@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
|
@@ -407,6 +407,10 @@ var CommandFace;
|
|
|
407
407
|
return ___default.isFunction(face === null || face === void 0 ? void 0 : face.icon) ? face.icon() : undefined;
|
|
408
408
|
}
|
|
409
409
|
CommandFace.getIconOf = getIconOf;
|
|
410
|
+
function getIconPositionOf(face) {
|
|
411
|
+
return ___default.isFunction(face === null || face === void 0 ? void 0 : face.iconPosition) ? face.iconPosition() : undefined;
|
|
412
|
+
}
|
|
413
|
+
CommandFace.getIconPositionOf = getIconPositionOf;
|
|
410
414
|
function getTooltipOf(face) {
|
|
411
415
|
return ___default.isFunction(face === null || face === void 0 ? void 0 : face.tooltip) ? face.tooltip() : undefined;
|
|
412
416
|
}
|
|
@@ -420,16 +424,16 @@ var CommandFace;
|
|
|
420
424
|
this.face = face;
|
|
421
425
|
}
|
|
422
426
|
get text() {
|
|
423
|
-
return
|
|
427
|
+
return CommandFace.getTextOf(this.face);
|
|
424
428
|
}
|
|
425
429
|
get icon() {
|
|
426
430
|
return CommandFace.getIconOf(this.face);
|
|
427
431
|
}
|
|
428
432
|
get iconPosition() {
|
|
429
|
-
return
|
|
433
|
+
return CommandFace.getIconPositionOf(this.face);
|
|
430
434
|
}
|
|
431
435
|
get tooltip() {
|
|
432
|
-
return
|
|
436
|
+
return CommandFace.getTooltipOf(this.face);
|
|
433
437
|
}
|
|
434
438
|
get iconPositionStart() {
|
|
435
439
|
return this.iconPosition === CommandFace.Position.START;
|
|
@@ -728,16 +732,7 @@ class CommandGroup extends GarbageCollector {
|
|
|
728
732
|
this.parent = parent;
|
|
729
733
|
this._rootTemplate = new MutableValueModel();
|
|
730
734
|
this._registrations = new MutableListModel();
|
|
731
|
-
this._childFaceModels = new MutableListModel();
|
|
732
|
-
this._faceChangeCount = new MutableValueModel(0);
|
|
733
735
|
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
734
|
-
const childFaces = chain(this._childFaceModels)
|
|
735
|
-
.map(m => m.value, { dependsOn: this._faceChangeCount })
|
|
736
|
-
.rejectNil();
|
|
737
|
-
const iconCount = childFaces
|
|
738
|
-
.select(face => !!CommandFace.getIconOf(face))
|
|
739
|
-
.count();
|
|
740
|
-
this.hasMixedIcons = valueOf.all(iconCount.isGreaterThan(0), iconCount.doesNotEqual(childFaces.length)).areTruthy();
|
|
741
736
|
this.childTemplates = chain(this._rootTemplate).pluckList('children');
|
|
742
737
|
this.initialised = chain(this._rootTemplate).isNotNil();
|
|
743
738
|
}
|
|
@@ -785,12 +780,10 @@ class CommandGroup extends GarbageCollector {
|
|
|
785
780
|
register(registration) {
|
|
786
781
|
this._registrations.push(registration);
|
|
787
782
|
if (registration instanceof Registration.FaceRegistration) {
|
|
788
|
-
this._childFaceModels.push(registration.faceModel);
|
|
789
783
|
const { when } = Dsl.disposeWith(registration);
|
|
790
784
|
when(registration.faceModel).changes((is, was) => {
|
|
791
|
-
this.notifyChildFaceChanged(
|
|
785
|
+
this.notifyChildFaceChanged(is, was);
|
|
792
786
|
}, { asLongAs: this.initialised });
|
|
793
|
-
registration.onDispose(() => this._childFaceModels.remove(registration.faceModel));
|
|
794
787
|
}
|
|
795
788
|
registration.onDispose(() => this._registrations.remove(registration));
|
|
796
789
|
return registration;
|
|
@@ -964,10 +957,15 @@ let CommandComponent = class CommandComponent extends DisposableComponent {
|
|
|
964
957
|
super();
|
|
965
958
|
this.parent = parent;
|
|
966
959
|
this.CommandFace = CommandFace;
|
|
967
|
-
const { chain,
|
|
968
|
-
this.
|
|
960
|
+
const { chain, switchOn } = Dsl.disposeWith(this);
|
|
961
|
+
this.activeFaceModel = switchOn(this.command.busy).toValue(when => {
|
|
962
|
+
when.equalTo(true, this.busyFaceModel);
|
|
963
|
+
when.otherwise(this.faceModel);
|
|
964
|
+
}).otherwise(this.faceModel);
|
|
965
|
+
this.buttonStyle = chain(this.activeFaceModel).map(f => CommandFace.getStyleOf(f));
|
|
966
|
+
this.colorModel = chain(this.activeFaceModel).map(f => CommandFace.getColorOf(f));
|
|
969
967
|
if (parent) {
|
|
970
|
-
this.registerDisposable(this.parent.registerCommand(this.command, this.
|
|
968
|
+
this.registerDisposable(this.parent.registerCommand(this.command, this.activeFaceModel));
|
|
971
969
|
}
|
|
972
970
|
}
|
|
973
971
|
ngOnInit() {
|
|
@@ -988,10 +986,18 @@ __decorate([
|
|
|
988
986
|
Input(), StoreInValueModel('faceModel'),
|
|
989
987
|
__metadata("design:type", Object)
|
|
990
988
|
], CommandComponent.prototype, "face", void 0);
|
|
989
|
+
__decorate([
|
|
990
|
+
Input(), TrackExternal(),
|
|
991
|
+
__metadata("design:type", ValueModel)
|
|
992
|
+
], CommandComponent.prototype, "busyFaceModel", void 0);
|
|
993
|
+
__decorate([
|
|
994
|
+
Input(), StoreInValueModel('busyFaceModel'),
|
|
995
|
+
__metadata("design:type", Object)
|
|
996
|
+
], CommandComponent.prototype, "busyFace", void 0);
|
|
991
997
|
CommandComponent = __decorate([
|
|
992
998
|
Component({
|
|
993
999
|
selector: 'aup-command',
|
|
994
|
-
template: "<ng-container *ngIf=\"!parent\">\n <ng-container [ngSwitch]=\"buttonStyle.value\">\n <button *ngSwitchCase=\"CommandFace.Style.STROKED\" mat-stroked-button [pectinCommand]=\"command\" [color]=\"
|
|
1000
|
+
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"
|
|
995
1001
|
}),
|
|
996
1002
|
__param(0, Optional()),
|
|
997
1003
|
__metadata("design:paramtypes", [CommandGroup])
|