@colijnit/corecomponents_v12 12.0.66 → 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.
Files changed (23) hide show
  1. package/bundles/colijnit-corecomponents_v12.umd.js +118 -111
  2. package/bundles/colijnit-corecomponents_v12.umd.js.map +1 -1
  3. package/colijnit-corecomponents_v12.metadata.json +1 -1
  4. package/esm2015/lib/components/base/base-input.component.js +7 -1
  5. package/esm2015/lib/components/drop-down-list/drop-down-list.component.js +1 -7
  6. package/esm2015/lib/components/input-date-picker/input-date-picker.component.js +4 -2
  7. package/esm2015/lib/components/input-search/input-search.component.js +7 -1
  8. package/esm2015/lib/components/pagination/paginate.pipe.js +4 -11
  9. package/esm2015/lib/components/pagination-bar/pagination-bar.component.js +5 -5
  10. package/esm2015/lib/components/simple-grid/base-simple-grid.component.js +4 -1
  11. package/esm2015/lib/components/simple-grid/simple-grid.component.js +5 -2
  12. package/fesm2015/colijnit-corecomponents_v12.js +114 -107
  13. package/fesm2015/colijnit-corecomponents_v12.js.map +1 -1
  14. package/lib/components/base/base-input.component.d.ts +1 -0
  15. package/lib/components/drop-down-list/drop-down-list.component.d.ts +0 -1
  16. package/lib/components/input-date-picker/input-date-picker.component.d.ts +1 -0
  17. package/lib/components/input-date-picker/style/_layout.scss +24 -0
  18. package/lib/components/input-search/input-search.component.d.ts +1 -0
  19. package/lib/components/pagination/paginate.pipe.d.ts +0 -3
  20. package/lib/components/simple-grid/base-simple-grid.component.d.ts +2 -0
  21. package/lib/components/simple-grid/style/_layout.scss +6 -0
  22. package/lib/components/simple-grid/style/_material-definition.scss +1 -0
  23. package/package.json +1 -1
@@ -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
  {
@@ -6669,6 +6670,7 @@
6669
6670
  _this.iconHeight = "24px";
6670
6671
  _this.placeholder = "";
6671
6672
  _this.blur = new core.EventEmitter();
6673
+ _this.isMinimal = false;
6672
6674
  _super.prototype._markAsOnPush.call(_this);
6673
6675
  return _this;
6674
6676
  }
@@ -6735,7 +6737,8 @@
6735
6737
  placeholder: [{ type: core.Input }],
6736
6738
  width: [{ type: core.Input }],
6737
6739
  blur: [{ type: core.Output }],
6738
- showClass: [{ type: core.HostBinding, args: ["class.co-input-date",] }]
6740
+ showClass: [{ type: core.HostBinding, args: ["class.co-input-date",] }],
6741
+ isMinimal: [{ type: core.HostBinding, args: ['class.is-minimal',] }, { type: core.Input }]
6739
6742
  };
6740
6743
 
6741
6744
  var CommitButtonsComponent = /** @class */ (function () {
@@ -7914,6 +7917,7 @@
7914
7917
  _this.search = new core.EventEmitter();
7915
7918
  _this.useLeftIcon = false;
7916
7919
  _this.useRightIcon = false;
7920
+ _this.customHeight = false;
7917
7921
  _this.noIcon = false;
7918
7922
  _this.isSmall = false;
7919
7923
  return _this;
@@ -7935,7 +7939,7 @@
7935
7939
  InputSearchComponent.decorators = [
7936
7940
  { type: core.Component, args: [{
7937
7941
  selector: 'co-input-search',
7938
- 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 ",
7939
7943
  changeDetection: core.ChangeDetectionStrategy.OnPush,
7940
7944
  encapsulation: core.ViewEncapsulation.None
7941
7945
  },] }
@@ -7945,6 +7949,7 @@
7945
7949
  search: [{ type: core.Output }],
7946
7950
  useLeftIcon: [{ type: core.Input }],
7947
7951
  useRightIcon: [{ type: core.Input }],
7952
+ customHeight: [{ type: core.Input }],
7948
7953
  noIcon: [{ type: core.HostBinding, args: ['class.no-icon',] }, { type: core.Input }],
7949
7954
  isSmall: [{ type: core.HostBinding, args: ['class.is-small',] }, { type: core.Input }],
7950
7955
  showClass: [{ type: core.HostBinding, args: ['class.co-input-search',] }]
@@ -7954,7 +7959,10 @@
7954
7959
  ], InputSearchComponent.prototype, "useLeftIcon", void 0);
7955
7960
  __decorate([
7956
7961
  InputBoolean()
7957
- ], InputSearchComponent.prototype, "useRightIcon", void 0);
7962
+ ], InputSearchComponent.prototype, "useRightIcon", void 0);
7963
+ __decorate([
7964
+ InputBoolean()
7965
+ ], InputSearchComponent.prototype, "customHeight", void 0);
7958
7966
 
