blob: 4927c3363c23a1c3cc2ccf4b95f12ae5a2025fb4 [file] [log] [blame]
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("@angular/core"),require("@angular/material/core"),require("@angular/material/button"),require("@angular/material/select"),require("@angular/material/tooltip"),require("@angular/cdk/coercion"),require("rxjs")):"function"==typeof define&&define.amd?define("@angular/material/paginator",["exports","@angular/common","@angular/core","@angular/material/core","@angular/material/button","@angular/material/select","@angular/material/tooltip","@angular/cdk/coercion","rxjs"],t):t(((e=e||self).ng=e.ng||{},e.ng.material=e.ng.material||{},e.ng.material.paginator={}),e.ng.common,e.ng.core,e.ng.material.core,e.ng.material.button,e.ng.material.select,e.ng.material.tooltip,e.ng.cdk.coercion,e.rxjs)}(this,(function(e,t,a,n,i,o,r,s,p){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var l,g=function(e,t){return(g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])})(e,t)};function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function a(){this.constructor=e}g(e,t),e.prototype=null===t?Object.create(t):(a.prototype=t.prototype,new a)}function c(e){return e||new l}(l=function l(){this.changes=new p.Subject,this.itemsPerPageLabel="Items per page:",this.nextPageLabel="Next page",this.previousPageLabel="Previous page",this.firstPageLabel="First page",this.lastPageLabel="Last page",this.getRangeLabel=function(e,t,a){if(0==a||0==t)return"0 of "+a;var n=e*t;return n+1+" – "+(n<(a=Math.max(a,0))?Math.min(n+t,a):n+t)+" of "+a}}).ɵprov=a.ɵɵdefineInjectable({factory:function e(){return new l},token:l,providedIn:"root"}),l.decorators=[{type:a.Injectable,args:[{providedIn:"root"}]}];var d={provide:l,deps:[[new a.Optional,new a.SkipSelf,l]],useFactory:c},h=function h(){},m=new a.InjectionToken("MAT_PAGINATOR_DEFAULT_OPTIONS"),f=function(e){function t(t,n,i){var o=e.call(this)||this;if(o._intl=t,o._changeDetectorRef=n,o._pageIndex=0,o._length=0,o._pageSizeOptions=[],o._hidePageSize=!1,o._showFirstLastButtons=!1,o.page=new a.EventEmitter,o._intlChanges=t.changes.subscribe((function(){return o._changeDetectorRef.markForCheck()})),i){var r=i.pageSize,s=i.pageSizeOptions,p=i.hidePageSize,l=i.showFirstLastButtons;null!=r&&(o._pageSize=r),null!=s&&(o._pageSizeOptions=s),null!=p&&(o._hidePageSize=p),null!=l&&(o._showFirstLastButtons=l)}return o}return u(t,e),Object.defineProperty(t.prototype,"pageIndex",{get:function(){return this._pageIndex},set:function(e){this._pageIndex=Math.max(s.coerceNumberProperty(e),0),this._changeDetectorRef.markForCheck()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this._length},set:function(e){this._length=s.coerceNumberProperty(e),this._changeDetectorRef.markForCheck()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageSize",{get:function(){return this._pageSize},set:function(e){this._pageSize=Math.max(s.coerceNumberProperty(e),0),this._updateDisplayedPageSizeOptions()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageSizeOptions",{get:function(){return this._pageSizeOptions},set:function(e){this._pageSizeOptions=(e||[]).map((function(e){return s.coerceNumberProperty(e)})),this._updateDisplayedPageSizeOptions()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hidePageSize",{get:function(){return this._hidePageSize},set:function(e){this._hidePageSize=s.coerceBooleanProperty(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"showFirstLastButtons",{get:function(){return this._showFirstLastButtons},set:function(e){this._showFirstLastButtons=s.coerceBooleanProperty(e)},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){this._initialized=!0,this._updateDisplayedPageSizeOptions(),this._markInitialized()},t.prototype.ngOnDestroy=function(){this._intlChanges.unsubscribe()},t.prototype.nextPage=function(){if(this.hasNextPage()){var e=this.pageIndex;this.pageIndex++,this._emitPageEvent(e)}},t.prototype.previousPage=function(){if(this.hasPreviousPage()){var e=this.pageIndex;this.pageIndex--,this._emitPageEvent(e)}},t.prototype.firstPage=function(){if(this.hasPreviousPage()){var e=this.pageIndex;this.pageIndex=0,this._emitPageEvent(e)}},t.prototype.lastPage=function(){if(this.hasNextPage()){var e=this.pageIndex;this.pageIndex=this.getNumberOfPages()-1,this._emitPageEvent(e)}},t.prototype.hasPreviousPage=function(){return this.pageIndex>=1&&0!=this.pageSize},t.prototype.hasNextPage=function(){var e=this.getNumberOfPages()-1;return this.pageIndex<e&&0!=this.pageSize},t.prototype.getNumberOfPages=function(){return this.pageSize?Math.ceil(this.length/this.pageSize):0},t.prototype._changePageSize=function(e){var t=this.pageIndex;this.pageIndex=Math.floor(this.pageIndex*this.pageSize/e)||0,this.pageSize=e,this._emitPageEvent(t)},t.prototype._nextButtonsDisabled=function(){return this.disabled||!this.hasNextPage()},t.prototype._previousButtonsDisabled=function(){return this.disabled||!this.hasPreviousPage()},t.prototype._updateDisplayedPageSizeOptions=function(){this._initialized&&(this.pageSize||(this._pageSize=0!=this.pageSizeOptions.length?this.pageSizeOptions[0]:50),this._displayedPageSizeOptions=this.pageSizeOptions.slice(),-1===this._displayedPageSizeOptions.indexOf(this.pageSize)&&this._displayedPageSizeOptions.push(this.pageSize),this._displayedPageSizeOptions.sort((function(e,t){return e-t})),this._changeDetectorRef.markForCheck())},t.prototype._emitPageEvent=function(e){this.page.emit({previousPageIndex:e,pageIndex:this.pageIndex,pageSize:this.pageSize,length:this.length})},t}(n.mixinDisabled(n.mixinInitialized((function b(){}))));f.decorators=[{type:a.Directive}],f.ctorParameters=function(){return[{type:l},{type:a.ChangeDetectorRef},{type:void 0}]},f.propDecorators={color:[{type:a.Input}],pageIndex:[{type:a.Input}],length:[{type:a.Input}],pageSize:[{type:a.Input}],pageSizeOptions:[{type:a.Input}],hidePageSize:[{type:a.Input}],showFirstLastButtons:[{type:a.Input}],page:[{type:a.Output}]};var P,_=function(e){function t(t,a,n){var i=e.call(this,t,a,n)||this;return n&&null!=n.formFieldAppearance&&(i._formFieldAppearance=n.formFieldAppearance),i}return u(t,e),t}(f);_.decorators=[{type:a.Component,args:[{selector:"mat-paginator",exportAs:"matPaginator",template:'<div class="mat-paginator-outer-container">\n <div class="mat-paginator-container">\n <div class="mat-paginator-page-size" *ngIf="!hidePageSize">\n <div class="mat-paginator-page-size-label">\n {{_intl.itemsPerPageLabel}}\n </div>\n\n <mat-form-field\n *ngIf="_displayedPageSizeOptions.length > 1"\n [appearance]="_formFieldAppearance!"\n [color]="color"\n class="mat-paginator-page-size-select">\n <mat-select\n [value]="pageSize"\n [disabled]="disabled"\n [aria-label]="_intl.itemsPerPageLabel"\n (selectionChange)="_changePageSize($event.value)">\n <mat-option *ngFor="let pageSizeOption of _displayedPageSizeOptions" [value]="pageSizeOption">\n {{pageSizeOption}}\n </mat-option>\n </mat-select>\n </mat-form-field>\n\n <div\n class="mat-paginator-page-size-value"\n *ngIf="_displayedPageSizeOptions.length <= 1">{{pageSize}}</div>\n </div>\n\n <div class="mat-paginator-range-actions">\n <div class="mat-paginator-range-label">\n {{_intl.getRangeLabel(pageIndex, pageSize, length)}}\n </div>\n\n <button mat-icon-button type="button"\n class="mat-paginator-navigation-first"\n (click)="firstPage()"\n [attr.aria-label]="_intl.firstPageLabel"\n [matTooltip]="_intl.firstPageLabel"\n [matTooltipDisabled]="_previousButtonsDisabled()"\n [matTooltipPosition]="\'above\'"\n [disabled]="_previousButtonsDisabled()"\n *ngIf="showFirstLastButtons">\n <svg class="mat-paginator-icon" viewBox="0 0 24 24" focusable="false">\n <path d="M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"/>\n </svg>\n </button>\n <button mat-icon-button type="button"\n class="mat-paginator-navigation-previous"\n (click)="previousPage()"\n [attr.aria-label]="_intl.previousPageLabel"\n [matTooltip]="_intl.previousPageLabel"\n [matTooltipDisabled]="_previousButtonsDisabled()"\n [matTooltipPosition]="\'above\'"\n [disabled]="_previousButtonsDisabled()">\n <svg class="mat-paginator-icon" viewBox="0 0 24 24" focusable="false">\n <path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/>\n </svg>\n </button>\n <button mat-icon-button type="button"\n class="mat-paginator-navigation-next"\n (click)="nextPage()"\n [attr.aria-label]="_intl.nextPageLabel"\n [matTooltip]="_intl.nextPageLabel"\n [matTooltipDisabled]="_nextButtonsDisabled()"\n [matTooltipPosition]="\'above\'"\n [disabled]="_nextButtonsDisabled()">\n <svg class="mat-paginator-icon" viewBox="0 0 24 24" focusable="false">\n <path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/>\n </svg>\n </button>\n <button mat-icon-button type="button"\n class="mat-paginator-navigation-last"\n (click)="lastPage()"\n [attr.aria-label]="_intl.lastPageLabel"\n [matTooltip]="_intl.lastPageLabel"\n [matTooltipDisabled]="_nextButtonsDisabled()"\n [matTooltipPosition]="\'above\'"\n [disabled]="_nextButtonsDisabled()"\n *ngIf="showFirstLastButtons">\n <svg class="mat-paginator-icon" viewBox="0 0 24 24" focusable="false">\n <path d="M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"/>\n </svg>\n </button>\n </div>\n </div>\n</div>\n',inputs:["disabled"],host:{class:"mat-paginator",role:"group"},changeDetection:a.ChangeDetectionStrategy.OnPush,encapsulation:a.ViewEncapsulation.None,styles:[".mat-paginator{display:block}.mat-paginator-outer-container{display:flex}.mat-paginator-container{display:flex;align-items:center;justify-content:flex-end;padding:0 8px;flex-wrap:wrap-reverse;width:100%}.mat-paginator-page-size{display:flex;align-items:baseline;margin-right:8px}[dir=rtl] .mat-paginator-page-size{margin-right:0;margin-left:8px}.mat-paginator-page-size-label{margin:0 4px}.mat-paginator-page-size-select{margin:6px 4px 0 4px;width:56px}.mat-paginator-page-size-select.mat-form-field-appearance-outline{width:64px}.mat-paginator-page-size-select.mat-form-field-appearance-fill{width:64px}.mat-paginator-range-label{margin:0 32px 0 24px}.mat-paginator-range-actions{display:flex;align-items:center}.mat-paginator-icon{width:28px;fill:currentColor}[dir=rtl] .mat-paginator-icon{transform:rotate(180deg)}\n"]}]}],_.ctorParameters=function(){return[{type:l},{type:a.ChangeDetectorRef},{type:void 0,decorators:[{type:a.Optional},{type:a.Inject,args:[m]}]}]},(P=function P(){}).decorators=[{type:a.NgModule,args:[{imports:[t.CommonModule,i.MatButtonModule,o.MatSelectModule,r.MatTooltipModule,n.MatCommonModule],exports:[_],declarations:[_],providers:[d]}]}],
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
e.MAT_PAGINATOR_DEFAULT_OPTIONS=m,e.MAT_PAGINATOR_INTL_PROVIDER=d,e.MAT_PAGINATOR_INTL_PROVIDER_FACTORY=c,e.MatPaginator=_,e.MatPaginatorIntl=l,e.MatPaginatorModule=P,e.PageEvent=h,e._MatPaginatorBase=f,Object.defineProperty(e,"__esModule",{value:!0})}));