@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.
- package/CHANGELOG.md +14 -0
- package/bundles/coolon-angular-ui-powerups.umd.js +22 -15
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/esm2015/lib/components/index.js +1 -1
- package/esm2015/lib/components/index.js.map +1 -1
- package/esm2015/lib/components/index.metadata.json +1 -1
- package/esm2015/lib/components/table/{cell-protal-ref.js → cell-portal-ref.js} +7 -3
- package/esm2015/lib/components/table/cell-portal-ref.js.map +1 -0
- package/esm2015/lib/components/table/{cell-protal-ref.metadata.json → cell-portal-ref.metadata.json} +1 -1
- package/esm2015/lib/components/table/column-model.js +12 -9
- package/esm2015/lib/components/table/column-model.js.map +1 -1
- package/esm2015/lib/components/table/column-model.metadata.json +1 -1
- package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js +1 -1
- package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -1
- package/esm2015/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js +1 -1
- package/esm2015/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js.map +1 -1
- package/esm2015/lib/components/table/table-model.js +5 -5
- package/esm2015/lib/components/table/table-model.js.map +1 -1
- package/esm2015/lib/components/table/table-model.metadata.json +1 -1
- package/esm5/lib/components/index.js +1 -1
- package/esm5/lib/components/index.js.map +1 -1
- package/esm5/lib/components/table/{cell-protal-ref.js → cell-portal-ref.js} +7 -3
- package/esm5/lib/components/table/cell-portal-ref.js.map +1 -0
- package/esm5/lib/components/table/column-model.js +12 -9
- package/esm5/lib/components/table/column-model.js.map +1 -1
- package/esm5/lib/components/table/table-cell-renderer/table-cell-renderer.component.js +1 -1
- package/esm5/lib/components/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -1
- package/esm5/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js +1 -1
- package/esm5/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js.map +1 -1
- package/esm5/lib/components/table/table-model.js +5 -5
- package/esm5/lib/components/table/table-model.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +22 -15
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +22 -15
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/index.d.ts +1 -1
- package/lib/components/table/{cell-protal-ref.d.ts → cell-portal-ref.d.ts} +4 -4
- package/lib/components/table/column-model.d.ts +5 -5
- package/lib/components/table/table-cell-renderer/table-cell-renderer.component.d.ts +1 -1
- package/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.d.ts +1 -1
- package/lib/components/table/table-model.d.ts +6 -2
- package/package.json +1 -1
- package/esm2015/lib/components/table/cell-protal-ref.js.map +0 -1
- package/esm5/lib/components/table/cell-protal-ref.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
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.7](https://bitbucket.org/coolon/angular-ui-powerups/compare/v2.0.0-alpha.6...v2.0.0-alpha.7) (2020-07-24)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* added multi-column support for the same property ([c8b7498](https://bitbucket.org/coolon/angular-ui-powerups/commit/c8b74987cad8dad012c874e7fa6a4e0c9e11aa36))
|
|
11
|
+
|
|
12
|
+
## [2.0.0-alpha.6](https://bitbucket.org/coolon/angular-ui-powerups/compare/v2.0.0-alpha.5...v2.0.0-alpha.6) (2020-07-24)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* added onComponentInit hook to table cell editors ([2e2e289](https://bitbucket.org/coolon/angular-ui-powerups/commit/2e2e28944fc3741840e3cdedce6b9b9511e09a9b))
|
|
18
|
+
|
|
5
19
|
## [2.0.0-alpha.5](https://bitbucket.org/coolon/angular-ui-powerups/compare/v2.0.0-alpha.4...v2.0.0-alpha.5) (2020-07-24)
|
|
6
20
|
|
|
7
21
|
|
|
@@ -1400,6 +1400,7 @@
|
|
|
1400
1400
|
typescriptUtilities.assert.isTruthy(host);
|
|
1401
1401
|
host[HEADER_CELL_RENDERER_PORTAL] = new portal.ComponentPortal(this.componentType);
|
|
1402
1402
|
};
|
|
1403
|
+
// @Trace()
|
|
1403
1404
|
CellHeaderPortalRef.prototype.onPortalAttached = function (host, portalComponent) {
|
|
1404
1405
|
this.initialiseHeader(portalComponent, host.column);
|
|
1405
1406
|
};
|
|
@@ -1423,13 +1424,15 @@
|
|
|
1423
1424
|
ComponentCellRendererPortalRef.prototype.initialiseHost = function (host, columnModel) {
|
|
1424
1425
|
host[CELL_RENDERER_PORTAL] = new portal.ComponentPortal(this.componentType);
|
|
1425
1426
|
};
|
|
1427
|
+
// @Trace()
|
|
1426
1428
|
ComponentCellRendererPortalRef.prototype.onPortalAttached = function (host, portalComponent) {
|
|
1427
1429
|
host[PORTAL_RENDERER_COMPONENT] = portalComponent;
|
|
1428
|
-
this.updateComponent(portalComponent, host.getRowData());
|
|
1430
|
+
this.updateComponent(portalComponent, host.getRowData(), true);
|
|
1429
1431
|
};
|
|
1432
|
+
// @Trace()
|
|
1430
1433
|
ComponentCellRendererPortalRef.prototype.pushState = function (host) {
|
|
1431
1434
|
if (host[PORTAL_RENDERER_COMPONENT]) {
|
|
1432
|
-
this.updateComponent(host[PORTAL_RENDERER_COMPONENT], host.getRowData());
|
|
1435
|
+
this.updateComponent(host[PORTAL_RENDERER_COMPONENT], host.getRowData(), false);
|
|
1433
1436
|
}
|
|
1434
1437
|
};
|
|
1435
1438
|
return ComponentCellRendererPortalRef;
|
|
@@ -1471,6 +1474,7 @@
|
|
|
1471
1474
|
TemplateCellRendererPortalRef.prototype.onPortalAttached = function (host, portalComponent) {
|
|
1472
1475
|
// don't care
|
|
1473
1476
|
};
|
|
1477
|
+
// @Trace()
|
|
1474
1478
|
TemplateCellRendererPortalRef.prototype.pushState = function (host) {
|
|
1475
1479
|
host[CELL_RENDERER_PORTAL] = this.createPortal(host.getRowData());
|
|
1476
1480
|
host.fillCell = this.fillCell;
|
|
@@ -1752,24 +1756,27 @@
|
|
|
1752
1756
|
}());
|
|
1753
1757
|
var PropertyColumnModel = /** @class */ (function (_super) {
|
|
1754
1758
|
__extends(PropertyColumnModel, _super);
|
|
1755
|
-
function PropertyColumnModel(property, defaults) {
|
|
1756
|
-
var _this = _super.call(this,
|
|
1759
|
+
function PropertyColumnModel(id, property, defaults) {
|
|
1760
|
+
var _this = _super.call(this, id, defaults) || this;
|
|
1757
1761
|
_this.property = property;
|
|
1758
1762
|
_this._format = function (value) { return value; };
|
|
1759
1763
|
_this.cellRenderer(DefaultCellRendererComponent);
|
|
1760
1764
|
return _this;
|
|
1761
1765
|
}
|
|
1762
|
-
PropertyColumnModel.prototype.cellRenderer = function (componentType) {
|
|
1766
|
+
PropertyColumnModel.prototype.cellRenderer = function (componentType, onComponentInit) {
|
|
1763
1767
|
var _this = this;
|
|
1764
|
-
this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, function (component, rowData) {
|
|
1768
|
+
this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, function (component, rowData, firstTime) {
|
|
1769
|
+
if (firstTime && onComponentInit) {
|
|
1770
|
+
onComponentInit(component);
|
|
1771
|
+
}
|
|
1765
1772
|
component.value = _this._format(rowData.row[_this.property]);
|
|
1766
1773
|
}));
|
|
1767
1774
|
return this;
|
|
1768
1775
|
};
|
|
1769
|
-
PropertyColumnModel.prototype.cellEditor = function (editor, validatorsOrInitialiser,
|
|
1776
|
+
PropertyColumnModel.prototype.cellEditor = function (editor, validatorsOrInitialiser, onComponentInit) {
|
|
1770
1777
|
var _this = this;
|
|
1771
1778
|
var validators = Array.isArray(validatorsOrInitialiser) ? validatorsOrInitialiser : undefined;
|
|
1772
|
-
var initialiser = ___default__default.isFunction(validatorsOrInitialiser) ? validatorsOrInitialiser :
|
|
1779
|
+
var initialiser = ___default__default.isFunction(validatorsOrInitialiser) ? validatorsOrInitialiser : onComponentInit;
|
|
1773
1780
|
this.configureCellEditor(new CellEditorPortalRef(editor, function (component, editSession) {
|
|
1774
1781
|
var formValueModel = editSession.form.pluck(_this.property);
|
|
1775
1782
|
if (validators) {
|
|
@@ -1794,8 +1801,8 @@
|
|
|
1794
1801
|
}(ColumnModel));
|
|
1795
1802
|
var ListPropertyColumnModel = /** @class */ (function (_super) {
|
|
1796
1803
|
__extends(ListPropertyColumnModel, _super);
|
|
1797
|
-
function ListPropertyColumnModel(property, defaults) {
|
|
1798
|
-
var _this = _super.call(this,
|
|
1804
|
+
function ListPropertyColumnModel(id, property, defaults) {
|
|
1805
|
+
var _this = _super.call(this, id, defaults) || this;
|
|
1799
1806
|
_this.property = property;
|
|
1800
1807
|
_this._format = function (value) { return value.map(function (v) { return v === null || v === void 0 ? void 0 : v.toString(); }).join(', '); };
|
|
1801
1808
|
_this.cellRenderer(DefaultCellRendererComponent);
|
|
@@ -2029,7 +2036,7 @@
|
|
|
2029
2036
|
this.dataSource = chain(this.sourceOfTruth).replaceAll(this.rowsBeingEdited);
|
|
2030
2037
|
this.firstEditableColumn = chain(this.columns).select(function (c) { return c.hasEditorPortal(); }).first();
|
|
2031
2038
|
this.hasColumnsWithRowSelectionExplicitlyEnabled = chain(this._columns).findIndex(function (column) { return column.isRowSelectionExplicitlyEnabled(); }).isGreaterThanOrEqualTo(0);
|
|
2032
|
-
this.addRowClass(
|
|
2039
|
+
this.addRowClass('enable-hover', function () { return _this.isRowSelectionEnabled(); });
|
|
2033
2040
|
}
|
|
2034
2041
|
TableModel_1 = TableModel;
|
|
2035
2042
|
TableModel.fromList = function (sourceOfTruth, builder) {
|
|
@@ -2057,11 +2064,11 @@
|
|
|
2057
2064
|
enumerable: true,
|
|
2058
2065
|
configurable: true
|
|
2059
2066
|
});
|
|
2060
|
-
TableModel.prototype.pluck = function (property) {
|
|
2061
|
-
return this.addColumn(new PropertyColumnModel(property, this));
|
|
2067
|
+
TableModel.prototype.pluck = function (property, options) {
|
|
2068
|
+
return this.addColumn(new PropertyColumnModel((options === null || options === void 0 ? void 0 : options.columnId) || property.toString(), property, this));
|
|
2062
2069
|
};
|
|
2063
|
-
TableModel.prototype.pluckList = function (property) {
|
|
2064
|
-
return this.addColumn(new ListPropertyColumnModel(property, this));
|
|
2070
|
+
TableModel.prototype.pluckList = function (property, options) {
|
|
2071
|
+
return this.addColumn(new ListPropertyColumnModel((options === null || options === void 0 ? void 0 : options.columnId) || property.toString(), property, this));
|
|
2065
2072
|
};
|
|
2066
2073
|
TableModel.prototype.addSelectionColumn = function (selectionModel) {
|
|
2067
2074
|
pectin.assert.isNil(this.selectionColumnModel);
|