@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
@@ -8,7 +8,6 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
8
8
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
9
9
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
10
10
|
var _excluded = ["checkedValues", "disabled", "searchStr", "originalTreeData", "showCodeName", "checkStrictly", "flatTreeData", "mode", "fieldNames", "tags", "onCheck", "optionRender", "treeData", "showLine", "switcherIcon", "checkable", "menu", "innerExpandKeys", "selectedKey", "disabledMode", "isRadioSelect"];
|
11
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
12
11
|
/*
|
13
12
|
*@Date: 2023-07-25 13:49:35
|
14
13
|
* @LastEditTime: 2024-05-20 11:47:45
|
@@ -19,9 +18,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
18
|
import React, { useEffect, useState } from 'react';
|
20
19
|
import { useSetState } from 'ahooks';
|
21
20
|
import { CaretDownOutlined } from '@ant-design/icons';
|
22
|
-
import SearchTitle from
|
23
|
-
import { filterCheckedNodes, getParentKey } from
|
24
|
-
import locale from
|
21
|
+
import SearchTitle from "./SearchTitle";
|
22
|
+
import { filterCheckedNodes, getParentKey } from "../utils";
|
23
|
+
import locale from "../../locale";
|
24
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
25
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
25
26
|
var tagsBgColors = ['rgba(0, 106, 255,0.16)', 'rgba(0, 196, 74,0.16)', 'rgba(255, 140, 0,0.16)', 'rgba(255, 80, 80,0.16)', 'rgba(97, 97, 97, 0.16)'];
|
26
27
|
var tagsColors = ['#006AFF', '#00C44A', '#FF8C00', '#FF5050', '#616161'];
|
27
28
|
function List(props) {
|
@@ -45,7 +46,7 @@ function List(props) {
|
|
45
46
|
_props$showLine = props.showLine,
|
46
47
|
showLine = _props$showLine === void 0 ? true : _props$showLine,
|
47
48
|
_props$switcherIcon = props.switcherIcon,
|
48
|
-
switcherIcon = _props$switcherIcon === void 0 ? _jsx(CaretDownOutlined, {}) : _props$switcherIcon,
|
49
|
+
switcherIcon = _props$switcherIcon === void 0 ? /*#__PURE__*/_jsx(CaretDownOutlined, {}) : _props$switcherIcon,
|
49
50
|
_props$checkable = props.checkable,
|
50
51
|
checkable = _props$checkable === void 0 ? false : _props$checkable,
|
51
52
|
menu = props.menu,
|
@@ -69,31 +70,29 @@ function List(props) {
|
|
69
70
|
currentClickTreeNode = _useSetState2$.currentClickTreeNode,
|
70
71
|
handing = _useSetState2$.handing,
|
71
72
|
setState = _useSetState2[1];
|
72
|
-
useEffect(
|
73
|
+
useEffect(() => {
|
73
74
|
if (searchStr) {
|
74
|
-
var newExpandedKeys = flatTreeData.map(
|
75
|
+
var newExpandedKeys = flatTreeData.map(item => {
|
75
76
|
var title = item[fieldNameValue] + item[fieldNameLabel];
|
76
77
|
if ((title === null || title === void 0 ? void 0 : title.indexOf(searchStr)) > -1) {
|
77
78
|
return getParentKey(item[fieldNameValue], originalTreeData, fieldNames);
|
78
79
|
}
|
79
80
|
return null;
|
80
|
-
}).filter(
|
81
|
-
return item && self.indexOf(item) === i;
|
82
|
-
});
|
81
|
+
}).filter((item, i, self) => item && self.indexOf(item) === i);
|
83
82
|
setState({
|
84
83
|
expandedKeys: newExpandedKeys,
|
85
84
|
autoExpandParent: true
|
86
85
|
});
|
87
86
|
}
|
88
87
|
}, [searchStr]);
|
89
|
-
useEffect(
|
88
|
+
useEffect(() => {
|
90
89
|
if (innerExpandKeys) {
|
91
90
|
setState({
|
92
91
|
expandedKeys: innerExpandKeys
|
93
92
|
});
|
94
93
|
}
|
95
94
|
}, [innerExpandKeys]);
|
96
|
-
useEffect(
|
95
|
+
useEffect(() => {
|
97
96
|
if (!checkable) {
|
98
97
|
// 单选树,checkedValues为string,选中那个树节点
|
99
98
|
setState({
|
@@ -101,7 +100,7 @@ function List(props) {
|
|
101
100
|
});
|
102
101
|
}
|
103
102
|
}, [checkedValues]);
|
104
|
-
useEffect(
|
103
|
+
useEffect(() => {
|
105
104
|
// 复选树,配置的selectedKey在这里处理选中,单选树,在ProTree组件里跟value比优先级处理,到这个组件里面是checkedValues了
|
106
105
|
if (checkable) {
|
107
106
|
setState({
|
@@ -110,7 +109,7 @@ function List(props) {
|
|
110
109
|
}
|
111
110
|
}, [selectedKey]);
|
112
111
|
var onSelect = /*#__PURE__*/function () {
|
113
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(value, item) {
|
112
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(value, item) {
|
114
113
|
var _props$onSelect;
|
115
114
|
var val;
|
116
115
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
@@ -132,7 +131,7 @@ function List(props) {
|
|
132
131
|
handing: true
|
133
132
|
});
|
134
133
|
_context.next = 7;
|
135
|
-
return props === null || props === void 0
|
134
|
+
return props === null || props === void 0 || (_props$onSelect = props.onSelect) === null || _props$onSelect === void 0 ? void 0 : _props$onSelect.call(props, val, item);
|
136
135
|
case 7:
|
137
136
|
setState({
|
138
137
|
handing: false
|
@@ -147,7 +146,7 @@ function List(props) {
|
|
147
146
|
return _ref.apply(this, arguments);
|
148
147
|
};
|
149
148
|
}();
|
150
|
-
var TreeNodeRow =
|
149
|
+
var TreeNodeRow = props => {
|
151
150
|
var nodeClass = props.nodeClass,
|
152
151
|
item = props.item,
|
153
152
|
index = props.index,
|
@@ -159,79 +158,79 @@ function List(props) {
|
|
159
158
|
open = _useState2[0],
|
160
159
|
setOpen = _useState2[1];
|
161
160
|
var operateButton = menu && menu(item === null || item === void 0 ? void 0 : item[fieldNameValue], item);
|
162
|
-
operateButton === null || operateButton === void 0
|
163
|
-
return _jsx(React.Fragment, {
|
161
|
+
operateButton === null || operateButton === void 0 || operateButton.map((item, i) => {
|
162
|
+
return /*#__PURE__*/_jsx(React.Fragment, {
|
164
163
|
children: item
|
165
164
|
}, i);
|
166
165
|
});
|
167
|
-
var hide =
|
166
|
+
var hide = () => {
|
168
167
|
setOpen(false);
|
169
168
|
};
|
170
|
-
var handleOpenChange =
|
169
|
+
var handleOpenChange = newOpen => {
|
171
170
|
setOpen(newOpen);
|
172
171
|
};
|
173
|
-
var expandIcon = _jsx("span", {
|
172
|
+
var expandIcon = /*#__PURE__*/_jsx("span", {
|
174
173
|
className: "icon-item",
|
175
|
-
children: _jsx("svg", {
|
174
|
+
children: /*#__PURE__*/_jsx("svg", {
|
176
175
|
width: "1em",
|
177
176
|
height: "1em",
|
178
177
|
viewBox: "0 0 16 16",
|
179
178
|
version: "1.1",
|
180
179
|
className: "icon-item svg-icon-expand",
|
181
|
-
children: _jsx("g", {
|
180
|
+
children: /*#__PURE__*/_jsx("g", {
|
182
181
|
id: "\u6811\u7ED3\u6784",
|
183
182
|
stroke: "none",
|
184
183
|
strokeWidth: "1",
|
185
184
|
fill: "none",
|
186
185
|
fillRule: "evenodd",
|
187
|
-
children: _jsx("g", {
|
186
|
+
children: /*#__PURE__*/_jsx("g", {
|
188
187
|
id: "\u6811\u7ED3\u6784\u4EA4\u4E92",
|
189
188
|
transform: "translate(-2285.000000, -2413.000000)",
|
190
189
|
fill: "currentColor",
|
191
|
-
children: _jsx("g", {
|
190
|
+
children: /*#__PURE__*/_jsx("g", {
|
192
191
|
id: "\u6570\u636E\u5C55\u793A/\u6811\u5F62\u63A7\u4EF6/\u5E26\u8FDE\u63A5\u7EBF\u5907\u4EFD-3",
|
193
192
|
transform: "translate(2065.000000, 2411.000000)",
|
194
|
-
children: _jsxs("g", {
|
193
|
+
children: /*#__PURE__*/_jsxs("g", {
|
195
194
|
id: "\u7F16\u7EC4-4",
|
196
195
|
transform: "translate(220.000000, 2.000000)",
|
197
|
-
children: [_jsxs("g", {
|
196
|
+
children: [/*#__PURE__*/_jsxs("g", {
|
198
197
|
id: "icon_more\u5907\u4EFD-9",
|
199
198
|
transform: "translate(7.000000, 3.000000)",
|
200
|
-
children: [_jsx("rect", {
|
199
|
+
children: [/*#__PURE__*/_jsx("rect", {
|
201
200
|
id: "\u77E9\u5F62",
|
202
201
|
x: "0",
|
203
202
|
y: "0",
|
204
203
|
width: "2",
|
205
204
|
height: "2"
|
206
|
-
}), _jsx("rect", {
|
205
|
+
}), /*#__PURE__*/_jsx("rect", {
|
207
206
|
id: "\u77E9\u5F62\u5907\u4EFD-3",
|
208
207
|
x: "0",
|
209
208
|
y: "4",
|
210
209
|
width: "2",
|
211
210
|
height: "2"
|
212
|
-
}), _jsx("rect", {
|
211
|
+
}), /*#__PURE__*/_jsx("rect", {
|
213
212
|
id: "\u77E9\u5F62\u5907\u4EFD-4",
|
214
213
|
x: "0",
|
215
214
|
y: "8",
|
216
215
|
width: "2",
|
217
216
|
height: "2"
|
218
217
|
})]
|
219
|
-
}), _jsxs("g", {
|
218
|
+
}), /*#__PURE__*/_jsxs("g", {
|
220
219
|
id: "icon_more\u5907\u4EFD-9",
|
221
220
|
transform: "translate(7.000000, 3.000000)",
|
222
|
-
children: [_jsx("rect", {
|
221
|
+
children: [/*#__PURE__*/_jsx("rect", {
|
223
222
|
id: "\u77E9\u5F62",
|
224
223
|
x: "0",
|
225
224
|
y: "0",
|
226
225
|
width: "2",
|
227
226
|
height: "2"
|
228
|
-
}), _jsx("rect", {
|
227
|
+
}), /*#__PURE__*/_jsx("rect", {
|
229
228
|
id: "\u77E9\u5F62\u5907\u4EFD-3",
|
230
229
|
x: "0",
|
231
230
|
y: "4",
|
232
231
|
width: "2",
|
233
232
|
height: "2"
|
234
|
-
}), _jsx("rect", {
|
233
|
+
}), /*#__PURE__*/_jsx("rect", {
|
235
234
|
id: "\u77E9\u5F62\u5907\u4EFD-4",
|
236
235
|
x: "0",
|
237
236
|
y: "8",
|
@@ -245,42 +244,42 @@ function List(props) {
|
|
245
244
|
})
|
246
245
|
})
|
247
246
|
});
|
248
|
-
return _jsxs("div", {
|
247
|
+
return /*#__PURE__*/_jsxs("div", {
|
249
248
|
className: nodeClass,
|
250
|
-
onClick:
|
249
|
+
onClick: e => {
|
251
250
|
e.stopPropagation();
|
252
251
|
onSelect(item === null || item === void 0 ? void 0 : item[fieldNameValue], {
|
253
252
|
node: e === null || e === void 0 ? void 0 : e.target,
|
254
253
|
event: e,
|
255
|
-
item
|
254
|
+
item,
|
256
255
|
selected: !isChecked
|
257
256
|
});
|
258
257
|
},
|
259
|
-
children: [tags && tags.length ? _jsx("div", {
|
258
|
+
children: [tags && tags.length ? /*#__PURE__*/_jsx("div", {
|
260
259
|
className: "pro-tree-tree-node-tag",
|
261
260
|
style: {
|
262
261
|
backgroundColor: tagsBgColors[index],
|
263
262
|
color: tagsColors[index]
|
264
263
|
},
|
265
|
-
children: _jsx("span", {
|
264
|
+
children: /*#__PURE__*/_jsx("span", {
|
266
265
|
children: tags[index]
|
267
266
|
})
|
268
|
-
}) : null, _jsxs("div", {
|
267
|
+
}) : null, /*#__PURE__*/_jsxs("div", {
|
269
268
|
className: "tree-node-show-text",
|
270
|
-
children: [_jsx("div", {
|
269
|
+
children: [/*#__PURE__*/_jsx("div", {
|
271
270
|
className: "tree-node-show-text-label",
|
272
|
-
children: optionRender ? optionRender(item, searchStr) : _jsx(SearchTitle, _objectSpread({
|
271
|
+
children: optionRender ? optionRender(item, searchStr) : /*#__PURE__*/_jsx(SearchTitle, _objectSpread({
|
273
272
|
label: title,
|
274
273
|
searchStr: searchStr
|
275
274
|
}, other))
|
276
|
-
}), _jsx("div", {
|
275
|
+
}), /*#__PURE__*/_jsx("div", {
|
277
276
|
className: "operate-tree-node-btns",
|
278
|
-
onClick:
|
277
|
+
onClick: e => {
|
279
278
|
e.stopPropagation();
|
280
279
|
},
|
281
|
-
children: (operateButton === null || operateButton === void 0 ? void 0 : operateButton.length) > 1 ? _jsx(_Popover, {
|
280
|
+
children: (operateButton === null || operateButton === void 0 ? void 0 : operateButton.length) > 1 ? /*#__PURE__*/_jsx(_Popover, {
|
282
281
|
overlayClassName: "pro-tree-operate-container",
|
283
|
-
content: _jsx("div", {
|
282
|
+
content: /*#__PURE__*/_jsx("div", {
|
284
283
|
className: "pro-tree-operate-btn-popover",
|
285
284
|
onClick: hide,
|
286
285
|
children: operateButton
|
@@ -292,23 +291,23 @@ function List(props) {
|
|
292
291
|
children: expandIcon
|
293
292
|
}) : operateButton
|
294
293
|
})]
|
295
|
-
}), _jsx("div", {
|
294
|
+
}), /*#__PURE__*/_jsx("div", {
|
296
295
|
className: "brand-bg-opa-ten"
|
297
296
|
})]
|
298
297
|
}, onlyKey);
|
299
298
|
};
|
300
299
|
function fn() {
|
301
|
-
var
|
300
|
+
var loop = (data, index) => {
|
302
301
|
index++;
|
303
|
-
var treeRow = data.map(
|
302
|
+
var treeRow = data.map(item => {
|
304
303
|
var nodeClass = 'pro-tree-tree-node ';
|
305
304
|
var isChecked = false;
|
306
305
|
if (currentClickTreeNode === item[fieldNameValue]) {
|
307
306
|
nodeClass += ' checked';
|
308
307
|
isChecked = true;
|
309
308
|
}
|
310
|
-
var title = showCodeName ?
|
311
|
-
var nodeTitle = _jsx(TreeNodeRow, {
|
309
|
+
var title = showCodeName ? `${item[fieldNameValue]}-${item[fieldNameLabel]}` : item[fieldNameLabel];
|
310
|
+
var nodeTitle = /*#__PURE__*/_jsx(TreeNodeRow, {
|
312
311
|
nodeClass: nodeClass,
|
313
312
|
item: item,
|
314
313
|
index: index,
|
@@ -320,7 +319,7 @@ function List(props) {
|
|
320
319
|
return _objectSpread(_objectSpread({}, item), {}, {
|
321
320
|
title: nodeTitle,
|
322
321
|
key: (item === null || item === void 0 ? void 0 : item.key) || item[fieldNameValue],
|
323
|
-
children:
|
322
|
+
children: loop(item[fieldNames.children], index)
|
324
323
|
});
|
325
324
|
}
|
326
325
|
return _objectSpread(_objectSpread({}, item), {}, {
|
@@ -337,10 +336,10 @@ function List(props) {
|
|
337
336
|
if (searchStr) {
|
338
337
|
newTreeData = filterCheckedNodes(originalTreeData, [], searchStr, fieldNames);
|
339
338
|
}
|
340
|
-
return
|
339
|
+
return loop(newTreeData, -1);
|
341
340
|
}
|
342
341
|
var _treeData = fn();
|
343
|
-
var onExpand =
|
342
|
+
var onExpand = (newExpandedKeys, nextPara) => {
|
344
343
|
setState({
|
345
344
|
expandedKeys: newExpandedKeys,
|
346
345
|
autoExpandParent: false
|
@@ -354,9 +353,9 @@ function List(props) {
|
|
354
353
|
if (expandedKeys) {
|
355
354
|
additionProps.expandedKeys = expandedKeys;
|
356
355
|
}
|
357
|
-
return _jsx("div", {
|
356
|
+
return /*#__PURE__*/_jsx("div", {
|
358
357
|
className: disabledMode === 'hide' ? 'hide-disable-node' : '',
|
359
|
-
children:
|
358
|
+
children: _treeData !== null && _treeData !== void 0 && _treeData.length ? /*#__PURE__*/_jsx(_Tree, _objectSpread(_objectSpread(_objectSpread({}, others), additionProps), {}, {
|
360
359
|
disabled: disabled,
|
361
360
|
style: {
|
362
361
|
width: '100%'
|
@@ -373,9 +372,9 @@ function List(props) {
|
|
373
372
|
checkable: checkable,
|
374
373
|
onSelect: onSelect,
|
375
374
|
blockNode: true
|
376
|
-
})) : _jsx("div", {
|
375
|
+
})) : /*#__PURE__*/_jsx("div", {
|
377
376
|
className: "empty-tree",
|
378
|
-
children: locale === null || locale === void 0
|
377
|
+
children: locale === null || locale === void 0 || (_locale$ProTree = locale.ProTree) === null || _locale$ProTree === void 0 ? void 0 : _locale$ProTree.emptyTips
|
379
378
|
})
|
380
379
|
});
|
381
380
|
}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
export { default as CloseIcon } from
|
1
|
+
export { default as CloseIcon } from "./CloseIcon";
|
2
2
|
// export { default as Trigger } from './Trigger';
|
3
|
-
export { default as SearchTitle } from
|
4
|
-
export { default as ListView } from
|
5
|
-
export { default as TreeView } from
|
3
|
+
export { default as SearchTitle } from "./SearchTitle";
|
4
|
+
export { default as ListView } from "./List";
|
5
|
+
export { default as TreeView } from "./Tree";
|
package/es/ProTree/index.js
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
3
2
|
/* eslint-disable jsx-a11y/anchor-is-valid */
|
4
3
|
/*
|
5
4
|
*@Date: 2023-07-11 16:07:12
|
@@ -7,9 +6,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
6
|
*@Author: liudongliang
|
8
7
|
*@Description: ProTree组件,集成了tree和treeSelect
|
9
8
|
*/
|
10
|
-
import ProTree from
|
11
|
-
import ProTreeSelect from
|
12
|
-
|
9
|
+
import ProTree from "./components/ProTree";
|
10
|
+
import ProTreeSelect from "./components/ProTreeSelect";
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
12
|
+
var ProTreeHandle = props => {
|
13
13
|
var _props$mode = props.mode,
|
14
14
|
mode = _props$mode === void 0 ? 'tree' : _props$mode;
|
15
15
|
if (mode === 'treeSelect') {
|
@@ -17,9 +17,9 @@ var ProTreeHandle = function ProTreeHandle(props) {
|
|
17
17
|
treeCheckable: props === null || props === void 0 ? void 0 : props.checkable,
|
18
18
|
treeCheckStrictly: props === null || props === void 0 ? void 0 : props.checkStrictly
|
19
19
|
});
|
20
|
-
return _jsx(ProTreeSelect, _objectSpread({}, adaptorProps));
|
20
|
+
return /*#__PURE__*/_jsx(ProTreeSelect, _objectSpread({}, adaptorProps));
|
21
21
|
}
|
22
|
-
return _jsx(ProTree, _objectSpread(_objectSpread({}, props), {}, {
|
22
|
+
return /*#__PURE__*/_jsx(ProTree, _objectSpread(_objectSpread({}, props), {}, {
|
23
23
|
checkedValues: props === null || props === void 0 ? void 0 : props.checkedKeys
|
24
24
|
}));
|
25
25
|
};
|
package/es/ProTree/utils.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
2
1
|
import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
|
3
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
4
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
3
|
+
/* eslint-disable no-restricted-syntax */
|
4
|
+
|
5
5
|
/**
|
6
6
|
* 树转成铺平的数组
|
7
7
|
* @param originalTreeData
|
@@ -23,6 +23,7 @@ export function getFlatTreeData(originalTreeData, fieldNames) {
|
|
23
23
|
loop(originalTreeData);
|
24
24
|
return dataList;
|
25
25
|
}
|
26
|
+
|
26
27
|
/**
|
27
28
|
* 获取 tree 所有的 keys 集合
|
28
29
|
* @param data
|
@@ -43,6 +44,7 @@ export function getAllKeys(data, fieldNames) {
|
|
43
44
|
loop(data);
|
44
45
|
return keys;
|
45
46
|
}
|
47
|
+
|
46
48
|
/**
|
47
49
|
* 获取展开的key
|
48
50
|
* @param key
|
@@ -50,28 +52,25 @@ export function getAllKeys(data, fieldNames) {
|
|
50
52
|
* @param fieldNames
|
51
53
|
* @returns
|
52
54
|
*/
|
53
|
-
var
|
55
|
+
export var getParentKey = (key, tree, fieldNames) => {
|
54
56
|
var parentKey;
|
55
57
|
for (var i = 0; i < tree.length; i++) {
|
56
58
|
var node = tree[i];
|
57
59
|
if (node[fieldNames.children]) {
|
58
|
-
if (node[fieldNames.children].some(
|
59
|
-
return item[fieldNames.value] === key;
|
60
|
-
})) {
|
60
|
+
if (node[fieldNames.children].some(item => item[fieldNames.value] === key)) {
|
61
61
|
parentKey = node[fieldNames.value];
|
62
|
-
} else if (
|
63
|
-
parentKey =
|
62
|
+
} else if (getParentKey(key, node[fieldNames.children], fieldNames)) {
|
63
|
+
parentKey = getParentKey(key, node[fieldNames.children], fieldNames);
|
64
64
|
}
|
65
65
|
}
|
66
66
|
}
|
67
67
|
return parentKey;
|
68
68
|
};
|
69
|
-
export { _getParentKey as getParentKey };
|
70
69
|
export function findTreeNodeByKey(treeData, key, fieldNames) {
|
71
70
|
var result = [];
|
72
|
-
var
|
71
|
+
var traverse = (node, parents) => {
|
73
72
|
if (node[fieldNames.value] === key) {
|
74
|
-
result.push
|
73
|
+
result.push(node, ...parents);
|
75
74
|
return true;
|
76
75
|
}
|
77
76
|
var children = node[fieldNames.children] || [];
|
@@ -80,7 +79,7 @@ export function findTreeNodeByKey(treeData, key, fieldNames) {
|
|
80
79
|
try {
|
81
80
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
82
81
|
var child = _step.value;
|
83
|
-
if (
|
82
|
+
if (traverse(child, [node, ...parents])) {
|
84
83
|
return true;
|
85
84
|
}
|
86
85
|
}
|
@@ -96,7 +95,7 @@ export function findTreeNodeByKey(treeData, key, fieldNames) {
|
|
96
95
|
try {
|
97
96
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
98
97
|
var node = _step2.value;
|
99
|
-
|
98
|
+
traverse(node, []);
|
100
99
|
}
|
101
100
|
} catch (err) {
|
102
101
|
_iterator2.e(err);
|
@@ -105,6 +104,7 @@ export function findTreeNodeByKey(treeData, key, fieldNames) {
|
|
105
104
|
}
|
106
105
|
return result;
|
107
106
|
}
|
107
|
+
|
108
108
|
/**
|
109
109
|
* 过滤掉每一层假值(例如 false、null、0、""、undefined 等)
|
110
110
|
* @param data
|
@@ -115,35 +115,40 @@ export function filterCheckedNodes(data, checkedKeys) {
|
|
115
115
|
var searchStr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
116
116
|
var fieldNames = arguments.length > 3 ? arguments[3] : undefined;
|
117
117
|
var result = [];
|
118
|
-
var
|
118
|
+
var traverse = node => {
|
119
119
|
var _node$fieldNames$chil3;
|
120
120
|
var title = node[fieldNames.value] + node[fieldNames.label];
|
121
121
|
if (!searchStr) {
|
122
122
|
if (checkedKeys.includes(node[fieldNames.value])) {
|
123
123
|
var _node$fieldNames$chil;
|
124
|
-
var _children = (node === null || node === void 0
|
125
|
-
return _objectSpread(_objectSpread({}, node), {},
|
124
|
+
var _children = (node === null || node === void 0 || (_node$fieldNames$chil = node[fieldNames.children]) === null || _node$fieldNames$chil === void 0 ? void 0 : _node$fieldNames$chil.map(traverse).filter(Boolean)) || [];
|
125
|
+
return _objectSpread(_objectSpread({}, node), {}, {
|
126
|
+
[fieldNames.children]: _children
|
127
|
+
});
|
126
128
|
}
|
127
129
|
} else if ((title === null || title === void 0 ? void 0 : title.indexOf(searchStr)) > -1) {
|
128
130
|
var _node$fieldNames$chil2;
|
129
|
-
var _children2 = ((_node$fieldNames$chil2 = node[fieldNames.children]) === null || _node$fieldNames$chil2 === void 0 ? void 0 : _node$fieldNames$chil2.map(
|
131
|
+
var _children2 = ((_node$fieldNames$chil2 = node[fieldNames.children]) === null || _node$fieldNames$chil2 === void 0 ? void 0 : _node$fieldNames$chil2.map(traverse).filter(Boolean)) || [];
|
130
132
|
return _objectSpread(_objectSpread({}, node), {}, {
|
131
133
|
children: _children2
|
132
134
|
});
|
133
135
|
}
|
134
|
-
var children = (_node$fieldNames$chil3 = node[fieldNames.children]) === null || _node$fieldNames$chil3 === void 0 ? void 0 : _node$fieldNames$chil3.map(
|
136
|
+
var children = (_node$fieldNames$chil3 = node[fieldNames.children]) === null || _node$fieldNames$chil3 === void 0 ? void 0 : _node$fieldNames$chil3.map(traverse).filter(Boolean);
|
135
137
|
if (children && children.length > 0) {
|
136
|
-
return _objectSpread(_objectSpread({}, node), {},
|
138
|
+
return _objectSpread(_objectSpread({}, node), {}, {
|
139
|
+
[fieldNames.children]: children
|
140
|
+
});
|
137
141
|
}
|
138
142
|
return null;
|
139
143
|
};
|
144
|
+
|
140
145
|
// eslint-disable-next-line no-restricted-syntax
|
141
146
|
var _iterator3 = _createForOfIteratorHelper(data),
|
142
147
|
_step3;
|
143
148
|
try {
|
144
149
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
145
150
|
var node = _step3.value;
|
146
|
-
var filtered =
|
151
|
+
var filtered = traverse(node);
|
147
152
|
if (filtered) {
|
148
153
|
result.push(filtered);
|
149
154
|
}
|
@@ -155,6 +160,7 @@ export function filterCheckedNodes(data, checkedKeys) {
|
|
155
160
|
}
|
156
161
|
return result;
|
157
162
|
}
|
163
|
+
|
158
164
|
/**
|
159
165
|
* 获取 tree 当前选中节点下的所有子节点的 keys
|
160
166
|
* @param node
|
@@ -165,7 +171,7 @@ export function getChildrenKeys(node, childrenKeys, fieldNames, type) {
|
|
165
171
|
// 当为 tree 触发 onChck 此时就是 key 为 children
|
166
172
|
if (type === 'treeCheck') {
|
167
173
|
var _node$children;
|
168
|
-
node === null || node === void 0
|
174
|
+
node === null || node === void 0 || (_node$children = node.children) === null || _node$children === void 0 || _node$children.forEach(item => {
|
169
175
|
childrenKeys.push(item.key);
|
170
176
|
if (item.children && item.children.length > 0) {
|
171
177
|
getChildrenKeys(item, childrenKeys, fieldNames, type);
|
@@ -174,7 +180,7 @@ export function getChildrenKeys(node, childrenKeys, fieldNames, type) {
|
|
174
180
|
} else {
|
175
181
|
var _node$fieldNames$chil4;
|
176
182
|
// 这个时候的值为我们的值
|
177
|
-
node === null || node === void 0
|
183
|
+
node === null || node === void 0 || (_node$fieldNames$chil4 = node[fieldNames.children]) === null || _node$fieldNames$chil4 === void 0 || _node$fieldNames$chil4.forEach(item => {
|
178
184
|
childrenKeys.push(item[fieldNames.value]);
|
179
185
|
if (item[fieldNames.children] && item[fieldNames.children].length > 0) {
|
180
186
|
getChildrenKeys(item, childrenKeys, fieldNames, type);
|
@@ -182,6 +188,7 @@ export function getChildrenKeys(node, childrenKeys, fieldNames, type) {
|
|
182
188
|
});
|
183
189
|
}
|
184
190
|
}
|
191
|
+
|
185
192
|
/**
|
186
193
|
* 如果默认全开展那么返回所有key,否则返回空[]
|
187
194
|
* @param isExpand 是否全展开
|
@@ -2,12 +2,14 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import "antd/es/checkbox/style";
|
3
3
|
import _Checkbox from "antd/es/checkbox";
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
5
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
6
5
|
import { useEffect } from 'react';
|
7
6
|
import { useSetState } from 'ahooks';
|
8
7
|
import classNames from 'classnames';
|
9
|
-
import SearchTitle from
|
10
|
-
|
8
|
+
import SearchTitle from "./SearchTitle";
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
11
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
12
|
+
var Cascader = props => {
|
11
13
|
var _dataSource$, _dataSource$2, _state$options;
|
12
14
|
var dataSource = props.dataSource,
|
13
15
|
checkedValues = props.checkedValues,
|
@@ -21,69 +23,65 @@ var Cascader = function Cascader(props) {
|
|
21
23
|
var fieldNameValue = fieldNames.value;
|
22
24
|
var fieldNameChildren = (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children';
|
23
25
|
var _useSetState = useSetState({
|
24
|
-
category: dataSource === null || dataSource === void 0
|
25
|
-
options: dataSource === null || dataSource === void 0
|
26
|
+
category: dataSource === null || dataSource === void 0 || (_dataSource$ = dataSource[0]) === null || _dataSource$ === void 0 ? void 0 : _dataSource$[fieldNameValue],
|
27
|
+
options: dataSource === null || dataSource === void 0 || (_dataSource$2 = dataSource[0]) === null || _dataSource$2 === void 0 ? void 0 : _dataSource$2[fieldNameChildren]
|
26
28
|
}),
|
27
29
|
_useSetState2 = _slicedToArray(_useSetState, 2),
|
28
30
|
state = _useSetState2[0],
|
29
31
|
setState = _useSetState2[1];
|
30
|
-
useEffect(
|
31
|
-
if (!state.category &&
|
32
|
+
useEffect(() => {
|
33
|
+
if (!state.category && dataSource !== null && dataSource !== void 0 && dataSource.length) {
|
32
34
|
var _dataSource$3, _dataSource$4;
|
33
35
|
setState({
|
34
|
-
category: dataSource === null || dataSource === void 0
|
35
|
-
options: dataSource === null || dataSource === void 0
|
36
|
+
category: dataSource === null || dataSource === void 0 || (_dataSource$3 = dataSource[0]) === null || _dataSource$3 === void 0 ? void 0 : _dataSource$3[fieldNameValue],
|
37
|
+
options: dataSource === null || dataSource === void 0 || (_dataSource$4 = dataSource[0]) === null || _dataSource$4 === void 0 ? void 0 : _dataSource$4[fieldNameChildren]
|
36
38
|
});
|
37
39
|
}
|
38
40
|
}, [dataSource]);
|
39
|
-
var handleClick =
|
41
|
+
var handleClick = item => {
|
40
42
|
setState({
|
41
43
|
category: item[fieldNameValue],
|
42
44
|
options: item[fieldNameChildren]
|
43
45
|
});
|
44
46
|
};
|
45
|
-
return _jsx(_Fragment, {
|
46
|
-
children: _jsxs("div", {
|
47
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
48
|
+
children: /*#__PURE__*/_jsxs("div", {
|
47
49
|
className: "pro-tree-modal-cascader-flex",
|
48
|
-
children: [_jsx("div", {
|
50
|
+
children: [/*#__PURE__*/_jsx("div", {
|
49
51
|
className: "pro-tree-modal-cascader-warp",
|
50
|
-
children: dataSource.map(
|
51
|
-
var title = showCodeName ?
|
52
|
-
return _jsx("div", {
|
53
|
-
onClick:
|
54
|
-
return handleClick(item);
|
55
|
-
},
|
52
|
+
children: dataSource.map(item => {
|
53
|
+
var title = showCodeName ? `${item[fieldNameValue]}-${item[fieldNameLabel]}` : item[fieldNameLabel];
|
54
|
+
return /*#__PURE__*/_jsx("div", {
|
55
|
+
onClick: () => handleClick(item),
|
56
56
|
className: classNames('pro-tree-modal-checkbox-content', 'pro-tree-modal-cascader-content', item[fieldNameValue] === state.category ? 'pro-tree-modal-check-cascader-content' : ''),
|
57
|
-
children: optionRender ? optionRender(item, searchStr) : _jsx(SearchTitle, {
|
57
|
+
children: optionRender ? optionRender(item, searchStr) : /*#__PURE__*/_jsx(SearchTitle, {
|
58
58
|
label: title,
|
59
59
|
searchStr: searchStr
|
60
60
|
})
|
61
61
|
}, item[fieldNameValue]);
|
62
62
|
})
|
63
|
-
}), _jsx("div", {
|
63
|
+
}), /*#__PURE__*/_jsx("div", {
|
64
64
|
className: "pro-tree-modal-cascader-warp",
|
65
|
-
children: _jsx(_Checkbox.Group, {
|
65
|
+
children: /*#__PURE__*/_jsx(_Checkbox.Group, {
|
66
66
|
disabled: disabled,
|
67
67
|
style: {
|
68
68
|
width: '100%'
|
69
69
|
},
|
70
70
|
value: checkedValues,
|
71
|
-
children: state === null || state === void 0
|
72
|
-
var title = showCodeName ?
|
73
|
-
return _jsx("div", {
|
71
|
+
children: state === null || state === void 0 || (_state$options = state.options) === null || _state$options === void 0 ? void 0 : _state$options.map(item => {
|
72
|
+
var title = showCodeName ? `${item[fieldNameValue]}-${item[fieldNameLabel]}` : item[fieldNameLabel];
|
73
|
+
return /*#__PURE__*/_jsx("div", {
|
74
74
|
className: "pro-tree-modal-checkbox-content pro-tree-modal-cascader-content",
|
75
|
-
children: item.checkable ? _jsx("span", {
|
76
|
-
children: optionRender ? optionRender(item, searchStr) : _jsx(SearchTitle, {
|
75
|
+
children: item.checkable ? /*#__PURE__*/_jsx("span", {
|
76
|
+
children: optionRender ? optionRender(item, searchStr) : /*#__PURE__*/_jsx(SearchTitle, {
|
77
77
|
label: title,
|
78
78
|
searchStr: searchStr
|
79
79
|
})
|
80
|
-
}) : _jsx(_Checkbox, _objectSpread(_objectSpread({}, item), {}, {
|
81
|
-
onChange:
|
82
|
-
return handleOnChange(e, item[fieldNameValue]);
|
83
|
-
},
|
80
|
+
}) : /*#__PURE__*/_jsx(_Checkbox, _objectSpread(_objectSpread({}, item), {}, {
|
81
|
+
onChange: e => handleOnChange(e, item[fieldNameValue]),
|
84
82
|
value: item[fieldNameValue],
|
85
|
-
children: _jsx("span", {
|
86
|
-
children: optionRender ? optionRender(item, searchStr) : _jsx(SearchTitle, {
|
83
|
+
children: /*#__PURE__*/_jsx("span", {
|
84
|
+
children: optionRender ? optionRender(item, searchStr) : /*#__PURE__*/_jsx(SearchTitle, {
|
87
85
|
label: title,
|
88
86
|
searchStr: searchStr
|
89
87
|
})
|