@coolon/angular-ui-powerups 2.0.0-alpha.36 → 2.0.0-alpha.38
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 +25 -19
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +2 -2
- 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/commands/command/command.component.js +17 -4
- package/esm2015/lib/components/commands/command/command.component.js.map +1 -1
- package/esm2015/lib/components/commands/command/command.component.metadata.json +1 -1
- package/esm2015/lib/components/commands/command-face.js +7 -3
- package/esm2015/lib/components/commands/command-face.js.map +1 -1
- package/esm2015/lib/components/commands/group/command-group.js +1 -13
- package/esm2015/lib/components/commands/group/command-group.js.map +1 -1
- package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
- package/esm5/lib/components/commands/command/command.component.js +17 -4
- package/esm5/lib/components/commands/command/command.component.js.map +1 -1
- package/esm5/lib/components/commands/command-face.js +7 -3
- package/esm5/lib/components/commands/command-face.js.map +1 -1
- package/esm5/lib/components/commands/group/command-group.js +1 -13
- package/esm5/lib/components/commands/group/command-group.js.map +1 -1
- package/esm5/lib/components/components.module.ngfactory.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +25 -19
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +25 -19
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/commands/command/command.component.d.ts +4 -0
- package/lib/components/commands/command-face.d.ts +1 -0
- package/lib/components/commands/group/command-group.d.ts +2 -5
- package/package.json +1 -1
|
@@ -446,6 +446,10 @@ var CommandFace;
|
|
|
446
446
|
return ___default.isFunction(face === null || face === void 0 ? void 0 : face.icon) ? face.icon() : undefined;
|
|
447
447
|
}
|
|
448
448
|
CommandFace.getIconOf = getIconOf;
|
|
449
|
+
function getIconPositionOf(face) {
|
|
450
|
+
return ___default.isFunction(face === null || face === void 0 ? void 0 : face.iconPosition) ? face.iconPosition() : undefined;
|
|
451
|
+
}
|
|
452
|
+
CommandFace.getIconPositionOf = getIconPositionOf;
|
|
449
453
|
function getTooltipOf(face) {
|
|
450
454
|
return ___default.isFunction(face === null || face === void 0 ? void 0 : face.tooltip) ? face.tooltip() : undefined;
|
|
451
455
|
}
|
|
@@ -460,7 +464,7 @@ var CommandFace;
|
|
|
460
464
|
}
|
|
461
465
|
Object.defineProperty(Adapter.prototype, "text", {
|
|
462
466
|
get: function () {
|
|
463
|
-
return
|
|
467
|
+
return CommandFace.getTextOf(this.face);
|
|
464
468
|
},
|
|
465
469
|
enumerable: true,
|
|
466
470
|
configurable: true
|
|
@@ -474,14 +478,14 @@ var CommandFace;
|
|
|
474
478
|
});
|
|
475
479
|
Object.defineProperty(Adapter.prototype, "iconPosition", {
|
|
476
480
|
get: function () {
|
|
477
|
-
return
|
|
481
|
+
return CommandFace.getIconPositionOf(this.face);
|
|
478
482
|
},
|
|
479
483
|
enumerable: true,
|
|
480
484
|
configurable: true
|
|
481
485
|
});
|
|
482
486
|
Object.defineProperty(Adapter.prototype, "tooltip", {
|
|
483
487
|
get: function () {
|
|
484
|
-
return
|
|
488
|
+
return CommandFace.getTooltipOf(this.face);
|
|
485
489
|
},
|
|
486
490
|
enumerable: true,
|
|
487
491
|
configurable: true
|
|
@@ -854,16 +858,7 @@ var CommandGroup = /** @class */ (function (_super) {
|
|
|
854
858
|
_this.parent = parent;
|
|
855
859
|
_this._rootTemplate = new MutableValueModel();
|
|
856
860
|
_this._registrations = new MutableListModel();
|
|
857
|
-
_this._childFaceModels = new MutableListModel();
|
|
858
|
-
_this._faceChangeCount = new MutableValueModel(0);
|
|
859
861
|
var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
|
|
860
|
-
var childFaces = chain(_this._childFaceModels)
|
|
861
|
-
.map(function (m) { return m.value; }, { dependsOn: _this._faceChangeCount })
|
|
862
|
-
.rejectNil();
|
|
863
|
-
var iconCount = childFaces
|
|
864
|
-
.select(function (face) { return !!CommandFace.getIconOf(face); })
|
|
865
|
-
.count();
|
|
866
|
-
_this.hasMixedIcons = valueOf.all(iconCount.isGreaterThan(0), iconCount.doesNotEqual(childFaces.length)).areTruthy();
|
|
867
862
|
_this.childTemplates = chain(_this._rootTemplate).pluckList('children');
|
|
868
863
|
_this.initialised = chain(_this._rootTemplate).isNotNil();
|
|
869
864
|
return _this;
|
|
@@ -925,12 +920,10 @@ var CommandGroup = /** @class */ (function (_super) {
|
|
|
925
920
|
var _this = this;
|
|
926
921
|
this._registrations.push(registration);
|
|
927
922
|
if (registration instanceof Registration.FaceRegistration) {
|
|
928
|
-
this._childFaceModels.push(registration.faceModel);
|
|
929
923
|
var when = Dsl.disposeWith(registration).when;
|
|
930
924
|
when(registration.faceModel).changes(function (is, was) {
|
|
931
|
-
_this.notifyChildFaceChanged(
|
|
925
|
+
_this.notifyChildFaceChanged(is, was);
|
|
932
926
|
}, { asLongAs: this.initialised });
|
|
933
|
-
registration.onDispose(function () { return _this._childFaceModels.remove(registration.faceModel); });
|
|
934
927
|
}
|
|
935
928
|
registration.onDispose(function () { return _this._registrations.remove(registration); });
|
|
936
929
|
return registration;
|
|
@@ -1146,10 +1139,15 @@ var CommandComponent = /** @class */ (function (_super) {
|
|
|
1146
1139
|
var _this = _super.call(this) || this;
|
|
1147
1140
|
_this.parent = parent;
|
|
1148
1141
|
_this.CommandFace = CommandFace;
|
|
1149
|
-
var _a = Dsl.disposeWith(_this), chain = _a.chain,
|
|
1150
|
-
_this.
|
|
1142
|
+
var _a = Dsl.disposeWith(_this), chain = _a.chain, switchOn = _a.switchOn;
|
|
1143
|
+
_this.activeFaceModel = switchOn(_this.command.busy).toValue(function (when) {
|
|
1144
|
+
when.equalTo(true, _this.busyFaceModel);
|
|
1145
|
+
when.otherwise(_this.faceModel);
|
|
1146
|
+
}).otherwise(_this.faceModel);
|
|
1147
|
+
_this.buttonStyle = chain(_this.activeFaceModel).map(function (f) { return CommandFace.getStyleOf(f); });
|
|
1148
|
+
_this.colorModel = chain(_this.activeFaceModel).map(function (f) { return CommandFace.getColorOf(f); });
|
|
1151
1149
|
if (parent) {
|
|
1152
|
-
_this.registerDisposable(_this.parent.registerCommand(_this.command, _this.
|
|
1150
|
+
_this.registerDisposable(_this.parent.registerCommand(_this.command, _this.activeFaceModel));
|
|
1153
1151
|
}
|
|
1154
1152
|
return _this;
|
|
1155
1153
|
}
|
|
@@ -1170,10 +1168,18 @@ var CommandComponent = /** @class */ (function (_super) {
|
|
|
1170
1168
|
Input(), StoreInValueModel('faceModel'),
|
|
1171
1169
|
__metadata("design:type", Object)
|
|
1172
1170
|
], CommandComponent.prototype, "face", void 0);
|
|
1171
|
+
__decorate([
|
|
1172
|
+
Input(), TrackExternal(),
|
|
1173
|
+
__metadata("design:type", ValueModel)
|
|
1174
|
+
], CommandComponent.prototype, "busyFaceModel", void 0);
|
|
1175
|
+
__decorate([
|
|
1176
|
+
Input(), StoreInValueModel('busyFaceModel'),
|
|
1177
|
+
__metadata("design:type", Object)
|
|
1178
|
+
], CommandComponent.prototype, "busyFace", void 0);
|
|
1173
1179
|
CommandComponent = __decorate([
|
|
1174
1180
|
Component({
|
|
1175
1181
|
selector: 'aup-command',
|
|
1176
|
-
template: "<ng-container *ngIf=\"!parent\">\n <ng-container [ngSwitch]=\"buttonStyle.value\">\n <button *ngSwitchCase=\"CommandFace.Style.STROKED\" mat-stroked-button [pectinCommand]=\"command\" [color]=\"
|
|
1182
|
+
template: "<ng-container *ngIf=\"!parent\">\n <ng-container [ngSwitch]=\"buttonStyle.value\">\n <button *ngSwitchCase=\"CommandFace.Style.STROKED\" mat-stroked-button [pectinCommand]=\"command\" [color]=\"colorModel.value\">\n <aup-command-face [face]=\"activeFaceModel.value\"></aup-command-face>\n </button>\n <button *ngSwitchCase=\"CommandFace.Style.RAISED\" mat-raised-button [pectinCommand]=\"command\" [color]=\"colorModel.value\">\n <aup-command-face [face]=\"activeFaceModel.value\"></aup-command-face>\n </button>\n <button *ngSwitchDefault mat-button [pectinCommand]=\"command\" [color]=\"colorModel.value\">\n <aup-command-face [face]=\"activeFaceModel.value\"></aup-command-face>\n </button>\n </ng-container>\n</ng-container>\n"
|
|
1177
1183
|
}),
|
|
1178
1184
|
__param(0, Optional()),
|
|
1179
1185
|
__metadata("design:paramtypes", [CommandGroup])
|