@luck-design-biz/luckda 1.0.0-alpha → 1.0.1-10
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 +21 -21
- package/README.md +40 -40
- package/es/components/Builder/index.js +15 -3
- package/es/components/ComplexItem/index.js +65 -49
- package/es/components/LDActions/index.less +68 -68
- package/es/components/LdAutoForm/index.js +6 -4
- package/es/components/LdFormList/index.js +11 -10
- package/es/components/LdGrid/index.js +4 -4
- package/es/components/LdGridForm/index.js +40 -23
- package/es/components/LdGridForm/index.less +7 -7
- package/es/components/LdTree/index.less +40 -40
- package/es/helper/action.js +6 -6
- package/es/helper/form.js +15 -14
- package/es/helper/index.less +7 -7
- package/es/helper/ldBuilder.js +8 -3
- package/es/locales/zh-CN.js +41 -4
- package/es/lowcode/constants/api-url.js +87 -87
- package/es/lowcode/constants/event-topics.js +0 -2
- package/es/lowcode/engine/launcher.js +3 -1
- package/es/lowcode/engine/meta/box.props.json +3 -3
- package/es/lowcode/engine/meta/button.props.default.json +1 -1
- package/es/lowcode/engine/meta/button.props.json +2 -2
- package/es/lowcode/engine/meta/cardlist.props.default.json +1 -0
- package/es/lowcode/engine/meta/cardlist.props.json +2 -1
- package/es/lowcode/engine/meta/components-list.json +6 -126
- package/es/lowcode/engine/meta/dialog.props.default.json +4 -2
- package/es/lowcode/engine/meta/dialog.props.json +76 -20
- package/es/lowcode/engine/meta/drawer.props.default.json +15 -4
- package/es/lowcode/engine/meta/drawer.props.json +144 -24
- package/es/lowcode/engine/meta/fieldcomplex.props.default.json +1 -0
- package/es/lowcode/engine/meta/fieldcomplex.props.json +7 -0
- package/es/lowcode/engine/meta/fielddatadic.props.default.json +16 -0
- package/es/lowcode/engine/meta/fielddatadic.props.json +73 -0
- package/es/lowcode/engine/meta/fielddate.props.default.json +2 -0
- package/es/lowcode/engine/meta/fielddate.props.json +4 -2
- package/es/lowcode/engine/meta/fieldnumber.props.default.json +1 -0
- package/es/lowcode/engine/meta/fieldnumber.props.json +3 -2
- package/es/lowcode/engine/meta/fielduser.props.default.json +1 -1
- package/es/lowcode/engine/meta/fielduser.props.json +1 -1
- package/es/lowcode/engine/meta/form.props.default.json +14 -4
- package/es/lowcode/engine/meta/form.props.json +53 -14
- package/es/lowcode/engine/meta/grouptree.props.default.json +16 -0
- package/es/lowcode/engine/meta/grouptree.props.json +89 -0
- package/es/lowcode/engine/meta/iframe.props.default.json +2 -1
- package/es/lowcode/engine/meta/iframe.props.json +3 -2
- package/es/lowcode/engine/meta/image.props.default.json +2 -1
- package/es/lowcode/engine/meta/image.props.json +3 -2
- package/es/lowcode/engine/meta/imex.props.default.json +2 -1
- package/es/lowcode/engine/meta/imex.props.json +27 -6
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +65 -42
- package/es/lowcode/engine/meta/jsx.props.default.json +1 -1
- package/es/lowcode/engine/meta/jsx.props.json +1 -1
- package/es/lowcode/engine/meta/layout.props.default.json +1 -1
- package/es/lowcode/engine/meta/layout.props.json +5 -5
- package/es/lowcode/engine/meta/link.props.default.json +2 -1
- package/es/lowcode/engine/meta/link.props.json +3 -2
- package/es/lowcode/engine/meta/page.props.json +6 -0
- package/es/lowcode/engine/meta/pagelayout.props.default.json +1 -1
- package/es/lowcode/engine/meta/pagelayout.props.json +1 -1
- package/es/lowcode/engine/meta/section.props.json +2 -1
- package/es/lowcode/engine/meta/split.props.default.json +1 -1
- package/es/lowcode/engine/meta/split.props.json +1 -1
- package/es/lowcode/engine/meta/table.props.json +3 -3
- package/es/lowcode/engine/meta/text.props.default.json +4 -2
- package/es/lowcode/engine/meta/text.props.json +8 -6
- package/es/lowcode/engine/meta/tree.props.json +2 -2
- package/es/lowcode/engine/provider/ContextProvider/index.js +83 -66
- package/es/lowcode/engine/provider/ContextProvider/router.js +43 -0
- package/es/lowcode/engine/{tools → provider/ContextProvider}/usePageDataStore.js +9 -7
- package/es/lowcode/engine/provider/ContextProvider/usePageVar.js +38 -15
- package/es/lowcode/engine/{tools → provider/ContextProvider}/useTodo.js +5 -7
- package/es/lowcode/engine/provider/ContextProvider/utils.js +157 -0
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +1 -2
- package/es/lowcode/engine/tools/dataProcess.js +76 -76
- package/es/lowcode/engine/tools/helper.js +28 -2
- package/es/lowcode/engine/tools/initDS.js +263 -0
- package/es/lowcode/engine/tools/useCanvasRender.js +13 -1
- package/es/lowcode/engine/tools/useCombinedRefs.js +3 -2
- package/es/lowcode/painter/Components.js +2 -2
- package/es/lowcode/painter/Design.js +1 -0
- package/es/lowcode/painter/DesignOperator.js +25 -11
- package/es/lowcode/painter/Panel.js +2 -2
- package/es/lowcode/painter/components/AdvancePanel.js +3 -3
- package/es/lowcode/painter/components/Collapse.js +31 -28
- package/es/lowcode/painter/components/ColorInput.js +24 -24
- package/es/lowcode/painter/components/ListEditor.js +24 -24
- package/es/lowcode/painter/components/NumberInput.js +29 -29
- package/es/lowcode/painter/components/PanelItem.js +24 -24
- package/es/lowcode/painter/components/PopConfirm.js +8 -8
- package/es/lowcode/painter/components/PopForm.js +27 -27
- package/es/lowcode/painter/components/RuleInput.js +30 -30
- package/es/lowcode/painter/components/SortBox.js +22 -22
- package/es/lowcode/painter/components/TipIcon.js +16 -0
- package/es/lowcode/painter/components/VarEditor.js +456 -0
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +32 -32
- package/es/lowcode/painter/components/code-editor/CssEditor.js +25 -25
- package/es/lowcode/painter/components/code-editor/FullScreenEditor.js +25 -25
- package/es/lowcode/painter/components/code-editor/JSEditor.js +23 -21
- package/es/lowcode/painter/components/code-editor/JsonEditor.js +25 -25
- package/es/lowcode/painter/components/code-editor/VisionEditor.js +81 -0
- package/es/lowcode/painter/components/field-setting/SettingUI.js +47 -5
- package/es/lowcode/painter/components/field-setting/index.js +27 -13
- package/es/lowcode/painter/components/field-setting/meta/frontRules.js +2 -1
- package/es/lowcode/painter/index.js +1 -0
- package/es/lowcode/painter/panel-section/BlockEditor/index.js +20 -6
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +2 -2
- package/es/lowcode/painter/panel-section/ComplexPop.js +242 -0
- package/es/lowcode/painter/panel-section/DataSetSelector.js +8 -0
- package/es/lowcode/painter/panel-section/FieldsSetting.js +30 -4
- package/es/lowcode/painter/panel-section/GroupClassSelector.js +55 -0
- package/es/lowcode/painter/panel-section/I18nInput.js +4 -2
- package/es/lowcode/painter/panel-section/Icon.js +32 -27
- package/es/lowcode/painter/panel-section/IconConditionSelector.js +7 -7
- package/es/lowcode/painter/panel-section/IconSelector.js +17 -17
- package/es/lowcode/painter/panel-section/ImpExp.js +1 -27
- package/es/lowcode/painter/panel-section/ImpExpAlone.js +1 -2
- package/es/lowcode/painter/panel-section/LayoutRatio.js +22 -21
- package/es/lowcode/painter/panel-section/PageVars.js +300 -0
- package/es/lowcode/painter/panel-section/StylePanel/BackGround.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Border.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/BorderRadius.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/BorderRadiusSelector.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/BorderSelector.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Display.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Font.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/FontEditor.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/GapSelector.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/HighLightPanel.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/HighLigthtSpan.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/HightLightSvg.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Margin.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Opacity.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Padding.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Pointer.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Shadow.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/Size.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/StyleContext.js +6 -5
- package/es/lowcode/painter/panel-section/StylePanel/StyleRow.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/WidthHeight.js +2 -2
- package/es/lowcode/painter/panel-section/StylePanel/index.js +15 -15
- package/es/lowcode/painter/panel-section/TabItems.js +6 -42
- package/es/lowcode/painter/panel-section/TextContent.js +79 -0
- package/es/lowcode/painter/services/complexPop.js +21 -0
- package/es/lowcode/painter/style/action-bind-modal.less +102 -102
- package/es/lowcode/painter/style/actions-editor.less +15 -15
- package/es/lowcode/painter/style/border-editor.less +36 -36
- package/es/lowcode/painter/style/border-radius-selector.less +42 -42
- package/es/lowcode/painter/style/border-selector.less +39 -39
- package/es/lowcode/painter/style/button-type.less +5 -5
- package/es/lowcode/painter/style/collapse.less +28 -28
- package/es/lowcode/painter/style/color-input.less +19 -19
- package/es/lowcode/painter/style/components.less +91 -91
- package/es/lowcode/painter/style/design.less +166 -160
- package/es/lowcode/painter/style/display.less +17 -17
- package/es/lowcode/painter/style/dragdrop.less +10 -10
- package/es/lowcode/painter/style/fields-setting.less +25 -25
- package/es/lowcode/painter/style/font-editor.less +9 -9
- package/es/lowcode/painter/style/fullscreen-editor.less +17 -17
- package/es/lowcode/painter/style/icon-selector.less +22 -22
- package/es/lowcode/painter/style/icon.less +10 -10
- package/es/lowcode/painter/style/impexp.less +7 -7
- package/es/lowcode/painter/style/index.less +6 -6
- package/es/lowcode/painter/style/layout-ratio.less +51 -51
- package/es/lowcode/painter/style/list-editor.less +95 -95
- package/es/lowcode/painter/style/number-input.less +17 -17
- package/es/lowcode/painter/style/outline.less +28 -28
- package/es/lowcode/painter/style/page-layout-display.less +27 -27
- package/es/lowcode/painter/style/page-vars.less +25 -0
- package/es/lowcode/painter/style/panel-attrs.less +43 -43
- package/es/lowcode/painter/style/panel-item.less +54 -54
- package/es/lowcode/painter/style/panel.less +98 -98
- package/es/lowcode/painter/style/pop-confirm.less +17 -17
- package/es/lowcode/painter/style/pop-form.less +19 -19
- package/es/lowcode/painter/style/radio.less +24 -24
- package/es/lowcode/painter/style/ribbon.less +5 -5
- package/es/lowcode/painter/style/rule-input.less +12 -12
- package/es/lowcode/painter/style/split-display.less +18 -18
- package/es/lowcode/painter/style/style-panel.less +37 -37
- package/es/lowcode/painter/style/tabitems.less +90 -90
- package/es/lowcode/painter/style/treedragdrop.less +19 -19
- package/es/lowcode/preview/index.js +1 -0
- package/es/lowcode/view/Canvas.js +24 -22
- package/es/lowcode/view/Loading.js +5 -7
- package/es/lowcode/view/Page.js +37 -15
- package/es/lowcode/view/index.js +1 -0
- package/es/lowcode/view/lc-components/Box/index.js +22 -7
- package/es/lowcode/view/lc-components/Box/index.less +14 -14
- package/es/lowcode/view/lc-components/Box/meta.json +40 -40
- package/es/lowcode/view/lc-components/Button/index.js +40 -40
- package/es/lowcode/view/lc-components/Button/meta.json +127 -127
- package/es/lowcode/view/lc-components/Button/style.less +2 -2
- package/es/lowcode/view/lc-components/CardList/meta.json +154 -153
- package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +14 -6
- package/es/lowcode/view/lc-components/Dialog/index.js +34 -25
- package/es/lowcode/view/lc-components/Dialog/index.less +12 -8
- package/es/lowcode/view/lc-components/Dialog/meta.json +204 -150
- package/es/lowcode/view/lc-components/Drawer/FunctionDesign.js +51 -8
- package/es/lowcode/view/lc-components/Drawer/index.js +149 -34
- package/es/lowcode/view/lc-components/Drawer/index.less +13 -10
- package/es/lowcode/view/lc-components/Drawer/meta.json +242 -131
- package/es/lowcode/view/lc-components/FieldColor/meta.json +157 -157
- package/es/lowcode/view/lc-components/FieldComplex/meta.json +140 -133
- package/es/lowcode/view/lc-components/FieldDate/meta.json +141 -139
- package/es/lowcode/view/lc-components/FieldDict/meta.json +138 -138
- package/es/lowcode/view/lc-components/FieldEditor/meta.json +138 -138
- package/es/lowcode/view/lc-components/FieldGroup/meta.json +167 -167
- package/es/lowcode/view/lc-components/FieldNumber/meta.json +143 -142
- package/es/lowcode/view/lc-components/FieldRadio/meta.json +115 -115
- package/es/lowcode/view/lc-components/FieldRegion/meta.json +121 -121
- package/es/lowcode/view/lc-components/FieldSelect/meta.json +152 -152
- package/es/lowcode/view/lc-components/FieldString/meta.json +152 -152
- package/es/lowcode/view/lc-components/FieldSwitch/meta.json +125 -125
- package/es/lowcode/view/lc-components/FieldTextarea/meta.json +143 -143
- package/es/lowcode/view/lc-components/FieldUpload/meta.json +165 -165
- package/es/lowcode/view/lc-components/FieldUser/meta.json +176 -176
- package/es/lowcode/view/lc-components/FieldYear/meta.json +129 -129
- package/es/lowcode/view/lc-components/Form/FunctionDesign.js +2 -1
- package/es/lowcode/view/lc-components/Form/index.js +76 -51
- package/es/lowcode/view/lc-components/Form/meta.json +645 -610
- package/es/lowcode/view/lc-components/GroupTree/FunctionDesign.js +10 -0
- package/es/lowcode/view/lc-components/GroupTree/FunctionLive.js +10 -0
- package/es/lowcode/view/lc-components/GroupTree/FunctionPreview.js +10 -0
- package/es/lowcode/view/lc-components/GroupTree/index.js +201 -0
- package/es/lowcode/view/lc-components/GroupTree/meta.json +89 -0
- package/es/lowcode/view/lc-components/Iframe/meta.json +33 -32
- package/es/lowcode/view/lc-components/ImEx/index.js +199 -128
- package/es/lowcode/view/lc-components/ImEx/index.less +7 -7
- package/es/lowcode/view/lc-components/ImEx/meta.json +134 -113
- package/es/lowcode/view/lc-components/Image/meta.json +115 -114
- package/es/lowcode/view/lc-components/JSX/RuntimeComp.js +4 -4
- package/es/lowcode/view/lc-components/JSX/meta.json +28 -28
- package/es/lowcode/view/lc-components/Layout/index.js +38 -21
- package/es/lowcode/view/lc-components/Layout/index.less +5 -5
- package/es/lowcode/view/lc-components/Layout/meta.json +107 -107
- package/es/lowcode/view/lc-components/Link/meta.json +113 -112
- package/es/lowcode/view/lc-components/Page/meta.json +61 -55
- package/es/lowcode/view/lc-components/PageContent/meta.json +9 -9
- package/es/lowcode/view/lc-components/PageFooter/meta.json +9 -9
- package/es/lowcode/view/lc-components/PageHeader/meta.json +9 -9
- package/es/lowcode/view/lc-components/PageLayout/FunctionDesign.js +5 -1
- package/es/lowcode/view/lc-components/PageLayout/meta.json +59 -59
- package/es/lowcode/view/lc-components/Section/index.js +2 -6
- package/es/lowcode/view/lc-components/Section/index.less +7 -7
- package/es/lowcode/view/lc-components/Section/meta.json +108 -107
- package/es/lowcode/view/lc-components/Split/index.js +19 -4
- package/es/lowcode/view/lc-components/Split/meta.json +53 -53
- package/es/lowcode/view/lc-components/Table/index.js +175 -148
- package/es/lowcode/view/lc-components/Table/meta.json +450 -450
- package/es/lowcode/view/lc-components/Tabs/index.js +42 -39
- package/es/lowcode/view/lc-components/Tabs/meta.json +113 -113
- package/es/lowcode/view/lc-components/Text/index.js +9 -2
- package/es/lowcode/view/lc-components/Text/meta.json +56 -56
- package/es/lowcode/view/lc-components/Tree/index.js +102 -107
- package/es/lowcode/view/lc-components/Tree/index.less +4 -4
- package/es/lowcode/view/lc-components/Tree/meta.json +357 -357
- package/es/lowcode/view/lc-components/Wrapper.js +17 -2
- package/es/lowcode/view/style/canvas.less +5 -5
- package/es/lowcode/view/style/loading.less +98 -84
- package/es/lowcode/view/style/page.less +7 -7
- package/es/services.js +19 -0
- package/es/upload/FilesWall/index.js +13 -13
- package/es/upload/FilesWall/index.less +74 -74
- package/es/upload/Form/gridForm.js +17 -7
- package/es/upload/Form/index.less +7 -7
- package/es/upload/FormItem/index.js +18 -18
- package/es/utils/form.js +25 -25
- package/es/utils/grid.js +5 -4
- package/lib/components/Builder/index.js +13 -1
- package/lib/components/ComplexItem/index.js +62 -47
- package/lib/components/LDActions/index.less +68 -68
- package/lib/components/LdAutoForm/index.js +5 -3
- package/lib/components/LdFormList/index.js +12 -11
- package/lib/components/LdGrid/index.js +4 -4
- package/lib/components/LdGridForm/index.js +40 -23
- package/lib/components/LdGridForm/index.less +7 -7
- package/lib/components/LdTree/index.less +40 -40
- package/lib/helper/action.js +6 -6
- package/lib/helper/form.js +15 -14
- package/lib/helper/index.less +7 -7
- package/lib/helper/ldBuilder.js +8 -3
- package/lib/locales/zh-CN.js +41 -4
- package/lib/lowcode/constants/api-url.js +87 -87
- package/lib/lowcode/constants/event-topics.js +1 -3
- package/lib/lowcode/engine/launcher.js +3 -1
- package/lib/lowcode/engine/meta/box.props.json +3 -3
- package/lib/lowcode/engine/meta/button.props.default.json +1 -1
- package/lib/lowcode/engine/meta/button.props.json +2 -2
- package/lib/lowcode/engine/meta/cardlist.props.default.json +1 -0
- package/lib/lowcode/engine/meta/cardlist.props.json +2 -1
- package/lib/lowcode/engine/meta/components-list.json +6 -126
- package/lib/lowcode/engine/meta/dialog.props.default.json +4 -2
- package/lib/lowcode/engine/meta/dialog.props.json +76 -20
- package/lib/lowcode/engine/meta/drawer.props.default.json +15 -4
- package/lib/lowcode/engine/meta/drawer.props.json +144 -24
- package/lib/lowcode/engine/meta/fieldcomplex.props.default.json +1 -0
- package/lib/lowcode/engine/meta/fieldcomplex.props.json +7 -0
- package/lib/lowcode/engine/meta/fielddatadic.props.default.json +16 -0
- package/lib/lowcode/engine/meta/fielddatadic.props.json +73 -0
- package/lib/lowcode/engine/meta/fielddate.props.default.json +2 -0
- package/lib/lowcode/engine/meta/fielddate.props.json +4 -2
- package/lib/lowcode/engine/meta/fieldnumber.props.default.json +1 -0
- package/lib/lowcode/engine/meta/fieldnumber.props.json +3 -2
- package/lib/lowcode/engine/meta/fielduser.props.default.json +1 -1
- package/lib/lowcode/engine/meta/fielduser.props.json +1 -1
- package/lib/lowcode/engine/meta/form.props.default.json +14 -4
- package/lib/lowcode/engine/meta/form.props.json +53 -14
- package/lib/lowcode/engine/meta/grouptree.props.default.json +16 -0
- package/lib/lowcode/engine/meta/grouptree.props.json +89 -0
- package/lib/lowcode/engine/meta/iframe.props.default.json +2 -1
- package/lib/lowcode/engine/meta/iframe.props.json +3 -2
- package/lib/lowcode/engine/meta/image.props.default.json +2 -1
- package/lib/lowcode/engine/meta/image.props.json +3 -2
- package/lib/lowcode/engine/meta/imex.props.default.json +2 -1
- package/lib/lowcode/engine/meta/imex.props.json +27 -6
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +65 -42
- package/lib/lowcode/engine/meta/jsx.props.default.json +1 -1
- package/lib/lowcode/engine/meta/jsx.props.json +1 -1
- package/lib/lowcode/engine/meta/layout.props.default.json +1 -1
- package/lib/lowcode/engine/meta/layout.props.json +5 -5
- package/lib/lowcode/engine/meta/link.props.default.json +2 -1
- package/lib/lowcode/engine/meta/link.props.json +3 -2
- package/lib/lowcode/engine/meta/page.props.json +6 -0
- package/lib/lowcode/engine/meta/pagelayout.props.default.json +1 -1
- package/lib/lowcode/engine/meta/pagelayout.props.json +1 -1
- package/lib/lowcode/engine/meta/section.props.json +2 -1
- package/lib/lowcode/engine/meta/split.props.default.json +1 -1
- package/lib/lowcode/engine/meta/split.props.json +1 -1
- package/lib/lowcode/engine/meta/table.props.json +3 -3
- package/lib/lowcode/engine/meta/text.props.default.json +4 -2
- package/lib/lowcode/engine/meta/text.props.json +8 -6
- package/lib/lowcode/engine/meta/tree.props.json +2 -2
- package/lib/lowcode/engine/provider/ContextProvider/index.js +81 -64
- package/lib/lowcode/engine/provider/ContextProvider/router.js +57 -0
- package/lib/lowcode/engine/{tools → provider/ContextProvider}/usePageDataStore.js +9 -7
- package/lib/lowcode/engine/provider/ContextProvider/usePageVar.js +38 -16
- package/lib/lowcode/engine/{tools → provider/ContextProvider}/useTodo.js +5 -7
- package/lib/lowcode/engine/provider/ContextProvider/utils.js +170 -0
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +2 -3
- package/lib/lowcode/engine/tools/dataProcess.js +76 -76
- package/lib/lowcode/engine/tools/helper.js +29 -2
- package/lib/lowcode/engine/tools/initDS.js +270 -0
- package/lib/lowcode/engine/tools/useCanvasRender.js +13 -1
- package/lib/lowcode/engine/tools/useCombinedRefs.js +2 -1
- package/lib/lowcode/painter/Components.js +2 -2
- package/lib/lowcode/painter/Design.js +1 -0
- package/lib/lowcode/painter/DesignOperator.js +24 -10
- package/lib/lowcode/painter/Panel.js +2 -2
- package/lib/lowcode/painter/components/AdvancePanel.js +3 -3
- package/lib/lowcode/painter/components/Collapse.js +31 -28
- package/lib/lowcode/painter/components/ColorInput.js +24 -24
- package/lib/lowcode/painter/components/ListEditor.js +24 -24
- package/lib/lowcode/painter/components/NumberInput.js +29 -29
- package/lib/lowcode/painter/components/PanelItem.js +24 -24
- package/lib/lowcode/painter/components/PopConfirm.js +8 -8
- package/lib/lowcode/painter/components/PopForm.js +27 -27
- package/lib/lowcode/painter/components/RuleInput.js +30 -30
- package/lib/lowcode/painter/components/SortBox.js +22 -22
- package/lib/lowcode/painter/components/TipIcon.js +23 -0
- package/lib/lowcode/painter/components/VarEditor.js +463 -0
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +32 -32
- package/lib/lowcode/painter/components/code-editor/CssEditor.js +25 -25
- package/lib/lowcode/painter/components/code-editor/FullScreenEditor.js +25 -25
- package/lib/lowcode/painter/components/code-editor/JSEditor.js +23 -21
- package/lib/lowcode/painter/components/code-editor/JsonEditor.js +25 -25
- package/lib/lowcode/painter/components/code-editor/VisionEditor.js +88 -0
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +46 -4
- package/lib/lowcode/painter/components/field-setting/index.js +27 -13
- package/lib/lowcode/painter/components/field-setting/meta/frontRules.js +2 -1
- package/lib/lowcode/painter/index.js +1 -0
- package/lib/lowcode/painter/panel-section/BlockEditor/index.js +19 -5
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +2 -2
- package/lib/lowcode/painter/panel-section/ComplexPop.js +250 -0
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +8 -0
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +30 -4
- package/lib/lowcode/painter/panel-section/GroupClassSelector.js +63 -0
- package/lib/lowcode/painter/panel-section/I18nInput.js +4 -2
- package/lib/lowcode/painter/panel-section/Icon.js +31 -26
- package/lib/lowcode/painter/panel-section/IconConditionSelector.js +6 -6
- package/lib/lowcode/painter/panel-section/IconSelector.js +17 -17
- package/lib/lowcode/painter/panel-section/ImpExp.js +0 -26
- package/lib/lowcode/painter/panel-section/ImpExpAlone.js +0 -1
- package/lib/lowcode/painter/panel-section/LayoutRatio.js +22 -21
- package/lib/lowcode/painter/panel-section/PageVars.js +308 -0
- package/lib/lowcode/painter/panel-section/StylePanel/BackGround.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Border.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/BorderRadius.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/BorderRadiusSelector.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/BorderSelector.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Display.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Font.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/FontEditor.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/GapSelector.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/HighLightPanel.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/HighLigthtSpan.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/HightLightSvg.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/MainPanel.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Margin.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Opacity.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Padding.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Pointer.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Shadow.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/Size.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/StyleContext.js +6 -5
- package/lib/lowcode/painter/panel-section/StylePanel/StyleRow.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/WidthHeight.js +2 -2
- package/lib/lowcode/painter/panel-section/StylePanel/index.js +15 -15
- package/lib/lowcode/painter/panel-section/TabItems.js +6 -42
- package/lib/lowcode/painter/panel-section/TextContent.js +87 -0
- package/lib/lowcode/painter/services/complexPop.js +28 -0
- package/lib/lowcode/painter/style/action-bind-modal.less +102 -102
- package/lib/lowcode/painter/style/actions-editor.less +15 -15
- package/lib/lowcode/painter/style/border-editor.less +36 -36
- package/lib/lowcode/painter/style/border-radius-selector.less +42 -42
- package/lib/lowcode/painter/style/border-selector.less +39 -39
- package/lib/lowcode/painter/style/button-type.less +5 -5
- package/lib/lowcode/painter/style/collapse.less +28 -28
- package/lib/lowcode/painter/style/color-input.less +19 -19
- package/lib/lowcode/painter/style/components.less +91 -91
- package/lib/lowcode/painter/style/design.less +166 -160
- package/lib/lowcode/painter/style/display.less +17 -17
- package/lib/lowcode/painter/style/dragdrop.less +10 -10
- package/lib/lowcode/painter/style/fields-setting.less +25 -25
- package/lib/lowcode/painter/style/font-editor.less +9 -9
- package/lib/lowcode/painter/style/fullscreen-editor.less +17 -17
- package/lib/lowcode/painter/style/icon-selector.less +22 -22
- package/lib/lowcode/painter/style/icon.less +10 -10
- package/lib/lowcode/painter/style/impexp.less +7 -7
- package/lib/lowcode/painter/style/index.less +6 -6
- package/lib/lowcode/painter/style/layout-ratio.less +51 -51
- package/lib/lowcode/painter/style/list-editor.less +95 -95
- package/lib/lowcode/painter/style/number-input.less +17 -17
- package/lib/lowcode/painter/style/outline.less +28 -28
- package/lib/lowcode/painter/style/page-layout-display.less +27 -27
- package/lib/lowcode/painter/style/page-vars.less +25 -0
- package/lib/lowcode/painter/style/panel-attrs.less +43 -43
- package/lib/lowcode/painter/style/panel-item.less +54 -54
- package/lib/lowcode/painter/style/panel.less +98 -98
- package/lib/lowcode/painter/style/pop-confirm.less +17 -17
- package/lib/lowcode/painter/style/pop-form.less +19 -19
- package/lib/lowcode/painter/style/radio.less +24 -24
- package/lib/lowcode/painter/style/ribbon.less +5 -5
- package/lib/lowcode/painter/style/rule-input.less +12 -12
- package/lib/lowcode/painter/style/split-display.less +18 -18
- package/lib/lowcode/painter/style/style-panel.less +37 -37
- package/lib/lowcode/painter/style/tabitems.less +90 -90
- package/lib/lowcode/painter/style/treedragdrop.less +19 -19
- package/lib/lowcode/preview/index.js +1 -0
- package/lib/lowcode/view/Canvas.js +24 -22
- package/lib/lowcode/view/Loading.js +5 -7
- package/lib/lowcode/view/Page.js +35 -13
- package/lib/lowcode/view/index.js +1 -0
- package/lib/lowcode/view/lc-components/Box/index.js +21 -6
- package/lib/lowcode/view/lc-components/Box/index.less +14 -14
- package/lib/lowcode/view/lc-components/Box/meta.json +40 -40
- package/lib/lowcode/view/lc-components/Button/index.js +38 -38
- package/lib/lowcode/view/lc-components/Button/meta.json +127 -127
- package/lib/lowcode/view/lc-components/Button/style.less +2 -2
- package/lib/lowcode/view/lc-components/CardList/meta.json +154 -153
- package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +13 -5
- package/lib/lowcode/view/lc-components/Dialog/index.js +34 -25
- package/lib/lowcode/view/lc-components/Dialog/index.less +12 -8
- package/lib/lowcode/view/lc-components/Dialog/meta.json +204 -150
- package/lib/lowcode/view/lc-components/Drawer/FunctionDesign.js +52 -8
- package/lib/lowcode/view/lc-components/Drawer/index.js +148 -33
- package/lib/lowcode/view/lc-components/Drawer/index.less +13 -10
- package/lib/lowcode/view/lc-components/Drawer/meta.json +242 -131
- package/lib/lowcode/view/lc-components/FieldColor/meta.json +157 -157
- package/lib/lowcode/view/lc-components/FieldComplex/meta.json +140 -133
- package/lib/lowcode/view/lc-components/FieldDate/meta.json +141 -139
- package/lib/lowcode/view/lc-components/FieldDict/meta.json +138 -138
- package/lib/lowcode/view/lc-components/FieldEditor/meta.json +138 -138
- package/lib/lowcode/view/lc-components/FieldGroup/meta.json +167 -167
- package/lib/lowcode/view/lc-components/FieldNumber/meta.json +143 -142
- package/lib/lowcode/view/lc-components/FieldRadio/meta.json +115 -115
- package/lib/lowcode/view/lc-components/FieldRegion/meta.json +121 -121
- package/lib/lowcode/view/lc-components/FieldSelect/meta.json +152 -152
- package/lib/lowcode/view/lc-components/FieldString/meta.json +152 -152
- package/lib/lowcode/view/lc-components/FieldSwitch/meta.json +125 -125
- package/lib/lowcode/view/lc-components/FieldTextarea/meta.json +143 -143
- package/lib/lowcode/view/lc-components/FieldUpload/meta.json +165 -165
- package/lib/lowcode/view/lc-components/FieldUser/meta.json +176 -176
- package/lib/lowcode/view/lc-components/FieldYear/meta.json +129 -129
- package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Form/index.js +75 -50
- package/lib/lowcode/view/lc-components/Form/meta.json +645 -610
- package/lib/lowcode/view/lc-components/GroupTree/FunctionDesign.js +17 -0
- package/lib/lowcode/view/lc-components/GroupTree/FunctionLive.js +17 -0
- package/lib/lowcode/view/lc-components/GroupTree/FunctionPreview.js +17 -0
- package/lib/lowcode/view/lc-components/GroupTree/index.js +209 -0
- package/lib/lowcode/view/lc-components/GroupTree/meta.json +89 -0
- package/lib/lowcode/view/lc-components/Iframe/meta.json +33 -32
- package/lib/lowcode/view/lc-components/ImEx/index.js +197 -126
- package/lib/lowcode/view/lc-components/ImEx/index.less +7 -7
- package/lib/lowcode/view/lc-components/ImEx/meta.json +134 -113
- package/lib/lowcode/view/lc-components/Image/meta.json +115 -114
- package/lib/lowcode/view/lc-components/JSX/RuntimeComp.js +4 -4
- package/lib/lowcode/view/lc-components/JSX/meta.json +28 -28
- package/lib/lowcode/view/lc-components/Layout/index.js +37 -20
- package/lib/lowcode/view/lc-components/Layout/index.less +5 -5
- package/lib/lowcode/view/lc-components/Layout/meta.json +107 -107
- package/lib/lowcode/view/lc-components/Link/meta.json +113 -112
- package/lib/lowcode/view/lc-components/Page/meta.json +61 -55
- package/lib/lowcode/view/lc-components/PageContent/meta.json +9 -9
- package/lib/lowcode/view/lc-components/PageFooter/meta.json +9 -9
- package/lib/lowcode/view/lc-components/PageHeader/meta.json +9 -9
- package/lib/lowcode/view/lc-components/PageLayout/FunctionDesign.js +5 -1
- package/lib/lowcode/view/lc-components/PageLayout/meta.json +59 -59
- package/lib/lowcode/view/lc-components/Section/index.js +2 -6
- package/lib/lowcode/view/lc-components/Section/index.less +7 -7
- package/lib/lowcode/view/lc-components/Section/meta.json +108 -107
- package/lib/lowcode/view/lc-components/Split/index.js +18 -3
- package/lib/lowcode/view/lc-components/Split/meta.json +53 -53
- package/lib/lowcode/view/lc-components/Table/index.js +176 -149
- package/lib/lowcode/view/lc-components/Table/meta.json +450 -450
- package/lib/lowcode/view/lc-components/Tabs/index.js +40 -37
- package/lib/lowcode/view/lc-components/Tabs/meta.json +113 -113
- package/lib/lowcode/view/lc-components/Text/index.js +8 -1
- package/lib/lowcode/view/lc-components/Text/meta.json +56 -56
- package/lib/lowcode/view/lc-components/Tree/index.js +102 -107
- package/lib/lowcode/view/lc-components/Tree/index.less +4 -4
- package/lib/lowcode/view/lc-components/Tree/meta.json +357 -357
- package/lib/lowcode/view/lc-components/Wrapper.js +16 -1
- package/lib/lowcode/view/style/canvas.less +5 -5
- package/lib/lowcode/view/style/loading.less +98 -84
- package/lib/lowcode/view/style/page.less +7 -7
- package/lib/services.js +20 -0
- package/lib/upload/FilesWall/index.js +13 -13
- package/lib/upload/FilesWall/index.less +74 -74
- package/lib/upload/Form/gridForm.js +17 -7
- package/lib/upload/Form/index.less +7 -7
- package/lib/upload/FormItem/index.js +18 -18
- package/lib/utils/form.js +24 -24
- package/lib/utils/grid.js +4 -3
- package/lowcode.js +1 -1
- package/package.json +175 -175
- package/upload.js +1 -1
- package/utils.js +1 -1
- package/es/lowcode/view/lc-components/Form/index.less +0 -5
- package/lib/lowcode/view/lc-components/Form/index.less +0 -5
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useDebounceFn, useCreation, useSet, useMemoizedFn } from 'ahooks';
|
|
5
|
+
import { Form, Input, Switch, Segmented, Dropdown, Menu } from 'luck-design/antd';
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
import { set, unset, get, intersection, keys } from 'lodash';
|
|
8
|
+
import { formatMessage } from '@luck-design-biz/base/utils';
|
|
9
|
+
import VisionEditor from "./code-editor/VisionEditor";
|
|
10
|
+
import JSEditor from "./code-editor/JSEditor";
|
|
11
|
+
import TipIcon from "./TipIcon";
|
|
12
|
+
var _I18N_PREFIX_ = 'luckda.lowcode.painter.pageVars';
|
|
13
|
+
var StyledForm = styled(Form).withConfig({
|
|
14
|
+
displayName: "StyledForm",
|
|
15
|
+
componentId: "luckda-6530__sc-iq6k7e-0"
|
|
16
|
+
})(["font-size:12px;.ant-form-item{font-size:12px;margin-bottom:0;}label{font-size:12px;}"]);
|
|
17
|
+
var StyledSegmented = styled(Segmented).withConfig({
|
|
18
|
+
displayName: "StyledSegmented",
|
|
19
|
+
componentId: "luckda-6530__sc-iq6k7e-1"
|
|
20
|
+
})(["width:100%;"]);
|
|
21
|
+
var EditorWrapper = styled.div.withConfig({
|
|
22
|
+
displayName: "EditorWrapper",
|
|
23
|
+
componentId: "luckda-6530__sc-iq6k7e-2"
|
|
24
|
+
})(["width:100%;height:80px;border:1px solid #d9d9d9;border-radius:4px;margin:8px 0;"]);
|
|
25
|
+
var LabelLine = styled.div.withConfig({
|
|
26
|
+
displayName: "LabelLine",
|
|
27
|
+
componentId: "luckda-6530__sc-iq6k7e-3"
|
|
28
|
+
})(["height:28px;background:rgba(31,56,88,0.04);border-top:1px solid rgba(31,56,88,0.1);border-bottom:1px solid rgba(31,56,88,0.1);margin:8px 0;line-height:26px;padding:0 12px;", ""], function (props) {
|
|
29
|
+
return props.$flex ? {
|
|
30
|
+
display: 'flex',
|
|
31
|
+
'align-items': 'center',
|
|
32
|
+
'justify-content': 'space-between'
|
|
33
|
+
} : null;
|
|
34
|
+
});
|
|
35
|
+
var _EDITOR_OPTIONS = {
|
|
36
|
+
minimap: {
|
|
37
|
+
enabled: false
|
|
38
|
+
},
|
|
39
|
+
lineNumbers: 'off'
|
|
40
|
+
};
|
|
41
|
+
var _TASK_TYPE_OPTIONS = [{
|
|
42
|
+
label: formatMessage({
|
|
43
|
+
id: "".concat(_I18N_PREFIX_, ".taskType.serial"),
|
|
44
|
+
label: '串行'
|
|
45
|
+
}),
|
|
46
|
+
value: 'serial'
|
|
47
|
+
}, {
|
|
48
|
+
label: formatMessage({
|
|
49
|
+
id: "".concat(_I18N_PREFIX_, ".taskType.parallel"),
|
|
50
|
+
label: '并行'
|
|
51
|
+
}),
|
|
52
|
+
value: 'parallel'
|
|
53
|
+
}];
|
|
54
|
+
var _METHOD_OPTIONS = [{
|
|
55
|
+
label: formatMessage({
|
|
56
|
+
id: "".concat(_I18N_PREFIX_, ".method.jsonp"),
|
|
57
|
+
label: 'JSONP'
|
|
58
|
+
}),
|
|
59
|
+
value: 'jsonp'
|
|
60
|
+
}, {
|
|
61
|
+
label: formatMessage({
|
|
62
|
+
id: "".concat(_I18N_PREFIX_, ".method.get"),
|
|
63
|
+
label: 'GET'
|
|
64
|
+
}),
|
|
65
|
+
value: 'get'
|
|
66
|
+
}, {
|
|
67
|
+
label: formatMessage({
|
|
68
|
+
id: "".concat(_I18N_PREFIX_, ".taskType.post"),
|
|
69
|
+
label: 'POST'
|
|
70
|
+
}),
|
|
71
|
+
value: 'post'
|
|
72
|
+
}, {
|
|
73
|
+
label: formatMessage({
|
|
74
|
+
id: "".concat(_I18N_PREFIX_, ".taskType.put"),
|
|
75
|
+
label: 'PUT'
|
|
76
|
+
}),
|
|
77
|
+
value: 'put'
|
|
78
|
+
}, {
|
|
79
|
+
label: formatMessage({
|
|
80
|
+
id: "".concat(_I18N_PREFIX_, ".taskType.delete"),
|
|
81
|
+
label: 'DELETE'
|
|
82
|
+
}),
|
|
83
|
+
value: 'delete'
|
|
84
|
+
}];
|
|
85
|
+
var _DEFAULT_PROCESS_ = {
|
|
86
|
+
willFetch: {
|
|
87
|
+
code: 'function willFetch(vars, config){\n\t\n}',
|
|
88
|
+
title: formatMessage({
|
|
89
|
+
id: "".concat(_I18N_PREFIX_, ".willFetch"),
|
|
90
|
+
label: "\u8BF7\u6C42\u53D1\u9001\u524D\u5904\u7406\u51FD\u6570(willFetch)"
|
|
91
|
+
})
|
|
92
|
+
},
|
|
93
|
+
didFetch: {
|
|
94
|
+
code: 'function didFetch(content){\n\t\n}',
|
|
95
|
+
title: formatMessage({
|
|
96
|
+
id: "".concat(_I18N_PREFIX_, ".didFetch"),
|
|
97
|
+
label: "\u8BF7\u6C42\u53D1\u9001\u524D\u5904\u7406\u51FD\u6570(didFetch)"
|
|
98
|
+
})
|
|
99
|
+
},
|
|
100
|
+
onError: {
|
|
101
|
+
code: 'function onError(error){\n\t\n}',
|
|
102
|
+
title: formatMessage({
|
|
103
|
+
id: "".concat(_I18N_PREFIX_, ".onError"),
|
|
104
|
+
label: "\u8BF7\u6C42\u53D1\u9001\u524D\u5904\u7406\u51FD\u6570(onError)"
|
|
105
|
+
})
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
var getBasicFormItem = function getBasicFormItem(form, item) {
|
|
109
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Form.Item, {
|
|
110
|
+
label: formatMessage({
|
|
111
|
+
id: "".concat(_I18N_PREFIX_, ".name"),
|
|
112
|
+
label: '名称'
|
|
113
|
+
})
|
|
114
|
+
}, form.getFieldDecorator('name', {
|
|
115
|
+
initialValue: item.name,
|
|
116
|
+
rules: [{
|
|
117
|
+
required: true,
|
|
118
|
+
message: formatMessage({
|
|
119
|
+
id: "".concat(_I18N_PREFIX_, ".messag.name"),
|
|
120
|
+
label: '请输入变量名'
|
|
121
|
+
})
|
|
122
|
+
}]
|
|
123
|
+
})( /*#__PURE__*/React.createElement(Input, {
|
|
124
|
+
size: "small"
|
|
125
|
+
}))), /*#__PURE__*/React.createElement(Form.Item, {
|
|
126
|
+
label: formatMessage({
|
|
127
|
+
id: "".concat(_I18N_PREFIX_, ".desc"),
|
|
128
|
+
label: '描述'
|
|
129
|
+
})
|
|
130
|
+
}, form.getFieldDecorator('desc', {
|
|
131
|
+
initialValue: item.desc
|
|
132
|
+
})( /*#__PURE__*/React.createElement(Input, {
|
|
133
|
+
size: "small",
|
|
134
|
+
placeholder: formatMessage({
|
|
135
|
+
id: "".concat(_I18N_PREFIX_, ".placeholder"),
|
|
136
|
+
label: '请输入'
|
|
137
|
+
})
|
|
138
|
+
}))));
|
|
139
|
+
};
|
|
140
|
+
var VarForm = Form.create({
|
|
141
|
+
name: 'var_form',
|
|
142
|
+
onValuesChange: function onValuesChange(_ref, values) {
|
|
143
|
+
var dispatch = _ref.dispatch,
|
|
144
|
+
item = _ref.item;
|
|
145
|
+
dispatch({
|
|
146
|
+
type: 'edit',
|
|
147
|
+
payload: {
|
|
148
|
+
id: item.id,
|
|
149
|
+
data: values
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
})(function (_ref2) {
|
|
154
|
+
var form = _ref2.form,
|
|
155
|
+
item = _ref2.item,
|
|
156
|
+
dispatch = _ref2.dispatch;
|
|
157
|
+
var _useDebounceFn = useDebounceFn(function (code) {
|
|
158
|
+
dispatch({
|
|
159
|
+
type: 'edit',
|
|
160
|
+
payload: {
|
|
161
|
+
id: item.id,
|
|
162
|
+
data: {
|
|
163
|
+
data: code
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
}, {
|
|
168
|
+
wait: 500
|
|
169
|
+
}),
|
|
170
|
+
handleEditorValueChange = _useDebounceFn.run;
|
|
171
|
+
return /*#__PURE__*/React.createElement(StyledForm, {
|
|
172
|
+
layout: "horizontal",
|
|
173
|
+
labelCol: {
|
|
174
|
+
span: 6
|
|
175
|
+
},
|
|
176
|
+
wrapperCol: {
|
|
177
|
+
span: 17
|
|
178
|
+
},
|
|
179
|
+
hideRequiredMark: true
|
|
180
|
+
}, getBasicFormItem(form, item), /*#__PURE__*/React.createElement(LabelLine, null, formatMessage({
|
|
181
|
+
id: "".concat(_I18N_PREFIX_, ".data"),
|
|
182
|
+
label: '数据'
|
|
183
|
+
}), /*#__PURE__*/React.createElement(TipIcon, {
|
|
184
|
+
type: "question-circle",
|
|
185
|
+
style: {
|
|
186
|
+
marginLeft: 4
|
|
187
|
+
},
|
|
188
|
+
title: formatMessage({
|
|
189
|
+
id: "".concat(_I18N_PREFIX_, ".tip.data"),
|
|
190
|
+
label: "\u8F93\u5165\u6846\u5185\u652F\u6301\u8F93\u5165JS\u7684\u57FA\u672C\u7C7B\u578B\u53D8\u91CF\uFF0C\u5982\u5B57\u7B26\u4E32:\"string\"\uFF0C\u6570\u5B57:123\uFF0C\u5E03\u5C14\u503C:true/false\uFF0C\u6570\u7EC4:[1,2,3]\uFF0C\u5BF9\u8C61:{\"name\": \"test\"}\uFF0C\u7A7A\u503C:null"
|
|
191
|
+
})
|
|
192
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
193
|
+
style: {
|
|
194
|
+
width: '100%',
|
|
195
|
+
height: 300
|
|
196
|
+
}
|
|
197
|
+
}, /*#__PURE__*/React.createElement(VisionEditor, {
|
|
198
|
+
onChange: handleEditorValueChange
|
|
199
|
+
}, item.data)));
|
|
200
|
+
});
|
|
201
|
+
var ApiForm = Form.create({
|
|
202
|
+
name: 'api_form',
|
|
203
|
+
onValuesChange: function onValuesChange(_ref3, values, all) {
|
|
204
|
+
var dispatch = _ref3.dispatch,
|
|
205
|
+
item = _ref3.item;
|
|
206
|
+
var auto = get(values, 'data.auto');
|
|
207
|
+
if (auto) {
|
|
208
|
+
set(all, 'data.taskType', 'parallel');
|
|
209
|
+
} else if (auto === false) {
|
|
210
|
+
unset(all, 'data.taskType');
|
|
211
|
+
}
|
|
212
|
+
dispatch({
|
|
213
|
+
type: 'edit',
|
|
214
|
+
payload: {
|
|
215
|
+
id: item.id,
|
|
216
|
+
data: all
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
})(function (_ref4) {
|
|
221
|
+
var _item$data, _item$data2, _item$data3, _item$data4, _item$data5, _item$data6, _item$data7, _item$data8, _item$data9, _item$data10, _item$data11;
|
|
222
|
+
var form = _ref4.form,
|
|
223
|
+
item = _ref4.item,
|
|
224
|
+
dispatch = _ref4.dispatch;
|
|
225
|
+
var _useSet = useSet(intersection(['willFetch', 'didFetch', 'onError'], keys(item))),
|
|
226
|
+
_useSet2 = _slicedToArray(_useSet, 2),
|
|
227
|
+
processSet = _useSet2[0],
|
|
228
|
+
_useSet2$ = _useSet2[1],
|
|
229
|
+
add = _useSet2$.add,
|
|
230
|
+
remove = _useSet2$.remove;
|
|
231
|
+
var _useDebounceFn2 = useDebounceFn(function (field, code) {
|
|
232
|
+
var obj = {};
|
|
233
|
+
set(obj, field, code);
|
|
234
|
+
form.setFieldsValue(obj);
|
|
235
|
+
}, {
|
|
236
|
+
wait: 500
|
|
237
|
+
}),
|
|
238
|
+
handleEditorValueChange = _useDebounceFn2.run;
|
|
239
|
+
var handleAddProcessFun = useMemoizedFn(function (_ref5) {
|
|
240
|
+
var key = _ref5.key;
|
|
241
|
+
if (!processSet.has(key)) {
|
|
242
|
+
add(key);
|
|
243
|
+
dispatch({
|
|
244
|
+
type: 'edit',
|
|
245
|
+
payload: {
|
|
246
|
+
id: item.id,
|
|
247
|
+
data: _defineProperty({}, key, _DEFAULT_PROCESS_[key].code)
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
var handleDelProcessFun = useMemoizedFn(function (_ref6) {
|
|
253
|
+
var key = _ref6.key;
|
|
254
|
+
remove(key);
|
|
255
|
+
dispatch({
|
|
256
|
+
type: 'edit',
|
|
257
|
+
payload: {
|
|
258
|
+
id: item.id,
|
|
259
|
+
data: _defineProperty({}, key, void 0)
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
var renderProcess = useMemoizedFn(function (processKey) {
|
|
264
|
+
return processSet.has(processKey) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(LabelLine, {
|
|
265
|
+
$flex: true
|
|
266
|
+
}, _DEFAULT_PROCESS_[processKey].title, /*#__PURE__*/React.createElement(TipIcon, {
|
|
267
|
+
type: "delete",
|
|
268
|
+
onClick: function onClick() {
|
|
269
|
+
return handleDelProcessFun(processKey);
|
|
270
|
+
}
|
|
271
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
272
|
+
wrapperCol: {
|
|
273
|
+
span: 24
|
|
274
|
+
}
|
|
275
|
+
}, form.getFieldDecorator(processKey, {
|
|
276
|
+
initialValue: item[processKey] || _DEFAULT_PROCESS_[processKey].code
|
|
277
|
+
})( /*#__PURE__*/React.createElement(EditorWrapper, {
|
|
278
|
+
style: {
|
|
279
|
+
margin: '4px 18px',
|
|
280
|
+
width: 'calc(100% - 36px)'
|
|
281
|
+
}
|
|
282
|
+
}, /*#__PURE__*/React.createElement(JSEditor, {
|
|
283
|
+
options: _EDITOR_OPTIONS,
|
|
284
|
+
onChange: function onChange(code) {
|
|
285
|
+
return handleEditorValueChange(processKey, code);
|
|
286
|
+
}
|
|
287
|
+
}, item[processKey] || _DEFAULT_PROCESS_[processKey].code))))) : null;
|
|
288
|
+
});
|
|
289
|
+
var menu = useCreation(function () {
|
|
290
|
+
return /*#__PURE__*/React.createElement(Menu, {
|
|
291
|
+
onClick: handleAddProcessFun
|
|
292
|
+
}, /*#__PURE__*/React.createElement(Menu.Item, {
|
|
293
|
+
key: "willFetch"
|
|
294
|
+
}, _DEFAULT_PROCESS_.willFetch.title), /*#__PURE__*/React.createElement(Menu.Item, {
|
|
295
|
+
key: "didFetch"
|
|
296
|
+
}, _DEFAULT_PROCESS_.didFetch.title), /*#__PURE__*/React.createElement(Menu.Item, {
|
|
297
|
+
key: "onError"
|
|
298
|
+
}, _DEFAULT_PROCESS_.onError.title));
|
|
299
|
+
}, []);
|
|
300
|
+
return /*#__PURE__*/React.createElement(StyledForm, {
|
|
301
|
+
layout: "horizontal",
|
|
302
|
+
labelCol: {
|
|
303
|
+
span: 6
|
|
304
|
+
},
|
|
305
|
+
wrapperCol: {
|
|
306
|
+
span: 17
|
|
307
|
+
},
|
|
308
|
+
hideRequiredMark: true
|
|
309
|
+
}, getBasicFormItem(form, item), /*#__PURE__*/React.createElement(Form.Item, {
|
|
310
|
+
label: formatMessage({
|
|
311
|
+
id: "".concat(_I18N_PREFIX_, ".auto"),
|
|
312
|
+
label: '自动加载'
|
|
313
|
+
})
|
|
314
|
+
}, form.getFieldDecorator('data.auto', {
|
|
315
|
+
valuePropName: 'checked',
|
|
316
|
+
initialValue: Boolean((_item$data = item.data) === null || _item$data === void 0 ? void 0 : _item$data.auto)
|
|
317
|
+
})( /*#__PURE__*/React.createElement(Switch, {
|
|
318
|
+
size: "small"
|
|
319
|
+
}))), form.getFieldValue('data.auto') ? /*#__PURE__*/React.createElement(Form.Item, {
|
|
320
|
+
label: formatMessage({
|
|
321
|
+
id: "".concat(_I18N_PREFIX_, ".taskType"),
|
|
322
|
+
label: '加载方式'
|
|
323
|
+
})
|
|
324
|
+
}, form.getFieldDecorator('data.taskType', {
|
|
325
|
+
initialValue: ((_item$data2 = item.data) === null || _item$data2 === void 0 ? void 0 : _item$data2.taskType) || 'parallel'
|
|
326
|
+
})( /*#__PURE__*/React.createElement(StyledSegmented, {
|
|
327
|
+
size: "small",
|
|
328
|
+
options: _TASK_TYPE_OPTIONS
|
|
329
|
+
}))) : null, /*#__PURE__*/React.createElement(Form.Item, {
|
|
330
|
+
label: formatMessage({
|
|
331
|
+
id: "".concat(_I18N_PREFIX_, ".url"),
|
|
332
|
+
label: '请求地址'
|
|
333
|
+
})
|
|
334
|
+
}, form.getFieldDecorator('data.url', {
|
|
335
|
+
initialValue: ((_item$data3 = item.data) === null || _item$data3 === void 0 ? void 0 : _item$data3.url) || ''
|
|
336
|
+
})( /*#__PURE__*/React.createElement(EditorWrapper, null, /*#__PURE__*/React.createElement(VisionEditor, {
|
|
337
|
+
options: _EDITOR_OPTIONS,
|
|
338
|
+
onChange: function onChange(code) {
|
|
339
|
+
return handleEditorValueChange('data.url', code);
|
|
340
|
+
}
|
|
341
|
+
}, ((_item$data4 = item.data) === null || _item$data4 === void 0 ? void 0 : _item$data4.url) || '')))), /*#__PURE__*/React.createElement(Form.Item, {
|
|
342
|
+
label: formatMessage({
|
|
343
|
+
id: "".concat(_I18N_PREFIX_, ".method"),
|
|
344
|
+
label: '请求方式'
|
|
345
|
+
})
|
|
346
|
+
}, form.getFieldDecorator('data.method', {
|
|
347
|
+
initialValue: ((_item$data5 = item.data) === null || _item$data5 === void 0 ? void 0 : _item$data5.method) || 'get'
|
|
348
|
+
})( /*#__PURE__*/React.createElement(StyledSegmented, {
|
|
349
|
+
size: "small",
|
|
350
|
+
options: _METHOD_OPTIONS
|
|
351
|
+
}))), /*#__PURE__*/React.createElement(LabelLine, null, formatMessage({
|
|
352
|
+
id: "".concat(_I18N_PREFIX_, ".urlParams"),
|
|
353
|
+
label: '请求参数'
|
|
354
|
+
}), /*#__PURE__*/React.createElement(TipIcon, {
|
|
355
|
+
type: "question-circle",
|
|
356
|
+
style: {
|
|
357
|
+
marginLeft: 4
|
|
358
|
+
},
|
|
359
|
+
title: formatMessage({
|
|
360
|
+
id: "".concat(_I18N_PREFIX_, ".tip.urlParams"),
|
|
361
|
+
label: 'URL 请求参数,格式为 {key1:value1,key2:value2} ,等价于 ?key1=value1&key2=value2'
|
|
362
|
+
})
|
|
363
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
364
|
+
wrapperCol: {
|
|
365
|
+
span: 24
|
|
366
|
+
}
|
|
367
|
+
}, form.getFieldDecorator('data.params', {
|
|
368
|
+
initialValue: ((_item$data6 = item.data) === null || _item$data6 === void 0 ? void 0 : _item$data6.params) || ''
|
|
369
|
+
})( /*#__PURE__*/React.createElement(EditorWrapper, {
|
|
370
|
+
style: {
|
|
371
|
+
margin: '4px 18px',
|
|
372
|
+
width: 'calc(100% - 36px)'
|
|
373
|
+
}
|
|
374
|
+
}, /*#__PURE__*/React.createElement(VisionEditor, {
|
|
375
|
+
options: _EDITOR_OPTIONS,
|
|
376
|
+
onChange: function onChange(code) {
|
|
377
|
+
return handleEditorValueChange('data.params', code);
|
|
378
|
+
}
|
|
379
|
+
}, ((_item$data7 = item.data) === null || _item$data7 === void 0 ? void 0 : _item$data7.params) || '')))), /*#__PURE__*/React.createElement(LabelLine, null, formatMessage({
|
|
380
|
+
id: "".concat(_I18N_PREFIX_, ".body"),
|
|
381
|
+
label: '请求体'
|
|
382
|
+
}), /*#__PURE__*/React.createElement(TipIcon, {
|
|
383
|
+
type: "question-circle",
|
|
384
|
+
style: {
|
|
385
|
+
marginLeft: 4
|
|
386
|
+
},
|
|
387
|
+
title: formatMessage({
|
|
388
|
+
id: "".concat(_I18N_PREFIX_, ".tip.body"),
|
|
389
|
+
label: '接口请求体(body),格式为 {key1:value1,key2:value2}'
|
|
390
|
+
})
|
|
391
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
392
|
+
wrapperCol: {
|
|
393
|
+
span: 24
|
|
394
|
+
}
|
|
395
|
+
}, form.getFieldDecorator('data.body', {
|
|
396
|
+
initialValue: ((_item$data8 = item.data) === null || _item$data8 === void 0 ? void 0 : _item$data8.body) || ''
|
|
397
|
+
})( /*#__PURE__*/React.createElement(EditorWrapper, {
|
|
398
|
+
style: {
|
|
399
|
+
margin: '4px 18px',
|
|
400
|
+
width: 'calc(100% - 36px)'
|
|
401
|
+
}
|
|
402
|
+
}, /*#__PURE__*/React.createElement(VisionEditor, {
|
|
403
|
+
options: _EDITOR_OPTIONS,
|
|
404
|
+
onChange: function onChange(code) {
|
|
405
|
+
return handleEditorValueChange('data.body', code);
|
|
406
|
+
}
|
|
407
|
+
}, ((_item$data9 = item.data) === null || _item$data9 === void 0 ? void 0 : _item$data9.body) || '')))), /*#__PURE__*/React.createElement(LabelLine, {
|
|
408
|
+
$flex: true
|
|
409
|
+
}, formatMessage({
|
|
410
|
+
id: "".concat(_I18N_PREFIX_, ".process"),
|
|
411
|
+
label: '数据处理'
|
|
412
|
+
}), /*#__PURE__*/React.createElement(Dropdown, {
|
|
413
|
+
overlay: menu,
|
|
414
|
+
trigger: ['click'],
|
|
415
|
+
getPopupContainer: function getPopupContainer() {
|
|
416
|
+
return document.getElementById('lc-design-workspace');
|
|
417
|
+
}
|
|
418
|
+
}, /*#__PURE__*/React.createElement(TipIcon, {
|
|
419
|
+
type: "plus"
|
|
420
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
421
|
+
style: {
|
|
422
|
+
padding: '0 12px'
|
|
423
|
+
}
|
|
424
|
+
}, renderProcess('willFetch'), renderProcess('didFetch'), renderProcess('onError')), /*#__PURE__*/React.createElement(LabelLine, null, formatMessage({
|
|
425
|
+
id: "".concat(_I18N_PREFIX_, ".defaultValue"),
|
|
426
|
+
label: '默认数据'
|
|
427
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
428
|
+
wrapperCol: {
|
|
429
|
+
span: 24
|
|
430
|
+
}
|
|
431
|
+
}, form.getFieldDecorator('data.defaultValue', {
|
|
432
|
+
initialValue: (_item$data10 = item.data) === null || _item$data10 === void 0 ? void 0 : _item$data10.defaultValue
|
|
433
|
+
})( /*#__PURE__*/React.createElement(EditorWrapper, {
|
|
434
|
+
style: {
|
|
435
|
+
margin: '4px 18px',
|
|
436
|
+
width: 'calc(100% - 36px)'
|
|
437
|
+
}
|
|
438
|
+
}, /*#__PURE__*/React.createElement(VisionEditor, {
|
|
439
|
+
options: _EDITOR_OPTIONS,
|
|
440
|
+
onChange: function onChange(code) {
|
|
441
|
+
return handleEditorValueChange('data.defaultValue', code);
|
|
442
|
+
}
|
|
443
|
+
}, ((_item$data11 = item.data) === null || _item$data11 === void 0 ? void 0 : _item$data11.defaultValue) || '')))));
|
|
444
|
+
});
|
|
445
|
+
var VarEditor = function VarEditor(_ref7) {
|
|
446
|
+
var item = _ref7.item,
|
|
447
|
+
dispatch = _ref7.dispatch;
|
|
448
|
+
return item.type === 'var' ? /*#__PURE__*/React.createElement(VarForm, {
|
|
449
|
+
item: item,
|
|
450
|
+
dispatch: dispatch
|
|
451
|
+
}) : /*#__PURE__*/React.createElement(ApiForm, {
|
|
452
|
+
item: item,
|
|
453
|
+
dispatch: dispatch
|
|
454
|
+
});
|
|
455
|
+
};
|
|
456
|
+
export default VarEditor;
|
|
@@ -6,38 +6,38 @@ var _excluded = ["onChange", "isFullscreen", "style"],
|
|
|
6
6
|
import React, { useEffect, useRef, useImperativeHandle, forwardRef } from 'react';
|
|
7
7
|
import * as monaco from 'monaco-editor';
|
|
8
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 编辑器实例。
|
|
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
41
|
*/
|
|
42
42
|
var BaseEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
43
43
|
var onChange = _ref.onChange,
|
|
@@ -4,31 +4,31 @@ var _excluded = ["children"];
|
|
|
4
4
|
import React, { forwardRef } from 'react';
|
|
5
5
|
import BaseEditor from "./BaseEditor";
|
|
6
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 组件实例。
|
|
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
32
|
*/
|
|
33
33
|
var CssEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
34
34
|
var children = _ref.children,
|
|
@@ -8,29 +8,29 @@ import { formatMessage } from '@luck-design-biz/base/utils';
|
|
|
8
8
|
import styles from "../../style/fullscreen-editor.less";
|
|
9
9
|
import { useFullscreen } from 'ahooks';
|
|
10
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 元素,其中包含了一个具有全屏切换功能的编辑器界面。
|
|
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
34
|
*/
|
|
35
35
|
var FullScreenEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
36
36
|
var EditorComponent = _ref.EditorComponent,
|
|
@@ -77,8 +77,8 @@ var FullScreenEditor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
77
77
|
},
|
|
78
78
|
overviewRulerLanes: 0,
|
|
79
79
|
scrollbar: {
|
|
80
|
-
vertical: '
|
|
81
|
-
horizontal: '
|
|
80
|
+
vertical: 'auto',
|
|
81
|
+
horizontal: 'auto',
|
|
82
82
|
handleMouseWheel: false
|
|
83
83
|
}
|
|
84
84
|
}
|