@zat-design/sisyphus-react 3.13.18 → 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 +32 -17
- 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 -58
- 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.d.ts +14 -0
- package/es/ProEnum/hooks/useFrequentEnumRequest.js +76 -0
- package/es/ProEnum/index.js +97 -97
- package/es/ProEnum/propsType.d.ts +29 -0
- package/es/ProEnum/utils/eventCenter.js +23 -32
- package/es/ProEnum/utils/frequentEnum.d.ts +40 -0
- package/es/ProEnum/utils/frequentEnum.js +91 -0
- 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/ProNumberRange/style/index.less +5 -0
- 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 -120
- 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 +31 -15
- 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 -60
- 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.d.ts +14 -0
- package/lib/ProEnum/hooks/useFrequentEnumRequest.js +83 -0
- package/lib/ProEnum/index.js +85 -86
- package/lib/ProEnum/propsType.d.ts +29 -0
- package/lib/ProEnum/utils/eventCenter.js +23 -32
- package/lib/ProEnum/utils/frequentEnum.d.ts +40 -0
- package/lib/ProEnum/utils/frequentEnum.js +99 -0
- 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/ProNumberRange/style/index.less +5 -0
- 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 -117
- 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 -6338
- package/dist/index.esm.js +0 -3
- package/dist/less.esm.css +0 -5762
- package/dist/less.esm.js +0 -3
- package/tests/__mocks__/fileMock.js +0 -1
- package/tests/__mocks__/zatUtils.js +0 -27
- package/tests/setup.ts +0 -477
- package/tests/test-utils.tsx +0 -81
@@ -1,13 +1,13 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
5
6
|
value: true
|
6
7
|
});
|
7
8
|
exports.default = exports.ProTreeSelect = void 0;
|
8
9
|
require("antd/es/tooltip/style");
|
9
10
|
var _tooltip = _interopRequireDefault(require("antd/es/tooltip"));
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
11
11
|
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
12
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
13
13
|
require("antd/es/input/style");
|
@@ -19,22 +19,21 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
19
19
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
20
20
|
require("antd/es/tree-select/style");
|
21
21
|
var _treeSelect = _interopRequireDefault(require("antd/es/tree-select"));
|
22
|
-
var _debounce2 = _interopRequireDefault(require("lodash/debounce"));
|
23
|
-
var _cloneDeep2 = _interopRequireDefault(require("lodash/cloneDeep"));
|
24
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
25
22
|
var _ahooks = require("ahooks");
|
26
|
-
var
|
27
|
-
var _react = require("react");
|
23
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
24
|
+
var _react = _interopRequireWildcard(require("react"));
|
25
|
+
var _lodash = require("lodash");
|
28
26
|
var _locale = _interopRequireDefault(require("../../../locale"));
|
29
27
|
var _ProConfigProvider = require("../../../ProConfigProvider");
|
30
28
|
var _Container = _interopRequireDefault(require("../../../ProForm/components/Container"));
|
31
29
|
var _AdaptiveTooltip = _interopRequireDefault(require("../AdaptiveTooltip"));
|
30
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
32
31
|
var _excluded = ["disabled", "code", "dataSource", "defaultDisableValue", "onChange", "useRequest", "transformResponse", "fieldNames", "placeholder", "tooltip", "showSearch", "filterTreeNode", "treeNodeFilterProp", "defaultExpandAll", "expandedKeys", "treeCheckable", "onSearch", "otherProps", "width", "dropdownStyle", "popupClassName", "style", "allowClear", "listHeight", "showCodeName", "className", "checkStrictly", "checkable"],
|
33
32
|
_excluded2 = ["children"];
|
34
33
|
/* eslint-disable react/no-danger */
|
35
34
|
/* eslint-disable react/jsx-closing-tag-location */
|
36
35
|
var SHOW_PARENT = _treeSelect.default.SHOW_PARENT;
|
37
|
-
var ProTreeSelect =
|
36
|
+
var ProTreeSelect = (props, ref) => {
|
38
37
|
var _useRequest$options;
|
39
38
|
// 全局属性配置在ConfigProvider
|
40
39
|
var _ref = (0, _ProConfigProvider.useProConfig)('ProTreeSelect') || {},
|
@@ -110,25 +109,26 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
110
109
|
_useSetState2$$origDa = _useSetState2$.origDataSource,
|
111
110
|
origDataSource = _useSetState2$$origDa === void 0 ? [] : _useSetState2$$origDa,
|
112
111
|
setState = _useSetState2[1];
|
112
|
+
|
113
113
|
/**
|
114
114
|
* 如果数据少于10条那么将数据平铺返回
|
115
115
|
* @param dictsEnum 原始数据
|
116
116
|
* @returns 平铺或者原始数据
|
117
117
|
*/
|
118
|
-
var countChild =
|
118
|
+
var countChild = dictsEnum => {
|
119
119
|
if (treeCheckable) {
|
120
120
|
return dictsEnum;
|
121
121
|
}
|
122
122
|
var count = 0;
|
123
123
|
var result = [];
|
124
|
-
var
|
125
|
-
data.map(
|
124
|
+
var loopCount = data => {
|
125
|
+
data.map(item => {
|
126
126
|
count += 1;
|
127
127
|
var children = item.children,
|
128
128
|
other = (0, _objectWithoutProperties2.default)(item, _excluded2);
|
129
129
|
result.push((0, _objectSpread2.default)({}, other));
|
130
130
|
if (item.children) {
|
131
|
-
|
131
|
+
loopCount(item.children);
|
132
132
|
}
|
133
133
|
return item;
|
134
134
|
});
|
@@ -136,35 +136,36 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
136
136
|
if ((dictsEnum === null || dictsEnum === void 0 ? void 0 : dictsEnum.length) > 10) {
|
137
137
|
return dictsEnum;
|
138
138
|
}
|
139
|
-
|
139
|
+
loopCount(dictsEnum);
|
140
140
|
if (count <= 10) {
|
141
141
|
return result;
|
142
142
|
}
|
143
143
|
return dictsEnum;
|
144
144
|
};
|
145
|
+
|
145
146
|
/**
|
146
147
|
* 如果要展示code-name,那么将源数据的label转为code-name
|
147
148
|
* @param dataArr 源数据
|
148
149
|
* @param showCodeAndName 是否展示code-name
|
149
150
|
* @returns 转换结果
|
150
151
|
*/
|
151
|
-
var transferDataSource =
|
152
|
-
var copyData = (0,
|
153
|
-
var
|
154
|
-
arr.map(
|
155
|
-
item[label] =
|
152
|
+
var transferDataSource = (dataArr, showCodeAndName) => {
|
153
|
+
var copyData = (0, _lodash.cloneDeep)(dataArr);
|
154
|
+
var loop = arr => {
|
155
|
+
arr.map(item => {
|
156
|
+
item[label] = `${item[code]}-${item[label]}`;
|
156
157
|
if (item.children) {
|
157
|
-
|
158
|
+
loop(item.children);
|
158
159
|
}
|
159
160
|
return item;
|
160
161
|
});
|
161
162
|
};
|
162
163
|
if (showCodeAndName) {
|
163
|
-
|
164
|
+
loop(copyData);
|
164
165
|
}
|
165
166
|
return copyData;
|
166
167
|
};
|
167
|
-
var defaultOnSuccessFun =
|
168
|
+
var defaultOnSuccessFun = res => {
|
168
169
|
var _res$status = res.status,
|
169
170
|
status = _res$status === void 0 ? 200 : _res$status,
|
170
171
|
msg = res.message,
|
@@ -179,7 +180,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
179
180
|
origDataSource: resultData || []
|
180
181
|
});
|
181
182
|
};
|
182
|
-
var successTransformDataHandle = (0, _react.useCallback)(
|
183
|
+
var successTransformDataHandle = (0, _react.useCallback)(res => {
|
183
184
|
if (transformResponse && typeof transformResponse === 'function') {
|
184
185
|
return transformResponse(res);
|
185
186
|
}
|
@@ -194,11 +195,12 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
194
195
|
}
|
195
196
|
return data;
|
196
197
|
}, []);
|
198
|
+
|
197
199
|
// 配置了异步数据源,拉取枚举数据逻辑 如果有code不掉接口从local里根据code取值
|
198
200
|
var fetchFunction = (0, _ahooks.useRequest)(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, (0, _objectSpread2.default)({
|
199
201
|
manual: true,
|
200
202
|
debounceWait: 300,
|
201
|
-
onSuccess:
|
203
|
+
onSuccess: data => {
|
202
204
|
if (transformResponse && typeof transformResponse === 'function') {
|
203
205
|
var responseData = transformResponse(data);
|
204
206
|
var resultData = transferDataSource(responseData, showCodeName);
|
@@ -211,19 +213,17 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
211
213
|
}
|
212
214
|
}
|
213
215
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options));
|
214
|
-
var cacheList =
|
215
|
-
(0, _react.useImperativeHandle)(ref,
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
});
|
216
|
+
var cacheList = useRequest !== null && useRequest !== void 0 && (_useRequest$options = useRequest.options) !== null && _useRequest$options !== void 0 && _useRequest$options.cacheKey ? successTransformDataHandle(fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.data) : [];
|
217
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
218
|
+
useRequestRef: fetchFunction
|
219
|
+
}));
|
220
|
+
|
220
221
|
// 设置cacheKey后使用缓存的数据
|
221
|
-
(0, _ahooks.useDeepCompareEffect)(
|
222
|
+
(0, _ahooks.useDeepCompareEffect)(() => {
|
222
223
|
var _useRequest$options2;
|
223
|
-
if (fetchFunction
|
224
|
+
if (fetchFunction !== null && fetchFunction !== void 0 && fetchFunction.data, useRequest !== null && useRequest !== void 0 && (_useRequest$options2 = useRequest.options) !== null && _useRequest$options2 !== void 0 && _useRequest$options2.cacheKey) {
|
224
225
|
if (transformResponse && typeof transformResponse === 'function') {
|
225
226
|
var responseData = transformResponse(fetchFunction.data);
|
226
|
-
// debugger;
|
227
227
|
var resultData = transferDataSource(responseData, showCodeName);
|
228
228
|
setState({
|
229
229
|
selectList: countChild(resultData),
|
@@ -234,7 +234,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
234
234
|
}
|
235
235
|
}
|
236
236
|
}, [fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.data]);
|
237
|
-
(0, _ahooks.useDeepCompareEffect)(
|
237
|
+
(0, _ahooks.useDeepCompareEffect)(() => {
|
238
238
|
if (enumCode) {
|
239
239
|
var dictEnum = dics[enumCode] || [];
|
240
240
|
var resultData = transferDataSource(dictEnum, showCodeName);
|
@@ -250,7 +250,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
250
250
|
});
|
251
251
|
}
|
252
252
|
}, [enumCode, dataSource]);
|
253
|
-
(0, _ahooks.useDeepCompareEffect)(
|
253
|
+
(0, _ahooks.useDeepCompareEffect)(() => {
|
254
254
|
// code存在huo dataSource存在,不执行接口请求
|
255
255
|
if (enumCode || dataSource) {
|
256
256
|
return undefined;
|
@@ -263,65 +263,66 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
263
263
|
if (defaultDisableValue || !useRequest) {
|
264
264
|
return undefined;
|
265
265
|
}
|
266
|
-
if (manual ||
|
266
|
+
if (manual || cacheList !== null && cacheList !== void 0 && cacheList.length) {
|
267
267
|
return;
|
268
268
|
}
|
269
269
|
var params = Array.isArray(defaultParams) ? defaultParams === null || defaultParams === void 0 ? void 0 : defaultParams[0] : defaultParams || {};
|
270
270
|
// 执行用户配置的枚举服务,拉取枚举数据进行更新
|
271
271
|
fetchFunction.run(params);
|
272
272
|
}, [useRequest === null || useRequest === void 0 ? void 0 : useRequest.options, defaultDisableValue]);
|
273
|
+
|
273
274
|
// disable默认值
|
274
275
|
if (defaultDisableValue) {
|
275
|
-
return (0, _jsxRuntime.jsx)("span", {
|
276
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
276
277
|
title: defaultDisableValue,
|
277
|
-
children: (0, _jsxRuntime.jsx)(_input.default, {
|
278
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_input.default, {
|
278
279
|
disabled: true,
|
279
280
|
defaultValue: defaultDisableValue,
|
280
281
|
style: props === null || props === void 0 ? void 0 : props.style
|
281
282
|
})
|
282
283
|
});
|
283
284
|
}
|
285
|
+
|
284
286
|
/**
|
285
287
|
* 根据值进行回显
|
286
288
|
* @param value 输入值
|
287
289
|
* @returns 对应枚举label
|
288
290
|
*/
|
289
|
-
var transToLabel =
|
291
|
+
var transToLabel = value => {
|
290
292
|
if (!Array.isArray(origDataSource) || !origDataSource.length) {
|
291
293
|
return viewEmpty;
|
292
294
|
}
|
293
295
|
var labelResult = [];
|
294
|
-
var
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
};
|
306
|
-
_queryLabel(origDataSource);
|
296
|
+
var queryLabel = dicts => dicts.map(item => {
|
297
|
+
if (value.includes(item[code])) {
|
298
|
+
var labelText = item[label];
|
299
|
+
labelResult.push(labelText);
|
300
|
+
}
|
301
|
+
if (item.children) {
|
302
|
+
queryLabel(item.children);
|
303
|
+
}
|
304
|
+
return item;
|
305
|
+
});
|
306
|
+
queryLabel(origDataSource);
|
307
307
|
return labelResult === null || labelResult === void 0 ? void 0 : labelResult.join(',');
|
308
308
|
};
|
309
|
+
|
309
310
|
// 纯展示处理
|
310
311
|
if (isView || props.isView) {
|
311
312
|
if (Array.isArray(value)) {
|
312
|
-
return (0, _jsxRuntime.jsx)(_Container.default, {
|
313
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Container.default, {
|
313
314
|
tooltip: true,
|
314
315
|
viewEmpty: viewEmpty,
|
315
316
|
children: transToLabel(value)
|
316
317
|
});
|
317
318
|
}
|
318
|
-
return (0, _jsxRuntime.jsx)(_Container.default, {
|
319
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Container.default, {
|
319
320
|
viewEmpty: viewEmpty,
|
320
321
|
children: value ? transToLabel([value]) : null
|
321
322
|
});
|
322
323
|
}
|
323
|
-
var Icon =
|
324
|
-
return (0, _jsxRuntime.jsx)("svg", {
|
324
|
+
var Icon = () => {
|
325
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
|
325
326
|
className: "icon",
|
326
327
|
viewBox: "0 0 1433 1024",
|
327
328
|
version: "1.1",
|
@@ -329,19 +330,20 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
329
330
|
"p-id": "2318",
|
330
331
|
width: "1em",
|
331
332
|
height: "1em",
|
332
|
-
children: (0, _jsxRuntime.jsx)("path", {
|
333
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
333
334
|
d: "M209.92 337.2032l362.0864 361.984L1223.68 47.5136l144.7936 144.896-796.4672 796.4672-506.88-506.88z",
|
334
335
|
"p-id": "2319",
|
335
336
|
fill: "currentColor"
|
336
337
|
})
|
337
338
|
});
|
338
339
|
};
|
340
|
+
|
339
341
|
/**
|
340
342
|
* 自定义渲染子树
|
341
343
|
* @param node 每个节点数据对象
|
342
344
|
* @returns 整个react节点树
|
343
345
|
*/
|
344
|
-
var
|
346
|
+
var renderTreeNode = (node, grade) => {
|
345
347
|
var children = node.children,
|
346
348
|
icon = node.icon;
|
347
349
|
var labelText = node[label];
|
@@ -350,39 +352,39 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
350
352
|
// 三无走默认
|
351
353
|
if (['undefined-undefined', 'undefined'].includes(labelText) && !value && !key) {
|
352
354
|
if (showCodeName) {
|
353
|
-
labelText =
|
355
|
+
labelText = `${node === null || node === void 0 ? void 0 : node.value}-${node === null || node === void 0 ? void 0 : node.label}`;
|
354
356
|
} else {
|
355
357
|
labelText = node === null || node === void 0 ? void 0 : node.label;
|
356
358
|
}
|
357
359
|
value = node === null || node === void 0 ? void 0 : node.value;
|
358
360
|
key = node === null || node === void 0 ? void 0 : node.value;
|
359
361
|
}
|
360
|
-
var titleHtml = (0, _jsxRuntime.jsx)("span", {
|
362
|
+
var titleHtml = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
361
363
|
dangerouslySetInnerHTML: {
|
362
364
|
__html: labelText
|
363
365
|
}
|
364
366
|
});
|
365
367
|
var searchKey = '';
|
366
368
|
if (showCodeName) {
|
367
|
-
searchKey =
|
369
|
+
searchKey = `${value}-${labelText}`;
|
368
370
|
} else {
|
369
371
|
searchKey = labelText;
|
370
372
|
}
|
371
|
-
var title = treeCheckable ? titleHtml : (0, _jsxRuntime.jsxs)("span", {
|
373
|
+
var title = treeCheckable ? titleHtml : /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
372
374
|
className: "check-option-text",
|
373
|
-
children: [(0, _jsxRuntime.jsx)("span", {
|
375
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
374
376
|
className: "check-option-text-content",
|
375
377
|
children: titleHtml
|
376
|
-
}), !disabled ? (0, _jsxRuntime.jsx)("span", {
|
378
|
+
}), !disabled ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
377
379
|
className: "check-mark-icon",
|
378
|
-
children: (0, _jsxRuntime.jsx)(Icon, {})
|
380
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {})
|
379
381
|
}) : null]
|
380
382
|
});
|
381
383
|
if (_showEllipse) {
|
382
|
-
title = (0, _jsxRuntime.jsx)(_AdaptiveTooltip.default, {
|
383
|
-
children: treeCheckable ? titleHtml : (0, _jsxRuntime.jsx)("span", {
|
384
|
+
title = /*#__PURE__*/(0, _jsxRuntime.jsx)(_AdaptiveTooltip.default, {
|
385
|
+
children: treeCheckable ? titleHtml : /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
384
386
|
className: "check-option-text",
|
385
|
-
children: (0, _jsxRuntime.jsx)("span", {
|
387
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
386
388
|
className: "check-option-text-content",
|
387
389
|
children: titleHtml
|
388
390
|
})
|
@@ -390,29 +392,28 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
390
392
|
});
|
391
393
|
}
|
392
394
|
if (!children) {
|
393
|
-
return (0, _jsxRuntime.jsx)(_treeSelect.default.TreeNode, {
|
395
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_treeSelect.default.TreeNode, {
|
394
396
|
value: value,
|
395
397
|
title: title,
|
396
398
|
label: searchKey,
|
397
399
|
disabled: node.disabled,
|
398
400
|
checkable: node.checkable,
|
399
401
|
icon: icon,
|
400
|
-
className:
|
402
|
+
className: `node-val-${value}`
|
401
403
|
}, key);
|
402
404
|
}
|
403
405
|
var sonGrade = grade + 1;
|
404
|
-
return (0, _jsxRuntime.jsx)(_treeSelect.default.TreeNode, {
|
406
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_treeSelect.default.TreeNode, {
|
405
407
|
value: value,
|
406
408
|
title: title,
|
407
409
|
label: searchKey,
|
408
410
|
disabled: node.disabled,
|
409
411
|
checkable: node.checkable,
|
410
|
-
className:
|
411
|
-
children: children.map(
|
412
|
-
return _renderTreeNode(child, sonGrade);
|
413
|
-
})
|
412
|
+
className: `node-val-${value}`,
|
413
|
+
children: children.map(child => renderTreeNode(child, sonGrade))
|
414
414
|
}, key);
|
415
415
|
};
|
416
|
+
|
416
417
|
/**
|
417
418
|
* 从树形数据中找出用户搜索得数据,并且将搜索字符串高亮标识
|
418
419
|
* @param data 全量树
|
@@ -420,7 +421,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
420
421
|
* @returns 处理后得树
|
421
422
|
*/
|
422
423
|
function filterTree(sourceList, keyWord) {
|
423
|
-
var
|
424
|
+
var filterData = function filterData(data) {
|
424
425
|
var currentAllNodeChild = []; // 记录当前节点得所有子节点
|
425
426
|
// 遍历数组
|
426
427
|
for (var i = 0; i < data.length; i++) {
|
@@ -428,7 +429,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
428
429
|
// 一直递归到最后一层子节点
|
429
430
|
var currentNodeChild = []; // 记录当前节点下得子节点匹配到的节点个数
|
430
431
|
if (item.children && item.children.length > 0) {
|
431
|
-
currentNodeChild =
|
432
|
+
currentNodeChild = filterData(item.children);
|
432
433
|
}
|
433
434
|
// 迭代完子节点向上回溯,如果有匹配到得子节点,那么加入当前节点得孩子对象上,否则加入得是空数组
|
434
435
|
item.children = currentNodeChild;
|
@@ -436,17 +437,17 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
436
437
|
// @ts-ignore
|
437
438
|
if (item[label].indexOf(keyWord) > -1 && (selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode) !== 'treeSelect') {
|
438
439
|
var regExp = new RegExp(keyWord);
|
439
|
-
item[label] = item[label].replace(regExp,
|
440
|
+
item[label] = item[label].replace(regExp, `<span class="highlight-search-text">${keyWord}</span>`);
|
440
441
|
}
|
441
442
|
currentAllNodeChild.push(item);
|
442
443
|
}
|
443
444
|
return currentAllNodeChild;
|
444
445
|
};
|
445
|
-
sourceList =
|
446
|
+
sourceList = filterData(sourceList);
|
446
447
|
return sourceList;
|
447
448
|
}
|
448
|
-
var searchTreeEvent = (0,
|
449
|
-
var _ref6 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(searchVal) {
|
449
|
+
var searchTreeEvent = (0, _lodash.debounce)( /*#__PURE__*/function () {
|
450
|
+
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(searchVal) {
|
450
451
|
var result;
|
451
452
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
452
453
|
while (1) switch (_context.prev = _context.next) {
|
@@ -456,11 +457,11 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
456
457
|
break;
|
457
458
|
}
|
458
459
|
setState({
|
459
|
-
selectList: (0,
|
460
|
+
selectList: (0, _lodash.cloneDeep)(origDataSource || [])
|
460
461
|
});
|
461
462
|
return _context.abrupt("return", null);
|
462
463
|
case 3:
|
463
|
-
result = filterTree((0,
|
464
|
+
result = filterTree((0, _lodash.cloneDeep)(origDataSource || []), searchVal);
|
464
465
|
setState({
|
465
466
|
selectList: result || []
|
466
467
|
});
|
@@ -476,7 +477,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
476
477
|
}(), 500);
|
477
478
|
function findTreeNode(treeList, nodeValue) {
|
478
479
|
var result = {};
|
479
|
-
var
|
480
|
+
var filterData = function filterData(data) {
|
480
481
|
for (var i = 0; i < data.length; i++) {
|
481
482
|
var item = data[i];
|
482
483
|
if (item[code] === nodeValue || Array.isArray(nodeValue) && nodeValue.includes(item[code])) {
|
@@ -488,11 +489,11 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
488
489
|
}
|
489
490
|
// 一直递归到最后一层子节点
|
490
491
|
if (item.children && item.children.length > 0) {
|
491
|
-
|
492
|
+
filterData(item.children);
|
492
493
|
}
|
493
494
|
}
|
494
495
|
};
|
495
|
-
|
496
|
+
filterData(treeList);
|
496
497
|
return result;
|
497
498
|
}
|
498
499
|
function getLabelByValue(treeList, nodeValue) {
|
@@ -500,7 +501,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
500
501
|
if (nodeValue) {
|
501
502
|
if (Array.isArray(nodeValue)) {
|
502
503
|
result = [];
|
503
|
-
nodeValue.map(
|
504
|
+
nodeValue.map(item => {
|
504
505
|
var res = findTreeNode(treeList, item === null || item === void 0 ? void 0 : item.value);
|
505
506
|
res && result.push(res);
|
506
507
|
return item;
|
@@ -511,9 +512,9 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
511
512
|
}
|
512
513
|
return result;
|
513
514
|
}
|
514
|
-
var handleChange =
|
515
|
+
var handleChange = (newVal, label, extra) => {
|
515
516
|
// newVal回来得一定是label、value
|
516
|
-
var _selectList = selectList.map(
|
517
|
+
var _selectList = selectList.map(item => {
|
517
518
|
var label = item.label;
|
518
519
|
var _label = label;
|
519
520
|
if (label) {
|
@@ -525,7 +526,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
525
526
|
});
|
526
527
|
});
|
527
528
|
var result = newVal;
|
528
|
-
if (props
|
529
|
+
if (props !== null && props !== void 0 && props.labelInValue) {
|
529
530
|
result = getLabelByValue(_selectList, newVal);
|
530
531
|
}
|
531
532
|
var options = findTreeNode(_selectList, extra === null || extra === void 0 ? void 0 : extra.triggerValue);
|
@@ -533,11 +534,12 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
533
534
|
// 重置搜索
|
534
535
|
showSearch && searchTreeEvent('');
|
535
536
|
};
|
537
|
+
|
536
538
|
/**
|
537
539
|
* 全局点击事件, 如果是单选的情况那么点击选中节点后取消勾选
|
538
540
|
* @param e 事件源
|
539
541
|
*/
|
540
|
-
var nodeChangeEvent =
|
542
|
+
var nodeChangeEvent = e => {
|
541
543
|
var el = e.target;
|
542
544
|
var classStr = el.className;
|
543
545
|
if (classStr && !treeCheckable && typeof classStr === 'string') {
|
@@ -552,17 +554,18 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
552
554
|
}
|
553
555
|
}
|
554
556
|
};
|
557
|
+
|
555
558
|
// 如果单选情况下只有10条那么设置class控制样式
|
556
559
|
var tenCountClass = '';
|
557
|
-
var countTen =
|
560
|
+
var countTen = enums => {
|
558
561
|
if (!enums) {
|
559
562
|
return '';
|
560
563
|
}
|
561
564
|
var noneChild = true;
|
562
|
-
var loopCount =
|
563
|
-
data.map(
|
565
|
+
var loopCount = data => {
|
566
|
+
data.map(item => {
|
564
567
|
var _item$children;
|
565
|
-
if (item
|
568
|
+
if (item !== null && item !== void 0 && (_item$children = item.children) !== null && _item$children !== void 0 && _item$children.length) {
|
566
569
|
noneChild = false;
|
567
570
|
}
|
568
571
|
return item;
|
@@ -572,21 +575,28 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
572
575
|
return noneChild ? 'ten-count-tree-node' : '';
|
573
576
|
};
|
574
577
|
tenCountClass = countTen(selectList);
|
575
|
-
var cls = (0,
|
576
|
-
'pro-tree-select': true
|
577
|
-
|
578
|
-
|
579
|
-
var
|
580
|
-
|
581
|
-
|
578
|
+
var cls = (0, _classnames.default)({
|
579
|
+
'pro-tree-select': true,
|
580
|
+
[`${className}`]: className
|
581
|
+
});
|
582
|
+
var innerClass = treeCheckable ? 'checkable-tree pro' : `${tenCountClass} signal-tree`;
|
583
|
+
var dropDownClassName = (0, _classnames.default)({
|
584
|
+
'pro-tree-select-drop-down-container': true,
|
585
|
+
[`${innerClass}`]: true,
|
586
|
+
[`${popupClassName}`]: popupClassName
|
587
|
+
});
|
582
588
|
var treeProps = (0, _objectSpread2.default)({
|
583
|
-
disabled
|
584
|
-
showSearch
|
589
|
+
disabled,
|
590
|
+
showSearch,
|
591
|
+
// 默认支持搜索
|
585
592
|
treeDefaultExpandAll: defaultExpandAll,
|
593
|
+
// 展开下拉配置,默认全展开
|
586
594
|
treeExpandedKeys: expandedKeys,
|
587
|
-
treeCheckable
|
595
|
+
treeCheckable,
|
596
|
+
// 可以复选;*枚举数据里必须有key
|
588
597
|
showCheckedStrategy: SHOW_PARENT,
|
589
|
-
|
598
|
+
// 选择后的值只显示父级
|
599
|
+
value,
|
590
600
|
onChange: handleChange,
|
591
601
|
dropdownStyle: (0, _objectSpread2.default)({
|
592
602
|
maxHeight: 320,
|
@@ -601,38 +611,37 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
601
611
|
onSearch: searchTreeEvent,
|
602
612
|
allowClear: allowClear || true,
|
603
613
|
showArrow: true,
|
604
|
-
treeNodeFilterProp
|
614
|
+
treeNodeFilterProp,
|
605
615
|
virtual: true,
|
606
616
|
treeCheckStrictly: checkStrictly
|
607
617
|
}, selectProps);
|
608
618
|
if (value === null) {
|
609
619
|
delete treeProps.value;
|
610
620
|
}
|
611
|
-
return (0, _jsxRuntime.jsx)("div", {
|
621
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
612
622
|
onClick: nodeChangeEvent,
|
613
623
|
className: cls,
|
614
|
-
children: (0, _jsxRuntime.jsx)(_treeSelect.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
624
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_treeSelect.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
615
625
|
placeholder: placeholder || _locale.default.ProForm.treeSelectPlaceholder,
|
616
|
-
maxTagPlaceholder:
|
617
|
-
var _rest = rest.map(
|
618
|
-
var _tag$label, _tag$
|
619
|
-
return (
|
626
|
+
maxTagPlaceholder: rest => {
|
627
|
+
var _rest = rest.map(tag => {
|
628
|
+
var _tag$label, _tag$label2, _tag$label3;
|
629
|
+
return (tag !== null && tag !== void 0 && (_tag$label = tag.label) !== null && _tag$label !== void 0 && (_tag$label = _tag$label.props) !== null && _tag$label !== void 0 && _tag$label.children ? tag === null || tag === void 0 || (_tag$label2 = tag.label) === null || _tag$label2 === void 0 || (_tag$label2 = _tag$label2.props) === null || _tag$label2 === void 0 || (_tag$label2 = _tag$label2.children) === null || _tag$label2 === void 0 || (_tag$label2 = _tag$label2.props) === null || _tag$label2 === void 0 || (_tag$label2 = _tag$label2.dangerouslySetInnerHTML) === null || _tag$label2 === void 0 ? void 0 : _tag$label2.__html : tag === null || tag === void 0 || (_tag$label3 = tag.label) === null || _tag$label3 === void 0 || (_tag$label3 = _tag$label3.props) === null || _tag$label3 === void 0 || (_tag$label3 = _tag$label3.dangerouslySetInnerHTML) === null || _tag$label3 === void 0 ? void 0 : _tag$label3.__html) || tag.label;
|
620
630
|
});
|
621
631
|
var _str = _rest.join('、');
|
622
|
-
return (0, _jsxRuntime.jsx)(_tooltip.default, {
|
623
|
-
title: (0, _jsxRuntime.jsx)("div", {
|
632
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_tooltip.default, {
|
633
|
+
title: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
624
634
|
children: _str
|
625
635
|
}),
|
626
|
-
children: (0, _jsxRuntime.jsxs)("span", {
|
636
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
627
637
|
children: ["+ ", rest.length, " ..."]
|
628
638
|
})
|
629
639
|
});
|
630
640
|
}
|
631
641
|
}, treeProps), {}, {
|
632
|
-
children: selectList.map(
|
633
|
-
return _renderTreeNode(node, 1);
|
634
|
-
})
|
642
|
+
children: selectList.map(node => renderTreeNode(node, 1))
|
635
643
|
}))
|
636
644
|
});
|
637
645
|
};
|
646
|
+
exports.ProTreeSelect = ProTreeSelect;
|
638
647
|
var _default = exports.default = /*#__PURE__*/(0, _react.forwardRef)(ProTreeSelect);
|