@zat-design/sisyphus-react 3.11.14-beta.5 → 3.11.14-beta.7
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 +22 -15
- package/dist/less.esm.css +22 -15
- package/es/ProAction/index.d.ts +2 -2
- package/es/ProAction/propsType.d.ts +16 -10
- package/es/ProConfigProvider/index.d.ts +6 -6
- package/es/ProDownload/index.d.ts +2 -2
- package/es/ProDownload/propsType.d.ts +2 -1
- package/es/ProEditLabel/components/RenderProForm.d.ts +2 -2
- package/es/ProEditLabel/index.d.ts +2 -2
- package/es/ProEditLabel/propsType.d.ts +133 -6
- package/es/ProEditLabel/style/index.less +24 -25
- package/es/ProEnum/components/Group.d.ts +2 -2
- package/es/ProEnum/components/Tag.d.ts +2 -2
- package/es/ProEnum/hooks/useEnumRequest.d.ts +2 -2
- package/es/ProEnum/index.d.ts +2 -2
- package/es/ProEnum/propsType.d.ts +228 -39
- package/es/ProEnum/propsType.js +0 -6
- package/es/ProEnum/utils/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProCascader/index.d.ts +1 -2
- package/es/ProForm/components/combination/ProCascader/propsType.d.ts +2 -1
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +3 -2
- package/es/ProLayout/components/Layout/Header/index.d.ts +2 -2
- package/es/ProLayout/components/Layout/Menu/index.d.ts +2 -2
- package/es/ProLayout/components/Layout/Notice/index.d.ts +2 -2
- package/es/ProLayout/components/ProCollapse/PropTypes.d.ts +4 -2
- package/es/ProLayout/components/ProCollapse/index.d.ts +2 -2
- package/es/ProLayout/components/ProFooter/PropTypes.d.ts +2 -1
- package/es/ProLayout/components/ProFooter/index.d.ts +2 -2
- package/es/ProLayout/components/ProHeader/PropTypes.d.ts +13 -9
- package/es/ProLayout/components/ProHeader/index.d.ts +2 -2
- package/es/ProLayout/index.d.ts +5 -5
- package/es/ProLayout/index.js +6 -2
- package/es/ProLayout/propTypes.d.ts +62 -21
- package/es/ProLayout/utils/index.d.ts +2 -2
- package/es/ProSelect/index.d.ts +3 -3
- package/es/ProSelect/propsType.d.ts +139 -29
- package/es/ProTable/style/index.less +3 -0
- package/es/ProTabs/index.d.ts +2 -2
- package/es/ProTabs/index.js +4 -4
- package/es/ProTabs/propType.d.ts +66 -9
- package/es/ProThemeTools/index.d.ts +2 -2
- package/es/ProThemeTools/propsType.d.ts +136 -14
- package/es/ProUpload/components/ButtonRender.d.ts +2 -2
- package/es/ProUpload/components/DraggableUploadListItem.d.ts +2 -2
- package/es/ProUpload/components/Example.d.ts +2 -2
- package/es/ProUpload/components/ImageRender.d.ts +2 -2
- package/es/ProUpload/index.d.ts +2 -2
- package/es/ProUpload/index.js +0 -7
- package/es/ProUpload/propsType.d.ts +59 -8
- package/es/ProWaterMark/index.d.ts +2 -2
- package/es/ProWaterMark/propsType.d.ts +2 -1
- package/lib/ProAction/index.d.ts +2 -2
- package/lib/ProAction/propsType.d.ts +16 -10
- package/lib/ProConfigProvider/index.d.ts +6 -6
- package/lib/ProDownload/index.d.ts +2 -2
- package/lib/ProDownload/propsType.d.ts +2 -1
- package/lib/ProEditLabel/components/RenderProForm.d.ts +2 -2
- package/lib/ProEditLabel/index.d.ts +2 -2
- package/lib/ProEditLabel/propsType.d.ts +133 -6
- package/lib/ProEditLabel/style/index.less +24 -25
- package/lib/ProEnum/components/Group.d.ts +2 -2
- package/lib/ProEnum/components/Tag.d.ts +2 -2
- package/lib/ProEnum/hooks/useEnumRequest.d.ts +2 -2
- package/lib/ProEnum/index.d.ts +2 -2
- package/lib/ProEnum/propsType.d.ts +228 -39
- package/lib/ProEnum/propsType.js +1 -7
- package/lib/ProEnum/utils/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProCascader/index.d.ts +1 -2
- package/lib/ProForm/components/combination/ProCascader/propsType.d.ts +2 -1
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +3 -2
- package/lib/ProLayout/components/Layout/Header/index.d.ts +2 -2
- package/lib/ProLayout/components/Layout/Menu/index.d.ts +2 -2
- package/lib/ProLayout/components/Layout/Notice/index.d.ts +2 -2
- package/lib/ProLayout/components/ProCollapse/PropTypes.d.ts +4 -2
- package/lib/ProLayout/components/ProCollapse/index.d.ts +2 -2
- package/lib/ProLayout/components/ProFooter/PropTypes.d.ts +2 -1
- package/lib/ProLayout/components/ProFooter/index.d.ts +2 -2
- package/lib/ProLayout/components/ProHeader/PropTypes.d.ts +13 -9
- package/lib/ProLayout/components/ProHeader/index.d.ts +2 -2
- package/lib/ProLayout/index.d.ts +5 -5
- package/lib/ProLayout/index.js +6 -2
- package/lib/ProLayout/propTypes.d.ts +62 -21
- package/lib/ProLayout/utils/index.d.ts +2 -2
- package/lib/ProSelect/index.d.ts +3 -3
- package/lib/ProSelect/propsType.d.ts +139 -29
- package/lib/ProTable/style/index.less +3 -0
- package/lib/ProTabs/index.d.ts +2 -2
- package/lib/ProTabs/index.js +4 -4
- package/lib/ProTabs/propType.d.ts +66 -9
- package/lib/ProThemeTools/index.d.ts +2 -2
- package/lib/ProThemeTools/propsType.d.ts +136 -14
- package/lib/ProUpload/components/ButtonRender.d.ts +2 -2
- package/lib/ProUpload/components/DraggableUploadListItem.d.ts +2 -2
- package/lib/ProUpload/components/Example.d.ts +2 -2
- package/lib/ProUpload/components/ImageRender.d.ts +2 -2
- package/lib/ProUpload/index.d.ts +2 -2
- package/lib/ProUpload/index.js +0 -7
- package/lib/ProUpload/propsType.d.ts +59 -8
- package/lib/ProWaterMark/index.d.ts +2 -2
- package/lib/ProWaterMark/propsType.d.ts +2 -1
- package/package.json +1 -1
@@ -3,93 +3,282 @@ import { RadioProps, CheckboxProps } from 'antd';
|
|
3
3
|
import { Service, Options } from 'ahooks/lib/useRequest/src/types';
|
4
4
|
import { ProFormOtherProps } from '../index';
|
5
5
|
import { PropSelectProps } from '../ProSelect/propsType';
|
6
|
-
|
6
|
+
/**
|
7
|
+
* @description 数据选项类型
|
8
|
+
*/
|
9
|
+
export interface DataOptionType {
|
10
|
+
/**
|
11
|
+
* @description 展示标签
|
12
|
+
* @default -
|
13
|
+
*/
|
7
14
|
label?: string;
|
15
|
+
/**
|
16
|
+
* @description 选项值
|
17
|
+
* @default -
|
18
|
+
*/
|
8
19
|
value?: string;
|
20
|
+
/**
|
21
|
+
* @description 是否禁用
|
22
|
+
* @default false
|
23
|
+
*/
|
9
24
|
disabled?: boolean;
|
25
|
+
/**
|
26
|
+
* @description 允许扩展字段
|
27
|
+
*/
|
10
28
|
[key: string]: any;
|
11
29
|
}
|
12
|
-
|
13
|
-
|
30
|
+
/**
|
31
|
+
* @description ProEnum配置类型
|
32
|
+
*/
|
33
|
+
export interface ProEnumConfigType {
|
34
|
+
/**
|
35
|
+
* @description 是否枚举主入口
|
36
|
+
* @default false
|
37
|
+
*/
|
14
38
|
main?: boolean;
|
15
|
-
/**
|
39
|
+
/**
|
40
|
+
* @description 是否使用主入口枚举
|
41
|
+
* @default false
|
42
|
+
*/
|
16
43
|
share?: boolean;
|
17
|
-
/**
|
44
|
+
/**
|
45
|
+
* @description 是否开启调试 log
|
46
|
+
* @default false
|
47
|
+
*/
|
18
48
|
debugger?: boolean;
|
19
|
-
/**
|
49
|
+
/**
|
50
|
+
* @description 是否对数据进行清洗
|
51
|
+
* @default false
|
52
|
+
*/
|
20
53
|
clear?: boolean;
|
21
|
-
/**
|
54
|
+
/**
|
55
|
+
* @description 字段别名
|
56
|
+
* @default { label: 'label', value: 'value', children: 'children' }
|
57
|
+
*/
|
22
58
|
fieldNames?: Record<'label' | 'value' | 'children', string>;
|
23
|
-
/**
|
59
|
+
/**
|
60
|
+
* @description 缓存的key、默认 zat-design-pro-component-cacheKey
|
61
|
+
* @default "zat-design-pro-component-cacheKey"
|
62
|
+
*/
|
24
63
|
cacheKey: string;
|
25
|
-
/**
|
64
|
+
/**
|
65
|
+
* @description 刷新请求、设置后每次进入都会重新请求
|
66
|
+
* @default false
|
67
|
+
*/
|
26
68
|
requestRefresh: boolean;
|
27
|
-
/**
|
69
|
+
/**
|
70
|
+
* @description 存储位置、不设置、默认读取 globalConfig 里面的
|
71
|
+
* @default "localStorage"
|
72
|
+
*/
|
28
73
|
storage: 'localStorage' | 'sessionStorage';
|
29
|
-
/**
|
30
|
-
|
31
|
-
|
74
|
+
/**
|
75
|
+
* @description 默认静态枚举数据
|
76
|
+
* @default {}
|
77
|
+
*/
|
78
|
+
dataSource: Record<string, DataOptionType[]>;
|
79
|
+
/**
|
80
|
+
* @description 对后台返回数据进行格式化
|
81
|
+
* @param data 后台返回的数据
|
82
|
+
* @returns 格式化后的枚举数据
|
83
|
+
* @default -
|
84
|
+
*/
|
32
85
|
transformResponse?: (data: {
|
33
|
-
data: Record<string,
|
34
|
-
}) => Record<string,
|
35
|
-
/**
|
86
|
+
data: Record<string, DataOptionType[]>;
|
87
|
+
}) => Record<string, DataOptionType[]> | Promise<Record<string, DataOptionType[]>>;
|
88
|
+
/**
|
89
|
+
* @description 批量请求枚举接口
|
90
|
+
* @default -
|
91
|
+
*/
|
36
92
|
useRequest?: {
|
93
|
+
/**
|
94
|
+
* @description 请求服务函数
|
95
|
+
*/
|
37
96
|
service: Service<any, any>;
|
97
|
+
/**
|
98
|
+
* @description 请求选项配置
|
99
|
+
*/
|
38
100
|
options?: Options<any, any> & {
|
101
|
+
/**
|
102
|
+
* @description 指定请求的枚举码
|
103
|
+
*/
|
39
104
|
codes?: string[];
|
105
|
+
/**
|
106
|
+
* @description 忽略的枚举码
|
107
|
+
*/
|
40
108
|
ignoreCodes?: string[];
|
41
109
|
};
|
42
110
|
};
|
43
|
-
|
111
|
+
/**
|
112
|
+
* @description 字典数据
|
113
|
+
* @default {}
|
114
|
+
*/
|
115
|
+
dics: Record<string, DataOptionType[]>;
|
44
116
|
}
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
117
|
+
/**
|
118
|
+
* @description 枚举组件类型枚举
|
119
|
+
*/
|
120
|
+
type EnumComponentType = 'ProSelect' | 'Radio' | 'Checkbox' | 'Tag' | 'Group';
|
121
|
+
/**
|
122
|
+
* @description ProEnum基础属性类型
|
123
|
+
*/
|
124
|
+
export interface ProEnumBaseType {
|
125
|
+
/**
|
126
|
+
* @description 组件展示类型、默认 ProSelect
|
127
|
+
* @default "ProSelect"
|
128
|
+
*/
|
129
|
+
type?: EnumComponentType;
|
130
|
+
/**
|
131
|
+
* @description 用于自定义组件
|
132
|
+
* @default -
|
133
|
+
*/
|
50
134
|
component?: ReactNode;
|
51
|
-
/**
|
135
|
+
/**
|
136
|
+
* @description 用于提交 code
|
137
|
+
* @default -
|
138
|
+
*/
|
52
139
|
code?: string | string[];
|
53
|
-
/**
|
140
|
+
/**
|
141
|
+
* @description 字段别名
|
142
|
+
* @default -
|
143
|
+
*/
|
54
144
|
fieldNames?: Record<string, string>;
|
55
|
-
/**
|
145
|
+
/**
|
146
|
+
* @description 是否查看模式
|
147
|
+
* @default false
|
148
|
+
*/
|
56
149
|
isView?: boolean;
|
57
|
-
/**
|
58
|
-
|
150
|
+
/**
|
151
|
+
* @description 数据源
|
152
|
+
* @default -
|
153
|
+
*/
|
154
|
+
dataSource?: DataOptionType[];
|
155
|
+
/**
|
156
|
+
* @description 当前值
|
157
|
+
* @default -
|
158
|
+
*/
|
59
159
|
value: any;
|
160
|
+
/**
|
161
|
+
* @description 值变化回调
|
162
|
+
* @default -
|
163
|
+
*/
|
60
164
|
onChange?: (value: any) => void;
|
61
|
-
/**
|
165
|
+
/**
|
166
|
+
* @description 远程请求接口
|
167
|
+
* @default -
|
168
|
+
*/
|
62
169
|
useRequest?: {
|
170
|
+
/**
|
171
|
+
* @description 请求服务函数
|
172
|
+
*/
|
63
173
|
service: Service<any, any>;
|
174
|
+
/**
|
175
|
+
* @description 请求选项
|
176
|
+
*/
|
64
177
|
options?: Options<any, any>;
|
65
178
|
};
|
66
|
-
/**
|
67
|
-
|
68
|
-
|
179
|
+
/**
|
180
|
+
* @description 对后台返回数据进行格式化
|
181
|
+
* @param data 后台返回的数据
|
182
|
+
* @returns 格式化后的选项数据
|
183
|
+
* @default -
|
184
|
+
*/
|
185
|
+
transformResponse?: (data: any) => DataOptionType[];
|
186
|
+
/**
|
187
|
+
* @description 是否合并数据
|
188
|
+
* @default false
|
189
|
+
*/
|
69
190
|
merge?: boolean;
|
70
|
-
/**
|
191
|
+
/**
|
192
|
+
* @description 查看模式下为空展示
|
193
|
+
* @default "-"
|
194
|
+
*/
|
71
195
|
viewEmpty?: React.ReactNode;
|
196
|
+
/**
|
197
|
+
* @description 自定义选项渲染
|
198
|
+
* @default -
|
199
|
+
*/
|
72
200
|
optionRender?: any;
|
73
|
-
/**
|
201
|
+
/**
|
202
|
+
* @description 显示 code-value 形式
|
203
|
+
* @default false
|
204
|
+
*/
|
74
205
|
showCodeName?: boolean;
|
75
|
-
/**
|
206
|
+
/**
|
207
|
+
* @description 支持 {label:xx, value: xx} 形式
|
208
|
+
* @default false
|
209
|
+
*/
|
76
210
|
labelInValue?: boolean;
|
211
|
+
/**
|
212
|
+
* @description 其他表单属性
|
213
|
+
* @default -
|
214
|
+
*/
|
77
215
|
otherProps?: ProFormOtherProps;
|
216
|
+
/**
|
217
|
+
* @description 是否允许清除
|
218
|
+
* @default false
|
219
|
+
*/
|
78
220
|
allowClear?: boolean;
|
221
|
+
/**
|
222
|
+
* @description 组件ID
|
223
|
+
* @default -
|
224
|
+
*/
|
79
225
|
id?: string;
|
226
|
+
/**
|
227
|
+
* @description 默认值
|
228
|
+
* @default -
|
229
|
+
*/
|
80
230
|
defaultValue?: any;
|
81
231
|
}
|
82
|
-
|
232
|
+
/**
|
233
|
+
* @description ProSelect类型映射
|
234
|
+
*/
|
235
|
+
export type PropProSelectsMapType = {
|
236
|
+
/**
|
237
|
+
* @description 类型为ProSelect
|
238
|
+
* @default "ProSelect"
|
239
|
+
*/
|
83
240
|
type?: 'ProSelect';
|
84
241
|
} & PropSelectProps;
|
85
|
-
|
242
|
+
/**
|
243
|
+
* @description Radio类型映射
|
244
|
+
*/
|
245
|
+
export type PropRadioPropsMapType = {
|
246
|
+
/**
|
247
|
+
* @description 类型为Radio
|
248
|
+
* @default "Radio"
|
249
|
+
*/
|
86
250
|
type?: 'Radio';
|
87
251
|
} & RadioProps;
|
88
|
-
|
252
|
+
/**
|
253
|
+
* @description Checkbox类型映射
|
254
|
+
*/
|
255
|
+
export type CheckboxPropsMapType = {
|
256
|
+
/**
|
257
|
+
* @description 类型为Checkbox
|
258
|
+
* @default "Checkbox"
|
259
|
+
*/
|
89
260
|
type?: 'Checkbox';
|
90
261
|
} & CheckboxProps;
|
91
|
-
|
262
|
+
/**
|
263
|
+
* @description Tag类型映射
|
264
|
+
*/
|
265
|
+
export interface TagPropsMapType {
|
266
|
+
/**
|
267
|
+
* @description 类型为Tag或Group
|
268
|
+
* @default -
|
269
|
+
*/
|
92
270
|
type?: 'Tag' | 'Group';
|
93
271
|
}
|
94
|
-
|
272
|
+
/**
|
273
|
+
* @description ProEnum组件属性类型
|
274
|
+
*/
|
275
|
+
export type ProEnumType = Omit<ProEnumBaseType, 'type'> & (PropProSelectsMapType | PropRadioPropsMapType | CheckboxPropsMapType | TagPropsMapType);
|
276
|
+
export type DataOption = DataOptionType;
|
277
|
+
export type ProEnumConfig = ProEnumConfigType;
|
278
|
+
export type ProEnum = ProEnumBaseType;
|
279
|
+
export type PropProSelectsMap = PropProSelectsMapType;
|
280
|
+
export type PropRadioPropsMap = PropRadioPropsMapType;
|
281
|
+
export type CheckboxPropsMap = CheckboxPropsMapType;
|
282
|
+
export type TagPropsMap = TagPropsMapType;
|
283
|
+
export type ProEnumProps = ProEnumBaseType;
|
95
284
|
export {};
|
package/es/ProEnum/propsType.js
CHANGED
@@ -6,7 +6,7 @@ interface EnumRes {
|
|
6
6
|
}
|
7
7
|
export declare function getEnumData(storage: StorageType, cacheKey: string, baseEnumStorage?: any): EnumRes;
|
8
8
|
export declare function setEnumData(storage: StorageType, cacheKey: string, data: any): boolean;
|
9
|
-
export declare function hasEnumList(storage: StorageType, cacheKey: any, code: string):
|
9
|
+
export declare function hasEnumList(storage: StorageType, cacheKey: any, code: string): import("../propsType").DataOptionType[];
|
10
10
|
export declare function isObject(obj: any): boolean;
|
11
11
|
export declare function mergeCacheData(storage: string, code: string, cacheKey: string, responseData: any): void;
|
12
12
|
/**
|
@@ -1,4 +1,3 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
|
3
|
-
declare const _default: import("react").MemoExoticComponent<(props: ProCascaderProps) => import("react/jsx-runtime").JSX.Element>;
|
2
|
+
declare const _default: import("react").MemoExoticComponent<(props: import("./propsType").ProCascaderType) => import("react/jsx-runtime").JSX.Element>;
|
4
3
|
export default _default;
|
@@ -7,7 +7,7 @@ export interface fieldNamesProps {
|
|
7
7
|
children?: string;
|
8
8
|
[key: string]: string;
|
9
9
|
}
|
10
|
-
export interface
|
10
|
+
export interface ProCascaderType {
|
11
11
|
className?: string;
|
12
12
|
mode?: 'address' | 'default';
|
13
13
|
isView?: boolean;
|
@@ -38,3 +38,4 @@ export interface ProCascaderProps {
|
|
38
38
|
scrollFollowParent?: boolean;
|
39
39
|
desensitization?: [number, number];
|
40
40
|
}
|
41
|
+
export type ProCascaderProps = ProCascaderType;
|
@@ -24,7 +24,7 @@ interface ConfigOption {
|
|
24
24
|
};
|
25
25
|
tableProps?: Record<string, any>;
|
26
26
|
}
|
27
|
-
interface
|
27
|
+
export interface ProModalSelectType {
|
28
28
|
configOption: ConfigOption;
|
29
29
|
onChange?: (value: number | string | undefined, option?: any) => void;
|
30
30
|
title: ModalProps['title'];
|
@@ -45,5 +45,6 @@ interface ProModalPropsType {
|
|
45
45
|
searchForm?: FormInstance;
|
46
46
|
searchKey?: string;
|
47
47
|
}
|
48
|
-
export declare type ProModalSelectPropsType = SelectProps & InputProps &
|
48
|
+
export declare type ProModalSelectPropsType = SelectProps & InputProps & ProModalSelectType;
|
49
|
+
export type ProModalSelectProps = ProModalSelectType;
|
49
50
|
export {};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
2
2
|
import { CollapseProps, CollapsePanelProps } from 'antd/es/collapse';
|
3
3
|
export type levelType = '1' | '2';
|
4
|
-
export interface
|
4
|
+
export interface TitleListType {
|
5
5
|
/**
|
6
6
|
* @description 描述的标题
|
7
7
|
* @default -
|
@@ -13,7 +13,7 @@ export interface TitleListProps {
|
|
13
13
|
*/
|
14
14
|
value: string | number | undefined | React.ReactNode;
|
15
15
|
}
|
16
|
-
export interface
|
16
|
+
export interface ProCollapseType {
|
17
17
|
/**
|
18
18
|
* @description 折叠头部标题
|
19
19
|
* @default -
|
@@ -91,3 +91,5 @@ export interface ProCollapseProps {
|
|
91
91
|
collapsePanelProps?: CollapsePanelProps;
|
92
92
|
[key: string]: any;
|
93
93
|
}
|
94
|
+
export type ProCollapseProps = ProCollapseType;
|
95
|
+
export type TitleListProps = TitleListType;
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import {
|
2
|
-
declare const ProCollapse: (props:
|
1
|
+
import type { ProCollapseType } from './PropTypes';
|
2
|
+
declare const ProCollapse: (props: ProCollapseType) => import("react/jsx-runtime").JSX.Element;
|
3
3
|
export default ProCollapse;
|
@@ -2,7 +2,7 @@ export interface stateProps {
|
|
2
2
|
width?: number;
|
3
3
|
[key: string]: any;
|
4
4
|
}
|
5
|
-
export interface
|
5
|
+
export interface ProFooterType {
|
6
6
|
/**
|
7
7
|
* @description 是否显示
|
8
8
|
* @default true
|
@@ -25,3 +25,4 @@ export interface ProFooterProps {
|
|
25
25
|
contentDom?: string;
|
26
26
|
[key: string]: any;
|
27
27
|
}
|
28
|
+
export type ProFooterProps = ProFooterType;
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import {
|
3
|
-
declare const _default: import("react").MemoExoticComponent<(props:
|
2
|
+
import type { ProFooterType } from './PropTypes';
|
3
|
+
declare const _default: import("react").MemoExoticComponent<(props: ProFooterType) => import("react/jsx-runtime").JSX.Element>;
|
4
4
|
export default _default;
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
2
2
|
import type { ModalProps } from 'antd';
|
3
3
|
export type BreadcrumbType = 'breadcrumb' | 'copy' | 'info' | 'version' | 'tag';
|
4
4
|
export type NavType = 'money' | 'thousandth' | 'enumName' | 'enumCodeName' | 'date' | 'dateTime';
|
5
|
-
export interface
|
5
|
+
export interface BreadcrumbColumnType {
|
6
6
|
/**
|
7
7
|
* @description 类型
|
8
8
|
* @default -
|
@@ -34,7 +34,7 @@ export interface BreadcrumbColumnsProps {
|
|
34
34
|
*/
|
35
35
|
tag?: string | React.ReactNode | (string | React.ReactNode)[];
|
36
36
|
}
|
37
|
-
export interface
|
37
|
+
export interface SubDescribeColumnType {
|
38
38
|
/**
|
39
39
|
* @description 描述内容
|
40
40
|
* @default -
|
@@ -71,7 +71,7 @@ export interface SubDescribeColumnsProps {
|
|
71
71
|
*/
|
72
72
|
code?: string;
|
73
73
|
}
|
74
|
-
export interface
|
74
|
+
export interface DescribeColumnType {
|
75
75
|
/**
|
76
76
|
* @description 描述内容
|
77
77
|
* @default -
|
@@ -118,7 +118,7 @@ export interface DescribeColumnsProps {
|
|
118
118
|
*/
|
119
119
|
tag?: string | React.ReactNode | (string | React.ReactNode)[];
|
120
120
|
}
|
121
|
-
export interface
|
121
|
+
export interface ProHeaderType {
|
122
122
|
/**
|
123
123
|
* @description 标题
|
124
124
|
* @default -
|
@@ -129,12 +129,12 @@ export interface ProHeaderProps {
|
|
129
129
|
* @deprecated 将于下个版本 4.0.0 被弃用
|
130
130
|
* @default -
|
131
131
|
*/
|
132
|
-
breadcrumbList?:
|
132
|
+
breadcrumbList?: BreadcrumbColumnType[];
|
133
133
|
/**
|
134
134
|
* @description 面包屑配置数据
|
135
135
|
* @default -
|
136
136
|
*/
|
137
|
-
breadcrumbColumns?:
|
137
|
+
breadcrumbColumns?: BreadcrumbColumnType[];
|
138
138
|
/**
|
139
139
|
* @description 是否隐藏溢出
|
140
140
|
* @default -
|
@@ -150,17 +150,17 @@ export interface ProHeaderProps {
|
|
150
150
|
* @deprecated 将于下个版本 4.0.0 被弃用
|
151
151
|
* @default -
|
152
152
|
*/
|
153
|
-
describeList?:
|
153
|
+
describeList?: SubDescribeColumnType[];
|
154
154
|
/**
|
155
155
|
* @description 主要描述数据源配置
|
156
156
|
* @default -
|
157
157
|
*/
|
158
|
-
describeColumns?:
|
158
|
+
describeColumns?: DescribeColumnType[];
|
159
159
|
/**
|
160
160
|
* @description 次级描述数据源配置
|
161
161
|
* @default -
|
162
162
|
*/
|
163
|
-
subDescribeColumns?:
|
163
|
+
subDescribeColumns?: SubDescribeColumnType[];
|
164
164
|
/**
|
165
165
|
* @description 次级描述是否展开
|
166
166
|
* @default -
|
@@ -204,3 +204,7 @@ export interface ProHeaderProps {
|
|
204
204
|
onBack?: () => void;
|
205
205
|
[key: string]: any;
|
206
206
|
}
|
207
|
+
export type ProHeaderProps = ProHeaderType;
|
208
|
+
export type BreadcrumbColumnsProps = BreadcrumbColumnType;
|
209
|
+
export type SubDescribeColumnsProps = SubDescribeColumnType;
|
210
|
+
export type DescribeColumnsProps = DescribeColumnType;
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import type {
|
3
|
-
declare const _default: React.MemoExoticComponent<(props:
|
2
|
+
import type { ProHeaderType } from './PropTypes';
|
3
|
+
declare const _default: React.MemoExoticComponent<(props: ProHeaderType) => import("react/jsx-runtime").JSX.Element>;
|
4
4
|
export default _default;
|
package/es/ProLayout/index.d.ts
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import type {
|
2
|
+
import type { ProLayoutType } from './propTypes';
|
3
3
|
export declare const LayoutContext: import("react").Context<{
|
4
4
|
selectedPath: string;
|
5
5
|
onSelected: (params: any) => void;
|
6
6
|
target: '_blank' | '_parent' | '_self' | '_top';
|
7
7
|
}>;
|
8
8
|
declare const ProLayout: {
|
9
|
-
(props:
|
9
|
+
(props: ProLayoutType): import("react/jsx-runtime").JSX.Element;
|
10
10
|
defaultProps: {
|
11
11
|
menus: any[];
|
12
12
|
iconfontUrl: string;
|
@@ -18,8 +18,8 @@ declare const ProLayout: {
|
|
18
18
|
headerHeight: number;
|
19
19
|
contentStyle: {};
|
20
20
|
};
|
21
|
-
ProCollapse: (props: import("./components/ProCollapse/PropTypes").
|
22
|
-
ProFooter: import("react").MemoExoticComponent<(props: import("./components/ProFooter/PropTypes").
|
23
|
-
ProHeader: import("react").MemoExoticComponent<(props: import("./components/ProHeader/PropTypes").
|
21
|
+
ProCollapse: (props: import("./components/ProCollapse/PropTypes").ProCollapseType) => import("react/jsx-runtime").JSX.Element;
|
22
|
+
ProFooter: import("react").MemoExoticComponent<(props: import("./components/ProFooter/PropTypes").ProFooterType) => import("react/jsx-runtime").JSX.Element>;
|
23
|
+
ProHeader: import("react").MemoExoticComponent<(props: import("./components/ProHeader/PropTypes").ProHeaderType) => import("react/jsx-runtime").JSX.Element>;
|
24
24
|
};
|
25
25
|
export default ProLayout;
|
package/es/ProLayout/index.js
CHANGED
@@ -56,8 +56,10 @@ var ProLayout = function ProLayout(props) {
|
|
56
56
|
return _message.warning('Warning: Missing menu data source, or menu data source is not an array');
|
57
57
|
}
|
58
58
|
var userData = transformMenus(dataSource, pathPrefix);
|
59
|
+
// 确保 menus 始终是一个数组
|
60
|
+
var menuData = Array.isArray(userData) ? userData : (userData === null || userData === void 0 ? void 0 : userData.menus) || [];
|
59
61
|
setState({
|
60
|
-
menus:
|
62
|
+
menus: menuData
|
61
63
|
});
|
62
64
|
}, [dataSource]);
|
63
65
|
/**
|
@@ -88,7 +90,9 @@ var ProLayout = function ProLayout(props) {
|
|
88
90
|
})), _jsxs("div", {
|
89
91
|
className: contentCls,
|
90
92
|
children: [_jsx(Menu, _objectSpread(_objectSpread({}, props), {}, {
|
91
|
-
dataSource: menus
|
93
|
+
dataSource: Array.isArray(menus) ? {
|
94
|
+
menus: menus
|
95
|
+
} : menus,
|
92
96
|
notice: notice,
|
93
97
|
collapsed: collapsed,
|
94
98
|
onToggle: function onToggle() {
|