Skip to content

Commit

Permalink
Merge branch 'master' into page-size-disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
tw15egan authored Jun 12, 2020
2 parents 30bc8fc + 3d12009 commit b75639c
Show file tree
Hide file tree
Showing 15 changed files with 165 additions and 133 deletions.
79 changes: 39 additions & 40 deletions packages/components/docs/sass.md
Original file line number Diff line number Diff line change
Expand Up @@ -3691,7 +3691,6 @@ $spacing-03: $carbon--spacing-03;
- [snippet [mixin]](#snippet-mixin)
- [data-table-v2-action [mixin]](#data-table-v2-action-mixin)
- [data-table-core [mixin]](#data-table-core-mixin)
- [data-table-expandable [mixin]](#data-table-expandable-mixin)
- [data-table-sort [mixin]](#data-table-sort-mixin)
- [modal [mixin]](#modal-mixin)
- [select [mixin]](#select-mixin)
Expand Down Expand Up @@ -15776,7 +15775,7 @@ Data table core styles

.#{$prefix}--data-table th,
.#{$prefix}--data-table td {
vertical-align: top;
vertical-align: middle;
text-align: left;
}

Expand All @@ -15797,8 +15796,8 @@ Data table core styles
}

.#{$prefix}--data-table .#{$prefix}--table-header-label {
display: block;
padding: rem(14px) $spacing-05;
padding-left: $spacing-05;
padding-right: $spacing-05;
text-align: left;
}

Expand All @@ -15808,8 +15807,8 @@ Data table core styles
color: $text-02;
border-top: 1px solid $ui-01;
border-bottom: 1px solid $ui-03;
padding: rem(14px) $spacing-05;
padding-bottom: rem(13px);
padding-left: $spacing-05;
padding-right: $spacing-05;

+ td:first-of-type {
padding-left: $spacing-04;
Expand Down Expand Up @@ -15948,22 +15947,33 @@ Data table core styles
// Do not use `position: relative`, as its behavior is undefined for many table elements: https://www.w3.org/TR/CSS21/visuren.html#propdef-position
position: static;
background: $ui-03;
padding: rem(12px) $spacing-03 0 $spacing-05;
padding-left: $spacing-05;
padding-right: $spacing-05;
width: rem(
44px
); // 16px padding left + 8px padding right + 20px checkbox width
transition: background-color $duration--fast-01 motion(entrance, productive);
}

.#{$prefix}--data-table td.#{$prefix}--table-column-checkbox {
padding-top: rem(11px);
padding-bottom: 0;
.#{$prefix}--data-table--tall .#{$prefix}--table-column-checkbox {
padding-top: rem(13px);
}

.#{$prefix}--data-table--tall .#{$prefix}--table-column-radio {
padding-top: $spacing-05;
}

.#{$prefix}--date-table tbody th.#{$prefix}--table-column-checkbox:hover {
background: $data-table-column-hover;
}

//----------------------------------------------------------------------------
// Radio
//----------------------------------------------------------------------------
.#{$prefix}--table-column-radio {
width: 48px;
}

// default selected row + zebra select - even child
.#{$prefix}--data-table--zebra
tbody
Expand Down Expand Up @@ -16120,13 +16130,13 @@ Data table core styles
padding-top: 1rem;
}

.#{$prefix}--data-table--cell-secondary-text {
@include type-style('label-01');
.#{$prefix}--data-table--tall th,
.#{$prefix}--data-table--tall td {
vertical-align: top;
}

.#{$prefix}--data-table.#{$prefix}--data-table--tall
.#{$prefix}--table-column-checkbox {
padding-top: rem(12px);
.#{$prefix}--data-table--cell-secondary-text {
@include type-style('label-01');
}

//----------------------------------------------------------------------------
Expand Down Expand Up @@ -16358,7 +16368,7 @@ Data table expandable styles
}

tr.#{$prefix}--parent-row.#{$prefix}--expandable-row:hover td:first-of-type {
border-bottom: 1px solid transparent; // first td doesn't have a visible border
border-bottom: 1px solid $hover-ui; // first td doesn't have a visible border
}

