@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,321 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import React, { useRef, useEffect, useState } from 'react';
|
|
4
|
+
import moment from 'moment';
|
|
5
|
+
import classNames from 'classnames';
|
|
6
|
+
import { last, initial } from 'lodash';
|
|
7
|
+
import { RawIntlProvider, getLocale, getIntl, localeInfo } from 'umi';
|
|
8
|
+
import { useEventListener, useSetState, useMemoizedFn, useCreation } from 'ahooks';
|
|
9
|
+
import { Select, Button, Icon, Divider, ConfigProvider, Dropdown, message } from 'luck-design/antd';
|
|
10
|
+
import { cloneDeep, reverse } from 'lodash';
|
|
11
|
+
import { suid } from '@luck-design-biz/base/utils';
|
|
12
|
+
import { useLDContext } from "../engine/provider/ContextProvider";
|
|
13
|
+
import Page from "../view/Page";
|
|
14
|
+
import { add } from "../engine/tools/dataProcess";
|
|
15
|
+
import { CELL_KEY, CELL_CLASS_NAME } from "../constants";
|
|
16
|
+
import styles from "./style/design.less";
|
|
17
|
+
var getOperatorStyle = function getOperatorStyle(page, cellNode) {
|
|
18
|
+
var _page$getBoundingClie = page.getBoundingClientRect(),
|
|
19
|
+
pageLeft = _page$getBoundingClie.left,
|
|
20
|
+
pageTop = _page$getBoundingClie.top;
|
|
21
|
+
var _cellNode$getBounding = cellNode.getBoundingClientRect(),
|
|
22
|
+
cellNodeLeft = _cellNode$getBounding.left,
|
|
23
|
+
cellNodeTop = _cellNode$getBounding.top;
|
|
24
|
+
return {
|
|
25
|
+
left: "".concat(cellNodeLeft - pageLeft, "px"),
|
|
26
|
+
top: "".concat(cellNodeTop - pageTop, "px"),
|
|
27
|
+
width: "".concat(cellNode.offsetWidth, "px"),
|
|
28
|
+
height: "".concat(cellNode.offsetHeight, "px")
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
var Design = function Design() {
|
|
32
|
+
var _selectorRef$current, _localeInfo$locale2;
|
|
33
|
+
var context = useLDContext();
|
|
34
|
+
var selectorRef = useRef(null);
|
|
35
|
+
var simulatorRef = useRef(null);
|
|
36
|
+
var _useSetState = useSetState({
|
|
37
|
+
selector: null,
|
|
38
|
+
detector: null
|
|
39
|
+
}),
|
|
40
|
+
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
41
|
+
operatorId = _useSetState2[0],
|
|
42
|
+
setOperatorId = _useSetState2[1];
|
|
43
|
+
var _useState = useState(null),
|
|
44
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
45
|
+
acticeProps = _useState2[0],
|
|
46
|
+
setActiceProps = _useState2[1];
|
|
47
|
+
var _useState3 = useState(null),
|
|
48
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
49
|
+
langList = _useState4[0],
|
|
50
|
+
setLangList = _useState4[1];
|
|
51
|
+
var _useState5 = useState(function () {
|
|
52
|
+
return getLocale();
|
|
53
|
+
}),
|
|
54
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
55
|
+
locale = _useState6[0],
|
|
56
|
+
setLocale = _useState6[1];
|
|
57
|
+
var _useState7 = useState(function () {
|
|
58
|
+
return getIntl(locale, true);
|
|
59
|
+
}),
|
|
60
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
61
|
+
intl = _useState8[0],
|
|
62
|
+
setContainerIntl = _useState8[1];
|
|
63
|
+
var _useState9 = useState('pc'),
|
|
64
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
65
|
+
activedTarget = _useState10[0],
|
|
66
|
+
setActivedTarget = _useState10[1];
|
|
67
|
+
useEventListener('mousemove', function (event) {
|
|
68
|
+
var elem = event.target;
|
|
69
|
+
var targetCell = elem.closest(".".concat(CELL_CLASS_NAME));
|
|
70
|
+
var targetCellId = targetCell === null || targetCell === void 0 ? void 0 : targetCell.id;
|
|
71
|
+
if (targetCellId && targetCellId !== operatorId.detector && targetCellId !== operatorId.selector) {
|
|
72
|
+
setOperatorId({
|
|
73
|
+
detector: targetCellId
|
|
74
|
+
});
|
|
75
|
+
context.$publisher(context.topics.COMPONENT_HOVER, {
|
|
76
|
+
id: targetCellId,
|
|
77
|
+
cellNode: targetCell
|
|
78
|
+
});
|
|
79
|
+
} else if (!targetCell || targetCellId === operatorId.selector) {
|
|
80
|
+
setOperatorId({
|
|
81
|
+
detector: null
|
|
82
|
+
});
|
|
83
|
+
context.$publisher(context.topics.COMPONENT_HOVER, null);
|
|
84
|
+
}
|
|
85
|
+
}, {
|
|
86
|
+
target: simulatorRef
|
|
87
|
+
});
|
|
88
|
+
useEventListener('mouseleave', function () {
|
|
89
|
+
if (operatorId.detector) {
|
|
90
|
+
setOperatorId({
|
|
91
|
+
detector: null
|
|
92
|
+
});
|
|
93
|
+
context.$publisher(context.topics.COMPONENT_HOVER, null);
|
|
94
|
+
}
|
|
95
|
+
}, {
|
|
96
|
+
target: simulatorRef
|
|
97
|
+
});
|
|
98
|
+
useEventListener('click', function (event) {
|
|
99
|
+
var elem = event.target;
|
|
100
|
+
var targetCell = elem.closest(".".concat(CELL_CLASS_NAME));
|
|
101
|
+
var targetCellId = targetCell === null || targetCell === void 0 ? void 0 : targetCell.id;
|
|
102
|
+
if (!targetCellId || targetCellId === operatorId.selector) return;
|
|
103
|
+
context.$publisher(context.topics.COMPONENT_HOVER, null);
|
|
104
|
+
context.$publisher(context.topics.COMPONENT_ACTIVE, {
|
|
105
|
+
id: targetCell.id,
|
|
106
|
+
cellNode: targetCell
|
|
107
|
+
});
|
|
108
|
+
}, {
|
|
109
|
+
target: simulatorRef
|
|
110
|
+
});
|
|
111
|
+
useEffect(function () {
|
|
112
|
+
var hcid = context.$subscriber(context.topics.COMPONENT_HOVER).on(function (payload) {
|
|
113
|
+
if (payload.id) setOperatorId({
|
|
114
|
+
detector: payload.id
|
|
115
|
+
});else setOperatorId({
|
|
116
|
+
detector: null
|
|
117
|
+
});
|
|
118
|
+
}).watch();
|
|
119
|
+
var acid = context.$subscriber(context.topics.COMPONENT_ACTIVE).on(function (payload) {
|
|
120
|
+
if (payload.id) {
|
|
121
|
+
setOperatorId({
|
|
122
|
+
selector: payload.id,
|
|
123
|
+
detector: null
|
|
124
|
+
});
|
|
125
|
+
setActiceProps(context.componentMap.get(payload.id).api.getLevelNodes());
|
|
126
|
+
} else {
|
|
127
|
+
setActiceProps(null);
|
|
128
|
+
}
|
|
129
|
+
}).watch();
|
|
130
|
+
return function () {
|
|
131
|
+
context.$unsubscriber(context.topics.COMPONENT_HOVER, hcid);
|
|
132
|
+
context.$unsubscriber(context.topics.COMPONENT_ACTIVE, acid);
|
|
133
|
+
};
|
|
134
|
+
}, [context.pageData]);
|
|
135
|
+
useEffect(function () {
|
|
136
|
+
var moid = context.$subscriber(context.topics.MODAL_OPEN).on(function () {
|
|
137
|
+
simulatorRef.current.style['overflow-y'] = 'hidden';
|
|
138
|
+
}).watch();
|
|
139
|
+
var mcid = context.$subscriber(context.topics.MODAL_CLOSE).on(function () {
|
|
140
|
+
simulatorRef.current.style['overflow-y'] = 'auto';
|
|
141
|
+
}).watch();
|
|
142
|
+
var laid = context.$subscriber(context.topics.LANG_SETTING_SELECT).on(function (_ref) {
|
|
143
|
+
var _langList = _ref.langList;
|
|
144
|
+
return setLangList(_langList);
|
|
145
|
+
}).watch();
|
|
146
|
+
return function () {
|
|
147
|
+
context.$unsubscriber(context.topics.MODAL_OPEN, moid);
|
|
148
|
+
context.$unsubscriber(context.topics.MODAL_CLOSE, mcid);
|
|
149
|
+
context.$unsubscriber(context.topics.LANG_SETTING_SELECT, laid);
|
|
150
|
+
};
|
|
151
|
+
}, []);
|
|
152
|
+
useEffect(function () {
|
|
153
|
+
var csid = context.$subscriber(context.topics.COMPONENT_SETTING_CLICK).on(function (_ref2) {
|
|
154
|
+
var data = _ref2.data;
|
|
155
|
+
if (!operatorId.selector) {
|
|
156
|
+
message.info('请在右侧画布选择节点');
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (context.componentMap.get(operatorId.selector).dom.getAttribute('name') !== 'box') {
|
|
160
|
+
message.info('该节点不支持添加子节点');
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
var json = require("../engine/meta/".concat(data.component.toLowerCase(), ".props.default.json"));
|
|
164
|
+
var _id = "".concat(data.component.toLowerCase(), "_").concat(suid());
|
|
165
|
+
var cloneData = cloneDeep(context.pageData);
|
|
166
|
+
add(cloneData, operatorId.selector, _id, json);
|
|
167
|
+
context._setPageData(cloneData).then(function (newData) {
|
|
168
|
+
context.$publisher(context.topics.COMPONENT_APPEND, {
|
|
169
|
+
id: _id,
|
|
170
|
+
pageData: newData
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
}).watch();
|
|
174
|
+
return function () {
|
|
175
|
+
return context.$unsubscriber(context.topics.COMPONENT_SETTING_CLICK, csid);
|
|
176
|
+
};
|
|
177
|
+
}, [context.pageData]);
|
|
178
|
+
var getDomById = useMemoizedFn(function (id) {
|
|
179
|
+
return context.componentMap.get(id).dom;
|
|
180
|
+
});
|
|
181
|
+
var handleLangChange = useMemoizedFn(function (locale) {
|
|
182
|
+
if (moment !== null && moment !== void 0 && moment.locale) {
|
|
183
|
+
var _localeInfo$locale;
|
|
184
|
+
moment.locale(((_localeInfo$locale = localeInfo[locale]) === null || _localeInfo$locale === void 0 ? void 0 : _localeInfo$locale.momentLocale) || 'en');
|
|
185
|
+
}
|
|
186
|
+
setLocale(locale);
|
|
187
|
+
setContainerIntl(getIntl(locale));
|
|
188
|
+
});
|
|
189
|
+
var handleSelect = function handleSelect(_key) {
|
|
190
|
+
context.$publisher(context.topics.COMPONENT_ACTIVE, _key ? {
|
|
191
|
+
id: _key,
|
|
192
|
+
cellNode: getDomById(_key)
|
|
193
|
+
} : null);
|
|
194
|
+
};
|
|
195
|
+
var handleHover = function handleHover(_key) {
|
|
196
|
+
context.$publisher(context.topics.COMPONENT_HOVER, _key ? {
|
|
197
|
+
id: _key,
|
|
198
|
+
cellNode: getDomById(_key)
|
|
199
|
+
} : null);
|
|
200
|
+
};
|
|
201
|
+
var menu = useCreation(function () {
|
|
202
|
+
if ((acticeProps === null || acticeProps === void 0 ? void 0 : acticeProps.length) > 0) return /*#__PURE__*/React.createElement("div", {
|
|
203
|
+
className: styles['next-overlay-wrapper'],
|
|
204
|
+
onMouseLeave: function onMouseLeave() {
|
|
205
|
+
return handleHover();
|
|
206
|
+
}
|
|
207
|
+
}, reverse(initial(acticeProps)).map(function (m) {
|
|
208
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
209
|
+
key: m.id
|
|
210
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
211
|
+
onClick: function onClick() {
|
|
212
|
+
return handleSelect(m.id);
|
|
213
|
+
},
|
|
214
|
+
onMouseOver: function onMouseOver() {
|
|
215
|
+
return handleHover(m.id);
|
|
216
|
+
}
|
|
217
|
+
}, m.name));
|
|
218
|
+
}));
|
|
219
|
+
return [];
|
|
220
|
+
}, [acticeProps]);
|
|
221
|
+
console.log('operatorId', operatorId);
|
|
222
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
223
|
+
className: styles['lc-painter-design']
|
|
224
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
225
|
+
className: styles['lc-painter-design-toolbar']
|
|
226
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
227
|
+
size: "small",
|
|
228
|
+
value: langList ? locale : undefined,
|
|
229
|
+
className: styles['i18n-selecter'],
|
|
230
|
+
style: {
|
|
231
|
+
fontSize: 12
|
|
232
|
+
},
|
|
233
|
+
onSelect: handleLangChange
|
|
234
|
+
}, langList === null || langList === void 0 ? void 0 : langList.map(function (item) {
|
|
235
|
+
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
236
|
+
key: item.field,
|
|
237
|
+
value: item.field
|
|
238
|
+
}, item.title);
|
|
239
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
240
|
+
className: classNames(styles['toolbar-item'], _defineProperty({}, styles.actived, activedTarget === 'pc')),
|
|
241
|
+
onClick: function onClick() {
|
|
242
|
+
return setActivedTarget('pc');
|
|
243
|
+
}
|
|
244
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
245
|
+
type: "laptop"
|
|
246
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
247
|
+
className: classNames(styles['toolbar-item'], _defineProperty({}, styles.actived, activedTarget === 'mobile')),
|
|
248
|
+
onClick: function onClick() {
|
|
249
|
+
return setActivedTarget('mobile');
|
|
250
|
+
}
|
|
251
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
252
|
+
type: "mobile"
|
|
253
|
+
})), /*#__PURE__*/React.createElement(Divider, {
|
|
254
|
+
type: "vertical"
|
|
255
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
256
|
+
style: {
|
|
257
|
+
width: 'auto',
|
|
258
|
+
fontSize: 12
|
|
259
|
+
},
|
|
260
|
+
className: styles['toolbar-item'],
|
|
261
|
+
onClick: function onClick() {
|
|
262
|
+
context.$publisher(context.topics.COMPONENT_ACTIVE, {
|
|
263
|
+
id: CELL_KEY.PAGE_ROOT,
|
|
264
|
+
cellNode: getDomById(CELL_KEY.PAGE_ROOT)
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}, "\u9875\u9762\u5C5E\u6027"), /*#__PURE__*/React.createElement(Divider, {
|
|
268
|
+
type: "vertical"
|
|
269
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
270
|
+
size: "small",
|
|
271
|
+
style: {
|
|
272
|
+
fontSize: 12,
|
|
273
|
+
margin: '0 2px'
|
|
274
|
+
}
|
|
275
|
+
}, "\u9884\u89C8"), /*#__PURE__*/React.createElement(Divider, {
|
|
276
|
+
type: "vertical"
|
|
277
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
278
|
+
size: "small",
|
|
279
|
+
type: "primary",
|
|
280
|
+
style: {
|
|
281
|
+
fontSize: 12,
|
|
282
|
+
margin: '0 0 0 2px'
|
|
283
|
+
}
|
|
284
|
+
}, "\u4FDD\u5B58")), /*#__PURE__*/React.createElement("div", {
|
|
285
|
+
className: styles['lc-painter-design-workspace']
|
|
286
|
+
}, operatorId.detector && /*#__PURE__*/React.createElement("div", {
|
|
287
|
+
id: "lc-detector",
|
|
288
|
+
className: styles['lc-painter-design-detector'],
|
|
289
|
+
style: getOperatorStyle(simulatorRef.current, getDomById(operatorId.detector))
|
|
290
|
+
}), operatorId.selector && /*#__PURE__*/React.createElement("div", {
|
|
291
|
+
id: "lc-selector",
|
|
292
|
+
ref: selectorRef,
|
|
293
|
+
className: styles['lc-painter-design-selector'],
|
|
294
|
+
style: getOperatorStyle(simulatorRef.current, getDomById(operatorId.selector))
|
|
295
|
+
}, acticeProps && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
296
|
+
className: styles['lc-borders-actions'],
|
|
297
|
+
style: last(acticeProps).id === "page_root" ? {
|
|
298
|
+
top: 0
|
|
299
|
+
} : ((_selectorRef$current = selectorRef.current) === null || _selectorRef$current === void 0 ? void 0 : _selectorRef$current.offsetTop) < 23 ? {
|
|
300
|
+
bottom: '-23px'
|
|
301
|
+
} : {
|
|
302
|
+
top: '-23px'
|
|
303
|
+
}
|
|
304
|
+
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
305
|
+
overlay: menu,
|
|
306
|
+
placement: "bottomLeft"
|
|
307
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
308
|
+
className: "instance-node-selector"
|
|
309
|
+
}, last(acticeProps).name)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Icon, {
|
|
310
|
+
type: "delete"
|
|
311
|
+
}))))), /*#__PURE__*/React.createElement(ConfigProvider, {
|
|
312
|
+
locale: ((_localeInfo$locale2 = localeInfo[locale]) === null || _localeInfo$locale2 === void 0 ? void 0 : _localeInfo$locale2.antd) || {}
|
|
313
|
+
}, /*#__PURE__*/React.createElement(RawIntlProvider, {
|
|
314
|
+
value: intl
|
|
315
|
+
}, /*#__PURE__*/React.createElement(Page, {
|
|
316
|
+
ref: simulatorRef,
|
|
317
|
+
pageCode: "mk2i87qb",
|
|
318
|
+
className: styles['lc-painter-design-simulator']
|
|
319
|
+
})))));
|
|
320
|
+
};
|
|
321
|
+
export default Design;
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
3
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
4
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
6
|
+
var _getDvaApp;
|
|
7
|
+
import React, { useState } from 'react';
|
|
8
|
+
import { getDvaApp } from 'umi';
|
|
9
|
+
import { useAsyncEffect, useCreation, useMemoizedFn } from 'ahooks';
|
|
10
|
+
import { GridTable } from 'luck-design';
|
|
11
|
+
import { reduce, remove, cloneDeep, debounce } from 'lodash';
|
|
12
|
+
import { Input, Button, Icon } from 'luck-design/antd';
|
|
13
|
+
import { formatMessage, suid } from '@luck-design-biz/base/utils';
|
|
14
|
+
import { useLDContext } from "../engine/provider/ContextProvider";
|
|
15
|
+
import { readAllLang, doAddLang, doUpdateLang, doDeleteLang } from "./services/I18n";
|
|
16
|
+
var Search = Input.Search;
|
|
17
|
+
var _getDvaApp$_store = (_getDvaApp = getDvaApp()) === null || _getDvaApp === void 0 ? void 0 : _getDvaApp._store,
|
|
18
|
+
dispatch = _getDvaApp$_store.dispatch;
|
|
19
|
+
var getLangKey = function getLangKey() {
|
|
20
|
+
return "app.lowcode.".concat(suid());
|
|
21
|
+
};
|
|
22
|
+
var formatDataFunc = function formatDataFunc(data) {
|
|
23
|
+
return _objectSpread(_objectSpread({}, data), reduce(data.languages, function (ret, value, key) {
|
|
24
|
+
ret[key] = value;
|
|
25
|
+
return ret;
|
|
26
|
+
}, {}));
|
|
27
|
+
};
|
|
28
|
+
var I18n = function I18n() {
|
|
29
|
+
var context = useLDContext();
|
|
30
|
+
var _useState = useState([]),
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
langList = _useState2[0],
|
|
33
|
+
setLangList = _useState2[1];
|
|
34
|
+
var _useState3 = useState([]),
|
|
35
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
36
|
+
dataSource = _useState4[0],
|
|
37
|
+
setDataSource = _useState4[1];
|
|
38
|
+
useAsyncEffect( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
39
|
+
var _langList;
|
|
40
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
41
|
+
while (1) switch (_context.prev = _context.next) {
|
|
42
|
+
case 0:
|
|
43
|
+
_context.next = 2;
|
|
44
|
+
return dispatch({
|
|
45
|
+
type: 'global/getDatadic',
|
|
46
|
+
payload: {
|
|
47
|
+
snamealias: 'base_lang'
|
|
48
|
+
},
|
|
49
|
+
format: function format(list, detail) {
|
|
50
|
+
return list.map(function (id) {
|
|
51
|
+
return {
|
|
52
|
+
title: detail[id].sname,
|
|
53
|
+
field: detail[id].sfactvalue,
|
|
54
|
+
editable: true,
|
|
55
|
+
filter: false
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
case 2:
|
|
61
|
+
_langList = _context.sent;
|
|
62
|
+
setLangList(_langList);
|
|
63
|
+
context.$publisher(context.topics.LANG_SETTING_SELECT, {
|
|
64
|
+
langList: _langList
|
|
65
|
+
});
|
|
66
|
+
doQuery();
|
|
67
|
+
case 6:
|
|
68
|
+
case "end":
|
|
69
|
+
return _context.stop();
|
|
70
|
+
}
|
|
71
|
+
}, _callee);
|
|
72
|
+
})), []);
|
|
73
|
+
var doQuery = useMemoizedFn(function () {
|
|
74
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
75
|
+
readAllLang(_objectSpread(_objectSpread({}, value), {}, {
|
|
76
|
+
classifyKey: '__LOWCODE__'
|
|
77
|
+
})).then(function (res) {
|
|
78
|
+
var code = res.code,
|
|
79
|
+
list = res.list,
|
|
80
|
+
detail = res.detail;
|
|
81
|
+
if (code === 1) setDataSource(list.map(function (id) {
|
|
82
|
+
return formatDataFunc(detail[id]);
|
|
83
|
+
}));
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
var actionsColumn = useCreation(function () {
|
|
87
|
+
return {
|
|
88
|
+
width: 60,
|
|
89
|
+
getActions: function getActions() {
|
|
90
|
+
return [{
|
|
91
|
+
wanted: 'update',
|
|
92
|
+
title: /*#__PURE__*/React.createElement(Icon, {
|
|
93
|
+
type: "copy"
|
|
94
|
+
}),
|
|
95
|
+
action: function action(_data) {
|
|
96
|
+
var data = {
|
|
97
|
+
languages: reduce(langList, function (result, value) {
|
|
98
|
+
result[value.field] = _data[value.field];
|
|
99
|
+
return result;
|
|
100
|
+
}, {})
|
|
101
|
+
};
|
|
102
|
+
handleAdd(data);
|
|
103
|
+
}
|
|
104
|
+
}, {
|
|
105
|
+
wanted: 'delete',
|
|
106
|
+
title: /*#__PURE__*/React.createElement(Icon, {
|
|
107
|
+
type: "delete"
|
|
108
|
+
}),
|
|
109
|
+
confirm: {
|
|
110
|
+
title: formatMessage({
|
|
111
|
+
id: 'app.base.confirm.delete'
|
|
112
|
+
})
|
|
113
|
+
},
|
|
114
|
+
action: handleDelete
|
|
115
|
+
}];
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
}, [langList]);
|
|
119
|
+
var handleAdd = useMemoizedFn(function () {
|
|
120
|
+
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
121
|
+
var addItems = _objectSpread(_objectSpread({}, data), {}, {
|
|
122
|
+
langKey: getLangKey(),
|
|
123
|
+
classifyKey: '__LOWCODE__'
|
|
124
|
+
});
|
|
125
|
+
doAddLang({}, addItems).then(function (res) {
|
|
126
|
+
var code = res.code,
|
|
127
|
+
list = res.list,
|
|
128
|
+
detail = res.detail;
|
|
129
|
+
if (code === 1) setDataSource([formatDataFunc(detail[list[0]])].concat(dataSource));
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
var handleValueChange = useMemoizedFn(function (field, newValue, oldValue, record) {
|
|
133
|
+
doUpdateLang({}, {
|
|
134
|
+
classifyKey: '__LOWCODE__',
|
|
135
|
+
langKey: record.langKey,
|
|
136
|
+
indocno: record.indocno,
|
|
137
|
+
languages: _objectSpread(_objectSpread({}, reduce(langList, function (result, value) {
|
|
138
|
+
result[value.field] = record[value.field];
|
|
139
|
+
return result;
|
|
140
|
+
}, {})), {}, _defineProperty({}, field, newValue))
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
var handleDelete = useMemoizedFn(function (data) {
|
|
144
|
+
doDeleteLang({}, {
|
|
145
|
+
delList: [{
|
|
146
|
+
indocno: data.indocno
|
|
147
|
+
}]
|
|
148
|
+
}).then(function (_ref2) {
|
|
149
|
+
var code = _ref2.code;
|
|
150
|
+
if (code === 1) {
|
|
151
|
+
var _data = cloneDeep(dataSource);
|
|
152
|
+
remove(_data, function (n) {
|
|
153
|
+
return n.indocno === data.indocno;
|
|
154
|
+
});
|
|
155
|
+
setDataSource(_data);
|
|
156
|
+
}
|
|
157
|
+
;
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
var handleSearch = debounce(doQuery, 300);
|
|
161
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
162
|
+
style: {
|
|
163
|
+
height: '100%',
|
|
164
|
+
padding: '16px 24px'
|
|
165
|
+
}
|
|
166
|
+
}, /*#__PURE__*/React.createElement(Search, {
|
|
167
|
+
placeholder: formatMessage({
|
|
168
|
+
id: 'luckda.lowcode.painter.I18n.search',
|
|
169
|
+
label: '搜索文案'
|
|
170
|
+
}),
|
|
171
|
+
onChange: function onChange(e) {
|
|
172
|
+
return handleSearch({
|
|
173
|
+
value: e.target.value
|
|
174
|
+
});
|
|
175
|
+
},
|
|
176
|
+
style: {
|
|
177
|
+
width: '100%'
|
|
178
|
+
},
|
|
179
|
+
allowClear: true
|
|
180
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
181
|
+
type: "primary",
|
|
182
|
+
ghost: true,
|
|
183
|
+
size: "small",
|
|
184
|
+
style: {
|
|
185
|
+
margin: '16px 0'
|
|
186
|
+
},
|
|
187
|
+
onClick: function onClick() {
|
|
188
|
+
return handleAdd();
|
|
189
|
+
}
|
|
190
|
+
}, formatMessage({
|
|
191
|
+
id: 'luckda.lowcode.painter.I18n.add',
|
|
192
|
+
label: '新增文案'
|
|
193
|
+
})), /*#__PURE__*/React.createElement(GridTable, {
|
|
194
|
+
height: 480,
|
|
195
|
+
columns: langList,
|
|
196
|
+
dataSource: dataSource,
|
|
197
|
+
renderIndex: false,
|
|
198
|
+
showStatusBar: false,
|
|
199
|
+
actionsColumn: actionsColumn,
|
|
200
|
+
onValueChange: handleValueChange,
|
|
201
|
+
operates: ['add', 'update', 'delete'],
|
|
202
|
+
bordered: false
|
|
203
|
+
}));
|
|
204
|
+
};
|
|
205
|
+
export default I18n;
|