@colijnit/corecomponents_v12 12.0.54 → 12.0.55
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.
- package/bundles/colijnit-corecomponents_v12.umd.js +15 -21
- package/bundles/colijnit-corecomponents_v12.umd.js.map +1 -1
- package/colijnit-corecomponents_v12.metadata.json +1 -1
- package/esm2015/lib/components/pagination/pagination.component.js +4 -20
- package/esm2015/lib/components/pagination-bar/pagination-bar.component.js +12 -2
- package/esm2015/lib/components/simple-grid/simple-grid.component.js +2 -1
- package/fesm2015/colijnit-corecomponents_v12.js +15 -20
- package/fesm2015/colijnit-corecomponents_v12.js.map +1 -1
- package/lib/components/pagination/pagination.component.d.ts +0 -3
- package/lib/components/pagination-bar/pagination-bar.component.d.ts +2 -0
- package/package.json +1 -1
|
@@ -9792,7 +9792,7 @@
|
|
|
9792
9792
|
SimpleGridComponent.decorators = [
|
|
9793
9793
|
{ type: core.Component, args: [{
|
|
9794
9794
|
selector: 'co-simple-grid',
|
|
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 || ' '\"\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 (previousClick)=\"goToPreviousPage()\"\n (nextClick)=\"goToNextPage()\"\n (pageClick)=\"setCurrentPage($event)\"\n ></co-pagination-bar>\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 || ' '\"\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 ",
|
|
9796
9796
|
providers: [
|
|
9797
9797
|
FormMasterService
|
|
9798
9798
|
],
|
|
@@ -9823,6 +9823,7 @@
|
|
|
9823
9823
|
this.itemsPerPage = 20;
|
|
9824
9824
|
this.totalItems = 1;
|
|
9825
9825
|
this.paginationRange = 8;
|
|
9826
|
+
this.autoHide = false;
|
|
9826
9827
|
this.previousClick = new core.EventEmitter();
|
|
9827
9828
|
this.nextClick = new core.EventEmitter();
|
|
9828
9829
|
this.pageClick = new core.EventEmitter();
|
|
@@ -9860,6 +9861,14 @@
|
|
|
9860
9861
|
this.currentPage = value;
|
|
9861
9862
|
this.pageClick.emit(value);
|
|
9862
9863
|
};
|
|
9864
|
+
PaginationBarComponent.prototype.shouldBeHidden = function () {
|
|
9865
|
+
if (!this.autoHide) {
|
|
9866
|
+
return false;
|
|
9867
|
+
}
|
|
9868
|
+
else {
|
|
9869
|
+
return (this.totalItems <= this.itemsPerPage);
|
|
9870
|
+
}
|
|
9871
|
+
};
|
|
9863
9872
|
// Returns an array of IPage objects to use in the pagination controls.
|
|
9864
9873
|
PaginationBarComponent.prototype._createPageArray = function () {
|
|
9865
9874
|
// paginationRange could be a string if passed from attribute, so cast to number.
|
|
@@ -9919,7 +9928,7 @@
|
|
|
9919
9928
|
PaginationBarComponent.decorators = [
|
|
9920
9929
|
{ type: core.Component, args: [{
|
|
9921
9930
|
selector: "co-pagination-bar",
|
|
9922
|
-
template: "\n <ul class=\"pagination\">\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 ",
|
|
9931
|
+
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 ",
|
|
9923
9932
|
encapsulation: core.ViewEncapsulation.None
|
|
9924
9933
|
},] }
|
|
9925
9934
|
];
|
|
@@ -9931,6 +9940,7 @@
|
|
|
9931
9940
|
itemsPerPage: [{ type: core.Input }],
|
|
9932
9941
|
totalItems: [{ type: core.Input }],
|
|
9933
9942
|
paginationRange: [{ type: core.Input }],
|
|
9943
|
+
autoHide: [{ type: core.Input }],
|
|
9934
9944
|
previousClick: [{ type: core.Output }],
|
|
9935
9945
|
nextClick: [{ type: core.Output }],
|
|
9936
9946
|
pageClick: [{ type: core.Output }],
|
|
@@ -10185,29 +10195,17 @@
|
|
|
10185
10195
|
this.changeSub.unsubscribe();
|
|
10186
10196
|
};
|
|
10187
10197
|
PaginationComponent.prototype.goToFirstPage = function () {
|
|
10188
|
-
|
|
10189
|
-
this.setCurrentPage(1);
|
|
10190
|
-
}
|
|
10198
|
+
this.setCurrentPage(1);
|
|
10191
10199
|
};
|
|
10192
10200
|
PaginationComponent.prototype.goToPreviousPage = function () {
|
|
10193
|
-
|
|
10194
|
-
this.setCurrentPage(this.getCurrentPage() - 1);
|
|
10195
|
-
}
|
|
10201
|
+
this.setCurrentPage(this.getCurrentPage() - 1);
|
|
10196
10202
|
};
|
|
10197
10203
|
PaginationComponent.prototype.goToNextPage = function () {
|
|
10198
|
-
|
|
10199
|
-
this.setCurrentPage(this.getCurrentPage() + 1);
|
|
10200
|
-
}
|
|
10204
|
+
this.setCurrentPage(this.getCurrentPage() + 1);
|
|
10201
10205
|
};
|
|
10202
10206
|
PaginationComponent.prototype.setCurrentPage = function (page) {
|
|
10203
10207
|
this.pageChange.emit(page);
|
|
10204
10208
|
};
|
|
10205
|
-
PaginationComponent.prototype.isOnFirstPage = function () {
|
|
10206
|
-
return this.getCurrentPage() === 1;
|
|
10207
|
-
};
|
|
10208
|
-
PaginationComponent.prototype.isOnLastPage = function () {
|
|
10209
|
-
return this.getLastPage() === this.getCurrentPage();
|
|
10210
|
-
};
|
|
10211
10209
|
PaginationComponent.prototype.shouldBeHidden = function () {
|
|
10212
10210
|
if (!this.autoHide) {
|
|
10213
10211
|
return false;
|
|
@@ -10234,10 +10232,6 @@
|
|
|
10234
10232
|
PaginationComponent.prototype.getCurrentPage = function () {
|
|
10235
10233
|
return this._paginationService.getCurrentPage(this.id);
|
|
10236
10234
|
};
|
|
10237
|
-
PaginationComponent.prototype.getLastPage = function () {
|
|
10238
|
-
var instance = this._paginationService.getInstance(this.id);
|
|
10239
|
-
return Math.ceil(instance.totalItems / instance.itemsPerPage);
|
|
10240
|
-
};
|
|
10241
10235
|
/**
|
|
10242
10236
|
* Checks that the instance.currentPage property is within bounds for the current page range.
|
|
10243
10237
|
* If not, return a correct value for currentPage, or the current value if OK.
|