// child row when hovering on expanded parent
Expand Down Expand Up @@ -16398,12 +16408,20 @@ Data table expandable styles
.#{$prefix}--data-table td.#{$prefix}--table-expand {
width: 2.5rem;
min-width: 2.5rem;
height: 3rem;
vertical-align: top;
padding: 0;
border-bottom: 1px solid $ui-03;
}

.#{$prefix}--data-table td.#{$prefix}--table-expand,
th.#{$prefix}--table-expand {
padding: 0 $spacing-05;
}

.#{$prefix}--data-table--tall td.#{$prefix}--table-expand,
.#{$prefix}--data-table--tall th.#{$prefix}--table-expand {
padding-top: rem(16px);
padding-bottom: rem(16px);
}

.#{$prefix}--data-table
td.#{$prefix}--table-expand[data-previous-value='collapsed'] {
border-bottom: 1px solid transparent;
Expand All @@ -16417,15 +16435,8 @@ Data table expandable styles

.#{$prefix}--table-expand__button {
@include button-reset('false');
display: flex;
justify-content: space-around;
align-items: center;
height: 100%;
width: 100%;
}

.#{$prefix}--data-table--short .#{$prefix}--table-expand__button {
height: auto;
height: rem(16px);
vertical-align: inherit;
}

.#{$prefix}--table-expand__button:focus {
Expand All @@ -16442,17 +16453,6 @@ Data table expandable styles
transition: transform $duration--moderate-01 motion(standard, productive);
}

th.#{$prefix}--table-expand {
position: relative;
vertical-align: middle;
padding-left: $spacing-05;
padding-right: $spacing-05;
}

th.#{$prefix}--table-expand + th.#{$prefix}--table-column-checkbox {
padding-left: $spacing-03;
}

// fix expanded parent separating border length
tr.#{$prefix}--parent-row.#{$prefix}--expandable-row
td.#{$prefix}--table-expand
Expand Down Expand Up @@ -16624,7 +16624,6 @@ Data table expandable styles
- [text-01 [variable]](#text-01-variable)
- [focus [variable]](#focus-variable)
- [ui-05 [variable]](#ui-05-variable)
- [spacing-03 [variable]](#spacing-03-variable)
- [ui-01 [variable]](#ui-01-variable)
- [hover-field [variable]](#hover-field-variable)
- [selected-ui [variable]](#selected-ui-variable)
Expand Down
39 changes: 25 additions & 14 deletions packages/components/src/components/data-table/_data-table-core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@

.#{$prefix}--data-table th,
.#{$prefix}--data-table td {
vertical-align: top;
vertical-align: middle;
text-align: left;
}

Expand All @@ -108,8 +108,8 @@
}

.#{$prefix}--data-table .#{$prefix}--table-header-label {
display: block;
padding: rem(14px) $spacing-05;
padding-left: $spacing-05;
padding-right: $spacing-05;
text-align: left;
}

Expand All @@ -119,8 +119,8 @@
color: $text-02;
border-top: 1px solid $ui-01;
border-bottom: 1px solid $ui-03;
padding: rem(14px) $spacing-05;
padding-bottom: rem(13px);
padding-left: $spacing-05;
padding-right: $spacing-05;

+ td:first-of-type {
padding-left: $spacing-04;
Expand Down Expand Up @@ -259,22 +259,33 @@
// Do not use `position: relative`, as its behavior is undefined for many table elements: https://www.w3.org/TR/CSS21/visuren.html#propdef-position
position: static;
background: $ui-03;
padding: rem(12px) $spacing-03 0 $spacing-05;
padding-left: $spacing-05;
padding-right: $spacing-05;
width: rem(
44px
); // 16px padding left + 8px padding right + 20px checkbox width
transition: background-color $duration--fast-01 motion(entrance, productive);
}

.#{$prefix}--data-table td.#{$prefix}--table-column-checkbox {
padding-top: rem(11px);
padding-bottom: 0;
.#{$prefix}--data-table--tall .#{$prefix}--table-column-checkbox {
padding-top: rem(13px);
}

.#{$prefix}--data-table--tall .#{$prefix}--table-column-radio {
padding-top: $spacing-05;
}

.#{$prefix}--date-table tbody th.#{$prefix}--table-column-checkbox:hover {
background: $data-table-column-hover;
}

//----------------------------------------------------------------------------
// Radio
//----------------------------------------------------------------------------
.#{$prefix}--table-column-radio {
width: 48px;
}

