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,8 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//@root-entry-name: default;
|
|
2
|
+
//@import (reference) '~antd/es/style/themes/index';
|
|
3
3
|
|
|
4
4
|
.refactor-tree-select {
|
|
5
5
|
position: relative;
|
|
6
|
+
width: 100%;
|
|
7
|
+
& * {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
}
|
|
10
|
+
|
|
6
11
|
&.refactor-tree-select-sm {
|
|
7
12
|
.refactor-tree-select-extra {
|
|
8
13
|
height: 22px;
|
|
@@ -26,17 +31,17 @@
|
|
|
26
31
|
//}
|
|
27
32
|
}
|
|
28
33
|
&.refactor-disabled .refactor-tree-select-extra {
|
|
29
|
-
background: @disabled-bg;
|
|
30
|
-
color: @disabled-color;
|
|
34
|
+
//background: @disabled-bg;
|
|
35
|
+
//color: @disabled-color;
|
|
31
36
|
}
|
|
32
37
|
.refactor-tree-select-extra {
|
|
33
38
|
width: 100%;
|
|
34
|
-
background: @component-background;
|
|
39
|
+
//background: @component-background;
|
|
35
40
|
position: absolute;
|
|
36
41
|
top: 0;
|
|
37
42
|
left: 0;
|
|
38
43
|
bottom: 0;
|
|
39
|
-
height: @input-height-base;
|
|
44
|
+
//height: @input-height-base;
|
|
40
45
|
z-index: 1;
|
|
41
46
|
padding: 1px 22px 1px 8px;
|
|
42
47
|
line-height: 30px;
|
|
@@ -45,7 +50,7 @@
|
|
|
45
50
|
white-space: nowrap;
|
|
46
51
|
}
|
|
47
52
|
}
|
|
48
|
-
|
|
53
|
+
//
|
|
49
54
|
.spec-uploader-viewonly {
|
|
50
55
|
display: inline-block;
|
|
51
56
|
width: 100%;
|
|
@@ -58,11 +63,11 @@
|
|
|
58
63
|
float: left;
|
|
59
64
|
width: 100px;
|
|
60
65
|
height: 100px;
|
|
61
|
-
padding: @padding-xs;
|
|
62
|
-
margin-right: @padding-xs;
|
|
63
|
-
margin-bottom: @padding-xs;
|
|
64
|
-
border: 1px solid @border-color-base;
|
|
65
|
-
border-radius: @border-radius-sm;
|
|
66
|
+
//padding: @padding-xs;
|
|
67
|
+
//margin-right: @padding-xs;
|
|
68
|
+
//margin-bottom: @padding-xs;
|
|
69
|
+
//border: 1px solid @border-color-base;
|
|
70
|
+
//border-radius: @border-radius-sm;
|
|
66
71
|
line-height: 88px;
|
|
67
72
|
text-align: center;
|
|
68
73
|
background: transparent;
|
|
@@ -80,9 +85,9 @@
|
|
|
80
85
|
.tree-select-viewonly-list {
|
|
81
86
|
position: relative;
|
|
82
87
|
width: 100%;
|
|
83
|
-
border: 1px solid fade(@border-color-split, 60%);
|
|
84
|
-
border-radius: @border-radius-sm;
|
|
85
|
-
padding: @padding-xs @padding-sm;
|
|
88
|
+
//border: 1px solid fade(@border-color-split, 60%);
|
|
89
|
+
//border-radius: @border-radius-sm;
|
|
90
|
+
//padding: @padding-xs @padding-sm;
|
|
86
91
|
&.collapsed {
|
|
87
92
|
padding-bottom: 28px;
|
|
88
93
|
}
|
|
@@ -97,15 +102,15 @@
|
|
|
97
102
|
height: 28px;
|
|
98
103
|
line-height: 28px;
|
|
99
104
|
text-align: center;
|
|
100
|
-
font-size: @font-size-sm;
|
|
105
|
+
//font-size: @font-size-sm;
|
|
101
106
|
cursor: pointer;
|
|
102
|
-
color: @text-color-secondary;
|
|
107
|
+
//color: @text-color-secondary;
|
|
103
108
|
//color: color(~`colorPalette('@{text-color-secondary}', 3) `);
|
|
104
|
-
background-image: -webkit-gradient(linear, left top, left bottom, from(fade(@component-background, 0)), to(@component-background));
|
|
105
|
-
background-image: -webkit-linear-gradient(top, fade(@component-background, 0), @component-background);
|
|
106
|
-
background-image: linear-gradient(-180deg, fade(@component-background, 0), @component-background);
|
|
109
|
+
//background-image: -webkit-gradient(linear, left top, left bottom, from(fade(@component-background, 0)), to(@component-background));
|
|
110
|
+
//background-image: -webkit-linear-gradient(top, fade(@component-background, 0), @component-background);
|
|
111
|
+
//background-image: linear-gradient(-180deg, fade(@component-background, 0), @component-background);
|
|
107
112
|
&:hover {
|
|
108
|
-
color: @primary-color;
|
|
113
|
+
//color: @primary-color;
|
|
109
114
|
}
|
|
110
115
|
}
|
|
111
116
|
}
|
|
@@ -14,6 +14,7 @@ export interface FieldsItemProps extends FieldComponentProps {
|
|
|
14
14
|
fieldOptions?: any;
|
|
15
15
|
size?: 'large' | 'middle' | 'small' | string;
|
|
16
16
|
componentStyle?: React.CSSProperties;
|
|
17
|
+
[k: string]: any;
|
|
17
18
|
}
|
|
18
19
|
interface layoutProps {
|
|
19
20
|
labelCol?: any;
|
|
@@ -32,6 +33,9 @@ interface ItemGroupProps {
|
|
|
32
33
|
form?: any;
|
|
33
34
|
layout?: string;
|
|
34
35
|
doUpdateFormFields?: () => void;
|
|
36
|
+
className?: string;
|
|
37
|
+
columnCount?: 1 | 2 | 3 | 4;
|
|
38
|
+
[k: string]: any;
|
|
35
39
|
}
|
|
36
40
|
declare const RenderItemGroup: (props: ItemGroupProps) => any;
|
|
37
41
|
export default RenderItemGroup;
|
|
@@ -1,17 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import "antd/es/form/style";
|
|
8
|
-
import _Form from "antd/es/form";
|
|
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); }
|
|
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); }
|
|
9
7
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var
|
|
8
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
|
+
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."); }
|
|
10
|
+
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); }
|
|
11
|
+
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; }
|
|
12
|
+
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; } }
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
/* eslint-disable */
|
|
15
|
+
import React, { useCallback } from "react";
|
|
16
|
+
import { Row, Col, Tooltip, Form, Space } from "antd";
|
|
17
|
+
import { general } from "../../data";
|
|
18
|
+
import Field from "../FieldComponent";
|
|
19
|
+
import SpecIcon from "../../SpecIcon";
|
|
20
|
+
import useStyle from "./style";
|
|
21
|
+
import classNames from "classnames";
|
|
22
|
+
var FormItem = Form.Item;
|
|
23
|
+
|
|
24
|
+
// 单个控件配置参数
|
|
25
|
+
|
|
15
26
|
var RenderItemGroup = function RenderItemGroup(props) {
|
|
16
27
|
var itemGroup = props.itemGroup,
|
|
17
28
|
_props$size = props.size,
|
|
@@ -24,23 +35,51 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
24
35
|
form = props.form,
|
|
25
36
|
doUpdateFormFields = props.doUpdateFormFields,
|
|
26
37
|
_props$layout = props.layout,
|
|
27
|
-
layout = _props$layout === void 0 ? "horizontal" : _props$layout
|
|
28
|
-
|
|
29
|
-
|
|
38
|
+
layout = _props$layout === void 0 ? "horizontal" : _props$layout,
|
|
39
|
+
gutter = props.gutter,
|
|
40
|
+
columnCount = props.columnCount;
|
|
41
|
+
var componentName = 'spec-item-group';
|
|
42
|
+
var _useStyle = useStyle(componentName),
|
|
43
|
+
_useStyle2 = _slicedToArray(_useStyle, 2),
|
|
44
|
+
wrapSSR = _useStyle2[0],
|
|
45
|
+
hashId = _useStyle2[1];
|
|
46
|
+
// 栅格数量
|
|
47
|
+
// const columnNumber: number = useMemo(() => {
|
|
48
|
+
// // @ts-ignore
|
|
49
|
+
// return general.modalSize[size].columnNumber || 1
|
|
50
|
+
// }, [size, columnCount])
|
|
51
|
+
|
|
52
|
+
var setColSpan = function setColSpan(display, modalSize, columnCount) {
|
|
53
|
+
if (_typeof(display) === 'object' || display === 'block') {
|
|
54
|
+
// 栅格数量为:1
|
|
30
55
|
return 24;
|
|
31
56
|
}
|
|
32
|
-
if (
|
|
33
|
-
return 8
|
|
57
|
+
if (columnCount) {
|
|
58
|
+
return 24 / columnCount; // 2, 3, 4, 6, 8, 12
|
|
34
59
|
}
|
|
60
|
+
if (modalSize === 'xs' || modalSize === 'sm' || modalSize === 'md' || modalSize === 'lg' || modalSize === 'xlg' || modalSize === 'xxlg') {
|
|
61
|
+
return 24 / general.modalSize[modalSize].columnNumber;
|
|
62
|
+
}
|
|
63
|
+
// if (modalSize === 'xs' || modalSize === 'sm') {
|
|
64
|
+
// // 栅格数量为:1
|
|
65
|
+
// return 24
|
|
66
|
+
// }
|
|
67
|
+
// if (modalSize === 'lg' || modalSize === 'xlg' || modalSize === 'xxlg') {
|
|
68
|
+
// // 栅格数量为:3
|
|
69
|
+
// return 8
|
|
70
|
+
// }
|
|
71
|
+
// 栅格数量为:2
|
|
35
72
|
return 12;
|
|
36
73
|
};
|
|
37
74
|
var updateFormFields = function updateFormFields() {
|
|
38
75
|
// if (newVal) form && form.setFieldsValue({ ...newVal })
|
|
39
76
|
if (doUpdateFormFields) doUpdateFormFields(); // 用于触发更新表单实例赋值
|
|
40
77
|
};
|
|
78
|
+
|
|
41
79
|
// useEffect(() => {
|
|
42
80
|
// // updateFormFields()
|
|
43
81
|
// }, [form])
|
|
82
|
+
|
|
44
83
|
// 渲染隐藏指定控件
|
|
45
84
|
var itemIsHide = function itemIsHide(isHide, getFieldsValue, FormInstance) {
|
|
46
85
|
if (typeof isHide === 'function') {
|
|
@@ -48,6 +87,73 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
48
87
|
}
|
|
49
88
|
return isHide || false;
|
|
50
89
|
};
|
|
90
|
+
|
|
91
|
+
// 计算表单栅格数排版
|
|
92
|
+
// 优先级 displayLayout.side > displayLayout > general
|
|
93
|
+
// 优先级:若有displayLayout.block 则直接使用 general > displayLayout
|
|
94
|
+
// 还需要判断 layout为vertical还是horizontal
|
|
95
|
+
var calculateFormLayout = useCallback(function (itemData) {
|
|
96
|
+
var formLayout = {};
|
|
97
|
+
// 当布局为 'inline' 时,不配置栅格结构
|
|
98
|
+
if (layout === 'inline') {
|
|
99
|
+
formLayout = {};
|
|
100
|
+
} else if (layout === 'vertical') {
|
|
101
|
+
formLayout = {
|
|
102
|
+
labelCol: {
|
|
103
|
+
span: 24
|
|
104
|
+
},
|
|
105
|
+
wrapperCol: {
|
|
106
|
+
span: 24
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
} else {
|
|
110
|
+
var _general$modalSize;
|
|
111
|
+
// @ts-ignore
|
|
112
|
+
var sizeFormLayout = (_general$modalSize = general.modalSize) === null || _general$modalSize === void 0 ? void 0 : _general$modalSize[size].formLayout;
|
|
113
|
+
// @ts-ignore
|
|
114
|
+
var sizeFormBlockLayout = general.modalSize[size].formBlockLayout;
|
|
115
|
+
// 优先级 displayLayout.side > displayLayout > general
|
|
116
|
+
// 优先级:若有displayLayout.block 则直接使用 general > displayLayout
|
|
117
|
+
// 还需要判断 layout为vertical还是horizontal
|
|
118
|
+
if (columnCount) {
|
|
119
|
+
// 有配置栅格数 1,2,3,4
|
|
120
|
+
switch (columnCount) {
|
|
121
|
+
case 1:
|
|
122
|
+
sizeFormLayout = general.modalSize.sm.formLayout;
|
|
123
|
+
sizeFormBlockLayout = general.modalSize.sm.formBlockLayout;
|
|
124
|
+
break;
|
|
125
|
+
case 2:
|
|
126
|
+
sizeFormLayout = general.modalSize.md.formLayout;
|
|
127
|
+
sizeFormBlockLayout = general.modalSize.md.formBlockLayout;
|
|
128
|
+
break;
|
|
129
|
+
case 3:
|
|
130
|
+
sizeFormLayout = general.modalSize.lg.formLayout;
|
|
131
|
+
sizeFormBlockLayout = general.modalSize.lg.formBlockLayout;
|
|
132
|
+
break;
|
|
133
|
+
case 4:
|
|
134
|
+
sizeFormLayout = general.modalSize.xxlg.formLayout;
|
|
135
|
+
sizeFormBlockLayout = general.modalSize.xxlg.formBlockLayout;
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
formLayout = (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.side) || (displayLayout !== null && displayLayout !== void 0 && displayLayout.block ? sizeFormLayout : !displayLayout || JSON.stringify(displayLayout) === '{}' ? sizeFormLayout : displayLayout);
|
|
140
|
+
if (itemData.hasOwnProperty('display')) {
|
|
141
|
+
if ((itemData === null || itemData === void 0 ? void 0 : itemData.display) === 'block') {
|
|
142
|
+
// @ts-ignore
|
|
143
|
+
formLayout = (displayLayout === null || displayLayout === void 0 ? void 0 : displayLayout.block) || sizeFormBlockLayout;
|
|
144
|
+
} else if ((itemData === null || itemData === void 0 ? void 0 : itemData.display) === 'side') {
|
|
145
|
+
// 使用默认
|
|
146
|
+
// formLayout = displayLayout?.side || (displayLayout?.block ? general.modalSize[size].formLayout : displayLayout) || general.modalSize[size].formLayout
|
|
147
|
+
// formLayout = displayLayout?.side || (displayLayout?.block ? general.modalSize[size].formLayout : ((!displayLayout || JSON.stringify(displayLayout) === '{}') ? general.modalSize[size].formLayout : displayLayout))
|
|
148
|
+
} else {
|
|
149
|
+
// 对象格式
|
|
150
|
+
formLayout = itemData === null || itemData === void 0 ? void 0 : itemData.display; // 对象类型传值如: {labelCol: {span: 3},wrapperCol: {span: 8}} 优先级最高
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return formLayout;
|
|
155
|
+
}, [size, layout, columnCount]);
|
|
156
|
+
|
|
51
157
|
// 渲染表单控件
|
|
52
158
|
var renderFormField = function renderFormField(field) {
|
|
53
159
|
var componentStyle = field.componentStyle,
|
|
@@ -55,11 +161,11 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
55
161
|
preExtra = field.preExtra; // 当前可传参的配置值
|
|
56
162
|
// 带前缀或后缀控件渲染
|
|
57
163
|
if (preExtra || extra) {
|
|
58
|
-
return /*#__PURE__*/React.createElement(
|
|
164
|
+
return /*#__PURE__*/React.createElement(Space, null, preExtra ? preExtra(field, form) : '', /*#__PURE__*/React.createElement(FormItem, {
|
|
59
165
|
noStyle: true,
|
|
60
166
|
rules: field.rules || (field.fieldOptions ? field.fieldOptions.rules : []),
|
|
61
167
|
name: field.filedName
|
|
62
|
-
}, /*#__PURE__*/React.createElement(Field,
|
|
168
|
+
}, /*#__PURE__*/React.createElement(Field, _extends({}, field, {
|
|
63
169
|
onChange: function onChange(eOrValue) {
|
|
64
170
|
updateFormFields();
|
|
65
171
|
for (var _len = arguments.length, otherParams = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
@@ -69,10 +175,10 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
69
175
|
},
|
|
70
176
|
fieldStatus: field.fieldStatus || fieldStatus,
|
|
71
177
|
size: field.protoConfig && field.protoConfig.size || field.size || fieldSize,
|
|
72
|
-
style: componentStyle ||
|
|
178
|
+
style: componentStyle || _objectSpread({}, general.formItemStyle.wide)
|
|
73
179
|
}))), extra ? extra(field, form) : '');
|
|
74
180
|
} else {
|
|
75
|
-
return /*#__PURE__*/React.createElement(Field,
|
|
181
|
+
return /*#__PURE__*/React.createElement(Field, _extends({}, field, {
|
|
76
182
|
onChange: function onChange(eOrValue) {
|
|
77
183
|
// let updateValue = val
|
|
78
184
|
// if (field.type === 'input' || field.type === 'textarea' || field.type === 'radio' || field.type === 'password') {
|
|
@@ -88,7 +194,7 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
88
194
|
},
|
|
89
195
|
fieldStatus: field.fieldStatus || fieldStatus,
|
|
90
196
|
size: field.protoConfig && field.protoConfig.size || field.size || fieldSize,
|
|
91
|
-
style: componentStyle ||
|
|
197
|
+
style: componentStyle || _objectSpread({}, general.formItemStyle.wide)
|
|
92
198
|
}));
|
|
93
199
|
}
|
|
94
200
|
};
|
|
@@ -98,14 +204,14 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
98
204
|
type = item.type,
|
|
99
205
|
customRender = item.customRender,
|
|
100
206
|
filedName = item.filedName; // 当前可传参的配置值
|
|
101
|
-
if (layout === "horizontal") {
|
|
102
|
-
return /*#__PURE__*/React.createElement(
|
|
207
|
+
if (layout === "horizontal" || layout === "vertical") {
|
|
208
|
+
return /*#__PURE__*/React.createElement(Col, {
|
|
103
209
|
key: index,
|
|
104
|
-
span: item.colSpan || setColSpan(item.display, size)
|
|
105
|
-
}, /*#__PURE__*/React.createElement(FormItem,
|
|
210
|
+
span: item.colSpan || setColSpan(item.display, size, columnCount)
|
|
211
|
+
}, /*#__PURE__*/React.createElement(FormItem, _extends({
|
|
106
212
|
name: type !== 'custom' && filedName,
|
|
107
|
-
className: fieldStatus === 'viewOnly' ? 'form-item-view-only' : '',
|
|
108
|
-
label: description ? /*#__PURE__*/React.createElement("span", null, label, /*#__PURE__*/React.createElement(
|
|
213
|
+
className: classNames(fieldStatus === 'viewOnly' ? 'form-item-view-only' : '', 'spec-item-group-form-item'),
|
|
214
|
+
label: description ? /*#__PURE__*/React.createElement("span", null, label, /*#__PURE__*/React.createElement(Tooltip, {
|
|
109
215
|
title: description
|
|
110
216
|
}, /*#__PURE__*/React.createElement(SpecIcon, {
|
|
111
217
|
name: "info"
|
|
@@ -114,21 +220,22 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
114
220
|
required: item.rules && item.rules.filter(function (rItem) {
|
|
115
221
|
return rItem.required;
|
|
116
222
|
}).length > 0
|
|
117
|
-
}, formLayout, item.protoFormItem), type === 'custom' && customRender ? customRender(form,
|
|
223
|
+
}, formLayout, item.protoFormItem), type === 'custom' && customRender ? customRender(form, _objectSpread({}, item), fieldStatus) : renderFormField(_objectSpread({}, item))));
|
|
118
224
|
} else {
|
|
119
|
-
return /*#__PURE__*/React.createElement(FormItem,
|
|
225
|
+
return /*#__PURE__*/React.createElement(FormItem, _extends({
|
|
120
226
|
key: index,
|
|
121
227
|
name: type !== 'custom' && filedName,
|
|
122
|
-
className: fieldStatus === 'viewOnly' ? 'form-item-view-only' : '',
|
|
123
|
-
label: description ? /*#__PURE__*/React.createElement("span", null, label, /*#__PURE__*/React.createElement(
|
|
228
|
+
className: classNames(fieldStatus === 'viewOnly' ? 'form-item-view-only' : '', 'spec-item-group-form-item'),
|
|
229
|
+
label: description ? /*#__PURE__*/React.createElement("span", null, label, /*#__PURE__*/React.createElement(Tooltip, {
|
|
124
230
|
title: description
|
|
125
231
|
}, /*#__PURE__*/React.createElement(SpecIcon, {
|
|
126
232
|
name: "info"
|
|
127
233
|
}))) : label,
|
|
128
234
|
rules: item.rules || (item.fieldOptions ? item.fieldOptions.rules : [])
|
|
129
|
-
}, formLayout, item.protoFormItem), type === 'custom' && customRender ? customRender(form,
|
|
235
|
+
}, formLayout, item.protoFormItem), type === 'custom' && customRender ? customRender(form, _objectSpread({}, item), fieldStatus) : renderFormField(_objectSpread({}, item)));
|
|
130
236
|
}
|
|
131
237
|
};
|
|
238
|
+
|
|
132
239
|
// 渲染表单控件列表
|
|
133
240
|
var renderItemGroupNode = function renderItemGroupNode() {
|
|
134
241
|
return itemGroup.map(function (item, index) {
|
|
@@ -137,30 +244,34 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
137
244
|
type = item.type,
|
|
138
245
|
_item$display = item.display,
|
|
139
246
|
display = _item$display === void 0 ? 'side' : _item$display; // 当前可传参的配置值
|
|
140
|
-
|
|
247
|
+
|
|
248
|
+
var formLayout = calculateFormLayout(item);
|
|
141
249
|
// if (displayLayout) {
|
|
142
250
|
// // 如果未配置,则使用以下配置值
|
|
143
251
|
// formLayout = { ...displayLayout }
|
|
144
252
|
// }
|
|
145
253
|
// 优先级 displayLayout.side > displayLayout > general
|
|
146
254
|
// 优先级:若有displayLayout.block 则直接使用 general > displayLayout
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
//
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
255
|
+
// 还需要判断 layout为vertical还是horizontal
|
|
256
|
+
// @ts-ignore
|
|
257
|
+
// formLayout = displayLayout?.side || (displayLayout?.block ? general.modalSize[size].formLayout : ((!displayLayout || JSON.stringify(displayLayout) === '{}') ? general.modalSize[size].formLayout : displayLayout))
|
|
258
|
+
// if (item.hasOwnProperty('display')) {
|
|
259
|
+
// if (typeof display === 'string') {
|
|
260
|
+
// if (display === 'block') {
|
|
261
|
+
// // @ts-ignore
|
|
262
|
+
// formLayout = displayLayout?.block || general.modalSize[size].formBlockLayout
|
|
263
|
+
// } else {
|
|
264
|
+
// // 使用默认
|
|
265
|
+
// // formLayout = displayLayout?.side || (displayLayout?.block ? general.modalSize[size].formLayout : displayLayout) || general.modalSize[size].formLayout
|
|
266
|
+
// }
|
|
267
|
+
// } else {
|
|
268
|
+
// formLayout = item.display // 对象类型传值如: {labelCol: {span: 3},wrapperCol: {span: 8}} 优先级最高
|
|
269
|
+
// }
|
|
270
|
+
// }
|
|
271
|
+
// // 当布局为 'inline' 时,不配置栅格结构
|
|
272
|
+
// if (layout === 'inline') {
|
|
273
|
+
// formLayout = {}
|
|
274
|
+
// }
|
|
164
275
|
// title标题或html渲染
|
|
165
276
|
if (type === 'title' || type === 'html') {
|
|
166
277
|
return /*#__PURE__*/React.createElement(FormItem, {
|
|
@@ -168,12 +279,12 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
168
279
|
noStyle: true,
|
|
169
280
|
shouldUpdate: true
|
|
170
281
|
}, function (FormInstance) {
|
|
171
|
-
var
|
|
282
|
+
var _item$protoConfig;
|
|
172
283
|
// isHide 返回为true则隐藏当前控件
|
|
173
|
-
return !itemIsHide(isHide, FormInstance.getFieldValue(), FormInstance) ? /*#__PURE__*/React.createElement(
|
|
284
|
+
return !itemIsHide(isHide, FormInstance.getFieldValue(), FormInstance) ? /*#__PURE__*/React.createElement(Col, {
|
|
174
285
|
span: item.colSpan || 24
|
|
175
|
-
}, type === 'title' ? /*#__PURE__*/React.createElement("h3",
|
|
176
|
-
className: "modalPanelTitle ".concat((
|
|
286
|
+
}, type === 'title' ? /*#__PURE__*/React.createElement("h3", _extends({}, item.protoConfig, {
|
|
287
|
+
className: "modalPanelTitle ".concat((item === null || item === void 0 || (_item$protoConfig = item.protoConfig) === null || _item$protoConfig === void 0 ? void 0 : _item$protoConfig.className) || '')
|
|
177
288
|
}), label) : label) : /*#__PURE__*/React.createElement(React.Fragment, null, null);
|
|
178
289
|
});
|
|
179
290
|
}
|
|
@@ -191,16 +302,22 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
191
302
|
return renderColFormItem(item, index, formLayout);
|
|
192
303
|
});
|
|
193
304
|
};
|
|
305
|
+
var itemGroupCls = classNames(componentName, componentName + '-' + layout, props === null || props === void 0 ? void 0 : props.className, hashId);
|
|
306
|
+
return wrapSSR( /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
194
307
|
// itemGroup = Array 则按以下结构渲染
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
308
|
+
itemGroup && Array.isArray(itemGroup) ? layout === 'inline' ?
|
|
309
|
+
/*#__PURE__*/
|
|
310
|
+
// renderItemGroupNode() // 不带标签
|
|
311
|
+
React.createElement("div", {
|
|
312
|
+
className: itemGroupCls
|
|
313
|
+
}, renderItemGroupNode())
|
|
314
|
+
// 布局配置为horizontal或vertical
|
|
315
|
+
: /*#__PURE__*/React.createElement(Row, {
|
|
316
|
+
className: itemGroupCls,
|
|
317
|
+
gutter: layout === 'vertical' ? gutter || [20, 20] : gutter
|
|
318
|
+
}, renderItemGroupNode())
|
|
319
|
+
/* itemGroup = ReactNode则直接返回 */ : /*#__PURE__*/React.createElement("div", {
|
|
320
|
+
className: itemGroupCls
|
|
321
|
+
}, itemGroup)));
|
|
205
322
|
};
|
|
206
323
|
export default RenderItemGroup;
|
|
@@ -0,0 +1,40 @@
|
|
|
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 _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; }
|
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
|
+
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); }
|
|
5
|
+
import { createStyleHook } from "../../../theme/utils/genStyleHook";
|
|
6
|
+
var ItemGroupStyleFunc = function ItemGroupStyleFunc(prefix) {
|
|
7
|
+
var prepareComponentToken = function prepareComponentToken(token) {
|
|
8
|
+
return {
|
|
9
|
+
// fontWeight: 400,
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
return createStyleHook(prefix, function (token) {
|
|
13
|
+
var prefixCls = ".".concat(prefix);
|
|
14
|
+
return [_defineProperty({}, prefixCls, {
|
|
15
|
+
'&.spec-item-group-inline': {
|
|
16
|
+
display: 'flex',
|
|
17
|
+
flexWrap: 'wrap',
|
|
18
|
+
'.spec-item-group-form-item': {
|
|
19
|
+
marginBottom: token.marginMD
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
'&.spec-item-group-vertical': {
|
|
23
|
+
'.spec-item-group-form-item': {
|
|
24
|
+
marginBottom: 0
|
|
25
|
+
},
|
|
26
|
+
'.modalPanelTitle, .modal-grid-title': {
|
|
27
|
+
marginBottom: 0
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
'.modalPanelTitle, .modal-grid-title': {
|
|
31
|
+
margin: "0 0 ".concat(token.marginMD, "px 0"),
|
|
32
|
+
// paddingBottom: token.paddingXS,
|
|
33
|
+
borderBottom: "1px solid ".concat(token.colorBorder),
|
|
34
|
+
fontSize: token.fontSize
|
|
35
|
+
}
|
|
36
|
+
}), {}];
|
|
37
|
+
}, prepareComponentToken // 当前组件扩展的变量
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
export default ItemGroupStyleFunc;
|