@coolon/angular-ui-powerups 3.7.5 → 3.8.0
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 +7 -0
- package/bundles/coolon-angular-ui-powerups.umd.js +25 -6
- 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/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
- package/esm2015/lib/components/table/table-model.js +23 -2
- package/esm2015/lib/components/table/table-model.js.map +1 -1
- package/esm2015/lib/components/table/table-model.metadata.json +1 -1
- package/esm2015/lib/components/table/table.component.js +3 -5
- package/esm2015/lib/components/table/table.component.js.map +1 -1
- package/esm2015/lib/components/table/table.component.metadata.json +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +25 -6
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/table/table-model.d.ts +6 -1
- package/lib/components/table/table.component.d.ts +1 -1
- package/package.json +1 -1
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
|
+
## [3.8.0](https://bitbucket.org/coolon/angular-ui-powerups/compare/v3.7.5...v3.8.0) (2021-02-03)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* added TableModel.onRowClicked with auto curser and hover ([c01dbc6](https://bitbucket.org/coolon/angular-ui-powerups/commit/c01dbc683ec68ef85bbfb564f92c85d4edf4dcd6))
|
|
11
|
+
|
|
5
12
|
### [3.7.5](https://bitbucket.org/coolon/angular-ui-powerups/compare/v3.7.4...v3.7.5) (2021-02-01)
|
|
6
13
|
|
|
7
14
|
### [3.7.4](https://bitbucket.org/coolon/angular-ui-powerups/compare/v3.7.3...v3.7.4) (2021-02-01)
|
|
@@ -2980,6 +2980,7 @@
|
|
|
2980
2980
|
this._columns = new pectin.MutableListModel();
|
|
2981
2981
|
this._editorSessions = new pectin.MutableListModel();
|
|
2982
2982
|
this.rowClassNamePredicates = [];
|
|
2983
|
+
this.rowClickListeners = new pectin.EventListenerList();
|
|
2983
2984
|
this._createForm = function (row) { return new pectin.DirtyTrackingForm(); };
|
|
2984
2985
|
this.trackBy = function (index, item) {
|
|
2985
2986
|
return _this.identityOf ? _this.identityOf(item) : index;
|
|
@@ -2995,7 +2996,6 @@
|
|
|
2995
2996
|
this.dataSource = chain(this.sourceOfTruth).replaceAll(this.rowsBeingEdited);
|
|
2996
2997
|
this.firstEditableColumn = chain(this.columns).select(function (c) { return c.hasEditorPortal(); }).first();
|
|
2997
2998
|
this.hasColumnsWithRowSelectionExplicitlyEnabled = chain(this._columns).findIndex(function (column) { return column.isRowSelectionExplicitlyEnabled(); }).isGreaterThanOrEqualTo(0);
|
|
2998
|
-
this.addRowClass('enable-hover', function () { return _this.isRowSelectionEnabled(); });
|
|
2999
2999
|
}
|
|
3000
3000
|
TableModel.fromList = function (sourceOfTruth, builder) {
|
|
3001
3001
|
var model = new TableModel_1(sourceOfTruth);
|
|
@@ -3115,10 +3115,31 @@
|
|
|
3115
3115
|
TableModel.prototype.isRowSelectionEnabled = function () {
|
|
3116
3116
|
return this.hasColumnsWithRowSelectionExplicitlyEnabled.value || this.isRowSelectionEnabledByDefault();
|
|
3117
3117
|
};
|
|
3118
|
+
TableModel.prototype.isHoverEnabled = function () {
|
|
3119
|
+
return this.isRowSelectionEnabled() || this.rowClickListeners.listenerCount > 0;
|
|
3120
|
+
};
|
|
3121
|
+
TableModel.prototype.isCursorEnabled = function (column) {
|
|
3122
|
+
// console.log({
|
|
3123
|
+
// column: column.columnId,
|
|
3124
|
+
// rowSelectionEnabled: this.isRowSelectionEnabledFor(column),
|
|
3125
|
+
// hasRowListeners: this.rowClickListeners.listenerCount > 0
|
|
3126
|
+
// });
|
|
3127
|
+
return this.isRowSelectionEnabledFor(column) || this.rowClickListeners.listenerCount > 0;
|
|
3128
|
+
};
|
|
3118
3129
|
TableModel.prototype.selectRow = function (row) {
|
|
3119
3130
|
var _a;
|
|
3120
3131
|
(_a = this.selectionColumnModel) === null || _a === void 0 ? void 0 : _a.selectRow(row);
|
|
3121
3132
|
};
|
|
3133
|
+
TableModel.prototype.onRowClicked = function (callback) {
|
|
3134
|
+
return this.rowClickListeners.add(callback);
|
|
3135
|
+
};
|
|
3136
|
+
// @Trace()
|
|
3137
|
+
TableModel.prototype._notifyCellClicked = function (columnModel, row) {
|
|
3138
|
+
if (this.isRowSelectionEnabledFor(columnModel)) {
|
|
3139
|
+
this.selectRow(row);
|
|
3140
|
+
}
|
|
3141
|
+
this.rowClickListeners.fire(function (l) { return l(row); });
|
|
3142
|
+
};
|
|
3122
3143
|
return TableModel;
|
|
3123
3144
|
}());
|
|
3124
3145
|
exports.TableModel = TableModel_1 = __decorate([
|
|
@@ -3173,17 +3194,15 @@
|
|
|
3173
3194
|
column.setTemplate(templateRef, viewContainer, fillCell, padChild);
|
|
3174
3195
|
}
|
|
3175
3196
|
};
|
|
3176
|
-
TableComponent.prototype.
|
|
3177
|
-
|
|
3178
|
-
this.tableModel.selectRow(row);
|
|
3179
|
-
}
|
|
3197
|
+
TableComponent.prototype.notifyCellClicked = function (columnModel, row) {
|
|
3198
|
+
this.tableModel._notifyCellClicked(columnModel, row);
|
|
3180
3199
|
};
|
|
3181
3200
|
return TableComponent;
|
|
3182
3201
|
}(DisposableComponent));
|
|
3183
3202
|
TableComponent.decorators = [
|
|
3184
3203
|
{ type: i0.Component, args: [{
|
|
3185
3204
|
selector: 'aup-table',
|
|
3186
|
-
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)=\"
|
|
3205
|
+
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)=\"notifyCellClicked(column, row)\" [class.enable-cursor]=\"tableModel.isCursorEnabled(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)\" [class.enable-hover]=\"tableModel.isHoverEnabled()\" [attr.trackBy]=\"tableModel.trackBy(i, row)\"\n ></tr>\n\n</table>\n",
|
|
3187
3206
|
styles: [":host{align-items:stretch;display:flex;flex-direction:column}:host table{flex:1;width:100%}"]
|
|
3188
3207
|
},] }
|
|
3189
3208
|
];
|