@zat-design/sisyphus-react 3.13.18 → 3.13.19-beta.10
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/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 +32 -17
- 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 -58
- 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.d.ts +14 -0
- package/es/ProEnum/hooks/useFrequentEnumRequest.js +76 -0
- package/es/ProEnum/index.js +97 -97
- package/es/ProEnum/propsType.d.ts +29 -0
- package/es/ProEnum/utils/eventCenter.js +23 -32
- package/es/ProEnum/utils/frequentEnum.d.ts +40 -0
- package/es/ProEnum/utils/frequentEnum.js +91 -0
- 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/ProNumberRange/style/index.less +5 -0
- 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 -120
- 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 +31 -15
- 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 -60
- 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.d.ts +14 -0
- package/lib/ProEnum/hooks/useFrequentEnumRequest.js +83 -0
- package/lib/ProEnum/index.js +85 -86
- package/lib/ProEnum/propsType.d.ts +29 -0
- package/lib/ProEnum/utils/eventCenter.js +23 -32
- package/lib/ProEnum/utils/frequentEnum.d.ts +40 -0
- package/lib/ProEnum/utils/frequentEnum.js +99 -0
- 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/ProNumberRange/style/index.less +5 -0
- 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 -117
- 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 +8 -8
- package/dist/index.esm.css +0 -6338
- package/dist/index.esm.js +0 -3
- package/dist/less.esm.css +0 -5762
- package/dist/less.esm.js +0 -3
- package/tests/__mocks__/fileMock.js +0 -1
- package/tests/__mocks__/zatUtils.js +0 -27
- package/tests/setup.ts +0 -477
- package/tests/test-utils.tsx +0 -81
@@ -1,71 +1,75 @@
|
|
1
1
|
import "antd/es/space/style";
|
2
2
|
import _Space from "antd/es/space";
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
4
|
-
import _omit from "lodash/omit";
|
5
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
6
4
|
import { useEffect } from 'react';
|
5
|
+
import { omit } from 'lodash';
|
7
6
|
import { InfoCircleOutlined } from '@ant-design/icons';
|
8
|
-
import { ProForm } from
|
9
|
-
import { matchFormValue } from
|
10
|
-
|
7
|
+
import { ProForm } from "../../index";
|
8
|
+
import { matchFormValue } from "../utils";
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
11
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
12
|
+
var RenderProForm = props => {
|
11
13
|
var _props3, _props6, _props7;
|
12
14
|
var columns = [];
|
13
15
|
var primitiveProps = _objectSpread({}, props);
|
14
16
|
var _props = {};
|
15
|
-
useEffect(
|
17
|
+
useEffect(() => {
|
16
18
|
// isNode以ReactNode节点方式打开popUp,默认每次打开弹窗清空弹窗内容
|
17
|
-
if (
|
19
|
+
if (primitiveProps !== null && primitiveProps !== void 0 && primitiveProps.value && !(primitiveProps !== null && primitiveProps !== void 0 && primitiveProps.isNode)) {
|
18
20
|
var _props2;
|
19
21
|
_props.form.setFieldsValue(matchFormValue(primitiveProps === null || primitiveProps === void 0 ? void 0 : primitiveProps.value, (_props2 = _props) === null || _props2 === void 0 ? void 0 : _props2.columns));
|
20
22
|
}
|
23
|
+
|
21
24
|
// 销毁重置表单数据
|
22
|
-
return
|
25
|
+
return () => {
|
23
26
|
var _props$form;
|
24
|
-
(_props$form = _props.form) === null || _props$form === void 0
|
27
|
+
(_props$form = _props.form) === null || _props$form === void 0 || _props$form.resetFields();
|
25
28
|
};
|
26
29
|
}, []);
|
30
|
+
|
27
31
|
// 兼容老写法
|
28
32
|
if (!props.columns) {
|
29
|
-
columns[0] = _objectSpread(_objectSpread({},
|
33
|
+
columns[0] = _objectSpread(_objectSpread({}, omit(props, ['title', 'tip', 'form', 'onChange', 'isView', 'isNode'])), {}, {
|
30
34
|
name: props.type || 'Input'
|
31
35
|
});
|
32
36
|
_props = {
|
33
|
-
columns
|
37
|
+
columns,
|
34
38
|
form: props.form,
|
35
39
|
isView: props.isView
|
36
40
|
};
|
37
41
|
} else {
|
38
|
-
_props = _objectSpread({},
|
42
|
+
_props = _objectSpread({}, omit(props, ['onChange', 'isNode']));
|
39
43
|
}
|
40
|
-
if ((_props3 = _props)
|
41
|
-
var _props4
|
42
|
-
(_props4 = _props) === null || _props4 === void 0
|
44
|
+
if ((_props3 = _props) !== null && _props3 !== void 0 && _props3.isView) {
|
45
|
+
var _props4;
|
46
|
+
(_props4 = _props) === null || _props4 === void 0 || (_props4 = _props4.columns) === null || _props4 === void 0 || _props4.forEach(item => {
|
43
47
|
item.noStyle = true;
|
44
48
|
});
|
45
49
|
} else {
|
46
|
-
var _props5
|
47
|
-
(_props5 = _props) === null || _props5 === void 0
|
50
|
+
var _props5;
|
51
|
+
(_props5 = _props) === null || _props5 === void 0 || (_props5 = _props5.columns) === null || _props5 === void 0 || _props5.forEach(item => {
|
48
52
|
item.noStyle = false;
|
49
53
|
});
|
50
54
|
}
|
51
|
-
return _jsxs(_Fragment, {
|
52
|
-
children: [(primitiveProps === null || primitiveProps === void 0 ? void 0 : primitiveProps.title) && !((_props6 = _props)
|
55
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
56
|
+
children: [(primitiveProps === null || primitiveProps === void 0 ? void 0 : primitiveProps.title) && !((_props6 = _props) !== null && _props6 !== void 0 && _props6.isView) && /*#__PURE__*/_jsx("div", {
|
53
57
|
className: "pro-edit-label-title",
|
54
58
|
children: primitiveProps === null || primitiveProps === void 0 ? void 0 : primitiveProps.title
|
55
|
-
}), (primitiveProps === null || primitiveProps === void 0 ? void 0 : primitiveProps.tip) && !((_props7 = _props)
|
59
|
+
}), (primitiveProps === null || primitiveProps === void 0 ? void 0 : primitiveProps.tip) && !((_props7 = _props) !== null && _props7 !== void 0 && _props7.isView) && /*#__PURE__*/_jsx("div", {
|
56
60
|
className: "pro-edit-label-tip",
|
57
|
-
children: _jsxs(_Space, {
|
61
|
+
children: /*#__PURE__*/_jsxs(_Space, {
|
58
62
|
align: "start",
|
59
|
-
children: [_jsx(InfoCircleOutlined, {}), primitiveProps === null || primitiveProps === void 0 ? void 0 : primitiveProps.tip]
|
63
|
+
children: [/*#__PURE__*/_jsx(InfoCircleOutlined, {}), primitiveProps === null || primitiveProps === void 0 ? void 0 : primitiveProps.tip]
|
60
64
|
})
|
61
|
-
}), _jsx(ProForm, _objectSpread({
|
65
|
+
}), /*#__PURE__*/_jsx(ProForm, _objectSpread({
|
62
66
|
span: 24,
|
63
67
|
footer: false,
|
64
|
-
onValuesChange:
|
68
|
+
onValuesChange: (changeValue, values) => {
|
65
69
|
var _props8;
|
66
70
|
if (((_props8 = _props) === null || _props8 === void 0 ? void 0 : _props8.columns.length) === 1) {
|
67
|
-
var _props9
|
68
|
-
primitiveProps.onChange && primitiveProps.onChange(values[(_props9 = _props) === null || _props9 === void 0
|
71
|
+
var _props9;
|
72
|
+
primitiveProps.onChange && primitiveProps.onChange(values[(_props9 = _props) === null || _props9 === void 0 || (_props9 = _props9.columns[0]) === null || _props9 === void 0 ? void 0 : _props9.name]);
|
69
73
|
return;
|
70
74
|
}
|
71
75
|
primitiveProps.onChange && primitiveProps.onChange(values);
|
package/es/ProEditLabel/index.js
CHANGED
@@ -2,26 +2,27 @@ import "antd/es/popconfirm/style";
|
|
2
2
|
import _Popconfirm from "antd/es/popconfirm";
|
3
3
|
import "antd/es/input/style";
|
4
4
|
import _Input from "antd/es/input";
|
5
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
6
5
|
import "antd/es/space/style";
|
7
6
|
import _Space from "antd/es/space";
|
7
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
8
8
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
9
9
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
10
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
11
10
|
import "antd/es/form/style";
|
12
11
|
import _Form from "antd/es/form";
|
13
12
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
14
13
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
15
|
-
import _omit from "lodash/omit";
|
16
14
|
var _excluded = ["open", "disabled", "onOpenChange", "onFinish", "onConfirm", "trigger", "mode", "className", "size", "popupProps", "style", "viewEmpty", "children", "form"];
|
17
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
18
15
|
import { EditOutlined } from '@ant-design/icons';
|
19
16
|
import { useToggle, useSetState } from 'ahooks';
|
20
17
|
import classnames from 'classnames';
|
21
18
|
import React, { useEffect, useRef } from 'react';
|
22
|
-
import
|
23
|
-
import
|
24
|
-
|
19
|
+
import { omit } from 'lodash';
|
20
|
+
import RenderProForm from "./components/RenderProForm";
|
21
|
+
import { matchFormValue } from "./utils";
|
22
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
23
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
24
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
25
|
+
var ProEditLabel = _ref => {
|
25
26
|
var _ref$open = _ref.open,
|
26
27
|
open = _ref$open === void 0 ? false : _ref$open,
|
27
28
|
_ref$disabled = _ref.disabled,
|
@@ -45,6 +46,7 @@ var ProEditLabel = function ProEditLabel(_ref) {
|
|
45
46
|
props = _objectWithoutProperties(_ref, _excluded);
|
46
47
|
var _useSetState = useSetState({
|
47
48
|
popValue: props.value || '',
|
49
|
+
// 临时value
|
48
50
|
confirmValue: props.value || '' // 确认后value
|
49
51
|
}),
|
50
52
|
_useSetState2 = _slicedToArray(_useSetState, 2),
|
@@ -61,7 +63,7 @@ var ProEditLabel = function ProEditLabel(_ref) {
|
|
61
63
|
_Form$useForm4 = _slicedToArray(_Form$useForm3, 1),
|
62
64
|
viewForm = _Form$useForm4[0];
|
63
65
|
var inputRef = useRef(null);
|
64
|
-
var onPress =
|
66
|
+
var onPress = e => {
|
65
67
|
var element = e.target;
|
66
68
|
if (e.key === 'Enter') {
|
67
69
|
onFinish && onFinish(element.value);
|
@@ -69,10 +71,10 @@ var ProEditLabel = function ProEditLabel(_ref) {
|
|
69
71
|
toggleStatus();
|
70
72
|
}
|
71
73
|
};
|
72
|
-
var editHandle =
|
74
|
+
var editHandle = () => {
|
73
75
|
var _inputRef$current;
|
74
76
|
toggleStatus();
|
75
|
-
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0
|
77
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
|
76
78
|
if (mode === 'popup') {
|
77
79
|
// 兼容老写法
|
78
80
|
if (!popupProps.columns) {
|
@@ -86,21 +88,22 @@ var ProEditLabel = function ProEditLabel(_ref) {
|
|
86
88
|
});
|
87
89
|
}
|
88
90
|
};
|
89
|
-
useEffect(
|
91
|
+
useEffect(() => {
|
90
92
|
var _inputRef$current2;
|
91
93
|
status && ((_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.focus());
|
92
94
|
}, [status]);
|
93
|
-
useEffect(
|
95
|
+
useEffect(() => {
|
94
96
|
_onOpenChange && _onOpenChange(status);
|
95
97
|
}, [_onOpenChange, status]);
|
96
|
-
useEffect(
|
98
|
+
useEffect(() => {
|
97
99
|
setState({
|
98
100
|
confirmValue: props.value,
|
99
101
|
popValue: props.value
|
100
102
|
});
|
101
103
|
}, [props.value]);
|
104
|
+
|
102
105
|
// 初始化同步数据或者同步外部数据源
|
103
|
-
useEffect(
|
106
|
+
useEffect(() => {
|
104
107
|
// 弹窗模式使用form赋值
|
105
108
|
if (mode === 'popup' && props.value) {
|
106
109
|
// 兼容老写法
|
@@ -115,8 +118,9 @@ var ProEditLabel = function ProEditLabel(_ref) {
|
|
115
118
|
}
|
116
119
|
}
|
117
120
|
}, [props.value, mode]);
|
121
|
+
|
118
122
|
// 文本模式同步
|
119
|
-
useEffect(
|
123
|
+
useEffect(() => {
|
120
124
|
// 弹窗模式使用form赋值
|
121
125
|
if (mode === 'popup' && confirmValue !== props.value) {
|
122
126
|
// 兼容老写法
|
@@ -127,14 +131,21 @@ var ProEditLabel = function ProEditLabel(_ref) {
|
|
127
131
|
}
|
128
132
|
}
|
129
133
|
}, [confirmValue, mode]);
|
130
|
-
var cls = classnames(
|
131
|
-
'pro-edit-label': true
|
132
|
-
|
134
|
+
var cls = classnames({
|
135
|
+
'pro-edit-label': true,
|
136
|
+
[`trigger-${trigger}`]: trigger,
|
137
|
+
'pro-edit-label-small': size === 'small',
|
138
|
+
'pro-edit-label-middle': size === 'middle',
|
139
|
+
// 默认middle
|
140
|
+
'pro-edit-label-large': size === 'large',
|
141
|
+
[`${className}`]: className
|
142
|
+
});
|
143
|
+
|
133
144
|
/**
|
134
145
|
* pop确认回调
|
135
146
|
*/
|
136
147
|
var onConfirmHandle = /*#__PURE__*/function () {
|
137
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
148
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
138
149
|
var res, value;
|
139
150
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
140
151
|
while (1) switch (_context.prev = _context.next) {
|
@@ -187,10 +198,11 @@ var ProEditLabel = function ProEditLabel(_ref) {
|
|
187
198
|
return _ref2.apply(this, arguments);
|
188
199
|
};
|
189
200
|
}();
|
201
|
+
|
190
202
|
/**
|
191
203
|
* pop取消回调
|
192
204
|
*/
|
193
|
-
var onCancelHandle =
|
205
|
+
var onCancelHandle = () => {
|
194
206
|
// 兼容老写法
|
195
207
|
if (!popupProps.columns) {
|
196
208
|
form.setFieldValue((popupProps === null || popupProps === void 0 ? void 0 : popupProps.type) || 'Input', props.value);
|
@@ -201,27 +213,28 @@ var ProEditLabel = function ProEditLabel(_ref) {
|
|
201
213
|
popValue: props.value
|
202
214
|
});
|
203
215
|
};
|
216
|
+
|
204
217
|
/**
|
205
218
|
* 渲染可编辑label
|
206
219
|
* @returns
|
207
220
|
*/
|
208
|
-
var renderProEditLabel =
|
209
|
-
var TextNode = _jsx("div", {
|
221
|
+
var renderProEditLabel = () => {
|
222
|
+
var TextNode = /*#__PURE__*/_jsx("div", {
|
210
223
|
className: cls,
|
211
224
|
style: style,
|
212
|
-
children: _jsxs(_Space, {
|
225
|
+
children: /*#__PURE__*/_jsxs(_Space, {
|
213
226
|
align: "start",
|
214
|
-
children: [mode === 'current' ? props.value : _jsx(RenderProForm, _objectSpread({
|
227
|
+
children: [mode === 'current' ? props.value : /*#__PURE__*/_jsx(RenderProForm, _objectSpread({
|
215
228
|
value: confirmValue,
|
216
229
|
isView: true,
|
217
230
|
form: viewForm
|
218
|
-
}, popupProps)), !disabled && _jsx(EditOutlined, {
|
231
|
+
}, popupProps)), !disabled && /*#__PURE__*/_jsx(EditOutlined, {
|
219
232
|
onClick: editHandle
|
220
233
|
})]
|
221
234
|
})
|
222
235
|
});
|
223
236
|
if (disabled) {
|
224
|
-
if (/*#__PURE__*/React.isValidElement(children)) {
|
237
|
+
if ( /*#__PURE__*/React.isValidElement(children)) {
|
225
238
|
return children;
|
226
239
|
}
|
227
240
|
if (props.value && !popupProps) {
|
@@ -232,17 +245,17 @@ var ProEditLabel = function ProEditLabel(_ref) {
|
|
232
245
|
// 当前页编辑模式
|
233
246
|
if (mode === 'current') {
|
234
247
|
if (status) {
|
235
|
-
return _jsx(_Input, _objectSpread(_objectSpread({
|
248
|
+
return /*#__PURE__*/_jsx(_Input, _objectSpread(_objectSpread({
|
236
249
|
ref: inputRef,
|
237
250
|
size: size,
|
238
|
-
onBlur:
|
251
|
+
onBlur: e => {
|
239
252
|
toggleStatus();
|
240
253
|
onFinish && onFinish(e.target.value);
|
241
254
|
onConfirm && onConfirm(e.target.value);
|
242
255
|
},
|
243
256
|
onKeyDown: onPress
|
244
257
|
}, props), {}, {
|
245
|
-
onChange:
|
258
|
+
onChange: e => {
|
246
259
|
props.onChange && props.onChange(e.target.value);
|
247
260
|
}
|
248
261
|
}));
|
@@ -252,17 +265,17 @@ var ProEditLabel = function ProEditLabel(_ref) {
|
|
252
265
|
// 弹窗编辑模式
|
253
266
|
if (mode === 'popup') {
|
254
267
|
// 查看时内容渲染
|
255
|
-
var labelRender =
|
256
|
-
if (/*#__PURE__*/React.isValidElement(children)) {
|
268
|
+
var labelRender = () => {
|
269
|
+
if ( /*#__PURE__*/React.isValidElement(children)) {
|
257
270
|
return children;
|
258
271
|
}
|
259
272
|
return TextNode;
|
260
273
|
};
|
261
|
-
return _jsx(_Popconfirm, _objectSpread(_objectSpread({
|
274
|
+
return /*#__PURE__*/_jsx(_Popconfirm, _objectSpread(_objectSpread({
|
262
275
|
overlayClassName: "pro-edit-label-popconfirm",
|
263
276
|
icon: null,
|
264
277
|
destroyTooltipOnHide: true,
|
265
|
-
title: _jsx(RenderProForm, _objectSpread({
|
278
|
+
title: /*#__PURE__*/_jsx(RenderProForm, _objectSpread({
|
266
279
|
form: form,
|
267
280
|
value: confirmValue,
|
268
281
|
onChange: props.onChange,
|
@@ -270,15 +283,15 @@ var ProEditLabel = function ProEditLabel(_ref) {
|
|
270
283
|
}, popupProps)),
|
271
284
|
onConfirm: onConfirmHandle,
|
272
285
|
onCancel: onCancelHandle,
|
273
|
-
onOpenChange:
|
286
|
+
onOpenChange: open => {
|
274
287
|
_onOpenChange && _onOpenChange(open);
|
275
288
|
}
|
276
|
-
},
|
289
|
+
}, omit(popupProps, ['type', 'label', 'title', 'tip', 'trim', 'labelWidth', 'fieldProps', 'columns'])), {}, {
|
277
290
|
children: labelRender()
|
278
291
|
}));
|
279
292
|
}
|
280
293
|
};
|
281
|
-
return _jsx(_Fragment, {
|
294
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
282
295
|
children: renderProEditLabel()
|
283
296
|
});
|
284
297
|
};
|
@@ -1,16 +1,17 @@
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
2
1
|
/**
|
3
2
|
* 判断columns的length是否为1,给表单赋值,默认匹配到value上
|
4
3
|
* @param value 表单值
|
5
4
|
* @param columns 表单配置项
|
6
5
|
* @returns value
|
7
6
|
*/
|
8
|
-
export var matchFormValue =
|
7
|
+
export var matchFormValue = (value, columns) => {
|
9
8
|
if (!Array.isArray(columns)) {
|
10
9
|
return value;
|
11
10
|
}
|
12
11
|
if (columns.length === 1) {
|
13
|
-
return
|
12
|
+
return {
|
13
|
+
[columns[0].name || columns[0].type]: value
|
14
|
+
};
|
14
15
|
}
|
15
16
|
return value;
|
16
17
|
};
|
@@ -1,17 +1,17 @@
|
|
1
|
-
import "antd/es/button/style";
|
2
|
-
import _Button from "antd/es/button";
|
3
1
|
import "antd/es/popconfirm/style";
|
4
2
|
import _Popconfirm from "antd/es/popconfirm";
|
3
|
+
import "antd/es/button/style";
|
4
|
+
import _Button from "antd/es/button";
|
5
5
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
6
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
7
|
-
import _omit from "lodash/omit";
|
8
|
-
import _isFunction from "lodash/isFunction";
|
9
|
-
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
10
6
|
import React from 'react';
|
11
|
-
import {
|
12
|
-
import
|
7
|
+
import { isFunction, omit } from 'lodash';
|
8
|
+
import { iconMap } from "../../utils/config";
|
9
|
+
import locale from "../../../locale";
|
10
|
+
|
13
11
|
// 渲染操作按钮
|
14
|
-
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
13
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
14
|
+
var ActionButton = _ref => {
|
15
15
|
var _editingKeys$includes, _btnConfig$buttonProp, _btnConfig$buttonProp2, _btnConfig$buttonProp3, _btnConfig$icon;
|
16
16
|
var record = _ref.record,
|
17
17
|
index = _ref.index,
|
@@ -27,33 +27,36 @@ var ActionButton = function ActionButton(_ref) {
|
|
27
27
|
name = config.name,
|
28
28
|
tableLength = config.tableLength,
|
29
29
|
selectedRows = config.selectedRows;
|
30
|
-
var rowNamePath = [
|
30
|
+
var rowNamePath = [...name, index];
|
31
|
+
|
31
32
|
// 操作按钮权限控制
|
32
|
-
var getShow =
|
33
|
+
var getShow = show => {
|
33
34
|
if (typeof show === 'function') {
|
34
35
|
return show(record, {
|
35
|
-
index
|
36
|
-
form
|
37
|
-
name
|
36
|
+
index,
|
37
|
+
form,
|
38
|
+
name,
|
38
39
|
namePath: rowNamePath,
|
39
|
-
tableLength
|
40
|
-
selectedRows
|
40
|
+
tableLength,
|
41
|
+
selectedRows
|
41
42
|
});
|
42
43
|
}
|
43
44
|
return show;
|
44
45
|
};
|
46
|
+
|
45
47
|
// 操作按钮权限控制
|
46
|
-
var getDisabled =
|
48
|
+
var getDisabled = disabled => {
|
47
49
|
if (typeof disabled === 'function') {
|
48
50
|
return disabled(record, {
|
49
|
-
index
|
50
|
-
form
|
51
|
-
name
|
51
|
+
index,
|
52
|
+
form,
|
53
|
+
name,
|
52
54
|
namePath: rowNamePath,
|
53
|
-
tableLength
|
54
|
-
selectedRows
|
55
|
+
tableLength,
|
56
|
+
selectedRows
|
55
57
|
});
|
56
58
|
}
|
59
|
+
|
57
60
|
// 新增超过最大行,禁止操作按钮
|
58
61
|
if (btnConfig.type === 'add' && max && tableLength >= max) {
|
59
62
|
return true;
|
@@ -64,106 +67,110 @@ var ActionButton = function ActionButton(_ref) {
|
|
64
67
|
delete: deletePoConfirmMsg,
|
65
68
|
mulDelete: mulDeletePoConfirmMsg
|
66
69
|
};
|
70
|
+
|
67
71
|
// 判断当前行是否正在编辑
|
68
|
-
var _isEditing = !virtualKey || btnConfig.isEditable === (editingKeys === null || editingKeys === void 0
|
72
|
+
var _isEditing = !virtualKey || btnConfig.isEditable === (editingKeys === null || editingKeys === void 0 || (_editingKeys$includes = editingKeys.includes) === null || _editingKeys$includes === void 0 ? void 0 : _editingKeys$includes.call(editingKeys, record === null || record === void 0 ? void 0 : record.rowKey));
|
73
|
+
|
69
74
|
// 单行删除、多行删除按钮Props
|
70
75
|
var delBtnProps = _objectSpread(_objectSpread({}, btnConfig.buttonProps), {}, {
|
71
76
|
disabled: getDisabled((_btnConfig$buttonProp = (_btnConfig$buttonProp2 = btnConfig.buttonProps) === null || _btnConfig$buttonProp2 === void 0 ? void 0 : _btnConfig$buttonProp2.disabled) !== null && _btnConfig$buttonProp !== void 0 ? _btnConfig$buttonProp : !selectedRowKeys.length && btnConfig.type === 'mulDelete')
|
72
77
|
});
|
78
|
+
|
73
79
|
// 其他操作按钮Props
|
74
80
|
var actionBtnProps = _objectSpread(_objectSpread({}, btnConfig.buttonProps), {}, {
|
75
|
-
onClick:
|
76
|
-
btnConfig === null || btnConfig === void 0
|
77
|
-
index
|
78
|
-
form
|
79
|
-
name
|
81
|
+
onClick: () => {
|
82
|
+
btnConfig === null || btnConfig === void 0 || btnConfig.onEvent(record, {
|
83
|
+
index,
|
84
|
+
form,
|
85
|
+
name,
|
80
86
|
namePath: rowNamePath,
|
81
|
-
tableLength
|
82
|
-
selectedRows
|
87
|
+
tableLength,
|
88
|
+
selectedRows
|
83
89
|
});
|
84
90
|
},
|
85
91
|
disabled: getDisabled((_btnConfig$buttonProp3 = btnConfig.buttonProps) === null || _btnConfig$buttonProp3 === void 0 ? void 0 : _btnConfig$buttonProp3.disabled)
|
86
92
|
});
|
93
|
+
|
87
94
|
// 当传入函数时,先转成reactNode
|
88
|
-
if (
|
95
|
+
if (isFunction(btnConfig.label)) {
|
89
96
|
var addIndex = tableLength ? tableLength - 1 : 0;
|
90
|
-
var namePath = [
|
97
|
+
var namePath = [...name, addIndex];
|
91
98
|
var addRecord = form.getFieldValue(namePath) || {};
|
92
99
|
btnConfig.label = btnConfig.label(addRecord, {
|
93
|
-
form
|
94
|
-
namePath
|
95
|
-
name
|
96
|
-
tableLength
|
97
|
-
selectedRows
|
100
|
+
form,
|
101
|
+
namePath,
|
102
|
+
name,
|
103
|
+
tableLength,
|
104
|
+
selectedRows,
|
98
105
|
index: addIndex
|
99
106
|
});
|
100
107
|
}
|
101
108
|
var isDisabled = !selectedRowKeys.length && btnConfig.type === 'mulDelete' || editingKeys.length || (delBtnProps === null || delBtnProps === void 0 ? void 0 : delBtnProps.disabled);
|
102
|
-
return _isEditing && getShow(btnConfig.show) ? _jsx(_Fragment, {
|
103
|
-
children: ['delete', 'mulDelete'].includes(btnConfig.type) ? _jsx(_Fragment, {
|
104
|
-
children:
|
109
|
+
return _isEditing && getShow(btnConfig.show) ? /*#__PURE__*/_jsx(_Fragment, {
|
110
|
+
children: ['delete', 'mulDelete'].includes(btnConfig.type) ? /*#__PURE__*/_jsx(_Fragment, {
|
111
|
+
children: btnConfig !== null && btnConfig !== void 0 && btnConfig.needConfirm ? /*#__PURE__*/_jsx(_Popconfirm, {
|
105
112
|
placement: "topRight",
|
106
113
|
title: deleteMsgMap[btnConfig.type],
|
107
|
-
onConfirm:
|
108
|
-
btnConfig === null || btnConfig === void 0
|
109
|
-
index
|
110
|
-
form
|
111
|
-
name
|
114
|
+
onConfirm: () => {
|
115
|
+
btnConfig === null || btnConfig === void 0 || btnConfig.onEvent(record, {
|
116
|
+
index,
|
117
|
+
form,
|
118
|
+
name,
|
112
119
|
namePath: rowNamePath,
|
113
|
-
tableLength
|
114
|
-
selectedRows
|
120
|
+
tableLength,
|
121
|
+
selectedRows
|
115
122
|
});
|
116
123
|
},
|
117
124
|
disabled: isDisabled,
|
118
125
|
okText: locale.ProEditTable.confirm,
|
119
126
|
cancelText: locale.ProEditTable.cancel,
|
120
|
-
children: /*#__PURE__*/React.isValidElement(btnConfig.label) ? (/*#__PURE__*/React.cloneElement(btnConfig.label, _objectSpread(_objectSpread({},
|
121
|
-
record
|
122
|
-
index
|
127
|
+
children: /*#__PURE__*/React.isValidElement(btnConfig.label) ? ( /*#__PURE__*/React.cloneElement(btnConfig.label, _objectSpread(_objectSpread({}, omit(delBtnProps, ['buttonProps', 'isEditable', 'onEvent'])), {}, {
|
128
|
+
record,
|
129
|
+
index,
|
123
130
|
disabled: isDisabled
|
124
|
-
}))) : _jsx(_Button, _objectSpread(_objectSpread({},
|
131
|
+
}))) : /*#__PURE__*/_jsx(_Button, _objectSpread(_objectSpread({}, omit(delBtnProps, ['buttonProps', 'isEditable', 'onEvent'])), {}, {
|
125
132
|
disabled: isDisabled,
|
126
133
|
type: "link",
|
127
134
|
children: btnConfig.label
|
128
135
|
}))
|
129
|
-
}) : _jsx(_Fragment, {
|
130
|
-
children: /*#__PURE__*/React.isValidElement(btnConfig.label) ? (/*#__PURE__*/React.cloneElement(btnConfig.label, _objectSpread(_objectSpread({},
|
131
|
-
record
|
132
|
-
index
|
136
|
+
}) : /*#__PURE__*/_jsx(_Fragment, {
|
137
|
+
children: /*#__PURE__*/React.isValidElement(btnConfig.label) ? ( /*#__PURE__*/React.cloneElement(btnConfig.label, _objectSpread(_objectSpread({}, omit(delBtnProps, ['buttonProps', 'isEditable', 'onEvent'])), {}, {
|
138
|
+
record,
|
139
|
+
index,
|
133
140
|
disabled: isDisabled,
|
134
|
-
onClick:
|
135
|
-
btnConfig === null || btnConfig === void 0
|
136
|
-
index
|
137
|
-
form
|
138
|
-
name
|
141
|
+
onClick: () => {
|
142
|
+
btnConfig === null || btnConfig === void 0 || btnConfig.onEvent(record, {
|
143
|
+
index,
|
144
|
+
form,
|
145
|
+
name,
|
139
146
|
namePath: rowNamePath,
|
140
|
-
tableLength
|
141
|
-
selectedRows
|
147
|
+
tableLength,
|
148
|
+
selectedRows
|
142
149
|
});
|
143
150
|
}
|
144
|
-
}))) : _jsx(_Button, _objectSpread(_objectSpread({},
|
151
|
+
}))) : /*#__PURE__*/_jsx(_Button, _objectSpread(_objectSpread({}, omit(delBtnProps, ['buttonProps', 'isEditable', 'onEvent'])), {}, {
|
145
152
|
disabled: isDisabled,
|
146
153
|
type: "link",
|
147
|
-
onClick:
|
148
|
-
btnConfig === null || btnConfig === void 0
|
149
|
-
index
|
150
|
-
form
|
151
|
-
name
|
154
|
+
onClick: () => {
|
155
|
+
btnConfig === null || btnConfig === void 0 || btnConfig.onEvent(record, {
|
156
|
+
index,
|
157
|
+
form,
|
158
|
+
name,
|
152
159
|
namePath: rowNamePath,
|
153
|
-
tableLength
|
154
|
-
selectedRows
|
160
|
+
tableLength,
|
161
|
+
selectedRows
|
155
162
|
});
|
156
163
|
},
|
157
164
|
children: btnConfig.label
|
158
165
|
}))
|
159
166
|
})
|
160
|
-
}) : _jsx(_Fragment, {
|
161
|
-
children: /*#__PURE__*/React.isValidElement(btnConfig.label) ? (/*#__PURE__*/React.cloneElement(btnConfig.label, _objectSpread(_objectSpread({},
|
162
|
-
record
|
163
|
-
index
|
164
|
-
}))) : _jsx(_Button, _objectSpread(_objectSpread({
|
167
|
+
}) : /*#__PURE__*/_jsx(_Fragment, {
|
168
|
+
children: /*#__PURE__*/React.isValidElement(btnConfig.label) ? ( /*#__PURE__*/React.cloneElement(btnConfig.label, _objectSpread(_objectSpread({}, omit(actionBtnProps, ['buttonProps', 'isEditable', 'onEvent'])), {}, {
|
169
|
+
record,
|
170
|
+
index
|
171
|
+
}))) : /*#__PURE__*/_jsx(_Button, _objectSpread(_objectSpread({
|
165
172
|
className: "action-button"
|
166
|
-
},
|
173
|
+
}, omit(actionBtnProps, ['buttonProps', 'isEditable', 'onEvent'])), {}, {
|
167
174
|
type: "link",
|
168
175
|
icon: (_btnConfig$icon = btnConfig === null || btnConfig === void 0 ? void 0 : btnConfig.icon) !== null && _btnConfig$icon !== void 0 ? _btnConfig$icon : iconMap[btnConfig.type],
|
169
176
|
children: btnConfig.label
|