@luck-design-biz/luckda 0.0.24-2 → 0.0.25-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/Builder/index.js +6 -4
- package/es/components/IconFont/index.js +5 -0
- package/es/components/LDActions/index.js +133 -0
- package/es/components/LDActions/index.less +65 -0
- package/es/components/LdAutoForm/index.js +1 -1
- package/es/components/LdCom/index.js +2 -1
- package/es/components/LdFormList/index.js +15 -10
- package/es/components/LdGrid/index.js +14 -8
- package/es/components/LdGridForm/index.js +5 -4
- package/es/components/LdRuntimeCom/index.js +20 -7
- package/es/components/LdTree/index.js +112 -31
- package/es/components/LdTree/index.less +6 -1
- package/es/helper/ldBuilder.js +28 -12
- package/es/helper/ldComBuild.js +29 -14
- package/es/index.js +1 -0
- package/es/locales/zh-CN.js +230 -0
- package/es/lowcode/constants/api-url.js +464 -262
- package/es/lowcode/constants/event-topics.js +4 -0
- package/es/lowcode/constants/index.js +31 -2
- package/es/lowcode/engine/factory/panel-item-factory/CheckboxStrategy.js +32 -0
- package/es/lowcode/engine/factory/panel-item-factory/index.js +2 -0
- package/es/lowcode/engine/meta/box.props.default.json +4 -3
- package/es/lowcode/engine/meta/box.props.json +2 -4
- package/es/lowcode/engine/meta/button.props.default.json +5 -2
- package/es/lowcode/engine/meta/button.props.json +9 -9
- package/es/lowcode/engine/meta/cardlist.props.default.json +4 -2
- package/es/lowcode/engine/meta/cardlist.props.json +2 -3
- package/es/lowcode/engine/meta/components-list.json +1 -1
- package/es/lowcode/engine/meta/dialog.props.default.json +4 -2
- package/es/lowcode/engine/meta/dialog.props.json +1 -2
- package/es/lowcode/engine/meta/drawer.props.default.json +4 -2
- package/es/lowcode/engine/meta/drawer.props.json +1 -2
- package/es/lowcode/engine/meta/form.props.default.json +52 -4
- package/es/lowcode/engine/meta/form.props.json +596 -64
- package/es/lowcode/engine/meta/iframe.props.default.json +1 -1
- package/es/lowcode/engine/meta/iframe.props.json +1 -1
- package/es/lowcode/engine/meta/image.props.default.json +5 -2
- package/es/lowcode/engine/meta/image.props.json +3 -3
- package/es/lowcode/engine/meta/imex.props.default.json +5 -2
- package/es/lowcode/engine/meta/imex.props.json +2 -2
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +152 -26
- package/es/lowcode/engine/meta/jsx.props.default.json +2 -1
- package/es/lowcode/engine/meta/jsx.props.json +10 -5
- package/es/lowcode/engine/meta/layout.props.default.json +5 -2
- package/es/lowcode/engine/meta/layout.props.json +1 -2
- package/es/lowcode/engine/meta/link.props.default.json +5 -2
- package/es/lowcode/engine/meta/link.props.json +3 -3
- package/es/lowcode/engine/meta/local/local.zh-cn.js +97 -0
- package/es/lowcode/engine/meta/page.props.default.json +12 -0
- package/es/lowcode/engine/meta/page.props.json +49 -0
- package/es/lowcode/engine/meta/pagecontent.props.default.json +6 -0
- package/es/lowcode/engine/meta/pagecontent.props.json +7 -0
- package/es/lowcode/engine/meta/pagefooter.props.default.json +6 -0
- package/es/lowcode/engine/meta/pagefooter.props.json +7 -0
- package/es/lowcode/engine/meta/pageheader.props.default.json +6 -0
- package/es/lowcode/engine/meta/pageheader.props.json +7 -0
- package/es/lowcode/engine/meta/section.props.default.json +7 -6
- package/es/lowcode/engine/meta/section.props.json +52 -49
- package/es/lowcode/engine/meta/split.props.default.json +9 -4
- package/es/lowcode/engine/meta/split.props.json +14 -29
- package/es/lowcode/engine/meta/table.props.default.json +23 -3
- package/es/lowcode/engine/meta/table.props.json +257 -55
- package/es/lowcode/engine/meta/tabs.props.default.json +16 -9
- package/es/lowcode/engine/meta/tabs.props.json +57 -81
- package/es/lowcode/engine/meta/text.props.default.json +5 -2
- package/es/lowcode/engine/meta/text.props.json +3 -3
- package/es/lowcode/engine/meta/tree.props.default.json +20 -7
- package/es/lowcode/engine/meta/tree.props.json +225 -79
- package/es/lowcode/engine/provider/ContextProvider/index.js +177 -0
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +174 -0
- package/es/lowcode/engine/tools/dataProcess.js +64 -2
- package/es/lowcode/engine/tools/helper.js +97 -18
- package/es/lowcode/engine/tools/useCanvasRender.js +73 -0
- package/es/lowcode/engine/tools/usePromiseState.js +23 -12
- package/es/lowcode/engine/tools/useTodo.js +78 -0
- package/es/lowcode/index.js +1 -0
- package/es/lowcode/painter/Components.js +47 -21
- package/es/lowcode/painter/Design.js +34 -2
- package/es/lowcode/painter/DesignOperator.js +48 -31
- package/es/lowcode/painter/DesignToolbar.js +324 -16
- package/es/lowcode/painter/I18n.js +2 -2
- package/es/lowcode/painter/Outline.js +31 -26
- package/es/lowcode/painter/Panel.js +99 -142
- package/es/lowcode/painter/Ribbon.js +1 -1
- package/es/lowcode/painter/components/ActionBindModal.js +293 -0
- package/es/lowcode/painter/components/AdvancePanel.js +140 -0
- package/es/lowcode/painter/components/AttrsPanel.js +145 -0
- package/es/lowcode/painter/components/Collapse.js +20 -9
- package/es/lowcode/painter/components/ColorInput.js +5 -3
- package/es/lowcode/painter/components/DragDrop/DragDropContext.js +137 -0
- package/es/lowcode/painter/components/DragDrop/DragDropWrapper.js +50 -0
- package/es/lowcode/painter/components/DragDrop/Overlay.js +8 -0
- package/es/lowcode/painter/components/DragDrop/TreeDragDropWrapper.js +67 -0
- package/es/lowcode/painter/components/FieldSelector.js +44 -0
- package/es/lowcode/painter/components/ListEditor.js +26 -11
- package/es/lowcode/painter/components/PanelItem.js +1 -1
- package/es/lowcode/painter/components/PopConfirm.js +10 -3
- package/es/lowcode/painter/components/SortBox.js +11 -4
- package/es/lowcode/painter/components/TreeEditor.js +13 -0
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +14 -2
- package/es/lowcode/painter/components/code-editor/JSEditor.js +25 -14
- package/es/lowcode/painter/components/code-editor/JsonEditor.js +41 -0
- package/es/lowcode/painter/components/field-setting/BatchSetting.js +154 -0
- package/es/lowcode/painter/components/field-setting/CheckRules.js +126 -0
- package/es/lowcode/painter/components/field-setting/FieldAttrs.js +287 -0
- package/es/lowcode/painter/components/field-setting/FieldAttrsModal.js +290 -0
- package/es/lowcode/painter/components/field-setting/FieldDefaultValue.js +63 -0
- package/es/lowcode/painter/components/field-setting/FieldRulesModal.js +116 -0
- package/es/lowcode/painter/components/field-setting/SettingUI.js +438 -0
- package/es/lowcode/painter/components/field-setting/index.js +373 -0
- package/es/lowcode/painter/index.js +3 -28
- package/es/lowcode/painter/panel-section/ActionsColumnWidth.js +25 -0
- package/es/lowcode/painter/panel-section/ActionsEditor/ActionEditor.js +101 -0
- package/es/lowcode/painter/{components/actions-editor → panel-section/ActionsEditor}/index.js +74 -13
- package/es/lowcode/painter/panel-section/BlockEditor/index.js +27 -0
- package/es/lowcode/painter/panel-section/BlocksEditor/BlockEditorItem.js +45 -0
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +235 -0
- package/es/lowcode/painter/panel-section/DataSetSelector.js +115 -43
- package/es/lowcode/painter/panel-section/FieldsSetting.js +329 -0
- package/es/lowcode/painter/panel-section/I18nInput.js +20 -0
- package/es/lowcode/painter/panel-section/Icon.js +14 -14
- package/es/lowcode/painter/panel-section/IconConditionSelector.js +111 -0
- package/es/lowcode/painter/panel-section/IconSelector.js +5 -2
- package/es/lowcode/painter/panel-section/ImpExp.js +91 -0
- package/es/lowcode/painter/panel-section/JSEditor.js +49 -0
- package/es/lowcode/painter/panel-section/LayoutRatio.js +6 -7
- package/es/lowcode/painter/panel-section/SerialsSelector.js +44 -0
- package/es/lowcode/painter/panel-section/SplitDisplay.js +248 -0
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/StyleContext.js +2 -22
- package/es/lowcode/painter/panel-section/TabItems.js +46 -30
- package/es/lowcode/painter/panel-section/TableTopFilter.js +306 -0
- package/es/lowcode/painter/panel-section/TableZebra.js +66 -6
- package/es/lowcode/painter/panel-section/TreeRootEditor.js +78 -0
- package/es/lowcode/painter/style/action-bind-modal.less +102 -0
- package/es/lowcode/painter/style/collapse.less +6 -0
- package/es/lowcode/painter/style/components.less +5 -4
- package/es/lowcode/painter/style/design.less +7 -4
- package/es/lowcode/painter/style/dragdrop.less +10 -0
- package/es/lowcode/painter/style/fields-setting.less +25 -0
- package/es/lowcode/painter/style/impexp.less +7 -0
- package/es/lowcode/painter/style/list-editor.less +36 -0
- package/es/lowcode/painter/style/panel-attrs.less +43 -0
- package/es/lowcode/painter/style/panel.less +6 -37
- package/es/lowcode/painter/style/pop-confirm.less +9 -2
- package/es/lowcode/painter/style/split-display.less +28 -0
- package/es/lowcode/painter/style/treedragdrop.less +19 -0
- package/es/lowcode/preview/index.js +27 -0
- package/es/lowcode/view/Canvas.js +34 -139
- package/es/lowcode/view/Loading.js +6 -2
- package/es/lowcode/view/Page.js +16 -14
- package/es/lowcode/view/lc-components/Box/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Box/index.js +11 -2
- package/es/lowcode/view/lc-components/Box/index.less +0 -1
- package/es/lowcode/view/lc-components/Box/meta.json +2 -4
- package/es/lowcode/view/lc-components/Button/FunctionDesign.js +8 -10
- package/es/lowcode/view/lc-components/Button/FunctionLive.js +3 -6
- package/es/lowcode/view/lc-components/Button/FunctionPreview.js +6 -0
- package/es/lowcode/view/lc-components/Button/index.js +43 -20
- package/es/lowcode/view/lc-components/Button/meta.json +9 -9
- package/es/lowcode/view/lc-components/CardList/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/CardList/index.js +1 -0
- package/es/lowcode/view/lc-components/CardList/meta.json +2 -3
- package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +16 -24
- package/es/lowcode/view/lc-components/Dialog/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Dialog/index.js +1 -0
- package/es/lowcode/view/lc-components/Dialog/meta.json +1 -2
- package/es/lowcode/view/lc-components/Drawer/FunctionDesign.js +4 -2
- package/es/lowcode/view/lc-components/Drawer/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Drawer/index.js +17 -0
- package/es/lowcode/view/lc-components/Drawer/index.less +3 -0
- package/es/lowcode/view/lc-components/Drawer/meta.json +1 -2
- package/es/lowcode/view/lc-components/Form/FunctionDesign.js +93 -2
- package/es/lowcode/view/lc-components/Form/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Form/index.js +290 -13
- package/es/lowcode/view/lc-components/Form/index.less +5 -0
- package/es/lowcode/view/lc-components/Form/meta.json +546 -64
- package/es/lowcode/view/lc-components/Iframe/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Iframe/index.js +1 -0
- package/es/lowcode/view/lc-components/Iframe/meta.json +1 -1
- package/es/lowcode/view/lc-components/ImEx/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/ImEx/index.js +1 -0
- package/es/lowcode/view/lc-components/ImEx/meta.json +2 -2
- package/es/lowcode/view/lc-components/Image/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Image/index.js +1 -0
- package/es/lowcode/view/lc-components/Image/meta.json +3 -3
- package/es/lowcode/view/lc-components/JSX/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/JSX/index.js +19 -6
- package/es/lowcode/view/lc-components/JSX/meta.json +8 -5
- package/es/lowcode/view/lc-components/Layout/FunctionDesign.js +23 -22
- package/es/lowcode/view/lc-components/Layout/FunctionLive.js +3 -8
- package/es/lowcode/view/lc-components/Layout/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Layout/index.js +1 -0
- package/es/lowcode/view/lc-components/Layout/meta.json +1 -2
- package/es/lowcode/view/lc-components/Link/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Link/index.js +1 -0
- package/es/lowcode/view/lc-components/Link/meta.json +3 -3
- package/es/lowcode/view/lc-components/Page/meta.json +49 -0
- package/es/lowcode/view/lc-components/PageContent/index.js +53 -0
- package/es/lowcode/view/lc-components/PageContent/meta.json +9 -0
- package/es/lowcode/view/lc-components/PageFooter/index.js +38 -0
- package/es/lowcode/view/lc-components/PageFooter/meta.json +9 -0
- package/es/lowcode/view/lc-components/PageHeader/index.js +40 -0
- package/es/lowcode/view/lc-components/PageHeader/meta.json +9 -0
- package/es/lowcode/view/lc-components/PageModal/index.js +23 -0
- package/es/lowcode/view/lc-components/Section/FunctionDesign.js +31 -2
- package/es/lowcode/view/lc-components/Section/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Section/index.js +115 -24
- package/es/lowcode/view/lc-components/Section/index.less +7 -0
- package/es/lowcode/view/lc-components/Section/meta.json +48 -49
- package/es/lowcode/view/lc-components/Split/FunctionDesign.js +57 -2
- package/es/lowcode/view/lc-components/Split/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Split/index.js +46 -7
- package/es/lowcode/view/lc-components/Split/meta.json +10 -29
- package/es/lowcode/view/lc-components/Table/FunctionDesign.js +41 -4
- package/es/lowcode/view/lc-components/Table/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Table/components/TopFilter.js +96 -0
- package/es/lowcode/view/lc-components/Table/index.js +365 -48
- package/es/lowcode/view/lc-components/Table/meta.json +229 -55
- package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +70 -2
- package/es/lowcode/view/lc-components/Tabs/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Tabs/FunctionPreview.js +10 -0
- package/es/lowcode/view/lc-components/Tabs/index.js +113 -10
- package/es/lowcode/view/lc-components/Tabs/meta.json +53 -81
- package/es/lowcode/view/lc-components/Text/FunctionPreview.js +9 -0
- package/es/lowcode/view/lc-components/Text/index.js +1 -0
- package/es/lowcode/view/lc-components/Text/meta.json +3 -3
- package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +63 -3
- package/es/lowcode/view/lc-components/Tree/FunctionPreview.js +26 -0
- package/es/lowcode/view/lc-components/Tree/index.js +323 -8
- package/es/lowcode/view/lc-components/Tree/index.less +5 -0
- package/es/lowcode/view/lc-components/Tree/meta.json +224 -80
- package/es/lowcode/view/lc-components/Wrapper.js +44 -27
- package/es/lowcode/view/style/page.less +3 -0
- package/es/services.js +5 -3
- package/es/upload/Form/gridForm.js +7 -3
- package/es/utils/grid.js +2 -2
- package/lib/components/Builder/index.js +4 -1
- package/lib/components/IconFont/index.js +11 -0
- package/lib/components/LDActions/index.js +141 -0
- package/lib/components/LDActions/index.less +65 -0
- package/lib/components/LdAutoForm/index.js +1 -1
- package/lib/components/LdCom/index.js +2 -1
- package/lib/components/LdFormList/index.js +14 -9
- package/lib/components/LdGrid/index.js +13 -7
- package/lib/components/LdGridForm/index.js +4 -3
- package/lib/components/LdRuntimeCom/index.js +21 -8
- package/lib/components/LdTree/index.js +112 -31
- package/lib/components/LdTree/index.less +6 -1
- package/lib/helper/ldBuilder.js +28 -12
- package/lib/helper/ldComBuild.js +27 -12
- package/lib/index.js +8 -0
- package/lib/locales/zh-CN.js +236 -0
- package/lib/lowcode/constants/api-url.js +465 -263
- package/lib/lowcode/constants/event-topics.js +5 -1
- package/lib/lowcode/constants/index.js +32 -3
- package/lib/lowcode/engine/factory/panel-item-factory/CheckboxStrategy.js +38 -0
- package/lib/lowcode/engine/factory/panel-item-factory/index.js +2 -0
- package/lib/lowcode/engine/meta/box.props.default.json +4 -3
- package/lib/lowcode/engine/meta/box.props.json +2 -4
- package/lib/lowcode/engine/meta/button.props.default.json +5 -2
- package/lib/lowcode/engine/meta/button.props.json +9 -9
- package/lib/lowcode/engine/meta/cardlist.props.default.json +4 -2
- package/lib/lowcode/engine/meta/cardlist.props.json +2 -3
- package/lib/lowcode/engine/meta/components-list.json +1 -1
- package/lib/lowcode/engine/meta/dialog.props.default.json +4 -2
- package/lib/lowcode/engine/meta/dialog.props.json +1 -2
- package/lib/lowcode/engine/meta/drawer.props.default.json +4 -2
- package/lib/lowcode/engine/meta/drawer.props.json +1 -2
- package/lib/lowcode/engine/meta/form.props.default.json +52 -4
- package/lib/lowcode/engine/meta/form.props.json +596 -64
- package/lib/lowcode/engine/meta/iframe.props.default.json +1 -1
- package/lib/lowcode/engine/meta/iframe.props.json +1 -1
- package/lib/lowcode/engine/meta/image.props.default.json +5 -2
- package/lib/lowcode/engine/meta/image.props.json +3 -3
- package/lib/lowcode/engine/meta/imex.props.default.json +5 -2
- package/lib/lowcode/engine/meta/imex.props.json +2 -2
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +152 -26
- package/lib/lowcode/engine/meta/jsx.props.default.json +2 -1
- package/lib/lowcode/engine/meta/jsx.props.json +10 -5
- package/lib/lowcode/engine/meta/layout.props.default.json +5 -2
- package/lib/lowcode/engine/meta/layout.props.json +1 -2
- package/lib/lowcode/engine/meta/link.props.default.json +5 -2
- package/lib/lowcode/engine/meta/link.props.json +3 -3
- package/lib/lowcode/engine/meta/local/local.zh-cn.js +103 -0
- package/lib/lowcode/engine/meta/page.props.default.json +12 -0
- package/lib/lowcode/engine/meta/page.props.json +49 -0
- package/lib/lowcode/engine/meta/pagecontent.props.default.json +6 -0
- package/lib/lowcode/engine/meta/pagecontent.props.json +7 -0
- package/lib/lowcode/engine/meta/pagefooter.props.default.json +6 -0
- package/lib/lowcode/engine/meta/pagefooter.props.json +7 -0
- package/lib/lowcode/engine/meta/pageheader.props.default.json +6 -0
- package/lib/lowcode/engine/meta/pageheader.props.json +7 -0
- package/lib/lowcode/engine/meta/section.props.default.json +7 -6
- package/lib/lowcode/engine/meta/section.props.json +52 -49
- package/lib/lowcode/engine/meta/split.props.default.json +9 -4
- package/lib/lowcode/engine/meta/split.props.json +14 -29
- package/lib/lowcode/engine/meta/table.props.default.json +23 -3
- package/lib/lowcode/engine/meta/table.props.json +257 -55
- package/lib/lowcode/engine/meta/tabs.props.default.json +16 -9
- package/lib/lowcode/engine/meta/tabs.props.json +57 -81
- package/lib/lowcode/engine/meta/text.props.default.json +5 -2
- package/lib/lowcode/engine/meta/text.props.json +3 -3
- package/lib/lowcode/engine/meta/tree.props.default.json +20 -7
- package/lib/lowcode/engine/meta/tree.props.json +225 -79
- package/lib/lowcode/engine/provider/ContextProvider/index.js +185 -0
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +182 -0
- package/lib/lowcode/engine/tools/dataProcess.js +64 -1
- package/lib/lowcode/engine/tools/helper.js +101 -17
- package/lib/lowcode/engine/tools/useCanvasRender.js +88 -0
- package/lib/lowcode/engine/tools/usePromiseState.js +22 -12
- package/lib/lowcode/engine/tools/useTodo.js +85 -0
- package/lib/lowcode/index.js +7 -0
- package/lib/lowcode/painter/Components.js +46 -20
- package/lib/lowcode/painter/Design.js +32 -0
- package/lib/lowcode/painter/DesignOperator.js +45 -28
- package/lib/lowcode/painter/DesignToolbar.js +321 -13
- package/lib/lowcode/painter/I18n.js +1 -1
- package/lib/lowcode/painter/Outline.js +29 -24
- package/lib/lowcode/painter/Panel.js +96 -139
- package/lib/lowcode/painter/Ribbon.js +1 -1
- package/lib/lowcode/painter/components/ActionBindModal.js +300 -0
- package/lib/lowcode/painter/components/AdvancePanel.js +148 -0
- package/lib/lowcode/painter/components/AttrsPanel.js +153 -0
- package/lib/lowcode/painter/components/Collapse.js +20 -9
- package/lib/lowcode/painter/components/ColorInput.js +5 -3
- package/lib/lowcode/painter/components/DragDrop/DragDropContext.js +146 -0
- package/lib/lowcode/painter/components/DragDrop/DragDropWrapper.js +57 -0
- package/lib/lowcode/painter/components/DragDrop/Overlay.js +15 -0
- package/lib/lowcode/painter/components/DragDrop/TreeDragDropWrapper.js +75 -0
- package/lib/lowcode/painter/components/FieldSelector.js +52 -0
- package/lib/lowcode/painter/components/ListEditor.js +25 -10
- package/lib/lowcode/painter/components/PanelItem.js +1 -1
- package/lib/lowcode/painter/components/PopConfirm.js +10 -3
- package/lib/lowcode/painter/components/SortBox.js +12 -5
- package/lib/lowcode/painter/components/TreeEditor.js +20 -0
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +14 -2
- package/lib/lowcode/painter/components/code-editor/JSEditor.js +25 -14
- package/lib/lowcode/painter/components/code-editor/JsonEditor.js +48 -0
- package/lib/lowcode/painter/components/field-setting/BatchSetting.js +161 -0
- package/lib/lowcode/painter/components/field-setting/CheckRules.js +133 -0
- package/lib/lowcode/painter/components/field-setting/FieldAttrs.js +295 -0
- package/lib/lowcode/painter/components/field-setting/FieldAttrsModal.js +298 -0
- package/lib/lowcode/painter/components/field-setting/FieldDefaultValue.js +70 -0
- package/lib/lowcode/painter/components/field-setting/FieldRulesModal.js +123 -0
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +446 -0
- package/lib/lowcode/painter/components/field-setting/index.js +380 -0
- package/lib/lowcode/painter/index.js +3 -30
- package/lib/lowcode/painter/panel-section/ActionsColumnWidth.js +32 -0
- package/lib/lowcode/painter/{components/actions-editor → panel-section/ActionsEditor}/ActionEditor.js +20 -66
- package/lib/lowcode/painter/{components/actions-editor → panel-section/ActionsEditor}/index.js +71 -10
- package/lib/lowcode/painter/panel-section/BlockEditor/index.js +34 -0
- package/lib/lowcode/painter/panel-section/BlocksEditor/BlockEditorItem.js +52 -0
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +242 -0
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +112 -40
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +337 -0
- package/lib/lowcode/painter/panel-section/I18nInput.js +27 -0
- package/lib/lowcode/painter/panel-section/Icon.js +16 -14
- package/lib/lowcode/painter/panel-section/IconConditionSelector.js +119 -0
- package/lib/lowcode/painter/panel-section/IconSelector.js +5 -2
- package/lib/lowcode/painter/panel-section/ImpExp.js +98 -0
- package/lib/lowcode/painter/panel-section/JSEditor.js +57 -0
- package/lib/lowcode/painter/panel-section/LayoutRatio.js +5 -6
- package/lib/lowcode/painter/panel-section/SerialsSelector.js +51 -0
- package/lib/lowcode/painter/panel-section/SplitDisplay.js +256 -0
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/StyleContext.js +3 -23
- package/lib/lowcode/painter/panel-section/TabItems.js +45 -29
- package/lib/lowcode/painter/panel-section/TableTopFilter.js +314 -0
- package/lib/lowcode/painter/panel-section/TableZebra.js +67 -6
- package/lib/lowcode/painter/panel-section/TreeRootEditor.js +86 -0
- package/lib/lowcode/painter/style/action-bind-modal.less +102 -0
- package/lib/lowcode/painter/style/collapse.less +6 -0
- package/lib/lowcode/painter/style/components.less +5 -4
- package/lib/lowcode/painter/style/design.less +7 -4
- package/lib/lowcode/painter/style/dragdrop.less +10 -0
- package/lib/lowcode/painter/style/fields-setting.less +25 -0
- package/lib/lowcode/painter/style/impexp.less +7 -0
- package/lib/lowcode/painter/style/list-editor.less +36 -0
- package/lib/lowcode/painter/style/panel-attrs.less +43 -0
- package/lib/lowcode/painter/style/panel.less +6 -37
- package/lib/lowcode/painter/style/pop-confirm.less +9 -2
- package/lib/lowcode/painter/style/split-display.less +28 -0
- package/lib/lowcode/painter/style/treedragdrop.less +19 -0
- package/lib/lowcode/preview/index.js +35 -0
- package/lib/lowcode/view/Canvas.js +32 -145
- package/lib/lowcode/view/Loading.js +6 -2
- package/lib/lowcode/view/Page.js +12 -10
- package/lib/lowcode/view/lc-components/Box/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Box/index.js +11 -2
- package/lib/lowcode/view/lc-components/Box/index.less +0 -1
- package/lib/lowcode/view/lc-components/Box/meta.json +2 -4
- package/lib/lowcode/view/lc-components/Button/FunctionDesign.js +8 -10
- package/lib/lowcode/view/lc-components/Button/FunctionLive.js +3 -6
- package/lib/lowcode/view/lc-components/Button/FunctionPreview.js +13 -0
- package/lib/lowcode/view/lc-components/Button/index.js +41 -18
- package/lib/lowcode/view/lc-components/Button/meta.json +9 -9
- package/lib/lowcode/view/lc-components/CardList/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/CardList/index.js +1 -0
- package/lib/lowcode/view/lc-components/CardList/meta.json +2 -3
- package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +15 -24
- package/lib/lowcode/view/lc-components/Dialog/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Dialog/index.js +1 -0
- package/lib/lowcode/view/lc-components/Dialog/meta.json +1 -2
- package/lib/lowcode/view/lc-components/Drawer/FunctionDesign.js +4 -2
- package/lib/lowcode/view/lc-components/Drawer/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Drawer/index.js +17 -0
- package/lib/lowcode/view/lc-components/Drawer/index.less +3 -0
- package/lib/lowcode/view/lc-components/Drawer/meta.json +1 -2
- package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +94 -2
- package/lib/lowcode/view/lc-components/Form/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Form/index.js +289 -12
- package/lib/lowcode/view/lc-components/Form/index.less +5 -0
- package/lib/lowcode/view/lc-components/Form/meta.json +546 -64
- package/lib/lowcode/view/lc-components/Iframe/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Iframe/index.js +1 -0
- package/lib/lowcode/view/lc-components/Iframe/meta.json +1 -1
- package/lib/lowcode/view/lc-components/ImEx/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/ImEx/index.js +1 -0
- package/lib/lowcode/view/lc-components/ImEx/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Image/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Image/index.js +1 -0
- package/lib/lowcode/view/lc-components/Image/meta.json +3 -3
- package/lib/lowcode/view/lc-components/JSX/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/JSX/index.js +19 -6
- package/lib/lowcode/view/lc-components/JSX/meta.json +8 -5
- package/lib/lowcode/view/lc-components/Layout/FunctionDesign.js +24 -22
- package/lib/lowcode/view/lc-components/Layout/FunctionLive.js +3 -8
- package/lib/lowcode/view/lc-components/Layout/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Layout/index.js +1 -0
- package/lib/lowcode/view/lc-components/Layout/meta.json +1 -2
- package/lib/lowcode/view/lc-components/Link/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Link/index.js +1 -0
- package/lib/lowcode/view/lc-components/Link/meta.json +3 -3
- package/lib/lowcode/view/lc-components/Page/meta.json +49 -0
- package/lib/lowcode/view/lc-components/PageContent/index.js +61 -0
- package/lib/lowcode/view/lc-components/PageContent/meta.json +9 -0
- package/lib/lowcode/view/lc-components/PageFooter/index.js +46 -0
- package/lib/lowcode/view/lc-components/PageFooter/meta.json +9 -0
- package/lib/lowcode/view/lc-components/PageHeader/index.js +48 -0
- package/lib/lowcode/view/lc-components/PageHeader/meta.json +9 -0
- package/lib/lowcode/view/lc-components/PageModal/index.js +30 -0
- package/lib/lowcode/view/lc-components/Section/FunctionDesign.js +31 -2
- package/lib/lowcode/view/lc-components/Section/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Section/index.js +114 -23
- package/lib/lowcode/view/lc-components/Section/index.less +7 -0
- package/lib/lowcode/view/lc-components/Section/meta.json +48 -49
- package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +58 -2
- package/lib/lowcode/view/lc-components/Split/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Split/index.js +45 -6
- package/lib/lowcode/view/lc-components/Split/meta.json +10 -29
- package/lib/lowcode/view/lc-components/Table/FunctionDesign.js +43 -5
- package/lib/lowcode/view/lc-components/Table/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Table/components/TopFilter.js +104 -0
- package/lib/lowcode/view/lc-components/Table/index.js +364 -47
- package/lib/lowcode/view/lc-components/Table/meta.json +229 -55
- package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +71 -2
- package/lib/lowcode/view/lc-components/Tabs/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Tabs/FunctionPreview.js +17 -0
- package/lib/lowcode/view/lc-components/Tabs/index.js +112 -9
- package/lib/lowcode/view/lc-components/Tabs/meta.json +53 -81
- package/lib/lowcode/view/lc-components/Text/FunctionPreview.js +16 -0
- package/lib/lowcode/view/lc-components/Text/index.js +1 -0
- package/lib/lowcode/view/lc-components/Text/meta.json +3 -3
- package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +64 -3
- package/lib/lowcode/view/lc-components/Tree/FunctionPreview.js +33 -0
- package/lib/lowcode/view/lc-components/Tree/index.js +321 -6
- package/lib/lowcode/view/lc-components/Tree/index.less +5 -0
- package/lib/lowcode/view/lc-components/Tree/meta.json +224 -80
- package/lib/lowcode/view/lc-components/Wrapper.js +42 -25
- package/lib/lowcode/view/style/page.less +3 -0
- package/lib/services.js +5 -3
- package/lib/upload/Form/gridForm.js +7 -3
- package/lib/utils/grid.js +2 -2
- package/package.json +12 -7
- package/es/lowcode/engine/provider/ContextProvider.js +0 -169
- package/es/lowcode/painter/components/actions-editor/ActionEditor.js +0 -147
- package/es/lowcode/painter/panel-section/TableActions.js +0 -19
- package/lib/lowcode/engine/provider/ContextProvider.js +0 -177
- package/lib/lowcode/painter/panel-section/TableActions.js +0 -26
|
@@ -1,20 +1,297 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import React, { useRef } from 'react';
|
|
4
|
-
import { useMemoizedFn } from 'ahooks';
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
+
import React, { useRef, forwardRef, Fragment, useImperativeHandle } from 'react';
|
|
4
|
+
import { useMemoizedFn, useCreation, useMount, useUnmount } from 'ahooks';
|
|
5
|
+
import classNames from 'classnames';
|
|
6
|
+
import { reduce, includes, isNil } from 'lodash';
|
|
7
|
+
import { BasicDivider } from 'luck-design';
|
|
8
|
+
import { Collapse } from '@luck-design-biz/base';
|
|
5
9
|
import Wrapper from "../Wrapper";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
import { LdFormList } from "../../../../index";
|
|
11
|
+
import { omitBadProps, executeCode } from "../../../engine/tools/helper";
|
|
12
|
+
import { useContext, useRemoteSource } from "../../../engine/provider/ContextProvider";
|
|
13
|
+
import buildUploadForm from "../../../../upload/Form";
|
|
14
|
+
import LdRuntimeCom from "../../../../components/LdRuntimeCom";
|
|
15
|
+
import defaultMeta from "../../../engine/meta/form.props.default.json";
|
|
16
|
+
import styles from "./index.less";
|
|
17
|
+
var Header = function Header(_ref) {
|
|
18
|
+
var _ref$header = _ref.header,
|
|
19
|
+
header = _ref$header === void 0 ? 'collapse' : _ref$header,
|
|
20
|
+
title = _ref.title,
|
|
21
|
+
ldId = _ref.ldId,
|
|
22
|
+
children = _ref.children;
|
|
23
|
+
if (header === 'collapse' || header === 'collapseFollow') return /*#__PURE__*/React.createElement(Collapse, {
|
|
24
|
+
title: title || ldId,
|
|
25
|
+
id: ldId,
|
|
26
|
+
key: ldId,
|
|
27
|
+
mode: header === 'collapse' && 'tab'
|
|
28
|
+
}, children);
|
|
29
|
+
return /*#__PURE__*/React.createElement(Fragment, {
|
|
30
|
+
key: ldId
|
|
31
|
+
}, header === 'divider' && /*#__PURE__*/React.createElement(BasicDivider, {
|
|
32
|
+
title: title || ldId,
|
|
33
|
+
id: ldId
|
|
34
|
+
}), children);
|
|
35
|
+
};
|
|
36
|
+
var LCForm = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
37
|
+
var id = _ref2.id,
|
|
38
|
+
parentId = _ref2.parentId,
|
|
39
|
+
width = _ref2.width,
|
|
40
|
+
height = _ref2.height,
|
|
41
|
+
className = _ref2.className,
|
|
42
|
+
blocks = _ref2.blocks,
|
|
43
|
+
advance = _ref2.advance,
|
|
44
|
+
initData = _ref2.initData,
|
|
45
|
+
readOnly = _ref2.readOnly,
|
|
46
|
+
showSave = _ref2.showSave,
|
|
47
|
+
saveTitle = _ref2.saveTitle,
|
|
48
|
+
settingLayout = _ref2.settingLayout,
|
|
49
|
+
renderFormLeft = _ref2.renderFormLeft,
|
|
50
|
+
renderFormRight = _ref2.renderFormRight,
|
|
51
|
+
children = _ref2.children;
|
|
52
|
+
var apiRef = useRef();
|
|
53
|
+
var boxRef = useRef();
|
|
54
|
+
var formRef = useRef();
|
|
55
|
+
var ctx = useContext();
|
|
56
|
+
var remoteSource = useRemoteSource();
|
|
57
|
+
var serials = useCreation(function () {
|
|
58
|
+
var _remoteSource$serials;
|
|
59
|
+
return ((_remoteSource$serials = remoteSource.serials) === null || _remoteSource$serials === void 0 ? void 0 : _remoteSource$serials.map(function (i) {
|
|
60
|
+
return i.serial;
|
|
61
|
+
})) || [];
|
|
62
|
+
}, [remoteSource.serials]);
|
|
63
|
+
useMount(function () {
|
|
64
|
+
ctx.doAction(advance.events.onMount, {
|
|
65
|
+
instance: (ref || formRef).current
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
useUnmount(function () {
|
|
69
|
+
ctx.doAction(advance.events.onUnmount, {
|
|
70
|
+
instance: (ref || formRef).current
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
useImperativeHandle(apiRef, function () {
|
|
74
|
+
return {
|
|
75
|
+
getForm: function getForm() {
|
|
76
|
+
return (ref || formRef).current;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
});
|
|
10
80
|
var getTargetDom = useMemoizedFn(function () {
|
|
11
|
-
return
|
|
81
|
+
return boxRef.current;
|
|
82
|
+
});
|
|
83
|
+
var handleDefaultDataSourceFormat = useMemoizedFn(function (defaultDataSourceFormat, defaultValues) {
|
|
84
|
+
if (isNil(defaultDataSourceFormat)) return function () {
|
|
85
|
+
return defaultValues;
|
|
86
|
+
};
|
|
87
|
+
return executeCode(ctx, defaultDataSourceFormat, ['defaultValues'], defaultValues);
|
|
88
|
+
});
|
|
89
|
+
var handleDataSourceFormat = useMemoizedFn(function (dataSourceFormat, _ref3) {
|
|
90
|
+
var values = _ref3.values,
|
|
91
|
+
submitData = _ref3.submitData;
|
|
92
|
+
if (isNil(dataSourceFormat)) return submitData;
|
|
93
|
+
return executeCode(ctx, dataSourceFormat, ['values', 'submitData'], values, submitData);
|
|
94
|
+
});
|
|
95
|
+
var handleResetActionsColumn = useMemoizedFn(function (actionsColumnReset, data, index, actions, params) {
|
|
96
|
+
return executeCode(ctx, actionsColumnReset, ['data', 'index', 'actions', 'params'], data, index, actions, params);
|
|
97
|
+
});
|
|
98
|
+
var handleColumnsReset = useMemoizedFn(function (actionsColumnReset, columns) {
|
|
99
|
+
if (isNil(actionsColumnReset)) return columns;
|
|
100
|
+
return executeCode(ctx, actionsColumnReset, ['columns'], columns);
|
|
101
|
+
});
|
|
102
|
+
var handleGridFormReady = useMemoizedFn(function (onGridFormReady, ref, params, gridForm) {
|
|
103
|
+
if (!isNil(onGridFormReady)) return executeCode(ctx, onGridFormReady, ['ref', 'params', 'gridForm'], ref, params, gridForm);
|
|
104
|
+
});
|
|
105
|
+
var handleResetActions = useMemoizedFn(function (resetActions, data, index, actionList, params) {
|
|
106
|
+
if (isNil(resetActions)) return actionList;
|
|
107
|
+
return executeCode(ctx, resetActions, ['data', 'index', 'actionList', 'params'], data, index, actionList, params);
|
|
108
|
+
});
|
|
109
|
+
var handleForbiddenTypes = useMemoizedFn(function (forbiddenTypes) {
|
|
110
|
+
if (isNil(forbiddenTypes)) return [];
|
|
111
|
+
return executeCode(ctx, forbiddenTypes, []);
|
|
112
|
+
});
|
|
113
|
+
var handleBeforeUpload = useMemoizedFn(function (beforeUpload, file, fileList) {
|
|
114
|
+
if (isNil(beforeUpload)) return true;
|
|
115
|
+
return executeCode(ctx, beforeUpload, ['file', 'fileList'], file, fileList);
|
|
116
|
+
});
|
|
117
|
+
var handleUploadChange = useMemoizedFn(function (onUploadChange, e) {
|
|
118
|
+
if (!isNil(onUploadChange)) return executeCode(ctx, onUploadChange, ['event'], e);
|
|
119
|
+
});
|
|
120
|
+
var renderAffix = useMemoizedFn(function (_render) {
|
|
121
|
+
return _render ? /*#__PURE__*/React.createElement(LdRuntimeCom, null, _render) : null;
|
|
122
|
+
});
|
|
123
|
+
var renderFormList = useMemoizedFn(function (formConfig) {
|
|
124
|
+
return reduce(blocks, function (result, item) {
|
|
125
|
+
if (includes(['auto', 'grid', 'writer'], item.type) && item.dataset && includes(item.mode, formConfig.formMode)) {
|
|
126
|
+
var data = {
|
|
127
|
+
id: item.id,
|
|
128
|
+
order: item.order,
|
|
129
|
+
type: item.type,
|
|
130
|
+
readOnly: item.readOnly,
|
|
131
|
+
title: item.name,
|
|
132
|
+
header: item.header,
|
|
133
|
+
dataSetKey: item.dataset.code,
|
|
134
|
+
serial: item.serial,
|
|
135
|
+
serialEffect: item.serialEffect,
|
|
136
|
+
defaultDataSourceFormat: function defaultDataSourceFormat(defaultValues) {
|
|
137
|
+
return handleDefaultDataSourceFormat(item.defaultDataSourceFormat, defaultValues);
|
|
138
|
+
},
|
|
139
|
+
onUpdate: {
|
|
140
|
+
post: function post(data) {
|
|
141
|
+
return handleDataSourceFormat(item.dataSourceFormat, data);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
if (item.type === 'auto') data = _objectSpread(_objectSpread({}, data), {}, {
|
|
146
|
+
col: item.cols
|
|
147
|
+
});else data = _objectSpread(_objectSpread({}, data), {}, {
|
|
148
|
+
suppressPreset: item.suppressPreset,
|
|
149
|
+
height: item.height,
|
|
150
|
+
bordered: item.bordered,
|
|
151
|
+
draggable: item.draggable,
|
|
152
|
+
orderByAdd: item.orderByAdd,
|
|
153
|
+
hideActionsColumn: item.suppressActions,
|
|
154
|
+
actionsWidth: item.actionsColumnWidth,
|
|
155
|
+
columnsReset: function columnsReset(columns) {
|
|
156
|
+
return handleColumnsReset(item.columnsReset, columns);
|
|
157
|
+
},
|
|
158
|
+
onGridFormReady: function onGridFormReady(ref, params, gridForm) {
|
|
159
|
+
return handleGridFormReady(item.onGridFormReady, ref, params, gridForm);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
if (item.actionsColumnReset) data = _objectSpread(_objectSpread({}, data), {}, {
|
|
163
|
+
resetActionsColumn: function resetActionsColumn(data, index, actions, params) {
|
|
164
|
+
return handleResetActionsColumn(item.actionsColumnReset, data, index, actions, params);
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
result.push(data);
|
|
168
|
+
}
|
|
169
|
+
return result;
|
|
170
|
+
}, []);
|
|
171
|
+
});
|
|
172
|
+
var renderFormExtra = useMemoizedFn(function (formConfig) {
|
|
173
|
+
return reduce(blocks, function (result, item) {
|
|
174
|
+
if (includes(item.mode, formConfig.formMode) && !item.serial || item.serialEffect === 'disable' || includes(serials, item.serial)) {
|
|
175
|
+
if (item.type === 'uploadForm') {
|
|
176
|
+
var _remoteSource$pageinf;
|
|
177
|
+
var dom = /*#__PURE__*/React.createElement(Header, {
|
|
178
|
+
ldId: item.id,
|
|
179
|
+
key: item.id,
|
|
180
|
+
header: item.header,
|
|
181
|
+
title: item.name,
|
|
182
|
+
order: item.order
|
|
183
|
+
}, buildUploadForm(_objectSpread(_objectSpread({}, formConfig), {}, {
|
|
184
|
+
formId: item.id,
|
|
185
|
+
moduleCode: remoteSource === null || remoteSource === void 0 || (_remoteSource$pageinf = remoteSource.pageinfo) === null || _remoteSource$pageinf === void 0 || (_remoteSource$pageinf = _remoteSource$pageinf.relationship) === null || _remoteSource$pageinf === void 0 ? void 0 : _remoteSource$pageinf.moduleCode,
|
|
186
|
+
readOnly: item.readOnly || formConfig.readOnly || item.serial && !includes(serials, item.serial),
|
|
187
|
+
suppressPreset: item.suppressPreset,
|
|
188
|
+
height: item.height,
|
|
189
|
+
bordered: item.bordered,
|
|
190
|
+
showNote: item.showNote,
|
|
191
|
+
zipName: "".concat(item.zipName || 'download', ".zip"),
|
|
192
|
+
uploadUrl: item.uploadUrl,
|
|
193
|
+
resetActions: item.useResetActions ? null : function () {
|
|
194
|
+
for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
195
|
+
params[_key] = arguments[_key];
|
|
196
|
+
}
|
|
197
|
+
return handleResetActions.apply(void 0, [item.resetActions].concat(params));
|
|
198
|
+
},
|
|
199
|
+
forbiddenTypes: function forbiddenTypes() {
|
|
200
|
+
return handleForbiddenTypes(item.forbiddenTypes);
|
|
201
|
+
},
|
|
202
|
+
beforeUpload: function beforeUpload() {
|
|
203
|
+
for (var _len2 = arguments.length, params = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
204
|
+
params[_key2] = arguments[_key2];
|
|
205
|
+
}
|
|
206
|
+
return handleBeforeUpload.apply(void 0, [item.beforeUpload].concat(params));
|
|
207
|
+
},
|
|
208
|
+
onUploadChange: function onUploadChange(e) {
|
|
209
|
+
return handleUploadChange(item.onUploadChange, e);
|
|
210
|
+
}
|
|
211
|
+
})));
|
|
212
|
+
result.push(dom);
|
|
213
|
+
}
|
|
214
|
+
if (item.type === 'blank') {
|
|
215
|
+
var _dom = /*#__PURE__*/React.createElement(Header, {
|
|
216
|
+
ldId: item.id,
|
|
217
|
+
key: item.id,
|
|
218
|
+
header: item.header,
|
|
219
|
+
title: item.name,
|
|
220
|
+
order: item.order
|
|
221
|
+
}, children === null || children === void 0 ? void 0 : children.find(function (child) {
|
|
222
|
+
return child.props.formBoxId === item.id;
|
|
223
|
+
}));
|
|
224
|
+
result.push(_dom);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return result;
|
|
228
|
+
}, []);
|
|
229
|
+
});
|
|
230
|
+
var beforeSubmit = useMemoizedFn(function (values, data) {
|
|
231
|
+
return new Promise(function (resolve) {
|
|
232
|
+
if (isNil(advance.events.beforeSave)) resolve(values);else {
|
|
233
|
+
var _data = ctx.doAction(advance.events.beforeSave, {
|
|
234
|
+
values: values,
|
|
235
|
+
data: data
|
|
236
|
+
});
|
|
237
|
+
resolve(_data);
|
|
238
|
+
}
|
|
239
|
+
;
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
var afterSubmit = useMemoizedFn(function (success, mainKey, res) {
|
|
243
|
+
ctx.doAction(advance.events.onSaveCallback, {
|
|
244
|
+
success: success,
|
|
245
|
+
mainKey: mainKey,
|
|
246
|
+
res: res
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
var onValueChange = useMemoizedFn(function (change, data) {
|
|
250
|
+
ctx.doAction(advance.events.onValueChange, {
|
|
251
|
+
change: change,
|
|
252
|
+
data: data
|
|
253
|
+
});
|
|
254
|
+
});
|
|
255
|
+
var onChildChange = useMemoizedFn(function (instance) {
|
|
256
|
+
ctx.doAction(advance.events.onChildChange, {
|
|
257
|
+
instance: instance
|
|
258
|
+
});
|
|
12
259
|
});
|
|
13
260
|
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
14
261
|
id: id,
|
|
15
|
-
|
|
262
|
+
displayName: "Form",
|
|
263
|
+
getTargetDom: getTargetDom,
|
|
264
|
+
api: apiRef
|
|
16
265
|
}, /*#__PURE__*/React.createElement("div", {
|
|
17
|
-
ref:
|
|
18
|
-
|
|
19
|
-
|
|
266
|
+
ref: boxRef,
|
|
267
|
+
style: {
|
|
268
|
+
width: width,
|
|
269
|
+
height: height
|
|
270
|
+
}
|
|
271
|
+
}, /*#__PURE__*/React.createElement(LdFormList, {
|
|
272
|
+
id: id,
|
|
273
|
+
ldId: id,
|
|
274
|
+
className: classNames(styles['lc-component-form'], _defineProperty({}, className, !!className)),
|
|
275
|
+
renderFormList: renderFormList,
|
|
276
|
+
renderFormExtra: renderFormExtra,
|
|
277
|
+
mainFormLdId: "block_main",
|
|
278
|
+
initData: initData,
|
|
279
|
+
ref: ref || formRef,
|
|
280
|
+
readOnly: readOnly,
|
|
281
|
+
showSaveBtn: showSave,
|
|
282
|
+
saveBtnTitle: saveTitle,
|
|
283
|
+
affixLayout: settingLayout,
|
|
284
|
+
renderAffixLeft: function renderAffixLeft() {
|
|
285
|
+
return renderAffix(renderFormLeft);
|
|
286
|
+
},
|
|
287
|
+
renderAffixRight: function renderAffixRight() {
|
|
288
|
+
return renderAffix(renderFormRight);
|
|
289
|
+
},
|
|
290
|
+
beforeSubmit: beforeSubmit,
|
|
291
|
+
afterSubmit: advance.events.onSaveCallback ? afterSubmit : null,
|
|
292
|
+
onValueChange: onValueChange,
|
|
293
|
+
onChildChange: onChildChange
|
|
294
|
+
})));
|
|
295
|
+
});
|
|
296
|
+
LCForm.defaultProps = omitBadProps(defaultMeta);
|
|
20
297
|
export default LCForm;
|