@stemy/ngx-utils 12.2.20 → 12.2.21
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/stemy-ngx-utils.umd.js +5 -2
- package/bundles/stemy-ngx-utils.umd.js.map +1 -1
- package/esm2015/ngx-utils/components/dynamic-table/dynamic-table.component.js +4 -2
- package/esm2015/ngx-utils/directives/pagination-item.directive.js +3 -2
- package/fesm2015/stemy-ngx-utils.js +5 -2
- package/fesm2015/stemy-ngx-utils.js.map +1 -1
- package/ngx-utils/components/dynamic-table/dynamic-table.component.d.ts +1 -0
- package/package.json +1 -1
- package/stemy-ngx-utils.metadata.json +1 -1
|
@@ -5536,8 +5536,9 @@
|
|
|
5536
5536
|
PaginationItemDirective.prototype.renderView = function () {
|
|
5537
5537
|
var _this = this;
|
|
5538
5538
|
this.viewContainer.clear();
|
|
5539
|
-
this.pagination.items.forEach(function (item) {
|
|
5539
|
+
this.pagination.items.forEach(function (item, ix) {
|
|
5540
5540
|
item.$implicit = item;
|
|
5541
|
+
item.rowIndex = ix;
|
|
5541
5542
|
_this.viewContainer.createEmbeddedView(_this.templateRef, item);
|
|
5542
5543
|
});
|
|
5543
5544
|
};
|
|
@@ -5856,6 +5857,7 @@
|
|
|
5856
5857
|
this.tableId = UniqueUtils.uuid();
|
|
5857
5858
|
this.templates = {};
|
|
5858
5859
|
this.filter = "";
|
|
5860
|
+
this.testId = "table";
|
|
5859
5861
|
this.orders = {};
|
|
5860
5862
|
}
|
|
5861
5863
|
Object.defineProperty(DynamicTableComponent.prototype, "items", {
|
|
@@ -5954,7 +5956,7 @@
|
|
|
5954
5956
|
DynamicTableComponent.decorators = [
|
|
5955
5957
|
{ type: core.Component, args: [{
|
|
5956
5958
|
selector: "dynamic-table",
|
|
5957
|
-
template: "<div class=\"dynamic-table\" #pagination=\"pagination\" [pagination]=\"loadData\" [itemsPerPage]=\"itemsPerPage\" [updateTime]=\"updateTime\">\r\n <ng-template #defaultFilterTemplate let-table>\r\n <div class=\"table-search\" *ngIf=\"table.showFilter\">\r\n <label *ngIf=\"label\" [attr.for]=\"tableId\">{{ label | translate }}</label>\r\n <input type=\"text\"\r\n class=\"form-control\"\r\n [attr.id]=\"tableId\"\r\n [placeholder]=\"placeholder | translate\"\r\n [ngModel]=\"table.filter\"\r\n (ngModelChange)=\"table.setFilter($event)\"/>\r\n </div>\r\n </ng-template>\r\n <ng-container [ngxTemplateOutlet]=\"filterTemplate || defaultFilterTemplate\" [context]=\"this\"></ng-container>\r\n <pagination-menu [maxSize]=\"maxPages\" [directionLinks]=\"directionLinks\" [boundaryLinks]=\"boundaryLinks\"></pagination-menu>\r\n <div class=\"table-responsive\">\r\n
|
|
5959
|
+
template: "<div class=\"dynamic-table\" #pagination=\"pagination\" [pagination]=\"loadData\" [itemsPerPage]=\"itemsPerPage\" [updateTime]=\"updateTime\">\r\n <ng-template #defaultFilterTemplate let-table>\r\n <div class=\"table-search\" *ngIf=\"table.showFilter\">\r\n <label *ngIf=\"label\" [attr.for]=\"tableId\">{{ label | translate }}</label>\r\n <input type=\"text\"\r\n class=\"form-control\"\r\n [attr.id]=\"tableId\"\r\n [attr.data-testid]=\"testId + '-filter-input'\"\r\n [placeholder]=\"placeholder | translate\"\r\n [ngModel]=\"table.filter\"\r\n (ngModelChange)=\"table.setFilter($event)\"/>\r\n </div>\r\n </ng-template>\r\n <ng-container [ngxTemplateOutlet]=\"filterTemplate || defaultFilterTemplate\" [context]=\"this\"></ng-container>\r\n <pagination-menu [maxSize]=\"maxPages\" [directionLinks]=\"directionLinks\" [boundaryLinks]=\"boundaryLinks\"></pagination-menu>\r\n <div class=\"table-responsive\">\r\n <ng-template #columnTemplate let-context let-column=\"column\" let-template=\"template\">\r\n <ng-template #defaultTemplate let-column=\"column\" let-item=\"item\">\r\n <span>{{ item[column] == undefined || item[column] == null ? '-' : item[column] }}</span>\r\n </ng-template>\r\n <ng-template #pureTemplate>\r\n <ng-container [ngxTemplateOutlet]=\"template.ref\" [context]=\"context\"></ng-container>\r\n </ng-template>\r\n <td [ngClass]=\"'column-' + column\"\r\n [attr.data-testid]=\"testId + '-' + column + '-' + context.rowIndex\" *ngIf=\"!template || !template.pure; else pureTemplate\">\r\n <ng-container [ngxTemplateOutlet]=\"!template ? defaultTemplate : template.ref\" [context]=\"context\"></ng-container>\r\n </td>\r\n </ng-template>\r\n\r\n <ng-template #columnsTemplate let-context>\r\n <ng-container *ngFor=\"let column of cols\"\r\n [ngxTemplateOutlet]=\"columnTemplate\"\r\n [context]=\"context\"\r\n [additionalContext]=\"{\r\n template: templates[column],\r\n column: column\r\n }\"></ng-container>\r\n </ng-template>\r\n\r\n <ng-template #defaultRowTemplate let-context>\r\n <tr>\r\n <ng-container [ngxTemplateOutlet]=\"columnsTemplate\" [context]=\"context\"></ng-container>\r\n </tr>\r\n </ng-template>\r\n\r\n <ng-template #defaultWrapperTemplate>\r\n <table class=\"table table-striped\">\r\n <thead>\r\n <tr>\r\n <th *ngFor=\"let column of cols\" [ngClass]=\"'column-' + column\">\r\n <a *ngIf=\"orders[column]\" (click)=\"setOrder(column)\">\r\n <span>{{ 'label.' + column | translate }}</span>\r\n <i *ngIf=\"orderBy == column\"\r\n [icon]=\"orderDescending ? 'sort-desc' : 'sort-asc'\"\r\n [ngClass]=\"orderBy == column ? (orderDescending ? 'sort-desc': 'sort-asc') : ''\"></i>\r\n </a>\r\n <span *ngIf=\"!orders[column]\">{{ 'label.' + column | translate }}</span>\r\n </th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *paginationItem=\"let context\"\r\n [ngxTemplateOutlet]=\"rowTemplate\"\r\n [context]=\"context\"\r\n [additionalContext]=\"this\"></ng-container>\r\n </tbody>\r\n </table>\r\n </ng-template>\r\n\r\n <ng-container [ngxTemplateOutlet]=\"wrapperTemplate || defaultWrapperTemplate\"\r\n [context]=\"this\"></ng-container>\r\n </div>\r\n <pagination-menu [maxSize]=\"maxPages\" [directionLinks]=\"directionLinks\" [boundaryLinks]=\"boundaryLinks\"></pagination-menu>\r\n</div>\r\n"
|
|
5958
5960
|
},] }
|
|
5959
5961
|
];
|
|
5960
5962
|
DynamicTableComponent.ctorParameters = function () { return []; };
|
|
@@ -5973,6 +5975,7 @@
|
|
|
5973
5975
|
boundaryLinks: [{ type: core.Input }],
|
|
5974
5976
|
orderBy: [{ type: core.Input }],
|
|
5975
5977
|
orderDescending: [{ type: core.Input }],
|
|
5978
|
+
testId: [{ type: core.Input }],
|
|
5976
5979
|
rowTemplate: [{ type: core.ContentChild, args: ["rowTemplate", { static: true },] }],
|
|
5977
5980
|
wrapperTemplate: [{ type: core.ContentChild, args: ["wrapperTemplate", { static: true },] }],
|
|
5978
5981
|
filterTemplate: [{ type: core.ContentChild, args: ["filterTemplate", { static: true },] }],
|