Skip to content

Commit 644f382

Browse files
authored
Merge branch 'dev' into main
2 parents effe7d4 + 792c79b commit 644f382

File tree

89 files changed

+1878
-388
lines changed

Some content is hidden

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

89 files changed

+1878
-388
lines changed

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-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/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"agora-access-token": "^2.0.4",
3939
"agora-rtc-sdk-ng": "^4.19.0",
4040
"agora-rtm-sdk": "^1.5.1",
41-
"antd": "^5.12.5",
41+
"antd": "^5.13.2",
4242
"axios": "^1.6.2",
4343
"buffer": "^6.0.3",
4444
"clsx": "^2.0.0",

client/packages/lowcoder/src/components/PermissionDialog/Permission.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,10 +369,10 @@ const PermissionSelector = (props: {
369369
width: "fit-content",
370370
}}
371371
$isVisible={roleSelectVisible}
372-
bordered={false}
372+
variant="borderless"
373373
defaultValue={props.supportRoles[0]}
374374
optionLabelProp="label"
375-
onChange={(value) => setSelectRole(value)}
375+
onChange={(value: string) => setSelectRole(value as ApplicationRoleType)}
376376
>
377377
{props.supportRoles.map((role) => (
378378
<CustomSelect.Option key={role.value} value={role.value} label={role.label}>

client/packages/lowcoder/src/components/PermissionDialog/PermissionList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function PermissionLiItem(props: {
119119
width: "100px",
120120
}}
121121
defaultValue={permissionItem.role}
122-
bordered={false}
122+
variant="borderless"
123123
optionLabelProp="label"
124124
onSelect={(value: any, option: any) => {
125125
if (option.key === "delete") {

client/packages/lowcoder/src/comps/comps/buttonComp/dropdownComp.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,16 @@ const DropdownTmpComp = (function () {
8383
key: option.label + " - " + index,
8484
disabled: option.disabled,
8585
icon: hasIcon && <span>{option.prefixIcon}</span>,
86-
onEvent: option.onEvent,
86+
index,
8787
}));
8888

8989
const menu = (
9090
<Menu
9191
items={items}
92-
onClick={({ key }) => items.find((o) => o.key === key)?.onEvent("click")}
92+
onClick={({ key }) => {
93+
const item = items.find((o) => o.key === key);
94+
item && props.options[item.index]?.onEvent("click");
95+
}}
9396
/>
9497
);
9598

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/dateComp/dateRangeUIView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { omit } from "lodash";
1313

1414
const { RangePicker } = DatePicker;
1515

16-
const RangePickerStyled = styled((props: any) => <RangePicker {...props} />)<{ $style: DateTimeStyleType }>`
16+
const RangePickerStyled = styled(RangePicker)<{ $style: DateTimeStyleType }>`
1717
width: 100%;
1818
${(props) => props.$style && getStyle(props.$style)}
1919
`;

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: 19 additions & 12 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]
@@ -176,7 +177,10 @@ export function ListView(props: Props) {
176177
return <div key={itemIdx} style={{ flex: "auto" }}></div>;
177178
}
178179
const containerProps = containerFn(
179-
{ [itemIndexName]: itemIdx, [itemDataName]: getCurrentItemParams(data, itemIdx) },
180+
{
181+
[itemIndexName]: itemIdx,
182+
[itemDataName]: getCurrentItemParams(data, itemIdx)
183+
},
180184
String(itemIdx)
181185
).getView();
182186
const unMountFn = () => {
@@ -211,14 +215,17 @@ export function ListView(props: Props) {
211215
<BackgroundColorContext.Provider value={style.background}>
212216
<ListViewWrapper $style={style} $paddingWidth={paddingWidth}>
213217
<BodyWrapper ref={ref} $autoHeight={autoHeight}>
214-
<ReactResizeDetector
215-
onResize={(width?: number, height?: number) => {
216-
if (height) setListHeight(height);
217-
}}
218-
observerOptions={{ box: "border-box" }}
219-
>
220-
<div style={{ height: autoHeight ? "auto" : "100%" }}>{renders}</div>
221-
</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+
)}
222229
</BodyWrapper>
223230
<FooterWrapper>
224231
<Pagination size="small" itemRender={pageItemRender} {...pageInfo.pagination} />

0 commit comments

Comments
 (0)