@aws-amplify/ui-angular 2.1.2 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/aws-amplify-ui-angular.metadata.json +1 -1
- package/bundles/aws-amplify-ui-angular.umd.js +202 -63
- package/bundles/aws-amplify-ui-angular.umd.js.map +1 -1
- package/bundles/aws-amplify-ui-angular.umd.min.js +1 -1
- package/bundles/aws-amplify-ui-angular.umd.min.js.map +1 -1
- package/esm2015/lib/components/authenticator/components/authenticator/authenticator.component.js +4 -2
- package/esm2015/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.js +16 -4
- package/esm2015/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.js +14 -4
- package/esm2015/lib/components/authenticator/components/confirm-sign-up/confirm-sign-up.component.js +23 -7
- package/esm2015/lib/components/authenticator/components/confirm-verify-user/amplify-confirm-verify-user.component.js +16 -4
- package/esm2015/lib/components/authenticator/components/federated-sign-in/federated-sign-in.component.js +2 -2
- package/esm2015/lib/components/authenticator/components/force-new-password/force-new-password.component.js +16 -4
- package/esm2015/lib/components/authenticator/components/form-field/form-field.component.js +8 -5
- package/esm2015/lib/components/authenticator/components/reset-password/reset-password.component.js +14 -4
- package/esm2015/lib/components/authenticator/components/setup-totp/setup-totp.component.js +18 -6
- package/esm2015/lib/components/authenticator/components/sign-in/sign-in.component.js +23 -5
- package/esm2015/lib/components/authenticator/components/sign-up/sign-up-form-fields/sign-up-form-fields.component.js +21 -3
- package/esm2015/lib/components/authenticator/components/sign-up/sign-up.component.js +3 -3
- package/esm2015/lib/components/authenticator/components/user-name-alias/user-name-alias.component.js +13 -6
- package/esm2015/lib/components/authenticator/components/verify-user/verify-user.component.js +4 -4
- package/esm2015/lib/primitives/password-field/password-field.component.js +2 -2
- package/esm2015/lib/primitives/phone-number-field/phone-number-field.component.js +7 -3
- package/esm2015/lib/primitives/select/select.component.js +2 -2
- package/esm2015/lib/primitives/text-field/text-field.component.js +2 -2
- package/esm2015/lib/services/authenticator.service.js +3 -2
- package/fesm2015/aws-amplify-ui-angular.js +180 -43
- package/fesm2015/aws-amplify-ui-angular.js.map +1 -1
- package/lib/components/authenticator/components/authenticator/authenticator.component.d.ts +1 -0
- package/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.d.ts +7 -1
- package/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.d.ts +4 -0
- package/lib/components/authenticator/components/confirm-sign-up/confirm-sign-up.component.d.ts +11 -1
- package/lib/components/authenticator/components/confirm-verify-user/amplify-confirm-verify-user.component.d.ts +7 -1
- package/lib/components/authenticator/components/force-new-password/force-new-password.component.d.ts +7 -1
- package/lib/components/authenticator/components/form-field/form-field.component.d.ts +3 -1
- package/lib/components/authenticator/components/reset-password/reset-password.component.d.ts +4 -0
- package/lib/components/authenticator/components/setup-totp/setup-totp.component.d.ts +4 -0
- package/lib/components/authenticator/components/sign-in/sign-in.component.d.ts +10 -1
- package/lib/components/authenticator/components/sign-up/sign-up-form-fields/sign-up-form-fields.component.d.ts +7 -1
- package/lib/components/authenticator/components/user-name-alias/user-name-alias.component.d.ts +7 -1
- package/lib/primitives/phone-number-field/phone-number-field.component.d.ts +5 -2
- package/lib/services/authenticator.service.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Directive, TemplateRef, Input, Injectable, Component, ViewEncapsulation, ContentChildren, HostBinding, EventEmitter, Output, NgModule } from '@angular/core';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
|
-
import { createAuthenticatorMachine, getServiceContextFacade, listenToAuthHub, getSendEventAliases, translate, getActorContext, AuthChallengeNames, FederatedIdentityProviders, authInputAttributes, countryDialCodes, getAliasInfoFromContext, hasTranslation,
|
|
4
|
+
import { createAuthenticatorMachine, getServiceContextFacade, listenToAuthHub, getSendEventAliases, translate, getActorState, getFormDataFromEvent, getActorContext, AuthChallengeNames, FederatedIdentityProviders, authInputAttributes, countryDialCodes, getAliasInfoFromContext, hasTranslation, setFormOrder } from '@aws-amplify/ui';
|
|
5
5
|
export { translations } from '@aws-amplify/ui';
|
|
6
6
|
import { Logger } from '@aws-amplify/core';
|
|
7
7
|
import { interpret } from 'xstate';
|
|
@@ -56,7 +56,7 @@ const logger$2 = new Logger('state-machine');
|
|
|
56
56
|
* AuthenticatorService provides access to the authenticator state and context.
|
|
57
57
|
*/
|
|
58
58
|
class AuthenticatorService {
|
|
59
|
-
startMachine({ initialState, loginMechanisms, services, signUpAttributes, socialProviders, }) {
|
|
59
|
+
startMachine({ initialState, loginMechanisms, services, signUpAttributes, socialProviders, formFields, }) {
|
|
60
60
|
const machine = createAuthenticatorMachine();
|
|
61
61
|
const authService = interpret(machine).start();
|
|
62
62
|
authService.send({
|
|
@@ -67,6 +67,7 @@ class AuthenticatorService {
|
|
|
67
67
|
socialProviders,
|
|
68
68
|
signUpAttributes,
|
|
69
69
|
services,
|
|
70
|
+
formFields,
|
|
70
71
|
},
|
|
71
72
|
});
|
|
72
73
|
this._machineSubscription = authService.subscribe((state) => {
|
|
@@ -201,13 +202,14 @@ class AuthenticatorComponent {
|
|
|
201
202
|
this.signUpTitle = translate('Create Account');
|
|
202
203
|
}
|
|
203
204
|
ngOnInit() {
|
|
204
|
-
const { initialState, loginMechanisms, services, signUpAttributes, socialProviders, } = this;
|
|
205
|
+
const { initialState, loginMechanisms, services, signUpAttributes, socialProviders, formFields, } = this;
|
|
205
206
|
this.authenticator.startMachine({
|
|
206
207
|
initialState,
|
|
207
208
|
loginMechanisms,
|
|
208
209
|
services,
|
|
209
210
|
signUpAttributes,
|
|
210
211
|
socialProviders,
|
|
212
|
+
formFields,
|
|
211
213
|
});
|
|
212
214
|
/**
|
|
213
215
|
* handling translations after content init, because authenticator and its
|
|
@@ -268,6 +270,7 @@ AuthenticatorComponent.ctorParameters = () => [
|
|
|
268
270
|
{ type: CustomComponentsService }
|
|
269
271
|
];
|
|
270
272
|
AuthenticatorComponent.propDecorators = {
|
|
273
|
+
formFields: [{ type: Input }],
|
|
271
274
|
initialState: [{ type: Input }],
|
|
272
275
|
loginMechanisms: [{ type: Input }],
|
|
273
276
|
services: [{ type: Input }],
|
|
@@ -288,6 +291,18 @@ class ConfirmResetPasswordComponent {
|
|
|
288
291
|
this.backToSignInText = translate('Back to Sign In');
|
|
289
292
|
this.resendCodeText = translate('Resend Code');
|
|
290
293
|
}
|
|
294
|
+
ngOnInit() {
|
|
295
|
+
this.setFormFields();
|
|
296
|
+
}
|
|
297
|
+
setFormFields() {
|
|
298
|
+
var _a, _b;
|
|
299
|
+
const _state = this.authenticator.authState;
|
|
300
|
+
this.formOverrides = (_b = (_a = getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.confirmResetPassword;
|
|
301
|
+
}
|
|
302
|
+
grabField(name, field, defaultV) {
|
|
303
|
+
var _a, _b, _c;
|
|
304
|
+
return (_c = (_b = (_a = this.formOverrides) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b[field]) !== null && _c !== void 0 ? _c : defaultV;
|
|
305
|
+
}
|
|
291
306
|
get context() {
|
|
292
307
|
return this.authenticator.slotContext;
|
|
293
308
|
}
|
|
@@ -298,13 +313,13 @@ class ConfirmResetPasswordComponent {
|
|
|
298
313
|
}
|
|
299
314
|
onSubmit(event) {
|
|
300
315
|
event.preventDefault();
|
|
301
|
-
this.authenticator.submitForm();
|
|
316
|
+
this.authenticator.submitForm(getFormDataFromEvent(event));
|
|
302
317
|
}
|
|
303
318
|
}
|
|
304
319
|
ConfirmResetPasswordComponent.decorators = [
|
|
305
320
|
{ type: Component, args: [{
|
|
306
321
|
selector: 'amplify-confirm-reset-password',
|
|
307
|
-
template: "<
|
|
322
|
+
template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: 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\">{{ headerText }}</h3>\n </amplify-slot>\n <amplify-form-field\n name=\"confirmation_code\"\n type=\"number\"\n autocomplete=\"one-time-code\"\n [labelHidden]=\"grabField('confirmation_code', 'labelHidden', true)\"\n [placeholder]=\"grabField('confirmation_code', 'placeholder', null)\"\n [required]=\"grabField('confirmation_code', 'required', true)\"\n [label]=\"grabField('confirmation_code', 'label', null)\"\n ></amplify-form-field>\n <amplify-form-field\n name=\"password\"\n label=\"New password\"\n autocomplete=\"new-password\"\n [labelHidden]=\"grabField('password', 'labelHidden', true)\"\n [placeholder]=\"grabField('password', 'placeholder', null)\"\n [required]=\"grabField('password', 'required', true)\"\n [label]=\"grabField('password', 'label', 'New password')\"\n ></amplify-form-field>\n <amplify-form-field\n name=\"confirm_password\"\n type=\"password\"\n autocomplete=\"new-password\"\n [labelHidden]=\"grabField('confirm_password', 'labelHidden', true)\"\n [placeholder]=\"grabField('confirm_password', 'placeholder', null)\"\n [required]=\"grabField('confirm_password', 'required', true)\"\n [label]=\"grabField('confirm_password', 'label', 'Confirm Password')\"\n ></amplify-form-field>\n\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ sendCodeText }}\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"
|
|
308
323
|
},] }
|
|
309
324
|
];
|
|
310
325
|
ConfirmResetPasswordComponent.ctorParameters = () => [
|
|
@@ -325,6 +340,16 @@ class ConfirmSignInComponent {
|
|
|
325
340
|
}
|
|
326
341
|
ngOnInit() {
|
|
327
342
|
this.setHeaderText();
|
|
343
|
+
this.setFormFields();
|
|
344
|
+
}
|
|
345
|
+
setFormFields() {
|
|
346
|
+
var _a, _b;
|
|
347
|
+
const _state = this.authenticator.authState;
|
|
348
|
+
this.formOverrides = (_b = (_a = getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.confirmSignIn;
|
|
349
|
+
}
|
|
350
|
+
grabField(name, field, defaultV) {
|
|
351
|
+
var _a, _b, _c;
|
|
352
|
+
return (_c = (_b = (_a = this.formOverrides) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b[field]) !== null && _c !== void 0 ? _c : defaultV;
|
|
328
353
|
}
|
|
329
354
|
get context() {
|
|
330
355
|
return this.authenticator.slotContext;
|
|
@@ -351,13 +376,13 @@ class ConfirmSignInComponent {
|
|
|
351
376
|
}
|
|
352
377
|
onSubmit(event) {
|
|
353
378
|
event.preventDefault();
|
|
354
|
-
this.authenticator.submitForm();
|
|
379
|
+
this.authenticator.submitForm(getFormDataFromEvent(event));
|
|
355
380
|
}
|
|
356
381
|
}
|
|
357
382
|
ConfirmSignInComponent.decorators = [
|
|
358
383
|
{ type: Component, args: [{
|
|
359
384
|
selector: 'amplify-confirm-sign-in',
|
|
360
|
-
template: "<
|
|
385
|
+
template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: 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\">{{ headerText }}</h3>\n </amplify-slot>\n <amplify-form-field\n name=\"confirmation_code\"\n label=\"Code *\"\n type=\"text\"\n autocomplete=\"one-time-code\"\n [labelHidden]=\"grabField('confirmation_code', 'labelHidden', true)\"\n [placeholder]=\"grabField('confirmation_code', 'placeholder', null)\"\n [required]=\"grabField('confirmation_code', 'required', true)\"\n [label]=\"grabField('confirmation_code', 'label', 'Code *')\"\n ></amplify-form-field>\n\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\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"
|
|
361
386
|
},] }
|
|
362
387
|
];
|
|
363
388
|
ConfirmSignInComponent.ctorParameters = () => [
|
|
@@ -375,6 +400,22 @@ class ConfirmSignUpComponent {
|
|
|
375
400
|
// translated texts
|
|
376
401
|
this.resendCodeText = translate('Resend Code');
|
|
377
402
|
this.confirmText = translate('Confirm');
|
|
403
|
+
this.emailMessage = translate('Your code is on the way. To log in, enter the code we emailed to');
|
|
404
|
+
this.textedMessage = translate('Your code is on the way. To log in, enter the code we texted to');
|
|
405
|
+
this.defaultMessage = translate('Your code is on the way. To log in, enter the code we sent you. It may take a minute to arrive.');
|
|
406
|
+
this.minutesMessage = translate('It may take a minute to arrive.');
|
|
407
|
+
}
|
|
408
|
+
ngOnInit() {
|
|
409
|
+
this.setFormFields();
|
|
410
|
+
}
|
|
411
|
+
setFormFields() {
|
|
412
|
+
var _a, _b;
|
|
413
|
+
const _state = this.authenticator.authState;
|
|
414
|
+
this.formOverrides = (_b = (_a = getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.confirmSignUp;
|
|
415
|
+
}
|
|
416
|
+
grabField(name, field, defaultV) {
|
|
417
|
+
var _a, _b, _c;
|
|
418
|
+
return (_c = (_b = (_a = this.formOverrides) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b[field]) !== null && _c !== void 0 ? _c : defaultV;
|
|
378
419
|
}
|
|
379
420
|
get context() {
|
|
380
421
|
return this.authenticator.slotContext;
|
|
@@ -390,10 +431,10 @@ class ConfirmSignUpComponent {
|
|
|
390
431
|
get subtitleText() {
|
|
391
432
|
const { codeDeliveryDetails: { DeliveryMedium, Destination } = {} } = this.authenticator;
|
|
392
433
|
return DeliveryMedium === 'EMAIL'
|
|
393
|
-
?
|
|
434
|
+
? `${this.emailMessage} ${Destination}. ${this.minutesMessage}`
|
|
394
435
|
: DeliveryMedium === 'SMS'
|
|
395
|
-
?
|
|
396
|
-
: translate(`
|
|
436
|
+
? `${this.textedMessage} ${Destination}. ${this.minutesMessage}`
|
|
437
|
+
: translate(`${this.defaultMessage}`);
|
|
397
438
|
}
|
|
398
439
|
onInput(event) {
|
|
399
440
|
event.preventDefault();
|
|
@@ -402,13 +443,13 @@ class ConfirmSignUpComponent {
|
|
|
402
443
|
}
|
|
403
444
|
onSubmit(event) {
|
|
404
445
|
event.preventDefault();
|
|
405
|
-
this.authenticator.submitForm();
|
|
446
|
+
this.authenticator.submitForm(getFormDataFromEvent(event));
|
|
406
447
|
}
|
|
407
448
|
}
|
|
408
449
|
ConfirmSignUpComponent.decorators = [
|
|
409
450
|
{ type: Component, args: [{
|
|
410
451
|
selector: 'amplify-confirm-sign-up',
|
|
411
|
-
template: "<
|
|
452
|
+
template: "<ng-container>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"context.isPending\"\n >\n <amplify-slot name=\"confirm-sign-up-header\" [context]=\"context\">\n <h3 class=\"amplify-heading\" style=\"font-size: 1.5rem\">\n {{ confirmSignUpHeading }}\n </h3>\n </amplify-slot>\n <span style=\"margin-bottom: 1rem\">\n {{ subtitleText }}\n </span>\n <amplify-form-field\n name=\"confirmation_code\"\n autocomplete=\"one-time-code\"\n [labelHidden]=\"grabField('confirmation_code', 'labelHidden', true)\"\n [placeholder]=\"grabField('confirmation_code', 'placeholder', null)\"\n [required]=\"grabField('confirmation_code', 'required', true)\"\n [label]=\"grabField('confirmation_code', 'label', null)\"\n ></amplify-form-field>\n\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\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"
|
|
412
453
|
},] }
|
|
413
454
|
];
|
|
414
455
|
ConfirmSignUpComponent.ctorParameters = () => [
|
|
@@ -428,6 +469,18 @@ class ConfirmVerifyUserComponent {
|
|
|
428
469
|
this.skipText = translate('Skip');
|
|
429
470
|
this.submitText = translate('Submit');
|
|
430
471
|
}
|
|
472
|
+
ngOnInit() {
|
|
473
|
+
this.setFormFields();
|
|
474
|
+
}
|
|
475
|
+
setFormFields() {
|
|
476
|
+
var _a, _b;
|
|
477
|
+
const _state = this.authenticator.authState;
|
|
478
|
+
this.formOverrides = (_b = (_a = getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.confirmVerifyUser;
|
|
479
|
+
}
|
|
480
|
+
grabField(name, field, defaultV) {
|
|
481
|
+
var _a, _b, _c;
|
|
482
|
+
return (_c = (_b = (_a = this.formOverrides) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b[field]) !== null && _c !== void 0 ? _c : defaultV;
|
|
483
|
+
}
|
|
431
484
|
get context() {
|
|
432
485
|
return this.authenticator.slotContext;
|
|
433
486
|
}
|
|
@@ -438,13 +491,13 @@ class ConfirmVerifyUserComponent {
|
|
|
438
491
|
}
|
|
439
492
|
onSubmit(event) {
|
|
440
493
|
event.preventDefault();
|
|
441
|
-
this.authenticator.submitForm();
|
|
494
|
+
this.authenticator.submitForm(getFormDataFromEvent(event));
|
|
442
495
|
}
|
|
443
496
|
}
|
|
444
497
|
ConfirmVerifyUserComponent.decorators = [
|
|
445
498
|
{ type: Component, args: [{
|
|
446
499
|
selector: 'amplify-confirm-verify-user',
|
|
447
|
-
template: "<
|
|
500
|
+
template: "<form data-amplify-form (input)=\"onInput($event)\" (submit)=\"onSubmit($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: 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\">{{ this.headerText }}</h3>\n </amplify-slot>\n <amplify-form-field\n name=\"confirmation_code\"\n type=\"number\"\n autocomplete=\"one-time-code\"\n [labelHidden]=\"grabField('confirmation_code', 'labelHidden', true)\"\n [placeholder]=\"grabField('confirmation_code', 'placeholder', null)\"\n [required]=\"grabField('confirmation_code', 'required', true)\"\n [label]=\"grabField('confirmation_code', 'label', null)\"\n ></amplify-form-field>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\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"
|
|
448
501
|
},] }
|
|
449
502
|
];
|
|
450
503
|
ConfirmVerifyUserComponent.ctorParameters = () => [
|
|
@@ -516,7 +569,7 @@ class FederatedSignInComponent {
|
|
|
516
569
|
FederatedSignInComponent.decorators = [
|
|
517
570
|
{ type: Component, args: [{
|
|
518
571
|
selector: 'amplify-federated-sign-in',
|
|
519
|
-
template: "<div\n class=\"amplify-flex federated-sign-in-container\"\n style=\"flex-direction: column; padding: 0 0 1rem 0\"\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\" style=\"align-self: center\">\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\" style=\"align-self: center\">\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\" style=\"align-self: center\">\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\" style=\"align-self: center\">\n {{ signInGoogleText }}\n </p>\n </amplify-federated-sign-in-button>\n\n
|
|
572
|
+
template: "<div\n class=\"amplify-flex federated-sign-in-container\"\n style=\"flex-direction: column; padding: 0 0 1rem 0\"\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\" style=\"align-self: center\">\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\" style=\"align-self: center\">\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\" style=\"align-self: center\">\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\" style=\"align-self: center\">\n {{ signInGoogleText }}\n </p>\n </amplify-federated-sign-in-button>\n\n\n <hr\n class=\"amplify-divider amplify-divider--label\"\n aria-orientation=\"horizontal\"\n data-size=\"small\"\n data-label=\"or\"\n />\n</div>\n"
|
|
520
573
|
},] }
|
|
521
574
|
];
|
|
522
575
|
FederatedSignInComponent.ctorParameters = () => [
|
|
@@ -532,9 +585,21 @@ class ForceNewPasswordComponent {
|
|
|
532
585
|
this.changePasswordText = translate('Change Password');
|
|
533
586
|
this.backToSignInText = translate('Back to Sign In');
|
|
534
587
|
}
|
|
588
|
+
ngOnInit() {
|
|
589
|
+
this.setFormFields();
|
|
590
|
+
}
|
|
535
591
|
get context() {
|
|
536
592
|
return this.authenticator.slotContext;
|
|
537
593
|
}
|
|
594
|
+
setFormFields() {
|
|
595
|
+
var _a, _b;
|
|
596
|
+
const _state = this.authenticator.authState;
|
|
597
|
+
this.formOverrides = (_b = (_a = getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.forceNewPassword;
|
|
598
|
+
}
|
|
599
|
+
grabField(name, field, defaultV) {
|
|
600
|
+
var _a, _b, _c;
|
|
601
|
+
return (_c = (_b = (_a = this.formOverrides) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b[field]) !== null && _c !== void 0 ? _c : defaultV;
|
|
602
|
+
}
|
|
538
603
|
onInput(event) {
|
|
539
604
|
event.preventDefault();
|
|
540
605
|
const { name, value } = event.target;
|
|
@@ -542,13 +607,13 @@ class ForceNewPasswordComponent {
|
|
|
542
607
|
}
|
|
543
608
|
onSubmit(event) {
|
|
544
609
|
event.preventDefault();
|
|
545
|
-
this.authenticator.submitForm();
|
|
610
|
+
this.authenticator.submitForm(getFormDataFromEvent(event));
|
|
546
611
|
}
|
|
547
612
|
}
|
|
548
613
|
ForceNewPasswordComponent.decorators = [
|
|
549
614
|
{ type: Component, args: [{
|
|
550
615
|
selector: 'amplify-force-new-password',
|
|
551
|
-
template: "<
|
|
616
|
+
template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: 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\">{{ this.headerText }}</h3>\n </amplify-slot>\n <amplify-form-field\n [labelHidden]=\"grabField('password', 'labelHidden', true)\"\n [placeholder]=\"grabField('password', 'placeholder', null)\"\n [required]=\"grabField('password', 'required', true)\"\n [label]=\"grabField('password', 'label', null)\"\n name=\"password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n\n <amplify-form-field\n name=\"confirm_password\"\n type=\"password\"\n autocomplete=\"new-password\"\n [labelHidden]=\"grabField('confirm_password', 'labelHidden', true)\"\n [placeholder]=\"grabField('confirm_password', 'placeholder', null)\"\n [required]=\"grabField('confirm_password', 'required', true)\"\n [label]=\"grabField('confirm_password', 'label', 'Confirm Password')\"\n ></amplify-form-field>\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"
|
|
552
617
|
},] }
|
|
553
618
|
];
|
|
554
619
|
ForceNewPasswordComponent.ctorParameters = () => [
|
|
@@ -605,14 +670,15 @@ class FormFieldComponent {
|
|
|
605
670
|
this.disabled = false;
|
|
606
671
|
this.autocomplete = '';
|
|
607
672
|
this.labelHidden = true;
|
|
608
|
-
this.
|
|
673
|
+
this.countryDialCodesValue = countryDialCodes;
|
|
609
674
|
}
|
|
610
675
|
ngOnInit() {
|
|
676
|
+
var _a;
|
|
611
677
|
// TODO: consider better default handling mechanisms across frameworks
|
|
612
678
|
if (this.isPhoneField()) {
|
|
613
679
|
const state = this.authenticator.authState;
|
|
614
680
|
const { country_code } = getActorContext(state);
|
|
615
|
-
this.
|
|
681
|
+
this.defaultCountryCodeValue = (_a = this.defaultCountryCode) !== null && _a !== void 0 ? _a : country_code;
|
|
616
682
|
}
|
|
617
683
|
}
|
|
618
684
|
get attributeMap() {
|
|
@@ -658,7 +724,7 @@ class FormFieldComponent {
|
|
|
658
724
|
FormFieldComponent.decorators = [
|
|
659
725
|
{ type: Component, args: [{
|
|
660
726
|
selector: 'amplify-form-field',
|
|
661
|
-
template: "<div class=\"amplify-flex amplify-field\" style=\"flex-direction: column\">\n <!-- Country code field -->\n <amplify-phone-number-field\n *ngIf=\"isPhoneField()\"\n [defaultCountryCode]=\"
|
|
727
|
+
template: "<div class=\"amplify-flex amplify-field\" style=\"flex-direction: column\">\n <!-- Country code field -->\n <amplify-phone-number-field\n *ngIf=\"isPhoneField()\"\n [defaultCountryCode]=\"defaultCountryCodeValue\"\n [dialCodeList]=\"dialCodeList\"\n [type]=\"inferType()\"\n [name]=\"name\"\n [label]=\"inferLabel()\"\n [placeholder]=\"inferPlaceholder()\"\n [required]=\"required\"\n [initialValue]=\"initialValue\"\n [disabled]=\"disabled\"\n [labelHidden]=\"labelHidden\"\n [autocomplete]=\"inferAutocomplete()\"\n ></amplify-phone-number-field>\n\n <amplify-password-field\n *ngIf=\"isPasswordField()\"\n [name]=\"name\"\n [label]=\"inferLabel()\"\n [placeholder]=\"inferPlaceholder()\"\n [required]=\"required\"\n [initialValue]=\"initialValue\"\n [disabled]=\"disabled\"\n [labelHidden]=\"labelHidden\"\n [autocomplete]=\"inferAutocomplete()\"\n (setBlur)=\"onBlur($event)\"\n ></amplify-password-field>\n\n <amplify-text-field\n *ngIf=\"!isPasswordField() && !isPhoneField()\"\n [type]=\"inferType()\"\n [name]=\"name\"\n [label]=\"inferLabel()\"\n [placeholder]=\"inferPlaceholder()\"\n [required]=\"required\"\n [initialValue]=\"initialValue\"\n [disabled]=\"disabled\"\n [labelHidden]=\"labelHidden\"\n [autocomplete]=\"inferAutocomplete()\"\n ></amplify-text-field>\n\n <amplify-error *ngIf=\"error\">\n {{ error }}\n </amplify-error>\n</div>\n"
|
|
662
728
|
},] }
|
|
663
729
|
];
|
|
664
730
|
FormFieldComponent.ctorParameters = () => [
|
|
@@ -673,7 +739,9 @@ FormFieldComponent.propDecorators = {
|
|
|
673
739
|
initialValue: [{ type: Input }],
|
|
674
740
|
disabled: [{ type: Input }],
|
|
675
741
|
autocomplete: [{ type: Input }],
|
|
676
|
-
labelHidden: [{ type: Input }]
|
|
742
|
+
labelHidden: [{ type: Input }],
|
|
743
|
+
defaultCountryCode: [{ type: Input }],
|
|
744
|
+
dialCodeList: [{ type: Input }]
|
|
677
745
|
};
|
|
678
746
|
|
|
679
747
|
class ResetPasswordComponent {
|
|
@@ -690,6 +758,16 @@ class ResetPasswordComponent {
|
|
|
690
758
|
const { authState } = this.authenticator;
|
|
691
759
|
const { label } = getAliasInfoFromContext(authState.context);
|
|
692
760
|
this.labelText = `Enter your ${label.toLowerCase()}`;
|
|
761
|
+
this.setFormFields();
|
|
762
|
+
}
|
|
763
|
+
setFormFields() {
|
|
764
|
+
var _a, _b;
|
|
765
|
+
const _state = this.authenticator.authState;
|
|
766
|
+
this.formOverrides = (_b = (_a = getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.resetPassword;
|
|
767
|
+
}
|
|
768
|
+
grabField(name, field, defaultV) {
|
|
769
|
+
var _a, _b, _c;
|
|
770
|
+
return (_c = (_b = (_a = this.formOverrides) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b[field]) !== null && _c !== void 0 ? _c : defaultV;
|
|
693
771
|
}
|
|
694
772
|
get context() {
|
|
695
773
|
return this.authenticator.slotContext;
|
|
@@ -701,13 +779,13 @@ class ResetPasswordComponent {
|
|
|
701
779
|
}
|
|
702
780
|
onSubmit(event) {
|
|
703
781
|
event.preventDefault();
|
|
704
|
-
this.authenticator.submitForm();
|
|
782
|
+
this.authenticator.submitForm(getFormDataFromEvent(event));
|
|
705
783
|
}
|
|
706
784
|
}
|
|
707
785
|
ResetPasswordComponent.decorators = [
|
|
708
786
|
{ type: Component, args: [{
|
|
709
787
|
selector: 'amplify-reset-password',
|
|
710
|
-
template: "<
|
|
788
|
+
template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot\n class=\"amplify-flex\"\n name=\"reset-password-header\"\n [context]=\"context\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n </amplify-slot>\n\n <amplify-form-field\n name=\"username\"\n type=\"username\"\n autocomplete=\"username\"\n [labelHidden]=\"grabField('username', 'labelHidden', true)\"\n [required]=\"grabField('username', 'required', true)\"\n [label]=\"grabField('username', 'label', labelText)\"\n [placeholder]=\"grabField('username', 'placeholder', labelText)\"\n ></amplify-form-field>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\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=\"reset-password-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n"
|
|
711
789
|
},] }
|
|
712
790
|
];
|
|
713
791
|
ResetPasswordComponent.ctorParameters = () => [
|
|
@@ -733,11 +811,22 @@ class SetupTotpComponent {
|
|
|
733
811
|
}
|
|
734
812
|
ngOnInit() {
|
|
735
813
|
this.generateQRCode();
|
|
814
|
+
this.setFormFields();
|
|
815
|
+
}
|
|
816
|
+
setFormFields() {
|
|
817
|
+
var _a, _b;
|
|
818
|
+
const _state = this.authenticator.authState;
|
|
819
|
+
this.formOverrides = (_b = (_a = getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.setupTOTP;
|
|
820
|
+
}
|
|
821
|
+
grabField(name, field, defaultV) {
|
|
822
|
+
var _a, _b, _c;
|
|
823
|
+
return (_c = (_b = (_a = this.formOverrides) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b[field]) !== null && _c !== void 0 ? _c : defaultV;
|
|
736
824
|
}
|
|
737
825
|
get context() {
|
|
738
826
|
return this.authenticator.slotContext;
|
|
739
827
|
}
|
|
740
828
|
generateQRCode() {
|
|
829
|
+
var _a, _b, _c, _d, _e, _f;
|
|
741
830
|
return __awaiter(this, void 0, void 0, function* () {
|
|
742
831
|
// TODO: This should be handled in core.
|
|
743
832
|
const state = this.authenticator.authState;
|
|
@@ -745,8 +834,9 @@ class SetupTotpComponent {
|
|
|
745
834
|
const { user } = actorContext;
|
|
746
835
|
try {
|
|
747
836
|
this.secretKey = yield Auth.setupTOTP(user);
|
|
748
|
-
const issuer = 'AWSCognito';
|
|
749
|
-
const
|
|
837
|
+
const issuer = (_c = (_b = (_a = this.formOverrides) === null || _a === void 0 ? void 0 : _a['QR']) === null || _b === void 0 ? void 0 : _b.totpIssuer) !== null && _c !== void 0 ? _c : 'AWSCognito';
|
|
838
|
+
const username = (_f = (_e = (_d = this.formOverrides) === null || _d === void 0 ? void 0 : _d['QR']) === null || _e === void 0 ? void 0 : _e.totpUsername) !== null && _f !== void 0 ? _f : user.username;
|
|
839
|
+
const totpCode = `otpauth://totp/${issuer}:${username}?secret=${this.secretKey}&issuer=${issuer}`;
|
|
750
840
|
logger.info('totp code was generated:', totpCode);
|
|
751
841
|
this.qrCodeSource = yield QRCode.toDataURL(totpCode);
|
|
752
842
|
}
|
|
@@ -762,7 +852,7 @@ class SetupTotpComponent {
|
|
|
762
852
|
}
|
|
763
853
|
onSubmit(event) {
|
|
764
854
|
event.preventDefault();
|
|
765
|
-
this.authenticator.submitForm();
|
|
855
|
+
this.authenticator.submitForm(getFormDataFromEvent(event));
|
|
766
856
|
}
|
|
767
857
|
copyText() {
|
|
768
858
|
navigator.clipboard.writeText(this.secretKey);
|
|
@@ -772,7 +862,7 @@ class SetupTotpComponent {
|
|
|
772
862
|
SetupTotpComponent.decorators = [
|
|
773
863
|
{ type: Component, args: [{
|
|
774
864
|
selector: 'amplify-setup-totp',
|
|
775
|
-
template: "<
|
|
865
|
+
template: "<form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"setup-totp-header\" [context]=\"context\">\n <h3 class=\"amplify-heading\">{{ 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>{{ secretKey }}</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-form-field\n name=\"confirmation_code\"\n type=\"text\"\n autocomplete=\"one-time-code\"\n [labelHidden]=\"grabField('confirmation_code', 'labelHidden', true)\"\n [placeholder]=\"grabField('confirmation_code', 'placeholder', null)\"\n [required]=\"grabField('confirmation_code', 'required', true)\"\n [label]=\"grabField('confirmation_code', 'label', 'Code *')\"\n ></amplify-form-field>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\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"
|
|
776
866
|
},] }
|
|
777
867
|
];
|
|
778
868
|
SetupTotpComponent.ctorParameters = () => [
|
|
@@ -793,6 +883,24 @@ class SignInComponent {
|
|
|
793
883
|
: translate('Forgot your password? ');
|
|
794
884
|
this.signInButtonText = translate('Sign in');
|
|
795
885
|
}
|
|
886
|
+
ngOnInit() {
|
|
887
|
+
this.setFormFields();
|
|
888
|
+
}
|
|
889
|
+
setFormFields() {
|
|
890
|
+
var _a, _b, _c, _d;
|
|
891
|
+
const _state = this.authenticator.authState;
|
|
892
|
+
this.formOverrides = (_b = (_a = getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.signIn;
|
|
893
|
+
this.userOverrides = (_c = this.formOverrides) === null || _c === void 0 ? void 0 : _c['username'];
|
|
894
|
+
this.passwordOR = (_d = this.formOverrides) === null || _d === void 0 ? void 0 : _d['password'];
|
|
895
|
+
}
|
|
896
|
+
labelHidden(name, defaultV = true) {
|
|
897
|
+
var _a, _b, _c;
|
|
898
|
+
return (_c = (_b = (_a = this.formOverrides) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b.labelHidden) !== null && _c !== void 0 ? _c : defaultV;
|
|
899
|
+
}
|
|
900
|
+
required(name, defaultV = true) {
|
|
901
|
+
var _a, _b, _c;
|
|
902
|
+
return (_c = (_b = (_a = this.formOverrides) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b.required) !== null && _c !== void 0 ? _c : defaultV;
|
|
903
|
+
}
|
|
796
904
|
get context() {
|
|
797
905
|
return this.authenticator.slotContext;
|
|
798
906
|
}
|
|
@@ -803,13 +911,13 @@ class SignInComponent {
|
|
|
803
911
|
}
|
|
804
912
|
onSubmit(event) {
|
|
805
913
|
event.preventDefault();
|
|
806
|
-
this.authenticator.submitForm();
|
|
914
|
+
this.authenticator.submitForm(getFormDataFromEvent(event));
|
|
807
915
|
}
|
|
808
916
|
}
|
|
809
917
|
SignInComponent.decorators = [
|
|
810
918
|
{ type: Component, args: [{
|
|
811
919
|
selector: 'amplify-sign-in',
|
|
812
|
-
template: "<
|
|
920
|
+
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\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-user-name-alias\n [labelHidden]=\"labelHidden('username')\"\n [placeholder]=\"userOverrides?.placeholder\"\n [required]=\"required('username')\"\n [label]=\"userOverrides?.label\"\n [dialCode]=\"userOverrides?.dialCode\"\n [dialCodeList]=\"userOverrides?.dialCodeList\"\n ></amplify-user-name-alias>\n <amplify-form-field\n [labelHidden]=\"labelHidden('password')\"\n [placeholder]=\"passwordOR?.placeholder\"\n [required]=\"required('password')\"\n [label]=\"passwordOR?.label\"\n data-amplify-password\n name=\"password\"\n type=\"password\"\n autocomplete=\"current-password\"\n ></amplify-form-field>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\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.toResetPassword()\"\n >\n {{ forgotPasswordText }}\n </button>\n </div>\n</amplify-slot>\n",
|
|
813
921
|
encapsulation: ViewEncapsulation.None
|
|
814
922
|
},] }
|
|
815
923
|
];
|
|
@@ -838,7 +946,7 @@ class SignUpComponent {
|
|
|
838
946
|
}
|
|
839
947
|
onSubmit(event) {
|
|
840
948
|
event.preventDefault();
|
|
841
|
-
this.authenticator.submitForm();
|
|
949
|
+
this.authenticator.submitForm(getFormDataFromEvent(event));
|
|
842
950
|
}
|
|
843
951
|
}
|
|
844
952
|
SignUpComponent.decorators = [
|
|
@@ -873,12 +981,30 @@ class SignUpFormFieldsComponent {
|
|
|
873
981
|
});
|
|
874
982
|
// Only 1 is supported, so `['email', 'phone_number']` will only show `email`
|
|
875
983
|
this.loginMechanism = this.fieldNames.shift();
|
|
984
|
+
const common = [
|
|
985
|
+
this.loginMechanism,
|
|
986
|
+
'password',
|
|
987
|
+
'confirm_password',
|
|
988
|
+
];
|
|
989
|
+
this.fieldNamesCombined = [...common, ...this.fieldNames];
|
|
990
|
+
this.setFormFields();
|
|
991
|
+
}
|
|
992
|
+
setFormFields() {
|
|
993
|
+
var _a, _b, _c;
|
|
994
|
+
const _state = this.authenticator.authState;
|
|
995
|
+
this.formOverrides = (_b = (_a = getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.signUp;
|
|
996
|
+
this.userOverrides = (_c = this.formOverrides) === null || _c === void 0 ? void 0 : _c[this.loginMechanism];
|
|
997
|
+
this.order = setFormOrder(this.formOverrides, this.fieldNamesCombined);
|
|
998
|
+
}
|
|
999
|
+
grabField(name, field, defaultV) {
|
|
1000
|
+
var _a, _b, _c;
|
|
1001
|
+
return (_c = (_b = (_a = this.formOverrides) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b[field]) !== null && _c !== void 0 ? _c : defaultV;
|
|
876
1002
|
}
|
|
877
1003
|
}
|
|
878
1004
|
SignUpFormFieldsComponent.decorators = [
|
|
879
1005
|
{ type: Component, args: [{
|
|
880
1006
|
selector: 'amplify-sign-up-form-fields',
|
|
881
|
-
template: "<div class=\"amplify-flex\" style=\"flex-direction: column\" data-amplify-fieldset>\n <amplify-user-name-alias
|
|
1007
|
+
template: "<div class=\"amplify-flex\" style=\"flex-direction: column\" data-amplify-fieldset>\n <ng-container *ngFor=\"let field of order\">\n <ng-container [ngSwitch]=\"field\">\n <amplify-user-name-alias\n *ngSwitchCase=\"loginMechanism\"\n [name]=\"loginMechanism\"\n [labelHidden]=\"grabField(loginMechanism, 'labelHidden', true)\"\n [placeholder]=\"userOverrides?.placeholder\"\n [required]=\"grabField(loginMechanism, 'required', true)\"\n [label]=\"userOverrides?.label\"\n [dialCode]=\"userOverrides?.dialCode\"\n [dialCodeList]=\"userOverrides?.dialCodeList\"\n ></amplify-user-name-alias>\n <amplify-form-field\n *ngSwitchCase=\"'password'\"\n [labelHidden]=\"grabField('password', 'labelHidden', true)\"\n [placeholder]=\"grabField('password', 'placeholder', null)\"\n [required]=\"grabField('password', 'required', true)\"\n [label]=\"grabField('password', 'label', null)\"\n name=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n <amplify-form-field\n *ngSwitchCase=\"'confirm_password'\"\n [labelHidden]=\"grabField('confirm_password', 'labelHidden', true)\"\n [placeholder]=\"\n grabField('confirm_password', 'placeholder', 'Confirm Password')\n \"\n [required]=\"grabField('confirm_password', 'required', true)\"\n [label]=\"grabField('confirm_password', 'label', 'Confirm Password')\"\n name=\"confirm_password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n\n <amplify-form-field\n *ngSwitchDefault\n [name]=\"field\"\n [labelHidden]=\"grabField(field, 'labelHidden', false)\"\n [placeholder]=\"grabField(field, 'placeholder', null)\"\n [required]=\"grabField(field, 'required', true)\"\n [label]=\"grabField(field, 'label', null)\"\n [defaultCountryCode]=\"grabField(field, 'dialCode', null)\"\n [dialCodeList]=\"grabField(field, 'dialCodeList', null)\"\n ></amplify-form-field>\n </ng-container>\n </ng-container>\n</div>\n"
|
|
882
1008
|
},] }
|
|
883
1009
|
];
|
|
884
1010
|
SignUpFormFieldsComponent.ctorParameters = () => [
|
|
@@ -894,17 +1020,19 @@ class UserNameAliasComponent {
|
|
|
894
1020
|
this.required = true;
|
|
895
1021
|
}
|
|
896
1022
|
ngOnInit() {
|
|
1023
|
+
var _a, _b, _c;
|
|
897
1024
|
const context = this.authenticator.context;
|
|
898
|
-
const { label, type } = getAliasInfoFromContext(context);
|
|
899
|
-
this.
|
|
1025
|
+
const { label: lbl, type } = getAliasInfoFromContext(context);
|
|
1026
|
+
this.labelValue = (_a = this.label) !== null && _a !== void 0 ? _a : lbl;
|
|
900
1027
|
this.type = type;
|
|
901
|
-
this.
|
|
1028
|
+
this.placeholderValue = (_b = this.placeholder) !== null && _b !== void 0 ? _b : lbl;
|
|
1029
|
+
this.requiredValue = (_c = this.required) !== null && _c !== void 0 ? _c : true;
|
|
902
1030
|
}
|
|
903
1031
|
}
|
|
904
1032
|
UserNameAliasComponent.decorators = [
|
|
905
1033
|
{ type: Component, args: [{
|
|
906
1034
|
selector: 'amplify-user-name-alias',
|
|
907
|
-
template: "<amplify-form-field\n data-amplify-usernamealias\n [name]=\"name\"\n [
|
|
1035
|
+
template: "<amplify-form-field\n data-amplify-usernamealias\n [name]=\"name\"\n [labelHidden]=\"labelHidden\"\n [label]=\"labelValue\"\n [placeholder]=\"placeholderValue\"\n [required]=\"requiredValue\"\n [defaultCountryCode]=\"dialCode\"\n [dialCodeList]=\"dialCodeList\"\n [type]=\"type\"\n [initialValue]=\"initialValue\"\n [disabled]=\"disabled\"\n autocomplete=\"username\"\n>\n</amplify-form-field>\n"
|
|
908
1036
|
},] }
|
|
909
1037
|
];
|
|
910
1038
|
UserNameAliasComponent.ctorParameters = () => [
|
|
@@ -914,7 +1042,12 @@ UserNameAliasComponent.propDecorators = {
|
|
|
914
1042
|
name: [{ type: Input }],
|
|
915
1043
|
disabled: [{ type: Input }],
|
|
916
1044
|
initialValue: [{ type: Input }],
|
|
917
|
-
required: [{ type: Input }]
|
|
1045
|
+
required: [{ type: Input }],
|
|
1046
|
+
labelHidden: [{ type: Input }],
|
|
1047
|
+
label: [{ type: Input }],
|
|
1048
|
+
placeholder: [{ type: Input }],
|
|
1049
|
+
dialCode: [{ type: Input }],
|
|
1050
|
+
dialCodeList: [{ type: Input }]
|
|
918
1051
|
};
|
|
919
1052
|
|
|
920
1053
|
class VerifyUserComponent {
|
|
@@ -948,13 +1081,13 @@ class VerifyUserComponent {
|
|
|
948
1081
|
}
|
|
949
1082
|
onSubmit(event) {
|
|
950
1083
|
event.preventDefault();
|
|
951
|
-
this.authenticator.submitForm();
|
|
1084
|
+
this.authenticator.submitForm(getFormDataFromEvent(event));
|
|
952
1085
|
}
|
|
953
1086
|
}
|
|
954
1087
|
VerifyUserComponent.decorators = [
|
|
955
1088
|
{ type: Component, args: [{
|
|
956
1089
|
selector: 'amplify-verify-user',
|
|
957
|
-
template: "<
|
|
1090
|
+
template: "<form data-amplify-form (input)=\"onInput($event)\" (submit)=\"onSubmit($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"verify-user-header\" [context]=\"context\">\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n </amplify-slot>\n\n <div *ngFor=\"let unverifiedAttribute of unverifiedAttributes | keyvalue\">\n <input\n name=\"unverifiedAttr\"\n type=\"radio\"\n [value]=\"unverifiedAttribute.key\"\n [id]=\"labelId\"\n />\n <label [for]=\"labelId\">{{\n getLabelForAttr(unverifiedAttribute.key)\n }}</label>\n </div>\n\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\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",
|
|
958
1091
|
encapsulation: ViewEncapsulation.None
|
|
959
1092
|
},] }
|
|
960
1093
|
];
|
|
@@ -1074,7 +1207,7 @@ class PasswordFieldComponent {
|
|
|
1074
1207
|
PasswordFieldComponent.decorators = [
|
|
1075
1208
|
{ type: Component, args: [{
|
|
1076
1209
|
selector: 'amplify-password-field',
|
|
1077
|
-
template: "<label
|
|
1210
|
+
template: "<label\n class=\"amplify-label\"\n [class.amplify-visually-hidden]=\"labelHidden\"\n [for]=\"fieldId\"\n>\n {{ label }}\n</label>\n<div class=\"amplify-flex amplify-field-group\">\n <input\n class=\"amplify-input amplify-field-group__control\"\n [id]=\"fieldId\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [attr.disabled]=\"disabled ? '' : null\"\n [autocomplete]=\"autocomplete\"\n (blur)=\"setBlur.emit($event)\"\n />\n <div class=\"amplify-field-group__outer-end\">\n <button\n amplify-button\n [attr.aria-label]=\"showPasswordButtonlabel\"\n class=\"amplify-field-group__control amplify-field__show-password\"\n (click)=\"togglePasswordText()\"\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"
|
|
1078
1211
|
},] }
|
|
1079
1212
|
];
|
|
1080
1213
|
PasswordFieldComponent.propDecorators = {
|
|
@@ -1102,13 +1235,16 @@ class PhoneNumberFieldComponent {
|
|
|
1102
1235
|
this.required = true;
|
|
1103
1236
|
this.labelHidden = false;
|
|
1104
1237
|
this.display = 'contents';
|
|
1105
|
-
|
|
1238
|
+
}
|
|
1239
|
+
ngOnInit() {
|
|
1240
|
+
var _a;
|
|
1241
|
+
this.countryDialCodesValues = (_a = this.dialCodeList) !== null && _a !== void 0 ? _a : countryDialCodes;
|
|
1106
1242
|
}
|
|
1107
1243
|
}
|
|
1108
1244
|
PhoneNumberFieldComponent.decorators = [
|
|
1109
1245
|
{ type: Component, args: [{
|
|
1110
1246
|
selector: 'amplify-phone-number-field',
|
|
1111
|
-
template: "<label
|
|
1247
|
+
template: "<label\n class=\"amplify-label\"\n [class.amplify-visually-hidden]=\"labelHidden\"\n [for]=\"textFieldId\"\n>\n {{ label }}\n</label>\n<div\n class=\"amplify-flex amplify-phonenumberfield\"\n amplify-field-group\n style=\"gap: 0px\"\n>\n <div class=\"amplify-field-group__outer-start\">\n <div\n class=\"\n amplify-flex amplify-field amplify-selectfield amplify-countrycodeselect\n \"\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 <input\n class=\"amplify-input\"\n [id]=\"textFieldId\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [attr.disabled]=\"disabled ? '' : null\"\n [autocomplete]=\"autocomplete\"\n />\n</div>\n"
|
|
1112
1248
|
},] }
|
|
1113
1249
|
];
|
|
1114
1250
|
PhoneNumberFieldComponent.propDecorators = {
|
|
@@ -1124,6 +1260,7 @@ PhoneNumberFieldComponent.propDecorators = {
|
|
|
1124
1260
|
required: [{ type: Input }],
|
|
1125
1261
|
type: [{ type: Input }],
|
|
1126
1262
|
labelHidden: [{ type: Input }],
|
|
1263
|
+
dialCodeList: [{ type: Input }],
|
|
1127
1264
|
display: [{ type: HostBinding, args: ['style.display',] }]
|
|
1128
1265
|
};
|
|
1129
1266
|
|
|
@@ -1132,7 +1269,7 @@ class SelectComponent {
|
|
|
1132
1269
|
SelectComponent.decorators = [
|
|
1133
1270
|
{ type: Component, args: [{
|
|
1134
1271
|
selector: 'amplify-form-select',
|
|
1135
|
-
template: "<label class=\"amplify-label
|
|
1272
|
+
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-wrapper\"\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"
|
|
1136
1273
|
},] }
|
|
1137
1274
|
];
|
|
1138
1275
|
SelectComponent.propDecorators = {
|
|
@@ -1222,7 +1359,7 @@ class TextFieldComponent {
|
|
|
1222
1359
|
TextFieldComponent.decorators = [
|
|
1223
1360
|
{ type: Component, args: [{
|
|
1224
1361
|
selector: 'amplify-text-field',
|
|
1225
|
-
template: "<label
|
|
1362
|
+
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 [id]=\"fieldId\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [attr.disabled]=\"disabled ? '' : null\"\n [autocomplete]=\"autocomplete\"\n/>\n"
|
|
1226
1363
|
},] }
|
|
1227
1364
|
];
|
|
1228
1365
|
TextFieldComponent.propDecorators = {
|