mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
icon type for columns (#1902)
- new 'icon' type for columns to render internal icons - enable attachment list in the demo shell
This commit is contained in:
committed by
Eugenio Romano
parent
0f66ce3472
commit
5b4aad5d91
@@ -65,8 +65,14 @@
|
||||
<i *ngIf="isIconValue(row, col)" class="material-icons icon-cell">{{asIconValue(row, col)}}</i>
|
||||
<img *ngIf="!isIconValue(row, col)"
|
||||
class="image-cell"
|
||||
alt="{{iconAltTextKey(data.getValue(row, col))|translate}}"
|
||||
src="{{data.getValue(row, col)}}"
|
||||
alt="{{ iconAltTextKey(data.getValue(row, col)) | translate }}"
|
||||
src="{{ data.getValue(row, col) }}"
|
||||
(error)="onImageLoadingError($event)">
|
||||
</div>
|
||||
<div *ngSwitchCase="'icon'" class="cell-value">
|
||||
<img class="image-cell"
|
||||
alt="{{ iconAltTextKey(data.getValue(row, col)) | translate }}"
|
||||
src="{{ data.getValue(row, col) }}"
|
||||
(error)="onImageLoadingError($event)">
|
||||
</div>
|
||||
<div *ngSwitchCase="'date'" class="cell-value" [attr.data-automation-id]="'date_' + data.getValue(row, col)">
|
||||
|
@@ -25,6 +25,33 @@ export class ObjectDataTableAdapter implements DataTableAdapter {
|
||||
private _sorting: DataSorting;
|
||||
private _rows: DataRow[];
|
||||
private _columns: DataColumn[];
|
||||
private icons: string[] = [
|
||||
'empty_doc_lib.svg',
|
||||
'ft_ic_archive.svg',
|
||||
'ft_ic_audio.svg',
|
||||
'ft_ic_database.svg',
|
||||
'ft_ic_document.svg',
|
||||
'ft_ic_ebook.svg',
|
||||
'ft_ic_folder.svg',
|
||||
'ft_ic_folder_empty.svg',
|
||||
'ft_ic_form.svg',
|
||||
'ft_ic_google_docs.svg',
|
||||
'ft_ic_google_drawings.svg',
|
||||
'ft_ic_google_forms.svg',
|
||||
'ft_ic_google_sheets.svg',
|
||||
'ft_ic_google_slides.svg',
|
||||
'ft_ic_miscellaneous.svg',
|
||||
'ft_ic_ms_excel.svg',
|
||||
'ft_ic_ms_powerpoint.svg',
|
||||
'ft_ic_ms_word.svg',
|
||||
'ft_ic_pdf.svg',
|
||||
'ft_ic_presentation.svg',
|
||||
'ft_ic_raster_image.svg',
|
||||
'ft_ic_spreadsheet.svg',
|
||||
'ft_ic_vector_image.svg',
|
||||
'ft_ic_video.svg',
|
||||
'ft_ic_website.svg'
|
||||
];
|
||||
|
||||
selectedRow: DataRow;
|
||||
|
||||
@@ -111,16 +138,12 @@ export class ObjectDataTableAdapter implements DataTableAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
if (col.type === 'image') {
|
||||
|
||||
if (col.key === 'icon') {
|
||||
|
||||
let icon = this.getImagePath(row.getValue('icon'));
|
||||
if (icon) {
|
||||
return icon;
|
||||
}
|
||||
return this.getImagePath('ft_ic_miscellaneous.svg');
|
||||
if (col.type === 'icon') {
|
||||
const iconName = row.getValue(col.key);
|
||||
if (this.icons.indexOf(iconName) > -1) {
|
||||
return this.getImagePath(iconName);
|
||||
}
|
||||
return this.getImagePath('ft_ic_miscellaneous.svg');
|
||||
}
|
||||
|
||||
return value;
|
||||
|
Reference in New Issue
Block a user