@coolon/angular-ui-powerups 2.0.0-alpha.36 → 2.0.0-alpha.37

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 (24) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/bundles/coolon-angular-ui-powerups.umd.js +18 -16
  3. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  4. package/bundles/coolon-angular-ui-powerups.umd.min.js +2 -2
  5. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  6. package/coolon-angular-ui-powerups.metadata.json +1 -1
  7. package/esm2015/lib/components/commands/command/command.component.js +17 -4
  8. package/esm2015/lib/components/commands/command/command.component.js.map +1 -1
  9. package/esm2015/lib/components/commands/command/command.component.metadata.json +1 -1
  10. package/esm2015/lib/components/commands/group/command-group.js +1 -13
  11. package/esm2015/lib/components/commands/group/command-group.js.map +1 -1
  12. package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
  13. package/esm5/lib/components/commands/command/command.component.js +17 -4
  14. package/esm5/lib/components/commands/command/command.component.js.map +1 -1
  15. package/esm5/lib/components/commands/group/command-group.js +1 -13
  16. package/esm5/lib/components/commands/group/command-group.js.map +1 -1
  17. package/esm5/lib/components/components.module.ngfactory.js.map +1 -1
  18. package/fesm2015/coolon-angular-ui-powerups.js +18 -16
  19. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  20. package/fesm5/coolon-angular-ui-powerups.js +18 -16
  21. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  22. package/lib/components/commands/command/command.component.d.ts +4 -0
  23. package/lib/components/commands/group/command-group.d.ts +2 -5
  24. package/package.json +1 -1
@@ -854,16 +854,7 @@ var CommandGroup = /** @class */ (function (_super) {
854
854
  _this.parent = parent;
855
855
  _this._rootTemplate = new MutableValueModel();
856
856
  _this._registrations = new MutableListModel();
857
- _this._childFaceModels = new MutableListModel();
858
- _this._faceChangeCount = new MutableValueModel(0);
859
857
  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
858
  _this.childTemplates = chain(_this._rootTemplate).pluckList('children');
868
859
  _this.initialised = chain(_this._rootTemplate).isNotNil();
869
860
  return _this;
@@ -925,12 +916,10 @@ var CommandGroup = /** @class */ (function (_super) {
925
916
  var _this = this;
926
917
  this._registrations.push(registration);
927
918
  if (registration instanceof Registration.FaceRegistration) {
928
- this._childFaceModels.push(registration.faceModel);
929
919
  var when = Dsl.disposeWith(registration).when;
930
920
  when(registration.faceModel).changes(function (is, was) {
931
- _this.notifyChildFaceChanged(new CommandFace.Adapter(is), new CommandFace.Adapter(was));
921
+ _this.notifyChildFaceChanged(is, was);
932
922
  }, { asLongAs: this.initialised });
933
- registration.onDispose(function () { return _this._childFaceModels.remove(registration.faceModel); });
934
923
  }
935
924
  registration.onDispose(function () { return _this._registrations.remove(registration); });
936
925
  return registration;
@@ -1146,10 +1135,15 @@ var CommandComponent = /** @class */ (function (_super) {
1146
1135
  var _this = _super.call(this) || this;
1147
1136
  _this.parent = parent;
1148
1137
  _this.CommandFace = CommandFace;
1149
- 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;
1150
- _this.buttonStyle = chain(_this.faceModel).map(function (f) { return CommandFace.getStyleOf(f); });
1138
+ var _a = Dsl.disposeWith(_this), chain = _a.chain, switchOn = _a.switchOn;
1139
+ _this.activeFaceModel = switchOn(_this.command.busy).toValue(function (when) {
1140
+ when.equalTo(true, _this.busyFaceModel);
1141
+ when.otherwise(_this.faceModel);
1142
+ }).otherwise(_this.faceModel);
1143
+ _this.buttonStyle = chain(_this.activeFaceModel).map(function (f) { return CommandFace.getStyleOf(f); });
1144
+ _this.colorModel = chain(_this.activeFaceModel).map(function (f) { return CommandFace.getColorOf(f); });
1151
1145
  if (parent) {
1152
- _this.registerDisposable(_this.parent.registerCommand(_this.command, _this.faceModel));
1146
+ _this.registerDisposable(_this.parent.registerCommand(_this.command, _this.activeFaceModel));
1153
1147
  }
1154
1148
  return _this;
1155
1149
  }
@@ -1170,10 +1164,18 @@ var CommandComponent = /** @class */ (function (_super) {
1170
1164
  Input(), StoreInValueModel('faceModel'),
1171
1165
  __metadata("design:type", Object)
1172
1166
  ], CommandComponent.prototype, "face", void 0);
1167
+ __decorate([
1168
+ Input(), TrackExternal(),
1169
+ __metadata("design:type", ValueModel)
1170
+ ], CommandComponent.prototype, "busyFaceModel", void 0);
1171
+ __decorate([
1172
+ Input(), StoreInValueModel('busyFaceModel'),
1173
+ __metadata("design:type", Object)
1174
+ ], CommandComponent.prototype, "busyFace", void 0);
1173
1175
  CommandComponent = __decorate([
1174
1176
  Component({
1175
1177
  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]=\"CommandFace.getColorOf(face)\">\n <aup-command-face [face]=\"face\"></aup-command-face>\n </button>\n <button *ngSwitchCase=\"CommandFace.Style.RAISED\" mat-raised-button [pectinCommand]=\"command\" [color]=\"CommandFace.getColorOf(face)\">\n <aup-command-face [face]=\"face\"></aup-command-face>\n </button>\n <button *ngSwitchDefault mat-button [pectinCommand]=\"command\" [color]=\"CommandFace.getColorOf(face)\">\n <aup-command-face [face]=\"face\"></aup-command-face>\n </button>\n </ng-container>\n</ng-container>\n"
1178
+ 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
1179
  }),
1178
1180
  __param(0, Optional()),
1179
1181
  __metadata("design:paramtypes", [CommandGroup])