@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.
- package/dist/pro-components.min.js +1 -1
- package/es/card/components/Actions/index.js +1 -4
- package/es/card/components/Card/index.js +23 -15
- package/es/card/components/Card/style.js +34 -8
- package/es/card/components/CheckCard/Group.js +1 -3
- package/es/card/components/CheckCard/index.js +0 -1
- package/es/card/components/Divider/index.d.ts +1 -1
- package/es/card/components/Divider/index.js +2 -2
- package/es/card/components/Divider/style.d.ts +4 -1
- package/es/card/components/Divider/style.js +6 -39
- package/es/card/components/Statistic/index.js +1 -1
- package/es/card/typing.d.ts +2 -6
- package/es/descriptions/index.d.ts +3 -5
- package/es/descriptions/index.js +6 -6
- package/es/descriptions/useFetchData.js +0 -1
- package/es/field/AllProField.js +0 -4
- package/es/field/PureProField.js +0 -5
- package/es/field/components/Checkbox/index.js +2 -5
- package/es/field/components/DatePicker/index.d.ts +1 -1
- package/es/field/components/DigitRange/index.js +1 -0
- package/es/field/components/Options/index.js +0 -3
- package/es/field/components/Percent/util.d.ts +1 -1
- package/es/field/components/RangePicker/index.d.ts +1 -1
- package/es/field/components/Select/SearchSelect/index.js +0 -1
- package/es/field/components/Switch/index.js +0 -1
- package/es/field/components/Text/index.js +4 -1
- package/es/form/BaseForm/BaseForm.js +0 -3
- package/es/form/BaseForm/LightWrapper/index.d.ts +2 -1
- package/es/form/components/Captcha/index.js +0 -3
- package/es/form/components/Checkbox/index.js +5 -1
- package/es/form/components/DatePicker/index.js +0 -2
- package/es/form/components/FieldSet/index.js +16 -6
- package/es/form/components/FormItem/index.js +9 -7
- package/es/form/components/FormItem/warpField.js +3 -15
- package/es/form/components/List/index.d.ts +1 -1
- package/es/form/components/List/index.js +0 -2
- package/es/form/components/Radio/index.js +5 -4
- package/es/form/components/SchemaForm/index.js +0 -1
- package/es/form/components/SchemaForm/layoutType/StepsForm.js +0 -1
- package/es/form/components/Select/index.js +0 -1
- package/es/form/components/Text/index.js +0 -3
- package/es/form/components/UploadButton/index.js +4 -2
- package/es/form/components/UploadDragger/index.js +0 -1
- package/es/form/helpers/grid.js +1 -5
- package/es/form/layouts/DrawerForm/index.js +1 -5
- package/es/form/layouts/LightFilter/index.js +0 -1
- package/es/form/layouts/ModalForm/index.js +1 -4
- package/es/form/layouts/ProForm/index.d.ts +1 -1
- package/es/form/layouts/QueryFilter/index.js +0 -1
- package/es/form/layouts/StepsForm/StepForm.js +0 -1
- package/es/form/layouts/StepsForm/index.js +3 -12
- package/es/layout/ProLayout.js +1 -6
- package/es/layout/components/AppsLogoComponents/style/index.js +4 -0
- package/es/layout/components/FooterToolbar/index.js +0 -3
- package/es/layout/components/GlobalHeader/ActionsContent.js +0 -1
- package/es/layout/components/Header/index.js +1 -3
- package/es/layout/components/PageContainer/index.js +0 -1
- package/es/layout/components/PageContainer/style/index.js +4 -0
- package/es/layout/components/SettingDrawer/BlockCheckbox.js +0 -1
- package/es/layout/components/SettingDrawer/index.js +0 -1
- package/es/layout/components/SettingDrawer/style/index.js +4 -0
- package/es/layout/components/SiderMenu/BaseMenu.js +2 -6
- package/es/layout/components/SiderMenu/SiderMenu.js +1 -3
- package/es/layout/components/SiderMenu/index.js +0 -1
- package/es/layout/components/TopNavHeader/index.js +1 -2
- package/es/layout/style/index.js +4 -0
- package/es/layout/utils/getMenuData.js +0 -1
- package/es/list/Item.d.ts +1 -4
- package/es/list/Item.js +75 -104
- package/es/list/ListView.d.ts +6 -4
- package/es/list/ListView.js +41 -53
- package/es/list/ProListBase.d.ts +74 -0
- package/es/list/ProListBase.js +350 -0
- package/es/list/constants.d.ts +2 -2
- package/es/list/constants.js +2 -5
- package/es/list/index.d.ts +23 -13
- package/es/list/index.js +78 -41
- package/es/list/style/index.d.ts +0 -1
- package/es/list/style/index.js +215 -86
- package/es/provider/index.js +0 -3
- package/es/provider/useStyle/index.d.ts +1 -21
- package/es/provider/useStyle/index.js +6 -3
- package/es/skeleton/components/Descriptions/index.js +1 -4
- package/es/skeleton/components/List/index.js +1 -4
- package/es/table/Store/Provide.js +0 -2
- package/es/table/Table.js +5 -14
- package/es/table/components/ColumnSetting/index.js +0 -1
- package/es/table/components/EditableTable/index.js +0 -1
- package/es/table/components/ListToolBar/index.d.ts +1 -1
- package/es/table/components/ListToolBar/index.js +4 -10
- package/es/table/components/ListToolBar/style.js +1 -1
- package/es/table/components/ToolBar/index.d.ts +1 -1
- package/es/table/style/index.js +4 -0
- package/es/table/typing.d.ts +10 -5
- package/es/table/useFetchData.js +0 -3
- package/es/table/utils/cellRenderToFromItem.js +1 -3
- package/es/table/utils/index.js +0 -1
- package/es/utils/components/LabelIconTip/index.d.ts +3 -4
- package/es/utils/genCopyable/index.d.ts +6 -0
- package/es/utils/genCopyable/index.js +28 -8
- package/es/utils/hooks/useDebounceValue/index.js +1 -3
- package/es/utils/hooks/useDeepCompareEffect/index.js +0 -2
- package/es/utils/index.d.ts +2 -1
- package/es/utils/isDeepEqualReact/index.js +0 -8
- package/es/utils/merge/index.js +0 -3
- package/es/utils/nanoid/index.d.ts +1 -3
- package/es/utils/nanoid/index.js +2 -10
- package/es/utils/proFieldParsingText/index.js +1 -3
- package/es/utils/typing.d.ts +2 -1
- package/es/utils/useEditableArray/index.js +1 -1
- package/es/utils/useEditableMap/index.js +1 -1
- package/guidelines/overview-components.md +1 -1
- package/lib/card/components/Actions/index.js +1 -4
- package/lib/card/components/Card/index.js +23 -15
- package/lib/card/components/Card/style.js +34 -8
- package/lib/card/components/CheckCard/Group.js +1 -3
- package/lib/card/components/CheckCard/index.js +0 -1
- package/lib/card/components/Divider/index.d.ts +1 -1
- package/lib/card/components/Divider/index.js +2 -2
- package/lib/card/components/Divider/style.d.ts +4 -1
- package/lib/card/components/Divider/style.js +5 -39
- package/lib/card/components/Statistic/index.js +1 -1
- package/lib/card/typing.d.ts +2 -6
- package/lib/descriptions/index.d.ts +3 -5
- package/lib/descriptions/index.js +6 -6
- package/lib/descriptions/useFetchData.js +0 -1
- package/lib/field/AllProField.js +0 -4
- package/lib/field/PureProField.js +0 -5
- package/lib/field/components/Checkbox/index.js +2 -5
- package/lib/field/components/DatePicker/index.d.ts +1 -1
- package/lib/field/components/DigitRange/index.js +1 -0
- package/lib/field/components/Options/index.js +0 -3
- package/lib/field/components/Percent/util.d.ts +1 -1
- package/lib/field/components/RangePicker/index.d.ts +1 -1
- package/lib/field/components/Select/SearchSelect/index.js +0 -1
- package/lib/field/components/Switch/index.js +0 -1
- package/lib/field/components/Text/index.js +4 -1
- package/lib/form/BaseForm/BaseForm.js +0 -4
- package/lib/form/BaseForm/LightWrapper/index.d.ts +2 -1
- package/lib/form/components/Captcha/index.js +0 -3
- package/lib/form/components/Checkbox/index.js +5 -1
- package/lib/form/components/DatePicker/index.js +0 -2
- package/lib/form/components/FieldSet/index.js +16 -6
- package/lib/form/components/FormItem/index.js +9 -7
- package/lib/form/components/FormItem/warpField.js +3 -15
- package/lib/form/components/List/index.d.ts +1 -1
- package/lib/form/components/List/index.js +0 -2
- package/lib/form/components/Radio/index.js +5 -4
- package/lib/form/components/SchemaForm/index.js +0 -1
- package/lib/form/components/SchemaForm/layoutType/StepsForm.js +0 -1
- package/lib/form/components/Select/index.js +0 -1
- package/lib/form/components/Text/index.js +0 -3
- package/lib/form/components/UploadButton/index.js +4 -2
- package/lib/form/components/UploadDragger/index.js +0 -1
- package/lib/form/helpers/grid.js +1 -5
- package/lib/form/layouts/DrawerForm/index.js +1 -5
- package/lib/form/layouts/LightFilter/index.js +0 -1
- package/lib/form/layouts/ModalForm/index.js +1 -4
- package/lib/form/layouts/ProForm/index.d.ts +1 -1
- package/lib/form/layouts/QueryFilter/index.js +0 -2
- package/lib/form/layouts/StepsForm/StepForm.js +0 -1
- package/lib/form/layouts/StepsForm/index.js +3 -12
- package/lib/layout/ProLayout.js +1 -6
- package/lib/layout/components/AppsLogoComponents/style/index.js +4 -0
- package/lib/layout/components/FooterToolbar/index.js +0 -4
- package/lib/layout/components/GlobalHeader/ActionsContent.js +0 -1
- package/lib/layout/components/Header/index.js +1 -3
- package/lib/layout/components/PageContainer/index.js +0 -1
- package/lib/layout/components/PageContainer/style/index.js +4 -0
- package/lib/layout/components/SettingDrawer/BlockCheckbox.js +0 -1
- package/lib/layout/components/SettingDrawer/index.js +0 -1
- package/lib/layout/components/SettingDrawer/style/index.js +4 -0
- package/lib/layout/components/SiderMenu/BaseMenu.js +2 -6
- package/lib/layout/components/SiderMenu/SiderMenu.js +1 -3
- package/lib/layout/components/SiderMenu/index.js +0 -1
- package/lib/layout/components/TopNavHeader/index.js +1 -2
- package/lib/layout/style/index.js +4 -0
- package/lib/layout/utils/getMenuData.js +0 -1
- package/lib/list/Item.d.ts +1 -4
- package/lib/list/Item.js +74 -103
- package/lib/list/ListView.d.ts +6 -4
- package/lib/list/ListView.js +40 -52
- package/lib/list/ProListBase.d.ts +74 -0
- package/lib/list/ProListBase.js +357 -0
- package/lib/list/constants.d.ts +2 -2
- package/lib/list/constants.js +2 -5
- package/lib/list/index.d.ts +23 -13
- package/lib/list/index.js +77 -40
- package/lib/list/style/index.d.ts +0 -1
- package/lib/list/style/index.js +214 -86
- package/lib/provider/index.js +0 -3
- package/lib/provider/useStyle/index.d.ts +1 -21
- package/lib/provider/useStyle/index.js +6 -3
- package/lib/skeleton/components/Descriptions/index.js +1 -4
- package/lib/skeleton/components/List/index.js +1 -4
- package/lib/table/Store/Provide.js +0 -2
- package/lib/table/Table.js +5 -14
- package/lib/table/components/ColumnSetting/index.js +0 -1
- package/lib/table/components/EditableTable/index.js +0 -1
- package/lib/table/components/ListToolBar/index.d.ts +1 -1
- package/lib/table/components/ListToolBar/index.js +4 -10
- package/lib/table/components/ListToolBar/style.js +1 -1
- package/lib/table/components/ToolBar/index.d.ts +1 -1
- package/lib/table/style/index.js +4 -0
- package/lib/table/typing.d.ts +10 -5
- package/lib/table/useFetchData.js +0 -3
- package/lib/table/utils/cellRenderToFromItem.js +1 -3
- package/lib/table/utils/index.js +0 -1
- package/lib/utils/components/LabelIconTip/index.d.ts +3 -4
- package/lib/utils/genCopyable/index.d.ts +6 -0
- package/lib/utils/genCopyable/index.js +28 -8
- package/lib/utils/hooks/useDebounceValue/index.js +1 -3
- package/lib/utils/hooks/useDeepCompareEffect/index.js +0 -2
- package/lib/utils/index.d.ts +2 -1
- package/lib/utils/isDeepEqualReact/index.js +0 -8
- package/lib/utils/merge/index.js +0 -3
- package/lib/utils/nanoid/index.d.ts +1 -3
- package/lib/utils/nanoid/index.js +2 -10
- package/lib/utils/proFieldParsingText/index.js +1 -3
- package/lib/utils/typing.d.ts +2 -1
- package/lib/utils/useEditableArray/index.js +0 -2
- package/lib/utils/useEditableMap/index.js +0 -2
- package/package.json +4 -5
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 内部 List 容器与 List.Item / List.Item.Meta 实现,用于替代 antd List(antd List 已停止维护)
|
|
3
|
+
* 保持与 antd List 相同的 DOM 结构及类名,以便复用 antd 的 list 样式
|
|
4
|
+
*/
|
|
5
|
+
import { ConfigProvider, Empty, Pagination } from 'antd';
|
|
6
|
+
import { clsx } from 'clsx';
|
|
7
|
+
import React, { useContext, useMemo } from 'react';
|
|
8
|
+
import { useBreakpoint } from "../utils/useMediaQuery";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
12
|
+
export const ProListContext = /*#__PURE__*/React.createContext({});
|
|
13
|
+
export const ProListItemMeta = ({
|
|
14
|
+
prefixCls: customizePrefixCls,
|
|
15
|
+
className,
|
|
16
|
+
avatar,
|
|
17
|
+
title,
|
|
18
|
+
description,
|
|
19
|
+
...rest
|
|
20
|
+
}) => {
|
|
21
|
+
const {
|
|
22
|
+
getPrefixCls
|
|
23
|
+
} = useContext(ConfigProvider.ConfigContext);
|
|
24
|
+
const prefixCls = getPrefixCls('pro-list', customizePrefixCls);
|
|
25
|
+
const classString = clsx(`${prefixCls}-item-meta`, className);
|
|
26
|
+
const content = title || description ? /*#__PURE__*/_jsxs("div", {
|
|
27
|
+
className: `${prefixCls}-item-meta-content`,
|
|
28
|
+
children: [title && /*#__PURE__*/_jsx("h4", {
|
|
29
|
+
className: `${prefixCls}-item-meta-title`,
|
|
30
|
+
children: title
|
|
31
|
+
}), description && /*#__PURE__*/_jsx("div", {
|
|
32
|
+
className: `${prefixCls}-item-meta-description`,
|
|
33
|
+
children: description
|
|
34
|
+
})]
|
|
35
|
+
}) : null;
|
|
36
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
37
|
+
...rest,
|
|
38
|
+
className: classString,
|
|
39
|
+
children: [avatar && /*#__PURE__*/_jsx("div", {
|
|
40
|
+
className: `${prefixCls}-item-meta-avatar`,
|
|
41
|
+
children: avatar
|
|
42
|
+
}), content]
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
const InternalProListItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
46
|
+
const {
|
|
47
|
+
prefixCls: customizePrefixCls,
|
|
48
|
+
children,
|
|
49
|
+
actions,
|
|
50
|
+
extra,
|
|
51
|
+
className,
|
|
52
|
+
colStyle,
|
|
53
|
+
...rest
|
|
54
|
+
} = props;
|
|
55
|
+
const {
|
|
56
|
+
grid,
|
|
57
|
+
itemLayout
|
|
58
|
+
} = useContext(ProListContext);
|
|
59
|
+
const {
|
|
60
|
+
getPrefixCls
|
|
61
|
+
} = useContext(ConfigProvider.ConfigContext);
|
|
62
|
+
const prefixCls = getPrefixCls('pro-list', customizePrefixCls);
|
|
63
|
+
const actionsContent = actions && actions.length > 0 ? /*#__PURE__*/_jsx("div", {
|
|
64
|
+
className: `${prefixCls}-item-action`,
|
|
65
|
+
onClick: e => e.stopPropagation(),
|
|
66
|
+
children: actions.map((action, i) => /*#__PURE__*/_jsx("div", {
|
|
67
|
+
className: `${prefixCls}-item-action-item`,
|
|
68
|
+
children: action
|
|
69
|
+
}, i))
|
|
70
|
+
}, "actions") : null;
|
|
71
|
+
const itemChildren = /*#__PURE__*/_jsx("div", {
|
|
72
|
+
...rest,
|
|
73
|
+
className: clsx(`${prefixCls}-item`, className),
|
|
74
|
+
children: itemLayout === 'vertical' && extra ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
75
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
76
|
+
className: `${prefixCls}-item-main`,
|
|
77
|
+
children: [children, actionsContent]
|
|
78
|
+
}, "content"), /*#__PURE__*/_jsx("div", {
|
|
79
|
+
className: `${prefixCls}-item-extra`,
|
|
80
|
+
children: extra
|
|
81
|
+
}, "extra")]
|
|
82
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
83
|
+
children: [children, actionsContent, extra != null && /*#__PURE__*/_jsx(React.Fragment, {
|
|
84
|
+
children: extra
|
|
85
|
+
}, "extra")]
|
|
86
|
+
})
|
|
87
|
+
});
|
|
88
|
+
if (grid) {
|
|
89
|
+
return /*#__PURE__*/_jsx("div", {
|
|
90
|
+
ref: ref,
|
|
91
|
+
style: {
|
|
92
|
+
width: '100%',
|
|
93
|
+
...colStyle
|
|
94
|
+
},
|
|
95
|
+
children: itemChildren
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return itemChildren;
|
|
99
|
+
});
|
|
100
|
+
InternalProListItem.displayName = 'ProListItem';
|
|
101
|
+
export const ProListItem = InternalProListItem;
|
|
102
|
+
ProListItem.Meta = ProListItemMeta;
|
|
103
|
+
function getRowKey(item, index, rowKey) {
|
|
104
|
+
if (typeof rowKey === 'function') {
|
|
105
|
+
return rowKey(item);
|
|
106
|
+
}
|
|
107
|
+
if (rowKey && typeof item === 'object' && item !== null && rowKey in item) {
|
|
108
|
+
return item[rowKey];
|
|
109
|
+
}
|
|
110
|
+
if (typeof item === 'object' && item !== null && 'key' in item) {
|
|
111
|
+
return item.key;
|
|
112
|
+
}
|
|
113
|
+
return `list-item-${index}`;
|
|
114
|
+
}
|
|
115
|
+
const defaultPaginationProps = {
|
|
116
|
+
current: 1,
|
|
117
|
+
total: 0,
|
|
118
|
+
position: 'bottom'
|
|
119
|
+
};
|
|
120
|
+
const ProListContainerInner = /*#__PURE__*/React.forwardRef(function ProListContainerInner(props, ref) {
|
|
121
|
+
const {
|
|
122
|
+
pagination = false,
|
|
123
|
+
prefixCls: customizePrefixCls,
|
|
124
|
+
variant = 'borderless',
|
|
125
|
+
split = true,
|
|
126
|
+
className,
|
|
127
|
+
rootClassName,
|
|
128
|
+
style,
|
|
129
|
+
children,
|
|
130
|
+
itemLayout,
|
|
131
|
+
loadMore,
|
|
132
|
+
grid,
|
|
133
|
+
dataSource = [],
|
|
134
|
+
size: customizeSize = 'default',
|
|
135
|
+
header,
|
|
136
|
+
footer,
|
|
137
|
+
loading = false,
|
|
138
|
+
rowKey,
|
|
139
|
+
renderItem,
|
|
140
|
+
locale,
|
|
141
|
+
hashId: propHashId,
|
|
142
|
+
...rest
|
|
143
|
+
} = props;
|
|
144
|
+
const {
|
|
145
|
+
getPrefixCls
|
|
146
|
+
} = useContext(ConfigProvider.ConfigContext);
|
|
147
|
+
const prefixCls = getPrefixCls('pro-list', customizePrefixCls);
|
|
148
|
+
const paginationObj = pagination && typeof pagination === 'object' ? pagination : {};
|
|
149
|
+
const [paginationCurrent, setPaginationCurrent] = React.useState(paginationObj.defaultCurrent ?? 1);
|
|
150
|
+
const [paginationSize, setPaginationSize] = React.useState(paginationObj.defaultPageSize ?? 10);
|
|
151
|
+
const sizeCls = customizeSize === 'large' ? 'lg' : customizeSize === 'small' ? 'sm' : '';
|
|
152
|
+
const isSomethingAfterLastItem = !!(loadMore || pagination || footer);
|
|
153
|
+
const paginationProps = useMemo(() => ({
|
|
154
|
+
...defaultPaginationProps,
|
|
155
|
+
total: dataSource.length,
|
|
156
|
+
current: paginationCurrent,
|
|
157
|
+
pageSize: paginationSize,
|
|
158
|
+
...(pagination && typeof pagination === 'object' ? pagination : {})
|
|
159
|
+
}), [dataSource.length, pagination, paginationCurrent, paginationSize]);
|
|
160
|
+
const largestPage = Math.ceil(paginationProps.total / (paginationProps.pageSize || 10));
|
|
161
|
+
const currentPage = Math.min(paginationProps.current ?? 1, Math.max(1, largestPage));
|
|
162
|
+
const splitDataSource = useMemo(() => {
|
|
163
|
+
if (!pagination || !dataSource.length) {
|
|
164
|
+
return dataSource;
|
|
165
|
+
}
|
|
166
|
+
const pageSize = paginationProps.pageSize ?? 10;
|
|
167
|
+
const total = paginationProps.total ?? 0;
|
|
168
|
+
// 父组件已分页(如 ListView 传入 pageData)时不再二次 slice
|
|
169
|
+
if (total > 0 && dataSource.length <= pageSize && total > dataSource.length) {
|
|
170
|
+
return dataSource;
|
|
171
|
+
}
|
|
172
|
+
const start = (currentPage - 1) * pageSize;
|
|
173
|
+
return dataSource.slice(start, start + pageSize);
|
|
174
|
+
}, [dataSource, pagination, currentPage, paginationProps.pageSize, paginationProps.total]);
|
|
175
|
+
const renderInternalItem = (item, index) => {
|
|
176
|
+
if (!renderItem) return null;
|
|
177
|
+
const key = getRowKey(item, index, rowKey);
|
|
178
|
+
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
179
|
+
children: renderItem(item, index, null)
|
|
180
|
+
}, key);
|
|
181
|
+
};
|
|
182
|
+
const breakpoint = useBreakpoint();
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* 根据当前断点获取列数
|
|
186
|
+
*/
|
|
187
|
+
const getResponsiveColumn = useMemo(() => {
|
|
188
|
+
if (!grid) return 1;
|
|
189
|
+
const breakpoints = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'];
|
|
190
|
+
const currentBreakpoint = breakpoint || 'md';
|
|
191
|
+
const startIndex = breakpoints.indexOf(currentBreakpoint);
|
|
192
|
+
|
|
193
|
+
// 从当前断点开始,向下查找第一个已定义的列数
|
|
194
|
+
for (let i = startIndex; i < breakpoints.length; i++) {
|
|
195
|
+
const bp = breakpoints[i];
|
|
196
|
+
const colCount = grid[bp];
|
|
197
|
+
if (colCount !== undefined) {
|
|
198
|
+
return colCount;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// 最后使用 column 默认值,确保不为 0(避免除以零)
|
|
203
|
+
return grid.column || 1;
|
|
204
|
+
}, [grid, breakpoint]);
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* 计算 grid 容器样式(flex 布局)
|
|
208
|
+
*/
|
|
209
|
+
const gridContainerStyle = useMemo(() => {
|
|
210
|
+
if (!grid) return undefined;
|
|
211
|
+
const style = {
|
|
212
|
+
display: 'flex',
|
|
213
|
+
flexWrap: 'wrap'
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
// 处理 gutter
|
|
217
|
+
if (grid.gutter) {
|
|
218
|
+
const [horizontal, vertical] = Array.isArray(grid.gutter) ? grid.gutter : [grid.gutter, 0];
|
|
219
|
+
const h = Number(horizontal) || 0;
|
|
220
|
+
const v = Number(vertical) || 0;
|
|
221
|
+
|
|
222
|
+
// flex 容器使用负 margin 来抵消子元素的 padding
|
|
223
|
+
style.marginLeft = -h / 2;
|
|
224
|
+
style.marginRight = -h / 2;
|
|
225
|
+
style.marginTop = -v / 2;
|
|
226
|
+
style.marginBottom = -v / 2;
|
|
227
|
+
}
|
|
228
|
+
return style;
|
|
229
|
+
}, [grid?.gutter]);
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* 计算每个 item 的样式(flex 子项)
|
|
233
|
+
*/
|
|
234
|
+
const colStyle = useMemo(() => {
|
|
235
|
+
if (!grid) return undefined;
|
|
236
|
+
const {
|
|
237
|
+
gutter
|
|
238
|
+
} = grid;
|
|
239
|
+
const column = getResponsiveColumn;
|
|
240
|
+
const style = {
|
|
241
|
+
display: 'flex'
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
// 处理 gutter
|
|
245
|
+
if (gutter) {
|
|
246
|
+
const [horizontal, vertical] = Array.isArray(gutter) ? gutter : [gutter, 0];
|
|
247
|
+
const h = Number(horizontal) || 0;
|
|
248
|
+
const v = Number(vertical) || 0;
|
|
249
|
+
style.paddingLeft = h / 2;
|
|
250
|
+
style.paddingRight = h / 2;
|
|
251
|
+
style.paddingTop = v / 2;
|
|
252
|
+
style.paddingBottom = v / 2;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// 计算每列的宽度(确保 column 有效,避免除以零)
|
|
256
|
+
if (column > 0) {
|
|
257
|
+
// 使用 flex-basis 和 max-width 确保准确的宽度
|
|
258
|
+
const percentage = 100 / column;
|
|
259
|
+
style.flexBasis = `${percentage}%`;
|
|
260
|
+
style.maxWidth = `${percentage}%`;
|
|
261
|
+
}
|
|
262
|
+
return style;
|
|
263
|
+
}, [grid?.gutter, getResponsiveColumn]);
|
|
264
|
+
const {
|
|
265
|
+
renderEmpty
|
|
266
|
+
} = useContext(ConfigProvider.ConfigContext);
|
|
267
|
+
let childrenContent;
|
|
268
|
+
const isLoading = typeof loading === 'boolean' ? loading : !!loading?.spinning;
|
|
269
|
+
if (splitDataSource.length > 0) {
|
|
270
|
+
const items = splitDataSource.map((item, idx) => renderInternalItem(item, idx));
|
|
271
|
+
childrenContent = grid ? /*#__PURE__*/_jsx("div", {
|
|
272
|
+
style: gridContainerStyle,
|
|
273
|
+
children: items.map((child, idx) => /*#__PURE__*/_jsx("div", {
|
|
274
|
+
style: colStyle,
|
|
275
|
+
children: child
|
|
276
|
+
}, child?.key ?? idx))
|
|
277
|
+
}) : /*#__PURE__*/_jsx("ul", {
|
|
278
|
+
className: `${prefixCls}-items`,
|
|
279
|
+
children: items
|
|
280
|
+
});
|
|
281
|
+
} else if (!children && !isLoading) {
|
|
282
|
+
const emptyContent = locale?.emptyText ?? (typeof renderEmpty === 'function' ? renderEmpty('List') : null) ?? /*#__PURE__*/_jsx(Empty, {
|
|
283
|
+
description: "\u6682\u65E0\u6570\u636E"
|
|
284
|
+
});
|
|
285
|
+
childrenContent = /*#__PURE__*/_jsx("div", {
|
|
286
|
+
className: `${prefixCls}-empty-text`,
|
|
287
|
+
children: emptyContent
|
|
288
|
+
});
|
|
289
|
+
} else if (isLoading) {
|
|
290
|
+
childrenContent = /*#__PURE__*/_jsx("div", {
|
|
291
|
+
style: {
|
|
292
|
+
minHeight: 53
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
} else {
|
|
296
|
+
childrenContent = children;
|
|
297
|
+
}
|
|
298
|
+
const paginationPosition = paginationProps.position ?? 'bottom';
|
|
299
|
+
const showPaginationTop = pagination && (paginationPosition === 'top' || paginationPosition === 'both');
|
|
300
|
+
const showPaginationBottom = pagination && (paginationPosition === 'bottom' || paginationPosition === 'both');
|
|
301
|
+
const paginationNode = pagination && /*#__PURE__*/_jsx("div", {
|
|
302
|
+
className: `${prefixCls}-pagination`,
|
|
303
|
+
children: /*#__PURE__*/_jsx(Pagination, {
|
|
304
|
+
align: "end",
|
|
305
|
+
...paginationProps,
|
|
306
|
+
current: currentPage,
|
|
307
|
+
onChange: (page, pageSize) => {
|
|
308
|
+
setPaginationCurrent(page);
|
|
309
|
+
setPaginationSize(pageSize ?? 10);
|
|
310
|
+
pagination?.onChange?.(page, pageSize ?? 10);
|
|
311
|
+
},
|
|
312
|
+
onShowSizeChange: (current, size) => {
|
|
313
|
+
setPaginationCurrent(current);
|
|
314
|
+
setPaginationSize(size);
|
|
315
|
+
pagination?.onShowSizeChange?.(current, size);
|
|
316
|
+
}
|
|
317
|
+
})
|
|
318
|
+
});
|
|
319
|
+
const contextValue = useMemo(() => ({
|
|
320
|
+
grid,
|
|
321
|
+
itemLayout
|
|
322
|
+
}), [JSON.stringify(grid), itemLayout]);
|
|
323
|
+
const classString = clsx(prefixCls, {
|
|
324
|
+
[`${prefixCls}-vertical`]: itemLayout === 'vertical',
|
|
325
|
+
[`${prefixCls}-${sizeCls}`]: sizeCls,
|
|
326
|
+
[`${prefixCls}-split`]: split,
|
|
327
|
+
[`${prefixCls}-${variant}`]: variant,
|
|
328
|
+
[`${prefixCls}-loading`]: isLoading,
|
|
329
|
+
[`${prefixCls}-grid`]: !!grid,
|
|
330
|
+
[`${prefixCls}-something-after-last-item`]: isSomethingAfterLastItem
|
|
331
|
+
}, propHashId, className, rootClassName);
|
|
332
|
+
return /*#__PURE__*/_jsx(ProListContext.Provider, {
|
|
333
|
+
value: contextValue,
|
|
334
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
335
|
+
ref: ref,
|
|
336
|
+
style: style,
|
|
337
|
+
className: classString,
|
|
338
|
+
...rest,
|
|
339
|
+
children: [showPaginationTop && paginationNode, header && /*#__PURE__*/_jsx("div", {
|
|
340
|
+
className: `${prefixCls}-header`,
|
|
341
|
+
children: header
|
|
342
|
+
}), childrenContent, children, footer && /*#__PURE__*/_jsx("div", {
|
|
343
|
+
className: `${prefixCls}-footer`,
|
|
344
|
+
children: footer
|
|
345
|
+
}), loadMore, showPaginationBottom && paginationNode]
|
|
346
|
+
})
|
|
347
|
+
});
|
|
348
|
+
});
|
|
349
|
+
ProListContainerInner.displayName = 'ProListContainer';
|
|
350
|
+
export const ProListContainer = ProListContainerInner;
|
package/es/list/constants.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const PRO_LIST_KEYS:
|
|
2
|
-
declare const PRO_LIST_KEYS_MAP:
|
|
1
|
+
declare const PRO_LIST_KEYS: readonly ["title", "subTitle", "avatar", "description", "extra", "aside", "content", "actions", "type"];
|
|
2
|
+
declare const PRO_LIST_KEYS_MAP: Set<string>;
|
|
3
3
|
export { PRO_LIST_KEYS, PRO_LIST_KEYS_MAP };
|
package/es/list/constants.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
const PRO_LIST_KEYS = ['title', 'subTitle', 'avatar', 'description', 'extra', 'content', 'actions', 'type'];
|
|
2
|
-
const PRO_LIST_KEYS_MAP = PRO_LIST_KEYS
|
|
3
|
-
pre.set(next, true);
|
|
4
|
-
return pre;
|
|
5
|
-
}, new Map());
|
|
1
|
+
const PRO_LIST_KEYS = ['title', 'subTitle', 'avatar', 'description', 'extra', 'aside', 'content', 'actions', 'type'];
|
|
2
|
+
const PRO_LIST_KEYS_MAP = new Set(PRO_LIST_KEYS);
|
|
6
3
|
export { PRO_LIST_KEYS, PRO_LIST_KEYS_MAP };
|
package/es/list/index.d.ts
CHANGED
|
@@ -1,22 +1,15 @@
|
|
|
1
|
-
import type { ListProps } from 'antd';
|
|
2
|
-
import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel';
|
|
3
1
|
import React from 'react';
|
|
4
2
|
import type { CheckCardProps } from '../card';
|
|
5
3
|
import type { ProColumnType, ProTableProps } from '../table';
|
|
4
|
+
import type { LabelTooltipType } from '../utils';
|
|
6
5
|
import type { ItemProps } from './Item';
|
|
6
|
+
import { type ProListItemRender } from './ListView';
|
|
7
|
+
import type { ListProps } from './ProListBase';
|
|
7
8
|
export type AntdListProps<RecordType> = Omit<ListProps<RecordType>, 'rowKey'>;
|
|
8
9
|
export type ProListMeta<T> = Pick<ProColumnType<T>, 'dataIndex' | 'valueType' | 'render' | 'search' | 'title' | 'valueEnum' | 'editable' | 'fieldProps' | 'formItemProps' | 'formItemRender'> & {
|
|
9
10
|
key?: React.Key;
|
|
10
11
|
};
|
|
11
|
-
type ProListMetaAction<T> = ProListMeta<T
|
|
12
|
-
/**
|
|
13
|
-
* @example
|
|
14
|
-
* `cardActionProps = 'actions';`;
|
|
15
|
-
*
|
|
16
|
-
* @name 选择映射到 card 上的 props,默认为extra
|
|
17
|
-
*/
|
|
18
|
-
cardActionProps?: 'extra' | 'actions';
|
|
19
|
-
};
|
|
12
|
+
type ProListMetaAction<T> = ProListMeta<T>;
|
|
20
13
|
type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N;
|
|
21
14
|
type IsAny<T> = IfAny<T, true, false>;
|
|
22
15
|
export type BaseProListMetas<T = any> = {
|
|
@@ -29,25 +22,42 @@ export type BaseProListMetas<T = any> = {
|
|
|
29
22
|
content?: ProListMeta<T>;
|
|
30
23
|
actions?: ProListMetaAction<T>;
|
|
31
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated 推荐使用 columns + listSlot 的方式,与 ProTable 共用同一套 API
|
|
27
|
+
*/
|
|
32
28
|
export type ProListMetas<T = any> = BaseProListMetas<T> & {
|
|
33
29
|
[key in keyof T]?: IsAny<T> extends true ? ProListMetaAction<T> : ProListMeta<T>;
|
|
34
30
|
};
|
|
35
31
|
export type GetComponentProps<RecordType> = (record: RecordType, index: number) => React.HTMLAttributes<HTMLElement>;
|
|
36
32
|
export type ProListProps<RecordType = any, Params = Record<string, any>, ValueType = 'text'> = Omit<ProTableProps<RecordType, Params, ValueType>, 'size' | 'footer'> & AntdListProps<RecordType> & {
|
|
37
33
|
tooltip?: LabelTooltipType | string;
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated 推荐使用 columns + listSlot 的方式,与 ProTable 共用同一套 API
|
|
36
|
+
*
|
|
37
|
+
* @example 旧 API(metas)
|
|
38
|
+
* metas={{ title: { dataIndex: 'name' }, avatar: { dataIndex: 'avatar' } }}
|
|
39
|
+
*
|
|
40
|
+
* @example 新 API(columns + listSlot)
|
|
41
|
+
* columns={[
|
|
42
|
+
* { title: '名称', dataIndex: 'name', listSlot: 'title' },
|
|
43
|
+
* { dataIndex: 'avatar', listSlot: 'avatar' },
|
|
44
|
+
* ]}
|
|
45
|
+
*/
|
|
38
46
|
metas?: ProListMetas<RecordType>;
|
|
39
|
-
showActions?: 'hover' | 'always';
|
|
40
|
-
showExtra?: 'hover' | 'always';
|
|
41
47
|
onRow?: GetComponentProps<RecordType>;
|
|
42
48
|
onItem?: GetComponentProps<RecordType>;
|
|
43
49
|
itemCardProps?: CheckCardProps;
|
|
44
50
|
rowClassName?: string | ((item: RecordType, index: number) => string);
|
|
45
51
|
itemHeaderRender?: ItemProps<RecordType>['itemHeaderRender'];
|
|
46
52
|
itemTitleRender?: ItemProps<RecordType>['itemTitleRender'];
|
|
53
|
+
/** 自定义列表项渲染,defaultDom 为默认渲染的列表项元素 */
|
|
54
|
+
itemRender?: ProListItemRender<RecordType>;
|
|
47
55
|
};
|
|
48
56
|
export type Key = React.Key;
|
|
49
57
|
export type TriggerEventHandler<RecordType> = (record: RecordType) => void;
|
|
58
|
+
/** BaseProList 默认隐藏卡片、搜索和工具栏 */
|
|
50
59
|
declare function BaseProList<RecordType extends Record<string, any>, U extends Record<string, any> = Record<string, any>>(props: ProListProps<RecordType, U>): import("react/jsx-runtime").JSX.Element;
|
|
51
60
|
declare function ProList<RecordType extends Record<string, any>, U extends Record<string, any> = Record<string, any>>(props: ProListProps<RecordType, U>): import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
export type { ProListItemRender } from './ListView';
|
|
52
62
|
export { BaseProList, ProList };
|
|
53
63
|
export default ProList;
|
package/es/list/index.js
CHANGED
|
@@ -1,15 +1,61 @@
|
|
|
1
|
+
import { warning } from '@rc-component/util';
|
|
1
2
|
import { ConfigProvider } from 'antd';
|
|
2
3
|
import { clsx } from 'clsx';
|
|
3
|
-
import React, { useContext, useImperativeHandle, useMemo, useRef } from 'react';
|
|
4
|
+
import React, { useContext, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
|
4
5
|
import { ProConfigProvider } from "../provider";
|
|
5
6
|
import ProTable from "../table";
|
|
6
7
|
import ListView from "./ListView";
|
|
7
8
|
import { useStyle } from "./style/index";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated 推荐使用 columns + listSlot 的方式,与 ProTable 共用同一套 API
|
|
12
|
+
*/
|
|
8
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
|
|
14
|
+
/** 根据 listSlot 推导默认的 valueType */
|
|
15
|
+
const DEFAULT_VALUE_TYPE_MAP = {
|
|
16
|
+
avatar: 'avatar',
|
|
17
|
+
actions: 'option',
|
|
18
|
+
description: 'textarea'
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 将 metas 对象转换为 columns 数组(向后兼容)
|
|
23
|
+
*/
|
|
24
|
+
function metasToColumns(metas) {
|
|
25
|
+
return Object.keys(metas).map(key => {
|
|
26
|
+
const meta = metas[key] || {};
|
|
27
|
+
const valueType = meta.valueType || DEFAULT_VALUE_TYPE_MAP[key];
|
|
28
|
+
return {
|
|
29
|
+
listSlot: key,
|
|
30
|
+
dataIndex: meta.dataIndex || key,
|
|
31
|
+
...meta,
|
|
32
|
+
valueType
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 为带有 listSlot 的 columns 填充默认 valueType
|
|
39
|
+
*/
|
|
40
|
+
function enrichColumnsWithDefaults(columns) {
|
|
41
|
+
return columns.map(col => {
|
|
42
|
+
const {
|
|
43
|
+
listSlot
|
|
44
|
+
} = col;
|
|
45
|
+
if (!listSlot) return col;
|
|
46
|
+
const valueType = col.valueType || DEFAULT_VALUE_TYPE_MAP[listSlot];
|
|
47
|
+
return valueType ? {
|
|
48
|
+
...col,
|
|
49
|
+
valueType
|
|
50
|
+
} : col;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function InternalProList(props) {
|
|
10
54
|
const {
|
|
11
|
-
metas
|
|
55
|
+
metas,
|
|
56
|
+
columns: propsColumns,
|
|
12
57
|
split,
|
|
58
|
+
variant,
|
|
13
59
|
footer,
|
|
14
60
|
rowKey,
|
|
15
61
|
tooltip,
|
|
@@ -17,12 +63,10 @@ function NoProVideProList(props) {
|
|
|
17
63
|
options = false,
|
|
18
64
|
search = false,
|
|
19
65
|
expandable,
|
|
20
|
-
showActions,
|
|
21
|
-
showExtra,
|
|
22
66
|
rowSelection: propRowSelection = false,
|
|
23
67
|
pagination: propsPagination = false,
|
|
24
68
|
itemLayout,
|
|
25
|
-
|
|
69
|
+
itemRender,
|
|
26
70
|
grid,
|
|
27
71
|
itemCardProps,
|
|
28
72
|
onRow,
|
|
@@ -35,44 +79,35 @@ function NoProVideProList(props) {
|
|
|
35
79
|
} = props;
|
|
36
80
|
const actionRef = useRef();
|
|
37
81
|
useImperativeHandle(rest.actionRef, () => actionRef.current, [actionRef.current]);
|
|
82
|
+
|
|
83
|
+
// metas 废弃提示,仅在开发环境触发一次
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
warning(!metas, '[ProList] `metas` is deprecated. Please use `columns` with `listSlot` instead. ' + 'See: columns={[ { dataIndex: "name", listSlot: "title" } ]}');
|
|
86
|
+
}, []);
|
|
38
87
|
const {
|
|
39
88
|
getPrefixCls
|
|
40
89
|
} = useContext(ConfigProvider.ConfigContext);
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* columns 优先级高于 metas
|
|
93
|
+
* - 如果传入了 columns(且含有 listSlot),直接使用 columns
|
|
94
|
+
* - 如果只传入了 metas,将 metas 转换为 columns(向后兼容)
|
|
95
|
+
*/
|
|
41
96
|
const proTableColumns = useMemo(() => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (!valueType) {
|
|
49
|
-
// 根据 key 给不同的 valueType
|
|
50
|
-
if (key === 'avatar') {
|
|
51
|
-
valueType = 'avatar';
|
|
52
|
-
}
|
|
53
|
-
if (key === 'actions') {
|
|
54
|
-
valueType = 'option';
|
|
55
|
-
}
|
|
56
|
-
if (key === 'description') {
|
|
57
|
-
valueType = 'textarea';
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
columns.push({
|
|
61
|
-
listKey: key,
|
|
62
|
-
dataIndex: meta?.dataIndex || key,
|
|
63
|
-
...meta,
|
|
64
|
-
valueType
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
return columns;
|
|
68
|
-
}, [metals]);
|
|
97
|
+
if (propsColumns && propsColumns.length > 0) {
|
|
98
|
+
return enrichColumnsWithDefaults(propsColumns);
|
|
99
|
+
}
|
|
100
|
+
if (!metas) return [];
|
|
101
|
+
return metasToColumns(metas);
|
|
102
|
+
}, [propsColumns, metas]);
|
|
69
103
|
const prefixCls = getPrefixCls('pro-list', props.prefixCls);
|
|
70
104
|
const {
|
|
71
105
|
wrapSSR,
|
|
72
106
|
hashId
|
|
73
107
|
} = useStyle(prefixCls);
|
|
74
108
|
const listClassName = clsx(prefixCls, hashId, {
|
|
75
|
-
[`${prefixCls}-no-split`]: !split
|
|
109
|
+
[`${prefixCls}-no-split`]: !split,
|
|
110
|
+
[`${prefixCls}-${variant}`]: variant
|
|
76
111
|
});
|
|
77
112
|
return wrapSSR( /*#__PURE__*/_jsx(ProTable, {
|
|
78
113
|
tooltip: tooltip,
|
|
@@ -83,7 +118,7 @@ function NoProVideProList(props) {
|
|
|
83
118
|
rowSelection: propRowSelection,
|
|
84
119
|
search: search,
|
|
85
120
|
options: options,
|
|
86
|
-
className: clsx(
|
|
121
|
+
className: clsx(className, listClassName),
|
|
87
122
|
columns: proTableColumns,
|
|
88
123
|
rowKey: rowKey,
|
|
89
124
|
tableViewRender: ({
|
|
@@ -100,17 +135,16 @@ function NoProVideProList(props) {
|
|
|
100
135
|
itemTitleRender: itemTitleRender,
|
|
101
136
|
prefixCls: props.prefixCls,
|
|
102
137
|
columns: columns,
|
|
103
|
-
|
|
138
|
+
itemRender: itemRender,
|
|
104
139
|
actionRef: actionRef,
|
|
105
140
|
dataSource: dataSource || [],
|
|
106
141
|
size: size,
|
|
107
142
|
footer: footer,
|
|
108
143
|
split: split,
|
|
144
|
+
variant: variant,
|
|
109
145
|
rowKey: rowKey,
|
|
110
146
|
expandable: expandable,
|
|
111
147
|
rowSelection: propRowSelection === false ? undefined : rowSelection,
|
|
112
|
-
showActions: showActions,
|
|
113
|
-
showExtra: showExtra,
|
|
114
148
|
pagination: pagination,
|
|
115
149
|
itemLayout: itemLayout,
|
|
116
150
|
loading: loading,
|
|
@@ -118,15 +152,18 @@ function NoProVideProList(props) {
|
|
|
118
152
|
onRow: onRow,
|
|
119
153
|
onItem: onItem,
|
|
120
154
|
rowClassName: rowClassName,
|
|
121
|
-
locale: locale
|
|
155
|
+
locale: locale,
|
|
156
|
+
hashId: hashId
|
|
122
157
|
});
|
|
123
158
|
}
|
|
124
159
|
}));
|
|
125
160
|
}
|
|
161
|
+
|
|
162
|
+
/** BaseProList 默认隐藏卡片、搜索和工具栏 */
|
|
126
163
|
function BaseProList(props) {
|
|
127
164
|
return /*#__PURE__*/_jsx(ProConfigProvider, {
|
|
128
165
|
needDeps: true,
|
|
129
|
-
children: /*#__PURE__*/_jsx(
|
|
166
|
+
children: /*#__PURE__*/_jsx(InternalProList, {
|
|
130
167
|
cardProps: false,
|
|
131
168
|
search: false,
|
|
132
169
|
toolBarRender: false,
|
|
@@ -137,7 +174,7 @@ function BaseProList(props) {
|
|
|
137
174
|
function ProList(props) {
|
|
138
175
|
return /*#__PURE__*/_jsx(ProConfigProvider, {
|
|
139
176
|
needDeps: true,
|
|
140
|
-
children: /*#__PURE__*/_jsx(
|
|
177
|
+
children: /*#__PURE__*/_jsx(InternalProList, {
|
|
141
178
|
...props
|
|
142
179
|
})
|
|
143
180
|
});
|
package/es/list/style/index.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import type { ProAliasToken } from '../../provider';
|
|
|
3
3
|
export interface ProListToken extends ProAliasToken {
|
|
4
4
|
componentCls: string;
|
|
5
5
|
}
|
|
6
|
-
export declare const techUiListActive: any;
|
|
7
6
|
export declare function useStyle(prefixCls: string): {
|
|
8
7
|
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
9
8
|
hashId: string;
|