@luck-design-biz/luckda 0.0.22-4 → 0.0.22-6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +40 -40
- package/es/components/Builder/index.js +1 -1
- 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 +0 -0
- package/es/components/LdFormList/model.js +0 -0
- package/es/components/LdGrid/index.js +4 -4
- package/es/components/LdGrid/model.js +0 -0
- package/es/components/LdGridForm/index.js +0 -0
- package/es/components/LdGridForm/index.less +7 -7
- package/es/components/LdInfoPanel/index.js +0 -0
- package/es/components/LdPop/index.js +0 -0
- package/es/components/LdRuntimeCom/index.js +42 -0
- package/es/components/LdTree/index.js +0 -0
- package/es/components/LdTree/index.less +36 -36
- package/es/helper/FromItems.js +0 -0
- package/es/helper/action.js +6 -6
- package/es/helper/form.js +14 -14
- package/es/helper/index.less +7 -7
- package/es/helper/ldBuilder.js +0 -0
- package/es/helper/ldComBuild.js +0 -0
- package/es/index.js +1 -0
- package/es/lowcode/constants/api-url.js +3 -0
- package/es/lowcode/constants/event-topics.js +36 -0
- package/es/lowcode/constants/index.js +12 -0
- package/es/lowcode/engine/factory/DataFactory.js +1 -0
- package/es/lowcode/engine/factory/panel-item-factory/DynamicStrategy.js +60 -0
- package/es/lowcode/engine/factory/panel-item-factory/SegmentedStrategy.js +32 -0
- package/es/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +55 -0
- package/es/lowcode/engine/factory/panel-item-factory/Strategy.js +21 -0
- package/es/lowcode/engine/factory/panel-item-factory/StringStrategy.js +32 -0
- package/es/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +32 -0
- package/es/lowcode/engine/factory/panel-item-factory/index.js +40 -0
- package/es/lowcode/engine/meta/box.props.default.json +10 -0
- package/es/lowcode/engine/meta/box.props.json +40 -0
- package/es/lowcode/engine/meta/button.props.default.json +16 -0
- package/es/lowcode/engine/meta/button.props.json +117 -0
- package/es/lowcode/engine/meta/cardlist.props.default.json +18 -0
- package/es/lowcode/engine/meta/cardlist.props.json +144 -0
- package/es/lowcode/engine/meta/components-list.json +128 -0
- package/es/lowcode/engine/meta/dialog.props.default.json +19 -0
- package/es/lowcode/engine/meta/dialog.props.json +121 -0
- package/es/lowcode/engine/meta/drawer.props.default.json +18 -0
- package/es/lowcode/engine/meta/drawer.props.json +144 -0
- package/es/lowcode/engine/meta/form.props.default.json +13 -0
- package/es/lowcode/engine/meta/form.props.json +117 -0
- package/es/lowcode/engine/meta/iframe.props.default.json +11 -0
- package/es/lowcode/engine/meta/iframe.props.json +32 -0
- package/es/lowcode/engine/meta/image.props.default.json +16 -0
- package/es/lowcode/engine/meta/image.props.json +114 -0
- package/es/lowcode/engine/meta/imex.props.default.json +12 -0
- package/es/lowcode/engine/meta/imex.props.json +82 -0
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +29 -0
- package/es/lowcode/engine/meta/jsx.props.default.json +10 -0
- package/es/lowcode/engine/meta/jsx.props.json +25 -0
- package/es/lowcode/engine/meta/layout.props.default.json +13 -0
- package/es/lowcode/engine/meta/layout.props.json +108 -0
- package/es/lowcode/engine/meta/link.props.default.json +14 -0
- package/es/lowcode/engine/meta/link.props.json +112 -0
- package/es/lowcode/engine/meta/section.props.default.json +17 -0
- package/es/lowcode/engine/meta/section.props.json +108 -0
- package/es/lowcode/engine/meta/split.props.default.json +13 -0
- package/es/lowcode/engine/meta/split.props.json +72 -0
- package/es/lowcode/engine/meta/table.props.default.json +18 -0
- package/es/lowcode/engine/meta/table.props.json +162 -0
- package/es/lowcode/engine/meta/tabs.props.default.json +18 -0
- package/es/lowcode/engine/meta/tabs.props.json +141 -0
- package/es/lowcode/engine/meta/text.props.default.json +12 -0
- package/es/lowcode/engine/meta/text.props.json +66 -0
- package/es/lowcode/engine/meta/tree.props.default.json +17 -0
- package/es/lowcode/engine/meta/tree.props.json +157 -0
- package/es/lowcode/engine/provider/ContextProvider.js +157 -0
- package/es/lowcode/engine/provider/EventBusProvider.js +120 -0
- package/es/lowcode/engine/tools/dataProcess.js +263 -0
- package/es/lowcode/engine/tools/helper.js +4 -0
- package/es/lowcode/engine/tools/usePromiseState.js +24 -0
- package/es/lowcode/index.js +3 -0
- package/es/lowcode/painter/Components.js +104 -0
- package/es/lowcode/painter/Design.js +321 -0
- package/es/lowcode/painter/I18n.js +205 -0
- package/es/lowcode/painter/Outline.js +208 -0
- package/es/lowcode/painter/Panel.js +200 -0
- package/es/lowcode/painter/Ribbon.js +142 -0
- package/es/lowcode/painter/components/PanelItem.js +35 -0
- 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 +105 -0
- 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 +49 -0
- package/es/lowcode/painter/components/code-editor/JSEditor.js +77 -0
- package/es/lowcode/painter/components/code-editor/index.js +2 -0
- package/es/lowcode/painter/index.js +45 -0
- package/es/lowcode/painter/panel-section/ButtonType.js +45 -0
- package/es/lowcode/painter/panel-section/Icon.js +48 -0
- package/es/lowcode/painter/panel-section/IconSelector.js +139 -0
- package/es/lowcode/painter/panel-section/LayoutRatio.js +140 -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/components.less +90 -0
- package/es/lowcode/painter/style/design.less +135 -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 +6 -0
- package/es/lowcode/painter/style/layout-ratio.less +51 -0
- package/es/lowcode/painter/style/outline.less +28 -0
- package/es/lowcode/painter/style/panel-item.less +22 -0
- package/es/lowcode/painter/style/panel.less +119 -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 +24 -0
- package/es/lowcode/painter/style/ribbon.less +5 -0
- package/es/lowcode/painter/style/rule-input.less +13 -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 +138 -0
- package/es/lowcode/view/Loading.js +23 -0
- package/es/lowcode/view/Page.js +249 -0
- package/es/lowcode/view/index.js +18 -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 +30 -0
- package/es/lowcode/view/lc-components/Box/index.less +14 -0
- package/es/lowcode/view/lc-components/Box/meta.json +40 -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 +37 -0
- package/es/lowcode/view/lc-components/Button/meta.json +117 -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 +20 -0
- package/es/lowcode/view/lc-components/CardList/meta.json +144 -0
- 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 +61 -0
- package/es/lowcode/view/lc-components/Dialog/index.less +3 -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 +62 -0
- 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 +20 -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 +20 -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 +20 -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 +20 -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 +20 -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 +60 -0
- 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 +20 -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 +34 -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 +21 -0
- package/es/lowcode/view/lc-components/Split/meta.json +72 -0
- package/es/lowcode/view/lc-components/Table/FunctionDesign.js +9 -0
- package/es/lowcode/view/lc-components/Table/FunctionLive.js +9 -0
- package/es/lowcode/view/lc-components/Table/index.js +23 -0
- package/es/lowcode/view/lc-components/Table/meta.json +162 -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 +21 -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 +23 -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 +20 -0
- package/es/lowcode/view/lc-components/Tree/meta.json +157 -0
- package/es/lowcode/view/lc-components/Wrapper.js +52 -0
- package/es/lowcode/view/style/canvas.less +5 -0
- package/es/lowcode/view/style/loading.less +84 -0
- package/es/lowcode/view/style/page.less +5 -0
- package/es/services.js +0 -0
- package/es/upload/Form/gridForm.js +0 -0
- package/es/upload/Form/index.js +0 -0
- package/es/upload/Form/index.less +7 -7
- package/es/upload/FormItem/index.js +15 -15
- 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 +22 -22
- package/es/utils/grid.js +3 -2
- package/es/utils/index.js +0 -0
- package/lib/components/Builder/index.js +1 -1
- 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 +0 -0
- package/lib/components/LdFormList/model.js +0 -0
- package/lib/components/LdGrid/index.js +4 -4
- package/lib/components/LdGrid/model.js +0 -0
- package/lib/components/LdGridForm/index.js +0 -0
- package/lib/components/LdGridForm/index.less +7 -7
- package/lib/components/LdInfoPanel/index.js +0 -0
- package/lib/components/LdPop/index.js +0 -0
- package/lib/components/LdRuntimeCom/index.js +49 -0
- package/lib/components/LdTree/index.js +0 -0
- package/lib/components/LdTree/index.less +36 -36
- package/lib/helper/FromItems.js +0 -0
- package/lib/helper/action.js +6 -6
- package/lib/helper/form.js +14 -14
- package/lib/helper/index.less +7 -7
- package/lib/helper/ldBuilder.js +0 -0
- package/lib/helper/ldComBuild.js +0 -0
- package/lib/index.js +9 -1
- package/lib/lowcode/constants/api-url.js +9 -0
- package/lib/lowcode/constants/event-topics.js +42 -0
- package/lib/lowcode/constants/index.js +18 -0
- package/lib/lowcode/engine/factory/DataFactory.js +3 -0
- package/lib/lowcode/engine/factory/panel-item-factory/DynamicStrategy.js +73 -0
- package/lib/lowcode/engine/factory/panel-item-factory/SegmentedStrategy.js +38 -0
- package/lib/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +61 -0
- package/lib/lowcode/engine/factory/panel-item-factory/Strategy.js +27 -0
- package/lib/lowcode/engine/factory/panel-item-factory/StringStrategy.js +38 -0
- package/lib/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +38 -0
- package/lib/lowcode/engine/factory/panel-item-factory/index.js +46 -0
- package/lib/lowcode/engine/meta/box.props.default.json +10 -0
- package/lib/lowcode/engine/meta/box.props.json +40 -0
- package/lib/lowcode/engine/meta/button.props.default.json +16 -0
- package/lib/lowcode/engine/meta/button.props.json +117 -0
- package/lib/lowcode/engine/meta/cardlist.props.default.json +18 -0
- package/lib/lowcode/engine/meta/cardlist.props.json +144 -0
- package/lib/lowcode/engine/meta/components-list.json +128 -0
- package/lib/lowcode/engine/meta/dialog.props.default.json +19 -0
- package/lib/lowcode/engine/meta/dialog.props.json +121 -0
- package/lib/lowcode/engine/meta/drawer.props.default.json +18 -0
- package/lib/lowcode/engine/meta/drawer.props.json +144 -0
- package/lib/lowcode/engine/meta/form.props.default.json +13 -0
- package/lib/lowcode/engine/meta/form.props.json +117 -0
- package/lib/lowcode/engine/meta/iframe.props.default.json +11 -0
- package/lib/lowcode/engine/meta/iframe.props.json +32 -0
- package/lib/lowcode/engine/meta/image.props.default.json +16 -0
- package/lib/lowcode/engine/meta/image.props.json +114 -0
- package/lib/lowcode/engine/meta/imex.props.default.json +12 -0
- package/lib/lowcode/engine/meta/imex.props.json +82 -0
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +29 -0
- package/lib/lowcode/engine/meta/jsx.props.default.json +10 -0
- package/lib/lowcode/engine/meta/jsx.props.json +25 -0
- package/lib/lowcode/engine/meta/layout.props.default.json +13 -0
- package/lib/lowcode/engine/meta/layout.props.json +108 -0
- package/lib/lowcode/engine/meta/link.props.default.json +14 -0
- package/lib/lowcode/engine/meta/link.props.json +112 -0
- package/lib/lowcode/engine/meta/section.props.default.json +17 -0
- package/lib/lowcode/engine/meta/section.props.json +108 -0
- package/lib/lowcode/engine/meta/split.props.default.json +13 -0
- package/lib/lowcode/engine/meta/split.props.json +72 -0
- package/lib/lowcode/engine/meta/table.props.default.json +18 -0
- package/lib/lowcode/engine/meta/table.props.json +162 -0
- package/lib/lowcode/engine/meta/tabs.props.default.json +18 -0
- package/lib/lowcode/engine/meta/tabs.props.json +141 -0
- package/lib/lowcode/engine/meta/text.props.default.json +12 -0
- package/lib/lowcode/engine/meta/text.props.json +66 -0
- package/lib/lowcode/engine/meta/tree.props.default.json +17 -0
- package/lib/lowcode/engine/meta/tree.props.json +157 -0
- package/lib/lowcode/engine/provider/ContextProvider.js +165 -0
- package/lib/lowcode/engine/provider/EventBusProvider.js +128 -0
- package/lib/lowcode/engine/tools/dataProcess.js +277 -0
- package/lib/lowcode/engine/tools/helper.js +11 -0
- package/lib/lowcode/engine/tools/usePromiseState.js +31 -0
- package/lib/lowcode/index.js +20 -0
- package/lib/lowcode/painter/Components.js +112 -0
- package/lib/lowcode/painter/Design.js +328 -0
- package/lib/lowcode/painter/I18n.js +213 -0
- package/lib/lowcode/painter/Outline.js +216 -0
- package/lib/lowcode/painter/Panel.js +208 -0
- package/lib/lowcode/painter/Ribbon.js +150 -0
- package/lib/lowcode/painter/components/PanelItem.js +41 -0
- 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 +112 -0
- 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 +57 -0
- package/lib/lowcode/painter/components/code-editor/JSEditor.js +88 -0
- package/lib/lowcode/painter/components/code-editor/index.js +20 -0
- package/lib/lowcode/painter/index.js +54 -0
- package/lib/lowcode/painter/panel-section/ButtonType.js +52 -0
- package/lib/lowcode/painter/panel-section/Icon.js +54 -0
- package/lib/lowcode/painter/panel-section/IconSelector.js +146 -0
- package/lib/lowcode/painter/panel-section/LayoutRatio.js +148 -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/components.less +90 -0
- package/lib/lowcode/painter/style/design.less +135 -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 +6 -0
- package/lib/lowcode/painter/style/layout-ratio.less +51 -0
- package/lib/lowcode/painter/style/outline.less +28 -0
- package/lib/lowcode/painter/style/panel-item.less +22 -0
- package/lib/lowcode/painter/style/panel.less +119 -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 +24 -0
- package/lib/lowcode/painter/style/ribbon.less +5 -0
- package/lib/lowcode/painter/style/rule-input.less +13 -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 +153 -0
- package/lib/lowcode/view/Loading.js +30 -0
- package/lib/lowcode/view/Page.js +257 -0
- package/lib/lowcode/view/index.js +25 -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 +38 -0
- package/lib/lowcode/view/lc-components/Box/index.less +14 -0
- package/lib/lowcode/view/lc-components/Box/meta.json +40 -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 +45 -0
- package/lib/lowcode/view/lc-components/Button/meta.json +117 -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 +28 -0
- package/lib/lowcode/view/lc-components/CardList/meta.json +144 -0
- 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 +69 -0
- package/lib/lowcode/view/lc-components/Dialog/index.less +3 -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 +70 -0
- 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 +28 -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 +28 -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 +28 -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 +28 -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 +28 -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 +68 -0
- 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 +28 -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 +42 -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 +29 -0
- package/lib/lowcode/view/lc-components/Split/meta.json +72 -0
- package/lib/lowcode/view/lc-components/Table/FunctionDesign.js +16 -0
- package/lib/lowcode/view/lc-components/Table/FunctionLive.js +16 -0
- package/lib/lowcode/view/lc-components/Table/index.js +31 -0
- package/lib/lowcode/view/lc-components/Table/meta.json +162 -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 +29 -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 +31 -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 +28 -0
- package/lib/lowcode/view/lc-components/Tree/meta.json +157 -0
- package/lib/lowcode/view/lc-components/Wrapper.js +59 -0
- package/lib/lowcode/view/style/canvas.less +5 -0
- package/lib/lowcode/view/style/loading.less +84 -0
- package/lib/lowcode/view/style/page.less +5 -0
- package/lib/services.js +0 -0
- package/lib/upload/Form/gridForm.js +0 -0
- package/lib/upload/Form/index.js +0 -0
- package/lib/upload/Form/index.less +7 -7
- package/lib/upload/FormItem/index.js +15 -15
- 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 +22 -22
- package/lib/utils/grid.js +6 -5
- package/lib/utils/index.js +0 -0
- package/lowcode.js +1 -0
- package/package.json +47 -34
- package/upload.js +1 -1
- package/utils.js +1 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
|
|
4
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
6
|
+
var _excluded = ["onValueChange", "rules", "value"];
|
|
7
|
+
import React, { forwardRef, useState, useEffect } from 'react';
|
|
8
|
+
import { Input, Tooltip } from 'luck-design/antd';
|
|
9
|
+
import classNames from 'classnames';
|
|
10
|
+
import styles from "../style/rule-input.less";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 带校验功能的输入组件。
|
|
14
|
+
*
|
|
15
|
+
* 此组件封装了antd的Input组件,并增加了输入值的校验功能。它允许开发者定义一组校验规则,
|
|
16
|
+
* 以确保用户输入符合特定要求。每条规则由一个校验函数和一个错误信息组成。如果用户的输入
|
|
17
|
+
* 不满足任何一条规则,将展示相应的错误信息提示。
|
|
18
|
+
*
|
|
19
|
+
* @component
|
|
20
|
+
* @example
|
|
21
|
+
* <RuleInput
|
|
22
|
+
* value="示例值"
|
|
23
|
+
* onValueChange={(e, newValue) => console.log('新值:', newValue)}
|
|
24
|
+
* rules={[
|
|
25
|
+
* { func: value => !!value, err: '输入不能为空' },
|
|
26
|
+
* { func: value => /^\d+$/.test(value), err: '只允许输入数字' }
|
|
27
|
+
* ]}
|
|
28
|
+
* />
|
|
29
|
+
*
|
|
30
|
+
* @param {Object} props 组件接收的props
|
|
31
|
+
* @param {string} props.value 输入框当前的值,可以由外部控制以实现受控组件。
|
|
32
|
+
* @param {Function} props.onValueChange 当输入值改变并通过所有校验时,触发的回调函数。
|
|
33
|
+
* 该函数接收原生的事件对象和新的输入值作为参数。
|
|
34
|
+
* @param {Array<{func: (value: string) => boolean, err: string}>} props.rules
|
|
35
|
+
* 定义输入校验规则的数组。每个元素是一个对象,其中`func`属性是一个函数,用于执行校验逻辑,
|
|
36
|
+
* 接收当前输入值作为参数,返回一个布尔值表示校验是否通过;`err`属性是一个字符串,指定当
|
|
37
|
+
* 校验失败时要显示的错误信息。
|
|
38
|
+
* @param {Object} rest 传递给内部Input组件的其他props,如`placeholder`、`disabled`等。
|
|
39
|
+
* @param {React.Ref} ref React ref对象,用于将ref传递给内部的Input DOM元素。
|
|
40
|
+
*
|
|
41
|
+
* @returns React元素,渲染一个带有校验功能的输入框和校验失败时的错误信息提示。
|
|
42
|
+
*/
|
|
43
|
+
export default /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
44
|
+
var onValueChange = _ref.onValueChange,
|
|
45
|
+
rules = _ref.rules,
|
|
46
|
+
value = _ref.value,
|
|
47
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
48
|
+
var _useState = useState(value),
|
|
49
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
50
|
+
inputValue = _useState2[0],
|
|
51
|
+
setInputValue = _useState2[1]; // 托管输入值的状态
|
|
52
|
+
var _useState3 = useState(null),
|
|
53
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
54
|
+
err = _useState4[0],
|
|
55
|
+
setErr = _useState4[1];
|
|
56
|
+
|
|
57
|
+
// 使用useEffect钩子监听value的变化
|
|
58
|
+
useEffect(function () {
|
|
59
|
+
setInputValue(value);
|
|
60
|
+
setErr(null);
|
|
61
|
+
}, [value]);
|
|
62
|
+
var handleInputChange = function handleInputChange(e) {
|
|
63
|
+
var value = e.target.value;
|
|
64
|
+
setInputValue(value); // 更新托管的输入值
|
|
65
|
+
|
|
66
|
+
if (value == '') onValueChange(e, value);
|
|
67
|
+
var error = null;
|
|
68
|
+
|
|
69
|
+
// 遍历rules,检查输入值是否满足条件
|
|
70
|
+
var _iterator = _createForOfIteratorHelper(rules),
|
|
71
|
+
_step;
|
|
72
|
+
try {
|
|
73
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
74
|
+
var rule = _step.value;
|
|
75
|
+
if (!rule.func(value)) {
|
|
76
|
+
error = rule.err;
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
} catch (err) {
|
|
81
|
+
_iterator.e(err);
|
|
82
|
+
} finally {
|
|
83
|
+
_iterator.f();
|
|
84
|
+
}
|
|
85
|
+
if (!error) {
|
|
86
|
+
setErr(null);
|
|
87
|
+
onValueChange(e, value);
|
|
88
|
+
} else {
|
|
89
|
+
setErr(error);
|
|
90
|
+
console.error(error);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
94
|
+
title: err,
|
|
95
|
+
visible: err
|
|
96
|
+
}, /*#__PURE__*/React.createElement(Input, _extends({
|
|
97
|
+
className: classNames(styles['lc-painter-components-ruleinput'], _defineProperty({}, styles.err, !!err)),
|
|
98
|
+
size: "small",
|
|
99
|
+
value: inputValue // 绑定输入值
|
|
100
|
+
,
|
|
101
|
+
onChange: handleInputChange
|
|
102
|
+
}, rest, {
|
|
103
|
+
ref: ref
|
|
104
|
+
}))));
|
|
105
|
+
});
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useState, useEffect } from 'react';
|
|
3
|
+
import { DndContext } from '@dnd-kit/core';
|
|
4
|
+
import { SortableContext, arrayMove, useSortable, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
|
5
|
+
import { CSS } from '@dnd-kit/utilities';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* SortBox 是一个使用 dnd-kit 实现拖拽排序的组件。
|
|
9
|
+
* 它允许子元素通过拖拽操作来重新排序,并在排序操作完成后通过 onChange 回调传递新的排序结果。
|
|
10
|
+
*
|
|
11
|
+
* @param {Object} props 组件的 props。
|
|
12
|
+
* @param {Array} props.datas 初始排序的数据数组,通常包含用于排序的唯一标识符。
|
|
13
|
+
* @param {ReactNode} props.children 组件的子元素,通常是需要进行排序的元素集合。
|
|
14
|
+
* @param {Function} props.onChange 当排序操作完成时触发的回调函数,参数为重新排序后的数据数组。
|
|
15
|
+
* @param {Function} [props.strategy=verticalListSortingStrategy] 用于排序的策略。默认为垂直列表排序策略。
|
|
16
|
+
*
|
|
17
|
+
* @returns {ReactNode} 返回一个配置了 DndContext 和 SortableContext 的 React 组件结构。
|
|
18
|
+
*/
|
|
19
|
+
export var SortBox = function SortBox(_ref) {
|
|
20
|
+
var datas = _ref.datas,
|
|
21
|
+
children = _ref.children,
|
|
22
|
+
onChange = _ref.onChange,
|
|
23
|
+
strategy = _ref.strategy;
|
|
24
|
+
var _useState = useState(datas),
|
|
25
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
26
|
+
items = _useState2[0],
|
|
27
|
+
setItems = _useState2[1];
|
|
28
|
+
var sortStrategy = strategy !== null && strategy !== void 0 ? strategy : verticalListSortingStrategy;
|
|
29
|
+
useEffect(function () {
|
|
30
|
+
setItems(datas);
|
|
31
|
+
}, [datas]);
|
|
32
|
+
function handleDragEnd(event) {
|
|
33
|
+
var active = event.active,
|
|
34
|
+
over = event.over;
|
|
35
|
+
if (active.id !== over.id) {
|
|
36
|
+
setItems(function (items) {
|
|
37
|
+
var oldIndex = items.indexOf(active.id);
|
|
38
|
+
var newIndex = items.indexOf(over.id);
|
|
39
|
+
var newSortItem = arrayMove(items, oldIndex, newIndex);
|
|
40
|
+
if (onChange) onChange(newSortItem);
|
|
41
|
+
return newSortItem;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return /*#__PURE__*/React.createElement(DndContext, {
|
|
46
|
+
onDragEnd: handleDragEnd
|
|
47
|
+
}, /*#__PURE__*/React.createElement(SortableContext, {
|
|
48
|
+
strategy: sortStrategy,
|
|
49
|
+
items: items
|
|
50
|
+
}, children));
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* SortItem 组件是一个使用 dnd-kit 实现的可排序项。它通过 useSortable 钩子来提供拖拽功能,
|
|
55
|
+
* 并将必要的属性和监听器传递给其子元素,使得子元素可拖拽。
|
|
56
|
+
*
|
|
57
|
+
* @param {Object} props - 组件的 props。
|
|
58
|
+
* @param {string} props.id - 该排序项的唯一标识符,用于识别不同的可排序元素。
|
|
59
|
+
* @param {ReactNode} props.children - 该组件的子元素。通常是你希望使之可拖拽的元素。
|
|
60
|
+
* SortItem 会将拖拽相关的 props 注入到这个子元素中。
|
|
61
|
+
*
|
|
62
|
+
* @returns {ReactNode} 返回一个增强后的 React 元素,此元素集成了拖拽功能。
|
|
63
|
+
* 它基于原 children 元素,附加了用于拖拽的属性和样式。
|
|
64
|
+
*/
|
|
65
|
+
export var SortItem = function SortItem(_ref2) {
|
|
66
|
+
var id = _ref2.id,
|
|
67
|
+
children = _ref2.children;
|
|
68
|
+
var _useSortable = useSortable({
|
|
69
|
+
id: id
|
|
70
|
+
}),
|
|
71
|
+
attributes = _useSortable.attributes,
|
|
72
|
+
listeners = _useSortable.listeners,
|
|
73
|
+
setNodeRef = _useSortable.setNodeRef,
|
|
74
|
+
transform = _useSortable.transform,
|
|
75
|
+
transition = _useSortable.transition,
|
|
76
|
+
setActivatorNodeRef = _useSortable.setActivatorNodeRef;
|
|
77
|
+
var style = {
|
|
78
|
+
transform: CSS.Transform.toString(transform),
|
|
79
|
+
transition: transition
|
|
80
|
+
};
|
|
81
|
+
var childWithProps = /*#__PURE__*/React.cloneElement(children, {
|
|
82
|
+
key: id,
|
|
83
|
+
attributes: attributes,
|
|
84
|
+
listeners: listeners,
|
|
85
|
+
setNodeRef: setNodeRef,
|
|
86
|
+
transform: transform,
|
|
87
|
+
transition: transition,
|
|
88
|
+
setActivatorNodeRef: setActivatorNodeRef,
|
|
89
|
+
style: style
|
|
90
|
+
});
|
|
91
|
+
return childWithProps;
|
|
92
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Icon } from 'luck-design/antd';
|
|
4
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
5
|
+
import styles from "../style/tabeditor.less";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* TabEditor 是一个用于管理和展示一组可编辑标签项的容器组件。
|
|
9
|
+
* 它提供了一个添加新标签项的操作按钮,并通过 children 属性接收一组 TabEditorItem 组件。
|
|
10
|
+
*
|
|
11
|
+
* @param {Object} props - 组件接收的属性。
|
|
12
|
+
* @param {ReactNode} props.children - TabEditorItem 组件的实例,表示可编辑的标签项。
|
|
13
|
+
* @param {Function} props.handleAdd - 一个回调函数,当用户点击添加按钮时被触发,用于添加新的标签项。
|
|
14
|
+
* @returns {ReactNode} 渲染一个带有操作按钮和标签项的容器。
|
|
15
|
+
*/
|
|
16
|
+
export var TabEditor = function TabEditor(_ref) {
|
|
17
|
+
var children = _ref.children,
|
|
18
|
+
handleAdd = _ref.handleAdd;
|
|
19
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
20
|
+
className: styles['lc-painter-panel-section-components-tabeditor']
|
|
21
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
22
|
+
className: styles['tabs-box']
|
|
23
|
+
}, children), /*#__PURE__*/React.createElement("div", {
|
|
24
|
+
className: styles['tabs-actions']
|
|
25
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
26
|
+
className: styles['tabs-action'],
|
|
27
|
+
onClick: handleAdd
|
|
28
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
29
|
+
type: "plus-circle"
|
|
30
|
+
}), ' ', formatMessage({
|
|
31
|
+
id: 'luckda.lowcode.painter.panel-section.components.tabeditor.add',
|
|
32
|
+
label: '添加一项'
|
|
33
|
+
}))));
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* TabEditorItem 是一个可编辑的标签项组件,用于在 TabEditor 容器内展示。
|
|
38
|
+
* 它支持拖拽排序,并可以通过左侧和右侧的插槽来自定义内容。
|
|
39
|
+
*
|
|
40
|
+
* @param {Object} props - 组件接收的属性。
|
|
41
|
+
* @param {Object} props.item - 表示标签项数据的对象。
|
|
42
|
+
* @param {ReactNode} props.left - 放置在标签项左侧的内容,通常用于展示标签名称或其他信息。
|
|
43
|
+
* @param {ReactNode} props.right - 放置在标签项右侧的内容,通常用于展示操作按钮如编辑或删除。
|
|
44
|
+
* @param {Function} props.setNodeRef - 用于设置拖拽组件根节点的引用。
|
|
45
|
+
* @param {Function} props.setActivatorNodeRef - 用于设置激活拖拽操作的节点引用。
|
|
46
|
+
* @param {Object} props.style - 应用于标签项的样式对象,通常包含拖拽过程中的动态变化样式。
|
|
47
|
+
* @param {Object} props.attributes - 包含与拖拽相关的HTML属性。
|
|
48
|
+
* @param {Object} props.listeners - 包含处理拖拽事件的监听器。
|
|
49
|
+
* @param {CSSProperties} props.transform - 应用于组件的CSS变换属性,用于实现拖拽效果。
|
|
50
|
+
* @param {string} props.transition - 定义拖拽动画的CSS过渡属性。
|
|
51
|
+
* @returns {ReactNode} 渲染一个可编辑的标签项,支持拖拽排序。
|
|
52
|
+
*/
|
|
53
|
+
export var TabEditorItem = function TabEditorItem(_ref2) {
|
|
54
|
+
var item = _ref2.item,
|
|
55
|
+
left = _ref2.left,
|
|
56
|
+
right = _ref2.right,
|
|
57
|
+
setNodeRef = _ref2.setNodeRef,
|
|
58
|
+
setActivatorNodeRef = _ref2.setActivatorNodeRef,
|
|
59
|
+
style = _ref2.style,
|
|
60
|
+
attributes = _ref2.attributes,
|
|
61
|
+
listeners = _ref2.listeners,
|
|
62
|
+
transform = _ref2.transform,
|
|
63
|
+
transition = _ref2.transition;
|
|
64
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
ref: setNodeRef,
|
|
66
|
+
style: style,
|
|
67
|
+
className: styles['tabitem']
|
|
68
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
className: styles['tabitem-left']
|
|
70
|
+
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
71
|
+
ref: setActivatorNodeRef
|
|
72
|
+
}, attributes, listeners, {
|
|
73
|
+
className: styles['dragicon']
|
|
74
|
+
}), /*#__PURE__*/React.createElement("svg", {
|
|
75
|
+
fill: "currentColor",
|
|
76
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
77
|
+
width: "16",
|
|
78
|
+
height: "12",
|
|
79
|
+
viewBox: "0 0 5 12",
|
|
80
|
+
style: {
|
|
81
|
+
verticalAlign: 'middle'
|
|
82
|
+
}
|
|
83
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
84
|
+
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"
|
|
85
|
+
}))), left), /*#__PURE__*/React.createElement("div", {
|
|
86
|
+
className: styles['tabitem-right']
|
|
87
|
+
}, right));
|
|
88
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["children", "width", "height", "language", "options"];
|
|
5
|
+
import React, { useEffect, useRef, useImperativeHandle, forwardRef } from 'react';
|
|
6
|
+
import * as monaco from 'monaco-editor';
|
|
7
|
+
var CodeEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
8
|
+
var children = _ref.children,
|
|
9
|
+
_ref$width = _ref.width,
|
|
10
|
+
width = _ref$width === void 0 ? '100%' : _ref$width,
|
|
11
|
+
_ref$height = _ref.height,
|
|
12
|
+
height = _ref$height === void 0 ? '100%' : _ref$height,
|
|
13
|
+
_ref$language = _ref.language,
|
|
14
|
+
language = _ref$language === void 0 ? 'javascript' : _ref$language,
|
|
15
|
+
_ref$options = _ref.options,
|
|
16
|
+
options = _ref$options === void 0 ? {} : _ref$options,
|
|
17
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
+
var editorRef = useRef(null);
|
|
19
|
+
var editorInstance = useRef(null);
|
|
20
|
+
useImperativeHandle(ref, function () {
|
|
21
|
+
return {
|
|
22
|
+
// 直接暴露 editorInstance
|
|
23
|
+
get editor() {
|
|
24
|
+
return editorInstance.current;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
useEffect(function () {
|
|
29
|
+
if (editorRef.current) {
|
|
30
|
+
var code = React.Children.toArray(children).join('').trim();
|
|
31
|
+
editorInstance.current = monaco.editor.create(editorRef.current, _objectSpread({
|
|
32
|
+
value: code,
|
|
33
|
+
language: language
|
|
34
|
+
}, options));
|
|
35
|
+
}
|
|
36
|
+
return function () {
|
|
37
|
+
var _editorInstance$curre;
|
|
38
|
+
return (_editorInstance$curre = editorInstance.current) === null || _editorInstance$curre === void 0 ? void 0 : _editorInstance$curre.dispose();
|
|
39
|
+
};
|
|
40
|
+
}, [children]);
|
|
41
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
42
|
+
ref: editorRef,
|
|
43
|
+
style: {
|
|
44
|
+
width: width,
|
|
45
|
+
height: height
|
|
46
|
+
}
|
|
47
|
+
}, rest));
|
|
48
|
+
});
|
|
49
|
+
export default CodeEditor;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
4
|
+
import React, { useEffect } from 'react';
|
|
5
|
+
import BaseEditor from "./BaseEditor";
|
|
6
|
+
import * as monaco from 'monaco-editor';
|
|
7
|
+
var _provideCompletionItems = function provideCompletionItems(monaco, model, position, module) {
|
|
8
|
+
var textUntilPosition = model.getValueInRange({
|
|
9
|
+
startLineNumber: position.lineNumber,
|
|
10
|
+
startColumn: 1,
|
|
11
|
+
endLineNumber: position.lineNumber,
|
|
12
|
+
endColumn: position.column
|
|
13
|
+
});
|
|
14
|
+
if (textUntilPosition.endsWith(module.triggerWord + '.')) {
|
|
15
|
+
var word = model.getWordUntilPosition(position);
|
|
16
|
+
var range = {
|
|
17
|
+
startLineNumber: position.lineNumber,
|
|
18
|
+
endLineNumber: position.lineNumber,
|
|
19
|
+
startColumn: word.startColumn,
|
|
20
|
+
endColumn: word.endColumn
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// 从模块中调用 completions 函数获取补全项数组
|
|
24
|
+
// 并动态转换 kind 字段
|
|
25
|
+
return module.completions.map(function (completion) {
|
|
26
|
+
return Object.assign({}, completion, {
|
|
27
|
+
range: range,
|
|
28
|
+
// 动态转换 kind 字段
|
|
29
|
+
kind: monaco.languages.CompletionItemKind[completion.kind]
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return [];
|
|
34
|
+
};
|
|
35
|
+
var setupAutocomplete = /*#__PURE__*/function () {
|
|
36
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(monaco) {
|
|
37
|
+
var autoCompleteModules;
|
|
38
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
39
|
+
while (1) switch (_context.prev = _context.next) {
|
|
40
|
+
case 0:
|
|
41
|
+
_context.next = 2;
|
|
42
|
+
return import("../../../engine/meta/js-editor/auto-complete.json");
|
|
43
|
+
case 2:
|
|
44
|
+
autoCompleteModules = _context.sent;
|
|
45
|
+
console.log('autoCompleteModules', autoCompleteModules);
|
|
46
|
+
monaco.languages.registerCompletionItemProvider('javascript', _defineProperty({
|
|
47
|
+
triggerCharacters: ['.'],
|
|
48
|
+
provideCompletionItems: function provideCompletionItems(model, position) {
|
|
49
|
+
var allCompletionItems = [];
|
|
50
|
+
|
|
51
|
+
// 从所有模块收集补全项
|
|
52
|
+
autoCompleteModules.default.forEach(function (module) {
|
|
53
|
+
var items = _provideCompletionItems(monaco, model, position, module);
|
|
54
|
+
allCompletionItems = allCompletionItems.concat(items);
|
|
55
|
+
});
|
|
56
|
+
return {
|
|
57
|
+
suggestions: allCompletionItems
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}, "triggerCharacters", ['.']));
|
|
61
|
+
case 5:
|
|
62
|
+
case "end":
|
|
63
|
+
return _context.stop();
|
|
64
|
+
}
|
|
65
|
+
}, _callee);
|
|
66
|
+
}));
|
|
67
|
+
return function setupAutocomplete(_x) {
|
|
68
|
+
return _ref.apply(this, arguments);
|
|
69
|
+
};
|
|
70
|
+
}();
|
|
71
|
+
var JSEditor = function JSEditor(props) {
|
|
72
|
+
useEffect(function () {
|
|
73
|
+
setupAutocomplete(monaco);
|
|
74
|
+
}, []);
|
|
75
|
+
return /*#__PURE__*/React.createElement(BaseEditor, props);
|
|
76
|
+
};
|
|
77
|
+
export default JSEditor;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import React, { useEffect } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
// import { history } from 'umi';
|
|
5
|
+
// import { formatMessage } from '@luck-design-biz/base/utils';
|
|
6
|
+
import EventBusProvider from "../engine/provider/EventBusProvider";
|
|
7
|
+
import ContextProvider from "../engine/provider/ContextProvider";
|
|
8
|
+
import Ribbon from "./Ribbon";
|
|
9
|
+
import Design from "./Design";
|
|
10
|
+
import Panel from "./Panel";
|
|
11
|
+
import { RUNTIME } from "../constants/index";
|
|
12
|
+
import styles from "./style/index.less";
|
|
13
|
+
var Painter = function Painter(_ref) {
|
|
14
|
+
var className = _ref.className;
|
|
15
|
+
// 修改后刷新提示功能,暂时关掉,等待提供数据对比进行判断
|
|
16
|
+
// useEffect(() => {
|
|
17
|
+
// const handleBeforeUnload = (event) => {
|
|
18
|
+
// event.preventDefault();
|
|
19
|
+
// event.returnValue = null;
|
|
20
|
+
// return null;
|
|
21
|
+
// };
|
|
22
|
+
|
|
23
|
+
// window.addEventListener('beforeunload', handleBeforeUnload);
|
|
24
|
+
|
|
25
|
+
// const unblock = history.block(() =>
|
|
26
|
+
// confirm(`${formatMessage({
|
|
27
|
+
// id: 'app.base.operate.comfire.reload', label: '重新加载此网站?'
|
|
28
|
+
// })}\n${formatMessage({
|
|
29
|
+
// id: 'app.base.operate.comfire.message.reload', label: '系统可能不会保存您所做的更改。'
|
|
30
|
+
// })}`)
|
|
31
|
+
// );
|
|
32
|
+
|
|
33
|
+
// return () => {
|
|
34
|
+
// unblock();
|
|
35
|
+
// window.removeEventListener('beforeunload', handleBeforeUnload);
|
|
36
|
+
// };
|
|
37
|
+
// }, []);
|
|
38
|
+
|
|
39
|
+
return /*#__PURE__*/React.createElement(EventBusProvider, {
|
|
40
|
+
runtime: RUNTIME.DESIGN
|
|
41
|
+
}, /*#__PURE__*/React.createElement(ContextProvider, null, /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
className: classNames(styles['lc-painter'], _defineProperty({}, className, !!className))
|
|
43
|
+
}, /*#__PURE__*/React.createElement(Ribbon, null), /*#__PURE__*/React.createElement(Design, null), /*#__PURE__*/React.createElement(Panel, null))));
|
|
44
|
+
};
|
|
45
|
+
export default Painter;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["field", "onChange"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { Select, Button } from 'luck-design/antd';
|
|
6
|
+
import styles from "../style/button-type.less";
|
|
7
|
+
var ButtonType = function ButtonType(_ref) {
|
|
8
|
+
var field = _ref.field,
|
|
9
|
+
_onChange = _ref.onChange,
|
|
10
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
11
|
+
return /*#__PURE__*/React.createElement(Select, _extends({}, props, {
|
|
12
|
+
onChange: function onChange(value) {
|
|
13
|
+
return _onChange({
|
|
14
|
+
field: field,
|
|
15
|
+
value: value
|
|
16
|
+
});
|
|
17
|
+
},
|
|
18
|
+
className: styles['lc-painter-panel-section-components-buttontype']
|
|
19
|
+
}), /*#__PURE__*/React.createElement(Select.Option, {
|
|
20
|
+
value: "primary"
|
|
21
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
22
|
+
type: "primary",
|
|
23
|
+
size: "small",
|
|
24
|
+
className: styles['lc-painter-panel-section-components-buttontype-option']
|
|
25
|
+
}, "primary")), /*#__PURE__*/React.createElement(Select.Option, {
|
|
26
|
+
value: "default"
|
|
27
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
28
|
+
type: "default",
|
|
29
|
+
size: "small",
|
|
30
|
+
className: styles['lc-painter-panel-section-components-buttontype-option']
|
|
31
|
+
}, "default")), /*#__PURE__*/React.createElement(Select.Option, {
|
|
32
|
+
value: "dashed"
|
|
33
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
34
|
+
type: "dashed",
|
|
35
|
+
size: "small",
|
|
36
|
+
className: styles['lc-painter-panel-section-components-buttontype-option']
|
|
37
|
+
}, "dashed")), /*#__PURE__*/React.createElement(Select.Option, {
|
|
38
|
+
value: "danger"
|
|
39
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
40
|
+
type: "danger",
|
|
41
|
+
size: "small",
|
|
42
|
+
className: styles['lc-painter-panel-section-components-buttontype-option']
|
|
43
|
+
}, "danger")));
|
|
44
|
+
};
|
|
45
|
+
export default ButtonType;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Icon } from 'luck-design/antd';
|
|
3
|
+
import styles from "../style/icon.less";
|
|
4
|
+
import { ICONLIST_JS } from "../../constants/api-url";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 一个简单的图标选择器组件,展示了一个图标并允许用户点击选择。
|
|
8
|
+
* 该组件使用了`Icon.createFromIconfontCN`来创建一个可以从Iconfont.cn加载图标的`IconFont`组件。
|
|
9
|
+
* 当图标被点击时,会调用`onSelect`回调函数,并传递一个对象,其中包含了`field`字段。
|
|
10
|
+
*
|
|
11
|
+
* @component
|
|
12
|
+
* @example
|
|
13
|
+
* ```jsx
|
|
14
|
+
* <IconSelector
|
|
15
|
+
* field="iconField"
|
|
16
|
+
* onSelect={({ field }) => console.log(`Selected icon field: ${field}`)}
|
|
17
|
+
* value="icon-example"
|
|
18
|
+
* />
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @param {Object} props 组件的props
|
|
22
|
+
* @param {string} props.field 用于识别选择的图标字段的标识符。
|
|
23
|
+
* @param {Function} props.onSelect 当图标被点击时触发的回调函数。
|
|
24
|
+
* 接收一个对象参数,该对象包含`field`字段。
|
|
25
|
+
* @param {string} [props.value='iconyingyongguanli'] 初始化时图标的类型,
|
|
26
|
+
* 默认为'iconyingyongguanli'。
|
|
27
|
+
*
|
|
28
|
+
* @returns {React.Element} 渲染的React元素。
|
|
29
|
+
*/
|
|
30
|
+
export default function (_ref) {
|
|
31
|
+
var field = _ref.field,
|
|
32
|
+
onSelect = _ref.onSelect,
|
|
33
|
+
value = _ref.value,
|
|
34
|
+
next = _ref.next;
|
|
35
|
+
var IconFont = Icon.createFromIconfontCN({
|
|
36
|
+
scriptUrl: ICONLIST_JS
|
|
37
|
+
});
|
|
38
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
className: styles['lc-painter-panel-section-icon'],
|
|
40
|
+
onClick: function onClick() {
|
|
41
|
+
return next();
|
|
42
|
+
}
|
|
43
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
44
|
+
type: value !== null && value !== void 0 ? value : 'iconyingyongguanli'
|
|
45
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
46
|
+
className: styles['selecor']
|
|
47
|
+
}, "\u8BF7\u9009\u62E9 >"));
|
|
48
|
+
}
|