@aws-amplify/ui-angular 2.4.4 → 2.4.7
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 +18 -5
- 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 +20 -7
- package/esm2015/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.js +2 -2
- package/fesm2015/aws-amplify-ui-angular.js +20 -7
- package/fesm2015/aws-amplify-ui-angular.js.map +1 -1
- package/lib/components/authenticator/components/authenticator/authenticator.component.d.ts +1 -0
- package/package.json +2 -2
|
@@ -315,7 +315,9 @@
|
|
|
315
315
|
AuthenticatorComponent.prototype.ngOnInit = function () {
|
|
316
316
|
var _this = this;
|
|
317
317
|
var _a = this, initialState = _a.initialState, loginMechanisms = _a.loginMechanisms, services = _a.services, signUpAttributes = _a.signUpAttributes, socialProviders = _a.socialProviders, formFields = _a.formFields;
|
|
318
|
-
|
|
318
|
+
var authService = this.authenticator.authService;
|
|
319
|
+
this.unsubscribeHub = ui.listenToAuthHub(authService, function (data, service) {
|
|
320
|
+
ui.defaultAuthHubHandler(data, service);
|
|
319
321
|
/**
|
|
320
322
|
* Hub events aren't properly caught by Angular, because they are
|
|
321
323
|
* synchronous events. Angular tracks async network events and
|
|
@@ -323,7 +325,6 @@
|
|
|
323
325
|
*
|
|
324
326
|
* On any notable hub events, we run change detection manually.
|
|
325
327
|
*/
|
|
326
|
-
var state = _this.authenticator.authService.send(event);
|
|
327
328
|
_this.changeDetector.detectChanges();
|
|
328
329
|
/**
|
|
329
330
|
* Hub events that we handle can lead to multiple state changes:
|
|
@@ -334,7 +335,6 @@
|
|
|
334
335
|
* to true to until we reach initial state.
|
|
335
336
|
*/
|
|
336
337
|
_this.isHandlingHubEvent = true;
|
|
337
|
-
return state;
|
|
338
338
|
});
|
|
339
339
|
/**
|
|
340
340
|
* Subscribes to state machine changes and sends INIT event
|
|
@@ -415,6 +415,19 @@
|
|
|
415
415
|
var route = this.authenticator.route;
|
|
416
416
|
return route === 'signIn' || route === 'signUp';
|
|
417
417
|
};
|
|
418
|
+
AuthenticatorComponent.prototype.hasRouteComponent = function () {
|
|
419
|
+
var route = this.authenticator.route;
|
|
420
|
+
switch (route) {
|
|
421
|
+
case 'authenticated':
|
|
422
|
+
case 'idle':
|
|
423
|
+
case 'setup':
|
|
424
|
+
case 'signOut':
|
|
425
|
+
case 'autoSignIn':
|
|
426
|
+
return false;
|
|
427
|
+
default:
|
|
428
|
+
return true;
|
|
429
|
+
}
|
|
430
|
+
};
|
|
418
431
|
AuthenticatorComponent.prototype.mapCustomComponents = function (componentQuery) {
|
|
419
432
|
if (!componentQuery)
|
|
420
433
|
return {};
|
|
@@ -429,7 +442,7 @@
|
|
|
429
442
|
AuthenticatorComponent.decorators = [
|
|
430
443
|
{ type: i0.Component, args: [{
|
|
431
444
|
selector: 'amplify-authenticator',
|
|
432
|
-
template: "<div
|
|
445
|
+
template: "<div\n data-amplify-authenticator\n [attr.data-variation]=\"variation\"\n *ngIf=\"hasRouteComponent()\"\n>\n <div data-amplify-container>\n <amplify-slot name=\"header\" [context]=\"context\"></amplify-slot>\n <div\n data-amplify-router\n [attr.data-amplify-router-content]=\"hasTabs() ? undefined : ''\"\n >\n <amplify-tabs\n (tabChange)=\"onTabChange()\"\n *ngIf=\"(route === 'signIn' || route === 'signUp') && !hideSignUp\"\n >\n <amplify-tab-item\n [title]=\"signInTitle\"\n [active]=\"route === 'signIn'\"\n data-amplify-router-content\n >\n <!-- signIn component -->\n <amplify-slot\n name=\"sign-in\"\n [context]=\"context\"\n *ngIf=\"route === 'signIn'\"\n >\n <amplify-sign-in></amplify-sign-in>\n </amplify-slot>\n </amplify-tab-item>\n <amplify-tab-item\n [title]=\"signUpTitle\"\n [active]=\"route === 'signUp'\"\n data-amplify-router-content\n >\n <!-- signUp component -->\n <amplify-slot\n name=\"sign-up\"\n [context]=\"context\"\n *ngIf=\"route === 'signUp'\"\n >\n <amplify-sign-up></amplify-sign-up>\n </amplify-slot>\n </amplify-tab-item>\n </amplify-tabs>\n\n <amplify-slot\n name=\"sign-in\"\n [context]=\"context\"\n *ngIf=\"route === 'signIn' && hideSignUp\"\n >\n <amplify-sign-in></amplify-sign-in>\n </amplify-slot>\n\n <!-- confirmSignUp content -->\n <amplify-slot\n name=\"confirm-sign-up\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmSignUp'\"\n >\n <amplify-confirm-sign-up></amplify-confirm-sign-up>\n </amplify-slot>\n\n <!-- confirmSignIn content -->\n <amplify-slot\n name=\"confirm-sign-in\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmSignIn'\"\n >\n <amplify-confirm-sign-in></amplify-confirm-sign-in>\n </amplify-slot>\n\n <!-- setupTotp content -->\n <amplify-slot\n name=\"setup-totp\"\n [context]=\"context\"\n *ngIf=\"route === 'setupTOTP'\"\n >\n <amplify-setup-totp></amplify-setup-totp>\n </amplify-slot>\n\n <!-- forceNewPassword content -->\n <amplify-slot\n name=\"force-new-password\"\n [context]=\"context\"\n *ngIf=\"route === 'forceNewPassword'\"\n >\n <amplify-force-new-password></amplify-force-new-password>\n </amplify-slot>\n\n <!-- resetPassword content -->\n <amplify-slot\n name=\"reset-password\"\n [context]=\"context\"\n *ngIf=\"route === 'resetPassword'\"\n >\n <amplify-reset-password></amplify-reset-password>\n </amplify-slot>\n\n <!-- confirmResetPassword content -->\n <amplify-slot\n name=\"confirm-reset-password\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmResetPassword'\"\n >\n <amplify-confirm-reset-password></amplify-confirm-reset-password>\n </amplify-slot>\n\n <!-- verifyUser content -->\n <amplify-slot\n name=\"verify-user\"\n [context]=\"context\"\n *ngIf=\"route === 'verifyUser'\"\n >\n <amplify-verify-user></amplify-verify-user>\n </amplify-slot>\n\n <!-- confirmVerifyUser content -->\n <amplify-slot\n name=\"confirm-verify-user\"\n [context]=\"context\"\n *ngIf=\"route === 'confirmVerifyUser'\"\n >\n <amplify-confirm-verify-user></amplify-confirm-verify-user>\n </amplify-slot>\n </div>\n\n <amplify-slot name=\"footer\" [context]=\"context\"></amplify-slot>\n </div>\n</div>\n\n<!-- signedIn content is rendered outside authenticator so it's not styled by authenticator -->\n<amplify-slot\n name=\"authenticated\"\n [context]=\"context\"\n *ngIf=\"route === 'authenticated'\"\n>\n <ng-content></ng-content>\n</amplify-slot>\n",
|
|
433
446
|
providers: [CustomComponentsService],
|
|
434
447
|
encapsulation: i0.ViewEncapsulation.None
|
|
435
448
|
},] }
|
|
@@ -464,7 +477,7 @@
|
|
|
464
477
|
* See https://github.com/aws-amplify/amplify-ui/issues/1784
|
|
465
478
|
* TODO: Remove support for 'Send Code' translation in next Major release
|
|
466
479
|
*/
|
|
467
|
-
this.submitText = ui.hasTranslation('
|
|
480
|
+
this.submitText = !ui.hasTranslation('Send Code')
|
|
468
481
|
? ui.translate('Submit')
|
|
469
482
|
: ui.translate('Send Code');
|
|
470
483
|
}
|