@luck-design-biz/luckda 0.0.25-1 → 0.0.25-10
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/ComplexItem/index.js +92 -0
- package/es/{lowcode/painter/services/toolbar.js → components/ComplexItem/service.js} +7 -11
- package/es/components/LDActions/index.js +8 -10
- package/es/components/LDActions/index.less +7 -4
- package/es/components/LdAutoForm/index.js +34 -11
- package/es/components/LdFormList/index.js +39 -23
- package/es/components/LdGrid/index.js +21 -7
- package/es/components/LdGridForm/index.js +32 -11
- package/es/components/LdTree/index.js +33 -15
- package/es/helper/FromItems.js +177 -94
- package/es/helper/form.js +55 -14
- package/es/helper/props_config.js +17 -0
- package/es/locales/zh-CN.js +26 -11
- package/es/lowcode/constants/api-url.js +354 -104
- package/es/lowcode/constants/event-topics.js +2 -0
- package/es/lowcode/constants/index.js +4 -2
- package/es/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +5 -2
- package/es/lowcode/engine/factory/panel-item-factory/StringStrategy.js +1 -1
- package/es/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +5 -2
- package/es/lowcode/engine/meta/box.props.default.json +1 -1
- package/es/lowcode/engine/meta/box.props.json +4 -4
- package/es/lowcode/engine/meta/button.props.json +4 -4
- package/es/lowcode/engine/meta/cardlist.props.json +14 -4
- package/es/lowcode/engine/meta/components-list.json +109 -1
- package/es/lowcode/engine/meta/dialog.props.default.json +11 -5
- package/es/lowcode/engine/meta/dialog.props.json +80 -43
- package/es/lowcode/engine/meta/drawer.props.json +9 -21
- package/es/lowcode/engine/meta/fieldcolor.props.default.json +14 -0
- package/es/lowcode/engine/meta/fieldcolor.props.json +63 -0
- package/es/lowcode/engine/meta/fieldcomplex.props.default.json +13 -0
- package/es/lowcode/engine/meta/fieldcomplex.props.json +39 -0
- package/es/lowcode/engine/meta/fielddate.props.default.json +12 -0
- package/es/lowcode/engine/meta/fielddate.props.json +47 -0
- package/es/lowcode/engine/meta/fielddict.props.default.json +14 -0
- package/es/lowcode/engine/meta/fielddict.props.json +44 -0
- package/es/lowcode/engine/meta/fieldeditor.props.default.json +13 -0
- package/es/lowcode/engine/meta/fieldeditor.props.json +44 -0
- package/es/lowcode/engine/meta/fieldgroup.props.default.json +15 -0
- package/es/lowcode/engine/meta/fieldgroup.props.json +73 -0
- package/es/lowcode/engine/meta/fieldnumber.props.default.json +14 -0
- package/es/lowcode/engine/meta/fieldnumber.props.json +48 -0
- package/es/lowcode/engine/meta/fieldradio.props.default.json +12 -0
- package/es/lowcode/engine/meta/fieldradio.props.json +20 -0
- package/es/lowcode/engine/meta/fieldregion.props.default.json +12 -0
- package/es/lowcode/engine/meta/fieldregion.props.json +26 -0
- package/es/lowcode/engine/meta/fieldselect.props.default.json +14 -0
- package/es/lowcode/engine/meta/fieldselect.props.json +58 -0
- package/es/lowcode/engine/meta/fieldstring.props.default.json +16 -0
- package/es/lowcode/engine/meta/fieldstring.props.json +62 -0
- package/es/lowcode/engine/meta/fieldswitch.props.default.json +12 -0
- package/es/lowcode/engine/meta/fieldswitch.props.json +31 -0
- package/es/lowcode/engine/meta/fieldtextarea.props.default.json +13 -0
- package/es/lowcode/engine/meta/fieldtextarea.props.json +49 -0
- package/es/lowcode/engine/meta/fieldupload.props.default.json +15 -0
- package/es/lowcode/engine/meta/fieldupload.props.json +71 -0
- package/es/lowcode/engine/meta/fielduser.props.default.json +16 -0
- package/es/lowcode/engine/meta/fielduser.props.json +82 -0
- package/es/lowcode/engine/meta/fieldyear.props.default.json +12 -0
- package/es/lowcode/engine/meta/fieldyear.props.json +20 -0
- package/es/lowcode/engine/meta/form.props.default.json +4 -5
- package/es/lowcode/engine/meta/form.props.json +44 -35
- package/es/lowcode/engine/meta/image.props.json +2 -2
- package/es/lowcode/engine/meta/imex.props.default.json +8 -1
- package/es/lowcode/engine/meta/imex.props.json +54 -22
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +53 -3
- package/es/lowcode/engine/meta/layout.props.json +2 -2
- package/es/lowcode/engine/meta/link.props.json +1 -1
- package/es/lowcode/engine/meta/page.props.json +2 -2
- package/es/lowcode/engine/meta/pagelayout.props.default.json +14 -0
- package/es/lowcode/engine/meta/pagelayout.props.json +47 -0
- package/es/lowcode/engine/meta/section.props.default.json +4 -6
- package/es/lowcode/engine/meta/section.props.json +52 -49
- package/es/lowcode/engine/meta/split.props.default.json +1 -1
- package/es/lowcode/engine/meta/split.props.json +4 -4
- package/es/lowcode/engine/meta/table.props.json +19 -13
- package/es/lowcode/engine/meta/tabs.props.json +3 -3
- package/es/lowcode/engine/meta/text.props.json +2 -2
- package/es/lowcode/engine/meta/tree.props.default.json +2 -0
- package/es/lowcode/engine/meta/tree.props.json +71 -8
- package/es/lowcode/engine/provider/ContextProvider/index.js +21 -35
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +89 -37
- package/es/lowcode/engine/tools/dataProcess.js +4 -0
- package/es/lowcode/engine/tools/diff.js +60 -0
- package/es/lowcode/engine/tools/helper.js +49 -26
- package/es/lowcode/engine/tools/useCanvasRender.js +8 -9
- package/es/lowcode/engine/tools/usePageDataStore.js +331 -0
- package/es/lowcode/engine/tools/usePromiseState.js +8 -10
- package/es/lowcode/engine/tools/useTodo.js +20 -10
- package/es/lowcode/painter/Design.js +41 -6
- package/es/lowcode/painter/DesignOperator.js +112 -88
- package/es/lowcode/painter/DesignToolbar.js +280 -36
- package/es/lowcode/painter/Outline.js +12 -10
- package/es/lowcode/painter/Panel.js +84 -46
- package/es/lowcode/painter/components/ActionBindModal.js +38 -27
- package/es/lowcode/painter/components/AdvancePanel.js +37 -21
- package/es/lowcode/painter/components/AttrsPanel.js +45 -34
- package/es/lowcode/painter/components/DragDrop/DragDropContext.js +1 -1
- package/es/lowcode/painter/components/DragDrop/DragDropWrapper.js +5 -2
- package/es/lowcode/painter/components/FieldSelector.js +26 -13
- package/es/lowcode/painter/components/ListEditor.js +8 -2
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +3 -2
- package/es/lowcode/painter/components/code-editor/JSEditor.js +5 -9
- package/es/lowcode/painter/components/field-setting/BatchSetting.js +13 -3
- package/es/lowcode/painter/components/field-setting/CheckFrontRules.js +108 -0
- package/es/lowcode/painter/components/field-setting/CheckRules.js +1 -26
- package/es/lowcode/painter/components/field-setting/FieldRulesModal.js +33 -13
- package/es/lowcode/painter/components/field-setting/SettingUI.js +182 -31
- package/es/lowcode/painter/components/field-setting/index.js +40 -61
- package/es/lowcode/painter/components/field-setting/meta/frontRules.js +53 -0
- package/es/lowcode/painter/index.js +1 -28
- package/es/lowcode/painter/panel-section/ActionsColumnWidth.js +25 -0
- package/es/lowcode/painter/panel-section/BlockEditor/index.js +7 -4
- package/es/lowcode/painter/panel-section/BlocksEditor/BlockEditorItem.js +4 -3
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +55 -28
- package/es/lowcode/painter/panel-section/ButtonType.js +4 -2
- package/es/lowcode/painter/panel-section/DataSetSelector.js +30 -7
- package/es/lowcode/painter/panel-section/FieldsSetting.js +124 -55
- package/es/lowcode/painter/panel-section/I18nInput.js +20 -0
- package/es/lowcode/painter/panel-section/ImpExp.js +99 -14
- package/es/lowcode/painter/panel-section/ImpExpAlone.js +108 -0
- package/es/lowcode/painter/panel-section/PageLayoutDisplay.js +95 -0
- package/es/lowcode/painter/panel-section/SerialsSelector.js +4 -2
- package/es/lowcode/painter/panel-section/SplitDisplay.js +25 -110
- package/es/lowcode/painter/panel-section/StylePanel/StyleContext.js +1 -1
- package/es/lowcode/painter/panel-section/StylePanel/index.js +10 -4
- package/es/lowcode/painter/panel-section/TableTopFilter.js +23 -13
- package/es/lowcode/painter/panel-section/TreeRootEditor.js +2 -2
- package/es/lowcode/painter/style/action-bind-modal.less +3 -3
- package/es/lowcode/painter/style/design.less +7 -3
- package/es/lowcode/painter/style/list-editor.less +36 -0
- package/es/lowcode/painter/style/page-layout-display.less +28 -0
- package/es/lowcode/painter/style/panel-item.less +1 -1
- package/es/lowcode/painter/style/split-display.less +0 -9
- package/es/lowcode/preview/index.js +20 -5
- package/es/lowcode/view/Canvas.js +6 -7
- package/es/lowcode/view/Page.js +5 -6
- package/es/lowcode/view/lc-components/Box/FunctionDesign.js +3 -2
- package/es/lowcode/view/lc-components/Box/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Box/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Box/meta.json +4 -4
- package/es/lowcode/view/lc-components/Button/index.js +2 -6
- package/es/lowcode/view/lc-components/Button/meta.json +4 -4
- package/es/lowcode/view/lc-components/CardList/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/CardList/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/CardList/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/CardList/meta.json +14 -4
- package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +3 -12
- package/es/lowcode/view/lc-components/Dialog/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Dialog/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Dialog/index.js +116 -19
- package/es/lowcode/view/lc-components/Dialog/meta.json +73 -43
- package/es/lowcode/view/lc-components/Drawer/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/Drawer/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Drawer/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Drawer/meta.json +9 -21
- package/es/lowcode/view/lc-components/FieldColor/meta.json +63 -0
- package/es/lowcode/view/lc-components/FieldComplex/meta.json +39 -0
- package/es/lowcode/view/lc-components/FieldDate/meta.json +45 -0
- package/es/lowcode/view/lc-components/FieldDict/meta.json +44 -0
- package/es/lowcode/view/lc-components/FieldEditor/meta.json +44 -0
- package/es/lowcode/view/lc-components/FieldGroup/meta.json +73 -0
- package/es/lowcode/view/lc-components/FieldNumber/meta.json +48 -0
- package/es/lowcode/view/lc-components/FieldRadio/meta.json +20 -0
- package/es/lowcode/view/lc-components/FieldRegion/meta.json +26 -0
- package/es/lowcode/view/lc-components/FieldSelect/meta.json +58 -0
- package/es/lowcode/view/lc-components/FieldString/meta.json +62 -0
- package/es/lowcode/view/lc-components/FieldSwitch/meta.json +31 -0
- package/es/lowcode/view/lc-components/FieldTextarea/meta.json +49 -0
- package/es/lowcode/view/lc-components/FieldUpload/meta.json +71 -0
- package/es/lowcode/view/lc-components/FieldUser/meta.json +82 -0
- package/es/lowcode/view/lc-components/FieldYear/meta.json +20 -0
- package/es/lowcode/view/lc-components/Form/FunctionDesign.js +61 -9
- package/es/lowcode/view/lc-components/Form/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Form/FunctionPreview.js +9 -1
- package/es/lowcode/view/lc-components/Form/index.js +401 -66
- package/es/lowcode/view/lc-components/Form/meta.json +44 -35
- package/es/lowcode/view/lc-components/Iframe/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/Iframe/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Iframe/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/ImEx/FunctionDesign.js +9 -3
- package/es/lowcode/view/lc-components/ImEx/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/ImEx/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/ImEx/index.js +470 -11
- package/es/lowcode/view/lc-components/ImEx/index.less +7 -0
- package/es/lowcode/view/lc-components/ImEx/meta.json +55 -23
- package/es/lowcode/view/lc-components/Image/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/Image/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Image/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Image/meta.json +2 -2
- package/es/lowcode/view/lc-components/JSX/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/JSX/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/JSX/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Layout/FunctionDesign.js +13 -21
- package/es/lowcode/view/lc-components/Layout/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Layout/meta.json +2 -2
- package/es/lowcode/view/lc-components/Link/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/Link/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Link/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Link/meta.json +1 -1
- package/es/lowcode/view/lc-components/Page/meta.json +2 -2
- package/es/lowcode/view/lc-components/PageContent/index.js +8 -9
- package/es/lowcode/view/lc-components/PageFooter/index.js +2 -5
- package/es/lowcode/view/lc-components/PageHeader/index.js +5 -6
- package/es/lowcode/view/lc-components/PageLayout/FunctionDesign.js +63 -0
- package/es/lowcode/view/lc-components/PageLayout/FunctionLive.js +10 -0
- package/es/lowcode/view/lc-components/PageLayout/FunctionPreview.js +10 -0
- package/es/lowcode/view/lc-components/PageLayout/index.js +32 -0
- package/es/lowcode/view/lc-components/PageLayout/meta.json +47 -0
- package/es/lowcode/view/lc-components/PageModal/index.js +12 -15
- package/es/lowcode/view/lc-components/Section/FunctionDesign.js +25 -2
- package/es/lowcode/view/lc-components/Section/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Section/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Section/index.js +114 -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 +19 -22
- package/es/lowcode/view/lc-components/Split/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Split/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Split/index.js +7 -11
- package/es/lowcode/view/lc-components/Split/meta.json +4 -4
- package/es/lowcode/view/lc-components/Table/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Table/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Table/components/TopFilter.js +78 -57
- package/es/lowcode/view/lc-components/Table/components/TopImex.js +420 -0
- package/es/lowcode/view/lc-components/Table/index.js +294 -47
- package/es/lowcode/view/lc-components/Table/meta.json +19 -13
- package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +11 -20
- package/es/lowcode/view/lc-components/Tabs/index.js +3 -1
- package/es/lowcode/view/lc-components/Tabs/meta.json +3 -3
- package/es/lowcode/view/lc-components/Text/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/Text/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Text/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Text/meta.json +2 -2
- package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +2 -3
- package/es/lowcode/view/lc-components/Tree/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Tree/index.js +103 -29
- package/es/lowcode/view/lc-components/Tree/meta.json +71 -9
- package/es/lowcode/view/lc-components/Wrapper.js +10 -12
- package/es/services.js +0 -24
- package/es/upload/FilesWall/file.png +0 -0
- package/es/upload/FilesWall/index.js +422 -0
- package/es/upload/FilesWall/index.less +74 -0
- package/es/upload/Form/gridForm.js +10 -5
- package/es/upload/Form/index.js +2 -1
- package/es/upload/FormItem/index.js +5 -6
- package/es/upload/index.js +2 -1
- package/es/utils/action.js +2 -2
- package/es/utils/form.js +16 -3
- package/es/utils/grid.js +8 -5
- package/lib/components/ComplexItem/index.js +100 -0
- package/lib/{lowcode/painter/services/toolbar.js → components/ComplexItem/service.js} +8 -12
- package/lib/components/LDActions/index.js +7 -9
- package/lib/components/LDActions/index.less +7 -4
- package/lib/components/LdAutoForm/index.js +33 -10
- package/lib/components/LdFormList/index.js +38 -22
- package/lib/components/LdGrid/index.js +21 -7
- package/lib/components/LdGridForm/index.js +30 -9
- package/lib/components/LdTree/index.js +33 -15
- package/lib/helper/FromItems.js +175 -92
- package/lib/helper/form.js +53 -13
- package/lib/helper/props_config.js +23 -0
- package/lib/locales/zh-CN.js +26 -11
- package/lib/lowcode/constants/api-url.js +355 -104
- package/lib/lowcode/constants/event-topics.js +3 -1
- package/lib/lowcode/constants/index.js +5 -3
- package/lib/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +7 -4
- package/lib/lowcode/engine/factory/panel-item-factory/StringStrategy.js +3 -2
- package/lib/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +6 -3
- package/lib/lowcode/engine/meta/box.props.default.json +1 -1
- package/lib/lowcode/engine/meta/box.props.json +4 -4
- package/lib/lowcode/engine/meta/button.props.json +4 -4
- package/lib/lowcode/engine/meta/cardlist.props.json +14 -4
- package/lib/lowcode/engine/meta/components-list.json +109 -1
- package/lib/lowcode/engine/meta/dialog.props.default.json +11 -5
- package/lib/lowcode/engine/meta/dialog.props.json +80 -43
- package/lib/lowcode/engine/meta/drawer.props.json +9 -21
- package/lib/lowcode/engine/meta/fieldcolor.props.default.json +14 -0
- package/lib/lowcode/engine/meta/fieldcolor.props.json +63 -0
- package/lib/lowcode/engine/meta/fieldcomplex.props.default.json +13 -0
- package/lib/lowcode/engine/meta/fieldcomplex.props.json +39 -0
- package/lib/lowcode/engine/meta/fielddate.props.default.json +12 -0
- package/lib/lowcode/engine/meta/fielddate.props.json +47 -0
- package/lib/lowcode/engine/meta/fielddict.props.default.json +14 -0
- package/lib/lowcode/engine/meta/fielddict.props.json +44 -0
- package/lib/lowcode/engine/meta/fieldeditor.props.default.json +13 -0
- package/lib/lowcode/engine/meta/fieldeditor.props.json +44 -0
- package/lib/lowcode/engine/meta/fieldgroup.props.default.json +15 -0
- package/lib/lowcode/engine/meta/fieldgroup.props.json +73 -0
- package/lib/lowcode/engine/meta/fieldnumber.props.default.json +14 -0
- package/lib/lowcode/engine/meta/fieldnumber.props.json +48 -0
- package/lib/lowcode/engine/meta/fieldradio.props.default.json +12 -0
- package/lib/lowcode/engine/meta/fieldradio.props.json +20 -0
- package/lib/lowcode/engine/meta/fieldregion.props.default.json +12 -0
- package/lib/lowcode/engine/meta/fieldregion.props.json +26 -0
- package/lib/lowcode/engine/meta/fieldselect.props.default.json +14 -0
- package/lib/lowcode/engine/meta/fieldselect.props.json +58 -0
- package/lib/lowcode/engine/meta/fieldstring.props.default.json +16 -0
- package/lib/lowcode/engine/meta/fieldstring.props.json +62 -0
- package/lib/lowcode/engine/meta/fieldswitch.props.default.json +12 -0
- package/lib/lowcode/engine/meta/fieldswitch.props.json +31 -0
- package/lib/lowcode/engine/meta/fieldtextarea.props.default.json +13 -0
- package/lib/lowcode/engine/meta/fieldtextarea.props.json +49 -0
- package/lib/lowcode/engine/meta/fieldupload.props.default.json +15 -0
- package/lib/lowcode/engine/meta/fieldupload.props.json +71 -0
- package/lib/lowcode/engine/meta/fielduser.props.default.json +16 -0
- package/lib/lowcode/engine/meta/fielduser.props.json +82 -0
- package/lib/lowcode/engine/meta/fieldyear.props.default.json +12 -0
- package/lib/lowcode/engine/meta/fieldyear.props.json +20 -0
- package/lib/lowcode/engine/meta/form.props.default.json +4 -5
- package/lib/lowcode/engine/meta/form.props.json +44 -35
- package/lib/lowcode/engine/meta/image.props.json +2 -2
- package/lib/lowcode/engine/meta/imex.props.default.json +8 -1
- package/lib/lowcode/engine/meta/imex.props.json +54 -22
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +53 -3
- package/lib/lowcode/engine/meta/layout.props.json +2 -2
- package/lib/lowcode/engine/meta/link.props.json +1 -1
- package/lib/lowcode/engine/meta/page.props.json +2 -2
- package/lib/lowcode/engine/meta/pagelayout.props.default.json +14 -0
- package/lib/lowcode/engine/meta/pagelayout.props.json +47 -0
- package/lib/lowcode/engine/meta/section.props.default.json +4 -6
- package/lib/lowcode/engine/meta/section.props.json +52 -49
- package/lib/lowcode/engine/meta/split.props.default.json +1 -1
- package/lib/lowcode/engine/meta/split.props.json +4 -4
- package/lib/lowcode/engine/meta/table.props.json +19 -13
- package/lib/lowcode/engine/meta/tabs.props.json +3 -3
- package/lib/lowcode/engine/meta/text.props.json +2 -2
- package/lib/lowcode/engine/meta/tree.props.default.json +2 -0
- package/lib/lowcode/engine/meta/tree.props.json +71 -8
- package/lib/lowcode/engine/provider/ContextProvider/index.js +37 -35
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +86 -34
- package/lib/lowcode/engine/tools/dataProcess.js +4 -0
- package/lib/lowcode/engine/tools/diff.js +67 -0
- package/lib/lowcode/engine/tools/helper.js +50 -25
- package/lib/lowcode/engine/tools/useCanvasRender.js +6 -7
- package/lib/lowcode/engine/tools/usePageDataStore.js +338 -0
- package/lib/lowcode/engine/tools/usePromiseState.js +6 -8
- package/lib/lowcode/engine/tools/useTodo.js +19 -9
- package/lib/lowcode/painter/Design.js +39 -4
- package/lib/lowcode/painter/DesignOperator.js +109 -85
- package/lib/lowcode/painter/DesignToolbar.js +277 -33
- package/lib/lowcode/painter/Outline.js +10 -8
- package/lib/lowcode/painter/Panel.js +82 -44
- package/lib/lowcode/painter/components/ActionBindModal.js +36 -25
- package/lib/lowcode/painter/components/AdvancePanel.js +36 -20
- package/lib/lowcode/painter/components/AttrsPanel.js +44 -33
- package/lib/lowcode/painter/components/DragDrop/DragDropContext.js +1 -1
- package/lib/lowcode/painter/components/DragDrop/DragDropWrapper.js +5 -2
- package/lib/lowcode/painter/components/FieldSelector.js +26 -13
- package/lib/lowcode/painter/components/ListEditor.js +8 -2
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +3 -2
- package/lib/lowcode/painter/components/code-editor/JSEditor.js +5 -9
- package/lib/lowcode/painter/components/field-setting/BatchSetting.js +13 -3
- package/lib/lowcode/painter/components/field-setting/CheckFrontRules.js +116 -0
- package/lib/lowcode/painter/components/field-setting/CheckRules.js +1 -26
- package/lib/lowcode/painter/components/field-setting/FieldRulesModal.js +34 -13
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +179 -28
- package/lib/lowcode/painter/components/field-setting/index.js +40 -61
- package/lib/lowcode/painter/components/field-setting/meta/frontRules.js +59 -0
- package/lib/lowcode/painter/index.js +1 -30
- package/lib/lowcode/painter/panel-section/ActionsColumnWidth.js +32 -0
- package/lib/lowcode/painter/panel-section/BlockEditor/index.js +7 -4
- package/lib/lowcode/painter/panel-section/BlocksEditor/BlockEditorItem.js +4 -3
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +53 -25
- package/lib/lowcode/painter/panel-section/ButtonType.js +4 -2
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +30 -7
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +121 -52
- package/lib/lowcode/painter/panel-section/I18nInput.js +27 -0
- package/lib/lowcode/painter/panel-section/ImpExp.js +99 -13
- package/lib/lowcode/painter/panel-section/ImpExpAlone.js +114 -0
- package/lib/lowcode/painter/panel-section/PageLayoutDisplay.js +103 -0
- package/lib/lowcode/painter/panel-section/SerialsSelector.js +4 -2
- package/lib/lowcode/painter/panel-section/SplitDisplay.js +24 -109
- package/lib/lowcode/painter/panel-section/StylePanel/StyleContext.js +5 -4
- package/lib/lowcode/painter/panel-section/StylePanel/index.js +10 -4
- package/lib/lowcode/painter/panel-section/TableTopFilter.js +22 -12
- package/lib/lowcode/painter/panel-section/TreeRootEditor.js +2 -2
- package/lib/lowcode/painter/style/action-bind-modal.less +3 -3
- package/lib/lowcode/painter/style/design.less +7 -3
- package/lib/lowcode/painter/style/list-editor.less +36 -0
- package/lib/lowcode/painter/style/page-layout-display.less +28 -0
- package/lib/lowcode/painter/style/panel-item.less +1 -1
- package/lib/lowcode/painter/style/split-display.less +0 -9
- package/lib/lowcode/preview/index.js +21 -5
- package/lib/lowcode/view/Canvas.js +5 -6
- package/lib/lowcode/view/Page.js +5 -6
- package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +3 -2
- package/lib/lowcode/view/lc-components/Box/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Box/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Box/meta.json +4 -4
- package/lib/lowcode/view/lc-components/Button/index.js +2 -6
- package/lib/lowcode/view/lc-components/Button/meta.json +4 -4
- package/lib/lowcode/view/lc-components/CardList/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/CardList/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/CardList/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/CardList/meta.json +14 -4
- package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +2 -11
- package/lib/lowcode/view/lc-components/Dialog/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Dialog/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Dialog/index.js +116 -19
- package/lib/lowcode/view/lc-components/Dialog/meta.json +73 -43
- package/lib/lowcode/view/lc-components/Drawer/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Drawer/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Drawer/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Drawer/meta.json +9 -21
- package/lib/lowcode/view/lc-components/FieldColor/meta.json +63 -0
- package/lib/lowcode/view/lc-components/FieldComplex/meta.json +39 -0
- package/lib/lowcode/view/lc-components/FieldDate/meta.json +45 -0
- package/lib/lowcode/view/lc-components/FieldDict/meta.json +44 -0
- package/lib/lowcode/view/lc-components/FieldEditor/meta.json +44 -0
- package/lib/lowcode/view/lc-components/FieldGroup/meta.json +73 -0
- package/lib/lowcode/view/lc-components/FieldNumber/meta.json +48 -0
- package/lib/lowcode/view/lc-components/FieldRadio/meta.json +20 -0
- package/lib/lowcode/view/lc-components/FieldRegion/meta.json +26 -0
- package/lib/lowcode/view/lc-components/FieldSelect/meta.json +58 -0
- package/lib/lowcode/view/lc-components/FieldString/meta.json +62 -0
- package/lib/lowcode/view/lc-components/FieldSwitch/meta.json +31 -0
- package/lib/lowcode/view/lc-components/FieldTextarea/meta.json +49 -0
- package/lib/lowcode/view/lc-components/FieldUpload/meta.json +71 -0
- package/lib/lowcode/view/lc-components/FieldUser/meta.json +82 -0
- package/lib/lowcode/view/lc-components/FieldYear/meta.json +20 -0
- package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +58 -7
- package/lib/lowcode/view/lc-components/Form/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Form/FunctionPreview.js +9 -1
- package/lib/lowcode/view/lc-components/Form/index.js +396 -61
- package/lib/lowcode/view/lc-components/Form/meta.json +44 -35
- package/lib/lowcode/view/lc-components/Iframe/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Iframe/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Iframe/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/ImEx/FunctionDesign.js +9 -3
- package/lib/lowcode/view/lc-components/ImEx/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/ImEx/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/ImEx/index.js +468 -9
- package/lib/lowcode/view/lc-components/ImEx/index.less +7 -0
- package/lib/lowcode/view/lc-components/ImEx/meta.json +55 -23
- package/lib/lowcode/view/lc-components/Image/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Image/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Image/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Image/meta.json +2 -2
- package/lib/lowcode/view/lc-components/JSX/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/JSX/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/JSX/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Layout/FunctionDesign.js +11 -19
- package/lib/lowcode/view/lc-components/Layout/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Layout/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Link/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Link/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Link/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Link/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Page/meta.json +2 -2
- package/lib/lowcode/view/lc-components/PageContent/index.js +7 -8
- package/lib/lowcode/view/lc-components/PageFooter/index.js +2 -5
- package/lib/lowcode/view/lc-components/PageHeader/index.js +4 -5
- package/lib/lowcode/view/lc-components/PageLayout/FunctionDesign.js +71 -0
- package/lib/lowcode/view/lc-components/PageLayout/FunctionLive.js +17 -0
- package/lib/lowcode/view/lc-components/PageLayout/FunctionPreview.js +17 -0
- package/lib/lowcode/view/lc-components/PageLayout/index.js +40 -0
- package/lib/lowcode/view/lc-components/PageLayout/meta.json +47 -0
- package/lib/lowcode/view/lc-components/PageModal/index.js +11 -14
- package/lib/lowcode/view/lc-components/Section/FunctionDesign.js +25 -2
- package/lib/lowcode/view/lc-components/Section/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Section/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Section/index.js +113 -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 +18 -21
- package/lib/lowcode/view/lc-components/Split/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Split/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Split/index.js +4 -8
- package/lib/lowcode/view/lc-components/Split/meta.json +4 -4
- package/lib/lowcode/view/lc-components/Table/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Table/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Table/components/TopFilter.js +75 -55
- package/lib/lowcode/view/lc-components/Table/components/TopImex.js +428 -0
- package/lib/lowcode/view/lc-components/Table/index.js +292 -45
- package/lib/lowcode/view/lc-components/Table/meta.json +19 -13
- package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +9 -18
- package/lib/lowcode/view/lc-components/Tabs/index.js +3 -1
- package/lib/lowcode/view/lc-components/Tabs/meta.json +3 -3
- package/lib/lowcode/view/lc-components/Text/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Text/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Text/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Text/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +2 -3
- package/lib/lowcode/view/lc-components/Tree/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Tree/index.js +100 -26
- package/lib/lowcode/view/lc-components/Tree/meta.json +71 -9
- package/lib/lowcode/view/lc-components/Wrapper.js +11 -12
- package/lib/services.js +0 -25
- package/lib/upload/FilesWall/file.png +0 -0
- package/lib/upload/FilesWall/index.js +429 -0
- package/lib/upload/FilesWall/index.less +74 -0
- package/lib/upload/Form/gridForm.js +10 -5
- package/lib/upload/Form/index.js +2 -1
- package/lib/upload/FormItem/index.js +5 -6
- package/lib/upload/index.js +8 -1
- package/lib/utils/action.js +2 -2
- package/lib/utils/form.js +16 -3
- package/lib/utils/grid.js +8 -5
- package/package.json +6 -4
- package/es/lowcode/engine/meta/local/local.zh-cn.js +0 -97
- package/lib/lowcode/engine/meta/local/local.zh-cn.js +0 -103
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
5
|
var _excluded = ["children", "id", "items"];
|
|
6
6
|
import React, { useEffect } from 'react';
|
|
7
7
|
import Index from "./index";
|
|
8
8
|
import { useCreation } from 'ahooks';
|
|
9
|
-
import {
|
|
9
|
+
import { differenceBy } from 'lodash';
|
|
10
10
|
import { suid } from '@luck-design-biz/base/utils';
|
|
11
|
-
import { useContext,
|
|
12
|
-
import { add, findNodeAndParent } from "../../../engine/tools/dataProcess";
|
|
11
|
+
import { useContext, useGet, addNode } from "../../../engine/provider/ContextProvider";
|
|
13
12
|
import boxDefaultMeta from "../../../engine/meta/box.props.default.json";
|
|
14
13
|
var FunctionDesign = function FunctionDesign(_ref) {
|
|
15
14
|
var children = _ref.children,
|
|
@@ -17,28 +16,24 @@ var FunctionDesign = function FunctionDesign(_ref) {
|
|
|
17
16
|
items = _ref.items,
|
|
18
17
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
18
|
var ctx = useContext();
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
var current = useGet({
|
|
20
|
+
id: id
|
|
21
|
+
});
|
|
23
22
|
useCreation(function () {
|
|
24
23
|
if (children !== null && children !== void 0 && children.length) return;
|
|
25
24
|
ctx.$subscriber(ctx.topics.COMPONENT_APPEND).once(function (_ref2) {
|
|
26
|
-
var compId = _ref2.id
|
|
27
|
-
pageData = _ref2.pageData;
|
|
25
|
+
var compId = _ref2.id;
|
|
28
26
|
if (compId !== id) return;
|
|
29
|
-
var cloneData = cloneDeep(pageData);
|
|
30
27
|
var boxId = "box_".concat(suid());
|
|
31
|
-
|
|
28
|
+
addNode(id, boxId, _objectSpread(_objectSpread({}, boxDefaultMeta), {}, {
|
|
32
29
|
buildIn: true,
|
|
33
30
|
tabId: items[0].id
|
|
34
31
|
}));
|
|
35
|
-
setPageData(cloneData);
|
|
36
32
|
}).watch();
|
|
37
33
|
}, []);
|
|
38
34
|
useEffect(function () {
|
|
39
35
|
var cmid = ctx.$subscriber(ctx.topics.COMPONENT_MODIFY).on(function (_ref3) {
|
|
40
36
|
var compId = _ref3.id,
|
|
41
|
-
pageData = _ref3.pageData,
|
|
42
37
|
newValue = _ref3.newValue,
|
|
43
38
|
oldValue = _ref3.oldValue;
|
|
44
39
|
if (compId !== id || !newValue.hasOwnProperty('items')) return;
|
|
@@ -47,30 +42,26 @@ var FunctionDesign = function FunctionDesign(_ref) {
|
|
|
47
42
|
_differenceBy2 = _slicedToArray(_differenceBy, 1),
|
|
48
43
|
newItem = _differenceBy2[0];
|
|
49
44
|
var boxId = "box_".concat(suid());
|
|
50
|
-
|
|
45
|
+
addNode(id, boxId, _objectSpread(_objectSpread({}, boxDefaultMeta), {}, {
|
|
51
46
|
buildIn: true,
|
|
52
47
|
tabId: newItem.id
|
|
53
48
|
}));
|
|
54
|
-
setPageData(pageData);
|
|
55
49
|
} else if (newValue.items.length < oldValue.items.length) {
|
|
56
50
|
var _differenceBy3 = differenceBy(oldValue.items, newValue.items, 'id'),
|
|
57
51
|
_differenceBy4 = _slicedToArray(_differenceBy3, 1),
|
|
58
52
|
removeItem = _differenceBy4[0];
|
|
59
|
-
var _findNodeAndParent = findNodeAndParent(id, pageData),
|
|
60
|
-
current = _findNodeAndParent.node;
|
|
61
53
|
var _boxId = current.children.find(function (childId) {
|
|
62
54
|
return current[childId].props.tabId === removeItem.id;
|
|
63
55
|
});
|
|
64
56
|
ctx.$publisher(ctx.topics.COMPONENT_DELETE, {
|
|
65
|
-
id: _boxId
|
|
66
|
-
pageData: pageData
|
|
57
|
+
id: _boxId
|
|
67
58
|
});
|
|
68
59
|
}
|
|
69
60
|
}).watch();
|
|
70
61
|
return function () {
|
|
71
62
|
return ctx.$unsubscriber(ctx.topics.COMPONENT_MODIFY, cmid);
|
|
72
63
|
};
|
|
73
|
-
}, []);
|
|
64
|
+
}, [current.children]);
|
|
74
65
|
return /*#__PURE__*/React.createElement(Index, _extends({
|
|
75
66
|
id: id,
|
|
76
67
|
items: items
|
|
@@ -12,7 +12,9 @@ import defaultMeta from "../../../engine/meta/tabs.props.default.json";
|
|
|
12
12
|
var StyledTabs = styled(Tabs).withConfig({
|
|
13
13
|
displayName: "StyledTabs",
|
|
14
14
|
componentId: "luckda-6530__sc-ht1jge-0"
|
|
15
|
-
})(["", ""], function (props) {
|
|
15
|
+
})([".ant-tabs-content{", "}", ""], function (props) {
|
|
16
|
+
return props.type === 'line' ? 'height: calc(100% - 62px);' : 'height: calc(100% - 56px);';
|
|
17
|
+
}, function (props) {
|
|
16
18
|
return props.$css;
|
|
17
19
|
});
|
|
18
20
|
var LCTabs = function LCTabs(_ref) {
|
|
@@ -94,19 +94,19 @@
|
|
|
94
94
|
"key": "onMount",
|
|
95
95
|
"name": "组件首次渲染时",
|
|
96
96
|
"desc": "在组件首次渲染时,执行方法",
|
|
97
|
-
"func": "(
|
|
97
|
+
"func": "function onMount() {\n\t\n}"
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
"key": "onUnmount",
|
|
101
101
|
"name": "组件卸载时",
|
|
102
102
|
"desc": "在组件卸载时,执行方法。",
|
|
103
|
-
"func": "(
|
|
103
|
+
"func": "function onUnmount() {\n\t\n}"
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
106
|
"key": "onTabClick",
|
|
107
107
|
"name": "tab被点击的回调",
|
|
108
108
|
"desc": "当tab被点击时, 执行方法",
|
|
109
|
-
"func": "(tabKey, e)
|
|
109
|
+
"func": "function onTabClick(tabKey, e) {\n\t\n}"
|
|
110
110
|
}
|
|
111
111
|
]
|
|
112
112
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
var _excluded = ["children"];
|
|
3
|
+
import React from 'react';
|
|
3
4
|
import Index from "./index";
|
|
4
5
|
var FunctionPreview = function FunctionPreview(_ref) {
|
|
5
6
|
var children = _ref.children,
|
|
@@ -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",
|
|
@@ -16,7 +16,6 @@ var FunctionDesign = function FunctionDesign(_ref) {
|
|
|
16
16
|
defaultExpandDeep = _ref.defaultExpandDeep,
|
|
17
17
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
18
18
|
var ctx = useContext();
|
|
19
|
-
var treeRef = useRef(null);
|
|
20
19
|
var _useState = useState([]),
|
|
21
20
|
_useState2 = _slicedToArray(_useState, 2),
|
|
22
21
|
treeData = _useState2[0],
|
|
@@ -46,7 +45,6 @@ var FunctionDesign = function FunctionDesign(_ref) {
|
|
|
46
45
|
});
|
|
47
46
|
}, [expandedKeys]);
|
|
48
47
|
return /*#__PURE__*/React.createElement(Index, _extends({}, props, {
|
|
49
|
-
ref: treeRef,
|
|
50
48
|
afterQuery: function afterQuery(_ref3) {
|
|
51
49
|
var code = _ref3.code,
|
|
52
50
|
list = _ref3.list,
|
|
@@ -63,7 +61,8 @@ var FunctionDesign = function FunctionDesign(_ref) {
|
|
|
63
61
|
className: styles['runtime-tree'],
|
|
64
62
|
draggable: false,
|
|
65
63
|
suppressInit: true,
|
|
66
|
-
onDataSetChange: handleDataSetChange
|
|
64
|
+
onDataSetChange: handleDataSetChange,
|
|
65
|
+
asyncLoad: false
|
|
67
66
|
}), children);
|
|
68
67
|
};
|
|
69
68
|
export default FunctionDesign;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
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,
|
|
5
|
+
var _excluded = ["id", "wrapperRef", "className", "dataset", "width", "height", "showLine", "defaultExpandDeep", "actions", "editable", "showRootAdd", "onlyRoot", "rootAddSetting", "doubleClickExpand", "onDoubleClick", "treeNodeCheckable", "treeNodeDisableCheckbox", "treeNodeDisable", "onTreeNodeRender", "treeNodeIcon", "advance", "cancelSelect", "defaultSelect"];
|
|
6
|
+
import React, { useRef, useImperativeHandle, useState, useEffect } from 'react';
|
|
6
7
|
import PropTypes from 'prop-types';
|
|
7
8
|
import { useMemoizedFn, useCreation } from 'ahooks';
|
|
8
9
|
import classNames from 'classnames';
|
|
9
|
-
import { isNil } from 'lodash';
|
|
10
|
-
import { IconFont } from '@luck-design-biz/base';
|
|
10
|
+
import { isNil, keyBy } from 'lodash';
|
|
11
|
+
import { Modal, recheck, IconFont } from '@luck-design-biz/base';
|
|
11
12
|
import { suid } from '@luck-design-biz/base/utils';
|
|
12
13
|
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
13
14
|
import Wrapper from "../Wrapper";
|
|
@@ -15,6 +16,7 @@ import { LdTree } from "../../../../index";
|
|
|
15
16
|
import { omitBadProps, executeCode } from "../../../engine/tools/helper";
|
|
16
17
|
import defaultMeta from "../../../engine/meta/tree.props.default.json";
|
|
17
18
|
import styles from "./index.less";
|
|
19
|
+
var PRIMARY = window.appConfig.constraintKeys.PRIMARY;
|
|
18
20
|
var LCTree = function LCTree(_ref) {
|
|
19
21
|
var id = _ref.id,
|
|
20
22
|
wrapperRef = _ref.wrapperRef,
|
|
@@ -27,6 +29,7 @@ var LCTree = function LCTree(_ref) {
|
|
|
27
29
|
actions = _ref.actions,
|
|
28
30
|
editable = _ref.editable,
|
|
29
31
|
showRootAdd = _ref.showRootAdd,
|
|
32
|
+
onlyRoot = _ref.onlyRoot,
|
|
30
33
|
rootAddSetting = _ref.rootAddSetting,
|
|
31
34
|
doubleClickExpand = _ref.doubleClickExpand,
|
|
32
35
|
onDoubleClick = _ref.onDoubleClick,
|
|
@@ -36,16 +39,41 @@ var LCTree = function LCTree(_ref) {
|
|
|
36
39
|
onTreeNodeRender = _ref.onTreeNodeRender,
|
|
37
40
|
_treeNodeIcon = _ref.treeNodeIcon,
|
|
38
41
|
advance = _ref.advance,
|
|
42
|
+
cancelSelect = _ref.cancelSelect,
|
|
43
|
+
defaultSelect = _ref.defaultSelect,
|
|
39
44
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
40
45
|
var ctx = useContext();
|
|
41
46
|
var boxRef = useRef();
|
|
47
|
+
var apiRef = useRef();
|
|
42
48
|
var treeRef = useRef();
|
|
49
|
+
var _useState = useState([]),
|
|
50
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
51
|
+
selectedKeys = _useState2[0],
|
|
52
|
+
setSelectedKeys = _useState2[1];
|
|
43
53
|
var getTargetDom = useMemoizedFn(function () {
|
|
44
54
|
return boxRef.current;
|
|
45
55
|
});
|
|
46
|
-
useImperativeHandle(
|
|
47
|
-
return
|
|
56
|
+
useImperativeHandle(apiRef, function () {
|
|
57
|
+
return {
|
|
58
|
+
getInstance: function getInstance() {
|
|
59
|
+
return treeRef.current;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
48
62
|
});
|
|
63
|
+
useEffect(function () {
|
|
64
|
+
var tid = ctx.$subscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED).on(function (_ref2) {
|
|
65
|
+
var resource = _ref2.resource,
|
|
66
|
+
prevResource = _ref2.prevResource;
|
|
67
|
+
ctx.doAction(advance.events.onPagePublicResourceChanged, {
|
|
68
|
+
resource: resource,
|
|
69
|
+
prevResource: prevResource,
|
|
70
|
+
instance: treeRef.current
|
|
71
|
+
});
|
|
72
|
+
}).watch();
|
|
73
|
+
return function () {
|
|
74
|
+
ctx.$unsubscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED, tid);
|
|
75
|
+
};
|
|
76
|
+
}, []);
|
|
49
77
|
var handleMount = useMemoizedFn(function (params) {
|
|
50
78
|
ctx.doAction(advance.events.onMount, {
|
|
51
79
|
params: params
|
|
@@ -71,6 +99,12 @@ var LCTree = function LCTree(_ref) {
|
|
|
71
99
|
e: e
|
|
72
100
|
});
|
|
73
101
|
});
|
|
102
|
+
var handleDrop = useMemoizedFn(function (info, dragInfo) {
|
|
103
|
+
ctx.doAction(advance.events.onCheck, {
|
|
104
|
+
info: info,
|
|
105
|
+
dragInfo: dragInfo
|
|
106
|
+
});
|
|
107
|
+
});
|
|
74
108
|
var events = useCreation(function () {
|
|
75
109
|
if (advance !== null && advance !== void 0 && advance.events) {
|
|
76
110
|
var _events = {};
|
|
@@ -79,29 +113,59 @@ var LCTree = function LCTree(_ref) {
|
|
|
79
113
|
if (advance.events.processDataSource) _events.dataToTreeFormat = handleProcessDataSource;
|
|
80
114
|
if (advance.events.onDoubleClick) _events.onNodeDoubleClick = handleNodeDoubleClick;
|
|
81
115
|
if (advance.events.onCheck) _events.onCheck = handleCheck;
|
|
116
|
+
if (advance.events.onDrop) _events.onDrop = handleDrop;
|
|
82
117
|
return _events;
|
|
83
118
|
}
|
|
84
119
|
return {};
|
|
85
120
|
}, [advance === null || advance === void 0 ? void 0 : advance.events]);
|
|
86
|
-
var
|
|
87
|
-
if (
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
// }, {
|
|
96
|
-
// showConfirm: false,
|
|
97
|
-
// callback: (success) => success && onLdQuery()
|
|
98
|
-
// });
|
|
121
|
+
var handleSelect = useMemoizedFn(function (_selectedKeys, e) {
|
|
122
|
+
if (cancelSelect || e.selected) {
|
|
123
|
+
setSelectedKeys(_selectedKeys);
|
|
124
|
+
ctx.setPagePublicResource(_defineProperty({}, id, {
|
|
125
|
+
selectedNodes: e.selectedNodes.map(function (i) {
|
|
126
|
+
var _i$props;
|
|
127
|
+
return (i === null || i === void 0 || (_i$props = i.props) === null || _i$props === void 0 ? void 0 : _i$props.dataRef) || i;
|
|
128
|
+
})
|
|
129
|
+
}));
|
|
99
130
|
}
|
|
131
|
+
ctx.doAction(advance.events.onSelect, {
|
|
132
|
+
checkedKeys: _selectedKeys,
|
|
133
|
+
e: e
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
var afterInit = useMemoizedFn(function (treeData, data) {
|
|
137
|
+
var selected = !isNil(defaultSelect) ? executeCode(ctx, defaultSelect, ['treeData'], treeData) : null;
|
|
138
|
+
selected && handleSelect(selected, {
|
|
139
|
+
selected: true,
|
|
140
|
+
selectedNodes: selected.map(function (key) {
|
|
141
|
+
return keyBy(data, PRIMARY)[key];
|
|
142
|
+
})
|
|
143
|
+
});
|
|
100
144
|
});
|
|
145
|
+
var handleAction = function handleAction(action, params) {
|
|
146
|
+
var doAction = function doAction() {
|
|
147
|
+
ctx.doAction(action.actionPool, params);
|
|
148
|
+
};
|
|
149
|
+
if (action.riskLevel === 'danger') {
|
|
150
|
+
Modal.confirm({
|
|
151
|
+
title: "\u786E\u8BA4\u6267\u884C".concat(action.name, "\u884C\u4E3A\u64CD\u4F5C\u5417\uFF1F"),
|
|
152
|
+
onOk: doAction
|
|
153
|
+
});
|
|
154
|
+
} else if (action.riskLevel === 'destroy') {
|
|
155
|
+
recheck({
|
|
156
|
+
title: "\u786E\u8BA4\u6267\u884C".concat(action.name, "\u884C\u4E3A\u64CD\u4F5C\u5417\uFF1F"),
|
|
157
|
+
checkWords: "\u6267\u884C".concat(action.name),
|
|
158
|
+
onOk: doAction
|
|
159
|
+
});
|
|
160
|
+
} else {
|
|
161
|
+
doAction();
|
|
162
|
+
}
|
|
163
|
+
};
|
|
101
164
|
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
102
165
|
id: id,
|
|
103
166
|
displayName: "Tree",
|
|
104
|
-
getTargetDom: getTargetDom
|
|
167
|
+
getTargetDom: getTargetDom,
|
|
168
|
+
api: apiRef
|
|
105
169
|
}, /*#__PURE__*/React.createElement("div", {
|
|
106
170
|
ref: boxRef,
|
|
107
171
|
style: {
|
|
@@ -125,14 +189,16 @@ var LCTree = function LCTree(_ref) {
|
|
|
125
189
|
return ctx.doAction(rootAddSetting.actionPool);
|
|
126
190
|
}
|
|
127
191
|
} : null,
|
|
192
|
+
onlyRoot: onlyRoot,
|
|
128
193
|
rightMenus: function rightMenus() {
|
|
129
194
|
return actions.todoList.map(function (action) {
|
|
130
195
|
return {
|
|
131
196
|
key: suid(),
|
|
132
197
|
name: action.name,
|
|
133
198
|
onClick: function onClick(_, data) {
|
|
134
|
-
|
|
135
|
-
data: data
|
|
199
|
+
handleAction(action, {
|
|
200
|
+
data: data,
|
|
201
|
+
datasetCode: dataset === null || dataset === void 0 ? void 0 : dataset.code
|
|
136
202
|
});
|
|
137
203
|
},
|
|
138
204
|
resource: action.serial,
|
|
@@ -173,7 +239,9 @@ var LCTree = function LCTree(_ref) {
|
|
|
173
239
|
onTreeNodeRender: onTreeNodeRender ? function (title, i) {
|
|
174
240
|
return executeCode(ctx, onTreeNodeRender, ['title', 'item'], title, i);
|
|
175
241
|
} : null,
|
|
176
|
-
|
|
242
|
+
selectedKeys: selectedKeys,
|
|
243
|
+
onSelect: handleSelect,
|
|
244
|
+
afterInit: afterInit
|
|
177
245
|
}, events, props))));
|
|
178
246
|
};
|
|
179
247
|
LCTree.propTypes = {
|
|
@@ -257,6 +325,11 @@ LCTree.propTypes = {
|
|
|
257
325
|
* @type bool
|
|
258
326
|
*/
|
|
259
327
|
showRootAdd: PropTypes.bool,
|
|
328
|
+
/**
|
|
329
|
+
* @name 是否只有唯一一个根节点
|
|
330
|
+
* @type bool
|
|
331
|
+
*/
|
|
332
|
+
onlyRoot: PropTypes.bool,
|
|
260
333
|
/**
|
|
261
334
|
* @name 根节点配置
|
|
262
335
|
* @type object
|
|
@@ -325,11 +398,12 @@ LCTree.propTypes = {
|
|
|
325
398
|
* @name 复选框选择事件
|
|
326
399
|
* @type _JSEditor
|
|
327
400
|
*/
|
|
328
|
-
onCheck: PropTypes.string
|
|
401
|
+
onCheck: PropTypes.string,
|
|
402
|
+
/**
|
|
403
|
+
* @name 选中事件
|
|
404
|
+
* @type _JSEditor
|
|
405
|
+
*/
|
|
406
|
+
onSelect: PropTypes.string
|
|
329
407
|
};
|
|
330
408
|
LCTree.defaultProps = omitBadProps(defaultMeta);
|
|
331
|
-
export default
|
|
332
|
-
return /*#__PURE__*/React.createElement(LCTree, _extends({
|
|
333
|
-
wrapperRef: ref
|
|
334
|
-
}, props));
|
|
335
|
-
});
|
|
409
|
+
export default LCTree;
|
|
@@ -17,13 +17,24 @@
|
|
|
17
17
|
"key": "dataset",
|
|
18
18
|
"name": "数据集",
|
|
19
19
|
"desc": "选择系统中的可用树形数据集",
|
|
20
|
-
"type": "_DataSetSelector"
|
|
20
|
+
"type": "_DataSetSelector",
|
|
21
|
+
"component": "tree",
|
|
22
|
+
"next": {
|
|
23
|
+
"name": "字段配置",
|
|
24
|
+
"props": [
|
|
25
|
+
{
|
|
26
|
+
"key": "fields",
|
|
27
|
+
"name": "#字段配置器",
|
|
28
|
+
"type": "_FieldsSetting"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
21
32
|
},
|
|
22
33
|
{
|
|
23
34
|
"key": "title",
|
|
24
35
|
"name": "标题",
|
|
25
36
|
"desc": "头部标题",
|
|
26
|
-
"type": "
|
|
37
|
+
"type": "_I18nInput"
|
|
27
38
|
},
|
|
28
39
|
{
|
|
29
40
|
"key": "readOnly",
|
|
@@ -81,7 +92,7 @@
|
|
|
81
92
|
"key": "treeNodeTitle",
|
|
82
93
|
"name": "展示字段",
|
|
83
94
|
"desc": "展示字段的key",
|
|
84
|
-
"type": "
|
|
95
|
+
"type": "_I18nInput",
|
|
85
96
|
"default": "sname"
|
|
86
97
|
},
|
|
87
98
|
{
|
|
@@ -118,6 +129,31 @@
|
|
|
118
129
|
"default": "0"
|
|
119
130
|
}
|
|
120
131
|
]
|
|
132
|
+
}, {
|
|
133
|
+
"key": "selectSetting",
|
|
134
|
+
"name": "选中设置",
|
|
135
|
+
"type": "group",
|
|
136
|
+
"props": [
|
|
137
|
+
{
|
|
138
|
+
"key": "cancelSelect",
|
|
139
|
+
"name": "取消选中",
|
|
140
|
+
"desc": "是否可以取消选中",
|
|
141
|
+
"type": "switch",
|
|
142
|
+
"default": true
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"key": "defaultSelect",
|
|
146
|
+
"name": "默认选中",
|
|
147
|
+
"desc": "返回默认选中的数据主键",
|
|
148
|
+
"type": "_JSEditor",
|
|
149
|
+
"defaultCode": "function defaultSelect(treeData) { \n return []; \n}",
|
|
150
|
+
"mustConfirm": true,
|
|
151
|
+
"wrapper": "collapse",
|
|
152
|
+
"wrapperProps": {
|
|
153
|
+
"suppressIcon": true
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
]
|
|
121
157
|
},
|
|
122
158
|
{
|
|
123
159
|
"key": "IconSetting",
|
|
@@ -168,6 +204,13 @@
|
|
|
168
204
|
"type": "switch",
|
|
169
205
|
"default": true
|
|
170
206
|
},
|
|
207
|
+
{
|
|
208
|
+
"key": "onlyRoot",
|
|
209
|
+
"name": "根节点唯一",
|
|
210
|
+
"desc": "树组件仅一个根节点,如数据根节点数大于0,则不允许根节点新增",
|
|
211
|
+
"type": "switch",
|
|
212
|
+
"default": false
|
|
213
|
+
},
|
|
171
214
|
{
|
|
172
215
|
"key": "rootAddSetting",
|
|
173
216
|
"name": "根节点配置",
|
|
@@ -184,6 +227,7 @@
|
|
|
184
227
|
"default": {
|
|
185
228
|
"todoList": []
|
|
186
229
|
},
|
|
230
|
+
"defaultCode": "function onActionClick(data) {\n\n}",
|
|
187
231
|
"suppressDisplay": true,
|
|
188
232
|
"suppressMax": true,
|
|
189
233
|
"suppressMore": true,
|
|
@@ -270,32 +314,50 @@
|
|
|
270
314
|
"key": "onMount",
|
|
271
315
|
"name": "组件首次渲染时",
|
|
272
316
|
"desc": "在组件首次渲染时,执行方法",
|
|
273
|
-
"func": "(params)
|
|
317
|
+
"func": "function onMount(params) {\n\t\n}"
|
|
274
318
|
},
|
|
275
319
|
{
|
|
276
320
|
"key": "onUnmount",
|
|
277
321
|
"name": "组件卸载时",
|
|
278
322
|
"desc": "在组件卸载时,执行方法。",
|
|
279
|
-
"func": "()
|
|
323
|
+
"func": "function onUnmount() {\n\t\n}"
|
|
280
324
|
},
|
|
281
325
|
{
|
|
282
326
|
"key": "processDataSource",
|
|
283
327
|
"name": "数据预处理",
|
|
284
328
|
"desc": "数据渲染前预处理",
|
|
285
|
-
"func": "(data)
|
|
329
|
+
"func": "function processDataSource(data) {\n\t\n}"
|
|
286
330
|
},
|
|
287
331
|
{
|
|
288
332
|
"key": "onDoubleClick",
|
|
289
333
|
"name": "双击事件",
|
|
290
334
|
"desc": "树节点双击事件",
|
|
291
|
-
"func": "(e, rowData)
|
|
335
|
+
"func": "function onDoubleClick(e, rowData) {\n\t\n}"
|
|
292
336
|
},
|
|
293
337
|
{
|
|
294
338
|
"key": "onCheck",
|
|
295
339
|
"name": "复选框选择事件",
|
|
296
340
|
"desc": "点击复选框触发",
|
|
297
|
-
"func": "(checkedKeys, e)
|
|
341
|
+
"func": "function onCheck(checkedKeys, e) {\n\t\n}"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
"key": "onSelect",
|
|
345
|
+
"name": "选中事件",
|
|
346
|
+
"desc": "节点选中事件",
|
|
347
|
+
"func": "function onSelect(checkedKeys, e) {\n\t\n}"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"key": "onDrop",
|
|
351
|
+
"name": "拖拽事件",
|
|
352
|
+
"desc": "节点拖拽事件",
|
|
353
|
+
"func": "function onDrop(info, dragInfo) {\n\t\n}"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"key": "onPagePublicResourceChanged",
|
|
357
|
+
"name": "页面共享资源变化后",
|
|
358
|
+
"desc": "当页面共享资源发生变化后(pagePublicResourceChanged),执行方法",
|
|
359
|
+
"func": "function onPagePublicResourceChanged(resource, prevResource, instance) {\n\t\n}"
|
|
298
360
|
}
|
|
299
361
|
]
|
|
300
362
|
}
|
|
301
|
-
}
|
|
363
|
+
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import
|
|
3
|
-
import { useEffect } from 'react';
|
|
2
|
+
import React, { useEffect } from 'react';
|
|
4
3
|
import { useLatest, useCreation } from 'ahooks';
|
|
5
4
|
import { omit } from 'lodash';
|
|
6
|
-
import { useContext,
|
|
7
|
-
import { findNodeAndParent, getPathNodesById } from "../../engine/tools/dataProcess";
|
|
5
|
+
import { useContext, useGet, getLevelNodes as _getLevelNodes, getSelfAndParent } from "../../engine/provider/ContextProvider";
|
|
8
6
|
import { LC_COMPONENT_UNIT_KEY, LC_COMPONENT_UNIT, RUNTIME } from "../../constants";
|
|
9
7
|
import DragDropWrapper from "../../painter/components/DragDrop/DragDropWrapper";
|
|
10
8
|
var LCWrapper = function LCWrapper(_ref) {
|
|
@@ -14,23 +12,23 @@ var LCWrapper = function LCWrapper(_ref) {
|
|
|
14
12
|
getTargetDom = _ref.getTargetDom,
|
|
15
13
|
api = _ref.api;
|
|
16
14
|
var ctx = useContext();
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
15
|
+
var selfData = useGet({
|
|
16
|
+
id: id
|
|
17
|
+
});
|
|
18
|
+
var _selfData = useLatest(selfData);
|
|
21
19
|
useCreation(function () {
|
|
22
20
|
var meta = displayName ? require("../../engine/meta/".concat(displayName.toLowerCase(), ".props.json")) : {};
|
|
23
21
|
var _api = {
|
|
24
22
|
self: children,
|
|
25
23
|
getSelfData: function getSelfData() {
|
|
26
|
-
return
|
|
24
|
+
return _selfData.current;
|
|
27
25
|
},
|
|
28
26
|
getSelfDom: getTargetDom,
|
|
29
|
-
|
|
30
|
-
return
|
|
27
|
+
getSelfAndParentData: function getSelfAndParentData() {
|
|
28
|
+
return getSelfAndParent(id);
|
|
31
29
|
},
|
|
32
30
|
getLevelNodes: function getLevelNodes() {
|
|
33
|
-
return
|
|
31
|
+
return _getLevelNodes(id);
|
|
34
32
|
}
|
|
35
33
|
};
|
|
36
34
|
ctx._register(id, new Proxy({
|
package/es/services.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
-
import { stringify } from 'querystring';
|
|
4
3
|
import { request } from '@luck-design-biz/base/utils';
|
|
5
4
|
import api from "@/services/ApiConfig";
|
|
6
5
|
export function readModlue(_x) {
|
|
@@ -21,27 +20,4 @@ function _readModlue() {
|
|
|
21
20
|
}, _callee);
|
|
22
21
|
}));
|
|
23
22
|
return _readModlue.apply(this, arguments);
|
|
24
|
-
}
|
|
25
|
-
export function readBehaviorCall(_x2, _x3) {
|
|
26
|
-
return _readBehaviorCall.apply(this, arguments);
|
|
27
|
-
}
|
|
28
|
-
function _readBehaviorCall() {
|
|
29
|
-
_readBehaviorCall = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(get, post) {
|
|
30
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
31
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
32
|
-
case 0:
|
|
33
|
-
return _context2.abrupt("return", request("".concat(api.API_HOST, "/lowcode/to/behavior/call?").concat(stringify(get)), {
|
|
34
|
-
method: 'POST',
|
|
35
|
-
body: post,
|
|
36
|
-
headers: {
|
|
37
|
-
'Content-Type': 'application/json;charset=UTF-8'
|
|
38
|
-
}
|
|
39
|
-
}));
|
|
40
|
-
case 1:
|
|
41
|
-
case "end":
|
|
42
|
-
return _context2.stop();
|
|
43
|
-
}
|
|
44
|
-
}, _callee2);
|
|
45
|
-
}));
|
|
46
|
-
return _readBehaviorCall.apply(this, arguments);
|
|
47
23
|
}
|
|
Binary file
|