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
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
"use strict";
|
|
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); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _antd = require("antd");
|
|
10
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
11
|
+
require("./styles/index.less");
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
var _icons = require("@ant-design/icons");
|
|
14
|
+
var _CalendarMonthPicker = _interopRequireDefault(require("./CalendarMonthPicker"));
|
|
15
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
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); }
|
|
18
|
+
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; }
|
|
19
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
20
|
+
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."); }
|
|
21
|
+
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); }
|
|
22
|
+
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; }
|
|
23
|
+
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; } }
|
|
24
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // import type { CalendarProps } from 'antd';
|
|
25
|
+
var CalendarCoordPicker = function CalendarCoordPicker(props) {
|
|
26
|
+
var _props$type = props.type,
|
|
27
|
+
type = _props$type === void 0 ? 'directPick' : _props$type,
|
|
28
|
+
year = props.year;
|
|
29
|
+
var componentName = 'spec-calendar-coordinate';
|
|
30
|
+
var _useStyle = (0, _styles.default)(componentName),
|
|
31
|
+
_useStyle2 = _slicedToArray(_useStyle, 2),
|
|
32
|
+
wrapSSR = _useStyle2[0],
|
|
33
|
+
hashId = _useStyle2[1];
|
|
34
|
+
var _useState = (0, _react.useState)((0, _dayjs.default)().year()),
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
yearNum = _useState2[0],
|
|
37
|
+
setYearNum = _useState2[1];
|
|
38
|
+
(0, _react.useEffect)(function () {
|
|
39
|
+
setYearNum(year || (0, _dayjs.default)().year());
|
|
40
|
+
}, [year]);
|
|
41
|
+
// const cellDays = useMemo(() => {
|
|
42
|
+
// return
|
|
43
|
+
// }, [])
|
|
44
|
+
// const onPanelChange = (value: Dayjs, mode: CalendarProps<Dayjs>['mode']) => {
|
|
45
|
+
// console.log(value.format('YYYY-MM-DD'), mode);
|
|
46
|
+
// };
|
|
47
|
+
(0, _react.useEffect)(function () {
|
|
48
|
+
// 获取日历格子元素
|
|
49
|
+
// var calendarCells = document.querySelectorAll('.calendar-cell');
|
|
50
|
+
var calendarCells = document.querySelectorAll('.ant-picker-cell');
|
|
51
|
+
// console.log('calendarCells', calendarCells)
|
|
52
|
+
// console.log('calendarCells', document.getElementsByClassName('ant-picker-cell-in-view'))
|
|
53
|
+
// 记录鼠标按下的位置
|
|
54
|
+
var startX, startY;
|
|
55
|
+
|
|
56
|
+
// 记录鼠标框选的起始位置和结束位置
|
|
57
|
+
// let startCell: any;
|
|
58
|
+
var endCell;
|
|
59
|
+
var startCellIndex, endCellIndex;
|
|
60
|
+
var startCellRect, endCellRect;
|
|
61
|
+
var cellSelectProcessing = false;
|
|
62
|
+
|
|
63
|
+
// 监听鼠标按下事件
|
|
64
|
+
document.addEventListener('mousedown', function (event) {
|
|
65
|
+
// 记录鼠标按下的位置
|
|
66
|
+
startX = event.clientX;
|
|
67
|
+
startY = event.clientY;
|
|
68
|
+
var startCellConfig = getCellFromCoordinates(startX, startY);
|
|
69
|
+
// 获取鼠标按下的日历格子
|
|
70
|
+
// startCell = startCellConfig.cell;
|
|
71
|
+
startCellIndex = startCellConfig.cellIndex;
|
|
72
|
+
startCellRect = startCellConfig.cellRect;
|
|
73
|
+
cellSelectProcessing = true;
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// 监听鼠标移动事件
|
|
77
|
+
document.addEventListener('mousemove', function (event) {
|
|
78
|
+
// 获取鼠标移动的位置
|
|
79
|
+
var currentX = event.clientX;
|
|
80
|
+
var currentY = event.clientY;
|
|
81
|
+
|
|
82
|
+
// 获取鼠标移动的日历格子
|
|
83
|
+
var currentCellConfig = getCellFromCoordinates(currentX, currentY);
|
|
84
|
+
var currentCell = currentCellConfig.cell;
|
|
85
|
+
var currentCellIndex = currentCellConfig.cellIndex;
|
|
86
|
+
var currentCellRect = currentCellConfig.cellRect;
|
|
87
|
+
|
|
88
|
+
// 如果鼠标移动的日历格子不为空,则进行框选
|
|
89
|
+
if (cellSelectProcessing && currentCell) {
|
|
90
|
+
// 清除之前的框选样式
|
|
91
|
+
clearSelection();
|
|
92
|
+
// 设置当前日历格子的框选样式
|
|
93
|
+
// currentCell.classList.add('spec-calendar-coordinate-picker__order-selected');
|
|
94
|
+
// 记录结束位置
|
|
95
|
+
endCell = currentCell;
|
|
96
|
+
endCellIndex = currentCellIndex;
|
|
97
|
+
endCellRect = currentCellRect;
|
|
98
|
+
type === 'orderPick' ? getCellSelected() : getCellCoordinate();
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
// 监听鼠标松开事件
|
|
103
|
+
document.addEventListener('mouseup', function (event) {
|
|
104
|
+
// 清除框选样式
|
|
105
|
+
clearSelection();
|
|
106
|
+
|
|
107
|
+
// 获取鼠标松开的位置
|
|
108
|
+
var endX = event.clientX;
|
|
109
|
+
var endY = event.clientY;
|
|
110
|
+
|
|
111
|
+
// 获取鼠标松开的日历格子
|
|
112
|
+
var endCellConfig = getCellFromCoordinates(endX, endY);
|
|
113
|
+
endCell = endCellConfig.cell;
|
|
114
|
+
endCellIndex = endCellConfig.cellIndex;
|
|
115
|
+
endCellRect = endCellConfig.cellRect;
|
|
116
|
+
|
|
117
|
+
// 如果鼠标松开的日历格子不为空,则进行框选
|
|
118
|
+
if (endCell) {
|
|
119
|
+
type === 'orderPick' ? getCellSelected() : getCellCoordinate();
|
|
120
|
+
}
|
|
121
|
+
cellSelectProcessing = false;
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
// 按坐标内的顺序选中
|
|
125
|
+
var getCellSelected = function getCellSelected() {
|
|
126
|
+
for (var i = Math.min(startCellIndex, endCellIndex); i <= Math.max(startCellIndex, endCellIndex); i++) {
|
|
127
|
+
// const rect = calendarCells[i].getBoundingClientRect();
|
|
128
|
+
if (calendarCells[i].classList.contains('ant-picker-cell-in-view')) {
|
|
129
|
+
calendarCells[i].classList.add('spec-calendar-coordinate-picker__order-selected');
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
// 按坐标内的范围选中
|
|
134
|
+
var getCellCoordinate = function getCellCoordinate() {
|
|
135
|
+
var _startCellRect, _endCellRect, _startCellRect2, _endCellRect2, _startCellRect3, _endCellRect3;
|
|
136
|
+
var direct = ''; // 选中单元格方位
|
|
137
|
+
if (!startCellRect && !endCellRect) return;
|
|
138
|
+
if (((_startCellRect = startCellRect) === null || _startCellRect === void 0 ? void 0 : _startCellRect.x) === ((_endCellRect = endCellRect) === null || _endCellRect === void 0 ? void 0 : _endCellRect.x)) {
|
|
139
|
+
if (startCellRect.y === endCellRect.y) {
|
|
140
|
+
direct = 'center';
|
|
141
|
+
} else if (startCellRect.y > endCellRect.y) {
|
|
142
|
+
direct = 'centerTop';
|
|
143
|
+
} else if (startCellRect.y < endCellRect.y) {
|
|
144
|
+
direct = 'centerBottom';
|
|
145
|
+
}
|
|
146
|
+
} else if (((_startCellRect2 = startCellRect) === null || _startCellRect2 === void 0 ? void 0 : _startCellRect2.x) > ((_endCellRect2 = endCellRect) === null || _endCellRect2 === void 0 ? void 0 : _endCellRect2.x)) {
|
|
147
|
+
if (startCellRect.y === endCellRect.y) {
|
|
148
|
+
direct = 'centerLeft';
|
|
149
|
+
} else if (startCellRect.y > endCellRect.y) {
|
|
150
|
+
direct = 'leftTop';
|
|
151
|
+
} else if (startCellRect.y < endCellRect.y) {
|
|
152
|
+
direct = 'leftBottom';
|
|
153
|
+
}
|
|
154
|
+
} else if (((_startCellRect3 = startCellRect) === null || _startCellRect3 === void 0 ? void 0 : _startCellRect3.x) < ((_endCellRect3 = endCellRect) === null || _endCellRect3 === void 0 ? void 0 : _endCellRect3.x)) {
|
|
155
|
+
if (startCellRect.y === endCellRect.y) {
|
|
156
|
+
direct = 'centerRight';
|
|
157
|
+
} else if (startCellRect.y > endCellRect.y) {
|
|
158
|
+
direct = 'rightTop';
|
|
159
|
+
} else if (startCellRect.y < endCellRect.y) {
|
|
160
|
+
direct = 'rightBottom';
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
var selectedCells = []; // 过滤当前选中的单元格
|
|
164
|
+
for (var i = 0; i < calendarCells.length; i++) {
|
|
165
|
+
var rect = calendarCells[i].getBoundingClientRect();
|
|
166
|
+
if (rect && calendarCells[i].classList.contains('ant-picker-cell-in-view')) {
|
|
167
|
+
switch (direct) {
|
|
168
|
+
case 'center':
|
|
169
|
+
if (rect.x === endCellRect.x && rect.y === endCellRect.y) {
|
|
170
|
+
selectedCells.push(calendarCells[i]);
|
|
171
|
+
}
|
|
172
|
+
break;
|
|
173
|
+
case 'centerTop':
|
|
174
|
+
if (rect.x === endCellRect.x && rect.y >= endCellRect.y && rect.x === endCellRect.x && rect.y <= startCellRect.y) {
|
|
175
|
+
selectedCells.push(calendarCells[i]);
|
|
176
|
+
}
|
|
177
|
+
break;
|
|
178
|
+
case 'centerBottom':
|
|
179
|
+
if (rect.x === endCellRect.x && rect.y <= endCellRect.y && rect.x === endCellRect.x && rect.y >= startCellRect.y) {
|
|
180
|
+
selectedCells.push(calendarCells[i]);
|
|
181
|
+
}
|
|
182
|
+
break;
|
|
183
|
+
case 'centerRight':
|
|
184
|
+
if (rect.y === endCellRect.y && rect.x <= endCellRect.x && rect.y === endCellRect.y && rect.x >= startCellRect.x) {
|
|
185
|
+
selectedCells.push(calendarCells[i]);
|
|
186
|
+
}
|
|
187
|
+
break;
|
|
188
|
+
case 'rightBottom':
|
|
189
|
+
if (rect.y >= startCellRect.y && rect.y <= endCellRect.y && rect.x >= startCellRect.x && rect.x <= endCellRect.x) {
|
|
190
|
+
selectedCells.push(calendarCells[i]);
|
|
191
|
+
}
|
|
192
|
+
break;
|
|
193
|
+
case 'rightTop':
|
|
194
|
+
if (rect.x >= startCellRect.x && rect.x <= endCellRect.x && rect.y >= endCellRect.y && rect.y <= startCellRect.y) {
|
|
195
|
+
selectedCells.push(calendarCells[i]);
|
|
196
|
+
}
|
|
197
|
+
break;
|
|
198
|
+
case 'centerLeft':
|
|
199
|
+
if (rect.y === endCellRect.y && rect.x >= endCellRect.x && rect.y === endCellRect.y && rect.x <= startCellRect.x) {
|
|
200
|
+
selectedCells.push(calendarCells[i]);
|
|
201
|
+
}
|
|
202
|
+
break;
|
|
203
|
+
case 'leftBottom':
|
|
204
|
+
if (rect.y >= startCellRect.y && rect.y <= endCellRect.y && rect.x <= startCellRect.x && rect.x >= endCellRect.x) {
|
|
205
|
+
selectedCells.push(calendarCells[i]);
|
|
206
|
+
}
|
|
207
|
+
break;
|
|
208
|
+
case 'leftTop':
|
|
209
|
+
if (rect.y <= startCellRect.y && rect.y >= endCellRect.y && rect.x <= startCellRect.x && rect.x >= endCellRect.x) {
|
|
210
|
+
selectedCells.push(calendarCells[i]);
|
|
211
|
+
}
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
// console.log('selectedCells', calendarCells)
|
|
217
|
+
for (var j = 0; j < selectedCells.length; j++) {
|
|
218
|
+
// rect.x >= startX && rect.x <= overX && rect.y >= startY && rect.y <= overY
|
|
219
|
+
selectedCells[j].classList.add('spec-calendar-coordinate-picker__directed-selected');
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
// 获取指定坐标的日历格子(按坐标)
|
|
223
|
+
var getCellFromCoordinates = function getCellFromCoordinates(x, y) {
|
|
224
|
+
var cell = null;
|
|
225
|
+
var cellIndex = null;
|
|
226
|
+
var cellRect = null; // 当前格子的坐标信息
|
|
227
|
+
// 遍历所有日历格子
|
|
228
|
+
for (var i = 0; i < calendarCells.length; i++) {
|
|
229
|
+
var rect = calendarCells[i].getBoundingClientRect();
|
|
230
|
+
// 判断坐标是否在日历格子的范围内
|
|
231
|
+
if (x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom) {
|
|
232
|
+
cell = calendarCells[i];
|
|
233
|
+
cellIndex = i;
|
|
234
|
+
cellRect = rect;
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return {
|
|
239
|
+
cellIndex: cellIndex,
|
|
240
|
+
cell: cell,
|
|
241
|
+
cellRect: cellRect
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
// 清除框选样式
|
|
246
|
+
var clearSelection = function clearSelection() {
|
|
247
|
+
for (var i = 0; i < calendarCells.length; i++) {
|
|
248
|
+
calendarCells[i].classList.remove('spec-calendar-coordinate-picker__order-selected');
|
|
249
|
+
calendarCells[i].classList.remove('spec-calendar-coordinate-picker__directed-selected');
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
return function () {
|
|
253
|
+
document.removeEventListener('mousedown', function () {}, false);
|
|
254
|
+
document.removeEventListener('mousemove', function () {}, false);
|
|
255
|
+
document.removeEventListener('mouseup', function () {}, false);
|
|
256
|
+
};
|
|
257
|
+
}, [type]);
|
|
258
|
+
var renderPickerHeader = function renderPickerHeader(_ref) {
|
|
259
|
+
var value = _ref.value;
|
|
260
|
+
//
|
|
261
|
+
// const start = 0;
|
|
262
|
+
// const end = 12;
|
|
263
|
+
// const monthOptions = [];
|
|
264
|
+
var current = value.clone();
|
|
265
|
+
var localeData = value.localeData();
|
|
266
|
+
var months = [];
|
|
267
|
+
for (var i = 0; i < 12; i++) {
|
|
268
|
+
current.month(i);
|
|
269
|
+
months.push(localeData.monthsShort(current));
|
|
270
|
+
}
|
|
271
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
272
|
+
style: {
|
|
273
|
+
textAlign: 'right',
|
|
274
|
+
fontSize: '16px',
|
|
275
|
+
paddingRight: '10px'
|
|
276
|
+
}
|
|
277
|
+
}, months[value.month()]);
|
|
278
|
+
};
|
|
279
|
+
var monthArray = (0, _react.useMemo)(function () {
|
|
280
|
+
var months = [];
|
|
281
|
+
for (var i = 0; i < 12; i++) {
|
|
282
|
+
months.push(i + 1);
|
|
283
|
+
}
|
|
284
|
+
return months;
|
|
285
|
+
}, []);
|
|
286
|
+
return wrapSSR( /*#__PURE__*/_react.default.createElement("div", {
|
|
287
|
+
className: (0, _classnames.default)(componentName, hashId)
|
|
288
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
289
|
+
className: 'spec-calendar-coordinate-header'
|
|
290
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
291
|
+
className: 'spec-calendar-coordinate-header-action prev'
|
|
292
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
293
|
+
size: 'small',
|
|
294
|
+
icon: /*#__PURE__*/_react.default.createElement(_icons.LeftOutlined, null),
|
|
295
|
+
title: "".concat(yearNum - 1, "\u5E74"),
|
|
296
|
+
onClick: function onClick() {
|
|
297
|
+
return setYearNum(yearNum - 1);
|
|
298
|
+
}
|
|
299
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
300
|
+
className: 'spec-calendar-coordinate-header-year'
|
|
301
|
+
}, yearNum, "\u5E74"), /*#__PURE__*/_react.default.createElement("div", {
|
|
302
|
+
className: 'spec-calendar-coordinate-header-action next'
|
|
303
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
304
|
+
size: 'small',
|
|
305
|
+
icon: /*#__PURE__*/_react.default.createElement(_icons.RightOutlined, null),
|
|
306
|
+
title: "".concat(yearNum + 1, "\u5E74"),
|
|
307
|
+
onClick: function onClick() {
|
|
308
|
+
return setYearNum(yearNum + 1);
|
|
309
|
+
}
|
|
310
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
311
|
+
className: 'spec-calendar-coordinate-picker'
|
|
312
|
+
}, monthArray.map(function (mItem) {
|
|
313
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
314
|
+
className: 'spec-calendar-coordinate-picker-col',
|
|
315
|
+
key: mItem
|
|
316
|
+
}, /*#__PURE__*/_react.default.createElement(_CalendarMonthPicker.default, {
|
|
317
|
+
month: mItem,
|
|
318
|
+
year: yearNum,
|
|
319
|
+
headerRender: renderPickerHeader
|
|
320
|
+
}));
|
|
321
|
+
}))));
|
|
322
|
+
};
|
|
323
|
+
var _default = exports.default = CalendarCoordPicker;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _genStyleHook = require("../../theme/utils/genStyleHook");
|
|
8
|
+
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); }
|
|
9
|
+
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; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
11
|
+
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); }
|
|
12
|
+
var CalendarCoordPickerStyleFunc = function CalendarCoordPickerStyleFunc(prefix) {
|
|
13
|
+
var prepareComponentToken = function prepareComponentToken(token) {
|
|
14
|
+
return {
|
|
15
|
+
fontWeight: 400
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
return (0, _genStyleHook.createStyleHook)(prefix, function (token) {
|
|
19
|
+
var prefixCls = ".".concat(prefix);
|
|
20
|
+
return [_defineProperty({}, prefixCls, {
|
|
21
|
+
position: 'relative',
|
|
22
|
+
'.spec-calendar-coordinate-header': {
|
|
23
|
+
padding: "".concat(token.paddingSM, "px ").concat(token.paddingMD, "px"),
|
|
24
|
+
backgroundColor: ' @body-background',
|
|
25
|
+
marginBottom: token.paddingSM
|
|
26
|
+
},
|
|
27
|
+
'.spec-calendar-coordinate-picker__directed-selected': {
|
|
28
|
+
backgroundColor: token.colorPrimary + '!important'
|
|
29
|
+
}
|
|
30
|
+
})];
|
|
31
|
+
}, prepareComponentToken // 当前组件扩展的变量
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
var _default = exports.default = CalendarCoordPickerStyleFunc;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.spec-calendar-coordinate {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
& * {
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
.spec-calendar-coordinate-header {
|
|
8
|
+
display: flex;
|
|
9
|
+
|
|
10
|
+
//padding: @padding-sm @padding-md;
|
|
11
|
+
//background-color: @body-background;
|
|
12
|
+
//margin-bottom: @padding-sm;
|
|
13
|
+
&-year{
|
|
14
|
+
flex: 1;
|
|
15
|
+
text-align: center;
|
|
16
|
+
font-size: 18px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
.spec-calendar-coordinate-picker{
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-wrap: wrap;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.spec-calendar-coordinate-picker-col {
|
|
25
|
+
width: 25%;
|
|
26
|
+
padding: 0 10px;
|
|
27
|
+
user-select: none;
|
|
28
|
+
|
|
29
|
+
.spec-calendar-coordinate-picker__order-selected{
|
|
30
|
+
background-color: #795da3;
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.spec-calendar-coordinate-picker__directed-selected {
|
|
35
|
+
//background-color: @primary-color !important;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FanProvider = exports.FanDefaultConfig = exports.FanContext = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
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); }
|
|
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
|
+
// import type { Locale } from '../locale';
|
|
15
|
+
|
|
16
|
+
// export type LocaleContextProps = Partial<Locale> & { exist?: boolean };
|
|
17
|
+
|
|
18
|
+
// const FanLocaleContext = createContext<LocaleContextProps | undefined>(undefined);
|
|
19
|
+
// const FanLocaleProvider = FanLocaleContext.Provider
|
|
20
|
+
var FanDefaultConfig = exports.FanDefaultConfig = {
|
|
21
|
+
locale: 'zh-cn'
|
|
22
|
+
};
|
|
23
|
+
var FanContext = exports.FanContext = /*#__PURE__*/(0, _react.createContext)(_objectSpread({}, FanDefaultConfig));
|
|
24
|
+
var FanProvider = exports.FanProvider = FanContext.Provider;
|
|
25
|
+
// export { FanLocaleContext, FanLocaleProvider };
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
-
require("./index.less");
|
|
10
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
10
|
var DragBar = function DragBar(props) {
|
|
12
11
|
var direction = props.direction,
|
|
@@ -21,5 +20,4 @@ var DragBar = function DragBar(props) {
|
|
|
21
20
|
onMouseDown: handleMouseDown
|
|
22
21
|
});
|
|
23
22
|
};
|
|
24
|
-
var _default = DragBar;
|
|
25
|
-
exports.default = _default;
|
|
23
|
+
var _default = exports.default = DragBar;
|
|
@@ -10,5 +10,5 @@ interface DragContentProps {
|
|
|
10
10
|
dragMouseMove?: (evt: any, direction?: string) => void;
|
|
11
11
|
dragMouseUp?: (evt: any, direction?: string) => void;
|
|
12
12
|
}
|
|
13
|
-
declare const DragContent: (props: DragContentProps) =>
|
|
13
|
+
declare const DragContent: (props: DragContentProps) => any;
|
|
14
14
|
export default DragContent;
|
package/lib/DragContent/index.js
CHANGED
|
@@ -8,14 +8,15 @@ exports.default = void 0;
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _DragBar = _interopRequireDefault(require("./DragBar"));
|
|
11
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
11
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
function _getRequireWildcardCache(
|
|
13
|
-
function _interopRequireWildcard(
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
14
15
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
16
|
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."); }
|
|
16
17
|
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); }
|
|
17
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
18
|
-
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)
|
|
18
|
+
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; }
|
|
19
|
+
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; } }
|
|
19
20
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
21
|
var DragContent = function DragContent(props) {
|
|
21
22
|
var children = props.children,
|
|
@@ -29,6 +30,11 @@ var DragContent = function DragContent(props) {
|
|
|
29
30
|
dragMouseDown = props.dragMouseDown,
|
|
30
31
|
dragMouseMove = props.dragMouseMove,
|
|
31
32
|
dragMouseUp = props.dragMouseUp;
|
|
33
|
+
var componentName = 'spec-grid-dragContent';
|
|
34
|
+
var _useStyle = (0, _styles.default)(componentName),
|
|
35
|
+
_useStyle2 = _slicedToArray(_useStyle, 2),
|
|
36
|
+
wrapSSR = _useStyle2[0],
|
|
37
|
+
hashId = _useStyle2[1];
|
|
32
38
|
var divRef = (0, _react.useRef)();
|
|
33
39
|
var _useState = (0, _react.useState)(0),
|
|
34
40
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -46,6 +52,7 @@ var DragContent = function DragContent(props) {
|
|
|
46
52
|
var parent = divRef.current;
|
|
47
53
|
var nextNode = parent.nextSibling; //相邻兄弟节点
|
|
48
54
|
var prevNode = parent.previousSibling; //相邻兄弟节点
|
|
55
|
+
|
|
49
56
|
//获取前后兄弟节点宽高
|
|
50
57
|
var prevWidth = 0,
|
|
51
58
|
prevHeight = 0,
|
|
@@ -65,6 +72,7 @@ var DragContent = function DragContent(props) {
|
|
|
65
72
|
var initHeight = parent.offsetHeight;
|
|
66
73
|
// let initLeft = parent.offsetLeft;
|
|
67
74
|
// let initTop = parent.offsetTop;
|
|
75
|
+
|
|
68
76
|
var startX = e.clientX;
|
|
69
77
|
var startY = e.clientY;
|
|
70
78
|
document.onmousemove = function (e) {
|
|
@@ -72,10 +80,16 @@ var DragContent = function DragContent(props) {
|
|
|
72
80
|
var currY = e.clientY;
|
|
73
81
|
var disY = currY - startY;
|
|
74
82
|
var disX = currX - startX;
|
|
83
|
+
// @ts-ignore
|
|
75
84
|
var hasT = /top/.test(direction);
|
|
85
|
+
// @ts-ignore
|
|
76
86
|
var hasB = /bottom/.test(direction);
|
|
87
|
+
// @ts-ignore
|
|
77
88
|
var hasL = /left/.test(direction);
|
|
89
|
+
// @ts-ignore
|
|
78
90
|
var hasR = /right/.test(direction);
|
|
91
|
+
// @ts-ignore
|
|
92
|
+
|
|
79
93
|
if (hasL || hasR) {
|
|
80
94
|
var newWidth = initWidth + (hasL ? -disX : hasR ? disX : 0);
|
|
81
95
|
var width = newWidth > 0 ? newWidth : 0;
|
|
@@ -137,9 +151,9 @@ var DragContent = function DragContent(props) {
|
|
|
137
151
|
if (dragMouseUp) dragMouseUp(e, direction);
|
|
138
152
|
};
|
|
139
153
|
};
|
|
140
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
154
|
+
return wrapSSR( /*#__PURE__*/_react.default.createElement("div", {
|
|
141
155
|
ref: divRef,
|
|
142
|
-
className: (0, _classnames.default)(
|
|
156
|
+
className: (0, _classnames.default)(componentName, hashId, className),
|
|
143
157
|
style: style
|
|
144
158
|
}, children, direction && direction.map(function (item, idx) {
|
|
145
159
|
return /*#__PURE__*/_react.default.createElement(_DragBar.default, {
|
|
@@ -147,7 +161,6 @@ var DragContent = function DragContent(props) {
|
|
|
147
161
|
direction: item,
|
|
148
162
|
onMouseDown: onmousedown
|
|
149
163
|
});
|
|
150
|
-
}));
|
|
164
|
+
})));
|
|
151
165
|
};
|
|
152
|
-
var _default = DragContent;
|
|
153
|
-
exports.default = _default;
|
|
166
|
+
var _default = exports.default = DragContent;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _genStyleHook = require("../../theme/utils/genStyleHook");
|
|
8
|
+
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); }
|
|
9
|
+
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; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
11
|
+
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); }
|
|
12
|
+
var DragContentStyleFunc = function DragContentStyleFunc(prefix) {
|
|
13
|
+
var prepareComponentToken = function prepareComponentToken(token) {
|
|
14
|
+
return {
|
|
15
|
+
fontWeight: 400
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
return (0, _genStyleHook.createStyleHook)(prefix, function (token) {
|
|
19
|
+
var prefixCls = ".".concat(prefix);
|
|
20
|
+
return [_defineProperty({}, prefixCls, {
|
|
21
|
+
position: 'relative',
|
|
22
|
+
'.spec-grid-dragbar-left-horizontal': {
|
|
23
|
+
height: '100%',
|
|
24
|
+
width: '5px',
|
|
25
|
+
position: 'absolute',
|
|
26
|
+
left: 0,
|
|
27
|
+
top: 0,
|
|
28
|
+
cursor: ' col-resize'
|
|
29
|
+
},
|
|
30
|
+
'.spec-grid-dragbar-right-horizontal': {
|
|
31
|
+
height: '100%',
|
|
32
|
+
width: '5px',
|
|
33
|
+
position: 'absolute',
|
|
34
|
+
right: 0,
|
|
35
|
+
top: 0,
|
|
36
|
+
cursor: ' col-resize'
|
|
37
|
+
},
|
|
38
|
+
'.spec-grid-dragbar-up-vertical': {
|
|
39
|
+
height: '5px',
|
|
40
|
+
width: '100%',
|
|
41
|
+
position: 'absolute',
|
|
42
|
+
left: 0,
|
|
43
|
+
top: 0,
|
|
44
|
+
cursor: ' col-resize'
|
|
45
|
+
},
|
|
46
|
+
'.spec-grid-dragbar-down-vertical': {
|
|
47
|
+
height: '5px',
|
|
48
|
+
width: '100%',
|
|
49
|
+
position: 'absolute',
|
|
50
|
+
left: 0,
|
|
51
|
+
bottom: 0,
|
|
52
|
+
cursor: ' col-resize'
|
|
53
|
+
}
|
|
54
|
+
})];
|
|
55
|
+
}, prepareComponentToken // 当前组件扩展的变量
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
var _default = exports.default = DragContentStyleFunc;
|