Skip to content

Commit c7d4c9c

Browse files
committed
Fixed a Hook Function issue.
1 parent ba03d3b commit c7d4c9c

File tree

13 files changed

+38
-26
lines changed

13 files changed

+38
-26
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,14 @@ CandleStickChartTmpComp = withViewFn(CandleStickChartTmpComp, (comp) => {
140140
}, [onUIEvent]);
141141

142142
const echartsConfigChildren = _.omit(comp.children, echartsConfigOmitChildren);
143+
const childrenProps = childrenToProps(echartsConfigChildren);
143144
const option = useMemo(() => {
144145
return getEchartsConfig(
145-
childrenToProps(echartsConfigChildren) as ToViewReturn<typeof echartsConfigChildren>,
146+
childrenProps as ToViewReturn<typeof echartsConfigChildren>,
146147
chartSize,
147148
theme?.theme?.components?.candleStickChart || {},
148149
);
149-
}, [chartSize, ...Object.values(echartsConfigChildren)]);
150+
}, [theme, childrenProps, chartSize, ...Object.values(echartsConfigChildren)]);
150151

151152
useEffect(() => {
152153
comp.children.mapInstance.dispatch(changeValueAction(null, false))

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,14 @@ ChartTmpComp = withViewFn(ChartTmpComp, (comp) => {
156156
}, [mode, onUIEvent]);
157157

158158
const echartsConfigChildren = _.omit(comp.children, echartsConfigOmitChildren);
159+
const childrenProps = childrenToProps(echartsConfigChildren);
159160
const option = useMemo(() => {
160161
return getEchartsConfig(
161-
childrenToProps(echartsConfigChildren) as ToViewReturn<typeof echartsConfigChildren>,
162+
childrenProps as ToViewReturn<typeof echartsConfigChildren>,
162163
chartSize,
163164
themeConfig
164165
);
165-
}, [chartSize, ...Object.values(echartsConfigChildren)]);
166+
}, [theme, childrenProps, chartSize, ...Object.values(echartsConfigChildren)]);
166167

