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
package/lib/ButtonGroup/index.js
CHANGED
|
@@ -5,24 +5,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
require("antd/es/popconfirm/style");
|
|
9
|
-
var _popconfirm = _interopRequireDefault(require("antd/es/popconfirm"));
|
|
10
|
-
require("antd/es/button/style");
|
|
11
|
-
var _button = _interopRequireDefault(require("antd/es/button"));
|
|
12
|
-
require("antd/es/dropdown/style");
|
|
13
|
-
var _dropdown = _interopRequireDefault(require("antd/es/dropdown"));
|
|
14
|
-
var _tslib = require("tslib");
|
|
15
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
16
|
-
var
|
|
17
|
-
var
|
|
9
|
+
var _components = require("../components");
|
|
10
|
+
var _SpecIcon = _interopRequireDefault(require("../SpecIcon"));
|
|
18
11
|
var _PopConfirmTitle = _interopRequireDefault(require("./PopConfirmTitle"));
|
|
19
|
-
var
|
|
12
|
+
var _antd = require("antd");
|
|
13
|
+
var _index = require("../data/index");
|
|
20
14
|
var _icons = require("@ant-design/icons");
|
|
21
15
|
var _filterPermission = require("../utils/filterPermission");
|
|
22
|
-
require("./
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
17
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
18
|
+
var _excluded = ["code", "fn", "exName", "name", "children", "icon"],
|
|
19
|
+
_excluded2 = ["exName", "name", "type", "icon", "ghost", "danger", "disabled", "loading", "fn", "code", "rowParams"],
|
|
20
|
+
_excluded3 = ["code", "fn", "exName", "name", "children", "icon", "confirmText", "confirmConfig"];
|
|
25
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
23
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
24
|
+
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); }
|
|
25
|
+
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; }
|
|
26
|
+
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; }
|
|
27
|
+
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; }
|
|
28
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
29
|
+
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); }
|
|
30
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
31
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
26
32
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
27
33
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
28
34
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
@@ -30,9 +36,11 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
30
36
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
37
|
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."); }
|
|
32
38
|
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); }
|
|
33
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
34
|
-
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)
|
|
39
|
+
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; }
|
|
40
|
+
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; } }
|
|
35
41
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
42
|
+
// 参数API
|
|
43
|
+
|
|
36
44
|
var ButtonGroup = function ButtonGroup(props) {
|
|
37
45
|
var _props$type = props.type,
|
|
38
46
|
type = _props$type === void 0 ? 'button' : _props$type,
|
|
@@ -43,15 +51,17 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
43
51
|
rowIndex: undefined
|
|
44
52
|
} : _props$rowParams,
|
|
45
53
|
_props$codes = props.codes,
|
|
46
|
-
codes = _props$codes === void 0 ?
|
|
54
|
+
codes = _props$codes === void 0 ? _index.funcCode.btnFuncCodes : _props$codes,
|
|
47
55
|
permissionCodes = props.permissionCodes,
|
|
48
56
|
_props$dropdownConfig = props.dropdownConfig,
|
|
49
|
-
dropdownConfig = _props$dropdownConfig === void 0 ? {} : _props$dropdownConfig
|
|
57
|
+
dropdownConfig = _props$dropdownConfig === void 0 ? {} : _props$dropdownConfig,
|
|
58
|
+
_props$moreText = props.moreText,
|
|
59
|
+
moreText = _props$moreText === void 0 ? '更多' : _props$moreText,
|
|
60
|
+
moreIcon = props.moreIcon;
|
|
50
61
|
var _props$options = props.options,
|
|
51
62
|
options = _props$options === void 0 ? [] : _props$options,
|
|
52
63
|
_props$min = props.min,
|
|
53
64
|
min = _props$min === void 0 ? 3 : _props$min; // 最小展示长度不能小于2
|
|
54
|
-
var moreText = '更多';
|
|
55
65
|
if (!options) return null; // 没有配置list返回null
|
|
56
66
|
var _useState = (0, _react.useState)(-1),
|
|
57
67
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -67,6 +77,7 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
67
77
|
setResetList = _useState6[1];
|
|
68
78
|
(0, _react.useEffect)(function () {
|
|
69
79
|
// 重组选项options集合数据,排除:无权限(有配置code,并且不包含permissionCodes内)的数据及,isHide 为true的数据
|
|
80
|
+
// @ts-ignore
|
|
70
81
|
setResetList(_toConsumableArray((0, _filterPermission.removeNoPermission)(options, permissionCodes, codes, rowParams)) || []);
|
|
71
82
|
return function () {
|
|
72
83
|
setResetList([]);
|
|
@@ -75,79 +86,7 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
75
86
|
(0, _react.useEffect)(function () {
|
|
76
87
|
setPopVisibleIndex(-1);
|
|
77
88
|
}, [rowParams]);
|
|
78
|
-
|
|
79
|
-
const buttonMenu = (group: any) => {
|
|
80
|
-
return (<Menu>
|
|
81
|
-
{
|
|
82
|
-
group.map((item: any, index: number) => {
|
|
83
|
-
if (item.children) {
|
|
84
|
-
return <Menu.SubMenu title={item.exName || item.name} key={index}>
|
|
85
|
-
{
|
|
86
|
-
item.children.map((child: any, childIndex: number) => {
|
|
87
|
-
return (<Menu.Item key={childIndex}>
|
|
88
|
-
<a onClick={child.fn ? () => child.fn(child) : null}
|
|
89
|
-
>
|
|
90
|
-
<IconNode icon={child.icon}/> {child.exName || child.name}
|
|
91
|
-
</a>
|
|
92
|
-
</Menu.Item>)
|
|
93
|
-
})
|
|
94
|
-
}
|
|
95
|
-
</Menu.SubMenu>
|
|
96
|
-
}
|
|
97
|
-
return (
|
|
98
|
-
<Menu.Item key={index}>
|
|
99
|
-
<a onClick={item.fn ? () => item.fn(item) : null}>
|
|
100
|
-
<IconNode icon={item.icon}/> {item.exName || item.name}
|
|
101
|
-
</a>
|
|
102
|
-
</Menu.Item>
|
|
103
|
-
)
|
|
104
|
-
})
|
|
105
|
-
}
|
|
106
|
-
</Menu>)
|
|
107
|
-
};
|
|
108
|
-
// 渲染文本形式多级菜单列表(用于表格)
|
|
109
|
-
const textMenu = (group: any[]) => {
|
|
110
|
-
return (
|
|
111
|
-
<Menu className="spec-button-text-dropdown">
|
|
112
|
-
{
|
|
113
|
-
group.map((gItem: any, gIndex: number) => {
|
|
114
|
-
|
|
115
|
-
if (gItem.children) {
|
|
116
|
-
return <Menu.SubMenu title={gItem.exName || gItem.name} key={gItem}>
|
|
117
|
-
{
|
|
118
|
-
gItem.children.map((child: any, childIndex: number) => <Menu.Item key={childIndex}>
|
|
119
|
-
<a onClick={child.fn ? () => child.fn(...Object.keys(rowParams).map((pItem) => rowParams[pItem])) : null}>
|
|
120
|
-
{child.render ? child.render(...Object.keys(rowParams).map((pItem) => rowParams[pItem])) : (child.exName || child.name)}
|
|
121
|
-
</a>
|
|
122
|
-
</Menu.Item>)
|
|
123
|
-
}
|
|
124
|
-
</Menu.SubMenu>
|
|
125
|
-
}
|
|
126
|
-
return <Menu.Item key={gIndex}
|
|
127
|
-
disabled={btnIsDisabled(gItem.disabled, rowParams)}>
|
|
128
|
-
{
|
|
129
|
-
gItem.hasOwnProperty('confirmText') || gItem.hasOwnProperty('confirmConfig') ?
|
|
130
|
-
// @ts-ignore
|
|
131
|
-
<a disabled={btnIsDisabled(gItem.disabled, rowParams)}
|
|
132
|
-
onClick={gItem.fn ? () => {
|
|
133
|
-
setPopVisibleIndex(rowParams.rowIndex)
|
|
134
|
-
setPopRow(gItem)
|
|
135
|
-
} : null}>
|
|
136
|
-
{gItem.render ? gItem.render(...Object.keys(rowParams).map((pItem) => rowParams[pItem])) : (gItem.exName || gItem.name)}
|
|
137
|
-
</a>
|
|
138
|
-
: <a className="spec-button-group-text"
|
|
139
|
-
onClick={gItem.fn ? () => gItem.fn(...Object.keys(rowParams).map((pItem) => rowParams[pItem])) : null}
|
|
140
|
-
// @ts-ignore
|
|
141
|
-
disabled={btnIsDisabled(gItem.disabled, rowParams)}>
|
|
142
|
-
{gItem.render ? gItem.render(...Object.keys(rowParams).map((pItem) => rowParams[pItem])) : (gItem.exName || gItem.name)}
|
|
143
|
-
</a>
|
|
144
|
-
}
|
|
145
|
-
</Menu.Item>
|
|
146
|
-
})
|
|
147
|
-
}
|
|
148
|
-
</Menu>
|
|
149
|
-
)
|
|
150
|
-
};*/
|
|
89
|
+
|
|
151
90
|
// 递归转换原来的数组结构
|
|
152
91
|
var deepTransButtonMenus = function deepTransButtonMenus(groupArray) {
|
|
153
92
|
if (!Array.isArray(groupArray)) {
|
|
@@ -160,12 +99,12 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
160
99
|
name = vItem.name,
|
|
161
100
|
children = vItem.children,
|
|
162
101
|
icon = vItem.icon,
|
|
163
|
-
others = (
|
|
164
|
-
return
|
|
102
|
+
others = _objectWithoutProperties(vItem, _excluded);
|
|
103
|
+
return _objectSpread(_objectSpread({}, others), {}, {
|
|
165
104
|
key: code ? code + i : i,
|
|
166
|
-
icon: /*#__PURE__*/_react.default.createElement(
|
|
105
|
+
icon: icon ? /*#__PURE__*/_react.default.createElement(_components.IconNode, {
|
|
167
106
|
icon: icon
|
|
168
|
-
}),
|
|
107
|
+
}) : null,
|
|
169
108
|
label: /*#__PURE__*/_react.default.createElement("a", {
|
|
170
109
|
onClick: function onClick() {
|
|
171
110
|
return fn && fn(vItem);
|
|
@@ -175,12 +114,36 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
175
114
|
});
|
|
176
115
|
});
|
|
177
116
|
};
|
|
178
|
-
|
|
179
|
-
//
|
|
180
|
-
var
|
|
181
|
-
return
|
|
182
|
-
|
|
183
|
-
|
|
117
|
+
|
|
118
|
+
// 渲染按钮多层级形式 (用于筛选)
|
|
119
|
+
var buttonMenu = function buttonMenu(group) {
|
|
120
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Menu, null, group.map(function (item, index) {
|
|
121
|
+
if (item.children) {
|
|
122
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Menu.SubMenu, {
|
|
123
|
+
title: item.exName || item.name,
|
|
124
|
+
key: index
|
|
125
|
+
}, item.children.map(function (child, childIndex) {
|
|
126
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Menu.Item, {
|
|
127
|
+
key: child.name + childIndex
|
|
128
|
+
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
129
|
+
onClick: child.fn ? function () {
|
|
130
|
+
return child.fn(child);
|
|
131
|
+
} : undefined
|
|
132
|
+
}, /*#__PURE__*/_react.default.createElement(_components.IconNode, {
|
|
133
|
+
icon: child.icon
|
|
134
|
+
}), " ", child.exName || child.name));
|
|
135
|
+
}));
|
|
136
|
+
}
|
|
137
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Menu.Item, {
|
|
138
|
+
key: item.name + index
|
|
139
|
+
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
140
|
+
onClick: item.fn ? function () {
|
|
141
|
+
return item.fn(item);
|
|
142
|
+
} : undefined
|
|
143
|
+
}, /*#__PURE__*/_react.default.createElement(_components.IconNode, {
|
|
144
|
+
icon: item.icon
|
|
145
|
+
}), " ", item.exName || item.name));
|
|
146
|
+
}));
|
|
184
147
|
};
|
|
185
148
|
// 渲染按钮形式 (用于筛选)
|
|
186
149
|
var RenderButtonList = function RenderButtonList(item) {
|
|
@@ -195,33 +158,124 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
195
158
|
fn = item.fn,
|
|
196
159
|
code = item.code,
|
|
197
160
|
rowParams = item.rowParams,
|
|
198
|
-
others = (
|
|
161
|
+
others = _objectWithoutProperties(item, _excluded2);
|
|
199
162
|
if (Array.isArray(item.children) && item.children.length > 0) {
|
|
200
163
|
// overlay={buttonMenu(item.children)}
|
|
201
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
164
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Dropdown, _extends({
|
|
202
165
|
menu: {
|
|
203
166
|
items: deepTransButtonMenus(item.children)
|
|
204
167
|
},
|
|
205
168
|
placement: "bottomRight"
|
|
206
|
-
}, (item === null || item === void 0 ? void 0 : item.dropdownConfig) || dropdownConfig || {}), /*#__PURE__*/_react.default.createElement(
|
|
169
|
+
}, (item === null || item === void 0 ? void 0 : item.dropdownConfig) || dropdownConfig || {}), /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
207
170
|
type: "primary"
|
|
208
|
-
}, item.exName || item.name
|
|
171
|
+
}, item.exName || item.name, " ", /*#__PURE__*/_react.default.createElement(_SpecIcon.default, {
|
|
209
172
|
name: "down"
|
|
210
173
|
})));
|
|
211
174
|
}
|
|
212
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
175
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Button, _extends({
|
|
213
176
|
type: type || 'primary',
|
|
214
177
|
danger: danger,
|
|
215
178
|
ghost: ghost,
|
|
179
|
+
loading: loading,
|
|
216
180
|
onClick: fn ? function () {
|
|
217
181
|
return fn(item);
|
|
218
182
|
} : null
|
|
219
183
|
}, others, {
|
|
220
|
-
icon: /*#__PURE__*/_react.default.createElement(
|
|
184
|
+
icon: icon ? /*#__PURE__*/_react.default.createElement(_components.IconNode, {
|
|
221
185
|
icon: icon
|
|
222
|
-
}),
|
|
186
|
+
}) : null,
|
|
223
187
|
disabled: (0, _filterPermission.btnIsDisabled)(disabled, rowParams)
|
|
224
|
-
}), exName || name
|
|
188
|
+
}), exName || name);
|
|
189
|
+
};
|
|
190
|
+
/*const textMenuItems = (group) => {
|
|
191
|
+
return (group || []).map((gItem: any, gIndex) => {
|
|
192
|
+
return {
|
|
193
|
+
disabled: btnIsDisabled(gItem.disabled, rowParams),
|
|
194
|
+
label: gItem.hasOwnProperty('confirmText') || gItem.hasOwnProperty('confirmConfig') ?
|
|
195
|
+
// @ts-ignore
|
|
196
|
+
<a disabled={btnIsDisabled(gItem.disabled, rowParams)}
|
|
197
|
+
onClick={gItem.fn ? () => {
|
|
198
|
+
setPopVisibleIndex(rowParams.rowIndex)
|
|
199
|
+
setPopRow(gItem)
|
|
200
|
+
} : null}>
|
|
201
|
+
{gItem.render ? gItem.render(...Object.keys(rowParams).map((pItem) => rowParams[pItem])) : (gItem.exName || gItem.name)}
|
|
202
|
+
</a>
|
|
203
|
+
: <a className="spec-button-group-text"
|
|
204
|
+
onClick={gItem.fn ? () => gItem.fn(...Object.keys(rowParams).map((pItem) => rowParams[pItem])) : null}
|
|
205
|
+
// @ts-ignore
|
|
206
|
+
disabled={btnIsDisabled(gItem.disabled, rowParams)}>
|
|
207
|
+
{gItem.render ? gItem.render(...Object.keys(rowParams).map((pItem) => rowParams[pItem])) : (gItem.exName || gItem.name)}
|
|
208
|
+
</a>,
|
|
209
|
+
key: gIndex + (gItem.exName || gItem.name),
|
|
210
|
+
children: gItem.children ? (gItem.children || []).map((child: any, childIndex: number) => {
|
|
211
|
+
return {
|
|
212
|
+
label: <a onClick={child.fn ? () => child.fn(...Object.keys(rowParams).map((pItem) => rowParams[pItem])) : null}>
|
|
213
|
+
{child.render ? child.render(...Object.keys(rowParams).map((pItem) => rowParams[pItem])) : (child.exName || child.name)}
|
|
214
|
+
</a>,
|
|
215
|
+
key: childIndex
|
|
216
|
+
}
|
|
217
|
+
}) : undefined
|
|
218
|
+
}
|
|
219
|
+
})
|
|
220
|
+
}*/
|
|
221
|
+
// 渲染文本形式多级菜单列表(用于表格)
|
|
222
|
+
var textMenu = function textMenu(group) {
|
|
223
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Menu, {
|
|
224
|
+
className: "spec-button-text-dropdown"
|
|
225
|
+
}, group.map(function (gItem, gIndex) {
|
|
226
|
+
if (gItem.children) {
|
|
227
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Menu.SubMenu, {
|
|
228
|
+
title: gItem.exName || gItem.name,
|
|
229
|
+
key: gItem.name + gIndex
|
|
230
|
+
}, gItem.children.map(function (child, childIndex) {
|
|
231
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Menu.Item, {
|
|
232
|
+
key: child.name + childIndex
|
|
233
|
+
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
234
|
+
onClick: child.fn ? function () {
|
|
235
|
+
return child.fn.apply(child, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
236
|
+
return rowParams[pItem];
|
|
237
|
+
})));
|
|
238
|
+
} : undefined
|
|
239
|
+
}, child.render ? child.render.apply(child, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
240
|
+
return rowParams[pItem];
|
|
241
|
+
}))) : child.exName || child.name));
|
|
242
|
+
}));
|
|
243
|
+
}
|
|
244
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Menu.Item, {
|
|
245
|
+
key: gIndex,
|
|
246
|
+
disabled: (0, _filterPermission.btnIsDisabled)(gItem.disabled, rowParams)
|
|
247
|
+
}, gItem.hasOwnProperty('confirmText') || gItem.hasOwnProperty('confirmConfig') ?
|
|
248
|
+
/*#__PURE__*/
|
|
249
|
+
// @ts-ignore
|
|
250
|
+
_react.default.createElement("a", {
|
|
251
|
+
disabled: (0, _filterPermission.btnIsDisabled)(gItem.disabled, rowParams),
|
|
252
|
+
onClick: gItem.fn ? function () {
|
|
253
|
+
// @ts-ignore
|
|
254
|
+
setPopVisibleIndex(rowParams === null || rowParams === void 0 ? void 0 : rowParams.rowIndex);
|
|
255
|
+
setPopRow(gItem);
|
|
256
|
+
} : undefined
|
|
257
|
+
}, gItem.render ? gItem.render.apply(gItem, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
258
|
+
return rowParams[pItem];
|
|
259
|
+
}))) : gItem.exName || gItem.name) : /*#__PURE__*/_react.default.createElement("a", {
|
|
260
|
+
className: 'spec-button-group-text',
|
|
261
|
+
onClick: gItem.fn ? function () {
|
|
262
|
+
return gItem.fn.apply(gItem, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
263
|
+
return rowParams[pItem];
|
|
264
|
+
})));
|
|
265
|
+
} : undefined
|
|
266
|
+
// @ts-ignore
|
|
267
|
+
,
|
|
268
|
+
disabled: (0, _filterPermission.btnIsDisabled)(gItem.disabled, rowParams)
|
|
269
|
+
}, gItem.render ? gItem.render.apply(gItem, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
270
|
+
return rowParams[pItem];
|
|
271
|
+
}))) : gItem.exName || gItem.name));
|
|
272
|
+
}));
|
|
273
|
+
};
|
|
274
|
+
// 自定义渲染显示的文本
|
|
275
|
+
var renderCustomLabel = function renderCustomLabel(gItem) {
|
|
276
|
+
return gItem.render ? gItem.render.apply(gItem, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
277
|
+
return rowParams[pItem];
|
|
278
|
+
}))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, gItem.icon ? ' ' : '', gItem.exName || gItem.name);
|
|
225
279
|
};
|
|
226
280
|
// 递归转换原来的数组结构
|
|
227
281
|
var deepTransTextMenus = function deepTransTextMenus(groupArray) {
|
|
@@ -237,7 +291,7 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
237
291
|
icon = vItem.icon,
|
|
238
292
|
confirmText = vItem.confirmText,
|
|
239
293
|
confirmConfig = vItem.confirmConfig,
|
|
240
|
-
others = (
|
|
294
|
+
others = _objectWithoutProperties(vItem, _excluded3);
|
|
241
295
|
return {
|
|
242
296
|
danger: others.danger,
|
|
243
297
|
disabled: (0, _filterPermission.btnIsDisabled)(others.disabled, rowParams),
|
|
@@ -247,6 +301,7 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
247
301
|
onClick: function onClick() {
|
|
248
302
|
// 配置二次确认
|
|
249
303
|
if (vItem.hasOwnProperty('confirmText') || vItem.hasOwnProperty('confirmConfig')) {
|
|
304
|
+
// @ts-ignore
|
|
250
305
|
fn ? (setPopVisibleIndex(rowParams.rowIndex), setPopRow(vItem)) : null;
|
|
251
306
|
} else {
|
|
252
307
|
fn && fn.apply(void 0, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
@@ -260,28 +315,29 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
260
315
|
};
|
|
261
316
|
});
|
|
262
317
|
};
|
|
318
|
+
|
|
263
319
|
// 渲染文本形式 列表(用于表格)
|
|
264
320
|
var RenderTextList = function RenderTextList(item) {
|
|
265
321
|
if (Array.isArray(item.children) && item.children.length > 0) {
|
|
266
|
-
|
|
267
|
-
return /*#__PURE__*/_react.default.createElement(_dropdown.default, Object.assign({
|
|
322
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Dropdown, _extends({
|
|
268
323
|
menu: {
|
|
269
324
|
items: deepTransTextMenus(item.children)
|
|
270
325
|
},
|
|
271
326
|
placement: "bottomRight"
|
|
272
327
|
}, (item === null || item === void 0 ? void 0 : item.dropdownConfig) || dropdownConfig || {}), /*#__PURE__*/_react.default.createElement("a", {
|
|
273
|
-
className:
|
|
328
|
+
className: 'spec-button-group-text'
|
|
274
329
|
}, item.render ? item.render.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
275
330
|
return rowParams[pItem];
|
|
276
|
-
}))) : item.exName || item.name, " ", /*#__PURE__*/_react.default.createElement(
|
|
331
|
+
}))) : item.exName || item.name, " ", /*#__PURE__*/_react.default.createElement(_SpecIcon.default, {
|
|
277
332
|
name: "down"
|
|
278
333
|
})));
|
|
279
334
|
}
|
|
280
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.hasOwnProperty('confirmText') || item.hasOwnProperty('confirmConfig') ? /*#__PURE__*/_react.default.createElement(
|
|
335
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, item.hasOwnProperty('confirmText') || item.hasOwnProperty('confirmConfig') ? /*#__PURE__*/_react.default.createElement(_antd.Popconfirm, _extends({
|
|
281
336
|
placement: "topRight",
|
|
282
337
|
icon: /*#__PURE__*/_react.default.createElement(_icons.QuestionCircleOutlined, null)
|
|
283
338
|
}, item.hasOwnProperty('confirmConfig') ? item.confirmConfig : {}, {
|
|
284
|
-
|
|
339
|
+
// 弹出扩展配置
|
|
340
|
+
title: /*#__PURE__*/_react.default.createElement(_PopConfirmTitle.default, _extends({}, item, {
|
|
285
341
|
extraRow: rowParams
|
|
286
342
|
})),
|
|
287
343
|
onCancel: function onCancel() {
|
|
@@ -305,23 +361,29 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
305
361
|
}
|
|
306
362
|
}
|
|
307
363
|
}), /*#__PURE__*/_react.default.createElement("a", {
|
|
308
|
-
className:
|
|
364
|
+
className: 'spec-button-group-text',
|
|
309
365
|
key: item.index,
|
|
310
|
-
title: item.exName || item.name
|
|
366
|
+
title: item.exName || item.name
|
|
311
367
|
// @ts-ignore
|
|
368
|
+
,
|
|
312
369
|
disabled: (0, _filterPermission.btnIsDisabled)(item.disabled, rowParams)
|
|
313
|
-
},
|
|
314
|
-
|
|
370
|
+
}, item.render ? item.render.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
371
|
+
return rowParams[pItem];
|
|
372
|
+
}))) : item.exName || item.name)) : /*#__PURE__*/_react.default.createElement("a", {
|
|
373
|
+
className: 'spec-button-group-text',
|
|
315
374
|
title: item.exName || item.name,
|
|
316
|
-
key: item.index
|
|
375
|
+
key: item.index
|
|
317
376
|
// @ts-ignore
|
|
377
|
+
,
|
|
318
378
|
disabled: (0, _filterPermission.btnIsDisabled)(item.disabled, rowParams),
|
|
319
379
|
onClick: item.fn ? function () {
|
|
320
380
|
return item.fn.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
321
381
|
return rowParams[pItem];
|
|
322
382
|
})));
|
|
323
|
-
} :
|
|
324
|
-
},
|
|
383
|
+
} : undefined
|
|
384
|
+
}, item.render ? item.render.apply(item, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
385
|
+
return rowParams[pItem];
|
|
386
|
+
}))) : item.exName || item.name));
|
|
325
387
|
};
|
|
326
388
|
// 渲染展示的按钮列表
|
|
327
389
|
var renderDisplayButton = function renderDisplayButton(item, index) {
|
|
@@ -333,86 +395,91 @@ var ButtonGroup = function ButtonGroup(props) {
|
|
|
333
395
|
}
|
|
334
396
|
/*渲染按钮形式*/
|
|
335
397
|
if (type === 'button') {
|
|
336
|
-
return /*#__PURE__*/_react.default.createElement(RenderButtonList,
|
|
398
|
+
return /*#__PURE__*/_react.default.createElement(RenderButtonList, _extends({
|
|
337
399
|
key: index
|
|
338
400
|
}, item, {
|
|
339
401
|
rowParams: rowParams
|
|
340
402
|
}));
|
|
341
403
|
}
|
|
342
404
|
/*渲染文本形式*/
|
|
343
|
-
return /*#__PURE__*/_react.default.createElement(RenderTextList,
|
|
405
|
+
return /*#__PURE__*/_react.default.createElement(RenderTextList, _extends({
|
|
344
406
|
key: index
|
|
345
407
|
}, item));
|
|
346
408
|
};
|
|
347
409
|
if (min < 2) min = 2;
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
type
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
410
|
+
var componentName = 'spec-button-group';
|
|
411
|
+
var _useStyle = (0, _styles.default)(componentName),
|
|
412
|
+
_useStyle2 = _slicedToArray(_useStyle, 2),
|
|
413
|
+
wrapSSR = _useStyle2[0],
|
|
414
|
+
hashId = _useStyle2[1];
|
|
415
|
+
var ButtonGroupGroupNode = function ButtonGroupGroupNode() {
|
|
416
|
+
if (resetList.length === 0) {
|
|
417
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, type !== 'button' ? '-' : null);
|
|
418
|
+
}
|
|
419
|
+
// 数量超出时渲染
|
|
420
|
+
if (resetList.length > min) {
|
|
421
|
+
var forGroup = resetList.slice(0, min - 1);
|
|
422
|
+
var forDrop = resetList.slice(min - 1);
|
|
423
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
424
|
+
className: (0, _classnames.default)(componentName, hashId)
|
|
425
|
+
}, forGroup.map(function (item, index) {
|
|
426
|
+
return index < min - 1 ? renderDisplayButton(item, index) : null;
|
|
427
|
+
}), type === 'button' ? /*#__PURE__*/_react.default.createElement(_antd.Dropdown, _extends({
|
|
428
|
+
menu: {
|
|
429
|
+
items: deepTransButtonMenus(forDrop)
|
|
430
|
+
},
|
|
431
|
+
placement: "bottomRight"
|
|
432
|
+
}, dropdownConfig), /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
433
|
+
type: "primary"
|
|
434
|
+
}, moreText || '更多', moreIcon || /*#__PURE__*/_react.default.createElement(_icons.DownOutlined, null))) : /*#__PURE__*/_react.default.createElement(_antd.Popconfirm, _extends({
|
|
435
|
+
placement: "topRight",
|
|
436
|
+
open: popVisibleIndex === rowParams.rowIndex,
|
|
437
|
+
icon: /*#__PURE__*/_react.default.createElement(_icons.QuestionCircleOutlined, null),
|
|
438
|
+
trigger: "click"
|
|
439
|
+
}, popRow.hasOwnProperty('confirmConfig') ? popRow.confirmConfig : {}, {
|
|
440
|
+
// 弹出扩展配置
|
|
441
|
+
title: /*#__PURE__*/_react.default.createElement(_PopConfirmTitle.default, _extends({}, popRow, {
|
|
442
|
+
extraRow: rowParams
|
|
443
|
+
})),
|
|
444
|
+
onCancel: function onCancel() {
|
|
445
|
+
setPopVisibleIndex(-1);
|
|
446
|
+
// 优先调用其 confirmConfig 配置的 onCancel 事件
|
|
447
|
+
if (popRow.hasOwnProperty('confirmConfig') && popRow.confirmConfig.onCancel) {
|
|
448
|
+
var _popRow$confirmConfig;
|
|
449
|
+
(_popRow$confirmConfig = popRow.confirmConfig).onCancel.apply(_popRow$confirmConfig, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
450
|
+
return rowParams[pItem];
|
|
451
|
+
})));
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
onConfirm: function onConfirm() {
|
|
455
|
+
setPopVisibleIndex(-1);
|
|
456
|
+
// 优先调用其 confirmConfig 配置的 onConfirm 事件
|
|
457
|
+
if (popRow.hasOwnProperty('confirmConfig') && popRow.confirmConfig.onConfirm) {
|
|
458
|
+
var _popRow$confirmConfig2;
|
|
459
|
+
(_popRow$confirmConfig2 = popRow.confirmConfig).onConfirm.apply(_popRow$confirmConfig2, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
460
|
+
return rowParams[pItem];
|
|
461
|
+
})));
|
|
462
|
+
} else if (popRow.fn) {
|
|
463
|
+
popRow.fn.apply(popRow, _toConsumableArray(Object.keys(rowParams).map(function (pItem) {
|
|
464
|
+
return rowParams[pItem];
|
|
465
|
+
})));
|
|
466
|
+
}
|
|
399
467
|
}
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
468
|
+
}), /*#__PURE__*/_react.default.createElement(_antd.Dropdown, _extends({
|
|
469
|
+
menu: {
|
|
470
|
+
items: deepTransTextMenus(forDrop)
|
|
471
|
+
},
|
|
472
|
+
placement: "bottomRight"
|
|
473
|
+
}, dropdownConfig), /*#__PURE__*/_react.default.createElement("a", {
|
|
474
|
+
className: 'spec-button-group-text'
|
|
475
|
+
}, moreText || '更多', moreIcon || /*#__PURE__*/_react.default.createElement(_icons.DownOutlined, null)))));
|
|
476
|
+
}
|
|
477
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
478
|
+
className: (0, _classnames.default)(componentName, hashId)
|
|
479
|
+
}, resetList.map(function (item, index) {
|
|
480
|
+
return renderDisplayButton(item, index);
|
|
481
|
+
}));
|
|
482
|
+
};
|
|
483
|
+
return wrapSSR(ButtonGroupGroupNode());
|
|
416
484
|
};
|
|
417
|
-
var _default = ButtonGroup;
|
|
418
|
-
exports.default = _default;
|
|
485
|
+
var _default = exports.default = ButtonGroup;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GlobalToken } from "antd";
|
|
2
|
+
import { CSSProperties } from "react";
|
|
3
|
+
export interface SpecButtonGroupToken extends GlobalToken {
|
|
4
|
+
[k: string]: any;
|
|
5
|
+
}
|
|
6
|
+
export declare const prepareComponentToken: (token: GlobalToken) => CSSProperties;
|
|
7
|
+
declare const SpecButtonGroupStyleFunc: (prefix: string) => any;
|
|
8
|
+
export default SpecButtonGroupStyleFunc;
|