@luck-design-biz/luckda 0.0.23 → 0.0.24-2
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/es/components/Builder/index.js +6 -4
- package/es/components/LdFormList/index.js +1 -4
- package/es/components/LdGrid/index.js +12 -3
- package/es/lowcode/constants/api-url.js +292 -1
- package/es/lowcode/constants/event-topics.js +14 -1
- package/es/lowcode/engine/factory/panel-item-factory/DynamicStrategy.js +60 -0
- package/es/lowcode/engine/factory/panel-item-factory/GroupStrategy.js +32 -0
- package/es/lowcode/engine/factory/panel-item-factory/NumberStrategy.js +32 -0
- package/es/lowcode/engine/factory/panel-item-factory/SegmentedStrategy.js +32 -0
- package/es/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +53 -0
- package/es/lowcode/engine/factory/panel-item-factory/Strategy.js +21 -0
- package/es/lowcode/engine/factory/panel-item-factory/StringStrategy.js +51 -0
- package/es/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +42 -0
- package/es/lowcode/engine/factory/panel-item-factory/index.js +44 -0
- package/es/lowcode/engine/meta/box.props.default.json +12 -0
- package/es/lowcode/engine/meta/box.props.json +42 -0
- package/es/lowcode/engine/meta/button.props.default.json +15 -7
- package/es/lowcode/engine/meta/{components/button.json → button.props.json} +126 -103
- package/es/lowcode/engine/meta/cardlist.props.default.json +17 -9
- package/es/lowcode/engine/meta/{components/card-list.json → cardlist.props.json} +143 -142
- package/es/lowcode/engine/meta/components-list.json +127 -121
- package/es/lowcode/engine/meta/dialog.props.default.json +19 -0
- package/{lib/lowcode/engine/meta/components/modal.json → es/lowcode/engine/meta/dialog.props.json} +120 -119
- package/es/lowcode/engine/meta/drawer.props.default.json +17 -9
- package/{lib/lowcode/engine/meta/components/drawer.json → es/lowcode/engine/meta/drawer.props.json} +143 -142
- package/es/lowcode/engine/meta/form.props.default.json +12 -4
- package/{lib/lowcode/engine/meta/components/form.json → es/lowcode/engine/meta/form.props.json} +116 -115
- package/es/lowcode/engine/meta/iframe.props.default.json +10 -2
- package/es/lowcode/engine/meta/{components/iframe.json → iframe.props.json} +31 -30
- package/es/lowcode/engine/meta/image.props.default.json +15 -7
- package/es/lowcode/engine/meta/{components/image.json → image.props.json} +113 -112
- package/es/lowcode/engine/meta/imex.props.default.json +11 -3
- package/{lib/lowcode/engine/meta/components/imex.json → es/lowcode/engine/meta/imex.props.json} +81 -80
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +29 -0
- package/es/lowcode/engine/meta/jsx.props.default.json +10 -1
- package/es/lowcode/engine/meta/{components/jsx.json → jsx.props.json} +24 -23
- package/es/lowcode/engine/meta/layout.props.default.json +12 -4
- package/{lib/lowcode/engine/meta/components/layout.json → es/lowcode/engine/meta/layout.props.json} +107 -106
- package/es/lowcode/engine/meta/link.props.default.json +13 -5
- package/{lib/lowcode/engine/meta/components/link.json → es/lowcode/engine/meta/link.props.json} +111 -110
- package/es/lowcode/engine/meta/section.props.default.json +16 -8
- package/{lib/lowcode/engine/meta/components/section.json → es/lowcode/engine/meta/section.props.json} +107 -106
- package/es/lowcode/engine/meta/split.props.default.json +12 -4
- package/es/lowcode/engine/meta/{components/split.json → split.props.json} +71 -70
- package/es/lowcode/engine/meta/table.props.default.json +29 -9
- package/es/lowcode/engine/meta/table.props.json +236 -0
- package/es/lowcode/engine/meta/tabs.props.default.json +17 -9
- package/es/lowcode/engine/meta/{components/tabs.json → tabs.props.json} +140 -139
- package/es/lowcode/engine/meta/text.props.default.json +11 -3
- package/{lib/lowcode/engine/meta/components/text.json → es/lowcode/engine/meta/text.props.json} +65 -64
- package/es/lowcode/engine/meta/tree.props.default.json +16 -8
- package/es/lowcode/engine/meta/{components/tree.json → tree.props.json} +156 -155
- package/es/lowcode/engine/provider/ContextProvider.js +46 -41
- package/es/lowcode/engine/provider/EventBusProvider.js +2 -2
- package/es/lowcode/engine/tools/dataProcess.js +85 -8
- package/es/lowcode/engine/tools/helper.js +68 -0
- package/es/lowcode/engine/tools/usePromiseState.js +24 -0
- package/es/lowcode/index.js +3 -1
- package/es/lowcode/painter/Design.js +40 -85
- package/es/lowcode/painter/DesignOperator.js +271 -0
- package/es/lowcode/painter/DesignToolbar.js +91 -0
- package/es/lowcode/painter/I18n.js +202 -2
- package/es/lowcode/painter/Outline.js +63 -54
- package/es/lowcode/painter/Panel.js +239 -2
- package/es/lowcode/painter/Ribbon.js +61 -55
- package/es/lowcode/painter/components/Collapse.js +90 -0
- package/es/lowcode/painter/components/ColorInput.js +125 -0
- package/es/lowcode/painter/components/ListEditor.js +89 -0
- package/es/lowcode/painter/components/NumberInput.js +148 -0
- package/es/lowcode/painter/components/PanelItem.js +83 -11
- package/es/lowcode/painter/components/PopConfirm.js +23 -0
- package/es/lowcode/painter/components/PopForm.js +71 -0
- package/es/lowcode/painter/components/RuleInput.js +9 -7
- package/es/lowcode/painter/components/SortBox.js +92 -0
- package/es/lowcode/painter/components/actions-editor/ActionEditor.js +147 -0
- package/es/lowcode/painter/components/actions-editor/index.js +170 -0
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +96 -0
- package/es/lowcode/painter/components/code-editor/CssEditor.js +41 -0
- package/es/lowcode/painter/components/code-editor/FullScreenEditor.js +87 -0
- package/es/lowcode/painter/components/code-editor/JSEditor.js +106 -0
- package/es/lowcode/painter/components/code-editor/index.js +2 -0
- package/es/lowcode/painter/index.js +33 -3
- package/es/lowcode/painter/panel-section/ButtonType.js +39 -0
- package/es/lowcode/painter/panel-section/DataSetSelector.js +61 -0
- package/es/lowcode/painter/panel-section/Icon.js +48 -0
- package/es/lowcode/painter/panel-section/IconSelector.js +134 -0
- package/es/lowcode/painter/panel-section/LayoutRatio.js +57 -49
- 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 +296 -0
- package/es/lowcode/painter/panel-section/StylePanel/DisplaySvg.js +543 -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 +96 -0
- 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 +148 -0
- package/es/lowcode/painter/panel-section/StylePanel/StyleRow.js +16 -0
- package/es/lowcode/painter/panel-section/StylePanel/WidthHeight.js +51 -0
- package/es/lowcode/painter/panel-section/StylePanel/index.js +29 -0
- package/es/lowcode/painter/panel-section/TabItems.js +207 -0
- package/es/lowcode/painter/panel-section/TableActions.js +19 -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 +85 -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 +5 -0
- package/es/lowcode/painter/style/collapse.less +22 -0
- package/es/lowcode/painter/style/color-input.less +19 -0
- package/es/lowcode/painter/style/design.less +116 -5
- package/es/lowcode/painter/style/display.less +17 -0
- package/es/lowcode/painter/style/font-editor.less +9 -0
- package/es/lowcode/painter/style/fullscreen-editor.less +17 -0
- package/es/lowcode/painter/style/icon-selector.less +22 -0
- package/es/lowcode/painter/style/icon.less +11 -0
- package/es/lowcode/painter/style/index.less +0 -1
- package/es/lowcode/painter/style/layout-ratio.less +1 -1
- package/es/lowcode/painter/style/list-editor.less +59 -0
- package/es/lowcode/painter/style/number-input.less +17 -0
- package/es/lowcode/painter/style/outline.less +2 -0
- package/es/lowcode/painter/style/panel-item.less +45 -12
- package/es/lowcode/painter/style/panel.less +124 -0
- package/es/lowcode/painter/style/pop-confirm.less +10 -0
- package/es/lowcode/painter/style/pop-form.less +20 -0
- package/es/lowcode/painter/style/ribbon.less +1 -0
- package/es/lowcode/painter/style/style-panel.less +37 -0
- package/es/lowcode/painter/style/tabitems.less +90 -0
- package/es/lowcode/view/Canvas.js +79 -70
- package/es/lowcode/view/Page.js +10 -28
- package/es/lowcode/view/index.js +5 -6
- package/es/lowcode/view/lc-components/Box/FunctionDesign.js +20 -0
- package/es/lowcode/view/lc-components/Box/FunctionLive.js +9 -0
- package/es/lowcode/view/lc-components/Box/index.js +22 -5
- package/es/lowcode/view/lc-components/Box/index.less +15 -0
- package/es/lowcode/view/lc-components/Box/meta.json +42 -0
- package/es/lowcode/view/lc-components/Button/FunctionDesign.js +21 -0
- package/es/lowcode/view/lc-components/Button/FunctionLive.js +9 -0
- package/es/lowcode/view/lc-components/Button/index.js +75 -7
- package/es/lowcode/view/lc-components/Button/meta.json +127 -0
- package/es/lowcode/view/lc-components/Button/style.less +3 -0
- package/es/lowcode/view/lc-components/CardList/FunctionDesign.js +9 -0
- package/es/lowcode/view/lc-components/CardList/FunctionLive.js +9 -0
- package/{lib/lowcode/engine/meta/components/table.json → es/lowcode/view/lc-components/CardList/meta.json} +11 -28
- package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +54 -0
- package/es/lowcode/view/lc-components/Dialog/FunctionLive.js +9 -0
- package/es/lowcode/view/lc-components/Dialog/index.js +20 -11
- package/es/lowcode/view/lc-components/Dialog/index.less +1 -1
- package/es/lowcode/view/lc-components/Dialog/meta.json +121 -0
- package/es/lowcode/view/lc-components/Drawer/FunctionDesign.js +20 -0
- package/es/lowcode/view/lc-components/Drawer/FunctionLive.js +9 -0
- package/es/lowcode/view/lc-components/Drawer/index.js +22 -9
- package/es/lowcode/view/lc-components/Drawer/index.less +7 -0
- package/es/lowcode/view/lc-components/Drawer/meta.json +144 -0
- package/es/lowcode/view/lc-components/Form/FunctionDesign.js +9 -0
- package/es/lowcode/view/lc-components/Form/FunctionLive.js +9 -0
- package/es/lowcode/view/lc-components/Form/meta.json +117 -0
- package/es/lowcode/view/lc-components/Iframe/FunctionDesign.js +9 -0
- package/es/lowcode/view/lc-components/Iframe/FunctionLive.js +9 -0
- package/es/lowcode/view/lc-components/Iframe/meta.json +32 -0
- package/es/lowcode/view/lc-components/ImEx/FunctionDesign.js +9 -0
- package/es/lowcode/view/lc-components/ImEx/FunctionLive.js +9 -0
- package/es/lowcode/view/lc-components/ImEx/meta.json +82 -0
- package/es/lowcode/view/lc-components/Image/FunctionDesign.js +9 -0
- package/es/lowcode/view/lc-components/Image/FunctionLive.js +9 -0
- package/es/lowcode/view/lc-components/Image/meta.json +114 -0
- package/es/lowcode/view/lc-components/JSX/FunctionDesign.js +9 -0
- package/es/lowcode/view/lc-components/JSX/FunctionLive.js +9 -0
- package/es/lowcode/view/lc-components/JSX/meta.json +25 -0
- package/es/lowcode/view/lc-components/Layout/FunctionDesign.js +75 -0
- package/es/lowcode/view/lc-components/Layout/FunctionLive.js +15 -0
- package/es/lowcode/view/lc-components/Layout/index.js +40 -7
- package/es/lowcode/view/lc-components/Layout/index.less +5 -0
- package/es/lowcode/view/lc-components/Layout/meta.json +108 -0
- package/es/lowcode/view/lc-components/Link/FunctionDesign.js +9 -0
- package/es/lowcode/view/lc-components/Link/FunctionLive.js +9 -0
- package/es/lowcode/view/lc-components/Link/meta.json +112 -0
- package/es/lowcode/view/lc-components/Section/FunctionDesign.js +9 -0
- package/es/lowcode/view/lc-components/Section/FunctionLive.js +9 -0
- package/es/lowcode/view/lc-components/Section/meta.json +108 -0
- package/es/lowcode/view/lc-components/Split/FunctionDesign.js +9 -0
- package/es/lowcode/view/lc-components/Split/FunctionLive.js +9 -0
- package/es/lowcode/view/lc-components/Split/meta.json +72 -0
- package/es/lowcode/view/lc-components/Table/FunctionDesign.js +18 -0
- package/es/lowcode/view/lc-components/Table/FunctionLive.js +9 -0
- package/es/lowcode/view/lc-components/Table/index.js +229 -9
- package/es/lowcode/view/lc-components/Table/meta.json +225 -0
- package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +9 -0
- package/es/lowcode/view/lc-components/Tabs/FunctionLive.js +9 -0
- package/es/lowcode/view/lc-components/Tabs/meta.json +141 -0
- package/es/lowcode/view/lc-components/Text/FunctionDesign.js +9 -0
- package/es/lowcode/view/lc-components/Text/FunctionLive.js +9 -0
- package/es/lowcode/view/lc-components/Text/meta.json +66 -0
- package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +9 -0
- package/es/lowcode/view/lc-components/Tree/FunctionLive.js +9 -0
- package/es/lowcode/view/lc-components/Tree/meta.json +157 -0
- package/es/lowcode/view/lc-components/Wrapper.js +32 -23
- package/es/lowcode/view/style/page.less +0 -1
- package/es/upload/Form/gridForm.js +1 -1
- package/es/utils/grid.js +4 -3
- package/lib/components/Builder/index.js +5 -3
- package/lib/components/LdFormList/index.js +1 -5
- package/lib/components/LdGrid/index.js +12 -3
- package/lib/lowcode/constants/api-url.js +294 -2
- package/lib/lowcode/constants/event-topics.js +15 -2
- package/lib/lowcode/engine/factory/panel-item-factory/DynamicStrategy.js +73 -0
- package/lib/lowcode/engine/factory/panel-item-factory/GroupStrategy.js +38 -0
- package/lib/lowcode/engine/factory/panel-item-factory/NumberStrategy.js +38 -0
- package/lib/lowcode/engine/factory/panel-item-factory/SegmentedStrategy.js +38 -0
- package/lib/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +59 -0
- package/lib/lowcode/engine/factory/panel-item-factory/Strategy.js +27 -0
- package/lib/lowcode/engine/factory/panel-item-factory/StringStrategy.js +57 -0
- package/lib/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +48 -0
- package/lib/lowcode/engine/factory/panel-item-factory/index.js +50 -0
- package/lib/lowcode/engine/meta/box.props.default.json +12 -0
- package/lib/lowcode/engine/meta/box.props.json +42 -0
- package/lib/lowcode/engine/meta/button.props.default.json +15 -7
- package/lib/lowcode/engine/meta/{components/button.json → button.props.json} +126 -103
- package/lib/lowcode/engine/meta/cardlist.props.default.json +17 -9
- package/lib/lowcode/engine/meta/{components/card-list.json → cardlist.props.json} +143 -142
- package/lib/lowcode/engine/meta/components-list.json +127 -121
- package/lib/lowcode/engine/meta/dialog.props.default.json +19 -0
- package/{es/lowcode/engine/meta/components/modal.json → lib/lowcode/engine/meta/dialog.props.json} +120 -119
- package/lib/lowcode/engine/meta/drawer.props.default.json +17 -9
- package/{es/lowcode/engine/meta/components/drawer.json → lib/lowcode/engine/meta/drawer.props.json} +143 -142
- package/lib/lowcode/engine/meta/form.props.default.json +12 -4
- package/{es/lowcode/engine/meta/components/form.json → lib/lowcode/engine/meta/form.props.json} +116 -115
- package/lib/lowcode/engine/meta/iframe.props.default.json +10 -2
- package/lib/lowcode/engine/meta/{components/iframe.json → iframe.props.json} +31 -30
- package/lib/lowcode/engine/meta/image.props.default.json +15 -7
- package/lib/lowcode/engine/meta/{components/image.json → image.props.json} +113 -112
- package/lib/lowcode/engine/meta/imex.props.default.json +11 -3
- package/{es/lowcode/engine/meta/components/imex.json → lib/lowcode/engine/meta/imex.props.json} +81 -80
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +29 -0
- package/lib/lowcode/engine/meta/jsx.props.default.json +10 -1
- package/lib/lowcode/engine/meta/{components/jsx.json → jsx.props.json} +24 -23
- package/lib/lowcode/engine/meta/layout.props.default.json +12 -4
- package/{es/lowcode/engine/meta/components/layout.json → lib/lowcode/engine/meta/layout.props.json} +107 -106
- package/lib/lowcode/engine/meta/link.props.default.json +13 -5
- package/{es/lowcode/engine/meta/components/link.json → lib/lowcode/engine/meta/link.props.json} +111 -110
- package/lib/lowcode/engine/meta/section.props.default.json +16 -8
- package/{es/lowcode/engine/meta/components/section.json → lib/lowcode/engine/meta/section.props.json} +107 -106
- package/lib/lowcode/engine/meta/split.props.default.json +12 -4
- package/lib/lowcode/engine/meta/{components/split.json → split.props.json} +71 -70
- package/lib/lowcode/engine/meta/table.props.default.json +29 -9
- package/lib/lowcode/engine/meta/table.props.json +236 -0
- package/lib/lowcode/engine/meta/tabs.props.default.json +17 -9
- package/lib/lowcode/engine/meta/{components/tabs.json → tabs.props.json} +140 -139
- package/lib/lowcode/engine/meta/text.props.default.json +11 -3
- package/{es/lowcode/engine/meta/components/text.json → lib/lowcode/engine/meta/text.props.json} +65 -64
- package/lib/lowcode/engine/meta/tree.props.default.json +16 -8
- package/lib/lowcode/engine/meta/{components/tree.json → tree.props.json} +156 -155
- package/lib/lowcode/engine/provider/ContextProvider.js +46 -41
- package/lib/lowcode/engine/provider/EventBusProvider.js +2 -2
- package/lib/lowcode/engine/tools/dataProcess.js +86 -8
- package/lib/lowcode/engine/tools/helper.js +70 -0
- package/lib/lowcode/engine/tools/usePromiseState.js +31 -0
- package/lib/lowcode/index.js +5 -1
- package/lib/lowcode/painter/Design.js +39 -84
- package/lib/lowcode/painter/DesignOperator.js +278 -0
- package/lib/lowcode/painter/DesignToolbar.js +99 -0
- package/lib/lowcode/painter/I18n.js +203 -2
- package/lib/lowcode/painter/Outline.js +62 -53
- package/lib/lowcode/painter/Panel.js +238 -1
- package/lib/lowcode/painter/Ribbon.js +63 -64
- package/lib/lowcode/painter/components/Collapse.js +97 -0
- package/lib/lowcode/painter/components/ColorInput.js +132 -0
- package/lib/lowcode/painter/components/ListEditor.js +95 -0
- package/lib/lowcode/painter/components/NumberInput.js +155 -0
- package/lib/lowcode/painter/components/PanelItem.js +84 -11
- package/lib/lowcode/painter/components/PopConfirm.js +29 -0
- package/lib/lowcode/painter/components/PopForm.js +77 -0
- package/lib/lowcode/painter/components/RuleInput.js +9 -7
- package/lib/lowcode/painter/components/SortBox.js +99 -0
- package/lib/lowcode/painter/components/actions-editor/ActionEditor.js +155 -0
- package/lib/lowcode/painter/components/actions-editor/index.js +178 -0
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +103 -0
- package/lib/lowcode/painter/components/code-editor/CssEditor.js +48 -0
- package/lib/lowcode/painter/components/code-editor/FullScreenEditor.js +94 -0
- package/lib/lowcode/painter/components/code-editor/JSEditor.js +117 -0
- package/lib/lowcode/painter/components/code-editor/index.js +20 -0
- package/lib/lowcode/painter/index.js +35 -3
- package/lib/lowcode/painter/panel-section/ButtonType.js +46 -0
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +69 -0
- package/lib/lowcode/painter/panel-section/Icon.js +54 -0
- package/lib/lowcode/painter/panel-section/IconSelector.js +141 -0
- package/lib/lowcode/painter/panel-section/LayoutRatio.js +56 -48
- 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 +303 -0
- package/lib/lowcode/painter/panel-section/StylePanel/DisplaySvg.js +550 -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 +103 -0
- 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/Size.js +59 -0
- package/lib/lowcode/painter/panel-section/StylePanel/StyleContext.js +159 -0
- package/lib/lowcode/painter/panel-section/StylePanel/StyleRow.js +22 -0
- package/lib/lowcode/painter/panel-section/StylePanel/WidthHeight.js +58 -0
- package/lib/lowcode/painter/panel-section/StylePanel/index.js +35 -0
- package/lib/lowcode/painter/panel-section/TabItems.js +215 -0
- package/lib/lowcode/painter/panel-section/TableActions.js +26 -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 +95 -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 +5 -0
- package/lib/lowcode/painter/style/collapse.less +22 -0
- package/lib/lowcode/painter/style/color-input.less +19 -0
- package/lib/lowcode/painter/style/design.less +116 -5
- package/lib/lowcode/painter/style/display.less +17 -0
- package/lib/lowcode/painter/style/font-editor.less +9 -0
- package/lib/lowcode/painter/style/fullscreen-editor.less +17 -0
- package/lib/lowcode/painter/style/icon-selector.less +22 -0
- package/lib/lowcode/painter/style/icon.less +11 -0
- package/lib/lowcode/painter/style/index.less +0 -1
- package/lib/lowcode/painter/style/layout-ratio.less +1 -1
- package/lib/lowcode/painter/style/list-editor.less +59 -0
- package/lib/lowcode/painter/style/number-input.less +17 -0
- package/lib/lowcode/painter/style/outline.less +2 -0
- package/lib/lowcode/painter/style/panel-item.less +45 -12
- package/lib/lowcode/painter/style/panel.less +124 -0
- package/lib/lowcode/painter/style/pop-confirm.less +10 -0
- package/lib/lowcode/painter/style/pop-form.less +20 -0
- package/lib/lowcode/painter/style/ribbon.less +1 -0
- package/lib/lowcode/painter/style/style-panel.less +37 -0
- package/lib/lowcode/painter/style/tabitems.less +90 -0
- package/lib/lowcode/view/Canvas.js +84 -75
- package/lib/lowcode/view/Page.js +9 -27
- package/lib/lowcode/view/index.js +5 -6
- package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +27 -0
- package/lib/lowcode/view/lc-components/Box/FunctionLive.js +16 -0
- package/lib/lowcode/view/lc-components/Box/index.js +23 -6
- package/lib/lowcode/view/lc-components/Box/index.less +15 -0
- package/lib/lowcode/view/lc-components/Box/meta.json +42 -0
- package/lib/lowcode/view/lc-components/Button/FunctionDesign.js +28 -0
- package/lib/lowcode/view/lc-components/Button/FunctionLive.js +16 -0
- package/lib/lowcode/view/lc-components/Button/index.js +76 -8
- package/lib/lowcode/view/lc-components/Button/meta.json +127 -0
- package/lib/lowcode/view/lc-components/Button/style.less +3 -0
- package/lib/lowcode/view/lc-components/CardList/FunctionDesign.js +16 -0
- package/lib/lowcode/view/lc-components/CardList/FunctionLive.js +16 -0
- package/{es/lowcode/engine/meta/components/table.json → lib/lowcode/view/lc-components/CardList/meta.json} +11 -28
- package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +62 -0
- package/lib/lowcode/view/lc-components/Dialog/FunctionLive.js +16 -0
- package/lib/lowcode/view/lc-components/Dialog/index.js +20 -11
- package/lib/lowcode/view/lc-components/Dialog/index.less +1 -1
- package/lib/lowcode/view/lc-components/Dialog/meta.json +121 -0
- package/lib/lowcode/view/lc-components/Drawer/FunctionDesign.js +27 -0
- package/lib/lowcode/view/lc-components/Drawer/FunctionLive.js +16 -0
- package/lib/lowcode/view/lc-components/Drawer/index.js +22 -9
- package/lib/lowcode/view/lc-components/Drawer/index.less +7 -0
- package/lib/lowcode/view/lc-components/Drawer/meta.json +144 -0
- package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +16 -0
- package/lib/lowcode/view/lc-components/Form/FunctionLive.js +16 -0
- package/lib/lowcode/view/lc-components/Form/meta.json +117 -0
- package/lib/lowcode/view/lc-components/Iframe/FunctionDesign.js +16 -0
- package/lib/lowcode/view/lc-components/Iframe/FunctionLive.js +16 -0
- package/lib/lowcode/view/lc-components/Iframe/meta.json +32 -0
- package/lib/lowcode/view/lc-components/ImEx/FunctionDesign.js +16 -0
- package/lib/lowcode/view/lc-components/ImEx/FunctionLive.js +16 -0
- package/lib/lowcode/view/lc-components/ImEx/meta.json +82 -0
- package/lib/lowcode/view/lc-components/Image/FunctionDesign.js +16 -0
- package/lib/lowcode/view/lc-components/Image/FunctionLive.js +16 -0
- package/lib/lowcode/view/lc-components/Image/meta.json +114 -0
- package/lib/lowcode/view/lc-components/JSX/FunctionDesign.js +16 -0
- package/lib/lowcode/view/lc-components/JSX/FunctionLive.js +16 -0
- package/lib/lowcode/view/lc-components/JSX/meta.json +25 -0
- package/lib/lowcode/view/lc-components/Layout/FunctionDesign.js +82 -0
- package/lib/lowcode/view/lc-components/Layout/FunctionLive.js +22 -0
- package/lib/lowcode/view/lc-components/Layout/index.js +41 -8
- package/lib/lowcode/view/lc-components/Layout/index.less +5 -0
- package/lib/lowcode/view/lc-components/Layout/meta.json +108 -0
- package/lib/lowcode/view/lc-components/Link/FunctionDesign.js +16 -0
- package/lib/lowcode/view/lc-components/Link/FunctionLive.js +16 -0
- package/lib/lowcode/view/lc-components/Link/meta.json +112 -0
- package/lib/lowcode/view/lc-components/Section/FunctionDesign.js +16 -0
- package/lib/lowcode/view/lc-components/Section/FunctionLive.js +16 -0
- package/lib/lowcode/view/lc-components/Section/meta.json +108 -0
- package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +16 -0
- package/lib/lowcode/view/lc-components/Split/FunctionLive.js +16 -0
- package/lib/lowcode/view/lc-components/Split/meta.json +72 -0
- package/lib/lowcode/view/lc-components/Table/FunctionDesign.js +25 -0
- package/lib/lowcode/view/lc-components/Table/FunctionLive.js +16 -0
- package/lib/lowcode/view/lc-components/Table/index.js +228 -8
- package/lib/lowcode/view/lc-components/Table/meta.json +225 -0
- package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +16 -0
- package/lib/lowcode/view/lc-components/Tabs/FunctionLive.js +16 -0
- package/lib/lowcode/view/lc-components/Tabs/meta.json +141 -0
- package/lib/lowcode/view/lc-components/Text/FunctionDesign.js +16 -0
- package/lib/lowcode/view/lc-components/Text/FunctionLive.js +16 -0
- package/lib/lowcode/view/lc-components/Text/meta.json +66 -0
- package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +16 -0
- package/lib/lowcode/view/lc-components/Tree/FunctionLive.js +16 -0
- package/lib/lowcode/view/lc-components/Tree/meta.json +157 -0
- package/lib/lowcode/view/lc-components/Wrapper.js +30 -21
- package/lib/lowcode/view/style/page.less +0 -1
- package/lib/upload/Form/gridForm.js +1 -1
- package/lib/utils/grid.js +6 -5
- package/package.json +15 -6
- package/es/lowcode/engine/meta/modal.props.default.json +0 -11
- package/es/lowcode/engine/tools/lcid.js +0 -16
- package/es/lowcode/painter/panel-section/Radio.js +0 -58
- package/lib/lowcode/engine/meta/modal.props.default.json +0 -11
- package/lib/lowcode/engine/tools/lcid.js +0 -22
- package/lib/lowcode/painter/panel-section/Radio.js +0 -65
|
@@ -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;
|
|
@@ -0,0 +1,99 @@
|
|
|
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 _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
var _antd = require("luck-design/antd");
|
|
14
|
+
var _ContextProvider = require("../engine/provider/ContextProvider");
|
|
15
|
+
var _constants = require("../constants");
|
|
16
|
+
var _design = _interopRequireDefault(require("./style/design.less"));
|
|
17
|
+
var DesignToolbar = function DesignToolbar(_ref) {
|
|
18
|
+
var locale = _ref.locale,
|
|
19
|
+
onLangChange = _ref.onLangChange;
|
|
20
|
+
var context = (0, _ContextProvider.useLDContext)();
|
|
21
|
+
var _useState = (0, _react.useState)(null),
|
|
22
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
23
|
+
langList = _useState2[0],
|
|
24
|
+
setLangList = _useState2[1];
|
|
25
|
+
var _useState3 = (0, _react.useState)('pc'),
|
|
26
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
27
|
+
activedTarget = _useState4[0],
|
|
28
|
+
setActivedTarget = _useState4[1];
|
|
29
|
+
(0, _react.useEffect)(function () {
|
|
30
|
+
var topicId = context.$subscriber(context.topics.LANG_SETTING_SELECT).on(function (_ref2) {
|
|
31
|
+
var _langList = _ref2.langList;
|
|
32
|
+
return setLangList(_langList);
|
|
33
|
+
}).watch();
|
|
34
|
+
return function () {
|
|
35
|
+
return context.$unsubscriber(context.topics.LANG_SETTING_SELECT, topicId);
|
|
36
|
+
};
|
|
37
|
+
}, []);
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
39
|
+
className: _design.default['lc-painter-design-toolbar']
|
|
40
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Select, {
|
|
41
|
+
size: "small",
|
|
42
|
+
value: langList ? locale : undefined,
|
|
43
|
+
className: _design.default['i18n-selecter'],
|
|
44
|
+
style: {
|
|
45
|
+
fontSize: 12
|
|
46
|
+
},
|
|
47
|
+
onSelect: onLangChange
|
|
48
|
+
}, langList === null || langList === void 0 ? void 0 : langList.map(function (item) {
|
|
49
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Select.Option, {
|
|
50
|
+
key: item.field,
|
|
51
|
+
value: item.field
|
|
52
|
+
}, item.title);
|
|
53
|
+
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
54
|
+
className: (0, _classnames.default)(_design.default['toolbar-item'], (0, _defineProperty2.default)({}, _design.default.actived, activedTarget === 'pc')),
|
|
55
|
+
onClick: function onClick() {
|
|
56
|
+
return setActivedTarget('pc');
|
|
57
|
+
}
|
|
58
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
59
|
+
type: "laptop"
|
|
60
|
+
})), /*#__PURE__*/_react.default.createElement("span", {
|
|
61
|
+
className: (0, _classnames.default)(_design.default['toolbar-item'], (0, _defineProperty2.default)({}, _design.default.actived, activedTarget === 'mobile')),
|
|
62
|
+
onClick: function onClick() {
|
|
63
|
+
return setActivedTarget('mobile');
|
|
64
|
+
}
|
|
65
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
66
|
+
type: "mobile"
|
|
67
|
+
})), /*#__PURE__*/_react.default.createElement(_antd.Divider, {
|
|
68
|
+
type: "vertical"
|
|
69
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
70
|
+
style: {
|
|
71
|
+
width: 'auto',
|
|
72
|
+
fontSize: 12
|
|
73
|
+
},
|
|
74
|
+
className: _design.default['toolbar-item'],
|
|
75
|
+
onClick: function onClick() {
|
|
76
|
+
context.$publisher(context.topics.COMPONENT_ACTIVE, {
|
|
77
|
+
id: _constants.CELL_KEY.PAGE_ROOT
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}, "\u9875\u9762\u5C5E\u6027"), /*#__PURE__*/_react.default.createElement(_antd.Divider, {
|
|
81
|
+
type: "vertical"
|
|
82
|
+
}), /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
83
|
+
size: "small",
|
|
84
|
+
style: {
|
|
85
|
+
fontSize: 12,
|
|
86
|
+
margin: '0 2px'
|
|
87
|
+
}
|
|
88
|
+
}, "\u9884\u89C8"), /*#__PURE__*/_react.default.createElement(_antd.Divider, {
|
|
89
|
+
type: "vertical"
|
|
90
|
+
}), /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
91
|
+
size: "small",
|
|
92
|
+
type: "primary",
|
|
93
|
+
style: {
|
|
94
|
+
fontSize: 12,
|
|
95
|
+
margin: '0 0 0 2px'
|
|
96
|
+
}
|
|
97
|
+
}, "\u4FDD\u5B58"));
|
|
98
|
+
};
|
|
99
|
+
var _default = exports.default = DesignToolbar;
|
|
@@ -1,12 +1,213 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
8
|
-
var
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
11
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
var _umi = require("umi");
|
|
16
|
+
var _ahooks = require("ahooks");
|
|
17
|
+
var _luckDesign = require("luck-design");
|
|
18
|
+
var _lodash = require("lodash");
|
|
19
|
+
var _antd = require("luck-design/antd");
|
|
20
|
+
var _utils = require("@luck-design-biz/base/utils");
|
|
21
|
+
var _ContextProvider = require("../engine/provider/ContextProvider");
|
|
22
|
+
var _I18n = require("./services/I18n");
|
|
23
|
+
var _getDvaApp;
|
|
24
|
+
var Search = _antd.Input.Search;
|
|
25
|
+
var _getDvaApp$_store = (_getDvaApp = (0, _umi.getDvaApp)()) === null || _getDvaApp === void 0 ? void 0 : _getDvaApp._store,
|
|
26
|
+
dispatch = _getDvaApp$_store.dispatch;
|
|
27
|
+
var getLangKey = function getLangKey() {
|
|
28
|
+
return "app.lowcode.".concat((0, _utils.suid)());
|
|
29
|
+
};
|
|
30
|
+
var formatDataFunc = function formatDataFunc(data) {
|
|
31
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, data), (0, _lodash.reduce)(data.languages, function (ret, value, key) {
|
|
32
|
+
ret[key] = value;
|
|
33
|
+
return ret;
|
|
34
|
+
}, {}));
|
|
35
|
+
};
|
|
9
36
|
var I18n = function I18n() {
|
|
10
|
-
|
|
37
|
+
var context = (0, _ContextProvider.useLDContext)();
|
|
38
|
+
var _useState = (0, _react.useState)([]),
|
|
39
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
40
|
+
langList = _useState2[0],
|
|
41
|
+
setLangList = _useState2[1];
|
|
42
|
+
var _useState3 = (0, _react.useState)([]),
|
|
43
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
44
|
+
dataSource = _useState4[0],
|
|
45
|
+
setDataSource = _useState4[1];
|
|
46
|
+
(0, _ahooks.useAsyncEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
47
|
+
var _langList;
|
|
48
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
49
|
+
while (1) switch (_context.prev = _context.next) {
|
|
50
|
+
case 0:
|
|
51
|
+
_context.next = 2;
|
|
52
|
+
return dispatch({
|
|
53
|
+
type: 'global/getDatadic',
|
|
54
|
+
payload: {
|
|
55
|
+
snamealias: 'base_lang'
|
|
56
|
+
},
|
|
57
|
+
format: function format(list, detail) {
|
|
58
|
+
return list.map(function (id) {
|
|
59
|
+
return {
|
|
60
|
+
title: detail[id].sname,
|
|
61
|
+
field: detail[id].sfactvalue,
|
|
62
|
+
editable: true,
|
|
63
|
+
filter: false
|
|
64
|
+
};
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
case 2:
|
|
69
|
+
_langList = _context.sent;
|
|
70
|
+
setLangList(_langList);
|
|
71
|
+
context.$publisher(context.topics.LANG_SETTING_SELECT, {
|
|
72
|
+
langList: _langList
|
|
73
|
+
});
|
|
74
|
+
doQuery();
|
|
75
|
+
case 6:
|
|
76
|
+
case "end":
|
|
77
|
+
return _context.stop();
|
|
78
|
+
}
|
|
79
|
+
}, _callee);
|
|
80
|
+
})), []);
|
|
81
|
+
var doQuery = (0, _ahooks.useMemoizedFn)(function () {
|
|
82
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
83
|
+
(0, _I18n.readAllLang)((0, _objectSpread3.default)((0, _objectSpread3.default)({}, value), {}, {
|
|
84
|
+
classifyKey: '__LOWCODE__'
|
|
85
|
+
})).then(function (res) {
|
|
86
|
+
var code = res.code,
|
|
87
|
+
list = res.list,
|
|
88
|
+
detail = res.detail;
|
|
89
|
+
if (code === 1) setDataSource(list.map(function (id) {
|
|
90
|
+
return formatDataFunc(detail[id]);
|
|
91
|
+
}));
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
var actionsColumn = (0, _ahooks.useCreation)(function () {
|
|
95
|
+
return {
|
|
96
|
+
width: 60,
|
|
97
|
+
getActions: function getActions() {
|
|
98
|
+
return [{
|
|
99
|
+
wanted: 'update',
|
|
100
|
+
title: /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
101
|
+
type: "copy"
|
|
102
|
+
}),
|
|
103
|
+
action: function action(_data) {
|
|
104
|
+
var data = {
|
|
105
|
+
languages: (0, _lodash.reduce)(langList, function (result, value) {
|
|
106
|
+
result[value.field] = _data[value.field];
|
|
107
|
+
return result;
|
|
108
|
+
}, {})
|
|
109
|
+
};
|
|
110
|
+
handleAdd(data);
|
|
111
|
+
}
|
|
112
|
+
}, {
|
|
113
|
+
wanted: 'delete',
|
|
114
|
+
title: /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
115
|
+
type: "delete"
|
|
116
|
+
}),
|
|
117
|
+
confirm: {
|
|
118
|
+
title: (0, _utils.formatMessage)({
|
|
119
|
+
id: 'app.base.confirm.delete'
|
|
120
|
+
})
|
|
121
|
+
},
|
|
122
|
+
action: handleDelete
|
|
123
|
+
}];
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
}, [langList]);
|
|
127
|
+
var handleAdd = (0, _ahooks.useMemoizedFn)(function () {
|
|
128
|
+
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
129
|
+
var addItems = (0, _objectSpread3.default)((0, _objectSpread3.default)({}, data), {}, {
|
|
130
|
+
langKey: getLangKey(),
|
|
131
|
+
classifyKey: '__LOWCODE__'
|
|
132
|
+
});
|
|
133
|
+
(0, _I18n.doAddLang)({}, addItems).then(function (res) {
|
|
134
|
+
var code = res.code,
|
|
135
|
+
list = res.list,
|
|
136
|
+
detail = res.detail;
|
|
137
|
+
if (code === 1) setDataSource([formatDataFunc(detail[list[0]])].concat(dataSource));
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
var handleValueChange = (0, _ahooks.useMemoizedFn)(function (field, newValue, oldValue, record) {
|
|
141
|
+
(0, _I18n.doUpdateLang)({}, {
|
|
142
|
+
classifyKey: '__LOWCODE__',
|
|
143
|
+
langKey: record.langKey,
|
|
144
|
+
indocno: record.indocno,
|
|
145
|
+
languages: (0, _objectSpread3.default)((0, _objectSpread3.default)({}, (0, _lodash.reduce)(langList, function (result, value) {
|
|
146
|
+
result[value.field] = record[value.field];
|
|
147
|
+
return result;
|
|
148
|
+
}, {})), {}, (0, _defineProperty2.default)({}, field, newValue))
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
var handleDelete = (0, _ahooks.useMemoizedFn)(function (data) {
|
|
152
|
+
(0, _I18n.doDeleteLang)({}, {
|
|
153
|
+
delList: [{
|
|
154
|
+
indocno: data.indocno
|
|
155
|
+
}]
|
|
156
|
+
}).then(function (_ref2) {
|
|
157
|
+
var code = _ref2.code;
|
|
158
|
+
if (code === 1) {
|
|
159
|
+
var _data = (0, _lodash.cloneDeep)(dataSource);
|
|
160
|
+
(0, _lodash.remove)(_data, function (n) {
|
|
161
|
+
return n.indocno === data.indocno;
|
|
162
|
+
});
|
|
163
|
+
setDataSource(_data);
|
|
164
|
+
}
|
|
165
|
+
;
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
var handleSearch = (0, _lodash.debounce)(doQuery, 300);
|
|
169
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
170
|
+
style: {
|
|
171
|
+
height: '100%',
|
|
172
|
+
padding: '16px 24px'
|
|
173
|
+
}
|
|
174
|
+
}, /*#__PURE__*/_react.default.createElement(Search, {
|
|
175
|
+
placeholder: (0, _utils.formatMessage)({
|
|
176
|
+
id: 'luckda.lowcode.painter.I18n.search',
|
|
177
|
+
label: '搜索文案'
|
|
178
|
+
}),
|
|
179
|
+
onChange: function onChange(e) {
|
|
180
|
+
return handleSearch({
|
|
181
|
+
value: e.target.value
|
|
182
|
+
});
|
|
183
|
+
},
|
|
184
|
+
style: {
|
|
185
|
+
width: '100%'
|
|
186
|
+
},
|
|
187
|
+
allowClear: true
|
|
188
|
+
}), /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
189
|
+
type: "primary",
|
|
190
|
+
ghost: true,
|
|
191
|
+
size: "small",
|
|
192
|
+
style: {
|
|
193
|
+
margin: '16px 0'
|
|
194
|
+
},
|
|
195
|
+
onClick: function onClick() {
|
|
196
|
+
return handleAdd();
|
|
197
|
+
}
|
|
198
|
+
}, (0, _utils.formatMessage)({
|
|
199
|
+
id: 'luckda.lowcode.painter.I18n.add',
|
|
200
|
+
label: '新增文案'
|
|
201
|
+
})), /*#__PURE__*/_react.default.createElement(_luckDesign.GridTable, {
|
|
202
|
+
height: 480,
|
|
203
|
+
columns: langList,
|
|
204
|
+
dataSource: dataSource,
|
|
205
|
+
renderIndex: false,
|
|
206
|
+
showStatusBar: false,
|
|
207
|
+
actionsColumn: actionsColumn,
|
|
208
|
+
onValueChange: handleValueChange,
|
|
209
|
+
operates: ['add', 'update', 'delete'],
|
|
210
|
+
bordered: false
|
|
211
|
+
}));
|
|
11
212
|
};
|
|
12
213
|
var _default = exports.default = I18n;
|