Skip to content

Commit e5f36ab

Browse files
authored
Merge pull request lowcoder-org#565 from lowcoder-org/dev
Dev -> Main - 2.2.0 hotfixes
2 parents 588093d + dcd674c commit e5f36ab

31 files changed

+307
-136
lines changed

‎client/.yarnrc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
nodeLinker: node-modules
22

3-
npmRegistryServer: "https://registry.npmmirror.com"
3+
npmRegistryServer: "https://registry.npmjs.org"
44

55
plugins:
66
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

‎client/config/test/jest.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import path from "node:path";
2-
import { buildVars } from "lowcoder-dev-utils/buildVars.js";
3-
import { currentDirName } from "lowcoder-dev-utils/util.js";
2+
import { buildVars } from "../../packages/lowcoder-dev-utils/buildVars.js";
3+
import { currentDirName } from "../../packages/lowcoder-dev-utils/util.js";
44

55
const globals = {};
66
buildVars.forEach(({ name, defaultValue }) => {

‎client/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "taco-fe",
3-
"version": "0.1.0",
2+
"name": "lowcoder-root",
3+
"version": "2.2.0",
44
"type": "module",
55
"private": true,
66
"workspaces": [

‎client/packages/create-lowcoder-plugin/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { spawn } from "cross-spawn";
55
import { writeFileSync, existsSync } from "node:fs";
66
import chalk from "chalk";
77
import { createCommand } from "commander";
8-
import { readJson, currentDirName } from "lowcoder-dev-utils/util.js";
8+
import { readJson, currentDirName } from "../lowcoder-dev-utils/util.js";
99

1010
const currentDir = currentDirName(import.meta.url);
1111
const pkg = readJson(path.resolve(currentDir, "./package.json"));

‎client/packages/lowcoder-cli/config/paths.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import path from "node:path";
22
import fs from "node:fs";
3-
import { currentDirName } from "lowcoder-dev-utils/util.js";
3+
import { currentDirName } from "../../lowcoder-dev-utils/util.js";
44

55
const currentDir = currentDirName(import.meta.url);
66
const appDirectory = fs.realpathSync(process.cwd());

‎client/packages/lowcoder-cli/config/vite.config.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import react from "@vitejs/plugin-react";
22
import svgrPlugin from "vite-plugin-svgr";
33
import global from "rollup-plugin-external-globals";
4-
import { buildVars } from "lowcoder-dev-utils/buildVars.js";
4+
import { buildVars } from "../../lowcoder-dev-utils/buildVars.js";
55
import injectCss from "vite-plugin-css-injected-by-js";
6-
import { getLibNames, getAllLibGlobalVarNames } from "lowcoder-dev-utils/external.js";
6+
import { getLibNames, getAllLibGlobalVarNames } from "../../lowcoder-dev-utils/external.js";
77
import paths from "./paths.js";
88
import { defineConfig } from "vite";
9-
import { readJson } from "lowcoder-dev-utils/util.js";
9+
import { readJson } from "../../lowcoder-dev-utils/util.js";
1010

1111
const isProduction = process.env.NODE_ENV === "production";
1212
const packageJson = readJson(paths.appPackageJson);

‎client/packages/lowcoder-dev-utils/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.0.6",
44
"license": "MIT",
55
"type": "module",
6+
"main": "external.js",
67
"description": "Lowcoder dev utils for lowcoder build process and lowcoder-cli",
78
"keywords": [
89
"lowcoder"

‎client/packages/lowcoder-plugin-demo/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { CompIDE } from "lowcoder-sdk";
33
import { name, version, lowcoder } from "./package.json";
44
import compMap from "./src/index";
55

6-
import "lowcoder-sdk/dist/style.css";
6+
import "../lowcoder-sdk/dist/style.css";
77

88
function CompDevApp() {
99
return (

‎client/packages/lowcoder-sdk/vite.config.mts

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import react from "@vitejs/plugin-react";
33
import viteTsconfigPaths from "vite-tsconfig-paths";
44
import svgrPlugin from "vite-plugin-svgr";
55
import path from "path";
6-
import { ensureLastSlash } from "lowcoder-dev-utils/util";
7-
import { buildVars } from "lowcoder-dev-utils/buildVars";
8-
import { globalDepPlugin } from "lowcoder-dev-utils/globalDepPlguin";
6+
import { ensureLastSlash } from "../lowcoder-dev-utils/util";
7+
import { buildVars } from "../lowcoder-dev-utils/buildVars";
8+
import { globalDepPlugin } from "../lowcoder-dev-utils/globalDepPlguin";
99

1010
const define = {};
1111
buildVars.forEach(({ name, defaultValue }) => {

‎client/packages/lowcoder/src/components/table/EditableCell.tsx

+8-14
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export interface CellProps {
3434
size?: string;
3535
candidateTags?: string[];
3636
candidateStatus?: { text: string; status: StatusType }[];
37+
textOverflow?: boolean;
3738
}
3839

3940
export type CellViewReturn = (props: CellProps) => ReactNode;
@@ -43,17 +44,6 @@ export type EditViewFn<T> = (props: {
4344
onChangeEnd: () => void;
4445
}) => ReactNode;
4546

46-
export const SizeWrapper = styled.div<{ $size?: string }>`
47-
${(props) =>
48-
props.$size &&
49-
`padding: ${
50-
props.$size === "small" ? "8.5px 8px" : props.$size === "large" ? "16.5px 16px" : "12.5px 8px"
51-
};
52-
line-height: 21px;
53-
min-height: ${props.$size === "small" ? "39px" : props.$size === "large" ? "55px" : "47px"};
54-
`}
55-
`;
56-
5747
const BorderDiv = styled.div`
5848
position: absolute;
5949
border: 1.5px solid #315efb;
@@ -127,11 +117,15 @@ export function EditableCell<T extends JSONValue>(props: EditableCellProps<T>) {
127117
}
128118

129119
return (
130-
<ColumnTypeView>
120+
<ColumnTypeView
121+
textOverflow={props.textOverflow}
122+
>
131123
{status === "toSave" && !isEditing && <EditableChip />}
132-
<SizeWrapper $size={props.size} onDoubleClick={enterEditFn}>
124+
<div
125+
onDoubleClick={enterEditFn}
126+
>
133127
{normalView}
134-
</SizeWrapper>
128+
</div>
135129
</ColumnTypeView>
136130
);
137131
}

‎client/packages/lowcoder/src/components/table/columnTypeView.tsx

+17-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
import React, { useEffect, useMemo, useRef, useState } from "react";
22
import styled from "styled-components";
33

4-
const ColumnTypeViewWrapper = styled.div`
5-
div {
6-
overflow: hidden;
7-
white-space: nowrap;
8-
text-overflow: ellipsis;
9-
word-break: keep-all;
10-
}
4+
const ColumnTypeViewWrapper = styled.div<{
5+
textOverflow?: boolean
6+
}>`
7+
${props => !props.textOverflow && `
8+
div {
9+
overflow: hidden;
10+
white-space: nowrap;
11+
text-overflow: ellipsis;
12+
word-break: keep-all;
13+
}
14+
`}
1115
`;
1216

1317
const ColumnTypeHoverView = styled.div<{
@@ -62,7 +66,10 @@ function childIsOverflow(nodes: HTMLCollection): boolean {
6266
return false;
6367
}
6468

65-
export default function ColumnTypeView(props: { children: React.ReactNode }) {
69+
export default function ColumnTypeView(props: {
70+
children: React.ReactNode,
71+
textOverflow?: boolean,
72+
}) {
6673
const wrapperRef = useRef<HTMLDivElement>(null);
6774
const hoverViewRef = useRef<HTMLDivElement>(null);
6875
const [isHover, setIsHover] = useState(false);
@@ -161,6 +168,7 @@ export default function ColumnTypeView(props: { children: React.ReactNode }) {
161168
<>
162169
<ColumnTypeViewWrapper
163170
ref={wrapperRef}
171+
textOverflow={props.textOverflow}
164172
onMouseEnter={() => {
165173
delayMouseEnter();
166174
}}
@@ -171,7 +179,7 @@ export default function ColumnTypeView(props: { children: React.ReactNode }) {
171179
>
172180
{props.children}
173181
</ColumnTypeViewWrapper>
174-
{isHover && hasOverflow && wrapperRef.current && (
182+
{isHover && hasOverflow && wrapperRef.current && !props.textOverflow && (
175183
<ColumnTypeHoverView
176184
ref={hoverViewRef}
177185
visible={adjustedPosition.done}

‎client/packages/lowcoder/src/comps/comps/tableComp/column/tableColumnComp.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { ColumnTypeComp, ColumnTypeCompMap } from "./columnTypeComp";
2626
import { ColorControl } from "comps/controls/colorControl";
2727
import { JSONValue } from "util/jsonTypes";
2828
import styled from "styled-components";
29+
import { TextOverflowControl } from "comps/controls/textOverflowControl";
2930

3031
export type Render = ReturnType<ConstructorToComp<typeof RenderComp>["getOriginalComp"]>;
3132
export const RenderComp = withSelectedMultiContext(ColumnTypeComp);
@@ -103,7 +104,8 @@ export const columnChildrenMap = {
103104
borderWidth: withDefault(RadiusControl, ""),
104105
radius: withDefault(RadiusControl, ""),
105106
textSize: withDefault(RadiusControl, ""),
106-
cellColor: CellColorComp,
107+
cellColor: CellColorComp,
108+
textOverflow: withDefault(TextOverflowControl, "ellipsis"),
107109
};
108110

109111
const StyledIcon = styled.span`
@@ -228,6 +230,7 @@ export class ColumnComp extends ColumnInitComp {
228230
preInputNode: <StyledIcon as={TextSizeIcon} title="" />,
229231
placeholder: '14px',
230232
})}
233+
{this.children.textOverflow.getPropertyView()}
231234
{this.children.cellColor.getPropertyView()}
232235
</>
233236
);

‎client/packages/lowcoder/src/comps/comps/tableComp/tableComp.tsx

+12-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import { lastValueIfEqual, shallowEqual } from "util/objectUtils";
5151
import { IContainer } from "../containerBase";
5252
import { getSelectedRowKeys } from "./selectionControl";
5353
import { compTablePropertyView } from "./tablePropertyView";
54-
import { RowColorComp, TableChildrenView, TableInitComp } from "./tableTypes";
54+
import { RowColorComp, RowHeightComp, TableChildrenView, TableInitComp } from "./tableTypes";
5555

5656
import { useContext } from "react";
5757
import { EditorContext } from "comps/editorState";
@@ -196,6 +196,17 @@ export class TableImplComp extends TableInitComp implements IContainer {
196196
})
197197
)
198198
);
199+
comp = comp.setChild(
200+
"rowHeight",
201+
comp.children.rowHeight.reduce(
202+
RowHeightComp.changeContextDataAction({
203+
currentRow: nextRowExample,
204+
currentIndex: 0,
205+
currentOriginalIndex: 0,
206+
columnTitle: nextRowExample ? Object.keys(nextRowExample)[0] : undefined,
207+
})
208+
)
209+
);
199210
}
200211

201212
if (dataChanged) {

0 commit comments

Comments
 (0)