@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
|
@@ -20,10 +20,10 @@ var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime
|
|
|
20
20
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
21
21
|
var LZString = _interopRequireWildcard(require("lz-string"));
|
|
22
22
|
var _constants = require("../../constants");
|
|
23
|
-
/**
|
|
24
|
-
* 数据压缩
|
|
25
|
-
* @param {JSON} data
|
|
26
|
-
* @returns 加密后的字符串
|
|
23
|
+
/**
|
|
24
|
+
* 数据压缩
|
|
25
|
+
* @param {JSON} data
|
|
26
|
+
* @returns 加密后的字符串
|
|
27
27
|
*/
|
|
28
28
|
function compress(data) {
|
|
29
29
|
// 将对象转换为JSON字符串
|
|
@@ -32,10 +32,10 @@ function compress(data) {
|
|
|
32
32
|
return LZString.compressToBase64(jsonString);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
/**
|
|
36
|
-
* 数据解压
|
|
37
|
-
* @param {string} compressedData
|
|
38
|
-
* @returns {json}
|
|
35
|
+
/**
|
|
36
|
+
* 数据解压
|
|
37
|
+
* @param {string} compressedData
|
|
38
|
+
* @returns {json}
|
|
39
39
|
*/
|
|
40
40
|
function decompress(compressedData) {
|
|
41
41
|
// 使用LZ-String解压数据
|
|
@@ -44,13 +44,13 @@ function decompress(compressedData) {
|
|
|
44
44
|
return JSON.parse(jsonString);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
/**
|
|
48
|
-
* 查找指定ID的节点及其父节点。
|
|
49
|
-
*
|
|
50
|
-
* @param {string} id - 要查找的节点ID。
|
|
51
|
-
* @param {Object} current - 当前遍历的JSON对象。
|
|
52
|
-
* @param {Object|null} parent - 当前节点的父节点。
|
|
53
|
-
* @returns {{node: Object|null, parent: Object|null}} 查找结果,包含节点和其父节点。
|
|
47
|
+
/**
|
|
48
|
+
* 查找指定ID的节点及其父节点。
|
|
49
|
+
*
|
|
50
|
+
* @param {string} id - 要查找的节点ID。
|
|
51
|
+
* @param {Object} current - 当前遍历的JSON对象。
|
|
52
|
+
* @param {Object|null} parent - 当前节点的父节点。
|
|
53
|
+
* @returns {{node: Object|null, parent: Object|null}} 查找结果,包含节点和其父节点。
|
|
54
54
|
*/
|
|
55
55
|
function findNodeAndParent(id, current) {
|
|
56
56
|
var parent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
@@ -84,13 +84,13 @@ function findNodeAndParent(id, current) {
|
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
/**
|
|
88
|
-
* 对指定的JSON结构进行节点的添加、修改或删除操作。
|
|
89
|
-
*
|
|
90
|
-
* @param {Object} json - 要操作的JSON对象。
|
|
91
|
-
* @param {string|null} path - 要操作的节点路径,使用'/'分隔。
|
|
92
|
-
* @param {string} id - 操作节点的唯一标识符。
|
|
93
|
-
* @param {Object|null} data - 要添加或修改的数据。如果为null,表示删除操作。
|
|
87
|
+
/**
|
|
88
|
+
* 对指定的JSON结构进行节点的添加、修改或删除操作。
|
|
89
|
+
*
|
|
90
|
+
* @param {Object} json - 要操作的JSON对象。
|
|
91
|
+
* @param {string|null} path - 要操作的节点路径,使用'/'分隔。
|
|
92
|
+
* @param {string} id - 操作节点的唯一标识符。
|
|
93
|
+
* @param {Object|null} data - 要添加或修改的数据。如果为null,表示删除操作。
|
|
94
94
|
*/
|
|
95
95
|
function process(json, path, id, data) {
|
|
96
96
|
if (!json) {
|
|
@@ -156,25 +156,25 @@ function process(json, path, id, data) {
|
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
/**
|
|
160
|
-
* 对指定的JSON结构进行节点的添加操作。
|
|
161
|
-
*
|
|
162
|
-
* @param {Object} json - 要操作的JSON对象。
|
|
163
|
-
* @param {string} parentId - 父节点的唯一标识符。
|
|
164
|
-
* @param {string} id - 操作节点的唯一标识符。
|
|
165
|
-
* @param {Object|null} data - 要添加或修改的数据。如果为null,表示删除操作。
|
|
159
|
+
/**
|
|
160
|
+
* 对指定的JSON结构进行节点的添加操作。
|
|
161
|
+
*
|
|
162
|
+
* @param {Object} json - 要操作的JSON对象。
|
|
163
|
+
* @param {string} parentId - 父节点的唯一标识符。
|
|
164
|
+
* @param {string} id - 操作节点的唯一标识符。
|
|
165
|
+
* @param {Object|null} data - 要添加或修改的数据。如果为null,表示删除操作。
|
|
166
166
|
*/
|
|
167
167
|
function add(json, parentId, id, data) {
|
|
168
168
|
process(json, getPathById(json, parentId), id, data);
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
/**
|
|
172
|
-
* 移动指定的节点到另一个节点的指定位置。
|
|
173
|
-
*
|
|
174
|
-
* @param {Object} json - 要操作的JSON对象。
|
|
175
|
-
* @param {string} sid - 被移动的节点id
|
|
176
|
-
* @param {string} tid - 目标节点id
|
|
177
|
-
* @param {string} action - 'left': 往节点前面插入,'right':往节点后面插,'inside':往节点子节点插
|
|
171
|
+
/**
|
|
172
|
+
* 移动指定的节点到另一个节点的指定位置。
|
|
173
|
+
*
|
|
174
|
+
* @param {Object} json - 要操作的JSON对象。
|
|
175
|
+
* @param {string} sid - 被移动的节点id
|
|
176
|
+
* @param {string} tid - 目标节点id
|
|
177
|
+
* @param {string} action - 'left': 往节点前面插入,'right':往节点后面插,'inside':往节点子节点插
|
|
178
178
|
*/
|
|
179
179
|
function move(json, sid, tid, action) {
|
|
180
180
|
// 验证节点存在性
|
|
@@ -230,34 +230,34 @@ function move(json, sid, tid, action) {
|
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
/**
|
|
234
|
-
* 对指定的JSON结构进行节点的修改操作。
|
|
235
|
-
*
|
|
236
|
-
* @param {Object} json - 要操作的JSON对象。
|
|
237
|
-
* @param {string} id - 操作节点的唯一标识符。
|
|
238
|
-
* @param {Object|null} data - 要添加或修改的数据。如果为null,表示删除操作。
|
|
233
|
+
/**
|
|
234
|
+
* 对指定的JSON结构进行节点的修改操作。
|
|
235
|
+
*
|
|
236
|
+
* @param {Object} json - 要操作的JSON对象。
|
|
237
|
+
* @param {string} id - 操作节点的唯一标识符。
|
|
238
|
+
* @param {Object|null} data - 要添加或修改的数据。如果为null,表示删除操作。
|
|
239
239
|
*/
|
|
240
240
|
function modifyById(json, id, data) {
|
|
241
241
|
process(json, null, id, data);
|
|
242
242
|
}
|
|
243
243
|
|
|
244
|
-
/**
|
|
245
|
-
* 删除指定id的节点。
|
|
246
|
-
*
|
|
247
|
-
* @param {Object} json - JSON对象。
|
|
248
|
-
* @param {string} id - 要删除的节点ID。
|
|
244
|
+
/**
|
|
245
|
+
* 删除指定id的节点。
|
|
246
|
+
*
|
|
247
|
+
* @param {Object} json - JSON对象。
|
|
248
|
+
* @param {string} id - 要删除的节点ID。
|
|
249
249
|
*/
|
|
250
250
|
function deleteById(json, id) {
|
|
251
251
|
process(json, null, id);
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
/**
|
|
255
|
-
* 根据ID在给定的JSON结构中查找节点的路径。
|
|
256
|
-
*
|
|
257
|
-
* @param {Object} json - 要搜索的JSON对象。
|
|
258
|
-
* @param {string} id - 要查找的节点ID。
|
|
259
|
-
* @param {string} currentPath - 当前递归到的路径,用于构建返回的路径字符串。
|
|
260
|
-
* @returns {string|null} 如果找到节点,返回节点的路径;否则返回null。
|
|
254
|
+
/**
|
|
255
|
+
* 根据ID在给定的JSON结构中查找节点的路径。
|
|
256
|
+
*
|
|
257
|
+
* @param {Object} json - 要搜索的JSON对象。
|
|
258
|
+
* @param {string} id - 要查找的节点ID。
|
|
259
|
+
* @param {string} currentPath - 当前递归到的路径,用于构建返回的路径字符串。
|
|
260
|
+
* @returns {string|null} 如果找到节点,返回节点的路径;否则返回null。
|
|
261
261
|
*/
|
|
262
262
|
function getPathById(json, id) {
|
|
263
263
|
var currentPath = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
@@ -277,28 +277,28 @@ function getPathById(json, id) {
|
|
|
277
277
|
return null;
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
-
/**
|
|
281
|
-
* 在给定的JSON结构中搜索具有特定id的节点,并返回包含该节点及其所有父节点的props属性的路径数组。
|
|
282
|
-
*
|
|
283
|
-
* @param {Object} data - 待搜索的JSON对象,它代表了一个复杂的树状结构,每个节点都可能有props和children属性。
|
|
284
|
-
* @param {string} targetId - 需要找到的目标节点的id。
|
|
285
|
-
* @returns {Array<Object>} 一个包含目标节点及其所有父节点的props属性的数组。如果未找到目标节点,则返回空数组。
|
|
286
|
-
*
|
|
287
|
-
* @example
|
|
288
|
-
* const data = {
|
|
289
|
-
* props: {
|
|
290
|
-
* id: 'page_root',
|
|
291
|
-
* type: 'Page',
|
|
292
|
-
* name: '页面',
|
|
293
|
-
* hasHeder: true,
|
|
294
|
-
* hasFooter: true,
|
|
295
|
-
* },
|
|
296
|
-
* // ...其他节点
|
|
297
|
-
* };
|
|
298
|
-
*
|
|
299
|
-
* const path = getPathNodesById(data, 'form_jknbjkun');
|
|
300
|
-
* console.log(path);
|
|
301
|
-
* // 输出目标节点及其所有父节点的props属性的数组
|
|
280
|
+
/**
|
|
281
|
+
* 在给定的JSON结构中搜索具有特定id的节点,并返回包含该节点及其所有父节点的props属性的路径数组。
|
|
282
|
+
*
|
|
283
|
+
* @param {Object} data - 待搜索的JSON对象,它代表了一个复杂的树状结构,每个节点都可能有props和children属性。
|
|
284
|
+
* @param {string} targetId - 需要找到的目标节点的id。
|
|
285
|
+
* @returns {Array<Object>} 一个包含目标节点及其所有父节点的props属性的数组。如果未找到目标节点,则返回空数组。
|
|
286
|
+
*
|
|
287
|
+
* @example
|
|
288
|
+
* const data = {
|
|
289
|
+
* props: {
|
|
290
|
+
* id: 'page_root',
|
|
291
|
+
* type: 'Page',
|
|
292
|
+
* name: '页面',
|
|
293
|
+
* hasHeder: true,
|
|
294
|
+
* hasFooter: true,
|
|
295
|
+
* },
|
|
296
|
+
* // ...其他节点
|
|
297
|
+
* };
|
|
298
|
+
*
|
|
299
|
+
* const path = getPathNodesById(data, 'form_jknbjkun');
|
|
300
|
+
* console.log(path);
|
|
301
|
+
* // 输出目标节点及其所有父节点的props属性的数组
|
|
302
302
|
*/
|
|
303
303
|
function getPathNodesById(data, targetId) {
|
|
304
304
|
// 初始化结果数组
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.executeCode = executeCode;
|
|
8
8
|
exports.extractKeywords = extractKeywords;
|
|
9
|
+
exports.findFirstLeafNode = findFirstLeafNode;
|
|
9
10
|
exports.getCtx = getCtx;
|
|
10
11
|
exports.getFuncBody = getFuncBody;
|
|
11
12
|
exports.getLDMetaAttr = getLDMetaAttr;
|
|
@@ -139,8 +140,13 @@ function executeCode(context, code, argsName) {
|
|
|
139
140
|
throw new Error('executeCode参数不匹配');
|
|
140
141
|
}
|
|
141
142
|
var ctx = getCtx(context);
|
|
142
|
-
|
|
143
|
-
|
|
143
|
+
try {
|
|
144
|
+
var func = (0, _construct2.default)(Function, (0, _toConsumableArray2.default)(argsName || []).concat(['ctx', 'window', "\"use strict\"; ".concat(getFuncBody(code))]));
|
|
145
|
+
return func.apply(void 0, args.concat([ctx, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, window.proxy), window)]));
|
|
146
|
+
} catch (e) {
|
|
147
|
+
console.error("".concat(code, "\u65E0\u6CD5\u88AB\u6267\u884C"), e);
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
144
150
|
}
|
|
145
151
|
function parseCSS(cssString) {
|
|
146
152
|
// 创建一个空对象来存储解析后的样式
|
|
@@ -255,4 +261,25 @@ function loadScript(path) {
|
|
|
255
261
|
ref: script,
|
|
256
262
|
status: script.getAttribute('data-status') || 'ready'
|
|
257
263
|
};
|
|
264
|
+
}
|
|
265
|
+
function findFirstLeafNode(node) {
|
|
266
|
+
if (!node.children || node.children.length === 0) {
|
|
267
|
+
return node;
|
|
268
|
+
}
|
|
269
|
+
var _iterator2 = (0, _createForOfIteratorHelper2.default)(node.children),
|
|
270
|
+
_step2;
|
|
271
|
+
try {
|
|
272
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
273
|
+
var child = _step2.value;
|
|
274
|
+
var leaf = findFirstLeafNode(child);
|
|
275
|
+
if (leaf) {
|
|
276
|
+
return leaf;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
} catch (err) {
|
|
280
|
+
_iterator2.e(err);
|
|
281
|
+
} finally {
|
|
282
|
+
_iterator2.f();
|
|
283
|
+
}
|
|
284
|
+
return null;
|
|
258
285
|
}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = initialize;
|
|
8
|
+
var _toArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toArray"));
|
|
9
|
+
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
14
|
+
var _lodash = require("lodash");
|
|
15
|
+
var _utils = require("@luck-design-biz/base/utils");
|
|
16
|
+
var _usePageDataStore = _interopRequireDefault(require("../provider/ContextProvider/usePageDataStore"));
|
|
17
|
+
var _usePageVar = require("../provider/ContextProvider/usePageVar");
|
|
18
|
+
var _helper = require("./helper");
|
|
19
|
+
var parseVar = function parseVar(ctx, input) {
|
|
20
|
+
if ((0, _lodash.isNil)(input)) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
return (0, _helper.executeCode)(ctx, "function() {return ".concat(input, "}"));
|
|
25
|
+
} catch (err) {
|
|
26
|
+
return input;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var Task = /*#__PURE__*/function () {
|
|
30
|
+
function Task(ctx, props) {
|
|
31
|
+
(0, _classCallCheck2.default)(this, Task);
|
|
32
|
+
this.ctx = ctx;
|
|
33
|
+
this.name = props.name;
|
|
34
|
+
this.props = props;
|
|
35
|
+
}
|
|
36
|
+
(0, _createClass2.default)(Task, [{
|
|
37
|
+
key: "run",
|
|
38
|
+
value: function () {
|
|
39
|
+
var _run = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(_params, _data) {
|
|
40
|
+
var _this = this;
|
|
41
|
+
var _this$props, willFetch, didFetch, onError, _this$props$data, url, params, body, method, defaultValue, vars, config;
|
|
42
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
43
|
+
while (1) switch (_context.prev = _context.next) {
|
|
44
|
+
case 0:
|
|
45
|
+
_this$props = this.props, willFetch = _this$props.willFetch, didFetch = _this$props.didFetch, onError = _this$props.onError;
|
|
46
|
+
_this$props$data = this.props.data, url = _this$props$data.url, params = _this$props$data.params, body = _this$props$data.body, method = _this$props$data.method, defaultValue = _this$props$data.defaultValue;
|
|
47
|
+
vars = {
|
|
48
|
+
params: (0, _lodash.isNil)(params) || params === '' ? {} : parseVar(this.ctx, params),
|
|
49
|
+
data: (0, _lodash.isNil)(body) || body === '' ? {} : parseVar(this.ctx, body)
|
|
50
|
+
};
|
|
51
|
+
config = {
|
|
52
|
+
headers: {}
|
|
53
|
+
};
|
|
54
|
+
if (willFetch) {
|
|
55
|
+
(0, _helper.executeCode)(this.ctx, willFetch, ['vars', 'config'], vars, config);
|
|
56
|
+
}
|
|
57
|
+
return _context.abrupt("return", (0, _utils.request)(parseVar(this.ctx, url), (0, _objectSpread2.default)({
|
|
58
|
+
params: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, vars.params), _params),
|
|
59
|
+
data: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, vars.data), _data),
|
|
60
|
+
method: parseVar(this.ctx, method)
|
|
61
|
+
}, config)).then(function (res) {
|
|
62
|
+
if (res.code === 1) {
|
|
63
|
+
var list = res.list,
|
|
64
|
+
detail = res.detail;
|
|
65
|
+
var content;
|
|
66
|
+
if (list.length === 1) {
|
|
67
|
+
content = detail[list[0]];
|
|
68
|
+
} else {
|
|
69
|
+
content = list.map(function (_id) {
|
|
70
|
+
return detail[_id];
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
if (didFetch) {
|
|
74
|
+
return (0, _helper.executeCode)(_this.ctx, didFetch, ['content', 'origin'], content, res);
|
|
75
|
+
}
|
|
76
|
+
return content;
|
|
77
|
+
} else if (onError) {
|
|
78
|
+
(0, _helper.executeCode)(_this.ctx, onError, ['error'], res);
|
|
79
|
+
}
|
|
80
|
+
if (defaultValue) {
|
|
81
|
+
return parseVar(_this.ctx, defaultValue);
|
|
82
|
+
}
|
|
83
|
+
}));
|
|
84
|
+
case 6:
|
|
85
|
+
case "end":
|
|
86
|
+
return _context.stop();
|
|
87
|
+
}
|
|
88
|
+
}, _callee, this);
|
|
89
|
+
}));
|
|
90
|
+
function run(_x, _x2) {
|
|
91
|
+
return _run.apply(this, arguments);
|
|
92
|
+
}
|
|
93
|
+
return run;
|
|
94
|
+
}()
|
|
95
|
+
}, {
|
|
96
|
+
key: "load",
|
|
97
|
+
value: function () {
|
|
98
|
+
var _load = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(params, data) {
|
|
99
|
+
var _this2 = this;
|
|
100
|
+
var content;
|
|
101
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
|
102
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
103
|
+
case 0:
|
|
104
|
+
_context2.next = 2;
|
|
105
|
+
return this.run(params, data);
|
|
106
|
+
case 2:
|
|
107
|
+
content = _context2.sent;
|
|
108
|
+
_usePageVar.useStateStore.setState(function (store) {
|
|
109
|
+
store.state[_this2.name] = content;
|
|
110
|
+
});
|
|
111
|
+
return _context2.abrupt("return", content);
|
|
112
|
+
case 5:
|
|
113
|
+
case "end":
|
|
114
|
+
return _context2.stop();
|
|
115
|
+
}
|
|
116
|
+
}, _callee2, this);
|
|
117
|
+
}));
|
|
118
|
+
function load(_x3, _x4) {
|
|
119
|
+
return _load.apply(this, arguments);
|
|
120
|
+
}
|
|
121
|
+
return load;
|
|
122
|
+
}()
|
|
123
|
+
}]);
|
|
124
|
+
return Task;
|
|
125
|
+
}();
|
|
126
|
+
var wrapPromise = function wrapPromise(promise) {
|
|
127
|
+
var cache = {
|
|
128
|
+
status: 'pending',
|
|
129
|
+
data: null
|
|
130
|
+
};
|
|
131
|
+
var suspender = promise.then(function (r) {
|
|
132
|
+
cache.status = 'fulfilled';
|
|
133
|
+
cache.data = r;
|
|
134
|
+
}, function (e) {
|
|
135
|
+
cache.status = 'rejected';
|
|
136
|
+
cache.data = e;
|
|
137
|
+
});
|
|
138
|
+
return {
|
|
139
|
+
read: function read() {
|
|
140
|
+
if (cache.status === 'pending') {
|
|
141
|
+
throw suspender;
|
|
142
|
+
} else if (cache.status === 'rejected') {
|
|
143
|
+
throw cache.data;
|
|
144
|
+
} else if (cache.status === 'fulfilled') {
|
|
145
|
+
return cache.data;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
function initialize(ctx) {
|
|
151
|
+
var pageVars = _usePageDataStore.default.getState().pageData.props.vars;
|
|
152
|
+
if ((0, _lodash.isNil)(pageVars)) return null;
|
|
153
|
+
var remoteApis = new Map();
|
|
154
|
+
var _reduce = (0, _lodash.reduce)(pageVars, function (ret, val) {
|
|
155
|
+
if (val.type === 'var') {
|
|
156
|
+
ret[0][val.name] = parseVar(ctx, val.data);
|
|
157
|
+
} else if (val.type === 'api') {
|
|
158
|
+
var _val$data = val.data,
|
|
159
|
+
auto = _val$data.auto,
|
|
160
|
+
taskType = _val$data.taskType;
|
|
161
|
+
var task = new Task(ctx, val);
|
|
162
|
+
remoteApis.set(val.name, task);
|
|
163
|
+
if (!auto) return ret;
|
|
164
|
+
if (taskType === 'serial') {
|
|
165
|
+
ret.push(task);
|
|
166
|
+
} else if (taskType === 'parallel') {
|
|
167
|
+
var lastIndex = ret.length - 1;
|
|
168
|
+
if (lastIndex > 0 && (0, _lodash.isArray)(ret[lastIndex])) {
|
|
169
|
+
ret[lastIndex].push(task);
|
|
170
|
+
} else {
|
|
171
|
+
ret.push([task]);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return ret;
|
|
176
|
+
}, [{}]),
|
|
177
|
+
_reduce2 = (0, _toArray2.default)(_reduce),
|
|
178
|
+
variables = _reduce2[0],
|
|
179
|
+
autoTasks = _reduce2.slice(1);
|
|
180
|
+
_usePageVar.useStateStore.getState().initialize(variables);
|
|
181
|
+
ctx._initRemoteApiMap(remoteApis);
|
|
182
|
+
function run() {
|
|
183
|
+
return _run2.apply(this, arguments);
|
|
184
|
+
}
|
|
185
|
+
function _run2() {
|
|
186
|
+
_run2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3() {
|
|
187
|
+
var result, _loop, i;
|
|
188
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee3$(_context5) {
|
|
189
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
190
|
+
case 0:
|
|
191
|
+
result = {};
|
|
192
|
+
_loop = /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _loop(i) {
|
|
193
|
+
var contents, _loop2, j, content;
|
|
194
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _loop$(_context4) {
|
|
195
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
196
|
+
case 0:
|
|
197
|
+
if (!(0, _lodash.isArray)(autoTasks[i])) {
|
|
198
|
+
_context4.next = 13;
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
_context4.next = 3;
|
|
202
|
+
return Promise.all(autoTasks[i].map(function (t) {
|
|
203
|
+
return t.run();
|
|
204
|
+
}));
|
|
205
|
+
case 3:
|
|
206
|
+
contents = _context4.sent;
|
|
207
|
+
_loop2 = /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _loop2(j) {
|
|
208
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _loop2$(_context3) {
|
|
209
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
210
|
+
case 0:
|
|
211
|
+
_usePageVar.useStateStore.setState(function (store) {
|
|
212
|
+
store.state[autoTasks[i][j].name] = contents[j];
|
|
213
|
+
});
|
|
214
|
+
case 1:
|
|
215
|
+
case "end":
|
|
216
|
+
return _context3.stop();
|
|
217
|
+
}
|
|
218
|
+
}, _loop2);
|
|
219
|
+
});
|
|
220
|
+
_context4.t0 = (0, _regeneratorRuntime2.default)().keys(autoTasks[i]);
|
|
221
|
+
case 6:
|
|
222
|
+
if ((_context4.t1 = _context4.t0()).done) {
|
|
223
|
+
_context4.next = 11;
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
j = _context4.t1.value;
|
|
227
|
+
return _context4.delegateYield(_loop2(j), "t2", 9);
|
|
228
|
+
case 9:
|
|
229
|
+
_context4.next = 6;
|
|
230
|
+
break;
|
|
231
|
+
case 11:
|
|
232
|
+
_context4.next = 17;
|
|
233
|
+
break;
|
|
234
|
+
case 13:
|
|
235
|
+
_context4.next = 15;
|
|
236
|
+
return autoTasks[i].run();
|
|
237
|
+
case 15:
|
|
238
|
+
content = _context4.sent;
|
|
239
|
+
_usePageVar.useStateStore.setState(function (store) {
|
|
240
|
+
store.state[autoTasks[i].name] = content;
|
|
241
|
+
});
|
|
242
|
+
case 17:
|
|
243
|
+
case "end":
|
|
244
|
+
return _context4.stop();
|
|
245
|
+
}
|
|
246
|
+
}, _loop);
|
|
247
|
+
});
|
|
248
|
+
_context5.t0 = (0, _regeneratorRuntime2.default)().keys(autoTasks);
|
|
249
|
+
case 3:
|
|
250
|
+
if ((_context5.t1 = _context5.t0()).done) {
|
|
251
|
+
_context5.next = 8;
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
i = _context5.t1.value;
|
|
255
|
+
return _context5.delegateYield(_loop(i), "t2", 6);
|
|
256
|
+
case 6:
|
|
257
|
+
_context5.next = 3;
|
|
258
|
+
break;
|
|
259
|
+
case 8:
|
|
260
|
+
return _context5.abrupt("return", result);
|
|
261
|
+
case 9:
|
|
262
|
+
case "end":
|
|
263
|
+
return _context5.stop();
|
|
264
|
+
}
|
|
265
|
+
}, _callee3);
|
|
266
|
+
}));
|
|
267
|
+
return _run2.apply(this, arguments);
|
|
268
|
+
}
|
|
269
|
+
return wrapPromise(run());
|
|
270
|
+
}
|
|
@@ -14,6 +14,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
14
14
|
var _react = _interopRequireWildcard3(require("react"));
|
|
15
15
|
var _umi = require("umi");
|
|
16
16
|
var _ahooks = require("ahooks");
|
|
17
|
+
var _antd = require("luck-design/antd");
|
|
17
18
|
var _lodash = require("lodash");
|
|
18
19
|
var _ContextProvider = require("../provider/ContextProvider");
|
|
19
20
|
var _constants = require("../../constants");
|
|
@@ -70,7 +71,18 @@ function useCanvasRender(data, deps) {
|
|
|
70
71
|
return _loader.apply(this, arguments);
|
|
71
72
|
}
|
|
72
73
|
return loader;
|
|
73
|
-
}()
|
|
74
|
+
}(),
|
|
75
|
+
loading: function loading() {
|
|
76
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Skeleton, {
|
|
77
|
+
active: true,
|
|
78
|
+
title: {
|
|
79
|
+
width: '70%'
|
|
80
|
+
},
|
|
81
|
+
paragraph: {
|
|
82
|
+
rows: 7
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
74
86
|
});
|
|
75
87
|
}
|
|
76
88
|
var renderable = true;
|
|
@@ -5,9 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
+
var _ahooks = require("ahooks");
|
|
8
9
|
var useCombinedRefs = function useCombinedRefs(forwardedRef) {
|
|
9
10
|
var innerRef = (0, _react.useRef)(null);
|
|
10
|
-
(0,
|
|
11
|
+
(0, _ahooks.useCreation)(function () {
|
|
11
12
|
if (!forwardedRef) return;
|
|
12
13
|
if (typeof forwardedRef === 'function') {
|
|
13
14
|
forwardedRef(innerRef.current);
|
|
@@ -95,8 +95,8 @@ var CompItem = function CompItem(_ref2) {
|
|
|
95
95
|
}, /*#__PURE__*/_react.default.createElement("span", null, item.name)));
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
-
/**
|
|
99
|
-
* 组件清单
|
|
98
|
+
/**
|
|
99
|
+
* 组件清单
|
|
100
100
|
*/
|
|
101
101
|
var Components = function Components(_ref3) {
|
|
102
102
|
var _ref3$dataset = _ref3.dataset,
|
|
@@ -76,6 +76,7 @@ var Design = function Design() {
|
|
|
76
76
|
locale: locale,
|
|
77
77
|
onLangChange: handleLangChange
|
|
78
78
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
79
|
+
id: "design-workspace",
|
|
79
80
|
className: _design.default['lc-painter-design-workspace']
|
|
80
81
|
}, /*#__PURE__*/_react.default.createElement(_DesignOperator.default, {
|
|
81
82
|
canvas: simulatorRef
|
|
@@ -32,7 +32,7 @@ var getOperatorStyle = function getOperatorStyle(canvas, cellNode) {
|
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
34
|
var DesignOperator = function DesignOperator(_ref) {
|
|
35
|
-
var
|
|
35
|
+
var _getElement2;
|
|
36
36
|
var canvas = _ref.canvas;
|
|
37
37
|
var context = (0, _ContextProvider.useContext)();
|
|
38
38
|
var size = (0, _ahooks.useSize)(canvas);
|
|
@@ -76,7 +76,9 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
76
76
|
context.$publisher(context.topics.COMPONENT_APPEND, {
|
|
77
77
|
id: _id
|
|
78
78
|
});
|
|
79
|
-
|
|
79
|
+
setTimeout(function () {
|
|
80
|
+
handleSelect(_id);
|
|
81
|
+
});
|
|
80
82
|
}
|
|
81
83
|
}).watch();
|
|
82
84
|
var json = require("../engine/meta/".concat(data.component.toLowerCase(), ".props.default.json"));
|
|
@@ -117,10 +119,28 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
117
119
|
}))
|
|
118
120
|
};
|
|
119
121
|
}, [operatorId.selector]);
|
|
122
|
+
var activeDomPosition = (0, _ahooks.useCreation)(function () {
|
|
123
|
+
var _getElement;
|
|
124
|
+
if (!operatorId.selector && !operatorId.selectorTarget) return null;
|
|
125
|
+
var targetTop = (_getElement = getElement((0, _lodash.isNil)(operatorId.selectorTarget) ? operatorId.selector : operatorId.selectorTarget.element)) === null || _getElement === void 0 ? void 0 : _getElement.getBoundingClientRect().top;
|
|
126
|
+
var delat = targetTop - canvas.current.getBoundingClientRect().top;
|
|
127
|
+
return {
|
|
128
|
+
top: delat > 24 ? -24 : 0
|
|
129
|
+
};
|
|
130
|
+
}, [operatorId.selector, operatorId.selectorTarget]);
|
|
120
131
|
var lastDetectorName = (0, _ahooks.useCreation)(function () {
|
|
121
132
|
var _last;
|
|
122
133
|
return operatorId.detector && (0, _lodash.isString)(operatorId.detector) ? (_last = (0, _lodash.last)(context.componentMap.get(operatorId.detector).api.getLevelNodes())) === null || _last === void 0 ? void 0 : _last.name : void 0;
|
|
123
134
|
}, [operatorId.detector]);
|
|
135
|
+
(0, _ahooks.useKeyPress)('backspace', function () {
|
|
136
|
+
if (operatorId.selector && operatorId.deletable) {
|
|
137
|
+
handleDelete({
|
|
138
|
+
id: operatorId.selector
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}, {
|
|
142
|
+
target: canvas
|
|
143
|
+
});
|
|
124
144
|
(0, _ahooks.useEventListener)('mousemove', function (event) {
|
|
125
145
|
var elem = event.target;
|
|
126
146
|
var targetFormItem = elem.closest("[".concat(_constants.LC_COMPONENT_UNIT_KEY, "=\"").concat(_constants.LC_FORMITEM_UNIT, "\"]"));
|
|
@@ -289,7 +309,7 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
289
309
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
290
310
|
className: _design.default['lc-painter-design-detector-name'],
|
|
291
311
|
style: {
|
|
292
|
-
top: ((
|
|
312
|
+
top: ((_getElement2 = getElement(operatorId.detector)) === null || _getElement2 === void 0 ? void 0 : _getElement2.offsetTop) < 23 ? 0 : '-23px'
|
|
293
313
|
}
|
|
294
314
|
}, lastDetectorName ? "".concat(lastDetectorName, "(").concat(operatorId.detector, ")") : null)), operatorId.selector && /*#__PURE__*/_react.default.createElement("div", {
|
|
295
315
|
id: "lc-selector",
|
|
@@ -298,13 +318,7 @@ var DesignOperator = function DesignOperator(_ref) {
|
|
|
298
318
|
style: getOperatorStyle(canvas.current, getElement((0, _lodash.isNil)(operatorId.selectorTarget) ? operatorId.selector : operatorId.selectorTarget.element))
|
|
299
319
|
}, acticeProps && /*#__PURE__*/_react.default.createElement("div", {
|
|
300
320
|
className: _design.default['lc-borders-actions'],
|
|
301
|
-
style:
|
|
302
|
-
top: 0
|
|
303
|
-
} : ((_getElement2 = getElement((0, _lodash.isNil)(operatorId.selectorTarget) ? operatorId.selector : operatorId.selectorTarget.element)) === null || _getElement2 === void 0 ? void 0 : _getElement2.offsetTop) < 23 ? {
|
|
304
|
-
bottom: '-23px'
|
|
305
|
-
} : {
|
|
306
|
-
top: '-23px'
|
|
307
|
-
}
|
|
321
|
+
style: activeDomPosition
|
|
308
322
|
}, /*#__PURE__*/_react.default.createElement(_antd.Dropdown, {
|
|
309
323
|
overlay: acticeProps.menu,
|
|
310
324
|
placement: "bottomLeft"
|