@ant-design/pro-components 3.1.1-1 → 3.1.2-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 (74) hide show
  1. package/dist/pro-components.min.js +1 -1
  2. package/es/descriptions/index.d.ts +0 -2
  3. package/es/descriptions/index.js +1 -5
  4. package/es/field/components/Cascader/index.d.ts +3 -3
  5. package/es/field/components/Checkbox/index.d.ts +2 -2
  6. package/es/field/components/ColorPicker/index.d.ts +1 -1
  7. package/es/field/components/DatePicker/index.d.ts +2 -2
  8. package/es/field/components/Radio/index.d.ts +1 -1
  9. package/es/field/components/RangePicker/index.d.ts +2 -2
  10. package/es/field/components/Segmented/index.d.ts +1 -1
  11. package/es/field/components/Select/LightSelect/index.d.ts +1 -1
  12. package/es/field/components/Select/index.d.ts +1 -1
  13. package/es/field/components/Select/index.js +0 -2
  14. package/es/field/components/Switch/index.d.ts +1 -1
  15. package/es/field/components/TreeSelect/index.d.ts +3 -3
  16. package/es/form/components/Cascader/index.d.ts +1 -1
  17. package/es/form/components/ColorPicker/index.d.ts +1 -1
  18. package/es/form/components/DateRangePicker/DateTimeRangePicker.d.ts +1 -1
  19. package/es/form/components/Digit/DigitRange.d.ts +2 -2
  20. package/es/form/components/Digit/index.d.ts +1 -1
  21. package/es/form/components/Money/index.d.ts +1 -1
  22. package/es/form/components/Radio/index.d.ts +2 -2
  23. package/es/form/components/Rate/index.d.ts +1 -1
  24. package/es/form/components/Slider/index.d.ts +1 -1
  25. package/es/form/components/TextArea/index.d.ts +1 -1
  26. package/es/form/layouts/ProForm/index.d.ts +1 -1
  27. package/es/layout/components/SiderMenu/BaseMenu.js +0 -2
  28. package/es/list/ListView.js +3 -3
  29. package/es/provider/index.js +1 -1
  30. package/es/table/Store/Provide.d.ts +0 -1
  31. package/es/table/Store/Provide.js +1 -1
  32. package/es/table/Table.js +0 -1
  33. package/es/table/typing.d.ts +0 -4
  34. package/es/table/utils/cellRenderToFromItem.d.ts +1 -1
  35. package/es/table/utils/columnRender.d.ts +1 -1
  36. package/es/table/utils/columnRender.js +1 -4
  37. package/es/table/utils/genProColumnToColumn.d.ts +2 -2
  38. package/es/table/utils/index.d.ts +0 -10
  39. package/es/table/utils/index.js +0 -12
  40. package/es/utils/useEditableArray/index.d.ts +1 -1
  41. package/es/utils/useEditableArray/index.js +1 -1
  42. package/es/utils/useLazyKVMap.d.ts +5 -0
  43. package/es/utils/useLazyKVMap.js +28 -0
  44. package/es/utils/useMediaQuery/index.d.ts +2 -2
  45. package/es/utils/usePagination.d.ts +8 -0
  46. package/es/utils/usePagination.js +67 -0
  47. package/es/utils/useSelection.d.ts +19 -0
  48. package/es/utils/useSelection.js +61 -0
  49. package/lib/descriptions/index.d.ts +0 -2
  50. package/lib/descriptions/index.js +1 -5
  51. package/lib/field/components/Select/index.js +0 -2
  52. package/lib/form/components/DateRangePicker/DateTimeRangePicker.d.ts +1 -1
  53. package/lib/layout/components/SiderMenu/BaseMenu.js +0 -2
  54. package/lib/list/ListView.js +4 -4
  55. package/lib/provider/index.js +1 -1
  56. package/lib/table/Store/Provide.d.ts +0 -1
  57. package/lib/table/Store/Provide.js +1 -1
  58. package/lib/table/Table.js +0 -1
  59. package/lib/table/typing.d.ts +0 -4
  60. package/lib/table/utils/cellRenderToFromItem.d.ts +1 -1
  61. package/lib/table/utils/columnRender.d.ts +1 -1
  62. package/lib/table/utils/columnRender.js +1 -4
  63. package/lib/table/utils/genProColumnToColumn.d.ts +2 -2
  64. package/lib/table/utils/index.d.ts +0 -10
  65. package/lib/table/utils/index.js +3 -15
  66. package/lib/utils/useEditableArray/index.d.ts +1 -1
  67. package/lib/utils/useEditableArray/index.js +2 -2
  68. package/lib/utils/useLazyKVMap.d.ts +5 -0
  69. package/lib/utils/useLazyKVMap.js +34 -0
  70. package/lib/utils/usePagination.d.ts +8 -0
  71. package/lib/utils/usePagination.js +74 -0
  72. package/lib/utils/useSelection.d.ts +19 -0
  73. package/lib/utils/useSelection.js +68 -0
  74. package/package.json +2 -1
