@luck-design-biz/luckda 0.0.25-1 → 0.0.25-11
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 +37 -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 +47 -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 +11 -4
- 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 +119 -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 +35 -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 +27 -12
- 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 +8 -9
- 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 +37 -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 +48 -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 +11 -4
- 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 +119 -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 +35 -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 +26 -11
- 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 +8 -9
- 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 +175 -171
- 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,3 +1,4 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
@@ -5,13 +6,12 @@ import React, { useRef, useState, useEffect, useLayoutEffect } from 'react';
|
|
|
5
6
|
import { useCreation, useMemoizedFn } from 'ahooks';
|
|
6
7
|
import { Breadcrumb } from 'luck-design/antd';
|
|
7
8
|
import classNames from 'classnames';
|
|
8
|
-
import { takeRight,
|
|
9
|
+
import { takeRight, isNil, reduce, get, isString } from 'lodash';
|
|
9
10
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
10
|
-
import { useContext,
|
|
11
|
+
import { useContext, useTask, addNode, deleteNode } from "../engine/provider/ContextProvider";
|
|
11
12
|
import AttrsPanel from "./components/AttrsPanel";
|
|
12
13
|
import StylePanel from "./panel-section/StylePanel";
|
|
13
14
|
import AdvancePanel from "./components/AdvancePanel";
|
|
14
|
-
import { modifyById, add, deleteById } from "../engine/tools/dataProcess";
|
|
15
15
|
import styles from "./style/panel.less";
|
|
16
16
|
import { LC_BUILDIN_UNIT_KEY } from "../constants";
|
|
17
17
|
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel';
|
|
@@ -35,6 +35,7 @@ var _TAB_LIST_ = [{
|
|
|
35
35
|
key: 'advance'
|
|
36
36
|
}];
|
|
37
37
|
var Panel = function Panel() {
|
|
38
|
+
var _activeNode$$target;
|
|
38
39
|
var activeTabRef = useRef(null);
|
|
39
40
|
var underLineRef = useRef(null);
|
|
40
41
|
var _useState = useState(null),
|
|
@@ -46,74 +47,106 @@ var Panel = function Panel() {
|
|
|
46
47
|
activeTabKey = _useState4[0],
|
|
47
48
|
setActiveTabKey = _useState4[1];
|
|
48
49
|
var context = useContext();
|
|
49
|
-
var
|
|
50
|
-
_usePageData2 = _slicedToArray(_usePageData, 2),
|
|
51
|
-
pageData = _usePageData2[0],
|
|
52
|
-
setPageData = _usePageData2[1].setPageData;
|
|
50
|
+
var task = useTask('modify');
|
|
53
51
|
var meta = useCreation(function () {
|
|
52
|
+
if (isNil(activeNode)) return null;
|
|
54
53
|
try {
|
|
55
|
-
|
|
54
|
+
var _meta = require("../engine/meta/".concat(activeNode.node.component.toLowerCase(), ".props.json"));
|
|
55
|
+
if (!isNil(activeNode === null || activeNode === void 0 ? void 0 : activeNode.$target)) {
|
|
56
|
+
var setValueKey = function setValueKey(items) {
|
|
57
|
+
items.forEach(function (item) {
|
|
58
|
+
if (item.next) {
|
|
59
|
+
setValueKey(item.next.props);
|
|
60
|
+
} else if (item.props) {
|
|
61
|
+
setValueKey(item.props);
|
|
62
|
+
} else {
|
|
63
|
+
item.valueKey = "".concat(activeNode.$target.keyPath, ".").concat(item.key);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
setValueKey(_meta.props);
|
|
68
|
+
}
|
|
69
|
+
return _meta;
|
|
56
70
|
} catch (e) {
|
|
57
71
|
return null;
|
|
58
72
|
}
|
|
59
73
|
}, [activeNode]);
|
|
60
|
-
var handleChange = useMemoizedFn(function (field, value
|
|
61
|
-
var
|
|
74
|
+
var handleChange = useMemoizedFn(function (field, value) {
|
|
75
|
+
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
76
|
+
repositioning = _ref.repositioning,
|
|
77
|
+
before = _ref.before;
|
|
62
78
|
if (field === 'enableHeader') {
|
|
63
79
|
if (value) {
|
|
64
80
|
var headerMeta = require("../engine/meta/pageheader.props.default.json");
|
|
65
|
-
|
|
81
|
+
addNode(LC_BUILDIN_UNIT_KEY.PAGE_ROOT, LC_BUILDIN_UNIT_KEY.PAGE_HEADER, _objectSpread(_objectSpread({}, headerMeta), {}, {
|
|
66
82
|
buildIn: true
|
|
67
83
|
}));
|
|
68
84
|
} else {
|
|
69
|
-
|
|
85
|
+
deleteNode(LC_BUILDIN_UNIT_KEY.PAGE_HEADER);
|
|
70
86
|
}
|
|
71
87
|
} else if (field === 'enableFooter') {
|
|
72
88
|
if (value) {
|
|
73
89
|
var footerMeta = require("../engine/meta/pagefooter.props.default.json");
|
|
74
|
-
|
|
90
|
+
addNode(LC_BUILDIN_UNIT_KEY.PAGE_ROOT, LC_BUILDIN_UNIT_KEY.PAGE_FOOTER, _objectSpread(_objectSpread({}, footerMeta), {}, {
|
|
75
91
|
buildIn: true
|
|
76
92
|
}));
|
|
77
93
|
} else {
|
|
78
|
-
|
|
94
|
+
deleteNode(LC_BUILDIN_UNIT_KEY.PAGE_FOOTER);
|
|
79
95
|
}
|
|
80
96
|
}
|
|
81
|
-
var
|
|
82
|
-
var
|
|
83
|
-
|
|
97
|
+
var targetId = isNil(activeNode.$target) ? activeNode.node.id : activeNode.$target.ancestorId;
|
|
98
|
+
var component = context.componentMap.get(targetId);
|
|
99
|
+
var node = component.api.getSelfData();
|
|
84
100
|
var oldValue = _defineProperty({}, field, get(node.props, field));
|
|
85
|
-
var
|
|
86
|
-
|
|
87
|
-
|
|
101
|
+
var newValue = _defineProperty({}, field, value);
|
|
102
|
+
if (before) {
|
|
103
|
+
before(handleChange);
|
|
104
|
+
}
|
|
105
|
+
task(targetId, newValue).then(function () {
|
|
88
106
|
context.$publisher(context.topics.COMPONENT_MODIFY, {
|
|
89
|
-
id:
|
|
90
|
-
pageData: cloneDeep(newData),
|
|
107
|
+
id: targetId,
|
|
91
108
|
oldValue: oldValue,
|
|
92
|
-
newValue:
|
|
109
|
+
newValue: newValue
|
|
93
110
|
});
|
|
94
111
|
if (repositioning) context.$publisher(context.topics.COMPONENT_REPOSITIONING, {
|
|
95
|
-
id:
|
|
112
|
+
id: targetId
|
|
96
113
|
});
|
|
97
114
|
});
|
|
98
115
|
});
|
|
99
116
|
useEffect(function () {
|
|
100
|
-
var
|
|
117
|
+
var tid = context.$subscriber(context.topics.COMPONENT_ACTIVE).on(function (payload) {
|
|
101
118
|
setActiveTabKey('attrs');
|
|
102
|
-
if (!payload.
|
|
119
|
+
if (!payload.target) {
|
|
103
120
|
setActiveNode(null);
|
|
104
121
|
return;
|
|
105
122
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
node =
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
123
|
+
if (isString(payload.target)) {
|
|
124
|
+
var component = context.componentMap.get(payload.target);
|
|
125
|
+
var node = component.api.getSelfData();
|
|
126
|
+
var levelNodes = takeRight(component.api.getLevelNodes(), 4);
|
|
127
|
+
setActiveNode({
|
|
128
|
+
node: node.props,
|
|
129
|
+
level: levelNodes
|
|
130
|
+
});
|
|
131
|
+
} else {
|
|
132
|
+
var _component = payload.target.element.getAttribute('data-__component');
|
|
133
|
+
var ancestor = context.componentMap.get(payload.target.ancestorId);
|
|
134
|
+
var _levelNodes = takeRight(ancestor.api.getLevelNodes(), 3);
|
|
135
|
+
setActiveNode({
|
|
136
|
+
node: {
|
|
137
|
+
id: payload.target.id,
|
|
138
|
+
component: _component
|
|
139
|
+
},
|
|
140
|
+
level: [].concat(_toConsumableArray(_levelNodes), [{
|
|
141
|
+
id: payload.target.id,
|
|
142
|
+
name: payload.target.label
|
|
143
|
+
}]),
|
|
144
|
+
$target: payload.target
|
|
145
|
+
});
|
|
146
|
+
}
|
|
114
147
|
}).watch();
|
|
115
148
|
return function () {
|
|
116
|
-
return context.$unsubscriber(context.topics.COMPONENT_ACTIVE,
|
|
149
|
+
return context.$unsubscriber(context.topics.COMPONENT_ACTIVE, tid);
|
|
117
150
|
};
|
|
118
151
|
}, []);
|
|
119
152
|
useLayoutEffect(function () {
|
|
@@ -128,16 +161,16 @@ var Panel = function Panel() {
|
|
|
128
161
|
style: {
|
|
129
162
|
fontSize: 12
|
|
130
163
|
}
|
|
131
|
-
}, activeNode === null || activeNode === void 0 ? void 0 : activeNode.level.map(function (
|
|
132
|
-
var id =
|
|
133
|
-
name =
|
|
164
|
+
}, activeNode === null || activeNode === void 0 ? void 0 : activeNode.level.map(function (_ref2) {
|
|
165
|
+
var id = _ref2.id,
|
|
166
|
+
name = _ref2.name;
|
|
134
167
|
return /*#__PURE__*/React.createElement(Breadcrumb.Item, {
|
|
135
168
|
key: id,
|
|
136
169
|
className: classNames(_defineProperty({}, styles['active-node-level'], id !== activeNode.node.id)),
|
|
137
170
|
onMouseEnter: function onMouseEnter() {
|
|
138
171
|
if (id === activeNode.node.id) return;
|
|
139
172
|
context.$publisher(context.topics.COMPONENT_HOVER, {
|
|
140
|
-
|
|
173
|
+
target: id
|
|
141
174
|
});
|
|
142
175
|
},
|
|
143
176
|
onMouseLeave: function onMouseLeave() {
|
|
@@ -147,7 +180,7 @@ var Panel = function Panel() {
|
|
|
147
180
|
onClick: function onClick() {
|
|
148
181
|
if (id === activeNode.node.id) return;
|
|
149
182
|
context.$publisher(context.topics.COMPONENT_ACTIVE, {
|
|
150
|
-
|
|
183
|
+
target: id
|
|
151
184
|
});
|
|
152
185
|
}
|
|
153
186
|
}, name);
|
|
@@ -177,21 +210,26 @@ var Panel = function Panel() {
|
|
|
177
210
|
ref: underLineRef,
|
|
178
211
|
className: styles.underline
|
|
179
212
|
})), activeTabKey === _TAB_LIST_[0].key && /*#__PURE__*/React.createElement(AttrsPanel, {
|
|
213
|
+
key: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node.id,
|
|
214
|
+
nodeId: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node.id,
|
|
215
|
+
ancestorId: activeNode === null || activeNode === void 0 || (_activeNode$$target = activeNode.$target) === null || _activeNode$$target === void 0 ? void 0 : _activeNode$$target.ancestorId,
|
|
180
216
|
meta: meta,
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
return handleChange(field, value, repositioning);
|
|
217
|
+
onChange: function onChange(field, value, params) {
|
|
218
|
+
return handleChange(field, value, params);
|
|
184
219
|
}
|
|
185
220
|
}), activeTabKey === _TAB_LIST_[1].key && /*#__PURE__*/React.createElement(StylePanel, {
|
|
186
|
-
|
|
221
|
+
key: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node.id,
|
|
222
|
+
nodeId: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node.id,
|
|
187
223
|
onChange: function onChange(_, newCss) {
|
|
188
224
|
return handleChange('css', newCss);
|
|
189
225
|
}
|
|
190
226
|
}), activeTabKey === _TAB_LIST_[2].key && /*#__PURE__*/React.createElement(AdvancePanel, {
|
|
227
|
+
key: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node.id,
|
|
228
|
+
nodeId: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node.id,
|
|
229
|
+
target: activeNode === null || activeNode === void 0 ? void 0 : activeNode.$target,
|
|
191
230
|
meta: meta,
|
|
192
|
-
value: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node.advance,
|
|
193
231
|
onChange: function onChange(val) {
|
|
194
|
-
return handleChange('advance', val);
|
|
232
|
+
return handleChange(isNil(activeNode.$target) ? 'advance' : "".concat(activeNode.$target.keyPath, ".advance"), val);
|
|
195
233
|
}
|
|
196
234
|
}), /*#__PURE__*/React.createElement("div", {
|
|
197
235
|
className: classNames(styles['lc-painter-panel-empty'], _defineProperty({}, styles.hidden, !!activeNode))
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
3
|
import React, { useRef, useState } from 'react';
|
|
5
|
-
import { useMemoizedFn, useLatest, useCreation, useMap, useUpdateEffect } from 'ahooks';
|
|
4
|
+
import { useMemoizedFn, useLatest, useCreation, useMap, useUpdateEffect, useDebounceFn } from 'ahooks';
|
|
6
5
|
import { Modal, Icon, Input, Checkbox, Tooltip } from 'luck-design/antd';
|
|
7
6
|
import classNames from 'classnames';
|
|
8
|
-
import {
|
|
7
|
+
import { reduce } from 'lodash';
|
|
9
8
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
10
9
|
import { useRemoteSource } from "../../engine/provider/ContextProvider";
|
|
11
10
|
import { useContext } from "../../engine/provider/ContextProvider";
|
|
12
11
|
import JSEditor from "./code-editor/JSEditor";
|
|
13
|
-
import JsonEditor from "./code-editor/JsonEditor";
|
|
14
12
|
import styles from "../style/action-bind-modal.less";
|
|
15
13
|
var _I18N_PREFIX_ = 'luckda.lowcode.painter.actionBindModal';
|
|
16
14
|
var _ACTION_CATEGORY_ = [{
|
|
@@ -32,10 +30,11 @@ var _ACTION_CATEGORY_ = [{
|
|
|
32
30
|
label: '自定义动作'
|
|
33
31
|
})
|
|
34
32
|
}];
|
|
35
|
-
var _DEFAULT_JSON_CODE_ = '{"
|
|
33
|
+
var _DEFAULT_JSON_CODE_ = '{"params":{},"data":{}}';
|
|
36
34
|
var _DEFAULT_JS_CODE_ = 'function todo() {\n\n}';
|
|
37
35
|
var ActionBindModal = function ActionBindModal(_ref) {
|
|
38
|
-
var
|
|
36
|
+
var nodeId = _ref.nodeId,
|
|
37
|
+
event = _ref.event,
|
|
39
38
|
_ref$defaultCode = _ref.defaultCode,
|
|
40
39
|
defaultCode = _ref$defaultCode === void 0 ? _DEFAULT_JS_CODE_ : _ref$defaultCode,
|
|
41
40
|
onComfirm = _ref.onComfirm,
|
|
@@ -82,7 +81,7 @@ var ActionBindModal = function ActionBindModal(_ref) {
|
|
|
82
81
|
target = _ref3[1];
|
|
83
82
|
ret.push({
|
|
84
83
|
key: key,
|
|
85
|
-
label: "".concat(target.api.
|
|
84
|
+
label: "".concat(target.api.getSelfData().props.name, "(").concat(key, ")")
|
|
86
85
|
});
|
|
87
86
|
return ret;
|
|
88
87
|
}, []);
|
|
@@ -99,28 +98,30 @@ var ActionBindModal = function ActionBindModal(_ref) {
|
|
|
99
98
|
}, [category]);
|
|
100
99
|
useUpdateEffect(function () {
|
|
101
100
|
if (activeKey) {
|
|
101
|
+
var _editorRef$current;
|
|
102
102
|
var action = get(activeKey);
|
|
103
|
-
editorRef.current.editor.setValue(action.code);
|
|
103
|
+
(_editorRef$current = editorRef.current) === null || _editorRef$current === void 0 || _editorRef$current.editor.setValue(action === null || action === void 0 ? void 0 : action.code);
|
|
104
104
|
}
|
|
105
|
-
}, [activeKey]);
|
|
105
|
+
}, [category, activeKey]);
|
|
106
106
|
useUpdateEffect(function () {
|
|
107
107
|
setAll(event === null || event === void 0 ? void 0 : event.actionPool);
|
|
108
108
|
}, [event]);
|
|
109
|
-
var
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
109
|
+
var _useDebounceFn = useDebounceFn(function (code) {
|
|
110
|
+
if (latestActiveKey.current) {
|
|
111
|
+
var action = get(latestActiveKey.current);
|
|
112
|
+
action.code = code;
|
|
113
|
+
}
|
|
114
|
+
}, {
|
|
115
|
+
wait: 500
|
|
116
|
+
}),
|
|
117
|
+
handleEditorValueChange = _useDebounceFn.run;
|
|
115
118
|
var handleOptionClick = useMemoizedFn(function (key) {
|
|
116
119
|
setActiveKey(key);
|
|
117
120
|
var action;
|
|
118
121
|
if (actionPool.has(key)) {
|
|
119
122
|
action = get(key);
|
|
120
123
|
} else {
|
|
121
|
-
var code = category === 'custom' ?
|
|
122
|
-
moduleCode: module.moduleCode
|
|
123
|
-
}, JSON.parse(_DEFAULT_JSON_CODE_)), null, '\t');
|
|
124
|
+
var code = event.func || (category === 'custom' ? defaultCode : "".concat(defaultCode.slice(0, -1), "\n\treturn ").concat(_DEFAULT_JSON_CODE_, " \n}"));
|
|
124
125
|
action = {
|
|
125
126
|
category: category,
|
|
126
127
|
key: key,
|
|
@@ -134,9 +135,7 @@ var ActionBindModal = function ActionBindModal(_ref) {
|
|
|
134
135
|
if (activeKey !== key) {
|
|
135
136
|
setActiveKey(key);
|
|
136
137
|
}
|
|
137
|
-
var code = category === 'custom' ?
|
|
138
|
-
moduleCode: module.moduleCode
|
|
139
|
-
}, JSON.parse(_DEFAULT_JSON_CODE_)), null, '\t');
|
|
138
|
+
var code = event.func || (category === 'custom' ? defaultCode : "".concat(defaultCode.slice(0, -1), "\n\treturn ").concat(_DEFAULT_JSON_CODE_, " \n}"));
|
|
140
139
|
set(key, {
|
|
141
140
|
category: category,
|
|
142
141
|
key: key,
|
|
@@ -166,9 +165,9 @@ var ActionBindModal = function ActionBindModal(_ref) {
|
|
|
166
165
|
marginTop: 0,
|
|
167
166
|
padding: '4px 24px'
|
|
168
167
|
},
|
|
169
|
-
title: event === null || event === void 0 ? void 0 : event.name,
|
|
168
|
+
title: "".concat(event === null || event === void 0 ? void 0 : event.name, "(").concat(nodeId, ")"),
|
|
170
169
|
visible: !!event,
|
|
171
|
-
width:
|
|
170
|
+
width: "70vw",
|
|
172
171
|
closable: false,
|
|
173
172
|
maskClosable: false,
|
|
174
173
|
getContainer: function getContainer() {
|
|
@@ -196,7 +195,19 @@ var ActionBindModal = function ActionBindModal(_ref) {
|
|
|
196
195
|
className: classNames(_defineProperty({}, styles.active, key === category)),
|
|
197
196
|
onClick: function onClick() {
|
|
198
197
|
setCategory(key);
|
|
199
|
-
|
|
198
|
+
if ('custom' === key) {
|
|
199
|
+
var _activeKey = 'coding';
|
|
200
|
+
setActiveKey(_activeKey);
|
|
201
|
+
if (!actionPool.has(_activeKey)) {
|
|
202
|
+
set(_activeKey, {
|
|
203
|
+
category: key,
|
|
204
|
+
key: _activeKey,
|
|
205
|
+
code: event.func || defaultCode
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
} else {
|
|
209
|
+
setActiveKey(void 0);
|
|
210
|
+
}
|
|
200
211
|
}
|
|
201
212
|
}, label, key === category && /*#__PURE__*/React.createElement(Icon, {
|
|
202
213
|
type: "check",
|
|
@@ -271,9 +282,9 @@ var ActionBindModal = function ActionBindModal(_ref) {
|
|
|
271
282
|
type: "exclamation-circle"
|
|
272
283
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
273
284
|
className: styles['code-box']
|
|
274
|
-
}, activeKey ? /*#__PURE__*/React.createElement(
|
|
285
|
+
}, activeKey ? /*#__PURE__*/React.createElement(JSEditor, {
|
|
275
286
|
ref: editorRef,
|
|
276
|
-
onChange: handleEditorValueChange
|
|
287
|
+
onChange: handleEditorValueChange
|
|
277
288
|
}) : formatMessage({
|
|
278
289
|
id: "".concat(_I18N_PREFIX_, ".noActionSelected"),
|
|
279
290
|
label: '请在右侧选择行为项'
|
|
@@ -284,7 +295,7 @@ var ActionBindModal = function ActionBindModal(_ref) {
|
|
|
284
295
|
className: styles['code-box']
|
|
285
296
|
}, activeKey ? /*#__PURE__*/React.createElement(JSEditor, {
|
|
286
297
|
ref: editorRef,
|
|
287
|
-
onChange: handleEditorValueChange
|
|
298
|
+
onChange: handleEditorValueChange
|
|
288
299
|
}) : formatMessage({
|
|
289
300
|
id: "".concat(_I18N_PREFIX_, ".noActionSelected"),
|
|
290
301
|
label: '请在右侧选择行为项'
|
|
@@ -8,7 +8,8 @@ import React, { useState } from 'react';
|
|
|
8
8
|
import { useCreation, useMemoizedFn } from 'ahooks';
|
|
9
9
|
import { Menu, Dropdown, Button, Tooltip, Icon } from 'luck-design/antd';
|
|
10
10
|
import styled from 'styled-components';
|
|
11
|
-
import { keyBy, keys, omit } from 'lodash';
|
|
11
|
+
import { isNil, keyBy, keys, omit, reduce } from 'lodash';
|
|
12
|
+
import { useGet } from "../../engine/provider/ContextProvider";
|
|
12
13
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
13
14
|
import Collapse from "./Collapse";
|
|
14
15
|
import ActionBindModal from "./ActionBindModal";
|
|
@@ -19,8 +20,16 @@ var EventItem = styled.div.withConfig({
|
|
|
19
20
|
})(["display:flex;align-items:center;justify-content:space-between;padding:4px 8px;border:1px solid #e5e6e8;border-radius:6px;margin-bottom:6px;font-size:12px;i{color:rgba(0,0,0,0.4);cursor:pointer;}i:not(:last-child){margin-right:6px;}"]);
|
|
20
21
|
var AdvancePanel = function AdvancePanel(_ref) {
|
|
21
22
|
var meta = _ref.meta,
|
|
22
|
-
|
|
23
|
+
nodeId = _ref.nodeId,
|
|
24
|
+
target = _ref.target,
|
|
23
25
|
onChange = _ref.onChange;
|
|
26
|
+
var value = useGet(isNil(target) ? {
|
|
27
|
+
id: nodeId,
|
|
28
|
+
path: 'props.advance'
|
|
29
|
+
} : {
|
|
30
|
+
id: target.ancestorId,
|
|
31
|
+
path: "props.".concat(target.keyPath, ".advance")
|
|
32
|
+
});
|
|
24
33
|
var _useState = useState((value === null || value === void 0 ? void 0 : value.events) || {}),
|
|
25
34
|
_useState2 = _slicedToArray(_useState, 2),
|
|
26
35
|
events = _useState2[0],
|
|
@@ -66,24 +75,28 @@ var AdvancePanel = function AdvancePanel(_ref) {
|
|
|
66
75
|
style: {
|
|
67
76
|
fontSize: 12
|
|
68
77
|
}
|
|
69
|
-
}, (_meta$advance2 = meta.advance) === null || _meta$advance2 === void 0
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
78
|
+
}, reduce((_meta$advance2 = meta.advance) === null || _meta$advance2 === void 0 ? void 0 : _meta$advance2.events, function (ret, event) {
|
|
79
|
+
var _value$events;
|
|
80
|
+
if (!(value !== null && value !== void 0 && (_value$events = value.events) !== null && _value$events !== void 0 && _value$events[event.key])) {
|
|
81
|
+
ret.push( /*#__PURE__*/React.createElement(Menu.Item, {
|
|
82
|
+
key: event.key,
|
|
83
|
+
payload: event
|
|
84
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
85
|
+
title: event.desc || event.name,
|
|
86
|
+
placement: "left",
|
|
87
|
+
getPopupContainer: function getPopupContainer() {
|
|
88
|
+
return document.getElementById('lc-design-workspace');
|
|
89
|
+
}
|
|
90
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
91
|
+
style: {
|
|
92
|
+
width: '100%',
|
|
93
|
+
fontSize: 12
|
|
94
|
+
}
|
|
95
|
+
}, event.name))));
|
|
96
|
+
}
|
|
97
|
+
return ret;
|
|
98
|
+
}, []));
|
|
99
|
+
}, [value]);
|
|
87
100
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Collapse, {
|
|
88
101
|
field: "events",
|
|
89
102
|
label: formatMessage({
|
|
@@ -94,7 +107,9 @@ var AdvancePanel = function AdvancePanel(_ref) {
|
|
|
94
107
|
padding: '12px 16px'
|
|
95
108
|
}
|
|
96
109
|
}, keys(events).map(function (ek) {
|
|
97
|
-
return /*#__PURE__*/React.createElement(EventItem,
|
|
110
|
+
return /*#__PURE__*/React.createElement(EventItem, {
|
|
111
|
+
key: ek
|
|
112
|
+
}, /*#__PURE__*/React.createElement("span", null, metaMap[ek].name), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
98
113
|
title: formatMessage({
|
|
99
114
|
id: 'luckda.lowcode.painter.edit',
|
|
100
115
|
label: '编辑'
|
|
@@ -130,6 +145,7 @@ var AdvancePanel = function AdvancePanel(_ref) {
|
|
|
130
145
|
id: "".concat(_I18N_PREFIX_, ".addEventAction"),
|
|
131
146
|
label: '添加事件动作'
|
|
132
147
|
})))), /*#__PURE__*/React.createElement(ActionBindModal, {
|
|
148
|
+
nodeId: nodeId,
|
|
133
149
|
event: event,
|
|
134
150
|
onComfirm: handleComfirm,
|
|
135
151
|
onClose: function onClose() {
|
|
@@ -8,7 +8,7 @@ import { useBoolean, useCreation, useMemoizedFn } from 'ahooks';
|
|
|
8
8
|
import { Drawer, Icon } from 'luck-design/antd';
|
|
9
9
|
import classNames from 'classnames';
|
|
10
10
|
import { startsWith, isNil, get } from 'lodash';
|
|
11
|
-
import {
|
|
11
|
+
import { useGet } from "../../engine/provider/ContextProvider";
|
|
12
12
|
import PanelItemFactory from "../../engine/factory/panel-item-factory";
|
|
13
13
|
import PanelItem from "./PanelItem";
|
|
14
14
|
import Collapse from "./Collapse";
|
|
@@ -16,7 +16,8 @@ import styles from "../style/panel-attrs.less";
|
|
|
16
16
|
var AttrsPanel = function AttrsPanel(_ref) {
|
|
17
17
|
var _nextRef$current2, _nextRef$current3;
|
|
18
18
|
var meta = _ref.meta,
|
|
19
|
-
|
|
19
|
+
nodeId = _ref.nodeId,
|
|
20
|
+
ancestorId = _ref.ancestorId,
|
|
20
21
|
onChange = _ref.onChange;
|
|
21
22
|
var nextRef = useRef(null);
|
|
22
23
|
var factory = useRef(new PanelItemFactory());
|
|
@@ -26,10 +27,18 @@ var AttrsPanel = function AttrsPanel(_ref) {
|
|
|
26
27
|
_useBoolean2$ = _useBoolean2[1],
|
|
27
28
|
setTrue = _useBoolean2$.setTrue,
|
|
28
29
|
setFalse = _useBoolean2$.setFalse;
|
|
29
|
-
var
|
|
30
|
-
|
|
30
|
+
var node = useGet({
|
|
31
|
+
id: isNil(ancestorId) ? nodeId : ancestorId,
|
|
32
|
+
path: 'props'
|
|
33
|
+
});
|
|
34
|
+
var handleChange = useMemoizedFn(function (field, val, _ref2) {
|
|
31
35
|
var _nextRef$current;
|
|
32
|
-
|
|
36
|
+
var repositioning = _ref2.repositioning,
|
|
37
|
+
before = _ref2.before;
|
|
38
|
+
onChange(field, val, {
|
|
39
|
+
repositioning: repositioning,
|
|
40
|
+
before: before
|
|
41
|
+
});
|
|
33
42
|
if ((_nextRef$current = nextRef.current) !== null && _nextRef$current !== void 0 && _nextRef$current.autoClose) {
|
|
34
43
|
setFalse();
|
|
35
44
|
}
|
|
@@ -44,55 +53,57 @@ var AttrsPanel = function AttrsPanel(_ref) {
|
|
|
44
53
|
setTrue();
|
|
45
54
|
});
|
|
46
55
|
var renderPanelItems = useMemoizedFn(function (items, dynamicProps) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
repositioning = _ref2.repositioning,
|
|
61
|
-
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
56
|
+
return items.map(function (_ref3) {
|
|
57
|
+
var type = _ref3.type,
|
|
58
|
+
key = _ref3.key,
|
|
59
|
+
valueKey = _ref3.valueKey,
|
|
60
|
+
name = _ref3.name,
|
|
61
|
+
desc = _ref3.desc,
|
|
62
|
+
defaultValue = _ref3.default,
|
|
63
|
+
props = _ref3.props,
|
|
64
|
+
wrapper = _ref3.wrapper,
|
|
65
|
+
wrapperProps = _ref3.wrapperProps,
|
|
66
|
+
next = _ref3.next,
|
|
67
|
+
repositioning = _ref3.repositioning,
|
|
68
|
+
rest = _objectWithoutProperties(_ref3, _excluded);
|
|
62
69
|
var Comp = factory.current.getPanelItemFor(startsWith(type, '_') ? 'dynamic' : type, type);
|
|
70
|
+
var _valueKey = (dynamicProps === null || dynamicProps === void 0 ? void 0 : dynamicProps.valueKey) || valueKey;
|
|
63
71
|
if (type === 'group') {
|
|
64
72
|
return /*#__PURE__*/React.createElement(Comp, {
|
|
65
|
-
nodeId:
|
|
73
|
+
nodeId: nodeId,
|
|
66
74
|
key: key,
|
|
67
75
|
field: key,
|
|
68
76
|
label: name,
|
|
69
|
-
next:
|
|
70
|
-
return goNext(
|
|
77
|
+
next: next ? function (_dp) {
|
|
78
|
+
return goNext(next, _dp);
|
|
71
79
|
} : null,
|
|
72
80
|
defaultCollapsed: defaultValue,
|
|
73
81
|
desc: desc
|
|
74
82
|
}, renderPanelItems(props || [], dynamicProps));
|
|
75
83
|
}
|
|
76
|
-
var _originalVal = get(node
|
|
84
|
+
var _originalVal = get(node, _valueKey || key);
|
|
77
85
|
var comp = Comp && /*#__PURE__*/React.createElement(Comp, _extends({
|
|
78
|
-
nodeId:
|
|
86
|
+
nodeId: nodeId,
|
|
79
87
|
key: key,
|
|
80
88
|
defaultValue: isNil(_originalVal) ? defaultValue : _originalVal,
|
|
81
|
-
next: function
|
|
82
|
-
return goNext(
|
|
83
|
-
},
|
|
84
|
-
onChange: function onChange(val) {
|
|
85
|
-
return handleChange(
|
|
89
|
+
next: next !== null && next !== void 0 && next.props ? function (_dp) {
|
|
90
|
+
return goNext(next, _dp);
|
|
91
|
+
} : null,
|
|
92
|
+
onChange: function onChange(val, before) {
|
|
93
|
+
return handleChange(_valueKey || key, val, {
|
|
94
|
+
repositioning: repositioning,
|
|
95
|
+
before: before
|
|
96
|
+
});
|
|
86
97
|
},
|
|
87
98
|
size: "small",
|
|
88
|
-
settings: node
|
|
99
|
+
settings: node,
|
|
89
100
|
renderPanelItems: renderPanelItems
|
|
90
101
|
}, rest, dynamicProps));
|
|
91
102
|
if (wrapper === 'hidden') return comp;
|
|
92
103
|
var Wrapper = wrapper === 'collapse' ? Collapse : PanelItem;
|
|
93
104
|
return /*#__PURE__*/React.createElement(Wrapper, _extends({
|
|
94
105
|
key: key,
|
|
95
|
-
nodeId:
|
|
106
|
+
nodeId: nodeId,
|
|
96
107
|
field: key,
|
|
97
108
|
label: name,
|
|
98
109
|
desc: desc
|
|
@@ -105,7 +116,7 @@ var AttrsPanel = function AttrsPanel(_ref) {
|
|
|
105
116
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
106
117
|
}
|
|
107
118
|
return renderPanelItems(meta.props);
|
|
108
|
-
}, [
|
|
119
|
+
}, [nodeId]);
|
|
109
120
|
useEffect(function () {
|
|
110
121
|
if (!open) {
|
|
111
122
|
nextRef.current = null;
|
|
@@ -113,7 +124,7 @@ var AttrsPanel = function AttrsPanel(_ref) {
|
|
|
113
124
|
}, [open]);
|
|
114
125
|
return /*#__PURE__*/React.createElement("div", {
|
|
115
126
|
id: "lc-painter-panel-attrs-container",
|
|
116
|
-
className: classNames(styles['lc-painter-panel-attrs'], _defineProperty(_defineProperty({}, styles.hidden, !
|
|
127
|
+
className: classNames(styles['lc-painter-panel-attrs'], _defineProperty(_defineProperty({}, styles.hidden, !nodeId), styles.showNext, open))
|
|
117
128
|
}, PropsComps, /*#__PURE__*/React.createElement(Drawer, {
|
|
118
129
|
visible: open,
|
|
119
130
|
width: 320,
|
|
@@ -61,7 +61,7 @@ export default function (_ref) {
|
|
|
61
61
|
}
|
|
62
62
|
function pubEvent(event, eventName, ctx) {
|
|
63
63
|
if (event.active && event.over && event.active.data.current.id !== event.over.data.current.id) {
|
|
64
|
-
var parentNode = ctx.componentMap.get(event.over.data.current.id).api.
|
|
64
|
+
var parentNode = ctx.componentMap.get(event.over.data.current.id).api.getSelfAndParentData().parent;
|
|
65
65
|
|
|
66
66
|
// console.log('event.over.data.current.type', event.over.data.current.type)
|
|
67
67
|
var actionSide = getAction(event.over.data.current.type, event.over.data.current.component.component, event.active.rect.current.translated, event.over.rect, parentNode);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import { cloneElement, useEffect } from 'react';
|
|
3
|
+
import { useCreation } from 'ahooks';
|
|
3
4
|
import { useDraggable, useDroppable } from '@dnd-kit/core';
|
|
4
5
|
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
5
|
-
import { useCreation } from 'ahooks';
|
|
6
6
|
import { Action } from "./DragDropContext";
|
|
7
7
|
import { NO_DRAGABLE, NO_DROPABLE } from "../../../constants";
|
|
8
8
|
export default function (_ref) {
|
|
@@ -33,6 +33,9 @@ export default function (_ref) {
|
|
|
33
33
|
}
|
|
34
34
|
}),
|
|
35
35
|
setDropRef = _useDroppable.setNodeRef;
|
|
36
|
+
var _memoListeners = useCreation(function () {
|
|
37
|
+
return listeners;
|
|
38
|
+
}, []);
|
|
36
39
|
useEffect(function () {
|
|
37
40
|
var dom = getTargetDom();
|
|
38
41
|
if (dom) {
|
|
@@ -41,7 +44,7 @@ export default function (_ref) {
|
|
|
41
44
|
}
|
|
42
45
|
}, []);
|
|
43
46
|
var comp = useCreation(function () {
|
|
44
|
-
return /*#__PURE__*/cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props),
|
|
47
|
+
return /*#__PURE__*/cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), _memoListeners), attributes));
|
|
45
48
|
}, [id, children]);
|
|
46
49
|
return comp;
|
|
47
50
|
}
|