@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,16 +1,74 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
8
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
+
var _ahooks = require("ahooks");
|
|
15
|
+
var _lodash = require("lodash");
|
|
16
|
+
var _utils = require("@luck-design-biz/base/utils");
|
|
17
|
+
var _ContextProvider = require("../../../engine/provider/ContextProvider");
|
|
9
18
|
var _index = _interopRequireDefault(require("./index"));
|
|
10
|
-
var
|
|
19
|
+
var _dataProcess = require("../../../engine/tools/dataProcess");
|
|
20
|
+
var _boxPropsDefault = _interopRequireDefault(require("../../../engine/meta/box.props.default.json"));
|
|
21
|
+
var _excluded = ["children", "id", "display"];
|
|
11
22
|
var FunctionDesign = function FunctionDesign(_ref) {
|
|
12
23
|
var children = _ref.children,
|
|
24
|
+
id = _ref.id,
|
|
25
|
+
display = _ref.display,
|
|
13
26
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
14
|
-
|
|
27
|
+
var ctx = (0, _ContextProvider.useContext)();
|
|
28
|
+
var _usePageData = (0, _ContextProvider.usePageData)(),
|
|
29
|
+
_usePageData2 = (0, _slicedToArray2.default)(_usePageData, 2),
|
|
30
|
+
setPageData = _usePageData2[1].setPageData;
|
|
31
|
+
var refreshChild = (0, _ahooks.useMemoizedFn)(function (_pageData) {
|
|
32
|
+
var cloneData = (0, _lodash.cloneDeep)(_pageData);
|
|
33
|
+
var _findNodeAndParent = (0, _dataProcess.findNodeAndParent)(id, cloneData),
|
|
34
|
+
current = _findNodeAndParent.node;
|
|
35
|
+
var ratioArr = display.ratio ? display.ratio.split(':') : new Array(display.type.length);
|
|
36
|
+
(0, _lodash.drop)(current.children, ratioArr.length).forEach(function (boxId) {
|
|
37
|
+
(0, _dataProcess.deleteById)(cloneData, boxId);
|
|
38
|
+
});
|
|
39
|
+
ratioArr.forEach(function (_, index) {
|
|
40
|
+
var _current$children;
|
|
41
|
+
if (!((_current$children = current.children) !== null && _current$children !== void 0 && _current$children[index])) {
|
|
42
|
+
(0, _dataProcess.add)(cloneData, id, "box_".concat((0, _utils.suid)()), (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _boxPropsDefault.default), {}, {
|
|
43
|
+
buildIn: true
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
setPageData(cloneData);
|
|
48
|
+
});
|
|
49
|
+
(0, _ahooks.useCreation)(function () {
|
|
50
|
+
if (children !== null && children !== void 0 && children.length) return;
|
|
51
|
+
ctx.$subscriber(ctx.topics.COMPONENT_APPEND).once(function (_ref2) {
|
|
52
|
+
var compId = _ref2.id,
|
|
53
|
+
pageData = _ref2.pageData;
|
|
54
|
+
if (compId !== id) return;
|
|
55
|
+
refreshChild(pageData);
|
|
56
|
+
}).watch();
|
|
57
|
+
}, []);
|
|
58
|
+
(0, _react.useEffect)(function () {
|
|
59
|
+
var cmid = ctx.$subscriber(ctx.topics.COMPONENT_MODIFY).on(function (_ref3) {
|
|
60
|
+
var compId = _ref3.id,
|
|
61
|
+
pageData = _ref3.pageData;
|
|
62
|
+
if (compId !== id) return;
|
|
63
|
+
refreshChild(pageData);
|
|
64
|
+
}).watch();
|
|
65
|
+
return function () {
|
|
66
|
+
return ctx.$unsubscriber(ctx.topics.COMPONENT_MODIFY, cmid);
|
|
67
|
+
};
|
|
68
|
+
}, []);
|
|
69
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, (0, _extends2.default)({
|
|
70
|
+
id: id,
|
|
71
|
+
display: display
|
|
72
|
+
}, props), children);
|
|
15
73
|
};
|
|
16
74
|
var _default = exports.default = FunctionDesign;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
+
var _index = _interopRequireDefault(require("./index"));
|
|
10
|
+
var _excluded = ["children"];
|
|
11
|
+
var FunctionPreview = function FunctionPreview(_ref) {
|
|
12
|
+
var children = _ref.children,
|
|
13
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
14
|
+
return /*#__PURE__*/React.createElement(_index.default, props, children);
|
|
15
|
+
};
|
|
16
|
+
var _default = exports.default = FunctionPreview;
|
|
@@ -6,24 +6,63 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
10
|
var _ahooks = require("ahooks");
|
|
11
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
12
|
+
var _lodash = require("lodash");
|
|
13
|
+
var _base = require("@luck-design-biz/base");
|
|
12
14
|
var _Wrapper = _interopRequireDefault(require("../Wrapper"));
|
|
13
|
-
var
|
|
15
|
+
var _MAPPING_ = {
|
|
16
|
+
left: 'min',
|
|
17
|
+
up: 'min',
|
|
18
|
+
right: 'max',
|
|
19
|
+
down: 'max'
|
|
20
|
+
};
|
|
21
|
+
var Div = _styledComponents.default.div.withConfig({
|
|
22
|
+
displayName: "Div",
|
|
23
|
+
componentId: "luckda-6530__sc-halzyx-0"
|
|
24
|
+
})(["width:100%;height:100%;", ""], function (props) {
|
|
25
|
+
return props.$css;
|
|
26
|
+
});
|
|
14
27
|
var LCSplit = function LCSplit(_ref) {
|
|
15
28
|
var id = _ref.id,
|
|
16
29
|
children = _ref.children,
|
|
17
|
-
|
|
30
|
+
css = _ref.css,
|
|
31
|
+
display = _ref.display;
|
|
32
|
+
var prevDisplay = (0, _ahooks.usePrevious)(display);
|
|
18
33
|
var ref = (0, _react.useRef)();
|
|
19
34
|
var getTargetDom = (0, _ahooks.useMemoizedFn)(function () {
|
|
20
35
|
return ref.current;
|
|
21
36
|
});
|
|
37
|
+
var _useCreation = (0, _ahooks.useCreation)(function () {
|
|
38
|
+
if ((0, _lodash.isNil)(display.ratio)) return {};
|
|
39
|
+
var arr = display.ratio.split(':').map(function (r) {
|
|
40
|
+
return parseInt(r);
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
ratioArr: arr,
|
|
44
|
+
total: (0, _lodash.sum)(arr)
|
|
45
|
+
};
|
|
46
|
+
}, [display.ratio]),
|
|
47
|
+
ratioArr = _useCreation.ratioArr,
|
|
48
|
+
total = _useCreation.total;
|
|
22
49
|
return /*#__PURE__*/_react.default.createElement(_Wrapper.default, {
|
|
23
50
|
id: id,
|
|
51
|
+
displayName: "Split",
|
|
24
52
|
getTargetDom: getTargetDom
|
|
25
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
26
|
-
ref: ref
|
|
27
|
-
|
|
53
|
+
}, /*#__PURE__*/_react.default.createElement(Div, {
|
|
54
|
+
ref: ref,
|
|
55
|
+
$css: css
|
|
56
|
+
}, prevDisplay && prevDisplay.type !== display.type ? null : display.type === 'normal' ? /*#__PURE__*/_react.default.createElement(_base.MemorySplit, {
|
|
57
|
+
split: display.split
|
|
58
|
+
}, ratioArr.map(function (r, i) {
|
|
59
|
+
return /*#__PURE__*/_react.default.createElement(_base.MemorySplit.Pane, {
|
|
60
|
+
fastTo: i === display.fastTo.length ? 'max' : _MAPPING_[display.fastTo[i]],
|
|
61
|
+
initialSize: "".concat(r / total * 100, "%"),
|
|
62
|
+
key: i
|
|
63
|
+
}, children[i]);
|
|
64
|
+
})) : /*#__PURE__*/_react.default.createElement(_base.Layout, null, /*#__PURE__*/_react.default.createElement(_base.Layout.Sider, null, children[0]), /*#__PURE__*/_react.default.createElement(_base.Layout.Main, null, display.type === 'lr' ? children[1] : /*#__PURE__*/_react.default.createElement(_base.MemorySplit, {
|
|
65
|
+
split: display.type === 'ltb' ? 'horizontal' : 'vertical'
|
|
66
|
+
}, children[1], children[2])))));
|
|
28
67
|
};
|
|
29
68
|
var _default = exports.default = LCSplit;
|
|
@@ -8,45 +8,26 @@
|
|
|
8
8
|
"order": 1,
|
|
9
9
|
"props": [
|
|
10
10
|
{
|
|
11
|
-
"key": "
|
|
11
|
+
"key": "id",
|
|
12
12
|
"name": "唯一标识",
|
|
13
|
-
"desc": "组件的唯一标识符,不能够与其它组件重名,不能够为空,且只能够使用以字母开头的,下划线以及数字的组合",
|
|
14
13
|
"type": "string",
|
|
15
14
|
"disabled": true
|
|
16
15
|
},
|
|
17
16
|
{
|
|
18
|
-
"key": "
|
|
17
|
+
"key": "displaySetting",
|
|
19
18
|
"name": "展现形式",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"default": "normal"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"key": "split",
|
|
26
|
-
"name": "分割方向",
|
|
27
|
-
"desc": "分割面板容器的分割方向(仅display为normal时有效)",
|
|
28
|
-
"type": "radio",
|
|
29
|
-
"options": [
|
|
30
|
-
{
|
|
31
|
-
"label": "垂直",
|
|
32
|
-
"value": "vertical"
|
|
33
|
-
},
|
|
19
|
+
"type": "group",
|
|
20
|
+
"props": [
|
|
34
21
|
{
|
|
35
|
-
"
|
|
36
|
-
"
|
|
22
|
+
"key": "display",
|
|
23
|
+
"name": "#展现形式",
|
|
24
|
+
"type": "_SplitDisplay",
|
|
25
|
+
"default": { "type": "normal", "split": "horizontal", "ratio": "1:1" }
|
|
37
26
|
}
|
|
38
|
-
]
|
|
39
|
-
"default": "vertical"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"key": "ratio",
|
|
43
|
-
"name": "比率",
|
|
44
|
-
"desc": "表示分割面板容器所占比例的比率(仅display为normal时有效)",
|
|
45
|
-
"type": "string",
|
|
46
|
-
"default": "1:3"
|
|
27
|
+
]
|
|
47
28
|
}
|
|
48
29
|
],
|
|
49
|
-
"
|
|
30
|
+
"css": "background-color: transparent",
|
|
50
31
|
"advance": {
|
|
51
32
|
"events": [
|
|
52
33
|
{
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
@@ -8,18 +9,55 @@ exports.default = void 0;
|
|
|
8
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
13
|
var _index = _interopRequireDefault(require("./index"));
|
|
14
|
+
var _ahooks = require("ahooks");
|
|
12
15
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
var
|
|
14
|
-
var _excluded = ["children", "className", "suppressPreset"];
|
|
16
|
+
var _excluded = ["children", "className", "suppressPreset", "renderIndex", "zebra", "actions"];
|
|
15
17
|
var FunctionDesign = function FunctionDesign(_ref) {
|
|
16
18
|
var children = _ref.children,
|
|
17
19
|
className = _ref.className,
|
|
18
20
|
suppressPreset = _ref.suppressPreset,
|
|
21
|
+
renderIndex = _ref.renderIndex,
|
|
22
|
+
zebra = _ref.zebra,
|
|
23
|
+
actions = _ref.actions,
|
|
19
24
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
var ref = (0, _react.useRef)(null);
|
|
26
|
+
var gridRef = (0, _react.useRef)(null);
|
|
27
|
+
var latestZebra = (0, _ahooks.useLatest)(zebra);
|
|
28
|
+
var latestActions = (0, _ahooks.useLatest)(actions);
|
|
29
|
+
var handleGridReady = (0, _ahooks.useMemoizedFn)(function (grid) {
|
|
30
|
+
gridRef.current = grid;
|
|
31
|
+
});
|
|
32
|
+
(0, _ahooks.useUpdateEffect)(function () {
|
|
33
|
+
if (!gridRef.current) return;
|
|
34
|
+
var itemsToUpdate = [];
|
|
35
|
+
gridRef.current.api.forEachNode(function (rowNode) {
|
|
36
|
+
itemsToUpdate.push(rowNode.data);
|
|
37
|
+
});
|
|
38
|
+
gridRef.current.api.updateRowData({
|
|
39
|
+
update: itemsToUpdate
|
|
40
|
+
});
|
|
41
|
+
}, [zebra]);
|
|
42
|
+
(0, _ahooks.useUpdateEffect)(function () {
|
|
43
|
+
if (!gridRef.current) return;
|
|
44
|
+
gridRef.current.api.refreshCells({
|
|
45
|
+
columns: ['luck-actions'],
|
|
46
|
+
force: true
|
|
47
|
+
});
|
|
48
|
+
}, [actions]);
|
|
49
|
+
(0, _ahooks.useUpdateEffect)(function () {
|
|
50
|
+
if (!gridRef.current) return;
|
|
51
|
+
gridRef.current.columnApi.setColumnVisible('luck-index', renderIndex);
|
|
52
|
+
}, [renderIndex]);
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, (0, _extends2.default)({
|
|
54
|
+
ref: ref,
|
|
55
|
+
className: (0, _classnames.default)((0, _defineProperty2.default)({}, className, !!className)),
|
|
56
|
+
suppressPreset: true,
|
|
57
|
+
renderIndex: renderIndex,
|
|
58
|
+
zebra: latestZebra,
|
|
59
|
+
actions: latestActions,
|
|
60
|
+
onGridReady: handleGridReady
|
|
23
61
|
}, props), children);
|
|
24
62
|
};
|
|
25
63
|
var _default = exports.default = FunctionDesign;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
+
var _index = _interopRequireDefault(require("./index"));
|
|
10
|
+
var _excluded = ["children"];
|
|
11
|
+
var FunctionPreview = function FunctionPreview(_ref) {
|
|
12
|
+
var children = _ref.children,
|
|
13
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
14
|
+
return /*#__PURE__*/React.createElement(_index.default, props, children);
|
|
15
|
+
};
|
|
16
|
+
var _default = exports.default = FunctionPreview;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _ahooks = require("ahooks");
|
|
14
|
+
var _antd = require("luck-design/antd");
|
|
15
|
+
var _lodash = require("lodash");
|
|
16
|
+
function mockDict() {
|
|
17
|
+
return new Promise(function (resolve) {
|
|
18
|
+
setTimeout(function () {
|
|
19
|
+
resolve([{
|
|
20
|
+
value: '1',
|
|
21
|
+
label: '启用'
|
|
22
|
+
}, {
|
|
23
|
+
value: '2',
|
|
24
|
+
label: '未启用'
|
|
25
|
+
}, {
|
|
26
|
+
value: '0',
|
|
27
|
+
label: '未知'
|
|
28
|
+
}]);
|
|
29
|
+
}, 600);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function mockDApi() {
|
|
33
|
+
return new Promise(function (resolve) {
|
|
34
|
+
setTimeout(function () {
|
|
35
|
+
resolve({
|
|
36
|
+
options: [{
|
|
37
|
+
value: '2023',
|
|
38
|
+
label: '2023年'
|
|
39
|
+
}, {
|
|
40
|
+
value: '2024',
|
|
41
|
+
label: '2024年'
|
|
42
|
+
}, {
|
|
43
|
+
value: '2024',
|
|
44
|
+
label: '2025年'
|
|
45
|
+
}],
|
|
46
|
+
field: 'planYear'
|
|
47
|
+
});
|
|
48
|
+
}, 600);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
var TopFilter = function TopFilter(_ref) {
|
|
52
|
+
var filter = _ref.filter;
|
|
53
|
+
var _useState = (0, _react.useState)((0, _lodash.isArray)(filter) ? filter : []),
|
|
54
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
55
|
+
optons = _useState2[0],
|
|
56
|
+
setOptions = _useState2[1];
|
|
57
|
+
(0, _ahooks.useAsyncEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
58
|
+
var _yield$mockDApi, options, field;
|
|
59
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
60
|
+
while (1) switch (_context.prev = _context.next) {
|
|
61
|
+
case 0:
|
|
62
|
+
if (!(0, _lodash.isString)(filter)) {
|
|
63
|
+
_context.next = 9;
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
_context.next = 3;
|
|
67
|
+
return mockDApi();
|
|
68
|
+
case 3:
|
|
69
|
+
_yield$mockDApi = _context.sent;
|
|
70
|
+
options = _yield$mockDApi.options;
|
|
71
|
+
field = _yield$mockDApi.field;
|
|
72
|
+
setOptions(options);
|
|
73
|
+
_context.next = 19;
|
|
74
|
+
break;
|
|
75
|
+
case 9:
|
|
76
|
+
if (!(0, _lodash.isArray)(filter)) {
|
|
77
|
+
_context.next = 13;
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
setOptions(filter);
|
|
81
|
+
_context.next = 19;
|
|
82
|
+
break;
|
|
83
|
+
case 13:
|
|
84
|
+
if (!(filter.key && filter.field)) {
|
|
85
|
+
_context.next = 19;
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
_context.t0 = setOptions;
|
|
89
|
+
_context.next = 17;
|
|
90
|
+
return mockDict();
|
|
91
|
+
case 17:
|
|
92
|
+
_context.t1 = _context.sent;
|
|
93
|
+
(0, _context.t0)(_context.t1);
|
|
94
|
+
case 19:
|
|
95
|
+
case "end":
|
|
96
|
+
return _context.stop();
|
|
97
|
+
}
|
|
98
|
+
}, _callee);
|
|
99
|
+
})), [filter]);
|
|
100
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Segmented, {
|
|
101
|
+
options: optons
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
var _default = exports.default = TopFilter;
|