@luck-design-biz/luckda 0.0.23 → 0.0.24-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/es/components/Builder/index.js +0 -0
- package/es/components/LdAutoForm/index.js +0 -0
- package/es/components/LdCard/index.js +0 -0
- package/es/components/LdCard/model.js +0 -0
- package/es/components/LdCom/index.js +0 -0
- package/es/components/LdFormList/index.js +1 -4
- package/es/components/LdFormList/model.js +0 -0
- package/es/components/LdGrid/index.js +0 -0
- package/es/components/LdGrid/model.js +0 -0
- package/es/components/LdGridForm/index.js +0 -0
- package/es/components/LdGridForm/index.less +0 -0
- package/es/components/LdInfoPanel/index.js +0 -0
- package/es/components/LdPop/index.js +0 -0
- package/es/components/LdRuntimeCom/index.js +0 -0
- package/es/components/LdTree/index.js +0 -0
- package/es/components/LdTree/index.less +0 -0
- package/es/helper/FromItems.js +0 -0
- package/es/helper/action.js +0 -0
- package/es/helper/form.js +0 -0
- package/es/helper/index.less +0 -0
- package/es/helper/ldBuilder.js +0 -0
- package/es/helper/ldComBuild.js +0 -0
- package/es/index.js +0 -0
- package/es/lowcode/constants/api-url.js +2 -1
- package/es/lowcode/constants/event-topics.js +14 -1
- package/es/lowcode/constants/index.js +0 -0
- package/es/lowcode/engine/factory/DataFactory.js +0 -0
- 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/SegmentedStrategy.js +32 -0
- package/es/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +50 -0
- package/es/lowcode/engine/factory/panel-item-factory/Strategy.js +21 -0
- package/es/lowcode/engine/factory/panel-item-factory/StringStrategy.js +50 -0
- package/es/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +32 -0
- package/es/lowcode/engine/factory/panel-item-factory/index.js +42 -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} +121 -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 +11 -9
- package/es/lowcode/engine/meta/table.props.json +174 -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 +10 -17
- package/es/lowcode/engine/provider/EventBusProvider.js +2 -2
- package/es/lowcode/engine/tools/dataProcess.js +80 -5
- package/es/lowcode/engine/tools/helper.js +0 -0
- package/es/lowcode/engine/tools/usePromiseState.js +24 -0
- package/es/lowcode/index.js +0 -0
- package/es/lowcode/painter/Components.js +0 -0
- package/es/lowcode/painter/Design.js +274 -42
- package/es/lowcode/painter/I18n.js +202 -2
- package/es/lowcode/painter/Outline.js +33 -28
- package/es/lowcode/painter/Panel.js +201 -2
- package/es/lowcode/painter/Ribbon.js +61 -55
- package/es/lowcode/painter/components/Collapse.js +31 -0
- package/es/lowcode/painter/components/NumberInput.js +93 -0
- package/es/lowcode/painter/components/PanelItem.js +52 -9
- package/es/lowcode/painter/components/PopConfirm.js +20 -0
- package/es/lowcode/painter/components/PopForm.js +71 -0
- package/es/lowcode/painter/components/RuleInput.js +4 -4
- package/es/lowcode/painter/components/SortBox.js +92 -0
- package/es/lowcode/painter/components/TabEditor.js +88 -0
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +118 -0
- package/es/lowcode/painter/components/code-editor/CssEditor.js +14 -0
- package/es/lowcode/painter/components/code-editor/FullScreenEditor.js +64 -0
- package/es/lowcode/painter/components/code-editor/JSEditor.js +84 -0
- package/es/lowcode/painter/components/code-editor/index.js +2 -0
- package/es/lowcode/painter/index.js +27 -1
- package/es/lowcode/painter/panel-section/ButtonType.js +39 -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 +56 -49
- package/es/lowcode/painter/panel-section/StylePanel/Display.js +292 -0
- package/es/lowcode/painter/panel-section/StylePanel/DisplaySvg.js +543 -0
- package/es/lowcode/painter/panel-section/StylePanel/Height.js +48 -0
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +64 -0
- package/es/lowcode/painter/panel-section/StylePanel/StyleContext.js +101 -0
- package/es/lowcode/painter/panel-section/StylePanel/Width.js +48 -0
- package/es/lowcode/painter/panel-section/StylePanel/index.js +12 -0
- package/es/lowcode/painter/panel-section/TabItems.js +237 -0
- package/es/lowcode/painter/services/I18n.js +85 -0
- package/es/lowcode/painter/style/button-type.less +5 -0
- package/es/lowcode/painter/style/collapse.less +21 -0
- package/es/lowcode/painter/style/components.less +0 -0
- package/es/lowcode/painter/style/design.less +109 -5
- package/es/lowcode/painter/style/display.less +17 -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/number-input.less +17 -0
- package/es/lowcode/painter/style/outline.less +2 -0
- package/es/lowcode/painter/style/panel-item.less +38 -15
- package/es/lowcode/painter/style/panel.less +137 -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/radio.less +0 -0
- package/es/lowcode/painter/style/ribbon.less +1 -0
- package/es/lowcode/painter/style/rule-input.less +0 -0
- package/es/lowcode/painter/style/style-panel.less +5 -0
- package/es/lowcode/painter/style/tabeditor.less +90 -0
- package/es/lowcode/painter/style/tabitems.less +90 -0
- package/es/lowcode/view/Canvas.js +63 -55
- package/es/lowcode/view/Loading.js +0 -0
- package/es/lowcode/view/Page.js +199 -2
- package/es/lowcode/view/index.js +0 -0
- 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 +72 -7
- package/es/lowcode/view/lc-components/Button/meta.json +122 -0
- package/es/lowcode/view/lc-components/CardList/FunctionDesign.js +9 -0
- package/es/lowcode/view/lc-components/CardList/FunctionLive.js +9 -0
- package/es/lowcode/view/lc-components/CardList/index.js +0 -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 +9 -0
- package/es/lowcode/view/lc-components/Dialog/FunctionLive.js +9 -0
- package/es/lowcode/view/lc-components/Dialog/index.js +12 -1
- package/es/lowcode/view/lc-components/Dialog/index.less +0 -0
- package/es/lowcode/view/lc-components/Dialog/meta.json +121 -0
- package/es/lowcode/view/lc-components/Drawer/FunctionDesign.js +9 -0
- package/es/lowcode/view/lc-components/Drawer/FunctionLive.js +9 -0
- package/es/lowcode/view/lc-components/Drawer/index.js +19 -3
- package/es/lowcode/view/lc-components/Drawer/meta.json +144 -0
- package/es/lowcode/view/lc-components/Drawer/style.less +7 -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/index.js +0 -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/index.js +0 -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/index.js +0 -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/index.js +0 -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/index.js +0 -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/index.js +0 -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/index.js +0 -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/index.js +0 -0
- package/es/lowcode/view/lc-components/Split/meta.json +72 -0
- package/es/lowcode/view/lc-components/Table/FunctionDesign.js +16 -0
- package/es/lowcode/view/lc-components/Table/FunctionLive.js +9 -0
- package/es/lowcode/view/lc-components/Table/index.js +138 -8
- package/es/lowcode/view/lc-components/Table/meta.json +174 -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/index.js +0 -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/index.js +0 -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/index.js +0 -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/canvas.less +0 -0
- package/es/lowcode/view/style/loading.less +0 -0
- package/es/lowcode/view/style/page.less +0 -1
- package/es/services.js +0 -0
- package/es/upload/Form/gridForm.js +1 -1
- package/es/upload/Form/index.js +0 -0
- package/es/upload/Form/index.less +0 -0
- package/es/upload/FormItem/index.js +0 -0
- package/es/upload/GridCell/index.js +0 -0
- package/es/upload/index.js +0 -0
- package/es/utils/action.js +0 -0
- package/es/utils/form.js +0 -0
- package/es/utils/grid.js +4 -3
- package/es/utils/index.js +0 -0
- package/lib/components/Builder/index.js +0 -0
- package/lib/components/LdAutoForm/index.js +0 -0
- package/lib/components/LdCard/index.js +0 -0
- package/lib/components/LdCard/model.js +0 -0
- package/lib/components/LdCom/index.js +0 -0
- package/lib/components/LdFormList/index.js +1 -5
- package/lib/components/LdFormList/model.js +0 -0
- package/lib/components/LdGrid/index.js +0 -0
- package/lib/components/LdGrid/model.js +0 -0
- package/lib/components/LdGridForm/index.js +0 -0
- package/lib/components/LdGridForm/index.less +0 -0
- package/lib/components/LdInfoPanel/index.js +0 -0
- package/lib/components/LdPop/index.js +0 -0
- package/lib/components/LdRuntimeCom/index.js +0 -0
- package/lib/components/LdTree/index.js +0 -0
- package/lib/components/LdTree/index.less +0 -0
- package/lib/helper/FromItems.js +0 -0
- package/lib/helper/action.js +0 -0
- package/lib/helper/form.js +0 -0
- package/lib/helper/index.less +0 -0
- package/lib/helper/ldBuilder.js +0 -0
- package/lib/helper/ldComBuild.js +0 -0
- package/lib/index.js +0 -0
- package/lib/lowcode/constants/api-url.js +3 -2
- package/lib/lowcode/constants/event-topics.js +15 -2
- package/lib/lowcode/constants/index.js +0 -0
- package/lib/lowcode/engine/factory/DataFactory.js +0 -0
- 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/SegmentedStrategy.js +38 -0
- package/lib/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +56 -0
- package/lib/lowcode/engine/factory/panel-item-factory/Strategy.js +27 -0
- package/lib/lowcode/engine/factory/panel-item-factory/StringStrategy.js +56 -0
- package/lib/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +38 -0
- package/lib/lowcode/engine/factory/panel-item-factory/index.js +48 -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} +121 -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 +11 -9
- package/lib/lowcode/engine/meta/table.props.json +174 -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 +9 -16
- package/lib/lowcode/engine/provider/EventBusProvider.js +2 -2
- package/lib/lowcode/engine/tools/dataProcess.js +81 -5
- package/lib/lowcode/engine/tools/helper.js +0 -0
- package/lib/lowcode/engine/tools/usePromiseState.js +31 -0
- package/lib/lowcode/index.js +0 -0
- package/lib/lowcode/painter/Components.js +0 -0
- package/lib/lowcode/painter/Design.js +271 -40
- package/lib/lowcode/painter/I18n.js +203 -2
- package/lib/lowcode/painter/Outline.js +32 -27
- package/lib/lowcode/painter/Panel.js +201 -2
- package/lib/lowcode/painter/Ribbon.js +63 -64
- package/lib/lowcode/painter/components/Collapse.js +39 -0
- package/lib/lowcode/painter/components/NumberInput.js +101 -0
- package/lib/lowcode/painter/components/PanelItem.js +53 -9
- package/lib/lowcode/painter/components/PopConfirm.js +26 -0
- package/lib/lowcode/painter/components/PopForm.js +77 -0
- package/lib/lowcode/painter/components/RuleInput.js +4 -4
- package/lib/lowcode/painter/components/SortBox.js +99 -0
- package/lib/lowcode/painter/components/TabEditor.js +94 -0
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +126 -0
- package/lib/lowcode/painter/components/code-editor/CssEditor.js +22 -0
- package/lib/lowcode/painter/components/code-editor/FullScreenEditor.js +72 -0
- package/lib/lowcode/painter/components/code-editor/JSEditor.js +95 -0
- package/lib/lowcode/painter/components/code-editor/index.js +20 -0
- package/lib/lowcode/painter/index.js +29 -1
- package/lib/lowcode/painter/panel-section/ButtonType.js +46 -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 +55 -48
- package/lib/lowcode/painter/panel-section/StylePanel/Display.js +299 -0
- package/lib/lowcode/painter/panel-section/StylePanel/DisplaySvg.js +550 -0
- package/lib/lowcode/painter/panel-section/StylePanel/Height.js +55 -0
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +72 -0
- package/lib/lowcode/painter/panel-section/StylePanel/StyleContext.js +112 -0
- package/lib/lowcode/painter/panel-section/StylePanel/Width.js +55 -0
- package/lib/lowcode/painter/panel-section/StylePanel/index.js +19 -0
- package/lib/lowcode/painter/panel-section/TabItems.js +245 -0
- package/lib/lowcode/painter/services/I18n.js +95 -0
- package/lib/lowcode/painter/style/button-type.less +5 -0
- package/lib/lowcode/painter/style/collapse.less +21 -0
- package/lib/lowcode/painter/style/components.less +0 -0
- package/lib/lowcode/painter/style/design.less +109 -5
- package/lib/lowcode/painter/style/display.less +17 -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/number-input.less +17 -0
- package/lib/lowcode/painter/style/outline.less +2 -0
- package/lib/lowcode/painter/style/panel-item.less +38 -15
- package/lib/lowcode/painter/style/panel.less +137 -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/radio.less +0 -0
- package/lib/lowcode/painter/style/ribbon.less +1 -0
- package/lib/lowcode/painter/style/rule-input.less +0 -0
- package/lib/lowcode/painter/style/style-panel.less +5 -0
- package/lib/lowcode/painter/style/tabeditor.less +90 -0
- package/lib/lowcode/painter/style/tabitems.less +90 -0
- package/lib/lowcode/view/Canvas.js +68 -60
- package/lib/lowcode/view/Loading.js +0 -0
- package/lib/lowcode/view/Page.js +198 -1
- package/lib/lowcode/view/index.js +0 -0
- 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 +73 -8
- package/lib/lowcode/view/lc-components/Button/meta.json +122 -0
- package/lib/lowcode/view/lc-components/CardList/FunctionDesign.js +16 -0
- package/lib/lowcode/view/lc-components/CardList/FunctionLive.js +16 -0
- package/lib/lowcode/view/lc-components/CardList/index.js +0 -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 +16 -0
- package/lib/lowcode/view/lc-components/Dialog/FunctionLive.js +16 -0
- package/lib/lowcode/view/lc-components/Dialog/index.js +11 -0
- package/lib/lowcode/view/lc-components/Dialog/index.less +0 -0
- package/lib/lowcode/view/lc-components/Dialog/meta.json +121 -0
- package/lib/lowcode/view/lc-components/Drawer/FunctionDesign.js +16 -0
- package/lib/lowcode/view/lc-components/Drawer/FunctionLive.js +16 -0
- package/lib/lowcode/view/lc-components/Drawer/index.js +18 -2
- package/lib/lowcode/view/lc-components/Drawer/meta.json +144 -0
- package/lib/lowcode/view/lc-components/Drawer/style.less +7 -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/index.js +0 -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/index.js +0 -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/index.js +0 -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/index.js +0 -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/index.js +0 -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/index.js +0 -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/index.js +0 -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/index.js +0 -0
- package/lib/lowcode/view/lc-components/Split/meta.json +72 -0
- package/lib/lowcode/view/lc-components/Table/FunctionDesign.js +23 -0
- package/lib/lowcode/view/lc-components/Table/FunctionLive.js +16 -0
- package/lib/lowcode/view/lc-components/Table/index.js +138 -8
- package/lib/lowcode/view/lc-components/Table/meta.json +174 -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/index.js +0 -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/index.js +0 -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/index.js +0 -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/canvas.less +0 -0
- package/lib/lowcode/view/style/loading.less +0 -0
- package/lib/lowcode/view/style/page.less +0 -1
- package/lib/services.js +0 -0
- package/lib/upload/Form/gridForm.js +1 -1
- package/lib/upload/Form/index.js +0 -0
- package/lib/upload/Form/index.less +0 -0
- package/lib/upload/FormItem/index.js +0 -0
- package/lib/upload/GridCell/index.js +0 -0
- package/lib/upload/index.js +0 -0
- package/lib/utils/action.js +0 -0
- package/lib/utils/form.js +0 -0
- package/lib/utils/grid.js +6 -5
- package/lib/utils/index.js +0 -0
- package/lowcode.js +0 -0
- package/package.json +12 -5
- package/upload.js +0 -0
- package/utils.js +0 -0
- 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
|
@@ -1,26 +1,70 @@
|
|
|
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 _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _lodash = require("lodash");
|
|
9
12
|
var _panelItem = _interopRequireDefault(require("../style/panel-item.less"));
|
|
13
|
+
var _antd = require("luck-design/antd");
|
|
10
14
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
+
* `PanelItem` 组件用于展示属性面板中的单个属性项。
|
|
16
|
+
* 它支持展示一个标签(属性名称)及对应的组件(例如输入框、选择器等),并可通过传入的 `addon` 属性添加额外的内容。
|
|
17
|
+
* 此组件支持折叠功能,可以通过 `collapsed` 属性控制初始折叠状态。
|
|
18
|
+
*
|
|
19
|
+
* @component
|
|
20
|
+
* @example
|
|
21
|
+
* ```jsx
|
|
22
|
+
* <PanelItem
|
|
23
|
+
* label="属性名称"
|
|
24
|
+
* collapsed={false}
|
|
25
|
+
* addon={<div>额外内容</div>}
|
|
26
|
+
* >
|
|
27
|
+
* <input type="text" />
|
|
28
|
+
* </PanelItem>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @param {Object} props 组件接收的参数。
|
|
32
|
+
* @param {string} props.label 显示的属性名称。如果标签以 `#` 开头,则不显示。
|
|
33
|
+
* @param {boolean} [props.collapsed=true] 初始是否折叠。默认为 `true`。
|
|
34
|
+
* @param {React.ReactNode} props.addon 当属性项展开时,可以在下方显示额外内容。
|
|
35
|
+
* @param {React.ReactNode} props.children 对应于属性名称的组件,可以是输入框、下拉菜单等 React 节点。
|
|
36
|
+
*
|
|
37
|
+
* @returns {React.Element} 渲染属性名称、对应的组件以及可选的额外内容。
|
|
15
38
|
*/
|
|
16
39
|
function _default(_ref) {
|
|
17
40
|
var label = _ref.label,
|
|
18
|
-
|
|
41
|
+
_ref$collapsed = _ref.collapsed,
|
|
42
|
+
collapsed = _ref$collapsed === void 0 ? true : _ref$collapsed,
|
|
43
|
+
addon = _ref.addon,
|
|
44
|
+
children = _ref.children;
|
|
45
|
+
var _useState = (0, _react.useState)(collapsed),
|
|
46
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
47
|
+
curClps = _useState2[0],
|
|
48
|
+
setCurClps = _useState2[1];
|
|
49
|
+
var HandleClick = function HandleClick() {
|
|
50
|
+
setCurClps(!curClps);
|
|
51
|
+
};
|
|
52
|
+
(0, _react.useEffect)(function () {
|
|
53
|
+
setCurClps(collapsed);
|
|
54
|
+
}, [collapsed]);
|
|
19
55
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
20
56
|
className: _panelItem.default['lc-painter-components-panelitem']
|
|
21
|
-
}, /*#__PURE__*/_react.default.createElement("
|
|
57
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
58
|
+
className: _panelItem.default['panelrow']
|
|
59
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
22
60
|
className: _panelItem.default['item-label']
|
|
23
|
-
},
|
|
61
|
+
}, addon && /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
62
|
+
className: _panelItem.default['item-icon'],
|
|
63
|
+
type: !curClps ? 'down' : 'right',
|
|
64
|
+
onClick: HandleClick
|
|
65
|
+
}), label && !(0, _lodash.startsWith)(label, '#') && /*#__PURE__*/_react.default.createElement("span", null, label)), /*#__PURE__*/_react.default.createElement("span", {
|
|
24
66
|
className: _panelItem.default['item-component']
|
|
25
|
-
},
|
|
67
|
+
}, children)), !curClps && /*#__PURE__*/_react.default.createElement("div", {
|
|
68
|
+
className: _panelItem.default['addon']
|
|
69
|
+
}, addon));
|
|
26
70
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
}, props));
|
|
26
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.PopFormItemRight = exports.PopFormItemLeft = exports.PopFormItem = exports.PopForm = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _popForm = _interopRequireDefault(require("../style/pop-form.less"));
|
|
12
|
+
var _excluded = ["children"],
|
|
13
|
+
_excluded2 = ["children"],
|
|
14
|
+
_excluded3 = ["children"],
|
|
15
|
+
_excluded4 = ["children"];
|
|
16
|
+
/**
|
|
17
|
+
* PopForm 是一个为弹出式表单布局提供容器的组件,它使用特定的样式来组织表单内容。
|
|
18
|
+
*
|
|
19
|
+
* @param {Object} props - 组件的 props。
|
|
20
|
+
* @param {ReactNode} props.children - 组件内包含的子元素。
|
|
21
|
+
* @param {Object} rest - 传递给组件的其余属性,这些属性将直接传递给根 div 元素。
|
|
22
|
+
*/
|
|
23
|
+
var PopForm = exports.PopForm = function PopForm(_ref) {
|
|
24
|
+
var children = _ref.children,
|
|
25
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
|
27
|
+
className: _popForm.default['lc-painter-panel-section-components-popform']
|
|
28
|
+
}, rest), children);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* PopFormItem 是 PopForm 组件的一个子项,用于包装表单的每个独立字段。
|
|
33
|
+
* 它提供了一致的布局和样式封装,用于表单项的展示。
|
|
34
|
+
*
|
|
35
|
+
* @param {Object} props - 组件的 props。
|
|
36
|
+
* @param {ReactNode} props.children - 组件内包含的子元素。
|
|
37
|
+
* @param {Object} rest - 传递给组件的其余属性,这些属性将直接传递给根 div 元素。
|
|
38
|
+
*/
|
|
39
|
+
var PopFormItem = exports.PopFormItem = function PopFormItem(_ref2) {
|
|
40
|
+
var children = _ref2.children,
|
|
41
|
+
rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
|
|
42
|
+
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
|
43
|
+
className: _popForm.default['item']
|
|
44
|
+
}, rest), children);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* PopFormItemLeft 是 PopFormItem 的子组件,用于展示表单项的标签或标题部分。
|
|
49
|
+
* 它通常用于放置字段名或说明性文本。
|
|
50
|
+
*
|
|
51
|
+
* @param {Object} props - 组件的 props。
|
|
52
|
+
* @param {ReactNode} props.children - 组件内包含的子元素。
|
|
53
|
+
* @param {Object} rest - 传递给组件的其余属性,这些属性将直接传递给根 div 元素。
|
|
54
|
+
*/
|
|
55
|
+
var PopFormItemLeft = exports.PopFormItemLeft = function PopFormItemLeft(_ref3) {
|
|
56
|
+
var children = _ref3.children,
|
|
57
|
+
rest = (0, _objectWithoutProperties2.default)(_ref3, _excluded3);
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
|
59
|
+
className: _popForm.default['left']
|
|
60
|
+
}, rest), children);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* PopFormItemRight 是 PopFormItem 的子组件,用于包含表单项的输入字段。
|
|
65
|
+
* 它是表单项布局中用于用户输入的部分,可以容纳各种类型的输入控件。
|
|
66
|
+
*
|
|
67
|
+
* @param {Object} props - 组件的 props。
|
|
68
|
+
* @param {ReactNode} props.children - 组件内包含的子元素。
|
|
69
|
+
* @param {Object} rest - 传递给组件的其余属性,这些属性将直接传递给根 div 元素。
|
|
70
|
+
*/
|
|
71
|
+
var PopFormItemRight = exports.PopFormItemRight = function PopFormItemRight(_ref4) {
|
|
72
|
+
var children = _ref4.children,
|
|
73
|
+
rest = (0, _objectWithoutProperties2.default)(_ref4, _excluded4);
|
|
74
|
+
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
|
75
|
+
className: _popForm.default['right']
|
|
76
|
+
}, rest), children);
|
|
77
|
+
};
|
|
@@ -7,11 +7,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
11
|
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
|
|
11
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
13
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
15
|
var _antd = require("luck-design/antd");
|
|
16
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
17
|
var _ruleInput = _interopRequireDefault(require("../style/rule-input.less"));
|
|
16
18
|
var _excluded = ["onValueChange", "rules", "value"];
|
|
17
19
|
/**
|
|
@@ -92,16 +94,14 @@ var _default = exports.default = /*#__PURE__*/(0, _react.forwardRef)(function (_
|
|
|
92
94
|
onValueChange(e, value);
|
|
93
95
|
} else {
|
|
94
96
|
setErr(error);
|
|
95
|
-
console.
|
|
97
|
+
console.error(error);
|
|
96
98
|
}
|
|
97
99
|
};
|
|
98
|
-
var className = _ruleInput.default['lc-painter-components-ruleinput'];
|
|
99
|
-
if (err) className += ' ' + _ruleInput.default['err'];
|
|
100
100
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_antd.Tooltip, {
|
|
101
101
|
title: err,
|
|
102
102
|
visible: err
|
|
103
103
|
}, /*#__PURE__*/_react.default.createElement(_antd.Input, (0, _extends2.default)({
|
|
104
|
-
className:
|
|
104
|
+
className: (0, _classnames.default)(_ruleInput.default['lc-painter-components-ruleinput'], (0, _defineProperty2.default)({}, _ruleInput.default.err, !!err)),
|
|
105
105
|
size: "small",
|
|
106
106
|
value: inputValue // 绑定输入值
|
|
107
107
|
,
|
|
@@ -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.SortItem = exports.SortBox = void 0;
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _core = require("@dnd-kit/core");
|
|
12
|
+
var _sortable = require("@dnd-kit/sortable");
|
|
13
|
+
var _utilities = require("@dnd-kit/utilities");
|
|
14
|
+
/**
|
|
15
|
+
* SortBox 是一个使用 dnd-kit 实现拖拽排序的组件。
|
|
16
|
+
* 它允许子元素通过拖拽操作来重新排序,并在排序操作完成后通过 onChange 回调传递新的排序结果。
|
|
17
|
+
*
|
|
18
|
+
* @param {Object} props 组件的 props。
|
|
19
|
+
* @param {Array} props.datas 初始排序的数据数组,通常包含用于排序的唯一标识符。
|
|
20
|
+
* @param {ReactNode} props.children 组件的子元素,通常是需要进行排序的元素集合。
|
|
21
|
+
* @param {Function} props.onChange 当排序操作完成时触发的回调函数,参数为重新排序后的数据数组。
|
|
22
|
+
* @param {Function} [props.strategy=verticalListSortingStrategy] 用于排序的策略。默认为垂直列表排序策略。
|
|
23
|
+
*
|
|
24
|
+
* @returns {ReactNode} 返回一个配置了 DndContext 和 SortableContext 的 React 组件结构。
|
|
25
|
+
*/
|
|
26
|
+
var SortBox = exports.SortBox = function SortBox(_ref) {
|
|
27
|
+
var datas = _ref.datas,
|
|
28
|
+
children = _ref.children,
|
|
29
|
+
onChange = _ref.onChange,
|
|
30
|
+
strategy = _ref.strategy;
|
|
31
|
+
var _useState = (0, _react.useState)(datas),
|
|
32
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
33
|
+
items = _useState2[0],
|
|
34
|
+
setItems = _useState2[1];
|
|
35
|
+
var sortStrategy = strategy !== null && strategy !== void 0 ? strategy : _sortable.verticalListSortingStrategy;
|
|
36
|
+
(0, _react.useEffect)(function () {
|
|
37
|
+
setItems(datas);
|
|
38
|
+
}, [datas]);
|
|
39
|
+
function handleDragEnd(event) {
|
|
40
|
+
var active = event.active,
|
|
41
|
+
over = event.over;
|
|
42
|
+
if (active.id !== over.id) {
|
|
43
|
+
setItems(function (items) {
|
|
44
|
+
var oldIndex = items.indexOf(active.id);
|
|
45
|
+
var newIndex = items.indexOf(over.id);
|
|
46
|
+
var newSortItem = (0, _sortable.arrayMove)(items, oldIndex, newIndex);
|
|
47
|
+
if (onChange) onChange(newSortItem);
|
|
48
|
+
return newSortItem;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement(_core.DndContext, {
|
|
53
|
+
onDragEnd: handleDragEnd
|
|
54
|
+
}, /*#__PURE__*/_react.default.createElement(_sortable.SortableContext, {
|
|
55
|
+
strategy: sortStrategy,
|
|
56
|
+
items: items
|
|
57
|
+
}, children));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* SortItem 组件是一个使用 dnd-kit 实现的可排序项。它通过 useSortable 钩子来提供拖拽功能,
|
|
62
|
+
* 并将必要的属性和监听器传递给其子元素,使得子元素可拖拽。
|
|
63
|
+
*
|
|
64
|
+
* @param {Object} props - 组件的 props。
|
|
65
|
+
* @param {string} props.id - 该排序项的唯一标识符,用于识别不同的可排序元素。
|
|
66
|
+
* @param {ReactNode} props.children - 该组件的子元素。通常是你希望使之可拖拽的元素。
|
|
67
|
+
* SortItem 会将拖拽相关的 props 注入到这个子元素中。
|
|
68
|
+
*
|
|
69
|
+
* @returns {ReactNode} 返回一个增强后的 React 元素,此元素集成了拖拽功能。
|
|
70
|
+
* 它基于原 children 元素,附加了用于拖拽的属性和样式。
|
|
71
|
+
*/
|
|
72
|
+
var SortItem = exports.SortItem = function SortItem(_ref2) {
|
|
73
|
+
var id = _ref2.id,
|
|
74
|
+
children = _ref2.children;
|
|
75
|
+
var _useSortable = (0, _sortable.useSortable)({
|
|
76
|
+
id: id
|
|
77
|
+
}),
|
|
78
|
+
attributes = _useSortable.attributes,
|
|
79
|
+
listeners = _useSortable.listeners,
|
|
80
|
+
setNodeRef = _useSortable.setNodeRef,
|
|
81
|
+
transform = _useSortable.transform,
|
|
82
|
+
transition = _useSortable.transition,
|
|
83
|
+
setActivatorNodeRef = _useSortable.setActivatorNodeRef;
|
|
84
|
+
var style = {
|
|
85
|
+
transform: _utilities.CSS.Transform.toString(transform),
|
|
86
|
+
transition: transition
|
|
87
|
+
};
|
|
88
|
+
var childWithProps = /*#__PURE__*/_react.default.cloneElement(children, {
|
|
89
|
+
key: id,
|
|
90
|
+
attributes: attributes,
|
|
91
|
+
listeners: listeners,
|
|
92
|
+
setNodeRef: setNodeRef,
|
|
93
|
+
transform: transform,
|
|
94
|
+
transition: transition,
|
|
95
|
+
setActivatorNodeRef: setActivatorNodeRef,
|
|
96
|
+
style: style
|
|
97
|
+
});
|
|
98
|
+
return childWithProps;
|
|
99
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.TabEditorItem = exports.TabEditor = 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 _tabeditor = _interopRequireDefault(require("../style/tabeditor.less"));
|
|
13
|
+
/**
|
|
14
|
+
* TabEditor 是一个用于管理和展示一组可编辑标签项的容器组件。
|
|
15
|
+
* 它提供了一个添加新标签项的操作按钮,并通过 children 属性接收一组 TabEditorItem 组件。
|
|
16
|
+
*
|
|
17
|
+
* @param {Object} props - 组件接收的属性。
|
|
18
|
+
* @param {ReactNode} props.children - TabEditorItem 组件的实例,表示可编辑的标签项。
|
|
19
|
+
* @param {Function} props.handleAdd - 一个回调函数,当用户点击添加按钮时被触发,用于添加新的标签项。
|
|
20
|
+
* @returns {ReactNode} 渲染一个带有操作按钮和标签项的容器。
|
|
21
|
+
*/
|
|
22
|
+
var TabEditor = exports.TabEditor = function TabEditor(_ref) {
|
|
23
|
+
var children = _ref.children,
|
|
24
|
+
handleAdd = _ref.handleAdd;
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
26
|
+
className: _tabeditor.default['lc-painter-panel-section-components-tabeditor']
|
|
27
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
28
|
+
className: _tabeditor.default['tabs-box']
|
|
29
|
+
}, children), /*#__PURE__*/_react.default.createElement("div", {
|
|
30
|
+
className: _tabeditor.default['tabs-actions']
|
|
31
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
32
|
+
className: _tabeditor.default['tabs-action'],
|
|
33
|
+
onClick: handleAdd
|
|
34
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
35
|
+
type: "plus-circle"
|
|
36
|
+
}), ' ', (0, _utils.formatMessage)({
|
|
37
|
+
id: 'luckda.lowcode.painter.panel-section.components.tabeditor.add',
|
|
38
|
+
label: '添加一项'
|
|
39
|
+
}))));
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* TabEditorItem 是一个可编辑的标签项组件,用于在 TabEditor 容器内展示。
|
|
44
|
+
* 它支持拖拽排序,并可以通过左侧和右侧的插槽来自定义内容。
|
|
45
|
+
*
|
|
46
|
+
* @param {Object} props - 组件接收的属性。
|
|
47
|
+
* @param {Object} props.item - 表示标签项数据的对象。
|
|
48
|
+
* @param {ReactNode} props.left - 放置在标签项左侧的内容,通常用于展示标签名称或其他信息。
|
|
49
|
+
* @param {ReactNode} props.right - 放置在标签项右侧的内容,通常用于展示操作按钮如编辑或删除。
|
|
50
|
+
* @param {Function} props.setNodeRef - 用于设置拖拽组件根节点的引用。
|
|
51
|
+
* @param {Function} props.setActivatorNodeRef - 用于设置激活拖拽操作的节点引用。
|
|
52
|
+
* @param {Object} props.style - 应用于标签项的样式对象,通常包含拖拽过程中的动态变化样式。
|
|
53
|
+
* @param {Object} props.attributes - 包含与拖拽相关的HTML属性。
|
|
54
|
+
* @param {Object} props.listeners - 包含处理拖拽事件的监听器。
|
|
55
|
+
* @param {CSSProperties} props.transform - 应用于组件的CSS变换属性,用于实现拖拽效果。
|
|
56
|
+
* @param {string} props.transition - 定义拖拽动画的CSS过渡属性。
|
|
57
|
+
* @returns {ReactNode} 渲染一个可编辑的标签项,支持拖拽排序。
|
|
58
|
+
*/
|
|
59
|
+
var TabEditorItem = exports.TabEditorItem = function TabEditorItem(_ref2) {
|
|
60
|
+
var item = _ref2.item,
|
|
61
|
+
left = _ref2.left,
|
|
62
|
+
right = _ref2.right,
|
|
63
|
+
setNodeRef = _ref2.setNodeRef,
|
|
64
|
+
setActivatorNodeRef = _ref2.setActivatorNodeRef,
|
|
65
|
+
style = _ref2.style,
|
|
66
|
+
attributes = _ref2.attributes,
|
|
67
|
+
listeners = _ref2.listeners,
|
|
68
|
+
transform = _ref2.transform,
|
|
69
|
+
transition = _ref2.transition;
|
|
70
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
71
|
+
ref: setNodeRef,
|
|
72
|
+
style: style,
|
|
73
|
+
className: _tabeditor.default['tabitem']
|
|
74
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
75
|
+
className: _tabeditor.default['tabitem-left']
|
|
76
|
+
}, /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
|
77
|
+
ref: setActivatorNodeRef
|
|
78
|
+
}, attributes, listeners, {
|
|
79
|
+
className: _tabeditor.default['dragicon']
|
|
80
|
+
}), /*#__PURE__*/_react.default.createElement("svg", {
|
|
81
|
+
fill: "currentColor",
|
|
82
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
83
|
+
width: "16",
|
|
84
|
+
height: "12",
|
|
85
|
+
viewBox: "0 0 5 12",
|
|
86
|
+
style: {
|
|
87
|
+
verticalAlign: 'middle'
|
|
88
|
+
}
|
|
89
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
90
|
+
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"
|
|
91
|
+
}))), left), /*#__PURE__*/_react.default.createElement("div", {
|
|
92
|
+
className: _tabeditor.default['tabitem-right']
|
|
93
|
+
}, right));
|
|
94
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
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 = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
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 monaco = _interopRequireWildcard(require("monaco-editor"));
|
|
15
|
+
var _excluded = ["onChange"],
|
|
16
|
+
_excluded2 = ["children", "language", "options", "onFullscreenChange"];
|
|
17
|
+
var BaseEditor = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
18
|
+
var onChange = _ref.onChange,
|
|
19
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
20
|
+
var children = props.children,
|
|
21
|
+
_props$language = props.language,
|
|
22
|
+
language = _props$language === void 0 ? 'javascript' : _props$language,
|
|
23
|
+
_props$options = props.options,
|
|
24
|
+
options = _props$options === void 0 ? {} : _props$options,
|
|
25
|
+
onFullscreenChange = props.onFullscreenChange,
|
|
26
|
+
rest = (0, _objectWithoutProperties2.default)(props, _excluded2);
|
|
27
|
+
var _useState = (0, _react.useState)(false),
|
|
28
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
29
|
+
isFullScreen = _useState2[0],
|
|
30
|
+
setIsFullScreen = _useState2[1];
|
|
31
|
+
var editorRef = (0, _react.useRef)(null);
|
|
32
|
+
var editorInstance = (0, _react.useRef)(null);
|
|
33
|
+
|
|
34
|
+
// 全屏切换方法
|
|
35
|
+
var toggleFullScreen = function toggleFullScreen() {
|
|
36
|
+
var element = editorRef.current;
|
|
37
|
+
if (!document.fullscreenElement) {
|
|
38
|
+
if (element.requestFullscreen) {
|
|
39
|
+
element.requestFullscreen();
|
|
40
|
+
} else if (element.mozRequestFullScreen) {
|
|
41
|
+
element.mozRequestFullScreen();
|
|
42
|
+
} else if (element.webkitRequestFullscreen) {
|
|
43
|
+
element.webkitRequestFullscreen();
|
|
44
|
+
} else if (element.msRequestFullscreen) {
|
|
45
|
+
element.msRequestFullscreen();
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
if (document.exitFullscreen) {
|
|
49
|
+
document.exitFullscreen();
|
|
50
|
+
} else if (document.mozCancelFullScreen) {
|
|
51
|
+
document.mozCancelFullScreen();
|
|
52
|
+
} else if (document.webkitExitFullscreen) {
|
|
53
|
+
document.webkitExitFullscreen();
|
|
54
|
+
} else if (document.msExitFullscreen) {
|
|
55
|
+
document.msExitFullscreen();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// 监听全屏状态的改变,并调用 layout
|
|
61
|
+
(0, _react.useEffect)(function () {
|
|
62
|
+
var handleFullScreenChange = function handleFullScreenChange() {
|
|
63
|
+
var isFullScreenNow = !!document.fullscreenElement;
|
|
64
|
+
setIsFullScreen(isFullScreenNow);
|
|
65
|
+
if (editorInstance.current) {
|
|
66
|
+
editorInstance.current.layout();
|
|
67
|
+
}
|
|
68
|
+
if (onFullscreenChange) onFullscreenChange(isFullScreenNow);
|
|
69
|
+
};
|
|
70
|
+
document.addEventListener('fullscreenchange', handleFullScreenChange);
|
|
71
|
+
|
|
72
|
+
// 组件卸载时移除事件监听器
|
|
73
|
+
return function () {
|
|
74
|
+
document.removeEventListener('fullscreenchange', handleFullScreenChange);
|
|
75
|
+
};
|
|
76
|
+
}, []);
|
|
77
|
+
|
|
78
|
+
// 初始化编辑器实例
|
|
79
|
+
(0, _react.useEffect)(function () {
|
|
80
|
+
if (editorRef.current) {
|
|
81
|
+
var code = _react.default.Children.toArray(children).join('').trim();
|
|
82
|
+
editorInstance.current = monaco.editor.create(editorRef.current, (0, _objectSpread2.default)({
|
|
83
|
+
value: code,
|
|
84
|
+
language: language
|
|
85
|
+
}, options));
|
|
86
|
+
editorInstance.current.onDidChangeModelContent(function (event) {
|
|
87
|
+
if (onChange) onChange(editorInstance.current.getValue(), event);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return function () {
|
|
91
|
+
var _editorInstance$curre;
|
|
92
|
+
return (_editorInstance$curre = editorInstance.current) === null || _editorInstance$curre === void 0 ? void 0 : _editorInstance$curre.dispose();
|
|
93
|
+
};
|
|
94
|
+
}, [children, language, options]);
|
|
95
|
+
|
|
96
|
+
// 使用 ref 暴露组件方法
|
|
97
|
+
(0, _react.useImperativeHandle)(ref, function () {
|
|
98
|
+
return {
|
|
99
|
+
get editor() {
|
|
100
|
+
return editorInstance.current;
|
|
101
|
+
},
|
|
102
|
+
toggleFullScreen: toggleFullScreen
|
|
103
|
+
};
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
// 更新编辑器布局当全屏状态改变
|
|
107
|
+
(0, _react.useEffect)(function () {
|
|
108
|
+
if (editorInstance.current) {
|
|
109
|
+
editorInstance.current.layout();
|
|
110
|
+
}
|
|
111
|
+
}, [isFullScreen]);
|
|
112
|
+
|
|
113
|
+
// 根据是否全屏来设置编辑器的样式
|
|
114
|
+
var editorStyle = isFullScreen ? {
|
|
115
|
+
width: '100vw',
|
|
116
|
+
height: '100vh'
|
|
117
|
+
} : {
|
|
118
|
+
width: props.width || '100%',
|
|
119
|
+
height: props.height || '100%'
|
|
120
|
+
};
|
|
121
|
+
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
|
122
|
+
ref: editorRef,
|
|
123
|
+
style: editorStyle
|
|
124
|
+
}, rest));
|
|
125
|
+
});
|
|
126
|
+
var _default = exports.default = /*#__PURE__*/_react.default.memo(BaseEditor);
|
|
@@ -0,0 +1,22 @@
|
|
|
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 = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _BaseEditor = _interopRequireDefault(require("./BaseEditor"));
|
|
13
|
+
var _excluded = ["children"];
|
|
14
|
+
var CssEditor = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
15
|
+
var children = _ref.children,
|
|
16
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
17
|
+
return /*#__PURE__*/_react.default.createElement(_BaseEditor.default, (0, _extends2.default)({
|
|
18
|
+
ref: ref,
|
|
19
|
+
language: "css"
|
|
20
|
+
}, rest), children);
|
|
21
|
+
});
|
|
22
|
+
var _default = exports.default = /*#__PURE__*/_react.default.memo(CssEditor);
|
|
@@ -0,0 +1,72 @@
|
|
|
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 = void 0;
|
|
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 _antd = require("luck-design/antd");
|
|
14
|
+
var _utils = require("@luck-design-biz/base/utils");
|
|
15
|
+
var _fullscreenEditor = _interopRequireDefault(require("../../style/fullscreen-editor.less"));
|
|
16
|
+
var _excluded = ["EditorComponent", "onLoad", "children"];
|
|
17
|
+
var FullScreenEditor = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
18
|
+
var EditorComponent = _ref.EditorComponent,
|
|
19
|
+
onLoad = _ref.onLoad,
|
|
20
|
+
children = _ref.children,
|
|
21
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
22
|
+
var _useState = (0, _react.useState)(false),
|
|
23
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
24
|
+
isFullScreen = _useState2[0],
|
|
25
|
+
setIsFullScreen = _useState2[1];
|
|
26
|
+
var handleFullscreen = function handleFullscreen() {
|
|
27
|
+
if (ref.current && ref.current.toggleFullScreen) {
|
|
28
|
+
ref.current.toggleFullScreen();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
var HandleFullscreenChange = function HandleFullscreenChange(fullscrean) {
|
|
32
|
+
setIsFullScreen(fullscrean);
|
|
33
|
+
};
|
|
34
|
+
(0, _react.useEffect)(function () {
|
|
35
|
+
if (onLoad) onLoad();
|
|
36
|
+
}, []);
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
38
|
+
className: _fullscreenEditor.default['lc-painter-components-fullscreen-editor']
|
|
39
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
40
|
+
className: _fullscreenEditor.default['actions']
|
|
41
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Tooltip, {
|
|
42
|
+
title: (0, _utils.formatMessage)({
|
|
43
|
+
id: 'luckda.lowcode.painter.components.fullscreen.tip',
|
|
44
|
+
label: '全屏'
|
|
45
|
+
})
|
|
46
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Icon, {
|
|
47
|
+
type: "fullscreen",
|
|
48
|
+
onClick: handleFullscreen
|
|
49
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
50
|
+
className: isFullScreen ? _fullscreenEditor.default['fullscreen'] : ''
|
|
51
|
+
}, /*#__PURE__*/_react.default.createElement(EditorComponent, (0, _extends2.default)({
|
|
52
|
+
ref: ref,
|
|
53
|
+
onFullscreenChange: HandleFullscreenChange,
|
|
54
|
+
options: isFullScreen ? {} : {
|
|
55
|
+
lineNumbers: 'off',
|
|
56
|
+
glyphMargin: false,
|
|
57
|
+
folding: false,
|
|
58
|
+
lineDecorationsWidth: 0,
|
|
59
|
+
lineNumbersMinChars: 0,
|
|
60
|
+
minimap: {
|
|
61
|
+
enabled: false
|
|
62
|
+
},
|
|
63
|
+
overviewRulerLanes: 0,
|
|
64
|
+
scrollbar: {
|
|
65
|
+
vertical: 'hidden',
|
|
66
|
+
horizontal: 'hidden',
|
|
67
|
+
handleMouseWheel: false
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}, props), children)));
|
|
71
|
+
});
|
|
72
|
+
var _default = exports.default = /*#__PURE__*/_react.default.memo(FullScreenEditor);
|