@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
|
@@ -20,13 +20,16 @@ var _ContextProvider = require("../engine/provider/ContextProvider");
|
|
|
20
20
|
var _constants = require("../constants");
|
|
21
21
|
var _dataProcess = require("../engine/tools/dataProcess");
|
|
22
22
|
var _outline = _interopRequireDefault(require("./style/outline.less"));
|
|
23
|
+
var _TreeEditor = _interopRequireDefault(require("./components/TreeEditor"));
|
|
23
24
|
var _excluded = ["props", "children"];
|
|
24
25
|
var TreeNode = _antd.Tree.TreeNode;
|
|
25
|
-
var PAGE_CELL = [_constants.CELL_KEY.PAGE_HEADER, _constants.CELL_KEY.PAGE_CONTENT, _constants.CELL_KEY.PAGE_FOOTER];
|
|
26
26
|
var Outline = function Outline(_ref) {
|
|
27
27
|
var open = _ref.open;
|
|
28
28
|
var clickBySelf = (0, _react.useRef)(false);
|
|
29
|
-
var
|
|
29
|
+
var ctx = (0, _ContextProvider.useContext)();
|
|
30
|
+
var _usePageData = (0, _ContextProvider.usePageData)(),
|
|
31
|
+
_usePageData2 = (0, _slicedToArray2.default)(_usePageData, 1),
|
|
32
|
+
pageData = _usePageData2[0];
|
|
30
33
|
var _useState = (0, _react.useState)(null),
|
|
31
34
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
32
35
|
pageAndModal = _useState2[0],
|
|
@@ -46,28 +49,28 @@ var Outline = function Outline(_ref) {
|
|
|
46
49
|
var latestModalExpandedKeysRef = (0, _ahooks.useLatest)(modalExpandedKeys);
|
|
47
50
|
var lastPageExpandedKeysRef = (0, _ahooks.useLatest)(pageExpandedKeys);
|
|
48
51
|
(0, _react.useEffect)(function () {
|
|
49
|
-
var _id =
|
|
52
|
+
var _id = ctx.$subscriber(ctx.topics.COMPONENT_ACTIVE).on(function (payload) {
|
|
50
53
|
setSelectedKey(payload.id);
|
|
51
54
|
if (clickBySelf.current) {
|
|
52
55
|
clickBySelf.current = false;
|
|
53
56
|
return;
|
|
54
57
|
}
|
|
55
|
-
var _split = (0, _lodash.split)((0, _dataProcess.getPathById)(
|
|
58
|
+
var _split = (0, _lodash.split)((0, _dataProcess.getPathById)(pageData, payload.id), '/'),
|
|
56
59
|
_split2 = (0, _slicedToArray2.default)(_split, 1),
|
|
57
60
|
_root = _split2[0];
|
|
58
|
-
if (!
|
|
59
|
-
setModalExpandedKeys((0, _lodash.uniq)([].concat((0, _toConsumableArray2.default)(latestModalExpandedKeysRef.current), (0, _toConsumableArray2.default)((0, _lodash.split)((0, _dataProcess.getPathById)(
|
|
61
|
+
if (!_constants.LC_BUILDIN_UNIT_KEY_LIST.includes(_root)) {
|
|
62
|
+
setModalExpandedKeys((0, _lodash.uniq)([].concat((0, _toConsumableArray2.default)(latestModalExpandedKeysRef.current), (0, _toConsumableArray2.default)((0, _lodash.split)((0, _dataProcess.getPathById)(pageData, payload.id), '/')))));
|
|
60
63
|
} else {
|
|
61
|
-
setPageExpandedKeys((0, _lodash.uniq)([].concat((0, _toConsumableArray2.default)(lastPageExpandedKeysRef.current), (0, _toConsumableArray2.default)((0, _lodash.split)((0, _dataProcess.getPathById)(
|
|
64
|
+
setPageExpandedKeys((0, _lodash.uniq)([].concat((0, _toConsumableArray2.default)(lastPageExpandedKeysRef.current), (0, _toConsumableArray2.default)((0, _lodash.split)((0, _dataProcess.getPathById)(pageData, payload.id), '/')))));
|
|
62
65
|
}
|
|
63
66
|
}).watch();
|
|
64
67
|
return function () {
|
|
65
|
-
|
|
68
|
+
ctx.$unsubscriber(ctx.topics.COMPONENT_ACTIVE, _id);
|
|
66
69
|
};
|
|
67
|
-
}, [
|
|
70
|
+
}, [pageData]);
|
|
68
71
|
var handleSelect = (0, _ahooks.useMemoizedFn)(function (_key) {
|
|
69
72
|
clickBySelf.current = true;
|
|
70
|
-
|
|
73
|
+
ctx.$publisher(ctx.topics.COMPONENT_ACTIVE, _key ? {
|
|
71
74
|
id: _key
|
|
72
75
|
} : null);
|
|
73
76
|
});
|
|
@@ -80,7 +83,9 @@ var Outline = function Outline(_ref) {
|
|
|
80
83
|
icon: /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
81
84
|
type: "layout"
|
|
82
85
|
}),
|
|
83
|
-
title:
|
|
86
|
+
title: /*#__PURE__*/_react.default.createElement(_TreeEditor.default, {
|
|
87
|
+
item: props
|
|
88
|
+
}),
|
|
84
89
|
key: props.id
|
|
85
90
|
}, (children === null || children === void 0 ? void 0 : children.length) && children.map(function (_id) {
|
|
86
91
|
return render(childrenMap[_id]);
|
|
@@ -91,12 +96,12 @@ var Outline = function Outline(_ref) {
|
|
|
91
96
|
});
|
|
92
97
|
});
|
|
93
98
|
(0, _ahooks.useDeepCompareLayoutEffect)(function () {
|
|
94
|
-
if (!
|
|
99
|
+
if (!pageData) {
|
|
95
100
|
return;
|
|
96
101
|
}
|
|
97
|
-
var _reduce = (0, _lodash.reduce)(
|
|
98
|
-
var resultKey =
|
|
99
|
-
result[resultKey][_id] =
|
|
102
|
+
var _reduce = (0, _lodash.reduce)(pageData.children, function (result, _id) {
|
|
103
|
+
var resultKey = _constants.LC_BUILDIN_UNIT_KEY_LIST.includes(_id) ? 'page' : 'modal';
|
|
104
|
+
result[resultKey][_id] = pageData[_id];
|
|
100
105
|
if (!result[resultKey].children) {
|
|
101
106
|
result[resultKey].children = [];
|
|
102
107
|
}
|
|
@@ -112,13 +117,13 @@ var Outline = function Outline(_ref) {
|
|
|
112
117
|
page: render(page),
|
|
113
118
|
modal: render(modal)
|
|
114
119
|
});
|
|
115
|
-
}, [
|
|
120
|
+
}, [pageData]);
|
|
116
121
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
117
122
|
className: _outline.default['lc-painter-outline']
|
|
118
123
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
119
|
-
className: (0, _classnames.default)(_outline.default['page-node'], (0, _defineProperty2.default)({}, _outline.default['page-node-active'], selectedKey === _constants.
|
|
124
|
+
className: (0, _classnames.default)(_outline.default['page-node'], (0, _defineProperty2.default)({}, _outline.default['page-node-active'], selectedKey === _constants.LC_BUILDIN_UNIT_KEY.PAGE_ROOT)),
|
|
120
125
|
onClick: function onClick() {
|
|
121
|
-
return handleSelect(_constants.
|
|
126
|
+
return handleSelect(_constants.LC_BUILDIN_UNIT_KEY.PAGE_ROOT);
|
|
122
127
|
}
|
|
123
128
|
}, /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
124
129
|
type: "layout"
|
|
@@ -158,14 +163,14 @@ var Outline = function Outline(_ref) {
|
|
|
158
163
|
node = _ref4.node;
|
|
159
164
|
if (selected && node.props.pos.split('-').length === 2) {
|
|
160
165
|
// 选中节点是模态视图,则打开模态视图组件
|
|
161
|
-
|
|
166
|
+
ctx.$publisher(ctx.topics.COMPONENT_MODAL_TOGGLE, {
|
|
162
167
|
toggle: true,
|
|
163
168
|
id: _key
|
|
164
169
|
});
|
|
165
170
|
handleSelect(_key);
|
|
166
171
|
} else if (!selected && node.props.pos.split('-').length === 2) {
|
|
167
172
|
// 取消选中节点是模态视图,则关闭模态视图
|
|
168
|
-
|
|
173
|
+
ctx.$publisher(ctx.topics.COMPONENT_MODAL_TOGGLE, {
|
|
169
174
|
toggle: false,
|
|
170
175
|
id: _key
|
|
171
176
|
});
|
|
@@ -173,10 +178,10 @@ var Outline = function Outline(_ref) {
|
|
|
173
178
|
} else {
|
|
174
179
|
// 选中节点是模态视图下的子组件,则打开该组件的模态视图组件
|
|
175
180
|
handleSelect(node.props.eventKey);
|
|
176
|
-
var _split3 = (0, _lodash.split)((0, _dataProcess.getPathById)(
|
|
181
|
+
var _split3 = (0, _lodash.split)((0, _dataProcess.getPathById)(pageData, node.props.eventKey), '/'),
|
|
177
182
|
_split4 = (0, _slicedToArray2.default)(_split3, 1),
|
|
178
183
|
parentModal = _split4[0];
|
|
179
|
-
|
|
184
|
+
ctx.$publisher(ctx.topics.COMPONENT_MODAL_TOGGLE, {
|
|
180
185
|
toggle: true,
|
|
181
186
|
id: parentModal
|
|
182
187
|
});
|
|
@@ -188,7 +193,7 @@ var Outline = function Outline(_ref) {
|
|
|
188
193
|
node = _ref6.node;
|
|
189
194
|
if (expanded && node.props.pos.split('-').length === 2) {
|
|
190
195
|
handleSelect(null);
|
|
191
|
-
|
|
196
|
+
ctx.$publisher(ctx.topics.COMPONENT_MODAL_TOGGLE, {
|
|
192
197
|
toggle: true,
|
|
193
198
|
id: node.props.eventKey
|
|
194
199
|
});
|
|
@@ -207,7 +212,7 @@ var Outline = function Outline(_ref) {
|
|
|
207
212
|
var _ref9 = (0, _slicedToArray2.default)(_ref7, 1),
|
|
208
213
|
_key = _ref9[0];
|
|
209
214
|
var node = _ref8.node;
|
|
210
|
-
|
|
215
|
+
ctx.$publisher(ctx.topics.COMPONENT_MODAL_TOGGLE, {
|
|
211
216
|
toggle: false
|
|
212
217
|
});
|
|
213
218
|
handleSelect(node.props.eventKey);
|
|
@@ -1,44 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
-
var
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
13
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
14
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
13
|
var _ahooks = require("ahooks");
|
|
16
14
|
var _antd = require("luck-design/antd");
|
|
17
15
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
18
16
|
var _lodash = require("lodash");
|
|
17
|
+
var _utils = require("@luck-design-biz/base/utils");
|
|
19
18
|
var _ContextProvider = require("../engine/provider/ContextProvider");
|
|
20
|
-
var
|
|
21
|
-
var
|
|
19
|
+
var _AttrsPanel = _interopRequireDefault(require("./components/AttrsPanel"));
|
|
20
|
+
var _StylePanel = _interopRequireDefault(require("./panel-section/StylePanel"));
|
|
21
|
+
var _AdvancePanel = _interopRequireDefault(require("./components/AdvancePanel"));
|
|
22
22
|
var _dataProcess = require("../engine/tools/dataProcess");
|
|
23
23
|
var _panel = _interopRequireDefault(require("./style/panel.less"));
|
|
24
|
-
var
|
|
25
|
-
var
|
|
24
|
+
var _constants = require("../constants");
|
|
25
|
+
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel';
|
|
26
26
|
var _TAB_LIST_ = [{
|
|
27
|
-
title:
|
|
27
|
+
title: (0, _utils.formatMessage)({
|
|
28
|
+
id: "".concat(_I18N_PREFIX_, ".attrs"),
|
|
29
|
+
label: '属性'
|
|
30
|
+
}),
|
|
28
31
|
key: 'attrs'
|
|
29
32
|
}, {
|
|
30
|
-
title:
|
|
31
|
-
|
|
33
|
+
title: (0, _utils.formatMessage)({
|
|
34
|
+
id: "".concat(_I18N_PREFIX_, ".css"),
|
|
35
|
+
label: '样式'
|
|
36
|
+
}),
|
|
37
|
+
key: 'css'
|
|
32
38
|
}, {
|
|
33
|
-
title:
|
|
39
|
+
title: (0, _utils.formatMessage)({
|
|
40
|
+
id: "".concat(_I18N_PREFIX_, ".advance"),
|
|
41
|
+
label: '高级'
|
|
42
|
+
}),
|
|
34
43
|
key: 'advance'
|
|
35
44
|
}];
|
|
36
45
|
var Panel = function Panel() {
|
|
37
|
-
var _nextRef$current, _nextRef$current2;
|
|
38
46
|
var activeTabRef = (0, _react.useRef)(null);
|
|
39
47
|
var underLineRef = (0, _react.useRef)(null);
|
|
40
|
-
var nextRef = (0, _react.useRef)(null);
|
|
41
|
-
var factory = (0, _react.useRef)(new _panelItemFactory.default());
|
|
42
48
|
var _useState = (0, _react.useState)(null),
|
|
43
49
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
44
50
|
activeNode = _useState2[0],
|
|
@@ -47,107 +53,60 @@ var Panel = function Panel() {
|
|
|
47
53
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
48
54
|
activeTabKey = _useState4[0],
|
|
49
55
|
setActiveTabKey = _useState4[1];
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
var context = (0, _ContextProvider.useContext)();
|
|
57
|
+
var _usePageData = (0, _ContextProvider.usePageData)(),
|
|
58
|
+
_usePageData2 = (0, _slicedToArray2.default)(_usePageData, 2),
|
|
59
|
+
pageData = _usePageData2[0],
|
|
60
|
+
setPageData = _usePageData2[1].setPageData;
|
|
61
|
+
var meta = (0, _ahooks.useCreation)(function () {
|
|
62
|
+
try {
|
|
63
|
+
return (0, _lodash.isNil)(activeNode) ? null : require("../engine/meta/".concat(activeNode.node.component.toLowerCase(), ".props.json"));
|
|
64
|
+
} catch (e) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
}, [activeNode]);
|
|
57
68
|
var handleChange = (0, _ahooks.useMemoizedFn)(function (field, value, repositioning) {
|
|
69
|
+
var cloneData = (0, _lodash.cloneDeep)(pageData);
|
|
70
|
+
if (field === 'enableHeader') {
|
|
71
|
+
if (value) {
|
|
72
|
+
var headerMeta = require("../engine/meta/pageheader.props.default.json");
|
|
73
|
+
(0, _dataProcess.add)(cloneData, _constants.LC_BUILDIN_UNIT_KEY.PAGE_ROOT, _constants.LC_BUILDIN_UNIT_KEY.PAGE_HEADER, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, headerMeta), {}, {
|
|
74
|
+
buildIn: true
|
|
75
|
+
}));
|
|
76
|
+
} else {
|
|
77
|
+
(0, _dataProcess.deleteById)(cloneData, _constants.LC_BUILDIN_UNIT_KEY.PAGE_HEADER);
|
|
78
|
+
}
|
|
79
|
+
} else if (field === 'enableFooter') {
|
|
80
|
+
if (value) {
|
|
81
|
+
var footerMeta = require("../engine/meta/pagefooter.props.default.json");
|
|
82
|
+
(0, _dataProcess.add)(cloneData, _constants.LC_BUILDIN_UNIT_KEY.PAGE_ROOT, _constants.LC_BUILDIN_UNIT_KEY.PAGE_FOOTER, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, footerMeta), {}, {
|
|
83
|
+
buildIn: true
|
|
84
|
+
}));
|
|
85
|
+
} else {
|
|
86
|
+
(0, _dataProcess.deleteById)(cloneData, _constants.LC_BUILDIN_UNIT_KEY.PAGE_FOOTER);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
58
89
|
var component = context.componentMap.get(activeNode.node.id);
|
|
59
90
|
var _component$api$getSel = component.api.getSelfAndParentLCData(),
|
|
60
91
|
node = _component$api$getSel.node;
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
|
|
92
|
+
var oldValue = (0, _defineProperty2.default)({}, field, (0, _lodash.get)(node.props, field));
|
|
93
|
+
var newNodeData = (0, _lodash.set)(node.props, field, value);
|
|
94
|
+
(0, _dataProcess.modifyById)(cloneData, activeNode.node.id, newNodeData);
|
|
95
|
+
setPageData(cloneData).then(function (newData) {
|
|
64
96
|
context.$publisher(context.topics.COMPONENT_MODIFY, {
|
|
65
97
|
id: activeNode.node.id,
|
|
66
|
-
pageData: (0, _lodash.cloneDeep)(newData)
|
|
98
|
+
pageData: (0, _lodash.cloneDeep)(newData),
|
|
99
|
+
oldValue: oldValue,
|
|
100
|
+
newValue: (0, _defineProperty2.default)({}, field, value)
|
|
67
101
|
});
|
|
68
102
|
if (repositioning) context.$publisher(context.topics.COMPONENT_REPOSITIONING, {
|
|
69
103
|
id: activeNode.node.id
|
|
70
104
|
});
|
|
71
105
|
});
|
|
72
|
-
if (nextRef.current.autoClose) {
|
|
73
|
-
setFalse();
|
|
74
|
-
}
|
|
75
106
|
});
|
|
76
|
-
var handleStyleChange = (0, _ahooks.useMemoizedFn)(function (newStyle, newCss) {
|
|
77
|
-
console.log('style', newStyle, newCss);
|
|
78
|
-
// setCss(newCss);
|
|
79
|
-
});
|
|
80
|
-
var goNext = (0, _ahooks.useMemoizedFn)(function (_next) {
|
|
81
|
-
if (!_next) return;
|
|
82
|
-
nextRef.current = {
|
|
83
|
-
name: _next.name,
|
|
84
|
-
autoClose: _next.autoClose,
|
|
85
|
-
NextComp: renderPanelItems(_next.props)
|
|
86
|
-
};
|
|
87
|
-
setTrue();
|
|
88
|
-
});
|
|
89
|
-
var renderPanelItems = (0, _ahooks.useMemoizedFn)(function (items) {
|
|
90
|
-
return items.map(function (_ref) {
|
|
91
|
-
var type = _ref.type,
|
|
92
|
-
key = _ref.key,
|
|
93
|
-
name = _ref.name,
|
|
94
|
-
desc = _ref.desc,
|
|
95
|
-
defaultValue = _ref.default,
|
|
96
|
-
props = _ref.props,
|
|
97
|
-
panelItem = _ref.panelItem,
|
|
98
|
-
_next2 = _ref.next,
|
|
99
|
-
repositioning = _ref.repositioning,
|
|
100
|
-
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
101
|
-
var Comp = factory.current.getPanelItemFor((0, _lodash.startsWith)(type, '_') ? 'dynamic' : type, type);
|
|
102
|
-
if (type === 'group') {
|
|
103
|
-
return /*#__PURE__*/_react.default.createElement(Comp, {
|
|
104
|
-
key: key,
|
|
105
|
-
field: key,
|
|
106
|
-
label: name,
|
|
107
|
-
next: _next2 ? function () {
|
|
108
|
-
return goNext(_next2);
|
|
109
|
-
} : null,
|
|
110
|
-
defaultCollapsed: defaultValue,
|
|
111
|
-
desc: desc
|
|
112
|
-
}, renderPanelItems(props || []));
|
|
113
|
-
}
|
|
114
|
-
var _context$componentMap = context.componentMap.get(activeNode.node.id).api.getSelfAndParentLCData(),
|
|
115
|
-
node = _context$componentMap.node;
|
|
116
|
-
return /*#__PURE__*/_react.default.createElement(_PanelItem.default, (0, _extends2.default)({
|
|
117
|
-
key: key,
|
|
118
|
-
field: key,
|
|
119
|
-
label: name,
|
|
120
|
-
desc: desc
|
|
121
|
-
}, panelItem), Comp && /*#__PURE__*/_react.default.createElement(Comp, (0, _extends2.default)({
|
|
122
|
-
defaultValue: (0, _lodash.isNil)(node.props[key]) ? defaultValue : node.props[key],
|
|
123
|
-
next: function next() {
|
|
124
|
-
return goNext(_next2);
|
|
125
|
-
},
|
|
126
|
-
onChange: function onChange(value) {
|
|
127
|
-
return handleChange(key, value, repositioning);
|
|
128
|
-
},
|
|
129
|
-
size: "small"
|
|
130
|
-
}, rest)));
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
var PropsComps = (0, _ahooks.useCreation)(function () {
|
|
134
|
-
setActiveTabKey('attrs');
|
|
135
|
-
var _meta;
|
|
136
|
-
try {
|
|
137
|
-
_meta = require("../engine/meta/".concat(activeNode.node.component.toLowerCase(), ".props.json"));
|
|
138
|
-
} catch (e) {
|
|
139
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
140
|
-
}
|
|
141
|
-
return renderPanelItems(_meta.props);
|
|
142
|
-
}, [activeNode]);
|
|
143
|
-
(0, _react.useEffect)(function () {
|
|
144
|
-
if (!open) {
|
|
145
|
-
nextRef.current = null;
|
|
146
|
-
}
|
|
147
|
-
}, [open]);
|
|
148
107
|
(0, _react.useEffect)(function () {
|
|
149
108
|
var _id = context.$subscriber(context.topics.COMPONENT_ACTIVE).on(function (payload) {
|
|
150
|
-
|
|
109
|
+
setActiveTabKey('attrs');
|
|
151
110
|
if (!payload.id) {
|
|
152
111
|
setActiveNode(null);
|
|
153
112
|
return;
|
|
@@ -162,12 +121,12 @@ var Panel = function Panel() {
|
|
|
162
121
|
});
|
|
163
122
|
}).watch();
|
|
164
123
|
return function () {
|
|
165
|
-
context.$unsubscriber(context.topics.COMPONENT_ACTIVE, _id);
|
|
124
|
+
return context.$unsubscriber(context.topics.COMPONENT_ACTIVE, _id);
|
|
166
125
|
};
|
|
167
126
|
}, []);
|
|
168
127
|
(0, _react.useLayoutEffect)(function () {
|
|
169
128
|
underLineRef.current.style.left = "".concat(activeTabRef.current.offsetLeft + activeTabRef.current.offsetWidth / 2 - 10, "px");
|
|
170
|
-
}, [activeTabKey,
|
|
129
|
+
}, [activeTabKey, meta === null || meta === void 0 ? void 0 : meta.component]);
|
|
171
130
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
172
131
|
className: _panel.default['lc-painter-panel']
|
|
173
132
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -177,9 +136,9 @@ var Panel = function Panel() {
|
|
|
177
136
|
style: {
|
|
178
137
|
fontSize: 12
|
|
179
138
|
}
|
|
180
|
-
}, activeNode === null || activeNode === void 0 ? void 0 : activeNode.level.map(function (
|
|
181
|
-
var id =
|
|
182
|
-
name =
|
|
139
|
+
}, activeNode === null || activeNode === void 0 ? void 0 : activeNode.level.map(function (_ref) {
|
|
140
|
+
var id = _ref.id,
|
|
141
|
+
name = _ref.name;
|
|
183
142
|
return /*#__PURE__*/_react.default.createElement(_antd.Breadcrumb.Item, {
|
|
184
143
|
key: id,
|
|
185
144
|
className: (0, _classnames.default)((0, _defineProperty2.default)({}, _panel.default['active-node-level'], id !== activeNode.node.id)),
|
|
@@ -204,7 +163,16 @@ var Panel = function Panel() {
|
|
|
204
163
|
className: (0, _classnames.default)(_panel.default['lc-painter-panel-tabbar'], (0, _defineProperty2.default)({}, _panel.default.hidden, !activeNode))
|
|
205
164
|
}, /*#__PURE__*/_react.default.createElement("ul", {
|
|
206
165
|
className: _panel.default.headerList
|
|
207
|
-
}, (
|
|
166
|
+
}, (0, _lodash.reduce)(_TAB_LIST_, function (ret, item) {
|
|
167
|
+
if (item.key === 'css' && !!(meta !== null && meta !== void 0 && meta.css)) {
|
|
168
|
+
ret.push(item);
|
|
169
|
+
} else if (item.key === 'advance' && !!(meta !== null && meta !== void 0 && meta.advance)) {
|
|
170
|
+
ret.push(item);
|
|
171
|
+
} else if (item.key === 'attrs') {
|
|
172
|
+
ret.push(item);
|
|
173
|
+
}
|
|
174
|
+
return ret;
|
|
175
|
+
}, []).map(function (_item) {
|
|
208
176
|
return /*#__PURE__*/_react.default.createElement("li", {
|
|
209
177
|
key: _item.key,
|
|
210
178
|
ref: activeTabKey === _item.key ? activeTabRef : null,
|
|
@@ -216,38 +184,28 @@ var Panel = function Panel() {
|
|
|
216
184
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
217
185
|
ref: underLineRef,
|
|
218
186
|
className: _panel.default.underline
|
|
219
|
-
})), activeTabKey === _TAB_LIST_[0].key && /*#__PURE__*/_react.default.createElement(
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
mask: false,
|
|
225
|
-
closable: false,
|
|
226
|
-
getContainer: false,
|
|
227
|
-
destroyOnClose: true,
|
|
228
|
-
style: {
|
|
229
|
-
position: 'absolute'
|
|
230
|
-
},
|
|
231
|
-
bodyStyle: {
|
|
232
|
-
padding: 0,
|
|
233
|
-
height: '100%'
|
|
187
|
+
})), activeTabKey === _TAB_LIST_[0].key && /*#__PURE__*/_react.default.createElement(_AttrsPanel.default, {
|
|
188
|
+
meta: meta,
|
|
189
|
+
value: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node,
|
|
190
|
+
onChange: function onChange(field, value, repositioning) {
|
|
191
|
+
return handleChange(field, value, repositioning);
|
|
234
192
|
}
|
|
235
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}
|
|
247
|
-
onChange: handleStyleChange,
|
|
248
|
-
value: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node.style
|
|
249
|
-
}), activeTabKey === _TAB_LIST_[2].key && /*#__PURE__*/_react.default.createElement("div", null, "\u9AD8\u7EA7\u9762\u677F"), /*#__PURE__*/_react.default.createElement("div", {
|
|
193
|
+
}), activeTabKey === _TAB_LIST_[1].key && /*#__PURE__*/_react.default.createElement(_StylePanel.default, {
|
|
194
|
+
value: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node.css,
|
|
195
|
+
onChange: function onChange(_, newCss) {
|
|
196
|
+
return handleChange('css', newCss);
|
|
197
|
+
}
|
|
198
|
+
}), activeTabKey === _TAB_LIST_[2].key && /*#__PURE__*/_react.default.createElement(_AdvancePanel.default, {
|
|
199
|
+
meta: meta,
|
|
200
|
+
value: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node.advance,
|
|
201
|
+
onChange: function onChange(val) {
|
|
202
|
+
return handleChange('advance', val);
|
|
203
|
+
}
|
|
204
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
250
205
|
className: (0, _classnames.default)(_panel.default['lc-painter-panel-empty'], (0, _defineProperty2.default)({}, _panel.default.hidden, !!activeNode))
|
|
251
|
-
},
|
|
206
|
+
}, (0, _utils.formatMessage)({
|
|
207
|
+
id: "".concat(_I18N_PREFIX_, ".empty"),
|
|
208
|
+
label: '请在左侧画布选中节点'
|
|
209
|
+
})));
|
|
252
210
|
};
|
|
253
211
|
var _default = exports.default = Panel;
|