fan-standard-comp 3.1.1 → 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 +81 -125
- package/es/FormComp/FieldComponent/setReadonlyValues.js +28 -55
- package/es/FormComp/RenderItemGroup/index.js +34 -55
- 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 +18 -36
- 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.js +24 -229
- 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 +41 -41
- package/lib/FormComp/FieldComponent/setReadonlyValues.js +17 -17
- package/lib/FormComp/RenderItemGroup/index.js +20 -20
- 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 -10
- 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.js +22 -22
- 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,33 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
1
|
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
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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 _react = _interopRequireDefault(require("react"));
|
|
19
|
-
|
|
20
|
-
var _FieldComponent = _interopRequireDefault(require("../FormComp/FieldComponent"));
|
|
21
|
-
|
|
22
|
-
var _ValueFormat = _interopRequireDefault(require("../utils/ValueFormat.js"));
|
|
23
|
-
|
|
24
|
-
var _index = _interopRequireDefault(require("../ButtonGroup/index"));
|
|
25
|
-
|
|
26
|
-
var _index2 = require("../data/index");
|
|
27
|
-
|
|
28
|
-
require("./style/index.less");
|
|
29
|
-
|
|
30
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
3
|
+
import "antd/es/button/style";
|
|
4
|
+
import _Button from "antd/es/button";
|
|
5
|
+
import "antd/es/form/style";
|
|
6
|
+
import _Form from "antd/es/form";
|
|
31
7
|
|
|
32
8
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
33
9
|
|
|
@@ -59,11 +35,17 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
|
|
|
59
35
|
|
|
60
36
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
61
37
|
|
|
62
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
38
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
63
39
|
|
|
64
40
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
65
41
|
|
|
66
|
-
|
|
42
|
+
import React from 'react';
|
|
43
|
+
import FieldComponent from '../FormComp/FieldComponent';
|
|
44
|
+
import UtilValueFormat from '../utils/ValueFormat.js';
|
|
45
|
+
import ButtonGroup from '../ButtonGroup/index';
|
|
46
|
+
import { general } from '../data/index';
|
|
47
|
+
import './style/index.less';
|
|
48
|
+
var FormItem = _Form.Item;
|
|
67
49
|
|
|
68
50
|
var StandardFilter = /*#__PURE__*/function (_React$Component) {
|
|
69
51
|
_inherits(StandardFilter, _React$Component);
|
|
@@ -76,7 +58,7 @@ var StandardFilter = /*#__PURE__*/function (_React$Component) {
|
|
|
76
58
|
_classCallCheck(this, StandardFilter);
|
|
77
59
|
|
|
78
60
|
_this = _super.call(this, props);
|
|
79
|
-
_this.filterFormRef = /*#__PURE__*/
|
|
61
|
+
_this.filterFormRef = /*#__PURE__*/React.createRef(); // 更新表单控件值,用于外部获取当前表单实例(force是否强制清空表单)
|
|
80
62
|
|
|
81
63
|
_this.updateFormFields = function (newVal, force) {
|
|
82
64
|
var getFormFields = _this.props.getFormFields;
|
|
@@ -104,7 +86,7 @@ var StandardFilter = /*#__PURE__*/function (_React$Component) {
|
|
|
104
86
|
// delete values.false // TODO 自定义结构会莫名的出来一个false字段
|
|
105
87
|
// }
|
|
106
88
|
|
|
107
|
-
var resultValues = (
|
|
89
|
+
var resultValues = UtilValueFormat(values, formItemGroup);
|
|
108
90
|
|
|
109
91
|
if (onFilterSearch) {
|
|
110
92
|
onFilterSearch(Object.assign({}, resultValues));
|
|
@@ -147,16 +129,16 @@ var StandardFilter = /*#__PURE__*/function (_React$Component) {
|
|
|
147
129
|
var reFormItemGroup = _this.state.reFormItemGroup;
|
|
148
130
|
|
|
149
131
|
if (Array.isArray(reFormItemGroup)) {
|
|
150
|
-
return /*#__PURE__*/
|
|
132
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, reFormItemGroup.map(function (item, index) {
|
|
151
133
|
var componentStyle = item.componentStyle,
|
|
152
134
|
isHide = item.isHide;
|
|
153
135
|
if (_this.itemIsHide(isHide)) return null;
|
|
154
|
-
return /*#__PURE__*/
|
|
136
|
+
return /*#__PURE__*/React.createElement(FormItem, Object.assign({
|
|
155
137
|
key: item.filedName,
|
|
156
138
|
label: item.label,
|
|
157
139
|
name: item.type !== 'custom' && item.filedName,
|
|
158
140
|
rules: item.rules || (item.fieldOptions ? item.fieldOptions.rules : [])
|
|
159
|
-
}, item.protoFormItem), item.type === 'custom' && item.customRender ? item.customRender(_this.filterFormRef, Object.assign({}, item)) : /*#__PURE__*/
|
|
141
|
+
}, item.protoFormItem), item.type === 'custom' && item.customRender ? item.customRender(_this.filterFormRef, Object.assign({}, item)) : /*#__PURE__*/React.createElement(FieldComponent, Object.assign({}, item, {
|
|
160
142
|
onChange: function onChange(val) {
|
|
161
143
|
var updateValue = val;
|
|
162
144
|
|
|
@@ -177,7 +159,7 @@ var StandardFilter = /*#__PURE__*/function (_React$Component) {
|
|
|
177
159
|
if (item.onChange) item.onChange.apply(item, [val, _this.filterFormRef].concat(otherParams));
|
|
178
160
|
},
|
|
179
161
|
style: Object.assign({
|
|
180
|
-
width: item.type === 'checkbox' || item.type === 'radio' ? 'auto' :
|
|
162
|
+
width: item.type === 'checkbox' || item.type === 'radio' ? 'auto' : general.formItemStyle.xsm.width
|
|
181
163
|
}, componentStyle)
|
|
182
164
|
})));
|
|
183
165
|
}));
|
|
@@ -223,30 +205,30 @@ var StandardFilter = /*#__PURE__*/function (_React$Component) {
|
|
|
223
205
|
confirmText = _this$props2.confirmText,
|
|
224
206
|
cancelText = _this$props2.cancelText; // const { recombinationGroup } = this.state;
|
|
225
207
|
|
|
226
|
-
return /*#__PURE__*/
|
|
208
|
+
return /*#__PURE__*/React.createElement(_Form, {
|
|
227
209
|
name: "standard-filter-form",
|
|
228
210
|
ref: this.filterFormRef,
|
|
229
211
|
layout: "inline",
|
|
230
212
|
onFinish: this.handleSearch,
|
|
231
213
|
className: className,
|
|
232
214
|
style: style
|
|
233
|
-
}, /*#__PURE__*/
|
|
215
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
234
216
|
className: "filter-grid"
|
|
235
|
-
}, /*#__PURE__*/
|
|
217
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
236
218
|
className: "filter-form"
|
|
237
|
-
}, this.state.reFormItemGroup ? /*#__PURE__*/
|
|
219
|
+
}, this.state.reFormItemGroup ? /*#__PURE__*/React.createElement(React.Fragment, null, this.renderFormItemGroup(), /*#__PURE__*/React.createElement(FormItem, null, /*#__PURE__*/React.createElement(_Button, {
|
|
238
220
|
type: "primary",
|
|
239
221
|
htmlType: "submit"
|
|
240
|
-
}, " ", confirmText || '查询'), onFilterReset && /*#__PURE__*/
|
|
222
|
+
}, " ", confirmText || '查询'), onFilterReset && /*#__PURE__*/React.createElement(_Button, {
|
|
241
223
|
type: "primary",
|
|
242
224
|
style: {
|
|
243
225
|
marginLeft: 8
|
|
244
226
|
},
|
|
245
227
|
onClick: this.handleReset,
|
|
246
228
|
ghost: true
|
|
247
|
-
}, cancelText || '重置'))) : null), buttonGroup && buttonGroup.length > 0 ? /*#__PURE__*/
|
|
229
|
+
}, cancelText || '重置'))) : null), buttonGroup && buttonGroup.length > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
248
230
|
className: "filter-btns"
|
|
249
|
-
}, /*#__PURE__*/
|
|
231
|
+
}, /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
250
232
|
options: buttonGroup,
|
|
251
233
|
min: min,
|
|
252
234
|
codes: codes,
|
|
@@ -266,7 +248,6 @@ var StandardFilter = /*#__PURE__*/function (_React$Component) {
|
|
|
266
248
|
}]);
|
|
267
249
|
|
|
268
250
|
return StandardFilter;
|
|
269
|
-
}(
|
|
251
|
+
}(React.Component);
|
|
270
252
|
|
|
271
|
-
|
|
272
|
-
exports["default"] = _default;
|
|
253
|
+
export default StandardFilter;
|
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
|
|
8
|
-
require("antd/es/button/style");
|
|
9
|
-
|
|
10
|
-
var _button = _interopRequireDefault(require("antd/es/button"));
|
|
11
|
-
|
|
12
|
-
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
|
-
var _IconNode = _interopRequireDefault(require("../components/IconNode"));
|
|
15
|
-
|
|
16
|
-
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 React from 'react';
|
|
4
|
+
import IconNode from "../components/IconNode";
|
|
17
5
|
|
|
18
6
|
var ActionList = function ActionList(props) {
|
|
19
7
|
var list = props.list,
|
|
@@ -22,16 +10,16 @@ var ActionList = function ActionList(props) {
|
|
|
22
10
|
align = _props$align === void 0 ? 'default' : _props$align,
|
|
23
11
|
other = props.other,
|
|
24
12
|
onStep = props.onStep;
|
|
25
|
-
return /*#__PURE__*/
|
|
13
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
26
14
|
className: "standardForm-actions",
|
|
27
15
|
style: {
|
|
28
16
|
textAlign: !align || align === 'default' ? 'inherit' : align
|
|
29
17
|
}
|
|
30
18
|
}, list.map(function (item, index) {
|
|
31
|
-
return /*#__PURE__*/
|
|
19
|
+
return /*#__PURE__*/React.createElement(_Button, {
|
|
32
20
|
key: index,
|
|
33
21
|
type: item.type ? item.type : 'primary',
|
|
34
|
-
icon: /*#__PURE__*/
|
|
22
|
+
icon: /*#__PURE__*/React.createElement(IconNode, {
|
|
35
23
|
icon: item.icon
|
|
36
24
|
}),
|
|
37
25
|
ghost: item.ghost,
|
|
@@ -53,5 +41,4 @@ var ActionList = function ActionList(props) {
|
|
|
53
41
|
}));
|
|
54
42
|
};
|
|
55
43
|
|
|
56
|
-
|
|
57
|
-
exports["default"] = _default;
|
|
44
|
+
export default ActionList;
|
|
@@ -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;
|