@zat-design/sisyphus-react 3.13.19-beta.6 → 3.13.19-beta.8
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/settings.local.json +9 -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 +80 -89
- 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 +68 -78
- 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 +6 -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
@@ -1,4 +1,3 @@
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
2
1
|
import "antd/es/config-provider/style";
|
3
2
|
import _ConfigProvider from "antd/es/config-provider";
|
4
3
|
import "antd/es/message/style";
|
@@ -6,36 +5,44 @@ import _message from "antd/es/message";
|
|
6
5
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
7
6
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
8
7
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
9
|
-
import _isEqual from "lodash/isEqual";
|
10
8
|
var _excluded = ["size", "className", "cacheTime", "color", "mode", "iconFollowTheme", "prefixCls", "tableBorder", "tableStripe", "theme", "onChange"];
|
11
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
12
9
|
/* eslint-disable prefer-const */
|
13
|
-
|
14
10
|
import { useEffect, useState } from 'react';
|
15
11
|
import { usePrevious, useUpdateEffect, useToggle } from 'ahooks';
|
16
12
|
import { ReactSVG } from 'react-svg';
|
13
|
+
import { isEqual } from 'lodash';
|
17
14
|
import classnames from 'classnames';
|
18
|
-
import { getKebabCase, setThemes, setTableBorder, getMapKebabCase, getMapHumpCase } from
|
19
|
-
import settingSvg from
|
20
|
-
import { ProTools } from
|
21
|
-
import locale from
|
15
|
+
import { getKebabCase, setThemes, setTableBorder, getMapKebabCase, getMapHumpCase } from "./utils/index";
|
16
|
+
import settingSvg from "../assets/setting.svg";
|
17
|
+
import { ProTools } from "./component";
|
18
|
+
import locale from "../locale";
|
19
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
20
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
22
21
|
var defaultCacheTime = 1; // 配置保存时间为一天
|
22
|
+
|
23
23
|
var defaultThemeConfig = {
|
24
24
|
zauiBrand: '#006AFF',
|
25
|
+
// 主题颜色
|
25
26
|
zauiText: '#343434',
|
26
27
|
zauiFontSize: '14px',
|
27
28
|
zauiFormAlign: 'left',
|
29
|
+
// 表单左对齐
|
28
30
|
zauiFormRequiredBefore: 'none',
|
31
|
+
// 前面*display
|
29
32
|
zauiFormRequiredAfter: 'inline',
|
33
|
+
// 后面*display
|
30
34
|
zauiSize: 1,
|
35
|
+
// 间距倍数
|
31
36
|
zauiSpaceSizeLg: '32px',
|
37
|
+
// 卡片行间距
|
32
38
|
zauiSpaceSizeMd: '16px',
|
39
|
+
// 控件行间距
|
33
40
|
zauiBigText: false,
|
34
41
|
zauiBaseFontSize: '0px',
|
35
42
|
zauiTableBorder: false,
|
36
43
|
zauiStripe: true
|
37
44
|
};
|
38
|
-
var ProThemeTools =
|
45
|
+
var ProThemeTools = _ref => {
|
39
46
|
var size = _ref.size,
|
40
47
|
className = _ref.className,
|
41
48
|
cacheTime = _ref.cacheTime,
|
@@ -64,8 +71,9 @@ var ProThemeTools = function ProThemeTools(_ref) {
|
|
64
71
|
var zauiBrand = state.zauiBrand,
|
65
72
|
zauiStripe = state.zauiStripe,
|
66
73
|
zauiTableBorder = state.zauiTableBorder;
|
74
|
+
|
67
75
|
// 重置
|
68
|
-
var onReset =
|
76
|
+
var onReset = () => {
|
69
77
|
setState(_objectSpread(_objectSpread({}, state), defaultThemeConfig));
|
70
78
|
setThemes({
|
71
79
|
'zaui-brand': '#006AFF',
|
@@ -82,8 +90,9 @@ var ProThemeTools = function ProThemeTools(_ref) {
|
|
82
90
|
'zaui-stripe': true
|
83
91
|
});
|
84
92
|
};
|
93
|
+
|
85
94
|
// 复制
|
86
|
-
var onCopy =
|
95
|
+
var onCopy = () => {
|
87
96
|
var data = JSON.stringify(getMapKebabCase(state, '@'));
|
88
97
|
var input = document.createElement('input');
|
89
98
|
document.body.appendChild(input);
|
@@ -91,17 +100,19 @@ var ProThemeTools = function ProThemeTools(_ref) {
|
|
91
100
|
input.select();
|
92
101
|
if (document.execCommand('copy')) {
|
93
102
|
document.execCommand('copy');
|
94
|
-
_message.success(
|
103
|
+
_message.success(`${locale.ProThemeTools.copySuccess}`);
|
95
104
|
}
|
96
105
|
document.body.removeChild(input);
|
97
106
|
};
|
107
|
+
|
98
108
|
// 首次从缓存中读取主题配置
|
99
|
-
useEffect(
|
109
|
+
useEffect(() => {
|
100
110
|
var themeConfig = localStorage.getItem('themeConfig');
|
101
111
|
var curThemeConfig = themeConfig ? JSON.parse(themeConfig) : {};
|
102
112
|
var startTime = curThemeConfig === null || curThemeConfig === void 0 ? void 0 : curThemeConfig.startTime;
|
103
113
|
// 默认时间间隔
|
104
114
|
var duration = (typeof cacheTime === 'number' ? cacheTime : defaultCacheTime) * 86400000;
|
115
|
+
|
105
116
|
// antd4以下版本不支持主题色的动态配置
|
106
117
|
if (!_ConfigProvider.config) {
|
107
118
|
return;
|
@@ -110,14 +121,12 @@ var ProThemeTools = function ProThemeTools(_ref) {
|
|
110
121
|
var _localThemeConfig;
|
111
122
|
var localThemeConfig;
|
112
123
|
localThemeConfig = curThemeConfig.data;
|
113
|
-
var cssVariables = Object.fromEntries(Object.entries(localThemeConfig).map(
|
114
|
-
|
115
|
-
];
|
116
|
-
}));
|
124
|
+
var cssVariables = Object.fromEntries(Object.entries(localThemeConfig).map(item => [`${getKebabCase(item === null || item === void 0 ? void 0 : item[0])}`, ['zauiSize'].includes(item === null || item === void 0 ? void 0 : item[0]) || typeof (item === null || item === void 0 ? void 0 : item[1]) !== 'number' ? item === null || item === void 0 ? void 0 : item[1] : `${item === null || item === void 0 ? void 0 : item[1]}px` // zauiSize取数字
|
125
|
+
]));
|
117
126
|
setState(_objectSpread(_objectSpread({}, state), localThemeConfig));
|
118
127
|
setThemes(cssVariables);
|
119
128
|
_ConfigProvider.config({
|
120
|
-
prefixCls
|
129
|
+
prefixCls,
|
121
130
|
theme: {
|
122
131
|
primaryColor: (_localThemeConfig = localThemeConfig) === null || _localThemeConfig === void 0 ? void 0 : _localThemeConfig.zauiBrand
|
123
132
|
}
|
@@ -125,15 +134,16 @@ var ProThemeTools = function ProThemeTools(_ref) {
|
|
125
134
|
} else {
|
126
135
|
setThemes(getMapKebabCase(state));
|
127
136
|
_ConfigProvider.config({
|
128
|
-
prefixCls
|
137
|
+
prefixCls,
|
129
138
|
theme: {
|
130
139
|
primaryColor: state === null || state === void 0 ? void 0 : state.zauiBrand
|
131
140
|
}
|
132
141
|
});
|
133
142
|
}
|
134
143
|
}, []);
|
144
|
+
|
135
145
|
// 主题色动态切换
|
136
|
-
useEffect(
|
146
|
+
useEffect(() => {
|
137
147
|
if (visible && zauiBrand) {
|
138
148
|
// antd4以下版本不支持主题色的动态配置
|
139
149
|
if (!_ConfigProvider.config) {
|
@@ -146,18 +156,21 @@ var ProThemeTools = function ProThemeTools(_ref) {
|
|
146
156
|
});
|
147
157
|
}
|
148
158
|
}, [zauiBrand]);
|
159
|
+
|
149
160
|
// 斑马纹设置
|
150
|
-
useEffect(
|
161
|
+
useEffect(() => {
|
151
162
|
setThemes({
|
152
163
|
'zaui-table-strip-bg': zauiStripe ? '#fafafa' : '#ffffff'
|
153
164
|
});
|
154
165
|
}, [zauiStripe]);
|
166
|
+
|
155
167
|
// 表格边框设置
|
156
|
-
useEffect(
|
168
|
+
useEffect(() => {
|
157
169
|
setTableBorder(zauiTableBorder);
|
158
170
|
}, [zauiTableBorder]);
|
171
|
+
|
159
172
|
// 主题配置缓存
|
160
|
-
useEffect(
|
173
|
+
useEffect(() => {
|
161
174
|
if (cacheTime) {
|
162
175
|
var newThemeConfig = {
|
163
176
|
startTime: new Date().getTime(),
|
@@ -166,24 +179,25 @@ var ProThemeTools = function ProThemeTools(_ref) {
|
|
166
179
|
localStorage.setItem('themeConfig', JSON.stringify(newThemeConfig));
|
167
180
|
}
|
168
181
|
}, [state, cacheTime]);
|
169
|
-
useUpdateEffect(
|
170
|
-
if (!
|
171
|
-
onChange === null || onChange === void 0
|
182
|
+
useUpdateEffect(() => {
|
183
|
+
if (!isEqual(state, previousState) && visible) {
|
184
|
+
onChange === null || onChange === void 0 || onChange(state);
|
172
185
|
}
|
173
186
|
}, [state]);
|
174
|
-
var cls = classnames(
|
187
|
+
var cls = classnames({
|
175
188
|
'pro-theme-tools': true,
|
176
|
-
'pro-theme-tools-follow': iconFollowTheme
|
177
|
-
|
178
|
-
|
179
|
-
|
189
|
+
'pro-theme-tools-follow': iconFollowTheme,
|
190
|
+
[className]: className
|
191
|
+
});
|
192
|
+
return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({}, props), {}, {
|
193
|
+
children: [/*#__PURE__*/_jsx("div", {
|
180
194
|
className: cls,
|
181
195
|
onClick: toggle,
|
182
|
-
children: _jsx(ReactSVG, {
|
196
|
+
children: /*#__PURE__*/_jsx(ReactSVG, {
|
183
197
|
className: "setting-icon",
|
184
198
|
src: settingSvg
|
185
199
|
})
|
186
|
-
}), _jsx(ProTools, {
|
200
|
+
}), /*#__PURE__*/_jsx(ProTools, {
|
187
201
|
prefixCls: prefixCls,
|
188
202
|
onReset: onReset,
|
189
203
|
onClose: toggle,
|
@@ -5,14 +5,15 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
5
5
|
var configProviderMapping = {
|
6
6
|
'zaui-brand': 'primaryColor'
|
7
7
|
};
|
8
|
+
|
8
9
|
/**
|
9
10
|
* 取主题配置的mapping值, 返回antd可用的主题配置
|
10
11
|
* @param themes
|
11
12
|
* @param themeMapping
|
12
13
|
*/
|
13
|
-
export var replaceObject =
|
14
|
+
export var replaceObject = (themes, themeMapping) => {
|
14
15
|
var result = {};
|
15
|
-
Object.keys(themes).forEach(
|
16
|
+
Object.keys(themes).forEach((key, index) => {
|
16
17
|
var value = themes[key];
|
17
18
|
var mappingKey = themeMapping[key];
|
18
19
|
if (mappingKey) {
|
@@ -21,10 +22,11 @@ export var replaceObject = function replaceObject(themes, themeMapping) {
|
|
21
22
|
});
|
22
23
|
return result;
|
23
24
|
};
|
25
|
+
|
24
26
|
/**
|
25
27
|
* 设置主题变量
|
26
28
|
*/
|
27
|
-
export var setThemes =
|
29
|
+
export var setThemes = (themes, themeMapping) => {
|
28
30
|
if (!Object.keys(themes).length) {
|
29
31
|
return false;
|
30
32
|
}
|
@@ -37,38 +39,38 @@ export var setThemes = function setThemes(themes, themeMapping) {
|
|
37
39
|
});
|
38
40
|
}
|
39
41
|
var list = Object.entries(themes);
|
40
|
-
list.forEach(
|
41
|
-
document.documentElement.style.setProperty(
|
42
|
+
list.forEach(item => {
|
43
|
+
document.documentElement.style.setProperty(`--${item[0]}`, item[1]);
|
42
44
|
});
|
43
45
|
};
|
46
|
+
|
44
47
|
/** JS实现驼峰命名与横线命名的转换 */
|
45
|
-
export var getKebabCase =
|
46
|
-
var temp = str.replace(/[A-Z]/g,
|
47
|
-
return
|
48
|
+
export var getKebabCase = str => {
|
49
|
+
var temp = str.replace(/[A-Z]/g, i => {
|
50
|
+
return `-${i.toLowerCase()}`;
|
48
51
|
});
|
49
52
|
if (temp.slice(0, 1) === '-') {
|
50
53
|
temp = temp.slice(1); // 如果首字母是大写,执行replace时会多一个-,需要去掉
|
51
54
|
}
|
52
55
|
return temp;
|
53
56
|
};
|
57
|
+
|
54
58
|
/** JS实现对象驼峰命名与横线命名的转换 */
|
55
59
|
export var getMapKebabCase = function getMapKebabCase(obj) {
|
56
60
|
var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
57
|
-
return Object.fromEntries(Object.entries(obj).map(
|
58
|
-
return ["".concat(prefix).concat(getKebabCase(item === null || item === void 0 ? void 0 : item[0])), item === null || item === void 0 ? void 0 : item[1]];
|
59
|
-
}));
|
61
|
+
return Object.fromEntries(Object.entries(obj).map(item => [`${prefix}${getKebabCase(item === null || item === void 0 ? void 0 : item[0])}`, item === null || item === void 0 ? void 0 : item[1]]));
|
60
62
|
};
|
63
|
+
|
61
64
|
/** JS实现对象横线命名与驼峰命名的转换 */
|
62
65
|
export var getMapHumpCase = function getMapHumpCase() {
|
63
66
|
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
64
|
-
return Object.keys(obj).reduce(
|
65
|
-
var transformedKey = key.replace(/-(\w)/g,
|
66
|
-
return letter.toUpperCase();
|
67
|
-
});
|
67
|
+
return Object.keys(obj).reduce((acc, key) => {
|
68
|
+
var transformedKey = key.replace(/-(\w)/g, (_, letter) => letter.toUpperCase());
|
68
69
|
acc[transformedKey] = obj[key];
|
69
70
|
return acc;
|
70
71
|
}, {});
|
71
72
|
};
|
73
|
+
|
72
74
|
/**
|
73
75
|
* 设置表格斑马纹
|
74
76
|
* @param stripe boolean
|
@@ -76,7 +78,7 @@ export var getMapHumpCase = function getMapHumpCase() {
|
|
76
78
|
export var setTableNoStripe = function setTableNoStripe(stripe) {
|
77
79
|
var prefixCls = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'ant';
|
78
80
|
var proTables = document.querySelectorAll('.pro-table');
|
79
|
-
var antTables = document.querySelectorAll(
|
81
|
+
var antTables = document.querySelectorAll(`.${prefixCls}-table`);
|
80
82
|
if (!proTables.length) {
|
81
83
|
return;
|
82
84
|
}
|
@@ -97,11 +99,12 @@ export var setTableNoStripe = function setTableNoStripe(stripe) {
|
|
97
99
|
}
|
98
100
|
}
|
99
101
|
};
|
102
|
+
|
100
103
|
/**
|
101
104
|
* 设置表格边框
|
102
105
|
* @param border boolean
|
103
106
|
*/
|
104
|
-
export var setTableBorder =
|
107
|
+
export var setTableBorder = border => {
|
105
108
|
var proTables = document.querySelectorAll('.pro-table');
|
106
109
|
if (!proTables.length) {
|
107
110
|
return;
|
package/es/ProTooltip/index.js
CHANGED
@@ -1,23 +1,22 @@
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
2
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
3
1
|
import "antd/es/tooltip/style";
|
4
2
|
import _Tooltip from "antd/es/tooltip";
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
5
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
6
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
7
6
|
var _excluded = ["text", "mode", "width", "line", "className", "style", "lineHeight", "scrollFollowParent"];
|
8
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
9
7
|
import { useSize, useSetState, useDebounce } from 'ahooks';
|
10
8
|
import { useEffect, useRef } from 'react';
|
11
9
|
import classnames from 'classnames';
|
12
|
-
import { isEllipsisActive } from
|
13
|
-
|
10
|
+
import { isEllipsisActive } from "../utils";
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
12
|
+
var findTableParent = function findTableParent(element) {
|
14
13
|
var _element$tagName;
|
15
14
|
var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
16
15
|
if (!element || depth >= 3) return false;
|
17
16
|
if (((_element$tagName = element.tagName) === null || _element$tagName === void 0 ? void 0 : _element$tagName.toLowerCase()) === 'td') return true;
|
18
|
-
return
|
17
|
+
return findTableParent(element.parentElement, depth + 1);
|
19
18
|
};
|
20
|
-
var ProTooltip =
|
19
|
+
var ProTooltip = props => {
|
21
20
|
var _useSize;
|
22
21
|
var ref = useRef();
|
23
22
|
var childRef = useRef();
|
@@ -65,39 +64,37 @@ var ProTooltip = function ProTooltip(props) {
|
|
65
64
|
});
|
66
65
|
var _ref = (_useSize = useSize(localElement)) !== null && _useSize !== void 0 ? _useSize : {},
|
67
66
|
_localSizeWidth = _ref.width;
|
68
|
-
var isTable =
|
67
|
+
var isTable = findTableParent(ref.current);
|
69
68
|
var overlayStyle = mode === 'auto' ? {
|
70
69
|
maxWidth: _localSizeWidth
|
71
70
|
} : {};
|
72
71
|
var multiStyle = isMultiLine ? {
|
73
72
|
WebkitLineClamp: line
|
74
73
|
} : {};
|
75
|
-
var AutoMixinSingle =
|
76
|
-
return isShowToolTip && line === 1 ? _jsx(_Tooltip, _objectSpread(_objectSpread({
|
74
|
+
var AutoMixinSingle = () => {
|
75
|
+
return isShowToolTip && line === 1 ? /*#__PURE__*/_jsx(_Tooltip, _objectSpread(_objectSpread({
|
77
76
|
title: text,
|
78
|
-
getPopupContainer:
|
79
|
-
return triggerNode.parentNode;
|
80
|
-
}
|
77
|
+
getPopupContainer: triggerNode => triggerNode.parentNode
|
81
78
|
}, restProps), {}, {
|
82
79
|
overlayStyle: overlayStyle,
|
83
|
-
children: _jsx("div", _objectSpread(_objectSpread({}, specialProps), {}, {
|
80
|
+
children: /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({}, specialProps), {}, {
|
84
81
|
style: _objectSpread(_objectSpread({}, multiStyle), {}, {
|
85
82
|
width: localWidth,
|
86
83
|
visibility: visible
|
87
84
|
}),
|
88
85
|
ref: childRef,
|
89
|
-
children: _jsx("div", _objectSpread(_objectSpread({}, specialProps), {}, {
|
86
|
+
children: /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({}, specialProps), {}, {
|
90
87
|
ref: contentWrapRef,
|
91
88
|
children: content
|
92
89
|
}))
|
93
90
|
}))
|
94
|
-
})) : _jsx("div", {
|
91
|
+
})) : /*#__PURE__*/_jsx("div", {
|
95
92
|
className: isMultiLine ? 'multiLine' : 'singleLine',
|
96
93
|
style: _objectSpread(_objectSpread({}, multiStyle), {}, {
|
97
94
|
width: localWidth
|
98
95
|
}),
|
99
96
|
ref: childRef,
|
100
|
-
children: _jsx("div", {
|
97
|
+
children: /*#__PURE__*/_jsx("div", {
|
101
98
|
className: "single-content-box",
|
102
99
|
style: {
|
103
100
|
visibility: visible
|
@@ -107,32 +104,30 @@ var ProTooltip = function ProTooltip(props) {
|
|
107
104
|
})
|
108
105
|
});
|
109
106
|
};
|
110
|
-
var AutoMixinMulti =
|
111
|
-
return isShowToolTip && line > 1 ? _jsx(_Tooltip, _objectSpread(_objectSpread({
|
107
|
+
var AutoMixinMulti = () => {
|
108
|
+
return isShowToolTip && line > 1 ? /*#__PURE__*/_jsx(_Tooltip, _objectSpread(_objectSpread({
|
112
109
|
title: text,
|
113
|
-
getPopupContainer:
|
114
|
-
return triggerNode.parentNode;
|
115
|
-
}
|
110
|
+
getPopupContainer: triggerNode => triggerNode.parentNode
|
116
111
|
}, restProps), {}, {
|
117
112
|
overlayStyle: overlayStyle,
|
118
|
-
children: _jsx("div", _objectSpread(_objectSpread({}, specialProps), {}, {
|
113
|
+
children: /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({}, specialProps), {}, {
|
119
114
|
style: _objectSpread(_objectSpread({}, multiStyle), {}, {
|
120
115
|
width: localWidth,
|
121
116
|
visibility: visible
|
122
117
|
}),
|
123
118
|
ref: childRef,
|
124
|
-
children: _jsx("div", _objectSpread(_objectSpread({}, specialProps), {}, {
|
119
|
+
children: /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({}, specialProps), {}, {
|
125
120
|
ref: contentWrapRef,
|
126
121
|
children: content
|
127
122
|
}))
|
128
123
|
}))
|
129
|
-
})) : _jsx("div", {
|
124
|
+
})) : /*#__PURE__*/_jsx("div", {
|
130
125
|
className: "multiLine",
|
131
126
|
style: _objectSpread(_objectSpread({}, multiStyle), {}, {
|
132
127
|
width: localWidth
|
133
128
|
}),
|
134
129
|
ref: childRef,
|
135
|
-
children: _jsx("div", {
|
130
|
+
children: /*#__PURE__*/_jsx("div", {
|
136
131
|
className: "multi-content-box",
|
137
132
|
style: {
|
138
133
|
visibility: visible
|
@@ -142,13 +137,13 @@ var ProTooltip = function ProTooltip(props) {
|
|
142
137
|
})
|
143
138
|
});
|
144
139
|
};
|
145
|
-
var AutoMixin =
|
140
|
+
var AutoMixin = () => {
|
146
141
|
if (mode !== 'auto') {
|
147
142
|
return null;
|
148
143
|
}
|
149
|
-
return line > 1 ? _jsx(AutoMixinMulti, {}) : _jsx(AutoMixinSingle, {});
|
144
|
+
return line > 1 ? /*#__PURE__*/_jsx(AutoMixinMulti, {}) : /*#__PURE__*/_jsx(AutoMixinSingle, {});
|
150
145
|
};
|
151
|
-
useEffect(
|
146
|
+
useEffect(() => {
|
152
147
|
if (mode === 'auto' && line === 1) {
|
153
148
|
var localDom = ref.current;
|
154
149
|
setState({
|
@@ -162,7 +157,7 @@ var ProTooltip = function ProTooltip(props) {
|
|
162
157
|
var contentWrapDom = childRef.current;
|
163
158
|
var contentDom = contentWrapRef.current;
|
164
159
|
if (contentWrapDom && contentDom) {
|
165
|
-
if (
|
160
|
+
if (contentWrapDom !== null && contentWrapDom !== void 0 && contentWrapDom.offsetWidth && contentDom !== null && contentDom !== void 0 && contentDom.scrollWidth) {
|
166
161
|
setState({
|
167
162
|
isShowToolTip: contentDom.scrollWidth > contentDom.offsetWidth,
|
168
163
|
specialProps: {
|
@@ -179,7 +174,7 @@ var ProTooltip = function ProTooltip(props) {
|
|
179
174
|
}
|
180
175
|
}
|
181
176
|
}, [mode, debouncedValue]);
|
182
|
-
useEffect(
|
177
|
+
useEffect(() => {
|
183
178
|
if (mode === 'auto' && line > 1 && JSON.stringify(specialProps) === '{}') {
|
184
179
|
var localDom = ref.current;
|
185
180
|
setState({
|
@@ -190,7 +185,7 @@ var ProTooltip = function ProTooltip(props) {
|
|
190
185
|
var contentWrapDom = childRef.current;
|
191
186
|
var contentDom = contentWrapRef.current;
|
192
187
|
if (contentWrapDom && contentDom) {
|
193
|
-
if (contentWrapDom
|
188
|
+
if (contentWrapDom !== null && contentWrapDom !== void 0 && contentWrapDom.scrollHeight) {
|
194
189
|
setState({
|
195
190
|
isShowToolTip: (contentWrapDom === null || contentWrapDom === void 0 ? void 0 : contentWrapDom.scrollHeight) > lineHeight * Number(line),
|
196
191
|
specialProps: {
|
@@ -206,7 +201,7 @@ var ProTooltip = function ProTooltip(props) {
|
|
206
201
|
}
|
207
202
|
}
|
208
203
|
}, [mode, debouncedValue, specialProps]);
|
209
|
-
useEffect(
|
204
|
+
useEffect(() => {
|
210
205
|
if (mode === 'auto' && line === 1) {
|
211
206
|
setState({
|
212
207
|
specialProps: {
|
@@ -216,7 +211,7 @@ var ProTooltip = function ProTooltip(props) {
|
|
216
211
|
});
|
217
212
|
}
|
218
213
|
}, [size]);
|
219
|
-
useEffect(
|
214
|
+
useEffect(() => {
|
220
215
|
if (mode === 'auto' && line > 1) {
|
221
216
|
if (JSON.stringify(specialProps) !== '{}') {
|
222
217
|
setState({
|
@@ -225,7 +220,7 @@ var ProTooltip = function ProTooltip(props) {
|
|
225
220
|
}
|
226
221
|
}
|
227
222
|
}, [debouncedValue]);
|
228
|
-
useEffect(
|
223
|
+
useEffect(() => {
|
229
224
|
var localDom = ref.current;
|
230
225
|
var isEllipsis = isEllipsisActive(childRef === null || childRef === void 0 ? void 0 : childRef.current);
|
231
226
|
setState({
|
@@ -233,11 +228,12 @@ var ProTooltip = function ProTooltip(props) {
|
|
233
228
|
isShowToolTip: isEllipsis
|
234
229
|
});
|
235
230
|
}, []);
|
236
|
-
var cls = classnames(
|
237
|
-
'pro-tooltip': true
|
238
|
-
|
239
|
-
|
240
|
-
|
231
|
+
var cls = classnames({
|
232
|
+
'pro-tooltip': true,
|
233
|
+
[`${className}`]: className
|
234
|
+
});
|
235
|
+
var renderContentBox = () => {
|
236
|
+
return /*#__PURE__*/_jsx("div", {
|
241
237
|
className: isMultiLine ? 'multiLine' : 'singleLine',
|
242
238
|
style: _objectSpread(_objectSpread({}, multiStyle), {}, {
|
243
239
|
width: localWidth
|
@@ -246,10 +242,10 @@ var ProTooltip = function ProTooltip(props) {
|
|
246
242
|
children: content
|
247
243
|
});
|
248
244
|
};
|
249
|
-
var renderTooltipContent =
|
250
|
-
return _jsx(_Tooltip, _objectSpread(_objectSpread({
|
245
|
+
var renderTooltipContent = () => {
|
246
|
+
return /*#__PURE__*/_jsx(_Tooltip, _objectSpread(_objectSpread({
|
251
247
|
title: text,
|
252
|
-
getPopupContainer:
|
248
|
+
getPopupContainer: triggerNode => {
|
253
249
|
// 修复scrollFollowParent为false时tooltip不显示的问题
|
254
250
|
// 当scrollFollowParent为false时,应该返回document.body而不是triggerNode本身
|
255
251
|
return scrollFollowParent ? triggerNode.parentNode : document.body;
|
@@ -259,11 +255,12 @@ var ProTooltip = function ProTooltip(props) {
|
|
259
255
|
children: renderContentBox()
|
260
256
|
}));
|
261
257
|
};
|
262
|
-
var renderContent =
|
258
|
+
var renderContent = () => {
|
263
259
|
// 自动模式使用专门的渲染逻辑
|
264
260
|
if (mode === 'auto') {
|
265
|
-
return _jsx(AutoMixin, {});
|
261
|
+
return /*#__PURE__*/_jsx(AutoMixin, {});
|
266
262
|
}
|
263
|
+
|
267
264
|
// 响应式宽度模式,根据是否需要显示tooltip决定渲染内容 且 父元素为table
|
268
265
|
if (isTable) {
|
269
266
|
if (isShowToolTip) {
|
@@ -271,13 +268,14 @@ var ProTooltip = function ProTooltip(props) {
|
|
271
268
|
}
|
272
269
|
return renderContentBox();
|
273
270
|
}
|
271
|
+
|
274
272
|
// 默认模式始终显示tooltip
|
275
273
|
if (mode === 'default') {
|
276
274
|
return renderTooltipContent();
|
277
275
|
}
|
278
276
|
return renderContentBox();
|
279
277
|
};
|
280
|
-
return _jsx("div", {
|
278
|
+
return /*#__PURE__*/_jsx("div", {
|
281
279
|
className: cls,
|
282
280
|
ref: ref,
|
283
281
|
style: _objectSpread(_objectSpread(_objectSpread({}, style), multiStyle), {}, {
|
@@ -1,17 +1,15 @@
|
|
1
1
|
import "antd/es/tooltip/style";
|
2
2
|
import _Tooltip from "antd/es/tooltip";
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
4
|
-
var AdaptiveTooltip =
|
4
|
+
var AdaptiveTooltip = _ref => {
|
5
5
|
var children = _ref.children;
|
6
|
-
return _jsx(_Tooltip, {
|
6
|
+
return /*#__PURE__*/_jsx(_Tooltip, {
|
7
7
|
placement: "rightTop",
|
8
|
-
title: _jsx("div", {
|
9
|
-
onMouseDown:
|
10
|
-
return e.stopPropagation();
|
11
|
-
},
|
8
|
+
title: /*#__PURE__*/_jsx("div", {
|
9
|
+
onMouseDown: e => e.stopPropagation(),
|
12
10
|
children: children
|
13
11
|
}),
|
14
|
-
children: _jsx("span", {
|
12
|
+
children: /*#__PURE__*/_jsx("span", {
|
15
13
|
className: "pro-tree-wrap-ellipse",
|
16
14
|
children: children
|
17
15
|
})
|
@@ -1,15 +1,15 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
3
3
|
function CloseIcon(props) {
|
4
|
-
return _jsx("span", _objectSpread(_objectSpread({}, props), {}, {
|
5
|
-
children: _jsx("span", {
|
4
|
+
return /*#__PURE__*/_jsx("span", _objectSpread(_objectSpread({}, props), {}, {
|
5
|
+
children: /*#__PURE__*/_jsx("span", {
|
6
6
|
className: "pro-tree-modal-checkbox-close",
|
7
7
|
role: "button",
|
8
|
-
children: _jsx("span", {
|
8
|
+
children: /*#__PURE__*/_jsx("span", {
|
9
9
|
role: "img",
|
10
10
|
"aria-label": "close-circle",
|
11
11
|
className: "anticon anticon-close-circle",
|
12
|
-
children: _jsx("svg", {
|
12
|
+
children: /*#__PURE__*/_jsx("svg", {
|
13
13
|
viewBox: "64 64 896 896",
|
14
14
|
focusable: "false",
|
15
15
|
"data-icon": "close-circle",
|
@@ -17,7 +17,7 @@ function CloseIcon(props) {
|
|
17
17
|
height: "1em",
|
18
18
|
fill: "currentColor",
|
19
19
|
"aria-hidden": "true",
|
20
|
-
children: _jsx("path", {
|
20
|
+
children: /*#__PURE__*/_jsx("path", {
|
21
21
|
d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
|
22
22
|
})
|
23
23
|
})
|