@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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [2.0.0-alpha.21](https://bitbucket.org/coolon/angular-ui-powerups/compare/v2.0.0-alpha.20...v2.0.0-alpha.21) (2020-08-12)
6
+
7
+
8
+ ### Features
9
+
10
+ * aup-table now inserts the trackBy id into the rendered output ([d195b98](https://bitbucket.org/coolon/angular-ui-powerups/commit/d195b9830061f376fb83613e4c2f7dbf284113a5))
11
+
5
12
  ## [2.0.0-alpha.20](https://bitbucket.org/coolon/angular-ui-powerups/compare/v2.0.0-alpha.19...v2.0.0-alpha.20) (2020-08-11)
6
13
 
7
14
 
@@ -2272,6 +2272,9 @@
2272
2272
  this._editorSessions = new pectin.MutableListModel();
2273
2273
  this.rowClassNamePredicates = [];
2274
2274
  this._createForm = function (row) { return new pectin.DirtyTrackingForm(); };
2275
+ this.trackBy = function (index, item) {
2276
+ return _this.identityOf ? _this.identityOf(item) : index;
2277
+ };
2275
2278
  this.identityOf = sourceOfTruth.identityOf;
2276
2279
  var _a = pectin.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;
2277
2280
  this._columnsById = chain(this._columns).indexBy('columnId');
@@ -2298,12 +2301,6 @@
2298
2301
  enumerable: true,
2299
2302
  configurable: true
2300
2303
  });
2301
- TableModel.prototype.getTrackByFunction = function () {
2302
- var _this = this;
2303
- return function (index, item) {
2304
- return _this.identityOf ? _this.identityOf(item) : index;
2305
- };
2306
- };
2307
2304
  Object.defineProperty(TableModel.prototype, "columns", {
2308
2305
  get: function () {
2309
2306
  return this._columns.readonly;
@@ -2483,7 +2480,7 @@
2483
2480
  TableComponent = __decorate([
2484
2481
  core.Component({
2485
2482
  selector: 'aup-table',
2486
- 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",
2483
+ 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",
2487
2484
  styles: [":host{display:flex;flex-direction:column;align-items:stretch}:host table{flex:1}"]
2488
2485
  }),
2489
2486
  __metadata("design:paramtypes", [])