@coolon/angular-ui-powerups 2.0.0-alpha.5 → 2.0.0-alpha.7

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/bundles/coolon-angular-ui-powerups.umd.js +22 -15
  3. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  4. package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
  5. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  6. package/esm2015/lib/components/index.js +1 -1
  7. package/esm2015/lib/components/index.js.map +1 -1
  8. package/esm2015/lib/components/index.metadata.json +1 -1
  9. package/esm2015/lib/components/table/{cell-protal-ref.js → cell-portal-ref.js} +7 -3
  10. package/esm2015/lib/components/table/cell-portal-ref.js.map +1 -0
  11. package/esm2015/lib/components/table/{cell-protal-ref.metadata.json → cell-portal-ref.metadata.json} +1 -1
  12. package/esm2015/lib/components/table/column-model.js +12 -9
  13. package/esm2015/lib/components/table/column-model.js.map +1 -1
  14. package/esm2015/lib/components/table/column-model.metadata.json +1 -1
  15. package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js +1 -1
  16. package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -1
  17. package/esm2015/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js +1 -1
  18. package/esm2015/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js.map +1 -1
  19. package/esm2015/lib/components/table/table-model.js +5 -5
  20. package/esm2015/lib/components/table/table-model.js.map +1 -1
  21. package/esm2015/lib/components/table/table-model.metadata.json +1 -1
  22. package/esm5/lib/components/index.js +1 -1
  23. package/esm5/lib/components/index.js.map +1 -1
  24. package/esm5/lib/components/table/{cell-protal-ref.js → cell-portal-ref.js} +7 -3
  25. package/esm5/lib/components/table/cell-portal-ref.js.map +1 -0
  26. package/esm5/lib/components/table/column-model.js +12 -9
  27. package/esm5/lib/components/table/column-model.js.map +1 -1
  28. package/esm5/lib/components/table/table-cell-renderer/table-cell-renderer.component.js +1 -1
  29. package/esm5/lib/components/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -1
  30. package/esm5/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js +1 -1
  31. package/esm5/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js.map +1 -1
  32. package/esm5/lib/components/table/table-model.js +5 -5
  33. package/esm5/lib/components/table/table-model.js.map +1 -1
  34. package/fesm2015/coolon-angular-ui-powerups.js +22 -15
  35. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  36. package/fesm5/coolon-angular-ui-powerups.js +22 -15
  37. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  38. package/lib/components/index.d.ts +1 -1
  39. package/lib/components/table/{cell-protal-ref.d.ts → cell-portal-ref.d.ts} +4 -4
  40. package/lib/components/table/column-model.d.ts +5 -5
  41. package/lib/components/table/table-cell-renderer/table-cell-renderer.component.d.ts +1 -1
  42. package/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.d.ts +1 -1
  43. package/lib/components/table/table-model.d.ts +6 -2
  44. package/package.json +1 -1
  45. package/esm2015/lib/components/table/cell-protal-ref.js.map +0 -1
  46. package/esm5/lib/components/table/cell-protal-ref.js.map +0 -1
