@coolon/angular-ui-powerups 13.2.1 → 13.3.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.
@@ -1,7 +1,7 @@
1
1
  import * as i4 from '@angular/common';
2
2
  import { DOCUMENT, CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { ElementRef, Directive, Inject, Host, Optional, Input, HostListener, NgZone, Injectable, Pipe, NgModule, Component, ContentChild, ViewEncapsulation, HostBinding, InjectionToken, ViewChildren, EventEmitter, ViewChild, Output, SkipSelf, Self, ContentChildren, ComponentRef, Injector, PLATFORM_ID } from '@angular/core';
4
+ import { ElementRef, Directive, Inject, Host, Optional, Input, HostListener, NgZone, Injectable, Pipe, NgModule, Component, ContentChild, ViewEncapsulation, HostBinding, InjectionToken, ViewChild, ViewChildren, EventEmitter, Output, SkipSelf, Self, ContentChildren, ComponentRef, Injector, PLATFORM_ID } from '@angular/core';
5
5
  import * as i4$1 from '@angular/forms';
6
6
  import { FormsModule } from '@angular/forms';
7
7
  import * as i1$8 from '@angular/material/form-field';
@@ -20,7 +20,7 @@ import { CdkScrollableModule } from '@angular/cdk/scrolling';
20
20
  import * as i2$1 from '@angular/material/autocomplete';
21
21
  import { MatAutocompleteModule } from '@angular/material/autocomplete';
22
22
  import * as i1 from '@angular/material/button';
23
- import { MatButtonModule } from '@angular/material/button';
23
+ import { MatButton, MatButtonModule } from '@angular/material/button';
24
24
  import * as i1$9 from '@angular/material/checkbox';
25
25
  import { MatCheckboxModule } from '@angular/material/checkbox';
26
26
  import * as i2 from '@angular/material/divider';
@@ -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, Disposable, DelegatingListModel, MutableValueModel, FocusManager, EventListenerList, Form, Guard, Binding, DebugContext, ListModel, Functions, MultipleSelectionModel, AbstractComputedListModel, DelegatingSelectionModel, DirtyTrackingForm, ComputedListModel, PageController, Trace, Deferred } 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';
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,9 +1075,12 @@ class CommandComponent extends PopupAwareComponent {
1075
1075
  getFace() {
1076
1076
  return this.face;
1077
1077
  }
1078
+ tryAndFocus() {
1079
+ this.button.focus();
1080
+ }
1078
1081
  }
1079
1082
  CommandComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: CommandComponent, deps: [{ token: i0.ElementRef }, { token: POPUP_CONTAINER, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1080
- CommandComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: CommandComponent, selector: "aup-command", inputs: { command: "command", faceModel: "faceModel", face: "face", busyFaceModel: "busyFaceModel", busyFace: "busyFace", alignFace: "alignFace" }, host: { properties: { "class": "this.alignFace" } }, usesInheritance: true, ngImport: i0, 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"], components: [{ type: i1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: CommandFaceComponent, selector: "aup-command-face", inputs: ["faces", "face", "ignoreIcon", "ignoreText", "includeMissingIconInLayout"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: CommandDirective, selector: "[pectinCommand]", inputs: ["pectinCommand", "commandParameter"] }, { type: i6.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i4.NgSwitchDefault, selector: "[ngSwitchDefault]" }] });
1083
+ CommandComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: CommandComponent, selector: "aup-command", inputs: { command: "command", faceModel: "faceModel", face: "face", busyFaceModel: "busyFaceModel", busyFace: "busyFace", alignFace: "alignFace" }, host: { properties: { "class": "this.alignFace" } }, viewQueries: [{ propertyName: "button", first: true, predicate: MatButton, descendants: true }], usesInheritance: true, ngImport: i0, 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"], components: [{ type: i1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: CommandFaceComponent, selector: "aup-command-face", inputs: ["faces", "face", "ignoreIcon", "ignoreText", "includeMissingIconInLayout"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: CommandDirective, selector: "[pectinCommand]", inputs: ["pectinCommand", "commandParameter"] }, { type: i6.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { type: i4.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i4.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i4.NgSwitchDefault, selector: "[ngSwitchDefault]" }] });
1081
1084
  __decorate([
1082
1085
  TrackExternal(),
1083
1086
  __metadata("design:type", Command)
@@ -1098,6 +1101,12 @@ __decorate([
1098
1101
  StoreInValueModel('busyFaceModel'),
1099
1102
  __metadata("design:type", Object)
1100
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);
1101
1110
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: CommandComponent, decorators: [{
1102
1111
  type: Component,
1103
1112
  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"] }]
@@ -1121,7 +1130,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
1121
1130
  }, {
1122
1131
  type: HostBinding,
1123
1132
  args: ["class"]
1124
- }] } });
1133
+ }], button: [{
1134
+ type: ViewChild,
1135
+ args: [MatButton]
1136
+ }], tryAndFocus: [] } });
1125
1137
 
