@aws-amplify/ui-angular 2.1.1 → 2.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.
Files changed (43) hide show
  1. package/aws-amplify-ui-angular.metadata.json +1 -1
  2. package/bundles/aws-amplify-ui-angular.umd.js +204 -61
  3. package/bundles/aws-amplify-ui-angular.umd.js.map +1 -1
  4. package/bundles/aws-amplify-ui-angular.umd.min.js +1 -1
  5. package/bundles/aws-amplify-ui-angular.umd.min.js.map +1 -1
  6. package/esm2015/index.js +5 -1
  7. package/esm2015/lib/components/authenticator/components/authenticator/authenticator.component.js +4 -2
  8. package/esm2015/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.js +16 -4
  9. package/esm2015/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.js +14 -4
  10. package/esm2015/lib/components/authenticator/components/confirm-sign-up/confirm-sign-up.component.js +23 -7
  11. package/esm2015/lib/components/authenticator/components/confirm-verify-user/amplify-confirm-verify-user.component.js +16 -4
  12. package/esm2015/lib/components/authenticator/components/force-new-password/force-new-password.component.js +16 -4
  13. package/esm2015/lib/components/authenticator/components/form-field/form-field.component.js +8 -5
  14. package/esm2015/lib/components/authenticator/components/reset-password/reset-password.component.js +14 -4
  15. package/esm2015/lib/components/authenticator/components/setup-totp/setup-totp.component.js +18 -6
  16. package/esm2015/lib/components/authenticator/components/sign-in/sign-in.component.js +23 -5
  17. package/esm2015/lib/components/authenticator/components/sign-up/sign-up-form-fields/sign-up-form-fields.component.js +21 -3
  18. package/esm2015/lib/components/authenticator/components/sign-up/sign-up.component.js +3 -3
  19. package/esm2015/lib/components/authenticator/components/user-name-alias/user-name-alias.component.js +13 -6
  20. package/esm2015/lib/components/authenticator/components/verify-user/verify-user.component.js +3 -3
  21. package/esm2015/lib/primitives/password-field/password-field.component.js +2 -2
  22. package/esm2015/lib/primitives/phone-number-field/phone-number-field.component.js +7 -3
  23. package/esm2015/lib/primitives/select/select.component.js +2 -2
  24. package/esm2015/lib/primitives/text-field/text-field.component.js +2 -2
  25. package/esm2015/lib/services/authenticator.service.js +3 -2
  26. package/fesm2015/aws-amplify-ui-angular.js +179 -41
  27. package/fesm2015/aws-amplify-ui-angular.js.map +1 -1
  28. package/index.d.ts +4 -0
  29. package/lib/components/authenticator/components/authenticator/authenticator.component.d.ts +1 -0
  30. package/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.d.ts +7 -1
  31. package/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.d.ts +4 -0
  32. package/lib/components/authenticator/components/confirm-sign-up/confirm-sign-up.component.d.ts +11 -1
  33. package/lib/components/authenticator/components/confirm-verify-user/amplify-confirm-verify-user.component.d.ts +7 -1
  34. package/lib/components/authenticator/components/force-new-password/force-new-password.component.d.ts +7 -1
  35. package/lib/components/authenticator/components/form-field/form-field.component.d.ts +3 -1
  36. package/lib/components/authenticator/components/reset-password/reset-password.component.d.ts +4 -0
  37. package/lib/components/authenticator/components/setup-totp/setup-totp.component.d.ts +4 -0
  38. package/lib/components/authenticator/components/sign-in/sign-in.component.d.ts +10 -1
  39. package/lib/components/authenticator/components/sign-up/sign-up-form-fields/sign-up-form-fields.component.d.ts +7 -1
  40. package/lib/components/authenticator/components/user-name-alias/user-name-alias.component.d.ts +7 -1
  41. package/lib/primitives/phone-number-field/phone-number-field.component.d.ts +5 -2
  42. package/lib/services/authenticator.service.d.ts +1 -1
  43. package/package.json +2 -2
@@ -87,7 +87,7 @@
87
87
  }
88
88
  AuthenticatorService.prototype.startMachine = function (_b) {
89
89
  var _this = this;
90
- var initialState = _b.initialState, loginMechanisms = _b.loginMechanisms, services = _b.services, signUpAttributes = _b.signUpAttributes, socialProviders = _b.socialProviders;
90
+ var initialState = _b.initialState, loginMechanisms = _b.loginMechanisms, services = _b.services, signUpAttributes = _b.signUpAttributes, socialProviders = _b.socialProviders, formFields = _b.formFields;
91
91
  var machine = ui.createAuthenticatorMachine();
92
92
  var authService = xstate.interpret(machine).start();
93
93
  authService.send({
@@ -98,6 +98,7 @@
98
98
  socialProviders: socialProviders,
99
99
  signUpAttributes: signUpAttributes,
100
100
  services: services,
101
+ formFields: formFields,
101
102
  },
102
103
  });
