@zat-design/sisyphus-react 4.0.0-beta.3 → 4.0.0-beta.5
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/babel.config.js +7 -30
- package/dist/index.esm.css +1 -6445
- package/dist/index.min.js +1 -0
- package/dist/less.esm.css +1 -5871
- package/dist/less.min.js +1 -0
- package/es/FormsProvider/index.js +5 -5
- package/es/ProAction/components/CheckModalContent/index.js +5 -7
- package/es/ProAction/index.js +16 -16
- package/es/ProAction/index.less +0 -2
- package/es/ProConfigProvider/index.d.ts +1 -0
- package/es/ProConfigProvider/index.js +34 -21
- package/es/ProDownload/index.js +13 -12
- package/es/ProDownload/style/index.less +0 -2
- package/es/ProDownload/utils.js +15 -15
- package/es/ProDrawerForm/components/ProDrawer/index.js +22 -19
- package/es/ProDrawerForm/components/ProModal/index.js +14 -9
- package/es/ProDrawerForm/index.js +39 -39
- package/es/ProDrawerForm/style/index.less +0 -2
- package/es/ProDrawerForm/utils/index.js +1 -1
- package/es/ProEditLabel/components/RenderProForm.js +10 -9
- package/es/ProEditLabel/index.js +36 -24
- package/es/ProEditLabel/style/index.less +0 -2
- package/es/ProEditLabel/utils/index.js +4 -3
- package/es/ProEditTable/components/ActionButton/index.js +58 -56
- package/es/ProEditTable/components/RcTable/BaseTable.js +21 -20
- package/es/ProEditTable/components/RcTable/DraggableTable.js +27 -34
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +49 -43
- package/es/ProEditTable/components/RenderField/index.js +98 -121
- package/es/ProEditTable/components/RenderToolbar/index.js +27 -33
- package/es/ProEditTable/components/Summary/index.js +16 -14
- package/es/ProEditTable/components/Validator/index.js +9 -6
- package/es/ProEditTable/index.js +130 -147
- package/es/ProEditTable/propsType.d.ts +1 -1
- package/es/ProEditTable/style/index.less +2 -4
- package/es/ProEditTable/utils/config.js +29 -36
- package/es/ProEditTable/utils/diffOriginal.d.ts +1 -0
- package/es/ProEditTable/utils/diffOriginal.js +76 -9
- package/es/ProEditTable/utils/getDefaultProps.js +6 -7
- package/es/ProEditTable/utils/index.js +52 -58
- package/es/ProEditTable/utils/tools.js +32 -41
- package/es/ProEditTable/utils/transform.js +7 -11
- package/es/ProEditTable/utils/useEditTableError.js +10 -12
- package/es/ProEnum/components/Group.js +18 -22
- package/es/ProEnum/components/Tag.js +10 -14
- package/es/ProEnum/hooks/useEnum.js +11 -10
- package/es/ProEnum/hooks/useEnumRequest.js +23 -25
- package/es/ProEnum/hooks/useFrequentEnumRequest.d.ts +14 -0
- package/es/ProEnum/hooks/useFrequentEnumRequest.js +76 -0
- package/es/ProEnum/index.js +50 -52
- package/es/ProEnum/propsType.d.ts +29 -0
- package/es/ProEnum/style/index.less +0 -2
- package/es/ProEnum/utils/eventCenter.js +20 -31
- package/es/ProEnum/utils/frequentEnum.d.ts +40 -0
- package/es/ProEnum/utils/frequentEnum.js +91 -0
- package/es/ProEnum/utils/getEnumLabel.js +8 -12
- package/es/ProEnum/utils/index.js +6 -6
- package/es/ProForm/components/Container.js +4 -3
- package/es/ProForm/components/FormFooter/index.js +19 -16
- package/es/ProForm/components/base/Checkbox/index.js +10 -11
- package/es/ProForm/components/base/DatePicker/index.js +25 -39
- package/es/ProForm/components/base/DatePicker/useDateLimit.js +2 -4
- package/es/ProForm/components/base/Input/index.js +24 -20
- package/es/ProForm/components/base/InputNumber/index.js +21 -18
- package/es/ProForm/components/base/Radio/index.js +11 -12
- package/es/ProForm/components/base/RangePicker/index.js +9 -12
- package/es/ProForm/components/base/RangePicker/useDateRange.js +3 -3
- package/es/ProForm/components/base/Select/index.js +9 -8
- package/es/ProForm/components/base/Switch/index.js +7 -6
- package/es/ProForm/components/base/SwitchCheckbox/index.js +7 -6
- package/es/ProForm/components/base/SwitchCheckbox/style/index.less +0 -2
- package/es/ProForm/components/base/TextArea/index.js +9 -8
- package/es/ProForm/components/base/TextArea/index.less +0 -2
- package/es/ProForm/components/base/TimePicker/index.js +5 -4
- package/es/ProForm/components/base/TimePicker/style/index.less +0 -2
- package/es/ProForm/components/combination/Container/index.js +12 -12
- package/es/ProForm/components/combination/Container/style/index.less +0 -2
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +60 -70
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +11 -7
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/es/ProForm/components/combination/FormList/components/Empty.js +9 -10
- package/es/ProForm/components/combination/FormList/components/LineFields.js +10 -9
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +32 -36
- package/es/ProForm/components/combination/FormList/index.js +25 -33
- package/es/ProForm/components/combination/FormList/style/index.less +0 -2
- package/es/ProForm/components/combination/FormList/utils.js +5 -7
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.js +1 -1
- package/es/ProForm/components/combination/Group/component/ComRender.js +22 -21
- package/es/ProForm/components/combination/Group/hooks/index.d.ts +0 -1
- package/es/ProForm/components/combination/Group/hooks/index.js +47 -39
- package/es/ProForm/components/combination/Group/index.d.ts +8 -2
- package/es/ProForm/components/combination/Group/index.js +42 -42
- package/es/ProForm/components/combination/Group/propsType.d.ts +2 -0
- package/es/ProForm/components/combination/Group/style/index.less +7 -0
- package/es/ProForm/components/combination/Group/utils.d.ts +0 -1
- package/es/ProForm/components/combination/Group/utils.js +38 -39
- package/es/ProForm/components/combination/ProCascader/index.js +139 -94
- package/es/ProForm/components/combination/ProCascader/propsType.d.ts +12 -4
- package/es/ProForm/components/combination/ProCascader/style/index.less +1 -3
- package/es/ProForm/components/combination/ProCascader/utils/index.js +3 -3
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +18 -20
- package/es/ProForm/components/combination/ProModalSelect/index.js +136 -168
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +7 -3
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +1 -4
- package/es/ProForm/components/combination/ProModalSelect/utils/index.js +1 -1
- package/es/ProForm/components/combination/ProNumberRange/index.js +73 -47
- package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +3 -2
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +4 -3
- package/es/ProForm/components/combination/ProRangeLimit/index.js +20 -18
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +3 -3
- package/es/ProForm/components/combination/ProTimeLimit/index.js +17 -15
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +0 -2
- package/es/ProForm/components/render/ChangedWrapper.js +25 -27
- package/es/ProForm/components/render/ConfirmWrapper.js +10 -11
- package/es/ProForm/components/render/Render.js +118 -101
- package/es/ProForm/components/render/RenderFields.d.ts +1 -1
- package/es/ProForm/components/render/RenderFields.js +25 -25
- package/es/ProForm/components/render/propsType.d.ts +1 -0
- package/es/ProForm/index.d.ts +2 -2
- package/es/ProForm/index.js +47 -45
- package/es/ProForm/propsType.d.ts +3 -4
- package/es/ProForm/style/index.less +0 -2
- package/es/ProForm/utils/diffOriginal.d.ts +1 -0
- package/es/ProForm/utils/diffOriginal.js +70 -5
- package/es/ProForm/utils/getDefaultProps.js +5 -5
- package/es/ProForm/utils/index.js +63 -91
- package/es/ProForm/utils/processDependencies.js +4 -5
- package/es/ProForm/utils/rulesCreator.js +12 -12
- package/es/ProForm/utils/transformNames.js +2 -2
- package/es/ProForm/utils/transformValue.js +6 -8
- package/es/ProForm/utils/useDeepCompareMemo.js +1 -1
- package/es/ProForm/utils/useFieldProps.js +1 -3
- package/es/ProForm/utils/useForm.js +19 -21
- package/es/ProForm/utils/useRules.js +17 -22
- package/es/ProForm/utils/useShouldUpdate.d.ts +1 -0
- package/es/ProForm/utils/useShouldUpdate.js +146 -64
- package/es/ProForm/utils/useWatch.js +12 -12
- package/es/ProForm/utils/valueType.js +46 -50
- package/es/ProIcon/index.js +30 -31
- package/es/ProIcon/style/index.less +0 -2
- package/es/ProIcon/utils/index.js +5 -5
- package/es/ProLayout/components/Layout/Header/index.js +1 -1
- package/es/ProLayout/components/Layout/Icon/Icon.js +4 -4
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +68 -19
- package/es/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +0 -2
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +44 -29
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +6 -4
- package/es/ProLayout/components/Layout/Menu/SideMenu/style/index.less +0 -2
- package/es/ProLayout/components/Layout/Menu/index.js +13 -10
- package/es/ProLayout/components/Layout/Menu/style/index.less +0 -2
- package/es/ProLayout/components/Layout/Notice/index.js +3 -3
- package/es/ProLayout/components/Layout/Notice/style/index.less +0 -2
- package/es/ProLayout/components/ProCollapse/PropTypes.d.ts +8 -3
- package/es/ProLayout/components/ProCollapse/index.js +49 -20
- package/es/ProLayout/components/ProCollapse/style/index.less +148 -4
- package/es/ProLayout/components/ProFooter/index.js +13 -14
- package/es/ProLayout/components/ProFooter/style/index.less +0 -2
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +6 -5
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +6 -5
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +0 -2
- package/es/ProLayout/components/ProHeader/index.js +68 -59
- package/es/ProLayout/components/ProHeader/style/index.less +0 -2
- package/es/ProLayout/components/ProHeader/utils/index.js +1 -1
- package/es/ProLayout/index.d.ts +0 -11
- package/es/ProLayout/index.js +73 -44
- package/es/ProLayout/propTypes.d.ts +9 -0
- package/es/ProLayout/style/index.less +0 -2
- package/es/ProLayout/utils/index.d.ts +7 -0
- package/es/ProLayout/utils/index.js +46 -17
- package/es/ProSelect/components/AdaptiveTooltip.js +8 -9
- package/es/ProSelect/index.js +57 -64
- package/es/ProSelect/index.less +0 -2
- package/es/ProSelect/utils/index.js +67 -17
- package/es/ProStep/components/Anchor/index.js +10 -9
- package/es/ProStep/components/Item/index.js +12 -13
- package/es/ProStep/components/Listener/index.js +6 -10
- package/es/ProStep/components/Step/index.js +9 -11
- package/es/ProStep/index.js +24 -30
- package/es/ProStep/style/index.less +0 -2
- package/es/ProStep/utils/index.js +8 -8
- package/es/ProStepTab/index.js +27 -28
- package/es/ProTable/components/FormatColumn/index.js +54 -59
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +6 -7
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +21 -37
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +16 -17
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +5 -6
- package/es/ProTable/components/RenderColumn/index.js +36 -35
- package/es/ProTable/components/RenderEmptyText/index.js +1 -1
- package/es/ProTable/components/RenderFooter/index.js +2 -2
- package/es/ProTable/components/RenderSummary/index.js +13 -12
- package/es/ProTable/components/RenderTableHeader/index.js +5 -4
- package/es/ProTable/components/RenderTabs/index.js +26 -29
- package/es/ProTable/components/TableResizable/index.js +8 -8
- package/es/ProTable/components/TooltipTitle/index.js +4 -3
- package/es/ProTable/hooks/useAntdTable.d.ts +3 -0
- package/es/ProTable/hooks/useAntdTable.js +164 -151
- package/es/ProTable/index.d.ts +3 -7
- package/es/ProTable/index.js +124 -147
- package/es/ProTable/propsType.d.ts +12 -5
- package/es/ProTable/style/index.less +4 -6
- package/es/ProTable/utils/index.js +13 -16
- package/es/ProTabs/components/Card/index.js +14 -8
- package/es/ProTabs/index.js +30 -20
- package/es/ProTabs/propType.d.ts +5 -0
- package/es/ProTabs/style/index.less +40 -5
- package/es/ProThemeTools/component/ProTools/index.js +46 -39
- package/es/ProThemeTools/context/ThemeContext.js +13 -13
- package/es/ProThemeTools/index.d.ts +0 -7
- package/es/ProThemeTools/index.js +28 -31
- package/es/ProThemeTools/style/index.less +0 -2
- package/es/ProThemeTools/utils/index.js +14 -18
- package/es/ProTooltip/index.js +24 -27
- package/es/ProTooltip/style/index.less +0 -2
- package/es/ProTree/components/AdaptiveTooltip.js +5 -6
- package/es/ProTree/components/List.js +10 -13
- package/es/ProTree/components/ProTree.js +47 -64
- package/es/ProTree/components/ProTreeSelect/index.js +77 -76
- package/es/ProTree/components/ProTreeSelect/style/index.less +0 -2
- package/es/ProTree/components/Tree.js +23 -22
- package/es/ProTree/index.js +1 -1
- package/es/ProTree/style/index.less +0 -2
- package/es/ProTree/utils.js +14 -14
- package/es/ProTreeModal/components/Cascader.js +13 -16
- package/es/ProTreeModal/components/List.js +49 -70
- package/es/ProTreeModal/components/SortableItem.js +7 -8
- package/es/ProTreeModal/components/Tree.js +18 -23
- package/es/ProTreeModal/components/Trigger.js +15 -10
- package/es/ProTreeModal/index.js +98 -151
- package/es/ProTreeModal/style/index.less +0 -2
- package/es/ProTreeModal/utils.js +21 -21
- package/es/ProUpload/components/ButtonRender.js +11 -12
- package/es/ProUpload/components/DragRender.js +17 -20
- package/es/ProUpload/components/DraggableUploadListItem.js +2 -2
- package/es/ProUpload/components/Example.js +3 -3
- package/es/ProUpload/components/FileItem.js +30 -25
- package/es/ProUpload/components/ImageRender.js +29 -22
- package/es/ProUpload/index.js +55 -66
- package/es/ProUpload/style/index.less +0 -2
- package/es/ProUpload/uitls.js +2 -2
- package/es/ProUtils/utils/index.js +10 -14
- package/es/ProViewer/index.js +22 -19
- package/es/ProViewer/propsType.js +0 -3
- package/es/ProViewer/style/index.less +0 -2
- package/es/ProWaterMark/index.js +4 -3
- package/es/index.d.ts +1 -1
- package/es/locale/index.js +2 -2
- package/es/style/index.less +1 -1
- package/es/style/theme/antd.less +0 -2
- package/es/style/theme/base.less +1 -0
- package/es/utils/index.js +11 -13
- package/jest.config.js +46 -4
- package/lib/FormsProvider/index.js +30 -50
- package/lib/ProAction/components/CheckModalContent/index.js +31 -27
- package/lib/ProAction/index.js +194 -151
- package/lib/ProAction/index.less +0 -2
- package/lib/ProAction/propsType.js +4 -16
- package/lib/ProConfigProvider/index.d.ts +1 -0
- package/lib/ProConfigProvider/index.js +137 -136
- package/lib/ProDownload/index.js +192 -124
- package/lib/ProDownload/propsType.js +4 -16
- package/lib/ProDownload/style/index.less +0 -2
- package/lib/ProDownload/utils.js +189 -143
- package/lib/ProDrawerForm/components/ProDrawer/index.js +243 -169
- package/lib/ProDrawerForm/components/ProModal/index.js +194 -134
- package/lib/ProDrawerForm/components/index.js +17 -39
- package/lib/ProDrawerForm/index.js +83 -95
- package/lib/ProDrawerForm/propsType.js +4 -16
- package/lib/ProDrawerForm/style/index.less +0 -2
- package/lib/ProDrawerForm/utils/index.js +13 -30
- package/lib/ProEditLabel/components/RenderProForm.js +58 -57
- package/lib/ProEditLabel/index.js +251 -178
- package/lib/ProEditLabel/propsType.js +4 -16
- package/lib/ProEditLabel/style/index.less +0 -2
- package/lib/ProEditLabel/utils/index.js +11 -26
- package/lib/ProEditTable/components/ActionButton/index.js +144 -155
- package/lib/ProEditTable/components/RcTable/BaseTable.js +97 -96
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +172 -151
- package/lib/ProEditTable/components/RcTable/index.js +17 -39
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +183 -174
- package/lib/ProEditTable/components/RenderField/index.js +628 -539
- package/lib/ProEditTable/components/RenderToolbar/index.js +119 -105
- package/lib/ProEditTable/components/Summary/index.js +70 -61
- package/lib/ProEditTable/components/Validator/index.js +30 -47
- package/lib/ProEditTable/components/index.js +38 -48
- package/lib/ProEditTable/index.js +379 -324
- package/lib/ProEditTable/propsType.d.ts +1 -1
- package/lib/ProEditTable/propsType.js +4 -16
- package/lib/ProEditTable/style/index.less +2 -4
- package/lib/ProEditTable/utils/config.js +225 -170
- package/lib/ProEditTable/utils/diffOriginal.d.ts +1 -0
- package/lib/ProEditTable/utils/diffOriginal.js +112 -52
- package/lib/ProEditTable/utils/getDefaultProps.js +26 -42
- package/lib/ProEditTable/utils/index.js +318 -244
- package/lib/ProEditTable/utils/tools.js +438 -243
- package/lib/ProEditTable/utils/transform.js +15 -28
- package/lib/ProEditTable/utils/useEditTableError.js +65 -54
- package/lib/ProEnum/components/Group.js +53 -81
- package/lib/ProEnum/components/Tag.js +37 -54
- package/lib/ProEnum/hooks/useEnum.js +74 -51
- package/lib/ProEnum/hooks/useEnumRequest.js +267 -194
- package/lib/ProEnum/hooks/useFrequentEnumRequest.d.ts +14 -0
- package/lib/ProEnum/hooks/useFrequentEnumRequest.js +83 -0
- package/lib/ProEnum/index.js +239 -234
- package/lib/ProEnum/propsType.d.ts +29 -0
- package/lib/ProEnum/propsType.js +4 -16
- package/lib/ProEnum/style/index.less +0 -2
- package/lib/ProEnum/utils/eventCenter.js +15 -12
- package/lib/ProEnum/utils/frequentEnum.d.ts +40 -0
- package/lib/ProEnum/utils/frequentEnum.js +99 -0
- package/lib/ProEnum/utils/getEnumLabel.js +57 -65
- package/lib/ProEnum/utils/index.js +98 -68
- package/lib/ProForm/components/Container.js +35 -45
- package/lib/ProForm/components/FormFooter/index.js +68 -80
- package/lib/ProForm/components/FormFooter/propsType.js +4 -16
- package/lib/ProForm/components/base/Checkbox/index.js +67 -62
- package/lib/ProForm/components/base/DatePicker/index.js +66 -89
- package/lib/ProForm/components/base/DatePicker/useDateLimit.js +13 -29
- package/lib/ProForm/components/base/Input/index.js +65 -73
- package/lib/ProForm/components/base/Input/propsType.js +4 -16
- package/lib/ProForm/components/base/InputNumber/index.js +230 -176
- package/lib/ProForm/components/base/Radio/index.js +60 -69
- package/lib/ProForm/components/base/RangePicker/index.js +73 -88
- package/lib/ProForm/components/base/RangePicker/useDateRange.js +28 -45
- package/lib/ProForm/components/base/Select/index.js +63 -69
- package/lib/ProForm/components/base/Switch/index.js +43 -59
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +63 -62
- package/lib/ProForm/components/base/SwitchCheckbox/style/index.less +0 -2
- package/lib/ProForm/components/base/TextArea/index.js +52 -65
- package/lib/ProForm/components/base/TextArea/index.less +0 -2
- package/lib/ProForm/components/base/TimePicker/index.js +45 -59
- package/lib/ProForm/components/base/TimePicker/style/index.less +0 -2
- package/lib/ProForm/components/combination/Container/index.js +58 -72
- package/lib/ProForm/components/combination/Container/propsType.js +4 -16
- package/lib/ProForm/components/combination/Container/style/index.less +0 -2
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +240 -195
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +85 -107
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +25 -44
- package/lib/ProForm/components/combination/FormList/components/Empty.js +92 -55
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +92 -117
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +133 -101
- package/lib/ProForm/components/combination/FormList/index.js +131 -164
- package/lib/ProForm/components/combination/FormList/propsType.js +4 -16
- package/lib/ProForm/components/combination/FormList/style/index.less +0 -2
- package/lib/ProForm/components/combination/FormList/utils.js +32 -52
- package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.js +23 -38
- package/lib/ProForm/components/combination/Group/component/ComRender.js +79 -74
- package/lib/ProForm/components/combination/Group/hooks/index.d.ts +0 -1
- package/lib/ProForm/components/combination/Group/hooks/index.js +127 -121
- package/lib/ProForm/components/combination/Group/index.d.ts +8 -2
- package/lib/ProForm/components/combination/Group/index.js +100 -110
- package/lib/ProForm/components/combination/Group/propsType.d.ts +2 -0
- package/lib/ProForm/components/combination/Group/propsType.js +4 -16
- package/lib/ProForm/components/combination/Group/style/index.less +7 -0
- package/lib/ProForm/components/combination/Group/utils.d.ts +0 -1
- package/lib/ProForm/components/combination/Group/utils.js +132 -104
- package/lib/ProForm/components/combination/ProCascader/index.js +289 -187
- package/lib/ProForm/components/combination/ProCascader/propsType.d.ts +12 -4
- package/lib/ProForm/components/combination/ProCascader/propsType.js +4 -16
- package/lib/ProForm/components/combination/ProCascader/style/index.less +1 -3
- package/lib/ProForm/components/combination/ProCascader/utils/index.js +23 -33
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +115 -116
- package/lib/ProForm/components/combination/ProModalSelect/index.js +656 -503
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +7 -3
- package/lib/ProForm/components/combination/ProModalSelect/propsType.js +4 -16
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +1 -4
- package/lib/ProForm/components/combination/ProModalSelect/utils/index.js +21 -43
- package/lib/ProForm/components/combination/ProNumberRange/index.js +207 -160
- package/lib/ProForm/components/combination/ProNumberRange/propsType.d.ts +3 -2
- package/lib/ProForm/components/combination/ProNumberRange/propsType.js +4 -16
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +4 -3
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +169 -139
- package/lib/ProForm/components/combination/ProRangeLimit/propsType.js +4 -16
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +28 -49
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +150 -127
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +0 -2
- package/lib/ProForm/components/index.js +192 -115
- package/lib/ProForm/components/render/ChangedWrapper.js +132 -143
- package/lib/ProForm/components/render/ConfirmWrapper.js +120 -78
- package/lib/ProForm/components/render/Render.js +446 -339
- package/lib/ProForm/components/render/RenderFields.d.ts +1 -1
- package/lib/ProForm/components/render/RenderFields.js +195 -179
- package/lib/ProForm/components/render/propsType.d.ts +1 -0
- package/lib/ProForm/components/render/propsType.js +31 -17
- package/lib/ProForm/index.d.ts +2 -2
- package/lib/ProForm/index.js +282 -233
- package/lib/ProForm/propsType.d.ts +3 -4
- package/lib/ProForm/propsType.js +9 -38
- package/lib/ProForm/style/index.less +0 -2
- package/lib/ProForm/utils/diffOriginal.d.ts +1 -0
- package/lib/ProForm/utils/diffOriginal.js +107 -53
- package/lib/ProForm/utils/getDefaultProps.js +26 -42
- package/lib/ProForm/utils/index.js +330 -254
- package/lib/ProForm/utils/processDependencies.js +61 -44
- package/lib/ProForm/utils/rulesCreator.js +58 -81
- package/lib/ProForm/utils/transformNames.js +26 -37
- package/lib/ProForm/utils/transformValue.js +47 -47
- package/lib/ProForm/utils/useDeepCompareMemo.js +15 -34
- package/lib/ProForm/utils/useFieldProps.js +10 -42
- package/lib/ProForm/utils/useForm.js +226 -118
- package/lib/ProForm/utils/useRules.js +50 -60
- package/lib/ProForm/utils/useShouldUpdate.d.ts +1 -0
- package/lib/ProForm/utils/useShouldUpdate.js +259 -103
- package/lib/ProForm/utils/useWatch.js +122 -93
- package/lib/ProForm/utils/valueType.js +222 -155
- package/lib/ProIcon/config/index.js +278 -365
- package/lib/ProIcon/index.js +217 -184
- package/lib/ProIcon/propsTypes.js +4 -16
- package/lib/ProIcon/style/index.less +0 -2
- package/lib/ProIcon/symbolIcon.js +30 -23
- package/lib/ProIcon/utils/index.js +53 -60
- package/lib/ProLayout/components/Layout/Header/index.js +42 -59
- package/lib/ProLayout/components/Layout/Icon/Icon.js +31 -49
- package/lib/ProLayout/components/Layout/Icon/index.js +7 -34
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +173 -113
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +0 -2
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +137 -114
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/propsType.js +4 -16
- package/lib/ProLayout/components/Layout/Menu/SideMenu/index.js +44 -59
- package/lib/ProLayout/components/Layout/Menu/SideMenu/style/index.less +0 -2
- package/lib/ProLayout/components/Layout/Menu/index.js +52 -68
- package/lib/ProLayout/components/Layout/Menu/style/index.less +0 -2
- package/lib/ProLayout/components/Layout/Notice/index.js +31 -39
- package/lib/ProLayout/components/Layout/Notice/style/index.less +0 -2
- package/lib/ProLayout/components/Layout/index.js +31 -45
- package/lib/ProLayout/components/ProCollapse/PropTypes.d.ts +8 -3
- package/lib/ProLayout/components/ProCollapse/PropTypes.js +4 -16
- package/lib/ProLayout/components/ProCollapse/index.js +163 -128
- package/lib/ProLayout/components/ProCollapse/style/index.less +148 -4
- package/lib/ProLayout/components/ProFooter/PropTypes.js +4 -16
- package/lib/ProLayout/components/ProFooter/index.js +41 -56
- package/lib/ProLayout/components/ProFooter/style/index.less +0 -2
- package/lib/ProLayout/components/ProHeader/PropTypes.js +4 -16
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +26 -53
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +27 -48
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/propsType.js +4 -16
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +0 -2
- package/lib/ProLayout/components/ProHeader/components/index.js +17 -39
- package/lib/ProLayout/components/ProHeader/index.js +466 -268
- package/lib/ProLayout/components/ProHeader/style/index.less +0 -2
- package/lib/ProLayout/components/ProHeader/utils/index.js +14 -31
- package/lib/ProLayout/components/index.js +24 -42
- package/lib/ProLayout/index.d.ts +0 -11
- package/lib/ProLayout/index.js +166 -138
- package/lib/ProLayout/propTypes.d.ts +9 -0
- package/lib/ProLayout/propTypes.js +4 -16
- package/lib/ProLayout/style/index.less +0 -2
- package/lib/ProLayout/utils/index.d.ts +7 -0
- package/lib/ProLayout/utils/index.js +125 -76
- package/lib/ProSelect/components/AdaptiveTooltip.js +38 -45
- package/lib/ProSelect/index.js +240 -213
- package/lib/ProSelect/index.less +0 -2
- package/lib/ProSelect/propsType.js +4 -16
- package/lib/ProSelect/utils/index.js +123 -73
- package/lib/ProStep/components/Anchor/index.js +102 -107
- package/lib/ProStep/components/Item/index.js +71 -76
- package/lib/ProStep/components/Listener/index.js +69 -62
- package/lib/ProStep/components/Step/index.js +65 -75
- package/lib/ProStep/index.js +227 -165
- package/lib/ProStep/propsType.js +4 -16
- package/lib/ProStep/style/index.less +0 -2
- package/lib/ProStep/utils/index.js +54 -57
- package/lib/ProStepTab/index.js +307 -166
- package/lib/ProStepTab/propsType.js +4 -16
- package/lib/ProTable/components/FormatColumn/index.js +472 -425
- package/lib/ProTable/components/RcTable/components/BaseTable/index.js +39 -53
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +183 -135
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +85 -104
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/propsType.js +4 -16
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +58 -80
- package/lib/ProTable/components/RcTable/index.js +17 -39
- package/lib/ProTable/components/RenderColumn/index.js +203 -194
- package/lib/ProTable/components/RenderEmptyText/index.js +25 -27
- package/lib/ProTable/components/RenderFooter/index.js +17 -33
- package/lib/ProTable/components/RenderSummary/index.js +57 -46
- package/lib/ProTable/components/RenderTableHeader/index.js +62 -68
- package/lib/ProTable/components/RenderTabs/index.js +67 -80
- package/lib/ProTable/components/TableResizable/index.js +87 -87
- package/lib/ProTable/components/TooltipTitle/index.js +27 -40
- package/lib/ProTable/components/index.js +45 -51
- package/lib/ProTable/hooks/useAntdTable.d.ts +3 -0
- package/lib/ProTable/hooks/useAntdTable.js +373 -291
- package/lib/ProTable/index.d.ts +3 -7
- package/lib/ProTable/index.js +354 -338
- package/lib/ProTable/propsType.d.ts +12 -5
- package/lib/ProTable/propsType.js +4 -16
- package/lib/ProTable/style/index.less +4 -6
- package/lib/ProTable/utils/index.js +89 -78
- package/lib/ProTabs/components/Card/index.js +57 -30
- package/lib/ProTabs/components/index.js +10 -36
- package/lib/ProTabs/index.js +94 -89
- package/lib/ProTabs/propType.d.ts +5 -0
- package/lib/ProTabs/propType.js +4 -16
- package/lib/ProTabs/style/index.less +40 -5
- package/lib/ProThemeTools/component/ProTools/index.js +246 -198
- package/lib/ProThemeTools/component/index.js +10 -36
- package/lib/ProThemeTools/context/ThemeContext.js +99 -89
- package/lib/ProThemeTools/index.d.ts +0 -7
- package/lib/ProThemeTools/index.js +207 -179
- package/lib/ProThemeTools/propsType.js +4 -16
- package/lib/ProThemeTools/style/index.less +0 -2
- package/lib/ProThemeTools/utils/index.js +84 -80
- package/lib/ProTooltip/index.js +217 -214
- package/lib/ProTooltip/propsType.js +4 -16
- package/lib/ProTooltip/style/index.less +0 -2
- package/lib/ProTree/components/AdaptiveTooltip.js +22 -33
- package/lib/ProTree/components/CloseIcon.js +31 -36
- package/lib/ProTree/components/List.js +69 -68
- package/lib/ProTree/components/ProTree.js +346 -258
- package/lib/ProTree/components/ProTreeSelect/index.js +460 -336
- package/lib/ProTree/components/ProTreeSelect/propsType.js +4 -16
- package/lib/ProTree/components/ProTreeSelect/style/index.less +0 -2
- package/lib/ProTree/components/SearchTitle.js +50 -47
- package/lib/ProTree/components/Tree.js +300 -227
- package/lib/ProTree/components/index.js +31 -45
- package/lib/ProTree/index.js +22 -45
- package/lib/ProTree/propsType.js +4 -16
- package/lib/ProTree/style/index.less +0 -2
- package/lib/ProTree/utils.js +140 -79
- package/lib/ProTreeModal/components/Cascader.js +90 -97
- package/lib/ProTreeModal/components/CloseIcon.js +31 -36
- package/lib/ProTreeModal/components/List.js +246 -192
- package/lib/ProTreeModal/components/SearchTitle.js +22 -30
- package/lib/ProTreeModal/components/SortableItem.js +59 -60
- package/lib/ProTreeModal/components/Tree.js +171 -157
- package/lib/ProTreeModal/components/Trigger.js +131 -108
- package/lib/ProTreeModal/components/index.js +45 -51
- package/lib/ProTreeModal/index.js +523 -448
- package/lib/ProTreeModal/propsType.js +4 -16
- package/lib/ProTreeModal/style/index.less +0 -2
- package/lib/ProTreeModal/utils.js +160 -99
- package/lib/ProUpload/components/ButtonRender.js +106 -85
- package/lib/ProUpload/components/DragRender.js +167 -117
- package/lib/ProUpload/components/DraggableUploadListItem.js +32 -48
- package/lib/ProUpload/components/Example.js +39 -55
- package/lib/ProUpload/components/FileItem.js +215 -113
- package/lib/ProUpload/components/ImageRender.js +250 -175
- package/lib/ProUpload/index.js +185 -181
- package/lib/ProUpload/propsType.js +4 -16
- package/lib/ProUpload/style/index.less +0 -2
- package/lib/ProUpload/uitls.js +9 -31
- package/lib/ProUtils/utils/index.js +20 -36
- package/lib/ProViewer/index.js +210 -175
- package/lib/ProViewer/propsType.js +1 -17
- package/lib/ProViewer/style/index.less +0 -2
- package/lib/ProWaterMark/index.js +20 -38
- package/lib/ProWaterMark/propsType.js +4 -16
- package/lib/index.d.ts +1 -1
- package/lib/index.js +272 -123
- package/lib/locale/en_US.js +127 -145
- package/lib/locale/index.js +40 -55
- package/lib/locale/zh_CN.js +128 -146
- package/lib/style/index.less +1 -1
- package/lib/style/theme/antd.less +0 -2
- package/lib/style/theme/base.less +1 -0
- package/lib/tokens.js +87 -103
- package/lib/utils/index.js +66 -88
- package/package.json +12 -11
- package/dist/index.esm.js +0 -3
- package/dist/less.esm.js +0 -3
@@ -1,15 +1,21 @@
|
|
1
|
-
import
|
1
|
+
import "antd/es/tooltip/style";
|
2
|
+
import _Tooltip from "antd/es/tooltip";
|
2
3
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
3
4
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
5
|
+
import "antd/es/input/style";
|
6
|
+
import _Input from "antd/es/input";
|
7
|
+
import "antd/es/message/style";
|
8
|
+
import _message from "antd/es/message";
|
4
9
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
5
10
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
6
11
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
12
|
+
import "antd/es/tree-select/style";
|
13
|
+
import _TreeSelect from "antd/es/tree-select";
|
7
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"],
|
8
15
|
_excluded2 = ["children"];
|
9
16
|
/* eslint-disable react/no-danger */
|
10
17
|
/* eslint-disable react/jsx-closing-tag-location */
|
11
18
|
import { useDeepCompareEffect, useRequest as useRequestFunc, useSetState } from 'ahooks';
|
12
|
-
import { Input, TreeSelect, message, Tooltip } from 'antd';
|
13
19
|
import classnames from 'classnames';
|
14
20
|
import React, { useImperativeHandle, forwardRef, useCallback } from 'react';
|
15
21
|
import { cloneDeep, debounce } from 'lodash';
|
@@ -19,8 +25,8 @@ import Container from "../../../ProForm/components/Container";
|
|
19
25
|
import AdaptiveTooltip from "../AdaptiveTooltip";
|
20
26
|
import { jsx as _jsx } from "react/jsx-runtime";
|
21
27
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
22
|
-
var SHOW_PARENT =
|
23
|
-
export var ProTreeSelect =
|
28
|
+
var SHOW_PARENT = _TreeSelect.SHOW_PARENT;
|
29
|
+
export var ProTreeSelect = (props, ref) => {
|
24
30
|
var _useRequest$options, _selectProps$classNam, _selectProps$classNam2, _selectProps$styles, _selectProps$styles2;
|
25
31
|
// 全局属性配置在ConfigProvider
|
26
32
|
var _ref = useProConfig('ProTreeSelect') || {},
|
@@ -102,14 +108,14 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
102
108
|
* @param dictsEnum 原始数据
|
103
109
|
* @returns 平铺或者原始数据
|
104
110
|
*/
|
105
|
-
var countChild =
|
111
|
+
var countChild = dictsEnum => {
|
106
112
|
if (treeCheckable) {
|
107
113
|
return dictsEnum;
|
108
114
|
}
|
109
115
|
var count = 0;
|
110
116
|
var result = [];
|
111
|
-
var loopCount =
|
112
|
-
data.map(
|
117
|
+
var loopCount = data => {
|
118
|
+
data.map(item => {
|
113
119
|
count += 1;
|
114
120
|
var children = item.children,
|
115
121
|
other = _objectWithoutProperties(item, _excluded2);
|
@@ -136,11 +142,11 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
136
142
|
* @param showCodeAndName 是否展示code-name
|
137
143
|
* @returns 转换结果
|
138
144
|
*/
|
139
|
-
var transferDataSource =
|
145
|
+
var transferDataSource = (dataArr, showCodeAndName) => {
|
140
146
|
var copyData = cloneDeep(dataArr);
|
141
|
-
var loop =
|
142
|
-
arr.map(
|
143
|
-
item[label] =
|
147
|
+
var loop = arr => {
|
148
|
+
arr.map(item => {
|
149
|
+
item[label] = `${item[code]}-${item[label]}`;
|
144
150
|
if (item.children) {
|
145
151
|
loop(item.children);
|
146
152
|
}
|
@@ -152,13 +158,13 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
152
158
|
}
|
153
159
|
return copyData;
|
154
160
|
};
|
155
|
-
var defaultOnSuccessFun =
|
161
|
+
var defaultOnSuccessFun = res => {
|
156
162
|
var _res$status = res.status,
|
157
163
|
status = _res$status === void 0 ? 200 : _res$status,
|
158
164
|
msg = res.message,
|
159
165
|
data = res.data;
|
160
166
|
if (status !== 200) {
|
161
|
-
|
167
|
+
_message.error(msg);
|
162
168
|
return;
|
163
169
|
}
|
164
170
|
var resultData = transferDataSource(data, showCodeName);
|
@@ -167,7 +173,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
167
173
|
origDataSource: resultData || []
|
168
174
|
});
|
169
175
|
};
|
170
|
-
var successTransformDataHandle = useCallback(
|
176
|
+
var successTransformDataHandle = useCallback(res => {
|
171
177
|
if (transformResponse && typeof transformResponse === 'function') {
|
172
178
|
return transformResponse(res);
|
173
179
|
}
|
@@ -177,7 +183,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
177
183
|
msg = _ref4.message,
|
178
184
|
data = _ref4.data;
|
179
185
|
if (status !== 200) {
|
180
|
-
|
186
|
+
_message.error(msg);
|
181
187
|
return;
|
182
188
|
}
|
183
189
|
return data;
|
@@ -187,7 +193,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
187
193
|
var fetchFunction = useRequestFunc(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, _objectSpread({
|
188
194
|
manual: true,
|
189
195
|
debounceWait: 300,
|
190
|
-
onSuccess:
|
196
|
+
onSuccess: data => {
|
191
197
|
if (transformResponse && typeof transformResponse === 'function') {
|
192
198
|
var responseData = transformResponse(data);
|
193
199
|
var resultData = transferDataSource(responseData, showCodeName);
|
@@ -201,14 +207,12 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
201
207
|
}
|
202
208
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options));
|
203
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) : [];
|
204
|
-
useImperativeHandle(ref,
|
205
|
-
|
206
|
-
|
207
|
-
};
|
208
|
-
});
|
210
|
+
useImperativeHandle(ref, () => ({
|
211
|
+
useRequestRef: fetchFunction
|
212
|
+
}));
|
209
213
|
|
210
214
|
// 设置cacheKey后使用缓存的数据
|
211
|
-
useDeepCompareEffect(
|
215
|
+
useDeepCompareEffect(() => {
|
212
216
|
var _useRequest$options2;
|
213
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) {
|
214
218
|
if (transformResponse && typeof transformResponse === 'function') {
|
@@ -223,7 +227,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
223
227
|
}
|
224
228
|
}
|
225
229
|
}, [fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.data]);
|
226
|
-
useDeepCompareEffect(
|
230
|
+
useDeepCompareEffect(() => {
|
227
231
|
if (enumCode) {
|
228
232
|
var dictEnum = dics[enumCode] || [];
|
229
233
|
var resultData = transferDataSource(dictEnum, showCodeName);
|
@@ -239,7 +243,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
239
243
|
});
|
240
244
|
}
|
241
245
|
}, [enumCode, dataSource]);
|
242
|
-
useDeepCompareEffect(
|
246
|
+
useDeepCompareEffect(() => {
|
243
247
|
// code存在huo dataSource存在,不执行接口请求
|
244
248
|
if (enumCode || dataSource) {
|
245
249
|
return undefined;
|
@@ -264,7 +268,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
264
268
|
if (defaultDisableValue) {
|
265
269
|
return /*#__PURE__*/_jsx("span", {
|
266
270
|
title: defaultDisableValue,
|
267
|
-
children: /*#__PURE__*/_jsx(
|
271
|
+
children: /*#__PURE__*/_jsx(_Input, {
|
268
272
|
disabled: true,
|
269
273
|
defaultValue: defaultDisableValue,
|
270
274
|
style: props === null || props === void 0 ? void 0 : props.style
|
@@ -277,23 +281,21 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
277
281
|
* @param value 输入值
|
278
282
|
* @returns 对应枚举label
|
279
283
|
*/
|
280
|
-
var transToLabel =
|
284
|
+
var transToLabel = value => {
|
281
285
|
if (!Array.isArray(origDataSource) || !origDataSource.length) {
|
282
286
|
return viewEmpty;
|
283
287
|
}
|
284
288
|
var labelResult = [];
|
285
|
-
var queryLabel =
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
});
|
296
|
-
};
|
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
|
+
});
|
297
299
|
queryLabel(origDataSource);
|
298
300
|
return labelResult === null || labelResult === void 0 ? void 0 : labelResult.join(',');
|
299
301
|
};
|
@@ -312,7 +314,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
312
314
|
children: value ? transToLabel([value]) : null
|
313
315
|
});
|
314
316
|
}
|
315
|
-
var Icon =
|
317
|
+
var Icon = () => {
|
316
318
|
return /*#__PURE__*/_jsx("svg", {
|
317
319
|
className: "icon",
|
318
320
|
viewBox: "0 0 1433 1024",
|
@@ -334,7 +336,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
334
336
|
* @param node 每个节点数据对象
|
335
337
|
* @returns 整个react节点树
|
336
338
|
*/
|
337
|
-
var renderTreeNode =
|
339
|
+
var renderTreeNode = (node, grade) => {
|
338
340
|
var children = node.children,
|
339
341
|
icon = node.icon;
|
340
342
|
var labelText = node[label];
|
@@ -343,7 +345,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
343
345
|
// 三无走默认
|
344
346
|
if (['undefined-undefined', 'undefined'].includes(labelText) && !value && !key) {
|
345
347
|
if (showCodeName) {
|
346
|
-
labelText =
|
348
|
+
labelText = `${node === null || node === void 0 ? void 0 : node.value}-${node === null || node === void 0 ? void 0 : node.label}`;
|
347
349
|
} else {
|
348
350
|
labelText = node === null || node === void 0 ? void 0 : node.label;
|
349
351
|
}
|
@@ -357,7 +359,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
357
359
|
});
|
358
360
|
var searchKey = '';
|
359
361
|
if (showCodeName) {
|
360
|
-
searchKey =
|
362
|
+
searchKey = `${value}-${labelText}`;
|
361
363
|
} else {
|
362
364
|
searchKey = labelText;
|
363
365
|
}
|
@@ -383,27 +385,25 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
383
385
|
});
|
384
386
|
}
|
385
387
|
if (!children) {
|
386
|
-
return /*#__PURE__*/_jsx(
|
388
|
+
return /*#__PURE__*/_jsx(_TreeSelect.TreeNode, {
|
387
389
|
value: value,
|
388
390
|
title: title,
|
389
391
|
label: searchKey,
|
390
392
|
disabled: node.disabled,
|
391
393
|
checkable: node.checkable,
|
392
394
|
icon: icon,
|
393
|
-
className:
|
395
|
+
className: `node-val-${value}`
|
394
396
|
}, key);
|
395
397
|
}
|
396
398
|
var sonGrade = grade + 1;
|
397
|
-
return /*#__PURE__*/_jsx(
|
399
|
+
return /*#__PURE__*/_jsx(_TreeSelect.TreeNode, {
|
398
400
|
value: value,
|
399
401
|
title: title,
|
400
402
|
label: searchKey,
|
401
403
|
disabled: node.disabled,
|
402
404
|
checkable: node.checkable,
|
403
|
-
className:
|
404
|
-
children: children.map(
|
405
|
-
return renderTreeNode(child, sonGrade);
|
406
|
-
})
|
405
|
+
className: `node-val-${value}`,
|
406
|
+
children: children.map(child => renderTreeNode(child, sonGrade))
|
407
407
|
}, key);
|
408
408
|
};
|
409
409
|
|
@@ -430,7 +430,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
430
430
|
// @ts-ignore
|
431
431
|
if (item[label].indexOf(keyWord) > -1 && (selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode) !== 'treeSelect') {
|
432
432
|
var regExp = new RegExp(keyWord);
|
433
|
-
item[label] = item[label].replace(regExp,
|
433
|
+
item[label] = item[label].replace(regExp, `<span class="highlight-search-text">${keyWord}</span>`);
|
434
434
|
}
|
435
435
|
currentAllNodeChild.push(item);
|
436
436
|
}
|
@@ -494,7 +494,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
494
494
|
if (nodeValue) {
|
495
495
|
if (Array.isArray(nodeValue)) {
|
496
496
|
result = [];
|
497
|
-
nodeValue.map(
|
497
|
+
nodeValue.map(item => {
|
498
498
|
var res = findTreeNode(treeList, item === null || item === void 0 ? void 0 : item.value);
|
499
499
|
res && result.push(res);
|
500
500
|
return item;
|
@@ -505,9 +505,9 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
505
505
|
}
|
506
506
|
return result;
|
507
507
|
}
|
508
|
-
var handleChange =
|
508
|
+
var handleChange = (newVal, label, extra) => {
|
509
509
|
// newVal回来得一定是label、value
|
510
|
-
var _selectList = selectList.map(
|
510
|
+
var _selectList = selectList.map(item => {
|
511
511
|
var label = item.label;
|
512
512
|
var _label = label;
|
513
513
|
if (label) {
|
@@ -532,7 +532,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
532
532
|
* 全局点击事件, 如果是单选的情况那么点击选中节点后取消勾选
|
533
533
|
* @param e 事件源
|
534
534
|
*/
|
535
|
-
var nodeChangeEvent =
|
535
|
+
var nodeChangeEvent = e => {
|
536
536
|
var el = e.target;
|
537
537
|
var classStr = el.className;
|
538
538
|
if (classStr && !treeCheckable && typeof classStr === 'string') {
|
@@ -550,13 +550,13 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
550
550
|
|
551
551
|
// 如果单选情况下只有10条那么设置class控制样式
|
552
552
|
var tenCountClass = '';
|
553
|
-
var countTen =
|
553
|
+
var countTen = enums => {
|
554
554
|
if (!enums) {
|
555
555
|
return '';
|
556
556
|
}
|
557
557
|
var noneChild = true;
|
558
|
-
var loopCount =
|
559
|
-
data.map(
|
558
|
+
var loopCount = data => {
|
559
|
+
data.map(item => {
|
560
560
|
var _item$children;
|
561
561
|
if (item !== null && item !== void 0 && (_item$children = item.children) !== null && _item$children !== void 0 && _item$children.length) {
|
562
562
|
noneChild = false;
|
@@ -568,25 +568,28 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
568
568
|
return noneChild ? 'ten-count-tree-node' : '';
|
569
569
|
};
|
570
570
|
tenCountClass = countTen(selectList);
|
571
|
-
var cls = classnames(
|
572
|
-
'pro-tree-select': true
|
573
|
-
|
574
|
-
|
575
|
-
var
|
576
|
-
|
577
|
-
|
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
|
+
});
|
578
581
|
var treeProps = _objectSpread(_objectSpread({
|
579
|
-
disabled
|
580
|
-
showSearch
|
582
|
+
disabled,
|
583
|
+
showSearch,
|
581
584
|
// 默认支持搜索
|
582
585
|
treeDefaultExpandAll: defaultExpandAll,
|
583
586
|
// 展开下拉配置,默认全展开
|
584
587
|
treeExpandedKeys: expandedKeys,
|
585
|
-
treeCheckable
|
588
|
+
treeCheckable,
|
586
589
|
// 可以复选;*枚举数据里必须有key
|
587
590
|
showCheckedStrategy: SHOW_PARENT,
|
588
591
|
// 选择后的值只显示父级
|
589
|
-
value
|
592
|
+
value,
|
590
593
|
onChange: handleChange,
|
591
594
|
listHeight: listHeight || 320,
|
592
595
|
style: _objectSpread({
|
@@ -594,7 +597,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
594
597
|
}, style),
|
595
598
|
onSearch: searchTreeEvent,
|
596
599
|
allowClear: allowClear || true,
|
597
|
-
treeNodeFilterProp
|
600
|
+
treeNodeFilterProp,
|
598
601
|
virtual: true,
|
599
602
|
treeCheckStrictly: checkStrictly
|
600
603
|
}, selectProps), {}, {
|
@@ -620,15 +623,15 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
620
623
|
return /*#__PURE__*/_jsx("div", {
|
621
624
|
onClick: nodeChangeEvent,
|
622
625
|
className: cls,
|
623
|
-
children: /*#__PURE__*/_jsx(
|
626
|
+
children: /*#__PURE__*/_jsx(_TreeSelect, _objectSpread(_objectSpread({
|
624
627
|
placeholder: placeholder || locale.ProForm.treeSelectPlaceholder,
|
625
|
-
maxTagPlaceholder:
|
626
|
-
var _rest = rest.map(
|
628
|
+
maxTagPlaceholder: rest => {
|
629
|
+
var _rest = rest.map(tag => {
|
627
630
|
var _tag$label, _tag$label2, _tag$label3;
|
628
631
|
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;
|
629
632
|
});
|
630
633
|
var _str = _rest.join('、');
|
631
|
-
return /*#__PURE__*/_jsx(
|
634
|
+
return /*#__PURE__*/_jsx(_Tooltip, {
|
632
635
|
title: /*#__PURE__*/_jsx("div", {
|
633
636
|
children: _str
|
634
637
|
}),
|
@@ -638,9 +641,7 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
638
641
|
});
|
639
642
|
}
|
640
643
|
}, treeProps), {}, {
|
641
|
-
children: selectList.map(
|
642
|
-
return renderTreeNode(node, 1);
|
643
|
-
})
|
644
|
+
children: selectList.map(node => renderTreeNode(node, 1))
|
644
645
|
}))
|
645
646
|
});
|
646
647
|
};
|
@@ -1,3 +1,7 @@
|
|
1
|
+
import "antd/es/tree/style";
|
2
|
+
import _Tree from "antd/es/tree";
|
3
|
+
import "antd/es/popover/style";
|
4
|
+
import _Popover from "antd/es/popover";
|
1
5
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
6
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
3
7
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
@@ -6,7 +10,6 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
6
10
|
var _excluded = ["checkedValues", "disabled", "searchStr", "originalTreeData", "showCodeName", "checkStrictly", "flatTreeData", "mode", "fieldNames", "tags", "onCheck", "optionRender", "treeData", "showLine", "switcherIcon", "checkable", "menu", "innerExpandKeys", "selectedKey", "disabledMode", "isRadioSelect"];
|
7
11
|
/* eslint-disable no-plusplus */
|
8
12
|
import React, { useEffect, useState } from 'react';
|
9
|
-
import { Tree, Popover } from 'antd';
|
10
13
|
import { useSetState } from 'ahooks';
|
11
14
|
import { CaretDownOutlined } from '@ant-design/icons';
|
12
15
|
import SearchTitle from "./SearchTitle";
|
@@ -61,31 +64,29 @@ function List(props) {
|
|
61
64
|
currentClickTreeNode = _useSetState2$.currentClickTreeNode,
|
62
65
|
handing = _useSetState2$.handing,
|
63
66
|
setState = _useSetState2[1];
|
64
|
-
useEffect(
|
67
|
+
useEffect(() => {
|
65
68
|
if (searchStr) {
|
66
|
-
var newExpandedKeys = flatTreeData.map(
|
69
|
+
var newExpandedKeys = flatTreeData.map(item => {
|
67
70
|
var title = item[fieldNameValue] + item[fieldNameLabel];
|
68
71
|
if ((title === null || title === void 0 ? void 0 : title.indexOf(searchStr)) > -1) {
|
69
72
|
return getParentKey(item[fieldNameValue], originalTreeData, fieldNames);
|
70
73
|
}
|
71
74
|
return null;
|
72
|
-
}).filter(
|
73
|
-
return item && self.indexOf(item) === i;
|
74
|
-
});
|
75
|
+
}).filter((item, i, self) => item && self.indexOf(item) === i);
|
75
76
|
setState({
|
76
77
|
expandedKeys: newExpandedKeys,
|
77
78
|
autoExpandParent: true
|
78
79
|
});
|
79
80
|
}
|
80
81
|
}, [searchStr]);
|
81
|
-
useEffect(
|
82
|
+
useEffect(() => {
|
82
83
|
if (innerExpandKeys) {
|
83
84
|
setState({
|
84
85
|
expandedKeys: innerExpandKeys
|
85
86
|
});
|
86
87
|
}
|
87
88
|
}, [innerExpandKeys]);
|
88
|
-
useEffect(
|
89
|
+
useEffect(() => {
|
89
90
|
if (!checkable) {
|
90
91
|
// 单选树,checkedValues为string,选中那个树节点
|
91
92
|
setState({
|
@@ -93,7 +94,7 @@ function List(props) {
|
|
93
94
|
});
|
94
95
|
}
|
95
96
|
}, [checkedValues]);
|
96
|
-
useEffect(
|
97
|
+
useEffect(() => {
|
97
98
|
// 复选树,配置的selectedKey在这里处理选中,单选树,在ProTree组件里跟value比优先级处理,到这个组件里面是checkedValues了
|
98
99
|
if (checkable) {
|
99
100
|
setState({
|
@@ -139,7 +140,7 @@ function List(props) {
|
|
139
140
|
return _ref.apply(this, arguments);
|
140
141
|
};
|
141
142
|
}();
|
142
|
-
var TreeNodeRow =
|
143
|
+
var TreeNodeRow = props => {
|
143
144
|
var nodeClass = props.nodeClass,
|
144
145
|
item = props.item,
|
145
146
|
index = props.index,
|
@@ -151,15 +152,15 @@ function List(props) {
|
|
151
152
|
open = _useState2[0],
|
152
153
|
setOpen = _useState2[1];
|
153
154
|
var operateButton = menu && menu(item === null || item === void 0 ? void 0 : item[fieldNameValue], item);
|
154
|
-
operateButton === null || operateButton === void 0 || operateButton.map(
|
155
|
+
operateButton === null || operateButton === void 0 || operateButton.map((item, i) => {
|
155
156
|
return /*#__PURE__*/_jsx(React.Fragment, {
|
156
157
|
children: item
|
157
158
|
}, i);
|
158
159
|
});
|
159
|
-
var hide =
|
160
|
+
var hide = () => {
|
160
161
|
setOpen(false);
|
161
162
|
};
|
162
|
-
var handleOpenChange =
|
163
|
+
var handleOpenChange = newOpen => {
|
163
164
|
setOpen(newOpen);
|
164
165
|
};
|
165
166
|
var expandIcon = /*#__PURE__*/_jsx("span", {
|
@@ -239,12 +240,12 @@ function List(props) {
|
|
239
240
|
});
|
240
241
|
return /*#__PURE__*/_jsxs("div", {
|
241
242
|
className: nodeClass,
|
242
|
-
onClick:
|
243
|
+
onClick: e => {
|
243
244
|
e.stopPropagation();
|
244
245
|
onSelect(item === null || item === void 0 ? void 0 : item[fieldNameValue], {
|
245
246
|
node: e === null || e === void 0 ? void 0 : e.target,
|
246
247
|
event: e,
|
247
|
-
item
|
248
|
+
item,
|
248
249
|
selected: !isChecked
|
249
250
|
});
|
250
251
|
},
|
@@ -267,10 +268,10 @@ function List(props) {
|
|
267
268
|
}, other))
|
268
269
|
}), /*#__PURE__*/_jsx("div", {
|
269
270
|
className: "operate-tree-node-btns",
|
270
|
-
onClick:
|
271
|
+
onClick: e => {
|
271
272
|
e.stopPropagation();
|
272
273
|
},
|
273
|
-
children: (operateButton === null || operateButton === void 0 ? void 0 : operateButton.length) > 1 ? /*#__PURE__*/_jsx(
|
274
|
+
children: (operateButton === null || operateButton === void 0 ? void 0 : operateButton.length) > 1 ? /*#__PURE__*/_jsx(_Popover, {
|
274
275
|
classNames: {
|
275
276
|
root: 'pro-tree-operate-container'
|
276
277
|
},
|
@@ -292,16 +293,16 @@ function List(props) {
|
|
292
293
|
}, onlyKey);
|
293
294
|
};
|
294
295
|
function fn() {
|
295
|
-
var loop =
|
296
|
+
var loop = (data, index) => {
|
296
297
|
index++;
|
297
|
-
var treeRow = data.map(
|
298
|
+
var treeRow = data.map(item => {
|
298
299
|
var nodeClass = 'pro-tree-tree-node ';
|
299
300
|
var isChecked = false;
|
300
301
|
if (currentClickTreeNode === item[fieldNameValue]) {
|
301
302
|
nodeClass += ' checked';
|
302
303
|
isChecked = true;
|
303
304
|
}
|
304
|
-
var title = showCodeName ?
|
305
|
+
var title = showCodeName ? `${item[fieldNameValue]}-${item[fieldNameLabel]}` : item[fieldNameLabel];
|
305
306
|
var nodeTitle = /*#__PURE__*/_jsx(TreeNodeRow, {
|
306
307
|
nodeClass: nodeClass,
|
307
308
|
item: item,
|
@@ -334,7 +335,7 @@ function List(props) {
|
|
334
335
|
return loop(newTreeData, -1);
|
335
336
|
}
|
336
337
|
var _treeData = fn();
|
337
|
-
var onExpand =
|
338
|
+
var onExpand = (newExpandedKeys, nextPara) => {
|
338
339
|
setState({
|
339
340
|
expandedKeys: newExpandedKeys,
|
340
341
|
autoExpandParent: false
|
@@ -350,7 +351,7 @@ function List(props) {
|
|
350
351
|
}
|
351
352
|
return /*#__PURE__*/_jsx("div", {
|
352
353
|
className: disabledMode === 'hide' ? 'hide-disable-node' : '',
|
353
|
-
children: _treeData !== null && _treeData !== void 0 && _treeData.length ? /*#__PURE__*/_jsx(
|
354
|
+
children: _treeData !== null && _treeData !== void 0 && _treeData.length ? /*#__PURE__*/_jsx(_Tree, _objectSpread(_objectSpread(_objectSpread({}, others), additionProps), {}, {
|
354
355
|
disabled: disabled,
|
355
356
|
style: {
|
356
357
|
width: '100%'
|
package/es/ProTree/index.js
CHANGED
@@ -2,7 +2,7 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import ProTree from "./components/ProTree";
|
3
3
|
import ProTreeSelect from "./components/ProTreeSelect";
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
-
var ProTreeHandle =
|
5
|
+
var ProTreeHandle = props => {
|
6
6
|
var _props$mode = props.mode,
|
7
7
|
mode = _props$mode === void 0 ? 'tree' : _props$mode;
|
8
8
|
if (mode === 'treeSelect') {
|
package/es/ProTree/utils.js
CHANGED
@@ -1,6 +1,4 @@
|
|
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";
|
5
3
|
/* eslint-disable no-restricted-syntax */
|
6
4
|
|
@@ -54,14 +52,12 @@ export function getAllKeys(data, fieldNames) {
|
|
54
52
|
* @param fieldNames
|
55
53
|
* @returns
|
56
54
|
*/
|
57
|
-
export var getParentKey =
|
55
|
+
export var getParentKey = (key, tree, fieldNames) => {
|
58
56
|
var parentKey;
|
59
57
|
for (var i = 0; i < tree.length; i++) {
|
60
58
|
var node = tree[i];
|
61
59
|
if (node[fieldNames.children]) {
|
62
|
-
if (node[fieldNames.children].some(
|
63
|
-
return item[fieldNames.value] === key;
|
64
|
-
})) {
|
60
|
+
if (node[fieldNames.children].some(item => item[fieldNames.value] === key)) {
|
65
61
|
parentKey = node[fieldNames.value];
|
66
62
|
} else if (getParentKey(key, node[fieldNames.children], fieldNames)) {
|
67
63
|
parentKey = getParentKey(key, node[fieldNames.children], fieldNames);
|
@@ -72,9 +68,9 @@ export var getParentKey = function getParentKey(key, tree, fieldNames) {
|
|
72
68
|
};
|
73
69
|
export function findTreeNodeByKey(treeData, key, fieldNames) {
|
74
70
|
var result = [];
|
75
|
-
var traverse =
|
71
|
+
var traverse = (node, parents) => {
|
76
72
|
if (node[fieldNames.value] === key) {
|
77
|
-
result.push
|
73
|
+
result.push(node, ...parents);
|
78
74
|
return true;
|
79
75
|
}
|
80
76
|
var children = node[fieldNames.children] || [];
|
@@ -83,7 +79,7 @@ export function findTreeNodeByKey(treeData, key, fieldNames) {
|
|
83
79
|
try {
|
84
80
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
85
81
|
var child = _step.value;
|
86
|
-
if (traverse(child, [node]
|
82
|
+
if (traverse(child, [node, ...parents])) {
|
87
83
|
return true;
|
88
84
|
}
|
89
85
|
}
|
@@ -119,14 +115,16 @@ export function filterCheckedNodes(data, checkedKeys) {
|
|
119
115
|
var searchStr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
120
116
|
var fieldNames = arguments.length > 3 ? arguments[3] : undefined;
|
121
117
|
var result = [];
|
122
|
-
var traverse =
|
118
|
+
var traverse = node => {
|
123
119
|
var _node$fieldNames$chil3;
|
124
120
|
var title = node[fieldNames.value] + node[fieldNames.label];
|
125
121
|
if (!searchStr) {
|
126
122
|
if (checkedKeys.includes(node[fieldNames.value])) {
|
127
123
|
var _node$fieldNames$chil;
|
128
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)) || [];
|
129
|
-
return _objectSpread(_objectSpread({}, node), {},
|
125
|
+
return _objectSpread(_objectSpread({}, node), {}, {
|
126
|
+
[fieldNames.children]: _children
|
127
|
+
});
|
130
128
|
}
|
131
129
|
} else if ((title === null || title === void 0 ? void 0 : title.indexOf(searchStr)) > -1) {
|
132
130
|
var _node$fieldNames$chil2;
|
@@ -137,7 +135,9 @@ export function filterCheckedNodes(data, checkedKeys) {
|
|
137
135
|
}
|
138
136
|
var children = (_node$fieldNames$chil3 = node[fieldNames.children]) === null || _node$fieldNames$chil3 === void 0 ? void 0 : _node$fieldNames$chil3.map(traverse).filter(Boolean);
|
139
137
|
if (children && children.length > 0) {
|
140
|
-
return _objectSpread(_objectSpread({}, node), {},
|
138
|
+
return _objectSpread(_objectSpread({}, node), {}, {
|
139
|
+
[fieldNames.children]: children
|
140
|
+
});
|
141
141
|
}
|
142
142
|
return null;
|
143
143
|
};
|
@@ -171,7 +171,7 @@ export function getChildrenKeys(node, childrenKeys, fieldNames, type) {
|
|
171
171
|
// 当为 tree 触发 onChck 此时就是 key 为 children
|
172
172
|
if (type === 'treeCheck') {
|
173
173
|
var _node$children;
|
174
|
-
node === null || node === void 0 || (_node$children = node.children) === null || _node$children === void 0 || _node$children.forEach(
|
174
|
+
node === null || node === void 0 || (_node$children = node.children) === null || _node$children === void 0 || _node$children.forEach(item => {
|
175
175
|
childrenKeys.push(item.key);
|
176
176
|
if (item.children && item.children.length > 0) {
|
177
177
|
getChildrenKeys(item, childrenKeys, fieldNames, type);
|
@@ -180,7 +180,7 @@ export function getChildrenKeys(node, childrenKeys, fieldNames, type) {
|
|
180
180
|
} else {
|
181
181
|
var _node$fieldNames$chil4;
|
182
182
|
// 这个时候的值为我们的值
|
183
|
-
node === null || node === void 0 || (_node$fieldNames$chil4 = node[fieldNames.children]) === null || _node$fieldNames$chil4 === void 0 || _node$fieldNames$chil4.forEach(
|
183
|
+
node === null || node === void 0 || (_node$fieldNames$chil4 = node[fieldNames.children]) === null || _node$fieldNames$chil4 === void 0 || _node$fieldNames$chil4.forEach(item => {
|
184
184
|
childrenKeys.push(item[fieldNames.value]);
|
185
185
|
if (item[fieldNames.children] && item[fieldNames.children].length > 0) {
|
186
186
|
getChildrenKeys(item, childrenKeys, fieldNames, type);
|