@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,8 +14,8 @@ const FormItemProvide = /*#__PURE__*/React.createContext({});
14
14
  /**
15
15
  * 把value扔给 fieldProps,方便给自定义用
16
16
  *
17
- * @param param0
18
17
  * @returns
18
+ * @param formFieldProps
19
19
  */
20
20
  const WithValueFomFiledProps = formFieldProps => {
21
21
  const {
@@ -85,11 +85,14 @@ const WithValueFomFiledProps = formFieldProps => {
85
85
  [valuePropName]: formFieldProps[valuePropName],
86
86
  ...filedChildren.props,
87
87
  onChange: finalChange,
88
- fieldProps: {
89
- ...filedChildren.props?.fieldProps,
90
- ...fieldPropsFromRest,
91
- ...fieldProps
92
- },
88
+ // 只有当子组件是 ProFormComponent 时才传递 fieldProps,避免传递给原生 DOM 元素
89
+ ...(!isProFormComponent && fieldProps ? {
90
+ fieldProps: {
91
+ ...filedChildren.props?.fieldProps,
92
+ ...fieldPropsFromRest,
93
+ ...fieldProps
94
+ }
95
+ } : {}),
93
96
  ...(variantFromRest !== undefined && {
94
97
  variant: variantFromRest
95
98
  }),
@@ -168,7 +171,6 @@ const WarpFormItem = ({
168
171
  getValueProps: getValuePropsFunc,
169
172
  children: children
170
173
  });
171
- // eslint-disable-next-line react-hooks/exhaustive-deps
172
174
  }, [addonAfter, addonBefore, children, convertValue?.toString(), props]);
173
175
  return /*#__PURE__*/_jsx(FormItemProvide.Provider, {
174
176
  value: {
@@ -38,8 +38,6 @@ const ignoreWidthValueType = ['switch', 'radioButton', 'radio', 'rate'];
38
38
  */
39
39
  export function warpField(Field, config) {
40
40
  // 标记是否是 ProForm 的组件
41
- // @ts-ignore
42
- // eslint-disable-next-line no-param-reassign
43
41
  Field.displayName = 'ProFormComponent';
44
42
  const FieldWithContext = props => {
45
43
  const {
@@ -99,9 +97,7 @@ export function warpField(Field, config) {
99
97
  formItemProps: getFormItemProps?.(),
100
98
  fieldProps: getFieldProps?.()
101
99
  };
102
- },
103
- // eslint-disable-next-line react-hooks/exhaustive-deps
104
- [getFieldProps, getFormItemProps, rest.dependenciesValues, onlyChange]);
100
+ }, [getFieldProps, getFormItemProps, rest.dependenciesValues, onlyChange]);
105
101
  const fieldProps = useDeepCompareMemo(() => {
106
102
  const newFieldProps = {
107
103
  ...(ignoreFormItem ? omitUndefined({
@@ -143,8 +139,6 @@ export function warpField(Field, config) {
143
139
  if (Array.isArray(prefixName) && name) name = `${prefixName.join('.')}.${name}`;
144
140
  const key = name && `form-${contextValue.formKey ?? ''}-field-${name}`;
145
141
  return key;
146
-
147
- // eslint-disable-next-line react-hooks/exhaustive-deps
148
142
  }, [stringify(otherProps?.name), prefixName, contextValue.formKey]);
149
143
  const onChange = useRefFunction((...restParams) => {
150
144
  if (getFormItemProps || getFieldProps) {
@@ -161,7 +155,6 @@ export function warpField(Field, config) {
161
155
  };
162
156
  if (isIgnoreWidth) Reflect.deleteProperty(newStyle, 'width');
163
157
  return omitUndefined(newStyle);
164
- // eslint-disable-next-line react-hooks/exhaustive-deps
165
158
  }, [stringify(fieldProps?.style), contextValue.grid, isIgnoreWidth, width]);
166
159
  const className = useDeepCompareMemo(() => {
167
160
  const isSizeEnum = width && WIDTH_SIZE_ENUM[width];
@@ -191,15 +184,12 @@ export function warpField(Field, config) {
191
184
  };
192
185
  }, [allowClear, className, onChange, fieldProps, style]);
193
186
  const field = useDeepCompareMemo(() => {
194
- return /*#__PURE__*/_jsx(Field
195
- // @ts-ignore
196
- , {
187
+ return /*#__PURE__*/_jsx(Field, {
197
188
  ...rest,
198
189
  fieldProps: fieldFieldProps,
199
190
  proFieldProps: fieldProFieldProps,
200
191
  ref: props?.fieldRef
201
192
  }, props.proFormFieldKey || props.name);
202
- // eslint-disable-next-line react-hooks/exhaustive-deps
203
193
  }, [fieldProFieldProps, fieldFieldProps, rest]);
204
194
 
205
195
  // 使用useMemo包裹避免不必要的re-render
@@ -210,9 +200,7 @@ export function warpField(Field, config) {
210
200
  , {
211
201
  label: label && proFieldProps?.light !== true ? label : undefined,
212
202
  tooltip: proFieldProps?.light !== true && tooltip,
213
- valuePropName: valuePropName
214
- // @ts-ignore
215
- ,
203
+ valuePropName: valuePropName,
216
204
  ...otherProps,
217
205
  ignoreFormItem: ignoreFormItem,
218
206
  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 & {
@@ -91,8 +91,6 @@ function ProFormList(props) {
91
91
  }
92
92
  return [listContext.name, rest.name].flat(1);
93
93
  }, [listContext.name, rest.name]);
94
-
95
- // eslint-disable-next-line react-hooks/exhaustive-deps
96
94
  useImperativeHandle(actionRef, () => ({
97
95
  ...actionRefs.current,
98
96
  get: index => {
@@ -1,3 +1,4 @@
1
+ import { omit } from '@rc-component/util';
1
2
  import { Radio } from 'antd';
2
3
  import React from 'react';
3
4
  import FieldRadio from "../../../field/components/Radio";
@@ -70,8 +71,11 @@ const ProFormRadioComponents = /*#__PURE__*/React.forwardRef(({
70
71
  fieldProps,
71
72
  children
72
73
  }, ref) => {
74
+ const {
75
+ ...restFieldProps
76
+ } = fieldProps || {};
73
77
  return /*#__PURE__*/_jsx(Radio, {
74
- ...fieldProps,
78
+ ...omit(restFieldProps, ['allowClear']),
75
79
  ref: ref,
76
80
  children: children
77
81
  });
@@ -83,8 +87,5 @@ const ProFormRadio = warpField?.(ProFormRadioComponents, {
83
87
  const WrappedProFormRadio = ProFormRadio;
84
88
  WrappedProFormRadio.Group = RadioGroup;
85
89
  WrappedProFormRadio.Button = Radio.Button;
86
-
87
- // @ts-ignore
88
- // eslint-disable-next-line no-param-reassign
89
90
  WrappedProFormRadio.displayName = 'ProFormComponent';
90
91
  export default WrappedProFormRadio;
@@ -125,7 +125,6 @@ function BetaSchemaForm(props) {
125
125
  // like StepsForm's columns but not only for StepsForm
126
126
  if (columns.length && Array.isArray(columns[0])) return;
127
127
  return genItems(columns);
128
- // eslint-disable-next-line react-hooks/exhaustive-deps
129
128
  }, [columns, restProps?.open, action, type, formDomsDeps, formRef.current]);
130
129
 
131
130
  /**
@@ -24,7 +24,6 @@ const StepsForm = ({
24
24
  return steps?.map((step, index) => /*#__PURE__*/_createElement(BetaSchemaForm, {
25
25
  grid: grid,
26
26
  ...step,
27
- // eslint-disable-next-line react/no-array-index-key
28
27
  key: index,
29
28
  layoutType: "StepForm",
30
29
  columns: columns[index]
@@ -119,6 +119,5 @@ const WrappedProFormSelect = ProFormSelect;
119
119
  WrappedProFormSelect.SearchSelect = ProFormSearchSelect;
120
120
 
121
121
  // @ts-ignore
122
- // eslint-disable-next-line no-param-reassign
123
122
  WrappedProFormSelect.displayName = 'ProFormComponent';
124
123
  export default WrappedProFormSelect;
@@ -152,8 +152,5 @@ const Password = ({
152
152
  };
153
153
  const WrappedProFormText = ProFormText;
154
154
  WrappedProFormText.Password = Password;
155
-
156
- // @ts-ignore
157
- // eslint-disable-next-line no-param-reassign
158
155
  WrappedProFormText.displayName = 'ProFormComponent';
159
156
  export default WrappedProFormText;
@@ -70,8 +70,10 @@ const BaseProFormUploadButton = /*#__PURE__*/React.forwardRef(({
70
70
  children: [icon, title]
71
71
  }))
72
72
  }), previewImage && /*#__PURE__*/_jsx(Image, {
73
- wrapperStyle: {
74
- display: 'none'
73
+ styles: {
74
+ root: {
75
+ display: 'none'
76
+ }
75
77
  },
76
78
  ...imageProps,
77
79
  preview: {
@@ -30,7 +30,6 @@ const BaseProFormUploadDragger = /*#__PURE__*/React.forwardRef(({
30
30
  // 如果配置了 max ,并且 超过了文件列表的大小,就不展示按钮
31
31
  const showUploadButton = (max === undefined || !value || value?.length < max) && mode !== 'read' && proFieldProps?.readonly !== true;
32
32
  return /*#__PURE__*/_jsxs(Upload.Dragger, {
33
- // @ts-ignore
34
33
  ref: ref,
35
34
  name: "files",
36
35
  action: action,
@@ -95,9 +95,5 @@ export const useGridHelpers = props => {
95
95
  rowProps: config?.rowProps,
96
96
  colProps: config?.colProps || colProps,
97
97
  Wrapper: config?.Wrapper
98
- }),
99
- // eslint-disable-next-line react-hooks/exhaustive-deps
100
- [config?.Wrapper, config.grid, grid,
101
- // eslint-disable-next-line react-hooks/exhaustive-deps
102
- JSON.stringify([colProps, config?.colProps, config?.rowProps])]);
98
+ }), [config?.Wrapper, config.grid, grid, JSON.stringify([colProps, config?.colProps, config?.rowProps])]);
103
99
  };
@@ -25,9 +25,7 @@ function DrawerForm({
25
25
  open: propsOpen,
26
26
  ...rest
27
27
  }) {
28
- noteOnce(
29
- // eslint-disable-next-line @typescript-eslint/dot-notation
30
- !rest['footer'] || !drawerProps?.footer, 'DrawerForm 是一个 ProForm 的特殊布局,如果想自定义按钮,请使用 submit.render 自定义。');
28
+ noteOnce(!rest.footer || !drawerProps?.footer, 'DrawerForm 是一个 ProForm 的特殊布局,如果想自定义按钮,请使用 submit.render 自定义。');
31
29
  const resizeInfo = React.useMemo(() => {
32
30
  const defaultResize = {
33
31
  onResize: () => {},
@@ -103,8 +101,6 @@ function DrawerForm({
103
101
  if (resizableDrawer) {
104
102
  setDrawerWidth(resizeInfo?.minWidth);
105
103
  }
106
-
107
- // eslint-disable-next-line react-hooks/exhaustive-deps
108
104
  }, [propsOpen, open, resizableDrawer]);
109
105
  useImperativeHandle(rest.formRef, () => {
110
106
  return formRef.current;
@@ -65,7 +65,6 @@ const LightFilterContainer = props => {
65
65
  collapseItems: collapseItemsArr,
66
66
  outsideItems: outsideItemsArr
67
67
  };
68
- // eslint-disable-next-line react-hooks/exhaustive-deps
69
68
  }, [props.items]);
70
69
  const renderCollapseLabelRender = () => {
71
70
  if (collapseLabel) {
@@ -23,9 +23,7 @@ function ModalForm({
23
23
  open: propsOpen,
24
24
  ...rest
25
25
  }) {
26
- noteOnce(
27
- // eslint-disable-next-line @typescript-eslint/dot-notation
28
- !rest['footer'] || !modalProps?.footer, 'ModalForm 是一个 ProForm 的特殊布局,如果想自定义按钮,请使用 submit.render 自定义。');
26
+ noteOnce(!rest.footer || !modalProps?.footer, 'ModalForm 是一个 ProForm 的特殊布局,如果想自定义按钮,请使用 submit.render 自定义。');
29
27
  const context = useContext(ConfigProvider.ConfigContext);
30
28
  const [, forceUpdate] = useState([]);
31
29
  const [loading, setLoading] = useState(false);
@@ -74,7 +72,6 @@ function ModalForm({
74
72
  if (propsOpen) {
75
73
  onOpenChange?.(true);
76
74
  }
77
- // eslint-disable-next-line react-hooks/exhaustive-deps
78
75
  }, [propsOpen]);
79
76
  const triggerDom = useMemo(() => {
80
77
  if (!trigger) {
@@ -9,7 +9,7 @@ declare namespace ProForm {
9
9
  var Group: React.FC<import("src/form").GroupProps>;
10
10
  var useForm: typeof import("antd/es/form/Form").useForm;
11
11
  var Item: React.FC<import("src/form/components/FormItem").ProFormItemProps>;
12
- var useWatch: typeof import("@rc-component/form").useWatch;
12
+ var useWatch: typeof import("antd/es/form/Form").useWatch;
13
13
  var ErrorList: React.FC<import("antd/es/form").ErrorListProps>;
14
14
  var Provider: React.FC<import("antd/es/form/context").FormProviderProps>;
15
15
  var useFormInstance: typeof import("antd/es/form/hooks/useFormInstance").default;
@@ -1,4 +1,3 @@
1
- /* eslint-disable no-param-reassign */
2
1
  import RcResizeObserver from '@rc-component/resize-observer';
3
2
  import { useControlledState } from '@rc-component/util';
4
3
  import { Col, ConfigProvider, Form, Row } from 'antd';
@@ -35,7 +35,6 @@ function StepForm(stepNativeProps) {
35
35
  return () => {
36
36
  context?.unRegForm(name);
37
37
  };
38
- // eslint-disable-next-line react-hooks/exhaustive-deps
39
38
  }, []);
40
39
  if (context && context?.formArrayRef) {
41
40
  context.formArrayRef.current[step || 0] = formRef;
@@ -140,8 +140,8 @@ function StepsForm(props) {
140
140
  });
141
141
  }, [onCurrentChangeCallback]);
142
142
  const layoutRender = useMemo(() => {
143
- return StepsLayoutStrategy[stepsProps?.direction || 'horizontal'];
144
- }, [stepsProps?.direction]);
143
+ return StepsLayoutStrategy[stepsProps?.orientation || 'horizontal'];
144
+ }, [stepsProps?.orientation]);
145
145
  const lastStep = useMemo(() => step === formArray.length - 1, [formArray.length, step]);
146
146
 
147
147
  /**
@@ -207,22 +207,13 @@ function StepsForm(props) {
207
207
  return stepItemProps;
208
208
  })
209
209
  };
210
-
211
- // Convert deprecated direction to orientation
212
- const processedStepsProps = stepsProps ? {
213
- ...stepsProps
214
- } : {};
215
- if ('direction' in processedStepsProps) {
216
- processedStepsProps.orientation = processedStepsProps.direction;
217
- delete processedStepsProps.direction;
218
- }
219
210
  return /*#__PURE__*/_jsx("div", {
220
211
  className: `${prefixCls}-steps-container ${hashId}`.trim(),
221
212
  style: {
222
213
  maxWidth: Math.min(formArray.length * 320, 1160)
223
214
  },
224
215
  children: /*#__PURE__*/_jsx(Steps, {
225
- ...processedStepsProps,
216
+ ...stepsProps,
226
217
  ...itemsProps,
227
218
  current: step,
228
219
  onChange: undefined
@@ -229,7 +229,6 @@ const BaseProLayout = props => {
229
229
  });
230
230
  useEffect(() => {
231
231
  setMenuLoading(isLoading);
232
- // eslint-disable-next-line react-hooks/exhaustive-deps
233
232
  }, [isLoading]);
234
233
  const {
235
234
  cache
@@ -238,7 +237,6 @@ const BaseProLayout = props => {
238
237
  return () => {
239
238
  if (cache instanceof Map) cache.delete(defaultId);
240
239
  };
241
- // eslint-disable-next-line react-hooks/exhaustive-deps
242
240
  }, []);
243
241
  const menuInfoData = useMemo(() => getMenuData(data || route?.children || route?.routes || [], menu, formatMessage, menuDataRender), [formatMessage, menu, menuDataRender, data, route?.children]);
244
242
  const {
@@ -401,7 +399,6 @@ const BaseProLayout = props => {
401
399
  /** 页面切换的时候触发 */
402
400
  useEffect(() => {
403
401
  props.onPageChange?.(props.location);
404
- // eslint-disable-next-line react-hooks/exhaustive-deps
405
402
  }, [location.pathname, location.pathname?.search]);
406
403
  const [hasFooterToolbar, setHasFooterToolbar] = useState(false);
407
404
  /**
@@ -462,9 +459,7 @@ const BaseProLayout = props => {
462
459
  flexDirection: siderMenuDom ? 'row' : undefined,
463
460
  ...style
464
461
  },
465
- children: [/*#__PURE__*/_jsx(ConfigProvider
466
- // @ts-ignore
467
- , {
462
+ children: [/*#__PURE__*/_jsx(ConfigProvider, {
468
463
  theme: {
469
464
  hashed: isNeedOpenHash(),
470
465
  token: {
@@ -4,6 +4,10 @@ import { genAppsLogoComponentsSimpleListStyle } from "./simple";
4
4
  const genAppsLogoComponentsStyle = token => {
5
5
  return {
6
6
  [token.componentCls]: {
7
+ boxSizing: 'border-box',
8
+ '*, *::before, *::after': {
9
+ boxSizing: 'border-box'
10
+ },
7
11
  '&-icon': {
8
12
  display: 'inline-flex',
9
13
  alignItems: 'center',
@@ -1,4 +1,3 @@
1
- /* eslint-disable react-hooks/exhaustive-deps */
2
1
  import { omit } from '@rc-component/util';
3
2
  import { ConfigProvider } from 'antd';
4
3
  import { clsx } from 'clsx';
@@ -46,7 +45,6 @@ const FooterToolbar = props => {
46
45
  return '100%';
47
46
  }
48
47
  return isMobile ? '100%' : `calc(100% - ${siderWidth}px)`;
49
- // eslint-disable-next-line react-hooks/exhaustive-deps
50
48
  }, [value.collapsed, value.hasSiderMenu, value.isMobile, value.siderWidth]);
51
49
  const containerDom = useMemo(() => {
52
50
  if (typeof window === 'undefined' || typeof document === 'undefined') return null;
@@ -75,7 +73,6 @@ const FooterToolbar = props => {
75
73
  return () => {
76
74
  value?.setHasFooterToolbar?.(false);
77
75
  };
78
- // eslint-disable-next-line react-hooks/exhaustive-deps
79
76
  }, []);
80
77
  const renderDom = /*#__PURE__*/_jsx("div", {
81
78
  className: clsx(className, hashId, baseClassName, {
@@ -116,7 +116,6 @@ export const ActionsContent = ({
116
116
  children: contentRender ? contentRender({
117
117
  ...props,
118
118
  // 测试专用
119
- //@ts-ignore
120
119
  rightContentSize: rightSize
121
120
  }) : null
122
121
  })
@@ -97,9 +97,7 @@ const DefaultHeader = props => {
97
97
  });
98
98
  if (layout === 'side' && !isMobile) return null;
99
99
  return stylish.wrapSSR(wrapSSR( /*#__PURE__*/_jsx(_Fragment, {
100
- children: /*#__PURE__*/_jsxs(ConfigProvider
101
- // @ts-ignore
102
- , {
100
+ children: /*#__PURE__*/_jsxs(ConfigProvider, {
103
101
  theme: {
104
102
  hashed: isNeedOpenHash(),
105
103
  components: {
@@ -190,7 +190,6 @@ const PageContainerBase = props => {
190
190
  return () => {
191
191
  value?.setHasPageContainer?.(num => num - 1);
192
192
  };
193
- // eslint-disable-next-line react-hooks/exhaustive-deps
194
193
  }, []);
195
194
  const {
196
195
  token
@@ -3,6 +3,10 @@ const [sm, md, lg, xl] = [576, 768, 992, 1200].map(bp => `@media (max-width: ${b
3
3
  const genPageContainerStyle = token => {
4
4
  return {
5
5
  [token.componentCls]: {
6
+ boxSizing: 'border-box',
7
+ '*, *::before, *::after': {
8
+ boxSizing: 'border-box'
9
+ },
6
10
  position: 'relative',
7
11
  '&-children-container': {
8
12
  paddingBlockStart: 0,
@@ -31,7 +31,6 @@ const BlockCheckbox = ({
31
31
  })
32
32
  }, item.key));
33
33
  return domList;
34
- // eslint-disable-next-line react-hooks/exhaustive-deps
35
34
  }, [value, list?.length, onChange]);
36
35
  return /*#__PURE__*/_jsx("div", {
37
36
  className: clsx(baseClassName, hashId),
@@ -213,7 +213,6 @@ export const SettingDrawer = props => {
213
213
  passive: true
214
214
  });
215
215
  return () => window.document.removeEventListener('languagechange', onLanguageChange);
216
- // eslint-disable-next-line react-hooks/exhaustive-deps
217
216
  }, []);
218
217
 
219
218
  /**
@@ -2,6 +2,10 @@ import { useStyle as useAntdStyle } from "../../../../provider";
2
2
  const genSettingDrawerStyle = token => {
3
3
  return {
4
4
  [`${token.componentCls}-handle`]: {
5
+ boxSizing: 'border-box',
6
+ '*, *::before, *::after': {
7
+ boxSizing: 'border-box'
8
+ },
5
9
  position: 'fixed',
6
10
  insetBlockStart: '240px',
7
11
  insetInlineEnd: '0px',
@@ -158,7 +158,6 @@ class MenuUtil {
158
158
  disabled: item.disabled,
159
159
  key: item.key || item.path,
160
160
  onClick: item.onTitleClick,
161
- // eslint-disable-next-line react/no-is-mounted
162
161
  label: this.getMenuItemPath(item, level, noGroupLevel)
163
162
  };
164
163
  };
@@ -376,7 +375,6 @@ const BaseMenu = props => {
376
375
  setOpenKeys(matchMenuKeys);
377
376
  setSelectedKeys(matchMenuKeys);
378
377
  }
379
- // eslint-disable-next-line react-hooks/exhaustive-deps
380
378
  }, [matchMenuKeys.join('-')]);
381
379
  useEffect(() => {
382
380
  // reset IconFont
@@ -408,9 +406,7 @@ const BaseMenu = props => {
408
406
  },
409
407
  // 依赖项加上 props.collapsed,保证折叠时能正确响应
410
408
  [matchMenuKeys.join('-'), props.collapsed]);
411
- const openKeysProps = useMemo(() => getOpenKeysProps(openKeys, props),
412
- // eslint-disable-next-line react-hooks/exhaustive-deps
413
- [openKeys && openKeys.join(','), props.layout, props.collapsed]);
409
+ const openKeysProps = useMemo(() => getOpenKeysProps(openKeys, props), [openKeys && openKeys.join(','), props.layout, props.collapsed]);
414
410
  const {
415
411
  wrapSSR,
416
412
  hashId
@@ -453,7 +449,7 @@ const BaseMenu = props => {
453
449
  }
454
450
  return wrapSSR( /*#__PURE__*/_createElement(Menu, {
455
451
  ...openKeysProps,
456
- _internalDisableMenuItemTitleTooltip: true,
452
+ tooltip: false,
457
453
  key: "Menu",
458
454
  mode: mode,
459
455
  inlineIndent: 16,
@@ -170,9 +170,7 @@ const SiderMenu = props => {
170
170
  }, index);
171
171
  })
172
172
  });
173
- },
174
- // eslint-disable-next-line react-hooks/exhaustive-deps
175
- [actionsRender, baseClassName, collapsed]);
173
+ }, [actionsRender, baseClassName, collapsed]);
176
174
  const appsDom = useMemo(() => {
177
175
  return /*#__PURE__*/_jsx(AppsLogoComponents, {
178
176
  onItemClick: props.itemClick,
@@ -25,7 +25,6 @@ const SiderMenuWrapper = props => {
25
25
  if (isMobile === true) {
26
26
  onCollapse?.(true);
27
27
  }
28
- // eslint-disable-next-line react-hooks/exhaustive-deps
29
28
  }, [isMobile]);
30
29
  const omitProps = omit(props, ['className', 'style']);
31
30
  const {
@@ -45,8 +45,7 @@ const TopNavHeader = props => {
45
45
  token
46
46
  } = useContext(ProProvider);
47
47
  const contentDom = useMemo(() => {
48
- const defaultDom = /*#__PURE__*/_jsx(ConfigProvider // @ts-ignore
49
- , {
48
+ const defaultDom = /*#__PURE__*/_jsx(ConfigProvider, {
50
49
  theme: {
51
50
  hashed: isNeedOpenHash(),
52
51
  components: {
@@ -5,6 +5,10 @@ const genProLayoutStyle = token => {
5
5
  backgroundColor: 'transparent !important'
6
6
  },
7
7
  [token.componentCls]: {
8
+ boxSizing: 'border-box',
9
+ '*, *::before, *::after': {
10
+ boxSizing: 'border-box'
11
+ },
8
12
  [`& ${token.antCls}-layout`]: {
9
13
  display: 'flex',
10
14
  backgroundColor: 'transparent',
@@ -1,7 +1,6 @@
1
1
  import { transformRoute } from '@umijs/route-utils';
2
2
  function fromEntries(iterable) {
3
3
  return [...iterable].reduce((obj, [key, val]) => {
4
- // eslint-disable-next-line no-param-reassign
5
4
  obj[key] = val;
6
5
  return obj;
7
6
  }, {});
package/es/list/Item.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import type { ListGridType } from 'antd/lib/list';
2
1
  import type { ExpandableConfig } from 'antd/lib/table/interface';
3
2
  import React from 'react';
4
3
  import type { CheckCardProps } from '../card';
5
4
  import type { GetComponentProps } from './index';
5
+ import type { ListGridType } from './ProListBase';
6
6
  export type RenderExpandIconProps<RecordType> = {
7
7
  prefixCls: string;
8
8
  expanded: boolean;
@@ -39,11 +39,8 @@ export type ItemProps<RecordType> = {
39
39
  grid?: ListGridType;
40
40
  expand?: boolean;
41
41
  rowSupportExpand?: boolean;
42
- cardActionProps?: 'actions' | 'extra';
43
42
  onExpand?: (expand: boolean) => void;
44
43
  expandable?: ExpandableConfig<any>;
45
- showActions?: 'hover' | 'always';
46
- showExtra?: 'hover' | 'always';
47
44
  type?: 'new' | 'top' | 'inline' | 'subheader';
48
45
  isEditable: boolean;
49
46
  recordKey: string | number | undefined;