Skip to content

Commit fc9350d

Browse files
authored
Merge pull request #1016 from lowcoder-org/dev
Dev > Main for Release v2.4.2
2 parents b9285dd + 7c772b8 commit fc9350d

File tree

276 files changed

+10320
-4985
lines changed

Some content is hidden

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

276 files changed

+10320
-4985
lines changed

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ 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
1212
application-dev.yml
13-
server/api-service/lowcoder-server/src/main/resources/application-lowcoder.yml
14-
server/api-service/lowcoder-server/src/main/resources/application-debug.yaml
13+
application-lowcoder.yml
14+
application-debug.yaml
15+
application-dev-localhost.yaml
1516
.vscode/settings.json
16-
.vscode/launch.json
17-
server/api-service/lowcoder-server/src/main/resources/application-dev-localhost.yaml
17+
.vscode/launch.json

client/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.1
1+
2.4.2

client/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
"chalk": "4",
8181
"flag-icons": "^7.2.1",
8282
"number-precision": "^1.6.0",
83+
"posthog-js": "^1.144.2",
8384
"react-countup": "^6.5.3",
8485
"react-player": "^2.11.0",
8586
"resize-observer-polyfill": "^1.5.1",

client/packages/lowcoder-comps/package.json

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -34,30 +34,6 @@
3434
"lowcoder": {
3535
"description": "",
3636
"comps": {
37-
"meetingController": {
38-
"name": "Agora Meeting Controller",
39-
"icon": "./icons/icon-comp-calendar.svg",
40-
"layoutInfo": {
41-
"w": 1,
42-
"h": 1
43-
}
44-
},
45-
"meetingSharing": {
46-
"name": "Agora Meeting Sharing",
47-
"icon": "./icons/icon-comp-calendar.svg",
48-
"layoutInfo": {
49-
"w": 6,
50-
"h": 40
51-
}
52-
},
53-
"meetingStream": {
54-
"name": "Video Stream",
55-
"icon": "./icons/icon-comp-calendar.svg",
56-
"layoutInfo": {
57-
"w": 6,
58-
"h": 40
59-
}
60-
},
6137
"calendar": {
6238
"name": "Calendar",
6339
"icon": "./icons/icon-comp-calendar.svg",
@@ -193,6 +169,30 @@
193169
"w": 19,
194170
"h": 60
195171
}
172+
},
173+
"meetingController": {
174+
"name": "Agora Meeting Controller",
175+
"icon": "./icons/icon-comp-calendar.svg",
176+
"layoutInfo": {
177+
"w": 1,
178+
"h": 1
179+
}
180+
},
181+
"meetingSharing": {
182+
"name": "Agora Meeting Sharing",
183+
"icon": "./icons/icon-comp-calendar.svg",
184+
"layoutInfo": {
185+
"w": 6,
186+
"h": 40
187+
}
188+
},
189+
"meetingStream": {
190+
"name": "Video Stream",
191+
"icon": "./icons/icon-comp-calendar.svg",
192+
"layoutInfo": {
193+
"w": 6,
194+
"h": 40
195+
}
196196
}
197197
}
198198
},

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ import {
2525
ThemeContext,
2626
chartColorPalette,
2727
getPromiseAfterDispatch,
28-
dropdownControl
28+
dropdownControl,
29+
useMergeCompStyles,
2930
} from "lowcoder-sdk";
3031
import { getEchartsLocale, trans } from "i18n/comps";
3132
import { ItemColorComp } from "comps/chartComp/chartConfigs/lineChartConfig";
@@ -73,6 +74,8 @@ BasicChartTmpComp = withViewFn(BasicChartTmpComp, (comp) => {
7374
log.error('theme chart error: ', error);
7475
}
7576

77+
useMergeCompStyles(childrenToProps(comp.children), comp.dispatch);
78+
7679
const triggerClickEvent = async (dispatch: any, action: CompAction<JSONValue>) => {
7780
await getPromiseAfterDispatch(
7881
dispatch,
@@ -123,7 +126,8 @@ BasicChartTmpComp = withViewFn(BasicChartTmpComp, (comp) => {
123126
const option = useMemo(() => {
124127
return getEchartsConfig(
125128
childrenToProps(echartsConfigChildren) as ToViewReturn<typeof echartsConfigChildren>,
126-
chartSize
129+
chartSize,
130+
theme?.theme?.components?.candleStickChart || {},
127131
);
128132
}, [chartSize, ...Object.values(echartsConfigChildren)]);
129133

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,11 @@ export const chartUiModeChildren = {
251251

252252
const chartJsonModeChildren = {
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),
258+
style: styleControl(EchartsStyle, 'style'),
259259
tooltip: withDefault(BoolControl, true),
260260
legendVisibility: withDefault(BoolControl, true),
261261
}

client/packages/lowcoder-comps/src/comps/basicChartComp/chartUtils.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,17 +128,21 @@ export function getSeriesConfig(props: EchartsConfigProps) {
128128
}
129129

130130
// https://echarts.apache.org/en/option.html
131-
export function getEchartsConfig(props: EchartsConfigProps, chartSize?: ChartSize): EChartsOptionWithMap {
131+
export function getEchartsConfig(
132+
props: EchartsConfigProps,
133+
chartSize?: ChartSize,
134+
theme?: any,
135+
): EChartsOptionWithMap {
132136
if (props.mode === "json") {
133137
let opt={
134138
"title": {
135139
"text": props.echartsTitle,
136140
'top': props.echartsLegendConfig.top === 'bottom' ?'top':'bottom',
137141
"left":"center"
138142
},
139-
"backgroundColor": props?.style?.background,
140-
"color": props.echartsOption.data?.map(data => data.color),
141-
"tooltip": props.tooltip&&{
143+
"backgroundColor": props?.style?.background || theme?.style?.background,
144+
"color": props.echartsOption.data?.map(data => data.color),
145+
"tooltip": props.tooltip && {
142146
"trigger": "item",
143147
"formatter": "{a} <br/>{b} : {c}%"
144148
},

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ import {
4242
CustomModal,
4343
jsonValueExposingStateControl,
4444
CalendarDeleteIcon,
45-
Tooltip
45+
Tooltip,
46+
useMergeCompStyles,
4647
} from "lowcoder-sdk";
4748

4849
import {
@@ -87,7 +88,7 @@ const childrenMap = {
8788
firstDay: dropdownControl(FirstDayOptions, "1"),
8889
dayMaxEvents: withDefault(NumberControl, 2),
8990
eventMaxStack: withDefault(NumberControl, 0),
90-
style: styleControl(CalendarStyle),
91+
style: styleControl(CalendarStyle, 'style'),
9192
licenseKey: withDefault( StringControl, "" ),
9293
currentFreeView: dropdownControl(DefaultWithFreeViewOptions, "timeGridWeek"),
9394
currentPremiumView: dropdownControl(DefaultWithPremiumViewOptions, "resourceTimelineDay"),
@@ -114,7 +115,7 @@ let CalendarBasicComp = (function () {
114115
licensed?: boolean;
115116
currentFreeView?: string;
116117
currentPremiumView?: string;
117-
}) => {
118+
}, dispatch: any) => {
118119

119120
const theme = useContext(ThemeContext);
120121
const ref = createRef<HTMLDivElement>();
@@ -123,15 +124,15 @@ let CalendarBasicComp = (function () {
123124
const [left, setLeft] = useState<number | undefined>(undefined);
124125
const [licensed, setLicensed] = useState<boolean>(props.licenseKey !== "");
125126

127+
useMergeCompStyles(props, dispatch);
128+
126129
useEffect(() => {
127130
setLicensed(props.licenseKey !== "");
128131
}, [props.licenseKey]);
129132

130133
let currentView = licensed ? props.currentPremiumView : props.currentFreeView;
131134
let currentEvents = currentView == "resourceTimelineDay" || currentView == "resourceTimeGridDay" ? props.resourcesEvents : props.events;
132135

133-
console.log("currentEvents", currentEvents);
134-
135136
// we use one central stack of events for all views
136137
let events = Array.isArray(currentEvents.value) ? currentEvents.value.map((item: EventType) => {
137138
return {

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ import {
2424
ThemeContext,
2525
chartColorPalette,
2626
getPromiseAfterDispatch,
27-
dropdownControl
27+
dropdownControl,
28+
useMergeCompStyles,
2829
} from "lowcoder-sdk";
2930
import { getEchartsLocale, trans } from "i18n/comps";
3031
import { ItemColorComp } from "comps/chartComp/chartConfigs/lineChartConfig";
@@ -63,14 +64,15 @@ CandleStickChartTmpComp = withViewFn(CandleStickChartTmpComp, (comp) => {
6364
color: chartColorPalette,
6465
backgroundColor: "#fff",
6566
};
66-
6767
let themeConfig = defaultChartTheme;
6868
try {
6969
themeConfig = theme?.theme.chart ? JSON.parse(theme?.theme.chart) : defaultChartTheme;
7070
} catch (error) {
7171
log.error('theme chart error: ', error);
7272
}
7373

74+
useMergeCompStyles(childrenToProps(comp.children), comp.dispatch);
75+
7476
const triggerClickEvent = async (dispatch: any, action: CompAction<JSONValue>) => {
7577
await getPromiseAfterDispatch(
7678
dispatch,
@@ -144,7 +146,8 @@ CandleStickChartTmpComp = withViewFn(CandleStickChartTmpComp, (comp) => {
144146
const option = useMemo(() => {
145147
return getEchartsConfig(
146148
childrenToProps(echartsConfigChildren) as ToViewReturn<typeof echartsConfigChildren>,
147-
chartSize
149+
chartSize,
150+
theme?.theme?.components?.candleStickChart || {},
148151
);
149152
}, [chartSize, ...Object.values(echartsConfigChildren)]);
150153

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ const chartJsonModeChildren = {
253253
echartsLegendConfig: EchartsLegendConfig,
254254
echartsLabelConfig: EchartsLabelConfig,
255255
echartsConfig: EchartsOptionComp,
256-
style: styleControl(EchartsStyle),
256+
style: styleControl(EchartsStyle, 'style'),
257257
tooltip: withDefault(BoolControl, true),
258258
legendVisibility: withDefault(BoolControl, true),
259259
}

client/packages/lowcoder-comps/src/comps/candleStickChartComp/candleStickChartUtils.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { chartColorPalette, isNumeric, JSONObject, loadScript } from "lowcoder-s
1212
import { calcXYConfig } from "comps/chartComp/chartConfigs/cartesianAxisConfig";
1313
import Big from "big.js";
1414
import { googleMapsApiUrl } from "../chartComp/chartConfigs/chartUrls";
15+
import { useContext } from "react";
1516

1617
export function transformData(
1718
originData: JSONObject[],
@@ -128,15 +129,19 @@ export function getSeriesConfig(props: EchartsConfigProps) {
128129
}
129130

130131
// https://echarts.apache.org/en/option.html
131-
export function getEchartsConfig(props: EchartsConfigProps, chartSize?: ChartSize): EChartsOptionWithMap {
132+
export function getEchartsConfig(
133+
props: EchartsConfigProps,
134+
chartSize?: ChartSize,
135+
theme?: any,
136+
): EChartsOptionWithMap {
132137
if (props.mode === "json") {
133138
let opt={
134139
"title": {
135140
"text": props.echartsTitle,
136141
'top': props.echartsLegendConfig.top === 'bottom' ?'top':'bottom',
137142
"left":"center"
138143
},
139-
"backgroundColor": props?.style?.background,
144+
"backgroundColor": props?.style?.background || theme?.style?.background,
140145
"color": props.echartsOption.data?.map(data => data.color),
141146
"tooltip": props.tooltip&&{
142147
"trigger": "axis",

client/packages/lowcoder-comps/src/comps/chartComp/chartUtils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,11 @@ export function getSeriesConfig(props: EchartsConfigProps) {
128128
}
129129

130130
// https://echarts.apache.org/en/option.html
131-
export function getEchartsConfig(props: EchartsConfigProps, chartSize?: ChartSize): EChartsOptionWithMap {
131+
export function getEchartsConfig(
132+
props: EchartsConfigProps,
133+
chartSize?: ChartSize,
134+
theme?: any,
135+
): EChartsOptionWithMap {
132136
if (props.mode === "json") {
133137
return props.echartsOption ? props.echartsOption : {};
134138
}

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ import {
2525
ThemeContext,
2626
chartColorPalette,
2727
getPromiseAfterDispatch,
28-
dropdownControl
28+
dropdownControl,
29+
useMergeCompStyles,
2930
} from "lowcoder-sdk";
3031
import { getEchartsLocale, trans } from "i18n/comps";
3132
import { ItemColorComp } from "comps/basicChartComp/chartConfigs/lineChartConfig";
@@ -82,6 +83,8 @@ MapTmpComp = withViewFn(MapTmpComp, (comp) => {
8283
log.error('theme chart error: ', error);
8384
}
8485

86+
useMergeCompStyles(childrenToProps(comp.children), comp.dispatch);
87+
8588
const triggerClickEvent = async (dispatch: any, action: CompAction<JSONValue>) => {
8689
await getPromiseAfterDispatch(
8790
dispatch,
@@ -119,7 +122,8 @@ MapTmpComp = withViewFn(MapTmpComp, (comp) => {
119122
const option = useMemo(() => {
120123
return getEchartsConfig(
121124
childrenToProps(echartsConfigChildren) as ToViewReturn<typeof echartsConfigChildren>,
122-
chartSize
125+
chartSize,
126+
theme?.theme?.components?.candleStickChart || {},
123127
);
124128
}, [chartSize, ...Object.values(echartsConfigChildren)]);
125129

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ import {
2424
ThemeContext,
2525
chartColorPalette,
2626
getPromiseAfterDispatch,
27-
dropdownControl
27+
dropdownControl,
28+
useMergeCompStyles,
2829
} from "lowcoder-sdk";
2930
import { getEchartsLocale, trans } from "i18n/comps";
3031
import { ItemColorComp } from "comps/chartComp/chartConfigs/lineChartConfig";
@@ -71,6 +72,8 @@ FunnelChartTmpComp = withViewFn(FunnelChartTmpComp, (comp) => {
7172
log.error('theme chart error: ', error);
7273
}
7374

75+
useMergeCompStyles(childrenToProps(comp.children), comp.dispatch);
76+
7477
const triggerClickEvent = async (dispatch: any, action: CompAction<JSONValue>) => {
7578
await getPromiseAfterDispatch(
7679
dispatch,
@@ -144,7 +147,8 @@ FunnelChartTmpComp = withViewFn(FunnelChartTmpComp, (comp) => {
144147
const option = useMemo(() => {
145148
return getEchartsConfig(
146149
childrenToProps(echartsConfigChildren) as ToViewReturn<typeof echartsConfigChildren>,
147-
chartSize
150+
chartSize,
151+
theme?.theme?.components?.candleStickChart || {},
148152
);
149153
}, [chartSize, ...Object.values(echartsConfigChildren)]);
150154

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ const chartJsonModeChildren = {
255255
echartsLabelConfig: EchartsLabelConfig,
256256
echartsConfig: EchartsOptionComp,
257257
echartsTitleConfig:EchartsTitleConfig,
258-
style: styleControl(EchartsStyle),
258+
style: styleControl(EchartsStyle, 'style'),
259259
tooltip: withDefault(BoolControl, true),
260260
label: withDefault(BoolControl, true),
261261
legendVisibility: withDefault(BoolControl, true),

client/packages/lowcoder-comps/src/comps/funnelChartComp/funnelChartUtils.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,19 @@ export function getSeriesConfig(props: EchartsConfigProps) {
128128
}
129129

130130
// https://echarts.apache.org/en/option.html
131-
export function getEchartsConfig(props: EchartsConfigProps, chartSize?: ChartSize): EChartsOptionWithMap {
131+
export function getEchartsConfig(
132+
props: EchartsConfigProps,
133+
chartSize?: ChartSize,
134+
theme?: any,
135+
): EChartsOptionWithMap {
132136
if (props.mode === "json") {
133137
let opt={
134138
"title": {
135139
"text": props.echartsTitle,
136140
'top': props.echartsLegendConfig.top === 'bottom' ?'top':'bottom',
137141
"left":props.echartsTitleConfig.top
138142
},
139-
"backgroundColor": props?.style?.background,
143+
"backgroundColor": props?.style?.background || theme?.style?.background,
140144
"color": props.echartsOption.data?.map(data => data.color),
141145
"tooltip": props.tooltip&&{
142146
"trigger": "item",

0 commit comments

Comments
 (0)