Skip to content

Commit dc59f88

Browse files
authored
Merge branch 'dev' into condition-load-agora
2 parents a91f142 + d7bc60c commit dc59f88

File tree

847 files changed

+34724
-6441
lines changed

Some content is hidden

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

847 files changed

+34724
-6441
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Lowcoder wants to take a step forward. More specifically, Lowcoder is:
3232
- The only platform where you can build your own Meeting Tool - like Teams, Zoom or Google Meets, - just in the Lowcode way.
3333

3434
## 🪄 Features
35-
- **Visual UI builder** with 50+ built-in components. Save 90% of time to build apps.
35+
- **Visual UI builder** with 70+ built-in components. Save 90% of time to build apps.
3636
- **Modules** for reusable (!) component sets in the UI builder.
3737
- **Embed Lowcoder Apps as native parts of any Website** instead of iFrame (!). [Demo](https://github.com/lowcoder-org/lowcoder-sdk-demo)
3838
- **Video Meeting Components** to create your own individual Web-Meeting tool.
@@ -87,6 +87,8 @@ And we mean it... Day by day!
8787
## 💻 Deployment Options
8888
[![Deploy to AWS using Stitch](https://img.shields.io/badge/deploy_with-Stitch-%23E369F7?logo=amazonaws&color=%23E369F7)](https://deploy.stitch.tech/lowcoder/lowcoder)
8989

90+
[![Deploy in minutes on Elest.io](https://raw.githubusercontent.com/elestio-examples/element/main/deploy-on-elestio.png)](https://elest.io/open-source/lowcoder)
91+
9092
You can access Lowcoder from [cloud-hosted version](https://app.lowcoder.cloud/) at any time, or use the following resources for self-host Lowcoder on different platforms:
9193
- [Docker](https://docs.lowcoder.cloud/lowcoder-documentation/setup-and-run/self-hosting)
9294

@@ -99,4 +101,4 @@ You can access Lowcoder from [cloud-hosted version](https://app.lowcoder.cloud/)
99101
Accelerate the growth of Lowcoder and unleash its potential with your Sponsorship – together, we're shaping the future of Lowcode for everyone!
100102
[Be a Sponsor](https://github.com/sponsors/lowcoder-org)
101103

102-
Like ... [@spacegoats-io](https://github.com/spacegoats-io), [@Jomedya](https://github.com/Jomedya), [@CHSchuepfer](https://github.com/CHSchuepfer), Thank you very much!!
104+
Like ... [@Darkjamin](https://github.com/Darkjamin), [@spacegoats-io](https://github.com/spacegoats-io), [@Jomedya](https://github.com/Jomedya), [@CHSchuepfer](https://github.com/CHSchuepfer), Thank you very much!!

client/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@
7676
"@types/styled-components": "^5.1.34",
7777
"antd-mobile": "^5.34.0",
7878
"chalk": "4",
79+
"flag-icons": "^7.2.1",
7980
"number-precision": "^1.6.0",
81+
"react-countup": "^6.5.3",
8082
"react-player": "^2.11.0",
8183
"resize-observer-polyfill": "^1.5.1",
8284
"rollup": "^4.13.0",

client/packages/lowcoder-comps/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lowcoder-comps",
3-
"version": "0.0.29",
3+
"version": "0.0.30",
44
"type": "module",
55
"license": "MIT",
66
"dependencies": {

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

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ let CalendarBasicComp = (function () {
9797
resources: any;
9898
resourceName : string
9999
onEvent?: any;
100-
onEventDrop?: any;
100+
onDropEvent?: any;
101101
editable?: boolean;
102102
showEventTime?: boolean;
103103
showWeekends?: boolean;
@@ -248,16 +248,16 @@ let CalendarBasicComp = (function () {
248248
return (
249249
<Event
250250
className={`event ${sizeClass} ${stateClass}`}
251-
bg={eventInfo.backgroundColor}
251+
$bg={eventInfo.backgroundColor}
252252
theme={theme?.theme}
253-
isList={isList}
254-
allDay={showAllDay}
253+
$isList={isList}
254+
$allDay={Boolean(showAllDay)}
255255
$style={props.style}
256256
>
257257
<div className="event-time">{eventInfo.timeText}</div>
258258
<div className="event-title">{eventInfo.event.title}</div>
259259
<Remove
260-
isList={isList}
260+
$isList={isList}
261261
className="event-remove"
262262
onClick={(e) => {
263263
e.stopPropagation();
@@ -526,7 +526,7 @@ let CalendarBasicComp = (function () {
526526
}}
527527
eventDragStop={(info) => {
528528
if (info.view) {
529-
props.onEventDrop("dropEvent");
529+
props.onDropEvent("dropEvent");
530530
}
531531
}}
532532
/>
@@ -540,8 +540,8 @@ let CalendarBasicComp = (function () {
540540
resourcesEvents: { propertyView: (arg0: {}) => any; };
541541
resources: { propertyView: (arg0: {}) => any; };
542542
resourceName: { propertyView: (arg0: {}) => any; };
543-
onEvent: { getPropertyView: () => any; };
544-
onDropEvent: { getPropertyView: () => any; };
543+
onEvent: { propertyView: ({title}?: {title?: string}) => any; };
544+
onDropEvent: { propertyView: ({title}?: {title?: string}) => any; };
545545
editable: { propertyView: (arg0: { label: string; }) => any; };
546546
showEventTime: { propertyView: (arg0: { label: string; tooltip: string; }) => any; };
547547
showWeekends: { propertyView: (arg0: { label: string; }) => any; };
@@ -573,8 +573,12 @@ let CalendarBasicComp = (function () {
573573
}
574574
<Section name={sectionNames.interaction}>
575575
{hiddenPropertyView(children)}
576-
{children.onEvent.getPropertyView()}
577-
{children.onDropEvent.getPropertyView()}
576+
<div style={{display: 'flex', flexDirection: 'column', gap: '8px'}}>
577+
{children.onEvent.propertyView()}
578+
</div>
579+
<div style={{display: 'flex', flexDirection: 'column', gap: '8px'}}>
580+
{children.onDropEvent.propertyView({title: trans("calendar.dragDropEventHandlers")})}
581+
</div>
578582
{children.editable.propertyView({ label: trans("calendar.editable"), })}
579583
</Section>
580584
<Section name={sectionNames.advanced}>

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ export const Wrapper = styled.div<{
635635
}
636636
`;
637637

638-
export const Remove = styled.div<{ isList: boolean }>`
638+
export const Remove = styled.div<{ $isList: boolean }>`
639639
position: absolute;
640640
pointer-events: auto;
641641
top: 0;
@@ -652,21 +652,21 @@ export const Remove = styled.div<{ isList: boolean }>`
652652
`;
653653

654654
export const Event = styled.div<{
655-
bg: string;
655+
$bg: string;
656656
theme: Object;
657-
isList: boolean;
658-
allDay: boolean;
657+
$isList: boolean;
658+
$allDay: boolean;
659659
$style: CalendarStyleType;
660660
}>`
661661
height: 100%;
662662
width: 100%;
663663
pointer-events: none;
664664
border-radius: 4px;
665-
box-shadow: ${(props) => !props.isList && "0 0 5px 0 rgba(0, 0, 0, 0.15)"};
665+
box-shadow: ${(props) => !props.$isList && "0 0 5px 0 rgba(0, 0, 0, 0.15)"};
666666
border: 1px solid ${(props) => props.$style.border};
667-
display: ${(props) => props.isList && "flex"};
667+
display: ${(props) => props.$isList && "flex"};
668668
background-color: ${(props) =>
669-
!props.isList && lightenColor(props.$style.background, 0.1)};
669+
!props.$isList && lightenColor(props.$style.background, 0.1)};
670670
overflow: hidden;
671671
font-size: 13px;
672672
line-height: 19px;
@@ -682,12 +682,12 @@ export const Event = styled.div<{
682682
left: 2px;
683683
top: 2px;
684684
border-radius: 3px;
685-
background-color: ${(props) => props.bg};
685+
background-color: ${(props) => props.$bg};
686686
}
687687
688688
.event-time {
689689
color: ${(props) =>
690-
!props.isList &&
690+
!props.$isList &&
691691
(isDarkColor(props.$style.text)
692692
? lightenColor(props.$style.text, 0.2)
693693
: props.$style.text)};
@@ -696,7 +696,7 @@ export const Event = styled.div<{
696696
margin-top: 2px;
697697
}
698698
.event-title {
699-
color: ${(props) => !props.isList && props.$style.text};
699+
color: ${(props) => !props.$isList && props.$style.text};
700700
font-weight: 500;
701701
margin-left: 15px;
702702
white-space: pre-wrap;

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

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
withViewFn,
2828
ThemeContext,
2929
chartColorPalette,
30+
getPromiseAfterDispatch,
3031
} from "lowcoder-sdk";
3132
import { getEchartsLocale, trans } from "i18n/comps";
3233
import { ItemColorComp } from "comps/chartComp/chartConfigs/lineChartConfig";
@@ -57,6 +58,7 @@ ChartTmpComp = withViewFn(ChartTmpComp, (comp) => {
5758
const mapZoomlevel = comp.children.mapZoomLevel.getView();
5859
const onUIEvent = comp.children.onUIEvent.getView();
5960
const onMapEvent = comp.children.onMapEvent.getView();
61+
const onEvent = comp.children.onEvent.getView();
6062

6163
const echartsCompRef = useRef<ReactECharts | null>();
6264
const [chartSize, setChartSize] = useState<ChartSize>();
@@ -75,7 +77,44 @@ ChartTmpComp = withViewFn(ChartTmpComp, (comp) => {
7577
log.error('theme chart error: ', error);
7678
}
7779

80+
const triggerClickEvent = async (dispatch: any, action: CompAction<JSONValue>) => {
81+
await getPromiseAfterDispatch(
82+
dispatch,
83+
action,
84+
{ autoHandleAfterReduce: true }
85+
);
86+
onEvent('click');
87+
}
88+
7889
useEffect(() => {
90+
// click events for JSON/Map mode
91+
if (mode === 'ui') return;
92+
93+
const echartsCompInstance = echartsCompRef?.current?.getEchartsInstance();
94+
if (!echartsCompInstance) {
95+
return _.noop;
96+
}
97+
echartsCompInstance?.on("click", (param: any) => {
98+
document.dispatchEvent(new CustomEvent("clickEvent", {
99+
bubbles: true,
100+
detail: {
101+
action: 'click',
102+
data: param.data,
103+
}
104+
}));
105+
triggerClickEvent(
106+
comp.dispatch,
107+
changeChildAction("lastInteractionData", param.data, false)
108+
);
109+
});
110+
return () => {
111+
echartsCompInstance?.off("click");
112+
document.removeEventListener('clickEvent', clickEventCallback)
113+
};
114+
}, [mode, mapScriptLoaded]);
115+
116+
useEffect(() => {
117+
// click events for UI mode
79118
if(mode !== 'ui') return;
80119

81120
// bind events
@@ -87,21 +126,27 @@ ChartTmpComp = withViewFn(ChartTmpComp, (comp) => {
87126
const option: any = echartsCompInstance?.getOption();
88127
//log.log("chart select change", param);
89128
// trigger click event listener
129+
90130
document.dispatchEvent(new CustomEvent("clickEvent", {
91131
bubbles: true,
92132
detail: {
93133
action: param.fromAction,
94134
data: getSelectedPoints(param, option)
95135
}
96136
}));
97-
137+
98138
if (param.fromAction === "select") {
99-
comp.dispatch(changeChildAction("selectedPoints", getSelectedPoints(param, option)));
139+
comp.dispatch(changeChildAction("selectedPoints", getSelectedPoints(param, option), false));
100140
onUIEvent("select");
101141
} else if (param.fromAction === "unselect") {
102-
comp.dispatch(changeChildAction("selectedPoints", getSelectedPoints(param, option)));
142+
comp.dispatch(changeChildAction("selectedPoints", getSelectedPoints(param, option), false));
103143
onUIEvent("unselect");
104144
}
145+
146+
triggerClickEvent(
147+
comp.dispatch,
148+
changeChildAction("lastInteractionData", getSelectedPoints(param, option), false)
149+
);
105150
});
106151
// unbind
107152
return () => {
@@ -141,10 +186,12 @@ ChartTmpComp = withViewFn(ChartTmpComp, (comp) => {
141186

142187
useEffect(() => {
143188
if( mode !== 'map') {
144-
comp.children.mapInstance.dispatch(changeValueAction(undefined))
189+
comp.children.mapInstance.dispatch(changeValueAction(null, false))
145190
return;
146191
}
147192

193+
if(comp.children.mapInstance.value) return;
194+
148195
const gMapScript = loadGoogleMapsScript(apiKey);
149196
if(isMapScriptLoaded) {
150197
handleOnMapScriptLoad();
@@ -298,6 +345,14 @@ let ChartComp = withExposingConfigs(ChartTmpComp, [
298345
return input.selectedPoints;
299346
},
300347
}),
348+
depsConfig({
349+
name: "lastInteractionData",
350+
desc: trans("chart.lastInteractionDataDesc"),
351+
depKeys: ["lastInteractionData"],
352+
func: (input) => {
353+
return input.lastInteractionData;
354+
},
355+
}),
301356
depsConfig({
302357
name: "data",
303358
desc: trans("chart.dataDesc"),

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

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
withType,
1616
ValueFromOption,
1717
uiChildren,
18+
clickEvent,
1819
} from "lowcoder-sdk";
1920
import { RecordConstructorToComp, RecordConstructorToView } from "lowcoder-core";
2021
import { BarChartConfig } from "./chartConfigs/barChartConfig";
@@ -67,7 +68,6 @@ export const UIEventOptions = [
6768
value: "select",
6869
description: trans("chart.selectDesc"),
6970
},
70-
7171
{
7272
label: trans("chart.unSelect"),
7373
value: "unselect",
@@ -253,6 +253,10 @@ export const chartUiModeChildren = {
253253
onUIEvent: eventHandlerControl(UIEventOptions),
254254
};
255255

256+
const chartJsonModeChildren = {
257+
echartsOption: jsonControl(toObject, i18nObjs.defaultEchartsJsonOption),
258+
}
259+
256260
const chartMapModeChildren = {
257261
mapInstance: stateComp(),
258262
getMapInstance: FunctionControl,
@@ -265,21 +269,28 @@ const chartMapModeChildren = {
265269
showCharts: withDefault(BoolControl, true),
266270
}
267271

272+
export type UIChartDataType = {
273+
seriesName: string;
274+
// coordinate chart
275+
x?: any;
276+
y?: any;
277+
// pie or funnel
278+
itemName?: any;
279+
value?: any;
280+
};
281+
282+
export type NonUIChartDataType = {
283+
name: string;
284+
value: any;
285+
}
286+
268287
export const chartChildrenMap = {
269288
mode: dropdownControl(chartModeOptions, "ui"),
270-
echartsOption: jsonControl(toObject, i18nObjs.defaultEchartsJsonOption),
271-
selectedPoints: stateComp<
272-
Array<{
273-
seriesName: string;
274-
// coordinate chart
275-
x?: any;
276-
y?: any;
277-
// pie or funnel
278-
itemName?: any;
279-
value?: any;
280-
}>
281-
>([]),
289+
selectedPoints: stateComp<Array<UIChartDataType>>([]),
290+
lastInteractionData: stateComp<Array<UIChartDataType> | NonUIChartDataType>({}),
291+
onEvent: eventHandlerControl([clickEvent] as const),
282292
...chartUiModeChildren,
293+
...chartJsonModeChildren,
283294
...chartMapModeChildren,
284295
};
285296

0 commit comments

Comments
 (0)