@aws-amplify/ui-angular 5.1.7 → 5.2.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/fesm2022/aws-amplify-ui-angular.mjs +1583 -0
- package/fesm2022/aws-amplify-ui-angular.mjs.map +1 -0
- package/lib/common/types/auth-types.d.ts +2 -2
- package/lib/common/types/component-types.d.ts +1 -1
- package/lib/components/authenticator/components/authenticator/authenticator.component.d.ts +1 -1
- package/lib/components/authenticator/components/base-form-fields/base-form-fields.component.d.ts +1 -1
- package/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.d.ts +1 -1
- package/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.d.ts +1 -1
- package/lib/components/authenticator/components/confirm-sign-up/confirm-sign-up.component.d.ts +1 -1
- package/lib/components/authenticator/components/confirm-verify-user/amplify-confirm-verify-user.component.d.ts +1 -1
- package/lib/components/authenticator/components/federated-sign-in/federated-sign-in.component.d.ts +1 -1
- package/lib/components/authenticator/components/federated-sign-in-button/federated-sign-in-button.component.d.ts +1 -1
- package/lib/components/authenticator/components/force-new-password/force-new-password-form-fields/force-new-password-form-fields.component.d.ts +1 -1
- package/lib/components/authenticator/components/force-new-password/force-new-password.component.d.ts +1 -1
- package/lib/components/authenticator/components/forgot-password/forgot-password.component.d.ts +1 -1
- package/lib/components/authenticator/components/form-field/form-field.component.d.ts +1 -1
- package/lib/components/authenticator/components/select-mfa-type/select-mfa-type.component.d.ts +1 -1
- package/lib/components/authenticator/components/setup-email/setup-email.component.d.ts +1 -1
- package/lib/components/authenticator/components/setup-totp/setup-totp.component.d.ts +1 -1
- package/lib/components/authenticator/components/sign-in/sign-in.component.d.ts +1 -1
- package/lib/components/authenticator/components/sign-up/sign-up-form-fields/sign-up-form-fields.component.d.ts +1 -1
- package/lib/components/authenticator/components/sign-up/sign-up.component.d.ts +1 -1
- package/lib/components/authenticator/components/verify-user/verify-user.component.d.ts +1 -1
- package/lib/primitives/button/button.component.d.ts +1 -1
- package/lib/primitives/checkbox/checkbox.component.d.ts +1 -1
- package/lib/primitives/error/error.component.d.ts +1 -1
- package/lib/primitives/password-field/password-field.component.d.ts +1 -1
- package/lib/primitives/phone-number-field/phone-number-field.component.d.ts +1 -1
- package/lib/primitives/select/select.component.d.ts +1 -1
- package/lib/primitives/tab-item/tab-item.component.d.ts +1 -1
- package/lib/primitives/tabs/tabs.component.d.ts +1 -1
- package/lib/primitives/text-field/text-field.component.d.ts +1 -1
- package/lib/utilities/amplify-slot/amplify-slot.component.d.ts +1 -1
- package/lib/utilities/amplify-slot/amplify-slot.directive.d.ts +1 -1
- package/package.json +7 -15
- package/version.d.ts +1 -1
- package/esm2020/aws-amplify-ui-angular.mjs +0 -5
- package/esm2020/index.mjs +0 -30
- package/esm2020/lib/common/helpers.mjs +0 -3
- package/esm2020/lib/common/index.mjs +0 -3
- package/esm2020/lib/common/types/auth-types.mjs +0 -2
- package/esm2020/lib/common/types/component-types.mjs +0 -2
- package/esm2020/lib/common/types/index.mjs +0 -3
- package/esm2020/lib/components/authenticator/authenticator.module.mjs +0 -124
- package/esm2020/lib/components/authenticator/components/authenticator/authenticator.component.mjs +0 -180
- package/esm2020/lib/components/authenticator/components/base-form-fields/base-form-fields.component.mjs +0 -32
- package/esm2020/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.mjs +0 -45
- package/esm2020/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.mjs +0 -49
- package/esm2020/lib/components/authenticator/components/confirm-sign-up/confirm-sign-up.component.mjs +0 -49
- package/esm2020/lib/components/authenticator/components/confirm-verify-user/amplify-confirm-verify-user.component.mjs +0 -44
- package/esm2020/lib/components/authenticator/components/federated-sign-in/federated-sign-in.component.mjs +0 -47
- package/esm2020/lib/components/authenticator/components/federated-sign-in-button/federated-sign-in-button.component.mjs +0 -26
- package/esm2020/lib/components/authenticator/components/force-new-password/force-new-password-form-fields/force-new-password-form-fields.component.mjs +0 -12
- package/esm2020/lib/components/authenticator/components/force-new-password/force-new-password.component.mjs +0 -44
- package/esm2020/lib/components/authenticator/components/forgot-password/forgot-password.component.mjs +0 -44
- package/esm2020/lib/components/authenticator/components/form-field/form-field.component.mjs +0 -50
- package/esm2020/lib/components/authenticator/components/index.mjs +0 -18
- package/esm2020/lib/components/authenticator/components/select-mfa-type/select-mfa-type.component.mjs +0 -52
- package/esm2020/lib/components/authenticator/components/setup-email/setup-email.component.mjs +0 -39
- package/esm2020/lib/components/authenticator/components/setup-totp/setup-totp.component.mjs +0 -69
- package/esm2020/lib/components/authenticator/components/sign-in/sign-in.component.mjs +0 -41
- package/esm2020/lib/components/authenticator/components/sign-up/sign-up-form-fields/sign-up-form-fields.component.mjs +0 -12
- package/esm2020/lib/components/authenticator/components/sign-up/sign-up.component.mjs +0 -44
- package/esm2020/lib/components/authenticator/components/verify-user/verify-user.component.mjs +0 -58
- package/esm2020/lib/primitives/button/button.component.mjs +0 -78
- package/esm2020/lib/primitives/checkbox/checkbox.component.mjs +0 -37
- package/esm2020/lib/primitives/error/error.component.mjs +0 -21
- package/esm2020/lib/primitives/index.mjs +0 -10
- package/esm2020/lib/primitives/password-field/password-field.component.mjs +0 -64
- package/esm2020/lib/primitives/phone-number-field/phone-number-field.component.mjs +0 -62
- package/esm2020/lib/primitives/select/select.component.mjs +0 -22
- package/esm2020/lib/primitives/tab-item/tab-item.component.mjs +0 -29
- package/esm2020/lib/primitives/tabs/tabs.component.mjs +0 -48
- package/esm2020/lib/primitives/text-field/text-field.component.mjs +0 -50
- package/esm2020/lib/services/authenticator.service.mjs +0 -180
- package/esm2020/lib/services/custom-components.service.mjs +0 -25
- package/esm2020/lib/utilities/amplify-slot/amplify-slot.component.mjs +0 -33
- package/esm2020/lib/utilities/amplify-slot/amplify-slot.directive.mjs +0 -21
- package/esm2020/version.mjs +0 -2
- package/fesm2015/aws-amplify-ui-angular.mjs +0 -1521
- package/fesm2015/aws-amplify-ui-angular.mjs.map +0 -1
- package/fesm2020/aws-amplify-ui-angular.mjs +0 -1504
- package/fesm2020/aws-amplify-ui-angular.mjs.map +0 -1
|
@@ -0,0 +1,1583 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Input, Directive, Injectable, HostBinding, Component, EventEmitter, Output, ViewEncapsulation, ContentChildren, NgModule } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { createAuthenticatorMachine, translate, listenToAuthHub, defaultAuthHubHandler, getServiceFacade, classNames, ComponentClassName, countryDialCodes, getErrors, getSortedFormFields, authenticatorTextUtil, getFormDataFromEvent, getActorContext, getTotpCodeURL, FederatedIdentityProviders, defaultFormFieldOptions, getActorState, censorContactMethod, setUserAgent } from '@aws-amplify/ui';
|
|
6
|
+
export { translations } from '@aws-amplify/ui';
|
|
7
|
+
import { Subject } from 'rxjs';
|
|
8
|
+
import { interpret } from 'xstate';
|
|
9
|
+
import { getCurrentUser } from 'aws-amplify/auth';
|
|
10
|
+
import { ConsoleLogger } from 'aws-amplify/utils';
|
|
11
|
+
import { nanoid } from 'nanoid';
|
|
12
|
+
import QRCode from 'qrcode';
|
|
13
|
+
|
|
14
|
+
class AmplifySlotDirective {
|
|
15
|
+
template;
|
|
16
|
+
name;
|
|
17
|
+
constructor(template) {
|
|
18
|
+
this.template = template;
|
|
19
|
+
}
|
|
20
|
+
set amplifySlot(component) {
|
|
21
|
+
this.name = component;
|
|
22
|
+
}
|
|
23
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: AmplifySlotDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
24
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.18", type: AmplifySlotDirective, isStandalone: false, selector: "[amplifySlot]", inputs: { amplifySlot: "amplifySlot" }, ngImport: i0 });
|
|
25
|
+
}
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: AmplifySlotDirective, decorators: [{
|
|
27
|
+
type: Directive,
|
|
28
|
+
args: [{
|
|
29
|
+
selector: '[amplifySlot]',
|
|
30
|
+
standalone: false,
|
|
31
|
+
}]
|
|
32
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }], propDecorators: { amplifySlot: [{
|
|
33
|
+
type: Input
|
|
34
|
+
}] } });
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Stores and provides custom components that users provide with `amplify-slot`.
|
|
38
|
+
*/
|
|
39
|
+
class CustomComponentsService {
|
|
40
|
+
_customComponents = {};
|
|
41
|
+
get customComponents() {
|
|
42
|
+
return this._customComponents;
|
|
43
|
+
}
|
|
44
|
+
set customComponents(customComponents) {
|
|
45
|
+
this._customComponents = { ...this._customComponents, ...customComponents };
|
|
46
|
+
}
|
|
47
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: CustomComponentsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
48
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: CustomComponentsService, providedIn: 'root' });
|
|
49
|
+
}
|
|
50
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: CustomComponentsService, decorators: [{
|
|
51
|
+
type: Injectable,
|
|
52
|
+
args: [{
|
|
53
|
+
providedIn: 'root',
|
|
54
|
+
}]
|
|
55
|
+
}] });
|
|
56
|
+
|
|
57
|
+
const VERSION = '5.2.0';
|
|
58
|
+
|
|
59
|
+
const logger$1 = new ConsoleLogger('state-machine');
|
|
60
|
+
/**
|
|
61
|
+
* AuthenticatorService provides access to the authenticator state and context.
|
|
62
|
+
*/
|
|
63
|
+
class AuthenticatorService {
|
|
64
|
+
_authState;
|
|
65
|
+
_authStatus = 'configuring';
|
|
66
|
+
_authService;
|
|
67
|
+
_machineSubscription;
|
|
68
|
+
_facade;
|
|
69
|
+
_hubSubject;
|
|
70
|
+
_unsubscribeHub;
|
|
71
|
+
constructor() {
|
|
72
|
+
const machine = createAuthenticatorMachine();
|
|
73
|
+
this._authService = interpret(machine).start();
|
|
74
|
+
this.getInitialAuthStatus();
|
|
75
|
+
this.setupMachineSubscription();
|
|
76
|
+
this.setupHubListener();
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Context facades
|
|
80
|
+
*/
|
|
81
|
+
get error() {
|
|
82
|
+
return translate(this._facade?.error);
|
|
83
|
+
}
|
|
84
|
+
get hasValidationErrors() {
|
|
85
|
+
return this._facade?.hasValidationErrors;
|
|
86
|
+
}
|
|
87
|
+
get isPending() {
|
|
88
|
+
return this._facade?.isPending;
|
|
89
|
+
}
|
|
90
|
+
get route() {
|
|
91
|
+
return this._facade?.route;
|
|
92
|
+
}
|
|
93
|
+
get authStatus() {
|
|
94
|
+
return this._authStatus;
|
|
95
|
+
}
|
|
96
|
+
get user() {
|
|
97
|
+
return this._facade?.user;
|
|
98
|
+
}
|
|
99
|
+
get username() {
|
|
100
|
+
return this._facade?.username;
|
|
101
|
+
}
|
|
102
|
+
get validationErrors() {
|
|
103
|
+
return this._facade?.validationErrors;
|
|
104
|
+
}
|
|
105
|
+
get codeDeliveryDetails() {
|
|
106
|
+
return this._facade?.codeDeliveryDetails;
|
|
107
|
+
}
|
|
108
|
+
get totpSecretCode() {
|
|
109
|
+
return this._facade?.totpSecretCode;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Service facades
|
|
113
|
+
*/
|
|
114
|
+
get initializeMachine() {
|
|
115
|
+
return this._facade.initializeMachine;
|
|
116
|
+
}
|
|
117
|
+
get updateForm() {
|
|
118
|
+
return this._facade.updateForm;
|
|
119
|
+
}
|
|
120
|
+
get updateBlur() {
|
|
121
|
+
return this._facade.updateBlur;
|
|
122
|
+
}
|
|
123
|
+
get resendCode() {
|
|
124
|
+
return this._facade.resendCode;
|
|
125
|
+
}
|
|
126
|
+
get signOut() {
|
|
127
|
+
return this._facade.signOut;
|
|
128
|
+
}
|
|
129
|
+
get submitForm() {
|
|
130
|
+
return this._facade.submitForm;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Transition facades
|
|
134
|
+
*/
|
|
135
|
+
get toFederatedSignIn() {
|
|
136
|
+
return this._facade.toFederatedSignIn;
|
|
137
|
+
}
|
|
138
|
+
get toForgotPassword() {
|
|
139
|
+
return this._facade.toForgotPassword;
|
|
140
|
+
}
|
|
141
|
+
get toSignIn() {
|
|
142
|
+
return this._facade.toSignIn;
|
|
143
|
+
}
|
|
144
|
+
get toSignUp() {
|
|
145
|
+
return this._facade.toSignUp;
|
|
146
|
+
}
|
|
147
|
+
get skipVerification() {
|
|
148
|
+
return this._facade.skipVerification;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Internal utility functions
|
|
152
|
+
*/
|
|
153
|
+
/** @deprecated For internal use only */
|
|
154
|
+
get authState() {
|
|
155
|
+
return this._authState;
|
|
156
|
+
}
|
|
157
|
+
/** @deprecated For internal use only */
|
|
158
|
+
get authService() {
|
|
159
|
+
return this._authService;
|
|
160
|
+
}
|
|
161
|
+
/** @deprecated For internal use only */
|
|
162
|
+
get context() {
|
|
163
|
+
return this._authState.context;
|
|
164
|
+
}
|
|
165
|
+
/** @deprecated For internal use only */
|
|
166
|
+
get slotContext() {
|
|
167
|
+
return {
|
|
168
|
+
...this._facade,
|
|
169
|
+
$implicit: this._facade,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
/** @deprecated For internal use only */
|
|
173
|
+
get hubSubject() {
|
|
174
|
+
return this._hubSubject;
|
|
175
|
+
}
|
|
176
|
+
subscribe(callback) {
|
|
177
|
+
if (!this._authService) {
|
|
178
|
+
logger$1.error('Subscription attempted before machine was created. This is likely a bug on the library, please consider filing a bug.');
|
|
179
|
+
}
|
|
180
|
+
const subscription = this._authService.subscribe(() => {
|
|
181
|
+
callback(this._facade);
|
|
182
|
+
});
|
|
183
|
+
return subscription;
|
|
184
|
+
}
|
|
185
|
+
ngOnDestroy() {
|
|
186
|
+
if (this._machineSubscription)
|
|
187
|
+
this._machineSubscription.unsubscribe();
|
|
188
|
+
if (this._unsubscribeHub)
|
|
189
|
+
this._unsubscribeHub();
|
|
190
|
+
this._authService.stop();
|
|
191
|
+
}
|
|
192
|
+
/** @deprecated For internal use only */
|
|
193
|
+
send(event) {
|
|
194
|
+
this.authService.send(event);
|
|
195
|
+
}
|
|
196
|
+
async getInitialAuthStatus() {
|
|
197
|
+
try {
|
|
198
|
+
await getCurrentUser();
|
|
199
|
+
this._authStatus = 'authenticated';
|
|
200
|
+
}
|
|
201
|
+
catch (e) {
|
|
202
|
+
this._authStatus = 'unauthenticated';
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
setupHubListener() {
|
|
206
|
+
this._hubSubject = new Subject();
|
|
207
|
+
const onSignIn = () => {
|
|
208
|
+
this._authStatus = 'authenticated';
|
|
209
|
+
};
|
|
210
|
+
const onSignOut = () => {
|
|
211
|
+
this._authStatus = 'unauthenticated';
|
|
212
|
+
};
|
|
213
|
+
this._unsubscribeHub = listenToAuthHub(this._authService, (data, service) => {
|
|
214
|
+
defaultAuthHubHandler(data, service, { onSignIn, onSignOut });
|
|
215
|
+
this._hubSubject.next();
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
setupMachineSubscription() {
|
|
219
|
+
this._machineSubscription = this._authService.subscribe((state) => {
|
|
220
|
+
const newState = state;
|
|
221
|
+
this._authState = newState;
|
|
222
|
+
this._facade = getServiceFacade({
|
|
223
|
+
send: this._authService.send,
|
|
224
|
+
state: newState,
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: AuthenticatorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
229
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: AuthenticatorService, providedIn: 'root' });
|
|
230
|
+
}
|
|
231
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: AuthenticatorService, decorators: [{
|
|
232
|
+
type: Injectable,
|
|
233
|
+
args: [{
|
|
234
|
+
providedIn: 'root', // ensure we have a singleton service
|
|
235
|
+
}]
|
|
236
|
+
}], ctorParameters: () => [] });
|
|
237
|
+
|
|
238
|
+
class AmplifySlotComponent {
|
|
239
|
+
propService;
|
|
240
|
+
name;
|
|
241
|
+
context;
|
|
242
|
+
display = 'contents';
|
|
243
|
+
overridingComponent;
|
|
244
|
+
isOverriden = false;
|
|
245
|
+
constructor(propService) {
|
|
246
|
+
this.propService = propService;
|
|
247
|
+
}
|
|
248
|
+
ngAfterContentInit() {
|
|
249
|
+
const { customComponents } = this.propService;
|
|
250
|
+
const overridingComponent = customComponents[this.name];
|
|
251
|
+
if (overridingComponent) {
|
|
252
|
+
this.overridingComponent = overridingComponent;
|
|
253
|
+
this.isOverriden = true;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: AmplifySlotComponent, deps: [{ token: CustomComponentsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
257
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: AmplifySlotComponent, isStandalone: false, selector: "amplify-slot", inputs: { name: "name", context: "context" }, host: { properties: { "style.display": "this.display" } }, ngImport: i0, template: "<!-- \n if slot isn't overwritten, we display the the default coponent, which is the \n children passed onto this component.\n-->\n<ng-content *ngIf=\"!isOverriden\"></ng-content>\n\n<!-- If slot is overwritten, we render that instead. -->\n<ng-container\n *ngIf=\"isOverriden\"\n [ngTemplateOutlet]=\"overridingComponent\"\n [ngTemplateOutletContext]=\"context\"\n></ng-container>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
258
|
+
}
|
|
259
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: AmplifySlotComponent, decorators: [{
|
|
260
|
+
type: Component,
|
|
261
|
+
args: [{ selector: 'amplify-slot', standalone: false, template: "<!-- \n if slot isn't overwritten, we display the the default coponent, which is the \n children passed onto this component.\n-->\n<ng-content *ngIf=\"!isOverriden\"></ng-content>\n\n<!-- If slot is overwritten, we render that instead. -->\n<ng-container\n *ngIf=\"isOverriden\"\n [ngTemplateOutlet]=\"overridingComponent\"\n [ngTemplateOutletContext]=\"context\"\n></ng-container>\n" }]
|
|
262
|
+
}], ctorParameters: () => [{ type: CustomComponentsService }], propDecorators: { name: [{
|
|
263
|
+
type: Input
|
|
264
|
+
}], context: [{
|
|
265
|
+
type: Input
|
|
266
|
+
}], display: [{
|
|
267
|
+
type: HostBinding,
|
|
268
|
+
args: ['style.display']
|
|
269
|
+
}] } });
|
|
270
|
+
|
|
271
|
+
class ButtonComponent {
|
|
272
|
+
type = 'button';
|
|
273
|
+
fullWidth = false;
|
|
274
|
+
isDisabled = false;
|
|
275
|
+
size = 'medium';
|
|
276
|
+
variation = 'default';
|
|
277
|
+
fontWeight = 'normal';
|
|
278
|
+
typeAttr;
|
|
279
|
+
fullWidthAttr;
|
|
280
|
+
sizeAttr;
|
|
281
|
+
variationAttr;
|
|
282
|
+
fontWeightAttr;
|
|
283
|
+
get getDisabled() {
|
|
284
|
+
return this.isDisabled ? '' : null;
|
|
285
|
+
}
|
|
286
|
+
get classNames() {
|
|
287
|
+
let className = 'amplify-button';
|
|
288
|
+
if (this.variation) {
|
|
289
|
+
className += ` amplify-button--${this.variation}`;
|
|
290
|
+
}
|
|
291
|
+
if (this.size) {
|
|
292
|
+
className += ` amplify-button--${this.size}`;
|
|
293
|
+
}
|
|
294
|
+
if (this.fullWidth) {
|
|
295
|
+
className += ` amplify-button--fullwidth`;
|
|
296
|
+
}
|
|
297
|
+
if (this.isDisabled) {
|
|
298
|
+
className += ` amplify-button--disabled amplify-button--loading`;
|
|
299
|
+
}
|
|
300
|
+
return className;
|
|
301
|
+
}
|
|
302
|
+
ngOnInit() {
|
|
303
|
+
this.typeAttr = this.type;
|
|
304
|
+
this.fullWidthAttr = this.fullWidth;
|
|
305
|
+
this.sizeAttr = this.size;
|
|
306
|
+
this.variationAttr = this.variation;
|
|
307
|
+
this.fontWeightAttr = this.fontWeight;
|
|
308
|
+
}
|
|
309
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
310
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: ButtonComponent, isStandalone: false, selector: "button[amplify-button]", inputs: { type: "type", fullWidth: "fullWidth", isDisabled: "isDisabled", size: "size", variation: "variation", fontWeight: "fontWeight" }, host: { properties: { "type": "this.typeAttr", "attr.data-fullwidth": "this.fullWidthAttr", "attr.data-size": "this.sizeAttr", "attr.data-variation": "this.variationAttr", "style.font-weight": "this.fontWeightAttr", "attr.disabled": "this.getDisabled", "class": "this.classNames" } }, ngImport: i0, template: "<ng-content></ng-content>\n" });
|
|
311
|
+
}
|
|
312
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
313
|
+
type: Component,
|
|
314
|
+
args: [{ selector: 'button[amplify-button]', standalone: false, template: "<ng-content></ng-content>\n" }]
|
|
315
|
+
}], propDecorators: { type: [{
|
|
316
|
+
type: Input
|
|
317
|
+
}], fullWidth: [{
|
|
318
|
+
type: Input
|
|
319
|
+
}], isDisabled: [{
|
|
320
|
+
type: Input
|
|
321
|
+
}], size: [{
|
|
322
|
+
type: Input
|
|
323
|
+
}], variation: [{
|
|
324
|
+
type: Input
|
|
325
|
+
}], fontWeight: [{
|
|
326
|
+
type: Input
|
|
327
|
+
}], typeAttr: [{
|
|
328
|
+
type: HostBinding,
|
|
329
|
+
args: ['type']
|
|
330
|
+
}], fullWidthAttr: [{
|
|
331
|
+
type: HostBinding,
|
|
332
|
+
args: ['attr.data-fullwidth']
|
|
333
|
+
}], sizeAttr: [{
|
|
334
|
+
type: HostBinding,
|
|
335
|
+
args: ['attr.data-size']
|
|
336
|
+
}], variationAttr: [{
|
|
337
|
+
type: HostBinding,
|
|
338
|
+
args: ['attr.data-variation']
|
|
339
|
+
}], fontWeightAttr: [{
|
|
340
|
+
type: HostBinding,
|
|
341
|
+
args: ['style.font-weight']
|
|
342
|
+
}], getDisabled: [{
|
|
343
|
+
type: HostBinding,
|
|
344
|
+
args: ['attr.disabled']
|
|
345
|
+
}], classNames: [{
|
|
346
|
+
type: HostBinding,
|
|
347
|
+
args: ['class']
|
|
348
|
+
}] } });
|
|
349
|
+
|
|
350
|
+
class PasswordFieldComponent {
|
|
351
|
+
autocomplete = 'new-password';
|
|
352
|
+
disabled = false;
|
|
353
|
+
fieldId = `amplify-field-${nanoid(12)}`;
|
|
354
|
+
initialValue = '';
|
|
355
|
+
label = '';
|
|
356
|
+
name;
|
|
357
|
+
placeholder = '';
|
|
358
|
+
required = true;
|
|
359
|
+
labelHidden = false;
|
|
360
|
+
hasError;
|
|
361
|
+
describedBy;
|
|
362
|
+
setBlur = new EventEmitter();
|
|
363
|
+
type = 'password';
|
|
364
|
+
showPassword = false;
|
|
365
|
+
showPasswordButtonlabel = translate('Show password');
|
|
366
|
+
// re-export utilities so that template html can use them
|
|
367
|
+
classnames = classNames;
|
|
368
|
+
ComponentClassName = ComponentClassName;
|
|
369
|
+
togglePasswordText() {
|
|
370
|
+
this.showPassword = !this.showPassword;
|
|
371
|
+
this.showPasswordButtonlabel = this.showPassword
|
|
372
|
+
? translate('Hide password')
|
|
373
|
+
: translate('Show password');
|
|
374
|
+
this.type = this.showPassword ? 'text' : 'password';
|
|
375
|
+
}
|
|
376
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: PasswordFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
377
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: PasswordFieldComponent, isStandalone: false, selector: "amplify-password-field", inputs: { autocomplete: "autocomplete", disabled: "disabled", fieldId: "fieldId", initialValue: "initialValue", label: "label", name: "name", placeholder: "placeholder", required: "required", labelHidden: "labelHidden", hasError: "hasError", describedBy: "describedBy" }, outputs: { setBlur: "setBlur" }, ngImport: i0, template: "<div\n [class]=\"\n classnames(\n ComponentClassName.Flex,\n ComponentClassName.Field,\n ComponentClassName.TextField,\n ComponentClassName.PasswordField\n )\n \"\n>\n <label\n class=\"amplify-label\"\n [class.amplify-visually-hidden]=\"labelHidden\"\n [for]=\"fieldId\"\n >\n {{ label }}\n </label>\n <div\n [class]=\"classnames(ComponentClassName.Flex, ComponentClassName.FieldGroup)\"\n >\n <div [class]=\"ComponentClassName.FieldGroupFieldWrapper\">\n <input\n [class]=\"\n classnames(\n ComponentClassName.Input,\n ComponentClassName.FieldGroupControl,\n ComponentClassName.FieldShowPassword\n )\n \"\n [id]=\"fieldId\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [autocomplete]=\"autocomplete\"\n autocapitalize=\"off\"\n [attr.disabled]=\"disabled ? '' : null\"\n [attr.aria-invalid]=\"hasError ? 'true' : 'false'\"\n [attr.aria-describedby]=\"describedBy\"\n (blur)=\"setBlur.emit($event)\"\n />\n </div>\n <div [class]=\"ComponentClassName.FieldGroupOuterEnd\">\n <button\n amplify-button\n role=\"switch\"\n (click)=\"togglePasswordText()\"\n [attr.aria-checked]=\"type !== 'password'\"\n [attr.aria-label]=\"showPasswordButtonlabel\"\n [class]=\"\n classnames(\n ComponentClassName.Input,\n ComponentClassName.FieldGroupControl\n )\n \"\n >\n <svg\n *ngIf=\"!showPassword\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n class=\"amplify-icon\"\n >\n <path\n d=\"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z\"\n ></path>\n </svg>\n <svg\n *ngIf=\"showPassword\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n class=\"amplify-icon\"\n >\n <path\n d=\"M0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0z\"\n fill=\"none\"\n ></path>\n <path\n d=\"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z\"\n ></path>\n </svg>\n </button>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }] });
|
|
378
|
+
}
|
|
379
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: PasswordFieldComponent, decorators: [{
|
|
380
|
+
type: Component,
|
|
381
|
+
args: [{ selector: 'amplify-password-field', standalone: false, template: "<div\n [class]=\"\n classnames(\n ComponentClassName.Flex,\n ComponentClassName.Field,\n ComponentClassName.TextField,\n ComponentClassName.PasswordField\n )\n \"\n>\n <label\n class=\"amplify-label\"\n [class.amplify-visually-hidden]=\"labelHidden\"\n [for]=\"fieldId\"\n >\n {{ label }}\n </label>\n <div\n [class]=\"classnames(ComponentClassName.Flex, ComponentClassName.FieldGroup)\"\n >\n <div [class]=\"ComponentClassName.FieldGroupFieldWrapper\">\n <input\n [class]=\"\n classnames(\n ComponentClassName.Input,\n ComponentClassName.FieldGroupControl,\n ComponentClassName.FieldShowPassword\n )\n \"\n [id]=\"fieldId\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [autocomplete]=\"autocomplete\"\n autocapitalize=\"off\"\n [attr.disabled]=\"disabled ? '' : null\"\n [attr.aria-invalid]=\"hasError ? 'true' : 'false'\"\n [attr.aria-describedby]=\"describedBy\"\n (blur)=\"setBlur.emit($event)\"\n />\n </div>\n <div [class]=\"ComponentClassName.FieldGroupOuterEnd\">\n <button\n amplify-button\n role=\"switch\"\n (click)=\"togglePasswordText()\"\n [attr.aria-checked]=\"type !== 'password'\"\n [attr.aria-label]=\"showPasswordButtonlabel\"\n [class]=\"\n classnames(\n ComponentClassName.Input,\n ComponentClassName.FieldGroupControl\n )\n \"\n >\n <svg\n *ngIf=\"!showPassword\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n class=\"amplify-icon\"\n >\n <path\n d=\"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z\"\n ></path>\n </svg>\n <svg\n *ngIf=\"showPassword\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n class=\"amplify-icon\"\n >\n <path\n d=\"M0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0z\"\n fill=\"none\"\n ></path>\n <path\n d=\"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z\"\n ></path>\n </svg>\n </button>\n </div>\n </div>\n</div>\n" }]
|
|
382
|
+
}], propDecorators: { autocomplete: [{
|
|
383
|
+
type: Input
|
|
384
|
+
}], disabled: [{
|
|
385
|
+
type: Input
|
|
386
|
+
}], fieldId: [{
|
|
387
|
+
type: Input
|
|
388
|
+
}], initialValue: [{
|
|
389
|
+
type: Input
|
|
390
|
+
}], label: [{
|
|
391
|
+
type: Input
|
|
392
|
+
}], name: [{
|
|
393
|
+
type: Input
|
|
394
|
+
}], placeholder: [{
|
|
395
|
+
type: Input
|
|
396
|
+
}], required: [{
|
|
397
|
+
type: Input
|
|
398
|
+
}], labelHidden: [{
|
|
399
|
+
type: Input
|
|
400
|
+
}], hasError: [{
|
|
401
|
+
type: Input
|
|
402
|
+
}], describedBy: [{
|
|
403
|
+
type: Input
|
|
404
|
+
}], setBlur: [{
|
|
405
|
+
type: Output
|
|
406
|
+
}] } });
|
|
407
|
+
|
|
408
|
+
class SelectComponent {
|
|
409
|
+
items;
|
|
410
|
+
name;
|
|
411
|
+
label;
|
|
412
|
+
id;
|
|
413
|
+
defaultValue;
|
|
414
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
415
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: SelectComponent, isStandalone: false, selector: "amplify-form-select", inputs: { items: "items", name: "name", label: "label", id: "id", defaultValue: "defaultValue" }, ngImport: i0, template: "<label class=\"amplify-label amplify-visually-hidden\" [for]=\"id\">{{\n label\n}}</label>\n<div class=\"amplify-select__wrapper\">\n <select\n class=\"amplify-select amplify-field-group__control\"\n autocomplete=\"tel-country-code\"\n [id]=\"id\"\n [name]=\"name\"\n >\n <option\n *ngFor=\"let item of items\"\n [value]=\"item\"\n [selected]=\"item === defaultValue\"\n >\n {{ item }}\n </option>\n </select>\n <div\n class=\"amplify-flex amplify-select__icon\"\n style=\"align-items: center; justify-content: center\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon\"\n viewBox=\"0 0 24 24\"\n data-size=\"large\"\n fill=\"currentColor\"\n >\n <path d=\"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z\"></path>\n </svg>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
416
|
+
}
|
|
417
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: SelectComponent, decorators: [{
|
|
418
|
+
type: Component,
|
|
419
|
+
args: [{ selector: 'amplify-form-select', standalone: false, template: "<label class=\"amplify-label amplify-visually-hidden\" [for]=\"id\">{{\n label\n}}</label>\n<div class=\"amplify-select__wrapper\">\n <select\n class=\"amplify-select amplify-field-group__control\"\n autocomplete=\"tel-country-code\"\n [id]=\"id\"\n [name]=\"name\"\n >\n <option\n *ngFor=\"let item of items\"\n [value]=\"item\"\n [selected]=\"item === defaultValue\"\n >\n {{ item }}\n </option>\n </select>\n <div\n class=\"amplify-flex amplify-select__icon\"\n style=\"align-items: center; justify-content: center\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon\"\n viewBox=\"0 0 24 24\"\n data-size=\"large\"\n fill=\"currentColor\"\n >\n <path d=\"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z\"></path>\n </svg>\n </div>\n</div>\n" }]
|
|
420
|
+
}], propDecorators: { items: [{
|
|
421
|
+
type: Input
|
|
422
|
+
}], name: [{
|
|
423
|
+
type: Input
|
|
424
|
+
}], label: [{
|
|
425
|
+
type: Input
|
|
426
|
+
}], id: [{
|
|
427
|
+
type: Input
|
|
428
|
+
}], defaultValue: [{
|
|
429
|
+
type: Input
|
|
430
|
+
}] } });
|
|
431
|
+
|
|
432
|
+
class PhoneNumberFieldComponent {
|
|
433
|
+
autocomplete = 'new-password';
|
|
434
|
+
disabled = false;
|
|
435
|
+
defaultCountryCode;
|
|
436
|
+
selectFieldId = `amplify-field-${nanoid(12)}`;
|
|
437
|
+
textFieldId = `amplify-field-${nanoid(12)}`;
|
|
438
|
+
initialValue = '';
|
|
439
|
+
label = '';
|
|
440
|
+
name;
|
|
441
|
+
placeholder = '';
|
|
442
|
+
required = true;
|
|
443
|
+
type;
|
|
444
|
+
labelHidden = false;
|
|
445
|
+
dialCodeList;
|
|
446
|
+
hasError;
|
|
447
|
+
describedBy;
|
|
448
|
+
display = 'contents';
|
|
449
|
+
countryDialCodesValues;
|
|
450
|
+
ngOnInit() {
|
|
451
|
+
this.countryDialCodesValues = this.dialCodeList ?? countryDialCodes;
|
|
452
|
+
}
|
|
453
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: PhoneNumberFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
454
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: PhoneNumberFieldComponent, isStandalone: false, selector: "amplify-phone-number-field", inputs: { autocomplete: "autocomplete", disabled: "disabled", defaultCountryCode: "defaultCountryCode", selectFieldId: "selectFieldId", textFieldId: "textFieldId", initialValue: "initialValue", label: "label", name: "name", placeholder: "placeholder", required: "required", type: "type", labelHidden: "labelHidden", dialCodeList: "dialCodeList", hasError: "hasError", describedBy: "describedBy" }, host: { properties: { "style.display": "this.display" } }, ngImport: i0, template: "<div\n class=\"amplify-flex amplify-field amplify-textfield amplify-phonenumberfield\"\n>\n <label\n class=\"amplify-label\"\n [class.amplify-visually-hidden]=\"labelHidden\"\n [for]=\"textFieldId\"\n >\n {{ label }}\n </label>\n <div class=\"amplify-flex amplify-field-group amplify-field-group--horizontal\">\n <div class=\"amplify-field-group__outer-start\">\n <div\n class=\"amplify-flex amplify-field amplify-selectfield amplify-dialcodeselect\"\n style=\"flex-direction: column\"\n >\n <amplify-form-select\n name=\"country_code\"\n label=\"Country Code\"\n [id]=\"selectFieldId\"\n [items]=\"countryDialCodesValues\"\n [defaultValue]=\"defaultCountryCode\"\n ></amplify-form-select>\n </div>\n </div>\n\n <div\n class=\"amplify-field-group__field-wrapper amplify-field-group__field-wrapper--horizontal\"\n >\n <input\n class=\"amplify-input amplify-field-group__control\"\n [id]=\"textFieldId\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [autocomplete]=\"autocomplete\"\n [attr.disabled]=\"disabled ? '' : null\"\n [attr.aria-invalid]=\"hasError ? 'true' : 'false'\"\n [attr.aria-describedby]=\"describedBy\"\n />\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: SelectComponent, selector: "amplify-form-select", inputs: ["items", "name", "label", "id", "defaultValue"] }] });
|
|
455
|
+
}
|
|
456
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: PhoneNumberFieldComponent, decorators: [{
|
|
457
|
+
type: Component,
|
|
458
|
+
args: [{ selector: 'amplify-phone-number-field', standalone: false, template: "<div\n class=\"amplify-flex amplify-field amplify-textfield amplify-phonenumberfield\"\n>\n <label\n class=\"amplify-label\"\n [class.amplify-visually-hidden]=\"labelHidden\"\n [for]=\"textFieldId\"\n >\n {{ label }}\n </label>\n <div class=\"amplify-flex amplify-field-group amplify-field-group--horizontal\">\n <div class=\"amplify-field-group__outer-start\">\n <div\n class=\"amplify-flex amplify-field amplify-selectfield amplify-dialcodeselect\"\n style=\"flex-direction: column\"\n >\n <amplify-form-select\n name=\"country_code\"\n label=\"Country Code\"\n [id]=\"selectFieldId\"\n [items]=\"countryDialCodesValues\"\n [defaultValue]=\"defaultCountryCode\"\n ></amplify-form-select>\n </div>\n </div>\n\n <div\n class=\"amplify-field-group__field-wrapper amplify-field-group__field-wrapper--horizontal\"\n >\n <input\n class=\"amplify-input amplify-field-group__control\"\n [id]=\"textFieldId\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [autocomplete]=\"autocomplete\"\n [attr.disabled]=\"disabled ? '' : null\"\n [attr.aria-invalid]=\"hasError ? 'true' : 'false'\"\n [attr.aria-describedby]=\"describedBy\"\n />\n </div>\n </div>\n</div>\n" }]
|
|
459
|
+
}], propDecorators: { autocomplete: [{
|
|
460
|
+
type: Input
|
|
461
|
+
}], disabled: [{
|
|
462
|
+
type: Input
|
|
463
|
+
}], defaultCountryCode: [{
|
|
464
|
+
type: Input
|
|
465
|
+
}], selectFieldId: [{
|
|
466
|
+
type: Input
|
|
467
|
+
}], textFieldId: [{
|
|
468
|
+
type: Input
|
|
469
|
+
}], initialValue: [{
|
|
470
|
+
type: Input
|
|
471
|
+
}], label: [{
|
|
472
|
+
type: Input
|
|
473
|
+
}], name: [{
|
|
474
|
+
type: Input
|
|
475
|
+
}], placeholder: [{
|
|
476
|
+
type: Input
|
|
477
|
+
}], required: [{
|
|
478
|
+
type: Input
|
|
479
|
+
}], type: [{
|
|
480
|
+
type: Input
|
|
481
|
+
}], labelHidden: [{
|
|
482
|
+
type: Input
|
|
483
|
+
}], dialCodeList: [{
|
|
484
|
+
type: Input
|
|
485
|
+
}], hasError: [{
|
|
486
|
+
type: Input
|
|
487
|
+
}], describedBy: [{
|
|
488
|
+
type: Input
|
|
489
|
+
}], display: [{
|
|
490
|
+
type: HostBinding,
|
|
491
|
+
args: ['style.display']
|
|
492
|
+
}] } });
|
|
493
|
+
|
|
494
|
+
class TextFieldComponent {
|
|
495
|
+
autocomplete = 'new-password';
|
|
496
|
+
disabled = false;
|
|
497
|
+
fieldId = `amplify-field-${nanoid(12)}`;
|
|
498
|
+
initialValue = '';
|
|
499
|
+
label = '';
|
|
500
|
+
name;
|
|
501
|
+
placeholder = '';
|
|
502
|
+
required = true;
|
|
503
|
+
type;
|
|
504
|
+
labelHidden = false;
|
|
505
|
+
hasError;
|
|
506
|
+
describedBy;
|
|
507
|
+
display = 'contents';
|
|
508
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TextFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
509
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: TextFieldComponent, isStandalone: false, selector: "amplify-text-field", inputs: { autocomplete: "autocomplete", disabled: "disabled", fieldId: "fieldId", initialValue: "initialValue", label: "label", name: "name", placeholder: "placeholder", required: "required", type: "type", labelHidden: "labelHidden", hasError: "hasError", describedBy: "describedBy" }, host: { properties: { "style.display": "this.display" } }, ngImport: i0, template: "<label\n class=\"amplify-label\"\n [class.amplify-visually-hidden]=\"labelHidden\"\n [for]=\"fieldId\"\n>\n {{ label }}\n</label>\n<input\n class=\"amplify-input\"\n autocapitalize=\"off\"\n [id]=\"fieldId\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [autocomplete]=\"autocomplete\"\n [attr.disabled]=\"disabled ? '' : null\"\n [attr.aria-invalid]=\"hasError ? 'true' : 'false'\"\n [attr.aria-describedby]=\"describedBy\"\n/>\n" });
|
|
510
|
+
}
|
|
511
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TextFieldComponent, decorators: [{
|
|
512
|
+
type: Component,
|
|
513
|
+
args: [{ selector: 'amplify-text-field', standalone: false, template: "<label\n class=\"amplify-label\"\n [class.amplify-visually-hidden]=\"labelHidden\"\n [for]=\"fieldId\"\n>\n {{ label }}\n</label>\n<input\n class=\"amplify-input\"\n autocapitalize=\"off\"\n [id]=\"fieldId\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [autocomplete]=\"autocomplete\"\n [attr.disabled]=\"disabled ? '' : null\"\n [attr.aria-invalid]=\"hasError ? 'true' : 'false'\"\n [attr.aria-describedby]=\"describedBy\"\n/>\n" }]
|
|
514
|
+
}], propDecorators: { autocomplete: [{
|
|
515
|
+
type: Input
|
|
516
|
+
}], disabled: [{
|
|
517
|
+
type: Input
|
|
518
|
+
}], fieldId: [{
|
|
519
|
+
type: Input
|
|
520
|
+
}], initialValue: [{
|
|
521
|
+
type: Input
|
|
522
|
+
}], label: [{
|
|
523
|
+
type: Input
|
|
524
|
+
}], name: [{
|
|
525
|
+
type: Input
|
|
526
|
+
}], placeholder: [{
|
|
527
|
+
type: Input
|
|
528
|
+
}], required: [{
|
|
529
|
+
type: Input
|
|
530
|
+
}], type: [{
|
|
531
|
+
type: Input
|
|
532
|
+
}], labelHidden: [{
|
|
533
|
+
type: Input
|
|
534
|
+
}], hasError: [{
|
|
535
|
+
type: Input
|
|
536
|
+
}], describedBy: [{
|
|
537
|
+
type: Input
|
|
538
|
+
}], display: [{
|
|
539
|
+
type: HostBinding,
|
|
540
|
+
args: ['style.display']
|
|
541
|
+
}] } });
|
|
542
|
+
|
|
543
|
+
class FormFieldComponent {
|
|
544
|
+
authenticator;
|
|
545
|
+
name; // name of the input field
|
|
546
|
+
formField; // form field options for this field
|
|
547
|
+
defaultCountryCodeValue;
|
|
548
|
+
countryDialCodesValue = countryDialCodes;
|
|
549
|
+
errorId = nanoid(12);
|
|
550
|
+
constructor(authenticator) {
|
|
551
|
+
this.authenticator = authenticator;
|
|
552
|
+
}
|
|
553
|
+
get ariaDescribedBy() {
|
|
554
|
+
return this.hasError() ? this.errorId : undefined;
|
|
555
|
+
}
|
|
556
|
+
get errors() {
|
|
557
|
+
const { validationErrors } = this.authenticator;
|
|
558
|
+
return getErrors(validationErrors[this.name]);
|
|
559
|
+
}
|
|
560
|
+
onBlur($event) {
|
|
561
|
+
const { name } = $event.target;
|
|
562
|
+
this.authenticator.updateBlur({ name });
|
|
563
|
+
}
|
|
564
|
+
isPasswordField() {
|
|
565
|
+
return this.formField.type === 'password';
|
|
566
|
+
}
|
|
567
|
+
isPhoneField() {
|
|
568
|
+
return this.formField.type === 'tel';
|
|
569
|
+
}
|
|
570
|
+
hasError() {
|
|
571
|
+
return this.errors?.length > 0;
|
|
572
|
+
}
|
|
573
|
+
translate(phrase) {
|
|
574
|
+
return translate(phrase);
|
|
575
|
+
}
|
|
576
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: FormFieldComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
577
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: FormFieldComponent, isStandalone: false, selector: "amplify-form-field", inputs: { name: "name", formField: "formField" }, ngImport: i0, template: "<div class=\"amplify-flex amplify-field amplify-authenticator__column\">\n <!-- Country code field -->\n <amplify-phone-number-field\n *ngIf=\"isPhoneField()\"\n [name]=\"name\"\n [label]=\"formField.label\"\n [defaultCountryCode]=\"formField.dialCode\"\n [dialCodeList]=\"formField.dialCodeList\"\n [placeholder]=\"formField.placeholder\"\n [required]=\"formField.isRequired\"\n [labelHidden]=\"formField.labelHidden\"\n [autocomplete]=\"formField.autocomplete\"\n [hasError]=\"hasError\"\n [describedBy]=\"ariaDescribedBy\"\n type=\"tel\"\n ></amplify-phone-number-field>\n\n <amplify-password-field\n *ngIf=\"isPasswordField()\"\n [name]=\"name\"\n [label]=\"formField.label\"\n [placeholder]=\"formField.placeholder\"\n [required]=\"formField.isRequired\"\n [labelHidden]=\"formField.labelHidden\"\n [autocomplete]=\"formField.autocomplete\"\n [hasError]=\"hasError\"\n [describedBy]=\"ariaDescribedBy\"\n (setBlur)=\"onBlur($event)\"\n ></amplify-password-field>\n\n <amplify-text-field\n *ngIf=\"!isPasswordField() && !isPhoneField()\"\n [name]=\"name\"\n [label]=\"formField.label\"\n [placeholder]=\"formField.placeholder\"\n [required]=\"formField.isRequired\"\n [labelHidden]=\"formField.labelHidden\"\n [autocomplete]=\"formField.autocomplete\"\n [type]=\"formField.type\"\n [hasError]=\"hasError\"\n [describedBy]=\"ariaDescribedBy\"\n ></amplify-text-field>\n\n <div\n data-amplify-sign-up-errors\n *ngIf=\"hasError()\"\n [id]=\"errorId\"\n >\n <div\n class=\"amplify-text amplify-text--error\"\n data-variation=\"error\"\n *ngFor=\"let error of errors\"\n >\n {{ translate(error) }}\n </div>\n </div>\n</div>", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PasswordFieldComponent, selector: "amplify-password-field", inputs: ["autocomplete", "disabled", "fieldId", "initialValue", "label", "name", "placeholder", "required", "labelHidden", "hasError", "describedBy"], outputs: ["setBlur"] }, { kind: "component", type: PhoneNumberFieldComponent, selector: "amplify-phone-number-field", inputs: ["autocomplete", "disabled", "defaultCountryCode", "selectFieldId", "textFieldId", "initialValue", "label", "name", "placeholder", "required", "type", "labelHidden", "dialCodeList", "hasError", "describedBy"] }, { kind: "component", type: TextFieldComponent, selector: "amplify-text-field", inputs: ["autocomplete", "disabled", "fieldId", "initialValue", "label", "name", "placeholder", "required", "type", "labelHidden", "hasError", "describedBy"] }] });
|
|
578
|
+
}
|
|
579
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: FormFieldComponent, decorators: [{
|
|
580
|
+
type: Component,
|
|
581
|
+
args: [{ selector: 'amplify-form-field', standalone: false, template: "<div class=\"amplify-flex amplify-field amplify-authenticator__column\">\n <!-- Country code field -->\n <amplify-phone-number-field\n *ngIf=\"isPhoneField()\"\n [name]=\"name\"\n [label]=\"formField.label\"\n [defaultCountryCode]=\"formField.dialCode\"\n [dialCodeList]=\"formField.dialCodeList\"\n [placeholder]=\"formField.placeholder\"\n [required]=\"formField.isRequired\"\n [labelHidden]=\"formField.labelHidden\"\n [autocomplete]=\"formField.autocomplete\"\n [hasError]=\"hasError\"\n [describedBy]=\"ariaDescribedBy\"\n type=\"tel\"\n ></amplify-phone-number-field>\n\n <amplify-password-field\n *ngIf=\"isPasswordField()\"\n [name]=\"name\"\n [label]=\"formField.label\"\n [placeholder]=\"formField.placeholder\"\n [required]=\"formField.isRequired\"\n [labelHidden]=\"formField.labelHidden\"\n [autocomplete]=\"formField.autocomplete\"\n [hasError]=\"hasError\"\n [describedBy]=\"ariaDescribedBy\"\n (setBlur)=\"onBlur($event)\"\n ></amplify-password-field>\n\n <amplify-text-field\n *ngIf=\"!isPasswordField() && !isPhoneField()\"\n [name]=\"name\"\n [label]=\"formField.label\"\n [placeholder]=\"formField.placeholder\"\n [required]=\"formField.isRequired\"\n [labelHidden]=\"formField.labelHidden\"\n [autocomplete]=\"formField.autocomplete\"\n [type]=\"formField.type\"\n [hasError]=\"hasError\"\n [describedBy]=\"ariaDescribedBy\"\n ></amplify-text-field>\n\n <div\n data-amplify-sign-up-errors\n *ngIf=\"hasError()\"\n [id]=\"errorId\"\n >\n <div\n class=\"amplify-text amplify-text--error\"\n data-variation=\"error\"\n *ngFor=\"let error of errors\"\n >\n {{ translate(error) }}\n </div>\n </div>\n</div>" }]
|
|
582
|
+
}], ctorParameters: () => [{ type: AuthenticatorService }], propDecorators: { name: [{
|
|
583
|
+
type: Input
|
|
584
|
+
}], formField: [{
|
|
585
|
+
type: Input
|
|
586
|
+
}] } });
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* Sorts the given formFields, then renders them in order.
|
|
590
|
+
*/
|
|
591
|
+
class BaseFormFieldsComponent {
|
|
592
|
+
authenticator;
|
|
593
|
+
route; // formFields to sort and render
|
|
594
|
+
display = 'contents';
|
|
595
|
+
formFields = [];
|
|
596
|
+
constructor(authenticator) {
|
|
597
|
+
this.authenticator = authenticator;
|
|
598
|
+
}
|
|
599
|
+
ngOnInit() {
|
|
600
|
+
const state = this.authenticator.authState;
|
|
601
|
+
this.formFields = getSortedFormFields(this.route, state);
|
|
602
|
+
}
|
|
603
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BaseFormFieldsComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
604
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: BaseFormFieldsComponent, isStandalone: false, selector: "amplify-base-form-fields", inputs: { route: "route" }, host: { properties: { "style.display": "this.display" } }, ngImport: i0, template: "<ng-container *ngFor=\"let formField of formFields\">\n <amplify-form-field\n [name]=\"formField[0]\"\n [formField]=\"formField[1]\"\n ></amplify-form-field>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: FormFieldComponent, selector: "amplify-form-field", inputs: ["name", "formField"] }] });
|
|
605
|
+
}
|
|
606
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: BaseFormFieldsComponent, decorators: [{
|
|
607
|
+
type: Component,
|
|
608
|
+
args: [{ selector: 'amplify-base-form-fields', standalone: false, template: "<ng-container *ngFor=\"let formField of formFields\">\n <amplify-form-field\n [name]=\"formField[0]\"\n [formField]=\"formField[1]\"\n ></amplify-form-field>\n</ng-container>\n" }]
|
|
609
|
+
}], ctorParameters: () => [{ type: AuthenticatorService }], propDecorators: { route: [{
|
|
610
|
+
type: Input
|
|
611
|
+
}], display: [{
|
|
612
|
+
type: HostBinding,
|
|
613
|
+
args: ['style.display']
|
|
614
|
+
}] } });
|
|
615
|
+
|
|
616
|
+
class ErrorComponent {
|
|
617
|
+
isVisible = true;
|
|
618
|
+
dismissAriaLabel = translate('Dismiss alert');
|
|
619
|
+
close() {
|
|
620
|
+
this.isVisible = false;
|
|
621
|
+
}
|
|
622
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
623
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: ErrorComponent, isStandalone: false, selector: "amplify-error", ngImport: i0, template: "<div\n class=\"amplify-flex amplify-alert amplify-alert--error\"\n data-variation=\"error\"\n style=\"align-items: center; justify-content: space-between\"\n *ngIf=\"isVisible\"\n role=\"alert\"\n>\n <div class=\"amplify-flex\" style=\"align-items: center\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon\"\n [attr.aria-hidden]=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path\n d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z\"\n ></path>\n </svg>\n <div><ng-content></ng-content></div>\n </div>\n <button\n amplify-button\n [attr.aria-label]=\"dismissAriaLabel\"\n variation=\"link\"\n [fullWidth]=\"false\"\n (click)=\"close()\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon\"\n [attr.aria-hidden]=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n ></path>\n </svg>\n </button>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }] });
|
|
624
|
+
}
|
|
625
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ErrorComponent, decorators: [{
|
|
626
|
+
type: Component,
|
|
627
|
+
args: [{ selector: 'amplify-error', standalone: false, template: "<div\n class=\"amplify-flex amplify-alert amplify-alert--error\"\n data-variation=\"error\"\n style=\"align-items: center; justify-content: space-between\"\n *ngIf=\"isVisible\"\n role=\"alert\"\n>\n <div class=\"amplify-flex\" style=\"align-items: center\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon\"\n [attr.aria-hidden]=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path\n d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z\"\n ></path>\n </svg>\n <div><ng-content></ng-content></div>\n </div>\n <button\n amplify-button\n [attr.aria-label]=\"dismissAriaLabel\"\n variation=\"link\"\n [fullWidth]=\"false\"\n (click)=\"close()\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon\"\n [attr.aria-hidden]=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n ></path>\n </svg>\n </button>\n</div>\n" }]
|
|
628
|
+
}] });
|
|
629
|
+
|
|
630
|
+
const { getBackToSignInText: getBackToSignInText$6, getResendCodeText: getResendCodeText$1, getSubmitText: getSubmitText$1, getResetYourPasswordText: getResetYourPasswordText$1, } = authenticatorTextUtil;
|
|
631
|
+
class ConfirmResetPasswordComponent {
|
|
632
|
+
authenticator;
|
|
633
|
+
dataAttr = '';
|
|
634
|
+
headerText = getResetYourPasswordText$1();
|
|
635
|
+
sortedFormFields;
|
|
636
|
+
// translated strings
|
|
637
|
+
backToSignInText = getBackToSignInText$6();
|
|
638
|
+
resendCodeText = getResendCodeText$1();
|
|
639
|
+
submitText = getSubmitText$1();
|
|
640
|
+
constructor(authenticator) {
|
|
641
|
+
this.authenticator = authenticator;
|
|
642
|
+
}
|
|
643
|
+
get context() {
|
|
644
|
+
return this.authenticator.slotContext;
|
|
645
|
+
}
|
|
646
|
+
onInput(event) {
|
|
647
|
+
event.preventDefault();
|
|
648
|
+
const { name, value } = event.target;
|
|
649
|
+
this.authenticator.updateForm({ name, value });
|
|
650
|
+
}
|
|
651
|
+
onSubmit(event) {
|
|
652
|
+
event.preventDefault();
|
|
653
|
+
this.authenticator.submitForm(getFormDataFromEvent(event));
|
|
654
|
+
}
|
|
655
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ConfirmResetPasswordComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
656
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: ConfirmResetPasswordComponent, isStandalone: false, selector: "amplify-confirm-reset-password", inputs: { headerText: "headerText" }, host: { properties: { "attr.data-amplify-authenticator-confirmsignin": "this.dataAttr" } }, ngImport: i0, template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"confirm-reset-password-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ headerText }}</h3>\n </amplify-slot>\n\n <amplify-base-form-fields\n route=\"confirmResetPassword\"\n ></amplify-base-form-fields>\n\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ submitText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n type=\"button\"\n (click)=\"authenticator.resendCode()\"\n >\n {{ resendCodeText }}\n </button>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"confirm-reset-password-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { kind: "component", type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }, { kind: "component", type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { kind: "component", type: ErrorComponent, selector: "amplify-error" }] });
|
|
657
|
+
}
|
|
658
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ConfirmResetPasswordComponent, decorators: [{
|
|
659
|
+
type: Component,
|
|
660
|
+
args: [{ selector: 'amplify-confirm-reset-password', standalone: false, template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"confirm-reset-password-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ headerText }}</h3>\n </amplify-slot>\n\n <amplify-base-form-fields\n route=\"confirmResetPassword\"\n ></amplify-base-form-fields>\n\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ submitText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n type=\"button\"\n (click)=\"authenticator.resendCode()\"\n >\n {{ resendCodeText }}\n </button>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"confirm-reset-password-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n" }]
|
|
661
|
+
}], ctorParameters: () => [{ type: AuthenticatorService }], propDecorators: { dataAttr: [{
|
|
662
|
+
type: HostBinding,
|
|
663
|
+
args: ['attr.data-amplify-authenticator-confirmsignin']
|
|
664
|
+
}], headerText: [{
|
|
665
|
+
type: Input
|
|
666
|
+
}] } });
|
|
667
|
+
|
|
668
|
+
const { getConfirmText: getConfirmText$4, getBackToSignInText: getBackToSignInText$5, getChallengeText } = authenticatorTextUtil;
|
|
669
|
+
class ConfirmSignInComponent {
|
|
670
|
+
authenticator;
|
|
671
|
+
dataAttr = '';
|
|
672
|
+
// translated texts
|
|
673
|
+
headerText;
|
|
674
|
+
confirmText = getConfirmText$4();
|
|
675
|
+
backToSignInText = getBackToSignInText$5();
|
|
676
|
+
sortedFormFields;
|
|
677
|
+
constructor(authenticator) {
|
|
678
|
+
this.authenticator = authenticator;
|
|
679
|
+
}
|
|
680
|
+
get context() {
|
|
681
|
+
return this.authenticator.slotContext;
|
|
682
|
+
}
|
|
683
|
+
ngOnInit() {
|
|
684
|
+
this.setHeaderText();
|
|
685
|
+
}
|
|
686
|
+
setHeaderText() {
|
|
687
|
+
const state = this.authenticator.authState;
|
|
688
|
+
const actorContext = getActorContext(state);
|
|
689
|
+
const { challengeName } = actorContext;
|
|
690
|
+
this.headerText = getChallengeText(challengeName);
|
|
691
|
+
}
|
|
692
|
+
onInput(event) {
|
|
693
|
+
event.preventDefault();
|
|
694
|
+
const { name, value } = event.target;
|
|
695
|
+
this.authenticator.updateForm({ name, value });
|
|
696
|
+
}
|
|
697
|
+
onSubmit(event) {
|
|
698
|
+
event.preventDefault();
|
|
699
|
+
this.authenticator.submitForm(getFormDataFromEvent(event));
|
|
700
|
+
}
|
|
701
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ConfirmSignInComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
702
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: ConfirmSignInComponent, isStandalone: false, selector: "amplify-confirm-sign-in", host: { properties: { "attr.data-amplify-authenticator-confirmsignin": "this.dataAttr" } }, ngImport: i0, template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"confirm-sign-in-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ headerText }}</h3>\n </amplify-slot>\n <amplify-base-form-fields route=\"confirmSignIn\"></amplify-base-form-fields>\n\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ confirmText }}\n </button>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot\n name=\"confirm-sign-in-footer\"\n [context]=\"context\"\n ></amplify-slot>\n</form>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { kind: "component", type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }, { kind: "component", type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { kind: "component", type: ErrorComponent, selector: "amplify-error" }] });
|
|
703
|
+
}
|
|
704
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ConfirmSignInComponent, decorators: [{
|
|
705
|
+
type: Component,
|
|
706
|
+
args: [{ selector: 'amplify-confirm-sign-in', standalone: false, template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"confirm-sign-in-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ headerText }}</h3>\n </amplify-slot>\n <amplify-base-form-fields route=\"confirmSignIn\"></amplify-base-form-fields>\n\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ confirmText }}\n </button>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot\n name=\"confirm-sign-in-footer\"\n [context]=\"context\"\n ></amplify-slot>\n</form>\n" }]
|
|
707
|
+
}], ctorParameters: () => [{ type: AuthenticatorService }], propDecorators: { dataAttr: [{
|
|
708
|
+
type: HostBinding,
|
|
709
|
+
args: ['attr.data-amplify-authenticator-confirmsignin']
|
|
710
|
+
}] } });
|
|
711
|
+
|
|
712
|
+
const { getResendCodeText, getConfirmText: getConfirmText$3, getDeliveryMethodText, getDeliveryMessageText, } = authenticatorTextUtil;
|
|
713
|
+
class ConfirmSignUpComponent {
|
|
714
|
+
authenticator;
|
|
715
|
+
dataAttr = '';
|
|
716
|
+
// translated texts
|
|
717
|
+
resendCodeText = getResendCodeText();
|
|
718
|
+
confirmText = getConfirmText$3();
|
|
719
|
+
sortedFormFields;
|
|
720
|
+
constructor(authenticator) {
|
|
721
|
+
this.authenticator = authenticator;
|
|
722
|
+
}
|
|
723
|
+
get context() {
|
|
724
|
+
return this.authenticator.slotContext;
|
|
725
|
+
}
|
|
726
|
+
get confirmSignUpHeading() {
|
|
727
|
+
const { codeDeliveryDetails } = this.authenticator;
|
|
728
|
+
return getDeliveryMethodText(codeDeliveryDetails);
|
|
729
|
+
}
|
|
730
|
+
get subtitleText() {
|
|
731
|
+
const { codeDeliveryDetails } = this.authenticator;
|
|
732
|
+
return getDeliveryMessageText(codeDeliveryDetails);
|
|
733
|
+
}
|
|
734
|
+
onInput(event) {
|
|
735
|
+
event.preventDefault();
|
|
736
|
+
const { name, value } = event.target;
|
|
737
|
+
this.authenticator.updateForm({ name, value });
|
|
738
|
+
}
|
|
739
|
+
onSubmit(event) {
|
|
740
|
+
event.preventDefault();
|
|
741
|
+
this.authenticator.submitForm(getFormDataFromEvent(event));
|
|
742
|
+
}
|
|
743
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ConfirmSignUpComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
744
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: ConfirmSignUpComponent, isStandalone: false, selector: "amplify-confirm-sign-up", host: { properties: { "attr.data-amplify-authenticator-confirmsignup": "this.dataAttr" } }, ngImport: i0, template: "<ng-container>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"context.isPending\"\n >\n <amplify-slot name=\"confirm-sign-up-header\" [context]=\"context\">\n <h3\n class=\"amplify-heading amplify-authenticator__heading\"\n style=\"font-size: 1.5rem\"\n >\n {{ confirmSignUpHeading }}\n </h3>\n </amplify-slot>\n <span class=\"amplify-authenticator__subtitle\">\n {{ subtitleText }}\n </span>\n <amplify-base-form-fields\n route=\"confirmSignUp\"\n ></amplify-base-form-fields>\n\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ confirmText }}\n </button>\n <button\n amplify-button\n fontWeight=\"normal\"\n (click)=\"authenticator.resendCode()\"\n >\n {{ resendCodeText }}\n </button>\n </fieldset>\n\n <amplify-error *ngIf=\"context.error\">\n {{ authenticator.error }}\n </amplify-error>\n <amplify-slot\n name=\"confirm-sign-up-footer\"\n [context]=\"context\"\n ></amplify-slot>\n </form>\n</ng-container>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { kind: "component", type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }, { kind: "component", type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { kind: "component", type: ErrorComponent, selector: "amplify-error" }] });
|
|
745
|
+
}
|
|
746
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ConfirmSignUpComponent, decorators: [{
|
|
747
|
+
type: Component,
|
|
748
|
+
args: [{ selector: 'amplify-confirm-sign-up', standalone: false, template: "<ng-container>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"context.isPending\"\n >\n <amplify-slot name=\"confirm-sign-up-header\" [context]=\"context\">\n <h3\n class=\"amplify-heading amplify-authenticator__heading\"\n style=\"font-size: 1.5rem\"\n >\n {{ confirmSignUpHeading }}\n </h3>\n </amplify-slot>\n <span class=\"amplify-authenticator__subtitle\">\n {{ subtitleText }}\n </span>\n <amplify-base-form-fields\n route=\"confirmSignUp\"\n ></amplify-base-form-fields>\n\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ confirmText }}\n </button>\n <button\n amplify-button\n fontWeight=\"normal\"\n (click)=\"authenticator.resendCode()\"\n >\n {{ resendCodeText }}\n </button>\n </fieldset>\n\n <amplify-error *ngIf=\"context.error\">\n {{ authenticator.error }}\n </amplify-error>\n <amplify-slot\n name=\"confirm-sign-up-footer\"\n [context]=\"context\"\n ></amplify-slot>\n </form>\n</ng-container>\n" }]
|
|
749
|
+
}], ctorParameters: () => [{ type: AuthenticatorService }], propDecorators: { dataAttr: [{
|
|
750
|
+
type: HostBinding,
|
|
751
|
+
args: ['attr.data-amplify-authenticator-confirmsignup']
|
|
752
|
+
}] } });
|
|
753
|
+
|
|
754
|
+
const { getAccountRecoveryInfoText: getAccountRecoveryInfoText$1, getSkipText: getSkipText$1, getSubmitText } = authenticatorTextUtil;
|
|
755
|
+
class ConfirmVerifyUserComponent {
|
|
756
|
+
authenticator;
|
|
757
|
+
dataAttr = '';
|
|
758
|
+
headerText = getAccountRecoveryInfoText$1();
|
|
759
|
+
// translated texts
|
|
760
|
+
skipText = getSkipText$1();
|
|
761
|
+
submitText = getSubmitText();
|
|
762
|
+
sortedFormFields;
|
|
763
|
+
constructor(authenticator) {
|
|
764
|
+
this.authenticator = authenticator;
|
|
765
|
+
}
|
|
766
|
+
get context() {
|
|
767
|
+
return this.authenticator.slotContext;
|
|
768
|
+
}
|
|
769
|
+
onInput(event) {
|
|
770
|
+
event.preventDefault();
|
|
771
|
+
const { name, value } = event.target;
|
|
772
|
+
this.authenticator.updateForm({ name, value });
|
|
773
|
+
}
|
|
774
|
+
onSubmit(event) {
|
|
775
|
+
event.preventDefault();
|
|
776
|
+
this.authenticator.submitForm(getFormDataFromEvent(event));
|
|
777
|
+
}
|
|
778
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ConfirmVerifyUserComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
779
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: ConfirmVerifyUserComponent, isStandalone: false, selector: "amplify-confirm-verify-user", inputs: { headerText: "headerText" }, host: { properties: { "attr.data-amplify-authenticator-confirmverifyuser": "this.dataAttr" } }, ngImport: i0, template: "<form data-amplify-form (input)=\"onInput($event)\" (submit)=\"onSubmit($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"confirm-verify-user-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n <amplify-base-form-fields\n route=\"confirmVerifyUser\"\n ></amplify-base-form-fields>\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ submitText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.skipVerification()\"\n >\n {{ skipText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"confirm-verify-user-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { kind: "component", type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }, { kind: "component", type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { kind: "component", type: ErrorComponent, selector: "amplify-error" }] });
|
|
780
|
+
}
|
|
781
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ConfirmVerifyUserComponent, decorators: [{
|
|
782
|
+
type: Component,
|
|
783
|
+
args: [{ selector: 'amplify-confirm-verify-user', standalone: false, template: "<form data-amplify-form (input)=\"onInput($event)\" (submit)=\"onSubmit($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"confirm-verify-user-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n <amplify-base-form-fields\n route=\"confirmVerifyUser\"\n ></amplify-base-form-fields>\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ submitText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.skipVerification()\"\n >\n {{ skipText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"confirm-verify-user-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n" }]
|
|
784
|
+
}], ctorParameters: () => [{ type: AuthenticatorService }], propDecorators: { dataAttr: [{
|
|
785
|
+
type: HostBinding,
|
|
786
|
+
args: ['attr.data-amplify-authenticator-confirmverifyuser']
|
|
787
|
+
}], headerText: [{
|
|
788
|
+
type: Input
|
|
789
|
+
}] } });
|
|
790
|
+
|
|
791
|
+
class ForceNewPasswordFormFieldsComponent {
|
|
792
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ForceNewPasswordFormFieldsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
793
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: ForceNewPasswordFormFieldsComponent, isStandalone: false, selector: "amplify-force-new-password-form-fields", ngImport: i0, template: "<div class=\"amplify-flex amplify-authenticator__column\" data-amplify-fieldset>\n <amplify-base-form-fields route=\"forceNewPassword\"></amplify-base-form-fields>\n</div>\n", dependencies: [{ kind: "component", type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }] });
|
|
794
|
+
}
|
|
795
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ForceNewPasswordFormFieldsComponent, decorators: [{
|
|
796
|
+
type: Component,
|
|
797
|
+
args: [{ selector: 'amplify-force-new-password-form-fields', standalone: false, template: "<div class=\"amplify-flex amplify-authenticator__column\" data-amplify-fieldset>\n <amplify-base-form-fields route=\"forceNewPassword\"></amplify-base-form-fields>\n</div>\n" }]
|
|
798
|
+
}] });
|
|
799
|
+
|
|
800
|
+
const { getChangePasswordText, getBackToSignInText: getBackToSignInText$4 } = authenticatorTextUtil;
|
|
801
|
+
class ForceNewPasswordComponent {
|
|
802
|
+
authenticator;
|
|
803
|
+
dataAttr = '';
|
|
804
|
+
headerText = getChangePasswordText();
|
|
805
|
+
// translated texts
|
|
806
|
+
changePasswordText = getChangePasswordText();
|
|
807
|
+
backToSignInText = getBackToSignInText$4();
|
|
808
|
+
constructor(authenticator) {
|
|
809
|
+
this.authenticator = authenticator;
|
|
810
|
+
}
|
|
811
|
+
get context() {
|
|
812
|
+
return this.authenticator.slotContext;
|
|
813
|
+
}
|
|
814
|
+
onInput(event) {
|
|
815
|
+
event.preventDefault();
|
|
816
|
+
const { name, value } = event.target;
|
|
817
|
+
this.authenticator.updateForm({ name, value });
|
|
818
|
+
}
|
|
819
|
+
onSubmit(event) {
|
|
820
|
+
event.preventDefault();
|
|
821
|
+
this.authenticator.submitForm(getFormDataFromEvent(event));
|
|
822
|
+
}
|
|
823
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ForceNewPasswordComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
824
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: ForceNewPasswordComponent, isStandalone: false, selector: "amplify-force-new-password", inputs: { headerText: "headerText" }, host: { properties: { "attr.data-amplify-authenticator-forcenewpassword": "this.dataAttr" } }, ngImport: i0, template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"force-new-password-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n\n <amplify-slot name=\"force-new-form-fields\" [context]=\"context\">\n <amplify-force-new-password-form-fields></amplify-force-new-password-form-fields>\n </amplify-slot>\n\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ changePasswordText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"force-new-password-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { kind: "component", type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { kind: "component", type: ErrorComponent, selector: "amplify-error" }, { kind: "component", type: ForceNewPasswordFormFieldsComponent, selector: "amplify-force-new-password-form-fields" }] });
|
|
825
|
+
}
|
|
826
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ForceNewPasswordComponent, decorators: [{
|
|
827
|
+
type: Component,
|
|
828
|
+
args: [{ selector: 'amplify-force-new-password', standalone: false, template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"force-new-password-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n\n <amplify-slot name=\"force-new-form-fields\" [context]=\"context\">\n <amplify-force-new-password-form-fields></amplify-force-new-password-form-fields>\n </amplify-slot>\n\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ changePasswordText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"force-new-password-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n" }]
|
|
829
|
+
}], ctorParameters: () => [{ type: AuthenticatorService }], propDecorators: { dataAttr: [{
|
|
830
|
+
type: HostBinding,
|
|
831
|
+
args: ['attr.data-amplify-authenticator-forcenewpassword']
|
|
832
|
+
}], headerText: [{
|
|
833
|
+
type: Input
|
|
834
|
+
}] } });
|
|
835
|
+
|
|
836
|
+
const { getResetYourPasswordText, getSendCodeText, getBackToSignInText: getBackToSignInText$3 } = authenticatorTextUtil;
|
|
837
|
+
class ForgotPasswordComponent {
|
|
838
|
+
authenticator;
|
|
839
|
+
dataAttr = '';
|
|
840
|
+
headerText = getResetYourPasswordText();
|
|
841
|
+
// translated texts
|
|
842
|
+
sendCodeText = getSendCodeText();
|
|
843
|
+
backToSignInText = getBackToSignInText$3();
|
|
844
|
+
sortedFormFields;
|
|
845
|
+
constructor(authenticator) {
|
|
846
|
+
this.authenticator = authenticator;
|
|
847
|
+
}
|
|
848
|
+
get context() {
|
|
849
|
+
return this.authenticator.slotContext;
|
|
850
|
+
}
|
|
851
|
+
onInput(event) {
|
|
852
|
+
event.preventDefault();
|
|
853
|
+
const { name, value } = event.target;
|
|
854
|
+
this.authenticator.updateForm({ name, value });
|
|
855
|
+
}
|
|
856
|
+
onSubmit(event) {
|
|
857
|
+
event.preventDefault();
|
|
858
|
+
this.authenticator.submitForm(getFormDataFromEvent(event));
|
|
859
|
+
}
|
|
860
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ForgotPasswordComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
861
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: ForgotPasswordComponent, isStandalone: false, selector: "amplify-forgot-password", inputs: { headerText: "headerText" }, host: { properties: { "attr.data-amplify-authenticator-forgotpassword": "this.dataAttr" } }, ngImport: i0, template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot\n class=\"amplify-flex\"\n name=\"forgot-password-header\"\n [context]=\"context\"\n >\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n\n <amplify-base-form-fields route=\"forgotPassword\"></amplify-base-form-fields>\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ sendCodeText }}\n </button>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n\n <amplify-slot name=\"forgot-password-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { kind: "component", type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }, { kind: "component", type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { kind: "component", type: ErrorComponent, selector: "amplify-error" }] });
|
|
862
|
+
}
|
|
863
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: ForgotPasswordComponent, decorators: [{
|
|
864
|
+
type: Component,
|
|
865
|
+
args: [{ selector: 'amplify-forgot-password', standalone: false, template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot\n class=\"amplify-flex\"\n name=\"forgot-password-header\"\n [context]=\"context\"\n >\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n\n <amplify-base-form-fields route=\"forgotPassword\"></amplify-base-form-fields>\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ sendCodeText }}\n </button>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n\n <amplify-slot name=\"forgot-password-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n" }]
|
|
866
|
+
}], ctorParameters: () => [{ type: AuthenticatorService }], propDecorators: { dataAttr: [{
|
|
867
|
+
type: HostBinding,
|
|
868
|
+
args: ['attr.data-amplify-authenticator-forgotpassword']
|
|
869
|
+
}], headerText: [{
|
|
870
|
+
type: Input
|
|
871
|
+
}] } });
|
|
872
|
+
|
|
873
|
+
const { getConfirmText: getConfirmText$2, getBackToSignInText: getBackToSignInText$2, getSelectMfaTypeText, getSelectMfaTypeByChallengeName, getMfaTypeLabelByValue, } = authenticatorTextUtil;
|
|
874
|
+
class SelectMfaTypeComponent {
|
|
875
|
+
authenticator;
|
|
876
|
+
headerText;
|
|
877
|
+
confirmText = getConfirmText$2();
|
|
878
|
+
backToSignInText = getBackToSignInText$2();
|
|
879
|
+
selectMfaTypeText = getSelectMfaTypeText();
|
|
880
|
+
getMfaTypeLabelByValue = getMfaTypeLabelByValue;
|
|
881
|
+
allowedMfaTypes = [];
|
|
882
|
+
classNames = classNames;
|
|
883
|
+
ComponentClassName = ComponentClassName;
|
|
884
|
+
constructor(authenticator) {
|
|
885
|
+
this.authenticator = authenticator;
|
|
886
|
+
}
|
|
887
|
+
get context() {
|
|
888
|
+
return this.authenticator.slotContext;
|
|
889
|
+
}
|
|
890
|
+
ngOnInit() {
|
|
891
|
+
this.setHeaderText();
|
|
892
|
+
this.setAllowedMfaTypes();
|
|
893
|
+
}
|
|
894
|
+
setHeaderText() {
|
|
895
|
+
const actorContext = getActorContext(this.authenticator.authState);
|
|
896
|
+
this.headerText = getSelectMfaTypeByChallengeName(actorContext.challengeName);
|
|
897
|
+
}
|
|
898
|
+
setAllowedMfaTypes() {
|
|
899
|
+
const actorContext = getActorContext(this.authenticator.authState);
|
|
900
|
+
this.allowedMfaTypes = actorContext.allowedMfaTypes;
|
|
901
|
+
}
|
|
902
|
+
onInput(event) {
|
|
903
|
+
event.preventDefault();
|
|
904
|
+
const { name, value } = event.target;
|
|
905
|
+
this.authenticator.updateForm({ name, value });
|
|
906
|
+
}
|
|
907
|
+
onSubmit(event) {
|
|
908
|
+
event.preventDefault();
|
|
909
|
+
this.authenticator.submitForm(getFormDataFromEvent(event));
|
|
910
|
+
}
|
|
911
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: SelectMfaTypeComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
912
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: SelectMfaTypeComponent, isStandalone: false, selector: "amplify-select-mfa-type", ngImport: i0, template: "<form\n data-amplify-form\n data-amplify-authenticator-select-mfa-type\n (submit)=\"onSubmit($event)\"\n (input)=\"onInput($event)\"\n>\n <fieldset\n [class]=\"classNames(ComponentClassName.Flex, 'amplify-authenticator__column')\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot\n name=\"select-mfa-type-header\"\n [context]=\"context\"\n >\n <h3 [class]=\"classNames(ComponentClassName.Heading, 'amplify-heading--3')\">{{ headerText }}</h3>\n </amplify-slot>\n <div\n *ngFor=\"let mfaType of allowedMfaTypes; index as i\"\n [class]=\"classNames(ComponentClassName.Flex, ComponentClassName.Field, ComponentClassName.RadioGroupField)\"\n role=\"radiogroup\"\n >\n <label\n [class]=\"classNames(ComponentClassName.Flex, ComponentClassName.Radio)\"\n [attr.data-amplify-radio-control-label]\n >\n <span [class]=\"classNames(ComponentClassName.Text, ComponentClassName.RadioLabel)\">\n {{getMfaTypeLabelByValue(mfaType)}}\n </span>\n <input\n [class]=\"classNames(ComponentClassName.Input, ComponentClassName.FieldGroupControl, ComponentClassName.VisuallyHidden, ComponentClassName.RadioInput)\"\n [attr.data-amplify-radio-control-input]\n [value]=\"mfaType\"\n [checked]=\"i === 0\"\n name=\"mfa_type\"\n type=\"radio\"\n required\n />\n <span\n [class]=\"classNames(ComponentClassName.Flex, ComponentClassName.RadioButton)\"\n [attr.aria-hidden]=\"true\"\n ></span>\n </label>\n </div>\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ confirmText }}\n </button>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot\n name=\"select-mfa-type-footer\"\n [context]=\"context\"\n ></amplify-slot>\n</form>", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { kind: "component", type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { kind: "component", type: ErrorComponent, selector: "amplify-error" }] });
|
|
913
|
+
}
|
|
914
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: SelectMfaTypeComponent, decorators: [{
|
|
915
|
+
type: Component,
|
|
916
|
+
args: [{ selector: 'amplify-select-mfa-type', standalone: false, template: "<form\n data-amplify-form\n data-amplify-authenticator-select-mfa-type\n (submit)=\"onSubmit($event)\"\n (input)=\"onInput($event)\"\n>\n <fieldset\n [class]=\"classNames(ComponentClassName.Flex, 'amplify-authenticator__column')\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot\n name=\"select-mfa-type-header\"\n [context]=\"context\"\n >\n <h3 [class]=\"classNames(ComponentClassName.Heading, 'amplify-heading--3')\">{{ headerText }}</h3>\n </amplify-slot>\n <div\n *ngFor=\"let mfaType of allowedMfaTypes; index as i\"\n [class]=\"classNames(ComponentClassName.Flex, ComponentClassName.Field, ComponentClassName.RadioGroupField)\"\n role=\"radiogroup\"\n >\n <label\n [class]=\"classNames(ComponentClassName.Flex, ComponentClassName.Radio)\"\n [attr.data-amplify-radio-control-label]\n >\n <span [class]=\"classNames(ComponentClassName.Text, ComponentClassName.RadioLabel)\">\n {{getMfaTypeLabelByValue(mfaType)}}\n </span>\n <input\n [class]=\"classNames(ComponentClassName.Input, ComponentClassName.FieldGroupControl, ComponentClassName.VisuallyHidden, ComponentClassName.RadioInput)\"\n [attr.data-amplify-radio-control-input]\n [value]=\"mfaType\"\n [checked]=\"i === 0\"\n name=\"mfa_type\"\n type=\"radio\"\n required\n />\n <span\n [class]=\"classNames(ComponentClassName.Flex, ComponentClassName.RadioButton)\"\n [attr.aria-hidden]=\"true\"\n ></span>\n </label>\n </div>\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ confirmText }}\n </button>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot\n name=\"select-mfa-type-footer\"\n [context]=\"context\"\n ></amplify-slot>\n</form>" }]
|
|
917
|
+
}], ctorParameters: () => [{ type: AuthenticatorService }] });
|
|
918
|
+
|
|
919
|
+
const { getConfirmText: getConfirmText$1, getBackToSignInText: getBackToSignInText$1, getSetupEmailText } = authenticatorTextUtil;
|
|
920
|
+
class SetupEmailComponent {
|
|
921
|
+
authenticator;
|
|
922
|
+
headerText = getSetupEmailText();
|
|
923
|
+
confirmText = getConfirmText$1();
|
|
924
|
+
backToSignInText = getBackToSignInText$1();
|
|
925
|
+
classNames = classNames;
|
|
926
|
+
ComponentClassName = ComponentClassName;
|
|
927
|
+
constructor(authenticator) {
|
|
928
|
+
this.authenticator = authenticator;
|
|
929
|
+
}
|
|
930
|
+
get context() {
|
|
931
|
+
return this.authenticator.slotContext;
|
|
932
|
+
}
|
|
933
|
+
onInput(event) {
|
|
934
|
+
event.preventDefault();
|
|
935
|
+
const { name, value } = event.target;
|
|
936
|
+
this.authenticator.updateForm({ name, value });
|
|
937
|
+
}
|
|
938
|
+
onSubmit(event) {
|
|
939
|
+
event.preventDefault();
|
|
940
|
+
this.authenticator.submitForm(getFormDataFromEvent(event));
|
|
941
|
+
}
|
|
942
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: SetupEmailComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
943
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: SetupEmailComponent, isStandalone: false, selector: "amplify-setup-email", ngImport: i0, template: "<form\n data-amplify-form\n data-amplify-authenticator-setup-email\n (submit)=\"onSubmit($event)\"\n (input)=\"onInput($event)\"\n>\n <fieldset\n [class]=\"classNames(ComponentClassName.Flex, 'amplify-authenticator__column')\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot\n name=\"setup-email-header\"\n [context]=\"context\"\n >\n <h3 [class]=\"classNames(ComponentClassName.Heading, 'amplify-heading--3')\">{{ headerText }}</h3>\n </amplify-slot>\n <amplify-base-form-fields route=\"setupEmail\"></amplify-base-form-fields>\n\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ confirmText }}\n </button>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot\n name=\"setup-email-footer\"\n [context]=\"context\"\n ></amplify-slot>\n</form>", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { kind: "component", type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }, { kind: "component", type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { kind: "component", type: ErrorComponent, selector: "amplify-error" }] });
|
|
944
|
+
}
|
|
945
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: SetupEmailComponent, decorators: [{
|
|
946
|
+
type: Component,
|
|
947
|
+
args: [{ selector: 'amplify-setup-email', standalone: false, template: "<form\n data-amplify-form\n data-amplify-authenticator-setup-email\n (submit)=\"onSubmit($event)\"\n (input)=\"onInput($event)\"\n>\n <fieldset\n [class]=\"classNames(ComponentClassName.Flex, 'amplify-authenticator__column')\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot\n name=\"setup-email-header\"\n [context]=\"context\"\n >\n <h3 [class]=\"classNames(ComponentClassName.Heading, 'amplify-heading--3')\">{{ headerText }}</h3>\n </amplify-slot>\n <amplify-base-form-fields route=\"setupEmail\"></amplify-base-form-fields>\n\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ confirmText }}\n </button>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot\n name=\"setup-email-footer\"\n [context]=\"context\"\n ></amplify-slot>\n</form>" }]
|
|
948
|
+
}], ctorParameters: () => [{ type: AuthenticatorService }] });
|
|
949
|
+
|
|
950
|
+
const logger = new ConsoleLogger('SetupTotp');
|
|
951
|
+
const { getSetupTotpText, getCopyText, getBackToSignInText, getConfirmText, getCopiedText, } = authenticatorTextUtil;
|
|
952
|
+
class SetupTotpComponent {
|
|
953
|
+
authenticator;
|
|
954
|
+
dataAttr = '';
|
|
955
|
+
headerText = getSetupTotpText();
|
|
956
|
+
qrCodeSource = '';
|
|
957
|
+
totpSecretCode = '';
|
|
958
|
+
copyTextLabel = getCopyText();
|
|
959
|
+
// translated texts
|
|
960
|
+
backToSignInText = getBackToSignInText();
|
|
961
|
+
confirmText = getConfirmText();
|
|
962
|
+
sortedFormFields;
|
|
963
|
+
constructor(authenticator) {
|
|
964
|
+
this.authenticator = authenticator;
|
|
965
|
+
}
|
|
966
|
+
get context() {
|
|
967
|
+
return this.authenticator.slotContext;
|
|
968
|
+
}
|
|
969
|
+
async ngOnInit() {
|
|
970
|
+
await this.generateQRCode();
|
|
971
|
+
}
|
|
972
|
+
async generateQRCode() {
|
|
973
|
+
const { authState: state, totpSecretCode, username } = this.authenticator;
|
|
974
|
+
const { formFields } = getActorContext(state);
|
|
975
|
+
const { totpIssuer = 'AWSCognito', totpUsername = username } = formFields?.setupTotp?.QR ?? {};
|
|
976
|
+
this.totpSecretCode = totpSecretCode;
|
|
977
|
+
try {
|
|
978
|
+
const totpCode = getTotpCodeURL(totpIssuer, totpUsername, this.totpSecretCode);
|
|
979
|
+
logger.info('totp code was generated:', totpCode);
|
|
980
|
+
this.qrCodeSource = await QRCode.toDataURL(totpCode);
|
|
981
|
+
}
|
|
982
|
+
catch (err) {
|
|
983
|
+
logger.error(err);
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
onInput(event) {
|
|
987
|
+
event.preventDefault();
|
|
988
|
+
const { name, value } = event.target;
|
|
989
|
+
this.authenticator.updateForm({ name, value });
|
|
990
|
+
}
|
|
991
|
+
onSubmit(event) {
|
|
992
|
+
event.preventDefault();
|
|
993
|
+
this.authenticator.submitForm(getFormDataFromEvent(event));
|
|
994
|
+
}
|
|
995
|
+
copyText() {
|
|
996
|
+
navigator.clipboard.writeText(this.totpSecretCode);
|
|
997
|
+
this.copyTextLabel = getCopiedText();
|
|
998
|
+
}
|
|
999
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: SetupTotpComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1000
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: SetupTotpComponent, isStandalone: false, selector: "amplify-setup-totp", host: { properties: { "attr.data-amplify-authenticator-setup-totp": "this.dataAttr" } }, ngImport: i0, template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"setup-totp-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n <p *ngIf=\"!qrCodeSource\">Loading...</p>\n <img\n *ngIf=\"qrCodeSource\"\n [src]=\"qrCodeSource\"\n alt=\"qr code\"\n data-amplify-qrcode\n width=\"228\"\n height=\"228\"\n />\n <div class=\"amplify-flex\" data-amplify-copy>\n <div>{{ totpSecretCode }}</div>\n <div data-amplify-copy-svg (click)=\"copyText()\">\n <div data-amplify-copy-tooltip>{{ copyTextLabel }}</div>\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM15 5H8C6.9 5 6.01 5.9 6.01 7L6 21C6 22.1 6.89 23 7.99 23H19C20.1 23 21 22.1 21 21V11L15 5ZM8 21V7H14V12H19V21H8Z\"\n />\n </svg>\n </div>\n </div>\n\n <amplify-base-form-fields route=\"setupTotp\"></amplify-base-form-fields>\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ confirmText }}\n </button>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"setup-totp-footer\" [context]=\"context\"> </amplify-slot>\n</form>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { kind: "component", type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }, { kind: "component", type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { kind: "component", type: ErrorComponent, selector: "amplify-error" }] });
|
|
1001
|
+
}
|
|
1002
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: SetupTotpComponent, decorators: [{
|
|
1003
|
+
type: Component,
|
|
1004
|
+
args: [{ selector: 'amplify-setup-totp', standalone: false, template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"setup-totp-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n <p *ngIf=\"!qrCodeSource\">Loading...</p>\n <img\n *ngIf=\"qrCodeSource\"\n [src]=\"qrCodeSource\"\n alt=\"qr code\"\n data-amplify-qrcode\n width=\"228\"\n height=\"228\"\n />\n <div class=\"amplify-flex\" data-amplify-copy>\n <div>{{ totpSecretCode }}</div>\n <div data-amplify-copy-svg (click)=\"copyText()\">\n <div data-amplify-copy-tooltip>{{ copyTextLabel }}</div>\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM15 5H8C6.9 5 6.01 5.9 6.01 7L6 21C6 22.1 6.89 23 7.99 23H19C20.1 23 21 22.1 21 21V11L15 5ZM8 21V7H14V12H19V21H8Z\"\n />\n </svg>\n </div>\n </div>\n\n <amplify-base-form-fields route=\"setupTotp\"></amplify-base-form-fields>\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ confirmText }}\n </button>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"setup-totp-footer\" [context]=\"context\"> </amplify-slot>\n</form>\n" }]
|
|
1005
|
+
}], ctorParameters: () => [{ type: AuthenticatorService }], propDecorators: { dataAttr: [{
|
|
1006
|
+
type: HostBinding,
|
|
1007
|
+
args: ['attr.data-amplify-authenticator-setup-totp']
|
|
1008
|
+
}] } });
|
|
1009
|
+
|
|
1010
|
+
class FederatedSignInButtonComponent {
|
|
1011
|
+
authenticator;
|
|
1012
|
+
provider;
|
|
1013
|
+
text;
|
|
1014
|
+
constructor(authenticator) {
|
|
1015
|
+
this.authenticator = authenticator;
|
|
1016
|
+
}
|
|
1017
|
+
onClick = () => {
|
|
1018
|
+
this.authenticator.send({
|
|
1019
|
+
type: 'FEDERATED_SIGN_IN',
|
|
1020
|
+
data: { provider: this.provider },
|
|
1021
|
+
});
|
|
1022
|
+
};
|
|
1023
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: FederatedSignInButtonComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1024
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: FederatedSignInButtonComponent, isStandalone: false, selector: "amplify-federated-sign-in-button", inputs: { provider: "provider", text: "text" }, ngImport: i0, template: "<button\n amplify-button\n class=\"amplify-field-group__control federated-sign-in-button\"\n fullWidth=\"true\"\n fontWeight=\"normal\"\n (click)=\"onClick()\"\n>\n <div class=\"amplify-flex federated-sign-in-button-row\">\n <ng-content></ng-content>\n </div>\n</button>\n", dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }] });
|
|
1025
|
+
}
|
|
1026
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: FederatedSignInButtonComponent, decorators: [{
|
|
1027
|
+
type: Component,
|
|
1028
|
+
args: [{ selector: 'amplify-federated-sign-in-button', standalone: false, template: "<button\n amplify-button\n class=\"amplify-field-group__control federated-sign-in-button\"\n fullWidth=\"true\"\n fontWeight=\"normal\"\n (click)=\"onClick()\"\n>\n <div class=\"amplify-flex federated-sign-in-button-row\">\n <ng-content></ng-content>\n </div>\n</button>\n" }]
|
|
1029
|
+
}], ctorParameters: () => [{ type: AuthenticatorService }], propDecorators: { provider: [{
|
|
1030
|
+
type: Input
|
|
1031
|
+
}], text: [{
|
|
1032
|
+
type: Input
|
|
1033
|
+
}] } });
|
|
1034
|
+
|
|
1035
|
+
const { getSignInWithFederationText, getOrText } = authenticatorTextUtil;
|
|
1036
|
+
class FederatedSignInComponent {
|
|
1037
|
+
authenticator;
|
|
1038
|
+
FederatedProviders = FederatedIdentityProviders;
|
|
1039
|
+
includeAmazon = false;
|
|
1040
|
+
includeApple = false;
|
|
1041
|
+
includeFacebook = false;
|
|
1042
|
+
includeGoogle = false;
|
|
1043
|
+
shouldShowFederatedSignIn = false;
|
|
1044
|
+
// translated texts
|
|
1045
|
+
orText;
|
|
1046
|
+
signInAmazonText;
|
|
1047
|
+
signInAppleText;
|
|
1048
|
+
signInFacebookText;
|
|
1049
|
+
signInGoogleText;
|
|
1050
|
+
constructor(authenticator) {
|
|
1051
|
+
this.authenticator = authenticator;
|
|
1052
|
+
}
|
|
1053
|
+
ngOnInit() {
|
|
1054
|
+
const socialProviders = this.authenticator.context?.config?.socialProviders;
|
|
1055
|
+
this.setFederatedTexts();
|
|
1056
|
+
this.includeAmazon = socialProviders?.includes('amazon');
|
|
1057
|
+
this.includeApple = socialProviders?.includes('apple');
|
|
1058
|
+
this.includeGoogle = socialProviders?.includes('google');
|
|
1059
|
+
this.includeFacebook = socialProviders?.includes('facebook');
|
|
1060
|
+
this.shouldShowFederatedSignIn =
|
|
1061
|
+
this.includeAmazon ||
|
|
1062
|
+
this.includeApple ||
|
|
1063
|
+
this.includeFacebook ||
|
|
1064
|
+
this.includeGoogle;
|
|
1065
|
+
}
|
|
1066
|
+
setFederatedTexts() {
|
|
1067
|
+
const { route } = this.authenticator;
|
|
1068
|
+
this.orText = getOrText();
|
|
1069
|
+
this.signInAmazonText = getSignInWithFederationText(route, 'amazon');
|
|
1070
|
+
this.signInAppleText = getSignInWithFederationText(route, 'apple');
|
|
1071
|
+
this.signInFacebookText = getSignInWithFederationText(route, 'facebook');
|
|
1072
|
+
this.signInGoogleText = getSignInWithFederationText(route, 'google');
|
|
1073
|
+
}
|
|
1074
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: FederatedSignInComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1075
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: FederatedSignInComponent, isStandalone: false, selector: "amplify-federated-sign-in", ngImport: i0, template: "<div\n class=\"amplify-flex federated-sign-in-container\"\n *ngIf=\"shouldShowFederatedSignIn\"\n data-orientation=\"horizontal\"\n data-size=\"small\"\n>\n <amplify-federated-sign-in-button\n *ngIf=\"includeAmazon\"\n [text]=\"signInAmazonText\"\n [provider]=\"FederatedProviders.Amazon\"\n >\n <svg\n aria-label=\"Amazon icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 248 268\"\n >\n <path\n d=\"M139.056521,147.024612 C133.548808,156.744524 124.782731,162.726926 115.087401,162.726926 C101.790721,162.726926 93.9937779,152.612964 93.9937779,137.68681 C93.9937779,108.224571 120.447551,102.879017 145.533369,102.879017 L145.533369,110.365976 C145.533369,123.831358 145.876354,135.063787 139.056521,147.024612 M207.206992,162.579655 C209.400505,165.692256 209.887066,169.437725 207.063416,171.770186 C199.996315,177.653081 187.429476,188.590967 180.513926,194.716661 L180.46208,194.621133 C178.176838,196.663031 174.862638,196.810303 172.27828,195.445057 C160.780281,185.9162 158.686473,181.494078 152.405048,172.403055 C133.405233,191.751331 119.909143,197.534719 95.309886,197.534719 C66.1281801,197.534719 43.4791563,179.599451 43.4791563,143.669212 C43.4791563,115.616003 58.6782107,96.5105248 80.4019706,87.1727225 C99.2063636,78.9096034 125.464714,77.4528107 145.533369,75.1641337 L145.533369,70.694248 C145.533369,62.4749122 146.167493,52.7510201 141.297893,45.6541312 C137.110277,39.2856386 129.018206,36.6586354 121.859376,36.6586354 C108.658413,36.6586354 96.9171331,43.4171982 94.0416364,57.4199213 C93.4593582,60.532522 91.1701278,63.5933787 88.003492,63.7406501 L54.4387473,60.1424518 C51.6150972,59.5095829 48.4484614,57.2248862 49.2740201,52.8982915 C56.9712583,12.2553679 93.7983558,0 126.732964,0 C143.587124,0 165.606011,4.47386604 178.902691,17.2148315 C195.760839,32.917146 194.149604,53.8694866 194.149604,76.6726704 L194.149604,130.542157 C194.149604,146.734049 200.87372,153.830938 207.206992,162.579655 Z M233.826346,208.038962 C230.467669,203.683255 211.550709,205.9821 203.056405,206.998432 C200.470662,207.321077 200.076227,205.042397 202.406981,203.404973 C217.475208,192.664928 242.201125,195.766353 245.081698,199.363845 C247.966255,202.981502 244.336653,228.071183 230.172839,240.049379 C228.001452,241.888455 225.929671,240.904388 226.89783,238.468418 C230.077218,230.430525 237.204944,212.418868 233.826346,208.038962 Z M126.768855,264 C74.0234043,264 42.0764048,241.955028 17.7852554,217.541992 C12.9733903,212.705982 6.71799208,206.295994 3.31151296,200.690918 C1.90227474,198.372135 5.59096074,195.021875 8.0442063,196.84375 C38.2390146,219.267578 82.1011654,239.538304 125.529506,239.538304 C154.819967,239.538304 191.046475,227.469543 220.66851,214.867659 C225.146771,212.966167 225.146771,219.180222 224.511585,221.060516 C224.183264,222.03242 209.514625,236.221149 189.247207,247.047411 C170.304273,257.166172 146.397132,264 126.768855,264 Z\"\n fill=\"#FF9900\"\n ></path>\n </svg>\n\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInAmazonText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeApple\"\n [provider]=\"FederatedProviders.Apple\"\n >\n <svg\n aria-label=\"Apple icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n fill=\"#000\"\n preserveAspectRatio=\"xMidYMid\"\n stroke=\"#000\"\n strokeWidth=\"0\"\n viewBox=\"0 0 1024 1024\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M747.4 535.7c-.4-68.2 30.5-119.6 92.9-157.5-34.9-50-87.7-77.5-157.3-82.8-65.9-5.2-138 38.4-164.4 38.4-27.9 0-91.7-36.6-141.9-36.6C273.1 298.8 163 379.8 163 544.6c0 48.7 8.9 99 26.7 150.8 23.8 68.2 109.6 235.3 199.1 232.6 46.8-1.1 79.9-33.2 140.8-33.2 59.1 0 89.7 33.2 141.9 33.2 90.3-1.3 167.9-153.2 190.5-221.6-121.1-57.1-114.6-167.2-114.6-170.7zm-105.1-305c50.7-60.2 46.1-115 44.6-134.7-44.8 2.6-96.6 30.5-126.1 64.8-32.5 36.8-51.6 82.3-47.5 133.6 48.4 3.7 92.6-21.2 129-63.7z\"\n ></path>\n </svg>\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInAppleText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeFacebook\"\n [text]=\"signInFacebookText\"\n [provider]=\"FederatedProviders.Facebook\"\n >\n <svg\n aria-label=\"Facebook icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 279 538\"\n >\n <path\n d=\"M82.3409742,538 L82.3409742,292.936652 L0,292.936652 L0,196.990154 L82.2410458,196.990154 L82.2410458,126.4295 C82.2410458,44.575144 132.205229,0 205.252865,0 C240.227794,0 270.306232,2.59855099 279,3.79788222 L279,89.2502322 L228.536175,89.2502322 C188.964542,89.2502322 181.270057,108.139699 181.270057,135.824262 L181.270057,196.89021 L276.202006,196.89021 L263.810888,292.836708 L181.16913,292.836708 L181.16913,538 L82.3409742,538 Z\"\n fill=\"#1877F2\"\n ></path>\n </svg>\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInFacebookText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeGoogle\"\n [provider]=\"FederatedProviders.Google\"\n >\n <svg\n aria-label=\"Google icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 256 262\"\n xmlns=\"http://www.w3.org/2000/svg\"\n preserveAspectRatio=\"xMidYMid\"\n >\n <path\n d=\"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027\"\n fill=\"#4285F4\"\n ></path>\n <path\n d=\"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1\"\n fill=\"#34A853\"\n ></path>\n <path\n d=\"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782\"\n fill=\"#FBBC05\"\n ></path>\n <path\n d=\"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251\"\n fill=\"#EB4335\"\n ></path>\n </svg>\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInGoogleText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <hr\n class=\"amplify-divider amplify-divider--label amplify-divider--small\"\n aria-orientation=\"horizontal\"\n data-size=\"small\"\n [attr.data-label]=\"orText\"\n />\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: FederatedSignInButtonComponent, selector: "amplify-federated-sign-in-button", inputs: ["provider", "text"] }] });
|
|
1076
|
+
}
|
|
1077
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: FederatedSignInComponent, decorators: [{
|
|
1078
|
+
type: Component,
|
|
1079
|
+
args: [{ selector: 'amplify-federated-sign-in', standalone: false, template: "<div\n class=\"amplify-flex federated-sign-in-container\"\n *ngIf=\"shouldShowFederatedSignIn\"\n data-orientation=\"horizontal\"\n data-size=\"small\"\n>\n <amplify-federated-sign-in-button\n *ngIf=\"includeAmazon\"\n [text]=\"signInAmazonText\"\n [provider]=\"FederatedProviders.Amazon\"\n >\n <svg\n aria-label=\"Amazon icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 248 268\"\n >\n <path\n d=\"M139.056521,147.024612 C133.548808,156.744524 124.782731,162.726926 115.087401,162.726926 C101.790721,162.726926 93.9937779,152.612964 93.9937779,137.68681 C93.9937779,108.224571 120.447551,102.879017 145.533369,102.879017 L145.533369,110.365976 C145.533369,123.831358 145.876354,135.063787 139.056521,147.024612 M207.206992,162.579655 C209.400505,165.692256 209.887066,169.437725 207.063416,171.770186 C199.996315,177.653081 187.429476,188.590967 180.513926,194.716661 L180.46208,194.621133 C178.176838,196.663031 174.862638,196.810303 172.27828,195.445057 C160.780281,185.9162 158.686473,181.494078 152.405048,172.403055 C133.405233,191.751331 119.909143,197.534719 95.309886,197.534719 C66.1281801,197.534719 43.4791563,179.599451 43.4791563,143.669212 C43.4791563,115.616003 58.6782107,96.5105248 80.4019706,87.1727225 C99.2063636,78.9096034 125.464714,77.4528107 145.533369,75.1641337 L145.533369,70.694248 C145.533369,62.4749122 146.167493,52.7510201 141.297893,45.6541312 C137.110277,39.2856386 129.018206,36.6586354 121.859376,36.6586354 C108.658413,36.6586354 96.9171331,43.4171982 94.0416364,57.4199213 C93.4593582,60.532522 91.1701278,63.5933787 88.003492,63.7406501 L54.4387473,60.1424518 C51.6150972,59.5095829 48.4484614,57.2248862 49.2740201,52.8982915 C56.9712583,12.2553679 93.7983558,0 126.732964,0 C143.587124,0 165.606011,4.47386604 178.902691,17.2148315 C195.760839,32.917146 194.149604,53.8694866 194.149604,76.6726704 L194.149604,130.542157 C194.149604,146.734049 200.87372,153.830938 207.206992,162.579655 Z M233.826346,208.038962 C230.467669,203.683255 211.550709,205.9821 203.056405,206.998432 C200.470662,207.321077 200.076227,205.042397 202.406981,203.404973 C217.475208,192.664928 242.201125,195.766353 245.081698,199.363845 C247.966255,202.981502 244.336653,228.071183 230.172839,240.049379 C228.001452,241.888455 225.929671,240.904388 226.89783,238.468418 C230.077218,230.430525 237.204944,212.418868 233.826346,208.038962 Z M126.768855,264 C74.0234043,264 42.0764048,241.955028 17.7852554,217.541992 C12.9733903,212.705982 6.71799208,206.295994 3.31151296,200.690918 C1.90227474,198.372135 5.59096074,195.021875 8.0442063,196.84375 C38.2390146,219.267578 82.1011654,239.538304 125.529506,239.538304 C154.819967,239.538304 191.046475,227.469543 220.66851,214.867659 C225.146771,212.966167 225.146771,219.180222 224.511585,221.060516 C224.183264,222.03242 209.514625,236.221149 189.247207,247.047411 C170.304273,257.166172 146.397132,264 126.768855,264 Z\"\n fill=\"#FF9900\"\n ></path>\n </svg>\n\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInAmazonText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeApple\"\n [provider]=\"FederatedProviders.Apple\"\n >\n <svg\n aria-label=\"Apple icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n fill=\"#000\"\n preserveAspectRatio=\"xMidYMid\"\n stroke=\"#000\"\n strokeWidth=\"0\"\n viewBox=\"0 0 1024 1024\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M747.4 535.7c-.4-68.2 30.5-119.6 92.9-157.5-34.9-50-87.7-77.5-157.3-82.8-65.9-5.2-138 38.4-164.4 38.4-27.9 0-91.7-36.6-141.9-36.6C273.1 298.8 163 379.8 163 544.6c0 48.7 8.9 99 26.7 150.8 23.8 68.2 109.6 235.3 199.1 232.6 46.8-1.1 79.9-33.2 140.8-33.2 59.1 0 89.7 33.2 141.9 33.2 90.3-1.3 167.9-153.2 190.5-221.6-121.1-57.1-114.6-167.2-114.6-170.7zm-105.1-305c50.7-60.2 46.1-115 44.6-134.7-44.8 2.6-96.6 30.5-126.1 64.8-32.5 36.8-51.6 82.3-47.5 133.6 48.4 3.7 92.6-21.2 129-63.7z\"\n ></path>\n </svg>\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInAppleText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeFacebook\"\n [text]=\"signInFacebookText\"\n [provider]=\"FederatedProviders.Facebook\"\n >\n <svg\n aria-label=\"Facebook icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 279 538\"\n >\n <path\n d=\"M82.3409742,538 L82.3409742,292.936652 L0,292.936652 L0,196.990154 L82.2410458,196.990154 L82.2410458,126.4295 C82.2410458,44.575144 132.205229,0 205.252865,0 C240.227794,0 270.306232,2.59855099 279,3.79788222 L279,89.2502322 L228.536175,89.2502322 C188.964542,89.2502322 181.270057,108.139699 181.270057,135.824262 L181.270057,196.89021 L276.202006,196.89021 L263.810888,292.836708 L181.16913,292.836708 L181.16913,538 L82.3409742,538 Z\"\n fill=\"#1877F2\"\n ></path>\n </svg>\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInFacebookText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeGoogle\"\n [provider]=\"FederatedProviders.Google\"\n >\n <svg\n aria-label=\"Google icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 256 262\"\n xmlns=\"http://www.w3.org/2000/svg\"\n preserveAspectRatio=\"xMidYMid\"\n >\n <path\n d=\"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027\"\n fill=\"#4285F4\"\n ></path>\n <path\n d=\"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1\"\n fill=\"#34A853\"\n ></path>\n <path\n d=\"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782\"\n fill=\"#FBBC05\"\n ></path>\n <path\n d=\"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251\"\n fill=\"#EB4335\"\n ></path>\n </svg>\n <p class=\"amplify-text amplify-authenticator__federated-text\">\n {{ signInGoogleText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <hr\n class=\"amplify-divider amplify-divider--label amplify-divider--small\"\n aria-orientation=\"horizontal\"\n data-size=\"small\"\n [attr.data-label]=\"orText\"\n />\n</div>\n" }]
|
|
1080
|
+
}], ctorParameters: () => [{ type: AuthenticatorService }] });
|
|
1081
|
+
|
|
1082
|
+
const { getForgotPasswordText, getSignInText } = authenticatorTextUtil;
|
|
1083
|
+
class SignInComponent {
|
|
1084
|
+
authenticator;
|
|
1085
|
+
dataAttr = '';
|
|
1086
|
+
forgotPasswordText = getForgotPasswordText();
|
|
1087
|
+
signInButtonText = getSignInText();
|
|
1088
|
+
sortedFormFields;
|
|
1089
|
+
constructor(authenticator) {
|
|
1090
|
+
this.authenticator = authenticator;
|
|
1091
|
+
}
|
|
1092
|
+
get context() {
|
|
1093
|
+
return this.authenticator.slotContext;
|
|
1094
|
+
}
|
|
1095
|
+
onInput(event) {
|
|
1096
|
+
event.preventDefault();
|
|
1097
|
+
const { name, value } = event.target;
|
|
1098
|
+
this.authenticator.updateForm({ name, value });
|
|
1099
|
+
}
|
|
1100
|
+
onSubmit(event) {
|
|
1101
|
+
event.preventDefault();
|
|
1102
|
+
this.authenticator.submitForm(getFormDataFromEvent(event));
|
|
1103
|
+
}
|
|
1104
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: SignInComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1105
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: SignInComponent, isStandalone: false, selector: "amplify-sign-in", host: { properties: { "attr.data-amplify-authenticator-signin": "this.dataAttr" } }, ngImport: i0, template: "<amplify-slot name=\"sign-in-header\" [context]=\"context\"></amplify-slot>\n\n<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <amplify-federated-sign-in></amplify-federated-sign-in>\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <legend class=\"amplify-visually-hidden\">Sign in</legend>\n <amplify-base-form-fields route=\"signIn\"></amplify-base-form-fields>\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ signInButtonText }}\n </button>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n</form>\n\n<amplify-slot name=\"sign-in-footer\" [context]=\"context\">\n <div data-amplify-footer>\n <button\n amplify-button\n fontWeight=\"normal\"\n size=\"small\"\n variation=\"link\"\n fullWidth=\"true\"\n (click)=\"authenticator.toForgotPassword()\"\n >\n {{ forgotPasswordText }}\n </button>\n </div>\n</amplify-slot>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { kind: "component", type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }, { kind: "component", type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { kind: "component", type: ErrorComponent, selector: "amplify-error" }, { kind: "component", type: FederatedSignInComponent, selector: "amplify-federated-sign-in" }], encapsulation: i0.ViewEncapsulation.None });
|
|
1106
|
+
}
|
|
1107
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: SignInComponent, decorators: [{
|
|
1108
|
+
type: Component,
|
|
1109
|
+
args: [{ selector: 'amplify-sign-in', standalone: false, encapsulation: ViewEncapsulation.None, template: "<amplify-slot name=\"sign-in-header\" [context]=\"context\"></amplify-slot>\n\n<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <amplify-federated-sign-in></amplify-federated-sign-in>\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <legend class=\"amplify-visually-hidden\">Sign in</legend>\n <amplify-base-form-fields route=\"signIn\"></amplify-base-form-fields>\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ signInButtonText }}\n </button>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n</form>\n\n<amplify-slot name=\"sign-in-footer\" [context]=\"context\">\n <div data-amplify-footer>\n <button\n amplify-button\n fontWeight=\"normal\"\n size=\"small\"\n variation=\"link\"\n fullWidth=\"true\"\n (click)=\"authenticator.toForgotPassword()\"\n >\n {{ forgotPasswordText }}\n </button>\n </div>\n</amplify-slot>\n" }]
|
|
1110
|
+
}], ctorParameters: () => [{ type: AuthenticatorService }], propDecorators: { dataAttr: [{
|
|
1111
|
+
type: HostBinding,
|
|
1112
|
+
args: ['attr.data-amplify-authenticator-signin']
|
|
1113
|
+
}] } });
|
|
1114
|
+
|
|
1115
|
+
class SignUpFormFieldsComponent {
|
|
1116
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: SignUpFormFieldsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1117
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: SignUpFormFieldsComponent, isStandalone: false, selector: "amplify-sign-up-form-fields", ngImport: i0, template: "<div class=\"amplify-flex amplify-authenticator__column\" data-amplify-fieldset>\n <amplify-base-form-fields route=\"signUp\"></amplify-base-form-fields>\n</div>\n", dependencies: [{ kind: "component", type: BaseFormFieldsComponent, selector: "amplify-base-form-fields", inputs: ["route"] }] });
|
|
1118
|
+
}
|
|
1119
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: SignUpFormFieldsComponent, decorators: [{
|
|
1120
|
+
type: Component,
|
|
1121
|
+
args: [{ selector: 'amplify-sign-up-form-fields', standalone: false, template: "<div class=\"amplify-flex amplify-authenticator__column\" data-amplify-fieldset>\n <amplify-base-form-fields route=\"signUp\"></amplify-base-form-fields>\n</div>\n" }]
|
|
1122
|
+
}] });
|
|
1123
|
+
|
|
1124
|
+
const { getCreateAccountText } = authenticatorTextUtil;
|
|
1125
|
+
class SignUpComponent {
|
|
1126
|
+
authenticator;
|
|
1127
|
+
dataAttr = '';
|
|
1128
|
+
// translated texts
|
|
1129
|
+
createAccountText = getCreateAccountText();
|
|
1130
|
+
constructor(authenticator) {
|
|
1131
|
+
this.authenticator = authenticator;
|
|
1132
|
+
}
|
|
1133
|
+
get context() {
|
|
1134
|
+
return this.authenticator.slotContext;
|
|
1135
|
+
}
|
|
1136
|
+
onInput(event) {
|
|
1137
|
+
const { checked, name, type, value } = event.target;
|
|
1138
|
+
const isUncheckedCheckbox = type === 'checkbox' && !checked;
|
|
1139
|
+
this.authenticator.updateForm({
|
|
1140
|
+
name,
|
|
1141
|
+
value: isUncheckedCheckbox ? undefined : value,
|
|
1142
|
+
});
|
|
1143
|
+
}
|
|
1144
|
+
onSubmit(event) {
|
|
1145
|
+
event.preventDefault();
|
|
1146
|
+
this.authenticator.submitForm(getFormDataFromEvent(event));
|
|
1147
|
+
}
|
|
1148
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: SignUpComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1149
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: SignUpComponent, isStandalone: false, selector: "amplify-sign-up", host: { properties: { "attr.data-amplify-authenticator-signup": "this.dataAttr" } }, ngImport: i0, template: "<amplify-slot name=\"sign-up-header\" [context]=\"context\"></amplify-slot>\n\n<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <amplify-federated-sign-in></amplify-federated-sign-in>\n <div class=\"amplify-flex amplify-authenticator__column\">\n <div class=\"amplify-flex amplify-authenticator__column\">\n <amplify-slot name=\"sign-up-form-fields\" [context]=\"context\">\n <amplify-sign-up-form-fields></amplify-sign-up-form-fields>\n </amplify-slot>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </div>\n\n <amplify-slot name=\"sign-up-button\" [context]=\"context\">\n <button\n [isDisabled]=\"\n authenticator.isPending || authenticator.hasValidationErrors\n \"\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n >\n {{ createAccountText }}\n </button>\n </amplify-slot>\n </div>\n</form>\n\n<amplify-slot name=\"sign-up-footer\" [context]=\"context\"> </amplify-slot>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { kind: "component", type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { kind: "component", type: ErrorComponent, selector: "amplify-error" }, { kind: "component", type: FederatedSignInComponent, selector: "amplify-federated-sign-in" }, { kind: "component", type: SignUpFormFieldsComponent, selector: "amplify-sign-up-form-fields" }] });
|
|
1150
|
+
}
|
|
1151
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: SignUpComponent, decorators: [{
|
|
1152
|
+
type: Component,
|
|
1153
|
+
args: [{ selector: 'amplify-sign-up', standalone: false, template: "<amplify-slot name=\"sign-up-header\" [context]=\"context\"></amplify-slot>\n\n<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <amplify-federated-sign-in></amplify-federated-sign-in>\n <div class=\"amplify-flex amplify-authenticator__column\">\n <div class=\"amplify-flex amplify-authenticator__column\">\n <amplify-slot name=\"sign-up-form-fields\" [context]=\"context\">\n <amplify-sign-up-form-fields></amplify-sign-up-form-fields>\n </amplify-slot>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </div>\n\n <amplify-slot name=\"sign-up-button\" [context]=\"context\">\n <button\n [isDisabled]=\"\n authenticator.isPending || authenticator.hasValidationErrors\n \"\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n >\n {{ createAccountText }}\n </button>\n </amplify-slot>\n </div>\n</form>\n\n<amplify-slot name=\"sign-up-footer\" [context]=\"context\"> </amplify-slot>\n" }]
|
|
1154
|
+
}], ctorParameters: () => [{ type: AuthenticatorService }], propDecorators: { dataAttr: [{
|
|
1155
|
+
type: HostBinding,
|
|
1156
|
+
args: ['attr.data-amplify-authenticator-signup']
|
|
1157
|
+
}] } });
|
|
1158
|
+
|
|
1159
|
+
class TabItemComponent {
|
|
1160
|
+
title;
|
|
1161
|
+
active = false;
|
|
1162
|
+
id;
|
|
1163
|
+
labelledById;
|
|
1164
|
+
tabIndex;
|
|
1165
|
+
display = 'block'; // emulate div behavior
|
|
1166
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TabItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1167
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: TabItemComponent, isStandalone: false, selector: "amplify-tab-item", inputs: { title: "title", active: "active", id: "id", labelledById: "labelledById", tabIndex: "tabIndex" }, host: { properties: { "style.display": "this.display" } }, ngImport: i0, template: "<div\n role=\"tabpanel\"\n class=\"amplify-tabs__panel\"\n [class]=\"active ? 'amplify-tabs__panel--active' : ''\"\n [id]=\"id\"\n [attr.aria-labelledby]=\"labelledById\"\n [attr.tabindex]=\"tabIndex\"\n>\n <ng-content *ngIf=\"active\"></ng-content>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1168
|
+
}
|
|
1169
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TabItemComponent, decorators: [{
|
|
1170
|
+
type: Component,
|
|
1171
|
+
args: [{ selector: 'amplify-tab-item', standalone: false, template: "<div\n role=\"tabpanel\"\n class=\"amplify-tabs__panel\"\n [class]=\"active ? 'amplify-tabs__panel--active' : ''\"\n [id]=\"id\"\n [attr.aria-labelledby]=\"labelledById\"\n [attr.tabindex]=\"tabIndex\"\n>\n <ng-content *ngIf=\"active\"></ng-content>\n</div>\n" }]
|
|
1172
|
+
}], propDecorators: { title: [{
|
|
1173
|
+
type: Input
|
|
1174
|
+
}], active: [{
|
|
1175
|
+
type: Input
|
|
1176
|
+
}], id: [{
|
|
1177
|
+
type: Input
|
|
1178
|
+
}], labelledById: [{
|
|
1179
|
+
type: Input
|
|
1180
|
+
}], tabIndex: [{
|
|
1181
|
+
type: Input
|
|
1182
|
+
}], display: [{
|
|
1183
|
+
type: HostBinding,
|
|
1184
|
+
args: ['style.display']
|
|
1185
|
+
}] } });
|
|
1186
|
+
|
|
1187
|
+
class TabsComponent {
|
|
1188
|
+
tabs;
|
|
1189
|
+
tabChange = new EventEmitter();
|
|
1190
|
+
ngAfterContentInit() {
|
|
1191
|
+
// assign ids
|
|
1192
|
+
this.tabs.forEach((tab, index) => {
|
|
1193
|
+
tab.id = `tab-${nanoid(12)}-panel-${index}`;
|
|
1194
|
+
tab.labelledById = `tab-${nanoid(12)}-tab-${index}`;
|
|
1195
|
+
});
|
|
1196
|
+
// find active tab
|
|
1197
|
+
// TODO(enhancement): more declarative way for choosing the initial tab to render
|
|
1198
|
+
const activeTabs = this.tabs.filter((tab) => tab.active);
|
|
1199
|
+
// set active tab
|
|
1200
|
+
if (activeTabs.length !== 1) {
|
|
1201
|
+
this.selectTab(this.tabs.first);
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
selectTab(tab) {
|
|
1205
|
+
this.tabs.forEach((tab) => {
|
|
1206
|
+
tab.active = false;
|
|
1207
|
+
});
|
|
1208
|
+
tab.active = true;
|
|
1209
|
+
}
|
|
1210
|
+
handleTabClick(tab) {
|
|
1211
|
+
if (tab.active)
|
|
1212
|
+
return; // don't do anything if clicks the current active tab
|
|
1213
|
+
this.tabChange.emit();
|
|
1214
|
+
this.selectTab(tab);
|
|
1215
|
+
}
|
|
1216
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1217
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: TabsComponent, isStandalone: false, selector: "amplify-tabs", outputs: { tabChange: "tabChange" }, queries: [{ propertyName: "tabs", predicate: TabItemComponent }], ngImport: i0, template: "<div class=\"amplify-tabs\">\n <div\n class=\"amplify-tabs__list amplify-tabs__list--top amplify-tabs__list--equal\"\n role=\"tablist\"\n >\n <button\n *ngFor=\"let tab of tabs\"\n class=\"amplify-tabs__item\"\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 [class]=\"tab.active ? 'amplify-tabs__item--active' : ''\"\n (click)=\"handleTabClick(tab)\"\n >\n {{ tab.title }}\n </button>\n </div>\n</div>\n\n<ng-content></ng-content>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
1218
|
+
}
|
|
1219
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: TabsComponent, decorators: [{
|
|
1220
|
+
type: Component,
|
|
1221
|
+
args: [{ selector: 'amplify-tabs', standalone: false, template: "<div class=\"amplify-tabs\">\n <div\n class=\"amplify-tabs__list amplify-tabs__list--top amplify-tabs__list--equal\"\n role=\"tablist\"\n >\n <button\n *ngFor=\"let tab of tabs\"\n class=\"amplify-tabs__item\"\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 [class]=\"tab.active ? 'amplify-tabs__item--active' : ''\"\n (click)=\"handleTabClick(tab)\"\n >\n {{ tab.title }}\n </button>\n </div>\n</div>\n\n<ng-content></ng-content>\n" }]
|
|
1222
|
+
}], propDecorators: { tabs: [{
|
|
1223
|
+
type: ContentChildren,
|
|
1224
|
+
args: [TabItemComponent]
|
|
1225
|
+
}], tabChange: [{
|
|
1226
|
+
type: Output
|
|
1227
|
+
}] } });
|
|
1228
|
+
|
|
1229
|
+
const getAttributeMap = () => defaultFormFieldOptions;
|
|
1230
|
+
|
|
1231
|
+
const { getSkipText, getVerifyText, getAccountRecoveryInfoText } = authenticatorTextUtil;
|
|
1232
|
+
class VerifyUserComponent {
|
|
1233
|
+
authenticator;
|
|
1234
|
+
dataAttr = '';
|
|
1235
|
+
headerText = getAccountRecoveryInfoText();
|
|
1236
|
+
unverifiedUserAttributes = {};
|
|
1237
|
+
labelId = nanoid(12);
|
|
1238
|
+
// translated texts
|
|
1239
|
+
skipText = getSkipText();
|
|
1240
|
+
verifyText = getVerifyText();
|
|
1241
|
+
constructor(authenticator) {
|
|
1242
|
+
this.authenticator = authenticator;
|
|
1243
|
+
}
|
|
1244
|
+
get context() {
|
|
1245
|
+
return this.authenticator.slotContext;
|
|
1246
|
+
}
|
|
1247
|
+
ngOnInit() {
|
|
1248
|
+
const actorState = getActorState(this.authenticator.authState);
|
|
1249
|
+
this.unverifiedUserAttributes = actorState.context.unverifiedUserAttributes;
|
|
1250
|
+
}
|
|
1251
|
+
getLabel(attr, value) {
|
|
1252
|
+
const attributeMap = getAttributeMap();
|
|
1253
|
+
const { label } = attributeMap[attr];
|
|
1254
|
+
const translatedTypeLabel = translate(label);
|
|
1255
|
+
const censoredAttributeValue = censorContactMethod(label, value);
|
|
1256
|
+
return `${translatedTypeLabel}: ${censoredAttributeValue}`;
|
|
1257
|
+
}
|
|
1258
|
+
onInput(event) {
|
|
1259
|
+
event.preventDefault();
|
|
1260
|
+
const { name, value } = event.target;
|
|
1261
|
+
this.authenticator.updateForm({ name, value });
|
|
1262
|
+
}
|
|
1263
|
+
onSubmit(event) {
|
|
1264
|
+
event.preventDefault();
|
|
1265
|
+
this.authenticator.submitForm(getFormDataFromEvent(event));
|
|
1266
|
+
}
|
|
1267
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: VerifyUserComponent, deps: [{ token: AuthenticatorService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1268
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: VerifyUserComponent, isStandalone: false, selector: "amplify-verify-user", inputs: { headerText: "headerText" }, host: { properties: { "attr.data-amplify-authenticator-verifyuser": "this.dataAttr" } }, ngImport: i0, template: "<form data-amplify-form (input)=\"onInput($event)\" (submit)=\"onSubmit($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"verify-user-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n\n <div\n *ngFor=\"\n let unverifiedUserAttribute of unverifiedUserAttributes | keyvalue\n let i = index;\n \"\n >\n <input\n name=\"unverifiedAttr\"\n type=\"radio\"\n [value]=\"unverifiedUserAttribute.key\"\n [id]=\"labelId\"\n [checked]=\"i === 0\"\n />\n <label [for]=\"labelId\">{{\n getLabel(unverifiedUserAttribute.key, unverifiedUserAttribute.value)\n }}</label>\n </div>\n\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ verifyText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.skipVerification()\"\n >\n {{ skipText }}\n </button>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"verify-user-footer\" [context]=\"context\"> </amplify-slot>\n</form>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { kind: "component", type: ButtonComponent, selector: "button[amplify-button]", inputs: ["type", "fullWidth", "isDisabled", "size", "variation", "fontWeight"] }, { kind: "component", type: ErrorComponent, selector: "amplify-error" }, { kind: "pipe", type: i2.KeyValuePipe, name: "keyvalue" }], encapsulation: i0.ViewEncapsulation.None });
|
|
1269
|
+
}
|
|
1270
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: VerifyUserComponent, decorators: [{
|
|
1271
|
+
type: Component,
|
|
1272
|
+
args: [{ selector: 'amplify-verify-user', standalone: false, encapsulation: ViewEncapsulation.None, template: "<form data-amplify-form (input)=\"onInput($event)\" (submit)=\"onSubmit($event)\">\n <fieldset\n class=\"amplify-flex amplify-authenticator__column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"verify-user-header\" [context]=\"context\">\n <h3 class=\"amplify-heading amplify-heading--3\">{{ this.headerText }}</h3>\n </amplify-slot>\n\n <div\n *ngFor=\"\n let unverifiedUserAttribute of unverifiedUserAttributes | keyvalue\n let i = index;\n \"\n >\n <input\n name=\"unverifiedAttr\"\n type=\"radio\"\n [value]=\"unverifiedUserAttribute.key\"\n [id]=\"labelId\"\n [checked]=\"i === 0\"\n />\n <label [for]=\"labelId\">{{\n getLabel(unverifiedUserAttribute.key, unverifiedUserAttribute.value)\n }}</label>\n </div>\n\n <button\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n [isDisabled]=\"authenticator.isPending\"\n >\n {{ verifyText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.skipVerification()\"\n >\n {{ skipText }}\n </button>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"verify-user-footer\" [context]=\"context\"> </amplify-slot>\n</form>\n" }]
|
|
1273
|
+
}], ctorParameters: () => [{ type: AuthenticatorService }], propDecorators: { dataAttr: [{
|
|
1274
|
+
type: HostBinding,
|
|
1275
|
+
args: ['attr.data-amplify-authenticator-verifyuser']
|
|
1276
|
+
}], headerText: [{
|
|
1277
|
+
type: Input
|
|
1278
|
+
}] } });
|
|
1279
|
+
|
|
1280
|
+
const { getSignInTabText, getSignUpTabText } = authenticatorTextUtil;
|
|
1281
|
+
class AuthenticatorComponent {
|
|
1282
|
+
authenticator;
|
|
1283
|
+
contextService;
|
|
1284
|
+
changeDetector;
|
|
1285
|
+
formFields;
|
|
1286
|
+
initialState;
|
|
1287
|
+
loginMechanisms;
|
|
1288
|
+
services;
|
|
1289
|
+
signUpAttributes;
|
|
1290
|
+
socialProviders;
|
|
1291
|
+
variation;
|
|
1292
|
+
hideSignUp;
|
|
1293
|
+
customComponentQuery = null;
|
|
1294
|
+
// translated texts
|
|
1295
|
+
signInTitle = getSignInTabText();
|
|
1296
|
+
signUpTitle = getSignUpTabText();
|
|
1297
|
+
hasInitialized = false;
|
|
1298
|
+
isHandlingHubEvent = false;
|
|
1299
|
+
unsubscribeMachine;
|
|
1300
|
+
clearUserAgent;
|
|
1301
|
+
constructor(authenticator, contextService, changeDetector) {
|
|
1302
|
+
this.authenticator = authenticator;
|
|
1303
|
+
this.contextService = contextService;
|
|
1304
|
+
this.changeDetector = changeDetector;
|
|
1305
|
+
}
|
|
1306
|
+
// context passed to "authenticated" slot
|
|
1307
|
+
get context() {
|
|
1308
|
+
return this.authenticator.slotContext;
|
|
1309
|
+
}
|
|
1310
|
+
get route() {
|
|
1311
|
+
return this.authenticator.route;
|
|
1312
|
+
}
|
|
1313
|
+
ngOnInit() {
|
|
1314
|
+
const { initialState, loginMechanisms, services, signUpAttributes, socialProviders, formFields, } = this;
|
|
1315
|
+
this.clearUserAgent = setUserAgent({
|
|
1316
|
+
componentName: 'Authenticator',
|
|
1317
|
+
packageName: 'angular',
|
|
1318
|
+
version: VERSION,
|
|
1319
|
+
});
|
|
1320
|
+
const { initializeMachine } = this.authenticator;
|
|
1321
|
+
this.authenticator.hubSubject.subscribe(() => {
|
|
1322
|
+
/*
|
|
1323
|
+
* Hub events aren't properly caught by Angular, because they are
|
|
1324
|
+
* synchronous events. Angular tracks async network events and
|
|
1325
|
+
* html events, but not synchronous events like hub.
|
|
1326
|
+
*
|
|
1327
|
+
* On any notable hub events, we run change detection manually.
|
|
1328
|
+
*/
|
|
1329
|
+
this.changeDetector.detectChanges();
|
|
1330
|
+
/*
|
|
1331
|
+
* Hub events that we handle can lead to multiple state changes:
|
|
1332
|
+
* e.g. `authenticated` -> `signOut` -> initialState.
|
|
1333
|
+
*
|
|
1334
|
+
* We want to ensure change detection runs all the way, until
|
|
1335
|
+
* we reach back to the initial state. Setting the below flag
|
|
1336
|
+
* to true to until we reach initial state.
|
|
1337
|
+
*/
|
|
1338
|
+
this.isHandlingHubEvent = true;
|
|
1339
|
+
});
|
|
1340
|
+
/**
|
|
1341
|
+
* Subscribes to state machine changes and sends INIT event
|
|
1342
|
+
* once machine reaches 'setup' state.
|
|
1343
|
+
*/
|
|
1344
|
+
this.unsubscribeMachine = this.authenticator.subscribe(() => {
|
|
1345
|
+
const { route } = this.authenticator;
|
|
1346
|
+
if (this.isHandlingHubEvent) {
|
|
1347
|
+
this.changeDetector.detectChanges();
|
|
1348
|
+
const initialStateWithDefault = initialState ?? 'signIn';
|
|
1349
|
+
// We can stop manual change detection if we're back to the initial state
|
|
1350
|
+
if (route === initialStateWithDefault) {
|
|
1351
|
+
this.isHandlingHubEvent = false;
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
if (!this.hasInitialized && route === 'setup') {
|
|
1355
|
+
initializeMachine({
|
|
1356
|
+
initialState,
|
|
1357
|
+
loginMechanisms,
|
|
1358
|
+
services,
|
|
1359
|
+
signUpAttributes,
|
|
1360
|
+
socialProviders,
|
|
1361
|
+
formFields,
|
|
1362
|
+
});
|
|
1363
|
+
this.hasInitialized = true;
|
|
1364
|
+
}
|
|
1365
|
+
}).unsubscribe;
|
|
1366
|
+
/**
|
|
1367
|
+
* handling translations after content init, because authenticator and its
|
|
1368
|
+
* translations might be initialized before the main app's `ngOnInit` is run.
|
|
1369
|
+
*/
|
|
1370
|
+
this.signInTitle = getSignInTabText();
|
|
1371
|
+
this.signUpTitle = getSignUpTabText();
|
|
1372
|
+
}
|
|
1373
|
+
/**
|
|
1374
|
+
* Lifecycle Methods
|
|
1375
|
+
*/
|
|
1376
|
+
ngAfterContentInit() {
|
|
1377
|
+
this.contextService.customComponents = this.mapCustomComponents(this.customComponentQuery);
|
|
1378
|
+
}
|
|
1379
|
+
ngOnDestroy() {
|
|
1380
|
+
this.clearUserAgent();
|
|
1381
|
+
if (this.unsubscribeMachine)
|
|
1382
|
+
this.unsubscribeMachine();
|
|
1383
|
+
}
|
|
1384
|
+
/**
|
|
1385
|
+
* Class Functions
|
|
1386
|
+
*/
|
|
1387
|
+
onTabChange() {
|
|
1388
|
+
const { route } = this.authenticator;
|
|
1389
|
+
if (route === 'signIn') {
|
|
1390
|
+
this.authenticator.toSignUp();
|
|
1391
|
+
}
|
|
1392
|
+
else {
|
|
1393
|
+
this.authenticator.toSignIn();
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
hasTabs() {
|
|
1397
|
+
const { route } = this.authenticator;
|
|
1398
|
+
return route === 'signIn' || route === 'signUp';
|
|
1399
|
+
}
|
|
1400
|
+
hasRouteComponent() {
|
|
1401
|
+
const { route } = this.authenticator;
|
|
1402
|
+
switch (route) {
|
|
1403
|
+
case 'authenticated':
|
|
1404
|
+
case 'idle':
|
|
1405
|
+
case 'setup':
|
|
1406
|
+
case 'signOut':
|
|
1407
|
+
case 'transition':
|
|
1408
|
+
return false;
|
|
1409
|
+
default:
|
|
1410
|
+
return true;
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
mapCustomComponents(componentQuery) {
|
|
1414
|
+
if (!componentQuery)
|
|
1415
|
+
return {};
|
|
1416
|
+
const customComponents = {};
|
|
1417
|
+
componentQuery.forEach((component) => {
|
|
1418
|
+
customComponents[component.name] = component.template;
|
|
1419
|
+
});
|
|
1420
|
+
return customComponents;
|
|
1421
|
+
}
|
|
1422
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: AuthenticatorComponent, deps: [{ token: AuthenticatorService }, { token: CustomComponentsService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1423
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: AuthenticatorComponent, isStandalone: false, selector: "amplify-authenticator", inputs: { formFields: "formFields", initialState: "initialState", loginMechanisms: "loginMechanisms", services: "services", signUpAttributes: "signUpAttributes", socialProviders: "socialProviders", variation: "variation", hideSignUp: "hideSignUp" }, providers: [CustomComponentsService], queries: [{ propertyName: "customComponentQuery", predicate: AmplifySlotDirective }], ngImport: i0, template: "<div\n data-amplify-authenticator\n [attr.data-variation]=\"variation\"\n *ngIf=\"hasRouteComponent()\"\n>\n <div data-amplify-container>\n <amplify-slot\n name=\"header\"\n [context]=\"context\"\n ></amplify-slot>\n <div\n data-amplify-router\n [attr.data-amplify-router-content]=\"hasTabs() ? undefined : ''\"\n >\n <amplify-tabs\n (tabChange)=\"onTabChange()\"\n *ngIf=\"(route === 'signIn' || route === 'signUp') && !hideSignUp\"\n >\n <amplify-tab-item\n [title]=\"signInTitle\"\n [active]=\"route === 'signIn'\"\n data-amplify-router-content\n >\n <!-- signIn component -->\n <amplify-slot\n name=\"sign-in\"\n [context]=\"context\"\n *ngIf=\"route === 'signIn'\"\n >\n <amplify-sign-in></amplify-sign-in>\n </amplify-slot>\n </amplify-tab-item>\n <amplify-tab-item\n [title]=\"signUpTitle\"\n [active]=\"route === 'signUp'\"\n data-amplify-router-content\n >\n <!-- signUp component -->\n <amplify-slot\n name=\"sign-up\"\n [context]=\"context\"\n *ngIf=\"route === 'signUp'\"\n >\n <amplify-sign-up></amplify-sign-up>\n </amplify-slot>\n </amplify-tab-item>\n </amplify-tabs>\n\n <amplify-slot\n name=\"sign-in\"\n [context]=\"context\"\n *ngIf=\"route === 'signIn' && hideSignUp\"\n >\n <amplify-sign-in></amplify-sign-in>\n </amplify-slot>\n\n <!-- confirmSignUp content -->\n <amplify-slot\n name=\"confirm-sign-up\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmSignUp'\"\n >\n <amplify-confirm-sign-up></amplify-confirm-sign-up>\n </amplify-slot>\n\n <!-- confirmSignIn content -->\n <amplify-slot\n name=\"confirm-sign-in\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmSignIn'\"\n >\n <amplify-confirm-sign-in></amplify-confirm-sign-in>\n </amplify-slot>\n\n <!-- setupTotp content -->\n <amplify-slot\n name=\"setup-totp\"\n [context]=\"context\"\n *ngIf=\"route === 'setupTotp'\"\n >\n <amplify-setup-totp></amplify-setup-totp>\n </amplify-slot>\n\n <!-- forceNewPassword content -->\n <amplify-slot\n name=\"force-new-password\"\n [context]=\"context\"\n *ngIf=\"route === 'forceNewPassword'\"\n >\n <amplify-force-new-password></amplify-force-new-password>\n </amplify-slot>\n\n <!-- forgotPassword content -->\n <amplify-slot\n name=\"forgot-password\"\n [context]=\"context\"\n *ngIf=\"route === 'forgotPassword'\"\n >\n <amplify-forgot-password></amplify-forgot-password>\n </amplify-slot>\n\n <!-- confirmResetPassword content -->\n <amplify-slot\n name=\"confirm-reset-password\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmResetPassword'\"\n >\n <amplify-confirm-reset-password></amplify-confirm-reset-password>\n </amplify-slot>\n\n <!-- verifyUser content -->\n <amplify-slot\n name=\"verify-user\"\n [context]=\"context\"\n *ngIf=\"route === 'verifyUser'\"\n >\n <amplify-verify-user></amplify-verify-user>\n </amplify-slot>\n\n <!-- confirmVerifyUser content -->\n <amplify-slot\n name=\"confirm-verify-user\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmVerifyUser'\"\n >\n <amplify-confirm-verify-user></amplify-confirm-verify-user>\n </amplify-slot>\n\n <!-- selectMfaType content -->\n <amplify-slot\n name=\"select-mfa-type\"\n [context]=\"context\"\n *ngIf=\"route === 'selectMfaType'\"\n >\n <amplify-select-mfa-type></amplify-select-mfa-type>\n </amplify-slot>\n\n <!-- setupEmail content -->\n <amplify-slot\n name=\"setup-email\"\n [context]=\"context\"\n *ngIf=\"route === 'setupEmail'\"\n >\n <amplify-setup-email></amplify-setup-email>\n </amplify-slot>\n </div>\n\n <amplify-slot\n name=\"footer\"\n [context]=\"context\"\n ></amplify-slot>\n </div>\n</div>\n\n<!-- signedIn content is rendered outside authenticator so it's not styled by authenticator -->\n<amplify-slot\n name=\"authenticated\"\n [context]=\"context\"\n *ngIf=\"route === 'authenticated'\"\n>\n <ng-content></ng-content>\n</amplify-slot>", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: AmplifySlotComponent, selector: "amplify-slot", inputs: ["name", "context"] }, { kind: "component", type: ConfirmResetPasswordComponent, selector: "amplify-confirm-reset-password", inputs: ["headerText"] }, { kind: "component", type: ConfirmSignInComponent, selector: "amplify-confirm-sign-in" }, { kind: "component", type: ConfirmSignUpComponent, selector: "amplify-confirm-sign-up" }, { kind: "component", type: ConfirmVerifyUserComponent, selector: "amplify-confirm-verify-user", inputs: ["headerText"] }, { kind: "component", type: ForceNewPasswordComponent, selector: "amplify-force-new-password", inputs: ["headerText"] }, { kind: "component", type: ForgotPasswordComponent, selector: "amplify-forgot-password", inputs: ["headerText"] }, { kind: "component", type: SelectMfaTypeComponent, selector: "amplify-select-mfa-type" }, { kind: "component", type: SetupEmailComponent, selector: "amplify-setup-email" }, { kind: "component", type: SetupTotpComponent, selector: "amplify-setup-totp" }, { kind: "component", type: SignInComponent, selector: "amplify-sign-in" }, { kind: "component", type: SignUpComponent, selector: "amplify-sign-up" }, { kind: "component", type: TabItemComponent, selector: "amplify-tab-item", inputs: ["title", "active", "id", "labelledById", "tabIndex"] }, { kind: "component", type: TabsComponent, selector: "amplify-tabs", outputs: ["tabChange"] }, { kind: "component", type: VerifyUserComponent, selector: "amplify-verify-user", inputs: ["headerText"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
1424
|
+
}
|
|
1425
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: AuthenticatorComponent, decorators: [{
|
|
1426
|
+
type: Component,
|
|
1427
|
+
args: [{ selector: 'amplify-authenticator', standalone: false, providers: [CustomComponentsService], encapsulation: ViewEncapsulation.None, template: "<div\n data-amplify-authenticator\n [attr.data-variation]=\"variation\"\n *ngIf=\"hasRouteComponent()\"\n>\n <div data-amplify-container>\n <amplify-slot\n name=\"header\"\n [context]=\"context\"\n ></amplify-slot>\n <div\n data-amplify-router\n [attr.data-amplify-router-content]=\"hasTabs() ? undefined : ''\"\n >\n <amplify-tabs\n (tabChange)=\"onTabChange()\"\n *ngIf=\"(route === 'signIn' || route === 'signUp') && !hideSignUp\"\n >\n <amplify-tab-item\n [title]=\"signInTitle\"\n [active]=\"route === 'signIn'\"\n data-amplify-router-content\n >\n <!-- signIn component -->\n <amplify-slot\n name=\"sign-in\"\n [context]=\"context\"\n *ngIf=\"route === 'signIn'\"\n >\n <amplify-sign-in></amplify-sign-in>\n </amplify-slot>\n </amplify-tab-item>\n <amplify-tab-item\n [title]=\"signUpTitle\"\n [active]=\"route === 'signUp'\"\n data-amplify-router-content\n >\n <!-- signUp component -->\n <amplify-slot\n name=\"sign-up\"\n [context]=\"context\"\n *ngIf=\"route === 'signUp'\"\n >\n <amplify-sign-up></amplify-sign-up>\n </amplify-slot>\n </amplify-tab-item>\n </amplify-tabs>\n\n <amplify-slot\n name=\"sign-in\"\n [context]=\"context\"\n *ngIf=\"route === 'signIn' && hideSignUp\"\n >\n <amplify-sign-in></amplify-sign-in>\n </amplify-slot>\n\n <!-- confirmSignUp content -->\n <amplify-slot\n name=\"confirm-sign-up\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmSignUp'\"\n >\n <amplify-confirm-sign-up></amplify-confirm-sign-up>\n </amplify-slot>\n\n <!-- confirmSignIn content -->\n <amplify-slot\n name=\"confirm-sign-in\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmSignIn'\"\n >\n <amplify-confirm-sign-in></amplify-confirm-sign-in>\n </amplify-slot>\n\n <!-- setupTotp content -->\n <amplify-slot\n name=\"setup-totp\"\n [context]=\"context\"\n *ngIf=\"route === 'setupTotp'\"\n >\n <amplify-setup-totp></amplify-setup-totp>\n </amplify-slot>\n\n <!-- forceNewPassword content -->\n <amplify-slot\n name=\"force-new-password\"\n [context]=\"context\"\n *ngIf=\"route === 'forceNewPassword'\"\n >\n <amplify-force-new-password></amplify-force-new-password>\n </amplify-slot>\n\n <!-- forgotPassword content -->\n <amplify-slot\n name=\"forgot-password\"\n [context]=\"context\"\n *ngIf=\"route === 'forgotPassword'\"\n >\n <amplify-forgot-password></amplify-forgot-password>\n </amplify-slot>\n\n <!-- confirmResetPassword content -->\n <amplify-slot\n name=\"confirm-reset-password\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmResetPassword'\"\n >\n <amplify-confirm-reset-password></amplify-confirm-reset-password>\n </amplify-slot>\n\n <!-- verifyUser content -->\n <amplify-slot\n name=\"verify-user\"\n [context]=\"context\"\n *ngIf=\"route === 'verifyUser'\"\n >\n <amplify-verify-user></amplify-verify-user>\n </amplify-slot>\n\n <!-- confirmVerifyUser content -->\n <amplify-slot\n name=\"confirm-verify-user\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmVerifyUser'\"\n >\n <amplify-confirm-verify-user></amplify-confirm-verify-user>\n </amplify-slot>\n\n <!-- selectMfaType content -->\n <amplify-slot\n name=\"select-mfa-type\"\n [context]=\"context\"\n *ngIf=\"route === 'selectMfaType'\"\n >\n <amplify-select-mfa-type></amplify-select-mfa-type>\n </amplify-slot>\n\n <!-- setupEmail content -->\n <amplify-slot\n name=\"setup-email\"\n [context]=\"context\"\n *ngIf=\"route === 'setupEmail'\"\n >\n <amplify-setup-email></amplify-setup-email>\n </amplify-slot>\n </div>\n\n <amplify-slot\n name=\"footer\"\n [context]=\"context\"\n ></amplify-slot>\n </div>\n</div>\n\n<!-- signedIn content is rendered outside authenticator so it's not styled by authenticator -->\n<amplify-slot\n name=\"authenticated\"\n [context]=\"context\"\n *ngIf=\"route === 'authenticated'\"\n>\n <ng-content></ng-content>\n</amplify-slot>" }]
|
|
1428
|
+
}], ctorParameters: () => [{ type: AuthenticatorService }, { type: CustomComponentsService }, { type: i0.ChangeDetectorRef }], propDecorators: { formFields: [{
|
|
1429
|
+
type: Input
|
|
1430
|
+
}], initialState: [{
|
|
1431
|
+
type: Input
|
|
1432
|
+
}], loginMechanisms: [{
|
|
1433
|
+
type: Input
|
|
1434
|
+
}], services: [{
|
|
1435
|
+
type: Input
|
|
1436
|
+
}], signUpAttributes: [{
|
|
1437
|
+
type: Input
|
|
1438
|
+
}], socialProviders: [{
|
|
1439
|
+
type: Input
|
|
1440
|
+
}], variation: [{
|
|
1441
|
+
type: Input
|
|
1442
|
+
}], hideSignUp: [{
|
|
1443
|
+
type: Input
|
|
1444
|
+
}], customComponentQuery: [{
|
|
1445
|
+
type: ContentChildren,
|
|
1446
|
+
args: [AmplifySlotDirective]
|
|
1447
|
+
}] } });
|
|
1448
|
+
|
|
1449
|
+
class CheckboxComponent {
|
|
1450
|
+
defaultChecked = false;
|
|
1451
|
+
errorMessage;
|
|
1452
|
+
hasError = false;
|
|
1453
|
+
label;
|
|
1454
|
+
name;
|
|
1455
|
+
value;
|
|
1456
|
+
isChecked = false;
|
|
1457
|
+
ngOnInit() {
|
|
1458
|
+
if (this.defaultChecked) {
|
|
1459
|
+
this.isChecked = true;
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
handleClick() {
|
|
1463
|
+
this.isChecked = !this.isChecked;
|
|
1464
|
+
}
|
|
1465
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: CheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1466
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.18", type: CheckboxComponent, isStandalone: false, selector: "amplify-checkbox", inputs: { defaultChecked: "defaultChecked", errorMessage: "errorMessage", hasError: "hasError", label: "label", name: "name", value: "value" }, ngImport: i0, template: "<div class=\"amplify-flex amplify-field amplify-checkboxfield\">\n <label class=\"amplify-flex amplify-checkbox\">\n <span class=\"amplify-visually-hidden\">\n <input\n (click)=\"handleClick()\"\n class=\"\n amplify-input\n amplify-field-group__control\n amplify-checkbox__input\n \"\n aria-invalid=\"false\"\n type=\"checkbox\"\n [name]=\"name\"\n [value]=\"value\"\n />\n </span>\n <span\n class=\"amplify-flex amplify-checkbox__button\"\n aria-hidden=\"true\"\n data-focus=\"false\"\n [ngClass]=\"{\n 'amplify-checkbox__button--error': hasError\n }\"\n [attr.data-error]=\"hasError\"\n [attr.data-checked]=\"isChecked\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon amplify-checkbox__icon\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n [attr.data-checked]=\"isChecked\"\n [ngClass]=\"{\n 'amplify-checkbox__icon--checked': isChecked\n }\"\n >\n <path d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\"></path>\n </svg>\n </span>\n <span class=\"amplify-text amplify-checkbox__label\">\n <ng-content></ng-content>\n </span>\n </label>\n <p *ngIf=\"hasError\" class=\"amplify-text amplify-field__error-message\">\n {{ errorMessage }}\n </p>\n</div>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1467
|
+
}
|
|
1468
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: CheckboxComponent, decorators: [{
|
|
1469
|
+
type: Component,
|
|
1470
|
+
args: [{ selector: 'amplify-checkbox', standalone: false, template: "<div class=\"amplify-flex amplify-field amplify-checkboxfield\">\n <label class=\"amplify-flex amplify-checkbox\">\n <span class=\"amplify-visually-hidden\">\n <input\n (click)=\"handleClick()\"\n class=\"\n amplify-input\n amplify-field-group__control\n amplify-checkbox__input\n \"\n aria-invalid=\"false\"\n type=\"checkbox\"\n [name]=\"name\"\n [value]=\"value\"\n />\n </span>\n <span\n class=\"amplify-flex amplify-checkbox__button\"\n aria-hidden=\"true\"\n data-focus=\"false\"\n [ngClass]=\"{\n 'amplify-checkbox__button--error': hasError\n }\"\n [attr.data-error]=\"hasError\"\n [attr.data-checked]=\"isChecked\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon amplify-checkbox__icon\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n [attr.data-checked]=\"isChecked\"\n [ngClass]=\"{\n 'amplify-checkbox__icon--checked': isChecked\n }\"\n >\n <path d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\"></path>\n </svg>\n </span>\n <span class=\"amplify-text amplify-checkbox__label\">\n <ng-content></ng-content>\n </span>\n </label>\n <p *ngIf=\"hasError\" class=\"amplify-text amplify-field__error-message\">\n {{ errorMessage }}\n </p>\n</div>\n" }]
|
|
1471
|
+
}], propDecorators: { defaultChecked: [{
|
|
1472
|
+
type: Input
|
|
1473
|
+
}], errorMessage: [{
|
|
1474
|
+
type: Input
|
|
1475
|
+
}], hasError: [{
|
|
1476
|
+
type: Input
|
|
1477
|
+
}], label: [{
|
|
1478
|
+
type: Input
|
|
1479
|
+
}], name: [{
|
|
1480
|
+
type: Input
|
|
1481
|
+
}], value: [{
|
|
1482
|
+
type: Input
|
|
1483
|
+
}] } });
|
|
1484
|
+
|
|
1485
|
+
class AmplifyAuthenticatorModule {
|
|
1486
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: AmplifyAuthenticatorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1487
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.18", ngImport: i0, type: AmplifyAuthenticatorModule, declarations: [AmplifySlotComponent,
|
|
1488
|
+
AmplifySlotDirective,
|
|
1489
|
+
AuthenticatorComponent,
|
|
1490
|
+
BaseFormFieldsComponent,
|
|
1491
|
+
ButtonComponent,
|
|
1492
|
+
CheckboxComponent,
|
|
1493
|
+
ConfirmResetPasswordComponent,
|
|
1494
|
+
ConfirmSignInComponent,
|
|
1495
|
+
ConfirmSignUpComponent,
|
|
1496
|
+
ConfirmVerifyUserComponent,
|
|
1497
|
+
ErrorComponent,
|
|
1498
|
+
FederatedSignInButtonComponent,
|
|
1499
|
+
FederatedSignInComponent,
|
|
1500
|
+
ForceNewPasswordComponent,
|
|
1501
|
+
ForceNewPasswordFormFieldsComponent,
|
|
1502
|
+
FormFieldComponent,
|
|
1503
|
+
PasswordFieldComponent,
|
|
1504
|
+
PhoneNumberFieldComponent,
|
|
1505
|
+
ForgotPasswordComponent,
|
|
1506
|
+
SelectComponent,
|
|
1507
|
+
SelectMfaTypeComponent,
|
|
1508
|
+
SetupEmailComponent,
|
|
1509
|
+
SetupTotpComponent,
|
|
1510
|
+
SignInComponent,
|
|
1511
|
+
SignUpComponent,
|
|
1512
|
+
SignUpFormFieldsComponent,
|
|
1513
|
+
TabItemComponent,
|
|
1514
|
+
TabsComponent,
|
|
1515
|
+
TextFieldComponent,
|
|
1516
|
+
VerifyUserComponent], imports: [CommonModule], exports: [AmplifySlotDirective,
|
|
1517
|
+
AuthenticatorComponent,
|
|
1518
|
+
CheckboxComponent,
|
|
1519
|
+
SignUpFormFieldsComponent,
|
|
1520
|
+
ForceNewPasswordFormFieldsComponent,
|
|
1521
|
+
TextFieldComponent] });
|
|
1522
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: AmplifyAuthenticatorModule, imports: [CommonModule] });
|
|
1523
|
+
}
|
|
1524
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.18", ngImport: i0, type: AmplifyAuthenticatorModule, decorators: [{
|
|
1525
|
+
type: NgModule,
|
|
1526
|
+
args: [{
|
|
1527
|
+
declarations: [
|
|
1528
|
+
AmplifySlotComponent,
|
|
1529
|
+
AmplifySlotDirective,
|
|
1530
|
+
AuthenticatorComponent,
|
|
1531
|
+
BaseFormFieldsComponent,
|
|
1532
|
+
ButtonComponent,
|
|
1533
|
+
CheckboxComponent,
|
|
1534
|
+
ConfirmResetPasswordComponent,
|
|
1535
|
+
ConfirmSignInComponent,
|
|
1536
|
+
ConfirmSignUpComponent,
|
|
1537
|
+
ConfirmVerifyUserComponent,
|
|
1538
|
+
ErrorComponent,
|
|
1539
|
+
FederatedSignInButtonComponent,
|
|
1540
|
+
FederatedSignInComponent,
|
|
1541
|
+
ForceNewPasswordComponent,
|
|
1542
|
+
ForceNewPasswordFormFieldsComponent,
|
|
1543
|
+
FormFieldComponent,
|
|
1544
|
+
PasswordFieldComponent,
|
|
1545
|
+
PhoneNumberFieldComponent,
|
|
1546
|
+
ForgotPasswordComponent,
|
|
1547
|
+
SelectComponent,
|
|
1548
|
+
SelectMfaTypeComponent,
|
|
1549
|
+
SetupEmailComponent,
|
|
1550
|
+
SetupTotpComponent,
|
|
1551
|
+
SignInComponent,
|
|
1552
|
+
SignUpComponent,
|
|
1553
|
+
SignUpFormFieldsComponent,
|
|
1554
|
+
TabItemComponent,
|
|
1555
|
+
TabsComponent,
|
|
1556
|
+
TextFieldComponent,
|
|
1557
|
+
VerifyUserComponent,
|
|
1558
|
+
],
|
|
1559
|
+
imports: [CommonModule],
|
|
1560
|
+
exports: [
|
|
1561
|
+
AmplifySlotDirective,
|
|
1562
|
+
AuthenticatorComponent,
|
|
1563
|
+
CheckboxComponent,
|
|
1564
|
+
SignUpFormFieldsComponent,
|
|
1565
|
+
ForceNewPasswordFormFieldsComponent,
|
|
1566
|
+
TextFieldComponent,
|
|
1567
|
+
],
|
|
1568
|
+
}]
|
|
1569
|
+
}] });
|
|
1570
|
+
|
|
1571
|
+
/*
|
|
1572
|
+
* Public API Surface of ui-angular
|
|
1573
|
+
*/
|
|
1574
|
+
/**
|
|
1575
|
+
* Modules
|
|
1576
|
+
*/
|
|
1577
|
+
|
|
1578
|
+
/**
|
|
1579
|
+
* Generated bundle index. Do not edit.
|
|
1580
|
+
*/
|
|
1581
|
+
|
|
1582
|
+
export { AmplifyAuthenticatorModule, AmplifySlotDirective, AuthenticatorComponent, AuthenticatorService, BaseFormFieldsComponent, ButtonComponent, CheckboxComponent, ConfirmResetPasswordComponent, ConfirmSignInComponent, ConfirmSignUpComponent, ConfirmVerifyUserComponent, CustomComponentsService, ErrorComponent, FederatedSignInButtonComponent, FederatedSignInComponent, ForceNewPasswordComponent, ForceNewPasswordFormFieldsComponent, ForgotPasswordComponent, FormFieldComponent, PasswordFieldComponent, PhoneNumberFieldComponent, SelectComponent, SetupTotpComponent, SignInComponent, SignUpComponent, SignUpFormFieldsComponent, TabItemComponent, TabsComponent, TextFieldComponent, VerifyUserComponent, getAttributeMap };
|
|
1583
|
+
//# sourceMappingURL=aws-amplify-ui-angular.mjs.map
|