#254 UI improvements

- out-of-box ‘ellipsis-cell’ class for styling columns
- extended demo with long column text truncation
- table cell layout improvements
This commit is contained in:
Denys Vuika
2016-06-22 16:11:38 +01:00
parent d00ae6c046
commit 5c8d13284b
5 changed files with 40 additions and 14 deletions

View File

@@ -24,7 +24,7 @@
<content-column
title="{{'DOCUMENT_LIST.COLUMNS.DISPLAY_NAME' | translate}}"
source="name"
class="full-width name-column">
class="full-width ellipsis-cell">
</content-column>
<!--
<content-column

View File

@@ -62,7 +62,7 @@ import {
<content-column
title="{{'DOCUMENT_LIST.COLUMNS.DISPLAY_NAME' | translate}}"
source="name"
class="full-width name-column">
class="full-width ellipsis-cell">
</content-column>
<content-column
title="{{'DOCUMENT_LIST.COLUMNS.CREATED_BY' | translate}}"

View File

@@ -1,7 +1,7 @@
{
"name": "ng2-alfresco-documentlist",
"description": "Alfresco Angular2 Document List Component",
"version": "0.1.27",
"version": "0.1.28",
"author": "Alfresco Software, Ltd.",
"scripts": {
"clean": "rimraf dist node_modules typings",

View File

@@ -23,11 +23,6 @@
}
:host .cell-value {}
:host .data-cell.name-column {
font-size: 15px;
cursor: default;
}
/* Empty folder */
:host .empty-folder-content {
@@ -58,3 +53,34 @@
clip: rect(0,0,0,0);
border: 0;
}
:host .ellipsis-cell > div
{
position: relative;
overflow: hidden;
height: 1em;
}
/* visible content */
:host .ellipsis-cell > div > span
{
display: block;
position: absolute;
max-width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
line-height: 1em; /* for vertical align of text */
}
/* cell stretching content */
:host .ellipsis-cell > div:after
{
content: attr(title);
overflow: hidden;
height: 0;
display: block;
}

View File

@@ -31,12 +31,12 @@
<div *ngSwitchCase="'image'" class="cell-value">
<img class="thumbnail" [src]="getCellValue(content, col)">
</div>
<span *ngSwitchCase="'date'" class="cell-value">
{{ getCellValue(content, col) }}
</span>
<span *ngSwitchDefault class="cell-value">
{{ getCellValue(content, col) }}
</span>
<div *ngSwitchCase="'date'" class="cell-value">
<span>{{ getCellValue(content, col) }}</span>
</div>
<div *ngSwitchDefault class="cell-value">
<span>{{ getCellValue(content, col) }}</span>
</div>
</td>
<!-- Actions: folder -->