@zat-design/sisyphus-react 3.0.16-beta.2 → 3.1.4
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/README.md +7 -7
- package/dist/index.esm.css +1556 -933
- package/es/ProAction/index.d.ts +7 -0
- package/es/ProAction/index.js +220 -0
- package/es/ProAction/index.less +7 -0
- package/es/ProAction/propsType.d.ts +38 -0
- package/es/ProConfigProvider/index.d.ts +5 -4
- package/es/ProConfigProvider/index.js +9 -5
- package/es/ProDownload/index.d.ts +4 -2
- package/es/ProDownload/index.js +71 -58
- package/es/ProDownload/propsType.d.ts +18 -6
- package/es/ProDownload/style/index.less +7 -0
- package/es/ProDownload/utils.d.ts +55 -0
- package/es/ProDownload/{DownloadHelper.js → utils.js} +96 -74
- package/es/ProDrawerForm/components/ProDrawer/index.js +53 -42
- package/es/ProDrawerForm/components/ProModal/index.js +49 -30
- package/es/ProDrawerForm/index.js +43 -19
- package/es/ProDrawerForm/propsType.d.ts +7 -3
- package/es/ProDrawerForm/style/index.less +33 -23
- package/es/ProEditLabel/components/RenderProForm.js +25 -19
- package/es/ProEditLabel/index.js +23 -16
- package/es/ProEditLabel/propsType.d.ts +3 -3
- package/es/ProEditLabel/style/index.less +10 -12
- package/es/ProEditTable/components/ActionButton/index.d.ts +1 -2
- package/es/ProEditTable/components/ActionButton/index.js +83 -45
- package/es/ProEditTable/components/DndWrapper/index.js +44 -32
- package/es/ProEditTable/components/RenderField/index.d.ts +1 -2
- package/es/ProEditTable/components/RenderField/index.js +158 -134
- package/es/ProEditTable/components/RenderToolbar/index.d.ts +1 -2
- package/es/ProEditTable/components/RenderToolbar/index.js +42 -31
- package/es/ProEditTable/components/Summary/index.d.ts +1 -2
- package/es/ProEditTable/components/Summary/index.js +21 -14
- package/es/ProEditTable/components/Validator/index.d.ts +3 -3
- package/es/ProEditTable/components/Validator/index.js +19 -15
- package/es/ProEditTable/index.js +126 -69
- package/es/ProEditTable/propsType.d.ts +47 -14
- package/es/ProEditTable/style/index.less +143 -53
- package/es/ProEditTable/utils/config.d.ts +2 -3
- package/es/ProEditTable/utils/config.js +53 -40
- package/es/ProEditTable/utils/index.d.ts +1 -2
- package/es/ProEditTable/utils/index.js +97 -82
- package/es/ProEditTable/utils/transform.d.ts +2 -2
- package/es/ProEditTable/utils/transform.js +1 -1
- package/es/ProEnum/components/Tag.d.ts +7 -0
- package/es/ProEnum/components/Tag.js +40 -0
- package/es/ProEnum/hooks/useEnum.d.ts +21 -0
- package/es/ProEnum/{useEnum.js → hooks/useEnum.js} +15 -19
- package/es/ProEnum/hooks/useEnumRequest.d.ts +4 -0
- package/es/ProEnum/hooks/useEnumRequest.js +287 -0
- package/es/ProEnum/index.d.ts +4 -4
- package/es/ProEnum/index.js +85 -40
- package/es/ProEnum/propsType.d.ts +17 -6
- package/es/ProEnum/propsType.js +6 -0
- package/es/ProEnum/style/index.less +23 -0
- package/es/ProEnum/utils/eventCenter.d.ts +1 -0
- package/es/ProEnum/utils/eventCenter.js +39 -0
- package/es/ProEnum/utils/getEnumLabel.d.ts +2 -0
- package/es/ProEnum/utils/getEnumLabel.js +81 -0
- package/{lib/ProEnum/utils.d.ts → es/ProEnum/utils/index.d.ts} +1 -1
- package/es/ProForm/components/Container.js +14 -10
- package/es/ProForm/components/FormFooter/index.d.ts +1 -0
- package/es/ProForm/components/FormFooter/index.js +50 -14
- package/es/ProForm/components/FormFooter/propsType.d.ts +3 -1
- package/es/ProForm/components/base/Checkbox/index.d.ts +1 -1
- package/es/ProForm/components/base/Checkbox/index.js +18 -13
- package/es/ProForm/components/base/DatePicker/index.d.ts +6 -5
- package/es/ProForm/components/base/DatePicker/index.js +16 -15
- package/es/ProForm/components/base/Input/index.d.ts +1 -2
- package/es/ProForm/components/base/Input/index.js +9 -7
- package/es/ProForm/components/base/InputNumber/index.d.ts +1 -1
- package/es/ProForm/components/base/InputNumber/index.js +96 -46
- package/es/ProForm/components/base/ProCascader/index.d.ts +14 -0
- package/es/ProForm/components/base/ProCascader/index.js +72 -0
- package/es/ProForm/components/base/Radio/index.js +13 -11
- package/es/ProForm/components/base/RangePicker/index.d.ts +4 -3
- package/es/ProForm/components/base/RangePicker/index.js +16 -11
- package/es/ProForm/components/base/Select/index.d.ts +1 -0
- package/es/ProForm/components/base/Select/index.js +18 -11
- package/es/ProForm/components/base/Switch/index.js +10 -7
- package/es/ProForm/components/base/SwitchCheckbox/index.js +25 -17
- package/es/ProForm/components/base/SwitchCheckbox/style/index.less +2 -3
- package/es/ProForm/components/base/TextArea/index.d.ts +2 -1
- package/es/ProForm/components/base/TextArea/index.js +19 -11
- package/es/ProForm/components/base/TextArea/index.less +11 -0
- package/es/ProForm/components/base/TimePicker/index.d.ts +13 -0
- package/es/ProForm/components/base/TimePicker/index.js +42 -0
- package/es/ProForm/components/base/TimePicker/style/index.less +3 -0
- package/es/ProForm/components/combination/Container/index.d.ts +4 -0
- package/es/ProForm/components/combination/Container/index.js +58 -0
- package/es/ProForm/components/combination/Container/propsType.d.ts +10 -0
- package/es/ProForm/components/combination/Container/style/index.less +37 -0
- package/{lib/ProForm/components/base → es/ProForm/components/combination}/FormList/components/ActionButton.d.ts +6 -3
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +242 -0
- package/es/ProForm/components/combination/FormList/components/BlockFields.d.ts +19 -0
- package/es/ProForm/components/{base → combination}/FormList/components/BlockFields.js +34 -30
- package/es/ProForm/components/{base → combination}/FormList/components/BlockTitle.d.ts +2 -4
- package/es/ProForm/components/{base → combination}/FormList/components/BlockTitle.js +6 -4
- package/es/ProForm/components/{base → combination}/FormList/components/LineFields.d.ts +7 -4
- package/es/ProForm/components/combination/FormList/components/LineFields.js +85 -0
- package/{lib/ProForm/components/base → es/ProForm/components/combination}/FormList/components/ToolbarButton.d.ts +3 -3
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +107 -0
- package/es/ProForm/components/combination/FormList/index.d.ts +4 -0
- package/es/ProForm/components/combination/FormList/index.js +129 -0
- package/es/ProForm/components/combination/FormList/propsType.d.ts +62 -0
- package/es/ProForm/components/combination/FormList/style/index.less +71 -0
- package/es/ProForm/components/combination/Group/index.d.ts +4 -0
- package/es/ProForm/components/combination/Group/index.js +71 -0
- package/es/ProForm/components/combination/Group/propsType.d.ts +25 -0
- package/es/ProForm/components/combination/Group/style/index.less +107 -0
- package/es/ProForm/components/combination/Group/utils.d.ts +10 -0
- package/es/ProForm/components/combination/Group/utils.js +49 -0
- package/es/ProForm/components/combination/ProAddressBar/index.d.ts +2 -2
- package/es/ProForm/components/combination/ProAddressBar/index.js +73 -53
- package/es/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -0
- package/es/ProForm/components/combination/ProCombination/index.js +43 -37
- package/es/ProForm/components/combination/ProModalSelect/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +163 -100
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +2 -2
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +28 -9
- package/es/ProForm/components/combination/ProNumberRange/index.d.ts +1 -2
- package/es/ProForm/components/combination/ProNumberRange/index.js +60 -53
- package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +4 -0
- package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +3 -2
- package/es/ProForm/components/combination/ProRangeLimit/index.js +42 -32
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProTimeLimit/index.js +40 -47
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +2 -1
- package/es/ProForm/components/index.d.ts +7 -3
- package/es/ProForm/components/index.js +7 -3
- package/es/ProForm/components/old/EnumSelect/index.js +63 -55
- package/es/ProForm/components/old/EnumSelect/interface.d.ts +1 -1
- package/es/ProForm/components/old/InputRange/index.d.ts +1 -2
- package/es/ProForm/components/old/InputRange/index.js +45 -44
- package/es/ProForm/components/old/InputWithSuffix/index.d.ts +1 -2
- package/es/ProForm/components/old/InputWithSuffix/index.js +22 -20
- package/es/ProForm/components/old/InputWithSuffix/propsTypes.d.ts +1 -1
- package/es/ProForm/components/old/ProAddress/index.d.ts +3 -3
- package/es/ProForm/components/old/ProAddress/index.js +79 -67
- package/es/ProForm/components/old/ProCertNo/index.d.ts +2 -2
- package/es/ProForm/components/old/ProCertNo/index.js +34 -29
- package/es/ProForm/components/old/ProCertNo/propsType.d.ts +1 -1
- package/es/ProForm/components/old/ProCertValidity/index.d.ts +2 -2
- package/es/ProForm/components/old/ProCertValidity/index.js +40 -34
- package/es/ProForm/components/old/ProCertValidity/propsType.d.ts +2 -2
- package/es/ProForm/components/old/ProRangeBox/index.d.ts +2 -2
- package/es/ProForm/components/old/ProRangeBox/index.js +65 -57
- package/es/ProForm/components/render/Render.js +157 -96
- package/es/ProForm/components/render/RenderFields.d.ts +3 -1
- package/es/ProForm/components/render/RenderFields.js +54 -29
- package/es/ProForm/components/render/propsType.d.ts +64 -8
- package/es/ProForm/components/render/propsType.js +0 -6
- package/es/ProForm/index.js +102 -66
- package/es/ProForm/propsType.d.ts +7 -2
- package/es/ProForm/style/index.less +77 -75
- package/es/ProForm/utils/index.d.ts +27 -2
- package/es/ProForm/utils/index.js +139 -31
- package/es/ProForm/utils/rulesCreator.d.ts +1 -1
- package/es/ProForm/utils/rulesCreator.js +12 -2
- package/es/ProForm/utils/transformNames.d.ts +1 -1
- package/es/ProForm/utils/transformValue.js +6 -9
- package/es/ProForm/utils/useChanged.js +6 -2
- package/es/ProForm/utils/useFieldProps.d.ts +4 -0
- package/es/ProForm/utils/useFieldProps.js +6 -0
- package/es/ProForm/utils/useForm.js +32 -48
- package/es/ProForm/utils/useRules.d.ts +16 -0
- package/es/ProForm/utils/useRules.js +62 -0
- package/es/ProForm/utils/useShouldUpdate.d.ts +3 -1
- package/es/ProForm/utils/useShouldUpdate.js +23 -22
- package/es/ProForm/utils/valueType.js +1 -1
- package/es/ProIcon/index.js +26 -26
- package/es/ProIcon/style/index.less +15 -0
- package/es/ProIcon/symbolIcon.js +6 -6
- package/es/ProLayout/components/Layout/Header/index.js +20 -13
- package/es/ProLayout/components/Layout/Header/style/index.less +6 -6
- package/es/ProLayout/components/Layout/Icon/Icon.js +8 -6
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.d.ts +1 -1
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +83 -72
- package/es/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +8 -8
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +1 -2
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +76 -50
- package/es/ProLayout/components/Layout/Menu/OpenMenu/propsType.d.ts +2 -0
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +23 -12
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +22 -17
- package/es/ProLayout/components/Layout/Menu/SideMenu/style/index.less +5 -4
- package/es/ProLayout/components/Layout/Menu/index.js +36 -34
- package/es/ProLayout/components/Layout/Menu/style/index.less +22 -3
- package/es/ProLayout/components/Layout/Notice/index.js +15 -13
- package/es/ProLayout/components/Layout/Notice/style/index.less +3 -3
- package/es/ProLayout/components/ProCollapse/PropTypes.d.ts +1 -1
- package/es/ProLayout/components/ProCollapse/index.d.ts +1 -2
- package/es/ProLayout/components/ProCollapse/index.js +57 -43
- package/es/ProLayout/components/ProCollapse/style/index.less +10 -4
- package/es/ProLayout/components/ProFooter/index.d.ts +2 -2
- package/es/ProLayout/components/ProFooter/index.js +10 -6
- package/es/ProLayout/components/ProFooter/style/index.less +2 -2
- package/es/ProLayout/components/ProHeader/PropTypes.d.ts +30 -7
- package/es/ProLayout/components/ProHeader/components/Copy/index.d.ts +1 -2
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +4 -7
- package/es/ProLayout/components/ProHeader/index.d.ts +1 -1
- package/es/ProLayout/components/ProHeader/index.js +253 -158
- package/es/ProLayout/components/ProHeader/style/index.less +29 -14
- package/es/ProLayout/index.d.ts +10 -6
- package/es/ProLayout/index.js +44 -26
- package/es/ProLayout/propTypes.d.ts +2 -0
- package/es/ProLayout/style/index.less +156 -1
- package/es/ProSelect/components/AdaptiveTooltip.d.ts +4 -0
- package/es/ProSelect/components/AdaptiveTooltip.js +46 -0
- package/es/ProSelect/index.d.ts +2 -1
- package/es/ProSelect/index.js +85 -59
- package/es/ProSelect/index.less +8 -0
- package/es/ProSelect/propsType.d.ts +19 -9
- package/es/ProStep/components/Anchor/index.d.ts +1 -2
- package/es/ProStep/components/Anchor/index.js +45 -34
- package/es/ProStep/components/Item/index.d.ts +2 -6
- package/es/ProStep/components/Item/index.js +23 -7
- package/es/ProStep/components/Step/index.d.ts +1 -2
- package/es/ProStep/components/Step/index.js +19 -14
- package/es/ProStep/index.d.ts +5 -9
- package/es/ProStep/index.js +94 -20
- package/es/ProStep/propsType.d.ts +11 -1
- package/es/ProStep/style/index.less +10 -24
- package/es/ProTable/components/RenderColumn/index.d.ts +14 -0
- package/es/ProTable/components/RenderColumn/index.js +75 -0
- package/es/ProTable/components/ResizableLine/index.d.ts +1 -2
- package/es/ProTable/components/ResizableLine/index.js +2 -2
- package/es/ProTable/components/TableResizable/index.d.ts +1 -2
- package/es/ProTable/components/TableResizable/index.js +16 -12
- package/es/ProTable/components/TooltipTitle/index.d.ts +11 -0
- package/es/ProTable/components/TooltipTitle/index.js +23 -0
- package/es/ProTable/index.d.ts +3 -3
- package/es/ProTable/index.js +137 -112
- package/es/ProTable/propsType.d.ts +41 -27
- package/es/ProTable/style/index.less +66 -32
- package/es/ProTable/useAntdTable.d.ts +11 -7
- package/es/ProTable/useAntdTable.js +106 -50
- package/es/ProTable/utils.d.ts +8 -0
- package/es/ProTable/utils.js +167 -110
- package/es/ProTabs/components/Card/index.d.ts +1 -2
- package/es/ProTabs/components/Card/index.js +45 -17
- package/es/ProTabs/index.d.ts +1 -1
- package/es/ProTabs/index.js +38 -27
- package/es/ProTabs/propType.d.ts +5 -0
- package/es/ProTabs/style/index.less +15 -3
- package/es/ProThemeTools/component/PrdTools/index.d.ts +1 -2
- package/es/ProThemeTools/component/PrdTools/index.js +215 -136
- package/es/ProThemeTools/component/PrdTools/style/index.less +7 -3
- package/es/ProThemeTools/index.d.ts +1 -2
- package/es/ProThemeTools/index.js +62 -49
- package/es/ProThemeTools/propsType.d.ts +16 -3
- package/es/ProThemeTools/utils/index.d.ts +10 -0
- package/es/ProThemeTools/utils/index.js +45 -0
- package/es/ProTooltip/index.d.ts +1 -2
- package/es/ProTooltip/index.js +232 -46
- package/es/ProTooltip/propsType.d.ts +3 -0
- package/es/ProTooltip/style/index.less +19 -8
- package/es/ProTree/components/CloseIcon.d.ts +3 -0
- package/es/ProTree/components/CloseIcon.js +30 -0
- package/es/ProTree/components/List.d.ts +17 -0
- package/es/ProTree/components/List.js +68 -0
- package/es/ProTree/components/ProTree.d.ts +4 -0
- package/es/ProTree/components/ProTree.js +446 -0
- package/es/ProTree/components/SearchTitle.d.ts +9 -0
- package/es/ProTree/components/SearchTitle.js +42 -0
- package/es/ProTree/components/Tree.d.ts +27 -0
- package/es/ProTree/components/Tree.js +344 -0
- package/es/ProTree/components/index.d.ts +4 -0
- package/es/ProTree/components/index.js +5 -0
- package/es/ProTree/index.d.ts +3 -0
- package/es/ProTree/index.js +25 -0
- package/es/ProTree/propsType.d.ts +217 -0
- package/es/ProTree/propsType.js +1 -0
- package/es/ProTree/style/index.less +289 -0
- package/es/ProTree/utils.d.ts +37 -0
- package/es/ProTree/utils.js +183 -0
- package/es/ProTreeModal/components/Cascader.d.ts +14 -0
- package/es/ProTreeModal/components/Cascader.js +99 -0
- package/es/ProTreeModal/components/CloseIcon.d.ts +2 -2
- package/es/ProTreeModal/components/CloseIcon.js +25 -20
- package/es/ProTreeModal/components/List.d.ts +11 -3
- package/es/ProTreeModal/components/List.js +184 -36
- package/es/ProTreeModal/components/SearchTitle.d.ts +3 -3
- package/es/ProTreeModal/components/SearchTitle.js +16 -9
- package/es/{ProTransferModal/components/SortableItem/index.d.ts → ProTreeModal/components/SortableItem.d.ts} +1 -0
- package/es/ProTreeModal/components/SortableItem.js +60 -0
- package/es/ProTreeModal/components/Tree.d.ts +14 -4
- package/es/ProTreeModal/components/Tree.js +165 -94
- package/es/ProTreeModal/components/Trigger.d.ts +5 -2
- package/es/ProTreeModal/components/Trigger.js +46 -21
- package/es/ProTreeModal/components/index.d.ts +1 -0
- package/es/ProTreeModal/components/index.js +2 -1
- package/es/ProTreeModal/index.d.ts +2 -2
- package/es/ProTreeModal/index.js +513 -146
- package/es/ProTreeModal/propsType.d.ts +71 -14
- package/es/ProTreeModal/style/index.less +231 -50
- package/es/ProTreeModal/utils.d.ts +26 -14
- package/es/ProTreeModal/utils.js +103 -40
- package/es/ProTreeSelect/index.d.ts +1 -1
- package/es/ProTreeSelect/index.js +181 -74
- package/es/ProTreeSelect/propsType.d.ts +11 -9
- package/es/ProTreeSelect/style/index.less +94 -90
- package/es/ProUpload/components/ButtonRender.d.ts +18 -0
- package/es/ProUpload/components/ButtonRender.js +71 -0
- package/es/ProUpload/components/DragRender.d.ts +20 -0
- package/es/ProUpload/components/DragRender.js +179 -0
- package/es/ProUpload/components/DraggableUploadListItem.d.ts +2 -0
- package/es/ProUpload/components/DraggableUploadListItem.js +29 -0
- package/es/ProUpload/components/Example.d.ts +10 -0
- package/es/ProUpload/components/Example.js +40 -0
- package/{lib/ProUpload → es/ProUpload/components}/FileItem.d.ts +2 -2
- package/es/ProUpload/components/FileItem.js +212 -0
- package/es/ProUpload/components/ImageRender.d.ts +18 -0
- package/es/ProUpload/components/ImageRender.js +267 -0
- package/es/ProUpload/index.js +183 -301
- package/es/ProUpload/propsType.d.ts +61 -7
- package/es/ProUpload/style/fileItem.less +126 -138
- package/es/ProUpload/style/index.less +185 -115
- package/es/ProUpload/uitls.d.ts +3 -0
- package/es/ProUpload/uitls.js +14 -0
- package/es/ProUtils/utils/index.js +1 -1
- package/es/ProViewer/index.d.ts +1 -1
- package/es/ProViewer/index.js +35 -29
- package/es/ProWaterMark/index.js +9 -7
- package/es/assets/delete.svg +1 -1
- package/es/{ProUpload/style → assets}/download.svg +1 -1
- package/es/assets/input-search.svg +11 -0
- package/es/global.less +2 -2
- package/es/index.d.ts +2 -3
- package/es/index.js +4 -4
- package/es/old/ProBackBtn/index.js +6 -5
- package/es/old/ProCertValidity/index.d.ts +3 -3
- package/es/old/ProCertValidity/index.js +70 -65
- package/es/old/ProCertValidity/propsType.d.ts +2 -2
- package/es/old/ProEditableTable/index.d.ts +1 -1
- package/es/old/ProEditableTable/index.js +90 -68
- package/es/old/ProEditableTable/propsType.d.ts +3 -3
- package/es/old/ProEditableTable/utils.js +141 -125
- package/es/style/components.less +3 -4
- package/es/style/theme/antd.less +11 -5
- package/es/style/theme/index.less +80 -161
- package/es/style/theme/tokens.less +88 -0
- package/es/tokens.d.ts +83 -0
- package/es/tokens.js +2 -3
- package/lib/ProAction/index.d.ts +7 -0
- package/lib/ProAction/index.js +224 -0
- package/lib/ProAction/index.less +7 -0
- package/lib/ProAction/propsType.d.ts +38 -0
- package/lib/ProConfigProvider/index.d.ts +5 -4
- package/lib/ProConfigProvider/index.js +11 -10
- package/lib/ProDownload/index.d.ts +4 -2
- package/lib/ProDownload/index.js +73 -60
- package/lib/ProDownload/propsType.d.ts +18 -6
- package/lib/ProDownload/style/index.less +7 -0
- package/lib/ProDownload/utils.d.ts +55 -0
- package/lib/ProDownload/{DownloadHelper.js → utils.js} +98 -78
- package/lib/ProDrawerForm/components/ProDrawer/index.js +54 -44
- package/lib/ProDrawerForm/components/ProModal/index.js +49 -31
- package/lib/ProDrawerForm/index.js +44 -21
- package/lib/ProDrawerForm/propsType.d.ts +7 -3
- package/lib/ProDrawerForm/style/index.less +33 -23
- package/lib/ProDrawerForm/utils/index.js +2 -3
- package/lib/ProEditLabel/components/RenderProForm.js +26 -22
- package/lib/ProEditLabel/index.js +24 -18
- package/lib/ProEditLabel/propsType.d.ts +3 -3
- package/lib/ProEditLabel/style/index.less +10 -12
- package/lib/ProEditLabel/utils/index.js +2 -3
- package/lib/ProEditTable/components/ActionButton/index.d.ts +1 -2
- package/lib/ProEditTable/components/ActionButton/index.js +84 -47
- package/lib/ProEditTable/components/DndWrapper/index.js +46 -36
- package/lib/ProEditTable/components/RenderField/index.d.ts +1 -2
- package/lib/ProEditTable/components/RenderField/index.js +158 -135
- package/lib/ProEditTable/components/RenderToolbar/index.d.ts +1 -2
- package/lib/ProEditTable/components/RenderToolbar/index.js +43 -33
- package/lib/ProEditTable/components/Summary/index.d.ts +1 -2
- package/lib/ProEditTable/components/Summary/index.js +22 -16
- package/lib/ProEditTable/components/Validator/index.d.ts +3 -3
- package/lib/ProEditTable/components/Validator/index.js +20 -18
- package/lib/ProEditTable/index.js +124 -71
- package/lib/ProEditTable/propsType.d.ts +47 -14
- package/lib/ProEditTable/style/index.less +143 -53
- package/lib/ProEditTable/utils/config.d.ts +2 -3
- package/lib/ProEditTable/utils/config.js +61 -55
- package/lib/ProEditTable/utils/index.d.ts +1 -2
- package/lib/ProEditTable/utils/index.js +98 -84
- package/lib/ProEditTable/utils/tools.js +7 -13
- package/lib/ProEditTable/utils/transform.d.ts +2 -2
- package/lib/ProEditTable/utils/transform.js +3 -4
- package/lib/ProEnum/components/Tag.d.ts +7 -0
- package/lib/ProEnum/components/Tag.js +47 -0
- package/lib/ProEnum/hooks/useEnum.d.ts +21 -0
- package/lib/ProEnum/{useEnum.js → hooks/useEnum.js} +18 -24
- package/lib/ProEnum/hooks/useEnumRequest.d.ts +4 -0
- package/lib/ProEnum/hooks/useEnumRequest.js +294 -0
- package/lib/ProEnum/index.d.ts +4 -4
- package/lib/ProEnum/index.js +86 -42
- package/lib/ProEnum/propsType.d.ts +17 -6
- package/lib/ProEnum/propsType.js +7 -1
- package/lib/ProEnum/style/index.less +23 -0
- package/lib/ProEnum/utils/eventCenter.d.ts +1 -0
- package/lib/ProEnum/utils/eventCenter.js +42 -0
- package/lib/ProEnum/utils/getEnumLabel.d.ts +2 -0
- package/lib/ProEnum/utils/getEnumLabel.js +88 -0
- package/{es/ProEnum/utils.d.ts → lib/ProEnum/utils/index.d.ts} +1 -1
- package/lib/ProForm/components/Container.js +15 -12
- package/lib/ProForm/components/FormFooter/index.d.ts +1 -0
- package/lib/ProForm/components/FormFooter/index.js +52 -18
- package/lib/ProForm/components/FormFooter/propsType.d.ts +3 -1
- package/lib/ProForm/components/base/Checkbox/index.d.ts +1 -1
- package/lib/ProForm/components/base/Checkbox/index.js +19 -15
- package/lib/ProForm/components/base/DatePicker/index.d.ts +6 -5
- package/lib/ProForm/components/base/DatePicker/index.js +18 -18
- package/lib/ProForm/components/base/Input/index.d.ts +1 -2
- package/lib/ProForm/components/base/Input/index.js +11 -10
- package/lib/ProForm/components/base/InputNumber/index.d.ts +1 -1
- package/lib/ProForm/components/base/InputNumber/index.js +98 -50
- package/lib/ProForm/components/base/ProCascader/index.d.ts +14 -0
- package/lib/ProForm/components/base/ProCascader/index.js +78 -0
- package/lib/ProForm/components/base/Radio/index.js +14 -13
- package/lib/ProForm/components/base/RangePicker/index.d.ts +4 -3
- package/lib/ProForm/components/base/RangePicker/index.js +13 -11
- package/lib/ProForm/components/base/Select/index.d.ts +1 -0
- package/lib/ProForm/components/base/Select/index.js +20 -14
- package/lib/ProForm/components/base/Switch/index.js +12 -10
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +26 -20
- package/lib/ProForm/components/base/SwitchCheckbox/style/index.less +2 -3
- package/lib/ProForm/components/base/TextArea/index.d.ts +2 -1
- package/lib/ProForm/components/base/TextArea/index.js +21 -14
- package/lib/ProForm/components/base/TextArea/index.less +11 -0
- package/lib/ProForm/components/base/TimePicker/index.d.ts +13 -0
- package/lib/ProForm/components/base/TimePicker/index.js +48 -0
- package/lib/ProForm/components/base/TimePicker/style/index.less +3 -0
- package/lib/ProForm/components/combination/Container/index.d.ts +4 -0
- package/lib/ProForm/components/combination/Container/index.js +65 -0
- package/lib/ProForm/components/combination/Container/propsType.d.ts +10 -0
- package/lib/ProForm/components/combination/Container/style/index.less +37 -0
- package/{es/ProForm/components/base → lib/ProForm/components/combination}/FormList/components/ActionButton.d.ts +6 -3
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +243 -0
- package/lib/ProForm/components/combination/FormList/components/BlockFields.d.ts +19 -0
- package/lib/ProForm/components/{base → combination}/FormList/components/BlockFields.js +35 -33
- package/lib/ProForm/components/{base → combination}/FormList/components/BlockTitle.d.ts +2 -4
- package/lib/ProForm/components/{base → combination}/FormList/components/BlockTitle.js +7 -6
- package/lib/ProForm/components/{base → combination}/FormList/components/LineFields.d.ts +7 -4
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +91 -0
- package/{es/ProForm/components/base → lib/ProForm/components/combination}/FormList/components/ToolbarButton.d.ts +3 -3
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +111 -0
- package/lib/ProForm/components/combination/FormList/index.d.ts +4 -0
- package/lib/ProForm/components/combination/FormList/index.js +135 -0
- package/lib/ProForm/components/combination/FormList/propsType.d.ts +62 -0
- package/lib/ProForm/components/combination/FormList/style/index.less +71 -0
- package/lib/ProForm/components/{base → combination}/FormList/utils.js +2 -3
- package/lib/ProForm/components/combination/Group/index.d.ts +4 -0
- package/lib/ProForm/components/combination/Group/index.js +75 -0
- package/lib/ProForm/components/combination/Group/propsType.d.ts +25 -0
- package/lib/ProForm/components/combination/Group/style/index.less +107 -0
- package/lib/ProForm/components/combination/Group/utils.d.ts +10 -0
- package/lib/ProForm/components/combination/Group/utils.js +56 -0
- package/lib/ProForm/components/combination/ProAddressBar/index.d.ts +2 -2
- package/lib/ProForm/components/combination/ProAddressBar/index.js +75 -57
- package/lib/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -0
- package/lib/ProForm/components/combination/ProCombination/index.js +46 -43
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -2
- package/lib/ProForm/components/combination/ProModalSelect/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +161 -99
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +2 -2
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +28 -9
- package/lib/ProForm/components/combination/ProNumberRange/index.d.ts +1 -2
- package/lib/ProForm/components/combination/ProNumberRange/index.js +61 -55
- package/lib/ProForm/components/combination/ProNumberRange/propsType.d.ts +4 -0
- package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +3 -2
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +44 -36
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +1 -2
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +41 -50
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +2 -1
- package/lib/ProForm/components/index.d.ts +7 -3
- package/lib/ProForm/components/index.js +40 -13
- package/lib/ProForm/components/old/EnumSelect/index.js +64 -58
- package/lib/ProForm/components/old/EnumSelect/interface.d.ts +1 -1
- package/lib/ProForm/components/old/InputRange/index.d.ts +1 -2
- package/lib/ProForm/components/old/InputRange/index.js +46 -47
- package/lib/ProForm/components/old/InputWithSuffix/index.d.ts +1 -2
- package/lib/ProForm/components/old/InputWithSuffix/index.js +23 -22
- package/lib/ProForm/components/old/InputWithSuffix/propsTypes.d.ts +1 -1
- package/lib/ProForm/components/old/ProAddress/index.d.ts +3 -3
- package/lib/ProForm/components/old/ProAddress/index.js +81 -72
- package/lib/ProForm/components/old/ProCertNo/index.d.ts +2 -2
- package/lib/ProForm/components/old/ProCertNo/index.js +36 -34
- package/lib/ProForm/components/old/ProCertNo/propsType.d.ts +1 -1
- package/lib/ProForm/components/old/ProCertValidity/index.d.ts +2 -2
- package/lib/ProForm/components/old/ProCertValidity/index.js +39 -38
- package/lib/ProForm/components/old/ProCertValidity/propsType.d.ts +2 -2
- package/lib/ProForm/components/old/ProRangeBox/index.d.ts +2 -2
- package/lib/ProForm/components/old/ProRangeBox/index.js +65 -57
- package/lib/ProForm/components/render/Render.js +152 -95
- package/lib/ProForm/components/render/RenderFields.d.ts +3 -1
- package/lib/ProForm/components/render/RenderFields.js +54 -30
- package/lib/ProForm/components/render/propsType.d.ts +64 -8
- package/lib/ProForm/components/render/propsType.js +1 -7
- package/lib/ProForm/index.js +101 -66
- package/lib/ProForm/propsType.d.ts +7 -2
- package/lib/ProForm/propsType.js +1 -2
- package/lib/ProForm/style/index.less +77 -75
- package/lib/ProForm/utils/contrastOriginal.js +2 -3
- package/lib/ProForm/utils/index.d.ts +27 -2
- package/lib/ProForm/utils/index.js +154 -61
- package/lib/ProForm/utils/rulesCreator.d.ts +1 -1
- package/lib/ProForm/utils/rulesCreator.js +15 -5
- package/lib/ProForm/utils/transformNames.d.ts +1 -1
- package/lib/ProForm/utils/transformNames.js +1 -2
- package/lib/ProForm/utils/transformValue.js +7 -12
- package/lib/ProForm/utils/useChanged.js +8 -5
- package/lib/ProForm/utils/useFieldProps.d.ts +4 -0
- package/lib/ProForm/utils/useFieldProps.js +13 -0
- package/lib/ProForm/utils/useForm.js +32 -49
- package/lib/ProForm/utils/useRules.d.ts +16 -0
- package/lib/ProForm/utils/useRules.js +69 -0
- package/lib/ProForm/utils/useShouldUpdate.d.ts +3 -1
- package/lib/ProForm/utils/useShouldUpdate.js +23 -23
- package/lib/ProForm/utils/valueType.js +3 -4
- package/lib/ProIcon/index.js +27 -29
- package/lib/ProIcon/style/index.less +15 -0
- package/lib/ProIcon/symbolIcon.js +6 -6
- package/lib/ProLayout/components/Layout/Header/index.js +21 -15
- package/lib/ProLayout/components/Layout/Header/style/index.less +6 -6
- package/lib/ProLayout/components/Layout/Icon/Icon.js +9 -9
- package/lib/ProLayout/components/Layout/Icon/index.js +1 -2
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.d.ts +1 -1
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +84 -74
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +8 -8
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +1 -2
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +78 -54
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/propsType.d.ts +2 -0
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +23 -12
- package/lib/ProLayout/components/Layout/Menu/SideMenu/index.js +23 -20
- package/lib/ProLayout/components/Layout/Menu/SideMenu/style/index.less +5 -4
- package/lib/ProLayout/components/Layout/Menu/index.js +37 -36
- package/lib/ProLayout/components/Layout/Menu/style/index.less +22 -3
- package/lib/ProLayout/components/Layout/Notice/index.js +16 -15
- package/lib/ProLayout/components/Layout/Notice/style/index.less +3 -3
- package/lib/ProLayout/components/ProCollapse/PropTypes.d.ts +1 -1
- package/lib/ProLayout/components/ProCollapse/index.d.ts +1 -2
- package/lib/ProLayout/components/ProCollapse/index.js +58 -45
- package/lib/ProLayout/components/ProCollapse/style/index.less +10 -4
- package/lib/ProLayout/components/ProFooter/index.d.ts +2 -2
- package/lib/ProLayout/components/ProFooter/index.js +11 -9
- package/lib/ProLayout/components/ProFooter/style/index.less +2 -2
- package/lib/ProLayout/components/ProHeader/PropTypes.d.ts +30 -7
- package/lib/ProLayout/components/ProHeader/components/Copy/index.d.ts +1 -2
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +5 -9
- package/lib/ProLayout/components/ProHeader/index.d.ts +1 -1
- package/lib/ProLayout/components/ProHeader/index.js +251 -161
- package/lib/ProLayout/components/ProHeader/style/index.less +29 -14
- package/lib/ProLayout/index.d.ts +10 -6
- package/lib/ProLayout/index.js +45 -30
- package/lib/ProLayout/propTypes.d.ts +2 -0
- package/lib/ProLayout/style/index.less +156 -1
- package/lib/ProLayout/utils/index.js +5 -9
- package/lib/ProSelect/components/AdaptiveTooltip.d.ts +4 -0
- package/lib/ProSelect/components/AdaptiveTooltip.js +52 -0
- package/lib/ProSelect/index.d.ts +2 -1
- package/lib/ProSelect/index.js +88 -62
- package/lib/ProSelect/index.less +8 -0
- package/lib/ProSelect/propsType.d.ts +19 -9
- package/lib/ProStep/components/Anchor/index.d.ts +1 -2
- package/lib/ProStep/components/Anchor/index.js +47 -38
- package/lib/ProStep/components/Item/index.d.ts +2 -6
- package/lib/ProStep/components/Item/index.js +25 -10
- package/lib/ProStep/components/Listener/index.js +2 -3
- package/lib/ProStep/components/Step/index.d.ts +1 -2
- package/lib/ProStep/components/Step/index.js +21 -18
- package/lib/ProStep/index.d.ts +5 -9
- package/lib/ProStep/index.js +97 -27
- package/lib/ProStep/propsType.d.ts +11 -1
- package/lib/ProStep/style/index.less +10 -24
- package/lib/ProStep/utils/index.js +2 -4
- package/lib/ProTable/components/RenderColumn/index.d.ts +14 -0
- package/lib/ProTable/components/RenderColumn/index.js +81 -0
- package/lib/ProTable/components/ResizableLine/index.d.ts +1 -2
- package/lib/ProTable/components/ResizableLine/index.js +3 -5
- package/lib/ProTable/components/TableResizable/index.d.ts +1 -2
- package/lib/ProTable/components/TableResizable/index.js +18 -16
- package/lib/ProTable/components/TooltipTitle/index.d.ts +11 -0
- package/lib/ProTable/components/TooltipTitle/index.js +29 -0
- package/lib/ProTable/index.d.ts +3 -3
- package/lib/ProTable/index.js +141 -120
- package/lib/ProTable/propsType.d.ts +41 -27
- package/lib/ProTable/style/index.less +66 -32
- package/lib/ProTable/useAntdTable.d.ts +11 -7
- package/lib/ProTable/useAntdTable.js +105 -51
- package/lib/ProTable/utils.d.ts +8 -0
- package/lib/ProTable/utils.js +169 -113
- package/lib/ProTabs/components/Card/index.d.ts +1 -2
- package/lib/ProTabs/components/Card/index.js +42 -20
- package/lib/ProTabs/index.d.ts +1 -1
- package/lib/ProTabs/index.js +39 -30
- package/lib/ProTabs/propType.d.ts +5 -0
- package/lib/ProTabs/style/index.less +15 -3
- package/lib/ProThemeTools/component/PrdTools/index.d.ts +1 -2
- package/lib/ProThemeTools/component/PrdTools/index.js +215 -138
- package/lib/ProThemeTools/component/PrdTools/style/index.less +7 -3
- package/lib/ProThemeTools/index.d.ts +1 -2
- package/lib/ProThemeTools/index.js +62 -51
- package/lib/ProThemeTools/propsType.d.ts +16 -3
- package/lib/ProThemeTools/utils/index.d.ts +10 -0
- package/lib/ProThemeTools/utils/index.js +49 -7
- package/lib/ProTooltip/index.d.ts +1 -2
- package/lib/ProTooltip/index.js +231 -47
- package/lib/ProTooltip/propsType.d.ts +3 -0
- package/lib/ProTooltip/style/index.less +19 -8
- package/lib/ProTree/components/CloseIcon.d.ts +3 -0
- package/lib/ProTree/components/CloseIcon.js +37 -0
- package/lib/ProTree/components/List.d.ts +17 -0
- package/lib/ProTree/components/List.js +74 -0
- package/lib/ProTree/components/ProTree.d.ts +4 -0
- package/lib/ProTree/components/ProTree.js +446 -0
- package/lib/ProTree/components/SearchTitle.d.ts +9 -0
- package/lib/ProTree/components/SearchTitle.js +47 -0
- package/lib/ProTree/components/Tree.d.ts +27 -0
- package/lib/ProTree/components/Tree.js +349 -0
- package/lib/ProTree/components/index.d.ts +4 -0
- package/lib/ProTree/components/index.js +34 -0
- package/lib/ProTree/index.d.ts +3 -0
- package/lib/ProTree/index.js +32 -0
- package/lib/ProTree/propsType.d.ts +217 -0
- package/lib/ProTree/propsType.js +5 -0
- package/lib/ProTree/style/index.less +289 -0
- package/lib/ProTree/utils.d.ts +37 -0
- package/lib/ProTree/utils.js +195 -0
- package/lib/ProTreeModal/components/Cascader.d.ts +14 -0
- package/lib/ProTreeModal/components/Cascader.js +105 -0
- package/lib/ProTreeModal/components/CloseIcon.d.ts +2 -2
- package/lib/ProTreeModal/components/CloseIcon.js +26 -22
- package/lib/ProTreeModal/components/List.d.ts +11 -3
- package/lib/ProTreeModal/components/List.js +181 -37
- package/lib/ProTreeModal/components/SearchTitle.d.ts +3 -3
- package/lib/ProTreeModal/components/SearchTitle.js +17 -12
- package/lib/{ProTransferModal/components/SortableItem/index.d.ts → ProTreeModal/components/SortableItem.d.ts} +1 -0
- package/lib/{ProTransferModal/components/SortableItem/index.js → ProTreeModal/components/SortableItem.js} +29 -26
- package/lib/ProTreeModal/components/Tree.d.ts +14 -4
- package/lib/ProTreeModal/components/Tree.js +164 -95
- package/lib/ProTreeModal/components/Trigger.d.ts +5 -2
- package/lib/ProTreeModal/components/Trigger.js +47 -23
- package/lib/ProTreeModal/components/index.d.ts +1 -0
- package/lib/ProTreeModal/components/index.js +8 -1
- package/lib/ProTreeModal/index.d.ts +2 -2
- package/lib/ProTreeModal/index.js +507 -146
- package/lib/ProTreeModal/propsType.d.ts +71 -14
- package/lib/ProTreeModal/style/index.less +231 -50
- package/lib/ProTreeModal/utils.d.ts +26 -14
- package/lib/ProTreeModal/utils.js +107 -43
- package/lib/ProTreeSelect/index.d.ts +1 -1
- package/lib/ProTreeSelect/index.js +183 -81
- package/lib/ProTreeSelect/propsType.d.ts +11 -9
- package/lib/ProTreeSelect/style/index.less +94 -90
- package/lib/ProUpload/components/ButtonRender.d.ts +18 -0
- package/lib/ProUpload/components/ButtonRender.js +75 -0
- package/lib/ProUpload/components/DragRender.d.ts +20 -0
- package/lib/ProUpload/components/DragRender.js +185 -0
- package/lib/ProUpload/components/DraggableUploadListItem.d.ts +2 -0
- package/lib/ProUpload/components/DraggableUploadListItem.js +36 -0
- package/lib/ProUpload/components/Example.d.ts +10 -0
- package/lib/ProUpload/components/Example.js +47 -0
- package/{es/ProUpload → lib/ProUpload/components}/FileItem.d.ts +2 -2
- package/lib/ProUpload/components/FileItem.js +215 -0
- package/lib/ProUpload/components/ImageRender.d.ts +18 -0
- package/lib/ProUpload/components/ImageRender.js +265 -0
- package/lib/ProUpload/index.js +185 -298
- package/lib/ProUpload/propsType.d.ts +61 -7
- package/lib/ProUpload/style/fileItem.less +126 -138
- package/lib/ProUpload/style/index.less +185 -115
- package/lib/ProUpload/uitls.d.ts +3 -0
- package/lib/ProUpload/uitls.js +20 -0
- package/lib/ProUtils/utils/index.js +3 -4
- package/lib/ProViewer/index.d.ts +1 -1
- package/lib/ProViewer/index.js +36 -31
- package/lib/ProWaterMark/index.js +10 -9
- package/lib/assets/delete.svg +1 -1
- package/lib/{ProUpload/style → assets}/download.svg +1 -1
- package/lib/assets/input-search.svg +11 -0
- package/lib/global.less +2 -2
- package/lib/index.d.ts +2 -3
- package/lib/index.js +21 -25
- package/lib/old/ProBackBtn/index.js +7 -8
- package/lib/old/ProCertValidity/index.d.ts +3 -3
- package/lib/old/ProCertValidity/index.js +68 -68
- package/lib/old/ProCertValidity/propsType.d.ts +2 -2
- package/lib/old/ProEditableTable/index.d.ts +1 -1
- package/lib/old/ProEditableTable/index.js +91 -71
- package/lib/old/ProEditableTable/propsType.d.ts +3 -3
- package/lib/old/ProEditableTable/utils.js +147 -136
- package/lib/style/components.less +3 -4
- package/lib/style/theme/antd.less +11 -5
- package/lib/style/theme/index.less +80 -161
- package/lib/style/theme/tokens.less +88 -0
- package/lib/tokens.d.ts +83 -0
- package/lib/tokens.js +6 -3
- package/package.json +18 -12
- package/typings.d.ts +14 -3
- package/es/ProDownload/DownloadHelper.d.ts +0 -32
- package/es/ProEnum/getEnumLabel.d.ts +0 -3
- package/es/ProEnum/getEnumLabel.js +0 -62
- package/es/ProEnum/useEnum.d.ts +0 -14
- package/es/ProEnum/useEnumRequest.d.ts +0 -3
- package/es/ProEnum/useEnumRequest.js +0 -227
- package/es/ProForm/components/base/FormList/components/ActionButton.js +0 -169
- package/es/ProForm/components/base/FormList/components/BlockFields.d.ts +0 -16
- package/es/ProForm/components/base/FormList/components/LineFields.js +0 -46
- package/es/ProForm/components/base/FormList/components/ToolbarButton.js +0 -79
- package/es/ProForm/components/base/FormList/index.d.ts +0 -44
- package/es/ProForm/components/base/FormList/index.js +0 -99
- package/es/ProForm/components/base/FormList/style/index.less +0 -39
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useTransformDate.d.ts +0 -12
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useTransformDate.js +0 -36
- package/es/ProForm/components/old/CertNo/index.d.ts +0 -19
- package/es/ProForm/components/old/CertNo/index.js +0 -63
- package/es/ProForm/components/old/CertNo/propsType.d.ts +0 -13
- package/es/ProLayout/images/pack.png +0 -0
- package/es/ProTransferModal/components/SortableItem/index.js +0 -56
- package/es/ProTransferModal/index.d.ts +0 -4
- package/es/ProTransferModal/index.js +0 -338
- package/es/ProTransferModal/propsType.d.ts +0 -34
- package/es/ProTransferModal/style/index.less +0 -169
- package/es/ProTreeModal/data/datasource.d.ts +0 -5
- package/es/ProTreeModal/data/datasource.js +0 -17
- package/es/ProTreeModal/data/mock.d.ts +0 -9
- package/es/ProTreeModal/data/mock.js +0 -39
- package/es/ProUpload/Example.d.ts +0 -7
- package/es/ProUpload/Example.js +0 -40
- package/es/ProUpload/FileItem.js +0 -207
- package/es/ProUpload/style/delete.svg +0 -1
- package/es/old/ProCustomColumn/LeftBody.d.ts +0 -4
- package/es/old/ProCustomColumn/LeftBody.js +0 -206
- package/es/old/ProCustomColumn/RightBody.d.ts +0 -9
- package/es/old/ProCustomColumn/RightBody.js +0 -145
- package/es/old/ProCustomColumn/index.d.ts +0 -4
- package/es/old/ProCustomColumn/index.js +0 -165
- package/es/old/ProCustomColumn/propsType.d.ts +0 -39
- package/es/old/ProCustomColumn/style/LeftBody.less +0 -74
- package/es/old/ProCustomColumn/style/RightBody.less +0 -25
- package/es/old/ProCustomColumn/style/index.less +0 -88
- package/es/old/ProEnumSelectModal/hooks/useRequestList.d.ts +0 -32
- package/es/old/ProEnumSelectModal/hooks/useRequestList.js +0 -110
- package/es/old/ProEnumSelectModal/index.d.ts +0 -12
- package/es/old/ProEnumSelectModal/index.js +0 -222
- package/es/old/ProEnumSelectModal/propsType.d.ts +0 -22
- package/es/old/ProEnumSelectModal/style/index.less +0 -98
- package/lib/ProDownload/DownloadHelper.d.ts +0 -32
- package/lib/ProEnum/getEnumLabel.d.ts +0 -3
- package/lib/ProEnum/getEnumLabel.js +0 -70
- package/lib/ProEnum/useEnum.d.ts +0 -14
- package/lib/ProEnum/useEnumRequest.d.ts +0 -3
- package/lib/ProEnum/useEnumRequest.js +0 -236
- package/lib/ProForm/components/base/FormList/components/ActionButton.js +0 -173
- package/lib/ProForm/components/base/FormList/components/BlockFields.d.ts +0 -16
- package/lib/ProForm/components/base/FormList/components/LineFields.js +0 -53
- package/lib/ProForm/components/base/FormList/components/ToolbarButton.js +0 -85
- package/lib/ProForm/components/base/FormList/index.d.ts +0 -44
- package/lib/ProForm/components/base/FormList/index.js +0 -107
- package/lib/ProForm/components/base/FormList/style/index.less +0 -39
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useTransformDate.d.ts +0 -12
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useTransformDate.js +0 -44
- package/lib/ProForm/components/old/CertNo/index.d.ts +0 -19
- package/lib/ProForm/components/old/CertNo/index.js +0 -69
- package/lib/ProForm/components/old/CertNo/propsType.d.ts +0 -13
- package/lib/ProLayout/images/pack.png +0 -0
- package/lib/ProTransferModal/index.d.ts +0 -4
- package/lib/ProTransferModal/index.js +0 -334
- package/lib/ProTransferModal/propsType.d.ts +0 -34
- package/lib/ProTransferModal/style/index.less +0 -169
- package/lib/ProTreeModal/data/datasource.d.ts +0 -5
- package/lib/ProTreeModal/data/datasource.js +0 -24
- package/lib/ProTreeModal/data/mock.d.ts +0 -9
- package/lib/ProTreeModal/data/mock.js +0 -47
- package/lib/ProUpload/Example.d.ts +0 -7
- package/lib/ProUpload/Example.js +0 -50
- package/lib/ProUpload/FileItem.js +0 -216
- package/lib/ProUpload/style/delete.svg +0 -1
- package/lib/old/ProCustomColumn/LeftBody.d.ts +0 -4
- package/lib/old/ProCustomColumn/LeftBody.js +0 -212
- package/lib/old/ProCustomColumn/RightBody.d.ts +0 -9
- package/lib/old/ProCustomColumn/RightBody.js +0 -150
- package/lib/old/ProCustomColumn/index.d.ts +0 -4
- package/lib/old/ProCustomColumn/index.js +0 -171
- package/lib/old/ProCustomColumn/propsType.d.ts +0 -39
- package/lib/old/ProCustomColumn/style/LeftBody.less +0 -74
- package/lib/old/ProCustomColumn/style/RightBody.less +0 -25
- package/lib/old/ProCustomColumn/style/index.less +0 -88
- package/lib/old/ProEnumSelectModal/hooks/useRequestList.d.ts +0 -32
- package/lib/old/ProEnumSelectModal/hooks/useRequestList.js +0 -117
- package/lib/old/ProEnumSelectModal/index.d.ts +0 -12
- package/lib/old/ProEnumSelectModal/index.js +0 -220
- package/lib/old/ProEnumSelectModal/propsType.d.ts +0 -22
- package/lib/old/ProEnumSelectModal/style/index.less +0 -98
- /package/es/{ProForm/components/old/CertNo → ProAction}/propsType.js +0 -0
- /package/es/ProEnum/{utils.js → utils/index.js} +0 -0
- /package/es/{ProTransferModal → ProForm/components/combination/Container}/propsType.js +0 -0
- /package/es/{old/ProCustomColumn → ProForm/components/combination/FormList}/propsType.js +0 -0
- /package/es/ProForm/components/{base → combination}/FormList/utils.d.ts +0 -0
- /package/es/ProForm/components/{base → combination}/FormList/utils.js +0 -0
- /package/es/{old/ProEnumSelectModal → ProForm/components/combination/Group}/propsType.js +0 -0
- /package/es/{ProUpload/style → assets}/look.svg +0 -0
- /package/lib/{ProForm/components/old/CertNo → ProAction}/propsType.js +0 -0
- /package/lib/ProEnum/{utils.js → utils/index.js} +0 -0
- /package/lib/{ProTransferModal → ProForm/components/combination/Container}/propsType.js +0 -0
- /package/lib/{old/ProCustomColumn → ProForm/components/combination/FormList}/propsType.js +0 -0
- /package/lib/ProForm/components/{base → combination}/FormList/utils.d.ts +0 -0
- /package/lib/{old/ProEnumSelectModal → ProForm/components/combination/Group}/propsType.js +0 -0
- /package/lib/{ProUpload/style → assets}/look.svg +0 -0
package/lib/ProDownload/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
@@ -10,15 +11,17 @@ var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helper
|
|
|
10
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
13
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
15
|
var _ahooks = require("ahooks");
|
|
14
16
|
var _antd = require("antd");
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var _excluded = ["source", "action", "method", "params", "fileName", "headers", "children", "onFinish", "beforeDownload"];
|
|
17
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
18
|
+
var _lodash = _interopRequireWildcard(require("lodash"));
|
|
19
|
+
var _utils = require("./utils");
|
|
20
|
+
var _excluded = ["source", "action", "url", "method", "params", "fileName", "headers", "children", "onFinish", "beforeDownload", "className", "transformResponse"];
|
|
19
21
|
var ProDownload = function ProDownload(props) {
|
|
20
22
|
var source = props.source,
|
|
21
23
|
action = props.action,
|
|
24
|
+
url = props.url,
|
|
22
25
|
method = props.method,
|
|
23
26
|
params = props.params,
|
|
24
27
|
fileName = props.fileName,
|
|
@@ -26,6 +29,8 @@ var ProDownload = function ProDownload(props) {
|
|
|
26
29
|
children = props.children,
|
|
27
30
|
onFinish = props.onFinish,
|
|
28
31
|
beforeDownload = props.beforeDownload,
|
|
32
|
+
className = props.className,
|
|
33
|
+
transformResponse = props.transformResponse,
|
|
29
34
|
defaultProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
30
35
|
var _useSetState = (0, _ahooks.useSetState)({
|
|
31
36
|
loading: false
|
|
@@ -35,7 +40,7 @@ var ProDownload = function ProDownload(props) {
|
|
|
35
40
|
setState = _useSetState2[1];
|
|
36
41
|
var handDownload = /*#__PURE__*/function () {
|
|
37
42
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
38
|
-
var
|
|
43
|
+
var _params;
|
|
39
44
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
40
45
|
while (1) switch (_context.prev = _context.next) {
|
|
41
46
|
case 0:
|
|
@@ -43,77 +48,89 @@ var ProDownload = function ProDownload(props) {
|
|
|
43
48
|
_context.next = 3;
|
|
44
49
|
break;
|
|
45
50
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
try {
|
|
52
|
+
fetch(url || action).then(function (response) {
|
|
53
|
+
if (response.status > 400) {
|
|
54
|
+
return Promise.reject(new Error("Service exception: ".concat(response.status)));
|
|
55
|
+
}
|
|
56
|
+
return response.blob();
|
|
57
|
+
}).then(function (res) {
|
|
58
|
+
var blob = new Blob([res]);
|
|
59
|
+
(0, _utils.BlobMakeFile)({
|
|
60
|
+
blob: blob,
|
|
61
|
+
fileName: fileName
|
|
62
|
+
});
|
|
53
63
|
});
|
|
54
|
-
})
|
|
64
|
+
} catch (error) {
|
|
65
|
+
Promise.reject(error);
|
|
66
|
+
}
|
|
55
67
|
return _context.abrupt("return");
|
|
56
68
|
case 3:
|
|
57
69
|
setState({
|
|
58
70
|
loading: true
|
|
59
71
|
});
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return (0, _DownloadHelper.DownloadRequest)({
|
|
64
|
-
url: action,
|
|
65
|
-
method: method,
|
|
66
|
-
headers: headers,
|
|
67
|
-
payload: params
|
|
68
|
-
});
|
|
69
|
-
case 7:
|
|
70
|
-
res = _context.sent;
|
|
71
|
-
data = _lodash.default.get(res, 'data');
|
|
72
|
-
if (!data) {
|
|
73
|
-
_context.next = 13;
|
|
72
|
+
_params = params;
|
|
73
|
+
if (!(0, _lodash.isFunction)(params)) {
|
|
74
|
+
_context.next = 14;
|
|
74
75
|
break;
|
|
75
76
|
}
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
if (!(params.constructor.name === 'AsyncFunction')) {
|
|
78
|
+
_context.next = 12;
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
_context.next = 9;
|
|
82
|
+
return params();
|
|
83
|
+
case 9:
|
|
84
|
+
_context.t0 = _context.sent;
|
|
85
|
+
_context.next = 13;
|
|
78
86
|
break;
|
|
87
|
+
case 12:
|
|
88
|
+
_context.t0 = params();
|
|
79
89
|
case 13:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
_params = _context.t0;
|
|
91
|
+
case 14:
|
|
92
|
+
_context.prev = 14;
|
|
93
|
+
_context.next = 17;
|
|
94
|
+
return (0, _utils.DownloadRequest)({
|
|
95
|
+
url: url || action,
|
|
96
|
+
method: method,
|
|
97
|
+
headers: headers,
|
|
98
|
+
params: _params,
|
|
99
|
+
transformResponse: transformResponse,
|
|
100
|
+
fileName: fileName,
|
|
101
|
+
onFinish: onFinish
|
|
89
102
|
});
|
|
90
|
-
case
|
|
91
|
-
_context.next =
|
|
103
|
+
case 17:
|
|
104
|
+
_context.next = 23;
|
|
92
105
|
break;
|
|
93
|
-
case
|
|
94
|
-
_context.prev =
|
|
95
|
-
_context.
|
|
106
|
+
case 19:
|
|
107
|
+
_context.prev = 19;
|
|
108
|
+
_context.t1 = _context["catch"](14);
|
|
96
109
|
setState({
|
|
97
110
|
loading: false
|
|
98
111
|
});
|
|
99
112
|
return _context.abrupt("return", Promise.reject());
|
|
100
|
-
case
|
|
101
|
-
_context.prev =
|
|
113
|
+
case 23:
|
|
114
|
+
_context.prev = 23;
|
|
102
115
|
setState({
|
|
103
116
|
loading: false
|
|
104
117
|
});
|
|
105
|
-
return _context.finish(
|
|
106
|
-
case
|
|
118
|
+
return _context.finish(23);
|
|
119
|
+
case 26:
|
|
107
120
|
case "end":
|
|
108
121
|
return _context.stop();
|
|
109
122
|
}
|
|
110
|
-
}, _callee, null, [[
|
|
123
|
+
}, _callee, null, [[14, 19, 23, 26]]);
|
|
111
124
|
}));
|
|
112
125
|
return function handDownload() {
|
|
113
126
|
return _ref.apply(this, arguments);
|
|
114
127
|
};
|
|
115
128
|
}();
|
|
116
|
-
|
|
129
|
+
var cls = (0, _classnames.default)(className, {
|
|
130
|
+
'pro-download': true
|
|
131
|
+
});
|
|
132
|
+
return (0, _jsxRuntime.jsx)(_antd.Button, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
133
|
+
className: cls,
|
|
117
134
|
onClick: function () {
|
|
118
135
|
var _onClick = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3() {
|
|
119
136
|
var res;
|
|
@@ -158,13 +175,8 @@ var ProDownload = function ProDownload(props) {
|
|
|
158
175
|
}
|
|
159
176
|
return _context3.abrupt("return");
|
|
160
177
|
case 13:
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
case 15:
|
|
164
|
-
if (_lodash.default.isFunction(onFinish)) {
|
|
165
|
-
onFinish();
|
|
166
|
-
}
|
|
167
|
-
case 16:
|
|
178
|
+
handDownload();
|
|
179
|
+
case 14:
|
|
168
180
|
case "end":
|
|
169
181
|
return _context3.stop();
|
|
170
182
|
}
|
|
@@ -176,8 +188,9 @@ var ProDownload = function ProDownload(props) {
|
|
|
176
188
|
return onClick;
|
|
177
189
|
}()
|
|
178
190
|
}, defaultProps), {}, {
|
|
179
|
-
loading: loading
|
|
180
|
-
|
|
191
|
+
loading: loading,
|
|
192
|
+
children: children
|
|
193
|
+
}));
|
|
181
194
|
};
|
|
182
|
-
|
|
183
|
-
exports.default =
|
|
195
|
+
ProDownload.downLoadRequest = _utils.DownloadRequest;
|
|
196
|
+
var _default = exports.default = ProDownload;
|
|
@@ -1,31 +1,38 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import type { ButtonProps } from 'antd';
|
|
3
|
+
import type { DownloadRequestProps, PropsWithMakeFilePropsType } from './utils';
|
|
3
4
|
export interface IProDownloadProps extends ButtonProps {
|
|
4
5
|
/**
|
|
5
6
|
* @description 下载资源获取来源:api:通过接口获取,url:通过静态资源链接获取
|
|
6
7
|
* @default api
|
|
7
8
|
*/
|
|
8
9
|
source?: string;
|
|
10
|
+
/**
|
|
11
|
+
* @description 下载请求的地址
|
|
12
|
+
* @default (必选)
|
|
13
|
+
*/
|
|
14
|
+
url: string;
|
|
9
15
|
/**
|
|
10
16
|
* @description 下载请求的地址
|
|
11
|
-
* @
|
|
17
|
+
* @deprecated 弃用,请使用url进行替换
|
|
18
|
+
* @default (非必选)
|
|
12
19
|
*/
|
|
13
|
-
action
|
|
20
|
+
action?: string;
|
|
14
21
|
/**
|
|
15
22
|
* @description 下载请求的类型
|
|
16
23
|
* @default post
|
|
17
24
|
*/
|
|
18
|
-
method?:
|
|
25
|
+
method?: 'post' | 'get';
|
|
19
26
|
/**
|
|
20
27
|
* @description 下载所需额外参数或返回上传额外参数的方法
|
|
21
28
|
* @default -
|
|
22
29
|
*/
|
|
23
|
-
params?:
|
|
30
|
+
params?: any;
|
|
24
31
|
/**
|
|
25
32
|
* @description 下载保存的文件名
|
|
26
33
|
* @default (必选)
|
|
27
34
|
*/
|
|
28
|
-
fileName
|
|
35
|
+
fileName?: string;
|
|
29
36
|
/**
|
|
30
37
|
* @description 设置上传的请求头部,IE10 以上有效
|
|
31
38
|
* @default -
|
|
@@ -36,6 +43,8 @@ export interface IProDownloadProps extends ButtonProps {
|
|
|
36
43
|
* @default false
|
|
37
44
|
*/
|
|
38
45
|
disabled?: boolean;
|
|
46
|
+
/** 格式化数据 */
|
|
47
|
+
transformResponse?: (data: any) => any;
|
|
39
48
|
/**
|
|
40
49
|
* @description 上传文件之前的钩子,若返回 false 则停止下载。支持返回一个 Promise 对象,Promise 对象 reject 时则停止下载
|
|
41
50
|
* @default -
|
|
@@ -50,5 +59,8 @@ export interface IProDownloadProps extends ButtonProps {
|
|
|
50
59
|
* @description 下载按钮的填充内容
|
|
51
60
|
* @default -
|
|
52
61
|
*/
|
|
53
|
-
|
|
62
|
+
downLoadRequest?: DownloadRequestProps;
|
|
63
|
+
downLoadBlobUrl?: PropsWithMakeFilePropsType;
|
|
64
|
+
children?: string | ReactNode;
|
|
65
|
+
[key: string]: any;
|
|
54
66
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export interface PropsWithMakeFilePropsType {
|
|
2
|
+
blob?: Blob;
|
|
3
|
+
fileName: string;
|
|
4
|
+
url?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface IDownloadRequestPropsType {
|
|
7
|
+
/**
|
|
8
|
+
* @description 下载请求的地址
|
|
9
|
+
* @default (必选)
|
|
10
|
+
*/
|
|
11
|
+
url: string;
|
|
12
|
+
/**
|
|
13
|
+
* @description 下载请求的类型
|
|
14
|
+
* @default post
|
|
15
|
+
*/
|
|
16
|
+
method?: 'post' | 'get';
|
|
17
|
+
/**
|
|
18
|
+
* @description 下载所需额外参数或返回上传额外参数的方法
|
|
19
|
+
* @default -
|
|
20
|
+
*/
|
|
21
|
+
params?: any;
|
|
22
|
+
headers?: any;
|
|
23
|
+
/** 格式化数据 */
|
|
24
|
+
transformResponse?: (data: any) => any;
|
|
25
|
+
/**
|
|
26
|
+
* @description service 执行完成时触发
|
|
27
|
+
* @default -
|
|
28
|
+
*/
|
|
29
|
+
onFinish?: (response: object, params: object) => void;
|
|
30
|
+
/**
|
|
31
|
+
* @description 下载保存的文件名
|
|
32
|
+
* @default (必选)
|
|
33
|
+
*/
|
|
34
|
+
fileName?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* 下载Blob
|
|
38
|
+
*
|
|
39
|
+
* @param response
|
|
40
|
+
* @param fileName
|
|
41
|
+
* @param extendName
|
|
42
|
+
* @constructor
|
|
43
|
+
*/
|
|
44
|
+
export declare function BlobMakeFile({ blob, fileName, url }: PropsWithMakeFilePropsType): void;
|
|
45
|
+
export type DownloadRequestProps = (props: IDownloadRequestPropsType) => Promise<Response>;
|
|
46
|
+
type convertBase64ToBlobType = (base64: string, fileType?: string, slice?: number) => Blob;
|
|
47
|
+
export declare const convertBase64ToBlob: convertBase64ToBlobType;
|
|
48
|
+
/**
|
|
49
|
+
* 从Content-Disposition获取filename
|
|
50
|
+
* @param contentDisposition string
|
|
51
|
+
* @returns string
|
|
52
|
+
*/
|
|
53
|
+
export declare function getFilenameFromContentDisposition(contentDisposition: any): string;
|
|
54
|
+
export declare const DownloadRequest: DownloadRequestProps;
|
|
55
|
+
export {};
|
|
@@ -6,12 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.BlobMakeFile = BlobMakeFile;
|
|
8
8
|
exports.convertBase64ToBlob = exports.DownloadRequest = void 0;
|
|
9
|
-
exports.
|
|
9
|
+
exports.getFilenameFromContentDisposition = getFilenameFromContentDisposition;
|
|
10
10
|
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
11
11
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
12
12
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
13
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
14
14
|
var _antd = require("antd");
|
|
15
|
+
var _lodash = require("lodash");
|
|
15
16
|
/* eslint-disable no-empty */
|
|
16
17
|
/* eslint-disable prefer-promise-reject-errors */
|
|
17
18
|
|
|
@@ -50,14 +51,39 @@ function BlobMakeFile(_ref) {
|
|
|
50
51
|
ele.click();
|
|
51
52
|
doc.body.removeChild(ele);
|
|
52
53
|
}
|
|
54
|
+
var convertBase64ToBlob = exports.convertBase64ToBlob = function convertBase64ToBlob(base64, fileType) {
|
|
55
|
+
var _atob$match;
|
|
56
|
+
var slice = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1024;
|
|
57
|
+
return new Blob((_atob$match = atob(base64).match(new RegExp("([\\s\\S]{".concat(slice, "})|([\\s\\S]{1,").concat(slice, "})"), 'g'))) === null || _atob$match === void 0 ? void 0 : _atob$match.map(function (item) {
|
|
58
|
+
return new Uint8Array(item.split('').map(function (s, i) {
|
|
59
|
+
return item.charCodeAt(i);
|
|
60
|
+
}));
|
|
61
|
+
}), {
|
|
62
|
+
type: fileType
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* 从Content-Disposition获取filename
|
|
67
|
+
* @param contentDisposition string
|
|
68
|
+
* @returns string
|
|
69
|
+
*/
|
|
70
|
+
function getFilenameFromContentDisposition(contentDisposition) {
|
|
71
|
+
var pattern = /filename=([^;]+)/i;
|
|
72
|
+
var matches = pattern.exec(contentDisposition);
|
|
73
|
+
if (matches && matches[1]) {
|
|
74
|
+
// remove double quotes if filename is quoted
|
|
75
|
+
return matches[1].replace(/^"?(.+?)"?$/, '$1');
|
|
76
|
+
}
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
53
79
|
// 发起请求获取下载文件
|
|
54
|
-
var DownloadRequest = /*#__PURE__*/function () {
|
|
80
|
+
var DownloadRequest = exports.DownloadRequest = /*#__PURE__*/function () {
|
|
55
81
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(_ref2) {
|
|
56
|
-
var url, _ref2$method, method,
|
|
82
|
+
var url, _ref2$method, method, params, headers, transformResponse, fileName, onFinish, config, res, fileBlob, data, contentFileName;
|
|
57
83
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
|
58
84
|
while (1) switch (_context2.prev = _context2.next) {
|
|
59
85
|
case 0:
|
|
60
|
-
url = _ref2.url, _ref2$method = _ref2.method, method = _ref2$method === void 0 ? 'post' : _ref2$method,
|
|
86
|
+
url = _ref2.url, _ref2$method = _ref2.method, method = _ref2$method === void 0 ? 'post' : _ref2$method, params = _ref2.params, headers = _ref2.headers, transformResponse = _ref2.transformResponse, fileName = _ref2.fileName, onFinish = _ref2.onFinish;
|
|
61
87
|
config = {
|
|
62
88
|
method: method,
|
|
63
89
|
credentials: 'include',
|
|
@@ -66,21 +92,22 @@ var DownloadRequest = /*#__PURE__*/function () {
|
|
|
66
92
|
accept: 'application/json;charset=UTF-8'
|
|
67
93
|
},
|
|
68
94
|
body: null
|
|
69
|
-
}; // method = post and
|
|
70
|
-
if (method === 'post' &&
|
|
71
|
-
config.body = JSON.stringify(
|
|
95
|
+
}; // method = post and params, add it to the fetch request
|
|
96
|
+
if (method === 'post' && params) {
|
|
97
|
+
config.body = JSON.stringify(params);
|
|
72
98
|
}
|
|
73
99
|
// 处理get请求入参
|
|
74
|
-
if (method === 'get' &&
|
|
75
|
-
url = "".concat(url).concat(url.indexOf('?') !== -1 ? '&' : '?').concat(stringify(
|
|
100
|
+
if (method === 'get' && params) {
|
|
101
|
+
url = "".concat(url).concat(url.indexOf('?') !== -1 ? '&' : '?').concat(stringify(params));
|
|
76
102
|
}
|
|
77
103
|
// if custom headers need to be set for the specific request
|
|
78
104
|
if (headers && (0, _typeof2.default)(headers) === 'object' && Object.keys(headers).length > 0) {
|
|
79
105
|
config.headers = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, config.headers), headers);
|
|
80
106
|
}
|
|
81
|
-
|
|
107
|
+
_context2.next = 7;
|
|
108
|
+
return fetch(url, config).then( /*#__PURE__*/function () {
|
|
82
109
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(response) {
|
|
83
|
-
var
|
|
110
|
+
var _data, errorMsg;
|
|
84
111
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
85
112
|
while (1) switch (_context.prev = _context.next) {
|
|
86
113
|
case 0:
|
|
@@ -88,39 +115,83 @@ var DownloadRequest = /*#__PURE__*/function () {
|
|
|
88
115
|
_context.next = 3;
|
|
89
116
|
return response.clone().json();
|
|
90
117
|
case 3:
|
|
91
|
-
|
|
92
|
-
if (
|
|
93
|
-
_context.next =
|
|
118
|
+
_data = _context.sent;
|
|
119
|
+
if (_data) {
|
|
120
|
+
_context.next = 7;
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
_antd.message.error('请求失败!');
|
|
124
|
+
return _context.abrupt("return", Promise.reject('请求失败!'));
|
|
125
|
+
case 7:
|
|
126
|
+
if (!((_data === null || _data === void 0 ? void 0 : _data.status) > 200 || (_data === null || _data === void 0 ? void 0 : _data.code) === 401)) {
|
|
127
|
+
_context.next = 11;
|
|
94
128
|
break;
|
|
95
129
|
}
|
|
96
|
-
errorMsg = (
|
|
130
|
+
errorMsg = (_data === null || _data === void 0 ? void 0 : _data.message) || (_data === null || _data === void 0 ? void 0 : _data.msg);
|
|
97
131
|
errorMsg && _antd.message.error(errorMsg);
|
|
98
132
|
return _context.abrupt("return", Promise.reject(errorMsg));
|
|
99
|
-
case 8:
|
|
100
|
-
Promise.resolve(data);
|
|
101
|
-
_context.next = 15;
|
|
102
|
-
break;
|
|
103
133
|
case 11:
|
|
104
|
-
|
|
134
|
+
if (!(0, _lodash.isFunction)(transformResponse)) {
|
|
135
|
+
_context.next = 13;
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
return _context.abrupt("return", Promise.resolve(transformResponse(_data)));
|
|
139
|
+
case 13:
|
|
140
|
+
Promise.resolve(_data);
|
|
141
|
+
_context.next = 20;
|
|
142
|
+
break;
|
|
143
|
+
case 16:
|
|
144
|
+
_context.prev = 16;
|
|
105
145
|
_context.t0 = _context["catch"](0);
|
|
106
146
|
if (!response.ok) {
|
|
107
|
-
_context.next =
|
|
147
|
+
_context.next = 20;
|
|
108
148
|
break;
|
|
109
149
|
}
|
|
110
150
|
return _context.abrupt("return", Promise.resolve(response));
|
|
111
|
-
case
|
|
151
|
+
case 20:
|
|
112
152
|
return _context.abrupt("return", Promise.reject('请求失败!'));
|
|
113
|
-
case
|
|
153
|
+
case 21:
|
|
114
154
|
case "end":
|
|
115
155
|
return _context.stop();
|
|
116
156
|
}
|
|
117
|
-
}, _callee, null, [[0,
|
|
157
|
+
}, _callee, null, [[0, 16]]);
|
|
118
158
|
}));
|
|
119
159
|
return function (_x2) {
|
|
120
160
|
return _ref4.apply(this, arguments);
|
|
121
161
|
};
|
|
122
|
-
}())
|
|
123
|
-
case
|
|
162
|
+
}());
|
|
163
|
+
case 7:
|
|
164
|
+
res = _context2.sent;
|
|
165
|
+
data = null;
|
|
166
|
+
contentFileName = '';
|
|
167
|
+
if ((0, _lodash.isFunction)(transformResponse)) {
|
|
168
|
+
data = res;
|
|
169
|
+
} else {
|
|
170
|
+
// 优先获取Content-Disposition中filename
|
|
171
|
+
contentFileName = getFilenameFromContentDisposition(res.headers.get('Content-Disposition'));
|
|
172
|
+
data = (0, _lodash.get)(res, 'data');
|
|
173
|
+
}
|
|
174
|
+
if (!data) {
|
|
175
|
+
_context2.next = 15;
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
fileBlob = convertBase64ToBlob(data);
|
|
179
|
+
_context2.next = 18;
|
|
180
|
+
break;
|
|
181
|
+
case 15:
|
|
182
|
+
_context2.next = 17;
|
|
183
|
+
return res.blob();
|
|
184
|
+
case 17:
|
|
185
|
+
fileBlob = _context2.sent;
|
|
186
|
+
case 18:
|
|
187
|
+
// 完成回调
|
|
188
|
+
onFinish === null || onFinish === void 0 ? void 0 : onFinish(res, params);
|
|
189
|
+
BlobMakeFile({
|
|
190
|
+
blob: fileBlob,
|
|
191
|
+
fileName: fileName || contentFileName
|
|
192
|
+
});
|
|
193
|
+
return _context2.abrupt("return", Promise.resolve(res));
|
|
194
|
+
case 21:
|
|
124
195
|
case "end":
|
|
125
196
|
return _context2.stop();
|
|
126
197
|
}
|
|
@@ -129,55 +200,4 @@ var DownloadRequest = /*#__PURE__*/function () {
|
|
|
129
200
|
return function DownloadRequest(_x) {
|
|
130
201
|
return _ref3.apply(this, arguments);
|
|
131
202
|
};
|
|
132
|
-
}();
|
|
133
|
-
exports.DownloadRequest = DownloadRequest;
|
|
134
|
-
function postDownloadFile(_ref5) {
|
|
135
|
-
var url = _ref5.url,
|
|
136
|
-
params = _ref5.params,
|
|
137
|
-
cb = _ref5.cb;
|
|
138
|
-
if (!url) {
|
|
139
|
-
return false;
|
|
140
|
-
}
|
|
141
|
-
// 删除重复创建的Form
|
|
142
|
-
var downloadForm = document.querySelector('#downloadForm');
|
|
143
|
-
if (downloadForm) {
|
|
144
|
-
document.body.removeChild(downloadForm);
|
|
145
|
-
}
|
|
146
|
-
try {
|
|
147
|
-
var form = document.createElement('form');
|
|
148
|
-
form.action = url;
|
|
149
|
-
form.id = 'downloadForm';
|
|
150
|
-
form.style = 'display:none';
|
|
151
|
-
form.method = 'post';
|
|
152
|
-
form.target = '_blank';
|
|
153
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
154
|
-
for (var key in params) {
|
|
155
|
-
if (Object.prototype.hasOwnProperty.call(params, key)) {
|
|
156
|
-
var newInput = document.createElement('input');
|
|
157
|
-
newInput.type = 'hidden';
|
|
158
|
-
newInput.name = key;
|
|
159
|
-
newInput.value = params[key];
|
|
160
|
-
form.appendChild(newInput);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
document.body.appendChild(form);
|
|
164
|
-
form.submit();
|
|
165
|
-
setTimeout(function () {
|
|
166
|
-
cb && cb();
|
|
167
|
-
}, 3000);
|
|
168
|
-
} catch (e) {
|
|
169
|
-
console.warn(e);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
var convertBase64ToBlob = function convertBase64ToBlob(base64, fileType) {
|
|
173
|
-
var _atob$match;
|
|
174
|
-
var slice = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1024;
|
|
175
|
-
return new Blob((_atob$match = atob(base64).match(new RegExp("([\\s\\S]{".concat(slice, "})|([\\s\\S]{1,").concat(slice, "})"), 'g'))) === null || _atob$match === void 0 ? void 0 : _atob$match.map(function (item) {
|
|
176
|
-
return new Uint8Array(item.split('').map(function (s, i) {
|
|
177
|
-
return item.charCodeAt(i);
|
|
178
|
-
}));
|
|
179
|
-
}), {
|
|
180
|
-
type: fileType
|
|
181
|
-
});
|
|
182
|
-
};
|
|
183
|
-
exports.convertBase64ToBlob = convertBase64ToBlob;
|
|
203
|
+
}();
|