fan-standard-comp 3.2.1 → 4.0.1
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/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/fan-standard-comp.min.css +1 -0
- package/dist/fan-standard-comp.min.js +1 -0
- package/es/ButtonGroup/PopConfirmTitle.d.ts +1 -1
- package/es/ButtonGroup/PopConfirmTitle.js +2 -2
- package/es/ButtonGroup/index.d.ts +5 -3
- package/es/ButtonGroup/index.js +259 -189
- package/es/ButtonGroup/styles/index.d.ts +8 -0
- package/es/ButtonGroup/styles/index.js +61 -0
- package/es/ButtonGroup/testStyles/index(antd-style).d.ts +11 -0
- package/es/ButtonGroup/testStyles/index(antd-style).js +28 -0
- package/es/ButtonGroup/testStyles/index(cssinjs).js +133 -0
- package/es/ButtonGroup/testStyles/index.d.ts +11 -0
- package/es/ButtonGroup/testStyles/index.js +23 -0
- package/es/CalendarCoordPicker/CalendarMonthPicker.d.ts +5 -0
- package/es/CalendarCoordPicker/CalendarMonthPicker.js +32 -0
- package/es/CalendarCoordPicker/index.d.ts +7 -0
- package/es/CalendarCoordPicker/index.js +314 -0
- package/es/CalendarCoordPicker/styles/index.d.ts +6 -0
- package/es/CalendarCoordPicker/styles/index.js +28 -0
- package/es/CalendarCoordPicker/styles/index.less +37 -0
- package/es/ConfigContext/index.d.ts +7 -0
- package/es/ConfigContext/index.js +20 -0
- package/es/DragContent/DragBar.d.ts +3 -0
- package/es/DragContent/DragBar.js +0 -1
- package/es/DragContent/index.d.ts +1 -1
- package/es/DragContent/index.js +20 -6
- package/es/DragContent/styles/index.d.ts +6 -0
- package/es/DragContent/styles/index.js +52 -0
- package/es/FormComp/ChunkUploader/api.js +11 -11
- package/es/FormComp/ChunkUploader/index.js +125 -132
- package/es/FormComp/ChunkUploader/lib.js +19 -19
- package/es/FormComp/ChunkUploader/upload-queue.class.js +51 -51
- package/es/FormComp/EditButton/index.d.ts +1 -1
- package/es/FormComp/EditButton/index.js +18 -17
- package/es/FormComp/FieldComponent/ReUpload.d.ts +1 -1
- package/es/FormComp/FieldComponent/ReUpload.js +45 -37
- package/es/FormComp/FieldComponent/RefactorTreeSelect.js +28 -19
- package/es/FormComp/FieldComponent/TitleNode.d.ts +2 -1
- package/es/FormComp/FieldComponent/UploaderViewer.d.ts +2 -0
- package/es/FormComp/FieldComponent/UploaderViewer.js +92 -0
- package/es/FormComp/FieldComponent/index.d.ts +1 -1
- package/es/FormComp/FieldComponent/index.js +88 -109
- package/es/FormComp/FieldComponent/setReadonlyValues.js +21 -15
- package/es/FormComp/FieldComponent/style/TreeSelect.d.ts +6 -0
- package/es/FormComp/FieldComponent/style/TreeSelect.js +42 -0
- package/es/FormComp/FieldComponent/style/UploaderStyle.d.ts +6 -0
- package/es/FormComp/FieldComponent/style/UploaderStyle.js +25 -0
- package/es/FormComp/FieldComponent/style/index.less +26 -21
- package/es/FormComp/RenderItemGroup/index.d.ts +4 -0
- package/es/FormComp/RenderItemGroup/index.js +183 -66
- package/es/FormComp/RenderItemGroup/style/index.d.ts +6 -0
- package/es/FormComp/RenderItemGroup/style/index.js +40 -0
- package/es/FormComp/Uploader/index.js +94 -75
- package/es/FormComp/Uploader/style/index.less +14 -14
- package/es/FormComp/Uploader/util.d.ts +2 -2
- package/es/FormComp/VarTemplate/index.js +32 -40
- package/es/FormComp/index.js +1 -1
- package/es/NavLeafScroll/Main.js +443 -0
- package/es/NavLeafScroll/index.d.ts +2 -0
- package/es/NavLeafScroll/index.js +21 -395
- package/es/NavLeafScroll/style/index.d.ts +6 -0
- package/es/NavLeafScroll/style/index.js +56 -0
- package/es/NavLeafScroll/style/index.less +22 -22
- package/es/RefactorTree/index.d.ts +1 -1
- package/es/RefactorTree/index.js +21 -19
- package/es/RefactorTree/style/index.js +1 -1
- package/es/RefactorTree/style/index.less +22 -22
- package/es/RefactorTree/util.d.ts +2 -2
- package/es/RefactorTree/util.js +30 -15
- 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/index.d.ts +0 -1
- package/es/SpecIcon/index.js +33 -12
- package/es/SpecIcon/styles/index(antd-style).d.ts +6 -0
- package/es/SpecIcon/styles/index(antd-style).js +13 -0
- package/es/SpecIcon/styles/index.d.ts +6 -0
- package/es/SpecIcon/styles/index.js +93 -0
- package/es/StandardContent/SplitterLayout/Pane.js +3 -3
- package/es/StandardContent/SplitterLayout/index.js +7 -6
- package/es/StandardContent/SplitterLayout/index.less +0 -1
- package/es/StandardContent/SubfieldContent.d.ts +3 -2
- package/es/StandardContent/SubfieldContent.js +24 -12
- package/es/StandardContent/WrapperContent.d.ts +2 -2
- package/es/StandardContent/WrapperContent.js +22 -11
- package/es/StandardContent/styles/Subfield.d.ts +6 -0
- package/es/StandardContent/styles/Subfield.js +30 -0
- package/es/StandardContent/styles/Wrapper.d.ts +6 -0
- package/es/StandardContent/styles/Wrapper.js +28 -0
- package/es/StandardContent/styles/index.less +67 -0
- package/es/StandardDragModal/ChangeStandardModal.d.ts +2 -2
- package/es/StandardDragModal/ChangeStandardModal.js +84 -71
- package/es/StandardDragModal/DraggableModal.js +7 -4
- package/es/StandardDragModal/DraggableModalContext.d.ts +1 -1
- package/es/StandardDragModal/DraggableModalInner.d.ts +2 -2
- package/es/StandardDragModal/DraggableModalInner.js +31 -21
- package/es/StandardDragModal/DraggableModalProvider.js +5 -5
- package/es/StandardDragModal/Modal.d.ts +1 -1
- package/es/StandardDragModal/Modal.js +8 -5
- package/es/StandardDragModal/ResizeHandle.js +2 -1
- package/es/StandardDragModal/draggableModalReducer.d.ts +4 -4
- package/es/StandardDragModal/draggableModalReducer.js +31 -22
- package/es/StandardDragModal/index.js +3 -3
- package/es/StandardDragModal/useDrag.js +2 -2
- package/es/StandardDragModal/useResize.js +2 -2
- package/es/StandardFilter/index.d.ts +8 -17
- package/es/StandardFilter/index.js +279 -206
- package/es/StandardFilter/style/FilterStyle.d.ts +6 -0
- package/es/StandardFilter/style/FilterStyle.js +50 -0
- package/es/StandardFilter/style/index.less +85 -36
- package/es/StandardForm/ActionList.d.ts +9 -0
- package/es/StandardForm/ActionList.js +5 -5
- package/es/StandardForm/StepForm.d.ts +1 -1
- package/es/StandardForm/StepForm.js +47 -40
- package/es/StandardForm/TabForm.d.ts +2 -1
- package/es/StandardForm/TabForm.js +50 -41
- package/es/StandardForm/index.d.ts +2 -1
- package/es/StandardForm/index.js +40 -22
- package/es/StandardForm/style/index.d.ts +6 -0
- package/es/StandardForm/style/index.js +49 -0
- package/es/StandardForm/style/index.less +23 -12
- package/es/StandardModal/UpdateFormRef.js +0 -1
- package/es/StandardModal/index.d.ts +4 -3
- package/es/StandardModal/index.js +153 -133
- package/es/StandardModal/style/index.d.ts +6 -0
- package/es/StandardModal/style/index.js +46 -0
- package/es/StandardModal/style/index.less +29 -29
- package/es/StandardPanel/index.d.ts +1 -1
- package/es/StandardPanel/index.js +28 -17
- package/es/StandardPanel/style/index.d.ts +6 -0
- package/es/StandardPanel/style/index.js +87 -0
- package/es/StandardPanel/style/index.less +30 -32
- package/es/StandardTable/index.d.ts +6 -1
- package/es/StandardTable/index.js +92 -40
- package/es/StandardTable/style/index.d.ts +6 -1
- package/es/StandardTable/style/index.js +113 -1
- package/es/StandardTable/style/index.less +89 -80
- package/es/components/IconNode/index.d.ts +1 -1
- package/es/components/IconNode/index.js +12 -1
- package/es/components/index.js +1 -1
- package/es/data/func.code.d.ts +16 -0
- package/es/data/general.config.d.ts +191 -0
- package/es/data/general.config.js +32 -1
- package/es/data/index.d.ts +3 -0
- package/es/data/index.js +2 -2
- package/es/index.d.ts +7 -6
- package/es/index.js +32 -26
- package/es/theme/index.d.ts +27 -0
- package/es/theme/index.js +29 -0
- package/es/theme/utils/genStyleHook.d.ts +1 -0
- package/es/theme/utils/genStyleHook.js +32 -0
- package/es/utils/ValueFormat.d.ts +3 -0
- package/es/utils/ValueFormat.js +17 -4
- package/es/utils/dictSelectUtil.d.ts +36 -0
- package/es/utils/dictSelectUtil.js +3 -3
- package/es/utils/filterPermission.d.ts +5 -0
- package/es/utils/filterPermission.js +4 -6
- package/es/utils/getParentNodes.d.ts +79 -0
- package/es/utils/getParentNodes.js +89 -13
- package/es/utils/index.d.ts +5 -0
- package/es/utils/index.js +5 -4
- package/es/utils/transferFile.d.ts +4 -0
- package/es/utils/transferFile.js +56 -0
- package/es/utils/urlUtils.d.ts +14 -0
- package/es/utils/urlUtils.js +77 -0
- package/lib/ButtonGroup/PopConfirmTitle.d.ts +1 -1
- package/lib/ButtonGroup/PopConfirmTitle.js +3 -4
- package/lib/ButtonGroup/index.d.ts +5 -3
- package/lib/ButtonGroup/index.js +261 -194
- package/lib/ButtonGroup/styles/index.d.ts +8 -0
- package/lib/ButtonGroup/styles/index.js +68 -0
- package/lib/ButtonGroup/testStyles/index(antd-style).d.ts +11 -0
- package/lib/ButtonGroup/testStyles/index(antd-style).js +34 -0
- package/lib/ButtonGroup/testStyles/index(cssinjs).js +134 -0
- package/lib/ButtonGroup/testStyles/index.d.ts +11 -0
- package/lib/ButtonGroup/testStyles/index.js +29 -0
- package/lib/CalendarCoordPicker/CalendarMonthPicker.d.ts +5 -0
- package/lib/CalendarCoordPicker/CalendarMonthPicker.js +41 -0
- package/lib/CalendarCoordPicker/index.d.ts +7 -0
- package/lib/CalendarCoordPicker/index.js +323 -0
- package/lib/CalendarCoordPicker/styles/index.d.ts +6 -0
- package/lib/CalendarCoordPicker/styles/index.js +34 -0
- package/lib/CalendarCoordPicker/styles/index.less +37 -0
- package/lib/ConfigContext/index.d.ts +7 -0
- package/lib/ConfigContext/index.js +25 -0
- package/lib/DragContent/DragBar.d.ts +3 -0
- package/lib/DragContent/DragBar.js +1 -3
- package/lib/DragContent/index.d.ts +1 -1
- package/lib/DragContent/index.js +22 -9
- package/lib/DragContent/styles/index.d.ts +6 -0
- package/lib/DragContent/styles/index.js +58 -0
- package/lib/FormComp/ChunkUploader/api.js +11 -11
- package/lib/FormComp/ChunkUploader/index.js +123 -130
- package/lib/FormComp/ChunkUploader/lib.js +19 -19
- package/lib/FormComp/ChunkUploader/upload-queue.class.js +52 -53
- package/lib/FormComp/EditButton/index.d.ts +1 -1
- package/lib/FormComp/EditButton/index.js +22 -22
- package/lib/FormComp/FieldComponent/ReUpload.d.ts +1 -1
- package/lib/FormComp/FieldComponent/ReUpload.js +47 -41
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +29 -21
- package/lib/FormComp/FieldComponent/TitleNode.d.ts +2 -1
- package/lib/FormComp/FieldComponent/TitleNode.js +1 -2
- package/lib/FormComp/FieldComponent/UploaderViewer.d.ts +2 -0
- package/lib/FormComp/FieldComponent/UploaderViewer.js +102 -0
- package/lib/FormComp/FieldComponent/index.d.ts +1 -1
- package/lib/FormComp/FieldComponent/index.js +83 -107
- package/lib/FormComp/FieldComponent/setReadonlyValues.js +29 -28
- package/lib/FormComp/FieldComponent/style/TreeSelect.d.ts +6 -0
- package/lib/FormComp/FieldComponent/style/TreeSelect.js +48 -0
- package/lib/FormComp/FieldComponent/style/UploaderStyle.d.ts +6 -0
- package/lib/FormComp/FieldComponent/style/UploaderStyle.js +31 -0
- package/lib/FormComp/FieldComponent/style/index.less +26 -21
- package/lib/FormComp/RenderItemGroup/index.d.ts +4 -0
- package/lib/FormComp/RenderItemGroup/index.js +182 -65
- package/lib/FormComp/RenderItemGroup/style/index.d.ts +6 -0
- package/lib/FormComp/RenderItemGroup/style/index.js +46 -0
- package/lib/FormComp/Uploader/index.js +95 -80
- package/lib/FormComp/Uploader/style/index.less +14 -14
- package/lib/FormComp/Uploader/util.d.ts +2 -2
- package/lib/FormComp/VarTemplate/index.js +38 -48
- package/lib/NavLeafScroll/Main.js +451 -0
- package/lib/NavLeafScroll/index.d.ts +2 -0
- package/lib/NavLeafScroll/index.js +21 -398
- package/lib/NavLeafScroll/style/index.d.ts +6 -0
- package/lib/NavLeafScroll/style/index.js +62 -0
- package/lib/NavLeafScroll/style/index.less +22 -22
- package/lib/RefactorTree/index.d.ts +1 -1
- package/lib/RefactorTree/index.js +21 -21
- package/lib/RefactorTree/style/index.less +22 -22
- package/lib/RefactorTree/util.d.ts +2 -2
- package/lib/RefactorTree/util.js +30 -15
- 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.d.ts +0 -1
- package/lib/SpecIcon/index.js +34 -14
- package/lib/SpecIcon/styles/index(antd-style).d.ts +6 -0
- package/lib/SpecIcon/styles/index(antd-style).js +19 -0
- package/lib/SpecIcon/styles/index.d.ts +6 -0
- package/lib/SpecIcon/styles/index.js +100 -0
- package/lib/StandardContent/SplitterLayout/Pane.js +3 -4
- package/lib/StandardContent/SplitterLayout/index.js +6 -6
- package/lib/StandardContent/SplitterLayout/index.less +0 -1
- package/lib/StandardContent/SubfieldContent.d.ts +3 -2
- package/lib/StandardContent/SubfieldContent.js +24 -13
- package/lib/StandardContent/WrapperContent.d.ts +2 -2
- package/lib/StandardContent/WrapperContent.js +23 -13
- package/lib/StandardContent/styles/Subfield.d.ts +6 -0
- package/lib/StandardContent/styles/Subfield.js +36 -0
- package/lib/StandardContent/styles/Wrapper.d.ts +6 -0
- package/lib/StandardContent/styles/Wrapper.js +34 -0
- package/lib/StandardContent/styles/index.less +67 -0
- package/lib/StandardDragModal/ChangeStandardModal.d.ts +2 -2
- package/lib/StandardDragModal/ChangeStandardModal.js +85 -72
- package/lib/StandardDragModal/DraggableModal.js +11 -8
- package/lib/StandardDragModal/DraggableModalContext.d.ts +1 -1
- package/lib/StandardDragModal/DraggableModalContext.js +3 -4
- package/lib/StandardDragModal/DraggableModalInner.d.ts +2 -2
- package/lib/StandardDragModal/DraggableModalInner.js +38 -30
- package/lib/StandardDragModal/DraggableModalProvider.js +10 -10
- package/lib/StandardDragModal/Modal.d.ts +1 -1
- package/lib/StandardDragModal/Modal.js +7 -5
- package/lib/StandardDragModal/ResizeHandle.js +6 -6
- package/lib/StandardDragModal/clamp.js +2 -3
- package/lib/StandardDragModal/draggableModalReducer.d.ts +4 -4
- package/lib/StandardDragModal/draggableModalReducer.js +34 -29
- package/lib/StandardDragModal/getWindowSize.js +2 -3
- package/lib/StandardDragModal/useDrag.js +4 -5
- package/lib/StandardDragModal/usePrevious.js +2 -3
- package/lib/StandardDragModal/useResize.js +4 -5
- package/lib/StandardFilter/index.d.ts +8 -17
- package/lib/StandardFilter/index.js +281 -207
- package/lib/StandardFilter/style/FilterStyle.d.ts +6 -0
- package/lib/StandardFilter/style/FilterStyle.js +56 -0
- package/lib/StandardFilter/style/index.less +85 -36
- package/lib/StandardForm/ActionList.d.ts +9 -0
- package/lib/StandardForm/ActionList.js +6 -7
- package/lib/StandardForm/StepForm.d.ts +1 -1
- package/lib/StandardForm/StepForm.js +46 -41
- package/lib/StandardForm/TabForm.d.ts +2 -1
- package/lib/StandardForm/TabForm.js +48 -41
- package/lib/StandardForm/index.d.ts +2 -1
- package/lib/StandardForm/index.js +39 -23
- package/lib/StandardForm/style/index.d.ts +6 -0
- package/lib/StandardForm/style/index.js +55 -0
- package/lib/StandardForm/style/index.less +23 -12
- package/lib/StandardModal/UpdateFormRef.js +3 -4
- package/lib/StandardModal/index.d.ts +4 -3
- package/lib/StandardModal/index.js +152 -133
- package/lib/StandardModal/style/index.d.ts +6 -0
- package/lib/StandardModal/style/index.js +52 -0
- package/lib/StandardModal/style/index.less +29 -29
- package/lib/StandardPanel/index.d.ts +1 -1
- package/lib/StandardPanel/index.js +29 -20
- package/lib/StandardPanel/style/index.d.ts +6 -0
- package/lib/StandardPanel/style/index.js +93 -0
- package/lib/StandardPanel/style/index.less +30 -32
- package/lib/StandardTable/index.d.ts +6 -1
- package/lib/StandardTable/index.js +93 -40
- package/lib/StandardTable/style/index.d.ts +6 -1
- package/lib/StandardTable/style/index.js +117 -1
- package/lib/StandardTable/style/index.less +89 -80
- package/lib/components/IconNode/index.d.ts +1 -1
- package/lib/components/IconNode/index.js +13 -3
- package/lib/data/func.code.d.ts +16 -0
- package/lib/data/func.code.js +2 -3
- package/lib/data/general.config.d.ts +191 -0
- package/lib/data/general.config.js +34 -4
- package/lib/data/index.d.ts +3 -0
- package/lib/index.d.ts +7 -6
- package/lib/index.js +24 -12
- package/lib/theme/index.d.ts +27 -0
- package/lib/theme/index.js +35 -0
- package/lib/theme/utils/genStyleHook.d.ts +1 -0
- package/lib/theme/utils/genStyleHook.js +38 -0
- package/lib/utils/ValueFormat.d.ts +3 -0
- package/lib/utils/ValueFormat.js +20 -6
- package/lib/utils/dictSelectUtil.d.ts +36 -0
- package/lib/utils/dictSelectUtil.js +3 -3
- package/lib/utils/filterPermission.d.ts +5 -0
- package/lib/utils/filterPermission.js +9 -16
- package/lib/utils/getParentNodes.d.ts +79 -0
- package/lib/utils/getParentNodes.js +91 -16
- package/lib/utils/index.d.ts +5 -0
- package/lib/utils/index.js +42 -32
- package/lib/utils/transferFile.d.ts +4 -0
- package/lib/utils/transferFile.js +63 -0
- package/lib/utils/urlUtils.d.ts +14 -0
- package/lib/utils/urlUtils.js +84 -0
- package/package.json +80 -33
- package/Readme.md +0 -49
- package/dist/f26952c118ab6cdcd23dc0028ee98c11.svg +0 -173
- package/dist/fan-standard-comp.umd.js +0 -602
- 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 -34
- package/es/ButtonGroup/ButtonMenu.d.ts +0 -2
- package/es/ButtonGroup/ButtonMenu.js +0 -35
- package/es/ButtonGroup/style/index.less +0 -36
- package/es/RefactorTree/indexTreeNode.d.ts +0 -39
- package/es/RefactorTree/indexTreeNode.js +0 -204
- 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 -33
- package/es/SplitterLayout/index.js +0 -325
- package/es/SplitterLayout/index.less +0 -58
- package/es/StandardContent/style/index.less +0 -80
- package/es/theme/spec-variable.less +0 -48
- package/lib/ButtonGroup/ButtonList.d.ts +0 -2
- package/lib/ButtonGroup/ButtonList.js +0 -43
- package/lib/ButtonGroup/ButtonMenu.d.ts +0 -2
- package/lib/ButtonGroup/ButtonMenu.js +0 -44
- package/lib/ButtonGroup/style/index.less +0 -36
- package/lib/RefactorTree/indexTreeNode.d.ts +0 -39
- package/lib/RefactorTree/indexTreeNode.js +0 -214
- 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 -41
- package/lib/SplitterLayout/index.js +0 -332
- package/lib/SplitterLayout/index.less +0 -58
- package/lib/StandardContent/style/index.less +0 -80
- package/lib/theme/spec-variable.less +0 -48
- /package/es/{styles/index.less → ButtonGroup/testStyles/index(cssinjs).d.ts} +0 -0
- /package/lib/{styles/index.less → ButtonGroup/testStyles/index(cssinjs).d.ts} +0 -0
|
@@ -4,67 +4,82 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
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
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _antd = require("antd");
|
|
19
9
|
var _data = require("../data");
|
|
20
10
|
var _RenderItemGroup = _interopRequireDefault(require("../FormComp/RenderItemGroup"));
|
|
21
|
-
var
|
|
11
|
+
var _utils = require("../utils");
|
|
22
12
|
var _IconNode = _interopRequireDefault(require("../components/IconNode"));
|
|
23
13
|
var _TabForm = _interopRequireDefault(require("../StandardForm/TabForm"));
|
|
24
14
|
var _StepForm = _interopRequireDefault(require("../StandardForm/StepForm"));
|
|
25
|
-
var _ActionList = _interopRequireDefault(require("../StandardForm/ActionList
|
|
15
|
+
var _ActionList = _interopRequireDefault(require("../StandardForm/ActionList"));
|
|
26
16
|
require("./style/index.less");
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
var _StandardDragModal = require("../StandardDragModal");
|
|
18
|
+
var _index2 = _interopRequireDefault(require("./style/index"));
|
|
19
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
20
|
+
var _ConfigContext = require("../ConfigContext");
|
|
21
|
+
var _excluded = ["children", "className", "style", "size", "type", "formItemGroup", "title", "visible", "open", "formPrefix", "formPostfix", "initialValues", "hideRequiredMark", "bodyStyle", "footer", "footerButtonGroup", "hideFooter", "getFormFields", "fieldStatus", "formLayout", "tabsConfig", "stepsConfig", "displayLayout", "dragAble", "itemGroupConfig"],
|
|
22
|
+
_excluded2 = ["name", "type", "icon", "ghost", "disabled", "loading", "fn"];
|
|
30
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
25
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
26
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
31
27
|
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); }
|
|
28
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
29
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
30
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
31
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
32
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
33
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
34
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
32
35
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
33
36
|
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."); }
|
|
34
37
|
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); }
|
|
35
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
36
|
-
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)
|
|
37
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import { DraggableModal, DraggableModalProvider } from '
|
|
38
|
+
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; }
|
|
39
|
+
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; } }
|
|
40
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import { DraggableModal, DraggableModalProvider } from 'ant-design-draggable-modal'
|
|
41
|
+
// import 'ant-design-draggable-modal/dist/index.css'
|
|
38
42
|
var StandardModal = function StandardModal(props) {
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
43
|
+
var componentName = 'spec-standard-modal';
|
|
44
|
+
var _useStyle = (0, _index2.default)(componentName),
|
|
45
|
+
_useStyle2 = _slicedToArray(_useStyle, 2),
|
|
46
|
+
wrapSSR = _useStyle2[0],
|
|
47
|
+
hashId = _useStyle2[1];
|
|
48
|
+
var InitFanContext = (0, _react.useContext)(_ConfigContext.FanContext);
|
|
49
|
+
var providerConfig = InitFanContext['StandardModal'] || {}; // 使用上下文(全局配置)设置扩展的配置项
|
|
50
|
+
var _providerConfig$props = _objectSpread(_objectSpread({}, providerConfig), props),
|
|
51
|
+
children = _providerConfig$props.children,
|
|
52
|
+
className = _providerConfig$props.className,
|
|
53
|
+
style = _providerConfig$props.style,
|
|
54
|
+
_providerConfig$props2 = _providerConfig$props.size,
|
|
55
|
+
size = _providerConfig$props2 === void 0 ? 'md' : _providerConfig$props2,
|
|
56
|
+
type = _providerConfig$props.type,
|
|
57
|
+
formItemGroup = _providerConfig$props.formItemGroup,
|
|
58
|
+
title = _providerConfig$props.title,
|
|
59
|
+
visible = _providerConfig$props.visible,
|
|
60
|
+
open = _providerConfig$props.open,
|
|
61
|
+
formPrefix = _providerConfig$props.formPrefix,
|
|
62
|
+
formPostfix = _providerConfig$props.formPostfix,
|
|
63
|
+
initialValues = _providerConfig$props.initialValues,
|
|
64
|
+
hideRequiredMark = _providerConfig$props.hideRequiredMark,
|
|
65
|
+
bodyStyle = _providerConfig$props.bodyStyle,
|
|
66
|
+
footer = _providerConfig$props.footer,
|
|
67
|
+
footerButtonGroup = _providerConfig$props.footerButtonGroup,
|
|
68
|
+
hideFooter = _providerConfig$props.hideFooter,
|
|
69
|
+
_getFormFields = _providerConfig$props.getFormFields,
|
|
70
|
+
_providerConfig$props3 = _providerConfig$props.fieldStatus,
|
|
71
|
+
fieldStatus = _providerConfig$props3 === void 0 ? 'default' : _providerConfig$props3,
|
|
72
|
+
_providerConfig$props4 = _providerConfig$props.formLayout,
|
|
73
|
+
formLayout = _providerConfig$props4 === void 0 ? 'horizontal' : _providerConfig$props4,
|
|
74
|
+
tabsConfig = _providerConfig$props.tabsConfig,
|
|
75
|
+
stepsConfig = _providerConfig$props.stepsConfig,
|
|
76
|
+
displayLayout = _providerConfig$props.displayLayout,
|
|
77
|
+
_providerConfig$props5 = _providerConfig$props.dragAble,
|
|
78
|
+
dragAble = _providerConfig$props5 === void 0 ? false : _providerConfig$props5,
|
|
79
|
+
_providerConfig$props6 = _providerConfig$props.itemGroupConfig,
|
|
80
|
+
itemGroupConfig = _providerConfig$props6 === void 0 ? {} : _providerConfig$props6,
|
|
81
|
+
otherProps = _objectWithoutProperties(_providerConfig$props, _excluded);
|
|
82
|
+
var _Form$useForm = _antd.Form.useForm(),
|
|
68
83
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
69
84
|
modalForm = _Form$useForm2[0];
|
|
70
85
|
var _useState = (0, _react.useState)(),
|
|
@@ -74,27 +89,33 @@ var StandardModal = function StandardModal(props) {
|
|
|
74
89
|
var _useState3 = (0, _react.useState)(0),
|
|
75
90
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
76
91
|
bodyMaxHeight = _useState4[0],
|
|
77
|
-
setBodyMaxHeight = _useState4[1];
|
|
92
|
+
setBodyMaxHeight = _useState4[1];
|
|
93
|
+
|
|
94
|
+
// setTabFormChild
|
|
78
95
|
var _useState5 = (0, _react.useState)(),
|
|
79
96
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
80
97
|
formChild = _useState6[0],
|
|
81
98
|
setFormChild = _useState6[1]; // <---- set the ref when Form Rendered
|
|
99
|
+
|
|
82
100
|
// 按钮栏是否有显示(默认显示)
|
|
83
101
|
var hasFooterBar = (0, _react.useMemo)(function () {
|
|
84
|
-
var _a, _b, _c, _d, _e;
|
|
85
102
|
var openLog = false;
|
|
86
103
|
if (type === 'tabForm' || type === 'stepForm') {
|
|
87
104
|
if (type === 'tabForm') {
|
|
88
|
-
var
|
|
105
|
+
var _activeTabInfo$action, _activeTabInfo$action2;
|
|
106
|
+
var activeTabInfo = (formItemGroup || []).find(function (fItem) {
|
|
89
107
|
return fItem.key === (tabsConfig === null || tabsConfig === void 0 ? void 0 : tabsConfig.activeKey);
|
|
90
108
|
});
|
|
91
|
-
openLog && console.log('rule 0-1', (
|
|
92
|
-
return (
|
|
109
|
+
openLog && console.log('rule 0-1', (activeTabInfo === null || activeTabInfo === void 0 || (_activeTabInfo$action = activeTabInfo.actions) === null || _activeTabInfo$action === void 0 ? void 0 : _activeTabInfo$action.length) > 0);
|
|
110
|
+
return (activeTabInfo === null || activeTabInfo === void 0 || (_activeTabInfo$action2 = activeTabInfo.actions) === null || _activeTabInfo$action2 === void 0 ? void 0 : _activeTabInfo$action2.length) > 0;
|
|
93
111
|
}
|
|
94
112
|
if (type === 'stepForm') {
|
|
95
|
-
var
|
|
96
|
-
|
|
97
|
-
|
|
113
|
+
var _currentStepInfo$acti, _currentStepInfo$acti2;
|
|
114
|
+
var currentStepInfo = (formItemGroup || []).filter(function (fItem) {
|
|
115
|
+
return !fItem.hideStep;
|
|
116
|
+
})[stepsConfig.current];
|
|
117
|
+
openLog && console.log('rule 0-2', (currentStepInfo === null || currentStepInfo === void 0 || (_currentStepInfo$acti = currentStepInfo.actions) === null || _currentStepInfo$acti === void 0 ? void 0 : _currentStepInfo$acti.length) > 0);
|
|
118
|
+
return (currentStepInfo === null || currentStepInfo === void 0 || (_currentStepInfo$acti2 = currentStepInfo.actions) === null || _currentStepInfo$acti2 === void 0 ? void 0 : _currentStepInfo$acti2.length) > 0;
|
|
98
119
|
}
|
|
99
120
|
return true;
|
|
100
121
|
} else {
|
|
@@ -112,11 +133,12 @@ var StandardModal = function StandardModal(props) {
|
|
|
112
133
|
return false;
|
|
113
134
|
}
|
|
114
135
|
if (props.hasOwnProperty('footerButtonGroup') && footerButtonGroup) {
|
|
136
|
+
var _footerButtonGroup;
|
|
115
137
|
if (Array.isArray(footerButtonGroup) && footerButtonGroup.length === 0) {
|
|
116
138
|
openLog && console.log('rule 4');
|
|
117
139
|
// 返回为空数组不占用按钮栏
|
|
118
140
|
return false;
|
|
119
|
-
} else if (typeof footerButtonGroup === 'function' && (!footerButtonGroup() || ((
|
|
141
|
+
} else if (typeof footerButtonGroup === 'function' && (!footerButtonGroup() || ((_footerButtonGroup = footerButtonGroup()) === null || _footerButtonGroup === void 0 ? void 0 : _footerButtonGroup.length) === 0)) {
|
|
120
142
|
openLog && console.log('rule 5');
|
|
121
143
|
// 配置类型为Function且返回值为null或者返回数组长度为0时,不显示按钮栏
|
|
122
144
|
return false;
|
|
@@ -139,8 +161,9 @@ var StandardModal = function StandardModal(props) {
|
|
|
139
161
|
// 设置限制弹窗高度
|
|
140
162
|
var initBodyMaxHeight = function initBodyMaxHeight() {
|
|
141
163
|
var title = props.title;
|
|
142
|
-
|
|
143
|
-
var
|
|
164
|
+
// 最大高度基础值调整成页面视口高度
|
|
165
|
+
var bodyHeight = document.documentElement.clientHeight; // document.body.offsetHeight
|
|
166
|
+
var baseReduce = 80 + 32 + 16; // 默认需要减去的高度(上下空白间距150及内部内容间距16*2
|
|
144
167
|
// console.log('弹窗是否有按钮:', hasFooterBar ? '是' : '否')
|
|
145
168
|
setBodyMaxHeight("".concat(bodyHeight - (title ? 55 : 0) - (hasFooterBar ? 55 : 0) - baseReduce, "px"));
|
|
146
169
|
// setBodyMaxHeight(`${bodyHeight - (title ? 55 : 0) - ((footer || footerButtonGroup) ? 55 : 0) - baseReduce +
|
|
@@ -151,7 +174,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
151
174
|
if (visible && modalFormRef) {
|
|
152
175
|
// <---- check ref before use the form instance
|
|
153
176
|
if (initialValues && _typeof(initialValues) === 'object') {
|
|
154
|
-
initialValues && modalForm.setFieldsValue(
|
|
177
|
+
initialValues && modalForm.setFieldsValue(_objectSpread({}, initialValues));
|
|
155
178
|
forceUpdateForm();
|
|
156
179
|
}
|
|
157
180
|
}
|
|
@@ -177,10 +200,9 @@ var StandardModal = function StandardModal(props) {
|
|
|
177
200
|
if (Object.prototype.hasOwnProperty.call(values, 'false')) {
|
|
178
201
|
delete values.false; // 自定义结构会莫名的出来一个false字段
|
|
179
202
|
}
|
|
180
|
-
|
|
181
|
-
var resultValues = (0, _ValueFormat.default)(values, formItemGroup);
|
|
203
|
+
var resultValues = (0, _utils.UtilValueFormat)(values, formItemGroup);
|
|
182
204
|
if (onSubmit) {
|
|
183
|
-
onSubmit(
|
|
205
|
+
onSubmit(_objectSpread({}, resultValues));
|
|
184
206
|
}
|
|
185
207
|
}).catch(function () {
|
|
186
208
|
// 定位到第一条表单异常的
|
|
@@ -197,10 +219,9 @@ var StandardModal = function StandardModal(props) {
|
|
|
197
219
|
if (Object.prototype.hasOwnProperty.call(values, 'false')) {
|
|
198
220
|
delete values.false; // 自定义结构会莫名的出来一个false字段
|
|
199
221
|
}
|
|
200
|
-
|
|
201
|
-
var resultValues = (0, _ValueFormat.default)(values, formItemGroup);
|
|
222
|
+
var resultValues = (0, _utils.UtilValueFormat)(values, formItemGroup);
|
|
202
223
|
if (onSubmit) {
|
|
203
|
-
onSubmit(
|
|
224
|
+
onSubmit(_objectSpread({}, resultValues));
|
|
204
225
|
}
|
|
205
226
|
}).catch(function () {
|
|
206
227
|
// 定位到第一条表单异常的
|
|
@@ -215,6 +236,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
215
236
|
onSubmit && onSubmit();
|
|
216
237
|
}
|
|
217
238
|
};
|
|
239
|
+
|
|
218
240
|
// 重置所有表单
|
|
219
241
|
var clearAllFieldsValue = function clearAllFieldsValue() {
|
|
220
242
|
// let allFields = {}
|
|
@@ -222,7 +244,6 @@ var StandardModal = function StandardModal(props) {
|
|
|
222
244
|
// modalForm.setFieldsValue(allFields) // 直接清空表单的赋值(initialValues传值如果没有前后赋值没有全部带上所有字段,则会默认又使用之前的部分未传参字段)
|
|
223
245
|
modalForm.resetFields(); // 直接使用这个无效
|
|
224
246
|
};
|
|
225
|
-
|
|
226
247
|
var onAfterClose = function onAfterClose() {
|
|
227
248
|
var afterClose = props.afterClose;
|
|
228
249
|
if (type === 'form') clearAllFieldsValue();
|
|
@@ -232,6 +253,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
232
253
|
var onCancel = props.onCancel;
|
|
233
254
|
if (onCancel) onCancel();
|
|
234
255
|
};
|
|
256
|
+
|
|
235
257
|
// 强制更新表单值,用于赋初始化实例值
|
|
236
258
|
var forceUpdateForm = function forceUpdateForm() {
|
|
237
259
|
_getFormFields && _getFormFields(modalForm.getFieldsValue() || {}, modalForm);
|
|
@@ -239,27 +261,28 @@ var StandardModal = function StandardModal(props) {
|
|
|
239
261
|
var renderFormItemGroup = function renderFormItemGroup() {
|
|
240
262
|
var fieldStatus = props.fieldStatus,
|
|
241
263
|
formItemGroup = props.formItemGroup,
|
|
242
|
-
_props$
|
|
243
|
-
size = _props$
|
|
264
|
+
_props$size = props.size,
|
|
265
|
+
size = _props$size === void 0 ? 'md' : _props$size,
|
|
244
266
|
type = props.type;
|
|
245
267
|
if (Array.isArray(formItemGroup)) {
|
|
246
268
|
if (type === 'gridForm') {
|
|
247
269
|
// 栅格组
|
|
248
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
270
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Row, {
|
|
249
271
|
gutter: 20
|
|
250
|
-
}, formItemGroup.map(function (item, index) {
|
|
272
|
+
}, (formItemGroup || []).map(function (item, index) {
|
|
251
273
|
var childrenFields = item.fields || [];
|
|
252
274
|
if (item.label) {
|
|
253
275
|
childrenFields = [{
|
|
254
276
|
type: item.type,
|
|
255
277
|
label: item.label,
|
|
256
|
-
protoConfig:
|
|
278
|
+
protoConfig: _objectSpread({}, item.protoConfig)
|
|
279
|
+
// protoConfig: { className: '', ...item.protoConfig }
|
|
257
280
|
}].concat(childrenFields);
|
|
258
281
|
}
|
|
259
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
282
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Col, {
|
|
260
283
|
key: index,
|
|
261
284
|
span: item.gridSpan || 24
|
|
262
|
-
}, /*#__PURE__*/_react.default.createElement(_RenderItemGroup.default, {
|
|
285
|
+
}, /*#__PURE__*/_react.default.createElement(_RenderItemGroup.default, _extends({
|
|
263
286
|
size: size,
|
|
264
287
|
layout: formLayout,
|
|
265
288
|
doUpdateFormFields: function doUpdateFormFields() {
|
|
@@ -269,10 +292,10 @@ var StandardModal = function StandardModal(props) {
|
|
|
269
292
|
itemGroup: childrenFields,
|
|
270
293
|
fieldStatus: fieldStatus,
|
|
271
294
|
form: modalForm
|
|
272
|
-
}));
|
|
295
|
+
}, itemGroupConfig)));
|
|
273
296
|
}));
|
|
274
297
|
}
|
|
275
|
-
return /*#__PURE__*/_react.default.createElement(_RenderItemGroup.default, {
|
|
298
|
+
return /*#__PURE__*/_react.default.createElement(_RenderItemGroup.default, _extends({
|
|
276
299
|
size: size,
|
|
277
300
|
layout: formLayout,
|
|
278
301
|
doUpdateFormFields: function doUpdateFormFields() {
|
|
@@ -282,7 +305,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
282
305
|
itemGroup: formItemGroup,
|
|
283
306
|
fieldStatus: fieldStatus,
|
|
284
307
|
form: modalForm
|
|
285
|
-
});
|
|
308
|
+
}, itemGroupConfig));
|
|
286
309
|
}
|
|
287
310
|
return formItemGroup;
|
|
288
311
|
};
|
|
@@ -293,24 +316,24 @@ var StandardModal = function StandardModal(props) {
|
|
|
293
316
|
case 'next':
|
|
294
317
|
// 获取当前步骤的表单配置下有 rules 的控件进行校验(自定义的控件则自己有业务层面处理添加校验)
|
|
295
318
|
// console.log('执行下一步骤,需要优先进行校验')
|
|
296
|
-
var currentFields = formItemGroup[current].fields;
|
|
319
|
+
var currentFields = (formItemGroup || [])[current].fields;
|
|
297
320
|
var validatorGroup = currentFields && Array.isArray(currentFields) ? currentFields.map(function (fItem) {
|
|
298
321
|
return fItem.rules ? fItem.filedName : null;
|
|
299
322
|
}) : [];
|
|
300
323
|
formChild.validateFields(validatorGroup).then(function () {
|
|
301
324
|
// if (stepClick) stepClick(type, formChild, values);
|
|
302
|
-
extraFunc();
|
|
325
|
+
extraFunc && extraFunc();
|
|
303
326
|
}).catch(function () {
|
|
304
327
|
// console.log('表单校验不通过 ', errorFields.map(err => err))
|
|
305
328
|
});
|
|
306
329
|
break;
|
|
307
330
|
case 'prev':
|
|
308
331
|
// if (stepClick) stepClick(type, formChild);
|
|
309
|
-
extraFunc();
|
|
332
|
+
extraFunc && extraFunc();
|
|
310
333
|
break;
|
|
311
334
|
case 'cancel':
|
|
312
335
|
// if (stepClick) stepClick(type, formChild);
|
|
313
|
-
extraFunc();
|
|
336
|
+
extraFunc && extraFunc();
|
|
314
337
|
break;
|
|
315
338
|
default:
|
|
316
339
|
// extraFunc()
|
|
@@ -339,8 +362,8 @@ var StandardModal = function StandardModal(props) {
|
|
|
339
362
|
disabled = item.disabled,
|
|
340
363
|
loading = item.loading,
|
|
341
364
|
fn = item.fn,
|
|
342
|
-
others = (
|
|
343
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
365
|
+
others = _objectWithoutProperties(item, _excluded2);
|
|
366
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Button, _extends({
|
|
344
367
|
key: name,
|
|
345
368
|
type: _type || 'primary',
|
|
346
369
|
icon: /*#__PURE__*/_react.default.createElement(_IconNode.default, {
|
|
@@ -358,28 +381,30 @@ var StandardModal = function StandardModal(props) {
|
|
|
358
381
|
}
|
|
359
382
|
}));
|
|
360
383
|
}
|
|
361
|
-
|
|
362
384
|
if (typeof footerButtonGroup === 'function') {
|
|
363
385
|
return footerButtonGroup(modalForm, props);
|
|
364
386
|
}
|
|
365
387
|
return footerButtonGroup;
|
|
366
388
|
}
|
|
367
389
|
if (footer) return footer;
|
|
368
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(
|
|
390
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_antd.Button, _extends({
|
|
369
391
|
key: "submit",
|
|
370
392
|
type: 'primary',
|
|
371
393
|
loading: confirmLoading,
|
|
372
394
|
onClick: handleSubmit
|
|
373
|
-
}, confirmButtonProps, okButtonProps), confirmText || okText || '确定'), /*#__PURE__*/_react.default.createElement(
|
|
395
|
+
}, confirmButtonProps, okButtonProps), confirmText || okText || '确定'), /*#__PURE__*/_react.default.createElement(_antd.Button, _extends({
|
|
374
396
|
key: "back",
|
|
375
397
|
onClick: handleCancel
|
|
376
398
|
}, cancelButtonProps), cancelText || '取消'));
|
|
377
399
|
};
|
|
378
400
|
var renderFooter = function renderFooter() {
|
|
379
|
-
var _a, _b;
|
|
380
401
|
if (type === 'stepForm') {
|
|
381
|
-
var
|
|
382
|
-
|
|
402
|
+
var _currentStepInfo$acti3;
|
|
403
|
+
// 过滤隐藏掉的步骤表单
|
|
404
|
+
var currentStepInfo = (formItemGroup || []).filter(function (fItem) {
|
|
405
|
+
return !fItem.hideStep;
|
|
406
|
+
})[stepsConfig.current];
|
|
407
|
+
return (currentStepInfo === null || currentStepInfo === void 0 || (_currentStepInfo$acti3 = currentStepInfo.actions) === null || _currentStepInfo$acti3 === void 0 ? void 0 : _currentStepInfo$acti3.length) > 0 ? /*#__PURE__*/_react.default.createElement(_ActionList.default, {
|
|
383
408
|
list: currentStepInfo.actions || [],
|
|
384
409
|
onStep: handleStepType,
|
|
385
410
|
form: formChild,
|
|
@@ -387,11 +412,12 @@ var StandardModal = function StandardModal(props) {
|
|
|
387
412
|
}) : null;
|
|
388
413
|
}
|
|
389
414
|
if (type === 'tabForm') {
|
|
390
|
-
var
|
|
415
|
+
var _activeTabInfo$action3;
|
|
416
|
+
var activeTabInfo = (formItemGroup || []).find(function (fItem) {
|
|
391
417
|
return fItem.key === (tabsConfig === null || tabsConfig === void 0 ? void 0 : tabsConfig.activeKey);
|
|
392
418
|
});
|
|
393
|
-
return (
|
|
394
|
-
list: activeTabInfo.actions || [],
|
|
419
|
+
return (activeTabInfo === null || activeTabInfo === void 0 || (_activeTabInfo$action3 = activeTabInfo.actions) === null || _activeTabInfo$action3 === void 0 ? void 0 : _activeTabInfo$action3.length) > 0 ? /*#__PURE__*/_react.default.createElement(_ActionList.default, {
|
|
420
|
+
list: (activeTabInfo === null || activeTabInfo === void 0 ? void 0 : activeTabInfo.actions) || [],
|
|
395
421
|
form: formChild,
|
|
396
422
|
other: props
|
|
397
423
|
}) : null;
|
|
@@ -400,21 +426,23 @@ var StandardModal = function StandardModal(props) {
|
|
|
400
426
|
};
|
|
401
427
|
// 内容渲染
|
|
402
428
|
var renderChildrenNodes = function renderChildrenNodes() {
|
|
403
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children, (type === 'form' || type === 'gridForm') && /*#__PURE__*/_react.default.createElement(
|
|
429
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children, (type === 'form' || type === 'gridForm') && /*#__PURE__*/_react.default.createElement(_antd.Form, {
|
|
404
430
|
layout: formLayout,
|
|
405
431
|
ref: setModalFormRef,
|
|
406
432
|
form: modalForm,
|
|
407
433
|
onFinish: handleSubmit,
|
|
408
|
-
hideRequiredMark: fieldStatus === 'viewOnly' || hideRequiredMark
|
|
434
|
+
hideRequiredMark: fieldStatus === 'viewOnly' || hideRequiredMark
|
|
409
435
|
// initialValues={{ ...initialValues }}
|
|
436
|
+
,
|
|
410
437
|
scrollToFirstError: true,
|
|
411
438
|
className: "modalForm"
|
|
412
|
-
}, formPrefix && /*#__PURE__*/_react.default.createElement(
|
|
439
|
+
}, formPrefix && /*#__PURE__*/_react.default.createElement(_antd.Row, null, formPrefix(modalForm, props, forceUpdateForm)), formItemGroup ? renderFormItemGroup() : null, formPostfix && /*#__PURE__*/_react.default.createElement(_antd.Row, null, formPostfix(modalForm, props, forceUpdateForm), " ")), type === 'tabForm' && /*#__PURE__*/_react.default.createElement(_TabForm.default, {
|
|
413
440
|
grid: size,
|
|
414
441
|
layout: formLayout,
|
|
415
442
|
fieldStatus: fieldStatus,
|
|
416
|
-
actionHide: true
|
|
443
|
+
actionHide: true
|
|
417
444
|
// @ts-ignore
|
|
445
|
+
,
|
|
418
446
|
getFormFields: function getFormFields(fields, form) {
|
|
419
447
|
setFormChild(form);
|
|
420
448
|
_getFormFields && _getFormFields(fields, form);
|
|
@@ -422,14 +450,15 @@ var StandardModal = function StandardModal(props) {
|
|
|
422
450
|
formItemGroup: formItemGroup,
|
|
423
451
|
tabsConfig: tabsConfig,
|
|
424
452
|
onSubmit: handleSubmit,
|
|
425
|
-
initialValues:
|
|
453
|
+
initialValues: _objectSpread({}, initialValues),
|
|
426
454
|
displayLayout: displayLayout
|
|
427
455
|
}), type === 'stepForm' && /*#__PURE__*/_react.default.createElement(_StepForm.default, {
|
|
428
456
|
grid: size,
|
|
429
457
|
layout: formLayout,
|
|
430
458
|
fieldStatus: fieldStatus,
|
|
431
|
-
actionHide: true
|
|
459
|
+
actionHide: true
|
|
432
460
|
// @ts-ignore
|
|
461
|
+
,
|
|
433
462
|
getFormFields: function getFormFields(fields, form) {
|
|
434
463
|
setFormChild(form);
|
|
435
464
|
_getFormFields && _getFormFields(fields, form);
|
|
@@ -437,65 +466,55 @@ var StandardModal = function StandardModal(props) {
|
|
|
437
466
|
formItemGroup: formItemGroup,
|
|
438
467
|
stepsConfig: stepsConfig,
|
|
439
468
|
onSubmit: handleSubmit,
|
|
440
|
-
initialValues:
|
|
469
|
+
initialValues: _objectSpread({}, initialValues),
|
|
441
470
|
displayLayout: displayLayout
|
|
442
471
|
}));
|
|
443
472
|
};
|
|
444
473
|
// 可拖动及缩放
|
|
445
474
|
if (dragAble) {
|
|
446
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
447
|
-
destroyOnClose: true
|
|
475
|
+
return wrapSSR( /*#__PURE__*/_react.default.createElement(_StandardDragModal.DraggableModalProvider, null, /*#__PURE__*/_react.default.createElement(_StandardDragModal.DraggableModal, _extends({
|
|
476
|
+
destroyOnClose: true
|
|
477
|
+
// @ts-ignore
|
|
478
|
+
,
|
|
448
479
|
initialWidth: otherProps.width || _data.general.modalSize[size].width,
|
|
449
480
|
initialHeight: otherProps.height,
|
|
450
481
|
zIndex: 1001
|
|
451
482
|
}, otherProps, {
|
|
452
483
|
visible: visible,
|
|
453
|
-
className:
|
|
484
|
+
className: (0, _classnames.default)(componentName, 'standardModal', className, fieldStatus === 'viewOnly' ? 'is-view' : '', hashId),
|
|
454
485
|
onCancel: handleCancel,
|
|
455
486
|
afterClose: onAfterClose,
|
|
456
487
|
onOk: handleSubmit,
|
|
457
488
|
title: title,
|
|
458
489
|
footer: renderFooter()
|
|
459
|
-
}), renderChildrenNodes());
|
|
460
|
-
/* return <DraggableModalProvider>
|
|
461
|
-
<DraggableModal destroyOnClose
|
|
462
|
-
initialWidth={otherProps.width || general.modalSize[size].width}
|
|
463
|
-
initialHeight={otherProps.height}
|
|
464
|
-
zIndex={1001}
|
|
465
|
-
{...otherProps}
|
|
466
|
-
visible={visible}
|
|
467
|
-
className={`standardModal ${className || ''} ${fieldStatus === 'viewOnly' ? 'is-view' : ''}`}
|
|
468
|
-
onCancel={handleCancel}
|
|
469
|
-
afterClose={onAfterClose}
|
|
470
|
-
onOk={handleSubmit}
|
|
471
|
-
title={title}
|
|
472
|
-
footer={renderFooter()}
|
|
473
|
-
>
|
|
474
|
-
{renderChildrenNodes()}
|
|
475
|
-
</DraggableModal>
|
|
476
|
-
</DraggableModalProvider>*/
|
|
490
|
+
}), renderChildrenNodes())));
|
|
477
491
|
}
|
|
478
|
-
|
|
479
|
-
return /*#__PURE__*/_react.default.createElement(_modal.default, Object.assign({
|
|
492
|
+
return wrapSSR( /*#__PURE__*/_react.default.createElement(_antd.Modal, _extends({
|
|
480
493
|
destroyOnClose: true,
|
|
481
|
-
maskClosable: false
|
|
494
|
+
maskClosable: false
|
|
495
|
+
// @ts-ignore
|
|
496
|
+
,
|
|
482
497
|
width: _data.general.modalSize[size].width
|
|
483
498
|
}, otherProps, {
|
|
484
499
|
open: visible,
|
|
485
500
|
title: title,
|
|
486
501
|
footer: renderFooter(),
|
|
487
|
-
className:
|
|
488
|
-
style:
|
|
502
|
+
className: (0, _classnames.default)(componentName, 'standardModal', className, fieldStatus === 'viewOnly' ? 'is-view' : '', hashId),
|
|
503
|
+
style: _objectSpread({
|
|
489
504
|
top: '80px'
|
|
490
|
-
}, style)
|
|
491
|
-
bodyStyle:
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
505
|
+
}, style)
|
|
506
|
+
// bodyStyle={{ maxHeight: bodyMaxHeight, overflowY: 'scroll', ...bodyStyle }}
|
|
507
|
+
,
|
|
508
|
+
styles: {
|
|
509
|
+
body: _objectSpread({
|
|
510
|
+
maxHeight: bodyMaxHeight,
|
|
511
|
+
overflow: 'hidden',
|
|
512
|
+
overflowY: 'scroll'
|
|
513
|
+
}, bodyStyle)
|
|
514
|
+
},
|
|
495
515
|
onCancel: handleCancel,
|
|
496
516
|
afterClose: onAfterClose,
|
|
497
517
|
onOk: handleSubmit
|
|
498
|
-
}), renderChildrenNodes());
|
|
518
|
+
}), renderChildrenNodes()));
|
|
499
519
|
};
|
|
500
|
-
var _default = StandardModal;
|
|
501
|
-
exports.default = _default;
|
|
520
|
+
var _default = exports.default = StandardModal;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _genStyleHook = require("../../theme/utils/genStyleHook");
|
|
8
|
+
var _index = require("../../theme/index");
|
|
9
|
+
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); }
|
|
10
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
14
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
|
+
var StandardPanelStyleFunc = function StandardPanelStyleFunc(prefix) {
|
|
16
|
+
var prepareComponentToken = function prepareComponentToken(token) {
|
|
17
|
+
return {
|
|
18
|
+
// fontWeight: 400,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
return (0, _genStyleHook.createStyleHook)(prefix, function (token) {
|
|
22
|
+
var prefixCls = ".".concat(prefix);
|
|
23
|
+
return [_defineProperty(_defineProperty(_defineProperty({}, prefixCls, {
|
|
24
|
+
'.ant-modal-body ': _objectSpread({}, (0, _index.scrollBar)(token)),
|
|
25
|
+
'.modalForm': {
|
|
26
|
+
'&.ant-form-horizontal .ant-form-item-label': {
|
|
27
|
+
'> label': {
|
|
28
|
+
minHeight: token.controlHeight + 'px'
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}), '.ant-form-item.form-item-view-only', {
|
|
33
|
+
'.ant-form-item-control-input': {
|
|
34
|
+
color: token.colorSecondary
|
|
35
|
+
},
|
|
36
|
+
'.modalGridTitle, .modal-grid-title': {
|
|
37
|
+
margin: "0 0 ".concat(token.marginMD, "px 0"),
|
|
38
|
+
paddingBottom: token.paddingXS,
|
|
39
|
+
paddingLeft: token.paddingXS
|
|
40
|
+
},
|
|
41
|
+
'&:before': {
|
|
42
|
+
borderLeft: " 4px solid ".concat(token.colorPrimary)
|
|
43
|
+
}
|
|
44
|
+
}), '.modalPanelTitle, .modal-grid-title', {
|
|
45
|
+
margin: "0 0 ".concat(token.marginMD, "px 0"),
|
|
46
|
+
paddingBottom: token.paddingXS,
|
|
47
|
+
borderBottom: "1px solid ".concat(token.colorBorder)
|
|
48
|
+
})];
|
|
49
|
+
}, prepareComponentToken // 当前组件扩展的变量
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
var _default = exports.default = StandardPanelStyleFunc;
|