@zat-design/sisyphus-react 3.0.13 → 3.0.16-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.css +2726 -1876
- package/es/ProDownload/DownloadHelper.js +2 -0
- package/es/ProDrawerForm/components/ProDrawer/index.js +5 -3
- package/es/ProDrawerForm/components/ProModal/index.js +15 -5
- package/es/ProDrawerForm/index.js +1 -1
- package/es/ProDrawerForm/propsType.d.ts +4 -0
- package/es/ProDrawerForm/style/index.less +88 -55
- package/es/ProEditLabel/components/RenderProForm.d.ts +4 -0
- package/es/ProEditLabel/components/RenderProForm.js +70 -0
- package/es/ProEditLabel/index.js +104 -141
- package/es/ProEditLabel/propsType.d.ts +7 -4
- package/es/ProEditLabel/style/index.less +33 -2
- package/es/ProEditLabel/utils/index.d.ts +5 -7
- package/es/ProEditLabel/utils/index.js +11 -27
- package/es/ProEditTable/components/ActionButton/index.d.ts +2 -1
- package/es/ProEditTable/components/ActionButton/index.js +20 -4
- package/es/ProEditTable/components/RenderField/index.d.ts +2 -1
- package/es/ProEditTable/components/RenderField/index.js +1 -2
- package/es/ProEditTable/components/RenderToolbar/index.d.ts +2 -1
- package/es/ProEditTable/components/Summary/index.d.ts +2 -1
- package/es/ProEditTable/propsType.d.ts +5 -0
- package/es/ProEditTable/style/index.less +16 -13
- package/es/ProEditTable/utils/config.d.ts +2 -1
- package/es/ProEditTable/utils/config.js +25 -14
- package/es/ProEditTable/utils/index.js +5 -3
- package/es/ProEnum/getEnumLabel.d.ts +2 -1
- package/es/ProEnum/index.d.ts +3 -2
- package/es/ProEnum/useEnumRequest.js +6 -11
- package/es/ProForm/components/base/DatePicker/index.js +1 -1
- package/es/ProForm/components/base/FormList/components/ActionButton.js +4 -5
- package/es/ProForm/components/base/FormList/index.d.ts +1 -0
- package/es/ProForm/components/base/FormList/index.js +10 -5
- package/es/ProForm/components/base/FormList/style/index.less +3 -0
- package/es/ProForm/components/base/Input/index.d.ts +2 -1
- package/es/ProForm/components/base/InputNumber/index.js +24 -0
- package/es/ProForm/components/base/RangePicker/index.js +2 -2
- package/es/ProForm/components/combination/ProAddressBar/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProAddressBar/index.js +2 -1
- package/es/ProForm/components/combination/ProCombination/index.js +3 -3
- package/es/ProForm/components/combination/ProModalSelect/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +3 -2
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +7 -6
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +45 -36
- package/es/ProForm/components/combination/ProRangeLimit/index.js +13 -15
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +1 -1
- package/es/ProForm/components/index.d.ts +2 -0
- package/es/ProForm/components/index.js +2 -0
- package/es/ProForm/components/old/CertNo/index.d.ts +2 -1
- package/es/ProForm/components/old/InputRange/index.d.ts +2 -1
- package/es/ProForm/components/old/InputWithSuffix/index.d.ts +2 -1
- package/es/ProForm/components/old/ProAddress/index.d.ts +2 -1
- package/es/ProForm/components/old/ProCertValidity/index.js +1 -1
- package/es/ProForm/components/old/ProRangeBox/index.d.ts +2 -1
- package/es/ProForm/components/render/Render.js +6 -22
- package/es/ProForm/components/render/propsType.d.ts +4 -0
- package/es/ProForm/index.js +3 -1
- package/es/ProForm/style/index.less +12 -5
- package/es/ProForm/utils/index.d.ts +5 -2
- package/es/ProForm/utils/index.js +7 -12
- package/es/ProForm/utils/transformValue.js +4 -2
- package/es/ProForm/utils/useShouldUpdate.js +1 -0
- package/es/ProForm/utils/valueType.d.ts +4 -4
- package/es/ProIcon/index.d.ts +1 -0
- package/es/ProIcon/index.js +35 -5
- package/es/ProIcon/propsTypes.d.ts +9 -9
- package/es/ProIcon/symbolIcon.js +43 -0
- package/es/ProLayout/components/Layout/Header/style/index.less +1 -2
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +2 -1
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +1 -1
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +3 -0
- package/es/ProLayout/components/ProCollapse/index.d.ts +2 -1
- package/es/ProLayout/components/ProCollapse/style/index.less +1 -0
- package/es/ProLayout/components/ProFooter/index.d.ts +1 -1
- package/es/ProLayout/components/ProHeader/components/Copy/index.d.ts +2 -1
- package/es/ProLayout/components/ProHeader/index.d.ts +1 -1
- package/es/ProLayout/components/ProHeader/index.js +2 -4
- package/es/ProLayout/components/ProHeader/style/index.less +3 -3
- package/es/ProLayout/index.d.ts +4 -4
- package/es/ProLayout/index.js +5 -6
- package/es/ProLayout/propTypes.d.ts +2 -5
- package/es/ProLayout/style/index.less +7 -1
- package/es/ProSelect/index.d.ts +1 -1
- package/es/ProSelect/index.js +1 -1
- package/es/ProSelect/propsType.d.ts +7 -0
- package/es/ProStep/components/Anchor/index.d.ts +2 -1
- package/es/ProStep/components/Item/index.d.ts +2 -1
- package/es/ProStep/components/Step/index.d.ts +2 -1
- package/es/ProStep/components/Step/index.js +12 -10
- package/es/ProStep/index.d.ts +2 -2
- package/es/ProStep/style/index.less +1 -1
- package/es/ProTable/components/ResizableLine/index.d.ts +2 -1
- package/es/ProTable/components/TableResizable/index.d.ts +2 -1
- package/es/ProTable/index.d.ts +1 -1
- package/es/ProTable/index.js +1 -1
- package/es/ProTable/propsType.d.ts +3 -2
- package/es/ProTable/style/index.less +12 -17
- package/es/ProTable/useAntdTable.d.ts +4 -4
- package/es/ProTable/useAntdTable.js +54 -34
- package/es/ProTable/utils.js +24 -5
- package/es/ProTabs/components/Card/index.d.ts +4 -0
- package/es/ProTabs/components/Card/index.js +24 -0
- package/es/ProTabs/components/index.d.ts +1 -0
- package/es/ProTabs/components/index.js +1 -0
- package/es/ProTabs/index.d.ts +4 -0
- package/es/ProTabs/index.js +98 -0
- package/es/ProTabs/propType.d.ts +31 -0
- package/es/ProTabs/propType.js +1 -0
- package/es/ProTabs/style/index.less +68 -0
- package/es/ProThemeTools/component/PrdTools/index.d.ts +4 -0
- package/es/ProThemeTools/component/PrdTools/index.js +200 -0
- package/es/ProThemeTools/component/PrdTools/style/index.less +164 -0
- package/es/ProThemeTools/component/index.d.ts +2 -0
- package/es/ProThemeTools/component/index.js +2 -0
- package/es/ProThemeTools/index.d.ts +14 -0
- package/es/ProThemeTools/index.js +179 -0
- package/es/ProThemeTools/propsType.d.ts +30 -0
- package/es/ProThemeTools/propsType.js +1 -0
- package/es/ProThemeTools/style/index.less +55 -0
- package/es/ProThemeTools/utils/index.d.ts +14 -0
- package/es/ProThemeTools/utils/index.js +54 -0
- package/es/ProTooltip/index.d.ts +2 -1
- package/es/ProTransferModal/components/SortableItem/index.js +2 -2
- package/es/ProTransferModal/style/index.less +9 -1
- package/es/ProTreeModal/components/CloseIcon.d.ts +3 -0
- package/es/ProTreeModal/components/CloseIcon.js +25 -0
- package/es/ProTreeModal/components/List.d.ts +13 -0
- package/es/ProTreeModal/components/List.js +52 -0
- package/es/ProTreeModal/components/SearchTitle.d.ts +7 -0
- package/es/ProTreeModal/components/SearchTitle.js +14 -0
- package/es/ProTreeModal/components/Tree.d.ts +15 -0
- package/es/ProTreeModal/components/Tree.js +149 -0
- package/es/ProTreeModal/components/Trigger.d.ts +10 -0
- package/es/ProTreeModal/components/Trigger.js +32 -0
- package/es/ProTreeModal/components/index.d.ts +5 -0
- package/es/ProTreeModal/components/index.js +5 -0
- package/es/ProTreeModal/data/datasource.d.ts +5 -0
- package/es/ProTreeModal/data/datasource.js +17 -0
- package/es/ProTreeModal/data/mock.d.ts +9 -0
- package/es/ProTreeModal/data/mock.js +39 -0
- package/es/ProTreeModal/index.d.ts +5 -0
- package/es/ProTreeModal/index.js +333 -0
- package/es/ProTreeModal/propsType.d.ts +26 -0
- package/es/ProTreeModal/propsType.js +1 -0
- package/es/ProTreeModal/style/index.less +105 -0
- package/es/ProTreeModal/utils.d.ts +26 -0
- package/es/ProTreeModal/utils.js +136 -0
- package/es/ProTreeSelect/index.d.ts +5 -0
- package/es/ProTreeSelect/index.js +404 -0
- package/es/ProTreeSelect/propsType.d.ts +95 -0
- package/es/ProTreeSelect/propsType.js +1 -0
- package/es/ProTreeSelect/style/index.less +109 -0
- package/es/ProUpload/index.d.ts +0 -1
- package/es/ProUpload/index.js +8 -2
- package/es/ProUpload/style/fileItem.less +3 -1
- package/es/ProUpload/style/index.less +8 -1
- package/es/ProWaterMark/index.js +1 -1
- package/es/assets/close.svg +1 -0
- package/es/index.d.ts +3 -0
- package/es/index.js +4 -8
- package/es/old/ProCertValidity/index.js +1 -1
- package/es/style/components.less +25 -9
- package/es/style/theme/antd.less +60 -29
- package/es/style/theme/index.less +154 -176
- package/es/tokens.js +85 -0
- package/lib/ProDrawerForm/components/ProDrawer/index.js +5 -3
- package/lib/ProDrawerForm/components/ProModal/index.js +13 -5
- package/lib/ProDrawerForm/index.js +1 -1
- package/lib/ProDrawerForm/propsType.d.ts +4 -0
- package/lib/ProDrawerForm/style/index.less +88 -55
- package/lib/ProEditLabel/components/RenderProForm.d.ts +4 -0
- package/lib/ProEditLabel/components/RenderProForm.js +78 -0
- package/lib/ProEditLabel/index.js +102 -137
- package/lib/ProEditLabel/propsType.d.ts +7 -4
- package/lib/ProEditLabel/style/index.less +33 -2
- package/lib/ProEditLabel/utils/index.d.ts +5 -7
- package/lib/ProEditLabel/utils/index.js +14 -31
- package/lib/ProEditTable/components/ActionButton/index.d.ts +2 -1
- package/lib/ProEditTable/components/ActionButton/index.js +20 -4
- package/lib/ProEditTable/components/RenderField/index.d.ts +2 -1
- package/lib/ProEditTable/components/RenderField/index.js +3 -2
- package/lib/ProEditTable/components/RenderToolbar/index.d.ts +2 -1
- package/lib/ProEditTable/components/Summary/index.d.ts +2 -1
- package/lib/ProEditTable/propsType.d.ts +5 -0
- package/lib/ProEditTable/style/index.less +16 -13
- package/lib/ProEditTable/utils/config.d.ts +2 -1
- package/lib/ProEditTable/utils/config.js +24 -13
- package/lib/ProEditTable/utils/index.js +5 -3
- package/lib/ProEnum/getEnumLabel.d.ts +2 -1
- package/lib/ProEnum/index.d.ts +3 -2
- package/lib/ProEnum/useEnumRequest.js +6 -11
- package/lib/ProForm/components/base/DatePicker/index.js +1 -1
- package/lib/ProForm/components/base/FormList/components/ActionButton.js +4 -5
- package/lib/ProForm/components/base/FormList/index.d.ts +1 -0
- package/lib/ProForm/components/base/FormList/index.js +10 -5
- package/lib/ProForm/components/base/FormList/style/index.less +3 -0
- package/lib/ProForm/components/base/Input/index.d.ts +2 -1
- package/lib/ProForm/components/base/InputNumber/index.js +24 -0
- package/lib/ProForm/components/base/RangePicker/index.js +2 -2
- package/lib/ProForm/components/combination/ProAddressBar/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProAddressBar/index.js +2 -1
- package/lib/ProForm/components/combination/ProCombination/index.js +3 -3
- package/lib/ProForm/components/combination/ProModalSelect/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +3 -2
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +7 -6
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +45 -36
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +13 -15
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +1 -1
- package/lib/ProForm/components/index.d.ts +2 -0
- package/lib/ProForm/components/index.js +14 -0
- package/lib/ProForm/components/old/CertNo/index.d.ts +2 -1
- package/lib/ProForm/components/old/InputRange/index.d.ts +2 -1
- package/lib/ProForm/components/old/InputWithSuffix/index.d.ts +2 -1
- package/lib/ProForm/components/old/ProAddress/index.d.ts +2 -1
- package/lib/ProForm/components/old/ProCertValidity/index.js +1 -1
- package/lib/ProForm/components/old/ProRangeBox/index.d.ts +2 -1
- package/lib/ProForm/components/render/Render.js +4 -20
- package/lib/ProForm/components/render/propsType.d.ts +4 -0
- package/lib/ProForm/index.js +2 -0
- package/lib/ProForm/style/index.less +12 -5
- package/lib/ProForm/utils/index.d.ts +5 -2
- package/lib/ProForm/utils/index.js +10 -14
- package/lib/ProForm/utils/transformValue.js +4 -2
- package/lib/ProForm/utils/useShouldUpdate.js +1 -0
- package/lib/ProForm/utils/valueType.d.ts +4 -4
- package/lib/ProIcon/index.d.ts +1 -0
- package/lib/ProIcon/index.js +36 -5
- package/lib/ProIcon/propsTypes.d.ts +9 -9
- package/lib/ProIcon/symbolIcon.js +45 -0
- package/lib/ProLayout/components/Layout/Header/style/index.less +1 -2
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +2 -1
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +1 -1
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +3 -0
- package/lib/ProLayout/components/ProCollapse/index.d.ts +2 -1
- package/lib/ProLayout/components/ProCollapse/style/index.less +1 -0
- package/lib/ProLayout/components/ProFooter/index.d.ts +1 -1
- package/lib/ProLayout/components/ProHeader/components/Copy/index.d.ts +2 -1
- package/lib/ProLayout/components/ProHeader/index.d.ts +1 -1
- package/lib/ProLayout/components/ProHeader/index.js +1 -4
- package/lib/ProLayout/components/ProHeader/style/index.less +3 -3
- package/lib/ProLayout/index.d.ts +4 -4
- package/lib/ProLayout/index.js +5 -6
- package/lib/ProLayout/propTypes.d.ts +2 -5
- package/lib/ProLayout/style/index.less +7 -1
- package/lib/ProSelect/index.d.ts +1 -1
- package/lib/ProSelect/index.js +1 -1
- package/lib/ProSelect/propsType.d.ts +7 -0
- package/lib/ProStep/components/Anchor/index.d.ts +2 -1
- package/lib/ProStep/components/Item/index.d.ts +2 -1
- package/lib/ProStep/components/Step/index.d.ts +2 -1
- package/lib/ProStep/components/Step/index.js +11 -9
- package/lib/ProStep/index.d.ts +2 -2
- package/lib/ProStep/style/index.less +1 -1
- package/lib/ProTable/components/ResizableLine/index.d.ts +2 -1
- package/lib/ProTable/components/TableResizable/index.d.ts +2 -1
- package/lib/ProTable/components/TableResizable/index.js +8 -0
- package/lib/ProTable/index.d.ts +1 -1
- package/lib/ProTable/index.js +1 -1
- package/lib/ProTable/propsType.d.ts +3 -2
- package/lib/ProTable/style/index.less +12 -17
- package/lib/ProTable/useAntdTable.d.ts +4 -4
- package/lib/ProTable/useAntdTable.js +53 -33
- package/lib/ProTable/utils.js +24 -5
- package/lib/ProTabs/components/Card/index.d.ts +4 -0
- package/lib/ProTabs/components/Card/index.js +31 -0
- package/lib/ProTabs/components/index.d.ts +1 -0
- package/lib/ProTabs/components/index.js +13 -0
- package/lib/ProTabs/index.d.ts +4 -0
- package/lib/ProTabs/index.js +106 -0
- package/lib/ProTabs/propType.d.ts +31 -0
- package/lib/ProTabs/propType.js +5 -0
- package/lib/ProTabs/style/index.less +68 -0
- package/lib/ProThemeTools/component/PrdTools/index.d.ts +4 -0
- package/lib/ProThemeTools/component/PrdTools/index.js +202 -0
- package/lib/ProThemeTools/component/PrdTools/style/index.less +164 -0
- package/lib/ProThemeTools/component/index.d.ts +2 -0
- package/lib/ProThemeTools/component/index.js +13 -0
- package/lib/ProThemeTools/index.d.ts +14 -0
- package/lib/ProThemeTools/index.js +185 -0
- package/lib/ProThemeTools/propsType.d.ts +30 -0
- package/lib/ProThemeTools/propsType.js +5 -0
- package/lib/ProThemeTools/style/index.less +55 -0
- package/lib/ProThemeTools/utils/index.d.ts +14 -0
- package/lib/ProThemeTools/utils/index.js +63 -0
- package/lib/ProTooltip/index.d.ts +2 -1
- package/lib/ProTransferModal/components/SortableItem/index.js +2 -2
- package/lib/ProTransferModal/style/index.less +9 -1
- package/lib/ProTreeModal/components/CloseIcon.d.ts +3 -0
- package/lib/ProTreeModal/components/CloseIcon.js +33 -0
- package/lib/ProTreeModal/components/List.d.ts +13 -0
- package/lib/ProTreeModal/components/List.js +59 -0
- package/lib/ProTreeModal/components/SearchTitle.d.ts +7 -0
- package/lib/ProTreeModal/components/SearchTitle.js +22 -0
- package/lib/ProTreeModal/components/Tree.d.ts +15 -0
- package/lib/ProTreeModal/components/Tree.js +157 -0
- package/lib/ProTreeModal/components/Trigger.d.ts +10 -0
- package/lib/ProTreeModal/components/Trigger.js +39 -0
- package/lib/ProTreeModal/components/index.d.ts +5 -0
- package/lib/ProTreeModal/components/index.js +41 -0
- package/lib/ProTreeModal/data/datasource.d.ts +5 -0
- package/lib/ProTreeModal/data/datasource.js +24 -0
- package/lib/ProTreeModal/data/mock.d.ts +9 -0
- package/lib/ProTreeModal/data/mock.js +47 -0
- package/lib/ProTreeModal/index.d.ts +5 -0
- package/lib/ProTreeModal/index.js +340 -0
- package/lib/ProTreeModal/propsType.d.ts +26 -0
- package/lib/ProTreeModal/propsType.js +5 -0
- package/lib/ProTreeModal/style/index.less +105 -0
- package/lib/ProTreeModal/utils.d.ts +26 -0
- package/lib/ProTreeModal/utils.js +148 -0
- package/lib/ProTreeSelect/index.d.ts +5 -0
- package/lib/ProTreeSelect/index.js +411 -0
- package/lib/ProTreeSelect/propsType.d.ts +95 -0
- package/lib/ProTreeSelect/propsType.js +5 -0
- package/lib/ProTreeSelect/style/index.less +109 -0
- package/lib/ProUpload/index.d.ts +0 -1
- package/lib/ProUpload/index.js +8 -2
- package/lib/ProUpload/style/fileItem.less +3 -1
- package/lib/ProUpload/style/index.less +8 -1
- package/lib/ProWaterMark/index.js +1 -1
- package/lib/assets/close.svg +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +28 -0
- package/lib/old/ProCertValidity/index.js +1 -1
- package/lib/style/components.less +25 -9
- package/lib/style/theme/antd.less +60 -29
- package/lib/style/theme/index.less +154 -176
- package/lib/tokens.js +87 -0
- package/package.json +7 -8
- package/typings.d.ts +4 -0
- package/es/ProEditLabel/components/RenderForm.d.ts +0 -3
- package/es/ProEditLabel/components/RenderForm.js +0 -65
- package/lib/ProEditLabel/components/RenderForm.d.ts +0 -3
- package/lib/ProEditLabel/components/RenderForm.js +0 -75
- package/source-code/package.json +0 -16
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { InputProps } from 'antd/lib/input';
|
|
2
2
|
import { PopconfirmProps } from 'antd/lib/popconfirm';
|
|
3
|
+
import { FormInstance } from 'antd/lib/form';
|
|
3
4
|
import React from 'react';
|
|
5
|
+
import { ProColumnProps } from '../index';
|
|
4
6
|
export interface ContainerProps {
|
|
5
7
|
trigger?: 'click' | 'hover';
|
|
6
8
|
size?: 'small' | 'middle' | 'large';
|
|
@@ -19,6 +21,7 @@ export interface PopupProps {
|
|
|
19
21
|
trim?: boolean;
|
|
20
22
|
labelWidth?: string | number;
|
|
21
23
|
fieldProps?: any;
|
|
24
|
+
columns?: ProColumnProps;
|
|
22
25
|
[key: string]: any;
|
|
23
26
|
}
|
|
24
27
|
export interface LabelProps extends InputProps {
|
|
@@ -34,10 +37,10 @@ export interface PopupConfirmProps extends Partial<PopconfirmProps> {
|
|
|
34
37
|
viewEmpty?: '-';
|
|
35
38
|
onConfirm?: (e?: any) => void;
|
|
36
39
|
onFinish?: (e?: any) => void;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
onOpenChange?: (e?: any) => void;
|
|
41
|
+
trigger?: 'click' | 'hover';
|
|
42
|
+
value?: any;
|
|
43
|
+
form?: FormInstance;
|
|
41
44
|
disabled?: boolean;
|
|
42
45
|
[key: string]: any;
|
|
43
46
|
}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
.pro-edit-label {
|
|
2
2
|
display: inline-block;
|
|
3
3
|
|
|
4
|
+
.pro-form-view {
|
|
5
|
+
.ant-row {
|
|
6
|
+
display: block;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
4
10
|
.pro-form-view-container {
|
|
5
11
|
word-break: break-all;
|
|
6
|
-
display: inline-block;
|
|
12
|
+
display : inline-block;
|
|
7
13
|
}
|
|
8
14
|
|
|
9
15
|
&.trigger-hover {
|
|
@@ -50,8 +56,34 @@
|
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
.ant-popover {
|
|
59
|
+
.ant-btn-sm {
|
|
60
|
+
font-size : 12px;
|
|
61
|
+
min-width : 56px;
|
|
62
|
+
line-height: 1;
|
|
63
|
+
|
|
64
|
+
span {
|
|
65
|
+
letter-spacing: -1px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.pro-edit-label-popconfirm {
|
|
53
72
|
z-index: 1029 !important;
|
|
54
73
|
|
|
74
|
+
.ant-popover-message {
|
|
75
|
+
display: block;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.ant-popover-message-title {
|
|
79
|
+
padding-left: 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ant-popover-content {
|
|
83
|
+
width : 360px;
|
|
84
|
+
max-width: 400px;
|
|
85
|
+
}
|
|
86
|
+
|
|
55
87
|
.pro-edit-label-title {
|
|
56
88
|
font-size : 16px;
|
|
57
89
|
font-weight : 500;
|
|
@@ -60,7 +92,6 @@
|
|
|
60
92
|
}
|
|
61
93
|
|
|
62
94
|
.pro-edit-label-tip {
|
|
63
|
-
max-width : 300px;
|
|
64
95
|
margin-bottom: var(--zaui-space-size-md, 16px);
|
|
65
96
|
color : #666;
|
|
66
97
|
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param
|
|
4
|
-
* @param
|
|
5
|
-
* @returns
|
|
2
|
+
* 判断columns的length是否为1,给表单赋值,默认匹配到value上
|
|
3
|
+
* @param value 表单值
|
|
4
|
+
* @param columns 表单配置项
|
|
5
|
+
* @returns value
|
|
6
6
|
*/
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const isNullValue: (value: any) => boolean;
|
|
9
|
-
export declare const isNullArray: (value: any, length: any) => boolean;
|
|
7
|
+
export declare const matchFormValue: (value: any, columns: any) => any;
|
|
@@ -1,41 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports.
|
|
7
|
+
exports.matchFormValue = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
7
9
|
/**
|
|
8
|
-
*
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
11
|
-
* @returns
|
|
10
|
+
* 判断columns的length是否为1,给表单赋值,默认匹配到value上
|
|
11
|
+
* @param value 表单值
|
|
12
|
+
* @param columns 表单配置项
|
|
13
|
+
* @returns value
|
|
12
14
|
*/
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
result.getValueFromEvent = function (event) {
|
|
17
|
-
return event.target.value.trim();
|
|
18
|
-
};
|
|
15
|
+
var matchFormValue = function matchFormValue(value, columns) {
|
|
16
|
+
if (!Array.isArray(columns)) {
|
|
17
|
+
return value;
|
|
19
18
|
}
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
// 判断一个字段值是否算空
|
|
23
|
-
exports.isTrim = isTrim;
|
|
24
|
-
var nullList = [undefined, 'null', '""', '[]'];
|
|
25
|
-
var isNullValue = function isNullValue(value) {
|
|
26
|
-
return nullList.includes(JSON.stringify(value));
|
|
27
|
-
};
|
|
28
|
-
// 判断数组是否算空
|
|
29
|
-
exports.isNullValue = isNullValue;
|
|
30
|
-
var isNullArray = function isNullArray(value, length) {
|
|
31
|
-
if (Array.isArray(value)) {
|
|
32
|
-
for (var i = 0; i < length; i++) {
|
|
33
|
-
if (isNullValue(value[i])) {
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return false;
|
|
19
|
+
if (columns.length === 1) {
|
|
20
|
+
return (0, _defineProperty2.default)({}, columns[0].name || columns[0].type, value);
|
|
38
21
|
}
|
|
39
|
-
return
|
|
22
|
+
return value;
|
|
40
23
|
};
|
|
41
|
-
exports.
|
|
24
|
+
exports.matchFormValue = matchFormValue;
|
|
@@ -48,21 +48,37 @@ var ActionButton = function ActionButton(_ref) {
|
|
|
48
48
|
if ((0, _lodash.isFunction)(btnConfig.label)) {
|
|
49
49
|
btnConfig.label = /*#__PURE__*/_react.default.createElement(btnConfig.label, null);
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
var isDisabled = !selectedRowKeys.length && btnConfig.type === 'mulDelete' || editingKeys.length || (delBtnProps === null || delBtnProps === void 0 ? void 0 : delBtnProps.disabled);
|
|
52
|
+
return isEditing && getShow(btnConfig.show) ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, ['delete', 'mulDelete'].includes(btnConfig.type) ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (btnConfig === null || btnConfig === void 0 ? void 0 : btnConfig.needConfirm) ? /*#__PURE__*/_react.default.createElement(_antd.Popconfirm, {
|
|
52
53
|
placement: "topRight",
|
|
53
54
|
title: deleteMsgMap[btnConfig.type],
|
|
54
55
|
onConfirm: function onConfirm() {
|
|
55
56
|
btnConfig.onClick(record, index);
|
|
56
57
|
},
|
|
57
|
-
disabled:
|
|
58
|
+
disabled: isDisabled,
|
|
58
59
|
okText: "\u786E\u8BA4",
|
|
59
60
|
cancelText: "\u53D6\u6D88"
|
|
60
61
|
}, /*#__PURE__*/_react.default.isValidElement(btnConfig.label) ? /*#__PURE__*/_react.default.cloneElement(btnConfig.label, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(delBtnProps, ['buttonProps', 'isEditable'])), {}, {
|
|
61
62
|
record: record,
|
|
62
|
-
index: index
|
|
63
|
+
index: index,
|
|
64
|
+
disabled: isDisabled
|
|
63
65
|
})) : /*#__PURE__*/_react.default.createElement(_antd.Button, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(delBtnProps, ['buttonProps', 'isEditable'])), {}, {
|
|
66
|
+
disabled: isDisabled,
|
|
64
67
|
type: "link"
|
|
65
|
-
}), btnConfig.label)) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.isValidElement(btnConfig.label) ? /*#__PURE__*/_react.default.cloneElement(btnConfig.label, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(
|
|
68
|
+
}), btnConfig.label)) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.isValidElement(btnConfig.label) ? /*#__PURE__*/_react.default.cloneElement(btnConfig.label, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(delBtnProps, ['buttonProps', 'isEditable'])), {}, {
|
|
69
|
+
record: record,
|
|
70
|
+
index: index,
|
|
71
|
+
disabled: isDisabled,
|
|
72
|
+
onClick: function onClick() {
|
|
73
|
+
btnConfig.onClick(record, index);
|
|
74
|
+
}
|
|
75
|
+
})) : /*#__PURE__*/_react.default.createElement(_antd.Button, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(delBtnProps, ['buttonProps', 'isEditable'])), {}, {
|
|
76
|
+
disabled: isDisabled,
|
|
77
|
+
type: "link",
|
|
78
|
+
onClick: function onClick() {
|
|
79
|
+
btnConfig.onClick(record, index);
|
|
80
|
+
}
|
|
81
|
+
}), btnConfig.label))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.isValidElement(btnConfig.label) ? /*#__PURE__*/_react.default.cloneElement(btnConfig.label, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(actionBtnProps, ['buttonProps', 'isEditable'])), {}, {
|
|
66
82
|
record: record,
|
|
67
83
|
index: index
|
|
68
84
|
})) : /*#__PURE__*/_react.default.createElement(_antd.Button, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
@@ -22,6 +22,8 @@ var componentMap = _interopRequireWildcard(require("../../../ProForm/components"
|
|
|
22
22
|
var _Container = _interopRequireDefault(require("../../../ProForm/components/Container"));
|
|
23
23
|
var _transformNames = _interopRequireDefault(require("../../../ProForm/utils/transformNames"));
|
|
24
24
|
var _excluded = ["type", "valueType", "rules", "names", "fieldProps", "required", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable"];
|
|
25
|
+
/* eslint-disable prefer-destructuring */
|
|
26
|
+
/* eslint-disable prefer-const */
|
|
25
27
|
var RenderField = function RenderField(_ref) {
|
|
26
28
|
var _type, _type$replace, _names, _fieldProps$rules, _formItemChildProps$p, _TargetComponent4;
|
|
27
29
|
var value = _ref.text,
|
|
@@ -213,7 +215,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
213
215
|
TargetComponent = viewRender;
|
|
214
216
|
}
|
|
215
217
|
}
|
|
216
|
-
var defaultPlaceholder = ['Select', 'EnumSelect', 'DatePicker', '
|
|
218
|
+
var defaultPlaceholder = ['Select', 'EnumSelect', 'DatePicker', 'RangePicker', 'Cascader', 'ProSelect', 'ProEnum', 'ProTimeLimit'].includes(type) ? "\u8BF7\u9009\u62E9".concat((0, _lodash.isString)(label) ? label || title : '') : "\u8BF7\u8F93\u5165".concat((0, _lodash.isString)(label) ? label || title : '');
|
|
217
219
|
var _placeholder = (_formItemChildProps$p = formItemChildProps === null || formItemChildProps === void 0 ? void 0 : formItemChildProps.placeholder) !== null && _formItemChildProps$p !== void 0 ? _formItemChildProps$p : defaultPlaceholder;
|
|
218
220
|
var _disabled = disabled || (formItemChildProps === null || formItemChildProps === void 0 ? void 0 : formItemChildProps.disabled);
|
|
219
221
|
var _rules = isEditing ? _formItemProps === null || _formItemProps === void 0 ? void 0 : _formItemProps.rules : [];
|
|
@@ -446,7 +448,6 @@ var RenderField = function RenderField(_ref) {
|
|
|
446
448
|
// 单元格编辑时,设置各个单元格disabled属性
|
|
447
449
|
if (isCell) {
|
|
448
450
|
record["$".concat(dataIndex, "Disabled")] = _disabled;
|
|
449
|
-
form.setFieldValue([].concat((0, _toConsumableArray2.default)(namePath), [index, "$".concat(dataIndex, "Disabled")]), _disabled);
|
|
450
451
|
}
|
|
451
452
|
// if (isCell) {
|
|
452
453
|
// _formItemProps.validateTrigger = 'onBlur';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { SummaryColumnProps } from '../../propsType';
|
|
2
3
|
interface SummaryProps<T = any> {
|
|
3
4
|
data: T[];
|
|
@@ -8,5 +9,5 @@ interface SummaryProps<T = any> {
|
|
|
8
9
|
};
|
|
9
10
|
rowSelection: any;
|
|
10
11
|
}
|
|
11
|
-
declare const Summary: ({ data, summary, rowSelection, }: SummaryProps) => JSX.Element;
|
|
12
|
+
declare const Summary: ({ data, summary, rowSelection, }: SummaryProps) => React.JSX.Element;
|
|
12
13
|
export default Summary;
|
|
@@ -38,12 +38,13 @@
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
.is-cell .ant-form-item .ant-form-item-row .ant-form-item-control .ant-form-item-control-input
|
|
41
|
+
.is-cell .ant-form-item .ant-form-item-row .ant-form-item-control .ant-form-item-control-input {
|
|
42
42
|
border: 1px solid transparent;
|
|
43
|
+
|
|
43
44
|
&:hover {
|
|
44
|
-
border: 1px solid #DEE0E3;
|
|
45
|
+
border : 1px solid #DEE0E3;
|
|
45
46
|
border-radius: 4px;
|
|
46
|
-
text-indent: 5px;
|
|
47
|
+
text-indent : 5px;
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
|
|
@@ -87,13 +88,15 @@
|
|
|
87
88
|
|
|
88
89
|
.ant-table-content {
|
|
89
90
|
>table {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
91
|
+
.ant-table-summary {
|
|
92
|
+
background-color: var(--zaui-table-header-bg, #f2f3f5);
|
|
93
|
+
color : #343434;
|
|
94
|
+
font-weight : 600;
|
|
95
|
+
|
|
96
|
+
.ant-table-cell-fix-left,
|
|
97
|
+
.ant-table-cell-fix-right {
|
|
98
|
+
background-color: var(--zaui-table-header-bg, #f2f3f5);
|
|
99
|
+
}
|
|
97
100
|
}
|
|
98
101
|
|
|
99
102
|
td {
|
|
@@ -149,7 +152,7 @@
|
|
|
149
152
|
.ant-table-thead>tr>th {
|
|
150
153
|
border : 0;
|
|
151
154
|
white-space : nowrap;
|
|
152
|
-
background-color: #
|
|
155
|
+
background-color: var(--zaui-table-header-bg, #f2f3f5);
|
|
153
156
|
}
|
|
154
157
|
|
|
155
158
|
.ant-table-thead>tr>th:not(:last-child):not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan])::before {
|
|
@@ -173,7 +176,7 @@
|
|
|
173
176
|
}
|
|
174
177
|
|
|
175
178
|
.ant-table-tbody tr:nth-child(2n)>td {
|
|
176
|
-
background-color: #
|
|
179
|
+
background-color: var(--zaui-table-strip-bg, #FAFAFA);
|
|
177
180
|
}
|
|
178
181
|
|
|
179
182
|
.ant-table-tbody>.ant-table-placeholder>td {
|
|
@@ -207,7 +210,7 @@
|
|
|
207
210
|
}
|
|
208
211
|
}
|
|
209
212
|
|
|
210
|
-
.ant-table-summary
|
|
213
|
+
.ant-table-summary>tr>td {
|
|
211
214
|
border-bottom: none;
|
|
212
215
|
}
|
|
213
216
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
export declare const defaultBtnNameMap: {
|
|
2
3
|
add: string;
|
|
3
4
|
edit: string;
|
|
@@ -9,7 +10,7 @@ export declare const defaultBtnNameMap: {
|
|
|
9
10
|
custom: string;
|
|
10
11
|
};
|
|
11
12
|
export declare const iconMap: {
|
|
12
|
-
add: JSX.Element;
|
|
13
|
+
add: React.JSX.Element;
|
|
13
14
|
};
|
|
14
15
|
export declare const defaultSingleActionKeys: string[];
|
|
15
16
|
export declare const defaultMultipleActionKeys: string[];
|
|
@@ -61,7 +61,11 @@ var actions = {
|
|
|
61
61
|
// 开启编辑状态
|
|
62
62
|
nextEditingKeys.push(record.rowKey);
|
|
63
63
|
// 编辑时赋值编辑状态,供validator做保存校验
|
|
64
|
-
|
|
64
|
+
if (nextEditingKeys === null || nextEditingKeys === void 0 ? void 0 : nextEditingKeys.length) {
|
|
65
|
+
record.isEditing = true;
|
|
66
|
+
} else {
|
|
67
|
+
delete record.isEditing;
|
|
68
|
+
}
|
|
65
69
|
// 复制当前行数据
|
|
66
70
|
form.setFieldValue(virtualRowName, record);
|
|
67
71
|
setState({
|
|
@@ -83,7 +87,11 @@ var actions = {
|
|
|
83
87
|
nextEditingKeys = editingKeys.filter(function (key) {
|
|
84
88
|
return key !== record.rowKey;
|
|
85
89
|
}); // 保存后取消编辑状态,供validator做保存校验
|
|
86
|
-
|
|
90
|
+
if (nextEditingKeys === null || nextEditingKeys === void 0 ? void 0 : nextEditingKeys.length) {
|
|
91
|
+
record.isEditing = true;
|
|
92
|
+
} else {
|
|
93
|
+
delete record.isEditing;
|
|
94
|
+
}
|
|
87
95
|
form.setFieldValue(rowName, record);
|
|
88
96
|
setState({
|
|
89
97
|
editingKeys: nextEditingKeys
|
|
@@ -111,7 +119,11 @@ var actions = {
|
|
|
111
119
|
return key !== record.rowKey;
|
|
112
120
|
});
|
|
113
121
|
// 保存后取消编辑状态,供validator做保存校验
|
|
114
|
-
|
|
122
|
+
if (nextEditingKeys === null || nextEditingKeys === void 0 ? void 0 : nextEditingKeys.length) {
|
|
123
|
+
record.isEditing = true;
|
|
124
|
+
} else {
|
|
125
|
+
delete record.isEditing;
|
|
126
|
+
}
|
|
115
127
|
setState({
|
|
116
128
|
editingKeys: nextEditingKeys
|
|
117
129
|
}); // 关闭编辑状态
|
|
@@ -173,18 +185,17 @@ var actions = {
|
|
|
173
185
|
_antd.message.warning(onlyOneLineMsg);
|
|
174
186
|
return false;
|
|
175
187
|
}
|
|
188
|
+
var rowKey = (0, _tools.getRandom)();
|
|
176
189
|
// 添加新增对象数据
|
|
177
|
-
var addData = (0, _typeof2.default)(result) === 'object' ? result : {}
|
|
178
|
-
var rowKey = Math.random().toString(36).slice(-6);
|
|
179
|
-
insertType === 'before' ? nextData.unshift((0, _objectSpread2.default)((0, _objectSpread2.default)({}, addData), {}, {
|
|
180
|
-
addFlag: true,
|
|
181
|
-
isEditing: true,
|
|
182
|
-
rowKey: rowKey
|
|
183
|
-
})) : nextData.push((0, _objectSpread2.default)((0, _objectSpread2.default)({}, addData), {}, {
|
|
184
|
-
addFlag: true,
|
|
185
|
-
isEditing: true,
|
|
190
|
+
var addData = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _typeof2.default)(result) === 'object' ? result : {}), {}, {
|
|
186
191
|
rowKey: rowKey
|
|
187
|
-
})
|
|
192
|
+
});
|
|
193
|
+
// 单行编辑时,需要操作一下数据结构,判断是否第一次新增,以及是否是编辑状态
|
|
194
|
+
if (virtualKey) {
|
|
195
|
+
addData.addFlag = true;
|
|
196
|
+
addData.isEditing = true;
|
|
197
|
+
}
|
|
198
|
+
insertType === 'before' ? nextData.unshift(addData) : nextData.push(addData);
|
|
188
199
|
form.setFieldValue(name, nextData);
|
|
189
200
|
// 当单选情况下,存储正在编辑值
|
|
190
201
|
if (virtualKey) {
|
|
@@ -22,7 +22,7 @@ var _tools = require("./tools");
|
|
|
22
22
|
var _ProTooltip = _interopRequireDefault(require("../../ProTooltip"));
|
|
23
23
|
var _components = require("../components");
|
|
24
24
|
var _tip = _interopRequireDefault(require("../../assets/tip.svg"));
|
|
25
|
-
var _excluded = ["type", "label", "show", "onHandle", "onClick"],
|
|
25
|
+
var _excluded = ["type", "label", "show", "needConfirm", "onHandle", "onClick"],
|
|
26
26
|
_excluded2 = ["title", "icon"];
|
|
27
27
|
// 渲染操作栏
|
|
28
28
|
var getActionColumn = function getActionColumn(config) {
|
|
@@ -65,15 +65,17 @@ var getActionColumn = function getActionColumn(config) {
|
|
|
65
65
|
var type = action.type,
|
|
66
66
|
label = action.label,
|
|
67
67
|
show = action.show,
|
|
68
|
+
needConfirm = action.needConfirm,
|
|
68
69
|
onHandle = action.onHandle,
|
|
69
70
|
onClick = action.onClick,
|
|
70
71
|
buttonProps = (0, _objectWithoutProperties2.default)(action, _excluded);
|
|
71
72
|
action.isEditable = _config.defaultEditingActionKeys.includes(type);
|
|
72
73
|
action.label = label !== null && label !== void 0 ? label : _config.defaultBtnNameMap[type];
|
|
73
74
|
action.show = show !== null && show !== void 0 ? show : true;
|
|
75
|
+
action.needConfirm = needConfirm !== null && needConfirm !== void 0 ? needConfirm : true;
|
|
74
76
|
action.onClick = /*#__PURE__*/function () {
|
|
75
77
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(record, index) {
|
|
76
|
-
var _yield$action$onHandl, _action$onHandle;
|
|
78
|
+
var _form$getFieldValue, _yield$action$onHandl, _action$onHandle;
|
|
77
79
|
var rowName, _record, result;
|
|
78
80
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
79
81
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -87,7 +89,7 @@ var getActionColumn = function getActionColumn(config) {
|
|
|
87
89
|
return (0, _tools.customValidate)(validateKeys, form, rowName);
|
|
88
90
|
case 4:
|
|
89
91
|
// 编辑状态使用自定义form值,非编辑状态直接使用行数据
|
|
90
|
-
_record =
|
|
92
|
+
_record = (_form$getFieldValue = form.getFieldValue(rowName)) !== null && _form$getFieldValue !== void 0 ? _form$getFieldValue : record; // 新增事件可以设置初始默认值,当做函数的出参导出
|
|
91
93
|
_context.next = 7;
|
|
92
94
|
return action === null || action === void 0 ? void 0 : (_action$onHandle = action.onHandle) === null || _action$onHandle === void 0 ? void 0 : _action$onHandle.call(action, _record, index);
|
|
93
95
|
case 7:
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const getEnumLabel: (enumCode: string, value: any, compose?: boolean, code?: string, label?: string) => React.JSX.Element;
|
|
2
3
|
export default getEnumLabel;
|
package/lib/ProEnum/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import useEnum from './useEnum';
|
|
2
3
|
import { ProEnumProps } from './propsType';
|
|
3
4
|
declare const ProEnum: {
|
|
4
|
-
(props: ProEnumProps): JSX.Element;
|
|
5
|
-
getEnumLabel: (enumCode: string, value: any, compose?: boolean, code?: string, label?: string) => JSX.Element;
|
|
5
|
+
(props: ProEnumProps): React.JSX.Element;
|
|
6
|
+
getEnumLabel: (enumCode: string, value: any, compose?: boolean, code?: string, label?: string) => React.JSX.Element;
|
|
6
7
|
useEnum: typeof useEnum;
|
|
7
8
|
};
|
|
8
9
|
export default ProEnum;
|
|
@@ -47,7 +47,7 @@ var useEnum = function useEnum(props, dispatch) {
|
|
|
47
47
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
|
|
48
48
|
setCache: function () {
|
|
49
49
|
var _setCache = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(res) {
|
|
50
|
-
var response, _useRequest$options, ignoreCodes, _i, _Object$keys, key, options;
|
|
50
|
+
var response, _useRequest$options, ignoreCodes, _i, _Object$keys, key, options, cacheData;
|
|
51
51
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
52
52
|
while (1) switch (_context.prev = _context.next) {
|
|
53
53
|
case 0:
|
|
@@ -85,15 +85,10 @@ var useEnum = function useEnum(props, dispatch) {
|
|
|
85
85
|
}
|
|
86
86
|
res.data = response;
|
|
87
87
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
//
|
|
91
|
-
|
|
92
|
-
// data: {
|
|
93
|
-
// ...res.data,
|
|
94
|
-
// ...cacheData?.data,
|
|
95
|
-
// },
|
|
96
|
-
// });
|
|
88
|
+
cacheData = (0, _utils.getEnumData)(storage, cacheKey) || {
|
|
89
|
+
data: {}
|
|
90
|
+
}; // 合并缓存数据
|
|
91
|
+
res.data = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, cacheData === null || cacheData === void 0 ? void 0 : cacheData.data), res.data);
|
|
97
92
|
(0, _utils.setEnumData)(storage, cacheKey, res);
|
|
98
93
|
// 同步数据到全局
|
|
99
94
|
dispatch({
|
|
@@ -101,7 +96,7 @@ var useEnum = function useEnum(props, dispatch) {
|
|
|
101
96
|
payload: (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, dics), dataSource), res.data)
|
|
102
97
|
});
|
|
103
98
|
return _context.abrupt("return", res);
|
|
104
|
-
case
|
|
99
|
+
case 16:
|
|
105
100
|
case "end":
|
|
106
101
|
return _context.stop();
|
|
107
102
|
}
|
|
@@ -19,7 +19,7 @@ var _excluded = ["className", "format", "otherProps"];
|
|
|
19
19
|
var DatePicker = function DatePicker(props) {
|
|
20
20
|
var className = props.className,
|
|
21
21
|
_props$format = props.format,
|
|
22
|
-
format = _props$format === void 0 ? 'YYYY-MM-DD
|
|
22
|
+
format = _props$format === void 0 ? 'YYYY-MM-DD' : _props$format,
|
|
23
23
|
otherProps = props.otherProps,
|
|
24
24
|
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
25
25
|
var _ref = otherProps || {},
|
|
@@ -10,8 +10,8 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/obje
|
|
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
11
|
var _antd = require("antd");
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
var _icons =
|
|
14
|
-
var
|
|
13
|
+
var _icons = require("@ant-design/icons");
|
|
14
|
+
var _ProIcon = _interopRequireDefault(require("../../../../../ProIcon"));
|
|
15
15
|
var _excluded = ["label", "onClick", "onHandle", "actionType", "needConfirm", "title"],
|
|
16
16
|
_excluded2 = ["onClick", "label"];
|
|
17
17
|
var getDefaultActions = function getDefaultActions(mode) {
|
|
@@ -32,9 +32,8 @@ var getDefaultActions = function getDefaultActions(mode) {
|
|
|
32
32
|
},
|
|
33
33
|
type: 'text',
|
|
34
34
|
label: '删除',
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
component: _delete.ReactComponent
|
|
35
|
+
icon: /*#__PURE__*/_react.default.createElement(_ProIcon.default, {
|
|
36
|
+
type: "delete"
|
|
38
37
|
})
|
|
39
38
|
},
|
|
40
39
|
copy: {
|
|
@@ -26,12 +26,13 @@ var FormList = function FormList(props, ref) {
|
|
|
26
26
|
operation = props.operation,
|
|
27
27
|
_props$mode = props.mode,
|
|
28
28
|
mode = _props$mode === void 0 ? 'line' : _props$mode,
|
|
29
|
-
meta = props.meta
|
|
29
|
+
meta = props.meta,
|
|
30
|
+
_props$span = props.span,
|
|
31
|
+
span = _props$span === void 0 ? 8 : _props$span;
|
|
30
32
|
var form = otherProps.form,
|
|
31
33
|
name = otherProps.name,
|
|
32
34
|
isView = otherProps.isView,
|
|
33
|
-
disabled = otherProps.disabled
|
|
34
|
-
colProps = otherProps.colProps;
|
|
35
|
+
disabled = otherProps.disabled;
|
|
35
36
|
var errors = meta.errors;
|
|
36
37
|
var _namePath = (0, _utils.toArray)(name);
|
|
37
38
|
var processColumns = (0, _react.useCallback)(function (fieldName, namePath) {
|
|
@@ -68,7 +69,9 @@ var FormList = function FormList(props, ref) {
|
|
|
68
69
|
namePath: namePath,
|
|
69
70
|
index: index,
|
|
70
71
|
field: field,
|
|
71
|
-
colProps:
|
|
72
|
+
colProps: {
|
|
73
|
+
span: span
|
|
74
|
+
},
|
|
72
75
|
form: form
|
|
73
76
|
})) : /*#__PURE__*/_react.default.createElement(_LineFields.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
74
77
|
key: field.key
|
|
@@ -80,7 +83,9 @@ var FormList = function FormList(props, ref) {
|
|
|
80
83
|
namePath: namePath,
|
|
81
84
|
index: index,
|
|
82
85
|
field: field,
|
|
83
|
-
colProps:
|
|
86
|
+
colProps: {
|
|
87
|
+
span: span
|
|
88
|
+
},
|
|
84
89
|
form: form
|
|
85
90
|
}));
|
|
86
91
|
}), /*#__PURE__*/_react.default.createElement(_antd.Form.ErrorList, {
|