@ant-design/pro-components 3.1.3-0 → 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 (277) 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/Actions/style.js +1 -0
  4. package/es/card/components/Card/index.js +23 -15
  5. package/es/card/components/Card/style.js +34 -8
  6. package/es/card/components/CheckCard/Group.js +1 -3
  7. package/es/card/components/CheckCard/index.js +0 -1
  8. package/es/card/components/CheckCard/style.js +1 -0
  9. package/es/card/components/Divider/index.d.ts +1 -1
  10. package/es/card/components/Divider/index.js +2 -2
  11. package/es/card/components/Divider/style.d.ts +4 -1
  12. package/es/card/components/Divider/style.js +6 -38
  13. package/es/card/components/Loading/style.js +1 -0
  14. package/es/card/components/Operation/style.js +1 -0
  15. package/es/card/components/Statistic/index.js +1 -1
  16. package/es/card/components/Statistic/style.js +1 -0
  17. package/es/card/components/StatisticCard/style.js +1 -0
  18. package/es/card/typing.d.ts +2 -6
  19. package/es/descriptions/index.d.ts +3 -5
  20. package/es/descriptions/index.js +6 -6
  21. package/es/descriptions/useFetchData.js +0 -1
  22. package/es/field/AllProField.js +0 -4
  23. package/es/field/PureProField.js +0 -5
  24. package/es/field/components/Checkbox/index.js +2 -5
  25. package/es/field/components/DatePicker/index.d.ts +1 -1
  26. package/es/field/components/DigitRange/index.js +1 -0
  27. package/es/field/components/Options/index.js +0 -3
  28. package/es/field/components/Percent/util.d.ts +1 -1
  29. package/es/field/components/RangePicker/index.d.ts +1 -1
  30. package/es/field/components/Select/SearchSelect/index.js +0 -1
  31. package/es/field/components/Switch/index.js +0 -1
  32. package/es/field/components/Text/index.js +4 -1
  33. package/es/form/BaseForm/BaseForm.js +0 -3
  34. package/es/form/BaseForm/LightWrapper/index.d.ts +2 -1
  35. package/es/form/BaseForm/LightWrapper/style.js +2 -0
  36. package/es/form/components/Captcha/index.js +0 -3
  37. package/es/form/components/Checkbox/index.js +5 -1
  38. package/es/form/components/DatePicker/index.js +0 -2
  39. package/es/form/components/FieldSet/index.js +16 -6
  40. package/es/form/components/FormItem/Group/style.js +1 -0
  41. package/es/form/components/FormItem/index.js +9 -7
  42. package/es/form/components/FormItem/warpField.js +3 -15
  43. package/es/form/components/List/index.d.ts +1 -1
  44. package/es/form/components/List/index.js +0 -2
  45. package/es/form/components/List/style.js +1 -0
  46. package/es/form/components/Radio/index.js +5 -4
  47. package/es/form/components/SchemaForm/index.js +0 -1
  48. package/es/form/components/SchemaForm/layoutType/StepsForm.js +0 -1
  49. package/es/form/components/Select/index.js +0 -1
  50. package/es/form/components/Text/index.js +0 -3
  51. package/es/form/components/UploadButton/index.js +4 -2
  52. package/es/form/components/UploadDragger/index.js +0 -1
  53. package/es/form/helpers/grid.js +1 -5
  54. package/es/form/layouts/DrawerForm/index.js +1 -5
  55. package/es/form/layouts/DrawerForm/style.js +1 -0
  56. package/es/form/layouts/LightFilter/index.js +0 -1
  57. package/es/form/layouts/LightFilter/style.js +1 -0
  58. package/es/form/layouts/LoginForm/style.js +1 -0
  59. package/es/form/layouts/LoginFormPage/style.js +1 -0
  60. package/es/form/layouts/ModalForm/index.js +1 -4
  61. package/es/form/layouts/ProForm/index.d.ts +1 -1
  62. package/es/form/layouts/QueryFilter/index.js +0 -1
  63. package/es/form/layouts/QueryFilter/style.js +1 -0
  64. package/es/form/layouts/StepsForm/StepForm.js +0 -1
  65. package/es/form/layouts/StepsForm/index.js +3 -12
  66. package/es/form/layouts/StepsForm/style.js +1 -0
  67. package/es/layout/ProLayout.js +1 -6
  68. package/es/layout/components/AppsLogoComponents/style/index.js +4 -0
  69. package/es/layout/components/CollapsedIcon/style.js +1 -0
  70. package/es/layout/components/FooterToolbar/index.js +0 -3
  71. package/es/layout/components/GlobalFooter/style.js +1 -0
  72. package/es/layout/components/GlobalHeader/ActionsContent.js +0 -1
  73. package/es/layout/components/GridContent/style.js +1 -0
  74. package/es/layout/components/Header/index.js +1 -3
  75. package/es/layout/components/PageContainer/index.js +0 -1
  76. package/es/layout/components/PageContainer/style/index.js +4 -0
  77. package/es/layout/components/SettingDrawer/BlockCheckbox.js +0 -1
  78. package/es/layout/components/SettingDrawer/index.js +0 -1
  79. package/es/layout/components/SettingDrawer/style/index.js +4 -0
  80. package/es/layout/components/SiderMenu/BaseMenu.js +2 -6
  81. package/es/layout/components/SiderMenu/SiderMenu.js +1 -3
  82. package/es/layout/components/SiderMenu/index.js +0 -1
  83. package/es/layout/components/TopNavHeader/index.js +1 -2
  84. package/es/layout/components/TopNavHeader/style.js +1 -0
  85. package/es/layout/style/index.js +4 -0
  86. package/es/layout/utils/getMenuData.js +0 -1
  87. package/es/list/Item.d.ts +1 -4
  88. package/es/list/Item.js +75 -104
  89. package/es/list/ListView.d.ts +6 -4
  90. package/es/list/ListView.js +41 -53
  91. package/es/list/ProListBase.d.ts +74 -0
  92. package/es/list/ProListBase.js +350 -0
  93. package/es/list/constants.d.ts +2 -2
  94. package/es/list/constants.js +2 -5
  95. package/es/list/index.d.ts +23 -13
  96. package/es/list/index.js +78 -41
  97. package/es/list/style/index.d.ts +0 -1
  98. package/es/list/style/index.js +215 -86
  99. package/es/provider/index.js +0 -3
  100. package/es/provider/useStyle/index.d.ts +1 -21
  101. package/es/provider/useStyle/index.js +7 -5
  102. package/es/skeleton/components/Descriptions/index.js +1 -4
  103. package/es/skeleton/components/List/index.js +1 -4
  104. package/es/table/Store/Provide.js +0 -2
  105. package/es/table/Table.js +5 -14
  106. package/es/table/components/Alert/style.js +1 -0
  107. package/es/table/components/ColumnSetting/index.js +0 -1
  108. package/es/table/components/ColumnSetting/style.js +1 -0
  109. package/es/table/components/DragSortTable/style.js +1 -0
  110. package/es/table/components/EditableTable/index.js +0 -1
  111. package/es/table/components/ListToolBar/index.d.ts +1 -1
  112. package/es/table/components/ListToolBar/index.js +4 -10
  113. package/es/table/components/ListToolBar/style.js +2 -1
  114. package/es/table/components/ToolBar/index.d.ts +1 -1
  115. package/es/table/style/index.js +4 -0
  116. package/es/table/typing.d.ts +10 -5
  117. package/es/table/useFetchData.js +0 -3
  118. package/es/table/utils/cellRenderToFromItem.js +1 -3
  119. package/es/table/utils/index.js +0 -1
  120. package/es/utils/components/DropdownFooter/style.js +1 -0
  121. package/es/utils/components/FieldLabel/index.js +1 -1
  122. package/es/utils/components/FieldLabel/style.js +15 -6
  123. package/es/utils/components/InlineErrorFormItem/style.js +1 -0
  124. package/es/utils/components/LabelIconTip/index.d.ts +3 -4
  125. package/es/utils/components/LabelIconTip/style.js +1 -0
  126. package/es/utils/genCopyable/index.d.ts +6 -0
  127. package/es/utils/genCopyable/index.js +28 -8
  128. package/es/utils/hooks/useDebounceValue/index.js +1 -3
  129. package/es/utils/hooks/useDeepCompareEffect/index.js +0 -2
  130. package/es/utils/index.d.ts +2 -1
  131. package/es/utils/isDeepEqualReact/index.js +0 -8
  132. package/es/utils/merge/index.js +0 -3
  133. package/es/utils/nanoid/index.d.ts +1 -3
  134. package/es/utils/nanoid/index.js +2 -10
  135. package/es/utils/proFieldParsingText/index.js +1 -3
  136. package/es/utils/typing.d.ts +2 -1
  137. package/es/utils/useEditableArray/index.js +1 -1
  138. package/es/utils/useEditableMap/index.js +1 -1
  139. package/guidelines/overview-components.md +1 -1
  140. package/lib/card/components/Actions/index.js +1 -4
  141. package/lib/card/components/Actions/style.js +1 -0
  142. package/lib/card/components/Card/index.js +23 -15
  143. package/lib/card/components/Card/style.js +34 -8
  144. package/lib/card/components/CheckCard/Group.js +1 -3
  145. package/lib/card/components/CheckCard/index.js +0 -1
  146. package/lib/card/components/CheckCard/style.js +1 -0
  147. package/lib/card/components/Divider/index.d.ts +1 -1
  148. package/lib/card/components/Divider/index.js +2 -2
  149. package/lib/card/components/Divider/style.d.ts +4 -1
  150. package/lib/card/components/Divider/style.js +5 -38
  151. package/lib/card/components/Loading/style.js +1 -0
  152. package/lib/card/components/Operation/style.js +1 -0
  153. package/lib/card/components/Statistic/index.js +1 -1
  154. package/lib/card/components/Statistic/style.js +1 -0
  155. package/lib/card/components/StatisticCard/style.js +1 -0
  156. package/lib/card/typing.d.ts +2 -6
  157. package/lib/descriptions/index.d.ts +3 -5
  158. package/lib/descriptions/index.js +6 -6
  159. package/lib/descriptions/useFetchData.js +0 -1
  160. package/lib/field/AllProField.js +0 -4
  161. package/lib/field/PureProField.js +0 -5
  162. package/lib/field/components/Checkbox/index.js +2 -5
  163. package/lib/field/components/DatePicker/index.d.ts +1 -1
  164. package/lib/field/components/DigitRange/index.js +1 -0
  165. package/lib/field/components/Options/index.js +0 -3
  166. package/lib/field/components/Percent/util.d.ts +1 -1
  167. package/lib/field/components/RangePicker/index.d.ts +1 -1
  168. package/lib/field/components/Select/SearchSelect/index.js +0 -1
  169. package/lib/field/components/Switch/index.js +0 -1
  170. package/lib/field/components/Text/index.js +4 -1
  171. package/lib/form/BaseForm/BaseForm.js +0 -4
  172. package/lib/form/BaseForm/LightWrapper/index.d.ts +2 -1
  173. package/lib/form/BaseForm/LightWrapper/style.js +2 -0
  174. package/lib/form/components/Captcha/index.js +0 -3
  175. package/lib/form/components/Checkbox/index.js +5 -1
  176. package/lib/form/components/DatePicker/index.js +0 -2
  177. package/lib/form/components/FieldSet/index.js +16 -6
  178. package/lib/form/components/FormItem/Group/style.js +1 -0
  179. package/lib/form/components/FormItem/index.js +9 -7
  180. package/lib/form/components/FormItem/warpField.js +3 -15
  181. package/lib/form/components/List/index.d.ts +1 -1
  182. package/lib/form/components/List/index.js +0 -2
  183. package/lib/form/components/List/style.js +1 -0
  184. package/lib/form/components/Radio/index.js +5 -4
  185. package/lib/form/components/SchemaForm/index.js +0 -1
  186. package/lib/form/components/SchemaForm/layoutType/StepsForm.js +0 -1
  187. package/lib/form/components/Select/index.js +0 -1
  188. package/lib/form/components/Text/index.js +0 -3
  189. package/lib/form/components/UploadButton/index.js +4 -2
  190. package/lib/form/components/UploadDragger/index.js +0 -1
  191. package/lib/form/helpers/grid.js +1 -5
  192. package/lib/form/layouts/DrawerForm/index.js +1 -5
  193. package/lib/form/layouts/DrawerForm/style.js +1 -0
  194. package/lib/form/layouts/LightFilter/index.js +0 -1
  195. package/lib/form/layouts/LightFilter/style.js +1 -0
  196. package/lib/form/layouts/LoginForm/style.js +1 -0
  197. package/lib/form/layouts/LoginFormPage/style.js +1 -0
  198. package/lib/form/layouts/ModalForm/index.js +1 -4
  199. package/lib/form/layouts/ProForm/index.d.ts +1 -1
  200. package/lib/form/layouts/QueryFilter/index.js +0 -2
  201. package/lib/form/layouts/QueryFilter/style.js +1 -0
  202. package/lib/form/layouts/StepsForm/StepForm.js +0 -1
  203. package/lib/form/layouts/StepsForm/index.js +3 -12
  204. package/lib/form/layouts/StepsForm/style.js +1 -0
  205. package/lib/layout/ProLayout.js +1 -6
  206. package/lib/layout/components/AppsLogoComponents/style/index.js +4 -0
  207. package/lib/layout/components/CollapsedIcon/style.js +1 -0
  208. package/lib/layout/components/FooterToolbar/index.js +0 -4
  209. package/lib/layout/components/GlobalFooter/style.js +1 -0
  210. package/lib/layout/components/GlobalHeader/ActionsContent.js +0 -1
  211. package/lib/layout/components/GridContent/style.js +1 -0
  212. package/lib/layout/components/Header/index.js +1 -3
  213. package/lib/layout/components/PageContainer/index.js +0 -1
  214. package/lib/layout/components/PageContainer/style/index.js +4 -0
  215. package/lib/layout/components/SettingDrawer/BlockCheckbox.js +0 -1
  216. package/lib/layout/components/SettingDrawer/index.js +0 -1
  217. package/lib/layout/components/SettingDrawer/style/index.js +4 -0
  218. package/lib/layout/components/SiderMenu/BaseMenu.js +2 -6
  219. package/lib/layout/components/SiderMenu/SiderMenu.js +1 -3
  220. package/lib/layout/components/SiderMenu/index.js +0 -1
  221. package/lib/layout/components/TopNavHeader/index.js +1 -2
  222. package/lib/layout/components/TopNavHeader/style.js +1 -0
  223. package/lib/layout/style/index.js +4 -0
  224. package/lib/layout/utils/getMenuData.js +0 -1
  225. package/lib/list/Item.d.ts +1 -4
  226. package/lib/list/Item.js +74 -103
  227. package/lib/list/ListView.d.ts +6 -4
  228. package/lib/list/ListView.js +40 -52
  229. package/lib/list/ProListBase.d.ts +74 -0
  230. package/lib/list/ProListBase.js +357 -0
  231. package/lib/list/constants.d.ts +2 -2
  232. package/lib/list/constants.js +2 -5
  233. package/lib/list/index.d.ts +23 -13
  234. package/lib/list/index.js +77 -40
  235. package/lib/list/style/index.d.ts +0 -1
  236. package/lib/list/style/index.js +214 -86
  237. package/lib/provider/index.js +0 -3
  238. package/lib/provider/useStyle/index.d.ts +1 -21
  239. package/lib/provider/useStyle/index.js +7 -5
  240. package/lib/skeleton/components/Descriptions/index.js +1 -4
  241. package/lib/skeleton/components/List/index.js +1 -4
  242. package/lib/table/Store/Provide.js +0 -2
  243. package/lib/table/Table.js +5 -14
  244. package/lib/table/components/Alert/style.js +1 -0
  245. package/lib/table/components/ColumnSetting/index.js +0 -1
  246. package/lib/table/components/ColumnSetting/style.js +1 -0
  247. package/lib/table/components/DragSortTable/style.js +1 -0
  248. package/lib/table/components/EditableTable/index.js +0 -1
  249. package/lib/table/components/ListToolBar/index.d.ts +1 -1
  250. package/lib/table/components/ListToolBar/index.js +4 -10
  251. package/lib/table/components/ListToolBar/style.js +2 -1
  252. package/lib/table/components/ToolBar/index.d.ts +1 -1
  253. package/lib/table/style/index.js +4 -0
  254. package/lib/table/typing.d.ts +10 -5
  255. package/lib/table/useFetchData.js +0 -3
  256. package/lib/table/utils/cellRenderToFromItem.js +1 -3
  257. package/lib/table/utils/index.js +0 -1
  258. package/lib/utils/components/DropdownFooter/style.js +1 -0
  259. package/lib/utils/components/FieldLabel/index.js +1 -1
  260. package/lib/utils/components/FieldLabel/style.js +15 -6
  261. package/lib/utils/components/InlineErrorFormItem/style.js +1 -0
  262. package/lib/utils/components/LabelIconTip/index.d.ts +3 -4
  263. package/lib/utils/components/LabelIconTip/style.js +1 -0
  264. package/lib/utils/genCopyable/index.d.ts +6 -0
  265. package/lib/utils/genCopyable/index.js +28 -8
  266. package/lib/utils/hooks/useDebounceValue/index.js +1 -3
  267. package/lib/utils/hooks/useDeepCompareEffect/index.js +0 -2
  268. package/lib/utils/index.d.ts +2 -1
  269. package/lib/utils/isDeepEqualReact/index.js +0 -8
  270. package/lib/utils/merge/index.js +0 -3
  271. package/lib/utils/nanoid/index.d.ts +1 -3
  272. package/lib/utils/nanoid/index.js +2 -10
  273. package/lib/utils/proFieldParsingText/index.js +1 -3
  274. package/lib/utils/typing.d.ts +2 -1
  275. package/lib/utils/useEditableArray/index.js +0 -2
  276. package/lib/utils/useEditableMap/index.js +0 -2
  277. package/package.json +4 -5
