@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,8 +1,13 @@
|
|
1
|
-
import
|
1
|
+
import "antd/es/spin/style";
|
2
|
+
import _Spin from "antd/es/spin";
|
3
|
+
import "antd/es/checkbox/style";
|
4
|
+
import _Checkbox from "antd/es/checkbox";
|
5
|
+
import "antd/es/input/style";
|
6
|
+
import _Input from "antd/es/input";
|
2
7
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
3
8
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
4
|
-
import
|
5
|
-
import
|
9
|
+
import "antd/es/message/style";
|
10
|
+
import _message from "antd/es/message";
|
6
11
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
7
12
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
8
13
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
@@ -11,7 +16,6 @@ import { useEffect } from 'react';
|
|
11
16
|
import classNames from 'classnames';
|
12
17
|
import { CaretDownOutlined, Loading3QuartersOutlined } from '@ant-design/icons';
|
13
18
|
import { useDeepCompareEffect, useSetState, useRequest as useRequestFunc } from 'ahooks';
|
14
|
-
import { Checkbox, Input, message, Spin } from 'antd';
|
15
19
|
import { cloneDeep, isFunction } from 'lodash';
|
16
20
|
import { ReactSVG } from 'react-svg';
|
17
21
|
import { useProConfig } from "../../ProConfigProvider";
|
@@ -22,7 +26,7 @@ import searchSVG from "../../assets/input-search.svg";
|
|
22
26
|
import "../style/index.less";
|
23
27
|
import { jsx as _jsx } from "react/jsx-runtime";
|
24
28
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
25
|
-
var ProTree =
|
29
|
+
var ProTree = props => {
|
26
30
|
var _props$otherProps, _props$otherProps2, _locale$ProTree, _state$innerExpandKey2, _state$innerExpandKey3, _locale$ProTree2, _locale$ProTree3, _locale$ProTree4;
|
27
31
|
var _useProConfig = useProConfig('ProEnum'),
|
28
32
|
_useProConfig$dics = _useProConfig.dics,
|
@@ -86,7 +90,7 @@ var ProTree = function ProTree(props) {
|
|
86
90
|
_useSetState2 = _slicedToArray(_useSetState, 2),
|
87
91
|
state = _useSetState2[0],
|
88
92
|
setState = _useSetState2[1];
|
89
|
-
useEffect(
|
93
|
+
useEffect(() => {
|
90
94
|
if (expandedKeys) {
|
91
95
|
setState({
|
92
96
|
innerExpandKeys: expandedKeys
|
@@ -95,7 +99,7 @@ var ProTree = function ProTree(props) {
|
|
95
99
|
}, [expandedKeys]);
|
96
100
|
var fetchFunction = useRequestFunc(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, _objectSpread({
|
97
101
|
manual: true,
|
98
|
-
onSuccess:
|
102
|
+
onSuccess: res => {
|
99
103
|
if (transformResponse && typeof transformResponse === 'function') {
|
100
104
|
var responseData = transformResponse(res);
|
101
105
|
var flatTrees = getFlatTreeData(responseData, fieldNames);
|
@@ -113,7 +117,7 @@ var ProTree = function ProTree(props) {
|
|
113
117
|
msg = res.message,
|
114
118
|
data = res.data;
|
115
119
|
if (status !== 200) {
|
116
|
-
|
120
|
+
_message.error(msg);
|
117
121
|
return;
|
118
122
|
}
|
119
123
|
var _flatTrees = getFlatTreeData(data, fieldNames);
|
@@ -129,7 +133,7 @@ var ProTree = function ProTree(props) {
|
|
129
133
|
},
|
130
134
|
debounceWait: 300
|
131
135
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options));
|
132
|
-
useDeepCompareEffect(
|
136
|
+
useDeepCompareEffect(() => {
|
133
137
|
if (dataSource && dataSource.length) {
|
134
138
|
var allKey = getAllKeys(dataSource, fieldNames);
|
135
139
|
setState({
|
@@ -160,7 +164,7 @@ var ProTree = function ProTree(props) {
|
|
160
164
|
});
|
161
165
|
}
|
162
166
|
}, [dataSource, enumCode]);
|
163
|
-
useDeepCompareEffect(
|
167
|
+
useDeepCompareEffect(() => {
|
164
168
|
if (enumCode || dataSource) {
|
165
169
|
return undefined;
|
166
170
|
}
|
@@ -174,7 +178,7 @@ var ProTree = function ProTree(props) {
|
|
174
178
|
// 执行用户配置的枚举服务,拉取枚举数据进行更新
|
175
179
|
fetchFunction.run(params);
|
176
180
|
}, [useRequest === null || useRequest === void 0 ? void 0 : useRequest.options]);
|
177
|
-
var handleSignalSelect =
|
181
|
+
var handleSignalSelect = value => {
|
178
182
|
var checkedValues = [];
|
179
183
|
var innerVal = value;
|
180
184
|
if (labelInValue) {
|
@@ -184,10 +188,10 @@ var ProTree = function ProTree(props) {
|
|
184
188
|
checkedValues = innerVal;
|
185
189
|
}
|
186
190
|
setState({
|
187
|
-
checkedValues
|
191
|
+
checkedValues
|
188
192
|
});
|
189
193
|
};
|
190
|
-
var handleCheckSelect =
|
194
|
+
var handleCheckSelect = allKeys => {
|
191
195
|
var checkedValues = [];
|
192
196
|
if (allValue && typeof value === 'string') {
|
193
197
|
// 如果value等于allValue那么全选中,否则选中value得值
|
@@ -200,26 +204,22 @@ var ProTree = function ProTree(props) {
|
|
200
204
|
var innerVal = value;
|
201
205
|
// 开启 labelInValue [{ label:xx, value: ""}] 形式、需要取出来 value
|
202
206
|
if (labelInValue) {
|
203
|
-
var isObjectArray = innerVal && innerVal.every(
|
204
|
-
return _typeof(element) === 'object' && element !== null;
|
205
|
-
});
|
207
|
+
var isObjectArray = innerVal && innerVal.every(element => typeof element === 'object' && element !== null);
|
206
208
|
if (!isObjectArray) {
|
207
209
|
console.error('Please enter an array object');
|
208
210
|
}
|
209
|
-
checkedValues = innerVal && innerVal.map(
|
210
|
-
return item[fieldNameValue];
|
211
|
-
});
|
211
|
+
checkedValues = innerVal && innerVal.map(item => item[fieldNameValue]);
|
212
212
|
} else {
|
213
213
|
// 复选,单纯value数组场景
|
214
214
|
checkedValues = innerVal;
|
215
215
|
}
|
216
216
|
}
|
217
217
|
setState({
|
218
|
-
checkedValues
|
218
|
+
checkedValues,
|
219
219
|
checkAll: checkedValues.length === allKeys.length
|
220
220
|
});
|
221
221
|
};
|
222
|
-
useEffect(
|
222
|
+
useEffect(() => {
|
223
223
|
if (value) {
|
224
224
|
var allKeys = state.allKeys;
|
225
225
|
if (!(other !== null && other !== void 0 && other.checkable)) {
|
@@ -240,41 +240,37 @@ var ProTree = function ProTree(props) {
|
|
240
240
|
/**
|
241
241
|
* 复选事件处理函数,全选事件处理函数
|
242
242
|
*/
|
243
|
-
var handleFinish =
|
243
|
+
var handleFinish = (allValue, checkAll, checkedValues, checkedNode) => {
|
244
244
|
if (disabled || isView) {
|
245
245
|
return null;
|
246
246
|
}
|
247
247
|
// 全选的时候返回 allValue 标记即可
|
248
248
|
setState({
|
249
|
-
checkedValues
|
249
|
+
checkedValues
|
250
250
|
});
|
251
251
|
if (allValue !== undefined && checkAll) {
|
252
252
|
onChange && onChange(allValue);
|
253
253
|
} else {
|
254
254
|
var values = checkedValues;
|
255
|
-
var options = state.flatTreeData.filter(
|
256
|
-
return values.includes(item[fieldNameValue]);
|
257
|
-
});
|
255
|
+
var options = state.flatTreeData.filter(item => values.includes(item[fieldNameValue]));
|
258
256
|
if (checkedNode) {
|
259
257
|
options = checkedNode;
|
260
258
|
delete options[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'];
|
261
259
|
}
|
262
260
|
if (labelInValue) {
|
263
|
-
values = state.flatTreeData.filter(
|
264
|
-
return values.includes(item[fieldNameValue]);
|
265
|
-
});
|
261
|
+
values = state.flatTreeData.filter(item => values.includes(item[fieldNameValue]));
|
266
262
|
}
|
267
263
|
onChange && onChange(values, options);
|
268
264
|
}
|
269
265
|
};
|
270
266
|
|
271
267
|
// 该方法只有复选框,在勾中checkbox后才会走到这个方法
|
272
|
-
var onCheck =
|
268
|
+
var onCheck = (checkedKeys, info) => {
|
273
269
|
var _info$node;
|
274
270
|
if (disabled || isView) {
|
275
271
|
return null;
|
276
272
|
}
|
277
|
-
var checkedValues =
|
273
|
+
var checkedValues = [...state.checkedValues];
|
278
274
|
var originalTreeData = state.originalTreeData;
|
279
275
|
|
280
276
|
// 此时应该取消掉自身并包含它所有的子集
|
@@ -283,29 +279,21 @@ var ProTree = function ProTree(props) {
|
|
283
279
|
// 2. 把所有的子节点也要取消
|
284
280
|
var childrenkeys = [];
|
285
281
|
getChildrenKeys(info.node, childrenkeys, fieldNames, 'treeCheck');
|
286
|
-
checkedValues = checkedValues.filter(
|
287
|
-
return !childrenkeys.includes(key);
|
288
|
-
});
|
282
|
+
checkedValues = checkedValues.filter(key => !childrenkeys.includes(key));
|
289
283
|
|
290
284
|
// 3. 取消父节点
|
291
285
|
var parentNodes = findTreeNodeByKey(originalTreeData, info.node.key, fieldNames);
|
292
|
-
var parentKeys = parentNodes.reduce(
|
293
|
-
|
294
|
-
}, []);
|
295
|
-
checkedValues = checkedValues.filter(function (key) {
|
296
|
-
return !parentKeys.includes(key);
|
297
|
-
});
|
286
|
+
var parentKeys = parentNodes.reduce((prev, curr) => prev.concat(curr[fieldNameValue]), []);
|
287
|
+
checkedValues = checkedValues.filter(key => !parentKeys.includes(key));
|
298
288
|
} else {
|
299
289
|
// checkStrictly 模式下取 checkedKeys.checked 或者自身的 key
|
300
290
|
if (checkStrictly) {
|
301
291
|
if (!info.checked) {
|
302
|
-
checkedValues = checkedValues.filter(
|
303
|
-
return key !== info.node.key;
|
304
|
-
});
|
292
|
+
checkedValues = checkedValues.filter(key => key !== info.node.key);
|
305
293
|
}
|
306
294
|
checkedKeys = checkedKeys.checked || [];
|
307
295
|
}
|
308
|
-
checkedKeys.forEach(
|
296
|
+
checkedKeys.forEach(key => {
|
309
297
|
var exist = checkedValues.includes(key);
|
310
298
|
if (info.checked && !exist) {
|
311
299
|
checkedValues.push(key);
|
@@ -317,9 +305,7 @@ var ProTree = function ProTree(props) {
|
|
317
305
|
checkAll: checkAllTemp
|
318
306
|
});
|
319
307
|
var checkNodeValue = info === null || info === void 0 || (_info$node = info.node) === null || _info$node === void 0 ? void 0 : _info$node[fieldNameValue];
|
320
|
-
var options = state.flatTreeData.filter(
|
321
|
-
return checkNodeValue === item[fieldNameValue];
|
322
|
-
});
|
308
|
+
var options = state.flatTreeData.filter(item => checkNodeValue === item[fieldNameValue]);
|
323
309
|
handleFinish(allValue, checkAllTemp, checkedValues, Array.isArray(options) ? options === null || options === void 0 ? void 0 : options[0] : options);
|
324
310
|
if (other !== null && other !== void 0 && other.onCheck) {
|
325
311
|
other.onCheck(checkedKeys, {
|
@@ -329,7 +315,7 @@ var ProTree = function ProTree(props) {
|
|
329
315
|
});
|
330
316
|
}
|
331
317
|
};
|
332
|
-
var onSearch =
|
318
|
+
var onSearch = e => {
|
333
319
|
var str = e.target.value;
|
334
320
|
setState({
|
335
321
|
searchStr: str
|
@@ -344,7 +330,7 @@ var ProTree = function ProTree(props) {
|
|
344
330
|
/**
|
345
331
|
* 全选操作,改变自身state并将值通过onchange上传到form
|
346
332
|
*/
|
347
|
-
var handleAllCheck =
|
333
|
+
var handleAllCheck = e => {
|
348
334
|
if (disabled || isView) {
|
349
335
|
return null;
|
350
336
|
}
|
@@ -386,13 +372,9 @@ var ProTree = function ProTree(props) {
|
|
386
372
|
});
|
387
373
|
case 7:
|
388
374
|
values = props;
|
389
|
-
options = state.flatTreeData.filter(
|
390
|
-
return values === item[fieldNameValue];
|
391
|
-
});
|
375
|
+
options = state.flatTreeData.filter(item => values === item[fieldNameValue]);
|
392
376
|
if (labelInValue) {
|
393
|
-
values = state.flatTreeData.filter(
|
394
|
-
return values === item[fieldNameValue];
|
395
|
-
});
|
377
|
+
values = state.flatTreeData.filter(item => values === item[fieldNameValue]);
|
396
378
|
}
|
397
379
|
option = (_options$ = options === null || options === void 0 ? void 0 : options[0]) !== null && _options$ !== void 0 ? _options$ : {};
|
398
380
|
delete option[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'];
|
@@ -412,11 +394,12 @@ var ProTree = function ProTree(props) {
|
|
412
394
|
return _ref2.apply(this, arguments);
|
413
395
|
};
|
414
396
|
}();
|
415
|
-
var boxClass = classNames(
|
397
|
+
var boxClass = classNames({
|
416
398
|
'pro-tree': true,
|
417
|
-
'footer-shadow': footer
|
418
|
-
|
419
|
-
|
399
|
+
'footer-shadow': footer,
|
400
|
+
[className]: className
|
401
|
+
});
|
402
|
+
var toggleExpand = () => {
|
420
403
|
var _state$innerExpandKey;
|
421
404
|
if (state !== null && state !== void 0 && (_state$innerExpandKey = state.innerExpandKeys) !== null && _state$innerExpandKey !== void 0 && _state$innerExpandKey.length) {
|
422
405
|
setState({
|
@@ -424,7 +407,7 @@ var ProTree = function ProTree(props) {
|
|
424
407
|
});
|
425
408
|
} else {
|
426
409
|
var expandKeys = [];
|
427
|
-
state === null || state === void 0 || state.flatTreeData.map(
|
410
|
+
state === null || state === void 0 || state.flatTreeData.map(item => {
|
428
411
|
var val = item[fieldNameValue];
|
429
412
|
expandKeys.push(val);
|
430
413
|
return item;
|
@@ -443,14 +426,14 @@ var ProTree = function ProTree(props) {
|
|
443
426
|
return /*#__PURE__*/_jsx("div", {
|
444
427
|
className: boxClass,
|
445
428
|
style: style,
|
446
|
-
children: /*#__PURE__*/_jsx(
|
429
|
+
children: /*#__PURE__*/_jsx(_Spin, {
|
447
430
|
spinning: state.clickShowLoading,
|
448
431
|
indicator: antIcon,
|
449
432
|
children: /*#__PURE__*/_jsxs("div", {
|
450
433
|
className: "pro-tree-content",
|
451
434
|
children: [/*#__PURE__*/_jsxs("div", {
|
452
435
|
className: "pro-tree-header-box",
|
453
|
-
children: [showSearch && /*#__PURE__*/_jsx(
|
436
|
+
children: [showSearch && /*#__PURE__*/_jsx(_Input, {
|
454
437
|
disabled: disabled,
|
455
438
|
allowClear: true,
|
456
439
|
value: state.searchStr,
|
@@ -467,7 +450,7 @@ var ProTree = function ProTree(props) {
|
|
467
450
|
className: "tree-title-text",
|
468
451
|
children: title
|
469
452
|
}), showExpand && /*#__PURE__*/_jsxs("div", {
|
470
|
-
className:
|
453
|
+
className: `expand-button ${state !== null && state !== void 0 && (_state$innerExpandKey2 = state.innerExpandKeys) !== null && _state$innerExpandKey2 !== void 0 && _state$innerExpandKey2.length ? 'expand' : ''}`,
|
471
454
|
onClick: toggleExpand,
|
472
455
|
children: [/*#__PURE__*/_jsx("div", {
|
473
456
|
className: "expand-icon",
|
@@ -498,7 +481,7 @@ var ProTree = function ProTree(props) {
|
|
498
481
|
className: allValue || footer ? 'pro-tree-footer-box' : '',
|
499
482
|
children: [/*#__PURE__*/_jsx("div", {
|
500
483
|
className: "check-all-box",
|
501
|
-
children: allValue !== undefined ? /*#__PURE__*/_jsx(
|
484
|
+
children: allValue !== undefined ? /*#__PURE__*/_jsx(_Checkbox, {
|
502
485
|
checked: state.checkAll,
|
503
486
|
disabled: disabled,
|
504
487
|
onChange: handleAllCheck,
|