@coolon/angular-ui-powerups 16.1.0-aplpha.125 → 16.1.0-aplpha.127
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/assets/draw.scss +20 -0
- package/assets/layout.scss +3 -0
- package/assets/styles.scss +2 -0
- package/assets/tabs.scss +14 -0
- package/esm2022/lib/components/forms/string-input/string-input.component.mjs +6 -2
- package/esm2022/lib/components/forms/text-input/text-input.component.mjs +6 -2
- package/esm2022/lib/place/guards/place.guard.mjs +5 -5
- package/esm2022/lib/place/place-auth-service.mjs +5 -5
- package/esm2022/lib/place/place-router.mjs +3 -3
- package/fesm2022/coolon-angular-ui-powerups.mjs +18 -10
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/components/forms/string-input/string-input.component.d.ts +3 -0
- package/lib/components/forms/text-input/text-input.component.d.ts +3 -0
- package/lib/place/place-auth-service.d.ts +4 -4
- package/lib/place/place-router.d.ts +2 -2
- package/package.json +2 -2
|
@@ -2527,6 +2527,7 @@ class StringInputComponent extends AbstractValueInputComponent {
|
|
|
2527
2527
|
get suffixCommand() { return this.#suffixCommand_accessor_storage; }
|
|
2528
2528
|
set suffixCommand(value) { this.#suffixCommand_accessor_storage = value; }
|
|
2529
2529
|
clearCommand;
|
|
2530
|
+
elementRef = this.inject(ElementRef);
|
|
2530
2531
|
constructor() {
|
|
2531
2532
|
super();
|
|
2532
2533
|
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
@@ -2539,6 +2540,9 @@ class StringInputComponent extends AbstractValueInputComponent {
|
|
|
2539
2540
|
get hasSuffixCommand() {
|
|
2540
2541
|
return Proxify.hasTarget(this.suffixCommand);
|
|
2541
2542
|
}
|
|
2543
|
+
select() {
|
|
2544
|
+
this.elementRef.nativeElement.querySelector('input').select();
|
|
2545
|
+
}
|
|
2542
2546
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: StringInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2543
2547
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.9", type: StringInputComponent, selector: "aup-string-input", inputs: { autocomplete: "autocomplete", enableClear$: "enableClear$", enableClear: "enableClear", iconPrefix: "iconPrefix", suffixCommand: "suffixCommand" }, usesInheritance: true, ngImport: i0, template: "<mat-form-field [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input matInput\n placeholder=\"{{placeholder}}\"\n [attr.autocomplete]=\"autocomplete\"\n [(ngModel)]=\"componentValue$.value\"\n [disabled]=\"!enabled$.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n <aup-icon *ngIf=\"iconPrefix\" matPrefix [icon]=\"iconPrefix\"></aup-icon>\n <span matSuffix>\n <aup-command *ngIf=\"enableClear\" [command]=\"clearCommand\" data-cy=\"clearCommand\"></aup-command>\n <aup-command *ngIf=\"hasSuffixCommand\" [command]=\"suffixCommand\" data-cy=\"suffixCommand\"></aup-command>\n </span>\n</mat-form-field>\n\n", styles: [""], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i4$2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4$2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i4$2.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i4$2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: FocusBindingDirective, selector: "[pectinFocusBinding]", inputs: ["pectinFocusBinding", "focusBindingTarget"] }, { kind: "component", type: IconComponent, selector: "aup-icon", inputs: ["icon"] }, { kind: "component", type: CommandComponent, selector: "aup-command", inputs: ["command", "face$", "face", "busyFace$", "busyFace", "alignFace"] }] });
|
|
2544
2548
|
}
|
|
@@ -2574,10 +2578,14 @@ class TextInputComponent extends AbstractValueInputComponent {
|
|
|
2574
2578
|
// valueModel: Form.ValueModelBase<string> | MutableValueModel<string>;
|
|
2575
2579
|
rows = 2;
|
|
2576
2580
|
cols;
|
|
2581
|
+
elementRef = this.inject(ElementRef);
|
|
2577
2582
|
constructor() {
|
|
2578
2583
|
super();
|
|
2579
2584
|
// const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
2580
2585
|
}
|
|
2586
|
+
select() {
|
|
2587
|
+
this.elementRef.nativeElement.querySelector('input').select();
|
|
2588
|
+
}
|
|
2581
2589
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: TextInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2582
2590
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.9", type: TextInputComponent, selector: "aup-text-input", inputs: { rows: "rows", cols: "cols" }, usesInheritance: true, ngImport: i0, template: "<mat-form-field [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <textarea matInput\n placeholder=\"{{placeholder}}\"\n [(ngModel)]=\"componentValue$.value\"\n [disabled]=\"!enabled$.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n [rows]=\"rows\"\n [cols]=\"cols\"\n >\n </textarea>\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n\n", styles: ["button[disabled]{visibility:hidden}textarea{overflow:auto}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i4$2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4$2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i4$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i4$2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: FocusBindingDirective, selector: "[pectinFocusBinding]", inputs: ["pectinFocusBinding", "focusBindingTarget"] }] });
|
|
2583
2591
|
}
|
|
@@ -8652,12 +8660,12 @@ class PlaceAuthService extends GarbageCollector {
|
|
|
8652
8660
|
await toPromise(this, this._authZReady$);
|
|
8653
8661
|
await this.enabledPlaceChecker.waitUntilReady(placeDef);
|
|
8654
8662
|
}
|
|
8655
|
-
getAuthenticationFailureRedirect(activatedRoute, state) {
|
|
8656
|
-
const redirect = this.authNOptions.redirectTo(activatedRoute, state);
|
|
8663
|
+
async getAuthenticationFailureRedirect(activatedRoute, state) {
|
|
8664
|
+
const redirect = await this.authNOptions.redirectTo(activatedRoute, state);
|
|
8657
8665
|
return redirect instanceof Visit ? redirect : Visit.goto(redirect);
|
|
8658
8666
|
}
|
|
8659
|
-
getAuthorisationFailureRedirectOptions(component) {
|
|
8660
|
-
return this.authZOptions.redirectTo(component).map(it => it instanceof Visit ? it : Visit.goto(it));
|
|
8667
|
+
async getAuthorisationFailureRedirectOptions(component) {
|
|
8668
|
+
return (await this.authZOptions.redirectTo(component)).map(it => it instanceof Visit ? it : Visit.goto(it));
|
|
8661
8669
|
}
|
|
8662
8670
|
isAuthenticated() {
|
|
8663
8671
|
return this.accessGuard$.value.isAuthenticated();
|
|
@@ -9148,10 +9156,10 @@ class PlaceRouter extends GarbageCollector {
|
|
|
9148
9156
|
postponeRoutingUntil(condition$) {
|
|
9149
9157
|
this._ready$.setDelegate(condition$);
|
|
9150
9158
|
}
|
|
9151
|
-
getAuthenticationFailureRedirect(activatedRoute, state) {
|
|
9159
|
+
async getAuthenticationFailureRedirect(activatedRoute, state) {
|
|
9152
9160
|
return this.authService.getAuthenticationFailureRedirect(activatedRoute, state);
|
|
9153
9161
|
}
|
|
9154
|
-
getAuthorisationFailureRedirectOptions(component) {
|
|
9162
|
+
async getAuthorisationFailureRedirectOptions(component) {
|
|
9155
9163
|
return this.authService.getAuthorisationFailureRedirectOptions(component);
|
|
9156
9164
|
}
|
|
9157
9165
|
get navigationSession() {
|
|
@@ -12268,7 +12276,7 @@ class PlaceGuard {
|
|
|
12268
12276
|
await this.placeRouter.authService.waitUntilAuthenticationReady();
|
|
12269
12277
|
const authenticated = this.authService.isAuthenticated();
|
|
12270
12278
|
if (!authenticated) {
|
|
12271
|
-
const redirect = this.authService.getAuthenticationFailureRedirect(activatedRoute, state);
|
|
12279
|
+
const redirect = await this.authService.getAuthenticationFailureRedirect(activatedRoute, state);
|
|
12272
12280
|
// const nextPlaceDef = this.getPlaceDefinition(redirect);
|
|
12273
12281
|
if (redirect.requiresAuthentication()) {
|
|
12274
12282
|
lang.illegalState(`onAuthenticationFailure hook returned place ${redirect.toDebugString()} that requires authentication.`);
|
|
@@ -12277,7 +12285,7 @@ class PlaceGuard {
|
|
|
12277
12285
|
}
|
|
12278
12286
|
await this.authService.waitUntilAuthorisationReadyFor(placeDefinition);
|
|
12279
12287
|
if (!this.authService.isAuthorised(placeDefinition)) {
|
|
12280
|
-
const nextRedirect = this.findBestAuthenticatedAlternative(placeDefinition, activatedRoute);
|
|
12288
|
+
const nextRedirect = await this.findBestAuthenticatedAlternative(placeDefinition, activatedRoute);
|
|
12281
12289
|
return this.createUrlTree(nextRedirect);
|
|
12282
12290
|
}
|
|
12283
12291
|
}
|
|
@@ -12321,7 +12329,7 @@ class PlaceGuard {
|
|
|
12321
12329
|
return lang.illegalState(`expected component to be an instance of PlaceComponent, got ${activatedRoute.component}`);
|
|
12322
12330
|
}
|
|
12323
12331
|
}
|
|
12324
|
-
findBestAuthenticatedAlternative(placeDefinition, activatedRoute) {
|
|
12332
|
+
async findBestAuthenticatedAlternative(placeDefinition, activatedRoute) {
|
|
12325
12333
|
let currentPlace = placeDefinition;
|
|
12326
12334
|
while (!currentPlace.isRoot()) {
|
|
12327
12335
|
currentPlace = currentPlace.parent;
|
|
@@ -12331,7 +12339,7 @@ class PlaceGuard {
|
|
|
12331
12339
|
}
|
|
12332
12340
|
}
|
|
12333
12341
|
// Couldn't find an authorised ancestor so we check if there are router level defined alternatives
|
|
12334
|
-
const alternativeRoutes = this.placeRouter.getAuthorisationFailureRedirectOptions(activatedRoute.component);
|
|
12342
|
+
const alternativeRoutes = await this.placeRouter.getAuthorisationFailureRedirectOptions(activatedRoute.component);
|
|
12335
12343
|
if (alternativeRoutes.length < 1) {
|
|
12336
12344
|
return lang.illegalState(`onAuthorisationFailure hook didn't return any alternate places`);
|
|
12337
12345
|
}
|