Skip to content

Commit fea0690

Browse files
fix(demo): use prefixCls instead of token.antCls in Table demos (#59327)
* fix(demo): use prefixCls instead of token.antCls in Table demos antd-style's createStyles token has no antCls, so the six Table scrollbar demos interpolated undefined into their selectors. The emitted rule was '.acss-x -table -table-container -table-body', which matches nothing, so the thin-scrollbar styling never applied. These were also the only six tsc errors in the repo. * test(table): update demo-extend snapshots for the new emotion hash --------- Co-authored-by: 高艳兵 <[email protected]>
1 parent e12b757 commit fea0690

8 files changed

Lines changed: 21 additions & 21 deletions

File tree

‎components/table/__tests__/__snapshots__/demo-extend.test.ts.snap‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12442,7 +12442,7 @@ exports[`renders components/table/demo/filter-search.tsx extend context correctl
1244212442

1244312443
exports[`renders components/table/demo/fixed-header.tsx extend context correctly 1`] = `
1244412444
<div
12445-
class="css-var-test-id ant-table-css-var ant-table-wrapper acss-1v0ot46"
12445+
class="css-var-test-id ant-table-css-var ant-table-wrapper acss-lej3nf"
1244612446
>
1244712447
<div
1244812448
aria-busy="false"
@@ -13809,7 +13809,7 @@ exports[`renders components/table/demo/fixed-header.tsx extend context correctly
1380913809

1381013810
exports[`renders components/table/demo/grouping-columns.tsx extend context correctly 1`] = `
1381113811
<div
13812-
class="css-var-test-id ant-table-css-var ant-table-wrapper acss-1v0ot46"
13812+
class="css-var-test-id ant-table-css-var ant-table-wrapper acss-lej3nf"
1381313813
>
1381413814
<div
1381513815
aria-busy="false"

‎components/table/__tests__/__snapshots__/demo.test.ts.snap‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9978,7 +9978,7 @@ exports[`renders components/table/demo/filter-search.tsx correctly 1`] = `
99789978

99799979
exports[`renders components/table/demo/fixed-columns.tsx correctly 1`] = `
99809980
<div
9981-
class="css-var-test-id ant-table-css-var ant-table-wrapper acss-1v0ot46"
9981+
class="css-var-test-id ant-table-css-var ant-table-wrapper acss-lej3nf"
99829982
>
99839983
<div
99849984
aria-busy="false"
@@ -10770,7 +10770,7 @@ exports[`renders components/table/demo/fixed-columns.tsx correctly 1`] = `
1077010770

1077110771
exports[`renders components/table/demo/fixed-columns-header.tsx correctly 1`] = `
1077210772
<div
10773-
class="css-var-test-id ant-table-css-var ant-table-wrapper acss-1v0ot46"
10773+
class="css-var-test-id ant-table-css-var ant-table-wrapper acss-lej3nf"
1077410774
>
1077510775
<div
1077610776
aria-busy="false"
@@ -12756,7 +12756,7 @@ exports[`renders components/table/demo/fixed-columns-header.tsx correctly 1`] =
1275612756

1275712757
exports[`renders components/table/demo/fixed-gapped-columns.tsx correctly 1`] = `
1275812758
<div
12759-
class="css-var-test-id ant-table-css-var ant-table-wrapper acss-1v0ot46"
12759+
class="css-var-test-id ant-table-css-var ant-table-wrapper acss-lej3nf"
1276012760
>
1276112761
<div
1276212762
aria-busy="false"
@@ -13502,7 +13502,7 @@ exports[`renders components/table/demo/fixed-gapped-columns.tsx correctly 1`] =
1350213502

1350313503
exports[`renders components/table/demo/fixed-header.tsx correctly 1`] = `
1350413504
<div
13505-
class="css-var-test-id ant-table-css-var ant-table-wrapper acss-1v0ot46"
13505+
class="css-var-test-id ant-table-css-var ant-table-wrapper acss-lej3nf"
1350613506
>
1350713507
<div
1350813508
aria-busy="false"
@@ -14761,7 +14761,7 @@ exports[`renders components/table/demo/fixed-header.tsx correctly 1`] = `
1476114761

1476214762
exports[`renders components/table/demo/grouping-columns.tsx correctly 1`] = `
1476314763
<div
14764-
class="css-var-test-id ant-table-css-var ant-table-wrapper acss-1v0ot46"
14764+
class="css-var-test-id ant-table-css-var ant-table-wrapper acss-lej3nf"
1476514765
>
1476614766
<div
1476714767
aria-busy="false"
@@ -28504,7 +28504,7 @@ exports[`renders components/table/demo/summary.tsx correctly 1`] = `
2850428504
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
2850528505
>
2850628506
<div
28507-
class="css-var-test-id ant-table-css-var ant-table-wrapper acss-1v0ot46"
28507+
class="css-var-test-id ant-table-css-var ant-table-wrapper acss-lej3nf"
2850828508
>
2850928509
<div
2851028510
aria-busy="false"
@@ -28688,7 +28688,7 @@ exports[`renders components/table/demo/summary.tsx correctly 1`] = `
2868828688
</div>
2868928689
</div>
2869028690
<div
28691-
class="css-var-test-id ant-table-css-var ant-table-wrapper acss-1v0ot46"
28691+
class="css-var-test-id ant-table-css-var ant-table-wrapper acss-lej3nf"
2869228692
>
2869328693
<div
2869428694
aria-busy="false"

‎components/table/demo/fixed-columns-header.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { Table } from 'antd';
33
import type { TableColumnsType } from 'antd';
44
import { createStyles } from 'antd-style';
55

6-
const useStyle = createStyles(({ css, token }) => {
7-
const { antCls } = token;
6+
const useStyle = createStyles(({ css, prefixCls }) => {
7+
const antCls = `.${prefixCls}`;
88
return {
99
customTable: css`
1010
${antCls}-table {

‎components/table/demo/fixed-columns.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { Table } from 'antd';
33
import type { TableColumnsType } from 'antd';
44
import { createStyles } from 'antd-style';
55

6-
const useStyle = createStyles(({ css, token }) => {
7-
const { antCls } = token;
6+
const useStyle = createStyles(({ css, prefixCls }) => {
7+
const antCls = `.${prefixCls}`;
88
return {
99
customTable: css`
1010
${antCls}-table {

‎components/table/demo/fixed-gapped-columns.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { Table } from 'antd';
33
import type { TableColumnsType } from 'antd';
44
import { createStyles } from 'antd-style';
55

6-
const useStyle = createStyles(({ css, token }) => {
7-
const { antCls } = token;
6+
const useStyle = createStyles(({ css, prefixCls }) => {
7+
const antCls = `.${prefixCls}`;
88
return {
99
customTable: css`
1010
${antCls}-table {

‎components/table/demo/fixed-header.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { Table } from 'antd';
33
import type { TableColumnsType } from 'antd';
44
import { createStyles } from 'antd-style';
55

6-
const useStyle = createStyles(({ css, token }) => {
7-
const { antCls } = token;
6+
const useStyle = createStyles(({ css, prefixCls }) => {
7+
const antCls = `.${prefixCls}`;
88
return {
99
customTable: css`
1010
${antCls}-table {

‎components/table/demo/grouping-columns.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { Table } from 'antd';
33
import type { TableColumnsType } from 'antd';
44
import { createStyles } from 'antd-style';
55

6-
const useStyle = createStyles(({ css, token }) => {
7-
const { antCls } = token;
6+
const useStyle = createStyles(({ css, prefixCls }) => {
7+
const antCls = `.${prefixCls}`;
88
return {
99
customTable: css`
1010
${antCls}-table {

‎components/table/demo/summary.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { Flex, Table, Typography } from 'antd';
33
import type { TableColumnsType } from 'antd';
44
import { createStyles } from 'antd-style';
55

6-
const useStyle = createStyles(({ css, token }) => {
7-
const { antCls } = token;
6+
const useStyle = createStyles(({ css, prefixCls }) => {
7+
const antCls = `.${prefixCls}`;
88
return {
99
customTable: css`
1010
${antCls}-table {

0 commit comments

Comments
 (0)