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