Skip to content

Commit a5f5919

Browse files
committed
pull from origin
2 parents abc37df + a739e2e commit a5f5919

Some content is hidden

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

51 files changed

+460
-65
lines changed

client/packages/lowcoder-core/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1777,7 +1777,7 @@ var CodeNode = /** @class */ (function (_super) {
17771777
return;
17781778
}
17791779
// wait for lazy loaded comps to load before executing query on page load
1780-
if (!Object.keys(value).length) {
1780+
if (!Object.keys(value).length && paths.size) {
17811781
isFetching_1 = true;
17821782
ready_1 = false;
17831783
}

client/packages/lowcoder-core/src/eval/codeNode.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export class CodeNode extends AbstractNode<ValueAndMsg<unknown>> {
173173
return;
174174
}
175175
// wait for lazy loaded comps to load before executing query on page load
176-
if (!Object.keys(value).length) {
176+
if (!Object.keys(value).length && paths.size) {
177177
isFetching = true;
178178
ready = false;
179179
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ export { ReactComponent as BorderRadiusIcon } from "./remix/rounded-corner.svg";
216216
export { ReactComponent as ShadowIcon } from "./remix/shadow-line.svg";
217217
export { ReactComponent as OpacityIcon } from "./remix/contrast-drop-2-line.svg";
218218
export { ReactComponent as AnimationIcon } from "./remix/loader-line.svg";
219+
export { ReactComponent as LineHeightIcon } from "./remix/line-height.svg";
219220

220221

221222
export { ReactComponent as LeftInfoLine } from "./remix/information-line.svg";

client/packages/lowcoder/src/api/commonSettingApi.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export interface ThemeDetail {
6262
animationDuration?: string;
6363
opacity?: string;
6464
boxShadow?: string;
65+
lineHeight?: string;
6566
boxShadowColor?: string;
6667
animationIterationCount?: string;
6768
components?: Record<string, JSONObject>;
@@ -83,6 +84,7 @@ export function getThemeDetailName(key: keyof ThemeDetail) {
8384
case "padding": return trans("style.padding");
8485
case "gridColumns": return trans("themeDetail.gridColumns");
8586
case "textSize": return trans("style.textSize");
87+
case "lineHeight": return trans("themeDetail.lineHeight");
8688
}
8789
return "";
8890
}
@@ -105,6 +107,7 @@ export function isThemeColorKey(key: string) {
105107
case "padding":
106108
case "gridColumns":
107109
case "textSize":
110+
case "lineHeight":
108111
return true;
109112
}
110113
return false;

client/packages/lowcoder/src/base/codeEditor/codeEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ function useCodeMirror(
224224
window.clearTimeout(isTypingRef.current);
225225
isTypingRef.current = window.setTimeout(() => (isTypingRef.current = 0), 100);
226226
onChange?.(state);
227-
}, 100)
227+
}, 1000)
228228
, [onChange]
229229
);
230230

client/packages/lowcoder/src/components/PageSkeleton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ export default function PageSkeleton(props: IProps) {
8383

8484
return (
8585
<Layout>
86-
{!hideHeader && isHeaderReady && (
86+
{/* {!hideHeader && isHeaderReady && (
8787
<Header
8888
headerStart={<StyledLogoWithName branding={true} />}
8989
style={{ backgroundColor: brandingConfig?.headerColor, ...props.headStyle }}
9090
/>
91-
)}
91+
)} */}
9292
<Layout>
9393
{!hideSideBar && <SideBar>{skeleton}</SideBar>}
9494
<MainContent>{!hideContent && skeleton}</MainContent>

client/packages/lowcoder/src/components/ThemeSettingsCompStyles.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
TextStyleIcon,
2626
ImageCompIconSmall,
2727
RotationIcon,
28+
LineHeightIcon
2829
} from "lowcoder-design/src/icons";
2930
import { trans } from "i18n";
3031
import { debounce } from "lodash";
@@ -375,6 +376,10 @@ export default function ThemeSettingsCompStyles(props: CompStyleProps) {
375376
icon = <RotationIcon style={{width: "16px", margin: "5px 0 0 5px", padding: "0px"}}/>;
376377
break;
377378
}
379+
case 'lineHeight': {
380+
icon = <LineHeightIcon style={{width: "16px", margin: "5px 0 0 5px", padding: "0px"}}/>;
381+
break;
382+
}
378383
}
379384
return icon;
380385
}

client/packages/lowcoder/src/components/ThemeSettingsSelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ export default function ThemeSettingsSelector(props: ColorConfigProps) {
381381
max={48} // Define the maximum value for the slider
382382
value={parseInt(gridColumns || "24")}
383383
onChange={(value) => setGridColumns(value.toString())}
384-
onAfterChange={(value) => gridColumnsInputBlur(value.toString())}
384+
onChangeComplete={(value) => gridColumnsInputBlur(value.toString())}
385385
/>
386386
</div>
387387
)}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export const Button100 = styled(Button)<{ $buttonStyle?: ButtonStyleType }>`
6565
overflow: hidden;
6666
text-overflow: ellipsis;
6767
}
68+
line-height:${(props) => props.$buttonStyle?.lineHeight};
6869
`;
6970

