@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.
- package/esm2020/lib/components/commands/command/command.component.mjs +18 -5
- package/esm2020/lib/interaction/activity-ref.mjs +2 -2
- package/esm2020/lib/interaction/activity.mjs +36 -27
- package/esm2020/lib/interaction/components/abstract-confirm-dialog.component.mjs +1 -1
- package/esm2020/lib/interaction/components/abstract-dialog.component.mjs +6 -1
- package/esm2020/lib/interaction/components/activity-actions/activity-actions.component.mjs +18 -5
- package/esm2020/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.mjs +5 -2
- package/esm2020/lib/interaction/components/input-activities/input-activity.mjs +2 -4
- package/fesm2015/coolon-angular-ui-powerups.mjs +73 -35
- package/fesm2015/coolon-angular-ui-powerups.mjs.map +1 -1
- package/fesm2020/coolon-angular-ui-powerups.mjs +73 -34
- package/fesm2020/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/components/commands/command/command.component.d.ts +5 -2
- package/lib/interaction/activity.d.ts +15 -10
- package/lib/interaction/components/activity-actions/activity-actions.component.d.ts +6 -1
- package/lib/interaction/components/input-activities/input-activity.d.ts +0 -1
- package/package.json +1 -1
|
@@ -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,
|
|
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, Deferred
|
|
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, __awaiter } from 'tslib';
|
|
45
45
|
import * as _ from 'lodash';
|
|
46
46
|
import { isEmpty, isString, isFunction, isNil, isInteger, isEqual, uniq, first, findLast, isObject, isNumber, isNaN as isNaN$1 } from 'lodash';
|
|
@@ -1085,9 +1085,12 @@ class CommandComponent extends PopupAwareComponent {
|
|
|
1085
1085
|
getFace() {
|
|
1086
1086
|
return this.face;
|
|
1087
1087
|
}
|
|
1088
|
+
tryAndFocus() {
|
|
1089
|
+
this.button.focus();
|
|
1090
|
+
}
|
|
1088
1091
|
}
|
|
1089
1092
|
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 });
|
|
1090
|
-
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]" }] });
|
|
1093
|
+
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]" }] });
|
|
1091
1094
|
__decorate([
|
|
1092
1095
|
TrackExternal(),
|
|
1093
1096
|
__metadata("design:type", Command)
|
|
@@ -1108,6 +1111,12 @@ __decorate([
|
|
|
1108
1111
|
StoreInValueModel('busyFaceModel'),
|
|
1109
1112
|
__metadata("design:type", Object)
|
|
1110
1113
|
], CommandComponent.prototype, "busyFace", void 0);
|
|
1114
|
+
__decorate([
|
|
1115
|
+
Trace(),
|
|
1116
|
+
__metadata("design:type", Function),
|
|
1117
|
+
__metadata("design:paramtypes", []),
|
|
1118
|
+
__metadata("design:returntype", void 0)
|
|
1119
|
+
], CommandComponent.prototype, "tryAndFocus", null);
|
|
1111
1120
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: CommandComponent, decorators: [{
|
|
1112
1121
|
type: Component,
|
|
1113
1122
|
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 +1142,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
1133
1142
|
}, {
|
|
1134
1143
|
type: HostBinding,
|
|
1135
1144
|
args: ["class"]
|
|
1136
|
-
}]
|
|
1145
|
+
}], button: [{
|
|
1146
|
+
type: ViewChild,
|
|
1147
|
+
args: [MatButton]
|
|
1148
|
+
}], tryAndFocus: [] } });
|
|
1137
1149
|
|
|
1138
1150
|
/**
|
|
1139
1151
|
*
|
|
@@ -5033,9 +5045,15 @@ class ActivityActionsComponent extends DisposableComponent {
|
|
|
5033
5045
|
this.cancelCommand = activity.cancelCommand;
|
|
5034
5046
|
this.cdr.detectChanges();
|
|
5035
5047
|
}
|
|
5048
|
+
focusConfirm() {
|
|
5049
|
+
this.confirmCommandComponent.tryAndFocus();
|
|
5050
|
+
}
|
|
5051
|
+
focusCancel() {
|
|
5052
|
+
this.cancelCommandComponent.tryAndFocus();
|
|
5053
|
+
}
|
|
5036
5054
|
}
|
|
5037
5055
|
ActivityActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ActivityActionsComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
5038
|
-
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"] }] });
|
|
5056
|
+
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"] }] });
|
|
5039
5057
|
__decorate([
|
|
5040
5058
|
TrackExternal(),
|
|
5041
5059
|
__metadata("design:type", Command)
|
|
@@ -5046,8 +5064,14 @@ __decorate([
|
|
|
5046
5064
|
], ActivityActionsComponent.prototype, "cancelCommand", void 0);
|
|
5047
5065
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ActivityActionsComponent, decorators: [{
|
|
5048
5066
|
type: Component,
|
|
5049
|
-
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"] }]
|
|
5050
|
-
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: {
|
|
5067
|
+
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"] }]
|
|
5068
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { confirmCommandComponent: [{
|
|
5069
|
+
type: ViewChild,
|
|
5070
|
+
args: ["confirmCommandComponent"]
|
|
5071
|
+
}], cancelCommandComponent: [{
|
|
5072
|
+
type: ViewChild,
|
|
5073
|
+
args: ["cancelCommandComponent"]
|
|
5074
|
+
}], confirmCommand: [{
|
|
5051
5075
|
type: Input
|
|
5052
5076
|
}], cancelCommand: [{
|
|
5053
5077
|
type: Input
|
|
@@ -5082,31 +5106,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
5082
5106
|
});
|
|
5083
5107
|
})(ActivityActionsComponent || (ActivityActionsComponent = {}));
|
|
5084
5108
|
|
|
5085
|
-
const ACTIVITY_DATA = new InjectionToken(
|
|
5109
|
+
const ACTIVITY_DATA = new InjectionToken("InteractionActivityData");
|
|
5086
5110
|
class Activity extends DisposableComponent {
|
|
5087
5111
|
constructor() {
|
|
5088
5112
|
super();
|
|
5089
|
-
this.
|
|
5090
|
-
this.
|
|
5091
|
-
this.
|
|
5113
|
+
this.activityReadyListeners = new EventListenerList();
|
|
5114
|
+
this._busy$ = this.registerDisposable(new DelegatingValueModel().withDefault(false));
|
|
5115
|
+
this._focused$ = this.registerDisposable(new DelegatingValueModel());
|
|
5116
|
+
this.class = "aup-activity";
|
|
5092
5117
|
this.busyWhile(this.confirmCommand.busy);
|
|
5093
5118
|
}
|
|
5094
5119
|
get isFocused() {
|
|
5095
|
-
return this.
|
|
5120
|
+
return this._focused$.value;
|
|
5096
5121
|
}
|
|
5097
5122
|
initialise(nestedInteractionContext, activityContext) {
|
|
5098
5123
|
const { chain, when } = Dsl.disposeWith(this);
|
|
5099
5124
|
assert$1.isNil(this._activityContext);
|
|
5100
5125
|
this._activityContext = activityContext;
|
|
5101
5126
|
this._interactionContext = nestedInteractionContext;
|
|
5102
|
-
this.
|
|
5103
|
-
when(this.
|
|
5104
|
-
this.
|
|
5127
|
+
this._focused$.setDelegate(activityContext.focused);
|
|
5128
|
+
when(this._focused$).becomesTruthy(() => {
|
|
5129
|
+
this.notifyActivityReady();
|
|
5105
5130
|
});
|
|
5106
5131
|
}
|
|
5107
5132
|
ngAfterViewInit() {
|
|
5108
|
-
|
|
5109
|
-
|
|
5133
|
+
if (this.activityActions) {
|
|
5134
|
+
this.initialiseActivityAction(this.activityActions);
|
|
5135
|
+
}
|
|
5136
|
+
}
|
|
5137
|
+
initialiseActivityAction(activityActions) {
|
|
5138
|
+
activityActions.initCommands(this);
|
|
5110
5139
|
}
|
|
5111
5140
|
get interactionContext() {
|
|
5112
5141
|
assert$1.isTruthy(this.isInitialised());
|
|
@@ -5118,27 +5147,30 @@ class Activity extends DisposableComponent {
|
|
|
5118
5147
|
cancel(error) {
|
|
5119
5148
|
this._activityContext.onCancel(error);
|
|
5120
5149
|
}
|
|
5121
|
-
|
|
5122
|
-
|
|
5150
|
+
notifyActivityReady() {
|
|
5151
|
+
this.activityReadyListeners.fire(l => l(this));
|
|
5123
5152
|
}
|
|
5124
|
-
|
|
5125
|
-
return this.
|
|
5153
|
+
onActivityReady(callback) {
|
|
5154
|
+
return this.activityReadyListeners.add(callback);
|
|
5126
5155
|
}
|
|
5127
|
-
get
|
|
5128
|
-
return this.
|
|
5156
|
+
get busy$() {
|
|
5157
|
+
return this._busy$.readonly;
|
|
5158
|
+
}
|
|
5159
|
+
get focused$() {
|
|
5160
|
+
return this._focused$.readonly;
|
|
5129
5161
|
}
|
|
5130
5162
|
busyWhile(busyModel) {
|
|
5131
|
-
this.
|
|
5163
|
+
this._busy$.setDelegate(busyModel);
|
|
5132
5164
|
}
|
|
5133
5165
|
isBusy() {
|
|
5134
|
-
return this.
|
|
5166
|
+
return this._busy$.value;
|
|
5135
5167
|
}
|
|
5136
5168
|
isInitialised() {
|
|
5137
5169
|
return !!this._activityContext;
|
|
5138
5170
|
}
|
|
5139
5171
|
}
|
|
5140
5172
|
Activity.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: Activity, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5141
|
-
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:
|
|
5173
|
+
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 });
|
|
5142
5174
|
__decorate([
|
|
5143
5175
|
TrackExternal(),
|
|
5144
5176
|
__metadata("design:type", Command)
|
|
@@ -5150,17 +5182,17 @@ __decorate([
|
|
|
5150
5182
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: Activity, decorators: [{
|
|
5151
5183
|
type: Component,
|
|
5152
5184
|
args: [{
|
|
5153
|
-
template:
|
|
5185
|
+
template: ""
|
|
5154
5186
|
}]
|
|
5155
5187
|
}], ctorParameters: function () { return []; }, propDecorators: { activityActions: [{
|
|
5156
5188
|
type: ViewChild,
|
|
5157
5189
|
args: [ActivityActionsComponent]
|
|
5158
5190
|
}], confirmCommand: [], cancelCommand: [], class: [{
|
|
5159
5191
|
type: HostBinding,
|
|
5160
|
-
args: [
|
|
5192
|
+
args: ["class"]
|
|
5161
5193
|
}], isFocused: [{
|
|
5162
5194
|
type: HostBinding,
|
|
5163
|
-
args: [
|
|
5195
|
+
args: ["attr.focused"]
|
|
5164
5196
|
}] } });
|
|
5165
5197
|
|
|
5166
5198
|
var Alert;
|
|
@@ -5194,6 +5226,11 @@ class AbstractDialogComponent extends Activity {
|
|
|
5194
5226
|
color: () => this.color || 'primary',
|
|
5195
5227
|
style: () => 'raised'
|
|
5196
5228
|
};
|
|
5229
|
+
this.onActivityReady(() => {
|
|
5230
|
+
if (this.activityActions) {
|
|
5231
|
+
this.isDestructive() ? this.activityActions.focusCancel() : this.activityActions.focusConfirm();
|
|
5232
|
+
}
|
|
5233
|
+
});
|
|
5197
5234
|
}
|
|
5198
5235
|
getConfig() {
|
|
5199
5236
|
return lang$1.abstractMethod(this.constructor);
|
|
@@ -5479,7 +5516,7 @@ class ActivityRef {
|
|
|
5479
5516
|
},
|
|
5480
5517
|
focused: this.focusedModel.readonly
|
|
5481
5518
|
});
|
|
5482
|
-
this._activityBusy.setDelegate(this._activity.busy);
|
|
5519
|
+
this._activityBusy.setDelegate(this._activity.busy$);
|
|
5483
5520
|
}
|
|
5484
5521
|
finishActivity(resolveOrReject) {
|
|
5485
5522
|
assert.isFalsey(this.isComplete());
|
|
@@ -5531,7 +5568,10 @@ class ActivityOutletComponent {
|
|
|
5531
5568
|
loadActivity(activityRef) {
|
|
5532
5569
|
const injector = Injector.create({
|
|
5533
5570
|
providers: [
|
|
5534
|
-
{
|
|
5571
|
+
{
|
|
5572
|
+
provide: ACTIVITY_DATA,
|
|
5573
|
+
useValue: activityRef.activityData
|
|
5574
|
+
}
|
|
5535
5575
|
],
|
|
5536
5576
|
parent: this.injector
|
|
5537
5577
|
});
|
|
@@ -8090,14 +8130,12 @@ class InputActivity extends Activity {
|
|
|
8090
8130
|
this.cancel();
|
|
8091
8131
|
});
|
|
8092
8132
|
this.busyWhile(this.confirmCommand.busy);
|
|
8133
|
+
this.onActivityReady(() => this.valueModel.focusContext.requestFocus());
|
|
8093
8134
|
}
|
|
8094
8135
|
get layout() {
|
|
8095
8136
|
var _a, _b;
|
|
8096
8137
|
return (_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.layout) !== null && _b !== void 0 ? _b : InputActivity.Layout.BLOCK;
|
|
8097
8138
|
}
|
|
8098
|
-
onActivityReady() {
|
|
8099
|
-
this.valueModel.focusContext.requestFocus();
|
|
8100
|
-
}
|
|
8101
8139
|
get additionalCssClassName() {
|
|
8102
8140
|
var _a;
|
|
8103
8141
|
return (_a = this.data.cssClassName) !== null && _a !== void 0 ? _a : '';
|