ecabs-components 1.0.89 → 1.0.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, Input, NgModule, HostBinding, EventEmitter, Output, Injectable, Directive, HostListener, ViewChild, ContentChild, Inject, Pipe } from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy, Input, NgModule, HostBinding, EventEmitter, Output, Injectable, Directive, HostListener, ViewChild, ContentChild, Inject, Host, Self, Optional, Pipe } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule, DecimalPipe } from '@angular/common';
5
5
  import * as i6 from '@angular/material/button';
@@ -48,6 +48,7 @@ import * as i2$1 from '@angular/material/progress-bar';
48
48
  import { MatProgressBarModule } from '@angular/material/progress-bar';
49
49
  import * as i1$2 from '@angular/material/dialog';
50
50
  import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
51
+ import * as i1$3 from '@angular/material/paginator';
51
52
  import { map as map$1 } from 'rxjs/operators';
52
53
  import * as i3$3 from '@angular/platform-browser';
53
54
  import { MatSidenavModule } from '@angular/material/sidenav';
@@ -522,16 +523,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
522
523
  type: Input
523
524
  }] } });
524
525
 
525
- class HintComponent {
526
+ class EcabsHintComponent {
526
527
  element;
527
528
  maxValue;
528
529
  showHint = false;
529
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: HintComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
530
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: HintComponent, selector: "app-hint", inputs: { element: "element", maxValue: "maxValue", showHint: "showHint" }, ngImport: i0, template: "<div class=\"hint\" *ngIf=\"element && showHint\">{{ element?.value?.length || 0 }}/{{ this.maxValue }}</div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
530
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EcabsHintComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
531
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: EcabsHintComponent, selector: "ecabs-hint", inputs: { element: "element", maxValue: "maxValue", showHint: "showHint" }, ngImport: i0, template: "<div class=\"hint\" *ngIf=\"element && showHint\">{{ element?.value?.length || 0 }}/{{ this.maxValue }}</div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
531
532
  }
532
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: HintComponent, decorators: [{
533
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EcabsHintComponent, decorators: [{
533
534
  type: Component,
534
- args: [{ selector: 'app-hint', template: "<div class=\"hint\" *ngIf=\"element && showHint\">{{ element?.value?.length || 0 }}/{{ this.maxValue }}</div>\r\n" }]
535
+ args: [{ selector: 'ecabs-hint', template: "<div class=\"hint\" *ngIf=\"element && showHint\">{{ element?.value?.length || 0 }}/{{ this.maxValue }}</div>\r\n" }]
535
536
  }], propDecorators: { element: [{
536
537
  type: Input
537
538
  }], maxValue: [{
@@ -563,11 +564,11 @@ class ElementWrapperComponent {
563
564
  this.decrease.emit();
564
565
  }
565
566
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ElementWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
566
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ElementWrapperComponent, selector: "app-element-wrapper", inputs: { data: "data", showCloseIcon: "showCloseIcon", focusedFlag: "focusedFlag", showPassword: "showPassword", control: "control" }, outputs: { showHidePassword: "showHidePassword", clear: "clear", increase: "increase", decrease: "decrease" }, ngImport: i0, template: "<div\r\n class=\"form-field\"\r\n [ngClass]=\"{\r\n 'form-field--invalid':\r\n data?.showValidation && (data?.control?.touched || data?.showValidationOnNotTouched) && data?.control?.invalid,\r\n disabled: data?.disabled,\r\n 'form-field--required': data?.required && data?.showAsterisk\r\n }\"\r\n>\r\n <div class=\"flex\">\r\n <label \r\n class=\"form-field__label\" \r\n [attr.for]=\"data?.name\" *ngIf=\"data?.label && data?.showLabel\"\r\n >\r\n <span [innerHTML]=\"data?.label\"></span>\r\n </label>\r\n <mat-icon class=\"icon ml-4 mat-icon-input-tooltip\" matTooltipClass=\"break-line-tooltip\" *ngIf=\"data?.tooltip\" [matTooltip]=\"data?.tooltip\">error_outline</mat-icon>\r\n </div>\r\n\r\n <div class=\"form-field__label-note\" *ngIf=\"data?.labelNote\" [innerHTML]=\"data?.labelNote\"></div>\r\n\r\n <ng-content></ng-content>\r\n\r\n <ecabs-loading-spinner class=\"spinner\" size=\"tiny\" *ngIf=\"data.loading\"></ecabs-loading-spinner>\r\n\r\n <app-hint [element]=\"data?.control\" [showHint]=\"data?.showHint\" [maxValue]=\"data?.maxLength\"></app-hint>\r\n\r\n <ecabs-validations-messages\r\n *ngIf=\"data?.showValidation && !data?.hideValidationMessage\"\r\n [element]=\"data?.control\"\r\n [label]=\"data?.label ? data?.label : data?.placeholder ? data.placeholder : data?.validationLabel\"\r\n [showValidationOnNotTouched]=\"data?.showValidationOnNotTouched\"\r\n >\r\n </ecabs-validations-messages>\r\n</div>\r\n", styles: [":host ::ng-deep .break-line-tooltip{white-space:pre-line}:host ::ng-deep .mat-icon-input-tooltip{font-size:18px;height:18px;width:18px}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: EcabsSpinnerComponent, selector: "ecabs-loading-spinner", inputs: ["size"] }, { kind: "component", type: ValidationComponent, selector: "ecabs-validations-messages", inputs: ["element", "label", "showValidationOnNotTouched", "updatedErrors"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i5$1.MatLegacyTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: HintComponent, selector: "app-hint", inputs: ["element", "maxValue", "showHint"] }] });
567
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ElementWrapperComponent, selector: "app-element-wrapper", inputs: { data: "data", showCloseIcon: "showCloseIcon", focusedFlag: "focusedFlag", showPassword: "showPassword", control: "control" }, outputs: { showHidePassword: "showHidePassword", clear: "clear", increase: "increase", decrease: "decrease" }, ngImport: i0, template: "<div\r\n class=\"form-field\"\r\n [ngClass]=\"{\r\n 'form-field--invalid':\r\n data?.showValidation && (data?.control?.touched || data?.showValidationOnNotTouched) && data?.control?.invalid,\r\n disabled: data?.disabled,\r\n 'form-field--required': data?.required && data?.showAsterisk\r\n }\"\r\n>\r\n <div class=\"flex\">\r\n <label\r\n class=\"form-field__label\"\r\n [attr.for]=\"data?.name\" *ngIf=\"data?.label && data?.showLabel\"\r\n >\r\n <span [innerHTML]=\"data?.label\"></span>\r\n </label>\r\n <mat-icon class=\"icon ml-4 mat-icon-input-tooltip\" matTooltipClass=\"break-line-tooltip\" *ngIf=\"data?.tooltip\"\r\n [matTooltip]=\"data?.tooltip\">error_outline\r\n </mat-icon>\r\n </div>\r\n\r\n <div class=\"form-field__label-note\" *ngIf=\"data?.labelNote\" [innerHTML]=\"data?.labelNote\"></div>\r\n\r\n <ng-content></ng-content>\r\n\r\n <ecabs-loading-spinner class=\"spinner\" size=\"tiny\" *ngIf=\"data.loading\"></ecabs-loading-spinner>\r\n\r\n <ecabs-hint [element]=\"data?.control\" [showHint]=\"data?.showHint\" [maxValue]=\"data?.maxLength\"></ecabs-hint>\r\n\r\n <ecabs-validations-messages\r\n *ngIf=\"data?.showValidation && !data?.hideValidationMessage\"\r\n [element]=\"data?.control\"\r\n [label]=\"data?.label ? data?.label : data?.placeholder ? data.placeholder : data?.validationLabel\"\r\n [showValidationOnNotTouched]=\"data?.showValidationOnNotTouched\"\r\n >\r\n </ecabs-validations-messages>\r\n</div>\r\n", styles: [":host ::ng-deep .break-line-tooltip{white-space:pre-line}:host ::ng-deep .mat-icon-input-tooltip{font-size:18px;height:18px;width:18px}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: EcabsSpinnerComponent, selector: "ecabs-loading-spinner", inputs: ["size"] }, { kind: "component", type: ValidationComponent, selector: "ecabs-validations-messages", inputs: ["element", "label", "showValidationOnNotTouched", "updatedErrors"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i5$1.MatLegacyTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: EcabsHintComponent, selector: "ecabs-hint", inputs: ["element", "maxValue", "showHint"] }] });
567
568
  }
568
569
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ElementWrapperComponent, decorators: [{
569
570
  type: Component,
570
- args: [{ selector: 'app-element-wrapper', template: "<div\r\n class=\"form-field\"\r\n [ngClass]=\"{\r\n 'form-field--invalid':\r\n data?.showValidation && (data?.control?.touched || data?.showValidationOnNotTouched) && data?.control?.invalid,\r\n disabled: data?.disabled,\r\n 'form-field--required': data?.required && data?.showAsterisk\r\n }\"\r\n>\r\n <div class=\"flex\">\r\n <label \r\n class=\"form-field__label\" \r\n [attr.for]=\"data?.name\" *ngIf=\"data?.label && data?.showLabel\"\r\n >\r\n <span [innerHTML]=\"data?.label\"></span>\r\n </label>\r\n <mat-icon class=\"icon ml-4 mat-icon-input-tooltip\" matTooltipClass=\"break-line-tooltip\" *ngIf=\"data?.tooltip\" [matTooltip]=\"data?.tooltip\">error_outline</mat-icon>\r\n </div>\r\n\r\n <div class=\"form-field__label-note\" *ngIf=\"data?.labelNote\" [innerHTML]=\"data?.labelNote\"></div>\r\n\r\n <ng-content></ng-content>\r\n\r\n <ecabs-loading-spinner class=\"spinner\" size=\"tiny\" *ngIf=\"data.loading\"></ecabs-loading-spinner>\r\n\r\n <app-hint [element]=\"data?.control\" [showHint]=\"data?.showHint\" [maxValue]=\"data?.maxLength\"></app-hint>\r\n\r\n <ecabs-validations-messages\r\n *ngIf=\"data?.showValidation && !data?.hideValidationMessage\"\r\n [element]=\"data?.control\"\r\n [label]=\"data?.label ? data?.label : data?.placeholder ? data.placeholder : data?.validationLabel\"\r\n [showValidationOnNotTouched]=\"data?.showValidationOnNotTouched\"\r\n >\r\n </ecabs-validations-messages>\r\n</div>\r\n", styles: [":host ::ng-deep .break-line-tooltip{white-space:pre-line}:host ::ng-deep .mat-icon-input-tooltip{font-size:18px;height:18px;width:18px}\n"] }]
571
+ args: [{ selector: 'app-element-wrapper', template: "<div\r\n class=\"form-field\"\r\n [ngClass]=\"{\r\n 'form-field--invalid':\r\n data?.showValidation && (data?.control?.touched || data?.showValidationOnNotTouched) && data?.control?.invalid,\r\n disabled: data?.disabled,\r\n 'form-field--required': data?.required && data?.showAsterisk\r\n }\"\r\n>\r\n <div class=\"flex\">\r\n <label\r\n class=\"form-field__label\"\r\n [attr.for]=\"data?.name\" *ngIf=\"data?.label && data?.showLabel\"\r\n >\r\n <span [innerHTML]=\"data?.label\"></span>\r\n </label>\r\n <mat-icon class=\"icon ml-4 mat-icon-input-tooltip\" matTooltipClass=\"break-line-tooltip\" *ngIf=\"data?.tooltip\"\r\n [matTooltip]=\"data?.tooltip\">error_outline\r\n </mat-icon>\r\n </div>\r\n\r\n <div class=\"form-field__label-note\" *ngIf=\"data?.labelNote\" [innerHTML]=\"data?.labelNote\"></div>\r\n\r\n <ng-content></ng-content>\r\n\r\n <ecabs-loading-spinner class=\"spinner\" size=\"tiny\" *ngIf=\"data.loading\"></ecabs-loading-spinner>\r\n\r\n <ecabs-hint [element]=\"data?.control\" [showHint]=\"data?.showHint\" [maxValue]=\"data?.maxLength\"></ecabs-hint>\r\n\r\n <ecabs-validations-messages\r\n *ngIf=\"data?.showValidation && !data?.hideValidationMessage\"\r\n [element]=\"data?.control\"\r\n [label]=\"data?.label ? data?.label : data?.placeholder ? data.placeholder : data?.validationLabel\"\r\n [showValidationOnNotTouched]=\"data?.showValidationOnNotTouched\"\r\n >\r\n </ecabs-validations-messages>\r\n</div>\r\n", styles: [":host ::ng-deep .break-line-tooltip{white-space:pre-line}:host ::ng-deep .mat-icon-input-tooltip{font-size:18px;height:18px;width:18px}\n"] }]
571
572
  }], propDecorators: { data: [{
572
573
  type: Input
573
574
  }], showCloseIcon: [{
@@ -818,17 +819,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
818
819
  type: Output
819
820
  }] } });
820
821
 
821
- class HintModule {
822
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: HintModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
823
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: HintModule, declarations: [HintComponent], imports: [CommonModule, FormsModule, MatFormFieldModule], exports: [HintComponent] });
824
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: HintModule, imports: [CommonModule, FormsModule, MatFormFieldModule] });
822
+ class EcabsHintModule {
823
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EcabsHintModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
824
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: EcabsHintModule, declarations: [EcabsHintComponent], imports: [CommonModule], exports: [EcabsHintComponent] });
825
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EcabsHintModule, imports: [CommonModule] });
825
826
  }
