@luck-design-biz/luckda 0.0.24-1 → 0.0.25
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 +6 -4
- package/es/components/LDActions/index.js +130 -0
- package/es/components/LDActions/index.less +48 -0
- package/es/components/LdAutoForm/index.js +0 -0
- package/es/components/LdCard/index.js +0 -0
- package/es/components/LdCard/model.js +0 -0
- package/es/components/LdCom/index.js +0 -0
- package/es/components/LdFormList/index.js +1 -1
- package/es/components/LdFormList/model.js +0 -0
- package/es/components/LdGrid/index.js +21 -6
- package/es/components/LdGrid/model.js +0 -0
- package/es/components/LdGridForm/index.js +0 -0
- package/es/components/LdGridForm/index.less +0 -0
- package/es/components/LdInfoPanel/index.js +0 -0
- package/es/components/LdPop/index.js +0 -0
- package/es/components/LdRuntimeCom/index.js +0 -0
- package/es/components/LdTree/index.js +32 -5
- package/es/components/LdTree/index.less +6 -1
- package/es/helper/FromItems.js +0 -0
- package/es/helper/action.js +0 -0
- package/es/helper/form.js +0 -0
- package/es/helper/index.less +0 -0
- package/es/helper/ldBuilder.js +0 -0
- package/es/helper/ldComBuild.js +0 -0
- package/es/index.js +1 -0
- package/es/locales/zh-CN.js +151 -0
- package/es/lowcode/constants/api-url.js +350 -1
- package/es/lowcode/constants/event-topics.js +4 -4
- package/es/lowcode/constants/index.js +3 -1
- package/es/lowcode/engine/factory/DataFactory.js +0 -0
- package/es/lowcode/engine/factory/panel-item-factory/CheckboxStrategy.js +32 -0
- package/es/lowcode/engine/factory/panel-item-factory/DynamicStrategy.js +0 -0
- package/es/lowcode/engine/factory/panel-item-factory/GroupStrategy.js +0 -0
- package/es/lowcode/engine/factory/panel-item-factory/NumberStrategy.js +32 -0
- package/es/lowcode/engine/factory/panel-item-factory/SegmentedStrategy.js +0 -0
- package/es/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +4 -1
- package/es/lowcode/engine/factory/panel-item-factory/Strategy.js +0 -0
- package/es/lowcode/engine/factory/panel-item-factory/StringStrategy.js +12 -11
- package/es/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +11 -1
- package/es/lowcode/engine/factory/panel-item-factory/index.js +4 -0
- package/es/lowcode/engine/meta/box.props.default.json +1 -3
- package/es/lowcode/engine/meta/box.props.json +1 -3
- package/es/lowcode/engine/meta/button.props.default.json +1 -1
- package/es/lowcode/engine/meta/button.props.json +8 -3
- package/es/lowcode/engine/meta/cardlist.props.default.json +0 -1
- package/es/lowcode/engine/meta/cardlist.props.json +1 -2
- package/es/lowcode/engine/meta/components-list.json +6 -6
- package/es/lowcode/engine/meta/dialog.props.default.json +0 -1
- package/es/lowcode/engine/meta/dialog.props.json +0 -1
- package/es/lowcode/engine/meta/drawer.props.default.json +0 -1
- package/es/lowcode/engine/meta/drawer.props.json +0 -1
- package/es/lowcode/engine/meta/form.props.default.json +0 -1
- package/es/lowcode/engine/meta/form.props.json +1 -2
- package/es/lowcode/engine/meta/iframe.props.default.json +1 -1
- package/es/lowcode/engine/meta/iframe.props.json +1 -1
- package/es/lowcode/engine/meta/image.props.default.json +1 -1
- package/es/lowcode/engine/meta/image.props.json +1 -1
- package/es/lowcode/engine/meta/imex.props.default.json +1 -1
- package/es/lowcode/engine/meta/imex.props.json +1 -1
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +135 -29
- package/es/lowcode/engine/meta/jsx.props.default.json +1 -1
- package/es/lowcode/engine/meta/jsx.props.json +1 -1
- package/es/lowcode/engine/meta/layout.props.default.json +1 -1
- package/es/lowcode/engine/meta/layout.props.json +1 -1
- package/es/lowcode/engine/meta/link.props.default.json +1 -1
- package/es/lowcode/engine/meta/link.props.json +1 -1
- package/es/lowcode/engine/meta/local/local.zh-cn.js +97 -0
- package/es/lowcode/engine/meta/section.props.default.json +1 -1
- package/es/lowcode/engine/meta/section.props.json +1 -1
- package/es/lowcode/engine/meta/split.props.default.json +1 -1
- package/es/lowcode/engine/meta/split.props.json +1 -1
- package/es/lowcode/engine/meta/table.props.default.json +36 -2
- package/es/lowcode/engine/meta/table.props.json +295 -58
- package/es/lowcode/engine/meta/tabs.props.default.json +0 -1
- package/es/lowcode/engine/meta/tabs.props.json +0 -1
- package/es/lowcode/engine/meta/text.props.default.json +1 -1
- package/es/lowcode/engine/meta/text.props.json +1 -1
- package/es/lowcode/engine/meta/tree.props.default.json +9 -4
- package/es/lowcode/engine/meta/tree.props.json +101 -55
- package/es/lowcode/engine/provider/ContextProvider/index.js +199 -0
- package/es/lowcode/engine/provider/EventBusProvider.js +0 -0
- package/es/lowcode/engine/tools/dataProcess.js +5 -3
- package/es/lowcode/engine/tools/helper.js +96 -0
- package/es/lowcode/engine/tools/usePromiseState.js +7 -6
- package/es/lowcode/index.js +3 -1
- package/es/lowcode/painter/Components.js +0 -0
- package/es/lowcode/painter/Design.js +27 -304
- package/es/lowcode/painter/DesignOperator.js +271 -0
- package/es/lowcode/painter/DesignToolbar.js +91 -0
- package/es/lowcode/painter/I18n.js +0 -0
- package/es/lowcode/painter/Outline.js +31 -27
- package/es/lowcode/painter/Panel.js +52 -97
- package/es/lowcode/painter/Ribbon.js +1 -1
- package/es/lowcode/painter/components/ActionBindModal.js +180 -0
- package/es/lowcode/painter/components/AdvancePanel.js +68 -0
- package/es/lowcode/painter/components/AttrsPanel.js +134 -0
- package/es/lowcode/painter/components/Collapse.js +74 -10
- package/es/lowcode/painter/components/ColorInput.js +125 -0
- package/es/lowcode/painter/components/FieldSelector.js +44 -0
- package/es/lowcode/painter/components/{TabEditor.js → ListEditor.js} +20 -17
- package/es/lowcode/painter/components/NumberInput.js +72 -17
- package/es/lowcode/painter/components/PanelItem.js +40 -11
- package/es/lowcode/painter/components/PopConfirm.js +14 -4
- package/es/lowcode/painter/components/PopForm.js +0 -0
- package/es/lowcode/painter/components/RuleInput.js +5 -3
- package/es/lowcode/painter/components/SortBox.js +0 -0
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +56 -66
- package/es/lowcode/painter/components/code-editor/CssEditor.js +27 -0
- package/es/lowcode/painter/components/code-editor/FullScreenEditor.js +37 -14
- package/es/lowcode/painter/components/code-editor/JSEditor.js +44 -11
- package/es/lowcode/painter/components/code-editor/JsonEditor.js +41 -0
- package/es/lowcode/painter/components/code-editor/index.js +0 -0
- package/es/lowcode/painter/index.js +6 -2
- package/es/lowcode/painter/panel-section/ActionsEditor/ActionEditor.js +154 -0
- package/es/lowcode/painter/panel-section/ActionsEditor/index.js +198 -0
- package/es/lowcode/painter/panel-section/ButtonType.js +0 -0
- package/es/lowcode/painter/panel-section/DataSetSelector.js +61 -0
- package/es/lowcode/painter/panel-section/Icon.js +0 -0
- package/es/lowcode/painter/panel-section/IconSelector.js +0 -0
- package/es/lowcode/painter/panel-section/ImpExp.js +91 -0
- package/es/lowcode/painter/panel-section/JSEditor.js +48 -0
- package/es/lowcode/painter/panel-section/LayoutRatio.js +2 -1
- package/es/lowcode/painter/panel-section/StylePanel/BackGround.js +61 -0
- package/es/lowcode/painter/panel-section/StylePanel/Border.js +150 -0
- package/es/lowcode/painter/panel-section/StylePanel/BorderRadius.js +87 -0
- package/es/lowcode/painter/panel-section/StylePanel/BorderRadiusSelector.js +66 -0
- package/es/lowcode/painter/panel-section/StylePanel/BorderSelector.js +66 -0
- package/es/lowcode/painter/panel-section/StylePanel/Display.js +15 -11
- package/es/lowcode/painter/panel-section/StylePanel/DisplaySvg.js +0 -0
- package/es/lowcode/painter/panel-section/StylePanel/Font.js +162 -0
- package/es/lowcode/painter/panel-section/StylePanel/FontEditor.js +386 -0
- package/es/lowcode/painter/panel-section/StylePanel/GapSelector.js +78 -0
- package/es/lowcode/painter/panel-section/StylePanel/HighLightPanel.js +23 -0
- package/es/lowcode/painter/panel-section/StylePanel/HighLigthtSpan.js +20 -0
- package/es/lowcode/painter/panel-section/StylePanel/HightLightSvg.js +23 -0
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +44 -12
- package/es/lowcode/painter/panel-section/StylePanel/Margin.js +60 -0
- package/es/lowcode/painter/panel-section/StylePanel/Opacity.js +50 -0
- package/es/lowcode/painter/panel-section/StylePanel/Padding.js +61 -0
- package/es/lowcode/painter/panel-section/StylePanel/Pointer.js +41 -0
- package/es/lowcode/painter/panel-section/StylePanel/Shadow.js +216 -0
- package/es/lowcode/painter/panel-section/StylePanel/Size.js +53 -0
- package/es/lowcode/painter/panel-section/StylePanel/StyleContext.js +56 -9
- package/es/lowcode/painter/panel-section/StylePanel/StyleRow.js +16 -0
- package/es/lowcode/painter/panel-section/StylePanel/{Height.js → WidthHeight.js} +23 -20
- package/es/lowcode/painter/panel-section/StylePanel/index.js +17 -0
- package/es/lowcode/painter/panel-section/TabItems.js +7 -37
- package/es/lowcode/painter/panel-section/TableTopFilter.js +306 -0
- package/es/lowcode/painter/panel-section/TableZebra.js +14 -0
- package/es/lowcode/painter/panel-section/WidthHeight.js +39 -0
- package/es/lowcode/painter/services/I18n.js +0 -0
- package/es/lowcode/painter/style/action-bind-modal.less +99 -0
- package/es/lowcode/painter/style/actions-editor.less +16 -0
- package/es/lowcode/painter/style/border-editor.less +36 -0
- package/es/lowcode/painter/style/border-radius-selector.less +43 -0
- package/es/lowcode/painter/style/border-selector.less +40 -0
- package/es/lowcode/painter/style/button-type.less +0 -0
- package/es/lowcode/painter/style/collapse.less +2 -1
- package/es/lowcode/painter/style/color-input.less +19 -0
- package/es/lowcode/painter/style/components.less +0 -0
- package/es/lowcode/painter/style/design.less +8 -1
- package/es/lowcode/painter/style/display.less +0 -0
- package/es/lowcode/painter/style/font-editor.less +9 -0
- package/es/lowcode/painter/style/fullscreen-editor.less +0 -0
- package/es/lowcode/painter/style/icon-selector.less +0 -0
- package/es/lowcode/painter/style/icon.less +0 -0
- package/es/lowcode/painter/style/impexp.less +7 -0
- package/es/lowcode/painter/style/index.less +0 -0
- package/es/lowcode/painter/style/layout-ratio.less +0 -0
- package/es/lowcode/painter/style/{tabeditor.less → list-editor.less} +9 -40
- package/es/lowcode/painter/style/number-input.less +0 -0
- package/es/lowcode/painter/style/outline.less +0 -0
- package/es/lowcode/painter/style/panel-attrs.less +43 -0
- package/es/lowcode/painter/style/panel-item.less +11 -1
- package/es/lowcode/painter/style/panel.less +5 -49
- package/es/lowcode/painter/style/pop-confirm.less +9 -2
- package/es/lowcode/painter/style/pop-form.less +0 -0
- package/es/lowcode/painter/style/radio.less +0 -0
- package/es/lowcode/painter/style/ribbon.less +0 -0
- package/es/lowcode/painter/style/rule-input.less +0 -0
- package/es/lowcode/painter/style/style-panel.less +32 -0
- package/es/lowcode/painter/style/tabitems.less +0 -0
- package/es/lowcode/view/Canvas.js +16 -15
- package/es/lowcode/view/Loading.js +0 -0
- package/es/lowcode/view/Page.js +10 -225
- package/es/lowcode/view/index.js +5 -6
- package/es/lowcode/view/lc-components/Box/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/Box/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Box/index.js +22 -6
- package/es/lowcode/view/lc-components/Box/index.less +0 -1
- package/es/lowcode/view/lc-components/Box/meta.json +1 -3
- package/es/lowcode/view/lc-components/Button/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/Button/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Button/index.js +10 -7
- package/es/lowcode/view/lc-components/Button/meta.json +8 -3
- package/es/lowcode/view/lc-components/Button/style.less +3 -0
- package/es/lowcode/view/lc-components/CardList/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/CardList/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/CardList/index.js +0 -0
- package/es/lowcode/view/lc-components/CardList/meta.json +1 -2
- package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +48 -3
- package/es/lowcode/view/lc-components/Dialog/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Dialog/index.js +21 -23
- package/es/lowcode/view/lc-components/Dialog/index.less +1 -1
- package/es/lowcode/view/lc-components/Dialog/meta.json +0 -1
- package/es/lowcode/view/lc-components/Drawer/FunctionDesign.js +13 -2
- package/es/lowcode/view/lc-components/Drawer/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Drawer/index.js +35 -22
- package/es/lowcode/view/lc-components/Drawer/{style.less → index.less} +1 -1
- package/es/lowcode/view/lc-components/Drawer/meta.json +0 -1
- package/es/lowcode/view/lc-components/Form/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/Form/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Form/index.js +0 -0
- package/es/lowcode/view/lc-components/Form/meta.json +1 -2
- package/es/lowcode/view/lc-components/Iframe/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/Iframe/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Iframe/index.js +0 -0
- package/es/lowcode/view/lc-components/Iframe/meta.json +1 -1
- package/es/lowcode/view/lc-components/ImEx/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/ImEx/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/ImEx/index.js +0 -0
- package/es/lowcode/view/lc-components/ImEx/meta.json +1 -1
- package/es/lowcode/view/lc-components/Image/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/Image/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Image/index.js +0 -0
- package/es/lowcode/view/lc-components/Image/meta.json +1 -1
- package/es/lowcode/view/lc-components/JSX/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/JSX/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/JSX/index.js +0 -0
- package/es/lowcode/view/lc-components/JSX/meta.json +1 -1
- package/es/lowcode/view/lc-components/Layout/FunctionDesign.js +6 -9
- package/es/lowcode/view/lc-components/Layout/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Layout/index.js +0 -0
- package/es/lowcode/view/lc-components/Layout/index.less +0 -0
- package/es/lowcode/view/lc-components/Layout/meta.json +1 -1
- package/es/lowcode/view/lc-components/Link/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/Link/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Link/index.js +0 -0
- package/es/lowcode/view/lc-components/Link/meta.json +1 -1
- package/es/lowcode/view/lc-components/Section/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/Section/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Section/index.js +0 -0
- package/es/lowcode/view/lc-components/Section/meta.json +1 -1
- package/es/lowcode/view/lc-components/Split/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/Split/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Split/index.js +0 -0
- package/es/lowcode/view/lc-components/Split/meta.json +1 -1
- package/es/lowcode/view/lc-components/Table/FunctionDesign.js +37 -2
- package/es/lowcode/view/lc-components/Table/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Table/components/TopFilter.js +96 -0
- package/es/lowcode/view/lc-components/Table/index.js +418 -108
- package/es/lowcode/view/lc-components/Table/meta.json +256 -58
- package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/Tabs/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Tabs/index.js +0 -0
- package/es/lowcode/view/lc-components/Tabs/meta.json +0 -1
- package/es/lowcode/view/lc-components/Text/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/Text/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Text/index.js +0 -0
- package/es/lowcode/view/lc-components/Text/meta.json +1 -1
- package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +48 -3
- package/es/lowcode/view/lc-components/Tree/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Tree/index.js +77 -6
- package/es/lowcode/view/lc-components/Tree/index.less +2 -0
- package/es/lowcode/view/lc-components/Tree/meta.json +97 -55
- package/es/lowcode/view/lc-components/Wrapper.js +2 -2
- package/es/lowcode/view/style/canvas.less +0 -0
- package/es/lowcode/view/style/loading.less +0 -0
- package/es/lowcode/view/style/page.less +0 -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 +0 -0
- package/es/upload/FormItem/index.js +0 -0
- package/es/upload/GridCell/index.js +0 -0
- package/es/upload/index.js +0 -0
- package/es/utils/action.js +0 -0
- package/es/utils/form.js +0 -0
- package/es/utils/grid.js +0 -0
- package/es/utils/index.js +0 -0
- package/lib/components/Builder/index.js +5 -3
- package/lib/components/LDActions/index.js +138 -0
- package/lib/components/LDActions/index.less +48 -0
- package/lib/components/LdAutoForm/index.js +0 -0
- package/lib/components/LdCard/index.js +0 -0
- package/lib/components/LdCard/model.js +0 -0
- package/lib/components/LdCom/index.js +0 -0
- package/lib/components/LdFormList/index.js +1 -1
- package/lib/components/LdFormList/model.js +0 -0
- package/lib/components/LdGrid/index.js +20 -5
- package/lib/components/LdGrid/model.js +0 -0
- package/lib/components/LdGridForm/index.js +0 -0
- package/lib/components/LdGridForm/index.less +0 -0
- package/lib/components/LdInfoPanel/index.js +0 -0
- package/lib/components/LdPop/index.js +0 -0
- package/lib/components/LdRuntimeCom/index.js +0 -0
- package/lib/components/LdTree/index.js +31 -4
- package/lib/components/LdTree/index.less +6 -1
- package/lib/helper/FromItems.js +0 -0
- package/lib/helper/action.js +0 -0
- package/lib/helper/form.js +0 -0
- package/lib/helper/index.less +0 -0
- package/lib/helper/ldBuilder.js +0 -0
- package/lib/helper/ldComBuild.js +0 -0
- package/lib/index.js +8 -0
- package/lib/locales/zh-CN.js +157 -0
- package/lib/lowcode/constants/api-url.js +352 -2
- package/lib/lowcode/constants/event-topics.js +5 -5
- package/lib/lowcode/constants/index.js +4 -2
- package/lib/lowcode/engine/factory/DataFactory.js +0 -0
- package/lib/lowcode/engine/factory/panel-item-factory/CheckboxStrategy.js +38 -0
- package/lib/lowcode/engine/factory/panel-item-factory/DynamicStrategy.js +0 -0
- package/lib/lowcode/engine/factory/panel-item-factory/GroupStrategy.js +0 -0
- package/lib/lowcode/engine/factory/panel-item-factory/NumberStrategy.js +38 -0
- package/lib/lowcode/engine/factory/panel-item-factory/SegmentedStrategy.js +0 -0
- package/lib/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +4 -1
- package/lib/lowcode/engine/factory/panel-item-factory/Strategy.js +0 -0
- package/lib/lowcode/engine/factory/panel-item-factory/StringStrategy.js +11 -10
- package/lib/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +11 -1
- package/lib/lowcode/engine/factory/panel-item-factory/index.js +4 -0
- package/lib/lowcode/engine/meta/box.props.default.json +1 -3
- package/lib/lowcode/engine/meta/box.props.json +1 -3
- package/lib/lowcode/engine/meta/button.props.default.json +1 -1
- package/lib/lowcode/engine/meta/button.props.json +8 -3
- package/lib/lowcode/engine/meta/cardlist.props.default.json +0 -1
- package/lib/lowcode/engine/meta/cardlist.props.json +1 -2
- package/lib/lowcode/engine/meta/components-list.json +6 -6
- package/lib/lowcode/engine/meta/dialog.props.default.json +0 -1
- package/lib/lowcode/engine/meta/dialog.props.json +0 -1
- package/lib/lowcode/engine/meta/drawer.props.default.json +0 -1
- package/lib/lowcode/engine/meta/drawer.props.json +0 -1
- package/lib/lowcode/engine/meta/form.props.default.json +0 -1
- package/lib/lowcode/engine/meta/form.props.json +1 -2
- package/lib/lowcode/engine/meta/iframe.props.default.json +1 -1
- package/lib/lowcode/engine/meta/iframe.props.json +1 -1
- package/lib/lowcode/engine/meta/image.props.default.json +1 -1
- package/lib/lowcode/engine/meta/image.props.json +1 -1
- package/lib/lowcode/engine/meta/imex.props.default.json +1 -1
- package/lib/lowcode/engine/meta/imex.props.json +1 -1
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +135 -29
- package/lib/lowcode/engine/meta/jsx.props.default.json +1 -1
- package/lib/lowcode/engine/meta/jsx.props.json +1 -1
- package/lib/lowcode/engine/meta/layout.props.default.json +1 -1
- package/lib/lowcode/engine/meta/layout.props.json +1 -1
- package/lib/lowcode/engine/meta/link.props.default.json +1 -1
- package/lib/lowcode/engine/meta/link.props.json +1 -1
- package/lib/lowcode/engine/meta/local/local.zh-cn.js +103 -0
- package/lib/lowcode/engine/meta/section.props.default.json +1 -1
- package/lib/lowcode/engine/meta/section.props.json +1 -1
- package/lib/lowcode/engine/meta/split.props.default.json +1 -1
- package/lib/lowcode/engine/meta/split.props.json +1 -1
- package/lib/lowcode/engine/meta/table.props.default.json +36 -2
- package/lib/lowcode/engine/meta/table.props.json +295 -58
- package/lib/lowcode/engine/meta/tabs.props.default.json +0 -1
- package/lib/lowcode/engine/meta/tabs.props.json +0 -1
- package/lib/lowcode/engine/meta/text.props.default.json +1 -1
- package/lib/lowcode/engine/meta/text.props.json +1 -1
- package/lib/lowcode/engine/meta/tree.props.default.json +9 -4
- package/lib/lowcode/engine/meta/tree.props.json +101 -55
- package/lib/lowcode/engine/provider/ContextProvider/index.js +207 -0
- package/lib/lowcode/engine/provider/EventBusProvider.js +0 -0
- package/lib/lowcode/engine/tools/dataProcess.js +5 -3
- package/lib/lowcode/engine/tools/helper.js +101 -0
- package/lib/lowcode/engine/tools/usePromiseState.js +6 -5
- package/lib/lowcode/index.js +5 -1
- package/lib/lowcode/painter/Components.js +0 -0
- package/lib/lowcode/painter/Design.js +24 -300
- package/lib/lowcode/painter/DesignOperator.js +278 -0
- package/lib/lowcode/painter/DesignToolbar.js +99 -0
- package/lib/lowcode/painter/I18n.js +0 -0
- package/lib/lowcode/painter/Outline.js +31 -27
- package/lib/lowcode/painter/Panel.js +49 -94
- package/lib/lowcode/painter/Ribbon.js +1 -1
- package/lib/lowcode/painter/components/ActionBindModal.js +188 -0
- package/lib/lowcode/painter/components/AdvancePanel.js +76 -0
- package/lib/lowcode/painter/components/AttrsPanel.js +142 -0
- package/lib/lowcode/painter/components/Collapse.js +72 -9
- package/lib/lowcode/painter/components/ColorInput.js +132 -0
- package/lib/lowcode/painter/components/FieldSelector.js +52 -0
- package/lib/lowcode/painter/components/{TabEditor.js → ListEditor.js} +22 -19
- package/lib/lowcode/painter/components/NumberInput.js +70 -16
- package/lib/lowcode/painter/components/PanelItem.js +40 -11
- package/lib/lowcode/painter/components/PopConfirm.js +14 -4
- package/lib/lowcode/painter/components/PopForm.js +0 -0
- package/lib/lowcode/painter/components/RuleInput.js +5 -3
- package/lib/lowcode/painter/components/SortBox.js +0 -0
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +54 -65
- package/lib/lowcode/painter/components/code-editor/CssEditor.js +26 -0
- package/lib/lowcode/painter/components/code-editor/FullScreenEditor.js +35 -13
- package/lib/lowcode/painter/components/code-editor/JSEditor.js +44 -11
- package/lib/lowcode/painter/components/code-editor/JsonEditor.js +48 -0
- package/lib/lowcode/painter/components/code-editor/index.js +0 -0
- package/lib/lowcode/painter/index.js +6 -2
- package/lib/lowcode/painter/panel-section/ActionsEditor/ActionEditor.js +162 -0
- package/lib/lowcode/painter/panel-section/ActionsEditor/index.js +206 -0
- package/lib/lowcode/painter/panel-section/ButtonType.js +0 -0
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +69 -0
- package/lib/lowcode/painter/panel-section/Icon.js +0 -0
- package/lib/lowcode/painter/panel-section/IconSelector.js +0 -0
- package/lib/lowcode/painter/panel-section/ImpExp.js +98 -0
- package/lib/lowcode/painter/panel-section/JSEditor.js +56 -0
- package/lib/lowcode/painter/panel-section/LayoutRatio.js +2 -1
- package/lib/lowcode/painter/panel-section/StylePanel/BackGround.js +68 -0
- package/lib/lowcode/painter/panel-section/StylePanel/Border.js +158 -0
- package/lib/lowcode/painter/panel-section/StylePanel/BorderRadius.js +95 -0
- package/lib/lowcode/painter/panel-section/StylePanel/BorderRadiusSelector.js +73 -0
- package/lib/lowcode/painter/panel-section/StylePanel/BorderSelector.js +73 -0
- package/lib/lowcode/painter/panel-section/StylePanel/Display.js +15 -11
- package/lib/lowcode/painter/panel-section/StylePanel/DisplaySvg.js +0 -0
- package/lib/lowcode/painter/panel-section/StylePanel/Font.js +170 -0
- package/lib/lowcode/painter/panel-section/StylePanel/FontEditor.js +392 -0
- package/lib/lowcode/painter/panel-section/StylePanel/GapSelector.js +85 -0
- package/lib/lowcode/painter/panel-section/StylePanel/HighLightPanel.js +29 -0
- package/lib/lowcode/painter/panel-section/StylePanel/HighLigthtSpan.js +26 -0
- package/lib/lowcode/painter/panel-section/StylePanel/HightLightSvg.js +29 -0
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +42 -11
- package/lib/lowcode/painter/panel-section/StylePanel/Margin.js +67 -0
- package/lib/lowcode/painter/panel-section/StylePanel/Opacity.js +57 -0
- package/lib/lowcode/painter/panel-section/StylePanel/Padding.js +68 -0
- package/lib/lowcode/painter/panel-section/StylePanel/Pointer.js +48 -0
- package/lib/lowcode/painter/panel-section/StylePanel/Shadow.js +224 -0
- package/lib/lowcode/painter/panel-section/StylePanel/{Width.js → Size.js} +39 -35
- package/lib/lowcode/painter/panel-section/StylePanel/StyleContext.js +56 -9
- package/lib/lowcode/painter/panel-section/StylePanel/StyleRow.js +22 -0
- package/lib/lowcode/painter/panel-section/StylePanel/{Height.js → WidthHeight.js} +22 -19
- package/lib/lowcode/painter/panel-section/StylePanel/index.js +16 -0
- package/lib/lowcode/painter/panel-section/TabItems.js +7 -37
- package/lib/lowcode/painter/panel-section/TableTopFilter.js +314 -0
- package/lib/lowcode/painter/panel-section/TableZebra.js +21 -0
- package/lib/lowcode/painter/panel-section/WidthHeight.js +46 -0
- package/lib/lowcode/painter/services/I18n.js +0 -0
- package/lib/lowcode/painter/style/action-bind-modal.less +99 -0
- package/lib/lowcode/painter/style/actions-editor.less +16 -0
- package/lib/lowcode/painter/style/border-editor.less +36 -0
- package/lib/lowcode/painter/style/border-radius-selector.less +43 -0
- package/lib/lowcode/painter/style/border-selector.less +40 -0
- package/lib/lowcode/painter/style/button-type.less +0 -0
- package/lib/lowcode/painter/style/collapse.less +2 -1
- package/lib/lowcode/painter/style/color-input.less +19 -0
- package/lib/lowcode/painter/style/components.less +0 -0
- package/lib/lowcode/painter/style/design.less +8 -1
- package/lib/lowcode/painter/style/display.less +0 -0
- package/lib/lowcode/painter/style/font-editor.less +9 -0
- package/lib/lowcode/painter/style/fullscreen-editor.less +0 -0
- package/lib/lowcode/painter/style/icon-selector.less +0 -0
- package/lib/lowcode/painter/style/icon.less +0 -0
- package/lib/lowcode/painter/style/impexp.less +7 -0
- package/lib/lowcode/painter/style/index.less +0 -0
- package/lib/lowcode/painter/style/layout-ratio.less +0 -0
- package/lib/lowcode/painter/style/{tabeditor.less → list-editor.less} +9 -40
- package/lib/lowcode/painter/style/number-input.less +0 -0
- package/lib/lowcode/painter/style/outline.less +0 -0
- package/lib/lowcode/painter/style/panel-attrs.less +43 -0
- package/lib/lowcode/painter/style/panel-item.less +11 -1
- package/lib/lowcode/painter/style/panel.less +5 -49
- package/lib/lowcode/painter/style/pop-confirm.less +9 -2
- package/lib/lowcode/painter/style/pop-form.less +0 -0
- package/lib/lowcode/painter/style/radio.less +0 -0
- package/lib/lowcode/painter/style/ribbon.less +0 -0
- package/lib/lowcode/painter/style/rule-input.less +0 -0
- package/lib/lowcode/painter/style/style-panel.less +32 -0
- package/lib/lowcode/painter/style/tabitems.less +0 -0
- package/lib/lowcode/view/Canvas.js +16 -15
- package/lib/lowcode/view/Loading.js +0 -0
- package/lib/lowcode/view/Page.js +9 -224
- package/lib/lowcode/view/index.js +5 -6
- package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/Box/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Box/index.js +19 -4
- package/lib/lowcode/view/lc-components/Box/index.less +0 -1
- package/lib/lowcode/view/lc-components/Box/meta.json +1 -3
- package/lib/lowcode/view/lc-components/Button/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/Button/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Button/index.js +10 -7
- package/lib/lowcode/view/lc-components/Button/meta.json +8 -3
- package/lib/lowcode/view/lc-components/Button/style.less +3 -0
- package/lib/lowcode/view/lc-components/CardList/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/CardList/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/CardList/index.js +0 -0
- package/lib/lowcode/view/lc-components/CardList/meta.json +1 -2
- package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +49 -3
- package/lib/lowcode/view/lc-components/Dialog/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Dialog/index.js +20 -22
- package/lib/lowcode/view/lc-components/Dialog/index.less +1 -1
- package/lib/lowcode/view/lc-components/Dialog/meta.json +0 -1
- package/lib/lowcode/view/lc-components/Drawer/FunctionDesign.js +13 -2
- package/lib/lowcode/view/lc-components/Drawer/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Drawer/index.js +34 -21
- package/lib/lowcode/view/lc-components/Drawer/{style.less → index.less} +1 -1
- package/lib/lowcode/view/lc-components/Drawer/meta.json +0 -1
- package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/Form/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Form/index.js +0 -0
- package/lib/lowcode/view/lc-components/Form/meta.json +1 -2
- package/lib/lowcode/view/lc-components/Iframe/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/Iframe/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Iframe/index.js +0 -0
- package/lib/lowcode/view/lc-components/Iframe/meta.json +1 -1
- package/lib/lowcode/view/lc-components/ImEx/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/ImEx/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/ImEx/index.js +0 -0
- package/lib/lowcode/view/lc-components/ImEx/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Image/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/Image/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Image/index.js +0 -0
- package/lib/lowcode/view/lc-components/Image/meta.json +1 -1
- package/lib/lowcode/view/lc-components/JSX/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/JSX/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/JSX/index.js +0 -0
- package/lib/lowcode/view/lc-components/JSX/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Layout/FunctionDesign.js +6 -9
- package/lib/lowcode/view/lc-components/Layout/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Layout/index.js +0 -0
- package/lib/lowcode/view/lc-components/Layout/index.less +0 -0
- package/lib/lowcode/view/lc-components/Layout/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Link/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/Link/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Link/index.js +0 -0
- package/lib/lowcode/view/lc-components/Link/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Section/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/Section/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Section/index.js +0 -0
- package/lib/lowcode/view/lc-components/Section/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/Split/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Split/index.js +0 -0
- package/lib/lowcode/view/lc-components/Split/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Table/FunctionDesign.js +39 -3
- package/lib/lowcode/view/lc-components/Table/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Table/components/TopFilter.js +104 -0
- package/lib/lowcode/view/lc-components/Table/index.js +418 -108
- package/lib/lowcode/view/lc-components/Table/meta.json +256 -58
- package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/Tabs/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Tabs/index.js +0 -0
- package/lib/lowcode/view/lc-components/Tabs/meta.json +0 -1
- package/lib/lowcode/view/lc-components/Text/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/Text/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Text/index.js +0 -0
- package/lib/lowcode/view/lc-components/Text/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +49 -3
- package/lib/lowcode/view/lc-components/Tree/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Tree/index.js +77 -6
- package/lib/lowcode/view/lc-components/Tree/index.less +2 -0
- package/lib/lowcode/view/lc-components/Tree/meta.json +97 -55
- package/lib/lowcode/view/lc-components/Wrapper.js +2 -2
- package/lib/lowcode/view/style/canvas.less +0 -0
- package/lib/lowcode/view/style/loading.less +0 -0
- package/lib/lowcode/view/style/page.less +0 -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 +0 -0
- package/lib/upload/FormItem/index.js +0 -0
- package/lib/upload/GridCell/index.js +0 -0
- package/lib/upload/index.js +0 -0
- package/lib/utils/action.js +0 -0
- package/lib/utils/form.js +0 -0
- package/lib/utils/grid.js +0 -0
- package/lib/utils/index.js +0 -0
- package/lowcode.js +0 -0
- package/package.json +14 -7
- package/upload.js +0 -0
- package/utils.js +0 -0
- package/es/lowcode/engine/provider/ContextProvider.js +0 -157
- package/es/lowcode/painter/panel-section/StylePanel/Width.js +0 -48
- package/lib/lowcode/engine/provider/ContextProvider.js +0 -165
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import React, { useEffect, useState } from 'react';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { Select, Button, Icon, Divider } from 'luck-design/antd';
|
|
6
|
+
import { useLDContext } from "../engine/provider/ContextProvider";
|
|
7
|
+
import { CELL_KEY } from "../constants";
|
|
8
|
+
import styles from "./style/design.less";
|
|
9
|
+
var DesignToolbar = function DesignToolbar(_ref) {
|
|
10
|
+
var locale = _ref.locale,
|
|
11
|
+
onLangChange = _ref.onLangChange;
|
|
12
|
+
var context = useLDContext();
|
|
13
|
+
var _useState = useState(null),
|
|
14
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
15
|
+
langList = _useState2[0],
|
|
16
|
+
setLangList = _useState2[1];
|
|
17
|
+
var _useState3 = useState('pc'),
|
|
18
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
19
|
+
activedTarget = _useState4[0],
|
|
20
|
+
setActivedTarget = _useState4[1];
|
|
21
|
+
useEffect(function () {
|
|
22
|
+
var topicId = context.$subscriber(context.topics.LANG_SETTING_SELECT).on(function (_ref2) {
|
|
23
|
+
var _langList = _ref2.langList;
|
|
24
|
+
return setLangList(_langList);
|
|
25
|
+
}).watch();
|
|
26
|
+
return function () {
|
|
27
|
+
return context.$unsubscriber(context.topics.LANG_SETTING_SELECT, topicId);
|
|
28
|
+
};
|
|
29
|
+
}, []);
|
|
30
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: styles['lc-painter-design-toolbar']
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
33
|
+
size: "small",
|
|
34
|
+
value: langList ? locale : undefined,
|
|
35
|
+
className: styles['i18n-selecter'],
|
|
36
|
+
style: {
|
|
37
|
+
fontSize: 12
|
|
38
|
+
},
|
|
39
|
+
onSelect: onLangChange
|
|
40
|
+
}, langList === null || langList === void 0 ? void 0 : langList.map(function (item) {
|
|
41
|
+
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
42
|
+
key: item.field,
|
|
43
|
+
value: item.field
|
|
44
|
+
}, item.title);
|
|
45
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
46
|
+
className: classNames(styles['toolbar-item'], _defineProperty({}, styles.actived, activedTarget === 'pc')),
|
|
47
|
+
onClick: function onClick() {
|
|
48
|
+
return setActivedTarget('pc');
|
|
49
|
+
}
|
|
50
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
51
|
+
type: "laptop"
|
|
52
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
53
|
+
className: classNames(styles['toolbar-item'], _defineProperty({}, styles.actived, activedTarget === 'mobile')),
|
|
54
|
+
onClick: function onClick() {
|
|
55
|
+
return setActivedTarget('mobile');
|
|
56
|
+
}
|
|
57
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
58
|
+
type: "mobile"
|
|
59
|
+
})), /*#__PURE__*/React.createElement(Divider, {
|
|
60
|
+
type: "vertical"
|
|
61
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
62
|
+
style: {
|
|
63
|
+
width: 'auto',
|
|
64
|
+
fontSize: 12
|
|
65
|
+
},
|
|
66
|
+
className: styles['toolbar-item'],
|
|
67
|
+
onClick: function onClick() {
|
|
68
|
+
context.$publisher(context.topics.COMPONENT_ACTIVE, {
|
|
69
|
+
id: CELL_KEY.PAGE_ROOT
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}, "\u9875\u9762\u5C5E\u6027"), /*#__PURE__*/React.createElement(Divider, {
|
|
73
|
+
type: "vertical"
|
|
74
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
75
|
+
size: "small",
|
|
76
|
+
style: {
|
|
77
|
+
fontSize: 12,
|
|
78
|
+
margin: '0 2px'
|
|
79
|
+
}
|
|
80
|
+
}, "\u9884\u89C8"), /*#__PURE__*/React.createElement(Divider, {
|
|
81
|
+
type: "vertical"
|
|
82
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
83
|
+
size: "small",
|
|
84
|
+
type: "primary",
|
|
85
|
+
style: {
|
|
86
|
+
fontSize: 12,
|
|
87
|
+
margin: '0 0 0 2px'
|
|
88
|
+
}
|
|
89
|
+
}, "\u4FDD\u5B58"));
|
|
90
|
+
};
|
|
91
|
+
export default DesignToolbar;
|
|
File without changes
|
|
@@ -17,7 +17,6 @@ var TreeNode = Tree.TreeNode;
|
|
|
17
17
|
var PAGE_CELL = [CELL_KEY.PAGE_HEADER, CELL_KEY.PAGE_CONTENT, CELL_KEY.PAGE_FOOTER];
|
|
18
18
|
var Outline = function Outline(_ref) {
|
|
19
19
|
var open = _ref.open;
|
|
20
|
-
var openModal = useRef(void 0);
|
|
21
20
|
var clickBySelf = useRef(false);
|
|
22
21
|
var context = useLDContext();
|
|
23
22
|
var _useState = useState(null),
|
|
@@ -45,7 +44,10 @@ var Outline = function Outline(_ref) {
|
|
|
45
44
|
clickBySelf.current = false;
|
|
46
45
|
return;
|
|
47
46
|
}
|
|
48
|
-
|
|
47
|
+
var _split = split(getPathById(context.pageData, payload.id), '/'),
|
|
48
|
+
_split2 = _slicedToArray(_split, 1),
|
|
49
|
+
_root = _split2[0];
|
|
50
|
+
if (!PAGE_CELL.includes(_root)) {
|
|
49
51
|
setModalExpandedKeys(uniq([].concat(_toConsumableArray(latestModalExpandedKeysRef.current), _toConsumableArray(split(getPathById(context.pageData, payload.id), '/')))));
|
|
50
52
|
} else {
|
|
51
53
|
setPageExpandedKeys(uniq([].concat(_toConsumableArray(lastPageExpandedKeysRef.current), _toConsumableArray(split(getPathById(context.pageData, payload.id), '/')))));
|
|
@@ -55,18 +57,11 @@ var Outline = function Outline(_ref) {
|
|
|
55
57
|
context.$unsubscriber(context.topics.COMPONENT_ACTIVE, _id);
|
|
56
58
|
};
|
|
57
59
|
}, [context.pageData]);
|
|
58
|
-
var handleSelect = function
|
|
60
|
+
var handleSelect = useMemoizedFn(function (_key) {
|
|
59
61
|
clickBySelf.current = true;
|
|
60
62
|
context.$publisher(context.topics.COMPONENT_ACTIVE, _key ? {
|
|
61
63
|
id: _key
|
|
62
64
|
} : null);
|
|
63
|
-
};
|
|
64
|
-
var handleOpenModal = useMemoizedFn(function (_key) {
|
|
65
|
-
var _comp = context.componentMap.get(_key);
|
|
66
|
-
var _prevComp = openModal.current ? context.componentMap.get(openModal.current) : null;
|
|
67
|
-
_prevComp === null || _prevComp === void 0 || _prevComp.api.doClose();
|
|
68
|
-
_comp.api.doOpen();
|
|
69
|
-
openModal.current = _key;
|
|
70
65
|
});
|
|
71
66
|
var render = useMemoizedFn(function (_ref2) {
|
|
72
67
|
var props = _ref2.props,
|
|
@@ -131,7 +126,7 @@ var Outline = function Outline(_ref) {
|
|
|
131
126
|
type: "inner",
|
|
132
127
|
hoverable: true,
|
|
133
128
|
title: formatMessage({
|
|
134
|
-
id: 'luckda.lowcode.
|
|
129
|
+
id: 'luckda.lowcode.modal',
|
|
135
130
|
label: '模态视图层'
|
|
136
131
|
}),
|
|
137
132
|
style: {
|
|
@@ -154,21 +149,29 @@ var Outline = function Outline(_ref) {
|
|
|
154
149
|
var selected = _ref4.selected,
|
|
155
150
|
node = _ref4.node;
|
|
156
151
|
if (selected && node.props.pos.split('-').length === 2) {
|
|
157
|
-
|
|
152
|
+
// 选中节点是模态视图,则打开模态视图组件
|
|
153
|
+
context.$publisher(context.topics.COMPONENT_MODAL_TOGGLE, {
|
|
154
|
+
toggle: true,
|
|
155
|
+
id: _key
|
|
156
|
+
});
|
|
158
157
|
handleSelect(_key);
|
|
159
158
|
} else if (!selected && node.props.pos.split('-').length === 2) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
// 取消选中节点是模态视图,则关闭模态视图
|
|
160
|
+
context.$publisher(context.topics.COMPONENT_MODAL_TOGGLE, {
|
|
161
|
+
toggle: false,
|
|
162
|
+
id: _key
|
|
163
|
+
});
|
|
163
164
|
handleSelect(null);
|
|
164
165
|
} else {
|
|
166
|
+
// 选中节点是模态视图下的子组件,则打开该组件的模态视图组件
|
|
165
167
|
handleSelect(node.props.eventKey);
|
|
166
|
-
var
|
|
167
|
-
|
|
168
|
-
parentModal =
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
168
|
+
var _split3 = split(getPathById(context.pageData, node.props.eventKey), '/'),
|
|
169
|
+
_split4 = _slicedToArray(_split3, 1),
|
|
170
|
+
parentModal = _split4[0];
|
|
171
|
+
context.$publisher(context.topics.COMPONENT_MODAL_TOGGLE, {
|
|
172
|
+
toggle: true,
|
|
173
|
+
id: parentModal
|
|
174
|
+
});
|
|
172
175
|
}
|
|
173
176
|
},
|
|
174
177
|
expandedKeys: modalExpandedKeys,
|
|
@@ -177,7 +180,10 @@ var Outline = function Outline(_ref) {
|
|
|
177
180
|
node = _ref6.node;
|
|
178
181
|
if (expanded && node.props.pos.split('-').length === 2) {
|
|
179
182
|
handleSelect(null);
|
|
180
|
-
|
|
183
|
+
context.$publisher(context.topics.COMPONENT_MODAL_TOGGLE, {
|
|
184
|
+
toggle: true,
|
|
185
|
+
id: node.props.eventKey
|
|
186
|
+
});
|
|
181
187
|
}
|
|
182
188
|
setModalExpandedKeys(_keys);
|
|
183
189
|
}
|
|
@@ -193,11 +199,9 @@ var Outline = function Outline(_ref) {
|
|
|
193
199
|
var _ref9 = _slicedToArray(_ref7, 1),
|
|
194
200
|
_key = _ref9[0];
|
|
195
201
|
var node = _ref8.node;
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
openModal.current = void 0;
|
|
200
|
-
}
|
|
202
|
+
context.$publisher(context.topics.COMPONENT_MODAL_TOGGLE, {
|
|
203
|
+
toggle: false
|
|
204
|
+
});
|
|
201
205
|
handleSelect(node.props.eventKey);
|
|
202
206
|
},
|
|
203
207
|
expandedKeys: pageExpandedKeys,
|
|
@@ -2,31 +2,40 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
|
2
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
4
|
import React, { useRef, useState, useEffect, useLayoutEffect } from 'react';
|
|
5
|
-
import {
|
|
6
|
-
import { Breadcrumb
|
|
5
|
+
import { useCreation, useMemoizedFn } from 'ahooks';
|
|
6
|
+
import { Breadcrumb } from 'luck-design/antd';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
|
-
import {
|
|
8
|
+
import { takeRight, cloneDeep, isNil } from 'lodash';
|
|
9
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
9
10
|
import { useLDContext } from "../engine/provider/ContextProvider";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
11
|
+
import AttrsPanel from "./components/AttrsPanel";
|
|
12
|
+
import StylePanel from "./panel-section/StylePanel";
|
|
13
|
+
import AdvancePanel from "./components/AdvancePanel";
|
|
12
14
|
import { modifyById } from "../engine/tools/dataProcess";
|
|
13
15
|
import styles from "./style/panel.less";
|
|
16
|
+
var _I18N_PREFIX_ = 'luckda.lowcode.painter.panel';
|
|
14
17
|
var _TAB_LIST_ = [{
|
|
15
|
-
title:
|
|
18
|
+
title: formatMessage({
|
|
19
|
+
id: "".concat(_I18N_PREFIX_, ".attrs"),
|
|
20
|
+
label: '属性'
|
|
21
|
+
}),
|
|
16
22
|
key: 'attrs'
|
|
17
23
|
}, {
|
|
18
|
-
title:
|
|
24
|
+
title: formatMessage({
|
|
25
|
+
id: "".concat(_I18N_PREFIX_, ".styles"),
|
|
26
|
+
label: '样式'
|
|
27
|
+
}),
|
|
19
28
|
key: 'styles'
|
|
20
29
|
}, {
|
|
21
|
-
title:
|
|
30
|
+
title: formatMessage({
|
|
31
|
+
id: "".concat(_I18N_PREFIX_, ".advance"),
|
|
32
|
+
label: '高级'
|
|
33
|
+
}),
|
|
22
34
|
key: 'advance'
|
|
23
35
|
}];
|
|
24
36
|
var Panel = function Panel() {
|
|
25
|
-
var _nextRef$current, _nextRef$current2;
|
|
26
37
|
var activeTabRef = useRef(null);
|
|
27
38
|
var underLineRef = useRef(null);
|
|
28
|
-
var nextRef = useRef(null);
|
|
29
|
-
var factory = useRef(new PanelItemFactory());
|
|
30
39
|
var _useState = useState(null),
|
|
31
40
|
_useState2 = _slicedToArray(_useState, 2),
|
|
32
41
|
activeNode = _useState2[0],
|
|
@@ -35,14 +44,11 @@ var Panel = function Panel() {
|
|
|
35
44
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
36
45
|
activeTabKey = _useState4[0],
|
|
37
46
|
setActiveTabKey = _useState4[1];
|
|
38
|
-
var _useBoolean = useBoolean(false),
|
|
39
|
-
_useBoolean2 = _slicedToArray(_useBoolean, 2),
|
|
40
|
-
open = _useBoolean2[0],
|
|
41
|
-
_useBoolean2$ = _useBoolean2[1],
|
|
42
|
-
setTrue = _useBoolean2$.setTrue,
|
|
43
|
-
setFalse = _useBoolean2$.setFalse;
|
|
44
47
|
var context = useLDContext();
|
|
45
|
-
var
|
|
48
|
+
var meta = useCreation(function () {
|
|
49
|
+
return isNil(activeNode) ? null : require("../engine/meta/".concat(activeNode.node.component.toLowerCase(), ".props.json"));
|
|
50
|
+
}, [activeNode]);
|
|
51
|
+
var handleChange = useMemoizedFn(function (field, value, repositioning) {
|
|
46
52
|
var component = context.componentMap.get(activeNode.node.id);
|
|
47
53
|
var _component$api$getSel = component.api.getSelfAndParentLCData(),
|
|
48
54
|
node = _component$api$getSel.node;
|
|
@@ -53,58 +59,14 @@ var Panel = function Panel() {
|
|
|
53
59
|
id: activeNode.node.id,
|
|
54
60
|
pageData: cloneDeep(newData)
|
|
55
61
|
});
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
var renderPanelItems = useMemoizedFn(function (items) {
|
|
60
|
-
return items.map(function (item) {
|
|
61
|
-
var Comp = factory.current.getPanelItemFor(startsWith(item.type, '_') ? 'dynamic' : item.type, item.type);
|
|
62
|
-
if (item.type === 'group') {
|
|
63
|
-
return /*#__PURE__*/React.createElement(Comp, {
|
|
64
|
-
key: item.key,
|
|
65
|
-
label: item.name,
|
|
66
|
-
defaultCollapsed: true
|
|
67
|
-
}, renderPanelItems(item.props));
|
|
68
|
-
}
|
|
69
|
-
console.log(11111, item.key, activeNode.node);
|
|
70
|
-
return /*#__PURE__*/React.createElement(PanelItem, {
|
|
71
|
-
key: item.key,
|
|
72
|
-
label: item.name
|
|
73
|
-
}, Comp && /*#__PURE__*/React.createElement(Comp, {
|
|
74
|
-
defaultValue: activeNode.node[item.key],
|
|
75
|
-
next: function next() {
|
|
76
|
-
if (!item.next) return;
|
|
77
|
-
nextRef.current = {
|
|
78
|
-
name: item.next.name,
|
|
79
|
-
NextComp: renderPanelItems(item.next.props)
|
|
80
|
-
};
|
|
81
|
-
setTrue();
|
|
82
|
-
},
|
|
83
|
-
options: item.options,
|
|
84
|
-
disabled: item.disabled,
|
|
85
|
-
onChange: function onChange(value) {
|
|
86
|
-
return handleChange(item.key, value);
|
|
87
|
-
},
|
|
88
|
-
size: "small"
|
|
89
|
-
}));
|
|
62
|
+
if (repositioning) context.$publisher(context.topics.COMPONENT_REPOSITIONING, {
|
|
63
|
+
id: activeNode.node.id
|
|
64
|
+
});
|
|
90
65
|
});
|
|
91
66
|
});
|
|
92
|
-
var PropsComps = useCreation(function () {
|
|
93
|
-
var _meta;
|
|
94
|
-
try {
|
|
95
|
-
_meta = require("../engine/meta/".concat(activeNode.node.component.toLowerCase(), ".props.json"));
|
|
96
|
-
} catch (e) {
|
|
97
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
98
|
-
}
|
|
99
|
-
return renderPanelItems(_meta.props);
|
|
100
|
-
}, [activeNode]);
|
|
101
|
-
useEffect(function () {
|
|
102
|
-
if (!open) {
|
|
103
|
-
nextRef.current = null;
|
|
104
|
-
}
|
|
105
|
-
}, [open]);
|
|
106
67
|
useEffect(function () {
|
|
107
68
|
var _id = context.$subscriber(context.topics.COMPONENT_ACTIVE).on(function (payload) {
|
|
69
|
+
setActiveTabKey('attrs');
|
|
108
70
|
if (!payload.id) {
|
|
109
71
|
setActiveNode(null);
|
|
110
72
|
return;
|
|
@@ -119,9 +81,9 @@ var Panel = function Panel() {
|
|
|
119
81
|
});
|
|
120
82
|
}).watch();
|
|
121
83
|
return function () {
|
|
122
|
-
context.$unsubscriber(context.topics.COMPONENT_ACTIVE, _id);
|
|
84
|
+
return context.$unsubscriber(context.topics.COMPONENT_ACTIVE, _id);
|
|
123
85
|
};
|
|
124
|
-
}, [
|
|
86
|
+
}, []);
|
|
125
87
|
useLayoutEffect(function () {
|
|
126
88
|
underLineRef.current.style.left = "".concat(activeTabRef.current.offsetLeft + activeTabRef.current.offsetWidth / 2 - 10, "px");
|
|
127
89
|
}, [activeTabKey, !!activeNode]);
|
|
@@ -161,7 +123,7 @@ var Panel = function Panel() {
|
|
|
161
123
|
className: classNames(styles['lc-painter-panel-tabbar'], _defineProperty({}, styles.hidden, !activeNode))
|
|
162
124
|
}, /*#__PURE__*/React.createElement("ul", {
|
|
163
125
|
className: styles.headerList
|
|
164
|
-
}, _TAB_LIST_.map(function (_item) {
|
|
126
|
+
}, (activeNode !== null && activeNode !== void 0 && activeNode.node.css ? _TAB_LIST_ : [_TAB_LIST_[0], _TAB_LIST_[2]]).map(function (_item) {
|
|
165
127
|
return /*#__PURE__*/React.createElement("li", {
|
|
166
128
|
key: _item.key,
|
|
167
129
|
ref: activeTabKey === _item.key ? activeTabRef : null,
|
|
@@ -173,35 +135,28 @@ var Panel = function Panel() {
|
|
|
173
135
|
})), /*#__PURE__*/React.createElement("div", {
|
|
174
136
|
ref: underLineRef,
|
|
175
137
|
className: styles.underline
|
|
176
|
-
})), activeTabKey === _TAB_LIST_[0].key && /*#__PURE__*/React.createElement(
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
mask: false,
|
|
182
|
-
closable: false,
|
|
183
|
-
getContainer: false,
|
|
184
|
-
destroyOnClose: true,
|
|
185
|
-
style: {
|
|
186
|
-
position: 'absolute'
|
|
187
|
-
},
|
|
188
|
-
bodyStyle: {
|
|
189
|
-
padding: 0,
|
|
190
|
-
height: '100%'
|
|
138
|
+
})), activeTabKey === _TAB_LIST_[0].key && /*#__PURE__*/React.createElement(AttrsPanel, {
|
|
139
|
+
meta: meta,
|
|
140
|
+
value: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node,
|
|
141
|
+
onChange: function onChange(field, value, repositioning) {
|
|
142
|
+
return handleChange(field, value, repositioning);
|
|
191
143
|
}
|
|
192
|
-
}, /*#__PURE__*/React.createElement(
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}, /*#__PURE__*/React.createElement(
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}
|
|
144
|
+
}), activeTabKey === _TAB_LIST_[1].key && /*#__PURE__*/React.createElement(StylePanel, {
|
|
145
|
+
value: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node.css,
|
|
146
|
+
onChange: function onChange(_, newCss) {
|
|
147
|
+
return handleChange('css', newCss);
|
|
148
|
+
}
|
|
149
|
+
}), activeTabKey === _TAB_LIST_[2].key && /*#__PURE__*/React.createElement(AdvancePanel, {
|
|
150
|
+
meta: meta,
|
|
151
|
+
value: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node,
|
|
152
|
+
onChange: function onChange(val) {
|
|
153
|
+
return handleChange('advance', val);
|
|
154
|
+
}
|
|
155
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
204
156
|
className: classNames(styles['lc-painter-panel-empty'], _defineProperty({}, styles.hidden, !!activeNode))
|
|
205
|
-
},
|
|
157
|
+
}, formatMessage({
|
|
158
|
+
id: "".concat(_I18N_PREFIX_, ".empty"),
|
|
159
|
+
label: '请在左侧画布选中节点'
|
|
160
|
+
})));
|
|
206
161
|
};
|
|
207
162
|
export default Panel;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import React, { useState, forwardRef, useImperativeHandle } from 'react';
|
|
4
|
+
import { useMemoizedFn, useCreation, useMap } from 'ahooks';
|
|
5
|
+
import { Modal, Icon, Input, Checkbox } from 'luck-design/antd';
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
import { reduce } from 'lodash';
|
|
8
|
+
import { useLDContext } from "../../engine/provider/ContextProvider";
|
|
9
|
+
import JSEditor from "./code-editor/JSEditor";
|
|
10
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
11
|
+
import styles from "../style/action-bind-modal.less";
|
|
12
|
+
var _I18N_PREFIX_ = 'luckda.lowcode.painter.actionBindModal';
|
|
13
|
+
var _ACTION_CATEGORY_ = [{
|
|
14
|
+
key: 'actions',
|
|
15
|
+
label: formatMessage({
|
|
16
|
+
id: "".concat(_I18N_PREFIX_, ".actions"),
|
|
17
|
+
label: '页面行为'
|
|
18
|
+
})
|
|
19
|
+
}, {
|
|
20
|
+
key: 'trigger',
|
|
21
|
+
label: formatMessage({
|
|
22
|
+
id: "".concat(_I18N_PREFIX_, ".trigger"),
|
|
23
|
+
label: '触发器'
|
|
24
|
+
})
|
|
25
|
+
}, {
|
|
26
|
+
key: 'code',
|
|
27
|
+
label: formatMessage({
|
|
28
|
+
id: "".concat(_I18N_PREFIX_, ".code"),
|
|
29
|
+
label: '自定义动作'
|
|
30
|
+
})
|
|
31
|
+
}];
|
|
32
|
+
var _CATEGORY_CODE_ITEMS = [{
|
|
33
|
+
key: 'coding',
|
|
34
|
+
label: formatMessage({
|
|
35
|
+
id: "".concat(_I18N_PREFIX_, ".coding"),
|
|
36
|
+
label: '动作编写'
|
|
37
|
+
})
|
|
38
|
+
}];
|
|
39
|
+
var ActionBindModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
40
|
+
var activeNode = _ref.activeNode,
|
|
41
|
+
onComfirm = _ref.onComfirm;
|
|
42
|
+
var context = useLDContext();
|
|
43
|
+
var _useState = useState(void 0),
|
|
44
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
45
|
+
title = _useState2[0],
|
|
46
|
+
setTitle = _useState2[1];
|
|
47
|
+
var _useState3 = useState('actions'),
|
|
48
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
49
|
+
category = _useState4[0],
|
|
50
|
+
setCategory = _useState4[1];
|
|
51
|
+
var _useMap = useMap([]),
|
|
52
|
+
_useMap2 = _slicedToArray(_useMap, 2),
|
|
53
|
+
actionPool = _useMap2[0],
|
|
54
|
+
_useMap2$ = _useMap2[1],
|
|
55
|
+
set = _useMap2$.set,
|
|
56
|
+
remove = _useMap2$.remove,
|
|
57
|
+
reset = _useMap2$.reset,
|
|
58
|
+
get = _useMap2$.get;
|
|
59
|
+
var selectItems = useCreation(function () {
|
|
60
|
+
if (category === 'actions') {
|
|
61
|
+
return [];
|
|
62
|
+
} else if (category === 'trigger') {
|
|
63
|
+
return reduce(context.componentList, function (ret, _ref2) {
|
|
64
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
65
|
+
key = _ref3[0],
|
|
66
|
+
target = _ref3[1];
|
|
67
|
+
if (key !== activeNode.id) {
|
|
68
|
+
ret.push({
|
|
69
|
+
key: key,
|
|
70
|
+
label: "".concat(target.api.getSelfAndParentLCData().node.props.name, "(").concat(key, ")")
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return ret;
|
|
74
|
+
}, []);
|
|
75
|
+
} else if (category === 'code') {
|
|
76
|
+
return _CATEGORY_CODE_ITEMS;
|
|
77
|
+
}
|
|
78
|
+
return [];
|
|
79
|
+
}, [category]);
|
|
80
|
+
var handleClose = useMemoizedFn(function () {
|
|
81
|
+
setTitle(void 0);
|
|
82
|
+
});
|
|
83
|
+
var handleComfirm = useMemoizedFn(function () {
|
|
84
|
+
handleClose();
|
|
85
|
+
});
|
|
86
|
+
var handleSearch = useMemoizedFn(function (val) {});
|
|
87
|
+
useImperativeHandle(ref, function () {
|
|
88
|
+
return {
|
|
89
|
+
doOpen: function doOpen(title) {
|
|
90
|
+
setTitle(title);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}, []);
|
|
94
|
+
return /*#__PURE__*/React.createElement(Modal, {
|
|
95
|
+
className: styles['lc-painter-panel-action-bind-modal'],
|
|
96
|
+
bodyStyle: {
|
|
97
|
+
marginTop: 0,
|
|
98
|
+
padding: '4px 24px'
|
|
99
|
+
},
|
|
100
|
+
title: title,
|
|
101
|
+
visible: !!title,
|
|
102
|
+
width: 960,
|
|
103
|
+
closable: false,
|
|
104
|
+
maskClosable: false,
|
|
105
|
+
getContainer: function getContainer() {
|
|
106
|
+
return document.getElementById('lc-design-workspace');
|
|
107
|
+
},
|
|
108
|
+
zIndex: 3000,
|
|
109
|
+
onCancel: handleClose,
|
|
110
|
+
onOk: handleComfirm
|
|
111
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
112
|
+
className: styles['lc-painter-panel-action-bind-modal-body']
|
|
113
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
114
|
+
className: styles['lc-painter-panel-action-bind-modal-body-left']
|
|
115
|
+
}, /*#__PURE__*/React.createElement("p", null, formatMessage({
|
|
116
|
+
id: "".concat(_I18N_PREFIX_, ".bind"),
|
|
117
|
+
label: '绑定动作'
|
|
118
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
119
|
+
className: styles['selector-box']
|
|
120
|
+
}, /*#__PURE__*/React.createElement("ul", {
|
|
121
|
+
className: classNames(styles['selector-box-ul'], styles['action-category'])
|
|
122
|
+
}, _ACTION_CATEGORY_.map(function (_ref4) {
|
|
123
|
+
var key = _ref4.key,
|
|
124
|
+
label = _ref4.label;
|
|
125
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
126
|
+
key: key,
|
|
127
|
+
className: classNames(_defineProperty({}, styles.active, key === category)),
|
|
128
|
+
onClick: function onClick() {
|
|
129
|
+
return setCategory(key);
|
|
130
|
+
}
|
|
131
|
+
}, label, key === category && /*#__PURE__*/React.createElement(Icon, {
|
|
132
|
+
type: "check",
|
|
133
|
+
className: styles['check-icon']
|
|
134
|
+
}));
|
|
135
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
136
|
+
className: styles['selecter-items-box']
|
|
137
|
+
}, category !== 'code' && /*#__PURE__*/React.createElement("div", {
|
|
138
|
+
style: {
|
|
139
|
+
height: 42,
|
|
140
|
+
display: 'flex',
|
|
141
|
+
justifyContent: 'center'
|
|
142
|
+
}
|
|
143
|
+
}, /*#__PURE__*/React.createElement(Input.Search, {
|
|
144
|
+
placeholder: formatMessage({
|
|
145
|
+
id: "".concat(_I18N_PREFIX_, ".search"),
|
|
146
|
+
label: '搜索'
|
|
147
|
+
}),
|
|
148
|
+
size: "small",
|
|
149
|
+
onSearch: handleSearch,
|
|
150
|
+
style: {
|
|
151
|
+
width: 170,
|
|
152
|
+
alignSelf: 'center'
|
|
153
|
+
}
|
|
154
|
+
})), /*#__PURE__*/React.createElement("ul", {
|
|
155
|
+
className: classNames(styles['selector-box-ul'], styles['selecter-items'])
|
|
156
|
+
}, selectItems.map(function (_ref5) {
|
|
157
|
+
var key = _ref5.key,
|
|
158
|
+
label = _ref5.label;
|
|
159
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
160
|
+
key: key,
|
|
161
|
+
className: classNames(_defineProperty({}, styles.active, actionPool.has(key))),
|
|
162
|
+
onClick: function onClick() {
|
|
163
|
+
return set(key, label);
|
|
164
|
+
}
|
|
165
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
166
|
+
checked: actionPool.has(key),
|
|
167
|
+
style: {
|
|
168
|
+
marginRight: 4
|
|
169
|
+
}
|
|
170
|
+
}), label);
|
|
171
|
+
}))))), /*#__PURE__*/React.createElement("div", {
|
|
172
|
+
className: styles['lc-painter-panel-action-bind-modal-body-right']
|
|
173
|
+
}, category === 'code' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", null, formatMessage({
|
|
174
|
+
id: "".concat(_I18N_PREFIX_, ".coding"),
|
|
175
|
+
label: '动作编写'
|
|
176
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
177
|
+
className: styles['code-box']
|
|
178
|
+
}, /*#__PURE__*/React.createElement(JSEditor, null))))));
|
|
179
|
+
});
|
|
180
|
+
export default ActionBindModal;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
|
+
import { useCreation, useMemoizedFn } from 'ahooks';
|
|
3
|
+
import { Menu, Dropdown, Button, Tooltip } from 'luck-design/antd';
|
|
4
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
5
|
+
import Collapse from "./Collapse";
|
|
6
|
+
import ActionBindModal from "./ActionBindModal";
|
|
7
|
+
var _I18N_PREFIX_ = 'luckda.lowcode.painter.advancePanel';
|
|
8
|
+
var AdvancePanel = function AdvancePanel(_ref) {
|
|
9
|
+
var meta = _ref.meta,
|
|
10
|
+
value = _ref.value,
|
|
11
|
+
onChange = _ref.onChange;
|
|
12
|
+
var modalRef = useRef();
|
|
13
|
+
var handleEventClick = useMemoizedFn(function (e) {
|
|
14
|
+
var payload = e.item.props.payload;
|
|
15
|
+
modalRef.current.doOpen(payload.name);
|
|
16
|
+
});
|
|
17
|
+
var eventsMenu = useCreation(function () {
|
|
18
|
+
var _meta$advance;
|
|
19
|
+
return /*#__PURE__*/React.createElement(Menu, {
|
|
20
|
+
onClick: handleEventClick,
|
|
21
|
+
style: {
|
|
22
|
+
fontSize: 12
|
|
23
|
+
}
|
|
24
|
+
}, (_meta$advance = meta.advance) === null || _meta$advance === void 0 || (_meta$advance = _meta$advance.events) === null || _meta$advance === void 0 ? void 0 : _meta$advance.map(function (event) {
|
|
25
|
+
return /*#__PURE__*/React.createElement(Menu.Item, {
|
|
26
|
+
key: event.key,
|
|
27
|
+
payload: event
|
|
28
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
29
|
+
title: event.desc || event.name,
|
|
30
|
+
placement: "left",
|
|
31
|
+
getPopupContainer: function getPopupContainer() {
|
|
32
|
+
return document.getElementById('lc-design-workspace');
|
|
33
|
+
}
|
|
34
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
style: {
|
|
36
|
+
width: '100%',
|
|
37
|
+
fontSize: 12
|
|
38
|
+
}
|
|
39
|
+
}, event.name)));
|
|
40
|
+
}));
|
|
41
|
+
}, [value]);
|
|
42
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Collapse, {
|
|
43
|
+
field: "events",
|
|
44
|
+
label: formatMessage({
|
|
45
|
+
id: "".concat(_I18N_PREFIX_, ".events"),
|
|
46
|
+
label: '事件'
|
|
47
|
+
}),
|
|
48
|
+
bodyStyle: {
|
|
49
|
+
padding: '12px 16px'
|
|
50
|
+
}
|
|
51
|
+
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
52
|
+
overlay: eventsMenu,
|
|
53
|
+
placement: "bottomCenter",
|
|
54
|
+
getPopupContainer: function getPopupContainer() {
|
|
55
|
+
return document.getElementById('lc-design-workspace');
|
|
56
|
+
}
|
|
57
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
58
|
+
size: "small",
|
|
59
|
+
block: true
|
|
60
|
+
}, formatMessage({
|
|
61
|
+
id: "".concat(_I18N_PREFIX_, ".addEventAction"),
|
|
62
|
+
label: '添加事件动作'
|
|
63
|
+
})))), /*#__PURE__*/React.createElement(ActionBindModal, {
|
|
64
|
+
ref: modalRef,
|
|
65
|
+
activeNode: value
|
|
66
|
+
}));
|
|
67
|
+
};
|
|
68
|
+
export default AdvancePanel;
|