@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,97 @@
|
|
|
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 = _default;
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _ahooks = require("ahooks");
|
|
12
|
+
var _collapse = _interopRequireDefault(require("../style/collapse.less"));
|
|
13
|
+
var _antd = require("luck-design/antd");
|
|
14
|
+
/**
|
|
15
|
+
* Collapse 组件是一个可折叠区域的实现,用于显示或隐藏内容。它支持自定义标签、描述以及默认的折叠状态。
|
|
16
|
+
* 该组件还可以通过 `next` 函数来自定义点击操作,而不是简单地切换折叠状态。
|
|
17
|
+
* 提供的工具提示可以显示额外信息,如字段名和描述,以帮助用户更好地理解折叠内容的作用。
|
|
18
|
+
*
|
|
19
|
+
* @component
|
|
20
|
+
* @example
|
|
21
|
+
* <Collapse
|
|
22
|
+
* field="exampleField"
|
|
23
|
+
* label="示例标签"
|
|
24
|
+
* desc="这是一个用于演示的折叠组件"
|
|
25
|
+
* defaultCollapsed={true}
|
|
26
|
+
* next={() => console.log('Custom next function executed')}
|
|
27
|
+
* >
|
|
28
|
+
* <p>这里是可折叠的内容</p>
|
|
29
|
+
* </Collapse>
|
|
30
|
+
*
|
|
31
|
+
* @param {Object} props - 组件的属性。
|
|
32
|
+
* @param {React.ReactNode} children - 折叠区域展开时显示的内容。
|
|
33
|
+
* @param {string} [props.field] - 与折叠内容相关联的字段名。
|
|
34
|
+
* @param {string} props.label - 折叠区域的标签名称。
|
|
35
|
+
* @param {string} [props.desc] - 关于折叠内容的描述信息。
|
|
36
|
+
* @param {boolean} [props.defaultCollapsed=false] - 折叠区域的默认状态。如果为 true,则默认为折叠状态。
|
|
37
|
+
* @param {Function} [props.next] - 点击操作的自定义函数。如果提供,点击时将执行此函数,而不是切换折叠状态。
|
|
38
|
+
*
|
|
39
|
+
* @returns {ReactElement} 返回一个 React 元素,表示一个具有可折叠功能的容器。
|
|
40
|
+
*/
|
|
41
|
+
function _default(_ref) {
|
|
42
|
+
var children = _ref.children,
|
|
43
|
+
field = _ref.field,
|
|
44
|
+
label = _ref.label,
|
|
45
|
+
desc = _ref.desc,
|
|
46
|
+
_ref$defaultCollapsed = _ref.defaultCollapsed,
|
|
47
|
+
defaultCollapsed = _ref$defaultCollapsed === void 0 ? false : _ref$defaultCollapsed,
|
|
48
|
+
next = _ref.next;
|
|
49
|
+
var _useState = (0, _react.useState)(defaultCollapsed),
|
|
50
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
51
|
+
collapsed = _useState2[0],
|
|
52
|
+
setCollapsed = _useState2[1];
|
|
53
|
+
var handleClick = (0, _ahooks.useMemoizedFn)(function () {
|
|
54
|
+
if (next) {
|
|
55
|
+
next();
|
|
56
|
+
} else {
|
|
57
|
+
setCollapsed(!collapsed);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
var tip = (0, _ahooks.useCreation)(function () {
|
|
61
|
+
var str = void 0;
|
|
62
|
+
if (field) {
|
|
63
|
+
str = "\u5C5E\u6027\uFF1A".concat(field);
|
|
64
|
+
}
|
|
65
|
+
if (desc) {
|
|
66
|
+
str += "".concat(str ? ' | ' : '', "\u8BF4\u660E\uFF1A").concat(desc);
|
|
67
|
+
}
|
|
68
|
+
return str;
|
|
69
|
+
}, [field, desc]);
|
|
70
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
71
|
+
className: _collapse.default['lc-painter-components-collapse']
|
|
72
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
73
|
+
className: _collapse.default['head'],
|
|
74
|
+
onClick: handleClick
|
|
75
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Tooltip, {
|
|
76
|
+
overlayStyle: {
|
|
77
|
+
fontSize: '12px'
|
|
78
|
+
},
|
|
79
|
+
title: tip,
|
|
80
|
+
getPopupContainer: function getPopupContainer() {
|
|
81
|
+
return document.getElementById('lc-design-workspace');
|
|
82
|
+
}
|
|
83
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
84
|
+
className: _collapse.default['label'],
|
|
85
|
+
style: {
|
|
86
|
+
cursor: desc ? 'help' : 'default'
|
|
87
|
+
}
|
|
88
|
+
}, label)), /*#__PURE__*/_react.default.createElement("span", {
|
|
89
|
+
className: _collapse.default['action']
|
|
90
|
+
}, next ? /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
91
|
+
type: "right"
|
|
92
|
+
}) : /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
93
|
+
type: collapsed ? 'down' : 'up'
|
|
94
|
+
}))), !collapsed && /*#__PURE__*/_react.default.createElement("div", {
|
|
95
|
+
className: _collapse.default['body']
|
|
96
|
+
}, children));
|
|
97
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = _default;
|
|
9
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
+
var _ahooks = require("ahooks");
|
|
15
|
+
var _PopConfirm = _interopRequireDefault(require("./PopConfirm"));
|
|
16
|
+
var _antd = require("luck-design/antd");
|
|
17
|
+
var _colorInput = _interopRequireDefault(require("../style/color-input.less"));
|
|
18
|
+
var _reactColor = require("react-color");
|
|
19
|
+
var _excluded = ["value", "onChange", "wrapperStyle"];
|
|
20
|
+
/**
|
|
21
|
+
* ColorInput 组件是一个集成颜色选择器的输入框组件,允许用户以 RGBA 或十六进制格式输入颜色值。
|
|
22
|
+
* 组件内部通过 PopConfirm 弹出一个 SketchPicker 颜色选择器,以提供一个直观的颜色选择界面。
|
|
23
|
+
* 用户输入的颜色值在内部转换为适当的格式,并通过 onChange 回调暴露给外部使用。
|
|
24
|
+
* 此组件还支持通过传入的 value 属性初始化颜色值,并响应其后续更改。
|
|
25
|
+
*
|
|
26
|
+
* @component
|
|
27
|
+
* @example
|
|
28
|
+
* const handleColorChange = (newColor) => {
|
|
29
|
+
* console.log('Selected color:', newColor);
|
|
30
|
+
* };
|
|
31
|
+
* <ColorInput
|
|
32
|
+
* value="rgba(255, 0, 0, 0.5)"
|
|
33
|
+
* onChange={handleColorChange}
|
|
34
|
+
* wrapperStyle={{ margin: '20px' }}
|
|
35
|
+
* />
|
|
36
|
+
*
|
|
37
|
+
* @param {Object} props - 组件的属性。
|
|
38
|
+
* @param {string} props.value - 初始化颜色值,支持 RGBA 字符串或十六进制格式。
|
|
39
|
+
* @param {Function} props.onChange - 当颜色值变更时触发的回调函数。传递新的颜色值作为参数。
|
|
40
|
+
* @param {Object} [props.wrapperStyle] - 自定义包装器 div 的样式对象。
|
|
41
|
+
* @param {Object} rest - 传递给 Input 组件的其他属性。
|
|
42
|
+
*
|
|
43
|
+
* @returns {ReactElement} 返回一个 React 元素,表示一个带有颜色选择器的输入框组件。
|
|
44
|
+
*/
|
|
45
|
+
function _default(_ref) {
|
|
46
|
+
var value = _ref.value,
|
|
47
|
+
onChange = _ref.onChange,
|
|
48
|
+
wrapperStyle = _ref.wrapperStyle,
|
|
49
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
50
|
+
var _useState = (0, _react.useState)(fromRGBA(value)),
|
|
51
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
52
|
+
color = _useState2[0],
|
|
53
|
+
setColor = _useState2[1];
|
|
54
|
+
var handleChange = function handleChange(color) {
|
|
55
|
+
changeColor(color.rgb);
|
|
56
|
+
};
|
|
57
|
+
var handleInputChange = function handleInputChange(e) {
|
|
58
|
+
changeColor(e.target.value);
|
|
59
|
+
};
|
|
60
|
+
var changeColor = function changeColor(value) {
|
|
61
|
+
if (onChange) onChange(toRGBA(value));
|
|
62
|
+
setColor(value);
|
|
63
|
+
};
|
|
64
|
+
(0, _ahooks.useUpdateEffect)(function () {
|
|
65
|
+
setColor(fromRGBA(value));
|
|
66
|
+
}, [value]);
|
|
67
|
+
var rgbaColor = toRGBA(color);
|
|
68
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
69
|
+
className: _colorInput.default['lc-painter-components-color-input'],
|
|
70
|
+
style: wrapperStyle
|
|
71
|
+
}, /*#__PURE__*/_react.default.createElement(_PopConfirm.default, {
|
|
72
|
+
placement: "top",
|
|
73
|
+
title: /*#__PURE__*/_react.default.createElement(_reactColor.SketchPicker, {
|
|
74
|
+
color: color !== null && color !== void 0 ? color : '#ffffff',
|
|
75
|
+
onChange: handleChange
|
|
76
|
+
})
|
|
77
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
78
|
+
className: _colorInput.default['color-input-wrap']
|
|
79
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Input, (0, _extends2.default)({
|
|
80
|
+
onChange: handleInputChange,
|
|
81
|
+
className: _colorInput.default['color-input'],
|
|
82
|
+
value: rgbaColor,
|
|
83
|
+
size: "small",
|
|
84
|
+
placeholder: "rgba(0,0,0,0)"
|
|
85
|
+
}, rest)), /*#__PURE__*/_react.default.createElement("div", {
|
|
86
|
+
className: "color-display",
|
|
87
|
+
style: {
|
|
88
|
+
backgroundColor: rgbaColor
|
|
89
|
+
}
|
|
90
|
+
}))));
|
|
91
|
+
}
|
|
92
|
+
function toRGBA(colorObj) {
|
|
93
|
+
// 首先检查 colorObj 是否为 null 或 undefined
|
|
94
|
+
if (colorObj === null || typeof colorObj === 'undefined') {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// 检查是否为对象且包含 r, g, b, a 属性
|
|
99
|
+
if ((0, _typeof2.default)(colorObj) === 'object' && 'r' in colorObj && 'g' in colorObj && 'b' in colorObj && 'a' in colorObj) {
|
|
100
|
+
return "rgba(".concat(colorObj.r, ", ").concat(colorObj.g, ", ").concat(colorObj.b, ", ").concat(colorObj.a, ")");
|
|
101
|
+
} else if (typeof colorObj === 'string' && colorObj.startsWith('#')) {
|
|
102
|
+
// 如果是以#号开头的字符串,则直接返回该字符串
|
|
103
|
+
return colorObj;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// 如果不符合上述任何一种情况,返回一个空字符串
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
function fromRGBA(rgbaString) {
|
|
110
|
+
if (rgbaString === null || typeof rgbaString === 'undefined') {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// 检查输入是否是有效的 rgba 字符串
|
|
115
|
+
var rgbaPattern = /rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d*\.?\d+)\)/;
|
|
116
|
+
var match = rgbaString.match(rgbaPattern);
|
|
117
|
+
if (match) {
|
|
118
|
+
// 如果匹配成功,则提取 rgba 值
|
|
119
|
+
return {
|
|
120
|
+
r: parseInt(match[1], 10),
|
|
121
|
+
g: parseInt(match[2], 10),
|
|
122
|
+
b: parseInt(match[3], 10),
|
|
123
|
+
a: parseFloat(match[4])
|
|
124
|
+
};
|
|
125
|
+
} else if (typeof rgbaString === 'string' && rgbaString.startsWith('#')) {
|
|
126
|
+
// 对于十六进制颜色字符串,直接返回原始字符串
|
|
127
|
+
return rgbaString;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// 如果不符合上述任何一种情况,返回 null
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ListEditorItem = exports.ListEditor = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _antd = require("luck-design/antd");
|
|
11
|
+
var _utils = require("@luck-design-biz/base/utils");
|
|
12
|
+
var _listEditor = _interopRequireDefault(require("../style/list-editor.less"));
|
|
13
|
+
/**
|
|
14
|
+
* ListEditor 是一个用于管理和展示一组可编辑标签项的容器组件。
|
|
15
|
+
* 它提供了一个添加新标签项的操作按钮,并通过 children 属性接收一组 ListEditorItem 组件。
|
|
16
|
+
*
|
|
17
|
+
* @param {Object} props - 组件接收的属性。
|
|
18
|
+
* @param {ReactNode} props.children - ListEditorItem 组件的实例,表示可编辑的标签项。
|
|
19
|
+
* @param {Function} props.handleAdd - 一个回调函数,当用户点击添加按钮时被触发,用于添加新的标签项。
|
|
20
|
+
* @returns {ReactNode} 渲染一个带有操作按钮和标签项的容器。
|
|
21
|
+
*/
|
|
22
|
+
var ListEditor = exports.ListEditor = function ListEditor(_ref) {
|
|
23
|
+
var children = _ref.children,
|
|
24
|
+
addText = _ref.addText,
|
|
25
|
+
handleAdd = _ref.handleAdd;
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
27
|
+
className: _listEditor.default['lc-painter-panel-section-components-listeditor']
|
|
28
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
29
|
+
className: _listEditor.default['list-box']
|
|
30
|
+
}, children), /*#__PURE__*/_react.default.createElement("div", {
|
|
31
|
+
className: _listEditor.default['list-actions']
|
|
32
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
33
|
+
className: _listEditor.default['list-action'],
|
|
34
|
+
onClick: handleAdd
|
|
35
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
36
|
+
type: "plus-circle"
|
|
37
|
+
}), ' ', addText || (0, _utils.formatMessage)({
|
|
38
|
+
id: 'luckda.lowcode.painter.panel-section.components.listeditor.add',
|
|
39
|
+
label: '添加一项'
|
|
40
|
+
}))));
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* ListEditorItem 是一个可编辑的标签项组件,用于在 ListEditor 容器内展示。
|
|
45
|
+
* 它支持拖拽排序,并可以通过左侧和右侧的插槽来自定义内容。
|
|
46
|
+
*
|
|
47
|
+
* @param {Object} props - 组件接收的属性。
|
|
48
|
+
* @param {Object} props.item - 表示标签项数据的对象。
|
|
49
|
+
* @param {ReactNode} props.left - 放置在标签项左侧的内容,通常用于展示标签名称或其他信息。
|
|
50
|
+
* @param {ReactNode} props.right - 放置在标签项右侧的内容,通常用于展示操作按钮如编辑或删除。
|
|
51
|
+
* @param {Function} props.setNodeRef - 用于设置拖拽组件根节点的引用。
|
|
52
|
+
* @param {Function} props.setActivatorNodeRef - 用于设置激活拖拽操作的节点引用。
|
|
53
|
+
* @param {Object} props.style - 应用于标签项的样式对象,通常包含拖拽过程中的动态变化样式。
|
|
54
|
+
* @param {Object} props.attributes - 包含与拖拽相关的HTML属性。
|
|
55
|
+
* @param {Object} props.listeners - 包含处理拖拽事件的监听器。
|
|
56
|
+
* @param {CSSProperties} props.transform - 应用于组件的CSS变换属性,用于实现拖拽效果。
|
|
57
|
+
* @param {string} props.transition - 定义拖拽动画的CSS过渡属性。
|
|
58
|
+
* @returns {ReactNode} 渲染一个可编辑的标签项,支持拖拽排序。
|
|
59
|
+
*/
|
|
60
|
+
var ListEditorItem = exports.ListEditorItem = function ListEditorItem(_ref2) {
|
|
61
|
+
var item = _ref2.item,
|
|
62
|
+
left = _ref2.left,
|
|
63
|
+
right = _ref2.right,
|
|
64
|
+
setNodeRef = _ref2.setNodeRef,
|
|
65
|
+
setActivatorNodeRef = _ref2.setActivatorNodeRef,
|
|
66
|
+
style = _ref2.style,
|
|
67
|
+
attributes = _ref2.attributes,
|
|
68
|
+
listeners = _ref2.listeners,
|
|
69
|
+
transform = _ref2.transform,
|
|
70
|
+
transition = _ref2.transition;
|
|
71
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
72
|
+
ref: setNodeRef,
|
|
73
|
+
style: style,
|
|
74
|
+
className: _listEditor.default['list-item']
|
|
75
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
76
|
+
className: _listEditor.default['list-item-left']
|
|
77
|
+
}, /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
|
78
|
+
ref: setActivatorNodeRef
|
|
79
|
+
}, attributes, listeners, {
|
|
80
|
+
className: _listEditor.default['dragicon']
|
|
81
|
+
}), /*#__PURE__*/_react.default.createElement("svg", {
|
|
82
|
+
fill: "currentColor",
|
|
83
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
84
|
+
width: "16",
|
|
85
|
+
height: "12",
|
|
86
|
+
viewBox: "0 0 5 12",
|
|
87
|
+
style: {
|
|
88
|
+
verticalAlign: 'middle'
|
|
89
|
+
}
|
|
90
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
91
|
+
d: "M0.499972716,6 L1.50002728,6 C1.77615459,6 2,6.22384541 2,6.49997272 C2,6.77610002 1.77615459,6.99994543 1.50002728,6.99994543 L0.499972716,6.99994543 C0.22384541,6.99994543 3.38158422e-17,6.77610002 0,6.49997272 C-3.38158422e-17,6.22384541 0.22384541,6 0.499972716,6 Z M0.499972716,3 L1.50002728,3 C1.77615459,3 2,3.22384541 2,3.49997272 C2,3.77610002 1.77615459,3.99994543 1.50002728,3.99994543 L0.499972716,3.99994543 C0.22384541,3.99994543 3.38158422e-17,3.77610002 0,3.49997272 C-3.38158422e-17,3.22384541 0.22384541,3 0.499972716,3 Z M0.499972716,7.28787148e-18 L1.50002728,5.55666624e-14 C1.77615459,7.07214574e-14 2,0.22384541 2,0.499972716 C2,0.776100022 1.77615459,0.999945432 1.50002728,0.999945432 L0.499972716,0.999945432 C0.22384541,0.999945432 3.38158422e-17,0.776100022 0,0.499972716 C-3.38158422e-17,0.22384541 0.22384541,5.0723721e-17 0.499972716,0 Z M0.5,9.00002729 L1.5,9.00002729 C1.77614237,9.00002729 2,9.22388491 2,9.50002729 C2,9.77616966 1.77614237,10.0000273 1.5,10.0000273 L0.5,10.0000273 C0.223857625,10.0000273 3.38176876e-17,9.77616966 0,9.50002729 C-3.38176876e-17,9.22388491 0.223857625,9.00002729 0.5,9.00002729 Z M0.5,12.0000273 L1.5,12.0000273 C1.77614237,12.0000273 2,12.2238849 2,12.5000273 C2,12.7761697 1.77614237,13.0000273 1.5,13.0000273 L0.5,13.0000273 C0.223857625,13.0000273 3.38176876e-17,12.7761697 0,12.5000273 C-3.38176876e-17,12.2238849 0.223857625,12.0000273 0.5,12.0000273 Z M0.5,15.0000273 L1.5,15.0000273 C1.77614237,15.0000273 2,15.2238849 2,15.5000273 C2,15.7761697 1.77614237,16.0000273 1.5,16.0000273 L0.5,16.0000273 C0.223857625,16.0000273 3.38176876e-17,15.7761697 0,15.5000273 C-3.38176876e-17,15.2238849 0.223857625,15.0000273 0.5,15.0000273 Z M3.49997272,6 L4.50002728,6 C4.77615459,6 5,6.22384541 5,6.49997272 C5,6.77610002 4.77615459,6.99994543 4.50002728,6.99994543 L3.49997272,6.99994543 C3.22384541,6.99994543 3,6.77610002 3,6.49997272 C3,6.22384541 3.22384541,6 3.49997272,6 Z M3.49997272,3 L4.50002728,3 C4.77615459,3 5,3.22384541 5,3.49997272 C5,3.77610002 4.77615459,3.99994543 4.50002728,3.99994543 L3.49997272,3.99994543 C3.22384541,3.99994543 3,3.77610002 3,3.49997272 C3,3.22384541 3.22384541,3 3.49997272,3 Z M3.49997272,7.28787148e-18 L4.50002728,5.55666624e-14 C4.77615459,7.07214574e-14 5,0.22384541 5,0.499972716 C5,0.776100022 4.77615459,0.999945432 4.50002728,0.999945432 L3.49997272,0.999945432 C3.22384541,0.999945432 3,0.776100022 3,0.499972716 C3,0.22384541 3.22384541,5.0723721e-17 3.49997272,0 Z M3.5,9.00002729 L4.5,9.00002729 C4.77614237,9.00002729 5,9.22388491 5,9.50002729 C5,9.77616966 4.77614237,10.0000273 4.5,10.0000273 L3.5,10.0000273 C3.22385763,10.0000273 3,9.77616966 3,9.50002729 C3,9.22388491 3.22385763,9.00002729 3.5,9.00002729 Z M3.5,12.0000273 L4.5,12.0000273 C4.77614237,12.0000273 5,12.2238849 5,12.5000273 C5,12.7761697 4.77614237,13.0000273 4.5,13.0000273 L3.5,13.0000273 C3.22385763,13.0000273 3,12.7761697 3,12.5000273 C3,12.2238849 3.22385763,12.0000273 3.5,12.0000273 Z M3.5,15.0000273 L4.5,15.0000273 C4.77614237,15.0000273 5,15.2238849 5,15.5000273 C5,15.7761697 4.77614237,16.0000273 4.5,16.0000273 L3.5,16.0000273 C3.22385763,16.0000273 3,15.7761697 3,15.5000273 C3,15.2238849 3.22385763,15.0000273 3.5,15.0000273 Z"
|
|
92
|
+
}))), left), /*#__PURE__*/_react.default.createElement("div", {
|
|
93
|
+
className: _listEditor.default['list-item-right']
|
|
94
|
+
}, right));
|
|
95
|
+
};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = _default;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _ahooks = require("ahooks");
|
|
14
|
+
var _numberInput = _interopRequireDefault(require("../style/number-input.less"));
|
|
15
|
+
var _antd = require("luck-design/antd");
|
|
16
|
+
var _lodash = require("lodash");
|
|
17
|
+
var _excluded = ["value", "options", "onChange", "defaultValue", "allowNull", "convertInt"];
|
|
18
|
+
/**
|
|
19
|
+
* NumberInput 组件是一个带单位选择的数字输入框组件,允许用户输入一个数值并从预定义的选项中选择一个单位。
|
|
20
|
+
* 它支持默认值、空值、自动类型转换以及自定义更改处理逻辑。
|
|
21
|
+
* 组件内部通过 Dropdown 组件提供一个单位的下拉选择菜单,并通过 InputNumber 接收数值输入。
|
|
22
|
+
* 该组件也支持将输入值转换为整数或保持为原始格式,并允许通过 options 定制可选单位。
|
|
23
|
+
*
|
|
24
|
+
* @component
|
|
25
|
+
* @example
|
|
26
|
+
* const options = [{ value: 'px', label: '像素' }, { value: '%', label: '百分比' }];
|
|
27
|
+
* <NumberInput
|
|
28
|
+
* value={100}
|
|
29
|
+
* options={options}
|
|
30
|
+
* onChange={(newValue) => console.log('New value:', newValue)}
|
|
31
|
+
* defaultValue={0}
|
|
32
|
+
* allowNull={true}
|
|
33
|
+
* convertInt={false}
|
|
34
|
+
* />
|
|
35
|
+
*
|
|
36
|
+
* @param {Object} props - 组件的属性。
|
|
37
|
+
* @param {number|string} props.value - 初始化输入框的值。
|
|
38
|
+
* @param {Object[]} props.options - 可选单位的数组,每个对象包含 value(单位的值)和 label(显示在下拉菜单中的标签)。
|
|
39
|
+
* @param {Function} props.onChange - 当输入值或单位改变时触发的回调函数。传递新的值作为参数。
|
|
40
|
+
* @param {number|string} [props.defaultValue] - 未指定 value 时的默认值。
|
|
41
|
+
* @param {boolean} [props.allowNull=true] - 是否允许空值。
|
|
42
|
+
* @param {boolean} [props.convertInt=false] - 是否将输入值转换为整数。
|
|
43
|
+
* @param {Object} rest - 传递给 InputNumber 组件的其他属性。
|
|
44
|
+
*
|
|
45
|
+
* @returns {ReactElement} 返回一个 React 元素,表示一个带单位选择的数字输入框组件。
|
|
46
|
+
*/
|
|
47
|
+
function _default(_ref) {
|
|
48
|
+
var value = _ref.value,
|
|
49
|
+
options = _ref.options,
|
|
50
|
+
onChange = _ref.onChange,
|
|
51
|
+
defaultValue = _ref.defaultValue,
|
|
52
|
+
_ref$allowNull = _ref.allowNull,
|
|
53
|
+
allowNull = _ref$allowNull === void 0 ? true : _ref$allowNull,
|
|
54
|
+
_ref$convertInt = _ref.convertInt,
|
|
55
|
+
convertInt = _ref$convertInt === void 0 ? false : _ref$convertInt,
|
|
56
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
57
|
+
var _useState = (0, _react.useState)(value !== null && value !== void 0 ? value : defaultValue),
|
|
58
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
59
|
+
val = _useState2[0],
|
|
60
|
+
setVal = _useState2[1];
|
|
61
|
+
(0, _ahooks.useUpdateEffect)(function () {
|
|
62
|
+
setVal(value);
|
|
63
|
+
}, [value]);
|
|
64
|
+
var _parseValue = parseValue(val, options),
|
|
65
|
+
number = _parseValue.number,
|
|
66
|
+
unit = _parseValue.unit;
|
|
67
|
+
var handleSelect = function handleSelect(item) {
|
|
68
|
+
var newValue;
|
|
69
|
+
if (item.key == 'auto') newValue = item.key;else if (isNaN(number)) {
|
|
70
|
+
var defaultNumber = defaultValue !== null && defaultValue !== void 0 ? defaultValue : 0;
|
|
71
|
+
if (isNaN(defaultNumber)) {
|
|
72
|
+
var match = defaultNumber.match(/[\d\.]+/);
|
|
73
|
+
defaultNumber = match ? parseFloat(match[0]) : 0;
|
|
74
|
+
}
|
|
75
|
+
newValue = defaultNumber + item.key;
|
|
76
|
+
} else {
|
|
77
|
+
newValue = number + item.key;
|
|
78
|
+
}
|
|
79
|
+
changeValue(newValue);
|
|
80
|
+
};
|
|
81
|
+
var handleChange = function handleChange(value) {
|
|
82
|
+
if (!(0, _lodash.isNil)(value)) changeValue(value + (unit !== null && unit !== void 0 ? unit : options[0].value));else changeValue(null);
|
|
83
|
+
};
|
|
84
|
+
var changeValue = function changeValue(value) {
|
|
85
|
+
// 分离需要数字前缀的值和不需要数字前缀的值(如auto)
|
|
86
|
+
var numericValues = options.filter(function (option) {
|
|
87
|
+
return option.value !== 'auto';
|
|
88
|
+
}).map(function (option) {
|
|
89
|
+
return option.value.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
90
|
+
}).join('|');
|
|
91
|
+
|
|
92
|
+
// 构建正则表达式
|
|
93
|
+
var regex = new RegExp("^(\\d*(?:".concat(numericValues, ")|auto)$"));
|
|
94
|
+
var isValid = regex.test(value);
|
|
95
|
+
if (isValid || allowNull && (value === '' || value == null)) {
|
|
96
|
+
// 如果value符合要求,执行以下代码
|
|
97
|
+
if (onChange) onChange(convertInt ? parseInt(value) : value);
|
|
98
|
+
setVal(value);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
var optionName = options[0].label;
|
|
102
|
+
var menu = /*#__PURE__*/_react.default.createElement(_antd.Menu, {
|
|
103
|
+
onClick: handleSelect
|
|
104
|
+
}, options.map(function (item) {
|
|
105
|
+
if (item.value == unit) optionName = item.label;
|
|
106
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Menu.Item, {
|
|
107
|
+
key: item.value
|
|
108
|
+
}, item.label);
|
|
109
|
+
}));
|
|
110
|
+
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
|
111
|
+
className: _numberInput.default['lc-painter-panel-section-components-number-input']
|
|
112
|
+
}, rest), /*#__PURE__*/_react.default.createElement("div", {
|
|
113
|
+
className: _numberInput.default['num-input-wrap']
|
|
114
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.InputNumber, (0, _extends2.default)({
|
|
115
|
+
className: _numberInput.default['num-input'],
|
|
116
|
+
size: "small"
|
|
117
|
+
}, rest, {
|
|
118
|
+
value: number,
|
|
119
|
+
onChange: handleChange
|
|
120
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
121
|
+
className: _numberInput.default['num-option']
|
|
122
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Dropdown, {
|
|
123
|
+
overlay: menu,
|
|
124
|
+
value: unit,
|
|
125
|
+
disabled: options.length === 1,
|
|
126
|
+
getPopupContainer: function getPopupContainer() {
|
|
127
|
+
return document.getElementById('lc-design-workspace');
|
|
128
|
+
}
|
|
129
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, optionName)))));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// 解析value,分离数字和单位
|
|
133
|
+
var parseValue = function parseValue(value, options) {
|
|
134
|
+
if (value === null || typeof value === 'undefined' || value === '') {
|
|
135
|
+
return {
|
|
136
|
+
number: null,
|
|
137
|
+
unit: null
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
value = String(value);
|
|
141
|
+
|
|
142
|
+
// 调整正则表达式以匹配数字后跟任意非数字字符
|
|
143
|
+
var result = value.match(/^(\d+)(\D*)$/); // \D 匹配任意非数字字符
|
|
144
|
+
if (result) {
|
|
145
|
+
return {
|
|
146
|
+
number: result[1],
|
|
147
|
+
unit: result[2] ? result[2] : options[0].value // 如果有非数字字符,则返回该字符,否则返回默认单位的第一项
|
|
148
|
+
};
|
|
149
|
+
} else {
|
|
150
|
+
return {
|
|
151
|
+
number: value,
|
|
152
|
+
unit: value
|
|
153
|
+
}; // 当没有数字时,比如 "auto",这里的逻辑可能需要调整,因为你的描述有点矛盾
|
|
154
|
+
}
|
|
155
|
+
};
|
|
@@ -1,26 +1,99 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = _default;
|
|
8
|
-
var
|
|
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 _ahooks = require("ahooks");
|
|
13
|
+
var _antd = require("luck-design/antd");
|
|
14
|
+
var _lodash = require("lodash");
|
|
15
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
16
|
var _panelItem = _interopRequireDefault(require("../style/panel-item.less"));
|
|
10
17
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
18
|
+
* `PanelItem` 组件用于展示属性面板中的单个属性项。
|
|
19
|
+
* 它支持展示一个标签(属性名称)及对应的组件(例如输入框、选择器等),并可通过传入的 `addon` 属性添加额外的内容。
|
|
20
|
+
* 此组件支持折叠功能,可以通过 `collapsed` 属性控制初始折叠状态。
|
|
21
|
+
*
|
|
22
|
+
* @component
|
|
23
|
+
* @example
|
|
24
|
+
* ```jsx
|
|
25
|
+
* <PanelItem
|
|
26
|
+
* label="属性名称"
|
|
27
|
+
* collapsed={false}
|
|
28
|
+
* addon={<div>额外内容</div>}
|
|
29
|
+
* >
|
|
30
|
+
* <input type="text" />
|
|
31
|
+
* </PanelItem>
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @param {Object} props 组件接收的参数。
|
|
35
|
+
* @param {string} props.label 显示的属性名称。如果标签以 `#` 开头,则不显示。
|
|
36
|
+
* @param {boolean} [props.collapsed=true] 初始是否折叠。默认为 `true`。
|
|
37
|
+
* @param {React.ReactNode} props.addon 当属性项展开时,可以在下方显示额外内容。
|
|
38
|
+
* @param {React.ReactNode} props.children 对应于属性名称的组件,可以是输入框、下拉菜单等 React 节点。
|
|
39
|
+
*
|
|
40
|
+
* @returns {React.Element} 渲染属性名称、对应的组件以及可选的额外内容。
|
|
15
41
|
*/
|
|
16
42
|
function _default(_ref) {
|
|
17
|
-
var
|
|
18
|
-
|
|
43
|
+
var field = _ref.field,
|
|
44
|
+
label = _ref.label,
|
|
45
|
+
desc = _ref.desc,
|
|
46
|
+
_ref$collapsed = _ref.collapsed,
|
|
47
|
+
collapsed = _ref$collapsed === void 0 ? true : _ref$collapsed,
|
|
48
|
+
addon = _ref.addon,
|
|
49
|
+
suppressPadding = _ref.suppressPadding,
|
|
50
|
+
children = _ref.children;
|
|
51
|
+
var _useState = (0, _react.useState)(collapsed),
|
|
52
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
53
|
+
curClps = _useState2[0],
|
|
54
|
+
setCurClps = _useState2[1];
|
|
55
|
+
var HandleClick = (0, _ahooks.useMemoizedFn)(function () {
|
|
56
|
+
if (!addon) return;
|
|
57
|
+
setCurClps(!curClps);
|
|
58
|
+
});
|
|
59
|
+
var tip = (0, _ahooks.useCreation)(function () {
|
|
60
|
+
var str = void 0;
|
|
61
|
+
if (field) {
|
|
62
|
+
str = "\u5C5E\u6027\uFF1A".concat(field);
|
|
63
|
+
}
|
|
64
|
+
if (desc) {
|
|
65
|
+
str += "".concat(str ? ' | ' : '', "\u8BF4\u660E\uFF1A").concat(desc);
|
|
66
|
+
}
|
|
67
|
+
return str;
|
|
68
|
+
}, [field, desc]);
|
|
69
|
+
(0, _react.useEffect)(function () {
|
|
70
|
+
setCurClps(collapsed);
|
|
71
|
+
}, [collapsed]);
|
|
19
72
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
20
|
-
className: _panelItem.default['lc-painter-components-panelitem']
|
|
73
|
+
className: (0, _classnames.default)(_panelItem.default['lc-painter-components-panelitem'], (0, _defineProperty2.default)({}, _panelItem.default['no-padding'], !!suppressPadding))
|
|
74
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
75
|
+
className: _panelItem.default['panelrow']
|
|
76
|
+
}, label && !(0, _lodash.startsWith)(label, '#') && /*#__PURE__*/_react.default.createElement("div", {
|
|
77
|
+
className: "".concat(_panelItem.default['item-label']).concat(addon ? ' panel-pointer' : ''),
|
|
78
|
+
onClick: HandleClick
|
|
79
|
+
}, addon && /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
80
|
+
className: _panelItem.default['item-icon'],
|
|
81
|
+
type: !curClps ? 'down' : 'right'
|
|
82
|
+
}), /*#__PURE__*/_react.default.createElement(_antd.Tooltip, {
|
|
83
|
+
overlayStyle: {
|
|
84
|
+
fontSize: '12px'
|
|
85
|
+
},
|
|
86
|
+
title: tip,
|
|
87
|
+
getPopupContainer: function getPopupContainer() {
|
|
88
|
+
return document.getElementById('lc-design-workspace');
|
|
89
|
+
}
|
|
21
90
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
22
|
-
|
|
23
|
-
|
|
91
|
+
style: desc ? {
|
|
92
|
+
cursor: 'help'
|
|
93
|
+
} : null
|
|
94
|
+
}, label))), /*#__PURE__*/_react.default.createElement("span", {
|
|
24
95
|
className: _panelItem.default['item-component']
|
|
25
|
-
},
|
|
96
|
+
}, children)), !curClps && addon && /*#__PURE__*/_react.default.createElement("div", {
|
|
97
|
+
className: _panelItem.default['addon']
|
|
98
|
+
}, addon));
|
|
26
99
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = _default;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _antd = require("luck-design/antd");
|
|
11
|
+
var _popConfirm = _interopRequireDefault(require("../style/pop-confirm.less"));
|
|
12
|
+
/**
|
|
13
|
+
* 这个组件是对 luck-design/antd 的 Popconfirm 组件的封装。
|
|
14
|
+
* 它提供了一个带有自定义样式的弹出确认框,用于在用户尝试执行重要操作前提示确认信息。
|
|
15
|
+
* 通过传入的 props 可以自定义 Popconfirm 组件的行为和外观。
|
|
16
|
+
*
|
|
17
|
+
* @param {Object} props - 传递给 Popconfirm 组件的属性。这包括所有标准的 Popconfirm 属性,
|
|
18
|
+
* 以及任何额外的属性,如事件处理器或自定义内容。
|
|
19
|
+
* @returns {ReactNode} 返回一个配置了自定义样式和指定属性的 Popconfirm 组件实例。
|
|
20
|
+
*/
|
|
21
|
+
function _default(props) {
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Popconfirm, (0, _extends2.default)({
|
|
23
|
+
overlayClassName: _popConfirm.default['lc-painter-panel-section-components-popconfirm'],
|
|
24
|
+
icon: null,
|
|
25
|
+
getPopupContainer: function getPopupContainer() {
|
|
26
|
+
return document.getElementById('lc-design-workspace');
|
|
27
|
+
}
|
|
28
|
+
}, props));
|
|
29
|
+
}
|