826
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: HintModule, decorators: [{
827
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EcabsHintModule, decorators: [{
827
828
  type: NgModule,
828
829
  args: [{
829
- declarations: [HintComponent],
830
- imports: [CommonModule, FormsModule, MatFormFieldModule],
831
- exports: [HintComponent],
830
+ declarations: [EcabsHintComponent],
831
+ imports: [CommonModule],
832
+ exports: [EcabsHintComponent],
832
833
  }]
833
834
  }] });
834
835
 
@@ -864,7 +865,7 @@ class ElementWrapperModule {
864
865
  MatFormFieldModule,
865
866
  MatIconModule,
866
867
  MatLegacyTooltipModule,
867
- HintModule], exports: [ElementWrapperComponent] });
868
+ EcabsHintModule], exports: [ElementWrapperComponent] });
868
869
  static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ElementWrapperModule, providers: [
869
870
  {
870
871
  provide: MAT_FORM_FIELD_DEFAULT_OPTIONS,
@@ -882,7 +883,7 @@ class ElementWrapperModule {
882
883
  MatFormFieldModule,
883
884
  MatIconModule,
884
885
  MatLegacyTooltipModule,
885
- HintModule] });
886
+ EcabsHintModule] });
886
887
  }
887
888
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ElementWrapperModule, decorators: [{
888
889
  type: NgModule,
@@ -896,7 +897,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
896
897
  MatFormFieldModule,
897
898
  MatIconModule,
898
899
  MatLegacyTooltipModule,
899
- HintModule,
900
+ EcabsHintModule,
900
901
  ],
901
902
  providers: [
902
903
  {
@@ -4516,6 +4517,173 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
4516
4517
  }]
4517
4518
  }] });
