@luck-design-biz/luckda 0.0.25-1 → 0.0.25-11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/ComplexItem/index.js +92 -0
- package/es/{lowcode/painter/services/toolbar.js → components/ComplexItem/service.js} +7 -11
- package/es/components/LDActions/index.js +8 -10
- package/es/components/LDActions/index.less +7 -4
- package/es/components/LdAutoForm/index.js +34 -11
- package/es/components/LdFormList/index.js +39 -23
- package/es/components/LdGrid/index.js +21 -7
- package/es/components/LdGridForm/index.js +32 -11
- package/es/components/LdTree/index.js +33 -15
- package/es/helper/FromItems.js +177 -94
- package/es/helper/form.js +55 -14
- package/es/helper/props_config.js +17 -0
- package/es/locales/zh-CN.js +26 -11
- package/es/lowcode/constants/api-url.js +354 -104
- package/es/lowcode/constants/event-topics.js +2 -0
- package/es/lowcode/constants/index.js +4 -2
- package/es/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +5 -2
- package/es/lowcode/engine/factory/panel-item-factory/StringStrategy.js +1 -1
- package/es/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +5 -2
- package/es/lowcode/engine/meta/box.props.default.json +1 -1
- package/es/lowcode/engine/meta/box.props.json +4 -4
- package/es/lowcode/engine/meta/button.props.json +4 -4
- package/es/lowcode/engine/meta/cardlist.props.json +14 -4
- package/es/lowcode/engine/meta/components-list.json +109 -1
- package/es/lowcode/engine/meta/dialog.props.default.json +11 -5
- package/es/lowcode/engine/meta/dialog.props.json +80 -43
- package/es/lowcode/engine/meta/drawer.props.json +9 -21
- package/es/lowcode/engine/meta/fieldcolor.props.default.json +14 -0
- package/es/lowcode/engine/meta/fieldcolor.props.json +63 -0
- package/es/lowcode/engine/meta/fieldcomplex.props.default.json +13 -0
- package/es/lowcode/engine/meta/fieldcomplex.props.json +39 -0
- package/es/lowcode/engine/meta/fielddate.props.default.json +12 -0
- package/es/lowcode/engine/meta/fielddate.props.json +47 -0
- package/es/lowcode/engine/meta/fielddict.props.default.json +14 -0
- package/es/lowcode/engine/meta/fielddict.props.json +44 -0
- package/es/lowcode/engine/meta/fieldeditor.props.default.json +13 -0
- package/es/lowcode/engine/meta/fieldeditor.props.json +44 -0
- package/es/lowcode/engine/meta/fieldgroup.props.default.json +15 -0
- package/es/lowcode/engine/meta/fieldgroup.props.json +73 -0
- package/es/lowcode/engine/meta/fieldnumber.props.default.json +14 -0
- package/es/lowcode/engine/meta/fieldnumber.props.json +48 -0
- package/es/lowcode/engine/meta/fieldradio.props.default.json +12 -0
- package/es/lowcode/engine/meta/fieldradio.props.json +20 -0
- package/es/lowcode/engine/meta/fieldregion.props.default.json +12 -0
- package/es/lowcode/engine/meta/fieldregion.props.json +26 -0
- package/es/lowcode/engine/meta/fieldselect.props.default.json +14 -0
- package/es/lowcode/engine/meta/fieldselect.props.json +58 -0
- package/es/lowcode/engine/meta/fieldstring.props.default.json +16 -0
- package/es/lowcode/engine/meta/fieldstring.props.json +62 -0
- package/es/lowcode/engine/meta/fieldswitch.props.default.json +12 -0
- package/es/lowcode/engine/meta/fieldswitch.props.json +31 -0
- package/es/lowcode/engine/meta/fieldtextarea.props.default.json +13 -0
- package/es/lowcode/engine/meta/fieldtextarea.props.json +49 -0
- package/es/lowcode/engine/meta/fieldupload.props.default.json +15 -0
- package/es/lowcode/engine/meta/fieldupload.props.json +71 -0
- package/es/lowcode/engine/meta/fielduser.props.default.json +16 -0
- package/es/lowcode/engine/meta/fielduser.props.json +82 -0
- package/es/lowcode/engine/meta/fieldyear.props.default.json +12 -0
- package/es/lowcode/engine/meta/fieldyear.props.json +37 -0
- package/es/lowcode/engine/meta/form.props.default.json +4 -5
- package/es/lowcode/engine/meta/form.props.json +44 -35
- package/es/lowcode/engine/meta/image.props.json +2 -2
- package/es/lowcode/engine/meta/imex.props.default.json +8 -1
- package/es/lowcode/engine/meta/imex.props.json +54 -22
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +53 -3
- package/es/lowcode/engine/meta/layout.props.json +2 -2
- package/es/lowcode/engine/meta/link.props.json +1 -1
- package/es/lowcode/engine/meta/page.props.json +2 -2
- package/es/lowcode/engine/meta/pagelayout.props.default.json +14 -0
- package/es/lowcode/engine/meta/pagelayout.props.json +47 -0
- package/es/lowcode/engine/meta/section.props.default.json +4 -6
- package/es/lowcode/engine/meta/section.props.json +52 -49
- package/es/lowcode/engine/meta/split.props.default.json +1 -1
- package/es/lowcode/engine/meta/split.props.json +4 -4
- package/es/lowcode/engine/meta/table.props.json +19 -13
- package/es/lowcode/engine/meta/tabs.props.json +3 -3
- package/es/lowcode/engine/meta/text.props.json +2 -2
- package/es/lowcode/engine/meta/tree.props.default.json +2 -0
- package/es/lowcode/engine/meta/tree.props.json +71 -8
- package/es/lowcode/engine/provider/ContextProvider/index.js +21 -35
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +89 -37
- package/es/lowcode/engine/tools/dataProcess.js +4 -0
- package/es/lowcode/engine/tools/diff.js +60 -0
- package/es/lowcode/engine/tools/helper.js +47 -26
- package/es/lowcode/engine/tools/useCanvasRender.js +8 -9
- package/es/lowcode/engine/tools/usePageDataStore.js +331 -0
- package/es/lowcode/engine/tools/usePromiseState.js +8 -10
- package/es/lowcode/engine/tools/useTodo.js +20 -10
- package/es/lowcode/painter/Design.js +41 -6
- package/es/lowcode/painter/DesignOperator.js +112 -88
- package/es/lowcode/painter/DesignToolbar.js +280 -36
- package/es/lowcode/painter/Outline.js +12 -10
- package/es/lowcode/painter/Panel.js +84 -46
- package/es/lowcode/painter/components/ActionBindModal.js +38 -27
- package/es/lowcode/painter/components/AdvancePanel.js +37 -21
- package/es/lowcode/painter/components/AttrsPanel.js +45 -34
- package/es/lowcode/painter/components/DragDrop/DragDropContext.js +1 -1
- package/es/lowcode/painter/components/DragDrop/DragDropWrapper.js +5 -2
- package/es/lowcode/painter/components/FieldSelector.js +26 -13
- package/es/lowcode/painter/components/ListEditor.js +8 -2
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +3 -2
- package/es/lowcode/painter/components/code-editor/JSEditor.js +5 -9
- package/es/lowcode/painter/components/field-setting/BatchSetting.js +13 -3
- package/es/lowcode/painter/components/field-setting/CheckFrontRules.js +108 -0
- package/es/lowcode/painter/components/field-setting/CheckRules.js +1 -26
- package/es/lowcode/painter/components/field-setting/FieldRulesModal.js +33 -13
- package/es/lowcode/painter/components/field-setting/SettingUI.js +182 -31
- package/es/lowcode/painter/components/field-setting/index.js +40 -61
- package/es/lowcode/painter/components/field-setting/meta/frontRules.js +53 -0
- package/es/lowcode/painter/index.js +1 -28
- package/es/lowcode/painter/panel-section/ActionsColumnWidth.js +25 -0
- package/es/lowcode/painter/panel-section/BlockEditor/index.js +7 -4
- package/es/lowcode/painter/panel-section/BlocksEditor/BlockEditorItem.js +4 -3
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +55 -28
- package/es/lowcode/painter/panel-section/ButtonType.js +4 -2
- package/es/lowcode/painter/panel-section/DataSetSelector.js +30 -7
- package/es/lowcode/painter/panel-section/FieldsSetting.js +124 -55
- package/es/lowcode/painter/panel-section/I18nInput.js +20 -0
- package/es/lowcode/painter/panel-section/ImpExp.js +99 -14
- package/es/lowcode/painter/panel-section/ImpExpAlone.js +108 -0
- package/es/lowcode/painter/panel-section/PageLayoutDisplay.js +95 -0
- package/es/lowcode/painter/panel-section/SerialsSelector.js +4 -2
- package/es/lowcode/painter/panel-section/SplitDisplay.js +25 -110
- package/es/lowcode/painter/panel-section/StylePanel/StyleContext.js +1 -1
- package/es/lowcode/painter/panel-section/StylePanel/index.js +10 -4
- package/es/lowcode/painter/panel-section/TableTopFilter.js +23 -13
- package/es/lowcode/painter/panel-section/TreeRootEditor.js +2 -2
- package/es/lowcode/painter/style/action-bind-modal.less +3 -3
- package/es/lowcode/painter/style/design.less +11 -4
- package/es/lowcode/painter/style/list-editor.less +36 -0
- package/es/lowcode/painter/style/page-layout-display.less +28 -0
- package/es/lowcode/painter/style/panel-item.less +1 -1
- package/es/lowcode/painter/style/split-display.less +0 -9
- package/es/lowcode/preview/index.js +20 -5
- package/es/lowcode/view/Canvas.js +6 -7
- package/es/lowcode/view/Page.js +5 -6
- package/es/lowcode/view/lc-components/Box/FunctionDesign.js +3 -2
- package/es/lowcode/view/lc-components/Box/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Box/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Box/meta.json +4 -4
- package/es/lowcode/view/lc-components/Button/index.js +2 -6
- package/es/lowcode/view/lc-components/Button/meta.json +4 -4
- package/es/lowcode/view/lc-components/CardList/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/CardList/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/CardList/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/CardList/meta.json +14 -4
- package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +3 -12
- package/es/lowcode/view/lc-components/Dialog/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Dialog/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Dialog/index.js +119 -19
- package/es/lowcode/view/lc-components/Dialog/meta.json +73 -43
- package/es/lowcode/view/lc-components/Drawer/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/Drawer/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Drawer/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Drawer/meta.json +9 -21
- package/es/lowcode/view/lc-components/FieldColor/meta.json +63 -0
- package/es/lowcode/view/lc-components/FieldComplex/meta.json +39 -0
- package/es/lowcode/view/lc-components/FieldDate/meta.json +45 -0
- package/es/lowcode/view/lc-components/FieldDict/meta.json +44 -0
- package/es/lowcode/view/lc-components/FieldEditor/meta.json +44 -0
- package/es/lowcode/view/lc-components/FieldGroup/meta.json +73 -0
- package/es/lowcode/view/lc-components/FieldNumber/meta.json +48 -0
- package/es/lowcode/view/lc-components/FieldRadio/meta.json +20 -0
- package/es/lowcode/view/lc-components/FieldRegion/meta.json +26 -0
- package/es/lowcode/view/lc-components/FieldSelect/meta.json +58 -0
- package/es/lowcode/view/lc-components/FieldString/meta.json +62 -0
- package/es/lowcode/view/lc-components/FieldSwitch/meta.json +31 -0
- package/es/lowcode/view/lc-components/FieldTextarea/meta.json +49 -0
- package/es/lowcode/view/lc-components/FieldUpload/meta.json +71 -0
- package/es/lowcode/view/lc-components/FieldUser/meta.json +82 -0
- package/es/lowcode/view/lc-components/FieldYear/meta.json +35 -0
- package/es/lowcode/view/lc-components/Form/FunctionDesign.js +61 -9
- package/es/lowcode/view/lc-components/Form/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Form/FunctionPreview.js +9 -1
- package/es/lowcode/view/lc-components/Form/index.js +401 -66
- package/es/lowcode/view/lc-components/Form/meta.json +44 -35
- package/es/lowcode/view/lc-components/Iframe/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/Iframe/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Iframe/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/ImEx/FunctionDesign.js +9 -3
- package/es/lowcode/view/lc-components/ImEx/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/ImEx/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/ImEx/index.js +470 -11
- package/es/lowcode/view/lc-components/ImEx/index.less +7 -0
- package/es/lowcode/view/lc-components/ImEx/meta.json +55 -23
- package/es/lowcode/view/lc-components/Image/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/Image/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Image/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Image/meta.json +2 -2
- package/es/lowcode/view/lc-components/JSX/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/JSX/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/JSX/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Layout/FunctionDesign.js +13 -21
- package/es/lowcode/view/lc-components/Layout/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Layout/meta.json +2 -2
- package/es/lowcode/view/lc-components/Link/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/Link/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Link/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Link/meta.json +1 -1
- package/es/lowcode/view/lc-components/Page/meta.json +2 -2
- package/es/lowcode/view/lc-components/PageContent/index.js +8 -9
- package/es/lowcode/view/lc-components/PageFooter/index.js +2 -5
- package/es/lowcode/view/lc-components/PageHeader/index.js +5 -6
- package/es/lowcode/view/lc-components/PageLayout/FunctionDesign.js +63 -0
- package/es/lowcode/view/lc-components/PageLayout/FunctionLive.js +10 -0
- package/es/lowcode/view/lc-components/PageLayout/FunctionPreview.js +10 -0
- package/es/lowcode/view/lc-components/PageLayout/index.js +32 -0
- package/es/lowcode/view/lc-components/PageLayout/meta.json +47 -0
- package/es/lowcode/view/lc-components/PageModal/index.js +12 -15
- package/es/lowcode/view/lc-components/Section/FunctionDesign.js +25 -2
- package/es/lowcode/view/lc-components/Section/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Section/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Section/index.js +114 -24
- package/es/lowcode/view/lc-components/Section/index.less +7 -0
- package/es/lowcode/view/lc-components/Section/meta.json +48 -49
- package/es/lowcode/view/lc-components/Split/FunctionDesign.js +19 -22
- package/es/lowcode/view/lc-components/Split/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Split/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Split/index.js +7 -11
- package/es/lowcode/view/lc-components/Split/meta.json +4 -4
- package/es/lowcode/view/lc-components/Table/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Table/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Table/components/TopFilter.js +78 -57
- package/es/lowcode/view/lc-components/Table/components/TopImex.js +420 -0
- package/es/lowcode/view/lc-components/Table/index.js +294 -47
- package/es/lowcode/view/lc-components/Table/meta.json +19 -13
- package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +11 -20
- package/es/lowcode/view/lc-components/Tabs/index.js +27 -12
- package/es/lowcode/view/lc-components/Tabs/meta.json +3 -3
- package/es/lowcode/view/lc-components/Text/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/Text/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Text/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Text/meta.json +2 -2
- package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +2 -3
- package/es/lowcode/view/lc-components/Tree/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Tree/index.js +103 -29
- package/es/lowcode/view/lc-components/Tree/meta.json +71 -9
- package/es/lowcode/view/lc-components/Wrapper.js +10 -12
- package/es/services.js +0 -24
- package/es/upload/FilesWall/file.png +0 -0
- package/es/upload/FilesWall/index.js +422 -0
- package/es/upload/FilesWall/index.less +74 -0
- package/es/upload/Form/gridForm.js +10 -5
- package/es/upload/Form/index.js +2 -1
- package/es/upload/FormItem/index.js +8 -9
- package/es/upload/index.js +2 -1
- package/es/utils/action.js +2 -2
- package/es/utils/form.js +16 -3
- package/es/utils/grid.js +8 -5
- package/lib/components/ComplexItem/index.js +100 -0
- package/lib/{lowcode/painter/services/toolbar.js → components/ComplexItem/service.js} +8 -12
- package/lib/components/LDActions/index.js +7 -9
- package/lib/components/LDActions/index.less +7 -4
- package/lib/components/LdAutoForm/index.js +33 -10
- package/lib/components/LdFormList/index.js +38 -22
- package/lib/components/LdGrid/index.js +21 -7
- package/lib/components/LdGridForm/index.js +30 -9
- package/lib/components/LdTree/index.js +33 -15
- package/lib/helper/FromItems.js +175 -92
- package/lib/helper/form.js +53 -13
- package/lib/helper/props_config.js +23 -0
- package/lib/locales/zh-CN.js +26 -11
- package/lib/lowcode/constants/api-url.js +355 -104
- package/lib/lowcode/constants/event-topics.js +3 -1
- package/lib/lowcode/constants/index.js +5 -3
- package/lib/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +7 -4
- package/lib/lowcode/engine/factory/panel-item-factory/StringStrategy.js +3 -2
- package/lib/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +6 -3
- package/lib/lowcode/engine/meta/box.props.default.json +1 -1
- package/lib/lowcode/engine/meta/box.props.json +4 -4
- package/lib/lowcode/engine/meta/button.props.json +4 -4
- package/lib/lowcode/engine/meta/cardlist.props.json +14 -4
- package/lib/lowcode/engine/meta/components-list.json +109 -1
- package/lib/lowcode/engine/meta/dialog.props.default.json +11 -5
- package/lib/lowcode/engine/meta/dialog.props.json +80 -43
- package/lib/lowcode/engine/meta/drawer.props.json +9 -21
- package/lib/lowcode/engine/meta/fieldcolor.props.default.json +14 -0
- package/lib/lowcode/engine/meta/fieldcolor.props.json +63 -0
- package/lib/lowcode/engine/meta/fieldcomplex.props.default.json +13 -0
- package/lib/lowcode/engine/meta/fieldcomplex.props.json +39 -0
- package/lib/lowcode/engine/meta/fielddate.props.default.json +12 -0
- package/lib/lowcode/engine/meta/fielddate.props.json +47 -0
- package/lib/lowcode/engine/meta/fielddict.props.default.json +14 -0
- package/lib/lowcode/engine/meta/fielddict.props.json +44 -0
- package/lib/lowcode/engine/meta/fieldeditor.props.default.json +13 -0
- package/lib/lowcode/engine/meta/fieldeditor.props.json +44 -0
- package/lib/lowcode/engine/meta/fieldgroup.props.default.json +15 -0
- package/lib/lowcode/engine/meta/fieldgroup.props.json +73 -0
- package/lib/lowcode/engine/meta/fieldnumber.props.default.json +14 -0
- package/lib/lowcode/engine/meta/fieldnumber.props.json +48 -0
- package/lib/lowcode/engine/meta/fieldradio.props.default.json +12 -0
- package/lib/lowcode/engine/meta/fieldradio.props.json +20 -0
- package/lib/lowcode/engine/meta/fieldregion.props.default.json +12 -0
- package/lib/lowcode/engine/meta/fieldregion.props.json +26 -0
- package/lib/lowcode/engine/meta/fieldselect.props.default.json +14 -0
- package/lib/lowcode/engine/meta/fieldselect.props.json +58 -0
- package/lib/lowcode/engine/meta/fieldstring.props.default.json +16 -0
- package/lib/lowcode/engine/meta/fieldstring.props.json +62 -0
- package/lib/lowcode/engine/meta/fieldswitch.props.default.json +12 -0
- package/lib/lowcode/engine/meta/fieldswitch.props.json +31 -0
- package/lib/lowcode/engine/meta/fieldtextarea.props.default.json +13 -0
- package/lib/lowcode/engine/meta/fieldtextarea.props.json +49 -0
- package/lib/lowcode/engine/meta/fieldupload.props.default.json +15 -0
- package/lib/lowcode/engine/meta/fieldupload.props.json +71 -0
- package/lib/lowcode/engine/meta/fielduser.props.default.json +16 -0
- package/lib/lowcode/engine/meta/fielduser.props.json +82 -0
- package/lib/lowcode/engine/meta/fieldyear.props.default.json +12 -0
- package/lib/lowcode/engine/meta/fieldyear.props.json +37 -0
- package/lib/lowcode/engine/meta/form.props.default.json +4 -5
- package/lib/lowcode/engine/meta/form.props.json +44 -35
- package/lib/lowcode/engine/meta/image.props.json +2 -2
- package/lib/lowcode/engine/meta/imex.props.default.json +8 -1
- package/lib/lowcode/engine/meta/imex.props.json +54 -22
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +53 -3
- package/lib/lowcode/engine/meta/layout.props.json +2 -2
- package/lib/lowcode/engine/meta/link.props.json +1 -1
- package/lib/lowcode/engine/meta/page.props.json +2 -2
- package/lib/lowcode/engine/meta/pagelayout.props.default.json +14 -0
- package/lib/lowcode/engine/meta/pagelayout.props.json +47 -0
- package/lib/lowcode/engine/meta/section.props.default.json +4 -6
- package/lib/lowcode/engine/meta/section.props.json +52 -49
- package/lib/lowcode/engine/meta/split.props.default.json +1 -1
- package/lib/lowcode/engine/meta/split.props.json +4 -4
- package/lib/lowcode/engine/meta/table.props.json +19 -13
- package/lib/lowcode/engine/meta/tabs.props.json +3 -3
- package/lib/lowcode/engine/meta/text.props.json +2 -2
- package/lib/lowcode/engine/meta/tree.props.default.json +2 -0
- package/lib/lowcode/engine/meta/tree.props.json +71 -8
- package/lib/lowcode/engine/provider/ContextProvider/index.js +37 -35
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +86 -34
- package/lib/lowcode/engine/tools/dataProcess.js +4 -0
- package/lib/lowcode/engine/tools/diff.js +67 -0
- package/lib/lowcode/engine/tools/helper.js +48 -25
- package/lib/lowcode/engine/tools/useCanvasRender.js +6 -7
- package/lib/lowcode/engine/tools/usePageDataStore.js +338 -0
- package/lib/lowcode/engine/tools/usePromiseState.js +6 -8
- package/lib/lowcode/engine/tools/useTodo.js +19 -9
- package/lib/lowcode/painter/Design.js +39 -4
- package/lib/lowcode/painter/DesignOperator.js +109 -85
- package/lib/lowcode/painter/DesignToolbar.js +277 -33
- package/lib/lowcode/painter/Outline.js +10 -8
- package/lib/lowcode/painter/Panel.js +82 -44
- package/lib/lowcode/painter/components/ActionBindModal.js +36 -25
- package/lib/lowcode/painter/components/AdvancePanel.js +36 -20
- package/lib/lowcode/painter/components/AttrsPanel.js +44 -33
- package/lib/lowcode/painter/components/DragDrop/DragDropContext.js +1 -1
- package/lib/lowcode/painter/components/DragDrop/DragDropWrapper.js +5 -2
- package/lib/lowcode/painter/components/FieldSelector.js +26 -13
- package/lib/lowcode/painter/components/ListEditor.js +8 -2
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +3 -2
- package/lib/lowcode/painter/components/code-editor/JSEditor.js +5 -9
- package/lib/lowcode/painter/components/field-setting/BatchSetting.js +13 -3
- package/lib/lowcode/painter/components/field-setting/CheckFrontRules.js +116 -0
- package/lib/lowcode/painter/components/field-setting/CheckRules.js +1 -26
- package/lib/lowcode/painter/components/field-setting/FieldRulesModal.js +34 -13
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +179 -28
- package/lib/lowcode/painter/components/field-setting/index.js +40 -61
- package/lib/lowcode/painter/components/field-setting/meta/frontRules.js +59 -0
- package/lib/lowcode/painter/index.js +1 -30
- package/lib/lowcode/painter/panel-section/ActionsColumnWidth.js +32 -0
- package/lib/lowcode/painter/panel-section/BlockEditor/index.js +7 -4
- package/lib/lowcode/painter/panel-section/BlocksEditor/BlockEditorItem.js +4 -3
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +53 -25
- package/lib/lowcode/painter/panel-section/ButtonType.js +4 -2
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +30 -7
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +121 -52
- package/lib/lowcode/painter/panel-section/I18nInput.js +27 -0
- package/lib/lowcode/painter/panel-section/ImpExp.js +99 -13
- package/lib/lowcode/painter/panel-section/ImpExpAlone.js +114 -0
- package/lib/lowcode/painter/panel-section/PageLayoutDisplay.js +103 -0
- package/lib/lowcode/painter/panel-section/SerialsSelector.js +4 -2
- package/lib/lowcode/painter/panel-section/SplitDisplay.js +24 -109
- package/lib/lowcode/painter/panel-section/StylePanel/StyleContext.js +5 -4
- package/lib/lowcode/painter/panel-section/StylePanel/index.js +10 -4
- package/lib/lowcode/painter/panel-section/TableTopFilter.js +22 -12
- package/lib/lowcode/painter/panel-section/TreeRootEditor.js +2 -2
- package/lib/lowcode/painter/style/action-bind-modal.less +3 -3
- package/lib/lowcode/painter/style/design.less +11 -4
- package/lib/lowcode/painter/style/list-editor.less +36 -0
- package/lib/lowcode/painter/style/page-layout-display.less +28 -0
- package/lib/lowcode/painter/style/panel-item.less +1 -1
- package/lib/lowcode/painter/style/split-display.less +0 -9
- package/lib/lowcode/preview/index.js +21 -5
- package/lib/lowcode/view/Canvas.js +5 -6
- package/lib/lowcode/view/Page.js +5 -6
- package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +3 -2
- package/lib/lowcode/view/lc-components/Box/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Box/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Box/meta.json +4 -4
- package/lib/lowcode/view/lc-components/Button/index.js +2 -6
- package/lib/lowcode/view/lc-components/Button/meta.json +4 -4
- package/lib/lowcode/view/lc-components/CardList/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/CardList/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/CardList/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/CardList/meta.json +14 -4
- package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +2 -11
- package/lib/lowcode/view/lc-components/Dialog/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Dialog/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Dialog/index.js +119 -19
- package/lib/lowcode/view/lc-components/Dialog/meta.json +73 -43
- package/lib/lowcode/view/lc-components/Drawer/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Drawer/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Drawer/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Drawer/meta.json +9 -21
- package/lib/lowcode/view/lc-components/FieldColor/meta.json +63 -0
- package/lib/lowcode/view/lc-components/FieldComplex/meta.json +39 -0
- package/lib/lowcode/view/lc-components/FieldDate/meta.json +45 -0
- package/lib/lowcode/view/lc-components/FieldDict/meta.json +44 -0
- package/lib/lowcode/view/lc-components/FieldEditor/meta.json +44 -0
- package/lib/lowcode/view/lc-components/FieldGroup/meta.json +73 -0
- package/lib/lowcode/view/lc-components/FieldNumber/meta.json +48 -0
- package/lib/lowcode/view/lc-components/FieldRadio/meta.json +20 -0
- package/lib/lowcode/view/lc-components/FieldRegion/meta.json +26 -0
- package/lib/lowcode/view/lc-components/FieldSelect/meta.json +58 -0
- package/lib/lowcode/view/lc-components/FieldString/meta.json +62 -0
- package/lib/lowcode/view/lc-components/FieldSwitch/meta.json +31 -0
- package/lib/lowcode/view/lc-components/FieldTextarea/meta.json +49 -0
- package/lib/lowcode/view/lc-components/FieldUpload/meta.json +71 -0
- package/lib/lowcode/view/lc-components/FieldUser/meta.json +82 -0
- package/lib/lowcode/view/lc-components/FieldYear/meta.json +35 -0
- package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +58 -7
- package/lib/lowcode/view/lc-components/Form/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Form/FunctionPreview.js +9 -1
- package/lib/lowcode/view/lc-components/Form/index.js +396 -61
- package/lib/lowcode/view/lc-components/Form/meta.json +44 -35
- package/lib/lowcode/view/lc-components/Iframe/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Iframe/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Iframe/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/ImEx/FunctionDesign.js +9 -3
- package/lib/lowcode/view/lc-components/ImEx/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/ImEx/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/ImEx/index.js +468 -9
- package/lib/lowcode/view/lc-components/ImEx/index.less +7 -0
- package/lib/lowcode/view/lc-components/ImEx/meta.json +55 -23
- package/lib/lowcode/view/lc-components/Image/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Image/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Image/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Image/meta.json +2 -2
- package/lib/lowcode/view/lc-components/JSX/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/JSX/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/JSX/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Layout/FunctionDesign.js +11 -19
- package/lib/lowcode/view/lc-components/Layout/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Layout/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Link/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Link/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Link/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Link/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Page/meta.json +2 -2
- package/lib/lowcode/view/lc-components/PageContent/index.js +7 -8
- package/lib/lowcode/view/lc-components/PageFooter/index.js +2 -5
- package/lib/lowcode/view/lc-components/PageHeader/index.js +4 -5
- package/lib/lowcode/view/lc-components/PageLayout/FunctionDesign.js +71 -0
- package/lib/lowcode/view/lc-components/PageLayout/FunctionLive.js +17 -0
- package/lib/lowcode/view/lc-components/PageLayout/FunctionPreview.js +17 -0
- package/lib/lowcode/view/lc-components/PageLayout/index.js +40 -0
- package/lib/lowcode/view/lc-components/PageLayout/meta.json +47 -0
- package/lib/lowcode/view/lc-components/PageModal/index.js +11 -14
- package/lib/lowcode/view/lc-components/Section/FunctionDesign.js +25 -2
- package/lib/lowcode/view/lc-components/Section/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Section/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Section/index.js +113 -23
- package/lib/lowcode/view/lc-components/Section/index.less +7 -0
- package/lib/lowcode/view/lc-components/Section/meta.json +48 -49
- package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +18 -21
- package/lib/lowcode/view/lc-components/Split/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Split/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Split/index.js +4 -8
- package/lib/lowcode/view/lc-components/Split/meta.json +4 -4
- package/lib/lowcode/view/lc-components/Table/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Table/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Table/components/TopFilter.js +75 -55
- package/lib/lowcode/view/lc-components/Table/components/TopImex.js +428 -0
- package/lib/lowcode/view/lc-components/Table/index.js +292 -45
- package/lib/lowcode/view/lc-components/Table/meta.json +19 -13
- package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +9 -18
- package/lib/lowcode/view/lc-components/Tabs/index.js +26 -11
- package/lib/lowcode/view/lc-components/Tabs/meta.json +3 -3
- package/lib/lowcode/view/lc-components/Text/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Text/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Text/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Text/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +2 -3
- package/lib/lowcode/view/lc-components/Tree/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Tree/index.js +100 -26
- package/lib/lowcode/view/lc-components/Tree/meta.json +71 -9
- package/lib/lowcode/view/lc-components/Wrapper.js +11 -12
- package/lib/services.js +0 -25
- package/lib/upload/FilesWall/file.png +0 -0
- package/lib/upload/FilesWall/index.js +429 -0
- package/lib/upload/FilesWall/index.less +74 -0
- package/lib/upload/Form/gridForm.js +10 -5
- package/lib/upload/Form/index.js +2 -1
- package/lib/upload/FormItem/index.js +8 -9
- package/lib/upload/index.js +8 -1
- package/lib/utils/action.js +2 -2
- package/lib/utils/form.js +16 -3
- package/lib/utils/grid.js +8 -5
- package/package.json +175 -171
- package/es/lowcode/engine/meta/local/local.zh-cn.js +0 -97
- package/lib/lowcode/engine/meta/local/local.zh-cn.js +0 -103
|
@@ -17,13 +17,24 @@
|
|
|
17
17
|
"key": "dataset",
|
|
18
18
|
"name": "数据集",
|
|
19
19
|
"desc": "选择系统中的可用树形数据集",
|
|
20
|
-
"type": "_DataSetSelector"
|
|
20
|
+
"type": "_DataSetSelector",
|
|
21
|
+
"component": "tree",
|
|
22
|
+
"next": {
|
|
23
|
+
"name": "字段配置",
|
|
24
|
+
"props": [
|
|
25
|
+
{
|
|
26
|
+
"key": "fields",
|
|
27
|
+
"name": "#字段配置器",
|
|
28
|
+
"type": "_FieldsSetting"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
21
32
|
},
|
|
22
33
|
{
|
|
23
34
|
"key": "title",
|
|
24
35
|
"name": "标题",
|
|
25
36
|
"desc": "头部标题",
|
|
26
|
-
"type": "
|
|
37
|
+
"type": "_I18nInput"
|
|
27
38
|
},
|
|
28
39
|
{
|
|
29
40
|
"key": "readOnly",
|
|
@@ -81,7 +92,7 @@
|
|
|
81
92
|
"key": "treeNodeTitle",
|
|
82
93
|
"name": "展示字段",
|
|
83
94
|
"desc": "展示字段的key",
|
|
84
|
-
"type": "
|
|
95
|
+
"type": "_I18nInput",
|
|
85
96
|
"default": "sname"
|
|
86
97
|
},
|
|
87
98
|
{
|
|
@@ -119,6 +130,32 @@
|
|
|
119
130
|
}
|
|
120
131
|
]
|
|
121
132
|
},
|
|
133
|
+
{
|
|
134
|
+
"key": "selectSetting",
|
|
135
|
+
"name": "选中设置",
|
|
136
|
+
"type": "group",
|
|
137
|
+
"props": [
|
|
138
|
+
{
|
|
139
|
+
"key": "cancelSelect",
|
|
140
|
+
"name": "取消选中",
|
|
141
|
+
"desc": "是否可以取消选中",
|
|
142
|
+
"type": "switch",
|
|
143
|
+
"default": true
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"key": "defaultSelect",
|
|
147
|
+
"name": "默认选中",
|
|
148
|
+
"desc": "返回默认选中的数据主键",
|
|
149
|
+
"type": "_JSEditor",
|
|
150
|
+
"defaultCode": "function defaultSelect(treeData) { \n return []; \n}",
|
|
151
|
+
"mustConfirm": true,
|
|
152
|
+
"wrapper": "collapse",
|
|
153
|
+
"wrapperProps": {
|
|
154
|
+
"suppressIcon": true
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
]
|
|
158
|
+
},
|
|
122
159
|
{
|
|
123
160
|
"key": "IconSetting",
|
|
124
161
|
"name": "图标设置",
|
|
@@ -170,6 +207,13 @@
|
|
|
170
207
|
"type": "switch",
|
|
171
208
|
"default": true
|
|
172
209
|
},
|
|
210
|
+
{
|
|
211
|
+
"key": "onlyRoot",
|
|
212
|
+
"name": "根节点唯一",
|
|
213
|
+
"desc": "树组件仅一个根节点,如数据根节点数大于0,则不允许根节点新增",
|
|
214
|
+
"type": "switch",
|
|
215
|
+
"default": false
|
|
216
|
+
},
|
|
173
217
|
{
|
|
174
218
|
"key": "rootAddSetting",
|
|
175
219
|
"name": "根节点配置",
|
|
@@ -186,6 +230,7 @@
|
|
|
186
230
|
"default": {
|
|
187
231
|
"todoList": []
|
|
188
232
|
},
|
|
233
|
+
"defaultCode": "function onActionClick(data) {\n\n}",
|
|
189
234
|
"suppressDisplay": true,
|
|
190
235
|
"suppressMax": true,
|
|
191
236
|
"suppressMore": true,
|
|
@@ -272,31 +317,49 @@
|
|
|
272
317
|
"key": "onMount",
|
|
273
318
|
"name": "组件首次渲染时",
|
|
274
319
|
"desc": "在组件首次渲染时,执行方法",
|
|
275
|
-
"func": "(params)
|
|
320
|
+
"func": "function onMount(params) {\n\t\n}"
|
|
276
321
|
},
|
|
277
322
|
{
|
|
278
323
|
"key": "onUnmount",
|
|
279
324
|
"name": "组件卸载时",
|
|
280
325
|
"desc": "在组件卸载时,执行方法。",
|
|
281
|
-
"func": "()
|
|
326
|
+
"func": "function onUnmount() {\n\t\n}"
|
|
282
327
|
},
|
|
283
328
|
{
|
|
284
329
|
"key": "processDataSource",
|
|
285
330
|
"name": "数据预处理",
|
|
286
331
|
"desc": "数据渲染前预处理",
|
|
287
|
-
"func": "(data)
|
|
332
|
+
"func": "function processDataSource(data) {\n\t\n}"
|
|
288
333
|
},
|
|
289
334
|
{
|
|
290
335
|
"key": "onDoubleClick",
|
|
291
336
|
"name": "双击事件",
|
|
292
337
|
"desc": "树节点双击事件",
|
|
293
|
-
"func": "(e, rowData)
|
|
338
|
+
"func": "function onDoubleClick(e, rowData) {\n\t\n}"
|
|
294
339
|
},
|
|
295
340
|
{
|
|
296
341
|
"key": "onCheck",
|
|
297
342
|
"name": "复选框选择事件",
|
|
298
343
|
"desc": "点击复选框触发",
|
|
299
|
-
"func": "(checkedKeys, e)
|
|
344
|
+
"func": "function onCheck(checkedKeys, e) {\n\t\n}"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"key": "onSelect",
|
|
348
|
+
"name": "选中事件",
|
|
349
|
+
"desc": "节点选中事件",
|
|
350
|
+
"func": "function onSelect(checkedKeys, e) {\n\t\n}"
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
"key": "onDrop",
|
|
354
|
+
"name": "拖拽事件",
|
|
355
|
+
"desc": "节点拖拽事件",
|
|
356
|
+
"func": "function onDrop(info, dragInfo) {\n\t\n}"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"key": "onPagePublicResourceChanged",
|
|
360
|
+
"name": "页面共享资源变化后",
|
|
361
|
+
"desc": "当页面共享资源发生变化后(pagePublicResourceChanged),执行方法",
|
|
362
|
+
"func": "function onPagePublicResourceChanged(resource, prevResource, instance) {\n\t\n}"
|
|
300
363
|
}
|
|
301
364
|
]
|
|
302
365
|
}
|
|
@@ -2,55 +2,30 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
import React, { createContext, useContext as useReactContext, useRef } from 'react';
|
|
4
4
|
import { history } from 'umi';
|
|
5
|
-
import { useMemoizedFn, useSetState } from 'ahooks';
|
|
6
|
-
import { get, isNil, isArray, isFunction, isObject, isString, reduce } from 'lodash';
|
|
5
|
+
import { useMemoizedFn, useSetState, useUpdateEffect, usePrevious } from 'ahooks';
|
|
7
6
|
import { useLDEventBus } from "../EventBusProvider";
|
|
8
7
|
import RemoteSourceProvider, { RemoteSourceContext } from "../RemoteSourceProvider";
|
|
9
8
|
import useTodo from "../../tools/useTodo";
|
|
10
|
-
import { findNodeAndParent } from "../../tools/dataProcess";
|
|
11
9
|
import * as topics from "../../../constants/event-topics";
|
|
12
10
|
export var Context = /*#__PURE__*/createContext(null);
|
|
13
11
|
export var useContext = function useContext() {
|
|
14
12
|
return useReactContext(Context);
|
|
15
13
|
};
|
|
16
|
-
export var usePageData = function usePageData(_) {
|
|
17
|
-
var _useReactContext = useReactContext(RemoteSourceContext),
|
|
18
|
-
pageData = _useReactContext.pageData,
|
|
19
|
-
loading = _useReactContext.loading,
|
|
20
|
-
setPageData = _useReactContext.setPageData;
|
|
21
|
-
var _pageData;
|
|
22
|
-
if (isNil(_)) {
|
|
23
|
-
_pageData = pageData;
|
|
24
|
-
} else if (isFunction(_)) {
|
|
25
|
-
_pageData = _(pageData);
|
|
26
|
-
} else if (isArray(_)) {
|
|
27
|
-
_pageData = reduce(_, function (r, k) {
|
|
28
|
-
r.push(get(pageData, k));
|
|
29
|
-
return r;
|
|
30
|
-
}, []);
|
|
31
|
-
} else if (isObject(_) && _.id) {
|
|
32
|
-
var _findNodeAndParent;
|
|
33
|
-
_pageData = (_findNodeAndParent = findNodeAndParent(_.id, pageData)) === null || _findNodeAndParent === void 0 ? void 0 : _findNodeAndParent.node;
|
|
34
|
-
} else if (isString(_)) {
|
|
35
|
-
_pageData = get(pageData, _);
|
|
36
|
-
}
|
|
37
|
-
return [_pageData, {
|
|
38
|
-
loading: loading,
|
|
39
|
-
setPageData: setPageData
|
|
40
|
-
}];
|
|
41
|
-
};
|
|
42
14
|
export var useRemoteSource = function useRemoteSource() {
|
|
43
15
|
return useReactContext(RemoteSourceContext);
|
|
44
16
|
};
|
|
17
|
+
export * from "../../tools/usePageDataStore";
|
|
45
18
|
var PRIVATE_KEYS = ['componentList', 'componentMap'];
|
|
46
19
|
export default (function (_ref) {
|
|
47
20
|
var children = _ref.children,
|
|
48
|
-
code = _ref.code
|
|
21
|
+
code = _ref.code,
|
|
22
|
+
debug = _ref.debug;
|
|
49
23
|
var eventBus = useLDEventBus();
|
|
50
24
|
var _useTodo = useTodo(),
|
|
51
|
-
_useTodo2 = _slicedToArray(_useTodo,
|
|
25
|
+
_useTodo2 = _slicedToArray(_useTodo, 3),
|
|
52
26
|
todo = _useTodo2[0],
|
|
53
|
-
callBehavior = _useTodo2[1]
|
|
27
|
+
callBehavior = _useTodo2[1],
|
|
28
|
+
loading = _useTodo2[2];
|
|
54
29
|
|
|
55
30
|
/**
|
|
56
31
|
* 页面公共资源
|
|
@@ -58,7 +33,8 @@ export default (function (_ref) {
|
|
|
58
33
|
var _useSetState = useSetState(null),
|
|
59
34
|
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
60
35
|
pagePublicResource = _useSetState2[0],
|
|
61
|
-
|
|
36
|
+
setPagePublicResource = _useSetState2[1];
|
|
37
|
+
var prevPagePublicResource = usePrevious(pagePublicResource);
|
|
62
38
|
|
|
63
39
|
/**
|
|
64
40
|
* 组件列表
|
|
@@ -120,14 +96,23 @@ export default (function (_ref) {
|
|
|
120
96
|
* return:object
|
|
121
97
|
*/
|
|
122
98
|
var getUrlParams = useMemoizedFn(function () {});
|
|
99
|
+
useUpdateEffect(function () {
|
|
100
|
+
eventBus.$publisher(topics.PAGE_PUBLIC_RESOURCE_CHANGED, {
|
|
101
|
+
resource: pagePublicResource,
|
|
102
|
+
prevResource: prevPagePublicResource
|
|
103
|
+
});
|
|
104
|
+
}, [pagePublicResource]);
|
|
123
105
|
var ctx = new Proxy(_objectSpread({
|
|
124
|
-
_setPagePublicResource: _setPagePublicResource,
|
|
125
106
|
_register: _register,
|
|
126
107
|
_unregister: _unregister,
|
|
127
108
|
pagePublicResource: pagePublicResource,
|
|
109
|
+
setPagePublicResource: setPagePublicResource,
|
|
110
|
+
loading: loading,
|
|
128
111
|
history: history,
|
|
129
112
|
callBehavior: callBehavior,
|
|
130
113
|
topics: topics,
|
|
114
|
+
PRIMARY_KEY: window.appConfig.constraintKeys.PRIMARY,
|
|
115
|
+
PARENT_KEY: window.appConfig.constraintKeys.PARENT,
|
|
131
116
|
getElementById: getElementById,
|
|
132
117
|
/**
|
|
133
118
|
* @method
|
|
@@ -164,6 +149,7 @@ export default (function (_ref) {
|
|
|
164
149
|
value: ctx
|
|
165
150
|
}, /*#__PURE__*/React.createElement(RemoteSourceProvider, {
|
|
166
151
|
code: code,
|
|
167
|
-
runtime: eventBus.runtime
|
|
152
|
+
runtime: eventBus.runtime,
|
|
153
|
+
debug: debug
|
|
168
154
|
}, children));
|
|
169
155
|
});
|
|
@@ -1,41 +1,52 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
-
import
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
4
3
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
4
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
5
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
import { useRequest, useSetState, useAsyncEffect, useCookieState, usePrevious, useMemoizedFn } from 'ahooks';
|
|
6
|
+
import React, { createContext, useRef } from 'react';
|
|
7
|
+
import { useRequest, useSetState, useAsyncEffect, useMemoizedFn, useCookieState, useCreation, useUnmount } from 'ahooks';
|
|
9
8
|
import { LuckDaContext } from "../../../components/Builder";
|
|
10
9
|
import { doAction as doActionUtils } from "../../../helper/action";
|
|
11
|
-
import
|
|
10
|
+
import usePageDataStore from "../tools/usePageDataStore";
|
|
12
11
|
import { decompress } from "../tools/dataProcess";
|
|
13
|
-
import { fetchPageData, fetchDesignModlueData, fetchModlueData, fetchAllDataset, fetchAllSerials } from "../../constants/api-url";
|
|
14
|
-
import {
|
|
12
|
+
import { fetchPageData, fetchDesignModlueData, fetchPreviewModlueData, fetchModlueData, fetchAllDataset, fetchAllSerials, fetchAllBehaviorEx } from "../../constants/api-url";
|
|
13
|
+
import { RUNTIME, COOKIE_RUNTIME_KEY } from "../../constants";
|
|
14
|
+
import { setLDMetaAttrs } from "../tools/helper";
|
|
15
15
|
export var RemoteSourceContext = /*#__PURE__*/createContext(null);
|
|
16
16
|
export default (function (_ref) {
|
|
17
17
|
var children = _ref.children,
|
|
18
18
|
code = _ref.code,
|
|
19
|
-
runtime = _ref.runtime
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
runtime = _ref.runtime,
|
|
20
|
+
debug = _ref.debug;
|
|
21
|
+
var _usePageDataStore = usePageDataStore(function (state) {
|
|
22
|
+
return {
|
|
23
|
+
initialize: state.initialize,
|
|
24
|
+
initializeModule: state.initializeModule,
|
|
25
|
+
reset: state.reset
|
|
26
|
+
};
|
|
27
|
+
}),
|
|
28
|
+
initialize = _usePageDataStore.initialize,
|
|
29
|
+
initializeModule = _usePageDataStore.initializeModule,
|
|
30
|
+
reset = _usePageDataStore.reset;
|
|
24
31
|
var _useSetState = useSetState({}),
|
|
25
32
|
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
26
33
|
remoteSource = _useSetState2[0],
|
|
27
34
|
setRemoteSource = _useSetState2[1];
|
|
28
|
-
var _useCookieState = useCookieState(
|
|
35
|
+
var _useCookieState = useCookieState(COOKIE_RUNTIME_KEY),
|
|
29
36
|
_useCookieState2 = _slicedToArray(_useCookieState, 2),
|
|
30
37
|
cookieRuntime = _useCookieState2[0],
|
|
31
38
|
setRuntime = _useCookieState2[1];
|
|
32
|
-
var prevRuntime =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
39
|
+
var prevRuntime = useRef(cookieRuntime);
|
|
40
|
+
useCreation(function () {
|
|
41
|
+
if (runtime !== cookieRuntime) {
|
|
42
|
+
prevRuntime.current = cookieRuntime;
|
|
43
|
+
setRuntime(runtime);
|
|
44
|
+
}
|
|
38
45
|
}, []);
|
|
46
|
+
useUnmount(function () {
|
|
47
|
+
!debug && reset();
|
|
48
|
+
setRuntime(prevRuntime.current);
|
|
49
|
+
});
|
|
39
50
|
|
|
40
51
|
// 获取页面数据
|
|
41
52
|
var _useRequest = useRequest(fetchPageData, {
|
|
@@ -44,7 +55,7 @@ export default (function (_ref) {
|
|
|
44
55
|
fetchPageDataLoading = _useRequest.loading,
|
|
45
56
|
runFetchPageData = _useRequest.runAsync;
|
|
46
57
|
// 获取模块数据
|
|
47
|
-
var _useRequest2 = useRequest(
|
|
58
|
+
var _useRequest2 = useRequest(_defineProperty(_defineProperty(_defineProperty({}, RUNTIME.DESIGN, fetchDesignModlueData), RUNTIME.PREVIEW, fetchPreviewModlueData), RUNTIME.LIVE, fetchModlueData)[runtime], {
|
|
48
59
|
manual: true,
|
|
49
60
|
onSuccess: function onSuccess(_ref2) {
|
|
50
61
|
var code = _ref2.code,
|
|
@@ -53,6 +64,7 @@ export default (function (_ref) {
|
|
|
53
64
|
setRemoteSource({
|
|
54
65
|
module: data
|
|
55
66
|
});
|
|
67
|
+
initializeModule(data);
|
|
56
68
|
}
|
|
57
69
|
}
|
|
58
70
|
}),
|
|
@@ -94,8 +106,48 @@ export default (function (_ref) {
|
|
|
94
106
|
fetchAllSerialsLoading = _useRequest4.loading,
|
|
95
107
|
runFetchAllSerials = _useRequest4.run,
|
|
96
108
|
refreshSerials = _useRequest4.refreshAsync;
|
|
109
|
+
|
|
110
|
+
// 获取导入导出行为下拉数据
|
|
111
|
+
var _useRequest5 = useRequest(fetchAllBehaviorEx, {
|
|
112
|
+
manual: true,
|
|
113
|
+
onSuccess: function onSuccess(_ref5) {
|
|
114
|
+
var code = _ref5.code,
|
|
115
|
+
data = _ref5.data;
|
|
116
|
+
if (code === 1) {
|
|
117
|
+
setRemoteSource({
|
|
118
|
+
impTypeList: data.map(function (item) {
|
|
119
|
+
return {
|
|
120
|
+
key: item.code,
|
|
121
|
+
value: item.code,
|
|
122
|
+
label: item.name
|
|
123
|
+
};
|
|
124
|
+
})
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}),
|
|
129
|
+
runFetchAllBehaviorImport = _useRequest5.run;
|
|
130
|
+
var _useRequest6 = useRequest(fetchAllBehaviorEx, {
|
|
131
|
+
manual: true,
|
|
132
|
+
onSuccess: function onSuccess(_ref6) {
|
|
133
|
+
var code = _ref6.code,
|
|
134
|
+
data = _ref6.data;
|
|
135
|
+
if (code === 1) {
|
|
136
|
+
setRemoteSource({
|
|
137
|
+
expTypeList: data.map(function (item) {
|
|
138
|
+
return {
|
|
139
|
+
key: item.code,
|
|
140
|
+
value: item.code,
|
|
141
|
+
label: item.name
|
|
142
|
+
};
|
|
143
|
+
})
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}),
|
|
148
|
+
runFetchAllBehaviorExport = _useRequest6.run;
|
|
97
149
|
useAsyncEffect( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
98
|
-
var fetchPageDataRes, data, list, detail,
|
|
150
|
+
var fetchPageDataRes, data, list, detail, source;
|
|
99
151
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
100
152
|
while (1) switch (_context.prev = _context.next) {
|
|
101
153
|
case 0:
|
|
@@ -106,30 +158,33 @@ export default (function (_ref) {
|
|
|
106
158
|
case 2:
|
|
107
159
|
fetchPageDataRes = _context.sent;
|
|
108
160
|
if (!(fetchPageDataRes.code === 1)) {
|
|
109
|
-
_context.next =
|
|
161
|
+
_context.next = 14;
|
|
110
162
|
break;
|
|
111
163
|
}
|
|
112
164
|
data = fetchPageDataRes.data, list = fetchPageDataRes.list, detail = fetchPageDataRes.detail;
|
|
113
|
-
|
|
114
|
-
|
|
165
|
+
source = detail[list[0]].source;
|
|
166
|
+
setLDMetaAttrs(data);
|
|
115
167
|
_context.next = 9;
|
|
116
168
|
return runFetchModlueData(data.dataModelKey, {
|
|
117
169
|
moduleCode: data.moduleCode
|
|
118
170
|
});
|
|
119
171
|
case 9:
|
|
172
|
+
runFetchAllBehaviorImport({
|
|
173
|
+
behaviorMode: 'IMPORT',
|
|
174
|
+
moduleCode: data.moduleCode
|
|
175
|
+
});
|
|
176
|
+
runFetchAllBehaviorExport({
|
|
177
|
+
behaviorMode: 'EXPORT',
|
|
178
|
+
moduleCode: data.moduleCode
|
|
179
|
+
});
|
|
120
180
|
runFetchAllDataset({
|
|
121
181
|
dataModelKey: data.dataModelKey
|
|
122
182
|
});
|
|
123
183
|
runFetchAllSerials({
|
|
124
184
|
uid: data.moduleId
|
|
125
185
|
});
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
relationship: data
|
|
129
|
-
}, info)
|
|
130
|
-
});
|
|
131
|
-
setPageData(decompress(source));
|
|
132
|
-
case 13:
|
|
186
|
+
!debug && initialize(decompress(source));
|
|
187
|
+
case 14:
|
|
133
188
|
case "end":
|
|
134
189
|
return _context.stop();
|
|
135
190
|
}
|
|
@@ -142,16 +197,13 @@ export default (function (_ref) {
|
|
|
142
197
|
});
|
|
143
198
|
});
|
|
144
199
|
return /*#__PURE__*/React.createElement(RemoteSourceContext.Provider, {
|
|
145
|
-
value: _objectSpread(_objectSpread({
|
|
146
|
-
pageData: pageData
|
|
147
|
-
}, remoteSource), {}, {
|
|
200
|
+
value: _objectSpread(_objectSpread({}, remoteSource), {}, {
|
|
148
201
|
loading: fetchPageDataLoading || fetchModlueDataLoading,
|
|
149
202
|
fetchAllDatasetLoading: fetchAllDatasetLoading,
|
|
150
203
|
fetchAllSerialsLoading: fetchAllSerialsLoading,
|
|
151
204
|
refreshModlueData: refreshModlueData,
|
|
152
205
|
refreshDataset: refreshDataset,
|
|
153
|
-
refreshSerials: refreshSerials
|
|
154
|
-
setPageData: setPageData
|
|
206
|
+
refreshSerials: refreshSerials
|
|
155
207
|
})
|
|
156
208
|
}, /*#__PURE__*/React.createElement(LuckDaContext.Provider, {
|
|
157
209
|
value: _objectSpread(_objectSpread({}, remoteSource.module), {}, {
|
|
@@ -39,6 +39,10 @@ export function decompress(compressedData) {
|
|
|
39
39
|
*/
|
|
40
40
|
export function findNodeAndParent(id, current) {
|
|
41
41
|
var parent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
42
|
+
if (!id) return {
|
|
43
|
+
node: null,
|
|
44
|
+
parent: null
|
|
45
|
+
};
|
|
42
46
|
if (!parent && current.props.id === id) {
|
|
43
47
|
return {
|
|
44
48
|
node: current,
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
2
|
+
var richTypes = {
|
|
3
|
+
Date: true,
|
|
4
|
+
RegExp: true,
|
|
5
|
+
String: true,
|
|
6
|
+
Number: true
|
|
7
|
+
};
|
|
8
|
+
export default function diff(obj, newObj) {
|
|
9
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
10
|
+
cyclesFix: true
|
|
11
|
+
};
|
|
12
|
+
var _stack = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
13
|
+
var diffs = [];
|
|
14
|
+
var isObjArray = Array.isArray(obj);
|
|
15
|
+
var _loop = function _loop() {
|
|
16
|
+
var _Object$getPrototypeO;
|
|
17
|
+
var objKey = obj[key];
|
|
18
|
+
var path = isObjArray ? +key : key;
|
|
19
|
+
if (!(key in newObj)) {
|
|
20
|
+
diffs.push({
|
|
21
|
+
type: 'REMOVE',
|
|
22
|
+
path: [path],
|
|
23
|
+
oldValue: obj[key]
|
|
24
|
+
});
|
|
25
|
+
return 1; // continue
|
|
26
|
+
}
|
|
27
|
+
var newObjKey = newObj[key];
|
|
28
|
+
var areCompatibleObjects = _typeof(objKey) === 'object' && _typeof(newObjKey) === 'object' && Array.isArray(objKey) === Array.isArray(newObjKey);
|
|
29
|
+
if (objKey && newObjKey && areCompatibleObjects && !richTypes[(_Object$getPrototypeO = Object.getPrototypeOf(objKey)) === null || _Object$getPrototypeO === void 0 || (_Object$getPrototypeO = _Object$getPrototypeO.constructor) === null || _Object$getPrototypeO === void 0 ? void 0 : _Object$getPrototypeO.name] && (!options.cyclesFix || !_stack.includes(objKey))) {
|
|
30
|
+
var nestedDiffs = diff(objKey, newObjKey, options, options.cyclesFix ? _stack.concat([objKey]) : []);
|
|
31
|
+
diffs.push.apply(diffs, nestedDiffs.map(function (difference) {
|
|
32
|
+
difference.path.unshift(path);
|
|
33
|
+
return difference;
|
|
34
|
+
}));
|
|
35
|
+
} else if (objKey !== newObjKey &&
|
|
36
|
+
// treat NaN values as equivalent
|
|
37
|
+
!(Number.isNaN(objKey) && Number.isNaN(newObjKey)) && !(areCompatibleObjects && (isNaN(objKey) ? objKey + '' === newObjKey + '' : +objKey === +newObjKey))) {
|
|
38
|
+
diffs.push({
|
|
39
|
+
path: [path],
|
|
40
|
+
type: 'CHANGE',
|
|
41
|
+
value: newObjKey,
|
|
42
|
+
oldValue: objKey
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
for (var key in obj) {
|
|
47
|
+
if (_loop()) continue;
|
|
48
|
+
}
|
|
49
|
+
var isNewObjArray = Array.isArray(newObj);
|
|
50
|
+
for (var _key in newObj) {
|
|
51
|
+
if (!(_key in obj)) {
|
|
52
|
+
diffs.push({
|
|
53
|
+
type: 'CREATE',
|
|
54
|
+
path: [isNewObjArray ? +_key : _key],
|
|
55
|
+
value: newObj[_key]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return diffs;
|
|
60
|
+
}
|
|
@@ -2,8 +2,9 @@ import _construct from "@babel/runtime/helpers/esm/construct";
|
|
|
2
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
3
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
4
4
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
5
|
-
import { omit,
|
|
5
|
+
import { omit, isNil, isString, isArray } from 'lodash';
|
|
6
6
|
import postcss from 'postcss';
|
|
7
|
+
import { META_TAG_NAME } from "../../constants";
|
|
7
8
|
export function isPromise(value) {
|
|
8
9
|
return !!value && _typeof(value) === 'object' && typeof value.then === 'function';
|
|
9
10
|
}
|
|
@@ -13,41 +14,43 @@ export function omitBadProps(props) {
|
|
|
13
14
|
}
|
|
14
15
|
export function listReducer(state, action) {
|
|
15
16
|
switch (action.type) {
|
|
16
|
-
case '
|
|
17
|
+
case 'insert':
|
|
17
18
|
{
|
|
18
19
|
var _action$callback;
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
var newState = _toConsumableArray(state);
|
|
21
|
+
newState.splice(action.payload.index + 1, 0, action.payload.data);
|
|
22
|
+
(_action$callback = action.callback) === null || _action$callback === void 0 || _action$callback.call(action, newState);
|
|
23
|
+
return newState;
|
|
21
24
|
}
|
|
22
25
|
case 'add':
|
|
23
26
|
{
|
|
24
27
|
var _action$callback2;
|
|
25
|
-
var
|
|
26
|
-
(_action$callback2 = action.callback) === null || _action$callback2 === void 0 || _action$callback2.call(action,
|
|
27
|
-
return
|
|
28
|
+
var _newState = [].concat(_toConsumableArray(state), [action.payload]);
|
|
29
|
+
(_action$callback2 = action.callback) === null || _action$callback2 === void 0 || _action$callback2.call(action, _newState);
|
|
30
|
+
return _newState;
|
|
28
31
|
}
|
|
29
32
|
case 'delete':
|
|
30
33
|
{
|
|
31
34
|
var _action$callback3;
|
|
32
|
-
var
|
|
35
|
+
var _newState2 = state.filter(function (item) {
|
|
33
36
|
return item.id !== action.payload;
|
|
34
37
|
});
|
|
35
|
-
(_action$callback3 = action.callback) === null || _action$callback3 === void 0 || _action$callback3.call(action,
|
|
36
|
-
return
|
|
38
|
+
(_action$callback3 = action.callback) === null || _action$callback3 === void 0 || _action$callback3.call(action, _newState2);
|
|
39
|
+
return _newState2;
|
|
37
40
|
}
|
|
38
41
|
case 'edit':
|
|
39
42
|
{
|
|
40
43
|
var _action$callback4;
|
|
41
|
-
var
|
|
44
|
+
var _newState3 = state.map(function (item) {
|
|
42
45
|
return item.id === action.payload.id ? _objectSpread(_objectSpread({}, item), action.payload.data) : item;
|
|
43
46
|
});
|
|
44
|
-
(_action$callback4 = action.callback) === null || _action$callback4 === void 0 || _action$callback4.call(action,
|
|
45
|
-
return
|
|
47
|
+
(_action$callback4 = action.callback) === null || _action$callback4 === void 0 || _action$callback4.call(action, _newState3);
|
|
48
|
+
return _newState3;
|
|
46
49
|
}
|
|
47
50
|
case 'batchEdit':
|
|
48
51
|
{
|
|
49
52
|
var _action$callback5;
|
|
50
|
-
var
|
|
53
|
+
var _newState4 = state.map(function (item) {
|
|
51
54
|
var newItem = action.payload.items.find(function (_id) {
|
|
52
55
|
return _id === item.id;
|
|
53
56
|
});
|
|
@@ -56,25 +59,25 @@ export function listReducer(state, action) {
|
|
|
56
59
|
}
|
|
57
60
|
return item;
|
|
58
61
|
});
|
|
59
|
-
(_action$callback5 = action.callback) === null || _action$callback5 === void 0 || _action$callback5.call(action,
|
|
60
|
-
return
|
|
62
|
+
(_action$callback5 = action.callback) === null || _action$callback5 === void 0 || _action$callback5.call(action, _newState4);
|
|
63
|
+
return _newState4;
|
|
61
64
|
}
|
|
62
65
|
case 'active':
|
|
63
66
|
{
|
|
64
67
|
var _action$callback6;
|
|
65
|
-
var
|
|
68
|
+
var _newState5 = state.map(function (item) {
|
|
66
69
|
item.active = false;
|
|
67
70
|
return item.id === action.payload.id ? _objectSpread(_objectSpread({}, item), action.payload.data) : item;
|
|
68
71
|
});
|
|
69
|
-
(_action$callback6 = action.callback) === null || _action$callback6 === void 0 || _action$callback6.call(action,
|
|
70
|
-
return
|
|
72
|
+
(_action$callback6 = action.callback) === null || _action$callback6 === void 0 || _action$callback6.call(action, _newState5);
|
|
73
|
+
return _newState5;
|
|
71
74
|
}
|
|
75
|
+
case 'init':
|
|
72
76
|
case 'new':
|
|
73
77
|
{
|
|
74
78
|
var _action$callback7;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return _newState5;
|
|
79
|
+
(_action$callback7 = action.callback) === null || _action$callback7 === void 0 || _action$callback7.call(action, action.payload);
|
|
80
|
+
return action.payload;
|
|
78
81
|
}
|
|
79
82
|
case 'sort':
|
|
80
83
|
{
|
|
@@ -94,9 +97,8 @@ export function listReducer(state, action) {
|
|
|
94
97
|
}
|
|
95
98
|
}
|
|
96
99
|
export function getCtx(context) {
|
|
97
|
-
return
|
|
98
|
-
|
|
99
|
-
});
|
|
100
|
+
return context;
|
|
101
|
+
// return omitBy(context, (_, key) => startsWith(key, '_'));
|
|
100
102
|
}
|
|
101
103
|
export function getFuncBody(funcCode) {
|
|
102
104
|
var regex = /{([\s\S]*?)}(?![\s\S]*})/;
|
|
@@ -141,9 +143,28 @@ export function parseCSS(cssString) {
|
|
|
141
143
|
// 返回包含所有样式的对象
|
|
142
144
|
return parsedStyles;
|
|
143
145
|
}
|
|
144
|
-
;
|
|
145
146
|
export function isColor(str) {
|
|
146
147
|
var hexRegex = /^#(?:[A-Fa-f0-9]{3,4}){1,2}$/;
|
|
147
148
|
var rgbaRegex = /^rgba?\(\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})(,\s*(0|1|0?\.\d+))?\s*\)$/;
|
|
148
149
|
return hexRegex.test(str) || rgbaRegex.test(str);
|
|
150
|
+
}
|
|
151
|
+
export function setLDMetaAttrs(data) {
|
|
152
|
+
var meta = document.querySelector("meta[name=\"".concat(META_TAG_NAME, "\"]"));
|
|
153
|
+
if (!meta) {
|
|
154
|
+
meta = document.createElement('meta');
|
|
155
|
+
}
|
|
156
|
+
meta.name = META_TAG_NAME;
|
|
157
|
+
meta.content = new URLSearchParams(data).toString().replaceAll('&', ',');
|
|
158
|
+
document.head.appendChild(meta);
|
|
159
|
+
}
|
|
160
|
+
export function getLDMetaAttr(name) {
|
|
161
|
+
if (isNil(name)) return void 0;
|
|
162
|
+
var meta = document.querySelector("meta[name=\"".concat(META_TAG_NAME, "\"]"));
|
|
163
|
+
var params = new URLSearchParams(meta.content.replaceAll(',', '&'));
|
|
164
|
+
if (isArray(name)) {
|
|
165
|
+
return name.map(function (n) {
|
|
166
|
+
return params.get(n);
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
return params.get(name);
|
|
149
170
|
}
|