@luck-design-biz/luckda 0.0.25-2 → 0.0.25-21
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/ComplexItem/index.js +92 -0
- package/es/components/ComplexItem/service.js +21 -0
- package/es/components/LDActions/index.js +8 -10
- package/es/components/LDActions/index.less +68 -65
- package/es/components/LdAutoForm/index.js +57 -12
- package/es/components/LdFormList/index.js +50 -28
- package/es/components/LdGrid/index.js +23 -11
- package/es/components/LdGridForm/index.js +37 -12
- package/es/components/LdGridForm/index.less +7 -7
- package/es/components/LdTree/index.js +59 -19
- package/es/components/LdTree/index.less +40 -40
- package/es/helper/FromItems.js +177 -94
- package/es/helper/action.js +6 -6
- package/es/helper/form.js +69 -28
- package/es/helper/index.less +7 -7
- package/es/helper/props_config.js +17 -0
- package/es/index.js +0 -1
- package/es/locales/zh-CN.js +22 -17
- package/es/lowcode/constants/api-url.js +269 -98
- package/es/lowcode/constants/event-topics.js +3 -0
- package/es/lowcode/constants/index.js +2 -1
- package/es/lowcode/engine/factory/panel-item-factory/RadioStrategy.js +53 -0
- package/es/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +5 -2
- package/es/lowcode/engine/factory/panel-item-factory/StringStrategy.js +2 -2
- package/es/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +5 -2
- package/es/lowcode/engine/factory/panel-item-factory/index.js +2 -0
- package/es/lowcode/engine/launcher.js +7 -0
- package/es/lowcode/engine/meta/box.props.default.json +1 -1
- package/es/lowcode/engine/meta/box.props.json +4 -4
- package/es/lowcode/engine/meta/button.props.json +3 -3
- package/es/lowcode/engine/meta/cardlist.props.json +13 -3
- package/es/lowcode/engine/meta/components-list.json +116 -8
- package/es/lowcode/engine/meta/dialog.props.default.json +11 -5
- package/es/lowcode/engine/meta/dialog.props.json +79 -42
- package/es/lowcode/engine/meta/drawer.props.json +8 -20
- package/es/lowcode/engine/meta/fieldcolor.props.default.json +16 -0
- package/es/lowcode/engine/meta/fieldcolor.props.json +146 -0
- package/es/lowcode/engine/meta/fieldcomplex.props.default.json +15 -0
- package/es/lowcode/engine/meta/fieldcomplex.props.json +122 -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 +14 -0
- package/es/lowcode/engine/meta/fielddate.props.json +130 -0
- package/es/lowcode/engine/meta/fielddict.props.default.json +16 -0
- package/es/lowcode/engine/meta/fielddict.props.json +127 -0
- package/es/lowcode/engine/meta/fieldeditor.props.default.json +15 -0
- package/es/lowcode/engine/meta/fieldeditor.props.json +127 -0
- package/es/lowcode/engine/meta/fieldgroup.props.default.json +17 -0
- package/es/lowcode/engine/meta/fieldgroup.props.json +156 -0
- package/es/lowcode/engine/meta/fieldnumber.props.default.json +16 -0
- package/es/lowcode/engine/meta/fieldnumber.props.json +131 -0
- package/es/lowcode/engine/meta/fieldradio.props.default.json +14 -0
- package/es/lowcode/engine/meta/fieldradio.props.json +104 -0
- package/es/lowcode/engine/meta/fieldregion.props.default.json +14 -0
- package/es/lowcode/engine/meta/fieldregion.props.json +110 -0
- package/es/lowcode/engine/meta/fieldselect.props.default.json +16 -0
- package/es/lowcode/engine/meta/fieldselect.props.json +141 -0
- package/es/lowcode/engine/meta/fieldstring.props.default.json +14 -0
- package/es/lowcode/engine/meta/fieldstring.props.json +141 -0
- package/es/lowcode/engine/meta/fieldswitch.props.default.json +14 -0
- package/es/lowcode/engine/meta/fieldswitch.props.json +114 -0
- package/es/lowcode/engine/meta/fieldtextarea.props.default.json +15 -0
- package/es/lowcode/engine/meta/fieldtextarea.props.json +132 -0
- package/es/lowcode/engine/meta/fieldupload.props.default.json +17 -0
- package/es/lowcode/engine/meta/fieldupload.props.json +154 -0
- package/es/lowcode/engine/meta/fielduser.props.default.json +18 -0
- package/es/lowcode/engine/meta/fielduser.props.json +165 -0
- package/es/lowcode/engine/meta/fieldyear.props.default.json +14 -0
- package/es/lowcode/engine/meta/fieldyear.props.json +120 -0
- package/es/lowcode/engine/meta/form.props.default.json +2 -2
- package/es/lowcode/engine/meta/form.props.json +36 -16
- package/es/lowcode/engine/meta/imex.props.default.json +8 -1
- package/es/lowcode/engine/meta/imex.props.json +54 -22
- package/es/lowcode/engine/meta/js-editor/auto-complete.json +106 -14
- package/es/lowcode/engine/meta/layout.props.json +2 -2
- package/es/lowcode/engine/meta/page.props.json +12 -6
- package/es/lowcode/engine/meta/pagelayout.props.default.json +14 -0
- package/es/lowcode/engine/meta/pagelayout.props.json +47 -0
- package/es/lowcode/engine/meta/section.props.json +2 -2
- package/es/lowcode/engine/meta/split.props.default.json +1 -1
- package/es/lowcode/engine/meta/split.props.json +4 -4
- package/es/lowcode/engine/meta/table.props.default.json +2 -1
- package/es/lowcode/engine/meta/table.props.json +27 -14
- package/es/lowcode/engine/meta/tabs.props.json +3 -3
- package/es/lowcode/engine/meta/tree.props.default.json +7 -5
- package/es/lowcode/engine/meta/tree.props.json +112 -55
- package/es/lowcode/engine/provider/ContextProvider/index.js +104 -86
- package/es/lowcode/engine/provider/ContextProvider/usePageState.js +21 -0
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +96 -49
- package/es/lowcode/engine/tools/dataProcess.js +80 -76
- package/es/lowcode/engine/tools/diff.js +60 -0
- package/es/lowcode/engine/tools/helper.js +92 -7
- package/es/lowcode/engine/tools/useCanvasRender.js +3 -2
- package/es/lowcode/engine/tools/useCombinedRefs.js +14 -0
- package/es/lowcode/engine/tools/usePageDataStore.js +350 -0
- package/es/lowcode/engine/tools/usePromiseState.js +12 -23
- package/es/lowcode/engine/tools/useTodo.js +20 -10
- package/es/lowcode/index.js +1 -4
- package/es/lowcode/painter/Components.js +2 -2
- package/es/lowcode/painter/Design.js +8 -5
- package/es/lowcode/painter/DesignOperator.js +111 -85
- package/es/lowcode/painter/DesignToolbar.js +85 -47
- package/es/lowcode/painter/Outline.js +12 -10
- package/es/lowcode/painter/Panel.js +85 -45
- package/es/lowcode/painter/components/ActionBindModal.js +45 -28
- package/es/lowcode/painter/components/AdvancePanel.js +37 -21
- package/es/lowcode/painter/components/AttrsPanel.js +40 -29
- package/es/lowcode/painter/components/Collapse.js +26 -26
- package/es/lowcode/painter/components/ColorInput.js +24 -24
- package/es/lowcode/painter/components/DragDrop/DragDropContext.js +1 -1
- package/es/lowcode/painter/components/FieldSelector.js +26 -13
- package/es/lowcode/painter/components/ListEditor.js +24 -24
- package/es/lowcode/painter/components/NumberInput.js +28 -28
- 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/PreviewIframe.js +19 -0
- package/es/lowcode/painter/components/RuleInput.js +30 -31
- package/es/lowcode/painter/components/SortBox.js +22 -22
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +35 -34
- package/es/lowcode/painter/components/code-editor/CssEditor.js +25 -25
- package/es/lowcode/painter/components/code-editor/FullScreenEditor.js +23 -23
- package/es/lowcode/painter/components/code-editor/JSEditor.js +48 -42
- package/es/lowcode/painter/components/code-editor/JsonEditor.js +25 -25
- package/es/lowcode/painter/components/field-setting/CheckFrontRules.js +108 -0
- package/es/lowcode/painter/components/field-setting/CheckRules.js +1 -26
- package/es/lowcode/painter/components/field-setting/FieldRulesModal.js +33 -13
- package/es/lowcode/painter/components/field-setting/SettingUI.js +158 -77
- package/es/lowcode/painter/components/field-setting/index.js +32 -65
- package/es/lowcode/painter/components/field-setting/meta/frontRules.js +53 -0
- package/es/lowcode/painter/panel-section/ActionsEditor/index.js +3 -1
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +11 -17
- package/es/lowcode/painter/panel-section/ButtonType.js +4 -2
- package/es/lowcode/painter/panel-section/ComponentSelector.js +36 -0
- package/es/lowcode/painter/panel-section/DataSetSelector.js +33 -7
- package/es/lowcode/painter/panel-section/FieldsSetting.js +72 -54
- package/es/lowcode/painter/panel-section/I18nInput.js +2 -1
- package/es/lowcode/painter/panel-section/Icon.js +23 -23
- package/es/lowcode/painter/panel-section/IconSelector.js +16 -16
- package/es/lowcode/painter/panel-section/ImpExp.js +131 -37
- package/es/lowcode/painter/panel-section/ImpExpAlone.js +124 -0
- package/es/lowcode/painter/panel-section/LayoutRatio.js +21 -21
- package/es/lowcode/painter/panel-section/PageLayoutDisplay.js +112 -0
- package/es/lowcode/painter/panel-section/SerialsSelector.js +4 -2
- package/es/lowcode/painter/panel-section/SplitDisplay.js +28 -112
- 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 +4 -4
- 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 +3 -3
- 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 +22 -16
- package/es/lowcode/painter/panel-section/TableTopFilter.js +23 -13
- package/es/lowcode/painter/panel-section/TreeRootEditor.js +12 -4
- 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 +159 -152
- 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 +28 -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 -27
- 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/view/Canvas.js +34 -8
- package/es/lowcode/view/Page.js +2 -4
- package/es/lowcode/view/lc-components/Box/FunctionDesign.js +8 -2
- package/es/lowcode/view/lc-components/Box/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Box/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Box/index.js +4 -4
- 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 +35 -39
- 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/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/CardList/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/CardList/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/CardList/meta.json +153 -143
- package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +3 -10
- package/es/lowcode/view/lc-components/Dialog/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Dialog/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Dialog/index.js +143 -19
- package/es/lowcode/view/lc-components/Dialog/index.less +3 -3
- package/es/lowcode/view/lc-components/Dialog/meta.json +150 -120
- package/es/lowcode/view/lc-components/Drawer/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/Drawer/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Drawer/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Drawer/index.js +15 -12
- package/es/lowcode/view/lc-components/Drawer/index.less +9 -9
- package/es/lowcode/view/lc-components/Drawer/meta.json +131 -143
- package/es/lowcode/view/lc-components/FieldColor/meta.json +146 -0
- package/es/lowcode/view/lc-components/FieldComplex/meta.json +122 -0
- package/es/lowcode/view/lc-components/FieldDate/meta.json +128 -0
- package/es/lowcode/view/lc-components/FieldDict/meta.json +127 -0
- package/es/lowcode/view/lc-components/FieldEditor/meta.json +127 -0
- package/es/lowcode/view/lc-components/FieldGroup/meta.json +156 -0
- package/es/lowcode/view/lc-components/FieldNumber/meta.json +131 -0
- package/es/lowcode/view/lc-components/FieldRadio/meta.json +104 -0
- package/es/lowcode/view/lc-components/FieldRegion/meta.json +110 -0
- package/es/lowcode/view/lc-components/FieldSelect/meta.json +141 -0
- package/es/lowcode/view/lc-components/FieldString/meta.json +141 -0
- package/es/lowcode/view/lc-components/FieldSwitch/meta.json +114 -0
- package/es/lowcode/view/lc-components/FieldTextarea/meta.json +132 -0
- package/es/lowcode/view/lc-components/FieldUpload/meta.json +154 -0
- package/es/lowcode/view/lc-components/FieldUser/meta.json +165 -0
- package/es/lowcode/view/lc-components/FieldYear/meta.json +118 -0
- package/es/lowcode/view/lc-components/Form/FunctionDesign.js +23 -33
- package/es/lowcode/view/lc-components/Form/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Form/FunctionPreview.js +9 -1
- package/es/lowcode/view/lc-components/Form/index.js +345 -80
- package/es/lowcode/view/lc-components/Form/index.less +4 -4
- package/es/lowcode/view/lc-components/Form/meta.json +610 -599
- package/es/lowcode/view/lc-components/Iframe/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/Iframe/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Iframe/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Iframe/meta.json +32 -32
- package/es/lowcode/view/lc-components/ImEx/FunctionDesign.js +9 -3
- package/es/lowcode/view/lc-components/ImEx/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/ImEx/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/ImEx/index.js +470 -11
- package/es/lowcode/view/lc-components/ImEx/index.less +7 -0
- package/es/lowcode/view/lc-components/ImEx/meta.json +114 -82
- package/es/lowcode/view/lc-components/Image/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/Image/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Image/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Image/meta.json +114 -114
- package/es/lowcode/view/lc-components/JSX/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/JSX/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/JSX/FunctionPreview.js +1 -0
- package/es/{components/LdRuntimeCom/index.js → lowcode/view/lc-components/JSX/RuntimeComp.js} +12 -15
- package/es/lowcode/view/lc-components/JSX/index.js +5 -6
- package/es/lowcode/view/lc-components/JSX/meta.json +28 -28
- package/es/lowcode/view/lc-components/Layout/FunctionDesign.js +12 -19
- package/es/lowcode/view/lc-components/Layout/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Layout/index.js +19 -17
- 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/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/Link/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Link/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Link/index.js +3 -0
- package/es/lowcode/view/lc-components/Link/meta.json +112 -112
- package/es/lowcode/view/lc-components/Page/meta.json +55 -49
- package/es/lowcode/view/lc-components/PageContent/index.js +11 -10
- package/es/lowcode/view/lc-components/PageContent/meta.json +9 -9
- package/es/lowcode/view/lc-components/PageFooter/index.js +5 -5
- package/es/lowcode/view/lc-components/PageFooter/meta.json +9 -9
- package/es/lowcode/view/lc-components/PageHeader/index.js +8 -6
- package/es/lowcode/view/lc-components/PageHeader/meta.json +9 -9
- package/es/lowcode/view/lc-components/PageLayout/FunctionDesign.js +68 -0
- package/es/lowcode/view/lc-components/PageLayout/FunctionLive.js +10 -0
- package/es/lowcode/view/lc-components/PageLayout/FunctionPreview.js +10 -0
- package/es/lowcode/view/lc-components/PageLayout/index.js +37 -0
- package/es/lowcode/view/lc-components/PageLayout/meta.json +47 -0
- package/es/lowcode/view/lc-components/PageModal/index.js +12 -15
- package/es/lowcode/view/lc-components/Section/FunctionDesign.js +3 -9
- package/es/lowcode/view/lc-components/Section/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Section/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Section/index.js +6 -3
- package/es/lowcode/view/lc-components/Section/index.less +7 -7
- package/es/lowcode/view/lc-components/Section/meta.json +107 -107
- package/es/lowcode/view/lc-components/Split/FunctionDesign.js +19 -20
- package/es/lowcode/view/lc-components/Split/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Split/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Split/index.js +8 -9
- package/es/lowcode/view/lc-components/Split/meta.json +53 -53
- package/es/lowcode/view/lc-components/Table/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Table/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Table/components/TopFilter.js +78 -57
- package/es/lowcode/view/lc-components/Table/components/TopImex.js +425 -0
- package/es/lowcode/view/lc-components/Table/index.js +426 -202
- package/es/lowcode/view/lc-components/Table/meta.json +451 -399
- package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +11 -18
- package/es/lowcode/view/lc-components/Tabs/index.js +52 -37
- package/es/lowcode/view/lc-components/Tabs/meta.json +113 -113
- package/es/lowcode/view/lc-components/Text/FunctionDesign.js +1 -0
- package/es/lowcode/view/lc-components/Text/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Text/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Text/index.js +3 -0
- package/es/lowcode/view/lc-components/Text/meta.json +66 -66
- package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +2 -3
- package/es/lowcode/view/lc-components/Tree/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Tree/index.js +173 -119
- package/es/lowcode/view/lc-components/Tree/index.less +4 -4
- package/es/lowcode/view/lc-components/Tree/meta.json +357 -301
- package/es/lowcode/view/lc-components/Wrapper.js +11 -12
- package/es/lowcode/view/style/canvas.less +5 -5
- package/es/lowcode/view/style/loading.less +84 -84
- package/es/lowcode/view/style/page.less +7 -7
- package/es/services.js +0 -24
- package/es/upload/FilesWall/file.png +0 -0
- package/es/upload/FilesWall/index.js +422 -0
- package/es/upload/FilesWall/index.less +74 -0
- package/es/upload/Form/gridForm.js +3 -2
- package/es/upload/Form/index.js +2 -1
- package/es/upload/Form/index.less +7 -7
- package/es/upload/FormItem/index.js +20 -21
- package/es/upload/index.js +2 -1
- package/es/utils/action.js +2 -2
- package/es/utils/form.js +37 -24
- package/es/utils/grid.js +10 -7
- package/lib/components/ComplexItem/index.js +100 -0
- package/lib/components/ComplexItem/service.js +28 -0
- package/lib/components/LDActions/index.js +7 -9
- package/lib/components/LDActions/index.less +68 -65
- package/lib/components/LdAutoForm/index.js +56 -11
- package/lib/components/LdFormList/index.js +49 -27
- package/lib/components/LdGrid/index.js +23 -11
- package/lib/components/LdGridForm/index.js +35 -10
- package/lib/components/LdGridForm/index.less +7 -7
- package/lib/components/LdTree/index.js +57 -17
- package/lib/components/LdTree/index.less +40 -40
- package/lib/helper/FromItems.js +175 -92
- package/lib/helper/action.js +6 -6
- package/lib/helper/form.js +67 -27
- package/lib/helper/index.less +7 -7
- package/lib/helper/props_config.js +23 -0
- package/lib/index.js +1 -9
- package/lib/locales/zh-CN.js +22 -17
- package/lib/lowcode/constants/api-url.js +270 -97
- package/lib/lowcode/constants/event-topics.js +4 -1
- package/lib/lowcode/constants/index.js +3 -2
- package/lib/lowcode/engine/factory/panel-item-factory/RadioStrategy.js +59 -0
- package/lib/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +7 -4
- package/lib/lowcode/engine/factory/panel-item-factory/StringStrategy.js +4 -3
- package/lib/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +6 -3
- package/lib/lowcode/engine/factory/panel-item-factory/index.js +2 -0
- package/lib/lowcode/engine/launcher.js +13 -0
- package/lib/lowcode/engine/meta/box.props.default.json +1 -1
- package/lib/lowcode/engine/meta/box.props.json +4 -4
- package/lib/lowcode/engine/meta/button.props.json +3 -3
- package/lib/lowcode/engine/meta/cardlist.props.json +13 -3
- package/lib/lowcode/engine/meta/components-list.json +116 -8
- package/lib/lowcode/engine/meta/dialog.props.default.json +11 -5
- package/lib/lowcode/engine/meta/dialog.props.json +79 -42
- package/lib/lowcode/engine/meta/drawer.props.json +8 -20
- package/lib/lowcode/engine/meta/fieldcolor.props.default.json +16 -0
- package/lib/lowcode/engine/meta/fieldcolor.props.json +146 -0
- package/lib/lowcode/engine/meta/fieldcomplex.props.default.json +15 -0
- package/lib/lowcode/engine/meta/fieldcomplex.props.json +122 -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 +14 -0
- package/lib/lowcode/engine/meta/fielddate.props.json +130 -0
- package/lib/lowcode/engine/meta/fielddict.props.default.json +16 -0
- package/lib/lowcode/engine/meta/fielddict.props.json +127 -0
- package/lib/lowcode/engine/meta/fieldeditor.props.default.json +15 -0
- package/lib/lowcode/engine/meta/fieldeditor.props.json +127 -0
- package/lib/lowcode/engine/meta/fieldgroup.props.default.json +17 -0
- package/lib/lowcode/engine/meta/fieldgroup.props.json +156 -0
- package/lib/lowcode/engine/meta/fieldnumber.props.default.json +16 -0
- package/lib/lowcode/engine/meta/fieldnumber.props.json +131 -0
- package/lib/lowcode/engine/meta/fieldradio.props.default.json +14 -0
- package/lib/lowcode/engine/meta/fieldradio.props.json +104 -0
- package/lib/lowcode/engine/meta/fieldregion.props.default.json +14 -0
- package/lib/lowcode/engine/meta/fieldregion.props.json +110 -0
- package/lib/lowcode/engine/meta/fieldselect.props.default.json +16 -0
- package/lib/lowcode/engine/meta/fieldselect.props.json +141 -0
- package/lib/lowcode/engine/meta/fieldstring.props.default.json +14 -0
- package/lib/lowcode/engine/meta/fieldstring.props.json +141 -0
- package/lib/lowcode/engine/meta/fieldswitch.props.default.json +14 -0
- package/lib/lowcode/engine/meta/fieldswitch.props.json +114 -0
- package/lib/lowcode/engine/meta/fieldtextarea.props.default.json +15 -0
- package/lib/lowcode/engine/meta/fieldtextarea.props.json +132 -0
- package/lib/lowcode/engine/meta/fieldupload.props.default.json +17 -0
- package/lib/lowcode/engine/meta/fieldupload.props.json +154 -0
- package/lib/lowcode/engine/meta/fielduser.props.default.json +18 -0
- package/lib/lowcode/engine/meta/fielduser.props.json +165 -0
- package/lib/lowcode/engine/meta/fieldyear.props.default.json +14 -0
- package/lib/lowcode/engine/meta/fieldyear.props.json +120 -0
- package/lib/lowcode/engine/meta/form.props.default.json +2 -2
- package/lib/lowcode/engine/meta/form.props.json +36 -16
- package/lib/lowcode/engine/meta/imex.props.default.json +8 -1
- package/lib/lowcode/engine/meta/imex.props.json +54 -22
- package/lib/lowcode/engine/meta/js-editor/auto-complete.json +106 -14
- package/lib/lowcode/engine/meta/layout.props.json +2 -2
- package/lib/lowcode/engine/meta/page.props.json +12 -6
- package/lib/lowcode/engine/meta/pagelayout.props.default.json +14 -0
- package/lib/lowcode/engine/meta/pagelayout.props.json +47 -0
- package/lib/lowcode/engine/meta/section.props.json +2 -2
- package/lib/lowcode/engine/meta/split.props.default.json +1 -1
- package/lib/lowcode/engine/meta/split.props.json +4 -4
- package/lib/lowcode/engine/meta/table.props.default.json +2 -1
- package/lib/lowcode/engine/meta/table.props.json +27 -14
- package/lib/lowcode/engine/meta/tabs.props.json +3 -3
- package/lib/lowcode/engine/meta/tree.props.default.json +7 -5
- package/lib/lowcode/engine/meta/tree.props.json +112 -55
- package/lib/lowcode/engine/provider/ContextProvider/index.js +120 -86
- package/lib/lowcode/engine/provider/ContextProvider/usePageState.js +28 -0
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +93 -46
- package/lib/lowcode/engine/tools/dataProcess.js +80 -76
- package/lib/lowcode/engine/tools/diff.js +67 -0
- package/lib/lowcode/engine/tools/helper.js +96 -6
- package/lib/lowcode/engine/tools/useCanvasRender.js +3 -2
- package/lib/lowcode/engine/tools/useCombinedRefs.js +20 -0
- package/lib/lowcode/engine/tools/usePageDataStore.js +357 -0
- package/lib/lowcode/engine/tools/usePromiseState.js +11 -21
- package/lib/lowcode/engine/tools/useTodo.js +19 -9
- package/lib/lowcode/index.js +1 -5
- package/lib/lowcode/painter/Components.js +2 -2
- package/lib/lowcode/painter/Design.js +7 -4
- package/lib/lowcode/painter/DesignOperator.js +108 -82
- package/lib/lowcode/painter/DesignToolbar.js +83 -45
- package/lib/lowcode/painter/Outline.js +10 -8
- package/lib/lowcode/painter/Panel.js +83 -43
- package/lib/lowcode/painter/components/ActionBindModal.js +42 -25
- package/lib/lowcode/painter/components/AdvancePanel.js +36 -20
- package/lib/lowcode/painter/components/AttrsPanel.js +39 -28
- package/lib/lowcode/painter/components/Collapse.js +26 -26
- package/lib/lowcode/painter/components/ColorInput.js +24 -24
- package/lib/lowcode/painter/components/DragDrop/DragDropContext.js +1 -1
- package/lib/lowcode/painter/components/FieldSelector.js +26 -13
- package/lib/lowcode/painter/components/ListEditor.js +24 -24
- package/lib/lowcode/painter/components/NumberInput.js +28 -28
- 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/PreviewIframe.js +26 -0
- package/lib/lowcode/painter/components/RuleInput.js +30 -31
- package/lib/lowcode/painter/components/SortBox.js +22 -22
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +35 -34
- package/lib/lowcode/painter/components/code-editor/CssEditor.js +25 -25
- package/lib/lowcode/painter/components/code-editor/FullScreenEditor.js +23 -23
- package/lib/lowcode/painter/components/code-editor/JSEditor.js +48 -42
- package/lib/lowcode/painter/components/code-editor/JsonEditor.js +25 -25
- package/lib/lowcode/painter/components/field-setting/CheckFrontRules.js +116 -0
- package/lib/lowcode/painter/components/field-setting/CheckRules.js +1 -26
- package/lib/lowcode/painter/components/field-setting/FieldRulesModal.js +34 -13
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +155 -74
- package/lib/lowcode/painter/components/field-setting/index.js +32 -65
- package/lib/lowcode/painter/components/field-setting/meta/frontRules.js +59 -0
- package/lib/lowcode/painter/panel-section/ActionsEditor/index.js +3 -1
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +10 -16
- package/lib/lowcode/painter/panel-section/ButtonType.js +4 -2
- package/lib/lowcode/painter/panel-section/ComponentSelector.js +43 -0
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +33 -7
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +69 -51
- package/lib/lowcode/painter/panel-section/I18nInput.js +2 -1
- package/lib/lowcode/painter/panel-section/Icon.js +23 -23
- package/lib/lowcode/painter/panel-section/IconSelector.js +16 -16
- package/lib/lowcode/painter/panel-section/ImpExp.js +131 -36
- package/lib/lowcode/painter/panel-section/ImpExpAlone.js +130 -0
- package/lib/lowcode/painter/panel-section/LayoutRatio.js +21 -21
- package/lib/lowcode/painter/panel-section/PageLayoutDisplay.js +120 -0
- package/lib/lowcode/painter/panel-section/SerialsSelector.js +4 -2
- package/lib/lowcode/painter/panel-section/SplitDisplay.js +27 -111
- 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 +4 -4
- 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 +7 -6
- 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 +22 -16
- package/lib/lowcode/painter/panel-section/TableTopFilter.js +22 -12
- package/lib/lowcode/painter/panel-section/TreeRootEditor.js +12 -4
- 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 +159 -152
- 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 +28 -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 -27
- 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/view/Canvas.js +34 -7
- package/lib/lowcode/view/Page.js +2 -4
- package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +8 -2
- package/lib/lowcode/view/lc-components/Box/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Box/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Box/index.js +4 -4
- 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 +35 -39
- 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/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/CardList/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/CardList/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/CardList/meta.json +153 -143
- package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +2 -9
- package/lib/lowcode/view/lc-components/Dialog/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Dialog/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Dialog/index.js +143 -19
- package/lib/lowcode/view/lc-components/Dialog/index.less +3 -3
- package/lib/lowcode/view/lc-components/Dialog/meta.json +150 -120
- package/lib/lowcode/view/lc-components/Drawer/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Drawer/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Drawer/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Drawer/index.js +15 -12
- package/lib/lowcode/view/lc-components/Drawer/index.less +9 -9
- package/lib/lowcode/view/lc-components/Drawer/meta.json +131 -143
- package/lib/lowcode/view/lc-components/FieldColor/meta.json +146 -0
- package/lib/lowcode/view/lc-components/FieldComplex/meta.json +122 -0
- package/lib/lowcode/view/lc-components/FieldDate/meta.json +128 -0
- package/lib/lowcode/view/lc-components/FieldDict/meta.json +127 -0
- package/lib/lowcode/view/lc-components/FieldEditor/meta.json +127 -0
- package/lib/lowcode/view/lc-components/FieldGroup/meta.json +156 -0
- package/lib/lowcode/view/lc-components/FieldNumber/meta.json +131 -0
- package/lib/lowcode/view/lc-components/FieldRadio/meta.json +104 -0
- package/lib/lowcode/view/lc-components/FieldRegion/meta.json +110 -0
- package/lib/lowcode/view/lc-components/FieldSelect/meta.json +141 -0
- package/lib/lowcode/view/lc-components/FieldString/meta.json +141 -0
- package/lib/lowcode/view/lc-components/FieldSwitch/meta.json +114 -0
- package/lib/lowcode/view/lc-components/FieldTextarea/meta.json +132 -0
- package/lib/lowcode/view/lc-components/FieldUpload/meta.json +154 -0
- package/lib/lowcode/view/lc-components/FieldUser/meta.json +165 -0
- package/lib/lowcode/view/lc-components/FieldYear/meta.json +118 -0
- package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +20 -31
- package/lib/lowcode/view/lc-components/Form/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Form/FunctionPreview.js +9 -1
- package/lib/lowcode/view/lc-components/Form/index.js +341 -76
- package/lib/lowcode/view/lc-components/Form/index.less +4 -4
- package/lib/lowcode/view/lc-components/Form/meta.json +610 -599
- package/lib/lowcode/view/lc-components/Iframe/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Iframe/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Iframe/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Iframe/meta.json +32 -32
- package/lib/lowcode/view/lc-components/ImEx/FunctionDesign.js +9 -3
- package/lib/lowcode/view/lc-components/ImEx/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/ImEx/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/ImEx/index.js +468 -9
- package/lib/lowcode/view/lc-components/ImEx/index.less +7 -0
- package/lib/lowcode/view/lc-components/ImEx/meta.json +114 -82
- package/lib/lowcode/view/lc-components/Image/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Image/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Image/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Image/meta.json +114 -114
- package/lib/lowcode/view/lc-components/JSX/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/JSX/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/JSX/FunctionPreview.js +2 -1
- package/lib/{components/LdRuntimeCom/index.js → lowcode/view/lc-components/JSX/RuntimeComp.js} +13 -16
- package/lib/lowcode/view/lc-components/JSX/index.js +5 -6
- package/lib/lowcode/view/lc-components/JSX/meta.json +28 -28
- package/lib/lowcode/view/lc-components/Layout/FunctionDesign.js +11 -18
- package/lib/lowcode/view/lc-components/Layout/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Layout/index.js +19 -17
- 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/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Link/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Link/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Link/index.js +3 -0
- package/lib/lowcode/view/lc-components/Link/meta.json +112 -112
- package/lib/lowcode/view/lc-components/Page/meta.json +55 -49
- package/lib/lowcode/view/lc-components/PageContent/index.js +9 -8
- package/lib/lowcode/view/lc-components/PageContent/meta.json +9 -9
- package/lib/lowcode/view/lc-components/PageFooter/index.js +5 -5
- package/lib/lowcode/view/lc-components/PageFooter/meta.json +9 -9
- package/lib/lowcode/view/lc-components/PageHeader/index.js +7 -5
- package/lib/lowcode/view/lc-components/PageHeader/meta.json +9 -9
- package/lib/lowcode/view/lc-components/PageLayout/FunctionDesign.js +76 -0
- package/lib/lowcode/view/lc-components/PageLayout/FunctionLive.js +17 -0
- package/lib/lowcode/view/lc-components/PageLayout/FunctionPreview.js +17 -0
- package/lib/lowcode/view/lc-components/PageLayout/index.js +45 -0
- package/lib/lowcode/view/lc-components/PageLayout/meta.json +47 -0
- package/lib/lowcode/view/lc-components/PageModal/index.js +11 -14
- package/lib/lowcode/view/lc-components/Section/FunctionDesign.js +2 -8
- package/lib/lowcode/view/lc-components/Section/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Section/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Section/index.js +6 -3
- package/lib/lowcode/view/lc-components/Section/index.less +7 -7
- package/lib/lowcode/view/lc-components/Section/meta.json +107 -107
- package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +19 -20
- package/lib/lowcode/view/lc-components/Split/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Split/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Split/index.js +5 -6
- package/lib/lowcode/view/lc-components/Split/meta.json +53 -53
- package/lib/lowcode/view/lc-components/Table/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Table/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Table/components/TopFilter.js +75 -55
- package/lib/lowcode/view/lc-components/Table/components/TopImex.js +433 -0
- package/lib/lowcode/view/lc-components/Table/index.js +422 -198
- package/lib/lowcode/view/lc-components/Table/meta.json +451 -399
- package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +12 -19
- package/lib/lowcode/view/lc-components/Tabs/index.js +51 -36
- package/lib/lowcode/view/lc-components/Tabs/meta.json +113 -113
- package/lib/lowcode/view/lc-components/Text/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Text/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Text/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Text/index.js +3 -0
- package/lib/lowcode/view/lc-components/Text/meta.json +66 -66
- package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +2 -3
- package/lib/lowcode/view/lc-components/Tree/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Tree/index.js +170 -116
- package/lib/lowcode/view/lc-components/Tree/index.less +4 -4
- package/lib/lowcode/view/lc-components/Tree/meta.json +357 -301
- package/lib/lowcode/view/lc-components/Wrapper.js +12 -12
- package/lib/lowcode/view/style/canvas.less +5 -5
- package/lib/lowcode/view/style/loading.less +84 -84
- package/lib/lowcode/view/style/page.less +7 -7
- package/lib/services.js +0 -25
- package/lib/upload/FilesWall/file.png +0 -0
- package/lib/upload/FilesWall/index.js +429 -0
- package/lib/upload/FilesWall/index.less +74 -0
- package/lib/upload/Form/gridForm.js +3 -2
- package/lib/upload/Form/index.js +2 -1
- package/lib/upload/Form/index.less +7 -7
- package/lib/upload/FormItem/index.js +20 -21
- package/lib/upload/index.js +8 -1
- package/lib/utils/action.js +2 -2
- package/lib/utils/form.js +37 -24
- package/lib/utils/grid.js +10 -7
- package/lowcode.js +1 -1
- package/package.json +173 -171
- package/upload.js +1 -1
- package/utils.js +1 -1
- package/es/lowcode/engine/meta/local/local.zh-cn.js +0 -97
- package/lib/lowcode/engine/meta/local/local.zh-cn.js +0 -103
|
@@ -1,57 +1,65 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = exports.RemoteSourceContext = void 0;
|
|
9
|
-
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
10
9
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
var
|
|
10
|
+
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
12
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
13
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
16
15
|
var _ahooks = require("ahooks");
|
|
16
|
+
var _launcher = _interopRequireDefault(require("../launcher"));
|
|
17
17
|
var _Builder = require("../../../components/Builder");
|
|
18
18
|
var _action2 = require("../../../helper/action");
|
|
19
|
-
var
|
|
19
|
+
var _usePageDataStore2 = _interopRequireDefault(require("../tools/usePageDataStore"));
|
|
20
|
+
var _ContextProvider = require("../provider/ContextProvider");
|
|
20
21
|
var _dataProcess = require("../tools/dataProcess");
|
|
21
22
|
var _apiUrl = require("../../constants/api-url");
|
|
22
23
|
var _constants = require("../../constants");
|
|
23
|
-
var
|
|
24
|
+
var _eventTopics = require("../../constants/event-topics");
|
|
25
|
+
var _helper = require("../tools/helper");
|
|
24
26
|
var RemoteSourceContext = exports.RemoteSourceContext = /*#__PURE__*/(0, _react.createContext)(null);
|
|
25
27
|
var _default = exports.default = function _default(_ref) {
|
|
26
28
|
var children = _ref.children,
|
|
27
29
|
code = _ref.code,
|
|
28
|
-
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
eventBus = _ref.eventBus;
|
|
31
|
+
var _usePageDataStore = (0, _usePageDataStore2.default)(function (state) {
|
|
32
|
+
return {
|
|
33
|
+
initialize: state.initialize,
|
|
34
|
+
initializeModule: state.initializeModule,
|
|
35
|
+
reset: state.reset
|
|
36
|
+
};
|
|
37
|
+
}),
|
|
38
|
+
initialize = _usePageDataStore.initialize,
|
|
39
|
+
initializeModule = _usePageDataStore.initializeModule,
|
|
40
|
+
reset = _usePageDataStore.reset;
|
|
41
|
+
var _useTemporalStore = (0, _ContextProvider.useTemporalStore)(function (state) {
|
|
42
|
+
return {
|
|
43
|
+
pause: state.pause,
|
|
44
|
+
resume: state.resume,
|
|
45
|
+
clear: state.clear
|
|
46
|
+
};
|
|
47
|
+
}),
|
|
48
|
+
pause = _useTemporalStore.pause,
|
|
49
|
+
resume = _useTemporalStore.resume,
|
|
50
|
+
clear = _useTemporalStore.clear;
|
|
38
51
|
var _useSetState = (0, _ahooks.useSetState)({}),
|
|
39
52
|
_useSetState2 = (0, _slicedToArray2.default)(_useSetState, 2),
|
|
40
53
|
remoteSource = _useSetState2[0],
|
|
41
54
|
setRemoteSource = _useSetState2[1];
|
|
42
|
-
var _useCookieState = (0, _ahooks.useCookieState)(_constants.COOKIE_RUNTIME_KEY),
|
|
43
|
-
_useCookieState2 = (0, _slicedToArray2.default)(_useCookieState, 2),
|
|
44
|
-
cookieRuntime = _useCookieState2[0],
|
|
45
|
-
setRuntime = _useCookieState2[1];
|
|
46
|
-
var prevRuntime = (0, _react.useRef)(cookieRuntime);
|
|
47
55
|
(0, _ahooks.useCreation)(function () {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
56
|
+
(0, _launcher.default)();
|
|
57
|
+
pause();
|
|
58
|
+
(0, _helper.setMetaAttrs)(_constants.COOKIE_RUNTIME_KEY, eventBus.runtime);
|
|
52
59
|
}, []);
|
|
53
60
|
(0, _ahooks.useUnmount)(function () {
|
|
54
|
-
|
|
61
|
+
reset();
|
|
62
|
+
clear();
|
|
55
63
|
});
|
|
56
64
|
|
|
57
65
|
// 获取页面数据
|
|
@@ -61,7 +69,7 @@ var _default = exports.default = function _default(_ref) {
|
|
|
61
69
|
fetchPageDataLoading = _useRequest.loading,
|
|
62
70
|
runFetchPageData = _useRequest.runAsync;
|
|
63
71
|
// 获取模块数据
|
|
64
|
-
var _useRequest2 = (0, _ahooks.useRequest)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _constants.RUNTIME.DESIGN, _apiUrl.fetchDesignModlueData), _constants.RUNTIME.PREVIEW, _apiUrl.fetchPreviewModlueData), _constants.RUNTIME.LIVE, _apiUrl.fetchModlueData)[runtime], {
|
|
72
|
+
var _useRequest2 = (0, _ahooks.useRequest)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _constants.RUNTIME.DESIGN, _apiUrl.fetchDesignModlueData), _constants.RUNTIME.PREVIEW, _apiUrl.fetchPreviewModlueData), _constants.RUNTIME.LIVE, _apiUrl.fetchModlueData)[eventBus.runtime], {
|
|
65
73
|
manual: true,
|
|
66
74
|
onSuccess: function onSuccess(_ref2) {
|
|
67
75
|
var code = _ref2.code,
|
|
@@ -70,6 +78,7 @@ var _default = exports.default = function _default(_ref) {
|
|
|
70
78
|
setRemoteSource({
|
|
71
79
|
module: data
|
|
72
80
|
});
|
|
81
|
+
initializeModule(data);
|
|
73
82
|
}
|
|
74
83
|
}
|
|
75
84
|
}),
|
|
@@ -111,8 +120,48 @@ var _default = exports.default = function _default(_ref) {
|
|
|
111
120
|
fetchAllSerialsLoading = _useRequest4.loading,
|
|
112
121
|
runFetchAllSerials = _useRequest4.run,
|
|
113
122
|
refreshSerials = _useRequest4.refreshAsync;
|
|
123
|
+
|
|
124
|
+
// 获取导入导出行为下拉数据
|
|
125
|
+
var _useRequest5 = (0, _ahooks.useRequest)(_apiUrl.fetchAllBehaviorEx, {
|
|
126
|
+
manual: true,
|
|
127
|
+
onSuccess: function onSuccess(_ref5) {
|
|
128
|
+
var code = _ref5.code,
|
|
129
|
+
data = _ref5.data;
|
|
130
|
+
if (code === 1) {
|
|
131
|
+
setRemoteSource({
|
|
132
|
+
impTypeList: data.map(function (item) {
|
|
133
|
+
return {
|
|
134
|
+
key: item.code,
|
|
135
|
+
value: item.code,
|
|
136
|
+
label: item.name
|
|
137
|
+
};
|
|
138
|
+
})
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}),
|
|
143
|
+
runFetchAllBehaviorImport = _useRequest5.run;
|
|
144
|
+
var _useRequest6 = (0, _ahooks.useRequest)(_apiUrl.fetchAllBehaviorEx, {
|
|
145
|
+
manual: true,
|
|
146
|
+
onSuccess: function onSuccess(_ref6) {
|
|
147
|
+
var code = _ref6.code,
|
|
148
|
+
data = _ref6.data;
|
|
149
|
+
if (code === 1) {
|
|
150
|
+
setRemoteSource({
|
|
151
|
+
expTypeList: data.map(function (item) {
|
|
152
|
+
return {
|
|
153
|
+
key: item.code,
|
|
154
|
+
value: item.code,
|
|
155
|
+
label: item.name
|
|
156
|
+
};
|
|
157
|
+
})
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}),
|
|
162
|
+
runFetchAllBehaviorExport = _useRequest6.run;
|
|
114
163
|
(0, _ahooks.useAsyncEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
115
|
-
var fetchPageDataRes, data, list, detail,
|
|
164
|
+
var fetchPageDataRes, data, list, detail, source;
|
|
116
165
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
117
166
|
while (1) switch (_context.prev = _context.next) {
|
|
118
167
|
case 0:
|
|
@@ -123,30 +172,35 @@ var _default = exports.default = function _default(_ref) {
|
|
|
123
172
|
case 2:
|
|
124
173
|
fetchPageDataRes = _context.sent;
|
|
125
174
|
if (!(fetchPageDataRes.code === 1)) {
|
|
126
|
-
_context.next =
|
|
175
|
+
_context.next = 16;
|
|
127
176
|
break;
|
|
128
177
|
}
|
|
129
178
|
data = fetchPageDataRes.data, list = fetchPageDataRes.list, detail = fetchPageDataRes.detail;
|
|
130
|
-
|
|
131
|
-
|
|
179
|
+
source = detail[list[0]].source;
|
|
180
|
+
(0, _helper.setMetaAttrs)(_constants.META_TAG_NAME, data);
|
|
132
181
|
_context.next = 9;
|
|
133
182
|
return runFetchModlueData(data.dataModelKey, {
|
|
134
183
|
moduleCode: data.moduleCode
|
|
135
184
|
});
|
|
136
185
|
case 9:
|
|
186
|
+
runFetchAllBehaviorImport({
|
|
187
|
+
behaviorMode: 'IMPORT',
|
|
188
|
+
moduleCode: data.moduleCode
|
|
189
|
+
});
|
|
190
|
+
runFetchAllBehaviorExport({
|
|
191
|
+
behaviorMode: 'EXPORT',
|
|
192
|
+
moduleCode: data.moduleCode
|
|
193
|
+
});
|
|
137
194
|
runFetchAllDataset({
|
|
138
195
|
dataModelKey: data.dataModelKey
|
|
139
196
|
});
|
|
140
197
|
runFetchAllSerials({
|
|
141
198
|
uid: data.moduleId
|
|
142
199
|
});
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
});
|
|
148
|
-
setPageData((0, _dataProcess.decompress)(source));
|
|
149
|
-
case 13:
|
|
200
|
+
initialize((0, _dataProcess.decompress)(source));
|
|
201
|
+
resume();
|
|
202
|
+
eventBus.$publisher(_eventTopics.PAGE_LOAD_MOUNT);
|
|
203
|
+
case 16:
|
|
150
204
|
case "end":
|
|
151
205
|
return _context.stop();
|
|
152
206
|
}
|
|
@@ -159,20 +213,13 @@ var _default = exports.default = function _default(_ref) {
|
|
|
159
213
|
});
|
|
160
214
|
});
|
|
161
215
|
return /*#__PURE__*/_react.default.createElement(RemoteSourceContext.Provider, {
|
|
162
|
-
value: (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
163
|
-
pageData: pageData
|
|
164
|
-
}, remoteSource), {}, {
|
|
216
|
+
value: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, remoteSource), {}, {
|
|
165
217
|
loading: fetchPageDataLoading || fetchModlueDataLoading,
|
|
166
218
|
fetchAllDatasetLoading: fetchAllDatasetLoading,
|
|
167
219
|
fetchAllSerialsLoading: fetchAllSerialsLoading,
|
|
168
220
|
refreshModlueData: refreshModlueData,
|
|
169
221
|
refreshDataset: refreshDataset,
|
|
170
|
-
refreshSerials: refreshSerials
|
|
171
|
-
setPageData: setPageData,
|
|
172
|
-
back: back,
|
|
173
|
-
forward: forward,
|
|
174
|
-
backLength: backLength,
|
|
175
|
-
forwardLength: forwardLength
|
|
222
|
+
refreshSerials: refreshSerials
|
|
176
223
|
})
|
|
177
224
|
}, /*#__PURE__*/_react.default.createElement(_Builder.LuckDaContext.Provider, {
|
|
178
225
|
value: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, remoteSource.module), {}, {
|
|
@@ -20,10 +20,10 @@ var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime
|
|
|
20
20
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
21
21
|
var LZString = _interopRequireWildcard(require("lz-string"));
|
|
22
22
|
var _constants = require("../../constants");
|
|
23
|
-
/**
|
|
24
|
-
* 数据压缩
|
|
25
|
-
* @param {JSON} data
|
|
26
|
-
* @returns 加密后的字符串
|
|
23
|
+
/**
|
|
24
|
+
* 数据压缩
|
|
25
|
+
* @param {JSON} data
|
|
26
|
+
* @returns 加密后的字符串
|
|
27
27
|
*/
|
|
28
28
|
function compress(data) {
|
|
29
29
|
// 将对象转换为JSON字符串
|
|
@@ -32,10 +32,10 @@ function compress(data) {
|
|
|
32
32
|
return LZString.compressToBase64(jsonString);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
/**
|
|
36
|
-
* 数据解压
|
|
37
|
-
* @param {string} compressedData
|
|
38
|
-
* @returns {json}
|
|
35
|
+
/**
|
|
36
|
+
* 数据解压
|
|
37
|
+
* @param {string} compressedData
|
|
38
|
+
* @returns {json}
|
|
39
39
|
*/
|
|
40
40
|
function decompress(compressedData) {
|
|
41
41
|
// 使用LZ-String解压数据
|
|
@@ -44,16 +44,20 @@ function decompress(compressedData) {
|
|
|
44
44
|
return JSON.parse(jsonString);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
/**
|
|
48
|
-
* 查找指定ID的节点及其父节点。
|
|
49
|
-
*
|
|
50
|
-
* @param {string} id - 要查找的节点ID。
|
|
51
|
-
* @param {Object} current - 当前遍历的JSON对象。
|
|
52
|
-
* @param {Object|null} parent - 当前节点的父节点。
|
|
53
|
-
* @returns {{node: Object|null, parent: Object|null}} 查找结果,包含节点和其父节点。
|
|
47
|
+
/**
|
|
48
|
+
* 查找指定ID的节点及其父节点。
|
|
49
|
+
*
|
|
50
|
+
* @param {string} id - 要查找的节点ID。
|
|
51
|
+
* @param {Object} current - 当前遍历的JSON对象。
|
|
52
|
+
* @param {Object|null} parent - 当前节点的父节点。
|
|
53
|
+
* @returns {{node: Object|null, parent: Object|null}} 查找结果,包含节点和其父节点。
|
|
54
54
|
*/
|
|
55
55
|
function findNodeAndParent(id, current) {
|
|
56
56
|
var parent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
57
|
+
if (!id) return {
|
|
58
|
+
node: null,
|
|
59
|
+
parent: null
|
|
60
|
+
};
|
|
57
61
|
if (!parent && current.props.id === id) {
|
|
58
62
|
return {
|
|
59
63
|
node: current,
|
|
@@ -80,13 +84,13 @@ function findNodeAndParent(id, current) {
|
|
|
80
84
|
};
|
|
81
85
|
}
|
|
82
86
|
|
|
83
|
-
/**
|
|
84
|
-
* 对指定的JSON结构进行节点的添加、修改或删除操作。
|
|
85
|
-
*
|
|
86
|
-
* @param {Object} json - 要操作的JSON对象。
|
|
87
|
-
* @param {string|null} path - 要操作的节点路径,使用'/'分隔。
|
|
88
|
-
* @param {string} id - 操作节点的唯一标识符。
|
|
89
|
-
* @param {Object|null} data - 要添加或修改的数据。如果为null,表示删除操作。
|
|
87
|
+
/**
|
|
88
|
+
* 对指定的JSON结构进行节点的添加、修改或删除操作。
|
|
89
|
+
*
|
|
90
|
+
* @param {Object} json - 要操作的JSON对象。
|
|
91
|
+
* @param {string|null} path - 要操作的节点路径,使用'/'分隔。
|
|
92
|
+
* @param {string} id - 操作节点的唯一标识符。
|
|
93
|
+
* @param {Object|null} data - 要添加或修改的数据。如果为null,表示删除操作。
|
|
90
94
|
*/
|
|
91
95
|
function process(json, path, id, data) {
|
|
92
96
|
if (!json) {
|
|
@@ -152,25 +156,25 @@ function process(json, path, id, data) {
|
|
|
152
156
|
}
|
|
153
157
|
}
|
|
154
158
|
|
|
155
|
-
/**
|
|
156
|
-
* 对指定的JSON结构进行节点的添加操作。
|
|
157
|
-
*
|
|
158
|
-
* @param {Object} json - 要操作的JSON对象。
|
|
159
|
-
* @param {string} parentId - 父节点的唯一标识符。
|
|
160
|
-
* @param {string} id - 操作节点的唯一标识符。
|
|
161
|
-
* @param {Object|null} data - 要添加或修改的数据。如果为null,表示删除操作。
|
|
159
|
+
/**
|
|
160
|
+
* 对指定的JSON结构进行节点的添加操作。
|
|
161
|
+
*
|
|
162
|
+
* @param {Object} json - 要操作的JSON对象。
|
|
163
|
+
* @param {string} parentId - 父节点的唯一标识符。
|
|
164
|
+
* @param {string} id - 操作节点的唯一标识符。
|
|
165
|
+
* @param {Object|null} data - 要添加或修改的数据。如果为null,表示删除操作。
|
|
162
166
|
*/
|
|
163
167
|
function add(json, parentId, id, data) {
|
|
164
168
|
process(json, getPathById(json, parentId), id, data);
|
|
165
169
|
}
|
|
166
170
|
|
|
167
|
-
/**
|
|
168
|
-
* 移动指定的节点到另一个节点的指定位置。
|
|
169
|
-
*
|
|
170
|
-
* @param {Object} json - 要操作的JSON对象。
|
|
171
|
-
* @param {string} sid - 被移动的节点id
|
|
172
|
-
* @param {string} tid - 目标节点id
|
|
173
|
-
* @param {string} action - 'left': 往节点前面插入,'right':往节点后面插,'inside':往节点子节点插
|
|
171
|
+
/**
|
|
172
|
+
* 移动指定的节点到另一个节点的指定位置。
|
|
173
|
+
*
|
|
174
|
+
* @param {Object} json - 要操作的JSON对象。
|
|
175
|
+
* @param {string} sid - 被移动的节点id
|
|
176
|
+
* @param {string} tid - 目标节点id
|
|
177
|
+
* @param {string} action - 'left': 往节点前面插入,'right':往节点后面插,'inside':往节点子节点插
|
|
174
178
|
*/
|
|
175
179
|
function move(json, sid, tid, action) {
|
|
176
180
|
// 验证节点存在性
|
|
@@ -226,34 +230,34 @@ function move(json, sid, tid, action) {
|
|
|
226
230
|
}
|
|
227
231
|
}
|
|
228
232
|
|
|
229
|
-
/**
|
|
230
|
-
* 对指定的JSON结构进行节点的修改操作。
|
|
231
|
-
*
|
|
232
|
-
* @param {Object} json - 要操作的JSON对象。
|
|
233
|
-
* @param {string} id - 操作节点的唯一标识符。
|
|
234
|
-
* @param {Object|null} data - 要添加或修改的数据。如果为null,表示删除操作。
|
|
233
|
+
/**
|
|
234
|
+
* 对指定的JSON结构进行节点的修改操作。
|
|
235
|
+
*
|
|
236
|
+
* @param {Object} json - 要操作的JSON对象。
|
|
237
|
+
* @param {string} id - 操作节点的唯一标识符。
|
|
238
|
+
* @param {Object|null} data - 要添加或修改的数据。如果为null,表示删除操作。
|
|
235
239
|
*/
|
|
236
240
|
function modifyById(json, id, data) {
|
|
237
241
|
process(json, null, id, data);
|
|
238
242
|
}
|
|
239
243
|
|
|
240
|
-
/**
|
|
241
|
-
* 删除指定id的节点。
|
|
242
|
-
*
|
|
243
|
-
* @param {Object} json - JSON对象。
|
|
244
|
-
* @param {string} id - 要删除的节点ID。
|
|
244
|
+
/**
|
|
245
|
+
* 删除指定id的节点。
|
|
246
|
+
*
|
|
247
|
+
* @param {Object} json - JSON对象。
|
|
248
|
+
* @param {string} id - 要删除的节点ID。
|
|
245
249
|
*/
|
|
246
250
|
function deleteById(json, id) {
|
|
247
251
|
process(json, null, id);
|
|
248
252
|
}
|
|
249
253
|
|
|
250
|
-
/**
|
|
251
|
-
* 根据ID在给定的JSON结构中查找节点的路径。
|
|
252
|
-
*
|
|
253
|
-
* @param {Object} json - 要搜索的JSON对象。
|
|
254
|
-
* @param {string} id - 要查找的节点ID。
|
|
255
|
-
* @param {string} currentPath - 当前递归到的路径,用于构建返回的路径字符串。
|
|
256
|
-
* @returns {string|null} 如果找到节点,返回节点的路径;否则返回null。
|
|
254
|
+
/**
|
|
255
|
+
* 根据ID在给定的JSON结构中查找节点的路径。
|
|
256
|
+
*
|
|
257
|
+
* @param {Object} json - 要搜索的JSON对象。
|
|
258
|
+
* @param {string} id - 要查找的节点ID。
|
|
259
|
+
* @param {string} currentPath - 当前递归到的路径,用于构建返回的路径字符串。
|
|
260
|
+
* @returns {string|null} 如果找到节点,返回节点的路径;否则返回null。
|
|
257
261
|
*/
|
|
258
262
|
function getPathById(json, id) {
|
|
259
263
|
var currentPath = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
@@ -273,28 +277,28 @@ function getPathById(json, id) {
|
|
|
273
277
|
return null;
|
|
274
278
|
}
|
|
275
279
|
|
|
276
|
-
/**
|
|
277
|
-
* 在给定的JSON结构中搜索具有特定id的节点,并返回包含该节点及其所有父节点的props属性的路径数组。
|
|
278
|
-
*
|
|
279
|
-
* @param {Object} data - 待搜索的JSON对象,它代表了一个复杂的树状结构,每个节点都可能有props和children属性。
|
|
280
|
-
* @param {string} targetId - 需要找到的目标节点的id。
|
|
281
|
-
* @returns {Array<Object>} 一个包含目标节点及其所有父节点的props属性的数组。如果未找到目标节点,则返回空数组。
|
|
282
|
-
*
|
|
283
|
-
* @example
|
|
284
|
-
* const data = {
|
|
285
|
-
* props: {
|
|
286
|
-
* id: 'page_root',
|
|
287
|
-
* type: 'Page',
|
|
288
|
-
* name: '页面',
|
|
289
|
-
* hasHeder: true,
|
|
290
|
-
* hasFooter: true,
|
|
291
|
-
* },
|
|
292
|
-
* // ...其他节点
|
|
293
|
-
* };
|
|
294
|
-
*
|
|
295
|
-
* const path = getPathNodesById(data, 'form_jknbjkun');
|
|
296
|
-
* console.log(path);
|
|
297
|
-
* // 输出目标节点及其所有父节点的props属性的数组
|
|
280
|
+
/**
|
|
281
|
+
* 在给定的JSON结构中搜索具有特定id的节点,并返回包含该节点及其所有父节点的props属性的路径数组。
|
|
282
|
+
*
|
|
283
|
+
* @param {Object} data - 待搜索的JSON对象,它代表了一个复杂的树状结构,每个节点都可能有props和children属性。
|
|
284
|
+
* @param {string} targetId - 需要找到的目标节点的id。
|
|
285
|
+
* @returns {Array<Object>} 一个包含目标节点及其所有父节点的props属性的数组。如果未找到目标节点,则返回空数组。
|
|
286
|
+
*
|
|
287
|
+
* @example
|
|
288
|
+
* const data = {
|
|
289
|
+
* props: {
|
|
290
|
+
* id: 'page_root',
|
|
291
|
+
* type: 'Page',
|
|
292
|
+
* name: '页面',
|
|
293
|
+
* hasHeder: true,
|
|
294
|
+
* hasFooter: true,
|
|
295
|
+
* },
|
|
296
|
+
* // ...其他节点
|
|
297
|
+
* };
|
|
298
|
+
*
|
|
299
|
+
* const path = getPathNodesById(data, 'form_jknbjkun');
|
|
300
|
+
* console.log(path);
|
|
301
|
+
* // 输出目标节点及其所有父节点的props属性的数组
|
|
298
302
|
*/
|
|
299
303
|
function getPathNodesById(data, targetId) {
|
|
300
304
|
// 初始化结果数组
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = diff;
|
|
8
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
|
+
var richTypes = {
|
|
10
|
+
Date: true,
|
|
11
|
+
RegExp: true,
|
|
12
|
+
String: true,
|
|
13
|
+
Number: true
|
|
14
|
+
};
|
|
15
|
+
function diff(obj, newObj) {
|
|
16
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
17
|
+
cyclesFix: true
|
|
18
|
+
};
|
|
19
|
+
var _stack = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
20
|
+
var diffs = [];
|
|
21
|
+
var isObjArray = Array.isArray(obj);
|
|
22
|
+
var _loop = function _loop() {
|
|
23
|
+
var _Object$getPrototypeO;
|
|
24
|
+
var objKey = obj[key];
|
|
25
|
+
var path = isObjArray ? +key : key;
|
|
26
|
+
if (!(key in newObj)) {
|
|
27
|
+
diffs.push({
|
|
28
|
+
type: 'REMOVE',
|
|
29
|
+
path: [path],
|
|
30
|
+
oldValue: obj[key]
|
|
31
|
+
});
|
|
32
|
+
return 1; // continue
|
|
33
|
+
}
|
|
34
|
+
var newObjKey = newObj[key];
|
|
35
|
+
var areCompatibleObjects = (0, _typeof2.default)(objKey) === 'object' && (0, _typeof2.default)(newObjKey) === 'object' && Array.isArray(objKey) === Array.isArray(newObjKey);
|
|
36
|
+
if (objKey && newObjKey && areCompatibleObjects && !richTypes[(_Object$getPrototypeO = Object.getPrototypeOf(objKey)) === null || _Object$getPrototypeO === void 0 || (_Object$getPrototypeO = _Object$getPrototypeO.constructor) === null || _Object$getPrototypeO === void 0 ? void 0 : _Object$getPrototypeO.name] && (!options.cyclesFix || !_stack.includes(objKey))) {
|
|
37
|
+
var nestedDiffs = diff(objKey, newObjKey, options, options.cyclesFix ? _stack.concat([objKey]) : []);
|
|
38
|
+
diffs.push.apply(diffs, nestedDiffs.map(function (difference) {
|
|
39
|
+
difference.path.unshift(path);
|
|
40
|
+
return difference;
|
|
41
|
+
}));
|
|
42
|
+
} else if (objKey !== newObjKey &&
|
|
43
|
+
// treat NaN values as equivalent
|
|
44
|
+
!(Number.isNaN(objKey) && Number.isNaN(newObjKey)) && !(areCompatibleObjects && (isNaN(objKey) ? objKey + '' === newObjKey + '' : +objKey === +newObjKey))) {
|
|
45
|
+
diffs.push({
|
|
46
|
+
path: [path],
|
|
47
|
+
type: 'CHANGE',
|
|
48
|
+
value: newObjKey,
|
|
49
|
+
oldValue: objKey
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
for (var key in obj) {
|
|
54
|
+
if (_loop()) continue;
|
|
55
|
+
}
|
|
56
|
+
var isNewObjArray = Array.isArray(newObj);
|
|
57
|
+
for (var _key in newObj) {
|
|
58
|
+
if (!obj || !(_key in obj)) {
|
|
59
|
+
diffs.push({
|
|
60
|
+
type: 'CREATE',
|
|
61
|
+
path: [isNewObjArray ? +_key : _key],
|
|
62
|
+
value: newObj[_key]
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return diffs;
|
|
67
|
+
}
|
|
@@ -5,19 +5,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.executeCode = executeCode;
|
|
8
|
+
exports.extractKeywords = extractKeywords;
|
|
8
9
|
exports.getCtx = getCtx;
|
|
9
10
|
exports.getFuncBody = getFuncBody;
|
|
11
|
+
exports.getLDMetaAttr = getLDMetaAttr;
|
|
12
|
+
exports.getMetaAttr = getMetaAttr;
|
|
10
13
|
exports.isColor = isColor;
|
|
11
14
|
exports.isPromise = isPromise;
|
|
12
15
|
exports.listReducer = listReducer;
|
|
16
|
+
exports.loadScript = loadScript;
|
|
13
17
|
exports.omitBadProps = omitBadProps;
|
|
14
18
|
exports.parseCSS = parseCSS;
|
|
19
|
+
exports.setMetaAttrs = setMetaAttrs;
|
|
20
|
+
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
|
|
15
21
|
var _construct2 = _interopRequireDefault(require("@babel/runtime/helpers/construct"));
|
|
16
22
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
17
23
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
18
24
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
19
25
|
var _lodash = require("lodash");
|
|
20
26
|
var _postcss = _interopRequireDefault(require("postcss"));
|
|
27
|
+
var _constants = require("../../constants");
|
|
21
28
|
function isPromise(value) {
|
|
22
29
|
return !!value && (0, _typeof2.default)(value) === 'object' && typeof value.then === 'function';
|
|
23
30
|
}
|
|
@@ -110,9 +117,8 @@ function listReducer(state, action) {
|
|
|
110
117
|
}
|
|
111
118
|
}
|
|
112
119
|
function getCtx(context) {
|
|
113
|
-
return
|
|
114
|
-
|
|
115
|
-
});
|
|
120
|
+
return context;
|
|
121
|
+
// return omitBy(context, (_, key) => startsWith(key, '_'));
|
|
116
122
|
}
|
|
117
123
|
function getFuncBody(funcCode) {
|
|
118
124
|
var regex = /{([\s\S]*?)}(?![\s\S]*})/;
|
|
@@ -133,8 +139,8 @@ function executeCode(context, code, argsName) {
|
|
|
133
139
|
throw new Error('executeCode参数不匹配');
|
|
134
140
|
}
|
|
135
141
|
var ctx = getCtx(context);
|
|
136
|
-
var func = (0, _construct2.default)(Function, (0, _toConsumableArray2.default)(argsName || []).concat(['ctx', getFuncBody(code)]));
|
|
137
|
-
return func.apply(void 0, args.concat([ctx]));
|
|
142
|
+
var func = (0, _construct2.default)(Function, (0, _toConsumableArray2.default)(argsName || []).concat(['ctx', 'window', "\"use strict\"; ".concat(getFuncBody(code))]));
|
|
143
|
+
return func.apply(void 0, args.concat([ctx, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, window.proxy), window)]));
|
|
138
144
|
}
|
|
139
145
|
function parseCSS(cssString) {
|
|
140
146
|
// 创建一个空对象来存储解析后的样式
|
|
@@ -157,9 +163,93 @@ function parseCSS(cssString) {
|
|
|
157
163
|
// 返回包含所有样式的对象
|
|
158
164
|
return parsedStyles;
|
|
159
165
|
}
|
|
160
|
-
;
|
|
161
166
|
function isColor(str) {
|
|
162
167
|
var hexRegex = /^#(?:[A-Fa-f0-9]{3,4}){1,2}$/;
|
|
163
168
|
var rgbaRegex = /^rgba?\(\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})(,\s*(0|1|0?\.\d+))?\s*\)$/;
|
|
164
169
|
return hexRegex.test(str) || rgbaRegex.test(str);
|
|
170
|
+
}
|
|
171
|
+
function setMetaAttrs(name, data) {
|
|
172
|
+
var meta = document.querySelector("meta[name=\"".concat(name, "\"]"));
|
|
173
|
+
if (!meta) {
|
|
174
|
+
meta = document.createElement('meta');
|
|
175
|
+
}
|
|
176
|
+
meta.name = name;
|
|
177
|
+
meta.content = (0, _lodash.isString)(data) ? data : new URLSearchParams(data).toString().replaceAll('&', ',');
|
|
178
|
+
document.head.appendChild(meta);
|
|
179
|
+
}
|
|
180
|
+
function getMetaAttr(name, _) {
|
|
181
|
+
if ((0, _lodash.isNil)(name)) return void 0;
|
|
182
|
+
var meta = document.querySelector("meta[name=\"".concat(name, "\"]"));
|
|
183
|
+
if (meta.content.includes(',')) {
|
|
184
|
+
var data = new URLSearchParams(meta.content.replaceAll(',', '&'));
|
|
185
|
+
if ((0, _lodash.isNil)(_)) {
|
|
186
|
+
return Object.fromEntries(data.entries());
|
|
187
|
+
}
|
|
188
|
+
if ((0, _lodash.isArray)(_)) {
|
|
189
|
+
return _.map(function (n) {
|
|
190
|
+
return data.get(n);
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
return data.get(_);
|
|
194
|
+
}
|
|
195
|
+
return meta.content;
|
|
196
|
+
}
|
|
197
|
+
function getLDMetaAttr(_) {
|
|
198
|
+
return getMetaAttr(_constants.META_TAG_NAME, _);
|
|
199
|
+
}
|
|
200
|
+
function extractKeywords(obj, keys) {
|
|
201
|
+
var keywords = [];
|
|
202
|
+
function recurse(currentObj) {
|
|
203
|
+
if ((0, _typeof2.default)(currentObj) !== 'object' || currentObj === null) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
for (var key in currentObj) {
|
|
207
|
+
var _iterator = (0, _createForOfIteratorHelper2.default)(keys),
|
|
208
|
+
_step;
|
|
209
|
+
try {
|
|
210
|
+
tag: for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
211
|
+
var triggerKey = _step.value;
|
|
212
|
+
var flag = (0, _lodash.isString)(triggerKey) ? key === triggerKey : (0, _lodash.has)(currentObj[key], triggerKey);
|
|
213
|
+
if (flag) {
|
|
214
|
+
var keyword = (0, _lodash.isString)(triggerKey) ? currentObj[triggerKey] : (0, _lodash.get)(currentObj[key], triggerKey);
|
|
215
|
+
keywords.push({
|
|
216
|
+
label: keyword,
|
|
217
|
+
kind: 'property',
|
|
218
|
+
insertText: keyword,
|
|
219
|
+
documentation: JSON.stringify(currentObj)
|
|
220
|
+
});
|
|
221
|
+
break tag;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
} catch (err) {
|
|
225
|
+
_iterator.e(err);
|
|
226
|
+
} finally {
|
|
227
|
+
_iterator.f();
|
|
228
|
+
}
|
|
229
|
+
recurse(currentObj[key]);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
recurse(obj);
|
|
233
|
+
return keywords;
|
|
234
|
+
}
|
|
235
|
+
function loadScript(path) {
|
|
236
|
+
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
237
|
+
var script = document.querySelector("script[src=\"".concat(path, "\"]"));
|
|
238
|
+
if (!script) {
|
|
239
|
+
var newScript = document.createElement('script');
|
|
240
|
+
newScript.src = path;
|
|
241
|
+
Object.keys(props).forEach(function (key) {
|
|
242
|
+
newScript[key] = props[key];
|
|
243
|
+
});
|
|
244
|
+
newScript.setAttribute('data-status', 'loading');
|
|
245
|
+
document.body.appendChild(newScript);
|
|
246
|
+
return {
|
|
247
|
+
ref: newScript,
|
|
248
|
+
status: 'loading'
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
return {
|
|
252
|
+
ref: script,
|
|
253
|
+
status: script.getAttribute('data-status') || 'ready'
|
|
254
|
+
};
|
|
165
255
|
}
|
|
@@ -22,8 +22,9 @@ var _excluded = ["props", "children"],
|
|
|
22
22
|
function useCanvasRender(data, deps) {
|
|
23
23
|
var dynamicCompMap = (0, _react.useRef)({});
|
|
24
24
|
var ctx = (0, _ContextProvider.useContext)();
|
|
25
|
-
var render = (0, _ahooks.useMemoizedFn)(function (
|
|
26
|
-
var
|
|
25
|
+
var render = (0, _ahooks.useMemoizedFn)(function () {
|
|
26
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
27
|
+
props = _ref.props,
|
|
27
28
|
children = _ref.children,
|
|
28
29
|
childrenMap = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
29
30
|
if (props && !_constants.LC_BUILDIN_UNIT_KEY_LIST.includes(props.id)) {
|