@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
|
@@ -3,33 +3,46 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["dsid", "defaultValue", "onChange"];
|
|
5
5
|
import React, { useState } from 'react';
|
|
6
|
+
import { useRequest } from 'ahooks';
|
|
6
7
|
import { Select } from 'luck-design/antd';
|
|
7
8
|
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
9
|
+
import { fetchFieldsByDataset } from "../../constants/api-url";
|
|
10
|
+
import { getLDMetaAttr } from "../../engine/tools/helper";
|
|
8
11
|
var FieldSelector = function FieldSelector(_ref) {
|
|
9
12
|
var dsid = _ref.dsid,
|
|
10
13
|
defaultValue = _ref.defaultValue,
|
|
11
14
|
onChange = _ref.onChange,
|
|
12
15
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
13
|
-
var _useState = useState([
|
|
14
|
-
value: 'state',
|
|
15
|
-
label: '状态'
|
|
16
|
-
}, {
|
|
17
|
-
value: 'type',
|
|
18
|
-
label: '类型'
|
|
19
|
-
}, {
|
|
20
|
-
value: 'year',
|
|
21
|
-
label: '年份'
|
|
22
|
-
}, {
|
|
23
|
-
value: 'count',
|
|
24
|
-
label: '次数'
|
|
25
|
-
}]),
|
|
16
|
+
var _useState = useState([]),
|
|
26
17
|
_useState2 = _slicedToArray(_useState, 2),
|
|
27
18
|
options = _useState2[0],
|
|
28
19
|
setOptions = _useState2[1];
|
|
20
|
+
var _useRequest = useRequest(fetchFieldsByDataset, {
|
|
21
|
+
defaultParams: [{
|
|
22
|
+
datasetUid: dsid,
|
|
23
|
+
moduleUid: getLDMetaAttr('moduleId')
|
|
24
|
+
}],
|
|
25
|
+
ready: !!dsid,
|
|
26
|
+
onSuccess: function onSuccess(_ref2) {
|
|
27
|
+
var code = _ref2.code,
|
|
28
|
+
list = _ref2.list,
|
|
29
|
+
detail = _ref2.detail;
|
|
30
|
+
if (code === 1) {
|
|
31
|
+
setOptions(list.map(function (_id) {
|
|
32
|
+
return {
|
|
33
|
+
value: detail[_id].field,
|
|
34
|
+
label: detail[_id].fieldAliasName
|
|
35
|
+
};
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}),
|
|
40
|
+
loading = _useRequest.loading;
|
|
29
41
|
return /*#__PURE__*/React.createElement(Select, _extends({
|
|
30
42
|
defaultValue: defaultValue,
|
|
31
43
|
onChange: onChange,
|
|
32
44
|
size: "small",
|
|
45
|
+
loading: loading,
|
|
33
46
|
placeholder: formatMessage({
|
|
34
47
|
id: "luckda.lowcode.painter.panel-section.field-selector.placeholder",
|
|
35
48
|
label: '请选择字段'
|
|
@@ -70,7 +70,8 @@ export var ListEditorItem = function ListEditorItem(_ref2) {
|
|
|
70
70
|
_ref2$sortable = _ref2.sortable,
|
|
71
71
|
sortable = _ref2$sortable === void 0 ? true : _ref2$sortable,
|
|
72
72
|
transform = _ref2.transform,
|
|
73
|
-
transition = _ref2.transition
|
|
73
|
+
transition = _ref2.transition,
|
|
74
|
+
onAddLine = _ref2.onAddLine;
|
|
74
75
|
return /*#__PURE__*/React.createElement("div", {
|
|
75
76
|
ref: setNodeRef,
|
|
76
77
|
style: style,
|
|
@@ -94,5 +95,10 @@ export var ListEditorItem = function ListEditorItem(_ref2) {
|
|
|
94
95
|
d: "M0.499972716,6 L1.50002728,6 C1.77615459,6 2,6.22384541 2,6.49997272 C2,6.77610002 1.77615459,6.99994543 1.50002728,6.99994543 L0.499972716,6.99994543 C0.22384541,6.99994543 3.38158422e-17,6.77610002 0,6.49997272 C-3.38158422e-17,6.22384541 0.22384541,6 0.499972716,6 Z M0.499972716,3 L1.50002728,3 C1.77615459,3 2,3.22384541 2,3.49997272 C2,3.77610002 1.77615459,3.99994543 1.50002728,3.99994543 L0.499972716,3.99994543 C0.22384541,3.99994543 3.38158422e-17,3.77610002 0,3.49997272 C-3.38158422e-17,3.22384541 0.22384541,3 0.499972716,3 Z M0.499972716,7.28787148e-18 L1.50002728,5.55666624e-14 C1.77615459,7.07214574e-14 2,0.22384541 2,0.499972716 C2,0.776100022 1.77615459,0.999945432 1.50002728,0.999945432 L0.499972716,0.999945432 C0.22384541,0.999945432 3.38158422e-17,0.776100022 0,0.499972716 C-3.38158422e-17,0.22384541 0.22384541,5.0723721e-17 0.499972716,0 Z M0.5,9.00002729 L1.5,9.00002729 C1.77614237,9.00002729 2,9.22388491 2,9.50002729 C2,9.77616966 1.77614237,10.0000273 1.5,10.0000273 L0.5,10.0000273 C0.223857625,10.0000273 3.38176876e-17,9.77616966 0,9.50002729 C-3.38176876e-17,9.22388491 0.223857625,9.00002729 0.5,9.00002729 Z M0.5,12.0000273 L1.5,12.0000273 C1.77614237,12.0000273 2,12.2238849 2,12.5000273 C2,12.7761697 1.77614237,13.0000273 1.5,13.0000273 L0.5,13.0000273 C0.223857625,13.0000273 3.38176876e-17,12.7761697 0,12.5000273 C-3.38176876e-17,12.2238849 0.223857625,12.0000273 0.5,12.0000273 Z M0.5,15.0000273 L1.5,15.0000273 C1.77614237,15.0000273 2,15.2238849 2,15.5000273 C2,15.7761697 1.77614237,16.0000273 1.5,16.0000273 L0.5,16.0000273 C0.223857625,16.0000273 3.38176876e-17,15.7761697 0,15.5000273 C-3.38176876e-17,15.2238849 0.223857625,15.0000273 0.5,15.0000273 Z M3.49997272,6 L4.50002728,6 C4.77615459,6 5,6.22384541 5,6.49997272 C5,6.77610002 4.77615459,6.99994543 4.50002728,6.99994543 L3.49997272,6.99994543 C3.22384541,6.99994543 3,6.77610002 3,6.49997272 C3,6.22384541 3.22384541,6 3.49997272,6 Z M3.49997272,3 L4.50002728,3 C4.77615459,3 5,3.22384541 5,3.49997272 C5,3.77610002 4.77615459,3.99994543 4.50002728,3.99994543 L3.49997272,3.99994543 C3.22384541,3.99994543 3,3.77610002 3,3.49997272 C3,3.22384541 3.22384541,3 3.49997272,3 Z M3.49997272,7.28787148e-18 L4.50002728,5.55666624e-14 C4.77615459,7.07214574e-14 5,0.22384541 5,0.499972716 C5,0.776100022 4.77615459,0.999945432 4.50002728,0.999945432 L3.49997272,0.999945432 C3.22384541,0.999945432 3,0.776100022 3,0.499972716 C3,0.22384541 3.22384541,5.0723721e-17 3.49997272,0 Z M3.5,9.00002729 L4.5,9.00002729 C4.77614237,9.00002729 5,9.22388491 5,9.50002729 C5,9.77616966 4.77614237,10.0000273 4.5,10.0000273 L3.5,10.0000273 C3.22385763,10.0000273 3,9.77616966 3,9.50002729 C3,9.22388491 3.22385763,9.00002729 3.5,9.00002729 Z M3.5,12.0000273 L4.5,12.0000273 C4.77614237,12.0000273 5,12.2238849 5,12.5000273 C5,12.7761697 4.77614237,13.0000273 4.5,13.0000273 L3.5,13.0000273 C3.22385763,13.0000273 3,12.7761697 3,12.5000273 C3,12.2238849 3.22385763,12.0000273 3.5,12.0000273 Z M3.5,15.0000273 L4.5,15.0000273 C4.77614237,15.0000273 5,15.2238849 5,15.5000273 C5,15.7761697 4.77614237,16.0000273 4.5,16.0000273 L3.5,16.0000273 C3.22385763,16.0000273 3,15.7761697 3,15.5000273 C3,15.2238849 3.22385763,15.0000273 3.5,15.0000273 Z"
|
|
95
96
|
}))), left), /*#__PURE__*/React.createElement("div", {
|
|
96
97
|
className: styles['list-item-right']
|
|
97
|
-
}, right)
|
|
98
|
+
}, right), onAddLine ? /*#__PURE__*/React.createElement("div", {
|
|
99
|
+
className: styles['list-item-bottom-line'],
|
|
100
|
+
onClick: function onClick() {
|
|
101
|
+
return onAddLine(item);
|
|
102
|
+
}
|
|
103
|
+
}) : null);
|
|
98
104
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["onChange", "isFullscreen"],
|
|
4
|
+
var _excluded = ["onChange", "isFullscreen", "style"],
|
|
5
5
|
_excluded2 = ["children", "language", "options"];
|
|
6
6
|
import React, { useEffect, useRef, useImperativeHandle, forwardRef } from 'react';
|
|
7
7
|
import * as monaco from 'monaco-editor';
|
|
@@ -42,6 +42,7 @@ import * as monaco from 'monaco-editor';
|
|
|
42
42
|
var BaseEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
43
43
|
var onChange = _ref.onChange,
|
|
44
44
|
isFullscreen = _ref.isFullscreen,
|
|
45
|
+
style = _ref.style,
|
|
45
46
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
46
47
|
var children = props.children,
|
|
47
48
|
_props$language = props.language,
|
|
@@ -102,7 +103,7 @@ var BaseEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
102
103
|
};
|
|
103
104
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
104
105
|
ref: editorRef,
|
|
105
|
-
style: editorStyle
|
|
106
|
+
style: _objectSpread(_objectSpread({}, editorStyle), style)
|
|
106
107
|
}, rest));
|
|
107
108
|
});
|
|
108
109
|
export default /*#__PURE__*/React.memo(BaseEditor);
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
4
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
4
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
6
5
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
7
6
|
var _excluded = ["children"];
|
|
8
7
|
import React, { useEffect, forwardRef } from 'react';
|
|
9
|
-
import BaseEditor from "./BaseEditor";
|
|
10
8
|
import * as monaco from 'monaco-editor';
|
|
11
9
|
import { isNil } from 'lodash';
|
|
10
|
+
import BaseEditor from "./BaseEditor";
|
|
12
11
|
function capitalizeFirstLetter(string) {
|
|
13
12
|
if (isNil(string)) return null;
|
|
14
13
|
if (string.length === 0) {
|
|
@@ -27,7 +26,6 @@ var _provideCompletionItems = function provideCompletionItems(monaco, model, pos
|
|
|
27
26
|
// 正则表达式匹配以 triggerWord 开头的任何单词
|
|
28
27
|
var pattern = new RegExp('\\b' + module.triggerWord + '[\\w.]*', 'i');
|
|
29
28
|
var match = textUntilPosition.match(pattern);
|
|
30
|
-
// console.log('match',match)
|
|
31
29
|
if (match) {
|
|
32
30
|
var word = model.getWordUntilPosition(position);
|
|
33
31
|
var range = {
|
|
@@ -55,10 +53,7 @@ var setupAutocomplete = /*#__PURE__*/function () {
|
|
|
55
53
|
return import("../../../engine/meta/js-editor/auto-complete.json");
|
|
56
54
|
case 2:
|
|
57
55
|
autoCompleteModules = _context.sent;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
monaco.languages.registerCompletionItemProvider('javascript', _defineProperty({
|
|
61
|
-
triggerCharacters: ['.'],
|
|
56
|
+
monaco.languages.registerCompletionItemProvider('javascript', {
|
|
62
57
|
provideCompletionItems: function provideCompletionItems(model, position) {
|
|
63
58
|
var allCompletionItems = [];
|
|
64
59
|
|
|
@@ -70,8 +65,9 @@ var setupAutocomplete = /*#__PURE__*/function () {
|
|
|
70
65
|
return {
|
|
71
66
|
suggestions: allCompletionItems
|
|
72
67
|
};
|
|
73
|
-
}
|
|
74
|
-
|
|
68
|
+
},
|
|
69
|
+
triggerCharacters: ['.'] // 当用户输入点号时触发补全
|
|
70
|
+
});
|
|
75
71
|
case 4:
|
|
76
72
|
case "end":
|
|
77
73
|
return _context.stop();
|
|
@@ -90,6 +90,8 @@ var BatchSetting = function BatchSetting(_ref) {
|
|
|
90
90
|
var _useDebounceFn = useDebounceFn(function (key, val) {
|
|
91
91
|
if (key === 'width') {
|
|
92
92
|
handleUIChange(key, val);
|
|
93
|
+
} else if (key === 'note' || key === 'tip' || key === 'placeholder') {
|
|
94
|
+
handleUIChange(key, val);
|
|
93
95
|
}
|
|
94
96
|
}, {
|
|
95
97
|
wait: 400
|
|
@@ -105,10 +107,18 @@ var BatchSetting = function BatchSetting(_ref) {
|
|
|
105
107
|
break;
|
|
106
108
|
}
|
|
107
109
|
handleUIChange(key, val);
|
|
108
|
-
_context.next =
|
|
110
|
+
_context.next = 10;
|
|
109
111
|
break;
|
|
110
112
|
case 4:
|
|
111
|
-
|
|
113
|
+
if (!(key === 'col' || key === 'row')) {
|
|
114
|
+
_context.next = 8;
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
handleUIChange(key, val);
|
|
118
|
+
_context.next = 10;
|
|
119
|
+
break;
|
|
120
|
+
case 8:
|
|
121
|
+
_context.next = 10;
|
|
112
122
|
return fetchAddFieldAttrs({
|
|
113
123
|
dataModelKey: dataModelKey,
|
|
114
124
|
moduleDatasetUid: datasetId,
|
|
@@ -121,7 +131,7 @@ var BatchSetting = function BatchSetting(_ref) {
|
|
|
121
131
|
}],
|
|
122
132
|
datasetBusinessUids: _toConsumableArray(fieldsData.keys())
|
|
123
133
|
});
|
|
124
|
-
case
|
|
134
|
+
case 10:
|
|
125
135
|
case "end":
|
|
126
136
|
return _context.stop();
|
|
127
137
|
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useRef, useImperativeHandle, useState } from 'react';
|
|
3
|
+
import { useMount, useCreation } from 'ahooks';
|
|
4
|
+
import { keyBy } from 'lodash';
|
|
5
|
+
import { Form, Row, Col, Select } from 'luck-design/antd';
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
8
|
+
import { JSEditor } from "../code-editor";
|
|
9
|
+
import { getFrontRules } from "./meta/frontRules";
|
|
10
|
+
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel-section.fieldsSetting.checkRules';
|
|
11
|
+
var FormItem = styled(Form.Item).withConfig({
|
|
12
|
+
displayName: "FormItem",
|
|
13
|
+
componentId: "luckda-6530__sc-d9mrmm-0"
|
|
14
|
+
})(["margin-bottom:0;"]);
|
|
15
|
+
var CheckRules = function CheckRules(_ref) {
|
|
16
|
+
var form = _ref.form,
|
|
17
|
+
fields = _ref.fields,
|
|
18
|
+
rule = _ref.rule,
|
|
19
|
+
fieldData = _ref.fieldData,
|
|
20
|
+
ruleRef = _ref.ruleRef;
|
|
21
|
+
var _useState = useState(),
|
|
22
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
23
|
+
verifyType = _useState2[0],
|
|
24
|
+
setVerifyType = _useState2[1];
|
|
25
|
+
var _useState3 = useState(''),
|
|
26
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
27
|
+
expression = _useState4[0],
|
|
28
|
+
setExpression = _useState4[1];
|
|
29
|
+
var jsRef = useRef();
|
|
30
|
+
useImperativeHandle(ruleRef, function () {
|
|
31
|
+
return jsRef.current;
|
|
32
|
+
});
|
|
33
|
+
useMount(function () {
|
|
34
|
+
if (rule.uid) {
|
|
35
|
+
form.setFieldsValue({
|
|
36
|
+
verifyType: rule.verifyType
|
|
37
|
+
});
|
|
38
|
+
setExpression(rule.expression);
|
|
39
|
+
} else {
|
|
40
|
+
var defaultType = getFrontRules(fieldData.property)[0].key;
|
|
41
|
+
form.setFieldsValue({
|
|
42
|
+
verifyType: defaultType
|
|
43
|
+
});
|
|
44
|
+
setVerifyType(defaultType);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
var frontRulesObj = useCreation(function () {
|
|
48
|
+
return keyBy(getFrontRules(fieldData.property), 'key');
|
|
49
|
+
}, []);
|
|
50
|
+
var frontRule = useCreation(function () {
|
|
51
|
+
var _frontRulesObj$verify;
|
|
52
|
+
setExpression(((_frontRulesObj$verify = frontRulesObj[verifyType]) === null || _frontRulesObj$verify === void 0 ? void 0 : _frontRulesObj$verify.defaultCode) || '');
|
|
53
|
+
if (verifyType) return frontRulesObj[verifyType];
|
|
54
|
+
return {
|
|
55
|
+
noCode: false
|
|
56
|
+
};
|
|
57
|
+
}, [verifyType]);
|
|
58
|
+
return /*#__PURE__*/React.createElement(Form, {
|
|
59
|
+
layout: "vertical"
|
|
60
|
+
}, /*#__PURE__*/React.createElement(Row, {
|
|
61
|
+
gutter: 8
|
|
62
|
+
}, /*#__PURE__*/React.createElement(Col, {
|
|
63
|
+
span: 24
|
|
64
|
+
}, /*#__PURE__*/React.createElement(FormItem, {
|
|
65
|
+
label: formatMessage({
|
|
66
|
+
id: "".concat(_I18N_PREFIX_, ".verifyType"),
|
|
67
|
+
label: '校验规则'
|
|
68
|
+
})
|
|
69
|
+
}, form.getFieldDecorator('verifyType', {
|
|
70
|
+
rules: [{
|
|
71
|
+
required: true,
|
|
72
|
+
message: formatMessage({
|
|
73
|
+
id: "".concat(_I18N_PREFIX_, ".message.verifyType"),
|
|
74
|
+
label: '请选择校验规则'
|
|
75
|
+
})
|
|
76
|
+
}]
|
|
77
|
+
})( /*#__PURE__*/React.createElement(Select, {
|
|
78
|
+
onChange: function onChange(val) {
|
|
79
|
+
console.log('setVerifyType');
|
|
80
|
+
setVerifyType(val);
|
|
81
|
+
}
|
|
82
|
+
}, getFrontRules(fieldData.property).map(function (rule) {
|
|
83
|
+
return /*#__PURE__*/React.createElement(Option, {
|
|
84
|
+
key: rule.key,
|
|
85
|
+
value: rule.key
|
|
86
|
+
}, rule.label);
|
|
87
|
+
}))))), !frontRule.noCode && /*#__PURE__*/React.createElement(Col, {
|
|
88
|
+
span: 24
|
|
89
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
90
|
+
style: {
|
|
91
|
+
fontSize: '14px',
|
|
92
|
+
marginBottom: '16px',
|
|
93
|
+
color: 'rgba(0, 0, 0, 0.85)'
|
|
94
|
+
}
|
|
95
|
+
}, formatMessage({
|
|
96
|
+
id: "".concat(_I18N_PREFIX_, ".logic"),
|
|
97
|
+
label: '校验逻辑'
|
|
98
|
+
})), /*#__PURE__*/React.createElement(JSEditor, {
|
|
99
|
+
style: {
|
|
100
|
+
height: '300px',
|
|
101
|
+
border: '1px solid rgb(217, 217, 217)',
|
|
102
|
+
borderRadius: '4px',
|
|
103
|
+
padding: '12px'
|
|
104
|
+
},
|
|
105
|
+
ref: jsRef
|
|
106
|
+
}, expression))));
|
|
107
|
+
};
|
|
108
|
+
export default CheckRules;
|
|
@@ -29,7 +29,7 @@ var CheckRules = function CheckRules(_ref) {
|
|
|
29
29
|
}, /*#__PURE__*/React.createElement(Row, {
|
|
30
30
|
gutter: 8
|
|
31
31
|
}, /*#__PURE__*/React.createElement(Col, {
|
|
32
|
-
span:
|
|
32
|
+
span: 24
|
|
33
33
|
}, /*#__PURE__*/React.createElement(FormItem, {
|
|
34
34
|
label: formatMessage({
|
|
35
35
|
id: "".concat(_I18N_PREFIX_, ".verifyType"),
|
|
@@ -50,31 +50,6 @@ var CheckRules = function CheckRules(_ref) {
|
|
|
50
50
|
}, val));
|
|
51
51
|
return types;
|
|
52
52
|
}, []))))), /*#__PURE__*/React.createElement(Col, {
|
|
53
|
-
span: 12
|
|
54
|
-
}, /*#__PURE__*/React.createElement(FormItem, {
|
|
55
|
-
label: formatMessage({
|
|
56
|
-
id: "".concat(_I18N_PREFIX_, ".verifyScope"),
|
|
57
|
-
label: '校验类型'
|
|
58
|
-
})
|
|
59
|
-
}, form.getFieldDecorator('verifyScope', {
|
|
60
|
-
rules: [{
|
|
61
|
-
required: true,
|
|
62
|
-
message: formatMessage({
|
|
63
|
-
id: "".concat(_I18N_PREFIX_, ".message.verifyScope"),
|
|
64
|
-
label: '请选择校验类型'
|
|
65
|
-
})
|
|
66
|
-
}]
|
|
67
|
-
})( /*#__PURE__*/React.createElement(Select, null, /*#__PURE__*/React.createElement(Option, {
|
|
68
|
-
value: 0
|
|
69
|
-
}, formatMessage({
|
|
70
|
-
id: "".concat(_I18N_PREFIX_, ".frontend"),
|
|
71
|
-
label: '前端'
|
|
72
|
-
})), /*#__PURE__*/React.createElement(Option, {
|
|
73
|
-
value: 1
|
|
74
|
-
}, formatMessage({
|
|
75
|
-
id: "".concat(_I18N_PREFIX_, ".backend"),
|
|
76
|
-
label: '后端'
|
|
77
|
-
})))))), /*#__PURE__*/React.createElement(Col, {
|
|
78
53
|
span: 24
|
|
79
54
|
}, /*#__PURE__*/React.createElement(FormItem, {
|
|
80
55
|
label: formatMessage({
|
|
@@ -2,12 +2,15 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
|
2
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
3
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
|
-
import React from 'react';
|
|
5
|
+
import React, { useRef } from 'react';
|
|
6
6
|
import { useMemoizedFn, useBoolean } from 'ahooks';
|
|
7
7
|
import { Modal, Form } from 'luck-design/antd';
|
|
8
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
8
9
|
import CheckRules from "./CheckRules";
|
|
10
|
+
import CheckFrontRules from "./CheckFrontRules";
|
|
9
11
|
import { fetchAddFieldAttrs, fetchUpdateFieldAttrs } from "../../../constants/api-url";
|
|
10
12
|
import { FIELD_SCOPES } from "../../../constants";
|
|
13
|
+
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel-section.fieldsSetting';
|
|
11
14
|
var FieldRulesModal = Form.create({
|
|
12
15
|
name: 'field-rules-form'
|
|
13
16
|
})(function (_ref) {
|
|
@@ -27,6 +30,7 @@ var FieldRulesModal = Form.create({
|
|
|
27
30
|
_useBoolean2$ = _useBoolean2[1],
|
|
28
31
|
setTrue = _useBoolean2$.setTrue,
|
|
29
32
|
setFalse = _useBoolean2$.setFalse;
|
|
33
|
+
var frontRuleRef = useRef();
|
|
30
34
|
var handleOk = useMemoizedFn( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
31
35
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
32
36
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -34,7 +38,8 @@ var FieldRulesModal = Form.create({
|
|
|
34
38
|
setTrue();
|
|
35
39
|
form.validateFields( /*#__PURE__*/function () {
|
|
36
40
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(err, vals) {
|
|
37
|
-
var
|
|
41
|
+
var _frontRuleRef$current;
|
|
42
|
+
var request, data, expression, _val, _yield$request, code;
|
|
38
43
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
39
44
|
while (1) switch (_context.prev = _context.next) {
|
|
40
45
|
case 0:
|
|
@@ -48,29 +53,35 @@ var FieldRulesModal = Form.create({
|
|
|
48
53
|
data = {
|
|
49
54
|
scope: FIELD_SCOPES.CHECK_RULES
|
|
50
55
|
};
|
|
56
|
+
expression = (_frontRuleRef$current = frontRuleRef.current) === null || _frontRuleRef$current === void 0 ? void 0 : _frontRuleRef$current.editor.getValue();
|
|
57
|
+
_val = expression ? _objectSpread(_objectSpread({}, vals), {}, {
|
|
58
|
+
expression: expression
|
|
59
|
+
}) : vals;
|
|
51
60
|
if (rule.uid) {
|
|
52
|
-
data.ccmModuleFieldVerifies = [_objectSpread(_objectSpread({},
|
|
53
|
-
uid: rule.uid
|
|
61
|
+
data.ccmModuleFieldVerifies = [_objectSpread(_objectSpread({}, _val), {}, {
|
|
62
|
+
uid: rule.uid,
|
|
63
|
+
verifyScope: (rule === null || rule === void 0 ? void 0 : rule.ruleType) === 'front' ? 0 : 1
|
|
54
64
|
})];
|
|
55
65
|
} else {
|
|
56
|
-
data.ccmModuleFieldVerifies = [_objectSpread(_objectSpread({},
|
|
57
|
-
dataModelKey: dataModelKey
|
|
66
|
+
data.ccmModuleFieldVerifies = [_objectSpread(_objectSpread({}, _val), {}, {
|
|
67
|
+
dataModelKey: dataModelKey,
|
|
68
|
+
verifyScope: (rule === null || rule === void 0 ? void 0 : rule.ruleType) === 'front' ? 0 : 1
|
|
58
69
|
})];
|
|
59
70
|
data.dataModelKey = dataModelKey;
|
|
60
71
|
data.datasetBusinessUids = [fieldData.uid];
|
|
61
72
|
data.moduleDatasetUid = datasetId;
|
|
62
73
|
data.moduleUid = moduleId;
|
|
63
74
|
}
|
|
64
|
-
_context.next =
|
|
75
|
+
_context.next = 9;
|
|
65
76
|
return request(data);
|
|
66
|
-
case
|
|
77
|
+
case 9:
|
|
67
78
|
_yield$request = _context.sent;
|
|
68
79
|
code = _yield$request.code;
|
|
69
80
|
setFalse();
|
|
70
81
|
if (code === 1) {
|
|
71
|
-
onClose(true);
|
|
82
|
+
onClose(true, (rule === null || rule === void 0 ? void 0 : rule.ruleType) === 'front' ? 0 : 1);
|
|
72
83
|
}
|
|
73
|
-
case
|
|
84
|
+
case 13:
|
|
74
85
|
case "end":
|
|
75
86
|
return _context.stop();
|
|
76
87
|
}
|
|
@@ -87,7 +98,10 @@ var FieldRulesModal = Form.create({
|
|
|
87
98
|
}, _callee2);
|
|
88
99
|
})));
|
|
89
100
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
90
|
-
title:
|
|
101
|
+
title: (rule === null || rule === void 0 ? void 0 : rule.ruleType) === 'front' ? formatMessage({
|
|
102
|
+
id: "".concat(_I18N_PREFIX_, ".rules.front"),
|
|
103
|
+
label: '前端校验规则'
|
|
104
|
+
}) : condition === null || condition === void 0 || (_condition$FIELD_SCOP = condition[FIELD_SCOPES.CHECK_RULES]) === null || _condition$FIELD_SCOP === void 0 ? void 0 : _condition$FIELD_SCOP.scopeName,
|
|
91
105
|
width: 800,
|
|
92
106
|
visible: !!rule,
|
|
93
107
|
getContainer: function getContainer() {
|
|
@@ -104,9 +118,15 @@ var FieldRulesModal = Form.create({
|
|
|
104
118
|
},
|
|
105
119
|
onOk: handleOk,
|
|
106
120
|
onCancel: function onCancel() {
|
|
107
|
-
return onClose(false);
|
|
121
|
+
return onClose(false, (rule === null || rule === void 0 ? void 0 : rule.ruleType) === 'front' ? 0 : 1);
|
|
108
122
|
}
|
|
109
|
-
}, /*#__PURE__*/React.createElement(
|
|
123
|
+
}, (rule === null || rule === void 0 ? void 0 : rule.ruleType) === 'front' && /*#__PURE__*/React.createElement(CheckFrontRules, {
|
|
124
|
+
form: form,
|
|
125
|
+
rule: rule,
|
|
126
|
+
fields: fields,
|
|
127
|
+
ruleRef: frontRuleRef,
|
|
128
|
+
fieldData: fieldData
|
|
129
|
+
}), (rule === null || rule === void 0 ? void 0 : rule.ruleType) === 'back' && /*#__PURE__*/React.createElement(CheckRules, {
|
|
110
130
|
form: form,
|
|
111
131
|
rule: rule,
|
|
112
132
|
condition: condition === null || condition === void 0 ? void 0 : condition[FIELD_SCOPES.CHECK_RULES],
|