@luck-design-biz/luckda 0.0.24-1 → 0.0.24-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/es/components/Builder/index.js +24 -17
- package/es/components/LdAutoForm/index.js +15 -5
- 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 +4 -1
- package/es/components/LdFormList/model.js +0 -0
- package/es/components/LdGrid/index.js +13 -7
- package/es/components/LdGrid/model.js +0 -0
- package/es/components/LdGridForm/index.js +12 -4
- package/es/components/LdGridForm/index.less +0 -0
- package/es/components/LdInfoPanel/index.js +0 -0
- package/es/components/LdPop/index.js +0 -0
- package/es/components/LdRuntimeCom/index.js +0 -0
- package/es/components/LdTree/index.js +0 -0
- package/es/components/LdTree/index.less +0 -0
- package/es/helper/FromItems.js +0 -0
- package/es/helper/action.js +0 -0
- package/es/helper/form.js +8 -2
- package/es/helper/index.less +0 -0
- package/es/helper/ldBuilder.js +4 -1
- package/es/helper/ldComBuild.js +0 -0
- package/es/index.js +0 -0
- package/es/lowcode/constants/api-url.js +1 -2
- package/es/lowcode/constants/event-topics.js +1 -14
- package/es/lowcode/constants/index.js +0 -0
- package/es/lowcode/engine/factory/DataFactory.js +0 -0
- package/es/lowcode/engine/meta/button.props.default.json +7 -15
- package/es/lowcode/engine/meta/cardlist.props.default.json +9 -17
- package/es/lowcode/engine/meta/{button.props.json → components/button.json} +103 -121
- package/es/lowcode/engine/meta/{cardlist.props.json → components/card-list.json} +142 -143
- package/es/lowcode/engine/meta/{drawer.props.json → components/drawer.json} +142 -143
- package/es/lowcode/engine/meta/{form.props.json → components/form.json} +115 -116
- package/{lib/lowcode/engine/meta/iframe.props.json → es/lowcode/engine/meta/components/iframe.json} +30 -31
- package/{lib/lowcode/engine/meta/image.props.json → es/lowcode/engine/meta/components/image.json} +112 -113
- package/es/lowcode/engine/meta/{imex.props.json → components/imex.json} +80 -81
- package/es/lowcode/engine/meta/{jsx.props.json → components/jsx.json} +23 -24
- package/{lib/lowcode/engine/meta/layout.props.json → es/lowcode/engine/meta/components/layout.json} +106 -107
- package/{lib/lowcode/engine/meta/link.props.json → es/lowcode/engine/meta/components/link.json} +110 -111
- package/{lib/lowcode/engine/meta/dialog.props.json → es/lowcode/engine/meta/components/modal.json} +119 -120
- package/{lib/lowcode/engine/meta/section.props.json → es/lowcode/engine/meta/components/section.json} +106 -107
- package/es/lowcode/engine/meta/{split.props.json → components/split.json} +70 -71
- package/es/lowcode/{view/lc-components/CardList/meta.json → engine/meta/components/table.json} +28 -11
- package/{lib/lowcode/engine/meta/tabs.props.json → es/lowcode/engine/meta/components/tabs.json} +139 -140
- package/{lib/lowcode/engine/meta/text.props.json → es/lowcode/engine/meta/components/text.json} +64 -65
- package/es/lowcode/engine/meta/{tree.props.json → components/tree.json} +155 -156
- package/es/lowcode/engine/meta/components-list.json +121 -127
- package/es/lowcode/engine/meta/drawer.props.default.json +9 -17
- package/es/lowcode/engine/meta/form.props.default.json +4 -12
- package/es/lowcode/engine/meta/iframe.props.default.json +2 -10
- package/es/lowcode/engine/meta/image.props.default.json +7 -15
- package/es/lowcode/engine/meta/imex.props.default.json +3 -11
- package/es/lowcode/engine/meta/jsx.props.default.json +1 -10
- package/es/lowcode/engine/meta/layout.props.default.json +4 -12
- package/es/lowcode/engine/meta/link.props.default.json +5 -13
- package/es/lowcode/engine/meta/modal.props.default.json +11 -0
- package/es/lowcode/engine/meta/section.props.default.json +8 -16
- package/es/lowcode/engine/meta/split.props.default.json +4 -12
- package/es/lowcode/engine/meta/table.props.default.json +9 -11
- package/es/lowcode/engine/meta/tabs.props.default.json +9 -17
- package/es/lowcode/engine/meta/text.props.default.json +3 -11
- package/es/lowcode/engine/meta/tree.props.default.json +8 -16
- package/es/lowcode/engine/provider/ContextProvider.js +17 -10
- package/es/lowcode/engine/provider/EventBusProvider.js +2 -2
- package/es/lowcode/engine/tools/dataProcess.js +5 -80
- package/es/lowcode/engine/tools/helper.js +0 -0
- package/es/lowcode/engine/tools/lcid.js +16 -0
- package/es/lowcode/index.js +0 -0
- package/es/lowcode/painter/Components.js +0 -0
- package/es/lowcode/painter/Design.js +42 -274
- package/es/lowcode/painter/I18n.js +2 -202
- package/es/lowcode/painter/Outline.js +28 -33
- package/es/lowcode/painter/Panel.js +2 -201
- package/es/lowcode/painter/Ribbon.js +55 -61
- package/es/lowcode/painter/components/PanelItem.js +9 -52
- package/es/lowcode/painter/components/RuleInput.js +4 -4
- package/es/lowcode/painter/index.js +1 -27
- package/es/lowcode/painter/panel-section/LayoutRatio.js +49 -56
- package/es/lowcode/painter/panel-section/Radio.js +58 -0
- package/es/lowcode/painter/style/components.less +0 -0
- package/es/lowcode/painter/style/design.less +5 -109
- package/es/lowcode/painter/style/index.less +1 -0
- package/es/lowcode/painter/style/layout-ratio.less +1 -1
- package/es/lowcode/painter/style/outline.less +0 -2
- package/es/lowcode/painter/style/panel-item.less +15 -38
- package/es/lowcode/painter/style/panel.less +0 -137
- package/es/lowcode/painter/style/radio.less +0 -0
- package/es/lowcode/painter/style/ribbon.less +0 -1
- package/es/lowcode/painter/style/rule-input.less +0 -0
- package/es/lowcode/view/Canvas.js +55 -63
- package/es/lowcode/view/Loading.js +0 -0
- package/es/lowcode/view/Page.js +2 -199
- package/es/lowcode/view/index.js +0 -0
- package/es/lowcode/view/lc-components/Box/index.js +5 -22
- package/es/lowcode/view/lc-components/Button/index.js +7 -72
- package/es/lowcode/view/lc-components/CardList/index.js +0 -0
- package/es/lowcode/view/lc-components/Dialog/index.js +1 -12
- package/es/lowcode/view/lc-components/Dialog/index.less +0 -0
- package/es/lowcode/view/lc-components/Drawer/index.js +3 -19
- package/es/lowcode/view/lc-components/Form/index.js +0 -0
- package/es/lowcode/view/lc-components/Iframe/index.js +0 -0
- package/es/lowcode/view/lc-components/ImEx/index.js +0 -0
- package/es/lowcode/view/lc-components/Image/index.js +0 -0
- package/es/lowcode/view/lc-components/JSX/index.js +0 -0
- package/es/lowcode/view/lc-components/Layout/index.js +7 -40
- package/es/lowcode/view/lc-components/Link/index.js +0 -0
- package/es/lowcode/view/lc-components/Section/index.js +0 -0
- package/es/lowcode/view/lc-components/Split/index.js +0 -0
- package/es/lowcode/view/lc-components/Table/index.js +8 -138
- package/es/lowcode/view/lc-components/Tabs/index.js +0 -0
- package/es/lowcode/view/lc-components/Text/index.js +0 -0
- package/es/lowcode/view/lc-components/Tree/index.js +0 -0
- package/es/lowcode/view/lc-components/Wrapper.js +23 -32
- package/es/lowcode/view/style/canvas.less +0 -0
- package/es/lowcode/view/style/loading.less +0 -0
- package/es/lowcode/view/style/page.less +1 -0
- package/es/services.js +24 -7
- package/es/upload/Form/gridForm.js +5 -4
- package/es/upload/Form/index.js +0 -0
- package/es/upload/Form/index.less +0 -0
- package/es/upload/FormItem/index.js +4 -3
- 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 +37 -3
- package/es/utils/grid.js +9 -8
- package/es/utils/index.js +0 -0
- package/lib/components/Builder/index.js +22 -15
- package/lib/components/LdAutoForm/index.js +14 -4
- 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 +5 -1
- package/lib/components/LdFormList/model.js +0 -0
- package/lib/components/LdGrid/index.js +13 -7
- package/lib/components/LdGrid/model.js +0 -0
- package/lib/components/LdGridForm/index.js +11 -3
- package/lib/components/LdGridForm/index.less +0 -0
- package/lib/components/LdInfoPanel/index.js +0 -0
- package/lib/components/LdPop/index.js +0 -0
- package/lib/components/LdRuntimeCom/index.js +0 -0
- package/lib/components/LdTree/index.js +0 -0
- package/lib/components/LdTree/index.less +0 -0
- package/lib/helper/FromItems.js +0 -0
- package/lib/helper/action.js +0 -0
- package/lib/helper/form.js +8 -2
- package/lib/helper/index.less +0 -0
- package/lib/helper/ldBuilder.js +4 -1
- package/lib/helper/ldComBuild.js +0 -0
- package/lib/index.js +0 -0
- package/lib/lowcode/constants/api-url.js +2 -3
- package/lib/lowcode/constants/event-topics.js +2 -15
- package/lib/lowcode/constants/index.js +0 -0
- package/lib/lowcode/engine/factory/DataFactory.js +0 -0
- package/lib/lowcode/engine/meta/button.props.default.json +7 -15
- package/lib/lowcode/engine/meta/cardlist.props.default.json +9 -17
- package/lib/lowcode/engine/meta/{button.props.json → components/button.json} +103 -121
- package/lib/lowcode/engine/meta/{cardlist.props.json → components/card-list.json} +142 -143
- package/lib/lowcode/engine/meta/{drawer.props.json → components/drawer.json} +142 -143
- package/lib/lowcode/engine/meta/{form.props.json → components/form.json} +115 -116
- package/{es/lowcode/engine/meta/iframe.props.json → lib/lowcode/engine/meta/components/iframe.json} +30 -31
- package/{es/lowcode/engine/meta/image.props.json → lib/lowcode/engine/meta/components/image.json} +112 -113
- package/lib/lowcode/engine/meta/{imex.props.json → components/imex.json} +80 -81
- package/lib/lowcode/engine/meta/{jsx.props.json → components/jsx.json} +23 -24
- package/{es/lowcode/engine/meta/layout.props.json → lib/lowcode/engine/meta/components/layout.json} +106 -107
- package/{es/lowcode/engine/meta/link.props.json → lib/lowcode/engine/meta/components/link.json} +110 -111
- package/{es/lowcode/engine/meta/dialog.props.json → lib/lowcode/engine/meta/components/modal.json} +119 -120
- package/{es/lowcode/engine/meta/section.props.json → lib/lowcode/engine/meta/components/section.json} +106 -107
- package/lib/lowcode/engine/meta/{split.props.json → components/split.json} +70 -71
- package/lib/lowcode/{view/lc-components/CardList/meta.json → engine/meta/components/table.json} +28 -11
- package/{es/lowcode/engine/meta/tabs.props.json → lib/lowcode/engine/meta/components/tabs.json} +139 -140
- package/{es/lowcode/engine/meta/text.props.json → lib/lowcode/engine/meta/components/text.json} +64 -65
- package/lib/lowcode/engine/meta/{tree.props.json → components/tree.json} +155 -156
- package/lib/lowcode/engine/meta/components-list.json +121 -127
- package/lib/lowcode/engine/meta/drawer.props.default.json +9 -17
- package/lib/lowcode/engine/meta/form.props.default.json +4 -12
- package/lib/lowcode/engine/meta/iframe.props.default.json +2 -10
- package/lib/lowcode/engine/meta/image.props.default.json +7 -15
- package/lib/lowcode/engine/meta/imex.props.default.json +3 -11
- package/lib/lowcode/engine/meta/jsx.props.default.json +1 -10
- package/lib/lowcode/engine/meta/layout.props.default.json +4 -12
- package/lib/lowcode/engine/meta/link.props.default.json +5 -13
- package/lib/lowcode/engine/meta/modal.props.default.json +11 -0
- package/lib/lowcode/engine/meta/section.props.default.json +8 -16
- package/lib/lowcode/engine/meta/split.props.default.json +4 -12
- package/lib/lowcode/engine/meta/table.props.default.json +9 -11
- package/lib/lowcode/engine/meta/tabs.props.default.json +9 -17
- package/lib/lowcode/engine/meta/text.props.default.json +3 -11
- package/lib/lowcode/engine/meta/tree.props.default.json +8 -16
- package/lib/lowcode/engine/provider/ContextProvider.js +16 -9
- package/lib/lowcode/engine/provider/EventBusProvider.js +2 -2
- package/lib/lowcode/engine/tools/dataProcess.js +5 -81
- package/lib/lowcode/engine/tools/helper.js +0 -0
- package/lib/lowcode/engine/tools/lcid.js +22 -0
- package/lib/lowcode/index.js +0 -0
- package/lib/lowcode/painter/Components.js +0 -0
- package/lib/lowcode/painter/Design.js +40 -271
- package/lib/lowcode/painter/I18n.js +2 -203
- package/lib/lowcode/painter/Outline.js +27 -32
- package/lib/lowcode/painter/Panel.js +2 -201
- package/lib/lowcode/painter/Ribbon.js +64 -63
- package/lib/lowcode/painter/components/PanelItem.js +9 -53
- package/lib/lowcode/painter/components/RuleInput.js +4 -4
- package/lib/lowcode/painter/index.js +1 -29
- package/lib/lowcode/painter/panel-section/LayoutRatio.js +48 -55
- package/lib/lowcode/painter/panel-section/Radio.js +65 -0
- package/lib/lowcode/painter/style/components.less +0 -0
- package/lib/lowcode/painter/style/design.less +5 -109
- package/lib/lowcode/painter/style/index.less +1 -0
- package/lib/lowcode/painter/style/layout-ratio.less +1 -1
- package/lib/lowcode/painter/style/outline.less +0 -2
- package/lib/lowcode/painter/style/panel-item.less +15 -38
- package/lib/lowcode/painter/style/panel.less +0 -137
- package/lib/lowcode/painter/style/radio.less +0 -0
- package/lib/lowcode/painter/style/ribbon.less +0 -1
- package/lib/lowcode/painter/style/rule-input.less +0 -0
- package/lib/lowcode/view/Canvas.js +60 -68
- package/lib/lowcode/view/Loading.js +0 -0
- package/lib/lowcode/view/Page.js +1 -198
- package/lib/lowcode/view/index.js +0 -0
- package/lib/lowcode/view/lc-components/Box/index.js +6 -23
- package/lib/lowcode/view/lc-components/Button/index.js +8 -73
- package/lib/lowcode/view/lc-components/CardList/index.js +0 -0
- package/lib/lowcode/view/lc-components/Dialog/index.js +0 -11
- package/lib/lowcode/view/lc-components/Dialog/index.less +0 -0
- package/lib/lowcode/view/lc-components/Drawer/index.js +2 -18
- package/lib/lowcode/view/lc-components/Form/index.js +0 -0
- package/lib/lowcode/view/lc-components/Iframe/index.js +0 -0
- package/lib/lowcode/view/lc-components/ImEx/index.js +0 -0
- package/lib/lowcode/view/lc-components/Image/index.js +0 -0
- package/lib/lowcode/view/lc-components/JSX/index.js +0 -0
- package/lib/lowcode/view/lc-components/Layout/index.js +8 -41
- package/lib/lowcode/view/lc-components/Link/index.js +0 -0
- package/lib/lowcode/view/lc-components/Section/index.js +0 -0
- package/lib/lowcode/view/lc-components/Split/index.js +0 -0
- package/lib/lowcode/view/lc-components/Table/index.js +8 -138
- package/lib/lowcode/view/lc-components/Tabs/index.js +0 -0
- package/lib/lowcode/view/lc-components/Text/index.js +0 -0
- package/lib/lowcode/view/lc-components/Tree/index.js +0 -0
- package/lib/lowcode/view/lc-components/Wrapper.js +21 -30
- package/lib/lowcode/view/style/canvas.less +0 -0
- package/lib/lowcode/view/style/loading.less +0 -0
- package/lib/lowcode/view/style/page.less +1 -0
- package/lib/services.js +25 -7
- package/lib/upload/Form/gridForm.js +5 -4
- package/lib/upload/Form/index.js +0 -0
- package/lib/upload/Form/index.less +0 -0
- package/lib/upload/FormItem/index.js +4 -3
- 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 +38 -3
- package/lib/utils/grid.js +11 -10
- package/lib/utils/index.js +0 -0
- package/lowcode.js +0 -0
- package/package.json +5 -12
- package/upload.js +0 -0
- package/utils.js +0 -0
- package/es/lowcode/engine/factory/panel-item-factory/DynamicStrategy.js +0 -60
- package/es/lowcode/engine/factory/panel-item-factory/GroupStrategy.js +0 -32
- package/es/lowcode/engine/factory/panel-item-factory/SegmentedStrategy.js +0 -32
- package/es/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +0 -50
- package/es/lowcode/engine/factory/panel-item-factory/Strategy.js +0 -21
- package/es/lowcode/engine/factory/panel-item-factory/StringStrategy.js +0 -50
- package/es/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +0 -32
- package/es/lowcode/engine/factory/panel-item-factory/index.js +0 -42
- package/es/lowcode/engine/meta/box.props.default.json +0 -12
- package/es/lowcode/engine/meta/box.props.json +0 -42
- package/es/lowcode/engine/meta/dialog.props.default.json +0 -19
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +0 -29
- package/es/lowcode/engine/meta/table.props.json +0 -174
- package/es/lowcode/engine/tools/usePromiseState.js +0 -24
- package/es/lowcode/painter/components/Collapse.js +0 -31
- package/es/lowcode/painter/components/NumberInput.js +0 -93
- package/es/lowcode/painter/components/PopConfirm.js +0 -20
- package/es/lowcode/painter/components/PopForm.js +0 -71
- package/es/lowcode/painter/components/SortBox.js +0 -92
- package/es/lowcode/painter/components/TabEditor.js +0 -88
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +0 -118
- package/es/lowcode/painter/components/code-editor/CssEditor.js +0 -14
- package/es/lowcode/painter/components/code-editor/FullScreenEditor.js +0 -64
- package/es/lowcode/painter/components/code-editor/JSEditor.js +0 -84
- package/es/lowcode/painter/components/code-editor/index.js +0 -2
- package/es/lowcode/painter/panel-section/ButtonType.js +0 -39
- package/es/lowcode/painter/panel-section/Icon.js +0 -48
- package/es/lowcode/painter/panel-section/IconSelector.js +0 -134
- package/es/lowcode/painter/panel-section/StylePanel/Display.js +0 -292
- package/es/lowcode/painter/panel-section/StylePanel/DisplaySvg.js +0 -543
- package/es/lowcode/painter/panel-section/StylePanel/Height.js +0 -48
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +0 -64
- package/es/lowcode/painter/panel-section/StylePanel/StyleContext.js +0 -101
- package/es/lowcode/painter/panel-section/StylePanel/Width.js +0 -48
- package/es/lowcode/painter/panel-section/StylePanel/index.js +0 -12
- package/es/lowcode/painter/panel-section/TabItems.js +0 -237
- package/es/lowcode/painter/services/I18n.js +0 -85
- package/es/lowcode/painter/style/button-type.less +0 -5
- package/es/lowcode/painter/style/collapse.less +0 -21
- package/es/lowcode/painter/style/display.less +0 -17
- package/es/lowcode/painter/style/fullscreen-editor.less +0 -17
- package/es/lowcode/painter/style/icon-selector.less +0 -22
- package/es/lowcode/painter/style/icon.less +0 -11
- package/es/lowcode/painter/style/number-input.less +0 -17
- package/es/lowcode/painter/style/pop-confirm.less +0 -10
- package/es/lowcode/painter/style/pop-form.less +0 -20
- package/es/lowcode/painter/style/style-panel.less +0 -5
- package/es/lowcode/painter/style/tabeditor.less +0 -90
- package/es/lowcode/painter/style/tabitems.less +0 -90
- package/es/lowcode/view/lc-components/Box/FunctionDesign.js +0 -20
- package/es/lowcode/view/lc-components/Box/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Box/index.less +0 -15
- package/es/lowcode/view/lc-components/Box/meta.json +0 -42
- package/es/lowcode/view/lc-components/Button/FunctionDesign.js +0 -21
- package/es/lowcode/view/lc-components/Button/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Button/meta.json +0 -122
- package/es/lowcode/view/lc-components/CardList/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/CardList/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Dialog/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Dialog/meta.json +0 -121
- package/es/lowcode/view/lc-components/Drawer/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Drawer/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Drawer/meta.json +0 -144
- package/es/lowcode/view/lc-components/Drawer/style.less +0 -7
- package/es/lowcode/view/lc-components/Form/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Form/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Form/meta.json +0 -117
- package/es/lowcode/view/lc-components/Iframe/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Iframe/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Iframe/meta.json +0 -32
- package/es/lowcode/view/lc-components/ImEx/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/ImEx/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/ImEx/meta.json +0 -82
- package/es/lowcode/view/lc-components/Image/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Image/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Image/meta.json +0 -114
- package/es/lowcode/view/lc-components/JSX/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/JSX/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/JSX/meta.json +0 -25
- package/es/lowcode/view/lc-components/Layout/FunctionDesign.js +0 -75
- package/es/lowcode/view/lc-components/Layout/FunctionLive.js +0 -15
- package/es/lowcode/view/lc-components/Layout/index.less +0 -5
- package/es/lowcode/view/lc-components/Layout/meta.json +0 -108
- package/es/lowcode/view/lc-components/Link/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Link/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Link/meta.json +0 -112
- package/es/lowcode/view/lc-components/Section/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Section/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Section/meta.json +0 -108
- package/es/lowcode/view/lc-components/Split/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Split/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Split/meta.json +0 -72
- package/es/lowcode/view/lc-components/Table/FunctionDesign.js +0 -16
- package/es/lowcode/view/lc-components/Table/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Table/meta.json +0 -174
- package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Tabs/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Tabs/meta.json +0 -141
- package/es/lowcode/view/lc-components/Text/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Text/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Text/meta.json +0 -66
- package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Tree/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Tree/meta.json +0 -157
- package/lib/lowcode/engine/factory/panel-item-factory/DynamicStrategy.js +0 -73
- package/lib/lowcode/engine/factory/panel-item-factory/GroupStrategy.js +0 -38
- package/lib/lowcode/engine/factory/panel-item-factory/SegmentedStrategy.js +0 -38
- package/lib/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +0 -56
- package/lib/lowcode/engine/factory/panel-item-factory/Strategy.js +0 -27
- package/lib/lowcode/engine/factory/panel-item-factory/StringStrategy.js +0 -56
- package/lib/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +0 -38
- package/lib/lowcode/engine/factory/panel-item-factory/index.js +0 -48
- package/lib/lowcode/engine/meta/box.props.default.json +0 -12
- package/lib/lowcode/engine/meta/box.props.json +0 -42
- package/lib/lowcode/engine/meta/dialog.props.default.json +0 -19
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +0 -29
- package/lib/lowcode/engine/meta/table.props.json +0 -174
- package/lib/lowcode/engine/tools/usePromiseState.js +0 -31
- package/lib/lowcode/painter/components/Collapse.js +0 -39
- package/lib/lowcode/painter/components/NumberInput.js +0 -101
- package/lib/lowcode/painter/components/PopConfirm.js +0 -26
- package/lib/lowcode/painter/components/PopForm.js +0 -77
- package/lib/lowcode/painter/components/SortBox.js +0 -99
- package/lib/lowcode/painter/components/TabEditor.js +0 -94
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +0 -126
- package/lib/lowcode/painter/components/code-editor/CssEditor.js +0 -22
- package/lib/lowcode/painter/components/code-editor/FullScreenEditor.js +0 -72
- package/lib/lowcode/painter/components/code-editor/JSEditor.js +0 -95
- package/lib/lowcode/painter/components/code-editor/index.js +0 -20
- package/lib/lowcode/painter/panel-section/ButtonType.js +0 -46
- package/lib/lowcode/painter/panel-section/Icon.js +0 -54
- package/lib/lowcode/painter/panel-section/IconSelector.js +0 -141
- package/lib/lowcode/painter/panel-section/StylePanel/Display.js +0 -299
- package/lib/lowcode/painter/panel-section/StylePanel/DisplaySvg.js +0 -550
- package/lib/lowcode/painter/panel-section/StylePanel/Height.js +0 -55
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +0 -72
- package/lib/lowcode/painter/panel-section/StylePanel/StyleContext.js +0 -112
- package/lib/lowcode/painter/panel-section/StylePanel/Width.js +0 -55
- package/lib/lowcode/painter/panel-section/StylePanel/index.js +0 -19
- package/lib/lowcode/painter/panel-section/TabItems.js +0 -245
- package/lib/lowcode/painter/services/I18n.js +0 -95
- package/lib/lowcode/painter/style/button-type.less +0 -5
- package/lib/lowcode/painter/style/collapse.less +0 -21
- package/lib/lowcode/painter/style/display.less +0 -17
- package/lib/lowcode/painter/style/fullscreen-editor.less +0 -17
- package/lib/lowcode/painter/style/icon-selector.less +0 -22
- package/lib/lowcode/painter/style/icon.less +0 -11
- package/lib/lowcode/painter/style/number-input.less +0 -17
- package/lib/lowcode/painter/style/pop-confirm.less +0 -10
- package/lib/lowcode/painter/style/pop-form.less +0 -20
- package/lib/lowcode/painter/style/style-panel.less +0 -5
- package/lib/lowcode/painter/style/tabeditor.less +0 -90
- package/lib/lowcode/painter/style/tabitems.less +0 -90
- package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +0 -27
- package/lib/lowcode/view/lc-components/Box/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Box/index.less +0 -15
- package/lib/lowcode/view/lc-components/Box/meta.json +0 -42
- package/lib/lowcode/view/lc-components/Button/FunctionDesign.js +0 -28
- package/lib/lowcode/view/lc-components/Button/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Button/meta.json +0 -122
- package/lib/lowcode/view/lc-components/CardList/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/CardList/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Dialog/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Dialog/meta.json +0 -121
- package/lib/lowcode/view/lc-components/Drawer/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Drawer/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Drawer/meta.json +0 -144
- package/lib/lowcode/view/lc-components/Drawer/style.less +0 -7
- package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Form/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Form/meta.json +0 -117
- package/lib/lowcode/view/lc-components/Iframe/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Iframe/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Iframe/meta.json +0 -32
- package/lib/lowcode/view/lc-components/ImEx/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/ImEx/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/ImEx/meta.json +0 -82
- package/lib/lowcode/view/lc-components/Image/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Image/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Image/meta.json +0 -114
- package/lib/lowcode/view/lc-components/JSX/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/JSX/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/JSX/meta.json +0 -25
- package/lib/lowcode/view/lc-components/Layout/FunctionDesign.js +0 -82
- package/lib/lowcode/view/lc-components/Layout/FunctionLive.js +0 -22
- package/lib/lowcode/view/lc-components/Layout/index.less +0 -5
- package/lib/lowcode/view/lc-components/Layout/meta.json +0 -108
- package/lib/lowcode/view/lc-components/Link/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Link/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Link/meta.json +0 -112
- package/lib/lowcode/view/lc-components/Section/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Section/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Section/meta.json +0 -108
- package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Split/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Split/meta.json +0 -72
- package/lib/lowcode/view/lc-components/Table/FunctionDesign.js +0 -23
- package/lib/lowcode/view/lc-components/Table/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Table/meta.json +0 -174
- package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Tabs/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Tabs/meta.json +0 -141
- package/lib/lowcode/view/lc-components/Text/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Text/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Text/meta.json +0 -66
- package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Tree/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Tree/meta.json +0 -157
|
@@ -1,91 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
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, useSize } 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';
|
|
1
|
+
import React, { useRef, useEffect } from 'react';
|
|
2
|
+
import { useEventListener } from 'ahooks';
|
|
12
3
|
import { useLDContext } from "../engine/provider/ContextProvider";
|
|
13
4
|
import Page from "../view/Page";
|
|
14
|
-
import {
|
|
15
|
-
import { CELL_KEY, CELL_CLASS_NAME } from "../constants";
|
|
5
|
+
import { CELL_CLASS_NAME } from "../constants";
|
|
16
6
|
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
7
|
var Design = function Design() {
|
|
32
|
-
var _selectorRef$current, _localeInfo$locale2;
|
|
33
8
|
var context = useLDContext();
|
|
9
|
+
var detectorRef = useRef(null);
|
|
34
10
|
var selectorRef = useRef(null);
|
|
35
11
|
var simulatorRef = useRef(null);
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
selector: null,
|
|
39
|
-
detector: null
|
|
40
|
-
}),
|
|
41
|
-
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
42
|
-
operatorId = _useSetState2[0],
|
|
43
|
-
setOperatorId = _useSetState2[1];
|
|
44
|
-
var _useState = useState(null),
|
|
45
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
46
|
-
langList = _useState2[0],
|
|
47
|
-
setLangList = _useState2[1];
|
|
48
|
-
var _useState3 = useState(function () {
|
|
49
|
-
return getLocale();
|
|
50
|
-
}),
|
|
51
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
52
|
-
locale = _useState4[0],
|
|
53
|
-
setLocale = _useState4[1];
|
|
54
|
-
var _useState5 = useState(function () {
|
|
55
|
-
return getIntl(locale, true);
|
|
56
|
-
}),
|
|
57
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
58
|
-
intl = _useState6[0],
|
|
59
|
-
setContainerIntl = _useState6[1];
|
|
60
|
-
var _useState7 = useState('pc'),
|
|
61
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
62
|
-
activedTarget = _useState8[0],
|
|
63
|
-
setActivedTarget = _useState8[1];
|
|
12
|
+
var hoverCellRef = useRef(null);
|
|
13
|
+
var activeCellRef = useRef(null);
|
|
64
14
|
useEventListener('mousemove', function (event) {
|
|
65
15
|
var elem = event.target;
|
|
66
16
|
var targetCell = elem.closest(".".concat(CELL_CLASS_NAME));
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
detector: targetCellId
|
|
71
|
-
});
|
|
17
|
+
if (targetCell && !targetCell.isEqualNode(hoverCellRef.current) && !targetCell.isEqualNode(activeCellRef.current)) {
|
|
18
|
+
var _id = targetCell.id;
|
|
19
|
+
hoverCellRef.current = targetCell;
|
|
72
20
|
context.$publisher(context.topics.COMPONENT_HOVER, {
|
|
73
|
-
id:
|
|
74
|
-
|
|
75
|
-
} else if (!targetCell || targetCellId === operatorId.selector) {
|
|
76
|
-
setOperatorId({
|
|
77
|
-
detector: null
|
|
21
|
+
id: _id,
|
|
22
|
+
cellNode: targetCell
|
|
78
23
|
});
|
|
24
|
+
} else if (!targetCell || targetCell.isEqualNode(activeCellRef.current)) {
|
|
25
|
+
hoverCellRef.current = null;
|
|
79
26
|
context.$publisher(context.topics.COMPONENT_HOVER, null);
|
|
80
27
|
}
|
|
81
28
|
}, {
|
|
82
29
|
target: simulatorRef
|
|
83
30
|
});
|
|
84
31
|
useEventListener('mouseleave', function () {
|
|
85
|
-
if (
|
|
86
|
-
|
|
87
|
-
detector: null
|
|
88
|
-
});
|
|
32
|
+
if (hoverCellRef.current) {
|
|
33
|
+
hoverCellRef.current = null;
|
|
89
34
|
context.$publisher(context.topics.COMPONENT_HOVER, null);
|
|
90
35
|
}
|
|
91
36
|
}, {
|
|
@@ -94,236 +39,59 @@ var Design = function Design() {
|
|
|
94
39
|
useEventListener('click', function (event) {
|
|
95
40
|
var elem = event.target;
|
|
96
41
|
var targetCell = elem.closest(".".concat(CELL_CLASS_NAME));
|
|
97
|
-
|
|
98
|
-
|
|
42
|
+
if (!targetCell || targetCell.isEqualNode(activeCellRef.current)) return;
|
|
43
|
+
activeCellRef.current = targetCell;
|
|
44
|
+
hoverCellRef.current = null;
|
|
99
45
|
context.$publisher(context.topics.COMPONENT_HOVER, null);
|
|
100
46
|
context.$publisher(context.topics.COMPONENT_ACTIVE, {
|
|
101
|
-
id:
|
|
47
|
+
id: activeCellRef.current.id,
|
|
48
|
+
cellNode: activeCellRef.current
|
|
102
49
|
});
|
|
103
50
|
}, {
|
|
104
51
|
target: simulatorRef
|
|
105
52
|
});
|
|
106
53
|
useEffect(function () {
|
|
54
|
+
var setRect = function setRect(node, cellNode) {
|
|
55
|
+
node.style.left = "".concat(cellNode.offsetLeft, "px");
|
|
56
|
+
node.style.top = "".concat(cellNode.offsetTop, "px");
|
|
57
|
+
node.style.width = "".concat(cellNode.offsetWidth, "px");
|
|
58
|
+
node.style.height = "".concat(cellNode.offsetHeight, "px");
|
|
59
|
+
};
|
|
107
60
|
var hcid = context.$subscriber(context.topics.COMPONENT_HOVER).on(function (payload) {
|
|
108
|
-
if (payload.id)
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
61
|
+
if (payload.id) {
|
|
62
|
+
detectorRef.current.style.display = 'block';
|
|
63
|
+
setRect(detectorRef.current, payload.cellNode);
|
|
64
|
+
} else {
|
|
65
|
+
detectorRef.current.style.display = 'none';
|
|
66
|
+
}
|
|
113
67
|
}).watch();
|
|
114
68
|
var acid = context.$subscriber(context.topics.COMPONENT_ACTIVE).on(function (payload) {
|
|
115
69
|
if (payload.id) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
detector: null
|
|
119
|
-
});
|
|
70
|
+
selectorRef.current.style.display = 'block';
|
|
71
|
+
setRect(selectorRef.current, payload.cellNode);
|
|
120
72
|
} else {
|
|
121
|
-
|
|
122
|
-
selector: null
|
|
123
|
-
});
|
|
73
|
+
selectorRef.current.style.display = 'none';
|
|
124
74
|
}
|
|
125
75
|
}).watch();
|
|
126
76
|
return function () {
|
|
127
77
|
context.$unsubscriber(context.topics.COMPONENT_HOVER, hcid);
|
|
128
78
|
context.$unsubscriber(context.topics.COMPONENT_ACTIVE, acid);
|
|
129
79
|
};
|
|
130
|
-
}, [context.pageData]);
|
|
131
|
-
useEffect(function () {
|
|
132
|
-
var moid = context.$subscriber(context.topics.MODAL_OPEN).on(function () {
|
|
133
|
-
simulatorRef.current.style.setProperty('overflow', 'hidden');
|
|
134
|
-
}).watch();
|
|
135
|
-
var mcid = context.$subscriber(context.topics.MODAL_CLOSE).on(function () {
|
|
136
|
-
simulatorRef.current.style.removeProperty('overflow');
|
|
137
|
-
}).watch();
|
|
138
|
-
var laid = context.$subscriber(context.topics.LANG_SETTING_SELECT).on(function (_ref) {
|
|
139
|
-
var _langList = _ref.langList;
|
|
140
|
-
return setLangList(_langList);
|
|
141
|
-
}).watch();
|
|
142
|
-
return function () {
|
|
143
|
-
context.$unsubscriber(context.topics.MODAL_OPEN, moid);
|
|
144
|
-
context.$unsubscriber(context.topics.MODAL_CLOSE, mcid);
|
|
145
|
-
context.$unsubscriber(context.topics.LANG_SETTING_SELECT, laid);
|
|
146
|
-
};
|
|
147
80
|
}, []);
|
|
148
|
-
useEffect(function () {
|
|
149
|
-
var csid = context.$subscriber(context.topics.COMPONENT_SETTING_CLICK).on(function (_ref2) {
|
|
150
|
-
var data = _ref2.data;
|
|
151
|
-
if (!operatorId.selector) {
|
|
152
|
-
message.info('请在右侧画布选择节点');
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
if (context.componentMap.get(operatorId.selector).dom.getAttribute('name') !== 'box') {
|
|
156
|
-
message.info('该节点不支持添加子节点');
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
var json = require("../engine/meta/".concat(data.component.toLowerCase(), ".props.default.json"));
|
|
160
|
-
var _id = "".concat(data.component.toLowerCase(), "_").concat(suid());
|
|
161
|
-
var cloneData = cloneDeep(context.pageData);
|
|
162
|
-
add(cloneData, operatorId.selector, _id, json);
|
|
163
|
-
context._setPageData(cloneData).then(function (newData) {
|
|
164
|
-
context.$publisher(context.topics.COMPONENT_APPEND, {
|
|
165
|
-
id: _id,
|
|
166
|
-
pageData: newData
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
}).watch();
|
|
170
|
-
return function () {
|
|
171
|
-
return context.$unsubscriber(context.topics.COMPONENT_SETTING_CLICK, csid);
|
|
172
|
-
};
|
|
173
|
-
}, [context.pageData]);
|
|
174
|
-
var getDomById = useMemoizedFn(function (id) {
|
|
175
|
-
return context.componentMap.get(id).dom;
|
|
176
|
-
});
|
|
177
|
-
var handleLangChange = useMemoizedFn(function (locale) {
|
|
178
|
-
if (moment !== null && moment !== void 0 && moment.locale) {
|
|
179
|
-
var _localeInfo$locale;
|
|
180
|
-
moment.locale(((_localeInfo$locale = localeInfo[locale]) === null || _localeInfo$locale === void 0 ? void 0 : _localeInfo$locale.momentLocale) || 'en');
|
|
181
|
-
}
|
|
182
|
-
setLocale(locale);
|
|
183
|
-
setContainerIntl(getIntl(locale));
|
|
184
|
-
});
|
|
185
|
-
var acticeProps = useCreation(function () {
|
|
186
|
-
if (operatorId.selector) {
|
|
187
|
-
var levelNodes = context.componentMap.get(operatorId.selector).api.getLevelNodes();
|
|
188
|
-
return {
|
|
189
|
-
props: last(levelNodes),
|
|
190
|
-
menu: /*#__PURE__*/React.createElement("div", {
|
|
191
|
-
className: styles['next-overlay-wrapper'],
|
|
192
|
-
onMouseLeave: function onMouseLeave() {
|
|
193
|
-
return handleHover();
|
|
194
|
-
}
|
|
195
|
-
}, reverse(initial(levelNodes)).map(function (m) {
|
|
196
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
197
|
-
key: m.id
|
|
198
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
199
|
-
onClick: function onClick() {
|
|
200
|
-
return handleSelect(m.id);
|
|
201
|
-
},
|
|
202
|
-
onMouseOver: function onMouseOver() {
|
|
203
|
-
return handleHover(m.id);
|
|
204
|
-
}
|
|
205
|
-
}, m.name));
|
|
206
|
-
}))
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
return null;
|
|
210
|
-
}, [operatorId.selector]);
|
|
211
|
-
var handleSelect = useMemoizedFn(function (_key) {
|
|
212
|
-
context.$publisher(context.topics.COMPONENT_ACTIVE, _key ? {
|
|
213
|
-
id: _key
|
|
214
|
-
} : null);
|
|
215
|
-
});
|
|
216
|
-
var handleHover = useMemoizedFn(function (_key) {
|
|
217
|
-
context.$publisher(context.topics.COMPONENT_HOVER, _key ? {
|
|
218
|
-
id: _key
|
|
219
|
-
} : null);
|
|
220
|
-
});
|
|
221
|
-
var handleDelete = useMemoizedFn(function (_key) {
|
|
222
|
-
context.$publisher(context.topics.COMPONENT_DELETE, _key ? {
|
|
223
|
-
id: _key
|
|
224
|
-
} : null);
|
|
225
|
-
});
|
|
226
81
|
return /*#__PURE__*/React.createElement("div", {
|
|
227
82
|
className: styles['lc-painter-design']
|
|
228
83
|
}, /*#__PURE__*/React.createElement("div", {
|
|
229
|
-
className: styles['lc-painter-design-toolbar']
|
|
230
|
-
}, /*#__PURE__*/React.createElement(Select, {
|
|
231
|
-
size: "small",
|
|
232
|
-
value: langList ? locale : undefined,
|
|
233
|
-
className: styles['i18n-selecter'],
|
|
234
|
-
style: {
|
|
235
|
-
fontSize: 12
|
|
236
|
-
},
|
|
237
|
-
onSelect: handleLangChange
|
|
238
|
-
}, langList === null || langList === void 0 ? void 0 : langList.map(function (item) {
|
|
239
|
-
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
240
|
-
key: item.field,
|
|
241
|
-
value: item.field
|
|
242
|
-
}, item.title);
|
|
243
|
-
})), /*#__PURE__*/React.createElement("span", {
|
|
244
|
-
className: classNames(styles['toolbar-item'], _defineProperty({}, styles.actived, activedTarget === 'pc')),
|
|
245
|
-
onClick: function onClick() {
|
|
246
|
-
return setActivedTarget('pc');
|
|
247
|
-
}
|
|
248
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
249
|
-
type: "laptop"
|
|
250
|
-
})), /*#__PURE__*/React.createElement("span", {
|
|
251
|
-
className: classNames(styles['toolbar-item'], _defineProperty({}, styles.actived, activedTarget === 'mobile')),
|
|
252
|
-
onClick: function onClick() {
|
|
253
|
-
return setActivedTarget('mobile');
|
|
254
|
-
}
|
|
255
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
256
|
-
type: "mobile"
|
|
257
|
-
})), /*#__PURE__*/React.createElement(Divider, {
|
|
258
|
-
type: "vertical"
|
|
259
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
260
|
-
style: {
|
|
261
|
-
width: 'auto',
|
|
262
|
-
fontSize: 12
|
|
263
|
-
},
|
|
264
|
-
className: styles['toolbar-item'],
|
|
265
|
-
onClick: function onClick() {
|
|
266
|
-
context.$publisher(context.topics.COMPONENT_ACTIVE, {
|
|
267
|
-
id: CELL_KEY.PAGE_ROOT
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
}, "\u9875\u9762\u5C5E\u6027"), /*#__PURE__*/React.createElement(Divider, {
|
|
271
|
-
type: "vertical"
|
|
272
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
273
|
-
size: "small",
|
|
274
|
-
style: {
|
|
275
|
-
fontSize: 12,
|
|
276
|
-
margin: '0 2px'
|
|
277
|
-
}
|
|
278
|
-
}, "\u9884\u89C8"), /*#__PURE__*/React.createElement(Divider, {
|
|
279
|
-
type: "vertical"
|
|
280
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
281
|
-
size: "small",
|
|
282
|
-
type: "primary",
|
|
283
|
-
style: {
|
|
284
|
-
fontSize: 12,
|
|
285
|
-
margin: '0 0 0 2px'
|
|
286
|
-
}
|
|
287
|
-
}, "\u4FDD\u5B58")), /*#__PURE__*/React.createElement("div", {
|
|
288
|
-
className: styles['lc-painter-design-workspace']
|
|
289
|
-
}, operatorId.detector && /*#__PURE__*/React.createElement("div", {
|
|
290
84
|
id: "lc-detector",
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
}),
|
|
85
|
+
ref: detectorRef,
|
|
86
|
+
className: styles.detector
|
|
87
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
294
88
|
id: "lc-selector",
|
|
295
89
|
ref: selectorRef,
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
style: getOperatorStyle(simulatorRef.current, getDomById(operatorId.selector))
|
|
299
|
-
}, acticeProps && /*#__PURE__*/React.createElement("div", {
|
|
300
|
-
className: styles['lc-borders-actions'],
|
|
301
|
-
style: acticeProps.props.id === CELL_KEY.PAGE_ROOT ? {
|
|
302
|
-
top: 0
|
|
303
|
-
} : ((_selectorRef$current = selectorRef.current) === null || _selectorRef$current === void 0 ? void 0 : _selectorRef$current.offsetTop) < 23 ? {
|
|
304
|
-
bottom: '-23px'
|
|
305
|
-
} : {
|
|
306
|
-
top: '-23px'
|
|
307
|
-
}
|
|
308
|
-
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
309
|
-
overlay: acticeProps.menu,
|
|
310
|
-
placement: "bottomLeft"
|
|
311
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
312
|
-
className: "instance-node-selector"
|
|
313
|
-
}, acticeProps.props.name)), /*#__PURE__*/React.createElement("div", {
|
|
314
|
-
onClick: function onClick() {
|
|
315
|
-
return handleDelete(acticeProps.props);
|
|
316
|
-
}
|
|
317
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
318
|
-
type: "delete"
|
|
319
|
-
})))), /*#__PURE__*/React.createElement(ConfigProvider, {
|
|
320
|
-
locale: ((_localeInfo$locale2 = localeInfo[locale]) === null || _localeInfo$locale2 === void 0 ? void 0 : _localeInfo$locale2.antd) || {}
|
|
321
|
-
}, /*#__PURE__*/React.createElement(RawIntlProvider, {
|
|
322
|
-
value: intl
|
|
323
|
-
}, /*#__PURE__*/React.createElement(Page, {
|
|
90
|
+
className: styles.selector
|
|
91
|
+
}), /*#__PURE__*/React.createElement(Page, {
|
|
324
92
|
ref: simulatorRef,
|
|
325
93
|
pageCode: "mk2i87qb",
|
|
326
|
-
className: styles
|
|
327
|
-
}))
|
|
94
|
+
className: styles.simulator
|
|
95
|
+
}));
|
|
328
96
|
};
|
|
329
97
|
export default Design;
|
|
@@ -1,205 +1,5 @@
|
|
|
1
|
-
import
|
|
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
|
-
};
|
|
1
|
+
import React from 'react';
|
|
28
2
|
var I18n = function I18n() {
|
|
29
|
-
|
|
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
|
-
}));
|
|
3
|
+
return /*#__PURE__*/React.createElement("div", null, "i18n");
|
|
204
4
|
};
|
|
205
5
|
export default I18n;
|