@aws-amplify/ui-angular 2.1.3 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/aws-amplify-ui-angular.metadata.json +1 -1
- package/bundles/aws-amplify-ui-angular.umd.js +182 -47
- package/bundles/aws-amplify-ui-angular.umd.js.map +1 -1
- package/bundles/aws-amplify-ui-angular.umd.min.js +1 -1
- package/bundles/aws-amplify-ui-angular.umd.min.js.map +1 -1
- package/esm2015/lib/components/authenticator/components/authenticator/authenticator.component.js +4 -2
- package/esm2015/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.js +15 -3
- package/esm2015/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.js +13 -3
- package/esm2015/lib/components/authenticator/components/confirm-sign-up/confirm-sign-up.component.js +15 -3
- package/esm2015/lib/components/authenticator/components/confirm-verify-user/amplify-confirm-verify-user.component.js +15 -3
- package/esm2015/lib/components/authenticator/components/federated-sign-in/federated-sign-in.component.js +2 -2
- package/esm2015/lib/components/authenticator/components/force-new-password/force-new-password.component.js +15 -3
- package/esm2015/lib/components/authenticator/components/form-field/form-field.component.js +8 -5
- package/esm2015/lib/components/authenticator/components/reset-password/reset-password.component.js +13 -3
- package/esm2015/lib/components/authenticator/components/setup-totp/setup-totp.component.js +17 -5
- package/esm2015/lib/components/authenticator/components/sign-in/sign-in.component.js +22 -4
- package/esm2015/lib/components/authenticator/components/sign-up/sign-up-form-fields/sign-up-form-fields.component.js +21 -3
- package/esm2015/lib/components/authenticator/components/user-name-alias/user-name-alias.component.js +13 -6
- package/esm2015/lib/components/authenticator/components/verify-user/verify-user.component.js +2 -2
- package/esm2015/lib/primitives/phone-number-field/phone-number-field.component.js +7 -3
- package/esm2015/lib/services/authenticator.service.js +3 -2
- package/fesm2015/aws-amplify-ui-angular.js +160 -27
- package/fesm2015/aws-amplify-ui-angular.js.map +1 -1
- package/lib/components/authenticator/components/authenticator/authenticator.component.d.ts +1 -0
- package/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.d.ts +7 -1
- package/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.d.ts +4 -0
- package/lib/components/authenticator/components/confirm-sign-up/confirm-sign-up.component.d.ts +7 -1
- package/lib/components/authenticator/components/confirm-verify-user/amplify-confirm-verify-user.component.d.ts +7 -1
- package/lib/components/authenticator/components/force-new-password/force-new-password.component.d.ts +7 -1
- package/lib/components/authenticator/components/form-field/form-field.component.d.ts +3 -1
- package/lib/components/authenticator/components/reset-password/reset-password.component.d.ts +4 -0
- package/lib/components/authenticator/components/setup-totp/setup-totp.component.d.ts +4 -0
- package/lib/components/authenticator/components/sign-in/sign-in.component.d.ts +10 -1
- package/lib/components/authenticator/components/sign-up/sign-up-form-fields/sign-up-form-fields.component.d.ts +7 -1
- package/lib/components/authenticator/components/user-name-alias/user-name-alias.component.d.ts +7 -1
- package/lib/primitives/phone-number-field/phone-number-field.component.d.ts +5 -2
- package/lib/services/authenticator.service.d.ts +1 -1
- package/package.json +2 -2
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
}
|
|
88
88
|
AuthenticatorService.prototype.startMachine = function (_b) {
|
|
89
89
|
var _this = this;
|
|
90
|
-
var initialState = _b.initialState, loginMechanisms = _b.loginMechanisms, services = _b.services, signUpAttributes = _b.signUpAttributes, socialProviders = _b.socialProviders;
|
|
90
|
+
var initialState = _b.initialState, loginMechanisms = _b.loginMechanisms, services = _b.services, signUpAttributes = _b.signUpAttributes, socialProviders = _b.socialProviders, formFields = _b.formFields;
|
|
91
91
|
var machine = ui.createAuthenticatorMachine();
|
|
92
92
|
var authService = xstate.interpret(machine).start();
|
|
93
93
|
authService.send({
|
|
@@ -98,6 +98,7 @@
|
|
|
98
98
|
socialProviders: socialProviders,
|
|
99
99
|
signUpAttributes: signUpAttributes,
|
|
100
100
|
services: services,
|
|
101
|
+
formFields: formFields,
|
|
101
102
|
},
|
|
102
103
|
});
|
|
103
104
|
this._machineSubscription = authService.subscribe(function (state) {
|
|
@@ -317,13 +318,14 @@
|
|
|
317
318
|
this.signUpTitle = ui.translate('Create Account');
|
|
318
319
|
}
|
|
319
320
|
AuthenticatorComponent.prototype.ngOnInit = function () {
|
|
320
|
-
var _a = this, initialState = _a.initialState, loginMechanisms = _a.loginMechanisms, services = _a.services, signUpAttributes = _a.signUpAttributes, socialProviders = _a.socialProviders;
|
|
321
|
+
var _a = this, initialState = _a.initialState, loginMechanisms = _a.loginMechanisms, services = _a.services, signUpAttributes = _a.signUpAttributes, socialProviders = _a.socialProviders, formFields = _a.formFields;
|
|
321
322
|
this.authenticator.startMachine({
|
|
322
323
|
initialState: initialState,
|
|
323
324
|
loginMechanisms: loginMechanisms,
|
|
324
325
|
services: services,
|
|
325
326
|
signUpAttributes: signUpAttributes,
|
|
326
327
|
socialProviders: socialProviders,
|
|
328
|
+
formFields: formFields,
|
|
327
329
|
});
|
|
328
330
|
/**
|
|
329
331
|
* handling translations after content init, because authenticator and its
|
|
@@ -393,6 +395,7 @@
|
|
|
393
395
|
{ type: CustomComponentsService }
|
|
394
396
|
]; };
|
|
395
397
|
AuthenticatorComponent.propDecorators = {
|
|
398
|
+
formFields: [{ type: i0.Input }],
|
|
396
399
|
initialState: [{ type: i0.Input }],
|
|
397
400
|
loginMechanisms: [{ type: i0.Input }],
|
|
398
401
|
services: [{ type: i0.Input }],
|
|
@@ -413,6 +416,18 @@
|
|
|
413
416
|
this.backToSignInText = ui.translate('Back to Sign In');
|
|
414
417
|
this.resendCodeText = ui.translate('Resend Code');
|
|
415
418
|
}
|
|
419
|
+
ConfirmResetPasswordComponent.prototype.ngOnInit = function () {
|
|
420
|
+
this.setFormFields();
|
|
421
|
+
};
|
|
422
|
+
ConfirmResetPasswordComponent.prototype.setFormFields = function () {
|
|
423
|
+
var _a, _b;
|
|
424
|
+
var _state = this.authenticator.authState;
|
|
425
|
+
this.formOverrides = (_b = (_a = ui.getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.confirmResetPassword;
|
|
426
|
+
};
|
|
427
|
+
ConfirmResetPasswordComponent.prototype.grabField = function (name, field, defaultV) {
|
|
428
|
+
var _a, _b, _c;
|
|
429
|
+
return (_c = (_b = (_a = this.formOverrides) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b[field]) !== null && _c !== void 0 ? _c : defaultV;
|
|
430
|
+
};
|
|
416
431
|
Object.defineProperty(ConfirmResetPasswordComponent.prototype, "context", {
|
|
417
432
|
get: function () {
|
|
418
433
|
return this.authenticator.slotContext;
|
|
@@ -422,7 +437,7 @@
|
|
|
422
437
|
});
|
|
423
438
|
ConfirmResetPasswordComponent.prototype.onInput = function (event) {
|
|
424
439
|
event.preventDefault();
|
|
425
|
-
var
|
|
440
|
+
var _d = event.target, name = _d.name, value = _d.value;
|
|
426
441
|
this.authenticator.updateForm({ name: name, value: value });
|
|
427
442
|
};
|
|
428
443
|
ConfirmResetPasswordComponent.prototype.onSubmit = function (event) {
|
|
@@ -434,7 +449,7 @@
|
|
|
434
449
|
ConfirmResetPasswordComponent.decorators = [
|
|
435
450
|
{ type: i0.Component, args: [{
|
|
436
451
|
selector: 'amplify-confirm-reset-password',
|
|
437
|
-
template: "<
|
|
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 <amplify-form-field\n name=\"confirmation_code\"\n autocomplete=\"one-time-code\"\n [labelHidden]=\"grabField('confirmation_code', 'labelHidden', true)\"\n [placeholder]=\"grabField('confirmation_code', 'placeholder', null)\"\n [required]=\"grabField('confirmation_code', 'required', true)\"\n [label]=\"grabField('confirmation_code', 'label', null)\"\n ></amplify-form-field>\n <amplify-form-field\n name=\"password\"\n label=\"New password\"\n autocomplete=\"new-password\"\n [labelHidden]=\"grabField('password', 'labelHidden', true)\"\n [placeholder]=\"grabField('password', 'placeholder', null)\"\n [required]=\"grabField('password', 'required', true)\"\n [label]=\"grabField('password', 'label', 'New password')\"\n ></amplify-form-field>\n <amplify-form-field\n name=\"confirm_password\"\n type=\"password\"\n autocomplete=\"new-password\"\n [labelHidden]=\"grabField('confirm_password', 'labelHidden', true)\"\n [placeholder]=\"grabField('confirm_password', 'placeholder', null)\"\n [required]=\"grabField('confirm_password', 'required', true)\"\n [label]=\"grabField('confirm_password', 'label', 'Confirm Password')\"\n ></amplify-form-field>\n\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ sendCodeText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n type=\"button\"\n (click)=\"authenticator.resendCode()\"\n >\n {{ resendCodeText }}\n </button>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"confirm-reset-password-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n"
|
|
438
453
|
},] }
|
|
439
454
|
];
|
|
440
455
|
ConfirmResetPasswordComponent.ctorParameters = function () { return [
|
|
@@ -455,6 +470,16 @@
|
|
|
455
470
|
}
|
|
456
471
|
ConfirmSignInComponent.prototype.ngOnInit = function () {
|
|
457
472
|
this.setHeaderText();
|
|
473
|
+
this.setFormFields();
|
|
474
|
+
};
|
|
475
|
+
ConfirmSignInComponent.prototype.setFormFields = function () {
|
|
476
|
+
var _a, _b;
|
|
477
|
+
var _state = this.authenticator.authState;
|
|
478
|
+
this.formOverrides = (_b = (_a = ui.getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.confirmSignIn;
|
|
479
|
+
};
|
|
480
|
+
ConfirmSignInComponent.prototype.grabField = function (name, field, defaultV) {
|
|
481
|
+
var _a, _b, _c;
|
|
482
|
+
return (_c = (_b = (_a = this.formOverrides) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b[field]) !== null && _c !== void 0 ? _c : defaultV;
|
|
458
483
|
};
|
|
459
484
|
Object.defineProperty(ConfirmSignInComponent.prototype, "context", {
|
|
460
485
|
get: function () {
|
|
@@ -480,7 +505,7 @@
|
|
|
480
505
|
};
|
|
481
506
|
ConfirmSignInComponent.prototype.onInput = function (event) {
|
|
482
507
|
event.preventDefault();
|
|
483
|
-
var
|
|
508
|
+
var _d = event.target, name = _d.name, value = _d.value;
|
|
484
509
|
this.authenticator.updateForm({ name: name, value: value });
|
|
485
510
|
};
|
|
486
511
|
ConfirmSignInComponent.prototype.onSubmit = function (event) {
|
|
@@ -492,7 +517,7 @@
|
|
|
492
517
|
ConfirmSignInComponent.decorators = [
|
|
493
518
|
{ type: i0.Component, args: [{
|
|
494
519
|
selector: 'amplify-confirm-sign-in',
|
|
495
|
-
template: "<
|
|
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-field\n name=\"confirmation_code\"\n label=\"Code *\"\n autocomplete=\"one-time-code\"\n [labelHidden]=\"grabField('confirmation_code', 'labelHidden', true)\"\n [placeholder]=\"grabField('confirmation_code', 'placeholder', null)\"\n [required]=\"grabField('confirmation_code', 'required', true)\"\n [label]=\"grabField('confirmation_code', 'label', 'Code *')\"\n ></amplify-form-field>\n\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ confirmText }}\n </button>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot\n name=\"confirm-sign-in-footer\"\n [context]=\"context\"\n ></amplify-slot>\n</form>\n"
|
|
496
521
|
},] }
|
|
497
522
|
];
|
|
498
523
|
ConfirmSignInComponent.ctorParameters = function () { return [
|
|
@@ -515,6 +540,18 @@
|
|
|
515
540
|
this.defaultMessage = ui.translate('Your code is on the way. To log in, enter the code we sent you. It may take a minute to arrive.');
|
|
516
541
|
this.minutesMessage = ui.translate('It may take a minute to arrive.');
|
|
517
542
|
}
|
|
543
|
+
ConfirmSignUpComponent.prototype.ngOnInit = function () {
|
|
544
|
+
this.setFormFields();
|
|
545
|
+
};
|
|
546
|
+
ConfirmSignUpComponent.prototype.setFormFields = function () {
|
|
547
|
+
var _a, _b;
|
|
548
|
+
var _state = this.authenticator.authState;
|
|
549
|
+
this.formOverrides = (_b = (_a = ui.getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.confirmSignUp;
|
|
550
|
+
};
|
|
551
|
+
ConfirmSignUpComponent.prototype.grabField = function (name, field, defaultV) {
|
|
552
|
+
var _a, _b, _c;
|
|
553
|
+
return (_c = (_b = (_a = this.formOverrides) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b[field]) !== null && _c !== void 0 ? _c : defaultV;
|
|
554
|
+
};
|
|
518
555
|
Object.defineProperty(ConfirmSignUpComponent.prototype, "context", {
|
|
519
556
|
get: function () {
|
|
520
557
|
return this.authenticator.slotContext;
|
|
@@ -524,7 +561,7 @@
|
|
|
524
561
|
});
|
|
525
562
|
Object.defineProperty(ConfirmSignUpComponent.prototype, "confirmSignUpHeading", {
|
|
526
563
|
get: function () {
|
|
527
|
-
var
|
|
564
|
+
var _d = this.authenticator.codeDeliveryDetails, _e = _d === void 0 ? {} : _d, DeliveryMedium = _e.DeliveryMedium;
|
|
528
565
|
return DeliveryMedium === 'EMAIL'
|
|
529
566
|
? ui.translate('We Emailed You')
|
|
530
567
|
: DeliveryMedium === 'SMS'
|
|
@@ -536,7 +573,7 @@
|
|
|
536
573
|
});
|
|
537
574
|
Object.defineProperty(ConfirmSignUpComponent.prototype, "subtitleText", {
|
|
538
575
|
get: function () {
|
|
539
|
-
var
|
|
576
|
+
var _d = this.authenticator.codeDeliveryDetails, _e = _d === void 0 ? {} : _d, DeliveryMedium = _e.DeliveryMedium, Destination = _e.Destination;
|
|
540
577
|
return DeliveryMedium === 'EMAIL'
|
|
541
578
|
? this.emailMessage + " " + Destination + ". " + this.minutesMessage
|
|
542
579
|
: DeliveryMedium === 'SMS'
|
|
@@ -548,7 +585,7 @@
|
|
|
548
585
|
});
|
|
549
586
|
ConfirmSignUpComponent.prototype.onInput = function (event) {
|
|
550
587
|
event.preventDefault();
|
|
551
|
-
var
|
|
588
|
+
var _d = event.target, name = _d.name, value = _d.value;
|
|
552
589
|
this.authenticator.updateForm({ name: name, value: value });
|
|
553
590
|
};
|
|
554
591
|
ConfirmSignUpComponent.prototype.onSubmit = function (event) {
|
|
@@ -560,7 +597,7 @@
|
|
|
560
597
|
ConfirmSignUpComponent.decorators = [
|
|
561
598
|
{ type: i0.Component, args: [{
|
|
562
599
|
selector: 'amplify-confirm-sign-up',
|
|
563
|
-
template: "<
|
|
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-field\n name=\"confirmation_code\"\n autocomplete=\"one-time-code\"\n [labelHidden]=\"grabField('confirmation_code', 'labelHidden', true)\"\n [placeholder]=\"grabField('confirmation_code', 'placeholder', null)\"\n [required]=\"grabField('confirmation_code', 'required', true)\"\n [label]=\"grabField('confirmation_code', 'label', null)\"\n ></amplify-form-field>\n\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ confirmText }}\n </button>\n <button\n amplify-button\n fontWeight=\"normal\"\n (click)=\"authenticator.resendCode()\"\n >\n {{ resendCodeText }}\n </button>\n </fieldset>\n\n <amplify-error *ngIf=\"context.error\">\n {{ authenticator.error }}\n </amplify-error>\n <amplify-slot\n name=\"confirm-sign-up-footer\"\n [context]=\"context\"\n ></amplify-slot>\n </form>\n</ng-container>\n"
|
|
564
601
|
},] }
|
|
565
602
|
];
|
|
566
603
|
ConfirmSignUpComponent.ctorParameters = function () { return [
|
|
@@ -580,6 +617,18 @@
|
|
|
580
617
|
this.skipText = ui.translate('Skip');
|
|
581
618
|
this.submitText = ui.translate('Submit');
|
|
582
619
|
}
|
|
620
|
+
ConfirmVerifyUserComponent.prototype.ngOnInit = function () {
|
|
621
|
+
this.setFormFields();
|
|
622
|
+
};
|
|
623
|
+
ConfirmVerifyUserComponent.prototype.setFormFields = function () {
|
|
624
|
+
var _a, _b;
|
|
625
|
+
var _state = this.authenticator.authState;
|
|
626
|
+
this.formOverrides = (_b = (_a = ui.getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.confirmVerifyUser;
|
|
627
|
+
};
|
|
628
|
+
ConfirmVerifyUserComponent.prototype.grabField = function (name, field, defaultV) {
|
|
629
|
+
var _a, _b, _c;
|
|
630
|
+
return (_c = (_b = (_a = this.formOverrides) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b[field]) !== null && _c !== void 0 ? _c : defaultV;
|
|
631
|
+
};
|
|
583
632
|
Object.defineProperty(ConfirmVerifyUserComponent.prototype, "context", {
|
|
584
633
|
get: function () {
|
|
585
634
|
return this.authenticator.slotContext;
|
|
@@ -589,7 +638,7 @@
|
|
|
589
638
|
});
|
|
590
639
|
ConfirmVerifyUserComponent.prototype.onInput = function (event) {
|
|
591
640
|
event.preventDefault();
|
|
592
|
-
var
|
|
641
|
+
var _d = event.target, name = _d.name, value = _d.value;
|
|
593
642
|
this.authenticator.updateForm({ name: name, value: value });
|
|
594
643
|
};
|
|
595
644
|
ConfirmVerifyUserComponent.prototype.onSubmit = function (event) {
|
|
@@ -601,7 +650,7 @@
|
|
|
601
650
|
ConfirmVerifyUserComponent.decorators = [
|
|
602
651
|
{ type: i0.Component, args: [{
|
|
603
652
|
selector: 'amplify-confirm-verify-user',
|
|
604
|
-
template: "<
|
|
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-field\n name=\"confirmation_code\"\n autocomplete=\"one-time-code\"\n [labelHidden]=\"grabField('confirmation_code', 'labelHidden', true)\"\n [placeholder]=\"grabField('confirmation_code', 'placeholder', null)\"\n [required]=\"grabField('confirmation_code', 'required', true)\"\n [label]=\"grabField('confirmation_code', 'label', null)\"\n ></amplify-form-field>\n <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"
|
|
605
654
|
},] }
|
|
606
655
|
];
|
|
607
656
|
ConfirmVerifyUserComponent.ctorParameters = function () { return [
|
|
@@ -676,7 +725,7 @@
|
|
|
676
725
|
FederatedSignInComponent.decorators = [
|
|
677
726
|
{ type: i0.Component, args: [{
|
|
678
727
|
selector: 'amplify-federated-sign-in',
|
|
679
|
-
template: "<div\n class=\"amplify-flex federated-sign-in-container\"\n style=\"flex-direction: column; padding: 0 0 1rem 0\"\n *ngIf=\"shouldShowFederatedSignIn\"\n data-orientation=\"horizontal\"\n data-size=\"small\"\n>\n <amplify-federated-sign-in-button\n *ngIf=\"includeAmazon\"\n [text]=\"signInAmazonText\"\n [provider]=\"FederatedProviders.Amazon\"\n >\n <svg\n aria-label=\"Amazon icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 248 268\"\n >\n <path\n d=\"M139.056521,147.024612 C133.548808,156.744524 124.782731,162.726926 115.087401,162.726926 C101.790721,162.726926 93.9937779,152.612964 93.9937779,137.68681 C93.9937779,108.224571 120.447551,102.879017 145.533369,102.879017 L145.533369,110.365976 C145.533369,123.831358 145.876354,135.063787 139.056521,147.024612 M207.206992,162.579655 C209.400505,165.692256 209.887066,169.437725 207.063416,171.770186 C199.996315,177.653081 187.429476,188.590967 180.513926,194.716661 L180.46208,194.621133 C178.176838,196.663031 174.862638,196.810303 172.27828,195.445057 C160.780281,185.9162 158.686473,181.494078 152.405048,172.403055 C133.405233,191.751331 119.909143,197.534719 95.309886,197.534719 C66.1281801,197.534719 43.4791563,179.599451 43.4791563,143.669212 C43.4791563,115.616003 58.6782107,96.5105248 80.4019706,87.1727225 C99.2063636,78.9096034 125.464714,77.4528107 145.533369,75.1641337 L145.533369,70.694248 C145.533369,62.4749122 146.167493,52.7510201 141.297893,45.6541312 C137.110277,39.2856386 129.018206,36.6586354 121.859376,36.6586354 C108.658413,36.6586354 96.9171331,43.4171982 94.0416364,57.4199213 C93.4593582,60.532522 91.1701278,63.5933787 88.003492,63.7406501 L54.4387473,60.1424518 C51.6150972,59.5095829 48.4484614,57.2248862 49.2740201,52.8982915 C56.9712583,12.2553679 93.7983558,0 126.732964,0 C143.587124,0 165.606011,4.47386604 178.902691,17.2148315 C195.760839,32.917146 194.149604,53.8694866 194.149604,76.6726704 L194.149604,130.542157 C194.149604,146.734049 200.87372,153.830938 207.206992,162.579655 Z M233.826346,208.038962 C230.467669,203.683255 211.550709,205.9821 203.056405,206.998432 C200.470662,207.321077 200.076227,205.042397 202.406981,203.404973 C217.475208,192.664928 242.201125,195.766353 245.081698,199.363845 C247.966255,202.981502 244.336653,228.071183 230.172839,240.049379 C228.001452,241.888455 225.929671,240.904388 226.89783,238.468418 C230.077218,230.430525 237.204944,212.418868 233.826346,208.038962 Z M126.768855,264 C74.0234043,264 42.0764048,241.955028 17.7852554,217.541992 C12.9733903,212.705982 6.71799208,206.295994 3.31151296,200.690918 C1.90227474,198.372135 5.59096074,195.021875 8.0442063,196.84375 C38.2390146,219.267578 82.1011654,239.538304 125.529506,239.538304 C154.819967,239.538304 191.046475,227.469543 220.66851,214.867659 C225.146771,212.966167 225.146771,219.180222 224.511585,221.060516 C224.183264,222.03242 209.514625,236.221149 189.247207,247.047411 C170.304273,257.166172 146.397132,264 126.768855,264 Z\"\n fill=\"#FF9900\"\n ></path>\n </svg>\n\n <p class=\"amplify-text\" style=\"align-self: center\">\n {{ signInAmazonText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeApple\"\n [provider]=\"FederatedProviders.Apple\"\n >\n <svg\n aria-label=\"Apple icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n fill=\"#000\"\n preserveAspectRatio=\"xMidYMid\"\n stroke=\"#000\"\n strokeWidth=\"0\"\n viewBox=\"0 0 1024 1024\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M747.4 535.7c-.4-68.2 30.5-119.6 92.9-157.5-34.9-50-87.7-77.5-157.3-82.8-65.9-5.2-138 38.4-164.4 38.4-27.9 0-91.7-36.6-141.9-36.6C273.1 298.8 163 379.8 163 544.6c0 48.7 8.9 99 26.7 150.8 23.8 68.2 109.6 235.3 199.1 232.6 46.8-1.1 79.9-33.2 140.8-33.2 59.1 0 89.7 33.2 141.9 33.2 90.3-1.3 167.9-153.2 190.5-221.6-121.1-57.1-114.6-167.2-114.6-170.7zm-105.1-305c50.7-60.2 46.1-115 44.6-134.7-44.8 2.6-96.6 30.5-126.1 64.8-32.5 36.8-51.6 82.3-47.5 133.6 48.4 3.7 92.6-21.2 129-63.7z\"\n ></path>\n </svg>\n <p class=\"amplify-text\" style=\"align-self: center\">\n {{ signInAppleText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeFacebook\"\n [text]=\"signInFacebookText\"\n [provider]=\"FederatedProviders.Facebook\"\n >\n <svg\n aria-label=\"Facebook icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 279 538\"\n >\n <path\n d=\"M82.3409742,538 L82.3409742,292.936652 L0,292.936652 L0,196.990154 L82.2410458,196.990154 L82.2410458,126.4295 C82.2410458,44.575144 132.205229,0 205.252865,0 C240.227794,0 270.306232,2.59855099 279,3.79788222 L279,89.2502322 L228.536175,89.2502322 C188.964542,89.2502322 181.270057,108.139699 181.270057,135.824262 L181.270057,196.89021 L276.202006,196.89021 L263.810888,292.836708 L181.16913,292.836708 L181.16913,538 L82.3409742,538 Z\"\n fill=\"#1877F2\"\n ></path>\n </svg>\n <p class=\"amplify-text\" style=\"align-self: center\">\n {{ signInFacebookText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeGoogle\"\n [provider]=\"FederatedProviders.Google\"\n >\n <svg\n aria-label=\"Google icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 256 262\"\n xmlns=\"http://www.w3.org/2000/svg\"\n preserveAspectRatio=\"xMidYMid\"\n >\n <path\n d=\"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027\"\n fill=\"#4285F4\"\n ></path>\n <path\n d=\"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1\"\n fill=\"#34A853\"\n ></path>\n <path\n d=\"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782\"\n fill=\"#FBBC05\"\n ></path>\n <path\n d=\"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251\"\n fill=\"#EB4335\"\n ></path>\n </svg>\n <p class=\"amplify-text\" style=\"align-self: center\">\n {{ signInGoogleText }}\n </p>\n </amplify-federated-sign-in-button>\n\n
|
|
728
|
+
template: "<div\n class=\"amplify-flex federated-sign-in-container\"\n style=\"flex-direction: column; padding: 0 0 1rem 0\"\n *ngIf=\"shouldShowFederatedSignIn\"\n data-orientation=\"horizontal\"\n data-size=\"small\"\n>\n <amplify-federated-sign-in-button\n *ngIf=\"includeAmazon\"\n [text]=\"signInAmazonText\"\n [provider]=\"FederatedProviders.Amazon\"\n >\n <svg\n aria-label=\"Amazon icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 248 268\"\n >\n <path\n d=\"M139.056521,147.024612 C133.548808,156.744524 124.782731,162.726926 115.087401,162.726926 C101.790721,162.726926 93.9937779,152.612964 93.9937779,137.68681 C93.9937779,108.224571 120.447551,102.879017 145.533369,102.879017 L145.533369,110.365976 C145.533369,123.831358 145.876354,135.063787 139.056521,147.024612 M207.206992,162.579655 C209.400505,165.692256 209.887066,169.437725 207.063416,171.770186 C199.996315,177.653081 187.429476,188.590967 180.513926,194.716661 L180.46208,194.621133 C178.176838,196.663031 174.862638,196.810303 172.27828,195.445057 C160.780281,185.9162 158.686473,181.494078 152.405048,172.403055 C133.405233,191.751331 119.909143,197.534719 95.309886,197.534719 C66.1281801,197.534719 43.4791563,179.599451 43.4791563,143.669212 C43.4791563,115.616003 58.6782107,96.5105248 80.4019706,87.1727225 C99.2063636,78.9096034 125.464714,77.4528107 145.533369,75.1641337 L145.533369,70.694248 C145.533369,62.4749122 146.167493,52.7510201 141.297893,45.6541312 C137.110277,39.2856386 129.018206,36.6586354 121.859376,36.6586354 C108.658413,36.6586354 96.9171331,43.4171982 94.0416364,57.4199213 C93.4593582,60.532522 91.1701278,63.5933787 88.003492,63.7406501 L54.4387473,60.1424518 C51.6150972,59.5095829 48.4484614,57.2248862 49.2740201,52.8982915 C56.9712583,12.2553679 93.7983558,0 126.732964,0 C143.587124,0 165.606011,4.47386604 178.902691,17.2148315 C195.760839,32.917146 194.149604,53.8694866 194.149604,76.6726704 L194.149604,130.542157 C194.149604,146.734049 200.87372,153.830938 207.206992,162.579655 Z M233.826346,208.038962 C230.467669,203.683255 211.550709,205.9821 203.056405,206.998432 C200.470662,207.321077 200.076227,205.042397 202.406981,203.404973 C217.475208,192.664928 242.201125,195.766353 245.081698,199.363845 C247.966255,202.981502 244.336653,228.071183 230.172839,240.049379 C228.001452,241.888455 225.929671,240.904388 226.89783,238.468418 C230.077218,230.430525 237.204944,212.418868 233.826346,208.038962 Z M126.768855,264 C74.0234043,264 42.0764048,241.955028 17.7852554,217.541992 C12.9733903,212.705982 6.71799208,206.295994 3.31151296,200.690918 C1.90227474,198.372135 5.59096074,195.021875 8.0442063,196.84375 C38.2390146,219.267578 82.1011654,239.538304 125.529506,239.538304 C154.819967,239.538304 191.046475,227.469543 220.66851,214.867659 C225.146771,212.966167 225.146771,219.180222 224.511585,221.060516 C224.183264,222.03242 209.514625,236.221149 189.247207,247.047411 C170.304273,257.166172 146.397132,264 126.768855,264 Z\"\n fill=\"#FF9900\"\n ></path>\n </svg>\n\n <p class=\"amplify-text\" style=\"align-self: center\">\n {{ signInAmazonText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeApple\"\n [provider]=\"FederatedProviders.Apple\"\n >\n <svg\n aria-label=\"Apple icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n fill=\"#000\"\n preserveAspectRatio=\"xMidYMid\"\n stroke=\"#000\"\n strokeWidth=\"0\"\n viewBox=\"0 0 1024 1024\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M747.4 535.7c-.4-68.2 30.5-119.6 92.9-157.5-34.9-50-87.7-77.5-157.3-82.8-65.9-5.2-138 38.4-164.4 38.4-27.9 0-91.7-36.6-141.9-36.6C273.1 298.8 163 379.8 163 544.6c0 48.7 8.9 99 26.7 150.8 23.8 68.2 109.6 235.3 199.1 232.6 46.8-1.1 79.9-33.2 140.8-33.2 59.1 0 89.7 33.2 141.9 33.2 90.3-1.3 167.9-153.2 190.5-221.6-121.1-57.1-114.6-167.2-114.6-170.7zm-105.1-305c50.7-60.2 46.1-115 44.6-134.7-44.8 2.6-96.6 30.5-126.1 64.8-32.5 36.8-51.6 82.3-47.5 133.6 48.4 3.7 92.6-21.2 129-63.7z\"\n ></path>\n </svg>\n <p class=\"amplify-text\" style=\"align-self: center\">\n {{ signInAppleText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeFacebook\"\n [text]=\"signInFacebookText\"\n [provider]=\"FederatedProviders.Facebook\"\n >\n <svg\n aria-label=\"Facebook icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 279 538\"\n >\n <path\n d=\"M82.3409742,538 L82.3409742,292.936652 L0,292.936652 L0,196.990154 L82.2410458,196.990154 L82.2410458,126.4295 C82.2410458,44.575144 132.205229,0 205.252865,0 C240.227794,0 270.306232,2.59855099 279,3.79788222 L279,89.2502322 L228.536175,89.2502322 C188.964542,89.2502322 181.270057,108.139699 181.270057,135.824262 L181.270057,196.89021 L276.202006,196.89021 L263.810888,292.836708 L181.16913,292.836708 L181.16913,538 L82.3409742,538 Z\"\n fill=\"#1877F2\"\n ></path>\n </svg>\n <p class=\"amplify-text\" style=\"align-self: center\">\n {{ signInFacebookText }}\n </p>\n </amplify-federated-sign-in-button>\n\n <amplify-federated-sign-in-button\n *ngIf=\"includeGoogle\"\n [provider]=\"FederatedProviders.Google\"\n >\n <svg\n aria-label=\"Google icon\"\n class=\"amplify-icon federated-sign-in-icon\"\n viewBox=\"0 0 256 262\"\n xmlns=\"http://www.w3.org/2000/svg\"\n preserveAspectRatio=\"xMidYMid\"\n >\n <path\n d=\"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027\"\n fill=\"#4285F4\"\n ></path>\n <path\n d=\"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1\"\n fill=\"#34A853\"\n ></path>\n <path\n d=\"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782\"\n fill=\"#FBBC05\"\n ></path>\n <path\n d=\"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251\"\n fill=\"#EB4335\"\n ></path>\n </svg>\n <p class=\"amplify-text\" style=\"align-self: center\">\n {{ signInGoogleText }}\n </p>\n </amplify-federated-sign-in-button>\n\n\n <hr\n class=\"amplify-divider amplify-divider--label\"\n aria-orientation=\"horizontal\"\n data-size=\"small\"\n data-label=\"or\"\n />\n</div>\n"
|
|
680
729
|
},] }
|
|
681
730
|
];
|
|
682
731
|
FederatedSignInComponent.ctorParameters = function () { return [
|
|
@@ -692,6 +741,9 @@
|
|
|
692
741
|
this.changePasswordText = ui.translate('Change Password');
|
|
693
742
|
this.backToSignInText = ui.translate('Back to Sign In');
|
|
694
743
|
}
|
|
744
|
+
ForceNewPasswordComponent.prototype.ngOnInit = function () {
|
|
745
|
+
this.setFormFields();
|
|
746
|
+
};
|
|
695
747
|
Object.defineProperty(ForceNewPasswordComponent.prototype, "context", {
|
|
696
748
|
get: function () {
|
|
697
749
|
return this.authenticator.slotContext;
|
|
@@ -699,9 +751,18 @@
|
|
|
699
751
|
enumerable: false,
|
|
700
752
|
configurable: true
|
|
701
753
|
});
|
|
754
|
+
ForceNewPasswordComponent.prototype.setFormFields = function () {
|
|
755
|
+
var _a, _b;
|
|
756
|
+
var _state = this.authenticator.authState;
|
|
757
|
+
this.formOverrides = (_b = (_a = ui.getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.forceNewPassword;
|
|
758
|
+
};
|
|
759
|
+
ForceNewPasswordComponent.prototype.grabField = function (name, field, defaultV) {
|
|
760
|
+
var _a, _b, _c;
|
|
761
|
+
return (_c = (_b = (_a = this.formOverrides) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b[field]) !== null && _c !== void 0 ? _c : defaultV;
|
|
762
|
+
};
|
|
702
763
|
ForceNewPasswordComponent.prototype.onInput = function (event) {
|
|
703
764
|
event.preventDefault();
|
|
704
|
-
var
|
|
765
|
+
var _d = event.target, name = _d.name, value = _d.value;
|
|
705
766
|
this.authenticator.updateForm({ name: name, value: value });
|
|
706
767
|
};
|
|
707
768
|
ForceNewPasswordComponent.prototype.onSubmit = function (event) {
|
|
@@ -713,7 +774,7 @@
|
|
|
713
774
|
ForceNewPasswordComponent.decorators = [
|
|
714
775
|
{ type: i0.Component, args: [{
|
|
715
776
|
selector: 'amplify-force-new-password',
|
|
716
|
-
template: "<
|
|
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 <amplify-form-field\n [labelHidden]=\"grabField('password', 'labelHidden', true)\"\n [placeholder]=\"grabField('password', 'placeholder', null)\"\n [required]=\"grabField('password', 'required', true)\"\n [label]=\"grabField('password', 'label', null)\"\n name=\"password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n\n <amplify-form-field\n name=\"confirm_password\"\n type=\"password\"\n autocomplete=\"new-password\"\n [labelHidden]=\"grabField('confirm_password', 'labelHidden', true)\"\n [placeholder]=\"grabField('confirm_password', 'placeholder', null)\"\n [required]=\"grabField('confirm_password', 'required', true)\"\n [label]=\"grabField('confirm_password', 'label', 'Confirm Password')\"\n ></amplify-form-field>\n <amplify-slot name=\"force-new-form-fields\" [context]=\"context\">\n <amplify-force-new-password-form-fields></amplify-force-new-password-form-fields>\n </amplify-slot>\n\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ changePasswordText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"force-new-password-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n"
|
|
717
778
|
},] }
|
|
718
779
|
];
|
|
719
780
|
ForceNewPasswordComponent.ctorParameters = function () { return [
|
|
@@ -771,14 +832,15 @@
|
|
|
771
832
|
this.disabled = false;
|
|
772
833
|
this.autocomplete = '';
|
|
773
834
|
this.labelHidden = true;
|
|
774
|
-
this.
|
|
835
|
+
this.countryDialCodesValue = ui.countryDialCodes;
|
|
775
836
|
}
|
|
776
837
|
FormFieldComponent.prototype.ngOnInit = function () {
|
|
838
|
+
var _a;
|
|
777
839
|
// TODO: consider better default handling mechanisms across frameworks
|
|
778
840
|
if (this.isPhoneField()) {
|
|
779
841
|
var state = this.authenticator.authState;
|
|
780
842
|
var country_code = ui.getActorContext(state).country_code;
|
|
781
|
-
this.
|
|
843
|
+
this.defaultCountryCodeValue = (_a = this.defaultCountryCode) !== null && _a !== void 0 ? _a : country_code;
|
|
782
844
|
}
|
|
783
845
|
};
|
|
784
846
|
Object.defineProperty(FormFieldComponent.prototype, "attributeMap", {
|
|
@@ -833,7 +895,7 @@
|
|
|
833
895
|
FormFieldComponent.decorators = [
|
|
834
896
|
{ type: i0.Component, args: [{
|
|
835
897
|
selector: 'amplify-form-field',
|
|
836
|
-
template: "<div class=\"amplify-flex amplify-field\" style=\"flex-direction: column\">\n <!-- Country code field -->\n <amplify-phone-number-field\n *ngIf=\"isPhoneField()\"\n [defaultCountryCode]=\"
|
|
898
|
+
template: "<div class=\"amplify-flex amplify-field\" style=\"flex-direction: column\">\n <!-- Country code field -->\n <amplify-phone-number-field\n *ngIf=\"isPhoneField()\"\n [defaultCountryCode]=\"defaultCountryCodeValue\"\n [dialCodeList]=\"dialCodeList\"\n [type]=\"inferType()\"\n [name]=\"name\"\n [label]=\"inferLabel()\"\n [placeholder]=\"inferPlaceholder()\"\n [required]=\"required\"\n [initialValue]=\"initialValue\"\n [disabled]=\"disabled\"\n [labelHidden]=\"labelHidden\"\n [autocomplete]=\"inferAutocomplete()\"\n ></amplify-phone-number-field>\n\n <amplify-password-field\n *ngIf=\"isPasswordField()\"\n [name]=\"name\"\n [label]=\"inferLabel()\"\n [placeholder]=\"inferPlaceholder()\"\n [required]=\"required\"\n [initialValue]=\"initialValue\"\n [disabled]=\"disabled\"\n [labelHidden]=\"labelHidden\"\n [autocomplete]=\"inferAutocomplete()\"\n (setBlur)=\"onBlur($event)\"\n ></amplify-password-field>\n\n <amplify-text-field\n *ngIf=\"!isPasswordField() && !isPhoneField()\"\n [type]=\"inferType()\"\n [name]=\"name\"\n [label]=\"inferLabel()\"\n [placeholder]=\"inferPlaceholder()\"\n [required]=\"required\"\n [initialValue]=\"initialValue\"\n [disabled]=\"disabled\"\n [labelHidden]=\"labelHidden\"\n [autocomplete]=\"inferAutocomplete()\"\n ></amplify-text-field>\n\n <amplify-error *ngIf=\"error\">\n {{ error }}\n </amplify-error>\n</div>\n"
|
|
837
899
|
},] }
|
|
838
900
|
];
|
|
839
901
|
FormFieldComponent.ctorParameters = function () { return [
|
|
@@ -848,7 +910,9 @@
|
|
|
848
910
|
initialValue: [{ type: i0.Input }],
|
|
849
911
|
disabled: [{ type: i0.Input }],
|
|
850
912
|
autocomplete: [{ type: i0.Input }],
|
|
851
|
-
labelHidden: [{ type: i0.Input }]
|
|
913
|
+
labelHidden: [{ type: i0.Input }],
|
|
914
|
+
defaultCountryCode: [{ type: i0.Input }],
|
|
915
|
+
dialCodeList: [{ type: i0.Input }]
|
|
852
916
|
};
|
|
853
917
|
|
|
854
918
|
var ResetPasswordComponent = /** @class */ (function () {
|
|
@@ -865,6 +929,16 @@
|
|
|
865
929
|
var authState = this.authenticator.authState;
|
|
866
930
|
var label = ui.getAliasInfoFromContext(authState.context).label;
|
|
867
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;
|
|
868
942
|
};
|
|
869
943
|
Object.defineProperty(ResetPasswordComponent.prototype, "context", {
|
|
870
944
|
get: function () {
|
|
@@ -875,7 +949,7 @@
|
|
|
875
949
|
});
|
|
876
950
|
ResetPasswordComponent.prototype.onInput = function (event) {
|
|
877
951
|
event.preventDefault();
|
|
878
|
-
var
|
|
952
|
+
var _d = event.target, name = _d.name, value = _d.value;
|
|
879
953
|
this.authenticator.updateForm({ name: name, value: value });
|
|
880
954
|
};
|
|
881
955
|
ResetPasswordComponent.prototype.onSubmit = function (event) {
|
|
@@ -887,7 +961,7 @@
|
|
|
887
961
|
ResetPasswordComponent.decorators = [
|
|
888
962
|
{ type: i0.Component, args: [{
|
|
889
963
|
selector: 'amplify-reset-password',
|
|
890
|
-
template: "<
|
|
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-field\n name=\"username\"\n type=\"username\"\n autocomplete=\"username\"\n [labelHidden]=\"grabField('username', 'labelHidden', true)\"\n [required]=\"grabField('username', 'required', true)\"\n [label]=\"grabField('username', 'label', labelText)\"\n [placeholder]=\"grabField('username', 'placeholder', labelText)\"\n ></amplify-form-field>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ sendCodeText }}\n </button>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n\n <amplify-slot name=\"reset-password-footer\" [context]=\"context\">\n </amplify-slot>\n</form>\n"
|
|
891
965
|
},] }
|
|
892
966
|
];
|
|
893
967
|
ResetPasswordComponent.ctorParameters = function () { return [
|
|
@@ -1231,6 +1305,16 @@
|
|
|
1231
1305
|
}
|
|
1232
1306
|
SetupTotpComponent.prototype.ngOnInit = function () {
|
|
1233
1307
|
this.generateQRCode();
|
|
1308
|
+
this.setFormFields();
|
|
1309
|
+
};
|
|
1310
|
+
SetupTotpComponent.prototype.setFormFields = function () {
|
|
1311
|
+
var _a, _b;
|
|
1312
|
+
var _state = this.authenticator.authState;
|
|
1313
|
+
this.formOverrides = (_b = (_a = ui.getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.setupTOTP;
|
|
1314
|
+
};
|
|
1315
|
+
SetupTotpComponent.prototype.grabField = function (name, field, defaultV) {
|
|
1316
|
+
var _a, _b, _c;
|
|
1317
|
+
return (_c = (_b = (_a = this.formOverrides) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b[field]) !== null && _c !== void 0 ? _c : defaultV;
|
|
1234
1318
|
};
|
|
1235
1319
|
Object.defineProperty(SetupTotpComponent.prototype, "context", {
|
|
1236
1320
|
get: function () {
|
|
@@ -1240,31 +1324,33 @@
|
|
|
1240
1324
|
configurable: true
|
|
1241
1325
|
});
|
|
1242
1326
|
SetupTotpComponent.prototype.generateQRCode = function () {
|
|
1327
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1243
1328
|
return __awaiter(this, void 0, void 0, function () {
|
|
1244
|
-
var state, actorContext, user,
|
|
1245
|
-
return __generator(this, function (
|
|
1246
|
-
switch (
|
|
1329
|
+
var state, actorContext, user, _g, issuer, username, totpCode, _h, err_1;
|
|
1330
|
+
return __generator(this, function (_j) {
|
|
1331
|
+
switch (_j.label) {
|
|
1247
1332
|
case 0:
|
|
1248
1333
|
state = this.authenticator.authState;
|
|
1249
1334
|
actorContext = ui.getActorContext(state);
|
|
1250
1335
|
user = actorContext.user;
|
|
1251
|
-
|
|
1336
|
+
_j.label = 1;
|
|
1252
1337
|
case 1:
|
|
1253
|
-
|
|
1254
|
-
|
|
1338
|
+
_j.trys.push([1, 4, , 5]);
|
|
1339
|
+
_g = this;
|
|
1255
1340
|
return [4 /*yield*/, awsAmplify.Auth.setupTOTP(user)];
|
|
1256
1341
|
case 2:
|
|
1257
|
-
|
|
1258
|
-
issuer = 'AWSCognito';
|
|
1259
|
-
|
|
1342
|
+
_g.secretKey = _j.sent();
|
|
1343
|
+
issuer = (_c = (_b = (_a = this.formOverrides) === null || _a === void 0 ? void 0 : _a['QR']) === null || _b === void 0 ? void 0 : _b.totpIssuer) !== null && _c !== void 0 ? _c : 'AWSCognito';
|
|
1344
|
+
username = (_f = (_e = (_d = this.formOverrides) === null || _d === void 0 ? void 0 : _d['QR']) === null || _e === void 0 ? void 0 : _e.totpUsername) !== null && _f !== void 0 ? _f : user.username;
|
|
1345
|
+
totpCode = "otpauth://totp/" + issuer + ":" + username + "?secret=" + this.secretKey + "&issuer=" + issuer;
|
|
1260
1346
|
logger.info('totp code was generated:', totpCode);
|
|
1261
|
-
|
|
1347
|
+
_h = this;
|
|
1262
1348
|
return [4 /*yield*/, QRCode__default["default"].toDataURL(totpCode)];
|
|
1263
1349
|
case 3:
|
|
1264
|
-
|
|
1350
|
+
_h.qrCodeSource = _j.sent();
|
|
1265
1351
|
return [3 /*break*/, 5];
|
|
1266
1352
|
case 4:
|
|
1267
|
-
err_1 =
|
|
1353
|
+
err_1 = _j.sent();
|
|
1268
1354
|
logger.error(err_1);
|
|
1269
1355
|
return [3 /*break*/, 5];
|
|
1270
1356
|
case 5: return [2 /*return*/];
|
|
@@ -1274,7 +1360,7 @@
|
|
|
1274
1360
|
};
|
|
1275
1361
|
SetupTotpComponent.prototype.onInput = function (event) {
|
|
1276
1362
|
event.preventDefault();
|
|
1277
|
-
var
|
|
1363
|
+
var _g = event.target, name = _g.name, value = _g.value;
|
|
1278
1364
|
this.authenticator.updateForm({ name: name, value: value });
|
|
1279
1365
|
};
|
|
1280
1366
|
SetupTotpComponent.prototype.onSubmit = function (event) {
|
|
@@ -1290,7 +1376,7 @@
|
|
|
1290
1376
|
SetupTotpComponent.decorators = [
|
|
1291
1377
|
{ type: i0.Component, args: [{
|
|
1292
1378
|
selector: 'amplify-setup-totp',
|
|
1293
|
-
template: "<
|
|
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-field\n name=\"confirmation_code\"\n autocomplete=\"one-time-code\"\n [labelHidden]=\"grabField('confirmation_code', 'labelHidden', true)\"\n [placeholder]=\"grabField('confirmation_code', 'placeholder', null)\"\n [required]=\"grabField('confirmation_code', 'required', true)\"\n [label]=\"grabField('confirmation_code', 'label', 'Code *')\"\n ></amplify-form-field>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ confirmText }}\n </button>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"setup-totp-footer\" [context]=\"context\"> </amplify-slot>\n</form>\n"
|
|
1294
1380
|
},] }
|
|
1295
1381
|
];
|
|
1296
1382
|
SetupTotpComponent.ctorParameters = function () { return [
|
|
@@ -1311,6 +1397,26 @@
|
|
|
1311
1397
|
: ui.translate('Forgot your password? ');
|
|
1312
1398
|
this.signInButtonText = ui.translate('Sign in');
|
|
1313
1399
|
}
|
|
1400
|
+
SignInComponent.prototype.ngOnInit = function () {
|
|
1401
|
+
this.setFormFields();
|
|
1402
|
+
};
|
|
1403
|
+
SignInComponent.prototype.setFormFields = function () {
|
|
1404
|
+
var _a, _b, _c, _d;
|
|
1405
|
+
var _state = this.authenticator.authState;
|
|
1406
|
+
this.formOverrides = (_b = (_a = ui.getActorState(_state).context) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.signIn;
|
|
1407
|
+
this.userOverrides = (_c = this.formOverrides) === null || _c === void 0 ? void 0 : _c['username'];
|
|
1408
|
+
this.passwordOR = (_d = this.formOverrides) === null || _d === void 0 ? void 0 : _d['password'];
|
|
1409
|
+
};
|
|
1410
|
+
SignInComponent.prototype.labelHidden = function (name, defaultV) {
|
|
1411
|
+
if (defaultV === void 0) { defaultV = true; }
|
|
1412
|
+
var _a, _b, _c;
|
|
1413
|
+
return (_c = (_b = (_a = this.formOverrides) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b.labelHidden) !== null && _c !== void 0 ? _c : defaultV;
|
|
1414
|
+
};
|
|
1415
|
+
SignInComponent.prototype.required = function (name, defaultV) {
|
|
1416
|
+
if (defaultV === void 0) { defaultV = true; }
|
|
1417
|
+
var _a, _b, _c;
|
|
1418
|
+
return (_c = (_b = (_a = this.formOverrides) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b.required) !== null && _c !== void 0 ? _c : defaultV;
|
|
1419
|
+
};
|
|
1314
1420
|
Object.defineProperty(SignInComponent.prototype, "context", {
|
|
1315
1421
|
get: function () {
|
|
1316
1422
|
return this.authenticator.slotContext;
|
|
@@ -1320,7 +1426,7 @@
|
|
|
1320
1426
|
});
|
|
1321
1427
|
SignInComponent.prototype.onInput = function (event) {
|
|
1322
1428
|
event.preventDefault();
|
|
1323
|
-
var
|
|
1429
|
+
var _e = event.target, name = _e.name, value = _e.value;
|
|
1324
1430
|
this.authenticator.updateForm({ name: name, value: value });
|
|
1325
1431
|
};
|
|
1326
1432
|
SignInComponent.prototype.onSubmit = function (event) {
|
|
@@ -1332,7 +1438,7 @@
|
|
|
1332
1438
|
SignInComponent.decorators = [
|
|
1333
1439
|
{ type: i0.Component, args: [{
|
|
1334
1440
|
selector: 'amplify-sign-in',
|
|
1335
|
-
template: "<
|
|
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\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-user-name-alias\n [labelHidden]=\"labelHidden('username')\"\n [placeholder]=\"userOverrides?.placeholder\"\n [required]=\"required('username')\"\n [label]=\"userOverrides?.label\"\n [dialCode]=\"userOverrides?.dialCode\"\n [dialCodeList]=\"userOverrides?.dialCodeList\"\n ></amplify-user-name-alias>\n <amplify-form-field\n [labelHidden]=\"labelHidden('password')\"\n [placeholder]=\"passwordOR?.placeholder\"\n [required]=\"required('password')\"\n [label]=\"passwordOR?.label\"\n data-amplify-password\n name=\"password\"\n type=\"password\"\n autocomplete=\"current-password\"\n ></amplify-form-field>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ signInButtonText }}\n </button>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n</form>\n\n<amplify-slot name=\"sign-in-footer\" [context]=\"context\">\n <div data-amplify-footer>\n <button\n amplify-button\n fontWeight=\"normal\"\n size=\"small\"\n variation=\"link\"\n fullWidth=\"true\"\n (click)=\"authenticator.toResetPassword()\"\n >\n {{ forgotPasswordText }}\n </button>\n </div>\n</amplify-slot>\n",
|
|
1336
1442
|
encapsulation: i0.ViewEncapsulation.None
|
|
1337
1443
|
},] }
|
|
1338
1444
|
];
|
|
@@ -1390,7 +1496,7 @@
|
|
|
1390
1496
|
}
|
|
1391
1497
|
SignUpFormFieldsComponent.prototype.ngOnInit = function () {
|
|
1392
1498
|
var context = this.authenticator.context;
|
|
1393
|
-
var
|
|
1499
|
+
var _d = context.config, loginMechanisms = _d.loginMechanisms, signUpAttributes = _d.signUpAttributes;
|
|
1394
1500
|
this.fieldNames = Array.from(new Set(__spread(loginMechanisms, signUpAttributes)));
|
|
1395
1501
|
this.fieldNames = this.fieldNames.filter(function (fieldName) {
|
|
1396
1502
|
var hasDefaultField = !!ui.authInputAttributes[fieldName];
|
|
@@ -1401,13 +1507,31 @@
|
|
|
1401
1507
|
});
|
|
1402
1508
|
// Only 1 is supported, so `['email', 'phone_number']` will only show `email`
|
|
1403
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;
|
|
1404
1528
|
};
|
|
1405
1529
|
return SignUpFormFieldsComponent;
|
|
1406
1530
|
}());
|
|
1407
1531
|
SignUpFormFieldsComponent.decorators = [
|
|
1408
1532
|
{ type: i0.Component, args: [{
|
|
1409
1533
|
selector: 'amplify-sign-up-form-fields',
|
|
1410
|
-
template: "<div class=\"amplify-flex\" style=\"flex-direction: column\" data-amplify-fieldset>\n <amplify-user-name-alias
|
|
1534
|
+
template: "<div class=\"amplify-flex\" style=\"flex-direction: column\" data-amplify-fieldset>\n <ng-container *ngFor=\"let field of order\">\n <ng-container [ngSwitch]=\"field\">\n <amplify-user-name-alias\n *ngSwitchCase=\"loginMechanism\"\n [name]=\"loginMechanism\"\n [labelHidden]=\"grabField(loginMechanism, 'labelHidden', true)\"\n [placeholder]=\"userOverrides?.placeholder\"\n [required]=\"grabField(loginMechanism, 'required', true)\"\n [label]=\"userOverrides?.label\"\n [dialCode]=\"userOverrides?.dialCode\"\n [dialCodeList]=\"userOverrides?.dialCodeList\"\n ></amplify-user-name-alias>\n <amplify-form-field\n *ngSwitchCase=\"'password'\"\n [labelHidden]=\"grabField('password', 'labelHidden', true)\"\n [placeholder]=\"grabField('password', 'placeholder', null)\"\n [required]=\"grabField('password', 'required', true)\"\n [label]=\"grabField('password', 'label', null)\"\n name=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n <amplify-form-field\n *ngSwitchCase=\"'confirm_password'\"\n [labelHidden]=\"grabField('confirm_password', 'labelHidden', true)\"\n [placeholder]=\"\n grabField('confirm_password', 'placeholder', 'Confirm Password')\n \"\n [required]=\"grabField('confirm_password', 'required', true)\"\n [label]=\"grabField('confirm_password', 'label', 'Confirm Password')\"\n name=\"confirm_password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n\n <amplify-form-field\n *ngSwitchDefault\n [name]=\"field\"\n [labelHidden]=\"grabField(field, 'labelHidden', false)\"\n [placeholder]=\"grabField(field, 'placeholder', null)\"\n [required]=\"grabField(field, 'required', true)\"\n [label]=\"grabField(field, 'label', null)\"\n [defaultCountryCode]=\"grabField(field, 'dialCode', null)\"\n [dialCodeList]=\"grabField(field, 'dialCodeList', null)\"\n ></amplify-form-field>\n </ng-container>\n </ng-container>\n</div>\n"
|
|
1411
1535
|
},] }
|
|
1412
1536
|
];
|
|
1413
1537
|
SignUpFormFieldsComponent.ctorParameters = function () { return [
|
|
@@ -1423,18 +1547,20 @@
|
|
|
1423
1547
|
this.required = true;
|
|
1424
1548
|
}
|
|
1425
1549
|
UserNameAliasComponent.prototype.ngOnInit = function () {
|
|
1550
|
+
var _a, _b, _c;
|
|
1426
1551
|
var context = this.authenticator.context;
|
|
1427
|
-
var
|
|
1428
|
-
this.
|
|
1552
|
+
var _d = ui.getAliasInfoFromContext(context), lbl = _d.label, type = _d.type;
|
|
1553
|
+
this.labelValue = (_a = this.label) !== null && _a !== void 0 ? _a : lbl;
|
|
1429
1554
|
this.type = type;
|
|
1430
|
-
this.
|
|
1555
|
+
this.placeholderValue = (_b = this.placeholder) !== null && _b !== void 0 ? _b : lbl;
|
|
1556
|
+
this.requiredValue = (_c = this.required) !== null && _c !== void 0 ? _c : true;
|
|
1431
1557
|
};
|
|
1432
1558
|
return UserNameAliasComponent;
|
|
1433
1559
|
}());
|
|
1434
1560
|
UserNameAliasComponent.decorators = [
|
|
1435
1561
|
{ type: i0.Component, args: [{
|
|
1436
1562
|
selector: 'amplify-user-name-alias',
|
|
1437
|
-
template: "<amplify-form-field\n data-amplify-usernamealias\n [name]=\"name\"\n [
|
|
1563
|
+
template: "<amplify-form-field\n data-amplify-usernamealias\n [name]=\"name\"\n [labelHidden]=\"labelHidden\"\n [label]=\"labelValue\"\n [placeholder]=\"placeholderValue\"\n [required]=\"requiredValue\"\n [defaultCountryCode]=\"dialCode\"\n [dialCodeList]=\"dialCodeList\"\n [type]=\"type\"\n [initialValue]=\"initialValue\"\n [disabled]=\"disabled\"\n autocomplete=\"username\"\n>\n</amplify-form-field>\n"
|
|
1438
1564
|
},] }
|
|
1439
1565
|
];
|
|
1440
1566
|
UserNameAliasComponent.ctorParameters = function () { return [
|
|
@@ -1444,7 +1570,12 @@
|
|
|
1444
1570
|
name: [{ type: i0.Input }],
|
|
1445
1571
|
disabled: [{ type: i0.Input }],
|
|
1446
1572
|
initialValue: [{ type: i0.Input }],
|
|
1447
|
-
required: [{ type: i0.Input }]
|
|
1573
|
+
required: [{ type: i0.Input }],
|
|
1574
|
+
labelHidden: [{ type: i0.Input }],
|
|
1575
|
+
label: [{ type: i0.Input }],
|
|
1576
|
+
placeholder: [{ type: i0.Input }],
|
|
1577
|
+
dialCode: [{ type: i0.Input }],
|
|
1578
|
+
dialCodeList: [{ type: i0.Input }]
|
|
1448
1579
|
};
|
|
1449
1580
|
|
|
1450
1581
|
var VerifyUserComponent = /** @class */ (function () {
|
|
@@ -1489,7 +1620,7 @@
|
|
|
1489
1620
|
VerifyUserComponent.decorators = [
|
|
1490
1621
|
{ type: i0.Component, args: [{
|
|
1491
1622
|
selector: 'amplify-verify-user',
|
|
1492
|
-
template: "<
|
|
1623
|
+
template: "<form data-amplify-form (input)=\"onInput($event)\" (submit)=\"onSubmit($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"verify-user-header\" [context]=\"context\">\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n </amplify-slot>\n\n <div *ngFor=\"let unverifiedAttribute of unverifiedAttributes | keyvalue\">\n <input\n name=\"unverifiedAttr\"\n type=\"radio\"\n [value]=\"unverifiedAttribute.key\"\n [id]=\"labelId\"\n />\n <label [for]=\"labelId\">{{\n getLabelForAttr(unverifiedAttribute.key)\n }}</label>\n </div>\n\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ verifyText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.skipVerification()\"\n >\n {{ skipText }}\n </button>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"verify-user-footer\" [context]=\"context\"> </amplify-slot>\n</form>\n",
|
|
1493
1624
|
encapsulation: i0.ViewEncapsulation.None
|
|
1494
1625
|
},] }
|
|
1495
1626
|
];
|
|
@@ -1641,14 +1772,17 @@
|
|
|
1641
1772
|
this.required = true;
|
|
1642
1773
|
this.labelHidden = false;
|
|
1643
1774
|
this.display = 'contents';
|
|
1644
|
-
this.countryDialCodes = ui.countryDialCodes;
|
|
1645
1775
|
}
|
|
1776
|
+
PhoneNumberFieldComponent.prototype.ngOnInit = function () {
|
|
1777
|
+
var _a;
|
|
1778
|
+
this.countryDialCodesValues = (_a = this.dialCodeList) !== null && _a !== void 0 ? _a : ui.countryDialCodes;
|
|
1779
|
+
};
|
|
1646
1780
|
return PhoneNumberFieldComponent;
|
|
1647
1781
|
}());
|
|
1648
1782
|
PhoneNumberFieldComponent.decorators = [
|
|
1649
1783
|
{ type: i0.Component, args: [{
|
|
1650
1784
|
selector: 'amplify-phone-number-field',
|
|
1651
|
-
template: "<label\n class=\"amplify-label\"\n [class.amplify-visually-hidden]=\"labelHidden\"\n [for]=\"textFieldId\"\n>\n {{ label }}\n</label>\n<div\n class=\"amplify-flex amplify-phonenumberfield\"\n amplify-field-group\n style=\"gap: 0px\"\n>\n <div class=\"amplify-field-group__outer-start\">\n <div\n class=\"\n amplify-flex amplify-field amplify-selectfield amplify-countrycodeselect\n \"\n style=\"flex-direction: column\"\n >\n <amplify-form-select\n name=\"country_code\"\n label=\"Country Code\"\n [id]=\"selectFieldId\"\n [items]=\"
|
|
1785
|
+
template: "<label\n class=\"amplify-label\"\n [class.amplify-visually-hidden]=\"labelHidden\"\n [for]=\"textFieldId\"\n>\n {{ label }}\n</label>\n<div\n class=\"amplify-flex amplify-phonenumberfield\"\n amplify-field-group\n style=\"gap: 0px\"\n>\n <div class=\"amplify-field-group__outer-start\">\n <div\n class=\"\n amplify-flex amplify-field amplify-selectfield amplify-countrycodeselect\n \"\n style=\"flex-direction: column\"\n >\n <amplify-form-select\n name=\"country_code\"\n label=\"Country Code\"\n [id]=\"selectFieldId\"\n [items]=\"countryDialCodesValues\"\n [defaultValue]=\"defaultCountryCode\"\n ></amplify-form-select>\n </div>\n </div>\n\n <input\n class=\"amplify-input\"\n [id]=\"textFieldId\"\n [type]=\"type\"\n [name]=\"name\"\n [placeholder]=\"placeholder\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [attr.disabled]=\"disabled ? '' : null\"\n [autocomplete]=\"autocomplete\"\n />\n</div>\n"
|
|
1652
1786
|
},] }
|
|
1653
1787
|
];
|
|
1654
1788
|
PhoneNumberFieldComponent.propDecorators = {
|
|
@@ -1664,6 +1798,7 @@
|
|
|
1664
1798
|
required: [{ type: i0.Input }],
|
|
1665
1799
|
type: [{ type: i0.Input }],
|
|
1666
1800
|
labelHidden: [{ type: i0.Input }],
|
|
1801
|
+
dialCodeList: [{ type: i0.Input }],
|
|
1667
1802
|
display: [{ type: i0.HostBinding, args: ['style.display',] }]
|
|
1668
1803
|
};
|
|
1669
1804
|
|