fan-standard-comp 3.1.9 → 3.2.0
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/Readme.md +35 -0
- package/dist/fan-standard-comp.umd.js +15 -10
- package/es/ButtonGroup/ButtonList.js +0 -3
- package/es/ButtonGroup/ButtonMenu.js +0 -3
- package/es/ButtonGroup/PopConfirmTitle.js +5 -15
- package/es/ButtonGroup/index.d.ts +2 -0
- package/es/ButtonGroup/index.js +223 -193
- package/es/ButtonGroup/style/index.less +1 -1
- package/es/DragContent/DragBar.js +2 -6
- package/es/DragContent/index.js +44 -75
- package/es/FormComp/ChunkUploader/api.js +6 -10
- package/es/FormComp/ChunkUploader/index.js +105 -171
- package/es/FormComp/ChunkUploader/lib.js +4 -17
- package/es/FormComp/ChunkUploader/upload-queue.class.js +10 -45
- package/es/FormComp/ChunkUploader/worker.js +0 -3
- package/es/FormComp/EditButton/index.js +24 -49
- package/es/FormComp/FieldComponent/ReUpload.js +18 -38
- package/es/FormComp/FieldComponent/RefactorTreeSelect.js +37 -75
- package/es/FormComp/FieldComponent/TitleNode.js +1 -3
- package/es/FormComp/FieldComponent/index.js +38 -74
- package/es/FormComp/FieldComponent/setReadonlyValues.js +34 -63
- package/es/FormComp/FieldComponent/style/index.less +6 -0
- package/es/FormComp/RenderItemGroup/index.js +46 -74
- package/es/FormComp/Uploader/index.js +36 -77
- package/es/FormComp/Uploader/util.js +0 -6
- package/es/FormComp/VarTemplate/index.js +58 -96
- package/es/NavLeafScroll/index.js +172 -154
- package/es/NavLeafScroll/style/index.less +33 -1
- package/es/RefactorTree/index.js +36 -53
- package/es/RefactorTree/indexTreeNode.js +35 -68
- package/es/RefactorTree/util.js +9 -43
- package/es/SpecIcon/fonts/iconfont.js +7 -12
- package/es/SpecIcon/index.js +16 -25
- package/es/SplitterLayout/Pane.js +2 -5
- package/es/SplitterLayout/index.js +20 -70
- package/es/StandardContent/SplitterLayout/Pane.js +6 -10
- package/es/StandardContent/SplitterLayout/index.js +12 -63
- package/es/StandardContent/SubfieldContent.js +12 -14
- package/es/StandardContent/WrapperContent.js +8 -10
- package/es/StandardDragModal/ChangeStandardModal.d.ts +44 -0
- package/es/StandardDragModal/ChangeStandardModal.js +493 -0
- package/es/StandardDragModal/DraggableModal.d.ts +7 -0
- package/es/StandardDragModal/DraggableModal.js +31 -0
- package/es/StandardDragModal/DraggableModalContext.d.ts +9 -0
- package/es/StandardDragModal/DraggableModalContext.js +5 -0
- package/es/StandardDragModal/DraggableModalInner.d.ts +16 -0
- package/es/StandardDragModal/DraggableModalInner.js +114 -0
- package/es/StandardDragModal/DraggableModalProvider.d.ts +4 -0
- package/es/StandardDragModal/DraggableModalProvider.js +40 -0
- package/es/StandardDragModal/Modal.d.ts +11 -0
- package/es/StandardDragModal/Modal.js +24 -0
- package/es/StandardDragModal/ResizeHandle.d.ts +2 -0
- package/es/StandardDragModal/ResizeHandle.js +8 -0
- package/es/StandardDragModal/clamp.d.ts +1 -0
- package/es/StandardDragModal/clamp.js +3 -0
- package/es/StandardDragModal/draggableModalReducer.d.ts +66 -0
- package/es/StandardDragModal/draggableModalReducer.js +157 -0
- package/es/StandardDragModal/getWindowSize.d.ts +4 -0
- package/es/StandardDragModal/getWindowSize.js +6 -0
- package/es/StandardDragModal/index.d.ts +3 -11
- package/es/StandardDragModal/index.js +3 -30
- package/es/StandardDragModal/index.less +65 -0
- package/es/StandardDragModal/useDrag.d.ts +5 -0
- package/es/StandardDragModal/useDrag.js +66 -0
- package/es/StandardDragModal/usePrevious.d.ts +1 -0
- package/es/StandardDragModal/usePrevious.js +8 -0
- package/es/StandardDragModal/useResize.d.ts +7 -0
- package/es/StandardDragModal/useResize.js +74 -0
- package/es/StandardFilter/index.d.ts +1 -0
- package/es/StandardFilter/index.js +32 -70
- package/es/StandardForm/ActionList.js +5 -7
- package/es/StandardForm/StepForm.js +50 -71
- package/es/StandardForm/TabForm.js +58 -70
- package/es/StandardForm/index.js +37 -56
- package/es/StandardModal/UpdateFormRef.js +1 -4
- package/es/StandardModal/index.d.ts +0 -1
- package/es/StandardModal/index.js +115 -159
- package/es/StandardPanel/index.js +19 -35
- package/es/StandardTable/index.js +20 -30
- package/es/components/IconNode/index.js +0 -4
- package/es/index.d.ts +1 -0
- package/es/index.js +15 -14
- package/es/utils/ValueFormat.js +0 -9
- package/es/utils/dictSelectUtil.js +153 -0
- package/es/utils/filterPermission.js +16 -34
- package/es/utils/getParentNodes.js +24 -47
- package/es/utils/index.js +2 -1
- package/lib/ButtonGroup/ButtonList.js +1 -13
- package/lib/ButtonGroup/ButtonMenu.js +1 -8
- package/lib/ButtonGroup/PopConfirmTitle.js +3 -16
- package/lib/ButtonGroup/index.d.ts +2 -0
- package/lib/ButtonGroup/index.js +226 -216
- package/lib/ButtonGroup/style/index.less +1 -1
- package/lib/DragContent/DragBar.js +2 -10
- package/lib/DragContent/index.js +47 -85
- package/lib/FormComp/ChunkUploader/api.js +6 -15
- package/lib/FormComp/ChunkUploader/index.js +107 -185
- package/lib/FormComp/ChunkUploader/lib.js +8 -27
- package/lib/FormComp/ChunkUploader/upload-queue.class.js +10 -46
- package/lib/FormComp/ChunkUploader/worker.js +1 -5
- package/lib/FormComp/EditButton/index.js +26 -60
- package/lib/FormComp/FieldComponent/ReUpload.js +21 -50
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +39 -90
- package/lib/FormComp/FieldComponent/TitleNode.js +1 -5
- package/lib/FormComp/FieldComponent/index.js +38 -110
- package/lib/FormComp/FieldComponent/setReadonlyValues.js +37 -79
- package/lib/FormComp/FieldComponent/style/index.less +6 -0
- package/lib/FormComp/RenderItemGroup/index.js +46 -87
- package/lib/FormComp/Uploader/index.js +38 -95
- package/lib/FormComp/Uploader/util.js +1 -9
- package/lib/FormComp/VarTemplate/index.js +62 -106
- package/lib/FormComp/index.js +0 -2
- package/lib/NavLeafScroll/index.js +174 -165
- package/lib/NavLeafScroll/style/index.less +33 -1
- package/lib/RefactorTree/index.js +36 -67
- package/lib/RefactorTree/indexTreeNode.js +37 -83
- package/lib/RefactorTree/util.js +11 -45
- package/lib/SpecIcon/fonts/iconfont.js +7 -12
- package/lib/SpecIcon/index.js +16 -30
- package/lib/SplitterLayout/Pane.js +0 -7
- package/lib/SplitterLayout/index.js +18 -72
- package/lib/StandardContent/SplitterLayout/Pane.js +6 -14
- package/lib/StandardContent/SplitterLayout/index.js +12 -68
- package/lib/StandardContent/SubfieldContent.js +12 -21
- package/lib/StandardContent/WrapperContent.js +8 -16
- package/lib/StandardDragModal/ChangeStandardModal.d.ts +44 -0
- package/lib/StandardDragModal/ChangeStandardModal.js +502 -0
- package/lib/StandardDragModal/DraggableModal.d.ts +7 -0
- package/lib/StandardDragModal/DraggableModal.js +40 -0
- package/lib/StandardDragModal/DraggableModalContext.d.ts +9 -0
- package/lib/StandardDragModal/DraggableModalContext.js +15 -0
- package/lib/StandardDragModal/DraggableModalInner.d.ts +16 -0
- package/lib/StandardDragModal/DraggableModalInner.js +124 -0
- package/lib/StandardDragModal/DraggableModalProvider.d.ts +4 -0
- package/lib/StandardDragModal/DraggableModalProvider.js +48 -0
- package/lib/StandardDragModal/Modal.d.ts +11 -0
- package/lib/StandardDragModal/Modal.js +32 -0
- package/lib/StandardDragModal/ResizeHandle.d.ts +2 -0
- package/lib/StandardDragModal/ResizeHandle.js +18 -0
- package/lib/StandardDragModal/clamp.d.ts +1 -0
- package/lib/StandardDragModal/clamp.js +10 -0
- package/lib/StandardDragModal/draggableModalReducer.d.ts +66 -0
- package/lib/StandardDragModal/draggableModalReducer.js +167 -0
- package/lib/StandardDragModal/getWindowSize.d.ts +4 -0
- package/lib/StandardDragModal/getWindowSize.js +13 -0
- package/lib/StandardDragModal/index.d.ts +3 -11
- package/lib/StandardDragModal/index.js +33 -38
- package/lib/StandardDragModal/index.less +65 -0
- package/lib/StandardDragModal/useDrag.d.ts +5 -0
- package/lib/StandardDragModal/useDrag.js +73 -0
- package/lib/StandardDragModal/usePrevious.d.ts +1 -0
- package/lib/StandardDragModal/usePrevious.js +15 -0
- package/lib/StandardDragModal/useResize.d.ts +7 -0
- package/lib/StandardDragModal/useResize.js +81 -0
- package/lib/StandardFilter/index.d.ts +1 -0
- package/lib/StandardFilter/index.js +30 -78
- package/lib/StandardForm/ActionList.js +5 -12
- package/lib/StandardForm/StepForm.js +52 -90
- package/lib/StandardForm/TabForm.js +61 -88
- package/lib/StandardForm/index.js +40 -75
- package/lib/StandardModal/UpdateFormRef.js +4 -12
- package/lib/StandardModal/index.d.ts +0 -1
- package/lib/StandardModal/index.js +117 -184
- package/lib/StandardPanel/index.js +22 -48
- package/lib/StandardTable/index.js +20 -39
- package/lib/components/IconNode/index.js +0 -7
- package/lib/components/index.js +0 -2
- package/lib/data/index.js +4 -7
- package/lib/index.d.ts +1 -0
- package/lib/index.js +50 -68
- package/lib/utils/ValueFormat.js +0 -10
- package/lib/utils/dictSelectUtil.js +161 -0
- package/lib/utils/filterPermission.js +15 -39
- package/lib/utils/getParentNodes.js +25 -52
- package/lib/utils/index.js +24 -9
- package/package.json +6 -5
|
@@ -1,92 +1,63 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
4
|
-
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
require("antd/es/col/style");
|
|
11
|
-
|
|
12
9
|
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
10
|
require("antd/es/steps/style");
|
|
19
|
-
|
|
20
11
|
var _steps = _interopRequireDefault(require("antd/es/steps"));
|
|
21
|
-
|
|
12
|
+
require("antd/es/button/style");
|
|
13
|
+
var _button = _interopRequireDefault(require("antd/es/button"));
|
|
14
|
+
var _tslib = require("tslib");
|
|
22
15
|
var _react = _interopRequireWildcard(require("react"));
|
|
23
|
-
|
|
24
16
|
var _index = _interopRequireDefault(require("./index"));
|
|
25
|
-
|
|
26
17
|
var _RenderItemGroup = _interopRequireDefault(require("../FormComp/RenderItemGroup"));
|
|
27
|
-
|
|
28
18
|
var _ActionList = _interopRequireDefault(require("./ActionList"));
|
|
29
|
-
|
|
30
19
|
require("./style/index.less");
|
|
31
|
-
|
|
32
|
-
function
|
|
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
|
-
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
|
36
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
|
-
|
|
38
23
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
39
|
-
|
|
40
24
|
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
25
|
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
26
|
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
|
-
|
|
27
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
48
28
|
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
29
|
var StepForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
54
30
|
var getFormFields = props.getFormFields,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
31
|
+
_props$formItemGroup = props.formItemGroup,
|
|
32
|
+
formItemGroup = _props$formItemGroup === void 0 ? [] : _props$formItemGroup,
|
|
33
|
+
grid = props.grid,
|
|
34
|
+
layout = props.layout,
|
|
35
|
+
onSubmit = props.onSubmit,
|
|
36
|
+
_props$actionAlign = props.actionAlign,
|
|
37
|
+
actionAlign = _props$actionAlign === void 0 ? 'center' : _props$actionAlign,
|
|
38
|
+
fieldStatus = props.fieldStatus,
|
|
39
|
+
_props$fieldSize = props.fieldSize,
|
|
40
|
+
fieldSize = _props$fieldSize === void 0 ? "middle" : _props$fieldSize,
|
|
41
|
+
initialValues = props.initialValues,
|
|
42
|
+
actionHide = props.actionHide,
|
|
43
|
+
_props$stepsConfig = props.stepsConfig,
|
|
44
|
+
stepsConfig = _props$stepsConfig === void 0 ? {
|
|
45
|
+
current: 0
|
|
46
|
+
} : _props$stepsConfig,
|
|
47
|
+
stepClick = props.stepClick,
|
|
48
|
+
displayLayout = props.displayLayout;
|
|
74
49
|
var _useState = (0, _react.useState)(),
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
50
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
51
|
+
formChildFields = _useState2[0],
|
|
52
|
+
setFormChildFields = _useState2[1];
|
|
79
53
|
var _useState3 = (0, _react.useState)(),
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
54
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
55
|
+
formChild = _useState4[0],
|
|
56
|
+
setFormChild = _useState4[1];
|
|
84
57
|
var _useState5 = (0, _react.useState)(0),
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
58
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
59
|
+
currentStep = _useState6[0],
|
|
60
|
+
setCurrentStep = _useState6[1]; // const [fieldFailed, setFieldFailed] = useState(false)
|
|
90
61
|
(0, _react.useEffect)(function () {
|
|
91
62
|
if (stepsConfig && (stepsConfig.current || stepsConfig.current === 0)) {
|
|
92
63
|
setCurrentStep(stepsConfig.current); // 判断是否有设置当前选中的步骤数
|
|
@@ -95,7 +66,6 @@ var StepForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
95
66
|
if (formItemGroup.length === 0) return null;
|
|
96
67
|
var formGridSize = (0, _react.useMemo)(function () {
|
|
97
68
|
if (typeof grid === 'string') return grid; // 数据格式为字符串,包括 xs,md,lg,xlg
|
|
98
|
-
|
|
99
69
|
var sizeName = 'xs';
|
|
100
70
|
if (grid <= 1) sizeName = 'xs';
|
|
101
71
|
if (grid === 2) sizeName = 'md';
|
|
@@ -106,11 +76,9 @@ var StepForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
106
76
|
(0, _react.useEffect)(function () {
|
|
107
77
|
forceUpdateForm();
|
|
108
78
|
}, [formChildFields, formChild]);
|
|
109
|
-
|
|
110
79
|
var forceUpdateForm = function forceUpdateForm() {
|
|
111
80
|
getFormFields && getFormFields(formChildFields, formChild);
|
|
112
81
|
};
|
|
113
|
-
|
|
114
82
|
var handleStepType = function handleStepType(type, extraFunc) {
|
|
115
83
|
switch (type) {
|
|
116
84
|
case 'submit':
|
|
@@ -125,26 +93,33 @@ var StepForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
125
93
|
formChild && formChild.validateFields(valitorGroup).then(function (values) {
|
|
126
94
|
if (stepClick) stepClick(type, formChild, values);
|
|
127
95
|
extraFunc && extraFunc();
|
|
128
|
-
}).catch(function (_ref) {
|
|
129
|
-
|
|
96
|
+
}).catch(function (_ref) {
|
|
130
97
|
var errorFields = _ref.errorFields;
|
|
131
|
-
})
|
|
132
|
-
|
|
98
|
+
} // console.log('表单校验不通过 ', errorFields.map(err => err))
|
|
99
|
+
);
|
|
133
100
|
|
|
101
|
+
break;
|
|
134
102
|
case 'prev':
|
|
135
103
|
if (stepClick) stepClick(type, formChild);
|
|
136
104
|
extraFunc && extraFunc();
|
|
137
105
|
break;
|
|
138
|
-
|
|
139
106
|
case 'cancel':
|
|
140
107
|
if (stepClick) stepClick(type, formChild);
|
|
141
108
|
extraFunc && extraFunc();
|
|
142
109
|
break;
|
|
143
|
-
|
|
144
110
|
default:
|
|
145
111
|
break;
|
|
146
112
|
}
|
|
147
113
|
};
|
|
114
|
+
var stepItems = (0, _react.useMemo)(function () {
|
|
115
|
+
return (formItemGroup || []).filter(function (fItem) {
|
|
116
|
+
return !fItem.hideStep;
|
|
117
|
+
}).map(function (item, index) {
|
|
118
|
+
var hideStep = item.hideStep,
|
|
119
|
+
StepItem = (0, _tslib.__rest)(item, ["hideStep"]);
|
|
120
|
+
return Object.assign({}, StepItem);
|
|
121
|
+
});
|
|
122
|
+
}, [formItemGroup]);
|
|
148
123
|
/* const handleStepChange = (cur:any) => {
|
|
149
124
|
// 自行判断是否校验通过
|
|
150
125
|
/!* if (cur > current) {
|
|
@@ -159,8 +134,6 @@ var StepForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
159
134
|
}*!/
|
|
160
135
|
if (stepsConfig && stepsConfig.onChange) stepsConfig.onChange(cur, formChild);
|
|
161
136
|
}*/
|
|
162
|
-
|
|
163
|
-
|
|
164
137
|
var renderStepActions = function renderStepActions(item, index) {
|
|
165
138
|
if (formItemGroup.length === 1) {
|
|
166
139
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -178,7 +151,6 @@ var StepForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
178
151
|
}
|
|
179
152
|
}, "\u53D6\u6D88"));
|
|
180
153
|
}
|
|
181
|
-
|
|
182
154
|
var buttonList = function buttonList(itemIndex) {
|
|
183
155
|
if (itemIndex === 0) {
|
|
184
156
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
@@ -226,7 +198,6 @@ var StepForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
226
198
|
}, "\u53D6\u6D88"));
|
|
227
199
|
}
|
|
228
200
|
};
|
|
229
|
-
|
|
230
201
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
231
202
|
className: "standardForm-actions",
|
|
232
203
|
key: index,
|
|
@@ -235,7 +206,6 @@ var StepForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
235
206
|
}
|
|
236
207
|
}, buttonList(index));
|
|
237
208
|
};
|
|
238
|
-
|
|
239
209
|
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
240
210
|
className: layout === 'inline' ? '' : '',
|
|
241
211
|
actionGroup: [],
|
|
@@ -249,19 +219,12 @@ var StepForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
249
219
|
},
|
|
250
220
|
onSubmit: onSubmit,
|
|
251
221
|
layout: layout,
|
|
252
|
-
onFinishFailed: function onFinishFailed() {
|
|
222
|
+
onFinishFailed: function onFinishFailed() {
|
|
223
|
+
// setFieldFailed(true)
|
|
253
224
|
}
|
|
254
|
-
}, /*#__PURE__*/_react.default.createElement(_steps.default, Object.assign({}, stepsConfig
|
|
255
|
-
|
|
256
|
-
|
|
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) {
|
|
225
|
+
}, /*#__PURE__*/_react.default.createElement(_steps.default, Object.assign({}, stepsConfig, {
|
|
226
|
+
items: stepItems
|
|
227
|
+
})), (formItemGroup || []).map(function (item, index) {
|
|
265
228
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
266
229
|
key: index,
|
|
267
230
|
className: "stepForm-content ".concat(layout === 'inline' ? 'stepForm-content-inline' : ''),
|
|
@@ -290,6 +253,5 @@ var StepForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
290
253
|
}) : renderStepActions(item, index)));
|
|
291
254
|
}));
|
|
292
255
|
});
|
|
293
|
-
|
|
294
256
|
var _default = StepForm;
|
|
295
257
|
exports.default = _default;
|
|
@@ -1,83 +1,55 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
4
|
-
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
require("antd/es/col/style");
|
|
11
|
-
|
|
12
|
-
var _col = _interopRequireDefault(require("antd/es/col"));
|
|
13
|
-
|
|
14
8
|
require("antd/es/tabs/style");
|
|
15
|
-
|
|
16
9
|
var _tabs = _interopRequireDefault(require("antd/es/tabs"));
|
|
17
|
-
|
|
10
|
+
require("antd/es/col/style");
|
|
11
|
+
var _col = _interopRequireDefault(require("antd/es/col"));
|
|
18
12
|
var _tslib = require("tslib");
|
|
19
|
-
|
|
20
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
21
|
-
|
|
22
14
|
require("./style/index.less");
|
|
23
|
-
|
|
24
15
|
var _index2 = _interopRequireDefault(require("./index"));
|
|
25
|
-
|
|
26
16
|
var _RenderItemGroup = _interopRequireDefault(require("../FormComp/RenderItemGroup"));
|
|
27
|
-
|
|
28
17
|
var _ActionList = _interopRequireDefault(require("./ActionList"));
|
|
29
|
-
|
|
30
|
-
function
|
|
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
|
-
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && 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; }
|
|
34
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
|
-
|
|
36
21
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
37
|
-
|
|
38
22
|
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
23
|
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
24
|
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
|
-
|
|
25
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
46
26
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
47
|
-
|
|
48
|
-
var TabPane = _tabs.default.TabPane;
|
|
49
|
-
|
|
50
27
|
var TabForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
51
28
|
var getFormFields = props.getFormFields,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
29
|
+
_props$formItemGroup = props.formItemGroup,
|
|
30
|
+
formItemGroup = _props$formItemGroup === void 0 ? [] : _props$formItemGroup,
|
|
31
|
+
grid = props.grid,
|
|
32
|
+
layout = props.layout,
|
|
33
|
+
_props$actionAlign = props.actionAlign,
|
|
34
|
+
actionAlign = _props$actionAlign === void 0 ? 'center' : _props$actionAlign,
|
|
35
|
+
actionHide = props.actionHide,
|
|
36
|
+
fieldStatus = props.fieldStatus,
|
|
37
|
+
_props$fieldSize = props.fieldSize,
|
|
38
|
+
fieldSize = _props$fieldSize === void 0 ? "middle" : _props$fieldSize,
|
|
39
|
+
onSubmit = props.onSubmit,
|
|
40
|
+
initialValues = props.initialValues,
|
|
41
|
+
tabsConfig = props.tabsConfig,
|
|
42
|
+
displayLayout = props.displayLayout;
|
|
67
43
|
var _useState = (0, _react.useState)(),
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
44
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
45
|
+
formChildFields = _useState2[0],
|
|
46
|
+
setFormChildFields = _useState2[1];
|
|
72
47
|
var _useState3 = (0, _react.useState)(),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
48
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
49
|
+
formChild = _useState4[0],
|
|
50
|
+
setFormChild = _useState4[1]; // const [fieldFailed, setFieldFailed] = useState(false)
|
|
78
51
|
var formGridSize = (0, _react.useMemo)(function () {
|
|
79
52
|
if (typeof grid === 'string') return grid; // 数据格式为字符串,包括 xs,md,lg,xlg
|
|
80
|
-
|
|
81
53
|
var sizeName = 'xs';
|
|
82
54
|
if (grid <= 1) sizeName = 'xs';
|
|
83
55
|
if (grid === 2) sizeName = 'md';
|
|
@@ -88,13 +60,44 @@ var TabForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
88
60
|
(0, _react.useEffect)(function () {
|
|
89
61
|
forceUpdateForm();
|
|
90
62
|
}, [formChildFields, formChild]);
|
|
91
|
-
|
|
92
63
|
var forceUpdateForm = function forceUpdateForm() {
|
|
93
64
|
// console.log('TabForm强制更新表单控件')
|
|
94
65
|
getFormFields && getFormFields(formChildFields, formChild);
|
|
95
66
|
};
|
|
96
|
-
|
|
97
67
|
if (formItemGroup.length === 0) return null;
|
|
68
|
+
var items = (0, _react.useMemo)(function () {
|
|
69
|
+
return formItemGroup.map(function (item, index) {
|
|
70
|
+
var title = item.title,
|
|
71
|
+
fields = item.fields,
|
|
72
|
+
actions = item.actions,
|
|
73
|
+
tabConfig = (0, _tslib.__rest)(item, ["title", "fields", "actions"]);
|
|
74
|
+
return Object.assign({
|
|
75
|
+
key: item.key || index,
|
|
76
|
+
label: title || item.label,
|
|
77
|
+
children: /*#__PURE__*/_react.default.createElement("div", {
|
|
78
|
+
className: "tabForm-content ".concat(layout === 'inline' ? 'tabForm-content-inline' : '')
|
|
79
|
+
}, fields && Array.isArray(fields) ? /*#__PURE__*/_react.default.createElement(_RenderItemGroup.default, {
|
|
80
|
+
layout: layout,
|
|
81
|
+
form: formChild,
|
|
82
|
+
fieldStatus: fieldStatus,
|
|
83
|
+
size: formGridSize,
|
|
84
|
+
displayLayout: displayLayout,
|
|
85
|
+
doUpdateFormFields: function doUpdateFormFields() {
|
|
86
|
+
return forceUpdateForm();
|
|
87
|
+
},
|
|
88
|
+
// doUpdateFormFields={() => forceUpdateForm()}
|
|
89
|
+
itemGroup: fields
|
|
90
|
+
}) : fields, !actionHide && actions && /*#__PURE__*/_react.default.createElement(_col.default, {
|
|
91
|
+
span: 24
|
|
92
|
+
}, /*#__PURE__*/_react.default.createElement(_ActionList.default, {
|
|
93
|
+
list: item.actions,
|
|
94
|
+
form: formChild,
|
|
95
|
+
other: props,
|
|
96
|
+
align: actionAlign
|
|
97
|
+
})))
|
|
98
|
+
}, tabConfig);
|
|
99
|
+
});
|
|
100
|
+
}, [formItemGroup]);
|
|
98
101
|
return /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
99
102
|
actionGroup: [],
|
|
100
103
|
ref: ref,
|
|
@@ -110,39 +113,9 @@ var TabForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
110
113
|
}, /*#__PURE__*/_react.default.createElement(_tabs.default, Object.assign({
|
|
111
114
|
type: "card",
|
|
112
115
|
animated: false
|
|
113
|
-
}, tabsConfig
|
|
114
|
-
|
|
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
|
-
}))));
|
|
116
|
+
}, tabsConfig, {
|
|
117
|
+
items: items
|
|
144
118
|
})));
|
|
145
119
|
});
|
|
146
|
-
|
|
147
120
|
var _default = TabForm;
|
|
148
121
|
exports.default = _default;
|