@coolon/angular-ui-powerups 13.3.0 → 13.5.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.
@@ -40,7 +40,7 @@ import { MatTooltipModule } from '@angular/material/tooltip';
40
40
  import * as i1$5 from '@fortawesome/angular-fontawesome';
41
41
  import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
42
42
  import * as i1$7 from '@coolon/pectin';
43
- import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, ValueModel, StoreInValueModel, Command, MutableListModel, StoreInListModel, Trace, Disposable, DelegatingListModel, MutableValueModel, FocusManager, EventListenerList, Form, Guard, Binding, DebugContext, ListModel, Functions, MultipleSelectionModel, AbstractComputedListModel, DelegatingSelectionModel, DirtyTrackingForm, ComputedListModel, PageController, Deferred } from '@coolon/pectin';
43
+ import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, ValueModel, StoreInValueModel, Command, MutableListModel, StoreInListModel, Disposable, DelegatingListModel, MutableValueModel, FocusManager, EventListenerList, Form, Guard, Binding, DebugContext, ListModel, Functions, MultipleSelectionModel, AbstractComputedListModel, DelegatingSelectionModel, DirtyTrackingForm, ComputedListModel, PageController, Trace, Deferred } from '@coolon/pectin';
44
44
  import { __decorate, __param, __metadata } from 'tslib';
45
45
  import * as i1$2 from '@angular/platform-browser';
46
46
  import * as _ from 'lodash';
@@ -1075,7 +1075,7 @@ class CommandComponent extends PopupAwareComponent {
1075
1075
  getFace() {
1076
1076
  return this.face;
1077
1077
  }
1078
- tryAndFocus() {
1078
+ requestFocus() {
1079
1079
  this.button.focus();
1080
1080
  }
1081
1081
  }
@@ -1101,12 +1101,6 @@ __decorate([
1101
1101
  StoreInValueModel('busyFaceModel'),
1102
1102
  __metadata("design:type", Object)
1103
1103
  ], CommandComponent.prototype, "busyFace", void 0);
1104
- __decorate([
1105
- Trace(),
1106
- __metadata("design:type", Function),
1107
- __metadata("design:paramtypes", []),
1108
- __metadata("design:returntype", void 0)
1109
- ], CommandComponent.prototype, "tryAndFocus", null);
1110
1104
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: CommandComponent, decorators: [{
1111
1105
  type: Component,
1112
1106
  args: [{ selector: 'aup-command', template: "<ng-container *ngIf=\"iconOnly$.value\">\n <button mat-icon-button [pectinCommand]=\"command\" [color]=\"color$.value\" [class.busy]=\"command.busy.value\"\n [matTooltip]=\"tooltip$.value\">\n <aup-command-face [class]=\"alignFace\" [faces]=\"faces$.value\"></aup-command-face>\n </button>\n</ng-container>\n<ng-container *ngIf=\"!iconOnly$.value\">\n <ng-container [ngSwitch]=\"buttonStyle$.value\">\n <ng-container *ngSwitchCase=\"CommandFace.Style.STROKED\">\n <button mat-stroked-button [pectinCommand]=\"command\" [color]=\"color$.value\" [class.busy]=\"command.busy.value\"\n [matTooltip]=\"tooltip$.value\">\n <aup-command-face [class]=\"alignFace\" [faces]=\"faces$.value\"></aup-command-face>\n </button>\n </ng-container>\n <ng-container *ngSwitchCase=\"CommandFace.Style.RAISED\">\n <button mat-raised-button [pectinCommand]=\"command\" [color]=\"color$.value\" [class.busy]=\"command.busy.value\"\n [matTooltip]=\"tooltip$.value\">\n <aup-command-face [class]=\"alignFace\" [faces]=\"faces$.value\"></aup-command-face>\n </button>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <button mat-button [pectinCommand]=\"command\" [color]=\"color$.value\" [class.busy]=\"command.busy.value\"\n [matTooltip]=\"tooltip$.value\">\n <aup-command-face [class]=\"alignFace\" [faces]=\"faces$.value\"></aup-command-face>\n </button>\n </ng-container>\n </ng-container>\n</ng-container>\n", styles: [":host{display:inline-flex;flex-direction:row;justify-content:stretch}:host.centered button{text-align:center}:host.start button{text-align:start}:host.end button{text-align:end}button{flex:1}\n"] }]
@@ -1133,7 +1127,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
1133
1127
  }], button: [{
1134
1128
  type: ViewChild,
1135
1129
  args: [MatButton]
1136
- }], tryAndFocus: [] } });
1130
+ }] } });
1137
1131
 
1138
1132
  /**
1139
1133
  *
@@ -5001,10 +4995,10 @@ class ActivityActionsComponent extends DisposableComponent {
5001
4995
  this.cdr.detectChanges();
5002
4996
  }
5003
4997
  focusConfirm() {
5004
- this.confirmCommandComponent.tryAndFocus();
4998
+ this.confirmCommandComponent.requestFocus();
5005
4999
  }
5006
5000
  focusCancel() {
5007
- this.cancelCommandComponent.tryAndFocus();
5001
+ this.cancelCommandComponent.requestFocus();
5008
5002
  }
5009
5003
  }
5010
5004
  ActivityActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ActivityActionsComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
@@ -5068,6 +5062,7 @@ class Activity extends DisposableComponent {
5068
5062
  this.activityReadyListeners = new EventListenerList();
5069
5063
  this._busy$ = this.registerDisposable(new DelegatingValueModel().withDefault(false));
5070
5064
  this._focused$ = this.registerDisposable(new DelegatingValueModel());
5065
+ this._ready$ = new MutableValueModel(false);
5071
5066
  this.class = "aup-activity";
5072
5067
  this.busyWhile(this.confirmCommand.busy);
5073
5068
  }
@@ -5104,10 +5099,17 @@ class Activity extends DisposableComponent {
5104
5099
  }
5105
5100
  notifyActivityReady() {
5106
5101
  this.activityReadyListeners.fire(l => l(this));
5102
+ this._ready$.value = true;
5107
5103
  }
5108
5104
  onActivityReady(callback) {
5109
5105
  return this.activityReadyListeners.add(callback);
5110
5106
  }
5107
+ autoFocusOnActivityReady(focusable) {
5108
+ return this.onActivityReady(() => focusable.requestFocus());
5109
+ }
5110
+ get ready$() {
5111
+ return this._ready$.readonly;
5112
+ }
5111
5113
  get busy$() {
5112
5114
  return this._busy$.readonly;
5113
5115
  }