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,90 +1,66 @@
|
|
|
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/button/style");
|
|
11
|
-
|
|
12
9
|
var _button = _interopRequireDefault(require("antd/es/button"));
|
|
13
|
-
|
|
14
10
|
require("antd/es/form/style");
|
|
15
|
-
|
|
16
11
|
var _form = _interopRequireDefault(require("antd/es/form"));
|
|
17
|
-
|
|
18
12
|
var _tslib = require("tslib");
|
|
19
|
-
|
|
20
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
21
|
-
|
|
22
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
23
|
-
|
|
24
15
|
var _RenderItemGroup = _interopRequireDefault(require("../FormComp/RenderItemGroup"));
|
|
25
|
-
|
|
26
16
|
var _data = require("../data");
|
|
27
|
-
|
|
28
17
|
require("./style/index.less");
|
|
29
|
-
|
|
30
18
|
var _ActionList = _interopRequireDefault(require("./ActionList"));
|
|
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
|
-
|
|
19
|
+
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); }
|
|
20
|
+
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
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
|
-
|
|
38
22
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
39
|
-
|
|
40
23
|
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
24
|
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
25
|
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
|
-
|
|
26
|
+
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
27
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
49
|
-
|
|
50
28
|
var StandardForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
51
29
|
var _props$formItemGroup = props.formItemGroup,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
30
|
+
formItemGroup = _props$formItemGroup === void 0 ? [] : _props$formItemGroup,
|
|
31
|
+
className = props.className,
|
|
32
|
+
initialValues = props.initialValues,
|
|
33
|
+
_props$layout = props.layout,
|
|
34
|
+
layout = _props$layout === void 0 ? 'horizontal' : _props$layout,
|
|
35
|
+
_props$grid = props.grid,
|
|
36
|
+
grid = _props$grid === void 0 ? 1 : _props$grid,
|
|
37
|
+
getFormFields = props.getFormFields,
|
|
38
|
+
fieldStatus = props.fieldStatus,
|
|
39
|
+
onSubmit = props.onSubmit,
|
|
40
|
+
_props$confirmText = props.confirmText,
|
|
41
|
+
confirmText = _props$confirmText === void 0 ? '确认' : _props$confirmText,
|
|
42
|
+
onCancel = props.onCancel,
|
|
43
|
+
_props$cancelText = props.cancelText,
|
|
44
|
+
cancelText = _props$cancelText === void 0 ? '取消' : _props$cancelText,
|
|
45
|
+
actionAlign = props.actionAlign,
|
|
46
|
+
actionGroup = props.actionGroup,
|
|
47
|
+
onFinishFailed = props.onFinishFailed,
|
|
48
|
+
children = props.children,
|
|
49
|
+
prefix = props.prefix,
|
|
50
|
+
postfix = props.postfix,
|
|
51
|
+
fieldSize = props.fieldSize,
|
|
52
|
+
displayLayout = props.displayLayout,
|
|
53
|
+
baseProps = (0, _tslib.__rest)(props, ["formItemGroup", "className", "initialValues", "layout", "grid", "getFormFields", "fieldStatus", "onSubmit", "confirmText", "onCancel", "cancelText", "actionAlign", "actionGroup", "onFinishFailed", "children", "prefix", "postfix", "fieldSize", "displayLayout"]);
|
|
77
54
|
var _Form$useForm = _form.default.useForm(),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
55
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
56
|
+
initForm = _Form$useForm2[0];
|
|
81
57
|
(0, _react.useEffect)(function () {
|
|
82
58
|
if (initForm) {
|
|
83
59
|
// <---- check ref before use the form instance
|
|
84
60
|
forceUpdateForm();
|
|
85
61
|
}
|
|
86
|
-
}, [initForm]);
|
|
87
|
-
|
|
62
|
+
}, [initForm]);
|
|
63
|
+
// 栅格尺寸
|
|
88
64
|
var gridSize = (0, _react.useMemo)(function () {
|
|
89
65
|
var sizeName = 'xs';
|
|
90
66
|
if (grid <= 1) sizeName = 'xs';
|
|
@@ -92,50 +68,43 @@ var StandardForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
92
68
|
if (grid === 3) sizeName = 'lg';
|
|
93
69
|
if (grid > 3) sizeName = 'xlg';
|
|
94
70
|
return sizeName;
|
|
95
|
-
}, [grid]);
|
|
96
|
-
|
|
71
|
+
}, [grid]);
|
|
72
|
+
// 按钮组对齐位置
|
|
97
73
|
var actionAlignCol = (0, _react.useMemo)(function () {
|
|
98
74
|
if (layout !== 'horizontal' || gridSize !== 'xs' || actionAlign && actionAlign !== 'default') {
|
|
99
75
|
return {};
|
|
100
76
|
}
|
|
101
|
-
|
|
102
77
|
return Object.assign(Object.assign({}, _data.general.modalSize[gridSize].formBlockLayout.wrapperCol), {
|
|
103
78
|
offset: _data.general.modalSize[gridSize].formBlockLayout.labelCol.span
|
|
104
79
|
});
|
|
105
|
-
}, [layout, gridSize, actionAlign]);
|
|
106
|
-
|
|
80
|
+
}, [layout, gridSize, actionAlign]);
|
|
81
|
+
// 强制更新表单值,用于赋初始化实例值
|
|
107
82
|
var forceUpdateForm = function forceUpdateForm() {
|
|
108
83
|
// @ts-ignore
|
|
109
84
|
getFormFields && getFormFields(initForm && initForm.getFieldsValue() || {}, initForm);
|
|
110
85
|
};
|
|
111
|
-
|
|
112
86
|
var onFormFinish = function onFormFinish(values) {
|
|
113
87
|
if (onSubmit) onSubmit(values);
|
|
114
88
|
};
|
|
115
|
-
|
|
116
89
|
var onFormFinishFailed = function onFormFinishFailed(_ref) {
|
|
117
90
|
var values = _ref.values,
|
|
118
|
-
|
|
119
|
-
|
|
91
|
+
errorFields = _ref.errorFields,
|
|
92
|
+
outOfDate = _ref.outOfDate;
|
|
120
93
|
// 定位到第一条表单异常的焦点
|
|
121
94
|
var errorCollection = Array.prototype.slice.call(document.getElementsByClassName('ant-form-item-has-error'));
|
|
122
|
-
|
|
123
95
|
if (errorCollection[0] && errorCollection[0].getElementsByTagName('input')) {
|
|
124
96
|
Array.prototype.slice.call(errorCollection[0].getElementsByTagName('input'))[0].focus();
|
|
125
97
|
}
|
|
126
|
-
|
|
127
98
|
if (onFinishFailed) onFinishFailed({
|
|
128
99
|
values: values,
|
|
129
100
|
errorFields: errorFields,
|
|
130
101
|
outOfDate: outOfDate
|
|
131
102
|
});
|
|
132
103
|
};
|
|
133
|
-
|
|
134
104
|
var onFormCancel = function onFormCancel() {
|
|
135
105
|
if (onCancel) onCancel();
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
|
|
106
|
+
};
|
|
107
|
+
// 按钮组
|
|
139
108
|
var renderActionGroup = function renderActionGroup() {
|
|
140
109
|
var groupNode = function groupNode() {
|
|
141
110
|
if (Array.isArray(actionGroup)) {
|
|
@@ -148,10 +117,8 @@ var StandardForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
148
117
|
other: props
|
|
149
118
|
}));
|
|
150
119
|
}
|
|
151
|
-
|
|
152
120
|
return actionGroup;
|
|
153
121
|
};
|
|
154
|
-
|
|
155
122
|
if (Array.isArray(actionGroup) && actionGroup.length === 0) return null;
|
|
156
123
|
if (actionGroup) return groupNode();
|
|
157
124
|
return /*#__PURE__*/_react.default.createElement(_form.default.Item, {
|
|
@@ -171,7 +138,6 @@ var StandardForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
171
138
|
size: fieldSize
|
|
172
139
|
}, cancelText));
|
|
173
140
|
};
|
|
174
|
-
|
|
175
141
|
return /*#__PURE__*/_react.default.createElement(_form.default, Object.assign({
|
|
176
142
|
className: (0, _classnames.default)(className, 'standardForm'),
|
|
177
143
|
ref: ref,
|
|
@@ -192,6 +158,5 @@ var StandardForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
192
158
|
fieldStatus: fieldStatus
|
|
193
159
|
}) : null, renderActionGroup()), postfix);
|
|
194
160
|
});
|
|
195
|
-
|
|
196
161
|
var _default = StandardForm;
|
|
197
162
|
exports.default = _default;
|
|
@@ -1,32 +1,24 @@
|
|
|
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
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
-
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
16
11
|
var updateModalForm = function updateModalForm(props) {
|
|
17
12
|
var getFormAndFields = props.getFormAndFields,
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
form = props.form;
|
|
20
14
|
var updateFormFields = function updateFormFields() {
|
|
21
15
|
if (getFormAndFields) getFormAndFields(form.current.getFieldsValue() || {}, form.current);
|
|
22
16
|
};
|
|
23
|
-
|
|
24
17
|
(0, _react.useEffect)(function () {
|
|
25
18
|
updateFormFields();
|
|
26
19
|
}, [form]);
|
|
27
20
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
28
21
|
/* 如果是ReactNode则直接返回 */
|
|
29
22
|
};
|
|
30
|
-
|
|
31
23
|
var _default = updateModalForm;
|
|
32
24
|
exports.default = _default;
|
|
@@ -3,7 +3,6 @@ import { ModalProps } from 'antd/es/modal';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { ItemGroupProps } from '../StandardForm/index';
|
|
5
5
|
import './style/index.less';
|
|
6
|
-
import 'ant-design-draggable-modal/dist/index.css';
|
|
7
6
|
export interface StandardModalProps extends ModalProps {
|
|
8
7
|
children?: React.ReactNode;
|
|
9
8
|
title?: String;
|