Skip to content

Commit d2638c2

Browse files
authored
Merge branch 'dev' into autocomplete-input-resize
2 parents e77d063 + 0a65c47 commit d2638c2

File tree

41 files changed

+1123
-650
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1123
-650
lines changed

.DS_Store

-8 KB
Binary file not shown.

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,3 @@ client/node_modules/
99
client/packages/lowcoder-plugin-demo/.yarn/install-state.gz
1010
client/packages/lowcoder-plugin-demo/yarn.lock
1111
client/packages/lowcoder-plugin-demo/.yarn/cache/@types-node-npm-16.18.68-56f72825c0-094ae9ed80.zip
12-
.DS_Store
13-
.DS_Store

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lowcoder-root",
3-
"version": "2.2.0",
3+
"version": "2.3.0",
44
"type": "module",
55
"private": true,
66
"workspaces": [

client/packages/lowcoder-cli-template-typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"react-dom": "^18.2.0",
3333
"react-resize-detector": "^7.0.0",
3434
"typescript": "5.3.3",
35-
"vite": "^5.0.10"
35+
"vite": "^4.5.2"
3636
},
3737
"keywords": [
3838
"Lowcoder, Component, Template, Plugin, Demonstrator"

client/packages/lowcoder-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"react-dom": "^18.2.0",
3434
"react-json-view": "^1.21.3",
3535
"rollup-plugin-external-globals": "^0.7.1",
36-
"vite": "^4.3.9",
36+
"vite": "^4.5.2",
3737
"vite-plugin-css-injected-by-js": "^2.1.1",
3838
"vite-plugin-svgr": "^2.2.2"
3939
},

client/packages/lowcoder-comps/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
},
7070
"devDependencies": {
7171
"jest": "29.3.0",
72-
"vite": "^4.3.9",
72+
"vite": "^4.5.2",
7373
"vite-tsconfig-paths": "^3.6.0"
7474
}
7575
}

