Skip to content

Commit d3acab2

Browse files
committed
test: update snap
1 parent 16e8012 commit d3acab2

File tree

9 files changed

+4797
-5054
lines changed

9 files changed

+4797
-5054
lines changed

components/table/Table.tsx

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import RcTable, { Summary } from '../vc-table';
1+
import RcTable from '../vc-table';
22
import type { TableProps as RcTableProps } from '../vc-table/Table';
33
import { INTERNAL_HOOKS } from '../vc-table/Table';
44
import type { SpinProps } from '../spin';
@@ -23,11 +23,7 @@ import type {
2323
TableAction,
2424
FilterValue,
2525
} from './interface';
26-
import useSelection, {
27-
SELECTION_ALL,
28-
SELECTION_INVERT,
29-
SELECTION_NONE,
30-
} from './hooks/useSelection';
26+
import useSelection from './hooks/useSelection';
3127
import type { SortState } from './hooks/useSorter';
3228
import useSorter, { getSortData } from './hooks/useSorter';
3329
import type { FilterState } from './hooks/useFilter';
@@ -36,8 +32,6 @@ import useTitleColumns from './hooks/useTitleColumns';
3632
import renderExpandIcon from './ExpandIcon';
3733
import scrollTo from '../_util/scrollTo';
3834
import defaultLocale from '../locale/en_US';
39-
import Column from './Column';
40-
import ColumnGroup from './ColumnGroup';
4135
import type { SizeType } from '../config-provider';
4236
import devWarning from '../vc-util/devWarning';
4337
import type { PropType } from 'vue';
@@ -240,7 +234,7 @@ const InteralTable = defineComponent<
240234
'customFilterIcon',
241235
'customFilterDropdown',
242236
],
243-
setup(props, { attrs, slots, emit }) {
237+
setup(props, { attrs, slots }) {
244238
devWarning(
245239
!(typeof props.rowKey === 'function' && props.rowKey.length > 1),
246240
'Table',

components/table/__tests__/__snapshots__/Table.pagination.test.js.snap

+34-37
Original file line numberDiff line numberDiff line change
@@ -5,52 +5,49 @@ exports[`Table.pagination renders pagination correctly 1`] = `
55
<div class="ant-spin-nested-loading">
66
<!---->
77
<div class="ant-spin-container">
8-
<div class="ant-table ant-table-default ant-table-scroll-position-left">
8+
<div class="ant-table">
99
<!---->
10-
<div class="ant-table-content">
11-
<!---->
12-
<div class="ant-table-body">
13-
<table class="">
14-
<colgroup>
15-
<col data-key="name">
16-
</colgroup>
10+
<div class="ant-table-container">
11+
<div class="ant-table-content">
12+
<table style="table-layout: auto;">
13+
<colgroup></colgroup>
1714
<thead class="ant-table-thead">
1815
<tr>
19-
<th colstart="0" colspan="1" colend="0" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Name</span><span class="ant-table-column-sorter"><!----></span>
20-
</div></span>
21-
<!---->
22-
</th>
23-
</tr>
24-
</thead>
25-
<tbody class="ant-table-tbody">
26-
<tr class="ant-table-row ant-table-row-level-0" data-row-key="0">
27-
<td class="">
16+
<th class="ant-table-cell" colstart="0" colend="0">
17+
<!---->Name
18+
</th>
19+
</tr>
20+
</thead>
21+
<tbody class="ant-table-tbody">
2822
<!---->
29-
<!---->Jack
30-
</td>
31-
</tr>
32-
<tr class="ant-table-row ant-table-row-level-0" data-row-key="1">
33-
<td class="">
23+
<tr data-row-key="0" class="ant-table-row ant-table-row-level-0">
24+
<td class="ant-table-cell ant-table-cell-with-append">
25+
<!---->Jack
26+
</td>
27+
</tr>
3428
<!---->
35-
<!---->Lucy
36-
</td>
37-
</tr>
38-
</tbody>
39-
</table>
29+
<tr data-row-key="1" class="ant-table-row ant-table-row-level-0">
30+
<td class="ant-table-cell ant-table-cell-with-append">
31+
<!---->Lucy
32+
</td>
33+
</tr>
34+
<!---->
35+
</tbody>
36+
<!---->
37+
</table>
38+
</div>
4039
</div>
4140
<!---->
42-
<!---->
4341
</div>
42+
<ul unselectable="on" class="ant-pagination my-page">
43+
<!---->
44+
<li title="Previous Page" class="ant-pagination-prev ant-pagination-disabled" aria-disabled="true"><button class="ant-pagination-item-link" type="button" tabindex="-1" disabled=""><span role="img" aria-label="left" class="anticon anticon-left"><svg focusable="false" class="" data-icon="left" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"></path></svg></span></button></li>
45+
<li title="1" tabindex="0" class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"><a rel="nofollow">1</a></li>
46+
<li title="2" tabindex="0" class="ant-pagination-item ant-pagination-item-2"><a rel="nofollow">2</a></li>
47+
<li title="Next Page" tabindex="0" class="ant-pagination-next" aria-disabled="false"><button class="ant-pagination-item-link" type="button" tabindex="-1"><span role="img" aria-label="right" class="anticon anticon-right"><svg focusable="false" class="" data-icon="right" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"></path></svg></span></button></li>
48+
<!---->
49+
</ul>
4450
</div>
45-
<ul unselectable="on" class="ant-pagination my-page ant-table-pagination">
46-
<!---->
47-
<li title="Previous Page" class="ant-pagination-prev ant-pagination-disabled" aria-disabled="true"><button class="ant-pagination-item-link" type="button" tabindex="-1" disabled=""><span role="img" aria-label="left" class="anticon anticon-left"><svg focusable="false" class="" data-icon="left" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"></path></svg></span></button></li>
48-
<li title="1" tabindex="0" class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"><a rel="nofollow">1</a></li>
49-
<li title="2" tabindex="0" class="ant-pagination-item ant-pagination-item-2"><a rel="nofollow">2</a></li>
50-
<li title="Next Page" tabindex="0" class="ant-pagination-next" aria-disabled="false"><button class="ant-pagination-item-link" type="button" tabindex="-1"><span role="img" aria-label="right" class="anticon anticon-right"><svg focusable="false" class="" data-icon="right" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"></path></svg></span></button></li>
51-
<!---->
52-
</ul>
5351
</div>
5452
</div>
55-
</div>
5653
`;

components/table/__tests__/__snapshots__/Table.rowSelection.test.js.snap

+79-82
Original file line numberDiff line numberDiff line change
@@ -5,95 +5,92 @@ exports[`Table.rowSelection fix selection column on the left 1`] = `
55
<div class="ant-spin-nested-loading">
66
<!---->
77
<div class="ant-spin-container">
8-
<div class="ant-table ant-table-default ant-table-scroll-position-left ant-table-scroll-position-right">
8+
<div class="ant-table ant-table-has-fix-left">
99
<!---->
10-
<div class="ant-table-content">
11-
<div class="ant-table-scroll">
12-
<!---->
13-
<div class="ant-table-body">
14-
<table class="">
15-
<colgroup>
16-
<col data-key="selection-column" class="ant-table-selection-col">
17-
<col data-key="name">
18-
</colgroup>
19-
<thead class="ant-table-thead">
20-
<tr>
21-
<th colstart="0" colspan="1" colend="0" rowspan="1" class="ant-table-selection-column"><span class="ant-table-header-column"><div><span class="ant-table-column-title"><div class="ant-table-selection"><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span>
22-
<!----></label>
10+
<div class="ant-table-container">
11+
<div class="ant-table-content">
12+
<table style="table-layout: auto;">
13+
<colgroup>
14+
<col class="ant-table-selection-col">
15+
</colgroup>
16+
<thead class="ant-table-thead">
17+
<tr>
18+
<th class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last ant-table-selection-column" style="position: sticky; left: 0px;" colstart="0" colend="0">
19+
<!---->
20+
<div class="ant-table-selection"><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span>
21+
<!---->
22+
</label>
2323
<!---->
24-
</div></span><span class="ant-table-column-sorter"><!----></span>
25-
</div></span>
26-
<!---->
27-
</th>
28-
<th colstart="1" colspan="1" colend="1" rowspan="1" class=""><span class="ant-table-header-column"><div><span class="ant-table-column-title">Name</span><span class="ant-table-column-sorter"><!----></span>
29-
</div></span>
30-
<!---->
31-
</th>
32-
</tr>
33-
</thead>
34-
<tbody class="ant-table-tbody">
35-
<tr class="ant-table-row ant-table-row-level-0" data-row-key="0">
36-
<td class="ant-table-selection-column">
37-
<!---->
38-
<!----><span><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span>
39-
<!----></label></span>
40-
</td>
41-
<td class="">
42-
<!---->
43-
<!---->Jack
44-
</td>
45-
</tr>
46-
<tr class="ant-table-row ant-table-row-level-0" data-row-key="1">
47-
<td class="ant-table-selection-column">
48-
<!---->
49-
<!----><span><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span>
50-
<!----></label></span>
51-
</td>
52-
<td class="">
53-
<!---->
54-
<!---->Lucy
55-
</td>
56-
</tr>
57-
<tr class="ant-table-row ant-table-row-level-0" data-row-key="2">
58-
<td class="ant-table-selection-column">
59-
<!---->
60-
<!----><span><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span>
61-
<!----></label></span>
62-
</td>
63-
<td class="">
64-
<!---->
65-
<!---->Tom
66-
</td>
67-
</tr>
68-
<tr class="ant-table-row ant-table-row-level-0" data-row-key="3">
69-
<td class="ant-table-selection-column">
70-
<!---->
71-
<!----><span><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span>
72-
<!----></label></span>
73-
</td>
74-
<td class="">
24+
</div>
25+
</th>
26+
<th class="ant-table-cell" colstart="1" colend="1">
27+
<!---->Name
28+
</th>
29+
</tr>
30+
</thead>
31+
<tbody class="ant-table-tbody">
32+
<!---->
33+
<tr data-row-key="0" class="ant-table-row ant-table-row-level-0">
34+
<td class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last ant-table-cell-with-append ant-table-selection-column" style="position: sticky; left: 0px;">
35+
<!----><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span>
36+
<!---->
37+
</label>
38+
</td>
39+
<td class="ant-table-cell ant-table-cell-with-append">
40+
<!---->Jack
41+
</td>
42+
</tr>
43+
<!---->
44+
<tr data-row-key="1" class="ant-table-row ant-table-row-level-0">
45+
<td class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last ant-table-cell-with-append ant-table-selection-column" style="position: sticky; left: 0px;">
46+
<!----><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span>
47+
<!---->
48+
</label>
49+
</td>
50+
<td class="ant-table-cell ant-table-cell-with-append">
51+
<!---->Lucy
52+
</td>
53+
</tr>
54+
<!---->
55+
<tr data-row-key="2" class="ant-table-row ant-table-row-level-0">
56+
<td class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last ant-table-cell-with-append ant-table-selection-column" style="position: sticky; left: 0px;">
57+
<!----><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span>
58+
<!---->
59+
</label>
60+
</td>
61+
<td class="ant-table-cell ant-table-cell-with-append">
62+
<!---->Tom
63+
</td>
64+
</tr>
65+
<!---->
66+
<tr data-row-key="3" class="ant-table-row ant-table-row-level-0">
67+
<td class="ant-table-cell ant-table-cell-fix-left ant-table-cell-fix-left-last ant-table-cell-with-append ant-table-selection-column" style="position: sticky; left: 0px;">
68+
<!----><label class="ant-checkbox-wrapper"><span class="ant-checkbox"><input type="checkbox" class="ant-checkbox-input"><span class="ant-checkbox-inner"></span></span>
69+
<!---->
70+
</label>
71+
</td>
72+
<td class="ant-table-cell ant-table-cell-with-append">
73+
<!---->Jerry
74+
</td>
75+
</tr>
76+
<!---->
77+
</tbody>
7578
<!---->
76-
<!---->Jerry
77-
</td>
78-
</tr>
79-
</tbody>
80-
</table>
79+
</table>
80+
</div>
81+
</div>
82+
<!---->
8183
</div>
82-
<!---->
83-
<!---->
84+
<ul unselectable="on" class="ant-pagination ant-table-pagination ant-table-pagination-right">
85+
<!---->
86+
<li title="Previous Page" class="ant-pagination-prev ant-pagination-disabled" aria-disabled="true"><button class="ant-pagination-item-link" type="button" tabindex="-1" disabled=""><span role="img" aria-label="left" class="anticon anticon-left"><svg focusable="false" class="" data-icon="left" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"></path></svg></span></button></li>
87+
<li title="1" tabindex="0" class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"><a rel="nofollow">1</a></li>
88+
<li title="Next Page" class="ant-pagination-next ant-pagination-disabled" aria-disabled="true"><button class="ant-pagination-item-link" type="button" tabindex="-1" disabled=""><span role="img" aria-label="right" class="anticon anticon-right"><svg focusable="false" class="" data-icon="right" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"></path></svg></span></button></li>
89+
<!---->
90+
</ul>
8491
</div>
8592
</div>
8693
</div>
87-
<ul unselectable="on" class="ant-pagination ant-table-pagination">
88-
<!---->
89-
<li title="Previous Page" class="ant-pagination-prev ant-pagination-disabled" aria-disabled="true"><button class="ant-pagination-item-link" type="button" tabindex="-1" disabled=""><span role="img" aria-label="left" class="anticon anticon-left"><svg focusable="false" class="" data-icon="left" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"></path></svg></span></button></li>
90-
<li title="1" tabindex="0" class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"><a rel="nofollow">1</a></li>
91-
<li title="Next Page" class="ant-pagination-next ant-pagination-disabled" aria-disabled="true"><button class="ant-pagination-item-link" type="button" tabindex="-1" disabled=""><span role="img" aria-label="right" class="anticon anticon-right"><svg focusable="false" class="" data-icon="right" width="1em" height="1em" fill="currentColor" aria-hidden="true" viewBox="64 64 896 896"><path d="M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"></path></svg></span></button></li>
92-
<!---->
93-
</ul>
94-
</div>
95-
</div>
96-
</div>
9794
`;
9895
9996
exports[`Table.rowSelection render with default selection correctly 1`] = `

0 commit comments

Comments
 (0)