@luck-design-biz/luckda 0.0.24-2 → 0.0.25-2
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 +230 -0
- package/es/lowcode/constants/api-url.js +464 -262
- package/es/lowcode/constants/event-topics.js +4 -0
- package/es/lowcode/constants/index.js +31 -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 +4 -3
- package/es/lowcode/engine/meta/box.props.json +2 -4
- package/es/lowcode/engine/meta/button.props.default.json +5 -2
- package/es/lowcode/engine/meta/button.props.json +9 -9
- package/es/lowcode/engine/meta/cardlist.props.default.json +4 -2
- package/es/lowcode/engine/meta/cardlist.props.json +2 -3
- package/es/lowcode/engine/meta/components-list.json +1 -1
- package/es/lowcode/engine/meta/dialog.props.default.json +4 -2
- package/es/lowcode/engine/meta/dialog.props.json +1 -2
- package/es/lowcode/engine/meta/drawer.props.default.json +4 -2
- package/es/lowcode/engine/meta/drawer.props.json +1 -2
- package/es/lowcode/engine/meta/form.props.default.json +52 -4
- package/es/lowcode/engine/meta/form.props.json +596 -64
- 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 +3 -3
- package/es/lowcode/engine/meta/imex.props.default.json +5 -2
- package/es/lowcode/engine/meta/imex.props.json +2 -2
- 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 +3 -3
- 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 +7 -6
- package/es/lowcode/engine/meta/section.props.json +52 -49
- 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 +3 -3
- 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 +177 -0
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +174 -0
- package/es/lowcode/engine/tools/dataProcess.js +64 -2
- package/es/lowcode/engine/tools/helper.js +97 -18
- package/es/lowcode/engine/tools/useCanvasRender.js +73 -0
- package/es/lowcode/engine/tools/usePromiseState.js +23 -12
- 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/Design.js +34 -2
- package/es/lowcode/painter/DesignOperator.js +48 -31
- package/es/lowcode/painter/DesignToolbar.js +324 -16
- package/es/lowcode/painter/I18n.js +2 -2
- package/es/lowcode/painter/Outline.js +31 -26
- package/es/lowcode/painter/Panel.js +99 -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 +50 -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 +26 -11
- 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 +154 -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 +438 -0
- package/es/lowcode/painter/components/field-setting/index.js +373 -0
- package/es/lowcode/painter/index.js +3 -28
- package/es/lowcode/painter/panel-section/ActionsColumnWidth.js +25 -0
- 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 +27 -0
- package/es/lowcode/painter/panel-section/BlocksEditor/BlockEditorItem.js +45 -0
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +235 -0
- package/es/lowcode/painter/panel-section/DataSetSelector.js +115 -43
- package/es/lowcode/painter/panel-section/FieldsSetting.js +329 -0
- package/es/lowcode/painter/panel-section/I18nInput.js +20 -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/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 +7 -4
- 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/list-editor.less +36 -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 +27 -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 +2 -4
- 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 +9 -9
- 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 +2 -3
- package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +16 -24
- 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 +1 -2
- 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 +1 -2
- package/es/lowcode/view/lc-components/Form/FunctionDesign.js +93 -2
- package/es/lowcode/view/lc-components/Form/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Form/index.js +290 -13
- package/es/lowcode/view/lc-components/Form/index.less +5 -0
- package/es/lowcode/view/lc-components/Form/meta.json +546 -64
- 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 +2 -2
- 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 +3 -3
- 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 +23 -22
- 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 +3 -3
- 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/FunctionDesign.js +31 -2
- package/es/lowcode/view/lc-components/Section/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Section/index.js +115 -24
- package/es/lowcode/view/lc-components/Section/index.less +7 -0
- package/es/lowcode/view/lc-components/Section/meta.json +48 -49
- package/es/lowcode/view/lc-components/Split/FunctionDesign.js +57 -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 -48
- package/es/lowcode/view/lc-components/Table/meta.json +229 -55
- package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +70 -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 +3 -3
- 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/upload/Form/gridForm.js +7 -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 +236 -0
- package/lib/lowcode/constants/api-url.js +465 -263
- package/lib/lowcode/constants/event-topics.js +5 -1
- package/lib/lowcode/constants/index.js +32 -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 +4 -3
- package/lib/lowcode/engine/meta/box.props.json +2 -4
- package/lib/lowcode/engine/meta/button.props.default.json +5 -2
- package/lib/lowcode/engine/meta/button.props.json +9 -9
- package/lib/lowcode/engine/meta/cardlist.props.default.json +4 -2
- package/lib/lowcode/engine/meta/cardlist.props.json +2 -3
- package/lib/lowcode/engine/meta/components-list.json +1 -1
- package/lib/lowcode/engine/meta/dialog.props.default.json +4 -2
- package/lib/lowcode/engine/meta/dialog.props.json +1 -2
- package/lib/lowcode/engine/meta/drawer.props.default.json +4 -2
- package/lib/lowcode/engine/meta/drawer.props.json +1 -2
- package/lib/lowcode/engine/meta/form.props.default.json +52 -4
- package/lib/lowcode/engine/meta/form.props.json +596 -64
- 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 +3 -3
- package/lib/lowcode/engine/meta/imex.props.default.json +5 -2
- package/lib/lowcode/engine/meta/imex.props.json +2 -2
- 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 +3 -3
- 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 +7 -6
- package/lib/lowcode/engine/meta/section.props.json +52 -49
- 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 +3 -3
- 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 +185 -0
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +182 -0
- package/lib/lowcode/engine/tools/dataProcess.js +64 -1
- package/lib/lowcode/engine/tools/helper.js +101 -17
- package/lib/lowcode/engine/tools/useCanvasRender.js +88 -0
- package/lib/lowcode/engine/tools/usePromiseState.js +22 -12
- 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/Design.js +32 -0
- package/lib/lowcode/painter/DesignOperator.js +45 -28
- package/lib/lowcode/painter/DesignToolbar.js +321 -13
- package/lib/lowcode/painter/I18n.js +1 -1
- package/lib/lowcode/painter/Outline.js +29 -24
- package/lib/lowcode/painter/Panel.js +96 -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 +57 -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 +25 -10
- 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 +161 -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 +446 -0
- package/lib/lowcode/painter/components/field-setting/index.js +380 -0
- package/lib/lowcode/painter/index.js +3 -30
- package/lib/lowcode/painter/panel-section/ActionsColumnWidth.js +32 -0
- 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 +34 -0
- package/lib/lowcode/painter/panel-section/BlocksEditor/BlockEditorItem.js +52 -0
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +242 -0
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +112 -40
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +337 -0
- package/lib/lowcode/painter/panel-section/I18nInput.js +27 -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/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 +7 -4
- 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/list-editor.less +36 -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 +35 -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 +2 -4
- 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 +9 -9
- 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 +2 -3
- package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +15 -24
- 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 +1 -2
- 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 +1 -2
- package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +94 -2
- package/lib/lowcode/view/lc-components/Form/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Form/index.js +289 -12
- package/lib/lowcode/view/lc-components/Form/index.less +5 -0
- package/lib/lowcode/view/lc-components/Form/meta.json +546 -64
- 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 +2 -2
- 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 +3 -3
- 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 +24 -22
- 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 +3 -3
- 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/FunctionDesign.js +31 -2
- package/lib/lowcode/view/lc-components/Section/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Section/index.js +114 -23
- package/lib/lowcode/view/lc-components/Section/index.less +7 -0
- package/lib/lowcode/view/lc-components/Section/meta.json +48 -49
- package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +58 -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 -47
- package/lib/lowcode/view/lc-components/Table/meta.json +229 -55
- package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +71 -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 +3 -3
- 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/upload/Form/gridForm.js +7 -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
|
@@ -8,9 +8,8 @@
|
|
|
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
|
},
|
|
@@ -18,123 +17,96 @@
|
|
|
18
17
|
"key": "items",
|
|
19
18
|
"name": "标签项",
|
|
20
19
|
"desc": "表示标签项或选项卡的集合",
|
|
21
|
-
"type": "
|
|
22
|
-
"default": [
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"key": "shape",
|
|
26
|
-
"name": "形态",
|
|
27
|
-
"desc": "表示选项卡的形态或外观样式",
|
|
28
|
-
"type": "radio",
|
|
29
|
-
"options": [
|
|
30
|
-
{
|
|
31
|
-
"label": "普通型",
|
|
32
|
-
"value": "pure"
|
|
33
|
-
},
|
|
20
|
+
"type": "_TabItems",
|
|
21
|
+
"default": [
|
|
34
22
|
{
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"label": "胶囊型",
|
|
44
|
-
"value": "capsule"
|
|
23
|
+
"id": "tab_lvwdncx1",
|
|
24
|
+
"name": "标签项",
|
|
25
|
+
"active": true,
|
|
26
|
+
"destory": false,
|
|
27
|
+
"serial": null,
|
|
28
|
+
"serialEffect": "hidden"
|
|
45
29
|
}
|
|
46
30
|
],
|
|
47
|
-
"
|
|
31
|
+
"wrapper": "collapse",
|
|
32
|
+
"wrapperProps": { "suppressIcon": true }
|
|
48
33
|
},
|
|
49
34
|
{
|
|
50
|
-
"key": "
|
|
51
|
-
"name": "
|
|
52
|
-
"
|
|
53
|
-
"type": "radio",
|
|
35
|
+
"key": "type",
|
|
36
|
+
"name": "基本样式",
|
|
37
|
+
"type": "segmented",
|
|
54
38
|
"options": [
|
|
55
39
|
{
|
|
56
|
-
"label": "
|
|
57
|
-
"value": "
|
|
40
|
+
"label": "线条式",
|
|
41
|
+
"value": "line"
|
|
58
42
|
},
|
|
59
43
|
{
|
|
60
|
-
"label": "
|
|
61
|
-
"value": "
|
|
44
|
+
"label": "卡片式",
|
|
45
|
+
"value": "card"
|
|
62
46
|
}
|
|
63
47
|
],
|
|
64
|
-
"default": "
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"key": "contentPadding",
|
|
68
|
-
"name": "内容间距",
|
|
69
|
-
"desc": "设定内容区的内间距,请输入合理的CSS padding值",
|
|
70
|
-
"type": "string",
|
|
71
|
-
"default": "20px 20px"
|
|
48
|
+
"default": "line"
|
|
72
49
|
},
|
|
73
50
|
{
|
|
74
|
-
"key": "
|
|
75
|
-
"name": "
|
|
76
|
-
"
|
|
77
|
-
"
|
|
51
|
+
"key": "tabPosition",
|
|
52
|
+
"name": "页签位置",
|
|
53
|
+
"type": "segmented",
|
|
54
|
+
"repositioning": true,
|
|
78
55
|
"options": [
|
|
79
56
|
{
|
|
80
|
-
"label": "
|
|
81
|
-
"value": "
|
|
57
|
+
"label": "上",
|
|
58
|
+
"value": "top"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"label": "右",
|
|
62
|
+
"value": "right"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"label": "下",
|
|
66
|
+
"value": "bottom"
|
|
82
67
|
},
|
|
83
68
|
{
|
|
84
|
-
"label": "
|
|
85
|
-
"value": "
|
|
69
|
+
"label": "左",
|
|
70
|
+
"value": "left"
|
|
86
71
|
}
|
|
87
72
|
],
|
|
88
|
-
"default": "
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"key": "unmountInactiveTabs",
|
|
92
|
-
"name": "切换销毁",
|
|
93
|
-
"desc": "表示选项卡切换时是否销毁非活动选项卡的内容",
|
|
94
|
-
"type": "boolean",
|
|
95
|
-
"default": false
|
|
73
|
+
"default": "top"
|
|
96
74
|
},
|
|
97
75
|
{
|
|
98
|
-
"key": "
|
|
99
|
-
"name": "
|
|
100
|
-
"
|
|
101
|
-
"type": "boolean",
|
|
102
|
-
"default": false
|
|
76
|
+
"key": "tabBarGutter",
|
|
77
|
+
"name": "Tab间隙",
|
|
78
|
+
"type": "number"
|
|
103
79
|
},
|
|
104
80
|
{
|
|
105
|
-
"key": "
|
|
106
|
-
"name": "
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
81
|
+
"key": "tabBarExtraContent",
|
|
82
|
+
"name": "tab bar 上额外的元素",
|
|
83
|
+
"type": "_JSEditor",
|
|
84
|
+
"defaultCode": "function Component() { \n return <div>extra</div>; \n}",
|
|
85
|
+
"mustConfirm": true,
|
|
86
|
+
"wrapper": "collapse",
|
|
87
|
+
"wrapperProps": { "suppressIcon": true }
|
|
110
88
|
}
|
|
111
89
|
],
|
|
112
|
-
"
|
|
90
|
+
"css": "width: 100%; height: 100%;",
|
|
113
91
|
"advance": {
|
|
114
92
|
"events": [
|
|
115
93
|
{
|
|
116
94
|
"key": "onMount",
|
|
117
95
|
"name": "组件首次渲染时",
|
|
118
96
|
"desc": "在组件首次渲染时,执行方法",
|
|
119
|
-
"func": "(
|
|
97
|
+
"func": "(instance)=>{\n\t\n}"
|
|
120
98
|
},
|
|
121
99
|
{
|
|
122
100
|
"key": "onUnmount",
|
|
123
101
|
"name": "组件卸载时",
|
|
124
102
|
"desc": "在组件卸载时,执行方法。",
|
|
125
|
-
"func": "(
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
"key": "renderBadge",
|
|
129
|
-
"name": "徽标渲染",
|
|
130
|
-
"desc": "当needBadge为true时可配置。徽标渲染方法",
|
|
131
|
-
"func": "(tabItem)=>{\n\t\n}"
|
|
103
|
+
"func": "(instance)=>{\n\t\n}"
|
|
132
104
|
},
|
|
133
105
|
{
|
|
134
|
-
"key": "
|
|
135
|
-
"name": "
|
|
136
|
-
"desc": "
|
|
137
|
-
"func": "(
|
|
106
|
+
"key": "onTabClick",
|
|
107
|
+
"name": "tab被点击的回调",
|
|
108
|
+
"desc": "当tab被点击时, 执行方法",
|
|
109
|
+
"func": "(tabKey, e)=>{\n\t\n}"
|
|
138
110
|
}
|
|
139
111
|
]
|
|
140
112
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
+
var _excluded = ["children"];
|
|
3
|
+
import Index from "./index";
|
|
4
|
+
var FunctionPreview = function FunctionPreview(_ref) {
|
|
5
|
+
var children = _ref.children,
|
|
6
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
7
|
+
return /*#__PURE__*/React.createElement(Index, props, children);
|
|
8
|
+
};
|
|
9
|
+
export default FunctionPreview;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"key": "content",
|
|
18
18
|
"name": "内容",
|
|
19
19
|
"desc": "文本内容设置",
|
|
20
|
-
"type": "
|
|
20
|
+
"type": "_I18nInput"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
"key": "showTitle",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"key": "title",
|
|
31
31
|
"name": "自定义标题",
|
|
32
32
|
"desc": "显示标题时配置。自定义标题内容",
|
|
33
|
-
"type": "
|
|
33
|
+
"type": "_I18nInput"
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
"key": "maxLine",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"default": 0
|
|
41
41
|
}
|
|
42
42
|
],
|
|
43
|
-
"
|
|
43
|
+
"css": {},
|
|
44
44
|
"advance": {
|
|
45
45
|
"events": [
|
|
46
46
|
{
|
|
@@ -1,9 +1,69 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
1
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
-
var _excluded = ["children"];
|
|
5
|
+
var _excluded = ["rowKey", "children", "defaultExpandDeep"];
|
|
6
|
+
import React, { useState, useEffect, useRef, useLayoutEffect } from 'react';
|
|
7
|
+
import { transform } from 'lodash';
|
|
8
|
+
import { useMemoizedFn } from 'ahooks';
|
|
3
9
|
import Index from "./index";
|
|
10
|
+
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
11
|
+
import styles from "./index.less";
|
|
4
12
|
var FunctionDesign = function FunctionDesign(_ref) {
|
|
5
|
-
var
|
|
13
|
+
var _ref$rowKey = _ref.rowKey,
|
|
14
|
+
rowKey = _ref$rowKey === void 0 ? window.appConfig.constraintKeys.PRIMARY : _ref$rowKey,
|
|
15
|
+
children = _ref.children,
|
|
16
|
+
defaultExpandDeep = _ref.defaultExpandDeep,
|
|
6
17
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
7
|
-
|
|
18
|
+
var ctx = useContext();
|
|
19
|
+
var treeRef = useRef(null);
|
|
20
|
+
var _useState = useState([]),
|
|
21
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
22
|
+
treeData = _useState2[0],
|
|
23
|
+
setTreeData = _useState2[1];
|
|
24
|
+
var _useState3 = useState([]),
|
|
25
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
26
|
+
expandedKeys = _useState4[0],
|
|
27
|
+
setExpandedKeys = _useState4[1];
|
|
28
|
+
var handleDataSetChange = useMemoizedFn(function (onLdQuery) {
|
|
29
|
+
onLdQuery(props.asyncLoad ? _defineProperty({}, props.parentKey || 'iparentid', 0) : {});
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// 默认展开层级
|
|
33
|
+
useEffect(function () {
|
|
34
|
+
if (defaultExpandDeep && treeData && treeData.length > 0) {
|
|
35
|
+
var defaultExpanded = transform(treeData, function (result, n) {
|
|
36
|
+
if (defaultExpandDeep === 'all' || n.sidcc.substring(1, n.sidcc.length - 1).split('/').length < Number(defaultExpandDeep) + 1) {
|
|
37
|
+
result.push("".concat(n[rowKey]));
|
|
38
|
+
}
|
|
39
|
+
}, []);
|
|
40
|
+
setExpandedKeys(defaultExpanded);
|
|
41
|
+
}
|
|
42
|
+
}, [defaultExpandDeep, treeData]);
|
|
43
|
+
useEffect(function () {
|
|
44
|
+
ctx.$publisher(ctx.topics.COMPONENT_REPOSITIONING, {
|
|
45
|
+
id: props.id
|
|
46
|
+
});
|
|
47
|
+
}, [expandedKeys]);
|
|
48
|
+
return /*#__PURE__*/React.createElement(Index, _extends({}, props, {
|
|
49
|
+
ref: treeRef,
|
|
50
|
+
afterQuery: function afterQuery(_ref3) {
|
|
51
|
+
var code = _ref3.code,
|
|
52
|
+
list = _ref3.list,
|
|
53
|
+
detail = _ref3.detail;
|
|
54
|
+
if (code === 1) setTreeData(list.map(function (i) {
|
|
55
|
+
return detail[i];
|
|
56
|
+
}));
|
|
57
|
+
},
|
|
58
|
+
expandedKeys: expandedKeys,
|
|
59
|
+
rowKey: rowKey,
|
|
60
|
+
defaultExpandDeep: defaultExpandDeep,
|
|
61
|
+
motion: null // 关闭动画
|
|
62
|
+
,
|
|
63
|
+
className: styles['runtime-tree'],
|
|
64
|
+
draggable: false,
|
|
65
|
+
suppressInit: true,
|
|
66
|
+
onDataSetChange: handleDataSetChange
|
|
67
|
+
}), children);
|
|
8
68
|
};
|
|
9
69
|
export default FunctionDesign;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["children"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { useMemoizedFn, useCreation } from 'ahooks';
|
|
6
|
+
import Index from "./index";
|
|
7
|
+
var FunctionPreview = function FunctionPreview(_ref) {
|
|
8
|
+
var children = _ref.children,
|
|
9
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
10
|
+
var onLoadData = useMemoizedFn(function (treeNode) {
|
|
11
|
+
return new Promise(function (resolve) {
|
|
12
|
+
if (treeNode.props.children) {
|
|
13
|
+
setTimeout(function () {
|
|
14
|
+
resolve();
|
|
15
|
+
}, 200);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
var asyncLoadSim = useCreation(function () {
|
|
20
|
+
return props.asyncLoad ? {
|
|
21
|
+
loadData: onLoadData
|
|
22
|
+
} : {};
|
|
23
|
+
}, props.asyncLoad);
|
|
24
|
+
return /*#__PURE__*/React.createElement(Index, _extends({}, props, asyncLoadSim), children);
|
|
25
|
+
};
|
|
26
|
+
export default FunctionPreview;
|
|
@@ -1,20 +1,335 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
1
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
-
var _excluded = ["id"];
|
|
3
|
-
import React, { useRef } from 'react';
|
|
4
|
-
import
|
|
4
|
+
var _excluded = ["id", "wrapperRef", "className", "dataset", "width", "height", "showLine", "defaultExpandDeep", "actions", "editable", "showRootAdd", "rootAddSetting", "doubleClickExpand", "onDoubleClick", "treeNodeCheckable", "treeNodeDisableCheckbox", "treeNodeDisable", "onTreeNodeRender", "treeNodeIcon", "advance"];
|
|
5
|
+
import React, { useRef, useImperativeHandle, forwardRef } from 'react';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import { useMemoizedFn, useCreation } from 'ahooks';
|
|
8
|
+
import classNames from 'classnames';
|
|
9
|
+
import { isNil } from 'lodash';
|
|
10
|
+
import { IconFont } from '@luck-design-biz/base';
|
|
11
|
+
import { suid } from '@luck-design-biz/base/utils';
|
|
12
|
+
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
5
13
|
import Wrapper from "../Wrapper";
|
|
14
|
+
import { LdTree } from "../../../../index";
|
|
15
|
+
import { omitBadProps, executeCode } from "../../../engine/tools/helper";
|
|
16
|
+
import defaultMeta from "../../../engine/meta/tree.props.default.json";
|
|
17
|
+
import styles from "./index.less";
|
|
6
18
|
var LCTree = function LCTree(_ref) {
|
|
7
19
|
var id = _ref.id,
|
|
20
|
+
wrapperRef = _ref.wrapperRef,
|
|
21
|
+
className = _ref.className,
|
|
22
|
+
dataset = _ref.dataset,
|
|
23
|
+
width = _ref.width,
|
|
24
|
+
height = _ref.height,
|
|
25
|
+
showLine = _ref.showLine,
|
|
26
|
+
defaultExpandDeep = _ref.defaultExpandDeep,
|
|
27
|
+
actions = _ref.actions,
|
|
28
|
+
editable = _ref.editable,
|
|
29
|
+
showRootAdd = _ref.showRootAdd,
|
|
30
|
+
rootAddSetting = _ref.rootAddSetting,
|
|
31
|
+
doubleClickExpand = _ref.doubleClickExpand,
|
|
32
|
+
onDoubleClick = _ref.onDoubleClick,
|
|
33
|
+
_treeNodeCheckable = _ref.treeNodeCheckable,
|
|
34
|
+
_treeNodeDisableCheckbox = _ref.treeNodeDisableCheckbox,
|
|
35
|
+
_treeNodeDisable = _ref.treeNodeDisable,
|
|
36
|
+
onTreeNodeRender = _ref.onTreeNodeRender,
|
|
37
|
+
_treeNodeIcon = _ref.treeNodeIcon,
|
|
38
|
+
advance = _ref.advance,
|
|
8
39
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
9
|
-
var
|
|
40
|
+
var ctx = useContext();
|
|
41
|
+
var boxRef = useRef();
|
|
42
|
+
var treeRef = useRef();
|
|
10
43
|
var getTargetDom = useMemoizedFn(function () {
|
|
11
|
-
return
|
|
44
|
+
return boxRef.current;
|
|
45
|
+
});
|
|
46
|
+
useImperativeHandle(wrapperRef, function () {
|
|
47
|
+
return treeRef.current;
|
|
48
|
+
});
|
|
49
|
+
var handleMount = useMemoizedFn(function (params) {
|
|
50
|
+
ctx.doAction(advance.events.onMount, {
|
|
51
|
+
params: params
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
var handleUnmount = useMemoizedFn(function () {
|
|
55
|
+
ctx.doAction(advance.events.onUnmount);
|
|
56
|
+
});
|
|
57
|
+
var handleProcessDataSource = useMemoizedFn(function (data) {
|
|
58
|
+
ctx.doAction(advance.events.processDataSource, {
|
|
59
|
+
data: data
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
var handleNodeDoubleClick = useMemoizedFn(function (e, rowData) {
|
|
63
|
+
ctx.doAction(advance.events.onDoubleClick, {
|
|
64
|
+
e: e,
|
|
65
|
+
rowData: rowData
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
var handleCheck = useMemoizedFn(function (checkedKeys, e) {
|
|
69
|
+
ctx.doAction(advance.events.onCheck, {
|
|
70
|
+
checkedKeys: checkedKeys,
|
|
71
|
+
e: e
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
var events = useCreation(function () {
|
|
75
|
+
if (advance !== null && advance !== void 0 && advance.events) {
|
|
76
|
+
var _events = {};
|
|
77
|
+
if (advance.events.onMount) _events.onMount = handleMount;
|
|
78
|
+
if (advance.events.onUnmount) _events.onUnmount = handleUnmount;
|
|
79
|
+
if (advance.events.processDataSource) _events.dataToTreeFormat = handleProcessDataSource;
|
|
80
|
+
if (advance.events.onDoubleClick) _events.onNodeDoubleClick = handleNodeDoubleClick;
|
|
81
|
+
if (advance.events.onCheck) _events.onCheck = handleCheck;
|
|
82
|
+
return _events;
|
|
83
|
+
}
|
|
84
|
+
return {};
|
|
85
|
+
}, [advance === null || advance === void 0 ? void 0 : advance.events]);
|
|
86
|
+
var handleDrop = useMemoizedFn(function (info, dragInfo) {
|
|
87
|
+
if (dragInfo !== false) {
|
|
88
|
+
// ctx.doAction(advance.events.onDoubleClick, { e, rowData });
|
|
89
|
+
// doAction('drag', {
|
|
90
|
+
// get: { datasetCode: dataSetKey },
|
|
91
|
+
// post: {
|
|
92
|
+
// fromId: info.dragNode.props.dataRef[PRIMARY],
|
|
93
|
+
// toId: info.node.props.dataRef[PRIMARY],
|
|
94
|
+
// }
|
|
95
|
+
// }, {
|
|
96
|
+
// showConfirm: false,
|
|
97
|
+
// callback: (success) => success && onLdQuery()
|
|
98
|
+
// });
|
|
99
|
+
}
|
|
12
100
|
});
|
|
13
101
|
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
14
102
|
id: id,
|
|
103
|
+
displayName: "Tree",
|
|
15
104
|
getTargetDom: getTargetDom
|
|
16
105
|
}, /*#__PURE__*/React.createElement("div", {
|
|
17
|
-
ref:
|
|
18
|
-
|
|
106
|
+
ref: boxRef,
|
|
107
|
+
style: {
|
|
108
|
+
width: width,
|
|
109
|
+
height: height
|
|
110
|
+
}
|
|
111
|
+
}, /*#__PURE__*/React.createElement(LdTree, _extends({
|
|
112
|
+
width: "100%",
|
|
113
|
+
height: "100%",
|
|
114
|
+
id: id,
|
|
115
|
+
ldId: id,
|
|
116
|
+
ref: treeRef,
|
|
117
|
+
className: classNames(styles['lc-component-tree'], _defineProperty({}, className, !!className)),
|
|
118
|
+
dataSetKey: dataset === null || dataset === void 0 ? void 0 : dataset.code,
|
|
119
|
+
showLine: showLine,
|
|
120
|
+
readOnly: !editable,
|
|
121
|
+
defaultExpandDeep: defaultExpandDeep === 'all' ? defaultExpandDeep : Number(defaultExpandDeep),
|
|
122
|
+
rootAdd: showRootAdd ? {
|
|
123
|
+
resource: rootAddSetting.serial,
|
|
124
|
+
onClick: function onClick() {
|
|
125
|
+
return ctx.doAction(rootAddSetting.actionPool);
|
|
126
|
+
}
|
|
127
|
+
} : null,
|
|
128
|
+
rightMenus: function rightMenus() {
|
|
129
|
+
return actions.todoList.map(function (action) {
|
|
130
|
+
return {
|
|
131
|
+
key: suid(),
|
|
132
|
+
name: action.name,
|
|
133
|
+
onClick: function onClick(_, data) {
|
|
134
|
+
ctx.doAction(action.actionPool, {
|
|
135
|
+
data: data
|
|
136
|
+
});
|
|
137
|
+
},
|
|
138
|
+
resource: action.serial,
|
|
139
|
+
style: action.riskLevel === 'default' ? null : {
|
|
140
|
+
color: {
|
|
141
|
+
danger: '#ff7875',
|
|
142
|
+
destroy: '#ff4d4f'
|
|
143
|
+
}[action.riskLevel]
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
},
|
|
148
|
+
doubleClickExpand: doubleClickExpand,
|
|
149
|
+
treeNodeCheckable: function treeNodeCheckable(i) {
|
|
150
|
+
if (isNil(_treeNodeCheckable)) return props.checkable;
|
|
151
|
+
return executeCode(ctx, _treeNodeCheckable, ['item'], i);
|
|
152
|
+
},
|
|
153
|
+
treeNodeDisableCheckbox: function treeNodeDisableCheckbox(i) {
|
|
154
|
+
if (isNil(_treeNodeDisableCheckbox)) return false;
|
|
155
|
+
return executeCode(ctx, _treeNodeDisableCheckbox, ['item'], i);
|
|
156
|
+
},
|
|
157
|
+
treeNodeDisable: function treeNodeDisable(i) {
|
|
158
|
+
if (isNil(_treeNodeDisable)) return false;
|
|
159
|
+
return executeCode(ctx, _treeNodeDisable, ['item'], i);
|
|
160
|
+
},
|
|
161
|
+
treeNodeIcon: function treeNodeIcon(node) {
|
|
162
|
+
if (!_treeNodeIcon || _treeNodeIcon.length === 0) return null;
|
|
163
|
+
var icon = null;
|
|
164
|
+
_treeNodeIcon.forEach(function (i) {
|
|
165
|
+
if (i.condition && executeCode(ctx, i.condition, ['item'], node)) {
|
|
166
|
+
icon = i.icon;
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
return icon ? /*#__PURE__*/React.createElement(IconFont, {
|
|
170
|
+
type: icon
|
|
171
|
+
}) : false;
|
|
172
|
+
},
|
|
173
|
+
onTreeNodeRender: onTreeNodeRender ? function (title, i) {
|
|
174
|
+
return executeCode(ctx, onTreeNodeRender, ['title', 'item'], title, i);
|
|
175
|
+
} : null,
|
|
176
|
+
onDrop: handleDrop
|
|
177
|
+
}, events, props))));
|
|
178
|
+
};
|
|
179
|
+
LCTree.propTypes = {
|
|
180
|
+
/**
|
|
181
|
+
* @name 唯一标识
|
|
182
|
+
* @type string
|
|
183
|
+
* @disabled true
|
|
184
|
+
*/
|
|
185
|
+
id: PropTypes.string.isRequired,
|
|
186
|
+
/**
|
|
187
|
+
* @name 数据集
|
|
188
|
+
* @type _DataSetSelector
|
|
189
|
+
*/
|
|
190
|
+
dataset: PropTypes.shape({
|
|
191
|
+
code: PropTypes.string.isRequired,
|
|
192
|
+
uid: PropTypes.string.isRequired
|
|
193
|
+
}),
|
|
194
|
+
/**
|
|
195
|
+
* @name 标题
|
|
196
|
+
* @type string
|
|
197
|
+
* @disabled true
|
|
198
|
+
*/
|
|
199
|
+
title: PropTypes.string,
|
|
200
|
+
/**
|
|
201
|
+
* @name 是否只读
|
|
202
|
+
* @type boolean
|
|
203
|
+
*/
|
|
204
|
+
readOnly: PropTypes.bool,
|
|
205
|
+
/**
|
|
206
|
+
* @name 支持拖拽
|
|
207
|
+
* @type boolean
|
|
208
|
+
*/
|
|
209
|
+
draggable: PropTypes.bool,
|
|
210
|
+
/**
|
|
211
|
+
* @name 异步加载
|
|
212
|
+
* @type boolean
|
|
213
|
+
*/
|
|
214
|
+
asyncLoad: PropTypes.bool,
|
|
215
|
+
/**
|
|
216
|
+
* @name 异步加载Key
|
|
217
|
+
* @type string
|
|
218
|
+
*/
|
|
219
|
+
iparentid: PropTypes.string,
|
|
220
|
+
/**
|
|
221
|
+
* @name 宽度
|
|
222
|
+
* @type string
|
|
223
|
+
*/
|
|
224
|
+
width: PropTypes.string,
|
|
225
|
+
/**
|
|
226
|
+
* @name 高度
|
|
227
|
+
* @type string
|
|
228
|
+
*/
|
|
229
|
+
height: PropTypes.string,
|
|
230
|
+
/**
|
|
231
|
+
* @name 显示线
|
|
232
|
+
* @type bool
|
|
233
|
+
*/
|
|
234
|
+
showLine: PropTypes.bool,
|
|
235
|
+
/**
|
|
236
|
+
* @name 展示字段
|
|
237
|
+
* @type string
|
|
238
|
+
*/
|
|
239
|
+
treeNodeTitle: PropTypes.string,
|
|
240
|
+
/**
|
|
241
|
+
* @name 展示字段
|
|
242
|
+
* @type string
|
|
243
|
+
*/
|
|
244
|
+
defaultExpandDeep: PropTypes.string,
|
|
245
|
+
/**
|
|
246
|
+
* @name 显示图标
|
|
247
|
+
* @type bool
|
|
248
|
+
*/
|
|
249
|
+
showIcon: PropTypes.bool,
|
|
250
|
+
/**
|
|
251
|
+
* @name 节点图标设置
|
|
252
|
+
* @type array
|
|
253
|
+
*/
|
|
254
|
+
treeNodeIcon: PropTypes.array,
|
|
255
|
+
/**
|
|
256
|
+
* @name 是否显示根节点
|
|
257
|
+
* @type bool
|
|
258
|
+
*/
|
|
259
|
+
showRootAdd: PropTypes.bool,
|
|
260
|
+
/**
|
|
261
|
+
* @name 根节点配置
|
|
262
|
+
* @type object
|
|
263
|
+
*/
|
|
264
|
+
rootAddSetting: PropTypes.object,
|
|
265
|
+
/**
|
|
266
|
+
* @name 节点操作项
|
|
267
|
+
* @type object
|
|
268
|
+
*/
|
|
269
|
+
actions: PropTypes.object,
|
|
270
|
+
/**
|
|
271
|
+
* @name 双击收缩节点
|
|
272
|
+
* @type bool
|
|
273
|
+
*/
|
|
274
|
+
doubleClickExpand: PropTypes.bool,
|
|
275
|
+
/**
|
|
276
|
+
* @name 复选框
|
|
277
|
+
* @type bool
|
|
278
|
+
*/
|
|
279
|
+
checkable: PropTypes.bool,
|
|
280
|
+
/**
|
|
281
|
+
* @name 节点是否有复选框
|
|
282
|
+
* @type _JSEditor
|
|
283
|
+
* @default "function treeNodeCheckable(item) { \n return true; \n}"
|
|
284
|
+
*/
|
|
285
|
+
treeNodeCheckable: PropTypes.string,
|
|
286
|
+
/**
|
|
287
|
+
* @name 节点复选框是否禁用
|
|
288
|
+
* @type _JSEditor
|
|
289
|
+
* @default "function treeNodeDisableCheckbox(item) { \n return false; \n}"
|
|
290
|
+
*/
|
|
291
|
+
treeNodeDisableCheckbox: PropTypes.string,
|
|
292
|
+
/**
|
|
293
|
+
* @name 节点是否禁用
|
|
294
|
+
* @type _JSEditor
|
|
295
|
+
* @default "function treeNodeDisable(item) { \n return false; \n}"
|
|
296
|
+
*/
|
|
297
|
+
treeNodeDisable: PropTypes.string,
|
|
298
|
+
/**
|
|
299
|
+
* @name 节点定制渲染
|
|
300
|
+
* @type _JSEditor
|
|
301
|
+
* @default "function onTreeNodeRender(title, item) { \n return title; \n}"
|
|
302
|
+
*/
|
|
303
|
+
onTreeNodeRender: PropTypes.string,
|
|
304
|
+
/**
|
|
305
|
+
* @name 组件首次渲染时
|
|
306
|
+
* @type _JSEditor
|
|
307
|
+
*/
|
|
308
|
+
onMount: PropTypes.string,
|
|
309
|
+
/**
|
|
310
|
+
* @name 组件卸载时
|
|
311
|
+
* @type _JSEditor
|
|
312
|
+
*/
|
|
313
|
+
onUnmount: PropTypes.string,
|
|
314
|
+
/**
|
|
315
|
+
* @name 数据预处理
|
|
316
|
+
* @type _JSEditor
|
|
317
|
+
*/
|
|
318
|
+
processDataSource: PropTypes.string,
|
|
319
|
+
/**
|
|
320
|
+
* @name 双击事件
|
|
321
|
+
* @type _JSEditor
|
|
322
|
+
*/
|
|
323
|
+
onDoubleClick: PropTypes.string,
|
|
324
|
+
/**
|
|
325
|
+
* @name 复选框选择事件
|
|
326
|
+
* @type _JSEditor
|
|
327
|
+
*/
|
|
328
|
+
onCheck: PropTypes.string
|
|
19
329
|
};
|
|
20
|
-
|
|
330
|
+
LCTree.defaultProps = omitBadProps(defaultMeta);
|
|
331
|
+
export default /*#__PURE__*/forwardRef(function (props, ref) {
|
|
332
|
+
return /*#__PURE__*/React.createElement(LCTree, _extends({
|
|
333
|
+
wrapperRef: ref
|
|
334
|
+
}, props));
|
|
335
|
+
});
|