@colijnit/corecomponents_v12 12.0.53 → 12.0.56

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.
@@ -6352,7 +6352,7 @@
6352
6352
  InputDatePickerComponent.decorators = [
6353
6353
  { type: core.Component, args: [{
6354
6354
  selector: "co-input-date",
6355
- template: "\n <ejs-datepicker #ejsDatePicker\n floatLabelType=\"Auto\"\n [format]=\"dateFormat\"\n [placeholder]=\"placeholder\"\n [ngModel]=\"model\"\n [readonly]=\"readonly\"\n (ngModelChange)=\"modelChange.emit($event)\"\n ></ejs-datepicker>\n <div class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
6355
+ template: "\n <ejs-datepicker #ejsDatePicker\n floatLabelType=\"Auto\"\n [format]=\"dateFormat\"\n [placeholder]=\"placeholder\"\n [ngModel]=\"model\"\n (ngModelChange)=\"modelChange.emit($event)\"\n ></ejs-datepicker>\n <div class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
6356
6356
  providers: [{
6357
6357
  provide: COMPONENT_INTERFACE_NAME, useExisting: core.forwardRef(function () { return InputDatePickerComponent; })
6358
6358
  }, {
@@ -6434,7 +6434,7 @@
6434
6434
  InputDateRangePickerComponent.decorators = [
6435
6435
  { type: core.Component, args: [{
6436
6436
  selector: "co-input-date-range",
6437
- template: "\n <ejs-daterangepicker\n [format]=\"dateFormat\"\n [placeholder]=\"placeholder\"\n [ngModel]=\"model\"\n [(startDate)]=\"startDate\"\n [(endDate)]=\"endDate\"\n [readonly]=\"readonly\"\n (ngModelChange)=\"rangeChange()\"\n (close)=\"close.next($event)\"\n (select)=\"select.next($event)\"\n (cleared)=\"cleared.next($event)\"\n ></ejs-daterangepicker>\n <div class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
6437
+ template: "\n <ejs-daterangepicker\n [format]=\"dateFormat\"\n [placeholder]=\"placeholder\"\n [ngModel]=\"model\"\n (ngModelChange)=\"rangeChange()\"\n (close)=\"close.next($event)\"\n (select)=\"select.next($event)\"\n (cleared)=\"cleared.next($event)\"\n [(startDate)]=\"startDate\"\n [(endDate)]=\"endDate\"\n ></ejs-daterangepicker>\n <div class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
6438
6438
  encapsulation: core.ViewEncapsulation.None
6439
6439
  },] }
6440
6440
  ];
@@ -9775,9 +9775,14 @@
9775
9775
  }
9776
9776
  this._detectChanges();
9777
9777
  };
9778
- SimpleGridComponent.prototype.pageChange = function (page) {
9778
+ SimpleGridComponent.prototype.goToPreviousPage = function () {
9779
+ this.currentPage -= 1;
9780
+ };
9781
+ SimpleGridComponent.prototype.goToNextPage = function () {
9782
+ this.currentPage += 1;
9783
+ };
9784
+ SimpleGridComponent.prototype.setCurrentPage = function (page) {
9779
9785
  this.currentPage = page;
9780
- //this.gridBody.nativeElement.scrollTop = 0;
9781
9786
  };
9782
9787
  SimpleGridComponent.prototype._detectChanges = function () {
9783
9788
  this._changeDetection.detectChanges();
@@ -9787,7 +9792,7 @@
9787
9792
  SimpleGridComponent.decorators = [
9788
9793
  { type: core.Component, args: [{
9789
9794
  selector: 'co-simple-grid',
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 ",
9795
+ template: "\n <co-grid-toolbar *ngIf=\"showToolbar\" [class.right]=\"rightToolbar\"\n [showEdit]=\"inlineEdit\"\n [showAdd]=\"showAdd\"\n [showDelete]=\"showDelete\"\n [deleteEnabled]=\"selectedRowIndex > -1\"\n (addClick)=\"addNewRow()\"\n (editClick)=\"editRow($event)\"\n (saveClick)=\"validateAndSave()\"\n (cancelClick)=\"cancelEditRow()\"\n (deleteClick)=\"removeRow()\"\n ></co-grid-toolbar>\n <table class=\"simple-grid-table\">\n <colgroup>\n <col *ngFor=\"let column of headerColumns; let index = index\"\n [class.simple-grid-column-auto-fit]=\"column.autoFit\"\n [style.width.px]=\"column.width\"\n [style.min-width.px]=\"MIN_COLUMN_WIDTH\">\n </colgroup>\n <thead>\n <tr>\n <th scope=\"col\" #headerCell class=\"simple-grid-column-header\" *ngFor=\"let column of headerColumns; let index = index\">\n <div class=\"simple-grid-column-header-wrapper\" [class.resizable]=\"resizable\"\n [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\">\n <ng-container *ngIf=\"column.headerTemplate; else noHeaderTemplate\">\n <ng-container [ngTemplateOutlet]=\"column.headerTemplate\"></ng-container>\n </ng-container>\n <ng-template #noHeaderTemplate>\n <div class=\"simple-grid-column-header-label\" [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\"\n [textContent]=\"column.headerText || '&nbsp;'\"\n ></div>\n </ng-template>\n <div *ngIf=\"resizable && column.resizable\" class=\"simple-grid-column-sizer\"\n (mousedown)=\"handleSizerMouseDown($event, column)\"\n ></div>\n </div>\n </th>\n </tr>\n </thead>\n <tbody #dropList cdkDropList cdkDropListOrientation=\"vertical\"\n class=\"simple-grid-drag-drop-list\"\n [cdkDropListDisabled]=\"!dragDropEnabled\"\n [cdkDropListData]=\"data\"\n [cdkDropListEnterPredicate]=\"handleCanDragDrop\"\n (cdkDropListDropped)=\"handleDrop($event)\">\n <tr class=\"simple-grid-row\" [class.selected]=\"rowIndex === selectedRowIndex && !editing\" observeVisibility\n [class.editing]=\"rowIndex === editRowIndex\" *ngFor=\"let row of (!!rowsPerPage ? (data | paginate: {itemsPerPage: rowsPerPage, currentPage: currentPage}) : data); last as last; let rowIndex = index\" cdkDrag\n (click)=\"handleClickRow($event, rowIndex)\" (dblclick)=\"handleDblClickRow($event, rowIndex)\" (visible)=\"rowVisible.next(row)\">\n <co-form class=\"simple-grid-row-form\">\n <ng-container *ngIf=\"isSingleColumnRow(row)\">\n <td class=\"simple-grid-single-column-cell\" [attr.colspan]=\"headerColumns.length\">\n <co-simple-grid-cell\n [column]=\"columns[singleColumnIndex(row)]\"\n [row]=\"row\"\n [editMode]=\"false\"\n ></co-simple-grid-cell>\n </td>\n </ng-container>\n <ng-container *ngIf=\"!isSingleColumnRow(row)\">\n <ng-container *ngFor=\"let column of headerColumns; let columnIndex = index\">\n <td class=\"simple-grid-column-cell\" *ngIf=\"columnIndex !== singleColumnIndex(row)\">\n <co-simple-grid-cell\n [column]=\"column\"\n [row]=\"row\"\n [editMode]=\"inlineEdit && editing && rowIndex === editRowIndex\"\n [fieldEditMode]=\"editCellIndex === columnIndex\"\n (cellClick)=\"handleCellClick(columnIndex)\"\n ></co-simple-grid-cell>\n <div *ngIf=\"column.resizable\" class=\"simple-grid-column-sizer-placeholder\"></div>\n </td>\n </ng-container>\n </ng-container>\n </co-form>\n </tr>\n </tbody>\n </table>\n <co-pagination-bar *ngIf=\"data?.length > rowsPerPage\"\n [itemsPerPage]=\"rowsPerPage\"\n [currentPage]=\"currentPage\"\n [totalItems]=\"data.length\"\n [autoHide]=\"true\"\n (previousClick)=\"goToPreviousPage()\"\n (nextClick)=\"goToNextPage()\"\n (pageClick)=\"setCurrentPage($event)\"\n ></co-pagination-bar>\n ",
9791
9796
  providers: [
9792
9797
  FormMasterService
9793
9798
  ],
@@ -9818,6 +9823,7 @@
9818
9823
  this.itemsPerPage = 20;
9819
9824
  this.totalItems = 1;
9820
9825
  this.paginationRange = 8;
9826
+ this.autoHide = false;
9821
9827
  this.previousClick = new core.EventEmitter();
9822
9828
  this.nextClick = new core.EventEmitter();
9823
9829
  this.pageClick = new core.EventEmitter();
@@ -9831,9 +9837,7 @@
9831
9837
  this.pages = this._createPageArray();
9832
9838
  };
9833
9839
  PaginationBarComponent.prototype.ngOnChanges = function (changes) {
9834
- if (changes['currentPage'].currentValue !== changes['currentPage'].previousValue) {
9835
- this.pages = this._createPageArray();
9836
- }
9840
+ this.pages = this._createPageArray();
9837
9841
  };
9838
9842
  PaginationBarComponent.prototype.isOnFirstPage = function () {
9839
9843
  return this.currentPage === 1;
@@ -9842,15 +9846,27 @@
9842
9846
  return this.pages.length === this.currentPage;
9843
9847
  };
9844
9848
  PaginationBarComponent.prototype.onPreviousClick = function () {
9845
- this.previousClick.emit();
9849
+ if (!this.isOnFirstPage()) {
9850
+ this.previousClick.emit();
9851
+ }
9846
9852
  };
9847
9853
  PaginationBarComponent.prototype.onNextClick = function () {
9848
- this.nextClick.emit();
9854
+ if (!this.isOnLastPage()) {
9855
+ this.nextClick.emit();
9856
+ }
9849
9857
  };
9850
9858
  PaginationBarComponent.prototype.onPageClick = function (value) {
9851
9859
  this.currentPage = value;
9852
9860
  this.pageClick.emit(value);
9853
9861
  };
9862
+ PaginationBarComponent.prototype.shouldBeHidden = function () {
9863
+ if (!this.autoHide) {
9864
+ return false;
9865
+ }
9866
+ else {
9867
+ return (this.totalItems <= this.itemsPerPage);
9868
+ }
9869
+ };
9854
9870
  // Returns an array of IPage objects to use in the pagination controls.
9855
9871
  PaginationBarComponent.prototype._createPageArray = function () {
9856
9872
  // paginationRange could be a string if passed from attribute, so cast to number.
@@ -9910,7 +9926,7 @@
9910
9926
  PaginationBarComponent.decorators = [
9911
9927
  { type: core.Component, args: [{
9912
9928
  selector: "co-pagination-bar",
9913
- 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 ",
9929
+ template: "\n <ul class=\"pagination\" *ngIf=\"!shouldBeHidden()\">\n <li *ngIf=\"directionLinks\" class=\"pagination-previous\" [class.disabled]=\"isOnFirstPage()\">\n <a (click)=\"onPreviousClick()\" [class.disabled]=\"isOnFirstPage()\">{{ previousLabel }}</a>\n </li>\n <li *ngFor=\"let page of pages\" [class.current]=\"currentPage === page.value\" (click)=\"onPageClick(page.value)\">\n <span>{{page.label}}</span>\n </li>\n <li *ngIf=\"directionLinks\" class=\"pagination-next\" [class.disabled]=\"isOnLastPage()\">\n <a (click)=\"onNextClick()\" [class.disabled]=\"isOnLastPage()\">{{ nextLabel }}</a>\n </li>\n </ul>\n ",
9914
9930
  encapsulation: core.ViewEncapsulation.None
9915
9931
  },] }
9916
9932
  ];
@@ -9922,6 +9938,7 @@
9922
9938
  itemsPerPage: [{ type: core.Input }],
9923
9939
  totalItems: [{ type: core.Input }],
9924
9940
  paginationRange: [{ type: core.Input }],
9941
+ autoHide: [{ type: core.Input }],
9925
9942
  previousClick: [{ type: core.Output }],
9926
9943
  nextClick: [{ type: core.Output }],
9927
9944
  pageClick: [{ type: core.Output }],
@@ -10176,29 +10193,17 @@
10176
10193
  this.changeSub.unsubscribe();
10177
10194
  };
10178
10195
  PaginationComponent.prototype.goToFirstPage = function () {
10179
- if (!this.isOnFirstPage()) {
10180
- this.setCurrentPage(1);
10181
- }
10196
+ this.setCurrentPage(1);
10182
10197
  };
10183
10198
  PaginationComponent.prototype.goToPreviousPage = function () {
10184
- if (!this.isOnFirstPage()) {
10185
- this.setCurrentPage(this.getCurrentPage() - 1);
10186
- }
10199
+ this.setCurrentPage(this.getCurrentPage() - 1);
10187
10200
  };
10188
10201
  PaginationComponent.prototype.goToNextPage = function () {
10189
- if (!this.isOnLastPage()) {
10190
- this.setCurrentPage(this.getCurrentPage() + 1);
10191
- }
10202
+ this.setCurrentPage(this.getCurrentPage() + 1);
10192
10203
  };
10193
10204
  PaginationComponent.prototype.setCurrentPage = function (page) {
10194
10205
  this.pageChange.emit(page);
10195
10206
  };
10196
- PaginationComponent.prototype.isOnFirstPage = function () {
10197
- return this.getCurrentPage() === 1;
10198
- };
10199
- PaginationComponent.prototype.isOnLastPage = function () {
10200
- return this.getLastPage() === this.getCurrentPage();
10201
- };
10202
10207
  PaginationComponent.prototype.shouldBeHidden = function () {
10203
10208
  if (!this.autoHide) {
10204
10209
  return false;
@@ -10225,10 +10230,6 @@
10225
10230
  PaginationComponent.prototype.getCurrentPage = function () {
10226
10231
  return this._paginationService.getCurrentPage(this.id);
10227
10232
  };
10228
- PaginationComponent.prototype.getLastPage = function () {
10229
- var instance = this._paginationService.getInstance(this.id);
10230
- return Math.ceil(instance.totalItems / instance.itemsPerPage);
10231
- };
10232
10233
  /**
10233
10234
  * Checks that the instance.currentPage property is within bounds for the current page range.
10234
10235
  * If not, return a correct value for currentPage, or the current value if OK.
@@ -10565,7 +10566,8 @@
10565
10566
  InputTextModule,
10566
10567
  FormModule,
10567
10568
  ObserveVisibilityModule,
10568
- PaginationModule
10569
+ PaginationModule,
10570
+ PaginationBarModule
10569
10571
  ],
10570
10572
  declarations: [
10571
10573
  SimpleGridComponent,