@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
|
@@ -3,18 +3,17 @@ import React, { useRef, useEffect, useState } from 'react';
|
|
|
3
3
|
import { last, initial } from 'lodash';
|
|
4
4
|
import { useEventListener, useSetState, useMemoizedFn, useCreation, useSize, useLatest } from 'ahooks';
|
|
5
5
|
import { Icon, Dropdown, message } from 'luck-design/antd';
|
|
6
|
-
import { reverse } from 'lodash';
|
|
6
|
+
import { reverse, isString, isNil } from 'lodash';
|
|
7
7
|
import { suid } from '@luck-design-biz/base/utils';
|
|
8
|
-
import { useContext,
|
|
9
|
-
import {
|
|
10
|
-
import { LC_BUILDIN_UNIT_KEY, LC_COMPONENT_UNIT_KEY, LC_COMPONENT_UNIT, CONTAINER_UNITS } from "../constants";
|
|
8
|
+
import { useContext, addNode, deleteNode } from "../engine/provider/ContextProvider";
|
|
9
|
+
import { LC_BUILDIN_UNIT_KEY, LC_COMPONENT_UNIT_KEY, LC_COMPONENT_UNIT, LC_FORMITEM_UNIT, CONTAINER_UNITS } from "../constants";
|
|
11
10
|
import styles from "./style/design.less";
|
|
12
11
|
var _MODAL_COMPONENT_ = ['Dialog', 'Drawer'];
|
|
13
|
-
var getOperatorStyle = function getOperatorStyle(
|
|
12
|
+
var getOperatorStyle = function getOperatorStyle(canvas, cellNode) {
|
|
14
13
|
if (!cellNode) return {};
|
|
15
|
-
var
|
|
16
|
-
pageLeft =
|
|
17
|
-
pageTop =
|
|
14
|
+
var _canvas$getBoundingCl = canvas.getBoundingClientRect(),
|
|
15
|
+
pageLeft = _canvas$getBoundingCl.left,
|
|
16
|
+
pageTop = _canvas$getBoundingCl.top;
|
|
18
17
|
var _cellNode$getBounding = cellNode.getBoundingClientRect(),
|
|
19
18
|
cellNodeLeft = _cellNode$getBounding.left,
|
|
20
19
|
cellNodeTop = _cellNode$getBounding.top;
|
|
@@ -26,14 +25,10 @@ var getOperatorStyle = function getOperatorStyle(page, cellNode) {
|
|
|
26
25
|
};
|
|
27
26
|
};
|
|
28
27
|
var DesignOperator = function DesignOperator(_ref) {
|
|
29
|
-
var
|
|
30
|
-
var
|
|
28
|
+
var _getElement, _getElement2;
|
|
29
|
+
var canvas = _ref.canvas;
|
|
31
30
|
var context = useContext();
|
|
32
|
-
var
|
|
33
|
-
_usePageData2 = _slicedToArray(_usePageData, 2),
|
|
34
|
-
pageData = _usePageData2[0],
|
|
35
|
-
setPageData = _usePageData2[1].setPageData;
|
|
36
|
-
var size = useSize(target);
|
|
31
|
+
var size = useSize(canvas);
|
|
37
32
|
var _useState = useState(suid()),
|
|
38
33
|
_useState2 = _slicedToArray(_useState, 2),
|
|
39
34
|
positionKey = _useState2[0],
|
|
@@ -47,48 +42,53 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
47
42
|
setOperatorId = _useSetState2[1];
|
|
48
43
|
var lastSelectorId = useLatest(operatorId.selector);
|
|
49
44
|
var currentModal = useRef(null);
|
|
50
|
-
var
|
|
45
|
+
var getElement = useMemoizedFn(function (_target) {
|
|
51
46
|
var _context$componentMap;
|
|
52
|
-
return (_context$componentMap = context.componentMap.get(
|
|
47
|
+
return isString(_target) ? (_context$componentMap = context.componentMap.get(_target)) === null || _context$componentMap === void 0 ? void 0 : _context$componentMap.api.getSelfDom() : _target;
|
|
53
48
|
});
|
|
54
|
-
var handleSelect = useMemoizedFn(function (
|
|
55
|
-
context.$publisher(context.topics.COMPONENT_ACTIVE,
|
|
56
|
-
|
|
49
|
+
var handleSelect = useMemoizedFn(function (_target) {
|
|
50
|
+
context.$publisher(context.topics.COMPONENT_ACTIVE, _target ? {
|
|
51
|
+
target: _target
|
|
57
52
|
} : null);
|
|
58
53
|
});
|
|
59
|
-
var handleHover = useMemoizedFn(function (
|
|
60
|
-
context.$publisher(context.topics.COMPONENT_HOVER,
|
|
61
|
-
|
|
54
|
+
var handleHover = useMemoizedFn(function (_target) {
|
|
55
|
+
context.$publisher(context.topics.COMPONENT_HOVER, _target ? {
|
|
56
|
+
target: _target
|
|
62
57
|
} : null);
|
|
63
58
|
});
|
|
64
59
|
var handleDelete = useMemoizedFn(function (_ref2) {
|
|
65
60
|
var id = _ref2.id;
|
|
66
61
|
context.$publisher(context.topics.COMPONENT_DELETE, {
|
|
67
|
-
id: id
|
|
68
|
-
pageData: pageData
|
|
62
|
+
id: id
|
|
69
63
|
});
|
|
70
64
|
});
|
|
71
65
|
var addComponent = useMemoizedFn(function (data, targetId) {
|
|
72
|
-
var json = require("../engine/meta/".concat(data.component.toLowerCase(), ".props.default.json"));
|
|
73
|
-
var _id = "".concat(data.component.toLowerCase(), "_").concat(suid());
|
|
74
|
-
add(pageData, targetId, _id, json);
|
|
75
66
|
context.$subscriber(context.topics.COMPONENT_MOUNT).once(function (_ref3) {
|
|
76
67
|
var mountCompId = _ref3.id;
|
|
77
68
|
if (mountCompId === _id) {
|
|
78
69
|
context.$publisher(context.topics.COMPONENT_APPEND, {
|
|
79
|
-
id: _id,
|
|
80
|
-
pageData: pageData
|
|
81
|
-
});
|
|
82
|
-
context.$publisher(context.topics.COMPONENT_ACTIVE, {
|
|
83
70
|
id: _id
|
|
84
71
|
});
|
|
72
|
+
handleSelect(_id);
|
|
85
73
|
}
|
|
86
74
|
}).watch();
|
|
87
|
-
|
|
75
|
+
var json = require("../engine/meta/".concat(data.component.toLowerCase(), ".props.default.json"));
|
|
76
|
+
var _id = "".concat(data.component.toLowerCase(), "_").concat(suid());
|
|
77
|
+
addNode(targetId, _id, json);
|
|
88
78
|
});
|
|
89
79
|
var acticeProps = useCreation(function () {
|
|
90
80
|
if (!operatorId.selector) return null;
|
|
91
|
-
var
|
|
81
|
+
var _id = isNil(operatorId.selectorTarget) ? operatorId.selector : operatorId.selectorTarget.ancestorId;
|
|
82
|
+
var levelNodes = context.componentMap.get(_id).api.getLevelNodes();
|
|
83
|
+
if (operatorId.selectorTarget) {
|
|
84
|
+
var _operatorId$selectorT = operatorId.selectorTarget,
|
|
85
|
+
id = _operatorId$selectorT.id,
|
|
86
|
+
label = _operatorId$selectorT.label;
|
|
87
|
+
levelNodes.push({
|
|
88
|
+
id: id,
|
|
89
|
+
name: label
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
92
|
return {
|
|
93
93
|
props: last(levelNodes),
|
|
94
94
|
menu: /*#__PURE__*/React.createElement("div", {
|
|
@@ -110,50 +110,70 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
110
110
|
}))
|
|
111
111
|
};
|
|
112
112
|
}, [operatorId.selector]);
|
|
113
|
-
var
|
|
114
|
-
|
|
113
|
+
var lastDetectorName = useCreation(function () {
|
|
114
|
+
var _last;
|
|
115
|
+
return operatorId.detector && isString(operatorId.detector) ? (_last = last(context.componentMap.get(operatorId.detector).api.getLevelNodes())) === null || _last === void 0 ? void 0 : _last.name : void 0;
|
|
115
116
|
}, [operatorId.detector]);
|
|
116
117
|
useEventListener('mousemove', function (event) {
|
|
117
118
|
var elem = event.target;
|
|
119
|
+
var targetFormItem = elem.closest("[".concat(LC_COMPONENT_UNIT_KEY, "=\"").concat(LC_FORMITEM_UNIT, "\"]"));
|
|
120
|
+
if (targetFormItem) {
|
|
121
|
+
handleHover(targetFormItem);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
118
124
|
var targetCell = elem.closest("[".concat(LC_COMPONENT_UNIT_KEY, "=\"").concat(LC_COMPONENT_UNIT, "\"]"));
|
|
119
125
|
var targetCellId = targetCell === null || targetCell === void 0 ? void 0 : targetCell.id;
|
|
120
126
|
if (targetCellId && targetCellId !== operatorId.detector && targetCellId !== operatorId.selector) {
|
|
121
|
-
|
|
122
|
-
detector: targetCellId
|
|
123
|
-
});
|
|
124
|
-
context.$publisher(context.topics.COMPONENT_HOVER, {
|
|
125
|
-
id: targetCellId
|
|
126
|
-
});
|
|
127
|
+
handleHover(targetCellId);
|
|
127
128
|
} else if (!targetCell || targetCellId === operatorId.selector) {
|
|
128
|
-
|
|
129
|
-
detector: null
|
|
130
|
-
});
|
|
131
|
-
context.$publisher(context.topics.COMPONENT_HOVER, null);
|
|
129
|
+
handleHover();
|
|
132
130
|
}
|
|
133
131
|
}, {
|
|
134
|
-
target:
|
|
132
|
+
target: canvas
|
|
135
133
|
});
|
|
136
134
|
useEventListener('mouseleave', function () {
|
|
137
135
|
if (operatorId.detector) {
|
|
138
|
-
|
|
139
|
-
detector: null
|
|
140
|
-
});
|
|
141
|
-
context.$publisher(context.topics.COMPONENT_HOVER, null);
|
|
136
|
+
handleHover();
|
|
142
137
|
}
|
|
143
138
|
}, {
|
|
144
|
-
target:
|
|
139
|
+
target: canvas
|
|
145
140
|
});
|
|
146
141
|
useEventListener('click', function (event) {
|
|
147
142
|
var elem = event.target;
|
|
143
|
+
var targetFormItem = elem.closest("[".concat(LC_COMPONENT_UNIT_KEY, "=\"").concat(LC_FORMITEM_UNIT, "\"]"));
|
|
144
|
+
if (targetFormItem) {
|
|
145
|
+
var _fieldName = targetFormItem.getAttribute('data-__field');
|
|
146
|
+
var _fieldLabel = targetFormItem.getAttribute('data-__label');
|
|
147
|
+
var _masterId = targetFormItem.getAttribute('data-__master');
|
|
148
|
+
var _ancestorId = targetFormItem.closest("[".concat(LC_COMPONENT_UNIT_KEY, "=\"").concat(LC_COMPONENT_UNIT, "\"]")).getAttribute('id');
|
|
149
|
+
var _ancestor = context.componentMap.get(_ancestorId);
|
|
150
|
+
var ancestorData = _ancestor.api.getSelfData();
|
|
151
|
+
var blockIndex = ancestorData.props.blocks.findIndex(function (b) {
|
|
152
|
+
return b.id === _masterId;
|
|
153
|
+
});
|
|
154
|
+
var fieldIndex = ancestorData.props.blocks[blockIndex].fields.findIndex(function (f) {
|
|
155
|
+
return f.field === _fieldName;
|
|
156
|
+
});
|
|
157
|
+
var _target = {
|
|
158
|
+
element: targetFormItem,
|
|
159
|
+
id: "".concat(_ancestorId, ".").concat(_masterId, ".").concat(_fieldName),
|
|
160
|
+
field: _fieldName,
|
|
161
|
+
label: _fieldLabel,
|
|
162
|
+
masterId: _masterId,
|
|
163
|
+
ancestorId: _ancestorId,
|
|
164
|
+
keyPath: "blocks[".concat(blockIndex, "].fields[").concat(fieldIndex, "]")
|
|
165
|
+
};
|
|
166
|
+
handleHover();
|
|
167
|
+
handleSelect(_target);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
148
170
|
var targetCell = elem.closest("[".concat(LC_COMPONENT_UNIT_KEY, "=\"").concat(LC_COMPONENT_UNIT, "\"]"));
|
|
149
171
|
var targetCellId = targetCell === null || targetCell === void 0 ? void 0 : targetCell.id;
|
|
150
172
|
if (!targetCellId || targetCellId === operatorId.selector) return;
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
id: targetCell.id
|
|
154
|
-
});
|
|
173
|
+
handleHover();
|
|
174
|
+
handleSelect(targetCell.id);
|
|
155
175
|
}, {
|
|
156
|
-
target:
|
|
176
|
+
target: canvas
|
|
157
177
|
});
|
|
158
178
|
useEffect(function () {
|
|
159
179
|
var csid = context.$subscriber(context.topics.COMPONENT_SETTING_CLICK).on(function (_ref4) {
|
|
@@ -165,9 +185,7 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
165
185
|
toggle: true,
|
|
166
186
|
id: compId
|
|
167
187
|
});
|
|
168
|
-
|
|
169
|
-
id: compId
|
|
170
|
-
});
|
|
188
|
+
handleSelect(compId);
|
|
171
189
|
}).watch();
|
|
172
190
|
addComponent(data, LC_BUILDIN_UNIT_KEY.PAGE_ROOT);
|
|
173
191
|
return;
|
|
@@ -183,39 +201,49 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
183
201
|
addComponent(data, lastSelectorId.current);
|
|
184
202
|
}).watch();
|
|
185
203
|
var hcid = context.$subscriber(context.topics.COMPONENT_HOVER).on(function (payload) {
|
|
186
|
-
if (payload.
|
|
187
|
-
detector: payload.
|
|
204
|
+
if (payload.target) setOperatorId({
|
|
205
|
+
detector: payload.target
|
|
188
206
|
});else setOperatorId({
|
|
189
207
|
detector: null
|
|
190
208
|
});
|
|
191
209
|
}).watch();
|
|
192
210
|
var acid = context.$subscriber(context.topics.COMPONENT_ACTIVE).on(function (payload) {
|
|
193
|
-
if (payload.
|
|
194
|
-
|
|
195
|
-
node =
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
211
|
+
if (payload.target) {
|
|
212
|
+
if (isString(payload.target)) {
|
|
213
|
+
var node = context.componentMap.get(payload.target).api.getSelfData();
|
|
214
|
+
setOperatorId({
|
|
215
|
+
selector: payload.target,
|
|
216
|
+
selectorTarget: null,
|
|
217
|
+
deletable: !node || node.props.buildIn !== true,
|
|
218
|
+
detector: null
|
|
219
|
+
});
|
|
220
|
+
} else {
|
|
221
|
+
setOperatorId({
|
|
222
|
+
selector: payload.target.id,
|
|
223
|
+
selectorTarget: payload.target,
|
|
224
|
+
deletable: false,
|
|
225
|
+
detector: null
|
|
226
|
+
});
|
|
227
|
+
}
|
|
201
228
|
} else {
|
|
202
229
|
setOperatorId({
|
|
203
|
-
selector: null
|
|
230
|
+
selector: null,
|
|
231
|
+
selectorTarget: null
|
|
204
232
|
});
|
|
205
233
|
}
|
|
206
234
|
}).watch();
|
|
207
235
|
var cmtid = context.$subscriber(context.topics.COMPONENT_MODAL_TOGGLE).on(function (_ref6) {
|
|
208
236
|
var toggle = _ref6.toggle,
|
|
209
237
|
id = _ref6.id;
|
|
210
|
-
if (toggle) {
|
|
211
|
-
|
|
238
|
+
if (toggle && id !== currentModal.current) {
|
|
239
|
+
canvas.current.style.setProperty('overflow', 'hidden');
|
|
212
240
|
var _modal = context.componentMap.get(id);
|
|
213
241
|
var _prevModal = currentModal.current ? context.componentMap.get(currentModal.current) : null;
|
|
214
242
|
_prevModal === null || _prevModal === void 0 || _prevModal.api.doClose();
|
|
215
243
|
_modal.api.doOpen();
|
|
216
244
|
currentModal.current = id;
|
|
217
|
-
} else {
|
|
218
|
-
|
|
245
|
+
} else if (!toggle) {
|
|
246
|
+
canvas.current.style.removeProperty('overflow');
|
|
219
247
|
var _id = id || currentModal.current;
|
|
220
248
|
if (_id) {
|
|
221
249
|
var _modal2 = context.componentMap.get(_id);
|
|
@@ -225,13 +253,11 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
225
253
|
}
|
|
226
254
|
}).watch();
|
|
227
255
|
var cdid = context.$subscriber(context.topics.COMPONENT_DELETE).on(function (_ref7) {
|
|
228
|
-
var id = _ref7.id
|
|
229
|
-
pageData = _ref7.pageData;
|
|
256
|
+
var id = _ref7.id;
|
|
230
257
|
if (lastSelectorId.current === id) {
|
|
231
|
-
|
|
258
|
+
handleSelect();
|
|
232
259
|
}
|
|
233
|
-
|
|
234
|
-
setPageData(pageData);
|
|
260
|
+
deleteNode(id);
|
|
235
261
|
});
|
|
236
262
|
return function () {
|
|
237
263
|
context.$unsubscriber(context.topics.COMPONENT_SETTING_CLICK, csid);
|
|
@@ -252,22 +278,22 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
252
278
|
return /*#__PURE__*/React.createElement(React.Fragment, null, operatorId.detector && /*#__PURE__*/React.createElement("div", {
|
|
253
279
|
id: "lc-detector",
|
|
254
280
|
className: styles['lc-painter-design-detector'],
|
|
255
|
-
style: getOperatorStyle(
|
|
281
|
+
style: getOperatorStyle(canvas.current, getElement(operatorId.detector))
|
|
256
282
|
}, /*#__PURE__*/React.createElement("span", {
|
|
257
283
|
className: styles['lc-painter-design-detector-name'],
|
|
258
284
|
style: {
|
|
259
|
-
top: ((
|
|
285
|
+
top: ((_getElement = getElement(operatorId.detector)) === null || _getElement === void 0 ? void 0 : _getElement.offsetTop) < 23 ? 0 : '-23px'
|
|
260
286
|
}
|
|
261
|
-
},
|
|
287
|
+
}, lastDetectorName ? "".concat(lastDetectorName, "(").concat(operatorId.detector, ")") : null)), operatorId.selector && /*#__PURE__*/React.createElement("div", {
|
|
262
288
|
id: "lc-selector",
|
|
263
289
|
key: "".concat((size === null || size === void 0 ? void 0 : size.width) || 0, "-").concat((size === null || size === void 0 ? void 0 : size.height) || 0, "-").concat(positionKey),
|
|
264
290
|
className: styles['lc-painter-design-selector'],
|
|
265
|
-
style: getOperatorStyle(
|
|
291
|
+
style: getOperatorStyle(canvas.current, getElement(isNil(operatorId.selectorTarget) ? operatorId.selector : operatorId.selectorTarget.element))
|
|
266
292
|
}, acticeProps && /*#__PURE__*/React.createElement("div", {
|
|
267
293
|
className: styles['lc-borders-actions'],
|
|
268
294
|
style: acticeProps.props.id === LC_BUILDIN_UNIT_KEY.PAGE_ROOT ? {
|
|
269
295
|
top: 0
|
|
270
|
-
} : ((
|
|
296
|
+
} : ((_getElement2 = getElement(isNil(operatorId.selectorTarget) ? operatorId.selector : operatorId.selectorTarget.element)) === null || _getElement2 === void 0 ? void 0 : _getElement2.offsetTop) < 23 ? {
|
|
271
297
|
bottom: '-23px'
|
|
272
298
|
} : {
|
|
273
299
|
top: '-23px'
|
|
@@ -11,13 +11,14 @@ import { useLocation } from 'umi';
|
|
|
11
11
|
import classNames from 'classnames';
|
|
12
12
|
import { useMemoizedFn, useRequest, useDebounceFn, useCookieState } from 'ahooks';
|
|
13
13
|
import { Select, Button, Icon, Divider, Modal, message, Drawer } from 'luck-design/antd';
|
|
14
|
-
import {
|
|
15
|
-
import { useContext,
|
|
14
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
15
|
+
import { useContext, useGet, resetPageData, useTemporalStore } from "../engine/provider/ContextProvider";
|
|
16
16
|
import JsonEditor from "../painter/components/code-editor/JsonEditor";
|
|
17
|
-
import
|
|
17
|
+
import PreviewIframe from "./components/PreviewIframe";
|
|
18
18
|
import { LC_BUILDIN_UNIT_KEY, COOKIE_VIRTUAL_ACCOUNT_KEY } from "../constants";
|
|
19
19
|
import styles from "./style/design.less";
|
|
20
20
|
import { fetchClearCache, fetchUpdatePageData } from "../constants/api-url";
|
|
21
|
+
import { getLDMetaAttr } from "../engine/tools/helper";
|
|
21
22
|
import { readAllUser } from '@luck-design-biz/base/lib/sys/services';
|
|
22
23
|
var DesignToolbar = function DesignToolbar(_ref) {
|
|
23
24
|
var locale = _ref.locale,
|
|
@@ -25,17 +26,7 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
25
26
|
var location = useLocation();
|
|
26
27
|
var editorRef = useRef();
|
|
27
28
|
var context = useContext();
|
|
28
|
-
var
|
|
29
|
-
_usePageData2 = _slicedToArray(_usePageData, 2),
|
|
30
|
-
pageData = _usePageData2[0],
|
|
31
|
-
_usePageData2$ = _usePageData2[1],
|
|
32
|
-
setPageData = _usePageData2$.setPageData,
|
|
33
|
-
back = _usePageData2$.back,
|
|
34
|
-
forward = _usePageData2$.forward,
|
|
35
|
-
backLength = _usePageData2$.backLength,
|
|
36
|
-
forwardLength = _usePageData2$.forwardLength;
|
|
37
|
-
var _ref2 = useRemoteSource() || {},
|
|
38
|
-
pageinfo = _ref2.pageinfo;
|
|
29
|
+
var pageData = useGet();
|
|
39
30
|
var _useState = useState(null),
|
|
40
31
|
_useState2 = _slicedToArray(_useState, 2),
|
|
41
32
|
langList = _useState2[0],
|
|
@@ -56,6 +47,18 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
56
47
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
57
48
|
userOptions = _useState10[0],
|
|
58
49
|
setUserOptions = _useState10[1];
|
|
50
|
+
var _useTemporalStore = useTemporalStore(function (state) {
|
|
51
|
+
return {
|
|
52
|
+
undo: state.undo,
|
|
53
|
+
redo: state.redo,
|
|
54
|
+
pastStates: state.pastStates,
|
|
55
|
+
futureStates: state.futureStates
|
|
56
|
+
};
|
|
57
|
+
}),
|
|
58
|
+
canUndo = _useTemporalStore.canUndo,
|
|
59
|
+
canRedo = _useTemporalStore.canRedo,
|
|
60
|
+
undo = _useTemporalStore.undo,
|
|
61
|
+
redo = _useTemporalStore.redo;
|
|
59
62
|
var _useCookieState = useCookieState(COOKIE_VIRTUAL_ACCOUNT_KEY),
|
|
60
63
|
_useCookieState2 = _slicedToArray(_useCookieState, 2),
|
|
61
64
|
userId = _useCookieState2[0],
|
|
@@ -64,7 +67,7 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
64
67
|
manual: true
|
|
65
68
|
}),
|
|
66
69
|
clearCacheLoading = _useRequest.loading,
|
|
67
|
-
runClearCache = _useRequest.
|
|
70
|
+
runClearCache = _useRequest.runAsync;
|
|
68
71
|
var _useRequest2 = useRequest(fetchUpdatePageData, {
|
|
69
72
|
manual: true,
|
|
70
73
|
debounceWait: 300
|
|
@@ -72,8 +75,8 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
72
75
|
updatePageDataLoading = _useRequest2.loading,
|
|
73
76
|
runAsync = _useRequest2.runAsync;
|
|
74
77
|
useEffect(function () {
|
|
75
|
-
var topicId = context.$subscriber(context.topics.LANG_SETTING_SELECT).on(function (
|
|
76
|
-
var _langList =
|
|
78
|
+
var topicId = context.$subscriber(context.topics.LANG_SETTING_SELECT).on(function (_ref2) {
|
|
79
|
+
var _langList = _ref2.langList;
|
|
77
80
|
return setLangList(_langList);
|
|
78
81
|
}).watch();
|
|
79
82
|
return function () {
|
|
@@ -86,25 +89,43 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
86
89
|
}
|
|
87
90
|
}, [showPreview]);
|
|
88
91
|
var handleSave = useMemoizedFn( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
89
|
-
var _pageinfo$relationshi;
|
|
90
92
|
var _yield$runAsync, code;
|
|
91
93
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
92
94
|
while (1) switch (_context.prev = _context.next) {
|
|
93
95
|
case 0:
|
|
94
|
-
|
|
96
|
+
message.loading({
|
|
97
|
+
content: formatMessage({
|
|
98
|
+
id: 'luckda.lowcode.design.toolbar.save.on',
|
|
99
|
+
label: '保存中...'
|
|
100
|
+
}),
|
|
101
|
+
key: 'saveLoading'
|
|
102
|
+
});
|
|
103
|
+
_context.next = 3;
|
|
95
104
|
return runAsync({
|
|
96
105
|
pageData: JSON.stringify(pageData),
|
|
97
|
-
pageCode:
|
|
106
|
+
pageCode: getLDMetaAttr('pageCode')
|
|
98
107
|
});
|
|
99
|
-
case
|
|
108
|
+
case 3:
|
|
100
109
|
_yield$runAsync = _context.sent;
|
|
101
110
|
code = _yield$runAsync.code;
|
|
102
111
|
if (code === 1) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
112
|
+
message.success({
|
|
113
|
+
content: formatMessage({
|
|
114
|
+
id: 'luckda.lowcode.design.toolbar.save.success',
|
|
115
|
+
label: '保存成功'
|
|
116
|
+
}),
|
|
117
|
+
key: 'saveLoading'
|
|
118
|
+
});
|
|
119
|
+
} else {
|
|
120
|
+
message.error({
|
|
121
|
+
content: formatMessage({
|
|
122
|
+
id: 'luckda.lowcode.design.toolbar.save.error',
|
|
123
|
+
label: '保存失败'
|
|
124
|
+
}),
|
|
125
|
+
key: 'saveLoading'
|
|
126
|
+
});
|
|
106
127
|
}
|
|
107
|
-
case
|
|
128
|
+
case 6:
|
|
108
129
|
case "end":
|
|
109
130
|
return _context.stop();
|
|
110
131
|
}
|
|
@@ -126,7 +147,7 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
126
147
|
zIndex: 3000,
|
|
127
148
|
onOk: function onOk() {
|
|
128
149
|
return runClearCache({
|
|
129
|
-
moduleCode:
|
|
150
|
+
moduleCode: getLDMetaAttr('moduleCode')
|
|
130
151
|
});
|
|
131
152
|
}
|
|
132
153
|
});
|
|
@@ -135,9 +156,10 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
135
156
|
var code = editorRef.current.editor.getValue();
|
|
136
157
|
try {
|
|
137
158
|
var data = JSON.parse(code);
|
|
138
|
-
|
|
159
|
+
resetPageData(data);
|
|
139
160
|
setShow(false);
|
|
140
161
|
} catch (e) {
|
|
162
|
+
console.error(e);
|
|
141
163
|
message.warning(formatMessage({
|
|
142
164
|
id: 'luckda.lowcode.error.pagedata',
|
|
143
165
|
label: '页面数据错误'
|
|
@@ -145,7 +167,7 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
145
167
|
}
|
|
146
168
|
});
|
|
147
169
|
var _useDebounceFn = useDebounceFn( /*#__PURE__*/function () {
|
|
148
|
-
var
|
|
170
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(value) {
|
|
149
171
|
var _yield$readAllUser, code, list, detail;
|
|
150
172
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
151
173
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -175,7 +197,7 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
175
197
|
}, _callee2);
|
|
176
198
|
}));
|
|
177
199
|
return function (_x) {
|
|
178
|
-
return
|
|
200
|
+
return _ref4.apply(this, arguments);
|
|
179
201
|
};
|
|
180
202
|
}(), {
|
|
181
203
|
wait: 500
|
|
@@ -213,9 +235,9 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
213
235
|
})), /*#__PURE__*/React.createElement(Divider, {
|
|
214
236
|
type: "vertical"
|
|
215
237
|
}), /*#__PURE__*/React.createElement("span", {
|
|
216
|
-
className: classNames(styles['toolbar-item'], _defineProperty({}, styles.disabled,
|
|
238
|
+
className: classNames(styles['toolbar-item'], _defineProperty({}, styles.disabled, !canUndo)),
|
|
217
239
|
onClick: function onClick() {
|
|
218
|
-
return
|
|
240
|
+
return canUndo && undo();
|
|
219
241
|
}
|
|
220
242
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
221
243
|
viewBox: "0 0 1024 1024",
|
|
@@ -228,9 +250,9 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
228
250
|
}, /*#__PURE__*/React.createElement("path", {
|
|
229
251
|
d: "M946.8 420L651.9 125.1c-19.5-19.5-52.7-5.7-52.7 21.8v174c-79.3-1.8-501.8 14.9-532.3 569.6-0.9 17.2 22.1 24.3 30.6 9.3C255 621 396.6 553.3 599.1 561.5v175.2c0 27.5 33.3 41.3 52.8 21.9l294.8-294.9c12.1-12.1 12.1-31.6 0.1-43.7z"
|
|
230
252
|
}))), /*#__PURE__*/React.createElement("span", {
|
|
231
|
-
className: classNames(styles['toolbar-item'], _defineProperty({}, styles.disabled,
|
|
253
|
+
className: classNames(styles['toolbar-item'], _defineProperty({}, styles.disabled, !canRedo)),
|
|
232
254
|
onClick: function onClick() {
|
|
233
|
-
return
|
|
255
|
+
return canRedo && redo();
|
|
234
256
|
}
|
|
235
257
|
}, /*#__PURE__*/React.createElement("svg", {
|
|
236
258
|
viewBox: "0 0 1024 1024",
|
|
@@ -249,7 +271,7 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
249
271
|
className: styles['toolbar-item'],
|
|
250
272
|
onClick: function onClick() {
|
|
251
273
|
context.$publisher(context.topics.COMPONENT_ACTIVE, {
|
|
252
|
-
|
|
274
|
+
target: LC_BUILDIN_UNIT_KEY.PAGE_ROOT
|
|
253
275
|
});
|
|
254
276
|
}
|
|
255
277
|
}, formatMessage({
|
|
@@ -263,7 +285,7 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
263
285
|
fontSize: 12,
|
|
264
286
|
margin: '0 4px 0 2px'
|
|
265
287
|
},
|
|
266
|
-
|
|
288
|
+
disabled: clearCacheLoading,
|
|
267
289
|
onClick: handleClearCache
|
|
268
290
|
}, formatMessage({
|
|
269
291
|
id: 'luckda.lowcode.design.toolbar.clear',
|
|
@@ -274,18 +296,33 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
274
296
|
fontSize: 12,
|
|
275
297
|
margin: '0 4px 0 2px'
|
|
276
298
|
},
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
299
|
+
disabled: updatePageDataLoading,
|
|
300
|
+
onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
301
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
302
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
303
|
+
case 0:
|
|
304
|
+
_context3.next = 2;
|
|
305
|
+
return handleSave();
|
|
306
|
+
case 2:
|
|
307
|
+
context.$publisher(context.topics.COMPONENT_ACTIVE, null);
|
|
308
|
+
setShowPreview(true);
|
|
309
|
+
case 4:
|
|
310
|
+
case "end":
|
|
311
|
+
return _context3.stop();
|
|
312
|
+
}
|
|
313
|
+
}, _callee3);
|
|
314
|
+
}))
|
|
280
315
|
}, formatMessage({
|
|
281
316
|
id: 'luckda.lowcode.design.toolbar.preview',
|
|
282
317
|
label: '预览'
|
|
283
318
|
})), /*#__PURE__*/React.createElement(Button, {
|
|
284
319
|
size: "small",
|
|
285
320
|
type: "primary",
|
|
321
|
+
disabled: updatePageDataLoading,
|
|
286
322
|
style: {
|
|
287
323
|
fontSize: 12,
|
|
288
|
-
padding: '0 7px 0 0'
|
|
324
|
+
padding: '0 7px 0 0',
|
|
325
|
+
marginLeft: 2
|
|
289
326
|
}
|
|
290
327
|
}, /*#__PURE__*/React.createElement("div", {
|
|
291
328
|
style: {
|
|
@@ -304,7 +341,7 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
304
341
|
return setShow(true);
|
|
305
342
|
}
|
|
306
343
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
307
|
-
type:
|
|
344
|
+
type: "eye"
|
|
308
345
|
})))), /*#__PURE__*/React.createElement(Modal, {
|
|
309
346
|
visible: show,
|
|
310
347
|
width: 1024,
|
|
@@ -312,15 +349,15 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
312
349
|
return document.getElementById('lc-design-workspace');
|
|
313
350
|
},
|
|
314
351
|
zIndex: 3000,
|
|
315
|
-
bodyStyle: {
|
|
316
|
-
height: '70vh'
|
|
317
|
-
},
|
|
318
352
|
onOk: handleOk,
|
|
319
353
|
onCancel: function onCancel() {
|
|
320
354
|
return setShow(false);
|
|
321
355
|
}
|
|
322
356
|
}, /*#__PURE__*/React.createElement(JsonEditor, {
|
|
323
|
-
ref: editorRef
|
|
357
|
+
ref: editorRef,
|
|
358
|
+
style: {
|
|
359
|
+
height: '70vh'
|
|
360
|
+
}
|
|
324
361
|
}, JSON.stringify(pageData, null, '\t'))), /*#__PURE__*/React.createElement(Drawer, {
|
|
325
362
|
title: /*#__PURE__*/React.createElement("div", {
|
|
326
363
|
id: "preview-drawer-header",
|
|
@@ -374,8 +411,9 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
374
411
|
})))),
|
|
375
412
|
placement: "bottom",
|
|
376
413
|
height: "94vh",
|
|
377
|
-
footer: false
|
|
378
|
-
zIndex
|
|
414
|
+
footer: false
|
|
415
|
+
// zIndex={3000}
|
|
416
|
+
,
|
|
379
417
|
headerStyle: {
|
|
380
418
|
padding: '0 48px 0 24px'
|
|
381
419
|
},
|
|
@@ -391,7 +429,7 @@ var DesignToolbar = function DesignToolbar(_ref) {
|
|
|
391
429
|
getContainer: function getContainer() {
|
|
392
430
|
return document.getElementById('lc-design-workspace');
|
|
393
431
|
}
|
|
394
|
-
}, /*#__PURE__*/React.createElement(
|
|
432
|
+
}, /*#__PURE__*/React.createElement(PreviewIframe, {
|
|
395
433
|
code: location.query.code,
|
|
396
434
|
userId: userId || 'no-user'
|
|
397
435
|
})));
|