@luck-design-biz/luckda 0.0.25-6 → 0.0.25-8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/LDActions/index.js +8 -10
- package/es/components/LDActions/index.less +7 -4
- package/es/components/LdAutoForm/index.js +26 -8
- package/es/components/LdFormList/index.js +37 -22
- package/es/components/LdGrid/index.js +14 -7
- package/es/components/LdGridForm/index.js +18 -6
- package/es/components/LdTree/index.js +33 -15
- package/es/helper/form.js +15 -8
- package/es/locales/zh-CN.js +16 -10
- package/es/lowcode/constants/api-url.js +120 -32
- package/es/lowcode/constants/event-topics.js +2 -0
- package/es/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +4 -2
- package/es/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +4 -2
- package/es/lowcode/engine/meta/box.props.json +3 -3
- package/es/lowcode/engine/meta/button.props.json +3 -3
- package/es/lowcode/engine/meta/components-list.json +6 -0
- package/es/lowcode/engine/meta/dialog.props.default.json +10 -5
- package/es/lowcode/engine/meta/dialog.props.json +72 -42
- package/es/lowcode/engine/meta/drawer.props.json +8 -20
- package/es/lowcode/engine/meta/form.props.json +16 -10
- 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 +53 -3
- package/es/lowcode/engine/meta/layout.props.json +2 -2
- package/es/lowcode/engine/meta/page.props.json +2 -2
- 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.json +17 -11
- package/es/lowcode/engine/meta/tabs.props.json +3 -3
- package/es/lowcode/engine/meta/tree.props.default.json +2 -0
- package/es/lowcode/engine/meta/tree.props.json +62 -6
- package/es/lowcode/engine/provider/ContextProvider/index.js +20 -43
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +69 -24
- package/es/lowcode/engine/tools/dataProcess.js +4 -0
- package/es/lowcode/engine/tools/helper.js +2 -3
- package/es/lowcode/engine/tools/useCanvasRender.js +3 -2
- package/es/lowcode/engine/tools/usePageDataStore.js +176 -0
- package/es/lowcode/engine/tools/usePromiseState.js +12 -23
- package/es/lowcode/engine/tools/useTodo.js +20 -10
- package/es/lowcode/painter/DesignOperator.js +12 -23
- package/es/lowcode/painter/DesignToolbar.js +10 -45
- package/es/lowcode/painter/Outline.js +2 -4
- package/es/lowcode/painter/Panel.js +29 -28
- package/es/lowcode/painter/components/ActionBindModal.js +30 -24
- package/es/lowcode/painter/components/AdvancePanel.js +6 -1
- package/es/lowcode/painter/components/AttrsPanel.js +38 -29
- package/es/lowcode/painter/components/DragDrop/DragDropContext.js +1 -1
- package/es/lowcode/painter/components/code-editor/BaseEditor.js +3 -2
- 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 +162 -30
- package/es/lowcode/painter/components/field-setting/index.js +32 -63
- package/es/lowcode/painter/components/field-setting/meta/frontRules.js +53 -0
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +14 -17
- package/es/lowcode/painter/panel-section/ButtonType.js +4 -2
- package/es/lowcode/painter/panel-section/DataSetSelector.js +4 -1
- package/es/lowcode/painter/panel-section/FieldsSetting.js +53 -8
- package/es/lowcode/painter/panel-section/ImpExp.js +93 -6
- package/es/lowcode/painter/panel-section/ImpExpAlone.js +109 -0
- package/es/lowcode/painter/panel-section/PageLayoutDisplay.js +95 -0
- package/es/lowcode/painter/panel-section/SerialsSelector.js +4 -2
- package/es/lowcode/painter/panel-section/SplitDisplay.js +25 -110
- package/es/lowcode/painter/panel-section/StylePanel/index.js +10 -4
- package/es/lowcode/painter/panel-section/TreeRootEditor.js +2 -2
- package/es/lowcode/painter/style/action-bind-modal.less +3 -3
- package/es/lowcode/painter/style/design.less +1 -1
- package/es/lowcode/painter/style/page-layout-display.less +28 -0
- package/es/lowcode/painter/style/panel-item.less +1 -1
- package/es/lowcode/painter/style/split-display.less +0 -9
- package/es/lowcode/preview/index.js +4 -2
- package/es/lowcode/view/Canvas.js +6 -7
- package/es/lowcode/view/Page.js +2 -3
- package/es/lowcode/view/lc-components/Box/FunctionDesign.js +3 -2
- package/es/lowcode/view/lc-components/Box/meta.json +3 -3
- package/es/lowcode/view/lc-components/Button/index.js +2 -6
- package/es/lowcode/view/lc-components/Button/meta.json +3 -3
- package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +3 -10
- package/es/lowcode/view/lc-components/Dialog/index.js +114 -19
- package/es/lowcode/view/lc-components/Dialog/meta.json +65 -42
- package/es/lowcode/view/lc-components/Drawer/meta.json +8 -20
- package/es/lowcode/view/lc-components/Form/FunctionDesign.js +23 -33
- package/es/lowcode/view/lc-components/Form/FunctionPreview.js +8 -1
- package/es/lowcode/view/lc-components/Form/index.js +113 -21
- package/es/lowcode/view/lc-components/Form/meta.json +16 -10
- package/es/lowcode/view/lc-components/ImEx/FunctionDesign.js +8 -3
- package/es/lowcode/view/lc-components/ImEx/index.js +260 -10
- package/es/lowcode/view/lc-components/ImEx/index.less +7 -0
- package/es/lowcode/view/lc-components/ImEx/meta.json +55 -23
- package/es/lowcode/view/lc-components/Layout/FunctionDesign.js +12 -19
- package/es/lowcode/view/lc-components/Layout/meta.json +2 -2
- package/es/lowcode/view/lc-components/Page/meta.json +2 -2
- package/es/lowcode/view/lc-components/PageContent/index.js +8 -9
- package/es/lowcode/view/lc-components/PageFooter/index.js +2 -5
- package/es/lowcode/view/lc-components/PageHeader/index.js +5 -6
- package/es/lowcode/view/lc-components/PageLayout/FunctionDesign.js +63 -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 +32 -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/meta.json +2 -2
- package/es/lowcode/view/lc-components/Split/FunctionDesign.js +19 -20
- package/es/lowcode/view/lc-components/Split/index.js +5 -9
- package/es/lowcode/view/lc-components/Split/meta.json +4 -4
- package/es/lowcode/view/lc-components/Table/components/TopImex.js +138 -0
- package/es/lowcode/view/lc-components/Table/index.js +124 -39
- package/es/lowcode/view/lc-components/Table/meta.json +17 -11
- package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +10 -17
- package/es/lowcode/view/lc-components/Tabs/index.js +3 -1
- package/es/lowcode/view/lc-components/Tabs/meta.json +3 -3
- package/es/lowcode/view/lc-components/Tree/FunctionDesign.js +2 -1
- package/es/lowcode/view/lc-components/Tree/index.js +67 -18
- package/es/lowcode/view/lc-components/Tree/meta.json +62 -7
- package/es/lowcode/view/lc-components/Wrapper.js +9 -11
- 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/index.js +2 -1
- package/es/upload/FormItem/index.js +3 -5
- package/es/upload/index.js +2 -1
- package/es/utils/action.js +2 -2
- package/lib/components/LDActions/index.js +7 -9
- package/lib/components/LDActions/index.less +7 -4
- package/lib/components/LdAutoForm/index.js +25 -7
- package/lib/components/LdFormList/index.js +36 -21
- package/lib/components/LdGrid/index.js +14 -7
- package/lib/components/LdGridForm/index.js +16 -4
- package/lib/components/LdTree/index.js +33 -15
- package/lib/helper/form.js +14 -7
- package/lib/locales/zh-CN.js +16 -10
- package/lib/lowcode/constants/api-url.js +123 -32
- package/lib/lowcode/constants/event-topics.js +3 -1
- package/lib/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +4 -2
- package/lib/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +4 -2
- package/lib/lowcode/engine/meta/box.props.json +3 -3
- package/lib/lowcode/engine/meta/button.props.json +3 -3
- package/lib/lowcode/engine/meta/components-list.json +6 -0
- package/lib/lowcode/engine/meta/dialog.props.default.json +10 -5
- package/lib/lowcode/engine/meta/dialog.props.json +72 -42
- package/lib/lowcode/engine/meta/drawer.props.json +8 -20
- package/lib/lowcode/engine/meta/form.props.json +16 -10
- 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 +53 -3
- package/lib/lowcode/engine/meta/layout.props.json +2 -2
- package/lib/lowcode/engine/meta/page.props.json +2 -2
- 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.json +17 -11
- package/lib/lowcode/engine/meta/tabs.props.json +3 -3
- package/lib/lowcode/engine/meta/tree.props.default.json +2 -0
- package/lib/lowcode/engine/meta/tree.props.json +62 -6
- package/lib/lowcode/engine/provider/ContextProvider/index.js +36 -43
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +68 -23
- package/lib/lowcode/engine/tools/dataProcess.js +4 -0
- package/lib/lowcode/engine/tools/helper.js +2 -3
- package/lib/lowcode/engine/tools/useCanvasRender.js +3 -2
- package/lib/lowcode/engine/tools/usePageDataStore.js +183 -0
- package/lib/lowcode/engine/tools/usePromiseState.js +11 -21
- package/lib/lowcode/engine/tools/useTodo.js +19 -9
- package/lib/lowcode/painter/DesignOperator.js +11 -22
- package/lib/lowcode/painter/DesignToolbar.js +9 -44
- package/lib/lowcode/painter/Outline.js +1 -3
- package/lib/lowcode/painter/Panel.js +28 -27
- package/lib/lowcode/painter/components/ActionBindModal.js +28 -22
- package/lib/lowcode/painter/components/AdvancePanel.js +6 -1
- package/lib/lowcode/painter/components/AttrsPanel.js +37 -28
- package/lib/lowcode/painter/components/DragDrop/DragDropContext.js +1 -1
- package/lib/lowcode/painter/components/code-editor/BaseEditor.js +3 -2
- 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 +159 -27
- package/lib/lowcode/painter/components/field-setting/index.js +32 -63
- package/lib/lowcode/painter/components/field-setting/meta/frontRules.js +59 -0
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +13 -16
- package/lib/lowcode/painter/panel-section/ButtonType.js +4 -2
- package/lib/lowcode/painter/panel-section/DataSetSelector.js +4 -1
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +53 -8
- package/lib/lowcode/painter/panel-section/ImpExp.js +92 -5
- package/lib/lowcode/painter/panel-section/ImpExpAlone.js +115 -0
- package/lib/lowcode/painter/panel-section/PageLayoutDisplay.js +103 -0
- package/lib/lowcode/painter/panel-section/SerialsSelector.js +4 -2
- package/lib/lowcode/painter/panel-section/SplitDisplay.js +24 -109
- package/lib/lowcode/painter/panel-section/StylePanel/index.js +10 -4
- package/lib/lowcode/painter/panel-section/TreeRootEditor.js +2 -2
- package/lib/lowcode/painter/style/action-bind-modal.less +3 -3
- package/lib/lowcode/painter/style/design.less +1 -1
- package/lib/lowcode/painter/style/page-layout-display.less +28 -0
- package/lib/lowcode/painter/style/panel-item.less +1 -1
- package/lib/lowcode/painter/style/split-display.less +0 -9
- package/lib/lowcode/preview/index.js +4 -2
- package/lib/lowcode/view/Canvas.js +5 -6
- package/lib/lowcode/view/Page.js +2 -3
- package/lib/lowcode/view/lc-components/Box/FunctionDesign.js +3 -2
- package/lib/lowcode/view/lc-components/Box/meta.json +3 -3
- package/lib/lowcode/view/lc-components/Button/index.js +2 -6
- package/lib/lowcode/view/lc-components/Button/meta.json +3 -3
- package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +2 -9
- package/lib/lowcode/view/lc-components/Dialog/index.js +114 -19
- package/lib/lowcode/view/lc-components/Dialog/meta.json +65 -42
- package/lib/lowcode/view/lc-components/Drawer/meta.json +8 -20
- package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +20 -31
- package/lib/lowcode/view/lc-components/Form/FunctionPreview.js +8 -1
- package/lib/lowcode/view/lc-components/Form/index.js +110 -18
- package/lib/lowcode/view/lc-components/Form/meta.json +16 -10
- package/lib/lowcode/view/lc-components/ImEx/FunctionDesign.js +8 -3
- package/lib/lowcode/view/lc-components/ImEx/index.js +257 -8
- package/lib/lowcode/view/lc-components/ImEx/index.less +7 -0
- package/lib/lowcode/view/lc-components/ImEx/meta.json +55 -23
- package/lib/lowcode/view/lc-components/Layout/FunctionDesign.js +11 -18
- package/lib/lowcode/view/lc-components/Layout/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Page/meta.json +2 -2
- package/lib/lowcode/view/lc-components/PageContent/index.js +7 -8
- package/lib/lowcode/view/lc-components/PageFooter/index.js +2 -5
- package/lib/lowcode/view/lc-components/PageHeader/index.js +4 -5
- package/lib/lowcode/view/lc-components/PageLayout/FunctionDesign.js +71 -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 +40 -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/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +19 -20
- package/lib/lowcode/view/lc-components/Split/index.js +2 -6
- package/lib/lowcode/view/lc-components/Split/meta.json +4 -4
- package/lib/lowcode/view/lc-components/Table/components/TopImex.js +145 -0
- package/lib/lowcode/view/lc-components/Table/index.js +123 -38
- package/lib/lowcode/view/lc-components/Table/meta.json +17 -11
- package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +11 -18
- package/lib/lowcode/view/lc-components/Tabs/index.js +3 -1
- package/lib/lowcode/view/lc-components/Tabs/meta.json +3 -3
- package/lib/lowcode/view/lc-components/Tree/FunctionDesign.js +2 -1
- package/lib/lowcode/view/lc-components/Tree/index.js +65 -16
- package/lib/lowcode/view/lc-components/Tree/meta.json +62 -7
- package/lib/lowcode/view/lc-components/Wrapper.js +8 -10
- 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/index.js +2 -1
- package/lib/upload/FormItem/index.js +3 -5
- package/lib/upload/index.js +8 -1
- package/lib/utils/action.js +2 -2
- package/package.json +5 -4
|
@@ -1,29 +1,35 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { useGet } from "../../../engine/provider/ContextProvider";
|
|
2
3
|
import { StyleProvider } from "./StyleContext";
|
|
3
4
|
import MainPanel from "./MainPanel";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* StylePanel 组件是一个 React 组件,用于提供样式设置主面板。
|
|
7
8
|
* 该组件通过 StyleProvider 将样式变更和当前样式值传递给其子组件。
|
|
8
|
-
*
|
|
9
|
+
*
|
|
9
10
|
* @component
|
|
10
11
|
* @example
|
|
11
12
|
* const handleChange = (newValue) => console.log(newValue);
|
|
12
13
|
* const initialValue = "dark";
|
|
13
14
|
* <StylePanel onChange={handleChange} value={initialValue} />
|
|
14
|
-
*
|
|
15
|
+
*
|
|
15
16
|
* @param {Object} props - 组件的属性。
|
|
16
17
|
* @param {Function} props.onChange - 当样式变更时调用的函数,该函数接受新的样式值作为参数。
|
|
17
18
|
* @param {any} props.value - 样式字符串
|
|
18
|
-
*
|
|
19
|
+
*
|
|
19
20
|
* @returns {ReactElement} 返回一个 React 元素,其中包含了 StyleProvider 和 MainPanel 组件。
|
|
20
21
|
*/
|
|
21
22
|
var StylePanel = function StylePanel(_ref) {
|
|
22
23
|
var onChange = _ref.onChange,
|
|
24
|
+
nodeId = _ref.nodeId,
|
|
23
25
|
value = _ref.value;
|
|
26
|
+
var _value = useGet({
|
|
27
|
+
id: nodeId,
|
|
28
|
+
path: 'props.css'
|
|
29
|
+
});
|
|
24
30
|
return /*#__PURE__*/React.createElement(StyleProvider, {
|
|
25
31
|
onChange: onChange,
|
|
26
|
-
value: value
|
|
32
|
+
value: value || _value
|
|
27
33
|
}, /*#__PURE__*/React.createElement(MainPanel, null));
|
|
28
34
|
};
|
|
29
35
|
export default StylePanel;
|
|
@@ -55,8 +55,8 @@ var TreeRootEditor = function TreeRootEditor(_ref) {
|
|
|
55
55
|
}
|
|
56
56
|
}))), /*#__PURE__*/React.createElement(Tooltip, {
|
|
57
57
|
title: formatMessage({
|
|
58
|
-
id: 'luckda.lowcode.painter.
|
|
59
|
-
label: '
|
|
58
|
+
id: 'luckda.lowcode.painter.bind',
|
|
59
|
+
label: '绑定动作'
|
|
60
60
|
})
|
|
61
61
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
62
62
|
type: "paper-clip",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.lc-painter-panel-action-bind-modal {
|
|
2
2
|
&-body {
|
|
3
3
|
width: 100%;
|
|
4
|
-
height:
|
|
4
|
+
height: 660px;
|
|
5
5
|
display: flex;
|
|
6
6
|
font-size: 12px;
|
|
7
7
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
.selector-box {
|
|
12
12
|
width: 100%;
|
|
13
|
-
height:
|
|
13
|
+
height: 620px;
|
|
14
14
|
border: 1px solid #e8e8e8;
|
|
15
15
|
border-radius: 6px;
|
|
16
16
|
display: flex;
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
|
|
69
69
|
.code-box {
|
|
70
70
|
width: 100%;
|
|
71
|
-
height:
|
|
71
|
+
height: 620px;
|
|
72
72
|
border: 1px solid #e8e8e8;
|
|
73
73
|
border-radius: 6px;
|
|
74
74
|
overflow: hidden;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.lc-painter-panel-section-pagelayoutdisplay {
|
|
2
|
+
.display-type-box {
|
|
3
|
+
display: grid;
|
|
4
|
+
grid-template-columns: repeat(3, 1fr);
|
|
5
|
+
grid-column-gap: 4px;
|
|
6
|
+
|
|
7
|
+
.display-type-item {
|
|
8
|
+
border: 1px solid rgba(0, 0, 0, 0.2);
|
|
9
|
+
border-radius: 4px;
|
|
10
|
+
padding: 3px;
|
|
11
|
+
height: 42px;
|
|
12
|
+
display: flex;
|
|
13
|
+
|
|
14
|
+
&:hover {
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
border-color: var(--ant-primary-color);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.active {
|
|
20
|
+
border-color: var(--ant-primary-color);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.item-block {
|
|
24
|
+
background-color: rgb(192, 194, 196);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -11,15 +11,6 @@
|
|
|
11
11
|
height: 42px;
|
|
12
12
|
display: flex;
|
|
13
13
|
|
|
14
|
-
&:hover {
|
|
15
|
-
cursor: pointer;
|
|
16
|
-
border-color: var(--ant-primary-color);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
&.active {
|
|
20
|
-
border-color: var(--ant-primary-color);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
14
|
.item-block {
|
|
24
15
|
background-color: rgb(192, 194, 196);
|
|
25
16
|
}
|
|
@@ -7,7 +7,8 @@ import Page from "../view/Page";
|
|
|
7
7
|
import { RUNTIME } from "../constants/index";
|
|
8
8
|
var Preview = function Preview(_ref) {
|
|
9
9
|
var code = _ref.code,
|
|
10
|
-
userId = _ref.userId
|
|
10
|
+
userId = _ref.userId,
|
|
11
|
+
debug = _ref.debug;
|
|
11
12
|
var _useState = useState(userId),
|
|
12
13
|
_useState2 = _slicedToArray(_useState, 2),
|
|
13
14
|
currentKey = _useState2[0],
|
|
@@ -21,7 +22,8 @@ var Preview = function Preview(_ref) {
|
|
|
21
22
|
return code && currentKey ? /*#__PURE__*/React.createElement(EventBusProvider, {
|
|
22
23
|
runtime: RUNTIME.PREVIEW
|
|
23
24
|
}, /*#__PURE__*/React.createElement(ContextProvider, {
|
|
24
|
-
code: code
|
|
25
|
+
code: code,
|
|
26
|
+
debug: debug
|
|
25
27
|
}, /*#__PURE__*/React.createElement(Page, null))) : null;
|
|
26
28
|
};
|
|
27
29
|
export default Preview;
|
|
@@ -3,7 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
|
-
import {
|
|
6
|
+
import { useGet } from "../engine/provider/ContextProvider";
|
|
7
7
|
import PageHeader from "./lc-components/PageHeader";
|
|
8
8
|
import PageContent from "./lc-components/PageContent";
|
|
9
9
|
import PageFooter from "./lc-components/PageFooter";
|
|
@@ -18,12 +18,11 @@ var PageRoot = styled.div.withConfig({
|
|
|
18
18
|
});
|
|
19
19
|
var Canvas = function Canvas(_ref) {
|
|
20
20
|
var className = _ref.className;
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
enableFooter = _usePageData2$[2];
|
|
21
|
+
var _useGet = useGet(['props.css', 'props.enableHeader', 'props.enableFooter']),
|
|
22
|
+
_useGet2 = _slicedToArray(_useGet, 3),
|
|
23
|
+
pagerootCss = _useGet2[0],
|
|
24
|
+
enableHeader = _useGet2[1],
|
|
25
|
+
enableFooter = _useGet2[2];
|
|
27
26
|
return /*#__PURE__*/React.createElement(PageRoot, {
|
|
28
27
|
id: "page-canvas",
|
|
29
28
|
className: classNames(styles['lc-view-canvas'], _defineProperty({}, className, !!className)),
|
package/es/lowcode/view/Page.js
CHANGED
|
@@ -23,8 +23,7 @@ var LCPage = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
23
23
|
var _ref = useRef(null);
|
|
24
24
|
var _rootRef = ref || _ref;
|
|
25
25
|
var _useRemoteSource = useRemoteSource(),
|
|
26
|
-
loading = _useRemoteSource.loading
|
|
27
|
-
pageData = _useRemoteSource.pageData;
|
|
26
|
+
loading = _useRemoteSource.loading;
|
|
28
27
|
var getTargetDom = useMemoizedFn(function () {
|
|
29
28
|
return _rootRef.current;
|
|
30
29
|
});
|
|
@@ -34,6 +33,6 @@ var LCPage = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
34
33
|
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
35
34
|
ref: _rootRef,
|
|
36
35
|
className: classNames(styles['lc-view-page'], _defineProperty(_defineProperty({}, styles.isloading, loading), className, !!className))
|
|
37
|
-
}, props),
|
|
36
|
+
}, props), /*#__PURE__*/React.createElement(Canvas, null), loading ? /*#__PURE__*/React.createElement(Masker, null, /*#__PURE__*/React.createElement(Loading, null)) : null));
|
|
38
37
|
});
|
|
39
38
|
export default LCPage;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["children"];
|
|
4
|
+
var _excluded = ["children", "className"];
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { useCreation } from 'ahooks';
|
|
7
7
|
import classNames from 'classnames';
|
|
@@ -9,12 +9,13 @@ import Index from "./index";
|
|
|
9
9
|
import styles from "./index.less";
|
|
10
10
|
var FunctionDesign = function FunctionDesign(_ref) {
|
|
11
11
|
var children = _ref.children,
|
|
12
|
+
className = _ref.className,
|
|
12
13
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
13
14
|
var isEmpty = useCreation(function () {
|
|
14
15
|
return !children || React.Children.count(children) === 0;
|
|
15
16
|
}, [children]);
|
|
16
17
|
return /*#__PURE__*/React.createElement(Index, _extends({
|
|
17
|
-
className: classNames(styles['lc-component-box-design'], _defineProperty({}, styles.placeholder, isEmpty))
|
|
18
|
+
className: classNames(styles['lc-component-box-design'], _defineProperty(_defineProperty({}, styles.placeholder, isEmpty), "className", !!className))
|
|
18
19
|
}, props), isEmpty ? '点击组件库的组件或拖拽组件到这里' : children);
|
|
19
20
|
};
|
|
20
21
|
export default FunctionDesign;
|
|
@@ -21,19 +21,19 @@
|
|
|
21
21
|
"key": "onMount",
|
|
22
22
|
"name": "组件首次渲染时",
|
|
23
23
|
"desc": "在组件首次渲染时,执行方法",
|
|
24
|
-
"func": "(params)
|
|
24
|
+
"func": "function onMount(params) {\n\t\n}"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"key": "onUnmount",
|
|
28
28
|
"name": "组件卸载时",
|
|
29
29
|
"desc": "在组件卸载时,执行方法。",
|
|
30
|
-
"func": "(params)
|
|
30
|
+
"func": "function onUnmount(params) {\n\t\n}"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"key": "onClick",
|
|
34
34
|
"name": "点击事件",
|
|
35
35
|
"desc": "点击文本时,执行方法",
|
|
36
|
-
"func": "(e)
|
|
36
|
+
"func": "function onClick(e) {\n\t\n}"
|
|
37
37
|
}
|
|
38
38
|
]
|
|
39
39
|
}
|
|
@@ -33,14 +33,10 @@ var LCButton = function LCButton(_ref) {
|
|
|
33
33
|
var ref = useRef();
|
|
34
34
|
var ctx = useContext();
|
|
35
35
|
useMount(function () {
|
|
36
|
-
ctx.doAction(advance.events.onMount
|
|
37
|
-
instance: ref.current
|
|
38
|
-
});
|
|
36
|
+
ctx.doAction(advance.events.onMount);
|
|
39
37
|
});
|
|
40
38
|
useUnmount(function () {
|
|
41
|
-
ctx.doAction(advance.events.onUnmount
|
|
42
|
-
instance: ref.current
|
|
43
|
-
});
|
|
39
|
+
ctx.doAction(advance.events.onUnmount);
|
|
44
40
|
});
|
|
45
41
|
var handleClick = useMemoizedFn(function (e) {
|
|
46
42
|
if (onClick) {
|
|
@@ -108,19 +108,19 @@
|
|
|
108
108
|
"key": "onMount",
|
|
109
109
|
"name": "组件首次渲染时",
|
|
110
110
|
"desc": "在组件首次渲染时,执行方法",
|
|
111
|
-
"func": "(
|
|
111
|
+
"func": "function onMount() {\n\t\n}"
|
|
112
112
|
},
|
|
113
113
|
{
|
|
114
114
|
"key": "onUnmount",
|
|
115
115
|
"name": "组件卸载时",
|
|
116
116
|
"desc": "在组件卸载时,执行方法。",
|
|
117
|
-
"func": "(
|
|
117
|
+
"func": "function onUnmount() {\n\t\n}"
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
120
|
"key": "onClick",
|
|
121
121
|
"name": "点击事件",
|
|
122
122
|
"desc": "点击文本时,执行方法",
|
|
123
|
-
"func": "(e)
|
|
123
|
+
"func": "function onClick(e) {\n\t\n}"
|
|
124
124
|
}
|
|
125
125
|
]
|
|
126
126
|
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
6
5
|
var _excluded = ["id", "children", "className"];
|
|
7
6
|
import React from 'react';
|
|
8
7
|
import { useCreation } from 'ahooks';
|
|
9
8
|
import Index from "./index";
|
|
10
9
|
import { suid } from '@luck-design-biz/base/utils';
|
|
11
|
-
import { useContext,
|
|
12
|
-
import { add } from "../../../engine/tools/dataProcess";
|
|
10
|
+
import { useContext, addNode } from "../../../engine/provider/ContextProvider";
|
|
13
11
|
import classNames from 'classnames';
|
|
14
12
|
import styles from "./index.less";
|
|
15
13
|
import boxDefaultMeta from "../../../engine/meta/box.props.default.json";
|
|
@@ -19,19 +17,14 @@ var FunctionDesign = function FunctionDesign(_ref) {
|
|
|
19
17
|
className = _ref.className,
|
|
20
18
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
19
|
var ctx = useContext();
|
|
22
|
-
var _usePageData = usePageData(),
|
|
23
|
-
_usePageData2 = _slicedToArray(_usePageData, 2),
|
|
24
|
-
setPageData = _usePageData2[1].setPageData;
|
|
25
20
|
useCreation(function () {
|
|
26
21
|
if (children !== null && children !== void 0 && children.length) return;
|
|
27
22
|
ctx.$subscriber(ctx.topics.COMPONENT_APPEND).once(function (_ref2) {
|
|
28
|
-
var compId = _ref2.id
|
|
29
|
-
pageData = _ref2.pageData;
|
|
23
|
+
var compId = _ref2.id;
|
|
30
24
|
if (compId !== id) return;
|
|
31
|
-
|
|
25
|
+
addNode(id, "box_".concat(suid()), _objectSpread(_objectSpread({}, boxDefaultMeta), {}, {
|
|
32
26
|
buildIn: true
|
|
33
27
|
}));
|
|
34
|
-
setPageData(pageData);
|
|
35
28
|
}).watch();
|
|
36
29
|
}, []);
|
|
37
30
|
return /*#__PURE__*/React.createElement(Index, _extends({
|
|
@@ -1,52 +1,147 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
import { useMemoizedFn, useBoolean } from 'ahooks';
|
|
7
|
-
import { Modal } from 'luck-design/antd';
|
|
4
|
+
import React, { useRef, useEffect, useImperativeHandle } from 'react';
|
|
5
|
+
import { useMemoizedFn, useUpdateEffect, useCreation } from 'ahooks';
|
|
6
|
+
import { Modal, Button } from 'luck-design/antd';
|
|
8
7
|
import classNames from 'classnames';
|
|
8
|
+
import styled from 'styled-components';
|
|
9
|
+
import { LDActions } from "../../../../index";
|
|
10
|
+
import { useContext } from "../../../engine/provider/ContextProvider";
|
|
11
|
+
import usePromiseState from "../../../engine/tools/usePromiseState";
|
|
9
12
|
import Wrapper from "../Wrapper";
|
|
10
13
|
import styles from "./index.less";
|
|
14
|
+
var Footer = styled.div.withConfig({
|
|
15
|
+
displayName: "Footer",
|
|
16
|
+
componentId: "luckda-6530__sc-1aeozvd-0"
|
|
17
|
+
})(["width:100%;display:flex;justify-content:flex-end;"]);
|
|
11
18
|
var LCDialog = function LCDialog(_ref) {
|
|
12
19
|
var id = _ref.id,
|
|
13
20
|
children = _ref.children,
|
|
21
|
+
title = _ref.title,
|
|
22
|
+
width = _ref.width,
|
|
23
|
+
height = _ref.height,
|
|
14
24
|
getContainer = _ref.getContainer,
|
|
15
25
|
wrapClassName = _ref.wrapClassName,
|
|
16
26
|
maskStyle = _ref.maskStyle,
|
|
17
|
-
|
|
27
|
+
defaultOpen = _ref.defaultOpen,
|
|
28
|
+
mask = _ref.mask,
|
|
29
|
+
okText = _ref.okText,
|
|
30
|
+
cancelText = _ref.cancelText,
|
|
31
|
+
footer = _ref.footer,
|
|
32
|
+
btnGroup = _ref.btnGroup,
|
|
33
|
+
advance = _ref.advance;
|
|
34
|
+
var ctx = useContext();
|
|
18
35
|
var apiRef = useRef();
|
|
19
36
|
var domRef = useRef();
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
open =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
37
|
+
var _usePromiseState = usePromiseState(defaultOpen),
|
|
38
|
+
_usePromiseState2 = _slicedToArray(_usePromiseState, 2),
|
|
39
|
+
open = _usePromiseState2[0],
|
|
40
|
+
setOpen = _usePromiseState2[1];
|
|
41
|
+
var _usePromiseState3 = usePromiseState(title),
|
|
42
|
+
_usePromiseState4 = _slicedToArray(_usePromiseState3, 2),
|
|
43
|
+
_title = _usePromiseState4[0],
|
|
44
|
+
_setTitle = _usePromiseState4[1];
|
|
45
|
+
useEffect(function () {
|
|
46
|
+
ctx.doAction(advance.events.onMount);
|
|
47
|
+
return function () {
|
|
48
|
+
_setTitle(title);
|
|
49
|
+
ctx.doAction(advance.events.onUnmount);
|
|
50
|
+
};
|
|
51
|
+
}, []);
|
|
52
|
+
useUpdateEffect(function () {
|
|
53
|
+
if (open) {
|
|
54
|
+
ctx.doAction(advance.events.onOpen);
|
|
55
|
+
} else {
|
|
56
|
+
ctx.doAction(advance.events.onClose);
|
|
57
|
+
}
|
|
58
|
+
}, [open]);
|
|
59
|
+
var handleOk = useMemoizedFn(function () {
|
|
60
|
+
ctx.doAction(advance.events.onOk);
|
|
61
|
+
});
|
|
62
|
+
var _footer = useCreation(function () {
|
|
63
|
+
var _btnGroup$todoList;
|
|
64
|
+
if (!footer) return {
|
|
65
|
+
footer: null
|
|
66
|
+
};
|
|
67
|
+
if (!(btnGroup !== null && btnGroup !== void 0 && (_btnGroup$todoList = btnGroup.todoList) !== null && _btnGroup$todoList !== void 0 && _btnGroup$todoList.length)) return {};
|
|
68
|
+
return {
|
|
69
|
+
footer: /*#__PURE__*/React.createElement(Footer, null, /*#__PURE__*/React.createElement(LDActions, _extends({}, btnGroup, {
|
|
70
|
+
doAction: function doAction(action) {
|
|
71
|
+
return ctx.doAction(action);
|
|
72
|
+
}
|
|
73
|
+
})), /*#__PURE__*/React.createElement(Button, {
|
|
74
|
+
onClick: function onClick() {
|
|
75
|
+
return setOpen(false);
|
|
76
|
+
},
|
|
77
|
+
style: {
|
|
78
|
+
marginLeft: 8
|
|
79
|
+
}
|
|
80
|
+
}, cancelText), /*#__PURE__*/React.createElement(Button, {
|
|
81
|
+
type: "primary",
|
|
82
|
+
onClick: handleOk
|
|
83
|
+
}, okText))
|
|
84
|
+
};
|
|
85
|
+
}, [footer, btnGroup]);
|
|
27
86
|
var getTargetDom = useMemoizedFn(function () {
|
|
28
87
|
var _domRef$current;
|
|
29
88
|
return (_domRef$current = domRef.current) === null || _domRef$current === void 0 ? void 0 : _domRef$current.closest('.ant-modal-content');
|
|
30
89
|
});
|
|
31
90
|
useImperativeHandle(apiRef, function () {
|
|
32
91
|
return {
|
|
92
|
+
/**
|
|
93
|
+
* 弹窗打开状态
|
|
94
|
+
* @property
|
|
95
|
+
*/
|
|
33
96
|
open: open,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
97
|
+
/**
|
|
98
|
+
* 打开弹窗
|
|
99
|
+
* @method
|
|
100
|
+
*/
|
|
101
|
+
doOpen: function doOpen() {
|
|
102
|
+
return setOpen(true);
|
|
103
|
+
},
|
|
104
|
+
/**
|
|
105
|
+
* 关闭弹窗
|
|
106
|
+
* @method
|
|
107
|
+
*/
|
|
108
|
+
doClose: function doClose() {
|
|
109
|
+
return setOpen(false);
|
|
110
|
+
},
|
|
111
|
+
/**
|
|
112
|
+
* 设置弹窗标题
|
|
113
|
+
* @method
|
|
114
|
+
* @param {stirng} title -标题
|
|
115
|
+
*/
|
|
116
|
+
setTitle: function setTitle(_title) {
|
|
117
|
+
return _setTitle(_title);
|
|
118
|
+
}
|
|
37
119
|
};
|
|
38
|
-
});
|
|
120
|
+
}, []);
|
|
39
121
|
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
40
122
|
id: id,
|
|
41
123
|
displayName: "Dialog",
|
|
42
124
|
getTargetDom: getTargetDom,
|
|
43
125
|
api: apiRef
|
|
44
|
-
}, /*#__PURE__*/React.createElement(Modal, {
|
|
126
|
+
}, /*#__PURE__*/React.createElement(Modal, _extends({
|
|
127
|
+
title: _title,
|
|
45
128
|
visible: open,
|
|
46
129
|
getContainer: getContainer,
|
|
130
|
+
width: width,
|
|
131
|
+
mask: mask,
|
|
47
132
|
maskStyle: maskStyle,
|
|
133
|
+
bodyStyle: {
|
|
134
|
+
height: height,
|
|
135
|
+
overflowY: 'auto',
|
|
136
|
+
marginTop: 0
|
|
137
|
+
},
|
|
48
138
|
wrapClassName: classNames(styles['lc-component-dialog-wrapper'], _defineProperty({}, wrapClassName, !!wrapClassName))
|
|
49
|
-
},
|
|
139
|
+
}, _footer, {
|
|
140
|
+
onOk: handleOk,
|
|
141
|
+
onCancel: function onCancel() {
|
|
142
|
+
return setOpen(false);
|
|
143
|
+
}
|
|
144
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
50
145
|
style: {
|
|
51
146
|
height: 0,
|
|
52
147
|
width: 0,
|