// default selected row + zebra select - even child
.#{$prefix}--data-table--zebra
tbody
Expand Down Expand Up @@ -431,13 +442,13 @@
padding-top: 1rem;
}

.#{$prefix}--data-table--cell-secondary-text {
@include type-style('label-01');
.#{$prefix}--data-table--tall th,
.#{$prefix}--data-table--tall td {
vertical-align: top;
}

.#{$prefix}--data-table.#{$prefix}--data-table--tall
.#{$prefix}--table-column-checkbox {
padding-top: rem(12px);
.#{$prefix}--data-table--cell-secondary-text {
@include type-style('label-01');
}

//----------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
}

tr.#{$prefix}--parent-row.#{$prefix}--expandable-row:hover td:first-of-type {
border-bottom: 1px solid transparent; // first td doesn't have a visible border
border-bottom: 1px solid $hover-ui; // first td doesn't have a visible border
}

// child row when hovering on expanded parent
Expand Down Expand Up @@ -160,12 +160,20 @@
.#{$prefix}--data-table td.#{$prefix}--table-expand {
width: 2.5rem;
min-width: 2.5rem;
height: 3rem;
vertical-align: top;
padding: 0;
border-bottom: 1px solid $ui-03;
}

.#{$prefix}--data-table td.#{$prefix}--table-expand,
th.#{$prefix}--table-expand {
padding: 0 $spacing-05;
}

.#{$prefix}--data-table--tall td.#{$prefix}--table-expand,
.#{$prefix}--data-table--tall th.#{$prefix}--table-expand {
padding-top: rem(16px);
padding-bottom: rem(16px);
}

.#{$prefix}--data-table
td.#{$prefix}--table-expand[data-previous-value='collapsed'] {
border-bottom: 1px solid transparent;
Expand All @@ -179,15 +187,8 @@

.#{$prefix}--table-expand__button {
@include button-reset('false');
display: flex;
justify-content: space-around;
align-items: center;
height: 100%;
width: 100%;
}

.#{$prefix}--data-table--short .#{$prefix}--table-expand__button {
height: auto;
height: rem(16px);
vertical-align: inherit;
}

.#{$prefix}--table-expand__button:focus {
Expand All @@ -204,17 +205,6 @@
transition: transform $duration--moderate-01 motion(standard, productive);
}

th.#{$prefix}--table-expand {
position: relative;
vertical-align: middle;
padding-left: $spacing-05;
padding-right: $spacing-05;
}

th.#{$prefix}--table-expand + th.#{$prefix}--table-column-checkbox {
padding-left: $spacing-03;
}

// fix expanded parent separating border length
tr.#{$prefix}--parent-row.#{$prefix}--expandable-row
td.#{$prefix}--table-expand
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/DataTable/TableHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const TableHeader = React.forwardRef(function TableHeader(
scope={scope}
colSpan={colSpan}
ref={ref}>
<span className={`${prefix}--table-header-label`}>{children}</span>
<div className={`${prefix}--table-header-label`}>{children}</div>
</th>
);
}
Expand All @@ -92,7 +92,7 @@ const TableHeader = React.forwardRef(function TableHeader(
ref={ref}
scope={scope}>
<button className={className} onClick={onClick} {...rest}>
<span className={`${prefix}--table-header-label`}>{children}</span>
<div className={`${prefix}--table-header-label`}>{children}</div>
<Arrow
className={`${prefix}--table-sort__icon`}
aria-label={t('carbon.table.header.icon.description', {
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/components/DataTable/TableSelectRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const TableSelectRow = ({
const InlineInputComponent = radio ? RadioButton : InlineCheckbox;
const tableSelectRowClasses = classNames(`${prefix}--table-column-checkbox`, {
[className]: className,
[`${prefix}--table-column-radio`]: radio,
});
return (
<td className={tableSelectRowClasses}>
Expand Down
Loading

0 comments on commit b75639c

Please sign in to comment.