Skip to content

Commit b841961

Browse files
fix(data-tables): Add column wrap support (#2921)
* fix(data-tables): Add column wrap support * Bump column support to 15 * Remove striped support
1 parent d6259b8 commit b841961

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

ui/components/data-tables/base/_index.scss

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,38 @@
421421
}
422422
}
423423

424+
$max-column-support: 15;
425+
426+
@for $i from 1 through $max-column-support {
427+
428+
.slds-table_column-#{$i}-wrap tbody tr > *:nth-child(#{$i}) .slds-truncate {
429+
overflow-wrap: break-word;
430+
word-wrap: break-word;
431+
hyphens: none;
432+
white-space: normal;
433+
}
434+
}
435+
436+
[class*="slds-table_column-"] tr td .slds-truncate {
437+
overflow: hidden;
438+
position: relative;
439+
max-height: 3.25rem;
440+
441+
&:after {
442+
content: '';
443+
position: absolute;
444+
top: 2.25rem;
445+
bottom: 0;
446+
right: 0;
447+
width: 50%;
448+
background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 69%);
449+
}
450+
}
451+
452+
[class*="slds-table_column-"] tr:hover td .slds-truncate:after {
453+
background: linear-gradient(to right, rgba(250, 250, 249, 0) 0%, rgba(250, 250, 249, 1) 69%);
454+
}
455+
424456
/**
425457
* Resizable data table columns
426458
*

ui/components/data-tables/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ export const AdvancedDataTable = props => (
3737
'slds-table slds-table_bordered slds-table_resizable-cols slds-table_fixed-layout',
3838
props.className,
3939
{
40-
'slds-table_edit': props.isEditable
40+
'slds-table_edit': props.isEditable,
41+
'slds-table_column-3-wrap': props.columnWrap
4142
}
4243
)}
4344
role="grid"

0 commit comments

Comments
 (0)