@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
@@ -1,15 +1,13 @@
|
|
1
|
+
import "antd/es/space/style";
|
2
|
+
import _Space from "antd/es/space";
|
1
3
|
import "antd/es/button/style";
|
2
4
|
import _Button from "antd/es/button";
|
3
|
-
import "antd/es/input/style";
|
4
|
-
import _Input from "antd/es/input";
|
5
5
|
import "antd/es/tooltip/style";
|
6
6
|
import _Tooltip from "antd/es/tooltip";
|
7
|
+
import "antd/es/input/style";
|
8
|
+
import _Input from "antd/es/input";
|
7
9
|
import "antd/es/spin/style";
|
8
10
|
import _Spin from "antd/es/spin";
|
9
|
-
import "antd/es/space/style";
|
10
|
-
import _Space from "antd/es/space";
|
11
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
12
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
13
11
|
import "antd/es/message/style";
|
14
12
|
import _message from "antd/es/message";
|
15
13
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
@@ -19,29 +17,26 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
19
17
|
import "antd/es/form/style";
|
20
18
|
import _Form from "antd/es/form";
|
21
19
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
22
|
-
import _isObject from "lodash/isObject";
|
23
|
-
import _isFunction from "lodash/isFunction";
|
24
|
-
import _isEqual from "lodash/isEqual";
|
25
|
-
import _isBoolean from "lodash/isBoolean";
|
26
|
-
import _isArray from "lodash/isArray";
|
27
|
-
import _debounce from "lodash/debounce";
|
28
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"],
|
29
21
|
_excluded2 = ["onOk"],
|
30
22
|
_excluded3 = ["rowKey", "columns", "rowSelection"];
|
31
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
32
23
|
import { SearchOutlined } from '@ant-design/icons';
|
33
24
|
import { useDebounceEffect, useDeepCompareEffect, useMount, useSetState } from 'ahooks';
|
25
|
+
import { debounce, isArray, isBoolean, isEqual, isFunction, isObject } from 'lodash';
|
34
26
|
import classNames from 'classnames';
|
35
27
|
import { ReactSVG } from 'react-svg';
|
36
28
|
import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
37
|
-
import { ProForm, ProDrawerForm, ProTable, useProConfig, ProSelect } from
|
38
|
-
import Container from
|
39
|
-
import viewSvg from
|
40
|
-
import useRequestList from
|
41
|
-
import locale from
|
42
|
-
import { hideTooltipIfOpen } from
|
43
|
-
|
44
|
-
|
29
|
+
import { ProForm, ProDrawerForm, ProTable, useProConfig, ProSelect } from "../../../../index";
|
30
|
+
import Container from "../../Container";
|
31
|
+
import viewSvg from "../../../../assets/view.svg";
|
32
|
+
import useRequestList from "./hooks/useRequestList";
|
33
|
+
import locale from "../../../../locale";
|
34
|
+
import { hideTooltipIfOpen } from "./utils";
|
35
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
36
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
37
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
38
|
+
var ProModalSelect = (props, ref) => {
|
39
|
+
var _useRequest$options, _useRequest$options2, _useRequest$options3, _formColumns$;
|
45
40
|
var value = props.value,
|
46
41
|
onChange = props.onChange,
|
47
42
|
disabled = props.disabled,
|
@@ -71,8 +66,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
71
66
|
otherProps = props.otherProps,
|
72
67
|
restProps = _objectWithoutProperties(props, _excluded);
|
73
68
|
var _tooltip = tooltip !== null && tooltip !== void 0 ? tooltip : isTooltip;
|
74
|
-
var nextMode = useMemo(
|
75
|
-
if (
|
69
|
+
var nextMode = useMemo(() => {
|
70
|
+
if (isBoolean(readOnly) && readOnly === false) {
|
76
71
|
return 'input';
|
77
72
|
}
|
78
73
|
return mode;
|
@@ -98,10 +93,13 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
98
93
|
isViewCon = _ref2.isView,
|
99
94
|
viewEmpty = _ref2.viewEmpty;
|
100
95
|
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
|
96
|
+
|
101
97
|
// 是否多选
|
102
98
|
var isMultiple = type === 'checkbox';
|
99
|
+
|
103
100
|
// 生成一个唯一id,用于满足tooltip功能
|
104
101
|
var uuid = Math.random().toString(36).slice(-6);
|
102
|
+
|
105
103
|
// 全局配置fieldNames指定 value与label的key
|
106
104
|
var _ref3 = useProConfig('ProModalSelect') || {},
|
107
105
|
_ref3$fieldNames = _ref3.fieldNames,
|
@@ -112,6 +110,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
112
110
|
labelKey = proModalSelectFieldNames.label;
|
113
111
|
valueKey = proModalSelectFieldNames.value;
|
114
112
|
}
|
113
|
+
|
115
114
|
// 表单上配置的权重大于全局配置
|
116
115
|
if (fieldNames && Object.keys(fieldNames).length) {
|
117
116
|
labelKey = fieldNames.label;
|
@@ -126,8 +125,9 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
126
125
|
var preValue = useRef(value);
|
127
126
|
// 表单项的ref
|
128
127
|
var fieldRef = useRef(null);
|
129
|
-
var defaultParams = Array.isArray(useRequest === null || useRequest === void 0
|
128
|
+
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) || {};
|
130
129
|
var defaultParamsRef = useRef(defaultParams); // 缓存 defaultParams 的引用
|
130
|
+
|
131
131
|
var _useSetState = useSetState({
|
132
132
|
_value: value,
|
133
133
|
isInit: true,
|
@@ -155,14 +155,14 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
155
155
|
var selectedRows = (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRows) || _selectedRows;
|
156
156
|
var selectedRowKeys = (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || _selectedRowKeys;
|
157
157
|
var _useRequestList = useRequestList(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, {
|
158
|
-
withPagination
|
159
|
-
transformParams
|
160
|
-
transformResponse
|
158
|
+
withPagination,
|
159
|
+
transformParams,
|
160
|
+
transformResponse
|
161
161
|
}, _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
|
162
162
|
manual: true,
|
163
|
-
onSuccess
|
163
|
+
onSuccess(res) {
|
164
164
|
var _res$data, _ref5;
|
165
|
-
var list = withPagination ? res === null || res === void 0
|
165
|
+
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;
|
166
166
|
setState({
|
167
167
|
options: (_ref5 = transformResponse ? transformResponse(res === null || res === void 0 ? void 0 : res.data) : list) !== null && _ref5 !== void 0 ? _ref5 : []
|
168
168
|
});
|
@@ -170,18 +170,18 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
170
170
|
})),
|
171
171
|
run = _useRequestList.run,
|
172
172
|
selectLoading = _useRequestList.loading;
|
173
|
-
var initParams = useMemo(
|
173
|
+
var initParams = useMemo(() => {
|
174
174
|
var nextInitParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams;
|
175
175
|
if (typeof (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) === 'function') {
|
176
176
|
var _contentForm$getField;
|
177
|
-
nextInitParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams(value, contentForm === null || contentForm === void 0
|
177
|
+
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));
|
178
178
|
}
|
179
179
|
return nextInitParams;
|
180
180
|
}, [value]);
|
181
181
|
var _useRequestList2 = useRequestList(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, {
|
182
|
-
withPagination
|
183
|
-
transformParams
|
184
|
-
transformResponse
|
182
|
+
withPagination,
|
183
|
+
transformParams,
|
184
|
+
transformResponse
|
185
185
|
}, _objectSpread({
|
186
186
|
ready: (initParams || defaultOne) && nextMode === 'input' || visible
|
187
187
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options)),
|
@@ -192,50 +192,47 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
192
192
|
onReset = _useRequestList2.onReset,
|
193
193
|
runAsync = _useRequestList2.runAsync,
|
194
194
|
mutate = _useRequestList2.mutate;
|
195
|
-
var defaultOptionRender =
|
196
|
-
return rowData === null || rowData === void 0 ? void 0 : rowData[labelKey];
|
197
|
-
};
|
195
|
+
var defaultOptionRender = rowData => rowData === null || rowData === void 0 ? void 0 : rowData[labelKey];
|
198
196
|
var handleFormat = onFormat || defaultOptionRender;
|
199
197
|
if (showCodeName) {
|
200
|
-
handleFormat =
|
198
|
+
handleFormat = _ref6 => {
|
201
199
|
var value = _ref6.value,
|
202
200
|
label = _ref6.label;
|
203
|
-
return
|
201
|
+
return `${value}-${label}`;
|
204
202
|
};
|
205
203
|
}
|
204
|
+
|
206
205
|
/**
|
207
206
|
* 格式化数据方法,展示在输入框中
|
208
207
|
* @date 2023-02-16
|
209
208
|
* @param {any} data 当前选中的值 labelInValue模式下为选中行对象,单值模式为value值
|
210
209
|
* @returns {any}
|
211
210
|
*/
|
212
|
-
var formatValue =
|
211
|
+
var formatValue = data => {
|
213
212
|
var _data$map;
|
214
213
|
if (typeof data === 'string' || typeof data === 'number') {
|
215
214
|
return data;
|
216
215
|
}
|
217
|
-
if (
|
216
|
+
if (isObject(data)) {
|
218
217
|
return handleFormat(_objectSpread(_objectSpread({}, data), {}, {
|
219
218
|
value: data[valueKey],
|
220
219
|
label: data[labelKey]
|
221
220
|
}));
|
222
221
|
}
|
223
|
-
return
|
222
|
+
return isArray(data) ? data === null || data === void 0 || (_data$map = data.map(item => {
|
224
223
|
return handleFormat(_objectSpread(_objectSpread({}, item), {}, {
|
225
224
|
value: item[valueKey],
|
226
225
|
label: item[labelKey]
|
227
226
|
}));
|
228
227
|
})) === null || _data$map === void 0 ? void 0 : _data$map.join(',') : '';
|
229
228
|
};
|
230
|
-
var viewText = useMemo(
|
229
|
+
var viewText = useMemo(() => {
|
231
230
|
var nextValue = labelInValue ? value : _value;
|
232
231
|
if (labelInValue) {
|
233
232
|
nextValue = value;
|
234
233
|
} else {
|
235
234
|
var _options$find;
|
236
|
-
var optionDTO = options === null || options === void 0
|
237
|
-
return item[valueKey] === value;
|
238
|
-
});
|
235
|
+
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);
|
239
236
|
if (optionDTO) {
|
240
237
|
nextValue = optionDTO;
|
241
238
|
} else {
|
@@ -244,33 +241,33 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
244
241
|
}
|
245
242
|
return formatValue(nextValue);
|
246
243
|
}, [value, _value, options]);
|
244
|
+
|
247
245
|
/**
|
248
246
|
* 获取表格的rowKey,支持函数、字符串
|
249
247
|
* @date 2023-02-16
|
250
248
|
* @param {any} record 表格行数据
|
251
249
|
* @returns {any}
|
252
250
|
*/
|
253
|
-
var getRowKey =
|
254
|
-
if (
|
251
|
+
var getRowKey = record => {
|
252
|
+
if (isFunction(rowKey)) {
|
255
253
|
return rowKey(record);
|
256
254
|
}
|
257
255
|
return record[rowKey];
|
258
256
|
};
|
257
|
+
|
259
258
|
/**
|
260
259
|
* 执行onChange暴露出来的第一个参数取数方法
|
261
260
|
* @date 2023-02-16
|
262
261
|
* @param {any} selectedRows 选中行数据
|
263
262
|
* @returns {any}
|
264
263
|
*/
|
265
|
-
var getNextValues =
|
264
|
+
var getNextValues = selectedRows => {
|
266
265
|
if (isMultiple) {
|
267
|
-
return selectedRows.map(
|
268
|
-
return item === null || item === void 0 ? void 0 : item[valueKey];
|
269
|
-
});
|
266
|
+
return selectedRows.map(item => item === null || item === void 0 ? void 0 : item[valueKey]);
|
270
267
|
}
|
271
268
|
return selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows[valueKey];
|
272
269
|
};
|
273
|
-
var handleChangeValue =
|
270
|
+
var handleChangeValue = e => {
|
274
271
|
onChange(e.target.value);
|
275
272
|
preValue.current = e.target.value;
|
276
273
|
if (nextMode === 'input') {
|
@@ -279,12 +276,12 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
279
276
|
});
|
280
277
|
}
|
281
278
|
};
|
282
|
-
var handleSelectValue =
|
279
|
+
var handleSelectValue = (val, option) => {
|
283
280
|
onChange(val, option);
|
284
281
|
preValue.current = val;
|
285
282
|
};
|
286
283
|
var handleClick = /*#__PURE__*/function () {
|
287
|
-
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
284
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
288
285
|
var _yield$beforeOpen, res;
|
289
286
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
290
287
|
while (1) switch (_context.prev = _context.next) {
|
@@ -319,8 +316,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
319
316
|
setState({
|
320
317
|
onOff: true
|
321
318
|
});
|
322
|
-
setTimeout(
|
323
|
-
afterOpen === null || afterOpen === void 0
|
319
|
+
setTimeout(() => {
|
320
|
+
afterOpen === null || afterOpen === void 0 || afterOpen({
|
324
321
|
setInnerState: setState
|
325
322
|
});
|
326
323
|
}, 100);
|
@@ -335,7 +332,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
335
332
|
return _ref7.apply(this, arguments);
|
336
333
|
};
|
337
334
|
}();
|
338
|
-
var handleClose =
|
335
|
+
var handleClose = () => {
|
339
336
|
var _useRequest$options4;
|
340
337
|
form.resetFields();
|
341
338
|
setState({
|
@@ -343,21 +340,20 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
343
340
|
visible: false,
|
344
341
|
isInit: false
|
345
342
|
});
|
343
|
+
|
346
344
|
// 当设置manual为true时,清空当前弹框内已搜索出来的值
|
347
|
-
if (useRequest
|
348
|
-
mutate(
|
349
|
-
return [];
|
350
|
-
});
|
345
|
+
if (useRequest !== null && useRequest !== void 0 && (_useRequest$options4 = useRequest.options) !== null && _useRequest$options4 !== void 0 && _useRequest$options4.manual) {
|
346
|
+
mutate(() => []);
|
351
347
|
}
|
352
348
|
};
|
353
349
|
var handleFinish = /*#__PURE__*/function () {
|
354
|
-
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
350
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
355
351
|
var _nextSelectedRows, _nextSelectedRows2, nextSelectedRows, record, flag, res;
|
356
352
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
357
353
|
while (1) switch (_context2.prev = _context2.next) {
|
358
354
|
case 0:
|
359
355
|
_context2.prev = 0;
|
360
|
-
if (!(!(selectedRowKeys
|
356
|
+
if (!(!(selectedRowKeys !== null && selectedRowKeys !== void 0 && selectedRowKeys.length) || !(selectedRows !== null && selectedRows !== void 0 && selectedRows.length))) {
|
361
357
|
_context2.next = 4;
|
362
358
|
break;
|
363
359
|
}
|
@@ -365,10 +361,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
365
361
|
return _context2.abrupt("return", false);
|
366
362
|
case 4:
|
367
363
|
nextSelectedRows = selectedRows;
|
368
|
-
if (!((_nextSelectedRows = nextSelectedRows)
|
369
|
-
nextSelectedRows = data.filter(
|
370
|
-
return selectedRowKeys.includes(item[valueKey]);
|
371
|
-
});
|
364
|
+
if (!((_nextSelectedRows = nextSelectedRows) !== null && _nextSelectedRows !== void 0 && _nextSelectedRows[0])) {
|
365
|
+
nextSelectedRows = data.filter(item => selectedRowKeys.includes(item[valueKey]));
|
372
366
|
}
|
373
367
|
record = isMultiple ? nextSelectedRows : (_nextSelectedRows2 = nextSelectedRows) === null || _nextSelectedRows2 === void 0 ? void 0 : _nextSelectedRows2[0];
|
374
368
|
if (!isMultiple) {
|
@@ -392,12 +386,12 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
392
386
|
}
|
393
387
|
case 14:
|
394
388
|
if (flag) {
|
395
|
-
onChange === null || onChange === void 0
|
389
|
+
onChange === null || onChange === void 0 || onChange(labelInValue ? record : getNextValues(record), record);
|
396
390
|
preValue.current = labelInValue ? record : getNextValues(record);
|
397
391
|
// 更新内部展示值
|
398
392
|
setState({
|
399
393
|
_value: record,
|
400
|
-
options:
|
394
|
+
options: isArray(record) ? record : [record]
|
401
395
|
});
|
402
396
|
handleClose();
|
403
397
|
}
|
@@ -417,7 +411,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
417
411
|
};
|
418
412
|
}();
|
419
413
|
var handleSearch = /*#__PURE__*/function () {
|
420
|
-
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
414
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
421
415
|
var values;
|
422
416
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
423
417
|
while (1) switch (_context3.prev = _context3.next) {
|
@@ -440,38 +434,33 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
440
434
|
};
|
441
435
|
}();
|
442
436
|
var _rowSelection = _objectSpread({
|
443
|
-
type
|
444
|
-
onChange:
|
437
|
+
type,
|
438
|
+
onChange: (rowKeys, rows) => {
|
445
439
|
setState({
|
446
440
|
selectedRowKeys: rowKeys,
|
447
441
|
selectedRows: rows
|
448
442
|
});
|
449
443
|
},
|
450
|
-
getCheckboxProps:
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
selectedRowKeys: selectedRowKeys,
|
456
|
-
selectedRows: selectedRows
|
444
|
+
getCheckboxProps: record => ({
|
445
|
+
disabled: record === null || record === void 0 ? void 0 : record.disabled
|
446
|
+
}),
|
447
|
+
selectedRowKeys,
|
448
|
+
selectedRows
|
457
449
|
}, rowSelection);
|
450
|
+
|
458
451
|
// 点击行进行勾选
|
459
|
-
var handleClickRow =
|
460
|
-
var _rowSelection$getChec
|
461
|
-
if (_rowSelection
|
452
|
+
var handleClickRow = record => {
|
453
|
+
var _rowSelection$getChec;
|
454
|
+
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) {
|
462
455
|
return;
|
463
456
|
}
|
464
|
-
if (record
|
457
|
+
if (record !== null && record !== void 0 && record.disabled) return;
|
465
458
|
var selectedValue = getRowKey(record);
|
466
|
-
var tempSelectedRows =
|
467
|
-
var tempSelectedRowKeys =
|
459
|
+
var tempSelectedRows = [...selectedRows];
|
460
|
+
var tempSelectedRowKeys = [...selectedRowKeys];
|
468
461
|
if (isMultiple) {
|
469
|
-
var rowIndex = tempSelectedRows.findIndex(
|
470
|
-
|
471
|
-
});
|
472
|
-
var rowKeyIndex = tempSelectedRowKeys.findIndex(function (item) {
|
473
|
-
return item === selectedValue;
|
474
|
-
});
|
462
|
+
var rowIndex = tempSelectedRows.findIndex(item => getRowKey(item) === selectedValue);
|
463
|
+
var rowKeyIndex = tempSelectedRowKeys.findIndex(item => item === selectedValue);
|
475
464
|
if (rowKeyIndex > -1) {
|
476
465
|
tempSelectedRows.splice(rowIndex, 1);
|
477
466
|
tempSelectedRowKeys.splice(rowKeyIndex, 1);
|
@@ -488,9 +477,10 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
488
477
|
selectedRowKeys: tempSelectedRowKeys
|
489
478
|
});
|
490
479
|
};
|
480
|
+
|
491
481
|
// 初始化回显,当传入initParams时,前端用来回险
|
492
482
|
var getInitValues = /*#__PURE__*/function () {
|
493
|
-
var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
483
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
494
484
|
var _useRequest$options5, queryBean, page, params, res, _res$data2, _list, list, _data, nextSelectRowKeys;
|
495
485
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
496
486
|
while (1) switch (_context4.prev = _context4.next) {
|
@@ -503,7 +493,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
503
493
|
page = _objectSpread({
|
504
494
|
pageNum: 1,
|
505
495
|
pageSize: 10
|
506
|
-
}, useRequest === null || useRequest === void 0
|
496
|
+
}, useRequest === null || useRequest === void 0 || (_useRequest$options5 = useRequest.options) === null || _useRequest$options5 === void 0 ? void 0 : _useRequest$options5.page);
|
507
497
|
params = withPagination ? _objectSpread(_objectSpread({}, page), {}, {
|
508
498
|
queryBean: queryBean !== null && queryBean !== void 0 ? queryBean : {}
|
509
499
|
}) : queryBean;
|
@@ -512,8 +502,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
512
502
|
return runAsync(params);
|
513
503
|
case 7:
|
514
504
|
res = _context4.sent;
|
515
|
-
if (res
|
516
|
-
list = withPagination ? res === null || res === void 0
|
505
|
+
if (res !== null && res !== void 0 && res.data) {
|
506
|
+
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;
|
517
507
|
if (transformResponse) {
|
518
508
|
list = transformResponse(res === null || res === void 0 ? void 0 : res.data);
|
519
509
|
}
|
@@ -549,9 +539,10 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
549
539
|
return _ref10.apply(this, arguments);
|
550
540
|
};
|
551
541
|
}();
|
542
|
+
|
552
543
|
// 初始化回显,当传入initParams时,前端用来回险
|
553
544
|
var getDefaultOneValues = /*#__PURE__*/function () {
|
554
|
-
var _ref11 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
545
|
+
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
555
546
|
var _useRequest$options6;
|
556
547
|
var queryBean, page, params, res, _res$data3, _list2, list, _data2, nextSelectRowKeys;
|
557
548
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
@@ -561,7 +552,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
561
552
|
page = _objectSpread({
|
562
553
|
pageNum: 1,
|
563
554
|
pageSize: 10
|
564
|
-
}, useRequest === null || useRequest === void 0
|
555
|
+
}, useRequest === null || useRequest === void 0 || (_useRequest$options6 = useRequest.options) === null || _useRequest$options6 === void 0 ? void 0 : _useRequest$options6.page);
|
565
556
|
params = withPagination ? _objectSpread(_objectSpread({}, page), {}, {
|
566
557
|
queryBean: queryBean !== null && queryBean !== void 0 ? queryBean : {}
|
567
558
|
}) : queryBean;
|
@@ -570,8 +561,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
570
561
|
return runAsync(params);
|
571
562
|
case 6:
|
572
563
|
res = _context5.sent;
|
573
|
-
if (res
|
574
|
-
list = withPagination ? res === null || res === void 0
|
564
|
+
if (res !== null && res !== void 0 && res.data) {
|
565
|
+
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;
|
575
566
|
if (transformResponse) {
|
576
567
|
list = transformResponse(res === null || res === void 0 ? void 0 : res.data);
|
577
568
|
}
|
@@ -581,12 +572,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
581
572
|
onChange(_data2);
|
582
573
|
preValue.current = _data2;
|
583
574
|
} else {
|
584
|
-
onChange(isMultiple ? _data2.map(
|
585
|
-
|
586
|
-
}) : _data2[valueKey]);
|
587
|
-
preValue.current = isMultiple ? _data2.map(function (item) {
|
588
|
-
return item[valueKey];
|
589
|
-
}) : _data2[valueKey];
|
575
|
+
onChange(isMultiple ? _data2.map(item => item[valueKey]) : _data2[valueKey]);
|
576
|
+
preValue.current = isMultiple ? _data2.map(item => item[valueKey]) : _data2[valueKey];
|
590
577
|
}
|
591
578
|
// 更新内部展示值
|
592
579
|
setState({
|
@@ -606,27 +593,28 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
606
593
|
return _ref11.apply(this, arguments);
|
607
594
|
};
|
608
595
|
}();
|
609
|
-
useImperativeHandle(ref,
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
});
|
615
|
-
useMount(function () {
|
596
|
+
useImperativeHandle(ref, () => ({
|
597
|
+
handleClick,
|
598
|
+
handleSearch
|
599
|
+
}));
|
600
|
+
useMount(() => {
|
616
601
|
if (!value) {
|
617
602
|
setState({
|
618
603
|
selectedRowKeys: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || [],
|
619
604
|
selectedRows: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRows) || [],
|
620
605
|
_value: undefined
|
621
606
|
});
|
622
|
-
} else if (
|
607
|
+
} else if (isArray(value)) {
|
623
608
|
setState({
|
624
609
|
selectedRowKeys: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || value,
|
625
610
|
selectedRows: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRows) || value,
|
626
611
|
_value: value
|
627
612
|
});
|
628
|
-
} else if (
|
629
|
-
var initialValue =
|
613
|
+
} else if (isObject(value)) {
|
614
|
+
var initialValue = {
|
615
|
+
[valueKey]: value[valueKey],
|
616
|
+
[labelKey]: value[labelKey]
|
617
|
+
};
|
630
618
|
setState({
|
631
619
|
selectedRowKeys: [value],
|
632
620
|
selectedRows: [initialValue],
|
@@ -634,10 +622,10 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
634
622
|
});
|
635
623
|
}
|
636
624
|
});
|
637
|
-
useEffect(
|
625
|
+
useEffect(() => {
|
638
626
|
if (onOff && !visible) {
|
639
627
|
var _useRequest$options7;
|
640
|
-
if ((useRequest === null || useRequest === void 0
|
628
|
+
if ((useRequest === null || useRequest === void 0 || (_useRequest$options7 = useRequest.options) === null || _useRequest$options7 === void 0 ? void 0 : _useRequest$options7.manual) !== true) {
|
641
629
|
onReset();
|
642
630
|
}
|
643
631
|
var nextState = {
|
@@ -648,14 +636,12 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
648
636
|
nextState.selectedRowKeys = [];
|
649
637
|
nextState.selectedRows = [];
|
650
638
|
}
|
651
|
-
if (
|
639
|
+
if (isObject(value)) {
|
652
640
|
nextState.selectedRowKeys = [getRowKey(value)];
|
653
641
|
nextState.selectedRows = [value];
|
654
642
|
}
|
655
|
-
if (
|
656
|
-
nextState.selectedRowKeys = value.map(
|
657
|
-
return getRowKey(item);
|
658
|
-
});
|
643
|
+
if (isArray(value)) {
|
644
|
+
nextState.selectedRowKeys = value.map(item => getRowKey(item));
|
659
645
|
nextState.selectedRows = value;
|
660
646
|
}
|
661
647
|
} else if (value) {
|
@@ -663,57 +649,59 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
663
649
|
var nextSelectedRowKeys = isMultiple ? value : [value];
|
664
650
|
nextState.selectedRowKeys = nextSelectedRowKeys;
|
665
651
|
var list = options !== null && options !== void 0 ? options : data;
|
666
|
-
nextState.selectedRows = list === null || list === void 0
|
652
|
+
nextState.selectedRows = list === null || list === void 0 || (_list$filter = list.filter) === null || _list$filter === void 0 ? void 0 : _list$filter.call(list, item => {
|
667
653
|
return nextSelectedRowKeys.includes(item[valueKey]);
|
668
654
|
});
|
669
655
|
}
|
670
656
|
setState(nextState);
|
671
657
|
}
|
672
658
|
}, [onOff, visible, JSON.stringify(value)]);
|
673
|
-
useEffect(
|
659
|
+
useEffect(() => {
|
674
660
|
hideTooltipIfOpen(fieldRef.current, visible);
|
675
661
|
}, [visible]);
|
676
|
-
useEffect(
|
662
|
+
useEffect(() => {
|
677
663
|
if (value && !visible && isInit && nextMode === 'input') {
|
678
664
|
getInitValues();
|
679
665
|
}
|
680
666
|
}, [JSON.stringify(value), visible, isInit]);
|
681
|
-
useDebounceEffect(
|
682
|
-
if (value && !visible && nextMode === 'select' && (!
|
667
|
+
useDebounceEffect(() => {
|
668
|
+
if (value && !visible && nextMode === 'select' && (!isEqual(value, preValue.current) || (options === null || options === void 0 ? void 0 : options.length) === 0)) {
|
683
669
|
var _options$some;
|
684
670
|
preValue.current = value;
|
685
671
|
var _data3 = labelInValue ? value[valueKey] : value;
|
686
|
-
var isHasValue = options === null || options === void 0
|
687
|
-
return item[valueKey] === _data3;
|
688
|
-
});
|
672
|
+
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);
|
689
673
|
if (isHasValue) {
|
690
674
|
return;
|
691
675
|
}
|
692
676
|
if (useRequest) {
|
693
677
|
// 加定时器 修复依赖数据同步更新未取到问题
|
694
|
-
setTimeout(
|
678
|
+
setTimeout(() => {
|
695
679
|
var params = withPagination ? {
|
696
680
|
pageNum: 1,
|
697
681
|
pageSize: 50,
|
698
|
-
queryBean: _objectSpread(_objectSpread(_objectSpread({}, defaultParams), initParams), {},
|
699
|
-
|
682
|
+
queryBean: _objectSpread(_objectSpread(_objectSpread({}, defaultParams), initParams), {}, {
|
683
|
+
[searchKey !== null && searchKey !== void 0 ? searchKey : valueKey]: _data3
|
684
|
+
})
|
685
|
+
} : _objectSpread(_objectSpread(_objectSpread({}, defaultParams), initParams), {}, {
|
686
|
+
[searchKey !== null && searchKey !== void 0 ? searchKey : valueKey]: _data3
|
687
|
+
});
|
700
688
|
var nextParams = transformParams ? transformParams(params) : params;
|
701
689
|
run(nextParams);
|
702
690
|
}, 300);
|
703
691
|
}
|
704
692
|
}
|
705
693
|
}, [JSON.stringify(value), visible, JSON.stringify(defaultParams), JSON.stringify(initParams), options === null || options === void 0 ? void 0 : options.length]);
|
706
|
-
var handleSelectFocus =
|
694
|
+
var handleSelectFocus = () => {
|
707
695
|
if (useRequest) {
|
708
696
|
var queryBean = defaultParams || {};
|
709
697
|
var params = withPagination ? {
|
710
698
|
pageNum: 1,
|
711
699
|
pageSize: 50,
|
712
|
-
queryBean
|
700
|
+
queryBean
|
713
701
|
} : queryBean;
|
714
702
|
var nextParams = transformParams ? transformParams(params) : params;
|
715
703
|
// 减少请求条件一致时,且请求过时,focus的重复请求
|
716
|
-
if (!
|
704
|
+
if (!isEqual(queryBean, defaultParamsRef.current) || !(options !== null && options !== void 0 && options.length)) {
|
717
705
|
run(nextParams); // 触发 run 请求
|
718
706
|
defaultParamsRef.current = queryBean; // 更新缓存
|
719
707
|
}
|
@@ -722,19 +710,21 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
722
710
|
});
|
723
711
|
}
|
724
712
|
};
|
725
|
-
var handleSelectSearch =
|
713
|
+
var handleSelectSearch = debounce(val => {
|
726
714
|
if (useRequest) {
|
727
|
-
var queryBean = _objectSpread(_objectSpread({}, defaultParams), {},
|
715
|
+
var queryBean = _objectSpread(_objectSpread({}, defaultParams), {}, {
|
716
|
+
[searchKey !== null && searchKey !== void 0 ? searchKey : labelKey]: val
|
717
|
+
});
|
728
718
|
var params = withPagination ? {
|
729
719
|
pageNum: 1,
|
730
720
|
pageSize: 50,
|
731
|
-
queryBean
|
721
|
+
queryBean
|
732
722
|
} : queryBean;
|
733
723
|
var nextParams = transformParams ? transformParams(params) : params;
|
734
724
|
run(nextParams);
|
735
725
|
}
|
736
726
|
}, 1000);
|
737
|
-
useDebounceEffect(
|
727
|
+
useDebounceEffect(() => {
|
738
728
|
if (!value) {
|
739
729
|
if (defaultOne) {
|
740
730
|
getDefaultOneValues();
|
@@ -747,14 +737,14 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
747
737
|
}
|
748
738
|
}
|
749
739
|
if (nextMode === 'input') {
|
750
|
-
if (labelInValue && _value && !
|
740
|
+
if (labelInValue && _value && !isEqual(value, _value)) {
|
751
741
|
setState({
|
752
742
|
_value: value,
|
753
743
|
selectedRowKeys: [],
|
754
744
|
selectedRows: []
|
755
745
|
});
|
756
746
|
}
|
757
|
-
if (!labelInValue && !
|
747
|
+
if (!labelInValue && !isEqual(value, _value === null || _value === void 0 ? void 0 : _value[valueKey])) {
|
758
748
|
setState({
|
759
749
|
_value: value,
|
760
750
|
selectedRowKeys: [],
|
@@ -763,13 +753,14 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
763
753
|
}
|
764
754
|
}
|
765
755
|
}, [value, _value]);
|
756
|
+
|
766
757
|
// 加个中间状态Input
|
767
|
-
var initRender = _jsxs(_Space.Compact, {
|
758
|
+
var initRender = /*#__PURE__*/_jsxs(_Space.Compact, {
|
768
759
|
style: {
|
769
760
|
width: '100%'
|
770
761
|
},
|
771
762
|
block: true,
|
772
|
-
children: [nextMode === 'select' ? _jsx(ProSelect, _objectSpread({
|
763
|
+
children: [nextMode === 'select' ? /*#__PURE__*/_jsx(ProSelect, _objectSpread({
|
773
764
|
value: value,
|
774
765
|
onChange: handleSelectValue,
|
775
766
|
disabled: disabled,
|
@@ -780,7 +771,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
780
771
|
optionRender: optionRender,
|
781
772
|
scrollFollowParent: false,
|
782
773
|
mode: isMultiple ? 'multiple' : undefined,
|
783
|
-
notFoundContent: selectLoading ? _jsx(_Spin, {
|
774
|
+
notFoundContent: selectLoading ? /*#__PURE__*/_jsx(_Spin, {
|
784
775
|
size: "small"
|
785
776
|
}) : null,
|
786
777
|
onFocus: handleSelectFocus,
|
@@ -789,18 +780,18 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
789
780
|
style: {
|
790
781
|
width: isView || disabled ? '100%' : 'calc(100% - 30px)'
|
791
782
|
}
|
792
|
-
}, restProps)) : _jsx(_Tooltip, {
|
783
|
+
}, restProps)) : /*#__PURE__*/_jsx(_Tooltip, {
|
793
784
|
title: _tooltip ? viewText : null,
|
794
785
|
placement: "topLeft",
|
795
|
-
children: _jsx(_Input, _objectSpread({
|
786
|
+
children: /*#__PURE__*/_jsx(_Input, _objectSpread({
|
796
787
|
value: viewText,
|
797
788
|
onChange: handleChangeValue,
|
798
789
|
disabled: disabled,
|
799
790
|
autoComplete: "off",
|
800
791
|
allowClear: true
|
801
792
|
}, restProps))
|
802
|
-
}), isView || disabled ? null : _jsx(_Button, {
|
803
|
-
icon: _jsx(ReactSVG, {
|
793
|
+
}), isView || disabled ? null : /*#__PURE__*/_jsx(_Button, {
|
794
|
+
icon: /*#__PURE__*/_jsx(ReactSVG, {
|
804
795
|
className: "viewSvg",
|
805
796
|
src: viewSvg,
|
806
797
|
onClick: handleClick
|
@@ -808,71 +799,73 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
808
799
|
})]
|
809
800
|
});
|
810
801
|
if (customRender && /*#__PURE__*/React.isValidElement(customRender)) {
|
811
|
-
initRender = _jsx("div", {
|
802
|
+
initRender = /*#__PURE__*/_jsx("div", {
|
812
803
|
className: "pro-modal-select-init",
|
813
804
|
onClick: handleClick,
|
814
805
|
children: customRender
|
815
806
|
});
|
816
807
|
}
|
817
|
-
useDeepCompareEffect(
|
808
|
+
useDeepCompareEffect(() => {
|
818
809
|
setState({
|
819
810
|
options: (tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource) || []
|
820
811
|
});
|
821
812
|
}, [tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource]);
|
813
|
+
|
822
814
|
// 当搜索条件只有一个时,且为输入框,默认设置suffix
|
823
|
-
if ((formColumns === null || formColumns === void 0 ? void 0 : formColumns.length) === 1 && (formColumns === null || formColumns === void 0
|
824
|
-
var _formColumns$2, _formColumns$3
|
825
|
-
if (!((_formColumns$2 = formColumns[0])
|
815
|
+
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') {
|
816
|
+
var _formColumns$2, _formColumns$3;
|
817
|
+
if (!((_formColumns$2 = formColumns[0]) !== null && _formColumns$2 !== void 0 && _formColumns$2.fieldProps)) {
|
826
818
|
formColumns[0].fieldProps = {};
|
827
819
|
}
|
828
|
-
if (!
|
829
|
-
formColumns[0].fieldProps.suffix = _jsx(SearchOutlined, {
|
820
|
+
if (!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)) {
|
821
|
+
formColumns[0].fieldProps.suffix = /*#__PURE__*/_jsx(SearchOutlined, {
|
830
822
|
onClick: handleSearch
|
831
823
|
});
|
832
824
|
}
|
833
825
|
}
|
834
826
|
if (isView) {
|
835
827
|
if (!value) {
|
836
|
-
return _jsx(_Fragment, {
|
828
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
837
829
|
children: viewEmpty
|
838
830
|
});
|
839
831
|
}
|
840
|
-
return _jsx(Container, {
|
832
|
+
return /*#__PURE__*/_jsx(Container, {
|
841
833
|
viewEmpty: viewEmpty,
|
842
|
-
children:
|
834
|
+
children: `${viewText}`
|
843
835
|
});
|
844
836
|
}
|
845
|
-
var _className = classNames(
|
846
|
-
'pro-modal-select': true
|
847
|
-
|
848
|
-
|
849
|
-
|
837
|
+
var _className = classNames({
|
838
|
+
'pro-modal-select': true,
|
839
|
+
[props.className]: props.className,
|
840
|
+
'pro-modal-select-open': visible
|
841
|
+
});
|
842
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
843
|
+
children: [/*#__PURE__*/_jsx("div", {
|
850
844
|
id: uuid,
|
851
845
|
className: _className,
|
852
846
|
style: style,
|
853
847
|
ref: fieldRef,
|
854
848
|
children: initRender
|
855
|
-
}), _jsxs(ProDrawerForm, _objectSpread(_objectSpread({
|
849
|
+
}), /*#__PURE__*/_jsxs(ProDrawerForm, _objectSpread(_objectSpread({
|
856
850
|
mode: "Modal",
|
857
851
|
title: title,
|
858
|
-
onOk: handleFinish
|
852
|
+
onOk: handleFinish
|
859
853
|
// @ts-ignore
|
854
|
+
,
|
860
855
|
onCancel: handleClose,
|
861
856
|
open: visible
|
862
857
|
}, restModalProps), {}, {
|
863
|
-
children: [_jsx(ProForm, {
|
858
|
+
children: [/*#__PURE__*/_jsx(ProForm, {
|
864
859
|
submitOnEnter: true,
|
865
860
|
form: form,
|
866
861
|
columns: formColumns,
|
867
862
|
onFinish: handleSearch,
|
868
863
|
confirmLoading: loading,
|
869
864
|
footer: (formColumns === null || formColumns === void 0 ? void 0 : formColumns.length) > 1
|
870
|
-
}), _jsx(ProTable, _objectSpread({
|
871
|
-
onRow:
|
865
|
+
}), /*#__PURE__*/_jsx(ProTable, _objectSpread({
|
866
|
+
onRow: record => {
|
872
867
|
return {
|
873
|
-
onClick:
|
874
|
-
return handleClickRow(record);
|
875
|
-
}
|
868
|
+
onClick: () => handleClickRow(record)
|
876
869
|
};
|
877
870
|
},
|
878
871
|
rowKey: rowKey,
|