[ADF-5153] Transclusion exposed from the DataTable to the DocumentList (#5743)

* [ADF-5153] Transclusion exposed from the DataTable to the DocumentList

* [ADF-5153] Add flags to control transclusion

* [ADF-5153] Remove Ngif breaking the transclusion
This commit is contained in:
Baptiste Mahé
2020-06-02 16:31:56 +02:00
committed by GitHub
parent 6b06fd6364
commit 439e3c7a7c
4 changed files with 16 additions and 0 deletions

View File

@@ -14,6 +14,7 @@
[showHeader]="!isEmpty() && showHeader" [showHeader]="!isEmpty() && showHeader"
[rowMenuCacheEnabled]="false" [rowMenuCacheEnabled]="false"
[stickyHeader]="stickyHeader" [stickyHeader]="stickyHeader"
[allowFiltering]="allowFiltering"
(showRowContextMenu)="onShowRowContextMenu($event)" (showRowContextMenu)="onShowRowContextMenu($event)"
(showRowActionsMenu)="onShowRowActionsMenu($event)" (showRowActionsMenu)="onShowRowActionsMenu($event)"
(executeRowAction)="onExecuteRowAction($event)" (executeRowAction)="onExecuteRowAction($event)"
@@ -23,6 +24,10 @@
(row-unselect)="onNodeUnselect($event.detail)" (row-unselect)="onNodeUnselect($event.detail)"
[class.adf-datatable-gallery-thumbnails]="data.thumbnails"> [class.adf-datatable-gallery-thumbnails]="data.thumbnails">
<ng-template let-col>
<!-- [ACA-3206] TODO : Implement search/filter widget HERE -->
</ng-template>
<adf-no-content-template> <adf-no-content-template>
<ng-template> <ng-template>
<adf-empty-list *ngIf="!customNoContentTemplate"> <adf-empty-list *ngIf="!customNoContentTemplate">

View File

@@ -308,6 +308,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
noPermission: boolean = false; noPermission: boolean = false;
selection = new Array<NodeEntry>(); selection = new Array<NodeEntry>();
$folderNode: Subject<Node> = new Subject<Node>(); $folderNode: Subject<Node> = new Subject<Node>();
allowFiltering: boolean = true;
// @deprecated 3.0.0 // @deprecated 3.0.0
folderNode: Node; folderNode: Node;

View File

@@ -34,6 +34,7 @@
adf-drop-zone dropTarget="header" [dropColumn]="col"> adf-drop-zone dropTarget="header" [dropColumn]="col">
<span *ngIf="col.title" class="adf-datatable-cell-value">{{ col.title | translate}}</span> <span *ngIf="col.title" class="adf-datatable-cell-value">{{ col.title | translate}}</span>
<span *ngIf="col.title && col.sortable" class="adf-sr-only" aria-live="polite">{{ getSortLiveAnnouncement(col) | translate: { string: col.title | translate } }}</span> <span *ngIf="col.title && col.sortable" class="adf-sr-only" aria-live="polite">{{ getSortLiveAnnouncement(col) | translate: { string: col.title | translate } }}</span>
<ng-template *ngIf="allowFiltering" [ngTemplateOutlet]="filterTemplateRef" [ngTemplateOutletContext]="{$implicit: col}"></ng-template>
</div> </div>
<!-- Actions (right) --> <!-- Actions (right) -->
<div *ngIf="actions && actionsPosition === 'right'" class="adf-actions-column adf-datatable-cell-header adf-datatable__actions-cell"> <div *ngIf="actions && actionsPosition === 'right'" class="adf-actions-column adf-datatable-cell-header adf-datatable__actions-cell">

View File

@@ -169,6 +169,15 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck,
@Input() @Input()
resolverFn: (row: DataRow, col: DataColumn) => any = null; resolverFn: (row: DataRow, col: DataColumn) => any = null;
/**
* Flag that indicate if the datatable allow the use facet widget search for filtering.
*/
@Input()
allowFiltering: boolean = false;
@ContentChild(TemplateRef)
filterTemplateRef: TemplateRef<any>;
noContentTemplate: TemplateRef<any>; noContentTemplate: TemplateRef<any>;
noPermissionTemplate: TemplateRef<any>; noPermissionTemplate: TemplateRef<any>;
loadingTemplate: TemplateRef<any>; loadingTemplate: TemplateRef<any>;