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
|
@@ -1,62 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import _Button from "antd/es/button";
|
|
5
|
-
import "antd/es/col/style";
|
|
6
|
-
import _Col from "antd/es/col";
|
|
7
|
-
import "antd/es/row/style";
|
|
8
|
-
import _Row from "antd/es/row";
|
|
9
|
-
import "antd/es/form/style";
|
|
10
|
-
import _Form from "antd/es/form";
|
|
1
|
+
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"],
|
|
2
|
+
_excluded2 = ["name", "type", "icon", "ghost", "disabled", "loading", "fn"];
|
|
3
|
+
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); }
|
|
11
4
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
7
|
+
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; }
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
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; }
|
|
12
12
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13
13
|
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."); }
|
|
14
14
|
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); }
|
|
15
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
16
|
-
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)
|
|
15
|
+
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; }
|
|
16
|
+
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; } }
|
|
17
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
import { general } from
|
|
21
|
-
import RenderItemGroup from
|
|
22
|
-
import UtilValueFormat from
|
|
18
|
+
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
|
19
|
+
import { Form, Modal, Button, Row, Col } from 'antd';
|
|
20
|
+
import { general } from "../data";
|
|
21
|
+
import RenderItemGroup from "../FormComp/RenderItemGroup";
|
|
22
|
+
import { UtilValueFormat } from "../utils";
|
|
23
23
|
import IconNode from "../components/IconNode";
|
|
24
|
-
import TabForm from
|
|
25
|
-
import StepForm from
|
|
26
|
-
import ActionList from
|
|
27
|
-
import
|
|
28
|
-
// import { DraggableModal, DraggableModalProvider } from '
|
|
29
|
-
import
|
|
24
|
+
import TabForm from "../StandardForm/TabForm";
|
|
25
|
+
import StepForm from "../StandardForm/StepForm";
|
|
26
|
+
import ActionList from "../StandardForm/ActionList";
|
|
27
|
+
import "./style/index.less";
|
|
28
|
+
// import { DraggableModal, DraggableModalProvider } from 'ant-design-draggable-modal'
|
|
29
|
+
// import 'ant-design-draggable-modal/dist/index.css'
|
|
30
|
+
import { DraggableModal, DraggableModalProvider } from "../StandardDragModal";
|
|
31
|
+
import useStyle from "./style/index";
|
|
32
|
+
import classNames from "classnames";
|
|
33
|
+
import { FanContext } from "../ConfigContext";
|
|
30
34
|
var StandardModal = function StandardModal(props) {
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
35
|
+
var componentName = 'spec-standard-modal';
|
|
36
|
+
var _useStyle = useStyle(componentName),
|
|
37
|
+
_useStyle2 = _slicedToArray(_useStyle, 2),
|
|
38
|
+
wrapSSR = _useStyle2[0],
|
|
39
|
+
hashId = _useStyle2[1];
|
|
40
|
+
var InitFanContext = useContext(FanContext);
|
|
41
|
+
var providerConfig = InitFanContext['StandardModal'] || {}; // 使用上下文(全局配置)设置扩展的配置项
|
|
42
|
+
var _providerConfig$props = _objectSpread(_objectSpread({}, providerConfig), props),
|
|
43
|
+
children = _providerConfig$props.children,
|
|
44
|
+
className = _providerConfig$props.className,
|
|
45
|
+
style = _providerConfig$props.style,
|
|
46
|
+
_providerConfig$props2 = _providerConfig$props.size,
|
|
47
|
+
size = _providerConfig$props2 === void 0 ? 'md' : _providerConfig$props2,
|
|
48
|
+
type = _providerConfig$props.type,
|
|
49
|
+
formItemGroup = _providerConfig$props.formItemGroup,
|
|
50
|
+
title = _providerConfig$props.title,
|
|
51
|
+
visible = _providerConfig$props.visible,
|
|
52
|
+
open = _providerConfig$props.open,
|
|
53
|
+
formPrefix = _providerConfig$props.formPrefix,
|
|
54
|
+
formPostfix = _providerConfig$props.formPostfix,
|
|
55
|
+
initialValues = _providerConfig$props.initialValues,
|
|
56
|
+
hideRequiredMark = _providerConfig$props.hideRequiredMark,
|
|
57
|
+
bodyStyle = _providerConfig$props.bodyStyle,
|
|
58
|
+
footer = _providerConfig$props.footer,
|
|
59
|
+
footerButtonGroup = _providerConfig$props.footerButtonGroup,
|
|
60
|
+
hideFooter = _providerConfig$props.hideFooter,
|
|
61
|
+
_getFormFields = _providerConfig$props.getFormFields,
|
|
62
|
+
_providerConfig$props3 = _providerConfig$props.fieldStatus,
|
|
63
|
+
fieldStatus = _providerConfig$props3 === void 0 ? 'default' : _providerConfig$props3,
|
|
64
|
+
_providerConfig$props4 = _providerConfig$props.formLayout,
|
|
65
|
+
formLayout = _providerConfig$props4 === void 0 ? 'horizontal' : _providerConfig$props4,
|
|
66
|
+
tabsConfig = _providerConfig$props.tabsConfig,
|
|
67
|
+
stepsConfig = _providerConfig$props.stepsConfig,
|
|
68
|
+
displayLayout = _providerConfig$props.displayLayout,
|
|
69
|
+
_providerConfig$props5 = _providerConfig$props.dragAble,
|
|
70
|
+
dragAble = _providerConfig$props5 === void 0 ? false : _providerConfig$props5,
|
|
71
|
+
_providerConfig$props6 = _providerConfig$props.itemGroupConfig,
|
|
72
|
+
itemGroupConfig = _providerConfig$props6 === void 0 ? {} : _providerConfig$props6,
|
|
73
|
+
otherProps = _objectWithoutProperties(_providerConfig$props, _excluded);
|
|
74
|
+
var _Form$useForm = Form.useForm(),
|
|
60
75
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
61
76
|
modalForm = _Form$useForm2[0];
|
|
62
77
|
var _useState = useState(),
|
|
@@ -66,27 +81,33 @@ var StandardModal = function StandardModal(props) {
|
|
|
66
81
|
var _useState3 = useState(0),
|
|
67
82
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
68
83
|
bodyMaxHeight = _useState4[0],
|
|
69
|
-
setBodyMaxHeight = _useState4[1];
|
|
84
|
+
setBodyMaxHeight = _useState4[1];
|
|
85
|
+
|
|
86
|
+
// setTabFormChild
|
|
70
87
|
var _useState5 = useState(),
|
|
71
88
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
72
89
|
formChild = _useState6[0],
|
|
73
90
|
setFormChild = _useState6[1]; // <---- set the ref when Form Rendered
|
|
91
|
+
|
|
74
92
|
// 按钮栏是否有显示(默认显示)
|
|
75
93
|
var hasFooterBar = useMemo(function () {
|
|
76
|
-
var _a, _b, _c, _d, _e;
|
|
77
94
|
var openLog = false;
|
|
78
95
|
if (type === 'tabForm' || type === 'stepForm') {
|
|
79
96
|
if (type === 'tabForm') {
|
|
80
|
-
var
|
|
97
|
+
var _activeTabInfo$action, _activeTabInfo$action2;
|
|
98
|
+
var activeTabInfo = (formItemGroup || []).find(function (fItem) {
|
|
81
99
|
return fItem.key === (tabsConfig === null || tabsConfig === void 0 ? void 0 : tabsConfig.activeKey);
|
|
82
100
|
});
|
|
83
|
-
openLog && console.log('rule 0-1', (
|
|
84
|
-
return (
|
|
101
|
+
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);
|
|
102
|
+
return (activeTabInfo === null || activeTabInfo === void 0 || (_activeTabInfo$action2 = activeTabInfo.actions) === null || _activeTabInfo$action2 === void 0 ? void 0 : _activeTabInfo$action2.length) > 0;
|
|
85
103
|
}
|
|
86
104
|
if (type === 'stepForm') {
|
|
87
|
-
var
|
|
88
|
-
|
|
89
|
-
|
|
105
|
+
var _currentStepInfo$acti, _currentStepInfo$acti2;
|
|
106
|
+
var currentStepInfo = (formItemGroup || []).filter(function (fItem) {
|
|
107
|
+
return !fItem.hideStep;
|
|
108
|
+
})[stepsConfig.current];
|
|
109
|
+
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);
|
|
110
|
+
return (currentStepInfo === null || currentStepInfo === void 0 || (_currentStepInfo$acti2 = currentStepInfo.actions) === null || _currentStepInfo$acti2 === void 0 ? void 0 : _currentStepInfo$acti2.length) > 0;
|
|
90
111
|
}
|
|
91
112
|
return true;
|
|
92
113
|
} else {
|
|
@@ -104,11 +125,12 @@ var StandardModal = function StandardModal(props) {
|
|
|
104
125
|
return false;
|
|
105
126
|
}
|
|
106
127
|
if (props.hasOwnProperty('footerButtonGroup') && footerButtonGroup) {
|
|
128
|
+
var _footerButtonGroup;
|
|
107
129
|
if (Array.isArray(footerButtonGroup) && footerButtonGroup.length === 0) {
|
|
108
130
|
openLog && console.log('rule 4');
|
|
109
131
|
// 返回为空数组不占用按钮栏
|
|
110
132
|
return false;
|
|
111
|
-
} else if (typeof footerButtonGroup === 'function' && (!footerButtonGroup() || ((
|
|
133
|
+
} else if (typeof footerButtonGroup === 'function' && (!footerButtonGroup() || ((_footerButtonGroup = footerButtonGroup()) === null || _footerButtonGroup === void 0 ? void 0 : _footerButtonGroup.length) === 0)) {
|
|
112
134
|
openLog && console.log('rule 5');
|
|
113
135
|
// 配置类型为Function且返回值为null或者返回数组长度为0时,不显示按钮栏
|
|
114
136
|
return false;
|
|
@@ -131,8 +153,9 @@ var StandardModal = function StandardModal(props) {
|
|
|
131
153
|
// 设置限制弹窗高度
|
|
132
154
|
var initBodyMaxHeight = function initBodyMaxHeight() {
|
|
133
155
|
var title = props.title;
|
|
134
|
-
|
|
135
|
-
var
|
|
156
|
+
// 最大高度基础值调整成页面视口高度
|
|
157
|
+
var bodyHeight = document.documentElement.clientHeight; // document.body.offsetHeight
|
|
158
|
+
var baseReduce = 80 + 32 + 16; // 默认需要减去的高度(上下空白间距150及内部内容间距16*2
|
|
136
159
|
// console.log('弹窗是否有按钮:', hasFooterBar ? '是' : '否')
|
|
137
160
|
setBodyMaxHeight("".concat(bodyHeight - (title ? 55 : 0) - (hasFooterBar ? 55 : 0) - baseReduce, "px"));
|
|
138
161
|
// setBodyMaxHeight(`${bodyHeight - (title ? 55 : 0) - ((footer || footerButtonGroup) ? 55 : 0) - baseReduce +
|
|
@@ -143,7 +166,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
143
166
|
if (visible && modalFormRef) {
|
|
144
167
|
// <---- check ref before use the form instance
|
|
145
168
|
if (initialValues && _typeof(initialValues) === 'object') {
|
|
146
|
-
initialValues && modalForm.setFieldsValue(
|
|
169
|
+
initialValues && modalForm.setFieldsValue(_objectSpread({}, initialValues));
|
|
147
170
|
forceUpdateForm();
|
|
148
171
|
}
|
|
149
172
|
}
|
|
@@ -169,10 +192,9 @@ var StandardModal = function StandardModal(props) {
|
|
|
169
192
|
if (Object.prototype.hasOwnProperty.call(values, 'false')) {
|
|
170
193
|
delete values.false; // 自定义结构会莫名的出来一个false字段
|
|
171
194
|
}
|
|
172
|
-
|
|
173
195
|
var resultValues = UtilValueFormat(values, formItemGroup);
|
|
174
196
|
if (onSubmit) {
|
|
175
|
-
onSubmit(
|
|
197
|
+
onSubmit(_objectSpread({}, resultValues));
|
|
176
198
|
}
|
|
177
199
|
}).catch(function () {
|
|
178
200
|
// 定位到第一条表单异常的
|
|
@@ -189,10 +211,9 @@ var StandardModal = function StandardModal(props) {
|
|
|
189
211
|
if (Object.prototype.hasOwnProperty.call(values, 'false')) {
|
|
190
212
|
delete values.false; // 自定义结构会莫名的出来一个false字段
|
|
191
213
|
}
|
|
192
|
-
|
|
193
214
|
var resultValues = UtilValueFormat(values, formItemGroup);
|
|
194
215
|
if (onSubmit) {
|
|
195
|
-
onSubmit(
|
|
216
|
+
onSubmit(_objectSpread({}, resultValues));
|
|
196
217
|
}
|
|
197
218
|
}).catch(function () {
|
|
198
219
|
// 定位到第一条表单异常的
|
|
@@ -207,6 +228,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
207
228
|
onSubmit && onSubmit();
|
|
208
229
|
}
|
|
209
230
|
};
|
|
231
|
+
|
|
210
232
|
// 重置所有表单
|
|
211
233
|
var clearAllFieldsValue = function clearAllFieldsValue() {
|
|
212
234
|
// let allFields = {}
|
|
@@ -214,7 +236,6 @@ var StandardModal = function StandardModal(props) {
|
|
|
214
236
|
// modalForm.setFieldsValue(allFields) // 直接清空表单的赋值(initialValues传值如果没有前后赋值没有全部带上所有字段,则会默认又使用之前的部分未传参字段)
|
|
215
237
|
modalForm.resetFields(); // 直接使用这个无效
|
|
216
238
|
};
|
|
217
|
-
|
|
218
239
|
var onAfterClose = function onAfterClose() {
|
|
219
240
|
var afterClose = props.afterClose;
|
|
220
241
|
if (type === 'form') clearAllFieldsValue();
|
|
@@ -224,6 +245,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
224
245
|
var onCancel = props.onCancel;
|
|
225
246
|
if (onCancel) onCancel();
|
|
226
247
|
};
|
|
248
|
+
|
|
227
249
|
// 强制更新表单值,用于赋初始化实例值
|
|
228
250
|
var forceUpdateForm = function forceUpdateForm() {
|
|
229
251
|
_getFormFields && _getFormFields(modalForm.getFieldsValue() || {}, modalForm);
|
|
@@ -231,27 +253,28 @@ var StandardModal = function StandardModal(props) {
|
|
|
231
253
|
var renderFormItemGroup = function renderFormItemGroup() {
|
|
232
254
|
var fieldStatus = props.fieldStatus,
|
|
233
255
|
formItemGroup = props.formItemGroup,
|
|
234
|
-
_props$
|
|
235
|
-
size = _props$
|
|
256
|
+
_props$size = props.size,
|
|
257
|
+
size = _props$size === void 0 ? 'md' : _props$size,
|
|
236
258
|
type = props.type;
|
|
237
259
|
if (Array.isArray(formItemGroup)) {
|
|
238
260
|
if (type === 'gridForm') {
|
|
239
261
|
// 栅格组
|
|
240
|
-
return /*#__PURE__*/React.createElement(
|
|
262
|
+
return /*#__PURE__*/React.createElement(Row, {
|
|
241
263
|
gutter: 20
|
|
242
|
-
}, formItemGroup.map(function (item, index) {
|
|
264
|
+
}, (formItemGroup || []).map(function (item, index) {
|
|
243
265
|
var childrenFields = item.fields || [];
|
|
244
266
|
if (item.label) {
|
|
245
267
|
childrenFields = [{
|
|
246
268
|
type: item.type,
|
|
247
269
|
label: item.label,
|
|
248
|
-
protoConfig:
|
|
270
|
+
protoConfig: _objectSpread({}, item.protoConfig)
|
|
271
|
+
// protoConfig: { className: '', ...item.protoConfig }
|
|
249
272
|
}].concat(childrenFields);
|
|
250
273
|
}
|
|
251
|
-
return /*#__PURE__*/React.createElement(
|
|
274
|
+
return /*#__PURE__*/React.createElement(Col, {
|
|
252
275
|
key: index,
|
|
253
276
|
span: item.gridSpan || 24
|
|
254
|
-
}, /*#__PURE__*/React.createElement(RenderItemGroup, {
|
|
277
|
+
}, /*#__PURE__*/React.createElement(RenderItemGroup, _extends({
|
|
255
278
|
size: size,
|
|
256
279
|
layout: formLayout,
|
|
257
280
|
doUpdateFormFields: function doUpdateFormFields() {
|
|
@@ -261,10 +284,10 @@ var StandardModal = function StandardModal(props) {
|
|
|
261
284
|
itemGroup: childrenFields,
|
|
262
285
|
fieldStatus: fieldStatus,
|
|
263
286
|
form: modalForm
|
|
264
|
-
}));
|
|
287
|
+
}, itemGroupConfig)));
|
|
265
288
|
}));
|
|
266
289
|
}
|
|
267
|
-
return /*#__PURE__*/React.createElement(RenderItemGroup, {
|
|
290
|
+
return /*#__PURE__*/React.createElement(RenderItemGroup, _extends({
|
|
268
291
|
size: size,
|
|
269
292
|
layout: formLayout,
|
|
270
293
|
doUpdateFormFields: function doUpdateFormFields() {
|
|
@@ -274,7 +297,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
274
297
|
itemGroup: formItemGroup,
|
|
275
298
|
fieldStatus: fieldStatus,
|
|
276
299
|
form: modalForm
|
|
277
|
-
});
|
|
300
|
+
}, itemGroupConfig));
|
|
278
301
|
}
|
|
279
302
|
return formItemGroup;
|
|
280
303
|
};
|
|
@@ -285,24 +308,24 @@ var StandardModal = function StandardModal(props) {
|
|
|
285
308
|
case 'next':
|
|
286
309
|
// 获取当前步骤的表单配置下有 rules 的控件进行校验(自定义的控件则自己有业务层面处理添加校验)
|
|
287
310
|
// console.log('执行下一步骤,需要优先进行校验')
|
|
288
|
-
var currentFields = formItemGroup[current].fields;
|
|
311
|
+
var currentFields = (formItemGroup || [])[current].fields;
|
|
289
312
|
var validatorGroup = currentFields && Array.isArray(currentFields) ? currentFields.map(function (fItem) {
|
|
290
313
|
return fItem.rules ? fItem.filedName : null;
|
|
291
314
|
}) : [];
|
|
292
315
|
formChild.validateFields(validatorGroup).then(function () {
|
|
293
316
|
// if (stepClick) stepClick(type, formChild, values);
|
|
294
|
-
extraFunc();
|
|
317
|
+
extraFunc && extraFunc();
|
|
295
318
|
}).catch(function () {
|
|
296
319
|
// console.log('表单校验不通过 ', errorFields.map(err => err))
|
|
297
320
|
});
|
|
298
321
|
break;
|
|
299
322
|
case 'prev':
|
|
300
323
|
// if (stepClick) stepClick(type, formChild);
|
|
301
|
-
extraFunc();
|
|
324
|
+
extraFunc && extraFunc();
|
|
302
325
|
break;
|
|
303
326
|
case 'cancel':
|
|
304
327
|
// if (stepClick) stepClick(type, formChild);
|
|
305
|
-
extraFunc();
|
|
328
|
+
extraFunc && extraFunc();
|
|
306
329
|
break;
|
|
307
330
|
default:
|
|
308
331
|
// extraFunc()
|
|
@@ -331,8 +354,8 @@ var StandardModal = function StandardModal(props) {
|
|
|
331
354
|
disabled = item.disabled,
|
|
332
355
|
loading = item.loading,
|
|
333
356
|
fn = item.fn,
|
|
334
|
-
others =
|
|
335
|
-
return /*#__PURE__*/React.createElement(
|
|
357
|
+
others = _objectWithoutProperties(item, _excluded2);
|
|
358
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
336
359
|
key: name,
|
|
337
360
|
type: _type || 'primary',
|
|
338
361
|
icon: /*#__PURE__*/React.createElement(IconNode, {
|
|
@@ -350,28 +373,30 @@ var StandardModal = function StandardModal(props) {
|
|
|
350
373
|
}
|
|
351
374
|
}));
|
|
352
375
|
}
|
|
353
|
-
|
|
354
376
|
if (typeof footerButtonGroup === 'function') {
|
|
355
377
|
return footerButtonGroup(modalForm, props);
|
|
356
378
|
}
|
|
357
379
|
return footerButtonGroup;
|
|
358
380
|
}
|
|
359
381
|
if (footer) return footer;
|
|
360
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
382
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, _extends({
|
|
361
383
|
key: "submit",
|
|
362
384
|
type: 'primary',
|
|
363
385
|
loading: confirmLoading,
|
|
364
386
|
onClick: handleSubmit
|
|
365
|
-
}, confirmButtonProps, okButtonProps), confirmText || okText || '确定'), /*#__PURE__*/React.createElement(
|
|
387
|
+
}, confirmButtonProps, okButtonProps), confirmText || okText || '确定'), /*#__PURE__*/React.createElement(Button, _extends({
|
|
366
388
|
key: "back",
|
|
367
389
|
onClick: handleCancel
|
|
368
390
|
}, cancelButtonProps), cancelText || '取消'));
|
|
369
391
|
};
|
|
370
392
|
var renderFooter = function renderFooter() {
|
|
371
|
-
var _a, _b;
|
|
372
393
|
if (type === 'stepForm') {
|
|
373
|
-
var
|
|
374
|
-
|
|
394
|
+
var _currentStepInfo$acti3;
|
|
395
|
+
// 过滤隐藏掉的步骤表单
|
|
396
|
+
var currentStepInfo = (formItemGroup || []).filter(function (fItem) {
|
|
397
|
+
return !fItem.hideStep;
|
|
398
|
+
})[stepsConfig.current];
|
|
399
|
+
return (currentStepInfo === null || currentStepInfo === void 0 || (_currentStepInfo$acti3 = currentStepInfo.actions) === null || _currentStepInfo$acti3 === void 0 ? void 0 : _currentStepInfo$acti3.length) > 0 ? /*#__PURE__*/React.createElement(ActionList, {
|
|
375
400
|
list: currentStepInfo.actions || [],
|
|
376
401
|
onStep: handleStepType,
|
|
377
402
|
form: formChild,
|
|
@@ -379,11 +404,12 @@ var StandardModal = function StandardModal(props) {
|
|
|
379
404
|
}) : null;
|
|
380
405
|
}
|
|
381
406
|
if (type === 'tabForm') {
|
|
382
|
-
var
|
|
407
|
+
var _activeTabInfo$action3;
|
|
408
|
+
var activeTabInfo = (formItemGroup || []).find(function (fItem) {
|
|
383
409
|
return fItem.key === (tabsConfig === null || tabsConfig === void 0 ? void 0 : tabsConfig.activeKey);
|
|
384
410
|
});
|
|
385
|
-
return (
|
|
386
|
-
list: activeTabInfo.actions || [],
|
|
411
|
+
return (activeTabInfo === null || activeTabInfo === void 0 || (_activeTabInfo$action3 = activeTabInfo.actions) === null || _activeTabInfo$action3 === void 0 ? void 0 : _activeTabInfo$action3.length) > 0 ? /*#__PURE__*/React.createElement(ActionList, {
|
|
412
|
+
list: (activeTabInfo === null || activeTabInfo === void 0 ? void 0 : activeTabInfo.actions) || [],
|
|
387
413
|
form: formChild,
|
|
388
414
|
other: props
|
|
389
415
|
}) : null;
|
|
@@ -392,21 +418,23 @@ var StandardModal = function StandardModal(props) {
|
|
|
392
418
|
};
|
|
393
419
|
// 内容渲染
|
|
394
420
|
var renderChildrenNodes = function renderChildrenNodes() {
|
|
395
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, children, (type === 'form' || type === 'gridForm') && /*#__PURE__*/React.createElement(
|
|
421
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children, (type === 'form' || type === 'gridForm') && /*#__PURE__*/React.createElement(Form, {
|
|
396
422
|
layout: formLayout,
|
|
397
423
|
ref: setModalFormRef,
|
|
398
424
|
form: modalForm,
|
|
399
425
|
onFinish: handleSubmit,
|
|
400
|
-
hideRequiredMark: fieldStatus === 'viewOnly' || hideRequiredMark
|
|
426
|
+
hideRequiredMark: fieldStatus === 'viewOnly' || hideRequiredMark
|
|
401
427
|
// initialValues={{ ...initialValues }}
|
|
428
|
+
,
|
|
402
429
|
scrollToFirstError: true,
|
|
403
430
|
className: "modalForm"
|
|
404
|
-
}, formPrefix && /*#__PURE__*/React.createElement(
|
|
431
|
+
}, formPrefix && /*#__PURE__*/React.createElement(Row, null, formPrefix(modalForm, props, forceUpdateForm)), formItemGroup ? renderFormItemGroup() : null, formPostfix && /*#__PURE__*/React.createElement(Row, null, formPostfix(modalForm, props, forceUpdateForm), " ")), type === 'tabForm' && /*#__PURE__*/React.createElement(TabForm, {
|
|
405
432
|
grid: size,
|
|
406
433
|
layout: formLayout,
|
|
407
434
|
fieldStatus: fieldStatus,
|
|
408
|
-
actionHide: true
|
|
435
|
+
actionHide: true
|
|
409
436
|
// @ts-ignore
|
|
437
|
+
,
|
|
410
438
|
getFormFields: function getFormFields(fields, form) {
|
|
411
439
|
setFormChild(form);
|
|
412
440
|
_getFormFields && _getFormFields(fields, form);
|
|
@@ -414,14 +442,15 @@ var StandardModal = function StandardModal(props) {
|
|
|
414
442
|
formItemGroup: formItemGroup,
|
|
415
443
|
tabsConfig: tabsConfig,
|
|
416
444
|
onSubmit: handleSubmit,
|
|
417
|
-
initialValues:
|
|
445
|
+
initialValues: _objectSpread({}, initialValues),
|
|
418
446
|
displayLayout: displayLayout
|
|
419
447
|
}), type === 'stepForm' && /*#__PURE__*/React.createElement(StepForm, {
|
|
420
448
|
grid: size,
|
|
421
449
|
layout: formLayout,
|
|
422
450
|
fieldStatus: fieldStatus,
|
|
423
|
-
actionHide: true
|
|
451
|
+
actionHide: true
|
|
424
452
|
// @ts-ignore
|
|
453
|
+
,
|
|
425
454
|
getFormFields: function getFormFields(fields, form) {
|
|
426
455
|
setFormChild(form);
|
|
427
456
|
_getFormFields && _getFormFields(fields, form);
|
|
@@ -429,64 +458,55 @@ var StandardModal = function StandardModal(props) {
|
|
|
429
458
|
formItemGroup: formItemGroup,
|
|
430
459
|
stepsConfig: stepsConfig,
|
|
431
460
|
onSubmit: handleSubmit,
|
|
432
|
-
initialValues:
|
|
461
|
+
initialValues: _objectSpread({}, initialValues),
|
|
433
462
|
displayLayout: displayLayout
|
|
434
463
|
}));
|
|
435
464
|
};
|
|
436
465
|
// 可拖动及缩放
|
|
437
466
|
if (dragAble) {
|
|
438
|
-
return /*#__PURE__*/React.createElement(
|
|
439
|
-
destroyOnClose: true
|
|
467
|
+
return wrapSSR( /*#__PURE__*/React.createElement(DraggableModalProvider, null, /*#__PURE__*/React.createElement(DraggableModal, _extends({
|
|
468
|
+
destroyOnClose: true
|
|
469
|
+
// @ts-ignore
|
|
470
|
+
,
|
|
440
471
|
initialWidth: otherProps.width || general.modalSize[size].width,
|
|
441
472
|
initialHeight: otherProps.height,
|
|
442
473
|
zIndex: 1001
|
|
443
474
|
}, otherProps, {
|
|
444
475
|
visible: visible,
|
|
445
|
-
className:
|
|
476
|
+
className: classNames(componentName, 'standardModal', className, fieldStatus === 'viewOnly' ? 'is-view' : '', hashId),
|
|
446
477
|
onCancel: handleCancel,
|
|
447
478
|
afterClose: onAfterClose,
|
|
448
479
|
onOk: handleSubmit,
|
|
449
480
|
title: title,
|
|
450
481
|
footer: renderFooter()
|
|
451
|
-
}), renderChildrenNodes());
|
|
452
|
-
/* return <DraggableModalProvider>
|
|
453
|
-
<DraggableModal destroyOnClose
|
|
454
|
-
initialWidth={otherProps.width || general.modalSize[size].width}
|
|
455
|
-
initialHeight={otherProps.height}
|
|
456
|
-
zIndex={1001}
|
|
457
|
-
{...otherProps}
|
|
458
|
-
visible={visible}
|
|
459
|
-
className={`standardModal ${className || ''} ${fieldStatus === 'viewOnly' ? 'is-view' : ''}`}
|
|
460
|
-
onCancel={handleCancel}
|
|
461
|
-
afterClose={onAfterClose}
|
|
462
|
-
onOk={handleSubmit}
|
|
463
|
-
title={title}
|
|
464
|
-
footer={renderFooter()}
|
|
465
|
-
>
|
|
466
|
-
{renderChildrenNodes()}
|
|
467
|
-
</DraggableModal>
|
|
468
|
-
</DraggableModalProvider>*/
|
|
482
|
+
}), renderChildrenNodes())));
|
|
469
483
|
}
|
|
470
|
-
|
|
471
|
-
return /*#__PURE__*/React.createElement(_Modal, Object.assign({
|
|
484
|
+
return wrapSSR( /*#__PURE__*/React.createElement(Modal, _extends({
|
|
472
485
|
destroyOnClose: true,
|
|
473
|
-
maskClosable: false
|
|
486
|
+
maskClosable: false
|
|
487
|
+
// @ts-ignore
|
|
488
|
+
,
|
|
474
489
|
width: general.modalSize[size].width
|
|
475
490
|
}, otherProps, {
|
|
476
491
|
open: visible,
|
|
477
492
|
title: title,
|
|
478
493
|
footer: renderFooter(),
|
|
479
|
-
className:
|
|
480
|
-
style:
|
|
494
|
+
className: classNames(componentName, 'standardModal', className, fieldStatus === 'viewOnly' ? 'is-view' : '', hashId),
|
|
495
|
+
style: _objectSpread({
|
|
481
496
|
top: '80px'
|
|
482
|
-
}, style)
|
|
483
|
-
bodyStyle:
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
497
|
+
}, style)
|
|
498
|
+
// bodyStyle={{ maxHeight: bodyMaxHeight, overflowY: 'scroll', ...bodyStyle }}
|
|
499
|
+
,
|
|
500
|
+
styles: {
|
|
501
|
+
body: _objectSpread({
|
|
502
|
+
maxHeight: bodyMaxHeight,
|
|
503
|
+
overflow: 'hidden',
|
|
504
|
+
overflowY: 'scroll'
|
|
505
|
+
}, bodyStyle)
|
|
506
|
+
},
|
|
487
507
|
onCancel: handleCancel,
|
|
488
508
|
afterClose: onAfterClose,
|
|
489
509
|
onOk: handleSubmit
|
|
490
|
-
}), renderChildrenNodes());
|
|
510
|
+
}), renderChildrenNodes()));
|
|
491
511
|
};
|
|
492
512
|
export default StandardModal;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
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); }
|
|
7
|
+
import { createStyleHook } from "../../theme/utils/genStyleHook";
|
|
8
|
+
import { scrollBar } from "../../theme/index";
|
|
9
|
+
var StandardPanelStyleFunc = function StandardPanelStyleFunc(prefix) {
|
|
10
|
+
var prepareComponentToken = function prepareComponentToken(token) {
|
|
11
|
+
return {
|
|
12
|
+
// fontWeight: 400,
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
return createStyleHook(prefix, function (token) {
|
|
16
|
+
var prefixCls = ".".concat(prefix);
|
|
17
|
+
return [_defineProperty(_defineProperty(_defineProperty({}, prefixCls, {
|
|
18
|
+
'.ant-modal-body ': _objectSpread({}, scrollBar(token)),
|
|
19
|
+
'.modalForm': {
|
|
20
|
+
'&.ant-form-horizontal .ant-form-item-label': {
|
|
21
|
+
'> label': {
|
|
22
|
+
minHeight: token.controlHeight + 'px'
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}), '.ant-form-item.form-item-view-only', {
|
|
27
|
+
'.ant-form-item-control-input': {
|
|
28
|
+
color: token.colorSecondary
|
|
29
|
+
},
|
|
30
|
+
'.modalGridTitle, .modal-grid-title': {
|
|
31
|
+
margin: "0 0 ".concat(token.marginMD, "px 0"),
|
|
32
|
+
paddingBottom: token.paddingXS,
|
|
33
|
+
paddingLeft: token.paddingXS
|
|
34
|
+
},
|
|
35
|
+
'&:before': {
|
|
36
|
+
borderLeft: " 4px solid ".concat(token.colorPrimary)
|
|
37
|
+
}
|
|
38
|
+
}), '.modalPanelTitle, .modal-grid-title', {
|
|
39
|
+
margin: "0 0 ".concat(token.marginMD, "px 0"),
|
|
40
|
+
paddingBottom: token.paddingXS,
|
|
41
|
+
borderBottom: "1px solid ".concat(token.colorBorder)
|
|
42
|
+
})];
|
|
43
|
+
}, prepareComponentToken // 当前组件扩展的变量
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
export default StandardPanelStyleFunc;
|