@stemy/ngx-utils 12.2.19 → 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.
@@ -3286,13 +3286,8 @@
3286
3286
  };
3287
3287
  BaseHttpService.prototype.absoluteUrl = function (url, options) {
3288
3288
  return __awaiter(this, void 0, void 0, function () {
3289
- var absoluteUrl;
3290
3289
  return __generator(this, function (_c) {
3291
- absoluteUrl = this.parseUrl(url);
3292
- if (url == "api-docs") {
3293
- return [2 /*return*/, absoluteUrl.replace("/api", "")];
3294
- }
3295
- return [2 /*return*/, absoluteUrl];
3290
+ return [2 /*return*/, this.parseUrl(url)];
3296
3291
  });
3297
3292
  });
3298
3293
  };
@@ -3331,7 +3326,11 @@
3331
3326
  configurable: true
3332
3327
  });
3333
3328
  ApiService.prototype.url = function (url) {
3334
- return this.expressRequestUrl("/api/" + url);
3329
+ var baseUrl = this.expressRequestUrl("/api/" + url);
3330
+ if (url == "api-docs" || url == "socket") {
3331
+ return baseUrl.replace("/api/", "/");
3332
+ }
3333
+ return baseUrl;
3335
3334
  };
3336
3335
  ApiService.prototype.get = function (url, options, body) {
3337
3336
  return this.getPromise(url, options, body);
@@ -5537,8 +5536,9 @@
5537
5536
  PaginationItemDirective.prototype.renderView = function () {
5538
5537
  var _this = this;
5539
5538
  this.viewContainer.clear();
5540
- this.pagination.items.forEach(function (item) {
5539
+ this.pagination.items.forEach(function (item, ix) {
5541
5540
  item.$implicit = item;
5541
+ item.rowIndex = ix;
5542
5542
  _this.viewContainer.createEmbeddedView(_this.templateRef, item);
5543
5543
  });
5544
5544
  };
@@ -5857,6 +5857,7 @@
5857
5857
  this.tableId = UniqueUtils.uuid();
5858
5858
  this.templates = {};
5859
5859
  this.filter = "";
5860
+ this.testId = "table";
5860
5861
  this.orders = {};
5861
5862
  }
5862
5863
  Object.defineProperty(DynamicTableComponent.prototype, "items", {
@@ -5955,7 +5956,7 @@
5955
5956
  DynamicTableComponent.decorators = [
5956
5957
  { type: core.Component, args: [{
5957
5958
  selector: "dynamic-table",
5958
- 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\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\" *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"
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"
5959
5960
  },] }
5960
5961
  ];
5961
5962
  DynamicTableComponent.ctorParameters = function () { return []; };
@@ -5974,6 +5975,7 @@
5974
5975
  boundaryLinks: [{ type: core.Input }],
5975
5976
  orderBy: [{ type: core.Input }],
5976
5977
  orderDescending: [{ type: core.Input }],
5978
+ testId: [{ type: core.Input }],
5977
5979
  rowTemplate: [{ type: core.ContentChild, args: ["rowTemplate", { static: true },] }],
5978
5980
  wrapperTemplate: [{ type: core.ContentChild, args: ["wrapperTemplate", { static: true },] }],
5979
5981
  filterTemplate: [{ type: core.ContentChild, args: ["filterTemplate", { static: true },] }],