@ant-design/pro-components 3.1.3-1 → 3.1.4-0

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 (223) hide show
  1. package/dist/pro-components.min.js +1 -1
  2. package/es/card/components/Actions/index.js +1 -4
  3. package/es/card/components/Card/index.js +23 -15
  4. package/es/card/components/Card/style.js +34 -8
  5. package/es/card/components/CheckCard/Group.js +1 -3
  6. package/es/card/components/CheckCard/index.js +0 -1
  7. package/es/card/components/Divider/index.d.ts +1 -1
  8. package/es/card/components/Divider/index.js +2 -2
  9. package/es/card/components/Divider/style.d.ts +4 -1
  10. package/es/card/components/Divider/style.js +6 -39
  11. package/es/card/components/Statistic/index.js +1 -1
  12. package/es/card/typing.d.ts +2 -6
  13. package/es/descriptions/index.d.ts +3 -5
  14. package/es/descriptions/index.js +6 -6
  15. package/es/descriptions/useFetchData.js +0 -1
  16. package/es/field/AllProField.js +0 -4
  17. package/es/field/PureProField.js +0 -5
  18. package/es/field/components/Checkbox/index.js +2 -5
  19. package/es/field/components/DatePicker/index.d.ts +1 -1
  20. package/es/field/components/DigitRange/index.js +1 -0
  21. package/es/field/components/Options/index.js +0 -3
  22. package/es/field/components/Percent/util.d.ts +1 -1
  23. package/es/field/components/RangePicker/index.d.ts +1 -1
  24. package/es/field/components/Select/SearchSelect/index.js +0 -1
  25. package/es/field/components/Switch/index.js +0 -1
  26. package/es/field/components/Text/index.js +4 -1
  27. package/es/form/BaseForm/BaseForm.js +0 -3
  28. package/es/form/BaseForm/LightWrapper/index.d.ts +2 -1
  29. package/es/form/components/Captcha/index.js +0 -3
  30. package/es/form/components/Checkbox/index.js +5 -1
  31. package/es/form/components/DatePicker/index.js +0 -2
  32. package/es/form/components/FieldSet/index.js +16 -6
  33. package/es/form/components/FormItem/index.js +9 -7
  34. package/es/form/components/FormItem/warpField.js +3 -15
  35. package/es/form/components/List/index.d.ts +1 -1
  36. package/es/form/components/List/index.js +0 -2
  37. package/es/form/components/Radio/index.js +5 -4
  38. package/es/form/components/SchemaForm/index.js +0 -1
  39. package/es/form/components/SchemaForm/layoutType/StepsForm.js +0 -1
  40. package/es/form/components/Select/index.js +0 -1
  41. package/es/form/components/Text/index.js +0 -3
  42. package/es/form/components/UploadButton/index.js +4 -2
  43. package/es/form/components/UploadDragger/index.js +0 -1
  44. package/es/form/helpers/grid.js +1 -5
  45. package/es/form/layouts/DrawerForm/index.js +1 -5
  46. package/es/form/layouts/LightFilter/index.js +0 -1
  47. package/es/form/layouts/ModalForm/index.js +1 -4
  48. package/es/form/layouts/ProForm/index.d.ts +1 -1
  49. package/es/form/layouts/QueryFilter/index.js +0 -1
  50. package/es/form/layouts/StepsForm/StepForm.js +0 -1
  51. package/es/form/layouts/StepsForm/index.js +3 -12
  52. package/es/layout/ProLayout.js +1 -6
  53. package/es/layout/components/AppsLogoComponents/style/index.js +4 -0
  54. package/es/layout/components/FooterToolbar/index.js +0 -3
  55. package/es/layout/components/GlobalHeader/ActionsContent.js +0 -1
  56. package/es/layout/components/Header/index.js +1 -3
  57. package/es/layout/components/PageContainer/index.js +0 -1
  58. package/es/layout/components/PageContainer/style/index.js +4 -0
  59. package/es/layout/components/SettingDrawer/BlockCheckbox.js +0 -1
  60. package/es/layout/components/SettingDrawer/index.js +0 -1
  61. package/es/layout/components/SettingDrawer/style/index.js +4 -0
  62. package/es/layout/components/SiderMenu/BaseMenu.js +2 -6
  63. package/es/layout/components/SiderMenu/SiderMenu.js +1 -3
  64. package/es/layout/components/SiderMenu/index.js +0 -1
  65. package/es/layout/components/TopNavHeader/index.js +1 -2
  66. package/es/layout/style/index.js +4 -0
  67. package/es/layout/utils/getMenuData.js +0 -1
  68. package/es/list/Item.d.ts +1 -4
  69. package/es/list/Item.js +75 -104
  70. package/es/list/ListView.d.ts +6 -4
  71. package/es/list/ListView.js +41 -53
  72. package/es/list/ProListBase.d.ts +74 -0
  73. package/es/list/ProListBase.js +350 -0
  74. package/es/list/constants.d.ts +2 -2
  75. package/es/list/constants.js +2 -5
  76. package/es/list/index.d.ts +23 -13
  77. package/es/list/index.js +78 -41
  78. package/es/list/style/index.d.ts +0 -1
  79. package/es/list/style/index.js +215 -86
  80. package/es/provider/index.js +0 -3
  81. package/es/provider/useStyle/index.d.ts +1 -21
  82. package/es/provider/useStyle/index.js +6 -3
  83. package/es/skeleton/components/Descriptions/index.js +1 -4
  84. package/es/skeleton/components/List/index.js +1 -4
  85. package/es/table/Store/Provide.js +0 -2
  86. package/es/table/Table.js +5 -14
  87. package/es/table/components/ColumnSetting/index.js +0 -1
  88. package/es/table/components/EditableTable/index.js +0 -1
  89. package/es/table/components/ListToolBar/index.d.ts +1 -1
  90. package/es/table/components/ListToolBar/index.js +4 -10
  91. package/es/table/components/ListToolBar/style.js +1 -1
  92. package/es/table/components/ToolBar/index.d.ts +1 -1
  93. package/es/table/style/index.js +4 -0
  94. package/es/table/typing.d.ts +10 -5
  95. package/es/table/useFetchData.js +0 -3
  96. package/es/table/utils/cellRenderToFromItem.js +1 -3
  97. package/es/table/utils/index.js +0 -1
  98. package/es/utils/components/LabelIconTip/index.d.ts +3 -4
  99. package/es/utils/genCopyable/index.d.ts +6 -0
  100. package/es/utils/genCopyable/index.js +28 -8
  101. package/es/utils/hooks/useDebounceValue/index.js +1 -3
  102. package/es/utils/hooks/useDeepCompareEffect/index.js +0 -2
  103. package/es/utils/index.d.ts +2 -1
  104. package/es/utils/isDeepEqualReact/index.js +0 -8
  105. package/es/utils/merge/index.js +0 -3
  106. package/es/utils/nanoid/index.d.ts +1 -3
  107. package/es/utils/nanoid/index.js +2 -10
  108. package/es/utils/proFieldParsingText/index.js +1 -3
  109. package/es/utils/typing.d.ts +2 -1
  110. package/es/utils/useEditableArray/index.js +1 -1
  111. package/es/utils/useEditableMap/index.js +1 -1
  112. package/guidelines/overview-components.md +1 -1
  113. package/lib/card/components/Actions/index.js +1 -4
  114. package/lib/card/components/Card/index.js +23 -15
  115. package/lib/card/components/Card/style.js +34 -8
  116. package/lib/card/components/CheckCard/Group.js +1 -3
  117. package/lib/card/components/CheckCard/index.js +0 -1
  118. package/lib/card/components/Divider/index.d.ts +1 -1
  119. package/lib/card/components/Divider/index.js +2 -2
  120. package/lib/card/components/Divider/style.d.ts +4 -1
  121. package/lib/card/components/Divider/style.js +5 -39
  122. package/lib/card/components/Statistic/index.js +1 -1
  123. package/lib/card/typing.d.ts +2 -6
  124. package/lib/descriptions/index.d.ts +3 -5
  125. package/lib/descriptions/index.js +6 -6
  126. package/lib/descriptions/useFetchData.js +0 -1
  127. package/lib/field/AllProField.js +0 -4
  128. package/lib/field/PureProField.js +0 -5
  129. package/lib/field/components/Checkbox/index.js +2 -5
  130. package/lib/field/components/DatePicker/index.d.ts +1 -1
  131. package/lib/field/components/DigitRange/index.js +1 -0
  132. package/lib/field/components/Options/index.js +0 -3
  133. package/lib/field/components/Percent/util.d.ts +1 -1
  134. package/lib/field/components/RangePicker/index.d.ts +1 -1
  135. package/lib/field/components/Select/SearchSelect/index.js +0 -1
  136. package/lib/field/components/Switch/index.js +0 -1
  137. package/lib/field/components/Text/index.js +4 -1
  138. package/lib/form/BaseForm/BaseForm.js +0 -4
  139. package/lib/form/BaseForm/LightWrapper/index.d.ts +2 -1
  140. package/lib/form/components/Captcha/index.js +0 -3
  141. package/lib/form/components/Checkbox/index.js +5 -1
  142. package/lib/form/components/DatePicker/index.js +0 -2
  143. package/lib/form/components/FieldSet/index.js +16 -6
  144. package/lib/form/components/FormItem/index.js +9 -7
  145. package/lib/form/components/FormItem/warpField.js +3 -15
  146. package/lib/form/components/List/index.d.ts +1 -1
  147. package/lib/form/components/List/index.js +0 -2
  148. package/lib/form/components/Radio/index.js +5 -4
  149. package/lib/form/components/SchemaForm/index.js +0 -1
  150. package/lib/form/components/SchemaForm/layoutType/StepsForm.js +0 -1
  151. package/lib/form/components/Select/index.js +0 -1
  152. package/lib/form/components/Text/index.js +0 -3
  153. package/lib/form/components/UploadButton/index.js +4 -2
  154. package/lib/form/components/UploadDragger/index.js +0 -1
  155. package/lib/form/helpers/grid.js +1 -5
  156. package/lib/form/layouts/DrawerForm/index.js +1 -5
  157. package/lib/form/layouts/LightFilter/index.js +0 -1
  158. package/lib/form/layouts/ModalForm/index.js +1 -4
  159. package/lib/form/layouts/ProForm/index.d.ts +1 -1
  160. package/lib/form/layouts/QueryFilter/index.js +0 -2
  161. package/lib/form/layouts/StepsForm/StepForm.js +0 -1
  162. package/lib/form/layouts/StepsForm/index.js +3 -12
  163. package/lib/layout/ProLayout.js +1 -6
  164. package/lib/layout/components/AppsLogoComponents/style/index.js +4 -0
  165. package/lib/layout/components/FooterToolbar/index.js +0 -4
  166. package/lib/layout/components/GlobalHeader/ActionsContent.js +0 -1
  167. package/lib/layout/components/Header/index.js +1 -3
  168. package/lib/layout/components/PageContainer/index.js +0 -1
  169. package/lib/layout/components/PageContainer/style/index.js +4 -0
  170. package/lib/layout/components/SettingDrawer/BlockCheckbox.js +0 -1
  171. package/lib/layout/components/SettingDrawer/index.js +0 -1
  172. package/lib/layout/components/SettingDrawer/style/index.js +4 -0
  173. package/lib/layout/components/SiderMenu/BaseMenu.js +2 -6
  174. package/lib/layout/components/SiderMenu/SiderMenu.js +1 -3
  175. package/lib/layout/components/SiderMenu/index.js +0 -1
  176. package/lib/layout/components/TopNavHeader/index.js +1 -2
  177. package/lib/layout/style/index.js +4 -0
  178. package/lib/layout/utils/getMenuData.js +0 -1
  179. package/lib/list/Item.d.ts +1 -4
  180. package/lib/list/Item.js +74 -103
  181. package/lib/list/ListView.d.ts +6 -4
  182. package/lib/list/ListView.js +40 -52
  183. package/lib/list/ProListBase.d.ts +74 -0
  184. package/lib/list/ProListBase.js +357 -0
  185. package/lib/list/constants.d.ts +2 -2
  186. package/lib/list/constants.js +2 -5
  187. package/lib/list/index.d.ts +23 -13
  188. package/lib/list/index.js +77 -40
  189. package/lib/list/style/index.d.ts +0 -1
  190. package/lib/list/style/index.js +214 -86
  191. package/lib/provider/index.js +0 -3
  192. package/lib/provider/useStyle/index.d.ts +1 -21
  193. package/lib/provider/useStyle/index.js +6 -3
  194. package/lib/skeleton/components/Descriptions/index.js +1 -4
  195. package/lib/skeleton/components/List/index.js +1 -4
  196. package/lib/table/Store/Provide.js +0 -2
  197. package/lib/table/Table.js +5 -14
  198. package/lib/table/components/ColumnSetting/index.js +0 -1
  199. package/lib/table/components/EditableTable/index.js +0 -1
  200. package/lib/table/components/ListToolBar/index.d.ts +1 -1
  201. package/lib/table/components/ListToolBar/index.js +4 -10
  202. package/lib/table/components/ListToolBar/style.js +1 -1
  203. package/lib/table/components/ToolBar/index.d.ts +1 -1
  204. package/lib/table/style/index.js +4 -0
  205. package/lib/table/typing.d.ts +10 -5
  206. package/lib/table/useFetchData.js +0 -3
  207. package/lib/table/utils/cellRenderToFromItem.js +1 -3
  208. package/lib/table/utils/index.js +0 -1
  209. package/lib/utils/components/LabelIconTip/index.d.ts +3 -4
  210. package/lib/utils/genCopyable/index.d.ts +6 -0
  211. package/lib/utils/genCopyable/index.js +28 -8
  212. package/lib/utils/hooks/useDebounceValue/index.js +1 -3
  213. package/lib/utils/hooks/useDeepCompareEffect/index.js +0 -2
  214. package/lib/utils/index.d.ts +2 -1
  215. package/lib/utils/isDeepEqualReact/index.js +0 -8
  216. package/lib/utils/merge/index.js +0 -3
  217. package/lib/utils/nanoid/index.d.ts +1 -3
  218. package/lib/utils/nanoid/index.js +2 -10
  219. package/lib/utils/proFieldParsingText/index.js +1 -3
  220. package/lib/utils/typing.d.ts +2 -1
  221. package/lib/utils/useEditableArray/index.js +0 -2
  222. package/lib/utils/useEditableMap/index.js +0 -2
  223. package/package.json +4 -5
