@luck-design-biz/luckda 0.0.24-1 → 0.0.24-2
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/LdAutoForm/index.js +0 -0
- package/es/components/LdCard/index.js +0 -0
- package/es/components/LdCard/model.js +0 -0
- package/es/components/LdCom/index.js +0 -0
- package/es/components/LdFormList/index.js +0 -0
- package/es/components/LdFormList/model.js +0 -0
- package/es/components/LdGrid/index.js +12 -3
- package/es/components/LdGrid/model.js +0 -0
- package/es/components/LdGridForm/index.js +0 -0
- package/es/components/LdGridForm/index.less +0 -0
- package/es/components/LdInfoPanel/index.js +0 -0
- package/es/components/LdPop/index.js +0 -0
- package/es/components/LdRuntimeCom/index.js +0 -0
- package/es/components/LdTree/index.js +0 -0
- package/es/components/LdTree/index.less +0 -0
- package/es/helper/FromItems.js +0 -0
- package/es/helper/action.js +0 -0
- package/es/helper/form.js +0 -0
- package/es/helper/index.less +0 -0
- package/es/helper/ldBuilder.js +0 -0
- package/es/helper/ldComBuild.js +0 -0
- package/es/index.js +0 -0
- package/es/lowcode/constants/api-url.js +291 -1
- package/es/lowcode/constants/event-topics.js +4 -4
- package/es/lowcode/constants/index.js +0 -0
- package/es/lowcode/engine/factory/DataFactory.js +0 -0
- package/es/lowcode/engine/factory/panel-item-factory/DynamicStrategy.js +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 +2 -0
- package/es/lowcode/engine/meta/box.props.default.json +0 -0
- package/es/lowcode/engine/meta/box.props.json +0 -0
- package/es/lowcode/engine/meta/button.props.default.json +0 -0
- package/es/lowcode/engine/meta/button.props.json +7 -2
- package/es/lowcode/engine/meta/cardlist.props.default.json +0 -0
- package/es/lowcode/engine/meta/cardlist.props.json +0 -0
- package/es/lowcode/engine/meta/components-list.json +6 -6
- package/es/lowcode/engine/meta/dialog.props.default.json +0 -0
- package/es/lowcode/engine/meta/dialog.props.json +0 -0
- package/es/lowcode/engine/meta/drawer.props.default.json +0 -0
- package/es/lowcode/engine/meta/drawer.props.json +0 -0
- package/es/lowcode/engine/meta/form.props.default.json +0 -0
- package/es/lowcode/engine/meta/form.props.json +0 -0
- package/es/lowcode/engine/meta/iframe.props.default.json +0 -0
- package/es/lowcode/engine/meta/iframe.props.json +0 -0
- package/es/lowcode/engine/meta/image.props.default.json +0 -0
- package/es/lowcode/engine/meta/image.props.json +0 -0
- package/es/lowcode/engine/meta/imex.props.default.json +0 -0
- package/es/lowcode/engine/meta/imex.props.json +0 -0
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +28 -28
- package/es/lowcode/engine/meta/jsx.props.default.json +0 -0
- package/es/lowcode/engine/meta/jsx.props.json +0 -0
- package/es/lowcode/engine/meta/layout.props.default.json +0 -0
- package/es/lowcode/engine/meta/layout.props.json +0 -0
- package/es/lowcode/engine/meta/link.props.default.json +0 -0
- package/es/lowcode/engine/meta/link.props.json +0 -0
- package/es/lowcode/engine/meta/section.props.default.json +0 -0
- package/es/lowcode/engine/meta/section.props.json +0 -0
- package/es/lowcode/engine/meta/split.props.default.json +0 -0
- package/es/lowcode/engine/meta/split.props.json +0 -0
- package/es/lowcode/engine/meta/table.props.default.json +20 -2
- package/es/lowcode/engine/meta/table.props.json +99 -37
- package/es/lowcode/engine/meta/tabs.props.default.json +0 -0
- package/es/lowcode/engine/meta/tabs.props.json +0 -0
- package/es/lowcode/engine/meta/text.props.default.json +0 -0
- package/es/lowcode/engine/meta/text.props.json +0 -0
- package/es/lowcode/engine/meta/tree.props.default.json +0 -0
- package/es/lowcode/engine/meta/tree.props.json +0 -0
- package/es/lowcode/engine/provider/ContextProvider.js +40 -28
- 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 +68 -0
- package/es/lowcode/engine/tools/usePromiseState.js +0 -0
- 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 +71 -33
- package/es/lowcode/painter/Ribbon.js +0 -0
- package/es/lowcode/painter/components/Collapse.js +67 -8
- package/es/lowcode/painter/components/ColorInput.js +125 -0
- package/es/lowcode/painter/components/{TabEditor.js → ListEditor.js} +17 -16
- 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 +4 -1
- 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/actions-editor/ActionEditor.js +147 -0
- package/es/lowcode/painter/components/actions-editor/index.js +170 -0
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +42 -64
- 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 +22 -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/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/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 +42 -10
- 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 +55 -8
- 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/TableActions.js +19 -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/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 +7 -0
- 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/index.less +0 -0
- package/es/lowcode/painter/style/layout-ratio.less +0 -0
- package/{lib/lowcode/painter/style/tabeditor.less → es/lowcode/painter/style/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-item.less +11 -1
- package/es/lowcode/painter/style/panel.less +3 -16
- package/es/lowcode/painter/style/pop-confirm.less +0 -0
- 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 +2 -2
- package/es/lowcode/view/lc-components/Box/index.less +0 -0
- package/es/lowcode/view/lc-components/Box/meta.json +0 -0
- 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 +7 -2
- 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 +0 -0
- 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 -0
- 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 +19 -22
- package/es/lowcode/view/lc-components/Drawer/{style.less → index.less} +1 -1
- package/es/lowcode/view/lc-components/Drawer/meta.json +0 -0
- 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 +0 -0
- 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 +0 -0
- 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 +0 -0
- 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 +0 -0
- 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 +0 -0
- package/es/lowcode/view/lc-components/Layout/FunctionDesign.js +0 -0
- 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 +0 -0
- 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 +0 -0
- 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 +0 -0
- 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 +0 -0
- package/es/lowcode/view/lc-components/Table/FunctionDesign.js +4 -2
- package/es/lowcode/view/lc-components/Table/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Table/index.js +222 -132
- package/es/lowcode/view/lc-components/Table/meta.json +88 -37
- 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 -0
- 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 +0 -0
- package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +0 -0
- package/es/lowcode/view/lc-components/Tree/FunctionLive.js +0 -0
- package/es/lowcode/view/lc-components/Tree/index.js +0 -0
- package/es/lowcode/view/lc-components/Tree/meta.json +0 -0
- package/es/lowcode/view/lc-components/Wrapper.js +0 -0
- 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/LdAutoForm/index.js +0 -0
- package/lib/components/LdCard/index.js +0 -0
- package/lib/components/LdCard/model.js +0 -0
- package/lib/components/LdCom/index.js +0 -0
- package/lib/components/LdFormList/index.js +0 -0
- package/lib/components/LdFormList/model.js +0 -0
- package/lib/components/LdGrid/index.js +12 -3
- package/lib/components/LdGrid/model.js +0 -0
- package/lib/components/LdGridForm/index.js +0 -0
- package/lib/components/LdGridForm/index.less +0 -0
- package/lib/components/LdInfoPanel/index.js +0 -0
- package/lib/components/LdPop/index.js +0 -0
- package/lib/components/LdRuntimeCom/index.js +0 -0
- package/lib/components/LdTree/index.js +0 -0
- package/lib/components/LdTree/index.less +0 -0
- package/lib/helper/FromItems.js +0 -0
- package/lib/helper/action.js +0 -0
- package/lib/helper/form.js +0 -0
- package/lib/helper/index.less +0 -0
- package/lib/helper/ldBuilder.js +0 -0
- package/lib/helper/ldComBuild.js +0 -0
- package/lib/index.js +0 -0
- package/lib/lowcode/constants/api-url.js +293 -2
- package/lib/lowcode/constants/event-topics.js +5 -5
- package/lib/lowcode/constants/index.js +0 -0
- package/lib/lowcode/engine/factory/DataFactory.js +0 -0
- package/lib/lowcode/engine/factory/panel-item-factory/DynamicStrategy.js +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 +2 -0
- package/lib/lowcode/engine/meta/box.props.default.json +0 -0
- package/lib/lowcode/engine/meta/box.props.json +0 -0
- package/lib/lowcode/engine/meta/button.props.default.json +0 -0
- package/lib/lowcode/engine/meta/button.props.json +7 -2
- package/lib/lowcode/engine/meta/cardlist.props.default.json +0 -0
- package/lib/lowcode/engine/meta/cardlist.props.json +0 -0
- package/lib/lowcode/engine/meta/components-list.json +6 -6
- package/lib/lowcode/engine/meta/dialog.props.default.json +0 -0
- package/lib/lowcode/engine/meta/dialog.props.json +0 -0
- package/lib/lowcode/engine/meta/drawer.props.default.json +0 -0
- package/lib/lowcode/engine/meta/drawer.props.json +0 -0
- package/lib/lowcode/engine/meta/form.props.default.json +0 -0
- package/lib/lowcode/engine/meta/form.props.json +0 -0
- package/lib/lowcode/engine/meta/iframe.props.default.json +0 -0
- package/lib/lowcode/engine/meta/iframe.props.json +0 -0
- package/lib/lowcode/engine/meta/image.props.default.json +0 -0
- package/lib/lowcode/engine/meta/image.props.json +0 -0
- package/lib/lowcode/engine/meta/imex.props.default.json +0 -0
- package/lib/lowcode/engine/meta/imex.props.json +0 -0
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +28 -28
- package/lib/lowcode/engine/meta/jsx.props.default.json +0 -0
- package/lib/lowcode/engine/meta/jsx.props.json +0 -0
- package/lib/lowcode/engine/meta/layout.props.default.json +0 -0
- package/lib/lowcode/engine/meta/layout.props.json +0 -0
- package/lib/lowcode/engine/meta/link.props.default.json +0 -0
- package/lib/lowcode/engine/meta/link.props.json +0 -0
- package/lib/lowcode/engine/meta/section.props.default.json +0 -0
- package/lib/lowcode/engine/meta/section.props.json +0 -0
- package/lib/lowcode/engine/meta/split.props.default.json +0 -0
- package/lib/lowcode/engine/meta/split.props.json +0 -0
- package/lib/lowcode/engine/meta/table.props.default.json +20 -2
- package/lib/lowcode/engine/meta/table.props.json +99 -37
- package/lib/lowcode/engine/meta/tabs.props.default.json +0 -0
- package/lib/lowcode/engine/meta/tabs.props.json +0 -0
- package/lib/lowcode/engine/meta/text.props.default.json +0 -0
- package/lib/lowcode/engine/meta/text.props.json +0 -0
- package/lib/lowcode/engine/meta/tree.props.default.json +0 -0
- package/lib/lowcode/engine/meta/tree.props.json +0 -0
- package/lib/lowcode/engine/provider/ContextProvider.js +40 -28
- 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 +70 -0
- package/lib/lowcode/engine/tools/usePromiseState.js +0 -0
- 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 +71 -33
- package/lib/lowcode/painter/Ribbon.js +0 -0
- package/lib/lowcode/painter/components/Collapse.js +65 -7
- package/lib/lowcode/painter/components/ColorInput.js +132 -0
- package/lib/lowcode/painter/components/{TabEditor.js → ListEditor.js} +19 -18
- 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 +4 -1
- 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/actions-editor/ActionEditor.js +155 -0
- package/lib/lowcode/painter/components/actions-editor/index.js +178 -0
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +40 -63
- 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 +22 -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/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/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 +40 -9
- 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 +55 -8
- 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/TableActions.js +26 -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/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 +7 -0
- 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/index.less +0 -0
- package/lib/lowcode/painter/style/layout-ratio.less +0 -0
- package/{es/lowcode/painter/style/tabeditor.less → lib/lowcode/painter/style/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-item.less +11 -1
- package/lib/lowcode/painter/style/panel.less +3 -16
- package/lib/lowcode/painter/style/pop-confirm.less +0 -0
- 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 +2 -2
- package/lib/lowcode/view/lc-components/Box/index.less +0 -0
- package/lib/lowcode/view/lc-components/Box/meta.json +0 -0
- 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 +7 -2
- 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 +0 -0
- 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 -0
- 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 +18 -21
- package/lib/lowcode/view/lc-components/Drawer/{style.less → index.less} +1 -1
- package/lib/lowcode/view/lc-components/Drawer/meta.json +0 -0
- 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 +0 -0
- 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 +0 -0
- 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 +0 -0
- 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 +0 -0
- 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 +0 -0
- package/lib/lowcode/view/lc-components/Layout/FunctionDesign.js +0 -0
- 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 +0 -0
- 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 +0 -0
- 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 +0 -0
- 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 +0 -0
- package/lib/lowcode/view/lc-components/Table/FunctionDesign.js +4 -2
- package/lib/lowcode/view/lc-components/Table/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Table/index.js +221 -131
- package/lib/lowcode/view/lc-components/Table/meta.json +88 -37
- 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 -0
- 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 +0 -0
- package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +0 -0
- package/lib/lowcode/view/lc-components/Tree/FunctionLive.js +0 -0
- package/lib/lowcode/view/lc-components/Tree/index.js +0 -0
- package/lib/lowcode/view/lc-components/Tree/meta.json +0 -0
- package/lib/lowcode/view/lc-components/Wrapper.js +0 -0
- 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 +7 -5
- package/upload.js +0 -0
- package/utils.js +0 -0
- package/es/lowcode/painter/panel-section/StylePanel/Width.js +0 -48
|
@@ -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,
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
1
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
5
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
|
+
var _excluded = ["type", "key", "name", "desc", "default", "props", "panelItem", "next", "repositioning"];
|
|
4
7
|
import React, { useRef, useState, useEffect, useLayoutEffect } from 'react';
|
|
5
8
|
import { useBoolean, useCreation, useMemoizedFn } from 'ahooks';
|
|
6
9
|
import { Breadcrumb, Drawer, Icon } from 'luck-design/antd';
|
|
7
10
|
import classNames from 'classnames';
|
|
8
|
-
import { startsWith, takeRight, cloneDeep } from 'lodash';
|
|
11
|
+
import { startsWith, takeRight, cloneDeep, isNil } from 'lodash';
|
|
9
12
|
import { useLDContext } from "../engine/provider/ContextProvider";
|
|
10
13
|
import PanelItem from "./components/PanelItem";
|
|
11
14
|
import PanelItemFactory from "../engine/factory/panel-item-factory";
|
|
12
15
|
import { modifyById } from "../engine/tools/dataProcess";
|
|
13
16
|
import styles from "./style/panel.less";
|
|
17
|
+
import StylePanel from "./panel-section/StylePanel";
|
|
14
18
|
var _TAB_LIST_ = [{
|
|
15
19
|
title: '属性',
|
|
16
20
|
key: 'attrs'
|
|
@@ -42,7 +46,7 @@ var Panel = function Panel() {
|
|
|
42
46
|
setTrue = _useBoolean2$.setTrue,
|
|
43
47
|
setFalse = _useBoolean2$.setFalse;
|
|
44
48
|
var context = useLDContext();
|
|
45
|
-
var handleChange = useMemoizedFn(function (field, value) {
|
|
49
|
+
var handleChange = useMemoizedFn(function (field, value, repositioning) {
|
|
46
50
|
var component = context.componentMap.get(activeNode.node.id);
|
|
47
51
|
var _component$api$getSel = component.api.getSelfAndParentLCData(),
|
|
48
52
|
node = _component$api$getSel.node;
|
|
@@ -53,43 +57,73 @@ var Panel = function Panel() {
|
|
|
53
57
|
id: activeNode.node.id,
|
|
54
58
|
pageData: cloneDeep(newData)
|
|
55
59
|
});
|
|
60
|
+
if (repositioning) context.$publisher(context.topics.COMPONENT_REPOSITIONING, {
|
|
61
|
+
id: activeNode.node.id
|
|
62
|
+
});
|
|
56
63
|
});
|
|
57
|
-
|
|
64
|
+
if (nextRef.current.autoClose) {
|
|
65
|
+
setFalse();
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
var handleStyleChange = useMemoizedFn(function (newStyle, newCss) {
|
|
69
|
+
console.log('style', newStyle, newCss);
|
|
70
|
+
// setCss(newCss);
|
|
71
|
+
});
|
|
72
|
+
var goNext = useMemoizedFn(function (_next) {
|
|
73
|
+
if (!_next) return;
|
|
74
|
+
nextRef.current = {
|
|
75
|
+
name: _next.name,
|
|
76
|
+
autoClose: _next.autoClose,
|
|
77
|
+
NextComp: renderPanelItems(_next.props)
|
|
78
|
+
};
|
|
79
|
+
setTrue();
|
|
58
80
|
});
|
|
59
81
|
var renderPanelItems = useMemoizedFn(function (items) {
|
|
60
|
-
return items.map(function (
|
|
61
|
-
var
|
|
62
|
-
|
|
82
|
+
return items.map(function (_ref) {
|
|
83
|
+
var type = _ref.type,
|
|
84
|
+
key = _ref.key,
|
|
85
|
+
name = _ref.name,
|
|
86
|
+
desc = _ref.desc,
|
|
87
|
+
defaultValue = _ref.default,
|
|
88
|
+
props = _ref.props,
|
|
89
|
+
panelItem = _ref.panelItem,
|
|
90
|
+
_next2 = _ref.next,
|
|
91
|
+
repositioning = _ref.repositioning,
|
|
92
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
93
|
+
var Comp = factory.current.getPanelItemFor(startsWith(type, '_') ? 'dynamic' : type, type);
|
|
94
|
+
if (type === 'group') {
|
|
63
95
|
return /*#__PURE__*/React.createElement(Comp, {
|
|
64
|
-
key:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
96
|
+
key: key,
|
|
97
|
+
field: key,
|
|
98
|
+
label: name,
|
|
99
|
+
next: _next2 ? function () {
|
|
100
|
+
return goNext(_next2);
|
|
101
|
+
} : null,
|
|
102
|
+
defaultCollapsed: defaultValue,
|
|
103
|
+
desc: desc
|
|
104
|
+
}, renderPanelItems(props || []));
|
|
68
105
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
106
|
+
var _context$componentMap = context.componentMap.get(activeNode.node.id).api.getSelfAndParentLCData(),
|
|
107
|
+
node = _context$componentMap.node;
|
|
108
|
+
return /*#__PURE__*/React.createElement(PanelItem, _extends({
|
|
109
|
+
key: key,
|
|
110
|
+
field: key,
|
|
111
|
+
label: name,
|
|
112
|
+
desc: desc
|
|
113
|
+
}, panelItem), Comp && /*#__PURE__*/React.createElement(Comp, _extends({
|
|
114
|
+
defaultValue: isNil(node.props[key]) ? defaultValue : node.props[key],
|
|
75
115
|
next: function next() {
|
|
76
|
-
|
|
77
|
-
nextRef.current = {
|
|
78
|
-
name: item.next.name,
|
|
79
|
-
NextComp: renderPanelItems(item.next.props)
|
|
80
|
-
};
|
|
81
|
-
setTrue();
|
|
116
|
+
return goNext(_next2);
|
|
82
117
|
},
|
|
83
|
-
options: item.options,
|
|
84
|
-
disabled: item.disabled,
|
|
85
118
|
onChange: function onChange(value) {
|
|
86
|
-
return handleChange(
|
|
119
|
+
return handleChange(key, value, repositioning);
|
|
87
120
|
},
|
|
88
121
|
size: "small"
|
|
89
|
-
}));
|
|
122
|
+
}, rest)));
|
|
90
123
|
});
|
|
91
124
|
});
|
|
92
125
|
var PropsComps = useCreation(function () {
|
|
126
|
+
setActiveTabKey('attrs');
|
|
93
127
|
var _meta;
|
|
94
128
|
try {
|
|
95
129
|
_meta = require("../engine/meta/".concat(activeNode.node.component.toLowerCase(), ".props.json"));
|
|
@@ -105,6 +139,7 @@ var Panel = function Panel() {
|
|
|
105
139
|
}, [open]);
|
|
106
140
|
useEffect(function () {
|
|
107
141
|
var _id = context.$subscriber(context.topics.COMPONENT_ACTIVE).on(function (payload) {
|
|
142
|
+
setFalse();
|
|
108
143
|
if (!payload.id) {
|
|
109
144
|
setActiveNode(null);
|
|
110
145
|
return;
|
|
@@ -121,7 +156,7 @@ var Panel = function Panel() {
|
|
|
121
156
|
return function () {
|
|
122
157
|
context.$unsubscriber(context.topics.COMPONENT_ACTIVE, _id);
|
|
123
158
|
};
|
|
124
|
-
}, [
|
|
159
|
+
}, []);
|
|
125
160
|
useLayoutEffect(function () {
|
|
126
161
|
underLineRef.current.style.left = "".concat(activeTabRef.current.offsetLeft + activeTabRef.current.offsetWidth / 2 - 10, "px");
|
|
127
162
|
}, [activeTabKey, !!activeNode]);
|
|
@@ -134,9 +169,9 @@ var Panel = function Panel() {
|
|
|
134
169
|
style: {
|
|
135
170
|
fontSize: 12
|
|
136
171
|
}
|
|
137
|
-
}, activeNode === null || activeNode === void 0 ? void 0 : activeNode.level.map(function (
|
|
138
|
-
var id =
|
|
139
|
-
name =
|
|
172
|
+
}, activeNode === null || activeNode === void 0 ? void 0 : activeNode.level.map(function (_ref2) {
|
|
173
|
+
var id = _ref2.id,
|
|
174
|
+
name = _ref2.name;
|
|
140
175
|
return /*#__PURE__*/React.createElement(Breadcrumb.Item, {
|
|
141
176
|
key: id,
|
|
142
177
|
className: classNames(_defineProperty({}, styles['active-node-level'], id !== activeNode.node.id)),
|
|
@@ -161,7 +196,7 @@ var Panel = function Panel() {
|
|
|
161
196
|
className: classNames(styles['lc-painter-panel-tabbar'], _defineProperty({}, styles.hidden, !activeNode))
|
|
162
197
|
}, /*#__PURE__*/React.createElement("ul", {
|
|
163
198
|
className: styles.headerList
|
|
164
|
-
}, _TAB_LIST_.map(function (_item) {
|
|
199
|
+
}, (activeNode !== null && activeNode !== void 0 && activeNode.node.style ? _TAB_LIST_ : [_TAB_LIST_[0], _TAB_LIST_[2]]).map(function (_item) {
|
|
165
200
|
return /*#__PURE__*/React.createElement("li", {
|
|
166
201
|
key: _item.key,
|
|
167
202
|
ref: activeTabKey === _item.key ? activeTabRef : null,
|
|
@@ -174,7 +209,7 @@ var Panel = function Panel() {
|
|
|
174
209
|
ref: underLineRef,
|
|
175
210
|
className: styles.underline
|
|
176
211
|
})), activeTabKey === _TAB_LIST_[0].key && /*#__PURE__*/React.createElement("div", {
|
|
177
|
-
className: classNames(styles['lc-painter-panel-content'], _defineProperty({}, styles.hidden, !activeNode))
|
|
212
|
+
className: classNames(styles['lc-painter-panel-content'], _defineProperty(_defineProperty({}, styles.hidden, !activeNode), styles.showNext, open))
|
|
178
213
|
}, PropsComps, /*#__PURE__*/React.createElement(Drawer, {
|
|
179
214
|
visible: open,
|
|
180
215
|
width: 320,
|
|
@@ -200,7 +235,10 @@ var Panel = function Panel() {
|
|
|
200
235
|
type: "close"
|
|
201
236
|
})), /*#__PURE__*/React.createElement("div", {
|
|
202
237
|
className: styles['next-content-body']
|
|
203
|
-
}, (_nextRef$current2 = nextRef.current) === null || _nextRef$current2 === void 0 ? void 0 : _nextRef$current2.NextComp)))), activeTabKey === _TAB_LIST_[1].key && /*#__PURE__*/React.createElement(
|
|
238
|
+
}, (_nextRef$current2 = nextRef.current) === null || _nextRef$current2 === void 0 ? void 0 : _nextRef$current2.NextComp)))), activeTabKey === _TAB_LIST_[1].key && /*#__PURE__*/React.createElement(StylePanel, {
|
|
239
|
+
onChange: handleStyleChange,
|
|
240
|
+
value: activeNode === null || activeNode === void 0 ? void 0 : activeNode.node.style
|
|
241
|
+
}), activeTabKey === _TAB_LIST_[2].key && /*#__PURE__*/React.createElement("div", null, "\u9AD8\u7EA7\u9762\u677F"), /*#__PURE__*/React.createElement("div", {
|
|
204
242
|
className: classNames(styles['lc-painter-panel-empty'], _defineProperty({}, styles.hidden, !!activeNode))
|
|
205
243
|
}, "\u8BF7\u5728\u5DE6\u4FA7\u753B\u5E03\u9009\u4E2D\u8282\u70B9"));
|
|
206
244
|
};
|
|
File without changes
|
|
@@ -1,29 +1,88 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
|
+
import { useMemoizedFn, useCreation } from 'ahooks';
|
|
3
4
|
import styles from "../style/collapse.less";
|
|
4
|
-
import { Icon } from 'luck-design/antd';
|
|
5
|
+
import { Icon, Tooltip } from 'luck-design/antd';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Collapse 组件是一个可折叠区域的实现,用于显示或隐藏内容。它支持自定义标签、描述以及默认的折叠状态。
|
|
9
|
+
* 该组件还可以通过 `next` 函数来自定义点击操作,而不是简单地切换折叠状态。
|
|
10
|
+
* 提供的工具提示可以显示额外信息,如字段名和描述,以帮助用户更好地理解折叠内容的作用。
|
|
11
|
+
*
|
|
12
|
+
* @component
|
|
13
|
+
* @example
|
|
14
|
+
* <Collapse
|
|
15
|
+
* field="exampleField"
|
|
16
|
+
* label="示例标签"
|
|
17
|
+
* desc="这是一个用于演示的折叠组件"
|
|
18
|
+
* defaultCollapsed={true}
|
|
19
|
+
* next={() => console.log('Custom next function executed')}
|
|
20
|
+
* >
|
|
21
|
+
* <p>这里是可折叠的内容</p>
|
|
22
|
+
* </Collapse>
|
|
23
|
+
*
|
|
24
|
+
* @param {Object} props - 组件的属性。
|
|
25
|
+
* @param {React.ReactNode} children - 折叠区域展开时显示的内容。
|
|
26
|
+
* @param {string} [props.field] - 与折叠内容相关联的字段名。
|
|
27
|
+
* @param {string} props.label - 折叠区域的标签名称。
|
|
28
|
+
* @param {string} [props.desc] - 关于折叠内容的描述信息。
|
|
29
|
+
* @param {boolean} [props.defaultCollapsed=false] - 折叠区域的默认状态。如果为 true,则默认为折叠状态。
|
|
30
|
+
* @param {Function} [props.next] - 点击操作的自定义函数。如果提供,点击时将执行此函数,而不是切换折叠状态。
|
|
31
|
+
*
|
|
32
|
+
* @returns {ReactElement} 返回一个 React 元素,表示一个具有可折叠功能的容器。
|
|
33
|
+
*/
|
|
5
34
|
export default function (_ref) {
|
|
6
35
|
var children = _ref.children,
|
|
36
|
+
field = _ref.field,
|
|
7
37
|
label = _ref.label,
|
|
38
|
+
desc = _ref.desc,
|
|
8
39
|
_ref$defaultCollapsed = _ref.defaultCollapsed,
|
|
9
|
-
defaultCollapsed = _ref$defaultCollapsed === void 0 ? false : _ref$defaultCollapsed
|
|
40
|
+
defaultCollapsed = _ref$defaultCollapsed === void 0 ? false : _ref$defaultCollapsed,
|
|
41
|
+
next = _ref.next;
|
|
10
42
|
var _useState = useState(defaultCollapsed),
|
|
11
43
|
_useState2 = _slicedToArray(_useState, 2),
|
|
12
44
|
collapsed = _useState2[0],
|
|
13
45
|
setCollapsed = _useState2[1];
|
|
14
|
-
var handleClick = function
|
|
15
|
-
|
|
16
|
-
|
|
46
|
+
var handleClick = useMemoizedFn(function () {
|
|
47
|
+
if (next) {
|
|
48
|
+
next();
|
|
49
|
+
} else {
|
|
50
|
+
setCollapsed(!collapsed);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
var tip = useCreation(function () {
|
|
54
|
+
var str = void 0;
|
|
55
|
+
if (field) {
|
|
56
|
+
str = "\u5C5E\u6027\uFF1A".concat(field);
|
|
57
|
+
}
|
|
58
|
+
if (desc) {
|
|
59
|
+
str += "".concat(str ? ' | ' : '', "\u8BF4\u660E\uFF1A").concat(desc);
|
|
60
|
+
}
|
|
61
|
+
return str;
|
|
62
|
+
}, [field, desc]);
|
|
17
63
|
return /*#__PURE__*/React.createElement("div", {
|
|
18
64
|
className: styles['lc-painter-components-collapse']
|
|
19
65
|
}, /*#__PURE__*/React.createElement("div", {
|
|
20
66
|
className: styles['head'],
|
|
21
67
|
onClick: handleClick
|
|
68
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
69
|
+
overlayStyle: {
|
|
70
|
+
fontSize: '12px'
|
|
71
|
+
},
|
|
72
|
+
title: tip,
|
|
73
|
+
getPopupContainer: function getPopupContainer() {
|
|
74
|
+
return document.getElementById('lc-design-workspace');
|
|
75
|
+
}
|
|
22
76
|
}, /*#__PURE__*/React.createElement("span", {
|
|
23
|
-
className: styles['label']
|
|
24
|
-
|
|
77
|
+
className: styles['label'],
|
|
78
|
+
style: {
|
|
79
|
+
cursor: desc ? 'help' : 'default'
|
|
80
|
+
}
|
|
81
|
+
}, label)), /*#__PURE__*/React.createElement("span", {
|
|
25
82
|
className: styles['action']
|
|
26
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
83
|
+
}, next ? /*#__PURE__*/React.createElement(Icon, {
|
|
84
|
+
type: "right"
|
|
85
|
+
}) : /*#__PURE__*/React.createElement(Icon, {
|
|
27
86
|
type: collapsed ? 'down' : 'up'
|
|
28
87
|
}))), !collapsed && /*#__PURE__*/React.createElement("div", {
|
|
29
88
|
className: styles['body']
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
+
var _excluded = ["value", "onChange", "wrapperStyle"];
|
|
6
|
+
import React, { useState } from 'react';
|
|
7
|
+
import { useUpdateEffect } from 'ahooks';
|
|
8
|
+
import PopConfirm from "./PopConfirm";
|
|
9
|
+
import { Input } from 'luck-design/antd';
|
|
10
|
+
import styles from "../style/color-input.less";
|
|
11
|
+
import { SketchPicker } from 'react-color';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* ColorInput 组件是一个集成颜色选择器的输入框组件,允许用户以 RGBA 或十六进制格式输入颜色值。
|
|
15
|
+
* 组件内部通过 PopConfirm 弹出一个 SketchPicker 颜色选择器,以提供一个直观的颜色选择界面。
|
|
16
|
+
* 用户输入的颜色值在内部转换为适当的格式,并通过 onChange 回调暴露给外部使用。
|
|
17
|
+
* 此组件还支持通过传入的 value 属性初始化颜色值,并响应其后续更改。
|
|
18
|
+
*
|
|
19
|
+
* @component
|
|
20
|
+
* @example
|
|
21
|
+
* const handleColorChange = (newColor) => {
|
|
22
|
+
* console.log('Selected color:', newColor);
|
|
23
|
+
* };
|
|
24
|
+
* <ColorInput
|
|
25
|
+
* value="rgba(255, 0, 0, 0.5)"
|
|
26
|
+
* onChange={handleColorChange}
|
|
27
|
+
* wrapperStyle={{ margin: '20px' }}
|
|
28
|
+
* />
|
|
29
|
+
*
|
|
30
|
+
* @param {Object} props - 组件的属性。
|
|
31
|
+
* @param {string} props.value - 初始化颜色值,支持 RGBA 字符串或十六进制格式。
|
|
32
|
+
* @param {Function} props.onChange - 当颜色值变更时触发的回调函数。传递新的颜色值作为参数。
|
|
33
|
+
* @param {Object} [props.wrapperStyle] - 自定义包装器 div 的样式对象。
|
|
34
|
+
* @param {Object} rest - 传递给 Input 组件的其他属性。
|
|
35
|
+
*
|
|
36
|
+
* @returns {ReactElement} 返回一个 React 元素,表示一个带有颜色选择器的输入框组件。
|
|
37
|
+
*/
|
|
38
|
+
export default function (_ref) {
|
|
39
|
+
var value = _ref.value,
|
|
40
|
+
onChange = _ref.onChange,
|
|
41
|
+
wrapperStyle = _ref.wrapperStyle,
|
|
42
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
43
|
+
var _useState = useState(fromRGBA(value)),
|
|
44
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
45
|
+
color = _useState2[0],
|
|
46
|
+
setColor = _useState2[1];
|
|
47
|
+
var handleChange = function handleChange(color) {
|
|
48
|
+
changeColor(color.rgb);
|
|
49
|
+
};
|
|
50
|
+
var handleInputChange = function handleInputChange(e) {
|
|
51
|
+
changeColor(e.target.value);
|
|
52
|
+
};
|
|
53
|
+
var changeColor = function changeColor(value) {
|
|
54
|
+
if (onChange) onChange(toRGBA(value));
|
|
55
|
+
setColor(value);
|
|
56
|
+
};
|
|
57
|
+
useUpdateEffect(function () {
|
|
58
|
+
setColor(fromRGBA(value));
|
|
59
|
+
}, [value]);
|
|
60
|
+
var rgbaColor = toRGBA(color);
|
|
61
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
62
|
+
className: styles['lc-painter-components-color-input'],
|
|
63
|
+
style: wrapperStyle
|
|
64
|
+
}, /*#__PURE__*/React.createElement(PopConfirm, {
|
|
65
|
+
placement: "top",
|
|
66
|
+
title: /*#__PURE__*/React.createElement(SketchPicker, {
|
|
67
|
+
color: color !== null && color !== void 0 ? color : '#ffffff',
|
|
68
|
+
onChange: handleChange
|
|
69
|
+
})
|
|
70
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
className: styles['color-input-wrap']
|
|
72
|
+
}, /*#__PURE__*/React.createElement(Input, _extends({
|
|
73
|
+
onChange: handleInputChange,
|
|
74
|
+
className: styles['color-input'],
|
|
75
|
+
value: rgbaColor,
|
|
76
|
+
size: "small",
|
|
77
|
+
placeholder: "rgba(0,0,0,0)"
|
|
78
|
+
}, rest)), /*#__PURE__*/React.createElement("div", {
|
|
79
|
+
className: "color-display",
|
|
80
|
+
style: {
|
|
81
|
+
backgroundColor: rgbaColor
|
|
82
|
+
}
|
|
83
|
+
}))));
|
|
84
|
+
}
|
|
85
|
+
function toRGBA(colorObj) {
|
|
86
|
+
// 首先检查 colorObj 是否为 null 或 undefined
|
|
87
|
+
if (colorObj === null || typeof colorObj === 'undefined') {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// 检查是否为对象且包含 r, g, b, a 属性
|
|
92
|
+
if (_typeof(colorObj) === 'object' && 'r' in colorObj && 'g' in colorObj && 'b' in colorObj && 'a' in colorObj) {
|
|
93
|
+
return "rgba(".concat(colorObj.r, ", ").concat(colorObj.g, ", ").concat(colorObj.b, ", ").concat(colorObj.a, ")");
|
|
94
|
+
} else if (typeof colorObj === 'string' && colorObj.startsWith('#')) {
|
|
95
|
+
// 如果是以#号开头的字符串,则直接返回该字符串
|
|
96
|
+
return colorObj;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// 如果不符合上述任何一种情况,返回一个空字符串
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
function fromRGBA(rgbaString) {
|
|
103
|
+
if (rgbaString === null || typeof rgbaString === 'undefined') {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// 检查输入是否是有效的 rgba 字符串
|
|
108
|
+
var rgbaPattern = /rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d*\.?\d+)\)/;
|
|
109
|
+
var match = rgbaString.match(rgbaPattern);
|
|
110
|
+
if (match) {
|
|
111
|
+
// 如果匹配成功,则提取 rgba 值
|
|
112
|
+
return {
|
|
113
|
+
r: parseInt(match[1], 10),
|
|
114
|
+
g: parseInt(match[2], 10),
|
|
115
|
+
b: parseInt(match[3], 10),
|
|
116
|
+
a: parseFloat(match[4])
|
|
117
|
+
};
|
|
118
|
+
} else if (typeof rgbaString === 'string' && rgbaString.startsWith('#')) {
|
|
119
|
+
// 对于十六进制颜色字符串,直接返回原始字符串
|
|
120
|
+
return rgbaString;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// 如果不符合上述任何一种情况,返回 null
|
|
124
|
+
return null;
|
|
125
|
+
}
|