@ant-design/pro-components 3.1.13-0 → 3.1.14-1
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/Card/index.js +10 -13
- package/es/card/components/Card/style.js +44 -48
- package/es/card/typing.d.ts +1 -1
- package/es/descriptions/ProDescriptions.js +2 -2
- package/es/field/PureProField.js +1 -1
- package/es/field/components/Options/index.js +3 -3
- package/es/form/components/List/ListItem.js +6 -1
- package/es/layout/components/PageHeader/index.js +6 -7
- package/es/layout/components/PageHeader/style/index.js +2 -4
- package/lib/card/components/Card/index.js +10 -13
- package/lib/card/components/Card/style.js +44 -48
- package/lib/card/typing.d.ts +1 -1
- package/lib/descriptions/ProDescriptions.js +2 -2
- package/lib/field/PureProField.js +1 -1
- package/lib/field/components/Options/index.js +3 -3
- package/lib/form/components/List/ListItem.js +6 -1
- package/lib/layout/components/PageHeader/index.js +5 -6
- package/lib/layout/components/PageHeader/style/index.js +1 -3
- package/package.json +1 -1
|
@@ -111,7 +111,7 @@ const Card = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
111
111
|
/**
|
|
112
112
|
* 根据响应式获取 gutter, 参考 antd 实现
|
|
113
113
|
*
|
|
114
|
-
* @param
|
|
114
|
+
* @param gut
|
|
115
115
|
*/
|
|
116
116
|
const getNormalizedGutter = gut => {
|
|
117
117
|
const results = [0, 0];
|
|
@@ -208,7 +208,6 @@ const Card = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
208
208
|
});
|
|
209
209
|
const cardCls = clsx(`${prefixCls}`, className, rootClassName, hashId, classNames?.root, {
|
|
210
210
|
[`${prefixCls}-border`]: variant === 'outlined',
|
|
211
|
-
[`${prefixCls}-filled`]: variant === 'filled',
|
|
212
211
|
[`${prefixCls}-box-shadow`]: boxShadow,
|
|
213
212
|
[`${prefixCls}-contain-card`]: containProCard,
|
|
214
213
|
[`${prefixCls}-loading`]: loading,
|
|
@@ -300,17 +299,15 @@ const Card = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
300
299
|
className: clsx(`${prefixCls}-cover`, hashId, classNames?.cover),
|
|
301
300
|
style: mergedStyles.cover,
|
|
302
301
|
children: cover
|
|
303
|
-
}), tabs ?
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
_jsx(
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
items: ModifyTabItemsContent
|
|
313
|
-
})
|
|
302
|
+
}), tabs ? loading ? /*#__PURE__*/_jsx("div", {
|
|
303
|
+
className: bodyCls,
|
|
304
|
+
style: mergedStyles.body,
|
|
305
|
+
children: loadingDOM
|
|
306
|
+
}) : /*#__PURE__*/_jsx(Tabs, {
|
|
307
|
+
onChange: tabs.onChange,
|
|
308
|
+
...omit(tabs, ['cardProps']),
|
|
309
|
+
items: ModifyTabItemsContent,
|
|
310
|
+
className: clsx(`${prefixCls}-tabs`, hashId)
|
|
314
311
|
}) : /*#__PURE__*/_jsx("div", {
|
|
315
312
|
className: bodyCls,
|
|
316
313
|
style: mergedStyles.body,
|
|
@@ -25,14 +25,8 @@ const genProCardStyle = token => {
|
|
|
25
25
|
borderRadius: token.borderRadiusLG,
|
|
26
26
|
transition: 'all 0.3s',
|
|
27
27
|
...resetComponent?.(token),
|
|
28
|
-
// 对齐 antd v6 Card:variant='borderless' 默认就有 boxShadowTertiary 浅阴影。
|
|
29
|
-
// 用 :not(&-border):not(&-box-shadow) 把显式 -box-shadow(boxShadowCard 重阴影)
|
|
30
|
-
// 和 -hoverable:hover(hover 也走 boxShadowCard)排除掉,确保它们的优先级更高。
|
|
31
|
-
'&&:not(&-border):not(&-box-shadow):not(&-filled)': {
|
|
32
|
-
boxShadow: token.boxShadowTertiary
|
|
33
|
-
},
|
|
34
28
|
'&-box-shadow': {
|
|
35
|
-
boxShadow: token.
|
|
29
|
+
boxShadow: token.boxShadowTertiary,
|
|
36
30
|
borderColor: 'transparent'
|
|
37
31
|
},
|
|
38
32
|
'&-col': {
|
|
@@ -64,17 +58,12 @@ const genProCardStyle = token => {
|
|
|
64
58
|
'&-border': {
|
|
65
59
|
border: `${token.lineWidth}px ${token.lineType} ${token.colorBorderSecondary}`
|
|
66
60
|
},
|
|
67
|
-
'&-filled': {
|
|
68
|
-
backgroundColor: token.colorFillAlter,
|
|
69
|
-
borderColor: 'transparent',
|
|
70
|
-
boxShadow: 'none'
|
|
71
|
-
},
|
|
72
61
|
'&-hoverable': {
|
|
73
62
|
cursor: 'pointer',
|
|
74
63
|
transition: 'box-shadow 0.3s, border-color 0.3s',
|
|
75
64
|
'&:hover': {
|
|
76
65
|
borderColor: 'transparent',
|
|
77
|
-
boxShadow: token.
|
|
66
|
+
boxShadow: token.boxShadowTertiary
|
|
78
67
|
},
|
|
79
68
|
[`&${componentCls}-checked:hover`]: {
|
|
80
69
|
borderColor: token.controlOutline
|
|
@@ -102,6 +91,8 @@ const genProCardStyle = token => {
|
|
|
102
91
|
},
|
|
103
92
|
'&&-ghost': {
|
|
104
93
|
backgroundColor: 'transparent',
|
|
94
|
+
border: 'none',
|
|
95
|
+
boxShadow: 'none',
|
|
105
96
|
[`> ${componentCls}`]: {
|
|
106
97
|
'&-header': {
|
|
107
98
|
paddingInlineEnd: 0,
|
|
@@ -237,47 +228,55 @@ const genProCardStyle = token => {
|
|
|
237
228
|
}
|
|
238
229
|
},
|
|
239
230
|
[`${componentCls}-tabs`]: {
|
|
240
|
-
[
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
marginBlockEnd: 0,
|
|
249
|
-
[`${token.antCls}-tabs-nav-list`]: {
|
|
250
|
-
paddingInlineStart: token.padding
|
|
251
|
-
}
|
|
252
|
-
},
|
|
253
|
-
[`${token.antCls}-tabs-left`]: {
|
|
254
|
-
[`${token.antCls}-tabs-content-holder`]: {
|
|
231
|
+
[`&${token.antCls}-tabs-top`]: {
|
|
232
|
+
[`> ${token.antCls}-tabs-nav`]: {
|
|
233
|
+
marginBlockEnd: 0,
|
|
234
|
+
[`${token.antCls}-tabs-nav-list`]: {
|
|
235
|
+
paddingInlineStart: token.paddingLG
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
[`> ${token.antCls}-tabs-body-holder`]: {
|
|
255
239
|
[`${token.antCls}-tabs-content`]: {
|
|
256
|
-
|
|
257
|
-
paddingInlineStart: 0
|
|
258
|
-
}
|
|
240
|
+
padding: token.paddingLG
|
|
259
241
|
}
|
|
260
242
|
}
|
|
261
243
|
},
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
244
|
+
[`&${token.antCls}-tabs-bottom`]: {
|
|
245
|
+
[`> ${token.antCls}-tabs-nav`]: {
|
|
246
|
+
marginBlockEnd: 0,
|
|
247
|
+
[`${token.antCls}-tabs-nav-list`]: {
|
|
248
|
+
paddingInlineStart: token.paddingLG
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
[`> ${token.antCls}-tabs-body-holder`]: {
|
|
252
|
+
[`${token.antCls}-tabs-content`]: {
|
|
253
|
+
padding: token.paddingLG
|
|
254
|
+
}
|
|
267
255
|
}
|
|
268
256
|
},
|
|
269
|
-
[
|
|
270
|
-
[
|
|
257
|
+
[`&${token.antCls}-tabs-left`]: {
|
|
258
|
+
[`> ${token.antCls}-tabs-nav`]: {
|
|
259
|
+
marginInlineEnd: 0,
|
|
260
|
+
[`${token.antCls}-tabs-nav-list`]: {
|
|
261
|
+
paddingBlockStart: token.padding
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
[`> ${token.antCls}-tabs-body-holder`]: {
|
|
271
265
|
[`${token.antCls}-tabs-content`]: {
|
|
272
|
-
|
|
273
|
-
paddingInlineStart: 0
|
|
274
|
-
}
|
|
266
|
+
padding: token.paddingLG
|
|
275
267
|
}
|
|
276
268
|
}
|
|
277
269
|
},
|
|
278
|
-
[
|
|
279
|
-
[
|
|
280
|
-
|
|
270
|
+
[`&${token.antCls}-tabs-right`]: {
|
|
271
|
+
[`> ${token.antCls}-tabs-nav`]: {
|
|
272
|
+
[`${token.antCls}-tabs-nav-list`]: {
|
|
273
|
+
paddingBlockStart: token.padding
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
[`> ${token.antCls}-tabs-body-holder`]: {
|
|
277
|
+
[`${token.antCls}-tabs-content`]: {
|
|
278
|
+
padding: token.paddingLG
|
|
279
|
+
}
|
|
281
280
|
}
|
|
282
281
|
}
|
|
283
282
|
}
|
|
@@ -323,10 +322,7 @@ export default function useStyle(prefixCls) {
|
|
|
323
322
|
return useAntdStyle('ProCard', token => {
|
|
324
323
|
const proCardToken = {
|
|
325
324
|
...token,
|
|
326
|
-
componentCls: `.${prefixCls}
|
|
327
|
-
// antd v6 运行时注入了 boxShadowCard,但 GlobalToken 类型里没有声明,
|
|
328
|
-
// 这里从原始 token 上透传一次。
|
|
329
|
-
boxShadowCard: token.boxShadowCard ?? token.boxShadow
|
|
325
|
+
componentCls: `.${prefixCls}`
|
|
330
326
|
};
|
|
331
327
|
return [genProCardStyle(proCardToken), getGridStyleByCls(proCardToken.componentCls)];
|
|
332
328
|
});
|
package/es/card/typing.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ type CardPropsBase = Pick<AntdCardProps, 'rootClassName' | 'cover'> & {
|
|
|
63
63
|
/** 拆分卡片方式 */
|
|
64
64
|
split?: 'vertical' | 'horizontal';
|
|
65
65
|
/** 卡片变体,与 antd Card variant 一致 */
|
|
66
|
-
variant?: 'outlined' | 'borderless'
|
|
66
|
+
variant?: 'outlined' | 'borderless';
|
|
67
67
|
/**
|
|
68
68
|
* 鼠标移过时可浮起
|
|
69
69
|
*
|
|
@@ -125,9 +125,9 @@ const ProDescriptions = props => {
|
|
|
125
125
|
minWidth: 0
|
|
126
126
|
}
|
|
127
127
|
},
|
|
128
|
-
extra: rest.extra ? /*#__PURE__*/_jsxs(Space, {
|
|
128
|
+
extra: options || rest.extra ? /*#__PURE__*/_jsxs(Space, {
|
|
129
129
|
children: [options, rest.extra]
|
|
130
|
-
}) :
|
|
130
|
+
}) : undefined,
|
|
131
131
|
title: title,
|
|
132
132
|
items: children
|
|
133
133
|
})
|
package/es/field/PureProField.js
CHANGED
|
@@ -45,7 +45,7 @@ export const pureRenderRead = (dataValue, valueType, props, valueTypeMap) => {
|
|
|
45
45
|
}, /*#__PURE__*/_jsx(_Fragment, {
|
|
46
46
|
children: dataValue
|
|
47
47
|
}));
|
|
48
|
-
if (props?.render) {
|
|
48
|
+
if (props?.render && valueType !== 'option') {
|
|
49
49
|
return props.render?.(dataValue, {
|
|
50
50
|
text: dataValue,
|
|
51
51
|
...props
|
|
@@ -42,9 +42,9 @@ const FieldOptions = ({
|
|
|
42
42
|
mode: type,
|
|
43
43
|
...fieldProps
|
|
44
44
|
}, /*#__PURE__*/_jsx(_Fragment, {}));
|
|
45
|
-
if (!doms
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
if (!doms) return null;
|
|
46
|
+
if (!Array.isArray(doms)) return doms;
|
|
47
|
+
if (doms.length < 1) return null;
|
|
48
48
|
return /*#__PURE__*/_jsx("div", {
|
|
49
49
|
style: {
|
|
50
50
|
display: 'flex',
|
|
@@ -26,6 +26,7 @@ const listToArray = children => {
|
|
|
26
26
|
* 这是一个纯渲染辅助函数(不含任何 hook),可以在条件分支中安全调用。
|
|
27
27
|
*/
|
|
28
28
|
function renderActionIcon({
|
|
29
|
+
key,
|
|
29
30
|
iconProps,
|
|
30
31
|
defaultIcon: DefaultIcon,
|
|
31
32
|
actionClassName,
|
|
@@ -46,7 +47,7 @@ function renderActionIcon({
|
|
|
46
47
|
className: clsx(`${prefixCls}-action-icon`, actionClassName, hashId),
|
|
47
48
|
onClick: onClick
|
|
48
49
|
})
|
|
49
|
-
});
|
|
50
|
+
}, key);
|
|
50
51
|
}
|
|
51
52
|
const ProFormListItem = props => {
|
|
52
53
|
const {
|
|
@@ -140,6 +141,7 @@ const ProFormListItem = props => {
|
|
|
140
141
|
|
|
141
142
|
// 4 个操作 icon 无条件调用 renderActionIcon(纯函数,无 hook),通过 hidden 控制是否渲染
|
|
142
143
|
const copyIcon = renderActionIcon({
|
|
144
|
+
key: 'copy',
|
|
143
145
|
iconProps: copyIconProps,
|
|
144
146
|
defaultIcon: CopyOutlined,
|
|
145
147
|
actionClassName: 'action-copy',
|
|
@@ -155,6 +157,7 @@ const ProFormListItem = props => {
|
|
|
155
157
|
}
|
|
156
158
|
});
|
|
157
159
|
const deleteIcon = renderActionIcon({
|
|
160
|
+
key: 'delete',
|
|
158
161
|
iconProps: deleteIconProps,
|
|
159
162
|
defaultIcon: DeleteOutlined,
|
|
160
163
|
actionClassName: 'action-remove',
|
|
@@ -171,6 +174,7 @@ const ProFormListItem = props => {
|
|
|
171
174
|
}
|
|
172
175
|
});
|
|
173
176
|
const upIcon = renderActionIcon({
|
|
177
|
+
key: 'up',
|
|
174
178
|
iconProps: upIconProps,
|
|
175
179
|
defaultIcon: ArrowUpOutlined,
|
|
176
180
|
actionClassName: 'action-up',
|
|
@@ -182,6 +186,7 @@ const ProFormListItem = props => {
|
|
|
182
186
|
}
|
|
183
187
|
});
|
|
184
188
|
const downIcon = renderActionIcon({
|
|
189
|
+
key: 'down',
|
|
185
190
|
iconProps: downIconProps,
|
|
186
191
|
defaultIcon: ArrowDownOutlined,
|
|
187
192
|
actionClassName: 'action-down',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ArrowLeftOutlined, ArrowRightOutlined } from '@ant-design/icons';
|
|
2
2
|
import ResizeObserver from '@rc-component/resize-observer';
|
|
3
|
-
import { Avatar, Breadcrumb, ConfigProvider, Space } from 'antd';
|
|
3
|
+
import { Avatar, Breadcrumb, Button, ConfigProvider, Space } from 'antd';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import useStyle from "./style";
|
|
@@ -12,14 +12,13 @@ const renderBack = (prefixCls, hashId, backIcon, onBack) => {
|
|
|
12
12
|
}
|
|
13
13
|
return /*#__PURE__*/_jsx("div", {
|
|
14
14
|
className: clsx(`${prefixCls}-back`, hashId),
|
|
15
|
-
children: /*#__PURE__*/_jsx(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
15
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
16
|
+
type: "text",
|
|
17
|
+
size: "small",
|
|
18
|
+
onClick: onBack,
|
|
20
19
|
className: clsx(`${prefixCls}-back-button`, hashId),
|
|
21
20
|
"aria-label": "back",
|
|
22
|
-
|
|
21
|
+
icon: backIcon
|
|
23
22
|
})
|
|
24
23
|
});
|
|
25
24
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resetComponent, useStyle as useAntdStyle } from "../../../../utils";
|
|
2
2
|
const textOverflowEllipsis = () => ({
|
|
3
3
|
overflow: 'hidden',
|
|
4
4
|
whiteSpace: 'nowrap',
|
|
@@ -30,9 +30,7 @@ const genPageHeaderStyle = token => {
|
|
|
30
30
|
lineHeight: 1,
|
|
31
31
|
'&-button': {
|
|
32
32
|
fontSize: 16,
|
|
33
|
-
|
|
34
|
-
color: token.pageHeaderColorBack,
|
|
35
|
-
cursor: 'pointer'
|
|
33
|
+
color: token.pageHeaderColorBack
|
|
36
34
|
},
|
|
37
35
|
[`${token.componentCls}-rlt &`]: {
|
|
38
36
|
float: 'right',
|
|
@@ -118,7 +118,7 @@ const Card = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
118
118
|
/**
|
|
119
119
|
* 根据响应式获取 gutter, 参考 antd 实现
|
|
120
120
|
*
|
|
121
|
-
* @param
|
|
121
|
+
* @param gut
|
|
122
122
|
*/
|
|
123
123
|
const getNormalizedGutter = gut => {
|
|
124
124
|
const results = [0, 0];
|
|
@@ -215,7 +215,6 @@ const Card = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
215
215
|
});
|
|
216
216
|
const cardCls = (0, _clsx.clsx)(`${prefixCls}`, className, rootClassName, hashId, classNames?.root, {
|
|
217
217
|
[`${prefixCls}-border`]: variant === 'outlined',
|
|
218
|
-
[`${prefixCls}-filled`]: variant === 'filled',
|
|
219
218
|
[`${prefixCls}-box-shadow`]: boxShadow,
|
|
220
219
|
[`${prefixCls}-contain-card`]: containProCard,
|
|
221
220
|
[`${prefixCls}-loading`]: loading,
|
|
@@ -307,17 +306,15 @@ const Card = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
307
306
|
className: (0, _clsx.clsx)(`${prefixCls}-cover`, hashId, classNames?.cover),
|
|
308
307
|
style: mergedStyles.cover,
|
|
309
308
|
children: cover
|
|
310
|
-
}), tabs ?
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
(0, _jsxRuntime.jsx)(
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
items: ModifyTabItemsContent
|
|
320
|
-
})
|
|
309
|
+
}), tabs ? loading ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
310
|
+
className: bodyCls,
|
|
311
|
+
style: mergedStyles.body,
|
|
312
|
+
children: loadingDOM
|
|
313
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tabs, {
|
|
314
|
+
onChange: tabs.onChange,
|
|
315
|
+
...(0, _util.omit)(tabs, ['cardProps']),
|
|
316
|
+
items: ModifyTabItemsContent,
|
|
317
|
+
className: (0, _clsx.clsx)(`${prefixCls}-tabs`, hashId)
|
|
321
318
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
322
319
|
className: bodyCls,
|
|
323
320
|
style: mergedStyles.body,
|
|
@@ -31,14 +31,8 @@ const genProCardStyle = token => {
|
|
|
31
31
|
borderRadius: token.borderRadiusLG,
|
|
32
32
|
transition: 'all 0.3s',
|
|
33
33
|
...(0, _utils.resetComponent)?.(token),
|
|
34
|
-
// 对齐 antd v6 Card:variant='borderless' 默认就有 boxShadowTertiary 浅阴影。
|
|
35
|
-
// 用 :not(&-border):not(&-box-shadow) 把显式 -box-shadow(boxShadowCard 重阴影)
|
|
36
|
-
// 和 -hoverable:hover(hover 也走 boxShadowCard)排除掉,确保它们的优先级更高。
|
|
37
|
-
'&&:not(&-border):not(&-box-shadow):not(&-filled)': {
|
|
38
|
-
boxShadow: token.boxShadowTertiary
|
|
39
|
-
},
|
|
40
34
|
'&-box-shadow': {
|
|
41
|
-
boxShadow: token.
|
|
35
|
+
boxShadow: token.boxShadowTertiary,
|
|
42
36
|
borderColor: 'transparent'
|
|
43
37
|
},
|
|
44
38
|
'&-col': {
|
|
@@ -70,17 +64,12 @@ const genProCardStyle = token => {
|
|
|
70
64
|
'&-border': {
|
|
71
65
|
border: `${token.lineWidth}px ${token.lineType} ${token.colorBorderSecondary}`
|
|
72
66
|
},
|
|
73
|
-
'&-filled': {
|
|
74
|
-
backgroundColor: token.colorFillAlter,
|
|
75
|
-
borderColor: 'transparent',
|
|
76
|
-
boxShadow: 'none'
|
|
77
|
-
},
|
|
78
67
|
'&-hoverable': {
|
|
79
68
|
cursor: 'pointer',
|
|
80
69
|
transition: 'box-shadow 0.3s, border-color 0.3s',
|
|
81
70
|
'&:hover': {
|
|
82
71
|
borderColor: 'transparent',
|
|
83
|
-
boxShadow: token.
|
|
72
|
+
boxShadow: token.boxShadowTertiary
|
|
84
73
|
},
|
|
85
74
|
[`&${componentCls}-checked:hover`]: {
|
|
86
75
|
borderColor: token.controlOutline
|
|
@@ -108,6 +97,8 @@ const genProCardStyle = token => {
|
|
|
108
97
|
},
|
|
109
98
|
'&&-ghost': {
|
|
110
99
|
backgroundColor: 'transparent',
|
|
100
|
+
border: 'none',
|
|
101
|
+
boxShadow: 'none',
|
|
111
102
|
[`> ${componentCls}`]: {
|
|
112
103
|
'&-header': {
|
|
113
104
|
paddingInlineEnd: 0,
|
|
@@ -243,47 +234,55 @@ const genProCardStyle = token => {
|
|
|
243
234
|
}
|
|
244
235
|
},
|
|
245
236
|
[`${componentCls}-tabs`]: {
|
|
246
|
-
[
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
marginBlockEnd: 0,
|
|
255
|
-
[`${token.antCls}-tabs-nav-list`]: {
|
|
256
|
-
paddingInlineStart: token.padding
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
|
-
[`${token.antCls}-tabs-left`]: {
|
|
260
|
-
[`${token.antCls}-tabs-content-holder`]: {
|
|
237
|
+
[`&${token.antCls}-tabs-top`]: {
|
|
238
|
+
[`> ${token.antCls}-tabs-nav`]: {
|
|
239
|
+
marginBlockEnd: 0,
|
|
240
|
+
[`${token.antCls}-tabs-nav-list`]: {
|
|
241
|
+
paddingInlineStart: token.paddingLG
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
[`> ${token.antCls}-tabs-body-holder`]: {
|
|
261
245
|
[`${token.antCls}-tabs-content`]: {
|
|
262
|
-
|
|
263
|
-
paddingInlineStart: 0
|
|
264
|
-
}
|
|
246
|
+
padding: token.paddingLG
|
|
265
247
|
}
|
|
266
248
|
}
|
|
267
249
|
},
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
250
|
+
[`&${token.antCls}-tabs-bottom`]: {
|
|
251
|
+
[`> ${token.antCls}-tabs-nav`]: {
|
|
252
|
+
marginBlockEnd: 0,
|
|
253
|
+
[`${token.antCls}-tabs-nav-list`]: {
|
|
254
|
+
paddingInlineStart: token.paddingLG
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
[`> ${token.antCls}-tabs-body-holder`]: {
|
|
258
|
+
[`${token.antCls}-tabs-content`]: {
|
|
259
|
+
padding: token.paddingLG
|
|
260
|
+
}
|
|
273
261
|
}
|
|
274
262
|
},
|
|
275
|
-
[
|
|
276
|
-
[
|
|
263
|
+
[`&${token.antCls}-tabs-left`]: {
|
|
264
|
+
[`> ${token.antCls}-tabs-nav`]: {
|
|
265
|
+
marginInlineEnd: 0,
|
|
266
|
+
[`${token.antCls}-tabs-nav-list`]: {
|
|
267
|
+
paddingBlockStart: token.padding
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
[`> ${token.antCls}-tabs-body-holder`]: {
|
|
277
271
|
[`${token.antCls}-tabs-content`]: {
|
|
278
|
-
|
|
279
|
-
paddingInlineStart: 0
|
|
280
|
-
}
|
|
272
|
+
padding: token.paddingLG
|
|
281
273
|
}
|
|
282
274
|
}
|
|
283
275
|
},
|
|
284
|
-
[
|
|
285
|
-
[
|
|
286
|
-
|
|
276
|
+
[`&${token.antCls}-tabs-right`]: {
|
|
277
|
+
[`> ${token.antCls}-tabs-nav`]: {
|
|
278
|
+
[`${token.antCls}-tabs-nav-list`]: {
|
|
279
|
+
paddingBlockStart: token.padding
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
[`> ${token.antCls}-tabs-body-holder`]: {
|
|
283
|
+
[`${token.antCls}-tabs-content`]: {
|
|
284
|
+
padding: token.paddingLG
|
|
285
|
+
}
|
|
287
286
|
}
|
|
288
287
|
}
|
|
289
288
|
}
|
|
@@ -329,10 +328,7 @@ function useStyle(prefixCls) {
|
|
|
329
328
|
return (0, _utils.useStyle)('ProCard', token => {
|
|
330
329
|
const proCardToken = {
|
|
331
330
|
...token,
|
|
332
|
-
componentCls: `.${prefixCls}
|
|
333
|
-
// antd v6 运行时注入了 boxShadowCard,但 GlobalToken 类型里没有声明,
|
|
334
|
-
// 这里从原始 token 上透传一次。
|
|
335
|
-
boxShadowCard: token.boxShadowCard ?? token.boxShadow
|
|
331
|
+
componentCls: `.${prefixCls}`
|
|
336
332
|
};
|
|
337
333
|
return [genProCardStyle(proCardToken), getGridStyleByCls(proCardToken.componentCls)];
|
|
338
334
|
});
|
package/lib/card/typing.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ type CardPropsBase = Pick<AntdCardProps, 'rootClassName' | 'cover'> & {
|
|
|
63
63
|
/** 拆分卡片方式 */
|
|
64
64
|
split?: 'vertical' | 'horizontal';
|
|
65
65
|
/** 卡片变体,与 antd Card variant 一致 */
|
|
66
|
-
variant?: 'outlined' | 'borderless'
|
|
66
|
+
variant?: 'outlined' | 'borderless';
|
|
67
67
|
/**
|
|
68
68
|
* 鼠标移过时可浮起
|
|
69
69
|
*
|
|
@@ -132,9 +132,9 @@ const ProDescriptions = props => {
|
|
|
132
132
|
minWidth: 0
|
|
133
133
|
}
|
|
134
134
|
},
|
|
135
|
-
extra: rest.extra ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
135
|
+
extra: options || rest.extra ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
136
136
|
children: [options, rest.extra]
|
|
137
|
-
}) :
|
|
137
|
+
}) : undefined,
|
|
138
138
|
title: title,
|
|
139
139
|
items: children
|
|
140
140
|
})
|
|
@@ -51,7 +51,7 @@ const pureRenderRead = (dataValue, valueType, props, valueTypeMap) => {
|
|
|
51
51
|
}, /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
52
52
|
children: dataValue
|
|
53
53
|
}));
|
|
54
|
-
if (props?.render) {
|
|
54
|
+
if (props?.render && valueType !== 'option') {
|
|
55
55
|
return props.render?.(dataValue, {
|
|
56
56
|
text: dataValue,
|
|
57
57
|
...props
|
|
@@ -48,9 +48,9 @@ const FieldOptions = ({
|
|
|
48
48
|
mode: type,
|
|
49
49
|
...fieldProps
|
|
50
50
|
}, /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {}));
|
|
51
|
-
if (!doms
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
if (!doms) return null;
|
|
52
|
+
if (!Array.isArray(doms)) return doms;
|
|
53
|
+
if (doms.length < 1) return null;
|
|
54
54
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
55
55
|
style: {
|
|
56
56
|
display: 'flex',
|
|
@@ -32,6 +32,7 @@ const listToArray = children => {
|
|
|
32
32
|
* 这是一个纯渲染辅助函数(不含任何 hook),可以在条件分支中安全调用。
|
|
33
33
|
*/
|
|
34
34
|
function renderActionIcon({
|
|
35
|
+
key,
|
|
35
36
|
iconProps,
|
|
36
37
|
defaultIcon: DefaultIcon,
|
|
37
38
|
actionClassName,
|
|
@@ -52,7 +53,7 @@ function renderActionIcon({
|
|
|
52
53
|
className: (0, _clsx.clsx)(`${prefixCls}-action-icon`, actionClassName, hashId),
|
|
53
54
|
onClick: onClick
|
|
54
55
|
})
|
|
55
|
-
});
|
|
56
|
+
}, key);
|
|
56
57
|
}
|
|
57
58
|
const ProFormListItem = props => {
|
|
58
59
|
const {
|
|
@@ -146,6 +147,7 @@ const ProFormListItem = props => {
|
|
|
146
147
|
|
|
147
148
|
// 4 个操作 icon 无条件调用 renderActionIcon(纯函数,无 hook),通过 hidden 控制是否渲染
|
|
148
149
|
const copyIcon = renderActionIcon({
|
|
150
|
+
key: 'copy',
|
|
149
151
|
iconProps: copyIconProps,
|
|
150
152
|
defaultIcon: _icons.CopyOutlined,
|
|
151
153
|
actionClassName: 'action-copy',
|
|
@@ -161,6 +163,7 @@ const ProFormListItem = props => {
|
|
|
161
163
|
}
|
|
162
164
|
});
|
|
163
165
|
const deleteIcon = renderActionIcon({
|
|
166
|
+
key: 'delete',
|
|
164
167
|
iconProps: deleteIconProps,
|
|
165
168
|
defaultIcon: _icons.DeleteOutlined,
|
|
166
169
|
actionClassName: 'action-remove',
|
|
@@ -177,6 +180,7 @@ const ProFormListItem = props => {
|
|
|
177
180
|
}
|
|
178
181
|
});
|
|
179
182
|
const upIcon = renderActionIcon({
|
|
183
|
+
key: 'up',
|
|
180
184
|
iconProps: upIconProps,
|
|
181
185
|
defaultIcon: _icons.ArrowUpOutlined,
|
|
182
186
|
actionClassName: 'action-up',
|
|
@@ -188,6 +192,7 @@ const ProFormListItem = props => {
|
|
|
188
192
|
}
|
|
189
193
|
});
|
|
190
194
|
const downIcon = renderActionIcon({
|
|
195
|
+
key: 'down',
|
|
191
196
|
iconProps: downIconProps,
|
|
192
197
|
defaultIcon: _icons.ArrowDownOutlined,
|
|
193
198
|
actionClassName: 'action-down',
|
|
@@ -18,14 +18,13 @@ const renderBack = (prefixCls, hashId, backIcon, onBack) => {
|
|
|
18
18
|
}
|
|
19
19
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
20
20
|
className: (0, _clsx.clsx)(`${prefixCls}-back`, hashId),
|
|
21
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
},
|
|
21
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Button, {
|
|
22
|
+
type: "text",
|
|
23
|
+
size: "small",
|
|
24
|
+
onClick: onBack,
|
|
26
25
|
className: (0, _clsx.clsx)(`${prefixCls}-back-button`, hashId),
|
|
27
26
|
"aria-label": "back",
|
|
28
|
-
|
|
27
|
+
icon: backIcon
|
|
29
28
|
})
|
|
30
29
|
});
|
|
31
30
|
};
|
|
@@ -36,9 +36,7 @@ const genPageHeaderStyle = token => {
|
|
|
36
36
|
lineHeight: 1,
|
|
37
37
|
'&-button': {
|
|
38
38
|
fontSize: 16,
|
|
39
|
-
|
|
40
|
-
color: token.pageHeaderColorBack,
|
|
41
|
-
cursor: 'pointer'
|
|
39
|
+
color: token.pageHeaderColorBack
|
|
42
40
|
},
|
|
43
41
|
[`${token.componentCls}-rlt &`]: {
|
|
44
42
|
float: 'right',
|