@ant-design/pro-components 3.1.3-0 → 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/Actions/style.js +1 -0
- 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/CheckCard/style.js +1 -0
- 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 -38
- package/es/card/components/Loading/style.js +1 -0
- package/es/card/components/Operation/style.js +1 -0
- package/es/card/components/Statistic/index.js +1 -1
- package/es/card/components/Statistic/style.js +1 -0
- package/es/card/components/StatisticCard/style.js +1 -0
- 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/BaseForm/LightWrapper/style.js +2 -0
- 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/Group/style.js +1 -0
- 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/List/style.js +1 -0
- 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/DrawerForm/style.js +1 -0
- package/es/form/layouts/LightFilter/index.js +0 -1
- package/es/form/layouts/LightFilter/style.js +1 -0
- package/es/form/layouts/LoginForm/style.js +1 -0
- package/es/form/layouts/LoginFormPage/style.js +1 -0
- 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/QueryFilter/style.js +1 -0
- package/es/form/layouts/StepsForm/StepForm.js +0 -1
- package/es/form/layouts/StepsForm/index.js +3 -12
- package/es/form/layouts/StepsForm/style.js +1 -0
- package/es/layout/ProLayout.js +1 -6
- package/es/layout/components/AppsLogoComponents/style/index.js +4 -0
- package/es/layout/components/CollapsedIcon/style.js +1 -0
- package/es/layout/components/FooterToolbar/index.js +0 -3
- package/es/layout/components/GlobalFooter/style.js +1 -0
- package/es/layout/components/GlobalHeader/ActionsContent.js +0 -1
- package/es/layout/components/GridContent/style.js +1 -0
- 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/components/TopNavHeader/style.js +1 -0
- 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 +7 -5
- 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/Alert/style.js +1 -0
- package/es/table/components/ColumnSetting/index.js +0 -1
- package/es/table/components/ColumnSetting/style.js +1 -0
- package/es/table/components/DragSortTable/style.js +1 -0
- 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 +2 -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/DropdownFooter/style.js +1 -0
- package/es/utils/components/FieldLabel/index.js +1 -1
- package/es/utils/components/FieldLabel/style.js +15 -6
- package/es/utils/components/InlineErrorFormItem/style.js +1 -0
- package/es/utils/components/LabelIconTip/index.d.ts +3 -4
- package/es/utils/components/LabelIconTip/style.js +1 -0
- 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/Actions/style.js +1 -0
- 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/CheckCard/style.js +1 -0
- 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 -38
- package/lib/card/components/Loading/style.js +1 -0
- package/lib/card/components/Operation/style.js +1 -0
- package/lib/card/components/Statistic/index.js +1 -1
- package/lib/card/components/Statistic/style.js +1 -0
- package/lib/card/components/StatisticCard/style.js +1 -0
- 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/BaseForm/LightWrapper/style.js +2 -0
- 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/Group/style.js +1 -0
- 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/List/style.js +1 -0
- 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/DrawerForm/style.js +1 -0
- package/lib/form/layouts/LightFilter/index.js +0 -1
- package/lib/form/layouts/LightFilter/style.js +1 -0
- package/lib/form/layouts/LoginForm/style.js +1 -0
- package/lib/form/layouts/LoginFormPage/style.js +1 -0
- 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/QueryFilter/style.js +1 -0
- package/lib/form/layouts/StepsForm/StepForm.js +0 -1
- package/lib/form/layouts/StepsForm/index.js +3 -12
- package/lib/form/layouts/StepsForm/style.js +1 -0
- package/lib/layout/ProLayout.js +1 -6
- package/lib/layout/components/AppsLogoComponents/style/index.js +4 -0
- package/lib/layout/components/CollapsedIcon/style.js +1 -0
- package/lib/layout/components/FooterToolbar/index.js +0 -4
- package/lib/layout/components/GlobalFooter/style.js +1 -0
- package/lib/layout/components/GlobalHeader/ActionsContent.js +0 -1
- package/lib/layout/components/GridContent/style.js +1 -0
- 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/components/TopNavHeader/style.js +1 -0
- 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 +7 -5
- 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/Alert/style.js +1 -0
- package/lib/table/components/ColumnSetting/index.js +0 -1
- package/lib/table/components/ColumnSetting/style.js +1 -0
- package/lib/table/components/DragSortTable/style.js +1 -0
- 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 +2 -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/DropdownFooter/style.js +1 -0
- package/lib/utils/components/FieldLabel/index.js +1 -1
- package/lib/utils/components/FieldLabel/style.js +15 -6
- package/lib/utils/components/InlineErrorFormItem/style.js +1 -0
- package/lib/utils/components/LabelIconTip/index.d.ts +3 -4
- package/lib/utils/components/LabelIconTip/style.js +1 -0
- 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
|
@@ -361,7 +361,6 @@ function ColumnSetting(props) {
|
|
|
361
361
|
if (counter.propsRef.current?.columnsState?.value) {
|
|
362
362
|
columnRef.current = JSON.parse(JSON.stringify(counter.propsRef.current?.columnsState?.value || {}));
|
|
363
363
|
}
|
|
364
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
365
364
|
}, []);
|
|
366
365
|
|
|
367
366
|
/**
|
|
@@ -216,7 +216,6 @@ function useCreatorButton({
|
|
|
216
216
|
return false;
|
|
217
217
|
}
|
|
218
218
|
return createButtonDom(recordCreatorProps, value, intl);
|
|
219
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
220
219
|
}, [maxLength, recordCreatorProps, value?.length, intl]);
|
|
221
220
|
const buttonRenderProps = (0, _react.useMemo)(() => {
|
|
222
221
|
if (!creatorButtonDom) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TabPaneProps } from 'antd';
|
|
2
|
-
import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel';
|
|
3
2
|
import type { SearchProps } from 'antd/lib/input';
|
|
4
3
|
import React from 'react';
|
|
4
|
+
import type { LabelTooltipType } from '../../../utils';
|
|
5
5
|
import type { ListToolBarHeaderMenuProps } from './HeaderMenu';
|
|
6
6
|
export type ListToolBarSetting = {
|
|
7
7
|
icon: React.ReactNode;
|
|
@@ -169,13 +169,11 @@ const ListToolBar = ({
|
|
|
169
169
|
},
|
|
170
170
|
children: actions.map((action, index) => {
|
|
171
171
|
if (! /*#__PURE__*/_react.default.isValidElement(action)) {
|
|
172
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
173
172
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {
|
|
174
173
|
children: action
|
|
175
174
|
}, index);
|
|
176
175
|
}
|
|
177
176
|
return /*#__PURE__*/_react.default.cloneElement(action, {
|
|
178
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
179
177
|
key: index,
|
|
180
178
|
...action?.props
|
|
181
179
|
});
|
|
@@ -247,14 +245,10 @@ const ListToolBar = ({
|
|
|
247
245
|
className: `${prefixCls}-setting-items ${hashId}`.trim(),
|
|
248
246
|
children: settings.map((setting, index) => {
|
|
249
247
|
const settingItem = getSettingItem(setting);
|
|
250
|
-
return (
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
className: `${prefixCls}-setting-item ${hashId}`.trim(),
|
|
255
|
-
children: settingItem
|
|
256
|
-
}, index)
|
|
257
|
-
);
|
|
248
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
249
|
+
className: `${prefixCls}-setting-item ${hashId}`.trim(),
|
|
250
|
+
children: settingItem
|
|
251
|
+
}, index);
|
|
258
252
|
})
|
|
259
253
|
}) : null]
|
|
260
254
|
});
|
|
@@ -8,12 +8,13 @@ var _provider = require("../../../provider");
|
|
|
8
8
|
const genProListStyle = token => {
|
|
9
9
|
return {
|
|
10
10
|
[token.componentCls]: {
|
|
11
|
+
boxSizing: 'border-box',
|
|
11
12
|
lineHeight: '1',
|
|
12
13
|
'&-container': {
|
|
13
14
|
display: 'flex',
|
|
14
15
|
justifyContent: 'space-between',
|
|
15
16
|
paddingBlock: token.padding,
|
|
16
|
-
paddingInline:
|
|
17
|
+
paddingInline: token.paddingXS,
|
|
17
18
|
'&-mobile': {
|
|
18
19
|
flexDirection: 'column'
|
|
19
20
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TableColumnType } from 'antd';
|
|
2
|
-
import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel';
|
|
3
2
|
import React from 'react';
|
|
3
|
+
import type { LabelTooltipType } from '../../../utils';
|
|
4
4
|
import type { ActionType, OptionSearchProps, ProTableProps } from '../../typing';
|
|
5
5
|
import type { ListToolBarProps } from '../ListToolBar';
|
|
6
6
|
export type SettingOptionType = {
|
package/lib/table/style/index.js
CHANGED
|
@@ -27,6 +27,10 @@ const turn = exports.turn = new _cssinjs.Keyframes('turn', {
|
|
|
27
27
|
const genProListStyle = token => {
|
|
28
28
|
return {
|
|
29
29
|
[token.componentCls]: {
|
|
30
|
+
boxSizing: 'border-box',
|
|
31
|
+
'*, *::before, *::after': {
|
|
32
|
+
boxSizing: 'border-box'
|
|
33
|
+
},
|
|
30
34
|
zIndex: 1,
|
|
31
35
|
[`${token.antCls}-table-wrapper ${token.antCls}-table-pagination${token.antCls}-pagination`]: {
|
|
32
36
|
marginBlockEnd: 0
|
package/lib/table/typing.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { SpinProps, TableProps } from 'antd';
|
|
2
2
|
import type { SizeType } from 'antd/lib/config-provider/SizeContext';
|
|
3
|
-
import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel';
|
|
4
3
|
import type { NamePath } from 'antd/lib/form/interface';
|
|
5
4
|
import type { SearchProps } from 'antd/lib/input';
|
|
6
5
|
import type { ColumnFilterItem, ColumnType, CompareFn, SorterResult, SortOrder } from 'antd/lib/table/interface';
|
|
@@ -10,7 +9,7 @@ import type { CSSProperties, Key } from 'react';
|
|
|
10
9
|
import type { ProCardProps } from '../card';
|
|
11
10
|
import type { ProFieldEmptyText } from '../field';
|
|
12
11
|
import type { LightWrapperProps, ProFormProps, QueryFilterProps } from '../form';
|
|
13
|
-
import type { ProCoreActionType, ProSchema, ProSchemaComponentTypes, ProTableEditableFnType, RowEditableConfig, SearchTransformKeyFn } from '../utils';
|
|
12
|
+
import type { LabelTooltipType, ProCoreActionType, ProEllipsis, ProSchema, ProSchemaComponentTypes, ProTableEditableFnType, RowEditableConfig, SearchTransformKeyFn } from '../utils';
|
|
14
13
|
import type { AlertRenderType } from './components/Alert';
|
|
15
14
|
import type { SearchConfig, TableFormItem } from './components/Form/FormRender';
|
|
16
15
|
import type { ListToolBarProps } from './components/ListToolBar';
|
|
@@ -80,7 +79,7 @@ export type ProColumnType<T = unknown, ValueType = 'text'> = ProSchema<T, ExtraP
|
|
|
80
79
|
/** 搜索表单的默认值 */
|
|
81
80
|
initialValue?: any;
|
|
82
81
|
/** @name 是否缩略 */
|
|
83
|
-
ellipsis?:
|
|
82
|
+
ellipsis?: ProEllipsis;
|
|
84
83
|
/** @name 是否拷贝 */
|
|
85
84
|
copyable?: boolean;
|
|
86
85
|
/** 在查询表单中隐藏 */
|
|
@@ -106,8 +105,14 @@ export type ProColumnType<T = unknown, ValueType = 'text'> = ProSchema<T, ExtraP
|
|
|
106
105
|
order?: number;
|
|
107
106
|
/** @name 可编辑表格是否可编辑 */
|
|
108
107
|
editable?: boolean | ProTableEditableFnType<T>;
|
|
109
|
-
/**
|
|
110
|
-
|
|
108
|
+
/**
|
|
109
|
+
* 用于 ProList,指定该列映射到列表项的哪个插槽位置
|
|
110
|
+
*
|
|
111
|
+
* @name 列表项插槽
|
|
112
|
+
* @example listSlot: 'title'
|
|
113
|
+
* @example listSlot: 'avatar'
|
|
114
|
+
*/
|
|
115
|
+
listSlot?: 'title' | 'subTitle' | 'avatar' | 'description' | 'content' | 'actions' | 'aside' | 'type' | (string & {});
|
|
111
116
|
/** @name 只读 */
|
|
112
117
|
readonly?: boolean;
|
|
113
118
|
/** @name 列设置的 disabled */
|
|
@@ -269,7 +269,6 @@ const useFetchData = (getData, defaultData, options) => {
|
|
|
269
269
|
return () => {
|
|
270
270
|
clearTimeout(pollingSetTimeRef.current);
|
|
271
271
|
};
|
|
272
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
273
272
|
}, [polling]);
|
|
274
273
|
(0, _react.useEffect)(() => {
|
|
275
274
|
umountRef.current = false;
|
|
@@ -302,7 +301,6 @@ const useFetchData = (getData, defaultData, options) => {
|
|
|
302
301
|
abortFetch();
|
|
303
302
|
fetchListDebounce.run(false);
|
|
304
303
|
}
|
|
305
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
306
304
|
}, [pageInfo?.current]);
|
|
307
305
|
|
|
308
306
|
// pageSize 修改后返回第一页
|
|
@@ -312,7 +310,6 @@ const useFetchData = (getData, defaultData, options) => {
|
|
|
312
310
|
}
|
|
313
311
|
abortFetch();
|
|
314
312
|
fetchListDebounce.run(false);
|
|
315
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
316
313
|
}, [pageInfo?.pageSize]);
|
|
317
314
|
|
|
318
315
|
/**
|
|
@@ -67,9 +67,7 @@ const CellRenderFromItem = props => {
|
|
|
67
67
|
name: formItemName,
|
|
68
68
|
...restProps,
|
|
69
69
|
children: children
|
|
70
|
-
}, key),
|
|
71
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
72
|
-
[key, formItemName]);
|
|
70
|
+
}, key), [key, formItemName]);
|
|
73
71
|
const generateFormItem = (0, _react.useCallback)(() => {
|
|
74
72
|
const formItemProps = {
|
|
75
73
|
...(0, _utils.getFieldPropsOrFormItemProps)(columnProps?.formItemProps, ...needProps)
|
package/lib/table/utils/index.js
CHANGED
|
@@ -122,7 +122,7 @@ const FieldLabelFunction = (props, ref) => {
|
|
|
122
122
|
[`${prefixCls}-${variant || 'borderless'}-active`]: (Array.isArray(value) ? value.length > 0 : !!value) || value === 0,
|
|
123
123
|
[`${prefixCls}-active`]: (Array.isArray(value) ? value.length > 0 : !!value) || value === 0,
|
|
124
124
|
[`${prefixCls}-disabled`]: disabled,
|
|
125
|
-
[`${prefixCls}
|
|
125
|
+
[`${prefixCls}-${variant}`]: variant,
|
|
126
126
|
[`${prefixCls}-allow-clear`]: allowClear
|
|
127
127
|
}, className),
|
|
128
128
|
style: style,
|
|
@@ -8,6 +8,7 @@ var _provider = require("../../../provider");
|
|
|
8
8
|
const genProStyle = token => {
|
|
9
9
|
return {
|
|
10
10
|
[token.componentCls]: {
|
|
11
|
+
boxSizing: 'border-box',
|
|
11
12
|
display: 'inline-flex',
|
|
12
13
|
gap: token.marginXXS,
|
|
13
14
|
alignItems: 'center',
|
|
@@ -107,12 +108,20 @@ const genProStyle = token => {
|
|
|
107
108
|
},
|
|
108
109
|
'&-filled': {
|
|
109
110
|
height: '32px',
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
111
|
+
backgroundColor: token.colorBgTextHover,
|
|
112
|
+
border: `${token.lineWidth}px solid transparent`,
|
|
113
|
+
'&:hover': {
|
|
114
|
+
border: `${token.lineWidth}px solid ${token.colorPrimary}`,
|
|
115
|
+
backgroundColor: token.colorBgTextHover
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
'&-underlined': {
|
|
119
|
+
height: '32px',
|
|
120
|
+
borderRadius: 0,
|
|
121
|
+
borderBottom: `${token.lineWidth}px solid ${token.colorSplit}`,
|
|
122
|
+
'&:hover': {
|
|
123
|
+
borderBottom: `${token.lineWidth}px solid ${token.colorPrimary}`,
|
|
124
|
+
backgroundColor: token.colorBgTextHover
|
|
116
125
|
}
|
|
117
126
|
},
|
|
118
127
|
'&-bordered&-small': {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import type { ProEllipsis } from '../../genCopyable';
|
|
3
|
+
import type { LabelTooltipType } from '../../typing';
|
|
3
4
|
/**
|
|
4
5
|
* 在 form 的 label 后面增加一个 tips 来展示一些说明文案
|
|
5
6
|
*
|
|
@@ -9,7 +10,5 @@ export declare const LabelIconTip: React.FC<{
|
|
|
9
10
|
label: React.ReactNode;
|
|
10
11
|
subTitle?: React.ReactNode;
|
|
11
12
|
tooltip?: string | LabelTooltipType;
|
|
12
|
-
ellipsis?:
|
|
13
|
-
showTitle?: boolean;
|
|
14
|
-
};
|
|
13
|
+
ellipsis?: ProEllipsis;
|
|
15
14
|
}>;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
import type { TooltipProps } from 'antd';
|
|
1
2
|
import React from 'react';
|
|
3
|
+
export type ProEllipsisTooltip = {
|
|
4
|
+
showTitle?: boolean;
|
|
5
|
+
tooltip?: TooltipProps;
|
|
6
|
+
};
|
|
7
|
+
export type ProEllipsis = ProEllipsisTooltip | boolean;
|
|
2
8
|
/**
|
|
3
9
|
* 生成 Copyable 或 Ellipsis 的 dom
|
|
4
10
|
*
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.genCopyable = void 0;
|
|
8
8
|
var _antd = require("antd");
|
|
9
|
+
var _isObject = _interopRequireDefault(require("lodash-es/isObject"));
|
|
9
10
|
var _react = _interopRequireDefault(require("react"));
|
|
10
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
12
|
const isNeedTranText = item => {
|
|
@@ -29,16 +30,35 @@ const normalizeCopyText = text => {
|
|
|
29
30
|
return text === null || text === undefined ? '' : String(text).trimEnd();
|
|
30
31
|
};
|
|
31
32
|
const genEllipsis = (dom, item, text) => {
|
|
33
|
+
const ellipsis = getEllipsis(item);
|
|
34
|
+
if (!ellipsis || !text) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
32
37
|
/** 有些 valueType 需要设置copy的为string */
|
|
33
38
|
const needTranText = isNeedTranText(item);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
|
|
40
|
+
// 支持一下 tooltip 的关闭
|
|
41
|
+
if (needTranText && item?.tooltip !== false) {
|
|
42
|
+
return {
|
|
43
|
+
tooltip: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
44
|
+
className: "pro-table-tooltip-text",
|
|
45
|
+
children: dom
|
|
46
|
+
})
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 如果 ellipsis 是对象且包含 tooltip 属性,合并 tooltip 的属性
|
|
51
|
+
if ((0, _isObject.default)(ellipsis) && (0, _isObject.default)(ellipsis.tooltip)) {
|
|
52
|
+
return {
|
|
53
|
+
tooltip: {
|
|
54
|
+
title: text,
|
|
55
|
+
...ellipsis.tooltip
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
tooltip: text
|
|
61
|
+
};
|
|
42
62
|
};
|
|
43
63
|
|
|
44
64
|
/**
|
|
@@ -21,8 +21,6 @@ function useDebounceValue(value, delay = 100, deps) {
|
|
|
21
21
|
setDebouncedValue(valueRef.current);
|
|
22
22
|
}, delay);
|
|
23
23
|
return () => clearTimeout(handler);
|
|
24
|
-
},
|
|
25
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
|
-
deps ? [delay, ...deps] : undefined);
|
|
24
|
+
}, deps ? [delay, ...deps] : undefined);
|
|
27
25
|
return debouncedValue;
|
|
28
26
|
}
|
|
@@ -22,7 +22,6 @@ function useDeepCompareMemoize(value, ignoreKeys) {
|
|
|
22
22
|
return ref.current;
|
|
23
23
|
}
|
|
24
24
|
function useDeepCompareEffect(effect, dependencies, ignoreKeys) {
|
|
25
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
25
|
(0, _react.useEffect)(effect, useDeepCompareMemoize(dependencies || [], ignoreKeys));
|
|
27
26
|
}
|
|
28
27
|
function useDeepCompareEffectDebounce(effect, dependencies, ignoreKeys, waitTime) {
|
|
@@ -31,6 +30,5 @@ function useDeepCompareEffectDebounce(effect, dependencies, ignoreKeys, waitTime
|
|
|
31
30
|
}, waitTime || 16);
|
|
32
31
|
(0, _react.useEffect)(() => {
|
|
33
32
|
effectDn.run();
|
|
34
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
35
33
|
}, useDeepCompareMemoize(dependencies || [], ignoreKeys));
|
|
36
34
|
}
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import type { ProFormInstanceType } from './components/ProFormContext';
|
|
|
9
9
|
import { ProFormContext } from './components/ProFormContext';
|
|
10
10
|
import { conversionMomentValue, convertMoment, dateFormatterMap } from './conversionMomentValue';
|
|
11
11
|
import { dateArrayFormatter } from './dateArrayFormatter';
|
|
12
|
+
import type { ProEllipsis } from './genCopyable';
|
|
12
13
|
import { genCopyable } from './genCopyable';
|
|
13
14
|
import { getFieldPropsOrFormItemProps } from './getFieldPropsOrFormItemProps';
|
|
14
15
|
import { useDebounceFn } from './hooks/useDebounceFn';
|
|
@@ -48,4 +49,4 @@ import { useEditableMap } from './useEditableMap';
|
|
|
48
49
|
import { useBreakpoint } from './useMediaQuery';
|
|
49
50
|
export * from './typing';
|
|
50
51
|
export { conversionMomentValue, conversionMomentValue as conversionSubmitValue, convertMoment, dateArrayFormatter, dateFormatterMap, DropdownFooter, editableRowByKey, ErrorBoundary, FieldLabel, FilterDropdown, genCopyable, getFieldPropsOrFormItemProps, InlineErrorFormItem, isBrowser, isDeepEqualReact, isDropdownValueType, isImg, isNil, isUrl, LabelIconTip, lighten, merge, nanoid, objectToMap, omitBoolean, omitUndefined, omitUndefinedAndEmptyArr, operationUnit, parseValueToDay, pickProFormItemProps, pickProProps, proFieldParsingText, ProFormContext, recordKeyToString, resetComponent, runFunction, setAlpha, stringify, transformKeySubmitValue, useBreakpoint, useDebounceFn, useDebounceValue, useDeepCompareEffect, useDeepCompareEffectDebounce, useDeepCompareMemo, useDocumentTitle, useEditableArray, useEditableMap, useFetchData, useLatest, usePrevious, useReactiveRef, useRefCallback, useRefFunction, useStyle, };
|
|
51
|
-
export type { ProFormInstanceType, ProRequestData, RowEditableConfig, RowEditableType, UseEditableMapType, UseEditableMapUtilType, UseEditableType, UseEditableUtilType, };
|
|
52
|
+
export type { ProEllipsis, ProFormInstanceType, ProRequestData, RowEditableConfig, RowEditableType, UseEditableMapType, UseEditableMapUtilType, UseEditableType, UseEditableUtilType, };
|
|
@@ -4,12 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.isDeepEqualReact = isDeepEqualReact;
|
|
7
|
-
/* eslint-disable no-restricted-syntax */
|
|
8
|
-
/* eslint-disable no-continue */
|
|
9
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
10
|
-
/* eslint-disable no-self-compare */
|
|
11
|
-
/* eslint-disable eqeqeq */
|
|
12
|
-
/* eslint-disable no-plusplus */
|
|
13
7
|
// do not edit .js files directly - edit src/index.jst
|
|
14
8
|
|
|
15
9
|
function isDeepEqualReact(a, b, ignoreKeys) {
|
|
@@ -48,8 +42,6 @@ function isDeepEqualReact(a, b, ignoreKeys) {
|
|
|
48
42
|
if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
|
|
49
43
|
if (a.valueOf !== Object.prototype.valueOf && a.valueOf) return a.valueOf() === b.valueOf();
|
|
50
44
|
if (a.toString !== Object.prototype.toString && a.toString) return a.toString() === b.toString();
|
|
51
|
-
|
|
52
|
-
// eslint-disable-next-line prefer-const
|
|
53
45
|
keys = Object.keys(a);
|
|
54
46
|
length = keys.length;
|
|
55
47
|
if (length !== Object.keys(b).length) return false;
|
package/lib/utils/merge/index.js
CHANGED
|
@@ -4,8 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.merge = void 0;
|
|
7
|
-
/* eslint-disable prefer-rest-params */
|
|
8
|
-
|
|
9
7
|
/**
|
|
10
8
|
* 用于合并 n 个对象
|
|
11
9
|
* @param {any[]} ...rest
|
|
@@ -17,7 +15,6 @@ const merge = (...rest) => {
|
|
|
17
15
|
let key;
|
|
18
16
|
let i = 0;
|
|
19
17
|
for (; i < il; i += 1) {
|
|
20
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
21
18
|
for (key in rest[i]) {
|
|
22
19
|
if (rest[i].hasOwnProperty(key)) {
|
|
23
20
|
if (typeof obj[key] === 'object' && typeof rest[i][key] === 'object' && obj[key] !== undefined && obj[key] !== null && !Array.isArray(obj[key]) && !Array.isArray(rest[i][key])) {
|
|
@@ -4,15 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.nanoid = void 0;
|
|
7
|
-
/* eslint-disable prefer-const */
|
|
8
|
-
|
|
9
7
|
let index = 0;
|
|
10
8
|
let genNanoid = (t = 21) => {
|
|
11
9
|
if (typeof window === 'undefined') return (index += 1).toFixed(0);
|
|
12
10
|
if (!window.crypto) return (index += 1).toFixed(0);
|
|
13
11
|
let e = '',
|
|
14
12
|
r = crypto.getRandomValues(new Uint8Array(t));
|
|
15
|
-
// eslint-disable-next-line no-param-reassign
|
|
16
13
|
for (; t--;) {
|
|
17
14
|
let n = 63 & r[t];
|
|
18
15
|
e += n < 36 ? n.toString(36) : n < 62 ? (n - 26).toString(36).toUpperCase() : n < 63 ? '_' : '-';
|
|
@@ -21,15 +18,10 @@ let genNanoid = (t = 21) => {
|
|
|
21
18
|
};
|
|
22
19
|
|
|
23
20
|
/**
|
|
24
|
-
* 生成uuid,如果不支持 randomUUID,就用 genNanoid
|
|
25
|
-
*
|
|
26
|
-
* @returns string
|
|
21
|
+
* @description 生成uuid,如果不支持 randomUUID,就用 genNanoid
|
|
27
22
|
*/
|
|
28
23
|
const nanoid = () => {
|
|
29
|
-
if (typeof
|
|
30
|
-
// @ts-ignore
|
|
31
|
-
if (window.crypto && window.crypto.randomUUID && typeof crypto.randomUUID == 'function') {
|
|
32
|
-
// @ts-ignore
|
|
24
|
+
if (window?.crypto?.randomUUID && typeof crypto.randomUUID === 'function') {
|
|
33
25
|
return crypto.randomUUID();
|
|
34
26
|
}
|
|
35
27
|
return genNanoid();
|
|
@@ -111,9 +111,7 @@ const proFieldParsingText = (text, valueEnumParams, key) => {
|
|
|
111
111
|
separator: ",",
|
|
112
112
|
size: 2,
|
|
113
113
|
wrap: true,
|
|
114
|
-
children: text.map((value, index) =>
|
|
115
|
-
// @ts-ignore
|
|
116
|
-
proFieldParsingText(value, valueEnumParams, index))
|
|
114
|
+
children: text.map((value, index) => proFieldParsingText(value, valueEnumParams, index))
|
|
117
115
|
}, key);
|
|
118
116
|
}
|
|
119
117
|
const valueEnum = objectToMap(valueEnumParams);
|
package/lib/utils/typing.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { AvatarProps, CascaderProps, CheckboxProps, ColorPickerProps, DatePickerProps, DividerProps, ImageProps, InputNumberProps, InputProps, PopoverProps, ProgressProps, RadioProps, RateProps, SegmentedProps, SelectProps, SliderSingleProps, SpaceProps, SwitchProps, TimeRangePickerProps, TreeSelectProps } from 'antd';
|
|
2
2
|
import type { RangePickerProps } from 'antd/lib/date-picker';
|
|
3
3
|
import type { FormInstance, FormItemProps } from 'antd/lib/form';
|
|
4
|
-
import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel';
|
|
5
4
|
import type { NamePath } from 'antd/lib/form/interface';
|
|
6
5
|
import type { PasswordProps, TextAreaProps } from 'antd/lib/input';
|
|
7
6
|
import type { SliderRangeProps } from 'antd/lib/slider';
|
|
8
7
|
import type { ReactNode } from 'react';
|
|
9
8
|
import type { ProSchemaValueEnumType } from '../provider';
|
|
10
9
|
import type { UseEditableUtilType } from './useEditableArray';
|
|
10
|
+
export type LabelTooltipType = any;
|
|
11
|
+
export type WrapperTooltipProps = any;
|
|
11
12
|
export type ProFormBaseGroupProps = {
|
|
12
13
|
/**
|
|
13
14
|
* @name 分组的标题
|
|
@@ -23,8 +23,6 @@ var _usePrevious = require("../hooks/usePrevious");
|
|
|
23
23
|
var _merge = require("../merge");
|
|
24
24
|
var _useLazyKVMap = _interopRequireDefault(require("../useLazyKVMap"));
|
|
25
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
26
|
-
/* eslint-disable react-hooks/exhaustive-deps */
|
|
27
|
-
|
|
28
26
|
const {
|
|
29
27
|
noteOnce
|
|
30
28
|
} = _util.warning;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ant-design/pro-components",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.4-0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "All-in-one package of @ant-design/pro-components",
|
|
6
6
|
"keywords": [
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"ant-design",
|
|
10
10
|
"ant-design-pro"
|
|
11
11
|
],
|
|
12
|
-
"homepage": "https://
|
|
12
|
+
"homepage": "https://pro-components.antdigital.dev",
|
|
13
13
|
"bugs": "https://github.com/ant-design/pro-components/issues",
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
"docs:preview": "pnpm docs preview",
|
|
42
42
|
"docs:create": "pnpm docs create",
|
|
43
43
|
"docs:check": "pnpm docs check",
|
|
44
|
-
"prepublishOnly": "pnpm run test && pnpm run build",
|
|
45
44
|
"lint": "eslint --cache --ext .js,.jsx,.ts,.tsx --fix ./ && npm run tsc",
|
|
46
45
|
"prettier": "prettier --write \"**/**.{js,jsx,tsx,ts,less,md,yaml,json}\" --log-level warn",
|
|
47
46
|
"createRelease": "node ./scripts/createRelease.mjs",
|
|
@@ -130,13 +129,13 @@
|
|
|
130
129
|
"@vitest/coverage-istanbul": "^3.2.4",
|
|
131
130
|
"@vitest/ui": "^3.2.4",
|
|
132
131
|
"animated-scroll-to": "^2.3.2",
|
|
133
|
-
"antd": "^6.
|
|
132
|
+
"antd": "^6.3.0",
|
|
134
133
|
"chalk": "^4.1.2",
|
|
135
134
|
"copy-to-clipboard": "^3.3.3",
|
|
136
135
|
"cross-env": "^7.0.3",
|
|
137
136
|
"dumi": "^2.4.21",
|
|
138
137
|
"dumi-theme-antd-style": "^0.31.1",
|
|
139
|
-
"esbuild": "^0.
|
|
138
|
+
"esbuild": "^0.27.0",
|
|
140
139
|
"eslint": "^8.57.1",
|
|
141
140
|
"eslint-plugin-react": "^7.37.5",
|
|
142
141
|
"eslint-plugin-react-hooks": "^4.6.2",
|