7071
export const ButtonCompWrapper = styled.div<{ disabled: boolean }>`

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ const LeftButtonWrapper = styled.div<{ $buttonStyle: DropdownStyleType }>`
6060
${(props) => `font-style: ${props.$buttonStyle.fontStyle};`}
6161
6262
width: 100%;
63+
line-height:${(props) => props.$buttonStyle.lineHeight};
6364
}
6465
6566
`;

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import { EditorContext } from "comps/editorState";
4141
import { disabledPropertyView, hiddenPropertyView } from "comps/utils/propertyUtils";
4242
import { DisabledContext } from "comps/generators/uiCompBuilder";
4343
import { useMergeCompStyles } from "@lowcoder-ee/util/hooks";
44+
import SliderControl from "@lowcoder-ee/comps/controls/sliderControl";
4445

4546
const ContainWrapper = styled.div<{
4647
$style: ContainerStyleType & {
@@ -90,6 +91,7 @@ const childrenMap = {
9091
0: { view: {}, layout: {} },
9192
1: { view: {}, layout: {} },
9293
}),
94+
horizontalGridCells: SliderControl,
9395
autoHeight: AutoHeightControl,
9496
matchColumnsHeight: withDefault(BoolControl, true),
9597
templateRows: withDefault(StringControl, "1fr"),
@@ -131,6 +133,7 @@ const ColumnLayout = (props: ColumnLayoutProps) => {
131133
templateColumns,
132134
columnGap,
133135
columnStyle,
136+
horizontalGridCells,
134137
} = props;
135138

136139
return (
@@ -161,6 +164,7 @@ const ColumnLayout = (props: ColumnLayoutProps) => {
161164
<ColumnContainer
162165
layout={containerProps.layout.getView()}
163166
items={gridItemCompToGridItems(containerProps.items.getView())}
167+
horizontalGridCells={horizontalGridCells}
164168
positionParams={containerProps.positionParams.getView()}
165169
dispatch={childDispatch}
166170
autoHeight={props.autoHeight}
@@ -206,6 +210,9 @@ export const ResponsiveLayoutBaseComp = (function () {
206210
<>
207211
<Section name={sectionNames.layout}>
208212
{children.autoHeight.getPropertyView()}
213+
{children.horizontalGridCells.propertyView({
214+
label: trans('prop.horizontalGridCells'),
215+
})}
209216
</Section>
210217
<Section name={trans("responsiveLayout.columnsLayout")}>
211218
{children.matchColumnsHeight.propertyView({ label: trans("responsiveLayout.matchColumnsHeight")

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ type ExtraProps = {
121121
isSelectable?: boolean;
122122
overflow?: string;
123123
enableGridLines?: boolean;
124+
horizontalGridCells?: number;
124125
onRowCountChange?: (rowHeight: number) => void;
125126
};
126127

@@ -338,6 +339,8 @@ export function InnerGrid(props: ViewPropsWithSelect) {
338339
enableGridLines,
339340
isRowCountLocked,
340341
} = props;
342+
const horizontalGridCells = props.horizontalGridCells ? String(props.horizontalGridCells) : undefined;
343+
const currentTheme = useContext(ThemeContext)?.theme;
341344
const [currentRowCount, setRowCount] = useState(rowCount || Infinity);
342345
const [currentRowHeight, setRowHeight] = useState(DEFAULT_ROW_HEIGHT);
343346
const editorState = useContext(EditorContext);
@@ -346,7 +349,8 @@ export function InnerGrid(props: ViewPropsWithSelect) {
346349
// Falk: TODO: Here we can define the inner grid columns dynamically
347350
//Added By Aqib Mirza
348351
const defaultGrid =
349-
useContext(ThemeContext)?.theme?.gridColumns ||
352+
horizontalGridCells ||
353+
currentTheme?.gridColumns ||
350354
defaultTheme?.gridColumns ||
351355
"12";
352356
/////////////////////

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ type ListItemProps = {
9898
itemIdx: number;
9999
offset: number;
100100
containerProps: ConstructorToView<typeof SimpleContainerComp>;
101+
horizontalGridCells?: number,
101102
autoHeight: boolean;
102103
scrollContainerRef?: RefObject<HTMLDivElement>;
103104
minHeight?: string;
@@ -117,7 +118,8 @@ function ListItem({
117118
containerProps,
118119
autoHeight,
119120
scrollContainerRef,
120-
minHeight
121+
minHeight,
122+
horizontalGridCells,
121123
} = props;
122124

123125
// disable the unmount function to save user's state with pagination
@@ -138,6 +140,7 @@ function ListItem({
138140
<ContainerInListView
139141
layout={containerProps.layout}
140142
items={gridItemCompToGridItems(containerProps.items)}
143+
horizontalGridCells={horizontalGridCells}
141144
positionParams={containerProps.positionParams}
142145
// all layout changes should only reflect on the commonContainer
143146
dispatch={itemIdx === offset ? containerProps.dispatch : _.noop}
@@ -186,6 +189,7 @@ export function ListView(props: Props) {
186189
() => getData(children.noOfRows.getView()),
187190
[children.noOfRows]
188191
);
192+
const horizontalGridCells = useMemo(() => children.horizontalGridCells.getView(), [children.horizontalGridCells]);
189193
const autoHeight = useMemo(() => children.autoHeight.getView(), [children.autoHeight]);
190194
const showHorizontalScrollbar = useMemo(() => children.showHorizontalScrollbar.getView(), [children.showHorizontalScrollbar]);
191195
const showVerticalScrollbar = useMemo(() => children.showVerticalScrollbar.getView(), [children.showVerticalScrollbar]);
@@ -261,6 +265,7 @@ export function ListView(props: Props) {
261265
itemIdx={itemIdx}
262266
offset={pageInfo.offset}
263267
containerProps={containerProps}
268+
horizontalGridCells={horizontalGridCells}
264269
autoHeight={isDragging || dynamicHeight}
265270
scrollContainerRef={ref}
266271
minHeight={minHeight}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import { ListView } from "./listView";
3939
import { listPropertyView } from "./listViewPropertyView";
4040
import { getData } from "./listViewUtils";
4141
import { withMethodExposing } from "comps/generators/withMethodExposing";
42+
import SliderControl from "@lowcoder-ee/comps/controls/sliderControl";
4243

4344
const childrenMap = {
4445
noOfRows: withIsLoadingMethod(NumberOrJSONObjectArrayControl), // FIXME: migrate "noOfRows" to "data"
@@ -51,6 +52,8 @@ const childrenMap = {
5152
autoHeight: AutoHeightControl,
5253
showVerticalScrollbar: withDefault(BoolControl, false),
5354
showHorizontalScrollbar: withDefault(BoolControl, false),
55+
horizontalGridCells: SliderControl,
56+
scrollbars: withDefault(BoolControl, false), //TOLOOK INTO
5457
showBorder: BoolControl,
5558
pagination: withDefault(PaginationControl, { pageSize: "6" }),
5659
style: styleControl(ListViewStyle, 'style'),

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ export function listPropertyView(compType: ListCompType) {
6161

6262
{(useContext(EditorContext).editorModeStatus === "layout" || useContext(EditorContext).editorModeStatus === "both") && (
6363
<><Section name={sectionNames.layout}>
64+
{children.horizontalGridCells.propertyView({
65+
label: trans('prop.horizontalGridCells'),
66+
})}
6467
{children.autoHeight.getPropertyView()}
6568
{(!children.autoHeight.getView()) && !children.horizontal.getView()&&
6669
children.showVerticalScrollbar.propertyView({

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ const getStyle = (style: InputLikeStyleType) => {
6060
return css`
6161
border-radius: ${style.radius};
6262
border-width:${style.borderWidth} !important;
63+
line-height: ${style.lineHeight} !important;
6364
// still use antd style when disabled
6465
&:not(.ant-input-number-disabled) {
6566
color: ${style.text};

client/packages/lowcoder/src/comps/comps/pageLayoutComp/pageLayout.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ export function PageLayout(props: LayoutProps & { siderCollapsed: boolean; setSi
128128
siderStyle,
129129
bodyStyle,
130130
footerStyle,
131+
horizontalGridCells,
131132
} = container;
132133

133134
const editorState = useContext(EditorContext);
@@ -171,6 +172,7 @@ export function PageLayout(props: LayoutProps & { siderCollapsed: boolean; setSi
171172
<SiderInnerGrid
172173
{...otherSiderProps}
173174
items={gridItemCompToGridItems(siderItems)}
175+
horizontalGridCells={horizontalGridCells}
174176
autoHeight={true}
175177
emptyRows={30}
176178
minHeight={`calc(100vh - ${style.padding}px)`}
@@ -196,6 +198,7 @@ export function PageLayout(props: LayoutProps & { siderCollapsed: boolean; setSi
196198
<HeaderInnerGrid
197199
{...otherHeaderProps}
198200
items={gridItemCompToGridItems(headerItems)}
201+
horizontalGridCells={horizontalGridCells}
199202
autoHeight={true}
200203
emptyRows={5}
201204
minHeight="46px"
@@ -223,6 +226,7 @@ export function PageLayout(props: LayoutProps & { siderCollapsed: boolean; setSi
223226
<SiderInnerGrid
224227
{...otherSiderProps}
225228
items={gridItemCompToGridItems(siderItems)}
229+
horizontalGridCells={horizontalGridCells}
226230
autoHeight={true}
227231
emptyRows={30}
228232
minHeight={`calc(100vh - ${style.padding}px)`}
@@ -256,6 +260,7 @@ export function PageLayout(props: LayoutProps & { siderCollapsed: boolean; setSi
256260
$showBorder={showHeader}
257261
{...otherBodyProps}
258262
items={gridItemCompToGridItems(bodyItems)}
263+
horizontalGridCells={horizontalGridCells}
259264
autoHeight={container.autoHeight}
260265
emptyRows={14}
261266
minHeight={showHeader ? "143px" : "142px"}
@@ -283,6 +288,7 @@ export function PageLayout(props: LayoutProps & { siderCollapsed: boolean; setSi
283288
<SiderInnerGrid
284289
{...otherSiderProps}
285290
items={gridItemCompToGridItems(siderItems)}
291+
horizontalGridCells={horizontalGridCells}
286292
autoHeight={true}
287293
emptyRows={30}
288294
minHeight={`calc(100vh - ${style.padding}px)`}
@@ -318,6 +324,7 @@ export function PageLayout(props: LayoutProps & { siderCollapsed: boolean; setSi
318324
$showBorder={showHeader}
319325
{...otherBodyProps}
320326
items={gridItemCompToGridItems(bodyItems)}
327+
horizontalGridCells={horizontalGridCells}
321328
autoHeight={container.autoHeight}
322329
emptyRows={14}
323330
minHeight={showHeader ? "143px" : "142px"}
@@ -337,6 +344,7 @@ export function PageLayout(props: LayoutProps & { siderCollapsed: boolean; setSi
337344
$showBorder={showHeader}
338345
{...otherFooterProps}
339346
items={gridItemCompToGridItems(footerItems)}
347+
horizontalGridCells={horizontalGridCells}
340348
autoHeight={true}
341349
emptyRows={5}
342350
minHeight={"48px"}
@@ -370,6 +378,7 @@ export function PageLayout(props: LayoutProps & { siderCollapsed: boolean; setSi
370378
<SiderInnerGrid
371379
{...otherSiderProps}
372380
items={gridItemCompToGridItems(siderItems)}
381+
horizontalGridCells={horizontalGridCells}
373382
autoHeight={true}
374383
emptyRows={30}
375384
minHeight={`calc(100vh - ${style.padding}px)`}

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { trans } from "i18n";
2929
import { ControlNode } from "lowcoder-design";
3030
import { StringControl } from "comps/controls/codeControl";
3131
import { useMergeCompStyles } from "@lowcoder-ee/util/hooks";
32+
import SliderControl from "@lowcoder-ee/comps/controls/sliderControl";
3233

3334
const childrenMap = {
3435
header: SimpleContainerComp,
@@ -49,6 +50,7 @@ const childrenMap = {
4950
siderWidth: withDefault(StringControl, "20%"),
5051
siderCollapsedWidth: withDefault(StringControl, "0"),
5152
showFooter: BoolControl,
53+
horizontalGridCells: SliderControl,
5254
autoHeight: AutoHeightControl,
5355
siderScrollbars: withDefault(BoolControl, false),
5456
contentScrollbars: withDefault(BoolControl, false),
@@ -134,7 +136,11 @@ export class PageLayoutComp extends layoutBaseComp implements IContainer {
134136
}
135137

136138
getPropertyView(): ControlNode {
137-
return [this.areaPropertyView(), this.heightPropertyView()];
139+
return [
140+
this.areaPropertyView(),
141+
this.gridPropertyView(),
142+
this.heightPropertyView(),
143+
];
138144
}
139145

140146
areaPropertyView() {
@@ -159,6 +165,14 @@ export class PageLayoutComp extends layoutBaseComp implements IContainer {
159165
];
160166
}
161167

168+
gridPropertyView() {
169+
return [
170+
this.children.horizontalGridCells.propertyView({
171+
label: trans('prop.horizontalGridCells'),
172+
}),
173+
]
174+
}
175+
162176
appSelectorPropertyView() {
163177
return [
164178
this.children.showApp.propertyView({ label: trans("prop.showApp"), tooltip: trans("prop.showAppTooltip") }),

0 commit comments

Comments
 (0)