@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
|
@@ -11,12 +11,13 @@ var BlockEditorItem = function BlockEditorItem(_ref) {
|
|
|
11
11
|
style = _ref.style,
|
|
12
12
|
setActivatorNodeRef = _ref.setActivatorNodeRef,
|
|
13
13
|
attributes = _ref.attributes,
|
|
14
|
-
listeners = _ref.listeners
|
|
14
|
+
listeners = _ref.listeners,
|
|
15
|
+
draggable = _ref.draggable;
|
|
15
16
|
return /*#__PURE__*/React.createElement("div", {
|
|
16
17
|
ref: setNodeRef,
|
|
17
18
|
style: style
|
|
18
19
|
}, /*#__PURE__*/React.createElement(Collapse, {
|
|
19
|
-
label: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", _extends({
|
|
20
|
+
label: /*#__PURE__*/React.createElement("div", null, draggable ? /*#__PURE__*/React.createElement("span", _extends({
|
|
20
21
|
ref: setActivatorNodeRef
|
|
21
22
|
}, attributes, listeners), /*#__PURE__*/React.createElement("svg", {
|
|
22
23
|
fill: "currentColor",
|
|
@@ -29,7 +30,7 @@ var BlockEditorItem = function BlockEditorItem(_ref) {
|
|
|
29
30
|
}
|
|
30
31
|
}, /*#__PURE__*/React.createElement("path", {
|
|
31
32
|
d: "M0.499972716,6 L1.50002728,6 C1.77615459,6 2,6.22384541 2,6.49997272 C2,6.77610002 1.77615459,6.99994543 1.50002728,6.99994543 L0.499972716,6.99994543 C0.22384541,6.99994543 3.38158422e-17,6.77610002 0,6.49997272 C-3.38158422e-17,6.22384541 0.22384541,6 0.499972716,6 Z M0.499972716,3 L1.50002728,3 C1.77615459,3 2,3.22384541 2,3.49997272 C2,3.77610002 1.77615459,3.99994543 1.50002728,3.99994543 L0.499972716,3.99994543 C0.22384541,3.99994543 3.38158422e-17,3.77610002 0,3.49997272 C-3.38158422e-17,3.22384541 0.22384541,3 0.499972716,3 Z M0.499972716,7.28787148e-18 L1.50002728,5.55666624e-14 C1.77615459,7.07214574e-14 2,0.22384541 2,0.499972716 C2,0.776100022 1.77615459,0.999945432 1.50002728,0.999945432 L0.499972716,0.999945432 C0.22384541,0.999945432 3.38158422e-17,0.776100022 0,0.499972716 C-3.38158422e-17,0.22384541 0.22384541,5.0723721e-17 0.499972716,0 Z M0.5,9.00002729 L1.5,9.00002729 C1.77614237,9.00002729 2,9.22388491 2,9.50002729 C2,9.77616966 1.77614237,10.0000273 1.5,10.0000273 L0.5,10.0000273 C0.223857625,10.0000273 3.38176876e-17,9.77616966 0,9.50002729 C-3.38176876e-17,9.22388491 0.223857625,9.00002729 0.5,9.00002729 Z M0.5,12.0000273 L1.5,12.0000273 C1.77614237,12.0000273 2,12.2238849 2,12.5000273 C2,12.7761697 1.77614237,13.0000273 1.5,13.0000273 L0.5,13.0000273 C0.223857625,13.0000273 3.38176876e-17,12.7761697 0,12.5000273 C-3.38176876e-17,12.2238849 0.223857625,12.0000273 0.5,12.0000273 Z M0.5,15.0000273 L1.5,15.0000273 C1.77614237,15.0000273 2,15.2238849 2,15.5000273 C2,15.7761697 1.77614237,16.0000273 1.5,16.0000273 L0.5,16.0000273 C0.223857625,16.0000273 3.38176876e-17,15.7761697 0,15.5000273 C-3.38176876e-17,15.2238849 0.223857625,15.0000273 0.5,15.0000273 Z M3.49997272,6 L4.50002728,6 C4.77615459,6 5,6.22384541 5,6.49997272 C5,6.77610002 4.77615459,6.99994543 4.50002728,6.99994543 L3.49997272,6.99994543 C3.22384541,6.99994543 3,6.77610002 3,6.49997272 C3,6.22384541 3.22384541,6 3.49997272,6 Z M3.49997272,3 L4.50002728,3 C4.77615459,3 5,3.22384541 5,3.49997272 C5,3.77610002 4.77615459,3.99994543 4.50002728,3.99994543 L3.49997272,3.99994543 C3.22384541,3.99994543 3,3.77610002 3,3.49997272 C3,3.22384541 3.22384541,3 3.49997272,3 Z M3.49997272,7.28787148e-18 L4.50002728,5.55666624e-14 C4.77615459,7.07214574e-14 5,0.22384541 5,0.499972716 C5,0.776100022 4.77615459,0.999945432 4.50002728,0.999945432 L3.49997272,0.999945432 C3.22384541,0.999945432 3,0.776100022 3,0.499972716 C3,0.22384541 3.22384541,5.0723721e-17 3.49997272,0 Z M3.5,9.00002729 L4.5,9.00002729 C4.77614237,9.00002729 5,9.22388491 5,9.50002729 C5,9.77616966 4.77614237,10.0000273 4.5,10.0000273 L3.5,10.0000273 C3.22385763,10.0000273 3,9.77616966 3,9.50002729 C3,9.22388491 3.22385763,9.00002729 3.5,9.00002729 Z M3.5,12.0000273 L4.5,12.0000273 C4.77614237,12.0000273 5,12.2238849 5,12.5000273 C5,12.7761697 4.77614237,13.0000273 4.5,13.0000273 L3.5,13.0000273 C3.22385763,13.0000273 3,12.7761697 3,12.5000273 C3,12.2238849 3.22385763,12.0000273 3.5,12.0000273 Z M3.5,15.0000273 L4.5,15.0000273 C4.77614237,15.0000273 5,15.2238849 5,15.5000273 C5,15.7761697 4.77614237,16.0000273 4.5,16.0000273 L3.5,16.0000273 C3.22385763,16.0000273 3,15.7761697 3,15.5000273 C3,15.2238849 3.22385763,15.0000273 3.5,15.0000273 Z"
|
|
32
|
-
}))), name),
|
|
33
|
+
}))) : null, name),
|
|
33
34
|
extraRender: isNil(onDelete) ? false : function () {
|
|
34
35
|
return /*#__PURE__*/React.createElement(Icon, {
|
|
35
36
|
type: "delete",
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
1
2
|
import _toArray from "@babel/runtime/helpers/esm/toArray";
|
|
2
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { useMemoizedFn, useCreation } from 'ahooks';
|
|
6
6
|
import { Icon, Dropdown, Button, Menu, Modal } from 'luck-design/antd';
|
|
7
|
-
import { concat, reduce } from 'lodash';
|
|
7
|
+
import { concat, reduce, sortBy, includes, cloneDeep } from 'lodash';
|
|
8
8
|
import { formatMessage, suid } from '@luck-design-biz/base/utils';
|
|
9
|
-
import {
|
|
9
|
+
import { useGet } from "../../../engine/provider/ContextProvider";
|
|
10
10
|
import { SortBox, SortItem } from "../../components/SortBox";
|
|
11
11
|
import BlockEditorItem from "./BlockEditorItem";
|
|
12
12
|
import defaultMeta from "../../../engine/meta/form.props.default.json";
|
|
13
|
-
import { includes } from 'lodash';
|
|
14
13
|
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel-section.blocksEditor';
|
|
15
14
|
var confirm = Modal.confirm;
|
|
16
15
|
var addOptions = [{
|
|
@@ -49,24 +48,21 @@ var BlockEditor = function BlockEditor(_ref) {
|
|
|
49
48
|
nodeId = _ref.nodeId,
|
|
50
49
|
renderPanelItems = _ref.renderPanelItems,
|
|
51
50
|
innerProps = _ref.innerProps;
|
|
52
|
-
var
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
node = _usePageData2[0];
|
|
57
|
-
var _ref2 = node || {
|
|
58
|
-
props: {}
|
|
59
|
-
},
|
|
60
|
-
blocks = _ref2.props.blocks;
|
|
51
|
+
var blocks = useGet({
|
|
52
|
+
id: nodeId,
|
|
53
|
+
path: 'props.blocks'
|
|
54
|
+
});
|
|
61
55
|
var handleAddBlock = useMemoizedFn(function (type) {
|
|
62
56
|
var _id = "block_".concat(suid());
|
|
63
|
-
var newData = concat(blocks, _objectSpread({
|
|
57
|
+
var newData = concat(blocks, _objectSpread(_objectSpread({
|
|
64
58
|
id: _id,
|
|
65
59
|
name: _id,
|
|
66
60
|
type: type,
|
|
67
61
|
serialEffect: 'hidden',
|
|
68
62
|
mode: ['add', 'update', 'edit', 'info']
|
|
69
|
-
}, defaultMeta.blockSettings[type])
|
|
63
|
+
}, defaultMeta.blockSettings[type]), {}, {
|
|
64
|
+
order: blocks.length + 1
|
|
65
|
+
}));
|
|
70
66
|
onChange(newData);
|
|
71
67
|
});
|
|
72
68
|
var handleDeleteBlock = useMemoizedFn(function (_id) {
|
|
@@ -88,17 +84,33 @@ var BlockEditor = function BlockEditor(_ref) {
|
|
|
88
84
|
var newData = blocks.filter(function (val) {
|
|
89
85
|
return val.id !== _id;
|
|
90
86
|
});
|
|
91
|
-
onChange(newData)
|
|
87
|
+
onChange(newData.map(function (i, index) {
|
|
88
|
+
return _objectSpread(_objectSpread({}, i), {}, {
|
|
89
|
+
order: index + 1
|
|
90
|
+
});
|
|
91
|
+
}));
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
94
|
});
|
|
95
95
|
var handleSortBlock = useMemoizedFn(function (sortItems) {
|
|
96
|
-
|
|
96
|
+
var _blocks = _toArray(blocks),
|
|
97
|
+
mainForm = _blocks[0],
|
|
98
|
+
restForm = _blocks.slice(1);
|
|
99
|
+
var newRestForm = sortBy(restForm, function (item) {
|
|
100
|
+
var index = sortItems.indexOf(item.id);
|
|
101
|
+
return index !== -1 ? index : Infinity;
|
|
102
|
+
});
|
|
103
|
+
var newData = [mainForm].concat(_toConsumableArray(newRestForm)).map(function (i, index) {
|
|
104
|
+
return _objectSpread(_objectSpread({}, i), {}, {
|
|
105
|
+
order: index + 1
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
onChange(newData);
|
|
97
109
|
});
|
|
98
110
|
var menu = useCreation(function () {
|
|
99
111
|
return /*#__PURE__*/React.createElement(Menu, {
|
|
100
|
-
onClick: function onClick(
|
|
101
|
-
var key =
|
|
112
|
+
onClick: function onClick(_ref2) {
|
|
113
|
+
var key = _ref2.key;
|
|
102
114
|
return handleAddBlock(key);
|
|
103
115
|
}
|
|
104
116
|
}, addOptions.map(function (opt) {
|
|
@@ -130,7 +142,8 @@ var BlockEditor = function BlockEditor(_ref) {
|
|
|
130
142
|
return mainForm ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BlockEditorItem, {
|
|
131
143
|
name: renderPanelItems([_objectSpread(_objectSpread({}, specialProp), {}, {
|
|
132
144
|
valueKey: "blocks[0].".concat(specialProp.key),
|
|
133
|
-
blockName: mainForm.name
|
|
145
|
+
blockName: mainForm.name,
|
|
146
|
+
blockId: mainForm.id,
|
|
134
147
|
next: {
|
|
135
148
|
name: specialProp.name,
|
|
136
149
|
props: specialProp.next["_".concat(mainForm.type, "_props")].map(function (nextP) {
|
|
@@ -141,9 +154,13 @@ var BlockEditor = function BlockEditor(_ref) {
|
|
|
141
154
|
}
|
|
142
155
|
})])
|
|
143
156
|
}, renderPanelItems(commonProps.map(function (p) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
157
|
+
var cloneP = cloneDeep(p);
|
|
158
|
+
if (cloneP.key === 'dataset') {
|
|
159
|
+
cloneP.fieldsKey = 'blocks[0].fields';
|
|
160
|
+
}
|
|
161
|
+
return _objectSpread(_objectSpread({}, cloneP), {}, {
|
|
162
|
+
disabled: includes(['mode', 'serialEffect'], cloneP.key) || cloneP.disabled,
|
|
163
|
+
valueKey: "blocks[0].".concat(cloneP.key)
|
|
147
164
|
});
|
|
148
165
|
}))), /*#__PURE__*/React.createElement(SortBox, {
|
|
149
166
|
datas: restForm.map(function (_bk) {
|
|
@@ -151,16 +168,19 @@ var BlockEditor = function BlockEditor(_ref) {
|
|
|
151
168
|
}),
|
|
152
169
|
onChange: handleSortBlock
|
|
153
170
|
}, restForm.map(function (blockItem, i) {
|
|
171
|
+
var _specialProp$next;
|
|
154
172
|
return /*#__PURE__*/React.createElement(SortItem, {
|
|
155
173
|
key: blockItem.id,
|
|
156
174
|
id: blockItem.id
|
|
157
175
|
}, /*#__PURE__*/React.createElement(BlockEditorItem, {
|
|
176
|
+
draggable: true,
|
|
158
177
|
name: renderPanelItems([_objectSpread(_objectSpread({}, specialProp), {}, {
|
|
159
178
|
valueKey: "blocks[".concat(i + 1, "].").concat(specialProp.key),
|
|
160
|
-
blockName: blockItem.name
|
|
179
|
+
blockName: blockItem.name,
|
|
180
|
+
blockId: blockItem.id,
|
|
161
181
|
next: {
|
|
162
182
|
name: specialProp.name,
|
|
163
|
-
props: specialProp.next["_".concat(blockItem.type, "_props")].map(function (nextP) {
|
|
183
|
+
props: (_specialProp$next = specialProp.next["_".concat(blockItem.type, "_props")]) === null || _specialProp$next === void 0 ? void 0 : _specialProp$next.map(function (nextP) {
|
|
164
184
|
var _nextP$props;
|
|
165
185
|
return _objectSpread(_objectSpread({}, nextP), {}, {
|
|
166
186
|
valueKey: "blocks[".concat(i + 1, "].").concat(nextP.key),
|
|
@@ -177,9 +197,16 @@ var BlockEditor = function BlockEditor(_ref) {
|
|
|
177
197
|
return handleDeleteBlock(blockItem.id);
|
|
178
198
|
}
|
|
179
199
|
}, renderPanelItems(reduce(commonProps, function (result, p) {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
200
|
+
var cloneP = cloneDeep(p);
|
|
201
|
+
cloneP.valueKey = "blocks[".concat(i + 1, "].").concat(p.key);
|
|
202
|
+
if (p.key === 'dataset') {
|
|
203
|
+
if (includes(['auto', 'grid', 'writer'], blockItem.type)) {
|
|
204
|
+
if (blockItem.type !== 'auto') cloneP.component = 'tableForm';
|
|
205
|
+
cloneP.fieldsKey = "blocks[".concat(i + 1, "].fields");
|
|
206
|
+
;
|
|
207
|
+
result.push(cloneP);
|
|
208
|
+
}
|
|
209
|
+
} else result.push(cloneP);
|
|
183
210
|
return result;
|
|
184
211
|
}, []))));
|
|
185
212
|
})), /*#__PURE__*/React.createElement("div", {
|
|
@@ -5,10 +5,12 @@ import React from 'react';
|
|
|
5
5
|
import { Select, Button } from 'luck-design/antd';
|
|
6
6
|
import styles from "../style/button-type.less";
|
|
7
7
|
var ButtonType = function ButtonType(_ref) {
|
|
8
|
-
var
|
|
8
|
+
var _onChange = _ref.onChange,
|
|
9
9
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
10
10
|
return /*#__PURE__*/React.createElement(Select, _extends({}, props, {
|
|
11
|
-
onChange: onChange
|
|
11
|
+
onChange: function onChange(val) {
|
|
12
|
+
return _onChange(val);
|
|
13
|
+
},
|
|
12
14
|
className: styles['lc-painter-panel-section-components-buttontype']
|
|
13
15
|
}), /*#__PURE__*/React.createElement(Select.Option, {
|
|
14
16
|
value: "primary"
|
|
@@ -7,6 +7,7 @@ import styled from 'styled-components';
|
|
|
7
7
|
import { Select, Button, Tooltip } from 'luck-design/antd';
|
|
8
8
|
import { useRemoteSource } from "../../engine/provider/ContextProvider";
|
|
9
9
|
import { fetchAddDataset } from "../../constants/api-url";
|
|
10
|
+
import { getLDMetaAttr } from "../../engine/tools/helper";
|
|
10
11
|
var Div = styled.div.withConfig({
|
|
11
12
|
displayName: "Div",
|
|
12
13
|
componentId: "luckda-6530__sc-onj9tc-0"
|
|
@@ -14,6 +15,9 @@ var Div = styled.div.withConfig({
|
|
|
14
15
|
var DataSetSelector = function DataSetSelector(_ref) {
|
|
15
16
|
var defaultValue = _ref.defaultValue,
|
|
16
17
|
onChange = _ref.onChange,
|
|
18
|
+
_ref$fieldsKey = _ref.fieldsKey,
|
|
19
|
+
fieldsKey = _ref$fieldsKey === void 0 ? 'fields' : _ref$fieldsKey,
|
|
20
|
+
component = _ref.component,
|
|
17
21
|
size = _ref.size,
|
|
18
22
|
isTree = _ref.isTree,
|
|
19
23
|
next = _ref.next;
|
|
@@ -29,8 +33,7 @@ var DataSetSelector = function DataSetSelector(_ref) {
|
|
|
29
33
|
dataset = _useRemoteSource.dataset,
|
|
30
34
|
fetchAllDatasetLoading = _useRemoteSource.fetchAllDatasetLoading,
|
|
31
35
|
refreshModlueData = _useRemoteSource.refreshModlueData,
|
|
32
|
-
refreshDataset = _useRemoteSource.refreshDataset
|
|
33
|
-
pageinfo = _useRemoteSource.pageinfo;
|
|
36
|
+
refreshDataset = _useRemoteSource.refreshDataset;
|
|
34
37
|
var _useRequest = useRequest(fetchAddDataset, {
|
|
35
38
|
manual: true
|
|
36
39
|
}),
|
|
@@ -44,12 +47,12 @@ var DataSetSelector = function DataSetSelector(_ref) {
|
|
|
44
47
|
}, [dataset, isTree]);
|
|
45
48
|
var handleChange = useMemoizedFn( /*#__PURE__*/function () {
|
|
46
49
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(value, _ref3) {
|
|
47
|
-
var key,
|
|
50
|
+
var key, _getLDMetaAttr, _getLDMetaAttr2, moduleId, dataModelKey, _yield$runAsync, code, res, _ds;
|
|
48
51
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
49
52
|
while (1) switch (_context.prev = _context.next) {
|
|
50
53
|
case 0:
|
|
51
54
|
key = _ref3.key;
|
|
52
|
-
|
|
55
|
+
_getLDMetaAttr = getLDMetaAttr(['moduleId', 'dataModelKey']), _getLDMetaAttr2 = _slicedToArray(_getLDMetaAttr, 2), moduleId = _getLDMetaAttr2[0], dataModelKey = _getLDMetaAttr2[1];
|
|
53
56
|
_context.next = 4;
|
|
54
57
|
return runAsync({
|
|
55
58
|
uid: moduleId,
|
|
@@ -75,7 +78,26 @@ var DataSetSelector = function DataSetSelector(_ref) {
|
|
|
75
78
|
code: value,
|
|
76
79
|
uid: key
|
|
77
80
|
};
|
|
78
|
-
onChange(_ds)
|
|
81
|
+
onChange(_ds, function (exe) {
|
|
82
|
+
var dsFields = res.data.dataSets[value];
|
|
83
|
+
exe(fieldsKey, dsFields.map(function (f) {
|
|
84
|
+
var _extra = JSON.parse(f.extra || '{}');
|
|
85
|
+
var restProps = {};
|
|
86
|
+
if (['table', 'tableForm'].includes(component)) {
|
|
87
|
+
var alignMapping = {
|
|
88
|
+
0: 'left',
|
|
89
|
+
1: 'center',
|
|
90
|
+
2: 'right'
|
|
91
|
+
};
|
|
92
|
+
restProps.align = alignMapping[_extra.scell_alignment];
|
|
93
|
+
restProps.headerAlign = alignMapping[_extra.sheading_alignment];
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
uid: f.uid,
|
|
97
|
+
field: f.field
|
|
98
|
+
};
|
|
99
|
+
}));
|
|
100
|
+
});
|
|
79
101
|
setCurrentDataset(_ds);
|
|
80
102
|
}
|
|
81
103
|
case 11:
|
|
@@ -115,9 +137,10 @@ var DataSetSelector = function DataSetSelector(_ref) {
|
|
|
115
137
|
disabled: !currentDataset,
|
|
116
138
|
onClick: function onClick() {
|
|
117
139
|
return next({
|
|
118
|
-
pageinfo: pageinfo,
|
|
119
140
|
datasetUid: currentDataset.uid,
|
|
120
|
-
datasetCode: currentDataset.code
|
|
141
|
+
datasetCode: currentDataset.code,
|
|
142
|
+
valueKey: fieldsKey,
|
|
143
|
+
component: component
|
|
121
144
|
});
|
|
122
145
|
}
|
|
123
146
|
}), /*#__PURE__*/React.createElement(Button, {
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
1
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
+
var _excluded = ["fieldAliasName"];
|
|
3
5
|
import React, { useReducer, useState } from 'react';
|
|
4
|
-
import { useMemoizedFn, useRequest, useDebounceFn, useCreation, useMap } from 'ahooks';
|
|
6
|
+
import { useMemoizedFn, useRequest, useDebounceFn, useCreation, useMap, useUpdateEffect } from 'ahooks';
|
|
5
7
|
import { Ellipsis } from 'luck-design';
|
|
6
8
|
import { Spin, Input, Tooltip, Icon, Checkbox, Drawer } from 'luck-design/antd';
|
|
7
9
|
import styled from 'styled-components';
|
|
8
|
-
import {
|
|
9
|
-
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
10
|
+
import { reduce, unionBy, isEqual, pick } from 'lodash';
|
|
11
|
+
import { formatMessage, suid } from '@luck-design-biz/base/utils';
|
|
10
12
|
import { useContext } from "../../engine/provider/ContextProvider";
|
|
11
13
|
import { SortBox, SortItem } from "../components/SortBox";
|
|
12
14
|
import { ListEditor, ListEditorItem } from "../components/ListEditor";
|
|
13
15
|
import FieldSetting from "../components/field-setting";
|
|
14
16
|
import BatchSetting from "../components/field-setting/BatchSetting";
|
|
15
17
|
import { fetchFieldsByDataset, fetchUpdateFieldAttrs } from "../../constants/api-url";
|
|
16
|
-
import { listReducer } from "../../engine/tools/helper";
|
|
18
|
+
import { listReducer, getLDMetaAttr } from "../../engine/tools/helper";
|
|
17
19
|
import styles from "../style/fields-setting.less";
|
|
18
20
|
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel-section.fieldsSetting';
|
|
19
|
-
var _PICK_KEYS_ = ['uid', 'field', 'width', 'align', 'headerAlign', 'pinned', 'tip'];
|
|
21
|
+
var _PICK_KEYS_ = ['id', 'uid', 'field', 'width', 'align', 'headerAlign', 'pinned', 'tip', 'col', 'row', 'note', 'placeholder', 'aliasName'];
|
|
20
22
|
var Header = styled.div.withConfig({
|
|
21
23
|
displayName: "Header",
|
|
22
24
|
componentId: "luckda-6530__sc-gcwvp1-0"
|
|
@@ -27,11 +29,10 @@ var FieldKey = styled(Ellipsis).withConfig({
|
|
|
27
29
|
})(["width:80px;margin-left:4px;"]);
|
|
28
30
|
var FieldsSetting = function FieldsSetting(_ref) {
|
|
29
31
|
var component = _ref.component,
|
|
30
|
-
pageinfo = _ref.pageinfo,
|
|
31
32
|
datasetUid = _ref.datasetUid,
|
|
32
33
|
nodeId = _ref.nodeId,
|
|
33
34
|
defaultValue = _ref.defaultValue,
|
|
34
|
-
|
|
35
|
+
onChange = _ref.onChange;
|
|
35
36
|
var ctx = useContext();
|
|
36
37
|
var _useReducer = useReducer(listReducer, []),
|
|
37
38
|
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
@@ -46,46 +47,66 @@ var FieldsSetting = function FieldsSetting(_ref) {
|
|
|
46
47
|
checkedFields = _useMap2[0],
|
|
47
48
|
_useMap2$ = _useMap2[1],
|
|
48
49
|
set = _useMap2$.set,
|
|
49
|
-
|
|
50
|
+
get = _useMap2$.get,
|
|
51
|
+
setAll = _useMap2$.setAll,
|
|
52
|
+
remove = _useMap2$.remove,
|
|
53
|
+
reset = _useMap2$.reset;
|
|
50
54
|
var _useState3 = useState(void 0),
|
|
51
55
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
52
56
|
drawerType = _useState4[0],
|
|
53
57
|
setDrawerType = _useState4[1];
|
|
58
|
+
var _useState5 = useState(false),
|
|
59
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
60
|
+
checkAll = _useState6[0],
|
|
61
|
+
setCheckAll = _useState6[1];
|
|
54
62
|
var fieldData = useCreation(function () {
|
|
55
63
|
return fields.find(function (_ref2) {
|
|
56
64
|
var uid = _ref2.uid;
|
|
57
65
|
return uid === fieldId;
|
|
58
66
|
});
|
|
59
67
|
}, [fieldId, fields]);
|
|
68
|
+
useUpdateEffect(function () {
|
|
69
|
+
if (checkedFields.size === fields.length) {
|
|
70
|
+
setCheckAll(true);
|
|
71
|
+
} else if (checkedFields.size === 0) {
|
|
72
|
+
setCheckAll(false);
|
|
73
|
+
}
|
|
74
|
+
}, [checkedFields, fields]);
|
|
60
75
|
var _useRequest = useRequest(fetchFieldsByDataset, {
|
|
61
76
|
defaultParams: [{
|
|
62
77
|
datasetUid: datasetUid,
|
|
63
|
-
moduleUid:
|
|
78
|
+
moduleUid: getLDMetaAttr('moduleId')
|
|
64
79
|
}],
|
|
65
80
|
onSuccess: function onSuccess(_ref3) {
|
|
66
81
|
var code = _ref3.code,
|
|
67
82
|
list = _ref3.list,
|
|
68
83
|
detail = _ref3.detail;
|
|
69
84
|
if (code === 1) {
|
|
70
|
-
var _fields = unionBy(
|
|
71
|
-
|
|
72
|
-
|
|
85
|
+
var _fields = unionBy(reduce(defaultValue, function (ret, _val) {
|
|
86
|
+
if (list.includes(_val.uid) || _val._type === 'divider') {
|
|
87
|
+
ret.push(_val);
|
|
88
|
+
}
|
|
89
|
+
return ret;
|
|
90
|
+
}, []), list.map(function (id) {
|
|
73
91
|
var _fieldData = detail[id];
|
|
74
|
-
var
|
|
75
|
-
var
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
92
|
+
var extra = JSON.parse(_fieldData.extra || '{}');
|
|
93
|
+
var restProps = {};
|
|
94
|
+
if (['table', 'tableForm'].includes(component)) {
|
|
95
|
+
var alignMapping = {
|
|
96
|
+
0: 'left',
|
|
97
|
+
1: 'center',
|
|
98
|
+
2: 'right'
|
|
99
|
+
};
|
|
100
|
+
restProps.align = alignMapping[extra.scell_alignment];
|
|
101
|
+
restProps.headerAlign = alignMapping[extra.sheading_alignment];
|
|
102
|
+
}
|
|
103
|
+
return _objectSpread({
|
|
81
104
|
uid: id,
|
|
82
|
-
field: detail[id].field
|
|
83
|
-
|
|
84
|
-
headerAlign: alignMapping[extraAttr.sheading_alignment]
|
|
85
|
-
};
|
|
105
|
+
field: detail[id].field
|
|
106
|
+
}, restProps);
|
|
86
107
|
}), 'uid');
|
|
87
108
|
if (!isEqual(_fields, defaultValue)) {
|
|
88
|
-
|
|
109
|
+
onChange(_fields);
|
|
89
110
|
}
|
|
90
111
|
dispatch({
|
|
91
112
|
type: 'init',
|
|
@@ -97,14 +118,20 @@ var FieldsSetting = function FieldsSetting(_ref) {
|
|
|
97
118
|
}
|
|
98
119
|
}),
|
|
99
120
|
loading = _useRequest.loading;
|
|
121
|
+
var handleChange = useMemoizedFn(function (newFields) {
|
|
122
|
+
onChange(newFields.map(function (_fieldData) {
|
|
123
|
+
return _fieldData._type === 'divider' ? _fieldData : pick(_fieldData, _PICK_KEYS_);
|
|
124
|
+
}));
|
|
125
|
+
});
|
|
100
126
|
var _useRequest2 = useRequest(fetchUpdateFieldAttrs, {
|
|
101
127
|
manual: true
|
|
102
128
|
}),
|
|
103
129
|
runUpdateFieldAttrs = _useRequest2.runAsync;
|
|
104
130
|
var _useDebounceFn = useDebounceFn(function (field, value) {
|
|
105
|
-
var
|
|
106
|
-
|
|
107
|
-
|
|
131
|
+
var _getLDMetaAttr = getLDMetaAttr(['moduleId', 'dataModelKey']),
|
|
132
|
+
_getLDMetaAttr2 = _slicedToArray(_getLDMetaAttr, 2),
|
|
133
|
+
moduleId = _getLDMetaAttr2[0],
|
|
134
|
+
dataModelKey = _getLDMetaAttr2[1];
|
|
108
135
|
runUpdateFieldAttrs({
|
|
109
136
|
dataModelKey: dataModelKey,
|
|
110
137
|
datasetBusinessUids: [field.uid],
|
|
@@ -119,6 +146,17 @@ var FieldsSetting = function FieldsSetting(_ref) {
|
|
|
119
146
|
var col = gridApi.columnApi.getColumn(field.field);
|
|
120
147
|
col.colDef.headerName = value;
|
|
121
148
|
gridApi.api.refreshHeader();
|
|
149
|
+
} else if (['form', 'tableForm'].includes(component)) {
|
|
150
|
+
handleChange(reduce(fields, function (ret, _ref4) {
|
|
151
|
+
var fieldAliasName = _ref4.fieldAliasName,
|
|
152
|
+
_field = _objectWithoutProperties(_ref4, _excluded);
|
|
153
|
+
if (fieldAliasName) {
|
|
154
|
+
ret.push(_objectSpread({
|
|
155
|
+
aliasName: fieldAliasName
|
|
156
|
+
}, _field));
|
|
157
|
+
}
|
|
158
|
+
return ret;
|
|
159
|
+
}, []));
|
|
122
160
|
}
|
|
123
161
|
});
|
|
124
162
|
}, {
|
|
@@ -134,9 +172,7 @@ var FieldsSetting = function FieldsSetting(_ref) {
|
|
|
134
172
|
var gridApi = ctx.componentMap.get(nodeId).api.self.ref.current.gridApi;
|
|
135
173
|
gridApi.columnApi.moveColumnByIndex(fromIndex, toIndex);
|
|
136
174
|
}
|
|
137
|
-
|
|
138
|
-
return pick(_fieldData, _PICK_KEYS_);
|
|
139
|
-
}));
|
|
175
|
+
handleChange(newFields);
|
|
140
176
|
}
|
|
141
177
|
});
|
|
142
178
|
});
|
|
@@ -162,9 +198,35 @@ var FieldsSetting = function FieldsSetting(_ref) {
|
|
|
162
198
|
remove(data.uid, data);
|
|
163
199
|
}
|
|
164
200
|
});
|
|
201
|
+
var handleFieldCheckAll = useMemoizedFn(function (e) {
|
|
202
|
+
if (e.target.checked) {
|
|
203
|
+
setAll(fields.map(function (_field) {
|
|
204
|
+
return [_field.uid, _field];
|
|
205
|
+
}));
|
|
206
|
+
} else {
|
|
207
|
+
reset();
|
|
208
|
+
}
|
|
209
|
+
});
|
|
165
210
|
var handleBatchSetting = useMemoizedFn(function () {
|
|
166
211
|
setDrawerType('batch');
|
|
167
212
|
});
|
|
213
|
+
var handleAddFormDivider = useMemoizedFn(function (index) {
|
|
214
|
+
var groupId = "group_".concat(suid());
|
|
215
|
+
dispatch({
|
|
216
|
+
type: 'insert',
|
|
217
|
+
payload: {
|
|
218
|
+
index: index,
|
|
219
|
+
data: {
|
|
220
|
+
uid: groupId,
|
|
221
|
+
id: groupId,
|
|
222
|
+
field: 'divider',
|
|
223
|
+
fieldAliasName: 'Group',
|
|
224
|
+
_type: 'divider'
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
callback: handleChange
|
|
228
|
+
});
|
|
229
|
+
});
|
|
168
230
|
var renderItemRight = useMemoizedFn(function (field) {
|
|
169
231
|
return /*#__PURE__*/React.createElement("div", {
|
|
170
232
|
key: field.uid,
|
|
@@ -181,7 +243,7 @@ var FieldsSetting = function FieldsSetting(_ref) {
|
|
|
181
243
|
onChange: function onChange(e) {
|
|
182
244
|
return handleAliasChange(field, e.target.value);
|
|
183
245
|
}
|
|
184
|
-
}), /*#__PURE__*/React.createElement(Tooltip, {
|
|
246
|
+
}), field._type !== 'divider' && /*#__PURE__*/React.createElement(Tooltip, {
|
|
185
247
|
title: formatMessage({
|
|
186
248
|
id: 'luckda.lowcode.painter.edit',
|
|
187
249
|
label: '编辑'
|
|
@@ -200,10 +262,18 @@ var FieldsSetting = function FieldsSetting(_ref) {
|
|
|
200
262
|
});
|
|
201
263
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Spin, {
|
|
202
264
|
spinning: loading
|
|
203
|
-
}, /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement(
|
|
265
|
+
}, /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
266
|
+
style: {
|
|
267
|
+
marginLeft: 20
|
|
268
|
+
},
|
|
269
|
+
disabled: drawerType === 'batch',
|
|
270
|
+
checked: checkAll,
|
|
271
|
+
indeterminate: checkedFields.size > 0 && checkedFields.size !== fields.length,
|
|
272
|
+
onChange: handleFieldCheckAll
|
|
273
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
204
274
|
style: {
|
|
205
|
-
width:
|
|
206
|
-
paddingLeft:
|
|
275
|
+
width: 80,
|
|
276
|
+
paddingLeft: 4
|
|
207
277
|
}
|
|
208
278
|
}, formatMessage({
|
|
209
279
|
id: "".concat(_I18N_PREFIX_, ".field"),
|
|
@@ -217,8 +287,8 @@ var FieldsSetting = function FieldsSetting(_ref) {
|
|
|
217
287
|
id: "".concat(_I18N_PREFIX_, ".title"),
|
|
218
288
|
label: '标题'
|
|
219
289
|
}))), /*#__PURE__*/React.createElement(SortBox, {
|
|
220
|
-
datas: fields.map(function (
|
|
221
|
-
var uid =
|
|
290
|
+
datas: fields.map(function (_ref5) {
|
|
291
|
+
var uid = _ref5.uid;
|
|
222
292
|
return uid;
|
|
223
293
|
}),
|
|
224
294
|
onChange: handleSortChange
|
|
@@ -236,22 +306,29 @@ var FieldsSetting = function FieldsSetting(_ref) {
|
|
|
236
306
|
addBtnProps: {
|
|
237
307
|
disabled: drawerType === 'batch'
|
|
238
308
|
}
|
|
239
|
-
}, fields.map(function (field) {
|
|
309
|
+
}, fields.map(function (field, index) {
|
|
240
310
|
return /*#__PURE__*/React.createElement(SortItem, {
|
|
241
311
|
key: field.uid,
|
|
242
312
|
id: field.uid
|
|
243
313
|
}, /*#__PURE__*/React.createElement(ListEditorItem, {
|
|
244
|
-
left: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
314
|
+
left: /*#__PURE__*/React.createElement(React.Fragment, null, field._type !== 'divider' ? /*#__PURE__*/React.createElement(Checkbox, {
|
|
245
315
|
disabled: drawerType === 'batch',
|
|
246
316
|
data: field,
|
|
317
|
+
checked: !!get(field.uid),
|
|
247
318
|
onChange: handleFieldCheckChange
|
|
248
|
-
}), /*#__PURE__*/React.createElement(FieldKey, {
|
|
319
|
+
}) : null, /*#__PURE__*/React.createElement(FieldKey, {
|
|
249
320
|
tooltip: true,
|
|
250
|
-
lines: 1
|
|
321
|
+
lines: 1,
|
|
322
|
+
style: field._type === 'divider' ? {
|
|
323
|
+
paddingLeft: 16
|
|
324
|
+
} : null
|
|
251
325
|
}, field.field)),
|
|
252
326
|
right: renderItemRight(field),
|
|
253
327
|
item: field,
|
|
254
|
-
dispatch: dispatch
|
|
328
|
+
dispatch: dispatch,
|
|
329
|
+
onAddLine: component === 'form' ? function () {
|
|
330
|
+
return handleAddFormDivider(index);
|
|
331
|
+
} : false
|
|
255
332
|
}));
|
|
256
333
|
})))), !!drawerType ? /*#__PURE__*/React.createElement(Drawer, {
|
|
257
334
|
visible: true,
|
|
@@ -280,29 +357,21 @@ var FieldsSetting = function FieldsSetting(_ref) {
|
|
|
280
357
|
dispatch: dispatch,
|
|
281
358
|
nodeId: nodeId,
|
|
282
359
|
fieldData: fieldData,
|
|
283
|
-
dataModelKey:
|
|
284
|
-
moduleId:
|
|
360
|
+
dataModelKey: getLDMetaAttr('dataModelKey'),
|
|
361
|
+
moduleId: getLDMetaAttr('moduleId'),
|
|
285
362
|
datasetId: datasetUid,
|
|
286
363
|
component: component,
|
|
287
364
|
onAliasChange: handleAliasChange,
|
|
288
|
-
onChange:
|
|
289
|
-
return _onChange(newFields.map(function (_fieldData) {
|
|
290
|
-
return pick(_fieldData, _PICK_KEYS_);
|
|
291
|
-
}));
|
|
292
|
-
}
|
|
365
|
+
onChange: handleChange
|
|
293
366
|
}) : null, drawerType === 'batch' ? /*#__PURE__*/React.createElement(BatchSetting, {
|
|
294
367
|
dispatch: dispatch,
|
|
295
368
|
nodeId: nodeId,
|
|
296
369
|
fieldsData: checkedFields,
|
|
297
|
-
dataModelKey:
|
|
298
|
-
moduleId:
|
|
370
|
+
dataModelKey: getLDMetaAttr('dataModelKey'),
|
|
371
|
+
moduleId: getLDMetaAttr('moduleId'),
|
|
299
372
|
datasetId: datasetUid,
|
|
300
373
|
component: component,
|
|
301
|
-
onChange:
|
|
302
|
-
return _onChange(newFields.map(function (_fieldData) {
|
|
303
|
-
return pick(_fieldData, _PICK_KEYS_);
|
|
304
|
-
}));
|
|
305
|
-
}
|
|
374
|
+
onChange: handleChange
|
|
306
375
|
}) : null) : null);
|
|
307
376
|
};
|
|
308
377
|
export default FieldsSetting;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useDebounceFn } from 'ahooks';
|
|
3
|
+
import { Input } from 'luck-design/antd';
|
|
4
|
+
var I18nInput = function I18nInput(_ref) {
|
|
5
|
+
var defaultValue = _ref.defaultValue,
|
|
6
|
+
onChange = _ref.onChange,
|
|
7
|
+
size = _ref.size;
|
|
8
|
+
var _useDebounceFn = useDebounceFn(onChange, {
|
|
9
|
+
wait: 400
|
|
10
|
+
}),
|
|
11
|
+
run = _useDebounceFn.run;
|
|
12
|
+
return /*#__PURE__*/React.createElement(Input, {
|
|
13
|
+
defaultValue: defaultValue,
|
|
14
|
+
onChange: function onChange(e) {
|
|
15
|
+
return run(e.target.value);
|
|
16
|
+
},
|
|
17
|
+
size: size
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
export default I18nInput;
|