@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
@@ -5,43 +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
- boxSizing: 'border-box',
15
- '&-divider': {
16
- flex: 'none',
17
- width: token.lineWidth,
18
- marginInline: token.marginXS,
19
- marginBlock: token.marginLG,
20
- backgroundColor: token.colorSplit,
21
- '&-horizontal': {
22
- width: 'initial',
23
- height: token.lineWidth,
24
- marginInline: token.marginLG,
25
- marginBlock: token.marginXS
26
- }
27
- },
28
- '&&-size-small &-divider': {
29
- marginBlock: token.marginLG,
30
- marginInline: token.marginXS,
31
- '&-horizontal': {
32
- marginBlock: token.marginXS,
33
- marginInline: token.marginLG
34
- }
35
- }
36
- }
37
- };
38
- };
39
- function useStyle(prefixCls) {
40
- return (0, _provider.useStyle)('ProCardDivider', token => {
41
- const proCardDividerToken = {
42
- ...token,
43
- componentCls: `.${prefixCls}`
44
- };
45
- return [genDividerStyle(proCardDividerToken)];
46
- });
8
+ /**
9
+ * Divider 样式已合并至 ProCard style.ts,此 hook 仅用于获取 hashId 和 wrapSSR
10
+ */
11
+ function useStyle(_prefixCls) {
12
+ return (0, _provider.useStyle)('ProCardDivider', () => ({}));
47
13
  }
@@ -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,
@@ -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) {
@@ -32,7 +32,10 @@ const FieldText = ({
32
32
  (0, _react.useImperativeHandle)(ref, () => inputRef.current, []);
33
33
  (0, _react.useEffect)(() => {
34
34
  if (autoFocus) {
35
- inputRef.current?.focus();
35
+ // 使用 queueMicrotask 延迟 focus 调用,避免在渲染期间触发 flushSync
36
+ queueMicrotask(() => {
37
+ inputRef.current?.focus();
38
+ });
36
39
  }
37
40
  }, [autoFocus]);
38
41
  if (mode === 'read') {
@@ -19,8 +19,6 @@ var _helpers = require("../helpers");
19
19
  var _EditOrReadOnlyContext = require("./EditOrReadOnlyContext");
20
20
  var _Submitter = _interopRequireDefault(require("./Submitter"));
21
21
  var _jsxRuntime = require("react/jsx-runtime");
22
- /* eslint-disable react-hooks/exhaustive-deps */
23
-
24
22
  const {
25
23
  noteOnce
26
24
  } = _util.warning;
@@ -249,7 +247,6 @@ function BaseFormComponents(props) {
249
247
  const isEqual = (0, _utils.isDeepEqualReact)(props.initialValues, preInitialValues);
250
248
  noteOnce(isEqual, `initialValues 只在 form 初始化时生效,如果你需要异步加载推荐使用 request,或者 initialValues ? <Form/> : null `);
251
249
  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 `);
252
- // eslint-disable-next-line react-hooks/exhaustive-deps
253
250
  }, [props.initialValues]);
254
251
 
255
252
  // 初始化给一个默认的 form
@@ -496,7 +493,6 @@ function BaseForm(props) {
496
493
  (0, _react.useEffect)(() => {
497
494
  if (!syncToUrl) return;
498
495
  setUrlSearch(genParams(syncToUrl, getGenParams(), 'set'));
499
- // eslint-disable-next-line react-hooks/exhaustive-deps
500
496
  }, [extraUrlParams, getGenParams, syncToUrl]);
501
497
  const getPopupContainer = (0, _react.useMemo)(() => {
502
498
  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;
@@ -38,7 +38,6 @@ const BaseProFormCaptcha = /*#__PURE__*/_react.default.forwardRef((props, ref) =
38
38
  } catch (error) {
39
39
  setTiming(false);
40
40
  setLoading(false);
41
- // eslint-disable-next-line no-console
42
41
  console.log(error);
43
42
  }
44
43
  };
@@ -70,7 +69,6 @@ const BaseProFormCaptcha = /*#__PURE__*/_react.default.forwardRef((props, ref) =
70
69
  }, 1000);
71
70
  }
72
71
  return () => clearInterval(interval);
73
- // eslint-disable-next-line react-hooks/exhaustive-deps
74
72
  }, [timing]);
75
73
  (0, _react.useEffect)(() => {
76
74
  if (onTiming) {
@@ -110,7 +108,6 @@ const BaseProFormCaptcha = /*#__PURE__*/_react.default.forwardRef((props, ref) =
110
108
  await onGetCaptcha('');
111
109
  }
112
110
  } catch (error) {
113
- // eslint-disable-next-line no-console
114
111
  console.log(error);
115
112
  }
116
113
  },
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
+ var _util = require("@rc-component/util");
8
9
  var _antd = require("antd");
9
10
  var _react = _interopRequireDefault(require("react"));
10
11
  var _field = require("../../../field");
@@ -73,9 +74,12 @@ const ProFormCheckboxComponents = /*#__PURE__*/_react.default.forwardRef(({
73
74
  fieldProps,
74
75
  children
75
76
  }, ref) => {
77
+ const {
78
+ ...restFieldProps
79
+ } = fieldProps || {};
76
80
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Checkbox, {
77
81
  ref: ref,
78
- ...fieldProps,
82
+ ...(0, _util.omit)(restFieldProps, ['allowClear']),
79
83
  children: children
80
84
  });
81
85
  });
@@ -15,7 +15,5 @@ ExportComponent.Week = _WeekPicker.default;
15
15
  ExportComponent.Month = _MonthPicker.default;
16
16
  ExportComponent.Quarter = _QuarterPicker.default;
17
17
  ExportComponent.Year = _YearPicker.default;
18
- // @ts-ignore
19
- // eslint-disable-next-line no-param-reassign
20
18
  ExportComponent.displayName = 'ProFormComponent';
21
19
  var _default = exports.default = ExportComponent;
@@ -92,12 +92,22 @@ const FieldSet = props => {
92
92
  } = (0, _helpers.useGridHelpers)(rest);
93
93
  const Wrapper = (0, _react.useCallback)(({
94
94
  children: dom
95
- }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(Components, {
96
- ...space,
97
- align: "start",
98
- wrap: true,
99
- children: dom
100
- }), [Components, space]);
95
+ }) => {
96
+ // 从 space props 中提取 wrap,如果未定义则不传递
97
+ const spacePropsWithWrap = {
98
+ ...space,
99
+ align: 'start'
100
+ };
101
+
102
+ // 只有当 space 中明确定义了 wrap 时才传递,否则使用组件默认行为
103
+ if (type === 'space' && space?.wrap !== undefined) {
104
+ spacePropsWithWrap.wrap = space.wrap;
105
+ }
106
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Components, {
107
+ ...spacePropsWithWrap,
108
+ children: dom
109
+ });
110
+ }, [Components, space, type]);
101
111
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(RowWrapper, {
102
112
  Wrapper: Wrapper,
103
113
  children: list
@@ -19,8 +19,8 @@ const FormItemProvide = exports.FormItemProvide = /*#__PURE__*/_react.default.cr
19
19
  /**
20
20
  * 把value扔给 fieldProps,方便给自定义用
21
21
  *
22
- * @param param0
23
22
  * @returns
23
+ * @param formFieldProps
24
24
  */
25
25
  const WithValueFomFiledProps = formFieldProps => {
26
26
  const {
@@ -90,11 +90,14 @@ const WithValueFomFiledProps = formFieldProps => {
90
90
  [valuePropName]: formFieldProps[valuePropName],
91
91
  ...filedChildren.props,
92
92
  onChange: finalChange,
93
- fieldProps: {
94
- ...filedChildren.props?.fieldProps,
95
- ...fieldPropsFromRest,
96
- ...fieldProps
97
- },
93
+ // 只有当子组件是 ProFormComponent 时才传递 fieldProps,避免传递给原生 DOM 元素
94
+ ...(!isProFormComponent && fieldProps ? {
95
+ fieldProps: {
96
+ ...filedChildren.props?.fieldProps,
97
+ ...fieldPropsFromRest,
98
+ ...fieldProps
99
+ }
100
+ } : {}),
98
101
  ...(variantFromRest !== undefined && {
99
102
  variant: variantFromRest
100
103
  }),
@@ -173,7 +176,6 @@ const WarpFormItem = ({
173
176
  getValueProps: getValuePropsFunc,
174
177
  children: children
175
178
  });
176
- // eslint-disable-next-line react-hooks/exhaustive-deps
177
179
  }, [addonAfter, addonBefore, children, convertValue?.toString(), props]);
178
180
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(FormItemProvide.Provider, {
179
181
  value: {
@@ -47,8 +47,6 @@ const ignoreWidthValueType = ['switch', 'radioButton', 'radio', 'rate'];
47
47
  */
48
48
  function warpField(Field, config) {
49
49
  // 标记是否是 ProForm 的组件
50
- // @ts-ignore
51
- // eslint-disable-next-line no-param-reassign
52
50
  Field.displayName = 'ProFormComponent';
53
51
  const FieldWithContext = props => {
54
52
  const {
@@ -108,9 +106,7 @@ function warpField(Field, config) {
108
106
  formItemProps: getFormItemProps?.(),
109
107
  fieldProps: getFieldProps?.()
110
108
  };
111
- },
112
- // eslint-disable-next-line react-hooks/exhaustive-deps
113
- [getFieldProps, getFormItemProps, rest.dependenciesValues, onlyChange]);
109
+ }, [getFieldProps, getFormItemProps, rest.dependenciesValues, onlyChange]);
114
110
  const fieldProps = (0, _utils.useDeepCompareMemo)(() => {
115
111
  const newFieldProps = {
116
112
  ...(ignoreFormItem ? (0, _utils.omitUndefined)({
@@ -152,8 +148,6 @@ function warpField(Field, config) {
152
148
  if (Array.isArray(prefixName) && name) name = `${prefixName.join('.')}.${name}`;
153
149
  const key = name && `form-${contextValue.formKey ?? ''}-field-${name}`;
154
150
  return key;
155
-
156
- // eslint-disable-next-line react-hooks/exhaustive-deps
157
151
  }, [(0, _utils.stringify)(otherProps?.name), prefixName, contextValue.formKey]);
158
152
  const onChange = (0, _utils.useRefFunction)((...restParams) => {
159
153
  if (getFormItemProps || getFieldProps) {
@@ -170,7 +164,6 @@ function warpField(Field, config) {
170
164
  };
171
165
  if (isIgnoreWidth) Reflect.deleteProperty(newStyle, 'width');
172
166
  return (0, _utils.omitUndefined)(newStyle);
173
- // eslint-disable-next-line react-hooks/exhaustive-deps
174
167
  }, [(0, _utils.stringify)(fieldProps?.style), contextValue.grid, isIgnoreWidth, width]);
175
168
  const className = (0, _utils.useDeepCompareMemo)(() => {
176
169
  const isSizeEnum = width && WIDTH_SIZE_ENUM[width];
@@ -200,15 +193,12 @@ function warpField(Field, config) {
200
193
  };
201
194
  }, [allowClear, className, onChange, fieldProps, style]);
202
195
  const field = (0, _utils.useDeepCompareMemo)(() => {
203
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(Field
204
- // @ts-ignore
205
- , {
196
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Field, {
206
197
  ...rest,
207
198
  fieldProps: fieldFieldProps,
208
199
  proFieldProps: fieldProFieldProps,
209
200
  ref: props?.fieldRef
210
201
  }, props.proFormFieldKey || props.name);
211
- // eslint-disable-next-line react-hooks/exhaustive-deps
212
202
  }, [fieldProFieldProps, fieldFieldProps, rest]);
213
203
 
214
204
  // 使用useMemo包裹避免不必要的re-render
@@ -219,9 +209,7 @@ function warpField(Field, config) {
219
209
  , {
220
210
  label: label && proFieldProps?.light !== true ? label : undefined,
221
211
  tooltip: proFieldProps?.light !== true && tooltip,
222
- valuePropName: valuePropName
223
- // @ts-ignore
224
- ,
212
+ valuePropName: valuePropName,
225
213
  ...otherProps,
226
214
  ignoreFormItem: ignoreFormItem,
227
215
  transform: transform,
@@ -1,9 +1,9 @@
1
1
  import type { ColProps } from 'antd';
2
- import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel';
3
2
  import type { FormListFieldData, FormListOperation, FormListProps } from 'antd/lib/form/FormList';
4
3
  import type { NamePath } from 'antd/lib/form/interface';
5
4
  import type { ReactNode } from 'react';
6
5
  import React from 'react';
6
+ import type { LabelTooltipType } from '../../../utils';
7
7
  import type { ProFormGridConfig } from '../../typing';
8
8
  import type { ChildrenItemFunction, FormListActionGuard, ProFromListCommonProps } from './ListItem';
9
9
  declare const FormListContext: React.Context<Record<string, any> | (FormListFieldData & {
@@ -99,8 +99,6 @@ function ProFormList(props) {
99
99
  }
100
100
  return [listContext.name, rest.name].flat(1);
101
101
  }, [listContext.name, rest.name]);
102
-
103
- // eslint-disable-next-line react-hooks/exhaustive-deps
104
102
  (0, _react.useImperativeHandle)(actionRef, () => ({
105
103
  ...actionRefs.current,
106
104
  get: index => {
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
+ var _util = require("@rc-component/util");
8
9
  var _antd = require("antd");
9
10
  var _react = _interopRequireDefault(require("react"));
10
11
  var _Radio = _interopRequireDefault(require("../../../field/components/Radio"));
@@ -77,8 +78,11 @@ const ProFormRadioComponents = /*#__PURE__*/_react.default.forwardRef(({
77
78
  fieldProps,
78
79
  children
79
80
  }, ref) => {
81
+ const {
82
+ ...restFieldProps
83
+ } = fieldProps || {};
80
84
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Radio, {
81
- ...fieldProps,
85
+ ...(0, _util.omit)(restFieldProps, ['allowClear']),
82
86
  ref: ref,
83
87
  children: children
84
88
  });
@@ -90,8 +94,5 @@ const ProFormRadio = (0, _warpField.default)?.(ProFormRadioComponents, {
90
94
  const WrappedProFormRadio = ProFormRadio;
91
95
  WrappedProFormRadio.Group = RadioGroup;
92
96
  WrappedProFormRadio.Button = _antd.Radio.Button;
93
-
94
- // @ts-ignore
95
- // eslint-disable-next-line no-param-reassign
96
97
  WrappedProFormRadio.displayName = 'ProFormComponent';
97
98
  var _default = exports.default = WrappedProFormRadio;
@@ -145,7 +145,6 @@ function BetaSchemaForm(props) {
145
145
  // like StepsForm's columns but not only for StepsForm
146
146
  if (columns.length && Array.isArray(columns[0])) return;
147
147
  return genItems(columns);
148
- // eslint-disable-next-line react-hooks/exhaustive-deps
149
148
  }, [columns, restProps?.open, action, type, formDomsDeps, formRef.current]);
150
149
 
151
150
  /**
@@ -31,7 +31,6 @@ const StepsForm = ({
31
31
  return steps?.map((step, index) => /*#__PURE__*/(0, _react.createElement)(_index.default, {
32
32
  grid: grid,
33
33
  ...step,
34
- // eslint-disable-next-line react/no-array-index-key
35
34
  key: index,
36
35
  layoutType: "StepForm",
37
36
  columns: columns[index]
@@ -127,6 +127,5 @@ const WrappedProFormSelect = ProFormSelect;
127
127
  WrappedProFormSelect.SearchSelect = ProFormSearchSelect;
128
128
 
129
129
  // @ts-ignore
130
- // eslint-disable-next-line no-param-reassign
131
130
  WrappedProFormSelect.displayName = 'ProFormComponent';
132
131
  var _default = exports.default = WrappedProFormSelect;
@@ -159,8 +159,5 @@ const Password = ({
159
159
  };
160
160
  const WrappedProFormText = ProFormText;
161
161
  WrappedProFormText.Password = Password;
162
-
163
- // @ts-ignore
164
- // eslint-disable-next-line no-param-reassign
165
162
  WrappedProFormText.displayName = 'ProFormComponent';
166
163
  var _default = exports.default = WrappedProFormText;
@@ -76,8 +76,10 @@ const BaseProFormUploadButton = /*#__PURE__*/_react.default.forwardRef(({
76
76
  children: [icon, title]
77
77
  }))
78
78
  }), previewImage && /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Image, {
79
- wrapperStyle: {
80
- display: 'none'
79
+ styles: {
80
+ root: {
81
+ display: 'none'
82
+ }
81
83
  },
82
84
  ...imageProps,
83
85
  preview: {
@@ -37,7 +37,6 @@ const BaseProFormUploadDragger = /*#__PURE__*/_react.default.forwardRef(({
37
37
  // 如果配置了 max ,并且 超过了文件列表的大小,就不展示按钮
38
38
  const showUploadButton = (max === undefined || !value || value?.length < max) && mode !== 'read' && proFieldProps?.readonly !== true;
39
39
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Upload.Dragger, {
40
- // @ts-ignore
41
40
  ref: ref,
42
41
  name: "files",
43
42
  action: action,