@colijnit/corecomponents_v12 12.0.48 → 12.0.51

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 (33) hide show
  1. package/bundles/colijnit-corecomponents_v12.umd.js +1075 -986
  2. package/bundles/colijnit-corecomponents_v12.umd.js.map +1 -1
  3. package/colijnit-corecomponents_v12.d.ts +7 -7
  4. package/colijnit-corecomponents_v12.metadata.json +1 -1
  5. package/esm2015/colijnit-corecomponents_v12.js +8 -8
  6. package/esm2015/lib/components/input-search/input-search.component.js +17 -7
  7. package/esm2015/lib/components/input-text/input-text.component.js +2 -2
  8. package/esm2015/lib/components/pagination/pagination.component.js +12 -12
  9. package/esm2015/lib/components/pagination/pagination.module.js +6 -4
  10. package/esm2015/lib/components/pagination-bar/pagination-bar.component.js +63 -0
  11. package/esm2015/lib/components/pagination-bar/pagination-bar.module.js +19 -0
  12. package/esm2015/lib/components/simple-grid/simple-grid.component.js +10 -2
  13. package/esm2015/lib/components/simple-grid/simple-grid.module.js +4 -2
  14. package/esm2015/public-api.js +3 -1
  15. package/fesm2015/colijnit-corecomponents_v12.js +1037 -941
  16. package/fesm2015/colijnit-corecomponents_v12.js.map +1 -1
  17. package/lib/components/input-search/input-search.component.d.ts +3 -2
  18. package/lib/components/input-text/style/_layout.scss +5 -2
  19. package/lib/components/pagination/pagination.component.d.ts +2 -5
  20. package/lib/components/pagination/style/_layout.scss +0 -70
  21. package/lib/components/pagination/style/material.scss +1 -0
  22. package/lib/components/pagination-bar/pagination-bar.component.d.ts +21 -0
  23. package/lib/components/pagination-bar/pagination-bar.module.d.ts +2 -0
  24. package/lib/components/pagination-bar/style/_layout.scss +67 -0
  25. package/lib/components/pagination-bar/style/_material-definition.scss +3 -0
  26. package/lib/components/pagination-bar/style/_theme.scss +24 -0
  27. package/lib/components/pagination-bar/style/material.scss +3 -0
  28. package/lib/components/simple-grid/simple-grid.component.d.ts +3 -0
  29. package/lib/components/simple-grid/style/_material-definition.scss +2 -0
  30. package/lib/components/simple-grid/style/_theme.scss +4 -0
  31. package/lib/components/simple-grid/style/material.scss +1 -0
  32. package/package.json +1 -1
  33. package/public-api.d.ts +2 -0
