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