Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,14 @@
class="kuiTableRow"
>
<td class="kuiTableRowCell kuiTableRowCell--checkBox">
<input
type="checkbox"
class="kuiCheckBox"
ng-click="listingController.toggleItem(item)"
ng-checked="listingController.isItemChecked(item)"
>
<div class="kuiTableRowCell__liner">
<input
type="checkbox"
class="kuiCheckBox"
ng-click="listingController.toggleItem(item)"
ng-checked="listingController.isItemChecked(item)"
>
</div>
</td>

<td class="kuiTableRowCell">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,14 @@ <h1 class="kuiTitle">
class="kuiTableRow"
>
<td class="kuiTableRowCell kuiTableRowCell--checkBox">
<input
type="checkbox"
class="kuiCheckBox"
ng-click="toggleItem(item)"
ng-checked="selectedItems.indexOf(item) >= 0"
>
<div class="kuiTableRowCell__liner">
<input
type="checkbox"
class="kuiCheckBox"
ng-click="toggleItem(item)"
ng-checked="selectedItems.indexOf(item) >= 0"
>
</div>
</td>
<td class="kuiTableRowCell">
<div class="kuiTableRowCell__liner">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@
>
</th>

<th class="kuiTableHeaderCell" ng-click="listingController.sortOn('title')">
<th
class="kuiTableHeaderCell"
ng-click="listingController.sortOn('title')"
>
Name
<span
class="kuiIcon"
Expand All @@ -126,7 +129,10 @@
></span>
</th>

<th class="kuiTableHeaderCell" ng-click="listingController.sortOn('type')">
<th
class="kuiTableHeaderCell"
ng-click="listingController.sortOn('type')"
>
Type
<span
class="kuiIcon"
Expand All @@ -143,12 +149,14 @@
class="kuiTableRow"
>
<td class="kuiTableRowCell kuiTableRowCell--checkBox">
<input
type="checkbox"
class="kuiCheckBox"
ng-click="listingController.toggleItem(item)"
ng-checked="listingController.isItemChecked(item)"
>
<div class="kuiTableRowCell__liner">
<input
type="checkbox"
class="kuiCheckBox"
ng-click="listingController.toggleItem(item)"
ng-checked="listingController.isItemChecked(item)"
>
</div>
</td>

<td class="kuiTableRowCell">
Expand Down
31 changes: 25 additions & 6 deletions ui_framework/components/table/_table.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
$tableCellPadding: 7px 8px 8px;

/**
* 1. Prevent cells from expanding based on content size. This substitutes for table-layout: fixed.
*/
@mixin tableCell {
font-size: $fontSize;
font-weight: 400;
line-height: $lineHeight;
padding: 7px 8px 8px;
text-align: left;
max-width: 20px; /* 1 */

&:last-child {
padding-right: 16px;
}
}

/**
* NOTE: table-layout: fixed causes a bug in IE11 and Edge (see #9929). It also prevents us from
* specifying a column width, e.g. the checkbox column.
*/
.kuiTable {
width: 100%;
border: $tableBorder;
Expand All @@ -19,6 +27,8 @@

.kuiTableHeaderCell {
@include tableCell;
padding: $tableCellPadding;
line-height: $lineHeight;
color: #a7a7a7;
}

Expand Down Expand Up @@ -64,11 +74,15 @@

/**
* 1. Vertically align all children.
* 2. Truncate text with an ellipsis. The padding on this div allows the ellipsis to show. If
* the padding was on the cell, the ellipsis would be cropped.
*/
.kuiTableRowCell__liner {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap; /* 2 */
overflow: hidden; /* 2 */
text-overflow: ellipsis; /* 2 */
padding: $tableCellPadding; /* 2 */
line-height: $lineHeight; /* 1 */

& > * {
vertical-align: middle; /* 1 */
Expand All @@ -86,10 +100,15 @@
/**
* 1. Rendered width of cell with checkbox inside of it.
* 2. Align checkbox with text in other cells.
* 3. Show the checkbox in Edge; otherwise it gets cropped.
*/
.kuiTableHeaderCell--checkBox,
.kuiTableRowCell--checkBox {
width: 28px; /* 1 */
padding-right: 0;
line-height: 1;
line-height: 1; /* 2 */

.kuiTableRowCell__liner {
overflow: visible; /* 3 */
}
}
36 changes: 30 additions & 6 deletions ui_framework/dist/ui_framework.css
Original file line number Diff line number Diff line change
Expand Up @@ -1352,6 +1352,13 @@ body {
border-top: none;
/* 2 */ }

/**
* 1. Prevent cells from expanding based on content size. This substitutes for table-layout: fixed.
*/
/**
* NOTE: table-layout: fixed causes a bug in IE11 and Edge (see #9929). It also prevents us from
* specifying a column width, e.g. the checkbox column.
*/
.kuiTable {
width: 100%;
border: 2px solid #E4E4E4;
Expand All @@ -1361,9 +1368,11 @@ body {
.kuiTableHeaderCell {
font-size: 14px;
font-weight: 400;
line-height: 1.5;
padding: 7px 8px 8px;
text-align: left;
max-width: 20px;
/* 1 */
padding: 7px 8px 8px;
line-height: 1.5;
color: #a7a7a7; }
.kuiTableHeaderCell:last-child {
padding-right: 16px; }
Expand Down Expand Up @@ -1396,21 +1405,30 @@ body {
.kuiTableRowCell {
font-size: 14px;
font-weight: 400;
line-height: 1.5;
padding: 7px 8px 8px;
text-align: left;
max-width: 20px;
/* 1 */
color: #191E23;
border-top: 1px solid #E4E4E4; }
.kuiTableRowCell:last-child {
padding-right: 16px; }

/**
* 1. Vertically align all children.
* 2. Truncate text with an ellipsis. The padding on this div allows the ellipsis to show. If
* the padding was on the cell, the ellipsis would be cropped.
*/
.kuiTableRowCell__liner {
white-space: nowrap;
/* 2 */
overflow: hidden;
text-overflow: ellipsis; }
/* 2 */
text-overflow: ellipsis;
/* 2 */
padding: 7px 8px 8px;
/* 2 */
line-height: 1.5;
/* 1 */ }
.kuiTableRowCell__liner > * {
vertical-align: middle;
/* 1 */ }
Expand All @@ -1423,13 +1441,19 @@ body {
/**
* 1. Rendered width of cell with checkbox inside of it.
* 2. Align checkbox with text in other cells.
* 3. Show the checkbox in Edge; otherwise it gets cropped.
*/
.kuiTableHeaderCell--checkBox,
.kuiTableRowCell--checkBox {
width: 28px;
/* 1 */
padding-right: 0;
line-height: 1; }
line-height: 1;
/* 2 */ }
.kuiTableHeaderCell--checkBox .kuiTableRowCell__liner,
.kuiTableRowCell--checkBox .kuiTableRowCell__liner {
overflow: visible;
/* 3 */ }

.kuiTabs {
display: -webkit-box;
Expand Down
2 changes: 1 addition & 1 deletion ui_framework/doc_site/src/views/table/table.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
</td>
<td class="kuiTableRowCell">
<div class="kuiTableRowCell__liner">
<a class="kuiLink" href="#">Celebration</a>
<a class="kuiLink" href="#">Celebration of some very long content that will affect cell width and should eventually become truncated</a>
</div>
</td>
<td class="kuiTableRowCell">
Expand Down