@@ -7265,7 +7265,7 @@
7265
7265
  InputTextComponent.decorators = [
7266
7266
  { type: core.Component, args: [{
7267
7267
  selector: "co-input-text",
7268
- template: "\n <label *ngIf=\"showPlaceholderOnFocus || (!showPlaceholderOnFocus && !hasValue && !focused)\" [textContent]=\"placeholder\"></label>\n <co-icon *ngIf=\"leftIcon\" class=\"input-text-left-icon\" [icon]=\"leftIcon\"></co-icon>\n <input #input\n [type]=\"type\"\n [ngModel]=\"model\"\n [min]=\"type === 'number' && this.min ? this.min : undefined\"\n [max]=\"type === 'number' && this.max ? this.max : undefined\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n (ngModelChange)=\"modelChange.emit($event)\"\n >\n <co-icon *ngIf=\"rightIcon\" class=\"input-text-right-icon\" [icon]=\"rightIcon\"></co-icon>\n <co-commit-buttons *ngIf=\"showSaveCancel && focused && canSaveOrCancel\"\n [committing]=\"committing\"\n [commitFinished]=\"commitFinished\"\n (commitClick)=\"commitClick($event)\"\n (cancelClick)=\"cancelClick($event)\"\n >\n </co-commit-buttons>\n <div class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
7268
+ template: "\n <label *ngIf=\"showPlaceholderOnFocus || (!showPlaceholderOnFocus && !hasValue && !focused)\" [textContent]=\"placeholder\"></label>\n <co-icon *ngIf=\"leftIcon\" class=\"input-text-left-icon\" [icon]=\"leftIcon\"></co-icon>\n <co-icon *ngIf=\"rightIcon\" class=\"input-text-right-icon\" [icon]=\"rightIcon\"></co-icon>\n <input #input\n [type]=\"type\"\n [ngModel]=\"model\"\n [min]=\"type === 'number' && this.min ? this.min : undefined\"\n [max]=\"type === 'number' && this.max ? this.max : undefined\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n (ngModelChange)=\"modelChange.emit($event)\"\n >\n <co-commit-buttons *ngIf=\"showSaveCancel && focused && canSaveOrCancel\"\n [committing]=\"committing\"\n [commitFinished]=\"commitFinished\"\n (commitClick)=\"commitClick($event)\"\n (cancelClick)=\"cancelClick($event)\"\n >\n </co-commit-buttons>\n <div class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
7269
7269
  providers: [{
7270
7270
  provide: COMPONENT_INTERFACE_NAME,
7271
7271
  useExisting: core.forwardRef(function () { return InputTextComponent; })
@@ -7551,9 +7551,10 @@
7551
7551
  function InputSearchComponent() {
7552
7552
  var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
7553
7553
  _this.searchIcon = exports.CoreComponentsIcon.Magnifier;
7554
- _this.iconRight = false;
7555
- _this.noIcon = false;
7556
7554
  _this.search = new core.EventEmitter();
7555
+ _this.useLeftIcon = false;
7556
+ _this.useRightIcon = false;
7557
+ _this.noIcon = false;
7557
7558
  return _this;
7558
7559
  }
7559
7560
  InputSearchComponent.prototype.showClass = function () {
@@ -7572,18 +7573,25 @@
7572
7573
  InputSearchComponent.decorators = [
7573
7574
  { type: core.Component, args: [{
7574
7575
  selector: 'co-input-search',
7575
- template: "\n <co-input-text\n [model]=\"model\"\n [leftIcon]=\"!iconRight && !noIcon ? searchIcon : undefined\"\n [rightIcon]=\"iconRight && !noIcon ? searchIcon : undefined\"\n [placeholder]=\"placeholder\"\n [showPlaceholderOnFocus]=\"false\"\n (modelChange)=\"modelChange.emit($event)\"\n ></co-input-text>\n ",
7576
+ 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 ",
7576
7577
  changeDetection: core.ChangeDetectionStrategy.OnPush,
7577
7578
  encapsulation: core.ViewEncapsulation.None
7578
7579
  },] }
7579
7580
  ];
7580
7581
  InputSearchComponent.propDecorators = {
7581
7582
  placeholder: [{ type: core.Input }],
7582
- iconRight: [{ type: core.Input }],
7583
- noIcon: [{ type: core.HostBinding, args: ['class.no-icon',] }, { type: core.Input }],
7584
7583
  search: [{ type: core.Output }],
7584
+ useLeftIcon: [{ type: core.Input }],
7585
+ useRightIcon: [{ type: core.Input }],
7586
+ noIcon: [{ type: core.HostBinding, args: ['class.no-icon',] }, { type: core.Input }],
7585
7587
  showClass: [{ type: core.HostBinding, args: ['class.co-input-search',] }]
7586
- };
7588
+ };
7589
+ __decorate([
7590
+ InputBoolean()
7591
+ ], InputSearchComponent.prototype, "useLeftIcon", void 0);
7592
+ __decorate([
7593
+ InputBoolean()
7594
+ ], InputSearchComponent.prototype, "useRightIcon", void 0);
7587
7595
 
7588
7596
  var InputSearchModule = /** @class */ (function () {
7589
7597
  function InputSearchModule() {
@@ -9495,10 +9503,12 @@
9495
9503
  _this.showAdd = false;
9496
9504
  _this.showDelete = false;
9497
9505
  _this.rightToolbar = false;
9506
+ _this.rowsPerPage = 1000;
9498
9507
  _this.editing = false;
9499
9508
  _this.editRowIndex = -1;
9500
9509
  _this.editCellIndex = -1;
9501
9510
  _this.selectedRowIndex = -1;
9511
+ _this.currentPage = 1;
9502
9512
  _this._doubleClicked = false;
9503
9513
  _this._newRow = false;
9504
9514
  return _this;
@@ -9765,6 +9775,10 @@
9765
9775
  }
9766
9776
  this._detectChanges();
9767
9777
  };
9778
+ SimpleGridComponent.prototype.pageChange = function (page) {
9779
+ this.currentPage = page;
9780
+ //this.gridBody.nativeElement.scrollTop = 0;
9781
+ };
9768
9782
  SimpleGridComponent.prototype._detectChanges = function () {
9769
9783
  this._changeDetection.detectChanges();
9770
9784
  };
@@ -9773,7 +9787,7 @@
9773
9787
  SimpleGridComponent.decorators = [
9774
9788
  { type: core.Component, args: [{
9775
9789
  selector: 'co-simple-grid',
9776
- 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 data; 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 ",
9790
+ 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 *ngIf=\"data?.length > rowsPerPage\" [autoHide]=\"true\" (pageChange)=\"pageChange($event)\"></co-pagination>\n ",
9777
9791
  providers: [
9778
9792
  FormMasterService
9779
9793
  ],
@@ -9790,1128 +9804,1201 @@
9790
9804
  showAdd: [{ type: core.Input }],
9791
9805
  showDelete: [{ type: core.Input }],
9792
9806
  rightToolbar: [{ type: core.Input }],
9807
+ rowsPerPage: [{ type: core.Input }],
9793
9808
  showClass: [{ type: core.HostBinding, args: ['class.co-simple-grid',] }],
9794
9809
  handleKeyDown: [{ type: core.HostListener, args: ['keydown', ['$event'],] }]
9795
9810
  };
9796
9811
 
9797
- var SimpleGridCellComponent = /** @class */ (function () {
9798
- function SimpleGridCellComponent(_changeDetector) {
9799
- this._changeDetector = _changeDetector;
9800
- this.defaultTextAlign = exports.ColumnAlign.Left;
9801
- this.editMode = false;
9802
- this.cellClick = new core.EventEmitter();
9803
- this._fieldEditMode = false;
9804
- this._focused = false;
9812
+ var PaginationBarComponent = /** @class */ (function () {
9813
+ function PaginationBarComponent() {
9814
+ this.pages = [];
9815
+ this.directionLinks = true;
9816
+ this.previousLabel = 'Vorige pagina';
9817
+ this.nextLabel = 'Volgende pagina';
9818
+ this.currentPage = 1;
9819
+ this.previousClick = new core.EventEmitter();
9820
+ this.nextClick = new core.EventEmitter();
9821
+ this.pageClick = new core.EventEmitter();
9805
9822
  }
9806
- Object.defineProperty(SimpleGridCellComponent.prototype, "editTemplateContent", {
9807
- set: function (template) {
9808
- if (template) {
9809
- this._editTemplate = template;
9810
- this._setFocusComponent();
9811
- }
9812
- },
9813
- enumerable: false,
9814
- configurable: true
9815
- });
9816
- Object.defineProperty(SimpleGridCellComponent.prototype, "noEditTemplateContent", {
9817
- set: function (template) {
9818
- if (template) {
9819
- this._template = template;
9820
- this._setFocusComponent();
9821
- }
9822
- },
9823
- enumerable: false,
9824
- configurable: true
9825
- });
9826
- Object.defineProperty(SimpleGridCellComponent.prototype, "noTemplateContent", {
9827
- set: function (template) {
9828
- if (template) {
9829
- this._inputTemplate = template;
9830
- this._setFocusComponent();
9831
- }
9832
- },
9833
- enumerable: false,
9834
- configurable: true
9835
- });
9836
- Object.defineProperty(SimpleGridCellComponent.prototype, "fieldEditMode", {
9823
+ PaginationBarComponent.prototype.showClass = function () {
9824
+ return true;
9825
+ };
9826
+ PaginationBarComponent.prototype.isOnFirstPage = function () {
9827
+ return this.currentPage === 1;
9828
+ };
9829
+ PaginationBarComponent.prototype.isOnLastPage = function () {
9830
+ return this.pages.length === this.currentPage;
9831
+ };
9832
+ PaginationBarComponent.prototype.onPreviousClick = function () {
9833
+ this.previousClick.emit();
9834
+ };
9835
+ PaginationBarComponent.prototype.onNextClick = function () {
9836
+ this.nextClick.emit();
9837
+ };
9838
+ PaginationBarComponent.prototype.onPageClick = function (value) {
9839
+ this.currentPage = value;
9840
+ this.pageClick.emit(value);
9841
+ };
9842
+ return PaginationBarComponent;
9843
+ }());
9844
+ PaginationBarComponent.decorators = [
9845
+ { type: core.Component, args: [{
9846
+ selector: "co-pagination-bar",
9847
+ template: "\n <ul class=\"pagination\">\n <li *ngIf=\"directionLinks\" class=\"pagination-previous\">\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\">\n <a (click)=\"onNextClick()\" [class.disabled]=\"isOnLastPage()\">{{ nextLabel }}</a>\n </li>\n </ul>\n ",
9848
+ encapsulation: core.ViewEncapsulation.None
9849
+ },] }
9850
+ ];
9851
+ PaginationBarComponent.propDecorators = {
9852
+ pages: [{ type: core.Input }],
9853
+ directionLinks: [{ type: core.Input }],
9854
+ previousLabel: [{ type: core.Input }],
9855
+ nextLabel: [{ type: core.Input }],
9856
+ currentPage: [{ type: core.Input }],
9857
+ previousClick: [{ type: core.Output }],
9858
+ nextClick: [{ type: core.Output }],
9859
+ pageClick: [{ type: core.Output }],
9860
+ showClass: [{ type: core.HostBinding, args: ["class.co-pagination-bar",] }]
9861
+ };
9862
+
9863
+ var PaginationBarModule = /** @class */ (function () {
9864
+ function PaginationBarModule() {
9865
+ }
9866
+ return PaginationBarModule;
9867
+ }());
9868
+ PaginationBarModule.decorators = [
9869
+ { type: core.NgModule, args: [{
9870
+ imports: [
9871
+ common.CommonModule
9872
+ ],
9873
+ declarations: [
9874
+ PaginationBarComponent
9875
+ ],
9876
+ exports: [
9877
+ PaginationBarComponent
9878
+ ]
9879
+ },] }
9880
+ ];
9881
+
9882
+ var PaginationService = /** @class */ (function () {
9883
+ function PaginationService() {
9884
+ this.change = new rxjs.Subject();
9885
+ this.instances = {};
9886
+ }
9887
+ Object.defineProperty(PaginationService.prototype, "DEFAULT_ID", {
9837
9888
  get: function () {
9838
- return this._fieldEditMode;
9839
- },
9840
- set: function (value) {
9841
- this._fieldEditMode = value;
9842
- this._setFocusComponent();
9889
+ return PaginationService.DEFAULT_ID;
9843
9890
  },
9844
9891
  enumerable: false,
9845
9892
  configurable: true
9846
9893
  });
9847
- SimpleGridCellComponent.prototype.showClass = function () {
9848
- return true;
9849
- };
9850
- SimpleGridCellComponent.prototype.handleClick = function (event) {
9851
- if (this.column && !this.column.readonly) {
9852
- this.cellClick.next();
9894
+ PaginationService.prototype.register = function (instance) {
9895
+ if (!instance.id) {
9896
+ instance.id = PaginationService.DEFAULT_ID;
9853
9897
  }
9854
- };
9855
- SimpleGridCellComponent.prototype._setFocusComponent = function () {
9856
- if (this.editMode && this.fieldEditMode) {
9857
- var element = this._getElement();
9858
- if (element) {
9859
- var focusEvent = this._createNewEvent(element, 'focus');
9860
- element.focus();
9861
- element.dispatchEvent(focusEvent);
9862
- this._focused = true;
9863
- }
9898
+ if (!this.instances[instance.id]) {
9899
+ this.instances[instance.id] = instance;
9900
+ this.change.next(instance.id);
9864
9901
  }
9865
9902
  else {
9866
- if (this._focused) {
9867
- var element = this._getElement();
9868
- if (element) {
9869
- var blurEvent = this._createNewEvent(element, 'blur');
9870
- element.blur();
9871
- element.dispatchEvent(blurEvent);
9872
- }
9873
- this._focused = false;
9903
+ var changed = this.updateInstance(instance);
9904
+ if (changed) {
9905
+ this.change.next(instance.id);
9874
9906
  }
9875
9907
  }
9876
- this._detectChanges();
9877
9908
  };
9878
- SimpleGridCellComponent.prototype._getFirstFormInput = function (parent) {
9879
- if (parent) {
9880
- var collection_1 = Array.from(parent.getElementsByTagName('input'));
9881
- var otherCollection = Array.from(parent.getElementsByTagName('textarea'));
9882
- otherCollection.map(function (o) { return collection_1.push(o); });
9883
- if (collection_1.length > 0) {
9884
- return collection_1[0];
9885
- }
9909
+ // Returns the current page number.
9910
+ PaginationService.prototype.getCurrentPage = function (id) {
9911
+ if (this.instances[id]) {
9912
+ return this.instances[id].currentPage;
9886
9913
  }
9887
9914
  };
9888
- SimpleGridCellComponent.prototype._createNewEvent = function (element, eventType) {
9889
- var event;
9890
- if ("createEvent" in document) {
9891
- event = document.createEvent("Event");
9892
- event.initEvent(eventType, true, true);
9893
- }
9894
- else if ("Event" in window) {
9895
- event = new Event(eventType, { bubbles: true, cancelable: true });
9915
+ // Sets the current page number.
9916
+ PaginationService.prototype.setCurrentPage = function (id, page) {
9917
+ if (this.instances[id]) {
9918
+ var instance = this.instances[id];
9919
+ var maxPage = Math.ceil(instance.totalItems / instance.itemsPerPage);
9920
+ if (page <= maxPage && 1 <= page) {
9921
+ this.instances[id].currentPage = page;
9922
+ this.change.next(id);
9923
+ }
9896
9924
  }
9897
- return event;
9898
9925
  };
9899
- SimpleGridCellComponent.prototype._getElement = function () {
9900
- var templ;
9901
- if (this._editTemplate) {
9902
- templ = this._editTemplate;
9926
+ // Sets the value of instance.totalItems
9927
+ PaginationService.prototype.setTotalItems = function (id, totalItems) {
9928
+ if (this.instances[id] && 0 <= totalItems) {
9929
+ this.instances[id].totalItems = totalItems;
9930
+ this.change.next(id);
9903
9931
  }
9904
- else if (this._template) {
9905
- templ = this._template;
9932
+ };
9933
+ // Sets the value of instance.itemsPerPage.
9934
+ PaginationService.prototype.setItemsPerPage = function (id, itemsPerPage) {
9935
+ if (this.instances[id]) {
9936
+ this.instances[id].itemsPerPage = itemsPerPage;
9937
+ this.change.next(id);
9906
9938
  }
9907
- else {
9908
- templ = this._inputTemplate;
9939
+ };
9940
+ /**
9941
+ * Returns a clone of the pagination instance object matching the id. If no
9942
+ * id specified, returns the instance corresponding to the default id.
9943
+ */
9944
+ PaginationService.prototype.getInstance = function (id) {
9945
+ if (id === void 0) { id = PaginationService.DEFAULT_ID; }
9946
+ if (this.instances[id]) {
9947
+ return ObjectUtils.GetShallowClone(this.instances[id]);
9909
9948
  }
9910
- if (templ) {
9911
- if (templ && templ.elementRef) {
9912
- var inputElement = this._getFirstFormInput(templ.elementRef.nativeElement.parentElement);
9913
- if (inputElement) {
9914
- return inputElement;
9915
- }
9949
+ return {};
9950
+ };
9951
+ /**
9952
+ * Check each property of the instance and update any that have changed. Return
9953
+ * true if any changes were made, else return false.
9954
+ */
9955
+ PaginationService.prototype.updateInstance = function (instance) {
9956
+ var changed = false;
9957
+ for (var prop in this.instances[instance.id]) {
9958
+ if (instance[prop] !== this.instances[instance.id][prop]) {
9959
+ this.instances[instance.id][prop] = instance[prop];
9960
+ changed = true;
9916
9961
  }
9917
9962
  }
9963
+ return changed;
9918
9964
  };
9919
- SimpleGridCellComponent.prototype._detectChanges = function () {
9920
- this._changeDetector.detectChanges();
9921
- };
9922
- return SimpleGridCellComponent;
9965
+ return PaginationService;
9923
9966
  }());
9924
- SimpleGridCellComponent.decorators = [
9925
- { type: core.Component, args: [{
9926
- selector: "co-simple-grid-cell",
9927
- template: "\n <div class=\"simple-grid-column-cell-value\" [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\">\n <ng-container *ngIf=\"editMode; else noInlineEdit\">\n <ng-container #editTemplate *ngIf=\"column.editTemplate; else noEditTemplate\"\n [ngTemplateOutlet]=\"column.editTemplate\"\n [ngTemplateOutletContext]=\"{value: row[column.field], row: row}\"></ng-container>\n <ng-template #noEditTemplate>\n <ng-container *ngIf=\"column.template; else noTemplate\">\n <ng-container [ngTemplateOutlet]=\"column.template\"\n [ngTemplateOutletContext]=\"{value: row[column.field], row: row}\"></ng-container>\n </ng-container>\n <ng-template #noTemplate>\n <co-input-text [(model)]=\"row[column.field]\" [required]=\"column.required\"></co-input-text>\n </ng-template>\n </ng-template>\n </ng-container>\n <ng-template #noInlineEdit>\n <ng-container *ngIf=\"column.template; else noTemplate\">\n <ng-container [ngTemplateOutlet]=\"column.template\"\n [ngTemplateOutletContext]=\"{value: row[column.field], row: row}\"></ng-container>\n </ng-container>\n <ng-template #noTemplate>\n <span [textContent]=\"column.getFieldValue(row[column.field])\"></span>\n </ng-template>\n </ng-template>\n </div>\n ",
9928
- encapsulation: core.ViewEncapsulation.None
9929
- },] }
9967
+ PaginationService.DEFAULT_ID = "DEFAULT_PAGINATION_ID";
9968
+ PaginationService.decorators = [
9969
+ { type: core.Injectable }
9930
9970
  ];
9931
- SimpleGridCellComponent.ctorParameters = function () { return [
9932
- { type: core.ChangeDetectorRef }
9933
- ]; };
9934
- SimpleGridCellComponent.propDecorators = {
9935
- editTemplateContent: [{ type: core.ViewChild, args: ["editTemplate", { read: BaseInputComponent },] }],
9936
- noEditTemplateContent: [{ type: core.ViewChild, args: ["noEditTemplate",] }],
9937
- noTemplateContent: [{ type: core.ViewChild, args: ["noTemplate",] }],
9938
- column: [{ type: core.Input }],
9939
- row: [{ type: core.Input }],
9940
- editMode: [{ type: core.Input }],
9941
- fieldEditMode: [{ type: core.Input }],
9942
- cellClick: [{ type: core.Output }],
9943
- showClass: [{ type: core.HostBinding, args: ["class.co-simple-grid-cell",] }],
9944
- handleClick: [{ type: core.HostListener, args: ['click', ['$event'],] }]
9945
- };
9971
+ PaginationService.ctorParameters = function () { return []; };
9946
9972
 
9947
- var ObserveVisibilityDirective = /** @class */ (function () {
9948
- function ObserveVisibilityDirective(_element) {
9949
- this._element = _element;
9950
- this.debounceTime = 0;
9951
- this.threshold = 0;
9952
- this.visible = new core.EventEmitter();
9953
- this._subject = new rxjs.Subject();
9973
+ var LARGE_NUMBER = 999999999;
9974
+ var PaginatePipe = /** @class */ (function () {
9975
+ function PaginatePipe(paginateService) {
9976
+ this.paginateService = paginateService;
9977
+ // store the values from the last time the pipe
9978
+ this.state = {};
9954
9979
  }
9955
- ObserveVisibilityDirective.prototype.ngOnInit = function () {
9956
- this._createObserver();
9957
- };
9958
- ObserveVisibilityDirective.prototype.ngAfterViewInit = function () {
9959
- this._startObservingElements();
9960
- };
9961
- ObserveVisibilityDirective.prototype.ngOnDestroy = function () {
9962
- if (this._observer) {
9963
- this._observer.disconnect();
9964
- this._observer = undefined;
9980
+ PaginatePipe.prototype.transform = function (collection, args) {
9981
+ // When an observable is passed through the AsyncPipe, it will output
9982
+ // `null` until the subscription resolves. In this case, we want to
9983
+ // use the cached data from the `state` object to prevent the NgFor
9984
+ // from flashing empty until the real values arrive.
9985
+ if (!(collection instanceof Array)) {
9986
+ var _id = args.id || this.paginateService.DEFAULT_ID;
9987
+ if (this.state[_id]) {
9988
+ return this.state[_id].slice;
9989
+ }
9990
+ else {
9991
+ return collection;
9992
+ }
9965
9993
  }
9966
- this._subject.next();
9967
- this._subject.complete();
9994
+ var serverSideMode = args.totalItems !== undefined;
9995
+ var instance = this._createInstance(collection, args);
9996
+ var id = instance.id;
9997
+ var start;
9998
+ var end;
9999
+ var perPage = instance.itemsPerPage;
10000
+ this.paginateService.register(instance);
10001
+ if (!serverSideMode && collection instanceof Array) {
10002
+ perPage = perPage || LARGE_NUMBER;
10003
+ start = (instance.currentPage - 1) * perPage;
10004
+ end = start + perPage;
10005
+ var isIdentical = this._stateIsIdentical(id, collection, start, end);
10006
+ if (isIdentical) {
10007
+ return this.state[id].slice;
10008
+ }
10009
+ else {
10010
+ var slice = collection.slice(start, end);
10011
+ this._saveState(id, collection, slice, start, end);
10012
+ this.paginateService.change.next(id);
10013
+ return slice;
10014
+ }
10015
+ }
10016
+ // save the state for server-side collection to avoid null
10017
+ // flash as new data loads.
10018
+ this._saveState(id, collection, collection, start, end);
10019
+ return collection;
9968
10020
  };
9969
- ObserveVisibilityDirective.prototype._isVisible = function (element) {
9970
- var _this = this;
9971
- return new Promise(function (resolve) {
9972
- var observer = new IntersectionObserver(function (_a) {
9973
- var _b = __read(_a, 1), entry = _b[0];
9974
- resolve(entry.isIntersecting && entry.intersectionRatio >= _this.threshold);
9975
- observer.disconnect();
9976
- });
9977
- observer.observe(element);
9978
- });
10021
+ // Create an IPaginationInstance object, using defaults for any optional properties not supplied.
10022
+ PaginatePipe.prototype._createInstance = function (collection, args) {
10023
+ var config = args;
10024
+ this._checkConfig(config);
10025
+ return {
10026
+ id: config.id || this.paginateService.DEFAULT_ID,
10027
+ itemsPerPage: config.itemsPerPage || 0,
10028
+ currentPage: config.currentPage || 1,
10029
+ totalItems: config.totalItems || collection.length
10030
+ };
9979
10031
  };
9980
- ObserveVisibilityDirective.prototype._createObserver = function () {
9981
- var _this = this;
9982
- var options = {
9983
- rootMargin: '0px',
9984
- threshold: this.threshold,
10032
+ // Ensure the argument passed to the filter contains the required properties.
10033
+ PaginatePipe.prototype._checkConfig = function (config) {
10034
+ var required = ["itemsPerPage", "currentPage"];
10035
+ var missing = required.filter(function (prop) { return !config.hasOwnProperty(prop); });
10036
+ if (0 < missing.length) {
10037
+ throw new Error("PaginatePipe: Argument is missing the following required properties: " + missing.join(", "));
10038
+ }
10039
+ };
10040
+ /**
10041
+ * To avoid returning a brand new array each time the pipe is run, we store the state of the sliced
10042
+ * array for a given id. This means that the next time the pipe is run on this collection & id, we just
10043
+ * need to check that the collection, start and end points are all identical, and if so, return the
10044
+ * last sliced array.
10045
+ */
10046
+ PaginatePipe.prototype._saveState = function (id, collection, slice, start, end) {
10047
+ this.state[id] = {
10048
+ collection: collection,
10049
+ size: collection.length,
10050
+ slice: slice,
10051
+ start: start,
10052
+ end: end
9985
10053
  };
9986
- var isIntersecting = function (entry) { return entry.isIntersecting || entry.intersectionRatio > 0; };
9987
- this._observer = new IntersectionObserver(function (entries, observer) {
9988
- entries.forEach(function (entry) {
9989
- if (isIntersecting(entry)) {
9990
- _this._subject.next({ entry: entry, observer: observer });
9991
- }
9992
- });
9993
- }, options);
9994
10054
  };
9995
- ObserveVisibilityDirective.prototype._startObservingElements = function () {
9996
- var _this = this;
9997
- if (!this._observer) {
9998
- return;
10055
+ // For a given id, returns true if the collection, size, start and end values are identical.
10056
+ PaginatePipe.prototype._stateIsIdentical = function (id, collection, start, end) {
10057
+ var state = this.state[id];
10058
+ if (!state) {
10059
+ return false;
9999
10060
  }
10000
- this._observer.observe(this._element.nativeElement);
10001
- this._subject
10002
- .pipe(operators.delay(this.debounceTime), operators.filter(Boolean))
10003
- .subscribe(function (_a) {
10004
- var entry = _a.entry, observer = _a.observer;
10005
- return __awaiter(_this, void 0, void 0, function () {
10006
- var target, isStillVisible;
10007
- return __generator(this, function (_a) {
10008
- switch (_a.label) {
10009
- case 0:
10010
- target = entry.target;
10011
- return [4 /*yield*/, this._isVisible(target)];
10012
- case 1:
10013
- isStillVisible = _a.sent();
10014
- if (isStillVisible) {
10015
- this.visible.emit(target);
10016
- observer.unobserve(target);
10017
- }
10018
- return [2 /*return*/];
10019
- }
10020
- });
10021
- });
10022
- });
10061
+ return state.collection === collection &&
10062
+ state.size === collection.length &&
10063
+ state.start === start &&
10064
+ state.end === end;
10023
10065
  };
10024
- return ObserveVisibilityDirective;
10066
+ return PaginatePipe;
10025
10067
  }());
10026
- ObserveVisibilityDirective.decorators = [
10027
- { type: core.Directive, args: [{
10028
- selector: '[observeVisibility]',
10068
+ PaginatePipe.decorators = [
10069
+ { type: core.Pipe, args: [{
10070
+ name: 'paginate',
10071
+ pure: false
10029
10072
  },] }
10030
10073
  ];
10031
- ObserveVisibilityDirective.ctorParameters = function () { return [
10032
- { type: core.ElementRef }
10033
- ]; };
10034
- ObserveVisibilityDirective.propDecorators = {
10035
- debounceTime: [{ type: core.Input }],
10036
- threshold: [{ type: core.Input }],
10037
- visible: [{ type: core.Output }]
10038
- };
10039
-
10040
- var ObserveVisibilityModule = /** @class */ (function () {
10041
- function ObserveVisibilityModule() {
10042
- }
10043
- return ObserveVisibilityModule;
10044
- }());
10045
- ObserveVisibilityModule.decorators = [
10046
- { type: core.NgModule, args: [{
10047
- declarations: [
10048
- ObserveVisibilityDirective
10049
- ],
10050
- exports: [
10051
- ObserveVisibilityDirective
10052
- ]
10053
- },] }
10054
- ];
10055
-
10056
- var SimpleGridModule = /** @class */ (function () {
10057
- function SimpleGridModule() {
10058
- }
10059
- return SimpleGridModule;
10060
- }());
10061
- SimpleGridModule.decorators = [
10062
- { type: core.NgModule, args: [{
10063
- imports: [
10064
- common.CommonModule,
10065
- dragDrop.DragDropModule,
10066
- GridToolbarModule,
10067
- InputTextModule,
10068
- FormModule,
10069
- ObserveVisibilityModule
10070
- ],
10071
- declarations: [
10072
- SimpleGridComponent,
10073
- SimpleGridCellComponent,
10074
- SimpleGridColumnDirective
10075
- ],
10076
- exports: [
10077
- SimpleGridComponent,
10078
- SimpleGridCellComponent,
10079
- SimpleGridColumnDirective
10080
- ]
10081
- },] }
10082
- ];
10074
+ PaginatePipe.ctorParameters = function () { return [
10075
+ { type: PaginationService }
10076
+ ]; };
10083
10077
 
10084
- var FilterItemComponent = /** @class */ (function () {
10085
- function FilterItemComponent(iconService) {
10086
- this.iconService = iconService;
10087
- this.icons = exports.CoreComponentsIcon;
10088
- this.initialLimit = 10;
10089
- this.expanded = false;
10090
- // Set to false to use filter item with a multi selectable collection. Set to true to specify custom content
10091
- this.customContent = false;
10092
- // Set to true to show all results. Set to false to get 'show more' and 'show less' buttons to expand and contract.
10093
- this.showAllResults = false;
10094
- this.singleSelect = false;
10095
- this.searchPlaceholder = 'Search...';
10096
- this.showMoreLabel = 'Show more';
10097
- this.showLessLabel = 'Show less';
10098
- this.noResultsLabel = "No results";
10099
- this.collectionChange = new core.EventEmitter();
10100
- this.filteredCollection = [];
10101
- this.limitTo = 10;
10102
- this.filterText = "";
10103
- this._collection = [];
10078
+ var PaginationComponent = /** @class */ (function () {
10079
+ function PaginationComponent(_paginationService) {
10080
+ var _this = this;
10081
+ this._paginationService = _paginationService;
10082
+ this.maxSize = 7;
10083
+ this.directionLinks = true;
10084
+ this.previousLabel = 'Vorige pagina';
10085
+ this.nextLabel = 'Volgende pagina';
10086
+ this.autoHide = false;
10087
+ // Emits the new page number.
10088
+ this.pageChange = new core.EventEmitter();
10089
+ this.showClass = true;
10090
+ this.pages = [];
10091
+ this.changeSub = this._paginationService.change.subscribe(function (id) {
10092
+ if (_this.id === id) {
10093
+ _this._updatePageLinks();
10094
+ }
10095
+ });
10104
10096
  }
10105
- Object.defineProperty(FilterItemComponent.prototype, "collection", {
10106
- get: function () {
10107
- return this._collection;
10108
- },
10109
- set: function (value) {
10110
- var _a;
10111
- this._collection = value;
10112
- this.filteredCollection = (_a = this._collection) === null || _a === void 0 ? void 0 : _a.slice();
10113
- },
10114
- enumerable: false,
10115
- configurable: true
10116
- });
10117
- FilterItemComponent.prototype.showClass = function () {
10118
- return true;
10097
+ PaginationComponent.prototype.ngOnInit = function () {
10098
+ if (!this.id) {
10099
+ this.id = this._paginationService.DEFAULT_ID;
10100
+ }
10101
+ this._updatePageLinks();
10119
10102
  };
10120
- FilterItemComponent.prototype.ngOnInit = function () {
10121
- this.setToInitialLimit();
10103
+ PaginationComponent.prototype.ngOnChanges = function () {
10104
+ this._updatePageLinks();
10122
10105
  };
10123
- FilterItemComponent.prototype.setToInitialLimit = function () {
10124
- this.limitTo = this.initialLimit;
10106
+ PaginationComponent.prototype.ngOnDestroy = function () {
10107
+ this.changeSub.unsubscribe();
10125
10108
  };
10126
- FilterItemComponent.prototype.increaseLimit = function () {
10127
- this.limitTo += 10;
10109
+ PaginationComponent.prototype.goToFirstPage = function () {
10110
+ if (!this.isOnFirstPage()) {
10111
+ this.setCurrentPage(1);
10112
+ }
10128
10113
  };
10129
- FilterItemComponent.prototype.moreToShow = function () {
10130
- var _a;
10131
- if (this.showAllResults) {
10132
- return false;
10114
+ PaginationComponent.prototype.goToPreviousPage = function () {
10115
+ if (!this.isOnFirstPage()) {
10116
+ this.setCurrentPage(this.getCurrentPage() - 1);
10133
10117
  }
10134
- return ((_a = this.filteredCollection) === null || _a === void 0 ? void 0 : _a.length) > this.limitTo;
10135
10118
  };
10136
- FilterItemComponent.prototype.lessToShow = function () {
10137
- var _a, _b;
10138
- if (this.showAllResults) {
10119
+ PaginationComponent.prototype.goToNextPage = function () {
10120
+ if (!this.isOnLastPage()) {
10121
+ this.setCurrentPage(this.getCurrentPage() + 1);
10122
+ }
10123
+ };
10124
+ PaginationComponent.prototype.setCurrentPage = function (page) {
10125
+ this.pageChange.emit(page);
10126
+ };
10127
+ PaginationComponent.prototype.isOnFirstPage = function () {
10128
+ return this.getCurrentPage() === 1;
10129
+ };
10130
+ PaginationComponent.prototype.isOnLastPage = function () {
10131
+ return this.getLastPage() === this.getCurrentPage();
10132
+ };
10133
+ PaginationComponent.prototype.shouldBeHidden = function () {
10134
+ if (!this.autoHide) {
10139
10135
  return false;
10140
10136
  }
10141
- return ((_a = this.filteredCollection) === null || _a === void 0 ? void 0 : _a.length) <= this.limitTo && ((_b = this.filteredCollection) === null || _b === void 0 ? void 0 : _b.length) > this.initialLimit;
10137
+ else {
10138
+ var instance = this._paginationService.getInstance();
10139
+ return (instance.totalItems <= instance.itemsPerPage);
10140
+ }
10142
10141
  };
10143
- FilterItemComponent.prototype.handleModelChange = function (model) {
10144
- if (this.singleSelect) {
10145
- this.collection.forEach(function (m) {
10146
- if (m.code !== model.code && m.description !== model.description) {
10147
- m.checked = false;
10148
- }
10149
- });
10142
+ /**
10143
+ * Updates the page links and checks that the current page is valid. Should run whenever the
10144
+ * PaginationService.change stream emits a value matching the current ID, or when any of the
10145
+ * input values changes.
10146
+ */
10147
+ PaginationComponent.prototype._updatePageLinks = function () {
10148
+ var paginationInstance = this._paginationService.getInstance(this.id);
10149
+ this.pages = this.createPageArray(paginationInstance.currentPage, paginationInstance.itemsPerPage, paginationInstance.totalItems, this.maxSize);
10150
+ var correctedCurrentPage = this.outOfBoundCorrection(paginationInstance);
10151
+ if (correctedCurrentPage !== paginationInstance.currentPage) {
10152
+ this.setCurrentPage(correctedCurrentPage);
10150
10153
  }
10151
- model.checked = !model.checked;
10152
- this.collectionChange.emit(this.collection);
10153
10154
  };
10154
- // Applies filter to the collection.
10155
- FilterItemComponent.prototype.applyFilter = function (text) {
10156
- var _a, _b;
10157
- return __awaiter(this, void 0, void 0, function () {
10158
- var _c, filterText, filteredItemCount;
10159
- return __generator(this, function (_d) {
10160
- switch (_d.label) {
10161
- case 0:
10162
- if (!(!isNaN(this.minSearchCharsToLoadCollection) && this.collectionLoadFn)) return [3 /*break*/, 3];
10163
- if (!(text.length === this.minSearchCharsToLoadCollection && text.length > this.filterText.length)) return [3 /*break*/, 2];
10164
- _c = this;
10165
- return [4 /*yield*/, this.collectionLoadFn(text)];
10166
- case 1:
10167
- _c.collection = _d.sent();
10168
- return [3 /*break*/, 3];
10169
- case 2:
10170
- if (text.length < this.minSearchCharsToLoadCollection) {
10171
- this.collection = undefined;
10172
- }
10173
- _d.label = 3;
10174
- case 3:
10175
- this.filterText = text;
10176
- if (!this.collection) {
10177
- return [2 /*return*/, []];
10178
- }
10179
- filterText = (_a = this.filterText) === null || _a === void 0 ? void 0 : _a.toString().toLowerCase();
10180
- filteredItemCount = 0;
10181
- this.filteredCollection = (_b = this.collection) === null || _b === void 0 ? void 0 : _b.filter(function (item) {
10182
- var _a;
10183
- var labelText = (_a = item.description) === null || _a === void 0 ? void 0 : _a.toString().toLowerCase();
10184
- var isHiddenByFilter = ((labelText === null || labelText === void 0 ? void 0 : labelText.indexOf(filterText)) === -1);
10185
- if (isHiddenByFilter) {
10186
- return false;
10187
- }
10188
- else {
10189
- filteredItemCount++;
10190
- return true;
10191
- }
10192
- });
10193
- return [2 /*return*/];
10194
- }
10155
+ PaginationComponent.prototype.getCurrentPage = function () {
10156
+ return this._paginationService.getCurrentPage(this.id);
10157
+ };
10158
+ PaginationComponent.prototype.getLastPage = function () {
10159
+ var instance = this._paginationService.getInstance(this.id);
10160
+ return Math.ceil(instance.totalItems / instance.itemsPerPage);
10161
+ };
10162
+ /**
10163
+ * Checks that the instance.currentPage property is within bounds for the current page range.
10164
+ * If not, return a correct value for currentPage, or the current value if OK.
10165
+ */
10166
+ PaginationComponent.prototype.outOfBoundCorrection = function (instance) {
10167
+ var totalPages = Math.ceil(instance.totalItems / instance.itemsPerPage);
10168
+ if (totalPages < instance.currentPage && 0 < totalPages) {
10169
+ return totalPages;
10170
+ }
10171
+ else if (instance.currentPage < 1) {
10172
+ return 1;
10173
+ }
10174
+ return instance.currentPage;
10175
+ };
10176
+ // Returns an array of IPage objects to use in the pagination controls.
10177
+ PaginationComponent.prototype.createPageArray = function (currentPage, itemsPerPage, totalItems, paginationRange) {
10178
+ // paginationRange could be a string if passed from attribute, so cast to number.
10179
+ paginationRange = +paginationRange;
10180
+ var pages = [];
10181
+ var totalPages = Math.ceil(totalItems / itemsPerPage);
10182
+ var halfWay = Math.ceil(paginationRange / 2);
10183
+ var isStart = currentPage <= halfWay;
10184
+ var isEnd = totalPages - halfWay < currentPage;
10185
+ var isMiddle = !isStart && !isEnd;
10186
+ var ellipsesNeeded = paginationRange < totalPages;
10187
+ var i = 1;
10188
+ while (i <= totalPages && i <= paginationRange) {
10189
+ var label = void 0;
10190
+ var pageNumber = this.calculatePageNumber(i, currentPage, paginationRange, totalPages);
10191
+ var openingEllipsesNeeded = (i === 2 && (isMiddle || isEnd));
10192
+ var closingEllipsesNeeded = (i === paginationRange - 1 && (isMiddle || isStart));
10193
+ if (ellipsesNeeded && (openingEllipsesNeeded || closingEllipsesNeeded)) {
10194
+ label = '...';
10195
+ }
10196
+ else {
10197
+ label = '' + pageNumber;
10198
+ }
10199
+ pages.push({
10200
+ label: label,
10201
+ value: pageNumber
10195
10202
  });
10196
- });
10203
+ i++;
10204
+ }
10205
+ return pages;
10197
10206
  };
10198
- return FilterItemComponent;
10207
+ // Given the position in the sequence of pagination links [i], figure out what page number corresponds to that position.
10208
+ PaginationComponent.prototype.calculatePageNumber = function (i, currentPage, paginationRange, totalPages) {
10209
+ var halfWay = Math.ceil(paginationRange / 2);
10210
+ if (i === paginationRange) {
10211
+ return totalPages;
10212
+ }
10213
+ else if (i === 1) {
10214
+ return i;
10215
+ }
10216
+ else if (paginationRange < totalPages) {
10217
+ if (totalPages - halfWay < currentPage) {
10218
+ return totalPages - paginationRange + i;
10219
+ }
10220
+ else if (halfWay < currentPage) {
10221
+ return currentPage - halfWay + i;
10222
+ }
10223
+ else {
10224
+ return i;
10225
+ }
10226
+ }
10227
+ else {
10228
+ return i;
10229
+ }
10230
+ };
10231
+ return PaginationComponent;
10199
10232
  }());
10200
- FilterItemComponent.decorators = [
10233
+ PaginationComponent.decorators = [
10201
10234
  { type: core.Component, args: [{
10202
- selector: "co-filter-item",
10203
- template: "\n <div class=\"co-filter-item-header\">\n <co-collapsible\n [headerTitle]=\"placeholder\"\n [expandButtonLast]=\"true\"\n [iconData]=\"iconService.getIcon(icons.ArrowPointDown)\"\n [expanded]=\"expanded\"\n >\n <div class=\"co-filter-item-collapsable-content\">\n <div class=\"co-filter-item-custom-content\" *ngIf=\"customContent; else collectionContent\">\n <ng-content></ng-content>\n </div>\n <ng-template #collectionContent>\n <div class=\"co-filter-item-collection-content\">\n <co-input-text\n *ngIf=\"collection?.length > 10 || minSearchCharsToLoadCollection\"\n [placeholder]=\"searchPlaceholder\"\n [model]=\"filterText\"\n (modelChange)=\"applyFilter($event)\"\n >\n </co-input-text>\n <div class=\"no-results\" *ngIf=\"filteredCollection?.length === 0\">\n <span [textContent]=\"noResultsLabel\"></span>\n </div>\n <div class=\"co-filter-item-collection-results\">\n <ng-container\n *ngFor=\"let option of filteredCollection; let index = index\">\n <div class=\"co-filter-item-collection-result-item\" *ngIf=\"index < limitTo || showAllResults\">\n <co-input-checkbox *ngIf=\"!singleSelect\"\n [label]=\"option.description\"\n [model]=\"option.checked\"\n (modelChange)=\"handleModelChange(option)\"\n ></co-input-checkbox>\n <co-input-radio-button *ngIf=\"singleSelect\"\n [name]=\"'radiogroup'\"\n [label]=\"option.description\"\n [model]=\"option.checked\"\n (modelChange)=\"handleModelChange(option)\"\n ></co-input-radio-button>\n <div class=\"co-filter-item-amount\" *ngIf=\"option.count\"\n [textContent]=\"option.count.toString() | append: ')' | prepend: ' ('\"\n ></div>\n </div>\n\n </ng-container>\n </div>\n <div class=\"co-filter-show-more-or-less\" *ngIf=\"!showAllResults\">\n <div class=\"co-filter-show-more clickable\"\n *ngIf=\"moreToShow()\">\n <a (click)=\"increaseLimit()\">\n <co-icon [iconData]=\"iconService.getIcon(icons.ArrowPointDown)\"></co-icon>\n <span [textContent]=\"showMoreLabel\"></span>\n </a>\n </div>\n <div class=\"co-filter-show-less clickable\"\n *ngIf=\"lessToShow()\">\n <a (click)=\"setToInitialLimit()\">\n <co-icon [iconData]=\"iconService.getIcon(icons.ArrowPointUp)\"></co-icon>\n <span [textContent]=\"showLessLabel\"></span>\n </a>\n </div>\n </div>\n </div>\n </ng-template>\n </div>\n </co-collapsible>\n </div>\n\n ",
10235
+ selector: 'co-pagination',
10236
+ template: "\n <div class=\"pagination-component-main-wrapper\" *ngIf=\"!shouldBeHidden()\">\n <div>\n <ng-content></ng-content>\n </div>\n\n <co-pagination-bar\n [pages]=\"pages\"\n [directionLinks]=\"directionLinks\"\n [previousLabel]=\"previousLabel\"\n [nextLabel]=\"nextLabel\"\n [currentPage]=\"getCurrentPage()\"\n (previousClick)=\"goToPreviousPage()\"\n (nextClick)=\"goToNextPage()\"\n (pageClick)=\"setCurrentPage($event)\"\n ></co-pagination-bar>\n </div>\n ",
10204
10237
  encapsulation: core.ViewEncapsulation.None
10205
10238
  },] }
10206
10239
  ];
10207
- FilterItemComponent.ctorParameters = function () { return [
10208
- { type: IconCacheService }
10240
+ PaginationComponent.ctorParameters = function () { return [
10241
+ { type: PaginationService }
10209
10242
  ]; };
10210
- FilterItemComponent.propDecorators = {
10211
- collection: [{ type: core.Input }],
10212
- placeholder: [{ type: core.Input }],
10213
- initialLimit: [{ type: core.Input }],
10214
- expanded: [{ type: core.Input }],
10215
- minSearchCharsToLoadCollection: [{ type: core.Input }],
10216
- collectionLoadFn: [{ type: core.Input }],
10217
- customContent: [{ type: core.Input }],
10218
- showAllResults: [{ type: core.Input }],
10219
- singleSelect: [{ type: core.Input }],
10220
- searchPlaceholder: [{ type: core.Input }],
10221
- showMoreLabel: [{ type: core.Input }],
10222
- showLessLabel: [{ type: core.Input }],
10223
- noResultsLabel: [{ type: core.Input }],
10224
- collectionChange: [{ type: core.Output }],
10225
- showClass: [{ type: core.HostBinding, args: ["class.co-filter-item",] }]
10243
+ PaginationComponent.propDecorators = {
10244
+ template: [{ type: core.ViewChild, args: ['template',] }],
10245
+ id: [{ type: core.Input }],
10246
+ maxSize: [{ type: core.Input }],
10247
+ directionLinks: [{ type: core.Input }],
10248
+ previousLabel: [{ type: core.Input }],
10249
+ nextLabel: [{ type: core.Input }],
10250
+ autoHide: [{ type: core.Input }],
10251
+ pageChange: [{ type: core.Output }],
10252
+ showClass: [{ type: core.HostBinding, args: ['class.co-pagination',] }]
10226
10253
  };
10227
10254
 
10228
- // A pipe for prepending strings to other strings in view templates.
10229
- var PrependPipe = /** @class */ (function () {
10230
- function PrependPipe() {
10231
- }
10232
- PrependPipe.prototype.transform = function (value, prepend) {
10233
- if (!value) {
10234
- return "";
10235
- }
10236
- if (!prepend) {
10237
- return value;
10238
- }
10239
- return prepend + value;
10240
- };
10241
- return PrependPipe;
10242
- }());
10243
- PrependPipe.decorators = [
10244
- { type: core.Pipe, args: [{ name: "prepend" },] }
10245
- ];
10246
-
10247
- var PrependPipeModule = /** @class */ (function () {
10248
- function PrependPipeModule() {
10255
+ var PaginationModule = /** @class */ (function () {
10256
+ function PaginationModule() {
10249
10257
  }
10250
- return PrependPipeModule;
10258
+ return PaginationModule;
10251
10259
  }());
10252
- PrependPipeModule.decorators = [
10260
+ PaginationModule.decorators = [
10253
10261
  { type: core.NgModule, args: [{
10262
+ imports: [
10263
+ common.CommonModule,
10264
+ PaginationBarModule
10265
+ ],
10266
+ providers: [
10267
+ PaginationService
10268
+ ],
10254
10269
  declarations: [
10255
- PrependPipe
10270
+ PaginationComponent,
10271
+ PaginatePipe
10256
10272
  ],
10257
10273
  exports: [
10258
- PrependPipe
10259
- ]
10260
- },] }
10261
- ];
10262
-
10263
- var FilterItemModule = /** @class */ (function () {
10264
- function FilterItemModule() {
10265
- }
10266
- return FilterItemModule;
10267
- }());
10268
- FilterItemModule.decorators = [
10269
- { type: core.NgModule, args: [{
10270
- imports: [
10271
- common.CommonModule,
10272
- CollapsibleModule,
10273
- InputTextModule,
10274
- InputCheckboxMultiSelectModule,
10275
- InputCheckboxModule,
10276
- IconModule,
10277
- scrolling.ScrollingModule,
10278
- AppendPipeModule,
10279
- PrependPipeModule,
10280
- InputTextModule,
10281
- InputRadioButtonModule
10282
- ],
10283
- declarations: [
10284
- FilterItemComponent
10285
- ],
10286
- exports: [
10287
- FilterItemComponent
10274
+ PaginationComponent,
10275
+ PaginatePipe
10288
10276
  ]
10289
10277
  },] }
10290
10278
  ];
10291
10279
 
10292
- // Human-readable JS keyboard codes, as in KeyboardEvent.key string values.
10293
- var KeyboardKey;
10294
- (function (KeyboardKey) {
10295
- KeyboardKey["Down"] = "ArrowDown";
10296
- KeyboardKey["Up"] = "ArrowUp";
10297
- KeyboardKey["Left"] = "ArrowLeft";
10298
- KeyboardKey["Right"] = "ArrowRight";
10299
- KeyboardKey["Tab"] = "Tab";
10300
- KeyboardKey["Escape"] = "Escape";
10301
- KeyboardKey["Enter"] = "Enter";
10302
- KeyboardKey["Home"] = "Home";
10303
- KeyboardKey["End"] = "End";
10304
- KeyboardKey["Delete"] = "Delete";
10305
- KeyboardKey["Insert"] = "Insert";
10306
- KeyboardKey["ShiftLeft"] = "ShiftLeft";
10307
- KeyboardKey["ShiftRight"] = "ShiftRight";
10308
- KeyboardKey["Backspace"] = "Backspace";
10309
- KeyboardKey["SpaceBar"] = "Space";
10310
- KeyboardKey["Period"] = "Period";
10311
- KeyboardKey["DecimalPoint"] = "NumpadDecimal";
10312
- KeyboardKey["SemiColon"] = "Semicolon";
10313
- KeyboardKey["ControlRight"] = "ControlRight";
10314
- KeyboardKey["ControlLeft"] = "ControlLeft";
10315
- KeyboardKey["Comma"] = "Comma";
10316
- ////Minus,
10317
- ////MinusFireFox,
10318
- ////Substract,
10319
- KeyboardKey["Zero"] = "Digit0";
10320
- KeyboardKey["One"] = "Digit1";
10321
- KeyboardKey["Two"] = "Digit2";
10322
- KeyboardKey["Three"] = "Digit3";
10323
- KeyboardKey["Four"] = "Digit4";
10324
- KeyboardKey["Five"] = "Digit5";
10325
- KeyboardKey["Six"] = "Digit6";
10326
- KeyboardKey["Seven"] = "Digit7";
10327
- KeyboardKey["Eight"] = "Digit8";
10328
- KeyboardKey["Nine"] = "Digit9";
10329
- KeyboardKey["NumpadZero"] = "Numpad0";
10330
- KeyboardKey["NumpadOne"] = "Numpad1";
10331
- KeyboardKey["NumpadTwo"] = "Numpad2";
10332
- KeyboardKey["NumpadThree"] = "Numpad3";
10333
- KeyboardKey["NumpadFour"] = "Numpad4";
10334
- KeyboardKey["NumpadFive"] = "Numpad5";
10335
- KeyboardKey["NumpadSix"] = "Numpad6";
10336
- KeyboardKey["NumpadSeven"] = "Numpad7";
10337
- KeyboardKey["NumpadEight"] = "Numpad8";
10338
- KeyboardKey["NumpadNine"] = "Numpad9";
10339
- KeyboardKey["A"] = "KeyA";
10340
- KeyboardKey["B"] = "KeyB";
10341
- KeyboardKey["C"] = "KeyC";
10342
- KeyboardKey["D"] = "KeyD";
10343
- KeyboardKey["E"] = "KeyE";
10344
- KeyboardKey["F"] = "KeyF";
10345
- KeyboardKey["G"] = "KeyG";
10346
- KeyboardKey["H"] = "KeyH";
10347
- KeyboardKey["I"] = "KeyI";
10348
- KeyboardKey["J"] = "KeyJ";
10349
- KeyboardKey["K"] = "KeyK";
10350
- KeyboardKey["L"] = "KeyL";
10351
- KeyboardKey["M"] = "KeyM";
10352
- KeyboardKey["N"] = "KeyN";
10353
- KeyboardKey["O"] = "KeyO";
10354
- KeyboardKey["P"] = "KeyP";
10355
- KeyboardKey["Q"] = "KeyQ";
10356
- KeyboardKey["R"] = "KeyR";
10357
- KeyboardKey["S"] = "KeyS";
10358
- KeyboardKey["T"] = "KeyT";
10359
- KeyboardKey["U"] = "KeyU";
10360
- KeyboardKey["V"] = "KeyV";
10361
- KeyboardKey["W"] = "KeyW";
10362
- KeyboardKey["X"] = "KeyX";
10363
- KeyboardKey["Y"] = "KeyY";
10364
- KeyboardKey["Z"] = "KeyZ";
10365
- })(KeyboardKey || (KeyboardKey = {}));
10366
-
10367
- var ClickOutsideMasterService = /** @class */ (function () {
10368
- function ClickOutsideMasterService(_ngZone) {
10369
- var _this = this;
10370
- this._ngZone = _ngZone;
10371
- this._clickOutsideRefs = [];
10372
- this.onClick = function (event) {
10373
- _this._currentClick = event;
10374
- var first = _this._clickOutsideRefs[0];
10375
- var targets = _this._clickOutsideRefs.filter(function (co) { return co.alwaysTrigger; });
10376
- if (first) {
10377
- targets.push(first);
10378
- }
10379
- setTimeout(function () {
10380
- targets.forEach(function (clickOutside) { return _this.checkEmit(clickOutside, event); });
10381
- });
10382
- };
10383
- this.onKeyDown = function (event) {
10384
- if (event.key === KeyboardKey.Escape) {
10385
- var first = _this._clickOutsideRefs[0];
10386
- if (first) {
10387
- _this.checkEmit(first, event, true);
10388
- }
10389
- }
10390
- };
10391
- document.addEventListener('click', this.onClick, true);
10392
- window.addEventListener('keydown', this.onKeyDown, EventUtils.passiveBubble);
10280
+ var SimpleGridCellComponent = /** @class */ (function () {
10281
+ function SimpleGridCellComponent(_changeDetector) {
10282
+ this._changeDetector = _changeDetector;
10283
+ this.defaultTextAlign = exports.ColumnAlign.Left;
10284
+ this.editMode = false;
10285
+ this.cellClick = new core.EventEmitter();
10286
+ this._fieldEditMode = false;
10287
+ this._focused = false;
10393
10288
  }
10394
- Object.defineProperty(ClickOutsideMasterService.prototype, "currentClick", {
10395
- get: function () {
10396
- return this._currentClick;
10289
+ Object.defineProperty(SimpleGridCellComponent.prototype, "editTemplateContent", {
10290
+ set: function (template) {
10291
+ if (template) {
10292
+ this._editTemplate = template;
10293
+ this._setFocusComponent();
10294
+ }
10397
10295
  },
10398
10296
  enumerable: false,
10399
10297
  configurable: true
10400
10298
  });
10401
- ClickOutsideMasterService.prototype.ngOnDestroy = function () {
10402
- document.removeEventListener('click', this.onClick, true);
10403
- window.removeEventListener('keydown', this.onKeyDown, EventUtils.passiveBubble);
10404
- };
10405
- ClickOutsideMasterService.prototype.checkEmit = function (clickOutside, event, force) {
10406
- if (clickOutside && (clickOutside.currentClick !== this.currentClick || force) && this._clickOutsideRefs.indexOf(clickOutside) !== -1) {
10407
- this._ngZone.run(function () { return clickOutside.clickOutside.emit(event); });
10408
- }
10409
- };
10410
- ClickOutsideMasterService.prototype.addClickOutside = function (clickOutside) {
10411
- this.removeClickOutside(clickOutside);
10412
- this._clickOutsideRefs.unshift(clickOutside);
10413
- };
10414
- ClickOutsideMasterService.prototype.removeClickOutside = function (clickOutside) {
10415
- ArrayUtils.RemoveElement(clickOutside, this._clickOutsideRefs);
10416
- };
10417
- return ClickOutsideMasterService;
10418
- }());
10419
- ClickOutsideMasterService.decorators = [
10420
- { type: core.Injectable }
10421
- ];
10422
- ClickOutsideMasterService.ctorParameters = function () { return [
10423
- { type: core.NgZone }
10424
- ]; };
10425
-
10426
- var ClickOutsideDirective = /** @class */ (function () {
10427
- function ClickOutsideDirective(elementRef, _ngZone, _master) {
10428
- var _this = this;
10429
- this.elementRef = elementRef;
10430
- this._ngZone = _ngZone;
10431
- this._master = _master;
10432
- this.clickOutside = new core.EventEmitter();
10433
- this._enabled = true;
10434
- this._initialized = false;
10435
- this.onClick = function (event) {
10436
- if (_this._enabled) {
10437
- _this._currentClick = event;
10299
+ Object.defineProperty(SimpleGridCellComponent.prototype, "noEditTemplateContent", {
10300
+ set: function (template) {
10301
+ if (template) {
10302
+ this._template = template;
10303
+ this._setFocusComponent();
10438
10304
  }
10439
- };
10440
- }
10441
- Object.defineProperty(ClickOutsideDirective.prototype, "currentClick", {
10442
- get: function () {
10443
- return this._currentClick;
10444
10305
  },
10445
10306
  enumerable: false,
10446
10307
  configurable: true
10447
10308
  });
10448
- Object.defineProperty(ClickOutsideDirective.prototype, "enabled", {
10449
- set: function (enabled) {
10450
- enabled = enabled === undefined || enabled;
10451
- // noinspection SuspiciousTypeOfGuard
10452
- if (typeof enabled === 'boolean' && this._enabled !== enabled) {
10453
- this._enabled = enabled;
10454
- if (this._initialized) {
10455
- this._enabled ? this._master.addClickOutside(this) : this._master.removeClickOutside(this);
10456
- }
10309
+ Object.defineProperty(SimpleGridCellComponent.prototype, "noTemplateContent", {
10310
+ set: function (template) {
10311
+ if (template) {
10312
+ this._inputTemplate = template;
10313
+ this._setFocusComponent();
10457
10314
  }
10458
10315
  },
10459
10316
  enumerable: false,
10460
10317
  configurable: true
10461
10318
  });
10462
- ClickOutsideDirective.prototype.ngAfterViewInit = function () {
10463
- var _this = this;
10464
- setTimeout(function () {
10465
- _this._ngZone.runOutsideAngular(function () {
10466
- if (_this.elementRef && _this.elementRef.nativeElement) {
10467
- _this.elementRef.nativeElement.addEventListener('click', _this.onClick, EventUtils.passiveCapture);
10468
- if (_this._enabled) {
10469
- _this._master.addClickOutside(_this);
10470
- }
10471
- _this._initialized = true;
10472
- }
10473
- });
10474
- });
10319
+ Object.defineProperty(SimpleGridCellComponent.prototype, "fieldEditMode", {
10320
+ get: function () {
10321
+ return this._fieldEditMode;
10322
+ },
10323
+ set: function (value) {
10324
+ this._fieldEditMode = value;
10325
+ this._setFocusComponent();
10326
+ },
10327
+ enumerable: false,
10328
+ configurable: true
10329
+ });
10330
+ SimpleGridCellComponent.prototype.showClass = function () {
10331
+ return true;
10475
10332
  };
10476
- ClickOutsideDirective.prototype.ngOnDestroy = function () {
10477
- this._master.removeClickOutside(this);
10478
- this.elementRef.nativeElement.removeEventListener('click', this.onClick, EventUtils.passiveCapture);
10479
- this.elementRef = undefined;
10333
+ SimpleGridCellComponent.prototype.handleClick = function (event) {
10334
+ if (this.column && !this.column.readonly) {
10335
+ this.cellClick.next();
10336
+ }
10480
10337
  };
10481
- return ClickOutsideDirective;
10482
- }());
10483
- ClickOutsideDirective.decorators = [
10484
- { type: core.Directive, args: [{
10485
- selector: "[clickOutside]",
10486
- exportAs: 'clickOutside'
10487
- },] }
10488
- ];
10489
- ClickOutsideDirective.ctorParameters = function () { return [
10490
- { type: core.ElementRef },
10491
- { type: core.NgZone },
10492
- { type: ClickOutsideMasterService }
10493
- ]; };
10494
- ClickOutsideDirective.propDecorators = {
10495
- enabled: [{ type: core.Input, args: ["clickOutside",] }],
10496
- alwaysTrigger: [{ type: core.Input }],
10497
- clickOutside: [{ type: core.Output }]
10498
- };
10499
- __decorate([
10500
- InputBoolean()
10501
- ], ClickOutsideDirective.prototype, "alwaysTrigger", void 0);
10502
-
10503
- var ClickoutsideModule = /** @class */ (function () {
10504
- function ClickoutsideModule() {
10505
- }
10506
- return ClickoutsideModule;
10507
- }());
10508
- ClickoutsideModule.decorators = [
10509
- { type: core.NgModule, args: [{
10510
- declarations: [
10511
- ClickOutsideDirective
10512
- ],
10513
- providers: [
10514
- ClickOutsideMasterService
10515
- ],
10516
- exports: [
10517
- ClickOutsideDirective
10518
- ]
10519
- },] }
10520
- ];
10521
-
10522
- var PaginationService = /** @class */ (function () {
10523
- function PaginationService() {
10524
- this.change = new rxjs.Subject();
10525
- this.instances = {};
10526
- }
10527
- Object.defineProperty(PaginationService.prototype, "DEFAULT_ID", {
10528
- get: function () {
10529
- return PaginationService.DEFAULT_ID;
10530
- },
10531
- enumerable: false,
10532
- configurable: true
10533
- });
10534
- PaginationService.prototype.register = function (instance) {
10535
- if (!instance.id) {
10536
- instance.id = PaginationService.DEFAULT_ID;
10537
- }
10538
- if (!this.instances[instance.id]) {
10539
- this.instances[instance.id] = instance;
10540
- this.change.next(instance.id);
10338
+ SimpleGridCellComponent.prototype._setFocusComponent = function () {
10339
+ if (this.editMode && this.fieldEditMode) {
10340
+ var element = this._getElement();
10341
+ if (element) {
10342
+ var focusEvent = this._createNewEvent(element, 'focus');
10343
+ element.focus();
10344
+ element.dispatchEvent(focusEvent);
10345
+ this._focused = true;
10346
+ }
10541
10347
  }
10542
10348
  else {
10543
- var changed = this.updateInstance(instance);
10544
- if (changed) {
10545
- this.change.next(instance.id);
10349
+ if (this._focused) {
10350
+ var element = this._getElement();
10351
+ if (element) {
10352
+ var blurEvent = this._createNewEvent(element, 'blur');
10353
+ element.blur();
10354
+ element.dispatchEvent(blurEvent);
10355
+ }
10356
+ this._focused = false;
10546
10357
  }
10547
10358
  }
10359
+ this._detectChanges();
10548
10360
  };
10549
- // Returns the current page number.
10550
- PaginationService.prototype.getCurrentPage = function (id) {
10551
- if (this.instances[id]) {
10552
- return this.instances[id].currentPage;
10553
- }
10554
- };
10555
- // Sets the current page number.
10556
- PaginationService.prototype.setCurrentPage = function (id, page) {
10557
- if (this.instances[id]) {
10558
- var instance = this.instances[id];
10559
- var maxPage = Math.ceil(instance.totalItems / instance.itemsPerPage);
10560
- if (page <= maxPage && 1 <= page) {
10561
- this.instances[id].currentPage = page;
10562
- this.change.next(id);
10361
+ SimpleGridCellComponent.prototype._getFirstFormInput = function (parent) {
10362
+ if (parent) {
10363
+ var collection_1 = Array.from(parent.getElementsByTagName('input'));
10364
+ var otherCollection = Array.from(parent.getElementsByTagName('textarea'));
10365
+ otherCollection.map(function (o) { return collection_1.push(o); });
10366
+ if (collection_1.length > 0) {
10367
+ return collection_1[0];
10563
10368
  }
10564
10369
  }
10565
10370
  };
10566
- // Sets the value of instance.totalItems
10567
- PaginationService.prototype.setTotalItems = function (id, totalItems) {
10568
- if (this.instances[id] && 0 <= totalItems) {
10569
- this.instances[id].totalItems = totalItems;
10570
- this.change.next(id);
10371
+ SimpleGridCellComponent.prototype._createNewEvent = function (element, eventType) {
10372
+ var event;
10373
+ if ("createEvent" in document) {
10374
+ event = document.createEvent("Event");
10375
+ event.initEvent(eventType, true, true);
10571
10376
  }
10572
- };
10573
- // Sets the value of instance.itemsPerPage.
10574
- PaginationService.prototype.setItemsPerPage = function (id, itemsPerPage) {
10575
- if (this.instances[id]) {
10576
- this.instances[id].itemsPerPage = itemsPerPage;
10577
- this.change.next(id);
10377
+ else if ("Event" in window) {
10378
+ event = new Event(eventType, { bubbles: true, cancelable: true });
10578
10379
  }
10380
+ return event;
10579
10381
  };
10580
- /**
10581
- * Returns a clone of the pagination instance object matching the id. If no
10582
- * id specified, returns the instance corresponding to the default id.
10583
- */
10584
- PaginationService.prototype.getInstance = function (id) {
10585
- if (id === void 0) { id = PaginationService.DEFAULT_ID; }
10586
- if (this.instances[id]) {
10587
- return ObjectUtils.GetShallowClone(this.instances[id]);
10382
+ SimpleGridCellComponent.prototype._getElement = function () {
10383
+ var templ;
10384
+ if (this._editTemplate) {
10385
+ templ = this._editTemplate;
10588
10386
  }
10589
- return {};
10590
- };
10591
- /**
10592
- * Check each property of the instance and update any that have changed. Return
10593
- * true if any changes were made, else return false.
10594
- */
10595
- PaginationService.prototype.updateInstance = function (instance) {
10596
- var changed = false;
10597
- for (var prop in this.instances[instance.id]) {
10598
- if (instance[prop] !== this.instances[instance.id][prop]) {
10599
- this.instances[instance.id][prop] = instance[prop];
10600
- changed = true;
10387
+ else if (this._template) {
10388
+ templ = this._template;
10389
+ }
10390
+ else {
10391
+ templ = this._inputTemplate;
10392
+ }
10393
+ if (templ) {
10394
+ if (templ && templ.elementRef) {
10395
+ var inputElement = this._getFirstFormInput(templ.elementRef.nativeElement.parentElement);
10396
+ if (inputElement) {
10397
+ return inputElement;
10398
+ }
10601
10399
  }
10602
10400
  }
10603
- return changed;
10604
10401
  };
10605
- return PaginationService;
10402
+ SimpleGridCellComponent.prototype._detectChanges = function () {
10403
+ this._changeDetector.detectChanges();
10404
+ };
10405
+ return SimpleGridCellComponent;
10606
10406
  }());
10607
- PaginationService.DEFAULT_ID = "DEFAULT_PAGINATION_ID";
10608
- PaginationService.decorators = [
10609
- { type: core.Injectable }
10407
+ SimpleGridCellComponent.decorators = [
10408
+ { type: core.Component, args: [{
10409
+ selector: "co-simple-grid-cell",
10410
+ template: "\n <div class=\"simple-grid-column-cell-value\" [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\">\n <ng-container *ngIf=\"editMode; else noInlineEdit\">\n <ng-container #editTemplate *ngIf=\"column.editTemplate; else noEditTemplate\"\n [ngTemplateOutlet]=\"column.editTemplate\"\n [ngTemplateOutletContext]=\"{value: row[column.field], row: row}\"></ng-container>\n <ng-template #noEditTemplate>\n <ng-container *ngIf=\"column.template; else noTemplate\">\n <ng-container [ngTemplateOutlet]=\"column.template\"\n [ngTemplateOutletContext]=\"{value: row[column.field], row: row}\"></ng-container>\n </ng-container>\n <ng-template #noTemplate>\n <co-input-text [(model)]=\"row[column.field]\" [required]=\"column.required\"></co-input-text>\n </ng-template>\n </ng-template>\n </ng-container>\n <ng-template #noInlineEdit>\n <ng-container *ngIf=\"column.template; else noTemplate\">\n <ng-container [ngTemplateOutlet]=\"column.template\"\n [ngTemplateOutletContext]=\"{value: row[column.field], row: row}\"></ng-container>\n </ng-container>\n <ng-template #noTemplate>\n <span [textContent]=\"column.getFieldValue(row[column.field])\"></span>\n </ng-template>\n </ng-template>\n </div>\n ",
10411
+ encapsulation: core.ViewEncapsulation.None
10412
+ },] }
10610
10413
  ];
10611
- PaginationService.ctorParameters = function () { return []; };
10414
+ SimpleGridCellComponent.ctorParameters = function () { return [
10415
+ { type: core.ChangeDetectorRef }
10416
+ ]; };
10417
+ SimpleGridCellComponent.propDecorators = {
10418
+ editTemplateContent: [{ type: core.ViewChild, args: ["editTemplate", { read: BaseInputComponent },] }],
10419
+ noEditTemplateContent: [{ type: core.ViewChild, args: ["noEditTemplate",] }],
10420
+ noTemplateContent: [{ type: core.ViewChild, args: ["noTemplate",] }],
10421
+ column: [{ type: core.Input }],
10422
+ row: [{ type: core.Input }],
10423
+ editMode: [{ type: core.Input }],
10424
+ fieldEditMode: [{ type: core.Input }],
10425
+ cellClick: [{ type: core.Output }],
10426
+ showClass: [{ type: core.HostBinding, args: ["class.co-simple-grid-cell",] }],
10427
+ handleClick: [{ type: core.HostListener, args: ['click', ['$event'],] }]
10428
+ };
10612
10429
 
10613
- var PaginationComponent = /** @class */ (function () {
10614
- function PaginationComponent(_paginationService) {
10615
- var _this = this;
10616
- this._paginationService = _paginationService;
10617
- this.maxSize = 7;
10618
- this.directionLinks = true;
10619
- this.previousLabel = 'Vorige pagina';
10620
- this.nextLabel = 'Volgende pagina';
10621
- this.autoHide = false;
10622
- // Emits the new page number.
10623
- this.pageChange = new core.EventEmitter();
10624
- this.showClass = true;
10625
- this.pages = [];
10626
- this.changeSub = this._paginationService.change.subscribe(function (id) {
10627
- if (_this.id === id) {
10628
- _this._updatePageLinks();
10629
- }
10630
- });
10430
+ var ObserveVisibilityDirective = /** @class */ (function () {
10431
+ function ObserveVisibilityDirective(_element) {
10432
+ this._element = _element;
10433
+ this.debounceTime = 0;
10434
+ this.threshold = 0;
10435
+ this.visible = new core.EventEmitter();
10436
+ this._subject = new rxjs.Subject();
10631
10437
  }
10632
- PaginationComponent.prototype.ngOnInit = function () {
10633
- if (!this.id) {
10634
- this.id = this._paginationService.DEFAULT_ID;
10635
- }
10636
- this._updatePageLinks();
10637
- };
10638
- PaginationComponent.prototype.ngOnChanges = function () {
10639
- this._updatePageLinks();
10438
+ ObserveVisibilityDirective.prototype.ngOnInit = function () {
10439
+ this._createObserver();
10640
10440
  };
10641
- PaginationComponent.prototype.ngOnDestroy = function () {
10642
- this.changeSub.unsubscribe();
10441
+ ObserveVisibilityDirective.prototype.ngAfterViewInit = function () {
10442
+ this._startObservingElements();
10643
10443
  };
10644
- PaginationComponent.prototype.goToFirstPage = function () {
10645
- if (!this.isOnFirstPage()) {
10646
- this.setCurrentPage(1);
10444
+ ObserveVisibilityDirective.prototype.ngOnDestroy = function () {
10445
+ if (this._observer) {
10446
+ this._observer.disconnect();
10447
+ this._observer = undefined;
10647
10448
  }
10449
+ this._subject.next();
10450
+ this._subject.complete();
10648
10451
  };
10649
- PaginationComponent.prototype.goToPreviousPage = function () {
10650
- if (!this.isOnFirstPage()) {
10651
- this.setCurrentPage(this.getCurrentPage() - 1);
10652
- }
10452
+ ObserveVisibilityDirective.prototype._isVisible = function (element) {
10453
+ var _this = this;
10454
+ return new Promise(function (resolve) {
10455
+ var observer = new IntersectionObserver(function (_a) {
10456
+ var _b = __read(_a, 1), entry = _b[0];
10457
+ resolve(entry.isIntersecting && entry.intersectionRatio >= _this.threshold);
10458
+ observer.disconnect();
10459
+ });
10460
+ observer.observe(element);
10461
+ });
10653
10462
  };
10654
- PaginationComponent.prototype.goToNextPage = function () {
10655
- if (!this.isOnLastPage()) {
10656
- this.setCurrentPage(this.getCurrentPage() + 1);
10657
- }
10463
+ ObserveVisibilityDirective.prototype._createObserver = function () {
10464
+ var _this = this;
10465
+ var options = {
10466
+ rootMargin: '0px',
10467
+ threshold: this.threshold,
10468
+ };
10469
+ var isIntersecting = function (entry) { return entry.isIntersecting || entry.intersectionRatio > 0; };
10470
+ this._observer = new IntersectionObserver(function (entries, observer) {
10471
+ entries.forEach(function (entry) {
10472
+ if (isIntersecting(entry)) {
10473
+ _this._subject.next({ entry: entry, observer: observer });
10474
+ }
10475
+ });
10476
+ }, options);
10658
10477
  };
10659
- PaginationComponent.prototype.setCurrentPage = function (page) {
10660
- this.pageChange.emit(page);
10478
+ ObserveVisibilityDirective.prototype._startObservingElements = function () {
10479
+ var _this = this;
10480
+ if (!this._observer) {
10481
+ return;
10482
+ }
10483
+ this._observer.observe(this._element.nativeElement);
10484
+ this._subject
10485
+ .pipe(operators.delay(this.debounceTime), operators.filter(Boolean))
10486
+ .subscribe(function (_a) {
10487
+ var entry = _a.entry, observer = _a.observer;
10488
+ return __awaiter(_this, void 0, void 0, function () {
10489
+ var target, isStillVisible;
10490
+ return __generator(this, function (_a) {
10491
+ switch (_a.label) {
10492
+ case 0:
10493
+ target = entry.target;
10494
+ return [4 /*yield*/, this._isVisible(target)];
10495
+ case 1:
10496
+ isStillVisible = _a.sent();
10497
+ if (isStillVisible) {
10498
+ this.visible.emit(target);
10499
+ observer.unobserve(target);
10500
+ }
10501
+ return [2 /*return*/];
10502
+ }
10503
+ });
10504
+ });
10505
+ });
10661
10506
  };
10662
- PaginationComponent.prototype.isOnFirstPage = function () {
10663
- return this.getCurrentPage() === 1;
10507
+ return ObserveVisibilityDirective;
10508
+ }());
10509
+ ObserveVisibilityDirective.decorators = [
10510
+ { type: core.Directive, args: [{
10511
+ selector: '[observeVisibility]',
10512
+ },] }
10513
+ ];
10514
+ ObserveVisibilityDirective.ctorParameters = function () { return [
10515
+ { type: core.ElementRef }
10516
+ ]; };
10517
+ ObserveVisibilityDirective.propDecorators = {
10518
+ debounceTime: [{ type: core.Input }],
10519
+ threshold: [{ type: core.Input }],
10520
+ visible: [{ type: core.Output }]
10521
+ };
10522
+
10523
+ var ObserveVisibilityModule = /** @class */ (function () {
10524
+ function ObserveVisibilityModule() {
10525
+ }
10526
+ return ObserveVisibilityModule;
10527
+ }());
10528
+ ObserveVisibilityModule.decorators = [
10529
+ { type: core.NgModule, args: [{
10530
+ declarations: [
10531
+ ObserveVisibilityDirective
10532
+ ],
10533
+ exports: [
10534
+ ObserveVisibilityDirective
10535
+ ]
10536
+ },] }
10537
+ ];
10538
+
10539
+ var SimpleGridModule = /** @class */ (function () {
10540
+ function SimpleGridModule() {
10541
+ }
10542
+ return SimpleGridModule;
10543
+ }());
10544
+ SimpleGridModule.decorators = [
10545
+ { type: core.NgModule, args: [{
10546
+ imports: [
10547
+ common.CommonModule,
10548
+ dragDrop.DragDropModule,
10549
+ GridToolbarModule,
10550
+ InputTextModule,
10551
+ FormModule,
10552
+ ObserveVisibilityModule,
10553
+ PaginationModule
10554
+ ],
10555
+ declarations: [
10556
+ SimpleGridComponent,
10557
+ SimpleGridCellComponent,
10558
+ SimpleGridColumnDirective
10559
+ ],
10560
+ exports: [
10561
+ SimpleGridComponent,
10562
+ SimpleGridCellComponent,
10563
+ SimpleGridColumnDirective
10564
+ ]
10565
+ },] }
10566
+ ];
10567
+
10568
+ var FilterItemComponent = /** @class */ (function () {
10569
+ function FilterItemComponent(iconService) {
10570
+ this.iconService = iconService;
10571
+ this.icons = exports.CoreComponentsIcon;
10572
+ this.initialLimit = 10;
10573
+ this.expanded = false;
10574
+ // Set to false to use filter item with a multi selectable collection. Set to true to specify custom content
10575
+ this.customContent = false;
10576
+ // Set to true to show all results. Set to false to get 'show more' and 'show less' buttons to expand and contract.
10577
+ this.showAllResults = false;
10578
+ this.singleSelect = false;
10579
+ this.searchPlaceholder = 'Search...';
10580
+ this.showMoreLabel = 'Show more';
10581
+ this.showLessLabel = 'Show less';
10582
+ this.noResultsLabel = "No results";
10583
+ this.collectionChange = new core.EventEmitter();
10584
+ this.filteredCollection = [];
10585
+ this.limitTo = 10;
10586
+ this.filterText = "";
10587
+ this._collection = [];
10588
+ }
10589
+ Object.defineProperty(FilterItemComponent.prototype, "collection", {
10590
+ get: function () {
10591
+ return this._collection;
10592
+ },
10593
+ set: function (value) {
10594
+ var _a;
10595
+ this._collection = value;
10596
+ this.filteredCollection = (_a = this._collection) === null || _a === void 0 ? void 0 : _a.slice();
10597
+ },
10598
+ enumerable: false,
10599
+ configurable: true
10600
+ });
10601
+ FilterItemComponent.prototype.showClass = function () {
10602
+ return true;
10664
10603
  };
10665
- PaginationComponent.prototype.isOnLastPage = function () {
10666
- return this.getLastPage() === this.getCurrentPage();
10604
+ FilterItemComponent.prototype.ngOnInit = function () {
10605
+ this.setToInitialLimit();
10667
10606
  };
10668
- PaginationComponent.prototype.shouldBeHidden = function () {
10669
- if (!this.autoHide) {
10607
+ FilterItemComponent.prototype.setToInitialLimit = function () {
10608
+ this.limitTo = this.initialLimit;
10609
+ };
10610
+ FilterItemComponent.prototype.increaseLimit = function () {
10611
+ this.limitTo += 10;
10612
+ };
10613
+ FilterItemComponent.prototype.moreToShow = function () {
10614
+ var _a;
10615
+ if (this.showAllResults) {
10670
10616
  return false;
10671
10617
  }
10672
- else {
10673
- var instance = this._paginationService.getInstance();
10674
- return (instance.totalItems <= instance.itemsPerPage);
10675
- }
10618
+ return ((_a = this.filteredCollection) === null || _a === void 0 ? void 0 : _a.length) > this.limitTo;
10676
10619
  };
10677
- /**
10678
- * Updates the page links and checks that the current page is valid. Should run whenever the
10679
- * PaginationService.change stream emits a value matching the current ID, or when any of the
10680
- * input values changes.
10681
- */
10682
- PaginationComponent.prototype._updatePageLinks = function () {
10683
- var paginationInstance = this._paginationService.getInstance(this.id);
10684
- this.pages = this.createPageArray(paginationInstance.currentPage, paginationInstance.itemsPerPage, paginationInstance.totalItems, this.maxSize);
10685
- var correctedCurrentPage = this.outOfBoundCorrection(paginationInstance);
10686
- if (correctedCurrentPage !== paginationInstance.currentPage) {
10687
- this.setCurrentPage(correctedCurrentPage);
10620
+ FilterItemComponent.prototype.lessToShow = function () {
10621
+ var _a, _b;
10622
+ if (this.showAllResults) {
10623
+ return false;
10688
10624
  }
10625
+ return ((_a = this.filteredCollection) === null || _a === void 0 ? void 0 : _a.length) <= this.limitTo && ((_b = this.filteredCollection) === null || _b === void 0 ? void 0 : _b.length) > this.initialLimit;
10689
10626
  };
10690
- PaginationComponent.prototype.getCurrentPage = function () {
10691
- return this._paginationService.getCurrentPage(this.id);
10692
- };
10693
- PaginationComponent.prototype.getLastPage = function () {
10694
- var instance = this._paginationService.getInstance(this.id);
10695
- return Math.ceil(instance.totalItems / instance.itemsPerPage);
10696
- };
10697
- /**
10698
- * Checks that the instance.currentPage property is within bounds for the current page range.
10699
- * If not, return a correct value for currentPage, or the current value if OK.
10700
- */
10701
- PaginationComponent.prototype.outOfBoundCorrection = function (instance) {
10702
- var totalPages = Math.ceil(instance.totalItems / instance.itemsPerPage);
10703
- if (totalPages < instance.currentPage && 0 < totalPages) {
10704
- return totalPages;
10705
- }
10706
- else if (instance.currentPage < 1) {
10707
- return 1;
10627
+ FilterItemComponent.prototype.handleModelChange = function (model) {
10628
+ if (this.singleSelect) {
10629
+ this.collection.forEach(function (m) {
10630
+ if (m.code !== model.code && m.description !== model.description) {
10631
+ m.checked = false;
10632
+ }
10633
+ });
10708
10634
  }
10709
- return instance.currentPage;
10635
+ model.checked = !model.checked;
10636
+ this.collectionChange.emit(this.collection);
10710
10637
  };
10711
- // Returns an array of IPage objects to use in the pagination controls.
10712
- PaginationComponent.prototype.createPageArray = function (currentPage, itemsPerPage, totalItems, paginationRange) {
10713
- // paginationRange could be a string if passed from attribute, so cast to number.
10714
- paginationRange = +paginationRange;
10715
- var pages = [];
10716
- var totalPages = Math.ceil(totalItems / itemsPerPage);
10717
- var halfWay = Math.ceil(paginationRange / 2);
10718
- var isStart = currentPage <= halfWay;
10719
- var isEnd = totalPages - halfWay < currentPage;
10720
- var isMiddle = !isStart && !isEnd;
10721
- var ellipsesNeeded = paginationRange < totalPages;
10722
- var i = 1;
10723
- while (i <= totalPages && i <= paginationRange) {
10724
- var label = void 0;
10725
- var pageNumber = this.calculatePageNumber(i, currentPage, paginationRange, totalPages);
10726
- var openingEllipsesNeeded = (i === 2 && (isMiddle || isEnd));
10727
- var closingEllipsesNeeded = (i === paginationRange - 1 && (isMiddle || isStart));
10728
- if (ellipsesNeeded && (openingEllipsesNeeded || closingEllipsesNeeded)) {
10729
- label = '...';
10730
- }
10731
- else {
10732
- label = '' + pageNumber;
10733
- }
10734
- pages.push({
10735
- label: label,
10736
- value: pageNumber
10638
+ // Applies filter to the collection.
10639
+ FilterItemComponent.prototype.applyFilter = function (text) {
10640
+ var _a, _b;
10641
+ return __awaiter(this, void 0, void 0, function () {
10642
+ var _c, filterText, filteredItemCount;
10643
+ return __generator(this, function (_d) {
10644
+ switch (_d.label) {
10645
+ case 0:
10646
+ if (!(!isNaN(this.minSearchCharsToLoadCollection) && this.collectionLoadFn)) return [3 /*break*/, 3];
10647
+ if (!(text.length === this.minSearchCharsToLoadCollection && text.length > this.filterText.length)) return [3 /*break*/, 2];
10648
+ _c = this;
10649
+ return [4 /*yield*/, this.collectionLoadFn(text)];
10650
+ case 1:
10651
+ _c.collection = _d.sent();
10652
+ return [3 /*break*/, 3];
10653
+ case 2:
10654
+ if (text.length < this.minSearchCharsToLoadCollection) {
10655
+ this.collection = undefined;
10656
+ }
10657
+ _d.label = 3;
10658
+ case 3:
10659
+ this.filterText = text;
10660
+ if (!this.collection) {
10661
+ return [2 /*return*/, []];
10662
+ }
10663
+ filterText = (_a = this.filterText) === null || _a === void 0 ? void 0 : _a.toString().toLowerCase();
10664
+ filteredItemCount = 0;
10665
+ this.filteredCollection = (_b = this.collection) === null || _b === void 0 ? void 0 : _b.filter(function (item) {
10666
+ var _a;
10667
+ var labelText = (_a = item.description) === null || _a === void 0 ? void 0 : _a.toString().toLowerCase();
10668
+ var isHiddenByFilter = ((labelText === null || labelText === void 0 ? void 0 : labelText.indexOf(filterText)) === -1);
10669
+ if (isHiddenByFilter) {
10670
+ return false;
10671
+ }
10672
+ else {
10673
+ filteredItemCount++;
10674
+ return true;
10675
+ }
10676
+ });
10677
+ return [2 /*return*/];
10678
+ }
10737
10679
  });
10738
- i++;
10739
- }
10740
- return pages;
10680
+ });
10741
10681
  };
10742
- // Given the position in the sequence of pagination links [i], figure out what page number corresponds to that position.
10743
- PaginationComponent.prototype.calculatePageNumber = function (i, currentPage, paginationRange, totalPages) {
10744
- var halfWay = Math.ceil(paginationRange / 2);
10745
- if (i === paginationRange) {
10746
- return totalPages;
10682
+ return FilterItemComponent;
10683
+ }());
10684
+ FilterItemComponent.decorators = [
10685
+ { type: core.Component, args: [{
10686
+ selector: "co-filter-item",
10687
+ template: "\n <div class=\"co-filter-item-header\">\n <co-collapsible\n [headerTitle]=\"placeholder\"\n [expandButtonLast]=\"true\"\n [iconData]=\"iconService.getIcon(icons.ArrowPointDown)\"\n [expanded]=\"expanded\"\n >\n <div class=\"co-filter-item-collapsable-content\">\n <div class=\"co-filter-item-custom-content\" *ngIf=\"customContent; else collectionContent\">\n <ng-content></ng-content>\n </div>\n <ng-template #collectionContent>\n <div class=\"co-filter-item-collection-content\">\n <co-input-text\n *ngIf=\"collection?.length > 10 || minSearchCharsToLoadCollection\"\n [placeholder]=\"searchPlaceholder\"\n [model]=\"filterText\"\n (modelChange)=\"applyFilter($event)\"\n >\n </co-input-text>\n <div class=\"no-results\" *ngIf=\"filteredCollection?.length === 0\">\n <span [textContent]=\"noResultsLabel\"></span>\n </div>\n <div class=\"co-filter-item-collection-results\">\n <ng-container\n *ngFor=\"let option of filteredCollection; let index = index\">\n <div class=\"co-filter-item-collection-result-item\" *ngIf=\"index < limitTo || showAllResults\">\n <co-input-checkbox *ngIf=\"!singleSelect\"\n [label]=\"option.description\"\n [model]=\"option.checked\"\n (modelChange)=\"handleModelChange(option)\"\n ></co-input-checkbox>\n <co-input-radio-button *ngIf=\"singleSelect\"\n [name]=\"'radiogroup'\"\n [label]=\"option.description\"\n [model]=\"option.checked\"\n (modelChange)=\"handleModelChange(option)\"\n ></co-input-radio-button>\n <div class=\"co-filter-item-amount\" *ngIf=\"option.count\"\n [textContent]=\"option.count.toString() | append: ')' | prepend: ' ('\"\n ></div>\n </div>\n\n </ng-container>\n </div>\n <div class=\"co-filter-show-more-or-less\" *ngIf=\"!showAllResults\">\n <div class=\"co-filter-show-more clickable\"\n *ngIf=\"moreToShow()\">\n <a (click)=\"increaseLimit()\">\n <co-icon [iconData]=\"iconService.getIcon(icons.ArrowPointDown)\"></co-icon>\n <span [textContent]=\"showMoreLabel\"></span>\n </a>\n </div>\n <div class=\"co-filter-show-less clickable\"\n *ngIf=\"lessToShow()\">\n <a (click)=\"setToInitialLimit()\">\n <co-icon [iconData]=\"iconService.getIcon(icons.ArrowPointUp)\"></co-icon>\n <span [textContent]=\"showLessLabel\"></span>\n </a>\n </div>\n </div>\n </div>\n </ng-template>\n </div>\n </co-collapsible>\n </div>\n\n ",
10688
+ encapsulation: core.ViewEncapsulation.None
10689
+ },] }
10690
+ ];
10691
+ FilterItemComponent.ctorParameters = function () { return [
10692
+ { type: IconCacheService }
10693
+ ]; };
10694
+ FilterItemComponent.propDecorators = {
10695
+ collection: [{ type: core.Input }],
10696
+ placeholder: [{ type: core.Input }],
10697
+ initialLimit: [{ type: core.Input }],
10698
+ expanded: [{ type: core.Input }],
10699
+ minSearchCharsToLoadCollection: [{ type: core.Input }],
10700
+ collectionLoadFn: [{ type: core.Input }],
10701
+ customContent: [{ type: core.Input }],
10702
+ showAllResults: [{ type: core.Input }],
10703
+ singleSelect: [{ type: core.Input }],
10704
+ searchPlaceholder: [{ type: core.Input }],
10705
+ showMoreLabel: [{ type: core.Input }],
10706
+ showLessLabel: [{ type: core.Input }],
10707
+ noResultsLabel: [{ type: core.Input }],
10708
+ collectionChange: [{ type: core.Output }],
10709
+ showClass: [{ type: core.HostBinding, args: ["class.co-filter-item",] }]
10710
+ };
10711
+
10712
+ // A pipe for prepending strings to other strings in view templates.
10713
+ var PrependPipe = /** @class */ (function () {
10714
+ function PrependPipe() {
10715
+ }
10716
+ PrependPipe.prototype.transform = function (value, prepend) {
10717
+ if (!value) {
10718
+ return "";
10747
10719
  }
10748
- else if (i === 1) {
10749
- return i;
10720
+ if (!prepend) {
10721
+ return value;
10750
10722
  }
10751
- else if (paginationRange < totalPages) {
10752
- if (totalPages - halfWay < currentPage) {
10753
- return totalPages - paginationRange + i;
10754
- }
10755
- else if (halfWay < currentPage) {
10756
- return currentPage - halfWay + i;
10723
+ return prepend + value;
10724
+ };
10725
+ return PrependPipe;
10726
+ }());
10727
+ PrependPipe.decorators = [
10728
+ { type: core.Pipe, args: [{ name: "prepend" },] }
10729
+ ];
10730
+
10731
+ var PrependPipeModule = /** @class */ (function () {
10732
+ function PrependPipeModule() {
10733
+ }
10734
+ return PrependPipeModule;
10735
+ }());
10736
+ PrependPipeModule.decorators = [
10737
+ { type: core.NgModule, args: [{
10738
+ declarations: [
10739
+ PrependPipe
10740
+ ],
10741
+ exports: [
10742
+ PrependPipe
10743
+ ]
10744
+ },] }
10745
+ ];
10746
+
10747
+ var FilterItemModule = /** @class */ (function () {
10748
+ function FilterItemModule() {
10749
+ }
10750
+ return FilterItemModule;
10751
+ }());
10752
+ FilterItemModule.decorators = [
10753
+ { type: core.NgModule, args: [{
10754
+ imports: [
10755
+ common.CommonModule,
10756
+ CollapsibleModule,
10757
+ InputTextModule,
10758
+ InputCheckboxMultiSelectModule,
10759
+ InputCheckboxModule,
10760
+ IconModule,
10761
+ scrolling.ScrollingModule,
10762
+ AppendPipeModule,
10763
+ PrependPipeModule,
10764
+ InputTextModule,
10765
+ InputRadioButtonModule
10766
+ ],
10767
+ declarations: [
10768
+ FilterItemComponent
10769
+ ],
10770
+ exports: [
10771
+ FilterItemComponent
10772
+ ]
10773
+ },] }
10774
+ ];
10775
+
10776
+ // Human-readable JS keyboard codes, as in KeyboardEvent.key string values.
10777
+ var KeyboardKey;
10778
+ (function (KeyboardKey) {
10779
+ KeyboardKey["Down"] = "ArrowDown";
10780
+ KeyboardKey["Up"] = "ArrowUp";
10781
+ KeyboardKey["Left"] = "ArrowLeft";
10782
+ KeyboardKey["Right"] = "ArrowRight";
10783
+ KeyboardKey["Tab"] = "Tab";
10784
+ KeyboardKey["Escape"] = "Escape";
10785
+ KeyboardKey["Enter"] = "Enter";
10786
+ KeyboardKey["Home"] = "Home";
10787
+ KeyboardKey["End"] = "End";
10788
+ KeyboardKey["Delete"] = "Delete";
10789
+ KeyboardKey["Insert"] = "Insert";
10790
+ KeyboardKey["ShiftLeft"] = "ShiftLeft";
10791
+ KeyboardKey["ShiftRight"] = "ShiftRight";
10792
+ KeyboardKey["Backspace"] = "Backspace";
10793
+ KeyboardKey["SpaceBar"] = "Space";
10794
+ KeyboardKey["Period"] = "Period";
10795
+ KeyboardKey["DecimalPoint"] = "NumpadDecimal";
10796
+ KeyboardKey["SemiColon"] = "Semicolon";
10797
+ KeyboardKey["ControlRight"] = "ControlRight";
10798
+ KeyboardKey["ControlLeft"] = "ControlLeft";
10799
+ KeyboardKey["Comma"] = "Comma";
10800
+ ////Minus,
10801
+ ////MinusFireFox,
10802
+ ////Substract,
10803
+ KeyboardKey["Zero"] = "Digit0";
10804
+ KeyboardKey["One"] = "Digit1";
10805
+ KeyboardKey["Two"] = "Digit2";
10806
+ KeyboardKey["Three"] = "Digit3";
10807
+ KeyboardKey["Four"] = "Digit4";
10808
+ KeyboardKey["Five"] = "Digit5";
10809
+ KeyboardKey["Six"] = "Digit6";
10810
+ KeyboardKey["Seven"] = "Digit7";
10811
+ KeyboardKey["Eight"] = "Digit8";
10812
+ KeyboardKey["Nine"] = "Digit9";
10813
+ KeyboardKey["NumpadZero"] = "Numpad0";
10814
+ KeyboardKey["NumpadOne"] = "Numpad1";
10815
+ KeyboardKey["NumpadTwo"] = "Numpad2";
10816
+ KeyboardKey["NumpadThree"] = "Numpad3";
10817
+ KeyboardKey["NumpadFour"] = "Numpad4";
10818
+ KeyboardKey["NumpadFive"] = "Numpad5";
10819
+ KeyboardKey["NumpadSix"] = "Numpad6";
10820
+ KeyboardKey["NumpadSeven"] = "Numpad7";
10821
+ KeyboardKey["NumpadEight"] = "Numpad8";
10822
+ KeyboardKey["NumpadNine"] = "Numpad9";
10823
+ KeyboardKey["A"] = "KeyA";
10824
+ KeyboardKey["B"] = "KeyB";
10825
+ KeyboardKey["C"] = "KeyC";
10826
+ KeyboardKey["D"] = "KeyD";
10827
+ KeyboardKey["E"] = "KeyE";
10828
+ KeyboardKey["F"] = "KeyF";
10829
+ KeyboardKey["G"] = "KeyG";
10830
+ KeyboardKey["H"] = "KeyH";
10831
+ KeyboardKey["I"] = "KeyI";
10832
+ KeyboardKey["J"] = "KeyJ";
10833
+ KeyboardKey["K"] = "KeyK";
10834
+ KeyboardKey["L"] = "KeyL";
10835
+ KeyboardKey["M"] = "KeyM";
10836
+ KeyboardKey["N"] = "KeyN";
10837
+ KeyboardKey["O"] = "KeyO";
10838
+ KeyboardKey["P"] = "KeyP";
10839
+ KeyboardKey["Q"] = "KeyQ";
10840
+ KeyboardKey["R"] = "KeyR";
10841
+ KeyboardKey["S"] = "KeyS";
10842
+ KeyboardKey["T"] = "KeyT";
10843
+ KeyboardKey["U"] = "KeyU";
10844
+ KeyboardKey["V"] = "KeyV";
10845
+ KeyboardKey["W"] = "KeyW";
10846
+ KeyboardKey["X"] = "KeyX";
10847
+ KeyboardKey["Y"] = "KeyY";
10848
+ KeyboardKey["Z"] = "KeyZ";
10849
+ })(KeyboardKey || (KeyboardKey = {}));
10850
+
10851
+ var ClickOutsideMasterService = /** @class */ (function () {
10852
+ function ClickOutsideMasterService(_ngZone) {
10853
+ var _this = this;
10854
+ this._ngZone = _ngZone;
10855
+ this._clickOutsideRefs = [];
10856
+ this.onClick = function (event) {
10857
+ _this._currentClick = event;
10858
+ var first = _this._clickOutsideRefs[0];
10859
+ var targets = _this._clickOutsideRefs.filter(function (co) { return co.alwaysTrigger; });
10860
+ if (first) {
10861
+ targets.push(first);
10757
10862
  }
10758
- else {
10759
- return i;
10863
+ setTimeout(function () {
10864
+ targets.forEach(function (clickOutside) { return _this.checkEmit(clickOutside, event); });
10865
+ });
10866
+ };
10867
+ this.onKeyDown = function (event) {
10868
+ if (event.key === KeyboardKey.Escape) {
10869
+ var first = _this._clickOutsideRefs[0];
10870
+ if (first) {
10871
+ _this.checkEmit(first, event, true);
10872
+ }
10760
10873
  }
10761
- }
10762
- else {
10763
- return i;
10874
+ };
10875
+ document.addEventListener('click', this.onClick, true);
10876
+ window.addEventListener('keydown', this.onKeyDown, EventUtils.passiveBubble);
10877
+ }
10878
+ Object.defineProperty(ClickOutsideMasterService.prototype, "currentClick", {
10879
+ get: function () {
10880
+ return this._currentClick;
10881
+ },
10882
+ enumerable: false,
10883
+ configurable: true
10884
+ });
10885
+ ClickOutsideMasterService.prototype.ngOnDestroy = function () {
10886
+ document.removeEventListener('click', this.onClick, true);
10887
+ window.removeEventListener('keydown', this.onKeyDown, EventUtils.passiveBubble);
10888
+ };
10889
+ ClickOutsideMasterService.prototype.checkEmit = function (clickOutside, event, force) {
10890
+ if (clickOutside && (clickOutside.currentClick !== this.currentClick || force) && this._clickOutsideRefs.indexOf(clickOutside) !== -1) {
10891
+ this._ngZone.run(function () { return clickOutside.clickOutside.emit(event); });
10764
10892
  }
10765
10893
  };
10766
- return PaginationComponent;
10894
+ ClickOutsideMasterService.prototype.addClickOutside = function (clickOutside) {
10895
+ this.removeClickOutside(clickOutside);
10896
+ this._clickOutsideRefs.unshift(clickOutside);
10897
+ };
10898
+ ClickOutsideMasterService.prototype.removeClickOutside = function (clickOutside) {
10899
+ ArrayUtils.RemoveElement(clickOutside, this._clickOutsideRefs);
10900
+ };
10901
+ return ClickOutsideMasterService;
10767
10902
  }());
10768
- PaginationComponent.decorators = [
10769
- { type: core.Component, args: [{
10770
- selector: 'co-pagination',
10771
- template: "\n <div class=\"pagination-component-main-wrapper\" *ngIf=\"!shouldBeHidden()\">\n <div>\n <ng-content></ng-content>\n </div>\n <ul class=\"pagination\">\n <li *ngIf=\"directionLinks\" class=\"pagination-previous\">\n <a (click)=\"goToPreviousPage()\" [class.disabled]=\"isOnFirstPage()\">{{ previousLabel }}</a>\n </li>\n <li *ngFor=\"let page of pages\" [class.current]=\"getCurrentPage() === page.value\" (click)=\"setCurrentPage(page.value)\">\n <span>{{page.label}}</span>\n </li>\n <li *ngIf=\"directionLinks\" class=\"pagination-next\">\n <a (click)=\"goToNextPage()\" [class.disabled]=\"isOnLastPage()\">{{ nextLabel }}</a>\n </li>\n </ul>\n </div>\n ",
10772
- encapsulation: core.ViewEncapsulation.None
10773
- },] }
10903
+ ClickOutsideMasterService.decorators = [
10904
+ { type: core.Injectable }
10774
10905
  ];
10775
- PaginationComponent.ctorParameters = function () { return [
10776
- { type: PaginationService }
10777
- ]; };
10778
- PaginationComponent.propDecorators = {
10779
- template: [{ type: core.ViewChild, args: ['template',] }],
10780
- id: [{ type: core.Input }],
10781
- maxSize: [{ type: core.Input }],
10782
- directionLinks: [{ type: core.Input }],
10783
- previousLabel: [{ type: core.Input }],
10784
- nextLabel: [{ type: core.Input }],
10785
- autoHide: [{ type: core.Input }],
10786
- pageChange: [{ type: core.Output }],
10787
- showClass: [{ type: core.HostBinding, args: ['class.co-pagination',] }]
10788
- };
10906
+ ClickOutsideMasterService.ctorParameters = function () { return [
10907
+ { type: core.NgZone }
10908
+ ]; };
10789
10909
 
10790
- var LARGE_NUMBER = 999999999;
10791
- var PaginatePipe = /** @class */ (function () {
10792
- function PaginatePipe(paginateService) {
10793
- this.paginateService = paginateService;
10794
- // store the values from the last time the pipe
10795
- this.state = {};
10796
- }
10797
- PaginatePipe.prototype.transform = function (collection, args) {
10798
- // When an observable is passed through the AsyncPipe, it will output
10799
- // `null` until the subscription resolves. In this case, we want to
10800
- // use the cached data from the `state` object to prevent the NgFor
10801
- // from flashing empty until the real values arrive.
10802
- if (!(collection instanceof Array)) {
10803
- var _id = args.id || this.paginateService.DEFAULT_ID;
10804
- if (this.state[_id]) {
10805
- return this.state[_id].slice;
10806
- }
10807
- else {
10808
- return collection;
10809
- }
10810
- }
10811
- var serverSideMode = args.totalItems !== undefined;
10812
- var instance = this._createInstance(collection, args);
10813
- var id = instance.id;
10814
- var start;
10815
- var end;
10816
- var perPage = instance.itemsPerPage;
10817
- this.paginateService.register(instance);
10818
- if (!serverSideMode && collection instanceof Array) {
10819
- perPage = perPage || LARGE_NUMBER;
10820
- start = (instance.currentPage - 1) * perPage;
10821
- end = start + perPage;
10822
- var isIdentical = this._stateIsIdentical(id, collection, start, end);
10823
- if (isIdentical) {
10824
- return this.state[id].slice;
10825
- }
10826
- else {
10827
- var slice = collection.slice(start, end);
10828
- this._saveState(id, collection, slice, start, end);
10829
- this.paginateService.change.next(id);
10830
- return slice;
10910
+ var ClickOutsideDirective = /** @class */ (function () {
10911
+ function ClickOutsideDirective(elementRef, _ngZone, _master) {
10912
+ var _this = this;
10913
+ this.elementRef = elementRef;
10914
+ this._ngZone = _ngZone;
10915
+ this._master = _master;
10916
+ this.clickOutside = new core.EventEmitter();
10917
+ this._enabled = true;
10918
+ this._initialized = false;
10919
+ this.onClick = function (event) {
10920
+ if (_this._enabled) {
10921
+ _this._currentClick = event;
10831
10922
  }
10832
- }
10833
- // save the state for server-side collection to avoid null
10834
- // flash as new data loads.
10835
- this._saveState(id, collection, collection, start, end);
10836
- return collection;
10837
- };
10838
- // Create an IPaginationInstance object, using defaults for any optional properties not supplied.
10839
- PaginatePipe.prototype._createInstance = function (collection, args) {
10840
- var config = args;
10841
- this._checkConfig(config);
10842
- return {
10843
- id: config.id || this.paginateService.DEFAULT_ID,
10844
- itemsPerPage: config.itemsPerPage || 0,
10845
- currentPage: config.currentPage || 1,
10846
- totalItems: config.totalItems || collection.length
10847
- };
10848
- };
10849
- // Ensure the argument passed to the filter contains the required properties.
10850
- PaginatePipe.prototype._checkConfig = function (config) {
10851
- var required = ["itemsPerPage", "currentPage"];
10852
- var missing = required.filter(function (prop) { return !config.hasOwnProperty(prop); });
10853
- if (0 < missing.length) {
10854
- throw new Error("PaginatePipe: Argument is missing the following required properties: " + missing.join(", "));
10855
- }
10856
- };
10857
- /**
10858
- * To avoid returning a brand new array each time the pipe is run, we store the state of the sliced
10859
- * array for a given id. This means that the next time the pipe is run on this collection & id, we just
10860
- * need to check that the collection, start and end points are all identical, and if so, return the
10861
- * last sliced array.
10862
- */
10863
- PaginatePipe.prototype._saveState = function (id, collection, slice, start, end) {
10864
- this.state[id] = {
10865
- collection: collection,
10866
- size: collection.length,
10867
- slice: slice,
10868
- start: start,
10869
- end: end
10870
10923
  };
10924
+ }
10925
+ Object.defineProperty(ClickOutsideDirective.prototype, "currentClick", {
10926
+ get: function () {
10927
+ return this._currentClick;
10928
+ },
10929
+ enumerable: false,
10930
+ configurable: true
10931
+ });
10932
+ Object.defineProperty(ClickOutsideDirective.prototype, "enabled", {
10933
+ set: function (enabled) {
10934
+ enabled = enabled === undefined || enabled;
10935
+ // noinspection SuspiciousTypeOfGuard
10936
+ if (typeof enabled === 'boolean' && this._enabled !== enabled) {
10937
+ this._enabled = enabled;
10938
+ if (this._initialized) {
10939
+ this._enabled ? this._master.addClickOutside(this) : this._master.removeClickOutside(this);
10940
+ }
10941
+ }
10942
+ },
10943
+ enumerable: false,
10944
+ configurable: true
10945
+ });
10946
+ ClickOutsideDirective.prototype.ngAfterViewInit = function () {
10947
+ var _this = this;
10948
+ setTimeout(function () {
10949
+ _this._ngZone.runOutsideAngular(function () {
10950
+ if (_this.elementRef && _this.elementRef.nativeElement) {
10951
+ _this.elementRef.nativeElement.addEventListener('click', _this.onClick, EventUtils.passiveCapture);
10952
+ if (_this._enabled) {
10953
+ _this._master.addClickOutside(_this);
10954
+ }
10955
+ _this._initialized = true;
10956
+ }
10957
+ });
10958
+ });
10871
10959
  };
10872
- // For a given id, returns true if the collection, size, start and end values are identical.
10873
- PaginatePipe.prototype._stateIsIdentical = function (id, collection, start, end) {
10874
- var state = this.state[id];
10875
- if (!state) {
10876
- return false;
10877
- }
10878
- return state.collection === collection &&
10879
- state.size === collection.length &&
10880
- state.start === start &&
10881
- state.end === end;
10960
+ ClickOutsideDirective.prototype.ngOnDestroy = function () {
10961
+ this._master.removeClickOutside(this);
10962
+ this.elementRef.nativeElement.removeEventListener('click', this.onClick, EventUtils.passiveCapture);
10963
+ this.elementRef = undefined;
10882
10964
  };
10883
- return PaginatePipe;
10965
+ return ClickOutsideDirective;
10884
10966
  }());
10885
- PaginatePipe.decorators = [
10886
- { type: core.Pipe, args: [{
10887
- name: 'paginate',
10888
- pure: false
10967
+ ClickOutsideDirective.decorators = [
10968
+ { type: core.Directive, args: [{
10969
+ selector: "[clickOutside]",
10970
+ exportAs: 'clickOutside'
10889
10971
  },] }
10890
10972
  ];
10891
- PaginatePipe.ctorParameters = function () { return [
10892
- { type: PaginationService }
10893
- ]; };
10973
+ ClickOutsideDirective.ctorParameters = function () { return [
10974
+ { type: core.ElementRef },
10975
+ { type: core.NgZone },
10976
+ { type: ClickOutsideMasterService }
10977
+ ]; };
10978
+ ClickOutsideDirective.propDecorators = {
10979
+ enabled: [{ type: core.Input, args: ["clickOutside",] }],
10980
+ alwaysTrigger: [{ type: core.Input }],
10981
+ clickOutside: [{ type: core.Output }]
10982
+ };
10983
+ __decorate([
10984
+ InputBoolean()
10985
+ ], ClickOutsideDirective.prototype, "alwaysTrigger", void 0);
10894
10986
 
10895
- var PaginationModule = /** @class */ (function () {
10896
- function PaginationModule() {
10987
+ var ClickoutsideModule = /** @class */ (function () {
10988
+ function ClickoutsideModule() {
10897
10989
  }
10898
- return PaginationModule;
10990
+ return ClickoutsideModule;
10899
10991
  }());
10900
- PaginationModule.decorators = [
10992
+ ClickoutsideModule.decorators = [
10901
10993
  { type: core.NgModule, args: [{
10902
- imports: [
10903
- common.CommonModule
10994
+ declarations: [
10995
+ ClickOutsideDirective
10904
10996
  ],
10905
10997
  providers: [
10906
- PaginationService
10907
- ],
10908
- declarations: [
10909
- PaginationComponent,
10910
- PaginatePipe
10998
+ ClickOutsideMasterService
10911
10999
  ],
10912
11000
  exports: [
10913
- PaginationComponent,
10914
- PaginatePipe
11001
+ ClickOutsideDirective
10915
11002
  ]
10916
11003
  },] }
10917
11004
  ];
@@ -11001,6 +11088,8 @@
11001
11088
  exports.MultiSelectListComponent = MultiSelectListComponent;
11002
11089
  exports.MultiSelectListModule = MultiSelectListModule;
11003
11090
  exports.ObserveVisibilityModule = ObserveVisibilityModule;
11091
+ exports.PaginationBarComponent = PaginationBarComponent;
11092
+ exports.PaginationBarModule = PaginationBarModule;
11004
11093
  exports.PaginationComponent = PaginationComponent;
11005
11094
  exports.PaginationModule = PaginationModule;
11006
11095
  exports.PopupButtonsComponent = PopupButtonsComponent;
@@ -11018,13 +11107,13 @@
11018
11107
  exports.TileModule = TileModule;
11019
11108
  exports["ɵa"] = RippleModule;
11020
11109
  exports["ɵb"] = MD_RIPPLE_GLOBAL_OPTIONS;
11021
- exports["ɵba"] = SimpleGridCellComponent;
11022
- exports["ɵbb"] = PrependPipeModule;
11023
- exports["ɵbc"] = PrependPipe;
11024
- exports["ɵbd"] = ClickOutsideDirective;
11025
- exports["ɵbe"] = ClickOutsideMasterService;
11026
- exports["ɵbf"] = PaginationService;
11027
- exports["ɵbg"] = PaginatePipe;
11110
+ exports["ɵba"] = PaginationService;
11111
+ exports["ɵbb"] = PaginatePipe;
11112
+ exports["ɵbc"] = SimpleGridCellComponent;
11113
+ exports["ɵbd"] = PrependPipeModule;
11114
+ exports["ɵbe"] = PrependPipe;
11115
+ exports["ɵbf"] = ClickOutsideDirective;
11116
+ exports["ɵbg"] = ClickOutsideMasterService;
11028
11117
  exports["ɵc"] = CoRippleDirective;
11029
11118
  exports["ɵd"] = CoViewportRulerService;
11030
11119
  exports["ɵe"] = CoScrollDispatcherService;