Skip to content

Commit a8f4023

Browse files
authored
Merge branch 'dev' into comment_component
2 parents 639d6e0 + 8c38b67 commit a8f4023

File tree

256 files changed

+11857
-642
lines changed

Some content is hidden

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

256 files changed

+11857
-642
lines changed

.DS_Store

6 KB
Binary file not shown.

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,19 @@ updates:
66
directory: "/server/api-service"
77
schedule:
88
interval: "monthly"
9+
target-branch: "dev"
910
- package-ecosystem: "npm"
1011
directory: "/server/node-service"
1112
schedule:
1213
interval: "monthly"
14+
target-branch: "dev"
1315
- package-ecosystem: "npm"
1416
directory: "/client"
1517
schedule:
1618
interval: "monthly"
19+
target-branch: "dev"
1720
- package-ecosystem: "docker"
1821
directory: "/deploy/docker"
1922
schedule:
2023
interval: "monthly"
24+
target-branch: "dev"

client/README.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66

77
#### Use prebuilt docker image
88

9-
Simply run below command to start a backend server.
9+
Simply run the below command to start a backend server.
1010

1111
```bash
1212
docker run -d --name lowcoder -p 3000:3000 -v "$PWD/stacks:/lowcoder-stacks" lowcoderorg/lowcoder-ce
1313
```
1414

