Skip to content

Commit 0191722

Browse files
authored
Merge pull request #1068 from lowcoder-org/dev
Dev > Main - for version 2.4.4
2 parents 9ab8650 + 38b391c commit 0191722

File tree

101 files changed

+1502
-436
lines changed

Some content is hidden

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

101 files changed

+1502
-436
lines changed

client/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.3
1+
2.4.4

client/packages/lowcoder-comps/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lowcoder-comps",
3-
"version": "2.4.8",
3+
"version": "2.4.9",
44
"type": "module",
55
"license": "MIT",
66
"dependencies": {
@@ -197,10 +197,10 @@
197197
}
198198
},
199199
"scripts": {
200-
"start": "NODE_OPTIONS=--max_old_space_size=6144 vite",
201-
"build": "yarn test && lowcoder-cli build",
202-
"build_only": "lowcoder-cli build",
203-
"build_publish": "lowcoder-cli build --publish",
200+
"start": "NODE_OPTIONS=--max_old_space_size=6442 vite",
201+
"build": "NODE_OPTIONS=--max_old_space_size=6442 yarn test && lowcoder-cli build",
202+
"build_only": "NODE_OPTIONS=--max_old_space_size=6442 lowcoder-cli build",
203+
"build_publish": "NODE_OPTIONS=--max_old_space_size=6442 lowcoder-cli build --publish",
204204
"test": "jest"
205205
},
206206
"devDependencies": {

client/packages/lowcoder-comps/src/comps/basicChartComp/chartComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ BasicChartTmpComp = withViewFn(BasicChartTmpComp, (comp) => {
7474
log.error('theme chart error: ', error);
7575
}
7676

77-
useMergeCompStyles(childrenToProps(comp.children), comp.dispatch);
77+
useMergeCompStyles?.(childrenToProps(comp.children), comp.dispatch);
7878

7979
const triggerClickEvent = async (dispatch: any, action: CompAction<JSONValue>) => {
8080
await getPromiseAfterDispatch(

client/packages/lowcoder-comps/src/comps/basicChartComp/chartConstants.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,16 +249,22 @@ export const chartUiModeChildren = {
249249
onUIEvent: eventHandlerControl(UIEventOptions),
250250
};
251251

252-
const chartJsonModeChildren = {
252+
let chartJsonModeChildren: any = {
253253
echartsOption: jsonControl(toObject, i18nObjs.defaultEchartsJsonOption),
254-
echartsTitle: withDefault(StringControl, trans("echarts.defaultTitle")),
254+
echartsTitle: withDefault(StringControl, trans("echarts.defaultTitle")),
255255
echartsLegendConfig: EchartsLegendConfig,
256256
echartsLabelConfig: EchartsLabelConfig,
257257
echartsConfig: EchartsOptionComp,
258-
style: styleControl(EchartsStyle, 'style'),
258+
// style: styleControl(EchartsStyle, 'style'),
259259
tooltip: withDefault(BoolControl, true),
260260
legendVisibility: withDefault(BoolControl, true),
261261
}
262+
if (EchartsStyle) {
263+
chartJsonModeChildren = {
264+
...chartJsonModeChildren,
265+
style: styleControl(EchartsStyle, 'style'),
266+
}
267+
}
262268

263269
const chartMapModeChildren = {
264270
mapInstance: stateComp(),

client/packages/lowcoder-comps/src/comps/calendarComp/calendarComp.tsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import {
3939
ThemeContext,
4040
CalendarStyle,
4141
DateParser,
42+
modalInstance,
4243
CustomModal,
4344
jsonValueExposingStateControl,
4445
CalendarDeleteIcon,
@@ -70,16 +71,13 @@ import {
7071
resourceTimeGridHeaderToolbar,
7172
} from "./calendarConstants";
7273

73-
// this should ensure backwards compatibility with older versions of the SDK
74-
const safeDragEventHandlerControl = typeof DragEventHandlerControl !== 'undefined' ? DragEventHandlerControl : () => {};
75-
76-
const childrenMap = {
74+
let childrenMap: any = {
7775
events: jsonValueExposingStateControl("events", defaultData),
7876
resourcesEvents: jsonValueExposingStateControl("resourcesEvents", resourcesEventsDefaultData),
7977
resources: jsonValueExposingStateControl("resources", resourcesDefaultData),
8078
resourceName: withDefault(StringControl, trans("calendar.resourcesDefault")),
8179
onEvent: ChangeEventHandlerControl,
82-
onDropEvent: safeDragEventHandlerControl,
80+
// onDropEvent: safeDragEventHandlerControl,
8381
editable: withDefault(BoolControl, true),
8482
showEventTime: withDefault(BoolControl, true),
8583
showWeekends: withDefault(BoolControl, true),
@@ -93,7 +91,13 @@ const childrenMap = {
9391
currentFreeView: dropdownControl(DefaultWithFreeViewOptions, "timeGridWeek"),
9492
currentPremiumView: dropdownControl(DefaultWithPremiumViewOptions, "resourceTimelineDay"),
9593
};
96-
94+
// this should ensure backwards compatibility with older versions of the SDK
95+
if (DragEventHandlerControl) {
96+
childrenMap = {
97+
...childrenMap,
98+
onDropEvent: DragEventHandlerControl,
99+
}
100+
}
97101
let CalendarBasicComp = (function () {
98102
return new UICompBuilder(childrenMap, (props: {
99103
events: any;
@@ -124,7 +128,7 @@ let CalendarBasicComp = (function () {
124128
const [left, setLeft] = useState<number | undefined>(undefined);
125129
const [licensed, setLicensed] = useState<boolean>(props.licenseKey !== "");
126130

127-
useMergeCompStyles(props, dispatch);
131+
useMergeCompStyles?.(props, dispatch);
128132

129133
useEffect(() => {
130134
setLicensed(props.licenseKey !== "");
@@ -326,6 +330,8 @@ let CalendarBasicComp = (function () {
326330
};
327331

328332
const showModal = (event: EventType, ifEdit: boolean) => {
333+
if (!modalInstance) return;
334+
329335
const modalTitle = ifEdit
330336
? trans("calendar.editEvent")
331337
: trans("calendar.creatEvent");

client/packages/lowcoder-comps/src/comps/candleStickChartComp/candleStickChartConstants.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,16 +247,22 @@ export const chartUiModeChildren = {
247247
onUIEvent: eventHandlerControl(UIEventOptions),
248248
};
249249

250-
const chartJsonModeChildren = {
250+
let chartJsonModeChildren: any = {
251251
echartsOption: jsonControl(toObject, i18nObjs.defaultCandleStickChartOption),
252252
echartsTitle: withDefault(StringControl, trans("candleStickChart.defaultTitle")),
253253
echartsLegendConfig: EchartsLegendConfig,
254254
echartsLabelConfig: EchartsLabelConfig,
255255
echartsConfig: EchartsOptionComp,
256-
style: styleControl(EchartsStyle, 'style'),
256+
// style: styleControl(EchartsStyle, 'style'),
257257
tooltip: withDefault(BoolControl, true),
258258
legendVisibility: withDefault(BoolControl, true),
259259
}
260+
if (EchartsStyle) {
261+
chartJsonModeChildren = {
262+
...chartJsonModeChildren,
263+
style: styleControl(EchartsStyle, 'style'),
264+
}
265+
}
260266

261267
const chartMapModeChildren = {
262268
mapInstance: stateComp(),

client/packages/lowcoder-comps/src/comps/candleStickChartComp/candleStickChartPropertyView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function candleStickChartPropertyView(
3838
{children.onEvent.propertyView()}
3939
</Section>
4040
<Section name={sectionNames.style}>
41-
{children.style.getPropertyView()}
41+
{children.style?.getPropertyView()}
4242
</Section>
4343
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
4444
</>

client/packages/lowcoder-comps/src/comps/chartComp/chartComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ ChartTmpComp = withViewFn(ChartTmpComp, (comp) => {
7878
}
7979

8080
const triggerClickEvent = async (dispatch: any, action: CompAction<JSONValue>) => {
81-
await getPromiseAfterDispatch(
81+
await getPromiseAfterDispatch?.(
8282
dispatch,
8383
action,
8484
{ autoHandleAfterReduce: true }

client/packages/lowcoder-comps/src/comps/funnelChartComp/funnelChartConstants.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,14 +248,14 @@ export const chartUiModeChildren = {
248248
onUIEvent: eventHandlerControl(UIEventOptions),
249249
};
250250

251-
const chartJsonModeChildren = {
251+
let chartJsonModeChildren: any = {
252252
echartsOption: jsonControl(toObject, i18nObjs.defaultFunnelChartOption),
253253
echartsTitle: withDefault(StringControl, trans("funnelChart.defaultTitle")),
254254
echartsLegendConfig: EchartsLegendConfig,
255255
echartsLabelConfig: EchartsLabelConfig,
256256
echartsConfig: EchartsOptionComp,
257257
echartsTitleConfig:EchartsTitleConfig,
258-
style: styleControl(EchartsStyle, 'style'),
258+
// style: styleControl(EchartsStyle, 'style'),
259259
tooltip: withDefault(BoolControl, true),
260260
label: withDefault(BoolControl, true),
261261
legendVisibility: withDefault(BoolControl, true),
@@ -267,6 +267,12 @@ const chartJsonModeChildren = {
267267
max:withDefault(NumberControl,trans('funnelChart.defaultMax')),
268268
gap:withDefault(NumberControl,trans('funnelChart.defaultGap'))
269269
}
270+
if (EchartsStyle) {
271+
chartJsonModeChildren = {
272+
...chartJsonModeChildren,
273+
style: styleControl(EchartsStyle, 'style'),
274+
}
275+
}
270276

271277
const chartMapModeChildren = {
272278
mapInstance: stateComp(),

client/packages/lowcoder-comps/src/comps/funnelChartComp/funnelChartPropertyView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function funnelChartPropertyView(
5050
{children.onEvent.propertyView()}
5151
</Section>
5252
<Section name={sectionNames.style}>
53-
{children.style.getPropertyView()}
53+
{children.style?.getPropertyView()}
5454
</Section>
5555
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
5656
</>

client/packages/lowcoder-comps/src/comps/gaugeChartComp/gaugeChartConstants.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,14 +248,14 @@ export const chartUiModeChildren = {
248248
onUIEvent: eventHandlerControl(UIEventOptions),
249249
};
250250

251-
const chartJsonModeChildren = {
251+
let chartJsonModeChildren: any = {
252252
echartsOption: jsonControl(toObject, i18nObjs.defaultGaugeChartOption),
253253
echartsTitle: withDefault(StringControl, trans("gaugeChart.defaultTitle")),
254254
echartsLegendConfig: EchartsLegendConfig,
255255
echartsLabelConfig: EchartsLabelConfig,
256256
echartsConfig: EchartsOptionComp,
257257
echartsTitleConfig:EchartsTitleConfig,
258-
style: styleControl(EchartsStyle, 'style'),
258+
// style: styleControl(EchartsStyle, 'style'),
259259
tooltip: withDefault(BoolControl, true),
260260
legendVisibility: withDefault(BoolControl, true),
261261
label: withDefault(BoolControl, true),
@@ -267,7 +267,12 @@ const chartJsonModeChildren = {
267267
max:withDefault(NumberControl,trans('gaugeChart.defaultMax')),
268268
gap:withDefault(NumberControl,trans('gaugeChart.defaultGap'))
269269
}
270-
270+
if (EchartsStyle) {
271+
chartJsonModeChildren = {
272+
...chartJsonModeChildren,
273+
style: styleControl(EchartsStyle, 'style'),
274+
}
275+
}
271276
const chartMapModeChildren = {
272277
mapInstance: stateComp(),
273278
getMapInstance: FunctionControl,

client/packages/lowcoder-comps/src/comps/gaugeChartComp/gaugeChartPropertyView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function gaugeChartPropertyView(
4646
{children.onEvent.propertyView()}
4747
</Section>
4848
<Section name={sectionNames.style}>
49-
{children.style.getPropertyView()}
49+
{children.style?.getPropertyView()}
5050
</Section>
5151
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
5252
</>

client/packages/lowcoder-comps/src/comps/graphChartComp/graphChartConstants.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,16 +247,22 @@ export const chartUiModeChildren = {
247247
onUIEvent: eventHandlerControl(UIEventOptions),
248248
};
249249

250-
const chartJsonModeChildren = {
250+
let chartJsonModeChildren: any = {
251251
echartsOption: jsonControl(toObject, i18nObjs.defaultGraphChartOption),
252252
echartsTitle: withDefault(StringControl, trans("graphChart.defaultTitle")),
253253
echartsLegendConfig: EchartsLegendConfig,
254254
echartsLabelConfig: EchartsLabelConfig,
255255
echartsConfig: EchartsOptionComp,
256-
style: styleControl(EchartsStyle, 'style'),
256+
// style: styleControl(EchartsStyle, 'style'),
257257
tooltip: withDefault(BoolControl, true),
258258
legendVisibility: withDefault(BoolControl, true),
259259
}
260+
if (EchartsStyle) {
261+
chartJsonModeChildren = {
262+
...chartJsonModeChildren,
263+
style: styleControl(EchartsStyle, 'style'),
264+
}
265+
}
260266

261267
const chartMapModeChildren = {
262268
mapInstance: stateComp(),

client/packages/lowcoder-comps/src/comps/graphChartComp/graphChartPropertyView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function graphChartPropertyView(
3838
{children.onEvent.propertyView()}
3939
</Section>
4040
<Section name={sectionNames.style}>
41-
{children.style.getPropertyView()}
41+
{children.style?.getPropertyView()}
4242
</Section>
4343
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
4444
</>

client/packages/lowcoder-comps/src/comps/heatmapChartComp/heatmapChartConstants.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,16 +247,22 @@ export const chartUiModeChildren = {
247247
onUIEvent: eventHandlerControl(UIEventOptions),
248248
};
249249

250-
const chartJsonModeChildren = {
250+
let chartJsonModeChildren: any = {
251251
echartsOption: jsonControl(toObject, i18nObjs.defaultHeatmapChartOption),
252252
echartsTitle: withDefault(StringControl, trans("heatmapChart.defaultTitle")),
253253
echartsLegendConfig: EchartsLegendConfig,
254254
echartsLabelConfig: EchartsLabelConfig,
255255
echartsConfig: EchartsOptionComp,
256-
style: styleControl(EchartsStyle, 'style'),
256+
// style: styleControl(EchartsStyle, 'style'),
257257
tooltip: withDefault(BoolControl, true),
258258
legendVisibility: withDefault(BoolControl, true),
259259
}
260+
if (EchartsStyle) {
261+
chartJsonModeChildren = {
262+
...chartJsonModeChildren,
263+
style: styleControl(EchartsStyle, 'style'),
264+
}
265+
}
260266

261267
const chartMapModeChildren = {
262268
mapInstance: stateComp(),

client/packages/lowcoder-comps/src/comps/heatmapChartComp/heatmapChartPropertyView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function heatmapChartPropertyView(
3838
{children.onEvent.propertyView()}
3939
</Section>
4040
<Section name={sectionNames.style}>
41-
{children.style.getPropertyView()}
41+
{children.style?.getPropertyView()}
4242
</Section>
4343
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
4444
</>

client/packages/lowcoder-comps/src/comps/radarChartComp/radarChartConstants.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,16 +247,22 @@ export const chartUiModeChildren = {
247247
onUIEvent: eventHandlerControl(UIEventOptions),
248248
};
249249

250-
const chartJsonModeChildren = {
250+
let chartJsonModeChildren: any = {
251251
echartsOption: jsonControl(toObject, i18nObjs.defaultRadarChartOption),
252252
echartsTitle: withDefault(StringControl, trans("radarChart.defaultTitle")),
253253
echartsLegendConfig: EchartsLegendConfig,
254254
echartsLabelConfig: EchartsLabelConfig,
255255
echartsConfig: EchartsOptionComp,
256-
style: styleControl(EchartsStyle, 'style'),
256+
// style: styleControl(EchartsStyle, 'style'),
257257
tooltip: withDefault(BoolControl, true),
258258
legendVisibility: withDefault(BoolControl, true),
259259
}
260+
if (EchartsStyle) {
261+
chartJsonModeChildren = {
262+
...chartJsonModeChildren,
263+
style: styleControl(EchartsStyle, 'style'),
264+
}
265+
}
260266

261267
const chartMapModeChildren = {
262268
mapInstance: stateComp(),

client/packages/lowcoder-comps/src/comps/radarChartComp/radarChartPropertyView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function radarChartPropertyView(
3838
{children.onEvent.propertyView()}
3939
</Section>
4040
<Section name={sectionNames.style}>
41-
{children.style.getPropertyView()}
41+
{children.style?.getPropertyView()}
4242
</Section>
4343
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
4444
</>

client/packages/lowcoder-comps/src/comps/sankeyChartComp/sankeyChartConstants.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,16 +247,22 @@ export const chartUiModeChildren = {
247247
onUIEvent: eventHandlerControl(UIEventOptions),
248248
};
249249

250-
const chartJsonModeChildren = {
250+
let chartJsonModeChildren: any = {
251251
echartsOption: jsonControl(toObject, i18nObjs.defaultSankeyChartOption),
252252
echartsTitle: withDefault(StringControl, trans("sankeyChart.defaultTitle")),
253253
echartsLegendConfig: EchartsLegendConfig,
254254
echartsLabelConfig: EchartsLabelConfig,
255255
echartsConfig: EchartsOptionComp,
256-
style: styleControl(EchartsStyle, 'style'),
256+
// style: styleControl(EchartsStyle, 'style'),
257257
tooltip: withDefault(BoolControl, true),
258258
legendVisibility: withDefault(BoolControl, true),
259259
}
260+
if (EchartsStyle) {
261+
chartJsonModeChildren = {
262+
...chartJsonModeChildren,
263+
style: styleControl(EchartsStyle, 'style'),
264+
}
265+
}
260266

261267
const chartMapModeChildren = {
262268
mapInstance: stateComp(),

client/packages/lowcoder-comps/src/comps/sankeyChartComp/sankeyChartPropertyView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export function sankeyChartPropertyView(
3939
{children.onEvent.propertyView()}
4040
</Section>
4141
<Section name={sectionNames.style}>
42-
{children.style.getPropertyView()}
42+
{children.style?.getPropertyView()}
4343
</Section>
4444
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
4545
</>

0 commit comments

Comments
 (0)