@aws-amplify/ui-angular 2.0.1-next.2 → 2.0.1-next.3
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 +15 -15
- package/aws-amplify-ui-angular.metadata.json +1 -1
- package/bundles/aws-amplify-ui-angular.umd.js +162 -92
- 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 +16 -16
- package/esm2015/index.js +2 -2
- package/esm2015/lib/components/amplify-authenticator/amplify-authenticator.component.js +2 -2
- package/esm2015/lib/components/amplify-confirm-sign-in/amplify-confirm-sign-in.component.js +8 -6
- package/esm2015/lib/components/amplify-confirm-sign-up/amplify-confirm-sign-up.component.js +12 -7
- package/esm2015/lib/components/amplify-federated-sign-in/amplify-federated-sign-in.component.js +9 -4
- package/esm2015/lib/components/amplify-force-new-password/amplify-force-new-password.component.js +12 -4
- package/esm2015/lib/components/amplify-reset-password/amplify-reset-password.component.js +7 -3
- package/esm2015/lib/components/amplify-setup-totp/amplify-setup-totp.component.js +14 -5
- package/esm2015/lib/components/amplify-sign-in/amplify-sign-in.component.js +9 -3
- package/esm2015/lib/components/amplify-sign-up/amplify-sign-up.component.js +8 -3
- package/esm2015/lib/components/amplify-verify-user/amplify-verify-user.component.js +11 -4
- package/esm2015/lib/components/confirm-reset-password/amplify-confirm-reset-password.component.js +9 -3
- package/esm2015/lib/components/confirm-verify-user/amplify-confirm-verify-user.component.js +2 -2
- package/esm2015/lib/components/index.js +14 -6
- package/esm2015/lib/primitives/amplify-input/amplify-input.component.js +30 -9
- package/esm2015/lib/primitives/amplify-select/amplify-select.component.js +17 -0
- package/esm2015/lib/primitives/amplify-user-name-alias/amplify-user-name-alias.component.js +6 -4
- package/esm2015/lib/ui-angular.module.js +4 -6
- package/fesm2015/aws-amplify-ui-angular.js +131 -70
- package/fesm2015/aws-amplify-ui-angular.js.map +1 -1
- package/index.d.ts +1 -1
- package/lib/components/amplify-confirm-sign-in/amplify-confirm-sign-in.component.d.ts +4 -2
- package/lib/components/amplify-confirm-sign-up/amplify-confirm-sign-up.component.d.ts +5 -0
- package/lib/components/amplify-federated-sign-in/amplify-federated-sign-in.component.d.ts +4 -1
- package/lib/components/amplify-force-new-password/amplify-force-new-password.component.d.ts +2 -0
- package/lib/components/amplify-reset-password/amplify-reset-password.component.d.ts +2 -0
- package/lib/components/amplify-setup-totp/amplify-setup-totp.component.d.ts +3 -0
- package/lib/components/amplify-sign-in/amplify-sign-in.component.d.ts +4 -0
- package/lib/components/amplify-sign-up/amplify-sign-up.component.d.ts +3 -0
- package/lib/components/amplify-verify-user/amplify-verify-user.component.d.ts +4 -1
- package/lib/components/confirm-reset-password/amplify-confirm-reset-password.component.d.ts +4 -0
- package/lib/components/index.d.ts +13 -5
- package/lib/primitives/amplify-input/amplify-input.component.d.ts +11 -3
- package/lib/primitives/amplify-select/amplify-select.component.d.ts +7 -0
- package/lib/primitives/amplify-user-name-alias/amplify-user-name-alias.component.d.ts +1 -0
- package/package.json +2 -2
- package/esm2015/lib/components/amplify-sign-out/amplify-sign-out.component.js +0 -28
- package/lib/components/amplify-sign-out/amplify-sign-out.component.d.ts +0 -6
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@aws-amplify/ui-angular', ['exports', '@angular/core', '@angular/common', '@
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['aws-amplify'] = global['aws-amplify'] || {}, global['aws-amplify']['ui-angular'] = {}), global.ng.core, global.ng.common, global.
|
|
5
|
-
}(this, (function (exports, i0, common,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@aws-amplify/ui'), require('xstate'), require('aws-amplify'), require('qrcode'), require('rxjs'), require('@aws-amplify/ui-components/dist/components')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@aws-amplify/ui-angular', ['exports', '@angular/core', '@angular/common', '@aws-amplify/ui', 'xstate', 'aws-amplify', 'qrcode', 'rxjs', '@aws-amplify/ui-components/dist/components'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['aws-amplify'] = global['aws-amplify'] || {}, global['aws-amplify']['ui-angular'] = {}), global.ng.core, global.ng.common, global.ui, global.xstate, global['aws-amplify'], global.QRCode, global.rxjs, global.components));
|
|
5
|
+
}(this, (function (exports, i0, common, ui, xstate, awsAmplify, QRCode, rxjs, components) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -212,7 +212,7 @@
|
|
|
212
212
|
AmplifyAuthenticatorComponent.decorators = [
|
|
213
213
|
{ type: i0.Component, args: [{
|
|
214
214
|
selector: 'amplify-authenticator',
|
|
215
|
-
template: "<!-- \n Define default contents here.\n-->\n<ng-template #signIn>\n <amplify-sign-in></amplify-sign-in>\n</ng-template>\n<ng-template #signUp>\n <amplify-sign-up></amplify-sign-up>\n</ng-template>\n<ng-template #confirmSignUp>\n <amplify-confirm-sign-up></amplify-confirm-sign-up>\n</ng-template>\n<ng-template #confirmSignIn>\n <amplify-confirm-sign-in></amplify-confirm-sign-in>\n</ng-template>\n<ng-template #authenticated
|
|
215
|
+
template: "<!-- \n Define default contents here.\n-->\n<ng-template #signIn>\n <amplify-sign-in></amplify-sign-in>\n</ng-template>\n<ng-template #signUp>\n <amplify-sign-up></amplify-sign-up>\n</ng-template>\n<ng-template #confirmSignUp>\n <amplify-confirm-sign-up></amplify-confirm-sign-up>\n</ng-template>\n<ng-template #confirmSignIn>\n <amplify-confirm-sign-in></amplify-confirm-sign-in>\n</ng-template>\n<ng-template #authenticated> <ng-content></ng-content> </ng-template>\n<ng-template #setupTOTP>\n <amplify-setup-totp></amplify-setup-totp>\n</ng-template>\n<ng-template #forceNewPassword>\n <amplify-force-new-password></amplify-force-new-password>\n</ng-template>\n<ng-template #resetPassword>\n <amplify-reset-password></amplify-reset-password>\n</ng-template>\n<ng-template #confirmResetPassword>\n <amplify-confirm-reset-password></amplify-confirm-reset-password>\n</ng-template>\n<ng-template #verifyUser>\n <amplify-verify-user></amplify-verify-user>\n</ng-template>\n<ng-template #confirmVerifyUser>\n <amplify-confirm-verify-user></amplify-confirm-verify-user>\n</ng-template>\n\n<!-- \n Next, we render respective auth subcomponent respective to the current authState.\n If customer is overriding that component, we render customer's template instead.\n-->\n\n<!-- signIn component -->\n<ng-container\n [ngTemplateOutlet]=\"customComponents.signIn || signIn\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('signIn')\"\n>\n</ng-container>\n\n<!-- signUp component -->\n<ng-container\n [ngTemplateOutlet]=\"customComponents.signUp || signUp\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('signUp')\"\n>\n</ng-container>\n\n<!-- confirmSignUp content -->\n<ng-container\n [ngTemplateOutlet]=\"customComponents.confirmSignUp || confirmSignUp\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('confirmSignUp')\"\n>\n</ng-container>\n\n<!-- confirmSignIn content -->\n<ng-container\n [ngTemplateOutlet]=\"customComponents.confirmSignIn || confirmSignIn\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('confirmSignIn')\"\n>\n</ng-container>\n\n<!-- setupTotp content -->\n<ng-container\n [ngTemplateOutlet]=\"customComponents.setupTOTP || setupTOTP\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('setupTOTP')\"\n>\n</ng-container>\n\n<!-- forceNewPassword content -->\n<ng-container\n [ngTemplateOutlet]=\"customComponents.forceNewPassword || forceNewPassword\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('forceNewPassword')\"\n>\n</ng-container>\n\n<!-- resetPassword content -->\n<ng-container\n [ngTemplateOutlet]=\"customComponents.resetPassword || resetPassword\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('resetPassword')\"\n>\n</ng-container>\n\n<!-- confirmResetPassword content -->\n<ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmResetPassword || confirmResetPassword\n \"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('confirmResetPassword')\"\n>\n</ng-container>\n\n<!-- verifyUser content -->\n<ng-container\n [ngTemplateOutlet]=\"customComponents.verifyUser || verifyUser\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('verifyUser')\"\n>\n</ng-container>\n\n<!-- confirmVerifyUser content -->\n<ng-container\n [ngTemplateOutlet]=\"customComponents.confirmVerifyUser || confirmVerifyUser\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('confirmVerifyUser')\"\n>\n</ng-container>\n\n<!-- signedIn content -->\n<ng-container\n [ngTemplateOutlet]=\"customComponents.authenticated || authenticated\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"authenticatorState.matches('authenticated')\"\n>\n</ng-container>\n",
|
|
216
216
|
providers: [AuthPropService],
|
|
217
217
|
encapsulation: i0.ViewEncapsulation.None
|
|
218
218
|
},] }
|
|
@@ -545,16 +545,21 @@
|
|
|
545
545
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
546
546
|
}
|
|
547
547
|
|
|
548
|
-
var logger$
|
|
548
|
+
var logger$3 = new awsAmplify.Logger('SignIn');
|
|
549
549
|
var AmplifySignInComponent = /** @class */ (function () {
|
|
550
550
|
function AmplifySignInComponent(stateMachine, contextService) {
|
|
551
551
|
this.stateMachine = stateMachine;
|
|
552
552
|
this.contextService = contextService;
|
|
553
553
|
this.dataAttr = '';
|
|
554
|
-
this.headerText = 'Sign in to your account';
|
|
554
|
+
this.headerText = ui.translate('Sign in to your account');
|
|
555
555
|
this.customComponents = {};
|
|
556
556
|
this.remoteError = '';
|
|
557
557
|
this.isPending = false;
|
|
558
|
+
// translated phrases
|
|
559
|
+
this.forgotPasswordText = ui.translate('Forgot your password? ');
|
|
560
|
+
this.signInButtonText = ui.translate('Sign in');
|
|
561
|
+
this.noAccountText = ui.translate('No account? ');
|
|
562
|
+
this.createAccountText = ui.translate('Create account');
|
|
558
563
|
}
|
|
559
564
|
AmplifySignInComponent.prototype.ngOnInit = function () {
|
|
560
565
|
var _this = this;
|
|
@@ -564,7 +569,7 @@
|
|
|
564
569
|
this.customComponents = this.contextService.customComponents;
|
|
565
570
|
};
|
|
566
571
|
AmplifySignInComponent.prototype.ngOnDestroy = function () {
|
|
567
|
-
logger$
|
|
572
|
+
logger$3.log('sign in destroyed, unsubscribing from state machine...');
|
|
568
573
|
this.authSubscription.unsubscribe();
|
|
569
574
|
};
|
|
570
575
|
AmplifySignInComponent.prototype.onStateUpdate = function (state) {
|
|
@@ -611,7 +616,7 @@
|
|
|
611
616
|
AmplifySignInComponent.decorators = [
|
|
612
617
|
{ type: i0.Component, args: [{
|
|
613
618
|
selector: 'amplify-sign-in',
|
|
614
|
-
template: "<!-- \n Define default contents here\n-->\n<ng-template #signInButton>\n <button data-amplify-button type=\"submit\">
|
|
619
|
+
template: "<!-- \n Define default contents here\n-->\n<ng-template #signInButton>\n <button data-amplify-button type=\"submit\">{{ signInButtonText }}</button>\n</ng-template>\n\n<ng-template #signInForm>\n <amplify-federated-sign-in></amplify-federated-sign-in>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset data-amplify-fieldset [disabled]=\"isPending\">\n <amplify-user-name-alias></amplify-user-name-alias>\n <amplify-form-input\n data-amplify-password\n name=\"password\"\n type=\"password\"\n autocomplete=\"current-password\"\n ></amplify-form-input>\n <button type=\"button\" (click)=\"toResetPassword()\">\n {{ forgotPasswordText }}\n </button>\n <div data-amplify-footer>\n <div>\n {{ noAccountText }}\n <button type=\"button\" (click)=\"toSignUp()\">\n {{ createAccountText }}\n </button>\n </div>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signInButton || signInButton\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n </div>\n </fieldset>\n\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </form>\n</ng-template>\n\n<!-- \n Render sign in component\n-->\n\n<div data-amplify-container>\n <h2 data-amplify-header>{{ this.headerText }}</h2>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signInForm || signInForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n",
|
|
615
620
|
encapsulation: i0.ViewEncapsulation.None
|
|
616
621
|
},] }
|
|
617
622
|
];
|
|
@@ -624,46 +629,21 @@
|
|
|
624
629
|
headerText: [{ type: i0.Input }]
|
|
625
630
|
};
|
|
626
631
|
|
|
627
|
-
var AmplifySignOutComponent = /** @class */ (function () {
|
|
628
|
-
function AmplifySignOutComponent(stateMachine) {
|
|
629
|
-
this.stateMachine = stateMachine;
|
|
630
|
-
}
|
|
631
|
-
AmplifySignOutComponent.prototype.signOut = function () {
|
|
632
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
633
|
-
return __generator(this, function (_a) {
|
|
634
|
-
try {
|
|
635
|
-
this.stateMachine.authService.send('SIGN_OUT');
|
|
636
|
-
}
|
|
637
|
-
catch (err) {
|
|
638
|
-
console.error(err);
|
|
639
|
-
}
|
|
640
|
-
return [2 /*return*/];
|
|
641
|
-
});
|
|
642
|
-
});
|
|
643
|
-
};
|
|
644
|
-
return AmplifySignOutComponent;
|
|
645
|
-
}());
|
|
646
|
-
AmplifySignOutComponent.decorators = [
|
|
647
|
-
{ type: i0.Component, args: [{
|
|
648
|
-
selector: 'amplify-sign-out',
|
|
649
|
-
template: "<div [ngStyle]=\"{ height: '24rem' }\">\n <button (click)=\"signOut()\">Sign Out</button>\n</div>\n"
|
|
650
|
-
},] }
|
|
651
|
-
];
|
|
652
|
-
AmplifySignOutComponent.ctorParameters = function () { return [
|
|
653
|
-
{ type: StateMachineService }
|
|
654
|
-
]; };
|
|
655
|
-
|
|
656
632
|
var AmplifySignUpComponent = /** @class */ (function () {
|
|
657
633
|
function AmplifySignUpComponent(stateMachine, contextService) {
|
|
658
634
|
this.stateMachine = stateMachine;
|
|
659
635
|
this.contextService = contextService;
|
|
660
636
|
this.dataAttr = '';
|
|
661
|
-
this.headerText = 'Create a new account';
|
|
637
|
+
this.headerText = ui.translate('Create a new account');
|
|
662
638
|
this.remoteError = '';
|
|
663
639
|
this.isPending = false;
|
|
664
640
|
this.primaryAlias = '';
|
|
665
641
|
this.secondaryAliases = [];
|
|
666
642
|
this.validationError = {};
|
|
643
|
+
// translated texts
|
|
644
|
+
this.createAccountText = ui.translate('Back to Sign In');
|
|
645
|
+
this.haveAccountText = ui.translate('Have an account? ');
|
|
646
|
+
this.signInText = ui.translate('Sign in');
|
|
667
647
|
}
|
|
668
648
|
Object.defineProperty(AmplifySignUpComponent.prototype, "context", {
|
|
669
649
|
get: function () {
|
|
@@ -731,7 +711,7 @@
|
|
|
731
711
|
AmplifySignUpComponent.decorators = [
|
|
732
712
|
{ type: i0.Component, args: [{
|
|
733
713
|
selector: 'amplify-sign-up',
|
|
734
|
-
template: "<ng-template #signUpButton>\n <button data-amplify-button type=\"submit\">
|
|
714
|
+
template: "<ng-template #signUpButton>\n <button data-amplify-button type=\"submit\">{{ createAccountText }}</button>\n</ng-template>\n\n<ng-template #signUpUsername>\n <amplify-user-name-alias [name]=\"primaryAlias\"></amplify-user-name-alias>\n</ng-template>\n\n<ng-template #signUpPassword>\n <amplify-form-input\n name=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-input>\n</ng-template>\n\n<ng-template #signUpConfirmPassword>\n <amplify-form-input\n name=\"confirm_password\"\n label=\"Confirm Password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-input>\n</ng-template>\n\n<ng-template #signUpFieldset>\n <fieldset data-amplify-fieldset [disabled]=\"isPending\">\n <amplify-federated-sign-in></amplify-federated-sign-in>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signUpUsername || signUpUsername\"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signUpPassword || signUpPassword\"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.signUpConfirmPassword || signUpConfirmPassword\n \"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n\n <ng-container *ngFor=\"let secondaryAlias of secondaryAliases\">\n <amplify-form-input [name]=\"secondaryAlias\"></amplify-form-input>\n </ng-container>\n </fieldset>\n\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n</ng-template>\n\n<div data-amplify-container>\n <h2 data-amplify-header>{{ this.headerText }}</h2>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signUpFieldset || signUpFieldset\"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n\n <div data-amplify-footer>\n <div>\n {{ haveAccountText }}\n <button type=\"button\" (click)=\"toSignIn()\">{{ signInText }}</button>\n </div>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signUpButton || signUpButton\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n </div>\n </form>\n</div>\n"
|
|
735
715
|
},] }
|
|
736
716
|
];
|
|
737
717
|
AmplifySignUpComponent.ctorParameters = function () { return [
|
|
@@ -746,19 +726,35 @@
|
|
|
746
726
|
var getAttributeMap = function () { return ui.authInputAttributes; };
|
|
747
727
|
|
|
748
728
|
/**
|
|
749
|
-
*
|
|
750
|
-
*
|
|
729
|
+
* Input interface opinionated for authenticator usage.
|
|
730
|
+
*
|
|
731
|
+
* TODO: Separate this component out to two parts -- 1) amplify-auth-input that
|
|
732
|
+
* contains authenticator opinionated logic and 2) amplify-text-field primitive
|
|
733
|
+
* that does not make any auth-related inference.
|
|
751
734
|
*/
|
|
752
735
|
var AmplifyInputComponent = /** @class */ (function () {
|
|
753
736
|
function AmplifyInputComponent(stateMachine) {
|
|
754
737
|
this.stateMachine = stateMachine;
|
|
755
|
-
this.required =
|
|
738
|
+
this.required = true;
|
|
756
739
|
this.placeholder = '';
|
|
757
740
|
this.label = '';
|
|
758
741
|
this.initialValue = '';
|
|
759
742
|
this.disabled = false;
|
|
760
743
|
this.autocomplete = '';
|
|
744
|
+
this.countryDialCodes = ui.countryDialCodes;
|
|
761
745
|
}
|
|
746
|
+
AmplifyInputComponent.prototype.ngOnInit = function () {
|
|
747
|
+
var state = this.stateMachine.authState;
|
|
748
|
+
var country_code = ui.getActorContext(state).country_code;
|
|
749
|
+
this.defaultCountryCode = country_code;
|
|
750
|
+
// TODO: consider better default handling mechanisms across frameworks
|
|
751
|
+
if (this.isTelInput()) {
|
|
752
|
+
this.stateMachine.send({
|
|
753
|
+
type: 'CHANGE',
|
|
754
|
+
data: { name: 'country_code', value: country_code },
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
};
|
|
762
758
|
Object.defineProperty(AmplifyInputComponent.prototype, "attributeMap", {
|
|
763
759
|
get: function () {
|
|
764
760
|
return getAttributeMap();
|
|
@@ -775,14 +771,19 @@
|
|
|
775
771
|
enumerable: false,
|
|
776
772
|
configurable: true
|
|
777
773
|
});
|
|
774
|
+
AmplifyInputComponent.prototype.isTelInput = function () {
|
|
775
|
+
return this.inferType() === 'tel';
|
|
776
|
+
};
|
|
778
777
|
AmplifyInputComponent.prototype.inferLabel = function () {
|
|
779
778
|
var _a;
|
|
780
|
-
|
|
779
|
+
var label = this.label || ((_a = this.attributeMap[this.name]) === null || _a === void 0 ? void 0 : _a.label);
|
|
780
|
+
return ui.translate(label);
|
|
781
781
|
};
|
|
782
782
|
AmplifyInputComponent.prototype.inferPlaceholder = function () {
|
|
783
783
|
var _a;
|
|
784
|
-
|
|
785
|
-
this.inferLabel()
|
|
784
|
+
var placeholder = this.placeholder || ((_a = this.attributeMap[this.name]) === null || _a === void 0 ? void 0 : _a.placeholder) ||
|
|
785
|
+
this.inferLabel();
|
|
786
|
+
return ui.translate(placeholder);
|
|
786
787
|
};
|
|
787
788
|
// infers what the `type` of underlying input element should be.
|
|
788
789
|
AmplifyInputComponent.prototype.inferType = function () {
|
|
@@ -794,7 +795,7 @@
|
|
|
794
795
|
AmplifyInputComponent.decorators = [
|
|
795
796
|
{ type: i0.Component, args: [{
|
|
796
797
|
selector: 'amplify-form-input',
|
|
797
|
-
template: "<label>\n <div data-amplify-label>{{ inferLabel() }}</div>\n <input\n data-amplify-form-input\n [type]=\"inferType()\"\n [name]=\"name\"\n [placeholder]=\"inferPlaceholder()\"\n [required]=\"required
|
|
798
|
+
template: "<!-- Country code field -->\n<amplify-form-select\n *ngIf=\"isTelInput()\"\n name=\"country_code\"\n label=\"Country Code\"\n [id]=\"'country-code'\"\n [items]=\"countryDialCodes\"\n [initialValue]=\"defaultCountryCode\"\n></amplify-form-select>\n<!-- Textbox field -->\n<label>\n <div data-amplify-label>{{ inferLabel() }}</div>\n <input\n data-amplify-form-input\n [type]=\"inferType()\"\n [name]=\"name\"\n [placeholder]=\"inferPlaceholder()\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [attr.disabled]=\"disabled ? '' : null\"\n [autocomplete]=\"autocomplete\"\n />\n <amplify-error *ngIf=\"error\">\n {{ error }}\n </amplify-error>\n</label>\n"
|
|
798
799
|
},] }
|
|
799
800
|
];
|
|
800
801
|
AmplifyInputComponent.ctorParameters = function () { return [
|
|
@@ -823,15 +824,20 @@
|
|
|
823
824
|
},] }
|
|
824
825
|
];
|
|
825
826
|
|
|
826
|
-
var logger$3 = new awsAmplify.Logger('ConfirmSignUp');
|
|
827
827
|
var AmplifyConfirmSignUpComponent = /** @class */ (function () {
|
|
828
828
|
function AmplifyConfirmSignUpComponent(stateMachine, contextService) {
|
|
829
829
|
this.stateMachine = stateMachine;
|
|
830
830
|
this.contextService = contextService;
|
|
831
831
|
this.dataAttr = '';
|
|
832
|
+
this.headerText = ui.translate('Confirm Sign Up');
|
|
832
833
|
this.customComponents = {};
|
|
833
834
|
this.remoteError = '';
|
|
834
835
|
this.isPending = false;
|
|
836
|
+
// translated texts
|
|
837
|
+
this.signInText = ui.translate('Sign in');
|
|
838
|
+
this.resendCodeText = ui.translate('Resend Code');
|
|
839
|
+
this.lostCodeText = ui.translate('Lost your code? ');
|
|
840
|
+
this.confirmText = ui.translate('Confirm');
|
|
835
841
|
}
|
|
836
842
|
AmplifyConfirmSignUpComponent.prototype.ngOnInit = function () {
|
|
837
843
|
var _this = this;
|
|
@@ -857,7 +863,6 @@
|
|
|
857
863
|
this.customComponents = this.contextService.customComponents;
|
|
858
864
|
};
|
|
859
865
|
AmplifyConfirmSignUpComponent.prototype.ngOnDestroy = function () {
|
|
860
|
-
logger$3.log('confirm sign up destroyed, unsubscribing from state machine...');
|
|
861
866
|
this.authSubscription.unsubscribe();
|
|
862
867
|
};
|
|
863
868
|
AmplifyConfirmSignUpComponent.prototype.onStateUpdate = function (state) {
|
|
@@ -910,7 +915,7 @@
|
|
|
910
915
|
AmplifyConfirmSignUpComponent.decorators = [
|
|
911
916
|
{ type: i0.Component, args: [{
|
|
912
917
|
selector: 'amplify-confirm-sign-up',
|
|
913
|
-
template: "<!-- \n Define default contents here\n-->\n<ng-template #confirmSignUpButton>\n <button data-amplify-button type=\"submit\">
|
|
918
|
+
template: "<!-- \n Define default contents here\n-->\n<ng-template #confirmSignUpButton>\n <button data-amplify-button type=\"submit\">{{ confirmText }}</button>\n</ng-template>\n\n<ng-template #confirmSignUpForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset data-amplify-fieldset [disabled]=\"isPending\">\n <amplify-form-input\n name=\"username\"\n [initialValue]=\"username ? username : null\"\n [disabled]=\"!!username\"\n ></amplify-form-input>\n <amplify-form-input\n name=\"confirmation_code\"\n type=\"number\"\n autocomplete=\"one-time-code\"\n ></amplify-form-input>\n\n <div data-amplify-resend>\n {{ lostCodeText }}\n <a data-amplify-link (click)=\"resend()\">{{ resendCodeText }}</a>\n </div>\n\n <div data-amplify-footer>\n <div>\n Back to{{ ' ' }}\n <a data-amplify-link (click)=\"toSignIn()\">{{ signInText }}</a>\n </div>\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmSignUpButton || confirmSignUpButton\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n </div>\n </fieldset>\n\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </form>\n</ng-template>\n\n<!-- \n Render confirm sign up component\n-->\n\n<div data-amplify-container>\n <h2 data-amplify-header>{{ headerText }}</h2>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.confirmSignUpForm || confirmSignUpForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
|
|
914
919
|
},] }
|
|
915
920
|
];
|
|
916
921
|
AmplifyConfirmSignUpComponent.ctorParameters = function () { return [
|
|
@@ -918,7 +923,8 @@
|
|
|
918
923
|
{ type: AuthPropService }
|
|
919
924
|
]; };
|
|
920
925
|
AmplifyConfirmSignUpComponent.propDecorators = {
|
|
921
|
-
dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-confirmsignup',] }]
|
|
926
|
+
dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-confirmsignup',] }],
|
|
927
|
+
headerText: [{ type: i0.Input }]
|
|
922
928
|
};
|
|
923
929
|
|
|
924
930
|
var AmplifyUserNameAliasComponent = /** @class */ (function () {
|
|
@@ -927,20 +933,21 @@
|
|
|
927
933
|
this.name = 'username';
|
|
928
934
|
this.disabled = false;
|
|
929
935
|
this.initialValue = '';
|
|
936
|
+
this.required = true;
|
|
930
937
|
}
|
|
931
938
|
AmplifyUserNameAliasComponent.prototype.ngOnInit = function () {
|
|
932
939
|
var context = this.stateMachine.context;
|
|
933
940
|
var _a = ui.getAliasInfoFromContext(context), label = _a.label, type = _a.type;
|
|
934
941
|
this.label = label;
|
|
935
942
|
this.type = type;
|
|
936
|
-
this.placeholder =
|
|
943
|
+
this.placeholder = label;
|
|
937
944
|
};
|
|
938
945
|
return AmplifyUserNameAliasComponent;
|
|
939
946
|
}());
|
|
940
947
|
AmplifyUserNameAliasComponent.decorators = [
|
|
941
948
|
{ type: i0.Component, args: [{
|
|
942
949
|
selector: 'amplify-user-name-alias',
|
|
943
|
-
template: "<amplify-form-input\n data-amplify-usernamealias\n [name]=\"name\"\n [label]=\"label\"\n [type]=\"type\"\n [placeholder]=\"placeholder\"\n [initialValue]=\"initialValue\"\n [disabled]=\"disabled\"\n autocomplete=\"username\"\n>\n</amplify-form-input>\n"
|
|
950
|
+
template: "<amplify-form-input\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-input>\n"
|
|
944
951
|
},] }
|
|
945
952
|
];
|
|
946
953
|
AmplifyUserNameAliasComponent.ctorParameters = function () { return [
|
|
@@ -949,7 +956,8 @@
|
|
|
949
956
|
AmplifyUserNameAliasComponent.propDecorators = {
|
|
950
957
|
name: [{ type: i0.Input }],
|
|
951
958
|
disabled: [{ type: i0.Input }],
|
|
952
|
-
initialValue: [{ type: i0.Input }]
|
|
959
|
+
initialValue: [{ type: i0.Input }],
|
|
960
|
+
required: [{ type: i0.Input }]
|
|
953
961
|
};
|
|
954
962
|
|
|
955
963
|
var logger$2 = new awsAmplify.Logger('ConfirmSignIn');
|
|
@@ -961,7 +969,8 @@
|
|
|
961
969
|
this.customComponents = {};
|
|
962
970
|
this.remoteError = '';
|
|
963
971
|
this.isPending = false;
|
|
964
|
-
this.
|
|
972
|
+
this.confirmText = ui.translate('Confirm');
|
|
973
|
+
this.backToSignInText = ui.translate('Back to Sign In');
|
|
965
974
|
}
|
|
966
975
|
AmplifyConfirmSignInComponent.prototype.ngOnInit = function () {
|
|
967
976
|
var _this = this;
|
|
@@ -992,10 +1001,10 @@
|
|
|
992
1001
|
switch (challengeName) {
|
|
993
1002
|
case ui.AuthChallengeNames.SOFTWARE_TOKEN_MFA:
|
|
994
1003
|
// TODO: this string should be centralized and translated from ui.
|
|
995
|
-
this.headerText = 'Confirm TOTP Code';
|
|
1004
|
+
this.headerText = ui.translate('Confirm TOTP Code');
|
|
996
1005
|
break;
|
|
997
1006
|
case ui.AuthChallengeNames.SMS_MFA:
|
|
998
|
-
this.headerText = 'Confirm SMS Code';
|
|
1007
|
+
this.headerText = ui.translate('Confirm SMS Code');
|
|
999
1008
|
break;
|
|
1000
1009
|
default:
|
|
1001
1010
|
logger$2.error('Unexpected challengeName', challengeName);
|
|
@@ -1031,7 +1040,7 @@
|
|
|
1031
1040
|
AmplifyConfirmSignInComponent.decorators = [
|
|
1032
1041
|
{ type: i0.Component, args: [{
|
|
1033
1042
|
selector: 'amplify-confirm-sign-in',
|
|
1034
|
-
template: "<!-- \n Define default contents here\n-->\n<ng-template #confirmSignInButton>\n <button data-amplify-button type=\"submit\">
|
|
1043
|
+
template: "<!-- \n Define default contents here\n-->\n<ng-template #confirmSignInButton>\n <button data-amplify-button type=\"submit\">{{ confirmText }}</button>\n</ng-template>\n\n<ng-template #confirmSignInForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset data-amplify-fieldset [disabled]=\"isPending\">\n <amplify-form-input\n name=\"confirmation_code\"\n type=\"number\"\n autocomplete=\"one-time-code\"\n ></amplify-form-input>\n\n <div data-amplify-footer>\n <button type=\"button\" (click)=\"toSignIn()\">\n {{ backToSignInText }}\n </button>\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmSignInButton || confirmSignInButton\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n </div>\n </fieldset>\n\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </form>\n</ng-template>\n\n<!-- \n Render sign in component\n-->\n\n<div data-amplify-container>\n <h2 data-amplify-header>{{ headerText }}</h2>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signInForm || confirmSignInForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
|
|
1035
1044
|
},] }
|
|
1036
1045
|
];
|
|
1037
1046
|
AmplifyConfirmSignInComponent.ctorParameters = function () { return [
|
|
@@ -1050,8 +1059,11 @@
|
|
|
1050
1059
|
this.customComponents = {};
|
|
1051
1060
|
this.remoteError = '';
|
|
1052
1061
|
this.isPending = false;
|
|
1053
|
-
this.headerText = 'Setup TOTP';
|
|
1062
|
+
this.headerText = ui.translate('Setup TOTP');
|
|
1054
1063
|
this.qrCodeSource = '';
|
|
1064
|
+
// translated texts
|
|
1065
|
+
this.backToSignInText = ui.translate('Back to Sign In');
|
|
1066
|
+
this.confirmText = ui.translate('Confirm');
|
|
1055
1067
|
}
|
|
1056
1068
|
AmplifySetupTotpComponent.prototype.ngOnInit = function () {
|
|
1057
1069
|
var _this = this;
|
|
@@ -1084,11 +1096,13 @@
|
|
|
1084
1096
|
AmplifySetupTotpComponent.prototype.generateQRCode = function () {
|
|
1085
1097
|
var _a;
|
|
1086
1098
|
return __awaiter(this, void 0, void 0, function () {
|
|
1087
|
-
var user, secretKey, issuer, totpCode, _b, err_1;
|
|
1099
|
+
var state, actorContext, user, secretKey, issuer, totpCode, _b, err_1;
|
|
1088
1100
|
return __generator(this, function (_c) {
|
|
1089
1101
|
switch (_c.label) {
|
|
1090
1102
|
case 0:
|
|
1091
|
-
|
|
1103
|
+
state = this.stateMachine.authState;
|
|
1104
|
+
actorContext = ui.getActorContext(state);
|
|
1105
|
+
user = actorContext.user;
|
|
1092
1106
|
_c.label = 1;
|
|
1093
1107
|
case 1:
|
|
1094
1108
|
_c.trys.push([1, 4, , 5]);
|
|
@@ -1130,12 +1144,15 @@
|
|
|
1130
1144
|
data: Object.fromEntries(formData),
|
|
1131
1145
|
});
|
|
1132
1146
|
};
|
|
1147
|
+
AmplifySetupTotpComponent.prototype.toSignIn = function () {
|
|
1148
|
+
this.stateMachine.send('SIGN_IN');
|
|
1149
|
+
};
|
|
1133
1150
|
return AmplifySetupTotpComponent;
|
|
1134
1151
|
}());
|
|
1135
1152
|
AmplifySetupTotpComponent.decorators = [
|
|
1136
1153
|
{ type: i0.Component, args: [{
|
|
1137
1154
|
selector: 'amplify-setup-totp',
|
|
1138
|
-
template: "<!-- \n Define default contents here\n-->\n<ng-template #setupTotpButton>\n <button data-amplify-button type=\"submit\">
|
|
1155
|
+
template: "<!-- \n Define default contents here\n-->\n<ng-template #setupTotpButton>\n <button data-amplify-button type=\"submit\">{{ confirmText }}</button>\n</ng-template>\n\n<ng-template #setupTotpForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset data-amplify-fieldset [disabled]=\"isPending\">\n <p *ngIf=\"!qrCodeSource\">Loading...</p>\n <img *ngIf=\"qrCodeSource\" [src]=\"qrCodeSource\" alt=\"qr code\" />\n <amplify-form-input\n name=\"confirmation_code\"\n type=\"number\"\n autocomplete=\"one-time-code\"\n ></amplify-form-input>\n\n <div data-amplify-footer>\n <button (click)=\"toSignIn()\">{{ backToSignInText }}</button>\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.setupTotpButton || setupTotpButton\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n </div>\n </fieldset>\n\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </form>\n</ng-template>\n\n<!-- \n Render sign in component\n-->\n<div data-amplify-container>\n <h2 data-amplify-header>{{ this.headerText }}</h2>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.setupTotpForm || setupTotpForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
|
|
1139
1156
|
},] }
|
|
1140
1157
|
];
|
|
1141
1158
|
AmplifySetupTotpComponent.ctorParameters = function () { return [
|
|
@@ -1152,10 +1169,13 @@
|
|
|
1152
1169
|
this.stateMachine = stateMachine;
|
|
1153
1170
|
this.contextService = contextService;
|
|
1154
1171
|
this.dataAttr = '';
|
|
1155
|
-
this.headerText = '
|
|
1172
|
+
this.headerText = ui.translate('Reset your password');
|
|
1156
1173
|
this.customComponents = {};
|
|
1157
1174
|
this.remoteError = '';
|
|
1158
1175
|
this.isPending = false;
|
|
1176
|
+
// translated texts
|
|
1177
|
+
this.changePasswordText = ui.translate('Change Password');
|
|
1178
|
+
this.backToSignInText = ui.translate('Back to Sign In');
|
|
1159
1179
|
}
|
|
1160
1180
|
AmplifyForceNewPasswordComponent.prototype.ngOnInit = function () {
|
|
1161
1181
|
var _this = this;
|
|
@@ -1171,7 +1191,11 @@
|
|
|
1171
1191
|
AmplifyForceNewPasswordComponent.prototype.onStateUpdate = function (state) {
|
|
1172
1192
|
var actorState = ui.getActorState(state);
|
|
1173
1193
|
this.remoteError = actorState.context.remoteError;
|
|
1174
|
-
this.isPending =
|
|
1194
|
+
this.isPending = actorState.matches({
|
|
1195
|
+
signUp: {
|
|
1196
|
+
submission: 'idle',
|
|
1197
|
+
},
|
|
1198
|
+
});
|
|
1175
1199
|
};
|
|
1176
1200
|
Object.defineProperty(AmplifyForceNewPasswordComponent.prototype, "context", {
|
|
1177
1201
|
get: function () {
|
|
@@ -1210,7 +1234,7 @@
|
|
|
1210
1234
|
AmplifyForceNewPasswordComponent.decorators = [
|
|
1211
1235
|
{ type: i0.Component, args: [{
|
|
1212
1236
|
selector: 'amplify-force-new-password',
|
|
1213
|
-
template: "<!-- \n Define default contents here\n-->\n<ng-template #forceNewPasswordSubmitButton>\n <button data-amplify-button type=\"submit\">
|
|
1237
|
+
template: "<!-- \n Define default contents here\n-->\n<ng-template #forceNewPasswordSubmitButton>\n <button data-amplify-button type=\"submit\">{{ changePasswordText }}</button>\n</ng-template>\n\n<ng-template #signInForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset data-amplify-fieldset [disabled]=\"isPending\">\n <amplify-form-input\n name=\"password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-input>\n\n <amplify-form-input\n name=\"confirm_password\"\n label=\"Confirm Password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-input>\n\n <div data-amplify-footer>\n <button type=\"button\" (click)=\"toSignIn()\">\n {{ backToSignInText }}\n </button>\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.forceNewPasswordSubmitButton ||\n forceNewPasswordSubmitButton\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n </div>\n </fieldset>\n\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </form>\n</ng-template>\n\n<!-- \n Render sign in component\n-->\n<div data-amplify-container>\n <h2 data-amplify-header>{{ this.headerText }}</h2>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signInForm || signInForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
|
|
1214
1238
|
},] }
|
|
1215
1239
|
];
|
|
1216
1240
|
AmplifyForceNewPasswordComponent.ctorParameters = function () { return [
|
|
@@ -1230,6 +1254,10 @@
|
|
|
1230
1254
|
this.includeGoogle = false;
|
|
1231
1255
|
this.includeAmazon = false;
|
|
1232
1256
|
this.shouldShowFederatedSignIn = false;
|
|
1257
|
+
// translated texts
|
|
1258
|
+
this.signInFacebookText = ui.translate('Sign In with Facebook');
|
|
1259
|
+
this.signInGoogleText = ui.translate('Sign In with Google');
|
|
1260
|
+
this.signInAmazonText = ui.translate('Sign In with Amazon');
|
|
1233
1261
|
}
|
|
1234
1262
|
AmplifyFederatedSignInComponent.prototype.ngOnInit = function () {
|
|
1235
1263
|
var _a, _b;
|
|
@@ -1245,7 +1273,7 @@
|
|
|
1245
1273
|
AmplifyFederatedSignInComponent.decorators = [
|
|
1246
1274
|
{ type: i0.Component, args: [{
|
|
1247
1275
|
selector: 'amplify-federated-sign-in',
|
|
1248
|
-
template: "<div data-amplify-federated>\n <amplify-federated-sign-in-button\n *ngIf=\"includeFacebook\"\n text=\"
|
|
1276
|
+
template: "<div data-amplify-federated>\n <amplify-federated-sign-in-button\n *ngIf=\"includeFacebook\"\n [text]=\"signInFacebookText\"\n [provider]=\"FederatedProviders.Facebook\"\n ></amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeGoogle\"\n [text]=\"signInGoogleText\"\n [provider]=\"FederatedProviders.Google\"\n ></amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeAmazon\"\n [text]=\"signInAmazonText\"\n [provider]=\"FederatedProviders.Amazon\"\n ></amplify-federated-sign-in-button>\n</div>\n"
|
|
1249
1277
|
},] }
|
|
1250
1278
|
];
|
|
1251
1279
|
AmplifyFederatedSignInComponent.ctorParameters = function () { return [
|
|
@@ -1284,10 +1312,13 @@
|
|
|
1284
1312
|
this.stateMachine = stateMachine;
|
|
1285
1313
|
this.contextService = contextService;
|
|
1286
1314
|
this.dataAttr = '';
|
|
1287
|
-
this.headerText = 'Reset your password';
|
|
1315
|
+
this.headerText = ui.translate('Reset your password');
|
|
1288
1316
|
this.customComponents = {};
|
|
1289
1317
|
this.remoteError = '';
|
|
1290
1318
|
this.isPending = false;
|
|
1319
|
+
// translated texts
|
|
1320
|
+
this.sendCodeText = ui.translate('Send Code');
|
|
1321
|
+
this.backToSignInText = ui.translate('Back to Sign In');
|
|
1291
1322
|
}
|
|
1292
1323
|
AmplifyResetPasswordComponent.prototype.ngOnInit = function () {
|
|
1293
1324
|
var _this = this;
|
|
@@ -1333,7 +1364,7 @@
|
|
|
1333
1364
|
AmplifyResetPasswordComponent.decorators = [
|
|
1334
1365
|
{ type: i0.Component, args: [{
|
|
1335
1366
|
selector: 'amplify-reset-password',
|
|
1336
|
-
template: "<!-- \n Define default contents here\n-->\n<ng-template #resetPasswordSubmitButton>\n <button data-amplify-button type=\"submit\">
|
|
1367
|
+
template: "<!-- \n Define default contents here\n-->\n<ng-template #resetPasswordSubmitButton>\n <button data-amplify-button type=\"submit\">{{ sendCodeText }}</button>\n</ng-template>\n\n<ng-template #resetPasswordFooter>\n <div data-amplify-footer>\n <button type=\"button\" (click)=\"toSignIn()\">{{ backToSignInText }}</button>\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.resetPasswordSubmitButton || resetPasswordSubmitButton\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #resetPasswordForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset data-amplify-fieldset [disabled]=\"isPending\">\n <amplify-form-input\n name=\"username\"\n type=\"username\"\n autocomplete=\"username\"\n ></amplify-form-input>\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.resetPasswordFooter || resetPasswordFooter\n \"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n </fieldset>\n\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </form>\n</ng-template>\n\n<!-- \n Render reset passsword component\n-->\n<div data-amplify-container>\n <h2 data-amplify-header>{{ this.headerText }}</h2>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.resetPasswordForm || resetPasswordForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
|
|
1337
1368
|
},] }
|
|
1338
1369
|
];
|
|
1339
1370
|
AmplifyResetPasswordComponent.ctorParameters = function () { return [
|
|
@@ -1350,11 +1381,14 @@
|
|
|
1350
1381
|
this.stateMachine = stateMachine;
|
|
1351
1382
|
this.contextService = contextService;
|
|
1352
1383
|
this.dataAttr = '';
|
|
1353
|
-
this.headerText = 'Account recovery requires verified contact information';
|
|
1384
|
+
this.headerText = ui.translate('Account recovery requires verified contact information');
|
|
1354
1385
|
this.customComponents = {};
|
|
1355
1386
|
this.unverifiedAttributes = {};
|
|
1356
1387
|
this.remoteError = '';
|
|
1357
1388
|
this.isPending = false;
|
|
1389
|
+
// translated texts
|
|
1390
|
+
this.skipText = ui.translate('Skip');
|
|
1391
|
+
this.verifyText = ui.translate('Verify');
|
|
1358
1392
|
}
|
|
1359
1393
|
AmplifyVerifyUserComponent.prototype.ngOnInit = function () {
|
|
1360
1394
|
var _this = this;
|
|
@@ -1384,6 +1418,10 @@
|
|
|
1384
1418
|
AmplifyVerifyUserComponent.prototype.skipVerify = function () {
|
|
1385
1419
|
this.stateMachine.send('SKIP');
|
|
1386
1420
|
};
|
|
1421
|
+
// enable translate to be used inside the template
|
|
1422
|
+
AmplifyVerifyUserComponent.prototype.translate = function (phrase) {
|
|
1423
|
+
return ui.translate(phrase);
|
|
1424
|
+
};
|
|
1387
1425
|
AmplifyVerifyUserComponent.prototype.onSubmit = function (event) {
|
|
1388
1426
|
return __awaiter(this, void 0, void 0, function () {
|
|
1389
1427
|
var formData;
|
|
@@ -1403,7 +1441,7 @@
|
|
|
1403
1441
|
AmplifyVerifyUserComponent.decorators = [
|
|
1404
1442
|
{ type: i0.Component, args: [{
|
|
1405
1443
|
selector: 'amplify-verify-user',
|
|
1406
|
-
template: "<!-- \n Define default contents here\n-->\n<ng-template #verifyUserFooter>\n <div data-amplify-footer>\n <button data-amplify-button (click)=\"skipVerify()\">
|
|
1444
|
+
template: "<!-- \n Define default contents here\n-->\n<ng-template #verifyUserFooter>\n <div data-amplify-footer>\n <button data-amplify-button (click)=\"skipVerify()\">{{ skipText }}</button>\n <button data-amplify-button type=\"submit\">{{ verifyText }}</button>\n </div>\n</ng-template>\n\n<ng-template #verifyUserForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\">\n <fieldset data-amplify-fieldset [disabled]=\"isPending\">\n <ng-container\n *ngFor=\"let unverifiedAttribute of unverifiedAttributes | keyvalue\"\n >\n <input\n name=\"unverifiedAttr\"\n type=\"radio\"\n [value]=\"unverifiedAttribute.key\"\n />\n <span>{{ translate(unverifiedAttribute.key) }}</span>\n </ng-container>\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.verifyUserFooter || verifyUserFooter\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n </fieldset>\n\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </form>\n</ng-template>\n\n<!-- \n Render verify user component\n-->\n<div data-amplify-container>\n <h2 data-amplify-header>{{ this.headerText }}</h2>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.verifyUserForm || verifyUserForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n",
|
|
1407
1445
|
encapsulation: i0.ViewEncapsulation.None
|
|
1408
1446
|
},] }
|
|
1409
1447
|
];
|
|
@@ -1421,10 +1459,15 @@
|
|
|
1421
1459
|
this.stateMachine = stateMachine;
|
|
1422
1460
|
this.contextService = contextService;
|
|
1423
1461
|
this.dataAttr = '';
|
|
1424
|
-
this.headerText = 'Reset your password';
|
|
1462
|
+
this.headerText = ui.translate('Reset your password');
|
|
1425
1463
|
this.customComponents = {};
|
|
1426
1464
|
this.remoteError = '';
|
|
1427
1465
|
this.isPending = false;
|
|
1466
|
+
// translated strings
|
|
1467
|
+
this.sendCodeText = ui.translate('Send Code');
|
|
1468
|
+
this.backToSignInText = ui.translate('Back to Sign In');
|
|
1469
|
+
this.lostCodeText = ui.translate('Lost your code? ');
|
|
1470
|
+
this.resendCodeText = ui.translate('Resend Code');
|
|
1428
1471
|
}
|
|
1429
1472
|
ConfirmResetPasswordComponent.prototype.ngOnInit = function () {
|
|
1430
1473
|
var _this = this;
|
|
@@ -1478,7 +1521,7 @@
|
|
|
1478
1521
|
ConfirmResetPasswordComponent.decorators = [
|
|
1479
1522
|
{ type: i0.Component, args: [{
|
|
1480
1523
|
selector: 'amplify-confirm-reset-password',
|
|
1481
|
-
template: "<!-- \n Define default contents here\n-->\n<ng-template #confirmResetPasswordSubmitButton>\n <button data-amplify-button type=\"submit\">
|
|
1524
|
+
template: "<!-- \n Define default contents here\n-->\n<ng-template #confirmResetPasswordSubmitButton>\n <button data-amplify-button type=\"submit\">{{ sendCodeText }}</button>\n</ng-template>\n\n<ng-template #confirmResetPasswordFooter>\n <div data-amplify-footer>\n <div>\n <button type=\"button\" (click)=\"toSignIn()\">{{ backToSignInText }}</button>\n </div>\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmResetPasswordSubmitButton ||\n confirmResetPasswordSubmitButton\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n </div>\n</ng-template>\n\n<ng-template #confirmResetPasswordForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset data-amplify-fieldset [disabled]=\"isPending\">\n <amplify-form-input\n name=\"confirmation_code\"\n type=\"number\"\n autocomplete=\"one-time-code\"\n ></amplify-form-input>\n <amplify-form-input\n name=\"password\"\n label=\"New password\"\n autocomplete=\"new-password\"\n ></amplify-form-input>\n\n <div data-amplify-resend>\n {{ lostCodeText }}\n <button type=\"button\" (click)=\"resend()\">{{ resendCodeText }}</button>\n </div>\n\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmResetPasswordFooter ||\n confirmResetPasswordFooter\n \"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n </fieldset>\n\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </form>\n</ng-template>\n\n<!-- \n Render confirm reset password component\n-->\n<div data-amplify-container>\n <h2 data-amplify-header>{{ headerText }}</h2>\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmResetPasswordForm || confirmResetPasswordForm\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
|
|
1482
1525
|
},] }
|
|
1483
1526
|
];
|
|
1484
1527
|
ConfirmResetPasswordComponent.ctorParameters = function () { return [
|
|
@@ -1546,7 +1589,7 @@
|
|
|
1546
1589
|
ConfirmVerifyUserComponent.decorators = [
|
|
1547
1590
|
{ type: i0.Component, args: [{
|
|
1548
1591
|
selector: 'amplify-confirm-verify-user',
|
|
1549
|
-
template: "<!-- \n Define default contents here\n-->\n<ng-template #verifyUserFooter>\n <div data-amplify-footer>\n <button data-amplify-button (click)=\"skipVerify()\">Skip</button>\n <button data-amplify-button type=\"submit\">Submit</button>\n </div>\n</ng-template>\n\n<ng-template #confirmVerifyUserForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\">\n <fieldset data-amplify-fieldset [disabled]=\"isPending\">\n <amplify-form-input\n name=\"confirmation_code\"\n type=\"number\"\n autocomplete=\"one-time-code\"\n
|
|
1592
|
+
template: "<!-- \n Define default contents here\n-->\n<ng-template #verifyUserFooter>\n <div data-amplify-footer>\n <button data-amplify-button (click)=\"skipVerify()\">Skip</button>\n <button data-amplify-button type=\"submit\">Submit</button>\n </div>\n</ng-template>\n\n<ng-template #confirmVerifyUserForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\">\n <fieldset data-amplify-fieldset [disabled]=\"isPending\">\n <amplify-form-input\n name=\"confirmation_code\"\n type=\"number\"\n autocomplete=\"one-time-code\"\n ></amplify-form-input>\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.verifyUserFooter || verifyUserFooter\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n </fieldset>\n\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </form>\n</ng-template>\n\n<!-- \n Render confirm reset password component\n-->\n<div data-amplify-container>\n <h2 data-amplify-header>{{ this.headerText }}</h2>\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmVerifyUserForm || confirmVerifyUserForm\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
|
|
1550
1593
|
},] }
|
|
1551
1594
|
];
|
|
1552
1595
|
ConfirmVerifyUserComponent.ctorParameters = function () { return [
|
|
@@ -1558,6 +1601,25 @@
|
|
|
1558
1601
|
headerText: [{ type: i0.Input }]
|
|
1559
1602
|
};
|
|
1560
1603
|
|
|
1604
|
+
var AmplifySelectComponent = /** @class */ (function () {
|
|
1605
|
+
function AmplifySelectComponent() {
|
|
1606
|
+
}
|
|
1607
|
+
return AmplifySelectComponent;
|
|
1608
|
+
}());
|
|
1609
|
+
AmplifySelectComponent.decorators = [
|
|
1610
|
+
{ type: i0.Component, args: [{
|
|
1611
|
+
selector: 'amplify-form-select',
|
|
1612
|
+
template: "<select [id]=\"id\" [name]=\"name\" [attr.aria-label]=\"label\">\n <option\n *ngFor=\"let item of items\"\n [value]=\"item\"\n [selected]=\"item === initialValue\"\n >\n {{ item }}\n </option>\n</select>\n"
|
|
1613
|
+
},] }
|
|
1614
|
+
];
|
|
1615
|
+
AmplifySelectComponent.propDecorators = {
|
|
1616
|
+
items: [{ type: i0.Input }],
|
|
1617
|
+
name: [{ type: i0.Input }],
|
|
1618
|
+
label: [{ type: i0.Input }],
|
|
1619
|
+
id: [{ type: i0.Input }],
|
|
1620
|
+
initialValue: [{ type: i0.Input }]
|
|
1621
|
+
};
|
|
1622
|
+
|
|
1561
1623
|
var proxyInputs = function (Cmp, inputs) {
|
|
1562
1624
|
var Prototype = Cmp.prototype;
|
|
1563
1625
|
inputs.forEach(function (item) {
|
|
@@ -3432,7 +3494,6 @@
|
|
|
3432
3494
|
exports.AmplifyPhotoPicker,
|
|
3433
3495
|
AmplifyAuthenticatorComponent,
|
|
3434
3496
|
AmplifySignInComponent,
|
|
3435
|
-
AmplifySignOutComponent,
|
|
3436
3497
|
AmplifySignUpComponent,
|
|
3437
3498
|
AmplifyInputComponent,
|
|
3438
3499
|
AmplifyErrorComponent,
|
|
@@ -3448,8 +3509,9 @@
|
|
|
3448
3509
|
AmplifyVerifyUserComponent,
|
|
3449
3510
|
ConfirmResetPasswordComponent,
|
|
3450
3511
|
ConfirmVerifyUserComponent,
|
|
3512
|
+
AmplifySelectComponent,
|
|
3451
3513
|
],
|
|
3452
|
-
imports: [common.CommonModule
|
|
3514
|
+
imports: [common.CommonModule],
|
|
3453
3515
|
exports: [
|
|
3454
3516
|
exports.AmplifyChatbot,
|
|
3455
3517
|
exports.AmplifyToast,
|
|
@@ -3464,7 +3526,6 @@
|
|
|
3464
3526
|
exports.AmplifyPhotoPicker,
|
|
3465
3527
|
AmplifyAuthenticatorComponent,
|
|
3466
3528
|
AmplifySignInComponent,
|
|
3467
|
-
AmplifySignOutComponent,
|
|
3468
3529
|
AmplifyInputComponent,
|
|
3469
3530
|
AmplifyErrorComponent,
|
|
3470
3531
|
AmplifyOverrideDirective,
|
|
@@ -3482,34 +3543,43 @@
|
|
|
3482
3543
|
*/
|
|
3483
3544
|
|
|
3484
3545
|
exports.AmplifyAuthenticatorComponent = AmplifyAuthenticatorComponent;
|
|
3546
|
+
exports.AmplifyConfirmSignInComponent = AmplifyConfirmSignInComponent;
|
|
3485
3547
|
exports.AmplifyConfirmSignUpComponent = AmplifyConfirmSignUpComponent;
|
|
3486
3548
|
exports.AmplifyErrorComponent = AmplifyErrorComponent;
|
|
3549
|
+
exports.AmplifyFederatedSignInButtonComponent = AmplifyFederatedSignInButtonComponent;
|
|
3550
|
+
exports.AmplifyFederatedSignInComponent = AmplifyFederatedSignInComponent;
|
|
3551
|
+
exports.AmplifyForceNewPasswordComponent = AmplifyForceNewPasswordComponent;
|
|
3487
3552
|
exports.AmplifyInputComponent = AmplifyInputComponent;
|
|
3488
3553
|
exports.AmplifyOverrideDirective = AmplifyOverrideDirective;
|
|
3554
|
+
exports.AmplifyResetPasswordComponent = AmplifyResetPasswordComponent;
|
|
3555
|
+
exports.AmplifySetupTotpComponent = AmplifySetupTotpComponent;
|
|
3489
3556
|
exports.AmplifySignInComponent = AmplifySignInComponent;
|
|
3490
|
-
exports.AmplifySignOutComponent = AmplifySignOutComponent;
|
|
3491
3557
|
exports.AmplifySignUpComponent = AmplifySignUpComponent;
|
|
3558
|
+
exports.AmplifyVerifyUserComponent = AmplifyVerifyUserComponent;
|
|
3492
3559
|
exports.AuthPropService = AuthPropService;
|
|
3560
|
+
exports.ConfirmResetPasswordComponent = ConfirmResetPasswordComponent;
|
|
3561
|
+
exports.ConfirmVerifyUserComponent = ConfirmVerifyUserComponent;
|
|
3493
3562
|
exports.StateMachineService = StateMachineService;
|
|
3494
3563
|
exports.UiAngularModule = UiAngularModule;
|
|
3564
|
+
exports.getAttributeMap = getAttributeMap;
|
|
3495
3565
|
exports.ɵa = ProxyCmp;
|
|
3496
3566
|
exports.ɵb = AmplifyAuthenticatorComponent;
|
|
3497
3567
|
exports.ɵc = AmplifySignInComponent;
|
|
3498
|
-
exports.ɵd =
|
|
3499
|
-
exports.ɵe =
|
|
3500
|
-
exports.ɵf =
|
|
3501
|
-
exports.ɵg =
|
|
3502
|
-
exports.ɵh =
|
|
3503
|
-
exports.ɵi =
|
|
3504
|
-
exports.ɵj =
|
|
3505
|
-
exports.ɵk =
|
|
3506
|
-
exports.ɵl =
|
|
3507
|
-
exports.ɵm =
|
|
3508
|
-
exports.ɵn =
|
|
3509
|
-
exports.ɵo =
|
|
3510
|
-
exports.ɵp =
|
|
3511
|
-
exports.ɵq =
|
|
3512
|
-
exports.ɵr =
|
|
3568
|
+
exports.ɵd = AmplifySignUpComponent;
|
|
3569
|
+
exports.ɵe = AmplifyInputComponent;
|
|
3570
|
+
exports.ɵf = AmplifyErrorComponent;
|
|
3571
|
+
exports.ɵg = AmplifyConfirmSignUpComponent;
|
|
3572
|
+
exports.ɵh = AmplifyUserNameAliasComponent;
|
|
3573
|
+
exports.ɵi = AmplifyConfirmSignInComponent;
|
|
3574
|
+
exports.ɵj = AmplifySetupTotpComponent;
|
|
3575
|
+
exports.ɵk = AmplifyForceNewPasswordComponent;
|
|
3576
|
+
exports.ɵl = AmplifyFederatedSignInComponent;
|
|
3577
|
+
exports.ɵm = AmplifyFederatedSignInButtonComponent;
|
|
3578
|
+
exports.ɵn = AmplifyResetPasswordComponent;
|
|
3579
|
+
exports.ɵo = AmplifyVerifyUserComponent;
|
|
3580
|
+
exports.ɵp = ConfirmResetPasswordComponent;
|
|
3581
|
+
exports.ɵq = ConfirmVerifyUserComponent;
|
|
3582
|
+
exports.ɵr = AmplifySelectComponent;
|
|
3513
3583
|
|
|
3514
3584
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3515
3585
|
|