@@ -9,8 +9,6 @@ export interface DescriptionsItemProps {
9
9
  className?: string;
10
10
  style?: React.CSSProperties;
11
11
  label?: React.ReactNode;
12
- labelStyle?: React.CSSProperties;
13
- contentStyle?: React.CSSProperties;
14
12
  children: React.ReactNode;
15
13
  span?: number;
16
14
  }
@@ -9,8 +9,6 @@ import ProSkeleton from "../skeleton";
9
9
  import { ErrorBoundary, InlineErrorFormItem, LabelIconTip, genCopyable, getFieldPropsOrFormItemProps, stringify, useEditableMap } from "../utils";
10
10
  import useFetchData from "./useFetchData";
11
11
 
12
- // todo remove it
13
-
14
12
  /**
15
13
  * 定义列表属性的类型定义,用于定义列表的一列
16
14
  * @typedef {Object} ProDescriptionsItemProps
@@ -297,7 +295,6 @@ const ProDescriptions = props => {
297
295
  actionRef,
298
296
  onRequestError,
299
297
  emptyText,
300
- contentStyle,
301
298
  ...rest
302
299
  } = props;
303
300
  const proContext = useContext(ProConfigContext);
@@ -415,8 +412,7 @@ const ProDescriptions = props => {
415
412
  ...rest,
416
413
  styles: {
417
414
  content: {
418
- minWidth: 0,
419
- ...(contentStyle || {})
415
+ minWidth: 0
420
416
  }
421
417
  },
422
418
  extra: rest.extra ? /*#__PURE__*/_jsxs(Space, {
@@ -9,9 +9,9 @@ export type GroupProps = {
9
9
  } & FieldSelectProps;
10
10
  declare const _default: React.ForwardRefExoticComponent<import("../../../provider").BaseProFieldFC & import("../../../provider").ProRenderFieldPropsType & {
11
11
  options?: (string | number | import("antd").CheckboxOptionType<any>)[] | undefined;
12
- radioType?: "radio" | "button" | undefined;
12
+ radioType?: "button" | "radio" | undefined;
13
13
  placeholder?: string | undefined;
14
- variant?: "outlined" | "borderless" | "filled" | undefined;
14
+ variant?: "outlined" | "filled" | "borderless" | undefined;
15
15
  } & {
16
16
  text: string;
17
17
  valueEnum?: import("src/utils/typing").ProFieldValueEnumType | undefined;
@@ -19,7 +19,7 @@ declare const _default: React.ForwardRefExoticComponent<import("../../../provide
19
19
  request?: import("src/utils/typing").ProFieldRequestData | undefined;
20
20
  params?: any;
21
21
  fieldProps?: any;
22
- variant?: "outlined" | "borderless" | "filled" | undefined;
22
+ variant?: "outlined" | "filled" | "borderless" | undefined;
23
23
  id?: string | undefined;
24
24
  defaultKeyWords?: string | undefined;
25
25
  } & import("../../PureProField").ProFieldLightProps & React.RefAttributes<any>>;
@@ -6,7 +6,7 @@ export type GroupProps = {
6
6
  options?: CheckboxGroupProps['options'];
7
7
  } & FieldSelectProps;
8
8
  declare const _default: React.ForwardRefExoticComponent<import("src/provider").BaseProFieldFC & import("src/provider").ProRenderFieldPropsType & {
9
- layout?: "vertical" | "horizontal" | undefined;
9
+ layout?: "horizontal" | "vertical" | undefined;
10
10
  options?: (string | number | import("antd/lib/checkbox").CheckboxOptionType<any>)[] | undefined;
11
11
  } & {
12
12
  text: string;
@@ -15,7 +15,7 @@ declare const _default: React.ForwardRefExoticComponent<import("src/provider").B
15
15
  request?: import("src/utils/typing").ProFieldRequestData | undefined;
16
16
  params?: any;
17
17
  fieldProps?: any;
18
- variant?: "outlined" | "borderless" | "filled" | undefined;
18
+ variant?: "outlined" | "filled" | "borderless" | undefined;
19
19
  id?: string | undefined;
20
20
  defaultKeyWords?: string | undefined;
21
21
  } & import("../../PureProField").ProFieldLightProps & React.RefAttributes<any>>;
@@ -2,6 +2,6 @@ import type { ColorPickerProps } from 'antd';
2
2
  import React from 'react';
3
3
  declare const _default: React.ForwardRefExoticComponent<import("src/provider").BaseProFieldFC & import("src/provider").ProRenderFieldPropsType & {
4
4
  text: string;
5
- mode?: "update" | "edit" | "read" | undefined;
5
+ mode?: "update" | "read" | "edit" | undefined;
6
6
  } & Partial<Omit<ColorPickerProps, "value" | "mode">> & React.RefAttributes<any>>;
7
7
  export default _default;
@@ -4,7 +4,7 @@ declare const _default: React.ForwardRefExoticComponent<import("../../../provide
4
4
  text: string | number;
5
5
  format?: string | undefined;
6
6
  showTime?: boolean | undefined;
7
- variant?: "outlined" | "borderless" | "filled" | "underlined" | undefined;
8
- picker?: "date" | "time" | "month" | "week" | "year" | "quarter" | undefined;
7
+ variant?: "outlined" | "filled" | "borderless" | "underlined" | undefined;
8
+ picker?: "time" | "date" | "month" | "week" | "year" | "quarter" | undefined;
9
9
  } & ProFieldLightProps & React.RefAttributes<any>>;
10
10
  export default _default;
@@ -15,7 +15,7 @@ declare const _default: React.ForwardRefExoticComponent<import("src/provider").B
15
15
  request?: import("src/utils/typing").ProFieldRequestData | undefined;
16
16
  params?: any;
17
17
  fieldProps?: any;
18
- variant?: "outlined" | "borderless" | "filled" | undefined;
18
+ variant?: "outlined" | "filled" | "borderless" | undefined;
19
19
  id?: string | undefined;
20
20
  defaultKeyWords?: string | undefined;
21
21
  } & import("../../PureProField").ProFieldLightProps & React.RefAttributes<any>>;
@@ -3,8 +3,8 @@ import type { ProFieldLightProps } from '../../PureProField';
3
3
  declare const _default: React.ForwardRefExoticComponent<import("../../../provider").BaseProFieldFC & import("../../../provider").ProRenderFieldPropsType & {
4
4
  text: string[];
5
5
  format?: string | undefined;
6
- variant?: "outlined" | "borderless" | "filled" | "underlined" | undefined;
6
+ variant?: "outlined" | "filled" | "borderless" | "underlined" | undefined;
7
7
  showTime?: boolean | undefined;
8
- picker?: "date" | "time" | "month" | "week" | "year" | "quarter" | undefined;
8
+ picker?: "time" | "date" | "month" | "week" | "year" | "quarter" | undefined;
9
9
  } & ProFieldLightProps & React.RefAttributes<any>>;
10
10
  export default _default;
@@ -9,7 +9,7 @@ declare const _default: React.ForwardRefExoticComponent<import("src/provider").B
9
9
  request?: import("src/utils/typing").ProFieldRequestData | undefined;
10
10
  params?: any;
11
11
  fieldProps?: any;
12
- variant?: "outlined" | "borderless" | "filled" | undefined;
12
+ variant?: "outlined" | "filled" | "borderless" | undefined;
13
13
  id?: string | undefined;
14
14
  defaultKeyWords?: string | undefined;
15
15
  } & import("../../PureProField").ProFieldLightProps & React.RefAttributes<any>>;
@@ -30,6 +30,6 @@ declare const _default: React.ForwardRefExoticComponent<SelectProps<any, import(
30
30
  */
31
31
  fetchDataOnSearch?: boolean | undefined;
32
32
  /** 变体类型 */
33
- variant?: "outlined" | "borderless" | "filled" | "underlined" | undefined;
33
+ variant?: "outlined" | "filled" | "borderless" | "underlined" | undefined;
34
34
  } & ProFieldLightProps & SelectProps<any, import("antd/es/select").DefaultOptionType> & React.RefAttributes<any>>;
35
35
  export default _default;
@@ -43,7 +43,7 @@ declare const _default: React.ForwardRefExoticComponent<import("../../../provide
43
43
  params?: any;
44
44
  /** 组件的全局设置 */
45
45
  fieldProps?: any;
46
- variant?: "outlined" | "borderless" | "filled" | undefined;
46
+ variant?: "outlined" | "filled" | "borderless" | undefined;
47
47
  id?: string | undefined;
48
48
  /** 默认搜素条件 */
49
49
  defaultKeyWords?: string | undefined;
@@ -182,10 +182,8 @@ export const useFieldFetchData = props => {
182
182
  keyWords: kw
183
183
  }, props), {
184
184
  revalidateIfStale: !cacheForSwr,
185
- // 打开 cacheForSwr 的时候才应该支持两个功能
186
185
  revalidateOnReconnect: cacheForSwr,
187
186
  shouldRetryOnError: false,
188
- // @todo 这个功能感觉应该搞个API出来
189
187
  revalidateOnFocus: false
190
188
  });
