@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,6 +1,5 @@
|
|
1
1
|
import "antd/es/tooltip/style";
|
2
2
|
import _Tooltip from "antd/es/tooltip";
|
3
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
4
3
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
5
4
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
6
5
|
import "antd/es/input/style";
|
@@ -12,22 +11,22 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
12
11
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
13
12
|
import "antd/es/tree-select/style";
|
14
13
|
import _TreeSelect from "antd/es/tree-select";
|
15
|
-
import _debounce from "lodash/debounce";
|
16
|
-
import _cloneDeep from "lodash/cloneDeep";
|
17
14
|
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"],
|
18
15
|
_excluded2 = ["children"];
|
19
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
20
16
|
/* eslint-disable react/no-danger */
|
21
17
|
/* eslint-disable react/jsx-closing-tag-location */
|
22
18
|
import { useDeepCompareEffect, useRequest as useRequestFunc, useSetState } from 'ahooks';
|
23
19
|
import classnames from 'classnames';
|
24
|
-
import { useImperativeHandle, forwardRef, useCallback } from 'react';
|
25
|
-
import
|
26
|
-
import
|
27
|
-
import
|
28
|
-
import
|
20
|
+
import React, { useImperativeHandle, forwardRef, useCallback } from 'react';
|
21
|
+
import { cloneDeep, debounce } from 'lodash';
|
22
|
+
import locale from "../../../locale";
|
23
|
+
import { useProConfig } from "../../../ProConfigProvider";
|
24
|
+
import Container from "../../../ProForm/components/Container";
|
25
|
+
import AdaptiveTooltip from "../AdaptiveTooltip";
|
26
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
27
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
29
28
|
var SHOW_PARENT = _TreeSelect.SHOW_PARENT;
|
30
|
-
export var ProTreeSelect =
|
29
|
+
export var ProTreeSelect = (props, ref) => {
|
31
30
|
var _useRequest$options;
|
32
31
|
// 全局属性配置在ConfigProvider
|
33
32
|
var _ref = useProConfig('ProTreeSelect') || {},
|
@@ -103,25 +102,26 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
103
102
|
_useSetState2$$origDa = _useSetState2$.origDataSource,
|
104
103
|
origDataSource = _useSetState2$$origDa === void 0 ? [] : _useSetState2$$origDa,
|
105
104
|
setState = _useSetState2[1];
|
105
|
+
|
106
106
|
/**
|
107
107
|
* 如果数据少于10条那么将数据平铺返回
|
108
108
|
* @param dictsEnum 原始数据
|
109
109
|
* @returns 平铺或者原始数据
|
110
110
|
*/
|
111
|
-
var countChild =
|
111
|
+
var countChild = dictsEnum => {
|
112
112
|
if (treeCheckable) {
|
113
113
|
return dictsEnum;
|
114
114
|
}
|
115
115
|
var count = 0;
|
116
116
|
var result = [];
|
117
|
-
var
|
118
|
-
data.map(
|
117
|
+
var loopCount = data => {
|
118
|
+
data.map(item => {
|
119
119
|
count += 1;
|
120
120
|
var children = item.children,
|
121
121
|
other = _objectWithoutProperties(item, _excluded2);
|
122
122
|
result.push(_objectSpread({}, other));
|
123
123
|
if (item.children) {
|
124
|
-
|
124
|
+
loopCount(item.children);
|
125
125
|
}
|
126
126
|
return item;
|
127
127
|
});
|
@@ -129,35 +129,36 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
129
129
|
if ((dictsEnum === null || dictsEnum === void 0 ? void 0 : dictsEnum.length) > 10) {
|
130
130
|
return dictsEnum;
|
131
131
|
}
|
132
|
-
|
132
|
+
loopCount(dictsEnum);
|
133
133
|
if (count <= 10) {
|
134
134
|
return result;
|
135
135
|
}
|
136
136
|
return dictsEnum;
|
137
137
|
};
|
138
|
+
|
138
139
|
/**
|
139
140
|
* 如果要展示code-name,那么将源数据的label转为code-name
|
140
141
|
* @param dataArr 源数据
|
141
142
|
* @param showCodeAndName 是否展示code-name
|
142
143
|
* @returns 转换结果
|
143
144
|
*/
|
144
|
-
var transferDataSource =
|
145
|
-
var copyData =
|
146
|
-
var
|
147
|
-
arr.map(
|
148
|
-
item[label] =
|
145
|
+
var transferDataSource = (dataArr, showCodeAndName) => {
|
146
|
+
var copyData = cloneDeep(dataArr);
|
147
|
+
var loop = arr => {
|
148
|
+
arr.map(item => {
|
149
|
+
item[label] = `${item[code]}-${item[label]}`;
|
149
150
|
if (item.children) {
|
150
|
-
|
151
|
+
loop(item.children);
|
151
152
|
}
|
152
153
|
return item;
|
153
154
|
});
|
154
155
|
};
|
155
156
|
if (showCodeAndName) {
|
156
|
-
|
157
|
+
loop(copyData);
|
157
158
|
}
|
158
159
|
return copyData;
|
159
160
|
};
|
160
|
-
var defaultOnSuccessFun =
|
161
|
+
var defaultOnSuccessFun = res => {
|
161
162
|
var _res$status = res.status,
|
162
163
|
status = _res$status === void 0 ? 200 : _res$status,
|
163
164
|
msg = res.message,
|
@@ -172,7 +173,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
172
173
|
origDataSource: resultData || []
|
173
174
|
});
|
174
175
|
};
|
175
|
-
var successTransformDataHandle = useCallback(
|
176
|
+
var successTransformDataHandle = useCallback(res => {
|
176
177
|
if (transformResponse && typeof transformResponse === 'function') {
|
177
178
|
return transformResponse(res);
|
178
179
|
}
|
@@ -187,11 +188,12 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
187
188
|
}
|
188
189
|
return data;
|
189
190
|
}, []);
|
191
|
+
|
190
192
|
// 配置了异步数据源,拉取枚举数据逻辑 如果有code不掉接口从local里根据code取值
|
191
193
|
var fetchFunction = useRequestFunc(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, _objectSpread({
|
192
194
|
manual: true,
|
193
195
|
debounceWait: 300,
|
194
|
-
onSuccess:
|
196
|
+
onSuccess: data => {
|
195
197
|
if (transformResponse && typeof transformResponse === 'function') {
|
196
198
|
var responseData = transformResponse(data);
|
197
199
|
var resultData = transferDataSource(responseData, showCodeName);
|
@@ -204,19 +206,17 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
204
206
|
}
|
205
207
|
}
|
206
208
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options));
|
207
|
-
var cacheList =
|
208
|
-
useImperativeHandle(ref,
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
});
|
209
|
+
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) : [];
|
210
|
+
useImperativeHandle(ref, () => ({
|
211
|
+
useRequestRef: fetchFunction
|
212
|
+
}));
|
213
|
+
|
213
214
|
// 设置cacheKey后使用缓存的数据
|
214
|
-
useDeepCompareEffect(
|
215
|
+
useDeepCompareEffect(() => {
|
215
216
|
var _useRequest$options2;
|
216
|
-
if (fetchFunction
|
217
|
+
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) {
|
217
218
|
if (transformResponse && typeof transformResponse === 'function') {
|
218
219
|
var responseData = transformResponse(fetchFunction.data);
|
219
|
-
// debugger;
|
220
220
|
var resultData = transferDataSource(responseData, showCodeName);
|
221
221
|
setState({
|
222
222
|
selectList: countChild(resultData),
|
@@ -227,7 +227,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
227
227
|
}
|
228
228
|
}
|
229
229
|
}, [fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.data]);
|
230
|
-
useDeepCompareEffect(
|
230
|
+
useDeepCompareEffect(() => {
|
231
231
|
if (enumCode) {
|
232
232
|
var dictEnum = dics[enumCode] || [];
|
233
233
|
var resultData = transferDataSource(dictEnum, showCodeName);
|
@@ -243,7 +243,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
243
243
|
});
|
244
244
|
}
|
245
245
|
}, [enumCode, dataSource]);
|
246
|
-
useDeepCompareEffect(
|
246
|
+
useDeepCompareEffect(() => {
|
247
247
|
// code存在huo dataSource存在,不执行接口请求
|
248
248
|
if (enumCode || dataSource) {
|
249
249
|
return undefined;
|
@@ -256,65 +256,66 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
256
256
|
if (defaultDisableValue || !useRequest) {
|
257
257
|
return undefined;
|
258
258
|
}
|
259
|
-
if (manual ||
|
259
|
+
if (manual || cacheList !== null && cacheList !== void 0 && cacheList.length) {
|
260
260
|
return;
|
261
261
|
}
|
262
262
|
var params = Array.isArray(defaultParams) ? defaultParams === null || defaultParams === void 0 ? void 0 : defaultParams[0] : defaultParams || {};
|
263
263
|
// 执行用户配置的枚举服务,拉取枚举数据进行更新
|
264
264
|
fetchFunction.run(params);
|
265
265
|
}, [useRequest === null || useRequest === void 0 ? void 0 : useRequest.options, defaultDisableValue]);
|
266
|
+
|
266
267
|
// disable默认值
|
267
268
|
if (defaultDisableValue) {
|
268
|
-
return _jsx("span", {
|
269
|
+
return /*#__PURE__*/_jsx("span", {
|
269
270
|
title: defaultDisableValue,
|
270
|
-
children: _jsx(_Input, {
|
271
|
+
children: /*#__PURE__*/_jsx(_Input, {
|
271
272
|
disabled: true,
|
272
273
|
defaultValue: defaultDisableValue,
|
273
274
|
style: props === null || props === void 0 ? void 0 : props.style
|
274
275
|
})
|
275
276
|
});
|
276
277
|
}
|
278
|
+
|
277
279
|
/**
|
278
280
|
* 根据值进行回显
|
279
281
|
* @param value 输入值
|
280
282
|
* @returns 对应枚举label
|
281
283
|
*/
|
282
|
-
var transToLabel =
|
284
|
+
var transToLabel = value => {
|
283
285
|
if (!Array.isArray(origDataSource) || !origDataSource.length) {
|
284
286
|
return viewEmpty;
|
285
287
|
}
|
286
288
|
var labelResult = [];
|
287
|
-
var
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
};
|
299
|
-
_queryLabel(origDataSource);
|
289
|
+
var queryLabel = dicts => dicts.map(item => {
|
290
|
+
if (value.includes(item[code])) {
|
291
|
+
var labelText = item[label];
|
292
|
+
labelResult.push(labelText);
|
293
|
+
}
|
294
|
+
if (item.children) {
|
295
|
+
queryLabel(item.children);
|
296
|
+
}
|
297
|
+
return item;
|
298
|
+
});
|
299
|
+
queryLabel(origDataSource);
|
300
300
|
return labelResult === null || labelResult === void 0 ? void 0 : labelResult.join(',');
|
301
301
|
};
|
302
|
+
|
302
303
|
// 纯展示处理
|
303
304
|
if (isView || props.isView) {
|
304
305
|
if (Array.isArray(value)) {
|
305
|
-
return _jsx(Container, {
|
306
|
+
return /*#__PURE__*/_jsx(Container, {
|
306
307
|
tooltip: true,
|
307
308
|
viewEmpty: viewEmpty,
|
308
309
|
children: transToLabel(value)
|
309
310
|
});
|
310
311
|
}
|
311
|
-
return _jsx(Container, {
|
312
|
+
return /*#__PURE__*/_jsx(Container, {
|
312
313
|
viewEmpty: viewEmpty,
|
313
314
|
children: value ? transToLabel([value]) : null
|
314
315
|
});
|
315
316
|
}
|
316
|
-
var Icon =
|
317
|
-
return _jsx("svg", {
|
317
|
+
var Icon = () => {
|
318
|
+
return /*#__PURE__*/_jsx("svg", {
|
318
319
|
className: "icon",
|
319
320
|
viewBox: "0 0 1433 1024",
|
320
321
|
version: "1.1",
|
@@ -322,19 +323,20 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
322
323
|
"p-id": "2318",
|
323
324
|
width: "1em",
|
324
325
|
height: "1em",
|
325
|
-
children: _jsx("path", {
|
326
|
+
children: /*#__PURE__*/_jsx("path", {
|
326
327
|
d: "M209.92 337.2032l362.0864 361.984L1223.68 47.5136l144.7936 144.896-796.4672 796.4672-506.88-506.88z",
|
327
328
|
"p-id": "2319",
|
328
329
|
fill: "currentColor"
|
329
330
|
})
|
330
331
|
});
|
331
332
|
};
|
333
|
+
|
332
334
|
/**
|
333
335
|
* 自定义渲染子树
|
334
336
|
* @param node 每个节点数据对象
|
335
337
|
* @returns 整个react节点树
|
336
338
|
*/
|
337
|
-
var
|
339
|
+
var renderTreeNode = (node, grade) => {
|
338
340
|
var children = node.children,
|
339
341
|
icon = node.icon;
|
340
342
|
var labelText = node[label];
|
@@ -343,39 +345,39 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
343
345
|
// 三无走默认
|
344
346
|
if (['undefined-undefined', 'undefined'].includes(labelText) && !value && !key) {
|
345
347
|
if (showCodeName) {
|
346
|
-
labelText =
|
348
|
+
labelText = `${node === null || node === void 0 ? void 0 : node.value}-${node === null || node === void 0 ? void 0 : node.label}`;
|
347
349
|
} else {
|
348
350
|
labelText = node === null || node === void 0 ? void 0 : node.label;
|
349
351
|
}
|
350
352
|
value = node === null || node === void 0 ? void 0 : node.value;
|
351
353
|
key = node === null || node === void 0 ? void 0 : node.value;
|
352
354
|
}
|
353
|
-
var titleHtml = _jsx("span", {
|
355
|
+
var titleHtml = /*#__PURE__*/_jsx("span", {
|
354
356
|
dangerouslySetInnerHTML: {
|
355
357
|
__html: labelText
|
356
358
|
}
|
357
359
|
});
|
358
360
|
var searchKey = '';
|
359
361
|
if (showCodeName) {
|
360
|
-
searchKey =
|
362
|
+
searchKey = `${value}-${labelText}`;
|
361
363
|
} else {
|
362
364
|
searchKey = labelText;
|
363
365
|
}
|
364
|
-
var title = treeCheckable ? titleHtml : _jsxs("span", {
|
366
|
+
var title = treeCheckable ? titleHtml : /*#__PURE__*/_jsxs("span", {
|
365
367
|
className: "check-option-text",
|
366
|
-
children: [_jsx("span", {
|
368
|
+
children: [/*#__PURE__*/_jsx("span", {
|
367
369
|
className: "check-option-text-content",
|
368
370
|
children: titleHtml
|
369
|
-
}), !disabled ? _jsx("span", {
|
371
|
+
}), !disabled ? /*#__PURE__*/_jsx("span", {
|
370
372
|
className: "check-mark-icon",
|
371
|
-
children: _jsx(Icon, {})
|
373
|
+
children: /*#__PURE__*/_jsx(Icon, {})
|
372
374
|
}) : null]
|
373
375
|
});
|
374
376
|
if (_showEllipse) {
|
375
|
-
title = _jsx(AdaptiveTooltip, {
|
376
|
-
children: treeCheckable ? titleHtml : _jsx("span", {
|
377
|
+
title = /*#__PURE__*/_jsx(AdaptiveTooltip, {
|
378
|
+
children: treeCheckable ? titleHtml : /*#__PURE__*/_jsx("span", {
|
377
379
|
className: "check-option-text",
|
378
|
-
children: _jsx("span", {
|
380
|
+
children: /*#__PURE__*/_jsx("span", {
|
379
381
|
className: "check-option-text-content",
|
380
382
|
children: titleHtml
|
381
383
|
})
|
@@ -383,29 +385,28 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
383
385
|
});
|
384
386
|
}
|
385
387
|
if (!children) {
|
386
|
-
return _jsx(_TreeSelect.TreeNode, {
|
388
|
+
return /*#__PURE__*/_jsx(_TreeSelect.TreeNode, {
|
387
389
|
value: value,
|
388
390
|
title: title,
|
389
391
|
label: searchKey,
|
390
392
|
disabled: node.disabled,
|
391
393
|
checkable: node.checkable,
|
392
394
|
icon: icon,
|
393
|
-
className:
|
395
|
+
className: `node-val-${value}`
|
394
396
|
}, key);
|
395
397
|
}
|
396
398
|
var sonGrade = grade + 1;
|
397
|
-
return _jsx(_TreeSelect.TreeNode, {
|
399
|
+
return /*#__PURE__*/_jsx(_TreeSelect.TreeNode, {
|
398
400
|
value: value,
|
399
401
|
title: title,
|
400
402
|
label: searchKey,
|
401
403
|
disabled: node.disabled,
|
402
404
|
checkable: node.checkable,
|
403
|
-
className:
|
404
|
-
children: children.map(
|
405
|
-
return _renderTreeNode(child, sonGrade);
|
406
|
-
})
|
405
|
+
className: `node-val-${value}`,
|
406
|
+
children: children.map(child => renderTreeNode(child, sonGrade))
|
407
407
|
}, key);
|
408
408
|
};
|
409
|
+
|
409
410
|
/**
|
410
411
|
* 从树形数据中找出用户搜索得数据,并且将搜索字符串高亮标识
|
411
412
|
* @param data 全量树
|
@@ -413,7 +414,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
413
414
|
* @returns 处理后得树
|
414
415
|
*/
|
415
416
|
function filterTree(sourceList, keyWord) {
|
416
|
-
var
|
417
|
+
var filterData = function filterData(data) {
|
417
418
|
var currentAllNodeChild = []; // 记录当前节点得所有子节点
|
418
419
|
// 遍历数组
|
419
420
|
for (var i = 0; i < data.length; i++) {
|
@@ -421,7 +422,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
421
422
|
// 一直递归到最后一层子节点
|
422
423
|
var currentNodeChild = []; // 记录当前节点下得子节点匹配到的节点个数
|
423
424
|
if (item.children && item.children.length > 0) {
|
424
|
-
currentNodeChild =
|
425
|
+
currentNodeChild = filterData(item.children);
|
425
426
|
}
|
426
427
|
// 迭代完子节点向上回溯,如果有匹配到得子节点,那么加入当前节点得孩子对象上,否则加入得是空数组
|
427
428
|
item.children = currentNodeChild;
|
@@ -429,17 +430,17 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
429
430
|
// @ts-ignore
|
430
431
|
if (item[label].indexOf(keyWord) > -1 && (selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode) !== 'treeSelect') {
|
431
432
|
var regExp = new RegExp(keyWord);
|
432
|
-
item[label] = item[label].replace(regExp,
|
433
|
+
item[label] = item[label].replace(regExp, `<span class="highlight-search-text">${keyWord}</span>`);
|
433
434
|
}
|
434
435
|
currentAllNodeChild.push(item);
|
435
436
|
}
|
436
437
|
return currentAllNodeChild;
|
437
438
|
};
|
438
|
-
sourceList =
|
439
|
+
sourceList = filterData(sourceList);
|
439
440
|
return sourceList;
|
440
441
|
}
|
441
|
-
var searchTreeEvent =
|
442
|
-
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(searchVal) {
|
442
|
+
var searchTreeEvent = debounce( /*#__PURE__*/function () {
|
443
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(searchVal) {
|
443
444
|
var result;
|
444
445
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
445
446
|
while (1) switch (_context.prev = _context.next) {
|
@@ -449,11 +450,11 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
449
450
|
break;
|
450
451
|
}
|
451
452
|
setState({
|
452
|
-
selectList:
|
453
|
+
selectList: cloneDeep(origDataSource || [])
|
453
454
|
});
|
454
455
|
return _context.abrupt("return", null);
|
455
456
|
case 3:
|
456
|
-
result = filterTree(
|
457
|
+
result = filterTree(cloneDeep(origDataSource || []), searchVal);
|
457
458
|
setState({
|
458
459
|
selectList: result || []
|
459
460
|
});
|
@@ -469,7 +470,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
469
470
|
}(), 500);
|
470
471
|
function findTreeNode(treeList, nodeValue) {
|
471
472
|
var result = {};
|
472
|
-
var
|
473
|
+
var filterData = function filterData(data) {
|
473
474
|
for (var i = 0; i < data.length; i++) {
|
474
475
|
var item = data[i];
|
475
476
|
if (item[code] === nodeValue || Array.isArray(nodeValue) && nodeValue.includes(item[code])) {
|
@@ -481,11 +482,11 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
481
482
|
}
|
482
483
|
// 一直递归到最后一层子节点
|
483
484
|
if (item.children && item.children.length > 0) {
|
484
|
-
|
485
|
+
filterData(item.children);
|
485
486
|
}
|
486
487
|
}
|
487
488
|
};
|
488
|
-
|
489
|
+
filterData(treeList);
|
489
490
|
return result;
|
490
491
|
}
|
491
492
|
function getLabelByValue(treeList, nodeValue) {
|
@@ -493,7 +494,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
493
494
|
if (nodeValue) {
|
494
495
|
if (Array.isArray(nodeValue)) {
|
495
496
|
result = [];
|
496
|
-
nodeValue.map(
|
497
|
+
nodeValue.map(item => {
|
497
498
|
var res = findTreeNode(treeList, item === null || item === void 0 ? void 0 : item.value);
|
498
499
|
res && result.push(res);
|
499
500
|
return item;
|
@@ -504,9 +505,9 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
504
505
|
}
|
505
506
|
return result;
|
506
507
|
}
|
507
|
-
var handleChange =
|
508
|
+
var handleChange = (newVal, label, extra) => {
|
508
509
|
// newVal回来得一定是label、value
|
509
|
-
var _selectList = selectList.map(
|
510
|
+
var _selectList = selectList.map(item => {
|
510
511
|
var label = item.label;
|
511
512
|
var _label = label;
|
512
513
|
if (label) {
|
@@ -518,7 +519,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
518
519
|
});
|
519
520
|
});
|
520
521
|
var result = newVal;
|
521
|
-
if (props
|
522
|
+
if (props !== null && props !== void 0 && props.labelInValue) {
|
522
523
|
result = getLabelByValue(_selectList, newVal);
|
523
524
|
}
|
524
525
|
var options = findTreeNode(_selectList, extra === null || extra === void 0 ? void 0 : extra.triggerValue);
|
@@ -526,11 +527,12 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
526
527
|
// 重置搜索
|
527
528
|
showSearch && searchTreeEvent('');
|
528
529
|
};
|
530
|
+
|
529
531
|
/**
|
530
532
|
* 全局点击事件, 如果是单选的情况那么点击选中节点后取消勾选
|
531
533
|
* @param e 事件源
|
532
534
|
*/
|
533
|
-
var nodeChangeEvent =
|
535
|
+
var nodeChangeEvent = e => {
|
534
536
|
var el = e.target;
|
535
537
|
var classStr = el.className;
|
536
538
|
if (classStr && !treeCheckable && typeof classStr === 'string') {
|
@@ -545,17 +547,18 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
545
547
|
}
|
546
548
|
}
|
547
549
|
};
|
550
|
+
|
548
551
|
// 如果单选情况下只有10条那么设置class控制样式
|
549
552
|
var tenCountClass = '';
|
550
|
-
var countTen =
|
553
|
+
var countTen = enums => {
|
551
554
|
if (!enums) {
|
552
555
|
return '';
|
553
556
|
}
|
554
557
|
var noneChild = true;
|
555
|
-
var loopCount =
|
556
|
-
data.map(
|
558
|
+
var loopCount = data => {
|
559
|
+
data.map(item => {
|
557
560
|
var _item$children;
|
558
|
-
if (item
|
561
|
+
if (item !== null && item !== void 0 && (_item$children = item.children) !== null && _item$children !== void 0 && _item$children.length) {
|
559
562
|
noneChild = false;
|
560
563
|
}
|
561
564
|
return item;
|
@@ -565,21 +568,28 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
565
568
|
return noneChild ? 'ten-count-tree-node' : '';
|
566
569
|
};
|
567
570
|
tenCountClass = countTen(selectList);
|
568
|
-
var cls = classnames(
|
569
|
-
'pro-tree-select': true
|
570
|
-
|
571
|
-
|
572
|
-
var
|
573
|
-
|
574
|
-
|
571
|
+
var cls = classnames({
|
572
|
+
'pro-tree-select': true,
|
573
|
+
[`${className}`]: className
|
574
|
+
});
|
575
|
+
var innerClass = treeCheckable ? 'checkable-tree pro' : `${tenCountClass} signal-tree`;
|
576
|
+
var dropDownClassName = classnames({
|
577
|
+
'pro-tree-select-drop-down-container': true,
|
578
|
+
[`${innerClass}`]: true,
|
579
|
+
[`${popupClassName}`]: popupClassName
|
580
|
+
});
|
575
581
|
var treeProps = _objectSpread({
|
576
|
-
disabled
|
577
|
-
showSearch
|
582
|
+
disabled,
|
583
|
+
showSearch,
|
584
|
+
// 默认支持搜索
|
578
585
|
treeDefaultExpandAll: defaultExpandAll,
|
586
|
+
// 展开下拉配置,默认全展开
|
579
587
|
treeExpandedKeys: expandedKeys,
|
580
|
-
treeCheckable
|
588
|
+
treeCheckable,
|
589
|
+
// 可以复选;*枚举数据里必须有key
|
581
590
|
showCheckedStrategy: SHOW_PARENT,
|
582
|
-
|
591
|
+
// 选择后的值只显示父级
|
592
|
+
value,
|
583
593
|
onChange: handleChange,
|
584
594
|
dropdownStyle: _objectSpread({
|
585
595
|
maxHeight: 320,
|
@@ -594,37 +604,35 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
594
604
|
onSearch: searchTreeEvent,
|
595
605
|
allowClear: allowClear || true,
|
596
606
|
showArrow: true,
|
597
|
-
treeNodeFilterProp
|
607
|
+
treeNodeFilterProp,
|
598
608
|
virtual: true,
|
599
609
|
treeCheckStrictly: checkStrictly
|
600
610
|
}, selectProps);
|
601
611
|
if (value === null) {
|
602
612
|
delete treeProps.value;
|
603
613
|
}
|
604
|
-
return _jsx("div", {
|
614
|
+
return /*#__PURE__*/_jsx("div", {
|
605
615
|
onClick: nodeChangeEvent,
|
606
616
|
className: cls,
|
607
|
-
children: _jsx(_TreeSelect, _objectSpread(_objectSpread({
|
617
|
+
children: /*#__PURE__*/_jsx(_TreeSelect, _objectSpread(_objectSpread({
|
608
618
|
placeholder: placeholder || locale.ProForm.treeSelectPlaceholder,
|
609
|
-
maxTagPlaceholder:
|
610
|
-
var _rest = rest.map(
|
611
|
-
var _tag$label, _tag$
|
612
|
-
return (
|
619
|
+
maxTagPlaceholder: rest => {
|
620
|
+
var _rest = rest.map(tag => {
|
621
|
+
var _tag$label, _tag$label2, _tag$label3;
|
622
|
+
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;
|
613
623
|
});
|
614
624
|
var _str = _rest.join('、');
|
615
|
-
return _jsx(_Tooltip, {
|
616
|
-
title: _jsx("div", {
|
625
|
+
return /*#__PURE__*/_jsx(_Tooltip, {
|
626
|
+
title: /*#__PURE__*/_jsx("div", {
|
617
627
|
children: _str
|
618
628
|
}),
|
619
|
-
children: _jsxs("span", {
|
629
|
+
children: /*#__PURE__*/_jsxs("span", {
|
620
630
|
children: ["+ ", rest.length, " ..."]
|
621
631
|
})
|
622
632
|
});
|
623
633
|
}
|
624
634
|
}, treeProps), {}, {
|
625
|
-
children: selectList.map(
|
626
|
-
return _renderTreeNode(node, 1);
|
627
|
-
})
|
635
|
+
children: selectList.map(node => renderTreeNode(node, 1))
|
628
636
|
}))
|
629
637
|
});
|
630
638
|
};
|
@@ -1,6 +1,7 @@
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
1
|
import { memo } from 'react';
|
3
|
-
import AdaptiveTooltip from
|
2
|
+
import AdaptiveTooltip from "./AdaptiveTooltip";
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
4
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
4
5
|
function SearchTitle(props) {
|
5
6
|
var label = props.label,
|
6
7
|
_props$searchStr = props.searchStr,
|
@@ -21,30 +22,30 @@ function SearchTitle(props) {
|
|
21
22
|
classEllipse = 'ellipse';
|
22
23
|
style.width = ellipseWidth;
|
23
24
|
}
|
24
|
-
var title = index > -1 ? _jsxs("span", {
|
25
|
+
var title = index > -1 ? /*#__PURE__*/_jsxs("span", {
|
25
26
|
className: classEllipse,
|
26
27
|
style: style,
|
27
|
-
children: [beforeStr, searchStr ? _jsx("span", {
|
28
|
+
children: [beforeStr, searchStr ? /*#__PURE__*/_jsx("span", {
|
28
29
|
className: "pro-tree-modal-search-value",
|
29
30
|
children: searchStr
|
30
31
|
}) : null, afterStr]
|
31
|
-
}) : _jsx("span", {
|
32
|
+
}) : /*#__PURE__*/_jsx("span", {
|
32
33
|
className: classEllipse,
|
33
34
|
style: style,
|
34
35
|
children: strTitle
|
35
36
|
});
|
36
|
-
var titleTips = index > -1 ? _jsxs("span", {
|
37
|
+
var titleTips = index > -1 ? /*#__PURE__*/_jsxs("span", {
|
37
38
|
style: style,
|
38
|
-
children: [beforeStr, searchStr ? _jsx("span", {
|
39
|
+
children: [beforeStr, searchStr ? /*#__PURE__*/_jsx("span", {
|
39
40
|
className: "pro-tree-modal-search-value",
|
40
41
|
children: searchStr
|
41
42
|
}) : null, afterStr]
|
42
|
-
}) : _jsx("span", {
|
43
|
+
}) : /*#__PURE__*/_jsx("span", {
|
43
44
|
style: style,
|
44
45
|
children: strTitle
|
45
46
|
});
|
46
47
|
if (classEllipse && !isDiffChange) {
|
47
|
-
return _jsx(AdaptiveTooltip, {
|
48
|
+
return /*#__PURE__*/_jsx(AdaptiveTooltip, {
|
48
49
|
children: titleTips
|
49
50
|
});
|
50
51
|
}
|