@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
|
@@ -6,11 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _index = _interopRequireDefault(require("./index"));
|
|
10
11
|
var _excluded = ["children"];
|
|
11
12
|
var FunctionLive = function FunctionLive(_ref) {
|
|
12
13
|
var children = _ref.children,
|
|
13
14
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
14
|
-
return /*#__PURE__*/
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, props, children);
|
|
15
16
|
};
|
|
16
17
|
var _default = exports.default = FunctionLive;
|
|
@@ -5,12 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
8
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
12
|
var _index = _interopRequireDefault(require("./index"));
|
|
10
13
|
var _excluded = ["children"];
|
|
11
14
|
var FunctionPreview = function FunctionPreview(_ref) {
|
|
12
15
|
var children = _ref.children,
|
|
13
16
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
14
|
-
return /*#__PURE__*/
|
|
17
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, (0, _extends2.default)({}, props, {
|
|
18
|
+
initData: {
|
|
19
|
+
formMode: 'update',
|
|
20
|
+
ticketData: (0, _defineProperty2.default)({}, window.appConfig.constraintKeys.PRIMARY, 'test')
|
|
21
|
+
}
|
|
22
|
+
}), children);
|
|
15
23
|
};
|
|
16
24
|
var _default = exports.default = FunctionPreview;
|
|
@@ -6,33 +6,141 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var
|
|
9
|
+
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
11
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
15
|
var _ahooks = require("ahooks");
|
|
14
16
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
17
|
var _lodash = require("lodash");
|
|
18
|
+
var _luckDesign = require("luck-design");
|
|
19
|
+
var _base = require("@luck-design-biz/base");
|
|
20
|
+
var _utils = require("@luck-design-biz/base/utils");
|
|
16
21
|
var _Wrapper = _interopRequireDefault(require("../Wrapper"));
|
|
17
22
|
var _index = require("../../../../index");
|
|
18
23
|
var _helper = require("../../../engine/tools/helper");
|
|
19
24
|
var _ContextProvider = require("../../../engine/provider/ContextProvider");
|
|
25
|
+
var _Form = _interopRequireDefault(require("../../../../upload/Form"));
|
|
26
|
+
var _LdRuntimeCom = _interopRequireDefault(require("../../../../components/LdRuntimeCom"));
|
|
20
27
|
var _formPropsDefault = _interopRequireDefault(require("../../../engine/meta/form.props.default.json"));
|
|
21
28
|
var _index2 = _interopRequireDefault(require("./index.less"));
|
|
22
|
-
var _excluded = ["
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
var _excluded = ["advance"];
|
|
30
|
+
var _I18N_PREFIX_ = 'lc.form.validator';
|
|
31
|
+
var Header = function Header(_ref) {
|
|
32
|
+
var _ref$header = _ref.header,
|
|
33
|
+
header = _ref$header === void 0 ? 'collapse' : _ref$header,
|
|
34
|
+
title = _ref.title,
|
|
35
|
+
ldId = _ref.ldId,
|
|
36
|
+
children = _ref.children;
|
|
37
|
+
if (header === 'collapse' || header === 'collapseFollow') return /*#__PURE__*/_react.default.createElement(_base.Collapse, {
|
|
38
|
+
title: title || ldId,
|
|
39
|
+
id: ldId,
|
|
40
|
+
key: ldId,
|
|
41
|
+
mode: header === 'collapse' && 'tab'
|
|
42
|
+
}, children);
|
|
43
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, {
|
|
44
|
+
key: ldId
|
|
45
|
+
}, header === 'divider' && /*#__PURE__*/_react.default.createElement(_luckDesign.BasicDivider, {
|
|
46
|
+
title: title || ldId,
|
|
47
|
+
id: ldId
|
|
48
|
+
}), children);
|
|
49
|
+
};
|
|
50
|
+
var getMthodParams = function getMthodParams(methodStr) {
|
|
51
|
+
var paramRegex = /\((.*?)\)/;
|
|
52
|
+
var match = methodStr.match(paramRegex);
|
|
53
|
+
if (match && match.length > 1) {
|
|
54
|
+
var paramStr = match[1];
|
|
55
|
+
var params = (0, _lodash.reduce)(paramStr.split(','), function (result, param) {
|
|
56
|
+
var _param$trim;
|
|
57
|
+
if (((_param$trim = param.trim()) === null || _param$trim === void 0 ? void 0 : _param$trim.length) > 0) result.push(param.trim());
|
|
58
|
+
return result;
|
|
59
|
+
}, []);
|
|
60
|
+
return params;
|
|
61
|
+
}
|
|
62
|
+
return [];
|
|
63
|
+
};
|
|
64
|
+
var LCForm = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
65
|
+
var _ctx$pagePublicResour2;
|
|
66
|
+
var id = _ref2.id,
|
|
67
|
+
parentId = _ref2.parentId,
|
|
68
|
+
width = _ref2.width,
|
|
69
|
+
height = _ref2.height,
|
|
70
|
+
className = _ref2.className,
|
|
71
|
+
blocks = _ref2.blocks,
|
|
72
|
+
advance = _ref2.advance,
|
|
73
|
+
initData = _ref2.initData,
|
|
74
|
+
readOnly = _ref2.readOnly,
|
|
75
|
+
showSave = _ref2.showSave,
|
|
76
|
+
saveTitle = _ref2.saveTitle,
|
|
77
|
+
settingLayout = _ref2.settingLayout,
|
|
78
|
+
renderFormLeft = _ref2.renderFormLeft,
|
|
79
|
+
renderFormRight = _ref2.renderFormRight,
|
|
80
|
+
children = _ref2.children;
|
|
81
|
+
var apiRef = (0, _react.useRef)();
|
|
34
82
|
var boxRef = (0, _react.useRef)();
|
|
83
|
+
var formRef = (0, _react.useRef)();
|
|
35
84
|
var ctx = (0, _ContextProvider.useContext)();
|
|
85
|
+
var remoteSource = (0, _ContextProvider.useRemoteSource)();
|
|
86
|
+
var _initData = (0, _ahooks.useCreation)(function () {
|
|
87
|
+
return (0, _utils.getPageQuery)();
|
|
88
|
+
}, []); // 获取主界面传递过来的详情页参数
|
|
89
|
+
|
|
90
|
+
var serials = (0, _ahooks.useCreation)(function () {
|
|
91
|
+
var _remoteSource$serials;
|
|
92
|
+
return ((_remoteSource$serials = remoteSource.serials) === null || _remoteSource$serials === void 0 ? void 0 : _remoteSource$serials.map(function (i) {
|
|
93
|
+
return i.serial;
|
|
94
|
+
})) || [];
|
|
95
|
+
}, [remoteSource.serials]);
|
|
96
|
+
(0, _ahooks.useMount)(function () {
|
|
97
|
+
ctx.doAction(advance.events.onMount, {
|
|
98
|
+
instance: (ref || formRef).current
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
(0, _react.useEffect)(function () {
|
|
102
|
+
var tid = ctx.$subscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED).on(function (_ref3) {
|
|
103
|
+
var resource = _ref3.resource,
|
|
104
|
+
prevResource = _ref3.prevResource;
|
|
105
|
+
ctx.doAction(advance.events.onPagePublicResourceChanged, {
|
|
106
|
+
resource: resource,
|
|
107
|
+
prevResource: prevResource,
|
|
108
|
+
instance: (ref || formRef).current
|
|
109
|
+
});
|
|
110
|
+
}).watch();
|
|
111
|
+
return function () {
|
|
112
|
+
ctx.$unsubscriber(ctx.topics.PAGE_PUBLIC_RESOURCE_CHANGED, tid);
|
|
113
|
+
ctx.doAction(advance.events.onUnmount, {
|
|
114
|
+
instance: (ref || formRef).current
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
}, []);
|
|
118
|
+
(0, _react.useImperativeHandle)(apiRef, function () {
|
|
119
|
+
return {
|
|
120
|
+
/**
|
|
121
|
+
* 获取表格实例
|
|
122
|
+
* @method
|
|
123
|
+
*/
|
|
124
|
+
getInstance: function getInstance() {
|
|
125
|
+
return (ref || formRef).current;
|
|
126
|
+
},
|
|
127
|
+
/**
|
|
128
|
+
* 提交表格数据
|
|
129
|
+
* @method
|
|
130
|
+
*/
|
|
131
|
+
submit: function submit() {
|
|
132
|
+
var _ctx$pagePublicResour;
|
|
133
|
+
var instance = (ref || formRef).current;
|
|
134
|
+
var _ref4 = ((_ctx$pagePublicResour = ctx.pagePublicResource) === null || _ctx$pagePublicResour === void 0 ? void 0 : _ctx$pagePublicResour[id]) || initData || _initData || {},
|
|
135
|
+
formMode = _ref4.formMode;
|
|
136
|
+
if (formMode === 'add') {
|
|
137
|
+
instance.onAdd();
|
|
138
|
+
} else if (formMode === 'update') {
|
|
139
|
+
instance.onBatchUpdate();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
});
|
|
36
144
|
var getTargetDom = (0, _ahooks.useMemoizedFn)(function () {
|
|
37
145
|
return boxRef.current;
|
|
38
146
|
});
|
|
@@ -42,11 +150,11 @@ var LCForm = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
42
150
|
};
|
|
43
151
|
return (0, _helper.executeCode)(ctx, defaultDataSourceFormat, ['defaultValues'], defaultValues);
|
|
44
152
|
});
|
|
45
|
-
var handleDataSourceFormat = (0, _ahooks.useMemoizedFn)(function (dataSourceFormat,
|
|
46
|
-
var values =
|
|
47
|
-
submitData =
|
|
48
|
-
if ((0, _lodash.isNil)(dataSourceFormat)) return submitData;
|
|
49
|
-
return (0, _helper.executeCode)(ctx, dataSourceFormat, ['values', 'submitData'], values, submitData);
|
|
153
|
+
var handleDataSourceFormat = (0, _ahooks.useMemoizedFn)(function (dataSourceFormat, dataSetKey, _ref5) {
|
|
154
|
+
var values = _ref5.values,
|
|
155
|
+
submitData = _ref5.submitData;
|
|
156
|
+
if ((0, _lodash.isNil)(dataSourceFormat)) return (0, _defineProperty2.default)({}, dataSetKey, submitData);
|
|
157
|
+
return (0, _helper.executeCode)(ctx, dataSourceFormat, ['dataSetKey', 'values', 'submitData'], dataSetKey, values, submitData);
|
|
50
158
|
});
|
|
51
159
|
var handleResetActionsColumn = (0, _ahooks.useMemoizedFn)(function (actionsColumnReset, data, index, actions, params) {
|
|
52
160
|
return (0, _helper.executeCode)(ctx, actionsColumnReset, ['data', 'index', 'actions', 'params'], data, index, actions, params);
|
|
@@ -58,61 +166,273 @@ var LCForm = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
58
166
|
var handleGridFormReady = (0, _ahooks.useMemoizedFn)(function (onGridFormReady, ref, params, gridForm) {
|
|
59
167
|
if (!(0, _lodash.isNil)(onGridFormReady)) return (0, _helper.executeCode)(ctx, onGridFormReady, ['ref', 'params', 'gridForm'], ref, params, gridForm);
|
|
60
168
|
});
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
169
|
+
var handleResetActions = (0, _ahooks.useMemoizedFn)(function (resetActions, data, index, actionList, params) {
|
|
170
|
+
if ((0, _lodash.isNil)(resetActions)) return actionList;
|
|
171
|
+
return (0, _helper.executeCode)(ctx, resetActions, ['data', 'index', 'actionList', 'params'], data, index, actionList, params);
|
|
172
|
+
});
|
|
173
|
+
var handleForbiddenTypes = (0, _ahooks.useMemoizedFn)(function (forbiddenTypes) {
|
|
174
|
+
if ((0, _lodash.isNil)(forbiddenTypes)) return [];
|
|
175
|
+
return (0, _helper.executeCode)(ctx, forbiddenTypes, []);
|
|
176
|
+
});
|
|
177
|
+
var handleBeforeUpload = (0, _ahooks.useMemoizedFn)(function (beforeUpload, file, fileList) {
|
|
178
|
+
if ((0, _lodash.isNil)(beforeUpload)) return true;
|
|
179
|
+
return (0, _helper.executeCode)(ctx, beforeUpload, ['file', 'fileList'], file, fileList);
|
|
180
|
+
});
|
|
181
|
+
var handleUploadChange = (0, _ahooks.useMemoizedFn)(function (onUploadChange, e) {
|
|
182
|
+
if (!(0, _lodash.isNil)(onUploadChange)) return (0, _helper.executeCode)(ctx, onUploadChange, ['event'], e);
|
|
183
|
+
});
|
|
184
|
+
var renderAffix = (0, _ahooks.useMemoizedFn)(function (_render) {
|
|
185
|
+
return _render ? /*#__PURE__*/_react.default.createElement(_LdRuntimeCom.default, null, _render) : null;
|
|
186
|
+
});
|
|
187
|
+
var setVerifyRules = function setVerifyRules(_props, verifyListObj) {
|
|
188
|
+
var _verifyListObj$length, _verifyListObj$min, _verifyListObj$max, _verifyListObj$rules;
|
|
189
|
+
var props = (0, _lodash.cloneDeep)(_props);
|
|
190
|
+
props.config.rules = props.config.rules || [];
|
|
191
|
+
if ((_verifyListObj$length = verifyListObj.length) !== null && _verifyListObj$length !== void 0 && _verifyListObj$length.expression) props.config.rules.push({
|
|
192
|
+
validator: function validator(rule, value, callback) {
|
|
193
|
+
var _current;
|
|
194
|
+
var length = (0, _helper.executeCode)(ctx, verifyListObj.length.expression, ['cValue'], (_current = (ref || formRef).current) === null || _current === void 0 ? void 0 : _current.getCValue());
|
|
195
|
+
if (value.length > length) callback("".concat((0, _utils.formatMessage)({
|
|
196
|
+
id: "".concat(_I18N_PREFIX_, ".maxLength"),
|
|
197
|
+
label: '字数不得超过'
|
|
198
|
+
})).concat(length).concat((0, _utils.formatMessage)({
|
|
199
|
+
id: "".concat(_I18N_PREFIX_, ".textNum"),
|
|
200
|
+
label: '个字符'
|
|
201
|
+
})));
|
|
202
|
+
callback();
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
if ((_verifyListObj$min = verifyListObj.min) !== null && _verifyListObj$min !== void 0 && _verifyListObj$min.expression) props.config.rules.push({
|
|
206
|
+
validator: function validator(rule, value, callback) {
|
|
207
|
+
var _current2;
|
|
208
|
+
var min = (0, _helper.executeCode)(ctx, verifyListObj.min.expression, ['cValue'], (_current2 = (ref || formRef).current) === null || _current2 === void 0 ? void 0 : _current2.getCValue());
|
|
209
|
+
if (value < min) callback((0, _utils.formatMessage)({
|
|
210
|
+
id: "".concat(_I18N_PREFIX_, ".numberBelowMin"),
|
|
211
|
+
label: '低于最小值'
|
|
212
|
+
}));
|
|
213
|
+
callback();
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
if ((_verifyListObj$max = verifyListObj.max) !== null && _verifyListObj$max !== void 0 && _verifyListObj$max.expression) props.config.rules.push({
|
|
217
|
+
validator: function validator(rule, value, callback) {
|
|
218
|
+
var _current3;
|
|
219
|
+
var max = (0, _helper.executeCode)(ctx, verifyListObj.max.expression, ['cValue'], (_current3 = (ref || formRef).current) === null || _current3 === void 0 ? void 0 : _current3.getCValue());
|
|
220
|
+
if (value > max) callback((0, _utils.formatMessage)({
|
|
221
|
+
id: "".concat(_I18N_PREFIX_, ".numberExceedMax"),
|
|
222
|
+
label: '超过最大值'
|
|
223
|
+
}));
|
|
224
|
+
callback();
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
if (verifyListObj.email) props.config.type = 'email';
|
|
228
|
+
if (verifyListObj.idcard) props.config.type = 'idcard';
|
|
229
|
+
if (verifyListObj.mobile) props.config.type = 'mobile';
|
|
230
|
+
if ((_verifyListObj$rules = verifyListObj.rules) !== null && _verifyListObj$rules !== void 0 && _verifyListObj$rules.expression) props.config.rules.push({
|
|
231
|
+
validator: function validator(rule, value, callback) {
|
|
232
|
+
var _current4;
|
|
233
|
+
(0, _helper.executeCode)(ctx, verifyListObj.rules.expression, ['cValue', 'rule', 'value', 'callback'], (_current4 = (ref || formRef).current) === null || _current4 === void 0 ? void 0 : _current4.getCValue(), rule, value, callback);
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
return props;
|
|
237
|
+
};
|
|
238
|
+
var transEventsInfields = function transEventsInfields(fields) {
|
|
239
|
+
return fields.map(function (setting) {
|
|
240
|
+
var advance = setting.advance,
|
|
241
|
+
rest = (0, _objectWithoutProperties2.default)(setting, _excluded);
|
|
242
|
+
var props = (0, _lodash.reduce)(rest, function (result, value, key) {
|
|
243
|
+
//处理方法
|
|
244
|
+
result[key] = (0, _lodash.isString)(value) && (0, _lodash.startsWith)(value, 'function') ? function () {
|
|
245
|
+
for (var _len = arguments.length, _props = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
246
|
+
_props[_key] = arguments[_key];
|
|
247
|
+
}
|
|
248
|
+
return _helper.executeCode.apply(void 0, [ctx, value, getMthodParams(value)].concat(_props));
|
|
249
|
+
} : value;
|
|
250
|
+
return result;
|
|
251
|
+
}, {});
|
|
252
|
+
if (advance !== null && advance !== void 0 && advance.events) return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
|
253
|
+
events: (0, _lodash.reduce)(advance.events, function (result, value, key) {
|
|
254
|
+
//处理事件
|
|
255
|
+
result[key] = function () {
|
|
256
|
+
for (var _len2 = arguments.length, props = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
257
|
+
props[_key2] = arguments[_key2];
|
|
81
258
|
}
|
|
259
|
+
ctx.doAction(value, (0, _lodash.reduce)(getMthodParams(value[0][1].code), function (result, value, index) {
|
|
260
|
+
result[value] = props[index];
|
|
261
|
+
return result;
|
|
262
|
+
}, {}));
|
|
82
263
|
};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
264
|
+
return result;
|
|
265
|
+
}, {})
|
|
266
|
+
});
|
|
267
|
+
return props;
|
|
268
|
+
});
|
|
269
|
+
};
|
|
270
|
+
var renderFormList = (0, _ahooks.useMemoizedFn)(function (formConfig) {
|
|
271
|
+
return (0, _lodash.reduce)(blocks, function (result, item) {
|
|
272
|
+
if ((0, _lodash.includes)(['auto', 'grid', 'writer'], item.type) && (0, _lodash.includes)(item.mode, formConfig.formMode)) {
|
|
273
|
+
var _item$dataset;
|
|
274
|
+
var data = {
|
|
275
|
+
id: item.id,
|
|
276
|
+
order: item.order,
|
|
277
|
+
type: item.type,
|
|
278
|
+
readOnly: item.readOnly,
|
|
279
|
+
title: item.name,
|
|
280
|
+
header: item.header,
|
|
281
|
+
dataSetKey: (_item$dataset = item.dataset) === null || _item$dataset === void 0 ? void 0 : _item$dataset.code,
|
|
282
|
+
serial: item.serial,
|
|
283
|
+
serialEffect: item.serialEffect,
|
|
284
|
+
fields: transEventsInfields(item.fields),
|
|
285
|
+
defaultDataSourceFormat: function defaultDataSourceFormat(defaultValues) {
|
|
286
|
+
return handleDefaultDataSourceFormat(item.defaultDataSourceFormat, defaultValues);
|
|
287
|
+
},
|
|
288
|
+
onUpdate: {
|
|
289
|
+
post: function post(data) {
|
|
290
|
+
var _item$dataset2;
|
|
291
|
+
return handleDataSourceFormat(item.dataSourceFormat, (_item$dataset2 = item.dataset) === null || _item$dataset2 === void 0 ? void 0 : _item$dataset2.code, data);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
if (item.type === 'auto') data = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, data), {}, {
|
|
296
|
+
col: item.cols
|
|
297
|
+
});else data = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, data), {}, {
|
|
298
|
+
suppressPreset: item.suppressPreset,
|
|
299
|
+
height: item.height,
|
|
300
|
+
bordered: item.bordered,
|
|
301
|
+
draggable: item.draggable,
|
|
302
|
+
orderByAdd: item.orderByAdd,
|
|
303
|
+
hideActionsColumn: item.suppressActions,
|
|
304
|
+
actionsWidth: item.actionsColumnWidth,
|
|
305
|
+
columnsReset: function columnsReset(columns) {
|
|
306
|
+
return handleColumnsReset(item.columnsReset, columns);
|
|
307
|
+
},
|
|
308
|
+
onGridFormReady: function onGridFormReady(ref, params, gridForm) {
|
|
309
|
+
return handleGridFormReady(item.onGridFormReady, ref, params, gridForm);
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
if (item.actionsColumnReset) data = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, data), {}, {
|
|
313
|
+
resetActionsColumn: function resetActionsColumn(data, index, actions, params) {
|
|
314
|
+
return handleResetActionsColumn(item.actionsColumnReset, data, index, actions, params);
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
result.push(data);
|
|
318
|
+
}
|
|
319
|
+
return result;
|
|
320
|
+
}, []);
|
|
321
|
+
});
|
|
322
|
+
var renderFormExtra = (0, _ahooks.useMemoizedFn)(function (formConfig) {
|
|
323
|
+
return (0, _lodash.reduce)(blocks, function (result, item) {
|
|
324
|
+
if ((0, _lodash.includes)(item.mode, formConfig.formMode) && !item.serial || item.serialEffect === 'disable' || (0, _lodash.includes)(serials, item.serial)) {
|
|
325
|
+
if (item.type === 'uploadForm') {
|
|
326
|
+
var dom = /*#__PURE__*/_react.default.createElement(Header, {
|
|
327
|
+
ldId: item.id,
|
|
328
|
+
key: item.id,
|
|
329
|
+
header: item.header,
|
|
330
|
+
title: item.name,
|
|
331
|
+
order: item.order
|
|
332
|
+
}, (0, _Form.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, formConfig), {}, {
|
|
333
|
+
formId: item.id,
|
|
334
|
+
moduleCode: (0, _helper.getLDMetaAttr)('moduleCode'),
|
|
335
|
+
readOnly: item.readOnly || formConfig.readOnly || item.serial && !(0, _lodash.includes)(serials, item.serial),
|
|
86
336
|
suppressPreset: item.suppressPreset,
|
|
87
337
|
height: item.height,
|
|
88
338
|
bordered: item.bordered,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
339
|
+
showNote: item.showNote,
|
|
340
|
+
zipName: "".concat(item.zipName || 'download', ".zip"),
|
|
341
|
+
uploadUrl: item.uploadUrl,
|
|
342
|
+
resetActions: item.useResetActions ? null : function () {
|
|
343
|
+
for (var _len3 = arguments.length, params = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
344
|
+
params[_key3] = arguments[_key3];
|
|
345
|
+
}
|
|
346
|
+
return handleResetActions.apply(void 0, [item.resetActions].concat(params));
|
|
95
347
|
},
|
|
96
|
-
|
|
97
|
-
return
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
348
|
+
forbiddenTypes: function forbiddenTypes() {
|
|
349
|
+
return handleForbiddenTypes(item.forbiddenTypes);
|
|
350
|
+
},
|
|
351
|
+
beforeUpload: function beforeUpload() {
|
|
352
|
+
for (var _len4 = arguments.length, params = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
353
|
+
params[_key4] = arguments[_key4];
|
|
354
|
+
}
|
|
355
|
+
return handleBeforeUpload.apply(void 0, [item.beforeUpload].concat(params));
|
|
356
|
+
},
|
|
357
|
+
onUploadChange: function onUploadChange(e) {
|
|
358
|
+
return handleUploadChange(item.onUploadChange, e);
|
|
103
359
|
}
|
|
104
|
-
});
|
|
105
|
-
result.push(
|
|
360
|
+
})));
|
|
361
|
+
result.push(dom);
|
|
362
|
+
}
|
|
363
|
+
if (item.type === 'blank') {
|
|
364
|
+
var _dom = /*#__PURE__*/_react.default.createElement(Header, {
|
|
365
|
+
ldId: item.id,
|
|
366
|
+
key: item.id,
|
|
367
|
+
header: item.header,
|
|
368
|
+
title: item.name,
|
|
369
|
+
order: item.order
|
|
370
|
+
}, children === null || children === void 0 ? void 0 : children.find(function (child) {
|
|
371
|
+
return child.props.formBoxId === item.id;
|
|
372
|
+
}));
|
|
373
|
+
result.push(_dom);
|
|
106
374
|
}
|
|
107
375
|
}
|
|
108
376
|
return result;
|
|
109
377
|
}, []);
|
|
110
|
-
|
|
378
|
+
});
|
|
379
|
+
var beforeSubmit = (0, _ahooks.useMemoizedFn)(function (values, data) {
|
|
380
|
+
return new Promise( /*#__PURE__*/function () {
|
|
381
|
+
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(resolve) {
|
|
382
|
+
var _data;
|
|
383
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
384
|
+
while (1) switch (_context.prev = _context.next) {
|
|
385
|
+
case 0:
|
|
386
|
+
if (!(0, _lodash.isNil)(advance.events.beforeSave)) {
|
|
387
|
+
_context.next = 4;
|
|
388
|
+
break;
|
|
389
|
+
}
|
|
390
|
+
resolve(values);
|
|
391
|
+
_context.next = 8;
|
|
392
|
+
break;
|
|
393
|
+
case 4:
|
|
394
|
+
_context.next = 6;
|
|
395
|
+
return ctx.doAction(advance.events.beforeSave, {
|
|
396
|
+
values: values,
|
|
397
|
+
data: data
|
|
398
|
+
});
|
|
399
|
+
case 6:
|
|
400
|
+
_data = _context.sent;
|
|
401
|
+
resolve((0, _lodash.last)(_data));
|
|
402
|
+
case 8:
|
|
403
|
+
case "end":
|
|
404
|
+
return _context.stop();
|
|
405
|
+
}
|
|
406
|
+
}, _callee);
|
|
407
|
+
}));
|
|
408
|
+
return function (_x) {
|
|
409
|
+
return _ref7.apply(this, arguments);
|
|
410
|
+
};
|
|
411
|
+
}());
|
|
412
|
+
});
|
|
413
|
+
var afterSubmit = (0, _ahooks.useMemoizedFn)(function (success, mainKey, res) {
|
|
414
|
+
ctx.doAction(advance.events.onSaveCallback, {
|
|
415
|
+
success: success,
|
|
416
|
+
mainKey: mainKey,
|
|
417
|
+
res: res
|
|
418
|
+
});
|
|
419
|
+
});
|
|
420
|
+
var onValueChange = (0, _ahooks.useMemoizedFn)(function (change, data) {
|
|
421
|
+
ctx.doAction(advance.events.onValueChange, {
|
|
422
|
+
change: change,
|
|
423
|
+
data: data
|
|
424
|
+
});
|
|
425
|
+
});
|
|
426
|
+
var onChildChange = (0, _ahooks.useMemoizedFn)(function (instance) {
|
|
427
|
+
ctx.doAction(advance.events.onChildChange, {
|
|
428
|
+
instance: instance
|
|
429
|
+
});
|
|
111
430
|
});
|
|
112
431
|
return /*#__PURE__*/_react.default.createElement(_Wrapper.default, {
|
|
113
432
|
id: id,
|
|
114
433
|
displayName: "Form",
|
|
115
|
-
getTargetDom: getTargetDom
|
|
434
|
+
getTargetDom: getTargetDom,
|
|
435
|
+
api: apiRef
|
|
116
436
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
117
437
|
ref: boxRef,
|
|
118
438
|
style: {
|
|
@@ -124,10 +444,25 @@ var LCForm = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
124
444
|
ldId: id,
|
|
125
445
|
className: (0, _classnames.default)(_index2.default['lc-component-form'], (0, _defineProperty2.default)({}, className, !!className)),
|
|
126
446
|
renderFormList: renderFormList,
|
|
447
|
+
renderFormExtra: renderFormExtra,
|
|
127
448
|
mainFormLdId: "block_main",
|
|
128
|
-
initData: initData,
|
|
129
|
-
ref: ref,
|
|
130
|
-
readOnly: readOnly
|
|
449
|
+
initData: ((_ctx$pagePublicResour2 = ctx.pagePublicResource) === null || _ctx$pagePublicResour2 === void 0 ? void 0 : _ctx$pagePublicResour2[id]) || initData || _initData,
|
|
450
|
+
ref: ref || formRef,
|
|
451
|
+
readOnly: readOnly,
|
|
452
|
+
showSaveBtn: showSave,
|
|
453
|
+
saveBtnTitle: saveTitle,
|
|
454
|
+
affixLayout: settingLayout,
|
|
455
|
+
renderAffixLeft: function renderAffixLeft() {
|
|
456
|
+
return renderAffix(renderFormLeft);
|
|
457
|
+
},
|
|
458
|
+
renderAffixRight: function renderAffixRight() {
|
|
459
|
+
return renderAffix(renderFormRight);
|
|
460
|
+
},
|
|
461
|
+
beforeSubmit: beforeSubmit,
|
|
462
|
+
afterSubmit: advance.events.onSaveCallback ? afterSubmit : null,
|
|
463
|
+
onValueChange: onValueChange,
|
|
464
|
+
onChildChange: onChildChange,
|
|
465
|
+
setVerifyRules: setVerifyRules
|
|
131
466
|
})));
|
|
132
467
|
});
|
|
133
468
|
LCForm.defaultProps = (0, _helper.omitBadProps)(_formPropsDefault.default);
|