fan-standard-comp 3.1.2 → 3.1.4
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/package.json +1 -1
- package/dist/f26952c118ab6cdcd23dc0028ee98c11.svg +0 -173
- package/dist/fan-standard-comp.umd.js +0 -597
- package/dist/fonts/iconfont.eot +0 -0
- package/dist/fonts/iconfont.ttf +0 -0
- package/dist/fonts/iconfont.woff +0 -0
- package/es/ButtonGroup/ButtonList.d.ts +0 -2
- package/es/ButtonGroup/ButtonList.js +0 -37
- package/es/ButtonGroup/ButtonMenu.d.ts +0 -2
- package/es/ButtonGroup/ButtonMenu.js +0 -38
- package/es/ButtonGroup/PopConfirmTitle.d.ts +0 -9
- package/es/ButtonGroup/PopConfirmTitle.js +0 -37
- package/es/ButtonGroup/index.d.ts +0 -30
- package/es/ButtonGroup/index.js +0 -374
- package/es/ButtonGroup/style/index.less +0 -36
- package/es/DragContent/DragBar.js +0 -21
- package/es/DragContent/index.d.ts +0 -14
- package/es/DragContent/index.js +0 -173
- package/es/DragContent/index.less +0 -44
- package/es/FormComp/ChunkUploader/api.js +0 -76
- package/es/FormComp/ChunkUploader/index.js +0 -391
- package/es/FormComp/ChunkUploader/lib.js +0 -96
- package/es/FormComp/ChunkUploader/style/style.less +0 -3
- package/es/FormComp/ChunkUploader/upload-queue.class.js +0 -167
- package/es/FormComp/ChunkUploader/worker.js +0 -23
- package/es/FormComp/EditButton/index.d.ts +0 -26
- package/es/FormComp/EditButton/index.js +0 -140
- package/es/FormComp/FieldComponent/ReUpload.d.ts +0 -3
- package/es/FormComp/FieldComponent/ReUpload.js +0 -131
- package/es/FormComp/FieldComponent/RefactorTreeSelect.js +0 -245
- package/es/FormComp/FieldComponent/TitleNode.d.ts +0 -6
- package/es/FormComp/FieldComponent/TitleNode.js +0 -9
- package/es/FormComp/FieldComponent/index.d.ts +0 -38
- package/es/FormComp/FieldComponent/index.js +0 -413
- package/es/FormComp/FieldComponent/setReadonlyValues.js +0 -236
- package/es/FormComp/FieldComponent/style/index.less +0 -116
- package/es/FormComp/RenderItemGroup/index.d.ts +0 -37
- package/es/FormComp/RenderItemGroup/index.js +0 -234
- package/es/FormComp/Uploader/index.d.ts +0 -19
- package/es/FormComp/Uploader/index.js +0 -275
- package/es/FormComp/Uploader/style/index.less +0 -14
- package/es/FormComp/Uploader/util.d.ts +0 -8
- package/es/FormComp/Uploader/util.js +0 -38
- package/es/FormComp/VarTemplate/index.js +0 -293
- package/es/FormComp/index.d.ts +0 -1
- package/es/FormComp/index.js +0 -1
- package/es/NavLeafScroll/index.js +0 -379
- package/es/NavLeafScroll/style/index.less +0 -119
- package/es/RefactorTree/data.d.ts +0 -7
- package/es/RefactorTree/index.d.ts +0 -40
- package/es/RefactorTree/index.js +0 -167
- package/es/RefactorTree/indexTreeNode.d.ts +0 -39
- package/es/RefactorTree/indexTreeNode.js +0 -237
- package/es/RefactorTree/style/index.d.ts +0 -1
- package/es/RefactorTree/style/index.js +0 -1
- package/es/RefactorTree/style/index.less +0 -22
- package/es/RefactorTree/util.d.ts +0 -42
- package/es/RefactorTree/util.js +0 -187
- package/es/SpecIcon/fonts/demo.css +0 -539
- package/es/SpecIcon/fonts/demo_index.html +0 -1315
- package/es/SpecIcon/fonts/iconfont.css +0 -211
- package/es/SpecIcon/fonts/iconfont.eot +0 -0
- package/es/SpecIcon/fonts/iconfont.js +0 -41
- package/es/SpecIcon/fonts/iconfont.json +0 -352
- package/es/SpecIcon/fonts/iconfont.svg +0 -173
- package/es/SpecIcon/fonts/iconfont.ttf +0 -0
- package/es/SpecIcon/fonts/iconfont.woff +0 -0
- package/es/SpecIcon/fonts/iconfont.woff2 +0 -0
- package/es/SpecIcon/index.d.ts +0 -17
- package/es/SpecIcon/index.js +0 -77
- package/es/SpecIcon/style/iconfont.less +0 -213
- package/es/SpecIcon/style/index.less +0 -98
- package/es/SplitterLayout/Pane.d.ts +0 -13
- package/es/SplitterLayout/Pane.js +0 -36
- package/es/SplitterLayout/index.js +0 -375
- package/es/SplitterLayout/index.less +0 -58
- package/es/StandardContent/SplitterLayout/Pane.js +0 -50
- package/es/StandardContent/SplitterLayout/index.js +0 -374
- package/es/StandardContent/SplitterLayout/index.less +0 -58
- package/es/StandardContent/SubfieldContent.d.ts +0 -17
- package/es/StandardContent/SubfieldContent.js +0 -41
- package/es/StandardContent/WrapperContent.d.ts +0 -13
- package/es/StandardContent/WrapperContent.js +0 -29
- package/es/StandardContent/data.d.ts +0 -101
- package/es/StandardContent/style/index.less +0 -80
- package/es/StandardDragModal/index.d.ts +0 -11
- package/es/StandardDragModal/index.js +0 -30
- package/es/StandardFilter/index.d.ts +0 -35
- package/es/StandardFilter/index.js +0 -253
- package/es/StandardFilter/style/index.less +0 -62
- package/es/StandardForm/ActionList.js +0 -44
- package/es/StandardForm/StepForm.d.ts +0 -19
- package/es/StandardForm/StepForm.js +0 -267
- package/es/StandardForm/TabForm.d.ts +0 -19
- package/es/StandardForm/TabForm.js +0 -122
- package/es/StandardForm/index.d.ts +0 -32
- package/es/StandardForm/index.js +0 -170
- package/es/StandardForm/style/index.less +0 -58
- package/es/StandardModal/UpdateFormRef.js +0 -18
- package/es/StandardModal/index.d.ts +0 -44
- package/es/StandardModal/index.js +0 -495
- package/es/StandardModal/style/index.less +0 -50
- package/es/StandardPanel/index.d.ts +0 -28
- package/es/StandardPanel/index.js +0 -134
- package/es/StandardPanel/style/index.less +0 -135
- package/es/StandardTable/index.d.ts +0 -22
- package/es/StandardTable/index.js +0 -126
- package/es/StandardTable/style/index.d.ts +0 -1
- package/es/StandardTable/style/index.js +0 -1
- package/es/StandardTable/style/index.less +0 -206
- package/es/components/IconNode/index.d.ts +0 -16
- package/es/components/IconNode/index.js +0 -28
- package/es/components/index.d.ts +0 -2
- package/es/components/index.js +0 -2
- package/es/data/func.code.js +0 -112
- package/es/data/general.config.js +0 -172
- package/es/data/index.js +0 -3
- package/es/index.d.ts +0 -24
- package/es/index.js +0 -31
- package/es/styles/index.less +0 -0
- package/es/theme/spec-variable.less +0 -48
- package/es/utils/ValueFormat.js +0 -50
- package/es/utils/filterPermission.js +0 -111
- package/es/utils/getParentNodes.js +0 -215
- package/es/utils/index.js +0 -3
- package/lib/ButtonGroup/ButtonList.d.ts +0 -2
- package/lib/ButtonGroup/ButtonList.js +0 -55
- package/lib/ButtonGroup/ButtonMenu.d.ts +0 -2
- package/lib/ButtonGroup/ButtonMenu.js +0 -51
- package/lib/ButtonGroup/PopConfirmTitle.d.ts +0 -9
- package/lib/ButtonGroup/PopConfirmTitle.js +0 -48
- package/lib/ButtonGroup/index.d.ts +0 -30
- package/lib/ButtonGroup/index.js +0 -405
- package/lib/ButtonGroup/style/index.less +0 -36
- package/lib/DragContent/DragBar.js +0 -33
- package/lib/DragContent/index.d.ts +0 -14
- package/lib/DragContent/index.js +0 -191
- package/lib/DragContent/index.less +0 -44
- package/lib/FormComp/ChunkUploader/api.js +0 -89
- package/lib/FormComp/ChunkUploader/index.js +0 -410
- package/lib/FormComp/ChunkUploader/lib.js +0 -113
- package/lib/FormComp/ChunkUploader/style/style.less +0 -3
- package/lib/FormComp/ChunkUploader/upload-queue.class.js +0 -174
- package/lib/FormComp/ChunkUploader/worker.js +0 -28
- package/lib/FormComp/EditButton/index.d.ts +0 -26
- package/lib/FormComp/EditButton/index.js +0 -159
- package/lib/FormComp/FieldComponent/ReUpload.d.ts +0 -3
- package/lib/FormComp/FieldComponent/ReUpload.js +0 -151
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +0 -268
- package/lib/FormComp/FieldComponent/TitleNode.d.ts +0 -6
- package/lib/FormComp/FieldComponent/TitleNode.js +0 -19
- package/lib/FormComp/FieldComponent/index.d.ts +0 -38
- package/lib/FormComp/FieldComponent/index.js +0 -457
- package/lib/FormComp/FieldComponent/setReadonlyValues.js +0 -263
- package/lib/FormComp/FieldComponent/style/index.less +0 -116
- package/lib/FormComp/RenderItemGroup/index.d.ts +0 -37
- package/lib/FormComp/RenderItemGroup/index.js +0 -255
- package/lib/FormComp/Uploader/index.d.ts +0 -19
- package/lib/FormComp/Uploader/index.js +0 -301
- package/lib/FormComp/Uploader/style/index.less +0 -14
- package/lib/FormComp/Uploader/util.d.ts +0 -8
- package/lib/FormComp/Uploader/util.js +0 -47
- package/lib/FormComp/VarTemplate/index.js +0 -308
- package/lib/FormComp/index.d.ts +0 -1
- package/lib/FormComp/index.js +0 -15
- package/lib/NavLeafScroll/index.js +0 -397
- package/lib/NavLeafScroll/style/index.less +0 -119
- package/lib/RefactorTree/data.d.ts +0 -7
- package/lib/RefactorTree/index.d.ts +0 -40
- package/lib/RefactorTree/index.js +0 -190
- package/lib/RefactorTree/indexTreeNode.d.ts +0 -39
- package/lib/RefactorTree/indexTreeNode.js +0 -260
- package/lib/RefactorTree/style/index.d.ts +0 -1
- package/lib/RefactorTree/style/index.js +0 -3
- package/lib/RefactorTree/style/index.less +0 -22
- package/lib/RefactorTree/util.d.ts +0 -42
- package/lib/RefactorTree/util.js +0 -195
- package/lib/SpecIcon/fonts/demo.css +0 -539
- package/lib/SpecIcon/fonts/demo_index.html +0 -1315
- package/lib/SpecIcon/fonts/iconfont.css +0 -211
- package/lib/SpecIcon/fonts/iconfont.eot +0 -0
- package/lib/SpecIcon/fonts/iconfont.js +0 -43
- package/lib/SpecIcon/fonts/iconfont.json +0 -352
- package/lib/SpecIcon/fonts/iconfont.svg +0 -173
- package/lib/SpecIcon/fonts/iconfont.ttf +0 -0
- package/lib/SpecIcon/fonts/iconfont.woff +0 -0
- package/lib/SpecIcon/fonts/iconfont.woff2 +0 -0
- package/lib/SpecIcon/index.d.ts +0 -17
- package/lib/SpecIcon/index.js +0 -90
- package/lib/SpecIcon/style/iconfont.less +0 -213
- package/lib/SpecIcon/style/index.less +0 -98
- package/lib/SplitterLayout/Pane.d.ts +0 -13
- package/lib/SplitterLayout/Pane.js +0 -48
- package/lib/SplitterLayout/index.js +0 -386
- package/lib/SplitterLayout/index.less +0 -58
- package/lib/StandardContent/SplitterLayout/Pane.js +0 -62
- package/lib/StandardContent/SplitterLayout/index.js +0 -387
- package/lib/StandardContent/SplitterLayout/index.less +0 -58
- package/lib/StandardContent/SubfieldContent.d.ts +0 -17
- package/lib/StandardContent/SubfieldContent.js +0 -56
- package/lib/StandardContent/WrapperContent.d.ts +0 -13
- package/lib/StandardContent/WrapperContent.js +0 -43
- package/lib/StandardContent/data.d.ts +0 -101
- package/lib/StandardContent/style/index.less +0 -80
- package/lib/StandardDragModal/index.d.ts +0 -11
- package/lib/StandardDragModal/index.js +0 -43
- package/lib/StandardFilter/index.d.ts +0 -35
- package/lib/StandardFilter/index.js +0 -272
- package/lib/StandardFilter/style/index.less +0 -62
- package/lib/StandardForm/ActionList.js +0 -57
- package/lib/StandardForm/StepForm.d.ts +0 -19
- package/lib/StandardForm/StepForm.js +0 -295
- package/lib/StandardForm/TabForm.d.ts +0 -19
- package/lib/StandardForm/TabForm.js +0 -148
- package/lib/StandardForm/index.d.ts +0 -32
- package/lib/StandardForm/index.js +0 -197
- package/lib/StandardForm/style/index.less +0 -58
- package/lib/StandardModal/UpdateFormRef.js +0 -32
- package/lib/StandardModal/index.d.ts +0 -44
- package/lib/StandardModal/index.js +0 -525
- package/lib/StandardModal/style/index.less +0 -50
- package/lib/StandardPanel/index.d.ts +0 -28
- package/lib/StandardPanel/index.js +0 -155
- package/lib/StandardPanel/style/index.less +0 -135
- package/lib/StandardTable/index.d.ts +0 -22
- package/lib/StandardTable/index.js +0 -143
- package/lib/StandardTable/style/index.d.ts +0 -1
- package/lib/StandardTable/style/index.js +0 -3
- package/lib/StandardTable/style/index.less +0 -206
- package/lib/components/IconNode/index.d.ts +0 -16
- package/lib/components/IconNode/index.js +0 -39
- package/lib/components/index.d.ts +0 -2
- package/lib/components/index.js +0 -15
- package/lib/data/func.code.js +0 -119
- package/lib/data/general.config.js +0 -179
- package/lib/data/index.js +0 -23
- package/lib/index.d.ts +0 -24
- package/lib/index.js +0 -236
- package/lib/styles/index.less +0 -0
- package/lib/theme/spec-variable.less +0 -48
- package/lib/utils/ValueFormat.js +0 -58
- package/lib/utils/filterPermission.js +0 -127
- package/lib/utils/getParentNodes.js +0 -226
- package/lib/utils/index.js +0 -35
|
@@ -1,295 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
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
|
-
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 }; }
|
|
37
|
-
|
|
38
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
39
|
-
|
|
40
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
41
|
-
|
|
42
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
43
|
-
|
|
44
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
45
|
-
|
|
46
|
-
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
47
|
-
|
|
48
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
49
|
-
|
|
50
|
-
// import { BreadcrumbProps as AntdBreadcrumbProps } from 'antd/es/form';
|
|
51
|
-
var Step = _steps.default.Step;
|
|
52
|
-
|
|
53
|
-
var StepForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
54
|
-
var getFormFields = props.getFormFields,
|
|
55
|
-
_props$formItemGroup = props.formItemGroup,
|
|
56
|
-
formItemGroup = _props$formItemGroup === void 0 ? [] : _props$formItemGroup,
|
|
57
|
-
grid = props.grid,
|
|
58
|
-
layout = props.layout,
|
|
59
|
-
onSubmit = props.onSubmit,
|
|
60
|
-
_props$actionAlign = props.actionAlign,
|
|
61
|
-
actionAlign = _props$actionAlign === void 0 ? 'center' : _props$actionAlign,
|
|
62
|
-
fieldStatus = props.fieldStatus,
|
|
63
|
-
_props$fieldSize = props.fieldSize,
|
|
64
|
-
fieldSize = _props$fieldSize === void 0 ? "middle" : _props$fieldSize,
|
|
65
|
-
initialValues = props.initialValues,
|
|
66
|
-
actionHide = props.actionHide,
|
|
67
|
-
_props$stepsConfig = props.stepsConfig,
|
|
68
|
-
stepsConfig = _props$stepsConfig === void 0 ? {
|
|
69
|
-
current: 0
|
|
70
|
-
} : _props$stepsConfig,
|
|
71
|
-
stepClick = props.stepClick,
|
|
72
|
-
displayLayout = props.displayLayout;
|
|
73
|
-
|
|
74
|
-
var _useState = (0, _react.useState)(),
|
|
75
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
76
|
-
formChildFields = _useState2[0],
|
|
77
|
-
setFormChildFields = _useState2[1];
|
|
78
|
-
|
|
79
|
-
var _useState3 = (0, _react.useState)(),
|
|
80
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
81
|
-
formChild = _useState4[0],
|
|
82
|
-
setFormChild = _useState4[1];
|
|
83
|
-
|
|
84
|
-
var _useState5 = (0, _react.useState)(0),
|
|
85
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
86
|
-
currentStep = _useState6[0],
|
|
87
|
-
setCurrentStep = _useState6[1]; // const [fieldFailed, setFieldFailed] = useState(false)
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
(0, _react.useEffect)(function () {
|
|
91
|
-
if (stepsConfig && (stepsConfig.current || stepsConfig.current === 0)) {
|
|
92
|
-
setCurrentStep(stepsConfig.current); // 判断是否有设置当前选中的步骤数
|
|
93
|
-
}
|
|
94
|
-
}, [stepsConfig]);
|
|
95
|
-
if (formItemGroup.length === 0) return null;
|
|
96
|
-
var formGridSize = (0, _react.useMemo)(function () {
|
|
97
|
-
if (typeof grid === 'string') return grid; // 数据格式为字符串,包括 xs,md,lg,xlg
|
|
98
|
-
|
|
99
|
-
var sizeName = 'xs';
|
|
100
|
-
if (grid <= 1) sizeName = 'xs';
|
|
101
|
-
if (grid === 2) sizeName = 'md';
|
|
102
|
-
if (grid === 3) sizeName = 'lg';
|
|
103
|
-
if (grid > 3) sizeName = 'xlg';
|
|
104
|
-
return sizeName;
|
|
105
|
-
}, [grid]);
|
|
106
|
-
(0, _react.useEffect)(function () {
|
|
107
|
-
forceUpdateForm();
|
|
108
|
-
}, [formChildFields, formChild]);
|
|
109
|
-
|
|
110
|
-
var forceUpdateForm = function forceUpdateForm() {
|
|
111
|
-
getFormFields && getFormFields(formChildFields, formChild);
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
var handleStepType = function handleStepType(type, extraFunc) {
|
|
115
|
-
switch (type) {
|
|
116
|
-
case 'submit':
|
|
117
|
-
case 'next':
|
|
118
|
-
// 获取当前步骤的表单配置下有 rules 的控件进行校验(自定义的控件则自己有业务层面处理添加校验)
|
|
119
|
-
var curentFields = formItemGroup[currentStep].fields;
|
|
120
|
-
var valitorGroup = curentFields && Array.isArray(curentFields) ? curentFields.filter(function (fItem) {
|
|
121
|
-
return fItem.rules;
|
|
122
|
-
}).map(function (matchItem) {
|
|
123
|
-
return matchItem.filedName;
|
|
124
|
-
}) : [];
|
|
125
|
-
formChild && formChild.validateFields(valitorGroup).then(function (values) {
|
|
126
|
-
if (stepClick) stepClick(type, formChild, values);
|
|
127
|
-
extraFunc && extraFunc();
|
|
128
|
-
}).catch(function (_ref) {// console.log('表单校验不通过 ', errorFields.map(err => err))
|
|
129
|
-
|
|
130
|
-
var errorFields = _ref.errorFields;
|
|
131
|
-
});
|
|
132
|
-
break;
|
|
133
|
-
|
|
134
|
-
case 'prev':
|
|
135
|
-
if (stepClick) stepClick(type, formChild);
|
|
136
|
-
extraFunc && extraFunc();
|
|
137
|
-
break;
|
|
138
|
-
|
|
139
|
-
case 'cancel':
|
|
140
|
-
if (stepClick) stepClick(type, formChild);
|
|
141
|
-
extraFunc && extraFunc();
|
|
142
|
-
break;
|
|
143
|
-
|
|
144
|
-
default:
|
|
145
|
-
break;
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
/* const handleStepChange = (cur:any) => {
|
|
149
|
-
// 自行判断是否校验通过
|
|
150
|
-
/!* if (cur > current) {
|
|
151
|
-
formChild.validateFields()
|
|
152
|
-
.then(values => {
|
|
153
|
-
if (stepsConfig && stepsConfig.onChange) stepsConfig.onChange(cur, formChild);
|
|
154
|
-
})
|
|
155
|
-
.catch(errorInfo => {
|
|
156
|
-
});
|
|
157
|
-
} else {
|
|
158
|
-
if (stepsConfig && stepsConfig.onChange) stepsConfig.onChange(cur, formChild);
|
|
159
|
-
}*!/
|
|
160
|
-
if (stepsConfig && stepsConfig.onChange) stepsConfig.onChange(cur, formChild);
|
|
161
|
-
}*/
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
var renderStepActions = function renderStepActions(item, index) {
|
|
165
|
-
if (formItemGroup.length === 1) {
|
|
166
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
167
|
-
className: "standardForm-actions",
|
|
168
|
-
key: index
|
|
169
|
-
}, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
170
|
-
type: "primary",
|
|
171
|
-
htmlType: "submit",
|
|
172
|
-
onClick: function onClick() {
|
|
173
|
-
return handleStepType('submit');
|
|
174
|
-
}
|
|
175
|
-
}, "\u786E\u8BA4"), /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
176
|
-
onClick: function onClick() {
|
|
177
|
-
return handleStepType('cancel');
|
|
178
|
-
}
|
|
179
|
-
}, "\u53D6\u6D88"));
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
var buttonList = function buttonList(itemIndex) {
|
|
183
|
-
if (itemIndex === 0) {
|
|
184
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
185
|
-
type: "primary",
|
|
186
|
-
onClick: function onClick() {
|
|
187
|
-
return handleStepType('next');
|
|
188
|
-
}
|
|
189
|
-
}, "\u4E0B\u4E00\u6B65"), /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
190
|
-
onClick: function onClick() {
|
|
191
|
-
return handleStepType('cancel');
|
|
192
|
-
}
|
|
193
|
-
}, "\u53D6\u6D88"));
|
|
194
|
-
} else if (itemIndex === formItemGroup.length - 1) {
|
|
195
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
196
|
-
type: "primary",
|
|
197
|
-
onClick: function onClick() {
|
|
198
|
-
return handleStepType('prev');
|
|
199
|
-
}
|
|
200
|
-
}, "\u4E0A\u4E00\u6B65"), /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
201
|
-
type: "primary",
|
|
202
|
-
htmlType: "submit",
|
|
203
|
-
onClick: function onClick() {
|
|
204
|
-
return handleStepType('submit');
|
|
205
|
-
}
|
|
206
|
-
}, "\u786E\u8BA4"), /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
207
|
-
onClick: function onClick() {
|
|
208
|
-
return handleStepType('cancel');
|
|
209
|
-
}
|
|
210
|
-
}, "\u53D6\u6D88"));
|
|
211
|
-
} else {
|
|
212
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
213
|
-
type: "primary",
|
|
214
|
-
onClick: function onClick() {
|
|
215
|
-
return handleStepType('prev');
|
|
216
|
-
}
|
|
217
|
-
}, "\u4E0A\u4E00\u6B65"), /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
218
|
-
type: "primary",
|
|
219
|
-
onClick: function onClick() {
|
|
220
|
-
return handleStepType('next');
|
|
221
|
-
}
|
|
222
|
-
}, "\u4E0B\u4E00\u6B65"), /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
223
|
-
onClick: function onClick() {
|
|
224
|
-
return handleStepType('cancel');
|
|
225
|
-
}
|
|
226
|
-
}, "\u53D6\u6D88"));
|
|
227
|
-
}
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
231
|
-
className: "standardForm-actions",
|
|
232
|
-
key: index,
|
|
233
|
-
style: {
|
|
234
|
-
textAlign: actionAlign
|
|
235
|
-
}
|
|
236
|
-
}, buttonList(index));
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
240
|
-
className: layout === 'inline' ? '' : '',
|
|
241
|
-
actionGroup: [],
|
|
242
|
-
ref: ref,
|
|
243
|
-
fieldSize: fieldSize,
|
|
244
|
-
initialValues: initialValues,
|
|
245
|
-
// @ts-ignore
|
|
246
|
-
getFormFields: function getFormFields(fields, form) {
|
|
247
|
-
setFormChildFields(fields);
|
|
248
|
-
setFormChild(form);
|
|
249
|
-
},
|
|
250
|
-
onSubmit: onSubmit,
|
|
251
|
-
layout: layout,
|
|
252
|
-
onFinishFailed: function onFinishFailed() {// setFieldFailed(true)
|
|
253
|
-
}
|
|
254
|
-
}, /*#__PURE__*/_react.default.createElement(_steps.default, Object.assign({}, stepsConfig), formItemGroup.map(function (item, index) {
|
|
255
|
-
return !item.hideStep ? /*#__PURE__*/_react.default.createElement(Step, {
|
|
256
|
-
key: "".concat(item.title).concat(index),
|
|
257
|
-
description: item.description,
|
|
258
|
-
icon: item.icon,
|
|
259
|
-
status: item.status,
|
|
260
|
-
title: item.title,
|
|
261
|
-
subTitle: item.subTitle,
|
|
262
|
-
disabled: item.disabled
|
|
263
|
-
}) : null;
|
|
264
|
-
})), formItemGroup.map(function (item, index) {
|
|
265
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
266
|
-
key: index,
|
|
267
|
-
className: "stepForm-content ".concat(layout === 'inline' ? 'stepForm-content-inline' : ''),
|
|
268
|
-
style: stepsConfig && stepsConfig.current !== index ? {
|
|
269
|
-
display: 'none'
|
|
270
|
-
} : {}
|
|
271
|
-
}, item.fields && Array.isArray(item.fields) ? /*#__PURE__*/_react.default.createElement(_RenderItemGroup.default, {
|
|
272
|
-
layout: layout,
|
|
273
|
-
form: formChild,
|
|
274
|
-
fieldStatus: fieldStatus,
|
|
275
|
-
size: formGridSize,
|
|
276
|
-
displayLayout: displayLayout,
|
|
277
|
-
doUpdateFormFields: function doUpdateFormFields() {
|
|
278
|
-
return forceUpdateForm();
|
|
279
|
-
},
|
|
280
|
-
// doUpdateFormFields={() => console.log('强制渲染表单')}
|
|
281
|
-
itemGroup: item.fields
|
|
282
|
-
}) : item.fields, !actionHide && /*#__PURE__*/_react.default.createElement(_col.default, {
|
|
283
|
-
span: 24
|
|
284
|
-
}, item.actions ? /*#__PURE__*/_react.default.createElement(_ActionList.default, {
|
|
285
|
-
list: item.actions,
|
|
286
|
-
onStep: handleStepType,
|
|
287
|
-
form: formChild,
|
|
288
|
-
align: actionAlign,
|
|
289
|
-
other: props
|
|
290
|
-
}) : renderStepActions(item, index)));
|
|
291
|
-
}));
|
|
292
|
-
});
|
|
293
|
-
|
|
294
|
-
var _default = StepForm;
|
|
295
|
-
exports.default = _default;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './style/index.less';
|
|
3
|
-
import { ItemGroupProps, StandardFormProps } from './index';
|
|
4
|
-
export interface TabItemGroupProps extends ItemGroupProps {
|
|
5
|
-
icon?: any;
|
|
6
|
-
hideStep?: boolean;
|
|
7
|
-
title?: any;
|
|
8
|
-
status?: any;
|
|
9
|
-
subTitle?: any;
|
|
10
|
-
disabled?: any;
|
|
11
|
-
key?: string;
|
|
12
|
-
}
|
|
13
|
-
export interface TabFormProp extends StandardFormProps {
|
|
14
|
-
tabsConfig?: any;
|
|
15
|
-
actionHide?: boolean;
|
|
16
|
-
formItemGroup?: TabItemGroupProps[];
|
|
17
|
-
}
|
|
18
|
-
declare const TabForm: React.ForwardRefExoticComponent<Pick<TabFormProp, string | number> & React.RefAttributes<unknown>>;
|
|
19
|
-
export default TabForm;
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
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
|
-
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 }; }
|
|
35
|
-
|
|
36
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
37
|
-
|
|
38
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
39
|
-
|
|
40
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
41
|
-
|
|
42
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
43
|
-
|
|
44
|
-
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
45
|
-
|
|
46
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
47
|
-
|
|
48
|
-
var TabPane = _tabs.default.TabPane;
|
|
49
|
-
|
|
50
|
-
var TabForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
51
|
-
var getFormFields = props.getFormFields,
|
|
52
|
-
_props$formItemGroup = props.formItemGroup,
|
|
53
|
-
formItemGroup = _props$formItemGroup === void 0 ? [] : _props$formItemGroup,
|
|
54
|
-
grid = props.grid,
|
|
55
|
-
layout = props.layout,
|
|
56
|
-
_props$actionAlign = props.actionAlign,
|
|
57
|
-
actionAlign = _props$actionAlign === void 0 ? 'center' : _props$actionAlign,
|
|
58
|
-
actionHide = props.actionHide,
|
|
59
|
-
fieldStatus = props.fieldStatus,
|
|
60
|
-
_props$fieldSize = props.fieldSize,
|
|
61
|
-
fieldSize = _props$fieldSize === void 0 ? "middle" : _props$fieldSize,
|
|
62
|
-
onSubmit = props.onSubmit,
|
|
63
|
-
initialValues = props.initialValues,
|
|
64
|
-
tabsConfig = props.tabsConfig,
|
|
65
|
-
displayLayout = props.displayLayout;
|
|
66
|
-
|
|
67
|
-
var _useState = (0, _react.useState)(),
|
|
68
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
69
|
-
formChildFields = _useState2[0],
|
|
70
|
-
setFormChildFields = _useState2[1];
|
|
71
|
-
|
|
72
|
-
var _useState3 = (0, _react.useState)(),
|
|
73
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
74
|
-
formChild = _useState4[0],
|
|
75
|
-
setFormChild = _useState4[1]; // const [fieldFailed, setFieldFailed] = useState(false)
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
var formGridSize = (0, _react.useMemo)(function () {
|
|
79
|
-
if (typeof grid === 'string') return grid; // 数据格式为字符串,包括 xs,md,lg,xlg
|
|
80
|
-
|
|
81
|
-
var sizeName = 'xs';
|
|
82
|
-
if (grid <= 1) sizeName = 'xs';
|
|
83
|
-
if (grid === 2) sizeName = 'md';
|
|
84
|
-
if (grid === 3) sizeName = 'lg';
|
|
85
|
-
if (grid > 3) sizeName = 'xlg';
|
|
86
|
-
return sizeName;
|
|
87
|
-
}, [grid]);
|
|
88
|
-
(0, _react.useEffect)(function () {
|
|
89
|
-
forceUpdateForm();
|
|
90
|
-
}, [formChildFields, formChild]);
|
|
91
|
-
|
|
92
|
-
var forceUpdateForm = function forceUpdateForm() {
|
|
93
|
-
// console.log('TabForm强制更新表单控件')
|
|
94
|
-
getFormFields && getFormFields(formChildFields, formChild);
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
if (formItemGroup.length === 0) return null;
|
|
98
|
-
return /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
99
|
-
actionGroup: [],
|
|
100
|
-
ref: ref,
|
|
101
|
-
fieldSize: fieldSize,
|
|
102
|
-
// @ts-ignore
|
|
103
|
-
getFormFields: function getFormFields(fields, form) {
|
|
104
|
-
setFormChildFields(fields);
|
|
105
|
-
setFormChild(form);
|
|
106
|
-
},
|
|
107
|
-
layout: layout,
|
|
108
|
-
onSubmit: onSubmit,
|
|
109
|
-
initialValues: initialValues
|
|
110
|
-
}, /*#__PURE__*/_react.default.createElement(_tabs.default, Object.assign({
|
|
111
|
-
type: "card",
|
|
112
|
-
animated: false
|
|
113
|
-
}, tabsConfig), formItemGroup.map(function (item, index) {
|
|
114
|
-
var title = item.title,
|
|
115
|
-
fields = item.fields,
|
|
116
|
-
actions = item.actions,
|
|
117
|
-
tabConfig = (0, _tslib.__rest)(item, ["title", "fields", "actions"]);
|
|
118
|
-
return /*#__PURE__*/_react.default.createElement(TabPane, Object.assign({
|
|
119
|
-
key: "".concat(item.key || index),
|
|
120
|
-
tab: title
|
|
121
|
-
}, tabConfig, {
|
|
122
|
-
forceRender: true
|
|
123
|
-
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
124
|
-
className: "tabForm-content ".concat(layout === 'inline' ? 'tabForm-content-inline' : '')
|
|
125
|
-
}, fields && Array.isArray(fields) ? /*#__PURE__*/_react.default.createElement(_RenderItemGroup.default, {
|
|
126
|
-
layout: layout,
|
|
127
|
-
form: formChild,
|
|
128
|
-
fieldStatus: fieldStatus,
|
|
129
|
-
size: formGridSize,
|
|
130
|
-
displayLayout: displayLayout,
|
|
131
|
-
doUpdateFormFields: function doUpdateFormFields() {
|
|
132
|
-
return forceUpdateForm();
|
|
133
|
-
},
|
|
134
|
-
// doUpdateFormFields={() => forceUpdateForm()}
|
|
135
|
-
itemGroup: fields
|
|
136
|
-
}) : fields, !actionHide && actions && /*#__PURE__*/_react.default.createElement(_col.default, {
|
|
137
|
-
span: 24
|
|
138
|
-
}, /*#__PURE__*/_react.default.createElement(_ActionList.default, {
|
|
139
|
-
list: item.actions,
|
|
140
|
-
form: formChild,
|
|
141
|
-
other: props,
|
|
142
|
-
align: actionAlign
|
|
143
|
-
}))));
|
|
144
|
-
})));
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
var _default = TabForm;
|
|
148
|
-
exports.default = _default;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FieldsItemProps } from '../FormComp/RenderItemGroup';
|
|
3
|
-
import './style/index.less';
|
|
4
|
-
export interface ItemGroupProps extends FieldsItemProps {
|
|
5
|
-
fields?: any;
|
|
6
|
-
actions?: any;
|
|
7
|
-
[k: string]: any;
|
|
8
|
-
}
|
|
9
|
-
export interface StandardFormProps {
|
|
10
|
-
formItemGroup?: ItemGroupProps[];
|
|
11
|
-
className?: string;
|
|
12
|
-
initialValues?: any;
|
|
13
|
-
layout?: 'horizontal' | 'vertical' | 'inline';
|
|
14
|
-
grid?: number;
|
|
15
|
-
fieldSize?: 'middle' | 'large' | 'small' | any;
|
|
16
|
-
getFormFields?: (fields?: any, form?: any) => void;
|
|
17
|
-
fieldStatus?: 'default' | 'viewOnly' | 'disabled' | any;
|
|
18
|
-
onSubmit?: (values?: any) => void;
|
|
19
|
-
confirmText?: string;
|
|
20
|
-
onCancel?: () => void;
|
|
21
|
-
cancelText?: string;
|
|
22
|
-
actionAlign?: any;
|
|
23
|
-
actionGroup?: any;
|
|
24
|
-
onFinishFailed?: any;
|
|
25
|
-
children?: React.ReactNode;
|
|
26
|
-
postfix?: React.ReactNode;
|
|
27
|
-
prefix?: React.ReactNode;
|
|
28
|
-
displayLayout?: any;
|
|
29
|
-
[k: string]: any;
|
|
30
|
-
}
|
|
31
|
-
declare const StandardForm: React.ForwardRefExoticComponent<Pick<StandardFormProps, string | number> & React.RefAttributes<unknown>>;
|
|
32
|
-
export default StandardForm;
|