@zat-design/sisyphus-react 4.0.0-beta.4 → 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/dist/index.esm.css +1 -0
- package/dist/index.min.js +1 -0
- package/dist/less.esm.css +1 -0
- 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/ProConfigProvider/index.js +31 -17
- package/es/ProDownload/index.js +13 -12
- 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 +6 -10
- 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/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 +40 -46
- 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/utils/config.js +29 -36
- package/es/ProEditTable/utils/diffOriginal.js +13 -13
- 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 +6 -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/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 +16 -13
- package/es/ProForm/components/base/Checkbox/index.js +10 -11
- package/es/ProForm/components/base/DatePicker/index.js +8 -7
- 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/TextArea/index.js +9 -8
- package/es/ProForm/components/base/TimePicker/index.js +5 -4
- package/es/ProForm/components/combination/Container/index.js +12 -12
- 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/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 +14 -14
- package/es/ProForm/components/combination/Group/hooks/index.d.ts +0 -1
- package/es/ProForm/components/combination/Group/hooks/index.js +30 -35
- package/es/ProForm/components/combination/Group/index.js +35 -29
- 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 +43 -52
- package/es/ProForm/components/combination/ProCascader/utils/index.js +3 -3
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +16 -16
- package/es/ProForm/components/combination/ProModalSelect/index.js +102 -108
- 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 +1 -1
- 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/render/ChangedWrapper.js +24 -26
- package/es/ProForm/components/render/ConfirmWrapper.js +10 -11
- package/es/ProForm/components/render/Render.js +107 -102
- package/es/ProForm/components/render/RenderFields.d.ts +0 -1
- package/es/ProForm/components/render/RenderFields.js +22 -24
- package/es/ProForm/index.js +44 -45
- package/es/ProForm/propsType.d.ts +1 -4
- package/es/ProForm/utils/diffOriginal.js +9 -9
- package/es/ProForm/utils/getDefaultProps.js +5 -5
- package/es/ProForm/utils/index.js +62 -90
- 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.js +79 -83
- 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/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 +19 -22
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +23 -30
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +3 -3
- package/es/ProLayout/components/Layout/Menu/index.js +9 -9
- package/es/ProLayout/components/Layout/Notice/index.js +3 -3
- package/es/ProLayout/components/ProCollapse/index.js +23 -18
- package/es/ProLayout/components/ProFooter/index.js +13 -14
- 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/index.js +68 -59
- package/es/ProLayout/components/ProHeader/utils/index.js +1 -1
- package/es/ProLayout/index.js +33 -32
- package/es/ProLayout/utils/index.js +17 -18
- package/es/ProSelect/components/AdaptiveTooltip.js +8 -9
- package/es/ProSelect/index.js +57 -64
- package/es/ProSelect/utils/index.js +17 -28
- package/es/ProStep/components/Anchor/index.js +10 -9
- package/es/ProStep/components/Item/index.js +11 -11
- 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/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.js +80 -95
- package/es/ProTable/index.js +110 -133
- package/es/ProTable/propsType.d.ts +9 -3
- 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 -3
- package/es/ProThemeTools/component/ProTools/index.js +46 -39
- package/es/ProThemeTools/context/ThemeContext.js +13 -13
- package/es/ProThemeTools/index.js +18 -19
- package/es/ProThemeTools/utils/index.js +14 -18
- package/es/ProTooltip/index.js +24 -27
- 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/Tree.js +23 -22
- package/es/ProTree/index.js +1 -1
- 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/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/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/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/base.less +1 -0
- package/es/utils/index.js +11 -13
- 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/propsType.js +4 -16
- package/lib/ProConfigProvider/index.js +136 -136
- package/lib/ProDownload/index.js +192 -124
- package/lib/ProDownload/propsType.js +4 -16
- 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 +79 -88
- package/lib/ProDrawerForm/propsType.js +4 -16
- 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/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 +177 -176
- 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.js +4 -16
- package/lib/ProEditTable/utils/config.js +225 -170
- package/lib/ProEditTable/utils/diffOriginal.js +93 -80
- 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 +72 -52
- 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/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 +67 -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 +63 -74
- 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/TextArea/index.js +52 -65
- package/lib/ProForm/components/base/TimePicker/index.js +45 -59
- 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/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/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 +78 -74
- package/lib/ProForm/components/combination/Group/hooks/index.d.ts +0 -1
- package/lib/ProForm/components/combination/Group/hooks/index.js +123 -123
- package/lib/ProForm/components/combination/Group/index.js +99 -104
- 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 +271 -226
- package/lib/ProForm/components/combination/ProCascader/propsType.js +4 -16
- package/lib/ProForm/components/combination/ProCascader/utils/index.js +23 -33
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +113 -114
- package/lib/ProForm/components/combination/ProModalSelect/index.js +651 -472
- package/lib/ProForm/components/combination/ProModalSelect/propsType.js +4 -16
- 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 +1 -1
- 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/index.js +192 -115
- package/lib/ProForm/components/render/ChangedWrapper.js +130 -141
- package/lib/ProForm/components/render/ConfirmWrapper.js +120 -78
- package/lib/ProForm/components/render/Render.js +445 -346
- package/lib/ProForm/components/render/RenderFields.d.ts +0 -1
- package/lib/ProForm/components/render/RenderFields.js +195 -181
- package/lib/ProForm/components/render/propsType.js +31 -17
- package/lib/ProForm/index.js +282 -235
- package/lib/ProForm/propsType.d.ts +1 -4
- package/lib/ProForm/propsType.js +9 -38
- package/lib/ProForm/utils/diffOriginal.js +88 -81
- 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.js +233 -126
- 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/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 +170 -139
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +135 -117
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/propsType.js +4 -16
- package/lib/ProLayout/components/Layout/Menu/SideMenu/index.js +44 -60
- package/lib/ProLayout/components/Layout/Menu/index.js +52 -71
- package/lib/ProLayout/components/Layout/Notice/index.js +31 -39
- package/lib/ProLayout/components/Layout/index.js +31 -45
- package/lib/ProLayout/components/ProCollapse/PropTypes.js +4 -16
- package/lib/ProLayout/components/ProCollapse/index.js +159 -148
- package/lib/ProLayout/components/ProFooter/PropTypes.js +4 -16
- package/lib/ProLayout/components/ProFooter/index.js +41 -56
- 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/index.js +17 -39
- package/lib/ProLayout/components/ProHeader/index.js +466 -268
- package/lib/ProLayout/components/ProHeader/utils/index.js +14 -31
- package/lib/ProLayout/components/index.js +24 -42
- package/lib/ProLayout/index.js +139 -130
- package/lib/ProLayout/propTypes.js +4 -16
- package/lib/ProLayout/utils/index.js +120 -86
- package/lib/ProSelect/components/AdaptiveTooltip.js +38 -45
- package/lib/ProSelect/index.js +240 -213
- package/lib/ProSelect/propsType.js +4 -16
- package/lib/ProSelect/utils/index.js +114 -93
- package/lib/ProStep/components/Anchor/index.js +102 -107
- package/lib/ProStep/components/Item/index.js +71 -75
- 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/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.js +351 -304
- package/lib/ProTable/index.js +354 -333
- package/lib/ProTable/propsType.d.ts +9 -3
- package/lib/ProTable/propsType.js +4 -16
- 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 -3
- 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.js +207 -172
- package/lib/ProThemeTools/propsType.js +4 -16
- package/lib/ProThemeTools/utils/index.js +84 -80
- package/lib/ProTooltip/index.js +217 -214
- package/lib/ProTooltip/propsType.js +4 -16
- 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/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/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/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/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/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/base.less +1 -0
- package/lib/tokens.js +87 -103
- package/lib/utils/index.js +66 -88
- package/package.json +7 -7
- package/dist/esm/index.d.ts +0 -5
- package/dist/esm/index.js +0 -5
- package/dist/esm/regExp/index.d.ts +0 -19
- package/dist/esm/regExp/index.js +0 -73
- package/dist/esm/tools/calc/index.d.ts +0 -4
- package/dist/esm/tools/calc/index.js +0 -67
- package/dist/esm/tools/dateUtils.d.ts +0 -7
- package/dist/esm/tools/dateUtils.js +0 -23
- package/dist/esm/tools/disableDate/index.d.ts +0 -9
- package/dist/esm/tools/disableDate/index.js +0 -43
- package/dist/esm/tools/disableTimeRange/index.d.ts +0 -9
- package/dist/esm/tools/disableTimeRange/index.js +0 -121
- package/dist/esm/tools/formatAmount/index.d.ts +0 -7
- package/dist/esm/tools/formatAmount/index.js +0 -14
- package/dist/esm/tools/formatPerMill/index.d.ts +0 -7
- package/dist/esm/tools/formatPerMill/index.js +0 -11
- package/dist/esm/tools/formatPercent/index.d.ts +0 -7
- package/dist/esm/tools/formatPercent/index.js +0 -11
- package/dist/esm/tools/getDataByIdCard/index.d.ts +0 -16
- package/dist/esm/tools/getDataByIdCard/index.js +0 -65
- package/dist/esm/tools/index.d.ts +0 -12
- package/dist/esm/tools/index.js +0 -14
- package/dist/esm/tools/sumAmount/index.d.ts +0 -16
- package/dist/esm/tools/sumAmount/index.js +0 -40
- package/dist/esm/tools/toChineseNum/index.d.ts +0 -7
- package/dist/esm/tools/toChineseNum/index.js +0 -103
- package/dist/esm/tools/toFixed/index.d.ts +0 -2
- package/dist/esm/tools/toFixed/index.js +0 -5
- package/dist/esm/tools/transformDataName/index.d.ts +0 -12
- package/dist/esm/tools/transformDataName/index.js +0 -37
- package/dist/esm/transforms/dateTransformer/index.d.ts +0 -24
- package/dist/esm/transforms/dateTransformer/index.js +0 -67
- package/dist/esm/transforms/index.d.ts +0 -6
- package/dist/esm/transforms/index.js +0 -6
- package/dist/esm/transforms/propTypes.d.ts +0 -7
- package/dist/esm/transforms/propTypes.js +0 -1
- package/dist/esm/transforms/transformDate/index.d.ts +0 -21
- package/dist/esm/transforms/transformDate/index.js +0 -141
- package/dist/esm/transforms/transformDatePicker/index.d.ts +0 -12
- package/dist/esm/transforms/transformDatePicker/index.js +0 -24
- package/dist/esm/transforms/transformRangePicker/index.d.ts +0 -29
- package/dist/esm/transforms/transformRangePicker/index.js +0 -61
- package/dist/esm/transforms/transformSwitch/index.d.ts +0 -13
- package/dist/esm/transforms/transformSwitch/index.js +0 -35
- package/dist/esm/transforms/utils.d.ts +0 -2
- package/dist/esm/transforms/utils.js +0 -8
- package/dist/esm/validate/index.d.ts +0 -107
- package/dist/esm/validate/index.js +0 -284
- package/tests/__mocks__/fileMock.js +0 -1
- package/tests/__mocks__/zatUtils.js +0 -27
- package/tests/setup.ts +0 -484
- package/tests/test-utils.tsx +0 -81
@@ -10,7 +10,7 @@ var defaultPage = {
|
|
10
10
|
pageNum: 1,
|
11
11
|
pageSize: 10
|
12
12
|
};
|
13
|
-
var useDefaultOptions =
|
13
|
+
var useDefaultOptions = options => {
|
14
14
|
var _options$withPaginati;
|
15
15
|
var customizePage = options === null || options === void 0 ? void 0 : options.customizePage;
|
16
16
|
var _useState = useState(customizePage || defaultPage),
|
@@ -57,7 +57,7 @@ export function useRequestList(service, options, useRequestOptions) {
|
|
57
57
|
setSearchValues = _useState4[1];
|
58
58
|
|
59
59
|
// 当次执行service的请求,包括page参数
|
60
|
-
var params = useMemo(
|
60
|
+
var params = useMemo(() => {
|
61
61
|
var _condition = _objectSpread(_objectSpread({}, _defaultParams), searchValues);
|
62
62
|
var tempParams = withPagination ? _objectSpread(_objectSpread({}, page), {}, {
|
63
63
|
queryBean: _condition !== null && _condition !== void 0 ? _condition : {}
|
@@ -75,26 +75,26 @@ export function useRequestList(service, options, useRequestOptions) {
|
|
75
75
|
|
76
76
|
// 搜索条件变化时触发
|
77
77
|
var prevParams = usePrevious(params);
|
78
|
-
var _useDebounceFn = useDebounceFn(
|
78
|
+
var _useDebounceFn = useDebounceFn(() => {
|
79
79
|
run(params);
|
80
80
|
}, {
|
81
81
|
wait: 300
|
82
82
|
}),
|
83
83
|
queryList = _useDebounceFn.run;
|
84
|
-
useEffect(
|
84
|
+
useEffect(() => {
|
85
85
|
if (prevParams && !isEqual(prevParams, params)) {
|
86
86
|
queryList();
|
87
87
|
}
|
88
88
|
}, [params, prevParams, queryList]);
|
89
89
|
|
90
90
|
// 分页变更
|
91
|
-
var onChange = useCallback(
|
91
|
+
var onChange = useCallback((current, pageSize) => {
|
92
92
|
onPageChange({
|
93
93
|
pageNum: current,
|
94
|
-
pageSize
|
94
|
+
pageSize
|
95
95
|
});
|
96
96
|
}, [onPageChange]);
|
97
|
-
var onSearch = useCallback(
|
97
|
+
var onSearch = useCallback(values => {
|
98
98
|
if (!isEqual(searchValues, values)) {
|
99
99
|
onChange(defaultPage.pageNum, defaultPage.pageSize);
|
100
100
|
setSearchValues(values);
|
@@ -102,10 +102,10 @@ export function useRequestList(service, options, useRequestOptions) {
|
|
102
102
|
}, [onChange, searchValues]);
|
103
103
|
|
104
104
|
// 重置查询条件
|
105
|
-
var onReset = useCallback(
|
105
|
+
var onReset = useCallback(() => {
|
106
106
|
onSearch({});
|
107
107
|
}, [onSearch]);
|
108
|
-
var dataSource = useMemo(
|
108
|
+
var dataSource = useMemo(() => {
|
109
109
|
if (data) {
|
110
110
|
var _data$data;
|
111
111
|
if (transformResponse) {
|
@@ -117,28 +117,28 @@ export function useRequestList(service, options, useRequestOptions) {
|
|
117
117
|
return [];
|
118
118
|
}, [data, transformResponse, withPagination]);
|
119
119
|
return _objectSpread(_objectSpread({}, result), {}, {
|
120
|
-
loading
|
120
|
+
loading,
|
121
121
|
data: dataSource,
|
122
|
-
onReset
|
123
|
-
onSearch
|
124
|
-
params
|
122
|
+
onReset,
|
123
|
+
onSearch,
|
124
|
+
params,
|
125
125
|
pagination: withPagination ? {
|
126
126
|
current: page.pageNum,
|
127
127
|
pageSize: page.pageSize,
|
128
128
|
onPaginationChange: true,
|
129
129
|
total: data === null || data === void 0 || (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : _data$data2.total,
|
130
|
-
onChange
|
130
|
+
onChange,
|
131
131
|
pageSizeOptions: [10, 20, 50, 100],
|
132
132
|
showQuickJumper: true,
|
133
133
|
showSizeChanger: true,
|
134
134
|
onShowSizeChange: onChange,
|
135
135
|
hideOnSinglePage: page.pageSize === 10,
|
136
136
|
// 只有一页时隐藏分页器
|
137
|
-
showTotal:
|
137
|
+
showTotal: total => {
|
138
138
|
var _locale$ProEditTable;
|
139
139
|
if (!total) return;
|
140
140
|
return formatMessage(locale === null || locale === void 0 || (_locale$ProEditTable = locale.ProEditTable) === null || _locale$ProEditTable === void 0 ? void 0 : _locale$ProEditTable.total, {
|
141
|
-
total
|
141
|
+
total
|
142
142
|
});
|
143
143
|
}
|
144
144
|
} : false
|
@@ -1,16 +1,27 @@
|
|
1
|
-
import
|
2
|
-
import
|
1
|
+
import "antd/es/space/style";
|
2
|
+
import _Space from "antd/es/space";
|
3
|
+
import "antd/es/button/style";
|
4
|
+
import _Button from "antd/es/button";
|
5
|
+
import "antd/es/tooltip/style";
|
6
|
+
import _Tooltip from "antd/es/tooltip";
|
7
|
+
import "antd/es/input/style";
|
8
|
+
import _Input from "antd/es/input";
|
9
|
+
import "antd/es/spin/style";
|
10
|
+
import _Spin from "antd/es/spin";
|
11
|
+
import "antd/es/message/style";
|
12
|
+
import _message from "antd/es/message";
|
3
13
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
4
14
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
5
15
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
6
16
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
17
|
+
import "antd/es/form/style";
|
18
|
+
import _Form from "antd/es/form";
|
7
19
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
8
20
|
var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "mode", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "afterOpen", "isTooltip", "tooltip", "searchForm", "searchKey", "defaultOne", "otherProps"],
|
9
21
|
_excluded2 = ["onOk"],
|
10
22
|
_excluded3 = ["rowKey", "columns", "rowSelection"];
|
11
23
|
import { SearchOutlined } from '@ant-design/icons';
|
12
24
|
import { useDebounceEffect, useDeepCompareEffect, useMount, useSetState } from 'ahooks';
|
13
|
-
import { Form, message, Input, Tooltip, Space, Button, Spin } from 'antd';
|
14
25
|
import { debounce, isArray, isBoolean, isEqual, isFunction, isObject } from 'lodash';
|
15
26
|
import classNames from 'classnames';
|
16
27
|
import { ReactSVG } from 'react-svg';
|
@@ -24,7 +35,7 @@ import { hideTooltipIfOpen } from "./utils";
|
|
24
35
|
import { jsx as _jsx } from "react/jsx-runtime";
|
25
36
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
26
37
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
27
|
-
var ProModalSelect =
|
38
|
+
var ProModalSelect = (props, ref) => {
|
28
39
|
var _useRequest$options, _useRequest$options2, _useRequest$options3, _formColumns$;
|
29
40
|
var value = props.value,
|
30
41
|
onChange = props.onChange,
|
@@ -55,13 +66,13 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
55
66
|
otherProps = props.otherProps,
|
56
67
|
restProps = _objectWithoutProperties(props, _excluded);
|
57
68
|
var _tooltip = tooltip !== null && tooltip !== void 0 ? tooltip : isTooltip;
|
58
|
-
var nextMode = useMemo(
|
69
|
+
var nextMode = useMemo(() => {
|
59
70
|
if (isBoolean(readOnly) && readOnly === false) {
|
60
71
|
return 'input';
|
61
72
|
}
|
62
73
|
return mode;
|
63
74
|
}, [mode, readOnly]);
|
64
|
-
var contentForm =
|
75
|
+
var contentForm = _Form.useFormInstance();
|
65
76
|
if (!configOption || Object.prototype.toString.call(configOption) !== '[object Object]') {
|
66
77
|
throw new Error('error: 请检查枚举选择弹框的配置项【configOption】');
|
67
78
|
}
|
@@ -136,18 +147,18 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
136
147
|
_selectedRows = _useSetState2$.selectedRows,
|
137
148
|
_selectedRowKeys = _useSetState2$.selectedRowKeys,
|
138
149
|
setState = _useSetState2[1];
|
139
|
-
var _Form$useForm =
|
150
|
+
var _Form$useForm = _Form.useForm(searchForm),
|
140
151
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
141
152
|
form = _Form$useForm2[0];
|
142
153
|
var selectedRows = (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRows) || _selectedRows;
|
143
154
|
var selectedRowKeys = (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || _selectedRowKeys;
|
144
155
|
var _useRequestList = useRequestList(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, {
|
145
|
-
withPagination
|
146
|
-
transformParams
|
147
|
-
transformResponse
|
156
|
+
withPagination,
|
157
|
+
transformParams,
|
158
|
+
transformResponse
|
148
159
|
}, _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
|
149
160
|
manual: true,
|
150
|
-
onSuccess
|
161
|
+
onSuccess(res) {
|
151
162
|
var _res$data, _ref5;
|
152
163
|
var list = withPagination ? res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list : res === null || res === void 0 ? void 0 : res.data;
|
153
164
|
setState({
|
@@ -157,7 +168,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
157
168
|
})),
|
158
169
|
run = _useRequestList.run,
|
159
170
|
selectLoading = _useRequestList.loading;
|
160
|
-
var initParams = useMemo(
|
171
|
+
var initParams = useMemo(() => {
|
161
172
|
var nextInitParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams;
|
162
173
|
if (typeof (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) === 'function') {
|
163
174
|
var _contentForm$getField;
|
@@ -166,9 +177,9 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
166
177
|
return nextInitParams;
|
167
178
|
}, [value]);
|
168
179
|
var _useRequestList2 = useRequestList(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, {
|
169
|
-
withPagination
|
170
|
-
transformParams
|
171
|
-
transformResponse
|
180
|
+
withPagination,
|
181
|
+
transformParams,
|
182
|
+
transformResponse
|
172
183
|
}, _objectSpread({
|
173
184
|
ready: (initParams || defaultOne) && nextMode === 'input' || open
|
174
185
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options)),
|
@@ -179,15 +190,13 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
179
190
|
onReset = _useRequestList2.onReset,
|
180
191
|
runAsync = _useRequestList2.runAsync,
|
181
192
|
mutate = _useRequestList2.mutate;
|
182
|
-
var defaultOptionRender =
|
183
|
-
return rowData === null || rowData === void 0 ? void 0 : rowData[labelKey];
|
184
|
-
};
|
193
|
+
var defaultOptionRender = rowData => rowData === null || rowData === void 0 ? void 0 : rowData[labelKey];
|
185
194
|
var handleFormat = onFormat || defaultOptionRender;
|
186
195
|
if (showCodeName) {
|
187
|
-
handleFormat =
|
196
|
+
handleFormat = _ref6 => {
|
188
197
|
var value = _ref6.value,
|
189
198
|
label = _ref6.label;
|
190
|
-
return
|
199
|
+
return `${value}-${label}`;
|
191
200
|
};
|
192
201
|
}
|
193
202
|
|
@@ -197,7 +206,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
197
206
|
* @param {any} data 当前选中的值 labelInValue模式下为选中行对象,单值模式为value值
|
198
207
|
* @returns {any}
|
199
208
|
*/
|
200
|
-
var formatValue =
|
209
|
+
var formatValue = data => {
|
201
210
|
var _data$map;
|
202
211
|
if (typeof data === 'string' || typeof data === 'number') {
|
203
212
|
return data;
|
@@ -208,22 +217,20 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
208
217
|
label: data[labelKey]
|
209
218
|
}));
|
210
219
|
}
|
211
|
-
return isArray(data) ? data === null || data === void 0 || (_data$map = data.map(
|
220
|
+
return isArray(data) ? data === null || data === void 0 || (_data$map = data.map(item => {
|
212
221
|
return handleFormat(_objectSpread(_objectSpread({}, item), {}, {
|
213
222
|
value: item[valueKey],
|
214
223
|
label: item[labelKey]
|
215
224
|
}));
|
216
225
|
})) === null || _data$map === void 0 ? void 0 : _data$map.join(',') : '';
|
217
226
|
};
|
218
|
-
var viewText = useMemo(
|
227
|
+
var viewText = useMemo(() => {
|
219
228
|
var nextValue = labelInValue ? value : _value;
|
220
229
|
if (labelInValue) {
|
221
230
|
nextValue = value;
|
222
231
|
} else {
|
223
232
|
var _options$find;
|
224
|
-
var optionDTO = options === null || options === void 0 || (_options$find = options.find) === null || _options$find === void 0 ? void 0 : _options$find.call(options,
|
225
|
-
return item[valueKey] === value;
|
226
|
-
});
|
233
|
+
var optionDTO = options === null || options === void 0 || (_options$find = options.find) === null || _options$find === void 0 ? void 0 : _options$find.call(options, item => item[valueKey] === value);
|
227
234
|
if (optionDTO) {
|
228
235
|
nextValue = optionDTO;
|
229
236
|
} else {
|
@@ -239,7 +246,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
239
246
|
* @param {any} record 表格行数据
|
240
247
|
* @returns {any}
|
241
248
|
*/
|
242
|
-
var getRowKey =
|
249
|
+
var getRowKey = record => {
|
243
250
|
if (isFunction(rowKey)) {
|
244
251
|
return rowKey(record);
|
245
252
|
}
|
@@ -252,15 +259,13 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
252
259
|
* @param {any} selectedRows 选中行数据
|
253
260
|
* @returns {any}
|
254
261
|
*/
|
255
|
-
var getNextValues =
|
262
|
+
var getNextValues = selectedRows => {
|
256
263
|
if (isMultiple) {
|
257
|
-
return selectedRows.map(
|
258
|
-
return item === null || item === void 0 ? void 0 : item[valueKey];
|
259
|
-
});
|
264
|
+
return selectedRows.map(item => item === null || item === void 0 ? void 0 : item[valueKey]);
|
260
265
|
}
|
261
266
|
return selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows[valueKey];
|
262
267
|
};
|
263
|
-
var handleChangeValue =
|
268
|
+
var handleChangeValue = e => {
|
264
269
|
onChange(e.target.value);
|
265
270
|
preValue.current = e.target.value;
|
266
271
|
if (nextMode === 'input') {
|
@@ -269,7 +274,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
269
274
|
});
|
270
275
|
}
|
271
276
|
};
|
272
|
-
var handleSelectValue =
|
277
|
+
var handleSelectValue = (val, option) => {
|
273
278
|
onChange(val, option);
|
274
279
|
preValue.current = val;
|
275
280
|
};
|
@@ -309,7 +314,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
309
314
|
setState({
|
310
315
|
onOff: true
|
311
316
|
});
|
312
|
-
setTimeout(
|
317
|
+
setTimeout(() => {
|
313
318
|
afterOpen === null || afterOpen === void 0 || afterOpen({
|
314
319
|
setInnerState: setState
|
315
320
|
});
|
@@ -325,7 +330,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
325
330
|
return _ref7.apply(this, arguments);
|
326
331
|
};
|
327
332
|
}();
|
328
|
-
var handleClose =
|
333
|
+
var handleClose = () => {
|
329
334
|
var _useRequest$options4;
|
330
335
|
form.resetFields();
|
331
336
|
setState({
|
@@ -336,9 +341,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
336
341
|
|
337
342
|
// 当设置manual为true时,清空当前弹框内已搜索出来的值
|
338
343
|
if (useRequest !== null && useRequest !== void 0 && (_useRequest$options4 = useRequest.options) !== null && _useRequest$options4 !== void 0 && _useRequest$options4.manual) {
|
339
|
-
mutate(
|
340
|
-
return [];
|
341
|
-
});
|
344
|
+
mutate(() => []);
|
342
345
|
}
|
343
346
|
};
|
344
347
|
var handleFinish = /*#__PURE__*/function () {
|
@@ -352,14 +355,12 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
352
355
|
_context2.next = 4;
|
353
356
|
break;
|
354
357
|
}
|
355
|
-
|
358
|
+
_message.error(locale.ProModalSelect.checkMsg);
|
356
359
|
return _context2.abrupt("return", false);
|
357
360
|
case 4:
|
358
361
|
nextSelectedRows = selectedRows;
|
359
362
|
if (!((_nextSelectedRows = nextSelectedRows) !== null && _nextSelectedRows !== void 0 && _nextSelectedRows[0])) {
|
360
|
-
nextSelectedRows = data.filter(
|
361
|
-
return selectedRowKeys.includes(item[valueKey]);
|
362
|
-
});
|
363
|
+
nextSelectedRows = data.filter(item => selectedRowKeys.includes(item[valueKey]));
|
363
364
|
}
|
364
365
|
record = isMultiple ? nextSelectedRows : (_nextSelectedRows2 = nextSelectedRows) === null || _nextSelectedRows2 === void 0 ? void 0 : _nextSelectedRows2[0];
|
365
366
|
if (!isMultiple) {
|
@@ -431,39 +432,33 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
431
432
|
};
|
432
433
|
}();
|
433
434
|
var _rowSelection = _objectSpread({
|
434
|
-
type
|
435
|
-
onChange:
|
435
|
+
type,
|
436
|
+
onChange: (rowKeys, rows) => {
|
436
437
|
setState({
|
437
438
|
selectedRowKeys: rowKeys,
|
438
439
|
selectedRows: rows
|
439
440
|
});
|
440
441
|
},
|
441
|
-
getCheckboxProps:
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
selectedRowKeys: selectedRowKeys,
|
447
|
-
selectedRows: selectedRows
|
442
|
+
getCheckboxProps: record => ({
|
443
|
+
disabled: record === null || record === void 0 ? void 0 : record.disabled
|
444
|
+
}),
|
445
|
+
selectedRowKeys,
|
446
|
+
selectedRows
|
448
447
|
}, rowSelection);
|
449
448
|
|
450
449
|
// 点击行进行勾选
|
451
|
-
var handleClickRow =
|
450
|
+
var handleClickRow = record => {
|
452
451
|
var _rowSelection$getChec;
|
453
452
|
if (_rowSelection !== null && _rowSelection !== void 0 && (_rowSelection$getChec = _rowSelection.getCheckboxProps) !== null && _rowSelection$getChec !== void 0 && (_rowSelection$getChec = _rowSelection$getChec.call(_rowSelection, record)) !== null && _rowSelection$getChec !== void 0 && _rowSelection$getChec.disabled) {
|
454
453
|
return;
|
455
454
|
}
|
456
455
|
if (record !== null && record !== void 0 && record.disabled) return;
|
457
456
|
var selectedValue = getRowKey(record);
|
458
|
-
var tempSelectedRows =
|
459
|
-
var tempSelectedRowKeys =
|
457
|
+
var tempSelectedRows = [...selectedRows];
|
458
|
+
var tempSelectedRowKeys = [...selectedRowKeys];
|
460
459
|
if (isMultiple) {
|
461
|
-
var rowIndex = tempSelectedRows.findIndex(
|
462
|
-
|
463
|
-
});
|
464
|
-
var rowKeyIndex = tempSelectedRowKeys.findIndex(function (item) {
|
465
|
-
return item === selectedValue;
|
466
|
-
});
|
460
|
+
var rowIndex = tempSelectedRows.findIndex(item => getRowKey(item) === selectedValue);
|
461
|
+
var rowKeyIndex = tempSelectedRowKeys.findIndex(item => item === selectedValue);
|
467
462
|
if (rowKeyIndex > -1) {
|
468
463
|
tempSelectedRows.splice(rowIndex, 1);
|
469
464
|
tempSelectedRowKeys.splice(rowKeyIndex, 1);
|
@@ -575,12 +570,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
575
570
|
onChange(_data2);
|
576
571
|
preValue.current = _data2;
|
577
572
|
} else {
|
578
|
-
onChange(isMultiple ? _data2.map(
|
579
|
-
|
580
|
-
}) : _data2[valueKey]);
|
581
|
-
preValue.current = isMultiple ? _data2.map(function (item) {
|
582
|
-
return item[valueKey];
|
583
|
-
}) : _data2[valueKey];
|
573
|
+
onChange(isMultiple ? _data2.map(item => item[valueKey]) : _data2[valueKey]);
|
574
|
+
preValue.current = isMultiple ? _data2.map(item => item[valueKey]) : _data2[valueKey];
|
584
575
|
}
|
585
576
|
// 更新内部展示值
|
586
577
|
setState({
|
@@ -600,13 +591,11 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
600
591
|
return _ref11.apply(this, arguments);
|
601
592
|
};
|
602
593
|
}();
|
603
|
-
useImperativeHandle(ref,
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
});
|
609
|
-
useMount(function () {
|
594
|
+
useImperativeHandle(ref, () => ({
|
595
|
+
handleClick,
|
596
|
+
handleSearch
|
597
|
+
}));
|
598
|
+
useMount(() => {
|
610
599
|
if (!value) {
|
611
600
|
setState({
|
612
601
|
selectedRowKeys: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || [],
|
@@ -620,7 +609,10 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
620
609
|
_value: value
|
621
610
|
});
|
622
611
|
} else if (isObject(value)) {
|
623
|
-
var initialValue =
|
612
|
+
var initialValue = {
|
613
|
+
[valueKey]: value[valueKey],
|
614
|
+
[labelKey]: value[labelKey]
|
615
|
+
};
|
624
616
|
setState({
|
625
617
|
selectedRowKeys: [value],
|
626
618
|
selectedRows: [initialValue],
|
@@ -628,7 +620,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
628
620
|
});
|
629
621
|
}
|
630
622
|
});
|
631
|
-
useEffect(
|
623
|
+
useEffect(() => {
|
632
624
|
if (onOff && !open) {
|
633
625
|
var _useRequest$options7;
|
634
626
|
if ((useRequest === null || useRequest === void 0 || (_useRequest$options7 = useRequest.options) === null || _useRequest$options7 === void 0 ? void 0 : _useRequest$options7.manual) !== true) {
|
@@ -647,9 +639,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
647
639
|
nextState.selectedRows = [value];
|
648
640
|
}
|
649
641
|
if (isArray(value)) {
|
650
|
-
nextState.selectedRowKeys = value.map(
|
651
|
-
return getRowKey(item);
|
652
|
-
});
|
642
|
+
nextState.selectedRowKeys = value.map(item => getRowKey(item));
|
653
643
|
nextState.selectedRows = value;
|
654
644
|
}
|
655
645
|
} else if (value) {
|
@@ -657,53 +647,55 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
657
647
|
var nextSelectedRowKeys = isMultiple ? value : [value];
|
658
648
|
nextState.selectedRowKeys = nextSelectedRowKeys;
|
659
649
|
var list = options !== null && options !== void 0 ? options : data;
|
660
|
-
nextState.selectedRows = list === null || list === void 0 || (_list$filter = list.filter) === null || _list$filter === void 0 ? void 0 : _list$filter.call(list,
|
650
|
+
nextState.selectedRows = list === null || list === void 0 || (_list$filter = list.filter) === null || _list$filter === void 0 ? void 0 : _list$filter.call(list, item => {
|
661
651
|
return nextSelectedRowKeys.includes(item[valueKey]);
|
662
652
|
});
|
663
653
|
}
|
664
654
|
setState(nextState);
|
665
655
|
}
|
666
656
|
}, [onOff, open, JSON.stringify(value)]);
|
667
|
-
useEffect(
|
657
|
+
useEffect(() => {
|
668
658
|
hideTooltipIfOpen(fieldRef.current, open);
|
669
659
|
}, [open]);
|
670
|
-
useEffect(
|
660
|
+
useEffect(() => {
|
671
661
|
if (value && !open && isInit && nextMode === 'input') {
|
672
662
|
getInitValues();
|
673
663
|
}
|
674
664
|
}, [JSON.stringify(value), open, isInit]);
|
675
|
-
useDebounceEffect(
|
665
|
+
useDebounceEffect(() => {
|
676
666
|
if (value && !open && nextMode === 'select' && (!isEqual(value, preValue.current) || (options === null || options === void 0 ? void 0 : options.length) === 0)) {
|
677
667
|
var _options$some;
|
678
668
|
preValue.current = value;
|
679
669
|
var _data3 = labelInValue ? value[valueKey] : value;
|
680
|
-
var isHasValue = options === null || options === void 0 || (_options$some = options.some) === null || _options$some === void 0 ? void 0 : _options$some.call(options,
|
681
|
-
return item[valueKey] === _data3;
|
682
|
-
});
|
670
|
+
var isHasValue = options === null || options === void 0 || (_options$some = options.some) === null || _options$some === void 0 ? void 0 : _options$some.call(options, item => item[valueKey] === _data3);
|
683
671
|
if (isHasValue) {
|
684
672
|
return;
|
685
673
|
}
|
686
674
|
if (useRequest) {
|
687
675
|
// 加定时器 修复依赖数据同步更新未取到问题
|
688
|
-
setTimeout(
|
676
|
+
setTimeout(() => {
|
689
677
|
var params = withPagination ? {
|
690
678
|
pageNum: 1,
|
691
679
|
pageSize: 50,
|
692
|
-
queryBean: _objectSpread(_objectSpread(_objectSpread({}, defaultParams), initParams), {},
|
693
|
-
|
680
|
+
queryBean: _objectSpread(_objectSpread(_objectSpread({}, defaultParams), initParams), {}, {
|
681
|
+
[searchKey !== null && searchKey !== void 0 ? searchKey : valueKey]: _data3
|
682
|
+
})
|
683
|
+
} : _objectSpread(_objectSpread(_objectSpread({}, defaultParams), initParams), {}, {
|
684
|
+
[searchKey !== null && searchKey !== void 0 ? searchKey : valueKey]: _data3
|
685
|
+
});
|
694
686
|
var nextParams = transformParams ? transformParams(params) : params;
|
695
687
|
run(nextParams);
|
696
688
|
}, 300);
|
697
689
|
}
|
698
690
|
}
|
699
691
|
}, [JSON.stringify(value), open, JSON.stringify(defaultParams), JSON.stringify(initParams), options === null || options === void 0 ? void 0 : options.length]);
|
700
|
-
var handleSelectFocus =
|
692
|
+
var handleSelectFocus = () => {
|
701
693
|
if (useRequest) {
|
702
694
|
var queryBean = defaultParams || {};
|
703
695
|
var params = withPagination ? {
|
704
696
|
pageNum: 1,
|
705
697
|
pageSize: 50,
|
706
|
-
queryBean
|
698
|
+
queryBean
|
707
699
|
} : queryBean;
|
708
700
|
var nextParams = transformParams ? transformParams(params) : params;
|
709
701
|
// 减少请求条件一致时,且请求过时,focus的重复请求
|
@@ -716,19 +708,21 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
716
708
|
});
|
717
709
|
}
|
718
710
|
};
|
719
|
-
var handleSelectSearch = debounce(
|
711
|
+
var handleSelectSearch = debounce(val => {
|
720
712
|
if (useRequest) {
|
721
|
-
var queryBean = _objectSpread(_objectSpread({}, defaultParams), {},
|
713
|
+
var queryBean = _objectSpread(_objectSpread({}, defaultParams), {}, {
|
714
|
+
[searchKey !== null && searchKey !== void 0 ? searchKey : labelKey]: val
|
715
|
+
});
|
722
716
|
var params = withPagination ? {
|
723
717
|
pageNum: 1,
|
724
718
|
pageSize: 50,
|
725
|
-
queryBean
|
719
|
+
queryBean
|
726
720
|
} : queryBean;
|
727
721
|
var nextParams = transformParams ? transformParams(params) : params;
|
728
722
|
run(nextParams);
|
729
723
|
}
|
730
724
|
}, 1000);
|
731
|
-
useDebounceEffect(
|
725
|
+
useDebounceEffect(() => {
|
732
726
|
if (!value) {
|
733
727
|
if (defaultOne) {
|
734
728
|
getDefaultOneValues();
|
@@ -759,7 +753,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
759
753
|
}, [value, _value]);
|
760
754
|
|
761
755
|
// 加个中间状态Input
|
762
|
-
var initRender = /*#__PURE__*/_jsxs(
|
756
|
+
var initRender = /*#__PURE__*/_jsxs(_Space.Compact, {
|
763
757
|
style: {
|
764
758
|
width: '100%'
|
765
759
|
},
|
@@ -775,7 +769,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
775
769
|
optionRender: optionRender,
|
776
770
|
scrollFollowParent: false,
|
777
771
|
mode: isMultiple ? 'multiple' : undefined,
|
778
|
-
notFoundContent: selectLoading ? /*#__PURE__*/_jsx(
|
772
|
+
notFoundContent: selectLoading ? /*#__PURE__*/_jsx(_Spin, {
|
779
773
|
size: "small"
|
780
774
|
}) : null,
|
781
775
|
onFocus: handleSelectFocus,
|
@@ -784,17 +778,17 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
784
778
|
style: {
|
785
779
|
width: isView || disabled ? '100%' : 'calc(100% - 30px)'
|
786
780
|
}
|
787
|
-
}, restProps)) : /*#__PURE__*/_jsx(
|
781
|
+
}, restProps)) : /*#__PURE__*/_jsx(_Tooltip, {
|
788
782
|
title: _tooltip ? viewText : null,
|
789
783
|
placement: "topLeft",
|
790
|
-
children: /*#__PURE__*/_jsx(
|
784
|
+
children: /*#__PURE__*/_jsx(_Input, _objectSpread({
|
791
785
|
value: viewText,
|
792
786
|
onChange: handleChangeValue,
|
793
787
|
disabled: disabled,
|
794
788
|
autoComplete: "off",
|
795
789
|
allowClear: true
|
796
790
|
}, restProps))
|
797
|
-
}), isView || disabled ? null : /*#__PURE__*/_jsx(
|
791
|
+
}), isView || disabled ? null : /*#__PURE__*/_jsx(_Button, {
|
798
792
|
onClick: handleClick,
|
799
793
|
icon: /*#__PURE__*/_jsx(ReactSVG, {
|
800
794
|
className: "viewSvg",
|
@@ -809,7 +803,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
809
803
|
children: customRender
|
810
804
|
});
|
811
805
|
}
|
812
|
-
useDeepCompareEffect(
|
806
|
+
useDeepCompareEffect(() => {
|
813
807
|
setState({
|
814
808
|
options: (tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource) || []
|
815
809
|
});
|
@@ -835,12 +829,14 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
835
829
|
}
|
836
830
|
return /*#__PURE__*/_jsx(Container, {
|
837
831
|
viewEmpty: viewEmpty,
|
838
|
-
children:
|
832
|
+
children: `${viewText}`
|
839
833
|
});
|
840
834
|
}
|
841
|
-
var _className = classNames(
|
842
|
-
'pro-modal-select': true
|
843
|
-
|
835
|
+
var _className = classNames({
|
836
|
+
'pro-modal-select': true,
|
837
|
+
[props.className]: props.className,
|
838
|
+
'pro-modal-select-open': open
|
839
|
+
});
|
844
840
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
845
841
|
children: [/*#__PURE__*/_jsx("div", {
|
846
842
|
id: uuid,
|
@@ -865,11 +861,9 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
865
861
|
confirmLoading: loading,
|
866
862
|
footer: (formColumns === null || formColumns === void 0 ? void 0 : formColumns.length) > 1
|
867
863
|
}), /*#__PURE__*/_jsx(ProTable, _objectSpread({
|
868
|
-
onRow:
|
864
|
+
onRow: record => {
|
869
865
|
return {
|
870
|
-
onClick:
|
871
|
-
return handleClickRow(record);
|
872
|
-
}
|
866
|
+
onClick: () => handleClickRow(record)
|
873
867
|
};
|
874
868
|
},
|
875
869
|
rowKey: rowKey,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/* eslint-disable no-restricted-syntax */
|
2
|
-
export var hideTooltipIfOpen =
|
2
|
+
export var hideTooltipIfOpen = (dom, open) => {
|
3
3
|
if (!open && document.querySelector('.pro-modal-select-parent-open') && dom) {
|
4
4
|
var _parent = dom.closest('.pro-form-item-changed');
|
5
5
|
var _grandParent = _parent === null || _parent === void 0 ? void 0 : _parent.parentElement;
|