191
189
  const resOptions = useMemo(() => {
@@ -3,6 +3,6 @@ import React from 'react';
3
3
  declare const _default: React.ForwardRefExoticComponent<import("../../../provider").BaseProFieldFC & import("../../../provider").ProRenderFieldPropsType & {
4
4
  text: boolean;
5
5
  fieldProps?: SwitchProps | undefined;
6
- variant?: "outlined" | "borderless" | "filled" | undefined;
6
+ variant?: "outlined" | "filled" | "borderless" | undefined;
7
7
  } & React.RefAttributes<any>>;
8
8
  export default _default;
@@ -16,8 +16,8 @@ export type TreeSelectFieldProps = TreeSelectProps<any> & {
16
16
  };
17
17
  declare const _default: React.ForwardRefExoticComponent<import("../../../provider").BaseProFieldFC & import("../../../provider").ProRenderFieldPropsType & {
18
18
  options?: (string | number | import("antd").CheckboxOptionType<any>)[] | undefined;
19
- radioType?: "radio" | "button" | undefined;
20
- variant?: "outlined" | "borderless" | "filled" | undefined;
19
+ radioType?: "button" | "radio" | undefined;
20
+ variant?: "outlined" | "filled" | "borderless" | undefined;
21
21
  } & {
22
22
  text: string;
23
23
  valueEnum?: import("src/utils/typing").ProFieldValueEnumType | undefined;
@@ -25,7 +25,7 @@ declare const _default: React.ForwardRefExoticComponent<import("../../../provide
25
25
  request?: import("src/utils/typing").ProFieldRequestData | undefined;
26
26
  params?: any;
27
27
  fieldProps?: any;
28
- variant?: "outlined" | "borderless" | "filled" | undefined;
28
+ variant?: "outlined" | "filled" | "borderless" | undefined;
29
29
  id?: string | undefined;
30
30
  defaultKeyWords?: string | undefined;
31
31
  } & import("../../PureProField").ProFieldLightProps & React.RefAttributes<any>>;
@@ -8,7 +8,7 @@ declare const _default: React.ForwardRefExoticComponent<{
8
8
  emptyText?: React.ReactNode;
9
9
  cacheForSwr?: boolean | undefined;
10
10
  disabled?: boolean | undefined;
11
- width?: number | "xs" | "sm" | "md" | "lg" | "xl" | undefined;
11
+ width?: number | "xl" | "lg" | "md" | "sm" | "xs" | undefined;
12
12
  proFieldProps?: import("src/utils").ProFieldProps | undefined;
13
13
  footerRender?: import("../../typing").LightFilterFooterRender | undefined;
14
14
  children?: any;
@@ -16,7 +16,7 @@ declare const _default: React.ForwardRefExoticComponent<{
16
16
  emptyText?: React.ReactNode;
17
17
  cacheForSwr?: boolean | undefined;
18
18
  disabled?: boolean | undefined;
19
- width?: number | "xs" | "sm" | "md" | "lg" | "xl" | undefined;
19
+ width?: number | "xl" | "lg" | "md" | "sm" | "xs" | undefined;
20
20
  proFieldProps?: import("src/utils").ProFieldProps | undefined;
21
21
  footerRender?: import("../../typing").LightFilterFooterRender | undefined;
22
22
  children?: any;
@@ -1,4 +1,4 @@
1
- import { RangePickerProps } from 'antd/lib/date-picker';
1
+ import type { RangePickerProps } from 'antd/lib/date-picker';
2
2
  import React from 'react';
3
3
  import type { ProFormFieldItemProps } from '../../typing';
4
4
  /**
@@ -13,7 +13,7 @@ export type ProFormDigitRangeProps = ProFormFieldItemProps<RangeInputNumberProps
13
13
  separatorWidth?: number;
14
14
  };
15
15
  declare const ForwardRefProFormDigit: React.ForwardRefExoticComponent<{
16
- fieldProps?: Partial<import("../../typing").FieldProps<any> & Omit<InputNumberProps<number>, "value" | "placeholder" | "onChange" | "defaultValue"> & {
16
+ fieldProps?: Partial<import("../../typing").FieldProps<any> & Omit<InputNumberProps<number>, "defaultValue" | "onChange" | "value" | "placeholder"> & {
17
17
  value?: ValuePair | undefined;
18
18
  defaultValue?: ValuePair | undefined;
19
19
  onChange?: ((value?: ValuePair) => void) | undefined;
@@ -23,7 +23,7 @@ declare const ForwardRefProFormDigit: React.ForwardRefExoticComponent<{
23
23
  emptyText?: React.ReactNode;
24
24
  cacheForSwr?: boolean | undefined;
25
25
  disabled?: boolean | undefined;
26
- width?: number | "xs" | "sm" | "md" | "lg" | "xl" | undefined;
26
+ width?: number | "xl" | "lg" | "md" | "sm" | "xs" | undefined;
27
27
  proFieldProps?: import("src/utils").ProFieldProps | undefined;
28
28
  footerRender?: import("../../typing").LightFilterFooterRender | undefined;
29
29
  children?: any;
@@ -12,7 +12,7 @@ declare const ForwardRefProFormDigit: React.ForwardRefExoticComponent<{
12
12
  emptyText?: React.ReactNode;
13
13
  cacheForSwr?: boolean | undefined;
14
14
  disabled?: boolean | undefined;
15
- width?: number | "xs" | "sm" | "md" | "lg" | "xl" | undefined;
15
+ width?: number | "xl" | "lg" | "md" | "sm" | "xs" | undefined;
16
16
  proFieldProps?: import("src/utils").ProFieldProps | undefined;
17
17
  footerRender?: import("../../typing").LightFilterFooterRender | undefined;
18
18
  children?: any;
@@ -16,7 +16,7 @@ declare const _default: React.ForwardRefExoticComponent<{
16
16
  emptyText?: React.ReactNode;
17
17
  cacheForSwr?: boolean | undefined;
18
18
  disabled?: boolean | undefined;
19
- width?: number | "xs" | "sm" | "md" | "lg" | "xl" | undefined;
19
+ width?: number | "xl" | "lg" | "md" | "sm" | "xs" | undefined;
20
20
  proFieldProps?: import("src/utils").ProFieldProps | undefined;
21
21
  footerRender?: import("../../typing").LightFilterFooterRender | undefined;
22
22
  children?: any;
@@ -15,7 +15,7 @@ declare const ProFormRadio: React.ComponentClass<{
15
15
  emptyText?: React.ReactNode;
16
16
  cacheForSwr?: boolean | undefined;
17
17
  disabled?: boolean | undefined;
18
- width?: number | "xs" | "sm" | "md" | "lg" | "xl" | undefined;
18
+ width?: number | "xl" | "lg" | "md" | "sm" | "xs" | undefined;
19
19
  proFieldProps?: import("src/utils/typing").ProFieldProps | undefined;
20
20
  footerRender?: import("../../typing").LightFilterFooterRender | undefined;
21
21
  children?: any;
@@ -29,7 +29,7 @@ declare const ProFormRadio: React.ComponentClass<{
29
29
  emptyText?: React.ReactNode;
30
30
  cacheForSwr?: boolean | undefined;
31
31
  disabled?: boolean | undefined;
32
- width?: number | "xs" | "sm" | "md" | "lg" | "xl" | undefined;
32
+ width?: number | "xl" | "lg" | "md" | "sm" | "xs" | undefined;
33
33
  proFieldProps?: import("src/utils/typing").ProFieldProps | undefined;
34
34
  footerRender?: import("../../typing").LightFilterFooterRender | undefined;
35
35
  children?: any;
@@ -7,7 +7,7 @@ declare const _default: React.ForwardRefExoticComponent<{
7
7
  emptyText?: React.ReactNode;
8
8
  cacheForSwr?: boolean | undefined;
9
9
  disabled?: boolean | undefined;
10
- width?: number | "xs" | "sm" | "md" | "lg" | "xl" | undefined;
10
+ width?: number | "xl" | "lg" | "md" | "sm" | "xs" | undefined;
11
11
  proFieldProps?: import("src/utils").ProFieldProps | undefined;
12
12
  footerRender?: import("../../typing").LightFilterFooterRender | undefined;
13
13
  children?: any;
@@ -22,7 +22,7 @@ declare const ProFormSlider: React.ForwardRefExoticComponent<{
22
22
  emptyText?: React.ReactNode;
23
23
  cacheForSwr?: boolean | undefined;
24
24
  disabled?: boolean | undefined;
25
- width?: number | "xs" | "sm" | "md" | "lg" | "xl" | undefined;
25
+ width?: number | "xl" | "lg" | "md" | "sm" | "xs" | undefined;
26
26
  proFieldProps?: import("src/utils").ProFieldProps | undefined;
27
27
  footerRender?: import("../../typing").LightFilterFooterRender | undefined;
28
28
  children?: any;
@@ -8,7 +8,7 @@ declare const _default: React.ForwardRefExoticComponent<{
8
8
  emptyText?: React.ReactNode;
9
9
  cacheForSwr?: boolean | undefined;
10
10
  disabled?: boolean | undefined;
11
- width?: number | "xs" | "sm" | "md" | "lg" | "xl" | undefined;
11
+ width?: number | "xl" | "lg" | "md" | "sm" | "xs" | undefined;
12
12
  proFieldProps?: import("src/utils").ProFieldProps | undefined;
13
13
  footerRender?: import("../../typing").LightFilterFooterRender | undefined;
14
14
  children?: any;
@@ -14,7 +14,7 @@ declare namespace ProForm {
14
14
  var Provider: React.FC<import("antd/es/form/context").FormProviderProps>;
15
15
  var useFormInstance: typeof import("antd/es/form/hooks/useFormInstance").default;
16
16
  var EditOrReadOnlyContext: React.Context<{
17
- mode: "update" | "edit" | "read";
17
+ mode: "update" | "read" | "edit";
18
18
  }>;
19
19
  }
20
20
  export { ProForm };
@@ -8,8 +8,6 @@ import { isImg, isUrl } from "../../../utils";
8
8
  import { defaultSettings } from "../../defaultSettings";
9
9
  import { getOpenKeysFromMenuData } from "../../utils/utils";
10
10
  import { useStyle } from "./style/menu";
11
-
12
- // todo
13
11
  import { jsx as _jsx } from "react/jsx-runtime";
14
12
  import { jsxs as _jsxs } from "react/jsx-runtime";
15
13
  import { createElement as _createElement } from "react";
@@ -1,11 +1,11 @@
1
1
  import { get } from '@rc-component/util';
2
2
  import { ConfigProvider, List } from 'antd';
3
- import useLazyKVMap from 'antd/lib/table/hooks/useLazyKVMap';
4
- import usePagination from 'antd/lib/table/hooks/usePagination';
5
- import useSelection from 'antd/lib/table/hooks/useSelection';
6
3
  import { clsx } from 'clsx';
7
4
  import React, { useContext } from 'react';
8
5
  import { ProProvider } from "../provider";
6
+ import useLazyKVMap from "../utils/useLazyKVMap";
7
+ import usePagination from "../utils/usePagination";
8
+ import useSelection from "../utils/useSelection";
9
9
  import { PRO_LIST_KEYS_MAP } from "./constants";
10
10
  import ProListItem from "./Item";
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
1
  import { useCacheToken } from '@ant-design/cssinjs';
2
2
  import { ConfigProvider as AntdConfigProvider, theme as antdTheme } from 'antd';
3
- import zh_CN from 'antd/lib/locale/zh_CN';
3
+ import zh_CN from 'antd/es/locale/zh_CN';
4
4
  import dayjs from 'dayjs';
5
5
  import 'dayjs/locale/zh-cn';
6
6
  import React, { useContext, useEffect, useMemo } from 'react';
@@ -13,7 +13,6 @@ export type ColumnsState = {
13
13
  };
14
14
  export type ProTableColumn<T> = ColumnsState & TableColumnType<T>;
15
15
  export type UseContainerProps<T = any> = {
16
- onColumnsStateChange?: (map: Record<string, ColumnsState>) => void;
17
16
  size?: DensitySize;
18
17
  defaultSize?: DensitySize;
19
18
  onSizeChange?: (size: DensitySize) => void;
@@ -69,7 +69,7 @@ function useContainer(props = {}) {
69
69
  }
70
70
  return props.columnsState?.value || props.columnsState?.defaultValue || defaultColumnKeyMap;
71
71
  }, props.columnsState?.value);
72
- const onColumnsMapChange = props.columnsState?.onChange || props.onColumnsStateChange;
72
+ const onColumnsMapChange = props.columnsState?.onChange;
73
73
  const setColumnsMap = useCallback(updater => {
74
74
  setColumnsMapInner(prev => {
75
75
  const next = typeof updater === 'function' ? updater(prev) : updater;
package/es/table/Table.js CHANGED
@@ -786,7 +786,6 @@ const ProviderTableContainer = props => {
786
786
  ...props,
787
787
  columnsState: props.columnsState,
788
788
  columns: props.columns,
789
- onColumnsStateChange: props.onColumnsStateChange,
790
789
  onSizeChange: props.onSizeChange,
791
790
  size: props.size,
792
791
  defaultSize: props.defaultSize
@@ -162,10 +162,6 @@ export type ProTableProps<DataSource, U, ValueType = 'text'> = {
162
162
  params?: U;
163
163
  /** @name 列状态的配置,可以用来操作列功能 */
164
164
  columnsState?: ColumnStateType;
165
- /**
166
- * @deprecated 请使用 columnsState.onChange。保留兼容,后续版本将移除。
167
- */
168
- onColumnsStateChange?: (map: Record<string, ColumnsState>) => void;
169
165
  onSizeChange?: (size: DensitySize) => void;
170
166
  /**
171
167
  * @name table 外面卡片的设置
@@ -1,4 +1,4 @@
1
- import { AnyObject } from 'antd/lib/_util/type';
1
+ import type { AnyObject } from 'antd/lib/_util/type';
2
2
  import React from 'react';
3
3
  import type { ProFieldEmptyText } from '../../field';
4
4
  import type { ProFormFieldProps } from '../../form';
@@ -1,4 +1,4 @@
1
- import { AnyObject } from 'antd/lib/_util/type';
1
+ import type { AnyObject } from 'antd/lib/_util/type';
2
2
  import React from 'react';
3
3
  import type { ProFieldEmptyText } from '../../field';
4
4
  import type { ProSchemaComponentTypes, UseEditableUtilType } from '../../utils';
@@ -17,10 +17,7 @@ export const renderColumnsTitle = item => {
17
17
  } = item;
18
18
  const ellipsis = typeof item?.ellipsis === 'boolean' ? item?.ellipsis : item?.ellipsis?.showTitle;
19
19
  if (title && typeof title === 'function') {
20
- return title(item, 'table', /*#__PURE__*/_jsx(LabelIconTip, {
21
- label: null,
22
- tooltip: item.tooltip
23
- }));
20
+ return title(item, 'table', null);
24
21
  }
25
22
  return /*#__PURE__*/_jsx(LabelIconTip, {
26
23
  label: title,
@@ -1,6 +1,6 @@
1
1
  import type { TableColumnType, TableProps } from 'antd';
2
- import { AnyObject } from 'antd/lib/_util/type';
3
- import { SortOrder } from 'antd/lib/table/interface';
2
+ import type { AnyObject } from 'antd/lib/_util/type';
3
+ import type { SortOrder } from 'antd/lib/table/interface';
4
4
  import type { ProFieldEmptyText } from '../../field';
5
5
  import type { ProSchemaComponentTypes, UseEditableUtilType } from '../../utils';
6
6
  import type { ContainerType } from '../Store/Provide';
@@ -75,22 +75,12 @@ export declare const flattenColumns: (data: any[]) => any[];
75
75
  * @returns 是否为本地筛选
76
76
  */
77
77
  export declare const isLocalFilter: <T>(filters: ProColumnType<T>['filters'], onFilter: ProColumnType<T>['onFilter']) => boolean;
78
- /**
79
- * @deprecated typo kept for backward compatibility
80
- * use `isLocalFilter` instead
81
- */
82
- export declare const isLocaleFilter: <T>(filters: ProColumnType<T>['filters'], onFilter: ProColumnType<T>['onFilter']) => boolean;
83
78
  /**
84
79
  * 判断是否为本地排序
85
80
  * @param sorter 排序配置
86
81
  * @returns 是否为本地排序
87
82
  */
88
83
  export declare const isLocalSorter: <T>(sorter: ProSorter<T>) => boolean;
89
- /**
90
- * @deprecated typo kept for backward compatibility
91
- * use `isLocalSorter` instead
92
- */
93
- export declare const isLocaleSorter: <T>(sorter: ProSorter<T>) => boolean;
94
84
  /**
95
85
  * 获取服务端筛选数据
96
86
  * @param filters 筛选数据
@@ -170,12 +170,6 @@ export const isLocalFilter = (filters, onFilter) => {
170
170
  return !!filters && !!onFilter;
171
171
  };
172
172
 
173
- /**
174
- * @deprecated typo kept for backward compatibility
175
- * use `isLocalFilter` instead
176
- */
177
- export const isLocaleFilter = isLocalFilter;
178
-
179
173
  /**
180
174
  * 判断是否为本地排序
181
175
  * @param sorter 排序配置
@@ -185,12 +179,6 @@ export const isLocalSorter = sorter => {
185
179
  return typeof sorter === 'function' || typeof sorter === 'object' && typeof sorter.compare === 'function';
186
180
  };
187
181
 
188
- /**
189
- * @deprecated typo kept for backward compatibility
190
- * use `isLocalSorter` instead
191
- */
192
- export const isLocaleSorter = isLocalSorter;
193
-
194
182
  /**
195
183
  * 获取服务端筛选数据
196
184
  * @param filters 筛选数据
@@ -1,5 +1,5 @@
1
1
  import type { FormInstance, FormProps } from 'antd';
2
- import { AnyObject } from 'antd/lib/_util/type';
2
+ import type { AnyObject } from 'antd/lib/_util/type';
3
3
  import type { NamePath } from 'antd/lib/form/interface';
4
4
  import type { GetRowKey } from 'antd/lib/table/interface';
5
5
  import React from 'react';
@@ -1,7 +1,6 @@
1
1
  /* eslint-disable react-hooks/exhaustive-deps */import { LoadingOutlined } from '@ant-design/icons';
2
2
  import { get, warning as rcWarning, set, useControlledState } from '@rc-component/util';
3
3
  import { Form, Popconfirm, message } from 'antd';
4
- import useLazyKVMap from 'antd/lib/table/hooks/useLazyKVMap';
5
4
  import React, { createRef, forwardRef, useCallback, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
6
5
  import { useDebounceFn, useRefFunction } from '..';
7
6
  import { useIntl } from "../../provider";
@@ -9,6 +8,7 @@ import { ProFormContext } from "../components/ProFormContext";
9
8
  import { useDeepCompareEffectDebounce } from "../hooks/useDeepCompareEffect";
10
9
  import { usePrevious } from "../hooks/usePrevious";
11
10
  import { merge } from "../merge";
11
+ import useLazyKVMap from "../useLazyKVMap";
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { jsxs as _jsxs } from "react/jsx-runtime";
14
14
  const {
@@ -0,0 +1,5 @@
1
+ import type { AnyObject } from 'antd/lib/_util/type';
2
+ import type { GetRowKey } from 'antd/lib/table/interface';
3
+ import React from 'react';
4
+ declare const useLazyKVMap: <RecordType extends AnyObject = AnyObject>(data: readonly RecordType[], childrenColumnName: string, getRowKey: GetRowKey<RecordType>) => readonly [(key: React.Key) => RecordType | undefined];
5
+ export default useLazyKVMap;
@@ -0,0 +1,28 @@
1
+ import { useRef } from 'react';
2
+ const useLazyKVMap = (data, childrenColumnName, getRowKey) => {
3
+ const mapCacheRef = useRef({});
4
+ function getRecordByKey(key) {
5
+ function dig(records, kv) {
6
+ records.forEach((record, index) => {
7
+ const rowKey = getRowKey(record, index);
8
+ kv.set(rowKey, record);
9
+ if (record && typeof record === 'object' && childrenColumnName in record) {
10
+ dig(record[childrenColumnName] || [], kv);
11
+ }
12
+ });
13
+ }
14
+ if (!mapCacheRef.current || mapCacheRef.current.data !== data || mapCacheRef.current.childrenColumnName !== childrenColumnName || mapCacheRef.current.getRowKey !== getRowKey) {
15
+ const kvMap = new Map();
16
+ dig(data, kvMap);
17
+ mapCacheRef.current = {
18
+ data,
19
+ childrenColumnName,
20
+ kvMap,
21
+ getRowKey
22
+ };
23
+ }
24
+ return mapCacheRef.current.kvMap?.get(key);
25
+ }
26
+ return [getRecordByKey];
27
+ };
28
+ export default useLazyKVMap;
@@ -35,6 +35,6 @@ export type MediaQueryKey = keyof typeof MediaQueryEnum;
35
35
  * `Rendered more hooks than during the previous render.`
36
36
  * So should use Array.forEach
37
37
  */
38
- export declare const getScreenClassName: () => "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
39
- declare const useBreakpoint: () => "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined;
38
+ export declare const getScreenClassName: () => "xxl" | "xl" | "lg" | "md" | "sm" | "xs" | undefined;
39
+ declare const useBreakpoint: () => "xxl" | "xl" | "lg" | "md" | "sm" | "xs" | undefined;
40
40
  export { useBreakpoint };
@@ -0,0 +1,8 @@
1
+ import type { TablePaginationConfig } from 'antd/es/table/interface';
2
+ export declare const DEFAULT_PAGE_SIZE = 10;
3
+ export declare function getPaginationParam(mergedPagination: TablePaginationConfig, pagination?: TablePaginationConfig | boolean): any;
4
+ declare function usePagination(total: number, onChange: (current: number, pageSize: number) => void, pagination?: TablePaginationConfig | false): readonly [
5
+ TablePaginationConfig,
6
+ (current?: number, pageSize?: number) => void
7
+ ];
8
+ export default usePagination;