@@ -1,7 +1,7 @@
1
1
  import { TabPaneProps } from 'antd';
2
- import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel';
3
2
  import type { SearchProps } from 'antd/lib/input';
4
3
  import React from 'react';
4
+ import type { LabelTooltipType } from '../../../utils';
5
5
  import type { ListToolBarHeaderMenuProps } from './HeaderMenu';
6
6
  export type ListToolBarSetting = {
7
7
  icon: React.ReactNode;
@@ -162,13 +162,11 @@ const ListToolBar = ({
162
162
  },
163
163
  children: actions.map((action, index) => {
164
164
  if (! /*#__PURE__*/React.isValidElement(action)) {
165
- // eslint-disable-next-line react/no-array-index-key
166
165
  return /*#__PURE__*/_jsx(React.Fragment, {
167
166
  children: action
168
167
  }, index);
169
168
  }
170
169
  return /*#__PURE__*/React.cloneElement(action, {
171
- // eslint-disable-next-line react/no-array-index-key
172
170
  key: index,
173
171
  ...action?.props
174
172
  });
@@ -240,14 +238,10 @@ const ListToolBar = ({
240
238
  className: `${prefixCls}-setting-items ${hashId}`.trim(),
241
239
  children: settings.map((setting, index) => {
242
240
  const settingItem = getSettingItem(setting);
243
- return (
244
- /*#__PURE__*/
245
- // eslint-disable-next-line react/no-array-index-key
246
- _jsx("div", {
247
- className: `${prefixCls}-setting-item ${hashId}`.trim(),
248
- children: settingItem
249
- }, index)
250
- );
241
+ return /*#__PURE__*/_jsx("div", {
242
+ className: `${prefixCls}-setting-item ${hashId}`.trim(),
243
+ children: settingItem
244
+ }, index);
251
245
  })
252
246
  }) : null]
253
247
  });
@@ -8,7 +8,7 @@ const genProListStyle = token => {
8
8
  display: 'flex',
9
9
  justifyContent: 'space-between',
10
10
  paddingBlock: token.padding,
11
- paddingInline: 0,
11
+ paddingInline: token.paddingXS,
12
12
  '&-mobile': {
13
13
  flexDirection: 'column'
14
14
  }
@@ -1,6 +1,6 @@
1
1
  import type { TableColumnType } from 'antd';
2
- import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel';
3
2
  import React from 'react';
3
+ import type { LabelTooltipType } from '../../../utils';
4
4
  import type { ActionType, OptionSearchProps, ProTableProps } from '../../typing';
5
5
  import type { ListToolBarProps } from '../ListToolBar';
6
6
  export type SettingOptionType = {
@@ -20,6 +20,10 @@ export const turn = new Keyframes('turn', {
20
20
  const genProListStyle = token => {
21
21
  return {
22
22
  [token.componentCls]: {
23
+ boxSizing: 'border-box',
24
+ '*, *::before, *::after': {
25
+ boxSizing: 'border-box'
26
+ },
23
27
  zIndex: 1,
24
28
  [`${token.antCls}-table-wrapper ${token.antCls}-table-pagination${token.antCls}-pagination`]: {
25
29
  marginBlockEnd: 0
@@ -1,6 +1,5 @@
1
1
  import type { SpinProps, TableProps } from 'antd';
2
2
  import type { SizeType } from 'antd/lib/config-provider/SizeContext';
3
- import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel';
4
3
  import type { NamePath } from 'antd/lib/form/interface';
5
4
  import type { SearchProps } from 'antd/lib/input';
6
5
  import type { ColumnFilterItem, ColumnType, CompareFn, SorterResult, SortOrder } from 'antd/lib/table/interface';
@@ -10,7 +9,7 @@ import type { CSSProperties, Key } from 'react';
10
9
  import type { ProCardProps } from '../card';
11
10
  import type { ProFieldEmptyText } from '../field';
12
11
  import type { LightWrapperProps, ProFormProps, QueryFilterProps } from '../form';
13
- import type { ProCoreActionType, ProSchema, ProSchemaComponentTypes, ProTableEditableFnType, RowEditableConfig, SearchTransformKeyFn } from '../utils';
12
+ import type { LabelTooltipType, ProCoreActionType, ProEllipsis, ProSchema, ProSchemaComponentTypes, ProTableEditableFnType, RowEditableConfig, SearchTransformKeyFn } from '../utils';
14
13
  import type { AlertRenderType } from './components/Alert';
15
14
  import type { SearchConfig, TableFormItem } from './components/Form/FormRender';
16
15
  import type { ListToolBarProps } from './components/ListToolBar';
@@ -80,7 +79,7 @@ export type ProColumnType<T = unknown, ValueType = 'text'> = ProSchema<T, ExtraP
80
79
  /** 搜索表单的默认值 */
81
80
  initialValue?: any;
82
81
  /** @name 是否缩略 */
83
- ellipsis?: ColumnType<T>['ellipsis'];
82
+ ellipsis?: ProEllipsis;
84
83
  /** @name 是否拷贝 */
85
84
  copyable?: boolean;
86
85
  /** 在查询表单中隐藏 */
@@ -106,8 +105,14 @@ export type ProColumnType<T = unknown, ValueType = 'text'> = ProSchema<T, ExtraP
106
105
  order?: number;
107
106
  /** @name 可编辑表格是否可编辑 */
108
107
  editable?: boolean | ProTableEditableFnType<T>;
109
- /** @private */
110
- listKey?: string;
108
+ /**
109
+ * 用于 ProList,指定该列映射到列表项的哪个插槽位置
110
+ *
111
+ * @name 列表项插槽
112
+ * @example listSlot: 'title'
113
+ * @example listSlot: 'avatar'
114
+ */
115
+ listSlot?: 'title' | 'subTitle' | 'avatar' | 'description' | 'content' | 'actions' | 'aside' | 'type' | (string & {});
111
116
  /** @name 只读 */
112
117
  readonly?: boolean;
113
118
  /** @name 列设置的 disabled */
@@ -264,7 +264,6 @@ const useFetchData = (getData, defaultData, options) => {
264
264
  return () => {
265
265
  clearTimeout(pollingSetTimeRef.current);
266
266
  };
267
- // eslint-disable-next-line react-hooks/exhaustive-deps
268
267
  }, [polling]);
269
268
  useEffect(() => {
270
269
  umountRef.current = false;
@@ -297,7 +296,6 @@ const useFetchData = (getData, defaultData, options) => {
297
296
  abortFetch();
298
297
  fetchListDebounce.run(false);
299
298
  }
300
- // eslint-disable-next-line react-hooks/exhaustive-deps
301
299
  }, [pageInfo?.current]);
302
300
 
303
301
  // pageSize 修改后返回第一页
@@ -307,7 +305,6 @@ const useFetchData = (getData, defaultData, options) => {
307
305
  }
308
306
  abortFetch();
309
307
  fetchListDebounce.run(false);
310
- // eslint-disable-next-line react-hooks/exhaustive-deps
311
308
  }, [pageInfo?.pageSize]);
312
309
 
313
310
  /**
@@ -60,9 +60,7 @@ const CellRenderFromItem = props => {
60
60
  name: formItemName,
61
61
  ...restProps,
62
62
  children: children
63
- }, key),
64
- // eslint-disable-next-line react-hooks/exhaustive-deps
65
- [key, formItemName]);
63
+ }, key), [key, formItemName]);
66
64
  const generateFormItem = useCallback(() => {
67
65
  const formItemProps = {
68
66
  ...getFieldPropsOrFormItemProps(columnProps?.formItemProps, ...needProps)
@@ -87,7 +87,6 @@ export function useActionType(ref, action, props) {
87
87
  // 透出 scrollTo(如上层提供)
88
88
  scrollTo: props.scrollTo
89
89
  };
90
- // eslint-disable-next-line no-param-reassign
91
90
  ref.current = userAction;
92
91
  }
93
92
  /**
@@ -1,5 +1,6 @@
1
- import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel';
2
1
  import React from 'react';
2
+ import type { ProEllipsis } from '../../genCopyable';
3
+ import type { LabelTooltipType } from '../../typing';
3
4
  /**
4
5
  * 在 form 的 label 后面增加一个 tips 来展示一些说明文案
5
6
  *
@@ -9,7 +10,5 @@ export declare const LabelIconTip: React.FC<{
9
10
  label: React.ReactNode;
10
11
  subTitle?: React.ReactNode;
11
12
  tooltip?: string | LabelTooltipType;
12
- ellipsis?: boolean | {
13
- showTitle?: boolean;
14
- };
13
+ ellipsis?: ProEllipsis;
15
14
  }>;
@@ -1,4 +1,10 @@
1
+ import type { TooltipProps } from 'antd';
1
2
  import React from 'react';
3
+ export type ProEllipsisTooltip = {
4
+ showTitle?: boolean;
5
+ tooltip?: TooltipProps;
6
+ };
7
+ export type ProEllipsis = ProEllipsisTooltip | boolean;
2
8
  /**
3
9
  * 生成 Copyable 或 Ellipsis 的 dom
4
10
  *
@@ -1,4 +1,5 @@
1
1
  import { Typography } from 'antd';
2
+ import isObject from 'lodash-es/isObject';
2
3
  import React from 'react';
3
4
  import { jsx as _jsx } from "react/jsx-runtime";
4
5
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -23,16 +24,35 @@ const normalizeCopyText = text => {
23
24
  return text === null || text === undefined ? '' : String(text).trimEnd();
24
25
  };
25
26
  const genEllipsis = (dom, item, text) => {
27
+ const ellipsis = getEllipsis(item);
28
+ if (!ellipsis || !text) {
29
+ return false;
30
+ }
26
31
  /** 有些 valueType 需要设置copy的为string */
27
32
  const needTranText = isNeedTranText(item);
28
- return getEllipsis(item) && text ? {
29
- tooltip:
30
- // 支持一下 tooltip 的关闭
31
- item?.tooltip !== false && needTranText ? /*#__PURE__*/_jsx("div", {
32
- className: "pro-table-tooltip-text",
33
- children: dom
34
- }) : text
35
- } : false;
33
+
34
+ // 支持一下 tooltip 的关闭
35
+ if (needTranText && item?.tooltip !== false) {
36
+ return {
37
+ tooltip: /*#__PURE__*/_jsx("div", {
38
+ className: "pro-table-tooltip-text",
39
+ children: dom
40
+ })
41
+ };
42
+ }
43
+
44
+ // 如果 ellipsis 是对象且包含 tooltip 属性,合并 tooltip 的属性
45
+ if (isObject(ellipsis) && isObject(ellipsis.tooltip)) {
46
+ return {
47
+ tooltip: {
48
+ title: text,
49
+ ...ellipsis.tooltip
50
+ }
51
+ };
52
+ }
53
+ return {
54
+ tooltip: text
55
+ };
36
56
  };
37
57
 
38
58
  /**
@@ -15,8 +15,6 @@ export function useDebounceValue(value, delay = 100, deps) {
15
15
  setDebouncedValue(valueRef.current);
16
16
  }, delay);
17
17
  return () => clearTimeout(handler);
18
- },
19
- // eslint-disable-next-line react-hooks/exhaustive-deps
20
- deps ? [delay, ...deps] : undefined);
18
+ }, deps ? [delay, ...deps] : undefined);
21
19
  return debouncedValue;
22
20
  }
@@ -12,7 +12,6 @@ export function useDeepCompareMemoize(value, ignoreKeys) {
12
12
  return ref.current;
13
13
  }
14
14
  export function useDeepCompareEffect(effect, dependencies, ignoreKeys) {
15
- // eslint-disable-next-line react-hooks/exhaustive-deps
16
15
  useEffect(effect, useDeepCompareMemoize(dependencies || [], ignoreKeys));
17
16
  }
18
17
  export function useDeepCompareEffectDebounce(effect, dependencies, ignoreKeys, waitTime) {
@@ -21,6 +20,5 @@ export function useDeepCompareEffectDebounce(effect, dependencies, ignoreKeys, w
21
20
  }, waitTime || 16);
22
21
  useEffect(() => {
23
22
  effectDn.run();
24
- // eslint-disable-next-line react-hooks/exhaustive-deps
25
23
  }, useDeepCompareMemoize(dependencies || [], ignoreKeys));
26
24
  }
@@ -9,6 +9,7 @@ import type { ProFormInstanceType } from './components/ProFormContext';
9
9
  import { ProFormContext } from './components/ProFormContext';
10
10
  import { conversionMomentValue, convertMoment, dateFormatterMap } from './conversionMomentValue';
11
11
  import { dateArrayFormatter } from './dateArrayFormatter';
12
+ import type { ProEllipsis } from './genCopyable';
12
13
  import { genCopyable } from './genCopyable';
13
14
  import { getFieldPropsOrFormItemProps } from './getFieldPropsOrFormItemProps';
14
15
  import { useDebounceFn } from './hooks/useDebounceFn';
@@ -48,4 +49,4 @@ import { useEditableMap } from './useEditableMap';
48
49
  import { useBreakpoint } from './useMediaQuery';
49
50
  export * from './typing';
50
51
  export { conversionMomentValue, conversionMomentValue as conversionSubmitValue, convertMoment, dateArrayFormatter, dateFormatterMap, DropdownFooter, editableRowByKey, ErrorBoundary, FieldLabel, FilterDropdown, genCopyable, getFieldPropsOrFormItemProps, InlineErrorFormItem, isBrowser, isDeepEqualReact, isDropdownValueType, isImg, isNil, isUrl, LabelIconTip, lighten, merge, nanoid, objectToMap, omitBoolean, omitUndefined, omitUndefinedAndEmptyArr, operationUnit, parseValueToDay, pickProFormItemProps, pickProProps, proFieldParsingText, ProFormContext, recordKeyToString, resetComponent, runFunction, setAlpha, stringify, transformKeySubmitValue, useBreakpoint, useDebounceFn, useDebounceValue, useDeepCompareEffect, useDeepCompareEffectDebounce, useDeepCompareMemo, useDocumentTitle, useEditableArray, useEditableMap, useFetchData, useLatest, usePrevious, useReactiveRef, useRefCallback, useRefFunction, useStyle, };
51
- export type { ProFormInstanceType, ProRequestData, RowEditableConfig, RowEditableType, UseEditableMapType, UseEditableMapUtilType, UseEditableType, UseEditableUtilType, };
52
+ export type { ProEllipsis, ProFormInstanceType, ProRequestData, RowEditableConfig, RowEditableType, UseEditableMapType, UseEditableMapUtilType, UseEditableType, UseEditableUtilType, };
@@ -1,9 +1,3 @@
1
- /* eslint-disable no-restricted-syntax */
2
- /* eslint-disable no-continue */
3
- /* eslint-disable @typescript-eslint/no-unused-vars */
4
- /* eslint-disable no-self-compare */
5
- /* eslint-disable eqeqeq */
6
- /* eslint-disable no-plusplus */
7
1
  // do not edit .js files directly - edit src/index.jst
8
2
 
9
3
  export function isDeepEqualReact(a, b, ignoreKeys) {
@@ -42,8 +36,6 @@ export function isDeepEqualReact(a, b, ignoreKeys) {
42
36
  if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
43
37
  if (a.valueOf !== Object.prototype.valueOf && a.valueOf) return a.valueOf() === b.valueOf();
44
38
  if (a.toString !== Object.prototype.toString && a.toString) return a.toString() === b.toString();
45
-
46
- // eslint-disable-next-line prefer-const
47
39
  keys = Object.keys(a);
48
40
  length = keys.length;
49
41
  if (length !== Object.keys(b).length) return false;
@@ -1,5 +1,3 @@
1
- /* eslint-disable prefer-rest-params */
2
-
3
1
  /**
4
2
  * 用于合并 n 个对象
5
3
  * @param {any[]} ...rest
@@ -11,7 +9,6 @@ const merge = (...rest) => {
11
9
  let key;
12
10
  let i = 0;
13
11
  for (; i < il; i += 1) {
14
- // eslint-disable-next-line no-restricted-syntax
15
12
  for (key in rest[i]) {
16
13
  if (rest[i].hasOwnProperty(key)) {
17
14
  if (typeof obj[key] === 'object' && typeof rest[i][key] === 'object' && obj[key] !== undefined && obj[key] !== null && !Array.isArray(obj[key]) && !Array.isArray(rest[i][key])) {
@@ -1,6 +1,4 @@
1
1
  /**
2
- * 生成uuid,如果不支持 randomUUID,就用 genNanoid
3
- *
4
- * @returns string
2
+ * @description 生成uuid,如果不支持 randomUUID,就用 genNanoid
5
3
  */
6
4
  export declare const nanoid: () => string;
@@ -1,12 +1,9 @@
1
- /* eslint-disable prefer-const */
2
-
3
1
  let index = 0;
4
2
  let genNanoid = (t = 21) => {
5
3
  if (typeof window === 'undefined') return (index += 1).toFixed(0);
6
4
  if (!window.crypto) return (index += 1).toFixed(0);
7
5
  let e = '',
8
6
  r = crypto.getRandomValues(new Uint8Array(t));
9
- // eslint-disable-next-line no-param-reassign
10
7
  for (; t--;) {
11
8
  let n = 63 & r[t];
12
9
  e += n < 36 ? n.toString(36) : n < 62 ? (n - 26).toString(36).toUpperCase() : n < 63 ? '_' : '-';
@@ -15,15 +12,10 @@ let genNanoid = (t = 21) => {
15
12
  };
16
13
 
17
14
  /**
18
- * 生成uuid,如果不支持 randomUUID,就用 genNanoid
19
- *
20
- * @returns string
15
+ * @description 生成uuid,如果不支持 randomUUID,就用 genNanoid
21
16
  */
22
17
  export const nanoid = () => {
23
- if (typeof window === 'undefined') return genNanoid();
24
- // @ts-ignore
25
- if (window.crypto && window.crypto.randomUUID && typeof crypto.randomUUID == 'function') {
26
- // @ts-ignore
18
+ if (window?.crypto?.randomUUID && typeof crypto.randomUUID === 'function') {
27
19
  return crypto.randomUUID();
28
20
  }
29
21
  return genNanoid();
@@ -102,9 +102,7 @@ export const proFieldParsingText = (text, valueEnumParams, key) => {
102
102
  separator: ",",
103
103
  size: 2,
104
104
  wrap: true,
105
- children: text.map((value, index) =>
106
- // @ts-ignore
107
- proFieldParsingText(value, valueEnumParams, index))
105
+ children: text.map((value, index) => proFieldParsingText(value, valueEnumParams, index))
108
106
  }, key);
109
107
  }
110
108
  const valueEnum = objectToMap(valueEnumParams);
@@ -1,13 +1,14 @@
1
1
  import type { AvatarProps, CascaderProps, CheckboxProps, ColorPickerProps, DatePickerProps, DividerProps, ImageProps, InputNumberProps, InputProps, PopoverProps, ProgressProps, RadioProps, RateProps, SegmentedProps, SelectProps, SliderSingleProps, SpaceProps, SwitchProps, TimeRangePickerProps, TreeSelectProps } from 'antd';
2
2
  import type { RangePickerProps } from 'antd/lib/date-picker';
3
3
  import type { FormInstance, FormItemProps } from 'antd/lib/form';
4
- import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel';
5
4
  import type { NamePath } from 'antd/lib/form/interface';
6
5
  import type { PasswordProps, TextAreaProps } from 'antd/lib/input';
7
6
  import type { SliderRangeProps } from 'antd/lib/slider';
8
7
  import type { ReactNode } from 'react';
9
8
  import type { ProSchemaValueEnumType } from '../provider';
10
9
  import type { UseEditableUtilType } from './useEditableArray';
10
+ export type LabelTooltipType = any;
11
+ export type WrapperTooltipProps = any;
11
12
  export type ProFormBaseGroupProps = {
12
13
  /**
13
14
  * @name 分组的标题
@@ -1,4 +1,4 @@
1
- /* eslint-disable react-hooks/exhaustive-deps */import { LoadingOutlined } from '@ant-design/icons';
1
+ import { LoadingOutlined } from '@ant-design/icons';
2
2
  import { get, warning as rcWarning, set, useControlledState } from '@rc-component/util';
3
3
  import { Form, Popconfirm, message } from 'antd';
4
4
  import React, { createRef, forwardRef, useCallback, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
@@ -1,4 +1,4 @@
1
- /* eslint-disable react-hooks/exhaustive-deps */import { get, useControlledState } from '@rc-component/util';
1
+ import { get, useControlledState } from '@rc-component/util';
2
2
  import { message } from 'antd';
3
3
  import { useCallback, useMemo, useRef } from 'react';
4
4
  import { useRefFunction } from '..';
@@ -14,7 +14,7 @@ Here are the guidelines files and additional guidelines for the ProComponents:
14
14
  | DrawerForm | Form inside a drawer | [drawer-form.md](components/drawer-form.md) |
15
15
  | StepsForm | Multi-step form wizard | [steps-form.md](components/steps-form.md) |
16
16
  | ProLayout | Heavy-duty layout component | [pro-layout.md](components/pro-layout.md) |
17
- | ProList | List component with table-like features | [pro-list.md](components/pro-list.md) |
17
+ | ProList | List component with table-like features | [list.md](components/list.md) |
18
18
  | ProSkeleton | Skeleton loading component | [pro-skeleton.md](components/pro-skeleton.md) |
19
19
  | ProTable | Advanced table with search, filter, and valueType | [pro-table.md](components/pro-table.md) |
20
20
  | EditableProTable | Editable table for inline editing | [editable-pro-table.md](components/editable-pro-table.md) |
@@ -21,10 +21,7 @@ const ProCardActions = props => {
21
21
  if (Array.isArray(actions) && actions?.length) {
22
22
  return wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
23
23
  className: (0, _clsx.clsx)(`${prefixCls}-actions`, hashId),
24
- children: actions.map((action, index) =>
25
- /*#__PURE__*/
26
- // eslint-disable-next-line react/no-array-index-key
27
- (0, _jsxRuntime.jsx)("li", {
24
+ children: actions.map((action, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
28
25
  style: {
29
26
  width: `${100 / actions.length}%`,
30
27
  padding: 0,
@@ -23,8 +23,6 @@ const Card = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
23
23
  const {
24
24
  className,
25
25
  style,
26
- bodyStyle,
27
- headStyle,
28
26
  styles,
29
27
  title,
30
28
  subTitle,
@@ -219,23 +217,34 @@ const Card = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
219
217
  [`${prefixCls}-body-direction-column`]: split === 'horizontal' || direction === 'column',
220
218
  [`${prefixCls}-body-wrap`]: wrap && containProCard
221
219
  });
222
-
223
- // 支持新的 styles API,同时保持向后兼容
224
- const cardBodyStyle = styles?.body || bodyStyle;
225
- const cardHeadStyle = styles?.header || headStyle;
220
+ const bodyStylePadding = styles?.body?.padding;
226
221
  const loadingDOM = /*#__PURE__*/_react.default.isValidElement(loading) ? loading : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.default, {
227
222
  prefix: prefixCls,
228
- style: cardBodyStyle?.padding === 0 || cardBodyStyle?.padding === '0px' ? {
223
+ style: bodyStylePadding === 0 || bodyStylePadding === '0px' ? {
229
224
  padding: 24
230
225
  } : undefined
231
226
  });
227
+ const handleCollapsibleIconClick = (0, _react.useCallback)(() => {
228
+ if (collapsible === 'icon') setCollapsed(prev => !prev);
229
+ }, [collapsible, setCollapsed]);
230
+
232
231
  // 非受控情况下展示
233
- const collapsibleButton = collapsible && controlCollapsed === undefined && (collapsibleIconRender ? collapsibleIconRender({
234
- collapsed
232
+ const collapsibleButton = collapsible && controlCollapsed === undefined && (collapsibleIconRender ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
233
+ role: "button",
234
+ tabIndex: collapsible === 'icon' ? 0 : undefined,
235
+ className: `${prefixCls}-collapsible-icon ${hashId}`.trim(),
236
+ onClick: collapsible === 'icon' ? handleCollapsibleIconClick : undefined,
237
+ onKeyDown: collapsible === 'icon' ? e => {
238
+ if (e.key === 'Enter' || e.key === ' ') {
239
+ e.preventDefault();
240
+ handleCollapsibleIconClick();
241
+ }
242
+ } : undefined,
243
+ children: collapsibleIconRender({
244
+ collapsed
245
+ })
235
246
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.RightOutlined, {
236
- onClick: () => {
237
- if (collapsible === 'icon') setCollapsed(!collapsed);
238
- },
247
+ onClick: handleCollapsibleIconClick,
239
248
  rotate: !collapsed ? 90 : undefined,
240
249
  className: `${prefixCls}-collapsible-icon ${hashId}`.trim()
241
250
  }));
@@ -253,7 +262,7 @@ const Card = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
253
262
  [`${prefixCls}-header-border`]: headerBordered || type === 'inner',
254
263
  [`${prefixCls}-header-collapsible`]: collapsibleButton
255
264
  }),
256
- style: cardHeadStyle,
265
+ style: styles?.header,
257
266
  onClick: () => {
258
267
  if (collapsible === 'header' || collapsible === true) setCollapsed(!collapsed);
259
268
  },
@@ -274,13 +283,12 @@ const Card = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
274
283
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tabs, {
275
284
  onChange: tabs.onChange,
276
285
  ...(0, _util.omit)(tabs, ['cardProps']),
277
- // @ts-ignore
278
286
  items: ModifyTabItemsContent,
279
287
  children: loading ? loadingDOM : children
280
288
  })
281
289
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
282
290
  className: bodyCls,
283
- style: cardBodyStyle,
291
+ style: styles?.body,
284
292
  children: loading ? loadingDOM : childrenModified
285
293
  }), actions ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Actions.default, {
286
294
  actions: actions,
@@ -19,6 +19,9 @@ const genProCardStyle = token => {
19
19
  display: 'flex',
20
20
  flexDirection: 'column',
21
21
  boxSizing: 'border-box',
22
+ '*, *::before, *::after': {
23
+ boxSizing: 'border-box'
24
+ },
22
25
  width: '100%',
23
26
  marginBlock: 0,
24
27
  marginInline: 0,
@@ -35,6 +38,29 @@ const genProCardStyle = token => {
35
38
  '&-col': {
36
39
  width: '100%'
37
40
  },
41
+ // 分割线样式:col 之间的分割线
42
+ [` ${componentCls}-col${componentCls}-split-vertical`]: {
43
+ borderInlineEnd: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`
44
+ },
45
+ [` ${componentCls}-col${componentCls}-split-horizontal`]: {
46
+ borderBlockEnd: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`
47
+ },
48
+ // Divider 分割线组件样式
49
+ [`${componentCls}-divider`]: {
50
+ flex: 'none',
51
+ alignSelf: 'stretch',
52
+ width: token.lineWidth,
53
+ marginInline: token.marginXS,
54
+ marginBlock: token.marginLG,
55
+ backgroundColor: token.colorSplit,
56
+ [`&${componentCls}-divider-horizontal`]: {
57
+ width: 'auto',
58
+ alignSelf: 'auto',
59
+ height: token.lineWidth,
60
+ marginInline: token.marginLG,
61
+ marginBlock: token.marginXS
62
+ }
63
+ },
38
64
  '&-border': {
39
65
  border: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`
40
66
  },
@@ -179,19 +205,19 @@ const genProCardStyle = token => {
179
205
  paddingBlock: token.paddingSM
180
206
  }
181
207
  },
208
+ [` ${componentCls}-divider`]: {
209
+ marginBlock: token.marginLG,
210
+ marginInline: token.marginXS,
211
+ [`&${componentCls}-divider-horizontal`]: {
212
+ marginBlock: token.marginXS,
213
+ marginInline: token.marginLG
214
+ }
215
+ },
182
216
  [`${componentCls}-header${componentCls}-header-collapsible`]: {
183
217
  paddingBlock: token.paddingXS
184
218
  }
185
219
  }
186
220
  },
187
- [`${componentCls}-col`]: {
188
- [`&${componentCls}-split-vertical`]: {
189
- borderInlineEnd: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`
190
- },
191
- [`&${componentCls}-split-horizontal`]: {
192
- borderBlockEnd: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`
193
- }
194
- },
195
221
  [`${componentCls}-tabs`]: {
196
222
  [`${token.antCls}-tabs-top > ${token.antCls}-tabs-nav`]: {
197
223
  marginBlockEnd: 0,
@@ -167,9 +167,7 @@ const CheckCardGroup = props => {
167
167
  };
168
168
  const children = (0, _react.useMemo)(() => {
169
169
  if (loading) {
170
- return new Array(options.length || _react.default.Children.toArray(props.children).length || 1).fill(0)
171
- // eslint-disable-next-line react/no-array-index-key
172
- .map((_, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.default, {
170
+ return new Array(options.length || _react.default.Children.toArray(props.children).length || 1).fill(0).map((_, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.default, {
173
171
  loading: true
174
172
  }, index));
175
173
  }
@@ -49,7 +49,6 @@ const CheckCard = props => {
49
49
  (0, _react.useEffect)(() => {
50
50
  checkCardGroup?.registerValue?.(props.value);
51
51
  return () => checkCardGroup?.cancelValue?.(props.value);
52
- // eslint-disable-next-line react-hooks/exhaustive-deps
53
52
  }, [props.value]);
54
53
  const {
55
54
  prefixCls: customizePrefixCls,
@@ -17,7 +17,7 @@ export type ProCardDividerProps = {
17
17
  *
18
18
  * @default vertical
19
19
  */
20
- type?: 'horizontal' | 'vertical';
20
+ orientation?: 'horizontal' | 'vertical';
21
21
  };
22
22
  declare const ProCardDivider: React.FC<ProCardDividerProps>;
23
23
  export default ProCardDivider;
@@ -24,10 +24,10 @@ const ProCardDivider = props => {
24
24
  const {
25
25
  className,
26
26
  style = {},
27
- type
27
+ orientation = 'vertical'
28
28
  } = props;
29
29
  const classString = (0, _clsx.clsx)(prefixCls, className, hashId, {
30
- [`${prefixCls}-${type}`]: type
30
+ [`${prefixCls}-${orientation}`]: orientation
31
31
  });
32
32
  return wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
33
33
  className: classString,
@@ -1,5 +1,8 @@
1
1
  /// <reference types="react" />
2
- export default function useStyle(prefixCls: string): {
2
+ /**
3
+ * Divider 样式已合并至 ProCard style.ts,此 hook 仅用于获取 hashId 和 wrapSSR
4
+ */
5
+ export default function useStyle(_prefixCls: string): {
3
6
  wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
4
7
  hashId: string;
5
8
  };