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,33 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import "antd/es/form/style";
|
|
10
|
-
import _Form from "antd/es/form";
|
|
1
|
+
var _excluded = ["children", "className", "style", "size", "type", "formItemGroup", "title", "visible", "formPrefix", "formPostfix", "initialValues", "hideRequiredMark", "bodyStyle", "footer", "footerButtonGroup", "hideFooter", "getFormFields", "fieldStatus", "formLayout", "tabsConfig", "stepsConfig", "displayLayout", "dragAble"],
|
|
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); }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
|
+
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); }
|
|
11
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); }
|
|
12
10
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
13
11
|
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
12
|
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)
|
|
13
|
+
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; }
|
|
14
|
+
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
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
-
|
|
16
|
+
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; }
|
|
17
|
+
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; }
|
|
18
|
+
/* eslint-disable */
|
|
19
19
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
20
|
-
import {
|
|
21
|
-
import
|
|
22
|
-
import
|
|
20
|
+
import { Form, Modal, Button, Row, Col } from 'antd';
|
|
21
|
+
import { general } from "../data";
|
|
22
|
+
import RenderItemGroup from "../FormComp/RenderItemGroup";
|
|
23
|
+
import { UtilValueFormat } from "../utils";
|
|
23
24
|
import IconNode from "../components/IconNode";
|
|
24
|
-
import TabForm from
|
|
25
|
-
import StepForm from
|
|
26
|
-
|
|
27
|
-
import
|
|
25
|
+
import TabForm from "../StandardForm/TabForm";
|
|
26
|
+
import StepForm from "../StandardForm/StepForm";
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
import ActionList from "../StandardForm/ActionList";
|
|
29
|
+
import "./style/index.less";
|
|
28
30
|
// import { DraggableModal, DraggableModalProvider } from '../StandardDragModal/index'
|
|
29
|
-
import StandardDragModal from
|
|
30
|
-
import
|
|
31
|
+
import StandardDragModal from "../StandardDragModal/Modal";
|
|
32
|
+
import "../StandardDragModal/index.less";
|
|
31
33
|
var StandardModal = function StandardModal(props) {
|
|
32
34
|
var children = props.children,
|
|
33
35
|
className = props.className,
|
|
@@ -56,8 +58,8 @@ var StandardModal = function StandardModal(props) {
|
|
|
56
58
|
displayLayout = props.displayLayout,
|
|
57
59
|
_props$dragAble = props.dragAble,
|
|
58
60
|
dragAble = _props$dragAble === void 0 ? false : _props$dragAble,
|
|
59
|
-
otherProps =
|
|
60
|
-
var _Form$useForm =
|
|
61
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
62
|
+
var _Form$useForm = Form.useForm(),
|
|
61
63
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
62
64
|
modalForm = _Form$useForm2[0];
|
|
63
65
|
var _useState = useState(),
|
|
@@ -67,27 +69,31 @@ var StandardModal = function StandardModal(props) {
|
|
|
67
69
|
var _useState3 = useState(0),
|
|
68
70
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
69
71
|
bodyMaxHeight = _useState4[0],
|
|
70
|
-
setBodyMaxHeight = _useState4[1];
|
|
72
|
+
setBodyMaxHeight = _useState4[1];
|
|
73
|
+
|
|
74
|
+
// setTabFormChild
|
|
71
75
|
var _useState5 = useState(),
|
|
72
76
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
73
77
|
formChild = _useState6[0],
|
|
74
78
|
setFormChild = _useState6[1]; // <---- set the ref when Form Rendered
|
|
79
|
+
|
|
75
80
|
// 按钮栏是否有显示(默认显示)
|
|
76
81
|
var hasFooterBar = useMemo(function () {
|
|
77
|
-
var _a, _b, _c, _d, _e;
|
|
78
82
|
var openLog = false;
|
|
79
83
|
if (type === 'tabForm' || type === 'stepForm') {
|
|
80
84
|
if (type === 'tabForm') {
|
|
81
|
-
var
|
|
85
|
+
var _activeTabInfo$action, _activeTabInfo$action2;
|
|
86
|
+
var activeTabInfo = (formItemGroup || []).find(function (fItem) {
|
|
82
87
|
return fItem.key === (tabsConfig === null || tabsConfig === void 0 ? void 0 : tabsConfig.activeKey);
|
|
83
88
|
});
|
|
84
|
-
openLog && console.log('rule 0-1', (
|
|
85
|
-
return (
|
|
89
|
+
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);
|
|
90
|
+
return (activeTabInfo === null || activeTabInfo === void 0 || (_activeTabInfo$action2 = activeTabInfo.actions) === null || _activeTabInfo$action2 === void 0 ? void 0 : _activeTabInfo$action2.length) > 0;
|
|
86
91
|
}
|
|
87
92
|
if (type === 'stepForm') {
|
|
88
|
-
var
|
|
89
|
-
|
|
90
|
-
|
|
93
|
+
var _currentStepInfo$acti, _currentStepInfo$acti2;
|
|
94
|
+
var currentStepInfo = (formItemGroup || [])[stepsConfig.current];
|
|
95
|
+
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);
|
|
96
|
+
return (currentStepInfo === null || currentStepInfo === void 0 || (_currentStepInfo$acti2 = currentStepInfo.actions) === null || _currentStepInfo$acti2 === void 0 ? void 0 : _currentStepInfo$acti2.length) > 0;
|
|
91
97
|
}
|
|
92
98
|
return true;
|
|
93
99
|
} else {
|
|
@@ -105,11 +111,12 @@ var StandardModal = function StandardModal(props) {
|
|
|
105
111
|
return false;
|
|
106
112
|
}
|
|
107
113
|
if (props.hasOwnProperty('footerButtonGroup') && footerButtonGroup) {
|
|
114
|
+
var _footerButtonGroup;
|
|
108
115
|
if (Array.isArray(footerButtonGroup) && footerButtonGroup.length === 0) {
|
|
109
116
|
openLog && console.log('rule 4');
|
|
110
117
|
// 返回为空数组不占用按钮栏
|
|
111
118
|
return false;
|
|
112
|
-
} else if (typeof footerButtonGroup === 'function' && (!footerButtonGroup() || ((
|
|
119
|
+
} else if (typeof footerButtonGroup === 'function' && (!footerButtonGroup() || ((_footerButtonGroup = footerButtonGroup()) === null || _footerButtonGroup === void 0 ? void 0 : _footerButtonGroup.length) === 0)) {
|
|
113
120
|
openLog && console.log('rule 5');
|
|
114
121
|
// 配置类型为Function且返回值为null或者返回数组长度为0时,不显示按钮栏
|
|
115
122
|
return false;
|
|
@@ -144,7 +151,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
144
151
|
if (visible && modalFormRef) {
|
|
145
152
|
// <---- check ref before use the form instance
|
|
146
153
|
if (initialValues && _typeof(initialValues) === 'object') {
|
|
147
|
-
initialValues && modalForm.setFieldsValue(
|
|
154
|
+
initialValues && modalForm.setFieldsValue(_objectSpread({}, initialValues));
|
|
148
155
|
forceUpdateForm();
|
|
149
156
|
}
|
|
150
157
|
}
|
|
@@ -170,10 +177,9 @@ var StandardModal = function StandardModal(props) {
|
|
|
170
177
|
if (Object.prototype.hasOwnProperty.call(values, 'false')) {
|
|
171
178
|
delete values.false; // 自定义结构会莫名的出来一个false字段
|
|
172
179
|
}
|
|
173
|
-
|
|
174
180
|
var resultValues = UtilValueFormat(values, formItemGroup);
|
|
175
181
|
if (onSubmit) {
|
|
176
|
-
onSubmit(
|
|
182
|
+
onSubmit(_objectSpread({}, resultValues));
|
|
177
183
|
}
|
|
178
184
|
}).catch(function () {
|
|
179
185
|
// 定位到第一条表单异常的
|
|
@@ -190,10 +196,9 @@ var StandardModal = function StandardModal(props) {
|
|
|
190
196
|
if (Object.prototype.hasOwnProperty.call(values, 'false')) {
|
|
191
197
|
delete values.false; // 自定义结构会莫名的出来一个false字段
|
|
192
198
|
}
|
|
193
|
-
|
|
194
199
|
var resultValues = UtilValueFormat(values, formItemGroup);
|
|
195
200
|
if (onSubmit) {
|
|
196
|
-
onSubmit(
|
|
201
|
+
onSubmit(_objectSpread({}, resultValues));
|
|
197
202
|
}
|
|
198
203
|
}).catch(function () {
|
|
199
204
|
// 定位到第一条表单异常的
|
|
@@ -208,6 +213,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
208
213
|
onSubmit && onSubmit();
|
|
209
214
|
}
|
|
210
215
|
};
|
|
216
|
+
|
|
211
217
|
// 重置所有表单
|
|
212
218
|
var clearAllFieldsValue = function clearAllFieldsValue() {
|
|
213
219
|
// let allFields = {}
|
|
@@ -215,7 +221,6 @@ var StandardModal = function StandardModal(props) {
|
|
|
215
221
|
// modalForm.setFieldsValue(allFields) // 直接清空表单的赋值(initialValues传值如果没有前后赋值没有全部带上所有字段,则会默认又使用之前的部分未传参字段)
|
|
216
222
|
modalForm.resetFields(); // 直接使用这个无效
|
|
217
223
|
};
|
|
218
|
-
|
|
219
224
|
var onAfterClose = function onAfterClose() {
|
|
220
225
|
var afterClose = props.afterClose;
|
|
221
226
|
if (type === 'form') clearAllFieldsValue();
|
|
@@ -225,6 +230,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
225
230
|
var onCancel = props.onCancel;
|
|
226
231
|
if (onCancel) onCancel();
|
|
227
232
|
};
|
|
233
|
+
|
|
228
234
|
// 强制更新表单值,用于赋初始化实例值
|
|
229
235
|
var forceUpdateForm = function forceUpdateForm() {
|
|
230
236
|
_getFormFields && _getFormFields(modalForm.getFieldsValue() || {}, modalForm);
|
|
@@ -238,7 +244,7 @@ var StandardModal = function StandardModal(props) {
|
|
|
238
244
|
if (Array.isArray(formItemGroup)) {
|
|
239
245
|
if (type === 'gridForm') {
|
|
240
246
|
// 栅格组
|
|
241
|
-
return /*#__PURE__*/React.createElement(
|
|
247
|
+
return /*#__PURE__*/React.createElement(Row, {
|
|
242
248
|
gutter: 20
|
|
243
249
|
}, formItemGroup.map(function (item, index) {
|
|
244
250
|
var childrenFields = item.fields || [];
|
|
@@ -246,10 +252,11 @@ var StandardModal = function StandardModal(props) {
|
|
|
246
252
|
childrenFields = [{
|
|
247
253
|
type: item.type,
|
|
248
254
|
label: item.label,
|
|
249
|
-
protoConfig:
|
|
255
|
+
protoConfig: _objectSpread({}, item.protoConfig)
|
|
256
|
+
// protoConfig: { className: '', ...item.protoConfig }
|
|
250
257
|
}].concat(childrenFields);
|
|
251
258
|
}
|
|
252
|
-
return /*#__PURE__*/React.createElement(
|
|
259
|
+
return /*#__PURE__*/React.createElement(Col, {
|
|
253
260
|
key: index,
|
|
254
261
|
span: item.gridSpan || 24
|
|
255
262
|
}, /*#__PURE__*/React.createElement(RenderItemGroup, {
|
|
@@ -286,24 +293,24 @@ var StandardModal = function StandardModal(props) {
|
|
|
286
293
|
case 'next':
|
|
287
294
|
// 获取当前步骤的表单配置下有 rules 的控件进行校验(自定义的控件则自己有业务层面处理添加校验)
|
|
288
295
|
// console.log('执行下一步骤,需要优先进行校验')
|
|
289
|
-
var currentFields = formItemGroup[current].fields;
|
|
296
|
+
var currentFields = (formItemGroup || [])[current].fields;
|
|
290
297
|
var validatorGroup = currentFields && Array.isArray(currentFields) ? currentFields.map(function (fItem) {
|
|
291
298
|
return fItem.rules ? fItem.filedName : null;
|
|
292
299
|
}) : [];
|
|
293
300
|
formChild.validateFields(validatorGroup).then(function () {
|
|
294
301
|
// if (stepClick) stepClick(type, formChild, values);
|
|
295
|
-
extraFunc();
|
|
302
|
+
extraFunc && extraFunc();
|
|
296
303
|
}).catch(function () {
|
|
297
304
|
// console.log('表单校验不通过 ', errorFields.map(err => err))
|
|
298
305
|
});
|
|
299
306
|
break;
|
|
300
307
|
case 'prev':
|
|
301
308
|
// if (stepClick) stepClick(type, formChild);
|
|
302
|
-
extraFunc();
|
|
309
|
+
extraFunc && extraFunc();
|
|
303
310
|
break;
|
|
304
311
|
case 'cancel':
|
|
305
312
|
// if (stepClick) stepClick(type, formChild);
|
|
306
|
-
extraFunc();
|
|
313
|
+
extraFunc && extraFunc();
|
|
307
314
|
break;
|
|
308
315
|
default:
|
|
309
316
|
// extraFunc()
|
|
@@ -332,8 +339,8 @@ var StandardModal = function StandardModal(props) {
|
|
|
332
339
|
disabled = item.disabled,
|
|
333
340
|
loading = item.loading,
|
|
334
341
|
fn = item.fn,
|
|
335
|
-
others =
|
|
336
|
-
return /*#__PURE__*/React.createElement(
|
|
342
|
+
others = _objectWithoutProperties(item, _excluded2);
|
|
343
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
337
344
|
key: name,
|
|
338
345
|
type: _type || 'primary',
|
|
339
346
|
icon: /*#__PURE__*/React.createElement(IconNode, {
|
|
@@ -351,28 +358,27 @@ var StandardModal = function StandardModal(props) {
|
|
|
351
358
|
}
|
|
352
359
|
}));
|
|
353
360
|
}
|
|
354
|
-
|
|
355
361
|
if (typeof footerButtonGroup === 'function') {
|
|
356
362
|
return footerButtonGroup(modalForm, props);
|
|
357
363
|
}
|
|
358
364
|
return footerButtonGroup;
|
|
359
365
|
}
|
|
360
366
|
if (footer) return footer;
|
|
361
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
367
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, _extends({
|
|
362
368
|
key: "submit",
|
|
363
369
|
type: 'primary',
|
|
364
370
|
loading: confirmLoading,
|
|
365
371
|
onClick: handleSubmit
|
|
366
|
-
}, confirmButtonProps, okButtonProps), confirmText || okText || '确定'), /*#__PURE__*/React.createElement(
|
|
372
|
+
}, confirmButtonProps, okButtonProps), confirmText || okText || '确定'), /*#__PURE__*/React.createElement(Button, _extends({
|
|
367
373
|
key: "back",
|
|
368
374
|
onClick: handleCancel
|
|
369
375
|
}, cancelButtonProps), cancelText || '取消'));
|
|
370
376
|
};
|
|
371
377
|
var renderFooter = function renderFooter() {
|
|
372
|
-
var _a, _b;
|
|
373
378
|
if (type === 'stepForm') {
|
|
374
|
-
var
|
|
375
|
-
|
|
379
|
+
var _currentStepInfo$acti3;
|
|
380
|
+
var currentStepInfo = (formItemGroup || [])[stepsConfig.current];
|
|
381
|
+
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, {
|
|
376
382
|
list: currentStepInfo.actions || [],
|
|
377
383
|
onStep: handleStepType,
|
|
378
384
|
form: formChild,
|
|
@@ -380,11 +386,12 @@ var StandardModal = function StandardModal(props) {
|
|
|
380
386
|
}) : null;
|
|
381
387
|
}
|
|
382
388
|
if (type === 'tabForm') {
|
|
383
|
-
var
|
|
389
|
+
var _activeTabInfo$action3;
|
|
390
|
+
var activeTabInfo = (formItemGroup || []).find(function (fItem) {
|
|
384
391
|
return fItem.key === (tabsConfig === null || tabsConfig === void 0 ? void 0 : tabsConfig.activeKey);
|
|
385
392
|
});
|
|
386
|
-
return (
|
|
387
|
-
list: activeTabInfo.actions || [],
|
|
393
|
+
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, {
|
|
394
|
+
list: (activeTabInfo === null || activeTabInfo === void 0 ? void 0 : activeTabInfo.actions) || [],
|
|
388
395
|
form: formChild,
|
|
389
396
|
other: props
|
|
390
397
|
}) : null;
|
|
@@ -393,21 +400,23 @@ var StandardModal = function StandardModal(props) {
|
|
|
393
400
|
};
|
|
394
401
|
// 内容渲染
|
|
395
402
|
var renderChildrenNodes = function renderChildrenNodes() {
|
|
396
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, children, (type === 'form' || type === 'gridForm') && /*#__PURE__*/React.createElement(
|
|
403
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children, (type === 'form' || type === 'gridForm') && /*#__PURE__*/React.createElement(Form, {
|
|
397
404
|
layout: formLayout,
|
|
398
405
|
ref: setModalFormRef,
|
|
399
406
|
form: modalForm,
|
|
400
407
|
onFinish: handleSubmit,
|
|
401
|
-
hideRequiredMark: fieldStatus === 'viewOnly' || hideRequiredMark
|
|
408
|
+
hideRequiredMark: fieldStatus === 'viewOnly' || hideRequiredMark
|
|
402
409
|
// initialValues={{ ...initialValues }}
|
|
410
|
+
,
|
|
403
411
|
scrollToFirstError: true,
|
|
404
412
|
className: "modalForm"
|
|
405
|
-
}, formPrefix && /*#__PURE__*/React.createElement(
|
|
413
|
+
}, 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, {
|
|
406
414
|
grid: size,
|
|
407
415
|
layout: formLayout,
|
|
408
416
|
fieldStatus: fieldStatus,
|
|
409
|
-
actionHide: true
|
|
417
|
+
actionHide: true
|
|
410
418
|
// @ts-ignore
|
|
419
|
+
,
|
|
411
420
|
getFormFields: function getFormFields(fields, form) {
|
|
412
421
|
setFormChild(form);
|
|
413
422
|
_getFormFields && _getFormFields(fields, form);
|
|
@@ -415,14 +424,15 @@ var StandardModal = function StandardModal(props) {
|
|
|
415
424
|
formItemGroup: formItemGroup,
|
|
416
425
|
tabsConfig: tabsConfig,
|
|
417
426
|
onSubmit: handleSubmit,
|
|
418
|
-
initialValues:
|
|
427
|
+
initialValues: _objectSpread({}, initialValues),
|
|
419
428
|
displayLayout: displayLayout
|
|
420
429
|
}), type === 'stepForm' && /*#__PURE__*/React.createElement(StepForm, {
|
|
421
430
|
grid: size,
|
|
422
431
|
layout: formLayout,
|
|
423
432
|
fieldStatus: fieldStatus,
|
|
424
|
-
actionHide: true
|
|
433
|
+
actionHide: true
|
|
425
434
|
// @ts-ignore
|
|
435
|
+
,
|
|
426
436
|
getFormFields: function getFormFields(fields, form) {
|
|
427
437
|
setFormChild(form);
|
|
428
438
|
_getFormFields && _getFormFields(fields, form);
|
|
@@ -430,14 +440,16 @@ var StandardModal = function StandardModal(props) {
|
|
|
430
440
|
formItemGroup: formItemGroup,
|
|
431
441
|
stepsConfig: stepsConfig,
|
|
432
442
|
onSubmit: handleSubmit,
|
|
433
|
-
initialValues:
|
|
443
|
+
initialValues: _objectSpread({}, initialValues),
|
|
434
444
|
displayLayout: displayLayout
|
|
435
445
|
}));
|
|
436
446
|
};
|
|
437
447
|
// 可拖动及缩放
|
|
438
448
|
if (dragAble) {
|
|
439
|
-
return /*#__PURE__*/React.createElement(StandardDragModal,
|
|
440
|
-
destroyOnClose: true
|
|
449
|
+
return /*#__PURE__*/React.createElement(StandardDragModal, _extends({
|
|
450
|
+
destroyOnClose: true
|
|
451
|
+
// @ts-ignore
|
|
452
|
+
,
|
|
441
453
|
initialWidth: otherProps.width || general.modalSize[size].width,
|
|
442
454
|
initialHeight: otherProps.height,
|
|
443
455
|
zIndex: 1001
|
|
@@ -468,20 +480,21 @@ var StandardModal = function StandardModal(props) {
|
|
|
468
480
|
</DraggableModal>
|
|
469
481
|
</DraggableModalProvider>*/
|
|
470
482
|
}
|
|
471
|
-
|
|
472
|
-
return /*#__PURE__*/React.createElement(_Modal, Object.assign({
|
|
483
|
+
return /*#__PURE__*/React.createElement(Modal, _extends({
|
|
473
484
|
destroyOnClose: true,
|
|
474
|
-
maskClosable: false
|
|
485
|
+
maskClosable: false
|
|
486
|
+
// @ts-ignore
|
|
487
|
+
,
|
|
475
488
|
width: general.modalSize[size].width
|
|
476
489
|
}, otherProps, {
|
|
477
490
|
open: visible,
|
|
478
491
|
title: title,
|
|
479
492
|
footer: renderFooter(),
|
|
480
493
|
className: "standardModal ".concat(className || '', " ").concat(fieldStatus === 'viewOnly' ? 'is-view' : ''),
|
|
481
|
-
style:
|
|
494
|
+
style: _objectSpread({
|
|
482
495
|
top: '80px'
|
|
483
496
|
}, style),
|
|
484
|
-
bodyStyle:
|
|
497
|
+
bodyStyle: _objectSpread({
|
|
485
498
|
maxHeight: bodyMaxHeight,
|
|
486
499
|
overflowY: 'scroll'
|
|
487
500
|
}, bodyStyle),
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
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); }
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { useContext } from 'react';
|
|
3
4
|
import { useUID } from 'react-uid';
|
|
4
|
-
import { DraggableModalContext } from
|
|
5
|
-
import { DraggableModalInner } from
|
|
6
|
-
import { getModalState } from
|
|
5
|
+
import { DraggableModalContext } from "./DraggableModalContext";
|
|
6
|
+
import { DraggableModalInner } from "./DraggableModalInner";
|
|
7
|
+
import { getModalState } from "./draggableModalReducer";
|
|
7
8
|
export var DraggableModal = function DraggableModal(props) {
|
|
8
9
|
// Get the unique ID of this modal.
|
|
9
10
|
var id = useUID();
|
|
11
|
+
|
|
10
12
|
// Get modal provider.
|
|
11
13
|
var modalProvider = useContext(DraggableModalContext);
|
|
12
14
|
if (!modalProvider) {
|
|
@@ -20,10 +22,11 @@ export var DraggableModal = function DraggableModal(props) {
|
|
|
20
22
|
initialHeight: props.initialHeight,
|
|
21
23
|
initialWidth: props.initialWidth
|
|
22
24
|
});
|
|
25
|
+
|
|
23
26
|
// We do this so that we don't re-render all modals for every state change.
|
|
24
27
|
// DraggableModalInner uses React.memo, so it only re-renders if
|
|
25
28
|
// if props change (e.g. modalState).
|
|
26
|
-
return /*#__PURE__*/React.createElement(DraggableModalInner,
|
|
29
|
+
return /*#__PURE__*/React.createElement(DraggableModalInner, _extends({
|
|
27
30
|
id: id,
|
|
28
31
|
dispatch: dispatch,
|
|
29
32
|
modalState: modalState
|
|
@@ -6,4 +6,4 @@ export interface DraggableModalContextMethods {
|
|
|
6
6
|
export interface DraggableModalContextValue extends DraggableModalContextMethods {
|
|
7
7
|
state: ModalsState;
|
|
8
8
|
}
|
|
9
|
-
export declare const DraggableModalContext: React.Context<DraggableModalContextValue>;
|
|
9
|
+
export declare const DraggableModalContext: React.Context<DraggableModalContextValue | null>;
|
|
@@ -8,9 +8,9 @@ interface ContextProps extends DraggableModalContextMethods {
|
|
|
8
8
|
initialWidth?: number;
|
|
9
9
|
initialHeight?: number;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
11
|
+
export type DraggableModalInnerProps = ModalProps & {
|
|
12
12
|
children?: React.ReactNode;
|
|
13
13
|
} & ContextProps;
|
|
14
|
-
declare function DraggableModalInnerNonMemo({ id, modalState, dispatch, visible, children, title, initialWidth, initialHeight, ...otherProps }: DraggableModalInnerProps): JSX.Element;
|
|
14
|
+
declare function DraggableModalInnerNonMemo({ id, modalState, dispatch, visible, children, title, initialWidth, initialHeight, ...otherProps }: DraggableModalInnerProps): React.JSX.Element;
|
|
15
15
|
export declare const DraggableModalInner: React.MemoExoticComponent<typeof DraggableModalInnerNonMemo>;
|
|
16
16
|
export {};
|
|
@@ -1,27 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
+
var _excluded = ["id", "modalState", "dispatch", "visible", "children", "title", "initialWidth", "initialHeight"];
|
|
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); }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
|
+
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); }
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
4
11
|
import * as React from 'react';
|
|
5
12
|
import { useEffect, useMemo, useCallback, memo } from 'react';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
13
|
+
import { Modal } from 'antd';
|
|
14
|
+
import { ResizeHandle } from "./ResizeHandle";
|
|
15
|
+
import { useDrag } from "./useDrag";
|
|
16
|
+
import { usePrevious } from "./usePrevious";
|
|
17
|
+
import { useResize } from "./useResize";
|
|
10
18
|
var modalStyle = {
|
|
11
19
|
margin: 0,
|
|
12
20
|
paddingBottom: 0,
|
|
13
21
|
pointerEvents: 'auto'
|
|
14
22
|
};
|
|
15
|
-
function DraggableModalInnerNonMemo(
|
|
16
|
-
var id =
|
|
17
|
-
modalState =
|
|
18
|
-
dispatch =
|
|
19
|
-
visible =
|
|
20
|
-
children =
|
|
21
|
-
title =
|
|
22
|
-
initialWidth =
|
|
23
|
-
initialHeight =
|
|
24
|
-
otherProps =
|
|
23
|
+
function DraggableModalInnerNonMemo(_ref) {
|
|
24
|
+
var id = _ref.id,
|
|
25
|
+
modalState = _ref.modalState,
|
|
26
|
+
dispatch = _ref.dispatch,
|
|
27
|
+
visible = _ref.visible,
|
|
28
|
+
children = _ref.children,
|
|
29
|
+
title = _ref.title,
|
|
30
|
+
initialWidth = _ref.initialWidth,
|
|
31
|
+
initialHeight = _ref.initialHeight,
|
|
32
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
33
|
+
// Call on mount and unmount.
|
|
25
34
|
useEffect(function () {
|
|
26
35
|
dispatch({
|
|
27
36
|
type: 'mount',
|
|
@@ -38,6 +47,7 @@ function DraggableModalInnerNonMemo(_a) {
|
|
|
38
47
|
});
|
|
39
48
|
};
|
|
40
49
|
}, [dispatch, id, initialWidth, initialHeight]);
|
|
50
|
+
|
|
41
51
|
// Bring this to the front if it's been opened with props.
|
|
42
52
|
var visiblePrevious = usePrevious(visible);
|
|
43
53
|
useEffect(function () {
|
|
@@ -61,7 +71,7 @@ function DraggableModalInnerNonMemo(_a) {
|
|
|
61
71
|
width = modalState.width,
|
|
62
72
|
height = modalState.height;
|
|
63
73
|
var style = useMemo(function () {
|
|
64
|
-
return
|
|
74
|
+
return _objectSpread(_objectSpread({}, modalStyle), {}, {
|
|
65
75
|
top: y,
|
|
66
76
|
left: x,
|
|
67
77
|
height: height
|
|
@@ -74,13 +84,13 @@ function DraggableModalInnerNonMemo(_a) {
|
|
|
74
84
|
});
|
|
75
85
|
}, [id, dispatch]);
|
|
76
86
|
var onDragWithID = useCallback(function (args) {
|
|
77
|
-
return dispatch(
|
|
87
|
+
return dispatch(_objectSpread({
|
|
78
88
|
type: 'drag',
|
|
79
89
|
id: id
|
|
80
90
|
}, args));
|
|
81
91
|
}, [dispatch, id]);
|
|
82
92
|
var onResizeWithID = useCallback(function (args) {
|
|
83
|
-
return dispatch(
|
|
93
|
+
return dispatch(_objectSpread({
|
|
84
94
|
type: 'resize',
|
|
85
95
|
id: id
|
|
86
96
|
}, args));
|
|
@@ -94,7 +104,7 @@ function DraggableModalInnerNonMemo(_a) {
|
|
|
94
104
|
onClick: onFocus
|
|
95
105
|
}, title);
|
|
96
106
|
}, [onMouseDrag, onFocus, title]);
|
|
97
|
-
return /*#__PURE__*/React.createElement(
|
|
107
|
+
return /*#__PURE__*/React.createElement(Modal, _extends({
|
|
98
108
|
wrapClassName: "ant-design-draggable-modal",
|
|
99
109
|
style: style,
|
|
100
110
|
width: width,
|
|
@@ -2,14 +2,14 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
2
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3
3
|
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."); }
|
|
4
4
|
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); }
|
|
5
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
6
|
-
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)
|
|
5
|
+
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; }
|
|
6
|
+
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; } }
|
|
7
7
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
import { useEffect, useReducer } from 'react';
|
|
10
|
-
import { DraggableModalContext } from
|
|
11
|
-
import { getWindowSize } from
|
|
12
|
-
import { draggableModalReducer, initialModalsState } from
|
|
10
|
+
import { DraggableModalContext } from "./DraggableModalContext";
|
|
11
|
+
import { getWindowSize } from "./getWindowSize";
|
|
12
|
+
import { draggableModalReducer, initialModalsState } from "./draggableModalReducer";
|
|
13
13
|
export var DraggableModalProvider = function DraggableModalProvider(_ref) {
|
|
14
14
|
var children = _ref.children;
|
|
15
15
|
var _useReducer = useReducer(draggableModalReducer, initialModalsState),
|
|
@@ -7,5 +7,5 @@ interface StandardDragModalProps {
|
|
|
7
7
|
initialHeight?: number;
|
|
8
8
|
[k: string]: any;
|
|
9
9
|
}
|
|
10
|
-
declare const StandardDragModal: (props: StandardDragModalProps) => JSX.Element;
|
|
10
|
+
declare const StandardDragModal: (props: StandardDragModalProps) => React.JSX.Element;
|
|
11
11
|
export default StandardDragModal;
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["visible", "onCancel", "onSubmit", "children"];
|
|
2
|
+
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); }
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
2
5
|
import React from 'react';
|
|
3
|
-
import { DraggableModal, DraggableModalProvider } from
|
|
4
|
-
import
|
|
6
|
+
import { DraggableModal, DraggableModalProvider } from "./index";
|
|
7
|
+
import "./index.less";
|
|
5
8
|
var StandardDragModal = function StandardDragModal(props) {
|
|
6
9
|
var visible = props.visible,
|
|
7
10
|
onCancel = props.onCancel,
|
|
8
11
|
onSubmit = props.onSubmit,
|
|
9
12
|
children = props.children,
|
|
10
|
-
others =
|
|
13
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
11
14
|
var handleOk = function handleOk() {
|
|
12
15
|
onSubmit && onSubmit();
|
|
13
16
|
};
|
|
14
17
|
var handleCancel = function handleCancel() {
|
|
15
18
|
onCancel && onCancel();
|
|
16
19
|
};
|
|
17
|
-
return /*#__PURE__*/React.createElement(DraggableModalProvider, null, /*#__PURE__*/React.createElement(DraggableModal,
|
|
20
|
+
return /*#__PURE__*/React.createElement(DraggableModalProvider, null, /*#__PURE__*/React.createElement(DraggableModal, _extends({
|
|
18
21
|
visible: visible,
|
|
19
22
|
onOk: handleOk,
|
|
20
23
|
onCancel: handleCancel,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
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); }
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
export var ResizeHandle = function ResizeHandle(props) {
|
|
3
|
-
return /*#__PURE__*/React.createElement("div",
|
|
4
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
4
5
|
className: "ant-design-draggable-modal-resize-handle"
|
|
5
6
|
}, props), /*#__PURE__*/React.createElement("div", {
|
|
6
7
|
className: "ant-design-draggable-modal-resize-handle-inner"
|