fan-standard-comp 3.1.0 → 3.1.2
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/dist/fan-standard-comp.umd.js +293 -285
- package/es/ButtonGroup/ButtonList.js +18 -36
- package/es/ButtonGroup/ButtonMenu.js +14 -27
- package/es/ButtonGroup/PopConfirmTitle.js +5 -16
- package/es/ButtonGroup/index.js +76 -107
- package/es/DragContent/DragBar.js +6 -18
- package/es/DragContent/index.js +12 -30
- package/es/FormComp/ChunkUploader/api.js +8 -21
- package/es/FormComp/ChunkUploader/index.js +27 -46
- package/es/FormComp/ChunkUploader/lib.js +9 -26
- package/es/FormComp/ChunkUploader/upload-queue.class.js +5 -12
- package/es/FormComp/ChunkUploader/worker.js +2 -7
- package/es/FormComp/EditButton/index.js +16 -35
- package/es/FormComp/FieldComponent/ReUpload.js +18 -38
- package/es/FormComp/FieldComponent/RefactorTreeSelect.js +26 -49
- package/es/FormComp/FieldComponent/TitleNode.js +3 -13
- package/es/FormComp/FieldComponent/index.js +87 -131
- package/es/FormComp/FieldComponent/setReadonlyValues.js +34 -61
- package/es/FormComp/RenderItemGroup/index.js +34 -56
- package/es/FormComp/Uploader/index.js +38 -64
- package/es/FormComp/Uploader/util.js +2 -11
- package/es/FormComp/VarTemplate/index.js +31 -44
- package/es/FormComp/index.js +1 -15
- package/es/NavLeafScroll/index.js +35 -53
- package/es/RefactorTree/index.js +29 -52
- package/es/RefactorTree/indexTreeNode.js +31 -54
- package/es/RefactorTree/style/index.js +1 -3
- package/es/RefactorTree/util.js +10 -18
- package/es/SpecIcon/fonts/iconfont.js +0 -2
- package/es/SpecIcon/index.js +17 -30
- package/es/SplitterLayout/Pane.js +5 -17
- package/es/SplitterLayout/index.js +13 -24
- package/es/StandardContent/SplitterLayout/Pane.js +13 -25
- package/es/StandardContent/SplitterLayout/index.js +30 -43
- package/es/StandardContent/SubfieldContent.js +13 -28
- package/es/StandardContent/WrapperContent.js +10 -24
- package/es/StandardDragModal/index.d.ts +11 -0
- package/es/StandardDragModal/index.js +30 -0
- package/es/StandardFilter/index.js +27 -46
- package/es/StandardForm/ActionList.js +8 -21
- package/es/StandardForm/StepForm.js +40 -68
- package/es/StandardForm/TabForm.js +26 -52
- package/es/StandardForm/index.js +28 -55
- package/es/StandardModal/UpdateFormRef.js +4 -18
- package/es/StandardModal/index.d.ts +3 -0
- package/es/StandardModal/index.js +118 -119
- package/es/StandardPanel/index.js +32 -53
- package/es/StandardTable/index.js +17 -44
- package/es/StandardTable/style/index.js +1 -3
- package/es/components/IconNode/index.js +6 -17
- package/es/components/index.js +2 -15
- package/es/data/func.code.js +2 -9
- package/es/data/general.config.js +2 -9
- package/es/data/index.js +3 -23
- package/es/index.d.ts +0 -1
- package/es/index.js +24 -238
- package/es/utils/ValueFormat.js +1 -9
- package/es/utils/filterPermission.js +4 -20
- package/es/utils/getParentNodes.js +1 -12
- package/es/utils/index.js +3 -35
- package/lib/ButtonGroup/ButtonList.js +9 -9
- package/lib/ButtonGroup/ButtonMenu.js +11 -11
- package/lib/ButtonGroup/PopConfirmTitle.js +5 -5
- package/lib/ButtonGroup/index.js +47 -47
- package/lib/DragContent/DragBar.js +5 -5
- package/lib/DragContent/index.js +7 -7
- package/lib/FormComp/ChunkUploader/api.js +4 -4
- package/lib/FormComp/ChunkUploader/index.js +10 -10
- package/lib/FormComp/ChunkUploader/lib.js +2 -2
- package/lib/FormComp/ChunkUploader/upload-queue.class.js +2 -2
- package/lib/FormComp/ChunkUploader/worker.js +2 -2
- package/lib/FormComp/EditButton/index.js +10 -10
- package/lib/FormComp/FieldComponent/ReUpload.js +9 -9
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +16 -16
- package/lib/FormComp/FieldComponent/TitleNode.js +4 -4
- package/lib/FormComp/FieldComponent/index.js +47 -47
- package/lib/FormComp/FieldComponent/setReadonlyValues.js +23 -23
- package/lib/FormComp/RenderItemGroup/index.js +20 -21
- package/lib/FormComp/Uploader/index.js +16 -16
- package/lib/FormComp/VarTemplate/index.js +25 -23
- package/lib/FormComp/index.js +2 -2
- package/lib/NavLeafScroll/index.js +28 -28
- package/lib/RefactorTree/index.js +14 -14
- package/lib/RefactorTree/indexTreeNode.js +19 -19
- package/lib/SpecIcon/index.js +13 -13
- package/lib/SplitterLayout/Pane.js +4 -4
- package/lib/SplitterLayout/index.js +10 -10
- package/lib/StandardContent/SplitterLayout/Pane.js +11 -11
- package/lib/StandardContent/SplitterLayout/index.js +27 -27
- package/lib/StandardContent/SubfieldContent.js +9 -9
- package/lib/StandardContent/WrapperContent.js +7 -7
- package/lib/StandardDragModal/index.d.ts +11 -0
- package/lib/StandardDragModal/index.js +43 -0
- package/lib/StandardFilter/index.js +18 -18
- package/lib/StandardForm/ActionList.js +6 -6
- package/lib/StandardForm/StepForm.js +26 -26
- package/lib/StandardForm/TabForm.js +13 -13
- package/lib/StandardForm/index.js +14 -14
- package/lib/StandardModal/UpdateFormRef.js +4 -4
- package/lib/StandardModal/index.d.ts +3 -0
- package/lib/StandardModal/index.js +99 -70
- package/lib/StandardPanel/index.js +23 -23
- package/lib/StandardTable/index.js +9 -19
- package/lib/components/IconNode/index.js +6 -6
- package/lib/components/index.js +2 -2
- package/lib/data/func.code.js +2 -2
- package/lib/data/general.config.js +2 -2
- package/lib/data/index.js +3 -3
- package/lib/index.d.ts +0 -1
- package/lib/index.js +23 -32
- package/lib/utils/ValueFormat.js +2 -2
- package/lib/utils/filterPermission.js +2 -2
- package/lib/utils/index.js +2 -2
- package/package.json +4 -3
- package/es/ConfigContext/index.d.ts +0 -7
- package/es/ConfigContext/index.js +0 -12
- package/es/locale/index.d.ts +0 -12
- package/es/locale/index.js +0 -5
- package/es/locale/zh_CN.d.ts +0 -4
- package/es/locale/zh_CN.js +0 -34
- package/lib/ConfigContext/index.d.ts +0 -7
- package/lib/ConfigContext/index.js +0 -12
- package/lib/locale/index.d.ts +0 -12
- package/lib/locale/index.js +0 -5
- package/lib/locale/zh_CN.d.ts +0 -4
- package/lib/locale/zh_CN.js +0 -34
|
@@ -1,39 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
require("antd/es/col/style");
|
|
11
|
-
|
|
12
|
-
var _col = _interopRequireDefault(require("antd/es/col"));
|
|
13
|
-
|
|
14
|
-
require("antd/es/button/style");
|
|
15
|
-
|
|
16
|
-
var _button = _interopRequireDefault(require("antd/es/button"));
|
|
17
|
-
|
|
18
|
-
require("antd/es/steps/style");
|
|
19
|
-
|
|
20
|
-
var _steps = _interopRequireDefault(require("antd/es/steps"));
|
|
21
|
-
|
|
22
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
23
|
-
|
|
24
|
-
var _index = _interopRequireDefault(require("./index"));
|
|
25
|
-
|
|
26
|
-
var _RenderItemGroup = _interopRequireDefault(require("../FormComp/RenderItemGroup"));
|
|
27
|
-
|
|
28
|
-
var _ActionList = _interopRequireDefault(require("./ActionList"));
|
|
29
|
-
|
|
30
|
-
require("./style/index.less");
|
|
31
|
-
|
|
32
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
33
|
-
|
|
34
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
|
-
|
|
36
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
1
|
+
import "antd/es/col/style";
|
|
2
|
+
import _Col from "antd/es/col";
|
|
3
|
+
import "antd/es/button/style";
|
|
4
|
+
import _Button from "antd/es/button";
|
|
5
|
+
import "antd/es/steps/style";
|
|
6
|
+
import _Steps from "antd/es/steps";
|
|
37
7
|
|
|
38
8
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
39
9
|
|
|
@@ -47,10 +17,14 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
47
17
|
|
|
48
18
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
49
19
|
|
|
50
|
-
|
|
51
|
-
|
|
20
|
+
import React, { useEffect, useState, useMemo } from 'react';
|
|
21
|
+
import StandardForm from './index';
|
|
22
|
+
import RenderItemGroup from '../FormComp/RenderItemGroup';
|
|
23
|
+
import ActionList from "./ActionList";
|
|
24
|
+
import './style/index.less'; // import { BreadcrumbProps as AntdBreadcrumbProps } from 'antd/es/form';
|
|
52
25
|
|
|
53
|
-
var
|
|
26
|
+
var Step = _Steps.Step;
|
|
27
|
+
var StepForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
54
28
|
var getFormFields = props.getFormFields,
|
|
55
29
|
_props$formItemGroup = props.formItemGroup,
|
|
56
30
|
formItemGroup = _props$formItemGroup === void 0 ? [] : _props$formItemGroup,
|
|
@@ -71,29 +45,29 @@ var StepForm = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
71
45
|
stepClick = props.stepClick,
|
|
72
46
|
displayLayout = props.displayLayout;
|
|
73
47
|
|
|
74
|
-
var _useState =
|
|
48
|
+
var _useState = useState(),
|
|
75
49
|
_useState2 = _slicedToArray(_useState, 2),
|
|
76
50
|
formChildFields = _useState2[0],
|
|
77
51
|
setFormChildFields = _useState2[1];
|
|
78
52
|
|
|
79
|
-
var _useState3 =
|
|
53
|
+
var _useState3 = useState(),
|
|
80
54
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
81
55
|
formChild = _useState4[0],
|
|
82
56
|
setFormChild = _useState4[1];
|
|
83
57
|
|
|
84
|
-
var _useState5 =
|
|
58
|
+
var _useState5 = useState(0),
|
|
85
59
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
86
60
|
currentStep = _useState6[0],
|
|
87
61
|
setCurrentStep = _useState6[1]; // const [fieldFailed, setFieldFailed] = useState(false)
|
|
88
62
|
|
|
89
63
|
|
|
90
|
-
|
|
64
|
+
useEffect(function () {
|
|
91
65
|
if (stepsConfig && (stepsConfig.current || stepsConfig.current === 0)) {
|
|
92
66
|
setCurrentStep(stepsConfig.current); // 判断是否有设置当前选中的步骤数
|
|
93
67
|
}
|
|
94
68
|
}, [stepsConfig]);
|
|
95
69
|
if (formItemGroup.length === 0) return null;
|
|
96
|
-
var formGridSize =
|
|
70
|
+
var formGridSize = useMemo(function () {
|
|
97
71
|
if (typeof grid === 'string') return grid; // 数据格式为字符串,包括 xs,md,lg,xlg
|
|
98
72
|
|
|
99
73
|
var sizeName = 'xs';
|
|
@@ -103,7 +77,7 @@ var StepForm = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
103
77
|
if (grid > 3) sizeName = 'xlg';
|
|
104
78
|
return sizeName;
|
|
105
79
|
}, [grid]);
|
|
106
|
-
|
|
80
|
+
useEffect(function () {
|
|
107
81
|
forceUpdateForm();
|
|
108
82
|
}, [formChildFields, formChild]);
|
|
109
83
|
|
|
@@ -125,7 +99,7 @@ var StepForm = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
125
99
|
formChild && formChild.validateFields(valitorGroup).then(function (values) {
|
|
126
100
|
if (stepClick) stepClick(type, formChild, values);
|
|
127
101
|
extraFunc && extraFunc();
|
|
128
|
-
})
|
|
102
|
+
}).catch(function (_ref) {// console.log('表单校验不通过 ', errorFields.map(err => err))
|
|
129
103
|
|
|
130
104
|
var errorFields = _ref.errorFields;
|
|
131
105
|
});
|
|
@@ -163,16 +137,16 @@ var StepForm = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
163
137
|
|
|
164
138
|
var renderStepActions = function renderStepActions(item, index) {
|
|
165
139
|
if (formItemGroup.length === 1) {
|
|
166
|
-
return /*#__PURE__*/
|
|
140
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
167
141
|
className: "standardForm-actions",
|
|
168
142
|
key: index
|
|
169
|
-
}, /*#__PURE__*/
|
|
143
|
+
}, /*#__PURE__*/React.createElement(_Button, {
|
|
170
144
|
type: "primary",
|
|
171
145
|
htmlType: "submit",
|
|
172
146
|
onClick: function onClick() {
|
|
173
147
|
return handleStepType('submit');
|
|
174
148
|
}
|
|
175
|
-
}, "\u786E\u8BA4"), /*#__PURE__*/
|
|
149
|
+
}, "\u786E\u8BA4"), /*#__PURE__*/React.createElement(_Button, {
|
|
176
150
|
onClick: function onClick() {
|
|
177
151
|
return handleStepType('cancel');
|
|
178
152
|
}
|
|
@@ -181,45 +155,45 @@ var StepForm = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
181
155
|
|
|
182
156
|
var buttonList = function buttonList(itemIndex) {
|
|
183
157
|
if (itemIndex === 0) {
|
|
184
|
-
return /*#__PURE__*/
|
|
158
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Button, {
|
|
185
159
|
type: "primary",
|
|
186
160
|
onClick: function onClick() {
|
|
187
161
|
return handleStepType('next');
|
|
188
162
|
}
|
|
189
|
-
}, "\u4E0B\u4E00\u6B65"), /*#__PURE__*/
|
|
163
|
+
}, "\u4E0B\u4E00\u6B65"), /*#__PURE__*/React.createElement(_Button, {
|
|
190
164
|
onClick: function onClick() {
|
|
191
165
|
return handleStepType('cancel');
|
|
192
166
|
}
|
|
193
167
|
}, "\u53D6\u6D88"));
|
|
194
168
|
} else if (itemIndex === formItemGroup.length - 1) {
|
|
195
|
-
return /*#__PURE__*/
|
|
169
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Button, {
|
|
196
170
|
type: "primary",
|
|
197
171
|
onClick: function onClick() {
|
|
198
172
|
return handleStepType('prev');
|
|
199
173
|
}
|
|
200
|
-
}, "\u4E0A\u4E00\u6B65"), /*#__PURE__*/
|
|
174
|
+
}, "\u4E0A\u4E00\u6B65"), /*#__PURE__*/React.createElement(_Button, {
|
|
201
175
|
type: "primary",
|
|
202
176
|
htmlType: "submit",
|
|
203
177
|
onClick: function onClick() {
|
|
204
178
|
return handleStepType('submit');
|
|
205
179
|
}
|
|
206
|
-
}, "\u786E\u8BA4"), /*#__PURE__*/
|
|
180
|
+
}, "\u786E\u8BA4"), /*#__PURE__*/React.createElement(_Button, {
|
|
207
181
|
onClick: function onClick() {
|
|
208
182
|
return handleStepType('cancel');
|
|
209
183
|
}
|
|
210
184
|
}, "\u53D6\u6D88"));
|
|
211
185
|
} else {
|
|
212
|
-
return /*#__PURE__*/
|
|
186
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Button, {
|
|
213
187
|
type: "primary",
|
|
214
188
|
onClick: function onClick() {
|
|
215
189
|
return handleStepType('prev');
|
|
216
190
|
}
|
|
217
|
-
}, "\u4E0A\u4E00\u6B65"), /*#__PURE__*/
|
|
191
|
+
}, "\u4E0A\u4E00\u6B65"), /*#__PURE__*/React.createElement(_Button, {
|
|
218
192
|
type: "primary",
|
|
219
193
|
onClick: function onClick() {
|
|
220
194
|
return handleStepType('next');
|
|
221
195
|
}
|
|
222
|
-
}, "\u4E0B\u4E00\u6B65"), /*#__PURE__*/
|
|
196
|
+
}, "\u4E0B\u4E00\u6B65"), /*#__PURE__*/React.createElement(_Button, {
|
|
223
197
|
onClick: function onClick() {
|
|
224
198
|
return handleStepType('cancel');
|
|
225
199
|
}
|
|
@@ -227,7 +201,7 @@ var StepForm = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
227
201
|
}
|
|
228
202
|
};
|
|
229
203
|
|
|
230
|
-
return /*#__PURE__*/
|
|
204
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
231
205
|
className: "standardForm-actions",
|
|
232
206
|
key: index,
|
|
233
207
|
style: {
|
|
@@ -236,7 +210,7 @@ var StepForm = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
236
210
|
}, buttonList(index));
|
|
237
211
|
};
|
|
238
212
|
|
|
239
|
-
return /*#__PURE__*/
|
|
213
|
+
return /*#__PURE__*/React.createElement(StandardForm, {
|
|
240
214
|
className: layout === 'inline' ? '' : '',
|
|
241
215
|
actionGroup: [],
|
|
242
216
|
ref: ref,
|
|
@@ -251,8 +225,8 @@ var StepForm = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
251
225
|
layout: layout,
|
|
252
226
|
onFinishFailed: function onFinishFailed() {// setFieldFailed(true)
|
|
253
227
|
}
|
|
254
|
-
}, /*#__PURE__*/
|
|
255
|
-
return !item.hideStep ? /*#__PURE__*/
|
|
228
|
+
}, /*#__PURE__*/React.createElement(_Steps, Object.assign({}, stepsConfig), formItemGroup.map(function (item, index) {
|
|
229
|
+
return !item.hideStep ? /*#__PURE__*/React.createElement(Step, {
|
|
256
230
|
key: "".concat(item.title).concat(index),
|
|
257
231
|
description: item.description,
|
|
258
232
|
icon: item.icon,
|
|
@@ -262,13 +236,13 @@ var StepForm = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
262
236
|
disabled: item.disabled
|
|
263
237
|
}) : null;
|
|
264
238
|
})), formItemGroup.map(function (item, index) {
|
|
265
|
-
return /*#__PURE__*/
|
|
239
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
266
240
|
key: index,
|
|
267
241
|
className: "stepForm-content ".concat(layout === 'inline' ? 'stepForm-content-inline' : ''),
|
|
268
242
|
style: stepsConfig && stepsConfig.current !== index ? {
|
|
269
243
|
display: 'none'
|
|
270
244
|
} : {}
|
|
271
|
-
}, item.fields && Array.isArray(item.fields) ? /*#__PURE__*/
|
|
245
|
+
}, item.fields && Array.isArray(item.fields) ? /*#__PURE__*/React.createElement(RenderItemGroup, {
|
|
272
246
|
layout: layout,
|
|
273
247
|
form: formChild,
|
|
274
248
|
fieldStatus: fieldStatus,
|
|
@@ -279,9 +253,9 @@ var StepForm = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
279
253
|
},
|
|
280
254
|
// doUpdateFormFields={() => console.log('强制渲染表单')}
|
|
281
255
|
itemGroup: item.fields
|
|
282
|
-
}) : item.fields, !actionHide && /*#__PURE__*/
|
|
256
|
+
}) : item.fields, !actionHide && /*#__PURE__*/React.createElement(_Col, {
|
|
283
257
|
span: 24
|
|
284
|
-
}, item.actions ? /*#__PURE__*/
|
|
258
|
+
}, item.actions ? /*#__PURE__*/React.createElement(ActionList, {
|
|
285
259
|
list: item.actions,
|
|
286
260
|
onStep: handleStepType,
|
|
287
261
|
form: formChild,
|
|
@@ -290,6 +264,4 @@ var StepForm = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
290
264
|
}) : renderStepActions(item, index)));
|
|
291
265
|
}));
|
|
292
266
|
});
|
|
293
|
-
|
|
294
|
-
var _default = StepForm;
|
|
295
|
-
exports["default"] = _default;
|
|
267
|
+
export default StepForm;
|
|
@@ -1,37 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
require("antd/es/col/style");
|
|
11
|
-
|
|
12
|
-
var _col = _interopRequireDefault(require("antd/es/col"));
|
|
13
|
-
|
|
14
|
-
require("antd/es/tabs/style");
|
|
15
|
-
|
|
16
|
-
var _tabs = _interopRequireDefault(require("antd/es/tabs"));
|
|
17
|
-
|
|
18
|
-
var _tslib = require("tslib");
|
|
19
|
-
|
|
20
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
21
|
-
|
|
22
|
-
require("./style/index.less");
|
|
23
|
-
|
|
24
|
-
var _index2 = _interopRequireDefault(require("./index"));
|
|
25
|
-
|
|
26
|
-
var _RenderItemGroup = _interopRequireDefault(require("../FormComp/RenderItemGroup"));
|
|
27
|
-
|
|
28
|
-
var _ActionList = _interopRequireDefault(require("./ActionList"));
|
|
29
|
-
|
|
30
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
31
|
-
|
|
32
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
|
-
|
|
34
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
1
|
+
import "antd/es/col/style";
|
|
2
|
+
import _Col from "antd/es/col";
|
|
3
|
+
import "antd/es/tabs/style";
|
|
4
|
+
import _Tabs from "antd/es/tabs";
|
|
35
5
|
|
|
36
6
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
37
7
|
|
|
@@ -45,9 +15,14 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
45
15
|
|
|
46
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
47
17
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
18
|
+
import { __rest } from "tslib";
|
|
19
|
+
import React, { useEffect, useState, useMemo } from 'react';
|
|
20
|
+
import './style/index.less';
|
|
21
|
+
import StandardForm from './index';
|
|
22
|
+
import RenderItemGroup from '../FormComp/RenderItemGroup';
|
|
23
|
+
import ActionList from "./ActionList";
|
|
24
|
+
var TabPane = _Tabs.TabPane;
|
|
25
|
+
var TabForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
51
26
|
var getFormFields = props.getFormFields,
|
|
52
27
|
_props$formItemGroup = props.formItemGroup,
|
|
53
28
|
formItemGroup = _props$formItemGroup === void 0 ? [] : _props$formItemGroup,
|
|
@@ -64,18 +39,18 @@ var TabForm = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
64
39
|
tabsConfig = props.tabsConfig,
|
|
65
40
|
displayLayout = props.displayLayout;
|
|
66
41
|
|
|
67
|
-
var _useState =
|
|
42
|
+
var _useState = useState(),
|
|
68
43
|
_useState2 = _slicedToArray(_useState, 2),
|
|
69
44
|
formChildFields = _useState2[0],
|
|
70
45
|
setFormChildFields = _useState2[1];
|
|
71
46
|
|
|
72
|
-
var _useState3 =
|
|
47
|
+
var _useState3 = useState(),
|
|
73
48
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
74
49
|
formChild = _useState4[0],
|
|
75
50
|
setFormChild = _useState4[1]; // const [fieldFailed, setFieldFailed] = useState(false)
|
|
76
51
|
|
|
77
52
|
|
|
78
|
-
var formGridSize =
|
|
53
|
+
var formGridSize = useMemo(function () {
|
|
79
54
|
if (typeof grid === 'string') return grid; // 数据格式为字符串,包括 xs,md,lg,xlg
|
|
80
55
|
|
|
81
56
|
var sizeName = 'xs';
|
|
@@ -85,7 +60,7 @@ var TabForm = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
85
60
|
if (grid > 3) sizeName = 'xlg';
|
|
86
61
|
return sizeName;
|
|
87
62
|
}, [grid]);
|
|
88
|
-
|
|
63
|
+
useEffect(function () {
|
|
89
64
|
forceUpdateForm();
|
|
90
65
|
}, [formChildFields, formChild]);
|
|
91
66
|
|
|
@@ -95,7 +70,7 @@ var TabForm = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
95
70
|
};
|
|
96
71
|
|
|
97
72
|
if (formItemGroup.length === 0) return null;
|
|
98
|
-
return /*#__PURE__*/
|
|
73
|
+
return /*#__PURE__*/React.createElement(StandardForm, {
|
|
99
74
|
actionGroup: [],
|
|
100
75
|
ref: ref,
|
|
101
76
|
fieldSize: fieldSize,
|
|
@@ -107,22 +82,23 @@ var TabForm = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
107
82
|
layout: layout,
|
|
108
83
|
onSubmit: onSubmit,
|
|
109
84
|
initialValues: initialValues
|
|
110
|
-
}, /*#__PURE__*/
|
|
85
|
+
}, /*#__PURE__*/React.createElement(_Tabs, Object.assign({
|
|
111
86
|
type: "card",
|
|
112
87
|
animated: false
|
|
113
88
|
}, tabsConfig), formItemGroup.map(function (item, index) {
|
|
114
89
|
var title = item.title,
|
|
115
90
|
fields = item.fields,
|
|
116
91
|
actions = item.actions,
|
|
117
|
-
tabConfig =
|
|
118
|
-
|
|
92
|
+
tabConfig = __rest(item, ["title", "fields", "actions"]);
|
|
93
|
+
|
|
94
|
+
return /*#__PURE__*/React.createElement(TabPane, Object.assign({
|
|
119
95
|
key: "".concat(item.key || index),
|
|
120
96
|
tab: title
|
|
121
97
|
}, tabConfig, {
|
|
122
98
|
forceRender: true
|
|
123
|
-
}), /*#__PURE__*/
|
|
99
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
124
100
|
className: "tabForm-content ".concat(layout === 'inline' ? 'tabForm-content-inline' : '')
|
|
125
|
-
}, fields && Array.isArray(fields) ? /*#__PURE__*/
|
|
101
|
+
}, fields && Array.isArray(fields) ? /*#__PURE__*/React.createElement(RenderItemGroup, {
|
|
126
102
|
layout: layout,
|
|
127
103
|
form: formChild,
|
|
128
104
|
fieldStatus: fieldStatus,
|
|
@@ -133,9 +109,9 @@ var TabForm = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
133
109
|
},
|
|
134
110
|
// doUpdateFormFields={() => forceUpdateForm()}
|
|
135
111
|
itemGroup: fields
|
|
136
|
-
}) : fields, !actionHide && actions && /*#__PURE__*/
|
|
112
|
+
}) : fields, !actionHide && actions && /*#__PURE__*/React.createElement(_Col, {
|
|
137
113
|
span: 24
|
|
138
|
-
}, /*#__PURE__*/
|
|
114
|
+
}, /*#__PURE__*/React.createElement(ActionList, {
|
|
139
115
|
list: item.actions,
|
|
140
116
|
form: formChild,
|
|
141
117
|
other: props,
|
|
@@ -143,6 +119,4 @@ var TabForm = /*#__PURE__*/_react["default"].forwardRef(function (props, ref) {
|
|
|
143
119
|
}))));
|
|
144
120
|
})));
|
|
145
121
|
});
|
|
146
|
-
|
|
147
|
-
var _default = TabForm;
|
|
148
|
-
exports["default"] = _default;
|
|
122
|
+
export default TabForm;
|
package/es/StandardForm/index.js
CHANGED
|
@@ -1,39 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
require("antd/es/button/style");
|
|
11
|
-
|
|
12
|
-
var _button = _interopRequireDefault(require("antd/es/button"));
|
|
13
|
-
|
|
14
|
-
require("antd/es/form/style");
|
|
15
|
-
|
|
16
|
-
var _form = _interopRequireDefault(require("antd/es/form"));
|
|
17
|
-
|
|
18
|
-
var _tslib = require("tslib");
|
|
19
|
-
|
|
20
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
21
|
-
|
|
22
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
23
|
-
|
|
24
|
-
var _RenderItemGroup = _interopRequireDefault(require("../FormComp/RenderItemGroup"));
|
|
25
|
-
|
|
26
|
-
var _data = require("../data");
|
|
27
|
-
|
|
28
|
-
require("./style/index.less");
|
|
29
|
-
|
|
30
|
-
var _ActionList = _interopRequireDefault(require("./ActionList"));
|
|
31
|
-
|
|
32
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
33
|
-
|
|
34
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
|
-
|
|
36
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
1
|
+
import "antd/es/button/style";
|
|
2
|
+
import _Button from "antd/es/button";
|
|
3
|
+
import "antd/es/form/style";
|
|
4
|
+
import _Form from "antd/es/form";
|
|
37
5
|
|
|
38
6
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
39
7
|
|
|
@@ -47,7 +15,14 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
47
15
|
|
|
48
16
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
49
17
|
|
|
50
|
-
|
|
18
|
+
import { __rest } from "tslib";
|
|
19
|
+
import React, { useEffect, useMemo } from 'react';
|
|
20
|
+
import classNames from 'classnames';
|
|
21
|
+
import RenderItemGroup from '../FormComp/RenderItemGroup';
|
|
22
|
+
import { general } from '../data';
|
|
23
|
+
import './style/index.less';
|
|
24
|
+
import ActionList from "./ActionList";
|
|
25
|
+
var StandardForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
51
26
|
var _props$formItemGroup = props.formItemGroup,
|
|
52
27
|
formItemGroup = _props$formItemGroup === void 0 ? [] : _props$formItemGroup,
|
|
53
28
|
className = props.className,
|
|
@@ -72,20 +47,20 @@ var StandardForm = /*#__PURE__*/_react["default"].forwardRef(function (props, re
|
|
|
72
47
|
postfix = props.postfix,
|
|
73
48
|
fieldSize = props.fieldSize,
|
|
74
49
|
displayLayout = props.displayLayout,
|
|
75
|
-
baseProps =
|
|
50
|
+
baseProps = __rest(props, ["formItemGroup", "className", "initialValues", "layout", "grid", "getFormFields", "fieldStatus", "onSubmit", "confirmText", "onCancel", "cancelText", "actionAlign", "actionGroup", "onFinishFailed", "children", "prefix", "postfix", "fieldSize", "displayLayout"]);
|
|
76
51
|
|
|
77
|
-
var _Form$useForm =
|
|
52
|
+
var _Form$useForm = _Form.useForm(),
|
|
78
53
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
79
54
|
initForm = _Form$useForm2[0];
|
|
80
55
|
|
|
81
|
-
|
|
56
|
+
useEffect(function () {
|
|
82
57
|
if (initForm) {
|
|
83
58
|
// <---- check ref before use the form instance
|
|
84
59
|
forceUpdateForm();
|
|
85
60
|
}
|
|
86
61
|
}, [initForm]); // 栅格尺寸
|
|
87
62
|
|
|
88
|
-
var gridSize =
|
|
63
|
+
var gridSize = useMemo(function () {
|
|
89
64
|
var sizeName = 'xs';
|
|
90
65
|
if (grid <= 1) sizeName = 'xs';
|
|
91
66
|
if (grid === 2) sizeName = 'md';
|
|
@@ -94,13 +69,13 @@ var StandardForm = /*#__PURE__*/_react["default"].forwardRef(function (props, re
|
|
|
94
69
|
return sizeName;
|
|
95
70
|
}, [grid]); // 按钮组对齐位置
|
|
96
71
|
|
|
97
|
-
var actionAlignCol =
|
|
72
|
+
var actionAlignCol = useMemo(function () {
|
|
98
73
|
if (layout !== 'horizontal' || gridSize !== 'xs' || actionAlign && actionAlign !== 'default') {
|
|
99
74
|
return {};
|
|
100
75
|
}
|
|
101
76
|
|
|
102
|
-
return Object.assign(Object.assign({},
|
|
103
|
-
offset:
|
|
77
|
+
return Object.assign(Object.assign({}, general.modalSize[gridSize].formBlockLayout.wrapperCol), {
|
|
78
|
+
offset: general.modalSize[gridSize].formBlockLayout.labelCol.span
|
|
104
79
|
});
|
|
105
80
|
}, [layout, gridSize, actionAlign]); // 强制更新表单值,用于赋初始化实例值
|
|
106
81
|
|
|
@@ -139,9 +114,9 @@ var StandardForm = /*#__PURE__*/_react["default"].forwardRef(function (props, re
|
|
|
139
114
|
var renderActionGroup = function renderActionGroup() {
|
|
140
115
|
var groupNode = function groupNode() {
|
|
141
116
|
if (Array.isArray(actionGroup)) {
|
|
142
|
-
return actionGroup.length === 0 ? null : /*#__PURE__*/
|
|
117
|
+
return actionGroup.length === 0 ? null : /*#__PURE__*/React.createElement(_Form.Item, {
|
|
143
118
|
wrapperCol: actionAlignCol
|
|
144
|
-
}, /*#__PURE__*/
|
|
119
|
+
}, /*#__PURE__*/React.createElement(ActionList, {
|
|
145
120
|
list: actionGroup,
|
|
146
121
|
form: initForm,
|
|
147
122
|
align: actionAlign,
|
|
@@ -154,17 +129,17 @@ var StandardForm = /*#__PURE__*/_react["default"].forwardRef(function (props, re
|
|
|
154
129
|
|
|
155
130
|
if (Array.isArray(actionGroup) && actionGroup.length === 0) return null;
|
|
156
131
|
if (actionGroup) return groupNode();
|
|
157
|
-
return /*#__PURE__*/
|
|
132
|
+
return /*#__PURE__*/React.createElement(_Form.Item, {
|
|
158
133
|
className: "standardForm-actions",
|
|
159
134
|
style: {
|
|
160
135
|
'textAlign': !actionAlign || actionAlign === 'default' ? 'inherit' : actionAlign
|
|
161
136
|
},
|
|
162
137
|
wrapperCol: actionAlignCol
|
|
163
|
-
}, confirmText && /*#__PURE__*/
|
|
138
|
+
}, confirmText && /*#__PURE__*/React.createElement(_Button, {
|
|
164
139
|
type: "primary",
|
|
165
140
|
htmlType: "submit",
|
|
166
141
|
size: fieldSize
|
|
167
|
-
}, confirmText), cancelText && /*#__PURE__*/
|
|
142
|
+
}, confirmText), cancelText && /*#__PURE__*/React.createElement(_Button, {
|
|
168
143
|
onClick: function onClick() {
|
|
169
144
|
return onFormCancel();
|
|
170
145
|
},
|
|
@@ -172,8 +147,8 @@ var StandardForm = /*#__PURE__*/_react["default"].forwardRef(function (props, re
|
|
|
172
147
|
}, cancelText));
|
|
173
148
|
};
|
|
174
149
|
|
|
175
|
-
return /*#__PURE__*/
|
|
176
|
-
className: (
|
|
150
|
+
return /*#__PURE__*/React.createElement(_Form, Object.assign({
|
|
151
|
+
className: classNames(className, 'standardForm'),
|
|
177
152
|
ref: ref,
|
|
178
153
|
form: initForm,
|
|
179
154
|
initialValues: initialValues,
|
|
@@ -182,7 +157,7 @@ var StandardForm = /*#__PURE__*/_react["default"].forwardRef(function (props, re
|
|
|
182
157
|
onFinish: onFormFinish,
|
|
183
158
|
onFinishFailed: onFormFinishFailed,
|
|
184
159
|
scrollToFirstError: true
|
|
185
|
-
}), prefix, children, /*#__PURE__*/
|
|
160
|
+
}), prefix, children, /*#__PURE__*/React.createElement(React.Fragment, null, formItemGroup.length > 0 ? /*#__PURE__*/React.createElement(RenderItemGroup, {
|
|
186
161
|
itemGroup: formItemGroup,
|
|
187
162
|
fieldSize: fieldSize,
|
|
188
163
|
displayLayout: displayLayout,
|
|
@@ -192,6 +167,4 @@ var StandardForm = /*#__PURE__*/_react["default"].forwardRef(function (props, re
|
|
|
192
167
|
fieldStatus: fieldStatus
|
|
193
168
|
}) : null, renderActionGroup()), postfix);
|
|
194
169
|
});
|
|
195
|
-
|
|
196
|
-
var _default = StandardForm;
|
|
197
|
-
exports["default"] = _default;
|
|
170
|
+
export default StandardForm;
|
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
13
|
-
|
|
14
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
1
|
+
import React, { useEffect } from "react";
|
|
15
2
|
|
|
16
3
|
var updateModalForm = function updateModalForm(props) {
|
|
17
4
|
var getFormAndFields = props.getFormAndFields,
|
|
@@ -21,12 +8,11 @@ var updateModalForm = function updateModalForm(props) {
|
|
|
21
8
|
if (getFormAndFields) getFormAndFields(form.current.getFieldsValue() || {}, form.current);
|
|
22
9
|
};
|
|
23
10
|
|
|
24
|
-
|
|
11
|
+
useEffect(function () {
|
|
25
12
|
updateFormFields();
|
|
26
13
|
}, [form]);
|
|
27
|
-
return /*#__PURE__*/
|
|
14
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
28
15
|
/* 如果是ReactNode则直接返回 */
|
|
29
16
|
};
|
|
30
17
|
|
|
31
|
-
|
|
32
|
-
exports["default"] = _default;
|
|
18
|
+
export default updateModalForm;
|
|
@@ -3,6 +3,7 @@ import { ModalProps } from 'antd/es/modal';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { ItemGroupProps } from '../StandardForm/index';
|
|
5
5
|
import './style/index.less';
|
|
6
|
+
import 'ant-design-draggable-modal/dist/index.css';
|
|
6
7
|
export interface StandardModalProps extends ModalProps {
|
|
7
8
|
children?: React.ReactNode;
|
|
8
9
|
title?: String;
|
|
@@ -36,6 +37,8 @@ export interface StandardModalProps extends ModalProps {
|
|
|
36
37
|
okButtonProps?: any;
|
|
37
38
|
confirmButtonProps?: any;
|
|
38
39
|
cancelButtonProps?: any;
|
|
40
|
+
dragAble?: boolean;
|
|
41
|
+
[k: string]: any;
|
|
39
42
|
}
|
|
40
43
|
declare const StandardModal: (props: StandardModalProps) => JSX.Element;
|
|
41
44
|
export default StandardModal;
|