@zat-design/sisyphus-react 3.11.14-beta.5 → 3.11.14-beta.6

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.
Files changed (103) hide show
  1. package/dist/index.esm.css +22 -15
  2. package/dist/less.esm.css +22 -15
  3. package/es/ProAction/index.d.ts +2 -2
  4. package/es/ProAction/propsType.d.ts +16 -10
  5. package/es/ProConfigProvider/index.d.ts +6 -6
  6. package/es/ProDownload/index.d.ts +2 -2
  7. package/es/ProDownload/propsType.d.ts +2 -1
  8. package/es/ProEditLabel/components/RenderProForm.d.ts +2 -2
  9. package/es/ProEditLabel/index.d.ts +2 -2
  10. package/es/ProEditLabel/propsType.d.ts +133 -6
  11. package/es/ProEditLabel/style/index.less +24 -25
  12. package/es/ProEnum/components/Group.d.ts +2 -2
  13. package/es/ProEnum/components/Tag.d.ts +2 -2
  14. package/es/ProEnum/hooks/useEnumRequest.d.ts +2 -2
  15. package/es/ProEnum/index.d.ts +2 -2
  16. package/es/ProEnum/propsType.d.ts +228 -39
  17. package/es/ProEnum/propsType.js +0 -6
  18. package/es/ProEnum/utils/index.d.ts +1 -1
  19. package/es/ProForm/components/combination/ProCascader/index.d.ts +1 -2
  20. package/es/ProForm/components/combination/ProCascader/propsType.d.ts +2 -1
  21. package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +3 -2
  22. package/es/ProIcon/symbolIcon.js +80 -39
  23. package/es/ProLayout/components/Layout/Header/index.d.ts +2 -2
  24. package/es/ProLayout/components/Layout/Menu/index.d.ts +2 -2
  25. package/es/ProLayout/components/Layout/Notice/index.d.ts +2 -2
  26. package/es/ProLayout/components/ProCollapse/PropTypes.d.ts +4 -2
  27. package/es/ProLayout/components/ProCollapse/index.d.ts +2 -2
  28. package/es/ProLayout/components/ProFooter/PropTypes.d.ts +2 -1
  29. package/es/ProLayout/components/ProFooter/index.d.ts +2 -2
  30. package/es/ProLayout/components/ProHeader/PropTypes.d.ts +13 -9
  31. package/es/ProLayout/components/ProHeader/index.d.ts +2 -2
  32. package/es/ProLayout/index.d.ts +5 -5
  33. package/es/ProLayout/index.js +6 -2
  34. package/es/ProLayout/propTypes.d.ts +62 -21
  35. package/es/ProLayout/utils/index.d.ts +2 -2
  36. package/es/ProSelect/index.d.ts +3 -3
  37. package/es/ProSelect/propsType.d.ts +139 -29
  38. package/es/ProTable/style/index.less +3 -0
  39. package/es/ProTabs/index.d.ts +2 -2
  40. package/es/ProTabs/index.js +4 -4
  41. package/es/ProTabs/propType.d.ts +66 -9
  42. package/es/ProThemeTools/index.d.ts +2 -2
  43. package/es/ProThemeTools/propsType.d.ts +136 -14
  44. package/es/ProUpload/components/ButtonRender.d.ts +2 -2
  45. package/es/ProUpload/components/DraggableUploadListItem.d.ts +2 -2
  46. package/es/ProUpload/components/Example.d.ts +2 -2
  47. package/es/ProUpload/components/ImageRender.d.ts +2 -2
  48. package/es/ProUpload/index.d.ts +2 -2
  49. package/es/ProUpload/index.js +0 -7
  50. package/es/ProUpload/propsType.d.ts +59 -8
  51. package/es/ProWaterMark/index.d.ts +2 -2
  52. package/es/ProWaterMark/propsType.d.ts +2 -1
  53. package/lib/ProAction/index.d.ts +2 -2
  54. package/lib/ProAction/propsType.d.ts +16 -10
  55. package/lib/ProConfigProvider/index.d.ts +6 -6
  56. package/lib/ProDownload/index.d.ts +2 -2
  57. package/lib/ProDownload/propsType.d.ts +2 -1
  58. package/lib/ProEditLabel/components/RenderProForm.d.ts +2 -2
  59. package/lib/ProEditLabel/index.d.ts +2 -2
  60. package/lib/ProEditLabel/propsType.d.ts +133 -6
  61. package/lib/ProEditLabel/style/index.less +24 -25
  62. package/lib/ProEnum/components/Group.d.ts +2 -2
  63. package/lib/ProEnum/components/Tag.d.ts +2 -2
  64. package/lib/ProEnum/hooks/useEnumRequest.d.ts +2 -2
  65. package/lib/ProEnum/index.d.ts +2 -2
  66. package/lib/ProEnum/propsType.d.ts +228 -39
  67. package/lib/ProEnum/propsType.js +1 -7
  68. package/lib/ProEnum/utils/index.d.ts +1 -1
  69. package/lib/ProForm/components/combination/ProCascader/index.d.ts +1 -2
  70. package/lib/ProForm/components/combination/ProCascader/propsType.d.ts +2 -1
  71. package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +3 -2
  72. package/lib/ProIcon/symbolIcon.js +85 -39
  73. package/lib/ProLayout/components/Layout/Header/index.d.ts +2 -2
  74. package/lib/ProLayout/components/Layout/Menu/index.d.ts +2 -2
  75. package/lib/ProLayout/components/Layout/Notice/index.d.ts +2 -2
  76. package/lib/ProLayout/components/ProCollapse/PropTypes.d.ts +4 -2
  77. package/lib/ProLayout/components/ProCollapse/index.d.ts +2 -2
  78. package/lib/ProLayout/components/ProFooter/PropTypes.d.ts +2 -1
  79. package/lib/ProLayout/components/ProFooter/index.d.ts +2 -2
  80. package/lib/ProLayout/components/ProHeader/PropTypes.d.ts +13 -9
  81. package/lib/ProLayout/components/ProHeader/index.d.ts +2 -2
  82. package/lib/ProLayout/index.d.ts +5 -5
  83. package/lib/ProLayout/index.js +6 -2
  84. package/lib/ProLayout/propTypes.d.ts +62 -21
  85. package/lib/ProLayout/utils/index.d.ts +2 -2
  86. package/lib/ProSelect/index.d.ts +3 -3
  87. package/lib/ProSelect/propsType.d.ts +139 -29
  88. package/lib/ProTable/style/index.less +3 -0
  89. package/lib/ProTabs/index.d.ts +2 -2
  90. package/lib/ProTabs/index.js +4 -4
  91. package/lib/ProTabs/propType.d.ts +66 -9
  92. package/lib/ProThemeTools/index.d.ts +2 -2
  93. package/lib/ProThemeTools/propsType.d.ts +136 -14
  94. package/lib/ProUpload/components/ButtonRender.d.ts +2 -2
  95. package/lib/ProUpload/components/DraggableUploadListItem.d.ts +2 -2
  96. package/lib/ProUpload/components/Example.d.ts +2 -2
  97. package/lib/ProUpload/components/ImageRender.d.ts +2 -2
  98. package/lib/ProUpload/index.d.ts +2 -2
  99. package/lib/ProUpload/index.js +0 -7
  100. package/lib/ProUpload/propsType.d.ts +59 -8
  101. package/lib/ProWaterMark/index.d.ts +2 -2
  102. package/lib/ProWaterMark/propsType.d.ts +2 -1
  103. package/package.json +1 -1
