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
|
@@ -5,33 +5,41 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.DraggableModalInner = void 0;
|
|
8
|
-
require("
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var React = _react;
|
|
10
|
+
var _antd = require("antd");
|
|
12
11
|
var _ResizeHandle = require("./ResizeHandle");
|
|
13
12
|
var _useDrag = require("./useDrag");
|
|
14
13
|
var _usePrevious = require("./usePrevious");
|
|
15
14
|
var _useResize = require("./useResize");
|
|
16
|
-
|
|
17
|
-
function
|
|
18
|
-
function
|
|
15
|
+
var _excluded = ["id", "modalState", "dispatch", "visible", "children", "title", "initialWidth", "initialHeight"];
|
|
16
|
+
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); }
|
|
17
|
+
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; }
|
|
18
|
+
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); }
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
|
+
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; }
|
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
23
|
+
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); }
|
|
24
|
+
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; }
|
|
25
|
+
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; }
|
|
19
26
|
var modalStyle = {
|
|
20
27
|
margin: 0,
|
|
21
28
|
paddingBottom: 0,
|
|
22
29
|
pointerEvents: 'auto'
|
|
23
30
|
};
|
|
24
|
-
function DraggableModalInnerNonMemo(
|
|
25
|
-
var id =
|
|
26
|
-
modalState =
|
|
27
|
-
dispatch =
|
|
28
|
-
visible =
|
|
29
|
-
children =
|
|
30
|
-
title =
|
|
31
|
-
initialWidth =
|
|
32
|
-
initialHeight =
|
|
33
|
-
otherProps = (
|
|
34
|
-
|
|
31
|
+
function DraggableModalInnerNonMemo(_ref) {
|
|
32
|
+
var id = _ref.id,
|
|
33
|
+
modalState = _ref.modalState,
|
|
34
|
+
dispatch = _ref.dispatch,
|
|
35
|
+
visible = _ref.visible,
|
|
36
|
+
children = _ref.children,
|
|
37
|
+
title = _ref.title,
|
|
38
|
+
initialWidth = _ref.initialWidth,
|
|
39
|
+
initialHeight = _ref.initialHeight,
|
|
40
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
41
|
+
// Call on mount and unmount.
|
|
42
|
+
(0, _react.useEffect)(function () {
|
|
35
43
|
dispatch({
|
|
36
44
|
type: 'mount',
|
|
37
45
|
id: id,
|
|
@@ -47,9 +55,10 @@ function DraggableModalInnerNonMemo(_a) {
|
|
|
47
55
|
});
|
|
48
56
|
};
|
|
49
57
|
}, [dispatch, id, initialWidth, initialHeight]);
|
|
58
|
+
|
|
50
59
|
// Bring this to the front if it's been opened with props.
|
|
51
60
|
var visiblePrevious = (0, _usePrevious.usePrevious)(visible);
|
|
52
|
-
(0,
|
|
61
|
+
(0, _react.useEffect)(function () {
|
|
53
62
|
if (visible !== visiblePrevious) {
|
|
54
63
|
if (visible) {
|
|
55
64
|
dispatch({
|
|
@@ -69,41 +78,41 @@ function DraggableModalInnerNonMemo(_a) {
|
|
|
69
78
|
y = modalState.y,
|
|
70
79
|
width = modalState.width,
|
|
71
80
|
height = modalState.height;
|
|
72
|
-
var style = (0,
|
|
73
|
-
return
|
|
81
|
+
var style = (0, _react.useMemo)(function () {
|
|
82
|
+
return _objectSpread(_objectSpread({}, modalStyle), {}, {
|
|
74
83
|
top: y,
|
|
75
84
|
left: x,
|
|
76
85
|
height: height
|
|
77
86
|
});
|
|
78
87
|
}, [y, x, height]);
|
|
79
|
-
var onFocus = (0,
|
|
88
|
+
var onFocus = (0, _react.useCallback)(function () {
|
|
80
89
|
return dispatch({
|
|
81
90
|
type: 'focus',
|
|
82
91
|
id: id
|
|
83
92
|
});
|
|
84
93
|
}, [id, dispatch]);
|
|
85
|
-
var onDragWithID = (0,
|
|
86
|
-
return dispatch(
|
|
94
|
+
var onDragWithID = (0, _react.useCallback)(function (args) {
|
|
95
|
+
return dispatch(_objectSpread({
|
|
87
96
|
type: 'drag',
|
|
88
97
|
id: id
|
|
89
98
|
}, args));
|
|
90
99
|
}, [dispatch, id]);
|
|
91
|
-
var onResizeWithID = (0,
|
|
92
|
-
return dispatch(
|
|
100
|
+
var onResizeWithID = (0, _react.useCallback)(function (args) {
|
|
101
|
+
return dispatch(_objectSpread({
|
|
93
102
|
type: 'resize',
|
|
94
103
|
id: id
|
|
95
104
|
}, args));
|
|
96
105
|
}, [dispatch, id]);
|
|
97
106
|
var onMouseDrag = (0, _useDrag.useDrag)(x, y, onDragWithID);
|
|
98
107
|
var onMouseResize = (0, _useResize.useResize)(x, y, width, height, onResizeWithID);
|
|
99
|
-
var titleElement = (0,
|
|
108
|
+
var titleElement = (0, _react.useMemo)(function () {
|
|
100
109
|
return /*#__PURE__*/React.createElement("div", {
|
|
101
110
|
className: "ant-design-draggable-modal-title",
|
|
102
111
|
onMouseDown: onMouseDrag,
|
|
103
112
|
onClick: onFocus
|
|
104
113
|
}, title);
|
|
105
114
|
}, [onMouseDrag, onFocus, title]);
|
|
106
|
-
return /*#__PURE__*/React.createElement(
|
|
115
|
+
return /*#__PURE__*/React.createElement(_antd.Modal, _extends({
|
|
107
116
|
wrapClassName: "ant-design-draggable-modal",
|
|
108
117
|
style: style,
|
|
109
118
|
width: width,
|
|
@@ -117,8 +126,7 @@ function DraggableModalInnerNonMemo(_a) {
|
|
|
117
126
|
onMouseDown: onMouseResize
|
|
118
127
|
}));
|
|
119
128
|
}
|
|
120
|
-
var DraggableModalInner = /*#__PURE__*/(0,
|
|
121
|
-
exports.DraggableModalInner = DraggableModalInner;
|
|
129
|
+
var DraggableModalInner = exports.DraggableModalInner = /*#__PURE__*/(0, _react.memo)(DraggableModalInnerNonMemo);
|
|
122
130
|
if (process.env.NODE_ENV !== 'production') {
|
|
123
131
|
DraggableModalInner.displayName = 'DraggableModalInner';
|
|
124
132
|
}
|
|
@@ -4,26 +4,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DraggableModalProvider = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var React = _react;
|
|
8
9
|
var _DraggableModalContext = require("./DraggableModalContext");
|
|
9
10
|
var _getWindowSize = require("./getWindowSize");
|
|
10
11
|
var _draggableModalReducer = require("./draggableModalReducer");
|
|
11
|
-
function _getRequireWildcardCache(
|
|
12
|
-
function _interopRequireWildcard(
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
13
14
|
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); }
|
|
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
|
-
var DraggableModalProvider = function DraggableModalProvider(_ref) {
|
|
21
|
+
var DraggableModalProvider = exports.DraggableModalProvider = function DraggableModalProvider(_ref) {
|
|
21
22
|
var children = _ref.children;
|
|
22
|
-
var _useReducer = (0,
|
|
23
|
+
var _useReducer = (0, _react.useReducer)(_draggableModalReducer.draggableModalReducer, _draggableModalReducer.initialModalsState),
|
|
23
24
|
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
24
25
|
state = _useReducer2[0],
|
|
25
26
|
dispatch = _useReducer2[1];
|
|
26
|
-
(0,
|
|
27
|
+
(0, _react.useEffect)(function () {
|
|
27
28
|
var onResize = function onResize() {
|
|
28
29
|
return dispatch({
|
|
29
30
|
type: 'windowResize',
|
|
@@ -44,5 +45,4 @@ var DraggableModalProvider = function DraggableModalProvider(_ref) {
|
|
|
44
45
|
dispatch: dispatch
|
|
45
46
|
}
|
|
46
47
|
}, children);
|
|
47
|
-
};
|
|
48
|
-
exports.DraggableModalProvider = DraggableModalProvider;
|
|
48
|
+
};
|
|
@@ -7,5 +7,5 @@ interface StandardDragModalProps {
|
|
|
7
7
|
initialHeight?: number;
|
|
8
8
|
[k: string]: any;
|
|
9
9
|
}
|
|
10
|
-
declare const StandardDragModal: (props: StandardDragModalProps) => JSX.Element;
|
|
10
|
+
declare const StandardDragModal: (props: StandardDragModalProps) => React.JSX.Element;
|
|
11
11
|
export default StandardDragModal;
|
|
@@ -4,29 +4,31 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _tslib = require("tslib");
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
8
|
var _index = require("./index");
|
|
10
9
|
require("./index.less");
|
|
10
|
+
var _excluded = ["visible", "onCancel", "onSubmit", "children"];
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
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; }
|
|
12
15
|
var StandardDragModal = function StandardDragModal(props) {
|
|
13
16
|
var visible = props.visible,
|
|
14
17
|
onCancel = props.onCancel,
|
|
15
18
|
onSubmit = props.onSubmit,
|
|
16
19
|
children = props.children,
|
|
17
|
-
others = (
|
|
20
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
18
21
|
var handleOk = function handleOk() {
|
|
19
22
|
onSubmit && onSubmit();
|
|
20
23
|
};
|
|
21
24
|
var handleCancel = function handleCancel() {
|
|
22
25
|
onCancel && onCancel();
|
|
23
26
|
};
|
|
24
|
-
return /*#__PURE__*/_react.default.createElement(_index.DraggableModalProvider, null, /*#__PURE__*/_react.default.createElement(_index.DraggableModal,
|
|
27
|
+
return /*#__PURE__*/_react.default.createElement(_index.DraggableModalProvider, null, /*#__PURE__*/_react.default.createElement(_index.DraggableModal, _extends({
|
|
25
28
|
visible: visible,
|
|
26
29
|
onOk: handleOk,
|
|
27
30
|
onCancel: handleCancel,
|
|
28
31
|
zIndex: 1001
|
|
29
32
|
}, others), children));
|
|
30
33
|
};
|
|
31
|
-
var _default = StandardDragModal;
|
|
32
|
-
exports.default = _default;
|
|
34
|
+
var _default = exports.default = StandardDragModal;
|
|
@@ -6,13 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.ResizeHandle = void 0;
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
function _getRequireWildcardCache(
|
|
10
|
-
function _interopRequireWildcard(
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
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); }
|
|
12
|
+
var ResizeHandle = exports.ResizeHandle = function ResizeHandle(props) {
|
|
13
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
13
14
|
className: "ant-design-draggable-modal-resize-handle"
|
|
14
15
|
}, props), /*#__PURE__*/React.createElement("div", {
|
|
15
16
|
className: "ant-design-draggable-modal-resize-handle-inner"
|
|
16
17
|
}));
|
|
17
|
-
};
|
|
18
|
-
exports.ResizeHandle = ResizeHandle;
|
|
18
|
+
};
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.clamp = void 0;
|
|
7
|
-
var clamp = function clamp(min, max, value) {
|
|
7
|
+
var clamp = exports.clamp = function clamp(min, max, value) {
|
|
8
8
|
return Math.max(min, Math.min(max, value));
|
|
9
|
-
};
|
|
10
|
-
exports.clamp = clamp;
|
|
9
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ModalID = string;
|
|
2
2
|
export interface ModalState {
|
|
3
3
|
x: number;
|
|
4
4
|
y: number;
|
|
@@ -19,7 +19,7 @@ export interface ModalsState {
|
|
|
19
19
|
}
|
|
20
20
|
export declare const initialModalsState: ModalsState;
|
|
21
21
|
export declare const initialModalState: ModalState;
|
|
22
|
-
export
|
|
22
|
+
export type Action = {
|
|
23
23
|
type: 'show';
|
|
24
24
|
id: ModalID;
|
|
25
25
|
} | {
|
|
@@ -60,7 +60,7 @@ export declare type Action = {
|
|
|
60
60
|
export declare const getModalState: ({ state, id, initialWidth, initialHeight, }: {
|
|
61
61
|
state: ModalsState;
|
|
62
62
|
id: ModalID;
|
|
63
|
-
initialWidth?: number;
|
|
64
|
-
initialHeight?: number;
|
|
63
|
+
initialWidth?: number | undefined;
|
|
64
|
+
initialHeight?: number | undefined;
|
|
65
65
|
}) => ModalState;
|
|
66
66
|
export declare const draggableModalReducer: (state: ModalsState, action: Action) => ModalsState;
|
|
@@ -7,27 +7,35 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.initialModalsState = exports.initialModalState = exports.getModalState = exports.draggableModalReducer = void 0;
|
|
8
8
|
var _getWindowSize = require("./getWindowSize");
|
|
9
9
|
var _clamp = require("./clamp");
|
|
10
|
+
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; }
|
|
11
|
+
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; }
|
|
10
12
|
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; }
|
|
11
|
-
function _toPropertyKey(
|
|
12
|
-
function _toPrimitive(
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
14
|
+
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); }
|
|
13
15
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
14
16
|
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."); }
|
|
15
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); }
|
|
16
18
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
17
19
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
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++)
|
|
20
|
+
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
21
|
var mapObject = function mapObject(o, f) {
|
|
20
22
|
return Object.assign.apply(Object, [{}].concat(_toConsumableArray(Object.keys(o).map(function (k) {
|
|
21
23
|
return _defineProperty({}, k, f(o[k]));
|
|
22
24
|
}))));
|
|
23
25
|
};
|
|
24
|
-
|
|
26
|
+
|
|
27
|
+
// ID for a specific modal.
|
|
28
|
+
|
|
29
|
+
// State for a specific modal.
|
|
30
|
+
|
|
31
|
+
// State of all modals.
|
|
32
|
+
|
|
33
|
+
var initialModalsState = exports.initialModalsState = {
|
|
25
34
|
maxZIndex: 0,
|
|
26
35
|
windowSize: (0, _getWindowSize.getWindowSize)(),
|
|
27
36
|
modals: {}
|
|
28
37
|
};
|
|
29
|
-
exports.
|
|
30
|
-
var initialModalState = {
|
|
38
|
+
var initialModalState = exports.initialModalState = {
|
|
31
39
|
x: 0,
|
|
32
40
|
y: 0,
|
|
33
41
|
width: 800,
|
|
@@ -35,18 +43,17 @@ var initialModalState = {
|
|
|
35
43
|
zIndex: 0,
|
|
36
44
|
visible: false
|
|
37
45
|
};
|
|
38
|
-
exports.initialModalState = initialModalState;
|
|
39
46
|
var getInitialModalState = function getInitialModalState(_ref2) {
|
|
40
47
|
var _ref2$initialWidth = _ref2.initialWidth,
|
|
41
48
|
initialWidth = _ref2$initialWidth === void 0 ? initialModalState.width : _ref2$initialWidth,
|
|
42
49
|
_ref2$initialHeight = _ref2.initialHeight,
|
|
43
50
|
initialHeight = _ref2$initialHeight === void 0 ? initialModalState.height : _ref2$initialHeight;
|
|
44
|
-
return
|
|
51
|
+
return _objectSpread(_objectSpread({}, initialModalState), {}, {
|
|
45
52
|
width: initialWidth,
|
|
46
53
|
height: initialHeight
|
|
47
54
|
});
|
|
48
55
|
};
|
|
49
|
-
var getModalState = function getModalState(_ref3) {
|
|
56
|
+
var getModalState = exports.getModalState = function getModalState(_ref3) {
|
|
50
57
|
var state = _ref3.state,
|
|
51
58
|
id = _ref3.id,
|
|
52
59
|
initialWidth = _ref3.initialWidth,
|
|
@@ -56,7 +63,6 @@ var getModalState = function getModalState(_ref3) {
|
|
|
56
63
|
initialHeight: initialHeight
|
|
57
64
|
});
|
|
58
65
|
};
|
|
59
|
-
exports.getModalState = getModalState;
|
|
60
66
|
var getNextZIndex = function getNextZIndex(state, id) {
|
|
61
67
|
return getModalState({
|
|
62
68
|
state: state,
|
|
@@ -83,20 +89,20 @@ var clampResize = function clampResize(windowWidth, windowHeight, x, y, width, h
|
|
|
83
89
|
height: clampedHeight
|
|
84
90
|
};
|
|
85
91
|
};
|
|
86
|
-
var draggableModalReducer = function draggableModalReducer(state, action) {
|
|
92
|
+
var draggableModalReducer = exports.draggableModalReducer = function draggableModalReducer(state, action) {
|
|
87
93
|
switch (action.type) {
|
|
88
94
|
case 'resize':
|
|
89
95
|
var size = clampResize(state.windowSize.width, state.windowSize.height, action.x, action.y, action.width, action.height);
|
|
90
|
-
return
|
|
96
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
91
97
|
maxZIndex: getNextZIndex(state, action.id),
|
|
92
|
-
modals:
|
|
98
|
+
modals: _objectSpread(_objectSpread({}, state.modals), {}, _defineProperty({}, action.id, _objectSpread(_objectSpread(_objectSpread({}, state.modals[action.id]), size), {}, {
|
|
93
99
|
zIndex: getNextZIndex(state, action.id)
|
|
94
100
|
})))
|
|
95
101
|
});
|
|
96
102
|
case 'drag':
|
|
97
|
-
return
|
|
103
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
98
104
|
maxZIndex: getNextZIndex(state, action.id),
|
|
99
|
-
modals:
|
|
105
|
+
modals: _objectSpread(_objectSpread({}, state.modals), {}, _defineProperty({}, action.id, _objectSpread(_objectSpread(_objectSpread({}, state.modals[action.id]), clampDrag(state.windowSize.width, state.windowSize.height, action.x, action.y, state.modals[action.id].width, state.modals[action.id].height)), {}, {
|
|
100
106
|
zIndex: getNextZIndex(state, action.id)
|
|
101
107
|
})))
|
|
102
108
|
});
|
|
@@ -107,9 +113,9 @@ var draggableModalReducer = function draggableModalReducer(state, action) {
|
|
|
107
113
|
var centerY = state.windowSize.height / 2 - _modalState.height / 2;
|
|
108
114
|
var position = clampDrag(state.windowSize.width, state.windowSize.height, centerX, centerY, _modalState.width, _modalState.height);
|
|
109
115
|
var _size = clampResize(state.windowSize.width, state.windowSize.height, position.x, position.y, _modalState.width, _modalState.height);
|
|
110
|
-
return
|
|
116
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
111
117
|
maxZIndex: state.maxZIndex + 1,
|
|
112
|
-
modals:
|
|
118
|
+
modals: _objectSpread(_objectSpread({}, state.modals), {}, _defineProperty({}, action.id, _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, _modalState), position), _size), {}, {
|
|
113
119
|
zIndex: state.maxZIndex + 1,
|
|
114
120
|
visible: true
|
|
115
121
|
})))
|
|
@@ -117,39 +123,39 @@ var draggableModalReducer = function draggableModalReducer(state, action) {
|
|
|
117
123
|
}
|
|
118
124
|
case 'focus':
|
|
119
125
|
var modalState = state.modals[action.id];
|
|
120
|
-
return
|
|
126
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
121
127
|
maxZIndex: state.maxZIndex + 1,
|
|
122
|
-
modals:
|
|
128
|
+
modals: _objectSpread(_objectSpread({}, state.modals), {}, _defineProperty({}, action.id, _objectSpread(_objectSpread({}, modalState), {}, {
|
|
123
129
|
zIndex: state.maxZIndex + 1
|
|
124
130
|
})))
|
|
125
131
|
});
|
|
126
132
|
case 'hide':
|
|
127
133
|
{
|
|
128
134
|
var _modalState2 = state.modals[action.id];
|
|
129
|
-
return
|
|
130
|
-
modals:
|
|
135
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
136
|
+
modals: _objectSpread(_objectSpread({}, state.modals), {}, _defineProperty({}, action.id, _objectSpread(_objectSpread({}, _modalState2), {}, {
|
|
131
137
|
visible: false
|
|
132
138
|
})))
|
|
133
139
|
});
|
|
134
140
|
}
|
|
135
141
|
case 'mount':
|
|
136
142
|
var initialState = getInitialModalState(action.intialState);
|
|
137
|
-
return
|
|
143
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
138
144
|
maxZIndex: state.maxZIndex + 1,
|
|
139
|
-
modals:
|
|
145
|
+
modals: _objectSpread(_objectSpread({}, state.modals), {}, _defineProperty({}, action.id, _objectSpread(_objectSpread({}, initialState), {}, {
|
|
140
146
|
x: state.windowSize.width / 2 - initialState.width / 2,
|
|
141
147
|
y: state.windowSize.height / 2 - initialState.height / 2,
|
|
142
148
|
zIndex: state.maxZIndex + 1
|
|
143
149
|
})))
|
|
144
150
|
});
|
|
145
151
|
case 'unmount':
|
|
146
|
-
var modalsClone =
|
|
152
|
+
var modalsClone = _objectSpread({}, state.modals);
|
|
147
153
|
delete modalsClone[action.id];
|
|
148
|
-
return
|
|
154
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
149
155
|
modals: modalsClone
|
|
150
156
|
});
|
|
151
157
|
case 'windowResize':
|
|
152
|
-
return
|
|
158
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
153
159
|
windowSize: action.size,
|
|
154
160
|
modals: mapObject(state.modals, function (modalState) {
|
|
155
161
|
if (!modalState.visible) {
|
|
@@ -157,11 +163,10 @@ var draggableModalReducer = function draggableModalReducer(state, action) {
|
|
|
157
163
|
}
|
|
158
164
|
var position = clampDrag(state.windowSize.width, state.windowSize.height, modalState.x, modalState.y, modalState.width, modalState.height);
|
|
159
165
|
var size = clampResize(state.windowSize.width, state.windowSize.height, position.x, position.y, modalState.width, modalState.height);
|
|
160
|
-
return
|
|
166
|
+
return _objectSpread(_objectSpread(_objectSpread({}, modalState), position), size);
|
|
161
167
|
})
|
|
162
168
|
});
|
|
163
169
|
default:
|
|
164
170
|
throw new Error();
|
|
165
171
|
}
|
|
166
|
-
};
|
|
167
|
-
exports.draggableModalReducer = draggableModalReducer;
|
|
172
|
+
};
|
|
@@ -4,10 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getWindowSize = void 0;
|
|
7
|
-
var getWindowSize = function getWindowSize() {
|
|
7
|
+
var getWindowSize = exports.getWindowSize = function getWindowSize() {
|
|
8
8
|
return {
|
|
9
9
|
width: window.innerWidth || 0,
|
|
10
10
|
height: window.innerHeight || 0
|
|
11
11
|
};
|
|
12
|
-
};
|
|
13
|
-
exports.getWindowSize = getWindowSize;
|
|
12
|
+
};
|
|
@@ -8,10 +8,10 @@ var _react = require("react");
|
|
|
8
8
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
9
|
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."); }
|
|
10
10
|
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); }
|
|
11
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
12
|
-
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)
|
|
11
|
+
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; }
|
|
12
|
+
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; } }
|
|
13
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
var useDrag = function useDrag(x, y, onDrag) {
|
|
14
|
+
var useDrag = exports.useDrag = function useDrag(x, y, onDrag) {
|
|
15
15
|
var _useState = (0, _react.useState)(false),
|
|
16
16
|
_useState2 = _slicedToArray(_useState, 2),
|
|
17
17
|
dragging = _useState2[0],
|
|
@@ -69,5 +69,4 @@ var useDrag = function useDrag(x, y, onDrag) {
|
|
|
69
69
|
};
|
|
70
70
|
}, [setDragging]);
|
|
71
71
|
return onMouseDown;
|
|
72
|
-
};
|
|
73
|
-
exports.useDrag = useDrag;
|
|
72
|
+
};
|
|
@@ -5,11 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.usePrevious = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
var usePrevious = function usePrevious(value) {
|
|
8
|
+
var usePrevious = exports.usePrevious = function usePrevious(value) {
|
|
9
9
|
var ref = (0, _react.useRef)(value);
|
|
10
10
|
(0, _react.useEffect)(function () {
|
|
11
11
|
ref.current = value;
|
|
12
12
|
}, [value]);
|
|
13
13
|
return ref.current;
|
|
14
|
-
};
|
|
15
|
-
exports.usePrevious = usePrevious;
|
|
14
|
+
};
|
|
@@ -8,10 +8,10 @@ var _react = require("react");
|
|
|
8
8
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
9
|
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."); }
|
|
10
10
|
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); }
|
|
11
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
12
|
-
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)
|
|
11
|
+
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; }
|
|
12
|
+
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; } }
|
|
13
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
var useResize = function useResize(x, y, width, height, onResize) {
|
|
14
|
+
var useResize = exports.useResize = function useResize(x, y, width, height, onResize) {
|
|
15
15
|
var _useState = (0, _react.useState)(false),
|
|
16
16
|
_useState2 = _slicedToArray(_useState, 2),
|
|
17
17
|
dragging = _useState2[0],
|
|
@@ -77,5 +77,4 @@ var useResize = function useResize(x, y, width, height, onResize) {
|
|
|
77
77
|
};
|
|
78
78
|
}, [setDragging]);
|
|
79
79
|
return onMouseDown;
|
|
80
|
-
};
|
|
81
|
-
exports.useResize = useResize;
|
|
80
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FieldComponentProps } from '../FormComp/FieldComponent';
|
|
3
|
-
import { ButtonGroupOptionsProps } from '../ButtonGroup/
|
|
3
|
+
import { ButtonGroupOptionsProps } from '../ButtonGroup/';
|
|
4
4
|
import './style/index.less';
|
|
5
5
|
export interface StandardFilterProps {
|
|
6
6
|
buttonGroup?: ButtonGroupOptionsProps[];
|
|
@@ -17,21 +17,12 @@ export interface StandardFilterProps {
|
|
|
17
17
|
min?: number;
|
|
18
18
|
codes?: any[];
|
|
19
19
|
permissionCodes?: string[];
|
|
20
|
+
formLayout?: 'inline' | 'horizontal' | 'vertical';
|
|
21
|
+
gridLayout?: 'inline' | 'horizontal';
|
|
22
|
+
colon?: boolean;
|
|
23
|
+
dateFormatter?: 'dayjs' | 'string';
|
|
24
|
+
itemGroupConfig?: object;
|
|
25
|
+
[k: string]: any;
|
|
20
26
|
}
|
|
21
|
-
declare
|
|
22
|
-
static getDerivedStateFromProps(nextProps: StandardFilterProps): {
|
|
23
|
-
reFormItemGroup: FieldComponentProps[];
|
|
24
|
-
};
|
|
25
|
-
private filterFormRef;
|
|
26
|
-
constructor(props: StandardFilterProps);
|
|
27
|
-
componentDidMount(): void;
|
|
28
|
-
componentDidUpdate(prevProps: StandardFilterProps): void;
|
|
29
|
-
updateFormFields: (newVal?: any, force?: boolean) => void;
|
|
30
|
-
forceUpdateForm: () => void;
|
|
31
|
-
handleSearch: (values: object) => void;
|
|
32
|
-
handleReset: () => void;
|
|
33
|
-
itemIsHide: (isHide: any) => any;
|
|
34
|
-
renderFormItemGroup: () => any;
|
|
35
|
-
render(): JSX.Element;
|
|
36
|
-
}
|
|
27
|
+
declare const StandardFilter: React.ForwardRefExoticComponent<Omit<StandardFilterProps, "ref"> & React.RefAttributes<unknown>>;
|
|
37
28
|
export default StandardFilter;
|