@luck-design-biz/luckda 0.0.25-4 → 0.0.25-7
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.less +1 -1
- package/es/components/LdAutoForm/index.js +24 -8
- package/es/components/LdFormList/index.js +25 -18
- package/es/components/LdGrid/index.js +3 -2
- package/es/components/LdGridForm/index.js +16 -6
- package/es/components/LdTree/index.js +3 -2
- package/es/helper/form.js +6 -3
- package/es/locales/zh-CN.js +1 -0
- package/es/lowcode/constants/api-url.js +13 -11
- package/es/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +5 -2
- package/es/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +5 -2
- 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/form.props.json +3 -3
- package/es/lowcode/engine/meta/table.props.json +4 -4
- package/es/lowcode/engine/meta/tree.props.default.json +1 -0
- package/es/lowcode/engine/meta/tree.props.json +7 -0
- package/es/lowcode/engine/provider/ContextProvider/index.js +8 -40
- package/es/lowcode/engine/provider/RemoteSourceProvider.js +16 -20
- 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 +174 -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 +11 -22
- package/es/lowcode/painter/DesignToolbar.js +8 -44
- package/es/lowcode/painter/Outline.js +2 -4
- package/es/lowcode/painter/Panel.js +26 -25
- package/es/lowcode/painter/components/ActionBindModal.js +5 -11
- package/es/lowcode/painter/components/AttrsPanel.js +26 -19
- 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/SettingUI.js +7 -7
- package/es/lowcode/painter/panel-section/BlocksEditor/index.js +11 -11
- 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 +5 -1
- package/es/lowcode/painter/panel-section/SerialsSelector.js +4 -2
- package/es/lowcode/painter/panel-section/TreeRootEditor.js +2 -2
- package/es/lowcode/painter/style/design.less +1 -1
- package/es/lowcode/painter/style/panel-item.less +1 -1
- package/es/lowcode/view/Canvas.js +6 -7
- package/es/lowcode/view/Page.js +2 -3
- package/es/lowcode/view/lc-components/Dialog/FunctionDesign.js +3 -10
- package/es/lowcode/view/lc-components/Dialog/index.js +89 -19
- package/es/lowcode/view/lc-components/Dialog/meta.json +65 -42
- package/es/lowcode/view/lc-components/Form/FunctionDesign.js +23 -33
- package/es/lowcode/view/lc-components/Form/index.js +20 -6
- package/es/lowcode/view/lc-components/Form/meta.json +3 -3
- package/es/lowcode/view/lc-components/Layout/FunctionDesign.js +12 -19
- 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/PageModal/index.js +12 -15
- package/es/lowcode/view/lc-components/Section/FunctionDesign.js +3 -9
- package/es/lowcode/view/lc-components/Split/FunctionDesign.js +11 -18
- package/es/lowcode/view/lc-components/Table/index.js +67 -25
- package/es/lowcode/view/lc-components/Table/meta.json +4 -4
- package/es/lowcode/view/lc-components/Tabs/FunctionDesign.js +9 -17
- package/es/lowcode/view/lc-components/Tree/index.js +8 -1
- package/es/lowcode/view/lc-components/Tree/meta.json +7 -0
- 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 +2 -1
- package/es/upload/index.js +2 -1
- package/es/utils/action.js +2 -2
- package/lib/components/LDActions/index.less +1 -1
- package/lib/components/LdAutoForm/index.js +23 -7
- package/lib/components/LdFormList/index.js +25 -18
- package/lib/components/LdGrid/index.js +3 -2
- package/lib/components/LdGridForm/index.js +14 -4
- package/lib/components/LdTree/index.js +3 -2
- package/lib/helper/form.js +6 -3
- package/lib/locales/zh-CN.js +1 -0
- package/lib/lowcode/constants/api-url.js +14 -10
- package/lib/lowcode/engine/factory/panel-item-factory/SelectStrategy.js +7 -4
- package/lib/lowcode/engine/factory/panel-item-factory/SwitchStrategy.js +6 -3
- 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/form.props.json +3 -3
- package/lib/lowcode/engine/meta/table.props.json +4 -4
- package/lib/lowcode/engine/meta/tree.props.default.json +1 -0
- package/lib/lowcode/engine/meta/tree.props.json +7 -0
- package/lib/lowcode/engine/provider/ContextProvider/index.js +25 -41
- package/lib/lowcode/engine/provider/RemoteSourceProvider.js +16 -20
- 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 +181 -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 +10 -21
- package/lib/lowcode/painter/DesignToolbar.js +7 -43
- package/lib/lowcode/painter/Outline.js +1 -3
- package/lib/lowcode/painter/Panel.js +25 -24
- package/lib/lowcode/painter/components/ActionBindModal.js +5 -11
- package/lib/lowcode/painter/components/AttrsPanel.js +26 -19
- 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/SettingUI.js +7 -7
- package/lib/lowcode/painter/panel-section/BlocksEditor/index.js +10 -10
- 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 +5 -1
- package/lib/lowcode/painter/panel-section/SerialsSelector.js +4 -2
- package/lib/lowcode/painter/panel-section/TreeRootEditor.js +2 -2
- package/lib/lowcode/painter/style/design.less +1 -1
- package/lib/lowcode/painter/style/panel-item.less +1 -1
- package/lib/lowcode/view/Canvas.js +5 -6
- package/lib/lowcode/view/Page.js +2 -3
- package/lib/lowcode/view/lc-components/Dialog/FunctionDesign.js +2 -9
- package/lib/lowcode/view/lc-components/Dialog/index.js +89 -19
- package/lib/lowcode/view/lc-components/Dialog/meta.json +65 -42
- package/lib/lowcode/view/lc-components/Form/FunctionDesign.js +20 -31
- package/lib/lowcode/view/lc-components/Form/index.js +20 -6
- package/lib/lowcode/view/lc-components/Form/meta.json +3 -3
- package/lib/lowcode/view/lc-components/Layout/FunctionDesign.js +11 -18
- 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/PageModal/index.js +11 -14
- package/lib/lowcode/view/lc-components/Section/FunctionDesign.js +2 -8
- package/lib/lowcode/view/lc-components/Split/FunctionDesign.js +10 -17
- package/lib/lowcode/view/lc-components/Table/index.js +66 -24
- package/lib/lowcode/view/lc-components/Table/meta.json +4 -4
- package/lib/lowcode/view/lc-components/Tabs/FunctionDesign.js +8 -16
- package/lib/lowcode/view/lc-components/Tree/index.js +8 -1
- package/lib/lowcode/view/lc-components/Tree/meta.json +7 -0
- 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 +2 -1
- package/lib/upload/index.js +8 -1
- package/lib/utils/action.js +2 -2
- package/package.json +4 -3
|
@@ -8,14 +8,12 @@ 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 _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
12
|
var _react = _interopRequireDefault(require("react"));
|
|
14
13
|
var _ahooks = require("ahooks");
|
|
15
14
|
var _index = _interopRequireDefault(require("./index"));
|
|
16
15
|
var _utils = require("@luck-design-biz/base/utils");
|
|
17
16
|
var _ContextProvider = require("../../../engine/provider/ContextProvider");
|
|
18
|
-
var _dataProcess = require("../../../engine/tools/dataProcess");
|
|
19
17
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
20
18
|
var _index2 = _interopRequireDefault(require("./index.less"));
|
|
21
19
|
var _boxPropsDefault = _interopRequireDefault(require("../../../engine/meta/box.props.default.json"));
|
|
@@ -26,19 +24,14 @@ var FunctionDesign = function FunctionDesign(_ref) {
|
|
|
26
24
|
className = _ref.className,
|
|
27
25
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
28
26
|
var ctx = (0, _ContextProvider.useContext)();
|
|
29
|
-
var _usePageData = (0, _ContextProvider.usePageData)(),
|
|
30
|
-
_usePageData2 = (0, _slicedToArray2.default)(_usePageData, 2),
|
|
31
|
-
setPageData = _usePageData2[1].setPageData;
|
|
32
27
|
(0, _ahooks.useCreation)(function () {
|
|
33
28
|
if (children !== null && children !== void 0 && children.length) return;
|
|
34
29
|
ctx.$subscriber(ctx.topics.COMPONENT_APPEND).once(function (_ref2) {
|
|
35
|
-
var compId = _ref2.id
|
|
36
|
-
pageData = _ref2.pageData;
|
|
30
|
+
var compId = _ref2.id;
|
|
37
31
|
if (compId !== id) return;
|
|
38
|
-
(0,
|
|
32
|
+
(0, _ContextProvider.addNode)(id, "box_".concat((0, _utils.suid)()), (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _boxPropsDefault.default), {}, {
|
|
39
33
|
buildIn: true
|
|
40
34
|
}));
|
|
41
|
-
setPageData(pageData);
|
|
42
35
|
}).watch();
|
|
43
36
|
}, []);
|
|
44
37
|
return /*#__PURE__*/_react.default.createElement(_index.default, (0, _extends2.default)({
|
|
@@ -1,37 +1,91 @@
|
|
|
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 = void 0;
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _ahooks = require("ahooks");
|
|
14
14
|
var _antd = require("luck-design/antd");
|
|
15
15
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
16
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
17
|
+
var _index = require("../../../../index");
|
|
18
|
+
var _ContextProvider = require("../../../engine/provider/ContextProvider");
|
|
19
|
+
var _usePromiseState3 = _interopRequireDefault(require("../../../engine/tools/usePromiseState"));
|
|
16
20
|
var _Wrapper = _interopRequireDefault(require("../Wrapper"));
|
|
17
|
-
var
|
|
18
|
-
var
|
|
21
|
+
var _index2 = _interopRequireDefault(require("./index.less"));
|
|
22
|
+
var Footer = _styledComponents.default.div.withConfig({
|
|
23
|
+
displayName: "Footer",
|
|
24
|
+
componentId: "luckda-6530__sc-1aeozvd-0"
|
|
25
|
+
})(["width:100%;display:flex;justify-content:flex-end;"]);
|
|
19
26
|
var LCDialog = function LCDialog(_ref) {
|
|
20
27
|
var id = _ref.id,
|
|
21
28
|
children = _ref.children,
|
|
29
|
+
title = _ref.title,
|
|
30
|
+
width = _ref.width,
|
|
31
|
+
height = _ref.height,
|
|
22
32
|
getContainer = _ref.getContainer,
|
|
23
33
|
wrapClassName = _ref.wrapClassName,
|
|
24
34
|
maskStyle = _ref.maskStyle,
|
|
25
|
-
|
|
35
|
+
defaultOpen = _ref.defaultOpen,
|
|
36
|
+
mask = _ref.mask,
|
|
37
|
+
okText = _ref.okText,
|
|
38
|
+
cancelText = _ref.cancelText,
|
|
39
|
+
footer = _ref.footer,
|
|
40
|
+
btnGroup = _ref.btnGroup,
|
|
41
|
+
advance = _ref.advance;
|
|
42
|
+
var ctx = (0, _ContextProvider.useContext)();
|
|
26
43
|
var apiRef = (0, _react.useRef)();
|
|
27
44
|
var domRef = (0, _react.useRef)();
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
open =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
45
|
+
var _usePromiseState = (0, _usePromiseState3.default)(defaultOpen),
|
|
46
|
+
_usePromiseState2 = (0, _slicedToArray2.default)(_usePromiseState, 2),
|
|
47
|
+
open = _usePromiseState2[0],
|
|
48
|
+
setOpen = _usePromiseState2[1];
|
|
49
|
+
(0, _react.useEffect)(function () {
|
|
50
|
+
ctx.doAction(advance.events.onMount);
|
|
51
|
+
return function () {
|
|
52
|
+
return ctx.doAction(advance.events.onUnmount);
|
|
53
|
+
};
|
|
54
|
+
}, []);
|
|
55
|
+
(0, _ahooks.useUpdateEffect)(function () {
|
|
56
|
+
if (open) {
|
|
57
|
+
ctx.doAction(advance.events.onOpen);
|
|
58
|
+
} else {
|
|
59
|
+
ctx.doAction(advance.events.onClose);
|
|
60
|
+
}
|
|
61
|
+
}, [open]);
|
|
62
|
+
var handleOk = (0, _ahooks.useMemoizedFn)(function () {
|
|
63
|
+
ctx.doAction(advance.events.onOk);
|
|
64
|
+
});
|
|
65
|
+
var _footer = (0, _ahooks.useCreation)(function () {
|
|
66
|
+
var _btnGroup$todoList;
|
|
67
|
+
if (!footer) return {
|
|
68
|
+
footer: null
|
|
69
|
+
};
|
|
70
|
+
if (!(btnGroup !== null && btnGroup !== void 0 && (_btnGroup$todoList = btnGroup.todoList) !== null && _btnGroup$todoList !== void 0 && _btnGroup$todoList.length)) return {};
|
|
71
|
+
return {
|
|
72
|
+
footer: /*#__PURE__*/_react.default.createElement(Footer, null, /*#__PURE__*/_react.default.createElement(_index.LDActions, (0, _extends2.default)({}, btnGroup, {
|
|
73
|
+
doAction: function doAction(action) {
|
|
74
|
+
return ctx.doAction(action);
|
|
75
|
+
}
|
|
76
|
+
})), /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
77
|
+
onClick: function onClick() {
|
|
78
|
+
return setOpen(false);
|
|
79
|
+
},
|
|
80
|
+
style: {
|
|
81
|
+
marginLeft: 8
|
|
82
|
+
}
|
|
83
|
+
}, cancelText), /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
84
|
+
type: "primary",
|
|
85
|
+
onClick: handleOk
|
|
86
|
+
}, okText))
|
|
87
|
+
};
|
|
88
|
+
}, [footer, btnGroup]);
|
|
35
89
|
var getTargetDom = (0, _ahooks.useMemoizedFn)(function () {
|
|
36
90
|
var _domRef$current;
|
|
37
91
|
return (_domRef$current = domRef.current) === null || _domRef$current === void 0 ? void 0 : _domRef$current.closest('.ant-modal-content');
|
|
@@ -39,22 +93,38 @@ var LCDialog = function LCDialog(_ref) {
|
|
|
39
93
|
(0, _react.useImperativeHandle)(apiRef, function () {
|
|
40
94
|
return {
|
|
41
95
|
open: open,
|
|
42
|
-
doOpen:
|
|
43
|
-
|
|
44
|
-
|
|
96
|
+
doOpen: function doOpen() {
|
|
97
|
+
return setOpen(true);
|
|
98
|
+
},
|
|
99
|
+
doClose: function doClose() {
|
|
100
|
+
return setOpen(false);
|
|
101
|
+
}
|
|
45
102
|
};
|
|
46
|
-
});
|
|
103
|
+
}, []);
|
|
47
104
|
return /*#__PURE__*/_react.default.createElement(_Wrapper.default, {
|
|
48
105
|
id: id,
|
|
49
106
|
displayName: "Dialog",
|
|
50
107
|
getTargetDom: getTargetDom,
|
|
51
108
|
api: apiRef
|
|
52
|
-
}, /*#__PURE__*/_react.default.createElement(_antd.Modal, {
|
|
109
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Modal, (0, _extends2.default)({
|
|
110
|
+
title: title,
|
|
53
111
|
visible: open,
|
|
54
112
|
getContainer: getContainer,
|
|
113
|
+
width: width,
|
|
114
|
+
mask: mask,
|
|
55
115
|
maskStyle: maskStyle,
|
|
56
|
-
|
|
57
|
-
|
|
116
|
+
bodyStyle: {
|
|
117
|
+
height: height,
|
|
118
|
+
overflowY: 'auto',
|
|
119
|
+
marginTop: 0
|
|
120
|
+
},
|
|
121
|
+
wrapClassName: (0, _classnames.default)(_index2.default['lc-component-dialog-wrapper'], (0, _defineProperty2.default)({}, wrapClassName, !!wrapClassName))
|
|
122
|
+
}, _footer, {
|
|
123
|
+
onOk: handleOk,
|
|
124
|
+
onCancel: function onCancel() {
|
|
125
|
+
return setOpen(false);
|
|
126
|
+
}
|
|
127
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
58
128
|
style: {
|
|
59
129
|
height: 0,
|
|
60
130
|
width: 0,
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"props": [
|
|
10
10
|
{
|
|
11
11
|
"key": "id",
|
|
12
|
-
"
|
|
12
|
+
"name": "唯一标识",
|
|
13
13
|
"type": "string",
|
|
14
14
|
"disabled": true
|
|
15
15
|
},
|
|
@@ -22,65 +22,88 @@
|
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
"key": "width",
|
|
25
|
-
"name": "
|
|
26
|
-
"
|
|
27
|
-
"
|
|
25
|
+
"name": "对话框宽度",
|
|
26
|
+
"type": "_WidthHeight",
|
|
27
|
+
"options": [
|
|
28
|
+
{
|
|
29
|
+
"label": "px",
|
|
30
|
+
"value": "px"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"label": "%",
|
|
34
|
+
"value": "%"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"label": "vw",
|
|
38
|
+
"value": "vw"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"label": "A",
|
|
42
|
+
"value": "auto"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
28
45
|
"default": "700px"
|
|
29
46
|
},
|
|
30
47
|
{
|
|
31
48
|
"key": "height",
|
|
32
|
-
"name": "
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
"default": true
|
|
49
|
+
"name": "内容区高度",
|
|
50
|
+
"type": "_WidthHeight",
|
|
51
|
+
"options": [
|
|
52
|
+
{
|
|
53
|
+
"label": "px",
|
|
54
|
+
"value": "px"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"label": "vh",
|
|
58
|
+
"value": "vh"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"label": "A",
|
|
62
|
+
"value": "auto"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"default": "50vh"
|
|
50
66
|
},
|
|
51
67
|
{
|
|
52
68
|
"key": "defaultOpen",
|
|
53
69
|
"name": "默认显示",
|
|
54
70
|
"desc": "默认是否显示",
|
|
55
|
-
"type": "
|
|
71
|
+
"type": "switch",
|
|
56
72
|
"default": false
|
|
57
73
|
},
|
|
58
74
|
{
|
|
59
75
|
"key": "mask",
|
|
60
76
|
"name": "显示遮罩",
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"default": false
|
|
77
|
+
"type": "switch",
|
|
78
|
+
"default": true
|
|
64
79
|
},
|
|
65
80
|
{
|
|
66
|
-
"key": "
|
|
67
|
-
"name": "
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
|
|
81
|
+
"key": "okText",
|
|
82
|
+
"name": "确认文字",
|
|
83
|
+
"type": "_I18nInput",
|
|
84
|
+
"default": "确定"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"key": "cancelText",
|
|
88
|
+
"name": "取消文字",
|
|
89
|
+
"type": "_I18nInput",
|
|
90
|
+
"default": "取消"
|
|
71
91
|
},
|
|
72
92
|
{
|
|
73
93
|
"key": "footer",
|
|
74
|
-
"name": "
|
|
94
|
+
"name": "显示footer",
|
|
75
95
|
"desc": "是否显示底部按钮区域",
|
|
76
|
-
"type": "
|
|
96
|
+
"type": "switch",
|
|
77
97
|
"default": true
|
|
78
98
|
},
|
|
79
99
|
{
|
|
80
100
|
"key": "btnGroup",
|
|
81
101
|
"name": "按钮组",
|
|
82
102
|
"desc": "底部按钮区域的按钮组(参考按钮配置)",
|
|
83
|
-
"type": "
|
|
103
|
+
"type": "_ActionsEditor",
|
|
104
|
+
"default": { "display": "button", "max": 2, "moreText": "操作", "todoList": [] },
|
|
105
|
+
"wrapper": "collapse",
|
|
106
|
+
"wrapperProps": { "suppressIcon": true }
|
|
84
107
|
}
|
|
85
108
|
],
|
|
86
109
|
"advance": {
|
|
@@ -89,31 +112,31 @@
|
|
|
89
112
|
"key": "onMount",
|
|
90
113
|
"name": "组件首次渲染时",
|
|
91
114
|
"desc": "在组件首次渲染时,执行方法",
|
|
92
|
-
"func": "(
|
|
115
|
+
"func": "()=>{\n\t\n}"
|
|
93
116
|
},
|
|
94
117
|
{
|
|
95
118
|
"key": "onUnmount",
|
|
96
119
|
"name": "组件卸载时",
|
|
97
120
|
"desc": "在组件卸载时,执行方法。",
|
|
98
|
-
"func": "(
|
|
121
|
+
"func": "()=>{\n\t\n}"
|
|
99
122
|
},
|
|
100
123
|
{
|
|
101
124
|
"key": "onOpen",
|
|
102
125
|
"name": "对话框打开时",
|
|
103
126
|
"desc": "在对话框打开时,执行方法",
|
|
104
|
-
"func": "(
|
|
127
|
+
"func": "()=>{\n\t\n}"
|
|
105
128
|
},
|
|
106
129
|
{
|
|
107
130
|
"key": "onClose",
|
|
108
131
|
"name": "对话框关闭时",
|
|
109
132
|
"desc": "在对话框打开时,执行方法,promise反馈false无法截断关闭",
|
|
110
|
-
"func": "(
|
|
133
|
+
"func": "()=>{\n\t\n}"
|
|
111
134
|
},
|
|
112
135
|
{
|
|
113
|
-
"key": "
|
|
114
|
-
"name": "
|
|
115
|
-
"desc": "
|
|
116
|
-
"func": "(
|
|
136
|
+
"key": "onOk",
|
|
137
|
+
"name": "确定按钮点击",
|
|
138
|
+
"desc": "点击确定按钮时,执行方法",
|
|
139
|
+
"func": "()=>{\n\t\n}"
|
|
117
140
|
}
|
|
118
141
|
]
|
|
119
142
|
}
|
|
@@ -16,7 +16,6 @@ var _ahooks = require("ahooks");
|
|
|
16
16
|
var _lodash = require("lodash");
|
|
17
17
|
var _utils = require("@luck-design-biz/base/utils");
|
|
18
18
|
var _ContextProvider = require("../../../engine/provider/ContextProvider");
|
|
19
|
-
var _dataProcess = require("../../../engine/tools/dataProcess");
|
|
20
19
|
var _boxPropsDefault = _interopRequireDefault(require("../../../engine/meta/box.props.default.json"));
|
|
21
20
|
var _index = _interopRequireDefault(require("./index"));
|
|
22
21
|
var _excluded = ["children", "blocks", "id"];
|
|
@@ -27,38 +26,32 @@ var FunctionDesign = function FunctionDesign(_ref) {
|
|
|
27
26
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
28
27
|
var ref = (0, _react.useRef)(null);
|
|
29
28
|
var ctx = (0, _ContextProvider.useContext)();
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
var current = (0, _ContextProvider.useGet)({
|
|
30
|
+
id: id
|
|
31
|
+
});
|
|
33
32
|
var previousBlocks = (0, _ahooks.usePrevious)((0, _lodash.cloneDeep)(blocks), function (prev, next) {
|
|
34
33
|
return !(0, _lodash.isEqual)(prev, next);
|
|
35
34
|
});
|
|
36
35
|
(0, _ahooks.useUpdateLayoutEffect)(function () {
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
gridApi = _ctx$componentMap$get.gridApi;
|
|
52
|
-
gridApi.api.refreshCells({
|
|
53
|
-
columns: ['luck-actions'],
|
|
54
|
-
force: true
|
|
55
|
-
});
|
|
36
|
+
var blocksObj = (0, _lodash.keyBy)(blocks, 'id');
|
|
37
|
+
var previousBlocksObj = (0, _lodash.keyBy)(previousBlocks, 'id');
|
|
38
|
+
(0, _lodash.forEach)(blocksObj, function (value, key) {
|
|
39
|
+
var _value$dataset, _previousBlocksObj$ke, _value$dataset2, _previousBlocksObj$ke2;
|
|
40
|
+
if (((_value$dataset = value.dataset) === null || _value$dataset === void 0 ? void 0 : _value$dataset.code) !== ((_previousBlocksObj$ke = previousBlocksObj[key]) === null || _previousBlocksObj$ke === void 0 || (_previousBlocksObj$ke = _previousBlocksObj$ke.dataset) === null || _previousBlocksObj$ke === void 0 ? void 0 : _previousBlocksObj$ke.code)) ((_value$dataset2 = value.dataset) === null || _value$dataset2 === void 0 ? void 0 : _value$dataset2.code) && ref.current.doQueryOne(key);
|
|
41
|
+
if (value.actionsColumnReset !== ((_previousBlocksObj$ke2 = previousBlocksObj[key]) === null || _previousBlocksObj$ke2 === void 0 ? void 0 : _previousBlocksObj$ke2.actionsColumnReset)) {
|
|
42
|
+
var _ctx$componentMap$get2;
|
|
43
|
+
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(key).formRef.current,
|
|
44
|
+
gridApi = _ctx$componentMap$get.gridApi;
|
|
45
|
+
gridApi.api.refreshCells({
|
|
46
|
+
columns: ['luck-actions'],
|
|
47
|
+
force: true
|
|
48
|
+
});
|
|
49
|
+
}
|
|
56
50
|
});
|
|
57
51
|
}, [JSON.stringify(blocks)]);
|
|
58
52
|
(0, _react.useEffect)(function () {
|
|
59
53
|
var cmid = ctx.$subscriber(ctx.topics.COMPONENT_MODIFY).on(function (_ref2) {
|
|
60
54
|
var compId = _ref2.id,
|
|
61
|
-
pageData = _ref2.pageData,
|
|
62
55
|
newValue = _ref2.newValue,
|
|
63
56
|
oldValue = _ref2.oldValue;
|
|
64
57
|
if (compId !== id || !newValue.hasOwnProperty('blocks')) return;
|
|
@@ -68,25 +61,21 @@ var FunctionDesign = function FunctionDesign(_ref) {
|
|
|
68
61
|
newItem = _differenceBy2[0];
|
|
69
62
|
if (newItem.type === 'blank') {
|
|
70
63
|
var boxId = "box_".concat((0, _utils.suid)());
|
|
71
|
-
(0,
|
|
64
|
+
(0, _ContextProvider.addNode)(id, boxId, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _boxPropsDefault.default), {}, {
|
|
72
65
|
buildIn: true,
|
|
73
66
|
formBoxId: newItem.id
|
|
74
67
|
}));
|
|
75
|
-
setPageData(pageData);
|
|
76
68
|
}
|
|
77
69
|
} else if (newValue.blocks.length < oldValue.blocks.length) {
|
|
78
70
|
var _differenceBy3 = (0, _lodash.differenceBy)(oldValue.blocks, newValue.blocks, 'id'),
|
|
79
71
|
_differenceBy4 = (0, _slicedToArray2.default)(_differenceBy3, 1),
|
|
80
72
|
removeItem = _differenceBy4[0];
|
|
81
73
|
if (removeItem.type === 'blank') {
|
|
82
|
-
var _findNodeAndParent = (0, _dataProcess.findNodeAndParent)(id, pageData),
|
|
83
|
-
current = _findNodeAndParent.node;
|
|
84
74
|
var _boxId = current.children.find(function (childId) {
|
|
85
|
-
return current[childId].props.
|
|
75
|
+
return current[childId].props.formBoxId === removeItem.id;
|
|
86
76
|
});
|
|
87
77
|
ctx.$publisher(ctx.topics.COMPONENT_DELETE, {
|
|
88
|
-
id: _boxId
|
|
89
|
-
pageData: pageData
|
|
78
|
+
id: _boxId
|
|
90
79
|
});
|
|
91
80
|
}
|
|
92
81
|
}
|
|
@@ -42,6 +42,7 @@ var Header = function Header(_ref) {
|
|
|
42
42
|
}), children);
|
|
43
43
|
};
|
|
44
44
|
var LCForm = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
45
|
+
var _ctx$pagePublicResour2;
|
|
45
46
|
var id = _ref2.id,
|
|
46
47
|
parentId = _ref2.parentId,
|
|
47
48
|
width = _ref2.width,
|
|
@@ -82,6 +83,17 @@ var LCForm = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
82
83
|
return {
|
|
83
84
|
getForm: function getForm() {
|
|
84
85
|
return (ref || formRef).current;
|
|
86
|
+
},
|
|
87
|
+
submit: function submit() {
|
|
88
|
+
var _ctx$pagePublicResour;
|
|
89
|
+
var instance = (ref || formRef).current;
|
|
90
|
+
var _ref3 = ((_ctx$pagePublicResour = ctx.pagePublicResource) === null || _ctx$pagePublicResour === void 0 ? void 0 : _ctx$pagePublicResour[id]) || initData || {},
|
|
91
|
+
formMode = _ref3.formMode;
|
|
92
|
+
if (formMode === 'add') {
|
|
93
|
+
instance.onAdd();
|
|
94
|
+
} else if (formMode === 'update') {
|
|
95
|
+
instance.onBatchUpdate();
|
|
96
|
+
}
|
|
85
97
|
}
|
|
86
98
|
};
|
|
87
99
|
});
|
|
@@ -94,9 +106,9 @@ var LCForm = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
94
106
|
};
|
|
95
107
|
return (0, _helper.executeCode)(ctx, defaultDataSourceFormat, ['defaultValues'], defaultValues);
|
|
96
108
|
});
|
|
97
|
-
var handleDataSourceFormat = (0, _ahooks.useMemoizedFn)(function (dataSourceFormat,
|
|
98
|
-
var values =
|
|
99
|
-
submitData =
|
|
109
|
+
var handleDataSourceFormat = (0, _ahooks.useMemoizedFn)(function (dataSourceFormat, _ref4) {
|
|
110
|
+
var values = _ref4.values,
|
|
111
|
+
submitData = _ref4.submitData;
|
|
100
112
|
if ((0, _lodash.isNil)(dataSourceFormat)) return submitData;
|
|
101
113
|
return (0, _helper.executeCode)(ctx, dataSourceFormat, ['values', 'submitData'], values, submitData);
|
|
102
114
|
});
|
|
@@ -130,7 +142,8 @@ var LCForm = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
130
142
|
});
|
|
131
143
|
var renderFormList = (0, _ahooks.useMemoizedFn)(function (formConfig) {
|
|
132
144
|
return (0, _lodash.reduce)(blocks, function (result, item) {
|
|
133
|
-
if ((0, _lodash.includes)(['auto', 'grid', 'writer'], item.type) &&
|
|
145
|
+
if ((0, _lodash.includes)(['auto', 'grid', 'writer'], item.type) && (0, _lodash.includes)(item.mode, formConfig.formMode)) {
|
|
146
|
+
var _item$dataset;
|
|
134
147
|
var data = {
|
|
135
148
|
id: item.id,
|
|
136
149
|
order: item.order,
|
|
@@ -138,9 +151,10 @@ var LCForm = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
138
151
|
readOnly: item.readOnly,
|
|
139
152
|
title: item.name,
|
|
140
153
|
header: item.header,
|
|
141
|
-
dataSetKey: item.dataset.code,
|
|
154
|
+
dataSetKey: (_item$dataset = item.dataset) === null || _item$dataset === void 0 ? void 0 : _item$dataset.code,
|
|
142
155
|
serial: item.serial,
|
|
143
156
|
serialEffect: item.serialEffect,
|
|
157
|
+
fields: item.fields,
|
|
144
158
|
defaultDataSourceFormat: function defaultDataSourceFormat(defaultValues) {
|
|
145
159
|
return handleDefaultDataSourceFormat(item.defaultDataSourceFormat, defaultValues);
|
|
146
160
|
},
|
|
@@ -283,7 +297,7 @@ var LCForm = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
283
297
|
renderFormList: renderFormList,
|
|
284
298
|
renderFormExtra: renderFormExtra,
|
|
285
299
|
mainFormLdId: "block_main",
|
|
286
|
-
initData: initData,
|
|
300
|
+
initData: ((_ctx$pagePublicResour2 = ctx.pagePublicResource) === null || _ctx$pagePublicResour2 === void 0 ? void 0 : _ctx$pagePublicResour2[id]) || initData,
|
|
287
301
|
ref: ref || formRef,
|
|
288
302
|
readOnly: readOnly,
|
|
289
303
|
showSaveBtn: showSave,
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
{
|
|
39
39
|
"key": "saveTitle",
|
|
40
40
|
"name": "保存按钮标题",
|
|
41
|
-
"type": "
|
|
41
|
+
"type": "_I18nInput",
|
|
42
42
|
"default": "保存"
|
|
43
43
|
},
|
|
44
44
|
{
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
{
|
|
121
121
|
"key": "name",
|
|
122
122
|
"name": "区块名称",
|
|
123
|
-
"type": "
|
|
123
|
+
"type": "_I18nInput"
|
|
124
124
|
},
|
|
125
125
|
{
|
|
126
126
|
"key": "serial",
|
|
@@ -501,7 +501,7 @@
|
|
|
501
501
|
{
|
|
502
502
|
"key": "zipName",
|
|
503
503
|
"name": "压缩包命名",
|
|
504
|
-
"type": "
|
|
504
|
+
"type": "_I18nInput"
|
|
505
505
|
},
|
|
506
506
|
{
|
|
507
507
|
"key": "uploadUrl",
|
|
@@ -8,7 +8,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
13
|
var _ahooks = require("ahooks");
|
|
@@ -16,7 +15,6 @@ var _lodash = require("lodash");
|
|
|
16
15
|
var _utils = require("@luck-design-biz/base/utils");
|
|
17
16
|
var _ContextProvider = require("../../../engine/provider/ContextProvider");
|
|
18
17
|
var _index = _interopRequireDefault(require("./index"));
|
|
19
|
-
var _dataProcess = require("../../../engine/tools/dataProcess");
|
|
20
18
|
var _boxPropsDefault = _interopRequireDefault(require("../../../engine/meta/box.props.default.json"));
|
|
21
19
|
var _excluded = ["children", "id", "columnRatio"];
|
|
22
20
|
var LayoutFunctionDesign = function LayoutFunctionDesign(_ref) {
|
|
@@ -25,29 +23,27 @@ var LayoutFunctionDesign = function LayoutFunctionDesign(_ref) {
|
|
|
25
23
|
columnRatio = _ref.columnRatio,
|
|
26
24
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
27
25
|
var ctx = (0, _ContextProvider.useContext)();
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var refreshChild = (0, _ahooks.useMemoizedFn)(function (
|
|
32
|
-
var _findNodeAndParent = (0, _dataProcess.findNodeAndParent)(id, _pageData),
|
|
33
|
-
current = _findNodeAndParent.node;
|
|
26
|
+
var current = (0, _ContextProvider.useGet)({
|
|
27
|
+
id: id
|
|
28
|
+
});
|
|
29
|
+
var refreshChild = (0, _ahooks.useMemoizedFn)(function () {
|
|
34
30
|
var ratioArr = columnRatio.split(':');
|
|
35
31
|
(0, _lodash.drop)(current.children, ratioArr.length).forEach(function (boxId) {
|
|
36
|
-
(0,
|
|
32
|
+
(0, _ContextProvider.deleteNode)(boxId);
|
|
37
33
|
});
|
|
38
34
|
ratioArr.forEach(function (item, index) {
|
|
39
35
|
var _current$children;
|
|
40
36
|
var ratio = parseInt(item, 10);
|
|
41
37
|
var boxId = (_current$children = current.children) === null || _current$children === void 0 ? void 0 : _current$children[index];
|
|
42
38
|
if (boxId) {
|
|
43
|
-
(0,
|
|
39
|
+
(0, _ContextProvider.modifyNode)(current.children[index], (0, _objectSpread2.default)((0, _objectSpread2.default)({}, current[boxId].props), {}, {
|
|
44
40
|
style: {
|
|
45
41
|
gridColumn: 'span ' + ratio
|
|
46
42
|
}
|
|
47
43
|
}));
|
|
48
44
|
} else {
|
|
49
45
|
boxId = "box_".concat((0, _utils.suid)());
|
|
50
|
-
(0,
|
|
46
|
+
(0, _ContextProvider.addNode)(id, boxId, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _boxPropsDefault.default), {}, {
|
|
51
47
|
buildIn: true,
|
|
52
48
|
style: {
|
|
53
49
|
gridColumn: 'span ' + ratio
|
|
@@ -55,23 +51,20 @@ var LayoutFunctionDesign = function LayoutFunctionDesign(_ref) {
|
|
|
55
51
|
}));
|
|
56
52
|
}
|
|
57
53
|
});
|
|
58
|
-
setPageData(_pageData);
|
|
59
54
|
});
|
|
60
55
|
(0, _ahooks.useCreation)(function () {
|
|
61
56
|
if (children !== null && children !== void 0 && children.length) return;
|
|
62
57
|
ctx.$subscriber(ctx.topics.COMPONENT_APPEND).once(function (_ref2) {
|
|
63
|
-
var compId = _ref2.id
|
|
64
|
-
pageData = _ref2.pageData;
|
|
58
|
+
var compId = _ref2.id;
|
|
65
59
|
if (compId !== id) return;
|
|
66
|
-
refreshChild(
|
|
60
|
+
refreshChild();
|
|
67
61
|
}).watch();
|
|
68
62
|
}, []);
|
|
69
63
|
(0, _react.useEffect)(function () {
|
|
70
64
|
var cmid = ctx.$subscriber(ctx.topics.COMPONENT_MODIFY).on(function (_ref3) {
|
|
71
|
-
var compId = _ref3.id
|
|
72
|
-
pageData = _ref3.pageData;
|
|
65
|
+
var compId = _ref3.id;
|
|
73
66
|
if (compId !== id) return;
|
|
74
|
-
refreshChild(
|
|
67
|
+
refreshChild();
|
|
75
68
|
}).watch();
|
|
76
69
|
return function () {
|
|
77
70
|
return ctx.$unsubscriber(ctx.topics.COMPONENT_MODIFY, cmid);
|