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,197 +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/button/style");
|
|
11
|
-
|
|
12
|
-
var _button = _interopRequireDefault(require("antd/es/button"));
|
|
13
|
-
|
|
14
|
-
require("antd/es/form/style");
|
|
15
|
-
|
|
16
|
-
var _form = _interopRequireDefault(require("antd/es/form"));
|
|
17
|
-
|
|
18
|
-
var _tslib = require("tslib");
|
|
19
|
-
|
|
20
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
21
|
-
|
|
22
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
23
|
-
|
|
24
|
-
var _RenderItemGroup = _interopRequireDefault(require("../FormComp/RenderItemGroup"));
|
|
25
|
-
|
|
26
|
-
var _data = require("../data");
|
|
27
|
-
|
|
28
|
-
require("./style/index.less");
|
|
29
|
-
|
|
30
|
-
var _ActionList = _interopRequireDefault(require("./ActionList"));
|
|
31
|
-
|
|
32
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
33
|
-
|
|
34
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
|
-
|
|
36
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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
|
-
var StandardForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
51
|
-
var _props$formItemGroup = props.formItemGroup,
|
|
52
|
-
formItemGroup = _props$formItemGroup === void 0 ? [] : _props$formItemGroup,
|
|
53
|
-
className = props.className,
|
|
54
|
-
initialValues = props.initialValues,
|
|
55
|
-
_props$layout = props.layout,
|
|
56
|
-
layout = _props$layout === void 0 ? 'horizontal' : _props$layout,
|
|
57
|
-
_props$grid = props.grid,
|
|
58
|
-
grid = _props$grid === void 0 ? 1 : _props$grid,
|
|
59
|
-
getFormFields = props.getFormFields,
|
|
60
|
-
fieldStatus = props.fieldStatus,
|
|
61
|
-
onSubmit = props.onSubmit,
|
|
62
|
-
_props$confirmText = props.confirmText,
|
|
63
|
-
confirmText = _props$confirmText === void 0 ? '确认' : _props$confirmText,
|
|
64
|
-
onCancel = props.onCancel,
|
|
65
|
-
_props$cancelText = props.cancelText,
|
|
66
|
-
cancelText = _props$cancelText === void 0 ? '取消' : _props$cancelText,
|
|
67
|
-
actionAlign = props.actionAlign,
|
|
68
|
-
actionGroup = props.actionGroup,
|
|
69
|
-
onFinishFailed = props.onFinishFailed,
|
|
70
|
-
children = props.children,
|
|
71
|
-
prefix = props.prefix,
|
|
72
|
-
postfix = props.postfix,
|
|
73
|
-
fieldSize = props.fieldSize,
|
|
74
|
-
displayLayout = props.displayLayout,
|
|
75
|
-
baseProps = (0, _tslib.__rest)(props, ["formItemGroup", "className", "initialValues", "layout", "grid", "getFormFields", "fieldStatus", "onSubmit", "confirmText", "onCancel", "cancelText", "actionAlign", "actionGroup", "onFinishFailed", "children", "prefix", "postfix", "fieldSize", "displayLayout"]);
|
|
76
|
-
|
|
77
|
-
var _Form$useForm = _form.default.useForm(),
|
|
78
|
-
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
79
|
-
initForm = _Form$useForm2[0];
|
|
80
|
-
|
|
81
|
-
(0, _react.useEffect)(function () {
|
|
82
|
-
if (initForm) {
|
|
83
|
-
// <---- check ref before use the form instance
|
|
84
|
-
forceUpdateForm();
|
|
85
|
-
}
|
|
86
|
-
}, [initForm]); // 栅格尺寸
|
|
87
|
-
|
|
88
|
-
var gridSize = (0, _react.useMemo)(function () {
|
|
89
|
-
var sizeName = 'xs';
|
|
90
|
-
if (grid <= 1) sizeName = 'xs';
|
|
91
|
-
if (grid === 2) sizeName = 'md';
|
|
92
|
-
if (grid === 3) sizeName = 'lg';
|
|
93
|
-
if (grid > 3) sizeName = 'xlg';
|
|
94
|
-
return sizeName;
|
|
95
|
-
}, [grid]); // 按钮组对齐位置
|
|
96
|
-
|
|
97
|
-
var actionAlignCol = (0, _react.useMemo)(function () {
|
|
98
|
-
if (layout !== 'horizontal' || gridSize !== 'xs' || actionAlign && actionAlign !== 'default') {
|
|
99
|
-
return {};
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return Object.assign(Object.assign({}, _data.general.modalSize[gridSize].formBlockLayout.wrapperCol), {
|
|
103
|
-
offset: _data.general.modalSize[gridSize].formBlockLayout.labelCol.span
|
|
104
|
-
});
|
|
105
|
-
}, [layout, gridSize, actionAlign]); // 强制更新表单值,用于赋初始化实例值
|
|
106
|
-
|
|
107
|
-
var forceUpdateForm = function forceUpdateForm() {
|
|
108
|
-
// @ts-ignore
|
|
109
|
-
getFormFields && getFormFields(initForm && initForm.getFieldsValue() || {}, initForm);
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
var onFormFinish = function onFormFinish(values) {
|
|
113
|
-
if (onSubmit) onSubmit(values);
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
var onFormFinishFailed = function onFormFinishFailed(_ref) {
|
|
117
|
-
var values = _ref.values,
|
|
118
|
-
errorFields = _ref.errorFields,
|
|
119
|
-
outOfDate = _ref.outOfDate;
|
|
120
|
-
// 定位到第一条表单异常的焦点
|
|
121
|
-
var errorCollection = Array.prototype.slice.call(document.getElementsByClassName('ant-form-item-has-error'));
|
|
122
|
-
|
|
123
|
-
if (errorCollection[0] && errorCollection[0].getElementsByTagName('input')) {
|
|
124
|
-
Array.prototype.slice.call(errorCollection[0].getElementsByTagName('input'))[0].focus();
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
if (onFinishFailed) onFinishFailed({
|
|
128
|
-
values: values,
|
|
129
|
-
errorFields: errorFields,
|
|
130
|
-
outOfDate: outOfDate
|
|
131
|
-
});
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
var onFormCancel = function onFormCancel() {
|
|
135
|
-
if (onCancel) onCancel();
|
|
136
|
-
}; // 按钮组
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
var renderActionGroup = function renderActionGroup() {
|
|
140
|
-
var groupNode = function groupNode() {
|
|
141
|
-
if (Array.isArray(actionGroup)) {
|
|
142
|
-
return actionGroup.length === 0 ? null : /*#__PURE__*/_react.default.createElement(_form.default.Item, {
|
|
143
|
-
wrapperCol: actionAlignCol
|
|
144
|
-
}, /*#__PURE__*/_react.default.createElement(_ActionList.default, {
|
|
145
|
-
list: actionGroup,
|
|
146
|
-
form: initForm,
|
|
147
|
-
align: actionAlign,
|
|
148
|
-
other: props
|
|
149
|
-
}));
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return actionGroup;
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
if (Array.isArray(actionGroup) && actionGroup.length === 0) return null;
|
|
156
|
-
if (actionGroup) return groupNode();
|
|
157
|
-
return /*#__PURE__*/_react.default.createElement(_form.default.Item, {
|
|
158
|
-
className: "standardForm-actions",
|
|
159
|
-
style: {
|
|
160
|
-
'textAlign': !actionAlign || actionAlign === 'default' ? 'inherit' : actionAlign
|
|
161
|
-
},
|
|
162
|
-
wrapperCol: actionAlignCol
|
|
163
|
-
}, confirmText && /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
164
|
-
type: "primary",
|
|
165
|
-
htmlType: "submit",
|
|
166
|
-
size: fieldSize
|
|
167
|
-
}, confirmText), cancelText && /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
168
|
-
onClick: function onClick() {
|
|
169
|
-
return onFormCancel();
|
|
170
|
-
},
|
|
171
|
-
size: fieldSize
|
|
172
|
-
}, cancelText));
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
return /*#__PURE__*/_react.default.createElement(_form.default, Object.assign({
|
|
176
|
-
className: (0, _classnames.default)(className, 'standardForm'),
|
|
177
|
-
ref: ref,
|
|
178
|
-
form: initForm,
|
|
179
|
-
initialValues: initialValues,
|
|
180
|
-
layout: layout
|
|
181
|
-
}, baseProps, {
|
|
182
|
-
onFinish: onFormFinish,
|
|
183
|
-
onFinishFailed: onFormFinishFailed,
|
|
184
|
-
scrollToFirstError: true
|
|
185
|
-
}), prefix, children, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, formItemGroup.length > 0 ? /*#__PURE__*/_react.default.createElement(_RenderItemGroup.default, {
|
|
186
|
-
itemGroup: formItemGroup,
|
|
187
|
-
fieldSize: fieldSize,
|
|
188
|
-
displayLayout: displayLayout,
|
|
189
|
-
// doUpdateFormFields={() => forceUpdateForm()}
|
|
190
|
-
size: gridSize,
|
|
191
|
-
layout: layout,
|
|
192
|
-
fieldStatus: fieldStatus
|
|
193
|
-
}) : null, renderActionGroup()), postfix);
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
var _default = StandardForm;
|
|
197
|
-
exports.default = _default;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
@root-entry-name: default;
|
|
2
|
-
@import (reference) '~antd/es/style/themes/index';
|
|
3
|
-
|
|
4
|
-
.standardForm {
|
|
5
|
-
&.ant-form-inline {
|
|
6
|
-
.ant-form-item {
|
|
7
|
-
margin-bottom: @padding-md;
|
|
8
|
-
}
|
|
9
|
-
.ant-form-item-explain, .ant-form-item-extra{
|
|
10
|
-
position: absolute;
|
|
11
|
-
}
|
|
12
|
-
.ant-slider {
|
|
13
|
-
min-width: 100px;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
&.ant-form-horizontal {
|
|
17
|
-
&.ant-form-small {
|
|
18
|
-
.ant-form-item-label> label {
|
|
19
|
-
min-height: @input-height-sm;}
|
|
20
|
-
}
|
|
21
|
-
&.ant-form-large {
|
|
22
|
-
.ant-form-item-label> label {
|
|
23
|
-
min-height: @input-height-lg;}
|
|
24
|
-
}
|
|
25
|
-
.ant-form-item-label {
|
|
26
|
-
white-space: inherit;
|
|
27
|
-
> label {
|
|
28
|
-
min-height: @input-height-base;
|
|
29
|
-
height: auto;
|
|
30
|
-
&.ant-form-item-required{
|
|
31
|
-
padding-left: 8px;
|
|
32
|
-
&:before {
|
|
33
|
-
position: absolute;
|
|
34
|
-
left:1px;
|
|
35
|
-
margin-right: 0;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.standardForm-actions {
|
|
43
|
-
.ant-btn + .ant-btn {
|
|
44
|
-
margin-left: 8px;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
.stepForm-content {
|
|
48
|
-
margin: @padding-md 0;
|
|
49
|
-
}
|
|
50
|
-
.tabForm-content-inline,
|
|
51
|
-
.stepForm-content-inline {
|
|
52
|
-
display: flex;
|
|
53
|
-
flex-wrap: wrap;
|
|
54
|
-
.ant-select {
|
|
55
|
-
min-width: 100px;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,32 +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
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
13
|
-
|
|
14
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
-
|
|
16
|
-
var updateModalForm = function updateModalForm(props) {
|
|
17
|
-
var getFormAndFields = props.getFormAndFields,
|
|
18
|
-
form = props.form;
|
|
19
|
-
|
|
20
|
-
var updateFormFields = function updateFormFields() {
|
|
21
|
-
if (getFormAndFields) getFormAndFields(form.current.getFieldsValue() || {}, form.current);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
(0, _react.useEffect)(function () {
|
|
25
|
-
updateFormFields();
|
|
26
|
-
}, [form]);
|
|
27
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
28
|
-
/* 如果是ReactNode则直接返回 */
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
var _default = updateModalForm;
|
|
32
|
-
exports.default = _default;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ModalProps } from 'antd/es/modal';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { ItemGroupProps } from '../StandardForm/index';
|
|
5
|
-
import './style/index.less';
|
|
6
|
-
import 'ant-design-draggable-modal/dist/index.css';
|
|
7
|
-
export interface StandardModalProps extends ModalProps {
|
|
8
|
-
children?: React.ReactNode;
|
|
9
|
-
title?: String;
|
|
10
|
-
type?: String;
|
|
11
|
-
size?: any;
|
|
12
|
-
formItemGroup?: ItemGroupProps[];
|
|
13
|
-
formPrefix?: (modalForm?: any, props?: StandardModalProps, forceUpdateForm?: () => void) => React.ReactNode;
|
|
14
|
-
formPostfix?: (modalForm?: any, props?: StandardModalProps, forceUpdateForm?: () => void) => React.ReactNode;
|
|
15
|
-
onSubmit?: (values?: any) => void;
|
|
16
|
-
confirmText?: String;
|
|
17
|
-
cancelText?: String;
|
|
18
|
-
onCancel?: () => void;
|
|
19
|
-
afterClose?: () => void;
|
|
20
|
-
initialValues?: object;
|
|
21
|
-
getFormFields?: (fields: any, form: any) => void;
|
|
22
|
-
fieldStatus?: 'default' | 'viewOnly' | 'disabled';
|
|
23
|
-
formLayout?: 'horizontal' | 'vertical' | 'inline';
|
|
24
|
-
tabsConfig?: any;
|
|
25
|
-
stepsConfig?: any;
|
|
26
|
-
className?: string;
|
|
27
|
-
style?: React.CSSProperties;
|
|
28
|
-
visible?: boolean;
|
|
29
|
-
bodyStyle?: React.CSSProperties;
|
|
30
|
-
hideRequiredMark?: boolean;
|
|
31
|
-
hideFooter?: Boolean;
|
|
32
|
-
footerButtonGroup?: ((modalForm?: any, props?: StandardModalProps) => React.ReactNode | PropTypes.ReactNodeArray | any) | any;
|
|
33
|
-
footer?: any;
|
|
34
|
-
displayLayout?: any;
|
|
35
|
-
confirmLoading?: boolean;
|
|
36
|
-
okText?: string;
|
|
37
|
-
okButtonProps?: any;
|
|
38
|
-
confirmButtonProps?: any;
|
|
39
|
-
cancelButtonProps?: any;
|
|
40
|
-
dragAble?: boolean;
|
|
41
|
-
[k: string]: any;
|
|
42
|
-
}
|
|
43
|
-
declare const StandardModal: (props: StandardModalProps) => JSX.Element;
|
|
44
|
-
export default StandardModal;
|