[ADF-4267] expose stiky heder in document list (#4455)

* expose stiky heder in document list

* lint fix
This commit is contained in:
Eugenio Romano
2019-03-19 16:41:28 +00:00
committed by GitHub
parent 7fe066b068
commit 5a7fe6f499
7 changed files with 24 additions and 3 deletions

View File

@@ -211,7 +211,8 @@
</mat-menu> </mat-menu>
</adf-toolbar> </adf-toolbar>
<adf-document-list <div [ngClass]="{'adf-sticky-document-list': stickyHeader }">
<adf-document-list
#documentList #documentList
class="adf-file-list-container" class="adf-file-list-container"
[permissionsStyle]="permissionsStyle" [permissionsStyle]="permissionsStyle"
@@ -228,6 +229,7 @@
[sortingMode]="sortingMode" [sortingMode]="sortingMode"
[showHeader]="showHeader" [showHeader]="showHeader"
[thumbnails]="thumbnails" [thumbnails]="thumbnails"
[stickyHeader]="stickyHeader"
(error)="onNavigationError($event)" (error)="onNavigationError($event)"
(success)="resetError()" (success)="resetError()"
(ready)="emitReadyEvent($event)" (ready)="emitReadyEvent($event)"
@@ -420,6 +422,7 @@
</content-action> </content-action>
</content-actions> </content-actions>
</adf-document-list> </adf-document-list>
</div>
<adf-pagination <adf-pagination
#standardPagination #standardPagination
*ngIf="!infiniteScrolling" *ngIf="!infiniteScrolling"
@@ -607,6 +610,12 @@
</mat-slide-toggle> </mat-slide-toggle>
</section> </section>
<section>
<mat-slide-toggle
color="primary" [(ngModel)]="stickyHeader" id="stickyHeader">
Sticky Header
</mat-slide-toggle>
</section>
<h5>Upload</h5> <h5>Upload</h5>
<section *ngIf="acceptedFilesTypeShow"> <section *ngIf="acceptedFilesTypeShow">

View File

@@ -189,6 +189,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
permissionsStyle: PermissionStyleModel[] = []; permissionsStyle: PermissionStyleModel[] = [];
infiniteScrolling: boolean; infiniteScrolling: boolean;
stickyHeader: boolean;
warnOnMultipleUploads = false; warnOnMultipleUploads = false;
thumbnails = false; thumbnails = false;
enableCustomPermissionMessage = false; enableCustomPermissionMessage = false;

View File

@@ -82,6 +82,7 @@ Displays the documents from a repository.
| where | `string` | | Filters the [`Node`](https://github.com/Alfresco/alfresco-js-api/blob/development/src/api/content-rest-api/docs/Node.md) list using the _where_ condition of the REST API (for example, isFolder=true). See the REST API documentation for more information. | | where | `string` | | Filters the [`Node`](https://github.com/Alfresco/alfresco-js-api/blob/development/src/api/content-rest-api/docs/Node.md) list using the _where_ condition of the REST API (for example, isFolder=true). See the REST API documentation for more information. |
| currentFolderId | | | The ID of the folder node to display or a reserved string alias for special sources | | currentFolderId | | | The ID of the folder node to display or a reserved string alias for special sources |
| rowFilter | | | Custom function to choose whether to show or hide rows. See the [Row Filter Model](../models/row-filter.model.md) page for more information. | | rowFilter | | | Custom function to choose whether to show or hide rows. See the [Row Filter Model](../models/row-filter.model.md) page for more information. |
| stickyHeader | `boolean` | false | Toggles the sticky header mode. |
### Events ### Events

View File

@@ -14,6 +14,7 @@
[noPermission]="noPermission" [noPermission]="noPermission"
[showHeader]="!isEmpty() && showHeader" [showHeader]="!isEmpty() && showHeader"
[rowMenuCacheEnabled]="false" [rowMenuCacheEnabled]="false"
[stickyHeader]="stickyHeader"
(showRowContextMenu)="onShowRowContextMenu($event)" (showRowContextMenu)="onShowRowContextMenu($event)"
(showRowActionsMenu)="onShowRowActionsMenu($event)" (showRowActionsMenu)="onShowRowActionsMenu($event)"
(executeRowAction)="onExecuteRowAction($event)" (executeRowAction)="onExecuteRowAction($event)"

View File

@@ -9,6 +9,11 @@
margin-top: 2px; margin-top: 2px;
} }
.adf-sticky-document-list {
height: 310px;
overflow-y: auto;
}
.adf-datatable-selected > svg { .adf-datatable-selected > svg {
fill: mat-color($accent); fill: mat-color($accent);
width: 32px; width: 32px;

View File

@@ -235,6 +235,10 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
@Input() @Input()
imageResolver: any | null = null; imageResolver: any | null = null;
/** Toggles the sticky header mode. */
@Input()
stickyHeader: boolean = false;
_currentFolderId: string = null; _currentFolderId: string = null;
/** The ID of the folder node to display or a reserved string alias for special sources */ /** The ID of the folder node to display or a reserved string alias for special sources */

View File

@@ -42,10 +42,10 @@ export class AboutComponent implements OnInit {
/** Commit corresponding to the version of ADF to be used. */ /** Commit corresponding to the version of ADF to be used. */
@Input() githubUrlCommitAlpha = 'https://github.com/Alfresco/alfresco-ng2-components/commits/'; @Input() githubUrlCommitAlpha = 'https://github.com/Alfresco/alfresco-ng2-components/commits/';
/** Toggles showing/hiding of extensions block. */ /** Toggles showing/hiding of extensions block. */
@Input() showExtensions = true; @Input() showExtensions = true;
/** Regular expression for filtering dependencies packages. */ /** Regular expression for filtering dependencies packages. */
@Input() regexp = '^(@alfresco)'; @Input() regexp = '^(@alfresco)';