@@ -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 BreadcrumbColumnsProps {
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 SubDescribeColumnsProps {
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 DescribeColumnsProps {
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 ProHeaderProps {
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?: BreadcrumbColumnsProps[];
132
+ breadcrumbList?: BreadcrumbColumnType[];
133
133
  /**
134
134
  * @description 面包屑配置数据
135
135
  * @default -
136
136
  */
137
- breadcrumbColumns?: BreadcrumbColumnsProps[];
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?: SubDescribeColumnsProps[];
153
+ describeList?: SubDescribeColumnType[];
154
154
  /**
155
155
  * @description 主要描述数据源配置
156
156
  * @default -
157
157
  */
158
- describeColumns?: DescribeColumnsProps[];
158
+ describeColumns?: DescribeColumnType[];
159
159
  /**
160
160
  * @description 次级描述数据源配置
161
161
  * @default -
162
162
  */
163
- subDescribeColumns?: SubDescribeColumnsProps[];
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 { ProHeaderProps } from './PropTypes';
3
- declare const _default: React.MemoExoticComponent<(props: ProHeaderProps) => import("react/jsx-runtime").JSX.Element>;
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;
@@ -1,12 +1,12 @@
1
1
  /// <reference types="react" />
2
- import type { ProLayoutProps } from './propTypes';
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: ProLayoutProps): import("react/jsx-runtime").JSX.Element;
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").ProCollapseProps) => import("react/jsx-runtime").JSX.Element;
22
- ProFooter: import("react").MemoExoticComponent<(props: import("./components/ProFooter/PropTypes").ProFooterProps) => import("react/jsx-runtime").JSX.Element>;
23
- ProHeader: import("react").MemoExoticComponent<(props: import("./components/ProHeader/PropTypes").ProHeaderProps) => import("react/jsx-runtime").JSX.Element>;
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;
@@ -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: userData
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() {
@@ -1,6 +1,10 @@
1
1
  import { CSSProperties, ReactNode } from 'react';
2
2
  import { ProWaterMarkProps } from '../ProWaterMark/propsType';
3
- export interface MenusProps {
3
+ export interface MenusType {
4
+ /**
5
+ * @description 菜单ID
6
+ * @default -
7
+ */
4
8
  id?: number;
5
9
  /**
6
10
  * @description 菜单唯一code
@@ -44,7 +48,7 @@ export interface MenusProps {
44
48
  sort?: number | undefined | null;
45
49
  /**
46
50
  * @description 是否隐藏菜单
47
- * @default -
51
+ * @default false
48
52
  */
49
53
  hideInMenu?: boolean;
50
54
  /**
@@ -62,9 +66,12 @@ export interface MenusProps {
62
66
  * @default -
63
67
  */
64
68
  type?: string;
69
+ /**
70
+ * @description 允许扩展字段
71
+ */
65
72
  [key: string]: any;
66
73
  }
67
- export interface DataSourceProps {
74
+ export interface DataSourceType {
68
75
  /**
69
76
  * @description 用户信息
70
77
  * @default -
@@ -72,15 +79,22 @@ export interface DataSourceProps {
72
79
  userInfo?: any;
73
80
  /**
74
81
  * @description 处理后一级菜单详情
75
- * @default -
82
+ * @default []
76
83
  */
77
- menus?: MenusProps[];
84
+ menus?: MenusType[];
78
85
  }
86
+ /**
87
+ * @description 主题枚举类型
88
+ */
89
+ type themeEnum = 'light' | 'dark';
90
+ /**
91
+ * @description 是否带有菜单界面的配置
92
+ */
79
93
  type pureKey = boolean | {
80
94
  topMenu?: boolean;
81
95
  leftMenu?: boolean;
82
96
  };
83
- export interface ProLayoutProps {
97
+ export interface ProLayoutType {
84
98
  /**
85
99
  * @description 左侧logo
86
100
  * @default -
@@ -88,7 +102,7 @@ export interface ProLayoutProps {
88
102
  logo?: ReactNode | string;
89
103
  /**
90
104
  * @description 类名
91
- * @default -
105
+ * @default ""
92
106
  */
93
107
  className?: string;
94
108
  /**
@@ -130,56 +144,66 @@ export interface ProLayoutProps {
130
144
  * @description 数据源
131
145
  * @default -
132
146
  */
133
- dataSource?: DataSourceProps | Partial<MenusProps>;
147
+ dataSource?: DataSourceType | Partial<MenusType>;
134
148
  /**
135
149
  * @description 是否折叠
136
- * @default -
150
+ * @default false
137
151
  */
138
152
  collapsed?: boolean;
139
153
  /**
140
154
  * @description 菜单拼接路径前缀
141
- * @default -
155
+ * @default ""
142
156
  */
143
157
  pathPrefix?: string;
144
158
  /**
145
159
  * @description 是否带有菜单界面,true不带,只显示content内容
146
- * @default -
160
+ * @default false
147
161
  */
148
162
  pure?: pureKey;
149
163
  /**
150
164
  * @description 头部区域高度
151
- * @default -
165
+ * @default 48
152
166
  */
153
167
  headerHeight?: number;
154
168
  /**
155
169
  * @description 内容区域样式
156
- * @default -
170
+ * @default {}
157
171
  */
158
172
  contentStyle?: CSSProperties;
159
173
  /**
160
174
  * @description 水印配置
161
- * @default -
175
+ * @default {}
162
176
  */
163
177
  waterMarkProps?: ProWaterMarkProps;
164
178
  /**
165
179
  * @description 折叠回调事件
166
180
  * @default -
167
181
  */
168
- onCollapsedChange?: (collapsed: any) => void;
182
+ onCollapsedChange?: (collapsed: boolean) => void;
169
183
  /**
170
184
  * @description 规定在何处打开被链接文档
171
- * _blank
172
- * _parent
173
- * _self
174
- * _top
185
+ * @default "_self"
175
186
  */
176
187
  target?: '_blank' | '_parent' | '_self' | '_top';
188
+ /**
189
+ * @description 主题
190
+ * @default "light"
191
+ */
192
+ theme?: themeEnum;
193
+ /**
194
+ * @description 子元素
195
+ * @default -
196
+ */
197
+ children?: ReactNode;
198
+ /**
199
+ * @description 允许扩展字段
200
+ */
177
201
  [key: string]: any;
178
202
  }
179
- export interface ProLayoutStates {
203
+ export interface ProLayoutStatesType {
180
204
  /**
181
205
  * @description 是否折叠
182
- * @default -
206
+ * @default false
183
207
  */
184
208
  collapsed?: boolean;
185
209
  /**
@@ -187,6 +211,23 @@ export interface ProLayoutStates {
187
211
  * @default -
188
212
  */
189
213
  notice?: ReactNode | string;
214
+ /**
215
+ * @description 菜单列表
216
+ * @default []
217
+ */
218
+ menus?: MenusType[];
219
+ /**
220
+ * @description 选中的路径
221
+ * @default ""
222
+ */
223
+ selectedPath?: string;
224
+ /**
225
+ * @description 允许扩展字段
226
+ */
190
227
  [key: string]: any;
191
228
  }
229
+ export type MenusProps = MenusType;
230
+ export type DataSourceProps = DataSourceType;
231
+ export type ProLayoutProps = ProLayoutType;
232
+ export type ProLayoutStates = ProLayoutStatesType;
192
233
  export {};
@@ -1,4 +1,4 @@
1
- import type { MenusProps } from '../propTypes';
1
+ import type { MenusType } from '../propTypes';
2
2
  /**
3
3
  * 通过URL获取对应keyIdPath
4
4
  * @param menus 菜单数据
@@ -17,7 +17,7 @@ export declare const transformMenu: (menuData: any[], pathPrefix: string) => any
17
17
  * @param data 菜单数据源
18
18
  * @returns []
19
19
  */
20
- export declare const transformMenus: (data: MenusProps, pathPrefix: string) => any[] | MenusProps;
20
+ export declare const transformMenus: (data: MenusType, pathPrefix: string) => any[] | MenusType;
21
21
  /**
22
22
  * 获取URL中的search参数
23
23
  * @param name 参数key
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { PropSelectProps, ProSelectAction } from './propsType';
2
+ import type { PropSelectType, ProSelectActionType } from './propsType';
3
3
  import './index.less';
4
- export declare const ProSelect: (props: PropSelectProps, ref: React.Ref<ProSelectAction> | undefined) => import("react/jsx-runtime").JSX.Element;
5
- declare const _default: React.ForwardRefExoticComponent<PropSelectProps & React.RefAttributes<ProSelectAction>>;
4
+ export declare const ProSelect: (props: PropSelectType, ref: React.Ref<ProSelectActionType> | undefined) => import("react/jsx-runtime").JSX.Element;
5
+ declare const _default: React.ForwardRefExoticComponent<PropSelectType & React.RefAttributes<ProSelectActionType>>;
6
6
  export default _default;
@@ -2,65 +2,175 @@ import { ReactNode } from 'react';
2
2
  import type { SelectProps } from 'antd';
3
3
  import { Service, Options, Result } from 'ahooks/lib/useRequest/src/types';
4
4
  import { ProFormOtherProps } from '../ProForm/propsType';
5
- export interface DataOption {
5
+ /**
6
+ * @description 数据选项类型
7
+ */
8
+ export interface DataOptionType {
9
+ /**
10
+ * @description 展示标签
11
+ * @default -
12
+ */
6
13
  label?: string;
14
+ /**
15
+ * @description 选项值
16
+ * @default -
17
+ */
7
18
  value?: string | number;
19
+ /**
20
+ * @description 允许扩展字段
21
+ */
8
22
  [key: string]: any;
9
23
  }
10
- export interface PropSelectProps extends Omit<SelectProps, 'onSearch'> {
11
- /** 是否查看模式 */
24
+ /**
25
+ * @description 选择框属性类型
26
+ */
27
+ export interface PropSelectType extends Omit<SelectProps, 'onSearch'> {
28
+ /**
29
+ * @description 是否查看模式
30
+ * @default false
31
+ */
12
32
  isView?: boolean;
13
- /** 是否开启组件在可视区域中才发起useRequest请求 默认 false */
33
+ /**
34
+ * @description 是否开启组件在可视区域中才发起useRequest请求
35
+ * @default false
36
+ */
14
37
  viewportReady?: boolean;
15
- /** 默认数组第一项 */
38
+ /**
39
+ * @description 默认数组第一项
40
+ * @default false
41
+ */
16
42
  defaultOne?: boolean;
17
- /** 数据源 */
18
- dataSource?: DataOption[];
19
- /** list场景中过滤掉已选择的值 */
43
+ /**
44
+ * @description 数据源
45
+ * @default -
46
+ */
47
+ dataSource?: DataOptionType[];
48
+ /**
49
+ * @description list场景中过滤掉已选择的值
50
+ * @default false
51
+ */
20
52
  filterInList?: boolean;
21
- /** @deprecated 兼容 2.0 版本、3.0 使用view 模式 */
53
+ /**
54
+ * @deprecated 兼容 2.0 版本、3.0 使用view 模式
55
+ * @default -
56
+ */
22
57
  defaultDisableValue?: string;
23
- /** 是否展示 tooltip、当 label 特别长的时候使用 */
58
+ /**
59
+ * @description 是否展示 tooltip、当 label 特别长的时候使用
60
+ * @default false
61
+ */
24
62
  tooltip?: boolean;
25
- /** 是否展示 code-label 形式 */
63
+ /**
64
+ * @description 是否展示 code-label 形式
65
+ * @default false
66
+ */
26
67
  showCodeName?: boolean;
27
- /** 集成表单 form 的属性 */
68
+ /**
69
+ * @description 集成表单 form 的属性
70
+ * @default -
71
+ */
28
72
  otherProps?: ProFormOtherProps;
29
- /** 下拉框滚动是否跟随父级 */
73
+ /**
74
+ * @description 下拉框滚动是否跟随父级
75
+ * @default false
76
+ */
30
77
  scrollFollowParent?: boolean;
31
- /** 远程请求接口 */
78
+ /**
79
+ * @description 远程请求接口
80
+ * @default -
81
+ */
32
82
  useRequest?: {
83
+ /**
84
+ * @description 请求服务函数
85
+ */
33
86
  service?: Service<any, any>;
87
+ /**
88
+ * @description 请求选项
89
+ */
34
90
  options?: Options<any, any>;
35
91
  };
36
92
  /**
37
93
  * @deprecated 兼容 2.0 版本、3.0 使用 transformResponse
38
- * @param data
39
- * @param setSelectList
94
+ * @param data 数据
95
+ * @param setSelectList 设置选择列表的函数
40
96
  * @returns
41
97
  */
42
98
  updateDataSource?: (data: any, setSelectList: any) => void;
43
- /** 格式化数据 */
44
- transformResponse?: (data: any) => DataOption[];
45
- /** 点击搜索执行 */
99
+ /**
100
+ * @description 格式化数据
101
+ * @param data 后台返回的数据
102
+ * @returns 格式化后的数据选项
103
+ */
104
+ transformResponse?: (data: any) => DataOptionType[];
105
+ /**
106
+ * @description 点击搜索执行
107
+ * @param value 搜索值
108
+ * @param useRequest 请求实例
109
+ */
46
110
  onSearch?: (value: string, useRequest: Result<any, any>) => void;
47
- /** 自定义展示 */
48
- optionRender?: (value: DataOption) => string | ReactNode;
49
- /** 用来转换修改value 和 getValueProps配合使用 */
50
- getChangeValue?: (value: DataOption) => any;
51
- /** 用来转换传入的value值 getChangeValue配合使用 */
52
- getValueProps?: (value: DataOption) => any;
111
+ /**
112
+ * @description 自定义展示
113
+ * @param value 数据选项
114
+ * @returns 自定义渲染内容
115
+ */
116
+ optionRender?: (value: DataOptionType) => string | ReactNode;
117
+ /**
118
+ * @description 用来转换修改value值 和 getValueProps配合使用
119
+ * @param value 数据选项
120
+ * @returns 转换后的值
121
+ */
122
+ getChangeValue?: (value: DataOptionType) => any;
123
+ /**
124
+ * @description 用来转换传入的value值 getChangeValue配合使用
125
+ * @param value 数据选项
126
+ * @returns 转换后的值属性
127
+ */
128
+ getValueProps?: (value: DataOptionType) => any;
53
129
  }
54
- export interface ProSelectAction {
55
- /** 实例方法、根据 code | code[] 批量获取数据 */
130
+ /**
131
+ * @description ProSelect操作接口类型
132
+ */
133
+ export interface ProSelectActionType {
134
+ /**
135
+ * @description 实例方法、根据 code | code[] 批量获取数据
136
+ * @param code 代码或代码数组
137
+ * @param key 可选键名
138
+ * @returns 获取的数据
139
+ */
56
140
  getValueObject: (code: string | string[], key?: string) => any;
57
- /** 获取发生请求的 useRequest 的 ref */
141
+ /**
142
+ * @description 获取发生请求的 useRequest 的 ref
143
+ */
58
144
  useRequestRef: Result<any, any>;
59
145
  }
60
- export interface ResponseData {
146
+ /**
147
+ * @description 响应数据接口类型
148
+ */
149
+ export interface ResponseDataType {
150
+ /**
151
+ * @description 状态码
152
+ */
61
153
  status: number;
154
+ /**
155
+ * @description 消息
156
+ */
62
157
  message: string;
158
+ /**
159
+ * @description 数据
160
+ */
63
161
  data: any;
162
+ /**
163
+ * @description 是否成功
164
+ * @default -
165
+ */
64
166
  success?: boolean;
167
+ /**
168
+ * @description 代码
169
+ * @default -
170
+ */
65
171
  code?: number;
66
172
  }
173
+ export type DataOption = DataOptionType;
174
+ export type PropSelectProps = PropSelectType;
175
+ export type ProSelectAction = ProSelectActionType;
176
+ export type ResponseData = ResponseDataType;
@@ -2,6 +2,9 @@
2
2
  @import (reference) '~antd/es/style/themes/index.less';
3
3
 
4
4
  .pro-table {
5
+ .pro-tooltip .singleLine {
6
+ transition: none;
7
+ }
5
8
  &.pro-table-draggable-only {
6
9
  .ant-table-tbody {
7
10
  .anticon {
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import type { ProTabsProps } from './propType';
3
- declare const _default: React.ForwardRefExoticComponent<Omit<ProTabsProps, "ref"> & React.RefAttributes<unknown>>;
2
+ import type { ProTabsType } from './propType';
3
+ declare const _default: React.ForwardRefExoticComponent<Omit<ProTabsType, "ref"> & React.RefAttributes<unknown>>;
4
4
  export default _default;
@@ -59,12 +59,12 @@ var ProTabs = function ProTabs(props, ref) {
59
59
  total: itemProps.total,
60
60
  label: itemProps.label,
61
61
  icon: itemProps.icon,
62
- mode: mode
62
+ mode: mode,
63
+ title: itemProps.title || itemProps.label,
64
+ loading: fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.loading
63
65
  };
64
66
  return _objectSpread(_objectSpread({}, omit(itemProps, ['total', 'label', 'icon'])), {}, {
65
- label: _jsx(Card, _objectSpread({
66
- loading: fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.loading
67
- }, cardItemProps))
67
+ label: _jsx(Card, _objectSpread({}, cardItemProps))
68
68
  });
69
69
  });
70
70
  }, [selectList, fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.loading]);
@@ -1,36 +1,93 @@
1
1
  import React from 'react';
2
2
  import type { TabsProps } from 'antd';
3
3
  import { Service, Options, Result } from 'ahooks/lib/useRequest/src/types';
4
- export interface CardProps {
4
+ export interface CardType {
5
+ /**
6
+ * @description 卡片标题
7
+ * @default -
8
+ */
9
+ title: string | React.ReactNode;
10
+ /**
11
+ * @description 卡片数量
12
+ * @default -
13
+ */
5
14
  total: number;
15
+ /**
16
+ * @description 卡片标签
17
+ * @default -
18
+ */
6
19
  label: string | React.ReactNode;
20
+ /**
21
+ * @description 卡片图标
22
+ * @default -
23
+ */
7
24
  icon: React.ReactNode;
25
+ /**
26
+ * @description 卡片模式
27
+ * @default card
28
+ */
8
29
  mode?: TabModeEnum;
30
+ /**
31
+ * @description 卡片是否加载中
32
+ * @default false
33
+ */
9
34
  loading?: boolean;
10
35
  [key: string]: any;
11
36
  }
12
- export interface ProTabsItemsProps extends CardProps {
37
+ export interface ProTabsItemType extends CardType {
38
+ /**
39
+ * @description 卡片唯一key
40
+ * @default -
41
+ */
13
42
  key: string;
43
+ /**
44
+ * @description 卡片内容
45
+ * @default -
46
+ */
14
47
  children?: React.ReactNode;
48
+ /**
49
+ * @description 卡片是否禁用
50
+ * @default false
51
+ */
15
52
  disabled?: boolean;
16
53
  [key: string]: any;
17
54
  }
18
- export interface ProTabsAction {
19
- /** 获取发生请求的 useRequest 的 ref */
55
+ export interface ProTabsActionType {
56
+ /**
57
+ * @description 获取发生请求的 useRequest 的 ref
58
+ * @default -
59
+ */
20
60
  useRequestRef: Result<any, any>;
21
61
  }
22
62
  export type TabModeEnum = 'card' | 'line';
23
- export interface ProTabsProps extends Omit<TabsProps, 'items' | 'onChange'> {
24
- dataSource: ProTabsItemsProps[];
25
- /** 是否开启tab切换查询 */
63
+ export interface ProTabsType extends Omit<TabsProps, 'items' | 'onChange'> {
64
+ /**
65
+ * @description 卡片数据源
66
+ * @default -
67
+ */
68
+ dataSource: ProTabsItemType[];
69
+ /**
70
+ * @description 是否开启tab切换查询
71
+ * @default false
72
+ */
26
73
  tabSearch?: boolean;
27
74
  onChange?: (activeKey: string, useRequest: Result<any, any>) => void;
28
- /** card:卡片模式 tab tab模式 */
75
+ /**
76
+ * @description card:卡片模式 tab tab模式
77
+ * @default card
78
+ */
29
79
  mode?: TabModeEnum;
30
- /** 远程请求接口 */
80
+ /**
81
+ * @description 远程请求接口
82
+ * @default -
83
+ */
31
84
  useRequest?: {
32
85
  service: Service<any, any>;
33
86
  options?: Options<any, any>;
34
87
  };
35
88
  [key: string]: any;
36
89
  }
90
+ export type ProTabsProps = ProTabsType;
91
+ export type ProTabsItemsProps = ProTabsItemType;
92
+ export type ProTabsAction = ProTabsActionType;
93
+ export type CardProps = CardType;