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,217 +1,290 @@
|
|
|
1
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function
|
|
7
|
-
function
|
|
8
|
-
function
|
|
9
|
-
function
|
|
10
|
-
function
|
|
11
|
-
function
|
|
12
|
-
function
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
var FormItem =
|
|
25
|
-
var StandardFilter = /*#__PURE__*/function (
|
|
26
|
-
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
});
|
|
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
+
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
|
+
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++) arr2[i] = arr[i]; return arr2; }
|
|
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); } 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
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
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; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
13
|
+
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); }
|
|
14
|
+
// @ts-nocheck
|
|
15
|
+
import React, { useContext, useEffect, useRef, useState, useMemo, useCallback, useImperativeHandle } from 'react';
|
|
16
|
+
import { Form, Button } from 'antd';
|
|
17
|
+
import RenderItemGroup from "../FormComp/RenderItemGroup";
|
|
18
|
+
import { UtilValueFormat } from "../utils";
|
|
19
|
+
import ButtonGroup from "../ButtonGroup/";
|
|
20
|
+
import { general } from "../data/";
|
|
21
|
+
import "./style/index.less";
|
|
22
|
+
import { FanContext } from "../ConfigContext";
|
|
23
|
+
import useStyle from "./style/FilterStyle";
|
|
24
|
+
var FormItem = Form.Item;
|
|
25
|
+
var StandardFilter = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
26
|
+
var InitFanContext = useContext(FanContext);
|
|
27
|
+
var providerConfig = InitFanContext['StandardFilter'] || {}; // 使用上下文(全局配置)设置扩展的配置项
|
|
28
|
+
var _providerConfig$props = _objectSpread(_objectSpread({}, providerConfig), props),
|
|
29
|
+
_providerConfig$props2 = _providerConfig$props.formItemGroup,
|
|
30
|
+
formItemGroup = _providerConfig$props2 === void 0 ? [] : _providerConfig$props2,
|
|
31
|
+
itemGroupConfig = _providerConfig$props.itemGroupConfig,
|
|
32
|
+
initialValues = _providerConfig$props.initialValues,
|
|
33
|
+
getFormFields = _providerConfig$props.getFormFields,
|
|
34
|
+
onFilterSearch = _providerConfig$props.onFilterSearch,
|
|
35
|
+
onFilterReset = _providerConfig$props.onFilterReset,
|
|
36
|
+
className = _providerConfig$props.className,
|
|
37
|
+
style = _providerConfig$props.style,
|
|
38
|
+
_providerConfig$props3 = _providerConfig$props.buttonGroup,
|
|
39
|
+
buttonGroup = _providerConfig$props3 === void 0 ? [] : _providerConfig$props3,
|
|
40
|
+
buttonGroupConfig = _providerConfig$props.buttonGroupConfig,
|
|
41
|
+
min = _providerConfig$props.min,
|
|
42
|
+
codes = _providerConfig$props.codes,
|
|
43
|
+
permissionCodes = _providerConfig$props.permissionCodes,
|
|
44
|
+
confirmText = _providerConfig$props.confirmText,
|
|
45
|
+
cancelText = _providerConfig$props.cancelText,
|
|
46
|
+
_providerConfig$props4 = _providerConfig$props.confirmButtonProps,
|
|
47
|
+
confirmButtonProps = _providerConfig$props4 === void 0 ? {} : _providerConfig$props4,
|
|
48
|
+
_providerConfig$props5 = _providerConfig$props.cancelButtonProps,
|
|
49
|
+
cancelButtonProps = _providerConfig$props5 === void 0 ? {} : _providerConfig$props5,
|
|
50
|
+
filterButtonColSpan = _providerConfig$props.filterButtonColSpan,
|
|
51
|
+
filterButtonConfig = _providerConfig$props.filterButtonConfig,
|
|
52
|
+
formLayout = _providerConfig$props.formLayout,
|
|
53
|
+
_providerConfig$props6 = _providerConfig$props.gridLayout,
|
|
54
|
+
gridLayout = _providerConfig$props6 === void 0 ? 'inline' : _providerConfig$props6,
|
|
55
|
+
filterFormStyle = _providerConfig$props.filterFormStyle,
|
|
56
|
+
filterBtnsStyle = _providerConfig$props.filterBtnsStyle,
|
|
57
|
+
_providerConfig$props7 = _providerConfig$props.colon,
|
|
58
|
+
colon = _providerConfig$props7 === void 0 ? true : _providerConfig$props7,
|
|
59
|
+
dateFormatter = _providerConfig$props.dateFormatter;
|
|
60
|
+
var filterFormRef = useRef();
|
|
61
|
+
// ref 的转发
|
|
62
|
+
useImperativeHandle(ref, function () {
|
|
63
|
+
return filterFormRef === null || filterFormRef === void 0 ? void 0 : filterFormRef.current;
|
|
64
|
+
});
|
|
65
|
+
var _useState = useState([]),
|
|
66
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
67
|
+
reFormItemGroup = _useState2[0],
|
|
68
|
+
setReFormItemGroup = _useState2[1];
|
|
69
|
+
var _useState3 = useState(0),
|
|
70
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
71
|
+
isHideCount = _useState4[0],
|
|
72
|
+
setIsHideCount = _useState4[1]; // 表单隐藏项数量值
|
|
74
73
|
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
var componentName = 'spec-standard-filter';
|
|
75
|
+
var _useStyle = useStyle(componentName),
|
|
76
|
+
_useStyle2 = _slicedToArray(_useStyle, 2),
|
|
77
|
+
wrapSSR = _useStyle2[0],
|
|
78
|
+
hashId = _useStyle2[1];
|
|
79
|
+
var filterFormLayout = useMemo(function () {
|
|
80
|
+
return formLayout || 'inline';
|
|
81
|
+
}, [formLayout]);
|
|
82
|
+
// 配置筛选按钮(确认与取消)
|
|
83
|
+
var filterActionButtons = useMemo(function () {
|
|
84
|
+
// 当前栅栅数量
|
|
85
|
+
var itemGroupSize = (itemGroupConfig === null || itemGroupConfig === void 0 ? void 0 : itemGroupConfig.size) || (filterFormLayout === 'horizontal' ? 'xxlg' : 'md');
|
|
86
|
+
if (itemGroupConfig !== null && itemGroupConfig !== void 0 && itemGroupConfig.columnCount) {
|
|
87
|
+
// 有配置栅格数 1,2,3,4
|
|
88
|
+
switch (itemGroupConfig === null || itemGroupConfig === void 0 ? void 0 : itemGroupConfig.columnCount) {
|
|
89
|
+
case 1:
|
|
90
|
+
itemGroupSize = 'sm';
|
|
91
|
+
break;
|
|
92
|
+
case 2:
|
|
93
|
+
itemGroupSize = 'md';
|
|
94
|
+
break;
|
|
95
|
+
case 3:
|
|
96
|
+
itemGroupSize = 'lg';
|
|
97
|
+
break;
|
|
98
|
+
case 4:
|
|
99
|
+
itemGroupSize = 'xxlg';
|
|
100
|
+
break;
|
|
77
101
|
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
if (Array.isArray(val)) {
|
|
118
|
-
updateValue = [...val]
|
|
119
|
-
}
|
|
120
|
-
this.updateFormFields({ [item.filedName]: updateValue })
|
|
121
|
-
if (item.onChange) item.onChange(val, this.filterFormRef, ...otherParams)
|
|
122
|
-
}}
|
|
123
|
-
style={{ width: item.type === 'checkbox' || item.type === 'radio' ? 'auto' : general.formItemStyle.xsm.width, ...componentStyle }}/>
|
|
124
|
-
}
|
|
125
|
-
</FormItem>
|
|
126
|
-
)
|
|
127
|
-
})
|
|
128
|
-
}
|
|
129
|
-
</>*/
|
|
102
|
+
}
|
|
103
|
+
// 计算扣除栅格列数是否还有多余的项,用来判断筛选按钮的版式(初始化的时候,可能会受默认值内配置的isHide影响导致计算错误;或自定义表单控件组栅格影响)
|
|
104
|
+
var calculateTimes = (formItemGroup.length - isHideCount) % general.modalSize[itemGroupSize].columnNumber;
|
|
105
|
+
// xs:1列 sm:1列 【span:24】
|
|
106
|
+
// md:2列 【span:12】
|
|
107
|
+
// lg:3列 xlg:3列 【span:8】
|
|
108
|
+
// xxlg:4列 【span:6】
|
|
109
|
+
if (!onFilterSearch && !onFilterReset) return [];
|
|
110
|
+
return [_objectSpread(_objectSpread({
|
|
111
|
+
label: '',
|
|
112
|
+
type: 'custom',
|
|
113
|
+
// display: 'block',
|
|
114
|
+
display: {
|
|
115
|
+
wrapperCol: {
|
|
116
|
+
// 占用的格子数按对应size配置的formItem(md下额外再新增1)
|
|
117
|
+
span: general.modalSize[itemGroupSize].formLayout.labelCol.span + general.modalSize[itemGroupSize].formLayout.wrapperCol.span + (itemGroupSize === 'md' ? 1 : 0)
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
protoFormItem: {
|
|
121
|
+
style: {
|
|
122
|
+
textAlign: filterFormLayout === 'horizontal' ? 'right' : 'left'
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
colSpan: filterButtonColSpan || 24 - calculateTimes * (24 / general.modalSize[itemGroupSize].columnNumber)
|
|
126
|
+
}, filterButtonConfig), {}, {
|
|
127
|
+
customRender: function customRender() {
|
|
128
|
+
return /*#__PURE__*/React.createElement(FormItem, {
|
|
129
|
+
noStyle: true
|
|
130
|
+
}, onFilterSearch && /*#__PURE__*/React.createElement(Button, _extends({
|
|
131
|
+
type: "primary",
|
|
132
|
+
htmlType: "submit"
|
|
133
|
+
}, confirmButtonProps), confirmText || '查询'), onFilterReset && /*#__PURE__*/React.createElement(Button, _extends({
|
|
134
|
+
type: "primary",
|
|
135
|
+
style: {
|
|
136
|
+
marginLeft: 8
|
|
137
|
+
},
|
|
138
|
+
onClick: handleReset,
|
|
139
|
+
ghost: true
|
|
140
|
+
}, cancelButtonProps), cancelText || '重置'));
|
|
130
141
|
}
|
|
142
|
+
})];
|
|
143
|
+
}, [confirmText, cancelText, filterFormLayout, reFormItemGroup, onFilterSearch, onFilterReset, itemGroupConfig, filterFormRef, isHideCount]);
|
|
131
144
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
value: function componentDidMount() {
|
|
143
|
-
var initialValues = this.props.initialValues;
|
|
144
|
-
this.updateFormFields(initialValues, true);
|
|
145
|
+
// 更新表单控件值,用于外部获取当前表单实例(force是否强制清空表单)
|
|
146
|
+
var updateFormFields = function updateFormFields(newVal, force) {
|
|
147
|
+
var resetValues = {};
|
|
148
|
+
if (force) {
|
|
149
|
+
// this.filterFormRef.current.resetFields()
|
|
150
|
+
// 先清空 再赋值
|
|
151
|
+
resetValues = filterFormRef.current.getFieldsValue();
|
|
152
|
+
Object.keys(resetValues).forEach(function (item) {
|
|
153
|
+
resetValues[item] = undefined;
|
|
154
|
+
});
|
|
145
155
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
156
|
+
/* const dateFieldTypes = ['datePicker', 'dateTimePicker', 'rangePicker', 'rangeTimePicker', 'timePicker', 'timePickerRange']
|
|
157
|
+
const filterDateFields = formItemGroup.filter(fItem => dateFieldTypes.includes(fItem.type))
|
|
158
|
+
// 如果配置了dateFormatter='string',则将默认对其他进行格式转换
|
|
159
|
+
if (dateFormatter === 'string') {
|
|
160
|
+
// 需要将字符串转换成日期格式
|
|
161
|
+
filterDateFields.forEach(dItem => {
|
|
162
|
+
if (newVal[dItem.filedName]) {
|
|
163
|
+
if (typeof newVal[dItem.filedName] === 'string') {
|
|
164
|
+
console.log('将字符串转换成dayjs')
|
|
165
|
+
newVal[dItem.filedName] = dayjs(newVal[dItem.filedName])
|
|
166
|
+
} else if (Array.isArray(newVal[dItem.filedName])) {
|
|
167
|
+
console.log('将数组转换成dayjs数组')
|
|
168
|
+
newVal[dItem.filedName] = newVal[dItem.filedName].map(valItem => {
|
|
169
|
+
return typeof valItem === 'string' ? dayjs(valItem) : valItem
|
|
170
|
+
})
|
|
171
|
+
} else {
|
|
172
|
+
// console.log('其他情况,当它是日期格式,则不进行转换')
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
})
|
|
176
|
+
} */
|
|
177
|
+
filterFormRef.current.setFieldsValue(_objectSpread(_objectSpread({}, resetValues), newVal || {})); // 直接清空表单的赋值
|
|
178
|
+
updateCalculate(filterFormRef.current.getFieldsValue());
|
|
179
|
+
if (getFormFields) getFormFields(filterFormRef.current.getFieldsValue(), filterFormRef);
|
|
180
|
+
};
|
|
181
|
+
// 强制更新表单值,用于赋初始化实例值
|
|
182
|
+
var forceUpdateForm = useCallback(function () {
|
|
183
|
+
var formValues = filterFormRef.current.getFieldsValue();
|
|
184
|
+
// if (Object.prototype.hasOwnProperty.call(formValues, false)) {
|
|
185
|
+
// delete formValues.false // TODO 自定义结构会莫名的出来一个false字段
|
|
186
|
+
// }
|
|
187
|
+
updateCalculate(formValues); // 更新当前表单数量,排除被隐藏的值
|
|
188
|
+
if (getFormFields) getFormFields(filterFormRef.current.getFieldsValue(), filterFormRef);
|
|
189
|
+
}, [dateFormatter, formItemGroup]);
|
|
190
|
+
// 计算表单隐藏项
|
|
191
|
+
var updateCalculate = useCallback(function (formValues) {
|
|
192
|
+
setIsHideCount(reFormItemGroup.filter(function (item) {
|
|
193
|
+
return item.hasOwnProperty('isHide') ? item.isHide(_objectSpread({}, formValues), filterFormRef) : false;
|
|
194
|
+
}).length);
|
|
195
|
+
}, [reFormItemGroup, filterFormRef]);
|
|
196
|
+
var handleSearch = function handleSearch(values) {
|
|
197
|
+
if (Object.prototype.hasOwnProperty.call(values, false)) {
|
|
198
|
+
delete values.false; // TODO 自定义结构会莫名的出来一个false字段
|
|
153
199
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
200
|
+
var resultValues = dateFormatter === 'string' ? UtilValueFormat(values, formItemGroup) : values;
|
|
201
|
+
console.log('格式化前数据', values);
|
|
202
|
+
console.log('格式化后数据', resultValues);
|
|
203
|
+
if (onFilterSearch) {
|
|
204
|
+
onFilterSearch(_objectSpread({}, resultValues));
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
var handleReset = function handleReset() {
|
|
208
|
+
var _filterFormRef$curren;
|
|
209
|
+
// 使用此方法,表单校验无法清空掉
|
|
210
|
+
// const resetValues = this.filterFormRef.current.getFieldsValue()
|
|
211
|
+
// Object.keys(resetValues).forEach((item) => {
|
|
212
|
+
// resetValues[item] = undefined
|
|
213
|
+
// })
|
|
214
|
+
// this.filterFormRef.current.setFieldsValue({ ...resetValues }) // 直接清空表单的赋值
|
|
215
|
+
filterFormRef.current.resetFields();
|
|
216
|
+
setReFormItemGroup(formItemGroup); // 重新渲染列表
|
|
217
|
+
updateCalculate(filterFormRef === null || filterFormRef === void 0 || (_filterFormRef$curren = filterFormRef.current) === null || _filterFormRef$curren === void 0 ? void 0 : _filterFormRef$curren.getFieldsValue());
|
|
218
|
+
if (onFilterReset) {
|
|
219
|
+
var _filterFormRef$curren2;
|
|
220
|
+
onFilterReset(filterFormRef === null || filterFormRef === void 0 || (_filterFormRef$curren2 = filterFormRef.current) === null || _filterFormRef$curren2 === void 0 ? void 0 : _filterFormRef$curren2.getFieldsValue());
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
useEffect(function () {
|
|
224
|
+
if (initialValues && JSON.stringify(initialValues) !== '{}') {
|
|
225
|
+
updateFormFields(initialValues, true);
|
|
226
|
+
}
|
|
227
|
+
}, [initialValues]);
|
|
228
|
+
useEffect(function () {
|
|
229
|
+
setReFormItemGroup(formItemGroup);
|
|
230
|
+
}, [formItemGroup]);
|
|
231
|
+
// / 表单列表组 formItemGroup 类型为数组或者React.Node
|
|
232
|
+
var renderFormItemGroup = function renderFormItemGroup() {
|
|
233
|
+
if (Array.isArray(reFormItemGroup)) {
|
|
234
|
+
// 数组则默认加上"确认与取消"按钮
|
|
235
|
+
return /*#__PURE__*/React.createElement(RenderItemGroup, _extends({
|
|
236
|
+
itemGroup: reFormItemGroup.concat(filterActionButtons),
|
|
237
|
+
size: filterFormLayout === 'horizontal' ? 'xxlg' : 'md' // size决定栅格排列数量(4列排版)
|
|
238
|
+
,
|
|
239
|
+
layout: filterFormLayout,
|
|
240
|
+
form: filterFormRef
|
|
241
|
+
// displayLayout={{labelCol: { span: 8 }, wrapperCol: { span: 16 },}}
|
|
242
|
+
,
|
|
243
|
+
doUpdateFormFields: function doUpdateFormFields() {
|
|
244
|
+
return forceUpdateForm();
|
|
184
245
|
}
|
|
185
|
-
},
|
|
186
|
-
type: "primary",
|
|
187
|
-
htmlType: "submit"
|
|
188
|
-
}, " ", confirmText || '查询'), onFilterReset && /*#__PURE__*/React.createElement(_Button, {
|
|
189
|
-
type: "primary",
|
|
190
|
-
style: {
|
|
191
|
-
marginLeft: 8
|
|
192
|
-
},
|
|
193
|
-
onClick: this.handleReset,
|
|
194
|
-
ghost: true
|
|
195
|
-
}, cancelText || '重置'))) : null), buttonGroup && buttonGroup.length > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
196
|
-
className: "filter-btns"
|
|
197
|
-
}, /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
198
|
-
options: buttonGroup,
|
|
199
|
-
min: min,
|
|
200
|
-
codes: codes,
|
|
201
|
-
permissionCodes: permissionCodes,
|
|
202
|
-
dropdownConfig: buttonGroupConfig
|
|
203
|
-
})) : null));
|
|
246
|
+
}, itemGroupConfig));
|
|
204
247
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
248
|
+
return reFormItemGroup;
|
|
249
|
+
};
|
|
250
|
+
/**
|
|
251
|
+
* 生成guid
|
|
252
|
+
*/
|
|
253
|
+
var guid = function guid() {
|
|
254
|
+
function S4() {
|
|
255
|
+
return ((1 + Math.random()) * 0x10000 | 0).toString(16).substring(1);
|
|
213
256
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
257
|
+
return "".concat(S4(), "-").concat(S4());
|
|
258
|
+
};
|
|
259
|
+
var renderButtonGroup = function renderButtonGroup() {
|
|
260
|
+
return buttonGroup && buttonGroup.length > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
261
|
+
className: "filter-btns ",
|
|
262
|
+
style: filterBtnsStyle
|
|
263
|
+
}, /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
264
|
+
options: buttonGroup,
|
|
265
|
+
min: min,
|
|
266
|
+
codes: codes,
|
|
267
|
+
permissionCodes: permissionCodes,
|
|
268
|
+
dropdownConfig: buttonGroupConfig
|
|
269
|
+
})) : null;
|
|
270
|
+
};
|
|
271
|
+
return wrapSSR( /*#__PURE__*/React.createElement(Form, {
|
|
272
|
+
name: 'standard-filter-form-' + guid(),
|
|
273
|
+
ref: filterFormRef,
|
|
274
|
+
layout: filterFormLayout,
|
|
275
|
+
onFinish: handleSearch
|
|
276
|
+
// className={classNames(componentName, hashId, props?.className)}
|
|
277
|
+
,
|
|
278
|
+
className: "standard-filter ".concat(componentName, " ").concat(className || '', " ").concat(hashId),
|
|
279
|
+
style: style,
|
|
280
|
+
colon: colon
|
|
281
|
+
// {...providerConfig} // 直接传这里面的话,会影响layout渲染
|
|
282
|
+
// initialValues={{ ...initialValues }}
|
|
283
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
284
|
+
className: "filter-grid filter-grid-".concat(gridLayout),
|
|
285
|
+
style: filterFormStyle
|
|
286
|
+
}, reFormItemGroup.length === 0 ? null : /*#__PURE__*/React.createElement("div", {
|
|
287
|
+
className: "filter-form filter-form-".concat(formLayout)
|
|
288
|
+
}, reFormItemGroup ? /*#__PURE__*/React.createElement(React.Fragment, null, renderFormItemGroup()) : null), renderButtonGroup())));
|
|
289
|
+
});
|
|
217
290
|
export default StandardFilter;
|
|
@@ -0,0 +1,50 @@
|
|
|
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 StandardFilterStyleFunc = function StandardFilterStyleFunc(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
|
+
'.filter-grid': {
|
|
16
|
+
// backgroundColor: token.colorBgBase,
|
|
17
|
+
'.filter-form': {
|
|
18
|
+
'.ant-form-item-control, ant-form-item-label': {
|
|
19
|
+
lineHeight: token.controlHeight + 'px' // @input-height-base;
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
'.filter-form .ant-form-item': {
|
|
23
|
+
marginRight: token.paddingMD,
|
|
24
|
+
marginBottom: token.paddingMD
|
|
25
|
+
},
|
|
26
|
+
'.filter-btns ': {
|
|
27
|
+
backgroundColor: token.colorBgBase
|
|
28
|
+
},
|
|
29
|
+
'.filter-btns .ant-btn': {
|
|
30
|
+
marginLeft: token.paddingXS,
|
|
31
|
+
marginTop: token.paddingXS,
|
|
32
|
+
// marginBottom: token.paddingMD,
|
|
33
|
+
marginBottom: token.paddingXS
|
|
34
|
+
},
|
|
35
|
+
'.ant-select-single:not(.ant-select-customize-input) .ant-select-selector': {
|
|
36
|
+
lineHeight: token.controlHeight - 2
|
|
37
|
+
},
|
|
38
|
+
'&.filter-grid-horizontal': {
|
|
39
|
+
'.filter-btn': {
|
|
40
|
+
'.spec-button-group': {
|
|
41
|
+
paddingTop: token.paddingMD
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
})];
|
|
47
|
+
}, prepareComponentToken // 当前组件扩展的变量
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
export default StandardFilterStyleFunc;
|