@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
@@ -103,10 +103,6 @@ const useGridHelpers = props => {
103
103
  rowProps: config?.rowProps,
104
104
  colProps: config?.colProps || colProps,
105
105
  Wrapper: config?.Wrapper
106
- }),
107
- // eslint-disable-next-line react-hooks/exhaustive-deps
108
- [config?.Wrapper, config.grid, grid,
109
- // eslint-disable-next-line react-hooks/exhaustive-deps
110
- JSON.stringify([colProps, config?.colProps, config?.rowProps])]);
106
+ }), [config?.Wrapper, config.grid, grid, JSON.stringify([colProps, config?.colProps, config?.rowProps])]);
111
107
  };
112
108
  exports.useGridHelpers = useGridHelpers;
@@ -30,9 +30,7 @@ function DrawerForm({
30
30
  open: propsOpen,
31
31
  ...rest
32
32
  }) {
33
- noteOnce(
34
- // eslint-disable-next-line @typescript-eslint/dot-notation
35
- !rest['footer'] || !drawerProps?.footer, 'DrawerForm 是一个 ProForm 的特殊布局,如果想自定义按钮,请使用 submit.render 自定义。');
33
+ noteOnce(!rest.footer || !drawerProps?.footer, 'DrawerForm 是一个 ProForm 的特殊布局,如果想自定义按钮,请使用 submit.render 自定义。');
36
34
  const resizeInfo = _react.default.useMemo(() => {
37
35
  const defaultResize = {
38
36
  onResize: () => {},
@@ -108,8 +106,6 @@ function DrawerForm({
108
106
  if (resizableDrawer) {
109
107
  setDrawerWidth(resizeInfo?.minWidth);
110
108
  }
111
-
112
- // eslint-disable-next-line react-hooks/exhaustive-deps
113
109
  }, [propsOpen, open, resizableDrawer]);
114
110
  (0, _react.useImperativeHandle)(rest.formRef, () => {
115
111
  return formRef.current;
@@ -71,7 +71,6 @@ const LightFilterContainer = props => {
71
71
  collapseItems: collapseItemsArr,
72
72
  outsideItems: outsideItemsArr
73
73
  };
74
- // eslint-disable-next-line react-hooks/exhaustive-deps
75
74
  }, [props.items]);
76
75
  const renderCollapseLabelRender = () => {
77
76
  if (collapseLabel) {
@@ -28,9 +28,7 @@ function ModalForm({
28
28
  open: propsOpen,
29
29
  ...rest
30
30
  }) {
31
- noteOnce(
32
- // eslint-disable-next-line @typescript-eslint/dot-notation
33
- !rest['footer'] || !modalProps?.footer, 'ModalForm 是一个 ProForm 的特殊布局,如果想自定义按钮,请使用 submit.render 自定义。');
31
+ noteOnce(!rest.footer || !modalProps?.footer, 'ModalForm 是一个 ProForm 的特殊布局,如果想自定义按钮,请使用 submit.render 自定义。');
34
32
  const context = (0, _react.useContext)(_antd.ConfigProvider.ConfigContext);
35
33
  const [, forceUpdate] = (0, _react.useState)([]);
36
34
  const [loading, setLoading] = (0, _react.useState)(false);
@@ -79,7 +77,6 @@ function ModalForm({
79
77
  if (propsOpen) {
80
78
  onOpenChange?.(true);
81
79
  }
82
- // eslint-disable-next-line react-hooks/exhaustive-deps
83
80
  }, [propsOpen]);
84
81
  const triggerDom = (0, _react.useMemo)(() => {
85
82
  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;
@@ -17,8 +17,6 @@ var _BaseForm = require("../../BaseForm");
17
17
  var _Actions = _interopRequireDefault(require("./Actions"));
18
18
  var _style = require("./style");
19
19
  var _jsxRuntime = require("react/jsx-runtime");
20
- /* eslint-disable no-param-reassign */
21
-
22
20
  const CONFIG_SPAN_BREAKPOINTS = {
23
21
  xs: 513,
24
22
  sm: 513,
@@ -41,7 +41,6 @@ function StepForm(stepNativeProps) {
41
41
  return () => {
42
42
  context?.unRegForm(name);
43
43
  };
44
- // eslint-disable-next-line react-hooks/exhaustive-deps
45
44
  }, []);
46
45
  if (context && context?.formArrayRef) {
47
46
  context.formArrayRef.current[step || 0] = formRef;
@@ -148,8 +148,8 @@ function StepsForm(props) {
148
148
  });
149
149
  }, [onCurrentChangeCallback]);
150
150
  const layoutRender = (0, _react.useMemo)(() => {
151
- return StepsLayoutStrategy[stepsProps?.direction || 'horizontal'];
152
- }, [stepsProps?.direction]);
151
+ return StepsLayoutStrategy[stepsProps?.orientation || 'horizontal'];
152
+ }, [stepsProps?.orientation]);
153
153
  const lastStep = (0, _react.useMemo)(() => step === formArray.length - 1, [formArray.length, step]);
154
154
 
155
155
  /**
@@ -215,22 +215,13 @@ function StepsForm(props) {
215
215
  return stepItemProps;
216
216
  })
217
217
  };
218
-
219
- // Convert deprecated direction to orientation
220
- const processedStepsProps = stepsProps ? {
221
- ...stepsProps
222
- } : {};
223
- if ('direction' in processedStepsProps) {
224
- processedStepsProps.orientation = processedStepsProps.direction;
225
- delete processedStepsProps.direction;
226
- }
227
218
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
228
219
  className: `${prefixCls}-steps-container ${hashId}`.trim(),
229
220
  style: {
230
221
  maxWidth: Math.min(formArray.length * 320, 1160)
231
222
  },
232
223
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Steps, {
233
- ...processedStepsProps,
224
+ ...stepsProps,
234
225
  ...itemsProps,
235
226
  current: step,
236
227
  onChange: undefined
@@ -234,7 +234,6 @@ const BaseProLayout = props => {
234
234
  });
235
235
  (0, _react.useEffect)(() => {
236
236
  setMenuLoading(isLoading);
237
- // eslint-disable-next-line react-hooks/exhaustive-deps
238
237
  }, [isLoading]);
239
238
  const {
240
239
  cache
@@ -243,7 +242,6 @@ const BaseProLayout = props => {
243
242
  return () => {
244
243
  if (cache instanceof Map) cache.delete(defaultId);
245
244
  };
246
- // eslint-disable-next-line react-hooks/exhaustive-deps
247
245
  }, []);
248
246
  const menuInfoData = (0, _react.useMemo)(() => (0, _getMenuData.getMenuData)(data || route?.children || route?.routes || [], menu, formatMessage, menuDataRender), [formatMessage, menu, menuDataRender, data, route?.children]);
249
247
  const {
@@ -406,7 +404,6 @@ const BaseProLayout = props => {
406
404
  /** 页面切换的时候触发 */
407
405
  (0, _react.useEffect)(() => {
408
406
  props.onPageChange?.(props.location);
409
- // eslint-disable-next-line react-hooks/exhaustive-deps
410
407
  }, [location.pathname, location.pathname?.search]);
411
408
  const [hasFooterToolbar, setHasFooterToolbar] = (0, _react.useState)(false);
412
409
  /**
@@ -467,9 +464,7 @@ const BaseProLayout = props => {
467
464
  flexDirection: siderMenuDom ? 'row' : undefined,
468
465
  ...style
469
466
  },
470
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.ConfigProvider
471
- // @ts-ignore
472
- , {
467
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.ConfigProvider, {
473
468
  theme: {
474
469
  hashed: (0, _provider.isNeedOpenHash)(),
475
470
  token: {
@@ -10,6 +10,10 @@ var _simple = require("./simple");
10
10
  const genAppsLogoComponentsStyle = token => {
11
11
  return {
12
12
  [token.componentCls]: {
13
+ boxSizing: 'border-box',
14
+ '*, *::before, *::after': {
15
+ boxSizing: 'border-box'
16
+ },
13
17
  '&-icon': {
14
18
  display: 'inline-flex',
15
19
  alignItems: 'center',
@@ -15,8 +15,6 @@ var _index = require("../../index");
15
15
  var _style = require("./style");
16
16
  var _stylish = require("./style/stylish");
17
17
  var _jsxRuntime = require("react/jsx-runtime");
18
- /* eslint-disable react-hooks/exhaustive-deps */
19
-
20
18
  const FooterToolbar = props => {
21
19
  const {
22
20
  children,
@@ -52,7 +50,6 @@ const FooterToolbar = props => {
52
50
  return '100%';
53
51
  }
54
52
  return isMobile ? '100%' : `calc(100% - ${siderWidth}px)`;
55
- // eslint-disable-next-line react-hooks/exhaustive-deps
56
53
  }, [value.collapsed, value.hasSiderMenu, value.isMobile, value.siderWidth]);
57
54
  const containerDom = (0, _react.useMemo)(() => {
58
55
  if (typeof window === 'undefined' || typeof document === 'undefined') return null;
@@ -81,7 +78,6 @@ const FooterToolbar = props => {
81
78
  return () => {
82
79
  value?.setHasFooterToolbar?.(false);
83
80
  };
84
- // eslint-disable-next-line react-hooks/exhaustive-deps
85
81
  }, []);
86
82
  const renderDom = /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
87
83
  className: (0, _clsx.clsx)(className, hashId, baseClassName, {
@@ -121,7 +121,6 @@ const ActionsContent = ({
121
121
  children: contentRender ? contentRender({
122
122
  ...props,
123
123
  // 测试专用
124
- //@ts-ignore
125
124
  rightContentSize: rightSize
126
125
  }) : null
127
126
  })
@@ -102,9 +102,7 @@ const DefaultHeader = props => {
102
102
  });
103
103
  if (layout === 'side' && !isMobile) return null;
104
104
  return stylish.wrapSSR(wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
105
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.ConfigProvider
106
- // @ts-ignore
107
- , {
105
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.ConfigProvider, {
108
106
  theme: {
109
107
  hashed: (0, _provider.isNeedOpenHash)(),
110
108
  components: {
@@ -196,7 +196,6 @@ const PageContainerBase = props => {
196
196
  return () => {
197
197
  value?.setHasPageContainer?.(num => num - 1);
198
198
  };
199
- // eslint-disable-next-line react-hooks/exhaustive-deps
200
199
  }, []);
201
200
  const {
202
201
  token
@@ -9,6 +9,10 @@ const [sm, md, lg, xl] = [576, 768, 992, 1200].map(bp => `@media (max-width: ${b
9
9
  const genPageContainerStyle = token => {
10
10
  return {
11
11
  [token.componentCls]: {
12
+ boxSizing: 'border-box',
13
+ '*, *::before, *::after': {
14
+ boxSizing: 'border-box'
15
+ },
12
16
  position: 'relative',
13
17
  '&-children-container': {
14
18
  paddingBlockStart: 0,
@@ -36,7 +36,6 @@ const BlockCheckbox = ({
36
36
  })
37
37
  }, item.key));
38
38
  return domList;
39
- // eslint-disable-next-line react-hooks/exhaustive-deps
40
39
  }, [value, list?.length, onChange]);
41
40
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
42
41
  className: (0, _clsx.clsx)(baseClassName, hashId),
@@ -219,7 +219,6 @@ const SettingDrawer = props => {
219
219
  passive: true
220
220
  });
221
221
  return () => window.document.removeEventListener('languagechange', onLanguageChange);
222
- // eslint-disable-next-line react-hooks/exhaustive-deps
223
222
  }, []);
224
223
 
225
224
  /**
@@ -8,6 +8,10 @@ var _provider = require("../../../../provider");
8
8
  const genSettingDrawerStyle = token => {
9
9
  return {
10
10
  [`${token.componentCls}-handle`]: {
11
+ boxSizing: 'border-box',
12
+ '*, *::before, *::after': {
13
+ boxSizing: 'border-box'
14
+ },
11
15
  position: 'fixed',
12
16
  insetBlockStart: '240px',
13
17
  insetInlineEnd: '0px',
@@ -163,7 +163,6 @@ class MenuUtil {
163
163
  disabled: item.disabled,
164
164
  key: item.key || item.path,
165
165
  onClick: item.onTitleClick,
166
- // eslint-disable-next-line react/no-is-mounted
167
166
  label: this.getMenuItemPath(item, level, noGroupLevel)
168
167
  };
169
168
  };
@@ -381,7 +380,6 @@ const BaseMenu = props => {
381
380
  setOpenKeys(matchMenuKeys);
382
381
  setSelectedKeys(matchMenuKeys);
383
382
  }
384
- // eslint-disable-next-line react-hooks/exhaustive-deps
385
383
  }, [matchMenuKeys.join('-')]);
386
384
  (0, _react.useEffect)(() => {
387
385
  // reset IconFont
@@ -413,9 +411,7 @@ const BaseMenu = props => {
413
411
  },
414
412
  // 依赖项加上 props.collapsed,保证折叠时能正确响应
415
413
  [matchMenuKeys.join('-'), props.collapsed]);
416
- const openKeysProps = (0, _react.useMemo)(() => getOpenKeysProps(openKeys, props),
417
- // eslint-disable-next-line react-hooks/exhaustive-deps
418
- [openKeys && openKeys.join(','), props.layout, props.collapsed]);
414
+ const openKeysProps = (0, _react.useMemo)(() => getOpenKeysProps(openKeys, props), [openKeys && openKeys.join(','), props.layout, props.collapsed]);
419
415
  const {
420
416
  wrapSSR,
421
417
  hashId
@@ -458,7 +454,7 @@ const BaseMenu = props => {
458
454
  }
459
455
  return wrapSSR( /*#__PURE__*/(0, _react.createElement)(_antd.Menu, {
460
456
  ...openKeysProps,
461
- _internalDisableMenuItemTitleTooltip: true,
457
+ tooltip: false,
462
458
  key: "Menu",
463
459
  mode: mode,
464
460
  inlineIndent: 16,
@@ -175,9 +175,7 @@ const SiderMenu = props => {
175
175
  }, index);
176
176
  })
177
177
  });
178
- },
179
- // eslint-disable-next-line react-hooks/exhaustive-deps
180
- [actionsRender, baseClassName, collapsed]);
178
+ }, [actionsRender, baseClassName, collapsed]);
181
179
  const appsDom = (0, _react.useMemo)(() => {
182
180
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_AppsLogoComponents.AppsLogoComponents, {
183
181
  onItemClick: props.itemClick,
@@ -32,7 +32,6 @@ const SiderMenuWrapper = props => {
32
32
  if (isMobile === true) {
33
33
  onCollapse?.(true);
34
34
  }
35
- // eslint-disable-next-line react-hooks/exhaustive-deps
36
35
  }, [isMobile]);
37
36
  const omitProps = (0, _util.omit)(props, ['className', 'style']);
38
37
  const {
@@ -51,8 +51,7 @@ const TopNavHeader = props => {
51
51
  token
52
52
  } = (0, _react.useContext)(_provider.ProProvider);
53
53
  const contentDom = (0, _react.useMemo)(() => {
54
- const defaultDom = /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.ConfigProvider // @ts-ignore
55
- , {
54
+ const defaultDom = /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.ConfigProvider, {
56
55
  theme: {
57
56
  hashed: (0, _provider.isNeedOpenHash)(),
58
57
  components: {
@@ -11,6 +11,10 @@ const genProLayoutStyle = token => {
11
11
  backgroundColor: 'transparent !important'
12
12
  },
13
13
  [token.componentCls]: {
14
+ boxSizing: 'border-box',
15
+ '*, *::before, *::after': {
16
+ boxSizing: 'border-box'
17
+ },
14
18
  [`& ${token.antCls}-layout`]: {
15
19
  display: 'flex',
16
20
  backgroundColor: 'transparent',
@@ -7,7 +7,6 @@ exports.getMenuData = void 0;
7
7
  var _routeUtils = require("@umijs/route-utils");
8
8
  function fromEntries(iterable) {
9
9
  return [...iterable].reduce((obj, [key, val]) => {
10
- // eslint-disable-next-line no-param-reassign
11
10
  obj[key] = val;
12
11
  return obj;
13
12
  }, {});
@@ -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;
package/lib/list/Item.js CHANGED
@@ -13,6 +13,7 @@ var _clsx = require("clsx");
13
13
  var _react = _interopRequireWildcard(require("react"));
14
14
  var _card = require("../card");
15
15
  var _provider = require("../provider");
16
+ var _ProListBase = require("./ProListBase");
16
17
  var _jsxRuntime = require("react/jsx-runtime");
17
18
  function renderExpandIcon({
18
19
  prefixCls,
@@ -45,26 +46,26 @@ function renderExpandIcon({
45
46
  });
46
47
  }
47
48
  function ProListItem(props) {
48
- const {
49
- prefixCls: customizePrefixCls
50
- } = props;
51
49
  const {
52
50
  getPrefixCls
53
51
  } = (0, _react.useContext)(_antd.ConfigProvider.ConfigContext);
54
52
  const {
55
53
  hashId
56
54
  } = (0, _react.useContext)(_provider.ProProvider);
57
- const prefixCls = getPrefixCls('pro-list', customizePrefixCls);
55
+ const prefixCls = getPrefixCls('pro-list', props.prefixCls);
58
56
  const defaultClassName = `${prefixCls}-row`;
59
57
  const {
60
58
  title,
61
59
  subTitle,
62
60
  content,
63
61
  itemTitleRender,
64
- prefixCls: restPrefixCls,
62
+ prefixCls: _prefixCls,
63
+ // eslint-disable-line @typescript-eslint/no-unused-vars
65
64
  actions,
66
- item,
67
- recordKey,
65
+ item: _item,
66
+ // eslint-disable-line @typescript-eslint/no-unused-vars
67
+ recordKey: _recordKey,
68
+ // eslint-disable-line @typescript-eslint/no-unused-vars
68
69
  avatar,
69
70
  cardProps,
70
71
  description,
@@ -77,8 +78,6 @@ function ProListItem(props) {
77
78
  onExpand: propsOnExpand,
78
79
  expandable: expandableConfig,
79
80
  rowSupportExpand,
80
- showActions,
81
- showExtra,
82
81
  type,
83
82
  style,
84
83
  className: propsClassName = defaultClassName,
@@ -86,7 +85,6 @@ function ProListItem(props) {
86
85
  onRow,
87
86
  onItem,
88
87
  itemHeaderRender,
89
- cardActionProps,
90
88
  extra,
91
89
  ...rest
92
90
  } = props;
@@ -107,37 +105,14 @@ function ProListItem(props) {
107
105
  }, [propsOnExpand]);
108
106
  const className = (0, _clsx.clsx)({
109
107
  [`${defaultClassName}-selected`]: !cardProps && selected,
110
- [`${defaultClassName}-show-action-hover`]: showActions === 'hover',
111
108
  [`${defaultClassName}-type-${type}`]: !!type,
112
- [`${defaultClassName}-editable`]: isEditable,
113
- [`${defaultClassName}-show-extra-hover`]: showExtra === 'hover'
109
+ [`${defaultClassName}-editable`]: isEditable
114
110
  }, hashId, defaultClassName);
115
- const extraClassName = (0, _clsx.clsx)(hashId, {
116
- [`${propsClassName}-extra`]: showExtra === 'hover'
117
- });
118
111
  const needExpanded = expanded || Object.values(expandableConfig || {}).length === 0;
119
112
  const expandedRowDom = expandedRowRender && expandedRowRender(record, index, indentSize, expanded);
120
- const extraDom = (0, _react.useMemo)(() => {
121
- if (!actions || cardActionProps === 'actions') {
122
- return undefined;
123
- }
124
- return [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
125
- onClick: e => e.stopPropagation(),
126
- children: actions
127
- }, "action")];
128
- }, [actions, cardActionProps]);
129
- const actionsDom = (0, _react.useMemo)(() => {
130
- if (!actions || !cardActionProps || cardActionProps === 'extra') {
131
- return undefined;
132
- }
133
- return [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
134
- className: `${defaultClassName}-actions ${hashId}`.trim(),
135
- onClick: e => e.stopPropagation(),
136
- children: actions
137
- }, "action")];
138
- }, [actions, cardActionProps, defaultClassName, hashId]);
113
+ const actionsArray = (0, _react.useMemo)(() => actions ? _react.default.Children.toArray(actions) : undefined, [actions]);
139
114
  const titleDom = title || subTitle ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
140
- className: `${defaultClassName}-header-container ${hashId}`.trim(),
115
+ className: (0, _clsx.clsx)(`${defaultClassName}-header-container`, hashId),
141
116
  children: [title && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
142
117
  className: (0, _clsx.clsx)(`${defaultClassName}-title`, hashId, {
143
118
  [`${defaultClassName}-title-editable`]: isEditable
@@ -151,41 +126,77 @@ function ProListItem(props) {
151
126
  })]
152
127
  }) : null;
153
128
  const metaTitle = (itemTitleRender && itemTitleRender?.(record, index, titleDom)) ?? titleDom;
154
- const metaDom = metaTitle || avatar || subTitle || description ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.List.Item.Meta, {
129
+ const metaDom = metaTitle || avatar || subTitle || description ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProListBase.ProListItemMeta, {
155
130
  avatar: avatar,
156
131
  title: metaTitle,
157
132
  description: description && needExpanded && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
158
- className: `${className}-description ${hashId}`.trim(),
133
+ className: (0, _clsx.clsx)(`${className}-description`, hashId),
159
134
  children: description
160
135
  })
161
136
  }) : null;
137
+ const itemProps = onItem?.(record, index);
138
+ const hasExpandableConfig = Object.keys(expandableConfig || {}).length > 0;
139
+ const expandedRowClassStr = typeof expandedRowClassName === 'function' ? expandedRowClassName(record, index, indentSize) : expandedRowClassName;
140
+ const headerDom = typeof itemHeaderRender === 'function' ? itemHeaderRender(record, index, metaDom) : metaDom;
141
+
142
+ // 卡片模式渲染
143
+ if (cardProps) {
144
+ const cardTitleDom = avatar || title ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
145
+ children: [avatar, /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
146
+ className: (0, _clsx.clsx)(`${prefixCls}-item-meta-title`, hashId),
147
+ children: title
148
+ })]
149
+ }) : null;
150
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
151
+ className: (0, _clsx.clsx)(hashId, `${className}-card-container`, {
152
+ [propsClassName]: propsClassName !== defaultClassName
153
+ }),
154
+ style: style,
155
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_card.CheckCard, {
156
+ bordered: true,
157
+ style: {
158
+ width: '100%'
159
+ },
160
+ className: (0, _clsx.clsx)(`${defaultClassName}-card`, hashId),
161
+ ...cardProps,
162
+ title: cardTitleDom,
163
+ subTitle: subTitle,
164
+ extra: actionsArray,
165
+ bodyStyle: {
166
+ padding: 24,
167
+ ...cardProps.bodyStyle
168
+ },
169
+ ...itemProps,
170
+ onClick: e => {
171
+ cardProps?.onClick?.(e);
172
+ itemProps?.onClick?.(e);
173
+ },
174
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Skeleton, {
175
+ avatar: true,
176
+ title: false,
177
+ loading: loading,
178
+ active: true,
179
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
180
+ className: (0, _clsx.clsx)(`${className}-header`, hashId),
181
+ children: [typeof itemTitleRender === 'function' && itemTitleRender(record, index, titleDom), content]
182
+ })
183
+ })
184
+ })
185
+ });
186
+ }
187
+
188
+ // 列表模式渲染
162
189
  const rowClassName = (0, _clsx.clsx)(hashId, {
163
190
  [`${defaultClassName}-item-has-checkbox`]: checkbox,
164
191
  [`${defaultClassName}-item-has-avatar`]: avatar,
165
192
  [className]: className
166
193
  });
167
- const cardTitleDom = (0, _react.useMemo)(() => {
168
- if (avatar || title) {
169
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
170
- children: [avatar, /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
171
- className: `${getPrefixCls('list-item-meta-title')} ${hashId}`.trim(),
172
- children: title
173
- })]
174
- });
175
- }
176
- return null;
177
- }, [avatar, getPrefixCls, hashId, title]);
178
- const itemProps = onItem?.(record, index);
179
- const defaultDom = !cardProps ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.List.Item, {
194
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProListBase.ProListItem, {
180
195
  className: (0, _clsx.clsx)(rowClassName, hashId, {
181
196
  [propsClassName]: propsClassName !== defaultClassName
182
197
  }),
183
198
  ...rest,
184
- actions: extraDom,
185
- extra: !!extra && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
186
- className: extraClassName,
187
- children: extra
188
- }),
199
+ extra: extra,
189
200
  ...onRow?.(record, index),
190
201
  ...itemProps,
191
202
  onClick: e => {
@@ -201,13 +212,13 @@ function ProListItem(props) {
201
212
  loading: loading,
202
213
  active: true,
203
214
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
204
- className: `${className}-header ${hashId}`.trim(),
215
+ className: (0, _clsx.clsx)(`${className}-header`, hashId),
205
216
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
206
- className: `${className}-header-option ${hashId}`.trim(),
217
+ className: (0, _clsx.clsx)(`${className}-header-option`, hashId),
207
218
  children: [!!checkbox && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
208
- className: `${className}-checkbox ${hashId}`.trim(),
219
+ className: (0, _clsx.clsx)(`${className}-checkbox`, hashId),
209
220
  children: checkbox
210
- }), Object.values(expandableConfig || {}).length > 0 && rowSupportExpand && renderExpandIcon({
221
+ }), hasExpandableConfig && rowSupportExpand && renderExpandIcon({
211
222
  prefixCls,
212
223
  hashId,
213
224
  expandIcon,
@@ -215,55 +226,15 @@ function ProListItem(props) {
215
226
  expanded,
216
227
  record
217
228
  })]
218
- }), (itemHeaderRender && itemHeaderRender?.(record, index, metaDom)) ?? metaDom]
229
+ }), headerDom, actionsArray]
219
230
  }), needExpanded && (content || expandedRowDom) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
220
- className: `${className}-content ${hashId}`.trim(),
231
+ className: (0, _clsx.clsx)(`${className}-content`, hashId),
221
232
  children: [content, expandedRowRender && rowSupportExpand && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
222
- className: expandedRowClassName && typeof expandedRowClassName !== 'string' ? expandedRowClassName(record, index, indentSize) : expandedRowClassName,
233
+ className: expandedRowClassStr,
223
234
  children: expandedRowDom
224
235
  })]
225
236
  })]
226
237
  })
227
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_card.CheckCard, {
228
- bordered: true,
229
- style: {
230
- width: '100%'
231
- },
232
- ...cardProps,
233
- title: cardTitleDom,
234
- subTitle: subTitle,
235
- extra: extraDom,
236
- actions: actionsDom,
237
- bodyStyle: {
238
- padding: 24,
239
- ...cardProps.bodyStyle
240
- },
241
- ...itemProps,
242
- onClick: e => {
243
- cardProps?.onClick?.(e);
244
- itemProps?.onClick?.(e);
245
- },
246
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Skeleton, {
247
- avatar: true,
248
- title: false,
249
- loading: loading,
250
- active: true,
251
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
252
- className: `${className}-header ${hashId}`.trim(),
253
- children: [itemTitleRender && itemTitleRender?.(record, index, titleDom), content]
254
- })
255
- })
256
- });
257
- if (!cardProps) {
258
- return defaultDom;
259
- }
260
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
261
- className: (0, _clsx.clsx)(hashId, {
262
- [`${className}-card`]: cardProps,
263
- [propsClassName]: propsClassName !== defaultClassName
264
- }),
265
- style: style,
266
- children: defaultDom
267
238
  });
268
239
  }
269
240
  var _default = exports.default = ProListItem;