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,40 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import "antd/es/cascader/style";
|
|
10
|
-
import _Cascader from "antd/es/cascader";
|
|
11
|
-
import "antd/es/button/style";
|
|
12
|
-
import _Button from "antd/es/button";
|
|
13
|
-
import "antd/es/time-picker/style";
|
|
14
|
-
import _TimePicker from "antd/es/time-picker";
|
|
15
|
-
import "antd/es/radio/style";
|
|
16
|
-
import _Radio from "antd/es/radio";
|
|
17
|
-
import "antd/es/checkbox/style";
|
|
18
|
-
import _Checkbox from "antd/es/checkbox";
|
|
19
|
-
import "antd/es/input-number/style";
|
|
20
|
-
import _InputNumber from "antd/es/input-number";
|
|
21
|
-
import "antd/es/date-picker/style";
|
|
22
|
-
import _DatePicker from "antd/es/date-picker";
|
|
23
|
-
import "antd/es/select/style";
|
|
24
|
-
import _Select from "antd/es/select";
|
|
25
|
-
import "antd/es/input/style";
|
|
26
|
-
import _Input from "antd/es/input";
|
|
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 _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 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; }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
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); }
|
|
8
|
+
/* eslint-disable */
|
|
27
9
|
import React from "react";
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
|
|
32
|
-
import
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
10
|
+
import { Input, Select, Checkbox, InputNumber, DatePicker, Radio, Button, Cascader, Switch, Slider, TimePicker, Mentions, Rate } from "antd";
|
|
11
|
+
import Uploader from "../Uploader";
|
|
12
|
+
import SpecIcon from "../../SpecIcon";
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
import RefactorTreeSelect from "./RefactorTreeSelect";
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
import { setSelectValue, setDatePickerValue, setTimePickerValue, setCascaderValue } from "./setReadonlyValues";
|
|
17
|
+
import TitleNode from "./TitleNode";
|
|
18
|
+
import ReUpload from "./ReUpload";
|
|
19
|
+
import UploaderViewer from "./UploaderViewer";
|
|
20
|
+
var TextArea = Input.TextArea,
|
|
21
|
+
Password = Input.Password;
|
|
22
|
+
var Option = Select.Option;
|
|
23
|
+
var RangePicker = DatePicker.RangePicker;
|
|
24
|
+
// 表单组件类型
|
|
38
25
|
var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
39
26
|
var type = props.type,
|
|
40
27
|
_onChange = props.onChange,
|
|
@@ -73,7 +60,7 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
73
60
|
if (selectOptionName && selectOptions) {
|
|
74
61
|
// 将传值的数据进行转换
|
|
75
62
|
selectOptions = selectOptions.map(function (item) {
|
|
76
|
-
return
|
|
63
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
77
64
|
value: item[selectOptionName.value || 'value'],
|
|
78
65
|
label: item[selectOptionName.label || 'label'],
|
|
79
66
|
disabled: item[selectOptionName.disabled || 'disabled'],
|
|
@@ -81,7 +68,7 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
81
68
|
});
|
|
82
69
|
});
|
|
83
70
|
}
|
|
84
|
-
var defaultProps =
|
|
71
|
+
var defaultProps = _objectSpread({
|
|
85
72
|
style: style,
|
|
86
73
|
onChange: _onChange,
|
|
87
74
|
value: value,
|
|
@@ -104,7 +91,7 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
104
91
|
var viewOnly = fieldStatus === 'viewOnly'; // 是否纯展示
|
|
105
92
|
switch (type) {
|
|
106
93
|
case 'input':
|
|
107
|
-
compContent = viewOnly ? value || '-' : /*#__PURE__*/React.createElement(
|
|
94
|
+
compContent = viewOnly ? value || '-' : /*#__PURE__*/React.createElement(Input, _extends({
|
|
108
95
|
placeholder: fieldStatus === 'disabled' || defaultProps.disabled ? '' : defaultProps.placeholder || placeholder || '请输入',
|
|
109
96
|
autoComplete: "off",
|
|
110
97
|
title: fieldStatus === 'disabled' || defaultProps.disabled ? value : null,
|
|
@@ -112,24 +99,24 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
112
99
|
}, defaultProps));
|
|
113
100
|
break;
|
|
114
101
|
case 'password':
|
|
115
|
-
compContent = viewOnly ? value ? "\u25CF\u25CF\u25CF\u25CF\u25CF\u25CF" : '-' : /*#__PURE__*/React.createElement(Password,
|
|
102
|
+
compContent = viewOnly ? value ? "\u25CF\u25CF\u25CF\u25CF\u25CF\u25CF" : '-' : /*#__PURE__*/React.createElement(Password, _extends({
|
|
116
103
|
autoComplete: "off",
|
|
117
104
|
placeholder: fieldStatus === 'disabled' || defaultProps.disabled ? '' : defaultProps.placeholder || placeholder || '请输入',
|
|
118
105
|
maxLength: defaultProps.maxLength || 50
|
|
119
106
|
}, defaultProps));
|
|
120
107
|
break;
|
|
121
108
|
case 'textarea':
|
|
122
|
-
compContent = viewOnly ? value || '-' : /*#__PURE__*/React.createElement(TextArea,
|
|
109
|
+
compContent = viewOnly ? value || '-' : /*#__PURE__*/React.createElement(TextArea, _extends({
|
|
123
110
|
placeholder: fieldStatus === 'disabled' || defaultProps.disabled ? '' : defaultProps.placeholder || placeholder || '请输入',
|
|
124
111
|
maxLength: defaultProps.maxLength || 500,
|
|
125
112
|
title: fieldStatus === 'disabled' || defaultProps.disabled ? value : null
|
|
126
113
|
}, defaultProps));
|
|
127
114
|
break;
|
|
128
115
|
case 'inputNumber':
|
|
129
|
-
compContent = viewOnly ? value || 0 : /*#__PURE__*/React.createElement(
|
|
116
|
+
compContent = viewOnly ? value || 0 : /*#__PURE__*/React.createElement(InputNumber, _extends({
|
|
130
117
|
placeholder: fieldStatus === 'disabled' || defaultProps.disabled ? '' : defaultProps.placeholder || placeholder || '请输入数字'
|
|
131
118
|
}, sortLimitRule, defaultProps, {
|
|
132
|
-
style:
|
|
119
|
+
style: _objectSpread({
|
|
133
120
|
width: '120px'
|
|
134
121
|
}, defaultProps.style)
|
|
135
122
|
}));
|
|
@@ -138,34 +125,36 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
138
125
|
// 重置返回完整字段值
|
|
139
126
|
var resetResultOption = function resetResultOption(Option) {
|
|
140
127
|
if (!Option) return Option;
|
|
141
|
-
if (Array.isArray(Option)) return selectOptions.filter(function (childOpt) {
|
|
128
|
+
if (Array.isArray(Option)) return (selectOptions || []).filter(function (childOpt) {
|
|
142
129
|
return Option.filter(function (optItem) {
|
|
143
130
|
return childOpt.value === optItem.value;
|
|
144
131
|
}).length > 0;
|
|
145
132
|
}); // 数据为数组
|
|
146
|
-
var extraParam = selectOptions.filter(function (childOpt) {
|
|
133
|
+
var extraParam = (selectOptions || []).filter(function (childOpt) {
|
|
147
134
|
return childOpt.value === Option.value;
|
|
148
135
|
})[0];
|
|
149
|
-
return
|
|
136
|
+
return _objectSpread(_objectSpread({}, Option), extraParam);
|
|
150
137
|
};
|
|
151
138
|
compContent = viewOnly ? setSelectValue(value, {
|
|
152
139
|
selectOptions: selectOptions,
|
|
153
140
|
selectOptionRender: selectOptionRender,
|
|
154
141
|
defaultProps: defaultProps,
|
|
155
142
|
type: type
|
|
156
|
-
}) : /*#__PURE__*/React.createElement(
|
|
143
|
+
}) : /*#__PURE__*/React.createElement(Select, _extends({
|
|
157
144
|
allowClear: true,
|
|
158
145
|
placeholder: fieldStatus === 'disabled' || defaultProps.disabled ? '' : defaultProps.placeholder || placeholder || "".concat(defaultProps.showSearch ? '请输入选择' : '请选择'),
|
|
159
146
|
filterOption: function filterOption(inputValue, option) {
|
|
160
147
|
return defaultProps.showSearch ? option.children.toLowerCase().indexOf(inputValue.toLowerCase()) >= 0 : false;
|
|
161
148
|
},
|
|
162
149
|
value: value
|
|
150
|
+
// fieldNames={fieldNames || selectOptionName}
|
|
151
|
+
// options={selectOptions}
|
|
163
152
|
}, defaultProps, {
|
|
164
153
|
// onChange返回参数:累加当前选中包括其他字段值的数据
|
|
165
154
|
onChange: function onChange(value, Option) {
|
|
166
|
-
return _onChange(value, resetResultOption(Option));
|
|
167
|
-
}
|
|
168
|
-
}),
|
|
155
|
+
return _onChange && _onChange(value, resetResultOption(Option));
|
|
156
|
+
} // 数据为对象
|
|
157
|
+
}), defaultProps !== null && defaultProps !== void 0 && defaultProps.fieldNames ? null : (selectOptions || []).map(function (val, index) {
|
|
169
158
|
return /*#__PURE__*/React.createElement(Option, {
|
|
170
159
|
value: val.value,
|
|
171
160
|
key: val.value || index,
|
|
@@ -175,7 +164,7 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
175
164
|
}));
|
|
176
165
|
break;
|
|
177
166
|
case 'tree-select':
|
|
178
|
-
compContent = /*#__PURE__*/React.createElement(RefactorTreeSelect,
|
|
167
|
+
compContent = /*#__PURE__*/React.createElement(RefactorTreeSelect, _extends({
|
|
179
168
|
treeData: treeData,
|
|
180
169
|
treeOptionName: treeOptionName,
|
|
181
170
|
allowClear: true,
|
|
@@ -194,20 +183,22 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
194
183
|
selectOptionRender: selectOptionRender,
|
|
195
184
|
defaultProps: defaultProps,
|
|
196
185
|
separator: separator
|
|
197
|
-
}) : /*#__PURE__*/React.createElement(
|
|
198
|
-
style:
|
|
186
|
+
}) : /*#__PURE__*/React.createElement(Checkbox.Group, _extends({}, defaultProps, {
|
|
187
|
+
style: _objectSpread({
|
|
199
188
|
width: 'auto'
|
|
200
189
|
}, defaultProps.style)
|
|
201
190
|
}), selectOptions && selectOptions.map(function (val, index) {
|
|
202
|
-
return /*#__PURE__*/React.createElement(
|
|
191
|
+
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
203
192
|
value: val.value,
|
|
204
|
-
key: val.value || index
|
|
193
|
+
key: val.value || index
|
|
205
194
|
// @ts-ignore
|
|
195
|
+
,
|
|
206
196
|
title: /*#__PURE__*/React.createElement(TitleNode, {
|
|
207
197
|
render: selectOptionRender,
|
|
208
198
|
data: val
|
|
209
|
-
})
|
|
199
|
+
})
|
|
210
200
|
// title={selectOptionRender ? selectOptionRender(val) : (val.title || val.label)}
|
|
201
|
+
,
|
|
211
202
|
disabled: val.disabled
|
|
212
203
|
}, selectOptionRender ? selectOptionRender(val) : val.label);
|
|
213
204
|
}));
|
|
@@ -218,33 +209,16 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
218
209
|
selectOptions: selectOptions,
|
|
219
210
|
selectOptionRender: selectOptionRender,
|
|
220
211
|
defaultProps: defaultProps
|
|
221
|
-
}) : /*#__PURE__*/React.createElement(
|
|
222
|
-
|
|
212
|
+
}) : /*#__PURE__*/React.createElement(Radio.Group, _extends({
|
|
213
|
+
options: (selectOptions || []).map(function (val) {
|
|
214
|
+
return _objectSpread(_objectSpread({}, val), {}, {
|
|
215
|
+
label: selectOptionRender ? selectOptionRender(val) : val.label
|
|
216
|
+
});
|
|
217
|
+
})
|
|
218
|
+
}, defaultProps, {
|
|
219
|
+
style: _objectSpread({
|
|
223
220
|
width: 'auto'
|
|
224
221
|
}, defaultProps.style)
|
|
225
|
-
}), selectOptions && selectOptions.map(function (val, index) {
|
|
226
|
-
if (defaultProps.optionType === 'button') {
|
|
227
|
-
return /*#__PURE__*/React.createElement(_Radio.Button, {
|
|
228
|
-
value: val.value,
|
|
229
|
-
key: val.value || index,
|
|
230
|
-
// @ts-ignore
|
|
231
|
-
title: /*#__PURE__*/React.createElement(TitleNode, {
|
|
232
|
-
render: selectOptionRender,
|
|
233
|
-
data: val
|
|
234
|
-
}),
|
|
235
|
-
disabled: val.disabled
|
|
236
|
-
}, selectOptionRender ? selectOptionRender(val) : val.label);
|
|
237
|
-
}
|
|
238
|
-
return /*#__PURE__*/React.createElement(_Radio, {
|
|
239
|
-
value: val.value,
|
|
240
|
-
key: val.value,
|
|
241
|
-
// @ts-ignore
|
|
242
|
-
title: /*#__PURE__*/React.createElement(TitleNode, {
|
|
243
|
-
render: selectOptionRender,
|
|
244
|
-
data: val
|
|
245
|
-
}),
|
|
246
|
-
disabled: val.disabled
|
|
247
|
-
}, selectOptionRender ? selectOptionRender(val) : val.label);
|
|
248
222
|
}));
|
|
249
223
|
break;
|
|
250
224
|
case 'datePicker': // 使用配置 picker设置其属于week,month,year
|
|
@@ -252,11 +226,11 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
252
226
|
compContent = viewOnly ? setDatePickerValue(value, {
|
|
253
227
|
type: type,
|
|
254
228
|
protoConfig: protoConfig
|
|
255
|
-
}) : /*#__PURE__*/React.createElement(
|
|
229
|
+
}) : /*#__PURE__*/React.createElement(DatePicker, _extends({
|
|
256
230
|
showTime: defaultProps.showTime || type === 'dateTimePicker',
|
|
257
231
|
placeholder: fieldStatus === 'disabled' || defaultProps.disabled ? '' : defaultProps.placeholder || placeholder || '请选择'
|
|
258
232
|
}, defaultProps, {
|
|
259
|
-
style:
|
|
233
|
+
style: _objectSpread({
|
|
260
234
|
'minWidth': 'auto'
|
|
261
235
|
}, defaultProps.style)
|
|
262
236
|
}));
|
|
@@ -267,10 +241,11 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
267
241
|
compContent = viewOnly ? setDatePickerValue(value, {
|
|
268
242
|
type: type,
|
|
269
243
|
protoConfig: protoConfig
|
|
270
|
-
}) : /*#__PURE__*/React.createElement(RangePicker,
|
|
271
|
-
showTime: defaultProps.showTime || type === 'rangeTimePicker'
|
|
244
|
+
}) : /*#__PURE__*/React.createElement(RangePicker, _extends({
|
|
245
|
+
showTime: defaultProps.showTime || type === 'rangeTimePicker',
|
|
246
|
+
allowEmpty: true
|
|
272
247
|
}, defaultProps, {
|
|
273
|
-
style:
|
|
248
|
+
style: _objectSpread({
|
|
274
249
|
width: type === 'rangeTimePicker' ? 'auto' : '100%'
|
|
275
250
|
}, defaultProps.style)
|
|
276
251
|
}));
|
|
@@ -280,10 +255,10 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
280
255
|
compContent = viewOnly ? setTimePickerValue(value, {
|
|
281
256
|
type: type,
|
|
282
257
|
protoConfig: protoConfig
|
|
283
|
-
}) : /*#__PURE__*/React.createElement(
|
|
284
|
-
style:
|
|
258
|
+
}) : /*#__PURE__*/React.createElement(TimePicker, _extends({}, defaultProps, {
|
|
259
|
+
style: _objectSpread(_objectSpread({
|
|
285
260
|
'minWidth': 'auto'
|
|
286
|
-
}, defaultProps.style), {
|
|
261
|
+
}, defaultProps.style), {}, {
|
|
287
262
|
width: 'auto'
|
|
288
263
|
})
|
|
289
264
|
}));
|
|
@@ -294,16 +269,18 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
294
269
|
compContent = viewOnly ? setTimePickerValue(value, {
|
|
295
270
|
type: type,
|
|
296
271
|
protoConfig: protoConfig
|
|
297
|
-
}) : /*#__PURE__*/React.createElement(
|
|
298
|
-
|
|
272
|
+
}) : /*#__PURE__*/React.createElement(TimePicker.RangePicker, _extends({
|
|
273
|
+
allowEmpty: true
|
|
274
|
+
}, defaultProps, {
|
|
275
|
+
style: _objectSpread(_objectSpread({
|
|
299
276
|
'minWidth': 'auto'
|
|
300
|
-
}, defaultProps.style), {
|
|
277
|
+
}, defaultProps.style), {}, {
|
|
301
278
|
width: 'auto'
|
|
302
279
|
})
|
|
303
280
|
}));
|
|
304
281
|
break;
|
|
305
282
|
case 'upload':
|
|
306
|
-
compContent = viewOnly && (!value || value.length === 0) ? '-' : /*#__PURE__*/React.createElement(ReUpload,
|
|
283
|
+
compContent = viewOnly && (!value || value.length === 0) ? '-' : /*#__PURE__*/React.createElement(ReUpload, _extends({}, defaultProps, {
|
|
307
284
|
viewOnly: viewOnly,
|
|
308
285
|
disabled: viewOnly || fieldStatus === 'disabled' || defaultProps.disabled
|
|
309
286
|
}), defaultProps.children ? defaultProps.children : defaultProps.fileList && defaultProps.fileList.length >= 1 || defaultProps.defaultFileList && defaultProps.defaultFileList.length >= 1 ? null : /*#__PURE__*/React.createElement(React.Fragment, null, defaultProps.listType === 'picture-card' ? /*#__PURE__*/React.createElement("div", {
|
|
@@ -312,12 +289,14 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
312
289
|
name: "plus"
|
|
313
290
|
}), /*#__PURE__*/React.createElement("div", {
|
|
314
291
|
className: "ant-upload-text"
|
|
315
|
-
}, "\u70B9\u51FB\u9009\u62E9")) : /*#__PURE__*/React.createElement(
|
|
292
|
+
}, "\u70B9\u51FB\u9009\u62E9")) : /*#__PURE__*/React.createElement(Button, null, /*#__PURE__*/React.createElement(SpecIcon, {
|
|
316
293
|
name: "upload"
|
|
317
294
|
}), " \u70B9\u51FB\u4E0A\u4F20")));
|
|
318
295
|
break;
|
|
319
296
|
case 'uploader':
|
|
320
|
-
compContent = viewOnly ?
|
|
297
|
+
compContent = viewOnly ? /*#__PURE__*/React.createElement(UploaderViewer, {
|
|
298
|
+
value: value
|
|
299
|
+
}) : /*#__PURE__*/React.createElement(Uploader, _extends({}, defaultProps, {
|
|
321
300
|
size: protoConfig === null || protoConfig === void 0 ? void 0 : protoConfig.size
|
|
322
301
|
}));
|
|
323
302
|
// compContent = <Uploader {...defaultProps}></Uploader>
|
|
@@ -327,7 +306,7 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
327
306
|
selectOptions: selectOptions,
|
|
328
307
|
selectOptionRender: selectOptionRender,
|
|
329
308
|
defaultProps: defaultProps
|
|
330
|
-
}) : /*#__PURE__*/React.createElement(
|
|
309
|
+
}) : /*#__PURE__*/React.createElement(Cascader, _extends({
|
|
331
310
|
options: selectOptions,
|
|
332
311
|
allowClear: true,
|
|
333
312
|
fieldNames: (defaultProps === null || defaultProps === void 0 ? void 0 : defaultProps.fieldNames) || selectOptionName,
|
|
@@ -335,32 +314,32 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
335
314
|
}, defaultProps));
|
|
336
315
|
break;
|
|
337
316
|
case 'switch':
|
|
338
|
-
compContent = /*#__PURE__*/React.createElement(
|
|
317
|
+
compContent = /*#__PURE__*/React.createElement(Switch, _extends({}, defaultProps, {
|
|
339
318
|
disabled: viewOnly || defaultProps.disabled,
|
|
340
319
|
checked: value,
|
|
341
|
-
style:
|
|
320
|
+
style: _objectSpread(_objectSpread({}, defaultProps.style), {}, {
|
|
342
321
|
width: 'auto'
|
|
343
322
|
})
|
|
344
323
|
}));
|
|
345
324
|
// compContent = viewOnly ? (String(value) === 'undefined' ? '-' : String(value)) : (<Switch {...defaultProps} checked={value} style={{ ...defaultProps.style, width: 'auto' }} />)
|
|
346
325
|
break;
|
|
347
326
|
case 'slider':
|
|
348
|
-
compContent = viewOnly ? value : /*#__PURE__*/React.createElement(
|
|
349
|
-
style:
|
|
327
|
+
compContent = viewOnly ? value : /*#__PURE__*/React.createElement(Slider, _extends({}, defaultProps, {
|
|
328
|
+
style: _objectSpread({}, defaultProps.style)
|
|
350
329
|
}));
|
|
351
330
|
break;
|
|
352
331
|
case 'mentions':
|
|
353
|
-
compContent = viewOnly ? value : /*#__PURE__*/React.createElement(
|
|
354
|
-
placeholder: "\u8BF7\u8F93\u5165 ".concat(defaultProps.prefix || '@', " \u9009\u62E9")
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
}
|
|
360
|
-
}));
|
|
332
|
+
compContent = viewOnly ? value : /*#__PURE__*/React.createElement(Mentions, _extends({
|
|
333
|
+
placeholder: "\u8BF7\u8F93\u5165 ".concat(defaultProps.prefix || '@', " \u9009\u62E9"),
|
|
334
|
+
options: (selectOptions || []).map(function (val) {
|
|
335
|
+
return _objectSpread(_objectSpread({}, val), {}, {
|
|
336
|
+
label: selectOptionRender ? selectOptionRender(val) : val.label
|
|
337
|
+
});
|
|
338
|
+
})
|
|
339
|
+
}, defaultProps));
|
|
361
340
|
break;
|
|
362
341
|
case 'rate':
|
|
363
|
-
compContent = /*#__PURE__*/React.createElement(
|
|
342
|
+
compContent = /*#__PURE__*/React.createElement(Rate, _extends({
|
|
364
343
|
disabled: viewOnly || defaultProps.disabled
|
|
365
344
|
}, defaultProps));
|
|
366
345
|
break;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import "antd/es/image/style";
|
|
2
|
-
import _Image from "antd/es/image";
|
|
3
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
2
|
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."); }
|
|
5
3
|
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); }
|
|
6
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
7
|
-
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)
|
|
4
|
+
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; }
|
|
5
|
+
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; } }
|
|
8
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
9
7
|
import React, { useEffect, useMemo, useState } from "react";
|
|
10
8
|
import moment from 'moment';
|
|
9
|
+
import { Image } from 'antd';
|
|
11
10
|
import { getBase64 } from "../Uploader/util";
|
|
11
|
+
import useUploaderStyle from "./style/UploaderStyle";
|
|
12
|
+
import classNames from 'classnames';
|
|
12
13
|
// 设置纯展示模式下的级联选择显示值
|
|
13
14
|
|
|
14
15
|
var setCascaderValue = function setCascaderValue(value, props) {
|
|
@@ -140,6 +141,11 @@ var setTimePickerValue = function setTimePickerValue(value, props) {
|
|
|
140
141
|
};
|
|
141
142
|
// 设置纯展示模式下上传控件显示值
|
|
142
143
|
var setUploaderValue = function setUploaderValue(value, props) {
|
|
144
|
+
var componentName = 'spec-uploader-viewonly';
|
|
145
|
+
var _useUploaderStyle = useUploaderStyle(componentName),
|
|
146
|
+
_useUploaderStyle2 = _slicedToArray(_useUploaderStyle, 2),
|
|
147
|
+
wrapSSR = _useUploaderStyle2[0],
|
|
148
|
+
hashId = _useUploaderStyle2[1];
|
|
143
149
|
if (!value && value !== 0) return '-'; // 无值情况 下
|
|
144
150
|
if (Array.isArray(value)) {
|
|
145
151
|
var _useState = useState(),
|
|
@@ -149,7 +155,7 @@ var setUploaderValue = function setUploaderValue(value, props) {
|
|
|
149
155
|
useEffect(function () {
|
|
150
156
|
var previewsUlr = [];
|
|
151
157
|
value.forEach(function (vItem) {
|
|
152
|
-
if (vItem
|
|
158
|
+
if (vItem !== null && vItem !== void 0 && vItem.downloadUrl) {
|
|
153
159
|
previewsUlr.push({
|
|
154
160
|
url: vItem.downloadUrl
|
|
155
161
|
});
|
|
@@ -157,7 +163,7 @@ var setUploaderValue = function setUploaderValue(value, props) {
|
|
|
157
163
|
return pItem;
|
|
158
164
|
}));
|
|
159
165
|
} else {
|
|
160
|
-
if (vItem
|
|
166
|
+
if (vItem !== null && vItem !== void 0 && vItem.originFileObj) getBase64(vItem.originFileObj).then(function (result) {
|
|
161
167
|
previewsUlr.push(result);
|
|
162
168
|
setPreviews(previewsUlr.filter(function (pItem) {
|
|
163
169
|
return pItem;
|
|
@@ -167,10 +173,10 @@ var setUploaderValue = function setUploaderValue(value, props) {
|
|
|
167
173
|
}
|
|
168
174
|
});
|
|
169
175
|
}, [value]);
|
|
170
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
171
|
-
className: 'spec-uploader-viewonly'
|
|
172
|
-
}, /*#__PURE__*/React.createElement(
|
|
173
|
-
return
|
|
176
|
+
return wrapSSR( /*#__PURE__*/React.createElement("div", {
|
|
177
|
+
className: classNames('spec-uploader-viewonly', hashId)
|
|
178
|
+
}, /*#__PURE__*/React.createElement(Image.PreviewGroup, null, previews && (previews === null || previews === void 0 ? void 0 : previews.map(function (item, index) {
|
|
179
|
+
return item !== null && item !== void 0 && item.url ? /*#__PURE__*/React.createElement(Image, {
|
|
174
180
|
key: index,
|
|
175
181
|
width: 100,
|
|
176
182
|
height: 100,
|
|
@@ -182,7 +188,7 @@ var setUploaderValue = function setUploaderValue(value, props) {
|
|
|
182
188
|
key: index,
|
|
183
189
|
className: "spec-uploader-viewonly-item"
|
|
184
190
|
}, "\u6682\u65E0\u56FE\u7247");
|
|
185
|
-
}))));
|
|
191
|
+
})))));
|
|
186
192
|
} else {
|
|
187
193
|
var _useState3 = useState(),
|
|
188
194
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
@@ -193,15 +199,15 @@ var setUploaderValue = function setUploaderValue(value, props) {
|
|
|
193
199
|
setPreview(result);
|
|
194
200
|
});
|
|
195
201
|
}, [value]);
|
|
196
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
197
|
-
className:
|
|
198
|
-
}, preview ? /*#__PURE__*/React.createElement(
|
|
202
|
+
return wrapSSR( /*#__PURE__*/React.createElement("div", {
|
|
203
|
+
className: classNames('spec-uploader-viewonly', hashId)
|
|
204
|
+
}, preview ? /*#__PURE__*/React.createElement(Image, {
|
|
199
205
|
style: {
|
|
200
206
|
objectFit: 'contain'
|
|
201
207
|
},
|
|
202
208
|
width: 100,
|
|
203
209
|
src: preview === null || preview === void 0 ? void 0 : preview.url
|
|
204
|
-
}) : '暂无图片');
|
|
210
|
+
}) : '暂无图片'));
|
|
205
211
|
}
|
|
206
212
|
};
|
|
207
213
|
export { setCascaderValue, setSelectValue, setDatePickerValue, setTimePickerValue, setUploaderValue };
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
import { TinyColor } from '@ctrl/tinycolor';
|
|
7
|
+
var RefactorTreeSelectStyleFunc = function RefactorTreeSelectStyleFunc(prefix) {
|
|
8
|
+
var prepareComponentToken = function prepareComponentToken(token) {
|
|
9
|
+
return {
|
|
10
|
+
// fontWeight: 400,
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
return createStyleHook(prefix, function (token) {
|
|
14
|
+
var prefixCls = ".".concat(prefix);
|
|
15
|
+
return [_defineProperty(_defineProperty({}, prefixCls, {
|
|
16
|
+
'&.refactor-disabled .refactor-tree-select-extra ': {
|
|
17
|
+
color: token.colorTextDisabled,
|
|
18
|
+
background: token.colorBgContainerDisabled
|
|
19
|
+
},
|
|
20
|
+
'.refactor-tree-select-extra': {
|
|
21
|
+
background: token.colorBgContainer,
|
|
22
|
+
height: token.controlHeight
|
|
23
|
+
}
|
|
24
|
+
}), '.tree-select-viewonly-list', {
|
|
25
|
+
border: "1px solid ".concat(new TinyColor(token.colorSplit).setAlpha(0.6).toRgbString()),
|
|
26
|
+
borderRadius: token.borderRadisuSM,
|
|
27
|
+
padding: "".concat(token.paddingXS, "px ").concat(token.paddingSM, "px"),
|
|
28
|
+
'& .toggle-icon': {
|
|
29
|
+
fontSize: token.fontSizeSM,
|
|
30
|
+
color: token.colorTextSecondary,
|
|
31
|
+
// backgroundImage: `-webkit-gradient(linear, left top, left bottom, from(fade(@component-background, 0)), to(@component-background))`,
|
|
32
|
+
// backgroundImage: `-webkit-linear-gradient(top, fade(@component-background, 0), @component-background)`,
|
|
33
|
+
backgroundImage: "linear-gradient(-180deg, ".concat(new TinyColor(token.colorBgContainer).setAlpha(0.).toRgbString(), ", ").concat(token.colorBgContainer, ")"),
|
|
34
|
+
'&:hover': {
|
|
35
|
+
color: token.colorPrimary
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
})];
|
|
39
|
+
}, prepareComponentToken // 当前组件扩展的变量
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
export default RefactorTreeSelectStyleFunc;
|
|
@@ -0,0 +1,25 @@
|
|
|
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 RefactorTreeSelectStyleFunc = function RefactorTreeSelectStyleFunc(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-uploader-viewonly-item': {
|
|
16
|
+
padding: token.paddingXS,
|
|
17
|
+
marginRight: token.marginXS,
|
|
18
|
+
border: "1px solid ".concat(token.colorBorder),
|
|
19
|
+
borderRadius: token.borderRadiusSM
|
|
20
|
+
}
|
|
21
|
+
})];
|
|
22
|
+
}, prepareComponentToken // 当前组件扩展的变量
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
export default RefactorTreeSelectStyleFunc;
|