15-
For more information, view our [docs](../docs/self-hosting)
15+
For more information, view our [docs](https://docs.lowcoder.cloud/lowcoder-documentation/setup-and-run/self-hosting)
1616

1717
#### Build Docker image from source
1818

19-
1. Check out source code and change to source dir.
20-
2. Use the command below to build Docker image :
19+
1. Check out the source code and change to source dir.
20+
2. Use the command below to build a Docker image :
2121

2222
```bash
2323
docker build -f ./deploy/docker/Dockerfile -t lowcoder-dev .
@@ -31,11 +31,21 @@ docker run -d --name lowcoder-dev -p 3000:3000 -v "$PWD/stacks:/lowcoder-stacks"
3131

3232
### Start develop
3333

34-
1. Check out source code.
34+
1. Check out the source code.
3535
2. Change to client dir in the repository root via cd client.
36-
3. Run yarn to install dependencies: .
37-
4. Start dev server: `LOWCODER_API_SERVICE_URL=http://localhost:3000 yarn start`.
38-
5. After dev server starts successfully, it will be automatically opened in the default browser.
36+
37+
```bash
38+
cd client
39+
```
40+
41+
4. Run yarn to install dependencies: .
42+
43+
```bash
44+
yarn install
45+
```
46+
47+
5. Start dev server: `LOWCODER_API_SERVICE_URL=http://localhost:3000 yarn start`.
48+
6. After the dev server starts successfully, it will be automatically opened in the default browser.
3949

4050
### Before submitting a pull request
4151

client/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.8
1+
2.1.0

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@types/qrcode.react": "^1.0.2",
3434
"@types/react-grid-layout": "^1.3.0",
3535
"@types/react-helmet": "^6.1.5",
36-
"@types/react-resizable": "^1.7.4",
36+
"@types/react-resizable": "^3.0.5",
3737
"@types/react-router-dom": "^5.3.2",
3838
"@types/shelljs": "^0.8.11",
3939
"@types/styled-components": "^5.1.19",

client/packages/lowcoder-cli/client.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ declare var LOWCODER_NODE_SERVICE_URL: string;
3434
declare var LOWCODER_SHOW_BRAND: string;
3535
declare var LOWCODER_CUSTOM_LOGO: string;
3636
declare var LOWCODER_CUSTOM_LOGO_SQUARE: string;
37+
declare var LOWCODER_CUSTOM_AUTH_WELCOME_TEXT: string;
3738
declare var REACT_APP_ENV: string;
3839
declare var REACT_APP_BUILD_ID: string;
3940
declare var REACT_APP_LOG_LEVEL: string;
Lines changed: 18 additions & 0 deletions
Loading

client/packages/lowcoder-comps/package.json

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lowcoder-comps",
3-
"version": "0.0.12",
3+
"version": "0.0.15",
44
"type": "module",
55
"license": "MIT",
66
"dependencies": {
@@ -14,6 +14,8 @@
1414
"@types/react": "17",
1515
"@types/react-dom": "17",
1616
"big.js": "^6.2.1",
17+
"echarts-extension-gmap": "^1.6.0",
18+
"echarts-wordcloud": "^2.1.0",
1719
"lowcoder-cli": "workspace:^",
1820
"lowcoder-sdk": "workspace:^",
1921
"mermaid": "^10.2.4",
@@ -28,16 +30,16 @@
2830
"name": "Chart",
2931
"icon": "./icons/icon-chart.svg",
3032
"layoutInfo": {
31-
"w": 11,
32-
"h": 35
33+
"w": 15,
34+
"h": 40
3335
}
3436
},
3537
"imageEditor": {
3638
"name": "Image Editor",
3739
"icon": "./icons/icon-chart.svg",
3840
"layoutInfo": {
3941
"w": 15,
40-
"h": 60
42+
"h": 40
4143
}
4244
},
4345
"calendar": {
@@ -47,6 +49,14 @@
4749
"w": 15,
4850
"h": 60
4951
}
52+
},
53+
"mermaid": {
54+
"name": "Mermaid",
55+
"icon": "./icons/mermaidchart.svg",
56+
"layoutInfo": {
57+
"w": 15,
58+
"h": 40
59+
}
5060
}
5161
}
5262
},

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ let CalendarBasicComp = (function () {
125125
isList={isList}
126126
bg={eventInfo.backgroundColor}
127127
theme={theme?.theme}
128+
allDay={showAllDay}
128129
$style={props.style}
129130
>
130131
<div className="event-time">{eventInfo.timeText}</div>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ export const Wrapper = styled.div<{
388388
389389
.fc-scrollgrid-liquid > tbody {
390390
& > tr:nth-of-type(2) {
391-
display: none;
391+
display: ${(props) => props.allDay && 1};
392392
}
393393
}
394394
.fc .fc-timegrid-slot-label-cushion {
@@ -639,6 +639,7 @@ export const Event = styled.div<{
639639
bg: string;
640640
theme: Object;
641641
isList: boolean;
642+
allDay: boolean;
642643
$style: CalendarStyleType;
643644
}>`
644645
height: 100%;

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

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,17 @@ import {
2626
withViewFn,
2727
ThemeContext,
2828
chartColorPalette,
29+
loadScript,
2930
} from "lowcoder-sdk";
3031
import { getEchartsLocale, trans } from "i18n/comps";
3132
import { ItemColorComp } from "comps/chartComp/chartConfigs/lineChartConfig";
3233
import {
3334
echartsConfigOmitChildren,
3435
getEchartsConfig,
3536
getSelectedPoints,
37+
loadGoogleMapsScript,
3638
} from "comps/chartComp/chartUtils";
39+
import 'echarts-extension-gmap';
3740
import log from "loglevel";
3841

3942
let ChartTmpComp = (function () {
@@ -45,6 +48,7 @@ let ChartTmpComp = (function () {
4548
ChartTmpComp = withViewFn(ChartTmpComp, (comp) => {
4649
const echartsCompRef = useRef<ReactECharts | null>();
4750
const [chartSize, setChartSize] = useState<ChartSize>();
51+
const [mapScriptLoaded, setMapScriptLoaded] = useState(false);
4852
const firstResize = useRef(true);
4953
const theme = useContext(ThemeContext);
5054
const defaultChartTheme = {
@@ -87,6 +91,34 @@ ChartTmpComp = withViewFn(ChartTmpComp, (comp) => {
8791
);
8892
}, [chartSize, ...Object.values(echartsConfigChildren)]);
8993

94+
const isMapScriptLoaded = useMemo(() => {
95+
return mapScriptLoaded || window?.google;
96+
}, [mapScriptLoaded])
97+
98+
const loadGoogleMapsData = () => {
99+
const echartsCompInstance = echartsCompRef?.current?.getEchartsInstance();
100+
if (!echartsCompInstance) {
101+
return _.noop;
102+
}
103+
echartsCompInstance.getModel().getComponent("gmap").getGoogleMap();
104+
}
105+
106+
const apiKey = comp.children.mapApiKey.getView();
107+
const mode = comp.children.mode.getView();
108+
useEffect(() => {
109+
if(mode === 'map') {
110+
const gMapScript = loadGoogleMapsScript('');
111+
if(isMapScriptLoaded) {
112+
loadGoogleMapsData();
113+
return;
114+
}
115+
gMapScript.addEventListener('load', function () {
116+
setMapScriptLoaded(true);
117+
loadGoogleMapsData();
118+
});
119+
}
120+
}, [mode, apiKey, option])
121+
90122
return (
91123
<ReactResizeDetector
92124
onResize={(w, h) => {
@@ -101,15 +133,17 @@ ChartTmpComp = withViewFn(ChartTmpComp, (comp) => {
101133
}
102134
}}
103135
>
104-
<ReactECharts
105-
ref={(e) => (echartsCompRef.current = e)}
106-
style={{ height: "100%" }}
107-
notMerge
108-
lazyUpdate
109-
opts={{ locale: getEchartsLocale() }}
110-
option={option}
111-
theme={themeConfig}
112-
/>
136+
{(mode !== 'map' || (mode === 'map' && isMapScriptLoaded)) && (
137+
<ReactECharts
138+
ref={(e) => (echartsCompRef.current = e)}
139+
style={{ height: "100%" }}
140+
notMerge
141+
lazyUpdate
142+
opts={{ locale: getEchartsLocale() }}
143+
option={option}
144+
theme={mode !== 'map' ? themeConfig : undefined}
145+
/>
146+
)}
113147
</ReactResizeDetector>
114148
);
115149
});

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ const echartsUrlLocale = language === "zh" ? "zh" : "en";
44
export const optionUrl = `https://echarts.apache.org/${echartsUrlLocale}/option.html`;
55
export const examplesUrl = `https://echarts.apache.org/examples/${echartsUrlLocale}/index.html`;
66
export const xAxisTypeUrl = `${optionUrl}#xAxis.type`;
7+
export const googleMapsApiUrl = `https://maps.googleapis.com/maps/api/js`;
8+
export const mapOptionUrl = `https://github.com/plainheart/echarts-extension-gmap`;
9+
export const mapExamplesUrl = `https://codepen.io/plainheart/pen/VweLGbR`;

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { jsonControl, JSONObject, stateComp, toJSONObjectArray, toObject } from "lowcoder-sdk";
2-
import { StringControl } from "lowcoder-sdk";
2+
import { withDefault, BooleanControl, StringControl, NumberControl, JSONObjectControl } from "lowcoder-sdk";
33
import { dropdownControl } from "lowcoder-sdk";
44
import { eventHandlerControl } from "lowcoder-sdk";
55
import { valueComp, withType } from "lowcoder-sdk";
@@ -15,7 +15,6 @@ import { ScatterChartConfig } from "./chartConfigs/scatterChartConfig";
1515
import { SeriesListComp } from "./seriesComp";
1616
import { EChartsOption } from "echarts";
1717
import { i18nObjs, trans } from "i18n/comps";
18-
import { JSONValue } from "lowcoder";
1918

2019
export const ChartTypeOptions = [
2120
{
@@ -45,6 +44,10 @@ const chartModeOptions = [
4544
label: "ECharts JSON",
4645
value: "json",
4746
},
47+
{
48+
label: "Map",
49+
value: "map",
50+
},
4851
] as const;
4952

5053
export const EventOptions = [
@@ -221,6 +224,14 @@ export const chartUiModeChildren = {
221224
chartConfig: ChartOptionComp,
222225
};
223226

227+
const chartMapModeChildren = {
228+
mapApiKey: withDefault(StringControl, ''),
229+
mapZoomLevel: withDefault(NumberControl, 3),
230+
mapCenterLng: withDefault(NumberControl, 15.932644),
231+
mapCenterLat: withDefault(NumberControl, 50.942063),
232+
mapOptions: jsonControl(toObject, i18nObjs.defaultMapJsonOption),
233+
}
234+
224235
export const chartChildrenMap = {
225236
mode: dropdownControl(chartModeOptions, "ui"),
226237
echartsOption: jsonControl(toObject, i18nObjs.defaultEchartsJsonOption),
@@ -236,6 +247,7 @@ export const chartChildrenMap = {
236247
}>
237248
>([]),
238249
...chartUiModeChildren,
250+
...chartMapModeChildren,
239251
};
240252

241253
const chartUiChildrenMap = uiChildren(chartChildrenMap);

0 commit comments

Comments
 (0)