fix: Table selection col width not correct (#23806)

* update snapshot

* Update package.json

* update snapshot
This commit is contained in:
二货机器人 2020-05-01 16:02:32 +08:00 committed by GitHub
parent 08dd4435df
commit 5f2874b292
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 71 additions and 14 deletions

View File

@ -27,6 +27,9 @@ exports[`Table.rowSelection fix expand on th left when selection column fixed on
<col
class="ant-table-expand-icon-col"
/>
<col
class="ant-table-selection-column"
/>
</colgroup>
<thead
class="ant-table-thead"
@ -354,7 +357,11 @@ exports[`Table.rowSelection fix selection column on the left 1`] = `
<table
style="width:903px;min-width:100%;table-layout:fixed"
>
<colgroup />
<colgroup>
<col
class="ant-table-selection-column"
/>
</colgroup>
<thead
class="ant-table-thead"
>
@ -634,7 +641,11 @@ exports[`Table.rowSelection fix selection column on the left when any other colu
<table
style="width:903px;min-width:100%;table-layout:fixed"
>
<colgroup />
<colgroup>
<col
class="ant-table-selection-column"
/>
</colgroup>
<thead
class="ant-table-thead"
>
@ -945,7 +956,11 @@ exports[`Table.rowSelection should support getPopupContainer 1`] = `
<table
style="table-layout: auto;"
>
<colgroup />
<colgroup>
<col
class="ant-table-selection-column"
/>
</colgroup>
<thead
class="ant-table-thead"
>
@ -1268,7 +1283,11 @@ exports[`Table.rowSelection should support getPopupContainer from ConfigProvider
<table
style="table-layout: auto;"
>
<colgroup />
<colgroup>
<col
class="ant-table-selection-column"
/>
</colgroup>
<thead
class="ant-table-thead"
>
@ -1591,7 +1610,11 @@ exports[`Table.rowSelection use column as selection column when key is \`selecti
<table
style="table-layout:auto"
>
<colgroup />
<colgroup>
<col
class="ant-table-selection-column"
/>
</colgroup>
<thead
class="ant-table-thead"
>

View File

@ -2378,6 +2378,9 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
<col
class="ant-table-expand-icon-col"
/>
<col
class="ant-table-selection-column"
/>
</colgroup>
<thead
class="ant-table-thead"
@ -4932,7 +4935,9 @@ exports[`renders ./components/table/demo/expand-children.md correctly 1`] = `
style="table-layout:auto"
>
<colgroup>
<col />
<col
class="ant-table-selection-column"
/>
<col />
<col
style="width:12%;min-width:12%"
@ -11867,7 +11872,11 @@ exports[`renders ./components/table/demo/row-selection.md correctly 1`] = `
<table
style="table-layout:auto"
>
<colgroup />
<colgroup>
<col
class="ant-table-selection-column"
/>
</colgroup>
<thead
class="ant-table-thead"
>
@ -12210,7 +12219,11 @@ exports[`renders ./components/table/demo/row-selection-and-operation.md correctl
<table
style="table-layout:auto"
>
<colgroup />
<colgroup>
<col
class="ant-table-selection-column"
/>
</colgroup>
<thead
class="ant-table-thead"
>
@ -12793,7 +12806,11 @@ exports[`renders ./components/table/demo/row-selection-custom.md correctly 1`] =
<table
style="table-layout:auto"
>
<colgroup />
<colgroup>
<col
class="ant-table-selection-column"
/>
</colgroup>
<thead
class="ant-table-thead"
>
@ -13403,7 +13420,11 @@ exports[`renders ./components/table/demo/row-selection-custom-debug.md correctly
<table
style="table-layout:auto"
>
<colgroup />
<colgroup>
<col
class="ant-table-selection-column"
/>
</colgroup>
<thead
class="ant-table-thead"
>

View File

@ -1,5 +1,6 @@
import * as React from 'react';
import DownOutlined from '@ant-design/icons/DownOutlined';
import { INTERNAL_COL_DEFINE } from 'rc-table';
import { FixedType } from 'rc-table/lib/interface';
import Checkbox, { CheckboxProps } from '../../checkbox';
import Dropdown from '../../dropdown';
@ -440,6 +441,9 @@ export default function useSelection<RecordType>(
className: `${prefixCls}-selection-column`,
title: rowSelection.columnTitle || title,
render: renderSelectionCell,
[INTERNAL_COL_DEFINE]: {
className: `${prefixCls}-selection-column`,
},
};
if (expandType === 'row' && columns.length && !expandIconColumnIndex) {

View File

@ -360,6 +360,7 @@
}
}
&-selection-column,
table tr th&-selection-column,
table tr td&-selection-column {
width: @table-selection-column-width;

View File

@ -2243,7 +2243,11 @@ exports[`renders ./components/transfer/demo/table-transfer.md correctly 1`] = `
<table
style="table-layout:auto"
>
<colgroup />
<colgroup>
<col
class="ant-table-selection-column"
/>
</colgroup>
<thead
class="ant-table-thead"
>
@ -2920,7 +2924,11 @@ exports[`renders ./components/transfer/demo/table-transfer.md correctly 1`] = `
<table
style="table-layout:auto"
>
<colgroup />
<colgroup>
<col
class="ant-table-selection-column"
/>
</colgroup>
<thead
class="ant-table-thead"
>

View File

@ -104,7 +104,7 @@
"copy-to-clipboard": "^3.2.0",
"css-animation": "^1.5.0",
"lodash": "^4.17.13",
"moment": "^2.24.0",
"moment": "~2.24.0",
"omit.js": "^1.0.2",
"prop-types": "^15.7.2",
"raf": "^3.4.1",
@ -129,7 +129,7 @@
"rc-slider": "~9.2.3",
"rc-steps": "~3.5.0",
"rc-switch": "~1.9.0",
"rc-table": "~7.5.2",
"rc-table": "~7.5.3",
"rc-tabs": "~10.1.1",
"rc-tooltip": "~4.0.2",
"rc-tree": "~3.1.0",