@aws-amplify/ui-angular 2.0.1-next.5 → 2.0.1-next.6
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/aws-amplify-ui-angular.metadata.json +1 -1
- package/bundles/aws-amplify-ui-angular.umd.js +11 -14
- package/bundles/aws-amplify-ui-angular.umd.js.map +1 -1
- package/bundles/aws-amplify-ui-angular.umd.min.js +1 -1
- package/bundles/aws-amplify-ui-angular.umd.min.js.map +1 -1
- package/esm2015/lib/components/amplify-authenticator/amplify-authenticator.component.js +4 -8
- package/esm2015/lib/primitives/phone-number-field/phone-number-field.component.js +2 -2
- package/esm2015/lib/primitives/tabs/tabs.component.js +3 -2
- package/esm2015/lib/services/state-machine.service.js +6 -7
- package/fesm2015/aws-amplify-ui-angular.js +11 -15
- package/fesm2015/aws-amplify-ui-angular.js.map +1 -1
- package/lib/components/amplify-authenticator/amplify-authenticator.component.d.ts +3 -4
- package/lib/services/state-machine.service.d.ts +2 -2
- package/package.json +2 -2
- package/styles/component.css +0 -5
|
@@ -8,11 +8,6 @@ export class AmplifyAuthenticatorComponent {
|
|
|
8
8
|
constructor(stateMachine, contextService) {
|
|
9
9
|
this.stateMachine = stateMachine;
|
|
10
10
|
this.contextService = contextService;
|
|
11
|
-
/**
|
|
12
|
-
* TODO: Add back custom events
|
|
13
|
-
*/
|
|
14
|
-
this.initialState = 'signIn';
|
|
15
|
-
this.loginMechanisms = ['username'];
|
|
16
11
|
this.customComponentQuery = null;
|
|
17
12
|
this.customComponents = {};
|
|
18
13
|
// translated texts
|
|
@@ -21,7 +16,8 @@ export class AmplifyAuthenticatorComponent {
|
|
|
21
16
|
}
|
|
22
17
|
ngOnInit() {
|
|
23
18
|
I18n.putVocabularies(translations);
|
|
24
|
-
this
|
|
19
|
+
const { initialState, loginMechanisms } = this;
|
|
20
|
+
this.stateMachine.startMachine({ initialState, loginMechanisms });
|
|
25
21
|
/**
|
|
26
22
|
* handling translations after content init, because authenticator and its
|
|
27
23
|
* translations might be initialized before the main app's `ngOnInit` is run.
|
|
@@ -72,7 +68,7 @@ export class AmplifyAuthenticatorComponent {
|
|
|
72
68
|
AmplifyAuthenticatorComponent.decorators = [
|
|
73
69
|
{ type: Component, args: [{
|
|
74
70
|
selector: 'amplify-authenticator',
|
|
75
|
-
template: "<!-- \n Define default contents here.\n-->\n<ng-template #signIn>\n <amplify-sign-in></amplify-sign-in>\n</ng-template>\n<ng-template #signUp>\n <amplify-sign-up></amplify-sign-up>\n</ng-template>\n<ng-template #confirmSignUp>\n <amplify-confirm-sign-up></amplify-confirm-sign-up>\n</ng-template>\n<ng-template #confirmSignIn>\n <amplify-confirm-sign-in></amplify-confirm-sign-in>\n</ng-template>\n<ng-template #authenticated> <ng-content></ng-content> </ng-template>\n<ng-template #setupTOTP>\n <amplify-setup-totp></amplify-setup-totp>\n</ng-template>\n<ng-template #forceNewPassword>\n <amplify-force-new-password></amplify-force-new-password>\n</ng-template>\n<ng-template #resetPassword>\n <amplify-reset-password></amplify-reset-password>\n</ng-template>\n<ng-template #confirmResetPassword>\n <amplify-confirm-reset-password></amplify-confirm-reset-password>\n</ng-template>\n<ng-template #verifyUser>\n <amplify-verify-user></amplify-verify-user>\n</ng-template>\n<ng-template #confirmVerifyUser>\n <amplify-confirm-verify-user></amplify-confirm-verify-user>\n</ng-template>\n\n<!-- \n Next, we render respective auth subcomponent respective to the current authState.\n If customer is overriding that component, we render customer's template instead.\n-->\n\n<div data-amplify-
|
|
71
|
+
template: "<!-- \n Define default contents here.\n-->\n<ng-template #signIn>\n <amplify-sign-in></amplify-sign-in>\n</ng-template>\n<ng-template #signUp>\n <amplify-sign-up></amplify-sign-up>\n</ng-template>\n<ng-template #confirmSignUp>\n <amplify-confirm-sign-up></amplify-confirm-sign-up>\n</ng-template>\n<ng-template #confirmSignIn>\n <amplify-confirm-sign-in></amplify-confirm-sign-in>\n</ng-template>\n<ng-template #authenticated> <ng-content></ng-content> </ng-template>\n<ng-template #setupTOTP>\n <amplify-setup-totp></amplify-setup-totp>\n</ng-template>\n<ng-template #forceNewPassword>\n <amplify-force-new-password></amplify-force-new-password>\n</ng-template>\n<ng-template #resetPassword>\n <amplify-reset-password></amplify-reset-password>\n</ng-template>\n<ng-template #confirmResetPassword>\n <amplify-confirm-reset-password></amplify-confirm-reset-password>\n</ng-template>\n<ng-template #verifyUser>\n <amplify-verify-user></amplify-verify-user>\n</ng-template>\n<ng-template #confirmVerifyUser>\n <amplify-confirm-verify-user></amplify-confirm-verify-user>\n</ng-template>\n\n<!-- \n Next, we render respective auth subcomponent respective to the current authState.\n If customer is overriding that component, we render customer's template instead.\n-->\n\n<div data-amplify-authenticator>\n <div data-amplify-modal></div>\n\n <div data-amplify-container>\n <amplify-tabs\n (tabChange)=\"onTabChange()\"\n *ngIf=\"actorState?.matches('signIn') || actorState?.matches('signUp')\"\n >\n <amplify-tab-item\n [title]=\"signInTitle\"\n [active]=\"actorState?.matches('signIn')\"\n >\n <!-- signIn component -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signIn || signIn\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('signIn')\"\n ></ng-container>\n </amplify-tab-item>\n <amplify-tab-item\n [title]=\"signUpTitle\"\n [active]=\"actorState?.matches('signUp')\"\n >\n <!-- signUp component -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signUp || signUp\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('signUp')\"\n ></ng-container>\n </amplify-tab-item>\n </amplify-tabs>\n\n <!-- confirmSignUp content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.confirmSignUp || confirmSignUp\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('confirmSignUp')\"\n >\n </ng-container>\n\n <!-- confirmSignIn content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.confirmSignIn || confirmSignIn\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('confirmSignIn')\"\n >\n </ng-container>\n\n <!-- setupTotp content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.setupTOTP || setupTOTP\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('setupTOTP')\"\n >\n </ng-container>\n\n <!-- forceNewPassword content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.forceNewPassword || forceNewPassword\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('forceNewPassword')\"\n >\n </ng-container>\n\n <!-- resetPassword content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.resetPassword || resetPassword\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('resetPassword')\"\n >\n </ng-container>\n\n <!-- confirmResetPassword content -->\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmResetPassword || confirmResetPassword\n \"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('confirmResetPassword')\"\n >\n </ng-container>\n\n <!-- verifyUser content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.verifyUser || verifyUser\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('verifyUser')\"\n >\n </ng-container>\n\n <!-- confirmVerifyUser content -->\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmVerifyUser || confirmVerifyUser\n \"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('confirmVerifyUser')\"\n >\n </ng-container>\n </div>\n</div>\n\n<!-- signedIn content is rendered outside authenticator so it's not styled by authenticator -->\n<ng-container\n [ngTemplateOutlet]=\"customComponents.authenticated || authenticated\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"authenticatorState.matches('authenticated')\"\n>\n</ng-container>\n",
|
|
76
72
|
providers: [AuthPropService],
|
|
77
73
|
encapsulation: ViewEncapsulation.None
|
|
78
74
|
},] }
|
|
@@ -86,4 +82,4 @@ AmplifyAuthenticatorComponent.propDecorators = {
|
|
|
86
82
|
loginMechanisms: [{ type: Input }],
|
|
87
83
|
customComponentQuery: [{ type: ContentChildren, args: [AmplifySlotDirective,] }]
|
|
88
84
|
};
|
|
89
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
85
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW1wbGlmeS1hdXRoZW50aWNhdG9yLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3VpLWFuZ3VsYXIvc3JjL2xpYi9jb21wb25lbnRzL2FtcGxpZnktYXV0aGVudGljYXRvci9hbXBsaWZ5LWF1dGhlbnRpY2F0b3IuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFFTCxTQUFTLEVBQ1QsZUFBZSxFQUNmLEtBQUssRUFJTCxpQkFBaUIsR0FDbEIsTUFBTSxlQUFlLENBQUM7QUFDdkIsT0FBTyxFQUVMLGFBQWEsRUFDYixTQUFTLEVBQ1QsWUFBWSxHQUNiLE1BQU0saUJBQWlCLENBQUM7QUFDekIsT0FBTyxFQUFFLElBQUksRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUVuQyxPQUFPLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSx5Q0FBeUMsQ0FBQztBQUMvRSxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sOENBQThDLENBQUM7QUFDL0UsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sc0NBQXNDLENBQUM7QUFRM0UsTUFBTSxPQUFPLDZCQUE2QjtJQWdCeEMsWUFDVSxZQUFpQyxFQUNqQyxjQUErQjtRQUQvQixpQkFBWSxHQUFaLFlBQVksQ0FBcUI7UUFDakMsbUJBQWMsR0FBZCxjQUFjLENBQWlCO1FBVGpDLHlCQUFvQixHQUFvQyxJQUFJLENBQUM7UUFDOUQsc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t9O1xuICAgIGNvbXBvbmVudFF1ZXJ5LmZvckVhY2goKGNvbXBvbmVudCkgPT4ge1xuICAgICAgY3VzdG9tQ29tcG9uZW50c1tjb21wb25lbnQubmFtZV0gPSBjb21wb25lbnQudGVtcGxhdGU7XG4gICAgfSk7XG5cbiAgICByZXR1cm4gY3VzdG9tQ29tcG9uZW50cztcbiAgfVxufVxuIl19
|
|
@@ -14,7 +14,7 @@ export class PhoneNumberFieldComponent {
|
|
|
14
14
|
PhoneNumberFieldComponent.decorators = [
|
|
15
15
|
{ type: Component, args: [{
|
|
16
16
|
selector: 'amplify-phone-number-field',
|
|
17
|
-
template: "<div
|
|
17
|
+
template: "<div\n class=\"amplify-flex amplify-phonenumberfield\"\n amplify-field-group\n style=\"gap: 0px\"\n>\n <div class=\"amplify-field-group__outer-start\">\n <div\n class=\" amplify-flex amplify-field amplify-selectfield amplify-countrycodeselect\"\n style=\"flex-direction: column\"\n >\n <amplify-form-select\n name=\"country_code\"\n label=\"Country Code\"\n [id]=\"selectFieldId\"\n [items]=\"countryDialCodes\"\n [defaultValue]=\"defaultCountryCode\"\n ></amplify-form-select>\n </div>\n </div>\n\n <label class=\"sr-only amplify-label\" [for]=\"textFieldId\">\n {{ label }}\n </label>\n <input\n class=\"amplify-input\"\n [id]=\"textFieldId\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [attr.disabled]=\"disabled ? '' : null\"\n [autocomplete]=\"autocomplete\"\n />\n</div>\n"
|
|
18
18
|
},] }
|
|
19
19
|
];
|
|
20
20
|
PhoneNumberFieldComponent.propDecorators = {
|
|
@@ -30,4 +30,4 @@ PhoneNumberFieldComponent.propDecorators = {
|
|
|
30
30
|
required: [{ type: Input }],
|
|
31
31
|
type: [{ type: Input }]
|
|
32
32
|
};
|
|
33
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
33
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uI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IGNvdW50cnlEaWFsQ29kZXMgfSBmcm9tICdAYXdzLWFtcGxpZnkvdWknO1xuXG5AQ29tcG9uZW50KHtcbiAgc2VsZWN0b3I6ICdhbXBsaWZ5LXBob25lLW51bWJlci1maWVsZCcsXG4gIHRlbXBsYXRlVXJsOiAnLi9waG9uZS1udW1iZXItZmllbGQuY29tcG9uZW50Lmh0bWwnLFxufSlcbmV4cG9ydCBjbGFzcyBQaG9uZU51bWJlckZpZWxkQ29tcG9uZW50IHtcbiAgQElucHV0KCkgYXV0b2NvbXBsZXRlID0gJ25ldy1wYXNzd29yZCc7XG4gIEBJbnB1dCgpIGRpc2FibGVkID0gZmFsc2U7XG4gIEBJbnB1dCgpIGRlZmF1bHRDb3VudHJ5Q29kZTogc3RyaW5nO1xuICBASW5wdXQoKSBzZWxlY3RGaWVsZElkOiBzdHJpbmc7XG4gIEBJbnB1dCgpIHRleHRGaWVsZElkOiBzdHJpbmc7XG4gIEBJbnB1dCgpIGluaXRpYWxWYWx1ZSA9ICcnO1xuICBASW5wdXQoKSBsYWJlbCA9ICcnO1xuICBASW5wdXQoKSBuYW1lOiBzdHJpbmc7XG4gIEBJbnB1dCgpIHBsYWNlaG9sZGVyID0gJyc7XG4gIEBJbnB1dCgpIHJlcXVpcmVkID0gdHJ1ZTtcbiAgQElucHV0KCkgdHlwZTogc3RyaW5nO1xuICBwdWJsaWMgY291bnRyeURpYWxDb2RlcyA9IGNvdW50cnlEaWFsQ29kZXM7XG59XG4iXX0=
|
|
@@ -12,6 +12,7 @@ export class TabsComponent {
|
|
|
12
12
|
tab.labelledById = `radix-id-${nanoid(12)}-1-trigger-${index}`;
|
|
13
13
|
});
|
|
14
14
|
// find active tab
|
|
15
|
+
// TODO(enhancement): more declarative way for choosing the initial tab to render
|
|
15
16
|
const activeTabs = this.tabs.filter((tab) => tab.active);
|
|
16
17
|
// set active tab
|
|
17
18
|
if (activeTabs.length !== 1) {
|
|
@@ -34,11 +35,11 @@ export class TabsComponent {
|
|
|
34
35
|
TabsComponent.decorators = [
|
|
35
36
|
{ type: Component, args: [{
|
|
36
37
|
selector: 'amplify-tabs',
|
|
37
|
-
template: "<div\n tabindex=\"0\"\n aria-orientation=\"horizontal\"\n data-orientation=\"horizontal\"\n role=\"tablist\"\n style=\"outline: none\"\n>\n <div\n class=\"amplify-flex amplify-tabs\"\n style=\"gap: 0px; justify-content: center\"\n >\n <div\n *ngFor=\"let tab of tabs\"\n class=\"amplify-tabs-item\"\n data-grow=\"equal\"\n data-orientation=\"horizontal\"\n role=\"tab\"\n [id]=\"tab.labelledById\"\n [tabindex]=\"tab.active ? '0' : '1'\"\n [attr.aria-selected]=\"tab.active\"\n [attr.aria-controls]=\"tab.id\"\n [attr.data-state]=\"tab.active ? 'active' : 'inactive'\"\n (click)=\"handleTabClick(tab)\"\n >\n {{ tab.title }}\n </div>\n </div>\n</div>\n\n<ng-content></ng-content>\n"
|
|
38
|
+
template: "<div\n tabindex=\"0\"\n aria-orientation=\"horizontal\"\n data-orientation=\"horizontal\"\n role=\"tablist\"\n style=\"outline: none\"\n>\n <div\n class=\"amplify-flex amplify-tabs\"\n data-indicator-position=\"top\"\n style=\"gap: 0px; justify-content: center\"\n >\n <div\n *ngFor=\"let tab of tabs\"\n class=\"amplify-tabs-item\"\n data-grow=\"equal\"\n data-orientation=\"horizontal\"\n role=\"tab\"\n [id]=\"tab.labelledById\"\n [tabindex]=\"tab.active ? '0' : '1'\"\n [attr.aria-selected]=\"tab.active\"\n [attr.aria-controls]=\"tab.id\"\n [attr.data-state]=\"tab.active ? 'active' : 'inactive'\"\n (click)=\"handleTabClick(tab)\"\n >\n {{ tab.title }}\n </div>\n </div>\n</div>\n\n<ng-content></ng-content>\n"
|
|
38
39
|
},] }
|
|
39
40
|
];
|
|
40
41
|
TabsComponent.propDecorators = {
|
|
41
42
|
tabs: [{ type: ContentChildren, args: [TabItemComponent,] }],
|
|
42
43
|
tabChange: [{ type: Output }]
|
|
43
44
|
};
|
|
44
|
-
//# sourceMapp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MSkge1xuICAgICAgdGhpcy5zZWxlY3RUYWIodGhpcy50YWJzLmZpcnN0KTtcbiAgICB9XG4gIH1cblxuICBzZWxlY3RUYWIodGFiOiBUYWJJdGVtQ29tcG9uZW50KSB7XG4gICAgdGhpcy50YWJzLmZvckVhY2goKHRhYikgPT4ge1xuICAgICAgdGFiLmFjdGl2ZSA9IGZhbHNlO1xuICAgIH0pO1xuICAgIHRhYi5hY3RpdmUgPSB0cnVlO1xuICB9XG5cbiAgaGFuZGxlVGFiQ2xpY2sodGFiOiBUYWJJdGVtQ29tcG9uZW50KSB7XG4gICAgaWYgKHRhYi5hY3RpdmUpIHJldHVybjsgLy8gZG9uJ3QgZG8gYW55dGhpbmcgaWYgY2xpY2tzIHRoZSBjdXJyZW50IGFjdGl2ZSB0YWJcbiAgICB0aGlzLnRhYkNoYW5nZS5lbWl0KCk7XG4gICAgdGhpcy5zZWxlY3RUYWIodGFiKTtcbiAgfVxufVxuIl19
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { createAuthenticatorMachine, getSendEventAliases, } from '@aws-amplify/ui';
|
|
3
3
|
import { interpret } from 'xstate';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
/**
|
|
@@ -7,11 +7,10 @@ import * as i0 from "@angular/core";
|
|
|
7
7
|
* and custom components passed by the user.
|
|
8
8
|
*/
|
|
9
9
|
export class StateMachineService {
|
|
10
|
-
startMachine(loginMechanisms) {
|
|
11
|
-
const machine =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
10
|
+
startMachine({ initialState, loginMechanisms, }) {
|
|
11
|
+
const machine = createAuthenticatorMachine({
|
|
12
|
+
initialState,
|
|
13
|
+
loginMechanisms,
|
|
15
14
|
});
|
|
16
15
|
const authService = interpret(machine, {
|
|
17
16
|
devTools: process.env.NODE_ENV === 'development',
|
|
@@ -49,4 +48,4 @@ StateMachineService.decorators = [
|
|
|
49
48
|
providedIn: 'root',
|
|
50
49
|
},] }
|
|
51
50
|
];
|
|
52
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
51
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhdGUtbWFjaGluZS5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdWktYW5ndWxhci9zcmMvbGliL3NlcnZpY2VzL3N0YXRlLW1hY2hpbmUuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzNDLE9BQU8sRUFNTCwwQkFBMEIsRUFDMUIsbUJBQW1CLEdBQ3BCLE1BQU0saUJBQWlCLENBQUM7QUFDekIsT0FBTyxFQUFTLFNBQVMsRUFBRSxNQUFNLFFBQVEsQ0FBQzs7QUFFMUM7OztHQUdHO0FBSUgsTUFBTSxPQUFPLG1CQUFtQjtJQU12QixZQUFZLENBQUMsRUFDbEIsWUFBWSxFQUNaLGVBQWUsR0FDYTtRQUM1QixNQUFNLE9BQU8sR0FBRywwQkFBMEIsQ0FBQztZQUN6QyxZQUFZO1lBQ1osZUFBZTtTQUNoQixDQUFDLENBQUM7UUFFSCxNQUFNLFdBQVcsR0FBRyxTQUFTLENBQUMsT0FBTyxFQUFFO1lBQ3JDLFFBQVEsRUFBRSxPQUFPLENBQUMsR0FBRyxDQUFDLFFBQVEsS0FBSyxhQUFhO1NBQ2pELENBQUM7YUFDQyxZQUFZLENBQUMsQ0FBQyxLQUFLLEVBQUUsRUFBRTtZQUN0QixJQUFJLENBQUMsS0FBSyxHQUFHLEtBQUssQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDO1lBQ2hDLElBQUksQ0FBQyxVQUFVLEdBQUcsS0FBSyxDQUFDO1FBQzFCLENBQUMsQ0FBQ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AgIH0pXG4gICAgICAub25UcmFuc2l0aW9uKChzdGF0ZSkgPT4ge1xuICAgICAgICB0aGlzLl91c2VyID0gc3RhdGUuY29udGV4dC51c2VyO1xuICAgICAgICB0aGlzLl9hdXRoU3RhdGUgPSBzdGF0ZTtcbiAgICAgIH0pXG4gICAgICAuc3RhcnQoKTtcblxuICAgIHRoaXMuX3NlcnZpY2VzID0gZ2V0U2VuZEV2ZW50QWxpYXNlcyhhdXRoU2VydmljZS5zZW5kKTtcbiAgICB0aGlzLl9hdXRoU2VydmljZSA9IGF1dGhTZXJ2aWNlO1xuICB9XG5cbiAgcHVibGljIGdldCBzZXJ2aWNlcygpIHtcbiAgICByZXR1cm4gdGhpcy5fc2VydmljZXM7XG4gIH1cblxuICBwdWJsaWMgZ2V0IGF1dGhTdGF0ZSgpOiBBdXRoTWFjaGluZVN0YXRlIHtcbiAgICByZXR1cm4gdGhpcy5fYXV0aFN0YXRlO1xuICB9XG5cbiAgcHVibGljIGdldCBhdXRoU2VydmljZSgpOiBBdXRoSW50ZXJwcmV0ZXIge1xuICAgIHJldHVybiB0aGlzLl9hdXRoU2VydmljZTtcbiAgfVxuXG4gIHB1YmxpYyBnZXQgdXNlcigpOiBSZWNvcmQ8c3RyaW5nLCBhbnk+IHtcbiAgICByZXR1cm4gdGhpcy5fdXNlcjtcbiAgfVxuXG4gIHB1YmxpYyBnZXQgY29udGV4dCgpOiBBdXRoQ29udGV4dCB7XG4gICAgcmV0dXJuIHRoaXMuX2F1dGhTdGF0ZS5jb250ZXh0O1xuICB9XG5cbiAgcHVibGljIHNlbmQoZXZlbnQ6IEV2ZW50PEF1dGhFdmVudD4pIHtcbiAgICB0aGlzLmF1dGhTZXJ2aWNlLnNlbmQoZXZlbnQpO1xuICB9XG59XG4iXX0=
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Directive, TemplateRef, Input, Injectable, Component, ViewEncapsulation, ContentChildren, HostBinding, EventEmitter, Output, ChangeDetectionStrategy, ChangeDetectorRef, ElementRef, NgZone, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
|
-
import {
|
|
4
|
+
import { createAuthenticatorMachine, getSendEventAliases, translate, translations, getActorState, getActorContext, AuthChallengeNames, FederatedIdentityProviders, getConfiguredAliases, authInputAttributes, countryDialCodes, getAliasInfoFromContext } from '@aws-amplify/ui';
|
|
5
5
|
import { I18n, Logger, Auth } from 'aws-amplify';
|
|
6
6
|
import { interpret } from 'xstate';
|
|
7
7
|
import { __awaiter, __decorate } from 'tslib';
|
|
@@ -62,11 +62,10 @@ AuthPropService.ctorParameters = () => [];
|
|
|
62
62
|
* and custom components passed by the user.
|
|
63
63
|
*/
|
|
64
64
|
class StateMachineService {
|
|
65
|
-
startMachine(loginMechanisms) {
|
|
66
|
-
const machine =
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
},
|
|
65
|
+
startMachine({ initialState, loginMechanisms, }) {
|
|
66
|
+
const machine = createAuthenticatorMachine({
|
|
67
|
+
initialState,
|
|
68
|
+
loginMechanisms,
|
|
70
69
|
});
|
|
71
70
|
const authService = interpret(machine, {
|
|
72
71
|
devTools: process.env.NODE_ENV === 'development',
|
|
@@ -109,11 +108,6 @@ class AmplifyAuthenticatorComponent {
|
|
|
109
108
|
constructor(stateMachine, contextService) {
|
|
110
109
|
this.stateMachine = stateMachine;
|
|
111
110
|
this.contextService = contextService;
|
|
112
|
-
/**
|
|
113
|
-
* TODO: Add back custom events
|
|
114
|
-
*/
|
|
115
|
-
this.initialState = 'signIn';
|
|
116
|
-
this.loginMechanisms = ['username'];
|
|
117
111
|
this.customComponentQuery = null;
|
|
118
112
|
this.customComponents = {};
|
|
119
113
|
// translated texts
|
|
@@ -122,7 +116,8 @@ class AmplifyAuthenticatorComponent {
|
|
|
122
116
|
}
|
|
123
117
|
ngOnInit() {
|
|
124
118
|
I18n.putVocabularies(translations);
|
|
125
|
-
this
|
|
119
|
+
const { initialState, loginMechanisms } = this;
|
|
120
|
+
this.stateMachine.startMachine({ initialState, loginMechanisms });
|
|
126
121
|
/**
|
|
127
122
|
* handling translations after content init, because authenticator and its
|
|
128
123
|
* translations might be initialized before the main app's `ngOnInit` is run.
|
|
@@ -173,7 +168,7 @@ class AmplifyAuthenticatorComponent {
|
|
|
173
168
|
AmplifyAuthenticatorComponent.decorators = [
|
|
174
169
|
{ type: Component, args: [{
|
|
175
170
|
selector: 'amplify-authenticator',
|
|
176
|
-
template: "<!-- \n Define default contents here.\n-->\n<ng-template #signIn>\n <amplify-sign-in></amplify-sign-in>\n</ng-template>\n<ng-template #signUp>\n <amplify-sign-up></amplify-sign-up>\n</ng-template>\n<ng-template #confirmSignUp>\n <amplify-confirm-sign-up></amplify-confirm-sign-up>\n</ng-template>\n<ng-template #confirmSignIn>\n <amplify-confirm-sign-in></amplify-confirm-sign-in>\n</ng-template>\n<ng-template #authenticated> <ng-content></ng-content> </ng-template>\n<ng-template #setupTOTP>\n <amplify-setup-totp></amplify-setup-totp>\n</ng-template>\n<ng-template #forceNewPassword>\n <amplify-force-new-password></amplify-force-new-password>\n</ng-template>\n<ng-template #resetPassword>\n <amplify-reset-password></amplify-reset-password>\n</ng-template>\n<ng-template #confirmResetPassword>\n <amplify-confirm-reset-password></amplify-confirm-reset-password>\n</ng-template>\n<ng-template #verifyUser>\n <amplify-verify-user></amplify-verify-user>\n</ng-template>\n<ng-template #confirmVerifyUser>\n <amplify-confirm-verify-user></amplify-confirm-verify-user>\n</ng-template>\n\n<!-- \n Next, we render respective auth subcomponent respective to the current authState.\n If customer is overriding that component, we render customer's template instead.\n-->\n\n<div data-amplify-
|
|
171
|
+
template: "<!-- \n Define default contents here.\n-->\n<ng-template #signIn>\n <amplify-sign-in></amplify-sign-in>\n</ng-template>\n<ng-template #signUp>\n <amplify-sign-up></amplify-sign-up>\n</ng-template>\n<ng-template #confirmSignUp>\n <amplify-confirm-sign-up></amplify-confirm-sign-up>\n</ng-template>\n<ng-template #confirmSignIn>\n <amplify-confirm-sign-in></amplify-confirm-sign-in>\n</ng-template>\n<ng-template #authenticated> <ng-content></ng-content> </ng-template>\n<ng-template #setupTOTP>\n <amplify-setup-totp></amplify-setup-totp>\n</ng-template>\n<ng-template #forceNewPassword>\n <amplify-force-new-password></amplify-force-new-password>\n</ng-template>\n<ng-template #resetPassword>\n <amplify-reset-password></amplify-reset-password>\n</ng-template>\n<ng-template #confirmResetPassword>\n <amplify-confirm-reset-password></amplify-confirm-reset-password>\n</ng-template>\n<ng-template #verifyUser>\n <amplify-verify-user></amplify-verify-user>\n</ng-template>\n<ng-template #confirmVerifyUser>\n <amplify-confirm-verify-user></amplify-confirm-verify-user>\n</ng-template>\n\n<!-- \n Next, we render respective auth subcomponent respective to the current authState.\n If customer is overriding that component, we render customer's template instead.\n-->\n\n<div data-amplify-authenticator>\n <div data-amplify-modal></div>\n\n <div data-amplify-container>\n <amplify-tabs\n (tabChange)=\"onTabChange()\"\n *ngIf=\"actorState?.matches('signIn') || actorState?.matches('signUp')\"\n >\n <amplify-tab-item\n [title]=\"signInTitle\"\n [active]=\"actorState?.matches('signIn')\"\n >\n <!-- signIn component -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signIn || signIn\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('signIn')\"\n ></ng-container>\n </amplify-tab-item>\n <amplify-tab-item\n [title]=\"signUpTitle\"\n [active]=\"actorState?.matches('signUp')\"\n >\n <!-- signUp component -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signUp || signUp\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('signUp')\"\n ></ng-container>\n </amplify-tab-item>\n </amplify-tabs>\n\n <!-- confirmSignUp content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.confirmSignUp || confirmSignUp\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('confirmSignUp')\"\n >\n </ng-container>\n\n <!-- confirmSignIn content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.confirmSignIn || confirmSignIn\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('confirmSignIn')\"\n >\n </ng-container>\n\n <!-- setupTotp content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.setupTOTP || setupTOTP\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('setupTOTP')\"\n >\n </ng-container>\n\n <!-- forceNewPassword content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.forceNewPassword || forceNewPassword\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('forceNewPassword')\"\n >\n </ng-container>\n\n <!-- resetPassword content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.resetPassword || resetPassword\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('resetPassword')\"\n >\n </ng-container>\n\n <!-- confirmResetPassword content -->\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmResetPassword || confirmResetPassword\n \"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('confirmResetPassword')\"\n >\n </ng-container>\n\n <!-- verifyUser content -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.verifyUser || verifyUser\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('verifyUser')\"\n >\n </ng-container>\n\n <!-- confirmVerifyUser content -->\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmVerifyUser || confirmVerifyUser\n \"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('confirmVerifyUser')\"\n >\n </ng-container>\n </div>\n</div>\n\n<!-- signedIn content is rendered outside authenticator so it's not styled by authenticator -->\n<ng-container\n [ngTemplateOutlet]=\"customComponents.authenticated || authenticated\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"authenticatorState.matches('authenticated')\"\n>\n</ng-container>\n",
|
|
177
172
|
providers: [AuthPropService],
|
|
178
173
|
encapsulation: ViewEncapsulation.None
|
|
179
174
|
},] }
|
|
@@ -1220,6 +1215,7 @@ class TabsComponent {
|
|
|
1220
1215
|
tab.labelledById = `radix-id-${nanoid(12)}-1-trigger-${index}`;
|
|
1221
1216
|
});
|
|
1222
1217
|
// find active tab
|
|
1218
|
+
// TODO(enhancement): more declarative way for choosing the initial tab to render
|
|
1223
1219
|
const activeTabs = this.tabs.filter((tab) => tab.active);
|
|
1224
1220
|
// set active tab
|
|
1225
1221
|
if (activeTabs.length !== 1) {
|
|
@@ -1242,7 +1238,7 @@ class TabsComponent {
|
|
|
1242
1238
|
TabsComponent.decorators = [
|
|
1243
1239
|
{ type: Component, args: [{
|
|
1244
1240
|
selector: 'amplify-tabs',
|
|
1245
|
-
template: "<div\n tabindex=\"0\"\n aria-orientation=\"horizontal\"\n data-orientation=\"horizontal\"\n role=\"tablist\"\n style=\"outline: none\"\n>\n <div\n class=\"amplify-flex amplify-tabs\"\n style=\"gap: 0px; justify-content: center\"\n >\n <div\n *ngFor=\"let tab of tabs\"\n class=\"amplify-tabs-item\"\n data-grow=\"equal\"\n data-orientation=\"horizontal\"\n role=\"tab\"\n [id]=\"tab.labelledById\"\n [tabindex]=\"tab.active ? '0' : '1'\"\n [attr.aria-selected]=\"tab.active\"\n [attr.aria-controls]=\"tab.id\"\n [attr.data-state]=\"tab.active ? 'active' : 'inactive'\"\n (click)=\"handleTabClick(tab)\"\n >\n {{ tab.title }}\n </div>\n </div>\n</div>\n\n<ng-content></ng-content>\n"
|
|
1241
|
+
template: "<div\n tabindex=\"0\"\n aria-orientation=\"horizontal\"\n data-orientation=\"horizontal\"\n role=\"tablist\"\n style=\"outline: none\"\n>\n <div\n class=\"amplify-flex amplify-tabs\"\n data-indicator-position=\"top\"\n style=\"gap: 0px; justify-content: center\"\n >\n <div\n *ngFor=\"let tab of tabs\"\n class=\"amplify-tabs-item\"\n data-grow=\"equal\"\n data-orientation=\"horizontal\"\n role=\"tab\"\n [id]=\"tab.labelledById\"\n [tabindex]=\"tab.active ? '0' : '1'\"\n [attr.aria-selected]=\"tab.active\"\n [attr.aria-controls]=\"tab.id\"\n [attr.data-state]=\"tab.active ? 'active' : 'inactive'\"\n (click)=\"handleTabClick(tab)\"\n >\n {{ tab.title }}\n </div>\n </div>\n</div>\n\n<ng-content></ng-content>\n"
|
|
1246
1242
|
},] }
|
|
1247
1243
|
];
|
|
1248
1244
|
TabsComponent.propDecorators = {
|
|
@@ -3109,7 +3105,7 @@ class PhoneNumberFieldComponent {
|
|
|
3109
3105
|
PhoneNumberFieldComponent.decorators = [
|
|
3110
3106
|
{ type: Component, args: [{
|
|
3111
3107
|
selector: 'amplify-phone-number-field',
|
|
3112
|
-
template: "<div
|
|
3108
|
+
template: "<div\n class=\"amplify-flex amplify-phonenumberfield\"\n amplify-field-group\n style=\"gap: 0px\"\n>\n <div class=\"amplify-field-group__outer-start\">\n <div\n class=\" amplify-flex amplify-field amplify-selectfield amplify-countrycodeselect\"\n style=\"flex-direction: column\"\n >\n <amplify-form-select\n name=\"country_code\"\n label=\"Country Code\"\n [id]=\"selectFieldId\"\n [items]=\"countryDialCodes\"\n [defaultValue]=\"defaultCountryCode\"\n ></amplify-form-select>\n </div>\n </div>\n\n <label class=\"sr-only amplify-label\" [for]=\"textFieldId\">\n {{ label }}\n </label>\n <input\n class=\"amplify-input\"\n [id]=\"textFieldId\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [attr.disabled]=\"disabled ? '' : null\"\n [autocomplete]=\"autocomplete\"\n />\n</div>\n"
|
|
3113
3109
|
},] }
|
|
3114
3110
|
];
|
|
3115
3111
|
PhoneNumberFieldComponent.propDecorators = {
|