@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
@@ -14,10 +14,7 @@ const ProCardActions = props => {
14
14
  if (Array.isArray(actions) && actions?.length) {
15
15
  return wrapSSR( /*#__PURE__*/_jsx("ul", {
16
16
  className: clsx(`${prefixCls}-actions`, hashId),
17
- children: actions.map((action, index) =>
18
- /*#__PURE__*/
19
- // eslint-disable-next-line react/no-array-index-key
20
- _jsx("li", {
17
+ children: actions.map((action, index) => /*#__PURE__*/_jsx("li", {
21
18
  style: {
22
19
  width: `${100 / actions.length}%`,
23
20
  padding: 0,
@@ -16,8 +16,6 @@ const Card = /*#__PURE__*/React.forwardRef((props, ref) => {
16
16
  const {
17
17
  className,
18
18
  style,
19
- bodyStyle,
20
- headStyle,
21
19
  styles,
22
20
  title,
23
21
  subTitle,
@@ -212,23 +210,34 @@ const Card = /*#__PURE__*/React.forwardRef((props, ref) => {
212
210
  [`${prefixCls}-body-direction-column`]: split === 'horizontal' || direction === 'column',
213
211
  [`${prefixCls}-body-wrap`]: wrap && containProCard
214
212
  });
215
-
216
- // 支持新的 styles API,同时保持向后兼容
217
- const cardBodyStyle = styles?.body || bodyStyle;
218
- const cardHeadStyle = styles?.header || headStyle;
213
+ const bodyStylePadding = styles?.body?.padding;
219
214
  const loadingDOM = /*#__PURE__*/React.isValidElement(loading) ? loading : /*#__PURE__*/_jsx(Loading, {
220
215
  prefix: prefixCls,
221
- style: cardBodyStyle?.padding === 0 || cardBodyStyle?.padding === '0px' ? {
216
+ style: bodyStylePadding === 0 || bodyStylePadding === '0px' ? {
222
217
  padding: 24
223
218
  } : undefined
224
219
  });
220
+ const handleCollapsibleIconClick = useCallback(() => {
221
+ if (collapsible === 'icon') setCollapsed(prev => !prev);
222
+ }, [collapsible, setCollapsed]);
223
+
225
224
  // 非受控情况下展示
226
- const collapsibleButton = collapsible && controlCollapsed === undefined && (collapsibleIconRender ? collapsibleIconRender({
227
- collapsed
225
+ const collapsibleButton = collapsible && controlCollapsed === undefined && (collapsibleIconRender ? /*#__PURE__*/_jsx("span", {
226
+ role: "button",
227
+ tabIndex: collapsible === 'icon' ? 0 : undefined,
228
+ className: `${prefixCls}-collapsible-icon ${hashId}`.trim(),
229
+ onClick: collapsible === 'icon' ? handleCollapsibleIconClick : undefined,
230
+ onKeyDown: collapsible === 'icon' ? e => {
231
+ if (e.key === 'Enter' || e.key === ' ') {
232
+ e.preventDefault();
233
+ handleCollapsibleIconClick();
234
+ }
235
+ } : undefined,
236
+ children: collapsibleIconRender({
237
+ collapsed
238
+ })
228
239
  }) : /*#__PURE__*/_jsx(RightOutlined, {
229
- onClick: () => {
230
- if (collapsible === 'icon') setCollapsed(!collapsed);
231
- },
240
+ onClick: handleCollapsibleIconClick,
232
241
  rotate: !collapsed ? 90 : undefined,
233
242
  className: `${prefixCls}-collapsible-icon ${hashId}`.trim()
234
243
  }));
@@ -246,7 +255,7 @@ const Card = /*#__PURE__*/React.forwardRef((props, ref) => {
246
255
  [`${prefixCls}-header-border`]: headerBordered || type === 'inner',
247
256
  [`${prefixCls}-header-collapsible`]: collapsibleButton
248
257
  }),
249
- style: cardHeadStyle,
258
+ style: styles?.header,
250
259
  onClick: () => {
251
260
  if (collapsible === 'header' || collapsible === true) setCollapsed(!collapsed);
252
261
  },
@@ -267,13 +276,12 @@ const Card = /*#__PURE__*/React.forwardRef((props, ref) => {
267
276
  children: /*#__PURE__*/_jsx(Tabs, {
268
277
  onChange: tabs.onChange,
269
278
  ...omit(tabs, ['cardProps']),
270
- // @ts-ignore
271
279
  items: ModifyTabItemsContent,
272
280
  children: loading ? loadingDOM : children
273
281
  })
274
282
  }) : /*#__PURE__*/_jsx("div", {
275
283
  className: bodyCls,
276
- style: cardBodyStyle,
284
+ style: styles?.body,
277
285
  children: loading ? loadingDOM : childrenModified
278
286
  }), actions ? /*#__PURE__*/_jsx(Actions, {
279
287
  actions: actions,
@@ -13,6 +13,9 @@ const genProCardStyle = token => {
13
13
  display: 'flex',
14
14
  flexDirection: 'column',
15
15
  boxSizing: 'border-box',
16
+ '*, *::before, *::after': {
17
+ boxSizing: 'border-box'
18
+ },
16
19
  width: '100%',
17
20
  marginBlock: 0,
18
21
  marginInline: 0,
@@ -29,6 +32,29 @@ const genProCardStyle = token => {
29
32
  '&-col': {
30
33
  width: '100%'
31
34
  },
35
+ // 分割线样式:col 之间的分割线
36
+ [` ${componentCls}-col${componentCls}-split-vertical`]: {
37
+ borderInlineEnd: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`
38
+ },
39
+ [` ${componentCls}-col${componentCls}-split-horizontal`]: {
40
+ borderBlockEnd: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`
41
+ },
42
+ // Divider 分割线组件样式
43
+ [`${componentCls}-divider`]: {
44
+ flex: 'none',
45
+ alignSelf: 'stretch',
46
+ width: token.lineWidth,
47
+ marginInline: token.marginXS,
48
+ marginBlock: token.marginLG,
49
+ backgroundColor: token.colorSplit,
50
+ [`&${componentCls}-divider-horizontal`]: {
51
+ width: 'auto',
52
+ alignSelf: 'auto',
53
+ height: token.lineWidth,
54
+ marginInline: token.marginLG,
55
+ marginBlock: token.marginXS
56
+ }
57
+ },
32
58
  '&-border': {
33
59
  border: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`
34
60
  },
@@ -173,19 +199,19 @@ const genProCardStyle = token => {
173
199
  paddingBlock: token.paddingSM
174
200
  }
175
201
  },
202
+ [` ${componentCls}-divider`]: {
203
+ marginBlock: token.marginLG,
204
+ marginInline: token.marginXS,
205
+ [`&${componentCls}-divider-horizontal`]: {
206
+ marginBlock: token.marginXS,
207
+ marginInline: token.marginLG
208
+ }
209
+ },
176
210
  [`${componentCls}-header${componentCls}-header-collapsible`]: {
177
211
  paddingBlock: token.paddingXS
178
212
  }
179
213
  }
180
214
  },
181
- [`${componentCls}-col`]: {
182
- [`&${componentCls}-split-vertical`]: {
183
- borderInlineEnd: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`
184
- },
185
- [`&${componentCls}-split-horizontal`]: {
186
- borderBlockEnd: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`
187
- }
188
- },
189
215
  [`${componentCls}-tabs`]: {
190
216
  [`${token.antCls}-tabs-top > ${token.antCls}-tabs-nav`]: {
191
217
  marginBlockEnd: 0,
@@ -160,9 +160,7 @@ const CheckCardGroup = props => {
160
160
  };
161
161
  const children = useMemo(() => {
162
162
  if (loading) {
163
- return new Array(options.length || React.Children.toArray(props.children).length || 1).fill(0)
164
- // eslint-disable-next-line react/no-array-index-key
165
- .map((_, index) => /*#__PURE__*/_jsx(CheckCard, {
163
+ return new Array(options.length || React.Children.toArray(props.children).length || 1).fill(0).map((_, index) => /*#__PURE__*/_jsx(CheckCard, {
166
164
  loading: true
167
165
  }, index));
168
166
  }
@@ -42,7 +42,6 @@ const CheckCard = props => {
42
42
  useEffect(() => {
43
43
  checkCardGroup?.registerValue?.(props.value);
44
44
  return () => checkCardGroup?.cancelValue?.(props.value);
45
- // eslint-disable-next-line react-hooks/exhaustive-deps
46
45
  }, [props.value]);
47
46
  const {
48
47
  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;
@@ -16,10 +16,10 @@ const ProCardDivider = props => {
16
16
  const {
17
17
  className,
18
18
  style = {},
19
- type
19
+ orientation = 'vertical'
20
20
  } = props;
21
21
  const classString = clsx(prefixCls, className, hashId, {
22
- [`${prefixCls}-${type}`]: type
22
+ [`${prefixCls}-${orientation}`]: orientation
23
23
  });
24
24
  return wrapSSR( /*#__PURE__*/_jsx("div", {
25
25
  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
  };
@@ -1,41 +1,8 @@
1
1
  import { useStyle as useAntdStyle } from "../../../provider";
2
- const genDividerStyle = token => {
3
- const {
4
- componentCls
5
- } = token;
6
- return {
7
- [componentCls]: {
8
- boxSizing: 'border-box',
9
- '&-divider': {
10
- flex: 'none',
11
- width: token.lineWidth,
12
- marginInline: token.marginXS,
13
- marginBlock: token.marginLG,
14
- backgroundColor: token.colorSplit,
15
- '&-horizontal': {
16
- width: 'initial',
17
- height: token.lineWidth,
18
- marginInline: token.marginLG,
19
- marginBlock: token.marginXS
20
- }
21
- },
22
- '&&-size-small &-divider': {
23
- marginBlock: token.marginLG,
24
- marginInline: token.marginXS,
25
- '&-horizontal': {
26
- marginBlock: token.marginXS,
27
- marginInline: token.marginLG
28
- }
29
- }
30
- }
31
- };
32
- };
33
- export default function useStyle(prefixCls) {
34
- return useAntdStyle('ProCardDivider', token => {
35
- const proCardDividerToken = {
36
- ...token,
37
- componentCls: `.${prefixCls}`
38
- };
39
- return [genDividerStyle(proCardDividerToken)];
40
- });
2
+
3
+ /**
4
+ * Divider 样式已合并至 ProCard style.ts,此 hook 仅用于获取 hashId 和 wrapSSR
5
+ */
6
+ export default function useStyle(_prefixCls) {
7
+ return useAntdStyle('ProCardDivider', () => ({}));
41
8
  }
@@ -12,7 +12,7 @@ const Statistic = props => {
12
12
  layout = 'inline',
13
13
  style,
14
14
  description,
15
- children,
15
+ children: _children,
16
16
  title,
17
17
  tip,
18
18
  status,
@@ -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
  /**
@@ -187,14 +187,14 @@ const schemaToDescriptionsItem = (items, entity, action, editableUtils, emptyTex
187
187
  };
188
188
  }
189
189
  const {
190
- valueEnum,
191
- render,
190
+ valueEnum: _valueEnum,
191
+ render: _render,
192
192
  renderText,
193
193
  mode,
194
- plain,
194
+ plain: _plain,
195
195
  dataIndex,
196
- request,
197
- params,
196
+ request: _request,
197
+ params: _params,
198
198
  editable,
199
199
  ...restItem
200
200
  } = item;
@@ -294,7 +294,7 @@ const ProDescriptions = props => {
294
294
  onLoadingChange,
295
295
  actionRef,
296
296
  onRequestError,
297
- emptyText,
297
+ emptyText: _emptyText,
298
298
  ...rest
299
299
  } = props;
300
300
  const proContext = useContext(ProConfigContext);
@@ -71,7 +71,6 @@ const useFetchData = (getData, options) => {
71
71
  return;
72
72
  }
73
73
  fetchList();
74
- // eslint-disable-next-line react-hooks/exhaustive-deps
75
74
  }, [...(effects || []), manual]);
76
75
  return {
77
76
  dataSource: entity,
@@ -127,15 +127,12 @@ export const defaultRenderText = (dataValue, valueType, props, valueTypeMap) =>
127
127
  });
128
128
  }
129
129
  }
130
-
131
- // eslint-disable-next-line no-param-reassign
132
130
  delete props.emptyText;
133
131
  if (typeof valueType === 'object') {
134
132
  return defaultRenderTextByObject(dataValue, valueType, props);
135
133
  }
136
134
  const customValueTypeConfig = valueTypeMap && valueTypeMap[valueType];
137
135
  if (customValueTypeConfig) {
138
- // eslint-disable-next-line no-param-reassign
139
136
  delete props.ref;
140
137
  if (mode === 'read') {
141
138
  return customValueTypeConfig.render?.(dataValue, {
@@ -561,7 +558,6 @@ const ProFieldComponent = ({
561
558
  ...omitUndefined(restFieldProps),
562
559
  onChange: onChangeCallBack
563
560
  };
564
- // eslint-disable-next-line react-hooks/exhaustive-deps
565
561
  }, [value, restFieldProps, onChangeCallBack]);
566
562
  const renderedDom = defaultRenderText(mode === 'edit' ? fieldProps?.value ?? text ?? '' : text ?? fieldProps?.value ?? '', valueType || 'text', omitUndefined({
567
563
  ref,
@@ -52,11 +52,8 @@ export const pureRenderText = (dataValue, valueType, props, valueTypeMap) => {
52
52
  });
53
53
  }
54
54
  }
55
-
56
- // eslint-disable-next-line no-param-reassign
57
55
  delete props.emptyText;
58
56
  if (typeof valueType === 'object') {
59
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
60
57
  return pureRenderText(dataValue, valueType.type, {
61
58
  ...valueType,
62
59
  ...props
@@ -64,7 +61,6 @@ export const pureRenderText = (dataValue, valueType, props, valueTypeMap) => {
64
61
  }
65
62
  const customValueTypeConfig = valueTypeMap && valueTypeMap[valueType];
66
63
  if (customValueTypeConfig) {
67
- // eslint-disable-next-line no-param-reassign
68
64
  delete props.ref;
69
65
  if (mode === 'read') {
70
66
  const readDom = customValueTypeConfig.render?.(dataValue, {
@@ -129,7 +125,6 @@ const ProFieldComponent = ({
129
125
  ...omitUndefined(restFieldProps),
130
126
  onChange: onChangeCallBack
131
127
  };
132
- // eslint-disable-next-line react-hooks/exhaustive-deps
133
128
  }, [value, restFieldProps, onChangeCallBack]);
134
129
  const renderedDom = pureRenderText(mode === 'edit' ? fieldProps?.value ?? text ?? '' : text ?? fieldProps?.value ?? '', valueType || 'text', omitUndefined({
135
130
  ref,
@@ -100,14 +100,11 @@ const FieldCheckbox = ({
100
100
  }
101
101
  if (mode === 'edit') {
102
102
  const {
103
- fieldNames,
103
+ fieldNames: _fieldNames,
104
104
  variant,
105
105
  ...restFieldProps
106
106
  } = rest.fieldProps || {};
107
- const dom = wrapSSR(
108
- /*#__PURE__*/
109
- //@ts-ignore
110
- _jsx(Checkbox.Group, {
107
+ const dom = wrapSSR( /*#__PURE__*/_jsx(Checkbox.Group, {
111
108
  ...restFieldProps,
112
109
  variant: variant,
113
110
  className: 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;
@@ -82,6 +82,7 @@ const FieldDigitRange = ({
82
82
  const placeholderValue = fieldProps?.placeholder || placeholder || [intl.getMessage('tableForm.inputPlaceholder', '请输入'), intl.getMessage('tableForm.inputPlaceholder', '请输入')];
83
83
  const getInputNumberPlaceholder = index => Array.isArray(placeholderValue) ? placeholderValue[index] : placeholderValue;
84
84
  const dom = /*#__PURE__*/_jsxs(Space.Compact, {
85
+ block: true,
85
86
  onBlur: handleGroupBlur,
86
87
  children: [/*#__PURE__*/_jsx(InputNumber, {
87
88
  ...fieldProps,
@@ -5,17 +5,14 @@ import { jsx as _jsx } from "react/jsx-runtime";
5
5
  import { Fragment as _Fragment } from "react/jsx-runtime";
6
6
  const addArrayKeys = doms => doms.map((dom, index) => {
7
7
  if (! /*#__PURE__*/React.isValidElement(dom)) {
8
- // eslint-disable-next-line react/no-array-index-key
9
8
  return /*#__PURE__*/_jsx(React.Fragment, {
10
9
  children: dom
11
10
  }, index);
12
11
  }
13
12
  return /*#__PURE__*/React.cloneElement(dom, {
14
- // eslint-disable-next-line react/no-array-index-key
15
13
  key: index,
16
14
  ...dom?.props,
17
15
  style: {
18
- // @ts-ignore
19
16
  ...dom?.props?.style
20
17
  }
21
18
  });
@@ -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 */): "#52c41a" | "#595959" | "#ff4d4f";
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;
@@ -33,7 +33,6 @@ const SearchSelect = (props, ref) => {
33
33
  showSearch,
34
34
  fieldNames,
35
35
  defaultSearchValue,
36
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
37
36
  preserveOriginalLabel: _preserveOriginalLabel = false,
38
37
  ...restProps
39
38
  } = props;
@@ -25,7 +25,6 @@ const FieldSwitch = ({
25
25
  const dom = useMemo(() => {
26
26
  if (text === undefined || text === null || `${text}`.length < 1) return '-';
27
27
  return text ? fieldProps?.checkedChildren ?? intl.getMessage('switch.open', '打开') : fieldProps?.unCheckedChildren ?? intl.getMessage('switch.close', '关闭');
28
- // eslint-disable-next-line react-hooks/exhaustive-deps
29
28
  }, [fieldProps?.checkedChildren, fieldProps?.unCheckedChildren, text]);
30
29
  if (mode === 'read') {
31
30
  if (render) {
@@ -27,7 +27,10 @@ const FieldText = ({
27
27
  useImperativeHandle(ref, () => inputRef.current, []);
28
28
  useEffect(() => {
29
29
  if (autoFocus) {
30
- inputRef.current?.focus();
30
+ // 使用 queueMicrotask 延迟 focus 调用,避免在渲染期间触发 flushSync
31
+ queueMicrotask(() => {
32
+ inputRef.current?.focus();
33
+ });
31
34
  }
32
35
  }, [autoFocus]);
33
36
  if (mode === 'read') {
@@ -1,4 +1,3 @@
1
- /* eslint-disable react-hooks/exhaustive-deps */
2
1
  import { get, set as namePathSet, omit, set, useControlledState, warning } from '@rc-component/util';
3
2
  import { useUrlSearchParams } from '@umijs/use-params';
4
3
  import { ConfigProvider, Form, Spin } from 'antd';
@@ -241,7 +240,6 @@ function BaseFormComponents(props) {
241
240
  const isEqual = isDeepEqualReact(props.initialValues, preInitialValues);
242
241
  noteOnce(isEqual, `initialValues 只在 form 初始化时生效,如果你需要异步加载推荐使用 request,或者 initialValues ? <Form/> : null `);
243
242
  noteOnce(isEqual, `The initialValues only take effect when the form is initialized, if you need to load asynchronously recommended request, or the initialValues ? <Form/> : null `);
244
- // eslint-disable-next-line react-hooks/exhaustive-deps
245
243
  }, [props.initialValues]);
246
244
 
247
245
  // 初始化给一个默认的 form
@@ -488,7 +486,6 @@ export function BaseForm(props) {
488
486
  useEffect(() => {
489
487
  if (!syncToUrl) return;
490
488
  setUrlSearch(genParams(syncToUrl, getGenParams(), 'set'));
491
- // eslint-disable-next-line react-hooks/exhaustive-deps
492
489
  }, [extraUrlParams, getGenParams, syncToUrl]);
493
490
  const getPopupContainer = useMemo(() => {
494
491
  if (typeof window === 'undefined') return undefined;
@@ -1,7 +1,8 @@
1
+ import type { SizeType as AntdSizeType } from 'antd/lib/config-provider/SizeContext';
1
2
  import type { TooltipPlacement } from 'antd/lib/tooltip';
2
3
  import React from 'react';
3
4
  import type { LightFilterFooterRender } from '../../typing';
4
- export type SizeType = 'small' | 'middle' | 'large' | undefined;
5
+ export type SizeType = AntdSizeType;
5
6
  export type LightWrapperProps = {
6
7
  label?: React.ReactNode;
7
8
  disabled?: boolean;
@@ -32,7 +32,6 @@ const BaseProFormCaptcha = /*#__PURE__*/React.forwardRef((props, ref) => {
32
32
  } catch (error) {
33
33
  setTiming(false);
34
34
  setLoading(false);
35
- // eslint-disable-next-line no-console
36
35
  console.log(error);
37
36
  }
38
37
  };
@@ -64,7 +63,6 @@ const BaseProFormCaptcha = /*#__PURE__*/React.forwardRef((props, ref) => {
64
63
  }, 1000);
65
64
  }
66
65
  return () => clearInterval(interval);
67
- // eslint-disable-next-line react-hooks/exhaustive-deps
68
66
  }, [timing]);
69
67
  useEffect(() => {
70
68
  if (onTiming) {
@@ -104,7 +102,6 @@ const BaseProFormCaptcha = /*#__PURE__*/React.forwardRef((props, ref) => {
104
102
  await onGetCaptcha('');
105
103
  }
106
104
  } catch (error) {
107
- // eslint-disable-next-line no-console
108
105
  console.log(error);
109
106
  }
110
107
  },
@@ -1,3 +1,4 @@
1
+ import { omit } from '@rc-component/util';
1
2
  import { Checkbox } from 'antd';
2
3
  import React from 'react';
3
4
  import { FieldCheckbox } from "../../../field";
@@ -66,9 +67,12 @@ const ProFormCheckboxComponents = /*#__PURE__*/React.forwardRef(({
66
67
  fieldProps,
67
68
  children
68
69
  }, ref) => {
70
+ const {
71
+ ...restFieldProps
72
+ } = fieldProps || {};
69
73
  return /*#__PURE__*/_jsx(Checkbox, {
70
74
  ref: ref,
71
- ...fieldProps,
75
+ ...omit(restFieldProps, ['allowClear']),
72
76
  children: children
73
77
  });
74
78
  });
@@ -8,7 +8,5 @@ ExportComponent.Week = ProFormDatePickerWeek;
8
8
  ExportComponent.Month = ProFormDatePickerMonth;
9
9
  ExportComponent.Quarter = ProFormDatePickerQuarter;
10
10
  ExportComponent.Year = ProFormDatePickerYear;
11
- // @ts-ignore
12
- // eslint-disable-next-line no-param-reassign
13
11
  ExportComponent.displayName = 'ProFormComponent';
14
12
  export default ExportComponent;
@@ -83,12 +83,22 @@ const FieldSet = props => {
83
83
  } = useGridHelpers(rest);
84
84
  const Wrapper = useCallback(({
85
85
  children: dom
86
- }) => /*#__PURE__*/_jsx(Components, {
87
- ...space,
88
- align: "start",
89
- wrap: true,
90
- children: dom
91
- }), [Components, space]);
86
+ }) => {
87
+ // 从 space props 中提取 wrap,如果未定义则不传递
88
+ const spacePropsWithWrap = {
89
+ ...space,
90
+ align: 'start'
91
+ };
92
+
93
+ // 只有当 space 中明确定义了 wrap 时才传递,否则使用组件默认行为
94
+ if (type === 'space' && space?.wrap !== undefined) {
95
+ spacePropsWithWrap.wrap = space.wrap;
96
+ }
97
+ return /*#__PURE__*/_jsx(Components, {
98
+ ...spacePropsWithWrap,
99
+ children: dom
100
+ });
101
+ }, [Components, space, type]);
92
102
  return /*#__PURE__*/_jsx(RowWrapper, {
93
103
  Wrapper: Wrapper,
94
104
  children: list