@luck-design-biz/luckda 0.0.24-2 → 0.0.24-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/Builder/index.js +27 -22
- package/es/components/LdAutoForm/index.js +15 -5
- package/es/components/LdFormList/index.js +4 -1
- package/es/components/LdGrid/index.js +15 -18
- package/es/components/LdGridForm/index.js +12 -4
- package/es/helper/form.js +8 -2
- package/es/helper/ldBuilder.js +4 -1
- package/es/lowcode/constants/api-url.js +1 -292
- package/es/lowcode/constants/event-topics.js +1 -14
- package/es/lowcode/engine/meta/button.props.default.json +7 -15
- package/es/lowcode/engine/meta/cardlist.props.default.json +9 -17
- package/{lib/lowcode/engine/meta/button.props.json → es/lowcode/engine/meta/components/button.json} +103 -126
- package/es/lowcode/engine/meta/{cardlist.props.json → components/card-list.json} +142 -143
- package/es/lowcode/engine/meta/{drawer.props.json → components/drawer.json} +142 -143
- package/es/lowcode/engine/meta/{form.props.json → components/form.json} +115 -116
- package/{lib/lowcode/engine/meta/iframe.props.json → es/lowcode/engine/meta/components/iframe.json} +30 -31
- package/{lib/lowcode/engine/meta/image.props.json → es/lowcode/engine/meta/components/image.json} +112 -113
- package/{lib/lowcode/engine/meta/imex.props.json → es/lowcode/engine/meta/components/imex.json} +80 -81
- package/es/lowcode/engine/meta/{jsx.props.json → components/jsx.json} +23 -24
- package/es/lowcode/engine/meta/{layout.props.json → components/layout.json} +106 -107
- package/{lib/lowcode/engine/meta/link.props.json → es/lowcode/engine/meta/components/link.json} +110 -111
- package/es/lowcode/engine/meta/{dialog.props.json → components/modal.json} +119 -120
- package/{lib/lowcode/engine/meta/section.props.json → es/lowcode/engine/meta/components/section.json} +106 -107
- package/{lib/lowcode/engine/meta/split.props.json → es/lowcode/engine/meta/components/split.json} +70 -71
- package/es/lowcode/{view/lc-components/CardList/meta.json → engine/meta/components/table.json} +28 -11
- package/{lib/lowcode/engine/meta/tabs.props.json → es/lowcode/engine/meta/components/tabs.json} +139 -140
- package/{lib/lowcode/engine/meta/text.props.json → es/lowcode/engine/meta/components/text.json} +64 -65
- package/es/lowcode/engine/meta/{tree.props.json → components/tree.json} +155 -156
- package/es/lowcode/engine/meta/components-list.json +121 -127
- package/es/lowcode/engine/meta/drawer.props.default.json +9 -17
- package/es/lowcode/engine/meta/form.props.default.json +4 -12
- package/es/lowcode/engine/meta/iframe.props.default.json +2 -10
- package/es/lowcode/engine/meta/image.props.default.json +7 -15
- package/es/lowcode/engine/meta/imex.props.default.json +3 -11
- package/es/lowcode/engine/meta/jsx.props.default.json +1 -10
- package/es/lowcode/engine/meta/layout.props.default.json +4 -12
- package/es/lowcode/engine/meta/link.props.default.json +5 -13
- package/es/lowcode/engine/meta/modal.props.default.json +11 -0
- package/es/lowcode/engine/meta/section.props.default.json +8 -16
- package/es/lowcode/engine/meta/split.props.default.json +4 -12
- package/es/lowcode/engine/meta/table.props.default.json +9 -29
- package/es/lowcode/engine/meta/tabs.props.default.json +9 -17
- package/es/lowcode/engine/meta/text.props.default.json +3 -11
- package/es/lowcode/engine/meta/tree.props.default.json +8 -16
- package/es/lowcode/engine/provider/ContextProvider.js +41 -46
- package/es/lowcode/engine/provider/EventBusProvider.js +2 -2
- package/es/lowcode/engine/tools/dataProcess.js +8 -85
- package/es/lowcode/engine/tools/helper.js +0 -68
- package/es/lowcode/engine/tools/lcid.js +16 -0
- package/es/lowcode/index.js +1 -3
- package/es/lowcode/painter/Design.js +85 -40
- package/es/lowcode/painter/I18n.js +2 -202
- package/es/lowcode/painter/Outline.js +54 -63
- package/es/lowcode/painter/Panel.js +2 -239
- package/es/lowcode/painter/Ribbon.js +55 -61
- package/es/lowcode/painter/components/PanelItem.js +11 -83
- package/es/lowcode/painter/components/RuleInput.js +7 -9
- package/es/lowcode/painter/index.js +3 -33
- package/es/lowcode/painter/panel-section/LayoutRatio.js +49 -57
- package/es/lowcode/painter/panel-section/Radio.js +58 -0
- package/es/lowcode/painter/style/design.less +5 -116
- package/es/lowcode/painter/style/index.less +1 -0
- package/es/lowcode/painter/style/layout-ratio.less +1 -1
- package/es/lowcode/painter/style/outline.less +0 -2
- package/es/lowcode/painter/style/panel-item.less +12 -45
- package/es/lowcode/painter/style/panel.less +0 -124
- package/es/lowcode/painter/style/ribbon.less +0 -1
- package/es/lowcode/view/Canvas.js +70 -79
- package/es/lowcode/view/Page.js +28 -10
- package/es/lowcode/view/index.js +6 -5
- package/es/lowcode/view/lc-components/Box/index.js +5 -22
- package/es/lowcode/view/lc-components/Button/index.js +7 -75
- package/es/lowcode/view/lc-components/Dialog/index.js +11 -20
- package/es/lowcode/view/lc-components/Dialog/index.less +1 -1
- package/es/lowcode/view/lc-components/Drawer/index.js +9 -22
- package/es/lowcode/view/lc-components/Layout/index.js +7 -40
- package/es/lowcode/view/lc-components/Table/index.js +9 -229
- package/es/lowcode/view/lc-components/Wrapper.js +23 -32
- package/es/lowcode/view/style/page.less +1 -0
- package/es/services.js +24 -7
- package/es/upload/Form/gridForm.js +5 -4
- package/es/upload/FormItem/index.js +4 -3
- package/es/utils/form.js +37 -3
- package/es/utils/grid.js +9 -8
- package/lib/components/Builder/index.js +25 -20
- package/lib/components/LdAutoForm/index.js +14 -4
- package/lib/components/LdFormList/index.js +5 -1
- package/lib/components/LdGrid/index.js +15 -18
- package/lib/components/LdGridForm/index.js +11 -3
- package/lib/helper/form.js +8 -2
- package/lib/helper/ldBuilder.js +4 -1
- package/lib/lowcode/constants/api-url.js +2 -294
- package/lib/lowcode/constants/event-topics.js +2 -15
- package/lib/lowcode/engine/meta/button.props.default.json +7 -15
- package/lib/lowcode/engine/meta/cardlist.props.default.json +9 -17
- package/{es/lowcode/engine/meta/button.props.json → lib/lowcode/engine/meta/components/button.json} +103 -126
- package/lib/lowcode/engine/meta/{cardlist.props.json → components/card-list.json} +142 -143
- package/lib/lowcode/engine/meta/{drawer.props.json → components/drawer.json} +142 -143
- package/lib/lowcode/engine/meta/{form.props.json → components/form.json} +115 -116
- package/{es/lowcode/engine/meta/iframe.props.json → lib/lowcode/engine/meta/components/iframe.json} +30 -31
- package/{es/lowcode/engine/meta/image.props.json → lib/lowcode/engine/meta/components/image.json} +112 -113
- package/{es/lowcode/engine/meta/imex.props.json → lib/lowcode/engine/meta/components/imex.json} +80 -81
- package/lib/lowcode/engine/meta/{jsx.props.json → components/jsx.json} +23 -24
- package/lib/lowcode/engine/meta/{layout.props.json → components/layout.json} +106 -107
- package/{es/lowcode/engine/meta/link.props.json → lib/lowcode/engine/meta/components/link.json} +110 -111
- package/lib/lowcode/engine/meta/{dialog.props.json → components/modal.json} +119 -120
- package/{es/lowcode/engine/meta/section.props.json → lib/lowcode/engine/meta/components/section.json} +106 -107
- package/{es/lowcode/engine/meta/split.props.json → lib/lowcode/engine/meta/components/split.json} +70 -71
- package/lib/lowcode/{view/lc-components/CardList/meta.json → engine/meta/components/table.json} +28 -11
- package/{es/lowcode/engine/meta/tabs.props.json → lib/lowcode/engine/meta/components/tabs.json} +139 -140
- package/{es/lowcode/engine/meta/text.props.json → lib/lowcode/engine/meta/components/text.json} +64 -65
- package/lib/lowcode/engine/meta/{tree.props.json → components/tree.json} +155 -156
- package/lib/lowcode/engine/meta/components-list.json +121 -127
- package/lib/lowcode/engine/meta/drawer.props.default.json +9 -17
- package/lib/lowcode/engine/meta/form.props.default.json +4 -12
- package/lib/lowcode/engine/meta/iframe.props.default.json +2 -10
- package/lib/lowcode/engine/meta/image.props.default.json +7 -15
- package/lib/lowcode/engine/meta/imex.props.default.json +3 -11
- package/lib/lowcode/engine/meta/jsx.props.default.json +1 -10
- package/lib/lowcode/engine/meta/layout.props.default.json +4 -12
- package/lib/lowcode/engine/meta/link.props.default.json +5 -13
- package/lib/lowcode/engine/meta/modal.props.default.json +11 -0
- package/lib/lowcode/engine/meta/section.props.default.json +8 -16
- package/lib/lowcode/engine/meta/split.props.default.json +4 -12
- package/lib/lowcode/engine/meta/table.props.default.json +9 -29
- package/lib/lowcode/engine/meta/tabs.props.default.json +9 -17
- package/lib/lowcode/engine/meta/text.props.default.json +3 -11
- package/lib/lowcode/engine/meta/tree.props.default.json +8 -16
- package/lib/lowcode/engine/provider/ContextProvider.js +41 -46
- package/lib/lowcode/engine/provider/EventBusProvider.js +2 -2
- package/lib/lowcode/engine/tools/dataProcess.js +8 -86
- package/lib/lowcode/engine/tools/helper.js +0 -70
- package/lib/lowcode/engine/tools/lcid.js +22 -0
- package/lib/lowcode/index.js +1 -5
- package/lib/lowcode/painter/Design.js +84 -39
- package/lib/lowcode/painter/I18n.js +2 -203
- package/lib/lowcode/painter/Outline.js +53 -62
- package/lib/lowcode/painter/Panel.js +1 -238
- package/lib/lowcode/painter/Ribbon.js +64 -63
- package/lib/lowcode/painter/components/PanelItem.js +11 -84
- package/lib/lowcode/painter/components/RuleInput.js +7 -9
- package/lib/lowcode/painter/index.js +3 -35
- package/lib/lowcode/painter/panel-section/LayoutRatio.js +48 -56
- package/lib/lowcode/painter/panel-section/Radio.js +65 -0
- package/lib/lowcode/painter/style/design.less +5 -116
- package/lib/lowcode/painter/style/index.less +1 -0
- package/lib/lowcode/painter/style/layout-ratio.less +1 -1
- package/lib/lowcode/painter/style/outline.less +0 -2
- package/lib/lowcode/painter/style/panel-item.less +12 -45
- package/lib/lowcode/painter/style/panel.less +0 -124
- package/lib/lowcode/painter/style/ribbon.less +0 -1
- package/lib/lowcode/view/Canvas.js +75 -84
- package/lib/lowcode/view/Page.js +27 -9
- package/lib/lowcode/view/index.js +6 -5
- package/lib/lowcode/view/lc-components/Box/index.js +6 -23
- package/lib/lowcode/view/lc-components/Button/index.js +8 -76
- package/lib/lowcode/view/lc-components/Dialog/index.js +11 -20
- package/lib/lowcode/view/lc-components/Dialog/index.less +1 -1
- package/lib/lowcode/view/lc-components/Drawer/index.js +9 -22
- package/lib/lowcode/view/lc-components/Layout/index.js +8 -41
- package/lib/lowcode/view/lc-components/Table/index.js +8 -228
- package/lib/lowcode/view/lc-components/Wrapper.js +21 -30
- package/lib/lowcode/view/style/page.less +1 -0
- package/lib/services.js +25 -7
- package/lib/upload/Form/gridForm.js +5 -4
- package/lib/upload/FormItem/index.js +4 -3
- package/lib/utils/form.js +38 -3
- package/lib/utils/grid.js +11 -10
- package/package.json +6 -15
- package/es/lowcode/engine/factory/panel-item-factory/DynamicStrategy.js +0 -60
- package/es/lowcode/engine/factory/panel-item-factory/GroupStrategy.js +0 -32
- package/es/lowcode/engine/factory/panel-item-factory/NumberStrategy.js +0 -32
- package/es/lowcode/engine/factory/panel-item-factory/SegmentedStrategy.js +0 -32
- package/es/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +0 -53
- package/es/lowcode/engine/factory/panel-item-factory/Strategy.js +0 -21
- package/es/lowcode/engine/factory/panel-item-factory/StringStrategy.js +0 -51
- package/es/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +0 -42
- package/es/lowcode/engine/factory/panel-item-factory/index.js +0 -44
- package/es/lowcode/engine/meta/box.props.default.json +0 -12
- package/es/lowcode/engine/meta/box.props.json +0 -42
- package/es/lowcode/engine/meta/dialog.props.default.json +0 -19
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +0 -29
- package/es/lowcode/engine/meta/table.props.json +0 -236
- package/es/lowcode/engine/tools/usePromiseState.js +0 -24
- package/es/lowcode/painter/DesignOperator.js +0 -271
- package/es/lowcode/painter/DesignToolbar.js +0 -91
- package/es/lowcode/painter/components/Collapse.js +0 -90
- package/es/lowcode/painter/components/ColorInput.js +0 -125
- package/es/lowcode/painter/components/ListEditor.js +0 -89
- package/es/lowcode/painter/components/NumberInput.js +0 -148
- package/es/lowcode/painter/components/PopConfirm.js +0 -23
- package/es/lowcode/painter/components/PopForm.js +0 -71
- package/es/lowcode/painter/components/SortBox.js +0 -92
- package/es/lowcode/painter/components/actions-editor/ActionEditor.js +0 -147
- package/es/lowcode/painter/components/actions-editor/index.js +0 -170
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +0 -96
- package/es/lowcode/painter/components/code-editor/CssEditor.js +0 -41
- package/es/lowcode/painter/components/code-editor/FullScreenEditor.js +0 -87
- package/es/lowcode/painter/components/code-editor/JSEditor.js +0 -106
- package/es/lowcode/painter/components/code-editor/index.js +0 -2
- package/es/lowcode/painter/panel-section/ButtonType.js +0 -39
- package/es/lowcode/painter/panel-section/DataSetSelector.js +0 -61
- package/es/lowcode/painter/panel-section/Icon.js +0 -48
- package/es/lowcode/painter/panel-section/IconSelector.js +0 -134
- package/es/lowcode/painter/panel-section/StylePanel/BackGround.js +0 -61
- package/es/lowcode/painter/panel-section/StylePanel/Border.js +0 -150
- package/es/lowcode/painter/panel-section/StylePanel/BorderRadius.js +0 -87
- package/es/lowcode/painter/panel-section/StylePanel/BorderRadiusSelector.js +0 -66
- package/es/lowcode/painter/panel-section/StylePanel/BorderSelector.js +0 -66
- package/es/lowcode/painter/panel-section/StylePanel/Display.js +0 -296
- package/es/lowcode/painter/panel-section/StylePanel/DisplaySvg.js +0 -543
- package/es/lowcode/painter/panel-section/StylePanel/Font.js +0 -162
- package/es/lowcode/painter/panel-section/StylePanel/FontEditor.js +0 -386
- package/es/lowcode/painter/panel-section/StylePanel/GapSelector.js +0 -78
- package/es/lowcode/painter/panel-section/StylePanel/HighLightPanel.js +0 -23
- package/es/lowcode/painter/panel-section/StylePanel/HighLigthtSpan.js +0 -20
- package/es/lowcode/painter/panel-section/StylePanel/HightLightSvg.js +0 -23
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +0 -96
- package/es/lowcode/painter/panel-section/StylePanel/Margin.js +0 -60
- package/es/lowcode/painter/panel-section/StylePanel/Opacity.js +0 -50
- package/es/lowcode/painter/panel-section/StylePanel/Padding.js +0 -61
- package/es/lowcode/painter/panel-section/StylePanel/Pointer.js +0 -41
- package/es/lowcode/painter/panel-section/StylePanel/Shadow.js +0 -216
- package/es/lowcode/painter/panel-section/StylePanel/Size.js +0 -53
- package/es/lowcode/painter/panel-section/StylePanel/StyleContext.js +0 -148
- package/es/lowcode/painter/panel-section/StylePanel/StyleRow.js +0 -16
- package/es/lowcode/painter/panel-section/StylePanel/WidthHeight.js +0 -51
- package/es/lowcode/painter/panel-section/StylePanel/index.js +0 -29
- package/es/lowcode/painter/panel-section/TabItems.js +0 -207
- package/es/lowcode/painter/panel-section/TableActions.js +0 -19
- package/es/lowcode/painter/panel-section/TableZebra.js +0 -14
- package/es/lowcode/painter/panel-section/WidthHeight.js +0 -39
- package/es/lowcode/painter/services/I18n.js +0 -85
- package/es/lowcode/painter/style/actions-editor.less +0 -16
- package/es/lowcode/painter/style/border-editor.less +0 -36
- package/es/lowcode/painter/style/border-radius-selector.less +0 -43
- package/es/lowcode/painter/style/border-selector.less +0 -40
- package/es/lowcode/painter/style/button-type.less +0 -5
- package/es/lowcode/painter/style/collapse.less +0 -22
- package/es/lowcode/painter/style/color-input.less +0 -19
- package/es/lowcode/painter/style/display.less +0 -17
- package/es/lowcode/painter/style/font-editor.less +0 -9
- package/es/lowcode/painter/style/fullscreen-editor.less +0 -17
- package/es/lowcode/painter/style/icon-selector.less +0 -22
- package/es/lowcode/painter/style/icon.less +0 -11
- package/es/lowcode/painter/style/list-editor.less +0 -59
- package/es/lowcode/painter/style/number-input.less +0 -17
- package/es/lowcode/painter/style/pop-confirm.less +0 -10
- package/es/lowcode/painter/style/pop-form.less +0 -20
- package/es/lowcode/painter/style/style-panel.less +0 -37
- package/es/lowcode/painter/style/tabitems.less +0 -90
- package/es/lowcode/view/lc-components/Box/FunctionDesign.js +0 -20
- package/es/lowcode/view/lc-components/Box/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Box/index.less +0 -15
- package/es/lowcode/view/lc-components/Box/meta.json +0 -42
- package/es/lowcode/view/lc-components/Button/FunctionDesign.js +0 -21
- package/es/lowcode/view/lc-components/Button/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Button/meta.json +0 -127
- package/es/lowcode/view/lc-components/Button/style.less +0 -3
- package/es/lowcode/view/lc-components/CardList/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/CardList/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +0 -54
- package/es/lowcode/view/lc-components/Dialog/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Dialog/meta.json +0 -121
- package/es/lowcode/view/lc-components/Drawer/FunctionDesign.js +0 -20
- package/es/lowcode/view/lc-components/Drawer/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Drawer/index.less +0 -7
- package/es/lowcode/view/lc-components/Drawer/meta.json +0 -144
- package/es/lowcode/view/lc-components/Form/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Form/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Form/meta.json +0 -117
- package/es/lowcode/view/lc-components/Iframe/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Iframe/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Iframe/meta.json +0 -32
- package/es/lowcode/view/lc-components/ImEx/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/ImEx/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/ImEx/meta.json +0 -82
- package/es/lowcode/view/lc-components/Image/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Image/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Image/meta.json +0 -114
- package/es/lowcode/view/lc-components/JSX/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/JSX/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/JSX/meta.json +0 -25
- package/es/lowcode/view/lc-components/Layout/FunctionDesign.js +0 -75
- package/es/lowcode/view/lc-components/Layout/FunctionLive.js +0 -15
- package/es/lowcode/view/lc-components/Layout/index.less +0 -5
- package/es/lowcode/view/lc-components/Layout/meta.json +0 -108
- package/es/lowcode/view/lc-components/Link/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Link/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Link/meta.json +0 -112
- package/es/lowcode/view/lc-components/Section/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Section/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Section/meta.json +0 -108
- package/es/lowcode/view/lc-components/Split/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Split/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Split/meta.json +0 -72
- package/es/lowcode/view/lc-components/Table/FunctionDesign.js +0 -18
- package/es/lowcode/view/lc-components/Table/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Table/meta.json +0 -225
- package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Tabs/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Tabs/meta.json +0 -141
- package/es/lowcode/view/lc-components/Text/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Text/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Text/meta.json +0 -66
- package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +0 -9
- package/es/lowcode/view/lc-components/Tree/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Tree/meta.json +0 -157
- package/lib/lowcode/engine/factory/panel-item-factory/DynamicStrategy.js +0 -73
- package/lib/lowcode/engine/factory/panel-item-factory/GroupStrategy.js +0 -38
- package/lib/lowcode/engine/factory/panel-item-factory/NumberStrategy.js +0 -38
- package/lib/lowcode/engine/factory/panel-item-factory/SegmentedStrategy.js +0 -38
- package/lib/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +0 -59
- package/lib/lowcode/engine/factory/panel-item-factory/Strategy.js +0 -27
- package/lib/lowcode/engine/factory/panel-item-factory/StringStrategy.js +0 -57
- package/lib/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +0 -48
- package/lib/lowcode/engine/factory/panel-item-factory/index.js +0 -50
- package/lib/lowcode/engine/meta/box.props.default.json +0 -12
- package/lib/lowcode/engine/meta/box.props.json +0 -42
- package/lib/lowcode/engine/meta/dialog.props.default.json +0 -19
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +0 -29
- package/lib/lowcode/engine/meta/table.props.json +0 -236
- package/lib/lowcode/engine/tools/usePromiseState.js +0 -31
- package/lib/lowcode/painter/DesignOperator.js +0 -278
- package/lib/lowcode/painter/DesignToolbar.js +0 -99
- package/lib/lowcode/painter/components/Collapse.js +0 -97
- package/lib/lowcode/painter/components/ColorInput.js +0 -132
- package/lib/lowcode/painter/components/ListEditor.js +0 -95
- package/lib/lowcode/painter/components/NumberInput.js +0 -155
- package/lib/lowcode/painter/components/PopConfirm.js +0 -29
- package/lib/lowcode/painter/components/PopForm.js +0 -77
- package/lib/lowcode/painter/components/SortBox.js +0 -99
- package/lib/lowcode/painter/components/actions-editor/ActionEditor.js +0 -155
- package/lib/lowcode/painter/components/actions-editor/index.js +0 -178
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +0 -103
- package/lib/lowcode/painter/components/code-editor/CssEditor.js +0 -48
- package/lib/lowcode/painter/components/code-editor/FullScreenEditor.js +0 -94
- package/lib/lowcode/painter/components/code-editor/JSEditor.js +0 -117
- package/lib/lowcode/painter/components/code-editor/index.js +0 -20
- package/lib/lowcode/painter/panel-section/ButtonType.js +0 -46
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +0 -69
- package/lib/lowcode/painter/panel-section/Icon.js +0 -54
- package/lib/lowcode/painter/panel-section/IconSelector.js +0 -141
- package/lib/lowcode/painter/panel-section/StylePanel/BackGround.js +0 -68
- package/lib/lowcode/painter/panel-section/StylePanel/Border.js +0 -158
- package/lib/lowcode/painter/panel-section/StylePanel/BorderRadius.js +0 -95
- package/lib/lowcode/painter/panel-section/StylePanel/BorderRadiusSelector.js +0 -73
- package/lib/lowcode/painter/panel-section/StylePanel/BorderSelector.js +0 -73
- package/lib/lowcode/painter/panel-section/StylePanel/Display.js +0 -303
- package/lib/lowcode/painter/panel-section/StylePanel/DisplaySvg.js +0 -550
- package/lib/lowcode/painter/panel-section/StylePanel/Font.js +0 -170
- package/lib/lowcode/painter/panel-section/StylePanel/FontEditor.js +0 -392
- package/lib/lowcode/painter/panel-section/StylePanel/GapSelector.js +0 -85
- package/lib/lowcode/painter/panel-section/StylePanel/HighLightPanel.js +0 -29
- package/lib/lowcode/painter/panel-section/StylePanel/HighLigthtSpan.js +0 -26
- package/lib/lowcode/painter/panel-section/StylePanel/HightLightSvg.js +0 -29
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +0 -103
- package/lib/lowcode/painter/panel-section/StylePanel/Margin.js +0 -67
- package/lib/lowcode/painter/panel-section/StylePanel/Opacity.js +0 -57
- package/lib/lowcode/painter/panel-section/StylePanel/Padding.js +0 -68
- package/lib/lowcode/painter/panel-section/StylePanel/Pointer.js +0 -48
- package/lib/lowcode/painter/panel-section/StylePanel/Shadow.js +0 -224
- package/lib/lowcode/painter/panel-section/StylePanel/Size.js +0 -59
- package/lib/lowcode/painter/panel-section/StylePanel/StyleContext.js +0 -159
- package/lib/lowcode/painter/panel-section/StylePanel/StyleRow.js +0 -22
- package/lib/lowcode/painter/panel-section/StylePanel/WidthHeight.js +0 -58
- package/lib/lowcode/painter/panel-section/StylePanel/index.js +0 -35
- package/lib/lowcode/painter/panel-section/TabItems.js +0 -215
- package/lib/lowcode/painter/panel-section/TableActions.js +0 -26
- package/lib/lowcode/painter/panel-section/TableZebra.js +0 -21
- package/lib/lowcode/painter/panel-section/WidthHeight.js +0 -46
- package/lib/lowcode/painter/services/I18n.js +0 -95
- package/lib/lowcode/painter/style/actions-editor.less +0 -16
- package/lib/lowcode/painter/style/border-editor.less +0 -36
- package/lib/lowcode/painter/style/border-radius-selector.less +0 -43
- package/lib/lowcode/painter/style/border-selector.less +0 -40
- package/lib/lowcode/painter/style/button-type.less +0 -5
- package/lib/lowcode/painter/style/collapse.less +0 -22
- package/lib/lowcode/painter/style/color-input.less +0 -19
- package/lib/lowcode/painter/style/display.less +0 -17
- package/lib/lowcode/painter/style/font-editor.less +0 -9
- package/lib/lowcode/painter/style/fullscreen-editor.less +0 -17
- package/lib/lowcode/painter/style/icon-selector.less +0 -22
- package/lib/lowcode/painter/style/icon.less +0 -11
- package/lib/lowcode/painter/style/list-editor.less +0 -59
- package/lib/lowcode/painter/style/number-input.less +0 -17
- package/lib/lowcode/painter/style/pop-confirm.less +0 -10
- package/lib/lowcode/painter/style/pop-form.less +0 -20
- package/lib/lowcode/painter/style/style-panel.less +0 -37
- package/lib/lowcode/painter/style/tabitems.less +0 -90
- package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +0 -27
- package/lib/lowcode/view/lc-components/Box/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Box/index.less +0 -15
- package/lib/lowcode/view/lc-components/Box/meta.json +0 -42
- package/lib/lowcode/view/lc-components/Button/FunctionDesign.js +0 -28
- package/lib/lowcode/view/lc-components/Button/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Button/meta.json +0 -127
- package/lib/lowcode/view/lc-components/Button/style.less +0 -3
- package/lib/lowcode/view/lc-components/CardList/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/CardList/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +0 -62
- package/lib/lowcode/view/lc-components/Dialog/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Dialog/meta.json +0 -121
- package/lib/lowcode/view/lc-components/Drawer/FunctionDesign.js +0 -27
- package/lib/lowcode/view/lc-components/Drawer/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Drawer/index.less +0 -7
- package/lib/lowcode/view/lc-components/Drawer/meta.json +0 -144
- package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Form/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Form/meta.json +0 -117
- package/lib/lowcode/view/lc-components/Iframe/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Iframe/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Iframe/meta.json +0 -32
- package/lib/lowcode/view/lc-components/ImEx/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/ImEx/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/ImEx/meta.json +0 -82
- package/lib/lowcode/view/lc-components/Image/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Image/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Image/meta.json +0 -114
- package/lib/lowcode/view/lc-components/JSX/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/JSX/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/JSX/meta.json +0 -25
- package/lib/lowcode/view/lc-components/Layout/FunctionDesign.js +0 -82
- package/lib/lowcode/view/lc-components/Layout/FunctionLive.js +0 -22
- package/lib/lowcode/view/lc-components/Layout/index.less +0 -5
- package/lib/lowcode/view/lc-components/Layout/meta.json +0 -108
- package/lib/lowcode/view/lc-components/Link/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Link/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Link/meta.json +0 -112
- package/lib/lowcode/view/lc-components/Section/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Section/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Section/meta.json +0 -108
- package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Split/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Split/meta.json +0 -72
- package/lib/lowcode/view/lc-components/Table/FunctionDesign.js +0 -25
- package/lib/lowcode/view/lc-components/Table/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Table/meta.json +0 -225
- package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Tabs/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Tabs/meta.json +0 -141
- package/lib/lowcode/view/lc-components/Text/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Text/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Text/meta.json +0 -66
- package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +0 -16
- package/lib/lowcode/view/lc-components/Tree/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Tree/meta.json +0 -157
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import React, { useState } from 'react';
|
|
3
|
-
import { useMemoizedFn, useCreation } from 'ahooks';
|
|
4
|
-
import styles from "../style/collapse.less";
|
|
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
|
-
*/
|
|
34
|
-
export default function (_ref) {
|
|
35
|
-
var children = _ref.children,
|
|
36
|
-
field = _ref.field,
|
|
37
|
-
label = _ref.label,
|
|
38
|
-
desc = _ref.desc,
|
|
39
|
-
_ref$defaultCollapsed = _ref.defaultCollapsed,
|
|
40
|
-
defaultCollapsed = _ref$defaultCollapsed === void 0 ? false : _ref$defaultCollapsed,
|
|
41
|
-
next = _ref.next;
|
|
42
|
-
var _useState = useState(defaultCollapsed),
|
|
43
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
44
|
-
collapsed = _useState2[0],
|
|
45
|
-
setCollapsed = _useState2[1];
|
|
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]);
|
|
63
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
64
|
-
className: styles['lc-painter-components-collapse']
|
|
65
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
66
|
-
className: styles['head'],
|
|
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
|
-
}
|
|
76
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
77
|
-
className: styles['label'],
|
|
78
|
-
style: {
|
|
79
|
-
cursor: desc ? 'help' : 'default'
|
|
80
|
-
}
|
|
81
|
-
}, label)), /*#__PURE__*/React.createElement("span", {
|
|
82
|
-
className: styles['action']
|
|
83
|
-
}, next ? /*#__PURE__*/React.createElement(Icon, {
|
|
84
|
-
type: "right"
|
|
85
|
-
}) : /*#__PURE__*/React.createElement(Icon, {
|
|
86
|
-
type: collapsed ? 'down' : 'up'
|
|
87
|
-
}))), !collapsed && /*#__PURE__*/React.createElement("div", {
|
|
88
|
-
className: styles['body']
|
|
89
|
-
}, children));
|
|
90
|
-
}
|
|
@@ -1,125 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Icon } from 'luck-design/antd';
|
|
4
|
-
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
5
|
-
import styles from "../style/list-editor.less";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* ListEditor 是一个用于管理和展示一组可编辑标签项的容器组件。
|
|
9
|
-
* 它提供了一个添加新标签项的操作按钮,并通过 children 属性接收一组 ListEditorItem 组件。
|
|
10
|
-
*
|
|
11
|
-
* @param {Object} props - 组件接收的属性。
|
|
12
|
-
* @param {ReactNode} props.children - ListEditorItem 组件的实例,表示可编辑的标签项。
|
|
13
|
-
* @param {Function} props.handleAdd - 一个回调函数,当用户点击添加按钮时被触发,用于添加新的标签项。
|
|
14
|
-
* @returns {ReactNode} 渲染一个带有操作按钮和标签项的容器。
|
|
15
|
-
*/
|
|
16
|
-
export var ListEditor = function ListEditor(_ref) {
|
|
17
|
-
var children = _ref.children,
|
|
18
|
-
addText = _ref.addText,
|
|
19
|
-
handleAdd = _ref.handleAdd;
|
|
20
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
21
|
-
className: styles['lc-painter-panel-section-components-listeditor']
|
|
22
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
23
|
-
className: styles['list-box']
|
|
24
|
-
}, children), /*#__PURE__*/React.createElement("div", {
|
|
25
|
-
className: styles['list-actions']
|
|
26
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
27
|
-
className: styles['list-action'],
|
|
28
|
-
onClick: handleAdd
|
|
29
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
30
|
-
type: "plus-circle"
|
|
31
|
-
}), ' ', addText || formatMessage({
|
|
32
|
-
id: 'luckda.lowcode.painter.panel-section.components.listeditor.add',
|
|
33
|
-
label: '添加一项'
|
|
34
|
-
}))));
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* ListEditorItem 是一个可编辑的标签项组件,用于在 ListEditor 容器内展示。
|
|
39
|
-
* 它支持拖拽排序,并可以通过左侧和右侧的插槽来自定义内容。
|
|
40
|
-
*
|
|
41
|
-
* @param {Object} props - 组件接收的属性。
|
|
42
|
-
* @param {Object} props.item - 表示标签项数据的对象。
|
|
43
|
-
* @param {ReactNode} props.left - 放置在标签项左侧的内容,通常用于展示标签名称或其他信息。
|
|
44
|
-
* @param {ReactNode} props.right - 放置在标签项右侧的内容,通常用于展示操作按钮如编辑或删除。
|
|
45
|
-
* @param {Function} props.setNodeRef - 用于设置拖拽组件根节点的引用。
|
|
46
|
-
* @param {Function} props.setActivatorNodeRef - 用于设置激活拖拽操作的节点引用。
|
|
47
|
-
* @param {Object} props.style - 应用于标签项的样式对象,通常包含拖拽过程中的动态变化样式。
|
|
48
|
-
* @param {Object} props.attributes - 包含与拖拽相关的HTML属性。
|
|
49
|
-
* @param {Object} props.listeners - 包含处理拖拽事件的监听器。
|
|
50
|
-
* @param {CSSProperties} props.transform - 应用于组件的CSS变换属性,用于实现拖拽效果。
|
|
51
|
-
* @param {string} props.transition - 定义拖拽动画的CSS过渡属性。
|
|
52
|
-
* @returns {ReactNode} 渲染一个可编辑的标签项,支持拖拽排序。
|
|
53
|
-
*/
|
|
54
|
-
export var ListEditorItem = function ListEditorItem(_ref2) {
|
|
55
|
-
var item = _ref2.item,
|
|
56
|
-
left = _ref2.left,
|
|
57
|
-
right = _ref2.right,
|
|
58
|
-
setNodeRef = _ref2.setNodeRef,
|
|
59
|
-
setActivatorNodeRef = _ref2.setActivatorNodeRef,
|
|
60
|
-
style = _ref2.style,
|
|
61
|
-
attributes = _ref2.attributes,
|
|
62
|
-
listeners = _ref2.listeners,
|
|
63
|
-
transform = _ref2.transform,
|
|
64
|
-
transition = _ref2.transition;
|
|
65
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
66
|
-
ref: setNodeRef,
|
|
67
|
-
style: style,
|
|
68
|
-
className: styles['list-item']
|
|
69
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
70
|
-
className: styles['list-item-left']
|
|
71
|
-
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
72
|
-
ref: setActivatorNodeRef
|
|
73
|
-
}, attributes, listeners, {
|
|
74
|
-
className: styles['dragicon']
|
|
75
|
-
}), /*#__PURE__*/React.createElement("svg", {
|
|
76
|
-
fill: "currentColor",
|
|
77
|
-
preserveAspectRatio: "xMidYMid meet",
|
|
78
|
-
width: "16",
|
|
79
|
-
height: "12",
|
|
80
|
-
viewBox: "0 0 5 12",
|
|
81
|
-
style: {
|
|
82
|
-
verticalAlign: 'middle'
|
|
83
|
-
}
|
|
84
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
85
|
-
d: "M0.499972716,6 L1.50002728,6 C1.77615459,6 2,6.22384541 2,6.49997272 C2,6.77610002 1.77615459,6.99994543 1.50002728,6.99994543 L0.499972716,6.99994543 C0.22384541,6.99994543 3.38158422e-17,6.77610002 0,6.49997272 C-3.38158422e-17,6.22384541 0.22384541,6 0.499972716,6 Z M0.499972716,3 L1.50002728,3 C1.77615459,3 2,3.22384541 2,3.49997272 C2,3.77610002 1.77615459,3.99994543 1.50002728,3.99994543 L0.499972716,3.99994543 C0.22384541,3.99994543 3.38158422e-17,3.77610002 0,3.49997272 C-3.38158422e-17,3.22384541 0.22384541,3 0.499972716,3 Z M0.499972716,7.28787148e-18 L1.50002728,5.55666624e-14 C1.77615459,7.07214574e-14 2,0.22384541 2,0.499972716 C2,0.776100022 1.77615459,0.999945432 1.50002728,0.999945432 L0.499972716,0.999945432 C0.22384541,0.999945432 3.38158422e-17,0.776100022 0,0.499972716 C-3.38158422e-17,0.22384541 0.22384541,5.0723721e-17 0.499972716,0 Z M0.5,9.00002729 L1.5,9.00002729 C1.77614237,9.00002729 2,9.22388491 2,9.50002729 C2,9.77616966 1.77614237,10.0000273 1.5,10.0000273 L0.5,10.0000273 C0.223857625,10.0000273 3.38176876e-17,9.77616966 0,9.50002729 C-3.38176876e-17,9.22388491 0.223857625,9.00002729 0.5,9.00002729 Z M0.5,12.0000273 L1.5,12.0000273 C1.77614237,12.0000273 2,12.2238849 2,12.5000273 C2,12.7761697 1.77614237,13.0000273 1.5,13.0000273 L0.5,13.0000273 C0.223857625,13.0000273 3.38176876e-17,12.7761697 0,12.5000273 C-3.38176876e-17,12.2238849 0.223857625,12.0000273 0.5,12.0000273 Z M0.5,15.0000273 L1.5,15.0000273 C1.77614237,15.0000273 2,15.2238849 2,15.5000273 C2,15.7761697 1.77614237,16.0000273 1.5,16.0000273 L0.5,16.0000273 C0.223857625,16.0000273 3.38176876e-17,15.7761697 0,15.5000273 C-3.38176876e-17,15.2238849 0.223857625,15.0000273 0.5,15.0000273 Z M3.49997272,6 L4.50002728,6 C4.77615459,6 5,6.22384541 5,6.49997272 C5,6.77610002 4.77615459,6.99994543 4.50002728,6.99994543 L3.49997272,6.99994543 C3.22384541,6.99994543 3,6.77610002 3,6.49997272 C3,6.22384541 3.22384541,6 3.49997272,6 Z M3.49997272,3 L4.50002728,3 C4.77615459,3 5,3.22384541 5,3.49997272 C5,3.77610002 4.77615459,3.99994543 4.50002728,3.99994543 L3.49997272,3.99994543 C3.22384541,3.99994543 3,3.77610002 3,3.49997272 C3,3.22384541 3.22384541,3 3.49997272,3 Z M3.49997272,7.28787148e-18 L4.50002728,5.55666624e-14 C4.77615459,7.07214574e-14 5,0.22384541 5,0.499972716 C5,0.776100022 4.77615459,0.999945432 4.50002728,0.999945432 L3.49997272,0.999945432 C3.22384541,0.999945432 3,0.776100022 3,0.499972716 C3,0.22384541 3.22384541,5.0723721e-17 3.49997272,0 Z M3.5,9.00002729 L4.5,9.00002729 C4.77614237,9.00002729 5,9.22388491 5,9.50002729 C5,9.77616966 4.77614237,10.0000273 4.5,10.0000273 L3.5,10.0000273 C3.22385763,10.0000273 3,9.77616966 3,9.50002729 C3,9.22388491 3.22385763,9.00002729 3.5,9.00002729 Z M3.5,12.0000273 L4.5,12.0000273 C4.77614237,12.0000273 5,12.2238849 5,12.5000273 C5,12.7761697 4.77614237,13.0000273 4.5,13.0000273 L3.5,13.0000273 C3.22385763,13.0000273 3,12.7761697 3,12.5000273 C3,12.2238849 3.22385763,12.0000273 3.5,12.0000273 Z M3.5,15.0000273 L4.5,15.0000273 C4.77614237,15.0000273 5,15.2238849 5,15.5000273 C5,15.7761697 4.77614237,16.0000273 4.5,16.0000273 L3.5,16.0000273 C3.22385763,16.0000273 3,15.7761697 3,15.5000273 C3,15.2238849 3.22385763,15.0000273 3.5,15.0000273 Z"
|
|
86
|
-
}))), left), /*#__PURE__*/React.createElement("div", {
|
|
87
|
-
className: styles['list-item-right']
|
|
88
|
-
}, right));
|
|
89
|
-
};
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["value", "options", "onChange", "defaultValue", "allowNull", "convertInt"];
|
|
5
|
-
import React, { useState } from 'react';
|
|
6
|
-
import { useUpdateEffect } from 'ahooks';
|
|
7
|
-
import styles from "../style/number-input.less";
|
|
8
|
-
import { InputNumber, Dropdown, Menu } from 'luck-design/antd';
|
|
9
|
-
import { isNil } from 'lodash';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* NumberInput 组件是一个带单位选择的数字输入框组件,允许用户输入一个数值并从预定义的选项中选择一个单位。
|
|
13
|
-
* 它支持默认值、空值、自动类型转换以及自定义更改处理逻辑。
|
|
14
|
-
* 组件内部通过 Dropdown 组件提供一个单位的下拉选择菜单,并通过 InputNumber 接收数值输入。
|
|
15
|
-
* 该组件也支持将输入值转换为整数或保持为原始格式,并允许通过 options 定制可选单位。
|
|
16
|
-
*
|
|
17
|
-
* @component
|
|
18
|
-
* @example
|
|
19
|
-
* const options = [{ value: 'px', label: '像素' }, { value: '%', label: '百分比' }];
|
|
20
|
-
* <NumberInput
|
|
21
|
-
* value={100}
|
|
22
|
-
* options={options}
|
|
23
|
-
* onChange={(newValue) => console.log('New value:', newValue)}
|
|
24
|
-
* defaultValue={0}
|
|
25
|
-
* allowNull={true}
|
|
26
|
-
* convertInt={false}
|
|
27
|
-
* />
|
|
28
|
-
*
|
|
29
|
-
* @param {Object} props - 组件的属性。
|
|
30
|
-
* @param {number|string} props.value - 初始化输入框的值。
|
|
31
|
-
* @param {Object[]} props.options - 可选单位的数组,每个对象包含 value(单位的值)和 label(显示在下拉菜单中的标签)。
|
|
32
|
-
* @param {Function} props.onChange - 当输入值或单位改变时触发的回调函数。传递新的值作为参数。
|
|
33
|
-
* @param {number|string} [props.defaultValue] - 未指定 value 时的默认值。
|
|
34
|
-
* @param {boolean} [props.allowNull=true] - 是否允许空值。
|
|
35
|
-
* @param {boolean} [props.convertInt=false] - 是否将输入值转换为整数。
|
|
36
|
-
* @param {Object} rest - 传递给 InputNumber 组件的其他属性。
|
|
37
|
-
*
|
|
38
|
-
* @returns {ReactElement} 返回一个 React 元素,表示一个带单位选择的数字输入框组件。
|
|
39
|
-
*/
|
|
40
|
-
export default function (_ref) {
|
|
41
|
-
var value = _ref.value,
|
|
42
|
-
options = _ref.options,
|
|
43
|
-
onChange = _ref.onChange,
|
|
44
|
-
defaultValue = _ref.defaultValue,
|
|
45
|
-
_ref$allowNull = _ref.allowNull,
|
|
46
|
-
allowNull = _ref$allowNull === void 0 ? true : _ref$allowNull,
|
|
47
|
-
_ref$convertInt = _ref.convertInt,
|
|
48
|
-
convertInt = _ref$convertInt === void 0 ? false : _ref$convertInt,
|
|
49
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
50
|
-
var _useState = useState(value !== null && value !== void 0 ? value : defaultValue),
|
|
51
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
52
|
-
val = _useState2[0],
|
|
53
|
-
setVal = _useState2[1];
|
|
54
|
-
useUpdateEffect(function () {
|
|
55
|
-
setVal(value);
|
|
56
|
-
}, [value]);
|
|
57
|
-
var _parseValue = parseValue(val, options),
|
|
58
|
-
number = _parseValue.number,
|
|
59
|
-
unit = _parseValue.unit;
|
|
60
|
-
var handleSelect = function handleSelect(item) {
|
|
61
|
-
var newValue;
|
|
62
|
-
if (item.key == 'auto') newValue = item.key;else if (isNaN(number)) {
|
|
63
|
-
var defaultNumber = defaultValue !== null && defaultValue !== void 0 ? defaultValue : 0;
|
|
64
|
-
if (isNaN(defaultNumber)) {
|
|
65
|
-
var match = defaultNumber.match(/[\d\.]+/);
|
|
66
|
-
defaultNumber = match ? parseFloat(match[0]) : 0;
|
|
67
|
-
}
|
|
68
|
-
newValue = defaultNumber + item.key;
|
|
69
|
-
} else {
|
|
70
|
-
newValue = number + item.key;
|
|
71
|
-
}
|
|
72
|
-
changeValue(newValue);
|
|
73
|
-
};
|
|
74
|
-
var handleChange = function handleChange(value) {
|
|
75
|
-
if (!isNil(value)) changeValue(value + (unit !== null && unit !== void 0 ? unit : options[0].value));else changeValue(null);
|
|
76
|
-
};
|
|
77
|
-
var changeValue = function changeValue(value) {
|
|
78
|
-
// 分离需要数字前缀的值和不需要数字前缀的值(如auto)
|
|
79
|
-
var numericValues = options.filter(function (option) {
|
|
80
|
-
return option.value !== 'auto';
|
|
81
|
-
}).map(function (option) {
|
|
82
|
-
return option.value.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
83
|
-
}).join('|');
|
|
84
|
-
|
|
85
|
-
// 构建正则表达式
|
|
86
|
-
var regex = new RegExp("^(\\d*(?:".concat(numericValues, ")|auto)$"));
|
|
87
|
-
var isValid = regex.test(value);
|
|
88
|
-
if (isValid || allowNull && (value === '' || value == null)) {
|
|
89
|
-
// 如果value符合要求,执行以下代码
|
|
90
|
-
if (onChange) onChange(convertInt ? parseInt(value) : value);
|
|
91
|
-
setVal(value);
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
var optionName = options[0].label;
|
|
95
|
-
var menu = /*#__PURE__*/React.createElement(Menu, {
|
|
96
|
-
onClick: handleSelect
|
|
97
|
-
}, options.map(function (item) {
|
|
98
|
-
if (item.value == unit) optionName = item.label;
|
|
99
|
-
return /*#__PURE__*/React.createElement(Menu.Item, {
|
|
100
|
-
key: item.value
|
|
101
|
-
}, item.label);
|
|
102
|
-
}));
|
|
103
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
104
|
-
className: styles['lc-painter-panel-section-components-number-input']
|
|
105
|
-
}, rest), /*#__PURE__*/React.createElement("div", {
|
|
106
|
-
className: styles['num-input-wrap']
|
|
107
|
-
}, /*#__PURE__*/React.createElement(InputNumber, _extends({
|
|
108
|
-
className: styles['num-input'],
|
|
109
|
-
size: "small"
|
|
110
|
-
}, rest, {
|
|
111
|
-
value: number,
|
|
112
|
-
onChange: handleChange
|
|
113
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
114
|
-
className: styles['num-option']
|
|
115
|
-
}, /*#__PURE__*/React.createElement(Dropdown, {
|
|
116
|
-
overlay: menu,
|
|
117
|
-
value: unit,
|
|
118
|
-
disabled: options.length === 1,
|
|
119
|
-
getPopupContainer: function getPopupContainer() {
|
|
120
|
-
return document.getElementById('lc-design-workspace');
|
|
121
|
-
}
|
|
122
|
-
}, /*#__PURE__*/React.createElement("span", null, optionName)))));
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// 解析value,分离数字和单位
|
|
126
|
-
var parseValue = function parseValue(value, options) {
|
|
127
|
-
if (value === null || typeof value === 'undefined' || value === '') {
|
|
128
|
-
return {
|
|
129
|
-
number: null,
|
|
130
|
-
unit: null
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
value = String(value);
|
|
134
|
-
|
|
135
|
-
// 调整正则表达式以匹配数字后跟任意非数字字符
|
|
136
|
-
var result = value.match(/^(\d+)(\D*)$/); // \D 匹配任意非数字字符
|
|
137
|
-
if (result) {
|
|
138
|
-
return {
|
|
139
|
-
number: result[1],
|
|
140
|
-
unit: result[2] ? result[2] : options[0].value // 如果有非数字字符,则返回该字符,否则返回默认单位的第一项
|
|
141
|
-
};
|
|
142
|
-
} else {
|
|
143
|
-
return {
|
|
144
|
-
number: value,
|
|
145
|
-
unit: value
|
|
146
|
-
}; // 当没有数字时,比如 "auto",这里的逻辑可能需要调整,因为你的描述有点矛盾
|
|
147
|
-
}
|
|
148
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Popconfirm } from 'luck-design/antd';
|
|
4
|
-
import styles from "../style/pop-confirm.less";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 这个组件是对 luck-design/antd 的 Popconfirm 组件的封装。
|
|
8
|
-
* 它提供了一个带有自定义样式的弹出确认框,用于在用户尝试执行重要操作前提示确认信息。
|
|
9
|
-
* 通过传入的 props 可以自定义 Popconfirm 组件的行为和外观。
|
|
10
|
-
*
|
|
11
|
-
* @param {Object} props - 传递给 Popconfirm 组件的属性。这包括所有标准的 Popconfirm 属性,
|
|
12
|
-
* 以及任何额外的属性,如事件处理器或自定义内容。
|
|
13
|
-
* @returns {ReactNode} 返回一个配置了自定义样式和指定属性的 Popconfirm 组件实例。
|
|
14
|
-
*/
|
|
15
|
-
export default function (props) {
|
|
16
|
-
return /*#__PURE__*/React.createElement(Popconfirm, _extends({
|
|
17
|
-
overlayClassName: styles['lc-painter-panel-section-components-popconfirm'],
|
|
18
|
-
icon: null,
|
|
19
|
-
getPopupContainer: function getPopupContainer() {
|
|
20
|
-
return document.getElementById('lc-design-workspace');
|
|
21
|
-
}
|
|
22
|
-
}, props));
|
|
23
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["children"],
|
|
4
|
-
_excluded2 = ["children"],
|
|
5
|
-
_excluded3 = ["children"],
|
|
6
|
-
_excluded4 = ["children"];
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import styles from "../style/pop-form.less";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* PopForm 是一个为弹出式表单布局提供容器的组件,它使用特定的样式来组织表单内容。
|
|
12
|
-
*
|
|
13
|
-
* @param {Object} props - 组件的 props。
|
|
14
|
-
* @param {ReactNode} props.children - 组件内包含的子元素。
|
|
15
|
-
* @param {Object} rest - 传递给组件的其余属性,这些属性将直接传递给根 div 元素。
|
|
16
|
-
*/
|
|
17
|
-
export var PopForm = function PopForm(_ref) {
|
|
18
|
-
var children = _ref.children,
|
|
19
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
21
|
-
className: styles['lc-painter-panel-section-components-popform']
|
|
22
|
-
}, rest), children);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* PopFormItem 是 PopForm 组件的一个子项,用于包装表单的每个独立字段。
|
|
27
|
-
* 它提供了一致的布局和样式封装,用于表单项的展示。
|
|
28
|
-
*
|
|
29
|
-
* @param {Object} props - 组件的 props。
|
|
30
|
-
* @param {ReactNode} props.children - 组件内包含的子元素。
|
|
31
|
-
* @param {Object} rest - 传递给组件的其余属性,这些属性将直接传递给根 div 元素。
|
|
32
|
-
*/
|
|
33
|
-
export var PopFormItem = function PopFormItem(_ref2) {
|
|
34
|
-
var children = _ref2.children,
|
|
35
|
-
rest = _objectWithoutProperties(_ref2, _excluded2);
|
|
36
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
37
|
-
className: styles['item']
|
|
38
|
-
}, rest), children);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* PopFormItemLeft 是 PopFormItem 的子组件,用于展示表单项的标签或标题部分。
|
|
43
|
-
* 它通常用于放置字段名或说明性文本。
|
|
44
|
-
*
|
|
45
|
-
* @param {Object} props - 组件的 props。
|
|
46
|
-
* @param {ReactNode} props.children - 组件内包含的子元素。
|
|
47
|
-
* @param {Object} rest - 传递给组件的其余属性,这些属性将直接传递给根 div 元素。
|
|
48
|
-
*/
|
|
49
|
-
export var PopFormItemLeft = function PopFormItemLeft(_ref3) {
|
|
50
|
-
var children = _ref3.children,
|
|
51
|
-
rest = _objectWithoutProperties(_ref3, _excluded3);
|
|
52
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
53
|
-
className: styles['left']
|
|
54
|
-
}, rest), children);
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* PopFormItemRight 是 PopFormItem 的子组件,用于包含表单项的输入字段。
|
|
59
|
-
* 它是表单项布局中用于用户输入的部分,可以容纳各种类型的输入控件。
|
|
60
|
-
*
|
|
61
|
-
* @param {Object} props - 组件的 props。
|
|
62
|
-
* @param {ReactNode} props.children - 组件内包含的子元素。
|
|
63
|
-
* @param {Object} rest - 传递给组件的其余属性,这些属性将直接传递给根 div 元素。
|
|
64
|
-
*/
|
|
65
|
-
export var PopFormItemRight = function PopFormItemRight(_ref4) {
|
|
66
|
-
var children = _ref4.children,
|
|
67
|
-
rest = _objectWithoutProperties(_ref4, _excluded4);
|
|
68
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
69
|
-
className: styles['right']
|
|
70
|
-
}, rest), children);
|
|
71
|
-
};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import React, { useState, useEffect } from 'react';
|
|
3
|
-
import { DndContext } from '@dnd-kit/core';
|
|
4
|
-
import { SortableContext, arrayMove, useSortable, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
|
5
|
-
import { CSS } from '@dnd-kit/utilities';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* SortBox 是一个使用 dnd-kit 实现拖拽排序的组件。
|
|
9
|
-
* 它允许子元素通过拖拽操作来重新排序,并在排序操作完成后通过 onChange 回调传递新的排序结果。
|
|
10
|
-
*
|
|
11
|
-
* @param {Object} props 组件的 props。
|
|
12
|
-
* @param {Array} props.datas 初始排序的数据数组,通常包含用于排序的唯一标识符。
|
|
13
|
-
* @param {ReactNode} props.children 组件的子元素,通常是需要进行排序的元素集合。
|
|
14
|
-
* @param {Function} props.onChange 当排序操作完成时触发的回调函数,参数为重新排序后的数据数组。
|
|
15
|
-
* @param {Function} [props.strategy=verticalListSortingStrategy] 用于排序的策略。默认为垂直列表排序策略。
|
|
16
|
-
*
|
|
17
|
-
* @returns {ReactNode} 返回一个配置了 DndContext 和 SortableContext 的 React 组件结构。
|
|
18
|
-
*/
|
|
19
|
-
export var SortBox = function SortBox(_ref) {
|
|
20
|
-
var datas = _ref.datas,
|
|
21
|
-
children = _ref.children,
|
|
22
|
-
onChange = _ref.onChange,
|
|
23
|
-
strategy = _ref.strategy;
|
|
24
|
-
var _useState = useState(datas),
|
|
25
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
26
|
-
items = _useState2[0],
|
|
27
|
-
setItems = _useState2[1];
|
|
28
|
-
var sortStrategy = strategy !== null && strategy !== void 0 ? strategy : verticalListSortingStrategy;
|
|
29
|
-
useEffect(function () {
|
|
30
|
-
setItems(datas);
|
|
31
|
-
}, [datas]);
|
|
32
|
-
function handleDragEnd(event) {
|
|
33
|
-
var active = event.active,
|
|
34
|
-
over = event.over;
|
|
35
|
-
if (active.id !== over.id) {
|
|
36
|
-
setItems(function (items) {
|
|
37
|
-
var oldIndex = items.indexOf(active.id);
|
|
38
|
-
var newIndex = items.indexOf(over.id);
|
|
39
|
-
var newSortItem = arrayMove(items, oldIndex, newIndex);
|
|
40
|
-
if (onChange) onChange(newSortItem);
|
|
41
|
-
return newSortItem;
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return /*#__PURE__*/React.createElement(DndContext, {
|
|
46
|
-
onDragEnd: handleDragEnd
|
|
47
|
-
}, /*#__PURE__*/React.createElement(SortableContext, {
|
|
48
|
-
strategy: sortStrategy,
|
|
49
|
-
items: items
|
|
50
|
-
}, children));
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* SortItem 组件是一个使用 dnd-kit 实现的可排序项。它通过 useSortable 钩子来提供拖拽功能,
|
|
55
|
-
* 并将必要的属性和监听器传递给其子元素,使得子元素可拖拽。
|
|
56
|
-
*
|
|
57
|
-
* @param {Object} props - 组件的 props。
|
|
58
|
-
* @param {string} props.id - 该排序项的唯一标识符,用于识别不同的可排序元素。
|
|
59
|
-
* @param {ReactNode} props.children - 该组件的子元素。通常是你希望使之可拖拽的元素。
|
|
60
|
-
* SortItem 会将拖拽相关的 props 注入到这个子元素中。
|
|
61
|
-
*
|
|
62
|
-
* @returns {ReactNode} 返回一个增强后的 React 元素,此元素集成了拖拽功能。
|
|
63
|
-
* 它基于原 children 元素,附加了用于拖拽的属性和样式。
|
|
64
|
-
*/
|
|
65
|
-
export var SortItem = function SortItem(_ref2) {
|
|
66
|
-
var id = _ref2.id,
|
|
67
|
-
children = _ref2.children;
|
|
68
|
-
var _useSortable = useSortable({
|
|
69
|
-
id: id
|
|
70
|
-
}),
|
|
71
|
-
attributes = _useSortable.attributes,
|
|
72
|
-
listeners = _useSortable.listeners,
|
|
73
|
-
setNodeRef = _useSortable.setNodeRef,
|
|
74
|
-
transform = _useSortable.transform,
|
|
75
|
-
transition = _useSortable.transition,
|
|
76
|
-
setActivatorNodeRef = _useSortable.setActivatorNodeRef;
|
|
77
|
-
var style = {
|
|
78
|
-
transform: CSS.Transform.toString(transform),
|
|
79
|
-
transition: transition
|
|
80
|
-
};
|
|
81
|
-
var childWithProps = /*#__PURE__*/React.cloneElement(children, {
|
|
82
|
-
key: id,
|
|
83
|
-
attributes: attributes,
|
|
84
|
-
listeners: listeners,
|
|
85
|
-
setNodeRef: setNodeRef,
|
|
86
|
-
transform: transform,
|
|
87
|
-
transition: transition,
|
|
88
|
-
setActivatorNodeRef: setActivatorNodeRef,
|
|
89
|
-
style: style
|
|
90
|
-
});
|
|
91
|
-
return childWithProps;
|
|
92
|
-
};
|