167168
const isMapScriptLoaded = useMemo(() => {
168169
return mapScriptLoaded || window?.google;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ MapTmpComp = withViewFn(MapTmpComp, (comp) => {
118118
const echartsConfigChildren = _.omit(comp.children, echartsConfigOmitChildren);
119119
const option = useMemo(() => {
120120
return getEchartsConfig(
121-
childrenToProps(echartsConfigChildren) as ToViewReturn<typeof echartsConfigChildren>,
121+
childrenProps as ToViewReturn<typeof echartsConfigChildren>,
122122
chartSize,
123123
theme?.theme?.components?.candleStickChart || {},
124124
);
125-
}, [chartSize, ...Object.values(echartsConfigChildren)]);
125+
}, [theme, childrenProps, chartSize, ...Object.values(echartsConfigChildren)]);
126126

127127
const isMapScriptLoaded = useMemo(() => {
128128
return mapScriptLoaded || window?.google;

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,14 @@ FunnelChartTmpComp = withViewFn(FunnelChartTmpComp, (comp) => {
141141
}, [onUIEvent]);
142142

143143
let echartsConfigChildren = _.omit(comp.children, echartsConfigOmitChildren);
144+
const childrenProps = childrenToProps(echartsConfigChildren);
144145
const option = useMemo(() => {
145146
return getEchartsConfig(
146-
childrenToProps(echartsConfigChildren) as ToViewReturn<typeof echartsConfigChildren>,
147+
childrenProps as ToViewReturn<typeof echartsConfigChildren>,
147148
chartSize,
148149
themeConfig,
149150
);
150-
}, [chartSize, ...Object.values(echartsConfigChildren), theme]);
151+
}, [theme, childrenProps, chartSize, ...Object.values(echartsConfigChildren)]);
151152

152153
useEffect(() => {
153154
comp.children.mapInstance.dispatch(changeValueAction(null, false))

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,14 @@ GaugeChartTmpComp = withViewFn(GaugeChartTmpComp, (comp) => {
142142
}, [onUIEvent]);
143143

144144
const echartsConfigChildren = _.omit(comp.children, echartsConfigOmitChildren);
145+
const childrenProps = childrenToProps(echartsConfigChildren);
145146
const option = useMemo(() => {
146147
return getEchartsConfig(
147-
childrenToProps(echartsConfigChildren) as ToViewReturn<typeof echartsConfigChildren>,
148+
childrenProps as ToViewReturn<typeof echartsConfigChildren>,
148149
chartSize,
149150
themeConfig
150151
);
151-
}, [chartSize, ...Object.values(echartsConfigChildren), theme]);
152+
}, [theme, childrenProps, chartSize, ...Object.values(echartsConfigChildren)]);
152153

153154
useEffect(() => {
154155
comp.children.mapInstance.dispatch(changeValueAction(null, false))

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,14 @@ GraphChartTmpComp = withViewFn(GraphChartTmpComp, (comp) => {
142142
}, [onUIEvent]);
143143

144144
const echartsConfigChildren = _.omit(comp.children, echartsConfigOmitChildren);
145+
const childrenProps = childrenToProps(echartsConfigChildren);
145146
const option = useMemo(() => {
146147
return getEchartsConfig(
147-
childrenToProps(echartsConfigChildren) as ToViewReturn<typeof echartsConfigChildren>,
148+
childrenProps as ToViewReturn<typeof echartsConfigChildren>,
148149
chartSize,
149150
themeConfig
150151
);
151-
}, [chartSize, ...Object.values(echartsConfigChildren)]);
152+
}, [theme, childrenProps, chartSize, ...Object.values(echartsConfigChildren)]);
152153

153154
useEffect(() => {
154155
comp.children.mapInstance.dispatch(changeValueAction(null, false))

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,14 @@ HeatmapChartTmpComp = withViewFn(HeatmapChartTmpComp, (comp) => {
141141
}, [onUIEvent]);
142142

143143
const echartsConfigChildren = _.omit(comp.children, echartsConfigOmitChildren);
144+
const childrenProps = childrenToProps(echartsConfigChildren);
144145
const option = useMemo(() => {
145146
return getEchartsConfig(
146-
childrenToProps(echartsConfigChildren) as ToViewReturn<typeof echartsConfigChildren>,
147+
childrenProps as ToViewReturn<typeof echartsConfigChildren>,
147148
chartSize,
148149
themeConfig
149150
);
150-
}, [chartSize, ...Object.values(echartsConfigChildren)]);
151+
}, [theme, childrenProps, chartSize, ...Object.values(echartsConfigChildren)]);
151152

152153
useEffect(() => {
153154
comp.children.mapInstance.dispatch(changeValueAction(null, false))

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,14 @@ RadarChartTmpComp = withViewFn(RadarChartTmpComp, (comp) => {
141141
}, [onUIEvent]);
142142

143143
const echartsConfigChildren = _.omit(comp.children, echartsConfigOmitChildren);
144+
const childrenProps = childrenToProps(echartsConfigChildren);
144145
const option = useMemo(() => {
145146
return getEchartsConfig(
146-
childrenToProps(echartsConfigChildren) as ToViewReturn<typeof echartsConfigChildren>,
147+
childrenProps as ToViewReturn<typeof echartsConfigChildren>,
147148
chartSize,
148149
themeConfig
149150
);
150-
}, [chartSize, ...Object.values(echartsConfigChildren)]);
151+
}, [theme, childrenProps, chartSize, ...Object.values(echartsConfigChildren)]);
151152

152153
useEffect(() => {
153154
comp.children.mapInstance.dispatch(changeValueAction(null, false))

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,14 @@ SankeyChartTmpComp = withViewFn(SankeyChartTmpComp, (comp) => {
141141
}, [onUIEvent]);
142142

143143
const echartsConfigChildren = _.omit(comp.children, echartsConfigOmitChildren);
144+
const childrenProps = childrenToProps(echartsConfigChildren);
144145
const option = useMemo(() => {
145146
return getEchartsConfig(
146-
childrenToProps(echartsConfigChildren) as ToViewReturn<typeof echartsConfigChildren>,
147+
childrenProps as ToViewReturn<typeof echartsConfigChildren>,
147148
chartSize,
148149
themeConfig
149150
);
150-
}, [chartSize, ...Object.values(echartsConfigChildren)]);
151+
}, [theme, childrenProps, chartSize, ...Object.values(echartsConfigChildren)]);
151152

152153
useEffect(() => {
153154
comp.children.mapInstance.dispatch(changeValueAction(null, false))

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,14 @@ SunburstChartTmpComp = withViewFn(SunburstChartTmpComp, (comp) => {
141141
}, [onUIEvent]);
142142

143143
const echartsConfigChildren = _.omit(comp.children, echartsConfigOmitChildren);
144+
const childrenProps = childrenToProps(echartsConfigChildren);
144145
const option = useMemo(() => {
145146
return getEchartsConfig(
146-
childrenToProps(echartsConfigChildren) as ToViewReturn<typeof echartsConfigChildren>,
147+
childrenProps as ToViewReturn<typeof echartsConfigChildren>,
147148
chartSize,
148149
themeConfig
149150
);
150-
}, [chartSize, ...Object.values(echartsConfigChildren)]);
151+
}, [theme, childrenProps, chartSize, ...Object.values(echartsConfigChildren)]);
151152

152153
useEffect(() => {
153154
comp.children.mapInstance.dispatch(changeValueAction(null, false))

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,14 @@ ThemeriverChartTmpComp = withViewFn(ThemeriverChartTmpComp, (comp) => {
141141
}, [onUIEvent]);
142142

143143
const echartsConfigChildren = _.omit(comp.children, echartsConfigOmitChildren);
144+
const childrenProps = childrenToProps(echartsConfigChildren);
144145
const option = useMemo(() => {
145146
return getEchartsConfig(
146-
childrenToProps(echartsConfigChildren) as ToViewReturn<typeof echartsConfigChildren>,
147+
childrenProps as ToViewReturn<typeof echartsConfigChildren>,
147148
chartSize,
148149
themeConfig
149150
);
150-
}, [chartSize, ...Object.values(echartsConfigChildren)]);
151+
}, [theme, childrenProps, chartSize, ...Object.values(echartsConfigChildren)]);
151152

152153
useEffect(() => {
153154
comp.children.mapInstance.dispatch(changeValueAction(null, false))

client/packages/lowcoder-comps/src/comps/treeChartComp/treechartComp.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,14 @@ TreeChartTmpComp = withViewFn(TreeChartTmpComp, (comp) => {
141141
}, [onUIEvent]);
142142

143143
const echartsConfigChildren = _.omit(comp.children, echartsConfigOmitChildren);
144+
const childrenProps = childrenToProps(echartsConfigChildren);
144145
const option = useMemo(() => {
145146
return getEchartsConfig(
146-
childrenToProps(echartsConfigChildren) as ToViewReturn<typeof echartsConfigChildren>,
147+
childrenProps as ToViewReturn<typeof echartsConfigChildren>,
147148
chartSize,
148149
themeConfig
149150
);
150-
}, [chartSize, ...Object.values(echartsConfigChildren)]);
151+
}, [theme, childrenProps, chartSize, ...Object.values(echartsConfigChildren)]);
151152

152153
useEffect(() => {
153154
comp.children.mapInstance.dispatch(changeValueAction(null, false))

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,14 @@ TreemapChartTmpComp = withViewFn(TreemapChartTmpComp, (comp) => {
141141
}, [onUIEvent]);
142142

143143
const echartsConfigChildren = _.omit(comp.children, echartsConfigOmitChildren);
144+
const childrenProps = childrenToProps(echartsConfigChildren);
144145
const option = useMemo(() => {
145146
return getEchartsConfig(
146-
childrenToProps(echartsConfigChildren) as ToViewReturn<typeof echartsConfigChildren>,
147+
childrenProps as ToViewReturn<typeof echartsConfigChildren>,
147148
chartSize,
148149
themeConfig
149150
);
150-
}, [chartSize, ...Object.values(echartsConfigChildren)]);
151+
}, [theme, childrenProps, chartSize, ...Object.values(echartsConfigChildren)]);
151152

152153
useEffect(() => {
153154
comp.children.mapInstance.dispatch(changeValueAction(null, false))

0 commit comments

Comments
 (0)