@@ -1228,6 +1228,7 @@ var CellHeaderPortalRef = /** @class */ (function (_super) {
1228
1228
  assert$1.isTruthy(host);
1229
1229
  host[HEADER_CELL_RENDERER_PORTAL] = new ComponentPortal(this.componentType);
1230
1230
  };
1231
+ // @Trace()
1231
1232
  CellHeaderPortalRef.prototype.onPortalAttached = function (host, portalComponent) {
1232
1233
  this.initialiseHeader(portalComponent, host.column);
1233
1234
  };
@@ -1251,13 +1252,15 @@ var ComponentCellRendererPortalRef = /** @class */ (function (_super) {
1251
1252
  ComponentCellRendererPortalRef.prototype.initialiseHost = function (host, columnModel) {
1252
1253
  host[CELL_RENDERER_PORTAL] = new ComponentPortal(this.componentType);
1253
1254
  };
1255
+ // @Trace()
1254
1256
  ComponentCellRendererPortalRef.prototype.onPortalAttached = function (host, portalComponent) {
1255
1257
  host[PORTAL_RENDERER_COMPONENT] = portalComponent;
1256
- this.updateComponent(portalComponent, host.getRowData());
1258
+ this.updateComponent(portalComponent, host.getRowData(), true);
1257
1259
  };
1260
+ // @Trace()
1258
1261
  ComponentCellRendererPortalRef.prototype.pushState = function (host) {
1259
1262
  if (host[PORTAL_RENDERER_COMPONENT]) {
1260
- this.updateComponent(host[PORTAL_RENDERER_COMPONENT], host.getRowData());
1263
+ this.updateComponent(host[PORTAL_RENDERER_COMPONENT], host.getRowData(), false);
1261
1264
  }
1262
1265
  };
1263
1266
  return ComponentCellRendererPortalRef;
@@ -1299,6 +1302,7 @@ var TemplateCellRendererPortalRef = /** @class */ (function (_super) {
1299
1302
  TemplateCellRendererPortalRef.prototype.onPortalAttached = function (host, portalComponent) {
1300
1303
  // don't care
1301
1304
  };
1305
+ // @Trace()
1302
1306
  TemplateCellRendererPortalRef.prototype.pushState = function (host) {
1303
1307
  host[CELL_RENDERER_PORTAL] = this.createPortal(host.getRowData());
1304
1308
  host.fillCell = this.fillCell;
@@ -1580,24 +1584,27 @@ var ColumnModel = /** @class */ (function () {
1580
1584
  }());
1581
1585
  var PropertyColumnModel = /** @class */ (function (_super) {
1582
1586
  __extends(PropertyColumnModel, _super);
1583
- function PropertyColumnModel(property, defaults) {
1584
- var _this = _super.call(this, property.toString(), defaults) || this;
1587
+ function PropertyColumnModel(id, property, defaults) {
1588
+ var _this = _super.call(this, id, defaults) || this;
1585
1589
  _this.property = property;
1586
1590
  _this._format = function (value) { return value; };
1587
1591
  _this.cellRenderer(DefaultCellRendererComponent);
1588
1592
  return _this;
1589
1593
  }
1590
- PropertyColumnModel.prototype.cellRenderer = function (componentType) {
1594
+ PropertyColumnModel.prototype.cellRenderer = function (componentType, onComponentInit) {
1591
1595
  var _this = this;
1592
- this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, function (component, rowData) {
1596
+ this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, function (component, rowData, firstTime) {
1597
+ if (firstTime && onComponentInit) {
1598
+ onComponentInit(component);
1599
+ }
1593
1600
  component.value = _this._format(rowData.row[_this.property]);
1594
1601
  }));
1595
1602
  return this;
1596
1603
  };
1597
- PropertyColumnModel.prototype.cellEditor = function (editor, validatorsOrInitialiser, initialiseComponent) {
1604
+ PropertyColumnModel.prototype.cellEditor = function (editor, validatorsOrInitialiser, onComponentInit) {
1598
1605
  var _this = this;
1599
1606
  var validators = Array.isArray(validatorsOrInitialiser) ? validatorsOrInitialiser : undefined;
1600
- var initialiser = ___default.isFunction(validatorsOrInitialiser) ? validatorsOrInitialiser : initialiseComponent;
1607
+ var initialiser = ___default.isFunction(validatorsOrInitialiser) ? validatorsOrInitialiser : onComponentInit;
1601
1608
  this.configureCellEditor(new CellEditorPortalRef(editor, function (component, editSession) {
1602
1609
  var formValueModel = editSession.form.pluck(_this.property);
1603
1610
  if (validators) {
@@ -1622,8 +1629,8 @@ var PropertyColumnModel = /** @class */ (function (_super) {
1622
1629
  }(ColumnModel));
1623
1630
  var ListPropertyColumnModel = /** @class */ (function (_super) {
1624
1631
  __extends(ListPropertyColumnModel, _super);
1625
- function ListPropertyColumnModel(property, defaults) {
1626
- var _this = _super.call(this, property.toString(), defaults) || this;
1632
+ function ListPropertyColumnModel(id, property, defaults) {
1633
+ var _this = _super.call(this, id, defaults) || this;
1627
1634
  _this.property = property;
1628
1635
  _this._format = function (value) { return value.map(function (v) { return v === null || v === void 0 ? void 0 : v.toString(); }).join(', '); };
1629
1636
  _this.cellRenderer(DefaultCellRendererComponent);
@@ -1857,7 +1864,7 @@ var TableModel = /** @class */ (function () {
1857
1864
  this.dataSource = chain(this.sourceOfTruth).replaceAll(this.rowsBeingEdited);
1858
1865
  this.firstEditableColumn = chain(this.columns).select(function (c) { return c.hasEditorPortal(); }).first();
1859
1866
  this.hasColumnsWithRowSelectionExplicitlyEnabled = chain(this._columns).findIndex(function (column) { return column.isRowSelectionExplicitlyEnabled(); }).isGreaterThanOrEqualTo(0);
1860
- this.addRowClass("enable-hover", function () { return _this.isRowSelectionEnabled(); });
1867
+ this.addRowClass('enable-hover', function () { return _this.isRowSelectionEnabled(); });
1861
1868
  }
1862
1869
  TableModel_1 = TableModel;
1863
1870
  TableModel.fromList = function (sourceOfTruth, builder) {
@@ -1885,11 +1892,11 @@ var TableModel = /** @class */ (function () {
1885
1892
  enumerable: true,
1886
1893
  configurable: true
1887
1894
  });
1888
- TableModel.prototype.pluck = function (property) {
1889
- return this.addColumn(new PropertyColumnModel(property, this));
1895
+ TableModel.prototype.pluck = function (property, options) {
1896
+ return this.addColumn(new PropertyColumnModel((options === null || options === void 0 ? void 0 : options.columnId) || property.toString(), property, this));
1890
1897
  };
1891
- TableModel.prototype.pluckList = function (property) {
1892
- return this.addColumn(new ListPropertyColumnModel(property, this));
1898
+ TableModel.prototype.pluckList = function (property, options) {
1899
+ return this.addColumn(new ListPropertyColumnModel((options === null || options === void 0 ? void 0 : options.columnId) || property.toString(), property, this));
1893
1900
  };
1894
1901
  TableModel.prototype.addSelectionColumn = function (selectionModel) {
1895
1902
  assert.isNil(this.selectionColumnModel);