7959
7967
  var InputSearchModule = /** @class */ (function () {
7960
7968
  function InputSearchModule() {
@@ -9695,6 +9703,7 @@
9695
9703
  var BaseSimpleGridComponent = /** @class */ (function () {
9696
9704
  function BaseSimpleGridComponent() {
9697
9705
  this.MIN_COLUMN_WIDTH = 50;
9706
+ this.dataChanged = new rxjs.Subject();
9698
9707
  this.dragDropEnabled = false;
9699
9708
  this.resizable = false;
9700
9709
  this.inlineEdit = false;
@@ -9732,6 +9741,7 @@
9732
9741
  set: function (value) {
9733
9742
  this._data = value;
9734
9743
  this._prepareData();
9744
+ this.dataChanged.next();
9735
9745
  },
9736
9746
  enumerable: false,
9737
9747
  configurable: true
@@ -9875,6 +9885,9 @@
9875
9885
  _this.currentPage = 1;
9876
9886
  _this._doubleClicked = false;
9877
9887
  _this._newRow = false;
9888
+ _this.dataChanged.subscribe(function () {
9889
+ _this.currentPage = 1;
9890
+ });
9878
9891
  return _this;
9879
9892
  }
9880
9893
  Object.defineProperty(SimpleGridComponent.prototype, "headerCells", {
@@ -10156,7 +10169,7 @@
10156
10169
  SimpleGridComponent.decorators = [
10157
10170
  { type: core.Component, args: [{
10158
10171
  selector: 'co-simple-grid',
10159
- 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 ",
10160
10173
  providers: [
10161
10174
  FormMasterService
10162
10175
  ],
@@ -10300,7 +10313,7 @@
10300
10313
  PaginationBarComponent.decorators = [
10301
10314
  { type: core.Component, args: [{
10302
10315
  selector: "co-pagination-bar",
10303
- 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 ",
10304
10317
  encapsulation: core.ViewEncapsulation.None
10305
10318
  },] }
10306
10319
  ];
@@ -10338,101 +10351,9 @@
10338
10351
  },] }
10339
10352
  ];
10340
10353
 
10341
- var PaginationService = /** @class */ (function () {
10342
- function PaginationService() {
10343
- this.change = new rxjs.Subject();
10344
- this.instances = {};
10345
- }
10346
- Object.defineProperty(PaginationService.prototype, "DEFAULT_ID", {
10347
- get: function () {
10348
- return PaginationService.DEFAULT_ID;
10349
- },
10350
- enumerable: false,
10351
- configurable: true
10352
- });
10353
- PaginationService.prototype.register = function (instance) {
10354
- if (!instance.id) {
10355
- instance.id = PaginationService.DEFAULT_ID;
10356
- }
10357
- if (!this.instances[instance.id]) {
10358
- this.instances[instance.id] = instance;
10359
- this.change.next(instance.id);
10360
- }
10361
- else {
10362
- var changed = this.updateInstance(instance);
10363
- if (changed) {
10364
- this.change.next(instance.id);
10365
- }
10366
- }
10367
- };
10368
- // Returns the current page number.
10369
- PaginationService.prototype.getCurrentPage = function (id) {
10370
- if (this.instances[id]) {
10371
- return this.instances[id].currentPage;
10372
- }
10373
- };
10374
- // Sets the current page number.
10375
- PaginationService.prototype.setCurrentPage = function (id, page) {
10376
- if (this.instances[id]) {
10377
- var instance = this.instances[id];
10378
- var maxPage = Math.ceil(instance.totalItems / instance.itemsPerPage);
10379
- if (page <= maxPage && 1 <= page) {
10380
- this.instances[id].currentPage = page;
10381
- this.change.next(id);
10382
- }
10383
- }
10384
- };
10385
- // Sets the value of instance.totalItems
10386
- PaginationService.prototype.setTotalItems = function (id, totalItems) {
10387
- if (this.instances[id] && 0 <= totalItems) {
10388
- this.instances[id].totalItems = totalItems;
10389
- this.change.next(id);
10390
- }
10391
- };
10392
- // Sets the value of instance.itemsPerPage.
10393
- PaginationService.prototype.setItemsPerPage = function (id, itemsPerPage) {
10394
- if (this.instances[id]) {
10395
- this.instances[id].itemsPerPage = itemsPerPage;
10396
- this.change.next(id);
10397
- }
10398
- };
10399
- /**
10400
- * Returns a clone of the pagination instance object matching the id. If no
10401
- * id specified, returns the instance corresponding to the default id.
10402
- */
10403
- PaginationService.prototype.getInstance = function (id) {
10404
- if (id === void 0) { id = PaginationService.DEFAULT_ID; }
10405
- if (this.instances[id]) {
10406
- return ObjectUtils.GetShallowClone(this.instances[id]);
10407
- }
10408
- return {};
10409
- };
10410
- /**
10411
- * Check each property of the instance and update any that have changed. Return
10412
- * true if any changes were made, else return false.
10413
- */
10414
- PaginationService.prototype.updateInstance = function (instance) {
10415
- var changed = false;
10416
- for (var prop in this.instances[instance.id]) {
10417
- if (instance[prop] !== this.instances[instance.id][prop]) {
10418
- this.instances[instance.id][prop] = instance[prop];
10419
- changed = true;
10420
- }
10421
- }
10422
- return changed;
10423
- };
10424
- return PaginationService;
10425
- }());
10426
- PaginationService.DEFAULT_ID = "DEFAULT_PAGINATION_ID";
10427
- PaginationService.decorators = [
10428
- { type: core.Injectable }
10429
- ];
10430
- PaginationService.ctorParameters = function () { return []; };
10431
-
10432
10354
  var LARGE_NUMBER = 999999999;
10433
10355
  var PaginatePipe = /** @class */ (function () {
10434
- function PaginatePipe(paginateService) {
10435
- this.paginateService = paginateService;
10356
+ function PaginatePipe() {
10436
10357
  // store the values from the last time the pipe
10437
10358
  this.state = {};
10438
10359
  }
@@ -10442,7 +10363,7 @@
10442
10363
  // use the cached data from the `state` object to prevent the NgFor
10443
10364
  // from flashing empty until the real values arrive.
10444
10365
  if (!(collection instanceof Array)) {
10445
- var _id = args.id || this.paginateService.DEFAULT_ID;
10366
+ var _id = args.id;
10446
10367
  if (this.state[_id]) {
10447
10368
  return this.state[_id].slice;
10448
10369
  }
@@ -10456,7 +10377,6 @@
10456
10377
  var start;
10457
10378
  var end;
10458
10379
  var perPage = instance.itemsPerPage;
10459
- this.paginateService.register(instance);
10460
10380
  if (!serverSideMode && collection instanceof Array) {
10461
10381
  perPage = perPage || LARGE_NUMBER;
10462
10382
  start = (instance.currentPage - 1) * perPage;
@@ -10468,7 +10388,6 @@
10468
10388
  else {
10469
10389
  var slice = collection.slice(start, end);
10470
10390
  this._saveState(id, collection, slice, start, end);
10471
- this.paginateService.change.next(id);
10472
10391
  return slice;
10473
10392
  }
10474
10393
  }
@@ -10482,7 +10401,7 @@
10482
10401
  var config = args;
10483
10402
  this._checkConfig(config);
10484
10403
  return {
10485
- id: config.id || this.paginateService.DEFAULT_ID,
10404
+ id: config.id,
10486
10405
  itemsPerPage: config.itemsPerPage || 0,
10487
10406
  currentPage: config.currentPage || 1,
10488
10407
  totalItems: config.totalItems || collection.length
@@ -10529,10 +10448,98 @@
10529
10448
  name: 'paginate',
10530
10449
  pure: false
10531
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 }
10532
10541
  ];
10533
- PaginatePipe.ctorParameters = function () { return [
10534
- { type: PaginationService }
10535
- ]; };
10542
+ PaginationService.ctorParameters = function () { return []; };
10536
10543
 
10537
10544
  var PaginationComponent = /** @class */ (function () {
10538
10545
  function PaginationComponent(_paginationService) {