@luck-design-biz/luckda 0.0.25-2 → 0.0.25-21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +40 -40
- package/es/components/ComplexItem/index.js +92 -0
- package/es/components/ComplexItem/service.js +21 -0
- package/es/components/LDActions/index.js +8 -10
- package/es/components/LDActions/index.less +68 -65
- package/es/components/LdAutoForm/index.js +57 -12
- package/es/components/LdFormList/index.js +50 -28
- package/es/components/LdGrid/index.js +23 -11
- package/es/components/LdGridForm/index.js +37 -12
- package/es/components/LdGridForm/index.less +7 -7
- package/es/components/LdTree/index.js +59 -19
- package/es/components/LdTree/index.less +40 -40
- package/es/helper/FromItems.js +177 -94
- package/es/helper/action.js +6 -6
- package/es/helper/form.js +69 -28
- package/es/helper/index.less +7 -7
- package/es/helper/props_config.js +17 -0
- package/es/index.js +0 -1
- package/es/locales/zh-CN.js +22 -17
- package/es/lowcode/constants/api-url.js +269 -98
- package/es/lowcode/constants/event-topics.js +3 -0
- package/es/lowcode/constants/index.js +2 -1
- package/es/lowcode/engine/factory/panel-item-factory/RadioStrategy.js +53 -0
- package/es/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +5 -2
- package/es/lowcode/engine/factory/panel-item-factory/StringStrategy.js +2 -2
- package/es/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +5 -2
- package/es/lowcode/engine/factory/panel-item-factory/index.js +2 -0
- package/es/lowcode/engine/launcher.js +7 -0
- package/es/lowcode/engine/meta/box.props.default.json +1 -1
- package/es/lowcode/engine/meta/box.props.json +4 -4
- package/es/lowcode/engine/meta/button.props.json +3 -3
- package/es/lowcode/engine/meta/cardlist.props.json +13 -3
- package/es/lowcode/engine/meta/components-list.json +116 -8
- package/es/lowcode/engine/meta/dialog.props.default.json +11 -5
- package/es/lowcode/engine/meta/dialog.props.json +79 -42
- package/es/lowcode/engine/meta/drawer.props.json +8 -20
- package/es/lowcode/engine/meta/fieldcolor.props.default.json +16 -0
- package/es/lowcode/engine/meta/fieldcolor.props.json +146 -0
- package/es/lowcode/engine/meta/fieldcomplex.props.default.json +15 -0
- package/es/lowcode/engine/meta/fieldcomplex.props.json +122 -0
- package/es/lowcode/engine/meta/fielddatadic.props.default.json +16 -0
- package/es/lowcode/engine/meta/fielddatadic.props.json +73 -0
- package/es/lowcode/engine/meta/fielddate.props.default.json +14 -0
- package/es/lowcode/engine/meta/fielddate.props.json +130 -0
- package/es/lowcode/engine/meta/fielddict.props.default.json +16 -0
- package/es/lowcode/engine/meta/fielddict.props.json +127 -0
- package/es/lowcode/engine/meta/fieldeditor.props.default.json +15 -0
- package/es/lowcode/engine/meta/fieldeditor.props.json +127 -0
- package/es/lowcode/engine/meta/fieldgroup.props.default.json +17 -0
- package/es/lowcode/engine/meta/fieldgroup.props.json +156 -0
- package/es/lowcode/engine/meta/fieldnumber.props.default.json +16 -0
- package/es/lowcode/engine/meta/fieldnumber.props.json +131 -0
- package/es/lowcode/engine/meta/fieldradio.props.default.json +14 -0
- package/es/lowcode/engine/meta/fieldradio.props.json +104 -0
- package/es/lowcode/engine/meta/fieldregion.props.default.json +14 -0
- package/es/lowcode/engine/meta/fieldregion.props.json +110 -0
- package/es/lowcode/engine/meta/fieldselect.props.default.json +16 -0
- package/es/lowcode/engine/meta/fieldselect.props.json +141 -0
- package/es/lowcode/engine/meta/fieldstring.props.default.json +14 -0
- package/es/lowcode/engine/meta/fieldstring.props.json +141 -0
- package/es/lowcode/engine/meta/fieldswitch.props.default.json +14 -0
- package/es/lowcode/engine/meta/fieldswitch.props.json +114 -0
- package/es/lowcode/engine/meta/fieldtextarea.props.default.json +15 -0
- package/es/lowcode/engine/meta/fieldtextarea.props.json +132 -0
- package/es/lowcode/engine/meta/fieldupload.props.default.json +17 -0
- package/es/lowcode/engine/meta/fieldupload.props.json +154 -0
- package/es/lowcode/engine/meta/fielduser.props.default.json +18 -0
- package/es/lowcode/engine/meta/fielduser.props.json +165 -0
- package/es/lowcode/engine/meta/fieldyear.props.default.json +14 -0
- package/es/lowcode/engine/meta/fieldyear.props.json +120 -0
- package/es/lowcode/engine/meta/form.props.default.json +2 -2
- package/es/lowcode/engine/meta/form.props.json +36 -16
- package/es/lowcode/engine/meta/imex.props.default.json +8 -1
- package/es/lowcode/engine/meta/imex.props.json +54 -22
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +106 -14
- package/es/lowcode/engine/meta/layout.props.json +2 -2
- package/es/lowcode/engine/meta/page.props.json +12 -6
- package/es/lowcode/engine/meta/pagelayout.props.default.json +14 -0
- package/es/lowcode/engine/meta/pagelayout.props.json +47 -0
- package/es/lowcode/engine/meta/section.props.json +2 -2
- package/es/lowcode/engine/meta/split.props.default.json +1 -1
- package/es/lowcode/engine/meta/split.props.json +4 -4
- package/es/lowcode/engine/meta/table.props.default.json +2 -1
- package/es/lowcode/engine/meta/table.props.json +27 -14
- package/es/lowcode/engine/meta/tabs.props.json +3 -3
- package/es/lowcode/engine/meta/tree.props.default.json +7 -5
- package/es/lowcode/engine/meta/tree.props.json +112 -55
- package/es/lowcode/engine/provider/ContextProvider/index.js +104 -86
- package/es/lowcode/engine/provider/ContextProvider/usePageState.js +21 -0
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +96 -49
- package/es/lowcode/engine/tools/dataProcess.js +80 -76
- package/es/lowcode/engine/tools/diff.js +60 -0
- package/es/lowcode/engine/tools/helper.js +92 -7
- package/es/lowcode/engine/tools/useCanvasRender.js +3 -2
- package/es/lowcode/engine/tools/useCombinedRefs.js +14 -0
- package/es/lowcode/engine/tools/usePageDataStore.js +350 -0
- package/es/lowcode/engine/tools/usePromiseState.js +12 -23
- package/es/lowcode/engine/tools/useTodo.js +20 -10
- package/es/lowcode/index.js +1 -4
- package/es/lowcode/painter/Components.js +2 -2
- package/es/lowcode/painter/Design.js +8 -5
- package/es/lowcode/painter/DesignOperator.js +111 -85
- package/es/lowcode/painter/DesignToolbar.js +85 -47
- package/es/lowcode/painter/Outline.js +12 -10
- package/es/lowcode/painter/Panel.js +85 -45
- package/es/lowcode/painter/components/ActionBindModal.js +45 -28
- package/es/lowcode/painter/components/AdvancePanel.js +37 -21
- package/es/lowcode/painter/components/AttrsPanel.js +40 -29
- package/es/lowcode/painter/components/Collapse.js +26 -26
- package/es/lowcode/painter/components/ColorInput.js +24 -24
- package/es/lowcode/painter/components/DragDrop/DragDropContext.js +1 -1
- package/es/lowcode/painter/components/FieldSelector.js +26 -13
- package/es/lowcode/painter/components/ListEditor.js +24 -24
- package/es/lowcode/painter/components/NumberInput.js +28 -28
- package/es/lowcode/painter/components/PanelItem.js +24 -24
- package/es/lowcode/painter/components/PopConfirm.js +8 -8
- package/es/lowcode/painter/components/PopForm.js +27 -27
- package/es/lowcode/painter/components/PreviewIframe.js +19 -0
- package/es/lowcode/painter/components/RuleInput.js +30 -31
- package/es/lowcode/painter/components/SortBox.js +22 -22
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +35 -34
- package/es/lowcode/painter/components/code-editor/CssEditor.js +25 -25
- package/es/lowcode/painter/components/code-editor/FullScreenEditor.js +23 -23
- package/es/lowcode/painter/components/code-editor/JSEditor.js +48 -42
- package/es/lowcode/painter/components/code-editor/JsonEditor.js +25 -25
- package/es/lowcode/painter/components/field-setting/CheckFrontRules.js +108 -0
- package/es/lowcode/painter/components/field-setting/CheckRules.js +1 -26
- package/es/lowcode/painter/components/field-setting/FieldRulesModal.js +33 -13
- package/es/lowcode/painter/components/field-setting/SettingUI.js +158 -77
- package/es/lowcode/painter/components/field-setting/index.js +32 -65
- package/es/lowcode/painter/components/field-setting/meta/frontRules.js +53 -0
- package/es/lowcode/painter/panel-section/ActionsEditor/index.js +3 -1
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +11 -17
- package/es/lowcode/painter/panel-section/ButtonType.js +4 -2
- package/es/lowcode/painter/panel-section/ComponentSelector.js +36 -0
- package/es/lowcode/painter/panel-section/DataSetSelector.js +33 -7
- package/es/lowcode/painter/panel-section/FieldsSetting.js +72 -54
- package/es/lowcode/painter/panel-section/I18nInput.js +2 -1
- package/es/lowcode/painter/panel-section/Icon.js +23 -23
- package/es/lowcode/painter/panel-section/IconSelector.js +16 -16
- package/es/lowcode/painter/panel-section/ImpExp.js +131 -37
- package/es/lowcode/painter/panel-section/ImpExpAlone.js +124 -0
- package/es/lowcode/painter/panel-section/LayoutRatio.js +21 -21
- package/es/lowcode/painter/panel-section/PageLayoutDisplay.js +112 -0
- package/es/lowcode/painter/panel-section/SerialsSelector.js +4 -2
- package/es/lowcode/painter/panel-section/SplitDisplay.js +28 -112
- package/es/lowcode/painter/panel-section/StylePanel/BackGround.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Border.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/BorderRadius.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/BorderRadiusSelector.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/BorderSelector.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Display.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Font.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/FontEditor.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/GapSelector.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/HighLightPanel.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/HighLigthtSpan.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/HightLightSvg.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +4 -4
- package/es/lowcode/painter/panel-section/StylePanel/Margin.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Opacity.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Padding.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Pointer.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Shadow.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Size.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/StyleContext.js +3 -3
- package/es/lowcode/painter/panel-section/StylePanel/StyleRow.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/WidthHeight.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/index.js +22 -16
- package/es/lowcode/painter/panel-section/TableTopFilter.js +23 -13
- package/es/lowcode/painter/panel-section/TreeRootEditor.js +12 -4
- package/es/lowcode/painter/style/action-bind-modal.less +102 -102
- package/es/lowcode/painter/style/actions-editor.less +15 -15
- package/es/lowcode/painter/style/border-editor.less +36 -36
- package/es/lowcode/painter/style/border-radius-selector.less +42 -42
- package/es/lowcode/painter/style/border-selector.less +39 -39
- package/es/lowcode/painter/style/button-type.less +5 -5
- package/es/lowcode/painter/style/collapse.less +28 -28
- package/es/lowcode/painter/style/color-input.less +19 -19
- package/es/lowcode/painter/style/components.less +91 -91
- package/es/lowcode/painter/style/design.less +159 -152
- package/es/lowcode/painter/style/display.less +17 -17
- package/es/lowcode/painter/style/dragdrop.less +10 -10
- package/es/lowcode/painter/style/fields-setting.less +25 -25
- package/es/lowcode/painter/style/font-editor.less +9 -9
- package/es/lowcode/painter/style/fullscreen-editor.less +17 -17
- package/es/lowcode/painter/style/icon-selector.less +22 -22
- package/es/lowcode/painter/style/icon.less +10 -10
- package/es/lowcode/painter/style/impexp.less +7 -7
- package/es/lowcode/painter/style/index.less +6 -6
- package/es/lowcode/painter/style/layout-ratio.less +51 -51
- package/es/lowcode/painter/style/list-editor.less +95 -95
- package/es/lowcode/painter/style/number-input.less +17 -17
- package/es/lowcode/painter/style/outline.less +28 -28
- package/es/lowcode/painter/style/page-layout-display.less +28 -0
- package/es/lowcode/painter/style/panel-attrs.less +43 -43
- package/es/lowcode/painter/style/panel-item.less +54 -54
- package/es/lowcode/painter/style/panel.less +98 -98
- package/es/lowcode/painter/style/pop-confirm.less +17 -17
- package/es/lowcode/painter/style/pop-form.less +19 -19
- package/es/lowcode/painter/style/radio.less +24 -24
- package/es/lowcode/painter/style/ribbon.less +5 -5
- package/es/lowcode/painter/style/rule-input.less +12 -12
- package/es/lowcode/painter/style/split-display.less +18 -27
- package/es/lowcode/painter/style/style-panel.less +37 -37
- package/es/lowcode/painter/style/tabitems.less +90 -90
- package/es/lowcode/painter/style/treedragdrop.less +19 -19
- package/es/lowcode/view/Canvas.js +34 -8
- package/es/lowcode/view/Page.js +2 -4
- package/es/lowcode/view/lc-components/Box/FunctionDesign.js +8 -2
- package/es/lowcode/view/lc-components/Box/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Box/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Box/index.js +4 -4
- package/es/lowcode/view/lc-components/Box/index.less +14 -14
- package/es/lowcode/view/lc-components/Box/meta.json +40 -40
- package/es/lowcode/view/lc-components/Button/index.js +35 -39
- package/es/lowcode/view/lc-components/Button/meta.json +127 -127
- package/es/lowcode/view/lc-components/Button/style.less +2 -2
- package/es/lowcode/view/lc-components/CardList/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/CardList/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/CardList/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/CardList/meta.json +153 -143
- package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +3 -10
- package/es/lowcode/view/lc-components/Dialog/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Dialog/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Dialog/index.js +143 -19
- package/es/lowcode/view/lc-components/Dialog/index.less +3 -3
- package/es/lowcode/view/lc-components/Dialog/meta.json +150 -120
- package/es/lowcode/view/lc-components/Drawer/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/Drawer/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Drawer/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Drawer/index.js +15 -12
- package/es/lowcode/view/lc-components/Drawer/index.less +9 -9
- package/es/lowcode/view/lc-components/Drawer/meta.json +131 -143
- package/es/lowcode/view/lc-components/FieldColor/meta.json +146 -0
- package/es/lowcode/view/lc-components/FieldComplex/meta.json +122 -0
- package/es/lowcode/view/lc-components/FieldDate/meta.json +128 -0
- package/es/lowcode/view/lc-components/FieldDict/meta.json +127 -0
- package/es/lowcode/view/lc-components/FieldEditor/meta.json +127 -0
- package/es/lowcode/view/lc-components/FieldGroup/meta.json +156 -0
- package/es/lowcode/view/lc-components/FieldNumber/meta.json +131 -0
- package/es/lowcode/view/lc-components/FieldRadio/meta.json +104 -0
- package/es/lowcode/view/lc-components/FieldRegion/meta.json +110 -0
- package/es/lowcode/view/lc-components/FieldSelect/meta.json +141 -0
- package/es/lowcode/view/lc-components/FieldString/meta.json +141 -0
- package/es/lowcode/view/lc-components/FieldSwitch/meta.json +114 -0
- package/es/lowcode/view/lc-components/FieldTextarea/meta.json +132 -0
- package/es/lowcode/view/lc-components/FieldUpload/meta.json +154 -0
- package/es/lowcode/view/lc-components/FieldUser/meta.json +165 -0
- package/es/lowcode/view/lc-components/FieldYear/meta.json +118 -0
- package/es/lowcode/view/lc-components/Form/FunctionDesign.js +23 -33
- package/es/lowcode/view/lc-components/Form/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Form/FunctionPreview.js +9 -1
- package/es/lowcode/view/lc-components/Form/index.js +345 -80
- package/es/lowcode/view/lc-components/Form/index.less +4 -4
- package/es/lowcode/view/lc-components/Form/meta.json +610 -599
- package/es/lowcode/view/lc-components/Iframe/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/Iframe/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Iframe/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Iframe/meta.json +32 -32
- package/es/lowcode/view/lc-components/ImEx/FunctionDesign.js +9 -3
- package/es/lowcode/view/lc-components/ImEx/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/ImEx/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/ImEx/index.js +470 -11
- package/es/lowcode/view/lc-components/ImEx/index.less +7 -0
- package/es/lowcode/view/lc-components/ImEx/meta.json +114 -82
- package/es/lowcode/view/lc-components/Image/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/Image/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Image/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Image/meta.json +114 -114
- package/es/lowcode/view/lc-components/JSX/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/JSX/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/JSX/FunctionPreview.js +1 -0
- package/es/{components/LdRuntimeCom/index.js → lowcode/view/lc-components/JSX/RuntimeComp.js} +12 -15
- package/es/lowcode/view/lc-components/JSX/index.js +5 -6
- package/es/lowcode/view/lc-components/JSX/meta.json +28 -28
- package/es/lowcode/view/lc-components/Layout/FunctionDesign.js +12 -19
- package/es/lowcode/view/lc-components/Layout/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Layout/index.js +19 -17
- package/es/lowcode/view/lc-components/Layout/index.less +5 -5
- package/es/lowcode/view/lc-components/Layout/meta.json +107 -107
- package/es/lowcode/view/lc-components/Link/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/Link/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Link/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Link/index.js +3 -0
- package/es/lowcode/view/lc-components/Link/meta.json +112 -112
- package/es/lowcode/view/lc-components/Page/meta.json +55 -49
- package/es/lowcode/view/lc-components/PageContent/index.js +11 -10
- package/es/lowcode/view/lc-components/PageContent/meta.json +9 -9
- package/es/lowcode/view/lc-components/PageFooter/index.js +5 -5
- package/es/lowcode/view/lc-components/PageFooter/meta.json +9 -9
- package/es/lowcode/view/lc-components/PageHeader/index.js +8 -6
- package/es/lowcode/view/lc-components/PageHeader/meta.json +9 -9
- package/es/lowcode/view/lc-components/PageLayout/FunctionDesign.js +68 -0
- package/es/lowcode/view/lc-components/PageLayout/FunctionLive.js +10 -0
- package/es/lowcode/view/lc-components/PageLayout/FunctionPreview.js +10 -0
- package/es/lowcode/view/lc-components/PageLayout/index.js +37 -0
- package/es/lowcode/view/lc-components/PageLayout/meta.json +47 -0
- package/es/lowcode/view/lc-components/PageModal/index.js +12 -15
- package/es/lowcode/view/lc-components/Section/FunctionDesign.js +3 -9
- package/es/lowcode/view/lc-components/Section/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Section/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Section/index.js +6 -3
- package/es/lowcode/view/lc-components/Section/index.less +7 -7
- package/es/lowcode/view/lc-components/Section/meta.json +107 -107
- package/es/lowcode/view/lc-components/Split/FunctionDesign.js +19 -20
- package/es/lowcode/view/lc-components/Split/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Split/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Split/index.js +8 -9
- package/es/lowcode/view/lc-components/Split/meta.json +53 -53
- package/es/lowcode/view/lc-components/Table/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Table/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Table/components/TopFilter.js +78 -57
- package/es/lowcode/view/lc-components/Table/components/TopImex.js +425 -0
- package/es/lowcode/view/lc-components/Table/index.js +426 -202
- package/es/lowcode/view/lc-components/Table/meta.json +451 -399
- package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +11 -18
- package/es/lowcode/view/lc-components/Tabs/index.js +52 -37
- package/es/lowcode/view/lc-components/Tabs/meta.json +113 -113
- package/es/lowcode/view/lc-components/Text/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/Text/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Text/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Text/index.js +3 -0
- package/es/lowcode/view/lc-components/Text/meta.json +66 -66
- package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +2 -3
- package/es/lowcode/view/lc-components/Tree/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Tree/index.js +173 -119
- package/es/lowcode/view/lc-components/Tree/index.less +4 -4
- package/es/lowcode/view/lc-components/Tree/meta.json +357 -301
- package/es/lowcode/view/lc-components/Wrapper.js +11 -12
- package/es/lowcode/view/style/canvas.less +5 -5
- package/es/lowcode/view/style/loading.less +84 -84
- package/es/lowcode/view/style/page.less +7 -7
- package/es/services.js +0 -24
- package/es/upload/FilesWall/file.png +0 -0
- package/es/upload/FilesWall/index.js +422 -0
- package/es/upload/FilesWall/index.less +74 -0
- package/es/upload/Form/gridForm.js +3 -2
- package/es/upload/Form/index.js +2 -1
- package/es/upload/Form/index.less +7 -7
- package/es/upload/FormItem/index.js +20 -21
- package/es/upload/index.js +2 -1
- package/es/utils/action.js +2 -2
- package/es/utils/form.js +37 -24
- package/es/utils/grid.js +10 -7
- package/lib/components/ComplexItem/index.js +100 -0
- package/lib/components/ComplexItem/service.js +28 -0
- package/lib/components/LDActions/index.js +7 -9
- package/lib/components/LDActions/index.less +68 -65
- package/lib/components/LdAutoForm/index.js +56 -11
- package/lib/components/LdFormList/index.js +49 -27
- package/lib/components/LdGrid/index.js +23 -11
- package/lib/components/LdGridForm/index.js +35 -10
- package/lib/components/LdGridForm/index.less +7 -7
- package/lib/components/LdTree/index.js +57 -17
- package/lib/components/LdTree/index.less +40 -40
- package/lib/helper/FromItems.js +175 -92
- package/lib/helper/action.js +6 -6
- package/lib/helper/form.js +67 -27
- package/lib/helper/index.less +7 -7
- package/lib/helper/props_config.js +23 -0
- package/lib/index.js +1 -9
- package/lib/locales/zh-CN.js +22 -17
- package/lib/lowcode/constants/api-url.js +270 -97
- package/lib/lowcode/constants/event-topics.js +4 -1
- package/lib/lowcode/constants/index.js +3 -2
- package/lib/lowcode/engine/factory/panel-item-factory/RadioStrategy.js +59 -0
- package/lib/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +7 -4
- package/lib/lowcode/engine/factory/panel-item-factory/StringStrategy.js +4 -3
- package/lib/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +6 -3
- package/lib/lowcode/engine/factory/panel-item-factory/index.js +2 -0
- package/lib/lowcode/engine/launcher.js +13 -0
- package/lib/lowcode/engine/meta/box.props.default.json +1 -1
- package/lib/lowcode/engine/meta/box.props.json +4 -4
- package/lib/lowcode/engine/meta/button.props.json +3 -3
- package/lib/lowcode/engine/meta/cardlist.props.json +13 -3
- package/lib/lowcode/engine/meta/components-list.json +116 -8
- package/lib/lowcode/engine/meta/dialog.props.default.json +11 -5
- package/lib/lowcode/engine/meta/dialog.props.json +79 -42
- package/lib/lowcode/engine/meta/drawer.props.json +8 -20
- package/lib/lowcode/engine/meta/fieldcolor.props.default.json +16 -0
- package/lib/lowcode/engine/meta/fieldcolor.props.json +146 -0
- package/lib/lowcode/engine/meta/fieldcomplex.props.default.json +15 -0
- package/lib/lowcode/engine/meta/fieldcomplex.props.json +122 -0
- package/lib/lowcode/engine/meta/fielddatadic.props.default.json +16 -0
- package/lib/lowcode/engine/meta/fielddatadic.props.json +73 -0
- package/lib/lowcode/engine/meta/fielddate.props.default.json +14 -0
- package/lib/lowcode/engine/meta/fielddate.props.json +130 -0
- package/lib/lowcode/engine/meta/fielddict.props.default.json +16 -0
- package/lib/lowcode/engine/meta/fielddict.props.json +127 -0
- package/lib/lowcode/engine/meta/fieldeditor.props.default.json +15 -0
- package/lib/lowcode/engine/meta/fieldeditor.props.json +127 -0
- package/lib/lowcode/engine/meta/fieldgroup.props.default.json +17 -0
- package/lib/lowcode/engine/meta/fieldgroup.props.json +156 -0
- package/lib/lowcode/engine/meta/fieldnumber.props.default.json +16 -0
- package/lib/lowcode/engine/meta/fieldnumber.props.json +131 -0
- package/lib/lowcode/engine/meta/fieldradio.props.default.json +14 -0
- package/lib/lowcode/engine/meta/fieldradio.props.json +104 -0
- package/lib/lowcode/engine/meta/fieldregion.props.default.json +14 -0
- package/lib/lowcode/engine/meta/fieldregion.props.json +110 -0
- package/lib/lowcode/engine/meta/fieldselect.props.default.json +16 -0
- package/lib/lowcode/engine/meta/fieldselect.props.json +141 -0
- package/lib/lowcode/engine/meta/fieldstring.props.default.json +14 -0
- package/lib/lowcode/engine/meta/fieldstring.props.json +141 -0
- package/lib/lowcode/engine/meta/fieldswitch.props.default.json +14 -0
- package/lib/lowcode/engine/meta/fieldswitch.props.json +114 -0
- package/lib/lowcode/engine/meta/fieldtextarea.props.default.json +15 -0
- package/lib/lowcode/engine/meta/fieldtextarea.props.json +132 -0
- package/lib/lowcode/engine/meta/fieldupload.props.default.json +17 -0
- package/lib/lowcode/engine/meta/fieldupload.props.json +154 -0
- package/lib/lowcode/engine/meta/fielduser.props.default.json +18 -0
- package/lib/lowcode/engine/meta/fielduser.props.json +165 -0
- package/lib/lowcode/engine/meta/fieldyear.props.default.json +14 -0
- package/lib/lowcode/engine/meta/fieldyear.props.json +120 -0
- package/lib/lowcode/engine/meta/form.props.default.json +2 -2
- package/lib/lowcode/engine/meta/form.props.json +36 -16
- package/lib/lowcode/engine/meta/imex.props.default.json +8 -1
- package/lib/lowcode/engine/meta/imex.props.json +54 -22
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +106 -14
- package/lib/lowcode/engine/meta/layout.props.json +2 -2
- package/lib/lowcode/engine/meta/page.props.json +12 -6
- package/lib/lowcode/engine/meta/pagelayout.props.default.json +14 -0
- package/lib/lowcode/engine/meta/pagelayout.props.json +47 -0
- package/lib/lowcode/engine/meta/section.props.json +2 -2
- package/lib/lowcode/engine/meta/split.props.default.json +1 -1
- package/lib/lowcode/engine/meta/split.props.json +4 -4
- package/lib/lowcode/engine/meta/table.props.default.json +2 -1
- package/lib/lowcode/engine/meta/table.props.json +27 -14
- package/lib/lowcode/engine/meta/tabs.props.json +3 -3
- package/lib/lowcode/engine/meta/tree.props.default.json +7 -5
- package/lib/lowcode/engine/meta/tree.props.json +112 -55
- package/lib/lowcode/engine/provider/ContextProvider/index.js +120 -86
- package/lib/lowcode/engine/provider/ContextProvider/usePageState.js +28 -0
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +93 -46
- package/lib/lowcode/engine/tools/dataProcess.js +80 -76
- package/lib/lowcode/engine/tools/diff.js +67 -0
- package/lib/lowcode/engine/tools/helper.js +96 -6
- package/lib/lowcode/engine/tools/useCanvasRender.js +3 -2
- package/lib/lowcode/engine/tools/useCombinedRefs.js +20 -0
- package/lib/lowcode/engine/tools/usePageDataStore.js +357 -0
- package/lib/lowcode/engine/tools/usePromiseState.js +11 -21
- package/lib/lowcode/engine/tools/useTodo.js +19 -9
- package/lib/lowcode/index.js +1 -5
- package/lib/lowcode/painter/Components.js +2 -2
- package/lib/lowcode/painter/Design.js +7 -4
- package/lib/lowcode/painter/DesignOperator.js +108 -82
- package/lib/lowcode/painter/DesignToolbar.js +83 -45
- package/lib/lowcode/painter/Outline.js +10 -8
- package/lib/lowcode/painter/Panel.js +83 -43
- package/lib/lowcode/painter/components/ActionBindModal.js +42 -25
- package/lib/lowcode/painter/components/AdvancePanel.js +36 -20
- package/lib/lowcode/painter/components/AttrsPanel.js +39 -28
- package/lib/lowcode/painter/components/Collapse.js +26 -26
- package/lib/lowcode/painter/components/ColorInput.js +24 -24
- package/lib/lowcode/painter/components/DragDrop/DragDropContext.js +1 -1
- package/lib/lowcode/painter/components/FieldSelector.js +26 -13
- package/lib/lowcode/painter/components/ListEditor.js +24 -24
- package/lib/lowcode/painter/components/NumberInput.js +28 -28
- package/lib/lowcode/painter/components/PanelItem.js +24 -24
- package/lib/lowcode/painter/components/PopConfirm.js +8 -8
- package/lib/lowcode/painter/components/PopForm.js +27 -27
- package/lib/lowcode/painter/components/PreviewIframe.js +26 -0
- package/lib/lowcode/painter/components/RuleInput.js +30 -31
- package/lib/lowcode/painter/components/SortBox.js +22 -22
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +35 -34
- package/lib/lowcode/painter/components/code-editor/CssEditor.js +25 -25
- package/lib/lowcode/painter/components/code-editor/FullScreenEditor.js +23 -23
- package/lib/lowcode/painter/components/code-editor/JSEditor.js +48 -42
- package/lib/lowcode/painter/components/code-editor/JsonEditor.js +25 -25
- package/lib/lowcode/painter/components/field-setting/CheckFrontRules.js +116 -0
- package/lib/lowcode/painter/components/field-setting/CheckRules.js +1 -26
- package/lib/lowcode/painter/components/field-setting/FieldRulesModal.js +34 -13
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +155 -74
- package/lib/lowcode/painter/components/field-setting/index.js +32 -65
- package/lib/lowcode/painter/components/field-setting/meta/frontRules.js +59 -0
- package/lib/lowcode/painter/panel-section/ActionsEditor/index.js +3 -1
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +10 -16
- package/lib/lowcode/painter/panel-section/ButtonType.js +4 -2
- package/lib/lowcode/painter/panel-section/ComponentSelector.js +43 -0
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +33 -7
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +69 -51
- package/lib/lowcode/painter/panel-section/I18nInput.js +2 -1
- package/lib/lowcode/painter/panel-section/Icon.js +23 -23
- package/lib/lowcode/painter/panel-section/IconSelector.js +16 -16
- package/lib/lowcode/painter/panel-section/ImpExp.js +131 -36
- package/lib/lowcode/painter/panel-section/ImpExpAlone.js +130 -0
- package/lib/lowcode/painter/panel-section/LayoutRatio.js +21 -21
- package/lib/lowcode/painter/panel-section/PageLayoutDisplay.js +120 -0
- package/lib/lowcode/painter/panel-section/SerialsSelector.js +4 -2
- package/lib/lowcode/painter/panel-section/SplitDisplay.js +27 -111
- package/lib/lowcode/painter/panel-section/StylePanel/BackGround.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Border.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/BorderRadius.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/BorderRadiusSelector.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/BorderSelector.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Display.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Font.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/FontEditor.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/GapSelector.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/HighLightPanel.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/HighLigthtSpan.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/HightLightSvg.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +4 -4
- package/lib/lowcode/painter/panel-section/StylePanel/Margin.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Opacity.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Padding.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Pointer.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Shadow.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Size.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/StyleContext.js +7 -6
- package/lib/lowcode/painter/panel-section/StylePanel/StyleRow.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/WidthHeight.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/index.js +22 -16
- package/lib/lowcode/painter/panel-section/TableTopFilter.js +22 -12
- package/lib/lowcode/painter/panel-section/TreeRootEditor.js +12 -4
- package/lib/lowcode/painter/style/action-bind-modal.less +102 -102
- package/lib/lowcode/painter/style/actions-editor.less +15 -15
- package/lib/lowcode/painter/style/border-editor.less +36 -36
- package/lib/lowcode/painter/style/border-radius-selector.less +42 -42
- package/lib/lowcode/painter/style/border-selector.less +39 -39
- package/lib/lowcode/painter/style/button-type.less +5 -5
- package/lib/lowcode/painter/style/collapse.less +28 -28
- package/lib/lowcode/painter/style/color-input.less +19 -19
- package/lib/lowcode/painter/style/components.less +91 -91
- package/lib/lowcode/painter/style/design.less +159 -152
- package/lib/lowcode/painter/style/display.less +17 -17
- package/lib/lowcode/painter/style/dragdrop.less +10 -10
- package/lib/lowcode/painter/style/fields-setting.less +25 -25
- package/lib/lowcode/painter/style/font-editor.less +9 -9
- package/lib/lowcode/painter/style/fullscreen-editor.less +17 -17
- package/lib/lowcode/painter/style/icon-selector.less +22 -22
- package/lib/lowcode/painter/style/icon.less +10 -10
- package/lib/lowcode/painter/style/impexp.less +7 -7
- package/lib/lowcode/painter/style/index.less +6 -6
- package/lib/lowcode/painter/style/layout-ratio.less +51 -51
- package/lib/lowcode/painter/style/list-editor.less +95 -95
- package/lib/lowcode/painter/style/number-input.less +17 -17
- package/lib/lowcode/painter/style/outline.less +28 -28
- package/lib/lowcode/painter/style/page-layout-display.less +28 -0
- package/lib/lowcode/painter/style/panel-attrs.less +43 -43
- package/lib/lowcode/painter/style/panel-item.less +54 -54
- package/lib/lowcode/painter/style/panel.less +98 -98
- package/lib/lowcode/painter/style/pop-confirm.less +17 -17
- package/lib/lowcode/painter/style/pop-form.less +19 -19
- package/lib/lowcode/painter/style/radio.less +24 -24
- package/lib/lowcode/painter/style/ribbon.less +5 -5
- package/lib/lowcode/painter/style/rule-input.less +12 -12
- package/lib/lowcode/painter/style/split-display.less +18 -27
- package/lib/lowcode/painter/style/style-panel.less +37 -37
- package/lib/lowcode/painter/style/tabitems.less +90 -90
- package/lib/lowcode/painter/style/treedragdrop.less +19 -19
- package/lib/lowcode/view/Canvas.js +34 -7
- package/lib/lowcode/view/Page.js +2 -4
- package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +8 -2
- package/lib/lowcode/view/lc-components/Box/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Box/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Box/index.js +4 -4
- package/lib/lowcode/view/lc-components/Box/index.less +14 -14
- package/lib/lowcode/view/lc-components/Box/meta.json +40 -40
- package/lib/lowcode/view/lc-components/Button/index.js +35 -39
- package/lib/lowcode/view/lc-components/Button/meta.json +127 -127
- package/lib/lowcode/view/lc-components/Button/style.less +2 -2
- package/lib/lowcode/view/lc-components/CardList/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/CardList/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/CardList/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/CardList/meta.json +153 -143
- package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +2 -9
- package/lib/lowcode/view/lc-components/Dialog/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Dialog/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Dialog/index.js +143 -19
- package/lib/lowcode/view/lc-components/Dialog/index.less +3 -3
- package/lib/lowcode/view/lc-components/Dialog/meta.json +150 -120
- package/lib/lowcode/view/lc-components/Drawer/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Drawer/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Drawer/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Drawer/index.js +15 -12
- package/lib/lowcode/view/lc-components/Drawer/index.less +9 -9
- package/lib/lowcode/view/lc-components/Drawer/meta.json +131 -143
- package/lib/lowcode/view/lc-components/FieldColor/meta.json +146 -0
- package/lib/lowcode/view/lc-components/FieldComplex/meta.json +122 -0
- package/lib/lowcode/view/lc-components/FieldDate/meta.json +128 -0
- package/lib/lowcode/view/lc-components/FieldDict/meta.json +127 -0
- package/lib/lowcode/view/lc-components/FieldEditor/meta.json +127 -0
- package/lib/lowcode/view/lc-components/FieldGroup/meta.json +156 -0
- package/lib/lowcode/view/lc-components/FieldNumber/meta.json +131 -0
- package/lib/lowcode/view/lc-components/FieldRadio/meta.json +104 -0
- package/lib/lowcode/view/lc-components/FieldRegion/meta.json +110 -0
- package/lib/lowcode/view/lc-components/FieldSelect/meta.json +141 -0
- package/lib/lowcode/view/lc-components/FieldString/meta.json +141 -0
- package/lib/lowcode/view/lc-components/FieldSwitch/meta.json +114 -0
- package/lib/lowcode/view/lc-components/FieldTextarea/meta.json +132 -0
- package/lib/lowcode/view/lc-components/FieldUpload/meta.json +154 -0
- package/lib/lowcode/view/lc-components/FieldUser/meta.json +165 -0
- package/lib/lowcode/view/lc-components/FieldYear/meta.json +118 -0
- package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +20 -31
- package/lib/lowcode/view/lc-components/Form/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Form/FunctionPreview.js +9 -1
- package/lib/lowcode/view/lc-components/Form/index.js +341 -76
- package/lib/lowcode/view/lc-components/Form/index.less +4 -4
- package/lib/lowcode/view/lc-components/Form/meta.json +610 -599
- package/lib/lowcode/view/lc-components/Iframe/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Iframe/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Iframe/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Iframe/meta.json +32 -32
- package/lib/lowcode/view/lc-components/ImEx/FunctionDesign.js +9 -3
- package/lib/lowcode/view/lc-components/ImEx/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/ImEx/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/ImEx/index.js +468 -9
- package/lib/lowcode/view/lc-components/ImEx/index.less +7 -0
- package/lib/lowcode/view/lc-components/ImEx/meta.json +114 -82
- package/lib/lowcode/view/lc-components/Image/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Image/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Image/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Image/meta.json +114 -114
- package/lib/lowcode/view/lc-components/JSX/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/JSX/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/JSX/FunctionPreview.js +2 -1
- package/lib/{components/LdRuntimeCom/index.js → lowcode/view/lc-components/JSX/RuntimeComp.js} +13 -16
- package/lib/lowcode/view/lc-components/JSX/index.js +5 -6
- package/lib/lowcode/view/lc-components/JSX/meta.json +28 -28
- package/lib/lowcode/view/lc-components/Layout/FunctionDesign.js +11 -18
- package/lib/lowcode/view/lc-components/Layout/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Layout/index.js +19 -17
- package/lib/lowcode/view/lc-components/Layout/index.less +5 -5
- package/lib/lowcode/view/lc-components/Layout/meta.json +107 -107
- package/lib/lowcode/view/lc-components/Link/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Link/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Link/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Link/index.js +3 -0
- package/lib/lowcode/view/lc-components/Link/meta.json +112 -112
- package/lib/lowcode/view/lc-components/Page/meta.json +55 -49
- package/lib/lowcode/view/lc-components/PageContent/index.js +9 -8
- package/lib/lowcode/view/lc-components/PageContent/meta.json +9 -9
- package/lib/lowcode/view/lc-components/PageFooter/index.js +5 -5
- package/lib/lowcode/view/lc-components/PageFooter/meta.json +9 -9
- package/lib/lowcode/view/lc-components/PageHeader/index.js +7 -5
- package/lib/lowcode/view/lc-components/PageHeader/meta.json +9 -9
- package/lib/lowcode/view/lc-components/PageLayout/FunctionDesign.js +76 -0
- package/lib/lowcode/view/lc-components/PageLayout/FunctionLive.js +17 -0
- package/lib/lowcode/view/lc-components/PageLayout/FunctionPreview.js +17 -0
- package/lib/lowcode/view/lc-components/PageLayout/index.js +45 -0
- package/lib/lowcode/view/lc-components/PageLayout/meta.json +47 -0
- package/lib/lowcode/view/lc-components/PageModal/index.js +11 -14
- package/lib/lowcode/view/lc-components/Section/FunctionDesign.js +2 -8
- package/lib/lowcode/view/lc-components/Section/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Section/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Section/index.js +6 -3
- package/lib/lowcode/view/lc-components/Section/index.less +7 -7
- package/lib/lowcode/view/lc-components/Section/meta.json +107 -107
- package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +19 -20
- package/lib/lowcode/view/lc-components/Split/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Split/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Split/index.js +5 -6
- package/lib/lowcode/view/lc-components/Split/meta.json +53 -53
- package/lib/lowcode/view/lc-components/Table/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Table/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Table/components/TopFilter.js +75 -55
- package/lib/lowcode/view/lc-components/Table/components/TopImex.js +433 -0
- package/lib/lowcode/view/lc-components/Table/index.js +422 -198
- package/lib/lowcode/view/lc-components/Table/meta.json +451 -399
- package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +12 -19
- package/lib/lowcode/view/lc-components/Tabs/index.js +51 -36
- package/lib/lowcode/view/lc-components/Tabs/meta.json +113 -113
- package/lib/lowcode/view/lc-components/Text/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Text/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Text/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Text/index.js +3 -0
- package/lib/lowcode/view/lc-components/Text/meta.json +66 -66
- package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +2 -3
- package/lib/lowcode/view/lc-components/Tree/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Tree/index.js +170 -116
- package/lib/lowcode/view/lc-components/Tree/index.less +4 -4
- package/lib/lowcode/view/lc-components/Tree/meta.json +357 -301
- package/lib/lowcode/view/lc-components/Wrapper.js +12 -12
- package/lib/lowcode/view/style/canvas.less +5 -5
- package/lib/lowcode/view/style/loading.less +84 -84
- package/lib/lowcode/view/style/page.less +7 -7
- package/lib/services.js +0 -25
- package/lib/upload/FilesWall/file.png +0 -0
- package/lib/upload/FilesWall/index.js +429 -0
- package/lib/upload/FilesWall/index.less +74 -0
- package/lib/upload/Form/gridForm.js +3 -2
- package/lib/upload/Form/index.js +2 -1
- package/lib/upload/Form/index.less +7 -7
- package/lib/upload/FormItem/index.js +20 -21
- package/lib/upload/index.js +8 -1
- package/lib/utils/action.js +2 -2
- package/lib/utils/form.js +37 -24
- package/lib/utils/grid.js +10 -7
- package/lowcode.js +1 -1
- package/package.json +173 -171
- package/upload.js +1 -1
- package/utils.js +1 -1
- package/es/lowcode/engine/meta/local/local.zh-cn.js +0 -97
- package/lib/lowcode/engine/meta/local/local.zh-cn.js +0 -103
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
3
|
+
import { useRef, useEffect, useCallback } from 'react';
|
|
4
|
+
import { create, createStore, useStore } from 'zustand';
|
|
5
|
+
import { immer } from 'zustand/middleware/immer';
|
|
6
|
+
import { subscribeWithSelector } from 'zustand/middleware';
|
|
7
|
+
import { useShallow } from 'zustand/react/shallow';
|
|
8
|
+
import { isObject, isArray, isNil, isFunction, isString, get, set as _set, unset, assign, forOwn, forEach, omit, debounce } from 'lodash';
|
|
9
|
+
import isDeepEqual from 'fast-deep-equal';
|
|
10
|
+
import { getPathNodesById, findNodeAndParent } from "./dataProcess";
|
|
11
|
+
import { LC_BUILDIN_UNIT_KEY } from "../../constants";
|
|
12
|
+
var temporalStateCreator = function temporalStateCreator(userSet, userGet, options) {
|
|
13
|
+
var stateCreator = function stateCreator(set, get) {
|
|
14
|
+
return {
|
|
15
|
+
pastStates: (options === null || options === void 0 ? void 0 : options.pastStates) || [],
|
|
16
|
+
futureStates: (options === null || options === void 0 ? void 0 : options.futureStates) || [],
|
|
17
|
+
undo: function undo() {
|
|
18
|
+
var steps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
19
|
+
if (get().pastStates.length) {
|
|
20
|
+
var _options$partialize, _options$diff;
|
|
21
|
+
var currentState = (options === null || options === void 0 || (_options$partialize = options.partialize) === null || _options$partialize === void 0 ? void 0 : _options$partialize.call(options, userGet())) || userGet();
|
|
22
|
+
var statesToApply = get().pastStates.splice(-steps, steps);
|
|
23
|
+
var nextState = statesToApply.shift();
|
|
24
|
+
userSet(nextState);
|
|
25
|
+
set({
|
|
26
|
+
pastStates: get().pastStates,
|
|
27
|
+
futureStates: get().futureStates.concat((options === null || options === void 0 || (_options$diff = options.diff) === null || _options$diff === void 0 ? void 0 : _options$diff.call(options, currentState, nextState)) || currentState, statesToApply.reverse())
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
redo: function redo() {
|
|
32
|
+
var steps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
33
|
+
if (get().futureStates.length) {
|
|
34
|
+
var _options$partialize2, _options$diff2;
|
|
35
|
+
var currentState = (options === null || options === void 0 || (_options$partialize2 = options.partialize) === null || _options$partialize2 === void 0 ? void 0 : _options$partialize2.call(options, userGet())) || userGet();
|
|
36
|
+
var statesToApply = get().futureStates.splice(-steps, steps);
|
|
37
|
+
var nextState = statesToApply.shift();
|
|
38
|
+
userSet(nextState);
|
|
39
|
+
set({
|
|
40
|
+
pastStates: get().pastStates.concat((options === null || options === void 0 || (_options$diff2 = options.diff) === null || _options$diff2 === void 0 ? void 0 : _options$diff2.call(options, currentState, nextState)) || currentState, statesToApply.reverse()),
|
|
41
|
+
futureStates: get().futureStates
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
clear: function clear() {
|
|
46
|
+
return set({
|
|
47
|
+
pastStates: [],
|
|
48
|
+
futureStates: []
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
isTracking: true,
|
|
52
|
+
pause: function pause() {
|
|
53
|
+
return set({
|
|
54
|
+
isTracking: false
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
resume: function resume() {
|
|
58
|
+
return set({
|
|
59
|
+
isTracking: true
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
setOnSave: function setOnSave(_onSave) {
|
|
63
|
+
return set({
|
|
64
|
+
_onSave: _onSave
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
// Internal properties
|
|
68
|
+
_onSave: options === null || options === void 0 ? void 0 : options.onSave,
|
|
69
|
+
_handleSet: function _handleSet(pastState, replace, currentState, deltaState) {
|
|
70
|
+
var _get$_onSave, _get;
|
|
71
|
+
if (options !== null && options !== void 0 && options.limit && get().pastStates.length >= (options === null || options === void 0 ? void 0 : options.limit)) {
|
|
72
|
+
get().pastStates.shift();
|
|
73
|
+
}
|
|
74
|
+
(_get$_onSave = (_get = get())._onSave) === null || _get$_onSave === void 0 || _get$_onSave.call(_get, pastState, currentState);
|
|
75
|
+
set({
|
|
76
|
+
pastStates: get().pastStates.concat(deltaState || pastState),
|
|
77
|
+
futureStates: []
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
return stateCreator;
|
|
83
|
+
};
|
|
84
|
+
var temporal = function temporal(config, options) {
|
|
85
|
+
var configWithTemporal = function configWithTemporal(set, get, store) {
|
|
86
|
+
var _options$wrapTemporal, _options$handleSet;
|
|
87
|
+
store.temporal = createStore((options === null || options === void 0 || (_options$wrapTemporal = options.wrapTemporal) === null || _options$wrapTemporal === void 0 ? void 0 : _options$wrapTemporal.call(options, temporalStateCreator(set, get, options))) || temporalStateCreator(set, get, options));
|
|
88
|
+
var curriedHandleSet = (options === null || options === void 0 || (_options$handleSet = options.handleSet) === null || _options$handleSet === void 0 ? void 0 : _options$handleSet.call(options, store.temporal.getState()._handleSet)) || store.temporal.getState()._handleSet;
|
|
89
|
+
var temporalHandleSet = function temporalHandleSet(pastState) {
|
|
90
|
+
var _options$partialize3, _options$diff3, _options$equality;
|
|
91
|
+
if (!store.temporal.getState().isTracking) return;
|
|
92
|
+
var currentState = (options === null || options === void 0 || (_options$partialize3 = options.partialize) === null || _options$partialize3 === void 0 ? void 0 : _options$partialize3.call(options, get())) || get();
|
|
93
|
+
var deltaState = options === null || options === void 0 || (_options$diff3 = options.diff) === null || _options$diff3 === void 0 ? void 0 : _options$diff3.call(options, pastState, currentState);
|
|
94
|
+
if (
|
|
95
|
+
// Don't call handleSet if state hasn't changed, as determined by diff fn or equality fn
|
|
96
|
+
!(
|
|
97
|
+
// If the user has provided a diff function but nothing has been changed, deltaState will be null
|
|
98
|
+
|
|
99
|
+
deltaState === null || // If the user has provided an equality function, use it
|
|
100
|
+
options !== null && options !== void 0 && (_options$equality = options.equality) !== null && _options$equality !== void 0 && _options$equality.call(options, pastState, currentState))) {
|
|
101
|
+
curriedHandleSet(pastState, void 0, currentState, deltaState);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
var setState = store.setState;
|
|
105
|
+
store.setState = function () {
|
|
106
|
+
var _options$partialize4;
|
|
107
|
+
var pastState = (options === null || options === void 0 || (_options$partialize4 = options.partialize) === null || _options$partialize4 === void 0 ? void 0 : _options$partialize4.call(options, get())) || get();
|
|
108
|
+
setState.apply(void 0, arguments);
|
|
109
|
+
temporalHandleSet(pastState);
|
|
110
|
+
};
|
|
111
|
+
return config(
|
|
112
|
+
// Modify the set function to call the userlandSet function
|
|
113
|
+
function () {
|
|
114
|
+
var _options$partialize5;
|
|
115
|
+
var pastState = (options === null || options === void 0 || (_options$partialize5 = options.partialize) === null || _options$partialize5 === void 0 ? void 0 : _options$partialize5.call(options, get())) || get();
|
|
116
|
+
set.apply(void 0, arguments);
|
|
117
|
+
temporalHandleSet(pastState);
|
|
118
|
+
}, get, store);
|
|
119
|
+
};
|
|
120
|
+
return configWithTemporal;
|
|
121
|
+
};
|
|
122
|
+
var findNode = function findNode(obj, id) {
|
|
123
|
+
for (var key in obj) {
|
|
124
|
+
if (!['props', 'children'].includes(key)) {
|
|
125
|
+
if (key === id) {
|
|
126
|
+
return {
|
|
127
|
+
target: obj[key],
|
|
128
|
+
parent: obj
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
if (_typeof(obj[key]) === 'object' && !Array.isArray(obj[key])) {
|
|
132
|
+
var result = findNode(obj[key], id);
|
|
133
|
+
if (result) {
|
|
134
|
+
return result;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return null;
|
|
140
|
+
};
|
|
141
|
+
var usePageDataStore = create()(immer(subscribeWithSelector(temporal(function (set) {
|
|
142
|
+
return {
|
|
143
|
+
pageData: null,
|
|
144
|
+
moduleData: null,
|
|
145
|
+
initialize: function initialize(data) {
|
|
146
|
+
return set(function (state) {
|
|
147
|
+
state.pageData = data;
|
|
148
|
+
});
|
|
149
|
+
},
|
|
150
|
+
initializeModule: function initializeModule(data) {
|
|
151
|
+
return set(function (state) {
|
|
152
|
+
state.moduleData = data;
|
|
153
|
+
});
|
|
154
|
+
},
|
|
155
|
+
reset: function reset(data) {
|
|
156
|
+
return set(function (state) {
|
|
157
|
+
state.pageData = data || null;
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
}, {
|
|
162
|
+
partialize: function partialize(state) {
|
|
163
|
+
return {
|
|
164
|
+
pageData: state.pageData
|
|
165
|
+
};
|
|
166
|
+
},
|
|
167
|
+
equality: function equality(pastState, newState) {
|
|
168
|
+
return isDeepEqual(pastState, newState);
|
|
169
|
+
},
|
|
170
|
+
handleSet: function handleSet(_handleSet2) {
|
|
171
|
+
return debounce(function (state) {
|
|
172
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key2 = 1; _key2 < _len; _key2++) {
|
|
173
|
+
args[_key2 - 1] = arguments[_key2];
|
|
174
|
+
}
|
|
175
|
+
return _handleSet2.apply(void 0, [state].concat(args));
|
|
176
|
+
}, 400, {
|
|
177
|
+
leading: true,
|
|
178
|
+
trailing: false
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}))));
|
|
182
|
+
export default usePageDataStore;
|
|
183
|
+
export var resetPageData = function resetPageData(data) {
|
|
184
|
+
usePageDataStore.setState(function (state) {
|
|
185
|
+
state.pageData = data || null;
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
export var addNode = function addNode(parentId, id, data) {
|
|
189
|
+
usePageDataStore.setState(function (state) {
|
|
190
|
+
if (parentId === LC_BUILDIN_UNIT_KEY.PAGE_ROOT) {
|
|
191
|
+
state.pageData.children.push(id);
|
|
192
|
+
state.pageData[id] = {
|
|
193
|
+
props: _objectSpread(_objectSpread({}, data), {}, {
|
|
194
|
+
id: id,
|
|
195
|
+
parentId: parentId
|
|
196
|
+
})
|
|
197
|
+
};
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
var _ref = findNode(state.pageData, parentId) || {},
|
|
201
|
+
target = _ref.target;
|
|
202
|
+
if (!target) return;
|
|
203
|
+
if (!target.hasOwnProperty('children')) {
|
|
204
|
+
target.children = [];
|
|
205
|
+
}
|
|
206
|
+
if (!target.children.includes(id)) {
|
|
207
|
+
target.children.push(id);
|
|
208
|
+
target[id] = {
|
|
209
|
+
props: _objectSpread(_objectSpread({}, data), {}, {
|
|
210
|
+
id: id,
|
|
211
|
+
parentId: parentId
|
|
212
|
+
})
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
};
|
|
217
|
+
export var deleteNode = function deleteNode(id) {
|
|
218
|
+
usePageDataStore.setState(function (state) {
|
|
219
|
+
var _parent$children;
|
|
220
|
+
var _ref2 = findNode(state.pageData, id) || {},
|
|
221
|
+
parent = _ref2.parent;
|
|
222
|
+
if (!parent || !((_parent$children = parent.children) !== null && _parent$children !== void 0 && _parent$children.length)) return;
|
|
223
|
+
parent.children.splice(parent.children.indexOf(id), 1);
|
|
224
|
+
if (parent.children.length === 0) {
|
|
225
|
+
delete parent['children'];
|
|
226
|
+
}
|
|
227
|
+
delete parent[id];
|
|
228
|
+
});
|
|
229
|
+
};
|
|
230
|
+
export var modifyNode = function modifyNode(id, data) {
|
|
231
|
+
usePageDataStore.setState(function (state) {
|
|
232
|
+
if (id === LC_BUILDIN_UNIT_KEY.PAGE_ROOT) {
|
|
233
|
+
assign(state.pageData.props, omit(data, ['id', 'parentId', 'component', 'buildIn']));
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
var _ref3 = findNode(state.pageData, id) || {},
|
|
237
|
+
target = _ref3.target;
|
|
238
|
+
if (!target) return;
|
|
239
|
+
forOwn(omit(data, ['id', 'parentId', 'component', 'buildIn']), function (_val, _key) {
|
|
240
|
+
if (isNil(_val)) {
|
|
241
|
+
unset(target.props, _key, _val);
|
|
242
|
+
} else {
|
|
243
|
+
_set(target.props, _key, _val);
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
};
|
|
248
|
+
export var clearChildren = function clearChildren(id) {
|
|
249
|
+
usePageDataStore.setState(function (state) {
|
|
250
|
+
if (id === LC_BUILDIN_UNIT_KEY.PAGE_ROOT) {
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
var _ref4 = findNode(state.pageData, id) || {},
|
|
254
|
+
target = _ref4.target;
|
|
255
|
+
if (!target) return;
|
|
256
|
+
forEach(target.children, function (c) {
|
|
257
|
+
delete target[c];
|
|
258
|
+
});
|
|
259
|
+
delete target['children'];
|
|
260
|
+
});
|
|
261
|
+
};
|
|
262
|
+
export var useTask = function useTask(type) {
|
|
263
|
+
var promiseRef = useRef(null);
|
|
264
|
+
var task = useCallback(function () {
|
|
265
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key3 = 0; _key3 < _len2; _key3++) {
|
|
266
|
+
args[_key3] = arguments[_key3];
|
|
267
|
+
}
|
|
268
|
+
return new Promise(function (resolve) {
|
|
269
|
+
promiseRef.current = resolve;
|
|
270
|
+
switch (type) {
|
|
271
|
+
case 'add':
|
|
272
|
+
addNode.apply(void 0, args);
|
|
273
|
+
break;
|
|
274
|
+
case 'update':
|
|
275
|
+
case 'modify':
|
|
276
|
+
modifyNode.apply(void 0, args);
|
|
277
|
+
break;
|
|
278
|
+
case 'delete':
|
|
279
|
+
deleteNode.apply(void 0, args);
|
|
280
|
+
break;
|
|
281
|
+
default:
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
}, []);
|
|
286
|
+
useEffect(function () {
|
|
287
|
+
var unsub = usePageDataStore.subscribe(function (state, prevState) {
|
|
288
|
+
if (!promiseRef.current) {
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
promiseRef.current(state.pageData, prevState.pageData);
|
|
292
|
+
promiseRef.current = null;
|
|
293
|
+
});
|
|
294
|
+
return unsub;
|
|
295
|
+
}, []);
|
|
296
|
+
return task;
|
|
297
|
+
};
|
|
298
|
+
export var useGet = function useGet(_) {
|
|
299
|
+
var result = usePageDataStore(useShallow(function (state) {
|
|
300
|
+
if (isNil(_)) {
|
|
301
|
+
return state.pageData;
|
|
302
|
+
} else if (isFunction(_)) {
|
|
303
|
+
return _(state.pageData);
|
|
304
|
+
} else if (isArray(_)) {
|
|
305
|
+
return _.map(function (k) {
|
|
306
|
+
var _findNode;
|
|
307
|
+
return k.includes('.') ? get(state.pageData, k) : (_findNode = findNode(state.pageData, k)) === null || _findNode === void 0 ? void 0 : _findNode.target;
|
|
308
|
+
});
|
|
309
|
+
} else if (isObject(_) && _.id) {
|
|
310
|
+
var _findNode2;
|
|
311
|
+
var path = _.path;
|
|
312
|
+
var _target = _.id === LC_BUILDIN_UNIT_KEY.PAGE_ROOT ? state.pageData : (_findNode2 = findNode(state.pageData, _.id)) === null || _findNode2 === void 0 ? void 0 : _findNode2.target;
|
|
313
|
+
return isNil(path) ? _target : get(_target, path);
|
|
314
|
+
} else if (isString(_)) {
|
|
315
|
+
return get(state.pageData, _);
|
|
316
|
+
}
|
|
317
|
+
}));
|
|
318
|
+
return result;
|
|
319
|
+
};
|
|
320
|
+
export var getCanUndoAndRedo = function getCanUndoAndRedo() {
|
|
321
|
+
var _usePageDataStore$tem = usePageDataStore.temporal.getState(),
|
|
322
|
+
pastStates = _usePageDataStore$tem.pastStates,
|
|
323
|
+
futureStates = _usePageDataStore$tem.futureStates;
|
|
324
|
+
var canUndo = !!pastStates.length;
|
|
325
|
+
var canRedo = !!futureStates.length;
|
|
326
|
+
return {
|
|
327
|
+
canUndo: canUndo,
|
|
328
|
+
canRedo: canRedo
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
export var useTemporalStore = function useTemporalStore(selector) {
|
|
332
|
+
var _temp$pastStates, _temp$futureStates;
|
|
333
|
+
var temp = useStore(usePageDataStore.temporal, selector);
|
|
334
|
+
if (!temp) return {
|
|
335
|
+
canUndo: false,
|
|
336
|
+
canRedo: false
|
|
337
|
+
};
|
|
338
|
+
var canUndo = !!((_temp$pastStates = temp.pastStates) !== null && _temp$pastStates !== void 0 && _temp$pastStates.length);
|
|
339
|
+
var canRedo = !!((_temp$futureStates = temp.futureStates) !== null && _temp$futureStates !== void 0 && _temp$futureStates.length);
|
|
340
|
+
return _objectSpread(_objectSpread({}, temp), {}, {
|
|
341
|
+
canUndo: canUndo,
|
|
342
|
+
canRedo: canRedo
|
|
343
|
+
});
|
|
344
|
+
};
|
|
345
|
+
export var getLevelNodes = function getLevelNodes(id) {
|
|
346
|
+
return getPathNodesById(usePageDataStore.getState().pageData, id);
|
|
347
|
+
};
|
|
348
|
+
export var getSelfAndParent = function getSelfAndParent(id) {
|
|
349
|
+
return findNodeAndParent(id, usePageDataStore.getState().pageData);
|
|
350
|
+
};
|
|
@@ -1,35 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import { useRef, useState, useCallback } from 'react';
|
|
3
|
+
import { useUpdateLayoutEffect } from 'ahooks';
|
|
4
4
|
var usePromiseState = function usePromiseState(initialState) {
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
forwardLength = _useHistoryTravel.forwardLength,
|
|
10
|
-
back = _useHistoryTravel.back,
|
|
11
|
-
forward = _useHistoryTravel.forward;
|
|
5
|
+
var _useState = useState(initialState),
|
|
6
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
7
|
+
state = _useState2[0],
|
|
8
|
+
setState = _useState2[1];
|
|
12
9
|
var promiseRef = useRef(null);
|
|
13
|
-
var setStatePromise = useCallback(function (
|
|
10
|
+
var setStatePromise = useCallback(function (_state) {
|
|
14
11
|
return new Promise(function (resolve) {
|
|
15
12
|
promiseRef.current = resolve;
|
|
16
|
-
|
|
17
|
-
if (!isEqual(value, _valStr)) {
|
|
18
|
-
setValue(_valStr);
|
|
19
|
-
}
|
|
13
|
+
setState(_state);
|
|
20
14
|
});
|
|
21
15
|
}, []);
|
|
22
16
|
useUpdateLayoutEffect(function () {
|
|
23
17
|
if (promiseRef.current) {
|
|
24
|
-
promiseRef.current(
|
|
18
|
+
promiseRef.current(state);
|
|
25
19
|
promiseRef.current = null;
|
|
26
20
|
}
|
|
27
|
-
}, [
|
|
28
|
-
return [
|
|
29
|
-
backLength: backLength - 1,
|
|
30
|
-
forwardLength: forwardLength,
|
|
31
|
-
back: back,
|
|
32
|
-
forward: forward
|
|
33
|
-
}];
|
|
21
|
+
}, [state]);
|
|
22
|
+
return [state, setStatePromise];
|
|
34
23
|
};
|
|
35
24
|
export default usePromiseState;
|
|
@@ -5,7 +5,8 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
5
5
|
var _excluded = ["datasetCode"];
|
|
6
6
|
import { useBoolean, useMemoizedFn } from 'ahooks';
|
|
7
7
|
import { message } from 'luck-design/antd';
|
|
8
|
-
import { keys, isNil } from 'lodash';
|
|
8
|
+
import { keys, isNil, isFunction } from 'lodash';
|
|
9
|
+
import usePageDataStore from "./usePageDataStore";
|
|
9
10
|
import { executeCode } from "./helper";
|
|
10
11
|
import { fetchCallBehavior } from "../../constants/api-url";
|
|
11
12
|
var useTodo = function useTodo() {
|
|
@@ -25,10 +26,13 @@ var useTodo = function useTodo() {
|
|
|
25
26
|
behaviorKey: behaviorKey
|
|
26
27
|
}, params), data);
|
|
27
28
|
});
|
|
29
|
+
var moduleData = usePageDataStore(function (state) {
|
|
30
|
+
return state.moduleData;
|
|
31
|
+
});
|
|
28
32
|
var todo = useMemoizedFn(function (ctx, actionPool) {
|
|
29
33
|
var argsMap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
30
34
|
if (isNil(actionPool)) {
|
|
31
|
-
return;
|
|
35
|
+
return Promise.resolve();
|
|
32
36
|
}
|
|
33
37
|
var dsCode = argsMap.datasetCode,
|
|
34
38
|
args = _objectWithoutProperties(argsMap, _excluded);
|
|
@@ -47,21 +51,27 @@ var useTodo = function useTodo() {
|
|
|
47
51
|
return Promise.resolve(executeCode.apply(void 0, [ctx, info.code, argsName].concat(_toConsumableArray(_args))));
|
|
48
52
|
case 'page-action':
|
|
49
53
|
{
|
|
50
|
-
var
|
|
51
|
-
moduleCode =
|
|
52
|
-
datasetCode =
|
|
53
|
-
params =
|
|
54
|
-
data =
|
|
54
|
+
var _ref4 = executeCode.apply(void 0, [ctx, info.code, argsName].concat(_toConsumableArray(_args))) || {},
|
|
55
|
+
moduleCode = _ref4.moduleCode,
|
|
56
|
+
datasetCode = _ref4.datasetCode,
|
|
57
|
+
params = _ref4.params,
|
|
58
|
+
data = _ref4.data,
|
|
59
|
+
after = _ref4.after;
|
|
60
|
+
var _moduleCode = moduleCode || moduleData.moduleCode;
|
|
55
61
|
var _dscode = datasetCode || dsCode;
|
|
56
|
-
if (!
|
|
62
|
+
if (!_moduleCode || !_dscode) {
|
|
57
63
|
message.warning('接口重要参数(模块编码或数据集编码)丢失');
|
|
58
64
|
return;
|
|
59
65
|
}
|
|
60
66
|
return callBehavior({
|
|
61
67
|
datasetCode: _dscode,
|
|
62
|
-
moduleCode:
|
|
68
|
+
moduleCode: _moduleCode,
|
|
63
69
|
behaviorKey: actionKey
|
|
64
|
-
}, params, data)
|
|
70
|
+
}, params, data).then(function (res) {
|
|
71
|
+
if (isFunction(after)) {
|
|
72
|
+
after(ctx, res);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
65
75
|
}
|
|
66
76
|
case 'trigger':
|
|
67
77
|
return Promise.resolve();
|
package/es/lowcode/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
export { default as Painter } from "./painter";
|
|
2
2
|
export { default as View } from "./view";
|
|
3
|
-
export { default as Preview } from "./preview";
|
|
4
|
-
// export * as dataProcess from './engine/tools/dataProcess';
|
|
5
|
-
|
|
6
|
-
export default function launcher() {}
|
|
3
|
+
export { default as Preview } from "./preview";
|
|
@@ -5,7 +5,7 @@ import { useMemoizedFn } from 'ahooks';
|
|
|
5
5
|
import moment from 'moment';
|
|
6
6
|
import { ConfigProvider } from 'luck-design/antd';
|
|
7
7
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
8
|
-
import {
|
|
8
|
+
import { getCanUndoAndRedo } from "../engine/provider/ContextProvider";
|
|
9
9
|
import DesignToolbar from "./DesignToolbar";
|
|
10
10
|
import DesignOperator from "./DesignOperator";
|
|
11
11
|
import Page from "../view/Page";
|
|
@@ -13,7 +13,6 @@ import styles from "./style/design.less";
|
|
|
13
13
|
var Design = function Design() {
|
|
14
14
|
var _localeInfo$locale;
|
|
15
15
|
var simulatorRef = useRef(null);
|
|
16
|
-
var remoteSource = useRemoteSource();
|
|
17
16
|
var _useState = useState(function () {
|
|
18
17
|
return getLocale();
|
|
19
18
|
}),
|
|
@@ -27,7 +26,9 @@ var Design = function Design() {
|
|
|
27
26
|
intl = _useState4[0],
|
|
28
27
|
setIntl = _useState4[1];
|
|
29
28
|
var unblock = useMemoizedFn(function () {
|
|
30
|
-
|
|
29
|
+
var _getCanUndoAndRedo = getCanUndoAndRedo(),
|
|
30
|
+
canUndo = _getCanUndoAndRedo.canUndo;
|
|
31
|
+
if (canUndo) return confirm("".concat(formatMessage({
|
|
31
32
|
id: 'app.base.operate.comfire.leave',
|
|
32
33
|
label: '离开当前页面?'
|
|
33
34
|
}), "\n").concat(formatMessage({
|
|
@@ -37,7 +38,9 @@ var Design = function Design() {
|
|
|
37
38
|
return true;
|
|
38
39
|
});
|
|
39
40
|
var handleBeforeUnload = useMemoizedFn(function (event) {
|
|
40
|
-
|
|
41
|
+
var _getCanUndoAndRedo2 = getCanUndoAndRedo(),
|
|
42
|
+
canUndo = _getCanUndoAndRedo2.canUndo;
|
|
43
|
+
if (canUndo) {
|
|
41
44
|
event.preventDefault();
|
|
42
45
|
event.returnValue = null;
|
|
43
46
|
return null;
|
|
@@ -71,7 +74,7 @@ var Design = function Design() {
|
|
|
71
74
|
}), /*#__PURE__*/React.createElement("div", {
|
|
72
75
|
className: styles['lc-painter-design-workspace']
|
|
73
76
|
}, /*#__PURE__*/React.createElement(DesignOperator, {
|
|
74
|
-
|
|
77
|
+
canvas: simulatorRef
|
|
75
78
|
}), /*#__PURE__*/React.createElement(ConfigProvider, {
|
|
76
79
|
locale: ((_localeInfo$locale = localeInfo[locale]) === null || _localeInfo$locale === void 0 ? void 0 : _localeInfo$locale.antd) || {}
|
|
77
80
|
}, /*#__PURE__*/React.createElement(RawIntlProvider, {
|