@luck-design-biz/luckda 0.0.24-1 → 0.0.25
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 +0 -0
- package/README.md +0 -0
- package/es/components/Builder/index.js +6 -4
- package/es/components/LDActions/index.js +130 -0
- package/es/components/LDActions/index.less +48 -0
- package/es/components/LdAutoForm/index.js +0 -0
- package/es/components/LdCard/index.js +0 -0
- package/es/components/LdCard/model.js +0 -0
- package/es/components/LdCom/index.js +0 -0
- package/es/components/LdFormList/index.js +1 -1
- package/es/components/LdFormList/model.js +0 -0
- package/es/components/LdGrid/index.js +21 -6
- package/es/components/LdGrid/model.js +0 -0
- package/es/components/LdGridForm/index.js +0 -0
- package/es/components/LdGridForm/index.less +0 -0
- package/es/components/LdInfoPanel/index.js +0 -0
- package/es/components/LdPop/index.js +0 -0
- package/es/components/LdRuntimeCom/index.js +0 -0
- package/es/components/LdTree/index.js +32 -5
- package/es/components/LdTree/index.less +6 -1
- package/es/helper/FromItems.js +0 -0
- package/es/helper/action.js +0 -0
- package/es/helper/form.js +0 -0
- package/es/helper/index.less +0 -0
- package/es/helper/ldBuilder.js +0 -0
- package/es/helper/ldComBuild.js +0 -0
- package/es/index.js +1 -0
- package/es/locales/zh-CN.js +151 -0
- package/es/lowcode/constants/api-url.js +350 -1
- package/es/lowcode/constants/event-topics.js +4 -4
- package/es/lowcode/constants/index.js +3 -1
- package/es/lowcode/engine/factory/DataFactory.js +0 -0
- package/es/lowcode/engine/factory/panel-item-factory/CheckboxStrategy.js +32 -0
- package/es/lowcode/engine/factory/panel-item-factory/DynamicStrategy.js +0 -0
- package/es/lowcode/engine/factory/panel-item-factory/GroupStrategy.js +0 -0
- package/es/lowcode/engine/factory/panel-item-factory/NumberStrategy.js +32 -0
- package/es/lowcode/engine/factory/panel-item-factory/SegmentedStrategy.js +0 -0
- package/es/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +4 -1
- package/es/lowcode/engine/factory/panel-item-factory/Strategy.js +0 -0
- package/es/lowcode/engine/factory/panel-item-factory/StringStrategy.js +12 -11
- package/es/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +11 -1
- package/es/lowcode/engine/factory/panel-item-factory/index.js +4 -0
- package/es/lowcode/engine/meta/box.props.default.json +1 -3
- package/es/lowcode/engine/meta/box.props.json +1 -3
- package/es/lowcode/engine/meta/button.props.default.json +1 -1
- package/es/lowcode/engine/meta/button.props.json +8 -3
- package/es/lowcode/engine/meta/cardlist.props.default.json +0 -1
- package/es/lowcode/engine/meta/cardlist.props.json +1 -2
- package/es/lowcode/engine/meta/components-list.json +6 -6
- package/es/lowcode/engine/meta/dialog.props.default.json +0 -1
- package/es/lowcode/engine/meta/dialog.props.json +0 -1
- package/es/lowcode/engine/meta/drawer.props.default.json +0 -1
- package/es/lowcode/engine/meta/drawer.props.json +0 -1
- package/es/lowcode/engine/meta/form.props.default.json +0 -1
- package/es/lowcode/engine/meta/form.props.json +1 -2
- package/es/lowcode/engine/meta/iframe.props.default.json +1 -1
- package/es/lowcode/engine/meta/iframe.props.json +1 -1
- package/es/lowcode/engine/meta/image.props.default.json +1 -1
- package/es/lowcode/engine/meta/image.props.json +1 -1
- package/es/lowcode/engine/meta/imex.props.default.json +1 -1
- package/es/lowcode/engine/meta/imex.props.json +1 -1
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +135 -29
- 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 +1 -1
- package/es/lowcode/engine/meta/link.props.default.json +1 -1
- package/es/lowcode/engine/meta/link.props.json +1 -1
- package/es/lowcode/engine/meta/local/local.zh-cn.js +97 -0
- package/es/lowcode/engine/meta/section.props.default.json +1 -1
- package/es/lowcode/engine/meta/section.props.json +1 -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.default.json +36 -2
- package/es/lowcode/engine/meta/table.props.json +295 -58
- package/es/lowcode/engine/meta/tabs.props.default.json +0 -1
- package/es/lowcode/engine/meta/tabs.props.json +0 -1
- package/es/lowcode/engine/meta/text.props.default.json +1 -1
- package/es/lowcode/engine/meta/text.props.json +1 -1
- package/es/lowcode/engine/meta/tree.props.default.json +9 -4
- package/es/lowcode/engine/meta/tree.props.json +101 -55
- package/es/lowcode/engine/provider/ContextProvider/index.js +199 -0
- package/es/lowcode/engine/provider/EventBusProvider.js +0 -0
- package/es/lowcode/engine/tools/dataProcess.js +5 -3
- package/es/lowcode/engine/tools/helper.js +96 -0
- package/es/lowcode/engine/tools/usePromiseState.js +7 -6
- package/es/lowcode/index.js +3 -1
- package/es/lowcode/painter/Components.js +0 -0
- package/es/lowcode/painter/Design.js +27 -304
- package/es/lowcode/painter/DesignOperator.js +271 -0
- package/es/lowcode/painter/DesignToolbar.js +91 -0
- package/es/lowcode/painter/I18n.js +0 -0
- package/es/lowcode/painter/Outline.js +31 -27
- package/es/lowcode/painter/Panel.js +52 -97
- package/es/lowcode/painter/Ribbon.js +1 -1
- package/es/lowcode/painter/components/ActionBindModal.js +180 -0
- package/es/lowcode/painter/components/AdvancePanel.js +68 -0
- package/es/lowcode/painter/components/AttrsPanel.js +134 -0
- package/es/lowcode/painter/components/Collapse.js +74 -10
- package/es/lowcode/painter/components/ColorInput.js +125 -0
- package/es/lowcode/painter/components/FieldSelector.js +44 -0
- package/es/lowcode/painter/components/{TabEditor.js → ListEditor.js} +20 -17
- package/es/lowcode/painter/components/NumberInput.js +72 -17
- package/es/lowcode/painter/components/PanelItem.js +40 -11
- package/es/lowcode/painter/components/PopConfirm.js +14 -4
- package/es/lowcode/painter/components/PopForm.js +0 -0
- package/es/lowcode/painter/components/RuleInput.js +5 -3
- package/es/lowcode/painter/components/SortBox.js +0 -0
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +56 -66
- package/es/lowcode/painter/components/code-editor/CssEditor.js +27 -0
- package/es/lowcode/painter/components/code-editor/FullScreenEditor.js +37 -14
- package/es/lowcode/painter/components/code-editor/JSEditor.js +44 -11
- package/es/lowcode/painter/components/code-editor/JsonEditor.js +41 -0
- package/es/lowcode/painter/components/code-editor/index.js +0 -0
- package/es/lowcode/painter/index.js +6 -2
- package/es/lowcode/painter/panel-section/ActionsEditor/ActionEditor.js +154 -0
- package/es/lowcode/painter/panel-section/ActionsEditor/index.js +198 -0
- package/es/lowcode/painter/panel-section/ButtonType.js +0 -0
- package/es/lowcode/painter/panel-section/DataSetSelector.js +61 -0
- package/es/lowcode/painter/panel-section/Icon.js +0 -0
- package/es/lowcode/painter/panel-section/IconSelector.js +0 -0
- package/es/lowcode/painter/panel-section/ImpExp.js +91 -0
- package/es/lowcode/painter/panel-section/JSEditor.js +48 -0
- package/es/lowcode/painter/panel-section/LayoutRatio.js +2 -1
- package/es/lowcode/painter/panel-section/StylePanel/BackGround.js +61 -0
- package/es/lowcode/painter/panel-section/StylePanel/Border.js +150 -0
- package/es/lowcode/painter/panel-section/StylePanel/BorderRadius.js +87 -0
- package/es/lowcode/painter/panel-section/StylePanel/BorderRadiusSelector.js +66 -0
- package/es/lowcode/painter/panel-section/StylePanel/BorderSelector.js +66 -0
- package/es/lowcode/painter/panel-section/StylePanel/Display.js +15 -11
- package/es/lowcode/painter/panel-section/StylePanel/DisplaySvg.js +0 -0
- package/es/lowcode/painter/panel-section/StylePanel/Font.js +162 -0
- package/es/lowcode/painter/panel-section/StylePanel/FontEditor.js +386 -0
- package/es/lowcode/painter/panel-section/StylePanel/GapSelector.js +78 -0
- package/es/lowcode/painter/panel-section/StylePanel/HighLightPanel.js +23 -0
- package/es/lowcode/painter/panel-section/StylePanel/HighLigthtSpan.js +20 -0
- package/es/lowcode/painter/panel-section/StylePanel/HightLightSvg.js +23 -0
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +44 -12
- package/es/lowcode/painter/panel-section/StylePanel/Margin.js +60 -0
- package/es/lowcode/painter/panel-section/StylePanel/Opacity.js +50 -0
- package/es/lowcode/painter/panel-section/StylePanel/Padding.js +61 -0
- package/es/lowcode/painter/panel-section/StylePanel/Pointer.js +41 -0
- package/es/lowcode/painter/panel-section/StylePanel/Shadow.js +216 -0
- package/es/lowcode/painter/panel-section/StylePanel/Size.js +53 -0
- package/es/lowcode/painter/panel-section/StylePanel/StyleContext.js +56 -9
- package/es/lowcode/painter/panel-section/StylePanel/StyleRow.js +16 -0
- package/es/lowcode/painter/panel-section/StylePanel/{Height.js → WidthHeight.js} +23 -20
- package/es/lowcode/painter/panel-section/StylePanel/index.js +17 -0
- package/es/lowcode/painter/panel-section/TabItems.js +7 -37
- package/es/lowcode/painter/panel-section/TableTopFilter.js +306 -0
- package/es/lowcode/painter/panel-section/TableZebra.js +14 -0
- package/es/lowcode/painter/panel-section/WidthHeight.js +39 -0
- package/es/lowcode/painter/services/I18n.js +0 -0
- package/es/lowcode/painter/style/action-bind-modal.less +99 -0
- package/es/lowcode/painter/style/actions-editor.less +16 -0
- package/es/lowcode/painter/style/border-editor.less +36 -0
- package/es/lowcode/painter/style/border-radius-selector.less +43 -0
- package/es/lowcode/painter/style/border-selector.less +40 -0
- package/es/lowcode/painter/style/button-type.less +0 -0
- package/es/lowcode/painter/style/collapse.less +2 -1
- package/es/lowcode/painter/style/color-input.less +19 -0
- package/es/lowcode/painter/style/components.less +0 -0
- package/es/lowcode/painter/style/design.less +8 -1
- package/es/lowcode/painter/style/display.less +0 -0
- package/es/lowcode/painter/style/font-editor.less +9 -0
- package/es/lowcode/painter/style/fullscreen-editor.less +0 -0
- package/es/lowcode/painter/style/icon-selector.less +0 -0
- package/es/lowcode/painter/style/icon.less +0 -0
- package/es/lowcode/painter/style/impexp.less +7 -0
- package/es/lowcode/painter/style/index.less +0 -0
- package/es/lowcode/painter/style/layout-ratio.less +0 -0
- package/es/lowcode/painter/style/{tabeditor.less → list-editor.less} +9 -40
- package/es/lowcode/painter/style/number-input.less +0 -0
- package/es/lowcode/painter/style/outline.less +0 -0
- package/es/lowcode/painter/style/panel-attrs.less +43 -0
- package/es/lowcode/painter/style/panel-item.less +11 -1
- package/es/lowcode/painter/style/panel.less +5 -49
- package/es/lowcode/painter/style/pop-confirm.less +9 -2
- package/es/lowcode/painter/style/pop-form.less +0 -0
- package/es/lowcode/painter/style/radio.less +0 -0
- package/es/lowcode/painter/style/ribbon.less +0 -0
- package/es/lowcode/painter/style/rule-input.less +0 -0
- package/es/lowcode/painter/style/style-panel.less +32 -0
- package/es/lowcode/painter/style/tabitems.less +0 -0
- package/es/lowcode/view/Canvas.js +16 -15
- package/es/lowcode/view/Loading.js +0 -0
- package/es/lowcode/view/Page.js +10 -225
- package/es/lowcode/view/index.js +5 -6
- package/es/lowcode/view/lc-components/Box/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/Box/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Box/index.js +22 -6
- package/es/lowcode/view/lc-components/Box/index.less +0 -1
- package/es/lowcode/view/lc-components/Box/meta.json +1 -3
- package/es/lowcode/view/lc-components/Button/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/Button/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Button/index.js +10 -7
- package/es/lowcode/view/lc-components/Button/meta.json +8 -3
- package/es/lowcode/view/lc-components/Button/style.less +3 -0
- package/es/lowcode/view/lc-components/CardList/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/CardList/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/CardList/index.js +0 -0
- package/es/lowcode/view/lc-components/CardList/meta.json +1 -2
- package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +48 -3
- package/es/lowcode/view/lc-components/Dialog/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Dialog/index.js +21 -23
- package/es/lowcode/view/lc-components/Dialog/index.less +1 -1
- package/es/lowcode/view/lc-components/Dialog/meta.json +0 -1
- package/es/lowcode/view/lc-components/Drawer/FunctionDesign.js +13 -2
- package/es/lowcode/view/lc-components/Drawer/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Drawer/index.js +35 -22
- package/es/lowcode/view/lc-components/Drawer/{style.less → index.less} +1 -1
- package/es/lowcode/view/lc-components/Drawer/meta.json +0 -1
- package/es/lowcode/view/lc-components/Form/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/Form/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Form/index.js +0 -0
- package/es/lowcode/view/lc-components/Form/meta.json +1 -2
- package/es/lowcode/view/lc-components/Iframe/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/Iframe/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Iframe/index.js +0 -0
- package/es/lowcode/view/lc-components/Iframe/meta.json +1 -1
- package/es/lowcode/view/lc-components/ImEx/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/ImEx/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/ImEx/index.js +0 -0
- package/es/lowcode/view/lc-components/ImEx/meta.json +1 -1
- package/es/lowcode/view/lc-components/Image/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/Image/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Image/index.js +0 -0
- package/es/lowcode/view/lc-components/Image/meta.json +1 -1
- package/es/lowcode/view/lc-components/JSX/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/JSX/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/JSX/index.js +0 -0
- package/es/lowcode/view/lc-components/JSX/meta.json +1 -1
- package/es/lowcode/view/lc-components/Layout/FunctionDesign.js +6 -9
- package/es/lowcode/view/lc-components/Layout/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Layout/index.js +0 -0
- package/es/lowcode/view/lc-components/Layout/index.less +0 -0
- package/es/lowcode/view/lc-components/Layout/meta.json +1 -1
- package/es/lowcode/view/lc-components/Link/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/Link/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Link/index.js +0 -0
- package/es/lowcode/view/lc-components/Link/meta.json +1 -1
- package/es/lowcode/view/lc-components/Section/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/Section/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Section/index.js +0 -0
- package/es/lowcode/view/lc-components/Section/meta.json +1 -1
- package/es/lowcode/view/lc-components/Split/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/Split/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Split/index.js +0 -0
- package/es/lowcode/view/lc-components/Split/meta.json +1 -1
- package/es/lowcode/view/lc-components/Table/FunctionDesign.js +37 -2
- package/es/lowcode/view/lc-components/Table/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Table/components/TopFilter.js +96 -0
- package/es/lowcode/view/lc-components/Table/index.js +418 -108
- package/es/lowcode/view/lc-components/Table/meta.json +256 -58
- package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/Tabs/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Tabs/index.js +0 -0
- package/es/lowcode/view/lc-components/Tabs/meta.json +0 -1
- package/es/lowcode/view/lc-components/Text/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/Text/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Text/index.js +0 -0
- package/es/lowcode/view/lc-components/Text/meta.json +1 -1
- package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +48 -3
- package/es/lowcode/view/lc-components/Tree/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Tree/index.js +77 -6
- package/es/lowcode/view/lc-components/Tree/index.less +2 -0
- package/es/lowcode/view/lc-components/Tree/meta.json +97 -55
- package/es/lowcode/view/lc-components/Wrapper.js +2 -2
- package/es/lowcode/view/style/canvas.less +0 -0
- package/es/lowcode/view/style/loading.less +0 -0
- package/es/lowcode/view/style/page.less +0 -0
- package/es/services.js +0 -0
- package/es/upload/Form/gridForm.js +0 -0
- package/es/upload/Form/index.js +0 -0
- package/es/upload/Form/index.less +0 -0
- package/es/upload/FormItem/index.js +0 -0
- package/es/upload/GridCell/index.js +0 -0
- package/es/upload/index.js +0 -0
- package/es/utils/action.js +0 -0
- package/es/utils/form.js +0 -0
- package/es/utils/grid.js +0 -0
- package/es/utils/index.js +0 -0
- package/lib/components/Builder/index.js +5 -3
- package/lib/components/LDActions/index.js +138 -0
- package/lib/components/LDActions/index.less +48 -0
- package/lib/components/LdAutoForm/index.js +0 -0
- package/lib/components/LdCard/index.js +0 -0
- package/lib/components/LdCard/model.js +0 -0
- package/lib/components/LdCom/index.js +0 -0
- package/lib/components/LdFormList/index.js +1 -1
- package/lib/components/LdFormList/model.js +0 -0
- package/lib/components/LdGrid/index.js +20 -5
- package/lib/components/LdGrid/model.js +0 -0
- package/lib/components/LdGridForm/index.js +0 -0
- package/lib/components/LdGridForm/index.less +0 -0
- package/lib/components/LdInfoPanel/index.js +0 -0
- package/lib/components/LdPop/index.js +0 -0
- package/lib/components/LdRuntimeCom/index.js +0 -0
- package/lib/components/LdTree/index.js +31 -4
- package/lib/components/LdTree/index.less +6 -1
- package/lib/helper/FromItems.js +0 -0
- package/lib/helper/action.js +0 -0
- package/lib/helper/form.js +0 -0
- package/lib/helper/index.less +0 -0
- package/lib/helper/ldBuilder.js +0 -0
- package/lib/helper/ldComBuild.js +0 -0
- package/lib/index.js +8 -0
- package/lib/locales/zh-CN.js +157 -0
- package/lib/lowcode/constants/api-url.js +352 -2
- package/lib/lowcode/constants/event-topics.js +5 -5
- package/lib/lowcode/constants/index.js +4 -2
- package/lib/lowcode/engine/factory/DataFactory.js +0 -0
- package/lib/lowcode/engine/factory/panel-item-factory/CheckboxStrategy.js +38 -0
- package/lib/lowcode/engine/factory/panel-item-factory/DynamicStrategy.js +0 -0
- package/lib/lowcode/engine/factory/panel-item-factory/GroupStrategy.js +0 -0
- package/lib/lowcode/engine/factory/panel-item-factory/NumberStrategy.js +38 -0
- package/lib/lowcode/engine/factory/panel-item-factory/SegmentedStrategy.js +0 -0
- package/lib/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +4 -1
- package/lib/lowcode/engine/factory/panel-item-factory/Strategy.js +0 -0
- package/lib/lowcode/engine/factory/panel-item-factory/StringStrategy.js +11 -10
- package/lib/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +11 -1
- package/lib/lowcode/engine/factory/panel-item-factory/index.js +4 -0
- package/lib/lowcode/engine/meta/box.props.default.json +1 -3
- package/lib/lowcode/engine/meta/box.props.json +1 -3
- package/lib/lowcode/engine/meta/button.props.default.json +1 -1
- package/lib/lowcode/engine/meta/button.props.json +8 -3
- package/lib/lowcode/engine/meta/cardlist.props.default.json +0 -1
- package/lib/lowcode/engine/meta/cardlist.props.json +1 -2
- package/lib/lowcode/engine/meta/components-list.json +6 -6
- package/lib/lowcode/engine/meta/dialog.props.default.json +0 -1
- package/lib/lowcode/engine/meta/dialog.props.json +0 -1
- package/lib/lowcode/engine/meta/drawer.props.default.json +0 -1
- package/lib/lowcode/engine/meta/drawer.props.json +0 -1
- package/lib/lowcode/engine/meta/form.props.default.json +0 -1
- package/lib/lowcode/engine/meta/form.props.json +1 -2
- package/lib/lowcode/engine/meta/iframe.props.default.json +1 -1
- package/lib/lowcode/engine/meta/iframe.props.json +1 -1
- package/lib/lowcode/engine/meta/image.props.default.json +1 -1
- package/lib/lowcode/engine/meta/image.props.json +1 -1
- package/lib/lowcode/engine/meta/imex.props.default.json +1 -1
- package/lib/lowcode/engine/meta/imex.props.json +1 -1
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +135 -29
- 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 +1 -1
- package/lib/lowcode/engine/meta/link.props.default.json +1 -1
- package/lib/lowcode/engine/meta/link.props.json +1 -1
- package/lib/lowcode/engine/meta/local/local.zh-cn.js +103 -0
- package/lib/lowcode/engine/meta/section.props.default.json +1 -1
- package/lib/lowcode/engine/meta/section.props.json +1 -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.default.json +36 -2
- package/lib/lowcode/engine/meta/table.props.json +295 -58
- package/lib/lowcode/engine/meta/tabs.props.default.json +0 -1
- package/lib/lowcode/engine/meta/tabs.props.json +0 -1
- package/lib/lowcode/engine/meta/text.props.default.json +1 -1
- package/lib/lowcode/engine/meta/text.props.json +1 -1
- package/lib/lowcode/engine/meta/tree.props.default.json +9 -4
- package/lib/lowcode/engine/meta/tree.props.json +101 -55
- package/lib/lowcode/engine/provider/ContextProvider/index.js +207 -0
- package/lib/lowcode/engine/provider/EventBusProvider.js +0 -0
- package/lib/lowcode/engine/tools/dataProcess.js +5 -3
- package/lib/lowcode/engine/tools/helper.js +101 -0
- package/lib/lowcode/engine/tools/usePromiseState.js +6 -5
- package/lib/lowcode/index.js +5 -1
- package/lib/lowcode/painter/Components.js +0 -0
- package/lib/lowcode/painter/Design.js +24 -300
- package/lib/lowcode/painter/DesignOperator.js +278 -0
- package/lib/lowcode/painter/DesignToolbar.js +99 -0
- package/lib/lowcode/painter/I18n.js +0 -0
- package/lib/lowcode/painter/Outline.js +31 -27
- package/lib/lowcode/painter/Panel.js +49 -94
- package/lib/lowcode/painter/Ribbon.js +1 -1
- package/lib/lowcode/painter/components/ActionBindModal.js +188 -0
- package/lib/lowcode/painter/components/AdvancePanel.js +76 -0
- package/lib/lowcode/painter/components/AttrsPanel.js +142 -0
- package/lib/lowcode/painter/components/Collapse.js +72 -9
- package/lib/lowcode/painter/components/ColorInput.js +132 -0
- package/lib/lowcode/painter/components/FieldSelector.js +52 -0
- package/lib/lowcode/painter/components/{TabEditor.js → ListEditor.js} +22 -19
- package/lib/lowcode/painter/components/NumberInput.js +70 -16
- package/lib/lowcode/painter/components/PanelItem.js +40 -11
- package/lib/lowcode/painter/components/PopConfirm.js +14 -4
- package/lib/lowcode/painter/components/PopForm.js +0 -0
- package/lib/lowcode/painter/components/RuleInput.js +5 -3
- package/lib/lowcode/painter/components/SortBox.js +0 -0
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +54 -65
- package/lib/lowcode/painter/components/code-editor/CssEditor.js +26 -0
- package/lib/lowcode/painter/components/code-editor/FullScreenEditor.js +35 -13
- package/lib/lowcode/painter/components/code-editor/JSEditor.js +44 -11
- package/lib/lowcode/painter/components/code-editor/JsonEditor.js +48 -0
- package/lib/lowcode/painter/components/code-editor/index.js +0 -0
- package/lib/lowcode/painter/index.js +6 -2
- package/lib/lowcode/painter/panel-section/ActionsEditor/ActionEditor.js +162 -0
- package/lib/lowcode/painter/panel-section/ActionsEditor/index.js +206 -0
- package/lib/lowcode/painter/panel-section/ButtonType.js +0 -0
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +69 -0
- package/lib/lowcode/painter/panel-section/Icon.js +0 -0
- package/lib/lowcode/painter/panel-section/IconSelector.js +0 -0
- package/lib/lowcode/painter/panel-section/ImpExp.js +98 -0
- package/lib/lowcode/painter/panel-section/JSEditor.js +56 -0
- package/lib/lowcode/painter/panel-section/LayoutRatio.js +2 -1
- package/lib/lowcode/painter/panel-section/StylePanel/BackGround.js +68 -0
- package/lib/lowcode/painter/panel-section/StylePanel/Border.js +158 -0
- package/lib/lowcode/painter/panel-section/StylePanel/BorderRadius.js +95 -0
- package/lib/lowcode/painter/panel-section/StylePanel/BorderRadiusSelector.js +73 -0
- package/lib/lowcode/painter/panel-section/StylePanel/BorderSelector.js +73 -0
- package/lib/lowcode/painter/panel-section/StylePanel/Display.js +15 -11
- package/lib/lowcode/painter/panel-section/StylePanel/DisplaySvg.js +0 -0
- package/lib/lowcode/painter/panel-section/StylePanel/Font.js +170 -0
- package/lib/lowcode/painter/panel-section/StylePanel/FontEditor.js +392 -0
- package/lib/lowcode/painter/panel-section/StylePanel/GapSelector.js +85 -0
- package/lib/lowcode/painter/panel-section/StylePanel/HighLightPanel.js +29 -0
- package/lib/lowcode/painter/panel-section/StylePanel/HighLigthtSpan.js +26 -0
- package/lib/lowcode/painter/panel-section/StylePanel/HightLightSvg.js +29 -0
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +42 -11
- package/lib/lowcode/painter/panel-section/StylePanel/Margin.js +67 -0
- package/lib/lowcode/painter/panel-section/StylePanel/Opacity.js +57 -0
- package/lib/lowcode/painter/panel-section/StylePanel/Padding.js +68 -0
- package/lib/lowcode/painter/panel-section/StylePanel/Pointer.js +48 -0
- package/lib/lowcode/painter/panel-section/StylePanel/Shadow.js +224 -0
- package/lib/lowcode/painter/panel-section/StylePanel/{Width.js → Size.js} +39 -35
- package/lib/lowcode/painter/panel-section/StylePanel/StyleContext.js +56 -9
- package/lib/lowcode/painter/panel-section/StylePanel/StyleRow.js +22 -0
- package/lib/lowcode/painter/panel-section/StylePanel/{Height.js → WidthHeight.js} +22 -19
- package/lib/lowcode/painter/panel-section/StylePanel/index.js +16 -0
- package/lib/lowcode/painter/panel-section/TabItems.js +7 -37
- package/lib/lowcode/painter/panel-section/TableTopFilter.js +314 -0
- package/lib/lowcode/painter/panel-section/TableZebra.js +21 -0
- package/lib/lowcode/painter/panel-section/WidthHeight.js +46 -0
- package/lib/lowcode/painter/services/I18n.js +0 -0
- package/lib/lowcode/painter/style/action-bind-modal.less +99 -0
- package/lib/lowcode/painter/style/actions-editor.less +16 -0
- package/lib/lowcode/painter/style/border-editor.less +36 -0
- package/lib/lowcode/painter/style/border-radius-selector.less +43 -0
- package/lib/lowcode/painter/style/border-selector.less +40 -0
- package/lib/lowcode/painter/style/button-type.less +0 -0
- package/lib/lowcode/painter/style/collapse.less +2 -1
- package/lib/lowcode/painter/style/color-input.less +19 -0
- package/lib/lowcode/painter/style/components.less +0 -0
- package/lib/lowcode/painter/style/design.less +8 -1
- package/lib/lowcode/painter/style/display.less +0 -0
- package/lib/lowcode/painter/style/font-editor.less +9 -0
- package/lib/lowcode/painter/style/fullscreen-editor.less +0 -0
- package/lib/lowcode/painter/style/icon-selector.less +0 -0
- package/lib/lowcode/painter/style/icon.less +0 -0
- package/lib/lowcode/painter/style/impexp.less +7 -0
- package/lib/lowcode/painter/style/index.less +0 -0
- package/lib/lowcode/painter/style/layout-ratio.less +0 -0
- package/lib/lowcode/painter/style/{tabeditor.less → list-editor.less} +9 -40
- package/lib/lowcode/painter/style/number-input.less +0 -0
- package/lib/lowcode/painter/style/outline.less +0 -0
- package/lib/lowcode/painter/style/panel-attrs.less +43 -0
- package/lib/lowcode/painter/style/panel-item.less +11 -1
- package/lib/lowcode/painter/style/panel.less +5 -49
- package/lib/lowcode/painter/style/pop-confirm.less +9 -2
- package/lib/lowcode/painter/style/pop-form.less +0 -0
- package/lib/lowcode/painter/style/radio.less +0 -0
- package/lib/lowcode/painter/style/ribbon.less +0 -0
- package/lib/lowcode/painter/style/rule-input.less +0 -0
- package/lib/lowcode/painter/style/style-panel.less +32 -0
- package/lib/lowcode/painter/style/tabitems.less +0 -0
- package/lib/lowcode/view/Canvas.js +16 -15
- package/lib/lowcode/view/Loading.js +0 -0
- package/lib/lowcode/view/Page.js +9 -224
- package/lib/lowcode/view/index.js +5 -6
- package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/Box/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Box/index.js +19 -4
- package/lib/lowcode/view/lc-components/Box/index.less +0 -1
- package/lib/lowcode/view/lc-components/Box/meta.json +1 -3
- package/lib/lowcode/view/lc-components/Button/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/Button/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Button/index.js +10 -7
- package/lib/lowcode/view/lc-components/Button/meta.json +8 -3
- package/lib/lowcode/view/lc-components/Button/style.less +3 -0
- package/lib/lowcode/view/lc-components/CardList/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/CardList/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/CardList/index.js +0 -0
- package/lib/lowcode/view/lc-components/CardList/meta.json +1 -2
- package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +49 -3
- package/lib/lowcode/view/lc-components/Dialog/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Dialog/index.js +20 -22
- package/lib/lowcode/view/lc-components/Dialog/index.less +1 -1
- package/lib/lowcode/view/lc-components/Dialog/meta.json +0 -1
- package/lib/lowcode/view/lc-components/Drawer/FunctionDesign.js +13 -2
- package/lib/lowcode/view/lc-components/Drawer/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Drawer/index.js +34 -21
- package/lib/lowcode/view/lc-components/Drawer/{style.less → index.less} +1 -1
- package/lib/lowcode/view/lc-components/Drawer/meta.json +0 -1
- package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/Form/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Form/index.js +0 -0
- package/lib/lowcode/view/lc-components/Form/meta.json +1 -2
- package/lib/lowcode/view/lc-components/Iframe/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/Iframe/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Iframe/index.js +0 -0
- package/lib/lowcode/view/lc-components/Iframe/meta.json +1 -1
- package/lib/lowcode/view/lc-components/ImEx/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/ImEx/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/ImEx/index.js +0 -0
- package/lib/lowcode/view/lc-components/ImEx/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Image/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/Image/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Image/index.js +0 -0
- package/lib/lowcode/view/lc-components/Image/meta.json +1 -1
- package/lib/lowcode/view/lc-components/JSX/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/JSX/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/JSX/index.js +0 -0
- package/lib/lowcode/view/lc-components/JSX/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Layout/FunctionDesign.js +6 -9
- package/lib/lowcode/view/lc-components/Layout/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Layout/index.js +0 -0
- package/lib/lowcode/view/lc-components/Layout/index.less +0 -0
- package/lib/lowcode/view/lc-components/Layout/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Link/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/Link/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Link/index.js +0 -0
- package/lib/lowcode/view/lc-components/Link/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Section/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/Section/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Section/index.js +0 -0
- package/lib/lowcode/view/lc-components/Section/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/Split/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Split/index.js +0 -0
- package/lib/lowcode/view/lc-components/Split/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Table/FunctionDesign.js +39 -3
- package/lib/lowcode/view/lc-components/Table/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Table/components/TopFilter.js +104 -0
- package/lib/lowcode/view/lc-components/Table/index.js +418 -108
- package/lib/lowcode/view/lc-components/Table/meta.json +256 -58
- package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/Tabs/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Tabs/index.js +0 -0
- package/lib/lowcode/view/lc-components/Tabs/meta.json +0 -1
- package/lib/lowcode/view/lc-components/Text/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/Text/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Text/index.js +0 -0
- package/lib/lowcode/view/lc-components/Text/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +49 -3
- package/lib/lowcode/view/lc-components/Tree/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Tree/index.js +77 -6
- package/lib/lowcode/view/lc-components/Tree/index.less +2 -0
- package/lib/lowcode/view/lc-components/Tree/meta.json +97 -55
- package/lib/lowcode/view/lc-components/Wrapper.js +2 -2
- package/lib/lowcode/view/style/canvas.less +0 -0
- package/lib/lowcode/view/style/loading.less +0 -0
- package/lib/lowcode/view/style/page.less +0 -0
- package/lib/services.js +0 -0
- package/lib/upload/Form/gridForm.js +0 -0
- package/lib/upload/Form/index.js +0 -0
- package/lib/upload/Form/index.less +0 -0
- package/lib/upload/FormItem/index.js +0 -0
- package/lib/upload/GridCell/index.js +0 -0
- package/lib/upload/index.js +0 -0
- package/lib/utils/action.js +0 -0
- package/lib/utils/form.js +0 -0
- package/lib/utils/grid.js +0 -0
- package/lib/utils/index.js +0 -0
- package/lowcode.js +0 -0
- package/package.json +14 -7
- package/upload.js +0 -0
- package/utils.js +0 -0
- package/es/lowcode/engine/provider/ContextProvider.js +0 -157
- package/es/lowcode/painter/panel-section/StylePanel/Width.js +0 -48
- package/lib/lowcode/engine/provider/ContextProvider.js +0 -165
|
@@ -6,330 +6,54 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _moment = _interopRequireDefault(require("moment"));
|
|
13
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
|
-
var _lodash = require("lodash");
|
|
15
11
|
var _umi = require("umi");
|
|
16
12
|
var _ahooks = require("ahooks");
|
|
13
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
17
14
|
var _antd = require("luck-design/antd");
|
|
18
|
-
var
|
|
19
|
-
var
|
|
15
|
+
var _DesignToolbar = _interopRequireDefault(require("./DesignToolbar"));
|
|
16
|
+
var _DesignOperator = _interopRequireDefault(require("./DesignOperator"));
|
|
20
17
|
var _Page = _interopRequireDefault(require("../view/Page"));
|
|
21
|
-
var _dataProcess = require("../engine/tools/dataProcess");
|
|
22
|
-
var _constants = require("../constants");
|
|
23
18
|
var _design = _interopRequireDefault(require("./style/design.less"));
|
|
24
|
-
var getOperatorStyle = function getOperatorStyle(page, cellNode) {
|
|
25
|
-
var _page$getBoundingClie = page.getBoundingClientRect(),
|
|
26
|
-
pageLeft = _page$getBoundingClie.left,
|
|
27
|
-
pageTop = _page$getBoundingClie.top;
|
|
28
|
-
var _cellNode$getBounding = cellNode.getBoundingClientRect(),
|
|
29
|
-
cellNodeLeft = _cellNode$getBounding.left,
|
|
30
|
-
cellNodeTop = _cellNode$getBounding.top;
|
|
31
|
-
return {
|
|
32
|
-
left: "".concat(cellNodeLeft - pageLeft, "px"),
|
|
33
|
-
top: "".concat(cellNodeTop - pageTop, "px"),
|
|
34
|
-
width: "".concat(cellNode.offsetWidth, "px"),
|
|
35
|
-
height: "".concat(cellNode.offsetHeight, "px")
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
19
|
var Design = function Design() {
|
|
39
|
-
var
|
|
40
|
-
var context = (0, _ContextProvider.useLDContext)();
|
|
41
|
-
var selectorRef = (0, _react.useRef)(null);
|
|
20
|
+
var _localeInfo$locale;
|
|
42
21
|
var simulatorRef = (0, _react.useRef)(null);
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
selector: null,
|
|
46
|
-
detector: null
|
|
22
|
+
var _useState = (0, _react.useState)(function () {
|
|
23
|
+
return (0, _umi.getLocale)();
|
|
47
24
|
}),
|
|
48
|
-
_useSetState2 = (0, _slicedToArray2.default)(_useSetState, 2),
|
|
49
|
-
operatorId = _useSetState2[0],
|
|
50
|
-
setOperatorId = _useSetState2[1];
|
|
51
|
-
var _useState = (0, _react.useState)(null),
|
|
52
25
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
53
|
-
|
|
54
|
-
|
|
26
|
+
locale = _useState2[0],
|
|
27
|
+
setLocale = _useState2[1];
|
|
55
28
|
var _useState3 = (0, _react.useState)(function () {
|
|
56
|
-
return (0, _umi.getLocale)();
|
|
29
|
+
return (0, _umi.getIntl)((0, _umi.getLocale)(), true);
|
|
57
30
|
}),
|
|
58
31
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
var
|
|
62
|
-
return (0, _umi.getIntl)(locale, true);
|
|
63
|
-
}),
|
|
64
|
-
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
65
|
-
intl = _useState6[0],
|
|
66
|
-
setContainerIntl = _useState6[1];
|
|
67
|
-
var _useState7 = (0, _react.useState)('pc'),
|
|
68
|
-
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
69
|
-
activedTarget = _useState8[0],
|
|
70
|
-
setActivedTarget = _useState8[1];
|
|
71
|
-
(0, _ahooks.useEventListener)('mousemove', function (event) {
|
|
72
|
-
var elem = event.target;
|
|
73
|
-
var targetCell = elem.closest(".".concat(_constants.CELL_CLASS_NAME));
|
|
74
|
-
var targetCellId = targetCell === null || targetCell === void 0 ? void 0 : targetCell.id;
|
|
75
|
-
if (targetCellId && targetCellId !== operatorId.detector && targetCellId !== operatorId.selector) {
|
|
76
|
-
setOperatorId({
|
|
77
|
-
detector: targetCellId
|
|
78
|
-
});
|
|
79
|
-
context.$publisher(context.topics.COMPONENT_HOVER, {
|
|
80
|
-
id: targetCellId
|
|
81
|
-
});
|
|
82
|
-
} else if (!targetCell || targetCellId === operatorId.selector) {
|
|
83
|
-
setOperatorId({
|
|
84
|
-
detector: null
|
|
85
|
-
});
|
|
86
|
-
context.$publisher(context.topics.COMPONENT_HOVER, null);
|
|
87
|
-
}
|
|
88
|
-
}, {
|
|
89
|
-
target: simulatorRef
|
|
90
|
-
});
|
|
91
|
-
(0, _ahooks.useEventListener)('mouseleave', function () {
|
|
92
|
-
if (operatorId.detector) {
|
|
93
|
-
setOperatorId({
|
|
94
|
-
detector: null
|
|
95
|
-
});
|
|
96
|
-
context.$publisher(context.topics.COMPONENT_HOVER, null);
|
|
97
|
-
}
|
|
98
|
-
}, {
|
|
99
|
-
target: simulatorRef
|
|
100
|
-
});
|
|
101
|
-
(0, _ahooks.useEventListener)('click', function (event) {
|
|
102
|
-
var elem = event.target;
|
|
103
|
-
var targetCell = elem.closest(".".concat(_constants.CELL_CLASS_NAME));
|
|
104
|
-
var targetCellId = targetCell === null || targetCell === void 0 ? void 0 : targetCell.id;
|
|
105
|
-
if (!targetCellId || targetCellId === operatorId.selector) return;
|
|
106
|
-
context.$publisher(context.topics.COMPONENT_HOVER, null);
|
|
107
|
-
context.$publisher(context.topics.COMPONENT_ACTIVE, {
|
|
108
|
-
id: targetCell.id
|
|
109
|
-
});
|
|
110
|
-
}, {
|
|
111
|
-
target: simulatorRef
|
|
112
|
-
});
|
|
113
|
-
(0, _react.useEffect)(function () {
|
|
114
|
-
var hcid = context.$subscriber(context.topics.COMPONENT_HOVER).on(function (payload) {
|
|
115
|
-
if (payload.id) setOperatorId({
|
|
116
|
-
detector: payload.id
|
|
117
|
-
});else setOperatorId({
|
|
118
|
-
detector: null
|
|
119
|
-
});
|
|
120
|
-
}).watch();
|
|
121
|
-
var acid = context.$subscriber(context.topics.COMPONENT_ACTIVE).on(function (payload) {
|
|
122
|
-
if (payload.id) {
|
|
123
|
-
setOperatorId({
|
|
124
|
-
selector: payload.id,
|
|
125
|
-
detector: null
|
|
126
|
-
});
|
|
127
|
-
} else {
|
|
128
|
-
setOperatorId({
|
|
129
|
-
selector: null
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
}).watch();
|
|
133
|
-
return function () {
|
|
134
|
-
context.$unsubscriber(context.topics.COMPONENT_HOVER, hcid);
|
|
135
|
-
context.$unsubscriber(context.topics.COMPONENT_ACTIVE, acid);
|
|
136
|
-
};
|
|
137
|
-
}, [context.pageData]);
|
|
138
|
-
(0, _react.useEffect)(function () {
|
|
139
|
-
var moid = context.$subscriber(context.topics.MODAL_OPEN).on(function () {
|
|
140
|
-
simulatorRef.current.style.setProperty('overflow', 'hidden');
|
|
141
|
-
}).watch();
|
|
142
|
-
var mcid = context.$subscriber(context.topics.MODAL_CLOSE).on(function () {
|
|
143
|
-
simulatorRef.current.style.removeProperty('overflow');
|
|
144
|
-
}).watch();
|
|
145
|
-
var laid = context.$subscriber(context.topics.LANG_SETTING_SELECT).on(function (_ref) {
|
|
146
|
-
var _langList = _ref.langList;
|
|
147
|
-
return setLangList(_langList);
|
|
148
|
-
}).watch();
|
|
149
|
-
return function () {
|
|
150
|
-
context.$unsubscriber(context.topics.MODAL_OPEN, moid);
|
|
151
|
-
context.$unsubscriber(context.topics.MODAL_CLOSE, mcid);
|
|
152
|
-
context.$unsubscriber(context.topics.LANG_SETTING_SELECT, laid);
|
|
153
|
-
};
|
|
154
|
-
}, []);
|
|
155
|
-
(0, _react.useEffect)(function () {
|
|
156
|
-
var csid = context.$subscriber(context.topics.COMPONENT_SETTING_CLICK).on(function (_ref2) {
|
|
157
|
-
var data = _ref2.data;
|
|
158
|
-
if (!operatorId.selector) {
|
|
159
|
-
_antd.message.info('请在右侧画布选择节点');
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
if (context.componentMap.get(operatorId.selector).dom.getAttribute('name') !== 'box') {
|
|
163
|
-
_antd.message.info('该节点不支持添加子节点');
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
var json = require("../engine/meta/".concat(data.component.toLowerCase(), ".props.default.json"));
|
|
167
|
-
var _id = "".concat(data.component.toLowerCase(), "_").concat((0, _utils.suid)());
|
|
168
|
-
var cloneData = (0, _lodash.cloneDeep)(context.pageData);
|
|
169
|
-
(0, _dataProcess.add)(cloneData, operatorId.selector, _id, json);
|
|
170
|
-
context._setPageData(cloneData).then(function (newData) {
|
|
171
|
-
context.$publisher(context.topics.COMPONENT_APPEND, {
|
|
172
|
-
id: _id,
|
|
173
|
-
pageData: newData
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
}).watch();
|
|
177
|
-
return function () {
|
|
178
|
-
return context.$unsubscriber(context.topics.COMPONENT_SETTING_CLICK, csid);
|
|
179
|
-
};
|
|
180
|
-
}, [context.pageData]);
|
|
181
|
-
var getDomById = (0, _ahooks.useMemoizedFn)(function (id) {
|
|
182
|
-
return context.componentMap.get(id).dom;
|
|
183
|
-
});
|
|
184
|
-
var handleLangChange = (0, _ahooks.useMemoizedFn)(function (locale) {
|
|
32
|
+
intl = _useState4[0],
|
|
33
|
+
setIntl = _useState4[1];
|
|
34
|
+
var handleLangChange = (0, _ahooks.useMemoizedFn)(function (_locale) {
|
|
185
35
|
if (_moment.default !== null && _moment.default !== void 0 && _moment.default.locale) {
|
|
186
|
-
var _localeInfo$
|
|
187
|
-
_moment.default.locale(((_localeInfo$
|
|
188
|
-
}
|
|
189
|
-
setLocale(locale);
|
|
190
|
-
setContainerIntl((0, _umi.getIntl)(locale));
|
|
191
|
-
});
|
|
192
|
-
var acticeProps = (0, _ahooks.useCreation)(function () {
|
|
193
|
-
if (operatorId.selector) {
|
|
194
|
-
var levelNodes = context.componentMap.get(operatorId.selector).api.getLevelNodes();
|
|
195
|
-
return {
|
|
196
|
-
props: (0, _lodash.last)(levelNodes),
|
|
197
|
-
menu: /*#__PURE__*/_react.default.createElement("div", {
|
|
198
|
-
className: _design.default['next-overlay-wrapper'],
|
|
199
|
-
onMouseLeave: function onMouseLeave() {
|
|
200
|
-
return handleHover();
|
|
201
|
-
}
|
|
202
|
-
}, (0, _lodash.reverse)((0, _lodash.initial)(levelNodes)).map(function (m) {
|
|
203
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
204
|
-
key: m.id
|
|
205
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
206
|
-
onClick: function onClick() {
|
|
207
|
-
return handleSelect(m.id);
|
|
208
|
-
},
|
|
209
|
-
onMouseOver: function onMouseOver() {
|
|
210
|
-
return handleHover(m.id);
|
|
211
|
-
}
|
|
212
|
-
}, m.name));
|
|
213
|
-
}))
|
|
214
|
-
};
|
|
36
|
+
var _localeInfo$_locale;
|
|
37
|
+
_moment.default.locale(((_localeInfo$_locale = _umi.localeInfo[_locale]) === null || _localeInfo$_locale === void 0 ? void 0 : _localeInfo$_locale.momentLocale) || 'en');
|
|
215
38
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
var handleSelect = (0, _ahooks.useMemoizedFn)(function (_key) {
|
|
219
|
-
context.$publisher(context.topics.COMPONENT_ACTIVE, _key ? {
|
|
220
|
-
id: _key
|
|
221
|
-
} : null);
|
|
222
|
-
});
|
|
223
|
-
var handleHover = (0, _ahooks.useMemoizedFn)(function (_key) {
|
|
224
|
-
context.$publisher(context.topics.COMPONENT_HOVER, _key ? {
|
|
225
|
-
id: _key
|
|
226
|
-
} : null);
|
|
227
|
-
});
|
|
228
|
-
var handleDelete = (0, _ahooks.useMemoizedFn)(function (_key) {
|
|
229
|
-
context.$publisher(context.topics.COMPONENT_DELETE, _key ? {
|
|
230
|
-
id: _key
|
|
231
|
-
} : null);
|
|
39
|
+
setLocale(_locale);
|
|
40
|
+
setIntl((0, _umi.getIntl)(_locale));
|
|
232
41
|
});
|
|
233
42
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
234
43
|
className: _design.default['lc-painter-design']
|
|
235
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
value: langList ? locale : undefined,
|
|
240
|
-
className: _design.default['i18n-selecter'],
|
|
241
|
-
style: {
|
|
242
|
-
fontSize: 12
|
|
243
|
-
},
|
|
244
|
-
onSelect: handleLangChange
|
|
245
|
-
}, langList === null || langList === void 0 ? void 0 : langList.map(function (item) {
|
|
246
|
-
return /*#__PURE__*/_react.default.createElement(_antd.Select.Option, {
|
|
247
|
-
key: item.field,
|
|
248
|
-
value: item.field
|
|
249
|
-
}, item.title);
|
|
250
|
-
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
251
|
-
className: (0, _classnames.default)(_design.default['toolbar-item'], (0, _defineProperty2.default)({}, _design.default.actived, activedTarget === 'pc')),
|
|
252
|
-
onClick: function onClick() {
|
|
253
|
-
return setActivedTarget('pc');
|
|
254
|
-
}
|
|
255
|
-
}, /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
256
|
-
type: "laptop"
|
|
257
|
-
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
258
|
-
className: (0, _classnames.default)(_design.default['toolbar-item'], (0, _defineProperty2.default)({}, _design.default.actived, activedTarget === 'mobile')),
|
|
259
|
-
onClick: function onClick() {
|
|
260
|
-
return setActivedTarget('mobile');
|
|
261
|
-
}
|
|
262
|
-
}, /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
263
|
-
type: "mobile"
|
|
264
|
-
})), /*#__PURE__*/_react.default.createElement(_antd.Divider, {
|
|
265
|
-
type: "vertical"
|
|
266
|
-
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
267
|
-
style: {
|
|
268
|
-
width: 'auto',
|
|
269
|
-
fontSize: 12
|
|
270
|
-
},
|
|
271
|
-
className: _design.default['toolbar-item'],
|
|
272
|
-
onClick: function onClick() {
|
|
273
|
-
context.$publisher(context.topics.COMPONENT_ACTIVE, {
|
|
274
|
-
id: _constants.CELL_KEY.PAGE_ROOT
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
}, "\u9875\u9762\u5C5E\u6027"), /*#__PURE__*/_react.default.createElement(_antd.Divider, {
|
|
278
|
-
type: "vertical"
|
|
279
|
-
}), /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
280
|
-
size: "small",
|
|
281
|
-
style: {
|
|
282
|
-
fontSize: 12,
|
|
283
|
-
margin: '0 2px'
|
|
284
|
-
}
|
|
285
|
-
}, "\u9884\u89C8"), /*#__PURE__*/_react.default.createElement(_antd.Divider, {
|
|
286
|
-
type: "vertical"
|
|
287
|
-
}), /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
288
|
-
size: "small",
|
|
289
|
-
type: "primary",
|
|
290
|
-
style: {
|
|
291
|
-
fontSize: 12,
|
|
292
|
-
margin: '0 0 0 2px'
|
|
293
|
-
}
|
|
294
|
-
}, "\u4FDD\u5B58")), /*#__PURE__*/_react.default.createElement("div", {
|
|
44
|
+
}, /*#__PURE__*/_react.default.createElement(_DesignToolbar.default, {
|
|
45
|
+
locale: locale,
|
|
46
|
+
onLangChange: handleLangChange
|
|
47
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
295
48
|
className: _design.default['lc-painter-design-workspace']
|
|
296
|
-
},
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
}), operatorId.selector && /*#__PURE__*/_react.default.createElement("div", {
|
|
301
|
-
id: "lc-selector",
|
|
302
|
-
ref: selectorRef,
|
|
303
|
-
key: "".concat((size === null || size === void 0 ? void 0 : size.width) || 0, "-").concat((size === null || size === void 0 ? void 0 : size.height) || 0),
|
|
304
|
-
className: _design.default['lc-painter-design-selector'],
|
|
305
|
-
style: getOperatorStyle(simulatorRef.current, getDomById(operatorId.selector))
|
|
306
|
-
}, acticeProps && /*#__PURE__*/_react.default.createElement("div", {
|
|
307
|
-
className: _design.default['lc-borders-actions'],
|
|
308
|
-
style: acticeProps.props.id === _constants.CELL_KEY.PAGE_ROOT ? {
|
|
309
|
-
top: 0
|
|
310
|
-
} : ((_selectorRef$current = selectorRef.current) === null || _selectorRef$current === void 0 ? void 0 : _selectorRef$current.offsetTop) < 23 ? {
|
|
311
|
-
bottom: '-23px'
|
|
312
|
-
} : {
|
|
313
|
-
top: '-23px'
|
|
314
|
-
}
|
|
315
|
-
}, /*#__PURE__*/_react.default.createElement(_antd.Dropdown, {
|
|
316
|
-
overlay: acticeProps.menu,
|
|
317
|
-
placement: "bottomLeft"
|
|
318
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
319
|
-
className: "instance-node-selector"
|
|
320
|
-
}, acticeProps.props.name)), /*#__PURE__*/_react.default.createElement("div", {
|
|
321
|
-
onClick: function onClick() {
|
|
322
|
-
return handleDelete(acticeProps.props);
|
|
323
|
-
}
|
|
324
|
-
}, /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
325
|
-
type: "delete"
|
|
326
|
-
})))), /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
327
|
-
locale: ((_localeInfo$locale2 = _umi.localeInfo[locale]) === null || _localeInfo$locale2 === void 0 ? void 0 : _localeInfo$locale2.antd) || {}
|
|
49
|
+
}, /*#__PURE__*/_react.default.createElement(_DesignOperator.default, {
|
|
50
|
+
target: simulatorRef
|
|
51
|
+
}), /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
52
|
+
locale: ((_localeInfo$locale = _umi.localeInfo[locale]) === null || _localeInfo$locale === void 0 ? void 0 : _localeInfo$locale.antd) || {}
|
|
328
53
|
}, /*#__PURE__*/_react.default.createElement(_umi.RawIntlProvider, {
|
|
329
54
|
value: intl
|
|
330
55
|
}, /*#__PURE__*/_react.default.createElement(_Page.default, {
|
|
331
56
|
ref: simulatorRef,
|
|
332
|
-
pageCode: "mk2i87qb",
|
|
333
57
|
className: _design.default['lc-painter-design-simulator']
|
|
334
58
|
})))));
|
|
335
59
|
};
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _lodash = require("lodash");
|
|
12
|
+
var _ahooks = require("ahooks");
|
|
13
|
+
var _antd = require("luck-design/antd");
|
|
14
|
+
var _utils = require("@luck-design-biz/base/utils");
|
|
15
|
+
var _ContextProvider = require("../engine/provider/ContextProvider");
|
|
16
|
+
var _dataProcess = require("../engine/tools/dataProcess");
|
|
17
|
+
var _constants = require("../constants");
|
|
18
|
+
var _design = _interopRequireDefault(require("./style/design.less"));
|
|
19
|
+
var _MODAL_COMPONENT_ = ['Dialog', 'Drawer'];
|
|
20
|
+
var getOperatorStyle = function getOperatorStyle(page, cellNode) {
|
|
21
|
+
var _page$getBoundingClie = page.getBoundingClientRect(),
|
|
22
|
+
pageLeft = _page$getBoundingClie.left,
|
|
23
|
+
pageTop = _page$getBoundingClie.top;
|
|
24
|
+
var _cellNode$getBounding = cellNode.getBoundingClientRect(),
|
|
25
|
+
cellNodeLeft = _cellNode$getBounding.left,
|
|
26
|
+
cellNodeTop = _cellNode$getBounding.top;
|
|
27
|
+
return {
|
|
28
|
+
left: "".concat(cellNodeLeft - pageLeft, "px"),
|
|
29
|
+
top: "".concat(cellNodeTop - pageTop, "px"),
|
|
30
|
+
width: "".concat(cellNode.offsetWidth, "px"),
|
|
31
|
+
height: "".concat(cellNode.offsetHeight, "px")
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
var DesignOperator = function DesignOperator(_ref) {
|
|
35
|
+
var _getDomById, _getDomById2;
|
|
36
|
+
var target = _ref.target;
|
|
37
|
+
var context = (0, _ContextProvider.useLDContext)();
|
|
38
|
+
var size = (0, _ahooks.useSize)(target);
|
|
39
|
+
var _useState = (0, _react.useState)((0, _utils.suid)()),
|
|
40
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
41
|
+
positionKey = _useState2[0],
|
|
42
|
+
setPositionKey = _useState2[1];
|
|
43
|
+
var _useSetState = (0, _ahooks.useSetState)({
|
|
44
|
+
selector: null,
|
|
45
|
+
detector: null
|
|
46
|
+
}),
|
|
47
|
+
_useSetState2 = (0, _slicedToArray2.default)(_useSetState, 2),
|
|
48
|
+
operatorId = _useSetState2[0],
|
|
49
|
+
setOperatorId = _useSetState2[1];
|
|
50
|
+
var lastSelectorId = (0, _ahooks.useLatest)(operatorId.selector);
|
|
51
|
+
var currentModal = (0, _react.useRef)(null);
|
|
52
|
+
var getDomById = (0, _ahooks.useMemoizedFn)(function (id) {
|
|
53
|
+
return context.componentMap.get(id).dom;
|
|
54
|
+
});
|
|
55
|
+
var handleSelect = (0, _ahooks.useMemoizedFn)(function (_key) {
|
|
56
|
+
context.$publisher(context.topics.COMPONENT_ACTIVE, _key ? {
|
|
57
|
+
id: _key
|
|
58
|
+
} : null);
|
|
59
|
+
});
|
|
60
|
+
var handleHover = (0, _ahooks.useMemoizedFn)(function (_key) {
|
|
61
|
+
context.$publisher(context.topics.COMPONENT_HOVER, _key ? {
|
|
62
|
+
id: _key
|
|
63
|
+
} : null);
|
|
64
|
+
});
|
|
65
|
+
var handleDelete = (0, _ahooks.useMemoizedFn)(function (_ref2) {
|
|
66
|
+
var id = _ref2.id,
|
|
67
|
+
parentId = _ref2.parentId;
|
|
68
|
+
context.$publisher(context.topics.COMPONENT_ACTIVE, null);
|
|
69
|
+
var cloneData = (0, _lodash.cloneDeep)(context.pageData);
|
|
70
|
+
(0, _dataProcess.deleteById)(cloneData, id);
|
|
71
|
+
context._setPageData(cloneData).then(function (newData) {
|
|
72
|
+
context.$publisher(context.topics.COMPONENT_DELETE, {
|
|
73
|
+
id: id,
|
|
74
|
+
parentId: parentId,
|
|
75
|
+
pageData: newData
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
var addComponent = (0, _ahooks.useMemoizedFn)(function (data, targetId) {
|
|
80
|
+
var json = require("../engine/meta/".concat(data.component.toLowerCase(), ".props.default.json"));
|
|
81
|
+
var _id = "".concat(data.component.toLowerCase(), "_").concat((0, _utils.suid)());
|
|
82
|
+
var cloneData = (0, _lodash.cloneDeep)(context.pageData);
|
|
83
|
+
(0, _dataProcess.add)(cloneData, targetId, _id, json);
|
|
84
|
+
context.$subscriber(context.topics.COMPONENT_MOUNT).once(function (_ref3) {
|
|
85
|
+
var mountCompId = _ref3.id;
|
|
86
|
+
if (mountCompId === _id) {
|
|
87
|
+
context.$publisher(context.topics.COMPONENT_APPEND, {
|
|
88
|
+
id: _id,
|
|
89
|
+
pageData: cloneData
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}).watch();
|
|
93
|
+
context._setPageData(cloneData);
|
|
94
|
+
});
|
|
95
|
+
var acticeProps = (0, _ahooks.useCreation)(function () {
|
|
96
|
+
if (!operatorId.selector) return null;
|
|
97
|
+
var levelNodes = context.componentMap.get(operatorId.selector).api.getLevelNodes();
|
|
98
|
+
return {
|
|
99
|
+
props: (0, _lodash.last)(levelNodes),
|
|
100
|
+
menu: /*#__PURE__*/_react.default.createElement("div", {
|
|
101
|
+
className: _design.default['next-overlay-wrapper'],
|
|
102
|
+
onMouseLeave: function onMouseLeave() {
|
|
103
|
+
return handleHover();
|
|
104
|
+
}
|
|
105
|
+
}, (0, _lodash.reverse)((0, _lodash.initial)(levelNodes)).map(function (m) {
|
|
106
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
107
|
+
key: m.id
|
|
108
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
109
|
+
onClick: function onClick() {
|
|
110
|
+
return handleSelect(m.id);
|
|
111
|
+
},
|
|
112
|
+
onMouseOver: function onMouseOver() {
|
|
113
|
+
return handleHover(m.id);
|
|
114
|
+
}
|
|
115
|
+
}, m.name));
|
|
116
|
+
}))
|
|
117
|
+
};
|
|
118
|
+
}, [operatorId.selector]);
|
|
119
|
+
var lastDetectorNode = (0, _ahooks.useCreation)(function () {
|
|
120
|
+
return operatorId.detector ? (0, _lodash.last)(context.componentMap.get(operatorId.detector).api.getLevelNodes()) : null;
|
|
121
|
+
}, [operatorId.detector]);
|
|
122
|
+
(0, _ahooks.useEventListener)('mousemove', function (event) {
|
|
123
|
+
var elem = event.target;
|
|
124
|
+
var targetCell = elem.closest(".".concat(_constants.CELL_CLASS_NAME));
|
|
125
|
+
var targetCellId = targetCell === null || targetCell === void 0 ? void 0 : targetCell.id;
|
|
126
|
+
if (targetCellId && targetCellId !== operatorId.detector && targetCellId !== operatorId.selector) {
|
|
127
|
+
setOperatorId({
|
|
128
|
+
detector: targetCellId
|
|
129
|
+
});
|
|
130
|
+
context.$publisher(context.topics.COMPONENT_HOVER, {
|
|
131
|
+
id: targetCellId
|
|
132
|
+
});
|
|
133
|
+
} else if (!targetCell || targetCellId === operatorId.selector) {
|
|
134
|
+
setOperatorId({
|
|
135
|
+
detector: null
|
|
136
|
+
});
|
|
137
|
+
context.$publisher(context.topics.COMPONENT_HOVER, null);
|
|
138
|
+
}
|
|
139
|
+
}, {
|
|
140
|
+
target: target
|
|
141
|
+
});
|
|
142
|
+
(0, _ahooks.useEventListener)('mouseleave', function () {
|
|
143
|
+
if (operatorId.detector) {
|
|
144
|
+
setOperatorId({
|
|
145
|
+
detector: null
|
|
146
|
+
});
|
|
147
|
+
context.$publisher(context.topics.COMPONENT_HOVER, null);
|
|
148
|
+
}
|
|
149
|
+
}, {
|
|
150
|
+
target: target
|
|
151
|
+
});
|
|
152
|
+
(0, _ahooks.useEventListener)('click', function (event) {
|
|
153
|
+
var elem = event.target;
|
|
154
|
+
var targetCell = elem.closest(".".concat(_constants.CELL_CLASS_NAME));
|
|
155
|
+
var targetCellId = targetCell === null || targetCell === void 0 ? void 0 : targetCell.id;
|
|
156
|
+
if (!targetCellId || targetCellId === operatorId.selector) return;
|
|
157
|
+
context.$publisher(context.topics.COMPONENT_HOVER, null);
|
|
158
|
+
context.$publisher(context.topics.COMPONENT_ACTIVE, {
|
|
159
|
+
id: targetCell.id
|
|
160
|
+
});
|
|
161
|
+
}, {
|
|
162
|
+
target: target
|
|
163
|
+
});
|
|
164
|
+
(0, _react.useEffect)(function () {
|
|
165
|
+
var csid = context.$subscriber(context.topics.COMPONENT_SETTING_CLICK).on(function (_ref4) {
|
|
166
|
+
var data = _ref4.data;
|
|
167
|
+
if (_MODAL_COMPONENT_.includes(data.component)) {
|
|
168
|
+
context.$subscriber(context.topics.COMPONENT_APPEND).once(function (_ref5) {
|
|
169
|
+
var compId = _ref5.id;
|
|
170
|
+
context.$publisher(context.topics.COMPONENT_MODAL_TOGGLE, {
|
|
171
|
+
toggle: true,
|
|
172
|
+
id: compId
|
|
173
|
+
});
|
|
174
|
+
context.$publisher(context.topics.COMPONENT_ACTIVE, {
|
|
175
|
+
id: compId
|
|
176
|
+
});
|
|
177
|
+
}).watch();
|
|
178
|
+
addComponent(data, _constants.CELL_KEY.PAGE_ROOT);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if (!lastSelectorId.current) {
|
|
182
|
+
_antd.message.info('请在右侧画布选择节点');
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
if (context.componentMap.get(lastSelectorId.current).dom.getAttribute('name') !== 'box') {
|
|
186
|
+
_antd.message.info('该节点不支持添加子节点');
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
addComponent(data, lastSelectorId.current);
|
|
190
|
+
}).watch();
|
|
191
|
+
var hcid = context.$subscriber(context.topics.COMPONENT_HOVER).on(function (payload) {
|
|
192
|
+
if (payload.id) setOperatorId({
|
|
193
|
+
detector: payload.id
|
|
194
|
+
});else setOperatorId({
|
|
195
|
+
detector: null
|
|
196
|
+
});
|
|
197
|
+
}).watch();
|
|
198
|
+
var acid = context.$subscriber(context.topics.COMPONENT_ACTIVE).on(function (payload) {
|
|
199
|
+
if (payload.id) {
|
|
200
|
+
setOperatorId({
|
|
201
|
+
selector: payload.id,
|
|
202
|
+
detector: null
|
|
203
|
+
});
|
|
204
|
+
} else {
|
|
205
|
+
setOperatorId({
|
|
206
|
+
selector: null
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
}).watch();
|
|
210
|
+
var cmtid = context.$subscriber(context.topics.COMPONENT_MODAL_TOGGLE).on(function (_ref6) {
|
|
211
|
+
var toggle = _ref6.toggle,
|
|
212
|
+
id = _ref6.id;
|
|
213
|
+
if (toggle) {
|
|
214
|
+
target.current.style.setProperty('overflow', 'hidden');
|
|
215
|
+
var _modal = context.componentMap.get(id);
|
|
216
|
+
var _prevModal = currentModal.current ? context.componentMap.get(currentModal.current) : null;
|
|
217
|
+
_prevModal === null || _prevModal === void 0 || _prevModal.api.doClose();
|
|
218
|
+
_modal.api.doOpen();
|
|
219
|
+
currentModal.current = id;
|
|
220
|
+
} else {
|
|
221
|
+
target.current.style.removeProperty('overflow');
|
|
222
|
+
var _modal2 = context.componentMap.get(id || currentModal.current);
|
|
223
|
+
_modal2.api.doClose();
|
|
224
|
+
currentModal.current = void 0;
|
|
225
|
+
}
|
|
226
|
+
}).watch();
|
|
227
|
+
return function () {
|
|
228
|
+
context.$unsubscriber(context.topics.COMPONENT_SETTING_CLICK, csid);
|
|
229
|
+
context.$unsubscriber(context.topics.COMPONENT_HOVER, hcid);
|
|
230
|
+
context.$unsubscriber(context.topics.COMPONENT_ACTIVE, acid);
|
|
231
|
+
context.$unsubscriber(context.topics.MODAL_OPEN, cmtid);
|
|
232
|
+
};
|
|
233
|
+
}, []);
|
|
234
|
+
(0, _react.useEffect)(function () {
|
|
235
|
+
var crid = context.$subscriber(context.topics.COMPONENT_REPOSITIONING).on(function (payload) {
|
|
236
|
+
if (payload.id === operatorId.selector) setPositionKey((0, _utils.suid)());
|
|
237
|
+
}).watch();
|
|
238
|
+
return function () {
|
|
239
|
+
context.$unsubscriber(context.topics.COMPONENT_REPOSITIONING, crid);
|
|
240
|
+
};
|
|
241
|
+
}, [operatorId.selector]);
|
|
242
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, operatorId.detector && /*#__PURE__*/_react.default.createElement("div", {
|
|
243
|
+
id: "lc-detector",
|
|
244
|
+
className: _design.default['lc-painter-design-detector'],
|
|
245
|
+
style: getOperatorStyle(target.current, getDomById(operatorId.detector))
|
|
246
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
247
|
+
className: _design.default['lc-painter-design-detector-name'],
|
|
248
|
+
style: {
|
|
249
|
+
top: ((_getDomById = getDomById(operatorId.detector)) === null || _getDomById === void 0 ? void 0 : _getDomById.offsetTop) < 23 ? 0 : '-23px'
|
|
250
|
+
}
|
|
251
|
+
}, lastDetectorNode ? "".concat(lastDetectorNode.name, "(").concat(operatorId.detector, ")") : null)), operatorId.selector && /*#__PURE__*/_react.default.createElement("div", {
|
|
252
|
+
id: "lc-selector",
|
|
253
|
+
key: "".concat((size === null || size === void 0 ? void 0 : size.width) || 0, "-").concat((size === null || size === void 0 ? void 0 : size.height) || 0, "-").concat(positionKey),
|
|
254
|
+
className: _design.default['lc-painter-design-selector'],
|
|
255
|
+
style: getOperatorStyle(target.current, getDomById(operatorId.selector))
|
|
256
|
+
}, acticeProps && /*#__PURE__*/_react.default.createElement("div", {
|
|
257
|
+
className: _design.default['lc-borders-actions'],
|
|
258
|
+
style: acticeProps.props.id === _constants.CELL_KEY.PAGE_ROOT ? {
|
|
259
|
+
top: 0
|
|
260
|
+
} : ((_getDomById2 = getDomById(operatorId.selector)) === null || _getDomById2 === void 0 ? void 0 : _getDomById2.offsetTop) < 23 ? {
|
|
261
|
+
bottom: '-23px'
|
|
262
|
+
} : {
|
|
263
|
+
top: '-23px'
|
|
264
|
+
}
|
|
265
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Dropdown, {
|
|
266
|
+
overlay: acticeProps.menu,
|
|
267
|
+
placement: "bottomLeft"
|
|
268
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
269
|
+
className: "instance-node-selector"
|
|
270
|
+
}, acticeProps.props.name)), /*#__PURE__*/_react.default.createElement("div", {
|
|
271
|
+
onClick: function onClick() {
|
|
272
|
+
return handleDelete(acticeProps.props);
|
|
273
|
+
}
|
|
274
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
275
|
+
type: "delete"
|
|
276
|
+
})))));
|
|
277
|
+
};
|
|
278
|
+
var _default = exports.default = DesignOperator;
|