@colijnit/corecomponents_v12 12.0.67 → 12.0.68

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.
@@ -4432,6 +4432,7 @@
4432
4432
  this.focused = false;
4433
4433
  this.formInput = true;
4434
4434
  this.customWidth = false;
4435
+ this.customHeight = false;
4435
4436
  this.noTriangleGraphic = false;
4436
4437
  this.halfWidth = false;
4437
4438
  this.fullWidth = false;
@@ -4728,6 +4729,7 @@
4728
4729
  if (this.showSaveCancel && this.canSaveOrCancel) {
4729
4730
  this._handleKeyDown(event);
4730
4731
  }
4732
+ this._positionValidationError();
4731
4733
  };
4732
4734
  Object.defineProperty(BaseInputComponent.prototype, "canChange", {
4733
4735
  get: function () {
@@ -5252,6 +5254,7 @@
5252
5254
  focused: [{ type: core.HostBinding, args: ["class.cc-input-focused",] }],
5253
5255
  formInput: [{ type: core.HostBinding, args: ["class.form-input",] }],
5254
5256
  customWidth: [{ type: core.Input }, { type: core.HostBinding, args: ["class.custom-width",] }],
5257
+ customHeight: [{ type: core.Input }, { type: core.HostBinding, args: ['class.custom-height',] }],
5255
5258
  noTriangleGraphic: [{ type: core.Input }],
5256
5259
  halfWidth: [{ type: core.Input }, { type: core.HostBinding, args: ["class.half-width",] }],
5257
5260
  fullWidth: [{ type: core.Input }, { type: core.HostBinding, args: ["class.full-width-important",] }],
@@ -5288,6 +5291,9 @@
5288
5291
  __decorate([
5289
5292
  InputBoolean()
5290
5293
  ], BaseInputComponent.prototype, "customWidth", void 0);
5294
+ __decorate([
5295
+ InputBoolean()
5296
+ ], BaseInputComponent.prototype, "customHeight", void 0);
5291
5297
  __decorate([
5292
5298
  InputBoolean()
5293
5299
  ], BaseInputComponent.prototype, "noTriangleGraphic", void 0);
@@ -5622,17 +5628,12 @@
5622
5628
  DropDownListComponent.prototype.showClass = function () {
5623
5629
  return true;
5624
5630
  };
5625
- DropDownListComponent.prototype.handleValueChanged = function (value) {
5626
- if (value !== this.model) {
5627
- this.modelChange.next(value);
5628
- }
5629
- };
5630
5631
  return DropDownListComponent;
5631
5632
  }(BaseInputComponent));
5632
5633
  DropDownListComponent.decorators = [
5633
5634
  { type: core.Component, args: [{
5634
5635
  selector: "co-drop-down-list",
5635
- template: "\n <ejs-dropdownlist\n [dataSource]=\"collection\"\n [allowFiltering]=\"allowFiltering\"\n [value]=\"model\"\n [fields]=\"fields\"\n [filterBarPlaceholder]=\"filterBarPlaceholder\"\n [filterType]=\"filterType\"\n [placeholder]=\"placeholder\"\n [readonly]=\"readonly\"\n [itemTemplate]=\"itemTemplate\"\n [headerTemplate]=\"headerTemplate\"\n [valueTemplate]=\"valueTemplate\"\n [disabled]=\"disabled\"\n [ngModel]=\"model\"\n (ngModelChange)=\"modelChange.emit($event)\"\n (valueChange)=\"handleValueChanged($event)\"\n showClearButton=\"true\"\n floatLabelType=\"Auto\"\n >\n </ejs-dropdownlist>\n <div class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
5636
+ template: "\n <ejs-dropdownlist\n [dataSource]=\"collection\"\n [allowFiltering]=\"allowFiltering\"\n [value]=\"model\"\n [fields]=\"fields\"\n [filterBarPlaceholder]=\"filterBarPlaceholder\"\n [filterType]=\"filterType\"\n [placeholder]=\"placeholder\"\n [readonly]=\"readonly\"\n [itemTemplate]=\"itemTemplate\"\n [headerTemplate]=\"headerTemplate\"\n [valueTemplate]=\"valueTemplate\"\n [disabled]=\"disabled\"\n [ngModel]=\"model\"\n (ngModelChange)=\"modelChange.emit($event)\"\n showClearButton=\"true\"\n floatLabelType=\"Auto\"\n >\n </ejs-dropdownlist>\n <div class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
5636
5637
  providers: [
5637
5638
  ej2AngularDropdowns.CheckBoxSelectionService,
5638
5639
  {
@@ -7916,6 +7917,7 @@
7916
7917
  _this.search = new core.EventEmitter();
7917
7918
  _this.useLeftIcon = false;
7918
7919
  _this.useRightIcon = false;
7920
+ _this.customHeight = false;
7919
7921
  _this.noIcon = false;
7920
7922
  _this.isSmall = false;
7921
7923
  return _this;
@@ -7937,7 +7939,7 @@
7937
7939
  InputSearchComponent.decorators = [
7938
7940
  { type: core.Component, args: [{
7939
7941
  selector: 'co-input-search',
7940
- template: "\n <co-input-text\n [model]=\"model\"\n [leftIcon]=\"useLeftIcon ? searchIcon : null\"\n [rightIcon]=\"useRightIcon ? searchIcon : null\"\n [placeholder]=\"placeholder\"\n [showPlaceholderOnFocus]=\"false\"\n (modelChange)=\"modelChange.emit($event)\"\n ></co-input-text>\n ",
7942
+ template: "\n <co-input-text\n [model]=\"model\"\n [leftIcon]=\"useLeftIcon ? searchIcon : null\"\n [rightIcon]=\"useRightIcon ? searchIcon : null\"\n [placeholder]=\"placeholder\"\n [customHeight]=\"customHeight\"\n [showPlaceholderOnFocus]=\"false\"\n (modelChange)=\"modelChange.emit($event)\"\n ></co-input-text>\n ",
7941
7943
  changeDetection: core.ChangeDetectionStrategy.OnPush,
7942
7944
  encapsulation: core.ViewEncapsulation.None
7943
7945
  },] }
@@ -7947,6 +7949,7 @@
7947
7949
  search: [{ type: core.Output }],
7948
7950
  useLeftIcon: [{ type: core.Input }],
7949
7951
  useRightIcon: [{ type: core.Input }],
7952
+ customHeight: [{ type: core.Input }],
7950
7953
  noIcon: [{ type: core.HostBinding, args: ['class.no-icon',] }, { type: core.Input }],
7951
7954
  isSmall: [{ type: core.HostBinding, args: ['class.is-small',] }, { type: core.Input }],
7952
7955
  showClass: [{ type: core.HostBinding, args: ['class.co-input-search',] }]
@@ -7956,7 +7959,10 @@
7956
7959
  ], InputSearchComponent.prototype, "useLeftIcon", void 0);
7957
7960
  __decorate([
7958
7961
  InputBoolean()
7959
- ], InputSearchComponent.prototype, "useRightIcon", void 0);
7962
+ ], InputSearchComponent.prototype, "useRightIcon", void 0);
7963
+ __decorate([
7964
+ InputBoolean()
7965
+ ], InputSearchComponent.prototype, "customHeight", void 0);
7960
7966
 
7961
7967
  var InputSearchModule = /** @class */ (function () {
7962
7968
  function InputSearchModule() {
@@ -9697,6 +9703,7 @@
9697
9703
  var BaseSimpleGridComponent = /** @class */ (function () {
9698
9704
  function BaseSimpleGridComponent() {
9699
9705
  this.MIN_COLUMN_WIDTH = 50;
9706
+ this.dataChanged = new rxjs.Subject();
9700
9707
  this.dragDropEnabled = false;
9701
9708
  this.resizable = false;
9702
9709
  this.inlineEdit = false;
@@ -9734,6 +9741,7 @@
9734
9741
  set: function (value) {
9735
9742
  this._data = value;
9736
9743
  this._prepareData();
9744
+ this.dataChanged.next();
9737
9745
  },
9738
9746
  enumerable: false,
9739
9747
  configurable: true
@@ -9877,6 +9885,9 @@
9877
9885
  _this.currentPage = 1;
9878
9886
  _this._doubleClicked = false;
9879
9887
  _this._newRow = false;
9888
+ _this.dataChanged.subscribe(function () {
9889
+ _this.currentPage = 1;
9890
+ });
9880
9891
  return _this;
9881
9892
  }
9882
9893
  Object.defineProperty(SimpleGridComponent.prototype, "headerCells", {
@@ -10158,7 +10169,7 @@
10158
10169
  SimpleGridComponent.decorators = [
10159
10170
  { type: core.Component, args: [{
10160
10171
  selector: 'co-simple-grid',
10161
- template: "\n <co-grid-toolbar *ngIf=\"showToolbar\" [class.right]=\"rightToolbar\"\n [showEdit]=\"inlineEdit\"\n [showAdd]=\"showAdd\"\n [showDelete]=\"showDelete\"\n [deleteEnabled]=\"selectedRowIndex > -1\"\n (addClick)=\"addNewRow()\"\n (editClick)=\"editRow($event)\"\n (saveClick)=\"validateAndSave()\"\n (cancelClick)=\"cancelEditRow()\"\n (deleteClick)=\"removeRow()\"\n ></co-grid-toolbar>\n <table class=\"simple-grid-table\">\n <colgroup>\n <col *ngFor=\"let column of headerColumns; let index = index\"\n [class.simple-grid-column-auto-fit]=\"column.autoFit\"\n [style.width.px]=\"column.width\"\n [style.min-width.px]=\"MIN_COLUMN_WIDTH\">\n </colgroup>\n <thead>\n <tr>\n <th scope=\"col\" #headerCell class=\"simple-grid-column-header\" *ngFor=\"let column of headerColumns; let index = index\">\n <div class=\"simple-grid-column-header-wrapper\" [class.resizable]=\"resizable\"\n [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\">\n <ng-container *ngIf=\"column.headerTemplate; else noHeaderTemplate\">\n <ng-container [ngTemplateOutlet]=\"column.headerTemplate\"></ng-container>\n </ng-container>\n <ng-template #noHeaderTemplate>\n <div class=\"simple-grid-column-header-label\" [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\"\n [textContent]=\"column.headerText || '&nbsp;'\"\n ></div>\n </ng-template>\n <div *ngIf=\"resizable && column.resizable\" class=\"simple-grid-column-sizer\"\n (mousedown)=\"handleSizerMouseDown($event, column)\"\n ></div>\n </div>\n </th>\n </tr>\n </thead>\n <tbody #dropList cdkDropList cdkDropListOrientation=\"vertical\"\n class=\"simple-grid-drag-drop-list\"\n [cdkDropListDisabled]=\"!dragDropEnabled\"\n [cdkDropListData]=\"data\"\n [cdkDropListEnterPredicate]=\"handleCanDragDrop\"\n (cdkDropListDropped)=\"handleDrop($event)\">\n <tr class=\"simple-grid-row\" [class.selected]=\"rowIndex === selectedRowIndex && !editing\" observeVisibility\n [class.editing]=\"rowIndex === editRowIndex\" *ngFor=\"let row of (!!rowsPerPage ? (data | paginate: {itemsPerPage: rowsPerPage, currentPage: currentPage}) : data); last as last; let rowIndex = index\" cdkDrag\n (click)=\"handleClickRow($event, rowIndex)\" (dblclick)=\"handleDblClickRow($event, rowIndex)\" (visible)=\"rowVisible.next(row)\">\n <co-form class=\"simple-grid-row-form\">\n <ng-container *ngIf=\"isSingleColumnRow(row)\">\n <td class=\"simple-grid-single-column-cell\" [attr.colspan]=\"headerColumns.length\">\n <co-simple-grid-cell\n [column]=\"columns[singleColumnIndex(row)]\"\n [row]=\"row\"\n [editMode]=\"false\"\n ></co-simple-grid-cell>\n </td>\n </ng-container>\n <ng-container *ngIf=\"!isSingleColumnRow(row)\">\n <ng-container *ngFor=\"let column of headerColumns; let columnIndex = index\">\n <td class=\"simple-grid-column-cell\" *ngIf=\"columnIndex !== singleColumnIndex(row)\">\n <co-simple-grid-cell\n [column]=\"column\"\n [row]=\"row\"\n [editMode]=\"inlineEdit && editing && rowIndex === editRowIndex\"\n [fieldEditMode]=\"editCellIndex === columnIndex\"\n (cellClick)=\"handleCellClick(columnIndex)\"\n ></co-simple-grid-cell>\n <div *ngIf=\"column.resizable\" class=\"simple-grid-column-sizer-placeholder\"></div>\n </td>\n </ng-container>\n </ng-container>\n </co-form>\n </tr>\n </tbody>\n </table>\n <co-pagination-bar *ngIf=\"data?.length > rowsPerPage\"\n [itemsPerPage]=\"rowsPerPage\"\n [currentPage]=\"currentPage\"\n [totalItems]=\"data.length\"\n [autoHide]=\"true\"\n (previousClick)=\"goToPreviousPage()\"\n (nextClick)=\"goToNextPage()\"\n (pageClick)=\"setCurrentPage($event)\"\n ></co-pagination-bar>\n ",
10172
+ template: "\n <co-grid-toolbar *ngIf=\"showToolbar\" [class.right]=\"rightToolbar\"\n [showEdit]=\"inlineEdit\"\n [showAdd]=\"showAdd\"\n [showDelete]=\"showDelete\"\n [deleteEnabled]=\"selectedRowIndex > -1\"\n (addClick)=\"addNewRow()\"\n (editClick)=\"editRow($event)\"\n (saveClick)=\"validateAndSave()\"\n (cancelClick)=\"cancelEditRow()\"\n (deleteClick)=\"removeRow()\"\n ></co-grid-toolbar>\n <table class=\"simple-grid-table\">\n <colgroup>\n <col *ngFor=\"let column of headerColumns; let index = index\"\n [class.simple-grid-column-auto-fit]=\"column.autoFit\"\n [style.width.px]=\"column.width\"\n [style.min-width.px]=\"MIN_COLUMN_WIDTH\">\n </colgroup>\n <thead>\n <tr>\n <th scope=\"col\" #headerCell class=\"simple-grid-column-header\" *ngFor=\"let column of headerColumns; let index = index\">\n <div class=\"simple-grid-column-header-wrapper\" [class.resizable]=\"resizable\"\n [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\">\n <ng-container *ngIf=\"column.headerTemplate; else noHeaderTemplate\">\n <ng-container [ngTemplateOutlet]=\"column.headerTemplate\"></ng-container>\n </ng-container>\n <ng-template #noHeaderTemplate>\n <div class=\"simple-grid-column-header-label\" [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\"\n [textContent]=\"column.headerText || '&nbsp;'\"\n ></div>\n </ng-template>\n <div *ngIf=\"resizable && column.resizable\" class=\"simple-grid-column-sizer\"\n (mousedown)=\"handleSizerMouseDown($event, column)\"\n ></div>\n </div>\n </th>\n </tr>\n </thead>\n <tbody #dropList cdkDropList cdkDropListOrientation=\"vertical\"\n class=\"simple-grid-drag-drop-list\"\n [cdkDropListDisabled]=\"!dragDropEnabled\"\n [cdkDropListData]=\"data\"\n [cdkDropListEnterPredicate]=\"handleCanDragDrop\"\n (cdkDropListDropped)=\"handleDrop($event)\">\n <tr class=\"simple-grid-row\" [class.selected]=\"rowIndex === selectedRowIndex && !editing\" observeVisibility\n [class.editing]=\"rowIndex === editRowIndex\" *ngFor=\"let row of (!!rowsPerPage ? (data | paginate: {itemsPerPage: rowsPerPage, currentPage: currentPage}) : data); last as last; let rowIndex = index\" cdkDrag\n (click)=\"handleClickRow($event, rowIndex)\" (dblclick)=\"handleDblClickRow($event, rowIndex)\" (visible)=\"rowVisible.next(row)\">\n <co-form class=\"simple-grid-row-form\">\n <ng-container *ngIf=\"isSingleColumnRow(row)\">\n <td class=\"simple-grid-single-column-cell\" [attr.colspan]=\"headerColumns.length\">\n <co-simple-grid-cell\n [column]=\"columns[singleColumnIndex(row)]\"\n [row]=\"row\"\n [editMode]=\"false\"\n ></co-simple-grid-cell>\n </td>\n </ng-container>\n <ng-container *ngIf=\"!isSingleColumnRow(row)\">\n <ng-container *ngFor=\"let column of headerColumns; let columnIndex = index\">\n <td class=\"simple-grid-column-cell\" *ngIf=\"columnIndex !== singleColumnIndex(row)\">\n <co-simple-grid-cell\n [column]=\"column\"\n [row]=\"row\"\n [editMode]=\"inlineEdit && editing && rowIndex === editRowIndex\"\n [fieldEditMode]=\"editCellIndex === columnIndex\"\n (cellClick)=\"handleCellClick(columnIndex)\"\n ></co-simple-grid-cell>\n <div *ngIf=\"column.resizable\" class=\"simple-grid-column-sizer-placeholder\"></div>\n </td>\n </ng-container>\n </ng-container>\n </co-form>\n </tr>\n </tbody>\n </table>\n <co-pagination-bar *ngIf=\"data?.length > rowsPerPage\" class=\"pagination-bar\"\n [itemsPerPage]=\"rowsPerPage\"\n [currentPage]=\"currentPage\"\n [totalItems]=\"data.length\"\n [autoHide]=\"true\"\n (previousClick)=\"goToPreviousPage()\"\n (nextClick)=\"goToNextPage()\"\n (pageClick)=\"setCurrentPage($event)\"\n ></co-pagination-bar>\n ",
10162
10173
  providers: [
10163
10174
  FormMasterService
10164
10175
  ],
@@ -10302,7 +10313,7 @@
10302
10313
  PaginationBarComponent.decorators = [
10303
10314
  { type: core.Component, args: [{
10304
10315
  selector: "co-pagination-bar",
10305
- template: "\n <ul class=\"pagination\" *ngIf=\"!shouldBeHidden()\">\n <li *ngIf=\"directionLinks\" class=\"pagination-previous\" [class.disabled]=\"isOnFirstPage()\">\n <a (click)=\"onPreviousClick()\" [class.disabled]=\"isOnFirstPage()\">{{ previousLabel }}</a>\n </li>\n <li *ngFor=\"let page of pages\" [class.current]=\"currentPage === page.value\" (click)=\"onPageClick(page.value)\">\n <span>{{page.label}}</span>\n </li>\n <li *ngIf=\"directionLinks\" class=\"pagination-next\" [class.disabled]=\"isOnLastPage()\">\n <a (click)=\"onNextClick()\" [class.disabled]=\"isOnLastPage()\">{{ nextLabel }}</a>\n </li>\n </ul>\n ",
10316
+ template: "\n <ul class=\"pagination\" *ngIf=\"!shouldBeHidden()\">\n <li *ngIf=\"directionLinks\" class=\"pagination-previous\" [class.disabled]=\"isOnFirstPage()\" (click)=\"onPreviousClick()\">\n <a [class.disabled]=\"isOnFirstPage()\">{{ previousLabel }}</a>\n </li>\n <li *ngFor=\"let page of pages\" [class.current]=\"currentPage === page.value\" (click)=\"onPageClick(page.value)\">\n <span>{{page.label}}</span>\n </li>\n <li *ngIf=\"directionLinks\" class=\"pagination-next\" [class.disabled]=\"isOnLastPage()\" (click)=\"onNextClick()\" >\n <a [class.disabled]=\"isOnLastPage()\">{{ nextLabel }}</a>\n </li>\n </ul>\n ",
10306
10317
  encapsulation: core.ViewEncapsulation.None
10307
10318
  },] }
10308
10319
  ];
@@ -10340,101 +10351,9 @@
10340
10351
  },] }
10341
10352
  ];
10342
10353
 
10343
- var PaginationService = /** @class */ (function () {
10344
- function PaginationService() {
10345
- this.change = new rxjs.Subject();
10346
- this.instances = {};
10347
- }
10348
- Object.defineProperty(PaginationService.prototype, "DEFAULT_ID", {
10349
- get: function () {
10350
- return PaginationService.DEFAULT_ID;
10351
- },
10352
- enumerable: false,
10353
- configurable: true
10354
- });
10355
- PaginationService.prototype.register = function (instance) {
10356
- if (!instance.id) {
10357
- instance.id = PaginationService.DEFAULT_ID;
10358
- }
10359
- if (!this.instances[instance.id]) {
10360
- this.instances[instance.id] = instance;
10361
- this.change.next(instance.id);
10362
- }
10363
- else {
10364
- var changed = this.updateInstance(instance);
10365
- if (changed) {
10366
- this.change.next(instance.id);
10367
- }
10368
- }
10369
- };
10370
- // Returns the current page number.
10371
- PaginationService.prototype.getCurrentPage = function (id) {
10372
- if (this.instances[id]) {
10373
- return this.instances[id].currentPage;
10374
- }
10375
- };
10376
- // Sets the current page number.
10377
- PaginationService.prototype.setCurrentPage = function (id, page) {
10378
- if (this.instances[id]) {
10379
- var instance = this.instances[id];
10380
- var maxPage = Math.ceil(instance.totalItems / instance.itemsPerPage);
10381
- if (page <= maxPage && 1 <= page) {
10382
- this.instances[id].currentPage = page;
10383
- this.change.next(id);
10384
- }
10385
- }
10386
- };
10387
- // Sets the value of instance.totalItems
10388
- PaginationService.prototype.setTotalItems = function (id, totalItems) {
10389
- if (this.instances[id] && 0 <= totalItems) {
10390
- this.instances[id].totalItems = totalItems;
10391
- this.change.next(id);
10392
- }
10393
- };
10394
- // Sets the value of instance.itemsPerPage.
10395
- PaginationService.prototype.setItemsPerPage = function (id, itemsPerPage) {
10396
- if (this.instances[id]) {
10397
- this.instances[id].itemsPerPage = itemsPerPage;
10398
- this.change.next(id);
10399
- }
10400
- };
10401
- /**
10402
- * Returns a clone of the pagination instance object matching the id. If no
10403
- * id specified, returns the instance corresponding to the default id.
10404
- */
10405
- PaginationService.prototype.getInstance = function (id) {
10406
- if (id === void 0) { id = PaginationService.DEFAULT_ID; }
10407
- if (this.instances[id]) {
10408
- return ObjectUtils.GetShallowClone(this.instances[id]);
10409
- }
10410
- return {};
10411
- };
10412
- /**
10413
- * Check each property of the instance and update any that have changed. Return
10414
- * true if any changes were made, else return false.
10415
- */
10416
- PaginationService.prototype.updateInstance = function (instance) {
10417
- var changed = false;
10418
- for (var prop in this.instances[instance.id]) {
10419
- if (instance[prop] !== this.instances[instance.id][prop]) {
10420
- this.instances[instance.id][prop] = instance[prop];
10421
- changed = true;
10422
- }
10423
- }
10424
- return changed;
10425
- };
10426
- return PaginationService;
10427
- }());
10428
- PaginationService.DEFAULT_ID = "DEFAULT_PAGINATION_ID";
10429
- PaginationService.decorators = [
10430
- { type: core.Injectable }
10431
- ];
10432
- PaginationService.ctorParameters = function () { return []; };
10433
-
10434
10354
  var LARGE_NUMBER = 999999999;
10435
10355
  var PaginatePipe = /** @class */ (function () {
10436
- function PaginatePipe(paginateService) {
10437
- this.paginateService = paginateService;
10356
+ function PaginatePipe() {
10438
10357
  // store the values from the last time the pipe
10439
10358
  this.state = {};
10440
10359
  }
@@ -10444,7 +10363,7 @@
10444
10363
  // use the cached data from the `state` object to prevent the NgFor
10445
10364
  // from flashing empty until the real values arrive.
10446
10365
  if (!(collection instanceof Array)) {
10447
- var _id = args.id || this.paginateService.DEFAULT_ID;
10366
+ var _id = args.id;
10448
10367
  if (this.state[_id]) {
10449
10368
  return this.state[_id].slice;
10450
10369
  }
@@ -10458,7 +10377,6 @@
10458
10377
  var start;
10459
10378
  var end;
10460
10379
  var perPage = instance.itemsPerPage;
10461
- this.paginateService.register(instance);
10462
10380
  if (!serverSideMode && collection instanceof Array) {
10463
10381
  perPage = perPage || LARGE_NUMBER;
10464
10382
  start = (instance.currentPage - 1) * perPage;
@@ -10470,7 +10388,6 @@
10470
10388
  else {
10471
10389
  var slice = collection.slice(start, end);
10472
10390
  this._saveState(id, collection, slice, start, end);
10473
- this.paginateService.change.next(id);
10474
10391
  return slice;
10475
10392
  }
10476
10393
  }
@@ -10484,7 +10401,7 @@
10484
10401
  var config = args;
10485
10402
  this._checkConfig(config);
10486
10403
  return {
10487
- id: config.id || this.paginateService.DEFAULT_ID,
10404
+ id: config.id,
10488
10405
  itemsPerPage: config.itemsPerPage || 0,
10489
10406
  currentPage: config.currentPage || 1,
10490
10407
  totalItems: config.totalItems || collection.length
@@ -10531,10 +10448,98 @@
10531
10448
  name: 'paginate',
10532
10449
  pure: false
10533
10450
  },] }
10451
+ ];
10452
+
10453
+ var PaginationService = /** @class */ (function () {
10454
+ function PaginationService() {
10455
+ this.change = new rxjs.Subject();
10456
+ this.instances = {};
10457
+ }
10458
+ Object.defineProperty(PaginationService.prototype, "DEFAULT_ID", {
10459
+ get: function () {
10460
+ return PaginationService.DEFAULT_ID;
10461
+ },
10462
+ enumerable: false,
10463
+ configurable: true
10464
+ });
10465
+ PaginationService.prototype.register = function (instance) {
10466
+ if (!instance.id) {
10467
+ instance.id = PaginationService.DEFAULT_ID;
10468
+ }
10469
+ if (!this.instances[instance.id]) {
10470
+ this.instances[instance.id] = instance;
10471
+ this.change.next(instance.id);
10472
+ }
10473
+ else {
10474
+ var changed = this.updateInstance(instance);
10475
+ if (changed) {
10476
+ this.change.next(instance.id);
10477
+ }
10478
+ }
10479
+ };
10480
+ // Returns the current page number.
10481
+ PaginationService.prototype.getCurrentPage = function (id) {
10482
+ if (this.instances[id]) {
10483
+ return this.instances[id].currentPage;
10484
+ }
10485
+ };
10486
+ // Sets the current page number.
10487
+ PaginationService.prototype.setCurrentPage = function (id, page) {
10488
+ if (this.instances[id]) {
10489
+ var instance = this.instances[id];
10490
+ var maxPage = Math.ceil(instance.totalItems / instance.itemsPerPage);
10491
+ if (page <= maxPage && 1 <= page) {
10492
+ this.instances[id].currentPage = page;
10493
+ this.change.next(id);
10494
+ }
10495
+ }
10496
+ };
10497
+ // Sets the value of instance.totalItems
10498
+ PaginationService.prototype.setTotalItems = function (id, totalItems) {
10499
+ if (this.instances[id] && 0 <= totalItems) {
10500
+ this.instances[id].totalItems = totalItems;
10501
+ this.change.next(id);
10502
+ }
10503
+ };
10504
+ // Sets the value of instance.itemsPerPage.
10505
+ PaginationService.prototype.setItemsPerPage = function (id, itemsPerPage) {
10506
+ if (this.instances[id]) {
10507
+ this.instances[id].itemsPerPage = itemsPerPage;
10508
+ this.change.next(id);
10509
+ }
10510
+ };
10511
+ /**
10512
+ * Returns a clone of the pagination instance object matching the id. If no
10513
+ * id specified, returns the instance corresponding to the default id.
10514
+ */
10515
+ PaginationService.prototype.getInstance = function (id) {
10516
+ if (id === void 0) { id = PaginationService.DEFAULT_ID; }
10517
+ if (this.instances[id]) {
10518
+ return ObjectUtils.GetShallowClone(this.instances[id]);
10519
+ }
10520
+ return {};
10521
+ };
10522
+ /**
10523
+ * Check each property of the instance and update any that have changed. Return
10524
+ * true if any changes were made, else return false.
10525
+ */
10526
+ PaginationService.prototype.updateInstance = function (instance) {
10527
+ var changed = false;
10528
+ for (var prop in this.instances[instance.id]) {
10529
+ if (instance[prop] !== this.instances[instance.id][prop]) {
10530
+ this.instances[instance.id][prop] = instance[prop];
10531
+ changed = true;
10532
+ }
10533
+ }
10534
+ return changed;
10535
+ };
10536
+ return PaginationService;
10537
+ }());
10538
+ PaginationService.DEFAULT_ID = "DEFAULT_PAGINATION_ID";
10539
+ PaginationService.decorators = [
10540
+ { type: core.Injectable }
10534
10541
  ];
10535
- PaginatePipe.ctorParameters = function () { return [
10536
- { type: PaginationService }
10537
- ]; };
10542
+ PaginationService.ctorParameters = function () { return []; };
10538
10543
 
10539
10544
  var PaginationComponent = /** @class */ (function () {
10540
10545
  function PaginationComponent(_paginationService) {