103
104
  this._machineSubscription = authService.subscribe(function (state) {
@@ -317,13 +318,14 @@
317
318
  this.signUpTitle = ui.translate('Create Account');
318
319
  }
319
320
  AuthenticatorComponent.prototype.ngOnInit = function () {
320
- var _a = this, initialState = _a.initialState, loginMechanisms = _a.loginMechanisms, services = _a.services, signUpAttributes = _a.signUpAttributes, socialProviders = _a.socialProviders;
321
+ var _a = this, initialState = _a.initialState, loginMechanisms = _a.loginMechanisms, services = _a.services, signUpAttributes = _a.signUpAttributes, socialProviders = _a.socialProviders, formFields = _a.formFields;
321
322
  this.authenticator.startMachine({
322
323
  initialState: initialState,
323
324
  loginMechanisms: loginMechanisms,
324
325
  services: services,
325
326
  signUpAttributes: signUpAttributes,
326
327
  socialProviders: socialProviders,
328
+ formFields: formFields,
327
329
  });
328
330
  /**
329
331
  * handling translations after content init, because authenticator and its
@@ -393,6 +395,7 @@
393
395
  { type: CustomComponentsService }
394
396
  ]; };
395
397
  AuthenticatorComponent.propDecorators = {
398
+ formFields: [{ type: i0.Input }],
396
399
  initialState: [{ type: i0.Input }],
397
400
  loginMechanisms: [{ type: i0.Input }],
398
401
  services: [{ type: i0.Input }],
@@ -413,6 +416,18 @@
413
416
  this.backToSignInText = ui.translate('Back to Sign In');
414
417
  this.resendCodeText = ui.translate('Resend Code');
415
418
  }
419
+ ConfirmResetPasswordComponent.prototype.ngOnInit = function () {
420
+ this.setFormFields();
421
+ };
422
+ ConfirmResetPasswordComponent.prototype.setFormFields = function () {
423
+ var _a, _b;
424
+ var _state = this.authenticator.authState;
425
+ this.formOverrides = (_b = (_a = ui.getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.confirmResetPassword;
426
+ };
427
+ ConfirmResetPasswordComponent.prototype.grabField = function (name, field, defaultV) {
428
+ var _a, _b, _c;
429
+ 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;
430
+ };
416
431
  Object.defineProperty(ConfirmResetPasswordComponent.prototype, "context", {
417
432
  get: function () {
418
433
  return this.authenticator.slotContext;
@@ -422,19 +437,19 @@
422
437
  });
423
438
  ConfirmResetPasswordComponent.prototype.onInput = function (event) {
424
439
  event.preventDefault();
425
- var _a = event.target, name = _a.name, value = _a.value;
440
+ var _d = event.target, name = _d.name, value = _d.value;
426
441
  this.authenticator.updateForm({ name: name, value: value });
427
442
  };
428
443
  ConfirmResetPasswordComponent.prototype.onSubmit = function (event) {
429
444
  event.preventDefault();
430
- this.authenticator.submitForm();
445
+ this.authenticator.submitForm(ui.getFormDataFromEvent(event));
431
446
  };
432
447
  return ConfirmResetPasswordComponent;
433
448
  }());
434
449
  ConfirmResetPasswordComponent.decorators = [
435
450
  { type: i0.Component, args: [{
436
451
  selector: 'amplify-confirm-reset-password',
437
- template: "<div data-amplify-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]=\"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 ></amplify-form-field>\n <amplify-form-field\n name=\"password\"\n label=\"New password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n <amplify-form-field\n name=\"confirm_password\"\n label=\"Confirm Password\"\n type=\"password\"\n autocomplete=\"new-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</div>\n"
452
+ template: "<div data-amplify-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]=\"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</div>\n"
438
453
  },] }
439
454
  ];
440
455
  ConfirmResetPasswordComponent.ctorParameters = function () { return [
@@ -455,6 +470,16 @@
455
470
  }
456
471
  ConfirmSignInComponent.prototype.ngOnInit = function () {
457
472
  this.setHeaderText();
473
+ this.setFormFields();
474
+ };
475
+ ConfirmSignInComponent.prototype.setFormFields = function () {
476
+ var _a, _b;
477
+ var _state = this.authenticator.authState;
478
+ this.formOverrides = (_b = (_a = ui.getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.confirmSignIn;
479
+ };
480
+ ConfirmSignInComponent.prototype.grabField = function (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;
458
483
  };
459
484
  Object.defineProperty(ConfirmSignInComponent.prototype, "context", {
460
485
  get: function () {
@@ -480,19 +505,19 @@
480
505
  };
481
506
  ConfirmSignInComponent.prototype.onInput = function (event) {
482
507
  event.preventDefault();
483
- var _a = event.target, name = _a.name, value = _a.value;
508
+ var _d = event.target, name = _d.name, value = _d.value;
484
509
  this.authenticator.updateForm({ name: name, value: value });
485
510
  };
486
511
  ConfirmSignInComponent.prototype.onSubmit = function (event) {
487
512
  event.preventDefault();
488
- this.authenticator.submitForm();
513
+ this.authenticator.submitForm(ui.getFormDataFromEvent(event));
489
514
  };
490
515
  return ConfirmSignInComponent;
491
516
  }());
492
517
  ConfirmSignInComponent.decorators = [
493
518
  { type: i0.Component, args: [{
494
519
  selector: 'amplify-confirm-sign-in',
495
- template: "<div data-amplify-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]=\"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 ></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</div>\n"
520
+ template: "<div data-amplify-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]=\"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</div>\n"
496
521
  },] }
497
522
  ];
498
523
  ConfirmSignInComponent.ctorParameters = function () { return [
@@ -510,7 +535,23 @@
510
535
  // translated texts
511
536
  this.resendCodeText = ui.translate('Resend Code');
512
537
  this.confirmText = ui.translate('Confirm');
538
+ this.emailMessage = ui.translate('Your code is on the way. To log in, enter the code we emailed to');
539
+ this.textedMessage = ui.translate('Your code is on the way. To log in, enter the code we texted to');
540
+ this.defaultMessage = ui.translate('Your code is on the way. To log in, enter the code we sent you. It may take a minute to arrive.');
541
+ this.minutesMessage = ui.translate('It may take a minute to arrive.');
513
542
  }
543
+ ConfirmSignUpComponent.prototype.ngOnInit = function () {
544
+ this.setFormFields();
545
+ };
546
+ ConfirmSignUpComponent.prototype.setFormFields = function () {
547
+ var _a, _b;
548
+ var _state = this.authenticator.authState;
549
+ this.formOverrides = (_b = (_a = ui.getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.confirmSignUp;
550
+ };
551
+ ConfirmSignUpComponent.prototype.grabField = function (name, field, defaultV) {
552
+ var _a, _b, _c;
553
+ 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;
554
+ };
514
555
  Object.defineProperty(ConfirmSignUpComponent.prototype, "context", {
515
556
  get: function () {
516
557
  return this.authenticator.slotContext;
@@ -520,7 +561,7 @@
520
561
  });
521
562
  Object.defineProperty(ConfirmSignUpComponent.prototype, "confirmSignUpHeading", {
522
563
  get: function () {
523
- var _a = this.authenticator.codeDeliveryDetails, _b = _a === void 0 ? {} : _a, DeliveryMedium = _b.DeliveryMedium;
564
+ var _d = this.authenticator.codeDeliveryDetails, _e = _d === void 0 ? {} : _d, DeliveryMedium = _e.DeliveryMedium;
524
565
  return DeliveryMedium === 'EMAIL'
525
566
  ? ui.translate('We Emailed You')
526
567
  : DeliveryMedium === 'SMS'
@@ -532,31 +573,31 @@
532
573
  });
533
574
  Object.defineProperty(ConfirmSignUpComponent.prototype, "subtitleText", {
534
575
  get: function () {
535
- var _a = this.authenticator.codeDeliveryDetails, _b = _a === void 0 ? {} : _a, DeliveryMedium = _b.DeliveryMedium, Destination = _b.Destination;
576
+ var _d = this.authenticator.codeDeliveryDetails, _e = _d === void 0 ? {} : _d, DeliveryMedium = _e.DeliveryMedium, Destination = _e.Destination;
536
577
  return DeliveryMedium === 'EMAIL'
537
- ? "Your code is on the way. To log in, enter the code we emailed to " + Destination + ". It may take a minute to arrive."
578
+ ? this.emailMessage + " " + Destination + ". " + this.minutesMessage
538
579
  : DeliveryMedium === 'SMS'
539
- ? "Your code is on the way. To log in, enter the code we texted to " + Destination + ". It may take a minute to arrive."
540
- : ui.translate("Your code is on the way. To log in, enter the code we sent you. It may take a minute to arrive.");
580
+ ? this.textedMessage + " " + Destination + ". " + this.minutesMessage
581
+ : ui.translate("" + this.defaultMessage);
541
582
  },
542
583
  enumerable: false,
543
584
  configurable: true
544
585
  });
545
586
  ConfirmSignUpComponent.prototype.onInput = function (event) {
546
587
  event.preventDefault();
547
- var _a = event.target, name = _a.name, value = _a.value;
588
+ var _d = event.target, name = _d.name, value = _d.value;
548
589
  this.authenticator.updateForm({ name: name, value: value });
549
590
  };
550
591
  ConfirmSignUpComponent.prototype.onSubmit = function (event) {
551
592
  event.preventDefault();
552
- this.authenticator.submitForm();
593
+ this.authenticator.submitForm(ui.getFormDataFromEvent(event));
553
594
  };
554
595
  return ConfirmSignUpComponent;
555
596
  }());
556
597
  ConfirmSignUpComponent.decorators = [
557
598
  { type: i0.Component, args: [{
558
599
  selector: 'amplify-confirm-sign-up',
559
- template: "<div data-amplify-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 ></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</div>\n"
600
+ template: "<div data-amplify-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</div>\n"
560
601
  },] }
561
602
  ];
562
603
  ConfirmSignUpComponent.ctorParameters = function () { return [
@@ -576,6 +617,18 @@
576
617
  this.skipText = ui.translate('Skip');
577
618
  this.submitText = ui.translate('Submit');
578
619
  }
620
+ ConfirmVerifyUserComponent.prototype.ngOnInit = function () {
621
+ this.setFormFields();
622
+ };
623
+ ConfirmVerifyUserComponent.prototype.setFormFields = function () {
624
+ var _a, _b;
625
+ var _state = this.authenticator.authState;
626
+ this.formOverrides = (_b = (_a = ui.getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.confirmVerifyUser;
627
+ };
628
+ ConfirmVerifyUserComponent.prototype.grabField = function (name, field, defaultV) {
629
+ var _a, _b, _c;
630
+ 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;
631
+ };
579
632
  Object.defineProperty(ConfirmVerifyUserComponent.prototype, "context", {
580
633
  get: function () {
581
634
  return this.authenticator.slotContext;
@@ -585,19 +638,19 @@
585
638
  });
586
639
  ConfirmVerifyUserComponent.prototype.onInput = function (event) {
587
640
  event.preventDefault();
588
- var _a = event.target, name = _a.name, value = _a.value;
641
+ var _d = event.target, name = _d.name, value = _d.value;
589
642
  this.authenticator.updateForm({ name: name, value: value });
590
643
  };
591
644
  ConfirmVerifyUserComponent.prototype.onSubmit = function (event) {
592
645
  event.preventDefault();
593
- this.authenticator.submitForm();
646
+ this.authenticator.submitForm(ui.getFormDataFromEvent(event));
594
647
  };
595
648
  return ConfirmVerifyUserComponent;
596
649
  }());
597
650
  ConfirmVerifyUserComponent.decorators = [
598
651
  { type: i0.Component, args: [{
599
652
  selector: 'amplify-confirm-verify-user',
600
- template: "<div data-amplify-container>\n <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 ></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</div>\n"
653
+ template: "<div data-amplify-container>\n <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</div>\n"
601
654
  },] }
602
655
  ];
603
656
  ConfirmVerifyUserComponent.ctorParameters = function () { return [
@@ -688,6 +741,9 @@
688
741
  this.changePasswordText = ui.translate('Change Password');
689
742
  this.backToSignInText = ui.translate('Back to Sign In');
690
743
  }
744
+ ForceNewPasswordComponent.prototype.ngOnInit = function () {
745
+ this.setFormFields();
746
+ };
691
747
  Object.defineProperty(ForceNewPasswordComponent.prototype, "context", {
692
748
  get: function () {
693
749
  return this.authenticator.slotContext;
@@ -695,21 +751,30 @@
695
751
  enumerable: false,
696
752
  configurable: true
697
753
  });
754
+ ForceNewPasswordComponent.prototype.setFormFields = function () {
755
+ var _a, _b;
756
+ var _state = this.authenticator.authState;
757
+ this.formOverrides = (_b = (_a = ui.getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.forceNewPassword;
758
+ };
759
+ ForceNewPasswordComponent.prototype.grabField = function (name, field, defaultV) {
760
+ var _a, _b, _c;
761
+ 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;
762
+ };
698
763
  ForceNewPasswordComponent.prototype.onInput = function (event) {
699
764
  event.preventDefault();
700
- var _a = event.target, name = _a.name, value = _a.value;
765
+ var _d = event.target, name = _d.name, value = _d.value;
701
766
  this.authenticator.updateForm({ name: name, value: value });
702
767
  };
703
768
  ForceNewPasswordComponent.prototype.onSubmit = function (event) {
704
769
  event.preventDefault();
705
- this.authenticator.submitForm();
770
+ this.authenticator.submitForm(ui.getFormDataFromEvent(event));
706
771
  };
707
772
  return ForceNewPasswordComponent;
708
773
  }());
709
774
  ForceNewPasswordComponent.decorators = [
710
775
  { type: i0.Component, args: [{
711
776
  selector: 'amplify-force-new-password',
712
- template: "<div data-amplify-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]=\"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 name=\"password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n\n <amplify-form-field\n name=\"confirm_password\"\n label=\"Confirm Password\"\n type=\"password\"\n autocomplete=\"new-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</div>\n"
777
+ template: "<div data-amplify-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]=\"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</div>\n"
713
778
  },] }
714
779
  ];
715
780
  ForceNewPasswordComponent.ctorParameters = function () { return [
@@ -767,14 +832,15 @@
767
832
  this.disabled = false;
768
833
  this.autocomplete = '';
769
834
  this.labelHidden = true;
770
- this.countryDialCodes = ui.countryDialCodes;
835
+ this.countryDialCodesValue = ui.countryDialCodes;
771
836
  }
772
837
  FormFieldComponent.prototype.ngOnInit = function () {
838
+ var _a;
773
839
  // TODO: consider better default handling mechanisms across frameworks
774
840
  if (this.isPhoneField()) {
775
841
  var state = this.authenticator.authState;
776
842
  var country_code = ui.getActorContext(state).country_code;
777
- this.defaultCountryCode = country_code;
843
+ this.defaultCountryCodeValue = (_a = this.defaultCountryCode) !== null && _a !== void 0 ? _a : country_code;
778
844
  }
779
845
  };
780
846
  Object.defineProperty(FormFieldComponent.prototype, "attributeMap", {
@@ -829,7 +895,7 @@
829
895
  FormFieldComponent.decorators = [
830
896
  { type: i0.Component, args: [{
831
897
  selector: 'amplify-form-field',
832
- 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]=\"defaultCountryCode\"\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"
898
+ 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"
833
899
  },] }
834
900
  ];
835
901
  FormFieldComponent.ctorParameters = function () { return [
@@ -844,7 +910,9 @@
844
910
  initialValue: [{ type: i0.Input }],
845
911
  disabled: [{ type: i0.Input }],
846
912
  autocomplete: [{ type: i0.Input }],
847
- labelHidden: [{ type: i0.Input }]
913
+ labelHidden: [{ type: i0.Input }],
914
+ defaultCountryCode: [{ type: i0.Input }],
915
+ dialCodeList: [{ type: i0.Input }]
848
916
  };
849
917
 
850
918
  var ResetPasswordComponent = /** @class */ (function () {
@@ -861,6 +929,16 @@
861
929
  var authState = this.authenticator.authState;
862
930
  var label = ui.getAliasInfoFromContext(authState.context).label;
863
931
  this.labelText = "Enter your " + label.toLowerCase();
932
+ this.setFormFields();
933
+ };
934
+ ResetPasswordComponent.prototype.setFormFields = function () {
935
+ var _a, _b;
936
+ var _state = this.authenticator.authState;
937
+ this.formOverrides = (_b = (_a = ui.getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.resetPassword;
938
+ };
939
+ ResetPasswordComponent.prototype.grabField = function (name, field, defaultV) {
940
+ var _a, _b, _c;
941
+ 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;
864
942
  };
865
943
  Object.defineProperty(ResetPasswordComponent.prototype, "context", {
866
944
  get: function () {
@@ -871,19 +949,19 @@
871
949
  });
872
950
  ResetPasswordComponent.prototype.onInput = function (event) {
873
951
  event.preventDefault();
874
- var _a = event.target, name = _a.name, value = _a.value;
952
+ var _d = event.target, name = _d.name, value = _d.value;
875
953
  this.authenticator.updateForm({ name: name, value: value });
876
954
  };
877
955
  ResetPasswordComponent.prototype.onSubmit = function (event) {
878
956
  event.preventDefault();
879
- this.authenticator.submitForm();
957
+ this.authenticator.submitForm(ui.getFormDataFromEvent(event));
880
958
  };
881
959
  return ResetPasswordComponent;
882
960
  }());
883
961
  ResetPasswordComponent.decorators = [
884
962
  { type: i0.Component, args: [{
885
963
  selector: 'amplify-reset-password',
886
- template: "<div data-amplify-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]=\"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 [placeholder]=\"labelText\"\n [label]=\"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</div>\n"
964
+ template: "<div data-amplify-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]=\"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</div>\n"
887
965
  },] }
888
966
  ];
889
967
  ResetPasswordComponent.ctorParameters = function () { return [
@@ -1227,6 +1305,16 @@
1227
1305
  }
1228
1306
  SetupTotpComponent.prototype.ngOnInit = function () {
1229
1307
  this.generateQRCode();
1308
+ this.setFormFields();
1309
+ };
1310
+ SetupTotpComponent.prototype.setFormFields = function () {
1311
+ var _a, _b;
1312
+ var _state = this.authenticator.authState;
1313
+ this.formOverrides = (_b = (_a = ui.getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.setupTOTP;
1314
+ };
1315
+ SetupTotpComponent.prototype.grabField = function (name, field, defaultV) {
1316
+ var _a, _b, _c;
1317
+ 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;
1230
1318
  };
1231
1319
  Object.defineProperty(SetupTotpComponent.prototype, "context", {
1232
1320
  get: function () {
@@ -1236,31 +1324,33 @@
1236
1324
  configurable: true
1237
1325
  });
1238
1326
  SetupTotpComponent.prototype.generateQRCode = function () {
1327
+ var _a, _b, _c, _d, _e, _f;
1239
1328
  return __awaiter(this, void 0, void 0, function () {
1240
- var state, actorContext, user, _a, issuer, totpCode, _b, err_1;
1241
- return __generator(this, function (_c) {
1242
- switch (_c.label) {
1329
+ var state, actorContext, user, _g, issuer, username, totpCode, _h, err_1;
1330
+ return __generator(this, function (_j) {
1331
+ switch (_j.label) {
1243
1332
  case 0:
1244
1333
  state = this.authenticator.authState;
1245
1334
  actorContext = ui.getActorContext(state);
1246
1335
  user = actorContext.user;
1247
- _c.label = 1;
1336
+ _j.label = 1;
1248
1337
  case 1:
1249
- _c.trys.push([1, 4, , 5]);
1250
- _a = this;
1338
+ _j.trys.push([1, 4, , 5]);
1339
+ _g = this;
1251
1340
  return [4 /*yield*/, awsAmplify.Auth.setupTOTP(user)];
1252
1341
  case 2:
1253
- _a.secretKey = _c.sent();
1254
- issuer = 'AWSCognito';
1255
- totpCode = "otpauth://totp/" + issuer + ":" + user.username + "?secret=" + this.secretKey + "&issuer=" + issuer;
1342
+ _g.secretKey = _j.sent();
1343
+ 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';
1344
+ 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;
1345
+ totpCode = "otpauth://totp/" + issuer + ":" + username + "?secret=" + this.secretKey + "&issuer=" + issuer;
1256
1346
  logger.info('totp code was generated:', totpCode);
1257
- _b = this;
1347
+ _h = this;
1258
1348
  return [4 /*yield*/, QRCode__default["default"].toDataURL(totpCode)];
1259
1349
  case 3:
1260
- _b.qrCodeSource = _c.sent();
1350
+ _h.qrCodeSource = _j.sent();
1261
1351
  return [3 /*break*/, 5];
1262
1352
  case 4:
1263
- err_1 = _c.sent();
1353
+ err_1 = _j.sent();
1264
1354
  logger.error(err_1);
1265
1355
  return [3 /*break*/, 5];
1266
1356
  case 5: return [2 /*return*/];
@@ -1270,12 +1360,12 @@
1270
1360
  };
1271
1361
  SetupTotpComponent.prototype.onInput = function (event) {
1272
1362
  event.preventDefault();
1273
- var _a = event.target, name = _a.name, value = _a.value;
1363
+ var _g = event.target, name = _g.name, value = _g.value;
1274
1364
  this.authenticator.updateForm({ name: name, value: value });
1275
1365
  };
1276
1366
  SetupTotpComponent.prototype.onSubmit = function (event) {
1277
1367
  event.preventDefault();
1278
- this.authenticator.submitForm();
1368
+ this.authenticator.submitForm(ui.getFormDataFromEvent(event));
1279
1369
  };
1280
1370
  SetupTotpComponent.prototype.copyText = function () {
1281
1371
  navigator.clipboard.writeText(this.secretKey);
@@ -1286,7 +1376,7 @@
1286
1376
  SetupTotpComponent.decorators = [
1287
1377
  { type: i0.Component, args: [{
1288
1378
  selector: 'amplify-setup-totp',
1289
- template: "<div data-amplify-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]=\"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 fill=\"none\"\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 fill=\"black\"\n />\n </svg>\n </div>\n </div>\n\n <amplify-form-field\n name=\"confirmation_code\"\n label=\"Code *\"\n type=\"text\"\n autocomplete=\"one-time-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</div>\n"
1379
+ template: "<div data-amplify-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]=\"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 fill=\"none\"\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 fill=\"black\"\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</div>\n"
1290
1380
  },] }
1291
1381
  ];
1292
1382
  SetupTotpComponent.ctorParameters = function () { return [
@@ -1307,6 +1397,26 @@
1307
1397
  : ui.translate('Forgot your password? ');
1308
1398
  this.signInButtonText = ui.translate('Sign in');
1309
1399
  }
1400
+ SignInComponent.prototype.ngOnInit = function () {
1401
+ this.setFormFields();
1402
+ };
1403
+ SignInComponent.prototype.setFormFields = function () {
1404
+ var _a, _b, _c, _d;
1405
+ var _state = this.authenticator.authState;
1406
+ this.formOverrides = (_b = (_a = ui.getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.signIn;
1407
+ this.userOverrides = (_c = this.formOverrides) === null || _c === void 0 ? void 0 : _c['username'];
1408
+ this.passwordOR = (_d = this.formOverrides) === null || _d === void 0 ? void 0 : _d['password'];
1409
+ };
1410
+ SignInComponent.prototype.labelHidden = function (name, defaultV) {
1411
+ if (defaultV === void 0) { defaultV = true; }
1412
+ var _a, _b, _c;
1413
+ 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;
1414
+ };
1415
+ SignInComponent.prototype.required = function (name, defaultV) {
1416
+ if (defaultV === void 0) { defaultV = true; }
1417
+ var _a, _b, _c;
1418
+ 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;
1419
+ };
1310
1420
  Object.defineProperty(SignInComponent.prototype, "context", {
1311
1421
  get: function () {
1312
1422
  return this.authenticator.slotContext;
@@ -1316,19 +1426,19 @@
1316
1426
  });
1317
1427
  SignInComponent.prototype.onInput = function (event) {
1318
1428
  event.preventDefault();
1319
- var _a = event.target, name = _a.name, value = _a.value;
1429
+ var _e = event.target, name = _e.name, value = _e.value;
1320
1430
  this.authenticator.updateForm({ name: name, value: value });
1321
1431
  };
1322
1432
  SignInComponent.prototype.onSubmit = function (event) {
1323
1433
  event.preventDefault();
1324
- this.authenticator.submitForm();
1434
+ this.authenticator.submitForm(ui.getFormDataFromEvent(event));
1325
1435
  };
1326
1436
  return SignInComponent;
1327
1437
  }());
1328
1438
  SignInComponent.decorators = [
1329
1439
  { type: i0.Component, args: [{
1330
1440
  selector: 'amplify-sign-in',
1331
- template: "<div data-amplify-container>\n <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></amplify-user-name-alias>\n <amplify-form-field\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</div>\n",
1441
+ template: "<div data-amplify-container>\n <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</div>\n",
1332
1442
  encapsulation: i0.ViewEncapsulation.None
1333
1443
  },] }
1334
1444
  ];
@@ -1361,7 +1471,7 @@
1361
1471
  };
1362
1472
  SignUpComponent.prototype.onSubmit = function (event) {
1363
1473
  event.preventDefault();
1364
- this.authenticator.submitForm();
1474
+ this.authenticator.submitForm(ui.getFormDataFromEvent(event));
1365
1475
  };
1366
1476
  return SignUpComponent;
1367
1477
  }());
@@ -1386,7 +1496,7 @@
1386
1496
  }
1387
1497
  SignUpFormFieldsComponent.prototype.ngOnInit = function () {
1388
1498
  var context = this.authenticator.context;
1389
- var _a = context.config, loginMechanisms = _a.loginMechanisms, signUpAttributes = _a.signUpAttributes;
1499
+ var _d = context.config, loginMechanisms = _d.loginMechanisms, signUpAttributes = _d.signUpAttributes;
1390
1500
  this.fieldNames = Array.from(new Set(__spread(loginMechanisms, signUpAttributes)));
1391
1501
  this.fieldNames = this.fieldNames.filter(function (fieldName) {
1392
1502
  var hasDefaultField = !!ui.authInputAttributes[fieldName];
@@ -1397,13 +1507,31 @@
1397
1507
  });
1398
1508
  // Only 1 is supported, so `['email', 'phone_number']` will only show `email`
1399
1509
  this.loginMechanism = this.fieldNames.shift();
1510
+ var common = [
1511
+ this.loginMechanism,
1512
+ 'password',
1513
+ 'confirm_password',
1514
+ ];
1515
+ this.fieldNamesCombined = __spread(common, this.fieldNames);
1516
+ this.setFormFields();
1517
+ };
1518
+ SignUpFormFieldsComponent.prototype.setFormFields = function () {
1519
+ var _a, _b, _c;
1520
+ var _state = this.authenticator.authState;
1521
+ this.formOverrides = (_b = (_a = ui.getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.signUp;
1522
+ this.userOverrides = (_c = this.formOverrides) === null || _c === void 0 ? void 0 : _c[this.loginMechanism];
1523
+ this.order = ui.setFormOrder(this.formOverrides, this.fieldNamesCombined);
1524
+ };
1525
+ SignUpFormFieldsComponent.prototype.grabField = function (name, field, defaultV) {
1526
+ var _a, _b, _c;
1527
+ 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;
1400
1528
  };
1401
1529
  return SignUpFormFieldsComponent;
1402
1530
  }());
1403
1531
  SignUpFormFieldsComponent.decorators = [
1404
1532
  { type: i0.Component, args: [{
1405
1533
  selector: 'amplify-sign-up-form-fields',
1406
- template: "<div class=\"amplify-flex\" style=\"flex-direction: column\" data-amplify-fieldset>\n <amplify-user-name-alias [name]=\"loginMechanism\"></amplify-user-name-alias>\n <amplify-form-field\n name=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n <amplify-form-field\n name=\"confirm_password\"\n label=\"Confirm Password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n\n <ng-container *ngFor=\"let field of fieldNames\">\n <amplify-form-field\n [name]=\"field\"\n [labelHidden]=\"false\"\n ></amplify-form-field>\n </ng-container>\n</div>\n"
1534
+ 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"
1407
1535
  },] }
1408
1536
  ];
1409
1537
  SignUpFormFieldsComponent.ctorParameters = function () { return [
@@ -1419,18 +1547,20 @@
1419
1547
  this.required = true;
1420
1548
  }
1421
1549
  UserNameAliasComponent.prototype.ngOnInit = function () {
1550
+ var _a, _b, _c;
1422
1551
  var context = this.authenticator.context;
1423
- var _a = ui.getAliasInfoFromContext(context), label = _a.label, type = _a.type;
1424
- this.label = label;
1552
+ var _d = ui.getAliasInfoFromContext(context), lbl = _d.label, type = _d.type;
1553
+ this.labelValue = (_a = this.label) !== null && _a !== void 0 ? _a : lbl;
1425
1554
  this.type = type;
1426
- this.placeholder = label;
1555
+ this.placeholderValue = (_b = this.placeholder) !== null && _b !== void 0 ? _b : lbl;
1556
+ this.requiredValue = (_c = this.required) !== null && _c !== void 0 ? _c : true;
1427
1557
  };
1428
1558
  return UserNameAliasComponent;
1429
1559
  }());
1430
1560
  UserNameAliasComponent.decorators = [
1431
1561
  { type: i0.Component, args: [{
1432
1562
  selector: 'amplify-user-name-alias',
1433
- template: "<amplify-form-field\n data-amplify-usernamealias\n [name]=\"name\"\n [label]=\"label\"\n [type]=\"type\"\n [placeholder]=\"placeholder\"\n [initialValue]=\"initialValue\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n autocomplete=\"username\"\n>\n</amplify-form-field>\n"
1563
+ 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"
1434
1564
  },] }
1435
1565
  ];
1436
1566
  UserNameAliasComponent.ctorParameters = function () { return [
@@ -1440,7 +1570,12 @@
1440
1570
  name: [{ type: i0.Input }],
1441
1571
  disabled: [{ type: i0.Input }],
1442
1572
  initialValue: [{ type: i0.Input }],
1443
- required: [{ type: i0.Input }]
1573
+ required: [{ type: i0.Input }],
1574
+ labelHidden: [{ type: i0.Input }],
1575
+ label: [{ type: i0.Input }],
1576
+ placeholder: [{ type: i0.Input }],
1577
+ dialCode: [{ type: i0.Input }],
1578
+ dialCodeList: [{ type: i0.Input }]
1444
1579
  };
1445
1580
 
1446
1581
  var VerifyUserComponent = /** @class */ (function () {
@@ -1478,7 +1613,7 @@
1478
1613
  };
1479
1614
  VerifyUserComponent.prototype.onSubmit = function (event) {
1480
1615
  event.preventDefault();
1481
- this.authenticator.submitForm();
1616
+ this.authenticator.submitForm(ui.getFormDataFromEvent(event));
1482
1617
  };
1483
1618
  return VerifyUserComponent;
1484
1619
  }());
@@ -1609,7 +1744,7 @@
1609
1744
  PasswordFieldComponent.decorators = [
1610
1745
  { type: i0.Component, args: [{
1611
1746
  selector: 'amplify-password-field',
1612
- template: "<label class=\"amplify-label\" [class.sr-only]=\"labelHidden\" [for]=\"fieldId\">\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"
1747
+ 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"
1613
1748
  },] }
1614
1749
  ];
1615
1750
  PasswordFieldComponent.propDecorators = {
@@ -1637,14 +1772,17 @@
1637
1772
  this.required = true;
1638
1773
  this.labelHidden = false;
1639
1774
  this.display = 'contents';
1640
- this.countryDialCodes = ui.countryDialCodes;
1641
1775
  }
1776
+ PhoneNumberFieldComponent.prototype.ngOnInit = function () {
1777
+ var _a;
1778
+ this.countryDialCodesValues = (_a = this.dialCodeList) !== null && _a !== void 0 ? _a : ui.countryDialCodes;
1779
+ };
1642
1780
  return PhoneNumberFieldComponent;
1643
1781
  }());
1644
1782
  PhoneNumberFieldComponent.decorators = [
1645
1783
  { type: i0.Component, args: [{
1646
1784
  selector: 'amplify-phone-number-field',
1647
- template: "<label class=\"amplify-label\" [class.sr-only]=\"labelHidden\" [for]=\"textFieldId\">\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]=\"countryDialCodes\"\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"
1785
+ 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"
1648
1786
  },] }
1649
1787
  ];
1650
1788
  PhoneNumberFieldComponent.propDecorators = {
@@ -1660,6 +1798,7 @@
1660
1798
  required: [{ type: i0.Input }],
1661
1799
  type: [{ type: i0.Input }],
1662
1800
  labelHidden: [{ type: i0.Input }],
1801
+ dialCodeList: [{ type: i0.Input }],
1663
1802
  display: [{ type: i0.HostBinding, args: ['style.display',] }]
1664
1803
  };
1665
1804
 
@@ -1671,7 +1810,7 @@
1671
1810
  SelectComponent.decorators = [
1672
1811
  { type: i0.Component, args: [{
1673
1812
  selector: 'amplify-form-select',
1674
- template: "<label class=\"amplify-label sr-only\" [for]=\"id\">{{ label }}</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"
1813
+ 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"
1675
1814
  },] }
1676
1815
  ];
1677
1816
  SelectComponent.propDecorators = {
@@ -1764,7 +1903,7 @@
1764
1903
  TextFieldComponent.decorators = [
1765
1904
  { type: i0.Component, args: [{
1766
1905
  selector: 'amplify-text-field',
1767
- template: "<label class=\"amplify-label\" [class.sr-only]=\"labelHidden\" [for]=\"fieldId\">\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"
1906
+ 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"
1768
1907
  },] }
1769
1908
  ];
1770
1909
  TextFieldComponent.propDecorators = {
@@ -1869,6 +2008,10 @@
1869
2008
  * Generated bundle index. Do not edit.
1870
2009
  */
1871
2010
 
2011
+ Object.defineProperty(exports, 'translations', {
2012
+ enumerable: true,
2013
+ get: function () { return ui.translations; }
2014
+ });
1872
2015
  exports.AmplifyAuthenticatorModule = AmplifyAuthenticatorModule;
1873
2016
  exports.AmplifySlotDirective = AmplifySlotDirective;
1874
2017
  exports.AuthenticatorComponent = AuthenticatorComponent;