@luck-design-biz/luckda 1.0.0-alpha → 1.0.1-10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +40 -40
- package/es/components/Builder/index.js +15 -3
- package/es/components/ComplexItem/index.js +65 -49
- package/es/components/LDActions/index.less +68 -68
- package/es/components/LdAutoForm/index.js +6 -4
- package/es/components/LdFormList/index.js +11 -10
- package/es/components/LdGrid/index.js +4 -4
- package/es/components/LdGridForm/index.js +40 -23
- package/es/components/LdGridForm/index.less +7 -7
- package/es/components/LdTree/index.less +40 -40
- package/es/helper/action.js +6 -6
- package/es/helper/form.js +15 -14
- package/es/helper/index.less +7 -7
- package/es/helper/ldBuilder.js +8 -3
- package/es/locales/zh-CN.js +41 -4
- package/es/lowcode/constants/api-url.js +87 -87
- package/es/lowcode/constants/event-topics.js +0 -2
- package/es/lowcode/engine/launcher.js +3 -1
- package/es/lowcode/engine/meta/box.props.json +3 -3
- package/es/lowcode/engine/meta/button.props.default.json +1 -1
- package/es/lowcode/engine/meta/button.props.json +2 -2
- package/es/lowcode/engine/meta/cardlist.props.default.json +1 -0
- package/es/lowcode/engine/meta/cardlist.props.json +2 -1
- package/es/lowcode/engine/meta/components-list.json +6 -126
- package/es/lowcode/engine/meta/dialog.props.default.json +4 -2
- package/es/lowcode/engine/meta/dialog.props.json +76 -20
- package/es/lowcode/engine/meta/drawer.props.default.json +15 -4
- package/es/lowcode/engine/meta/drawer.props.json +144 -24
- package/es/lowcode/engine/meta/fieldcomplex.props.default.json +1 -0
- package/es/lowcode/engine/meta/fieldcomplex.props.json +7 -0
- package/es/lowcode/engine/meta/fielddatadic.props.default.json +16 -0
- package/es/lowcode/engine/meta/fielddatadic.props.json +73 -0
- package/es/lowcode/engine/meta/fielddate.props.default.json +2 -0
- package/es/lowcode/engine/meta/fielddate.props.json +4 -2
- package/es/lowcode/engine/meta/fieldnumber.props.default.json +1 -0
- package/es/lowcode/engine/meta/fieldnumber.props.json +3 -2
- package/es/lowcode/engine/meta/fielduser.props.default.json +1 -1
- package/es/lowcode/engine/meta/fielduser.props.json +1 -1
- package/es/lowcode/engine/meta/form.props.default.json +14 -4
- package/es/lowcode/engine/meta/form.props.json +53 -14
- package/es/lowcode/engine/meta/grouptree.props.default.json +16 -0
- package/es/lowcode/engine/meta/grouptree.props.json +89 -0
- package/es/lowcode/engine/meta/iframe.props.default.json +2 -1
- package/es/lowcode/engine/meta/iframe.props.json +3 -2
- package/es/lowcode/engine/meta/image.props.default.json +2 -1
- package/es/lowcode/engine/meta/image.props.json +3 -2
- package/es/lowcode/engine/meta/imex.props.default.json +2 -1
- package/es/lowcode/engine/meta/imex.props.json +27 -6
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +65 -42
- package/es/lowcode/engine/meta/jsx.props.default.json +1 -1
- package/es/lowcode/engine/meta/jsx.props.json +1 -1
- package/es/lowcode/engine/meta/layout.props.default.json +1 -1
- package/es/lowcode/engine/meta/layout.props.json +5 -5
- package/es/lowcode/engine/meta/link.props.default.json +2 -1
- package/es/lowcode/engine/meta/link.props.json +3 -2
- package/es/lowcode/engine/meta/page.props.json +6 -0
- package/es/lowcode/engine/meta/pagelayout.props.default.json +1 -1
- package/es/lowcode/engine/meta/pagelayout.props.json +1 -1
- package/es/lowcode/engine/meta/section.props.json +2 -1
- package/es/lowcode/engine/meta/split.props.default.json +1 -1
- package/es/lowcode/engine/meta/split.props.json +1 -1
- package/es/lowcode/engine/meta/table.props.json +3 -3
- package/es/lowcode/engine/meta/text.props.default.json +4 -2
- package/es/lowcode/engine/meta/text.props.json +8 -6
- package/es/lowcode/engine/meta/tree.props.json +2 -2
- package/es/lowcode/engine/provider/ContextProvider/index.js +83 -66
- package/es/lowcode/engine/provider/ContextProvider/router.js +43 -0
- package/es/lowcode/engine/{tools → provider/ContextProvider}/usePageDataStore.js +9 -7
- package/es/lowcode/engine/provider/ContextProvider/usePageVar.js +38 -15
- package/es/lowcode/engine/{tools → provider/ContextProvider}/useTodo.js +5 -7
- package/es/lowcode/engine/provider/ContextProvider/utils.js +157 -0
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +1 -2
- package/es/lowcode/engine/tools/dataProcess.js +76 -76
- package/es/lowcode/engine/tools/helper.js +28 -2
- package/es/lowcode/engine/tools/initDS.js +263 -0
- package/es/lowcode/engine/tools/useCanvasRender.js +13 -1
- package/es/lowcode/engine/tools/useCombinedRefs.js +3 -2
- package/es/lowcode/painter/Components.js +2 -2
- package/es/lowcode/painter/Design.js +1 -0
- package/es/lowcode/painter/DesignOperator.js +25 -11
- package/es/lowcode/painter/Panel.js +2 -2
- package/es/lowcode/painter/components/AdvancePanel.js +3 -3
- package/es/lowcode/painter/components/Collapse.js +31 -28
- 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 +29 -29
- 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 +16 -0
- package/es/lowcode/painter/components/VarEditor.js +456 -0
- 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 +25 -25
- package/es/lowcode/painter/components/code-editor/JSEditor.js +23 -21
- package/es/lowcode/painter/components/code-editor/JsonEditor.js +25 -25
- package/es/lowcode/painter/components/code-editor/VisionEditor.js +81 -0
- package/es/lowcode/painter/components/field-setting/SettingUI.js +47 -5
- package/es/lowcode/painter/components/field-setting/index.js +27 -13
- package/es/lowcode/painter/components/field-setting/meta/frontRules.js +2 -1
- package/es/lowcode/painter/index.js +1 -0
- package/es/lowcode/painter/panel-section/BlockEditor/index.js +20 -6
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +2 -2
- package/es/lowcode/painter/panel-section/ComplexPop.js +242 -0
- package/es/lowcode/painter/panel-section/DataSetSelector.js +8 -0
- package/es/lowcode/painter/panel-section/FieldsSetting.js +30 -4
- package/es/lowcode/painter/panel-section/GroupClassSelector.js +55 -0
- package/es/lowcode/painter/panel-section/I18nInput.js +4 -2
- package/es/lowcode/painter/panel-section/Icon.js +32 -27
- package/es/lowcode/painter/panel-section/IconConditionSelector.js +7 -7
- package/es/lowcode/painter/panel-section/IconSelector.js +17 -17
- package/es/lowcode/painter/panel-section/ImpExp.js +1 -27
- package/es/lowcode/painter/panel-section/ImpExpAlone.js +1 -2
- package/es/lowcode/painter/panel-section/LayoutRatio.js +22 -21
- package/es/lowcode/painter/panel-section/PageVars.js +300 -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 +6 -5
- 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/panel-section/TabItems.js +6 -42
- package/es/lowcode/painter/panel-section/TextContent.js +79 -0
- package/es/lowcode/painter/services/complexPop.js +21 -0
- package/es/lowcode/painter/style/action-bind-modal.less +102 -102
- 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 +166 -160
- package/es/lowcode/painter/style/display.less +17 -17
- package/es/lowcode/painter/style/dragdrop.less +10 -10
- 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/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 +95 -95
- package/es/lowcode/painter/style/number-input.less +17 -17
- package/es/lowcode/painter/style/outline.less +28 -28
- package/es/lowcode/painter/style/page-layout-display.less +27 -27
- package/es/lowcode/painter/style/page-vars.less +25 -0
- package/es/lowcode/painter/style/panel-attrs.less +43 -43
- package/es/lowcode/painter/style/panel-item.less +54 -54
- package/es/lowcode/painter/style/panel.less +98 -98
- 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 +5 -5
- 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/style/treedragdrop.less +19 -19
- package/es/lowcode/preview/index.js +1 -0
- package/es/lowcode/view/Canvas.js +24 -22
- package/es/lowcode/view/Loading.js +5 -7
- package/es/lowcode/view/Page.js +37 -15
- package/es/lowcode/view/index.js +1 -0
- package/es/lowcode/view/lc-components/Box/index.js +22 -7
- 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 +40 -40
- 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/meta.json +154 -153
- package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +14 -6
- package/es/lowcode/view/lc-components/Dialog/index.js +34 -25
- package/es/lowcode/view/lc-components/Dialog/index.less +12 -8
- package/es/lowcode/view/lc-components/Dialog/meta.json +204 -150
- package/es/lowcode/view/lc-components/Drawer/FunctionDesign.js +51 -8
- package/es/lowcode/view/lc-components/Drawer/index.js +149 -34
- package/es/lowcode/view/lc-components/Drawer/index.less +13 -10
- package/es/lowcode/view/lc-components/Drawer/meta.json +242 -131
- package/es/lowcode/view/lc-components/FieldColor/meta.json +157 -157
- package/es/lowcode/view/lc-components/FieldComplex/meta.json +140 -133
- package/es/lowcode/view/lc-components/FieldDate/meta.json +141 -139
- package/es/lowcode/view/lc-components/FieldDict/meta.json +138 -138
- package/es/lowcode/view/lc-components/FieldEditor/meta.json +138 -138
- package/es/lowcode/view/lc-components/FieldGroup/meta.json +167 -167
- package/es/lowcode/view/lc-components/FieldNumber/meta.json +143 -142
- 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 +129 -129
- package/es/lowcode/view/lc-components/Form/FunctionDesign.js +2 -1
- package/es/lowcode/view/lc-components/Form/index.js +76 -51
- package/es/lowcode/view/lc-components/Form/meta.json +645 -610
- package/es/lowcode/view/lc-components/GroupTree/FunctionDesign.js +10 -0
- package/es/lowcode/view/lc-components/GroupTree/FunctionLive.js +10 -0
- package/es/lowcode/view/lc-components/GroupTree/FunctionPreview.js +10 -0
- package/es/lowcode/view/lc-components/GroupTree/index.js +201 -0
- package/es/lowcode/view/lc-components/GroupTree/meta.json +89 -0
- package/es/lowcode/view/lc-components/Iframe/meta.json +33 -32
- package/es/lowcode/view/lc-components/ImEx/index.js +199 -128
- package/es/lowcode/view/lc-components/ImEx/index.less +7 -7
- package/es/lowcode/view/lc-components/ImEx/meta.json +134 -113
- package/es/lowcode/view/lc-components/Image/meta.json +115 -114
- package/es/lowcode/view/lc-components/JSX/RuntimeComp.js +4 -4
- package/es/lowcode/view/lc-components/JSX/meta.json +28 -28
- package/es/lowcode/view/lc-components/Layout/index.js +38 -21
- 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/meta.json +113 -112
- package/es/lowcode/view/lc-components/Page/meta.json +61 -55
- 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/FunctionDesign.js +5 -1
- package/es/lowcode/view/lc-components/PageLayout/meta.json +59 -59
- package/es/lowcode/view/lc-components/Section/index.js +2 -6
- package/es/lowcode/view/lc-components/Section/index.less +7 -7
- package/es/lowcode/view/lc-components/Section/meta.json +108 -107
- package/es/lowcode/view/lc-components/Split/index.js +19 -4
- package/es/lowcode/view/lc-components/Split/meta.json +53 -53
- package/es/lowcode/view/lc-components/Table/index.js +175 -148
- package/es/lowcode/view/lc-components/Table/meta.json +450 -450
- package/es/lowcode/view/lc-components/Tabs/index.js +42 -39
- package/es/lowcode/view/lc-components/Tabs/meta.json +113 -113
- package/es/lowcode/view/lc-components/Text/index.js +9 -2
- package/es/lowcode/view/lc-components/Text/meta.json +56 -56
- package/es/lowcode/view/lc-components/Tree/index.js +102 -107
- package/es/lowcode/view/lc-components/Tree/index.less +4 -4
- package/es/lowcode/view/lc-components/Tree/meta.json +357 -357
- package/es/lowcode/view/lc-components/Wrapper.js +17 -2
- package/es/lowcode/view/style/canvas.less +5 -5
- package/es/lowcode/view/style/loading.less +98 -84
- package/es/lowcode/view/style/page.less +7 -7
- package/es/services.js +19 -0
- package/es/upload/FilesWall/index.js +13 -13
- package/es/upload/FilesWall/index.less +74 -74
- package/es/upload/Form/gridForm.js +17 -7
- package/es/upload/Form/index.less +7 -7
- package/es/upload/FormItem/index.js +18 -18
- package/es/utils/form.js +25 -25
- package/es/utils/grid.js +5 -4
- package/lib/components/Builder/index.js +13 -1
- package/lib/components/ComplexItem/index.js +62 -47
- package/lib/components/LDActions/index.less +68 -68
- package/lib/components/LdAutoForm/index.js +5 -3
- package/lib/components/LdFormList/index.js +12 -11
- package/lib/components/LdGrid/index.js +4 -4
- package/lib/components/LdGridForm/index.js +40 -23
- package/lib/components/LdGridForm/index.less +7 -7
- package/lib/components/LdTree/index.less +40 -40
- package/lib/helper/action.js +6 -6
- package/lib/helper/form.js +15 -14
- package/lib/helper/index.less +7 -7
- package/lib/helper/ldBuilder.js +8 -3
- package/lib/locales/zh-CN.js +41 -4
- package/lib/lowcode/constants/api-url.js +87 -87
- package/lib/lowcode/constants/event-topics.js +1 -3
- package/lib/lowcode/engine/launcher.js +3 -1
- package/lib/lowcode/engine/meta/box.props.json +3 -3
- package/lib/lowcode/engine/meta/button.props.default.json +1 -1
- package/lib/lowcode/engine/meta/button.props.json +2 -2
- package/lib/lowcode/engine/meta/cardlist.props.default.json +1 -0
- package/lib/lowcode/engine/meta/cardlist.props.json +2 -1
- package/lib/lowcode/engine/meta/components-list.json +6 -126
- package/lib/lowcode/engine/meta/dialog.props.default.json +4 -2
- package/lib/lowcode/engine/meta/dialog.props.json +76 -20
- package/lib/lowcode/engine/meta/drawer.props.default.json +15 -4
- package/lib/lowcode/engine/meta/drawer.props.json +144 -24
- package/lib/lowcode/engine/meta/fieldcomplex.props.default.json +1 -0
- package/lib/lowcode/engine/meta/fieldcomplex.props.json +7 -0
- package/lib/lowcode/engine/meta/fielddatadic.props.default.json +16 -0
- package/lib/lowcode/engine/meta/fielddatadic.props.json +73 -0
- package/lib/lowcode/engine/meta/fielddate.props.default.json +2 -0
- package/lib/lowcode/engine/meta/fielddate.props.json +4 -2
- package/lib/lowcode/engine/meta/fieldnumber.props.default.json +1 -0
- package/lib/lowcode/engine/meta/fieldnumber.props.json +3 -2
- package/lib/lowcode/engine/meta/fielduser.props.default.json +1 -1
- package/lib/lowcode/engine/meta/fielduser.props.json +1 -1
- package/lib/lowcode/engine/meta/form.props.default.json +14 -4
- package/lib/lowcode/engine/meta/form.props.json +53 -14
- package/lib/lowcode/engine/meta/grouptree.props.default.json +16 -0
- package/lib/lowcode/engine/meta/grouptree.props.json +89 -0
- package/lib/lowcode/engine/meta/iframe.props.default.json +2 -1
- package/lib/lowcode/engine/meta/iframe.props.json +3 -2
- package/lib/lowcode/engine/meta/image.props.default.json +2 -1
- package/lib/lowcode/engine/meta/image.props.json +3 -2
- package/lib/lowcode/engine/meta/imex.props.default.json +2 -1
- package/lib/lowcode/engine/meta/imex.props.json +27 -6
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +65 -42
- package/lib/lowcode/engine/meta/jsx.props.default.json +1 -1
- package/lib/lowcode/engine/meta/jsx.props.json +1 -1
- package/lib/lowcode/engine/meta/layout.props.default.json +1 -1
- package/lib/lowcode/engine/meta/layout.props.json +5 -5
- package/lib/lowcode/engine/meta/link.props.default.json +2 -1
- package/lib/lowcode/engine/meta/link.props.json +3 -2
- package/lib/lowcode/engine/meta/page.props.json +6 -0
- package/lib/lowcode/engine/meta/pagelayout.props.default.json +1 -1
- package/lib/lowcode/engine/meta/pagelayout.props.json +1 -1
- package/lib/lowcode/engine/meta/section.props.json +2 -1
- package/lib/lowcode/engine/meta/split.props.default.json +1 -1
- package/lib/lowcode/engine/meta/split.props.json +1 -1
- package/lib/lowcode/engine/meta/table.props.json +3 -3
- package/lib/lowcode/engine/meta/text.props.default.json +4 -2
- package/lib/lowcode/engine/meta/text.props.json +8 -6
- package/lib/lowcode/engine/meta/tree.props.json +2 -2
- package/lib/lowcode/engine/provider/ContextProvider/index.js +81 -64
- package/lib/lowcode/engine/provider/ContextProvider/router.js +57 -0
- package/lib/lowcode/engine/{tools → provider/ContextProvider}/usePageDataStore.js +9 -7
- package/lib/lowcode/engine/provider/ContextProvider/usePageVar.js +38 -16
- package/lib/lowcode/engine/{tools → provider/ContextProvider}/useTodo.js +5 -7
- package/lib/lowcode/engine/provider/ContextProvider/utils.js +170 -0
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +2 -3
- package/lib/lowcode/engine/tools/dataProcess.js +76 -76
- package/lib/lowcode/engine/tools/helper.js +29 -2
- package/lib/lowcode/engine/tools/initDS.js +270 -0
- package/lib/lowcode/engine/tools/useCanvasRender.js +13 -1
- package/lib/lowcode/engine/tools/useCombinedRefs.js +2 -1
- package/lib/lowcode/painter/Components.js +2 -2
- package/lib/lowcode/painter/Design.js +1 -0
- package/lib/lowcode/painter/DesignOperator.js +24 -10
- package/lib/lowcode/painter/Panel.js +2 -2
- package/lib/lowcode/painter/components/AdvancePanel.js +3 -3
- package/lib/lowcode/painter/components/Collapse.js +31 -28
- 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 +29 -29
- 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 +23 -0
- package/lib/lowcode/painter/components/VarEditor.js +463 -0
- 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 +25 -25
- package/lib/lowcode/painter/components/code-editor/JSEditor.js +23 -21
- package/lib/lowcode/painter/components/code-editor/JsonEditor.js +25 -25
- package/lib/lowcode/painter/components/code-editor/VisionEditor.js +88 -0
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +46 -4
- package/lib/lowcode/painter/components/field-setting/index.js +27 -13
- package/lib/lowcode/painter/components/field-setting/meta/frontRules.js +2 -1
- package/lib/lowcode/painter/index.js +1 -0
- package/lib/lowcode/painter/panel-section/BlockEditor/index.js +19 -5
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +2 -2
- package/lib/lowcode/painter/panel-section/ComplexPop.js +250 -0
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +8 -0
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +30 -4
- package/lib/lowcode/painter/panel-section/GroupClassSelector.js +63 -0
- package/lib/lowcode/painter/panel-section/I18nInput.js +4 -2
- package/lib/lowcode/painter/panel-section/Icon.js +31 -26
- package/lib/lowcode/painter/panel-section/IconConditionSelector.js +6 -6
- package/lib/lowcode/painter/panel-section/IconSelector.js +17 -17
- package/lib/lowcode/painter/panel-section/ImpExp.js +0 -26
- package/lib/lowcode/painter/panel-section/ImpExpAlone.js +0 -1
- package/lib/lowcode/painter/panel-section/LayoutRatio.js +22 -21
- package/lib/lowcode/painter/panel-section/PageVars.js +308 -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 +6 -5
- 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/panel-section/TabItems.js +6 -42
- package/lib/lowcode/painter/panel-section/TextContent.js +87 -0
- package/lib/lowcode/painter/services/complexPop.js +28 -0
- package/lib/lowcode/painter/style/action-bind-modal.less +102 -102
- 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 +166 -160
- package/lib/lowcode/painter/style/display.less +17 -17
- package/lib/lowcode/painter/style/dragdrop.less +10 -10
- 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/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 +95 -95
- package/lib/lowcode/painter/style/number-input.less +17 -17
- package/lib/lowcode/painter/style/outline.less +28 -28
- package/lib/lowcode/painter/style/page-layout-display.less +27 -27
- package/lib/lowcode/painter/style/page-vars.less +25 -0
- package/lib/lowcode/painter/style/panel-attrs.less +43 -43
- package/lib/lowcode/painter/style/panel-item.less +54 -54
- package/lib/lowcode/painter/style/panel.less +98 -98
- 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 +5 -5
- 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/style/treedragdrop.less +19 -19
- package/lib/lowcode/preview/index.js +1 -0
- package/lib/lowcode/view/Canvas.js +24 -22
- package/lib/lowcode/view/Loading.js +5 -7
- package/lib/lowcode/view/Page.js +35 -13
- package/lib/lowcode/view/index.js +1 -0
- package/lib/lowcode/view/lc-components/Box/index.js +21 -6
- 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 +38 -38
- 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/meta.json +154 -153
- package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +13 -5
- package/lib/lowcode/view/lc-components/Dialog/index.js +34 -25
- package/lib/lowcode/view/lc-components/Dialog/index.less +12 -8
- package/lib/lowcode/view/lc-components/Dialog/meta.json +204 -150
- package/lib/lowcode/view/lc-components/Drawer/FunctionDesign.js +52 -8
- package/lib/lowcode/view/lc-components/Drawer/index.js +148 -33
- package/lib/lowcode/view/lc-components/Drawer/index.less +13 -10
- package/lib/lowcode/view/lc-components/Drawer/meta.json +242 -131
- package/lib/lowcode/view/lc-components/FieldColor/meta.json +157 -157
- package/lib/lowcode/view/lc-components/FieldComplex/meta.json +140 -133
- package/lib/lowcode/view/lc-components/FieldDate/meta.json +141 -139
- package/lib/lowcode/view/lc-components/FieldDict/meta.json +138 -138
- package/lib/lowcode/view/lc-components/FieldEditor/meta.json +138 -138
- package/lib/lowcode/view/lc-components/FieldGroup/meta.json +167 -167
- package/lib/lowcode/view/lc-components/FieldNumber/meta.json +143 -142
- 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 +129 -129
- package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Form/index.js +75 -50
- package/lib/lowcode/view/lc-components/Form/meta.json +645 -610
- package/lib/lowcode/view/lc-components/GroupTree/FunctionDesign.js +17 -0
- package/lib/lowcode/view/lc-components/GroupTree/FunctionLive.js +17 -0
- package/lib/lowcode/view/lc-components/GroupTree/FunctionPreview.js +17 -0
- package/lib/lowcode/view/lc-components/GroupTree/index.js +209 -0
- package/lib/lowcode/view/lc-components/GroupTree/meta.json +89 -0
- package/lib/lowcode/view/lc-components/Iframe/meta.json +33 -32
- package/lib/lowcode/view/lc-components/ImEx/index.js +197 -126
- package/lib/lowcode/view/lc-components/ImEx/index.less +7 -7
- package/lib/lowcode/view/lc-components/ImEx/meta.json +134 -113
- package/lib/lowcode/view/lc-components/Image/meta.json +115 -114
- package/lib/lowcode/view/lc-components/JSX/RuntimeComp.js +4 -4
- package/lib/lowcode/view/lc-components/JSX/meta.json +28 -28
- package/lib/lowcode/view/lc-components/Layout/index.js +37 -20
- 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/meta.json +113 -112
- package/lib/lowcode/view/lc-components/Page/meta.json +61 -55
- 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/FunctionDesign.js +5 -1
- package/lib/lowcode/view/lc-components/PageLayout/meta.json +59 -59
- package/lib/lowcode/view/lc-components/Section/index.js +2 -6
- package/lib/lowcode/view/lc-components/Section/index.less +7 -7
- package/lib/lowcode/view/lc-components/Section/meta.json +108 -107
- package/lib/lowcode/view/lc-components/Split/index.js +18 -3
- package/lib/lowcode/view/lc-components/Split/meta.json +53 -53
- package/lib/lowcode/view/lc-components/Table/index.js +176 -149
- package/lib/lowcode/view/lc-components/Table/meta.json +450 -450
- package/lib/lowcode/view/lc-components/Tabs/index.js +40 -37
- package/lib/lowcode/view/lc-components/Tabs/meta.json +113 -113
- package/lib/lowcode/view/lc-components/Text/index.js +8 -1
- package/lib/lowcode/view/lc-components/Text/meta.json +56 -56
- package/lib/lowcode/view/lc-components/Tree/index.js +102 -107
- package/lib/lowcode/view/lc-components/Tree/index.less +4 -4
- package/lib/lowcode/view/lc-components/Tree/meta.json +357 -357
- package/lib/lowcode/view/lc-components/Wrapper.js +16 -1
- package/lib/lowcode/view/style/canvas.less +5 -5
- package/lib/lowcode/view/style/loading.less +98 -84
- package/lib/lowcode/view/style/page.less +7 -7
- package/lib/services.js +20 -0
- package/lib/upload/FilesWall/index.js +13 -13
- package/lib/upload/FilesWall/index.less +74 -74
- package/lib/upload/Form/gridForm.js +17 -7
- package/lib/upload/Form/index.less +7 -7
- package/lib/upload/FormItem/index.js +18 -18
- package/lib/utils/form.js +24 -24
- package/lib/utils/grid.js +4 -3
- package/lowcode.js +1 -1
- package/package.json +175 -175
- package/upload.js +1 -1
- package/utils.js +1 -1
- package/es/lowcode/view/lc-components/Form/index.less +0 -5
- package/lib/lowcode/view/lc-components/Form/index.less +0 -5
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
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
|
-
import {
|
|
5
|
-
import { useMemoizedFn, useUpdateEffect } from 'ahooks';
|
|
4
|
+
import { useMemoizedFn } from 'ahooks';
|
|
6
5
|
import { isNil } from 'lodash';
|
|
7
|
-
import diff from "../../tools/diff";
|
|
8
6
|
import { useLDEventBus } from "../EventBusProvider";
|
|
9
7
|
import RemoteSourceProvider, { RemoteSourceContext } from "../RemoteSourceProvider";
|
|
10
8
|
import usePageVar from "./usePageVar";
|
|
11
|
-
import useTodo from "
|
|
12
|
-
import { getModuleData } from "
|
|
9
|
+
import useTodo from "./useTodo";
|
|
10
|
+
import { getModuleData } from "./usePageDataStore";
|
|
11
|
+
import API_PREFIX from "@/services/ApiConfig";
|
|
12
|
+
import { getBehaviorUrl } from "../../../constants/api-url";
|
|
13
13
|
import * as topics from "../../../constants/event-topics";
|
|
14
|
+
import * as utils from "./utils";
|
|
15
|
+
import * as router from "./router";
|
|
14
16
|
export var Context = /*#__PURE__*/createContext(null);
|
|
15
17
|
export var useContext = function useContext() {
|
|
16
18
|
return useReactContext(Context);
|
|
@@ -18,31 +20,32 @@ export var useContext = function useContext() {
|
|
|
18
20
|
export var useRemoteSource = function useRemoteSource() {
|
|
19
21
|
return useReactContext(RemoteSourceContext);
|
|
20
22
|
};
|
|
21
|
-
export * from "
|
|
22
|
-
var PRIVATE_KEYS = ['componentList', 'componentMap'];
|
|
23
|
+
export * from "./usePageDataStore";
|
|
24
|
+
var PRIVATE_KEYS = ['componentList', 'componentMap', 'remoteApiMap'];
|
|
23
25
|
export default (function (_ref) {
|
|
24
26
|
var children = _ref.children,
|
|
25
27
|
code = _ref.code;
|
|
26
28
|
var eventBus = useLDEventBus();
|
|
27
29
|
var _useTodo = useTodo(),
|
|
28
|
-
_useTodo2 = _slicedToArray(_useTodo,
|
|
30
|
+
_useTodo2 = _slicedToArray(_useTodo, 2),
|
|
29
31
|
todo = _useTodo2[0],
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var _usePageVar = usePageVar(null, null),
|
|
33
|
-
state = _usePageVar.state,
|
|
34
|
-
prevState = _usePageVar.prevState,
|
|
32
|
+
loading = _useTodo2[1];
|
|
33
|
+
var _usePageVar = usePageVar(),
|
|
35
34
|
setState = _usePageVar.setState,
|
|
36
35
|
getState = _usePageVar.getState,
|
|
37
36
|
global = _usePageVar.global,
|
|
38
37
|
setGlobal = _usePageVar.setGlobal;
|
|
39
38
|
var _componentList = useRef([]);
|
|
39
|
+
var _remoteApiMap = useRef(new Map());
|
|
40
40
|
var _privateGetter = useRef({
|
|
41
41
|
componentList: function componentList() {
|
|
42
42
|
return _componentList.current;
|
|
43
43
|
},
|
|
44
44
|
componentMap: function componentMap() {
|
|
45
45
|
return new Map(_componentList.current);
|
|
46
|
+
},
|
|
47
|
+
remoteApiMap: function remoteApiMap() {
|
|
48
|
+
return Object.fromEntries(_remoteApiMap.current.entries());
|
|
46
49
|
}
|
|
47
50
|
});
|
|
48
51
|
var _register = useMemoizedFn(function (id, component) {
|
|
@@ -55,6 +58,9 @@ export default (function (_ref) {
|
|
|
55
58
|
return _id !== id;
|
|
56
59
|
});
|
|
57
60
|
});
|
|
61
|
+
var _initRemoteApiMap = useMemoizedFn(function (_apiMap) {
|
|
62
|
+
_remoteApiMap.current = _apiMap;
|
|
63
|
+
});
|
|
58
64
|
var getElementById = useMemoizedFn(function (compId) {
|
|
59
65
|
var _componentList$curren;
|
|
60
66
|
return (_componentList$curren = _componentList.current.find(function (_ref4) {
|
|
@@ -63,15 +69,13 @@ export default (function (_ref) {
|
|
|
63
69
|
return compId === _id;
|
|
64
70
|
})) === null || _componentList$curren === void 0 ? void 0 : _componentList$curren[1];
|
|
65
71
|
});
|
|
66
|
-
var
|
|
72
|
+
var getParentElementById = useMemoizedFn(function (compId) {
|
|
73
|
+
var _target$api$getSelfDa;
|
|
67
74
|
var compMap = new Map(_componentList.current);
|
|
68
75
|
var _target = compMap.get(compId);
|
|
69
|
-
var _parentId = _target.api.getSelfData().parentId;
|
|
76
|
+
var _parentId = (_target$api$getSelfDa = _target.api.getSelfData()) === null || _target$api$getSelfDa === void 0 ? void 0 : _target$api$getSelfDa.props.parentId;
|
|
70
77
|
if (!_parentId) return null;
|
|
71
|
-
return compMap(_parentId);
|
|
72
|
-
});
|
|
73
|
-
var getUrlParams = useMemoizedFn(function () {
|
|
74
|
-
return history.location.query;
|
|
78
|
+
return compMap.get(_parentId);
|
|
75
79
|
});
|
|
76
80
|
var want = useMemoizedFn(function (wanted) {
|
|
77
81
|
var _getModuleData;
|
|
@@ -89,71 +93,82 @@ export default (function (_ref) {
|
|
|
89
93
|
}, 0);
|
|
90
94
|
return (serialsValue & (serialMap[wanted] || 0)) === 1;
|
|
91
95
|
});
|
|
92
|
-
useUpdateEffect(function () {
|
|
93
|
-
var _diff = diff(prevState, state);
|
|
94
|
-
eventBus.$publisher(topics.PAGE_STATE_CHANGED, {
|
|
95
|
-
state: state,
|
|
96
|
-
prevState: prevState,
|
|
97
|
-
diff: _diff
|
|
98
|
-
});
|
|
99
|
-
}, [state, prevState]);
|
|
100
96
|
var ctx = new Proxy(_objectSpread({
|
|
101
97
|
_register: _register,
|
|
102
98
|
_unregister: _unregister,
|
|
103
|
-
|
|
104
|
-
|
|
99
|
+
_initRemoteApiMap: _initRemoteApiMap,
|
|
100
|
+
/**
|
|
101
|
+
* @property {boolean} loading - loading状态
|
|
105
102
|
*/
|
|
106
103
|
loading: loading,
|
|
107
|
-
/**
|
|
108
|
-
* @property {object}
|
|
109
|
-
*/
|
|
110
|
-
history: history,
|
|
111
|
-
/**
|
|
112
|
-
* @method - 执行行为接口
|
|
113
|
-
* @param {object} evns - moduleCode: 模块编码,datasetCode:数据集编码,behaviorKey:行为key
|
|
114
|
-
* @param {object} params - 链接参数
|
|
115
|
-
* @param {object} data - body参数
|
|
116
|
-
*/
|
|
117
|
-
callBehavior: callBehavior,
|
|
118
|
-
/**
|
|
119
|
-
* @property {object} topics - 内置的事件话题
|
|
104
|
+
/**
|
|
105
|
+
* @property {object} topics - 内置的事件话题
|
|
120
106
|
*/
|
|
121
107
|
topics: topics,
|
|
122
|
-
/**
|
|
123
|
-
* @property {
|
|
108
|
+
/**
|
|
109
|
+
* @property {object} topics - service api前缀
|
|
110
|
+
*/
|
|
111
|
+
API_PREFIX: API_PREFIX,
|
|
112
|
+
/**
|
|
113
|
+
* @property {string} PRIMARY_KEY - 主键key
|
|
124
114
|
*/
|
|
125
115
|
PRIMARY_KEY: window.appConfig.constraintKeys.PRIMARY,
|
|
116
|
+
/**
|
|
117
|
+
* @property {string} PARENT_KEY - 树组件主键key
|
|
118
|
+
*/
|
|
126
119
|
PARENT_KEY: window.appConfig.constraintKeys.PARENT,
|
|
127
|
-
/**
|
|
128
|
-
* @method - 根据组件ID获取实例
|
|
129
|
-
* @param {string} compId - 组件ID
|
|
130
|
-
* @return {object} target - 组件实例
|
|
120
|
+
/**
|
|
121
|
+
* @method - 根据组件ID获取实例
|
|
122
|
+
* @param {string} compId - 组件ID
|
|
123
|
+
* @return {object} target - 组件实例
|
|
131
124
|
*/
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* @method - 根据组件ID获取父组件实例
|
|
135
|
-
* @param {string} compId - 组件ID
|
|
136
|
-
* @return {object} target - 父组件实例
|
|
125
|
+
$: getElementById,
|
|
126
|
+
/**
|
|
127
|
+
* @method - 根据组件ID获取父组件实例
|
|
128
|
+
* @param {string} compId - 组件ID
|
|
129
|
+
* @return {object} target - 父组件实例
|
|
137
130
|
*/
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* @method - 执行行为池
|
|
141
|
-
* @param {object} actionPool - 行为池
|
|
142
|
-
* @param {object} args - 参数
|
|
131
|
+
$$: getParentElementById,
|
|
132
|
+
/**
|
|
133
|
+
* @method - 执行行为池
|
|
134
|
+
* @param {object} actionPool - 行为池
|
|
135
|
+
* @param {object} args - 参数
|
|
143
136
|
*/
|
|
144
137
|
doAction: function doAction(actionPool, args) {
|
|
145
138
|
return todo(this, actionPool, args);
|
|
146
139
|
},
|
|
147
|
-
/**
|
|
148
|
-
* @method -
|
|
149
|
-
* @return {
|
|
140
|
+
/**
|
|
141
|
+
* @method - 是否有权限
|
|
142
|
+
* @return {string} wanted - 期望的资源串
|
|
143
|
+
*/
|
|
144
|
+
want: want,
|
|
145
|
+
/**
|
|
146
|
+
* @method - 获取执行行为请求的接口URL
|
|
147
|
+
* @return {string} BEHAVIOR_URL - 执行行为请求的接口URL
|
|
148
|
+
*/
|
|
149
|
+
getBehaviorUrl: getBehaviorUrl,
|
|
150
|
+
/**
|
|
151
|
+
* @typedef {Object} Utils
|
|
152
|
+
* @property {function(type, props): void} dialog - 弹出对话框
|
|
153
|
+
* @property {function({ moduleCode, datasetCode, behaviorKey }, params, data): Promise} callBehavior - 执行行为
|
|
154
|
+
* @property {function(type, value, formatOrSeparator): string} formatter - 常用的 formatter 函数用于进行事件、金额、手机号等 format
|
|
155
|
+
* @property {function(when, type): string} getDateTimeRange - 获取当前或指定日期的开始结束区间时间戳
|
|
156
|
+
*/
|
|
157
|
+
/**
|
|
158
|
+
* @property {Utils} 工具类
|
|
159
|
+
*/
|
|
160
|
+
utils: utils,
|
|
161
|
+
/**
|
|
162
|
+
* @typedef {Object} Router
|
|
163
|
+
* @property {function(path, params): void} push - 跳转
|
|
164
|
+
* @property {function(path, state): void} replace - 替换
|
|
165
|
+
* @property {function{}: object} getQuery - 获取URL参数
|
|
166
|
+
* @property {function(params): string} stringifyQuery - 序列化 URL 参数
|
|
150
167
|
*/
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
* @method - 是否有权限
|
|
154
|
-
* @return {string} wanted - 期望的资源串
|
|
168
|
+
/**
|
|
169
|
+
* @property {Router} router - 路由
|
|
155
170
|
*/
|
|
156
|
-
|
|
171
|
+
router: router
|
|
157
172
|
}, eventBus), {
|
|
158
173
|
get: function get(target, property, receiver) {
|
|
159
174
|
if (PRIVATE_KEYS.includes(property)) {
|
|
@@ -169,6 +184,8 @@ export default (function (_ref) {
|
|
|
169
184
|
set: function set(target, property, receiver) {
|
|
170
185
|
if (PRIVATE_KEYS.includes(property)) {
|
|
171
186
|
throw new Error("\u5C5E\u6027 \"".concat(property, "\" \u662F\u53EA\u8BFB\u7684"));
|
|
187
|
+
} else if (property.startsWith('_')) {
|
|
188
|
+
throw new Error("\u5C5E\u6027 \"".concat(property, "\" \u662F\u79C1\u6709\u7684"));
|
|
172
189
|
} else if (property === 'state') {
|
|
173
190
|
setState(receiver);
|
|
174
191
|
return true;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { history } from 'umi';
|
|
2
|
+
import { isNil } from 'lodash';
|
|
3
|
+
export function push(path, params) {
|
|
4
|
+
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'push';
|
|
5
|
+
var blank = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
6
|
+
if (blank) {
|
|
7
|
+
window.openUrl("new:".concat(path));
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
if (type === 'replace') {
|
|
11
|
+
window.openUrl(path, {
|
|
12
|
+
method: 'replace'
|
|
13
|
+
});
|
|
14
|
+
} else if (type === 'layer') {
|
|
15
|
+
window.openUrl("layer:".concat(path), params);
|
|
16
|
+
} else if (type === 'iframe') {
|
|
17
|
+
window.openUrl("iframe:".concat(path));
|
|
18
|
+
} else if (type === 'sso') {
|
|
19
|
+
window.openUrl("sso:".concat(path));
|
|
20
|
+
} else {
|
|
21
|
+
history[type](path, params);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export function replace(path, state) {
|
|
25
|
+
history.replace(path, state);
|
|
26
|
+
}
|
|
27
|
+
export function getQuery(key) {
|
|
28
|
+
var toSearch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
29
|
+
if (toSearch) {
|
|
30
|
+
return history.location.search;
|
|
31
|
+
}
|
|
32
|
+
var query = history.location.query;
|
|
33
|
+
if (isNil(key)) {
|
|
34
|
+
return query;
|
|
35
|
+
}
|
|
36
|
+
return query[key];
|
|
37
|
+
}
|
|
38
|
+
export function stringifyQuery(params) {
|
|
39
|
+
return Object.keys(params).map(function (key) {
|
|
40
|
+
return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(params[key]));
|
|
41
|
+
}).join('&');
|
|
42
|
+
}
|
|
43
|
+
export { history };
|
|
@@ -7,8 +7,8 @@ import { subscribeWithSelector } from 'zustand/middleware';
|
|
|
7
7
|
import { useShallow } from 'zustand/react/shallow';
|
|
8
8
|
import { isObject, isArray, isNil, isFunction, isString, get, set as _set, unset, assign, forOwn, forEach, omit, debounce } from 'lodash';
|
|
9
9
|
import isDeepEqual from 'fast-deep-equal';
|
|
10
|
-
import { getPathNodesById, findNodeAndParent } from "
|
|
11
|
-
import { LC_BUILDIN_UNIT_KEY } from "
|
|
10
|
+
import { getPathNodesById, findNodeAndParent } from "../../tools/dataProcess";
|
|
11
|
+
import { LC_BUILDIN_UNIT_KEY } from "../../../constants";
|
|
12
12
|
var temporalStateCreator = function temporalStateCreator(userSet, userGet, options) {
|
|
13
13
|
var stateCreator = function stateCreator(set, get) {
|
|
14
14
|
return {
|
|
@@ -184,11 +184,13 @@ export default usePageDataStore;
|
|
|
184
184
|
usePageDataStore.subscribe(function (state) {
|
|
185
185
|
return state.pageData;
|
|
186
186
|
}, function (_, prev) {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
})
|
|
191
|
-
|
|
187
|
+
usePageDataStore.setState(function (state) {
|
|
188
|
+
if (prev === null) {
|
|
189
|
+
state.needPrompt = false;
|
|
190
|
+
} else if (state.needPrompt === false) {
|
|
191
|
+
state.needPrompt = true;
|
|
192
|
+
}
|
|
193
|
+
});
|
|
192
194
|
});
|
|
193
195
|
export var resetPageData = function resetPageData(data) {
|
|
194
196
|
usePageDataStore.setState(function (state) {
|
|
@@ -1,18 +1,42 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
1
|
import { useRef } from 'react';
|
|
4
|
-
import {
|
|
2
|
+
import { useMemoizedFn } from 'ahooks';
|
|
3
|
+
import { create } from 'zustand';
|
|
4
|
+
import { immer } from 'zustand/middleware/immer';
|
|
5
|
+
import { subscribeWithSelector } from 'zustand/middleware';
|
|
5
6
|
import { forOwn, isNil, isString, isObject } from 'lodash';
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
export var useStateStore = create()(immer(subscribeWithSelector(function (set) {
|
|
8
|
+
return {
|
|
9
|
+
state: {},
|
|
10
|
+
initialize: function initialize(init) {
|
|
11
|
+
return set(function (store) {
|
|
12
|
+
store.state = init;
|
|
13
|
+
});
|
|
14
|
+
},
|
|
15
|
+
clear: function clear() {
|
|
16
|
+
return set(function (store) {
|
|
17
|
+
store.state = {};
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
})));
|
|
22
|
+
var usePageVar = function usePageVar() {
|
|
23
|
+
var globalRef = useRef(null);
|
|
24
|
+
var state = useStateStore(function (store) {
|
|
25
|
+
return store.state;
|
|
26
|
+
});
|
|
27
|
+
var setState = useMemoizedFn(function (newState) {
|
|
28
|
+
useStateStore.setState(function (store) {
|
|
29
|
+
forOwn(newState, function (_val, _key) {
|
|
30
|
+
if (isNil(_val)) {
|
|
31
|
+
delete store.state[_key];
|
|
32
|
+
} else {
|
|
33
|
+
store.state[_key] = _val;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
var getState = useMemoizedFn(function () {
|
|
39
|
+
return useStateStore.getState().state;
|
|
16
40
|
});
|
|
17
41
|
var setGlobal = useMemoizedFn(function (newGlobal) {
|
|
18
42
|
if (isNil(globalRef.current)) {
|
|
@@ -28,8 +52,7 @@ var usePageVar = function usePageVar(defaultState, defaultGlobal) {
|
|
|
28
52
|
});
|
|
29
53
|
return {
|
|
30
54
|
state: state,
|
|
31
|
-
|
|
32
|
-
setState: setPageState,
|
|
55
|
+
setState: setState,
|
|
33
56
|
getState: getState,
|
|
34
57
|
global: globalRef,
|
|
35
58
|
setGlobal: setGlobal
|
|
@@ -6,9 +6,9 @@ var _excluded = ["datasetCode"];
|
|
|
6
6
|
import { useBoolean, useMemoizedFn } from 'ahooks';
|
|
7
7
|
import { message } from 'luck-design/antd';
|
|
8
8
|
import { keys, isNil, isFunction } from 'lodash';
|
|
9
|
-
import
|
|
10
|
-
import { executeCode } from "
|
|
11
|
-
import { fetchCallBehavior } from "
|
|
9
|
+
import { getModuleData } from "./usePageDataStore";
|
|
10
|
+
import { executeCode } from "../../tools/helper";
|
|
11
|
+
import { fetchCallBehavior } from "../../../constants/api-url";
|
|
12
12
|
var useTodo = function useTodo() {
|
|
13
13
|
var _useBoolean = useBoolean(),
|
|
14
14
|
_useBoolean2 = _slicedToArray(_useBoolean, 2),
|
|
@@ -26,9 +26,6 @@ var useTodo = function useTodo() {
|
|
|
26
26
|
behaviorKey: behaviorKey
|
|
27
27
|
}, params), data);
|
|
28
28
|
});
|
|
29
|
-
var moduleData = usePageDataStore(function (state) {
|
|
30
|
-
return state.moduleData;
|
|
31
|
-
});
|
|
32
29
|
var todo = useMemoizedFn(function (ctx, actionPool) {
|
|
33
30
|
var argsMap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
34
31
|
if (isNil(actionPool)) {
|
|
@@ -57,6 +54,7 @@ var useTodo = function useTodo() {
|
|
|
57
54
|
params = _ref4.params,
|
|
58
55
|
data = _ref4.data,
|
|
59
56
|
after = _ref4.after;
|
|
57
|
+
var moduleData = getModuleData();
|
|
60
58
|
var _moduleCode = moduleCode || moduleData.moduleCode;
|
|
61
59
|
var _dscode = datasetCode || dsCode;
|
|
62
60
|
if (!_moduleCode || !_dscode) {
|
|
@@ -83,6 +81,6 @@ var useTodo = function useTodo() {
|
|
|
83
81
|
}
|
|
84
82
|
return Promise.resolve();
|
|
85
83
|
});
|
|
86
|
-
return [todo,
|
|
84
|
+
return [todo, loading];
|
|
87
85
|
};
|
|
88
86
|
export default useTodo;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
+
import { Modal, message } from 'luck-design/antd';
|
|
5
|
+
import { fetchCallBehavior } from "../../../constants/api-url";
|
|
6
|
+
import { getDvaApp } from 'umi';
|
|
7
|
+
var Formatter = /*#__PURE__*/function () {
|
|
8
|
+
function Formatter() {
|
|
9
|
+
_classCallCheck(this, Formatter);
|
|
10
|
+
}
|
|
11
|
+
_createClass(Formatter, null, [{
|
|
12
|
+
key: "formatDate",
|
|
13
|
+
value:
|
|
14
|
+
// 格式化日期
|
|
15
|
+
function formatDate(date, format) {
|
|
16
|
+
var options = {
|
|
17
|
+
'Y+': date.getFullYear().toString(),
|
|
18
|
+
// 年
|
|
19
|
+
'M+': (date.getMonth() + 1).toString().padStart(2, '0'),
|
|
20
|
+
// 月
|
|
21
|
+
'D+': date.getDate().toString().padStart(2, '0'),
|
|
22
|
+
// 日
|
|
23
|
+
'H+': date.getHours().toString().padStart(2, '0'),
|
|
24
|
+
// 时
|
|
25
|
+
'm+': date.getMinutes().toString().padStart(2, '0'),
|
|
26
|
+
// 分
|
|
27
|
+
's+': date.getSeconds().toString().padStart(2, '0') // 秒
|
|
28
|
+
};
|
|
29
|
+
for (var k in options) {
|
|
30
|
+
format = format.replace(new RegExp(k), options[k]);
|
|
31
|
+
}
|
|
32
|
+
return format;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// 格式化金额
|
|
36
|
+
}, {
|
|
37
|
+
key: "formatCurrency",
|
|
38
|
+
value: function formatCurrency(amount) {
|
|
39
|
+
var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ',';
|
|
40
|
+
amount = parseFloat(amount).toFixed(2);
|
|
41
|
+
var parts = amount.split('.');
|
|
42
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, separator);
|
|
43
|
+
return "".concat(parts.join('.'));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// 格式化手机号
|
|
47
|
+
}, {
|
|
48
|
+
key: "formatPhoneNumber",
|
|
49
|
+
value: function formatPhoneNumber(phone) {
|
|
50
|
+
phone = phone.toString();
|
|
51
|
+
return phone.replace(/(\+?\d{2})(\d{4})(\d{4})(\d{3})/, '$1 $2 $3 $4');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// 格式化银行卡号
|
|
55
|
+
}, {
|
|
56
|
+
key: "formatCardNumber",
|
|
57
|
+
value: function formatCardNumber(cardNumber) {
|
|
58
|
+
cardNumber = cardNumber.toString();
|
|
59
|
+
return cardNumber.replace(/(\d{4})(?=\d)/g, '$1 ');
|
|
60
|
+
}
|
|
61
|
+
}]);
|
|
62
|
+
return Formatter;
|
|
63
|
+
}();
|
|
64
|
+
export function dialog() {
|
|
65
|
+
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'confirm';
|
|
66
|
+
var props = arguments.length > 1 ? arguments[1] : undefined;
|
|
67
|
+
if (!['info', 'success', 'error', 'warning', 'confirm'].includes(type)) return;
|
|
68
|
+
return Modal[type](props);
|
|
69
|
+
}
|
|
70
|
+
export function toast() {
|
|
71
|
+
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'info';
|
|
72
|
+
var props = arguments.length > 1 ? arguments[1] : undefined;
|
|
73
|
+
if (!['info', 'success', 'error', 'warning', 'warn', 'loading'].includes(type)) return;
|
|
74
|
+
return message[type](props);
|
|
75
|
+
}
|
|
76
|
+
export function callBehavior(_ref, params, data) {
|
|
77
|
+
var moduleCode = _ref.moduleCode,
|
|
78
|
+
datasetCode = _ref.datasetCode,
|
|
79
|
+
behaviorKey = _ref.behaviorKey;
|
|
80
|
+
return fetchCallBehavior(_objectSpread({
|
|
81
|
+
moduleCode: moduleCode,
|
|
82
|
+
datasetCode: datasetCode,
|
|
83
|
+
behaviorKey: behaviorKey
|
|
84
|
+
}, params), data);
|
|
85
|
+
}
|
|
86
|
+
export function formatter(type, value, formatOrSeparator) {
|
|
87
|
+
switch (type) {
|
|
88
|
+
case 'date':
|
|
89
|
+
return Formatter.formatDate(value, formatOrSeparator);
|
|
90
|
+
case 'money':
|
|
91
|
+
return Formatter.formatCurrency(value, formatOrSeparator);
|
|
92
|
+
case 'cnmobile':
|
|
93
|
+
return Formatter.formatPhoneNumber(value);
|
|
94
|
+
case 'card':
|
|
95
|
+
return Formatter.formatCardNumber(value);
|
|
96
|
+
default:
|
|
97
|
+
throw new Error("Unsupported format type: ".concat(type));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
export function getDateTimeRange() {
|
|
101
|
+
var when = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();
|
|
102
|
+
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'day';
|
|
103
|
+
var start = new Date(when);
|
|
104
|
+
var end = new Date(when);
|
|
105
|
+
switch (type) {
|
|
106
|
+
case 'year':
|
|
107
|
+
start.setMonth(0, 1); // 设置到当年的1月1日
|
|
108
|
+
start.setHours(0, 0, 0, 0);
|
|
109
|
+
end.setMonth(11, 31); // 设置到当年的12月31日
|
|
110
|
+
end.setHours(23, 59, 59, 999);
|
|
111
|
+
break;
|
|
112
|
+
case 'month':
|
|
113
|
+
start.setDate(1); // 设置到当月的1日
|
|
114
|
+
start.setHours(0, 0, 0, 0);
|
|
115
|
+
end.setMonth(end.getMonth() + 1); // 设置到下月的1日
|
|
116
|
+
end.setDate(0); // 回到当月的最后一天
|
|
117
|
+
end.setHours(23, 59, 59, 999);
|
|
118
|
+
break;
|
|
119
|
+
case 'week':
|
|
120
|
+
var dayOfWeek = start.getDay(); // 当前日期是本周的第几天
|
|
121
|
+
var diffToMonday = (dayOfWeek + 6) % 7; // 计算到上一个星期一的天数
|
|
122
|
+
start.setDate(start.getDate() - diffToMonday); // 设置到本周的星期一
|
|
123
|
+
start.setHours(0, 0, 0, 0);
|
|
124
|
+
end.setDate(start.getDate() + 6); // 设置到本周的星期天
|
|
125
|
+
end.setHours(23, 59, 59, 999);
|
|
126
|
+
break;
|
|
127
|
+
case 'day':
|
|
128
|
+
case 'date':
|
|
129
|
+
// 'day' 和 'date' 是一样的处理方式
|
|
130
|
+
start.setHours(0, 0, 0, 0);
|
|
131
|
+
end.setHours(23, 59, 59, 999);
|
|
132
|
+
break;
|
|
133
|
+
case 'hour':
|
|
134
|
+
start.setMinutes(0, 0, 0);
|
|
135
|
+
end.setMinutes(59, 59, 999);
|
|
136
|
+
break;
|
|
137
|
+
case 'minute':
|
|
138
|
+
start.setSeconds(0, 0);
|
|
139
|
+
end.setSeconds(59, 999);
|
|
140
|
+
break;
|
|
141
|
+
case 'second':
|
|
142
|
+
start.setMilliseconds(0);
|
|
143
|
+
end.setMilliseconds(999);
|
|
144
|
+
break;
|
|
145
|
+
default:
|
|
146
|
+
throw new Error("Unsupported range type: ".concat(type));
|
|
147
|
+
}
|
|
148
|
+
return [start.getTime(), end.getTime()];
|
|
149
|
+
}
|
|
150
|
+
export function getLoginUser() {
|
|
151
|
+
var _getDvaApp;
|
|
152
|
+
return (_getDvaApp = getDvaApp()) === null || _getDvaApp === void 0 ? void 0 : _getDvaApp._store.getState().user.currentUser;
|
|
153
|
+
}
|
|
154
|
+
export function isMobile() {
|
|
155
|
+
// return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
|
156
|
+
return USER_RUNTIME === 'MOBILE';
|
|
157
|
+
}
|
|
@@ -9,8 +9,7 @@ import { history } from 'umi';
|
|
|
9
9
|
import launcher from "../launcher";
|
|
10
10
|
import { LuckDaContext } from "../../../components/Builder";
|
|
11
11
|
import { doAction as doActionUtils } from "../../../helper/action";
|
|
12
|
-
import usePageDataStore from "
|
|
13
|
-
import { useTemporalStore } from "../provider/ContextProvider";
|
|
12
|
+
import usePageDataStore, { useTemporalStore } from "./ContextProvider/usePageDataStore";
|
|
14
13
|
import { decompress } from "../tools/dataProcess";
|
|
15
14
|
import { fetchPageData, fetchDesignModlueData, fetchPreviewModlueData, fetchModlueData, fetchAllDataset, fetchAllSerials, fetchAllBehaviorEx } from "../../constants/api-url";
|
|
16
15
|
import { RUNTIME, LC_RUNTIME_KEY, META_TAG_NAME } from "../../constants";
|