@coolon/angular-ui-powerups 12.4.0-alpha.69 → 12.4.0-alpha.70
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/bundles/coolon-angular-ui-powerups.umd.js +60 -36
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/lib/components/exports.js +1 -1
- package/esm2015/lib/components/exports.js.map +1 -1
- package/esm2015/lib/components/exports.metadata.json +1 -1
- package/esm2015/lib/components/tables/abstract-table-model.js +21 -17
- package/esm2015/lib/components/tables/abstract-table-model.js.map +1 -1
- package/esm2015/lib/components/tables/edit-session.js.map +1 -0
- package/esm2015/lib/components/tables/{table/edit-session.metadata.json → edit-session.metadata.json} +1 -1
- package/esm2015/lib/components/tables/table/cell-portal-ref.js.map +1 -1
- package/esm2015/lib/components/tables/table/column-model.js +1 -1
- package/esm2015/lib/components/tables/table/column-model.js.map +1 -1
- package/esm2015/lib/components/tables/table/column-model.metadata.json +1 -1
- package/esm2015/lib/components/tables/table/edit-row-controls/edit-row-controls.component.js +18 -11
- package/esm2015/lib/components/tables/table/edit-row-controls/edit-row-controls.component.js.map +1 -1
- package/esm2015/lib/components/tables/table/edit-row-controls/edit-row-controls.component.metadata.json +1 -1
- package/esm2015/lib/components/tables/table/table-cell-renderer/table-cell-renderer.component.js +1 -1
- package/esm2015/lib/components/tables/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -1
- package/esm2015/lib/components/tables/table/table.component.js +13 -12
- package/esm2015/lib/components/tables/table/table.component.js.map +1 -1
- package/esm2015/lib/components/tables/table/table.component.metadata.json +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +50 -38
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/exports.d.ts +1 -1
- package/lib/components/tables/abstract-table-model.d.ts +4 -4
- package/lib/components/tables/{table/edit-session.d.ts → edit-session.d.ts} +3 -3
- package/lib/components/tables/table/cell-portal-ref.d.ts +1 -1
- package/lib/components/tables/table/column-model.d.ts +3 -3
- package/lib/components/tables/table/edit-row-controls/edit-row-controls.component.d.ts +4 -2
- package/lib/components/tables/table/table-cell-renderer/table-cell-renderer.component.d.ts +1 -1
- package/lib/components/tables/table/table.component.d.ts +13 -12
- package/package.json +1 -1
- package/esm2015/lib/components/tables/table/edit-session.js.map +0 -1
- /package/esm2015/lib/components/tables/{table/edit-session.js → edit-session.js} +0 -0
|
@@ -2975,19 +2975,38 @@
|
|
|
2975
2975
|
__extends(EditRowControls, _super);
|
|
2976
2976
|
function EditRowControls() {
|
|
2977
2977
|
var _this = _super.call(this) || this;
|
|
2978
|
-
_this.saveCommand = pectin.Command.create(function () {
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2978
|
+
_this.saveCommand = pectin.Command.create(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
2979
|
+
var finished;
|
|
2980
|
+
return __generator(this, function (_b) {
|
|
2981
|
+
switch (_b.label) {
|
|
2982
|
+
case 0: return [4 /*yield*/, this.editSession.saveCommand.execute()];
|
|
2983
|
+
case 1:
|
|
2984
|
+
finished = _b.sent();
|
|
2985
|
+
if (finished) {
|
|
2986
|
+
this.editSession.dispose();
|
|
2987
|
+
}
|
|
2988
|
+
return [2 /*return*/];
|
|
2983
2989
|
}
|
|
2984
2990
|
});
|
|
2985
|
-
});
|
|
2991
|
+
}); });
|
|
2986
2992
|
_this.cancelCommand = pectin.Command.create(function () {
|
|
2987
2993
|
_this.editSession.dispose();
|
|
2988
|
-
});
|
|
2994
|
+
}).disableWhile(_this.saveCommand.busy);
|
|
2989
2995
|
return _this;
|
|
2990
2996
|
}
|
|
2997
|
+
Object.defineProperty(EditRowControls.prototype, "editSession", {
|
|
2998
|
+
get: function () {
|
|
2999
|
+
return this._session;
|
|
3000
|
+
},
|
|
3001
|
+
set: function (session) {
|
|
3002
|
+
if (session) {
|
|
3003
|
+
session.form.disableWhile(this.saveCommand.busy);
|
|
3004
|
+
}
|
|
3005
|
+
this._session = session;
|
|
3006
|
+
},
|
|
3007
|
+
enumerable: false,
|
|
3008
|
+
configurable: true
|
|
3009
|
+
});
|
|
2991
3010
|
EditRowControls.prototype.ngOnInit = function () {
|
|
2992
3011
|
};
|
|
2993
3012
|
Object.defineProperty(EditRowControls.prototype, "form", {
|
|
@@ -3401,7 +3420,7 @@
|
|
|
3401
3420
|
}(ColumnModel));
|
|
3402
3421
|
var EditorControlColumnModel = /** @class */ (function (_super) {
|
|
3403
3422
|
__extends(EditorControlColumnModel, _super);
|
|
3404
|
-
function EditorControlColumnModel(columnId,
|
|
3423
|
+
function EditorControlColumnModel(columnId, saveCommandFactory, defaults) {
|
|
3405
3424
|
var _this = _super.call(this, columnId, defaults) || this;
|
|
3406
3425
|
_this.cellRenderer(EditRowControls);
|
|
3407
3426
|
return _this;
|
|
@@ -3984,11 +4003,14 @@
|
|
|
3984
4003
|
}
|
|
3985
4004
|
return selectionColumnModel;
|
|
3986
4005
|
};
|
|
3987
|
-
AbstractTableModel.prototype.addEditControls = function (
|
|
4006
|
+
AbstractTableModel.prototype.addEditControls = function (saveCommandFactory, formFactory) {
|
|
3988
4007
|
var _this = this;
|
|
3989
|
-
this.
|
|
4008
|
+
this.saveCommandFactory = saveCommandFactory;
|
|
4009
|
+
if (___namespace.isFunction(formFactory)) {
|
|
4010
|
+
this._createForm = formFactory;
|
|
4011
|
+
}
|
|
3990
4012
|
var columnId = 'editControls';
|
|
3991
|
-
return this.addColumn(new EditorControlColumnModel(columnId,
|
|
4013
|
+
return this.addColumn(new EditorControlColumnModel(columnId, saveCommandFactory, function () { return _this.getColumnTextProperties(columnId); }));
|
|
3992
4014
|
};
|
|
3993
4015
|
AbstractTableModel.prototype.addCustomColumn = function (columnId, dataAccessor) {
|
|
3994
4016
|
var _this = this;
|
|
@@ -4036,19 +4058,20 @@
|
|
|
4036
4058
|
if (this._rowsBeingEdited.query().indexOf(row) > -1) {
|
|
4037
4059
|
return pectin.lang.illegalState("Row with id=" + rowId + " already being edited");
|
|
4038
4060
|
}
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
}
|
|
4061
|
+
// todo: pass the factories to the edit session so we can make the whole lot pluggable?
|
|
4062
|
+
var form = this._createForm(row);
|
|
4063
|
+
var saveCommand = this.saveCommandFactory.create(form);
|
|
4064
|
+
var editSession = new EditSession(rowId, row, form, saveCommand);
|
|
4065
|
+
var when = pectin.Dsl.disposeWith(editSession).when;
|
|
4066
|
+
when(editSession.liveRowValue).changes(function (editedValue) {
|
|
4067
|
+
_this._rowsBeingEdited.replaceOrPush(editedValue);
|
|
4068
|
+
}, { initialValue: 'triggerChangeUnlessNil' });
|
|
4069
|
+
this._editorSessions.push(editSession);
|
|
4070
|
+
editSession.onDispose(function () {
|
|
4071
|
+
_this._rowsBeingEdited.remove(editSession.liveRowValue.value);
|
|
4072
|
+
_this._editorSessions.remove(editSession);
|
|
4073
|
+
});
|
|
4074
|
+
return editSession;
|
|
4052
4075
|
};
|
|
4053
4076
|
AbstractTableModel.prototype.getEditSessionFor = function (row) {
|
|
4054
4077
|
return this._editorSessionByRowId.get(this.identityOf(row));
|
|
@@ -4142,18 +4165,19 @@
|
|
|
4142
4165
|
* --row-selected-background-color: rebeccapurple; // defaults to transparent
|
|
4143
4166
|
* --first-column-padding-left: 18px // defaults to --column-gap
|
|
4144
4167
|
* --last-column-padding-right: 18px // defaults to --column-gap
|
|
4145
|
-
*
|
|
4146
|
-
*
|
|
4147
|
-
*
|
|
4148
|
-
*
|
|
4149
|
-
*
|
|
4150
|
-
*
|
|
4151
|
-
*
|
|
4152
|
-
*
|
|
4153
|
-
*
|
|
4154
|
-
*
|
|
4155
|
-
*
|
|
4156
|
-
*
|
|
4168
|
+
* ::ng-deep {
|
|
4169
|
+
* aup-table-header-cell-renderer,
|
|
4170
|
+
* aup-table-cell-renderer {
|
|
4171
|
+
* &.aup-col-my-dasherised-column-id {
|
|
4172
|
+
* // do stuff
|
|
4173
|
+
* }
|
|
4174
|
+
* &.first-visible-column {
|
|
4175
|
+
* // do stuff
|
|
4176
|
+
* }
|
|
4177
|
+
* &.last-visible-column {
|
|
4178
|
+
* // do stuff
|
|
4179
|
+
* }
|
|
4180
|
+
* }
|
|
4157
4181
|
* }
|
|
4158
4182
|
* }
|
|
4159
4183
|
*/
|