@luck-design-biz/luckda 0.0.25 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/es/components/Builder/index.js +24 -17
- package/es/components/LdAutoForm/index.js +15 -5
- package/es/components/LdCard/index.js +0 -0
- package/es/components/LdCard/model.js +0 -0
- package/es/components/LdCom/index.js +0 -0
- package/es/components/LdFormList/index.js +4 -1
- package/es/components/LdFormList/model.js +0 -0
- package/es/components/LdGrid/index.js +18 -27
- package/es/components/LdGrid/model.js +0 -0
- package/es/components/LdGridForm/index.js +12 -4
- package/es/components/LdGridForm/index.less +0 -0
- package/es/components/LdInfoPanel/index.js +0 -0
- package/es/components/LdPop/index.js +0 -0
- package/es/components/LdRuntimeCom/index.js +0 -0
- package/es/components/LdTree/index.js +5 -32
- package/es/components/LdTree/index.less +1 -6
- package/es/helper/FromItems.js +0 -0
- package/es/helper/action.js +0 -0
- package/es/helper/form.js +8 -2
- package/es/helper/index.less +0 -0
- package/es/helper/ldBuilder.js +4 -1
- package/es/helper/ldComBuild.js +0 -0
- package/es/index.js +0 -1
- package/es/lowcode/constants/api-url.js +1 -351
- package/es/lowcode/constants/event-topics.js +1 -14
- package/es/lowcode/constants/index.js +1 -3
- package/es/lowcode/engine/factory/DataFactory.js +0 -0
- package/es/lowcode/engine/meta/button.props.default.json +7 -15
- package/es/lowcode/engine/meta/cardlist.props.default.json +9 -16
- package/{lib/lowcode/engine/meta/button.props.json → es/lowcode/engine/meta/components/button.json} +103 -126
- package/{lib/lowcode/engine/meta/cardlist.props.json → es/lowcode/engine/meta/components/card-list.json} +142 -142
- package/es/lowcode/engine/meta/{drawer.props.json → components/drawer.json} +142 -142
- package/{lib/lowcode/engine/meta/form.props.json → es/lowcode/engine/meta/components/form.json} +115 -115
- 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/{lib/lowcode/engine/meta/jsx.props.json → es/lowcode/engine/meta/components/jsx.json} +23 -24
- package/es/lowcode/engine/meta/{layout.props.json → components/layout.json} +106 -107
- package/es/lowcode/engine/meta/{link.props.json → components/link.json} +110 -111
- package/{lib/lowcode/engine/meta/dialog.props.json → es/lowcode/engine/meta/components/modal.json} +119 -119
- package/es/lowcode/engine/meta/{section.props.json → 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} +30 -12
- package/{lib/lowcode/engine/meta/tabs.props.json → es/lowcode/engine/meta/components/tabs.json} +139 -139
- package/{lib/lowcode/engine/meta/text.props.json → es/lowcode/engine/meta/components/text.json} +64 -65
- package/{lib/lowcode/engine/meta/tree.props.json → es/lowcode/engine/meta/components/tree.json} +155 -202
- package/es/lowcode/engine/meta/components-list.json +121 -127
- package/es/lowcode/engine/meta/drawer.props.default.json +9 -16
- package/es/lowcode/engine/meta/form.props.default.json +4 -11
- 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 -45
- package/es/lowcode/engine/meta/tabs.props.default.json +9 -16
- package/es/lowcode/engine/meta/text.props.default.json +3 -11
- package/es/lowcode/engine/meta/tree.props.default.json +8 -21
- package/es/lowcode/engine/provider/ContextProvider.js +164 -0
- 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 -96
- package/es/lowcode/engine/tools/lcid.js +16 -0
- package/es/lowcode/index.js +1 -3
- package/es/lowcode/painter/Components.js +0 -0
- 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 -156
- 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/components.less +0 -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 -93
- package/es/lowcode/painter/style/radio.less +0 -0
- package/es/lowcode/painter/style/ribbon.less +0 -1
- package/es/lowcode/painter/style/rule-input.less +0 -0
- package/es/lowcode/view/Canvas.js +70 -79
- package/es/lowcode/view/Loading.js +0 -0
- 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 +8 -41
- package/es/lowcode/view/lc-components/Button/index.js +7 -75
- package/es/lowcode/view/lc-components/CardList/index.js +0 -0
- 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 -38
- package/es/lowcode/view/lc-components/Form/index.js +0 -0
- package/es/lowcode/view/lc-components/Iframe/index.js +0 -0
- package/es/lowcode/view/lc-components/ImEx/index.js +0 -0
- package/es/lowcode/view/lc-components/Image/index.js +0 -0
- package/es/lowcode/view/lc-components/JSX/index.js +0 -0
- package/es/lowcode/view/lc-components/Layout/index.js +7 -40
- package/es/lowcode/view/lc-components/Link/index.js +0 -0
- package/es/lowcode/view/lc-components/Section/index.js +0 -0
- package/es/lowcode/view/lc-components/Split/index.js +0 -0
- package/es/lowcode/view/lc-components/Table/index.js +11 -451
- package/es/lowcode/view/lc-components/Tabs/index.js +0 -0
- package/es/lowcode/view/lc-components/Text/index.js +0 -0
- package/es/lowcode/view/lc-components/Tree/index.js +6 -77
- package/es/lowcode/view/lc-components/Wrapper.js +24 -33
- package/es/lowcode/view/style/canvas.less +0 -0
- package/es/lowcode/view/style/loading.less +0 -0
- package/es/lowcode/view/style/page.less +1 -0
- package/es/services.js +24 -7
- package/es/upload/Form/gridForm.js +5 -4
- package/es/upload/Form/index.js +0 -0
- package/es/upload/Form/index.less +0 -0
- package/es/upload/FormItem/index.js +4 -3
- package/es/upload/GridCell/index.js +0 -0
- package/es/upload/index.js +0 -0
- package/es/utils/action.js +0 -0
- package/es/utils/form.js +37 -3
- package/es/utils/grid.js +9 -7
- package/es/utils/index.js +0 -0
- package/lib/components/Builder/index.js +22 -15
- package/lib/components/LdAutoForm/index.js +14 -4
- package/lib/components/LdCard/index.js +0 -0
- package/lib/components/LdCard/model.js +0 -0
- package/lib/components/LdCom/index.js +0 -0
- package/lib/components/LdFormList/index.js +5 -1
- package/lib/components/LdFormList/model.js +0 -0
- package/lib/components/LdGrid/index.js +17 -26
- package/lib/components/LdGrid/model.js +0 -0
- package/lib/components/LdGridForm/index.js +11 -3
- package/lib/components/LdGridForm/index.less +0 -0
- package/lib/components/LdInfoPanel/index.js +0 -0
- package/lib/components/LdPop/index.js +0 -0
- package/lib/components/LdRuntimeCom/index.js +0 -0
- package/lib/components/LdTree/index.js +4 -31
- package/lib/components/LdTree/index.less +1 -6
- package/lib/helper/FromItems.js +0 -0
- package/lib/helper/action.js +0 -0
- package/lib/helper/form.js +8 -2
- package/lib/helper/index.less +0 -0
- package/lib/helper/ldBuilder.js +4 -1
- package/lib/helper/ldComBuild.js +0 -0
- package/lib/index.js +0 -8
- package/lib/lowcode/constants/api-url.js +2 -353
- package/lib/lowcode/constants/event-topics.js +2 -15
- package/lib/lowcode/constants/index.js +2 -4
- package/lib/lowcode/engine/factory/DataFactory.js +0 -0
- package/lib/lowcode/engine/meta/button.props.default.json +7 -15
- package/lib/lowcode/engine/meta/cardlist.props.default.json +9 -16
- package/{es/lowcode/engine/meta/button.props.json → lib/lowcode/engine/meta/components/button.json} +103 -126
- package/{es/lowcode/engine/meta/cardlist.props.json → lib/lowcode/engine/meta/components/card-list.json} +142 -142
- package/lib/lowcode/engine/meta/{drawer.props.json → components/drawer.json} +142 -142
- package/{es/lowcode/engine/meta/form.props.json → lib/lowcode/engine/meta/components/form.json} +115 -115
- 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/{es/lowcode/engine/meta/jsx.props.json → lib/lowcode/engine/meta/components/jsx.json} +23 -24
- package/lib/lowcode/engine/meta/{layout.props.json → components/layout.json} +106 -107
- package/lib/lowcode/engine/meta/{link.props.json → components/link.json} +110 -111
- package/{es/lowcode/engine/meta/dialog.props.json → lib/lowcode/engine/meta/components/modal.json} +119 -119
- package/lib/lowcode/engine/meta/{section.props.json → 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} +30 -12
- package/{es/lowcode/engine/meta/tabs.props.json → lib/lowcode/engine/meta/components/tabs.json} +139 -139
- package/{es/lowcode/engine/meta/text.props.json → lib/lowcode/engine/meta/components/text.json} +64 -65
- package/{es/lowcode/engine/meta/tree.props.json → lib/lowcode/engine/meta/components/tree.json} +155 -202
- package/lib/lowcode/engine/meta/components-list.json +121 -127
- package/lib/lowcode/engine/meta/drawer.props.default.json +9 -16
- package/lib/lowcode/engine/meta/form.props.default.json +4 -11
- 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 -45
- package/lib/lowcode/engine/meta/tabs.props.default.json +9 -16
- package/lib/lowcode/engine/meta/text.props.default.json +3 -11
- package/lib/lowcode/engine/meta/tree.props.default.json +8 -21
- package/lib/lowcode/engine/provider/ContextProvider.js +172 -0
- 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 -101
- package/lib/lowcode/engine/tools/lcid.js +22 -0
- package/lib/lowcode/index.js +1 -5
- package/lib/lowcode/painter/Components.js +0 -0
- 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 +2 -156
- 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/components.less +0 -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 -93
- package/lib/lowcode/painter/style/radio.less +0 -0
- package/lib/lowcode/painter/style/ribbon.less +0 -1
- package/lib/lowcode/painter/style/rule-input.less +0 -0
- package/lib/lowcode/view/Canvas.js +75 -84
- package/lib/lowcode/view/Loading.js +0 -0
- 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 +7 -39
- package/lib/lowcode/view/lc-components/Button/index.js +8 -76
- package/lib/lowcode/view/lc-components/CardList/index.js +0 -0
- 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 -38
- package/lib/lowcode/view/lc-components/Form/index.js +0 -0
- package/lib/lowcode/view/lc-components/Iframe/index.js +0 -0
- package/lib/lowcode/view/lc-components/ImEx/index.js +0 -0
- package/lib/lowcode/view/lc-components/Image/index.js +0 -0
- package/lib/lowcode/view/lc-components/JSX/index.js +0 -0
- package/lib/lowcode/view/lc-components/Layout/index.js +8 -41
- package/lib/lowcode/view/lc-components/Link/index.js +0 -0
- package/lib/lowcode/view/lc-components/Section/index.js +0 -0
- package/lib/lowcode/view/lc-components/Split/index.js +0 -0
- package/lib/lowcode/view/lc-components/Table/index.js +11 -451
- package/lib/lowcode/view/lc-components/Tabs/index.js +0 -0
- package/lib/lowcode/view/lc-components/Text/index.js +0 -0
- package/lib/lowcode/view/lc-components/Tree/index.js +6 -77
- package/lib/lowcode/view/lc-components/Wrapper.js +24 -32
- package/lib/lowcode/view/style/canvas.less +0 -0
- package/lib/lowcode/view/style/loading.less +0 -0
- package/lib/lowcode/view/style/page.less +1 -0
- package/lib/services.js +25 -7
- package/lib/upload/Form/gridForm.js +5 -4
- package/lib/upload/Form/index.js +0 -0
- package/lib/upload/Form/index.less +0 -0
- package/lib/upload/FormItem/index.js +4 -3
- package/lib/upload/GridCell/index.js +0 -0
- package/lib/upload/index.js +0 -0
- package/lib/utils/action.js +0 -0
- package/lib/utils/form.js +38 -3
- package/lib/utils/grid.js +8 -6
- package/lib/utils/index.js +0 -0
- package/lowcode.js +0 -0
- package/package.json +8 -22
- package/upload.js +0 -0
- package/utils.js +0 -0
- package/es/components/LDActions/index.js +0 -130
- package/es/components/LDActions/index.less +0 -48
- package/es/locales/zh-CN.js +0 -151
- package/es/lowcode/engine/factory/panel-item-factory/CheckboxStrategy.js +0 -32
- 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 -46
- package/es/lowcode/engine/meta/box.props.default.json +0 -10
- package/es/lowcode/engine/meta/box.props.json +0 -40
- package/es/lowcode/engine/meta/dialog.props.default.json +0 -18
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +0 -135
- package/es/lowcode/engine/meta/local/local.zh-cn.js +0 -97
- package/es/lowcode/engine/meta/table.props.json +0 -411
- package/es/lowcode/engine/provider/ContextProvider/index.js +0 -199
- package/es/lowcode/engine/tools/usePromiseState.js +0 -25
- package/es/lowcode/painter/DesignOperator.js +0 -271
- package/es/lowcode/painter/DesignToolbar.js +0 -91
- package/es/lowcode/painter/components/ActionBindModal.js +0 -180
- package/es/lowcode/painter/components/AdvancePanel.js +0 -68
- package/es/lowcode/painter/components/AttrsPanel.js +0 -134
- package/es/lowcode/painter/components/Collapse.js +0 -95
- package/es/lowcode/painter/components/ColorInput.js +0 -125
- package/es/lowcode/painter/components/FieldSelector.js +0 -44
- package/es/lowcode/painter/components/ListEditor.js +0 -91
- package/es/lowcode/painter/components/NumberInput.js +0 -148
- package/es/lowcode/painter/components/PopConfirm.js +0 -30
- package/es/lowcode/painter/components/PopForm.js +0 -71
- package/es/lowcode/painter/components/SortBox.js +0 -92
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +0 -108
- 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 -117
- package/es/lowcode/painter/components/code-editor/JsonEditor.js +0 -41
- package/es/lowcode/painter/components/code-editor/index.js +0 -2
- package/es/lowcode/painter/panel-section/ActionsEditor/ActionEditor.js +0 -154
- package/es/lowcode/painter/panel-section/ActionsEditor/index.js +0 -198
- 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/ImpExp.js +0 -91
- package/es/lowcode/painter/panel-section/JSEditor.js +0 -48
- 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/TableTopFilter.js +0 -306
- 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/action-bind-modal.less +0 -99
- 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/impexp.less +0 -7
- 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/panel-attrs.less +0 -43
- package/es/lowcode/painter/style/pop-confirm.less +0 -17
- 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 -14
- package/es/lowcode/view/lc-components/Box/meta.json +0 -40
- 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 -120
- 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 -143
- 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 -116
- 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 -72
- 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 -51
- package/es/lowcode/view/lc-components/Table/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Table/components/TopFilter.js +0 -96
- package/es/lowcode/view/lc-components/Table/meta.json +0 -372
- 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 -140
- 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 -54
- package/es/lowcode/view/lc-components/Tree/FunctionLive.js +0 -9
- package/es/lowcode/view/lc-components/Tree/index.less +0 -2
- package/es/lowcode/view/lc-components/Tree/meta.json +0 -199
- package/lib/components/LDActions/index.js +0 -138
- package/lib/components/LDActions/index.less +0 -48
- package/lib/locales/zh-CN.js +0 -157
- package/lib/lowcode/engine/factory/panel-item-factory/CheckboxStrategy.js +0 -38
- 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 -52
- package/lib/lowcode/engine/meta/box.props.default.json +0 -10
- package/lib/lowcode/engine/meta/box.props.json +0 -40
- package/lib/lowcode/engine/meta/dialog.props.default.json +0 -18
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +0 -135
- package/lib/lowcode/engine/meta/local/local.zh-cn.js +0 -103
- package/lib/lowcode/engine/meta/table.props.json +0 -411
- package/lib/lowcode/engine/provider/ContextProvider/index.js +0 -207
- package/lib/lowcode/engine/tools/usePromiseState.js +0 -32
- package/lib/lowcode/painter/DesignOperator.js +0 -278
- package/lib/lowcode/painter/DesignToolbar.js +0 -99
- package/lib/lowcode/painter/components/ActionBindModal.js +0 -188
- package/lib/lowcode/painter/components/AdvancePanel.js +0 -76
- package/lib/lowcode/painter/components/AttrsPanel.js +0 -142
- package/lib/lowcode/painter/components/Collapse.js +0 -102
- package/lib/lowcode/painter/components/ColorInput.js +0 -132
- package/lib/lowcode/painter/components/FieldSelector.js +0 -52
- package/lib/lowcode/painter/components/ListEditor.js +0 -97
- package/lib/lowcode/painter/components/NumberInput.js +0 -155
- package/lib/lowcode/painter/components/PopConfirm.js +0 -36
- package/lib/lowcode/painter/components/PopForm.js +0 -77
- package/lib/lowcode/painter/components/SortBox.js +0 -99
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +0 -115
- 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 -128
- package/lib/lowcode/painter/components/code-editor/JsonEditor.js +0 -48
- package/lib/lowcode/painter/components/code-editor/index.js +0 -20
- package/lib/lowcode/painter/panel-section/ActionsEditor/ActionEditor.js +0 -162
- package/lib/lowcode/painter/panel-section/ActionsEditor/index.js +0 -206
- 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/ImpExp.js +0 -98
- package/lib/lowcode/painter/panel-section/JSEditor.js +0 -56
- 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/TableTopFilter.js +0 -314
- 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/action-bind-modal.less +0 -99
- 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/impexp.less +0 -7
- 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/panel-attrs.less +0 -43
- package/lib/lowcode/painter/style/pop-confirm.less +0 -17
- 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 -14
- package/lib/lowcode/view/lc-components/Box/meta.json +0 -40
- 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 -120
- 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 -143
- 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 -116
- 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 -79
- 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 -59
- package/lib/lowcode/view/lc-components/Table/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Table/components/TopFilter.js +0 -104
- package/lib/lowcode/view/lc-components/Table/meta.json +0 -372
- 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 -140
- 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 -62
- package/lib/lowcode/view/lc-components/Tree/FunctionLive.js +0 -16
- package/lib/lowcode/view/lc-components/Tree/index.less +0 -2
- package/lib/lowcode/view/lc-components/Tree/meta.json +0 -199
|
@@ -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
|
-
};
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["onChange", "isFullscreen"],
|
|
5
|
-
_excluded2 = ["children", "language", "options"];
|
|
6
|
-
import React, { useEffect, useRef, useImperativeHandle, forwardRef } from 'react';
|
|
7
|
-
import * as monaco from 'monaco-editor';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* BaseEditor 组件是一个封装了 monaco 编辑器的 React 组件,支持前向 ref 引用。
|
|
11
|
-
* 该组件允许用户编辑代码,并在代码发生变更时触发回调函数。
|
|
12
|
-
* 它还支持通过 props 控制编辑器的语言、选项以及是否全屏显示。
|
|
13
|
-
*
|
|
14
|
-
* @component
|
|
15
|
-
* @example
|
|
16
|
-
* const handleEditorChange = (newValue, event) => {
|
|
17
|
-
* console.log('Editor content changed: ', newValue);
|
|
18
|
-
* };
|
|
19
|
-
* <BaseEditor
|
|
20
|
-
* language="javascript"
|
|
21
|
-
* onChange={handleEditorChange}
|
|
22
|
-
* isFullscreen={false}
|
|
23
|
-
* width="600px"
|
|
24
|
-
* height="400px"
|
|
25
|
-
* >
|
|
26
|
-
* {`function sayHello() {\n console.log('Hello, World!');\n}`}
|
|
27
|
-
* </BaseEditor>
|
|
28
|
-
*
|
|
29
|
-
* @param {Object} props - 组件的属性。
|
|
30
|
-
* @param {Function} props.onChange - 当编辑器内容变更时调用的函数。接收最新的编辑器内容和事件对象作为参数。
|
|
31
|
-
* @param {boolean} props.isFullscreen - 控制编辑器是否全屏显示。
|
|
32
|
-
* @param {string} [props.language='javascript'] - 设置编辑器的编程语言,默认为 'javascript'。
|
|
33
|
-
* @param {Object} [props.options={}] - 用于自定义编辑器的选项。
|
|
34
|
-
* @param {React.ReactNode} children - 子组件,通常是编辑器的初始代码。
|
|
35
|
-
* @param {string} [props.width] - 编辑器的宽度,默认为 '100%'。
|
|
36
|
-
* @param {string} [props.height] - 编辑器的高度,默认为 '100%'。
|
|
37
|
-
* @param {Object} rest - 传递给 div 容器的其它属性。
|
|
38
|
-
* @param {React.Ref} ref - React ref 引用,用于外部组件调用编辑器实例的方法。
|
|
39
|
-
*
|
|
40
|
-
* @returns {ReactElement} 返回一个 React 元素,其中包含了一个配置好的 monaco 编辑器实例。
|
|
41
|
-
*/
|
|
42
|
-
var BaseEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
43
|
-
var onChange = _ref.onChange,
|
|
44
|
-
isFullscreen = _ref.isFullscreen,
|
|
45
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
46
|
-
var children = props.children,
|
|
47
|
-
_props$language = props.language,
|
|
48
|
-
language = _props$language === void 0 ? 'javascript' : _props$language,
|
|
49
|
-
_props$options = props.options,
|
|
50
|
-
options = _props$options === void 0 ? {} : _props$options,
|
|
51
|
-
rest = _objectWithoutProperties(props, _excluded2);
|
|
52
|
-
var editorRef = useRef(null);
|
|
53
|
-
var editorInstance = useRef(null);
|
|
54
|
-
|
|
55
|
-
// 初始化编辑器实例
|
|
56
|
-
useEffect(function () {
|
|
57
|
-
if (editorRef.current) {
|
|
58
|
-
var code = React.Children.toArray(children).join('').trim();
|
|
59
|
-
editorInstance.current = monaco.editor.create(editorRef.current, _objectSpread({
|
|
60
|
-
value: code,
|
|
61
|
-
language: language,
|
|
62
|
-
automaticLayout: true
|
|
63
|
-
}, options), {
|
|
64
|
-
storageService: {
|
|
65
|
-
get: function get() {},
|
|
66
|
-
getBoolean: function getBoolean(key) {
|
|
67
|
-
if (key === 'expandSuggestionDocs') return true;
|
|
68
|
-
return false;
|
|
69
|
-
},
|
|
70
|
-
remove: function remove() {},
|
|
71
|
-
store: function store() {},
|
|
72
|
-
onWillSaveState: function onWillSaveState() {},
|
|
73
|
-
onDidChangeStorage: function onDidChangeStorage() {}
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
editorInstance.current.onDidChangeModelContent(function (event) {
|
|
77
|
-
if (onChange) onChange(editorInstance.current.getValue(), event);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
return function () {
|
|
81
|
-
var _editorInstance$curre;
|
|
82
|
-
return (_editorInstance$curre = editorInstance.current) === null || _editorInstance$curre === void 0 ? void 0 : _editorInstance$curre.dispose();
|
|
83
|
-
};
|
|
84
|
-
}, [children, language, options]);
|
|
85
|
-
|
|
86
|
-
// 使用 ref 暴露组件方法
|
|
87
|
-
useImperativeHandle(ref, function () {
|
|
88
|
-
return {
|
|
89
|
-
get editor() {
|
|
90
|
-
return editorInstance.current;
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
}, []);
|
|
94
|
-
|
|
95
|
-
// 根据是否全屏来设置编辑器的样式
|
|
96
|
-
var editorStyle = isFullscreen ? {
|
|
97
|
-
width: '100vw',
|
|
98
|
-
height: '100vh'
|
|
99
|
-
} : {
|
|
100
|
-
width: props.width || '100%',
|
|
101
|
-
height: props.height || '100%'
|
|
102
|
-
};
|
|
103
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
104
|
-
ref: editorRef,
|
|
105
|
-
style: editorStyle
|
|
106
|
-
}, rest));
|
|
107
|
-
});
|
|
108
|
-
export default /*#__PURE__*/React.memo(BaseEditor);
|
|
@@ -1,41 +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
|
-
import React, { forwardRef } from 'react';
|
|
5
|
-
import BaseEditor from "./BaseEditor";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* CssEditor 组件是一个专门用于编辑 CSS 代码的 React 组件,它基于 BaseEditor 组件构建。
|
|
9
|
-
* 该组件通过将 language 属性固定设置为 "css",确保编辑器环境专门用于 CSS 代码编辑。
|
|
10
|
-
* 用户可以传入 CSS 代码作为 children,并通过其他 props 控制 BaseEditor 提供的额外功能。
|
|
11
|
-
*
|
|
12
|
-
* @component
|
|
13
|
-
* @example
|
|
14
|
-
* const handleCssChange = (newCss, event) => {
|
|
15
|
-
* console.log('CSS changed: ', newCss);
|
|
16
|
-
* };
|
|
17
|
-
* <CssEditor
|
|
18
|
-
* onChange={handleCssChange}
|
|
19
|
-
* isFullscreen={false}
|
|
20
|
-
* width="600px"
|
|
21
|
-
* height="400px"
|
|
22
|
-
* >
|
|
23
|
-
* {`body { margin: 0; font-family: Arial, sans-serif; }`}
|
|
24
|
-
* </CssEditor>
|
|
25
|
-
*
|
|
26
|
-
* @param {Object} props - 组件的属性。
|
|
27
|
-
* @param {React.ReactNode} children - 子组件,通常是编辑器的初始 CSS 代码。
|
|
28
|
-
* @param {Object} rest - 传递给 BaseEditor 组件的其他属性。
|
|
29
|
-
* @param {React.Ref} ref - React ref 引用,用于外部组件调用编辑器实例的方法。
|
|
30
|
-
*
|
|
31
|
-
* @returns {ReactElement} 返回一个 React 元素,该元素内部是一个专门用于 CSS 编辑的 BaseEditor 组件实例。
|
|
32
|
-
*/
|
|
33
|
-
var CssEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
34
|
-
var children = _ref.children,
|
|
35
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
36
|
-
return /*#__PURE__*/React.createElement(BaseEditor, _extends({
|
|
37
|
-
ref: ref,
|
|
38
|
-
language: "css"
|
|
39
|
-
}, rest), children);
|
|
40
|
-
});
|
|
41
|
-
export default /*#__PURE__*/React.memo(CssEditor);
|
|
@@ -1,87 +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 = ["EditorComponent", "onLoad", "children"];
|
|
5
|
-
import React, { useEffect, forwardRef, useRef } from 'react';
|
|
6
|
-
import { Tooltip, Icon } from 'luck-design/antd';
|
|
7
|
-
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
8
|
-
import styles from "../../style/fullscreen-editor.less";
|
|
9
|
-
import { useFullscreen } from 'ahooks';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* FullScreenEditor 组件是一个支持全屏编辑模式的 React 组件,它利用提供的 EditorComponent 来实现代码编辑功能。
|
|
13
|
-
* 该组件使用 ahooks 的 useFullscreen 钩子来实现全屏切换,并在全屏模式下调整编辑器布局。
|
|
14
|
-
* 全屏/非全屏模式下编辑器的某些选项可能会有所不同,以适应不同的布局需求。
|
|
15
|
-
*
|
|
16
|
-
* @component
|
|
17
|
-
* @example
|
|
18
|
-
* const MyEditor = React.forwardRef((props, ref) => <BaseEditor {...props} ref={ref} />);
|
|
19
|
-
* <FullScreenEditor
|
|
20
|
-
* EditorComponent={MyEditor}
|
|
21
|
-
* onLoad={() => console.log('Editor loaded')}
|
|
22
|
-
* >
|
|
23
|
-
* {`function sayHello() {\n console.log('Hello, World!');\n}`}
|
|
24
|
-
* </FullScreenEditor>
|
|
25
|
-
*
|
|
26
|
-
* @param {Object} props - 组件的属性。
|
|
27
|
-
* @param {Function} props.EditorComponent - 用于编辑的组件,该组件需要支持 ref 引用以调用编辑器的方法。
|
|
28
|
-
* @param {Function} [props.onLoad] - 编辑器加载完成时的回调函数。
|
|
29
|
-
* @param {React.ReactNode} children - 传递给 EditorComponent 的 children,通常是初始代码或内容。
|
|
30
|
-
* @param {Object} rest - 传递给 EditorComponent 的其他属性。
|
|
31
|
-
* @param {React.Ref} ref - React ref 引用,用于在外部组件中访问 EditorComponent 实例的方法。
|
|
32
|
-
*
|
|
33
|
-
* @returns {ReactElement} 返回一个 React 元素,其中包含了一个具有全屏切换功能的编辑器界面。
|
|
34
|
-
*/
|
|
35
|
-
var FullScreenEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
36
|
-
var EditorComponent = _ref.EditorComponent,
|
|
37
|
-
onLoad = _ref.onLoad,
|
|
38
|
-
children = _ref.children,
|
|
39
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
40
|
-
var fullscreenRef = useRef(null);
|
|
41
|
-
var _useFullscreen = useFullscreen(fullscreenRef),
|
|
42
|
-
_useFullscreen2 = _slicedToArray(_useFullscreen, 2),
|
|
43
|
-
isFullscreen = _useFullscreen2[0],
|
|
44
|
-
toggleFullscreen = _useFullscreen2[1].toggleFullscreen;
|
|
45
|
-
var handleFullscreen = function handleFullscreen() {
|
|
46
|
-
toggleFullscreen();
|
|
47
|
-
};
|
|
48
|
-
useEffect(function () {
|
|
49
|
-
if (onLoad) onLoad();
|
|
50
|
-
}, []);
|
|
51
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
52
|
-
className: styles['lc-painter-components-fullscreen-editor']
|
|
53
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
54
|
-
className: styles['actions']
|
|
55
|
-
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
56
|
-
title: formatMessage({
|
|
57
|
-
id: 'luckda.lowcode.painter.components.fullscreen.tip',
|
|
58
|
-
label: '全屏'
|
|
59
|
-
})
|
|
60
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
61
|
-
type: "fullscreen",
|
|
62
|
-
onClick: handleFullscreen
|
|
63
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
64
|
-
className: isFullscreen ? styles['fullscreen'] : '',
|
|
65
|
-
ref: fullscreenRef
|
|
66
|
-
}, /*#__PURE__*/React.createElement(EditorComponent, _extends({
|
|
67
|
-
ref: ref,
|
|
68
|
-
isFullscreen: isFullscreen,
|
|
69
|
-
options: isFullscreen ? {} : {
|
|
70
|
-
lineNumbers: 'off',
|
|
71
|
-
glyphMargin: false,
|
|
72
|
-
folding: false,
|
|
73
|
-
lineDecorationsWidth: 0,
|
|
74
|
-
lineNumbersMinChars: 0,
|
|
75
|
-
minimap: {
|
|
76
|
-
enabled: false
|
|
77
|
-
},
|
|
78
|
-
overviewRulerLanes: 0,
|
|
79
|
-
scrollbar: {
|
|
80
|
-
vertical: 'hidden',
|
|
81
|
-
horizontal: 'hidden',
|
|
82
|
-
handleMouseWheel: false
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}, props), children)));
|
|
86
|
-
});
|
|
87
|
-
export default /*#__PURE__*/React.memo(FullScreenEditor);
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
4
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
6
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
7
|
-
var _excluded = ["children"];
|
|
8
|
-
import React, { useEffect, forwardRef } from 'react';
|
|
9
|
-
import BaseEditor from "./BaseEditor";
|
|
10
|
-
import * as monaco from 'monaco-editor';
|
|
11
|
-
import { isNil } from 'lodash';
|
|
12
|
-
function capitalizeFirstLetter(string) {
|
|
13
|
-
if (isNil(string)) return null;
|
|
14
|
-
if (string.length === 0) {
|
|
15
|
-
return ''; // 如果字符串为空,返回空字符串
|
|
16
|
-
}
|
|
17
|
-
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
18
|
-
}
|
|
19
|
-
var _provideCompletionItems = function provideCompletionItems(monaco, model, position, module) {
|
|
20
|
-
var textUntilPosition = model.getValueInRange({
|
|
21
|
-
startLineNumber: 1,
|
|
22
|
-
startColumn: 1,
|
|
23
|
-
endLineNumber: position.lineNumber,
|
|
24
|
-
endColumn: position.column
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
// 正则表达式匹配以 triggerWord 开头的任何单词
|
|
28
|
-
var pattern = new RegExp('\\b' + module.triggerWord + '[\\w.]*', 'i');
|
|
29
|
-
var match = textUntilPosition.match(pattern);
|
|
30
|
-
// console.log('match',match)
|
|
31
|
-
if (match) {
|
|
32
|
-
var word = model.getWordUntilPosition(position);
|
|
33
|
-
var range = {
|
|
34
|
-
startLineNumber: position.lineNumber,
|
|
35
|
-
endLineNumber: position.lineNumber,
|
|
36
|
-
startColumn: word.startColumn,
|
|
37
|
-
endColumn: word.endColumn
|
|
38
|
-
};
|
|
39
|
-
return module.completions.map(function (completion) {
|
|
40
|
-
return _objectSpread(_objectSpread({}, completion), {}, {
|
|
41
|
-
range: range,
|
|
42
|
-
kind: monaco.languages.CompletionItemKind[capitalizeFirstLetter(completion.kind)]
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
return [];
|
|
47
|
-
};
|
|
48
|
-
var setupAutocomplete = /*#__PURE__*/function () {
|
|
49
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(monaco) {
|
|
50
|
-
var autoCompleteModules;
|
|
51
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
52
|
-
while (1) switch (_context.prev = _context.next) {
|
|
53
|
-
case 0:
|
|
54
|
-
_context.next = 2;
|
|
55
|
-
return import("../../../engine/meta/js-editor/auto-complete.json");
|
|
56
|
-
case 2:
|
|
57
|
-
autoCompleteModules = _context.sent;
|
|
58
|
-
// console.log('autoCompleteModules', autoCompleteModules);
|
|
59
|
-
|
|
60
|
-
monaco.languages.registerCompletionItemProvider('javascript', _defineProperty({
|
|
61
|
-
triggerCharacters: ['.'],
|
|
62
|
-
provideCompletionItems: function provideCompletionItems(model, position) {
|
|
63
|
-
var allCompletionItems = [];
|
|
64
|
-
|
|
65
|
-
// 从所有模块收集补全项
|
|
66
|
-
autoCompleteModules.default.forEach(function (module) {
|
|
67
|
-
var items = _provideCompletionItems(monaco, model, position, module);
|
|
68
|
-
allCompletionItems = allCompletionItems.concat(items);
|
|
69
|
-
});
|
|
70
|
-
return {
|
|
71
|
-
suggestions: allCompletionItems
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
}, "triggerCharacters", ['.']));
|
|
75
|
-
case 4:
|
|
76
|
-
case "end":
|
|
77
|
-
return _context.stop();
|
|
78
|
-
}
|
|
79
|
-
}, _callee);
|
|
80
|
-
}));
|
|
81
|
-
return function setupAutocomplete(_x) {
|
|
82
|
-
return _ref.apply(this, arguments);
|
|
83
|
-
};
|
|
84
|
-
}();
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* JSEditor 组件是一个专为 JavaScript 编辑设计的 React 组件,它基于 BaseEditor 组件构建,并集成了自动完成功能。
|
|
88
|
-
* 该组件利用 monaco-editor 提供的 API,通过 setupAutocomplete 函数设置自动完成项,从而增强代码编辑体验。
|
|
89
|
-
* 自动完成逻辑包括从预定义的自动完成模块中加载补全项,以及在编辑器中键入特定字符(如".")时触发补全建议。
|
|
90
|
-
*
|
|
91
|
-
* @component
|
|
92
|
-
* @example
|
|
93
|
-
* <JSEditor
|
|
94
|
-
* language="javascript"
|
|
95
|
-
* options={{ fontSize: 14 }}
|
|
96
|
-
* >
|
|
97
|
-
* {`function sayHello() {\n console.log('Hello, World!');\n}`}
|
|
98
|
-
* </JSEditor>
|
|
99
|
-
*
|
|
100
|
-
* @param {Object} props - 组件的属性。
|
|
101
|
-
* @param {React.ReactNode} children - 传递给 BaseEditor 的 children,通常是初始代码或内容。
|
|
102
|
-
* @param {Object} rest - 传递给 BaseEditor 组件的其他属性。
|
|
103
|
-
* @param {React.Ref} ref - React ref 引用,用于在外部组件中访问 BaseEditor 实例的方法。
|
|
104
|
-
*
|
|
105
|
-
* @returns {ReactElement} 返回一个 React 元素,其中包含了一个具有自动完成功能的 JavaScript 编辑器实例。
|
|
106
|
-
*/
|
|
107
|
-
var JSEditor = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
108
|
-
var children = _ref2.children,
|
|
109
|
-
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
110
|
-
useEffect(function () {
|
|
111
|
-
setupAutocomplete(monaco);
|
|
112
|
-
}, []);
|
|
113
|
-
return /*#__PURE__*/React.createElement(BaseEditor, _extends({
|
|
114
|
-
ref: ref
|
|
115
|
-
}, rest), children);
|
|
116
|
-
});
|
|
117
|
-
export default /*#__PURE__*/React.memo(JSEditor);
|
|
@@ -1,41 +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
|
-
import React, { forwardRef } from 'react';
|
|
5
|
-
import BaseEditor from "./BaseEditor";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* JsonEditor 组件是一个专门用于编辑 CSS 代码的 React 组件,它基于 BaseEditor 组件构建。
|
|
9
|
-
* 该组件通过将 language 属性固定设置为 "css",确保编辑器环境专门用于 CSS 代码编辑。
|
|
10
|
-
* 用户可以传入 CSS 代码作为 children,并通过其他 props 控制 BaseEditor 提供的额外功能。
|
|
11
|
-
*
|
|
12
|
-
* @component
|
|
13
|
-
* @example
|
|
14
|
-
* const handleCssChange = (newCss, event) => {
|
|
15
|
-
* console.log('CSS changed: ', newCss);
|
|
16
|
-
* };
|
|
17
|
-
* <JsonEditor
|
|
18
|
-
* onChange={handleCssChange}
|
|
19
|
-
* isFullscreen={false}
|
|
20
|
-
* width="600px"
|
|
21
|
-
* height="400px"
|
|
22
|
-
* >
|
|
23
|
-
* {`body { margin: 0; font-family: Arial, sans-serif; }`}
|
|
24
|
-
* </JsonEditor>
|
|
25
|
-
*
|
|
26
|
-
* @param {Object} props - 组件的属性。
|
|
27
|
-
* @param {React.ReactNode} children - 子组件,通常是编辑器的初始 CSS 代码。
|
|
28
|
-
* @param {Object} rest - 传递给 BaseEditor 组件的其他属性。
|
|
29
|
-
* @param {React.Ref} ref - React ref 引用,用于外部组件调用编辑器实例的方法。
|
|
30
|
-
*
|
|
31
|
-
* @returns {ReactElement} 返回一个 React 元素,该元素内部是一个专门用于 CSS 编辑的 BaseEditor 组件实例。
|
|
32
|
-
*/
|
|
33
|
-
var JsonEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
34
|
-
var children = _ref.children,
|
|
35
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
36
|
-
return /*#__PURE__*/React.createElement(BaseEditor, _extends({
|
|
37
|
-
ref: ref,
|
|
38
|
-
language: "json"
|
|
39
|
-
}, rest), children);
|
|
40
|
-
});
|
|
41
|
-
export default /*#__PURE__*/React.memo(JsonEditor);
|