client/packages/lowcoder-core/lib/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ declare enum CompActionTypes {
454454
* broadcast other actions in comp tree structure.
455455
* used for encapsulate MultiBaseComp
456456
*/
457-
BROADCAST = "BROADCAST"
457+
BROADCAST = "BROADCAST",
458458
}
459459
type ExtraActionType = "layout" | "delete" | "add" | "modify" | "rename" | "recover" | "upgrade";
460460
type ActionExtraInfo = {

client/packages/lowcoder-design/src/icons/index.ts

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,9 @@ export { ReactComponent as ClickHouseIcon } from "./icon-query-ClickHouse.svg";
214214
export { ReactComponent as ResetIcon } from "./icon-style-reset.svg";
215215
export { ReactComponent as EditIcon } from "./icon-edit.svg";
216216
export { ReactComponent as EditableIcon } from "./icon-editable.svg";
217-
export { ReactComponent as LeftStateIcon } from "./icon-left-state.svg";
218-
export { ReactComponent as LeftSettingIcon } from "./icon-left-setting.svg";
217+
export { ReactComponent as LeftStateIcon } from "./remix/node-tree.svg";
218+
export { ReactComponent as LeftSettingIcon } from "./remix/tools-fill.svg";
219+
export { ReactComponent as LeftLayersIcon } from "./remix/stack-line.svg";
219220
export { ReactComponent as LeftHelpIcon } from "./icon-left-help.svg";
220221
export { ReactComponent as LeftPreloadIcon } from "./icon-left-preload.svg";
221222
export { ReactComponent as CollapsibleContainerCompIcon } from "./icon-collapsible-container.svg";
@@ -277,31 +278,37 @@ export { ReactComponent as SignatureIcon } from "./icon-signature.svg";
277278
export { ReactComponent as ManualIcon } from "./icon-manual.svg";
278279
export { ReactComponent as WarnIcon } from "./icon-warn.svg";
279280
export { ReactComponent as SyncManualIcon } from "./icon-sync-manual.svg";
280-
export { ReactComponent as DangerIcon } from "icons/icon-danger.svg";
281-
export { ReactComponent as TableMinusIcon } from "icons/icon-table-minus.svg";
282-
export { ReactComponent as TablePlusIcon } from "icons/icon-table-plus.svg";
283-
export { ReactComponent as MobileAppIcon } from "icons/icon-mobile-app.svg";
284-
export { ReactComponent as MobileNavIcon } from "icons/icon-navigation-mobile.svg";
285-
export { ReactComponent as PcNavIcon } from "icons/icon-navigation-pc.svg";
286-
export { ReactComponent as UnLockIcon } from "icons/icon-unlock.svg";
287-
export { ReactComponent as CalendarDeleteIcon } from "icons/icon-calendar-delete.svg";
288-
export { ReactComponent as TableCheckedIcon } from "icons/icon-table-checked.svg";
289-
export { ReactComponent as TableUnCheckedIcon } from "icons/icon-table-boolean-false.svg";
290-
export { ReactComponent as FileFolderIcon } from "icons/icon-editor-folder.svg";
291-
export { ReactComponent as ExpandIcon } from "icons/icon-expand.svg";
292-
export { ReactComponent as CompressIcon } from "icons/icon-compress.svg";
293-
export { ReactComponent as TableCellsIcon } from "icons/icon-table-cells.svg"; // Added By Aqib Mirza
294-
export { ReactComponent as TimeLineIcon } from "icons/icon-timeline-comp.svg"
295-
export { ReactComponent as LottieIcon } from "icons/icon-lottie.svg";
296-
export { ReactComponent as CommentIcon } from "icons/icon-comment-comp.svg";
297-
export { ReactComponent as MentionIcon } from "icons/icon-mention-comp.svg";
298-
export { ReactComponent as AutoCompleteCompIcon } from "icons/icon-autocomplete-comp.svg";
299-
export { ReactComponent as WidthIcon } from "icons/icon-width.svg";
300-
export { ReactComponent as ResponsiveLayoutCompIcon } from "icons/icon-responsive-layout-comp.svg";
281+
export { ReactComponent as DangerIcon } from "./icon-danger.svg";
282+
export { ReactComponent as TableMinusIcon } from "./icon-table-minus.svg";
283+
export { ReactComponent as TablePlusIcon } from "./icon-table-plus.svg";
284+
export { ReactComponent as MobileAppIcon } from "./icon-mobile-app.svg";
285+
export { ReactComponent as MobileNavIcon } from "./icon-navigation-mobile.svg";
286+
export { ReactComponent as PcNavIcon } from "./icon-navigation-pc.svg";
287+
export { ReactComponent as UnLockIcon } from "./icon-unlock.svg";
288+
export { ReactComponent as CalendarDeleteIcon } from "./icon-calendar-delete.svg";
289+
export { ReactComponent as TableCheckedIcon } from "./icon-table-checked.svg";
290+
export { ReactComponent as TableUnCheckedIcon } from "./icon-table-boolean-false.svg";
291+
export { ReactComponent as FileFolderIcon } from "./icon-editor-folder.svg";
292+
export { ReactComponent as ExpandIcon } from "./icon-expand.svg";
293+
export { ReactComponent as CompressIcon } from "./icon-compress.svg";
294+
export { ReactComponent as TableCellsIcon } from "./icon-table-cells.svg"; // Added By Aqib Mirza
295+
export { ReactComponent as TimeLineIcon } from "./icon-timeline-comp.svg"
296+
export { ReactComponent as LottieIcon } from "./icon-lottie.svg";
297+
export { ReactComponent as CommentIcon } from "./icon-comment-comp.svg";
298+
export { ReactComponent as MentionIcon } from "./icon-mention-comp.svg";
299+
export { ReactComponent as AutoCompleteCompIcon } from "./icon-autocomplete-comp.svg";
300+
export { ReactComponent as WidthIcon } from "./icon-width.svg";
301+
export { ReactComponent as ResponsiveLayoutCompIcon } from "./icon-responsive-layout-comp.svg";
301302
export { ReactComponent as TextSizeIcon } from "./remix/font-size-2.svg";
302303
export { ReactComponent as FontFamilyIcon } from "./remix/font-sans-serif.svg";
303304
export { ReactComponent as TextWeigthIcon } from "./remix/bold.svg";
304305
export { ReactComponent as BorderWidthIcon } from "./remix/expand-width-line.svg";
306+
export { ReactComponent as LeftInfoLine } from "./remix/information-line.svg";
307+
export { ReactComponent as LeftInfoFill } from "./remix/information-fill.svg";
308+
export { ReactComponent as LeftShow } from "./remix/eye-off-line.svg";
309+
export { ReactComponent as LeftHide } from "./remix/eye-line.svg";
310+
export { ReactComponent as LeftLock } from "./remix/lock-line.svg";
311+
export { ReactComponent as LeftUnlock } from "./remix/lock-unlock-line.svg";
305312

306313

307314
// new

client/packages/lowcoder-plugin-demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@
3535
"lowcoder-cli": "workspace:^",
3636
"lowcoder-sdk": "workspace:^",
3737
"typescript": "4.8.4",
38-
"vite": "^4.3.9"
38+
"vite": "^4.5.2"
3939
}
4040
}

