@aws-amplify/ui-angular 2.0.9 → 2.0.10

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.
@@ -100,16 +100,19 @@
100
100
  services: services,
101
101
  },
102
102
  });
103
- this._subscription = authService.subscribe(function (state) {
103
+ this._machineSubscription = authService.subscribe(function (state) {
104
104
  _this._authState = state;
105
105
  _this._facade = ui.getServiceContextFacade(state);
106
106
  });
107
+ this._hubSubscription = ui.listenToAuthHub(authService.send);
107
108
  this._sendEventAliases = ui.getSendEventAliases(authService.send);
108
109
  this._authService = authService;
109
110
  };
110
111
  AuthenticatorService.prototype.ngOnDestroy = function () {
111
- if (this._subscription)
112
- this._subscription.unsubscribe();
112
+ if (this._machineSubscription)
113
+ this._machineSubscription.unsubscribe();
114
+ if (this._hubSubscription)
115
+ this._hubSubscription();
113
116
  };
114
117
  Object.defineProperty(AuthenticatorService.prototype, "error", {
115
118
  /**
@@ -705,7 +708,7 @@
705
708
  ForceNewPasswordComponent.decorators = [
706
709
  { type: i0.Component, args: [{
707
710
  selector: 'amplify-force-new-password',
708
- template: "<div data-amplify-container>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"force-new-password-header\" [context]=\"context\">\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n </amplify-slot>\n <amplify-form-field\n name=\"password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n\n <amplify-form-field\n name=\"confirm_password\"\n label=\"Confirm Password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ changePasswordText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"force-new-password-footer\" [context]=\"context\">\n </amplify-slot>\n </form>\n</div>\n"
711
+ template: "<div data-amplify-container>\n <form data-amplify-form (submit)=\"onSubmit($event)\" (input)=\"onInput($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"authenticator.isPending\"\n >\n <amplify-slot name=\"force-new-password-header\" [context]=\"context\">\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n </amplify-slot>\n <amplify-form-field\n name=\"password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n\n <amplify-form-field\n name=\"confirm_password\"\n label=\"Confirm Password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n <amplify-slot name=\"force-new-form-fields\" [context]=\"context\">\n <amplify-force-new-password-form-fields></amplify-force-new-password-form-fields>\n </amplify-slot>\n\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ changePasswordText }}\n </button>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"authenticator.toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </fieldset>\n <amplify-slot name=\"force-new-password-footer\" [context]=\"context\">\n </amplify-slot>\n </form>\n</div>\n"
709
712
  },] }
710
713
  ];
711
714
  ForceNewPasswordComponent.ctorParameters = function () { return [
@@ -716,6 +719,34 @@
716
719
  headerText: [{ type: i0.Input }]
717
720
  };
718
721
 
722
+ var ForceNewPasswordFormFieldsComponent = /** @class */ (function () {
723
+ function ForceNewPasswordFormFieldsComponent(authenticator) {
724
+ this.authenticator = authenticator;
725
+ }
726
+ ForceNewPasswordFormFieldsComponent.prototype.ngOnInit = function () {
727
+ var state = this.authenticator.authState;
728
+ var actorContext = ui.getActorContext(state);
729
+ var requiredAttributes = actorContext.requiredAttributes;
730
+ this.fieldNames = requiredAttributes.filter(function (fieldName) {
731
+ var hasDefaultField = !!ui.authInputAttributes[fieldName];
732
+ if (!hasDefaultField) {
733
+ console.debug("Authenticator does not have a default implementation for " + fieldName + ". Customize Authenticator.SignUp.FormFields to add your own.");
734
+ }
735
+ return hasDefaultField;
736
+ });
737
+ };
738
+ return ForceNewPasswordFormFieldsComponent;
739
+ }());
740
+ ForceNewPasswordFormFieldsComponent.decorators = [
741
+ { type: i0.Component, args: [{
742
+ selector: 'amplify-force-new-password-form-fields',
743
+ template: "<div class=\"amplify-flex\" style=\"flex-direction: column\" data-amplify-fieldset>\n <ng-container *ngFor=\"let field of fieldNames\">\n <amplify-form-field\n [name]=\"field\"\n [labelHidden]=\"false\"\n ></amplify-form-field>\n </ng-container>\n</div>\n"
744
+ },] }
745
+ ];
746
+ ForceNewPasswordFormFieldsComponent.ctorParameters = function () { return [
747
+ { type: AuthenticatorService }
748
+ ]; };
749
+
719
750
  var getAttributeMap = function () { return ui.authInputAttributes; };
720
751
 
721
752
  /**
@@ -1801,6 +1832,7 @@
1801
1832
  FederatedSignInButtonComponent,
1802
1833
  FederatedSignInComponent,
1803
1834
  ForceNewPasswordComponent,
1835
+ ForceNewPasswordFormFieldsComponent,
1804
1836
  FormFieldComponent,
1805
1837
  PasswordFieldComponent,
1806
1838
  PhoneNumberFieldComponent,
@@ -1822,6 +1854,7 @@
1822
1854
  AuthenticatorComponent,
1823
1855
  CheckboxComponent,
1824
1856
  SignUpFormFieldsComponent,
1857
+ ForceNewPasswordFormFieldsComponent,
1825
1858
  TextFieldComponent,
1826
1859
  ],
1827
1860
  },] }
@@ -1850,6 +1883,7 @@
1850
1883
  exports.FederatedSignInButtonComponent = FederatedSignInButtonComponent;
1851
1884
  exports.FederatedSignInComponent = FederatedSignInComponent;
1852
1885
  exports.ForceNewPasswordComponent = ForceNewPasswordComponent;
1886
+ exports.ForceNewPasswordFormFieldsComponent = ForceNewPasswordFormFieldsComponent;
1853
1887
  exports.FormFieldComponent = FormFieldComponent;
1854
1888
  exports.PasswordFieldComponent = PasswordFieldComponent;
1855
1889
  exports.PhoneNumberFieldComponent = PhoneNumberFieldComponent;
@@ -1867,6 +1901,7 @@
1867
1901
  exports.getAttributeMap = getAttributeMap;
1868
1902
  exports["ɵa"] = AmplifySlotComponent;
1869
1903
  exports["ɵb"] = AuthenticatorComponent;
1904
+ exports["ɵba"] = VerifyUserComponent;
1870
1905
  exports["ɵc"] = ButtonComponent;
1871
1906
  exports["ɵd"] = CheckboxComponent;
1872
1907
  exports["ɵe"] = ConfirmResetPasswordComponent;
@@ -1877,20 +1912,20 @@
1877
1912
  exports["ɵj"] = FederatedSignInButtonComponent;
1878
1913
  exports["ɵk"] = FederatedSignInComponent;
1879
1914
  exports["ɵl"] = ForceNewPasswordComponent;
1880
- exports["ɵm"] = FormFieldComponent;
1881
- exports["ɵn"] = PasswordFieldComponent;
1882
- exports["ɵo"] = PhoneNumberFieldComponent;
1883
- exports["ɵp"] = ResetPasswordComponent;
1884
- exports["ɵq"] = SelectComponent;
1885
- exports["ɵr"] = SetupTotpComponent;
1886
- exports["ɵs"] = SignInComponent;
1887
- exports["ɵt"] = SignUpComponent;
1888
- exports["ɵu"] = SignUpFormFieldsComponent;
1889
- exports["ɵv"] = TabItemComponent;
1890
- exports["ɵw"] = TabsComponent;
1891
- exports["ɵx"] = TextFieldComponent;
1892
- exports["ɵy"] = UserNameAliasComponent;
1893
- exports["ɵz"] = VerifyUserComponent;
1915
+ exports["ɵm"] = ForceNewPasswordFormFieldsComponent;
1916
+ exports["ɵn"] = FormFieldComponent;
1917
+ exports["ɵo"] = PasswordFieldComponent;
1918
+ exports["ɵp"] = PhoneNumberFieldComponent;
1919
+ exports["ɵq"] = ResetPasswordComponent;
1920
+ exports["ɵr"] = SelectComponent;
1921
+ exports["ɵs"] = SetupTotpComponent;
1922
+ exports["ɵt"] = SignInComponent;
1923
+ exports["ɵu"] = SignUpComponent;
1924
+ exports["ɵv"] = SignUpFormFieldsComponent;
1925
+ exports["ɵw"] = TabItemComponent;
1926
+ exports["ɵx"] = TabsComponent;
1927
+ exports["ɵy"] = TextFieldComponent;
1928
+ exports["ɵz"] = UserNameAliasComponent;
1894
1929
 
1895
1930
  Object.defineProperty(exports, '__esModule', { value: true });
1896
1931