@luck-design-biz/luckda 0.0.25-1 → 0.0.25-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/locales/zh-CN.js +9 -0
- package/es/lowcode/constants/api-url.js +184 -100
- package/es/lowcode/constants/index.js +2 -1
- package/es/lowcode/engine/meta/box.props.default.json +1 -1
- package/es/lowcode/engine/meta/box.props.json +1 -1
- package/es/lowcode/engine/meta/button.props.json +1 -1
- package/es/lowcode/engine/meta/cardlist.props.json +1 -1
- package/es/lowcode/engine/meta/components-list.json +1 -1
- package/es/lowcode/engine/meta/dialog.props.json +1 -1
- package/es/lowcode/engine/meta/drawer.props.json +1 -1
- package/es/lowcode/engine/meta/form.props.default.json +4 -5
- package/es/lowcode/engine/meta/form.props.json +33 -30
- package/es/lowcode/engine/meta/image.props.json +2 -2
- package/es/lowcode/engine/meta/imex.props.json +1 -1
- package/es/lowcode/engine/meta/link.props.json +1 -1
- package/es/lowcode/engine/meta/section.props.default.json +4 -6
- package/es/lowcode/engine/meta/section.props.json +52 -49
- package/es/lowcode/engine/meta/text.props.json +2 -2
- package/es/lowcode/engine/meta/tree.props.json +2 -2
- package/es/lowcode/engine/provider/ContextProvider/index.js +10 -2
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +28 -15
- package/es/lowcode/engine/tools/helper.js +23 -21
- package/es/lowcode/engine/tools/useCanvasRender.js +5 -7
- package/es/lowcode/engine/tools/usePromiseState.js +23 -14
- package/es/lowcode/painter/Design.js +34 -2
- package/es/lowcode/painter/DesignOperator.js +6 -8
- package/es/lowcode/painter/DesignToolbar.js +258 -21
- package/es/lowcode/painter/Panel.js +8 -9
- package/es/lowcode/painter/components/AttrsPanel.js +6 -6
- package/es/lowcode/painter/components/DragDrop/DragDropWrapper.js +5 -2
- package/es/lowcode/painter/components/ListEditor.js +8 -2
- package/es/lowcode/painter/components/field-setting/BatchSetting.js +13 -3
- package/es/lowcode/painter/components/field-setting/SettingUI.js +26 -7
- package/es/lowcode/painter/components/field-setting/index.js +18 -8
- package/es/lowcode/painter/index.js +1 -28
- package/es/lowcode/painter/panel-section/ActionsColumnWidth.js +25 -0
- package/es/lowcode/painter/panel-section/BlockEditor/index.js +7 -4
- package/es/lowcode/painter/panel-section/BlocksEditor/BlockEditorItem.js +4 -3
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +48 -15
- package/es/lowcode/painter/panel-section/FieldsSetting.js +48 -27
- package/es/lowcode/painter/panel-section/I18nInput.js +20 -0
- package/es/lowcode/painter/style/design.less +6 -2
- package/es/lowcode/painter/style/list-editor.less +36 -0
- package/es/lowcode/preview/index.js +17 -4
- 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/meta.json +1 -1
- package/es/lowcode/view/lc-components/Button/meta.json +1 -1
- 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 +1 -1
- package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +2 -4
- 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/meta.json +1 -1
- 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/meta.json +1 -1
- package/es/lowcode/view/lc-components/Form/FunctionDesign.js +66 -4
- package/es/lowcode/view/lc-components/Form/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Form/FunctionPreview.js +1 -0
- package/es/lowcode/view/lc-components/Form/index.js +232 -61
- package/es/lowcode/view/lc-components/Form/meta.json +33 -30
- 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/ImEx/FunctionDesign.js +1 -0
- 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/meta.json +1 -1
- 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 +2 -2
- 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/lowcode/view/lc-components/Layout/FunctionDesign.js +6 -7
- package/es/lowcode/view/lc-components/Layout/FunctionPreview.js +1 -0
- 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/meta.json +1 -1
- package/es/lowcode/view/lc-components/Section/FunctionDesign.js +31 -2
- 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 +114 -24
- package/es/lowcode/view/lc-components/Section/index.less +7 -0
- package/es/lowcode/view/lc-components/Section/meta.json +48 -49
- package/es/lowcode/view/lc-components/Split/FunctionDesign.js +4 -6
- 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 +4 -4
- 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/index.js +7 -6
- package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +2 -4
- 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/meta.json +2 -2
- package/es/lowcode/view/lc-components/Tree/FunctionLive.js +1 -0
- package/es/lowcode/view/lc-components/Tree/meta.json +2 -2
- package/es/upload/Form/gridForm.js +7 -3
- package/lib/locales/zh-CN.js +9 -0
- package/lib/lowcode/constants/api-url.js +183 -100
- package/lib/lowcode/constants/index.js +3 -2
- package/lib/lowcode/engine/meta/box.props.default.json +1 -1
- package/lib/lowcode/engine/meta/box.props.json +1 -1
- package/lib/lowcode/engine/meta/button.props.json +1 -1
- package/lib/lowcode/engine/meta/cardlist.props.json +1 -1
- package/lib/lowcode/engine/meta/components-list.json +1 -1
- package/lib/lowcode/engine/meta/dialog.props.json +1 -1
- package/lib/lowcode/engine/meta/drawer.props.json +1 -1
- package/lib/lowcode/engine/meta/form.props.default.json +4 -5
- package/lib/lowcode/engine/meta/form.props.json +33 -30
- package/lib/lowcode/engine/meta/image.props.json +2 -2
- package/lib/lowcode/engine/meta/imex.props.json +1 -1
- package/lib/lowcode/engine/meta/link.props.json +1 -1
- package/lib/lowcode/engine/meta/section.props.default.json +4 -6
- package/lib/lowcode/engine/meta/section.props.json +52 -49
- package/lib/lowcode/engine/meta/text.props.json +2 -2
- package/lib/lowcode/engine/meta/tree.props.json +2 -2
- package/lib/lowcode/engine/provider/ContextProvider/index.js +10 -2
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +24 -11
- package/lib/lowcode/engine/tools/helper.js +23 -21
- package/lib/lowcode/engine/tools/useCanvasRender.js +3 -5
- package/lib/lowcode/engine/tools/usePromiseState.js +22 -14
- package/lib/lowcode/painter/Design.js +32 -0
- package/lib/lowcode/painter/DesignOperator.js +5 -7
- package/lib/lowcode/painter/DesignToolbar.js +256 -19
- package/lib/lowcode/painter/Panel.js +7 -8
- package/lib/lowcode/painter/components/AttrsPanel.js +6 -6
- package/lib/lowcode/painter/components/DragDrop/DragDropWrapper.js +5 -2
- package/lib/lowcode/painter/components/ListEditor.js +8 -2
- package/lib/lowcode/painter/components/field-setting/BatchSetting.js +13 -3
- package/lib/lowcode/painter/components/field-setting/SettingUI.js +26 -7
- package/lib/lowcode/painter/components/field-setting/index.js +18 -8
- package/lib/lowcode/painter/index.js +1 -30
- package/lib/lowcode/painter/panel-section/ActionsColumnWidth.js +32 -0
- package/lib/lowcode/painter/panel-section/BlockEditor/index.js +7 -4
- package/lib/lowcode/painter/panel-section/BlocksEditor/BlockEditorItem.js +4 -3
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +47 -13
- package/lib/lowcode/painter/panel-section/FieldsSetting.js +46 -25
- package/lib/lowcode/painter/panel-section/I18nInput.js +27 -0
- package/lib/lowcode/painter/style/design.less +6 -2
- package/lib/lowcode/painter/style/list-editor.less +36 -0
- package/lib/lowcode/preview/index.js +18 -4
- 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/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Button/meta.json +1 -1
- 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 +1 -1
- package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +2 -4
- 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/meta.json +1 -1
- 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/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +64 -2
- package/lib/lowcode/view/lc-components/Form/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Form/FunctionPreview.js +2 -1
- package/lib/lowcode/view/lc-components/Form/index.js +230 -59
- package/lib/lowcode/view/lc-components/Form/meta.json +33 -30
- 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/ImEx/FunctionDesign.js +2 -1
- 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/meta.json +1 -1
- 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 +2 -2
- 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/lowcode/view/lc-components/Layout/FunctionDesign.js +5 -6
- package/lib/lowcode/view/lc-components/Layout/FunctionPreview.js +2 -1
- 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/meta.json +1 -1
- package/lib/lowcode/view/lc-components/Section/FunctionDesign.js +31 -2
- 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 +113 -23
- package/lib/lowcode/view/lc-components/Section/index.less +7 -0
- package/lib/lowcode/view/lc-components/Section/meta.json +48 -49
- package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +5 -7
- 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 +4 -4
- 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/index.js +7 -6
- package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +4 -6
- 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/meta.json +2 -2
- package/lib/lowcode/view/lc-components/Tree/FunctionLive.js +2 -1
- package/lib/lowcode/view/lc-components/Tree/meta.json +2 -2
- package/lib/upload/Form/gridForm.js +7 -3
- package/package.json +1 -1
- package/es/lowcode/painter/services/toolbar.js +0 -25
- package/lib/lowcode/painter/services/toolbar.js +0 -32
|
@@ -0,0 +1,27 @@
|
|
|
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 = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _ahooks = require("ahooks");
|
|
10
|
+
var _antd = require("luck-design/antd");
|
|
11
|
+
var I18nInput = function I18nInput(_ref) {
|
|
12
|
+
var defaultValue = _ref.defaultValue,
|
|
13
|
+
onChange = _ref.onChange,
|
|
14
|
+
size = _ref.size;
|
|
15
|
+
var _useDebounceFn = (0, _ahooks.useDebounceFn)(onChange, {
|
|
16
|
+
wait: 400
|
|
17
|
+
}),
|
|
18
|
+
run = _useDebounceFn.run;
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Input, {
|
|
20
|
+
defaultValue: defaultValue,
|
|
21
|
+
onChange: function onChange(e) {
|
|
22
|
+
return run(e.target.value);
|
|
23
|
+
},
|
|
24
|
+
size: size
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
var _default = exports.default = I18nInput;
|
|
@@ -63,6 +63,11 @@
|
|
|
63
63
|
color: #8c8c8c;
|
|
64
64
|
background: #f1f2f3;
|
|
65
65
|
}
|
|
66
|
+
|
|
67
|
+
.toolbar-item.disabled {
|
|
68
|
+
color: #d9d9d9;
|
|
69
|
+
cursor: not-allowed;
|
|
70
|
+
}
|
|
66
71
|
}
|
|
67
72
|
|
|
68
73
|
&-workspace {
|
|
@@ -77,9 +82,8 @@
|
|
|
77
82
|
|
|
78
83
|
&-simulator {
|
|
79
84
|
min-height: 100%;
|
|
80
|
-
height: auto;
|
|
81
85
|
:global {
|
|
82
|
-
.ant-form-item, .resizer {
|
|
86
|
+
.ant-form-item, .ant-collapse-header, .resizer {
|
|
83
87
|
pointer-events: none;
|
|
84
88
|
}
|
|
85
89
|
.luck-grid-table {
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
width: 100%;
|
|
8
8
|
.list-item {
|
|
9
9
|
height: 28px;
|
|
10
|
+
position: relative;
|
|
10
11
|
background: #fff;
|
|
11
12
|
border: 1px solid #e5e6e8;
|
|
12
13
|
border-radius: 6px;
|
|
@@ -37,6 +38,41 @@
|
|
|
37
38
|
cursor: pointer;
|
|
38
39
|
}
|
|
39
40
|
}
|
|
41
|
+
|
|
42
|
+
.list-item-bottom-line {
|
|
43
|
+
width: 100%;
|
|
44
|
+
height: 8px;
|
|
45
|
+
border-bottom: solid 1px var(--ant-primary-color);
|
|
46
|
+
position: absolute;
|
|
47
|
+
left: 0;
|
|
48
|
+
bottom: -6px;
|
|
49
|
+
padding-top: 4px;
|
|
50
|
+
display: none;
|
|
51
|
+
align-items: center;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
z-index: 10;
|
|
55
|
+
}
|
|
56
|
+
.list-item-bottom-line::after {
|
|
57
|
+
content: "+";
|
|
58
|
+
height: 12px;
|
|
59
|
+
margin-top: 4px;
|
|
60
|
+
color: var(--ant-primary-color);
|
|
61
|
+
border: solid 1px var(--ant-primary-color);
|
|
62
|
+
border-radius: 10px;
|
|
63
|
+
font-weight: bold;
|
|
64
|
+
font-size: 14px;
|
|
65
|
+
background-color: white;
|
|
66
|
+
padding: 0 8px;
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
justify-content: center;
|
|
70
|
+
}
|
|
71
|
+
&:hover {
|
|
72
|
+
.list-item-bottom-line {
|
|
73
|
+
display: flex;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
40
76
|
}
|
|
41
77
|
}
|
|
42
78
|
|
|
@@ -1,21 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
8
|
-
var
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _ahooks = require("ahooks");
|
|
9
12
|
var _EventBusProvider = _interopRequireDefault(require("../engine/provider/EventBusProvider"));
|
|
10
13
|
var _ContextProvider = _interopRequireDefault(require("../engine/provider/ContextProvider"));
|
|
11
14
|
var _Page = _interopRequireDefault(require("../view/Page"));
|
|
12
15
|
var _index = require("../constants/index");
|
|
13
16
|
var Preview = function Preview(_ref) {
|
|
14
|
-
var code = _ref.code
|
|
15
|
-
|
|
17
|
+
var code = _ref.code,
|
|
18
|
+
userId = _ref.userId;
|
|
19
|
+
var _useState = (0, _react.useState)(userId),
|
|
20
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
21
|
+
currentKey = _useState2[0],
|
|
22
|
+
setCurrentKey = _useState2[1];
|
|
23
|
+
(0, _ahooks.useUpdateEffect)(function () {
|
|
24
|
+
setCurrentKey(void 0);
|
|
25
|
+
setTimeout(function () {
|
|
26
|
+
setCurrentKey(userId);
|
|
27
|
+
});
|
|
28
|
+
}, [userId]);
|
|
29
|
+
return code && currentKey ? /*#__PURE__*/_react.default.createElement(_EventBusProvider.default, {
|
|
16
30
|
runtime: _index.RUNTIME.PREVIEW
|
|
17
31
|
}, /*#__PURE__*/_react.default.createElement(_ContextProvider.default, {
|
|
18
32
|
code: code
|
|
19
|
-
}, /*#__PURE__*/_react.default.createElement(_Page.default, null)));
|
|
33
|
+
}, /*#__PURE__*/_react.default.createElement(_Page.default, null))) : null;
|
|
20
34
|
};
|
|
21
35
|
var _default = exports.default = Preview;
|
|
@@ -6,11 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _index = _interopRequireDefault(require("./index"));
|
|
10
11
|
var _excluded = ["children"];
|
|
11
12
|
var FunctionLive = function FunctionLive(_ref) {
|
|
12
13
|
var children = _ref.children,
|
|
13
14
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
14
|
-
return /*#__PURE__*/
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, props, children);
|
|
15
16
|
};
|
|
16
17
|
var _default = exports.default = FunctionLive;
|
|
@@ -6,11 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _index = _interopRequireDefault(require("./index"));
|
|
10
11
|
var _excluded = ["children"];
|
|
11
12
|
var FunctionPreview = function FunctionPreview(_ref) {
|
|
12
13
|
var children = _ref.children,
|
|
13
14
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
14
|
-
return /*#__PURE__*/
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, props, children);
|
|
15
16
|
};
|
|
16
17
|
var _default = exports.default = FunctionPreview;
|
|
@@ -6,11 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _index = _interopRequireDefault(require("./index"));
|
|
10
11
|
var _excluded = ["children"];
|
|
11
12
|
var FunctionDesign = function FunctionDesign(_ref) {
|
|
12
13
|
var children = _ref.children,
|
|
13
14
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
14
|
-
return /*#__PURE__*/
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, props, children);
|
|
15
16
|
};
|
|
16
17
|
var _default = exports.default = FunctionDesign;
|
|
@@ -6,11 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _index = _interopRequireDefault(require("./index"));
|
|
10
11
|
var _excluded = ["children"];
|
|
11
12
|
var FunctionLive = function FunctionLive(_ref) {
|
|
12
13
|
var children = _ref.children,
|
|
13
14
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
14
|
-
return /*#__PURE__*/
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, props, children);
|
|
15
16
|
};
|
|
16
17
|
var _default = exports.default = FunctionLive;
|
|
@@ -6,11 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _index = _interopRequireDefault(require("./index"));
|
|
10
11
|
var _excluded = ["children"];
|
|
11
12
|
var FunctionPreview = function FunctionPreview(_ref) {
|
|
12
13
|
var children = _ref.children,
|
|
13
14
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
14
|
-
return /*#__PURE__*/
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, props, children);
|
|
15
16
|
};
|
|
16
17
|
var _default = exports.default = FunctionPreview;
|
|
@@ -12,7 +12,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
12
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
14
|
var _ahooks = require("ahooks");
|
|
15
|
-
var _lodash = require("lodash");
|
|
16
15
|
var _index = _interopRequireDefault(require("./index"));
|
|
17
16
|
var _utils = require("@luck-design-biz/base/utils");
|
|
18
17
|
var _ContextProvider = require("../../../engine/provider/ContextProvider");
|
|
@@ -36,11 +35,10 @@ var FunctionDesign = function FunctionDesign(_ref) {
|
|
|
36
35
|
var compId = _ref2.id,
|
|
37
36
|
pageData = _ref2.pageData;
|
|
38
37
|
if (compId !== id) return;
|
|
39
|
-
|
|
40
|
-
(0, _dataProcess.add)(cloneData, id, "box_".concat((0, _utils.suid)()), (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _boxPropsDefault.default), {}, {
|
|
38
|
+
(0, _dataProcess.add)(pageData, id, "box_".concat((0, _utils.suid)()), (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _boxPropsDefault.default), {}, {
|
|
41
39
|
buildIn: true
|
|
42
40
|
}));
|
|
43
|
-
setPageData(
|
|
41
|
+
setPageData(pageData);
|
|
44
42
|
}).watch();
|
|
45
43
|
}, []);
|
|
46
44
|
return /*#__PURE__*/_react.default.createElement(_index.default, (0, _extends2.default)({
|
|
@@ -6,11 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _index = _interopRequireDefault(require("./index"));
|
|
10
11
|
var _excluded = ["children"];
|
|
11
12
|
var FunctionLive = function FunctionLive(_ref) {
|
|
12
13
|
var children = _ref.children,
|
|
13
14
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
14
|
-
return /*#__PURE__*/
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, props, children);
|
|
15
16
|
};
|
|
16
17
|
var _default = exports.default = FunctionLive;
|
|
@@ -6,11 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _index = _interopRequireDefault(require("./index"));
|
|
10
11
|
var _excluded = ["children"];
|
|
11
12
|
var FunctionPreview = function FunctionPreview(_ref) {
|
|
12
13
|
var children = _ref.children,
|
|
13
14
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
14
|
-
return /*#__PURE__*/
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, props, children);
|
|
15
16
|
};
|
|
16
17
|
var _default = exports.default = FunctionPreview;
|
|
@@ -8,6 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
12
|
var _index = _interopRequireDefault(require("./index"));
|
|
12
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
14
|
var _index2 = _interopRequireDefault(require("./index.less"));
|
|
@@ -17,7 +18,7 @@ var FunctionDesign = function FunctionDesign(_ref) {
|
|
|
17
18
|
className = _ref.className,
|
|
18
19
|
show = _ref.show,
|
|
19
20
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
20
|
-
return /*#__PURE__*/
|
|
21
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, (0, _extends2.default)({
|
|
21
22
|
className: (0, _classnames.default)(_index2.default['runtime-design'], (0, _defineProperty2.default)((0, _defineProperty2.default)({}, className, !!className), "hidden", !show)),
|
|
22
23
|
getContainer: false,
|
|
23
24
|
show: show,
|
|
@@ -6,11 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _index = _interopRequireDefault(require("./index"));
|
|
10
11
|
var _excluded = ["children"];
|
|
11
12
|
var FunctionLive = function FunctionLive(_ref) {
|
|
12
13
|
var children = _ref.children,
|
|
13
14
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
14
|
-
return /*#__PURE__*/
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, props, children);
|
|
15
16
|
};
|
|
16
17
|
var _default = exports.default = FunctionLive;
|
|
@@ -6,11 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _index = _interopRequireDefault(require("./index"));
|
|
10
11
|
var _excluded = ["children"];
|
|
11
12
|
var FunctionPreview = function FunctionPreview(_ref) {
|
|
12
13
|
var children = _ref.children,
|
|
13
14
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
14
|
-
return /*#__PURE__*/
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, props, children);
|
|
15
16
|
};
|
|
16
17
|
var _default = exports.default = FunctionPreview;
|
|
@@ -8,10 +8,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
13
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
15
|
var _ahooks = require("ahooks");
|
|
14
16
|
var _lodash = require("lodash");
|
|
17
|
+
var _utils = require("@luck-design-biz/base/utils");
|
|
18
|
+
var _ContextProvider = require("../../../engine/provider/ContextProvider");
|
|
19
|
+
var _dataProcess = require("../../../engine/tools/dataProcess");
|
|
20
|
+
var _boxPropsDefault = _interopRequireDefault(require("../../../engine/meta/box.props.default.json"));
|
|
15
21
|
var _index = _interopRequireDefault(require("./index"));
|
|
16
22
|
var _excluded = ["children", "blocks", "id"];
|
|
17
23
|
var FunctionDesign = function FunctionDesign(_ref) {
|
|
@@ -20,19 +26,75 @@ var FunctionDesign = function FunctionDesign(_ref) {
|
|
|
20
26
|
id = _ref.id,
|
|
21
27
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
22
28
|
var ref = (0, _react.useRef)(null);
|
|
29
|
+
var ctx = (0, _ContextProvider.useContext)();
|
|
30
|
+
var _usePageData = (0, _ContextProvider.usePageData)(),
|
|
31
|
+
_usePageData2 = (0, _slicedToArray2.default)(_usePageData, 2),
|
|
32
|
+
setPageData = _usePageData2[1].setPageData;
|
|
23
33
|
var previousBlocks = (0, _ahooks.usePrevious)((0, _lodash.cloneDeep)(blocks), function (prev, next) {
|
|
24
34
|
return !(0, _lodash.isEqual)(prev, next);
|
|
25
35
|
});
|
|
26
36
|
(0, _ahooks.useUpdateLayoutEffect)(function () {
|
|
27
|
-
var
|
|
37
|
+
var diffDataset = (0, _lodash.differenceWith)(blocks, previousBlocks, function (arrVal, othVal) {
|
|
28
38
|
var _arrVal$dataset, _othVal$dataset;
|
|
29
39
|
return arrVal.id === othVal.id && ((_arrVal$dataset = arrVal.dataset) === null || _arrVal$dataset === void 0 ? void 0 : _arrVal$dataset.code) === ((_othVal$dataset = othVal.dataset) === null || _othVal$dataset === void 0 ? void 0 : _othVal$dataset.code);
|
|
30
40
|
});
|
|
31
|
-
|
|
41
|
+
diffDataset.forEach(function (df) {
|
|
32
42
|
var _df$dataset;
|
|
33
43
|
((_df$dataset = df.dataset) === null || _df$dataset === void 0 ? void 0 : _df$dataset.code) && ref.current.doQueryOne(df.id);
|
|
34
44
|
});
|
|
45
|
+
var diffColReset = (0, _lodash.differenceWith)(blocks, previousBlocks, function (arrVal, othVal) {
|
|
46
|
+
return arrVal.id === othVal.id && arrVal.actionsColumnReset === othVal.actionsColumnReset;
|
|
47
|
+
});
|
|
48
|
+
diffColReset.forEach(function (df) {
|
|
49
|
+
var _ctx$componentMap$get2;
|
|
50
|
+
var _ctx$componentMap$get = (_ctx$componentMap$get2 = ctx.componentMap.get(id)) === null || _ctx$componentMap$get2 === void 0 ? void 0 : _ctx$componentMap$get2.api.getForm().getFormRef(df.id).formRef.current,
|
|
51
|
+
gridApi = _ctx$componentMap$get.gridApi;
|
|
52
|
+
gridApi.api.refreshCells({
|
|
53
|
+
columns: ['luck-actions'],
|
|
54
|
+
force: true
|
|
55
|
+
});
|
|
56
|
+
});
|
|
35
57
|
}, [JSON.stringify(blocks)]);
|
|
58
|
+
(0, _react.useEffect)(function () {
|
|
59
|
+
var cmid = ctx.$subscriber(ctx.topics.COMPONENT_MODIFY).on(function (_ref2) {
|
|
60
|
+
var compId = _ref2.id,
|
|
61
|
+
pageData = _ref2.pageData,
|
|
62
|
+
newValue = _ref2.newValue,
|
|
63
|
+
oldValue = _ref2.oldValue;
|
|
64
|
+
if (compId !== id || !newValue.hasOwnProperty('blocks')) return;
|
|
65
|
+
if (newValue.blocks.length > oldValue.blocks.length) {
|
|
66
|
+
var _differenceBy = (0, _lodash.differenceBy)(newValue.blocks, oldValue.blocks, 'id'),
|
|
67
|
+
_differenceBy2 = (0, _slicedToArray2.default)(_differenceBy, 1),
|
|
68
|
+
newItem = _differenceBy2[0];
|
|
69
|
+
if (newItem.type === 'blank') {
|
|
70
|
+
var boxId = "box_".concat((0, _utils.suid)());
|
|
71
|
+
(0, _dataProcess.add)(pageData, id, boxId, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _boxPropsDefault.default), {}, {
|
|
72
|
+
buildIn: true,
|
|
73
|
+
formBoxId: newItem.id
|
|
74
|
+
}));
|
|
75
|
+
setPageData(pageData);
|
|
76
|
+
}
|
|
77
|
+
} else if (newValue.blocks.length < oldValue.blocks.length) {
|
|
78
|
+
var _differenceBy3 = (0, _lodash.differenceBy)(oldValue.blocks, newValue.blocks, 'id'),
|
|
79
|
+
_differenceBy4 = (0, _slicedToArray2.default)(_differenceBy3, 1),
|
|
80
|
+
removeItem = _differenceBy4[0];
|
|
81
|
+
if (removeItem.type === 'blank') {
|
|
82
|
+
var _findNodeAndParent = (0, _dataProcess.findNodeAndParent)(id, pageData),
|
|
83
|
+
current = _findNodeAndParent.node;
|
|
84
|
+
var _boxId = current.children.find(function (childId) {
|
|
85
|
+
return current[childId].props.tabId === removeItem.id;
|
|
86
|
+
});
|
|
87
|
+
ctx.$publisher(ctx.topics.COMPONENT_DELETE, {
|
|
88
|
+
id: _boxId,
|
|
89
|
+
pageData: pageData
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}).watch();
|
|
94
|
+
return function () {
|
|
95
|
+
return ctx.$unsubscriber(ctx.topics.COMPONENT_MODIFY, cmid);
|
|
96
|
+
};
|
|
97
|
+
}, []);
|
|
36
98
|
return /*#__PURE__*/_react.default.createElement(_index.default, (0, _extends2.default)({}, props, {
|
|
37
99
|
id: id,
|
|
38
100
|
blocks: blocks,
|
|
@@ -6,11 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _index = _interopRequireDefault(require("./index"));
|
|
10
11
|
var _excluded = ["children"];
|
|
11
12
|
var FunctionLive = function FunctionLive(_ref) {
|
|
12
13
|
var children = _ref.children,
|
|
13
14
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
14
|
-
return /*#__PURE__*/
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, props, children);
|
|
15
16
|
};
|
|
16
17
|
var _default = exports.default = FunctionLive;
|
|
@@ -6,11 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _index = _interopRequireDefault(require("./index"));
|
|
10
11
|
var _excluded = ["children"];
|
|
11
12
|
var FunctionPreview = function FunctionPreview(_ref) {
|
|
12
13
|
var children = _ref.children,
|
|
13
14
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
14
|
-
return /*#__PURE__*/
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, props, children);
|
|
15
16
|
};
|
|
16
17
|
var _default = exports.default = FunctionPreview;
|