client/packages/lowcoder-sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"rollup-plugin-terser": "^7.0.2",
4444
"rollup-plugin-typescript": "^1.0.1",
4545
"typescript": "^4.8.4",
46-
"vite": "^4.3.9",
46+
"vite": "^4.5.2",
4747
"vite-plugin-svgr": "^2.2.2",
4848
"vite-tsconfig-paths": "^3.6.0"
4949
},

client/packages/lowcoder/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
"http-proxy-middleware": "^2.0.6",
125125
"rollup-plugin-visualizer": "^5.9.2",
126126
"typescript": "^4.8.4",
127-
"vite": "^4.5.1",
127+
"vite": "^4.5.2",
128128
"vite-plugin-checker": "^0.5.1",
129129
"vite-plugin-html": "^3.2.0",
130130
"vite-plugin-svgr": "^2.2.2",

client/packages/lowcoder/src/comps/comps/containerComp/containerComp.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const ContainerBaseComp = (function () {
2424
return new ContainerCompBuilder(childrenMap, (props, dispatch) => {
2525
return (
2626
<DisabledContext.Provider value={props.disabled}>
27-
<TriContainer {...props} />
27+
<TriContainer {...props} />
2828
</DisabledContext.Provider>
2929
);
3030
})
@@ -78,6 +78,7 @@ function convertOldContainerParams(params: CompParams<any>) {
7878
// old params
7979
if (container && (container.hasOwnProperty("layout") || container.hasOwnProperty("items"))) {
8080
const autoHeight = tempParams.value.autoHeight;
81+
const scrollbars = tempParams.value.scrollbars;
8182
return {
8283
...tempParams,
8384
value: {
@@ -87,6 +88,7 @@ function convertOldContainerParams(params: CompParams<any>) {
8788
showBody: true,
8889
showFooter: false,
8990
autoHeight: autoHeight,
91+
scrollbars: scrollbars,
9092
},
9193
},
9294
};
@@ -123,7 +125,7 @@ export function defaultContainerData(
123125
layoutItem: {
124126
i: "",
125127
h: 5,
126-
w: 24,
128+
w: 12,
127129
x: 0,
128130
y: 0,
129131
},

client/packages/lowcoder/src/comps/comps/containerComp/containerView.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { hookCompCategory, HookCompType } from "comps/hooks/hookCompTypes";
55
import { UICompLayoutInfo, uiCompRegistry, UICompType } from "comps/uiCompRegistry";
66
import { genRandomKey } from "comps/utils/idGenerator";
77
import { parseCompType } from "comps/utils/remote";
8+
import { ScrollBar } from "lowcoder-design";
89
import {
910
DEFAULT_POSITION_PARAMS,
1011
draggingUtils,
@@ -102,6 +103,7 @@ type ExtraProps = {
102103
rowCount?: number;
103104
isRowCountLocked?: boolean;
104105
autoHeight?: boolean;
106+
scrollbars?: boolean;
105107
minHeight?: string;
106108
emptyRows?: number;
107109
extraHeight?: string;
@@ -230,14 +232,27 @@ const onDrop = (
230232
};
231233
const key = genRandomKey();
232234
const layoutItem = Object.values(items)[0];
235+
// calculate postion of newly added comp
236+
// should have last position in the comps list
237+
let itemPos = 0;
238+
if (!Object.keys(layout).length) {
239+
itemPos = 0;
240+
} else {
241+
itemPos = Math.max(...Object.values(layout).map(l => l.pos || 0)) + 1;
242+
}
233243
// log.debug("layout: onDrop. widgetValue: ", widgetValue, " layoutItem: ", layoutItem);
234244
dispatch(
235245
wrapActionExtraInfo(
236246
multiChangeAction({
237247
layout: changeValueAction(
238248
{
239249
...layout,
240-
[key]: { ...layoutItem, i: key, placeholder: undefined },
250+
[key]: {
251+
...layoutItem,
252+
i: key,
253+
placeholder: undefined,
254+
pos: itemPos,
255+
},
241256
},
242257
true
243258
),
@@ -463,6 +478,7 @@ export function InnerGrid(props: ViewPropsWithSelect) {
463478
layout={props.layout}
464479
extraLayout={extraLayout}
465480
onDropDragOver={(e) => {
481+
466482
const compType = draggingUtils.getData<UICompType>("compType");
467483
const compLayout = draggingUtils.getData<UICompLayoutInfo>("compLayout");
468484
if (compType) {

client/packages/lowcoder/src/comps/comps/gridLayoutComp/canvasView.tsx

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { defaultTheme } from "comps/controls/styleControlConstants";
1919
import { checkIsMobile } from "util/commonUtils";
2020
import { CanvasContainerID } from "constants/domLocators";
2121
import { CNRootContainer } from "constants/styleSelectors";
22+
import { ScrollBar } from "lowcoder-design";
2223

2324
const UICompContainer = styled.div<{ $maxWidth?: number; readOnly?: boolean; $bgColor: string }>`
2425
height: 100%;
@@ -112,17 +113,19 @@ export function CanvasView(props: ContainerBaseProps) {
112113
$bgColor={bgColor}
113114
>
114115
<div>
115-
<Profiler id="Panel" onRender={profilerCallback}>
116-
<InnerGrid
117-
containerPadding={rootContainerPadding}
118-
overflow={rootContainerOverflow}
119-
{...props}
120-
positionParams={positionParams} // Added By Aqib Mirza
121-
{...gridLayoutCanvasProps}
122-
bgColor={bgColor}
123-
radius="0px"
124-
/>
125-
</Profiler>
116+
{/* <ScrollBar style={{ height: "100%", margin: "0px", padding: "0px" }}> */}
117+
<Profiler id="Panel" onRender={profilerCallback}>
118+
<InnerGrid
119+
containerPadding={rootContainerPadding}
120+
overflow={rootContainerOverflow}
121+
{...props}
122+
positionParams={positionParams} // Added By Aqib Mirza
123+
{...gridLayoutCanvasProps}
124+
bgColor={bgColor}
125+
radius="0px"
126+
/>
127+
</Profiler>
128+
{/*</ScrollBar> */}
126129
</div>
127130
</UICompContainer>
128131
);

client/packages/lowcoder/src/comps/comps/listViewComp/listView.tsx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { EditorContext } from "comps/editorState";
33
import { BackgroundColorContext } from "comps/utils/backgroundColorContext";
44
import _ from "lodash";
55
import { ConstructorToView, deferAction } from "lowcoder-core";
6-
import { HintPlaceHolder, pageItemRender } from "lowcoder-design";
6+
import { HintPlaceHolder, ScrollBar, pageItemRender } from "lowcoder-design";
77
import { RefObject, useContext, useEffect, useMemo, useRef } from "react";
88
import ReactResizeDetector from "react-resize-detector";
99
import styled from "styled-components";
@@ -80,7 +80,7 @@ function ListItem(props: ListItemProps) {
8080
// }, []);
8181

8282
return (
83-
<ContainerInListView
83+
<ContainerInListView
8484
layout={containerProps.layout}
8585
items={gridItemCompToGridItems(containerProps.items)}
8686
positionParams={containerProps.positionParams}
@@ -95,7 +95,7 @@ function ListItem(props: ListItemProps) {
9595
scrollContainerRef={scrollContainerRef}
9696
overflow={"hidden"}
9797
minHeight={minHeight}
98-
enableGridLines={true}
98+
enableGridLines={true}
9999
/>
100100
);
101101
}
@@ -125,6 +125,7 @@ export function ListView(props: Props) {
125125
[children.noOfRows]
126126
);
127127
const autoHeight = useMemo(() => children.autoHeight.getView(), [children.autoHeight]);
128+
const scrollbars = useMemo(() => children.scrollbars.getView(), [children.scrollbars]);
128129
const noOfColumns = useMemo(
129130
() => Math.max(1, children.noOfColumns.getView()),
130131
[children.noOfColumns]
@@ -214,14 +215,17 @@ export function ListView(props: Props) {
214215
<BackgroundColorContext.Provider value={style.background}>
215216
<ListViewWrapper $style={style} $paddingWidth={paddingWidth}>
216217
<BodyWrapper ref={ref} $autoHeight={autoHeight}>
217-
<ReactResizeDetector
218-
onResize={(width?: number, height?: number) => {
219-
if (height) setListHeight(height);
220-
}}
221-
observerOptions={{ box: "border-box" }}
222-
>
223-
<div style={{ height: autoHeight ? "auto" : "100%" }}>{renders}</div>
224-
</ReactResizeDetector>
218+
{scrollbars ? (
219+
<ScrollBar style={{ height: autoHeight ? "auto" : "100%", margin: "0px", padding: "0px" }}>
220+
<>{<ReactResizeDetector onResize={(width?: number, height?: number) => { if (height) setListHeight(height); }} observerOptions={{ box: "border-box" }} >
221+
<div style={{ height: autoHeight ? "auto" : "100%" }}>{renders}</div>
222+
</ReactResizeDetector>}</>
223+
</ScrollBar>
224+
) : (
225+
<>{<ReactResizeDetector onResize={(width?: number, height?: number) => { if (height) setListHeight(height); }} observerOptions={{ box: "border-box" }} >
226+
<div style={{ height: autoHeight ? "auto" : "100%" }}>{renders}</div>
227+
</ReactResizeDetector>}</>
228+
)}
225229
</BodyWrapper>
226230
<FooterWrapper>
227231
<Pagination size="small" itemRender={pageItemRender} {...pageInfo.pagination} />

client/packages/lowcoder/src/comps/comps/listViewComp/listViewComp.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const childrenMap = {
4848
heightUnitOfRow: withDefault(NumberControl, 1),
4949
container: ContextContainerComp,
5050
autoHeight: AutoHeightControl,
51+
scrollbars: withDefault(BoolControl, false),
5152
showBorder: BoolControl,
5253
pagination: withDefault(PaginationControl, { pageSize: "6" }),
5354
style: styleControl(ListViewStyle),
@@ -172,12 +173,12 @@ ListViewPropertyComp = withExposingConfigs(ListViewPropertyComp, [
172173
return data;
173174
},
174175
}),
175-
// new CompDepsConfig(
176-
// "index",
177-
// (comp) => ({index: comp.children.itemIndexName.node() }),
178-
// (input) => input.index.value,
179-
// "index", // trans("listView.itemsDesc")
180-
// ),
176+
new CompDepsConfig(
177+
"pageNo",
178+
(comp) => ({index: comp.children.pagination.children.pageNo.exposingNode() }),
179+
(input) => input.index,
180+
"Page Number", // trans("listView.itemsDesc")
181+
),
181182
NameConfigHidden,
182183
]);
183184

client/packages/lowcoder/src/comps/comps/listViewComp/listViewPropertyView.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ListViewImplComp } from "./listViewComp";
44
import { ListCompType } from "./listViewUtils";
55
import { useContext } from "react";
66
import { EditorContext } from "comps/editorState";
7+
import { disabledPropertyView, hiddenPropertyView } from "comps/utils/propertyUtils";
78

89
type Props = {
910
comp: InstanceType<typeof ListViewImplComp>;
@@ -52,9 +53,20 @@ export function listPropertyView(compType: ListCompType) {
5253
</Section>
5354
)}
5455

56+
{(useContext(EditorContext).editorModeStatus === "logic" || useContext(EditorContext).editorModeStatus === "both") && (
57+
<Section name={sectionNames.interaction}>
58+
{hiddenPropertyView(children)}
59+
</Section>
60+
)}
61+
5562
{(useContext(EditorContext).editorModeStatus === "layout" || useContext(EditorContext).editorModeStatus === "both") && (
5663
<><Section name={sectionNames.layout}>
5764
{children.autoHeight.getPropertyView()}
65+
{!children.autoHeight.getView() &&
66+
children.scrollbars.propertyView({
67+
label: trans("prop.scrollbar"),
68+
}
69+
)}
5870
</Section>
5971
<Section name={sectionNames.style}>
6072
{children.style.getPropertyView()}

0 commit comments

Comments
 (0)