fan-standard-comp 3.2.1 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Readme.md +1 -33
- package/dist/09cd8e9be7081f2166444cce393fe968.svg +54 -0
- package/dist/e3378c145b7db195ad068735e15fb28a.svg +165 -0
- package/dist/fan-standard-comp.umd.js +166 -444
- package/dist/fonts/iconfont.ttf +0 -0
- package/dist/fonts/iconfont.woff +0 -0
- package/dist/fonts/lg.ttf +0 -0
- package/dist/fonts/lg.woff +0 -0
- package/dist/fonts/lg.woff2 +0 -0
- package/es/ButtonGroup/ButtonList.d.ts +2 -1
- package/es/ButtonGroup/ButtonMenu.d.ts +2 -1
- package/es/ButtonGroup/PopConfirmTitle.js +5 -5
- package/es/ButtonGroup/index.d.ts +3 -1
- package/es/ButtonGroup/index.js +146 -180
- package/es/ButtonGroup/style/index.less +4 -1
- package/es/CalendarCoordPicker/CalendarMonthPicker.d.ts +5 -0
- package/es/CalendarCoordPicker/CalendarMonthPicker.js +26 -0
- package/es/CalendarCoordPicker/index.d.ts +8 -0
- package/es/CalendarCoordPicker/index.js +296 -0
- package/es/CalendarCoordPicker/index.less +31 -0
- package/es/ConfigContext/index.d.ts +7 -0
- package/es/ConfigContext/index.js +12 -0
- package/es/DragContent/index.d.ts +1 -1
- package/es/DragContent/index.js +5 -5
- package/es/FormComp/ChunkUploader/api.js +14 -14
- package/es/FormComp/ChunkUploader/index.js +132 -139
- package/es/FormComp/ChunkUploader/lib.js +21 -21
- package/es/FormComp/ChunkUploader/upload-queue.class.js +64 -66
- package/es/FormComp/EditButton/index.d.ts +1 -1
- package/es/FormComp/EditButton/index.js +15 -17
- package/es/FormComp/FieldComponent/ReUpload.d.ts +1 -1
- package/es/FormComp/FieldComponent/ReUpload.js +37 -23
- package/es/FormComp/FieldComponent/RefactorTextarea.js +32 -0
- package/es/FormComp/FieldComponent/RefactorTreeSelect.js +72 -19
- package/es/FormComp/FieldComponent/TitleNode.d.ts +2 -1
- package/es/FormComp/FieldComponent/index.d.ts +1 -1
- package/es/FormComp/FieldComponent/index.js +33 -23
- package/es/FormComp/FieldComponent/setReadonlyValues.js +6 -6
- package/es/FormComp/RenderItemGroup/index.js +24 -8
- package/es/FormComp/Uploader/index.d.ts +3 -1
- package/es/FormComp/Uploader/index.js +243 -119
- package/es/FormComp/VarTemplate/index.js +57 -64
- package/es/ImageGallery/ImagePreview.d.ts +13 -0
- package/es/ImageGallery/ImagePreview.js +168 -0
- package/es/ImageGallery/PreviewStyles/ImagePreview.less +730 -0
- package/es/ImageGallery/PreviewStyles/fonts/lg.svg +54 -0
- package/es/ImageGallery/PreviewStyles/fonts/lg.ttf +0 -0
- package/es/ImageGallery/PreviewStyles/fonts/lg.woff +0 -0
- package/es/ImageGallery/PreviewStyles/fonts/lg.woff2 +0 -0
- package/es/ImageGallery/PreviewStyles/lg-thumbnail.css +108 -0
- package/es/ImageGallery/PreviewStyles/lg-video.css +144 -0
- package/es/ImageGallery/PreviewStyles/lg-zoom.css +116 -0
- package/es/ImageGallery/PreviewStyles/lightgallery.css +728 -0
- package/es/ImageGallery/SliderContent.d.ts +7 -0
- package/es/ImageGallery/SliderContent.js +699 -0
- package/es/ImageGallery/Thumbnail.d.ts +3 -0
- package/es/ImageGallery/Thumbnail.js +296 -0
- package/es/ImageGallery/hook/uniqueId.d.ts +1 -0
- package/es/ImageGallery/hook/uniqueId.js +10 -0
- package/es/ImageGallery/index.d.ts +4 -0
- package/es/ImageGallery/index.js +29 -0
- package/es/ImageGallery/style/index.less +5 -0
- package/es/ImageGallery/types.d.ts +5 -0
- package/es/ImageGallery/types.js +1 -0
- package/es/NavLeafScroll/index.js +94 -50
- package/es/RefactorTree/index.d.ts +1 -1
- package/es/RefactorTree/index.js +6 -6
- package/es/RefactorTree/indexTreeNode.d.ts +1 -1
- package/es/RefactorTree/indexTreeNode.js +19 -17
- package/es/RefactorTree/util.js +18 -18
- package/es/SpecIcon/fonts/demo_index.html +559 -5
- package/es/SpecIcon/fonts/iconfont.css +101 -3
- package/es/SpecIcon/fonts/iconfont.js +34 -27
- package/es/SpecIcon/fonts/iconfont.json +168 -0
- package/es/SpecIcon/fonts/iconfont.svg +163 -171
- 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/style/iconfont.less +106 -11
- package/es/SplitterLayout/Pane.d.ts +1 -1
- package/es/SplitterLayout/index.js +25 -26
- package/es/StandardContent/SplitterLayout/Pane.js +3 -3
- package/es/StandardContent/SplitterLayout/index.js +25 -26
- package/es/StandardContent/SubfieldContent.d.ts +1 -1
- package/es/StandardContent/WrapperContent.d.ts +1 -1
- package/es/StandardDragModal/index.d.ts +11 -3
- package/es/StandardDragModal/index.js +25 -3
- package/es/StandardFilter/index.d.ts +5 -16
- package/es/StandardFilter/index.js +212 -200
- package/es/StandardFilter/indexClass.d.ts +37 -0
- package/es/StandardFilter/indexClass.js +217 -0
- package/es/StandardFilter/style/index.less +82 -9
- package/es/StandardForm/StepForm.d.ts +1 -1
- package/es/StandardForm/StepForm.js +28 -22
- package/es/StandardForm/TabForm.d.ts +1 -1
- package/es/StandardForm/TabForm.js +41 -43
- package/es/StandardForm/index.d.ts +1 -1
- package/es/StandardForm/index.js +5 -5
- package/es/StandardModal/UpdateFormRef.js +0 -1
- package/es/StandardModal/index.d.ts +2 -1
- package/es/StandardModal/index.js +25 -39
- package/es/StandardPanel/index.d.ts +1 -1
- package/es/StandardPanel/index.js +7 -7
- package/es/StandardTable/index.d.ts +1 -0
- package/es/StandardTable/index.js +44 -26
- package/es/components/IconNode/index.d.ts +1 -1
- package/es/components/IconNode/index.js +0 -1
- package/es/data/general.config.js +31 -0
- package/es/index.d.ts +3 -1
- package/es/index.js +6 -2
- package/es/utils/filterPermission.js +7 -10
- package/es/utils/getParentNodes.js +101 -26
- package/es/utils/index.js +2 -3
- package/es/utils/urlUtils.js +76 -0
- package/lib/ButtonGroup/ButtonList.d.ts +2 -1
- package/lib/ButtonGroup/ButtonList.js +2 -3
- package/lib/ButtonGroup/ButtonMenu.d.ts +2 -1
- package/lib/ButtonGroup/ButtonMenu.js +2 -3
- package/lib/ButtonGroup/PopConfirmTitle.js +7 -8
- package/lib/ButtonGroup/index.d.ts +3 -1
- package/lib/ButtonGroup/index.js +150 -185
- package/lib/ButtonGroup/style/index.less +4 -1
- package/lib/CalendarCoordPicker/CalendarMonthPicker.d.ts +5 -0
- package/lib/CalendarCoordPicker/CalendarMonthPicker.js +36 -0
- package/lib/CalendarCoordPicker/index.d.ts +8 -0
- package/lib/CalendarCoordPicker/index.js +305 -0
- package/lib/CalendarCoordPicker/index.less +31 -0
- package/lib/ConfigContext/index.d.ts +7 -0
- package/lib/ConfigContext/index.js +17 -0
- package/lib/DragContent/DragBar.js +2 -3
- package/lib/DragContent/index.d.ts +1 -1
- package/lib/DragContent/index.js +9 -10
- package/lib/FormComp/ChunkUploader/api.js +15 -15
- package/lib/FormComp/ChunkUploader/index.js +135 -142
- package/lib/FormComp/ChunkUploader/lib.js +22 -22
- package/lib/FormComp/ChunkUploader/upload-queue.class.js +66 -69
- package/lib/FormComp/ChunkUploader/worker.js +1 -1
- package/lib/FormComp/EditButton/index.d.ts +1 -1
- package/lib/FormComp/EditButton/index.js +19 -22
- package/lib/FormComp/FieldComponent/ReUpload.d.ts +1 -1
- package/lib/FormComp/FieldComponent/ReUpload.js +40 -28
- package/lib/FormComp/FieldComponent/RefactorTextarea.js +42 -0
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +75 -23
- package/lib/FormComp/FieldComponent/TitleNode.d.ts +2 -1
- package/lib/FormComp/FieldComponent/TitleNode.js +2 -3
- package/lib/FormComp/FieldComponent/index.d.ts +1 -1
- package/lib/FormComp/FieldComponent/index.js +38 -26
- package/lib/FormComp/FieldComponent/setReadonlyValues.js +15 -20
- package/lib/FormComp/RenderItemGroup/index.js +26 -11
- package/lib/FormComp/Uploader/index.d.ts +3 -1
- package/lib/FormComp/Uploader/index.js +244 -123
- package/lib/FormComp/VarTemplate/index.js +63 -71
- package/lib/FormComp/index.js +1 -1
- package/lib/ImageGallery/ImagePreview.d.ts +13 -0
- package/lib/ImageGallery/ImagePreview.js +178 -0
- package/lib/ImageGallery/PreviewStyles/ImagePreview.less +730 -0
- package/lib/ImageGallery/PreviewStyles/fonts/lg.svg +54 -0
- package/lib/ImageGallery/PreviewStyles/fonts/lg.ttf +0 -0
- package/lib/ImageGallery/PreviewStyles/fonts/lg.woff +0 -0
- package/lib/ImageGallery/PreviewStyles/fonts/lg.woff2 +0 -0
- package/lib/ImageGallery/PreviewStyles/lg-thumbnail.css +108 -0
- package/lib/ImageGallery/PreviewStyles/lg-video.css +144 -0
- package/lib/ImageGallery/PreviewStyles/lg-zoom.css +116 -0
- package/lib/ImageGallery/PreviewStyles/lightgallery.css +728 -0
- package/lib/ImageGallery/SliderContent.d.ts +7 -0
- package/lib/ImageGallery/SliderContent.js +708 -0
- package/lib/ImageGallery/Thumbnail.d.ts +3 -0
- package/lib/ImageGallery/Thumbnail.js +306 -0
- package/lib/ImageGallery/hook/uniqueId.d.ts +1 -0
- package/lib/ImageGallery/hook/uniqueId.js +17 -0
- package/lib/ImageGallery/index.d.ts +4 -0
- package/lib/ImageGallery/index.js +36 -0
- package/lib/ImageGallery/style/index.less +5 -0
- package/lib/ImageGallery/types.d.ts +5 -0
- package/lib/ImageGallery/types.js +5 -0
- package/lib/NavLeafScroll/index.js +98 -55
- package/lib/RefactorTree/index.d.ts +1 -1
- package/lib/RefactorTree/index.js +10 -11
- package/lib/RefactorTree/indexTreeNode.d.ts +1 -1
- package/lib/RefactorTree/indexTreeNode.js +23 -22
- package/lib/RefactorTree/util.js +18 -18
- package/lib/SpecIcon/fonts/demo_index.html +559 -5
- package/lib/SpecIcon/fonts/iconfont.css +101 -3
- package/lib/SpecIcon/fonts/iconfont.js +34 -27
- package/lib/SpecIcon/fonts/iconfont.json +168 -0
- package/lib/SpecIcon/fonts/iconfont.svg +163 -171
- 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.js +2 -3
- package/lib/SpecIcon/style/iconfont.less +106 -11
- package/lib/SplitterLayout/Pane.d.ts +1 -1
- package/lib/SplitterLayout/Pane.js +2 -3
- package/lib/SplitterLayout/index.js +27 -29
- package/lib/StandardContent/SplitterLayout/Pane.js +5 -6
- package/lib/StandardContent/SplitterLayout/index.js +27 -29
- package/lib/StandardContent/SubfieldContent.d.ts +1 -1
- package/lib/StandardContent/SubfieldContent.js +2 -3
- package/lib/StandardContent/WrapperContent.d.ts +1 -1
- package/lib/StandardContent/WrapperContent.js +2 -3
- package/lib/StandardDragModal/index.d.ts +11 -3
- package/lib/StandardDragModal/index.js +27 -33
- package/lib/StandardFilter/index.d.ts +5 -16
- package/lib/StandardFilter/index.js +215 -201
- package/lib/StandardFilter/indexClass.d.ts +37 -0
- package/lib/StandardFilter/indexClass.js +223 -0
- package/lib/StandardFilter/style/index.less +82 -9
- package/lib/StandardForm/ActionList.js +2 -3
- package/lib/StandardForm/StepForm.d.ts +1 -1
- package/lib/StandardForm/StepForm.js +32 -27
- package/lib/StandardForm/TabForm.d.ts +1 -1
- package/lib/StandardForm/TabForm.js +45 -48
- package/lib/StandardForm/index.d.ts +1 -1
- package/lib/StandardForm/index.js +9 -10
- package/lib/StandardModal/UpdateFormRef.js +3 -4
- package/lib/StandardModal/index.d.ts +2 -1
- package/lib/StandardModal/index.js +29 -43
- package/lib/StandardPanel/index.d.ts +1 -1
- package/lib/StandardPanel/index.js +11 -12
- package/lib/StandardTable/index.d.ts +1 -0
- package/lib/StandardTable/index.js +49 -29
- package/lib/components/IconNode/index.d.ts +1 -1
- package/lib/components/IconNode/index.js +2 -4
- package/lib/components/index.js +1 -1
- package/lib/data/func.code.js +2 -3
- package/lib/data/general.config.js +33 -3
- package/lib/data/index.js +1 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.js +30 -10
- package/lib/utils/ValueFormat.js +1 -2
- package/lib/utils/filterPermission.js +11 -18
- package/lib/utils/getParentNodes.js +103 -29
- package/lib/utils/index.js +5 -27
- package/lib/utils/urlUtils.js +82 -0
- package/package.json +14 -9
- package/dist/f26952c118ab6cdcd23dc0028ee98c11.svg +0 -173
- package/dist/fonts/iconfont.eot +0 -0
- package/es/StandardDragModal/ChangeStandardModal.d.ts +0 -44
- package/es/StandardDragModal/ChangeStandardModal.js +0 -493
- package/es/StandardDragModal/DraggableModal.d.ts +0 -7
- package/es/StandardDragModal/DraggableModal.js +0 -31
- package/es/StandardDragModal/DraggableModalContext.d.ts +0 -9
- package/es/StandardDragModal/DraggableModalContext.js +0 -5
- package/es/StandardDragModal/DraggableModalInner.d.ts +0 -16
- package/es/StandardDragModal/DraggableModalInner.js +0 -114
- package/es/StandardDragModal/DraggableModalProvider.d.ts +0 -4
- package/es/StandardDragModal/DraggableModalProvider.js +0 -40
- package/es/StandardDragModal/Modal.d.ts +0 -11
- package/es/StandardDragModal/Modal.js +0 -24
- package/es/StandardDragModal/ResizeHandle.d.ts +0 -2
- package/es/StandardDragModal/ResizeHandle.js +0 -8
- package/es/StandardDragModal/clamp.d.ts +0 -1
- package/es/StandardDragModal/clamp.js +0 -3
- package/es/StandardDragModal/draggableModalReducer.d.ts +0 -66
- package/es/StandardDragModal/draggableModalReducer.js +0 -157
- package/es/StandardDragModal/getWindowSize.d.ts +0 -4
- package/es/StandardDragModal/getWindowSize.js +0 -6
- package/es/StandardDragModal/index.less +0 -65
- package/es/StandardDragModal/useDrag.d.ts +0 -5
- package/es/StandardDragModal/useDrag.js +0 -66
- package/es/StandardDragModal/usePrevious.d.ts +0 -1
- package/es/StandardDragModal/usePrevious.js +0 -8
- package/es/StandardDragModal/useResize.d.ts +0 -7
- package/es/StandardDragModal/useResize.js +0 -74
- package/es/utils/dictSelectUtil.js +0 -153
- package/lib/StandardDragModal/ChangeStandardModal.d.ts +0 -44
- package/lib/StandardDragModal/ChangeStandardModal.js +0 -502
- package/lib/StandardDragModal/DraggableModal.d.ts +0 -7
- package/lib/StandardDragModal/DraggableModal.js +0 -40
- package/lib/StandardDragModal/DraggableModalContext.d.ts +0 -9
- package/lib/StandardDragModal/DraggableModalContext.js +0 -15
- package/lib/StandardDragModal/DraggableModalInner.d.ts +0 -16
- package/lib/StandardDragModal/DraggableModalInner.js +0 -124
- package/lib/StandardDragModal/DraggableModalProvider.d.ts +0 -4
- package/lib/StandardDragModal/DraggableModalProvider.js +0 -48
- package/lib/StandardDragModal/Modal.d.ts +0 -11
- package/lib/StandardDragModal/Modal.js +0 -32
- package/lib/StandardDragModal/ResizeHandle.d.ts +0 -2
- package/lib/StandardDragModal/ResizeHandle.js +0 -18
- package/lib/StandardDragModal/clamp.d.ts +0 -1
- package/lib/StandardDragModal/clamp.js +0 -10
- package/lib/StandardDragModal/draggableModalReducer.d.ts +0 -66
- package/lib/StandardDragModal/draggableModalReducer.js +0 -167
- package/lib/StandardDragModal/getWindowSize.d.ts +0 -4
- package/lib/StandardDragModal/getWindowSize.js +0 -13
- package/lib/StandardDragModal/index.less +0 -65
- package/lib/StandardDragModal/useDrag.d.ts +0 -5
- package/lib/StandardDragModal/useDrag.js +0 -73
- package/lib/StandardDragModal/usePrevious.d.ts +0 -1
- package/lib/StandardDragModal/usePrevious.js +0 -15
- package/lib/StandardDragModal/useResize.d.ts +0 -7
- package/lib/StandardDragModal/useResize.js +0 -81
- package/lib/utils/dictSelectUtil.js +0 -161
|
@@ -1,502 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
require("antd/es/modal/style");
|
|
8
|
-
var _modal = _interopRequireDefault(require("antd/es/modal"));
|
|
9
|
-
require("antd/es/button/style");
|
|
10
|
-
var _button = _interopRequireDefault(require("antd/es/button"));
|
|
11
|
-
require("antd/es/col/style");
|
|
12
|
-
var _col = _interopRequireDefault(require("antd/es/col"));
|
|
13
|
-
require("antd/es/row/style");
|
|
14
|
-
var _row = _interopRequireDefault(require("antd/es/row"));
|
|
15
|
-
require("antd/es/form/style");
|
|
16
|
-
var _form = _interopRequireDefault(require("antd/es/form"));
|
|
17
|
-
var _tslib = require("tslib");
|
|
18
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
-
var _data = require("../data");
|
|
20
|
-
var _RenderItemGroup = _interopRequireDefault(require("../FormComp/RenderItemGroup"));
|
|
21
|
-
var _ValueFormat = _interopRequireDefault(require("../utils/ValueFormat.js"));
|
|
22
|
-
var _IconNode = _interopRequireDefault(require("../components/IconNode"));
|
|
23
|
-
var _TabForm = _interopRequireDefault(require("../StandardForm/TabForm"));
|
|
24
|
-
var _StepForm = _interopRequireDefault(require("../StandardForm/StepForm"));
|
|
25
|
-
var _ActionList = _interopRequireDefault(require("../StandardForm/ActionList.js"));
|
|
26
|
-
require("./style/index.less");
|
|
27
|
-
var _Modal2 = _interopRequireDefault(require("../StandardDragModal/Modal"));
|
|
28
|
-
require("../StandardDragModal/index.less");
|
|
29
|
-
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); }
|
|
30
|
-
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; }
|
|
31
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
32
|
-
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); }
|
|
33
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
34
|
-
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."); }
|
|
35
|
-
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); }
|
|
36
|
-
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; }
|
|
37
|
-
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; } }
|
|
38
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import { DraggableModal, DraggableModalProvider } from '../StandardDragModal/index'
|
|
39
|
-
var StandardModal = function StandardModal(props) {
|
|
40
|
-
var children = props.children,
|
|
41
|
-
className = props.className,
|
|
42
|
-
style = props.style,
|
|
43
|
-
_props$size = props.size,
|
|
44
|
-
size = _props$size === void 0 ? 'md' : _props$size,
|
|
45
|
-
type = props.type,
|
|
46
|
-
formItemGroup = props.formItemGroup,
|
|
47
|
-
title = props.title,
|
|
48
|
-
visible = props.visible,
|
|
49
|
-
formPrefix = props.formPrefix,
|
|
50
|
-
formPostfix = props.formPostfix,
|
|
51
|
-
initialValues = props.initialValues,
|
|
52
|
-
hideRequiredMark = props.hideRequiredMark,
|
|
53
|
-
bodyStyle = props.bodyStyle,
|
|
54
|
-
footer = props.footer,
|
|
55
|
-
footerButtonGroup = props.footerButtonGroup,
|
|
56
|
-
hideFooter = props.hideFooter,
|
|
57
|
-
_getFormFields = props.getFormFields,
|
|
58
|
-
_props$fieldStatus = props.fieldStatus,
|
|
59
|
-
fieldStatus = _props$fieldStatus === void 0 ? 'default' : _props$fieldStatus,
|
|
60
|
-
_props$formLayout = props.formLayout,
|
|
61
|
-
formLayout = _props$formLayout === void 0 ? 'horizontal' : _props$formLayout,
|
|
62
|
-
tabsConfig = props.tabsConfig,
|
|
63
|
-
stepsConfig = props.stepsConfig,
|
|
64
|
-
displayLayout = props.displayLayout,
|
|
65
|
-
_props$dragAble = props.dragAble,
|
|
66
|
-
dragAble = _props$dragAble === void 0 ? false : _props$dragAble,
|
|
67
|
-
otherProps = (0, _tslib.__rest)(props, ["children", "className", "style", "size", "type", "formItemGroup", "title", "visible", "formPrefix", "formPostfix", "initialValues", "hideRequiredMark", "bodyStyle", "footer", "footerButtonGroup", "hideFooter", "getFormFields", "fieldStatus", "formLayout", "tabsConfig", "stepsConfig", "displayLayout", "dragAble"]);
|
|
68
|
-
var _Form$useForm = _form.default.useForm(),
|
|
69
|
-
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
70
|
-
modalForm = _Form$useForm2[0];
|
|
71
|
-
var _useState = (0, _react.useState)(),
|
|
72
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
73
|
-
modalFormRef = _useState2[0],
|
|
74
|
-
setModalFormRef = _useState2[1]; // <---- set the ref when Form Rendered
|
|
75
|
-
var _useState3 = (0, _react.useState)(0),
|
|
76
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
77
|
-
bodyMaxHeight = _useState4[0],
|
|
78
|
-
setBodyMaxHeight = _useState4[1]; // setTabFormChild
|
|
79
|
-
var _useState5 = (0, _react.useState)(),
|
|
80
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
81
|
-
formChild = _useState6[0],
|
|
82
|
-
setFormChild = _useState6[1]; // <---- set the ref when Form Rendered
|
|
83
|
-
// 按钮栏是否有显示(默认显示)
|
|
84
|
-
var hasFooterBar = (0, _react.useMemo)(function () {
|
|
85
|
-
var _a, _b, _c, _d, _e;
|
|
86
|
-
var openLog = false;
|
|
87
|
-
if (type === 'tabForm' || type === 'stepForm') {
|
|
88
|
-
if (type === 'tabForm') {
|
|
89
|
-
var activeTabInfo = formItemGroup.find(function (fItem) {
|
|
90
|
-
return fItem.key === (tabsConfig === null || tabsConfig === void 0 ? void 0 : tabsConfig.activeKey);
|
|
91
|
-
});
|
|
92
|
-
openLog && console.log('rule 0-1', ((_a = activeTabInfo === null || activeTabInfo === void 0 ? void 0 : activeTabInfo.actions) === null || _a === void 0 ? void 0 : _a.length) > 0);
|
|
93
|
-
return ((_b = activeTabInfo === null || activeTabInfo === void 0 ? void 0 : activeTabInfo.actions) === null || _b === void 0 ? void 0 : _b.length) > 0;
|
|
94
|
-
}
|
|
95
|
-
if (type === 'stepForm') {
|
|
96
|
-
var currentStepInfo = formItemGroup[stepsConfig.current];
|
|
97
|
-
openLog && console.log('rule 0-2', ((_c = currentStepInfo === null || currentStepInfo === void 0 ? void 0 : currentStepInfo.actions) === null || _c === void 0 ? void 0 : _c.length) > 0);
|
|
98
|
-
return ((_d = currentStepInfo === null || currentStepInfo === void 0 ? void 0 : currentStepInfo.actions) === null || _d === void 0 ? void 0 : _d.length) > 0;
|
|
99
|
-
}
|
|
100
|
-
return true;
|
|
101
|
-
} else {
|
|
102
|
-
if (hideFooter) {
|
|
103
|
-
openLog && console.log('rule 1');
|
|
104
|
-
return false;
|
|
105
|
-
}
|
|
106
|
-
if (fieldStatus && fieldStatus !== 'default') {
|
|
107
|
-
if (props.hasOwnProperty('footerButtonGroup')) {
|
|
108
|
-
// 如果有配置按钮组件,则还是要显示按钮
|
|
109
|
-
return true;
|
|
110
|
-
}
|
|
111
|
-
openLog && console.log('rule 2');
|
|
112
|
-
// disabled/viewOnly都不显示按钮
|
|
113
|
-
return false;
|
|
114
|
-
}
|
|
115
|
-
if (props.hasOwnProperty('footerButtonGroup') && footerButtonGroup) {
|
|
116
|
-
if (Array.isArray(footerButtonGroup) && footerButtonGroup.length === 0) {
|
|
117
|
-
openLog && console.log('rule 4');
|
|
118
|
-
// 返回为空数组不占用按钮栏
|
|
119
|
-
return false;
|
|
120
|
-
} else if (typeof footerButtonGroup === 'function' && (!footerButtonGroup() || ((_e = footerButtonGroup()) === null || _e === void 0 ? void 0 : _e.length) === 0)) {
|
|
121
|
-
openLog && console.log('rule 5');
|
|
122
|
-
// 配置类型为Function且返回值为null或者返回数组长度为0时,不显示按钮栏
|
|
123
|
-
return false;
|
|
124
|
-
}
|
|
125
|
-
openLog && console.log('rule 3');
|
|
126
|
-
return true;
|
|
127
|
-
} else if (footerButtonGroup === false) {
|
|
128
|
-
openLog && console.log('rule 7');
|
|
129
|
-
// 显示
|
|
130
|
-
return true;
|
|
131
|
-
}
|
|
132
|
-
if (props.hasOwnProperty('footer') && !footer) {
|
|
133
|
-
openLog && console.log('rule 8');
|
|
134
|
-
return false;
|
|
135
|
-
}
|
|
136
|
-
openLog && console.log('rule 9');
|
|
137
|
-
return true;
|
|
138
|
-
}
|
|
139
|
-
}, [fieldStatus, hideFooter, footer, footerButtonGroup, type, tabsConfig, stepsConfig, formItemGroup]);
|
|
140
|
-
// 设置限制弹窗高度
|
|
141
|
-
var initBodyMaxHeight = function initBodyMaxHeight() {
|
|
142
|
-
var title = props.title;
|
|
143
|
-
var bodyHeight = document.body.offsetHeight;
|
|
144
|
-
var baseReduce = 80 + 32; // 默认需要减去的高度(上下空白间距150及内部内容间距16*2
|
|
145
|
-
// console.log('弹窗是否有按钮:', hasFooterBar ? '是' : '否')
|
|
146
|
-
setBodyMaxHeight("".concat(bodyHeight - (title ? 55 : 0) - (hasFooterBar ? 55 : 0) - baseReduce, "px"));
|
|
147
|
-
// setBodyMaxHeight(`${bodyHeight - (title ? 55 : 0) - ((footer || footerButtonGroup) ? 55 : 0) - baseReduce +
|
|
148
|
-
// ((fieldStatus && fieldStatus !== 'default' && !footerButtonGroup) || hideFooter ? 55 : 0)}px`)
|
|
149
|
-
};
|
|
150
|
-
// fill Form when modal open 此处可解决获取 Form.useForm warning
|
|
151
|
-
(0, _react.useEffect)(function () {
|
|
152
|
-
if (visible && modalFormRef) {
|
|
153
|
-
// <---- check ref before use the form instance
|
|
154
|
-
if (initialValues && _typeof(initialValues) === 'object') {
|
|
155
|
-
initialValues && modalForm.setFieldsValue(Object.assign({}, initialValues));
|
|
156
|
-
forceUpdateForm();
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
// if (!visible && modalFormRef) {
|
|
160
|
-
// clearAllFieldsValue() // 清空表单传参数
|
|
161
|
-
// }
|
|
162
|
-
}, [modalFormRef, visible]);
|
|
163
|
-
(0, _react.useEffect)(function () {
|
|
164
|
-
if (visible) {
|
|
165
|
-
initBodyMaxHeight();
|
|
166
|
-
// 让resize事件触发 initBodyMaxHeight
|
|
167
|
-
window.addEventListener('resize', initBodyMaxHeight);
|
|
168
|
-
} else {
|
|
169
|
-
window.removeEventListener('resize', initBodyMaxHeight);
|
|
170
|
-
}
|
|
171
|
-
}, [fieldStatus, title, visible, hideFooter, footer, footerButtonGroup]);
|
|
172
|
-
var handleSubmit = function handleSubmit() {
|
|
173
|
-
var type = props.type,
|
|
174
|
-
formItemGroup = props.formItemGroup,
|
|
175
|
-
onSubmit = props.onSubmit;
|
|
176
|
-
if (type === 'form' || type === 'gridForm') {
|
|
177
|
-
modalForm.validateFields().then(function (values) {
|
|
178
|
-
if (Object.prototype.hasOwnProperty.call(values, 'false')) {
|
|
179
|
-
delete values.false; // 自定义结构会莫名的出来一个false字段
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
var resultValues = (0, _ValueFormat.default)(values, formItemGroup);
|
|
183
|
-
if (onSubmit) {
|
|
184
|
-
onSubmit(Object.assign({}, resultValues));
|
|
185
|
-
}
|
|
186
|
-
}).catch(function () {
|
|
187
|
-
// 定位到第一条表单异常的
|
|
188
|
-
var errorCollection = Array.prototype.slice.call(document.getElementsByClassName('ant-form-item-has-error'));
|
|
189
|
-
if (errorCollection[0] && errorCollection[0].getElementsByTagName('input')) {
|
|
190
|
-
Array.prototype.slice.call(errorCollection[0].getElementsByTagName('input'))[0].focus();
|
|
191
|
-
}
|
|
192
|
-
// console.error('表单填写有误', errorInfo, '第一条数据',errorInfo.errorFields[0].name[0])
|
|
193
|
-
});
|
|
194
|
-
} else if (type === 'stepForm' || type === 'tabForm') {
|
|
195
|
-
// onSubmit && onSubmit()
|
|
196
|
-
formChild.validateFields().then(function (values) {
|
|
197
|
-
// console.log(values)
|
|
198
|
-
if (Object.prototype.hasOwnProperty.call(values, 'false')) {
|
|
199
|
-
delete values.false; // 自定义结构会莫名的出来一个false字段
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
var resultValues = (0, _ValueFormat.default)(values, formItemGroup);
|
|
203
|
-
if (onSubmit) {
|
|
204
|
-
onSubmit(Object.assign({}, resultValues));
|
|
205
|
-
}
|
|
206
|
-
}).catch(function () {
|
|
207
|
-
// 定位到第一条表单异常的
|
|
208
|
-
var errorCollection = Array.prototype.slice.call(document.getElementsByClassName('ant-form-item-has-error'));
|
|
209
|
-
if (errorCollection[0] && errorCollection[0].getElementsByTagName('input')) {
|
|
210
|
-
Array.prototype.slice.call(errorCollection[0].getElementsByTagName('input'))[0].focus();
|
|
211
|
-
}
|
|
212
|
-
// console.error('表单填写有误', errorInfo, '第一条数据',errorInfo.errorFields[0].name[0])
|
|
213
|
-
});
|
|
214
|
-
} else {
|
|
215
|
-
// 没有表单数组 formItemGroup 配置
|
|
216
|
-
onSubmit && onSubmit();
|
|
217
|
-
}
|
|
218
|
-
};
|
|
219
|
-
// 重置所有表单
|
|
220
|
-
var clearAllFieldsValue = function clearAllFieldsValue() {
|
|
221
|
-
// let allFields = {}
|
|
222
|
-
// Object.keys(modalForm.getFieldsValue()).map((item) => allFields[item] = undefined)
|
|
223
|
-
// modalForm.setFieldsValue(allFields) // 直接清空表单的赋值(initialValues传值如果没有前后赋值没有全部带上所有字段,则会默认又使用之前的部分未传参字段)
|
|
224
|
-
modalForm.resetFields(); // 直接使用这个无效
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
var onAfterClose = function onAfterClose() {
|
|
228
|
-
var afterClose = props.afterClose;
|
|
229
|
-
if (type === 'form') clearAllFieldsValue();
|
|
230
|
-
if (afterClose) afterClose();
|
|
231
|
-
};
|
|
232
|
-
var handleCancel = function handleCancel() {
|
|
233
|
-
var onCancel = props.onCancel;
|
|
234
|
-
if (onCancel) onCancel();
|
|
235
|
-
};
|
|
236
|
-
// 强制更新表单值,用于赋初始化实例值
|
|
237
|
-
var forceUpdateForm = function forceUpdateForm() {
|
|
238
|
-
_getFormFields && _getFormFields(modalForm.getFieldsValue() || {}, modalForm);
|
|
239
|
-
};
|
|
240
|
-
var renderFormItemGroup = function renderFormItemGroup() {
|
|
241
|
-
var fieldStatus = props.fieldStatus,
|
|
242
|
-
formItemGroup = props.formItemGroup,
|
|
243
|
-
_props$size2 = props.size,
|
|
244
|
-
size = _props$size2 === void 0 ? 'md' : _props$size2,
|
|
245
|
-
type = props.type;
|
|
246
|
-
if (Array.isArray(formItemGroup)) {
|
|
247
|
-
if (type === 'gridForm') {
|
|
248
|
-
// 栅格组
|
|
249
|
-
return /*#__PURE__*/_react.default.createElement(_row.default, {
|
|
250
|
-
gutter: 20
|
|
251
|
-
}, formItemGroup.map(function (item, index) {
|
|
252
|
-
var childrenFields = item.fields || [];
|
|
253
|
-
if (item.label) {
|
|
254
|
-
childrenFields = [{
|
|
255
|
-
type: item.type,
|
|
256
|
-
label: item.label,
|
|
257
|
-
protoConfig: Object.assign({}, item.protoConfig)
|
|
258
|
-
}].concat(childrenFields);
|
|
259
|
-
}
|
|
260
|
-
return /*#__PURE__*/_react.default.createElement(_col.default, {
|
|
261
|
-
key: index,
|
|
262
|
-
span: item.gridSpan || 24
|
|
263
|
-
}, /*#__PURE__*/_react.default.createElement(_RenderItemGroup.default, {
|
|
264
|
-
size: size,
|
|
265
|
-
layout: formLayout,
|
|
266
|
-
doUpdateFormFields: function doUpdateFormFields() {
|
|
267
|
-
return forceUpdateForm();
|
|
268
|
-
},
|
|
269
|
-
displayLayout: item.displayLayout || displayLayout,
|
|
270
|
-
itemGroup: childrenFields,
|
|
271
|
-
fieldStatus: fieldStatus,
|
|
272
|
-
form: modalForm
|
|
273
|
-
}));
|
|
274
|
-
}));
|
|
275
|
-
}
|
|
276
|
-
return /*#__PURE__*/_react.default.createElement(_RenderItemGroup.default, {
|
|
277
|
-
size: size,
|
|
278
|
-
layout: formLayout,
|
|
279
|
-
doUpdateFormFields: function doUpdateFormFields() {
|
|
280
|
-
return forceUpdateForm();
|
|
281
|
-
},
|
|
282
|
-
displayLayout: displayLayout,
|
|
283
|
-
itemGroup: formItemGroup,
|
|
284
|
-
fieldStatus: fieldStatus,
|
|
285
|
-
form: modalForm
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
return formItemGroup;
|
|
289
|
-
};
|
|
290
|
-
var handleStepType = function handleStepType(type, extraFunc) {
|
|
291
|
-
var current = stepsConfig.current;
|
|
292
|
-
switch (type) {
|
|
293
|
-
case 'submit':
|
|
294
|
-
case 'next':
|
|
295
|
-
// 获取当前步骤的表单配置下有 rules 的控件进行校验(自定义的控件则自己有业务层面处理添加校验)
|
|
296
|
-
// console.log('执行下一步骤,需要优先进行校验')
|
|
297
|
-
var currentFields = formItemGroup[current].fields;
|
|
298
|
-
var validatorGroup = currentFields && Array.isArray(currentFields) ? currentFields.map(function (fItem) {
|
|
299
|
-
return fItem.rules ? fItem.filedName : null;
|
|
300
|
-
}) : [];
|
|
301
|
-
formChild.validateFields(validatorGroup).then(function () {
|
|
302
|
-
// if (stepClick) stepClick(type, formChild, values);
|
|
303
|
-
extraFunc();
|
|
304
|
-
}).catch(function () {
|
|
305
|
-
// console.log('表单校验不通过 ', errorFields.map(err => err))
|
|
306
|
-
});
|
|
307
|
-
break;
|
|
308
|
-
case 'prev':
|
|
309
|
-
// if (stepClick) stepClick(type, formChild);
|
|
310
|
-
extraFunc();
|
|
311
|
-
break;
|
|
312
|
-
case 'cancel':
|
|
313
|
-
// if (stepClick) stepClick(type, formChild);
|
|
314
|
-
extraFunc();
|
|
315
|
-
break;
|
|
316
|
-
default:
|
|
317
|
-
// extraFunc()
|
|
318
|
-
break;
|
|
319
|
-
}
|
|
320
|
-
};
|
|
321
|
-
var renderButtonGroup = function renderButtonGroup() {
|
|
322
|
-
var footerButtonGroup = props.footerButtonGroup,
|
|
323
|
-
confirmLoading = props.confirmLoading,
|
|
324
|
-
cancelText = props.cancelText,
|
|
325
|
-
confirmText = props.confirmText,
|
|
326
|
-
okText = props.okText,
|
|
327
|
-
okButtonProps = props.okButtonProps,
|
|
328
|
-
confirmButtonProps = props.confirmButtonProps,
|
|
329
|
-
cancelButtonProps = props.cancelButtonProps;
|
|
330
|
-
if (footerButtonGroup) {
|
|
331
|
-
if (Array.isArray(footerButtonGroup)) {
|
|
332
|
-
if (footerButtonGroup.length === 0) return null; // <div>按钮组合配置为空</div>
|
|
333
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, footerButtonGroup.map(function (item) {
|
|
334
|
-
if (_typeof(item) === 'object') {
|
|
335
|
-
if (item.isHide) return null;
|
|
336
|
-
var name = item.name,
|
|
337
|
-
_type = item.type,
|
|
338
|
-
icon = item.icon,
|
|
339
|
-
ghost = item.ghost,
|
|
340
|
-
disabled = item.disabled,
|
|
341
|
-
loading = item.loading,
|
|
342
|
-
fn = item.fn,
|
|
343
|
-
others = (0, _tslib.__rest)(item, ["name", "type", "icon", "ghost", "disabled", "loading", "fn"]);
|
|
344
|
-
return /*#__PURE__*/_react.default.createElement(_button.default, Object.assign({
|
|
345
|
-
key: name,
|
|
346
|
-
type: _type || 'primary',
|
|
347
|
-
icon: /*#__PURE__*/_react.default.createElement(_IconNode.default, {
|
|
348
|
-
icon: icon
|
|
349
|
-
}),
|
|
350
|
-
ghost: ghost,
|
|
351
|
-
disabled: disabled,
|
|
352
|
-
loading: loading,
|
|
353
|
-
onClick: fn ? function (e) {
|
|
354
|
-
return fn(item, modalForm, props, e);
|
|
355
|
-
} : null
|
|
356
|
-
}, others), name);
|
|
357
|
-
} else {
|
|
358
|
-
return item; // 如果是DOM,则直接渲染
|
|
359
|
-
}
|
|
360
|
-
}));
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
if (typeof footerButtonGroup === 'function') {
|
|
364
|
-
return footerButtonGroup(modalForm, props);
|
|
365
|
-
}
|
|
366
|
-
return footerButtonGroup;
|
|
367
|
-
}
|
|
368
|
-
if (footer) return footer;
|
|
369
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_button.default, Object.assign({
|
|
370
|
-
key: "submit",
|
|
371
|
-
type: 'primary',
|
|
372
|
-
loading: confirmLoading,
|
|
373
|
-
onClick: handleSubmit
|
|
374
|
-
}, confirmButtonProps, okButtonProps), confirmText || okText || '确定'), /*#__PURE__*/_react.default.createElement(_button.default, Object.assign({
|
|
375
|
-
key: "back",
|
|
376
|
-
onClick: handleCancel
|
|
377
|
-
}, cancelButtonProps), cancelText || '取消'));
|
|
378
|
-
};
|
|
379
|
-
var renderFooter = function renderFooter() {
|
|
380
|
-
var _a, _b;
|
|
381
|
-
if (type === 'stepForm') {
|
|
382
|
-
var currentStepInfo = formItemGroup[stepsConfig.current];
|
|
383
|
-
return ((_a = currentStepInfo === null || currentStepInfo === void 0 ? void 0 : currentStepInfo.actions) === null || _a === void 0 ? void 0 : _a.length) > 0 ? /*#__PURE__*/_react.default.createElement(_ActionList.default, {
|
|
384
|
-
list: currentStepInfo.actions || [],
|
|
385
|
-
onStep: handleStepType,
|
|
386
|
-
form: formChild,
|
|
387
|
-
other: props
|
|
388
|
-
}) : null;
|
|
389
|
-
}
|
|
390
|
-
if (type === 'tabForm') {
|
|
391
|
-
var activeTabInfo = formItemGroup.find(function (fItem) {
|
|
392
|
-
return fItem.key === (tabsConfig === null || tabsConfig === void 0 ? void 0 : tabsConfig.activeKey);
|
|
393
|
-
});
|
|
394
|
-
return ((_b = activeTabInfo === null || activeTabInfo === void 0 ? void 0 : activeTabInfo.actions) === null || _b === void 0 ? void 0 : _b.length) > 0 ? /*#__PURE__*/_react.default.createElement(_ActionList.default, {
|
|
395
|
-
list: activeTabInfo.actions || [],
|
|
396
|
-
form: formChild,
|
|
397
|
-
other: props
|
|
398
|
-
}) : null;
|
|
399
|
-
}
|
|
400
|
-
return hasFooterBar ? renderButtonGroup() : null;
|
|
401
|
-
};
|
|
402
|
-
// 内容渲染
|
|
403
|
-
var renderChildrenNodes = function renderChildrenNodes() {
|
|
404
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children, (type === 'form' || type === 'gridForm') && /*#__PURE__*/_react.default.createElement(_form.default, {
|
|
405
|
-
layout: formLayout,
|
|
406
|
-
ref: setModalFormRef,
|
|
407
|
-
form: modalForm,
|
|
408
|
-
onFinish: handleSubmit,
|
|
409
|
-
hideRequiredMark: fieldStatus === 'viewOnly' || hideRequiredMark,
|
|
410
|
-
// initialValues={{ ...initialValues }}
|
|
411
|
-
scrollToFirstError: true,
|
|
412
|
-
className: "modalForm"
|
|
413
|
-
}, formPrefix && /*#__PURE__*/_react.default.createElement(_row.default, null, formPrefix(modalForm, props, forceUpdateForm)), formItemGroup ? renderFormItemGroup() : null, formPostfix && /*#__PURE__*/_react.default.createElement(_row.default, null, formPostfix(modalForm, props, forceUpdateForm), " ")), type === 'tabForm' && /*#__PURE__*/_react.default.createElement(_TabForm.default, {
|
|
414
|
-
grid: size,
|
|
415
|
-
layout: formLayout,
|
|
416
|
-
fieldStatus: fieldStatus,
|
|
417
|
-
actionHide: true,
|
|
418
|
-
// @ts-ignore
|
|
419
|
-
getFormFields: function getFormFields(fields, form) {
|
|
420
|
-
setFormChild(form);
|
|
421
|
-
_getFormFields && _getFormFields(fields, form);
|
|
422
|
-
},
|
|
423
|
-
formItemGroup: formItemGroup,
|
|
424
|
-
tabsConfig: tabsConfig,
|
|
425
|
-
onSubmit: handleSubmit,
|
|
426
|
-
initialValues: Object.assign({}, initialValues),
|
|
427
|
-
displayLayout: displayLayout
|
|
428
|
-
}), type === 'stepForm' && /*#__PURE__*/_react.default.createElement(_StepForm.default, {
|
|
429
|
-
grid: size,
|
|
430
|
-
layout: formLayout,
|
|
431
|
-
fieldStatus: fieldStatus,
|
|
432
|
-
actionHide: true,
|
|
433
|
-
// @ts-ignore
|
|
434
|
-
getFormFields: function getFormFields(fields, form) {
|
|
435
|
-
setFormChild(form);
|
|
436
|
-
_getFormFields && _getFormFields(fields, form);
|
|
437
|
-
},
|
|
438
|
-
formItemGroup: formItemGroup,
|
|
439
|
-
stepsConfig: stepsConfig,
|
|
440
|
-
onSubmit: handleSubmit,
|
|
441
|
-
initialValues: Object.assign({}, initialValues),
|
|
442
|
-
displayLayout: displayLayout
|
|
443
|
-
}));
|
|
444
|
-
};
|
|
445
|
-
// 可拖动及缩放
|
|
446
|
-
if (dragAble) {
|
|
447
|
-
return /*#__PURE__*/_react.default.createElement(_Modal2.default, Object.assign({
|
|
448
|
-
destroyOnClose: true,
|
|
449
|
-
initialWidth: otherProps.width || _data.general.modalSize[size].width,
|
|
450
|
-
initialHeight: otherProps.height,
|
|
451
|
-
zIndex: 1001
|
|
452
|
-
}, otherProps, {
|
|
453
|
-
visible: visible,
|
|
454
|
-
className: "standardModal ".concat(className || '', " ").concat(fieldStatus === 'viewOnly' ? 'is-view' : ''),
|
|
455
|
-
onCancel: handleCancel,
|
|
456
|
-
afterClose: onAfterClose,
|
|
457
|
-
onOk: handleSubmit,
|
|
458
|
-
title: title,
|
|
459
|
-
footer: renderFooter()
|
|
460
|
-
}), renderChildrenNodes());
|
|
461
|
-
/* return <DraggableModalProvider>
|
|
462
|
-
<DraggableModal destroyOnClose
|
|
463
|
-
initialWidth={otherProps.width || general.modalSize[size].width}
|
|
464
|
-
initialHeight={otherProps.height}
|
|
465
|
-
zIndex={1001}
|
|
466
|
-
{...otherProps}
|
|
467
|
-
visible={visible}
|
|
468
|
-
className={`standardModal ${className || ''} ${fieldStatus === 'viewOnly' ? 'is-view' : ''}`}
|
|
469
|
-
onCancel={handleCancel}
|
|
470
|
-
afterClose={onAfterClose}
|
|
471
|
-
onOk={handleSubmit}
|
|
472
|
-
title={title}
|
|
473
|
-
footer={renderFooter()}
|
|
474
|
-
>
|
|
475
|
-
{renderChildrenNodes()}
|
|
476
|
-
</DraggableModal>
|
|
477
|
-
</DraggableModalProvider>*/
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
return /*#__PURE__*/_react.default.createElement(_modal.default, Object.assign({
|
|
481
|
-
destroyOnClose: true,
|
|
482
|
-
maskClosable: false,
|
|
483
|
-
width: _data.general.modalSize[size].width
|
|
484
|
-
}, otherProps, {
|
|
485
|
-
open: visible,
|
|
486
|
-
title: title,
|
|
487
|
-
footer: renderFooter(),
|
|
488
|
-
className: "standardModal ".concat(className || '', " ").concat(fieldStatus === 'viewOnly' ? 'is-view' : ''),
|
|
489
|
-
style: Object.assign({
|
|
490
|
-
top: '80px'
|
|
491
|
-
}, style),
|
|
492
|
-
bodyStyle: Object.assign({
|
|
493
|
-
maxHeight: bodyMaxHeight,
|
|
494
|
-
overflowY: 'scroll'
|
|
495
|
-
}, bodyStyle),
|
|
496
|
-
onCancel: handleCancel,
|
|
497
|
-
afterClose: onAfterClose,
|
|
498
|
-
onOk: handleSubmit
|
|
499
|
-
}), renderChildrenNodes());
|
|
500
|
-
};
|
|
501
|
-
var _default = StandardModal;
|
|
502
|
-
exports.default = _default;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react';
|
|
2
|
-
import { ModalProps } from 'antd/lib/modal';
|
|
3
|
-
export interface DraggableModalProps extends ModalProps {
|
|
4
|
-
initialWidth?: number;
|
|
5
|
-
initialHeight?: number;
|
|
6
|
-
}
|
|
7
|
-
export declare const DraggableModal: FunctionComponent<DraggableModalProps>;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
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); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.DraggableModal = void 0;
|
|
8
|
-
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _reactUid = require("react-uid");
|
|
10
|
-
var _DraggableModalContext = require("./DraggableModalContext");
|
|
11
|
-
var _DraggableModalInner = require("./DraggableModalInner");
|
|
12
|
-
var _draggableModalReducer = require("./draggableModalReducer");
|
|
13
|
-
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); }
|
|
14
|
-
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; }
|
|
15
|
-
var DraggableModal = function DraggableModal(props) {
|
|
16
|
-
// Get the unique ID of this modal.
|
|
17
|
-
var id = (0, _reactUid.useUID)();
|
|
18
|
-
// Get modal provider.
|
|
19
|
-
var modalProvider = (0, React.useContext)(_DraggableModalContext.DraggableModalContext);
|
|
20
|
-
if (!modalProvider) {
|
|
21
|
-
throw new Error('No Provider');
|
|
22
|
-
}
|
|
23
|
-
var dispatch = modalProvider.dispatch,
|
|
24
|
-
state = modalProvider.state;
|
|
25
|
-
var modalState = (0, _draggableModalReducer.getModalState)({
|
|
26
|
-
state: state,
|
|
27
|
-
id: id,
|
|
28
|
-
initialHeight: props.initialHeight,
|
|
29
|
-
initialWidth: props.initialWidth
|
|
30
|
-
});
|
|
31
|
-
// We do this so that we don't re-render all modals for every state change.
|
|
32
|
-
// DraggableModalInner uses React.memo, so it only re-renders if
|
|
33
|
-
// if props change (e.g. modalState).
|
|
34
|
-
return /*#__PURE__*/React.createElement(_DraggableModalInner.DraggableModalInner, Object.assign({
|
|
35
|
-
id: id,
|
|
36
|
-
dispatch: dispatch,
|
|
37
|
-
modalState: modalState
|
|
38
|
-
}, props));
|
|
39
|
-
};
|
|
40
|
-
exports.DraggableModal = DraggableModal;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Action, ModalsState } from './draggableModalReducer';
|
|
3
|
-
export interface DraggableModalContextMethods {
|
|
4
|
-
dispatch: (action: Action) => void;
|
|
5
|
-
}
|
|
6
|
-
export interface DraggableModalContextValue extends DraggableModalContextMethods {
|
|
7
|
-
state: ModalsState;
|
|
8
|
-
}
|
|
9
|
-
export declare const DraggableModalContext: React.Context<DraggableModalContextValue>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
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); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.DraggableModalContext = void 0;
|
|
8
|
-
var React = _interopRequireWildcard(require("react"));
|
|
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; }
|
|
11
|
-
var DraggableModalContext = /*#__PURE__*/React.createContext(null);
|
|
12
|
-
exports.DraggableModalContext = DraggableModalContext;
|
|
13
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
14
|
-
DraggableModalContext.displayName = 'DraggableModalContext';
|
|
15
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ModalProps } from 'antd/lib/modal';
|
|
3
|
-
import { DraggableModalContextMethods } from './DraggableModalContext';
|
|
4
|
-
import { ModalID, ModalState } from './draggableModalReducer';
|
|
5
|
-
interface ContextProps extends DraggableModalContextMethods {
|
|
6
|
-
id: ModalID;
|
|
7
|
-
modalState: ModalState;
|
|
8
|
-
initialWidth?: number;
|
|
9
|
-
initialHeight?: number;
|
|
10
|
-
}
|
|
11
|
-
export declare type DraggableModalInnerProps = ModalProps & {
|
|
12
|
-
children?: React.ReactNode;
|
|
13
|
-
} & ContextProps;
|
|
14
|
-
declare function DraggableModalInnerNonMemo({ id, modalState, dispatch, visible, children, title, initialWidth, initialHeight, ...otherProps }: DraggableModalInnerProps): JSX.Element;
|
|
15
|
-
export declare const DraggableModalInner: React.MemoExoticComponent<typeof DraggableModalInnerNonMemo>;
|
|
16
|
-
export {};
|