@zat-design/sisyphus-react 3.13.19-beta.6 → 3.13.19-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +9 -0
- package/PROJECT_GUIDE.md +250 -0
- package/dist/sisyphus-react.min.css +2 -0
- package/dist/sisyphus-react.min.js +1 -0
- package/es/FormsProvider/index.js +9 -7
- package/es/ProAction/components/CheckModalContent/index.js +14 -14
- package/es/ProAction/index.js +46 -47
- package/es/ProConfigProvider/index.js +25 -19
- package/es/ProDownload/index.js +66 -73
- package/es/ProDownload/utils.js +26 -23
- package/es/ProDrawerForm/components/ProDrawer/index.js +43 -39
- package/es/ProDrawerForm/components/ProModal/index.js +25 -23
- package/es/ProDrawerForm/components/index.js +2 -2
- package/es/ProDrawerForm/index.js +19 -21
- package/es/ProDrawerForm/utils/index.js +1 -1
- package/es/ProEditLabel/components/RenderProForm.js +30 -26
- package/es/ProEditLabel/index.js +49 -36
- package/es/ProEditLabel/utils/index.js +4 -3
- package/es/ProEditTable/components/ActionButton/index.js +83 -76
- package/es/ProEditTable/components/RcTable/BaseTable.js +24 -24
- package/es/ProEditTable/components/RcTable/DraggableTable.js +34 -41
- package/es/ProEditTable/components/RcTable/VirtualTable.js +4 -3
- package/es/ProEditTable/components/RcTable/index.js +3 -3
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +61 -57
- package/es/ProEditTable/components/RenderField/index.js +151 -145
- package/es/ProEditTable/components/RenderToolbar/index.js +37 -42
- package/es/ProEditTable/components/Summary/index.js +22 -21
- package/es/ProEditTable/components/Validator/index.js +11 -10
- package/es/ProEditTable/components/index.js +5 -5
- package/es/ProEditTable/index.d.ts +1 -1
- package/es/ProEditTable/index.js +170 -173
- package/es/ProEditTable/utils/config.js +42 -46
- package/es/ProEditTable/utils/diffOriginal.js +34 -19
- package/es/ProEditTable/utils/getDefaultProps.js +12 -13
- package/es/ProEditTable/utils/index.js +102 -99
- package/es/ProEditTable/utils/tools.js +88 -91
- package/es/ProEditTable/utils/transform.js +7 -11
- package/es/ProEditTable/utils/useEditTableError.js +22 -13
- package/es/ProEnum/components/Group.js +23 -27
- package/es/ProEnum/components/Tag.js +14 -16
- package/es/ProEnum/hooks/useEnum.js +32 -14
- package/es/ProEnum/hooks/useEnumRequest.js +42 -42
- package/es/ProEnum/hooks/useFrequentEnumRequest.js +16 -16
- package/es/ProEnum/index.js +80 -89
- package/es/ProEnum/utils/eventCenter.js +23 -32
- package/es/ProEnum/utils/frequentEnum.js +15 -4
- package/es/ProEnum/utils/getEnumLabel.js +16 -21
- package/es/ProEnum/utils/index.js +12 -7
- package/es/ProForm/components/Container.js +8 -6
- package/es/ProForm/components/FormFooter/index.js +21 -19
- package/es/ProForm/components/base/Checkbox/index.js +16 -15
- package/es/ProForm/components/base/DatePicker/index.js +23 -20
- package/es/ProForm/components/base/Input/index.js +20 -18
- package/es/ProForm/components/base/InputNumber/index.js +57 -53
- package/es/ProForm/components/base/Radio/index.js +15 -15
- package/es/ProForm/components/base/RangePicker/index.js +24 -29
- package/es/ProForm/components/base/RangePicker/useDateRange.js +3 -3
- package/es/ProForm/components/base/Select/index.js +17 -15
- package/es/ProForm/components/base/Switch/index.js +16 -15
- package/es/ProForm/components/base/SwitchCheckbox/index.js +19 -18
- package/es/ProForm/components/base/TextArea/index.js +18 -17
- package/es/ProForm/components/base/TimePicker/index.js +10 -9
- package/es/ProForm/components/combination/Container/index.js +25 -23
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +80 -92
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +21 -19
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +7 -7
- package/es/ProForm/components/combination/FormList/components/Empty.js +21 -20
- package/es/ProForm/components/combination/FormList/components/LineFields.js +19 -18
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +45 -51
- package/es/ProForm/components/combination/FormList/index.js +43 -51
- package/es/ProForm/components/combination/FormList/utils.js +9 -9
- package/es/ProForm/components/combination/Group/component/AddonWrapper/index.js +8 -6
- package/es/ProForm/components/combination/Group/component/ComRender.js +33 -29
- package/es/ProForm/components/combination/Group/hooks/index.js +49 -47
- package/es/ProForm/components/combination/Group/index.js +38 -37
- package/es/ProForm/components/combination/Group/utils.js +56 -50
- package/es/ProForm/components/combination/ProCascader/index.js +81 -85
- package/es/ProForm/components/combination/ProCascader/utils/index.js +6 -6
- package/es/ProForm/components/combination/ProCombination/index.js +41 -37
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +31 -25
- package/es/ProForm/components/combination/ProModalSelect/index.js +166 -173
- package/es/ProForm/components/combination/ProModalSelect/utils/index.js +1 -1
- package/es/ProForm/components/combination/ProNumberRange/index.js +46 -51
- package/es/ProForm/components/combination/ProRangeLimit/index.js +39 -39
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +3 -3
- package/es/ProForm/components/combination/ProTimeLimit/index.js +43 -40
- package/es/ProForm/components/index.d.ts +1 -0
- package/es/ProForm/components/index.js +40 -35
- package/es/ProForm/components/old/EnumSelect/hooks/useRequestList.js +30 -28
- package/es/ProForm/components/old/EnumSelect/index.js +55 -62
- package/es/ProForm/components/old/InputRange/index.js +17 -16
- package/es/ProForm/components/old/InputWithSuffix/index.js +6 -5
- package/es/ProForm/components/old/ProAddress/index.js +53 -75
- package/es/ProForm/components/old/ProCertNo/index.js +17 -17
- package/es/ProForm/components/old/ProCertValidity/index.js +19 -21
- package/es/ProForm/components/old/ProRangeBox/index.js +25 -24
- package/es/ProForm/components/render/ChangedWrapper.js +34 -33
- package/es/ProForm/components/render/ConfirmWrapper.js +16 -18
- package/es/ProForm/components/render/Render.js +150 -135
- package/es/ProForm/components/render/RenderFields.js +65 -50
- package/es/ProForm/components/render/propsType.js +25 -0
- package/es/ProForm/index.js +83 -70
- package/es/ProForm/propsType.d.ts +1 -1
- package/es/ProForm/propsType.js +5 -1
- package/es/ProForm/utils/diffOriginal.js +30 -16
- package/es/ProForm/utils/getDefaultProps.js +10 -10
- package/es/ProForm/utils/index.js +105 -110
- package/es/ProForm/utils/processDependencies.js +15 -5
- package/es/ProForm/utils/rulesCreator.js +21 -22
- package/es/ProForm/utils/transformNames.js +7 -6
- package/es/ProForm/utils/transformValue.js +16 -13
- package/es/ProForm/utils/useDeepCompareMemo.js +6 -4
- package/es/ProForm/utils/useFieldProps.js +1 -3
- package/es/ProForm/utils/useForm.js +36 -34
- package/es/ProForm/utils/useRules.js +28 -31
- package/es/ProForm/utils/useShouldUpdate.js +83 -86
- package/es/ProForm/utils/useWatch.js +36 -14
- package/es/ProForm/utils/valueType.js +51 -52
- package/es/ProIcon/config/index.js +2 -0
- package/es/ProIcon/index.js +53 -49
- package/es/ProIcon/utils/index.js +8 -9
- package/es/ProLayout/components/Layout/Header/index.js +13 -11
- package/es/ProLayout/components/Layout/Icon/Icon.js +7 -7
- package/es/ProLayout/components/Layout/Icon/index.js +1 -1
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +42 -40
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +51 -52
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +10 -9
- package/es/ProLayout/components/Layout/Menu/index.js +20 -18
- package/es/ProLayout/components/Layout/Notice/index.js +12 -11
- package/es/ProLayout/components/Layout/index.js +4 -4
- package/es/ProLayout/components/ProCollapse/index.js +35 -32
- package/es/ProLayout/components/ProFooter/index.js +13 -15
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +9 -9
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +8 -7
- package/es/ProLayout/components/ProHeader/components/index.js +2 -2
- package/es/ProLayout/components/ProHeader/index.js +129 -118
- package/es/ProLayout/components/ProHeader/utils/index.js +1 -1
- package/es/ProLayout/components/index.js +3 -3
- package/es/ProLayout/index.d.ts +1 -1
- package/es/ProLayout/index.js +28 -25
- package/es/ProLayout/utils/index.js +37 -35
- package/es/ProSelect/components/AdaptiveTooltip.js +10 -11
- package/es/ProSelect/index.js +87 -99
- package/es/ProSelect/utils/index.js +27 -33
- package/es/ProStep/components/Anchor/index.d.ts +1 -0
- package/es/ProStep/components/Anchor/index.js +26 -25
- package/es/ProStep/components/Item/index.d.ts +1 -0
- package/es/ProStep/components/Item/index.js +26 -22
- package/es/ProStep/components/Listener/index.js +11 -15
- package/es/ProStep/components/Step/index.js +24 -25
- package/es/ProStep/index.js +51 -53
- package/es/ProStep/utils/index.js +13 -12
- package/es/ProStepTab/index.js +59 -37
- package/es/ProTable/components/FormatColumn/index.js +106 -110
- package/es/ProTable/components/RcTable/components/BaseTable/index.js +7 -9
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +36 -50
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +24 -24
- package/es/ProTable/components/RcTable/components/DraggableTable/index.js +8 -10
- package/es/ProTable/components/RcTable/index.js +2 -2
- package/es/ProTable/components/RenderColumn/index.js +51 -51
- package/es/ProTable/components/RenderEmptyText/index.js +8 -7
- package/es/ProTable/components/RenderFooter/index.js +3 -3
- package/es/ProTable/components/RenderSummary/index.js +13 -13
- package/es/ProTable/components/RenderTableHeader/index.js +16 -14
- package/es/ProTable/components/RenderTabs/index.js +28 -33
- package/es/ProTable/components/TableResizable/index.js +17 -16
- package/es/ProTable/components/TooltipTitle/index.js +7 -6
- package/es/ProTable/components/index.js +11 -6
- package/es/ProTable/hooks/useAntdTable.js +106 -119
- package/es/ProTable/index.js +158 -176
- package/es/ProTable/utils/index.js +25 -21
- package/es/ProTabs/components/Card/index.js +15 -14
- package/es/ProTabs/components/index.js +1 -1
- package/es/ProTabs/index.js +24 -25
- package/es/ProThemeTools/component/ProTools/index.js +69 -68
- package/es/ProThemeTools/component/index.js +1 -1
- package/es/ProThemeTools/index.js +47 -33
- package/es/ProThemeTools/utils/index.js +20 -17
- package/es/ProTooltip/index.js +44 -46
- package/es/ProTree/components/AdaptiveTooltip.js +5 -7
- package/es/ProTree/components/CloseIcon.js +5 -5
- package/es/ProTree/components/List.js +22 -24
- package/es/ProTree/components/ProTree.js +84 -102
- package/es/ProTree/components/ProTreeSelect/index.js +128 -119
- package/es/ProTree/components/SearchTitle.js +10 -9
- package/es/ProTree/components/Tree.js +57 -58
- package/es/ProTree/components/index.js +4 -4
- package/es/ProTree/index.js +6 -6
- package/es/ProTree/utils.js +29 -22
- package/es/ProTreeModal/components/Cascader.js +31 -33
- package/es/ProTreeModal/components/CloseIcon.js +5 -5
- package/es/ProTreeModal/components/List.js +74 -93
- package/es/ProTreeModal/components/SearchTitle.js +5 -4
- package/es/ProTreeModal/components/SortableItem.js +14 -14
- package/es/ProTreeModal/components/Tree.js +49 -53
- package/es/ProTreeModal/components/Trigger.js +29 -28
- package/es/ProTreeModal/components/index.js +6 -6
- package/es/ProTreeModal/index.js +166 -206
- package/es/ProTreeModal/utils.js +37 -33
- package/es/ProUpload/components/ButtonRender.js +33 -36
- package/es/ProUpload/components/DragRender.js +54 -51
- package/es/ProUpload/components/DraggableUploadListItem.js +5 -4
- package/es/ProUpload/components/Example.js +13 -12
- package/es/ProUpload/components/FileItem.js +63 -58
- package/es/ProUpload/components/ImageRender.js +98 -100
- package/es/ProUpload/index.js +75 -82
- package/es/ProUpload/uitls.js +3 -3
- package/es/ProUtils/utils/index.js +10 -14
- package/es/ProViewer/index.js +29 -25
- package/es/ProViewer/propsType.js +0 -1
- package/es/ProWaterMark/index.js +5 -4
- package/es/index.d.ts +1 -1
- package/es/index.js +38 -29
- package/es/locale/index.js +7 -4
- package/es/old/ProCertValidity/index.js +19 -21
- package/es/old/ProEditableTable/index.js +156 -156
- package/es/old/ProEditableTable/utils.js +61 -63
- package/es/tokens.js +1 -0
- package/es/utils/index.js +12 -12
- package/lib/FormsProvider/index.js +11 -7
- package/lib/ProAction/components/CheckModalContent/index.js +11 -13
- package/lib/ProAction/index.js +40 -43
- package/lib/ProConfigProvider/index.js +23 -16
- package/lib/ProDownload/index.js +65 -71
- package/lib/ProDownload/utils.js +25 -22
- package/lib/ProDrawerForm/components/ProDrawer/index.js +39 -38
- package/lib/ProDrawerForm/components/ProModal/index.js +23 -22
- package/lib/ProDrawerForm/index.js +18 -18
- package/lib/ProDrawerForm/utils/index.js +3 -2
- package/lib/ProEditLabel/components/RenderProForm.js +26 -24
- package/lib/ProEditLabel/index.js +46 -35
- package/lib/ProEditLabel/utils/index.js +6 -5
- package/lib/ProEditTable/components/ActionButton/index.js +79 -74
- package/lib/ProEditTable/components/RcTable/BaseTable.js +21 -23
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +32 -40
- package/lib/ProEditTable/components/RcTable/VirtualTable.js +3 -3
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +62 -59
- package/lib/ProEditTable/components/RenderField/index.js +137 -132
- package/lib/ProEditTable/components/RenderToolbar/index.js +34 -41
- package/lib/ProEditTable/components/Summary/index.js +20 -20
- package/lib/ProEditTable/components/Validator/index.js +10 -10
- package/lib/ProEditTable/index.d.ts +1 -1
- package/lib/ProEditTable/index.js +159 -164
- package/lib/ProEditTable/utils/config.js +40 -44
- package/lib/ProEditTable/utils/diffOriginal.js +36 -21
- package/lib/ProEditTable/utils/getDefaultProps.js +14 -15
- package/lib/ProEditTable/utils/index.js +97 -97
- package/lib/ProEditTable/utils/tools.js +96 -91
- package/lib/ProEditTable/utils/transform.js +7 -11
- package/lib/ProEditTable/utils/useEditTableError.js +22 -13
- package/lib/ProEnum/components/Group.js +23 -27
- package/lib/ProEnum/components/Tag.js +14 -16
- package/lib/ProEnum/hooks/useEnum.js +30 -12
- package/lib/ProEnum/hooks/useEnumRequest.js +39 -39
- package/lib/ProEnum/hooks/useFrequentEnumRequest.js +15 -15
- package/lib/ProEnum/index.js +68 -78
- package/lib/ProEnum/utils/eventCenter.js +23 -32
- package/lib/ProEnum/utils/frequentEnum.js +13 -3
- package/lib/ProEnum/utils/getEnumLabel.js +15 -21
- package/lib/ProEnum/utils/index.js +12 -7
- package/lib/ProForm/components/Container.js +7 -5
- package/lib/ProForm/components/FormFooter/index.js +19 -17
- package/lib/ProForm/components/base/Checkbox/index.js +14 -13
- package/lib/ProForm/components/base/DatePicker/index.js +20 -17
- package/lib/ProForm/components/base/Input/index.js +15 -15
- package/lib/ProForm/components/base/InputNumber/index.js +51 -48
- package/lib/ProForm/components/base/Radio/index.js +13 -13
- package/lib/ProForm/components/base/RangePicker/index.js +19 -22
- package/lib/ProForm/components/base/RangePicker/useDateRange.js +5 -4
- package/lib/ProForm/components/base/Select/index.js +14 -12
- package/lib/ProForm/components/base/Switch/index.js +11 -11
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +16 -15
- package/lib/ProForm/components/base/TextArea/index.js +14 -13
- package/lib/ProForm/components/base/TimePicker/index.js +6 -5
- package/lib/ProForm/components/combination/Container/index.js +22 -21
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +77 -89
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +17 -15
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +7 -7
- package/lib/ProForm/components/combination/FormList/components/Empty.js +17 -18
- package/lib/ProForm/components/combination/FormList/components/LineFields.js +14 -14
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +43 -48
- package/lib/ProForm/components/combination/FormList/index.js +35 -43
- package/lib/ProForm/components/combination/FormList/utils.js +11 -10
- package/lib/ProForm/components/combination/Group/component/AddonWrapper/index.js +7 -5
- package/lib/ProForm/components/combination/Group/component/ComRender.js +30 -28
- package/lib/ProForm/components/combination/Group/hooks/index.js +48 -45
- package/lib/ProForm/components/combination/Group/index.js +34 -35
- package/lib/ProForm/components/combination/Group/utils.js +62 -50
- package/lib/ProForm/components/combination/ProCascader/index.js +75 -80
- package/lib/ProForm/components/combination/ProCascader/utils/index.js +8 -7
- package/lib/ProForm/components/combination/ProCombination/index.js +35 -31
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +30 -24
- package/lib/ProForm/components/combination/ProModalSelect/index.js +171 -180
- package/lib/ProForm/components/combination/ProModalSelect/utils/index.js +3 -2
- package/lib/ProForm/components/combination/ProNumberRange/index.js +42 -48
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +35 -35
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +3 -3
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +37 -34
- package/lib/ProForm/components/index.d.ts +1 -0
- package/lib/ProForm/components/old/EnumSelect/hooks/useRequestList.js +35 -33
- package/lib/ProForm/components/old/EnumSelect/index.js +50 -58
- package/lib/ProForm/components/old/InputRange/index.js +16 -16
- package/lib/ProForm/components/old/InputWithSuffix/index.js +4 -4
- package/lib/ProForm/components/old/ProAddress/index.js +53 -75
- package/lib/ProForm/components/old/ProCertNo/index.js +16 -17
- package/lib/ProForm/components/old/ProCertValidity/index.js +17 -18
- package/lib/ProForm/components/old/ProRangeBox/index.js +24 -24
- package/lib/ProForm/components/render/ChangedWrapper.js +35 -35
- package/lib/ProForm/components/render/ConfirmWrapper.js +14 -17
- package/lib/ProForm/components/render/Render.js +138 -125
- package/lib/ProForm/components/render/RenderFields.js +57 -43
- package/lib/ProForm/components/render/propsType.js +26 -1
- package/lib/ProForm/index.js +74 -61
- package/lib/ProForm/propsType.d.ts +1 -1
- package/lib/ProForm/propsType.js +5 -1
- package/lib/ProForm/utils/diffOriginal.js +30 -17
- package/lib/ProForm/utils/getDefaultProps.js +12 -12
- package/lib/ProForm/utils/index.js +127 -106
- package/lib/ProForm/utils/processDependencies.js +15 -6
- package/lib/ProForm/utils/rulesCreator.js +21 -21
- package/lib/ProForm/utils/transformNames.js +6 -6
- package/lib/ProForm/utils/transformValue.js +14 -11
- package/lib/ProForm/utils/useDeepCompareMemo.js +7 -6
- package/lib/ProForm/utils/useFieldProps.js +2 -3
- package/lib/ProForm/utils/useForm.js +33 -31
- package/lib/ProForm/utils/useRules.js +25 -28
- package/lib/ProForm/utils/useShouldUpdate.js +82 -85
- package/lib/ProForm/utils/useWatch.js +36 -14
- package/lib/ProForm/utils/valueType.js +52 -52
- package/lib/ProIcon/config/index.js +2 -0
- package/lib/ProIcon/index.js +47 -44
- package/lib/ProIcon/utils/index.js +10 -8
- package/lib/ProLayout/components/Layout/Header/index.js +10 -10
- package/lib/ProLayout/components/Layout/Icon/Icon.js +8 -7
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +37 -36
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +49 -52
- package/lib/ProLayout/components/Layout/Menu/SideMenu/index.js +8 -8
- package/lib/ProLayout/components/Layout/Menu/index.js +17 -16
- package/lib/ProLayout/components/Layout/Notice/index.js +8 -8
- package/lib/ProLayout/components/ProCollapse/index.js +32 -30
- package/lib/ProLayout/components/ProFooter/index.js +14 -16
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +7 -7
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +6 -7
- package/lib/ProLayout/components/ProHeader/index.js +131 -120
- package/lib/ProLayout/components/ProHeader/utils/index.js +3 -2
- package/lib/ProLayout/index.d.ts +1 -1
- package/lib/ProLayout/index.js +22 -21
- package/lib/ProLayout/utils/index.js +42 -33
- package/lib/ProSelect/components/AdaptiveTooltip.js +9 -11
- package/lib/ProSelect/index.js +82 -93
- package/lib/ProSelect/utils/index.js +29 -34
- package/lib/ProStep/components/Anchor/index.d.ts +1 -0
- package/lib/ProStep/components/Anchor/index.js +25 -24
- package/lib/ProStep/components/Item/index.d.ts +1 -0
- package/lib/ProStep/components/Item/index.js +24 -20
- package/lib/ProStep/components/Listener/index.js +9 -13
- package/lib/ProStep/components/Step/index.js +20 -21
- package/lib/ProStep/index.js +45 -49
- package/lib/ProStep/utils/index.js +16 -12
- package/lib/ProStepTab/index.js +60 -38
- package/lib/ProTable/components/FormatColumn/index.js +100 -104
- package/lib/ProTable/components/RcTable/components/BaseTable/index.js +5 -7
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +34 -48
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +25 -23
- package/lib/ProTable/components/RcTable/components/DraggableTable/index.js +5 -7
- package/lib/ProTable/components/RenderColumn/index.js +46 -48
- package/lib/ProTable/components/RenderEmptyText/index.js +6 -6
- package/lib/ProTable/components/RenderFooter/index.js +3 -3
- package/lib/ProTable/components/RenderSummary/index.js +11 -12
- package/lib/ProTable/components/RenderTableHeader/index.js +14 -13
- package/lib/ProTable/components/RenderTabs/index.js +27 -32
- package/lib/ProTable/components/TableResizable/index.js +16 -15
- package/lib/ProTable/components/TooltipTitle/index.js +5 -5
- package/lib/ProTable/hooks/useAntdTable.js +103 -116
- package/lib/ProTable/index.js +149 -169
- package/lib/ProTable/utils/index.js +33 -22
- package/lib/ProTabs/components/Card/index.js +14 -14
- package/lib/ProTabs/index.js +24 -24
- package/lib/ProThemeTools/component/ProTools/index.js +66 -65
- package/lib/ProThemeTools/index.js +43 -29
- package/lib/ProThemeTools/utils/index.js +25 -18
- package/lib/ProTooltip/index.js +44 -46
- package/lib/ProTree/components/AdaptiveTooltip.js +5 -7
- package/lib/ProTree/components/CloseIcon.js +5 -5
- package/lib/ProTree/components/List.js +18 -22
- package/lib/ProTree/components/ProTree.js +77 -96
- package/lib/ProTree/components/ProTreeSelect/index.js +126 -116
- package/lib/ProTree/components/SearchTitle.js +8 -8
- package/lib/ProTree/components/Tree.js +53 -55
- package/lib/ProTree/index.js +4 -4
- package/lib/ProTree/utils.js +34 -25
- package/lib/ProTreeModal/components/Cascader.js +28 -32
- package/lib/ProTreeModal/components/CloseIcon.js +5 -5
- package/lib/ProTreeModal/components/List.js +69 -89
- package/lib/ProTreeModal/components/SearchTitle.js +4 -4
- package/lib/ProTreeModal/components/SortableItem.js +11 -12
- package/lib/ProTreeModal/components/Tree.js +44 -49
- package/lib/ProTreeModal/components/Trigger.js +26 -26
- package/lib/ProTreeModal/index.js +157 -199
- package/lib/ProTreeModal/utils.js +43 -35
- package/lib/ProUpload/components/ButtonRender.js +29 -33
- package/lib/ProUpload/components/DragRender.js +50 -48
- package/lib/ProUpload/components/DraggableUploadListItem.js +7 -5
- package/lib/ProUpload/components/Example.js +13 -11
- package/lib/ProUpload/components/FileItem.js +58 -50
- package/lib/ProUpload/components/ImageRender.js +89 -93
- package/lib/ProUpload/index.js +68 -76
- package/lib/ProUpload/uitls.js +5 -3
- package/lib/ProUtils/utils/index.js +10 -14
- package/lib/ProViewer/index.js +26 -24
- package/lib/ProViewer/propsType.js +1 -5
- package/lib/ProWaterMark/index.js +5 -4
- package/lib/index.d.ts +1 -1
- package/lib/locale/index.js +6 -2
- package/lib/old/ProCertValidity/index.js +17 -18
- package/lib/old/ProEditableTable/index.js +153 -156
- package/lib/old/ProEditableTable/utils.js +61 -62
- package/lib/tokens.js +1 -0
- package/lib/utils/index.js +16 -13
- package/package.json +6 -8
- package/dist/index.esm.css +0 -6344
- package/dist/index.esm.js +0 -3
- package/dist/less.esm.css +0 -5768
- package/dist/less.esm.js +0 -3
@@ -6,36 +6,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
7
7
|
});
|
8
8
|
exports.default = void 0;
|
9
|
+
require("antd/es/space/style");
|
10
|
+
var _space = _interopRequireDefault(require("antd/es/space"));
|
9
11
|
require("antd/es/button/style");
|
10
12
|
var _button = _interopRequireDefault(require("antd/es/button"));
|
11
|
-
require("antd/es/input/style");
|
12
|
-
var _input = _interopRequireDefault(require("antd/es/input"));
|
13
13
|
require("antd/es/tooltip/style");
|
14
14
|
var _tooltip2 = _interopRequireDefault(require("antd/es/tooltip"));
|
15
|
+
require("antd/es/input/style");
|
16
|
+
var _input = _interopRequireDefault(require("antd/es/input"));
|
15
17
|
require("antd/es/spin/style");
|
16
18
|
var _spin = _interopRequireDefault(require("antd/es/spin"));
|
17
|
-
require("antd/es/space/style");
|
18
|
-
var _space = _interopRequireDefault(require("antd/es/space"));
|
19
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
20
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
21
19
|
require("antd/es/message/style");
|
22
20
|
var _message2 = _interopRequireDefault(require("antd/es/message"));
|
23
21
|
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
24
22
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
25
|
-
var
|
23
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
26
24
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
27
25
|
require("antd/es/form/style");
|
28
26
|
var _form = _interopRequireDefault(require("antd/es/form"));
|
29
27
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
30
|
-
var _isObject2 = _interopRequireDefault(require("lodash/isObject"));
|
31
|
-
var _isFunction2 = _interopRequireDefault(require("lodash/isFunction"));
|
32
|
-
var _isEqual2 = _interopRequireDefault(require("lodash/isEqual"));
|
33
|
-
var _isBoolean2 = _interopRequireDefault(require("lodash/isBoolean"));
|
34
|
-
var _isArray2 = _interopRequireDefault(require("lodash/isArray"));
|
35
|
-
var _debounce2 = _interopRequireDefault(require("lodash/debounce"));
|
36
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
37
28
|
var _icons = require("@ant-design/icons");
|
38
29
|
var _ahooks = require("ahooks");
|
30
|
+
var _lodash = require("lodash");
|
39
31
|
var _classnames = _interopRequireDefault(require("classnames"));
|
40
32
|
var _reactSvg = require("react-svg");
|
41
33
|
var _react = _interopRequireWildcard(require("react"));
|
@@ -45,11 +37,12 @@ var _view = _interopRequireDefault(require("../../../../assets/view.svg"));
|
|
45
37
|
var _useRequestList3 = _interopRequireDefault(require("./hooks/useRequestList"));
|
46
38
|
var _locale = _interopRequireDefault(require("../../../../locale"));
|
47
39
|
var _utils = require("./utils");
|
40
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
48
41
|
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"],
|
49
42
|
_excluded2 = ["onOk"],
|
50
43
|
_excluded3 = ["rowKey", "columns", "rowSelection"];
|
51
|
-
var ProModalSelect =
|
52
|
-
var _useRequest$options, _useRequest$options2, _useRequest$
|
44
|
+
var ProModalSelect = (props, ref) => {
|
45
|
+
var _useRequest$options, _useRequest$options2, _useRequest$options3, _formColumns$;
|
53
46
|
var value = props.value,
|
54
47
|
onChange = props.onChange,
|
55
48
|
disabled = props.disabled,
|
@@ -79,8 +72,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
79
72
|
otherProps = props.otherProps,
|
80
73
|
restProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
81
74
|
var _tooltip = tooltip !== null && tooltip !== void 0 ? tooltip : isTooltip;
|
82
|
-
var nextMode = (0, _react.useMemo)(
|
83
|
-
if ((0,
|
75
|
+
var nextMode = (0, _react.useMemo)(() => {
|
76
|
+
if ((0, _lodash.isBoolean)(readOnly) && readOnly === false) {
|
84
77
|
return 'input';
|
85
78
|
}
|
86
79
|
return mode;
|
@@ -106,10 +99,13 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
106
99
|
isViewCon = _ref2.isView,
|
107
100
|
viewEmpty = _ref2.viewEmpty;
|
108
101
|
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
|
102
|
+
|
109
103
|
// 是否多选
|
110
104
|
var isMultiple = type === 'checkbox';
|
105
|
+
|
111
106
|
// 生成一个唯一id,用于满足tooltip功能
|
112
107
|
var uuid = Math.random().toString(36).slice(-6);
|
108
|
+
|
113
109
|
// 全局配置fieldNames指定 value与label的key
|
114
110
|
var _ref3 = (0, _index.useProConfig)('ProModalSelect') || {},
|
115
111
|
_ref3$fieldNames = _ref3.fieldNames,
|
@@ -120,6 +116,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
120
116
|
labelKey = proModalSelectFieldNames.label;
|
121
117
|
valueKey = proModalSelectFieldNames.value;
|
122
118
|
}
|
119
|
+
|
123
120
|
// 表单上配置的权重大于全局配置
|
124
121
|
if (fieldNames && Object.keys(fieldNames).length) {
|
125
122
|
labelKey = fieldNames.label;
|
@@ -134,8 +131,9 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
134
131
|
var preValue = (0, _react.useRef)(value);
|
135
132
|
// 表单项的ref
|
136
133
|
var fieldRef = (0, _react.useRef)(null);
|
137
|
-
var defaultParams = Array.isArray(useRequest === null || useRequest === void 0
|
134
|
+
var defaultParams = Array.isArray(useRequest === null || useRequest === void 0 || (_useRequest$options = useRequest.options) === null || _useRequest$options === void 0 ? void 0 : _useRequest$options.defaultParams) ? useRequest === null || useRequest === void 0 || (_useRequest$options2 = useRequest.options) === null || _useRequest$options2 === void 0 || (_useRequest$options2 = _useRequest$options2.defaultParams) === null || _useRequest$options2 === void 0 ? void 0 : _useRequest$options2[0] : (useRequest === null || useRequest === void 0 || (_useRequest$options3 = useRequest.options) === null || _useRequest$options3 === void 0 ? void 0 : _useRequest$options3.defaultParams) || {};
|
138
135
|
var defaultParamsRef = (0, _react.useRef)(defaultParams); // 缓存 defaultParams 的引用
|
136
|
+
|
139
137
|
var _useSetState = (0, _ahooks.useSetState)({
|
140
138
|
_value: value,
|
141
139
|
isInit: true,
|
@@ -163,14 +161,14 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
163
161
|
var selectedRows = (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRows) || _selectedRows;
|
164
162
|
var selectedRowKeys = (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || _selectedRowKeys;
|
165
163
|
var _useRequestList = (0, _useRequestList3.default)(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, {
|
166
|
-
withPagination
|
167
|
-
transformParams
|
168
|
-
transformResponse
|
169
|
-
}, (0,
|
164
|
+
withPagination,
|
165
|
+
transformParams,
|
166
|
+
transformResponse
|
167
|
+
}, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
|
170
168
|
manual: true,
|
171
|
-
onSuccess
|
169
|
+
onSuccess(res) {
|
172
170
|
var _res$data, _ref5;
|
173
|
-
var list = withPagination ? res === null || res === void 0
|
171
|
+
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;
|
174
172
|
setState({
|
175
173
|
options: (_ref5 = transformResponse ? transformResponse(res === null || res === void 0 ? void 0 : res.data) : list) !== null && _ref5 !== void 0 ? _ref5 : []
|
176
174
|
});
|
@@ -178,19 +176,19 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
178
176
|
})),
|
179
177
|
run = _useRequestList.run,
|
180
178
|
selectLoading = _useRequestList.loading;
|
181
|
-
var initParams = (0, _react.useMemo)(
|
179
|
+
var initParams = (0, _react.useMemo)(() => {
|
182
180
|
var nextInitParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams;
|
183
181
|
if (typeof (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) === 'function') {
|
184
182
|
var _contentForm$getField;
|
185
|
-
nextInitParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams(value, contentForm === null || contentForm === void 0
|
183
|
+
nextInitParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams(value, contentForm === null || contentForm === void 0 || (_contentForm$getField = contentForm.getFieldsValue) === null || _contentForm$getField === void 0 ? void 0 : _contentForm$getField.call(contentForm));
|
186
184
|
}
|
187
185
|
return nextInitParams;
|
188
186
|
}, [value]);
|
189
187
|
var _useRequestList2 = (0, _useRequestList3.default)(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, {
|
190
|
-
withPagination
|
191
|
-
transformParams
|
192
|
-
transformResponse
|
193
|
-
}, (0,
|
188
|
+
withPagination,
|
189
|
+
transformParams,
|
190
|
+
transformResponse
|
191
|
+
}, (0, _objectSpread2.default)({
|
194
192
|
ready: (initParams || defaultOne) && nextMode === 'input' || visible
|
195
193
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options)),
|
196
194
|
data = _useRequestList2.data,
|
@@ -200,50 +198,47 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
200
198
|
onReset = _useRequestList2.onReset,
|
201
199
|
runAsync = _useRequestList2.runAsync,
|
202
200
|
mutate = _useRequestList2.mutate;
|
203
|
-
var defaultOptionRender =
|
204
|
-
return rowData === null || rowData === void 0 ? void 0 : rowData[labelKey];
|
205
|
-
};
|
201
|
+
var defaultOptionRender = rowData => rowData === null || rowData === void 0 ? void 0 : rowData[labelKey];
|
206
202
|
var handleFormat = onFormat || defaultOptionRender;
|
207
203
|
if (showCodeName) {
|
208
|
-
handleFormat =
|
204
|
+
handleFormat = _ref6 => {
|
209
205
|
var value = _ref6.value,
|
210
206
|
label = _ref6.label;
|
211
|
-
return
|
207
|
+
return `${value}-${label}`;
|
212
208
|
};
|
213
209
|
}
|
210
|
+
|
214
211
|
/**
|
215
212
|
* 格式化数据方法,展示在输入框中
|
216
213
|
* @date 2023-02-16
|
217
214
|
* @param {any} data 当前选中的值 labelInValue模式下为选中行对象,单值模式为value值
|
218
215
|
* @returns {any}
|
219
216
|
*/
|
220
|
-
var formatValue =
|
217
|
+
var formatValue = data => {
|
221
218
|
var _data$map;
|
222
219
|
if (typeof data === 'string' || typeof data === 'number') {
|
223
220
|
return data;
|
224
221
|
}
|
225
|
-
if ((0,
|
226
|
-
return handleFormat((0,
|
222
|
+
if ((0, _lodash.isObject)(data)) {
|
223
|
+
return handleFormat((0, _objectSpread2.default)((0, _objectSpread2.default)({}, data), {}, {
|
227
224
|
value: data[valueKey],
|
228
225
|
label: data[labelKey]
|
229
226
|
}));
|
230
227
|
}
|
231
|
-
return (0,
|
232
|
-
return handleFormat((0,
|
228
|
+
return (0, _lodash.isArray)(data) ? data === null || data === void 0 || (_data$map = data.map(item => {
|
229
|
+
return handleFormat((0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
233
230
|
value: item[valueKey],
|
234
231
|
label: item[labelKey]
|
235
232
|
}));
|
236
233
|
})) === null || _data$map === void 0 ? void 0 : _data$map.join(',') : '';
|
237
234
|
};
|
238
|
-
var viewText = (0, _react.useMemo)(
|
235
|
+
var viewText = (0, _react.useMemo)(() => {
|
239
236
|
var nextValue = labelInValue ? value : _value;
|
240
237
|
if (labelInValue) {
|
241
238
|
nextValue = value;
|
242
239
|
} else {
|
243
240
|
var _options$find;
|
244
|
-
var optionDTO = options === null || options === void 0
|
245
|
-
return item[valueKey] === value;
|
246
|
-
});
|
241
|
+
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);
|
247
242
|
if (optionDTO) {
|
248
243
|
nextValue = optionDTO;
|
249
244
|
} else {
|
@@ -252,33 +247,33 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
252
247
|
}
|
253
248
|
return formatValue(nextValue);
|
254
249
|
}, [value, _value, options]);
|
250
|
+
|
255
251
|
/**
|
256
252
|
* 获取表格的rowKey,支持函数、字符串
|
257
253
|
* @date 2023-02-16
|
258
254
|
* @param {any} record 表格行数据
|
259
255
|
* @returns {any}
|
260
256
|
*/
|
261
|
-
var getRowKey =
|
262
|
-
if ((0,
|
257
|
+
var getRowKey = record => {
|
258
|
+
if ((0, _lodash.isFunction)(rowKey)) {
|
263
259
|
return rowKey(record);
|
264
260
|
}
|
265
261
|
return record[rowKey];
|
266
262
|
};
|
263
|
+
|
267
264
|
/**
|
268
265
|
* 执行onChange暴露出来的第一个参数取数方法
|
269
266
|
* @date 2023-02-16
|
270
267
|
* @param {any} selectedRows 选中行数据
|
271
268
|
* @returns {any}
|
272
269
|
*/
|
273
|
-
var getNextValues =
|
270
|
+
var getNextValues = selectedRows => {
|
274
271
|
if (isMultiple) {
|
275
|
-
return selectedRows.map(
|
276
|
-
return item === null || item === void 0 ? void 0 : item[valueKey];
|
277
|
-
});
|
272
|
+
return selectedRows.map(item => item === null || item === void 0 ? void 0 : item[valueKey]);
|
278
273
|
}
|
279
274
|
return selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows[valueKey];
|
280
275
|
};
|
281
|
-
var handleChangeValue =
|
276
|
+
var handleChangeValue = e => {
|
282
277
|
onChange(e.target.value);
|
283
278
|
preValue.current = e.target.value;
|
284
279
|
if (nextMode === 'input') {
|
@@ -287,12 +282,12 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
287
282
|
});
|
288
283
|
}
|
289
284
|
};
|
290
|
-
var handleSelectValue =
|
285
|
+
var handleSelectValue = (val, option) => {
|
291
286
|
onChange(val, option);
|
292
287
|
preValue.current = val;
|
293
288
|
};
|
294
289
|
var handleClick = /*#__PURE__*/function () {
|
295
|
-
var _ref7 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
290
|
+
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
296
291
|
var _yield$beforeOpen, res;
|
297
292
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
298
293
|
while (1) switch (_context.prev = _context.next) {
|
@@ -327,8 +322,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
327
322
|
setState({
|
328
323
|
onOff: true
|
329
324
|
});
|
330
|
-
setTimeout(
|
331
|
-
afterOpen === null || afterOpen === void 0
|
325
|
+
setTimeout(() => {
|
326
|
+
afterOpen === null || afterOpen === void 0 || afterOpen({
|
332
327
|
setInnerState: setState
|
333
328
|
});
|
334
329
|
}, 100);
|
@@ -343,7 +338,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
343
338
|
return _ref7.apply(this, arguments);
|
344
339
|
};
|
345
340
|
}();
|
346
|
-
var handleClose =
|
341
|
+
var handleClose = () => {
|
347
342
|
var _useRequest$options4;
|
348
343
|
form.resetFields();
|
349
344
|
setState({
|
@@ -351,21 +346,20 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
351
346
|
visible: false,
|
352
347
|
isInit: false
|
353
348
|
});
|
349
|
+
|
354
350
|
// 当设置manual为true时,清空当前弹框内已搜索出来的值
|
355
|
-
if (useRequest
|
356
|
-
mutate(
|
357
|
-
return [];
|
358
|
-
});
|
351
|
+
if (useRequest !== null && useRequest !== void 0 && (_useRequest$options4 = useRequest.options) !== null && _useRequest$options4 !== void 0 && _useRequest$options4.manual) {
|
352
|
+
mutate(() => []);
|
359
353
|
}
|
360
354
|
};
|
361
355
|
var handleFinish = /*#__PURE__*/function () {
|
362
|
-
var _ref8 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
|
356
|
+
var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
|
363
357
|
var _nextSelectedRows, _nextSelectedRows2, nextSelectedRows, record, flag, res;
|
364
358
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
365
359
|
while (1) switch (_context2.prev = _context2.next) {
|
366
360
|
case 0:
|
367
361
|
_context2.prev = 0;
|
368
|
-
if (!(!(selectedRowKeys
|
362
|
+
if (!(!(selectedRowKeys !== null && selectedRowKeys !== void 0 && selectedRowKeys.length) || !(selectedRows !== null && selectedRows !== void 0 && selectedRows.length))) {
|
369
363
|
_context2.next = 4;
|
370
364
|
break;
|
371
365
|
}
|
@@ -373,10 +367,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
373
367
|
return _context2.abrupt("return", false);
|
374
368
|
case 4:
|
375
369
|
nextSelectedRows = selectedRows;
|
376
|
-
if (!((_nextSelectedRows = nextSelectedRows)
|
377
|
-
nextSelectedRows = data.filter(
|
378
|
-
return selectedRowKeys.includes(item[valueKey]);
|
379
|
-
});
|
370
|
+
if (!((_nextSelectedRows = nextSelectedRows) !== null && _nextSelectedRows !== void 0 && _nextSelectedRows[0])) {
|
371
|
+
nextSelectedRows = data.filter(item => selectedRowKeys.includes(item[valueKey]));
|
380
372
|
}
|
381
373
|
record = isMultiple ? nextSelectedRows : (_nextSelectedRows2 = nextSelectedRows) === null || _nextSelectedRows2 === void 0 ? void 0 : _nextSelectedRows2[0];
|
382
374
|
if (!isMultiple) {
|
@@ -400,12 +392,12 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
400
392
|
}
|
401
393
|
case 14:
|
402
394
|
if (flag) {
|
403
|
-
onChange === null || onChange === void 0
|
395
|
+
onChange === null || onChange === void 0 || onChange(labelInValue ? record : getNextValues(record), record);
|
404
396
|
preValue.current = labelInValue ? record : getNextValues(record);
|
405
397
|
// 更新内部展示值
|
406
398
|
setState({
|
407
399
|
_value: record,
|
408
|
-
options: (0,
|
400
|
+
options: (0, _lodash.isArray)(record) ? record : [record]
|
409
401
|
});
|
410
402
|
handleClose();
|
411
403
|
}
|
@@ -425,7 +417,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
425
417
|
};
|
426
418
|
}();
|
427
419
|
var handleSearch = /*#__PURE__*/function () {
|
428
|
-
var _ref9 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3() {
|
420
|
+
var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3() {
|
429
421
|
var values;
|
430
422
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee3$(_context3) {
|
431
423
|
while (1) switch (_context3.prev = _context3.next) {
|
@@ -434,7 +426,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
434
426
|
return form.validateFields();
|
435
427
|
case 2:
|
436
428
|
values = _context3.sent;
|
437
|
-
onSearch((0,
|
429
|
+
onSearch((0, _objectSpread2.default)((0, _objectSpread2.default)({}, values), {}, {
|
438
430
|
d: Date.now()
|
439
431
|
}));
|
440
432
|
case 4:
|
@@ -447,39 +439,34 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
447
439
|
return _ref9.apply(this, arguments);
|
448
440
|
};
|
449
441
|
}();
|
450
|
-
var _rowSelection = (0,
|
451
|
-
type
|
452
|
-
onChange:
|
442
|
+
var _rowSelection = (0, _objectSpread2.default)({
|
443
|
+
type,
|
444
|
+
onChange: (rowKeys, rows) => {
|
453
445
|
setState({
|
454
446
|
selectedRowKeys: rowKeys,
|
455
447
|
selectedRows: rows
|
456
448
|
});
|
457
449
|
},
|
458
|
-
getCheckboxProps:
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
selectedRowKeys: selectedRowKeys,
|
464
|
-
selectedRows: selectedRows
|
450
|
+
getCheckboxProps: record => ({
|
451
|
+
disabled: record === null || record === void 0 ? void 0 : record.disabled
|
452
|
+
}),
|
453
|
+
selectedRowKeys,
|
454
|
+
selectedRows
|
465
455
|
}, rowSelection);
|
456
|
+
|
466
457
|
// 点击行进行勾选
|
467
|
-
var handleClickRow =
|
468
|
-
var _rowSelection$getChec
|
469
|
-
if (_rowSelection
|
458
|
+
var handleClickRow = record => {
|
459
|
+
var _rowSelection$getChec;
|
460
|
+
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) {
|
470
461
|
return;
|
471
462
|
}
|
472
|
-
if (record
|
463
|
+
if (record !== null && record !== void 0 && record.disabled) return;
|
473
464
|
var selectedValue = getRowKey(record);
|
474
|
-
var tempSelectedRows =
|
475
|
-
var tempSelectedRowKeys =
|
465
|
+
var tempSelectedRows = [...selectedRows];
|
466
|
+
var tempSelectedRowKeys = [...selectedRowKeys];
|
476
467
|
if (isMultiple) {
|
477
|
-
var rowIndex = tempSelectedRows.findIndex(
|
478
|
-
|
479
|
-
});
|
480
|
-
var rowKeyIndex = tempSelectedRowKeys.findIndex(function (item) {
|
481
|
-
return item === selectedValue;
|
482
|
-
});
|
468
|
+
var rowIndex = tempSelectedRows.findIndex(item => getRowKey(item) === selectedValue);
|
469
|
+
var rowKeyIndex = tempSelectedRowKeys.findIndex(item => item === selectedValue);
|
483
470
|
if (rowKeyIndex > -1) {
|
484
471
|
tempSelectedRows.splice(rowIndex, 1);
|
485
472
|
tempSelectedRowKeys.splice(rowKeyIndex, 1);
|
@@ -496,9 +483,10 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
496
483
|
selectedRowKeys: tempSelectedRowKeys
|
497
484
|
});
|
498
485
|
};
|
486
|
+
|
499
487
|
// 初始化回显,当传入initParams时,前端用来回险
|
500
488
|
var getInitValues = /*#__PURE__*/function () {
|
501
|
-
var _ref10 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee4() {
|
489
|
+
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee4() {
|
502
490
|
var _useRequest$options5, queryBean, page, params, res, _res$data2, _list, list, _data, nextSelectRowKeys;
|
503
491
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee4$(_context4) {
|
504
492
|
while (1) switch (_context4.prev = _context4.next) {
|
@@ -507,12 +495,12 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
507
495
|
_context4.next = 9;
|
508
496
|
break;
|
509
497
|
}
|
510
|
-
queryBean = (0,
|
511
|
-
page = (0,
|
498
|
+
queryBean = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, defaultParams), initParams || {});
|
499
|
+
page = (0, _objectSpread2.default)({
|
512
500
|
pageNum: 1,
|
513
501
|
pageSize: 10
|
514
|
-
}, useRequest === null || useRequest === void 0
|
515
|
-
params = withPagination ? (0,
|
502
|
+
}, useRequest === null || useRequest === void 0 || (_useRequest$options5 = useRequest.options) === null || _useRequest$options5 === void 0 ? void 0 : _useRequest$options5.page);
|
503
|
+
params = withPagination ? (0, _objectSpread2.default)((0, _objectSpread2.default)({}, page), {}, {
|
516
504
|
queryBean: queryBean !== null && queryBean !== void 0 ? queryBean : {}
|
517
505
|
}) : queryBean;
|
518
506
|
params = transformParams ? transformParams(params) : params;
|
@@ -520,8 +508,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
520
508
|
return runAsync(params);
|
521
509
|
case 7:
|
522
510
|
res = _context4.sent;
|
523
|
-
if (res
|
524
|
-
list = withPagination ? res === null || res === void 0
|
511
|
+
if (res !== null && res !== void 0 && res.data) {
|
512
|
+
list = withPagination ? res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.list : res === null || res === void 0 ? void 0 : res.data;
|
525
513
|
if (transformResponse) {
|
526
514
|
list = transformResponse(res === null || res === void 0 ? void 0 : res.data);
|
527
515
|
}
|
@@ -557,20 +545,21 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
557
545
|
return _ref10.apply(this, arguments);
|
558
546
|
};
|
559
547
|
}();
|
548
|
+
|
560
549
|
// 初始化回显,当传入initParams时,前端用来回险
|
561
550
|
var getDefaultOneValues = /*#__PURE__*/function () {
|
562
|
-
var _ref11 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee5() {
|
551
|
+
var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee5() {
|
563
552
|
var _useRequest$options6;
|
564
553
|
var queryBean, page, params, res, _res$data3, _list2, list, _data2, nextSelectRowKeys;
|
565
554
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee5$(_context5) {
|
566
555
|
while (1) switch (_context5.prev = _context5.next) {
|
567
556
|
case 0:
|
568
|
-
queryBean = (0,
|
569
|
-
page = (0,
|
557
|
+
queryBean = (0, _objectSpread2.default)({}, defaultParams);
|
558
|
+
page = (0, _objectSpread2.default)({
|
570
559
|
pageNum: 1,
|
571
560
|
pageSize: 10
|
572
|
-
}, useRequest === null || useRequest === void 0
|
573
|
-
params = withPagination ? (0,
|
561
|
+
}, useRequest === null || useRequest === void 0 || (_useRequest$options6 = useRequest.options) === null || _useRequest$options6 === void 0 ? void 0 : _useRequest$options6.page);
|
562
|
+
params = withPagination ? (0, _objectSpread2.default)((0, _objectSpread2.default)({}, page), {}, {
|
574
563
|
queryBean: queryBean !== null && queryBean !== void 0 ? queryBean : {}
|
575
564
|
}) : queryBean;
|
576
565
|
params = transformParams ? transformParams(params) : params;
|
@@ -578,8 +567,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
578
567
|
return runAsync(params);
|
579
568
|
case 6:
|
580
569
|
res = _context5.sent;
|
581
|
-
if (res
|
582
|
-
list = withPagination ? res === null || res === void 0
|
570
|
+
if (res !== null && res !== void 0 && res.data) {
|
571
|
+
list = withPagination ? res === null || res === void 0 || (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.list : res === null || res === void 0 ? void 0 : res.data;
|
583
572
|
if (transformResponse) {
|
584
573
|
list = transformResponse(res === null || res === void 0 ? void 0 : res.data);
|
585
574
|
}
|
@@ -589,12 +578,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
589
578
|
onChange(_data2);
|
590
579
|
preValue.current = _data2;
|
591
580
|
} else {
|
592
|
-
onChange(isMultiple ? _data2.map(
|
593
|
-
|
594
|
-
}) : _data2[valueKey]);
|
595
|
-
preValue.current = isMultiple ? _data2.map(function (item) {
|
596
|
-
return item[valueKey];
|
597
|
-
}) : _data2[valueKey];
|
581
|
+
onChange(isMultiple ? _data2.map(item => item[valueKey]) : _data2[valueKey]);
|
582
|
+
preValue.current = isMultiple ? _data2.map(item => item[valueKey]) : _data2[valueKey];
|
598
583
|
}
|
599
584
|
// 更新内部展示值
|
600
585
|
setState({
|
@@ -614,27 +599,28 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
614
599
|
return _ref11.apply(this, arguments);
|
615
600
|
};
|
616
601
|
}();
|
617
|
-
(0, _react.useImperativeHandle)(ref,
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
});
|
623
|
-
(0, _ahooks.useMount)(function () {
|
602
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
603
|
+
handleClick,
|
604
|
+
handleSearch
|
605
|
+
}));
|
606
|
+
(0, _ahooks.useMount)(() => {
|
624
607
|
if (!value) {
|
625
608
|
setState({
|
626
609
|
selectedRowKeys: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || [],
|
627
610
|
selectedRows: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRows) || [],
|
628
611
|
_value: undefined
|
629
612
|
});
|
630
|
-
} else if ((0,
|
613
|
+
} else if ((0, _lodash.isArray)(value)) {
|
631
614
|
setState({
|
632
615
|
selectedRowKeys: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || value,
|
633
616
|
selectedRows: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRows) || value,
|
634
617
|
_value: value
|
635
618
|
});
|
636
|
-
} else if ((0,
|
637
|
-
var initialValue =
|
619
|
+
} else if ((0, _lodash.isObject)(value)) {
|
620
|
+
var initialValue = {
|
621
|
+
[valueKey]: value[valueKey],
|
622
|
+
[labelKey]: value[labelKey]
|
623
|
+
};
|
638
624
|
setState({
|
639
625
|
selectedRowKeys: [value],
|
640
626
|
selectedRows: [initialValue],
|
@@ -642,10 +628,10 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
642
628
|
});
|
643
629
|
}
|
644
630
|
});
|
645
|
-
(0, _react.useEffect)(
|
631
|
+
(0, _react.useEffect)(() => {
|
646
632
|
if (onOff && !visible) {
|
647
633
|
var _useRequest$options7;
|
648
|
-
if ((useRequest === null || useRequest === void 0
|
634
|
+
if ((useRequest === null || useRequest === void 0 || (_useRequest$options7 = useRequest.options) === null || _useRequest$options7 === void 0 ? void 0 : _useRequest$options7.manual) !== true) {
|
649
635
|
onReset();
|
650
636
|
}
|
651
637
|
var nextState = {
|
@@ -656,14 +642,12 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
656
642
|
nextState.selectedRowKeys = [];
|
657
643
|
nextState.selectedRows = [];
|
658
644
|
}
|
659
|
-
if ((0,
|
645
|
+
if ((0, _lodash.isObject)(value)) {
|
660
646
|
nextState.selectedRowKeys = [getRowKey(value)];
|
661
647
|
nextState.selectedRows = [value];
|
662
648
|
}
|
663
|
-
if ((0,
|
664
|
-
nextState.selectedRowKeys = value.map(
|
665
|
-
return getRowKey(item);
|
666
|
-
});
|
649
|
+
if ((0, _lodash.isArray)(value)) {
|
650
|
+
nextState.selectedRowKeys = value.map(item => getRowKey(item));
|
667
651
|
nextState.selectedRows = value;
|
668
652
|
}
|
669
653
|
} else if (value) {
|
@@ -671,57 +655,59 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
671
655
|
var nextSelectedRowKeys = isMultiple ? value : [value];
|
672
656
|
nextState.selectedRowKeys = nextSelectedRowKeys;
|
673
657
|
var list = options !== null && options !== void 0 ? options : data;
|
674
|
-
nextState.selectedRows = list === null || list === void 0
|
658
|
+
nextState.selectedRows = list === null || list === void 0 || (_list$filter = list.filter) === null || _list$filter === void 0 ? void 0 : _list$filter.call(list, item => {
|
675
659
|
return nextSelectedRowKeys.includes(item[valueKey]);
|
676
660
|
});
|
677
661
|
}
|
678
662
|
setState(nextState);
|
679
663
|
}
|
680
664
|
}, [onOff, visible, JSON.stringify(value)]);
|
681
|
-
(0, _react.useEffect)(
|
665
|
+
(0, _react.useEffect)(() => {
|
682
666
|
(0, _utils.hideTooltipIfOpen)(fieldRef.current, visible);
|
683
667
|
}, [visible]);
|
684
|
-
(0, _react.useEffect)(
|
668
|
+
(0, _react.useEffect)(() => {
|
685
669
|
if (value && !visible && isInit && nextMode === 'input') {
|
686
670
|
getInitValues();
|
687
671
|
}
|
688
672
|
}, [JSON.stringify(value), visible, isInit]);
|
689
|
-
(0, _ahooks.useDebounceEffect)(
|
690
|
-
if (value && !visible && nextMode === 'select' && (!(0,
|
673
|
+
(0, _ahooks.useDebounceEffect)(() => {
|
674
|
+
if (value && !visible && nextMode === 'select' && (!(0, _lodash.isEqual)(value, preValue.current) || (options === null || options === void 0 ? void 0 : options.length) === 0)) {
|
691
675
|
var _options$some;
|
692
676
|
preValue.current = value;
|
693
677
|
var _data3 = labelInValue ? value[valueKey] : value;
|
694
|
-
var isHasValue = options === null || options === void 0
|
695
|
-
return item[valueKey] === _data3;
|
696
|
-
});
|
678
|
+
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);
|
697
679
|
if (isHasValue) {
|
698
680
|
return;
|
699
681
|
}
|
700
682
|
if (useRequest) {
|
701
683
|
// 加定时器 修复依赖数据同步更新未取到问题
|
702
|
-
setTimeout(
|
684
|
+
setTimeout(() => {
|
703
685
|
var params = withPagination ? {
|
704
686
|
pageNum: 1,
|
705
687
|
pageSize: 50,
|
706
|
-
queryBean: (0,
|
707
|
-
|
688
|
+
queryBean: (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, defaultParams), initParams), {}, {
|
689
|
+
[searchKey !== null && searchKey !== void 0 ? searchKey : valueKey]: _data3
|
690
|
+
})
|
691
|
+
} : (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, defaultParams), initParams), {}, {
|
692
|
+
[searchKey !== null && searchKey !== void 0 ? searchKey : valueKey]: _data3
|
693
|
+
});
|
708
694
|
var nextParams = transformParams ? transformParams(params) : params;
|
709
695
|
run(nextParams);
|
710
696
|
}, 300);
|
711
697
|
}
|
712
698
|
}
|
713
699
|
}, [JSON.stringify(value), visible, JSON.stringify(defaultParams), JSON.stringify(initParams), options === null || options === void 0 ? void 0 : options.length]);
|
714
|
-
var handleSelectFocus =
|
700
|
+
var handleSelectFocus = () => {
|
715
701
|
if (useRequest) {
|
716
702
|
var queryBean = defaultParams || {};
|
717
703
|
var params = withPagination ? {
|
718
704
|
pageNum: 1,
|
719
705
|
pageSize: 50,
|
720
|
-
queryBean
|
706
|
+
queryBean
|
721
707
|
} : queryBean;
|
722
708
|
var nextParams = transformParams ? transformParams(params) : params;
|
723
709
|
// 减少请求条件一致时,且请求过时,focus的重复请求
|
724
|
-
if (!(0,
|
710
|
+
if (!(0, _lodash.isEqual)(queryBean, defaultParamsRef.current) || !(options !== null && options !== void 0 && options.length)) {
|
725
711
|
run(nextParams); // 触发 run 请求
|
726
712
|
defaultParamsRef.current = queryBean; // 更新缓存
|
727
713
|
}
|
@@ -730,19 +716,21 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
730
716
|
});
|
731
717
|
}
|
732
718
|
};
|
733
|
-
var handleSelectSearch = (0,
|
719
|
+
var handleSelectSearch = (0, _lodash.debounce)(val => {
|
734
720
|
if (useRequest) {
|
735
|
-
var queryBean = (0,
|
721
|
+
var queryBean = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, defaultParams), {}, {
|
722
|
+
[searchKey !== null && searchKey !== void 0 ? searchKey : labelKey]: val
|
723
|
+
});
|
736
724
|
var params = withPagination ? {
|
737
725
|
pageNum: 1,
|
738
726
|
pageSize: 50,
|
739
|
-
queryBean
|
727
|
+
queryBean
|
740
728
|
} : queryBean;
|
741
729
|
var nextParams = transformParams ? transformParams(params) : params;
|
742
730
|
run(nextParams);
|
743
731
|
}
|
744
732
|
}, 1000);
|
745
|
-
(0, _ahooks.useDebounceEffect)(
|
733
|
+
(0, _ahooks.useDebounceEffect)(() => {
|
746
734
|
if (!value) {
|
747
735
|
if (defaultOne) {
|
748
736
|
getDefaultOneValues();
|
@@ -755,14 +743,14 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
755
743
|
}
|
756
744
|
}
|
757
745
|
if (nextMode === 'input') {
|
758
|
-
if (labelInValue && _value && !(0,
|
746
|
+
if (labelInValue && _value && !(0, _lodash.isEqual)(value, _value)) {
|
759
747
|
setState({
|
760
748
|
_value: value,
|
761
749
|
selectedRowKeys: [],
|
762
750
|
selectedRows: []
|
763
751
|
});
|
764
752
|
}
|
765
|
-
if (!labelInValue && !(0,
|
753
|
+
if (!labelInValue && !(0, _lodash.isEqual)(value, _value === null || _value === void 0 ? void 0 : _value[valueKey])) {
|
766
754
|
setState({
|
767
755
|
_value: value,
|
768
756
|
selectedRowKeys: [],
|
@@ -771,13 +759,14 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
771
759
|
}
|
772
760
|
}
|
773
761
|
}, [value, _value]);
|
762
|
+
|
774
763
|
// 加个中间状态Input
|
775
|
-
var initRender = (0, _jsxRuntime.jsxs)(_space.default.Compact, {
|
764
|
+
var initRender = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_space.default.Compact, {
|
776
765
|
style: {
|
777
766
|
width: '100%'
|
778
767
|
},
|
779
768
|
block: true,
|
780
|
-
children: [nextMode === 'select' ? (0, _jsxRuntime.jsx)(_index.ProSelect, (0,
|
769
|
+
children: [nextMode === 'select' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ProSelect, (0, _objectSpread2.default)({
|
781
770
|
value: value,
|
782
771
|
onChange: handleSelectValue,
|
783
772
|
disabled: disabled,
|
@@ -788,7 +777,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
788
777
|
optionRender: optionRender,
|
789
778
|
scrollFollowParent: false,
|
790
779
|
mode: isMultiple ? 'multiple' : undefined,
|
791
|
-
notFoundContent: selectLoading ? (0, _jsxRuntime.jsx)(_spin.default, {
|
780
|
+
notFoundContent: selectLoading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_spin.default, {
|
792
781
|
size: "small"
|
793
782
|
}) : null,
|
794
783
|
onFocus: handleSelectFocus,
|
@@ -797,18 +786,18 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
797
786
|
style: {
|
798
787
|
width: isView || disabled ? '100%' : 'calc(100% - 30px)'
|
799
788
|
}
|
800
|
-
}, restProps)) : (0, _jsxRuntime.jsx)(_tooltip2.default, {
|
789
|
+
}, restProps)) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_tooltip2.default, {
|
801
790
|
title: _tooltip ? viewText : null,
|
802
791
|
placement: "topLeft",
|
803
|
-
children: (0, _jsxRuntime.jsx)(_input.default, (0,
|
792
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_input.default, (0, _objectSpread2.default)({
|
804
793
|
value: viewText,
|
805
794
|
onChange: handleChangeValue,
|
806
795
|
disabled: disabled,
|
807
796
|
autoComplete: "off",
|
808
797
|
allowClear: true
|
809
798
|
}, restProps))
|
810
|
-
}), isView || disabled ? null : (0, _jsxRuntime.jsx)(_button.default, {
|
811
|
-
icon: (0, _jsxRuntime.jsx)(_reactSvg.ReactSVG, {
|
799
|
+
}), isView || disabled ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.default, {
|
800
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSvg.ReactSVG, {
|
812
801
|
className: "viewSvg",
|
813
802
|
src: _view.default,
|
814
803
|
onClick: handleClick
|
@@ -816,71 +805,73 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
816
805
|
})]
|
817
806
|
});
|
818
807
|
if (customRender && /*#__PURE__*/_react.default.isValidElement(customRender)) {
|
819
|
-
initRender = (0, _jsxRuntime.jsx)("div", {
|
808
|
+
initRender = /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
820
809
|
className: "pro-modal-select-init",
|
821
810
|
onClick: handleClick,
|
822
811
|
children: customRender
|
823
812
|
});
|
824
813
|
}
|
825
|
-
(0, _ahooks.useDeepCompareEffect)(
|
814
|
+
(0, _ahooks.useDeepCompareEffect)(() => {
|
826
815
|
setState({
|
827
816
|
options: (tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource) || []
|
828
817
|
});
|
829
818
|
}, [tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource]);
|
819
|
+
|
830
820
|
// 当搜索条件只有一个时,且为输入框,默认设置suffix
|
831
|
-
if ((formColumns === null || formColumns === void 0 ? void 0 : formColumns.length) === 1 && (formColumns === null || formColumns === void 0
|
832
|
-
var _formColumns$2, _formColumns$3
|
833
|
-
if (!((_formColumns$2 = formColumns[0])
|
821
|
+
if ((formColumns === null || formColumns === void 0 ? void 0 : formColumns.length) === 1 && (formColumns === null || formColumns === void 0 || (_formColumns$ = formColumns[0]) === null || _formColumns$ === void 0 ? void 0 : _formColumns$.type) === 'Input') {
|
822
|
+
var _formColumns$2, _formColumns$3;
|
823
|
+
if (!((_formColumns$2 = formColumns[0]) !== null && _formColumns$2 !== void 0 && _formColumns$2.fieldProps)) {
|
834
824
|
formColumns[0].fieldProps = {};
|
835
825
|
}
|
836
|
-
if (!(0,
|
837
|
-
formColumns[0].fieldProps.suffix = (0, _jsxRuntime.jsx)(_icons.SearchOutlined, {
|
826
|
+
if (!(0, _lodash.isFunction)(formColumns[0].fieldProps) && !(formColumns !== null && formColumns !== void 0 && (_formColumns$3 = formColumns[0]) !== null && _formColumns$3 !== void 0 && (_formColumns$3 = _formColumns$3.fieldProps) !== null && _formColumns$3 !== void 0 && _formColumns$3.suffix)) {
|
827
|
+
formColumns[0].fieldProps.suffix = /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.SearchOutlined, {
|
838
828
|
onClick: handleSearch
|
839
829
|
});
|
840
830
|
}
|
841
831
|
}
|
842
832
|
if (isView) {
|
843
833
|
if (!value) {
|
844
|
-
return (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
834
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
845
835
|
children: viewEmpty
|
846
836
|
});
|
847
837
|
}
|
848
|
-
return (0, _jsxRuntime.jsx)(_Container.default, {
|
838
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Container.default, {
|
849
839
|
viewEmpty: viewEmpty,
|
850
|
-
children:
|
840
|
+
children: `${viewText}`
|
851
841
|
});
|
852
842
|
}
|
853
|
-
var _className = (0, _classnames.default)(
|
854
|
-
'pro-modal-select': true
|
855
|
-
|
856
|
-
|
857
|
-
|
843
|
+
var _className = (0, _classnames.default)({
|
844
|
+
'pro-modal-select': true,
|
845
|
+
[props.className]: props.className,
|
846
|
+
'pro-modal-select-open': visible
|
847
|
+
});
|
848
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
849
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
858
850
|
id: uuid,
|
859
851
|
className: _className,
|
860
852
|
style: style,
|
861
853
|
ref: fieldRef,
|
862
854
|
children: initRender
|
863
|
-
}), (0, _jsxRuntime.jsxs)(_index.ProDrawerForm, (0,
|
855
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_index.ProDrawerForm, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
864
856
|
mode: "Modal",
|
865
857
|
title: title,
|
866
|
-
onOk: handleFinish
|
858
|
+
onOk: handleFinish
|
867
859
|
// @ts-ignore
|
860
|
+
,
|
868
861
|
onCancel: handleClose,
|
869
862
|
open: visible
|
870
863
|
}, restModalProps), {}, {
|
871
|
-
children: [(0, _jsxRuntime.jsx)(_index.ProForm, {
|
864
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ProForm, {
|
872
865
|
submitOnEnter: true,
|
873
866
|
form: form,
|
874
867
|
columns: formColumns,
|
875
868
|
onFinish: handleSearch,
|
876
869
|
confirmLoading: loading,
|
877
870
|
footer: (formColumns === null || formColumns === void 0 ? void 0 : formColumns.length) > 1
|
878
|
-
}), (0, _jsxRuntime.jsx)(_index.ProTable, (0,
|
879
|
-
onRow:
|
871
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ProTable, (0, _objectSpread2.default)({
|
872
|
+
onRow: record => {
|
880
873
|
return {
|
881
|
-
onClick:
|
882
|
-
return handleClickRow(record);
|
883
|
-
}
|
874
|
+
onClick: () => handleClickRow(record)
|
884
875
|
};
|
885
876
|
},
|
886
877
|
rowKey: rowKey,
|