mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
- readonly mode for “Dynamic Table” - “Display Value” now just uses “Dynamic Table” if needed (previously rendered the table itself) - support for “tableEditable” settings
68 lines
2.8 KiB
HTML
68 lines
2.8 KiB
HTML
<div class="dynamic-table-widget {{field.className}}"
|
|
[class.dynamic-table-widget__invalid]="!isValid()" *ngIf="field?.isVisible">
|
|
<div class="dynamic-table-widget__label">{{content.name}}</div>
|
|
|
|
<div *ngIf="!editMode">
|
|
<div class="dynamic-table-widget__table-container">
|
|
<table class="mdl-data-table mdl-js-data-table dynamic-table-widget__table">
|
|
<thead>
|
|
<tr>
|
|
<th *ngFor="let column of content.visibleColumns"
|
|
class="mdl-data-table__cell--non-numeric">
|
|
{{column.name}}
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr *ngFor="let row of content.rows"
|
|
[class.dynamic-table-widget__row-selected]="row.selected">
|
|
<td *ngFor="let column of content.visibleColumns"
|
|
class="mdl-data-table__cell--non-numeric"
|
|
(click)="onRowClicked(row)">
|
|
{{ getCellValue(row, column) }}
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="dynamic-table-widget__buttons" *ngIf="!readOnly">
|
|
<button class="mdl-button mdl-js-button mdl-button--icon"
|
|
[disabled]="!hasSelection()"
|
|
(click)="moveSelectionUp()">
|
|
<i class="material-icons">arrow_upward</i>
|
|
</button>
|
|
<button class="mdl-button mdl-js-button mdl-button--icon"
|
|
[disabled]="!hasSelection()"
|
|
(click)="moveSelectionDown()">
|
|
<i class="material-icons">arrow_downward</i>
|
|
</button>
|
|
<button class="mdl-button mdl-js-button mdl-button--icon"
|
|
(click)="addNewRow()">
|
|
<i class="material-icons">add_circle_outline</i>
|
|
</button>
|
|
<button class="mdl-button mdl-js-button mdl-button--icon"
|
|
[disabled]="!hasSelection()"
|
|
(click)="deleteSelection()">
|
|
<i class="material-icons">remove_circle_outline</i>
|
|
</button>
|
|
<button class="mdl-button mdl-js-button mdl-button--icon"
|
|
[disabled]="!hasSelection()"
|
|
(click)="editSelection()">
|
|
<i class="material-icons">edit</i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<row-editor *ngIf="editMode"
|
|
[table]="content"
|
|
[row]="editRow"
|
|
[column]="column"
|
|
(save)="onSaveChanges()"
|
|
(cancel)="onCancelChanges()">
|
|
</row-editor>
|
|
|
|
<div class="dynamic-table-widget__summary">{{content?.field.validationSummary}}</div>
|
|
|
|
</div>
|