@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
|
@@ -1,54 +1,77 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
2
|
import React, { useRef } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import { useMemoizedFn } from 'ahooks';
|
|
4
|
+
import { useMemoizedFn, useMount, useUnmount } from 'ahooks';
|
|
5
|
+
import styled from 'styled-components';
|
|
5
6
|
import classNames from 'classnames';
|
|
6
|
-
import {
|
|
7
|
-
import { Button } from 'luck-design/antd';
|
|
7
|
+
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
8
8
|
import Wrapper from "../Wrapper";
|
|
9
|
-
import {
|
|
9
|
+
import { LdButton as Button } from "../../../../components/LdCom";
|
|
10
|
+
import Icon from "../../../../components/IconFont";
|
|
10
11
|
import { omitBadProps } from "../../../engine/tools/helper";
|
|
11
12
|
import defaultMeta from "../../../engine/meta/button.props.default.json";
|
|
12
|
-
|
|
13
|
+
var StyledButton = styled(Button).withConfig({
|
|
14
|
+
displayName: "StyledButton",
|
|
15
|
+
componentId: "luckda-6530__sc-51v47z-0"
|
|
16
|
+
})(["", ""], function (props) {
|
|
17
|
+
return props.$css;
|
|
18
|
+
});
|
|
13
19
|
var LCButton = function LCButton(_ref) {
|
|
14
20
|
var id = _ref.id,
|
|
15
21
|
title = _ref.title,
|
|
16
22
|
type = _ref.type,
|
|
17
23
|
size = _ref.size,
|
|
24
|
+
iconFont = _ref.iconFont,
|
|
18
25
|
block = _ref.block,
|
|
19
26
|
serial = _ref.serial,
|
|
20
27
|
serialEffect = _ref.serialEffect,
|
|
21
28
|
ghost = _ref.ghost,
|
|
22
|
-
|
|
23
|
-
className = _ref.className
|
|
24
|
-
|
|
29
|
+
css = _ref.css,
|
|
30
|
+
className = _ref.className,
|
|
31
|
+
onClick = _ref.onClick,
|
|
32
|
+
advance = _ref.advance;
|
|
25
33
|
var ref = useRef();
|
|
26
|
-
var
|
|
27
|
-
|
|
34
|
+
var ctx = useContext();
|
|
35
|
+
useMount(function () {
|
|
36
|
+
ctx.doAction(advance.events.onMount, {
|
|
37
|
+
instance: ref.current
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
useUnmount(function () {
|
|
41
|
+
ctx.doAction(advance.events.onUnmount, {
|
|
42
|
+
instance: ref.current
|
|
43
|
+
});
|
|
28
44
|
});
|
|
29
45
|
var handleClick = useMemoizedFn(function (e) {
|
|
30
|
-
if (
|
|
31
|
-
e
|
|
46
|
+
if (onClick) {
|
|
47
|
+
onClick(e);
|
|
32
48
|
return;
|
|
33
49
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
id: id
|
|
50
|
+
ctx.doAction(advance.events.onClick, {
|
|
51
|
+
e: e
|
|
37
52
|
});
|
|
38
53
|
});
|
|
54
|
+
var getTargetDom = useMemoizedFn(function () {
|
|
55
|
+
return ref.current.buttonNode;
|
|
56
|
+
});
|
|
39
57
|
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
40
58
|
id: id,
|
|
59
|
+
displayName: "Button",
|
|
41
60
|
getTargetDom: getTargetDom
|
|
42
|
-
}, /*#__PURE__*/React.createElement(
|
|
61
|
+
}, /*#__PURE__*/React.createElement(StyledButton, {
|
|
43
62
|
ref: ref,
|
|
44
63
|
type: type,
|
|
45
64
|
size: size,
|
|
46
65
|
block: block,
|
|
47
66
|
ghost: ghost,
|
|
48
|
-
|
|
49
|
-
className: classNames(_defineProperty(
|
|
67
|
+
$css: css,
|
|
68
|
+
className: classNames(_defineProperty({}, className, !!className)),
|
|
69
|
+
resource: serial,
|
|
70
|
+
serialEffect: serialEffect,
|
|
50
71
|
onClick: handleClick
|
|
51
|
-
},
|
|
72
|
+
}, iconFont ? /*#__PURE__*/React.createElement(Icon, {
|
|
73
|
+
type: iconFont
|
|
74
|
+
}) : null, title));
|
|
52
75
|
};
|
|
53
76
|
LCButton.propTypes = {
|
|
54
77
|
/**
|
|
@@ -93,7 +116,7 @@ LCButton.propTypes = {
|
|
|
93
116
|
* @options [{ "label": "隐藏", "value": "hidden" }, { "label": "禁用", "value": "disable"}]
|
|
94
117
|
* @default 'hidden'
|
|
95
118
|
*/
|
|
96
|
-
serialEffect: PropTypes.oneOf(['
|
|
119
|
+
serialEffect: PropTypes.oneOf(['disable', 'hidden']),
|
|
97
120
|
/**
|
|
98
121
|
* @name 幽灵按钮
|
|
99
122
|
* @type boolean
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"default": false
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
|
-
"key": "
|
|
66
|
+
"key": "iconFont",
|
|
67
67
|
"name": "图标",
|
|
68
68
|
"type": "_Icon",
|
|
69
69
|
"next": {
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
"autoClose": true,
|
|
72
72
|
"props": [
|
|
73
73
|
{
|
|
74
|
-
"key": "
|
|
75
|
-
"name": "
|
|
74
|
+
"key": "iconFont",
|
|
75
|
+
"name": "#图标选择器",
|
|
76
76
|
"type": "_IconSelector"
|
|
77
77
|
}
|
|
78
78
|
]
|
|
@@ -82,11 +82,11 @@
|
|
|
82
82
|
{
|
|
83
83
|
"key": "serials",
|
|
84
84
|
"name": "资源串",
|
|
85
|
-
"type": "
|
|
85
|
+
"type": "_SerialsSelector"
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
"key": "serialEffect",
|
|
89
|
-
"name": "
|
|
89
|
+
"name": "越权效果",
|
|
90
90
|
"type": "segmented",
|
|
91
91
|
"options": [
|
|
92
92
|
{
|
|
@@ -101,20 +101,20 @@
|
|
|
101
101
|
"default": "hidden"
|
|
102
102
|
}
|
|
103
103
|
],
|
|
104
|
-
"
|
|
104
|
+
"css": {},
|
|
105
105
|
"advance": {
|
|
106
106
|
"events": [
|
|
107
107
|
{
|
|
108
108
|
"key": "onMount",
|
|
109
109
|
"name": "组件首次渲染时",
|
|
110
110
|
"desc": "在组件首次渲染时,执行方法",
|
|
111
|
-
"func": "(
|
|
111
|
+
"func": "(instance)=>{\n\t\n}"
|
|
112
112
|
},
|
|
113
113
|
{
|
|
114
114
|
"key": "onUnmount",
|
|
115
115
|
"name": "组件卸载时",
|
|
116
116
|
"desc": "在组件卸载时,执行方法。",
|
|
117
|
-
"func": "(
|
|
117
|
+
"func": "(instance)=>{\n\t\n}"
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
120
|
"key": "onClick",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
+
var _excluded = ["children"];
|
|
3
|
+
import Index from "./index";
|
|
4
|
+
var FunctionPreview = function FunctionPreview(_ref) {
|
|
5
|
+
var children = _ref.children,
|
|
6
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
7
|
+
return /*#__PURE__*/React.createElement(Index, props, children);
|
|
8
|
+
};
|
|
9
|
+
export default FunctionPreview;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"disabled": true
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
"key": "
|
|
17
|
+
"key": "dataset",
|
|
18
18
|
"name": "首次数据自动加载",
|
|
19
19
|
"desc": "选择系统中的可用树形数据集",
|
|
20
20
|
"type": "_DataSetSelector"
|
|
@@ -94,7 +94,6 @@
|
|
|
94
94
|
"type": "_ActionSelector"
|
|
95
95
|
}
|
|
96
96
|
],
|
|
97
|
-
"style": {},
|
|
98
97
|
"advance": {
|
|
99
98
|
"events": [
|
|
100
99
|
{
|
|
@@ -1,47 +1,41 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["
|
|
5
|
-
import React
|
|
6
|
-
import { useCreation
|
|
6
|
+
var _excluded = ["id", "children", "className"];
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { useCreation } from 'ahooks';
|
|
7
9
|
import { cloneDeep } from 'lodash';
|
|
8
10
|
import Index from "./index";
|
|
9
11
|
import { suid } from '@luck-design-biz/base/utils';
|
|
12
|
+
import { useContext, usePageData } from "../../../engine/provider/ContextProvider";
|
|
10
13
|
import { add } from "../../../engine/tools/dataProcess";
|
|
11
14
|
import classNames from 'classnames';
|
|
12
15
|
import styles from "./index.less";
|
|
13
16
|
import boxDefaultMeta from "../../../engine/meta/box.props.default.json";
|
|
14
17
|
var FunctionDesign = function FunctionDesign(_ref) {
|
|
15
|
-
var
|
|
16
|
-
id = _ref.id,
|
|
18
|
+
var id = _ref.id,
|
|
17
19
|
children = _ref.children,
|
|
18
20
|
className = _ref.className,
|
|
19
21
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
});
|
|
22
|
+
var ctx = useContext();
|
|
23
|
+
var _usePageData = usePageData(),
|
|
24
|
+
_usePageData2 = _slicedToArray(_usePageData, 2),
|
|
25
|
+
setPageData = _usePageData2[1].setPageData;
|
|
25
26
|
useCreation(function () {
|
|
26
27
|
if (children !== null && children !== void 0 && children.length) return;
|
|
27
|
-
|
|
28
|
+
ctx.$subscriber(ctx.topics.COMPONENT_APPEND).once(function (_ref2) {
|
|
28
29
|
var compId = _ref2.id,
|
|
29
30
|
pageData = _ref2.pageData;
|
|
30
31
|
if (compId !== id) return;
|
|
31
|
-
|
|
32
|
+
var cloneData = cloneDeep(pageData);
|
|
33
|
+
add(cloneData, id, "box_".concat(suid()), _objectSpread(_objectSpread({}, boxDefaultMeta), {}, {
|
|
34
|
+
buildIn: true
|
|
35
|
+
}));
|
|
36
|
+
setPageData(cloneData);
|
|
32
37
|
}).watch();
|
|
33
38
|
}, []);
|
|
34
|
-
useEffect(function () {
|
|
35
|
-
var cdid = context.$subscriber(context.topics.COMPONENT_DELETE).on(function (_ref3) {
|
|
36
|
-
var parentId = _ref3.parentId,
|
|
37
|
-
pageData = _ref3.pageData;
|
|
38
|
-
if (parentId !== id) return;
|
|
39
|
-
handleAppendBox(pageData);
|
|
40
|
-
}).watch();
|
|
41
|
-
return function () {
|
|
42
|
-
return context.$unsubscriber(context.topics.COMPONENT_DELETE, cdid);
|
|
43
|
-
};
|
|
44
|
-
}, []);
|
|
45
39
|
return /*#__PURE__*/React.createElement(Index, _extends({
|
|
46
40
|
id: id,
|
|
47
41
|
wrapClassName: classNames(styles['runtime-design'], _defineProperty({}, className, !!className)),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
+
var _excluded = ["children"];
|
|
3
|
+
import Index from "./index";
|
|
4
|
+
var FunctionPreview = function FunctionPreview(_ref) {
|
|
5
|
+
var children = _ref.children,
|
|
6
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
7
|
+
return /*#__PURE__*/React.createElement(Index, props, children);
|
|
8
|
+
};
|
|
9
|
+
export default FunctionPreview;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["children", "className"];
|
|
4
|
+
var _excluded = ["children", "className", "show"];
|
|
5
5
|
import Index from "./index";
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import styles from "./index.less";
|
|
8
8
|
var FunctionDesign = function FunctionDesign(_ref) {
|
|
9
9
|
var children = _ref.children,
|
|
10
10
|
className = _ref.className,
|
|
11
|
+
show = _ref.show,
|
|
11
12
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
12
13
|
return /*#__PURE__*/React.createElement(Index, _extends({
|
|
13
|
-
className: classNames(styles['runtime-design'], _defineProperty({}, className, !!className)),
|
|
14
|
+
className: classNames(styles['runtime-design'], _defineProperty(_defineProperty({}, className, !!className), "hidden", !show)),
|
|
14
15
|
getContainer: false,
|
|
16
|
+
show: show,
|
|
15
17
|
style: {
|
|
16
18
|
position: 'absolute'
|
|
17
19
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
+
var _excluded = ["children"];
|
|
3
|
+
import Index from "./index";
|
|
4
|
+
var FunctionPreview = function FunctionPreview(_ref) {
|
|
5
|
+
var children = _ref.children,
|
|
6
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
7
|
+
return /*#__PURE__*/React.createElement(Index, props, children);
|
|
8
|
+
};
|
|
9
|
+
export default FunctionPreview;
|
|
@@ -30,14 +30,31 @@ var LCDrawer = function LCDrawer(_ref) {
|
|
|
30
30
|
});
|
|
31
31
|
useImperativeHandle(apiRef, function () {
|
|
32
32
|
return {
|
|
33
|
+
/**
|
|
34
|
+
* 是否打开
|
|
35
|
+
* @property
|
|
36
|
+
*/
|
|
33
37
|
open: open,
|
|
38
|
+
/**
|
|
39
|
+
* 打开弹窗
|
|
40
|
+
* @method
|
|
41
|
+
*/
|
|
34
42
|
doOpen: setTrue,
|
|
43
|
+
/**
|
|
44
|
+
* 关闭弹窗
|
|
45
|
+
* @method
|
|
46
|
+
*/
|
|
35
47
|
doClose: setFalse,
|
|
48
|
+
/**
|
|
49
|
+
* @method
|
|
50
|
+
* 切换弹窗
|
|
51
|
+
*/
|
|
36
52
|
toggle: toggle
|
|
37
53
|
};
|
|
38
54
|
});
|
|
39
55
|
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
40
56
|
id: id,
|
|
57
|
+
displayName: "Drawer",
|
|
41
58
|
getTargetDom: getTargetDom,
|
|
42
59
|
api: apiRef
|
|
43
60
|
}, /*#__PURE__*/React.createElement(Drawer, {
|
|
@@ -1,9 +1,38 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
1
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
-
var _excluded = ["children"];
|
|
4
|
+
var _excluded = ["children", "blocks", "id"];
|
|
5
|
+
import React, { useRef, useState } from 'react';
|
|
6
|
+
import { usePrevious, useUpdateLayoutEffect } from 'ahooks';
|
|
7
|
+
import { isEqual, differenceWith, cloneDeep } from 'lodash';
|
|
3
8
|
import Index from "./index";
|
|
4
9
|
var FunctionDesign = function FunctionDesign(_ref) {
|
|
5
10
|
var children = _ref.children,
|
|
11
|
+
blocks = _ref.blocks,
|
|
12
|
+
id = _ref.id,
|
|
6
13
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
7
|
-
|
|
14
|
+
var ref = useRef(null);
|
|
15
|
+
var previousBlocks = usePrevious(cloneDeep(blocks), function (prev, next) {
|
|
16
|
+
return !isEqual(prev, next);
|
|
17
|
+
});
|
|
18
|
+
useUpdateLayoutEffect(function () {
|
|
19
|
+
var difference = differenceWith(blocks, previousBlocks, function (arrVal, othVal) {
|
|
20
|
+
var _arrVal$dataset, _othVal$dataset;
|
|
21
|
+
return arrVal.id === othVal.id && ((_arrVal$dataset = arrVal.dataset) === null || _arrVal$dataset === void 0 ? void 0 : _arrVal$dataset.code) === ((_othVal$dataset = othVal.dataset) === null || _othVal$dataset === void 0 ? void 0 : _othVal$dataset.code);
|
|
22
|
+
});
|
|
23
|
+
difference.forEach(function (df) {
|
|
24
|
+
var _df$dataset;
|
|
25
|
+
((_df$dataset = df.dataset) === null || _df$dataset === void 0 ? void 0 : _df$dataset.code) && ref.current.doQueryOne(df.id);
|
|
26
|
+
});
|
|
27
|
+
}, [JSON.stringify(blocks)]);
|
|
28
|
+
return /*#__PURE__*/React.createElement(Index, _extends({}, props, {
|
|
29
|
+
id: id,
|
|
30
|
+
blocks: blocks,
|
|
31
|
+
initData: {
|
|
32
|
+
formMode: 'update',
|
|
33
|
+
ticketData: _defineProperty({}, window.appConfig.constraintKeys.PRIMARY, 'test')
|
|
34
|
+
},
|
|
35
|
+
ref: ref
|
|
36
|
+
}), children);
|
|
8
37
|
};
|
|
9
38
|
export default FunctionDesign;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
+
var _excluded = ["children"];
|
|
3
|
+
import Index from "./index";
|
|
4
|
+
var FunctionPreview = function FunctionPreview(_ref) {
|
|
5
|
+
var children = _ref.children,
|
|
6
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
7
|
+
return /*#__PURE__*/React.createElement(Index, props, children);
|
|
8
|
+
};
|
|
9
|
+
export default FunctionPreview;
|
|
@@ -1,20 +1,126 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
1
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
-
var _excluded = ["id"];
|
|
3
|
-
import React, { useRef } from 'react';
|
|
4
|
+
var _excluded = ["id", "parentId", "width", "height", "className", "blocks", "advance", "initData", "readOnly"];
|
|
5
|
+
import React, { useRef, forwardRef } from 'react';
|
|
4
6
|
import { useMemoizedFn } from 'ahooks';
|
|
7
|
+
import classNames from 'classnames';
|
|
8
|
+
import { reduce, includes, isNil } from 'lodash';
|
|
5
9
|
import Wrapper from "../Wrapper";
|
|
6
|
-
|
|
10
|
+
import { LdFormList } from "../../../../index";
|
|
11
|
+
import { omitBadProps, executeCode } from "../../../engine/tools/helper";
|
|
12
|
+
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
13
|
+
import defaultMeta from "../../../engine/meta/form.props.default.json";
|
|
14
|
+
import styles from "./index.less";
|
|
15
|
+
var LCForm = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
7
16
|
var id = _ref.id,
|
|
17
|
+
parentId = _ref.parentId,
|
|
18
|
+
width = _ref.width,
|
|
19
|
+
height = _ref.height,
|
|
20
|
+
className = _ref.className,
|
|
21
|
+
blocks = _ref.blocks,
|
|
22
|
+
advance = _ref.advance,
|
|
23
|
+
initData = _ref.initData,
|
|
24
|
+
readOnly = _ref.readOnly,
|
|
8
25
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
9
|
-
var
|
|
26
|
+
var boxRef = useRef();
|
|
27
|
+
var ctx = useContext();
|
|
10
28
|
var getTargetDom = useMemoizedFn(function () {
|
|
11
|
-
return
|
|
29
|
+
return boxRef.current;
|
|
30
|
+
});
|
|
31
|
+
var handleDefaultDataSourceFormat = useMemoizedFn(function (defaultDataSourceFormat, defaultValues) {
|
|
32
|
+
if (isNil(defaultDataSourceFormat)) return function () {
|
|
33
|
+
return defaultValues;
|
|
34
|
+
};
|
|
35
|
+
return executeCode(ctx, defaultDataSourceFormat, ['defaultValues'], defaultValues);
|
|
36
|
+
});
|
|
37
|
+
var handleDataSourceFormat = useMemoizedFn(function (dataSourceFormat, _ref2) {
|
|
38
|
+
var values = _ref2.values,
|
|
39
|
+
submitData = _ref2.submitData;
|
|
40
|
+
if (isNil(dataSourceFormat)) return submitData;
|
|
41
|
+
return executeCode(ctx, dataSourceFormat, ['values', 'submitData'], values, submitData);
|
|
42
|
+
});
|
|
43
|
+
var handleResetActionsColumn = useMemoizedFn(function (actionsColumnReset, data, index, actions, params) {
|
|
44
|
+
return executeCode(ctx, actionsColumnReset, ['data', 'index', 'actions', 'params'], data, index, actions, params);
|
|
45
|
+
});
|
|
46
|
+
var handleColumnsReset = useMemoizedFn(function (actionsColumnReset, columns) {
|
|
47
|
+
if (isNil(actionsColumnReset)) return columns;
|
|
48
|
+
return executeCode(ctx, actionsColumnReset, ['columns'], columns);
|
|
49
|
+
});
|
|
50
|
+
var handleGridFormReady = useMemoizedFn(function (onGridFormReady, ref, params, gridForm) {
|
|
51
|
+
if (!isNil(onGridFormReady)) return executeCode(ctx, onGridFormReady, ['ref', 'params', 'gridForm'], ref, params, gridForm);
|
|
52
|
+
});
|
|
53
|
+
var renderFormList = useMemoizedFn(function (formConfig) {
|
|
54
|
+
var formList = reduce(blocks, function (result, item) {
|
|
55
|
+
if (includes(['auto', 'grid', 'writer'], item.type)) {
|
|
56
|
+
if (item.dataset && includes(item.mode, formConfig.formMode)) {
|
|
57
|
+
var data = {
|
|
58
|
+
id: item.id,
|
|
59
|
+
type: item.type,
|
|
60
|
+
readOnly: item.readOnly,
|
|
61
|
+
title: item.name,
|
|
62
|
+
header: item.header,
|
|
63
|
+
dataSetKey: item.dataset.code,
|
|
64
|
+
serial: item.serial,
|
|
65
|
+
serialEffect: item.serialEffect,
|
|
66
|
+
defaultDataSourceFormat: function defaultDataSourceFormat(defaultValues) {
|
|
67
|
+
return handleDefaultDataSourceFormat(item.defaultDataSourceFormat, defaultValues);
|
|
68
|
+
},
|
|
69
|
+
onUpdate: {
|
|
70
|
+
post: function post(data) {
|
|
71
|
+
return handleDataSourceFormat(item.dataSourceFormat, data);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
if (item.type === 'auto') data = _objectSpread(_objectSpread({}, data), {}, {
|
|
76
|
+
col: item.cols
|
|
77
|
+
});else data = _objectSpread(_objectSpread({}, data), {}, {
|
|
78
|
+
suppressPreset: item.suppressPreset,
|
|
79
|
+
height: item.height,
|
|
80
|
+
bordered: item.bordered,
|
|
81
|
+
draggable: item.draggable,
|
|
82
|
+
orderByAdd: item.orderByAdd,
|
|
83
|
+
hideActionsColumn: item.suppressActions,
|
|
84
|
+
actionsWidth: item.actionsColumnWidth,
|
|
85
|
+
columnsReset: function columnsReset(columns) {
|
|
86
|
+
return handleColumnsReset(item.columnsReset, columns);
|
|
87
|
+
},
|
|
88
|
+
onGridFormReady: function onGridFormReady(ref, params, gridForm) {
|
|
89
|
+
return handleGridFormReady(item.onGridFormReady, ref, params, gridForm);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
if (item.actionsColumnReset) data = _objectSpread(_objectSpread({}, data), {}, {
|
|
93
|
+
resetActionsColumn: function resetActionsColumn(data, index, actions, params) {
|
|
94
|
+
return handleResetActionsColumn(item.actionsColumnReset, data, index, actions, params);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
result.push(data);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return result;
|
|
101
|
+
}, []);
|
|
102
|
+
return formList;
|
|
12
103
|
});
|
|
13
104
|
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
14
105
|
id: id,
|
|
106
|
+
displayName: "Form",
|
|
15
107
|
getTargetDom: getTargetDom
|
|
16
108
|
}, /*#__PURE__*/React.createElement("div", {
|
|
17
|
-
ref:
|
|
18
|
-
|
|
19
|
-
|
|
109
|
+
ref: boxRef,
|
|
110
|
+
style: {
|
|
111
|
+
width: width,
|
|
112
|
+
height: height
|
|
113
|
+
}
|
|
114
|
+
}, /*#__PURE__*/React.createElement(LdFormList, {
|
|
115
|
+
id: id,
|
|
116
|
+
ldId: id,
|
|
117
|
+
className: classNames(styles['lc-component-form'], _defineProperty({}, className, !!className)),
|
|
118
|
+
renderFormList: renderFormList,
|
|
119
|
+
mainFormLdId: "block_main",
|
|
120
|
+
initData: initData,
|
|
121
|
+
ref: ref,
|
|
122
|
+
readOnly: readOnly
|
|
123
|
+
})));
|
|
124
|
+
});
|
|
125
|
+
LCForm.defaultProps = omitBadProps(defaultMeta);
|
|
20
126
|
export default LCForm;
|