@aws-amplify/ui-angular 2.2.1 → 2.3.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.d.ts +24 -24
- package/aws-amplify-ui-angular.metadata.json +1 -1
- package/bundles/aws-amplify-ui-angular.umd.js +110 -314
- 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/aws-amplify-ui-angular.js +25 -25
- package/esm2015/lib/common/helpers.js +3 -3
- package/esm2015/lib/common/types/auth-types.js +1 -1
- package/esm2015/lib/components/authenticator/authenticator.module.js +3 -3
- package/esm2015/lib/components/authenticator/components/base-form-fields/base-form-fields.component.js +54 -0
- package/esm2015/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.js +3 -15
- package/esm2015/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.js +3 -13
- package/esm2015/lib/components/authenticator/components/confirm-sign-up/confirm-sign-up.component.js +3 -15
- package/esm2015/lib/components/authenticator/components/confirm-verify-user/amplify-confirm-verify-user.component.js +3 -15
- package/esm2015/lib/components/authenticator/components/force-new-password/force-new-password-form-fields/force-new-password-form-fields.component.js +2 -22
- package/esm2015/lib/components/authenticator/components/force-new-password/force-new-password.component.js +3 -15
- package/esm2015/lib/components/authenticator/components/form-field/form-field.component.js +12 -67
- package/esm2015/lib/components/authenticator/components/index.js +2 -2
- package/esm2015/lib/components/authenticator/components/reset-password/reset-password.component.js +3 -19
- package/esm2015/lib/components/authenticator/components/setup-totp/setup-totp.component.js +3 -13
- package/esm2015/lib/components/authenticator/components/sign-in/sign-in.component.js +3 -21
- package/esm2015/lib/components/authenticator/components/sign-up/sign-up-form-fields/sign-up-form-fields.component.js +2 -44
- package/fesm2015/aws-amplify-ui-angular.js +75 -277
- package/fesm2015/aws-amplify-ui-angular.js.map +1 -1
- package/lib/common/types/auth-types.d.ts +2 -2
- package/lib/components/authenticator/components/authenticator/authenticator.component.d.ts +2 -2
- package/lib/components/authenticator/components/base-form-fields/base-form-fields.component.d.ts +15 -0
- package/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.d.ts +5 -9
- package/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.d.ts +4 -6
- package/lib/components/authenticator/components/confirm-sign-up/confirm-sign-up.component.d.ts +5 -9
- package/lib/components/authenticator/components/confirm-verify-user/amplify-confirm-verify-user.component.d.ts +5 -9
- package/lib/components/authenticator/components/force-new-password/force-new-password-form-fields/force-new-password-form-fields.component.d.ts +1 -7
- package/lib/components/authenticator/components/force-new-password/force-new-password.component.d.ts +3 -9
- package/lib/components/authenticator/components/form-field/form-field.component.d.ts +5 -29
- package/lib/components/authenticator/components/index.d.ts +1 -1
- package/lib/components/authenticator/components/reset-password/reset-password.component.d.ts +5 -10
- package/lib/components/authenticator/components/setup-totp/setup-totp.component.d.ts +5 -6
- package/lib/components/authenticator/components/sign-in/sign-in.component.d.ts +5 -12
- package/lib/components/authenticator/components/sign-up/sign-up-form-fields/sign-up-form-fields.component.d.ts +1 -17
- package/lib/components/authenticator/components/sign-up/sign-up.component.d.ts +2 -2
- package/lib/components/authenticator/components/verify-user/verify-user.component.d.ts +2 -2
- package/lib/services/authenticator.service.d.ts +3 -3
- package/package.json +7 -2
- package/esm2015/lib/components/authenticator/components/user-name-alias/user-name-alias.component.js +0 -42
- package/lib/components/authenticator/components/user-name-alias/user-name-alias.component.d.ts +0 -21
|
@@ -416,18 +416,6 @@
|
|
|
416
416
|
this.backToSignInText = ui.translate('Back to Sign In');
|
|
417
417
|
this.resendCodeText = ui.translate('Resend Code');
|
|
418
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
|
-
};
|
|
431
419
|
Object.defineProperty(ConfirmResetPasswordComponent.prototype, "context", {
|
|
432
420
|
get: function () {
|
|
433
421
|
return this.authenticator.slotContext;
|
|
@@ -437,7 +425,7 @@
|
|
|
437
425
|
});
|
|
438
426
|
ConfirmResetPasswordComponent.prototype.onInput = function (event) {
|
|
439
427
|
event.preventDefault();
|
|
440
|
-
var
|
|
428
|
+
var _a = event.target, name = _a.name, value = _a.value;
|
|
441
429
|
this.authenticator.updateForm({ name: name, value: value });
|
|
442
430
|
};
|
|
443
431
|
ConfirmResetPasswordComponent.prototype.onSubmit = function (event) {
|
|
@@ -449,7 +437,7 @@
|
|
|
449
437
|
ConfirmResetPasswordComponent.decorators = [
|
|
450
438
|
{ type: i0.Component, args: [{
|
|
451
439
|
selector: 'amplify-confirm-reset-password',
|
|
452
|
-
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
|
|
440
|
+
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\n <amplify-base-form-fields\n route=\"confirmResetPassword\"\n ></amplify-base-form-fields>\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"
|
|
453
441
|
},] }
|
|
454
442
|
];
|
|
455
443
|
ConfirmResetPasswordComponent.ctorParameters = function () { return [
|
|
@@ -470,16 +458,6 @@
|
|
|
470
458
|
}
|
|
471
459
|
ConfirmSignInComponent.prototype.ngOnInit = function () {
|
|
472
460
|
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;
|
|
483
461
|
};
|
|
484
462
|
Object.defineProperty(ConfirmSignInComponent.prototype, "context", {
|
|
485
463
|
get: function () {
|
|
@@ -505,7 +483,7 @@
|
|
|
505
483
|
};
|
|
506
484
|
ConfirmSignInComponent.prototype.onInput = function (event) {
|
|
507
485
|
event.preventDefault();
|
|
508
|
-
var
|
|
486
|
+
var _a = event.target, name = _a.name, value = _a.value;
|
|
509
487
|
this.authenticator.updateForm({ name: name, value: value });
|
|
510
488
|
};
|
|
511
489
|
ConfirmSignInComponent.prototype.onSubmit = function (event) {
|
|
@@ -517,7 +495,7 @@
|
|
|
517
495
|
ConfirmSignInComponent.decorators = [
|
|
518
496
|
{ type: i0.Component, args: [{
|
|
519
497
|
selector: 'amplify-confirm-sign-in',
|
|
520
|
-
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-
|
|
498
|
+
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-base-form-fields route=\"confirmSignIn\"></amplify-base-form-fields>\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"
|
|
521
499
|
},] }
|
|
522
500
|
];
|
|
523
501
|
ConfirmSignInComponent.ctorParameters = function () { return [
|
|
@@ -540,18 +518,6 @@
|
|
|
540
518
|
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
519
|
this.minutesMessage = ui.translate('It may take a minute to arrive.');
|
|
542
520
|
}
|
|
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
|
-
};
|
|
555
521
|
Object.defineProperty(ConfirmSignUpComponent.prototype, "context", {
|
|
556
522
|
get: function () {
|
|
557
523
|
return this.authenticator.slotContext;
|
|
@@ -561,7 +527,7 @@
|
|
|
561
527
|
});
|
|
562
528
|
Object.defineProperty(ConfirmSignUpComponent.prototype, "confirmSignUpHeading", {
|
|
563
529
|
get: function () {
|
|
564
|
-
var
|
|
530
|
+
var _a = this.authenticator.codeDeliveryDetails, _b = _a === void 0 ? {} : _a, DeliveryMedium = _b.DeliveryMedium;
|
|
565
531
|
return DeliveryMedium === 'EMAIL'
|
|
566
532
|
? ui.translate('We Emailed You')
|
|
567
533
|
: DeliveryMedium === 'SMS'
|
|
@@ -573,7 +539,7 @@
|
|
|
573
539
|
});
|
|
574
540
|
Object.defineProperty(ConfirmSignUpComponent.prototype, "subtitleText", {
|
|
575
541
|
get: function () {
|
|
576
|
-
var
|
|
542
|
+
var _a = this.authenticator.codeDeliveryDetails, _b = _a === void 0 ? {} : _a, DeliveryMedium = _b.DeliveryMedium, Destination = _b.Destination;
|
|
577
543
|
return DeliveryMedium === 'EMAIL'
|
|
578
544
|
? this.emailMessage + " " + Destination + ". " + this.minutesMessage
|
|
579
545
|
: DeliveryMedium === 'SMS'
|
|
@@ -585,7 +551,7 @@
|
|
|
585
551
|
});
|
|
586
552
|
ConfirmSignUpComponent.prototype.onInput = function (event) {
|
|
587
553
|
event.preventDefault();
|
|
588
|
-
var
|
|
554
|
+
var _a = event.target, name = _a.name, value = _a.value;
|
|
589
555
|
this.authenticator.updateForm({ name: name, value: value });
|
|
590
556
|
};
|
|
591
557
|
ConfirmSignUpComponent.prototype.onSubmit = function (event) {
|
|
@@ -597,7 +563,7 @@
|
|
|
597
563
|
ConfirmSignUpComponent.decorators = [
|
|
598
564
|
{ type: i0.Component, args: [{
|
|
599
565
|
selector: 'amplify-confirm-sign-up',
|
|
600
|
-
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-
|
|
566
|
+
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-base-form-fields\n route=\"confirmSignUp\"\n ></amplify-base-form-fields>\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"
|
|
601
567
|
},] }
|
|
602
568
|
];
|
|
603
569
|
ConfirmSignUpComponent.ctorParameters = function () { return [
|
|
@@ -617,18 +583,6 @@
|
|
|
617
583
|
this.skipText = ui.translate('Skip');
|
|
618
584
|
this.submitText = ui.translate('Submit');
|
|
619
585
|
}
|
|
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
|
-
};
|
|
632
586
|
Object.defineProperty(ConfirmVerifyUserComponent.prototype, "context", {
|
|
633
587
|
get: function () {
|
|
634
588
|
return this.authenticator.slotContext;
|
|
@@ -638,7 +592,7 @@
|
|
|
638
592
|
});
|
|
639
593
|
ConfirmVerifyUserComponent.prototype.onInput = function (event) {
|
|
640
594
|
event.preventDefault();
|
|
641
|
-
var
|
|
595
|
+
var _a = event.target, name = _a.name, value = _a.value;
|
|
642
596
|
this.authenticator.updateForm({ name: name, value: value });
|
|
643
597
|
};
|
|
644
598
|
ConfirmVerifyUserComponent.prototype.onSubmit = function (event) {
|
|
@@ -650,7 +604,7 @@
|
|
|
650
604
|
ConfirmVerifyUserComponent.decorators = [
|
|
651
605
|
{ type: i0.Component, args: [{
|
|
652
606
|
selector: 'amplify-confirm-verify-user',
|
|
653
|
-
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-
|
|
607
|
+
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-base-form-fields\n route=\"confirmVerifyUser\"\n ></amplify-base-form-fields>\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"
|
|
654
608
|
},] }
|
|
655
609
|
];
|
|
656
610
|
ConfirmVerifyUserComponent.ctorParameters = function () { return [
|
|
@@ -741,9 +695,6 @@
|
|
|
741
695
|
this.changePasswordText = ui.translate('Change Password');
|
|
742
696
|
this.backToSignInText = ui.translate('Back to Sign In');
|
|
743
697
|
}
|
|
744
|
-
ForceNewPasswordComponent.prototype.ngOnInit = function () {
|
|
745
|
-
this.setFormFields();
|
|
746
|
-
};
|
|
747
698
|
Object.defineProperty(ForceNewPasswordComponent.prototype, "context", {
|
|
748
699
|
get: function () {
|
|
749
700
|
return this.authenticator.slotContext;
|
|
@@ -751,18 +702,9 @@
|
|
|
751
702
|
enumerable: false,
|
|
752
703
|
configurable: true
|
|
753
704
|
});
|
|
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
|
-
};
|
|
763
705
|
ForceNewPasswordComponent.prototype.onInput = function (event) {
|
|
764
706
|
event.preventDefault();
|
|
765
|
-
var
|
|
707
|
+
var _a = event.target, name = _a.name, value = _a.value;
|
|
766
708
|
this.authenticator.updateForm({ name: name, value: value });
|
|
767
709
|
};
|
|
768
710
|
ForceNewPasswordComponent.prototype.onSubmit = function (event) {
|
|
@@ -774,7 +716,7 @@
|
|
|
774
716
|
ForceNewPasswordComponent.decorators = [
|
|
775
717
|
{ type: i0.Component, args: [{
|
|
776
718
|
selector: 'amplify-force-new-password',
|
|
777
|
-
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
|
|
719
|
+
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\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"
|
|
778
720
|
},] }
|
|
779
721
|
];
|
|
780
722
|
ForceNewPasswordComponent.ctorParameters = function () { return [
|
|
@@ -786,75 +728,26 @@
|
|
|
786
728
|
};
|
|
787
729
|
|
|
788
730
|
var ForceNewPasswordFormFieldsComponent = /** @class */ (function () {
|
|
789
|
-
function ForceNewPasswordFormFieldsComponent(
|
|
790
|
-
this.authenticator = authenticator;
|
|
731
|
+
function ForceNewPasswordFormFieldsComponent() {
|
|
791
732
|
}
|
|
792
|
-
ForceNewPasswordFormFieldsComponent.prototype.ngOnInit = function () {
|
|
793
|
-
var state = this.authenticator.authState;
|
|
794
|
-
var actorContext = ui.getActorContext(state);
|
|
795
|
-
var requiredAttributes = actorContext.requiredAttributes;
|
|
796
|
-
this.fieldNames = requiredAttributes.filter(function (fieldName) {
|
|
797
|
-
var hasDefaultField = !!ui.authInputAttributes[fieldName];
|
|
798
|
-
if (!hasDefaultField) {
|
|
799
|
-
console.debug("Authenticator does not have a default implementation for " + fieldName + ". Customize Authenticator.SignUp.FormFields to add your own.");
|
|
800
|
-
}
|
|
801
|
-
return hasDefaultField;
|
|
802
|
-
});
|
|
803
|
-
};
|
|
804
733
|
return ForceNewPasswordFormFieldsComponent;
|
|
805
734
|
}());
|
|
806
735
|
ForceNewPasswordFormFieldsComponent.decorators = [
|
|
807
736
|
{ type: i0.Component, args: [{
|
|
808
737
|
selector: 'amplify-force-new-password-form-fields',
|
|
809
|
-
template: "<div class=\"amplify-flex\" style=\"flex-direction: column\" data-amplify-fieldset>\n <
|
|
738
|
+
template: "<div class=\"amplify-flex\" style=\"flex-direction: column\" data-amplify-fieldset>\n <amplify-base-form-fields route=\"forceNewPassword\"></amplify-base-form-fields>\n</div>\n"
|
|
810
739
|
},] }
|
|
811
740
|
];
|
|
812
|
-
ForceNewPasswordFormFieldsComponent.ctorParameters = function () { return [
|
|
813
|
-
{ type: AuthenticatorService }
|
|
814
|
-
]; };
|
|
815
741
|
|
|
816
|
-
var getAttributeMap = function () { return ui.authInputAttributes; };
|
|
817
|
-
|
|
818
|
-
/**
|
|
819
|
-
* Input interface opinionated for authenticator usage.
|
|
820
|
-
*
|
|
821
|
-
* TODO: Separate this component out to two parts -- 1) amplify-auth-input that
|
|
822
|
-
* contains authenticator opinionated logic and 2) amplify-text-field primitive
|
|
823
|
-
* that does not make any auth-related inference.
|
|
824
|
-
*/
|
|
825
742
|
var FormFieldComponent = /** @class */ (function () {
|
|
826
743
|
function FormFieldComponent(authenticator) {
|
|
827
744
|
this.authenticator = authenticator;
|
|
828
|
-
this.required = true;
|
|
829
|
-
this.placeholder = '';
|
|
830
|
-
this.label = '';
|
|
831
|
-
this.initialValue = '';
|
|
832
|
-
this.disabled = false;
|
|
833
|
-
this.autocomplete = '';
|
|
834
|
-
this.labelHidden = true;
|
|
835
745
|
this.countryDialCodesValue = ui.countryDialCodes;
|
|
836
746
|
}
|
|
837
|
-
FormFieldComponent.prototype
|
|
838
|
-
var _a;
|
|
839
|
-
// TODO: consider better default handling mechanisms across frameworks
|
|
840
|
-
if (this.isPhoneField()) {
|
|
841
|
-
var state = this.authenticator.authState;
|
|
842
|
-
var country_code = ui.getActorContext(state).country_code;
|
|
843
|
-
this.defaultCountryCodeValue = (_a = this.defaultCountryCode) !== null && _a !== void 0 ? _a : country_code;
|
|
844
|
-
}
|
|
845
|
-
};
|
|
846
|
-
Object.defineProperty(FormFieldComponent.prototype, "attributeMap", {
|
|
747
|
+
Object.defineProperty(FormFieldComponent.prototype, "errors", {
|
|
847
748
|
get: function () {
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
enumerable: false,
|
|
851
|
-
configurable: true
|
|
852
|
-
});
|
|
853
|
-
Object.defineProperty(FormFieldComponent.prototype, "error", {
|
|
854
|
-
get: function () {
|
|
855
|
-
var formContext = ui.getActorContext(this.authenticator.authState);
|
|
856
|
-
var validationError = formContext.validationError;
|
|
857
|
-
return ui.translate(validationError[this.name]);
|
|
749
|
+
var validationErrors = this.authenticator.validationErrors;
|
|
750
|
+
return ui.getErrors(validationErrors[this.name]);
|
|
858
751
|
},
|
|
859
752
|
enumerable: false,
|
|
860
753
|
configurable: true
|
|
@@ -863,39 +756,21 @@
|
|
|
863
756
|
var name = $event.target.name;
|
|
864
757
|
this.authenticator.updateBlur({ name: name });
|
|
865
758
|
};
|
|
866
|
-
FormFieldComponent.prototype.inferLabel = function () {
|
|
867
|
-
var _a;
|
|
868
|
-
var label = this.label || ((_a = this.attributeMap[this.name]) === null || _a === void 0 ? void 0 : _a.label);
|
|
869
|
-
return ui.translate(label);
|
|
870
|
-
};
|
|
871
|
-
FormFieldComponent.prototype.inferPlaceholder = function () {
|
|
872
|
-
var _a;
|
|
873
|
-
var placeholder = this.placeholder || ((_a = this.attributeMap[this.name]) === null || _a === void 0 ? void 0 : _a.placeholder) ||
|
|
874
|
-
this.inferLabel();
|
|
875
|
-
return ui.translate(placeholder);
|
|
876
|
-
};
|
|
877
|
-
// infers what the `type` of underlying input element should be.
|
|
878
|
-
FormFieldComponent.prototype.inferType = function () {
|
|
879
|
-
var _a, _b, _c;
|
|
880
|
-
return (_c = (_a = this.type) !== null && _a !== void 0 ? _a : (_b = this.attributeMap[this.name]) === null || _b === void 0 ? void 0 : _b.type) !== null && _c !== void 0 ? _c : 'text';
|
|
881
|
-
};
|
|
882
|
-
FormFieldComponent.prototype.inferAutocomplete = function () {
|
|
883
|
-
var _a;
|
|
884
|
-
return this.autocomplete || ((_a = this.attributeMap[this.name]) === null || _a === void 0 ? void 0 : _a.autocomplete);
|
|
885
|
-
};
|
|
886
|
-
// TODO(enhancement): use enum to differentiate special field types
|
|
887
759
|
FormFieldComponent.prototype.isPasswordField = function () {
|
|
888
|
-
return this.
|
|
760
|
+
return this.formField.type === 'password';
|
|
889
761
|
};
|
|
890
762
|
FormFieldComponent.prototype.isPhoneField = function () {
|
|
891
|
-
return this.
|
|
763
|
+
return this.formField.type === 'tel';
|
|
764
|
+
};
|
|
765
|
+
FormFieldComponent.prototype.translate = function (phrase) {
|
|
766
|
+
return ui.translate(phrase);
|
|
892
767
|
};
|
|
893
768
|
return FormFieldComponent;
|
|
894
769
|
}());
|
|
895
770
|
FormFieldComponent.decorators = [
|
|
896
771
|
{ type: i0.Component, args: [{
|
|
897
772
|
selector: 'amplify-form-field',
|
|
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 [
|
|
773
|
+
template: "<div class=\"amplify-flex amplify-field\" style=\"flex-direction: column\">\n <!-- Country code field -->\n <amplify-phone-number-field\n *ngIf=\"isPhoneField()\"\n [name]=\"name\"\n [label]=\"formField.label\"\n [defaultCountryCode]=\"formField.dialCode\"\n [dialCodeList]=\"formField.dialCodeList\"\n [placeholder]=\"formField.placeholder\"\n [required]=\"formField.isRequired\"\n [labelHidden]=\"formField.labelHidden\"\n [autocomplete]=\"formField.autocomplete\"\n type=\"tel\"\n ></amplify-phone-number-field>\n\n <amplify-password-field\n *ngIf=\"isPasswordField()\"\n [name]=\"name\"\n [label]=\"formField.label\"\n [placeholder]=\"formField.placeholder\"\n [required]=\"formField.isRequired\"\n [labelHidden]=\"formField.labelHidden\"\n [autocomplete]=\"formField.autocomplete\"\n (setBlur)=\"onBlur($event)\"\n ></amplify-password-field>\n\n <amplify-text-field\n *ngIf=\"!isPasswordField() && !isPhoneField()\"\n [name]=\"name\"\n [label]=\"formField.label\"\n [placeholder]=\"formField.placeholder\"\n [required]=\"formField.isRequired\"\n [labelHidden]=\"formField.labelHidden\"\n [autocomplete]=\"formField.autocomplete\"\n [type]=\"formField.type\"\n ></amplify-text-field>\n <div data-amplify-sign-up-errors *ngIf=\"errors?.length > 0\">\n <div\n class=\"amplify-text\"\n data-variation=\"error\"\n *ngFor=\"let error of errors\"\n >\n {{ translate(error) }}\n </div>\n </div>\n</div>\n"
|
|
899
774
|
},] }
|
|
900
775
|
];
|
|
901
776
|
FormFieldComponent.ctorParameters = function () { return [
|
|
@@ -903,16 +778,7 @@
|
|
|
903
778
|
]; };
|
|
904
779
|
FormFieldComponent.propDecorators = {
|
|
905
780
|
name: [{ type: i0.Input }],
|
|
906
|
-
|
|
907
|
-
required: [{ type: i0.Input }],
|
|
908
|
-
placeholder: [{ type: i0.Input }],
|
|
909
|
-
label: [{ type: i0.Input }],
|
|
910
|
-
initialValue: [{ type: i0.Input }],
|
|
911
|
-
disabled: [{ type: i0.Input }],
|
|
912
|
-
autocomplete: [{ type: i0.Input }],
|
|
913
|
-
labelHidden: [{ type: i0.Input }],
|
|
914
|
-
defaultCountryCode: [{ type: i0.Input }],
|
|
915
|
-
dialCodeList: [{ type: i0.Input }]
|
|
781
|
+
formField: [{ type: i0.Input }]
|
|
916
782
|
};
|
|
917
783
|
|
|
918
784
|
var ResetPasswordComponent = /** @class */ (function () {
|
|
@@ -923,23 +789,7 @@
|
|
|
923
789
|
// translated texts
|
|
924
790
|
this.sendCodeText = ui.translate('Send Code');
|
|
925
791
|
this.backToSignInText = ui.translate('Back to Sign In');
|
|
926
|
-
this.labelText = ui.translate('Username');
|
|
927
792
|
}
|
|
928
|
-
ResetPasswordComponent.prototype.ngOnInit = function () {
|
|
929
|
-
var authState = this.authenticator.authState;
|
|
930
|
-
var label = ui.getAliasInfoFromContext(authState.context).label;
|
|
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;
|
|
942
|
-
};
|
|
943
793
|
Object.defineProperty(ResetPasswordComponent.prototype, "context", {
|
|
944
794
|
get: function () {
|
|
945
795
|
return this.authenticator.slotContext;
|
|
@@ -949,7 +799,7 @@
|
|
|
949
799
|
});
|
|
950
800
|
ResetPasswordComponent.prototype.onInput = function (event) {
|
|
951
801
|
event.preventDefault();
|
|
952
|
-
var
|
|
802
|
+
var _a = event.target, name = _a.name, value = _a.value;
|
|
953
803
|
this.authenticator.updateForm({ name: name, value: value });
|
|
954
804
|
};
|
|
955
805
|
ResetPasswordComponent.prototype.onSubmit = function (event) {
|
|
@@ -961,7 +811,7 @@
|
|
|
961
811
|
ResetPasswordComponent.decorators = [
|
|
962
812
|
{ type: i0.Component, args: [{
|
|
963
813
|
selector: 'amplify-reset-password',
|
|
964
|
-
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-
|
|
814
|
+
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-base-form-fields route=\"resetPassword\"></amplify-base-form-fields>\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"
|
|
965
815
|
},] }
|
|
966
816
|
];
|
|
967
817
|
ResetPasswordComponent.ctorParameters = function () { return [
|
|
@@ -1305,16 +1155,6 @@
|
|
|
1305
1155
|
}
|
|
1306
1156
|
SetupTotpComponent.prototype.ngOnInit = function () {
|
|
1307
1157
|
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;
|
|
1318
1158
|
};
|
|
1319
1159
|
Object.defineProperty(SetupTotpComponent.prototype, "context", {
|
|
1320
1160
|
get: function () {
|
|
@@ -1376,7 +1216,7 @@
|
|
|
1376
1216
|
SetupTotpComponent.decorators = [
|
|
1377
1217
|
{ type: i0.Component, args: [{
|
|
1378
1218
|
selector: 'amplify-setup-totp',
|
|
1379
|
-
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-
|
|
1219
|
+
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-base-form-fields route=\"setupTOTP\"></amplify-base-form-fields>\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"
|
|
1380
1220
|
},] }
|
|
1381
1221
|
];
|
|
1382
1222
|
SetupTotpComponent.ctorParameters = function () { return [
|
|
@@ -1397,26 +1237,6 @@
|
|
|
1397
1237
|
: ui.translate('Forgot your password? ');
|
|
1398
1238
|
this.signInButtonText = ui.translate('Sign in');
|
|
1399
1239
|
}
|
|
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
|
-
};
|
|
1420
1240
|
Object.defineProperty(SignInComponent.prototype, "context", {
|
|
1421
1241
|
get: function () {
|
|
1422
1242
|
return this.authenticator.slotContext;
|
|
@@ -1426,7 +1246,7 @@
|
|
|
1426
1246
|
});
|
|
1427
1247
|
SignInComponent.prototype.onInput = function (event) {
|
|
1428
1248
|
event.preventDefault();
|
|
1429
|
-
var
|
|
1249
|
+
var _a = event.target, name = _a.name, value = _a.value;
|
|
1430
1250
|
this.authenticator.updateForm({ name: name, value: value });
|
|
1431
1251
|
};
|
|
1432
1252
|
SignInComponent.prototype.onSubmit = function (event) {
|
|
@@ -1438,7 +1258,7 @@
|
|
|
1438
1258
|
SignInComponent.decorators = [
|
|
1439
1259
|
{ type: i0.Component, args: [{
|
|
1440
1260
|
selector: 'amplify-sign-in',
|
|
1441
|
-
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
|
|
1261
|
+
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 class=\"amplify-flex\" style=\"flex-direction: column\" data-amplify-fieldset\n [disabled]=\"authenticator.isPending\">\n <legend class=\"amplify-visually-hidden\">Sign in</legend>\n <amplify-base-form-fields route=\"signIn\"></amplify-base-form-fields>\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 amplify-button fontWeight=\"normal\" size=\"small\" variation=\"link\" fullWidth=\"true\"\n (click)=\"authenticator.toResetPassword()\">\n {{ forgotPasswordText }}\n </button>\n </div>\n</amplify-slot>\n",
|
|
1442
1262
|
encapsulation: i0.ViewEncapsulation.None
|
|
1443
1263
|
},] }
|
|
1444
1264
|
];
|
|
@@ -1489,94 +1309,18 @@
|
|
|
1489
1309
|
};
|
|
1490
1310
|
|
|
1491
1311
|
var SignUpFormFieldsComponent = /** @class */ (function () {
|
|
1492
|
-
function SignUpFormFieldsComponent(
|
|
1493
|
-
this.authenticator = authenticator;
|
|
1494
|
-
this.primaryAlias = '';
|
|
1495
|
-
this.secondaryAliases = [];
|
|
1312
|
+
function SignUpFormFieldsComponent() {
|
|
1496
1313
|
}
|
|
1497
|
-
SignUpFormFieldsComponent.prototype.ngOnInit = function () {
|
|
1498
|
-
var context = this.authenticator.context;
|
|
1499
|
-
var _d = context.config, loginMechanisms = _d.loginMechanisms, signUpAttributes = _d.signUpAttributes;
|
|
1500
|
-
this.fieldNames = Array.from(new Set(__spread(loginMechanisms, signUpAttributes)));
|
|
1501
|
-
this.fieldNames = this.fieldNames.filter(function (fieldName) {
|
|
1502
|
-
var hasDefaultField = !!ui.authInputAttributes[fieldName];
|
|
1503
|
-
if (!hasDefaultField) {
|
|
1504
|
-
console.debug("Authenticator does not have a default implementation for " + fieldName + ". Customize Authenticator.SignUp.FormFields to add your own.");
|
|
1505
|
-
}
|
|
1506
|
-
return hasDefaultField;
|
|
1507
|
-
});
|
|
1508
|
-
// Only 1 is supported, so `['email', 'phone_number']` will only show `email`
|
|
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;
|
|
1528
|
-
};
|
|
1529
1314
|
return SignUpFormFieldsComponent;
|
|
1530
1315
|
}());
|
|
1531
1316
|
SignUpFormFieldsComponent.decorators = [
|
|
1532
1317
|
{ type: i0.Component, args: [{
|
|
1533
1318
|
selector: 'amplify-sign-up-form-fields',
|
|
1534
|
-
template: "<div class=\"amplify-flex\" style=\"flex-direction: column\" data-amplify-fieldset>\n <
|
|
1319
|
+
template: "<div class=\"amplify-flex\" style=\"flex-direction: column\" data-amplify-fieldset>\n <amplify-base-form-fields route=\"signUp\"></amplify-base-form-fields>\n</div>\n"
|
|
1535
1320
|
},] }
|
|
1536
1321
|
];
|
|
1537
|
-
SignUpFormFieldsComponent.ctorParameters = function () { return [
|
|
1538
|
-
{ type: AuthenticatorService }
|
|
1539
|
-
]; };
|
|
1540
1322
|
|
|
1541
|
-
var
|
|
1542
|
-
function UserNameAliasComponent(authenticator) {
|
|
1543
|
-
this.authenticator = authenticator;
|
|
1544
|
-
this.name = 'username';
|
|
1545
|
-
this.disabled = false;
|
|
1546
|
-
this.initialValue = '';
|
|
1547
|
-
this.required = true;
|
|
1548
|
-
}
|
|
1549
|
-
UserNameAliasComponent.prototype.ngOnInit = function () {
|
|
1550
|
-
var _a, _b, _c;
|
|
1551
|
-
var context = this.authenticator.context;
|
|
1552
|
-
var _d = ui.getAliasInfoFromContext(context), lbl = _d.label, type = _d.type;
|
|
1553
|
-
this.labelValue = (_a = this.label) !== null && _a !== void 0 ? _a : lbl;
|
|
1554
|
-
this.type = type;
|
|
1555
|
-
this.placeholderValue = (_b = this.placeholder) !== null && _b !== void 0 ? _b : lbl;
|
|
1556
|
-
this.requiredValue = (_c = this.required) !== null && _c !== void 0 ? _c : true;
|
|
1557
|
-
};
|
|
1558
|
-
return UserNameAliasComponent;
|
|
1559
|
-
}());
|
|
1560
|
-
UserNameAliasComponent.decorators = [
|
|
1561
|
-
{ type: i0.Component, args: [{
|
|
1562
|
-
selector: 'amplify-user-name-alias',
|
|
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"
|
|
1564
|
-
},] }
|
|
1565
|
-
];
|
|
1566
|
-
UserNameAliasComponent.ctorParameters = function () { return [
|
|
1567
|
-
{ type: AuthenticatorService }
|
|
1568
|
-
]; };
|
|
1569
|
-
UserNameAliasComponent.propDecorators = {
|
|
1570
|
-
name: [{ type: i0.Input }],
|
|
1571
|
-
disabled: [{ type: i0.Input }],
|
|
1572
|
-
initialValue: [{ 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 }]
|
|
1579
|
-
};
|
|
1323
|
+
var getAttributeMap = function () { return ui.defaultFormFieldOptions; };
|
|
1580
1324
|
|
|
1581
1325
|
var VerifyUserComponent = /** @class */ (function () {
|
|
1582
1326
|
function VerifyUserComponent(authenticator) {
|
|
@@ -1632,6 +1376,58 @@
|
|
|
1632
1376
|
headerText: [{ type: i0.Input }]
|
|
1633
1377
|
};
|
|
1634
1378
|
|
|
1379
|
+
/**
|
|
1380
|
+
* Sorts the given formFields, then renders them in order.
|
|
1381
|
+
*/
|
|
1382
|
+
var BaseFormFieldsComponent = /** @class */ (function () {
|
|
1383
|
+
function BaseFormFieldsComponent(authenticator) {
|
|
1384
|
+
this.authenticator = authenticator;
|
|
1385
|
+
this.display = 'contents';
|
|
1386
|
+
this.formFields = [];
|
|
1387
|
+
}
|
|
1388
|
+
BaseFormFieldsComponent.prototype.ngOnInit = function () {
|
|
1389
|
+
var state = this.authenticator.authState;
|
|
1390
|
+
this.formFields = ui.getSortedFormFields(this.route, state);
|
|
1391
|
+
if (this.route === 'confirmSignUp') {
|
|
1392
|
+
this.handleConfirmSignUp();
|
|
1393
|
+
}
|
|
1394
|
+
};
|
|
1395
|
+
BaseFormFieldsComponent.prototype.handleConfirmSignUp = function () {
|
|
1396
|
+
/**
|
|
1397
|
+
* @todo(breaking): Angular `confirmSignUp` has different placholder here from other frameworks.
|
|
1398
|
+
*
|
|
1399
|
+
* Translating here in a backwards-compatible manner, but should be resolved in next major version.
|
|
1400
|
+
*/
|
|
1401
|
+
var _a;
|
|
1402
|
+
var state = this.authenticator.authState;
|
|
1403
|
+
// backwards compatible placeholder text
|
|
1404
|
+
var placeholder = !ui.hasTranslation('Confirmation Code')
|
|
1405
|
+
? ui.translate('Enter your code') // prioritize new placeholder
|
|
1406
|
+
: ui.translate('Confirmation Code'); // legacy placeholder
|
|
1407
|
+
var defaultFormFields = ui.getDefaultFormFields(this.route, state);
|
|
1408
|
+
if (defaultFormFields.confirmation_code.placeholder) {
|
|
1409
|
+
defaultFormFields.confirmation_code.placeholder = placeholder;
|
|
1410
|
+
}
|
|
1411
|
+
var customFormFields = ((_a = ui.getActorContext(state).formFields) === null || _a === void 0 ? void 0 : _a.confirmSignUp) || {};
|
|
1412
|
+
var newFormFields = ui.applyDefaults(defaultFormFields, customFormFields);
|
|
1413
|
+
this.formFields = ui.sortFormFields(newFormFields);
|
|
1414
|
+
};
|
|
1415
|
+
return BaseFormFieldsComponent;
|
|
1416
|
+
}());
|
|
1417
|
+
BaseFormFieldsComponent.decorators = [
|
|
1418
|
+
{ type: i0.Component, args: [{
|
|
1419
|
+
selector: 'amplify-base-form-fields',
|
|
1420
|
+
template: "<ng-container *ngFor=\"let formField of formFields\">\n <amplify-form-field\n [name]=\"formField[0]\"\n [formField]=\"formField[1]\"\n ></amplify-form-field>\n</ng-container>\n"
|
|
1421
|
+
},] }
|
|
1422
|
+
];
|
|
1423
|
+
BaseFormFieldsComponent.ctorParameters = function () { return [
|
|
1424
|
+
{ type: AuthenticatorService }
|
|
1425
|
+
]; };
|
|
1426
|
+
BaseFormFieldsComponent.propDecorators = {
|
|
1427
|
+
route: [{ type: i0.Input }],
|
|
1428
|
+
display: [{ type: i0.HostBinding, args: ['style.display',] }]
|
|
1429
|
+
};
|
|
1430
|
+
|
|
1635
1431
|
var ButtonComponent = /** @class */ (function () {
|
|
1636
1432
|
function ButtonComponent() {
|
|
1637
1433
|
this.type = 'button';
|
|
@@ -1962,6 +1758,7 @@
|
|
|
1962
1758
|
AmplifySlotComponent,
|
|
1963
1759
|
AmplifySlotDirective,
|
|
1964
1760
|
AuthenticatorComponent,
|
|
1761
|
+
BaseFormFieldsComponent,
|
|
1965
1762
|
ButtonComponent,
|
|
1966
1763
|
CheckboxComponent,
|
|
1967
1764
|
ConfirmResetPasswordComponent,
|
|
@@ -1985,7 +1782,6 @@
|
|
|
1985
1782
|
TabItemComponent,
|
|
1986
1783
|
TabsComponent,
|
|
1987
1784
|
TextFieldComponent,
|
|
1988
|
-
UserNameAliasComponent,
|
|
1989
1785
|
VerifyUserComponent,
|
|
1990
1786
|
],
|
|
1991
1787
|
imports: [common.CommonModule],
|
|
@@ -2016,6 +1812,7 @@
|
|
|
2016
1812
|
exports.AmplifySlotDirective = AmplifySlotDirective;
|
|
2017
1813
|
exports.AuthenticatorComponent = AuthenticatorComponent;
|
|
2018
1814
|
exports.AuthenticatorService = AuthenticatorService;
|
|
1815
|
+
exports.BaseFormFieldsComponent = BaseFormFieldsComponent;
|
|
2019
1816
|
exports.ButtonComponent = ButtonComponent;
|
|
2020
1817
|
exports.CheckboxComponent = CheckboxComponent;
|
|
2021
1818
|
exports.ConfirmResetPasswordComponent = ConfirmResetPasswordComponent;
|
|
@@ -2040,36 +1837,35 @@
|
|
|
2040
1837
|
exports.TabItemComponent = TabItemComponent;
|
|
2041
1838
|
exports.TabsComponent = TabsComponent;
|
|
2042
1839
|
exports.TextFieldComponent = TextFieldComponent;
|
|
2043
|
-
exports.UserNameAliasComponent = UserNameAliasComponent;
|
|
2044
1840
|
exports.VerifyUserComponent = VerifyUserComponent;
|
|
2045
1841
|
exports.getAttributeMap = getAttributeMap;
|
|
2046
1842
|
exports["ɵa"] = AmplifySlotComponent;
|
|
2047
1843
|
exports["ɵb"] = AuthenticatorComponent;
|
|
2048
1844
|
exports["ɵba"] = VerifyUserComponent;
|
|
2049
|
-
exports["ɵc"] =
|
|
2050
|
-
exports["ɵd"] =
|
|
2051
|
-
exports["ɵe"] =
|
|
2052
|
-
exports["ɵf"] =
|
|
2053
|
-
exports["ɵg"] =
|
|
2054
|
-
exports["ɵh"] =
|
|
2055
|
-
exports["ɵi"] =
|
|
2056
|
-
exports["ɵj"] =
|
|
2057
|
-
exports["ɵk"] =
|
|
2058
|
-
exports["ɵl"] =
|
|
2059
|
-
exports["ɵm"] =
|
|
2060
|
-
exports["ɵn"] =
|
|
2061
|
-
exports["ɵo"] =
|
|
2062
|
-
exports["ɵp"] =
|
|
2063
|
-
exports["ɵq"] =
|
|
2064
|
-
exports["ɵr"] =
|
|
2065
|
-
exports["ɵs"] =
|
|
2066
|
-
exports["ɵt"] =
|
|
2067
|
-
exports["ɵu"] =
|
|
2068
|
-
exports["ɵv"] =
|
|
2069
|
-
exports["ɵw"] =
|
|
2070
|
-
exports["ɵx"] =
|
|
2071
|
-
exports["ɵy"] =
|
|
2072
|
-
exports["ɵz"] =
|
|
1845
|
+
exports["ɵc"] = BaseFormFieldsComponent;
|
|
1846
|
+
exports["ɵd"] = ButtonComponent;
|
|
1847
|
+
exports["ɵe"] = CheckboxComponent;
|
|
1848
|
+
exports["ɵf"] = ConfirmResetPasswordComponent;
|
|
1849
|
+
exports["ɵg"] = ConfirmSignInComponent;
|
|
1850
|
+
exports["ɵh"] = ConfirmSignUpComponent;
|
|
1851
|
+
exports["ɵi"] = ConfirmVerifyUserComponent;
|
|
1852
|
+
exports["ɵj"] = ErrorComponent;
|
|
1853
|
+
exports["ɵk"] = FederatedSignInButtonComponent;
|
|
1854
|
+
exports["ɵl"] = FederatedSignInComponent;
|
|
1855
|
+
exports["ɵm"] = ForceNewPasswordComponent;
|
|
1856
|
+
exports["ɵn"] = ForceNewPasswordFormFieldsComponent;
|
|
1857
|
+
exports["ɵo"] = FormFieldComponent;
|
|
1858
|
+
exports["ɵp"] = PasswordFieldComponent;
|
|
1859
|
+
exports["ɵq"] = PhoneNumberFieldComponent;
|
|
1860
|
+
exports["ɵr"] = ResetPasswordComponent;
|
|
1861
|
+
exports["ɵs"] = SelectComponent;
|
|
1862
|
+
exports["ɵt"] = SetupTotpComponent;
|
|
1863
|
+
exports["ɵu"] = SignInComponent;
|
|
1864
|
+
exports["ɵv"] = SignUpComponent;
|
|
1865
|
+
exports["ɵw"] = SignUpFormFieldsComponent;
|
|
1866
|
+
exports["ɵx"] = TabItemComponent;
|
|
1867
|
+
exports["ɵy"] = TabsComponent;
|
|
1868
|
+
exports["ɵz"] = TextFieldComponent;
|
|
2073
1869
|
|
|
2074
1870
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2075
1871
|
|