@@ -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,
@@ -12,6 +12,7 @@ const genActionsStyle = token => {
12
12
  } = token;
13
13
  return {
14
14
  [`${componentCls}-actions`]: {
15
+ boxSizing: 'border-box',
15
16
  marginBlock: 0,
16
17
  marginInline: 0,
17
18
  paddingBlock: 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,
@@ -41,6 +41,7 @@ const cardLoading = exports.cardLoading = new _cssinjs.Keyframes('card-loading',
41
41
  const genProStyle = token => {
42
42
  return {
43
43
  [token.componentCls]: {
44
+ boxSizing: 'border-box',
44
45
  position: 'relative',
45
46
  display: 'inline-block',
46
47
  width: '320px',
@@ -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
  };
@@ -5,42 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = useStyle;
7
7
  var _provider = require("../../../provider");
8
- const genDividerStyle = token => {
9
- const {
10
- componentCls
11
- } = token;
12
- return {
13
- [componentCls]: {
14
- '&-divider': {
15
- flex: 'none',
16
- width: token.lineWidth,
17
- marginInline: token.marginXS,
18
- marginBlock: token.marginLG,
19
- backgroundColor: token.colorSplit,
20
- '&-horizontal': {
21
- width: 'initial',
22
- height: token.lineWidth,
23
- marginInline: token.marginLG,
24
- marginBlock: token.marginXS
25
- }
26
- },
27
- '&&-size-small &-divider': {
28
- marginBlock: token.marginLG,
29
- marginInline: token.marginXS,
30
- '&-horizontal': {
31
- marginBlock: token.marginXS,
32
- marginInline: token.marginLG
33
- }
34
- }
35
- }
36
- };
37
- };
38
- function useStyle(prefixCls) {
39
- return (0, _provider.useStyle)('ProCardDivider', token => {
40
- const proCardDividerToken = {
41
- ...token,
42
- componentCls: `.${prefixCls}`
43
- };
44
- return [genDividerStyle(proCardDividerToken)];
45
- });
8
+ /**
9
+ * Divider 样式已合并至 ProCard style.ts,此 hook 仅用于获取 hashId 和 wrapSSR
10
+ */
11
+ function useStyle(_prefixCls) {
12
+ return (0, _provider.useStyle)('ProCardDivider', () => ({}));
46
13
  }
@@ -21,6 +21,7 @@ const cardLoading = exports.cardLoading = new _cssinjs.Keyframes('card-loading',
21
21
  const genProStyle = token => {
22
22
  return {
23
23
  [token.componentCls]: {
24
+ boxSizing: 'border-box',
24
25
  '&-loading': {
25
26
  overflow: 'hidden'
26
27
  },
@@ -8,6 +8,7 @@ var _provider = require("../../../provider");
8
8
  const genProStyle = token => {
9
9
  return {
10
10
  [token.componentCls]: {
11
+ boxSizing: 'border-box',
11
12
  display: 'flex',
12
13
  flexDirection: 'column',
13
14
  justifyContent: 'flex-end',
@@ -17,7 +17,7 @@ const Statistic = props => {
17
17
  layout = 'inline',
18
18
  style,
19
19
  description,
20
- children,
20
+ children: _children,
21
21
  title,
22
22
  tip,
23
23
  status,
@@ -8,6 +8,7 @@ var _provider = require("../../../provider");
8
8
  const genProStyle = token => {
9
9
  return {
10
10
  [token.componentCls]: {
11
+ boxSizing: 'border-box',
11
12
  display: 'flex',
12
13
  fontSize: token.fontSize,
13
14
  '& + &': {
@@ -8,6 +8,7 @@ var _provider = require("../../../provider");
8
8
  const genProStyle = token => {
9
9
  return {
10
10
  [token.componentCls]: {
11
+ boxSizing: 'border-box',
11
12
  '&-chart': {
12
13
  display: 'flex',
13
14
  flexDirection: 'column',
@@ -1,15 +1,12 @@
1
1
  import type { TabPaneProps, TabsProps } from 'antd';
2
- import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel';
3
2
  import type { ReactNode } from 'react';
3
+ import type { LabelTooltipType } from '../utils';
4
+ export type { LabelTooltipType };
4
5
  export type Breakpoint = 'xxl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs';
5
6
  export type Gutter = number | Partial<Record<Breakpoint, number>>;
6
7
  export type ColSpanType = number | string;
7
8
  type CollapsibleType = 'icon' | 'header' | boolean;
8
9
  type CardPropsBase = {
9
- /** 标题样式 */
10
- headStyle?: React.CSSProperties;
11
- /** 内容样式 */
12
- bodyStyle?: React.CSSProperties;
13
10
  /** 样式配置 */
14
11
  styles?: {
15
12
  header?: React.CSSProperties;
@@ -93,4 +90,3 @@ export type ProCardTabPaneProps = {
93
90
  cardProps?: CardProps;
94
91
  } & TabPaneProps;
95
92
  export type CardType = React.ForwardRefExoticComponent<CardProps>;
96
- export {};
@@ -1,8 +1,8 @@
1
1
  import type { DescriptionsProps, FormProps } from 'antd';
2
- import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel';
3
2
  import React from 'react';
4
3
  import type { ProFieldFCMode } from '../provider';
5
- import type { ProCoreActionType, ProFieldValueType, ProSchema, ProSchemaComponentTypes, RowEditableConfig, UseEditableMapUtilType } from '../utils';
4
+ import type { ProCoreActionType, ProEllipsis, ProFieldValueType, ProSchema, ProSchemaComponentTypes, RowEditableConfig, UseEditableMapUtilType } from '../utils';
5
+ import { LabelTooltipType } from '../utils';
6
6
  import type { RequestData } from './useFetchData';
7
7
  export interface DescriptionsItemProps {
8
8
  prefixCls?: string;
@@ -31,9 +31,7 @@ export type ProDescriptionsItemProps<T = Record<string, any>, ValueType = 'text'
31
31
  hide?: boolean;
32
32
  plain?: boolean;
33
33
  copyable?: boolean;
34
- ellipsis?: boolean | {
35
- showTitle?: boolean;
36
- };
34
+ ellipsis?: ProEllipsis;
37
35
  mode?: ProFieldFCMode;
38
36
  children?: React.ReactNode;
39
37
  /**
@@ -194,14 +194,14 @@ const schemaToDescriptionsItem = (items, entity, action, editableUtils, emptyTex
194
194
  };
195
195
  }
196
196
  const {
197
- valueEnum,
198
- render,
197
+ valueEnum: _valueEnum,
198
+ render: _render,
199
199
  renderText,
200
200
  mode,
201
- plain,
201
+ plain: _plain,
202
202
  dataIndex,
203
- request,
204
- params,
203
+ request: _request,
204
+ params: _params,
205
205
  editable,
206
206
  ...restItem
207
207
  } = item;
@@ -301,7 +301,7 @@ const ProDescriptions = props => {
301
301
  onLoadingChange,
302
302
  actionRef,
303
303
  onRequestError,
304
- emptyText,
304
+ emptyText: _emptyText,
305
305
  ...rest
306
306
  } = props;
307
307
  const proContext = (0, _react.useContext)(_provider.default);
@@ -77,7 +77,6 @@ const useFetchData = (getData, options) => {
77
77
  return;
78
78
  }
79
79
  fetchList();
80
- // eslint-disable-next-line react-hooks/exhaustive-deps
81
80
  }, [...(effects || []), manual]);
82
81
  return {
83
82
  dataSource: entity,
@@ -134,15 +134,12 @@ const defaultRenderText = (dataValue, valueType, props, valueTypeMap) => {
134
134
  });
135
135
  }
136
136
  }
137
-
138
- // eslint-disable-next-line no-param-reassign
139
137
  delete props.emptyText;
140
138
  if (typeof valueType === 'object') {
141
139
  return defaultRenderTextByObject(dataValue, valueType, props);
142
140
  }
143
141
  const customValueTypeConfig = valueTypeMap && valueTypeMap[valueType];
144
142
  if (customValueTypeConfig) {
145
- // eslint-disable-next-line no-param-reassign
146
143
  delete props.ref;
147
144
  if (mode === 'read') {
148
145
  return customValueTypeConfig.render?.(dataValue, {
@@ -569,7 +566,6 @@ const ProFieldComponent = ({
569
566
  ...(0, _utils.omitUndefined)(restFieldProps),
570
567
  onChange: onChangeCallBack
571
568
  };
572
- // eslint-disable-next-line react-hooks/exhaustive-deps
573
569
  }, [value, restFieldProps, onChangeCallBack]);
574
570
  const renderedDom = defaultRenderText(mode === 'edit' ? fieldProps?.value ?? text ?? '' : text ?? fieldProps?.value ?? '', valueType || 'text', (0, _utils.omitUndefined)({
575
571
  ref,
@@ -59,11 +59,8 @@ const pureRenderText = (dataValue, valueType, props, valueTypeMap) => {
59
59
  });
60
60
  }
61
61
  }
62
-
63
- // eslint-disable-next-line no-param-reassign
64
62
  delete props.emptyText;
65
63
  if (typeof valueType === 'object') {
66
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
67
64
  return pureRenderText(dataValue, valueType.type, {
68
65
  ...valueType,
69
66
  ...props
@@ -71,7 +68,6 @@ const pureRenderText = (dataValue, valueType, props, valueTypeMap) => {
71
68
  }
72
69
  const customValueTypeConfig = valueTypeMap && valueTypeMap[valueType];
73
70
  if (customValueTypeConfig) {
74
- // eslint-disable-next-line no-param-reassign
75
71
  delete props.ref;
76
72
  if (mode === 'read') {
77
73
  const readDom = customValueTypeConfig.render?.(dataValue, {
@@ -136,7 +132,6 @@ const ProFieldComponent = ({
136
132
  ...(0, _utils.omitUndefined)(restFieldProps),
137
133
  onChange: onChangeCallBack
138
134
  };
139
- // eslint-disable-next-line react-hooks/exhaustive-deps
140
135
  }, [value, restFieldProps, onChangeCallBack]);
141
136
  const renderedDom = pureRenderText(mode === 'edit' ? fieldProps?.value ?? text ?? '' : text ?? fieldProps?.value ?? '', valueType || 'text', (0, _utils.omitUndefined)({
142
137
  ref,
@@ -106,14 +106,11 @@ const FieldCheckbox = ({
106
106
  }
107
107
  if (mode === 'edit') {
108
108
  const {
109
- fieldNames,
109
+ fieldNames: _fieldNames,
110
110
  variant,
111
111
  ...restFieldProps
112
112
  } = rest.fieldProps || {};
113
- const dom = wrapSSR(
114
- /*#__PURE__*/
115
- //@ts-ignore
116
- (0, _jsxRuntime.jsx)(_antd.Checkbox.Group, {
113
+ const dom = wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Checkbox.Group, {
117
114
  ...restFieldProps,
118
115
  variant: variant,
119
116
  className: (0, _clsx.clsx)(rest.fieldProps?.className, hashId, `${layoutClassName}-${layout}`, {
@@ -5,6 +5,6 @@ declare const _default: React.ForwardRefExoticComponent<import("../../../provide
5
5
  format?: string | undefined;
6
6
  showTime?: boolean | undefined;
7
7
  variant?: "outlined" | "filled" | "borderless" | "underlined" | undefined;
8
- picker?: "time" | "date" | "month" | "week" | "year" | "quarter" | undefined;
8
+ picker?: "time" | "date" | "month" | "week" | "quarter" | "year" | undefined;
9
9
  } & ProFieldLightProps & React.RefAttributes<any>>;
10
10
  export default _default;
@@ -88,6 +88,7 @@ const FieldDigitRange = ({
88
88
  const placeholderValue = fieldProps?.placeholder || placeholder || [intl.getMessage('tableForm.inputPlaceholder', '请输入'), intl.getMessage('tableForm.inputPlaceholder', '请输入')];
89
89
  const getInputNumberPlaceholder = index => Array.isArray(placeholderValue) ? placeholderValue[index] : placeholderValue;
90
90
  const dom = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Space.Compact, {
91
+ block: true,
91
92
  onBlur: handleGroupBlur,
92
93
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.InputNumber, {
93
94
  ...fieldProps,
@@ -11,17 +11,14 @@ var _provider = require("../../../provider");
11
11
  var _jsxRuntime = require("react/jsx-runtime");
12
12
  const addArrayKeys = doms => doms.map((dom, index) => {
13
13
  if (! /*#__PURE__*/_react.default.isValidElement(dom)) {
14
- // eslint-disable-next-line react/no-array-index-key
15
14
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {
16
15
  children: dom
17
16
  }, index);
18
17
  }
19
18
  return /*#__PURE__*/_react.default.cloneElement(dom, {
20
- // eslint-disable-next-line react/no-array-index-key
21
19
  key: index,
22
20
  ...dom?.props,
23
21
  style: {
24
- // @ts-ignore
25
22
  ...dom?.props?.style
26
23
  }
27
24
  });
@@ -1,7 +1,7 @@
1
1
  /** 获取展示符号 */
2
2
  export declare function getSymbolByRealValue(realValue: number): "-" | "+" | null;
3
3
  /** 获取颜色 */
4
- export declare function getColorByRealValue(realValue: number /** ,color: string */): "#595959" | "#52c41a" | "#ff4d4f";
4
+ export declare function getColorByRealValue(realValue: number /** ,color: string */): "#595959" | "#ff4d4f" | "#52c41a";
5
5
  /** 获取到最后展示的数字 */
6
6
  export declare function getRealTextWithPrecision(realValue: number, precision?: number): string | number;
7
7
  /**
@@ -5,6 +5,6 @@ declare const _default: React.ForwardRefExoticComponent<import("../../../provide
5
5
  format?: string | undefined;
6
6
  variant?: "outlined" | "filled" | "borderless" | "underlined" | undefined;
7
7
  showTime?: boolean | undefined;
8
- picker?: "time" | "date" | "month" | "week" | "year" | "quarter" | undefined;
8
+ picker?: "time" | "date" | "month" | "week" | "quarter" | "year" | undefined;
9
9
  } & ProFieldLightProps & React.RefAttributes<any>>;
10
10
  export default _default;
@@ -40,7 +40,6 @@ const SearchSelect = (props, ref) => {
40
40
  showSearch,
41
41
  fieldNames,
42
42
  defaultSearchValue,
43
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
44
43
  preserveOriginalLabel: _preserveOriginalLabel = false,
45
44
  ...restProps
46
45
  } = props;
@@ -31,7 +31,6 @@ const FieldSwitch = ({
31
31
  const dom = (0, _react.useMemo)(() => {
32
32
  if (text === undefined || text === null || `${text}`.length < 1) return '-';
33
33
  return text ? fieldProps?.checkedChildren ?? intl.getMessage('switch.open', '打开') : fieldProps?.unCheckedChildren ?? intl.getMessage('switch.close', '关闭');
34
- // eslint-disable-next-line react-hooks/exhaustive-deps
35
34
  }, [fieldProps?.checkedChildren, fieldProps?.unCheckedChildren, text]);
36
35
  if (mode === 'read') {
37
36
  if (render) {