@ant-design/pro-components 3.1.5-0 → 3.1.6-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/field/components/ColorPicker/index.d.ts +1 -1
- package/es/field/components/DatePicker/index.d.ts +1 -1
- package/es/field/components/RangePicker/index.d.ts +1 -1
- package/es/field/components/Select/SearchSelect/index.js +3 -5
- package/es/form/components/FormItem/Group/index.js +11 -1
- package/es/form/layouts/LightFilter/index.js +18 -27
- package/es/form/layouts/LoginForm/index.js +2 -1
- package/es/form/layouts/LoginFormPage/index.js +2 -1
- package/es/layout/ProLayout.d.ts +2 -2
- package/es/layout/ProLayout.js +12 -24
- package/es/list/ProListBase.js +15 -17
- package/es/table/components/EditableTable/index.js +0 -64
- package/es/table/components/ToolBar/DensityIcon.d.ts +2 -2
- package/es/table/components/ToolBar/DensityIcon.js +6 -3
- package/es/table/components/ToolBar/FullscreenIcon.d.ts +1 -1
- package/es/table/components/ToolBar/FullscreenIcon.js +11 -5
- package/lib/field/components/ColorPicker/index.d.ts +1 -1
- package/lib/field/components/DatePicker/index.d.ts +1 -1
- package/lib/field/components/RangePicker/index.d.ts +1 -1
- package/lib/field/components/Select/SearchSelect/index.js +2 -4
- package/lib/form/components/FormItem/Group/index.js +11 -1
- package/lib/form/layouts/LightFilter/index.js +17 -26
- package/lib/form/layouts/LoginForm/index.js +2 -1
- package/lib/form/layouts/LoginFormPage/index.js +2 -1
- package/lib/layout/ProLayout.d.ts +2 -2
- package/lib/layout/ProLayout.js +12 -24
- package/lib/list/ProListBase.js +14 -16
- package/lib/table/components/EditableTable/index.js +0 -64
- package/lib/table/components/ToolBar/DensityIcon.d.ts +2 -2
- package/lib/table/components/ToolBar/DensityIcon.js +6 -3
- package/lib/table/components/ToolBar/FullscreenIcon.d.ts +1 -1
- package/lib/table/components/ToolBar/FullscreenIcon.js +11 -5
- package/package.json +1 -1
|
@@ -3,5 +3,5 @@ import React from 'react';
|
|
|
3
3
|
declare const _default: React.ForwardRefExoticComponent<import("src/provider").BaseProFieldFC & import("src/provider").ProRenderFieldPropsType & {
|
|
4
4
|
text: string;
|
|
5
5
|
mode?: "update" | "read" | "edit" | undefined;
|
|
6
|
-
} & Partial<Omit<ColorPickerProps, "
|
|
6
|
+
} & Partial<Omit<ColorPickerProps, "value" | "mode">> & React.RefAttributes<any>>;
|
|
7
7
|
export default _default;
|
|
@@ -5,6 +5,6 @@ declare const _default: React.ForwardRefExoticComponent<import("../../../provide
|
|
|
5
5
|
format?: string | undefined;
|
|
6
6
|
showTime?: boolean | undefined;
|
|
7
7
|
variant?: "outlined" | "filled" | "borderless" | "underlined" | undefined;
|
|
8
|
-
picker?: "time" | "date" | "month" | "week" | "
|
|
8
|
+
picker?: "time" | "date" | "month" | "week" | "year" | "quarter" | undefined;
|
|
9
9
|
} & ProFieldLightProps & React.RefAttributes<any>>;
|
|
10
10
|
export default _default;
|
|
@@ -5,6 +5,6 @@ declare const _default: React.ForwardRefExoticComponent<import("../../../provide
|
|
|
5
5
|
format?: string | undefined;
|
|
6
6
|
variant?: "outlined" | "filled" | "borderless" | "underlined" | undefined;
|
|
7
7
|
showTime?: boolean | undefined;
|
|
8
|
-
picker?: "time" | "date" | "month" | "week" | "
|
|
8
|
+
picker?: "time" | "date" | "month" | "week" | "year" | "quarter" | undefined;
|
|
9
9
|
} & ProFieldLightProps & React.RefAttributes<any>>;
|
|
10
10
|
export default _default;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { useControlledState } from '@rc-component/util';
|
|
1
2
|
import { ConfigProvider, Select } from 'antd';
|
|
2
3
|
import { clsx } from 'clsx';
|
|
3
|
-
import React, { useContext, useEffect, useImperativeHandle, useRef
|
|
4
|
+
import React, { useContext, useEffect, useImperativeHandle, useRef } from 'react';
|
|
4
5
|
import { nanoid } from "../../../../utils";
|
|
5
6
|
|
|
6
7
|
// 支持 key, value, label,兼容 UserSearch 中只填写了 key 的情况。
|
|
@@ -41,7 +42,7 @@ const SearchSelect = (props, ref) => {
|
|
|
41
42
|
value: valuePropsName = 'value',
|
|
42
43
|
options: optionsPropsName = 'options'
|
|
43
44
|
} = fieldNames || {};
|
|
44
|
-
const [searchValue, setSearchValue] =
|
|
45
|
+
const [searchValue, setSearchValue] = useControlledState(defaultSearchValue, propsSearchValue);
|
|
45
46
|
const selectRef = useRef();
|
|
46
47
|
useImperativeHandle(ref, () => selectRef.current);
|
|
47
48
|
useEffect(() => {
|
|
@@ -49,9 +50,6 @@ const SearchSelect = (props, ref) => {
|
|
|
49
50
|
selectRef?.current?.focus();
|
|
50
51
|
}
|
|
51
52
|
}, [restProps.autoFocus]);
|
|
52
|
-
useEffect(() => {
|
|
53
|
-
setSearchValue(propsSearchValue);
|
|
54
|
-
}, [propsSearchValue]);
|
|
55
53
|
const {
|
|
56
54
|
getPrefixCls
|
|
57
55
|
} = useContext(ConfigProvider.ConfigContext);
|
|
@@ -117,7 +117,7 @@ const Group = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
117
117
|
display: 'none'
|
|
118
118
|
},
|
|
119
119
|
children: hiddenChildren
|
|
120
|
-
}) : null];
|
|
120
|
+
}, "hidden") : null];
|
|
121
121
|
}, [children, RowWrapper, Wrapper, autoFocus]);
|
|
122
122
|
return wrapSSR( /*#__PURE__*/_jsx(ColWrapper, {
|
|
123
123
|
children: /*#__PURE__*/_jsxs("div", {
|
|
@@ -127,11 +127,19 @@ const Group = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
127
127
|
style: style,
|
|
128
128
|
ref: ref,
|
|
129
129
|
children: [hiddenDoms, (title || tooltip || extra) && /*#__PURE__*/_jsx("div", {
|
|
130
|
+
role: "button",
|
|
131
|
+
tabIndex: 0,
|
|
130
132
|
className: clsx(`${className}-title`, hashId),
|
|
131
133
|
style: titleStyle,
|
|
132
134
|
onClick: () => {
|
|
133
135
|
setCollapsed(!collapsed);
|
|
134
136
|
},
|
|
137
|
+
onKeyDown: e => {
|
|
138
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
139
|
+
e.preventDefault();
|
|
140
|
+
setCollapsed(!collapsed);
|
|
141
|
+
}
|
|
142
|
+
},
|
|
135
143
|
children: extra ? /*#__PURE__*/_jsxs("div", {
|
|
136
144
|
style: {
|
|
137
145
|
display: 'flex',
|
|
@@ -140,7 +148,9 @@ const Group = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
140
148
|
justifyContent: 'space-between'
|
|
141
149
|
},
|
|
142
150
|
children: [titleDom, /*#__PURE__*/_jsx("span", {
|
|
151
|
+
role: "presentation",
|
|
143
152
|
onClick: e => e.stopPropagation(),
|
|
153
|
+
onKeyDown: e => e.stopPropagation(),
|
|
144
154
|
children: extra
|
|
145
155
|
})]
|
|
146
156
|
}) : titleDom
|
|
@@ -2,7 +2,7 @@ import { FilterOutlined } from '@ant-design/icons';
|
|
|
2
2
|
import { omit } from '@rc-component/util';
|
|
3
3
|
import { ConfigProvider } from 'antd';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
|
-
import React, { useContext,
|
|
5
|
+
import React, { useContext, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
6
6
|
import { useIntl } from "../../../provider";
|
|
7
7
|
import { FieldLabel, FilterDropdown } from "../../../utils";
|
|
8
8
|
import { BaseForm } from "../../BaseForm";
|
|
@@ -35,16 +35,22 @@ const LightFilterContainer = props => {
|
|
|
35
35
|
hashId
|
|
36
36
|
} = useStyle(lightFilterClassName);
|
|
37
37
|
const [open, setOpen] = useState(false);
|
|
38
|
-
const [moreValues, setMoreValues] = useState(() => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
const [moreValues, setMoreValues] = useState(() => ({
|
|
39
|
+
...values
|
|
40
|
+
}));
|
|
41
|
+
const collapseLabelNode = useMemo(() => {
|
|
42
|
+
if (collapseLabel) return collapseLabel;
|
|
43
|
+
if (collapse) {
|
|
44
|
+
return /*#__PURE__*/_jsx(FilterOutlined, {
|
|
45
|
+
className: clsx(`${lightFilterClassName}-collapse-icon`, hashId)
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return /*#__PURE__*/_jsx(FieldLabel, {
|
|
49
|
+
variant: variant,
|
|
50
|
+
size: size,
|
|
51
|
+
label: intl.getMessage('form.lightFilter.more', '更多筛选')
|
|
46
52
|
});
|
|
47
|
-
}, [
|
|
53
|
+
}, [collapseLabel, collapse, lightFilterClassName, hashId, variant, size, intl]);
|
|
48
54
|
const {
|
|
49
55
|
collapseItems,
|
|
50
56
|
outsideItems
|
|
@@ -66,21 +72,6 @@ const LightFilterContainer = props => {
|
|
|
66
72
|
outsideItems: outsideItemsArr
|
|
67
73
|
};
|
|
68
74
|
}, [props.items]);
|
|
69
|
-
const renderCollapseLabelRender = () => {
|
|
70
|
-
if (collapseLabel) {
|
|
71
|
-
return collapseLabel;
|
|
72
|
-
}
|
|
73
|
-
if (collapse) {
|
|
74
|
-
return /*#__PURE__*/_jsx(FilterOutlined, {
|
|
75
|
-
className: clsx(`${lightFilterClassName}-collapse-icon`, hashId)
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
return /*#__PURE__*/_jsx(FieldLabel, {
|
|
79
|
-
variant: variant,
|
|
80
|
-
size: size,
|
|
81
|
-
label: intl.getMessage('form.lightFilter.more', '更多筛选')
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
75
|
return wrapSSR( /*#__PURE__*/_jsx("div", {
|
|
85
76
|
className: clsx(lightFilterClassName, hashId, `${lightFilterClassName}-${size}`, {
|
|
86
77
|
[`${lightFilterClassName}-effective`]: Object.keys(values).some(key => Array.isArray(values[key]) ? values[key].length > 0 : values[key])
|
|
@@ -126,7 +117,7 @@ const LightFilterContainer = props => {
|
|
|
126
117
|
},
|
|
127
118
|
placement: placement,
|
|
128
119
|
popoverProps: popoverProps,
|
|
129
|
-
label:
|
|
120
|
+
label: collapseLabelNode,
|
|
130
121
|
footerRender: footerRender,
|
|
131
122
|
footer: {
|
|
132
123
|
onConfirm: () => {
|
|
@@ -244,7 +235,7 @@ function LightFilter(props) {
|
|
|
244
235
|
onValuesChange(newValues, newAllValues);
|
|
245
236
|
}
|
|
246
237
|
}
|
|
247
|
-
});
|
|
238
|
+
}, JSON.stringify(values || {}));
|
|
248
239
|
},
|
|
249
240
|
formRef: formRef,
|
|
250
241
|
formItemProps: {
|
package/es/layout/ProLayout.d.ts
CHANGED
|
@@ -46,9 +46,9 @@ export type ProLayoutProps = GlobalTypes & {
|
|
|
46
46
|
* @name logo 的配置,可以配置url,React 组件 和 false
|
|
47
47
|
*
|
|
48
48
|
* @example 设置 logo 为网络地址 logo="https://avatars1.githubusercontent.com/u/8186664?s=460&v=4"
|
|
49
|
-
* @example 设置 logo 为组件 logo={<img src="https://avatars1.githubusercontent.com/u/8186664?s=460&v=4"/>}
|
|
49
|
+
* @example 设置 logo 为组件 logo={<img src="https://avatars1.githubusercontent.com/u/8186664?s=460&v=4" alt="" />}
|
|
50
50
|
* @example 设置 logo 为 false 不显示 logo logo={false}
|
|
51
|
-
* @example 设置 logo 为 方法 logo={()=> <img src="https://avatars1.githubusercontent.com/u/8186664?s=460&v=4"/> }
|
|
51
|
+
* @example 设置 logo 为 方法 logo={()=> <img src="https://avatars1.githubusercontent.com/u/8186664?s=460&v=4" alt="" /> }
|
|
52
52
|
* */
|
|
53
53
|
logo?: React.ReactNode | React.JSX.Element | WithFalse<() => React.ReactNode | React.JSX.Element>;
|
|
54
54
|
/**
|
package/es/layout/ProLayout.js
CHANGED
|
@@ -164,7 +164,7 @@ const BaseProLayout = props => {
|
|
|
164
164
|
}, [props.layout, propsSiderWidth]);
|
|
165
165
|
const context = useContext(ConfigProvider.ConfigContext);
|
|
166
166
|
const prefixCls = props.prefixCls ?? context.getPrefixCls('pro');
|
|
167
|
-
const [
|
|
167
|
+
const [menuLoadingState, _setMenuLoadingInner] = useControlledState(false, menu?.loading);
|
|
168
168
|
|
|
169
169
|
/**
|
|
170
170
|
* 使用 useRefFunction 包装回调,确保引用稳定
|
|
@@ -173,20 +173,6 @@ const BaseProLayout = props => {
|
|
|
173
173
|
menu?.onLoadingChange?.(loading);
|
|
174
174
|
});
|
|
175
175
|
|
|
176
|
-
/**
|
|
177
|
-
* 包装 setMenuLoading,使用 queueMicrotask 延迟回调调用
|
|
178
|
-
* 避免在渲染阶段调用外部回调导致的 React 警告
|
|
179
|
-
*/
|
|
180
|
-
const setMenuLoading = useCallback(updater => {
|
|
181
|
-
setMenuLoadingInner(prev => {
|
|
182
|
-
const next = typeof updater === 'function' ? updater(prev) : updater;
|
|
183
|
-
queueMicrotask(() => {
|
|
184
|
-
menuOnLoadingChange(next);
|
|
185
|
-
});
|
|
186
|
-
return next;
|
|
187
|
-
});
|
|
188
|
-
}, [menuOnLoadingChange]);
|
|
189
|
-
|
|
190
176
|
// give a default key for swr
|
|
191
177
|
const [defaultId] = useState(() => {
|
|
192
178
|
layoutIndex += 1;
|
|
@@ -216,20 +202,21 @@ const BaseProLayout = props => {
|
|
|
216
202
|
const {
|
|
217
203
|
data,
|
|
218
204
|
mutate,
|
|
219
|
-
|
|
205
|
+
isValidating
|
|
220
206
|
} = useSWR([defaultId, menu?.params], async ([, params]) => {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
207
|
+
menuOnLoadingChange(true);
|
|
208
|
+
try {
|
|
209
|
+
const menuDataItems = await menu?.request?.(params || {}, route?.children || route?.routes || []);
|
|
210
|
+
return menuDataItems;
|
|
211
|
+
} finally {
|
|
212
|
+
menuOnLoadingChange(false);
|
|
213
|
+
}
|
|
225
214
|
}, {
|
|
226
215
|
revalidateOnFocus: false,
|
|
227
216
|
shouldRetryOnError: false,
|
|
228
217
|
revalidateOnReconnect: false
|
|
229
218
|
});
|
|
230
|
-
|
|
231
|
-
setMenuLoading(isLoading);
|
|
232
|
-
}, [isLoading]);
|
|
219
|
+
const menuLoading = menu?.loading ?? (menu?.request ? isValidating : menuLoadingState);
|
|
233
220
|
const {
|
|
234
221
|
cache
|
|
235
222
|
} = useSWRConfig();
|
|
@@ -414,11 +401,12 @@ const BaseProLayout = props => {
|
|
|
414
401
|
return bgLayoutImgList?.map((item, index) => {
|
|
415
402
|
return /*#__PURE__*/_jsx("img", {
|
|
416
403
|
src: item.src,
|
|
404
|
+
alt: "",
|
|
417
405
|
style: {
|
|
418
406
|
position: 'absolute',
|
|
419
407
|
...item
|
|
420
408
|
}
|
|
421
|
-
}, index);
|
|
409
|
+
}, item.src ?? `bg-layout-${index}`);
|
|
422
410
|
});
|
|
423
411
|
}
|
|
424
412
|
return null;
|
package/es/list/ProListBase.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* 内部 List 容器与 List.Item / List.Item.Meta 实现,用于替代 antd List(antd List 已停止维护)
|
|
3
3
|
* 保持与 antd List 相同的 DOM 结构及类名,以便复用 antd 的 list 样式
|
|
4
4
|
*/
|
|
5
|
-
import { ConfigProvider, Empty, Grid, Pagination } from 'antd';
|
|
5
|
+
import { ConfigProvider, Empty, Grid, Pagination, Spin } from 'antd';
|
|
6
6
|
import { clsx } from 'clsx';
|
|
7
7
|
import React, { useContext, useMemo } from 'react';
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -286,20 +286,14 @@ const ProListContainerInner = /*#__PURE__*/React.forwardRef(function ProListCont
|
|
|
286
286
|
children: child
|
|
287
287
|
}, child?.key ?? idx))
|
|
288
288
|
}) : items;
|
|
289
|
-
} else if (!children
|
|
289
|
+
} else if (!children) {
|
|
290
290
|
const emptyContent = locale?.emptyText ?? (typeof renderEmpty === 'function' ? renderEmpty('List') : null) ?? /*#__PURE__*/_jsx(Empty, {
|
|
291
|
-
|
|
291
|
+
image: Empty.PRESENTED_IMAGE_SIMPLE
|
|
292
292
|
});
|
|
293
293
|
childrenContent = /*#__PURE__*/_jsx("div", {
|
|
294
294
|
className: `${prefixCls}-empty-text`,
|
|
295
295
|
children: emptyContent
|
|
296
296
|
});
|
|
297
|
-
} else if (isLoading) {
|
|
298
|
-
childrenContent = /*#__PURE__*/_jsx("div", {
|
|
299
|
-
style: {
|
|
300
|
-
minHeight: 53
|
|
301
|
-
}
|
|
302
|
-
});
|
|
303
297
|
} else {
|
|
304
298
|
childrenContent = children;
|
|
305
299
|
}
|
|
@@ -339,18 +333,22 @@ const ProListContainerInner = /*#__PURE__*/React.forwardRef(function ProListCont
|
|
|
339
333
|
}, propHashId, className, rootClassName);
|
|
340
334
|
return /*#__PURE__*/_jsx(ProListContext.Provider, {
|
|
341
335
|
value: contextValue,
|
|
342
|
-
children: /*#__PURE__*/
|
|
336
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
343
337
|
ref: ref,
|
|
344
338
|
style: style,
|
|
345
339
|
className: classString,
|
|
346
340
|
...rest,
|
|
347
|
-
children:
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
341
|
+
children: /*#__PURE__*/_jsxs(Spin, {
|
|
342
|
+
spinning: isLoading,
|
|
343
|
+
delay: 100,
|
|
344
|
+
children: [showPaginationTop && paginationNode, header && /*#__PURE__*/_jsx("div", {
|
|
345
|
+
className: `${prefixCls}-header`,
|
|
346
|
+
children: header
|
|
347
|
+
}), childrenContent, footer && /*#__PURE__*/_jsx("div", {
|
|
348
|
+
className: `${prefixCls}-footer`,
|
|
349
|
+
children: footer
|
|
350
|
+
}), loadMore, showPaginationBottom && paginationNode]
|
|
351
|
+
})
|
|
354
352
|
})
|
|
355
353
|
});
|
|
356
354
|
});
|
|
@@ -5,7 +5,6 @@ import React, { useCallback, useContext, useEffect, useImperativeHandle, useMemo
|
|
|
5
5
|
import ProForm, { ProFormDependency } from "../../../form";
|
|
6
6
|
import { useIntl } from "../../../provider";
|
|
7
7
|
import { isDeepEqualReact, runFunction, useDeepCompareEffect, useRefFunction } from "../../../utils";
|
|
8
|
-
import { editableRowByKey, recordKeyToString } from "../../../utils/useEditableArray";
|
|
9
8
|
import ProTable from "../../Table";
|
|
10
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -39,69 +38,6 @@ function RecordCreator(props) {
|
|
|
39
38
|
});
|
|
40
39
|
}
|
|
41
40
|
|
|
42
|
-
/**
|
|
43
|
-
* 处理嵌套行的新增
|
|
44
|
-
*/
|
|
45
|
-
function handleNestedRowInsert(baseData, defaultValue, newLineOptions, getRowKey, childrenColumnName) {
|
|
46
|
-
if (!newLineOptions.recordKey) {
|
|
47
|
-
return baseData;
|
|
48
|
-
}
|
|
49
|
-
const actionProps = {
|
|
50
|
-
data: baseData,
|
|
51
|
-
getRowKey,
|
|
52
|
-
row: {
|
|
53
|
-
...defaultValue,
|
|
54
|
-
map_row_parentKey: recordKeyToString(newLineOptions.parentKey)?.toString()
|
|
55
|
-
},
|
|
56
|
-
key: newLineOptions.recordKey,
|
|
57
|
-
childrenColumnName
|
|
58
|
-
};
|
|
59
|
-
return editableRowByKey(actionProps, newLineOptions.position === 'top' ? 'top' : 'update');
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* 处理分页场景下的新增
|
|
64
|
-
*/
|
|
65
|
-
function handlePaginationInsert(baseData, defaultValue, pageConfig) {
|
|
66
|
-
if (pageConfig.pageSize > baseData.length) {
|
|
67
|
-
return [...baseData, defaultValue];
|
|
68
|
-
}
|
|
69
|
-
const insertIndex = pageConfig.current * pageConfig.pageSize - 1;
|
|
70
|
-
const result = [...baseData];
|
|
71
|
-
result.splice(insertIndex, 0, defaultValue);
|
|
72
|
-
return result;
|
|
73
|
-
}
|
|
74
|
-
function _useEditableDataSource({
|
|
75
|
-
actionDataSource,
|
|
76
|
-
editableUtils,
|
|
77
|
-
pagination,
|
|
78
|
-
getRowKey,
|
|
79
|
-
childrenColumnName
|
|
80
|
-
}) {
|
|
81
|
-
return useMemo(() => {
|
|
82
|
-
const newLineConfig = editableUtils?.newLineRecord;
|
|
83
|
-
const baseData = Array.isArray(actionDataSource) ? [...actionDataSource] : [];
|
|
84
|
-
if (!newLineConfig?.defaultValue) {
|
|
85
|
-
return baseData;
|
|
86
|
-
}
|
|
87
|
-
const {
|
|
88
|
-
options: newLineOptions,
|
|
89
|
-
defaultValue
|
|
90
|
-
} = newLineConfig;
|
|
91
|
-
if (newLineOptions?.parentKey) {
|
|
92
|
-
return handleNestedRowInsert(baseData, defaultValue, newLineOptions, getRowKey, childrenColumnName || 'children');
|
|
93
|
-
}
|
|
94
|
-
if (newLineOptions?.position === 'top') {
|
|
95
|
-
return [defaultValue, ...baseData];
|
|
96
|
-
}
|
|
97
|
-
const pageConfig = pagination && typeof pagination === 'object' ? pagination : undefined;
|
|
98
|
-
if (pageConfig?.current && pageConfig?.pageSize) {
|
|
99
|
-
return handlePaginationInsert(baseData, defaultValue, pageConfig);
|
|
100
|
-
}
|
|
101
|
-
return [...baseData, defaultValue];
|
|
102
|
-
}, [actionDataSource, childrenColumnName, editableUtils?.newLineRecord, getRowKey, pagination]);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
41
|
/**
|
|
106
42
|
* 检查是否应该显示创建按钮
|
|
107
43
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type DensitySize = 'middle' | 'small' | 'large' | undefined;
|
|
3
|
-
declare const _default: React.MemoExoticComponent<
|
|
3
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<{
|
|
4
4
|
icon?: React.ReactNode;
|
|
5
|
-
}
|
|
5
|
+
} & React.RefAttributes<HTMLSpanElement>>>;
|
|
6
6
|
export default _default;
|
|
@@ -4,7 +4,7 @@ import React, { useContext } from 'react';
|
|
|
4
4
|
import { useIntl } from "../../../provider";
|
|
5
5
|
import { TableContext } from "../../Store/Provide";
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
const DensityIcon = props => {
|
|
7
|
+
const DensityIcon = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
8
8
|
const {
|
|
9
9
|
icon = /*#__PURE__*/_jsx(ColumnHeightOutlined, {})
|
|
10
10
|
} = props;
|
|
@@ -35,8 +35,11 @@ const DensityIcon = props => {
|
|
|
35
35
|
trigger: ['click'],
|
|
36
36
|
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
37
37
|
title: intl.getMessage('tableToolBar.density', '表格密度'),
|
|
38
|
-
children:
|
|
38
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
39
|
+
ref: ref,
|
|
40
|
+
children: icon
|
|
41
|
+
})
|
|
39
42
|
})
|
|
40
43
|
});
|
|
41
|
-
};
|
|
44
|
+
});
|
|
42
45
|
export default /*#__PURE__*/React.memo(DensityIcon);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare const _default: React.MemoExoticComponent<
|
|
2
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<React.RefAttributes<HTMLSpanElement>>>;
|
|
3
3
|
export default _default;
|
|
@@ -4,7 +4,7 @@ import React, { useEffect, useState } from 'react';
|
|
|
4
4
|
import { useIntl } from "../../../provider";
|
|
5
5
|
import { isBrowser } from "../../../utils";
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
const FullScreenIcon = () => {
|
|
7
|
+
const FullScreenIcon = /*#__PURE__*/React.forwardRef((_, ref) => {
|
|
8
8
|
const intl = useIntl();
|
|
9
9
|
const [fullscreen, setFullscreen] = useState(false);
|
|
10
10
|
useEffect(() => {
|
|
@@ -16,11 +16,17 @@ const FullScreenIcon = () => {
|
|
|
16
16
|
};
|
|
17
17
|
}, []);
|
|
18
18
|
return fullscreen ? /*#__PURE__*/_jsx(Tooltip, {
|
|
19
|
-
title: intl.getMessage('tableToolBar.exitFullScreen', '
|
|
20
|
-
children: /*#__PURE__*/_jsx(
|
|
19
|
+
title: intl.getMessage('tableToolBar.exitFullScreen', '退出全屏'),
|
|
20
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
21
|
+
ref: ref,
|
|
22
|
+
children: /*#__PURE__*/_jsx(FullscreenExitOutlined, {})
|
|
23
|
+
})
|
|
21
24
|
}) : /*#__PURE__*/_jsx(Tooltip, {
|
|
22
25
|
title: intl.getMessage('tableToolBar.fullScreen', '全屏'),
|
|
23
|
-
children: /*#__PURE__*/_jsx(
|
|
26
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
27
|
+
ref: ref,
|
|
28
|
+
children: /*#__PURE__*/_jsx(FullscreenOutlined, {})
|
|
29
|
+
})
|
|
24
30
|
});
|
|
25
|
-
};
|
|
31
|
+
});
|
|
26
32
|
export default /*#__PURE__*/React.memo(FullScreenIcon);
|
|
@@ -3,5 +3,5 @@ import React from 'react';
|
|
|
3
3
|
declare const _default: React.ForwardRefExoticComponent<import("src/provider").BaseProFieldFC & import("src/provider").ProRenderFieldPropsType & {
|
|
4
4
|
text: string;
|
|
5
5
|
mode?: "update" | "read" | "edit" | undefined;
|
|
6
|
-
} & Partial<Omit<ColorPickerProps, "
|
|
6
|
+
} & Partial<Omit<ColorPickerProps, "value" | "mode">> & React.RefAttributes<any>>;
|
|
7
7
|
export default _default;
|
|
@@ -5,6 +5,6 @@ declare const _default: React.ForwardRefExoticComponent<import("../../../provide
|
|
|
5
5
|
format?: string | undefined;
|
|
6
6
|
showTime?: boolean | undefined;
|
|
7
7
|
variant?: "outlined" | "filled" | "borderless" | "underlined" | undefined;
|
|
8
|
-
picker?: "time" | "date" | "month" | "week" | "
|
|
8
|
+
picker?: "time" | "date" | "month" | "week" | "year" | "quarter" | undefined;
|
|
9
9
|
} & ProFieldLightProps & React.RefAttributes<any>>;
|
|
10
10
|
export default _default;
|
|
@@ -5,6 +5,6 @@ declare const _default: React.ForwardRefExoticComponent<import("../../../provide
|
|
|
5
5
|
format?: string | undefined;
|
|
6
6
|
variant?: "outlined" | "filled" | "borderless" | "underlined" | undefined;
|
|
7
7
|
showTime?: boolean | undefined;
|
|
8
|
-
picker?: "time" | "date" | "month" | "week" | "
|
|
8
|
+
picker?: "time" | "date" | "month" | "week" | "year" | "quarter" | undefined;
|
|
9
9
|
} & ProFieldLightProps & React.RefAttributes<any>>;
|
|
10
10
|
export default _default;
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _util = require("@rc-component/util");
|
|
8
9
|
var _antd = require("antd");
|
|
9
10
|
var _clsx = require("clsx");
|
|
10
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -48,7 +49,7 @@ const SearchSelect = (props, ref) => {
|
|
|
48
49
|
value: valuePropsName = 'value',
|
|
49
50
|
options: optionsPropsName = 'options'
|
|
50
51
|
} = fieldNames || {};
|
|
51
|
-
const [searchValue, setSearchValue] = (0,
|
|
52
|
+
const [searchValue, setSearchValue] = (0, _util.useControlledState)(defaultSearchValue, propsSearchValue);
|
|
52
53
|
const selectRef = (0, _react.useRef)();
|
|
53
54
|
(0, _react.useImperativeHandle)(ref, () => selectRef.current);
|
|
54
55
|
(0, _react.useEffect)(() => {
|
|
@@ -56,9 +57,6 @@ const SearchSelect = (props, ref) => {
|
|
|
56
57
|
selectRef?.current?.focus();
|
|
57
58
|
}
|
|
58
59
|
}, [restProps.autoFocus]);
|
|
59
|
-
(0, _react.useEffect)(() => {
|
|
60
|
-
setSearchValue(propsSearchValue);
|
|
61
|
-
}, [propsSearchValue]);
|
|
62
60
|
const {
|
|
63
61
|
getPrefixCls
|
|
64
62
|
} = (0, _react.useContext)(_antd.ConfigProvider.ConfigContext);
|
|
@@ -124,7 +124,7 @@ const Group = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
124
124
|
display: 'none'
|
|
125
125
|
},
|
|
126
126
|
children: hiddenChildren
|
|
127
|
-
}) : null];
|
|
127
|
+
}, "hidden") : null];
|
|
128
128
|
}, [children, RowWrapper, Wrapper, autoFocus]);
|
|
129
129
|
return wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsx)(ColWrapper, {
|
|
130
130
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -134,11 +134,19 @@ const Group = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
134
134
|
style: style,
|
|
135
135
|
ref: ref,
|
|
136
136
|
children: [hiddenDoms, (title || tooltip || extra) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
137
|
+
role: "button",
|
|
138
|
+
tabIndex: 0,
|
|
137
139
|
className: (0, _clsx.clsx)(`${className}-title`, hashId),
|
|
138
140
|
style: titleStyle,
|
|
139
141
|
onClick: () => {
|
|
140
142
|
setCollapsed(!collapsed);
|
|
141
143
|
},
|
|
144
|
+
onKeyDown: e => {
|
|
145
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
146
|
+
e.preventDefault();
|
|
147
|
+
setCollapsed(!collapsed);
|
|
148
|
+
}
|
|
149
|
+
},
|
|
142
150
|
children: extra ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
143
151
|
style: {
|
|
144
152
|
display: 'flex',
|
|
@@ -147,7 +155,9 @@ const Group = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
147
155
|
justifyContent: 'space-between'
|
|
148
156
|
},
|
|
149
157
|
children: [titleDom, /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
158
|
+
role: "presentation",
|
|
150
159
|
onClick: e => e.stopPropagation(),
|
|
160
|
+
onKeyDown: e => e.stopPropagation(),
|
|
151
161
|
children: extra
|
|
152
162
|
})]
|
|
153
163
|
}) : titleDom
|
|
@@ -41,16 +41,22 @@ const LightFilterContainer = props => {
|
|
|
41
41
|
hashId
|
|
42
42
|
} = (0, _style.useStyle)(lightFilterClassName);
|
|
43
43
|
const [open, setOpen] = (0, _react.useState)(false);
|
|
44
|
-
const [moreValues, setMoreValues] = (0, _react.useState)(() => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
const [moreValues, setMoreValues] = (0, _react.useState)(() => ({
|
|
45
|
+
...values
|
|
46
|
+
}));
|
|
47
|
+
const collapseLabelNode = (0, _react.useMemo)(() => {
|
|
48
|
+
if (collapseLabel) return collapseLabel;
|
|
49
|
+
if (collapse) {
|
|
50
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.FilterOutlined, {
|
|
51
|
+
className: (0, _clsx.clsx)(`${lightFilterClassName}-collapse-icon`, hashId)
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_utils.FieldLabel, {
|
|
55
|
+
variant: variant,
|
|
56
|
+
size: size,
|
|
57
|
+
label: intl.getMessage('form.lightFilter.more', '更多筛选')
|
|
52
58
|
});
|
|
53
|
-
}, [
|
|
59
|
+
}, [collapseLabel, collapse, lightFilterClassName, hashId, variant, size, intl]);
|
|
54
60
|
const {
|
|
55
61
|
collapseItems,
|
|
56
62
|
outsideItems
|
|
@@ -72,21 +78,6 @@ const LightFilterContainer = props => {
|
|
|
72
78
|
outsideItems: outsideItemsArr
|
|
73
79
|
};
|
|
74
80
|
}, [props.items]);
|
|
75
|
-
const renderCollapseLabelRender = () => {
|
|
76
|
-
if (collapseLabel) {
|
|
77
|
-
return collapseLabel;
|
|
78
|
-
}
|
|
79
|
-
if (collapse) {
|
|
80
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.FilterOutlined, {
|
|
81
|
-
className: (0, _clsx.clsx)(`${lightFilterClassName}-collapse-icon`, hashId)
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_utils.FieldLabel, {
|
|
85
|
-
variant: variant,
|
|
86
|
-
size: size,
|
|
87
|
-
label: intl.getMessage('form.lightFilter.more', '更多筛选')
|
|
88
|
-
});
|
|
89
|
-
};
|
|
90
81
|
return wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
91
82
|
className: (0, _clsx.clsx)(lightFilterClassName, hashId, `${lightFilterClassName}-${size}`, {
|
|
92
83
|
[`${lightFilterClassName}-effective`]: Object.keys(values).some(key => Array.isArray(values[key]) ? values[key].length > 0 : values[key])
|
|
@@ -132,7 +123,7 @@ const LightFilterContainer = props => {
|
|
|
132
123
|
},
|
|
133
124
|
placement: placement,
|
|
134
125
|
popoverProps: popoverProps,
|
|
135
|
-
label:
|
|
126
|
+
label: collapseLabelNode,
|
|
136
127
|
footerRender: footerRender,
|
|
137
128
|
footer: {
|
|
138
129
|
onConfirm: () => {
|
|
@@ -250,7 +241,7 @@ function LightFilter(props) {
|
|
|
250
241
|
onValuesChange(newValues, newAllValues);
|
|
251
242
|
}
|
|
252
243
|
}
|
|
253
|
-
});
|
|
244
|
+
}, JSON.stringify(values || {}));
|
|
254
245
|
},
|
|
255
246
|
formRef: formRef,
|
|
256
247
|
formItemProps: {
|