@coolon/angular-ui-powerups 2.0.0-alpha.20 → 2.0.0-alpha.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.
@@ -2101,6 +2101,9 @@ var TableModel = /** @class */ (function () {
2101
2101
  this._editorSessions = new MutableListModel();
2102
2102
  this.rowClassNamePredicates = [];
2103
2103
  this._createForm = function (row) { return new DirtyTrackingForm(); };
2104
+ this.trackBy = function (index, item) {
2105
+ return _this.identityOf ? _this.identityOf(item) : index;
2106
+ };
2104
2107
  this.identityOf = sourceOfTruth.identityOf;
2105
2108
  var _a = Dsl.disposeWith(this._garbage), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
2106
2109
  this._columnsById = chain(this._columns).indexBy('columnId');
@@ -2127,12 +2130,6 @@ var TableModel = /** @class */ (function () {
2127
2130
  enumerable: true,
2128
2131
  configurable: true
2129
2132
  });
2130
- TableModel.prototype.getTrackByFunction = function () {
2131
- var _this = this;
2132
- return function (index, item) {
2133
- return _this.identityOf ? _this.identityOf(item) : index;
2134
- };
2135
- };
2136
2133
  Object.defineProperty(TableModel.prototype, "columns", {
2137
2134
  get: function () {
2138
2135
  return this._columns.readonly;
@@ -2312,7 +2309,7 @@ var TableComponent = /** @class */ (function (_super) {
2312
2309
  TableComponent = __decorate([
2313
2310
  Component({
2314
2311
  selector: 'aup-table',
2315
- template: "<table mat-table [dataSource]=\"tableModel.dataSource.value\" [trackBy]=\"tableModel.getTrackByFunction()\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\" matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef>\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"onCellClicked(column, row)\" [class.enable-cursor]=\"tableModel.isRowSelectionEnabledFor(column)\">\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"tableModel\"\n [editSession]=\"tableModel.getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value;\"\n [ngClass]=\"tableModel.getRowClasses(row)\"\n ></tr>\n\n</table>\n",
2312
+ template: "<table mat-table [dataSource]=\"tableModel.dataSource.value\" [trackBy]=\"tableModel.trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\" matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef>\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"onCellClicked(column, row)\" [class.enable-cursor]=\"tableModel.isRowSelectionEnabledFor(column)\">\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"tableModel\"\n [editSession]=\"tableModel.getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"tableModel.getRowClasses(row)\" [attr.trackBy]=\"tableModel.trackBy(i, row)\"\n ></tr>\n\n</table>\n",
2316
2313
  styles: [":host{display:flex;flex-direction:column;align-items:stretch}:host table{flex:1}"]
2317
2314
  }),
2318
2315
  __metadata("design:paramtypes", [])