1126
1138
  /**
1127
1139
  *
@@ -4988,9 +5000,15 @@ class ActivityActionsComponent extends DisposableComponent {
4988
5000
  this.cancelCommand = activity.cancelCommand;
4989
5001
  this.cdr.detectChanges();
4990
5002
  }
5003
+ focusConfirm() {
5004
+ this.confirmCommandComponent.tryAndFocus();
5005
+ }
5006
+ focusCancel() {
5007
+ this.cancelCommandComponent.tryAndFocus();
5008
+ }
4991
5009
  }
4992
5010
  ActivityActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ActivityActionsComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
4993
- ActivityActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: ActivityActionsComponent, selector: "aup-activity-actions", inputs: { confirmCommand: "confirmCommand", cancelCommand: "cancelCommand", faces: "faces", confirmFace: "confirmFace", cancelFace: "cancelFace", style: "style", layout: "layout", align: "align" }, host: { properties: { "attr.layout": "this.layout", "attr.align": "this.align" } }, usesInheritance: true, ngImport: i0, template: "<div class=\"content\">\n <ng-content></ng-content>\n</div>\n<ng-container *ngIf=\"hasConfirmFace()\">\n <aup-command class=\"confirm\" [command]=\"confirmCommand\" [face]=\"confirmFace\" data-cy=\"confirm-command\"></aup-command>\n</ng-container>\n<ng-container *ngIf=\"hasCancelFace()\">\n <aup-command class=\"cancel\" [command]=\"cancelCommand\" [face]=\"cancelFace\" data-cy=\"cancel-command\"></aup-command>\n</ng-container>\n", styles: [":host{display:grid;grid-template-rows:auto;align-items:center;justify-content:end;--resolved-activity-actions-gap: var(--activity-actions-gap, 8px)}:host[layout=block][align=start]{grid-template-areas:\"cancel confirm content\";grid-template-columns:auto auto 1fr}:host[layout=block][align=start] .confirm{margin-left:var(--resolved-activity-actions-gap)}:host[layout=block][align=end]{grid-template-areas:\"content cancel confirm\";grid-template-columns:1fr auto auto}:host[layout=block][align=end] .confirm{margin-left:var(--resolved-activity-actions-gap)}:host[layout=block][align=stretch]{grid-template-areas:\"cancel content confirm\";grid-template-columns:auto 1fr auto}:host[layout=inline]{grid-template-areas:\"confirm cancel content\";grid-template-columns:auto auto 1fr}:host[layout=inline] .cancel{margin-left:var(--resolved-activity-actions-gap)}.cancel{grid-area:cancel}.confirm{grid-area:confirm}.content{grid-area:content;text-align:left}\n"], components: [{ type: CommandComponent, selector: "aup-command", inputs: ["command", "faceModel", "face", "busyFaceModel", "busyFace", "alignFace"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
5011
+ ActivityActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: ActivityActionsComponent, selector: "aup-activity-actions", inputs: { confirmCommand: "confirmCommand", cancelCommand: "cancelCommand", faces: "faces", confirmFace: "confirmFace", cancelFace: "cancelFace", style: "style", layout: "layout", align: "align" }, host: { properties: { "attr.layout": "this.layout", "attr.align": "this.align" } }, viewQueries: [{ propertyName: "confirmCommandComponent", first: true, predicate: ["confirmCommandComponent"], descendants: true }, { propertyName: "cancelCommandComponent", first: true, predicate: ["cancelCommandComponent"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"content\">\n <ng-content></ng-content>\n</div>\n<ng-container *ngIf=\"hasConfirmFace()\">\n <aup-command #confirmCommandComponent class=\"confirm\" [command]=\"confirmCommand\" [face]=\"confirmFace\" data-cy=\"confirm-command\"></aup-command>\n</ng-container>\n<ng-container *ngIf=\"hasCancelFace()\">\n <aup-command #cancelCommandComponent class=\"cancel\" [command]=\"cancelCommand\" [face]=\"cancelFace\" data-cy=\"cancel-command\"></aup-command>\n</ng-container>\n", styles: [":host{display:grid;grid-template-rows:auto;align-items:center;justify-content:end;--resolved-activity-actions-gap: var(--activity-actions-gap, 8px)}:host[layout=block][align=start]{grid-template-areas:\"cancel confirm content\";grid-template-columns:auto auto 1fr}:host[layout=block][align=start] .confirm{margin-left:var(--resolved-activity-actions-gap)}:host[layout=block][align=end]{grid-template-areas:\"content cancel confirm\";grid-template-columns:1fr auto auto}:host[layout=block][align=end] .confirm{margin-left:var(--resolved-activity-actions-gap)}:host[layout=block][align=stretch]{grid-template-areas:\"cancel content confirm\";grid-template-columns:auto 1fr auto}:host[layout=inline]{grid-template-areas:\"confirm cancel content\";grid-template-columns:auto auto 1fr}:host[layout=inline] .cancel{margin-left:var(--resolved-activity-actions-gap)}.cancel{grid-area:cancel}.confirm{grid-area:confirm}.content{grid-area:content;text-align:left}\n"], components: [{ type: CommandComponent, selector: "aup-command", inputs: ["command", "faceModel", "face", "busyFaceModel", "busyFace", "alignFace"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
4994
5012
  __decorate([
4995
5013
  TrackExternal(),
4996
5014
  __metadata("design:type", Command)
@@ -5001,8 +5019,14 @@ __decorate([
5001
5019
  ], ActivityActionsComponent.prototype, "cancelCommand", void 0);
5002
5020
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ActivityActionsComponent, decorators: [{
5003
5021
  type: Component,
5004
- args: [{ selector: 'aup-activity-actions', template: "<div class=\"content\">\n <ng-content></ng-content>\n</div>\n<ng-container *ngIf=\"hasConfirmFace()\">\n <aup-command class=\"confirm\" [command]=\"confirmCommand\" [face]=\"confirmFace\" data-cy=\"confirm-command\"></aup-command>\n</ng-container>\n<ng-container *ngIf=\"hasCancelFace()\">\n <aup-command class=\"cancel\" [command]=\"cancelCommand\" [face]=\"cancelFace\" data-cy=\"cancel-command\"></aup-command>\n</ng-container>\n", styles: [":host{display:grid;grid-template-rows:auto;align-items:center;justify-content:end;--resolved-activity-actions-gap: var(--activity-actions-gap, 8px)}:host[layout=block][align=start]{grid-template-areas:\"cancel confirm content\";grid-template-columns:auto auto 1fr}:host[layout=block][align=start] .confirm{margin-left:var(--resolved-activity-actions-gap)}:host[layout=block][align=end]{grid-template-areas:\"content cancel confirm\";grid-template-columns:1fr auto auto}:host[layout=block][align=end] .confirm{margin-left:var(--resolved-activity-actions-gap)}:host[layout=block][align=stretch]{grid-template-areas:\"cancel content confirm\";grid-template-columns:auto 1fr auto}:host[layout=inline]{grid-template-areas:\"confirm cancel content\";grid-template-columns:auto auto 1fr}:host[layout=inline] .cancel{margin-left:var(--resolved-activity-actions-gap)}.cancel{grid-area:cancel}.confirm{grid-area:confirm}.content{grid-area:content;text-align:left}\n"] }]
5005
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { confirmCommand: [{
5022
+ args: [{ selector: 'aup-activity-actions', template: "<div class=\"content\">\n <ng-content></ng-content>\n</div>\n<ng-container *ngIf=\"hasConfirmFace()\">\n <aup-command #confirmCommandComponent class=\"confirm\" [command]=\"confirmCommand\" [face]=\"confirmFace\" data-cy=\"confirm-command\"></aup-command>\n</ng-container>\n<ng-container *ngIf=\"hasCancelFace()\">\n <aup-command #cancelCommandComponent class=\"cancel\" [command]=\"cancelCommand\" [face]=\"cancelFace\" data-cy=\"cancel-command\"></aup-command>\n</ng-container>\n", styles: [":host{display:grid;grid-template-rows:auto;align-items:center;justify-content:end;--resolved-activity-actions-gap: var(--activity-actions-gap, 8px)}:host[layout=block][align=start]{grid-template-areas:\"cancel confirm content\";grid-template-columns:auto auto 1fr}:host[layout=block][align=start] .confirm{margin-left:var(--resolved-activity-actions-gap)}:host[layout=block][align=end]{grid-template-areas:\"content cancel confirm\";grid-template-columns:1fr auto auto}:host[layout=block][align=end] .confirm{margin-left:var(--resolved-activity-actions-gap)}:host[layout=block][align=stretch]{grid-template-areas:\"cancel content confirm\";grid-template-columns:auto 1fr auto}:host[layout=inline]{grid-template-areas:\"confirm cancel content\";grid-template-columns:auto auto 1fr}:host[layout=inline] .cancel{margin-left:var(--resolved-activity-actions-gap)}.cancel{grid-area:cancel}.confirm{grid-area:confirm}.content{grid-area:content;text-align:left}\n"] }]
5023
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { confirmCommandComponent: [{
5024
+ type: ViewChild,
5025
+ args: ["confirmCommandComponent"]
5026
+ }], cancelCommandComponent: [{
5027
+ type: ViewChild,
5028
+ args: ["cancelCommandComponent"]
5029
+ }], confirmCommand: [{
5006
5030
  type: Input
5007
5031
  }], cancelCommand: [{
5008
5032
  type: Input
@@ -5037,30 +5061,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
5037
5061
  });
5038
5062
  })(ActivityActionsComponent || (ActivityActionsComponent = {}));
5039
5063
 
5040
- const ACTIVITY_DATA = new InjectionToken('InteractionActivityData');
5064
+ const ACTIVITY_DATA = new InjectionToken("InteractionActivityData");
5041
5065
  class Activity extends DisposableComponent {
5042
5066
  constructor() {
5043
5067
  super();
5044
- this._busyModel = this.registerDisposable(new DelegatingValueModel().withDefault(false));
5045
- this._focusedModel = this.registerDisposable(new DelegatingValueModel());
5046
- this.class = 'aup-activity';
5068
+ this.activityReadyListeners = new EventListenerList();
5069
+ this._busy$ = this.registerDisposable(new DelegatingValueModel().withDefault(false));
5070
+ this._focused$ = this.registerDisposable(new DelegatingValueModel());
5071
+ this.class = "aup-activity";
5047
5072
  this.busyWhile(this.confirmCommand.busy);
5048
5073
  }
5049
5074
  get isFocused() {
5050
- return this._focusedModel.value;
5075
+ return this._focused$.value;
5051
5076
  }
5052
5077
  initialise(nestedInteractionContext, activityContext) {
5053
5078
  const { chain, when } = Dsl.disposeWith(this);
5054
5079
  assert$1.isNil(this._activityContext);
5055
5080
  this._activityContext = activityContext;
5056
5081
  this._interactionContext = nestedInteractionContext;
5057
- this._focusedModel.setDelegate(activityContext.focused);
5058
- when(this._focusedModel).becomesTruthy(() => {
5059
- this.onActivityReady();
5082
+ this._focused$.setDelegate(activityContext.focused);
5083
+ when(this._focused$).becomesTruthy(() => {
5084
+ this.notifyActivityReady();
5060
5085
  });
5061
5086
  }
5062
5087
  ngAfterViewInit() {
5063
- this.activityActions?.initCommands(this);
5088
+ if (this.activityActions) {
5089
+ this.initialiseActivityAction(this.activityActions);
5090
+ }
5091
+ }
5092
+ initialiseActivityAction(activityActions) {
5093
+ activityActions.initCommands(this);
5064
5094
  }
5065
5095
  get interactionContext() {
5066
5096
  assert$1.isTruthy(this.isInitialised());
@@ -5072,27 +5102,30 @@ class Activity extends DisposableComponent {
5072
5102
  cancel(error) {
5073
5103
  this._activityContext.onCancel(error);
5074
5104
  }
5075
- // @Trace()
5076
- onActivityReady() {
5105
+ notifyActivityReady() {
5106
+ this.activityReadyListeners.fire(l => l(this));
5077
5107
  }
5078
- get busy() {
5079
- return this._busyModel.readonly;
5108
+ onActivityReady(callback) {
5109
+ return this.activityReadyListeners.add(callback);
5080
5110
  }
5081
- get focused() {
5082
- return this._focusedModel.readonly;
5111
+ get busy$() {
5112
+ return this._busy$.readonly;
5113
+ }
5114
+ get focused$() {
5115
+ return this._focused$.readonly;
5083
5116
  }
5084
5117
  busyWhile(busyModel) {
5085
- this._busyModel.setDelegate(busyModel);
5118
+ this._busy$.setDelegate(busyModel);
5086
5119
  }
5087
5120
  isBusy() {
5088
- return this._busyModel.value;
5121
+ return this._busy$.value;
5089
5122
  }
5090
5123
  isInitialised() {
5091
5124
  return !!this._activityContext;
5092
5125
  }
5093
5126
  }
5094
5127
  Activity.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: Activity, deps: [], target: i0.ɵɵFactoryTarget.Component });
5095
- Activity.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: Activity, selector: "ng-component", host: { properties: { "class": "this.class", "attr.focused": "this.isFocused" } }, viewQueries: [{ propertyName: "activityActions", first: true, predicate: ActivityActionsComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
5128
+ Activity.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: Activity, selector: "ng-component", host: { properties: { "class": "this.class", "attr.focused": "this.isFocused" } }, viewQueries: [{ propertyName: "activityActions", first: true, predicate: ActivityActionsComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "", isInline: true });
5096
5129
  __decorate([
5097
5130
  TrackExternal(),
5098
5131
  __metadata("design:type", Command)
@@ -5104,17 +5137,17 @@ __decorate([
5104
5137
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: Activity, decorators: [{
5105
5138
  type: Component,
5106
5139
  args: [{
5107
- template: ''
5140
+ template: ""
5108
5141
  }]
5109
5142
  }], ctorParameters: function () { return []; }, propDecorators: { activityActions: [{
5110
5143
  type: ViewChild,
5111
5144
  args: [ActivityActionsComponent]
5112
5145
  }], confirmCommand: [], cancelCommand: [], class: [{
5113
5146
  type: HostBinding,
5114
- args: ['class']
5147
+ args: ["class"]
5115
5148
  }], isFocused: [{
5116
5149
  type: HostBinding,
5117
- args: ['attr.focused']
5150
+ args: ["attr.focused"]
5118
5151
  }] } });
5119
5152
 
5120
5153
  var Alert;
@@ -5148,6 +5181,11 @@ class AbstractDialogComponent extends Activity {
5148
5181
  color: () => this.color || 'primary',
5149
5182
  style: () => 'raised'
5150
5183
  };
5184
+ this.onActivityReady(() => {
5185
+ if (this.activityActions) {
5186
+ this.isDestructive() ? this.activityActions.focusCancel() : this.activityActions.focusConfirm();
5187
+ }
5188
+ });
5151
5189
  }
5152
5190
  getConfig() {
5153
5191
  return lang$1.abstractMethod(this.constructor);
@@ -7130,7 +7168,7 @@ class ActivityRef {
7130
7168
  },
7131
7169
  focused: this.focusedModel.readonly
7132
7170
  });
7133
- this._activityBusy.setDelegate(this._activity.busy);
7171
+ this._activityBusy.setDelegate(this._activity.busy$);
7134
7172
  }
7135
7173
  finishActivity(resolveOrReject) {
7136
7174
  assert.isFalsey(this.isComplete());
@@ -7182,7 +7220,10 @@ class ActivityOutletComponent {
7182
7220
  loadActivity(activityRef) {
7183
7221
  const injector = Injector.create({
7184
7222
  providers: [
7185
- { provide: ACTIVITY_DATA, useValue: activityRef.activityData }
7223
+ {
7224
+ provide: ACTIVITY_DATA,
7225
+ useValue: activityRef.activityData
7226
+ }
7186
7227
  ],
7187
7228
  parent: this.injector
7188
7229
  });
@@ -7991,13 +8032,11 @@ class InputActivity extends Activity {
7991
8032
  this.cancel();
7992
8033
  });
7993
8034
  this.busyWhile(this.confirmCommand.busy);
8035
+ this.onActivityReady(() => this.valueModel.focusContext.requestFocus());
7994
8036
  }
7995
8037
  get layout() {
7996
8038
  return this.data?.layout ?? InputActivity.Layout.BLOCK;
7997
8039
  }
7998
- onActivityReady() {
7999
- this.valueModel.focusContext.requestFocus();
8000
- }
8001
8040
  get additionalCssClassName() {
8002
8041
  return this.data.cssClassName ?? '';
8003
8042
  }