(core) Prevent raw table names from overflowing

Summary:
Modifies CSS so that text overflow is handled by displaying an
ellipsis when raw table names exceed the width of their container.

Test Plan: Tested manually.

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D3524
This commit is contained in:
George Gevoian
2022-07-18 09:24:26 -07:00
parent 3e49fe9a50
commit 5c0a250309
3 changed files with 11 additions and 9 deletions

View File

@@ -63,7 +63,7 @@ export class DataTables extends Disposable {
)),
),
cssMiddle(
css60(this._tableTitle(tableRec), testId('table-title')),
css60(cssTableTitle(this._tableTitle(tableRec), testId('table-title'))),
css40(
cssIdHoverWrapper(
cssUpperCase("Table id: "),
@@ -120,10 +120,7 @@ export class DataTables extends Disposable {
} else {
return dom('div', // to disable flex grow in the widget
dom.domComputed(fromKo(table.rawViewSection), vs =>
dom.update(
buildTableName(vs, testId('widget-title')),
dom.on('click', (ev) => { ev.stopPropagation(); ev.preventDefault(); }),
)
buildTableName(vs, testId('widget-title'))
)
);
}
@@ -242,14 +239,14 @@ const cssMiddle = styled('div', `
margin-top: 6px;
margin-bottom: 4px;
.${cssList.className}-card & {
margin: 0px:
margin: 0px;
}
`);
const css60 = styled('div', `
min-width: min(240px, 100%);
display: flex;
flex: 6;
margin-right: 4px;
`);
const css40 = styled('div', `
@@ -301,6 +298,10 @@ const cssTableId = styled(cssLine, `
font-size: ${css.vars.smallFontSize};
`);
const cssTableTitle = styled('div', `
white-space: nowrap;
`);
const cssUpperCase = styled('span', `
text-transform: uppercase;
letter-spacing: 0.81px;