@ant-design/pro-components 3.1.13-0 → 3.1.14-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.
@@ -111,7 +111,7 @@ const Card = /*#__PURE__*/React.forwardRef((props, ref) => {
111
111
  /**
112
112
  * 根据响应式获取 gutter, 参考 antd 实现
113
113
  *
114
- * @param gutter Gutter
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
- /*#__PURE__*/
305
- // antd v5 Tabs 仅通过 items 渲染,传 children 会被忽略。
306
- // loading 状态下,把骨架屏放到 Tabs 容器外层,避免 children 被吞。
307
- _jsx("div", {
308
- className: clsx(`${prefixCls}-tabs`, hashId),
309
- children: loading ? loadingDOM : /*#__PURE__*/_jsx(Tabs, {
310
- onChange: tabs.onChange,
311
- ...omit(tabs, ['cardProps']),
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,
@@ -26,13 +26,11 @@ const genProCardStyle = token => {
26
26
  transition: 'all 0.3s',
27
27
  ...resetComponent?.(token),
28
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)': {
29
+ '&&:not(&-border):not(&-box-shadow)': {
32
30
  boxShadow: token.boxShadowTertiary
33
31
  },
34
32
  '&-box-shadow': {
35
- boxShadow: token.boxShadowCard,
33
+ boxShadow: token.boxShadowTertiary,
36
34
  borderColor: 'transparent'
37
35
  },
38
36
  '&-col': {
@@ -64,17 +62,12 @@ const genProCardStyle = token => {
64
62
  '&-border': {
65
63
  border: `${token.lineWidth}px ${token.lineType} ${token.colorBorderSecondary}`
66
64
  },
67
- '&-filled': {
68
- backgroundColor: token.colorFillAlter,
69
- borderColor: 'transparent',
70
- boxShadow: 'none'
71
- },
72
65
  '&-hoverable': {
73
66
  cursor: 'pointer',
74
67
  transition: 'box-shadow 0.3s, border-color 0.3s',
75
68
  '&:hover': {
76
69
  borderColor: 'transparent',
77
- boxShadow: token.boxShadowCard
70
+ boxShadow: token.boxShadowTertiary
78
71
  },
79
72
  [`&${componentCls}-checked:hover`]: {
80
73
  borderColor: token.controlOutline
@@ -102,6 +95,8 @@ const genProCardStyle = token => {
102
95
  },
103
96
  '&&-ghost': {
104
97
  backgroundColor: 'transparent',
98
+ border: 'none',
99
+ boxShadow: 'none',
105
100
  [`> ${componentCls}`]: {
106
101
  '&-header': {
107
102
  paddingInlineEnd: 0,
@@ -237,47 +232,55 @@ const genProCardStyle = token => {
237
232
  }
238
233
  },
239
234
  [`${componentCls}-tabs`]: {
240
- [`${token.antCls}-tabs-top > ${token.antCls}-tabs-nav`]: {
241
- marginBlockEnd: 0,
242
- [`${token.antCls}-tabs-nav-list`]: {
243
- marginBlockStart: token.marginXS,
244
- paddingInlineStart: token.padding
245
- }
246
- },
247
- [`${token.antCls}-tabs-bottom > ${token.antCls}-tabs-nav`]: {
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`]: {
235
+ [`&${token.antCls}-tabs-top`]: {
236
+ [`> ${token.antCls}-tabs-nav`]: {
237
+ marginBlockEnd: 0,
238
+ [`${token.antCls}-tabs-nav-list`]: {
239
+ paddingInlineStart: token.paddingLG
240
+ }
241
+ },
242
+ [`> ${token.antCls}-tabs-body-holder`]: {
255
243
  [`${token.antCls}-tabs-content`]: {
256
- [`${token.antCls}-tabs-tabpane`]: {
257
- paddingInlineStart: 0
258
- }
244
+ padding: token.paddingLG
259
245
  }
260
246
  }
261
247
  },
262
- // 这里是为了保证 tabs 的高度和左侧的一致
263
- [`${token.antCls}-tabs-left > ${token.antCls}-tabs-nav`]: {
264
- marginInlineEnd: 0,
265
- [`${token.antCls}-tabs-nav-list`]: {
266
- paddingBlockStart: token.padding
248
+ [`&${token.antCls}-tabs-bottom`]: {
249
+ [`> ${token.antCls}-tabs-nav`]: {
250
+ marginBlockEnd: 0,
251
+ [`${token.antCls}-tabs-nav-list`]: {
252
+ paddingInlineStart: token.paddingLG
253
+ }
254
+ },
255
+ [`> ${token.antCls}-tabs-body-holder`]: {
256
+ [`${token.antCls}-tabs-content`]: {
257
+ padding: token.paddingLG
258
+ }
267
259
  }
268
260
  },
269
- [`${token.antCls}-tabs-right`]: {
270
- [`${token.antCls}-tabs-content-holder`]: {
261
+ [`&${token.antCls}-tabs-left`]: {
262
+ [`> ${token.antCls}-tabs-nav`]: {
263
+ marginInlineEnd: 0,
264
+ [`${token.antCls}-tabs-nav-list`]: {
265
+ paddingBlockStart: token.padding
266
+ }
267
+ },
268
+ [`> ${token.antCls}-tabs-body-holder`]: {
271
269
  [`${token.antCls}-tabs-content`]: {
272
- [`${token.antCls}-tabs-tabpane`]: {
273
- paddingInlineStart: 0
274
- }
270
+ padding: token.paddingLG
275
271
  }
276
272
  }
277
273
  },
278
- [`${token.antCls}-tabs-right > ${token.antCls}-tabs-nav`]: {
279
- [`${token.antCls}-tabs-nav-list`]: {
280
- paddingBlockStart: token.padding
274
+ [`&${token.antCls}-tabs-right`]: {
275
+ [`> ${token.antCls}-tabs-nav`]: {
276
+ [`${token.antCls}-tabs-nav-list`]: {
277
+ paddingBlockStart: token.padding
278
+ }
279
+ },
280
+ [`> ${token.antCls}-tabs-body-holder`]: {
281
+ [`${token.antCls}-tabs-content`]: {
282
+ padding: token.paddingLG
283
+ }
281
284
  }
282
285
  }
283
286
  }
@@ -323,10 +326,7 @@ export default function useStyle(prefixCls) {
323
326
  return useAntdStyle('ProCard', token => {
324
327
  const proCardToken = {
325
328
  ...token,
326
- componentCls: `.${prefixCls}`,
327
- // antd v6 运行时注入了 boxShadowCard,但 GlobalToken 类型里没有声明,
328
- // 这里从原始 token 上透传一次。
329
- boxShadowCard: token.boxShadowCard ?? token.boxShadow
329
+ componentCls: `.${prefixCls}`
330
330
  };
331
331
  return [genProCardStyle(proCardToken), getGridStyleByCls(proCardToken.componentCls)];
332
332
  });
@@ -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' | 'filled';
66
+ variant?: 'outlined' | 'borderless';
67
67
  /**
68
68
  * 鼠标移过时可浮起
69
69
  *
@@ -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',
@@ -118,7 +118,7 @@ const Card = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
118
118
  /**
119
119
  * 根据响应式获取 gutter, 参考 antd 实现
120
120
  *
121
- * @param gutter Gutter
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
- /*#__PURE__*/
312
- // antd v5 Tabs 仅通过 items 渲染,传 children 会被忽略。
313
- // loading 状态下,把骨架屏放到 Tabs 容器外层,避免 children 被吞。
314
- (0, _jsxRuntime.jsx)("div", {
315
- className: (0, _clsx.clsx)(`${prefixCls}-tabs`, hashId),
316
- children: loading ? loadingDOM : /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tabs, {
317
- onChange: tabs.onChange,
318
- ...(0, _util.omit)(tabs, ['cardProps']),
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,
@@ -32,13 +32,11 @@ const genProCardStyle = token => {
32
32
  transition: 'all 0.3s',
33
33
  ...(0, _utils.resetComponent)?.(token),
34
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)': {
35
+ '&&:not(&-border):not(&-box-shadow)': {
38
36
  boxShadow: token.boxShadowTertiary
39
37
  },
40
38
  '&-box-shadow': {
41
- boxShadow: token.boxShadowCard,
39
+ boxShadow: token.boxShadowTertiary,
42
40
  borderColor: 'transparent'
43
41
  },
44
42
  '&-col': {
@@ -70,17 +68,12 @@ const genProCardStyle = token => {
70
68
  '&-border': {
71
69
  border: `${token.lineWidth}px ${token.lineType} ${token.colorBorderSecondary}`
72
70
  },
73
- '&-filled': {
74
- backgroundColor: token.colorFillAlter,
75
- borderColor: 'transparent',
76
- boxShadow: 'none'
77
- },
78
71
  '&-hoverable': {
79
72
  cursor: 'pointer',
80
73
  transition: 'box-shadow 0.3s, border-color 0.3s',
81
74
  '&:hover': {
82
75
  borderColor: 'transparent',
83
- boxShadow: token.boxShadowCard
76
+ boxShadow: token.boxShadowTertiary
84
77
  },
85
78
  [`&${componentCls}-checked:hover`]: {
86
79
  borderColor: token.controlOutline
@@ -108,6 +101,8 @@ const genProCardStyle = token => {
108
101
  },
109
102
  '&&-ghost': {
110
103
  backgroundColor: 'transparent',
104
+ border: 'none',
105
+ boxShadow: 'none',
111
106
  [`> ${componentCls}`]: {
112
107
  '&-header': {
113
108
  paddingInlineEnd: 0,
@@ -243,47 +238,55 @@ const genProCardStyle = token => {
243
238
  }
244
239
  },
245
240
  [`${componentCls}-tabs`]: {
246
- [`${token.antCls}-tabs-top > ${token.antCls}-tabs-nav`]: {
247
- marginBlockEnd: 0,
248
- [`${token.antCls}-tabs-nav-list`]: {
249
- marginBlockStart: token.marginXS,
250
- paddingInlineStart: token.padding
251
- }
252
- },
253
- [`${token.antCls}-tabs-bottom > ${token.antCls}-tabs-nav`]: {
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`]: {
241
+ [`&${token.antCls}-tabs-top`]: {
242
+ [`> ${token.antCls}-tabs-nav`]: {
243
+ marginBlockEnd: 0,
244
+ [`${token.antCls}-tabs-nav-list`]: {
245
+ paddingInlineStart: token.paddingLG
246
+ }
247
+ },
248
+ [`> ${token.antCls}-tabs-body-holder`]: {
261
249
  [`${token.antCls}-tabs-content`]: {
262
- [`${token.antCls}-tabs-tabpane`]: {
263
- paddingInlineStart: 0
264
- }
250
+ padding: token.paddingLG
265
251
  }
266
252
  }
267
253
  },
268
- // 这里是为了保证 tabs 的高度和左侧的一致
269
- [`${token.antCls}-tabs-left > ${token.antCls}-tabs-nav`]: {
270
- marginInlineEnd: 0,
271
- [`${token.antCls}-tabs-nav-list`]: {
272
- paddingBlockStart: token.padding
254
+ [`&${token.antCls}-tabs-bottom`]: {
255
+ [`> ${token.antCls}-tabs-nav`]: {
256
+ marginBlockEnd: 0,
257
+ [`${token.antCls}-tabs-nav-list`]: {
258
+ paddingInlineStart: token.paddingLG
259
+ }
260
+ },
261
+ [`> ${token.antCls}-tabs-body-holder`]: {
262
+ [`${token.antCls}-tabs-content`]: {
263
+ padding: token.paddingLG
264
+ }
273
265
  }
274
266
  },
275
- [`${token.antCls}-tabs-right`]: {
276
- [`${token.antCls}-tabs-content-holder`]: {
267
+ [`&${token.antCls}-tabs-left`]: {
268
+ [`> ${token.antCls}-tabs-nav`]: {
269
+ marginInlineEnd: 0,
270
+ [`${token.antCls}-tabs-nav-list`]: {
271
+ paddingBlockStart: token.padding
272
+ }
273
+ },
274
+ [`> ${token.antCls}-tabs-body-holder`]: {
277
275
  [`${token.antCls}-tabs-content`]: {
278
- [`${token.antCls}-tabs-tabpane`]: {
279
- paddingInlineStart: 0
280
- }
276
+ padding: token.paddingLG
281
277
  }
282
278
  }
283
279
  },
284
- [`${token.antCls}-tabs-right > ${token.antCls}-tabs-nav`]: {
285
- [`${token.antCls}-tabs-nav-list`]: {
286
- paddingBlockStart: token.padding
280
+ [`&${token.antCls}-tabs-right`]: {
281
+ [`> ${token.antCls}-tabs-nav`]: {
282
+ [`${token.antCls}-tabs-nav-list`]: {
283
+ paddingBlockStart: token.padding
284
+ }
285
+ },
286
+ [`> ${token.antCls}-tabs-body-holder`]: {
287
+ [`${token.antCls}-tabs-content`]: {
288
+ padding: token.paddingLG
289
+ }
287
290
  }
288
291
  }
289
292
  }
@@ -329,10 +332,7 @@ function useStyle(prefixCls) {
329
332
  return (0, _utils.useStyle)('ProCard', token => {
330
333
  const proCardToken = {
331
334
  ...token,
332
- componentCls: `.${prefixCls}`,
333
- // antd v6 运行时注入了 boxShadowCard,但 GlobalToken 类型里没有声明,
334
- // 这里从原始 token 上透传一次。
335
- boxShadowCard: token.boxShadowCard ?? token.boxShadow
335
+ componentCls: `.${prefixCls}`
336
336
  };
337
337
  return [genProCardStyle(proCardToken), getGridStyleByCls(proCardToken.componentCls)];
338
338
  });
@@ -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' | 'filled';
66
+ variant?: 'outlined' | 'borderless';
67
67
  /**
68
68
  * 鼠标移过时可浮起
69
69
  *
@@ -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',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ant-design/pro-components",
3
- "version": "3.1.13-0",
3
+ "version": "3.1.14-0",
4
4
  "description": "All-in-one package of @ant-design/pro-components",
5
5
  "keywords": [
6
6
  "antd",