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