@zat-design/sisyphus-react 3.13.19-beta.1 → 3.13.19-beta.11
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/dist/index.esm.css +1 -6344
- package/dist/index.min.js +1 -0
- package/dist/less.esm.css +1 -5768
- package/dist/less.min.js +1 -0
- package/es/FormsProvider/index.js +9 -7
- package/es/ProAction/components/CheckModalContent/index.js +14 -14
- package/es/ProAction/index.js +46 -47
- package/es/ProConfigProvider/index.js +26 -20
- package/es/ProDownload/index.js +66 -73
- package/es/ProDownload/utils.js +26 -23
- package/es/ProDrawerForm/components/ProDrawer/index.js +43 -39
- package/es/ProDrawerForm/components/ProModal/index.js +25 -23
- package/es/ProDrawerForm/components/index.js +2 -2
- package/es/ProDrawerForm/index.js +19 -21
- package/es/ProDrawerForm/utils/index.js +1 -1
- package/es/ProEditLabel/components/RenderProForm.js +30 -26
- package/es/ProEditLabel/index.js +49 -36
- package/es/ProEditLabel/utils/index.js +4 -3
- package/es/ProEditTable/components/ActionButton/index.js +83 -76
- package/es/ProEditTable/components/RcTable/BaseTable.js +24 -24
- package/es/ProEditTable/components/RcTable/DraggableTable.js +34 -41
- package/es/ProEditTable/components/RcTable/VirtualTable.js +4 -3
- package/es/ProEditTable/components/RcTable/index.js +3 -3
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +61 -57
- package/es/ProEditTable/components/RenderField/index.js +151 -145
- package/es/ProEditTable/components/RenderToolbar/index.js +37 -42
- package/es/ProEditTable/components/Summary/index.js +22 -21
- package/es/ProEditTable/components/Validator/index.js +11 -10
- package/es/ProEditTable/components/index.js +5 -5
- package/es/ProEditTable/index.d.ts +1 -1
- package/es/ProEditTable/index.js +170 -173
- package/es/ProEditTable/utils/config.js +42 -46
- package/es/ProEditTable/utils/diffOriginal.js +34 -19
- package/es/ProEditTable/utils/getDefaultProps.js +12 -13
- package/es/ProEditTable/utils/index.js +102 -99
- package/es/ProEditTable/utils/tools.js +88 -91
- package/es/ProEditTable/utils/transform.js +7 -11
- package/es/ProEditTable/utils/useEditTableError.js +22 -13
- package/es/ProEnum/components/Group.js +23 -27
- package/es/ProEnum/components/Tag.js +14 -16
- package/es/ProEnum/hooks/useEnum.js +32 -14
- package/es/ProEnum/hooks/useEnumRequest.js +42 -42
- package/es/ProEnum/hooks/useFrequentEnumRequest.js +17 -19
- package/es/ProEnum/index.js +80 -89
- package/es/ProEnum/utils/eventCenter.js +23 -32
- package/es/ProEnum/utils/frequentEnum.js +16 -4
- package/es/ProEnum/utils/getEnumLabel.js +16 -21
- package/es/ProEnum/utils/index.js +12 -7
- package/es/ProForm/components/Container.js +8 -6
- package/es/ProForm/components/FormFooter/index.js +21 -19
- package/es/ProForm/components/base/Checkbox/index.js +16 -15
- package/es/ProForm/components/base/DatePicker/index.js +23 -20
- package/es/ProForm/components/base/Input/index.js +20 -18
- package/es/ProForm/components/base/InputNumber/index.js +57 -53
- package/es/ProForm/components/base/Radio/index.js +15 -15
- package/es/ProForm/components/base/RangePicker/index.js +24 -29
- package/es/ProForm/components/base/RangePicker/useDateRange.js +3 -3
- package/es/ProForm/components/base/Select/index.js +17 -15
- package/es/ProForm/components/base/Switch/index.js +16 -15
- package/es/ProForm/components/base/SwitchCheckbox/index.js +19 -18
- package/es/ProForm/components/base/TextArea/index.js +18 -17
- package/es/ProForm/components/base/TimePicker/index.js +10 -9
- package/es/ProForm/components/combination/Container/index.js +25 -23
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +80 -92
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +21 -19
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +7 -7
- package/es/ProForm/components/combination/FormList/components/Empty.js +21 -20
- package/es/ProForm/components/combination/FormList/components/LineFields.js +19 -18
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +45 -51
- package/es/ProForm/components/combination/FormList/index.js +43 -51
- package/es/ProForm/components/combination/FormList/utils.js +9 -9
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.js +8 -6
- package/es/ProForm/components/combination/Group/component/ComRender.js +33 -29
- package/es/ProForm/components/combination/Group/hooks/index.js +49 -47
- package/es/ProForm/components/combination/Group/index.js +38 -37
- package/es/ProForm/components/combination/Group/utils.js +56 -50
- package/es/ProForm/components/combination/ProCascader/index.js +81 -85
- package/es/ProForm/components/combination/ProCascader/utils/index.js +6 -6
- package/es/ProForm/components/combination/ProCombination/index.js +41 -37
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +31 -25
- package/es/ProForm/components/combination/ProModalSelect/index.js +166 -173
- package/es/ProForm/components/combination/ProModalSelect/utils/index.js +1 -1
- package/es/ProForm/components/combination/ProNumberRange/index.js +46 -51
- package/es/ProForm/components/combination/ProRangeLimit/index.js +39 -39
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +3 -3
- package/es/ProForm/components/combination/ProTimeLimit/index.js +43 -40
- package/es/ProForm/components/index.d.ts +1 -0
- package/es/ProForm/components/index.js +40 -35
- package/es/ProForm/components/old/EnumSelect/hooks/useRequestList.js +30 -28
- package/es/ProForm/components/old/EnumSelect/index.js +55 -62
- package/es/ProForm/components/old/InputRange/index.js +17 -16
- package/es/ProForm/components/old/InputWithSuffix/index.js +6 -5
- package/es/ProForm/components/old/ProAddress/index.js +53 -75
- package/es/ProForm/components/old/ProCertNo/index.js +17 -17
- package/es/ProForm/components/old/ProCertValidity/index.js +19 -21
- package/es/ProForm/components/old/ProRangeBox/index.js +25 -24
- package/es/ProForm/components/render/ChangedWrapper.js +34 -33
- package/es/ProForm/components/render/ConfirmWrapper.js +16 -18
- package/es/ProForm/components/render/Render.js +150 -135
- package/es/ProForm/components/render/RenderFields.js +65 -50
- package/es/ProForm/components/render/propsType.js +25 -0
- package/es/ProForm/index.js +83 -70
- package/es/ProForm/propsType.d.ts +1 -1
- package/es/ProForm/propsType.js +5 -1
- package/es/ProForm/utils/diffOriginal.js +30 -16
- package/es/ProForm/utils/getDefaultProps.js +10 -10
- package/es/ProForm/utils/index.js +105 -110
- package/es/ProForm/utils/processDependencies.js +15 -5
- package/es/ProForm/utils/rulesCreator.js +21 -22
- package/es/ProForm/utils/transformNames.js +7 -6
- package/es/ProForm/utils/transformValue.js +16 -13
- package/es/ProForm/utils/useDeepCompareMemo.js +6 -4
- package/es/ProForm/utils/useFieldProps.js +1 -3
- package/es/ProForm/utils/useForm.js +36 -34
- package/es/ProForm/utils/useRules.js +28 -31
- package/es/ProForm/utils/useShouldUpdate.js +83 -86
- package/es/ProForm/utils/useWatch.js +36 -14
- package/es/ProForm/utils/valueType.js +51 -52
- package/es/ProIcon/config/index.js +2 -0
- package/es/ProIcon/index.js +53 -49
- package/es/ProIcon/utils/index.js +8 -9
- package/es/ProLayout/components/Layout/Header/index.js +13 -11
- package/es/ProLayout/components/Layout/Icon/Icon.js +7 -7
- package/es/ProLayout/components/Layout/Icon/index.js +1 -1
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +42 -40
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +51 -52
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +10 -9
- package/es/ProLayout/components/Layout/Menu/index.js +20 -18
- package/es/ProLayout/components/Layout/Notice/index.js +12 -11
- package/es/ProLayout/components/Layout/index.js +4 -4
- package/es/ProLayout/components/ProCollapse/index.js +35 -32
- package/es/ProLayout/components/ProFooter/index.js +13 -15
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +9 -9
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +8 -7
- package/es/ProLayout/components/ProHeader/components/index.js +2 -2
- package/es/ProLayout/components/ProHeader/index.js +129 -118
- package/es/ProLayout/components/ProHeader/utils/index.js +1 -1
- package/es/ProLayout/components/index.js +3 -3
- package/es/ProLayout/index.d.ts +1 -1
- package/es/ProLayout/index.js +28 -25
- package/es/ProLayout/utils/index.js +37 -35
- package/es/ProSelect/components/AdaptiveTooltip.js +10 -11
- package/es/ProSelect/index.js +87 -99
- package/es/ProSelect/utils/index.js +27 -33
- package/es/ProStep/components/Anchor/index.d.ts +1 -0
- package/es/ProStep/components/Anchor/index.js +26 -25
- package/es/ProStep/components/Item/index.d.ts +1 -0
- package/es/ProStep/components/Item/index.js +26 -22
- package/es/ProStep/components/Listener/index.js +11 -15
- package/es/ProStep/components/Step/index.js +24 -25
- package/es/ProStep/index.js +51 -53
- package/es/ProStep/utils/index.js +13 -12
- package/es/ProStepTab/index.js +59 -37
- package/es/ProTable/components/FormatColumn/index.js +106 -110
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +7 -9
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +36 -50
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +24 -24
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +8 -10
- package/es/ProTable/components/RcTable/index.js +2 -2
- package/es/ProTable/components/RenderColumn/index.js +51 -51
- package/es/ProTable/components/RenderEmptyText/index.js +8 -7
- package/es/ProTable/components/RenderFooter/index.js +3 -3
- package/es/ProTable/components/RenderSummary/index.js +13 -13
- package/es/ProTable/components/RenderTableHeader/index.js +16 -14
- package/es/ProTable/components/RenderTabs/index.js +28 -33
- package/es/ProTable/components/TableResizable/index.js +17 -16
- package/es/ProTable/components/TooltipTitle/index.js +7 -6
- package/es/ProTable/components/index.js +11 -6
- package/es/ProTable/hooks/useAntdTable.js +106 -119
- package/es/ProTable/index.js +158 -176
- package/es/ProTable/utils/index.js +25 -21
- package/es/ProTabs/components/Card/index.js +15 -14
- package/es/ProTabs/components/index.js +1 -1
- package/es/ProTabs/index.js +24 -25
- package/es/ProThemeTools/component/ProTools/index.js +69 -68
- package/es/ProThemeTools/component/index.js +1 -1
- package/es/ProThemeTools/index.js +47 -33
- package/es/ProThemeTools/utils/index.js +20 -17
- package/es/ProTooltip/index.js +44 -46
- package/es/ProTree/components/AdaptiveTooltip.js +5 -7
- package/es/ProTree/components/CloseIcon.js +5 -5
- package/es/ProTree/components/List.js +22 -24
- package/es/ProTree/components/ProTree.js +84 -102
- package/es/ProTree/components/ProTreeSelect/index.js +128 -119
- package/es/ProTree/components/SearchTitle.js +10 -9
- package/es/ProTree/components/Tree.js +57 -58
- package/es/ProTree/components/index.js +4 -4
- package/es/ProTree/index.js +6 -6
- package/es/ProTree/utils.js +29 -22
- package/es/ProTreeModal/components/Cascader.js +31 -33
- package/es/ProTreeModal/components/CloseIcon.js +5 -5
- package/es/ProTreeModal/components/List.js +74 -93
- package/es/ProTreeModal/components/SearchTitle.js +5 -4
- package/es/ProTreeModal/components/SortableItem.js +14 -14
- package/es/ProTreeModal/components/Tree.js +49 -53
- package/es/ProTreeModal/components/Trigger.js +29 -28
- package/es/ProTreeModal/components/index.js +6 -6
- package/es/ProTreeModal/index.js +166 -206
- package/es/ProTreeModal/utils.js +37 -33
- package/es/ProUpload/components/ButtonRender.js +33 -36
- package/es/ProUpload/components/DragRender.js +54 -51
- package/es/ProUpload/components/DraggableUploadListItem.js +5 -4
- package/es/ProUpload/components/Example.js +13 -12
- package/es/ProUpload/components/FileItem.js +63 -58
- package/es/ProUpload/components/ImageRender.js +98 -100
- package/es/ProUpload/index.js +75 -82
- package/es/ProUpload/uitls.js +3 -3
- package/es/ProUtils/utils/index.js +10 -14
- package/es/ProViewer/index.js +29 -25
- package/es/ProViewer/propsType.js +0 -1
- package/es/ProWaterMark/index.js +5 -4
- package/es/index.d.ts +1 -1
- package/es/index.js +38 -29
- package/es/locale/index.js +7 -4
- package/es/old/ProCertValidity/index.js +19 -21
- package/es/old/ProEditableTable/index.js +156 -156
- package/es/old/ProEditableTable/utils.js +61 -63
- package/es/tokens.js +1 -0
- package/es/utils/index.js +12 -12
- package/lib/FormsProvider/index.js +11 -7
- package/lib/ProAction/components/CheckModalContent/index.js +11 -13
- package/lib/ProAction/index.js +40 -43
- package/lib/ProConfigProvider/index.js +24 -17
- package/lib/ProDownload/index.js +65 -71
- package/lib/ProDownload/utils.js +25 -22
- package/lib/ProDrawerForm/components/ProDrawer/index.js +39 -38
- package/lib/ProDrawerForm/components/ProModal/index.js +23 -22
- package/lib/ProDrawerForm/index.js +18 -18
- package/lib/ProDrawerForm/utils/index.js +3 -2
- package/lib/ProEditLabel/components/RenderProForm.js +26 -24
- package/lib/ProEditLabel/index.js +46 -35
- package/lib/ProEditLabel/utils/index.js +6 -5
- package/lib/ProEditTable/components/ActionButton/index.js +79 -74
- package/lib/ProEditTable/components/RcTable/BaseTable.js +21 -23
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +32 -40
- package/lib/ProEditTable/components/RcTable/VirtualTable.js +3 -3
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +62 -59
- package/lib/ProEditTable/components/RenderField/index.js +137 -132
- package/lib/ProEditTable/components/RenderToolbar/index.js +34 -41
- package/lib/ProEditTable/components/Summary/index.js +20 -20
- package/lib/ProEditTable/components/Validator/index.js +10 -10
- package/lib/ProEditTable/index.d.ts +1 -1
- package/lib/ProEditTable/index.js +159 -164
- package/lib/ProEditTable/utils/config.js +40 -44
- package/lib/ProEditTable/utils/diffOriginal.js +36 -21
- package/lib/ProEditTable/utils/getDefaultProps.js +14 -15
- package/lib/ProEditTable/utils/index.js +97 -97
- package/lib/ProEditTable/utils/tools.js +96 -91
- package/lib/ProEditTable/utils/transform.js +7 -11
- package/lib/ProEditTable/utils/useEditTableError.js +22 -13
- package/lib/ProEnum/components/Group.js +23 -27
- package/lib/ProEnum/components/Tag.js +14 -16
- package/lib/ProEnum/hooks/useEnum.js +30 -12
- package/lib/ProEnum/hooks/useEnumRequest.js +39 -39
- package/lib/ProEnum/hooks/useFrequentEnumRequest.js +16 -18
- package/lib/ProEnum/index.js +68 -78
- package/lib/ProEnum/utils/eventCenter.js +23 -32
- package/lib/ProEnum/utils/frequentEnum.js +14 -3
- package/lib/ProEnum/utils/getEnumLabel.js +15 -21
- package/lib/ProEnum/utils/index.js +12 -7
- package/lib/ProForm/components/Container.js +7 -5
- package/lib/ProForm/components/FormFooter/index.js +19 -17
- package/lib/ProForm/components/base/Checkbox/index.js +14 -13
- package/lib/ProForm/components/base/DatePicker/index.js +20 -17
- package/lib/ProForm/components/base/Input/index.js +15 -15
- package/lib/ProForm/components/base/InputNumber/index.js +51 -48
- package/lib/ProForm/components/base/Radio/index.js +13 -13
- package/lib/ProForm/components/base/RangePicker/index.js +19 -22
- package/lib/ProForm/components/base/RangePicker/useDateRange.js +5 -4
- package/lib/ProForm/components/base/Select/index.js +14 -12
- package/lib/ProForm/components/base/Switch/index.js +11 -11
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +16 -15
- package/lib/ProForm/components/base/TextArea/index.js +14 -13
- package/lib/ProForm/components/base/TimePicker/index.js +6 -5
- package/lib/ProForm/components/combination/Container/index.js +22 -21
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +77 -89
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +17 -15
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +7 -7
- package/lib/ProForm/components/combination/FormList/components/Empty.js +17 -18
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +14 -14
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +43 -48
- package/lib/ProForm/components/combination/FormList/index.js +35 -43
- package/lib/ProForm/components/combination/FormList/utils.js +11 -10
- package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.js +7 -5
- package/lib/ProForm/components/combination/Group/component/ComRender.js +30 -28
- package/lib/ProForm/components/combination/Group/hooks/index.js +48 -45
- package/lib/ProForm/components/combination/Group/index.js +34 -35
- package/lib/ProForm/components/combination/Group/utils.js +62 -50
- package/lib/ProForm/components/combination/ProCascader/index.js +75 -80
- package/lib/ProForm/components/combination/ProCascader/utils/index.js +8 -7
- package/lib/ProForm/components/combination/ProCombination/index.js +35 -31
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +30 -24
- package/lib/ProForm/components/combination/ProModalSelect/index.js +171 -180
- package/lib/ProForm/components/combination/ProModalSelect/utils/index.js +3 -2
- package/lib/ProForm/components/combination/ProNumberRange/index.js +42 -48
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +35 -35
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +3 -3
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +37 -34
- package/lib/ProForm/components/index.d.ts +1 -0
- package/lib/ProForm/components/old/EnumSelect/hooks/useRequestList.js +35 -33
- package/lib/ProForm/components/old/EnumSelect/index.js +50 -58
- package/lib/ProForm/components/old/InputRange/index.js +16 -16
- package/lib/ProForm/components/old/InputWithSuffix/index.js +4 -4
- package/lib/ProForm/components/old/ProAddress/index.js +53 -75
- package/lib/ProForm/components/old/ProCertNo/index.js +16 -17
- package/lib/ProForm/components/old/ProCertValidity/index.js +17 -18
- package/lib/ProForm/components/old/ProRangeBox/index.js +24 -24
- package/lib/ProForm/components/render/ChangedWrapper.js +35 -35
- package/lib/ProForm/components/render/ConfirmWrapper.js +14 -17
- package/lib/ProForm/components/render/Render.js +138 -125
- package/lib/ProForm/components/render/RenderFields.js +57 -43
- package/lib/ProForm/components/render/propsType.js +26 -1
- package/lib/ProForm/index.js +74 -61
- package/lib/ProForm/propsType.d.ts +1 -1
- package/lib/ProForm/propsType.js +5 -1
- package/lib/ProForm/utils/diffOriginal.js +30 -17
- package/lib/ProForm/utils/getDefaultProps.js +12 -12
- package/lib/ProForm/utils/index.js +127 -106
- package/lib/ProForm/utils/processDependencies.js +15 -6
- package/lib/ProForm/utils/rulesCreator.js +21 -21
- package/lib/ProForm/utils/transformNames.js +6 -6
- package/lib/ProForm/utils/transformValue.js +14 -11
- package/lib/ProForm/utils/useDeepCompareMemo.js +7 -6
- package/lib/ProForm/utils/useFieldProps.js +2 -3
- package/lib/ProForm/utils/useForm.js +33 -31
- package/lib/ProForm/utils/useRules.js +25 -28
- package/lib/ProForm/utils/useShouldUpdate.js +82 -85
- package/lib/ProForm/utils/useWatch.js +36 -14
- package/lib/ProForm/utils/valueType.js +52 -52
- package/lib/ProIcon/config/index.js +2 -0
- package/lib/ProIcon/index.js +47 -44
- package/lib/ProIcon/utils/index.js +10 -8
- package/lib/ProLayout/components/Layout/Header/index.js +10 -10
- package/lib/ProLayout/components/Layout/Icon/Icon.js +8 -7
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +37 -36
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +49 -52
- package/lib/ProLayout/components/Layout/Menu/SideMenu/index.js +8 -8
- package/lib/ProLayout/components/Layout/Menu/index.js +17 -16
- package/lib/ProLayout/components/Layout/Notice/index.js +8 -8
- package/lib/ProLayout/components/ProCollapse/index.js +32 -30
- package/lib/ProLayout/components/ProFooter/index.js +14 -16
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +7 -7
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +6 -7
- package/lib/ProLayout/components/ProHeader/index.js +131 -120
- package/lib/ProLayout/components/ProHeader/utils/index.js +3 -2
- package/lib/ProLayout/index.d.ts +1 -1
- package/lib/ProLayout/index.js +22 -21
- package/lib/ProLayout/utils/index.js +42 -33
- package/lib/ProSelect/components/AdaptiveTooltip.js +9 -11
- package/lib/ProSelect/index.js +82 -93
- package/lib/ProSelect/utils/index.js +29 -34
- package/lib/ProStep/components/Anchor/index.d.ts +1 -0
- package/lib/ProStep/components/Anchor/index.js +25 -24
- package/lib/ProStep/components/Item/index.d.ts +1 -0
- package/lib/ProStep/components/Item/index.js +24 -20
- package/lib/ProStep/components/Listener/index.js +9 -13
- package/lib/ProStep/components/Step/index.js +20 -21
- package/lib/ProStep/index.js +45 -49
- package/lib/ProStep/utils/index.js +16 -12
- package/lib/ProStepTab/index.js +60 -38
- package/lib/ProTable/components/FormatColumn/index.js +100 -104
- package/lib/ProTable/components/RcTable/components/BaseTable/index.js +5 -7
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +34 -48
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +25 -23
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +5 -7
- package/lib/ProTable/components/RenderColumn/index.js +46 -48
- package/lib/ProTable/components/RenderEmptyText/index.js +6 -6
- package/lib/ProTable/components/RenderFooter/index.js +3 -3
- package/lib/ProTable/components/RenderSummary/index.js +11 -12
- package/lib/ProTable/components/RenderTableHeader/index.js +14 -13
- package/lib/ProTable/components/RenderTabs/index.js +27 -32
- package/lib/ProTable/components/TableResizable/index.js +16 -15
- package/lib/ProTable/components/TooltipTitle/index.js +5 -5
- package/lib/ProTable/hooks/useAntdTable.js +103 -116
- package/lib/ProTable/index.js +149 -169
- package/lib/ProTable/utils/index.js +33 -22
- package/lib/ProTabs/components/Card/index.js +14 -14
- package/lib/ProTabs/index.js +24 -24
- package/lib/ProThemeTools/component/ProTools/index.js +66 -65
- package/lib/ProThemeTools/index.js +43 -29
- package/lib/ProThemeTools/utils/index.js +25 -18
- package/lib/ProTooltip/index.js +44 -46
- package/lib/ProTree/components/AdaptiveTooltip.js +5 -7
- package/lib/ProTree/components/CloseIcon.js +5 -5
- package/lib/ProTree/components/List.js +18 -22
- package/lib/ProTree/components/ProTree.js +77 -96
- package/lib/ProTree/components/ProTreeSelect/index.js +126 -116
- package/lib/ProTree/components/SearchTitle.js +8 -8
- package/lib/ProTree/components/Tree.js +53 -55
- package/lib/ProTree/index.js +4 -4
- package/lib/ProTree/utils.js +34 -25
- package/lib/ProTreeModal/components/Cascader.js +28 -32
- package/lib/ProTreeModal/components/CloseIcon.js +5 -5
- package/lib/ProTreeModal/components/List.js +69 -89
- package/lib/ProTreeModal/components/SearchTitle.js +4 -4
- package/lib/ProTreeModal/components/SortableItem.js +11 -12
- package/lib/ProTreeModal/components/Tree.js +44 -49
- package/lib/ProTreeModal/components/Trigger.js +26 -26
- package/lib/ProTreeModal/index.js +157 -199
- package/lib/ProTreeModal/utils.js +43 -35
- package/lib/ProUpload/components/ButtonRender.js +29 -33
- package/lib/ProUpload/components/DragRender.js +50 -48
- package/lib/ProUpload/components/DraggableUploadListItem.js +7 -5
- package/lib/ProUpload/components/Example.js +13 -11
- package/lib/ProUpload/components/FileItem.js +58 -50
- package/lib/ProUpload/components/ImageRender.js +89 -93
- package/lib/ProUpload/index.js +68 -76
- package/lib/ProUpload/uitls.js +5 -3
- package/lib/ProUtils/utils/index.js +10 -14
- package/lib/ProViewer/index.js +26 -24
- package/lib/ProViewer/propsType.js +1 -5
- package/lib/ProWaterMark/index.js +5 -4
- package/lib/index.d.ts +1 -1
- package/lib/locale/index.js +6 -2
- package/lib/old/ProCertValidity/index.js +17 -18
- package/lib/old/ProEditableTable/index.js +153 -156
- package/lib/old/ProEditableTable/utils.js +61 -62
- package/lib/tokens.js +1 -0
- package/lib/utils/index.js +16 -13
- package/package.json +8 -8
- package/dist/index.esm.js +0 -3
- package/dist/less.esm.js +0 -3
@@ -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,16 +213,15 @@ 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
227
|
var resultData = transferDataSource(responseData, showCodeName);
|
@@ -233,7 +234,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
233
234
|
}
|
234
235
|
}
|
235
236
|
}, [fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.data]);
|
236
|
-
(0, _ahooks.useDeepCompareEffect)(
|
237
|
+
(0, _ahooks.useDeepCompareEffect)(() => {
|
237
238
|
if (enumCode) {
|
238
239
|
var dictEnum = dics[enumCode] || [];
|
239
240
|
var resultData = transferDataSource(dictEnum, showCodeName);
|
@@ -249,7 +250,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
249
250
|
});
|
250
251
|
}
|
251
252
|
}, [enumCode, dataSource]);
|
252
|
-
(0, _ahooks.useDeepCompareEffect)(
|
253
|
+
(0, _ahooks.useDeepCompareEffect)(() => {
|
253
254
|
// code存在huo dataSource存在,不执行接口请求
|
254
255
|
if (enumCode || dataSource) {
|
255
256
|
return undefined;
|
@@ -262,65 +263,66 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
262
263
|
if (defaultDisableValue || !useRequest) {
|
263
264
|
return undefined;
|
264
265
|
}
|
265
|
-
if (manual ||
|
266
|
+
if (manual || cacheList !== null && cacheList !== void 0 && cacheList.length) {
|
266
267
|
return;
|
267
268
|
}
|
268
269
|
var params = Array.isArray(defaultParams) ? defaultParams === null || defaultParams === void 0 ? void 0 : defaultParams[0] : defaultParams || {};
|
269
270
|
// 执行用户配置的枚举服务,拉取枚举数据进行更新
|
270
271
|
fetchFunction.run(params);
|
271
272
|
}, [useRequest === null || useRequest === void 0 ? void 0 : useRequest.options, defaultDisableValue]);
|
273
|
+
|
272
274
|
// disable默认值
|
273
275
|
if (defaultDisableValue) {
|
274
|
-
return (0, _jsxRuntime.jsx)("span", {
|
276
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
275
277
|
title: defaultDisableValue,
|
276
|
-
children: (0, _jsxRuntime.jsx)(_input.default, {
|
278
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_input.default, {
|
277
279
|
disabled: true,
|
278
280
|
defaultValue: defaultDisableValue,
|
279
281
|
style: props === null || props === void 0 ? void 0 : props.style
|
280
282
|
})
|
281
283
|
});
|
282
284
|
}
|
285
|
+
|
283
286
|
/**
|
284
287
|
* 根据值进行回显
|
285
288
|
* @param value 输入值
|
286
289
|
* @returns 对应枚举label
|
287
290
|
*/
|
288
|
-
var transToLabel =
|
291
|
+
var transToLabel = value => {
|
289
292
|
if (!Array.isArray(origDataSource) || !origDataSource.length) {
|
290
293
|
return viewEmpty;
|
291
294
|
}
|
292
295
|
var labelResult = [];
|
293
|
-
var
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
};
|
305
|
-
_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);
|
306
307
|
return labelResult === null || labelResult === void 0 ? void 0 : labelResult.join(',');
|
307
308
|
};
|
309
|
+
|
308
310
|
// 纯展示处理
|
309
311
|
if (isView || props.isView) {
|
310
312
|
if (Array.isArray(value)) {
|
311
|
-
return (0, _jsxRuntime.jsx)(_Container.default, {
|
313
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Container.default, {
|
312
314
|
tooltip: true,
|
313
315
|
viewEmpty: viewEmpty,
|
314
316
|
children: transToLabel(value)
|
315
317
|
});
|
316
318
|
}
|
317
|
-
return (0, _jsxRuntime.jsx)(_Container.default, {
|
319
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Container.default, {
|
318
320
|
viewEmpty: viewEmpty,
|
319
321
|
children: value ? transToLabel([value]) : null
|
320
322
|
});
|
321
323
|
}
|
322
|
-
var Icon =
|
323
|
-
return (0, _jsxRuntime.jsx)("svg", {
|
324
|
+
var Icon = () => {
|
325
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
|
324
326
|
className: "icon",
|
325
327
|
viewBox: "0 0 1433 1024",
|
326
328
|
version: "1.1",
|
@@ -328,19 +330,20 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
328
330
|
"p-id": "2318",
|
329
331
|
width: "1em",
|
330
332
|
height: "1em",
|
331
|
-
children: (0, _jsxRuntime.jsx)("path", {
|
333
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
332
334
|
d: "M209.92 337.2032l362.0864 361.984L1223.68 47.5136l144.7936 144.896-796.4672 796.4672-506.88-506.88z",
|
333
335
|
"p-id": "2319",
|
334
336
|
fill: "currentColor"
|
335
337
|
})
|
336
338
|
});
|
337
339
|
};
|
340
|
+
|
338
341
|
/**
|
339
342
|
* 自定义渲染子树
|
340
343
|
* @param node 每个节点数据对象
|
341
344
|
* @returns 整个react节点树
|
342
345
|
*/
|
343
|
-
var
|
346
|
+
var renderTreeNode = (node, grade) => {
|
344
347
|
var children = node.children,
|
345
348
|
icon = node.icon;
|
346
349
|
var labelText = node[label];
|
@@ -349,39 +352,39 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
349
352
|
// 三无走默认
|
350
353
|
if (['undefined-undefined', 'undefined'].includes(labelText) && !value && !key) {
|
351
354
|
if (showCodeName) {
|
352
|
-
labelText =
|
355
|
+
labelText = `${node === null || node === void 0 ? void 0 : node.value}-${node === null || node === void 0 ? void 0 : node.label}`;
|
353
356
|
} else {
|
354
357
|
labelText = node === null || node === void 0 ? void 0 : node.label;
|
355
358
|
}
|
356
359
|
value = node === null || node === void 0 ? void 0 : node.value;
|
357
360
|
key = node === null || node === void 0 ? void 0 : node.value;
|
358
361
|
}
|
359
|
-
var titleHtml = (0, _jsxRuntime.jsx)("span", {
|
362
|
+
var titleHtml = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
360
363
|
dangerouslySetInnerHTML: {
|
361
364
|
__html: labelText
|
362
365
|
}
|
363
366
|
});
|
364
367
|
var searchKey = '';
|
365
368
|
if (showCodeName) {
|
366
|
-
searchKey =
|
369
|
+
searchKey = `${value}-${labelText}`;
|
367
370
|
} else {
|
368
371
|
searchKey = labelText;
|
369
372
|
}
|
370
|
-
var title = treeCheckable ? titleHtml : (0, _jsxRuntime.jsxs)("span", {
|
373
|
+
var title = treeCheckable ? titleHtml : /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
371
374
|
className: "check-option-text",
|
372
|
-
children: [(0, _jsxRuntime.jsx)("span", {
|
375
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
373
376
|
className: "check-option-text-content",
|
374
377
|
children: titleHtml
|
375
|
-
}), !disabled ? (0, _jsxRuntime.jsx)("span", {
|
378
|
+
}), !disabled ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
376
379
|
className: "check-mark-icon",
|
377
|
-
children: (0, _jsxRuntime.jsx)(Icon, {})
|
380
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {})
|
378
381
|
}) : null]
|
379
382
|
});
|
380
383
|
if (_showEllipse) {
|
381
|
-
title = (0, _jsxRuntime.jsx)(_AdaptiveTooltip.default, {
|
382
|
-
children: treeCheckable ? titleHtml : (0, _jsxRuntime.jsx)("span", {
|
384
|
+
title = /*#__PURE__*/(0, _jsxRuntime.jsx)(_AdaptiveTooltip.default, {
|
385
|
+
children: treeCheckable ? titleHtml : /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
383
386
|
className: "check-option-text",
|
384
|
-
children: (0, _jsxRuntime.jsx)("span", {
|
387
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
385
388
|
className: "check-option-text-content",
|
386
389
|
children: titleHtml
|
387
390
|
})
|
@@ -389,29 +392,28 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
389
392
|
});
|
390
393
|
}
|
391
394
|
if (!children) {
|
392
|
-
return (0, _jsxRuntime.jsx)(_treeSelect.default.TreeNode, {
|
395
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_treeSelect.default.TreeNode, {
|
393
396
|
value: value,
|
394
397
|
title: title,
|
395
398
|
label: searchKey,
|
396
399
|
disabled: node.disabled,
|
397
400
|
checkable: node.checkable,
|
398
401
|
icon: icon,
|
399
|
-
className:
|
402
|
+
className: `node-val-${value}`
|
400
403
|
}, key);
|
401
404
|
}
|
402
405
|
var sonGrade = grade + 1;
|
403
|
-
return (0, _jsxRuntime.jsx)(_treeSelect.default.TreeNode, {
|
406
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_treeSelect.default.TreeNode, {
|
404
407
|
value: value,
|
405
408
|
title: title,
|
406
409
|
label: searchKey,
|
407
410
|
disabled: node.disabled,
|
408
411
|
checkable: node.checkable,
|
409
|
-
className:
|
410
|
-
children: children.map(
|
411
|
-
return _renderTreeNode(child, sonGrade);
|
412
|
-
})
|
412
|
+
className: `node-val-${value}`,
|
413
|
+
children: children.map(child => renderTreeNode(child, sonGrade))
|
413
414
|
}, key);
|
414
415
|
};
|
416
|
+
|
415
417
|
/**
|
416
418
|
* 从树形数据中找出用户搜索得数据,并且将搜索字符串高亮标识
|
417
419
|
* @param data 全量树
|
@@ -419,7 +421,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
419
421
|
* @returns 处理后得树
|
420
422
|
*/
|
421
423
|
function filterTree(sourceList, keyWord) {
|
422
|
-
var
|
424
|
+
var filterData = function filterData(data) {
|
423
425
|
var currentAllNodeChild = []; // 记录当前节点得所有子节点
|
424
426
|
// 遍历数组
|
425
427
|
for (var i = 0; i < data.length; i++) {
|
@@ -427,7 +429,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
427
429
|
// 一直递归到最后一层子节点
|
428
430
|
var currentNodeChild = []; // 记录当前节点下得子节点匹配到的节点个数
|
429
431
|
if (item.children && item.children.length > 0) {
|
430
|
-
currentNodeChild =
|
432
|
+
currentNodeChild = filterData(item.children);
|
431
433
|
}
|
432
434
|
// 迭代完子节点向上回溯,如果有匹配到得子节点,那么加入当前节点得孩子对象上,否则加入得是空数组
|
433
435
|
item.children = currentNodeChild;
|
@@ -435,17 +437,17 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
435
437
|
// @ts-ignore
|
436
438
|
if (item[label].indexOf(keyWord) > -1 && (selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode) !== 'treeSelect') {
|
437
439
|
var regExp = new RegExp(keyWord);
|
438
|
-
item[label] = item[label].replace(regExp,
|
440
|
+
item[label] = item[label].replace(regExp, `<span class="highlight-search-text">${keyWord}</span>`);
|
439
441
|
}
|
440
442
|
currentAllNodeChild.push(item);
|
441
443
|
}
|
442
444
|
return currentAllNodeChild;
|
443
445
|
};
|
444
|
-
sourceList =
|
446
|
+
sourceList = filterData(sourceList);
|
445
447
|
return sourceList;
|
446
448
|
}
|
447
|
-
var searchTreeEvent = (0,
|
448
|
-
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) {
|
449
451
|
var result;
|
450
452
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
451
453
|
while (1) switch (_context.prev = _context.next) {
|
@@ -455,11 +457,11 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
455
457
|
break;
|
456
458
|
}
|
457
459
|
setState({
|
458
|
-
selectList: (0,
|
460
|
+
selectList: (0, _lodash.cloneDeep)(origDataSource || [])
|
459
461
|
});
|
460
462
|
return _context.abrupt("return", null);
|
461
463
|
case 3:
|
462
|
-
result = filterTree((0,
|
464
|
+
result = filterTree((0, _lodash.cloneDeep)(origDataSource || []), searchVal);
|
463
465
|
setState({
|
464
466
|
selectList: result || []
|
465
467
|
});
|
@@ -475,7 +477,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
475
477
|
}(), 500);
|
476
478
|
function findTreeNode(treeList, nodeValue) {
|
477
479
|
var result = {};
|
478
|
-
var
|
480
|
+
var filterData = function filterData(data) {
|
479
481
|
for (var i = 0; i < data.length; i++) {
|
480
482
|
var item = data[i];
|
481
483
|
if (item[code] === nodeValue || Array.isArray(nodeValue) && nodeValue.includes(item[code])) {
|
@@ -487,11 +489,11 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
487
489
|
}
|
488
490
|
// 一直递归到最后一层子节点
|
489
491
|
if (item.children && item.children.length > 0) {
|
490
|
-
|
492
|
+
filterData(item.children);
|
491
493
|
}
|
492
494
|
}
|
493
495
|
};
|
494
|
-
|
496
|
+
filterData(treeList);
|
495
497
|
return result;
|
496
498
|
}
|
497
499
|
function getLabelByValue(treeList, nodeValue) {
|
@@ -499,7 +501,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
499
501
|
if (nodeValue) {
|
500
502
|
if (Array.isArray(nodeValue)) {
|
501
503
|
result = [];
|
502
|
-
nodeValue.map(
|
504
|
+
nodeValue.map(item => {
|
503
505
|
var res = findTreeNode(treeList, item === null || item === void 0 ? void 0 : item.value);
|
504
506
|
res && result.push(res);
|
505
507
|
return item;
|
@@ -510,9 +512,9 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
510
512
|
}
|
511
513
|
return result;
|
512
514
|
}
|
513
|
-
var handleChange =
|
515
|
+
var handleChange = (newVal, label, extra) => {
|
514
516
|
// newVal回来得一定是label、value
|
515
|
-
var _selectList = selectList.map(
|
517
|
+
var _selectList = selectList.map(item => {
|
516
518
|
var label = item.label;
|
517
519
|
var _label = label;
|
518
520
|
if (label) {
|
@@ -524,7 +526,7 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
524
526
|
});
|
525
527
|
});
|
526
528
|
var result = newVal;
|
527
|
-
if (props
|
529
|
+
if (props !== null && props !== void 0 && props.labelInValue) {
|
528
530
|
result = getLabelByValue(_selectList, newVal);
|
529
531
|
}
|
530
532
|
var options = findTreeNode(_selectList, extra === null || extra === void 0 ? void 0 : extra.triggerValue);
|
@@ -532,11 +534,12 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
532
534
|
// 重置搜索
|
533
535
|
showSearch && searchTreeEvent('');
|
534
536
|
};
|
537
|
+
|
535
538
|
/**
|
536
539
|
* 全局点击事件, 如果是单选的情况那么点击选中节点后取消勾选
|
537
540
|
* @param e 事件源
|
538
541
|
*/
|
539
|
-
var nodeChangeEvent =
|
542
|
+
var nodeChangeEvent = e => {
|
540
543
|
var el = e.target;
|
541
544
|
var classStr = el.className;
|
542
545
|
if (classStr && !treeCheckable && typeof classStr === 'string') {
|
@@ -551,17 +554,18 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
551
554
|
}
|
552
555
|
}
|
553
556
|
};
|
557
|
+
|
554
558
|
// 如果单选情况下只有10条那么设置class控制样式
|
555
559
|
var tenCountClass = '';
|
556
|
-
var countTen =
|
560
|
+
var countTen = enums => {
|
557
561
|
if (!enums) {
|
558
562
|
return '';
|
559
563
|
}
|
560
564
|
var noneChild = true;
|
561
|
-
var loopCount =
|
562
|
-
data.map(
|
565
|
+
var loopCount = data => {
|
566
|
+
data.map(item => {
|
563
567
|
var _item$children;
|
564
|
-
if (item
|
568
|
+
if (item !== null && item !== void 0 && (_item$children = item.children) !== null && _item$children !== void 0 && _item$children.length) {
|
565
569
|
noneChild = false;
|
566
570
|
}
|
567
571
|
return item;
|
@@ -571,21 +575,28 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
571
575
|
return noneChild ? 'ten-count-tree-node' : '';
|
572
576
|
};
|
573
577
|
tenCountClass = countTen(selectList);
|
574
|
-
var cls = (0,
|
575
|
-
'pro-tree-select': true
|
576
|
-
|
577
|
-
|
578
|
-
var
|
579
|
-
|
580
|
-
|
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
|
+
});
|
581
588
|
var treeProps = (0, _objectSpread2.default)({
|
582
|
-
disabled
|
583
|
-
showSearch
|
589
|
+
disabled,
|
590
|
+
showSearch,
|
591
|
+
// 默认支持搜索
|
584
592
|
treeDefaultExpandAll: defaultExpandAll,
|
593
|
+
// 展开下拉配置,默认全展开
|
585
594
|
treeExpandedKeys: expandedKeys,
|
586
|
-
treeCheckable
|
595
|
+
treeCheckable,
|
596
|
+
// 可以复选;*枚举数据里必须有key
|
587
597
|
showCheckedStrategy: SHOW_PARENT,
|
588
|
-
|
598
|
+
// 选择后的值只显示父级
|
599
|
+
value,
|
589
600
|
onChange: handleChange,
|
590
601
|
dropdownStyle: (0, _objectSpread2.default)({
|
591
602
|
maxHeight: 320,
|
@@ -600,38 +611,37 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
600
611
|
onSearch: searchTreeEvent,
|
601
612
|
allowClear: allowClear || true,
|
602
613
|
showArrow: true,
|
603
|
-
treeNodeFilterProp
|
614
|
+
treeNodeFilterProp,
|
604
615
|
virtual: true,
|
605
616
|
treeCheckStrictly: checkStrictly
|
606
617
|
}, selectProps);
|
607
618
|
if (value === null) {
|
608
619
|
delete treeProps.value;
|
609
620
|
}
|
610
|
-
return (0, _jsxRuntime.jsx)("div", {
|
621
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
611
622
|
onClick: nodeChangeEvent,
|
612
623
|
className: cls,
|
613
|
-
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)({
|
614
625
|
placeholder: placeholder || _locale.default.ProForm.treeSelectPlaceholder,
|
615
|
-
maxTagPlaceholder:
|
616
|
-
var _rest = rest.map(
|
617
|
-
var _tag$label, _tag$
|
618
|
-
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;
|
619
630
|
});
|
620
631
|
var _str = _rest.join('、');
|
621
|
-
return (0, _jsxRuntime.jsx)(_tooltip.default, {
|
622
|
-
title: (0, _jsxRuntime.jsx)("div", {
|
632
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_tooltip.default, {
|
633
|
+
title: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
623
634
|
children: _str
|
624
635
|
}),
|
625
|
-
children: (0, _jsxRuntime.jsxs)("span", {
|
636
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
626
637
|
children: ["+ ", rest.length, " ..."]
|
627
638
|
})
|
628
639
|
});
|
629
640
|
}
|
630
641
|
}, treeProps), {}, {
|
631
|
-
children: selectList.map(
|
632
|
-
return _renderTreeNode(node, 1);
|
633
|
-
})
|
642
|
+
children: selectList.map(node => renderTreeNode(node, 1))
|
634
643
|
}))
|
635
644
|
});
|
636
645
|
};
|
646
|
+
exports.ProTreeSelect = ProTreeSelect;
|
637
647
|
var _default = exports.default = /*#__PURE__*/(0, _react.forwardRef)(ProTreeSelect);
|