mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
[ADF-2765] Fix for the gallery view in datatable component (#3470)
* [ADF-2765] Fix for the gallery view in datatable component * [ADF-2765] Fixed lint errors * [ADF-2765] Changed maximum columns per row number * [ADF-2765] Removed trailing whitespace
This commit is contained in:
committed by
Eugenio Romano
parent
23403076a9
commit
edf82d9c05
@@ -42,7 +42,6 @@
|
|||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="adf-datatable-body">
|
<div class="adf-datatable-body">
|
||||||
@@ -191,6 +190,9 @@
|
|||||||
<ng-content select="adf-empty-list"></ng-content>
|
<ng-content select="adf-empty-list"></ng-content>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div *ngFor="let row of fakeRows"
|
||||||
|
class="adf-datatable-row adf-datatable-row-empty-card">
|
||||||
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<div *ngIf="!loading && noPermission"
|
<div *ngIf="!loading && noPermission"
|
||||||
[class.adf-datatable-row]="display === 'list'"
|
[class.adf-datatable-row]="display === 'list'"
|
||||||
|
@@ -29,13 +29,10 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
flex-direction: row;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
&:after {
|
justify-content: space-evenly;
|
||||||
content: "";
|
align-content: flex-start;
|
||||||
flex: auto;
|
align-items: flex-start;
|
||||||
}
|
|
||||||
|
|
||||||
.adf-datatable-row {
|
.adf-datatable-row {
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
@@ -58,6 +55,14 @@
|
|||||||
@include mat-overridable-elevation(2);
|
@include mat-overridable-elevation(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.adf-datatable-row-empty-card {
|
||||||
|
height: 0 !important;
|
||||||
|
padding-top: 0;
|
||||||
|
padding-bottom: 0;
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.is-selected {
|
.is-selected {
|
||||||
background: mat-color($primary, 100);
|
background: mat-color($primary, 100);
|
||||||
padding-bottom: 31px;
|
padding-bottom: 31px;
|
||||||
|
@@ -161,6 +161,9 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck,
|
|||||||
isSelectAllChecked: boolean = false;
|
isSelectAllChecked: boolean = false;
|
||||||
selection = new Array<DataRow>();
|
selection = new Array<DataRow>();
|
||||||
|
|
||||||
|
/** This array of fake rows fix the flex layout for the gallery view */
|
||||||
|
fakeRows = [];
|
||||||
|
|
||||||
private clickObserver: Observer<DataRowEvent>;
|
private clickObserver: Observer<DataRowEvent>;
|
||||||
private click$: Observable<DataRowEvent>;
|
private click$: Observable<DataRowEvent>;
|
||||||
|
|
||||||
@@ -188,6 +191,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck,
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
this.datatableLayoutFix();
|
||||||
this.setTableSchema();
|
this.setTableSchema();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,6 +224,10 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck,
|
|||||||
if (this.isPropertyChanged(changes['sorting'])) {
|
if (this.isPropertyChanged(changes['sorting'])) {
|
||||||
this.setTableSorting(changes['sorting'].currentValue);
|
this.setTableSorting(changes['sorting'].currentValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.isPropertyChanged(changes['display'])) {
|
||||||
|
this.datatableLayoutFix();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ngDoCheck() {
|
ngDoCheck() {
|
||||||
@@ -654,4 +662,16 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck,
|
|||||||
this.dataRowsChanged = null;
|
this.dataRowsChanged = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
datatableLayoutFix() {
|
||||||
|
const maxGalleryRows = 25;
|
||||||
|
|
||||||
|
if (this.display === 'gallery') {
|
||||||
|
for (let i = 0; i < maxGalleryRows; i++) {
|
||||||
|
this.fakeRows.push('');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.fakeRows = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user