Skip to content

Commit

Permalink
Merge pull request #1068 from lowcoder-org/dev
Browse files Browse the repository at this point in the history
Dev > Main - for version 2.4.4
  • Loading branch information
FalkWolsky authored Jul 26, 2024
2 parents 9ab8650 + 38b391c commit 0191722
Show file tree
Hide file tree
Showing 101 changed files with 1,502 additions and 436 deletions.
2 changes: 1 addition & 1 deletion client/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.3
2.4.4
10 changes: 5 additions & 5 deletions client/packages/lowcoder-comps/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lowcoder-comps",
"version": "2.4.8",
"version": "2.4.9",
"type": "module",
"license": "MIT",
"dependencies": {
Expand Down Expand Up @@ -197,10 +197,10 @@
}
},
"scripts": {
"start": "NODE_OPTIONS=--max_old_space_size=6144 vite",
"build": "yarn test && lowcoder-cli build",
"build_only": "lowcoder-cli build",
"build_publish": "lowcoder-cli build --publish",
"start": "NODE_OPTIONS=--max_old_space_size=6442 vite",
"build": "NODE_OPTIONS=--max_old_space_size=6442 yarn test && lowcoder-cli build",
"build_only": "NODE_OPTIONS=--max_old_space_size=6442 lowcoder-cli build",
"build_publish": "NODE_OPTIONS=--max_old_space_size=6442 lowcoder-cli build --publish",
"test": "jest"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ BasicChartTmpComp = withViewFn(BasicChartTmpComp, (comp) => {
log.error('theme chart error: ', error);
}

useMergeCompStyles(childrenToProps(comp.children), comp.dispatch);
useMergeCompStyles?.(childrenToProps(comp.children), comp.dispatch);

const triggerClickEvent = async (dispatch: any, action: CompAction<JSONValue>) => {
await getPromiseAfterDispatch(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,16 +249,22 @@ export const chartUiModeChildren = {
onUIEvent: eventHandlerControl(UIEventOptions),
};

const chartJsonModeChildren = {
let chartJsonModeChildren: any = {
echartsOption: jsonControl(toObject, i18nObjs.defaultEchartsJsonOption),
echartsTitle: withDefault(StringControl, trans("echarts.defaultTitle")),
echartsTitle: withDefault(StringControl, trans("echarts.defaultTitle")),
echartsLegendConfig: EchartsLegendConfig,
echartsLabelConfig: EchartsLabelConfig,
echartsConfig: EchartsOptionComp,
style: styleControl(EchartsStyle, 'style'),
// style: styleControl(EchartsStyle, 'style'),
tooltip: withDefault(BoolControl, true),
legendVisibility: withDefault(BoolControl, true),
}
if (EchartsStyle) {
chartJsonModeChildren = {
...chartJsonModeChildren,
style: styleControl(EchartsStyle, 'style'),
}
}

const chartMapModeChildren = {
mapInstance: stateComp(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import {
ThemeContext,
CalendarStyle,
DateParser,
modalInstance,
CustomModal,
jsonValueExposingStateControl,
CalendarDeleteIcon,
Expand Down Expand Up @@ -70,16 +71,13 @@ import {
resourceTimeGridHeaderToolbar,
} from "./calendarConstants";

// this should ensure backwards compatibility with older versions of the SDK
const safeDragEventHandlerControl = typeof DragEventHandlerControl !== 'undefined' ? DragEventHandlerControl : () => {};

const childrenMap = {
let childrenMap: any = {
events: jsonValueExposingStateControl("events", defaultData),
resourcesEvents: jsonValueExposingStateControl("resourcesEvents", resourcesEventsDefaultData),
resources: jsonValueExposingStateControl("resources", resourcesDefaultData),
resourceName: withDefault(StringControl, trans("calendar.resourcesDefault")),
onEvent: ChangeEventHandlerControl,
onDropEvent: safeDragEventHandlerControl,
// onDropEvent: safeDragEventHandlerControl,
editable: withDefault(BoolControl, true),
showEventTime: withDefault(BoolControl, true),
showWeekends: withDefault(BoolControl, true),
Expand All @@ -93,7 +91,13 @@ const childrenMap = {
currentFreeView: dropdownControl(DefaultWithFreeViewOptions, "timeGridWeek"),
currentPremiumView: dropdownControl(DefaultWithPremiumViewOptions, "resourceTimelineDay"),
};

// this should ensure backwards compatibility with older versions of the SDK
if (DragEventHandlerControl) {
childrenMap = {
...childrenMap,
onDropEvent: DragEventHandlerControl,
}
}
let CalendarBasicComp = (function () {
return new UICompBuilder(childrenMap, (props: {
events: any;
Expand Down Expand Up @@ -124,7 +128,7 @@ let CalendarBasicComp = (function () {
const [left, setLeft] = useState<number | undefined>(undefined);
const [licensed, setLicensed] = useState<boolean>(props.licenseKey !== "");

useMergeCompStyles(props, dispatch);
useMergeCompStyles?.(props, dispatch);

useEffect(() => {
setLicensed(props.licenseKey !== "");
Expand Down Expand Up @@ -326,6 +330,8 @@ let CalendarBasicComp = (function () {
};

const showModal = (event: EventType, ifEdit: boolean) => {
if (!modalInstance) return;

const modalTitle = ifEdit
? trans("calendar.editEvent")
: trans("calendar.creatEvent");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,16 +247,22 @@ export const chartUiModeChildren = {
onUIEvent: eventHandlerControl(UIEventOptions),
};

const chartJsonModeChildren = {
let chartJsonModeChildren: any = {
echartsOption: jsonControl(toObject, i18nObjs.defaultCandleStickChartOption),
echartsTitle: withDefault(StringControl, trans("candleStickChart.defaultTitle")),
echartsLegendConfig: EchartsLegendConfig,
echartsLabelConfig: EchartsLabelConfig,
echartsConfig: EchartsOptionComp,
style: styleControl(EchartsStyle, 'style'),
// style: styleControl(EchartsStyle, 'style'),
tooltip: withDefault(BoolControl, true),
legendVisibility: withDefault(BoolControl, true),
}
if (EchartsStyle) {
chartJsonModeChildren = {
...chartJsonModeChildren,
style: styleControl(EchartsStyle, 'style'),
}
}

const chartMapModeChildren = {
mapInstance: stateComp(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function candleStickChartPropertyView(
{children.onEvent.propertyView()}
</Section>
<Section name={sectionNames.style}>
{children.style.getPropertyView()}
{children.style?.getPropertyView()}
</Section>
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ ChartTmpComp = withViewFn(ChartTmpComp, (comp) => {
}

const triggerClickEvent = async (dispatch: any, action: CompAction<JSONValue>) => {
await getPromiseAfterDispatch(
await getPromiseAfterDispatch?.(
dispatch,
action,
{ autoHandleAfterReduce: true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,14 @@ export const chartUiModeChildren = {
onUIEvent: eventHandlerControl(UIEventOptions),
};

const chartJsonModeChildren = {
let chartJsonModeChildren: any = {
echartsOption: jsonControl(toObject, i18nObjs.defaultFunnelChartOption),
echartsTitle: withDefault(StringControl, trans("funnelChart.defaultTitle")),
echartsLegendConfig: EchartsLegendConfig,
echartsLabelConfig: EchartsLabelConfig,
echartsConfig: EchartsOptionComp,
echartsTitleConfig:EchartsTitleConfig,
style: styleControl(EchartsStyle, 'style'),
// style: styleControl(EchartsStyle, 'style'),
tooltip: withDefault(BoolControl, true),
label: withDefault(BoolControl, true),
legendVisibility: withDefault(BoolControl, true),
Expand All @@ -267,6 +267,12 @@ const chartJsonModeChildren = {
max:withDefault(NumberControl,trans('funnelChart.defaultMax')),
gap:withDefault(NumberControl,trans('funnelChart.defaultGap'))
}
if (EchartsStyle) {
chartJsonModeChildren = {
...chartJsonModeChildren,
style: styleControl(EchartsStyle, 'style'),
}
}

const chartMapModeChildren = {
mapInstance: stateComp(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function funnelChartPropertyView(
{children.onEvent.propertyView()}
</Section>
<Section name={sectionNames.style}>
{children.style.getPropertyView()}
{children.style?.getPropertyView()}
</Section>
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,14 @@ export const chartUiModeChildren = {
onUIEvent: eventHandlerControl(UIEventOptions),
};

const chartJsonModeChildren = {
let chartJsonModeChildren: any = {
echartsOption: jsonControl(toObject, i18nObjs.defaultGaugeChartOption),
echartsTitle: withDefault(StringControl, trans("gaugeChart.defaultTitle")),
echartsLegendConfig: EchartsLegendConfig,
echartsLabelConfig: EchartsLabelConfig,
echartsConfig: EchartsOptionComp,
echartsTitleConfig:EchartsTitleConfig,
style: styleControl(EchartsStyle, 'style'),
// style: styleControl(EchartsStyle, 'style'),
tooltip: withDefault(BoolControl, true),
legendVisibility: withDefault(BoolControl, true),
label: withDefault(BoolControl, true),
Expand All @@ -267,7 +267,12 @@ const chartJsonModeChildren = {
max:withDefault(NumberControl,trans('gaugeChart.defaultMax')),
gap:withDefault(NumberControl,trans('gaugeChart.defaultGap'))
}

if (EchartsStyle) {
chartJsonModeChildren = {
...chartJsonModeChildren,
style: styleControl(EchartsStyle, 'style'),
}
}
const chartMapModeChildren = {
mapInstance: stateComp(),
getMapInstance: FunctionControl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function gaugeChartPropertyView(
{children.onEvent.propertyView()}
</Section>
<Section name={sectionNames.style}>
{children.style.getPropertyView()}
{children.style?.getPropertyView()}
</Section>
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,16 +247,22 @@ export const chartUiModeChildren = {
onUIEvent: eventHandlerControl(UIEventOptions),
};

const chartJsonModeChildren = {
let chartJsonModeChildren: any = {
echartsOption: jsonControl(toObject, i18nObjs.defaultGraphChartOption),
echartsTitle: withDefault(StringControl, trans("graphChart.defaultTitle")),
echartsLegendConfig: EchartsLegendConfig,
echartsLabelConfig: EchartsLabelConfig,
echartsConfig: EchartsOptionComp,
style: styleControl(EchartsStyle, 'style'),
// style: styleControl(EchartsStyle, 'style'),
tooltip: withDefault(BoolControl, true),
legendVisibility: withDefault(BoolControl, true),
}
if (EchartsStyle) {
chartJsonModeChildren = {
...chartJsonModeChildren,
style: styleControl(EchartsStyle, 'style'),
}
}

const chartMapModeChildren = {
mapInstance: stateComp(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function graphChartPropertyView(
{children.onEvent.propertyView()}
</Section>
<Section name={sectionNames.style}>
{children.style.getPropertyView()}
{children.style?.getPropertyView()}
</Section>
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,16 +247,22 @@ export const chartUiModeChildren = {
onUIEvent: eventHandlerControl(UIEventOptions),
};

const chartJsonModeChildren = {
let chartJsonModeChildren: any = {
echartsOption: jsonControl(toObject, i18nObjs.defaultHeatmapChartOption),
echartsTitle: withDefault(StringControl, trans("heatmapChart.defaultTitle")),
echartsLegendConfig: EchartsLegendConfig,
echartsLabelConfig: EchartsLabelConfig,
echartsConfig: EchartsOptionComp,
style: styleControl(EchartsStyle, 'style'),
// style: styleControl(EchartsStyle, 'style'),
tooltip: withDefault(BoolControl, true),
legendVisibility: withDefault(BoolControl, true),
}
if (EchartsStyle) {
chartJsonModeChildren = {
...chartJsonModeChildren,
style: styleControl(EchartsStyle, 'style'),
}
}

const chartMapModeChildren = {
mapInstance: stateComp(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function heatmapChartPropertyView(
{children.onEvent.propertyView()}
</Section>
<Section name={sectionNames.style}>
{children.style.getPropertyView()}
{children.style?.getPropertyView()}
</Section>
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,16 +247,22 @@ export const chartUiModeChildren = {
onUIEvent: eventHandlerControl(UIEventOptions),
};

const chartJsonModeChildren = {
let chartJsonModeChildren: any = {
echartsOption: jsonControl(toObject, i18nObjs.defaultRadarChartOption),
echartsTitle: withDefault(StringControl, trans("radarChart.defaultTitle")),
echartsLegendConfig: EchartsLegendConfig,
echartsLabelConfig: EchartsLabelConfig,
echartsConfig: EchartsOptionComp,
style: styleControl(EchartsStyle, 'style'),
// style: styleControl(EchartsStyle, 'style'),
tooltip: withDefault(BoolControl, true),
legendVisibility: withDefault(BoolControl, true),
}
if (EchartsStyle) {
chartJsonModeChildren = {
...chartJsonModeChildren,
style: styleControl(EchartsStyle, 'style'),
}
}

const chartMapModeChildren = {
mapInstance: stateComp(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function radarChartPropertyView(
{children.onEvent.propertyView()}
</Section>
<Section name={sectionNames.style}>
{children.style.getPropertyView()}
{children.style?.getPropertyView()}
</Section>
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,16 +247,22 @@ export const chartUiModeChildren = {
onUIEvent: eventHandlerControl(UIEventOptions),
};

const chartJsonModeChildren = {
let chartJsonModeChildren: any = {
echartsOption: jsonControl(toObject, i18nObjs.defaultSankeyChartOption),
echartsTitle: withDefault(StringControl, trans("sankeyChart.defaultTitle")),
echartsLegendConfig: EchartsLegendConfig,
echartsLabelConfig: EchartsLabelConfig,
echartsConfig: EchartsOptionComp,
style: styleControl(EchartsStyle, 'style'),
// style: styleControl(EchartsStyle, 'style'),
tooltip: withDefault(BoolControl, true),
legendVisibility: withDefault(BoolControl, true),
}
if (EchartsStyle) {
chartJsonModeChildren = {
...chartJsonModeChildren,
style: styleControl(EchartsStyle, 'style'),
}
}

const chartMapModeChildren = {
mapInstance: stateComp(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function sankeyChartPropertyView(
{children.onEvent.propertyView()}
</Section>
<Section name={sectionNames.style}>
{children.style.getPropertyView()}
{children.style?.getPropertyView()}
</Section>
<Section name={sectionNames.layout}>{hiddenPropertyView(children)}</Section>
</>
Expand Down
Loading

0 comments on commit 0191722

Please sign in to comment.