@zat-design/sisyphus-react 3.13.19-beta.5 → 3.13.19-beta.7
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/.claude/CLAUDE.md +44 -0
- package/.claude/settings.local.json +17 -0
- package/PROJECT_GUIDE.md +250 -0
- package/dist/sisyphus-react.min.css +2 -0
- package/dist/sisyphus-react.min.js +1 -0
- package/es/FormsProvider/index.js +9 -7
- package/es/ProAction/components/CheckModalContent/index.js +14 -14
- package/es/ProAction/index.js +46 -47
- package/es/ProConfigProvider/index.js +25 -19
- package/es/ProDownload/index.js +66 -73
- package/es/ProDownload/utils.js +26 -23
- package/es/ProDrawerForm/components/ProDrawer/index.js +43 -39
- package/es/ProDrawerForm/components/ProModal/index.js +25 -23
- package/es/ProDrawerForm/components/index.js +2 -2
- package/es/ProDrawerForm/index.js +19 -21
- package/es/ProDrawerForm/utils/index.js +1 -1
- package/es/ProEditLabel/components/RenderProForm.js +30 -26
- package/es/ProEditLabel/index.js +49 -36
- package/es/ProEditLabel/utils/index.js +4 -3
- package/es/ProEditTable/components/ActionButton/index.js +83 -76
- package/es/ProEditTable/components/RcTable/BaseTable.js +24 -24
- package/es/ProEditTable/components/RcTable/DraggableTable.js +34 -41
- package/es/ProEditTable/components/RcTable/VirtualTable.js +4 -3
- package/es/ProEditTable/components/RcTable/index.js +3 -3
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +61 -57
- package/es/ProEditTable/components/RenderField/index.js +151 -145
- package/es/ProEditTable/components/RenderToolbar/index.js +37 -42
- package/es/ProEditTable/components/Summary/index.js +22 -21
- package/es/ProEditTable/components/Validator/index.js +11 -10
- package/es/ProEditTable/components/index.js +5 -5
- package/es/ProEditTable/index.d.ts +1 -1
- package/es/ProEditTable/index.js +170 -173
- package/es/ProEditTable/utils/config.js +42 -46
- package/es/ProEditTable/utils/diffOriginal.js +34 -19
- package/es/ProEditTable/utils/getDefaultProps.js +12 -13
- package/es/ProEditTable/utils/index.js +102 -99
- package/es/ProEditTable/utils/tools.js +88 -91
- package/es/ProEditTable/utils/transform.js +7 -11
- package/es/ProEditTable/utils/useEditTableError.js +22 -13
- package/es/ProEnum/components/Group.js +23 -27
- package/es/ProEnum/components/Tag.js +14 -16
- package/es/ProEnum/hooks/useEnum.js +32 -14
- package/es/ProEnum/hooks/useEnumRequest.js +42 -42
- package/es/ProEnum/hooks/useFrequentEnumRequest.js +16 -16
- package/es/ProEnum/index.js +84 -102
- package/es/ProEnum/utils/eventCenter.js +23 -32
- package/es/ProEnum/utils/frequentEnum.js +15 -4
- package/es/ProEnum/utils/getEnumLabel.js +16 -21
- package/es/ProEnum/utils/index.js +12 -7
- package/es/ProForm/components/Container.js +8 -6
- package/es/ProForm/components/FormFooter/index.js +21 -19
- package/es/ProForm/components/base/Checkbox/index.js +16 -15
- package/es/ProForm/components/base/DatePicker/index.js +23 -20
- package/es/ProForm/components/base/Input/index.js +20 -18
- package/es/ProForm/components/base/InputNumber/index.js +57 -53
- package/es/ProForm/components/base/Radio/index.js +15 -15
- package/es/ProForm/components/base/RangePicker/index.js +24 -29
- package/es/ProForm/components/base/RangePicker/useDateRange.js +3 -3
- package/es/ProForm/components/base/Select/index.js +17 -15
- package/es/ProForm/components/base/Switch/index.js +16 -15
- package/es/ProForm/components/base/SwitchCheckbox/index.js +19 -18
- package/es/ProForm/components/base/TextArea/index.js +18 -17
- package/es/ProForm/components/base/TimePicker/index.js +10 -9
- package/es/ProForm/components/combination/Container/index.js +25 -23
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +80 -92
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +21 -19
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +7 -7
- package/es/ProForm/components/combination/FormList/components/Empty.js +21 -20
- package/es/ProForm/components/combination/FormList/components/LineFields.js +19 -18
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +45 -51
- package/es/ProForm/components/combination/FormList/index.js +43 -51
- package/es/ProForm/components/combination/FormList/utils.js +9 -9
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.js +8 -6
- package/es/ProForm/components/combination/Group/component/ComRender.js +33 -29
- package/es/ProForm/components/combination/Group/hooks/index.js +49 -47
- package/es/ProForm/components/combination/Group/index.js +38 -37
- package/es/ProForm/components/combination/Group/utils.js +56 -50
- package/es/ProForm/components/combination/ProCascader/index.js +81 -85
- package/es/ProForm/components/combination/ProCascader/utils/index.js +6 -6
- package/es/ProForm/components/combination/ProCombination/index.js +41 -37
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +31 -25
- package/es/ProForm/components/combination/ProModalSelect/index.js +166 -173
- package/es/ProForm/components/combination/ProModalSelect/utils/index.js +1 -1
- package/es/ProForm/components/combination/ProNumberRange/index.js +46 -51
- package/es/ProForm/components/combination/ProRangeLimit/index.js +39 -39
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +3 -3
- package/es/ProForm/components/combination/ProTimeLimit/index.js +43 -40
- package/es/ProForm/components/index.d.ts +1 -0
- package/es/ProForm/components/index.js +40 -35
- package/es/ProForm/components/old/EnumSelect/hooks/useRequestList.js +30 -28
- package/es/ProForm/components/old/EnumSelect/index.js +55 -62
- package/es/ProForm/components/old/InputRange/index.js +17 -16
- package/es/ProForm/components/old/InputWithSuffix/index.js +6 -5
- package/es/ProForm/components/old/ProAddress/index.js +53 -75
- package/es/ProForm/components/old/ProCertNo/index.js +17 -17
- package/es/ProForm/components/old/ProCertValidity/index.js +19 -21
- package/es/ProForm/components/old/ProRangeBox/index.js +25 -24
- package/es/ProForm/components/render/ChangedWrapper.js +34 -33
- package/es/ProForm/components/render/ConfirmWrapper.js +16 -18
- package/es/ProForm/components/render/Render.js +150 -135
- package/es/ProForm/components/render/RenderFields.js +65 -50
- package/es/ProForm/components/render/propsType.js +25 -0
- package/es/ProForm/index.js +83 -70
- package/es/ProForm/propsType.d.ts +1 -1
- package/es/ProForm/propsType.js +5 -1
- package/es/ProForm/utils/diffOriginal.js +30 -16
- package/es/ProForm/utils/getDefaultProps.js +10 -10
- package/es/ProForm/utils/index.js +105 -110
- package/es/ProForm/utils/processDependencies.js +15 -5
- package/es/ProForm/utils/rulesCreator.js +21 -22
- package/es/ProForm/utils/transformNames.js +7 -6
- package/es/ProForm/utils/transformValue.js +16 -13
- package/es/ProForm/utils/useDeepCompareMemo.js +6 -4
- package/es/ProForm/utils/useFieldProps.js +1 -3
- package/es/ProForm/utils/useForm.js +36 -34
- package/es/ProForm/utils/useRules.js +28 -31
- package/es/ProForm/utils/useShouldUpdate.js +83 -86
- package/es/ProForm/utils/useWatch.js +36 -14
- package/es/ProForm/utils/valueType.js +51 -52
- package/es/ProIcon/config/index.js +2 -0
- package/es/ProIcon/index.js +53 -49
- package/es/ProIcon/utils/index.js +8 -9
- package/es/ProLayout/components/Layout/Header/index.js +13 -11
- package/es/ProLayout/components/Layout/Icon/Icon.js +7 -7
- package/es/ProLayout/components/Layout/Icon/index.js +1 -1
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +42 -40
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +51 -52
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +10 -9
- package/es/ProLayout/components/Layout/Menu/index.js +20 -18
- package/es/ProLayout/components/Layout/Notice/index.js +12 -11
- package/es/ProLayout/components/Layout/index.js +4 -4
- package/es/ProLayout/components/ProCollapse/index.js +35 -32
- package/es/ProLayout/components/ProFooter/index.js +13 -15
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +9 -9
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +8 -7
- package/es/ProLayout/components/ProHeader/components/index.js +2 -2
- package/es/ProLayout/components/ProHeader/index.js +129 -118
- package/es/ProLayout/components/ProHeader/utils/index.js +1 -1
- package/es/ProLayout/components/index.js +3 -3
- package/es/ProLayout/index.d.ts +1 -1
- package/es/ProLayout/index.js +28 -25
- package/es/ProLayout/utils/index.js +37 -35
- package/es/ProSelect/components/AdaptiveTooltip.js +10 -11
- package/es/ProSelect/index.js +87 -99
- package/es/ProSelect/utils/index.js +27 -33
- package/es/ProStep/components/Anchor/index.d.ts +1 -0
- package/es/ProStep/components/Anchor/index.js +26 -25
- package/es/ProStep/components/Item/index.d.ts +1 -0
- package/es/ProStep/components/Item/index.js +26 -22
- package/es/ProStep/components/Listener/index.js +11 -15
- package/es/ProStep/components/Step/index.js +24 -25
- package/es/ProStep/index.js +51 -53
- package/es/ProStep/utils/index.js +13 -12
- package/es/ProStepTab/index.js +59 -37
- package/es/ProTable/components/FormatColumn/index.js +106 -110
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +7 -9
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +36 -50
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +24 -24
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +8 -10
- package/es/ProTable/components/RcTable/index.js +2 -2
- package/es/ProTable/components/RenderColumn/index.js +51 -51
- package/es/ProTable/components/RenderEmptyText/index.js +8 -7
- package/es/ProTable/components/RenderFooter/index.js +3 -3
- package/es/ProTable/components/RenderSummary/index.js +13 -13
- package/es/ProTable/components/RenderTableHeader/index.js +16 -14
- package/es/ProTable/components/RenderTabs/index.js +28 -33
- package/es/ProTable/components/TableResizable/index.js +17 -16
- package/es/ProTable/components/TooltipTitle/index.js +7 -6
- package/es/ProTable/components/index.js +11 -6
- package/es/ProTable/hooks/useAntdTable.js +106 -119
- package/es/ProTable/index.js +158 -176
- package/es/ProTable/utils/index.js +25 -21
- package/es/ProTabs/components/Card/index.js +15 -14
- package/es/ProTabs/components/index.js +1 -1
- package/es/ProTabs/index.js +24 -25
- package/es/ProThemeTools/component/ProTools/index.js +69 -68
- package/es/ProThemeTools/component/index.js +1 -1
- package/es/ProThemeTools/index.js +47 -33
- package/es/ProThemeTools/utils/index.js +20 -17
- package/es/ProTooltip/index.js +44 -46
- package/es/ProTree/components/AdaptiveTooltip.js +5 -7
- package/es/ProTree/components/CloseIcon.js +5 -5
- package/es/ProTree/components/List.js +22 -24
- package/es/ProTree/components/ProTree.js +84 -102
- package/es/ProTree/components/ProTreeSelect/index.js +128 -119
- package/es/ProTree/components/SearchTitle.js +10 -9
- package/es/ProTree/components/Tree.js +57 -58
- package/es/ProTree/components/index.js +4 -4
- package/es/ProTree/index.js +6 -6
- package/es/ProTree/utils.js +29 -22
- package/es/ProTreeModal/components/Cascader.js +31 -33
- package/es/ProTreeModal/components/CloseIcon.js +5 -5
- package/es/ProTreeModal/components/List.js +74 -93
- package/es/ProTreeModal/components/SearchTitle.js +5 -4
- package/es/ProTreeModal/components/SortableItem.js +14 -14
- package/es/ProTreeModal/components/Tree.js +49 -53
- package/es/ProTreeModal/components/Trigger.js +29 -28
- package/es/ProTreeModal/components/index.js +6 -6
- package/es/ProTreeModal/index.js +166 -206
- package/es/ProTreeModal/utils.js +37 -33
- package/es/ProUpload/components/ButtonRender.js +33 -36
- package/es/ProUpload/components/DragRender.js +54 -51
- package/es/ProUpload/components/DraggableUploadListItem.js +5 -4
- package/es/ProUpload/components/Example.js +13 -12
- package/es/ProUpload/components/FileItem.js +63 -58
- package/es/ProUpload/components/ImageRender.js +98 -100
- package/es/ProUpload/index.js +75 -82
- package/es/ProUpload/uitls.js +3 -3
- package/es/ProUtils/utils/index.js +10 -14
- package/es/ProViewer/index.js +29 -25
- package/es/ProViewer/propsType.js +0 -1
- package/es/ProWaterMark/index.js +5 -4
- package/es/index.d.ts +1 -1
- package/es/index.js +38 -29
- package/es/locale/index.js +7 -4
- package/es/old/ProCertValidity/index.js +19 -21
- package/es/old/ProEditableTable/index.js +156 -156
- package/es/old/ProEditableTable/utils.js +61 -63
- package/es/tokens.js +1 -0
- package/es/utils/index.js +12 -12
- package/lib/FormsProvider/index.js +11 -7
- package/lib/ProAction/components/CheckModalContent/index.js +11 -13
- package/lib/ProAction/index.js +40 -43
- package/lib/ProConfigProvider/index.js +23 -16
- package/lib/ProDownload/index.js +65 -71
- package/lib/ProDownload/utils.js +25 -22
- package/lib/ProDrawerForm/components/ProDrawer/index.js +39 -38
- package/lib/ProDrawerForm/components/ProModal/index.js +23 -22
- package/lib/ProDrawerForm/index.js +18 -18
- package/lib/ProDrawerForm/utils/index.js +3 -2
- package/lib/ProEditLabel/components/RenderProForm.js +26 -24
- package/lib/ProEditLabel/index.js +46 -35
- package/lib/ProEditLabel/utils/index.js +6 -5
- package/lib/ProEditTable/components/ActionButton/index.js +79 -74
- package/lib/ProEditTable/components/RcTable/BaseTable.js +21 -23
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +32 -40
- package/lib/ProEditTable/components/RcTable/VirtualTable.js +3 -3
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +62 -59
- package/lib/ProEditTable/components/RenderField/index.js +137 -132
- package/lib/ProEditTable/components/RenderToolbar/index.js +34 -41
- package/lib/ProEditTable/components/Summary/index.js +20 -20
- package/lib/ProEditTable/components/Validator/index.js +10 -10
- package/lib/ProEditTable/index.d.ts +1 -1
- package/lib/ProEditTable/index.js +159 -164
- package/lib/ProEditTable/utils/config.js +40 -44
- package/lib/ProEditTable/utils/diffOriginal.js +36 -21
- package/lib/ProEditTable/utils/getDefaultProps.js +14 -15
- package/lib/ProEditTable/utils/index.js +97 -97
- package/lib/ProEditTable/utils/tools.js +96 -91
- package/lib/ProEditTable/utils/transform.js +7 -11
- package/lib/ProEditTable/utils/useEditTableError.js +22 -13
- package/lib/ProEnum/components/Group.js +23 -27
- package/lib/ProEnum/components/Tag.js +14 -16
- package/lib/ProEnum/hooks/useEnum.js +30 -12
- package/lib/ProEnum/hooks/useEnumRequest.js +39 -39
- package/lib/ProEnum/hooks/useFrequentEnumRequest.js +15 -15
- package/lib/ProEnum/index.js +71 -90
- package/lib/ProEnum/utils/eventCenter.js +23 -32
- package/lib/ProEnum/utils/frequentEnum.js +13 -3
- package/lib/ProEnum/utils/getEnumLabel.js +15 -21
- package/lib/ProEnum/utils/index.js +12 -7
- package/lib/ProForm/components/Container.js +7 -5
- package/lib/ProForm/components/FormFooter/index.js +19 -17
- package/lib/ProForm/components/base/Checkbox/index.js +14 -13
- package/lib/ProForm/components/base/DatePicker/index.js +20 -17
- package/lib/ProForm/components/base/Input/index.js +15 -15
- package/lib/ProForm/components/base/InputNumber/index.js +51 -48
- package/lib/ProForm/components/base/Radio/index.js +13 -13
- package/lib/ProForm/components/base/RangePicker/index.js +19 -22
- package/lib/ProForm/components/base/RangePicker/useDateRange.js +5 -4
- package/lib/ProForm/components/base/Select/index.js +14 -12
- package/lib/ProForm/components/base/Switch/index.js +11 -11
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +16 -15
- package/lib/ProForm/components/base/TextArea/index.js +14 -13
- package/lib/ProForm/components/base/TimePicker/index.js +6 -5
- package/lib/ProForm/components/combination/Container/index.js +22 -21
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +77 -89
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +17 -15
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +7 -7
- package/lib/ProForm/components/combination/FormList/components/Empty.js +17 -18
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +14 -14
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +43 -48
- package/lib/ProForm/components/combination/FormList/index.js +35 -43
- package/lib/ProForm/components/combination/FormList/utils.js +11 -10
- package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.js +7 -5
- package/lib/ProForm/components/combination/Group/component/ComRender.js +30 -28
- package/lib/ProForm/components/combination/Group/hooks/index.js +48 -45
- package/lib/ProForm/components/combination/Group/index.js +34 -35
- package/lib/ProForm/components/combination/Group/utils.js +62 -50
- package/lib/ProForm/components/combination/ProCascader/index.js +75 -80
- package/lib/ProForm/components/combination/ProCascader/utils/index.js +8 -7
- package/lib/ProForm/components/combination/ProCombination/index.js +35 -31
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +30 -24
- package/lib/ProForm/components/combination/ProModalSelect/index.js +171 -180
- package/lib/ProForm/components/combination/ProModalSelect/utils/index.js +3 -2
- package/lib/ProForm/components/combination/ProNumberRange/index.js +42 -48
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +35 -35
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +3 -3
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +37 -34
- package/lib/ProForm/components/index.d.ts +1 -0
- package/lib/ProForm/components/old/EnumSelect/hooks/useRequestList.js +35 -33
- package/lib/ProForm/components/old/EnumSelect/index.js +50 -58
- package/lib/ProForm/components/old/InputRange/index.js +16 -16
- package/lib/ProForm/components/old/InputWithSuffix/index.js +4 -4
- package/lib/ProForm/components/old/ProAddress/index.js +53 -75
- package/lib/ProForm/components/old/ProCertNo/index.js +16 -17
- package/lib/ProForm/components/old/ProCertValidity/index.js +17 -18
- package/lib/ProForm/components/old/ProRangeBox/index.js +24 -24
- package/lib/ProForm/components/render/ChangedWrapper.js +35 -35
- package/lib/ProForm/components/render/ConfirmWrapper.js +14 -17
- package/lib/ProForm/components/render/Render.js +138 -125
- package/lib/ProForm/components/render/RenderFields.js +57 -43
- package/lib/ProForm/components/render/propsType.js +26 -1
- package/lib/ProForm/index.js +74 -61
- package/lib/ProForm/propsType.d.ts +1 -1
- package/lib/ProForm/propsType.js +5 -1
- package/lib/ProForm/utils/diffOriginal.js +30 -17
- package/lib/ProForm/utils/getDefaultProps.js +12 -12
- package/lib/ProForm/utils/index.js +127 -106
- package/lib/ProForm/utils/processDependencies.js +15 -6
- package/lib/ProForm/utils/rulesCreator.js +21 -21
- package/lib/ProForm/utils/transformNames.js +6 -6
- package/lib/ProForm/utils/transformValue.js +14 -11
- package/lib/ProForm/utils/useDeepCompareMemo.js +7 -6
- package/lib/ProForm/utils/useFieldProps.js +2 -3
- package/lib/ProForm/utils/useForm.js +33 -31
- package/lib/ProForm/utils/useRules.js +25 -28
- package/lib/ProForm/utils/useShouldUpdate.js +82 -85
- package/lib/ProForm/utils/useWatch.js +36 -14
- package/lib/ProForm/utils/valueType.js +52 -52
- package/lib/ProIcon/config/index.js +2 -0
- package/lib/ProIcon/index.js +47 -44
- package/lib/ProIcon/utils/index.js +10 -8
- package/lib/ProLayout/components/Layout/Header/index.js +10 -10
- package/lib/ProLayout/components/Layout/Icon/Icon.js +8 -7
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +37 -36
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +49 -52
- package/lib/ProLayout/components/Layout/Menu/SideMenu/index.js +8 -8
- package/lib/ProLayout/components/Layout/Menu/index.js +17 -16
- package/lib/ProLayout/components/Layout/Notice/index.js +8 -8
- package/lib/ProLayout/components/ProCollapse/index.js +32 -30
- package/lib/ProLayout/components/ProFooter/index.js +14 -16
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +7 -7
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +6 -7
- package/lib/ProLayout/components/ProHeader/index.js +131 -120
- package/lib/ProLayout/components/ProHeader/utils/index.js +3 -2
- package/lib/ProLayout/index.d.ts +1 -1
- package/lib/ProLayout/index.js +22 -21
- package/lib/ProLayout/utils/index.js +42 -33
- package/lib/ProSelect/components/AdaptiveTooltip.js +9 -11
- package/lib/ProSelect/index.js +82 -93
- package/lib/ProSelect/utils/index.js +29 -34
- package/lib/ProStep/components/Anchor/index.d.ts +1 -0
- package/lib/ProStep/components/Anchor/index.js +25 -24
- package/lib/ProStep/components/Item/index.d.ts +1 -0
- package/lib/ProStep/components/Item/index.js +24 -20
- package/lib/ProStep/components/Listener/index.js +9 -13
- package/lib/ProStep/components/Step/index.js +20 -21
- package/lib/ProStep/index.js +45 -49
- package/lib/ProStep/utils/index.js +16 -12
- package/lib/ProStepTab/index.js +60 -38
- package/lib/ProTable/components/FormatColumn/index.js +100 -104
- package/lib/ProTable/components/RcTable/components/BaseTable/index.js +5 -7
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +34 -48
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +25 -23
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +5 -7
- package/lib/ProTable/components/RenderColumn/index.js +46 -48
- package/lib/ProTable/components/RenderEmptyText/index.js +6 -6
- package/lib/ProTable/components/RenderFooter/index.js +3 -3
- package/lib/ProTable/components/RenderSummary/index.js +11 -12
- package/lib/ProTable/components/RenderTableHeader/index.js +14 -13
- package/lib/ProTable/components/RenderTabs/index.js +27 -32
- package/lib/ProTable/components/TableResizable/index.js +16 -15
- package/lib/ProTable/components/TooltipTitle/index.js +5 -5
- package/lib/ProTable/hooks/useAntdTable.js +103 -116
- package/lib/ProTable/index.js +149 -169
- package/lib/ProTable/utils/index.js +33 -22
- package/lib/ProTabs/components/Card/index.js +14 -14
- package/lib/ProTabs/index.js +24 -24
- package/lib/ProThemeTools/component/ProTools/index.js +66 -65
- package/lib/ProThemeTools/index.js +43 -29
- package/lib/ProThemeTools/utils/index.js +25 -18
- package/lib/ProTooltip/index.js +44 -46
- package/lib/ProTree/components/AdaptiveTooltip.js +5 -7
- package/lib/ProTree/components/CloseIcon.js +5 -5
- package/lib/ProTree/components/List.js +18 -22
- package/lib/ProTree/components/ProTree.js +77 -96
- package/lib/ProTree/components/ProTreeSelect/index.js +126 -116
- package/lib/ProTree/components/SearchTitle.js +8 -8
- package/lib/ProTree/components/Tree.js +53 -55
- package/lib/ProTree/index.js +4 -4
- package/lib/ProTree/utils.js +34 -25
- package/lib/ProTreeModal/components/Cascader.js +28 -32
- package/lib/ProTreeModal/components/CloseIcon.js +5 -5
- package/lib/ProTreeModal/components/List.js +69 -89
- package/lib/ProTreeModal/components/SearchTitle.js +4 -4
- package/lib/ProTreeModal/components/SortableItem.js +11 -12
- package/lib/ProTreeModal/components/Tree.js +44 -49
- package/lib/ProTreeModal/components/Trigger.js +26 -26
- package/lib/ProTreeModal/index.js +157 -199
- package/lib/ProTreeModal/utils.js +43 -35
- package/lib/ProUpload/components/ButtonRender.js +29 -33
- package/lib/ProUpload/components/DragRender.js +50 -48
- package/lib/ProUpload/components/DraggableUploadListItem.js +7 -5
- package/lib/ProUpload/components/Example.js +13 -11
- package/lib/ProUpload/components/FileItem.js +58 -50
- package/lib/ProUpload/components/ImageRender.js +89 -93
- package/lib/ProUpload/index.js +68 -76
- package/lib/ProUpload/uitls.js +5 -3
- package/lib/ProUtils/utils/index.js +10 -14
- package/lib/ProViewer/index.js +26 -24
- package/lib/ProViewer/propsType.js +1 -5
- package/lib/ProWaterMark/index.js +5 -4
- package/lib/index.d.ts +1 -1
- package/lib/locale/index.js +6 -2
- package/lib/old/ProCertValidity/index.js +17 -18
- package/lib/old/ProEditableTable/index.js +153 -156
- package/lib/old/ProEditableTable/utils.js +61 -62
- package/lib/tokens.js +1 -0
- package/lib/utils/index.js +16 -13
- package/package.json +8 -8
- package/dist/index.esm.css +0 -6344
- package/dist/index.esm.js +0 -3
- package/dist/less.esm.css +0 -5768
- package/dist/less.esm.js +0 -3
package/es/ProDownload/utils.js
CHANGED
@@ -2,18 +2,16 @@ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
2
|
import "antd/es/message/style";
|
3
3
|
import _message from "antd/es/message";
|
4
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
5
|
-
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
6
5
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
7
|
-
import _get from "lodash/get";
|
8
|
-
import _isFunction from "lodash/isFunction";
|
9
6
|
/* eslint-disable no-empty */
|
10
7
|
/* eslint-disable prefer-promise-reject-errors */
|
11
|
-
import
|
12
|
-
|
8
|
+
import { isFunction, get } from 'lodash';
|
9
|
+
import locale from "../locale";
|
10
|
+
var stringify = data => {
|
13
11
|
var result = '';
|
14
12
|
if (data && Object.keys(data).length) {
|
15
|
-
Object.entries(data).forEach(
|
16
|
-
result +=
|
13
|
+
Object.entries(data).forEach(item => {
|
14
|
+
result += `&${item[0]}=${item[1]}`;
|
17
15
|
});
|
18
16
|
}
|
19
17
|
return result ? result.substr(1) : '';
|
@@ -40,21 +38,25 @@ export function BlobMakeFile(_ref) {
|
|
40
38
|
ele.style.display = 'none';
|
41
39
|
ele.setAttribute('target', '');
|
42
40
|
ele.href = blobUrl;
|
43
|
-
ele.download =
|
41
|
+
ele.download = `${fileName}`;
|
44
42
|
ele.click();
|
45
43
|
doc.body.removeChild(ele);
|
46
44
|
}
|
45
|
+
|
46
|
+
// base64转Blob
|
47
|
+
|
47
48
|
export var convertBase64ToBlob = function convertBase64ToBlob(base64, fileType) {
|
48
49
|
var _atob$match;
|
49
50
|
var slice = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1024;
|
50
|
-
return new Blob((_atob$match = atob(base64).match(new RegExp(
|
51
|
-
return new Uint8Array(item.split('').map(
|
51
|
+
return new Blob((_atob$match = atob(base64).match(new RegExp(`([\\s\\S]{${slice}})|([\\s\\S]{1,${slice}})`, 'g'))) === null || _atob$match === void 0 ? void 0 : _atob$match.map(item => {
|
52
|
+
return new Uint8Array(item.split('').map((s, i) => {
|
52
53
|
return item.charCodeAt(i);
|
53
54
|
}));
|
54
55
|
}), {
|
55
56
|
type: fileType
|
56
57
|
});
|
57
58
|
};
|
59
|
+
|
58
60
|
/**
|
59
61
|
* 从Content-Disposition获取filename
|
60
62
|
* @param contentDisposition string
|
@@ -71,16 +73,17 @@ export function getFilenameFromContentDisposition(contentDisposition) {
|
|
71
73
|
}
|
72
74
|
return null;
|
73
75
|
}
|
76
|
+
|
74
77
|
// 发起请求获取下载文件
|
75
78
|
export var DownloadRequest = /*#__PURE__*/function () {
|
76
|
-
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref2) {
|
79
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref2) {
|
77
80
|
var url, _ref2$method, method, params, headers, transformResponse, fileName, onFinish, onError, config, res, fileBlob, data, contentFileName;
|
78
81
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
79
82
|
while (1) switch (_context2.prev = _context2.next) {
|
80
83
|
case 0:
|
81
84
|
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, onError = _ref2.onError;
|
82
85
|
config = {
|
83
|
-
method
|
86
|
+
method,
|
84
87
|
credentials: 'include',
|
85
88
|
headers: {
|
86
89
|
'Content-Type': 'application/json',
|
@@ -93,15 +96,15 @@ export var DownloadRequest = /*#__PURE__*/function () {
|
|
93
96
|
}
|
94
97
|
// 处理get请求入参
|
95
98
|
if (method === 'get' && params) {
|
96
|
-
url =
|
99
|
+
url = `${url}${url.indexOf('?') !== -1 ? '&' : '?'}${stringify(params)}`;
|
97
100
|
}
|
98
101
|
// if custom headers need to be set for the specific request
|
99
|
-
if (headers &&
|
102
|
+
if (headers && typeof headers === 'object' && Object.keys(headers).length > 0) {
|
100
103
|
config.headers = _objectSpread(_objectSpread({}, config.headers), headers);
|
101
104
|
}
|
102
105
|
_context2.next = 7;
|
103
|
-
return fetch(url, config).then(/*#__PURE__*/function () {
|
104
|
-
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(response) {
|
106
|
+
return fetch(url, config).then( /*#__PURE__*/function () {
|
107
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(response) {
|
105
108
|
var _data, errorMsg;
|
106
109
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
107
110
|
while (1) switch (_context.prev = _context.next) {
|
@@ -115,8 +118,8 @@ export var DownloadRequest = /*#__PURE__*/function () {
|
|
115
118
|
_context.next = 7;
|
116
119
|
break;
|
117
120
|
}
|
118
|
-
_message.error(
|
119
|
-
return _context.abrupt("return", Promise.reject(
|
121
|
+
_message.error(`${locale.ProDownload.errorMessage}`);
|
122
|
+
return _context.abrupt("return", Promise.reject(`${locale.ProDownload.errorMessage}`));
|
120
123
|
case 7:
|
121
124
|
if (!((_data === null || _data === void 0 ? void 0 : _data.status) > 200 || (_data === null || _data === void 0 ? void 0 : _data.code) === 401)) {
|
122
125
|
_context.next = 12;
|
@@ -127,7 +130,7 @@ export var DownloadRequest = /*#__PURE__*/function () {
|
|
127
130
|
onError && onError(_data);
|
128
131
|
return _context.abrupt("return", Promise.reject(errorMsg));
|
129
132
|
case 12:
|
130
|
-
if (!
|
133
|
+
if (!isFunction(transformResponse)) {
|
131
134
|
_context.next = 14;
|
132
135
|
break;
|
133
136
|
}
|
@@ -145,7 +148,7 @@ export var DownloadRequest = /*#__PURE__*/function () {
|
|
145
148
|
}
|
146
149
|
return _context.abrupt("return", Promise.resolve(response));
|
147
150
|
case 21:
|
148
|
-
return _context.abrupt("return", Promise.reject(
|
151
|
+
return _context.abrupt("return", Promise.reject(`${locale.ProDownload.errorMessage}`));
|
149
152
|
case 22:
|
150
153
|
case "end":
|
151
154
|
return _context.stop();
|
@@ -160,12 +163,12 @@ export var DownloadRequest = /*#__PURE__*/function () {
|
|
160
163
|
res = _context2.sent;
|
161
164
|
data = null;
|
162
165
|
contentFileName = '';
|
163
|
-
if (
|
166
|
+
if (isFunction(transformResponse)) {
|
164
167
|
data = res;
|
165
168
|
} else {
|
166
169
|
// 优先获取Content-Disposition中filename
|
167
170
|
contentFileName = getFilenameFromContentDisposition(res.headers.get('Content-Disposition'));
|
168
|
-
data =
|
171
|
+
data = get(res, 'data');
|
169
172
|
}
|
170
173
|
if (!data) {
|
171
174
|
_context2.next = 15;
|
@@ -181,7 +184,7 @@ export var DownloadRequest = /*#__PURE__*/function () {
|
|
181
184
|
fileBlob = _context2.sent;
|
182
185
|
case 18:
|
183
186
|
// 完成回调
|
184
|
-
onFinish === null || onFinish === void 0
|
187
|
+
onFinish === null || onFinish === void 0 || onFinish(res, params);
|
185
188
|
BlobMakeFile({
|
186
189
|
blob: fileBlob,
|
187
190
|
fileName: fileName || contentFileName
|
@@ -8,17 +8,19 @@ import "antd/es/modal/style";
|
|
8
8
|
import _Modal from "antd/es/modal";
|
9
9
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
10
10
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
11
|
-
import _isArray from "lodash/isArray";
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
13
11
|
import React, { useCallback, useState, useRef, useEffect } from 'react';
|
14
12
|
import { useScroll } from 'ahooks';
|
13
|
+
import { isArray } from 'lodash';
|
15
14
|
import { ReactSVG } from 'react-svg';
|
16
|
-
import closeSvg from
|
17
|
-
import locale from
|
15
|
+
import closeSvg from "../../../assets/close.svg";
|
16
|
+
import locale from "../../../locale";
|
17
|
+
|
18
18
|
/**
|
19
19
|
* 抽屉组件
|
20
20
|
*/
|
21
|
-
|
21
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
22
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
23
|
+
var ProDrawer = _ref => {
|
22
24
|
var form = _ref.form,
|
23
25
|
title = _ref.title,
|
24
26
|
width = _ref.width,
|
@@ -51,27 +53,28 @@ var ProDrawer = function ProDrawer(_ref) {
|
|
51
53
|
initialSnapshot = _useState4[0],
|
52
54
|
setInitialSnapshot = _useState4[1];
|
53
55
|
var noRenderFooter = isView || footer === false || footer === null;
|
56
|
+
|
54
57
|
// 使用 useEffect 在 visible 变更时延迟捕获 初始DOM 快照
|
55
|
-
useEffect(
|
58
|
+
useEffect(() => {
|
56
59
|
if (visible) {
|
57
60
|
// 延迟到下一个事件循环,确保 Drawer 已经渲染
|
58
|
-
var timeoutId = setTimeout(
|
61
|
+
var timeoutId = setTimeout(() => {
|
59
62
|
if (ref.current) {
|
60
63
|
setInitialSnapshot(ref.current.innerHTML); // 捕获 DOM 快照
|
61
64
|
}
|
62
65
|
}, 100); // 使用 setTimeout 让 DOM 渲染完成后再执行
|
63
|
-
|
64
|
-
|
65
|
-
}; // 清理定时器
|
66
|
+
|
67
|
+
return () => clearTimeout(timeoutId); // 清理定时器
|
66
68
|
}
|
67
69
|
setInitialSnapshot('');
|
68
70
|
}, [visible]); // 当 visible 变化时执行
|
71
|
+
|
69
72
|
// 快照对比
|
70
|
-
var compareSnapshots =
|
73
|
+
var compareSnapshots = () => {
|
71
74
|
if (!ref.current) return false;
|
72
75
|
return ref.current.innerHTML === initialSnapshot;
|
73
76
|
};
|
74
|
-
var onConfirm = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
77
|
+
var onConfirm = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
75
78
|
var _locale$ProDrawerForm, _locale$ProDrawerForm2, _locale$ProDrawerForm3, _locale$ProDrawerForm4;
|
76
79
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
77
80
|
while (1) switch (_context.prev = _context.next) {
|
@@ -82,14 +85,14 @@ var ProDrawer = function ProDrawer(_ref) {
|
|
82
85
|
} else if (!modalRef.current) {
|
83
86
|
modalRef.current = _Modal.confirm(_objectSpread({
|
84
87
|
className: 'width430',
|
85
|
-
title: locale === null || locale === void 0
|
86
|
-
okText: locale === null || locale === void 0
|
87
|
-
cancelText: locale === null || locale === void 0
|
88
|
-
content: locale === null || locale === void 0
|
89
|
-
onOk:
|
88
|
+
title: locale === null || locale === void 0 || (_locale$ProDrawerForm = locale.ProDrawerForm) === null || _locale$ProDrawerForm === void 0 ? void 0 : _locale$ProDrawerForm.isSureClose,
|
89
|
+
okText: locale === null || locale === void 0 || (_locale$ProDrawerForm2 = locale.ProDrawerForm) === null || _locale$ProDrawerForm2 === void 0 ? void 0 : _locale$ProDrawerForm2.confirm,
|
90
|
+
cancelText: locale === null || locale === void 0 || (_locale$ProDrawerForm3 = locale.ProDrawerForm) === null || _locale$ProDrawerForm3 === void 0 ? void 0 : _locale$ProDrawerForm3.cancel,
|
91
|
+
content: locale === null || locale === void 0 || (_locale$ProDrawerForm4 = locale.ProDrawerForm) === null || _locale$ProDrawerForm4 === void 0 ? void 0 : _locale$ProDrawerForm4.secondTipsWhenSave,
|
92
|
+
onOk: () => {
|
90
93
|
onCancel && onCancel();
|
91
94
|
},
|
92
|
-
onCancel:
|
95
|
+
onCancel: () => {
|
93
96
|
modalRef.current = null;
|
94
97
|
}
|
95
98
|
}, isConfirmCloseModalProps));
|
@@ -100,7 +103,7 @@ var ProDrawer = function ProDrawer(_ref) {
|
|
100
103
|
}
|
101
104
|
}, _callee);
|
102
105
|
})), [onCancel, modalRef.current, ref.current]);
|
103
|
-
var handleFinish = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
106
|
+
var handleFinish = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
104
107
|
var values;
|
105
108
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
106
109
|
while (1) switch (_context2.prev = _context2.next) {
|
@@ -161,10 +164,10 @@ var ProDrawer = function ProDrawer(_ref) {
|
|
161
164
|
_context2.prev = 26;
|
162
165
|
_context2.t4 = _context2["catch"](0);
|
163
166
|
/** 使用setTimeout确保DOM已经更新,错误标记已经渲染 */
|
164
|
-
setTimeout(
|
167
|
+
setTimeout(() => {
|
165
168
|
var _ref$current, _error$errorFields;
|
166
169
|
var errorElement = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.querySelector('[class*="form-item-has-error"]');
|
167
|
-
if (errorElement &&
|
170
|
+
if (errorElement && _context2.t4 !== null && _context2.t4 !== void 0 && (_error$errorFields = _context2.t4.errorFields) !== null && _error$errorFields !== void 0 && _error$errorFields.length) {
|
168
171
|
errorElement.scrollIntoView({
|
169
172
|
behavior: 'smooth',
|
170
173
|
block: 'center'
|
@@ -181,38 +184,39 @@ var ProDrawer = function ProDrawer(_ref) {
|
|
181
184
|
}
|
182
185
|
}, _callee2, null, [[0, 26, 29, 32]]);
|
183
186
|
})), [onOk, onCancel, form]);
|
187
|
+
|
184
188
|
/**
|
185
189
|
* 描述:默认底部操作按钮
|
186
190
|
*
|
187
191
|
*/
|
188
|
-
var defaultFooter = _jsxs("div", {
|
192
|
+
var defaultFooter = /*#__PURE__*/_jsxs("div", {
|
189
193
|
className: "pro-drawer-footer",
|
190
|
-
children: [_jsx(_Button, {
|
194
|
+
children: [/*#__PURE__*/_jsx(_Button, {
|
191
195
|
type: "primary",
|
192
196
|
onClick: handleFinish,
|
193
197
|
loading: okLoading !== null && okLoading !== void 0 ? okLoading : loading,
|
194
198
|
disabled: okDisabled !== null && okDisabled !== void 0 ? okDisabled : loading,
|
195
199
|
children: okText
|
196
|
-
}), _jsx(_Button, {
|
200
|
+
}), /*#__PURE__*/_jsx(_Button, {
|
197
201
|
onClick: onCancel,
|
198
202
|
children: cancelText
|
199
203
|
})]
|
200
204
|
});
|
201
|
-
var renderFooter =
|
205
|
+
var renderFooter = () => {
|
202
206
|
if (noRenderFooter) {
|
203
207
|
return null;
|
204
208
|
}
|
205
|
-
if (/*#__PURE__*/React.isValidElement(footer)) {
|
206
|
-
return _jsx("div", {
|
209
|
+
if ( /*#__PURE__*/React.isValidElement(footer)) {
|
210
|
+
return /*#__PURE__*/_jsx("div", {
|
207
211
|
className: "pro-drawer-footer",
|
208
212
|
children: footer
|
209
213
|
});
|
210
214
|
}
|
211
|
-
if (
|
212
|
-
return _jsx("div", {
|
215
|
+
if (isArray(footer) && footer !== null && footer !== void 0 && footer.length) {
|
216
|
+
return /*#__PURE__*/_jsx("div", {
|
213
217
|
className: "pro-drawer-footer",
|
214
|
-
children: footer.map(
|
215
|
-
if (/*#__PURE__*/React.isValidElement(item)) {
|
218
|
+
children: footer.map(item => {
|
219
|
+
if ( /*#__PURE__*/React.isValidElement(item)) {
|
216
220
|
return item;
|
217
221
|
}
|
218
222
|
return false;
|
@@ -221,33 +225,33 @@ var ProDrawer = function ProDrawer(_ref) {
|
|
221
225
|
}
|
222
226
|
return defaultFooter;
|
223
227
|
};
|
224
|
-
return _jsxs(_Drawer, _objectSpread(_objectSpread({
|
228
|
+
return /*#__PURE__*/_jsxs(_Drawer, _objectSpread(_objectSpread({
|
225
229
|
width: width,
|
226
230
|
open: visible,
|
227
231
|
maskClosable: maskClosable,
|
228
232
|
placement: "right",
|
229
|
-
className:
|
233
|
+
className: `pro-drawer ${className !== null && className !== void 0 ? className : ''}`,
|
230
234
|
closable: false,
|
231
235
|
onClose: onCancel,
|
232
236
|
zIndex: zIndex
|
233
237
|
}, drawerProps), {}, {
|
234
|
-
children: [_jsx("div", {
|
238
|
+
children: [/*#__PURE__*/_jsx("div", {
|
235
239
|
className: "pro-drawer-close",
|
236
240
|
onClick: onConfirm,
|
237
|
-
children: _jsx(ReactSVG, {
|
241
|
+
children: /*#__PURE__*/_jsx(ReactSVG, {
|
238
242
|
className: "close-icon",
|
239
243
|
src: closeSvg
|
240
244
|
})
|
241
|
-
}), title ? _jsx("div", {
|
242
|
-
className:
|
245
|
+
}), title ? /*#__PURE__*/_jsx("div", {
|
246
|
+
className: `pro-drawer-title ${top > 0 ? 'pro-drawer-scrolling' : ''}`,
|
243
247
|
children: title
|
244
|
-
}) : null, _jsx("div", {
|
248
|
+
}) : null, /*#__PURE__*/_jsx("div", {
|
245
249
|
ref: ref,
|
246
250
|
className: "pro-drawer-content",
|
247
251
|
style: {
|
248
252
|
marginTop: title ? 64 : 0,
|
249
253
|
paddingBottom: noRenderFooter ? 0 : 64,
|
250
|
-
height:
|
254
|
+
height: `calc(100% - ${title ? 64 : 0}px)`
|
251
255
|
},
|
252
256
|
children: children
|
253
257
|
}), renderFooter()]
|
@@ -1,24 +1,25 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
2
|
import "antd/es/modal/style";
|
3
3
|
import _Modal from "antd/es/modal";
|
4
|
-
import "antd/es/button/style";
|
5
|
-
import _Button from "antd/es/button";
|
6
4
|
import "antd/es/space/style";
|
7
5
|
import _Space from "antd/es/space";
|
6
|
+
import "antd/es/button/style";
|
7
|
+
import _Button from "antd/es/button";
|
8
8
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
9
9
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
10
10
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
11
|
-
import _isArray from "lodash/isArray";
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
13
11
|
import React, { useCallback, useState, useRef } from 'react';
|
14
12
|
import { useScroll, useSize } from 'ahooks';
|
15
13
|
import classnames from 'classnames';
|
14
|
+
import { isArray } from 'lodash';
|
16
15
|
import { ReactSVG } from 'react-svg';
|
17
|
-
import closeSvg from
|
16
|
+
import closeSvg from "../../../assets/close.svg";
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
18
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
18
19
|
/**
|
19
20
|
* 弹窗组件
|
20
21
|
*/
|
21
|
-
var ProModal =
|
22
|
+
var ProModal = _ref => {
|
22
23
|
var _ref$current;
|
23
24
|
var form = _ref.form,
|
24
25
|
title = _ref.title,
|
@@ -53,7 +54,7 @@ var ProModal = function ProModal(_ref) {
|
|
53
54
|
'pro-modal-no-footer': noRenderFooter,
|
54
55
|
'pro-modal-footer-shadow': height >= 450
|
55
56
|
}]);
|
56
|
-
var handleFinish = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
57
|
+
var handleFinish = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
57
58
|
var values;
|
58
59
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
59
60
|
while (1) switch (_context.prev = _context.next) {
|
@@ -114,10 +115,10 @@ var ProModal = function ProModal(_ref) {
|
|
114
115
|
_context.prev = 26;
|
115
116
|
_context.t4 = _context["catch"](0);
|
116
117
|
/** 使用setTimeout确保DOM已经更新,错误标记已经渲染 */
|
117
|
-
setTimeout(
|
118
|
+
setTimeout(() => {
|
118
119
|
var _ref$current2, _error$errorFields;
|
119
120
|
var errorElement = (_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.querySelector('[class*="form-item-has-error"]');
|
120
|
-
if (errorElement &&
|
121
|
+
if (errorElement && _context.t4 !== null && _context.t4 !== void 0 && (_error$errorFields = _context.t4.errorFields) !== null && _error$errorFields !== void 0 && _error$errorFields.length) {
|
121
122
|
errorElement.scrollIntoView({
|
122
123
|
behavior: 'smooth',
|
123
124
|
block: 'center'
|
@@ -134,17 +135,18 @@ var ProModal = function ProModal(_ref) {
|
|
134
135
|
}
|
135
136
|
}, _callee, null, [[0, 26, 29, 32]]);
|
136
137
|
})), [onOk, onCancel, form]);
|
138
|
+
|
137
139
|
/**
|
138
140
|
* 描述:默认底部操作按钮
|
139
141
|
*
|
140
142
|
*/
|
141
|
-
var defaultFooter = _jsxs("div", {
|
143
|
+
var defaultFooter = /*#__PURE__*/_jsxs("div", {
|
142
144
|
className: extraLeft ? 'pro-modal-footer' : undefined,
|
143
|
-
children: [extraLeft, _jsxs(_Space, {
|
144
|
-
children: [_jsx(_Button, {
|
145
|
+
children: [extraLeft, /*#__PURE__*/_jsxs(_Space, {
|
146
|
+
children: [/*#__PURE__*/_jsx(_Button, {
|
145
147
|
onClick: onCancel,
|
146
148
|
children: cancelText
|
147
|
-
}), _jsx(_Button, {
|
149
|
+
}), /*#__PURE__*/_jsx(_Button, {
|
148
150
|
type: "primary",
|
149
151
|
onClick: handleFinish,
|
150
152
|
loading: okLoading !== null && okLoading !== void 0 ? okLoading : loading,
|
@@ -153,21 +155,21 @@ var ProModal = function ProModal(_ref) {
|
|
153
155
|
})]
|
154
156
|
})]
|
155
157
|
});
|
156
|
-
var renderFooter =
|
158
|
+
var renderFooter = () => {
|
157
159
|
if (noRenderFooter) {
|
158
160
|
return null;
|
159
161
|
}
|
160
|
-
if (/*#__PURE__*/React.isValidElement(footer)) {
|
161
|
-
return _jsx("div", {
|
162
|
+
if ( /*#__PURE__*/React.isValidElement(footer)) {
|
163
|
+
return /*#__PURE__*/_jsx("div", {
|
162
164
|
className: "pro-drawer-footer",
|
163
165
|
children: footer
|
164
166
|
});
|
165
167
|
}
|
166
|
-
if (
|
167
|
-
return _jsx("div", {
|
168
|
+
if (isArray(footer) && footer !== null && footer !== void 0 && footer.length) {
|
169
|
+
return /*#__PURE__*/_jsx("div", {
|
168
170
|
className: "pro-drawer-footer",
|
169
|
-
children: footer.map(
|
170
|
-
if (/*#__PURE__*/React.isValidElement(item)) {
|
171
|
+
children: footer.map(item => {
|
172
|
+
if ( /*#__PURE__*/React.isValidElement(item)) {
|
171
173
|
return item;
|
172
174
|
}
|
173
175
|
return false;
|
@@ -176,7 +178,7 @@ var ProModal = function ProModal(_ref) {
|
|
176
178
|
}
|
177
179
|
return defaultFooter;
|
178
180
|
};
|
179
|
-
return _jsx(_Modal, _objectSpread(_objectSpread({
|
181
|
+
return /*#__PURE__*/_jsx(_Modal, _objectSpread(_objectSpread({
|
180
182
|
className: _className,
|
181
183
|
title: title,
|
182
184
|
width: width,
|
@@ -186,13 +188,13 @@ var ProModal = function ProModal(_ref) {
|
|
186
188
|
footer: renderFooter(),
|
187
189
|
okText: okText,
|
188
190
|
cancelText: cancelText,
|
189
|
-
closeIcon: _jsx(ReactSVG, {
|
191
|
+
closeIcon: /*#__PURE__*/_jsx(ReactSVG, {
|
190
192
|
className: "close-icon",
|
191
193
|
src: closeSvg
|
192
194
|
}),
|
193
195
|
zIndex: zIndex
|
194
196
|
}, modalProps), {}, {
|
195
|
-
children: _jsx("div", {
|
197
|
+
children: /*#__PURE__*/_jsx("div", {
|
196
198
|
ref: ref,
|
197
199
|
children: children
|
198
200
|
})
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export { default as ProDrawer } from
|
2
|
-
export { default as ProModal } from
|
1
|
+
export { default as ProDrawer } from "./ProDrawer";
|
2
|
+
export { default as ProModal } from "./ProModal";
|
@@ -1,17 +1,15 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
3
3
|
var _locale$ProDrawerForm3;
|
4
|
+
import React, { createContext, forwardRef, useContext, useImperativeHandle, useMemo } from 'react';
|
5
|
+
import { ProDrawer, ProModal } from "./components";
|
6
|
+
import ProForm from "../ProForm";
|
7
|
+
import { transformBySize } from "./utils";
|
8
|
+
import locale from "../locale";
|
4
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
-
import { createContext, forwardRef, useContext, useImperativeHandle, useMemo } from 'react';
|
6
|
-
import { ProDrawer, ProModal } from './components';
|
7
|
-
import ProForm from '../ProForm';
|
8
|
-
import { transformBySize } from './utils';
|
9
|
-
import locale from '../locale';
|
10
10
|
var ProDrawerFormContext = /*#__PURE__*/createContext(null);
|
11
|
-
export var useProDrawerFormContext =
|
12
|
-
|
13
|
-
};
|
14
|
-
var ProDrawerForm = /*#__PURE__*/forwardRef(function (props, ref) {
|
11
|
+
export var useProDrawerFormContext = () => useContext(ProDrawerFormContext);
|
12
|
+
var ProDrawerForm = /*#__PURE__*/forwardRef((props, ref) => {
|
15
13
|
var _okText, _locale$ProDrawerForm, _locale$ProDrawerForm2;
|
16
14
|
var visible = props.visible,
|
17
15
|
showType = props.showType,
|
@@ -28,45 +26,45 @@ var ProDrawerForm = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
28
26
|
children = props.children;
|
29
27
|
showType = mode || showType;
|
30
28
|
isView = isView || disabled;
|
31
|
-
okText = (_okText = okText) !== null && _okText !== void 0 ? _okText : showType === 'Drawer' ? locale === null || locale === void 0
|
29
|
+
okText = (_okText = okText) !== null && _okText !== void 0 ? _okText : showType === 'Drawer' ? locale === null || locale === void 0 || (_locale$ProDrawerForm = locale.ProDrawerForm) === null || _locale$ProDrawerForm === void 0 ? void 0 : _locale$ProDrawerForm.save : locale === null || locale === void 0 || (_locale$ProDrawerForm2 = locale.ProDrawerForm) === null || _locale$ProDrawerForm2 === void 0 ? void 0 : _locale$ProDrawerForm2.confirm;
|
32
30
|
visible = open !== null && open !== void 0 ? open : visible;
|
33
31
|
var width = props.width;
|
34
32
|
if (!width && size) {
|
35
33
|
width = transformBySize(size);
|
36
34
|
}
|
35
|
+
|
37
36
|
// 强转string 类型
|
38
37
|
if (!Number.isNaN(+width)) {
|
39
|
-
width =
|
38
|
+
width = `${width}px`;
|
40
39
|
}
|
41
40
|
var _ProForm$useForm = ProForm.useForm(originalForm),
|
42
41
|
_ProForm$useForm2 = _slicedToArray(_ProForm$useForm, 1),
|
43
42
|
form = _ProForm$useForm2[0];
|
44
|
-
var handleCancel =
|
43
|
+
var handleCancel = () => {
|
45
44
|
onCloseClean && form.resetFields();
|
46
|
-
onCancel === null || onCancel === void 0
|
45
|
+
onCancel === null || onCancel === void 0 || onCancel();
|
47
46
|
};
|
47
|
+
|
48
48
|
// 暴露form实例给用户
|
49
|
-
useImperativeHandle(ref,
|
50
|
-
|
51
|
-
});
|
52
|
-
var Com = useMemo(function () {
|
49
|
+
useImperativeHandle(ref, () => form);
|
50
|
+
var Com = useMemo(() => {
|
53
51
|
return {
|
54
52
|
Drawer: ProDrawer,
|
55
53
|
Modal: ProModal
|
56
54
|
}[showType];
|
57
55
|
}, [showType]);
|
58
|
-
return _jsx(ProDrawerFormContext.Provider, {
|
56
|
+
return /*#__PURE__*/_jsx(ProDrawerFormContext.Provider, {
|
59
57
|
value: {
|
60
58
|
source: 'ProDrawerForm'
|
61
59
|
},
|
62
|
-
children: visible ? _jsx(Com, _objectSpread(_objectSpread({}, props), {}, {
|
60
|
+
children: visible ? /*#__PURE__*/_jsx(Com, _objectSpread(_objectSpread({}, props), {}, {
|
63
61
|
isView: isView,
|
64
62
|
visible: visible,
|
65
63
|
form: form,
|
66
64
|
width: width,
|
67
65
|
okText: okText,
|
68
66
|
onCancel: handleCancel,
|
69
|
-
children: children || _jsx(ProForm, _objectSpread({
|
67
|
+
children: children || /*#__PURE__*/_jsx(ProForm, _objectSpread({
|
70
68
|
form: form,
|
71
69
|
disabled: isView,
|
72
70
|
footer: false
|
@@ -80,7 +78,7 @@ ProDrawerForm.defaultProps = {
|
|
80
78
|
isConfirmClose: true,
|
81
79
|
onCloseClean: true,
|
82
80
|
maskClosable: false,
|
83
|
-
cancelText: locale === null || locale === void 0
|
81
|
+
cancelText: locale === null || locale === void 0 || (_locale$ProDrawerForm3 = locale.ProDrawerForm) === null || _locale$ProDrawerForm3 === void 0 ? void 0 : _locale$ProDrawerForm3.cancel,
|
84
82
|
proFormProps: {}
|
85
83
|
};
|
86
84
|
export default ProDrawerForm;
|