@luck-design-biz/luckda 1.0.2-12 → 1.0.2-14
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/LICENSE +21 -21
- package/README.md +40 -40
- package/es/components/Builder/index.js +13 -10
- package/es/components/LDActions/index.less +70 -70
- package/es/components/LdAutoForm/index.js +5 -4
- package/es/components/LdCom/index.js +3 -2
- package/es/components/LdFormList/index.js +4 -3
- package/es/components/LdGrid/index.js +4 -4
- package/es/components/LdGridForm/index.js +5 -4
- package/es/components/LdGridForm/index.less +7 -7
- package/es/components/LdTree/index.less +42 -42
- package/es/helper/FromItems.js +64 -5
- package/es/helper/action.js +6 -6
- package/es/helper/form.js +14 -14
- package/es/helper/index.less +7 -7
- package/es/helper/ldBuilder.js +5 -4
- package/es/helper/ldComBuild.js +16 -11
- package/es/locales/zh-CN.js +43 -5
- package/es/lowcode/constants/api-url.js +309 -261
- package/es/lowcode/constants/event-topics.js +2 -0
- package/es/lowcode/constants/index.js +5 -4
- package/es/lowcode/engine/meta/components-list.json +12 -6
- package/es/lowcode/engine/meta/dialog.props.default.json +3 -1
- package/es/lowcode/engine/meta/dialog.props.json +4 -2
- package/es/lowcode/engine/meta/drawer.props.json +1 -1
- package/es/lowcode/engine/meta/fielddate.props.default.json +1 -0
- package/es/lowcode/engine/meta/fielddate.props.json +48 -0
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +35 -30
- package/es/lowcode/engine/meta/proxy.props.default.json +15 -0
- package/es/lowcode/engine/meta/proxy.props.json +66 -0
- package/es/lowcode/engine/provider/ContextProvider/index.js +87 -49
- package/es/lowcode/engine/provider/ContextProvider/usePageDataStore.js +49 -43
- package/es/lowcode/engine/provider/ContextProvider/usePageVar.js +11 -5
- package/es/lowcode/engine/provider/ContextProvider/useTodo.js +2 -4
- package/es/lowcode/engine/provider/EventBusProvider.js +14 -4
- package/es/lowcode/engine/provider/PageProxyProvider.js +95 -0
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +10 -12
- package/es/lowcode/engine/tools/dataProcess.js +76 -76
- package/es/lowcode/engine/tools/helper.js +25 -1
- package/es/lowcode/engine/tools/initDS.js +4 -4
- package/es/lowcode/painter/Components.js +2 -2
- package/es/lowcode/painter/Design.js +1 -0
- package/es/lowcode/painter/DesignOperator.js +129 -27
- package/es/lowcode/painter/DesignToolbar.js +88 -173
- package/es/lowcode/painter/components/AdvancePanel.js +29 -11
- package/es/lowcode/painter/components/Collapse.js +26 -26
- package/es/lowcode/painter/components/ColorInput.js +24 -24
- package/es/lowcode/painter/components/ListEditor.js +24 -24
- package/es/lowcode/painter/components/NumberInput.js +28 -28
- package/es/lowcode/painter/components/PanelItem.js +24 -24
- package/es/lowcode/painter/components/PopConfirm.js +8 -8
- package/es/lowcode/painter/components/PopForm.js +27 -27
- package/es/lowcode/painter/components/RuleInput.js +30 -30
- package/es/lowcode/painter/components/SortBox.js +22 -22
- package/es/lowcode/painter/components/TipIcon.js +12 -4
- package/es/lowcode/painter/components/TreeEditor.js +10 -10
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +32 -32
- package/es/lowcode/painter/components/code-editor/CssEditor.js +25 -25
- package/es/lowcode/painter/components/code-editor/FullScreenEditor.js +23 -23
- package/es/lowcode/painter/components/code-editor/JSEditor.js +20 -20
- package/es/lowcode/painter/components/code-editor/JsonEditor.js +25 -25
- package/es/lowcode/painter/components/field-setting/SettingUI.js +56 -4
- package/es/lowcode/painter/components/field-setting/index.js +24 -1
- package/es/lowcode/painter/components/shortcut-modal/KeyIcon.js +11 -0
- package/es/lowcode/painter/components/shortcut-modal/index.js +208 -0
- package/es/lowcode/painter/panel-section/BlockEditor/index.js +10 -19
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +4 -1
- package/es/lowcode/painter/panel-section/ConditionCheck.js +70 -0
- package/es/lowcode/painter/panel-section/DataSetSelector.js +6 -3
- package/es/lowcode/painter/panel-section/FieldsSetting.js +1 -1
- package/es/lowcode/painter/panel-section/Icon.js +23 -23
- package/es/lowcode/painter/panel-section/IconConditionSelector.js +2 -1
- package/es/lowcode/painter/panel-section/IconSelector.js +16 -16
- package/es/lowcode/painter/panel-section/JSEditor/ToolBar.js +7 -4
- package/es/lowcode/painter/panel-section/JSEditor/index.js +43 -5
- package/es/lowcode/painter/panel-section/JSEditor/index.less +4 -0
- package/es/lowcode/painter/panel-section/LayoutRatio.js +21 -21
- package/es/lowcode/painter/panel-section/ProxyLinker.js +137 -0
- package/es/lowcode/painter/panel-section/ProxyParams.js +28 -0
- package/es/lowcode/painter/panel-section/ProxyParamsSetter.js +240 -0
- package/es/lowcode/painter/panel-section/StylePanel/BackGround.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Border.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/BorderRadius.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/BorderRadiusSelector.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/BorderSelector.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Display.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Font.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/FontEditor.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/GapSelector.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/HighLightPanel.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/HighLigthtSpan.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/HightLightSvg.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Margin.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Opacity.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Padding.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Pointer.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Shadow.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Size.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/StyleContext.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/StyleRow.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/WidthHeight.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/index.js +15 -15
- package/es/lowcode/painter/style/action-bind-modal.less +104 -104
- package/es/lowcode/painter/style/actions-editor.less +15 -15
- package/es/lowcode/painter/style/border-editor.less +36 -36
- package/es/lowcode/painter/style/border-radius-selector.less +42 -42
- package/es/lowcode/painter/style/border-selector.less +39 -39
- package/es/lowcode/painter/style/button-type.less +5 -5
- package/es/lowcode/painter/style/collapse.less +28 -28
- package/es/lowcode/painter/style/color-input.less +19 -19
- package/es/lowcode/painter/style/components.less +91 -91
- package/es/lowcode/painter/style/design.less +178 -178
- package/es/lowcode/painter/style/display.less +17 -17
- package/es/lowcode/painter/style/dragdrop.less +56 -56
- package/es/lowcode/painter/style/fields-setting.less +25 -25
- package/es/lowcode/painter/style/font-editor.less +9 -9
- package/es/lowcode/painter/style/fullscreen-editor.less +17 -17
- package/es/lowcode/painter/style/history.less +46 -46
- package/es/lowcode/painter/style/icon-selector.less +22 -22
- package/es/lowcode/painter/style/icon.less +10 -10
- package/es/lowcode/painter/style/impexp.less +7 -7
- package/es/lowcode/painter/style/index.less +6 -6
- package/es/lowcode/painter/style/layout-ratio.less +51 -51
- package/es/lowcode/painter/style/list-editor.less +97 -97
- package/es/lowcode/painter/style/number-input.less +19 -19
- package/es/lowcode/painter/style/outline.less +30 -30
- package/es/lowcode/painter/style/page-layout-display.less +27 -27
- package/es/lowcode/painter/style/page-vars.less +25 -25
- package/es/lowcode/painter/style/panel-attrs.less +47 -47
- package/es/lowcode/painter/style/panel-item.less +55 -54
- package/es/lowcode/painter/style/panel.less +100 -100
- package/es/lowcode/painter/style/pop-confirm.less +17 -17
- package/es/lowcode/painter/style/pop-form.less +19 -19
- package/es/lowcode/painter/style/radio.less +24 -24
- package/es/lowcode/painter/style/ribbon.less +7 -7
- package/es/lowcode/painter/style/rule-input.less +12 -12
- package/es/lowcode/painter/style/split-display.less +18 -18
- package/es/lowcode/painter/style/style-panel.less +37 -37
- package/es/lowcode/painter/style/tabitems.less +90 -90
- package/es/lowcode/painter/svg/code.svg +3 -3
- package/es/lowcode/painter/svg/expect.svg +9 -9
- package/es/lowcode/preview/DebugTool.js +78 -0
- package/es/lowcode/preview/DebugToolDetail.js +103 -0
- package/es/lowcode/preview/index.js +10 -17
- package/es/lowcode/preview/useDebugSettings.js +62 -0
- package/es/lowcode/view/Canvas.js +5 -1
- package/es/lowcode/view/Page.js +8 -3
- package/es/lowcode/view/lc-components/Box/index.js +4 -4
- package/es/lowcode/view/lc-components/Box/index.less +14 -14
- package/es/lowcode/view/lc-components/Box/meta.json +40 -40
- package/es/lowcode/view/lc-components/Button/index.js +33 -33
- package/es/lowcode/view/lc-components/Button/meta.json +127 -127
- package/es/lowcode/view/lc-components/Button/style.less +2 -2
- package/es/lowcode/view/lc-components/CardList/index.js +126 -123
- package/es/lowcode/view/lc-components/CardList/meta.json +332 -332
- package/es/lowcode/view/lc-components/Dialog/index.js +18 -17
- package/es/lowcode/view/lc-components/Dialog/index.less +12 -12
- package/es/lowcode/view/lc-components/Dialog/meta.json +224 -222
- package/es/lowcode/view/lc-components/Drawer/index.js +18 -16
- package/es/lowcode/view/lc-components/Drawer/index.less +13 -13
- package/es/lowcode/view/lc-components/Drawer/meta.json +242 -242
- package/es/lowcode/view/lc-components/FieldColor/meta.json +157 -157
- package/es/lowcode/view/lc-components/FieldComplex/meta.json +140 -140
- package/es/lowcode/view/lc-components/FieldDate/meta.json +188 -140
- package/es/lowcode/view/lc-components/FieldDict/meta.json +138 -138
- package/es/lowcode/view/lc-components/FieldEditor/meta.json +137 -137
- package/es/lowcode/view/lc-components/FieldGroup/meta.json +166 -166
- package/es/lowcode/view/lc-components/FieldNumber/meta.json +143 -143
- package/es/lowcode/view/lc-components/FieldRadio/meta.json +115 -115
- package/es/lowcode/view/lc-components/FieldRegion/meta.json +121 -121
- package/es/lowcode/view/lc-components/FieldSelect/meta.json +152 -152
- package/es/lowcode/view/lc-components/FieldString/meta.json +152 -152
- package/es/lowcode/view/lc-components/FieldSwitch/meta.json +125 -125
- package/es/lowcode/view/lc-components/FieldTextarea/meta.json +143 -143
- package/es/lowcode/view/lc-components/FieldUpload/meta.json +165 -165
- package/es/lowcode/view/lc-components/FieldUser/meta.json +176 -176
- package/es/lowcode/view/lc-components/FieldYear/meta.json +128 -128
- package/es/lowcode/view/lc-components/Form/index.js +23 -20
- package/es/lowcode/view/lc-components/Form/meta.json +629 -629
- package/es/lowcode/view/lc-components/GroupTree/index.js +23 -23
- package/es/lowcode/view/lc-components/GroupTree/index.less +11 -11
- package/es/lowcode/view/lc-components/GroupTree/meta.json +82 -82
- package/es/lowcode/view/lc-components/Iframe/meta.json +31 -31
- package/es/lowcode/view/lc-components/ImEx/index.js +25 -25
- package/es/lowcode/view/lc-components/ImEx/index.less +7 -7
- package/es/lowcode/view/lc-components/ImEx/meta.json +134 -134
- package/es/lowcode/view/lc-components/Image/index.less +27 -27
- package/es/lowcode/view/lc-components/Image/meta.json +149 -149
- package/es/lowcode/view/lc-components/JSX/RuntimeComp.js +4 -4
- package/es/lowcode/view/lc-components/JSX/meta.json +29 -29
- package/es/lowcode/view/lc-components/Layout/index.js +16 -16
- package/es/lowcode/view/lc-components/Layout/index.less +5 -5
- package/es/lowcode/view/lc-components/Layout/meta.json +107 -107
- package/es/lowcode/view/lc-components/Link/index.less +15 -15
- package/es/lowcode/view/lc-components/Link/meta.json +112 -112
- package/es/lowcode/view/lc-components/Page/meta.json +61 -61
- package/es/lowcode/view/lc-components/PageContent/meta.json +9 -9
- package/es/lowcode/view/lc-components/PageFooter/meta.json +9 -9
- package/es/lowcode/view/lc-components/PageHeader/meta.json +9 -9
- package/es/lowcode/view/lc-components/PageLayout/meta.json +59 -59
- package/es/lowcode/view/lc-components/Proxy/FunctionDesign.js +17 -0
- package/es/lowcode/view/lc-components/Proxy/FunctionLive.js +23 -0
- package/es/lowcode/view/lc-components/Proxy/FunctionPreview.js +23 -0
- package/es/lowcode/view/lc-components/Proxy/index.js +42 -0
- package/es/lowcode/view/lc-components/Proxy/index.less +5 -0
- package/es/lowcode/view/lc-components/Proxy/meta.json +66 -0
- package/es/lowcode/view/lc-components/Section/index.less +7 -7
- package/es/lowcode/view/lc-components/Section/meta.json +108 -108
- package/es/lowcode/view/lc-components/Split/meta.json +53 -53
- package/es/lowcode/view/lc-components/Table/index.js +156 -149
- package/es/lowcode/view/lc-components/Table/meta.json +443 -443
- package/es/lowcode/view/lc-components/Tabs/index.js +23 -23
- package/es/lowcode/view/lc-components/Tabs/meta.json +113 -113
- package/es/lowcode/view/lc-components/Text/meta.json +56 -56
- package/es/lowcode/view/lc-components/Tree/index.js +99 -96
- package/es/lowcode/view/lc-components/Tree/index.less +4 -4
- package/es/lowcode/view/lc-components/Tree/meta.json +353 -353
- package/es/lowcode/view/lc-components/Wrapper.js +7 -1
- package/es/lowcode/view/style/canvas.less +5 -5
- package/es/lowcode/view/style/loading.less +98 -98
- package/es/lowcode/view/style/page.less +7 -7
- package/es/upload/FilesWall/index.js +13 -13
- package/es/upload/FilesWall/index.less +74 -74
- package/es/upload/Form/index.less +7 -7
- package/es/upload/FormItem/index.js +15 -15
- package/es/utils/form.js +21 -21
- package/lib/components/Builder/index.js +13 -10
- package/lib/components/LDActions/index.less +70 -70
- package/lib/components/LdAutoForm/index.js +3 -2
- package/lib/components/LdCom/index.js +3 -2
- package/lib/components/LdFormList/index.js +3 -2
- package/lib/components/LdGrid/index.js +4 -4
- package/lib/components/LdGridForm/index.js +3 -2
- package/lib/components/LdGridForm/index.less +7 -7
- package/lib/components/LdTree/index.less +42 -42
- package/lib/helper/FromItems.js +64 -5
- package/lib/helper/action.js +6 -6
- package/lib/helper/form.js +14 -14
- package/lib/helper/index.less +7 -7
- package/lib/helper/ldBuilder.js +4 -4
- package/lib/helper/ldComBuild.js +14 -9
- package/lib/locales/zh-CN.js +43 -5
- package/lib/lowcode/constants/api-url.js +309 -260
- package/lib/lowcode/constants/event-topics.js +3 -1
- package/lib/lowcode/constants/index.js +6 -5
- package/lib/lowcode/engine/meta/components-list.json +12 -6
- package/lib/lowcode/engine/meta/dialog.props.default.json +3 -1
- package/lib/lowcode/engine/meta/dialog.props.json +4 -2
- package/lib/lowcode/engine/meta/drawer.props.json +1 -1
- package/lib/lowcode/engine/meta/fielddate.props.default.json +1 -0
- package/lib/lowcode/engine/meta/fielddate.props.json +48 -0
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +35 -30
- package/lib/lowcode/engine/meta/proxy.props.default.json +15 -0
- package/lib/lowcode/engine/meta/proxy.props.json +66 -0
- package/lib/lowcode/engine/provider/ContextProvider/index.js +87 -49
- package/lib/lowcode/engine/provider/ContextProvider/usePageDataStore.js +50 -44
- package/lib/lowcode/engine/provider/ContextProvider/usePageVar.js +10 -4
- package/lib/lowcode/engine/provider/ContextProvider/useTodo.js +1 -3
- package/lib/lowcode/engine/provider/EventBusProvider.js +14 -4
- package/lib/lowcode/engine/provider/PageProxyProvider.js +103 -0
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +10 -12
- package/lib/lowcode/engine/tools/dataProcess.js +76 -76
- package/lib/lowcode/engine/tools/helper.js +25 -0
- package/lib/lowcode/engine/tools/initDS.js +4 -4
- package/lib/lowcode/painter/Components.js +2 -2
- package/lib/lowcode/painter/Design.js +1 -0
- package/lib/lowcode/painter/DesignOperator.js +126 -24
- package/lib/lowcode/painter/DesignToolbar.js +84 -169
- package/lib/lowcode/painter/components/AdvancePanel.js +28 -10
- package/lib/lowcode/painter/components/Collapse.js +26 -26
- package/lib/lowcode/painter/components/ColorInput.js +24 -24
- package/lib/lowcode/painter/components/ListEditor.js +24 -24
- package/lib/lowcode/painter/components/NumberInput.js +28 -28
- package/lib/lowcode/painter/components/PanelItem.js +24 -24
- package/lib/lowcode/painter/components/PopConfirm.js +8 -8
- package/lib/lowcode/painter/components/PopForm.js +27 -27
- package/lib/lowcode/painter/components/RuleInput.js +30 -30
- package/lib/lowcode/painter/components/SortBox.js +22 -22
- package/lib/lowcode/painter/components/TipIcon.js +12 -4
- package/lib/lowcode/painter/components/TreeEditor.js +10 -10
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +32 -32
- package/lib/lowcode/painter/components/code-editor/CssEditor.js +25 -25
- package/lib/lowcode/painter/components/code-editor/FullScreenEditor.js +23 -23
- package/lib/lowcode/painter/components/code-editor/JSEditor.js +20 -20
- package/lib/lowcode/painter/components/code-editor/JsonEditor.js +25 -25
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +55 -3
- package/lib/lowcode/painter/components/field-setting/index.js +24 -1
- package/lib/lowcode/painter/components/shortcut-modal/KeyIcon.js +18 -0
- package/lib/lowcode/painter/components/shortcut-modal/index.js +215 -0
- package/lib/lowcode/painter/panel-section/BlockEditor/index.js +9 -18
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +4 -1
- package/lib/lowcode/painter/panel-section/ConditionCheck.js +78 -0
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +6 -3
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +1 -1
- package/lib/lowcode/painter/panel-section/Icon.js +23 -23
- package/lib/lowcode/painter/panel-section/IconConditionSelector.js +2 -1
- package/lib/lowcode/painter/panel-section/IconSelector.js +16 -16
- package/lib/lowcode/painter/panel-section/JSEditor/ToolBar.js +7 -4
- package/lib/lowcode/painter/panel-section/JSEditor/index.js +42 -4
- package/lib/lowcode/painter/panel-section/JSEditor/index.less +4 -0
- package/lib/lowcode/painter/panel-section/LayoutRatio.js +21 -21
- package/lib/lowcode/painter/panel-section/ProxyLinker.js +145 -0
- package/lib/lowcode/painter/panel-section/ProxyParams.js +35 -0
- package/lib/lowcode/painter/panel-section/ProxyParamsSetter.js +248 -0
- package/lib/lowcode/painter/panel-section/StylePanel/BackGround.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Border.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/BorderRadius.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/BorderRadiusSelector.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/BorderSelector.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Display.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Font.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/FontEditor.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/GapSelector.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/HighLightPanel.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/HighLigthtSpan.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/HightLightSvg.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Margin.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Opacity.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Padding.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Pointer.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Shadow.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Size.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/StyleContext.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/StyleRow.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/WidthHeight.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/index.js +15 -15
- package/lib/lowcode/painter/style/action-bind-modal.less +104 -104
- package/lib/lowcode/painter/style/actions-editor.less +15 -15
- package/lib/lowcode/painter/style/border-editor.less +36 -36
- package/lib/lowcode/painter/style/border-radius-selector.less +42 -42
- package/lib/lowcode/painter/style/border-selector.less +39 -39
- package/lib/lowcode/painter/style/button-type.less +5 -5
- package/lib/lowcode/painter/style/collapse.less +28 -28
- package/lib/lowcode/painter/style/color-input.less +19 -19
- package/lib/lowcode/painter/style/components.less +91 -91
- package/lib/lowcode/painter/style/design.less +178 -178
- package/lib/lowcode/painter/style/display.less +17 -17
- package/lib/lowcode/painter/style/dragdrop.less +56 -56
- package/lib/lowcode/painter/style/fields-setting.less +25 -25
- package/lib/lowcode/painter/style/font-editor.less +9 -9
- package/lib/lowcode/painter/style/fullscreen-editor.less +17 -17
- package/lib/lowcode/painter/style/history.less +46 -46
- package/lib/lowcode/painter/style/icon-selector.less +22 -22
- package/lib/lowcode/painter/style/icon.less +10 -10
- package/lib/lowcode/painter/style/impexp.less +7 -7
- package/lib/lowcode/painter/style/index.less +6 -6
- package/lib/lowcode/painter/style/layout-ratio.less +51 -51
- package/lib/lowcode/painter/style/list-editor.less +97 -97
- package/lib/lowcode/painter/style/number-input.less +19 -19
- package/lib/lowcode/painter/style/outline.less +30 -30
- package/lib/lowcode/painter/style/page-layout-display.less +27 -27
- package/lib/lowcode/painter/style/page-vars.less +25 -25
- package/lib/lowcode/painter/style/panel-attrs.less +47 -47
- package/lib/lowcode/painter/style/panel-item.less +55 -54
- package/lib/lowcode/painter/style/panel.less +100 -100
- package/lib/lowcode/painter/style/pop-confirm.less +17 -17
- package/lib/lowcode/painter/style/pop-form.less +19 -19
- package/lib/lowcode/painter/style/radio.less +24 -24
- package/lib/lowcode/painter/style/ribbon.less +7 -7
- package/lib/lowcode/painter/style/rule-input.less +12 -12
- package/lib/lowcode/painter/style/split-display.less +18 -18
- package/lib/lowcode/painter/style/style-panel.less +37 -37
- package/lib/lowcode/painter/style/tabitems.less +90 -90
- package/lib/lowcode/painter/svg/code.svg +3 -3
- package/lib/lowcode/painter/svg/expect.svg +9 -9
- package/lib/lowcode/preview/DebugTool.js +86 -0
- package/lib/lowcode/preview/DebugToolDetail.js +111 -0
- package/lib/lowcode/preview/index.js +10 -18
- package/lib/lowcode/preview/useDebugSettings.js +69 -0
- package/lib/lowcode/view/Canvas.js +5 -1
- package/lib/lowcode/view/Page.js +8 -3
- package/lib/lowcode/view/lc-components/Box/index.js +4 -4
- package/lib/lowcode/view/lc-components/Box/index.less +14 -14
- package/lib/lowcode/view/lc-components/Box/meta.json +40 -40
- package/lib/lowcode/view/lc-components/Button/index.js +33 -33
- package/lib/lowcode/view/lc-components/Button/meta.json +127 -127
- package/lib/lowcode/view/lc-components/Button/style.less +2 -2
- package/lib/lowcode/view/lc-components/CardList/index.js +126 -123
- package/lib/lowcode/view/lc-components/CardList/meta.json +332 -332
- package/lib/lowcode/view/lc-components/Dialog/index.js +16 -15
- package/lib/lowcode/view/lc-components/Dialog/index.less +12 -12
- package/lib/lowcode/view/lc-components/Dialog/meta.json +224 -222
- package/lib/lowcode/view/lc-components/Drawer/index.js +16 -14
- package/lib/lowcode/view/lc-components/Drawer/index.less +13 -13
- package/lib/lowcode/view/lc-components/Drawer/meta.json +242 -242
- package/lib/lowcode/view/lc-components/FieldColor/meta.json +157 -157
- package/lib/lowcode/view/lc-components/FieldComplex/meta.json +140 -140
- package/lib/lowcode/view/lc-components/FieldDate/meta.json +188 -140
- package/lib/lowcode/view/lc-components/FieldDict/meta.json +138 -138
- package/lib/lowcode/view/lc-components/FieldEditor/meta.json +137 -137
- package/lib/lowcode/view/lc-components/FieldGroup/meta.json +166 -166
- package/lib/lowcode/view/lc-components/FieldNumber/meta.json +143 -143
- package/lib/lowcode/view/lc-components/FieldRadio/meta.json +115 -115
- package/lib/lowcode/view/lc-components/FieldRegion/meta.json +121 -121
- package/lib/lowcode/view/lc-components/FieldSelect/meta.json +152 -152
- package/lib/lowcode/view/lc-components/FieldString/meta.json +152 -152
- package/lib/lowcode/view/lc-components/FieldSwitch/meta.json +125 -125
- package/lib/lowcode/view/lc-components/FieldTextarea/meta.json +143 -143
- package/lib/lowcode/view/lc-components/FieldUpload/meta.json +165 -165
- package/lib/lowcode/view/lc-components/FieldUser/meta.json +176 -176
- package/lib/lowcode/view/lc-components/FieldYear/meta.json +128 -128
- package/lib/lowcode/view/lc-components/Form/index.js +23 -20
- package/lib/lowcode/view/lc-components/Form/meta.json +629 -629
- package/lib/lowcode/view/lc-components/GroupTree/index.js +23 -23
- package/lib/lowcode/view/lc-components/GroupTree/index.less +11 -11
- package/lib/lowcode/view/lc-components/GroupTree/meta.json +82 -82
- package/lib/lowcode/view/lc-components/Iframe/meta.json +31 -31
- package/lib/lowcode/view/lc-components/ImEx/index.js +25 -25
- package/lib/lowcode/view/lc-components/ImEx/index.less +7 -7
- package/lib/lowcode/view/lc-components/ImEx/meta.json +134 -134
- package/lib/lowcode/view/lc-components/Image/index.less +27 -27
- package/lib/lowcode/view/lc-components/Image/meta.json +149 -149
- package/lib/lowcode/view/lc-components/JSX/RuntimeComp.js +4 -4
- package/lib/lowcode/view/lc-components/JSX/meta.json +29 -29
- package/lib/lowcode/view/lc-components/Layout/index.js +16 -16
- package/lib/lowcode/view/lc-components/Layout/index.less +5 -5
- package/lib/lowcode/view/lc-components/Layout/meta.json +107 -107
- package/lib/lowcode/view/lc-components/Link/index.less +15 -15
- package/lib/lowcode/view/lc-components/Link/meta.json +112 -112
- package/lib/lowcode/view/lc-components/Page/meta.json +61 -61
- package/lib/lowcode/view/lc-components/PageContent/meta.json +9 -9
- package/lib/lowcode/view/lc-components/PageFooter/meta.json +9 -9
- package/lib/lowcode/view/lc-components/PageHeader/meta.json +9 -9
- package/lib/lowcode/view/lc-components/PageLayout/meta.json +59 -59
- package/lib/lowcode/view/lc-components/Proxy/FunctionDesign.js +24 -0
- package/lib/lowcode/view/lc-components/Proxy/FunctionLive.js +30 -0
- package/lib/lowcode/view/lc-components/Proxy/FunctionPreview.js +30 -0
- package/lib/lowcode/view/lc-components/Proxy/index.js +50 -0
- package/lib/lowcode/view/lc-components/Proxy/index.less +5 -0
- package/lib/lowcode/view/lc-components/Proxy/meta.json +66 -0
- package/lib/lowcode/view/lc-components/Section/index.less +7 -7
- package/lib/lowcode/view/lc-components/Section/meta.json +108 -108
- package/lib/lowcode/view/lc-components/Split/meta.json +53 -53
- package/lib/lowcode/view/lc-components/Table/index.js +156 -149
- package/lib/lowcode/view/lc-components/Table/meta.json +443 -443
- package/lib/lowcode/view/lc-components/Tabs/index.js +23 -23
- package/lib/lowcode/view/lc-components/Tabs/meta.json +113 -113
- package/lib/lowcode/view/lc-components/Text/meta.json +56 -56
- package/lib/lowcode/view/lc-components/Tree/index.js +99 -96
- package/lib/lowcode/view/lc-components/Tree/index.less +4 -4
- package/lib/lowcode/view/lc-components/Tree/meta.json +353 -353
- package/lib/lowcode/view/lc-components/Wrapper.js +6 -0
- package/lib/lowcode/view/style/canvas.less +5 -5
- package/lib/lowcode/view/style/loading.less +98 -98
- package/lib/lowcode/view/style/page.less +7 -7
- package/lib/upload/FilesWall/index.js +13 -13
- package/lib/upload/FilesWall/index.less +74 -74
- package/lib/upload/Form/index.less +7 -7
- package/lib/upload/FormItem/index.js +15 -15
- package/lib/utils/form.js +21 -21
- package/lowcode.js +1 -1
- package/package.json +175 -175
- package/upload.js +1 -1
- package/utils.js +1 -1
|
@@ -11,7 +11,10 @@ var _exportNames = {
|
|
|
11
11
|
useRemoteSource: true
|
|
12
12
|
};
|
|
13
13
|
exports.useRemoteSource = exports.useContext = exports.default = exports.Context = void 0;
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
15
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
16
|
+
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
|
|
17
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
18
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
19
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
20
|
var _ahooks = require("ahooks");
|
|
@@ -83,10 +86,27 @@ var _default = exports.default = function _default(_ref) {
|
|
|
83
86
|
if (index !== -1) {
|
|
84
87
|
_componentList.current.splice(index, 1);
|
|
85
88
|
}
|
|
86
|
-
;
|
|
87
89
|
});
|
|
88
|
-
var _initRemoteApiMap = (0, _ahooks.useMemoizedFn)(function (_apiMap) {
|
|
89
|
-
|
|
90
|
+
var _initRemoteApiMap = (0, _ahooks.useMemoizedFn)(function (_apiMap, append) {
|
|
91
|
+
if (append) {
|
|
92
|
+
_remoteApiMap.current = new Map([].concat((0, _toConsumableArray2.default)(_remoteApiMap.current), (0, _toConsumableArray2.default)(_apiMap)));
|
|
93
|
+
} else {
|
|
94
|
+
_remoteApiMap.current = _apiMap;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
var _deleteRemoteApis = (0, _ahooks.useMemoizedFn)(function (keys) {
|
|
98
|
+
var _iterator = (0, _createForOfIteratorHelper2.default)(keys),
|
|
99
|
+
_step;
|
|
100
|
+
try {
|
|
101
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
102
|
+
var key = _step.value;
|
|
103
|
+
_remoteApiMap.current.delete(key);
|
|
104
|
+
}
|
|
105
|
+
} catch (err) {
|
|
106
|
+
_iterator.e(err);
|
|
107
|
+
} finally {
|
|
108
|
+
_iterator.f();
|
|
109
|
+
}
|
|
90
110
|
});
|
|
91
111
|
var getElementById = (0, _ahooks.useMemoizedFn)(function (compId) {
|
|
92
112
|
var _componentList$curren;
|
|
@@ -124,76 +144,77 @@ var _default = exports.default = function _default(_ref) {
|
|
|
124
144
|
_register: _register,
|
|
125
145
|
_unregister: _unregister,
|
|
126
146
|
_initRemoteApiMap: _initRemoteApiMap,
|
|
127
|
-
|
|
128
|
-
|
|
147
|
+
_deleteRemoteApis: _deleteRemoteApis,
|
|
148
|
+
/**
|
|
149
|
+
* @property {boolean} loading - loading状态
|
|
129
150
|
*/
|
|
130
151
|
loading: loading,
|
|
131
|
-
/**
|
|
132
|
-
* @property {object} topics - 内置的事件话题
|
|
152
|
+
/**
|
|
153
|
+
* @property {object} topics - 内置的事件话题
|
|
133
154
|
*/
|
|
134
155
|
topics: topics,
|
|
135
|
-
/**
|
|
136
|
-
* @property {object} topics - service api前缀
|
|
156
|
+
/**
|
|
157
|
+
* @property {object} topics - service api前缀
|
|
137
158
|
*/
|
|
138
159
|
API_PREFIX: _ApiConfig.default,
|
|
139
|
-
/**
|
|
140
|
-
* @property {string} PRIMARY_KEY - 主键key
|
|
160
|
+
/**
|
|
161
|
+
* @property {string} PRIMARY_KEY - 主键key
|
|
141
162
|
*/
|
|
142
163
|
PRIMARY_KEY: window.appConfig.constraintKeys.PRIMARY,
|
|
143
|
-
/**
|
|
144
|
-
* @property {string} PARENT_KEY - 树组件主键key
|
|
164
|
+
/**
|
|
165
|
+
* @property {string} PARENT_KEY - 树组件主键key
|
|
145
166
|
*/
|
|
146
167
|
PARENT_KEY: window.appConfig.constraintKeys.PARENT,
|
|
147
|
-
/**
|
|
148
|
-
* @method - 根据组件ID获取实例
|
|
149
|
-
* @param {string} compId - 组件ID
|
|
150
|
-
* @return {object} target - 组件实例
|
|
168
|
+
/**
|
|
169
|
+
* @method - 根据组件ID获取实例
|
|
170
|
+
* @param {string} compId - 组件ID
|
|
171
|
+
* @return {object} target - 组件实例
|
|
151
172
|
*/
|
|
152
173
|
$: getElementById,
|
|
153
|
-
/**
|
|
154
|
-
* @method - 根据组件ID获取父组件实例
|
|
155
|
-
* @param {string} compId - 组件ID
|
|
156
|
-
* @return {object} target - 父组件实例
|
|
174
|
+
/**
|
|
175
|
+
* @method - 根据组件ID获取父组件实例
|
|
176
|
+
* @param {string} compId - 组件ID
|
|
177
|
+
* @return {object} target - 父组件实例
|
|
157
178
|
*/
|
|
158
179
|
$$: getParentElementById,
|
|
159
|
-
/**
|
|
160
|
-
* @method - 执行行为池
|
|
161
|
-
* @param {object} actionPool - 行为池
|
|
162
|
-
* @param {object} args - 参数
|
|
180
|
+
/**
|
|
181
|
+
* @method - 执行行为池
|
|
182
|
+
* @param {object} actionPool - 行为池
|
|
183
|
+
* @param {object} args - 参数
|
|
163
184
|
*/
|
|
164
185
|
doAction: function doAction(actionPool, args) {
|
|
165
186
|
return todo(this, actionPool, args);
|
|
166
187
|
},
|
|
167
|
-
/**
|
|
168
|
-
* @method - 是否有权限
|
|
169
|
-
* @return {string} wanted - 期望的资源串
|
|
188
|
+
/**
|
|
189
|
+
* @method - 是否有权限
|
|
190
|
+
* @return {string} wanted - 期望的资源串
|
|
170
191
|
*/
|
|
171
192
|
want: want,
|
|
172
|
-
/**
|
|
173
|
-
* @method - 获取执行行为请求的接口URL
|
|
174
|
-
* @return {string} BEHAVIOR_URL - 执行行为请求的接口URL
|
|
193
|
+
/**
|
|
194
|
+
* @method - 获取执行行为请求的接口URL
|
|
195
|
+
* @return {string} BEHAVIOR_URL - 执行行为请求的接口URL
|
|
175
196
|
*/
|
|
176
197
|
getBehaviorUrl: _apiUrl.getBehaviorUrl,
|
|
177
|
-
/**
|
|
178
|
-
* @typedef {Object} Utils
|
|
179
|
-
* @property {function(type, props): void} dialog - 弹出对话框
|
|
180
|
-
* @property {function({ moduleCode, datasetCode, behaviorKey }, params, data): Promise} callBehavior - 执行行为
|
|
181
|
-
* @property {function(type, value, formatOrSeparator): string} formatter - 常用的 formatter 函数用于进行事件、金额、手机号等 format
|
|
182
|
-
* @property {function(when, type): string} getDateTimeRange - 获取当前或指定日期的开始结束区间时间戳
|
|
198
|
+
/**
|
|
199
|
+
* @typedef {Object} Utils
|
|
200
|
+
* @property {function(type, props): void} dialog - 弹出对话框
|
|
201
|
+
* @property {function({ moduleCode, datasetCode, behaviorKey }, params, data): Promise} callBehavior - 执行行为
|
|
202
|
+
* @property {function(type, value, formatOrSeparator): string} formatter - 常用的 formatter 函数用于进行事件、金额、手机号等 format
|
|
203
|
+
* @property {function(when, type): string} getDateTimeRange - 获取当前或指定日期的开始结束区间时间戳
|
|
183
204
|
*/
|
|
184
|
-
/**
|
|
185
|
-
* @property {Utils} 工具类
|
|
205
|
+
/**
|
|
206
|
+
* @property {Utils} 工具类
|
|
186
207
|
*/
|
|
187
208
|
utils: utils,
|
|
188
|
-
/**
|
|
189
|
-
* @typedef {Object} Router
|
|
190
|
-
* @property {function(path, params): void} push - 跳转
|
|
191
|
-
* @property {function(path, state): void} replace - 替换
|
|
192
|
-
* @property {function{}: object} getQuery - 获取URL参数
|
|
193
|
-
* @property {function(params): string} stringifyQuery - 序列化 URL 参数
|
|
209
|
+
/**
|
|
210
|
+
* @typedef {Object} Router
|
|
211
|
+
* @property {function(path, params): void} push - 跳转
|
|
212
|
+
* @property {function(path, state): void} replace - 替换
|
|
213
|
+
* @property {function{}: object} getQuery - 获取URL参数
|
|
214
|
+
* @property {function(params): string} stringifyQuery - 序列化 URL 参数
|
|
194
215
|
*/
|
|
195
|
-
/**
|
|
196
|
-
* @property {Router} router - 路由
|
|
216
|
+
/**
|
|
217
|
+
* @property {Router} router - 路由
|
|
197
218
|
*/
|
|
198
219
|
router: router
|
|
199
220
|
}, eventBus), {
|
|
@@ -202,9 +223,26 @@ var _default = exports.default = function _default(_ref) {
|
|
|
202
223
|
var _privateGetter$curren;
|
|
203
224
|
return (_privateGetter$curren = _privateGetter.current) === null || _privateGetter$curren === void 0 ? void 0 : _privateGetter$curren[property]();
|
|
204
225
|
} else if (property === 'state') {
|
|
205
|
-
|
|
226
|
+
var state = getState();
|
|
227
|
+
return new Proxy(Object.assign({}, state), {
|
|
228
|
+
get: function get(stateTarget, stateProperty, stateReceiver) {
|
|
229
|
+
return Reflect.get(stateTarget, stateProperty, stateReceiver);
|
|
230
|
+
},
|
|
231
|
+
set: function set(stateTarget, stateProperty, stateReceiver) {
|
|
232
|
+
setState((0, _defineProperty2.default)({}, stateProperty, stateReceiver));
|
|
233
|
+
return true;
|
|
234
|
+
}
|
|
235
|
+
});
|
|
206
236
|
} else if (property === 'global') {
|
|
207
|
-
return global.current
|
|
237
|
+
return new Proxy(Object.assign({}, global.current), {
|
|
238
|
+
get: function get(globalTarget, globalProperty, globalReceiver) {
|
|
239
|
+
return Reflect.get(globalTarget, globalProperty, globalReceiver);
|
|
240
|
+
},
|
|
241
|
+
set: function set(globalTarget, globalProperty, globalReceiver) {
|
|
242
|
+
setGlobal((0, _defineProperty2.default)({}, globalProperty, globalReceiver));
|
|
243
|
+
return true;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
208
246
|
}
|
|
209
247
|
return Reflect.get(target, property, receiver);
|
|
210
248
|
},
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.useTemporalStore = exports.useTask = exports.useGet = exports.setNeedPrompt = exports.resetPageData = exports.moveNode = exports.modifyNode = exports.getSelfAndParent = exports.getNeedPrompt = exports.
|
|
7
|
+
exports.useTemporalStore = exports.useTask = exports.useGet = exports.setNeedPrompt = exports.resetPageData = exports.moveNode = exports.modifyNode = exports.getSelfAndParent = exports.getNeedPrompt = exports.getLevelNodes = exports.deleteNode = exports.default = exports.clearChildren = exports.addNode = void 0;
|
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
9
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
10
10
|
var _react = require("react");
|
|
@@ -14,6 +14,7 @@ var _middleware = require("zustand/middleware");
|
|
|
14
14
|
var _shallow = require("zustand/react/shallow");
|
|
15
15
|
var _lodash = require("lodash");
|
|
16
16
|
var _fastDeepEqual = _interopRequireDefault(require("fast-deep-equal"));
|
|
17
|
+
var _PageProxyProvider = require("../PageProxyProvider");
|
|
17
18
|
var _dataProcess = require("../../tools/dataProcess");
|
|
18
19
|
var _constants = require("../../../constants");
|
|
19
20
|
var temporalStateCreator = function temporalStateCreator(userSet, userGet, options) {
|
|
@@ -148,18 +149,12 @@ var findNode = function findNode(obj, id) {
|
|
|
148
149
|
var usePageDataStore = (0, _zustand.create)()((0, _immer.immer)((0, _middleware.subscribeWithSelector)(temporal(function (set) {
|
|
149
150
|
return {
|
|
150
151
|
pageData: null,
|
|
151
|
-
moduleData: null,
|
|
152
152
|
needPrompt: false,
|
|
153
153
|
initialize: function initialize(data) {
|
|
154
154
|
return set(function (state) {
|
|
155
155
|
state.pageData = data;
|
|
156
156
|
});
|
|
157
157
|
},
|
|
158
|
-
initializeModule: function initializeModule(data) {
|
|
159
|
-
return set(function (state) {
|
|
160
|
-
state.moduleData = data;
|
|
161
|
-
});
|
|
162
|
-
},
|
|
163
158
|
reset: function reset(data) {
|
|
164
159
|
return set(function (state) {
|
|
165
160
|
state.pageData = data || null;
|
|
@@ -265,22 +260,22 @@ var modifyNode = exports.modifyNode = function modifyNode(id, data) {
|
|
|
265
260
|
});
|
|
266
261
|
};
|
|
267
262
|
|
|
268
|
-
/**
|
|
269
|
-
* 移动页面中的一个节点到另一个位置。
|
|
270
|
-
*
|
|
271
|
-
* @param {string} sid - 源节点的ID。
|
|
272
|
-
* @param {string} tid - 目标节点的ID。
|
|
273
|
-
* @param {string} action - 移动类型,可以是 'inside', 'left', 'right' 中的一个。
|
|
274
|
-
* @param {string} newid - 新节点的ID,仅在创建新节点时使用。
|
|
275
|
-
* @param {Object} json - 新节点的初始属性,仅在创建新节点时使用。
|
|
276
|
-
*
|
|
277
|
-
* @description
|
|
278
|
-
* 此函数会更新页面数据状态,根据提供的动作类型(`action`),将源节点(`sourceNode`)移动到目标节点(`targetNode`)的相应位置。
|
|
279
|
-
* - 'inside': 将源节点作为目标节点的子节点。
|
|
280
|
-
* - 'left': 将源节点放在目标节点的左边(同一父节点下)。
|
|
281
|
-
* - 'right': 将源节点放在目标节点的右边(同一父节点下)。
|
|
282
|
-
* 如果 `sid` 是空但提供了 `newid`,则函数会创建一个新的节点。
|
|
283
|
-
*
|
|
263
|
+
/**
|
|
264
|
+
* 移动页面中的一个节点到另一个位置。
|
|
265
|
+
*
|
|
266
|
+
* @param {string} sid - 源节点的ID。
|
|
267
|
+
* @param {string} tid - 目标节点的ID。
|
|
268
|
+
* @param {string} action - 移动类型,可以是 'inside', 'left', 'right' 中的一个。
|
|
269
|
+
* @param {string} newid - 新节点的ID,仅在创建新节点时使用。
|
|
270
|
+
* @param {Object} json - 新节点的初始属性,仅在创建新节点时使用。
|
|
271
|
+
*
|
|
272
|
+
* @description
|
|
273
|
+
* 此函数会更新页面数据状态,根据提供的动作类型(`action`),将源节点(`sourceNode`)移动到目标节点(`targetNode`)的相应位置。
|
|
274
|
+
* - 'inside': 将源节点作为目标节点的子节点。
|
|
275
|
+
* - 'left': 将源节点放在目标节点的左边(同一父节点下)。
|
|
276
|
+
* - 'right': 将源节点放在目标节点的右边(同一父节点下)。
|
|
277
|
+
* 如果 `sid` 是空但提供了 `newid`,则函数会创建一个新的节点。
|
|
278
|
+
*
|
|
284
279
|
*/
|
|
285
280
|
var moveNode = exports.moveNode = function moveNode(sid, tid, action, newid, json) {
|
|
286
281
|
usePageDataStore.setState(function (state) {
|
|
@@ -394,30 +389,41 @@ var useTask = exports.useTask = function useTask(type) {
|
|
|
394
389
|
}, []);
|
|
395
390
|
return task;
|
|
396
391
|
};
|
|
397
|
-
var
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
392
|
+
var getTargetData = function getTargetData(_, source) {
|
|
393
|
+
if ((0, _lodash.isNil)(_)) {
|
|
394
|
+
return source;
|
|
395
|
+
} else if ((0, _lodash.isFunction)(_)) {
|
|
396
|
+
return _(source);
|
|
397
|
+
} else if ((0, _lodash.isArray)(_)) {
|
|
398
|
+
return _.map(function (k) {
|
|
399
|
+
var _findNode;
|
|
400
|
+
return k.includes('.') ? (0, _lodash.get)(source, k) : (_findNode = findNode(source, k)) === null || _findNode === void 0 ? void 0 : _findNode.target;
|
|
401
|
+
});
|
|
402
|
+
} else if ((0, _lodash.isObject)(_) && _.id) {
|
|
403
|
+
var _findNode2;
|
|
404
|
+
var path = _.path;
|
|
405
|
+
var _target = _.id === _constants.LC_BUILDIN_UNIT_KEY.PAGE_ROOT ? source : (_findNode2 = findNode(source, _.id)) === null || _findNode2 === void 0 ? void 0 : _findNode2.target;
|
|
406
|
+
if ((0, _lodash.isNil)(path)) {
|
|
407
|
+
return _target;
|
|
408
|
+
} else if ((0, _lodash.isString)(path)) {
|
|
409
|
+
return (0, _lodash.get)(_target, path);
|
|
410
|
+
} else if ((0, _lodash.isArray)(path)) {
|
|
411
|
+
return path.map(function (k) {
|
|
412
|
+
return (0, _lodash.get)(_target, k);
|
|
407
413
|
});
|
|
408
|
-
} else if ((0, _lodash.isObject)(_) && _.id) {
|
|
409
|
-
var _findNode2;
|
|
410
|
-
var path = _.path;
|
|
411
|
-
var _target = _.id === _constants.LC_BUILDIN_UNIT_KEY.PAGE_ROOT ? state.pageData : (_findNode2 = findNode(state.pageData, _.id)) === null || _findNode2 === void 0 ? void 0 : _findNode2.target;
|
|
412
|
-
return (0, _lodash.isNil)(path) ? _target : (0, _lodash.get)(_target, path);
|
|
413
|
-
} else if ((0, _lodash.isString)(_)) {
|
|
414
|
-
return (0, _lodash.get)(state.pageData, _);
|
|
415
414
|
}
|
|
416
|
-
}))
|
|
417
|
-
|
|
415
|
+
} else if ((0, _lodash.isString)(_)) {
|
|
416
|
+
return (0, _lodash.get)(state.pageData, _);
|
|
417
|
+
}
|
|
418
418
|
};
|
|
419
|
-
var
|
|
420
|
-
|
|
419
|
+
var useGet = exports.useGet = function useGet(_) {
|
|
420
|
+
var ppCtx = (0, _PageProxyProvider.usePageProxyContext)();
|
|
421
|
+
if (ppCtx !== null && ppCtx !== void 0 && ppCtx.proxyCode) {
|
|
422
|
+
return getTargetData(_, usePageDataStore.getState()[ppCtx.proxyCode]);
|
|
423
|
+
}
|
|
424
|
+
return usePageDataStore((0, _shallow.useShallow)(function (state) {
|
|
425
|
+
return getTargetData(_, state.pageData);
|
|
426
|
+
}));
|
|
421
427
|
};
|
|
422
428
|
var setNeedPrompt = exports.setNeedPrompt = function setNeedPrompt(_need) {
|
|
423
429
|
usePageDataStore.setState(function (state) {
|
|
@@ -13,14 +13,20 @@ var _lodash = require("lodash");
|
|
|
13
13
|
var useStateStore = exports.useStateStore = (0, _zustand.create)()((0, _immer.immer)((0, _middleware.subscribeWithSelector)(function (set) {
|
|
14
14
|
return {
|
|
15
15
|
state: {},
|
|
16
|
-
initialize: function initialize(init) {
|
|
16
|
+
initialize: function initialize(init, append) {
|
|
17
17
|
return set(function (store) {
|
|
18
|
-
|
|
18
|
+
if (append) {
|
|
19
|
+
(0, _lodash.forOwn)(init, function (value, key) {
|
|
20
|
+
store.state[key] = value;
|
|
21
|
+
});
|
|
22
|
+
} else {
|
|
23
|
+
store.state = init;
|
|
24
|
+
}
|
|
19
25
|
});
|
|
20
26
|
},
|
|
21
|
-
clear: function clear() {
|
|
27
|
+
clear: function clear(_vars) {
|
|
22
28
|
return set(function (store) {
|
|
23
|
-
store.state =
|
|
29
|
+
store.state = (0, _lodash.omit)(store.state, _vars);
|
|
24
30
|
});
|
|
25
31
|
}
|
|
26
32
|
};
|
|
@@ -12,7 +12,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
12
12
|
var _ahooks = require("ahooks");
|
|
13
13
|
var _antd = require("luck-design/antd");
|
|
14
14
|
var _lodash = require("lodash");
|
|
15
|
-
var _usePageDataStore = require("./usePageDataStore");
|
|
16
15
|
var _helper = require("../../tools/helper");
|
|
17
16
|
var _apiUrl = require("../../../constants/api-url");
|
|
18
17
|
var _excluded = ["datasetCode"];
|
|
@@ -61,8 +60,7 @@ var useTodo = function useTodo() {
|
|
|
61
60
|
params = _ref4.params,
|
|
62
61
|
data = _ref4.data,
|
|
63
62
|
after = _ref4.after;
|
|
64
|
-
var
|
|
65
|
-
var _moduleCode = moduleCode || moduleData.moduleCode;
|
|
63
|
+
var _moduleCode = moduleCode || (0, _helper.getLDMetaAttr)('moduleCode');
|
|
66
64
|
var _dscode = datasetCode || dsCode;
|
|
67
65
|
if (!_moduleCode || !_dscode) {
|
|
68
66
|
_antd.message.warning('接口重要参数(模块编码或数据集编码)丢失');
|
|
@@ -66,7 +66,7 @@ var _default = exports.default = function _default(_ref) {
|
|
|
66
66
|
var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
|
|
67
67
|
_id = _ref4[0],
|
|
68
68
|
_subscriber = _ref4[1];
|
|
69
|
-
var temp = _subscriber._before ? _subscriber._before(payload) : null;
|
|
69
|
+
var temp = _subscriber._before ? _subscriber._before(payload, _id) : null;
|
|
70
70
|
if (_subscriber._before && !(0, _helper.isPromise)(temp)) {
|
|
71
71
|
console.error('before hook must return a promise');
|
|
72
72
|
return;
|
|
@@ -76,10 +76,10 @@ var _default = exports.default = function _default(_ref) {
|
|
|
76
76
|
if (!flag) return flag;
|
|
77
77
|
var func = _subscriber._once || _subscriber._on;
|
|
78
78
|
if (!func) return;
|
|
79
|
-
return func(payload);
|
|
79
|
+
return func(payload, _id);
|
|
80
80
|
}).then(function (flag) {
|
|
81
81
|
if (flag === false || !_subscriber._after) return;
|
|
82
|
-
return _subscriber._after(payload);
|
|
82
|
+
return _subscriber._after(payload, _id);
|
|
83
83
|
}).finally(function () {
|
|
84
84
|
if (_subscriber._once) {
|
|
85
85
|
$unsubscriber(topic, _id);
|
|
@@ -93,6 +93,15 @@ var _default = exports.default = function _default(_ref) {
|
|
|
93
93
|
runtime: runtime
|
|
94
94
|
}, payload));
|
|
95
95
|
});
|
|
96
|
+
var $publisherOnce = (0, _ahooks.useMemoizedFn)(function (topic, payload) {
|
|
97
|
+
return new Promise(function (resolve) {
|
|
98
|
+
event$.emit((0, _objectSpread2.default)({
|
|
99
|
+
topic: topic,
|
|
100
|
+
runtime: runtime
|
|
101
|
+
}, payload));
|
|
102
|
+
$subscriber(topic).once(resolve).watch();
|
|
103
|
+
});
|
|
104
|
+
});
|
|
96
105
|
var $subscriber = (0, _ahooks.useMemoizedFn)(function (topic) {
|
|
97
106
|
if (!subscriberPool.has(topic)) subscriberPool.set(topic, []);
|
|
98
107
|
var id = (0, _utils.suid)();
|
|
@@ -112,7 +121,7 @@ var _default = exports.default = function _default(_ref) {
|
|
|
112
121
|
if (!subscriberPool.get(topic).length) {
|
|
113
122
|
subscriberPool.delete(topic);
|
|
114
123
|
}
|
|
115
|
-
(_subscriber$_off = (_subscriber2 = _subscriber)._off) === null || _subscriber$_off === void 0 || _subscriber$_off.call(_subscriber2);
|
|
124
|
+
(_subscriber$_off = (_subscriber2 = _subscriber)._off) === null || _subscriber$_off === void 0 || _subscriber$_off.call(_subscriber2, _id);
|
|
116
125
|
_subscriber = null;
|
|
117
126
|
}
|
|
118
127
|
});
|
|
@@ -121,6 +130,7 @@ var _default = exports.default = function _default(_ref) {
|
|
|
121
130
|
value: {
|
|
122
131
|
runtime: runtime,
|
|
123
132
|
$publisher: $publisher,
|
|
133
|
+
$publisherOnce: $publisherOnce,
|
|
124
134
|
$subscriber: $subscriber,
|
|
125
135
|
$unsubscriber: $unsubscriber
|
|
126
136
|
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.usePageProxyContext = exports.default = exports.Context = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _ahooks = require("ahooks");
|
|
11
|
+
var _antd = require("luck-design/antd");
|
|
12
|
+
var _lodash = require("lodash");
|
|
13
|
+
var _utils = require("@luck-design-biz/base/utils");
|
|
14
|
+
var _ContextProvider = require("./ContextProvider");
|
|
15
|
+
var _usePageDataStore = _interopRequireDefault(require("./ContextProvider/usePageDataStore"));
|
|
16
|
+
var _dataProcess = require("../tools/dataProcess");
|
|
17
|
+
var _apiUrl = require("../../constants/api-url");
|
|
18
|
+
var Context = exports.Context = /*#__PURE__*/(0, _react.createContext)(null);
|
|
19
|
+
var usePageProxyContext = exports.usePageProxyContext = function usePageProxyContext() {
|
|
20
|
+
return (0, _react.useContext)(Context);
|
|
21
|
+
};
|
|
22
|
+
var _default = exports.default = function _default(_ref) {
|
|
23
|
+
var children = _ref.children,
|
|
24
|
+
id = _ref.id,
|
|
25
|
+
proxyCode = _ref.proxyCode,
|
|
26
|
+
destroyOnUnmount = _ref.destroyOnUnmount,
|
|
27
|
+
proxyParams = _ref.proxyParams;
|
|
28
|
+
if ((0, _lodash.isNil)(proxyCode)) return /*#__PURE__*/_react.default.createElement(_antd.Empty, {
|
|
29
|
+
description: (0, _utils.formatMessage)({
|
|
30
|
+
id: 'luckda.lowcode.view.lc-component.design.nocode',
|
|
31
|
+
label: '缺少页面代理编码配置'
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
var ctx = (0, _ContextProvider.useContext)();
|
|
35
|
+
var _useRequest = (0, _ahooks.useRequest)(_apiUrl.fetchPageData, {
|
|
36
|
+
defaultParams: [{
|
|
37
|
+
code: proxyCode
|
|
38
|
+
}],
|
|
39
|
+
ready: !_usePageDataStore.default.getState()[proxyCode],
|
|
40
|
+
onFinally: function onFinally() {
|
|
41
|
+
ctx.$publisher(ctx.topics.PAGE_LOAD_MOUNT, {
|
|
42
|
+
proxyCode: proxyCode
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
onSuccess: function onSuccess(_ref2) {
|
|
46
|
+
var code = _ref2.code,
|
|
47
|
+
data = _ref2.data,
|
|
48
|
+
list = _ref2.list,
|
|
49
|
+
detail = _ref2.detail;
|
|
50
|
+
if (code === 1) {
|
|
51
|
+
_usePageDataStore.default.setState(function (state) {
|
|
52
|
+
var source = detail[list[0]].source;
|
|
53
|
+
state[proxyCode] = (0, _dataProcess.decompress)(source);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}),
|
|
58
|
+
loading = _useRequest.loading;
|
|
59
|
+
(0, _react.useEffect)(function () {
|
|
60
|
+
if (_usePageDataStore.default.getState()[proxyCode]) {
|
|
61
|
+
ctx.$publisher(ctx.topics.PAGE_LOAD_MOUNT, {
|
|
62
|
+
proxyCode: proxyCode
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return function () {
|
|
66
|
+
if (destroyOnUnmount) {
|
|
67
|
+
_usePageDataStore.default.setState(function (state) {
|
|
68
|
+
state[proxyCode] = null;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}, []);
|
|
73
|
+
var _proxyParams = (0, _ahooks.useCreation)(function () {
|
|
74
|
+
return (0, _lodash.reduce)(proxyParams, function (ret, param) {
|
|
75
|
+
switch (param.origin) {
|
|
76
|
+
case 'state':
|
|
77
|
+
ret[param.name] = ctx.state[param.value];
|
|
78
|
+
return ret;
|
|
79
|
+
case 'golbal':
|
|
80
|
+
ret[param.name] = ctx.global[param.value];
|
|
81
|
+
return ret;
|
|
82
|
+
case 'url':
|
|
83
|
+
ret[param.name] = ctx.router.getQuery(param.value);
|
|
84
|
+
return ret;
|
|
85
|
+
case 'string':
|
|
86
|
+
case 'num':
|
|
87
|
+
case 'bool':
|
|
88
|
+
default:
|
|
89
|
+
ret[param.name] = param.value;
|
|
90
|
+
return ret;
|
|
91
|
+
}
|
|
92
|
+
}, {});
|
|
93
|
+
}, []);
|
|
94
|
+
return /*#__PURE__*/_react.default.createElement(Context.Provider, {
|
|
95
|
+
value: {
|
|
96
|
+
id: id,
|
|
97
|
+
proxyCode: proxyCode,
|
|
98
|
+
params: _proxyParams
|
|
99
|
+
}
|
|
100
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Spin, {
|
|
101
|
+
spinning: loading
|
|
102
|
+
}, children));
|
|
103
|
+
};
|
|
@@ -8,12 +8,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = exports.RemoteSourceContext = void 0;
|
|
9
9
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
10
|
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
11
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
14
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
14
15
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
16
|
var _ahooks = require("ahooks");
|
|
16
17
|
var _umi = require("umi");
|
|
18
|
+
var _lodash = require("lodash");
|
|
17
19
|
var _launcher = _interopRequireDefault(require("../launcher"));
|
|
18
20
|
var _Builder = require("../../../components/Builder");
|
|
19
21
|
var _action2 = require("../../../helper/action");
|
|
@@ -31,12 +33,10 @@ var _default = exports.default = function _default(_ref) {
|
|
|
31
33
|
var _usePageDataStore = (0, _usePageDataStore2.default)(function (state) {
|
|
32
34
|
return {
|
|
33
35
|
initialize: state.initialize,
|
|
34
|
-
initializeModule: state.initializeModule,
|
|
35
36
|
reset: state.reset
|
|
36
37
|
};
|
|
37
38
|
}),
|
|
38
39
|
initialize = _usePageDataStore.initialize,
|
|
39
|
-
initializeModule = _usePageDataStore.initializeModule,
|
|
40
40
|
reset = _usePageDataStore.reset;
|
|
41
41
|
var _useTemporalStore = (0, _usePageDataStore2.useTemporalStore)(function (state) {
|
|
42
42
|
return {
|
|
@@ -78,7 +78,6 @@ var _default = exports.default = function _default(_ref) {
|
|
|
78
78
|
setRemoteSource({
|
|
79
79
|
module: data
|
|
80
80
|
});
|
|
81
|
-
initializeModule(data);
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
83
|
}),
|
|
@@ -161,7 +160,7 @@ var _default = exports.default = function _default(_ref) {
|
|
|
161
160
|
}),
|
|
162
161
|
runFetchAllBehaviorExport = _useRequest6.run;
|
|
163
162
|
(0, _ahooks.useAsyncEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
164
|
-
var fetchPageDataRes, data, list, detail, source;
|
|
163
|
+
var fetchPageDataRes, data, list, detail, source, _pageData;
|
|
165
164
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
166
165
|
while (1) switch (_context.prev = _context.next) {
|
|
167
166
|
case 0:
|
|
@@ -181,16 +180,17 @@ var _default = exports.default = function _default(_ref) {
|
|
|
181
180
|
break;
|
|
182
181
|
}
|
|
183
182
|
_umi.history.replace('/404');
|
|
184
|
-
_context.next =
|
|
183
|
+
_context.next = 21;
|
|
185
184
|
break;
|
|
186
185
|
case 9:
|
|
187
|
-
source = detail[list[0]].source;
|
|
188
186
|
(0, _helper.setMetaAttrs)(_constants.META_TAG_NAME, data);
|
|
189
|
-
|
|
187
|
+
source = detail[list[0]].source;
|
|
188
|
+
_pageData = (0, _dataProcess.decompress)(source);
|
|
189
|
+
_context.next = 14;
|
|
190
190
|
return runFetchModlueData(data.dataModelKey, {
|
|
191
|
-
moduleCode: data.moduleCode
|
|
191
|
+
moduleCode: [data.moduleCode].concat((0, _toConsumableArray2.default)((0, _lodash.values)(_pageData.props.proxy))).join(',')
|
|
192
192
|
});
|
|
193
|
-
case
|
|
193
|
+
case 14:
|
|
194
194
|
runFetchAllBehaviorImport({
|
|
195
195
|
behaviorMode: 'IMPORT',
|
|
196
196
|
moduleCode: data.moduleCode
|
|
@@ -205,11 +205,9 @@ var _default = exports.default = function _default(_ref) {
|
|
|
205
205
|
runFetchAllSerials({
|
|
206
206
|
uid: data.moduleId
|
|
207
207
|
});
|
|
208
|
-
initialize(
|
|
208
|
+
initialize(_pageData);
|
|
209
209
|
resume();
|
|
210
210
|
eventBus.$publisher(_eventTopics.PAGE_LOAD_MOUNT);
|
|
211
|
-
case 20:
|
|
212
|
-
;
|
|
213
211
|
case 21:
|
|
214
212
|
case "end":
|
|
215
213
|
return _context.stop();
|