@zat-design/sisyphus-react 3.13.19-beta.1 → 3.13.19-beta.10
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/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 +26 -20
- 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 +17 -19
- package/es/ProEnum/index.js +80 -89
- package/es/ProEnum/utils/eventCenter.js +23 -32
- package/es/ProEnum/utils/frequentEnum.js +16 -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 +24 -17
- 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 +16 -18
- package/lib/ProEnum/index.js +68 -78
- package/lib/ProEnum/utils/eventCenter.js +23 -32
- package/lib/ProEnum/utils/frequentEnum.js +14 -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
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
6
6
|
});
|
7
7
|
exports.default = void 0;
|
8
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
9
8
|
var _react = require("react");
|
10
9
|
var _AdaptiveTooltip = _interopRequireDefault(require("./AdaptiveTooltip"));
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
11
11
|
function SearchTitle(props) {
|
12
12
|
var label = props.label,
|
13
13
|
_props$searchStr = props.searchStr,
|
@@ -28,30 +28,30 @@ function SearchTitle(props) {
|
|
28
28
|
classEllipse = 'ellipse';
|
29
29
|
style.width = ellipseWidth;
|
30
30
|
}
|
31
|
-
var title = index > -1 ? (0, _jsxRuntime.jsxs)("span", {
|
31
|
+
var title = index > -1 ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
32
32
|
className: classEllipse,
|
33
33
|
style: style,
|
34
|
-
children: [beforeStr, searchStr ? (0, _jsxRuntime.jsx)("span", {
|
34
|
+
children: [beforeStr, searchStr ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
35
35
|
className: "pro-tree-modal-search-value",
|
36
36
|
children: searchStr
|
37
37
|
}) : null, afterStr]
|
38
|
-
}) : (0, _jsxRuntime.jsx)("span", {
|
38
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
39
39
|
className: classEllipse,
|
40
40
|
style: style,
|
41
41
|
children: strTitle
|
42
42
|
});
|
43
|
-
var titleTips = index > -1 ? (0, _jsxRuntime.jsxs)("span", {
|
43
|
+
var titleTips = index > -1 ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
44
44
|
style: style,
|
45
|
-
children: [beforeStr, searchStr ? (0, _jsxRuntime.jsx)("span", {
|
45
|
+
children: [beforeStr, searchStr ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
46
46
|
className: "pro-tree-modal-search-value",
|
47
47
|
children: searchStr
|
48
48
|
}) : null, afterStr]
|
49
|
-
}) : (0, _jsxRuntime.jsx)("span", {
|
49
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
50
50
|
style: style,
|
51
51
|
children: strTitle
|
52
52
|
});
|
53
53
|
if (classEllipse && !isDiffChange) {
|
54
|
-
return (0, _jsxRuntime.jsx)(_AdaptiveTooltip.default, {
|
54
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_AdaptiveTooltip.default, {
|
55
55
|
children: titleTips
|
56
56
|
});
|
57
57
|
}
|
@@ -15,13 +15,13 @@ var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helper
|
|
15
15
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
16
16
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
17
17
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
18
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
19
18
|
var _react = _interopRequireWildcard(require("react"));
|
20
19
|
var _ahooks = require("ahooks");
|
21
20
|
var _icons = require("@ant-design/icons");
|
22
21
|
var _SearchTitle = _interopRequireDefault(require("./SearchTitle"));
|
23
22
|
var _utils = require("../utils");
|
24
23
|
var _locale = _interopRequireDefault(require("../../locale"));
|
24
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
25
25
|
var _excluded = ["checkedValues", "disabled", "searchStr", "originalTreeData", "showCodeName", "checkStrictly", "flatTreeData", "mode", "fieldNames", "tags", "onCheck", "optionRender", "treeData", "showLine", "switcherIcon", "checkable", "menu", "innerExpandKeys", "selectedKey", "disabledMode", "isRadioSelect"];
|
26
26
|
/*
|
27
27
|
*@Date: 2023-07-25 13:49:35
|
@@ -53,7 +53,7 @@ function List(props) {
|
|
53
53
|
_props$showLine = props.showLine,
|
54
54
|
showLine = _props$showLine === void 0 ? true : _props$showLine,
|
55
55
|
_props$switcherIcon = props.switcherIcon,
|
56
|
-
switcherIcon = _props$switcherIcon === void 0 ? (0, _jsxRuntime.jsx)(_icons.CaretDownOutlined, {}) : _props$switcherIcon,
|
56
|
+
switcherIcon = _props$switcherIcon === void 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.CaretDownOutlined, {}) : _props$switcherIcon,
|
57
57
|
_props$checkable = props.checkable,
|
58
58
|
checkable = _props$checkable === void 0 ? false : _props$checkable,
|
59
59
|
menu = props.menu,
|
@@ -77,31 +77,29 @@ function List(props) {
|
|
77
77
|
currentClickTreeNode = _useSetState2$.currentClickTreeNode,
|
78
78
|
handing = _useSetState2$.handing,
|
79
79
|
setState = _useSetState2[1];
|
80
|
-
(0, _react.useEffect)(
|
80
|
+
(0, _react.useEffect)(() => {
|
81
81
|
if (searchStr) {
|
82
|
-
var newExpandedKeys = flatTreeData.map(
|
82
|
+
var newExpandedKeys = flatTreeData.map(item => {
|
83
83
|
var title = item[fieldNameValue] + item[fieldNameLabel];
|
84
84
|
if ((title === null || title === void 0 ? void 0 : title.indexOf(searchStr)) > -1) {
|
85
85
|
return (0, _utils.getParentKey)(item[fieldNameValue], originalTreeData, fieldNames);
|
86
86
|
}
|
87
87
|
return null;
|
88
|
-
}).filter(
|
89
|
-
return item && self.indexOf(item) === i;
|
90
|
-
});
|
88
|
+
}).filter((item, i, self) => item && self.indexOf(item) === i);
|
91
89
|
setState({
|
92
90
|
expandedKeys: newExpandedKeys,
|
93
91
|
autoExpandParent: true
|
94
92
|
});
|
95
93
|
}
|
96
94
|
}, [searchStr]);
|
97
|
-
(0, _react.useEffect)(
|
95
|
+
(0, _react.useEffect)(() => {
|
98
96
|
if (innerExpandKeys) {
|
99
97
|
setState({
|
100
98
|
expandedKeys: innerExpandKeys
|
101
99
|
});
|
102
100
|
}
|
103
101
|
}, [innerExpandKeys]);
|
104
|
-
(0, _react.useEffect)(
|
102
|
+
(0, _react.useEffect)(() => {
|
105
103
|
if (!checkable) {
|
106
104
|
// 单选树,checkedValues为string,选中那个树节点
|
107
105
|
setState({
|
@@ -109,7 +107,7 @@ function List(props) {
|
|
109
107
|
});
|
110
108
|
}
|
111
109
|
}, [checkedValues]);
|
112
|
-
(0, _react.useEffect)(
|
110
|
+
(0, _react.useEffect)(() => {
|
113
111
|
// 复选树,配置的selectedKey在这里处理选中,单选树,在ProTree组件里跟value比优先级处理,到这个组件里面是checkedValues了
|
114
112
|
if (checkable) {
|
115
113
|
setState({
|
@@ -118,7 +116,7 @@ function List(props) {
|
|
118
116
|
}
|
119
117
|
}, [selectedKey]);
|
120
118
|
var onSelect = /*#__PURE__*/function () {
|
121
|
-
var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(value, item) {
|
119
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(value, item) {
|
122
120
|
var _props$onSelect;
|
123
121
|
var val;
|
124
122
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
@@ -140,7 +138,7 @@ function List(props) {
|
|
140
138
|
handing: true
|
141
139
|
});
|
142
140
|
_context.next = 7;
|
143
|
-
return props === null || props === void 0
|
141
|
+
return props === null || props === void 0 || (_props$onSelect = props.onSelect) === null || _props$onSelect === void 0 ? void 0 : _props$onSelect.call(props, val, item);
|
144
142
|
case 7:
|
145
143
|
setState({
|
146
144
|
handing: false
|
@@ -155,7 +153,7 @@ function List(props) {
|
|
155
153
|
return _ref.apply(this, arguments);
|
156
154
|
};
|
157
155
|
}();
|
158
|
-
var TreeNodeRow =
|
156
|
+
var TreeNodeRow = props => {
|
159
157
|
var nodeClass = props.nodeClass,
|
160
158
|
item = props.item,
|
161
159
|
index = props.index,
|
@@ -167,79 +165,79 @@ function List(props) {
|
|
167
165
|
open = _useState2[0],
|
168
166
|
setOpen = _useState2[1];
|
169
167
|
var operateButton = menu && menu(item === null || item === void 0 ? void 0 : item[fieldNameValue], item);
|
170
|
-
operateButton === null || operateButton === void 0
|
171
|
-
return (0, _jsxRuntime.jsx)(_react.default.Fragment, {
|
168
|
+
operateButton === null || operateButton === void 0 || operateButton.map((item, i) => {
|
169
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {
|
172
170
|
children: item
|
173
171
|
}, i);
|
174
172
|
});
|
175
|
-
var hide =
|
173
|
+
var hide = () => {
|
176
174
|
setOpen(false);
|
177
175
|
};
|
178
|
-
var handleOpenChange =
|
176
|
+
var handleOpenChange = newOpen => {
|
179
177
|
setOpen(newOpen);
|
180
178
|
};
|
181
|
-
var expandIcon = (0, _jsxRuntime.jsx)("span", {
|
179
|
+
var expandIcon = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
182
180
|
className: "icon-item",
|
183
|
-
children: (0, _jsxRuntime.jsx)("svg", {
|
181
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
|
184
182
|
width: "1em",
|
185
183
|
height: "1em",
|
186
184
|
viewBox: "0 0 16 16",
|
187
185
|
version: "1.1",
|
188
186
|
className: "icon-item svg-icon-expand",
|
189
|
-
children: (0, _jsxRuntime.jsx)("g", {
|
187
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
190
188
|
id: "\u6811\u7ED3\u6784",
|
191
189
|
stroke: "none",
|
192
190
|
strokeWidth: "1",
|
193
191
|
fill: "none",
|
194
192
|
fillRule: "evenodd",
|
195
|
-
children: (0, _jsxRuntime.jsx)("g", {
|
193
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
196
194
|
id: "\u6811\u7ED3\u6784\u4EA4\u4E92",
|
197
195
|
transform: "translate(-2285.000000, -2413.000000)",
|
198
196
|
fill: "currentColor",
|
199
|
-
children: (0, _jsxRuntime.jsx)("g", {
|
197
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
200
198
|
id: "\u6570\u636E\u5C55\u793A/\u6811\u5F62\u63A7\u4EF6/\u5E26\u8FDE\u63A5\u7EBF\u5907\u4EFD-3",
|
201
199
|
transform: "translate(2065.000000, 2411.000000)",
|
202
|
-
children: (0, _jsxRuntime.jsxs)("g", {
|
200
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
|
203
201
|
id: "\u7F16\u7EC4-4",
|
204
202
|
transform: "translate(220.000000, 2.000000)",
|
205
|
-
children: [(0, _jsxRuntime.jsxs)("g", {
|
203
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
|
206
204
|
id: "icon_more\u5907\u4EFD-9",
|
207
205
|
transform: "translate(7.000000, 3.000000)",
|
208
|
-
children: [(0, _jsxRuntime.jsx)("rect", {
|
206
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("rect", {
|
209
207
|
id: "\u77E9\u5F62",
|
210
208
|
x: "0",
|
211
209
|
y: "0",
|
212
210
|
width: "2",
|
213
211
|
height: "2"
|
214
|
-
}), (0, _jsxRuntime.jsx)("rect", {
|
212
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("rect", {
|
215
213
|
id: "\u77E9\u5F62\u5907\u4EFD-3",
|
216
214
|
x: "0",
|
217
215
|
y: "4",
|
218
216
|
width: "2",
|
219
217
|
height: "2"
|
220
|
-
}), (0, _jsxRuntime.jsx)("rect", {
|
218
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("rect", {
|
221
219
|
id: "\u77E9\u5F62\u5907\u4EFD-4",
|
222
220
|
x: "0",
|
223
221
|
y: "8",
|
224
222
|
width: "2",
|
225
223
|
height: "2"
|
226
224
|
})]
|
227
|
-
}), (0, _jsxRuntime.jsxs)("g", {
|
225
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
|
228
226
|
id: "icon_more\u5907\u4EFD-9",
|
229
227
|
transform: "translate(7.000000, 3.000000)",
|
230
|
-
children: [(0, _jsxRuntime.jsx)("rect", {
|
228
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("rect", {
|
231
229
|
id: "\u77E9\u5F62",
|
232
230
|
x: "0",
|
233
231
|
y: "0",
|
234
232
|
width: "2",
|
235
233
|
height: "2"
|
236
|
-
}), (0, _jsxRuntime.jsx)("rect", {
|
234
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("rect", {
|
237
235
|
id: "\u77E9\u5F62\u5907\u4EFD-3",
|
238
236
|
x: "0",
|
239
237
|
y: "4",
|
240
238
|
width: "2",
|
241
239
|
height: "2"
|
242
|
-
}), (0, _jsxRuntime.jsx)("rect", {
|
240
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("rect", {
|
243
241
|
id: "\u77E9\u5F62\u5907\u4EFD-4",
|
244
242
|
x: "0",
|
245
243
|
y: "8",
|
@@ -253,42 +251,42 @@ function List(props) {
|
|
253
251
|
})
|
254
252
|
})
|
255
253
|
});
|
256
|
-
return (0, _jsxRuntime.jsxs)("div", {
|
254
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
257
255
|
className: nodeClass,
|
258
|
-
onClick:
|
256
|
+
onClick: e => {
|
259
257
|
e.stopPropagation();
|
260
258
|
onSelect(item === null || item === void 0 ? void 0 : item[fieldNameValue], {
|
261
259
|
node: e === null || e === void 0 ? void 0 : e.target,
|
262
260
|
event: e,
|
263
|
-
item
|
261
|
+
item,
|
264
262
|
selected: !isChecked
|
265
263
|
});
|
266
264
|
},
|
267
|
-
children: [tags && tags.length ? (0, _jsxRuntime.jsx)("div", {
|
265
|
+
children: [tags && tags.length ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
268
266
|
className: "pro-tree-tree-node-tag",
|
269
267
|
style: {
|
270
268
|
backgroundColor: tagsBgColors[index],
|
271
269
|
color: tagsColors[index]
|
272
270
|
},
|
273
|
-
children: (0, _jsxRuntime.jsx)("span", {
|
271
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
274
272
|
children: tags[index]
|
275
273
|
})
|
276
|
-
}) : null, (0, _jsxRuntime.jsxs)("div", {
|
274
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
277
275
|
className: "tree-node-show-text",
|
278
|
-
children: [(0, _jsxRuntime.jsx)("div", {
|
276
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
279
277
|
className: "tree-node-show-text-label",
|
280
|
-
children: optionRender ? optionRender(item, searchStr) : (0, _jsxRuntime.jsx)(_SearchTitle.default, (0, _objectSpread2.default)({
|
278
|
+
children: optionRender ? optionRender(item, searchStr) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_SearchTitle.default, (0, _objectSpread2.default)({
|
281
279
|
label: title,
|
282
280
|
searchStr: searchStr
|
283
281
|
}, other))
|
284
|
-
}), (0, _jsxRuntime.jsx)("div", {
|
282
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
285
283
|
className: "operate-tree-node-btns",
|
286
|
-
onClick:
|
284
|
+
onClick: e => {
|
287
285
|
e.stopPropagation();
|
288
286
|
},
|
289
|
-
children: (operateButton === null || operateButton === void 0 ? void 0 : operateButton.length) > 1 ? (0, _jsxRuntime.jsx)(_popover.default, {
|
287
|
+
children: (operateButton === null || operateButton === void 0 ? void 0 : operateButton.length) > 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_popover.default, {
|
290
288
|
overlayClassName: "pro-tree-operate-container",
|
291
|
-
content: (0, _jsxRuntime.jsx)("div", {
|
289
|
+
content: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
292
290
|
className: "pro-tree-operate-btn-popover",
|
293
291
|
onClick: hide,
|
294
292
|
children: operateButton
|
@@ -300,23 +298,23 @@ function List(props) {
|
|
300
298
|
children: expandIcon
|
301
299
|
}) : operateButton
|
302
300
|
})]
|
303
|
-
}), (0, _jsxRuntime.jsx)("div", {
|
301
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
304
302
|
className: "brand-bg-opa-ten"
|
305
303
|
})]
|
306
304
|
}, onlyKey);
|
307
305
|
};
|
308
306
|
function fn() {
|
309
|
-
var
|
307
|
+
var loop = (data, index) => {
|
310
308
|
index++;
|
311
|
-
var treeRow = data.map(
|
309
|
+
var treeRow = data.map(item => {
|
312
310
|
var nodeClass = 'pro-tree-tree-node ';
|
313
311
|
var isChecked = false;
|
314
312
|
if (currentClickTreeNode === item[fieldNameValue]) {
|
315
313
|
nodeClass += ' checked';
|
316
314
|
isChecked = true;
|
317
315
|
}
|
318
|
-
var title = showCodeName ?
|
319
|
-
var nodeTitle = (0, _jsxRuntime.jsx)(TreeNodeRow, {
|
316
|
+
var title = showCodeName ? `${item[fieldNameValue]}-${item[fieldNameLabel]}` : item[fieldNameLabel];
|
317
|
+
var nodeTitle = /*#__PURE__*/(0, _jsxRuntime.jsx)(TreeNodeRow, {
|
320
318
|
nodeClass: nodeClass,
|
321
319
|
item: item,
|
322
320
|
index: index,
|
@@ -328,7 +326,7 @@ function List(props) {
|
|
328
326
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
329
327
|
title: nodeTitle,
|
330
328
|
key: (item === null || item === void 0 ? void 0 : item.key) || item[fieldNameValue],
|
331
|
-
children:
|
329
|
+
children: loop(item[fieldNames.children], index)
|
332
330
|
});
|
333
331
|
}
|
334
332
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
@@ -345,10 +343,10 @@ function List(props) {
|
|
345
343
|
if (searchStr) {
|
346
344
|
newTreeData = (0, _utils.filterCheckedNodes)(originalTreeData, [], searchStr, fieldNames);
|
347
345
|
}
|
348
|
-
return
|
346
|
+
return loop(newTreeData, -1);
|
349
347
|
}
|
350
348
|
var _treeData = fn();
|
351
|
-
var onExpand =
|
349
|
+
var onExpand = (newExpandedKeys, nextPara) => {
|
352
350
|
setState({
|
353
351
|
expandedKeys: newExpandedKeys,
|
354
352
|
autoExpandParent: false
|
@@ -362,9 +360,9 @@ function List(props) {
|
|
362
360
|
if (expandedKeys) {
|
363
361
|
additionProps.expandedKeys = expandedKeys;
|
364
362
|
}
|
365
|
-
return (0, _jsxRuntime.jsx)("div", {
|
363
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
366
364
|
className: disabledMode === 'hide' ? 'hide-disable-node' : '',
|
367
|
-
children:
|
365
|
+
children: _treeData !== null && _treeData !== void 0 && _treeData.length ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_tree.default, (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, others), additionProps), {}, {
|
368
366
|
disabled: disabled,
|
369
367
|
style: {
|
370
368
|
width: '100%'
|
@@ -381,9 +379,9 @@ function List(props) {
|
|
381
379
|
checkable: checkable,
|
382
380
|
onSelect: onSelect,
|
383
381
|
blockNode: true
|
384
|
-
})) : (0, _jsxRuntime.jsx)("div", {
|
382
|
+
})) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
385
383
|
className: "empty-tree",
|
386
|
-
children: _locale.default === null || _locale.default === void 0
|
384
|
+
children: _locale.default === null || _locale.default === void 0 || (_locale$ProTree = _locale.default.ProTree) === null || _locale$ProTree === void 0 ? void 0 : _locale$ProTree.emptyTips
|
387
385
|
})
|
388
386
|
});
|
389
387
|
}
|
package/lib/ProTree/index.js
CHANGED
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
});
|
7
7
|
exports.default = void 0;
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
9
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
10
9
|
var _ProTree = _interopRequireDefault(require("./components/ProTree"));
|
11
10
|
var _ProTreeSelect = _interopRequireDefault(require("./components/ProTreeSelect"));
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
12
12
|
/* eslint-disable jsx-a11y/anchor-is-valid */
|
13
13
|
/*
|
14
14
|
*@Date: 2023-07-11 16:07:12
|
@@ -17,7 +17,7 @@ var _ProTreeSelect = _interopRequireDefault(require("./components/ProTreeSelect"
|
|
17
17
|
*@Description: ProTree组件,集成了tree和treeSelect
|
18
18
|
*/
|
19
19
|
|
20
|
-
var ProTreeHandle =
|
20
|
+
var ProTreeHandle = props => {
|
21
21
|
var _props$mode = props.mode,
|
22
22
|
mode = _props$mode === void 0 ? 'tree' : _props$mode;
|
23
23
|
if (mode === 'treeSelect') {
|
@@ -25,9 +25,9 @@ var ProTreeHandle = function ProTreeHandle(props) {
|
|
25
25
|
treeCheckable: props === null || props === void 0 ? void 0 : props.checkable,
|
26
26
|
treeCheckStrictly: props === null || props === void 0 ? void 0 : props.checkStrictly
|
27
27
|
});
|
28
|
-
return (0, _jsxRuntime.jsx)(_ProTreeSelect.default, (0, _objectSpread2.default)({}, adaptorProps));
|
28
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProTreeSelect.default, (0, _objectSpread2.default)({}, adaptorProps));
|
29
29
|
}
|
30
|
-
return (0, _jsxRuntime.jsx)(_ProTree.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
30
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProTree.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), {}, {
|
31
31
|
checkedValues: props === null || props === void 0 ? void 0 : props.checkedKeys
|
32
32
|
}));
|
33
33
|
};
|
package/lib/ProTree/utils.js
CHANGED
@@ -11,10 +11,10 @@ exports.getChildrenKeys = getChildrenKeys;
|
|
11
11
|
exports.getDefaultExpandKeys = getDefaultExpandKeys;
|
12
12
|
exports.getFlatTreeData = getFlatTreeData;
|
13
13
|
exports.getParentKey = void 0;
|
14
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
15
14
|
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
|
16
|
-
var
|
17
|
-
|
15
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
16
|
+
/* eslint-disable no-restricted-syntax */
|
17
|
+
|
18
18
|
/**
|
19
19
|
* 树转成铺平的数组
|
20
20
|
* @param originalTreeData
|
@@ -24,10 +24,10 @@ function getFlatTreeData(originalTreeData, fieldNames) {
|
|
24
24
|
var dataList = [];
|
25
25
|
function loop(data) {
|
26
26
|
for (var i = 0; i < data.length; i++) {
|
27
|
-
var node = (0,
|
27
|
+
var node = (0, _objectSpread2.default)({}, data[i]);
|
28
28
|
// dataList.push({ value: node[fieldNames.value], label: node[fieldNames.label] });
|
29
29
|
delete node[fieldNames.children];
|
30
|
-
dataList.push((0,
|
30
|
+
dataList.push((0, _objectSpread2.default)({}, node));
|
31
31
|
if (data[i][fieldNames.children]) {
|
32
32
|
loop(data[i][fieldNames.children]);
|
33
33
|
}
|
@@ -36,6 +36,7 @@ function getFlatTreeData(originalTreeData, fieldNames) {
|
|
36
36
|
loop(originalTreeData);
|
37
37
|
return dataList;
|
38
38
|
}
|
39
|
+
|
39
40
|
/**
|
40
41
|
* 获取 tree 所有的 keys 集合
|
41
42
|
* @param data
|
@@ -56,6 +57,7 @@ function getAllKeys(data, fieldNames) {
|
|
56
57
|
loop(data);
|
57
58
|
return keys;
|
58
59
|
}
|
60
|
+
|
59
61
|
/**
|
60
62
|
* 获取展开的key
|
61
63
|
* @param key
|
@@ -63,27 +65,26 @@ function getAllKeys(data, fieldNames) {
|
|
63
65
|
* @param fieldNames
|
64
66
|
* @returns
|
65
67
|
*/
|
66
|
-
var
|
68
|
+
var getParentKey = (key, tree, fieldNames) => {
|
67
69
|
var parentKey;
|
68
70
|
for (var i = 0; i < tree.length; i++) {
|
69
71
|
var node = tree[i];
|
70
72
|
if (node[fieldNames.children]) {
|
71
|
-
if (node[fieldNames.children].some(
|
72
|
-
return item[fieldNames.value] === key;
|
73
|
-
})) {
|
73
|
+
if (node[fieldNames.children].some(item => item[fieldNames.value] === key)) {
|
74
74
|
parentKey = node[fieldNames.value];
|
75
|
-
} else if (
|
76
|
-
parentKey =
|
75
|
+
} else if (getParentKey(key, node[fieldNames.children], fieldNames)) {
|
76
|
+
parentKey = getParentKey(key, node[fieldNames.children], fieldNames);
|
77
77
|
}
|
78
78
|
}
|
79
79
|
}
|
80
80
|
return parentKey;
|
81
81
|
};
|
82
|
+
exports.getParentKey = getParentKey;
|
82
83
|
function findTreeNodeByKey(treeData, key, fieldNames) {
|
83
84
|
var result = [];
|
84
|
-
var
|
85
|
+
var traverse = (node, parents) => {
|
85
86
|
if (node[fieldNames.value] === key) {
|
86
|
-
result.push
|
87
|
+
result.push(node, ...parents);
|
87
88
|
return true;
|
88
89
|
}
|
89
90
|
var children = node[fieldNames.children] || [];
|
@@ -92,7 +93,7 @@ function findTreeNodeByKey(treeData, key, fieldNames) {
|
|
92
93
|
try {
|
93
94
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
94
95
|
var child = _step.value;
|
95
|
-
if (
|
96
|
+
if (traverse(child, [node, ...parents])) {
|
96
97
|
return true;
|
97
98
|
}
|
98
99
|
}
|
@@ -108,7 +109,7 @@ function findTreeNodeByKey(treeData, key, fieldNames) {
|
|
108
109
|
try {
|
109
110
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
110
111
|
var node = _step2.value;
|
111
|
-
|
112
|
+
traverse(node, []);
|
112
113
|
}
|
113
114
|
} catch (err) {
|
114
115
|
_iterator2.e(err);
|
@@ -117,6 +118,7 @@ function findTreeNodeByKey(treeData, key, fieldNames) {
|
|
117
118
|
}
|
118
119
|
return result;
|
119
120
|
}
|
121
|
+
|
120
122
|
/**
|
121
123
|
* 过滤掉每一层假值(例如 false、null、0、""、undefined 等)
|
122
124
|
* @param data
|
@@ -127,35 +129,40 @@ function filterCheckedNodes(data, checkedKeys) {
|
|
127
129
|
var searchStr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
128
130
|
var fieldNames = arguments.length > 3 ? arguments[3] : undefined;
|
129
131
|
var result = [];
|
130
|
-
var
|
132
|
+
var traverse = node => {
|
131
133
|
var _node$fieldNames$chil3;
|
132
134
|
var title = node[fieldNames.value] + node[fieldNames.label];
|
133
135
|
if (!searchStr) {
|
134
136
|
if (checkedKeys.includes(node[fieldNames.value])) {
|
135
137
|
var _node$fieldNames$chil;
|
136
|
-
var _children = (node === null || node === void 0
|
137
|
-
return (0,
|
138
|
+
var _children = (node === null || node === void 0 || (_node$fieldNames$chil = node[fieldNames.children]) === null || _node$fieldNames$chil === void 0 ? void 0 : _node$fieldNames$chil.map(traverse).filter(Boolean)) || [];
|
139
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, node), {}, {
|
140
|
+
[fieldNames.children]: _children
|
141
|
+
});
|
138
142
|
}
|
139
143
|
} else if ((title === null || title === void 0 ? void 0 : title.indexOf(searchStr)) > -1) {
|
140
144
|
var _node$fieldNames$chil2;
|
141
|
-
var _children2 = ((_node$fieldNames$chil2 = node[fieldNames.children]) === null || _node$fieldNames$chil2 === void 0 ? void 0 : _node$fieldNames$chil2.map(
|
142
|
-
return (0,
|
145
|
+
var _children2 = ((_node$fieldNames$chil2 = node[fieldNames.children]) === null || _node$fieldNames$chil2 === void 0 ? void 0 : _node$fieldNames$chil2.map(traverse).filter(Boolean)) || [];
|
146
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, node), {}, {
|
143
147
|
children: _children2
|
144
148
|
});
|
145
149
|
}
|
146
|
-
var children = (_node$fieldNames$chil3 = node[fieldNames.children]) === null || _node$fieldNames$chil3 === void 0 ? void 0 : _node$fieldNames$chil3.map(
|
150
|
+
var children = (_node$fieldNames$chil3 = node[fieldNames.children]) === null || _node$fieldNames$chil3 === void 0 ? void 0 : _node$fieldNames$chil3.map(traverse).filter(Boolean);
|
147
151
|
if (children && children.length > 0) {
|
148
|
-
return (0,
|
152
|
+
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, node), {}, {
|
153
|
+
[fieldNames.children]: children
|
154
|
+
});
|
149
155
|
}
|
150
156
|
return null;
|
151
157
|
};
|
158
|
+
|
152
159
|
// eslint-disable-next-line no-restricted-syntax
|
153
160
|
var _iterator3 = (0, _createForOfIteratorHelper2.default)(data),
|
154
161
|
_step3;
|
155
162
|
try {
|
156
163
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
157
164
|
var node = _step3.value;
|
158
|
-
var filtered =
|
165
|
+
var filtered = traverse(node);
|
159
166
|
if (filtered) {
|
160
167
|
result.push(filtered);
|
161
168
|
}
|
@@ -167,6 +174,7 @@ function filterCheckedNodes(data, checkedKeys) {
|
|
167
174
|
}
|
168
175
|
return result;
|
169
176
|
}
|
177
|
+
|
170
178
|
/**
|
171
179
|
* 获取 tree 当前选中节点下的所有子节点的 keys
|
172
180
|
* @param node
|
@@ -177,7 +185,7 @@ function getChildrenKeys(node, childrenKeys, fieldNames, type) {
|
|
177
185
|
// 当为 tree 触发 onChck 此时就是 key 为 children
|
178
186
|
if (type === 'treeCheck') {
|
179
187
|
var _node$children;
|
180
|
-
node === null || node === void 0
|
188
|
+
node === null || node === void 0 || (_node$children = node.children) === null || _node$children === void 0 || _node$children.forEach(item => {
|
181
189
|
childrenKeys.push(item.key);
|
182
190
|
if (item.children && item.children.length > 0) {
|
183
191
|
getChildrenKeys(item, childrenKeys, fieldNames, type);
|
@@ -186,7 +194,7 @@ function getChildrenKeys(node, childrenKeys, fieldNames, type) {
|
|
186
194
|
} else {
|
187
195
|
var _node$fieldNames$chil4;
|
188
196
|
// 这个时候的值为我们的值
|
189
|
-
node === null || node === void 0
|
197
|
+
node === null || node === void 0 || (_node$fieldNames$chil4 = node[fieldNames.children]) === null || _node$fieldNames$chil4 === void 0 || _node$fieldNames$chil4.forEach(item => {
|
190
198
|
childrenKeys.push(item[fieldNames.value]);
|
191
199
|
if (item[fieldNames.children] && item[fieldNames.children].length > 0) {
|
192
200
|
getChildrenKeys(item, childrenKeys, fieldNames, type);
|
@@ -194,6 +202,7 @@ function getChildrenKeys(node, childrenKeys, fieldNames, type) {
|
|
194
202
|
});
|
195
203
|
}
|
196
204
|
}
|
205
|
+
|
197
206
|
/**
|
198
207
|
* 如果默认全开展那么返回所有key,否则返回空[]
|
199
208
|
* @param isExpand 是否全展开
|