4518
4519
 
4520
+ class EcabsPaginatorDirective {
4521
+ matPag;
4522
+ vr;
4523
+ ren;
4524
+ destroyRef;
4525
+ length;
4526
+ _rangeStart;
4527
+ _rangeEnd;
4528
+ _buttons = [];
4529
+ _curPageObj = {
4530
+ length: 0,
4531
+ pageIndex: 0,
4532
+ pageSize: 0,
4533
+ previousPageIndex: 0,
4534
+ };
4535
+ _showTotalPages = 3;
4536
+ get showTotalPages() {
4537
+ return this._showTotalPages;
4538
+ }
4539
+ get inc() {
4540
+ return this._showTotalPages % 2 === 0
4541
+ ? this.showTotalPages / 2
4542
+ : (this.showTotalPages - 1) / 2;
4543
+ }
4544
+ get lastPageIndex() {
4545
+ return this.matPag.getNumberOfPages() - 1;
4546
+ }
4547
+ set showTotalPages(value) {
4548
+ this._showTotalPages = value % 2 === 0 ? value + 1 : value;
4549
+ }
4550
+ constructor(matPag, vr, ren, destroyRef) {
4551
+ this.matPag = matPag;
4552
+ this.vr = vr;
4553
+ this.ren = ren;
4554
+ this.destroyRef = destroyRef;
4555
+ // to rerender buttons on items per page change and first, last, next and prior buttons
4556
+ this.matPag.page
4557
+ .pipe(takeUntilDestroyed(this.destroyRef))
4558
+ .subscribe((e) => {
4559
+ this.pageChanged(e);
4560
+ });
4561
+ this.matPag.selectConfig = {
4562
+ panelClass: 'paginator--selector',
4563
+ };
4564
+ }
4565
+ pageChanged(page) {
4566
+ if (this._curPageObj.pageSize !== page.pageSize &&
4567
+ this._curPageObj.pageIndex !== 0) {
4568
+ page.pageIndex = 0;
4569
+ this._rangeStart = 0;
4570
+ this._rangeEnd = this._showTotalPages - 1;
4571
+ }
4572
+ this._curPageObj = page;
4573
+ this.initPageRange();
4574
+ }
4575
+ ngOnChanges(changes) {
4576
+ if (changes['length'] && !changes['length']?.firstChange) {
4577
+ this.pageChanged(this._curPageObj);
4578
+ }
4579
+ }
4580
+ //Initialize default state after view init
4581
+ ngAfterViewInit() {
4582
+ this._rangeStart = 0;
4583
+ this._rangeEnd = this._showTotalPages - 1;
4584
+ this.initPageRange();
4585
+ }
4586
+ buildPageNumbers() {
4587
+ const actionContainer = this.vr.element.nativeElement.querySelector('div.mat-mdc-paginator-range-actions');
4588
+ // including flex box in container
4589
+ const container = this.vr.element.nativeElement.querySelector('div.mat-mdc-paginator-container');
4590
+ // removing item per page
4591
+ const itemPerPage = this.vr.element.nativeElement.querySelector('div.mat-mdc-paginator-page-size');
4592
+ this.ren.appendChild(container, itemPerPage);
4593
+ // remove buttons before creating new ones
4594
+ if (this._buttons.length > 0) {
4595
+ this._buttons.forEach((button) => {
4596
+ this.ren.removeChild(actionContainer, button);
4597
+ });
4598
+ // Empty state array
4599
+ this._buttons.length = 0;
4600
+ }
4601
+ }
4602
+ // calculates the button range based on class input parameters and based on current page index value. Used to render new buttons after event.
4603
+ initPageRange() {
4604
+ const middleIndex = (this._rangeStart + this._rangeEnd) / 2;
4605
+ this._rangeStart = this.calcRangeStart(middleIndex);
4606
+ this._rangeEnd = this.calcRangeEnd(middleIndex);
4607
+ this.buildPageNumbers();
4608
+ }
4609
+ // Helper function To calculate start of button range
4610
+ calcRangeStart(middleIndex) {
4611
+ switch (true) {
4612
+ case this._curPageObj.pageIndex === 0 && this._rangeStart !== 0:
4613
+ return 0;
4614
+ case this._curPageObj.pageIndex > this._rangeEnd:
4615
+ return this._curPageObj.pageIndex + this.inc > this.lastPageIndex
4616
+ ? this.lastPageIndex - this.inc * 2
4617
+ : this._curPageObj.pageIndex - this.inc;
4618
+ case this._curPageObj.pageIndex > this._curPageObj.previousPageIndex &&
4619
+ this._curPageObj.pageIndex > middleIndex &&
4620
+ this._rangeEnd < this.lastPageIndex:
4621
+ return this._rangeStart + 1;
4622
+ case this._curPageObj.pageIndex < this._curPageObj.previousPageIndex &&
4623
+ this._curPageObj.pageIndex < middleIndex &&
4624
+ this._rangeStart > 0:
4625
+ return this._rangeStart - 1;
4626
+ default:
4627
+ return this._rangeStart;
4628
+ }
4629
+ }
4630
+ // Helper function to calculate end of button range
4631
+ calcRangeEnd(middleIndex) {
4632
+ switch (true) {
4633
+ case this._curPageObj.pageIndex === 0 &&
4634
+ this._rangeEnd !== this._showTotalPages:
4635
+ return this._showTotalPages - 1;
4636
+ case this._curPageObj.pageIndex > this._rangeEnd:
4637
+ return this._curPageObj.pageIndex + this.inc > this.lastPageIndex
4638
+ ? this.lastPageIndex
4639
+ : this._curPageObj.pageIndex + 1;
4640
+ case this._curPageObj.pageIndex > this._curPageObj.previousPageIndex &&
4641
+ this._curPageObj.pageIndex > middleIndex &&
4642
+ this._rangeEnd < this.lastPageIndex:
4643
+ return this._rangeEnd + 1;
4644
+ case this._curPageObj.pageIndex < this._curPageObj.previousPageIndex &&
4645
+ this._curPageObj.pageIndex < middleIndex &&
4646
+ this._rangeStart >= 0 &&
4647
+ this._rangeEnd > this._showTotalPages - 1:
4648
+ return this._rangeEnd - 1;
4649
+ default:
4650
+ return this._rangeEnd;
4651
+ }
4652
+ }
4653
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EcabsPaginatorDirective, deps: [{ token: i1$3.MatPaginator, host: true, optional: true, self: true }, { token: i0.ViewContainerRef }, { token: i0.Renderer2 }, { token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Directive });
4654
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: EcabsPaginatorDirective, selector: "[ecabsPaginator]", inputs: { length: "length", showTotalPages: "showTotalPages" }, usesOnChanges: true, ngImport: i0 });
4655
+ }
4656
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EcabsPaginatorDirective, decorators: [{
4657
+ type: Directive,
4658
+ args: [{
4659
+ selector: '[ecabsPaginator]',
4660
+ }]
4661
+ }], ctorParameters: function () { return [{ type: i1$3.MatPaginator, decorators: [{
4662
+ type: Host
4663
+ }, {
4664
+ type: Self
4665
+ }, {
4666
+ type: Optional
4667
+ }] }, { type: i0.ViewContainerRef }, { type: i0.Renderer2 }, { type: i0.DestroyRef }]; }, propDecorators: { length: [{
4668
+ type: Input
4669
+ }], showTotalPages: [{
4670
+ type: Input
4671
+ }] } });
4672
+
4673
+ class EcabsPaginatorDirectiveModule {
4674
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EcabsPaginatorDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4675
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: EcabsPaginatorDirectiveModule, declarations: [EcabsPaginatorDirective], imports: [CommonModule], exports: [EcabsPaginatorDirective] });
4676
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EcabsPaginatorDirectiveModule, imports: [CommonModule] });
4677
+ }
4678
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EcabsPaginatorDirectiveModule, decorators: [{
4679
+ type: NgModule,
4680
+ args: [{
4681
+ imports: [CommonModule],
4682
+ declarations: [EcabsPaginatorDirective],
4683
+ exports: [EcabsPaginatorDirective],
4684
+ }]
4685
+ }] });
4686
+
4519
4687
  class EcabsValidationComponent {
4520
4688
  validations;
4521
4689
  form;
@@ -5409,5 +5577,5 @@ const sortGeneric = (objX, objY, sortParams) => {
5409
5577
  * Generated bundle index. Do not edit.
5410
5578
  */
5411
5579
 
5412
- export { ButtonsComponent, DynamicBgColorDirective, DynamicBgColorDirectiveModule, EcabsActiveStatusFilterComponent, EcabsActiveStatusFilterModule, EcabsBreadcrumbComponent, EcabsBreadcrumbModule, EcabsButtonsModule, EcabsCheckboxToggleComponent, EcabsCheckboxToggleModule, EcabsComponentsService, EcabsDatePickerComponent, EcabsDatePickerHeaderComponent, EcabsDatePickerHeaderService, EcabsDatePickerModule, EcabsDateRangeModule, EcabsDateRangePickerComponent, EcabsDateRangePickerHeaderComponent, EcabsDateTimePickerComponent, EcabsDateTimePickerHeaderComponent, EcabsDateTimeRangePickerComponent, EcabsDateTimeRangePickerHeaderComponent, EcabsDatetimePickerModule, EcabsDatetimeRangePickerModule, EcabsDialogConfirmComponent, EcabsDialogConfirmModule, EcabsDialogMessageComponent, EcabsDialogMessageModule, EcabsEmptyPlaceholderComponent, EcabsEmptyPlaceholderModule, EcabsExpansionPanelComponent, EcabsExpansionPanelModule, EcabsHeaderComponent, EcabsHeaderModule, EcabsIncrementComponent, EcabsIncrementModule, EcabsInputComponent, EcabsInputModule, EcabsLanguageSelectorComponent, EcabsLanguageSelectorModule, EcabsLoadingComponent, EcabsLoadingModule, EcabsLogoComponent, EcabsLogoModule, EcabsMenuItemsComponent, EcabsMenuItemsModule, EcabsMultipleDatesPickerComponent, EcabsMultipleDatesPickerModule, EcabsNoteComponent, EcabsNoteModule, EcabsPhoneComponent, EcabsPhoneModule, EcabsPipesModule, EcabsPlaceAutocompleteComponent, EcabsPlaceAutocompleteModule, EcabsProfileComponent, EcabsProfileModule, EcabsRadioButtonListComponent, EcabsRadioButtonListModule, EcabsSelectComponent, EcabsSelectModule, EcabsSidebarComponent, EcabsSidebarModule, EcabsSpinnerComponent, EcabsTableFilterWrapperComponent, EcabsTableFilterWrapperModule, EcabsTableModule, EcabsTextAreaModule, EcabsTextareaComponent, EcabsTimeListPanelComponent, EcabsTimepickerComponent, EcabsTimepickerModule, EcabsTruncatePipe, EcabsValidationComponent, EcabsValidationModule, EcabsValidationViewModule, FormTimePickerService, GenericComponentConfig, HeaderService, MATERIAL_DATETIMEPICKER_FORMATS, MaskTimeDirective, MaskTimeDirectiveModule, TableComponent, TooltipIfTruncatedDirective, TooltipIfTruncatedDirectiveModule, UnsubscribeService, ValidationComponent, scrollFactory, sortGeneric };
5580
+ export { ButtonsComponent, DynamicBgColorDirective, DynamicBgColorDirectiveModule, EcabsActiveStatusFilterComponent, EcabsActiveStatusFilterModule, EcabsBreadcrumbComponent, EcabsBreadcrumbModule, EcabsButtonsModule, EcabsCheckboxToggleComponent, EcabsCheckboxToggleModule, EcabsComponentsService, EcabsDatePickerComponent, EcabsDatePickerHeaderComponent, EcabsDatePickerHeaderService, EcabsDatePickerModule, EcabsDateRangeModule, EcabsDateRangePickerComponent, EcabsDateRangePickerHeaderComponent, EcabsDateTimePickerComponent, EcabsDateTimePickerHeaderComponent, EcabsDateTimeRangePickerComponent, EcabsDateTimeRangePickerHeaderComponent, EcabsDatetimePickerModule, EcabsDatetimeRangePickerModule, EcabsDialogConfirmComponent, EcabsDialogConfirmModule, EcabsDialogMessageComponent, EcabsDialogMessageModule, EcabsEmptyPlaceholderComponent, EcabsEmptyPlaceholderModule, EcabsExpansionPanelComponent, EcabsExpansionPanelModule, EcabsHeaderComponent, EcabsHeaderModule, EcabsHintComponent, EcabsHintModule, EcabsIncrementComponent, EcabsIncrementModule, EcabsInputComponent, EcabsInputModule, EcabsLanguageSelectorComponent, EcabsLanguageSelectorModule, EcabsLoadingComponent, EcabsLoadingModule, EcabsLogoComponent, EcabsLogoModule, EcabsMenuItemsComponent, EcabsMenuItemsModule, EcabsMultipleDatesPickerComponent, EcabsMultipleDatesPickerModule, EcabsNoteComponent, EcabsNoteModule, EcabsPaginatorDirective, EcabsPaginatorDirectiveModule, EcabsPhoneComponent, EcabsPhoneModule, EcabsPipesModule, EcabsPlaceAutocompleteComponent, EcabsPlaceAutocompleteModule, EcabsProfileComponent, EcabsProfileModule, EcabsRadioButtonListComponent, EcabsRadioButtonListModule, EcabsSelectComponent, EcabsSelectModule, EcabsSidebarComponent, EcabsSidebarModule, EcabsSpinnerComponent, EcabsTableFilterWrapperComponent, EcabsTableFilterWrapperModule, EcabsTableModule, EcabsTextAreaModule, EcabsTextareaComponent, EcabsTimeListPanelComponent, EcabsTimepickerComponent, EcabsTimepickerModule, EcabsTruncatePipe, EcabsValidationComponent, EcabsValidationModule, EcabsValidationViewModule, FormTimePickerService, GenericComponentConfig, HeaderService, MATERIAL_DATETIMEPICKER_FORMATS, MaskTimeDirective, MaskTimeDirectiveModule, TableComponent, TooltipIfTruncatedDirective, TooltipIfTruncatedDirectiveModule, UnsubscribeService, ValidationComponent, scrollFactory, sortGeneric };
5413
5581
  //# sourceMappingURL=ecabs-components.mjs.map