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,27 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
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); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.default = void 0;
|
|
7
|
-
require("antd/es/tree/style");
|
|
8
|
-
var _tree = _interopRequireDefault(require("antd/es/tree"));
|
|
9
|
-
require("antd/es/empty/style");
|
|
10
|
-
var _empty = _interopRequireDefault(require("antd/es/empty"));
|
|
11
|
-
require("antd/es/popconfirm/style");
|
|
12
|
-
var _popconfirm = _interopRequireDefault(require("antd/es/popconfirm"));
|
|
13
|
-
var _tslib = require("tslib");
|
|
14
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _antd = require("antd");
|
|
15
10
|
var _index = _interopRequireDefault(require("../SpecIcon/index"));
|
|
16
11
|
var _util = require("./util");
|
|
17
12
|
require("./style/index.less");
|
|
18
|
-
|
|
19
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
+
var _excluded = ["treeData", "rootName", "rootKey", "emptyDescription", "optionName", "defaultSelectedKeys", "nodeExtra", "selectable", "nodeControl", "limitKey", "checkedKeys", "checkStrictly", "onSelect", "onCheck", "titleRender", "disabledFields"]; // 重构树控件,可直接配置数据
|
|
20
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
function
|
|
15
|
+
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); }
|
|
16
|
+
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; }
|
|
17
|
+
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); }
|
|
22
18
|
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; }
|
|
23
|
-
function _toPropertyKey(
|
|
24
|
-
function _toPrimitive(
|
|
19
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
20
|
+
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); }
|
|
21
|
+
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; }
|
|
22
|
+
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; }
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
|
|
25
25
|
var RefactorTree = function RefactorTree(props) {
|
|
26
26
|
var treeData = props.treeData,
|
|
27
27
|
rootName = props.rootName,
|
|
@@ -46,14 +46,14 @@ var RefactorTree = function RefactorTree(props) {
|
|
|
46
46
|
onCheck = props.onCheck,
|
|
47
47
|
titleRender = props.titleRender,
|
|
48
48
|
disabledFields = props.disabledFields,
|
|
49
|
-
otherProps = (
|
|
49
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
50
|
+
// const { title, value, children, disabled } = { value: 'value', title: 'title', children: 'children', disabled: 'disabled', ...optionName }
|
|
50
51
|
// 重新组合指定数据源字段
|
|
51
52
|
var transTreeData = (0, _react.useMemo)(function () {
|
|
52
|
-
var _ref;
|
|
53
53
|
var afterTransData = (0, _util.transDataParam)(treeData, optionName); // 通过转换后的数据
|
|
54
54
|
var resultData;
|
|
55
55
|
// 如果有配置根节点,则添加 一个根节点数据
|
|
56
|
-
resultData = rootName ? [(
|
|
56
|
+
resultData = rootName ? [_defineProperty(_defineProperty(_defineProperty({}, optionName.title || 'title', rootName), optionName.key || 'key', rootKey || '0'), 'children', afterTransData)] : afterTransData;
|
|
57
57
|
// 有配置limitKey指定限制同级节点时,添加判断节点选择限制(在父子节点不相关联条件下使用checkStrictly=true)
|
|
58
58
|
if (checkStrictly && limitKey && checkedKeys) {
|
|
59
59
|
if (Array.isArray(checkedKeys) && checkedKeys.length > 0 || checkedKeys && Array.isArray(checkedKeys.checked) && checkedKeys.checked.length > 0) {
|
|
@@ -65,6 +65,7 @@ var RefactorTree = function RefactorTree(props) {
|
|
|
65
65
|
}
|
|
66
66
|
return resultData;
|
|
67
67
|
}, [treeData, optionName, checkStrictly, limitKey, checkedKeys, disabledFields]);
|
|
68
|
+
|
|
68
69
|
// console.log('重置后的数据', transTreeData)
|
|
69
70
|
var handleToSelectTreeNode = function handleToSelectTreeNode(key, e) {
|
|
70
71
|
var currentData = e.node;
|
|
@@ -109,7 +110,7 @@ var RefactorTree = function RefactorTree(props) {
|
|
|
109
110
|
}
|
|
110
111
|
}, /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
111
112
|
name: 'edit'
|
|
112
|
-
})), /*#__PURE__*/_react.default.createElement(
|
|
113
|
+
})), /*#__PURE__*/_react.default.createElement(_antd.Popconfirm, {
|
|
113
114
|
placement: 'top',
|
|
114
115
|
title: "\u786E\u5B9A\u8981\u5220\u9664\uFF1A".concat(item[optionName.title || 'title'], "\u5417\uFF1F"),
|
|
115
116
|
icon: /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
@@ -127,8 +128,8 @@ var RefactorTree = function RefactorTree(props) {
|
|
|
127
128
|
})))) : null, nodeExtra && nodeExtra(item));
|
|
128
129
|
};
|
|
129
130
|
if (transTreeData.length == 0) {
|
|
130
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
131
|
-
image:
|
|
131
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Empty, {
|
|
132
|
+
image: _antd.Empty.PRESENTED_IMAGE_SIMPLE,
|
|
132
133
|
description: emptyDescription
|
|
133
134
|
});
|
|
134
135
|
} else {
|
|
@@ -138,7 +139,7 @@ var RefactorTree = function RefactorTree(props) {
|
|
|
138
139
|
} else {
|
|
139
140
|
defExpand = rootKey ? [rootKey] : ['0'];
|
|
140
141
|
}
|
|
141
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
142
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Tree, _extends({}, otherProps, {
|
|
142
143
|
onSelect: function onSelect(keys, e) {
|
|
143
144
|
return handleToSelectTreeNode(keys, e);
|
|
144
145
|
},
|
|
@@ -155,5 +156,4 @@ var RefactorTree = function RefactorTree(props) {
|
|
|
155
156
|
}));
|
|
156
157
|
}
|
|
157
158
|
};
|
|
158
|
-
var _default = RefactorTree;
|
|
159
|
-
exports.default = _default;
|
|
159
|
+
var _default = exports.default = RefactorTree;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
padding: 0 2px;
|
|
5
|
-
color: @text-color;
|
|
6
|
-
&:hover{
|
|
7
|
-
color: @primary-color;
|
|
8
|
-
}
|
|
9
|
-
&:first-child {
|
|
10
|
-
margin-left: 2px;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.treeControl a {
|
|
15
|
-
color: #fff;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.ant-tree-node-content-wrapper {
|
|
20
|
-
cursor: default !important;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
1
|
+
//@root-entry-name: default;
|
|
2
|
+
//@import (reference) '~antd/es/style/themes/index';
|
|
3
|
+
//.treeControl a {
|
|
4
|
+
// padding: 0 2px;
|
|
5
|
+
// color: @text-color;
|
|
6
|
+
// &:hover{
|
|
7
|
+
// color: @primary-color;
|
|
8
|
+
// }
|
|
9
|
+
// &:first-child {
|
|
10
|
+
// margin-left: 2px;
|
|
11
|
+
// }
|
|
12
|
+
//}
|
|
13
|
+
//.spec-grid-left .ant-tree-node-selected {
|
|
14
|
+
// .treeControl a {
|
|
15
|
+
// color: #fff;
|
|
16
|
+
// }
|
|
17
|
+
//}
|
|
18
|
+
//.notPointer {
|
|
19
|
+
// .ant-tree-node-content-wrapper {
|
|
20
|
+
// cursor: default !important;
|
|
21
|
+
// }
|
|
22
|
+
//}
|
|
@@ -13,7 +13,7 @@ interface optionNameProps {
|
|
|
13
13
|
* @params {object} optionName 选项字段值
|
|
14
14
|
*
|
|
15
15
|
* */
|
|
16
|
-
export declare function transDataParam(array
|
|
16
|
+
export declare function transDataParam(array: any[], optionName?: optionNameProps): any[] | null;
|
|
17
17
|
/**
|
|
18
18
|
* 根据限制字段limitKey进行重组数据
|
|
19
19
|
*
|
|
@@ -25,7 +25,7 @@ export declare function transDataParam(array?: any[], optionName?: optionNamePro
|
|
|
25
25
|
* @Return {array} 返回结果数据
|
|
26
26
|
*
|
|
27
27
|
* */
|
|
28
|
-
export declare function resetDataWithLimit(hasKeys: any[], list: any[], optionName
|
|
28
|
+
export declare function resetDataWithLimit(hasKeys: any[], list: any[], optionName: optionNameProps | undefined, limitKey: string): any[];
|
|
29
29
|
/**
|
|
30
30
|
* 根据指定禁用字段 disabledFields 进行重组数据
|
|
31
31
|
*
|
package/lib/RefactorTree/util.js
CHANGED
|
@@ -6,13 +6,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.resetDataWithDisabled = resetDataWithDisabled;
|
|
7
7
|
exports.resetDataWithLimit = resetDataWithLimit;
|
|
8
8
|
exports.transDataParam = transDataParam;
|
|
9
|
-
|
|
9
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
10
10
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
11
11
|
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."); }
|
|
12
12
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
13
13
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
14
14
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
15
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
15
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
16
|
+
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
17
|
+
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; }
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
21
|
+
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); }
|
|
22
|
+
/* eslint-disable */
|
|
23
|
+
// import * as React from 'react';
|
|
24
|
+
|
|
16
25
|
/**
|
|
17
26
|
* transDataParam 根据指定选项字段名重组数据
|
|
18
27
|
*
|
|
@@ -41,14 +50,18 @@ function transDataParam(array) {
|
|
|
41
50
|
if (item.hasOwnProperty(optionName.children || 'children')) {
|
|
42
51
|
item.children = item[optionName.children || 'children'] ? trans(item[optionName.children || 'children']) : [];
|
|
43
52
|
}
|
|
44
|
-
return
|
|
53
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
45
54
|
key: item[optionName.value || optionName.key || 'key'],
|
|
46
55
|
title: item[optionName.title || 'title']
|
|
56
|
+
// children: trans(item[treeOptionName.children || 'children']),
|
|
57
|
+
// disabled: item[treeOptionName.disabled || 'disabled'],
|
|
58
|
+
// selectable: item[treeOptionName.selectable || 'selectable'],
|
|
47
59
|
});
|
|
48
60
|
});
|
|
49
61
|
};
|
|
50
|
-
return trans(array);
|
|
62
|
+
return trans(array || []);
|
|
51
63
|
}
|
|
64
|
+
|
|
52
65
|
/**
|
|
53
66
|
* 根据限制字段limitKey进行重组数据
|
|
54
67
|
*
|
|
@@ -76,7 +89,7 @@ function resetDataWithLimit(hasKeys, list) {
|
|
|
76
89
|
if (Array.isArray(preList) && preList.length > 0) {
|
|
77
90
|
preList.forEach(function (item, i) {
|
|
78
91
|
if (ids.includes(item[optionName.value || 'value'])) {
|
|
79
|
-
matchList.push(
|
|
92
|
+
matchList.push(_objectSpread({}, item));
|
|
80
93
|
}
|
|
81
94
|
if (item[optionName.children || 'children']) {
|
|
82
95
|
matchList = matchList.concat(filterCheckedNode(ids, item[optionName.children || 'children']));
|
|
@@ -85,13 +98,14 @@ function resetDataWithLimit(hasKeys, list) {
|
|
|
85
98
|
}
|
|
86
99
|
return matchList;
|
|
87
100
|
};
|
|
101
|
+
|
|
88
102
|
// 筛选同一层级可选择,其他层级数据不可选择(限制按指定字段名的层级数据)
|
|
89
103
|
var filterResetSameLevel = function filterResetSameLevel(preList, matchDataValue) {
|
|
90
104
|
if (!preList) return [];
|
|
91
105
|
if (!matchDataValue) return preList;
|
|
92
|
-
return preList
|
|
93
|
-
var oldItem =
|
|
94
|
-
var item = (
|
|
106
|
+
return (preList || []).map(function (preItem) {
|
|
107
|
+
var oldItem = _objectSpread({}, preItem);
|
|
108
|
+
var item = Object.assign({}, (_objectDestructuringEmpty(oldItem), oldItem));
|
|
95
109
|
if (item[limitKey] !== matchDataValue) {
|
|
96
110
|
item.disabled = true;
|
|
97
111
|
} else if (item.hasOwnProperty(optionName.disabled || 'disabled')) {
|
|
@@ -101,7 +115,7 @@ function resetDataWithLimit(hasKeys, list) {
|
|
|
101
115
|
item.isLimit = item[limitKey] !== matchDataValue;
|
|
102
116
|
item.children = filterResetSameLevel(item['children'], matchDataValue);
|
|
103
117
|
item[optionName.children || 'children'] = filterResetSameLevel(item[optionName.children || 'children'], matchDataValue);
|
|
104
|
-
return
|
|
118
|
+
return _objectSpread({}, item);
|
|
105
119
|
});
|
|
106
120
|
};
|
|
107
121
|
// 先筛选出来选中节点的数据,取其中的 level 层级的值(数据必须保证同级类型值一致)
|
|
@@ -115,6 +129,7 @@ function resetDataWithLimit(hasKeys, list) {
|
|
|
115
129
|
return newList;
|
|
116
130
|
}
|
|
117
131
|
}
|
|
132
|
+
|
|
118
133
|
/**
|
|
119
134
|
* 根据指定禁用字段 disabledFields 进行重组数据
|
|
120
135
|
*
|
|
@@ -132,16 +147,16 @@ function resetDataWithDisabled(list, optionName, disabledFields) {
|
|
|
132
147
|
var filterResetTargetFields = function filterResetTargetFields(preList, fields) {
|
|
133
148
|
if (!preList) return [];
|
|
134
149
|
return preList.map(function (preItem) {
|
|
135
|
-
var oldItem =
|
|
136
|
-
var item = (
|
|
150
|
+
var oldItem = _objectSpread({}, preItem);
|
|
151
|
+
var item = Object.assign({}, (_objectDestructuringEmpty(oldItem), oldItem));
|
|
137
152
|
Object.keys(item).forEach(function (itemKeyName) {
|
|
138
|
-
var
|
|
139
|
-
var isMatch = fields.find(function (fItem) {
|
|
153
|
+
var isMatch = (fields || []).find(function (fItem) {
|
|
140
154
|
return fItem.key === itemKeyName;
|
|
141
155
|
});
|
|
142
156
|
if (isMatch) {
|
|
157
|
+
var _isMatch$value$split;
|
|
143
158
|
// 确认是否匹配数据,进行设置 disabled
|
|
144
|
-
if ((
|
|
159
|
+
if ((_isMatch$value$split = isMatch.value.split(',')) !== null && _isMatch$value$split !== void 0 && _isMatch$value$split.includes(item[itemKeyName])) {
|
|
145
160
|
item.disabled = true;
|
|
146
161
|
} else if (item.hasOwnProperty(optionName.disabled || 'disabled')) {
|
|
147
162
|
item.disabled = item[optionName.disabled || 'disabled'];
|
|
@@ -151,7 +166,7 @@ function resetDataWithDisabled(list, optionName, disabledFields) {
|
|
|
151
166
|
item.children = filterResetTargetFields(item[itemKeyName], fields);
|
|
152
167
|
}
|
|
153
168
|
});
|
|
154
|
-
return
|
|
169
|
+
return _objectSpread({}, item);
|
|
155
170
|
});
|
|
156
171
|
};
|
|
157
172
|
var prevList = list && Array.isArray(list) ? _toConsumableArray(list) : [];
|