@luck-design-biz/luckda 0.0.24-2 → 0.0.25-1
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/es/components/Builder/index.js +6 -4
- package/es/components/IconFont/index.js +5 -0
- package/es/components/LDActions/index.js +133 -0
- package/es/components/LDActions/index.less +65 -0
- package/es/components/LdAutoForm/index.js +1 -1
- package/es/components/LdCom/index.js +2 -1
- package/es/components/LdFormList/index.js +15 -10
- package/es/components/LdGrid/index.js +14 -8
- package/es/components/LdGridForm/index.js +5 -4
- package/es/components/LdRuntimeCom/index.js +20 -7
- package/es/components/LdTree/index.js +112 -31
- package/es/components/LdTree/index.less +6 -1
- package/es/helper/ldBuilder.js +28 -12
- package/es/helper/ldComBuild.js +29 -14
- package/es/index.js +1 -0
- package/es/locales/zh-CN.js +221 -0
- package/es/lowcode/constants/api-url.js +380 -262
- package/es/lowcode/constants/event-topics.js +4 -0
- package/es/lowcode/constants/index.js +30 -2
- package/es/lowcode/engine/factory/panel-item-factory/CheckboxStrategy.js +32 -0
- package/es/lowcode/engine/factory/panel-item-factory/index.js +2 -0
- package/es/lowcode/engine/meta/box.props.default.json +3 -2
- package/es/lowcode/engine/meta/box.props.json +1 -3
- package/es/lowcode/engine/meta/button.props.default.json +5 -2
- package/es/lowcode/engine/meta/button.props.json +8 -8
- package/es/lowcode/engine/meta/cardlist.props.default.json +4 -2
- package/es/lowcode/engine/meta/cardlist.props.json +1 -2
- package/es/lowcode/engine/meta/dialog.props.default.json +4 -2
- package/es/lowcode/engine/meta/dialog.props.json +0 -1
- package/es/lowcode/engine/meta/drawer.props.default.json +4 -2
- package/es/lowcode/engine/meta/drawer.props.json +0 -1
- package/es/lowcode/engine/meta/form.props.default.json +53 -4
- package/es/lowcode/engine/meta/form.props.json +584 -55
- package/es/lowcode/engine/meta/iframe.props.default.json +1 -1
- package/es/lowcode/engine/meta/iframe.props.json +1 -1
- package/es/lowcode/engine/meta/image.props.default.json +5 -2
- package/es/lowcode/engine/meta/image.props.json +1 -1
- package/es/lowcode/engine/meta/imex.props.default.json +5 -2
- package/es/lowcode/engine/meta/imex.props.json +1 -1
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +152 -26
- package/es/lowcode/engine/meta/jsx.props.default.json +2 -1
- package/es/lowcode/engine/meta/jsx.props.json +10 -5
- package/es/lowcode/engine/meta/layout.props.default.json +5 -2
- package/es/lowcode/engine/meta/layout.props.json +1 -2
- package/es/lowcode/engine/meta/link.props.default.json +5 -2
- package/es/lowcode/engine/meta/link.props.json +2 -2
- package/es/lowcode/engine/meta/local/local.zh-cn.js +97 -0
- package/es/lowcode/engine/meta/page.props.default.json +12 -0
- package/es/lowcode/engine/meta/page.props.json +49 -0
- package/es/lowcode/engine/meta/pagecontent.props.default.json +6 -0
- package/es/lowcode/engine/meta/pagecontent.props.json +7 -0
- package/es/lowcode/engine/meta/pagefooter.props.default.json +6 -0
- package/es/lowcode/engine/meta/pagefooter.props.json +7 -0
- package/es/lowcode/engine/meta/pageheader.props.default.json +6 -0
- package/es/lowcode/engine/meta/pageheader.props.json +7 -0
- package/es/lowcode/engine/meta/section.props.default.json +5 -2
- package/es/lowcode/engine/meta/section.props.json +1 -1
- package/es/lowcode/engine/meta/split.props.default.json +9 -4
- package/es/lowcode/engine/meta/split.props.json +14 -29
- package/es/lowcode/engine/meta/table.props.default.json +23 -3
- package/es/lowcode/engine/meta/table.props.json +257 -55
- package/es/lowcode/engine/meta/tabs.props.default.json +16 -9
- package/es/lowcode/engine/meta/tabs.props.json +57 -81
- package/es/lowcode/engine/meta/text.props.default.json +5 -2
- package/es/lowcode/engine/meta/text.props.json +1 -1
- package/es/lowcode/engine/meta/tree.props.default.json +20 -7
- package/es/lowcode/engine/meta/tree.props.json +225 -79
- package/es/lowcode/engine/provider/ContextProvider/index.js +169 -0
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +161 -0
- package/es/lowcode/engine/tools/dataProcess.js +64 -2
- package/es/lowcode/engine/tools/helper.js +96 -19
- package/es/lowcode/engine/tools/useCanvasRender.js +75 -0
- package/es/lowcode/engine/tools/usePromiseState.js +8 -6
- package/es/lowcode/engine/tools/useTodo.js +78 -0
- package/es/lowcode/index.js +1 -0
- package/es/lowcode/painter/Components.js +47 -21
- package/es/lowcode/painter/DesignOperator.js +47 -28
- package/es/lowcode/painter/DesignToolbar.js +86 -15
- package/es/lowcode/painter/I18n.js +2 -2
- package/es/lowcode/painter/Outline.js +31 -26
- package/es/lowcode/painter/Panel.js +100 -142
- package/es/lowcode/painter/Ribbon.js +1 -1
- package/es/lowcode/painter/components/ActionBindModal.js +293 -0
- package/es/lowcode/painter/components/AdvancePanel.js +140 -0
- package/es/lowcode/painter/components/AttrsPanel.js +145 -0
- package/es/lowcode/painter/components/Collapse.js +20 -9
- package/es/lowcode/painter/components/ColorInput.js +5 -3
- package/es/lowcode/painter/components/DragDrop/DragDropContext.js +137 -0
- package/es/lowcode/painter/components/DragDrop/DragDropWrapper.js +47 -0
- package/es/lowcode/painter/components/DragDrop/Overlay.js +8 -0
- package/es/lowcode/painter/components/DragDrop/TreeDragDropWrapper.js +67 -0
- package/es/lowcode/painter/components/FieldSelector.js +44 -0
- package/es/lowcode/painter/components/ListEditor.js +18 -9
- package/es/lowcode/painter/components/PanelItem.js +1 -1
- package/es/lowcode/painter/components/PopConfirm.js +10 -3
- package/es/lowcode/painter/components/SortBox.js +11 -4
- package/es/lowcode/painter/components/TreeEditor.js +13 -0
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +14 -2
- package/es/lowcode/painter/components/code-editor/JSEditor.js +25 -14
- package/es/lowcode/painter/components/code-editor/JsonEditor.js +41 -0
- package/es/lowcode/painter/components/field-setting/BatchSetting.js +144 -0
- package/es/lowcode/painter/components/field-setting/CheckRules.js +126 -0
- package/es/lowcode/painter/components/field-setting/FieldAttrs.js +287 -0
- package/es/lowcode/painter/components/field-setting/FieldAttrsModal.js +290 -0
- package/es/lowcode/painter/components/field-setting/FieldDefaultValue.js +63 -0
- package/es/lowcode/painter/components/field-setting/FieldRulesModal.js +116 -0
- package/es/lowcode/painter/components/field-setting/SettingUI.js +419 -0
- package/es/lowcode/painter/components/field-setting/index.js +363 -0
- package/es/lowcode/painter/index.js +3 -1
- package/es/lowcode/painter/panel-section/ActionsEditor/ActionEditor.js +101 -0
- package/es/lowcode/painter/{components/actions-editor → panel-section/ActionsEditor}/index.js +74 -13
- package/es/lowcode/painter/panel-section/BlockEditor/index.js +24 -0
- package/es/lowcode/painter/panel-section/BlocksEditor/BlockEditorItem.js +44 -0
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +202 -0
- package/es/lowcode/painter/panel-section/DataSetSelector.js +115 -43
- package/es/lowcode/painter/panel-section/FieldsSetting.js +308 -0
- package/es/lowcode/painter/panel-section/Icon.js +14 -14
- package/es/lowcode/painter/panel-section/IconConditionSelector.js +111 -0
- package/es/lowcode/painter/panel-section/IconSelector.js +5 -2
- package/es/lowcode/painter/panel-section/ImpExp.js +91 -0
- package/es/lowcode/painter/panel-section/JSEditor.js +49 -0
- package/es/lowcode/painter/panel-section/LayoutRatio.js +6 -7
- package/es/lowcode/painter/panel-section/SerialsSelector.js +44 -0
- package/es/lowcode/painter/panel-section/SplitDisplay.js +248 -0
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/StyleContext.js +2 -22
- package/es/lowcode/painter/panel-section/TabItems.js +46 -30
- package/es/lowcode/painter/panel-section/TableTopFilter.js +306 -0
- package/es/lowcode/painter/panel-section/TableZebra.js +66 -6
- package/es/lowcode/painter/panel-section/TreeRootEditor.js +78 -0
- package/es/lowcode/painter/services/toolbar.js +25 -0
- package/es/lowcode/painter/style/action-bind-modal.less +102 -0
- package/es/lowcode/painter/style/collapse.less +6 -0
- package/es/lowcode/painter/style/components.less +5 -4
- package/es/lowcode/painter/style/design.less +2 -3
- package/es/lowcode/painter/style/dragdrop.less +10 -0
- package/es/lowcode/painter/style/fields-setting.less +25 -0
- package/es/lowcode/painter/style/impexp.less +7 -0
- package/es/lowcode/painter/style/panel-attrs.less +43 -0
- package/es/lowcode/painter/style/panel.less +6 -37
- package/es/lowcode/painter/style/pop-confirm.less +9 -2
- package/es/lowcode/painter/style/split-display.less +28 -0
- package/es/lowcode/painter/style/treedragdrop.less +19 -0
- package/es/lowcode/preview/index.js +14 -0
- package/es/lowcode/view/Canvas.js +34 -139
- package/es/lowcode/view/Loading.js +6 -2
- package/es/lowcode/view/Page.js +16 -14
- package/es/lowcode/view/lc-components/Box/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Box/index.js +11 -2
- package/es/lowcode/view/lc-components/Box/index.less +0 -1
- package/es/lowcode/view/lc-components/Box/meta.json +1 -3
- package/es/lowcode/view/lc-components/Button/FunctionDesign.js +8 -10
- package/es/lowcode/view/lc-components/Button/FunctionLive.js +3 -6
- package/es/lowcode/view/lc-components/Button/FunctionPreview.js +6 -0
- package/es/lowcode/view/lc-components/Button/index.js +43 -20
- package/es/lowcode/view/lc-components/Button/meta.json +8 -8
- package/es/lowcode/view/lc-components/CardList/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/CardList/index.js +1 -0
- package/es/lowcode/view/lc-components/CardList/meta.json +1 -2
- package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +17 -23
- package/es/lowcode/view/lc-components/Dialog/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Dialog/index.js +1 -0
- package/es/lowcode/view/lc-components/Dialog/meta.json +0 -1
- package/es/lowcode/view/lc-components/Drawer/FunctionDesign.js +4 -2
- package/es/lowcode/view/lc-components/Drawer/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Drawer/index.js +17 -0
- package/es/lowcode/view/lc-components/Drawer/index.less +3 -0
- package/es/lowcode/view/lc-components/Drawer/meta.json +0 -1
- package/es/lowcode/view/lc-components/Form/FunctionDesign.js +31 -2
- package/es/lowcode/view/lc-components/Form/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Form/index.js +114 -8
- package/es/lowcode/view/lc-components/Form/index.less +5 -0
- package/es/lowcode/view/lc-components/Form/meta.json +534 -55
- package/es/lowcode/view/lc-components/Iframe/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Iframe/index.js +1 -0
- package/es/lowcode/view/lc-components/Iframe/meta.json +1 -1
- package/es/lowcode/view/lc-components/ImEx/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/ImEx/index.js +1 -0
- package/es/lowcode/view/lc-components/ImEx/meta.json +1 -1
- package/es/lowcode/view/lc-components/Image/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Image/index.js +1 -0
- package/es/lowcode/view/lc-components/Image/meta.json +1 -1
- package/es/lowcode/view/lc-components/JSX/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/JSX/index.js +19 -6
- package/es/lowcode/view/lc-components/JSX/meta.json +8 -5
- package/es/lowcode/view/lc-components/Layout/FunctionDesign.js +19 -17
- package/es/lowcode/view/lc-components/Layout/FunctionLive.js +3 -8
- package/es/lowcode/view/lc-components/Layout/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Layout/index.js +1 -0
- package/es/lowcode/view/lc-components/Layout/meta.json +1 -2
- package/es/lowcode/view/lc-components/Link/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Link/index.js +1 -0
- package/es/lowcode/view/lc-components/Link/meta.json +2 -2
- package/es/lowcode/view/lc-components/Page/meta.json +49 -0
- package/es/lowcode/view/lc-components/PageContent/index.js +53 -0
- package/es/lowcode/view/lc-components/PageContent/meta.json +9 -0
- package/es/lowcode/view/lc-components/PageFooter/index.js +38 -0
- package/es/lowcode/view/lc-components/PageFooter/meta.json +9 -0
- package/es/lowcode/view/lc-components/PageHeader/index.js +40 -0
- package/es/lowcode/view/lc-components/PageHeader/meta.json +9 -0
- package/es/lowcode/view/lc-components/PageModal/index.js +23 -0
- package/es/lowcode/view/lc-components/Section/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Section/index.js +1 -0
- package/es/lowcode/view/lc-components/Section/meta.json +1 -1
- package/es/lowcode/view/lc-components/Split/FunctionDesign.js +59 -2
- package/es/lowcode/view/lc-components/Split/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Split/index.js +46 -7
- package/es/lowcode/view/lc-components/Split/meta.json +10 -29
- package/es/lowcode/view/lc-components/Table/FunctionDesign.js +41 -4
- package/es/lowcode/view/lc-components/Table/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Table/components/TopFilter.js +96 -0
- package/es/lowcode/view/lc-components/Table/index.js +365 -49
- package/es/lowcode/view/lc-components/Table/meta.json +229 -55
- package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +72 -2
- package/es/lowcode/view/lc-components/Tabs/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Tabs/FunctionPreview.js +10 -0
- package/es/lowcode/view/lc-components/Tabs/index.js +113 -10
- package/es/lowcode/view/lc-components/Tabs/meta.json +53 -81
- package/es/lowcode/view/lc-components/Text/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Text/index.js +1 -0
- package/es/lowcode/view/lc-components/Text/meta.json +1 -1
- package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +63 -3
- package/es/lowcode/view/lc-components/Tree/FunctionPreview.js +26 -0
- package/es/lowcode/view/lc-components/Tree/index.js +323 -8
- package/es/lowcode/view/lc-components/Tree/index.less +5 -0
- package/es/lowcode/view/lc-components/Tree/meta.json +224 -80
- package/es/lowcode/view/lc-components/Wrapper.js +44 -27
- package/es/lowcode/view/style/page.less +3 -0
- package/es/services.js +5 -3
- package/es/utils/grid.js +2 -2
- package/lib/components/Builder/index.js +4 -1
- package/lib/components/IconFont/index.js +11 -0
- package/lib/components/LDActions/index.js +141 -0
- package/lib/components/LDActions/index.less +65 -0
- package/lib/components/LdAutoForm/index.js +1 -1
- package/lib/components/LdCom/index.js +2 -1
- package/lib/components/LdFormList/index.js +14 -9
- package/lib/components/LdGrid/index.js +13 -7
- package/lib/components/LdGridForm/index.js +4 -3
- package/lib/components/LdRuntimeCom/index.js +21 -8
- package/lib/components/LdTree/index.js +112 -31
- package/lib/components/LdTree/index.less +6 -1
- package/lib/helper/ldBuilder.js +28 -12
- package/lib/helper/ldComBuild.js +27 -12
- package/lib/index.js +8 -0
- package/lib/locales/zh-CN.js +227 -0
- package/lib/lowcode/constants/api-url.js +382 -263
- package/lib/lowcode/constants/event-topics.js +5 -1
- package/lib/lowcode/constants/index.js +31 -3
- package/lib/lowcode/engine/factory/panel-item-factory/CheckboxStrategy.js +38 -0
- package/lib/lowcode/engine/factory/panel-item-factory/index.js +2 -0
- package/lib/lowcode/engine/meta/box.props.default.json +3 -2
- package/lib/lowcode/engine/meta/box.props.json +1 -3
- package/lib/lowcode/engine/meta/button.props.default.json +5 -2
- package/lib/lowcode/engine/meta/button.props.json +8 -8
- package/lib/lowcode/engine/meta/cardlist.props.default.json +4 -2
- package/lib/lowcode/engine/meta/cardlist.props.json +1 -2
- package/lib/lowcode/engine/meta/dialog.props.default.json +4 -2
- package/lib/lowcode/engine/meta/dialog.props.json +0 -1
- package/lib/lowcode/engine/meta/drawer.props.default.json +4 -2
- package/lib/lowcode/engine/meta/drawer.props.json +0 -1
- package/lib/lowcode/engine/meta/form.props.default.json +53 -4
- package/lib/lowcode/engine/meta/form.props.json +584 -55
- package/lib/lowcode/engine/meta/iframe.props.default.json +1 -1
- package/lib/lowcode/engine/meta/iframe.props.json +1 -1
- package/lib/lowcode/engine/meta/image.props.default.json +5 -2
- package/lib/lowcode/engine/meta/image.props.json +1 -1
- package/lib/lowcode/engine/meta/imex.props.default.json +5 -2
- package/lib/lowcode/engine/meta/imex.props.json +1 -1
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +152 -26
- package/lib/lowcode/engine/meta/jsx.props.default.json +2 -1
- package/lib/lowcode/engine/meta/jsx.props.json +10 -5
- package/lib/lowcode/engine/meta/layout.props.default.json +5 -2
- package/lib/lowcode/engine/meta/layout.props.json +1 -2
- package/lib/lowcode/engine/meta/link.props.default.json +5 -2
- package/lib/lowcode/engine/meta/link.props.json +2 -2
- package/lib/lowcode/engine/meta/local/local.zh-cn.js +103 -0
- package/lib/lowcode/engine/meta/page.props.default.json +12 -0
- package/lib/lowcode/engine/meta/page.props.json +49 -0
- package/lib/lowcode/engine/meta/pagecontent.props.default.json +6 -0
- package/lib/lowcode/engine/meta/pagecontent.props.json +7 -0
- package/lib/lowcode/engine/meta/pagefooter.props.default.json +6 -0
- package/lib/lowcode/engine/meta/pagefooter.props.json +7 -0
- package/lib/lowcode/engine/meta/pageheader.props.default.json +6 -0
- package/lib/lowcode/engine/meta/pageheader.props.json +7 -0
- package/lib/lowcode/engine/meta/section.props.default.json +5 -2
- package/lib/lowcode/engine/meta/section.props.json +1 -1
- package/lib/lowcode/engine/meta/split.props.default.json +9 -4
- package/lib/lowcode/engine/meta/split.props.json +14 -29
- package/lib/lowcode/engine/meta/table.props.default.json +23 -3
- package/lib/lowcode/engine/meta/table.props.json +257 -55
- package/lib/lowcode/engine/meta/tabs.props.default.json +16 -9
- package/lib/lowcode/engine/meta/tabs.props.json +57 -81
- package/lib/lowcode/engine/meta/text.props.default.json +5 -2
- package/lib/lowcode/engine/meta/text.props.json +1 -1
- package/lib/lowcode/engine/meta/tree.props.default.json +20 -7
- package/lib/lowcode/engine/meta/tree.props.json +225 -79
- package/lib/lowcode/engine/provider/ContextProvider/index.js +177 -0
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +169 -0
- package/lib/lowcode/engine/tools/dataProcess.js +64 -1
- package/lib/lowcode/engine/tools/helper.js +100 -18
- package/lib/lowcode/engine/tools/useCanvasRender.js +90 -0
- package/lib/lowcode/engine/tools/usePromiseState.js +7 -5
- package/lib/lowcode/engine/tools/useTodo.js +85 -0
- package/lib/lowcode/index.js +7 -0
- package/lib/lowcode/painter/Components.js +46 -20
- package/lib/lowcode/painter/DesignOperator.js +45 -26
- package/lib/lowcode/painter/DesignToolbar.js +82 -11
- package/lib/lowcode/painter/I18n.js +1 -1
- package/lib/lowcode/painter/Outline.js +29 -24
- package/lib/lowcode/painter/Panel.js +97 -139
- package/lib/lowcode/painter/Ribbon.js +1 -1
- package/lib/lowcode/painter/components/ActionBindModal.js +300 -0
- package/lib/lowcode/painter/components/AdvancePanel.js +148 -0
- package/lib/lowcode/painter/components/AttrsPanel.js +153 -0
- package/lib/lowcode/painter/components/Collapse.js +20 -9
- package/lib/lowcode/painter/components/ColorInput.js +5 -3
- package/lib/lowcode/painter/components/DragDrop/DragDropContext.js +146 -0
- package/lib/lowcode/painter/components/DragDrop/DragDropWrapper.js +54 -0
- package/lib/lowcode/painter/components/DragDrop/Overlay.js +15 -0
- package/lib/lowcode/painter/components/DragDrop/TreeDragDropWrapper.js +75 -0
- package/lib/lowcode/painter/components/FieldSelector.js +52 -0
- package/lib/lowcode/painter/components/ListEditor.js +17 -8
- package/lib/lowcode/painter/components/PanelItem.js +1 -1
- package/lib/lowcode/painter/components/PopConfirm.js +10 -3
- package/lib/lowcode/painter/components/SortBox.js +12 -5
- package/lib/lowcode/painter/components/TreeEditor.js +20 -0
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +14 -2
- package/lib/lowcode/painter/components/code-editor/JSEditor.js +25 -14
- package/lib/lowcode/painter/components/code-editor/JsonEditor.js +48 -0
- package/lib/lowcode/painter/components/field-setting/BatchSetting.js +151 -0
- package/lib/lowcode/painter/components/field-setting/CheckRules.js +133 -0
- package/lib/lowcode/painter/components/field-setting/FieldAttrs.js +295 -0
- package/lib/lowcode/painter/components/field-setting/FieldAttrsModal.js +298 -0
- package/lib/lowcode/painter/components/field-setting/FieldDefaultValue.js +70 -0
- package/lib/lowcode/painter/components/field-setting/FieldRulesModal.js +123 -0
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +427 -0
- package/lib/lowcode/painter/components/field-setting/index.js +370 -0
- package/lib/lowcode/painter/index.js +3 -1
- package/lib/lowcode/painter/{components/actions-editor → panel-section/ActionsEditor}/ActionEditor.js +20 -66
- package/lib/lowcode/painter/{components/actions-editor → panel-section/ActionsEditor}/index.js +71 -10
- package/lib/lowcode/painter/panel-section/BlockEditor/index.js +31 -0
- package/lib/lowcode/painter/panel-section/BlocksEditor/BlockEditorItem.js +51 -0
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +208 -0
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +112 -40
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +316 -0
- package/lib/lowcode/painter/panel-section/Icon.js +16 -14
- package/lib/lowcode/painter/panel-section/IconConditionSelector.js +119 -0
- package/lib/lowcode/painter/panel-section/IconSelector.js +5 -2
- package/lib/lowcode/painter/panel-section/ImpExp.js +98 -0
- package/lib/lowcode/painter/panel-section/JSEditor.js +57 -0
- package/lib/lowcode/painter/panel-section/LayoutRatio.js +5 -6
- package/lib/lowcode/painter/panel-section/SerialsSelector.js +51 -0
- package/lib/lowcode/painter/panel-section/SplitDisplay.js +256 -0
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/StyleContext.js +3 -23
- package/lib/lowcode/painter/panel-section/TabItems.js +45 -29
- package/lib/lowcode/painter/panel-section/TableTopFilter.js +314 -0
- package/lib/lowcode/painter/panel-section/TableZebra.js +67 -6
- package/lib/lowcode/painter/panel-section/TreeRootEditor.js +86 -0
- package/lib/lowcode/painter/services/toolbar.js +32 -0
- package/lib/lowcode/painter/style/action-bind-modal.less +102 -0
- package/lib/lowcode/painter/style/collapse.less +6 -0
- package/lib/lowcode/painter/style/components.less +5 -4
- package/lib/lowcode/painter/style/design.less +2 -3
- package/lib/lowcode/painter/style/dragdrop.less +10 -0
- package/lib/lowcode/painter/style/fields-setting.less +25 -0
- package/lib/lowcode/painter/style/impexp.less +7 -0
- package/lib/lowcode/painter/style/panel-attrs.less +43 -0
- package/lib/lowcode/painter/style/panel.less +6 -37
- package/lib/lowcode/painter/style/pop-confirm.less +9 -2
- package/lib/lowcode/painter/style/split-display.less +28 -0
- package/lib/lowcode/painter/style/treedragdrop.less +19 -0
- package/lib/lowcode/preview/index.js +21 -0
- package/lib/lowcode/view/Canvas.js +32 -145
- package/lib/lowcode/view/Loading.js +6 -2
- package/lib/lowcode/view/Page.js +12 -10
- package/lib/lowcode/view/lc-components/Box/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Box/index.js +11 -2
- package/lib/lowcode/view/lc-components/Box/index.less +0 -1
- package/lib/lowcode/view/lc-components/Box/meta.json +1 -3
- package/lib/lowcode/view/lc-components/Button/FunctionDesign.js +8 -10
- package/lib/lowcode/view/lc-components/Button/FunctionLive.js +3 -6
- package/lib/lowcode/view/lc-components/Button/FunctionPreview.js +13 -0
- package/lib/lowcode/view/lc-components/Button/index.js +41 -18
- package/lib/lowcode/view/lc-components/Button/meta.json +8 -8
- package/lib/lowcode/view/lc-components/CardList/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/CardList/index.js +1 -0
- package/lib/lowcode/view/lc-components/CardList/meta.json +1 -2
- package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +16 -23
- package/lib/lowcode/view/lc-components/Dialog/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Dialog/index.js +1 -0
- package/lib/lowcode/view/lc-components/Dialog/meta.json +0 -1
- package/lib/lowcode/view/lc-components/Drawer/FunctionDesign.js +4 -2
- package/lib/lowcode/view/lc-components/Drawer/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Drawer/index.js +17 -0
- package/lib/lowcode/view/lc-components/Drawer/index.less +3 -0
- package/lib/lowcode/view/lc-components/Drawer/meta.json +0 -1
- package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +32 -2
- package/lib/lowcode/view/lc-components/Form/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Form/index.js +113 -7
- package/lib/lowcode/view/lc-components/Form/index.less +5 -0
- package/lib/lowcode/view/lc-components/Form/meta.json +534 -55
- package/lib/lowcode/view/lc-components/Iframe/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Iframe/index.js +1 -0
- package/lib/lowcode/view/lc-components/Iframe/meta.json +1 -1
- package/lib/lowcode/view/lc-components/ImEx/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/ImEx/index.js +1 -0
- package/lib/lowcode/view/lc-components/ImEx/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Image/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Image/index.js +1 -0
- package/lib/lowcode/view/lc-components/Image/meta.json +1 -1
- package/lib/lowcode/view/lc-components/JSX/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/JSX/index.js +19 -6
- package/lib/lowcode/view/lc-components/JSX/meta.json +8 -5
- package/lib/lowcode/view/lc-components/Layout/FunctionDesign.js +21 -18
- package/lib/lowcode/view/lc-components/Layout/FunctionLive.js +3 -8
- package/lib/lowcode/view/lc-components/Layout/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Layout/index.js +1 -0
- package/lib/lowcode/view/lc-components/Layout/meta.json +1 -2
- package/lib/lowcode/view/lc-components/Link/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Link/index.js +1 -0
- package/lib/lowcode/view/lc-components/Link/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Page/meta.json +49 -0
- package/lib/lowcode/view/lc-components/PageContent/index.js +61 -0
- package/lib/lowcode/view/lc-components/PageContent/meta.json +9 -0
- package/lib/lowcode/view/lc-components/PageFooter/index.js +46 -0
- package/lib/lowcode/view/lc-components/PageFooter/meta.json +9 -0
- package/lib/lowcode/view/lc-components/PageHeader/index.js +48 -0
- package/lib/lowcode/view/lc-components/PageHeader/meta.json +9 -0
- package/lib/lowcode/view/lc-components/PageModal/index.js +30 -0
- package/lib/lowcode/view/lc-components/Section/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Section/index.js +1 -0
- package/lib/lowcode/view/lc-components/Section/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +60 -2
- package/lib/lowcode/view/lc-components/Split/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Split/index.js +45 -6
- package/lib/lowcode/view/lc-components/Split/meta.json +10 -29
- package/lib/lowcode/view/lc-components/Table/FunctionDesign.js +43 -5
- package/lib/lowcode/view/lc-components/Table/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Table/components/TopFilter.js +104 -0
- package/lib/lowcode/view/lc-components/Table/index.js +364 -48
- package/lib/lowcode/view/lc-components/Table/meta.json +229 -55
- package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +73 -2
- package/lib/lowcode/view/lc-components/Tabs/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Tabs/FunctionPreview.js +17 -0
- package/lib/lowcode/view/lc-components/Tabs/index.js +112 -9
- package/lib/lowcode/view/lc-components/Tabs/meta.json +53 -81
- package/lib/lowcode/view/lc-components/Text/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Text/index.js +1 -0
- package/lib/lowcode/view/lc-components/Text/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +64 -3
- package/lib/lowcode/view/lc-components/Tree/FunctionPreview.js +33 -0
- package/lib/lowcode/view/lc-components/Tree/index.js +321 -6
- package/lib/lowcode/view/lc-components/Tree/index.less +5 -0
- package/lib/lowcode/view/lc-components/Tree/meta.json +224 -80
- package/lib/lowcode/view/lc-components/Wrapper.js +42 -25
- package/lib/lowcode/view/style/page.less +3 -0
- package/lib/services.js +5 -3
- package/lib/utils/grid.js +2 -2
- package/package.json +12 -7
- package/es/lowcode/engine/provider/ContextProvider.js +0 -169
- package/es/lowcode/painter/components/actions-editor/ActionEditor.js +0 -147
- package/es/lowcode/painter/panel-section/TableActions.js +0 -19
- package/lib/lowcode/engine/provider/ContextProvider.js +0 -177
- package/lib/lowcode/painter/panel-section/TableActions.js +0 -26
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Icon } from 'luck-design/antd';
|
|
4
|
+
import { isNil } from 'lodash';
|
|
5
|
+
import Collapse from "../../components/Collapse";
|
|
6
|
+
var BlockEditorItem = function BlockEditorItem(_ref) {
|
|
7
|
+
var children = _ref.children,
|
|
8
|
+
onDelete = _ref.onDelete,
|
|
9
|
+
name = _ref.name,
|
|
10
|
+
setNodeRef = _ref.setNodeRef,
|
|
11
|
+
style = _ref.style,
|
|
12
|
+
setActivatorNodeRef = _ref.setActivatorNodeRef,
|
|
13
|
+
attributes = _ref.attributes,
|
|
14
|
+
listeners = _ref.listeners;
|
|
15
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
ref: setNodeRef,
|
|
17
|
+
style: style
|
|
18
|
+
}, /*#__PURE__*/React.createElement(Collapse, {
|
|
19
|
+
label: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", _extends({
|
|
20
|
+
ref: setActivatorNodeRef
|
|
21
|
+
}, attributes, listeners), /*#__PURE__*/React.createElement("svg", {
|
|
22
|
+
fill: "currentColor",
|
|
23
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
24
|
+
width: "16",
|
|
25
|
+
height: "12",
|
|
26
|
+
viewBox: "0 0 5 12",
|
|
27
|
+
style: {
|
|
28
|
+
verticalAlign: 'middle'
|
|
29
|
+
}
|
|
30
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
31
|
+
d: "M0.499972716,6 L1.50002728,6 C1.77615459,6 2,6.22384541 2,6.49997272 C2,6.77610002 1.77615459,6.99994543 1.50002728,6.99994543 L0.499972716,6.99994543 C0.22384541,6.99994543 3.38158422e-17,6.77610002 0,6.49997272 C-3.38158422e-17,6.22384541 0.22384541,6 0.499972716,6 Z M0.499972716,3 L1.50002728,3 C1.77615459,3 2,3.22384541 2,3.49997272 C2,3.77610002 1.77615459,3.99994543 1.50002728,3.99994543 L0.499972716,3.99994543 C0.22384541,3.99994543 3.38158422e-17,3.77610002 0,3.49997272 C-3.38158422e-17,3.22384541 0.22384541,3 0.499972716,3 Z M0.499972716,7.28787148e-18 L1.50002728,5.55666624e-14 C1.77615459,7.07214574e-14 2,0.22384541 2,0.499972716 C2,0.776100022 1.77615459,0.999945432 1.50002728,0.999945432 L0.499972716,0.999945432 C0.22384541,0.999945432 3.38158422e-17,0.776100022 0,0.499972716 C-3.38158422e-17,0.22384541 0.22384541,5.0723721e-17 0.499972716,0 Z M0.5,9.00002729 L1.5,9.00002729 C1.77614237,9.00002729 2,9.22388491 2,9.50002729 C2,9.77616966 1.77614237,10.0000273 1.5,10.0000273 L0.5,10.0000273 C0.223857625,10.0000273 3.38176876e-17,9.77616966 0,9.50002729 C-3.38176876e-17,9.22388491 0.223857625,9.00002729 0.5,9.00002729 Z M0.5,12.0000273 L1.5,12.0000273 C1.77614237,12.0000273 2,12.2238849 2,12.5000273 C2,12.7761697 1.77614237,13.0000273 1.5,13.0000273 L0.5,13.0000273 C0.223857625,13.0000273 3.38176876e-17,12.7761697 0,12.5000273 C-3.38176876e-17,12.2238849 0.223857625,12.0000273 0.5,12.0000273 Z M0.5,15.0000273 L1.5,15.0000273 C1.77614237,15.0000273 2,15.2238849 2,15.5000273 C2,15.7761697 1.77614237,16.0000273 1.5,16.0000273 L0.5,16.0000273 C0.223857625,16.0000273 3.38176876e-17,15.7761697 0,15.5000273 C-3.38176876e-17,15.2238849 0.223857625,15.0000273 0.5,15.0000273 Z M3.49997272,6 L4.50002728,6 C4.77615459,6 5,6.22384541 5,6.49997272 C5,6.77610002 4.77615459,6.99994543 4.50002728,6.99994543 L3.49997272,6.99994543 C3.22384541,6.99994543 3,6.77610002 3,6.49997272 C3,6.22384541 3.22384541,6 3.49997272,6 Z M3.49997272,3 L4.50002728,3 C4.77615459,3 5,3.22384541 5,3.49997272 C5,3.77610002 4.77615459,3.99994543 4.50002728,3.99994543 L3.49997272,3.99994543 C3.22384541,3.99994543 3,3.77610002 3,3.49997272 C3,3.22384541 3.22384541,3 3.49997272,3 Z M3.49997272,7.28787148e-18 L4.50002728,5.55666624e-14 C4.77615459,7.07214574e-14 5,0.22384541 5,0.499972716 C5,0.776100022 4.77615459,0.999945432 4.50002728,0.999945432 L3.49997272,0.999945432 C3.22384541,0.999945432 3,0.776100022 3,0.499972716 C3,0.22384541 3.22384541,5.0723721e-17 3.49997272,0 Z M3.5,9.00002729 L4.5,9.00002729 C4.77614237,9.00002729 5,9.22388491 5,9.50002729 C5,9.77616966 4.77614237,10.0000273 4.5,10.0000273 L3.5,10.0000273 C3.22385763,10.0000273 3,9.77616966 3,9.50002729 C3,9.22388491 3.22385763,9.00002729 3.5,9.00002729 Z M3.5,12.0000273 L4.5,12.0000273 C4.77614237,12.0000273 5,12.2238849 5,12.5000273 C5,12.7761697 4.77614237,13.0000273 4.5,13.0000273 L3.5,13.0000273 C3.22385763,13.0000273 3,12.7761697 3,12.5000273 C3,12.2238849 3.22385763,12.0000273 3.5,12.0000273 Z M3.5,15.0000273 L4.5,15.0000273 C4.77614237,15.0000273 5,15.2238849 5,15.5000273 C5,15.7761697 4.77614237,16.0000273 4.5,16.0000273 L3.5,16.0000273 C3.22385763,16.0000273 3,15.7761697 3,15.5000273 C3,15.2238849 3.22385763,15.0000273 3.5,15.0000273 Z"
|
|
32
|
+
}))), name),
|
|
33
|
+
extraRender: isNil(onDelete) ? false : function () {
|
|
34
|
+
return /*#__PURE__*/React.createElement(Icon, {
|
|
35
|
+
type: "delete",
|
|
36
|
+
style: {
|
|
37
|
+
color: 'var(--luck-color-danger)'
|
|
38
|
+
},
|
|
39
|
+
onClick: onDelete
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}, children));
|
|
43
|
+
};
|
|
44
|
+
export default BlockEditorItem;
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import _toArray from "@babel/runtime/helpers/esm/toArray";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { useMemoizedFn, useCreation } from 'ahooks';
|
|
6
|
+
import { Icon, Dropdown, Button, Menu, Modal } from 'luck-design/antd';
|
|
7
|
+
import { concat, reduce } from 'lodash';
|
|
8
|
+
import { formatMessage, suid } from '@luck-design-biz/base/utils';
|
|
9
|
+
import { usePageData } from "../../../engine/provider/ContextProvider";
|
|
10
|
+
import { SortBox, SortItem } from "../../components/SortBox";
|
|
11
|
+
import BlockEditorItem from "./BlockEditorItem";
|
|
12
|
+
import defaultMeta from "../../../engine/meta/form.props.default.json";
|
|
13
|
+
import { includes } from 'lodash';
|
|
14
|
+
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel-section.blocksEditor';
|
|
15
|
+
var confirm = Modal.confirm;
|
|
16
|
+
var addOptions = [{
|
|
17
|
+
label: formatMessage({
|
|
18
|
+
id: "".concat(_I18N_PREFIX_, ".auto"),
|
|
19
|
+
label: '表单'
|
|
20
|
+
}),
|
|
21
|
+
value: 'auto'
|
|
22
|
+
}, {
|
|
23
|
+
label: formatMessage({
|
|
24
|
+
id: "".concat(_I18N_PREFIX_, ".grid"),
|
|
25
|
+
label: '表格'
|
|
26
|
+
}),
|
|
27
|
+
value: 'grid'
|
|
28
|
+
}, {
|
|
29
|
+
label: formatMessage({
|
|
30
|
+
id: "".concat(_I18N_PREFIX_, ".writer"),
|
|
31
|
+
label: '行内编辑表格'
|
|
32
|
+
}),
|
|
33
|
+
value: 'writer'
|
|
34
|
+
}, {
|
|
35
|
+
label: formatMessage({
|
|
36
|
+
id: "".concat(_I18N_PREFIX_, ".uploadForm"),
|
|
37
|
+
label: '附件列表'
|
|
38
|
+
}),
|
|
39
|
+
value: 'uploadForm'
|
|
40
|
+
}, {
|
|
41
|
+
label: formatMessage({
|
|
42
|
+
id: "".concat(_I18N_PREFIX_, ".blank"),
|
|
43
|
+
label: '空白区'
|
|
44
|
+
}),
|
|
45
|
+
value: 'blank'
|
|
46
|
+
}];
|
|
47
|
+
var BlockEditor = function BlockEditor(_ref) {
|
|
48
|
+
var onChange = _ref.onChange,
|
|
49
|
+
nodeId = _ref.nodeId,
|
|
50
|
+
renderPanelItems = _ref.renderPanelItems,
|
|
51
|
+
innerProps = _ref.innerProps;
|
|
52
|
+
var _usePageData = usePageData({
|
|
53
|
+
id: nodeId
|
|
54
|
+
}),
|
|
55
|
+
_usePageData2 = _slicedToArray(_usePageData, 1),
|
|
56
|
+
node = _usePageData2[0];
|
|
57
|
+
var _ref2 = node || {
|
|
58
|
+
props: {}
|
|
59
|
+
},
|
|
60
|
+
blocks = _ref2.props.blocks;
|
|
61
|
+
var handleAddBlock = useMemoizedFn(function (type) {
|
|
62
|
+
var _id = "block_".concat(suid());
|
|
63
|
+
var newData = concat(blocks, _objectSpread({
|
|
64
|
+
id: _id,
|
|
65
|
+
name: _id,
|
|
66
|
+
type: type,
|
|
67
|
+
serialEffect: 'hidden',
|
|
68
|
+
mode: ['add', 'update', 'edit', 'info']
|
|
69
|
+
}, defaultMeta.blockSettings[type]));
|
|
70
|
+
onChange(newData);
|
|
71
|
+
});
|
|
72
|
+
var handleDeleteBlock = useMemoizedFn(function (_id) {
|
|
73
|
+
confirm({
|
|
74
|
+
title: formatMessage({
|
|
75
|
+
id: 'app.base.confirm.delete.title'
|
|
76
|
+
}),
|
|
77
|
+
content: "".concat(formatMessage({
|
|
78
|
+
id: 'app.base.confirm.delete.simple'
|
|
79
|
+
}), "?"),
|
|
80
|
+
cancelText: formatMessage({
|
|
81
|
+
id: 'app.base.operate.cancel'
|
|
82
|
+
}),
|
|
83
|
+
okText: formatMessage({
|
|
84
|
+
id: 'app.base.operate.ok'
|
|
85
|
+
}),
|
|
86
|
+
okType: 'danger',
|
|
87
|
+
onOk: function onOk() {
|
|
88
|
+
var newData = blocks.filter(function (val) {
|
|
89
|
+
return val.id !== _id;
|
|
90
|
+
});
|
|
91
|
+
onChange(newData);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
var handleSortBlock = useMemoizedFn(function (sortItems) {
|
|
96
|
+
console.log('sortItems', sortItems);
|
|
97
|
+
});
|
|
98
|
+
var menu = useCreation(function () {
|
|
99
|
+
return /*#__PURE__*/React.createElement(Menu, {
|
|
100
|
+
onClick: function onClick(_ref3) {
|
|
101
|
+
var key = _ref3.key;
|
|
102
|
+
return handleAddBlock(key);
|
|
103
|
+
}
|
|
104
|
+
}, addOptions.map(function (opt) {
|
|
105
|
+
return /*#__PURE__*/React.createElement(Menu.Item, {
|
|
106
|
+
key: opt.value
|
|
107
|
+
}, opt.label);
|
|
108
|
+
}));
|
|
109
|
+
});
|
|
110
|
+
var _useCreation = useCreation(function () {
|
|
111
|
+
return blocks || [];
|
|
112
|
+
}, [blocks]),
|
|
113
|
+
_useCreation2 = _toArray(_useCreation),
|
|
114
|
+
mainForm = _useCreation2[0],
|
|
115
|
+
restForm = _useCreation2.slice(1);
|
|
116
|
+
var _useCreation3 = useCreation(function () {
|
|
117
|
+
return reduce(innerProps, function (ret, p) {
|
|
118
|
+
if (p.key === 'blockSettings') {
|
|
119
|
+
ret.specialProp = p;
|
|
120
|
+
} else {
|
|
121
|
+
ret.commonProps.push(p);
|
|
122
|
+
}
|
|
123
|
+
return ret;
|
|
124
|
+
}, {
|
|
125
|
+
commonProps: []
|
|
126
|
+
});
|
|
127
|
+
}, [innerProps]),
|
|
128
|
+
commonProps = _useCreation3.commonProps,
|
|
129
|
+
specialProp = _useCreation3.specialProp;
|
|
130
|
+
return mainForm ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BlockEditorItem, {
|
|
131
|
+
name: renderPanelItems([_objectSpread(_objectSpread({}, specialProp), {}, {
|
|
132
|
+
valueKey: "blocks[0].".concat(specialProp.key),
|
|
133
|
+
blockName: mainForm.name || mainForm.id,
|
|
134
|
+
next: {
|
|
135
|
+
name: specialProp.name,
|
|
136
|
+
props: specialProp.next["_".concat(mainForm.type, "_props")].map(function (nextP) {
|
|
137
|
+
return _objectSpread(_objectSpread({}, nextP), {}, {
|
|
138
|
+
valueKey: "blocks[0].".concat(nextP.key)
|
|
139
|
+
});
|
|
140
|
+
})
|
|
141
|
+
}
|
|
142
|
+
})])
|
|
143
|
+
}, renderPanelItems(commonProps.map(function (p) {
|
|
144
|
+
return _objectSpread(_objectSpread({}, p), {}, {
|
|
145
|
+
disabled: includes(['mode', 'serialEffect'], p.key) || p.disabled,
|
|
146
|
+
valueKey: "blocks[0].".concat(p.key)
|
|
147
|
+
});
|
|
148
|
+
}))), /*#__PURE__*/React.createElement(SortBox, {
|
|
149
|
+
datas: restForm.map(function (_bk) {
|
|
150
|
+
return _bk.id;
|
|
151
|
+
}),
|
|
152
|
+
onChange: handleSortBlock
|
|
153
|
+
}, restForm.map(function (blockItem, i) {
|
|
154
|
+
return /*#__PURE__*/React.createElement(SortItem, {
|
|
155
|
+
key: blockItem.id,
|
|
156
|
+
id: blockItem.id
|
|
157
|
+
}, /*#__PURE__*/React.createElement(BlockEditorItem, {
|
|
158
|
+
name: renderPanelItems([_objectSpread(_objectSpread({}, specialProp), {}, {
|
|
159
|
+
valueKey: "blocks[".concat(i + 1, "].").concat(specialProp.key),
|
|
160
|
+
blockName: blockItem.name || blockItem.id,
|
|
161
|
+
next: {
|
|
162
|
+
name: specialProp.name,
|
|
163
|
+
props: specialProp.next["_".concat(blockItem.type, "_props")].map(function (nextP) {
|
|
164
|
+
var _nextP$props;
|
|
165
|
+
return _objectSpread(_objectSpread({}, nextP), {}, {
|
|
166
|
+
valueKey: "blocks[".concat(i + 1, "].").concat(nextP.key),
|
|
167
|
+
props: (_nextP$props = nextP.props) === null || _nextP$props === void 0 ? void 0 : _nextP$props.map(function (p) {
|
|
168
|
+
return _objectSpread(_objectSpread({}, p), {}, {
|
|
169
|
+
valueKey: "blocks[".concat(i + 1, "].").concat(p.key)
|
|
170
|
+
});
|
|
171
|
+
})
|
|
172
|
+
});
|
|
173
|
+
})
|
|
174
|
+
}
|
|
175
|
+
})]),
|
|
176
|
+
onDelete: function onDelete() {
|
|
177
|
+
return handleDeleteBlock(blockItem.id);
|
|
178
|
+
}
|
|
179
|
+
}, renderPanelItems(reduce(commonProps, function (result, p) {
|
|
180
|
+
if (!(blockItem.type === 'uploadForm' && p.key === 'dataset')) result.push(_objectSpread(_objectSpread({}, p), {}, {
|
|
181
|
+
valueKey: "blocks[".concat(i + 1, "].").concat(p.key)
|
|
182
|
+
}));
|
|
183
|
+
return result;
|
|
184
|
+
}, []))));
|
|
185
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
186
|
+
style: {
|
|
187
|
+
padding: '0px 16px',
|
|
188
|
+
width: '100%'
|
|
189
|
+
}
|
|
190
|
+
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
191
|
+
overlay: menu
|
|
192
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
193
|
+
block: true,
|
|
194
|
+
size: "small"
|
|
195
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
196
|
+
type: "plus-circle"
|
|
197
|
+
}), formatMessage({
|
|
198
|
+
id: "".concat(_I18N_PREFIX_, ".addBlock"),
|
|
199
|
+
label: '新增区块'
|
|
200
|
+
}))))) : null;
|
|
201
|
+
};
|
|
202
|
+
export default BlockEditor;
|
|
@@ -1,61 +1,133 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
1
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
4
|
import React, { useEffect, useState } from 'react';
|
|
3
|
-
import { useMemoizedFn } from 'ahooks';
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useMemoizedFn, useRequest } from 'ahooks';
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
import { Select, Button, Tooltip } from 'luck-design/antd';
|
|
8
|
+
import { useRemoteSource } from "../../engine/provider/ContextProvider";
|
|
9
|
+
import { fetchAddDataset } from "../../constants/api-url";
|
|
10
|
+
var Div = styled.div.withConfig({
|
|
11
|
+
displayName: "Div",
|
|
12
|
+
componentId: "luckda-6530__sc-onj9tc-0"
|
|
13
|
+
})(["display:flex;align-items:center;"]);
|
|
7
14
|
var DataSetSelector = function DataSetSelector(_ref) {
|
|
8
15
|
var defaultValue = _ref.defaultValue,
|
|
16
|
+
onChange = _ref.onChange,
|
|
9
17
|
size = _ref.size,
|
|
10
|
-
|
|
18
|
+
isTree = _ref.isTree,
|
|
19
|
+
next = _ref.next;
|
|
11
20
|
var _useState = useState([]),
|
|
12
21
|
_useState2 = _slicedToArray(_useState, 2),
|
|
13
22
|
options = _useState2[0],
|
|
14
23
|
setOptions = _useState2[1];
|
|
24
|
+
var _useState3 = useState(defaultValue),
|
|
25
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
26
|
+
currentDataset = _useState4[0],
|
|
27
|
+
setCurrentDataset = _useState4[1];
|
|
28
|
+
var _useRemoteSource = useRemoteSource(),
|
|
29
|
+
dataset = _useRemoteSource.dataset,
|
|
30
|
+
fetchAllDatasetLoading = _useRemoteSource.fetchAllDatasetLoading,
|
|
31
|
+
refreshModlueData = _useRemoteSource.refreshModlueData,
|
|
32
|
+
refreshDataset = _useRemoteSource.refreshDataset,
|
|
33
|
+
pageinfo = _useRemoteSource.pageinfo;
|
|
34
|
+
var _useRequest = useRequest(fetchAddDataset, {
|
|
35
|
+
manual: true
|
|
36
|
+
}),
|
|
37
|
+
loading = _useRequest.loading,
|
|
38
|
+
runAsync = _useRequest.runAsync;
|
|
15
39
|
useEffect(function () {
|
|
16
|
-
setOptions(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
setOptions(isTree ? dataset.filter(function (_ref2) {
|
|
41
|
+
var tree = _ref2.tree;
|
|
42
|
+
return tree === 1;
|
|
43
|
+
}) : dataset);
|
|
44
|
+
}, [dataset, isTree]);
|
|
45
|
+
var handleChange = useMemoizedFn( /*#__PURE__*/function () {
|
|
46
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(value, _ref3) {
|
|
47
|
+
var key, _pageinfo$relationshi, moduleId, dataModelKey, _yield$runAsync, code, res, _ds;
|
|
48
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
49
|
+
while (1) switch (_context.prev = _context.next) {
|
|
50
|
+
case 0:
|
|
51
|
+
key = _ref3.key;
|
|
52
|
+
_pageinfo$relationshi = pageinfo.relationship, moduleId = _pageinfo$relationshi.moduleId, dataModelKey = _pageinfo$relationshi.dataModelKey;
|
|
53
|
+
_context.next = 4;
|
|
54
|
+
return runAsync({
|
|
55
|
+
uid: moduleId,
|
|
56
|
+
dataModelKey: dataModelKey,
|
|
57
|
+
addList: [{
|
|
58
|
+
code: value,
|
|
59
|
+
datasetUid: key
|
|
60
|
+
}]
|
|
61
|
+
});
|
|
62
|
+
case 4:
|
|
63
|
+
_yield$runAsync = _context.sent;
|
|
64
|
+
code = _yield$runAsync.code;
|
|
65
|
+
if (!(code === 1)) {
|
|
66
|
+
_context.next = 11;
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
_context.next = 9;
|
|
70
|
+
return refreshModlueData();
|
|
71
|
+
case 9:
|
|
72
|
+
res = _context.sent;
|
|
73
|
+
if (res.code === 1) {
|
|
74
|
+
_ds = {
|
|
75
|
+
code: value,
|
|
76
|
+
uid: key
|
|
77
|
+
};
|
|
78
|
+
onChange(_ds);
|
|
79
|
+
setCurrentDataset(_ds);
|
|
80
|
+
}
|
|
81
|
+
case 11:
|
|
82
|
+
case "end":
|
|
83
|
+
return _context.stop();
|
|
84
|
+
}
|
|
85
|
+
}, _callee);
|
|
86
|
+
}));
|
|
87
|
+
return function (_x, _x2) {
|
|
88
|
+
return _ref4.apply(this, arguments);
|
|
89
|
+
};
|
|
90
|
+
}());
|
|
91
|
+
return /*#__PURE__*/React.createElement(Div, null, /*#__PURE__*/React.createElement(Select, {
|
|
92
|
+
defaultValue: defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.code,
|
|
47
93
|
size: size,
|
|
48
94
|
onChange: handleChange,
|
|
49
95
|
getPopupContainer: function getPopupContainer() {
|
|
50
96
|
return document.getElementById('lc-design-workspace');
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
97
|
+
},
|
|
98
|
+
style: {
|
|
99
|
+
width: 145
|
|
100
|
+
},
|
|
101
|
+
loading: loading
|
|
102
|
+
}, options.map(function (opt) {
|
|
55
103
|
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
56
|
-
key:
|
|
57
|
-
value:
|
|
58
|
-
},
|
|
104
|
+
key: opt.uid,
|
|
105
|
+
value: opt.code
|
|
106
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
107
|
+
title: opt.name
|
|
108
|
+
}, opt.name));
|
|
109
|
+
})), /*#__PURE__*/React.createElement(Button, {
|
|
110
|
+
size: size,
|
|
111
|
+
icon: "setting",
|
|
112
|
+
style: {
|
|
113
|
+
marginLeft: 4
|
|
114
|
+
},
|
|
115
|
+
disabled: !currentDataset,
|
|
116
|
+
onClick: function onClick() {
|
|
117
|
+
return next({
|
|
118
|
+
pageinfo: pageinfo,
|
|
119
|
+
datasetUid: currentDataset.uid,
|
|
120
|
+
datasetCode: currentDataset.code
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
124
|
+
size: size,
|
|
125
|
+
icon: "cloud-sync",
|
|
126
|
+
loading: fetchAllDatasetLoading,
|
|
127
|
+
style: {
|
|
128
|
+
marginLeft: 4
|
|
129
|
+
},
|
|
130
|
+
onClick: refreshDataset
|
|
59
131
|
}));
|
|
60
132
|
};
|
|
61
133
|
export default DataSetSelector;
|