@aws-amplify/ui-angular 2.0.1-next.4 → 2.0.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.
Files changed (137) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +28 -0
  3. package/aws-amplify-ui-angular.d.ts +26 -23
  4. package/aws-amplify-ui-angular.metadata.json +1 -1
  5. package/bundles/aws-amplify-ui-angular-legacy.umd.js +2229 -0
  6. package/bundles/aws-amplify-ui-angular-legacy.umd.js.map +1 -0
  7. package/bundles/aws-amplify-ui-angular-legacy.umd.min.js +16 -0
  8. package/bundles/aws-amplify-ui-angular-legacy.umd.min.js.map +1 -0
  9. package/bundles/aws-amplify-ui-angular.umd.js +890 -2845
  10. package/bundles/aws-amplify-ui-angular.umd.js.map +1 -1
  11. package/bundles/aws-amplify-ui-angular.umd.min.js +1 -1
  12. package/bundles/aws-amplify-ui-angular.umd.min.js.map +1 -1
  13. package/esm2015/aws-amplify-ui-angular.js +27 -24
  14. package/esm2015/index.js +22 -8
  15. package/esm2015/legacy/aws-amplify-ui-angular-legacy.js +6 -0
  16. package/esm2015/legacy/index.js +3 -0
  17. package/esm2015/legacy/legacy-ui-angular.module.js +53 -0
  18. package/esm2015/legacy/proxies.js +1839 -0
  19. package/esm2015/lib/common/types/auth-types.js +1 -1
  20. package/esm2015/lib/components/authenticator/authenticator.module.js +79 -0
  21. package/esm2015/lib/components/authenticator/components/authenticator/authenticator.component.js +87 -0
  22. package/esm2015/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.js +40 -0
  23. package/esm2015/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.js +57 -0
  24. package/esm2015/lib/components/authenticator/components/confirm-sign-up/confirm-sign-up.component.js +39 -0
  25. package/esm2015/lib/components/authenticator/components/confirm-verify-user/amplify-confirm-verify-user.component.js +39 -0
  26. package/esm2015/lib/components/authenticator/components/federated-sign-in/federated-sign-in.component.js +47 -0
  27. package/esm2015/lib/components/authenticator/components/federated-sign-in-button/federated-sign-in-button.component.js +27 -0
  28. package/esm2015/lib/components/authenticator/components/force-new-password/force-new-password.component.js +39 -0
  29. package/esm2015/lib/components/authenticator/components/form-field/form-field.component.js +93 -0
  30. package/esm2015/lib/components/authenticator/components/index.js +17 -0
  31. package/esm2015/lib/components/authenticator/components/reset-password/reset-password.component.js +45 -0
  32. package/esm2015/lib/components/authenticator/components/setup-totp/setup-totp.component.js +65 -0
  33. package/esm2015/lib/components/authenticator/components/sign-in/sign-in.component.js +38 -0
  34. package/esm2015/lib/components/authenticator/components/sign-up/sign-up-form-fields/sign-up-form-fields.component.js +34 -0
  35. package/esm2015/lib/components/authenticator/components/sign-up/sign-up.component.js +37 -0
  36. package/esm2015/lib/components/authenticator/components/user-name-alias/user-name-alias.component.js +35 -0
  37. package/esm2015/lib/components/authenticator/components/verify-user/verify-user.component.js +54 -0
  38. package/esm2015/lib/primitives/button/button.component.js +38 -0
  39. package/esm2015/lib/primitives/checkbox/checkbox.component.js +31 -0
  40. package/esm2015/lib/primitives/error/error.component.js +16 -0
  41. package/esm2015/lib/primitives/index.js +10 -3
  42. package/esm2015/lib/primitives/password-field/password-field.component.js +43 -0
  43. package/esm2015/lib/primitives/phone-number-field/phone-number-field.component.js +40 -0
  44. package/esm2015/lib/primitives/select/select.component.js +17 -0
  45. package/esm2015/lib/primitives/tabs/tabs.component.js +3 -2
  46. package/esm2015/lib/primitives/text-field/text-field.component.js +35 -0
  47. package/esm2015/lib/services/authenticator.service.js +133 -0
  48. package/esm2015/lib/services/custom-components.service.js +23 -0
  49. package/esm2015/lib/utilities/amplify-slot/amplify-slot.component.js +32 -0
  50. package/esm2015/lib/utilities/amplify-slot/amplify-slot.directive.js +21 -0
  51. package/fesm2015/aws-amplify-ui-angular-legacy.js +1846 -0
  52. package/fesm2015/aws-amplify-ui-angular-legacy.js.map +1 -0
  53. package/fesm2015/aws-amplify-ui-angular.js +668 -2604
  54. package/fesm2015/aws-amplify-ui-angular.js.map +1 -1
  55. package/index.d.ts +21 -7
  56. package/legacy/aws-amplify-ui-angular-legacy.d.ts +5 -0
  57. package/legacy/aws-amplify-ui-angular-legacy.metadata.json +1 -0
  58. package/legacy/index.d.ts +2 -0
  59. package/legacy/legacy-ui-angular.module.d.ts +2 -0
  60. package/legacy/package.json +11 -0
  61. package/{lib → legacy}/proxies.d.ts +0 -0
  62. package/lib/common/types/auth-types.d.ts +2 -5
  63. package/lib/components/authenticator/authenticator.module.d.ts +2 -0
  64. package/lib/components/authenticator/components/authenticator/authenticator.component.d.ts +67 -0
  65. package/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.d.ts +50 -0
  66. package/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.d.ts +52 -0
  67. package/lib/components/authenticator/components/confirm-sign-up/confirm-sign-up.component.d.ts +49 -0
  68. package/lib/components/authenticator/components/confirm-verify-user/amplify-confirm-verify-user.component.d.ts +49 -0
  69. package/lib/components/{amplify-federated-sign-in/amplify-federated-sign-in.component.d.ts → authenticator/components/federated-sign-in/federated-sign-in.component.d.ts} +9 -6
  70. package/lib/components/authenticator/components/federated-sign-in-button/federated-sign-in-button.component.d.ts +9 -0
  71. package/lib/components/authenticator/components/force-new-password/force-new-password.component.d.ts +49 -0
  72. package/lib/{primitives/amplify-form-field/amplify-form-field.component.d.ts → components/authenticator/components/form-field/form-field.component.d.ts} +7 -5
  73. package/lib/components/authenticator/components/index.d.ts +16 -0
  74. package/lib/components/authenticator/components/reset-password/reset-password.component.d.ts +52 -0
  75. package/lib/components/authenticator/components/setup-totp/setup-totp.component.d.ts +53 -0
  76. package/lib/components/authenticator/components/sign-in/sign-in.component.d.ts +48 -0
  77. package/lib/components/authenticator/components/sign-up/sign-up-form-fields/sign-up-form-fields.component.d.ts +12 -0
  78. package/lib/components/authenticator/components/sign-up/sign-up.component.d.ts +47 -0
  79. package/lib/{primitives/amplify-user-name-alias/amplify-user-name-alias.component.d.ts → components/authenticator/components/user-name-alias/user-name-alias.component.d.ts} +4 -4
  80. package/lib/components/authenticator/components/verify-user/verify-user.component.d.ts +54 -0
  81. package/lib/primitives/{amplify-button/amplify-button.component.d.ts → button/button.component.d.ts} +1 -1
  82. package/lib/primitives/checkbox/checkbox.component.d.ts +12 -0
  83. package/lib/primitives/error/error.component.d.ts +4 -0
  84. package/lib/primitives/index.d.ts +9 -2
  85. package/lib/primitives/{amplify-password-field/amplify-password-field.component.d.ts → password-field/password-field.component.d.ts} +3 -2
  86. package/lib/primitives/phone-number-field/phone-number-field.component.d.ts +16 -0
  87. package/lib/primitives/{amplify-select/amplify-select.component.d.ts → select/select.component.d.ts} +2 -2
  88. package/lib/primitives/{amplify-text-field/amplify-text-field.component.d.ts → text-field/text-field.component.d.ts} +4 -5
  89. package/lib/services/authenticator.service.d.ts +94 -0
  90. package/lib/services/custom-components.service.d.ts +9 -0
  91. package/lib/utilities/amplify-slot/amplify-slot.component.d.ts +12 -0
  92. package/lib/{directives → utilities/amplify-slot}/amplify-slot.directive.d.ts +0 -0
  93. package/package.json +3 -4
  94. package/theme.css +0 -1
  95. package/esm2015/lib/components/amplify-authenticator/amplify-authenticator.component.js +0 -89
  96. package/esm2015/lib/components/amplify-confirm-sign-in/amplify-confirm-sign-in.component.js +0 -91
  97. package/esm2015/lib/components/amplify-confirm-sign-up/amplify-confirm-sign-up.component.js +0 -83
  98. package/esm2015/lib/components/amplify-federated-sign-in/amplify-federated-sign-in.component.js +0 -37
  99. package/esm2015/lib/components/amplify-federated-sign-in-button/amplify-federated-sign-in-button.component.js +0 -27
  100. package/esm2015/lib/components/amplify-force-new-password/amplify-force-new-password.component.js +0 -83
  101. package/esm2015/lib/components/amplify-reset-password/amplify-reset-password.component.js +0 -68
  102. package/esm2015/lib/components/amplify-setup-totp/amplify-setup-totp.component.js +0 -100
  103. package/esm2015/lib/components/amplify-sign-in/amplify-sign-in.component.js +0 -78
  104. package/esm2015/lib/components/amplify-sign-up/amplify-sign-up.component.js +0 -98
  105. package/esm2015/lib/components/amplify-verify-user/amplify-verify-user.component.js +0 -78
  106. package/esm2015/lib/components/confirm-reset-password/amplify-confirm-reset-password.component.js +0 -76
  107. package/esm2015/lib/components/confirm-verify-user/amplify-confirm-verify-user.component.js +0 -66
  108. package/esm2015/lib/components/index.js +0 -14
  109. package/esm2015/lib/directives/amplify-slot.directive.js +0 -21
  110. package/esm2015/lib/primitives/amplify-button/amplify-button.component.js +0 -38
  111. package/esm2015/lib/primitives/amplify-error/amplify-error.component.js +0 -10
  112. package/esm2015/lib/primitives/amplify-form-field/amplify-form-field.component.js +0 -89
  113. package/esm2015/lib/primitives/amplify-password-field/amplify-password-field.component.js +0 -39
  114. package/esm2015/lib/primitives/amplify-select/amplify-select.component.js +0 -17
  115. package/esm2015/lib/primitives/amplify-text-field/amplify-text-field.component.js +0 -39
  116. package/esm2015/lib/primitives/amplify-user-name-alias/amplify-user-name-alias.component.js +0 -35
  117. package/esm2015/lib/proxies.js +0 -1839
  118. package/esm2015/lib/services/authenticator-context.service.js +0 -28
  119. package/esm2015/lib/services/state-machine.service.js +0 -52
  120. package/esm2015/lib/ui-angular.module.js +0 -101
  121. package/lib/components/amplify-authenticator/amplify-authenticator.component.d.ts +0 -36
  122. package/lib/components/amplify-confirm-sign-in/amplify-confirm-sign-in.component.d.ts +0 -31
  123. package/lib/components/amplify-confirm-sign-up/amplify-confirm-sign-up.component.d.ts +0 -34
  124. package/lib/components/amplify-federated-sign-in-button/amplify-federated-sign-in-button.component.d.ts +0 -9
  125. package/lib/components/amplify-force-new-password/amplify-force-new-password.component.d.ts +0 -31
  126. package/lib/components/amplify-reset-password/amplify-reset-password.component.d.ts +0 -30
  127. package/lib/components/amplify-setup-totp/amplify-setup-totp.component.d.ts +0 -31
  128. package/lib/components/amplify-sign-in/amplify-sign-in.component.d.ts +0 -32
  129. package/lib/components/amplify-sign-up/amplify-sign-up.component.d.ts +0 -32
  130. package/lib/components/amplify-verify-user/amplify-verify-user.component.d.ts +0 -32
  131. package/lib/components/confirm-reset-password/amplify-confirm-reset-password.component.d.ts +0 -34
  132. package/lib/components/confirm-verify-user/amplify-confirm-verify-user.component.d.ts +0 -28
  133. package/lib/components/index.d.ts +0 -13
  134. package/lib/primitives/amplify-error/amplify-error.component.d.ts +0 -2
  135. package/lib/services/authenticator-context.service.d.ts +0 -10
  136. package/lib/services/state-machine.service.d.ts +0 -29
  137. package/lib/ui-angular.module.d.ts +0 -2
@@ -1,15 +1,14 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, TemplateRef, Input, Injectable, Component, ViewEncapsulation, ContentChildren, HostBinding, EventEmitter, Output, ChangeDetectionStrategy, ChangeDetectorRef, ElementRef, NgZone, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2
+ import { Directive, TemplateRef, Input, Injectable, Component, ViewEncapsulation, ContentChildren, HostBinding, EventEmitter, Output, NgModule } from '@angular/core';
3
3
  import { CommonModule } from '@angular/common';
4
- import { authMachine, getSendEventAliases, translate, translations, getActorState, getActorContext, AuthChallengeNames, FederatedIdentityProviders, getConfiguredAliases, authInputAttributes, countryDialCodes, getAliasInfoFromContext } from '@aws-amplify/ui';
5
- import { I18n, Logger, Auth } from 'aws-amplify';
4
+ import { BrowserModule } from '@angular/platform-browser';
5
+ import { createAuthenticatorMachine, getServiceContextFacade, getSendEventAliases, translate, getActorContext, AuthChallengeNames, FederatedIdentityProviders, authInputAttributes, countryDialCodes, getAliasInfoFromContext, getActorState } from '@aws-amplify/ui';
6
+ import { Logger } from '@aws-amplify/core';
6
7
  import { interpret } from 'xstate';
7
- import { __awaiter, __decorate } from 'tslib';
8
+ import { Logger as Logger$1, Auth } from 'aws-amplify';
9
+ import { __awaiter } from 'tslib';
8
10
  import QRCode from 'qrcode';
9
- import { isEmpty } from 'lodash';
10
11
  import { nanoid } from 'nanoid';
11
- import { fromEvent } from 'rxjs';
12
- import { AmplifyButton as AmplifyButton$1, AmplifyInput as AmplifyInput$1, AmplifyToast as AmplifyToast$1, AmplifyChatbot as AmplifyChatbot$1, AmplifyS3Album as AmplifyS3Album$1, AmplifyS3ImagePicker as AmplifyS3ImagePicker$1, AmplifyS3Text as AmplifyS3Text$1, AmplifyS3TextPicker as AmplifyS3TextPicker$1, AmplifyS3Image as AmplifyS3Image$1, AmplifyPicker as AmplifyPicker$1, AmplifyPhotoPicker as AmplifyPhotoPicker$1 } from '@aws-amplify/ui-components/dist/components';
13
12
 
14
13
  class AmplifySlotDirective {
15
14
  constructor(template) {
@@ -31,10 +30,12 @@ AmplifySlotDirective.propDecorators = {
31
30
  amplifySlot: [{ type: Input }]
32
31
  };
33
32
 
34
- class AuthPropService {
33
+ /**
34
+ * Stores and provides custom components that users provide with `amplify-slot`.
35
+ */
36
+ class CustomComponentsService {
35
37
  constructor() {
36
38
  this._customComponents = {};
37
- this._props = {};
38
39
  }
39
40
  get customComponents() {
40
41
  return this._customComponents;
@@ -42,91 +43,164 @@ class AuthPropService {
42
43
  set customComponents(customComponents) {
43
44
  this._customComponents = Object.assign(Object.assign({}, this._customComponents), customComponents);
44
45
  }
45
- get props() {
46
- return this._props;
47
- }
48
- set props(props) {
49
- this._props = Object.assign(Object.assign({}, this._props), props);
50
- }
51
46
  }
52
- AuthPropService.ɵprov = i0.ɵɵdefineInjectable({ factory: function AuthPropService_Factory() { return new AuthPropService(); }, token: AuthPropService, providedIn: "root" });
53
- AuthPropService.decorators = [
47
+ CustomComponentsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CustomComponentsService_Factory() { return new CustomComponentsService(); }, token: CustomComponentsService, providedIn: "root" });
48
+ CustomComponentsService.decorators = [
54
49
  { type: Injectable, args: [{
55
50
  providedIn: 'root',
56
51
  },] }
57
52
  ];
58
- AuthPropService.ctorParameters = () => [];
59
53
 
54
+ const logger$2 = new Logger('state-machine');
60
55
  /**
61
- * AmplifyContextService contains access to the xstate machine
62
- * and custom components passed by the user.
56
+ * AuthenticatorService provides access to the authenticator state and context.
63
57
  */
64
- class StateMachineService {
65
- startMachine(loginMechanisms) {
66
- const machine = authMachine.withContext({
67
- config: {
68
- login_mechanisms: loginMechanisms,
69
- },
58
+ class AuthenticatorService {
59
+ startMachine({ initialState, loginMechanisms, services, signUpAttributes, socialProviders, }) {
60
+ const machine = createAuthenticatorMachine({
61
+ initialState,
62
+ loginMechanisms,
63
+ services,
64
+ signUpAttributes,
65
+ socialProviders,
70
66
  });
71
67
  const authService = interpret(machine, {
72
68
  devTools: process.env.NODE_ENV === 'development',
73
- })
74
- .onTransition((state) => {
75
- this._user = state.context.user;
69
+ }).start();
70
+ this._subscription = authService.subscribe((state) => {
76
71
  this._authState = state;
77
- })
78
- .start();
79
- this._services = getSendEventAliases(authService.send);
72
+ this._facade = getServiceContextFacade(state);
73
+ });
74
+ this._sendEventAliases = getSendEventAliases(authService.send);
80
75
  this._authService = authService;
81
76
  }
82
- get services() {
83
- return this._services;
77
+ ngOnDestroy() {
78
+ if (this._subscription)
79
+ this._subscription.unsubscribe();
80
+ }
81
+ /**
82
+ * Context facades
83
+ */
84
+ get error() {
85
+ var _a;
86
+ return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.error;
87
+ }
88
+ get hasValidationErrors() {
89
+ var _a;
90
+ return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.hasValidationErrors;
91
+ }
92
+ get isPending() {
93
+ var _a;
94
+ return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.isPending;
95
+ }
96
+ get route() {
97
+ var _a;
98
+ return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.route;
99
+ }
100
+ get user() {
101
+ var _a;
102
+ return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.user;
103
+ }
104
+ get validationErrors() {
105
+ var _a;
106
+ return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.validationErrors;
107
+ }
108
+ /**
109
+ * Service facades
110
+ */
111
+ get updateForm() {
112
+ return this._sendEventAliases.updateForm;
113
+ }
114
+ get resendCode() {
115
+ return this._sendEventAliases.resendCode;
116
+ }
117
+ get signOut() {
118
+ return this._sendEventAliases.signOut;
119
+ }
120
+ get submitForm() {
121
+ return this._sendEventAliases.submitForm;
122
+ }
123
+ /**
124
+ * Transition facades
125
+ */
126
+ get toFederatedSignIn() {
127
+ return this._sendEventAliases.toFederatedSignIn;
128
+ }
129
+ get toResetPassword() {
130
+ return this._sendEventAliases.toResetPassword;
84
131
  }
132
+ get toSignIn() {
133
+ return this._sendEventAliases.toSignIn;
134
+ }
135
+ get toSignUp() {
136
+ return this._sendEventAliases.toSignUp;
137
+ }
138
+ get skipVerification() {
139
+ return this._sendEventAliases.skipVerification;
140
+ }
141
+ /**
142
+ * Internal utility functions
143
+ */
144
+ /** @deprecated For internal use only */
85
145
  get authState() {
86
146
  return this._authState;
87
147
  }
148
+ /** @deprecated For internal use only */
88
149
  get authService() {
89
150
  return this._authService;
90
151
  }
91
- get user() {
92
- return this._user;
93
- }
152
+ /** @deprecated For internal use only */
94
153
  get context() {
95
154
  return this._authState.context;
96
155
  }
156
+ /** @deprecated For internal use only */
157
+ get slotContext() {
158
+ const slotContext = Object.assign(Object.assign({}, this._facade), this._sendEventAliases);
159
+ return Object.assign(Object.assign({}, slotContext), { $implicit: Object.assign({}, slotContext) });
160
+ }
161
+ /** @deprecated For internal use only */
162
+ subscribe(callback) {
163
+ if (this._authService) {
164
+ return this._authService.subscribe(callback);
165
+ }
166
+ else {
167
+ logger$2.error('Subscription attempted before machine was created. This is likely a bug on the library, please consider filing a bug.');
168
+ }
169
+ }
170
+ /** @deprecated For internal use only */
97
171
  send(event) {
98
172
  this.authService.send(event);
99
173
  }
100
174
  }
101
- StateMachineService.ɵprov = i0.ɵɵdefineInjectable({ factory: function StateMachineService_Factory() { return new StateMachineService(); }, token: StateMachineService, providedIn: "root" });
102
- StateMachineService.decorators = [
175
+ AuthenticatorService.ɵprov = i0.ɵɵdefineInjectable({ factory: function AuthenticatorService_Factory() { return new AuthenticatorService(); }, token: AuthenticatorService, providedIn: "root" });
176
+ AuthenticatorService.decorators = [
103
177
  { type: Injectable, args: [{
104
178
  providedIn: 'root',
105
179
  },] }
106
180
  ];
107
181
 
108
- class AmplifyAuthenticatorComponent {
109
- constructor(stateMachine, contextService) {
110
- this.stateMachine = stateMachine;
182
+ class AuthenticatorComponent {
183
+ constructor(authenticator, contextService) {
184
+ this.authenticator = authenticator;
111
185
  this.contextService = contextService;
112
- /**
113
- * TODO: Add back custom events
114
- */
115
- this.initialState = 'signIn';
116
- this.loginMechanisms = ['username'];
117
186
  this.customComponentQuery = null;
118
- this.customComponents = {};
119
187
  // translated texts
120
188
  this.signInTitle = translate('Sign In');
121
189
  this.signUpTitle = translate('Create Account');
122
190
  }
123
191
  ngOnInit() {
124
- I18n.putVocabularies(translations);
125
- this.stateMachine.startMachine(this.loginMechanisms);
192
+ const { initialState, loginMechanisms, services, signUpAttributes, socialProviders, } = this;
193
+ this.authenticator.startMachine({
194
+ initialState,
195
+ loginMechanisms,
196
+ services,
197
+ signUpAttributes,
198
+ socialProviders,
199
+ });
126
200
  /**
127
201
  * handling translations after content init, because authenticator and its
128
202
  * translations might be initialized before the main app's `ngOnInit` is run.
129
- **/
203
+ */
130
204
  this.signInTitle = translate('Sign In');
131
205
  this.signUpTitle = translate('Create Account');
132
206
  }
@@ -135,29 +209,24 @@ class AmplifyAuthenticatorComponent {
135
209
  */
136
210
  ngAfterContentInit() {
137
211
  this.contextService.customComponents = this.mapCustomComponents(this.customComponentQuery);
138
- this.customComponents = this.contextService.customComponents;
139
212
  }
140
213
  /**
141
214
  * Class Functions
142
215
  */
216
+ // context passed to "authenticated" slot
143
217
  get context() {
144
- const { signOut } = this.stateMachine.services;
145
- const user = this.stateMachine.user;
146
- return { signOut, user };
218
+ return this.authenticator.slotContext;
147
219
  }
148
- get actorState() {
149
- return getActorState(this.stateMachine.authState);
150
- }
151
- get authenticatorState() {
152
- return this.stateMachine.authState;
220
+ get route() {
221
+ return this.authenticator.route;
153
222
  }
154
223
  onTabChange() {
155
- const currentState = this.stateMachine.authState.value;
156
- if (currentState === 'signIn') {
157
- this.stateMachine.send('SIGN_UP');
224
+ const route = this.authenticator.route;
225
+ if (route === 'signIn') {
226
+ this.authenticator.toSignUp();
158
227
  }
159
228
  else {
160
- this.stateMachine.send('SIGN_IN');
229
+ this.authenticator.toSignIn();
161
230
  }
162
231
  }
163
232
  mapCustomComponents(componentQuery) {
@@ -170,393 +239,431 @@ class AmplifyAuthenticatorComponent {
170
239
  return customComponents;
171
240
  }
172
241
  }
173
- AmplifyAuthenticatorComponent.decorators = [
242
+ AuthenticatorComponent.decorators = [
174
243
  { type: Component, args: [{
175
244
  selector: 'amplify-authenticator',
176
- 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<div data-amplify-wrapper data-amplify-authenticator>\n <amplify-tabs\n (tabChange)=\"onTabChange()\"\n *ngIf=\"actorState?.matches('signIn') || actorState?.matches('signUp')\"\n >\n <amplify-tab-item [title]=\"signInTitle\">\n <!-- signIn component -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signIn || signIn\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('signIn')\"\n ></ng-container>\n </amplify-tab-item>\n <amplify-tab-item [title]=\"signUpTitle\">\n <!-- signUp component -->\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signUp || signUp\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"actorState?.matches('signUp')\"\n ></ng-container>\n </amplify-tab-item>\n </amplify-tabs>\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</div>\n\n<!-- signedIn content is rendered outside authenticator so it's not styled by authenticator -->\n<ng-container\n [ngTemplateOutlet]=\"customComponents.authenticated || authenticated\"\n [ngTemplateOutletContext]=\"context\"\n *ngIf=\"authenticatorState.matches('authenticated')\"\n>\n</ng-container>\n",
177
- providers: [AuthPropService],
245
+ template: "<div data-amplify-authenticator [attr.data-variation]=\"variation\">\n <div data-amplify-container>\n <amplify-slot name=\"header\" [context]=\"context\"></amplify-slot>\n <div data-amplify-router>\n <amplify-tabs\n (tabChange)=\"onTabChange()\"\n *ngIf=\"route === 'signIn' || route === 'signUp'\"\n >\n <amplify-tab-item [title]=\"signInTitle\" [active]=\"route === 'signIn'\">\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 [title]=\"signUpTitle\" [active]=\"route === 'signUp'\">\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 <!-- 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",
246
+ providers: [CustomComponentsService],
178
247
  encapsulation: ViewEncapsulation.None
179
248
  },] }
180
249
  ];
181
- AmplifyAuthenticatorComponent.ctorParameters = () => [
182
- { type: StateMachineService },
183
- { type: AuthPropService }
250
+ AuthenticatorComponent.ctorParameters = () => [
251
+ { type: AuthenticatorService },
252
+ { type: CustomComponentsService }
184
253
  ];
185
- AmplifyAuthenticatorComponent.propDecorators = {
254
+ AuthenticatorComponent.propDecorators = {
186
255
  initialState: [{ type: Input }],
187
256
  loginMechanisms: [{ type: Input }],
257
+ services: [{ type: Input }],
258
+ signUpAttributes: [{ type: Input }],
259
+ socialProviders: [{ type: Input }],
260
+ variation: [{ type: Input }],
188
261
  customComponentQuery: [{ type: ContentChildren, args: [AmplifySlotDirective,] }]
189
262
  };
190
263
 
191
- const logger$3 = new Logger('ConfirmSignIn');
192
- class AmplifyConfirmSignInComponent {
193
- constructor(stateMachine, contextService) {
194
- this.stateMachine = stateMachine;
195
- this.contextService = contextService;
264
+ class ConfirmResetPasswordComponent {
265
+ constructor(authenticator) {
266
+ this.authenticator = authenticator;
267
+ this.dataAttr = '';
268
+ this.headerText = translate('Reset your password');
269
+ // translated strings
270
+ this.sendCodeText = translate('Send Code');
271
+ this.backToSignInText = translate('Back to Sign In');
272
+ this.resendCodeText = translate('Resend Code');
273
+ }
274
+ get context() {
275
+ return this.authenticator.slotContext;
276
+ }
277
+ onInput(event) {
278
+ event.preventDefault();
279
+ const { name, value } = event.target;
280
+ this.authenticator.updateForm({ name, value });
281
+ }
282
+ onSubmit(event) {
283
+ event.preventDefault();
284
+ this.authenticator.submitForm();
285
+ }
286
+ }
287
+ ConfirmResetPasswordComponent.decorators = [
288
+ { type: Component, args: [{
289
+ selector: 'amplify-confirm-reset-password',
290
+ 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=\"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 type=\"number\"\n autocomplete=\"one-time-code\"\n ></amplify-form-field>\n <amplify-form-field\n name=\"password\"\n label=\"New password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\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 {{ 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</div>\n"
291
+ },] }
292
+ ];
293
+ ConfirmResetPasswordComponent.ctorParameters = () => [
294
+ { type: AuthenticatorService }
295
+ ];
296
+ ConfirmResetPasswordComponent.propDecorators = {
297
+ dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-confirmsignin',] }],
298
+ headerText: [{ type: Input }]
299
+ };
300
+
301
+ const logger$1 = new Logger$1('ConfirmSignIn');
302
+ class ConfirmSignInComponent {
303
+ constructor(authenticator) {
304
+ this.authenticator = authenticator;
196
305
  this.dataAttr = '';
197
- this.customComponents = {};
198
- this.remoteError = '';
199
- this.isPending = false;
200
306
  this.confirmText = translate('Confirm');
201
307
  this.backToSignInText = translate('Back to Sign In');
202
308
  }
203
309
  ngOnInit() {
204
- this.authSubscription = this.stateMachine.authService.subscribe((state) => {
205
- this.onStateUpdate(state);
206
- });
207
310
  this.setHeaderText();
208
311
  }
209
- ngAfterContentInit() {
210
- this.customComponents = this.contextService.customComponents;
211
- }
212
- ngOnDestroy() {
213
- this.authSubscription.unsubscribe();
214
- }
215
312
  get context() {
216
- const { change, signIn, submit } = this.stateMachine.services;
217
- const remoteError = this.remoteError;
218
- return { change, remoteError, signIn, submit };
313
+ return this.authenticator.slotContext;
219
314
  }
220
315
  setHeaderText() {
221
- const state = this.stateMachine.authState;
316
+ const state = this.authenticator.authState;
222
317
  const actorContext = getActorContext(state);
223
318
  const { challengeName } = actorContext;
224
319
  switch (challengeName) {
225
320
  case AuthChallengeNames.SOFTWARE_TOKEN_MFA:
226
- // TODO: this string should be centralized and translated from ui.
227
321
  this.headerText = translate('Confirm TOTP Code');
228
322
  break;
229
323
  case AuthChallengeNames.SMS_MFA:
230
324
  this.headerText = translate('Confirm SMS Code');
231
325
  break;
232
326
  default:
233
- logger$3.error('Unexpected challengeName', challengeName);
327
+ logger$1.error('Unexpected challengeName', challengeName);
234
328
  }
235
329
  }
236
- onStateUpdate(state) {
237
- const actorState = getActorState(state);
238
- this.remoteError = actorState.context.remoteError;
239
- this.isPending = !actorState.matches('confirmSignIn.edit');
240
- }
241
330
  onInput(event) {
242
331
  event.preventDefault();
243
332
  const { name, value } = event.target;
244
- this.stateMachine.send({
245
- type: 'CHANGE',
246
- data: { name, value },
247
- });
333
+ this.authenticator.updateForm({ name, value });
248
334
  }
249
335
  onSubmit(event) {
250
336
  event.preventDefault();
251
- // TODO: handle form data within the state machine
252
- const formData = new FormData(event.target);
253
- this.stateMachine.send({
254
- type: 'SUBMIT',
255
- data: Object.fromEntries(formData),
256
- });
257
- }
258
- toSignIn() {
259
- this.stateMachine.send('SIGN_IN');
337
+ this.authenticator.submitForm();
260
338
  }
261
339
  }
262
- AmplifyConfirmSignInComponent.decorators = [
340
+ ConfirmSignInComponent.decorators = [
263
341
  { type: Component, args: [{
264
342
  selector: 'amplify-confirm-sign-in',
265
- template: "<!-- \n Define default contents here\n-->\n<ng-template #confirmSignInButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ confirmText }}\n </button>\n</ng-template>\n\n<ng-template #confirmSignInForm>\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]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ headerText }}</h3>\n <amplify-form-field\n name=\"confirmation_code\"\n type=\"number\"\n autocomplete=\"one-time-code\"\n ></amplify-form-field>\n\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmSignInButton || confirmSignInButton\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n </form>\n</ng-template>\n\n<!-- \n Render sign in component\n-->\n\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signInForm || confirmSignInForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
343
+ 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=\"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 type=\"text\"\n autocomplete=\"one-time-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</div>\n"
266
344
  },] }
267
345
  ];
268
- AmplifyConfirmSignInComponent.ctorParameters = () => [
269
- { type: StateMachineService },
270
- { type: AuthPropService }
346
+ ConfirmSignInComponent.ctorParameters = () => [
347
+ { type: AuthenticatorService }
271
348
  ];
272
- AmplifyConfirmSignInComponent.propDecorators = {
349
+ ConfirmSignInComponent.propDecorators = {
273
350
  dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-confirmsignin',] }]
274
351
  };
275
352
 
276
- class AmplifyConfirmSignUpComponent {
277
- constructor(stateMachine, contextService) {
278
- this.stateMachine = stateMachine;
279
- this.contextService = contextService;
280
- this.dataAttr = '';
353
+ class ConfirmSignUpComponent {
354
+ constructor(authenticator) {
355
+ this.authenticator = authenticator;
281
356
  this.headerText = translate('Confirm Sign Up');
282
- this.customComponents = {};
283
- this.remoteError = '';
284
- this.isPending = false;
357
+ this.dataAttr = '';
285
358
  // translated texts
286
359
  this.resendCodeText = translate('Resend Code');
287
- this.lostCodeText = translate('Lost your code? ');
288
360
  this.confirmText = translate('Confirm');
289
361
  }
290
- ngOnInit() {
291
- // TODO: alias for subscribe
292
- this.authSubscription = this.stateMachine.authService.subscribe((state) => this.onStateUpdate(state));
362
+ get context() {
363
+ return this.authenticator.slotContext;
293
364
  }
294
- ngAfterContentInit() {
295
- this.customComponents = this.contextService.customComponents;
365
+ onInput(event) {
366
+ event.preventDefault();
367
+ const { name, value } = event.target;
368
+ this.authenticator.updateForm({ name, value });
296
369
  }
297
- ngOnDestroy() {
298
- this.authSubscription.unsubscribe();
370
+ onSubmit(event) {
371
+ event.preventDefault();
372
+ this.authenticator.submitForm();
299
373
  }
300
- onStateUpdate(state) {
301
- const actorState = getActorState(state);
302
- this.remoteError = actorState.context.remoteError;
303
- this.isPending = !actorState.matches('confirmSignUp.edit');
374
+ }
375
+ ConfirmSignUpComponent.decorators = [
376
+ { type: Component, args: [{
377
+ selector: 'amplify-confirm-sign-up',
378
+ 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]=\"context.isPending\"\n >\n <amplify-slot name=\"confirm-sign-up-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 ></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</div>\n"
379
+ },] }
380
+ ];
381
+ ConfirmSignUpComponent.ctorParameters = () => [
382
+ { type: AuthenticatorService }
383
+ ];
384
+ ConfirmSignUpComponent.propDecorators = {
385
+ headerText: [{ type: Input }],
386
+ dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-confirmsignup',] }]
387
+ };
388
+
389
+ class ConfirmVerifyUserComponent {
390
+ constructor(authenticator) {
391
+ this.authenticator = authenticator;
392
+ this.dataAttr = '';
393
+ this.headerText = translate('Account recovery requires verified contact information');
394
+ // translated texts
395
+ this.skipText = translate('Skip');
396
+ this.submitText = translate('Submit');
304
397
  }
305
398
  get context() {
306
- const { change, resend, signIn, submit } = this.stateMachine.services;
307
- const remoteError = this.remoteError;
308
- const username = this.username;
309
- return { change, remoteError, resend, signIn, submit, username };
310
- }
311
- resend() {
312
- this.stateMachine.send({
313
- type: 'RESEND',
314
- data: {
315
- username: this.username,
316
- },
317
- });
399
+ return this.authenticator.slotContext;
318
400
  }
319
- onInput($event) {
320
- $event.preventDefault();
321
- const { name, value } = $event.target;
322
- this.stateMachine.send({
323
- type: 'CHANGE',
324
- data: { name, value },
325
- });
401
+ onInput(event) {
402
+ event.preventDefault();
403
+ const { name, value } = event.target;
404
+ this.authenticator.updateForm({ name, value });
326
405
  }
327
406
  onSubmit(event) {
328
407
  event.preventDefault();
329
- const state = this.stateMachine.authState;
330
- const actorContext = getActorContext(state);
331
- const { formValues } = actorContext;
332
- const { username, confirmation_code } = formValues;
333
- this.stateMachine.send({
334
- type: 'SUBMIT',
335
- data: { username, confirmation_code },
336
- });
408
+ this.authenticator.submitForm();
337
409
  }
338
410
  }
339
- AmplifyConfirmSignUpComponent.decorators = [
411
+ ConfirmVerifyUserComponent.decorators = [
340
412
  { type: Component, args: [{
341
- selector: 'amplify-confirm-sign-up',
342
- template: "<!-- \n Define default contents here\n-->\n<ng-template #confirmSignUpButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ confirmText }}\n </button>\n</ng-template>\n\n<ng-template #confirmSignUpForm>\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]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n <amplify-form-field\n name=\"confirmation_code\"\n type=\"number\"\n autocomplete=\"one-time-code\"\n ></amplify-form-field>\n\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmSignUpButton || confirmSignUpButton\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n <button amplify-button fontWeight=\"normal\" (click)=\"resend()\">\n {{ resendCodeText }}\n </button>\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 <ng-container\n [ngTemplateOutlet]=\"customComponents.confirmSignUpForm || confirmSignUpForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
413
+ selector: 'amplify-confirm-verify-user',
414
+ template: "<div data-amplify-container>\n <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 type=\"number\"\n autocomplete=\"one-time-code\"\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</div>\n"
343
415
  },] }
344
416
  ];
345
- AmplifyConfirmSignUpComponent.ctorParameters = () => [
346
- { type: StateMachineService },
347
- { type: AuthPropService }
417
+ ConfirmVerifyUserComponent.ctorParameters = () => [
418
+ { type: AuthenticatorService }
348
419
  ];
349
- AmplifyConfirmSignUpComponent.propDecorators = {
350
- dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-confirmsignup',] }],
420
+ ConfirmVerifyUserComponent.propDecorators = {
421
+ dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-confirmverifyuser',] }],
351
422
  headerText: [{ type: Input }]
352
423
  };
353
424
 
354
- class AmplifyFederatedSignInButtonComponent {
355
- constructor(stateMachine) {
356
- this.stateMachine = stateMachine;
425
+ class FederatedSignInButtonComponent {
426
+ constructor(authenticator) {
427
+ this.authenticator = authenticator;
357
428
  this.onClick = () => {
358
- this.stateMachine.send({
429
+ this.authenticator.send({
359
430
  type: 'FEDERATED_SIGN_IN',
360
431
  data: { provider: this.provider },
361
432
  });
362
433
  };
363
434
  }
364
435
  }
365
- AmplifyFederatedSignInButtonComponent.decorators = [
436
+ FederatedSignInButtonComponent.decorators = [
366
437
  { type: Component, args: [{
367
438
  selector: 'amplify-federated-sign-in-button',
368
- template: "<button\n amplify-button\n class=\"amplify-field-group__control federated-sign-in-button\"\n fullWidth=\"true\"\n fontWeight=\"normal\"\n style=\"display: block\"\n (click)=\"onClick()\"\n>\n <div\n class=\"amplify-flex federated-sign-in-button-row\"\n style=\"flex-direction: row; justify-content: center\"\n >\n <ng-content></ng-content>\n </div>\n</button>\n"
439
+ template: "<button\n amplify-button\n class=\"amplify-field-group__control federated-sign-in-button\"\n fullWidth=\"true\"\n fontWeight=\"normal\"\n style=\"display: block\"\n (click)=\"onClick()\"\n>\n <div\n class=\"amplify-flex federated-sign-in-button-row\"\n style=\"flex-direction: row; justify-content: center; align-items: center\"\n >\n <ng-content></ng-content>\n </div>\n</button>\n"
369
440
  },] }
370
441
  ];
371
- AmplifyFederatedSignInButtonComponent.ctorParameters = () => [
372
- { type: StateMachineService }
442
+ FederatedSignInButtonComponent.ctorParameters = () => [
443
+ { type: AuthenticatorService }
373
444
  ];
374
- AmplifyFederatedSignInButtonComponent.propDecorators = {
445
+ FederatedSignInButtonComponent.propDecorators = {
375
446
  provider: [{ type: Input }],
376
447
  text: [{ type: Input }]
377
448
  };
378
449
 
379
- class AmplifyFederatedSignInComponent {
380
- constructor(stateMachine) {
381
- this.stateMachine = stateMachine;
450
+ class FederatedSignInComponent {
451
+ constructor(authenticator) {
452
+ this.authenticator = authenticator;
382
453
  this.FederatedProviders = FederatedIdentityProviders;
454
+ this.includeAmazon = false;
455
+ this.includeApple = false;
383
456
  this.includeFacebook = false;
384
457
  this.includeGoogle = false;
385
- this.includeAmazon = false;
386
458
  this.shouldShowFederatedSignIn = false;
387
- // translated texts
388
- this.signInFacebookText = translate('Sign In with Facebook');
389
- this.signInGoogleText = translate('Sign In with Google');
390
- this.signInAmazonText = translate('Sign In with Amazon');
391
459
  }
392
460
  ngOnInit() {
393
- var _a, _b;
394
- const loginMechanisms = (_b = (_a = this.stateMachine.context) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.login_mechanisms;
395
- this.includeFacebook = loginMechanisms === null || loginMechanisms === void 0 ? void 0 : loginMechanisms.includes('facebook');
396
- this.includeGoogle = loginMechanisms === null || loginMechanisms === void 0 ? void 0 : loginMechanisms.includes('google');
397
- this.includeAmazon = loginMechanisms === null || loginMechanisms === void 0 ? void 0 : loginMechanisms.includes('amazon');
461
+ var _a;
462
+ const { socialProviders } = (_a = this.authenticator.context) === null || _a === void 0 ? void 0 : _a.config;
463
+ this.setFederatedTexts();
464
+ this.includeAmazon = socialProviders === null || socialProviders === void 0 ? void 0 : socialProviders.includes('amazon');
465
+ this.includeApple = socialProviders === null || socialProviders === void 0 ? void 0 : socialProviders.includes('apple');
466
+ this.includeGoogle = socialProviders === null || socialProviders === void 0 ? void 0 : socialProviders.includes('google');
467
+ this.includeFacebook = socialProviders === null || socialProviders === void 0 ? void 0 : socialProviders.includes('facebook');
398
468
  this.shouldShowFederatedSignIn =
399
- this.includeFacebook || this.includeGoogle || this.includeAmazon;
469
+ this.includeAmazon ||
470
+ this.includeApple ||
471
+ this.includeFacebook ||
472
+ this.includeGoogle;
473
+ }
474
+ setFederatedTexts() {
475
+ const { route } = this.authenticator;
476
+ const federatedText = route === 'signUp' ? 'Up' : 'In';
477
+ this.signInAmazonText = translate(`Sign ${federatedText} with Amazon`);
478
+ this.signInAppleText = translate(`Sign ${federatedText} with Apple`);
479
+ this.signInFacebookText = translate(`Sign ${federatedText} with Facebook`);
480
+ this.signInGoogleText = translate(`Sign ${federatedText} with Google`);
400
481
  }
401
482
  }
402
- AmplifyFederatedSignInComponent.decorators = [
483
+ FederatedSignInComponent.decorators = [
403
484
  { type: Component, args: [{
404
485
  selector: 'amplify-federated-sign-in',
405
- template: "<div\n class=\"amplify-flex federated-sign-in-container\"\n style=\"flex-direction: column\"\n *ngIf=\"shouldShowFederatedSignIn\"\n data-orientation=\"horizontal\"\n data-size=\"small\"\n>\n <hr\n class=\"amplify-divider\"\n aria-orientation=\"horizontal\"\n data-size=\"small\"\n style=\"margin: '1rem 0'\"\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 <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=\"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</div>\n"
486
+ 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 <div class=\"amplify-flex\" data-or-container>\n <div data-or-line>or</div>\n <hr\n class=\"amplify-divider\"\n aria-orientation=\"horizontal\"\n data-size=\"small\"\n />\n </div>\n</div>\n"
406
487
  },] }
407
488
  ];
408
- AmplifyFederatedSignInComponent.ctorParameters = () => [
409
- { type: StateMachineService }
489
+ FederatedSignInComponent.ctorParameters = () => [
490
+ { type: AuthenticatorService }
410
491
  ];
411
492
 
412
- const logger$2 = new Logger('ForceNewPassword');
413
- class AmplifyForceNewPasswordComponent {
414
- constructor(stateMachine, contextService) {
415
- this.stateMachine = stateMachine;
416
- this.contextService = contextService;
493
+ class ForceNewPasswordComponent {
494
+ constructor(authenticator) {
495
+ this.authenticator = authenticator;
417
496
  this.dataAttr = '';
418
497
  this.headerText = translate('Change Password');
419
- this.customComponents = {};
420
- this.remoteError = '';
421
- this.isPending = false;
422
498
  // translated texts
423
499
  this.changePasswordText = translate('Change Password');
424
500
  this.backToSignInText = translate('Back to Sign In');
425
501
  }
426
- ngOnInit() {
427
- this.authSubscription = this.stateMachine.authService.subscribe((state) => this.onStateUpdate(state));
428
- }
429
- ngAfterContentInit() {
430
- this.customComponents = this.contextService.customComponents;
431
- }
432
- ngOnDestroy() {
433
- logger$2.log('sign in destroyed, unsubscribing from state machine...');
434
- this.authSubscription.unsubscribe();
435
- }
436
- onStateUpdate(state) {
437
- const actorState = getActorState(state);
438
- this.remoteError = actorState.context.remoteError;
439
- this.isPending = actorState.matches({
440
- signUp: {
441
- submission: 'idle',
442
- },
443
- });
444
- }
445
502
  get context() {
446
- const { change, signIn, submit } = this.stateMachine.services;
447
- const user = this.stateMachine.user;
448
- const remoteError = this.remoteError;
449
- return { change, remoteError, signIn, submit, user };
450
- }
451
- toSignIn() {
452
- this.stateMachine.send('SIGN_IN');
503
+ return this.authenticator.slotContext;
453
504
  }
454
505
  onInput(event) {
455
506
  event.preventDefault();
456
507
  const { name, value } = event.target;
457
- this.stateMachine.send({
458
- type: 'CHANGE',
459
- data: { name, value },
460
- });
508
+ this.authenticator.updateForm({ name, value });
461
509
  }
462
510
  onSubmit(event) {
463
511
  event.preventDefault();
464
- // consider stateMachine directly providing actorState / actorContext
465
- const state = this.stateMachine.authState;
466
- const actorState = getActorContext(state);
467
- const { formValues } = actorState;
468
- this.stateMachine.send({
469
- type: 'SUBMIT',
470
- data: formValues,
471
- });
512
+ this.authenticator.submitForm();
472
513
  }
473
514
  }
474
- AmplifyForceNewPasswordComponent.decorators = [
515
+ ForceNewPasswordComponent.decorators = [
475
516
  { type: Component, args: [{
476
517
  selector: 'amplify-force-new-password',
477
- template: "<!-- \n Define default contents here\n-->\n<ng-template #forceNewPasswordSubmitButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ changePasswordText }}\n </button>\n</ng-template>\n\n<ng-template #signInForm>\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]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\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 <ng-container\n [ngTemplateOutlet]=\"\n customComponents.forceNewPasswordSubmitButton ||\n forceNewPasswordSubmitButton\n \"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n </form>\n</ng-template>\n\n<!-- \n Render force new password component\n-->\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signInForm || signInForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
518
+ 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"
478
519
  },] }
479
520
  ];
480
- AmplifyForceNewPasswordComponent.ctorParameters = () => [
481
- { type: StateMachineService },
482
- { type: AuthPropService }
521
+ ForceNewPasswordComponent.ctorParameters = () => [
522
+ { type: AuthenticatorService }
483
523
  ];
484
- AmplifyForceNewPasswordComponent.propDecorators = {
524
+ ForceNewPasswordComponent.propDecorators = {
485
525
  dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-forcenewpassword',] }],
486
526
  headerText: [{ type: Input }]
487
527
  };
488
528
 
489
- class AmplifyResetPasswordComponent {
490
- constructor(stateMachine, contextService) {
491
- this.stateMachine = stateMachine;
492
- this.contextService = contextService;
529
+ const getAttributeMap = () => authInputAttributes;
530
+
531
+ /**
532
+ * Input interface opinionated for authenticator usage.
533
+ *
534
+ * TODO: Separate this component out to two parts -- 1) amplify-auth-input that
535
+ * contains authenticator opinionated logic and 2) amplify-text-field primitive
536
+ * that does not make any auth-related inference.
537
+ */
538
+ class FormFieldComponent {
539
+ constructor(authenticator) {
540
+ this.authenticator = authenticator;
541
+ this.required = true;
542
+ this.placeholder = '';
543
+ this.label = '';
544
+ this.initialValue = '';
545
+ this.disabled = false;
546
+ this.autocomplete = '';
547
+ this.labelHidden = true;
548
+ this.countryDialCodes = countryDialCodes;
549
+ }
550
+ ngOnInit() {
551
+ // TODO: consider better default handling mechanisms across frameworks
552
+ if (this.isPhoneField()) {
553
+ const state = this.authenticator.authState;
554
+ const { country_code } = getActorContext(state);
555
+ this.defaultCountryCode = country_code;
556
+ // TODO: remove this side-effect
557
+ this.authenticator.updateForm({
558
+ name: 'country_code',
559
+ value: country_code,
560
+ });
561
+ }
562
+ }
563
+ get attributeMap() {
564
+ return getAttributeMap();
565
+ }
566
+ get error() {
567
+ const formContext = getActorContext(this.authenticator.authState);
568
+ const { validationError } = formContext;
569
+ return validationError[this.name];
570
+ }
571
+ inferLabel() {
572
+ var _a;
573
+ const label = this.label || ((_a = this.attributeMap[this.name]) === null || _a === void 0 ? void 0 : _a.label);
574
+ return translate(label);
575
+ }
576
+ inferPlaceholder() {
577
+ var _a;
578
+ const placeholder = this.placeholder || ((_a = this.attributeMap[this.name]) === null || _a === void 0 ? void 0 : _a.placeholder) ||
579
+ this.inferLabel();
580
+ return translate(placeholder);
581
+ }
582
+ // infers what the `type` of underlying input element should be.
583
+ inferType() {
584
+ var _a, _b, _c;
585
+ return (_c = (_a = this.type) !== null && _a !== void 0 ? _a : (_b = this.attributeMap[this.name]) === null || _b === void 0 ? void 0 : _b.type) !== null && _c !== void 0 ? _c : 'text';
586
+ }
587
+ inferAutocomplete() {
588
+ var _a;
589
+ return this.autocomplete || ((_a = this.attributeMap[this.name]) === null || _a === void 0 ? void 0 : _a.autocomplete);
590
+ }
591
+ // TODO(enhancement): use enum to differentiate special field types
592
+ isPasswordField() {
593
+ return this.inferType() === 'password';
594
+ }
595
+ isPhoneField() {
596
+ return this.inferType() === 'tel';
597
+ }
598
+ }
599
+ FormFieldComponent.decorators = [
600
+ { type: Component, args: [{
601
+ selector: 'amplify-form-field',
602
+ 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]=\"defaultCountryCode\"\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 ></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"
603
+ },] }
604
+ ];
605
+ FormFieldComponent.ctorParameters = () => [
606
+ { type: AuthenticatorService }
607
+ ];
608
+ FormFieldComponent.propDecorators = {
609
+ name: [{ type: Input }],
610
+ type: [{ type: Input }],
611
+ required: [{ type: Input }],
612
+ placeholder: [{ type: Input }],
613
+ label: [{ type: Input }],
614
+ initialValue: [{ type: Input }],
615
+ disabled: [{ type: Input }],
616
+ autocomplete: [{ type: Input }],
617
+ labelHidden: [{ type: Input }]
618
+ };
619
+
620
+ class ResetPasswordComponent {
621
+ constructor(authenticator) {
622
+ this.authenticator = authenticator;
493
623
  this.dataAttr = '';
494
624
  this.headerText = translate('Reset your password');
495
- this.customComponents = {};
496
- this.remoteError = '';
497
- this.isPending = false;
498
625
  // translated texts
499
626
  this.sendCodeText = translate('Send Code');
500
627
  this.backToSignInText = translate('Back to Sign In');
628
+ this.labelText = translate('Username');
501
629
  }
502
630
  ngOnInit() {
503
- this.authSubscription = this.stateMachine.authService.subscribe((state) => this.onStateUpdate(state));
504
- }
505
- ngAfterContentInit() {
506
- this.customComponents = this.contextService.customComponents;
507
- }
508
- ngOnDestroy() {
509
- this.authSubscription.unsubscribe();
510
- }
511
- onStateUpdate(state) {
512
- const actorState = getActorState(state);
513
- this.remoteError = actorState.context.remoteError;
514
- this.isPending = !actorState.matches('resetPassword.edit');
631
+ const { authState } = this.authenticator;
632
+ const { label } = getAliasInfoFromContext(authState.context);
633
+ this.labelText = `Enter your ${label.toLowerCase()}`;
515
634
  }
516
635
  get context() {
517
- const { change, signIn, submit } = this.stateMachine.services;
518
- const remoteError = this.remoteError;
519
- return { change, remoteError, signIn, submit };
520
- }
521
- toSignIn() {
522
- this.stateMachine.send('SIGN_IN');
636
+ return this.authenticator.slotContext;
523
637
  }
524
638
  onInput(event) {
525
639
  event.preventDefault();
526
640
  const { name, value } = event.target;
527
- this.stateMachine.send({
528
- type: 'CHANGE',
529
- data: { name, value },
530
- });
641
+ this.authenticator.updateForm({ name, value });
531
642
  }
532
643
  onSubmit(event) {
533
644
  event.preventDefault();
534
- this.stateMachine.send('SUBMIT');
645
+ this.authenticator.submitForm();
535
646
  }
536
647
  }
537
- AmplifyResetPasswordComponent.decorators = [
648
+ ResetPasswordComponent.decorators = [
538
649
  { type: Component, args: [{
539
650
  selector: 'amplify-reset-password',
540
- template: "<!-- \n Define default contents here\n-->\n<ng-template #resetPasswordSubmitButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ sendCodeText }}\n </button>\n</ng-template>\n\n<ng-template #resetPasswordForm>\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]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n <amplify-form-field\n name=\"username\"\n type=\"username\"\n autocomplete=\"username\"\n ></amplify-form-field>\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.resetPasswordSubmitButton ||\n resetPasswordSubmitButton\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n </form>\n</ng-template>\n\n<!-- \n Render reset passsword component\n-->\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.resetPasswordForm || resetPasswordForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
651
+ 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\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 [placeholder]=\"labelText\"\n [label]=\"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</div>\n"
541
652
  },] }
542
653
  ];
543
- AmplifyResetPasswordComponent.ctorParameters = () => [
544
- { type: StateMachineService },
545
- { type: AuthPropService }
654
+ ResetPasswordComponent.ctorParameters = () => [
655
+ { type: AuthenticatorService }
546
656
  ];
547
- AmplifyResetPasswordComponent.propDecorators = {
657
+ ResetPasswordComponent.propDecorators = {
548
658
  dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-resetPassword',] }],
549
659
  headerText: [{ type: Input }]
550
660
  };
551
661
 
552
- const logger$1 = new Logger('SetupTotp');
553
- class AmplifySetupTotpComponent {
554
- constructor(stateMachine, contextService) {
555
- this.stateMachine = stateMachine;
556
- this.contextService = contextService;
557
- this.customComponents = {};
558
- this.remoteError = '';
559
- this.isPending = false;
662
+ const logger = new Logger$1('SetupTotp');
663
+ class SetupTotpComponent {
664
+ constructor(authenticator) {
665
+ this.authenticator = authenticator;
666
+ this.dataAttr = '';
560
667
  this.headerText = translate('Setup TOTP');
561
668
  this.qrCodeSource = '';
562
669
  // translated texts
@@ -564,449 +671,234 @@ class AmplifySetupTotpComponent {
564
671
  this.confirmText = translate('Confirm');
565
672
  }
566
673
  ngOnInit() {
567
- this.authSubscription = this.stateMachine.authService.subscribe((state) => {
568
- this.onStateUpdate(state);
569
- });
570
674
  this.generateQRCode();
571
675
  }
572
- ngAfterContentInit() {
573
- this.customComponents = this.contextService.customComponents;
574
- }
575
- ngOnDestroy() {
576
- this.authSubscription.unsubscribe();
577
- }
578
- onStateUpdate(state) {
579
- const actorState = getActorState(state);
580
- this.remoteError = actorState.context.remoteError;
581
- this.isPending = !actorState.matches('setupTOTP.edit');
582
- }
583
676
  get context() {
584
- const { change, submit } = this.stateMachine.services;
585
- const remoteError = this.remoteError;
586
- const user = this.stateMachine.user;
587
- return { change, remoteError, submit, user };
677
+ return this.authenticator.slotContext;
588
678
  }
589
679
  generateQRCode() {
590
- var _a;
591
680
  return __awaiter(this, void 0, void 0, function* () {
592
681
  // TODO: This should be handled in core.
593
- const state = this.stateMachine.authState;
682
+ const state = this.authenticator.authState;
594
683
  const actorContext = getActorContext(state);
595
684
  const { user } = actorContext;
596
685
  try {
597
686
  const secretKey = yield Auth.setupTOTP(user);
598
687
  const issuer = 'AWSCognito';
599
688
  const totpCode = `otpauth://totp/${issuer}:${user.username}?secret=${secretKey}&issuer=${issuer}`;
600
- logger$1.info('totp code was generated:', totpCode);
689
+ logger.info('totp code was generated:', totpCode);
601
690
  this.qrCodeSource = yield QRCode.toDataURL(totpCode);
602
691
  }
603
692
  catch (err) {
604
- this.remoteError = (_a = err.message) !== null && _a !== void 0 ? _a : err;
605
- logger$1.error(err);
693
+ logger.error(err);
606
694
  }
607
695
  });
608
696
  }
609
697
  onInput(event) {
610
698
  event.preventDefault();
611
699
  const { name, value } = event.target;
612
- this.stateMachine.send({
613
- type: 'CHANGE',
614
- data: { name, value },
615
- });
700
+ this.authenticator.updateForm({ name, value });
616
701
  }
617
702
  onSubmit(event) {
618
703
  event.preventDefault();
619
- // TODO: handle form data within the state machine
620
- const formData = new FormData(event.target);
621
- this.stateMachine.send({
622
- type: 'SUBMIT',
623
- data: Object.fromEntries(formData),
624
- });
625
- }
626
- toSignIn() {
627
- this.stateMachine.send('SIGN_IN');
704
+ this.authenticator.submitForm();
628
705
  }
629
706
  }
630
- AmplifySetupTotpComponent.decorators = [
707
+ SetupTotpComponent.decorators = [
631
708
  { type: Component, args: [{
632
709
  selector: 'amplify-setup-totp',
633
- template: "<!-- \n Define default contents here\n-->\n<ng-template #setupTotpButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ confirmText }}\n </button>\n</ng-template>\n\n<ng-template #setupTotpForm>\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]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n <p *ngIf=\"!qrCodeSource\">Loading...</p>\n <img *ngIf=\"qrCodeSource\" [src]=\"qrCodeSource\" alt=\"qr code\" />\n <amplify-form-field\n name=\"confirmation_code\"\n type=\"number\"\n autocomplete=\"one-time-code\"\n ></amplify-form-field>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.setupTotpButton || setupTotpButton\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"toSignIn()\"\n >\n {{ backToSignInText }}\n </button>\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n </form>\n</ng-template>\n\n<!-- \n Render sign in component\n-->\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.setupTotpForm || setupTotpForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
710
+ 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=\"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 <amplify-form-field\n name=\"confirmation_code\"\n label=\"Code *\"\n type=\"text\"\n autocomplete=\"one-time-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</div>\n"
634
711
  },] }
635
712
  ];
636
- AmplifySetupTotpComponent.ctorParameters = () => [
637
- { type: StateMachineService },
638
- { type: AuthPropService }
713
+ SetupTotpComponent.ctorParameters = () => [
714
+ { type: AuthenticatorService }
639
715
  ];
640
- AmplifySetupTotpComponent.propDecorators = {
641
- customComponents: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-setup-totp',] }]
716
+ SetupTotpComponent.propDecorators = {
717
+ dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-setup-totp',] }]
642
718
  };
643
719
 
644
- const logger = new Logger('SignIn');
645
- class AmplifySignInComponent {
646
- constructor(stateMachine, contextService) {
647
- this.stateMachine = stateMachine;
648
- this.contextService = contextService;
720
+ class SignInComponent {
721
+ constructor(authenticator) {
722
+ this.authenticator = authenticator;
649
723
  this.dataAttr = '';
650
- this.headerText = translate('Sign in to your account');
651
- this.customComponents = {};
652
- this.remoteError = '';
653
- this.isPending = false;
654
724
  // translated phrases
655
725
  this.forgotPasswordText = translate('Forgot your password? ');
656
726
  this.signInButtonText = translate('Sign in');
657
- this.noAccountText = translate('No account? ');
658
- }
659
- ngOnInit() {
660
- this.authSubscription = this.stateMachine.authService.subscribe((state) => this.onStateUpdate(state));
661
- }
662
- ngAfterContentInit() {
663
- this.customComponents = this.contextService.customComponents;
664
- }
665
- ngOnDestroy() {
666
- logger.log('sign in destroyed, unsubscribing from state machine...');
667
- this.authSubscription.unsubscribe();
668
- }
669
- onStateUpdate(state) {
670
- const actorState = getActorState(state);
671
- this.remoteError = actorState.context.remoteError;
672
- this.isPending = !actorState.matches('signIn.edit');
673
727
  }
674
728
  get context() {
675
- const { change, resetPassword, signUp, submit } = this.stateMachine.services;
676
- const remoteError = this.remoteError;
677
- return { change, remoteError, resetPassword, signUp, submit };
678
- }
679
- toResetPassword() {
680
- this.stateMachine.send('RESET_PASSWORD');
729
+ return this.authenticator.slotContext;
681
730
  }
682
731
  onInput(event) {
683
732
  event.preventDefault();
684
733
  const { name, value } = event.target;
685
- this.stateMachine.send({
686
- type: 'CHANGE',
687
- data: { name, value },
688
- });
734
+ this.authenticator.updateForm({ name, value });
689
735
  }
690
736
  onSubmit(event) {
691
- return __awaiter(this, void 0, void 0, function* () {
692
- event.preventDefault();
693
- this.stateMachine.send({
694
- type: 'SUBMIT',
695
- });
696
- });
737
+ event.preventDefault();
738
+ this.authenticator.submitForm();
697
739
  }
698
740
  }
699
- AmplifySignInComponent.decorators = [
741
+ SignInComponent.decorators = [
700
742
  { type: Component, args: [{
701
743
  selector: 'amplify-sign-in',
702
- template: "<!-- \n Define default contents here\n-->\n<ng-template #signInButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ signInButtonText }}\n </button>\n</ng-template>\n\n<ng-template #signInForm>\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]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n <amplify-user-name-alias></amplify-user-name-alias>\n <amplify-form-field\n data-amplify-password\n name=\"password\"\n type=\"password\"\n autocomplete=\"current-password\"\n ></amplify-form-field>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signInButton || signInButton\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n <button\n amplify-button\n fontWeight=\"normal\"\n size=\"small\"\n variation=\"link\"\n (click)=\"toResetPassword()\"\n >\n {{ forgotPasswordText }}\n </button>\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n <amplify-federated-sign-in></amplify-federated-sign-in>\n </form>\n</ng-template>\n\n<!-- \n Render sign in component\n-->\n\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signInForm || signInForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n",
744
+ template: "<div data-amplify-container>\n <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></amplify-user-name-alias>\n <amplify-form-field\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</div>\n",
703
745
  encapsulation: ViewEncapsulation.None
704
746
  },] }
705
747
  ];
706
- AmplifySignInComponent.ctorParameters = () => [
707
- { type: StateMachineService },
708
- { type: AuthPropService }
748
+ SignInComponent.ctorParameters = () => [
749
+ { type: AuthenticatorService }
709
750
  ];
710
- AmplifySignInComponent.propDecorators = {
711
- dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-signin',] }],
712
- headerText: [{ type: Input }]
751
+ SignInComponent.propDecorators = {
752
+ dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-signin',] }]
713
753
  };
714
754
 
715
- class AmplifySignUpComponent {
716
- constructor(stateMachine, contextService) {
717
- this.stateMachine = stateMachine;
718
- this.contextService = contextService;
755
+ class SignUpComponent {
756
+ constructor(authenticator) {
757
+ this.authenticator = authenticator;
719
758
  this.dataAttr = '';
720
- this.headerText = translate('Create a new account');
721
- this.remoteError = '';
722
- this.isPending = false;
723
- this.primaryAlias = '';
724
- this.secondaryAliases = [];
725
- this.validationError = {};
726
759
  // translated texts
727
760
  this.createAccountText = translate('Create Account');
728
761
  }
729
762
  get context() {
730
- const { change, signIn, submit } = this.stateMachine.services;
731
- const remoteError = this.remoteError;
732
- const validationError = this.validationError;
733
- return {
734
- change,
735
- remoteError,
736
- signIn,
737
- submit,
738
- validationError,
739
- };
740
- }
741
- ngOnInit() {
742
- this.authSubscription = this.stateMachine.authService.subscribe((state) => this.onStateUpdate(state));
743
- const context = this.stateMachine.context;
744
- const { primaryAlias, secondaryAliases } = getConfiguredAliases(context);
745
- /**
746
- * If the login_mechanisms are configured to use ONLY username, we need
747
- * to ask for some sort of secondary contact information in order to
748
- * verify the user for Cognito. Currently matching this to how Vue is
749
- * set up.
750
- */
751
- if (primaryAlias === 'username' && isEmpty(secondaryAliases)) {
752
- secondaryAliases.push('email', 'phone_number');
753
- }
754
- console.log(secondaryAliases);
755
- this.primaryAlias = primaryAlias;
756
- this.secondaryAliases = secondaryAliases;
757
- }
758
- ngAfterContentInit() {
759
- this.customComponents = this.contextService.customComponents;
760
- }
761
- ngOnDestroy() {
762
- this.authSubscription.unsubscribe();
763
- }
764
- onStateUpdate(state) {
765
- const actorState = getActorState(state);
766
- const actorContext = getActorContext(state);
767
- this.remoteError = actorContext.remoteError;
768
- this.validationError = actorContext.validationError;
769
- this.isPending = !actorState.matches({
770
- signUp: {
771
- submission: 'idle',
772
- },
773
- });
774
- }
775
- onSubmit($event) {
776
- return __awaiter(this, void 0, void 0, function* () {
777
- $event.preventDefault();
778
- this.stateMachine.send('SUBMIT');
779
- });
763
+ return this.authenticator.slotContext;
780
764
  }
781
765
  onInput(event) {
766
+ let { checked, name, type, value } = event.target;
767
+ if (type === 'checkbox' && !checked)
768
+ value = undefined;
769
+ this.authenticator.updateForm({ name, value });
770
+ }
771
+ onSubmit(event) {
782
772
  event.preventDefault();
783
- const { name, value } = event.target;
784
- this.stateMachine.send({
785
- type: 'CHANGE',
786
- data: { name, value },
787
- });
773
+ this.authenticator.submitForm();
788
774
  }
789
775
  }
790
- AmplifySignUpComponent.decorators = [
776
+ SignUpComponent.decorators = [
791
777
  { type: Component, args: [{
792
778
  selector: 'amplify-sign-up',
793
- template: "<ng-template #signUpButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ createAccountText }}\n </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-field\n name=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n</ng-template>\n\n<ng-template #signUpConfirmPassword>\n <amplify-form-field\n name=\"confirm_password\"\n label=\"Confirm Password\"\n type=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n</ng-template>\n\n<ng-template #signUpFieldset>\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\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-field [name]=\"secondaryAlias\"></amplify-form-field>\n </ng-container>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.signUpButton || signUpButton\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n <amplify-federated-sign-in></amplify-federated-sign-in>\n</ng-template>\n\n<div data-amplify-container>\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 </form>\n</div>\n"
779
+ template: "<amplify-slot name=\"sign-up-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 <div class=\"amplify-flex\" style=\"flex-direction: column\">\n <div class=\"amplify-flex\" style=\"flex-direction: column\">\n <amplify-slot name=\"sign-up-form-fields\" [context]=\"context\">\n <amplify-sign-up-form-fields></amplify-sign-up-form-fields>\n </amplify-slot>\n\n <amplify-error *ngIf=\"authenticator.error\">\n {{ authenticator.error }}\n </amplify-error>\n </div>\n\n <amplify-slot name=\"sign-up-button\" [context]=\"context\">\n <button\n [disabled]=\"\n authenticator.isPending || authenticator.hasValidationErrors\n \"\n amplify-button\n variation=\"primary\"\n fullWidth=\"true\"\n type=\"submit\"\n >\n {{ createAccountText }}\n </button>\n </amplify-slot>\n </div>\n</form>\n\n<amplify-slot name=\"sign-up-footer\" [context]=\"context\"> </amplify-slot>\n"
794
780
  },] }
795
781
  ];
796
- AmplifySignUpComponent.ctorParameters = () => [
797
- { type: StateMachineService },
798
- { type: AuthPropService }
782
+ SignUpComponent.ctorParameters = () => [
783
+ { type: AuthenticatorService }
799
784
  ];
800
- AmplifySignUpComponent.propDecorators = {
801
- dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-signup',] }],
802
- headerText: [{ type: Input }]
785
+ SignUpComponent.propDecorators = {
786
+ dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-signup',] }]
803
787
  };
804
788
 
805
- const getAttributeMap = () => authInputAttributes;
806
-
807
- class AmplifyVerifyUserComponent {
808
- constructor(stateMachine, contextService) {
809
- this.stateMachine = stateMachine;
810
- this.contextService = contextService;
811
- this.dataAttr = '';
812
- this.headerText = translate('Account recovery requires verified contact information');
813
- this.customComponents = {};
814
- this.unverifiedAttributes = {};
815
- this.remoteError = '';
816
- this.isPending = false;
817
- this.labelId = nanoid(12);
818
- // translated texts
819
- this.skipText = translate('Skip');
820
- this.verifyText = translate('Verify');
789
+ class SignUpFormFieldsComponent {
790
+ constructor(authenticator) {
791
+ this.authenticator = authenticator;
792
+ this.primaryAlias = '';
793
+ this.secondaryAliases = [];
821
794
  }
822
795
  ngOnInit() {
823
- this.authSubscription = this.stateMachine.authService.subscribe((state) => this.onStateUpdate(state));
824
- }
825
- ngAfterContentInit() {
826
- this.customComponents = this.contextService.customComponents;
827
- }
828
- ngOnDestroy() {
829
- this.authSubscription.unsubscribe();
830
- }
831
- onStateUpdate(state) {
832
- const actorState = getActorState(state);
833
- this.unverifiedAttributes = actorState.context.unverifiedAttributes;
834
- this.remoteError = actorState.context.remoteError;
835
- this.isPending = !actorState.matches('verifyUser.edit');
836
- }
837
- get context() {
838
- const { change, skip, submit } = this.stateMachine.services;
839
- const remoteError = this.remoteError;
840
- return { change, remoteError, skip, submit };
841
- }
842
- skipVerify() {
843
- this.stateMachine.send('SKIP');
844
- }
845
- getLabelForAttr(authAttr) {
846
- var _a;
847
- const attributeMap = getAttributeMap();
848
- const label = (_a = attributeMap[authAttr]) === null || _a === void 0 ? void 0 : _a.label;
849
- return translate(label);
850
- }
851
- onSubmit(event) {
852
- return __awaiter(this, void 0, void 0, function* () {
853
- event.preventDefault();
854
- const formData = new FormData(event.target);
855
- this.stateMachine.send({
856
- type: 'SUBMIT',
857
- data: Object.fromEntries(formData),
858
- });
796
+ const context = this.authenticator.context;
797
+ const { loginMechanisms, signUpAttributes } = context.config;
798
+ this.fieldNames = Array.from(new Set([...loginMechanisms, ...signUpAttributes]));
799
+ this.fieldNames = this.fieldNames.filter((fieldName) => {
800
+ const hasDefaultField = !!authInputAttributes[fieldName];
801
+ if (!hasDefaultField) {
802
+ console.debug(`Authenticator does not have a default implementation for ${fieldName}. Customize Authenticator.SignUp.FormFields to add your own.`);
803
+ }
804
+ return hasDefaultField;
859
805
  });
806
+ // Only 1 is supported, so `['email', 'phone_number']` will only show `email`
807
+ this.loginMechanism = this.fieldNames.shift();
860
808
  }
861
809
  }
862
- AmplifyVerifyUserComponent.decorators = [
810
+ SignUpFormFieldsComponent.decorators = [
863
811
  { type: Component, args: [{
864
- selector: 'amplify-verify-user',
865
- template: "<!-- \n Define default contents here\n-->\n<ng-template #verifyButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ verifyText }}\n </button>\n</ng-template>\n\n<ng-template #verifyUserForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n\n <div *ngFor=\"let unverifiedAttribute of unverifiedAttributes | keyvalue\">\n <!-- TODO: match React implementation -->\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 <ng-container\n [ngTemplateOutlet]=\"customComponents.verifyButton || verifyButton\"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"skipVerify()\"\n >\n {{ skipText }}\n </button>\n\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n </form>\n</ng-template>\n\n<!-- \n Render verify user component\n-->\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"customComponents.verifyUserForm || verifyUserForm\"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n",
866
- encapsulation: ViewEncapsulation.None
812
+ selector: 'amplify-sign-up-form-fields',
813
+ template: "<div class=\"amplify-flex\" style=\"flex-direction: column\" data-amplify-fieldset>\n <amplify-user-name-alias [name]=\"loginMechanism\"></amplify-user-name-alias>\n <amplify-form-field\n name=\"password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\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 <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"
867
814
  },] }
868
815
  ];
869
- AmplifyVerifyUserComponent.ctorParameters = () => [
870
- { type: StateMachineService },
871
- { type: AuthPropService }
816
+ SignUpFormFieldsComponent.ctorParameters = () => [
817
+ { type: AuthenticatorService }
872
818
  ];
873
- AmplifyVerifyUserComponent.propDecorators = {
874
- dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-verifyuser',] }],
875
- headerText: [{ type: Input }]
876
- };
877
819
 
878
- class ConfirmResetPasswordComponent {
879
- constructor(stateMachine, contextService) {
880
- this.stateMachine = stateMachine;
881
- this.contextService = contextService;
882
- this.dataAttr = '';
883
- this.headerText = translate('Reset your password');
884
- this.customComponents = {};
885
- this.remoteError = '';
886
- this.isPending = false;
887
- // translated strings
888
- this.sendCodeText = translate('Send Code');
889
- this.backToSignInText = translate('Back to Sign In');
890
- this.lostCodeText = translate('Lost your code? ');
891
- this.resendCodeText = translate('Resend Code');
820
+ class UserNameAliasComponent {
821
+ constructor(authenticator) {
822
+ this.authenticator = authenticator;
823
+ this.name = 'username';
824
+ this.disabled = false;
825
+ this.initialValue = '';
826
+ this.required = true;
892
827
  }
893
828
  ngOnInit() {
894
- this.authSubscription = this.stateMachine.authService.subscribe((state) => this.onStateUpdate(state));
895
- }
896
- ngAfterContentInit() {
897
- this.customComponents = this.contextService.customComponents;
898
- }
899
- ngOnDestroy() {
900
- this.authSubscription.unsubscribe();
901
- }
902
- onStateUpdate(state) {
903
- const actorState = getActorState(state);
904
- this.remoteError = actorState.context.remoteError;
905
- this.isPending = !actorState.matches('confirmResetPassword.edit');
906
- }
907
- get context() {
908
- const { change, resend, signIn, submit } = this.stateMachine.services;
909
- const remoteError = this.remoteError;
910
- return { change, resend, remoteError, signIn, submit };
911
- }
912
- toSignIn() {
913
- this.stateMachine.send('SIGN_IN');
914
- }
915
- resend() {
916
- this.stateMachine.send('RESEND');
917
- }
918
- onInput(event) {
919
- event.preventDefault();
920
- const { name, value } = event.target;
921
- this.stateMachine.send({
922
- type: 'CHANGE',
923
- data: { name, value },
924
- });
925
- }
926
- onSubmit(event) {
927
- return __awaiter(this, void 0, void 0, function* () {
928
- event.preventDefault();
929
- this.stateMachine.send('SUBMIT');
930
- });
829
+ const context = this.authenticator.context;
830
+ const { label, type } = getAliasInfoFromContext(context);
831
+ this.label = label;
832
+ this.type = type;
833
+ this.placeholder = label;
931
834
  }
932
835
  }
933
- ConfirmResetPasswordComponent.decorators = [
836
+ UserNameAliasComponent.decorators = [
934
837
  { type: Component, args: [{
935
- selector: 'amplify-confirm-reset-password',
936
- template: "<!-- \n Define default contents here\n-->\n<ng-template #confirmResetPasswordSubmitButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ sendCodeText }}\n </button>\n</ng-template>\n<ng-template #confirmResetPasswordForm>\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]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ headerText }}</h3>\n <amplify-form-field\n name=\"confirmation_code\"\n type=\"number\"\n autocomplete=\"one-time-code\"\n ></amplify-form-field>\n <amplify-form-field\n name=\"password\"\n label=\"New password\"\n autocomplete=\"new-password\"\n ></amplify-form-field>\n\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmResetPasswordSubmitButton ||\n confirmResetPasswordSubmitButton\n \"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n type=\"button\"\n (click)=\"resend()\"\n >\n {{ resendCodeText }}\n </button>\n\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n </form>\n</ng-template>\n\n<!-- \n Render confirm reset password component\n-->\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmResetPasswordForm || confirmResetPasswordForm\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
838
+ selector: 'amplify-user-name-alias',
839
+ template: "<amplify-form-field\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-field>\n"
937
840
  },] }
938
841
  ];
939
- ConfirmResetPasswordComponent.ctorParameters = () => [
940
- { type: StateMachineService },
941
- { type: AuthPropService }
842
+ UserNameAliasComponent.ctorParameters = () => [
843
+ { type: AuthenticatorService }
942
844
  ];
943
- ConfirmResetPasswordComponent.propDecorators = {
944
- dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-confirmsignin',] }],
945
- headerText: [{ type: Input }]
845
+ UserNameAliasComponent.propDecorators = {
846
+ name: [{ type: Input }],
847
+ disabled: [{ type: Input }],
848
+ initialValue: [{ type: Input }],
849
+ required: [{ type: Input }]
946
850
  };
947
851
 
948
- class ConfirmVerifyUserComponent {
949
- constructor(stateMachine, contextService) {
950
- this.stateMachine = stateMachine;
951
- this.contextService = contextService;
852
+ class VerifyUserComponent {
853
+ constructor(authenticator) {
854
+ this.authenticator = authenticator;
952
855
  this.dataAttr = '';
953
856
  this.headerText = translate('Account recovery requires verified contact information');
954
- this.customComponents = {};
955
- this.remoteError = '';
956
- this.isPending = false;
857
+ this.unverifiedAttributes = {};
858
+ this.labelId = nanoid(12);
957
859
  // translated texts
958
860
  this.skipText = translate('Skip');
959
- this.submitText = translate('Submit');
861
+ this.verifyText = translate('Verify');
960
862
  }
961
863
  ngOnInit() {
962
- this.authSubscription = this.stateMachine.authService.subscribe((state) => this.onStateUpdate(state));
963
- }
964
- ngAfterContentInit() {
965
- this.customComponents = this.contextService.customComponents;
966
- }
967
- ngOnDestroy() {
968
- this.authSubscription.unsubscribe();
969
- }
970
- onStateUpdate(state) {
971
- const actorState = getActorState(state);
972
- this.remoteError = actorState.context.remoteError;
973
- this.isPending = !actorState.matches('confirmVerifyUser.edit');
864
+ const actorState = getActorState(this.authenticator.authState);
865
+ this.unverifiedAttributes = actorState.context.unverifiedAttributes;
974
866
  }
975
867
  get context() {
976
- const { skip, submit } = this.stateMachine.services;
977
- const remoteError = this.remoteError;
978
- return { remoteError, skip, submit };
868
+ return this.authenticator.slotContext;
869
+ }
870
+ getLabelForAttr(authAttr) {
871
+ var _a;
872
+ const attributeMap = getAttributeMap();
873
+ const label = (_a = attributeMap[authAttr]) === null || _a === void 0 ? void 0 : _a.label;
874
+ return translate(label);
979
875
  }
980
- skipVerify() {
981
- this.stateMachine.send('SKIP');
876
+ onInput(event) {
877
+ event.preventDefault();
878
+ const { name, value } = event.target;
879
+ this.authenticator.updateForm({ name, value });
982
880
  }
983
881
  onSubmit(event) {
984
- return __awaiter(this, void 0, void 0, function* () {
985
- event.preventDefault();
986
- const formData = new FormData(event.target);
987
- this.stateMachine.send({
988
- type: 'SUBMIT',
989
- data: Object.fromEntries(formData),
990
- });
991
- });
882
+ event.preventDefault();
883
+ this.authenticator.submitForm();
992
884
  }
993
885
  }
994
- ConfirmVerifyUserComponent.decorators = [
886
+ VerifyUserComponent.decorators = [
995
887
  { type: Component, args: [{
996
- selector: 'amplify-confirm-verify-user',
997
- template: "<!-- \n Define default contents here\n-->\n<ng-template #confirmVerifyButton>\n <button amplify-button variation=\"primary\" fullWidth=\"true\" type=\"submit\">\n {{ submitText }}\n </button>\n</ng-template>\n\n<ng-template #confirmVerifyUserForm>\n <form data-amplify-form (submit)=\"onSubmit($event)\">\n <fieldset\n class=\"amplify-flex\"\n style=\"flex-direction: column\"\n data-amplify-fieldset\n [disabled]=\"isPending\"\n >\n <h3 class=\"amplify-heading\">{{ this.headerText }}</h3>\n <amplify-form-field\n name=\"confirmation_code\"\n type=\"number\"\n autocomplete=\"one-time-code\"\n ></amplify-form-field>\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmVerifyButton || confirmVerifyButton\n \"\n [ngTemplateOutletContext]=\"context\"\n ></ng-container>\n\n <button\n amplify-button\n size=\"small\"\n variation=\"link\"\n fontWeight=\"normal\"\n fullWidth=\"true\"\n (click)=\"skipVerify()\"\n >\n {{ skipText }}\n </button>\n <amplify-error *ngIf=\"remoteError\">\n {{ remoteError }}\n </amplify-error>\n </fieldset>\n </form>\n</ng-template>\n\n<!-- \n Render confirm reset password component\n-->\n<div data-amplify-container>\n <ng-container\n [ngTemplateOutlet]=\"\n customComponents.confirmVerifyUserForm || confirmVerifyUserForm\n \"\n [ngTemplateOutletContext]=\"context\"\n >\n </ng-container>\n</div>\n"
888
+ selector: 'amplify-verify-user',
889
+ template: "<div data-amplify-container>\n <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</div>\n",
890
+ encapsulation: ViewEncapsulation.None
998
891
  },] }
999
892
  ];
1000
- ConfirmVerifyUserComponent.ctorParameters = () => [
1001
- { type: StateMachineService },
1002
- { type: AuthPropService }
893
+ VerifyUserComponent.ctorParameters = () => [
894
+ { type: AuthenticatorService }
1003
895
  ];
1004
- ConfirmVerifyUserComponent.propDecorators = {
1005
- dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-confirmverifyuser',] }],
896
+ VerifyUserComponent.propDecorators = {
897
+ dataAttr: [{ type: HostBinding, args: ['attr.data-amplify-authenticator-verifyuser',] }],
1006
898
  headerText: [{ type: Input }]
1007
899
  };
1008
900
 
1009
- class AmplifyButtonComponent {
901
+ class ButtonComponent {
1010
902
  constructor() {
1011
903
  this.type = 'button';
1012
904
  this.fullWidth = false;
@@ -1023,13 +915,13 @@ class AmplifyButtonComponent {
1023
915
  this.fontWeightAttr = this.fontWeight;
1024
916
  }
1025
917
  }
1026
- AmplifyButtonComponent.decorators = [
918
+ ButtonComponent.decorators = [
1027
919
  { type: Component, args: [{
1028
920
  selector: 'button[amplify-button]',
1029
921
  template: "<ng-content></ng-content>\n"
1030
922
  },] }
1031
923
  ];
1032
- AmplifyButtonComponent.propDecorators = {
924
+ ButtonComponent.propDecorators = {
1033
925
  type: [{ type: Input }],
1034
926
  fullWidth: [{ type: Input }],
1035
927
  size: [{ type: Input }],
@@ -1043,107 +935,61 @@ AmplifyButtonComponent.propDecorators = {
1043
935
  fontWeightAttr: [{ type: HostBinding, args: ['style.font-weight',] }]
1044
936
  };
1045
937
 
1046
- class AmplifyErrorComponent {
1047
- }
1048
- AmplifyErrorComponent.decorators = [
1049
- { type: Component, args: [{
1050
- selector: 'amplify-error',
1051
- template: "<span data-ui-error>\n <ng-content></ng-content>\n</span>\n"
1052
- },] }
1053
- ];
1054
-
1055
- /**
1056
- * Input interface opinionated for authenticator usage.
1057
- *
1058
- * TODO: Separate this component out to two parts -- 1) amplify-auth-input that
1059
- * contains authenticator opinionated logic and 2) amplify-text-field primitive
1060
- * that does not make any auth-related inference.
1061
- */
1062
- class AmplifyFormFieldComponent {
1063
- constructor(stateMachine) {
1064
- this.stateMachine = stateMachine;
1065
- this.required = true;
1066
- this.placeholder = '';
1067
- this.label = '';
1068
- this.initialValue = '';
1069
- this.disabled = false;
1070
- this.autocomplete = '';
1071
- this.countryDialCodes = countryDialCodes;
938
+ class CheckboxComponent {
939
+ constructor() {
940
+ this.defaultChecked = false;
941
+ this.hasError = false;
942
+ this.isChecked = false;
1072
943
  }
1073
944
  ngOnInit() {
1074
- this.textFieldId = `amplify-field-${nanoid(12)}`;
1075
- this.selectFieldId = `amplify-field-${nanoid(12)}`;
1076
- // TODO: consider better default handling mechanisms across frameworks
1077
- if (this.isTelInput()) {
1078
- const state = this.stateMachine.authState;
1079
- const { country_code } = getActorContext(state);
1080
- this.defaultCountryCode = country_code;
1081
- // TODO: remove this side-effect
1082
- this.stateMachine.send({
1083
- type: 'CHANGE',
1084
- data: { name: 'country_code', value: country_code },
1085
- });
945
+ if (this.defaultChecked) {
946
+ this.isChecked = true;
1086
947
  }
1087
948
  }
1088
- get attributeMap() {
1089
- return getAttributeMap();
1090
- }
1091
- get error() {
1092
- const formContext = getActorContext(this.stateMachine.authState);
1093
- const { validationError } = formContext;
1094
- return validationError[this.name];
1095
- }
1096
- isTelInput() {
1097
- return this.inferType() === 'tel';
1098
- }
1099
- inferLabel() {
1100
- var _a;
1101
- const label = this.label || ((_a = this.attributeMap[this.name]) === null || _a === void 0 ? void 0 : _a.label);
1102
- return translate(label);
1103
- }
1104
- inferPlaceholder() {
1105
- var _a;
1106
- const placeholder = this.placeholder || ((_a = this.attributeMap[this.name]) === null || _a === void 0 ? void 0 : _a.placeholder) ||
1107
- this.inferLabel();
1108
- return translate(placeholder);
1109
- }
1110
- // infers what the `type` of underlying input element should be.
1111
- inferType() {
1112
- var _a, _b, _c;
1113
- return (_c = (_a = this.type) !== null && _a !== void 0 ? _a : (_b = this.attributeMap[this.name]) === null || _b === void 0 ? void 0 : _b.type) !== null && _c !== void 0 ? _c : 'text';
1114
- }
1115
- isPasswordField() {
1116
- return this.inferType() === 'password';
949
+ handleClick() {
950
+ this.isChecked = !this.isChecked;
1117
951
  }
1118
952
  }
1119
- AmplifyFormFieldComponent.decorators = [
953
+ CheckboxComponent.decorators = [
1120
954
  { type: Component, args: [{
1121
- selector: 'amplify-form-field',
1122
- template: "<div class=\"amplify-flex\" style=\"flex-direction: column\">\n <!-- Country code field -->\n <amplify-form-select\n *ngIf=\"isTelInput()\"\n name=\"country_code\"\n label=\"Country Code\"\n [id]=\"selectFieldId\"\n [items]=\"countryDialCodes\"\n [initialValue]=\"defaultCountryCode\"\n ></amplify-form-select>\n\n <amplify-password-field\n *ngIf=\"isPasswordField()\"\n [id]=\"textFieldId\"\n [name]=\"name\"\n [label]=\"inferLabel()\"\n [placeholder]=\"inferPlaceholder()\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [disabled]=\"disabled\"\n [autocomplete]=\"autocomplete\"\n ></amplify-password-field>\n\n <amplify-text-field\n *ngIf=\"!isPasswordField()\"\n [id]=\"textFieldId\"\n [type]=\"inferType()\"\n [name]=\"name\"\n [label]=\"inferLabel()\"\n [placeholder]=\"inferPlaceholder()\"\n [required]=\"required\"\n [value]=\"initialValue\"\n [attr.disabled]=\"disabled ? '' : null\"\n [autocomplete]=\"autocomplete\"\n ></amplify-text-field>\n\n <amplify-error *ngIf=\"error\">\n {{ error }}\n </amplify-error>\n</div>\n"
955
+ selector: 'amplify-checkbox',
956
+ template: "<div class=\"amplify-flex amplify-field amplify-checkboxfield\">\n <label class=\"amplify-flex amplify-checkbox\">\n <span class=\"amplify-visually-hidden\">\n <input\n (click)=\"handleClick()\"\n class=\"\n amplify-input\n amplify-field-group__control\n amplify-checkbox__input\n \"\n aria-invalid=\"false\"\n type=\"checkbox\"\n [name]=\"name\"\n [value]=\"value\"\n />\n </span>\n <span\n class=\"amplify-flex amplify-checkbox__button\"\n aria-hidden=\"true\"\n data-focus=\"false\"\n [attr.data-error]=\"hasError\"\n [attr.data-checked]=\"isChecked\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon amplify-checkbox__icon\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n [attr.data-checked]=\"isChecked\"\n >\n <path d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\"></path>\n </svg>\n </span>\n <span class=\"amplify-text amplify-checkbox__label\">\n <ng-content></ng-content>\n </span>\n </label>\n <p *ngIf=\"hasError\" class=\"amplify-text amplify-field__error-message\">\n {{ errorMessage }}\n </p>\n</div>\n"
1123
957
  },] }
1124
958
  ];
1125
- AmplifyFormFieldComponent.ctorParameters = () => [
1126
- { type: StateMachineService }
1127
- ];
1128
- AmplifyFormFieldComponent.propDecorators = {
1129
- name: [{ type: Input }],
1130
- type: [{ type: Input }],
1131
- required: [{ type: Input }],
1132
- placeholder: [{ type: Input }],
959
+ CheckboxComponent.propDecorators = {
960
+ defaultChecked: [{ type: Input }],
961
+ errorMessage: [{ type: Input }],
962
+ hasError: [{ type: Input }],
1133
963
  label: [{ type: Input }],
1134
- initialValue: [{ type: Input }],
1135
- disabled: [{ type: Input }],
1136
- autocomplete: [{ type: Input }]
964
+ name: [{ type: Input }],
965
+ value: [{ type: Input }]
1137
966
  };
1138
967
 
1139
- class AmplifyPasswordFieldComponent {
968
+ class ErrorComponent {
969
+ constructor() {
970
+ this.isVisible = true;
971
+ }
972
+ close() {
973
+ this.isVisible = false;
974
+ }
975
+ }
976
+ ErrorComponent.decorators = [
977
+ { type: Component, args: [{
978
+ selector: 'amplify-error',
979
+ template: "<div\n class=\"amplify-flex amplify-alert\"\n data-variation=\"error\"\n style=\"align-items: center; justify-content: space-between\"\n *ngIf=\"isVisible\"\n role=\"alert\"\n>\n <div class=\"amplify-flex\" style=\"align-items: center\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path\n d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z\"\n ></path>\n </svg>\n <div><ng-content></ng-content></div>\n </div>\n <button\n amplify-button\n class=\"amplify-field-group__control\"\n variation=\"link\"\n [fullWidth]=\"false\"\n (click)=\"close()\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n >\n <path\n d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n ></path>\n </svg>\n </button>\n</div>\n"
980
+ },] }
981
+ ];
982
+
983
+ class PasswordFieldComponent {
1140
984
  constructor() {
1141
985
  this.autocomplete = 'new-password';
1142
986
  this.disabled = false;
987
+ this.fieldId = `amplify-field-${nanoid(12)}`;
1143
988
  this.initialValue = '';
1144
989
  this.label = '';
1145
990
  this.placeholder = '';
1146
991
  this.required = true;
992
+ this.labelHidden = false;
1147
993
  this.type = 'password';
1148
994
  this.showPassword = false;
1149
995
  this.showPasswordButtonlabel = translate('Show password');
@@ -1156,37 +1002,75 @@ class AmplifyPasswordFieldComponent {
1156
1002
  this.type = this.showPassword ? 'text' : 'password';
1157
1003
  }
1158
1004
  }
1159
- AmplifyPasswordFieldComponent.decorators = [
1005
+ PasswordFieldComponent.decorators = [
1160
1006
  { type: Component, args: [{
1161
1007
  selector: 'amplify-password-field',
1162
- template: "<label class=\"amplify-label sr-only\" [for]=\"id\">\n {{ label }}\n</label>\n<div class=\"amplify-flex amplify-field-group\">\n <input\n class=\"amplify-input amplify-field-group__control\"\n [id]=\"id\"\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 class=\"amplify-field-group__outer-end\">\n <button\n amplify-button\n [attr.aria-label]=\"showPasswordButtonlabel\"\n class=\"amplify-field-group__control amplify-field__show-password\"\n (click)=\"togglePasswordText()\"\n >\n <svg\n *ngIf=\"!showPassword\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n class=\"amplify-icon\"\n >\n <path\n d=\"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z\"\n ></path>\n </svg>\n <svg\n *ngIf=\"showPassword\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n class=\"amplify-icon\"\n >\n <path\n d=\"M0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0z\"\n fill=\"none\"\n ></path>\n <path\n d=\"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z\"\n ></path>\n </svg>\n </button>\n </div>\n</div>\n"
1008
+ template: "<label class=\"amplify-label\" [class.sr-only]=\"labelHidden\" [for]=\"fieldId\">\n {{ label }}\n</label>\n<div class=\"amplify-flex amplify-field-group\">\n <input\n class=\"amplify-input amplify-field-group__control\"\n [id]=\"fieldId\"\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 class=\"amplify-field-group__outer-end\">\n <button\n amplify-button\n [attr.aria-label]=\"showPasswordButtonlabel\"\n class=\"amplify-field-group__control amplify-field__show-password\"\n (click)=\"togglePasswordText()\"\n >\n <svg\n *ngIf=\"!showPassword\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n class=\"amplify-icon\"\n >\n <path\n d=\"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z\"\n ></path>\n </svg>\n <svg\n *ngIf=\"showPassword\"\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n class=\"amplify-icon\"\n >\n <path\n d=\"M0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0z\"\n fill=\"none\"\n ></path>\n <path\n d=\"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z\"\n ></path>\n </svg>\n </button>\n </div>\n</div>\n"
1163
1009
  },] }
1164
1010
  ];
1165
- AmplifyPasswordFieldComponent.propDecorators = {
1011
+ PasswordFieldComponent.propDecorators = {
1166
1012
  autocomplete: [{ type: Input }],
1167
1013
  disabled: [{ type: Input }],
1168
- id: [{ type: Input }],
1014
+ fieldId: [{ type: Input }],
1169
1015
  initialValue: [{ type: Input }],
1170
1016
  label: [{ type: Input }],
1171
1017
  name: [{ type: Input }],
1172
1018
  placeholder: [{ type: Input }],
1173
- required: [{ type: Input }]
1019
+ required: [{ type: Input }],
1020
+ labelHidden: [{ type: Input }]
1021
+ };
1022
+
1023
+ class PhoneNumberFieldComponent {
1024
+ constructor() {
1025
+ this.autocomplete = 'new-password';
1026
+ this.disabled = false;
1027
+ this.selectFieldId = `amplify-field-${nanoid(12)}`;
1028
+ this.textFieldId = `amplify-field-${nanoid(12)}`;
1029
+ this.initialValue = '';
1030
+ this.label = '';
1031
+ this.placeholder = '';
1032
+ this.required = true;
1033
+ this.labelHidden = false;
1034
+ this.display = 'contents';
1035
+ this.countryDialCodes = countryDialCodes;
1036
+ }
1037
+ }
1038
+ PhoneNumberFieldComponent.decorators = [
1039
+ { type: Component, args: [{
1040
+ selector: 'amplify-phone-number-field',
1041
+ template: "<label class=\"amplify-label\" [class.sr-only]=\"labelHidden\" [for]=\"textFieldId\">\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]=\"countryDialCodes\"\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"
1042
+ },] }
1043
+ ];
1044
+ PhoneNumberFieldComponent.propDecorators = {
1045
+ autocomplete: [{ type: Input }],
1046
+ disabled: [{ type: Input }],
1047
+ defaultCountryCode: [{ type: Input }],
1048
+ selectFieldId: [{ type: Input }],
1049
+ textFieldId: [{ type: Input }],
1050
+ initialValue: [{ type: Input }],
1051
+ label: [{ type: Input }],
1052
+ name: [{ type: Input }],
1053
+ placeholder: [{ type: Input }],
1054
+ required: [{ type: Input }],
1055
+ type: [{ type: Input }],
1056
+ labelHidden: [{ type: Input }],
1057
+ display: [{ type: HostBinding, args: ['style.display',] }]
1174
1058
  };
1175
1059
 
1176
- class AmplifySelectComponent {
1060
+ class SelectComponent {
1177
1061
  }
1178
- AmplifySelectComponent.decorators = [
1062
+ SelectComponent.decorators = [
1179
1063
  { type: Component, args: [{
1180
1064
  selector: 'amplify-form-select',
1181
- template: "<label class=\"amplify-label sr-only\" [for]=\"id\">{{ label }}</label>\n<select class=\"amplify-select\" [id]=\"id\" [name]=\"name\">\n <option\n *ngFor=\"let item of items\"\n [value]=\"item\"\n [selected]=\"item === initialValue\"\n >\n {{ item }}\n </option>\n</select>\n"
1065
+ template: "<label class=\"amplify-label sr-only\" [for]=\"id\">{{ label }}</label>\n<div class=\"amplify-select__wrapper\">\n <select\n class=\"amplify-select amplify-field-group__control\"\n autocomplete=\"tel-country-code\"\n [id]=\"id\"\n [name]=\"name\"\n >\n <option\n *ngFor=\"let item of items\"\n [value]=\"item\"\n [selected]=\"item === defaultValue\"\n >\n {{ item }}\n </option>\n </select>\n <div\n class=\"amplify-flex amplify-select__icon-wrapper\"\n style=\"align-items: center; justify-content: center\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"amplify-icon\"\n viewBox=\"0 0 24 24\"\n data-size=\"large\"\n fill=\"currentColor\"\n >\n <path d=\"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z\"></path>\n </svg>\n </div>\n</div>\n"
1182
1066
  },] }
1183
1067
  ];
1184
- AmplifySelectComponent.propDecorators = {
1068
+ SelectComponent.propDecorators = {
1185
1069
  items: [{ type: Input }],
1186
1070
  name: [{ type: Input }],
1187
1071
  label: [{ type: Input }],
1188
1072
  id: [{ type: Input }],
1189
- initialValue: [{ type: Input }]
1073
+ defaultValue: [{ type: Input }]
1190
1074
  };
1191
1075
 
1192
1076
  class TabItemComponent {
@@ -1219,6 +1103,7 @@ class TabsComponent {
1219
1103
  tab.labelledById = `radix-id-${nanoid(12)}-1-trigger-${index}`;
1220
1104
  });
1221
1105
  // find active tab
1106
+ // TODO(enhancement): more declarative way for choosing the initial tab to render
1222
1107
  const activeTabs = this.tabs.filter((tab) => tab.active);
1223
1108
  // set active tab
1224
1109
  if (activeTabs.length !== 1) {
@@ -1241,7 +1126,7 @@ class TabsComponent {
1241
1126
  TabsComponent.decorators = [
1242
1127
  { type: Component, args: [{
1243
1128
  selector: 'amplify-tabs',
1244
- template: "<div\n tabindex=\"0\"\n aria-orientation=\"horizontal\"\n data-orientation=\"horizontal\"\n role=\"tablist\"\n style=\"outline: none\"\n>\n <div\n class=\"amplify-flex amplify-tabs\"\n style=\"gap: 0px; justify-content: center\"\n >\n <div\n *ngFor=\"let tab of tabs\"\n class=\"amplify-tabs-item\"\n data-grow=\"equal\"\n data-orientation=\"horizontal\"\n role=\"tab\"\n [id]=\"tab.labelledById\"\n [tabindex]=\"tab.active ? '0' : '1'\"\n [attr.aria-selected]=\"tab.active\"\n [attr.aria-controls]=\"tab.id\"\n [attr.data-state]=\"tab.active ? 'active' : 'inactive'\"\n (click)=\"handleTabClick(tab)\"\n >\n {{ tab.title }}\n </div>\n </div>\n</div>\n\n<ng-content></ng-content>\n"
1129
+ template: "<div\n tabindex=\"0\"\n aria-orientation=\"horizontal\"\n data-orientation=\"horizontal\"\n role=\"tablist\"\n style=\"outline: none\"\n>\n <div\n class=\"amplify-flex amplify-tabs\"\n data-indicator-position=\"top\"\n style=\"gap: 0px; justify-content: center\"\n >\n <div\n *ngFor=\"let tab of tabs\"\n class=\"amplify-tabs-item\"\n data-spacing=\"equal\"\n data-orientation=\"horizontal\"\n role=\"tab\"\n [id]=\"tab.labelledById\"\n [tabindex]=\"tab.active ? '0' : '1'\"\n [attr.aria-selected]=\"tab.active\"\n [attr.aria-controls]=\"tab.id\"\n [attr.data-state]=\"tab.active ? 'active' : 'inactive'\"\n (click)=\"handleTabClick(tab)\"\n >\n {{ tab.title }}\n </div>\n </div>\n</div>\n\n<ng-content></ng-content>\n"
1245
1130
  },] }
1246
1131
  ];
1247
1132
  TabsComponent.propDecorators = {
@@ -1249,1931 +1134,110 @@ TabsComponent.propDecorators = {
1249
1134
  tabChange: [{ type: Output }]
1250
1135
  };
1251
1136
 
1252
- class AmplifyTextFieldComponent {
1137
+ class TextFieldComponent {
1253
1138
  constructor() {
1254
1139
  this.autocomplete = 'new-password';
1255
1140
  this.disabled = false;
1141
+ this.fieldId = `amplify-field-${nanoid(12)}`;
1256
1142
  this.initialValue = '';
1257
1143
  this.label = '';
1258
1144
  this.placeholder = '';
1259
1145
  this.required = true;
1260
- this.showPassword = false;
1261
- this.showPasswordButtonlabel = translate('Show password');
1262
- }
1263
- togglePasswordText() {
1264
- this.showPassword = !this.showPassword;
1265
- this.showPasswordButtonlabel = this.showPassword
1266
- ? translate('Show password')
1267
- : translate('Hide password');
1268
- this.type = this.showPassword ? 'text' : 'password';
1146
+ this.labelHidden = false;
1147
+ this.display = 'contents';
1269
1148
  }
1270
1149
  }
1271
- AmplifyTextFieldComponent.decorators = [
1150
+ TextFieldComponent.decorators = [
1272
1151
  { type: Component, args: [{
1273
1152
  selector: 'amplify-text-field',
1274
- template: "<label class=\"amplify-label sr-only\" [for]=\"id\">\n {{ label }}\n</label>\n<input\n class=\"amplify-input\"\n [id]=\"id\"\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"
1153
+ template: "<label class=\"amplify-label\" [class.sr-only]=\"labelHidden\" [for]=\"fieldId\">\n {{ label }}\n</label>\n<input\n class=\"amplify-input\"\n [id]=\"fieldId\"\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"
1275
1154
  },] }
1276
1155
  ];
1277
- AmplifyTextFieldComponent.propDecorators = {
1156
+ TextFieldComponent.propDecorators = {
1278
1157
  autocomplete: [{ type: Input }],
1279
1158
  disabled: [{ type: Input }],
1280
- id: [{ type: Input }],
1159
+ fieldId: [{ type: Input }],
1281
1160
  initialValue: [{ type: Input }],
1282
1161
  label: [{ type: Input }],
1283
1162
  name: [{ type: Input }],
1284
1163
  placeholder: [{ type: Input }],
1285
1164
  required: [{ type: Input }],
1286
- type: [{ type: Input }]
1165
+ type: [{ type: Input }],
1166
+ labelHidden: [{ type: Input }],
1167
+ display: [{ type: HostBinding, args: ['style.display',] }]
1287
1168
  };
1288
1169
 
1289
- class AmplifyUserNameAliasComponent {
1290
- constructor(stateMachine) {
1291
- this.stateMachine = stateMachine;
1292
- this.name = 'username';
1293
- this.disabled = false;
1294
- this.initialValue = '';
1295
- this.required = true;
1170
+ class AmplifySlotComponent {
1171
+ constructor(propService) {
1172
+ this.propService = propService;
1173
+ this.display = 'contents';
1174
+ this.isOverriden = false;
1296
1175
  }
1297
- ngOnInit() {
1298
- const context = this.stateMachine.context;
1299
- const { label, type } = getAliasInfoFromContext(context);
1300
- this.label = label;
1301
- this.type = type;
1302
- this.placeholder = label;
1303
- }
1304
- }
1305
- AmplifyUserNameAliasComponent.decorators = [
1306
- { type: Component, args: [{
1307
- selector: 'amplify-user-name-alias',
1308
- template: "<amplify-form-field\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-field>\n"
1309
- },] }
1310
- ];
1311
- AmplifyUserNameAliasComponent.ctorParameters = () => [
1312
- { type: StateMachineService }
1313
- ];
1314
- AmplifyUserNameAliasComponent.propDecorators = {
1315
- name: [{ type: Input }],
1316
- disabled: [{ type: Input }],
1317
- initialValue: [{ type: Input }],
1318
- required: [{ type: Input }]
1319
- };
1320
-
1321
- const proxyInputs = (Cmp, inputs) => {
1322
- const Prototype = Cmp.prototype;
1323
- inputs.forEach((item) => {
1324
- Object.defineProperty(Prototype, item, {
1325
- get() {
1326
- return this.el[item];
1327
- },
1328
- set(val) {
1329
- this.z.runOutsideAngular(() => (this.el[item] = val));
1330
- },
1331
- });
1332
- });
1333
- };
1334
- const proxyMethods = (Cmp, methods) => {
1335
- const Prototype = Cmp.prototype;
1336
- methods.forEach((methodName) => {
1337
- Prototype[methodName] = function () {
1338
- const args = arguments;
1339
- return this.z.runOutsideAngular(() => this.el[methodName].apply(this.el, args));
1340
- };
1341
- });
1342
- };
1343
- const proxyOutputs = (instance, el, events) => {
1344
- events.forEach((eventName) => (instance[eventName] = fromEvent(el, eventName)));
1345
- };
1346
- // tslint:disable-next-line: only-arrow-functions
1347
- function ProxyCmp(opts) {
1348
- const decorator = function (cls) {
1349
- if (opts.inputs) {
1350
- proxyInputs(cls, opts.inputs);
1351
- }
1352
- if (opts.methods) {
1353
- proxyMethods(cls, opts.methods);
1176
+ ngAfterContentInit() {
1177
+ const customComponents = this.propService.customComponents;
1178
+ const overridingComponent = customComponents[this.name];
1179
+ if (overridingComponent) {
1180
+ this.overridingComponent = overridingComponent;
1181
+ this.isOverriden = true;
1354
1182
  }
1355
- return cls;
1356
- };
1357
- return decorator;
1358
- }
1359
- let AmplifyAmazonButton = class AmplifyAmazonButton {
1360
- constructor(c, r, z) {
1361
- this.z = z;
1362
- c.detach();
1363
- this.el = r.nativeElement;
1364
- }
1365
- };
1366
- AmplifyAmazonButton.decorators = [
1367
- { type: Component, args: [{
1368
- selector: 'amplify-amazon-button',
1369
- changeDetection: ChangeDetectionStrategy.OnPush,
1370
- template: '<ng-content></ng-content>',
1371
- inputs: ['clientId', 'handleAuthStateChange']
1372
- },] }
1373
- ];
1374
- AmplifyAmazonButton.ctorParameters = () => [
1375
- { type: ChangeDetectorRef },
1376
- { type: ElementRef },
1377
- { type: NgZone }
1378
- ];
1379
- AmplifyAmazonButton = __decorate([
1380
- ProxyCmp({ inputs: ['clientId', 'handleAuthStateChange'] })
1381
- ], AmplifyAmazonButton);
1382
- class AmplifyAuthContainer {
1383
- constructor(c, r, z) {
1384
- this.z = z;
1385
- c.detach();
1386
- this.el = r.nativeElement;
1387
1183
  }
1388
1184
  }
1389
- AmplifyAuthContainer.decorators = [
1390
- { type: Component, args: [{
1391
- selector: 'amplify-auth-container',
1392
- changeDetection: ChangeDetectionStrategy.OnPush,
1393
- template: '<ng-content></ng-content>'
1394
- },] }
1395
- ];
1396
- AmplifyAuthContainer.ctorParameters = () => [
1397
- { type: ChangeDetectorRef },
1398
- { type: ElementRef },
1399
- { type: NgZone }
1400
- ];
1401
- let AmplifyAuthFields = class AmplifyAuthFields {
1402
- constructor(c, r, z) {
1403
- this.z = z;
1404
- c.detach();
1405
- this.el = r.nativeElement;
1406
- }
1407
- };
1408
- AmplifyAuthFields.decorators = [
1409
- { type: Component, args: [{
1410
- selector: 'amplify-auth-fields',
1411
- changeDetection: ChangeDetectionStrategy.OnPush,
1412
- template: '<ng-content></ng-content>',
1413
- inputs: ['formFields']
1414
- },] }
1415
- ];
1416
- AmplifyAuthFields.ctorParameters = () => [
1417
- { type: ChangeDetectorRef },
1418
- { type: ElementRef },
1419
- { type: NgZone }
1420
- ];
1421
- AmplifyAuthFields = __decorate([
1422
- ProxyCmp({ inputs: ['formFields'] })
1423
- ], AmplifyAuthFields);
1424
- let AmplifyAuth0Button = class AmplifyAuth0Button {
1425
- constructor(c, r, z) {
1426
- this.z = z;
1427
- c.detach();
1428
- this.el = r.nativeElement;
1429
- }
1430
- };
1431
- AmplifyAuth0Button.decorators = [
1432
- { type: Component, args: [{
1433
- selector: 'amplify-auth0-button',
1434
- changeDetection: ChangeDetectionStrategy.OnPush,
1435
- template: '<ng-content></ng-content>',
1436
- inputs: ['config', 'handleAuthStateChange']
1437
- },] }
1438
- ];
1439
- AmplifyAuth0Button.ctorParameters = () => [
1440
- { type: ChangeDetectorRef },
1441
- { type: ElementRef },
1442
- { type: NgZone }
1443
- ];
1444
- AmplifyAuth0Button = __decorate([
1445
- ProxyCmp({ inputs: ['config', 'handleAuthStateChange'] })
1446
- ], AmplifyAuth0Button);
1447
- let AmplifyAuthenticator = class AmplifyAuthenticator {
1448
- constructor(c, r, z) {
1449
- this.z = z;
1450
- c.detach();
1451
- this.el = r.nativeElement;
1452
- }
1453
- };
1454
- AmplifyAuthenticator.decorators = [
1455
- { type: Component, args: [{
1456
- selector: 'amplify-authenticator',
1457
- changeDetection: ChangeDetectionStrategy.OnPush,
1458
- template: '<ng-content></ng-content>',
1459
- inputs: [
1460
- 'federated',
1461
- 'handleAuthStateChange',
1462
- 'hideToast',
1463
- 'initialAuthState',
1464
- 'usernameAlias',
1465
- ]
1466
- },] }
1467
- ];
1468
- AmplifyAuthenticator.ctorParameters = () => [
1469
- { type: ChangeDetectorRef },
1470
- { type: ElementRef },
1471
- { type: NgZone }
1472
- ];
1473
- AmplifyAuthenticator = __decorate([
1474
- ProxyCmp({
1475
- inputs: [
1476
- 'federated',
1477
- 'handleAuthStateChange',
1478
- 'hideToast',
1479
- 'initialAuthState',
1480
- 'usernameAlias',
1481
- ],
1482
- })
1483
- ], AmplifyAuthenticator);
1484
- let AmplifyButton = class AmplifyButton {
1485
- constructor(c, r, z) {
1486
- this.z = z;
1487
- c.detach();
1488
- this.el = r.nativeElement;
1489
- }
1490
- };
1491
- AmplifyButton.decorators = [
1185
+ AmplifySlotComponent.decorators = [
1492
1186
  { type: Component, args: [{
1493
- selector: 'amplify-button',
1494
- changeDetection: ChangeDetectionStrategy.OnPush,
1495
- template: '<ng-content></ng-content>',
1496
- inputs: ['disabled', 'handleButtonClick', 'icon', 'type', 'variant']
1187
+ selector: 'amplify-slot',
1188
+ template: "<!-- \n if slot isn't overwritten, we display the the default coponent, which is the \n children passed onto this component.\n-->\n<ng-content *ngIf=\"!isOverriden\"></ng-content>\n\n<!-- If slot is overwritten, we render that instead. -->\n<ng-container\n *ngIf=\"isOverriden\"\n [ngTemplateOutlet]=\"overridingComponent\"\n [ngTemplateOutletContext]=\"context\"\n></ng-container>\n"
1497
1189
  },] }
1498
1190
  ];
1499
- AmplifyButton.ctorParameters = () => [
1500
- { type: ChangeDetectorRef },
1501
- { type: ElementRef },
1502
- { type: NgZone }
1191
+ AmplifySlotComponent.ctorParameters = () => [
1192
+ { type: CustomComponentsService }
1503
1193
  ];
1504
- AmplifyButton = __decorate([
1505
- ProxyCmp({
1506
- inputs: ['disabled', 'handleButtonClick', 'icon', 'type', 'variant'],
1507
- })
1508
- ], AmplifyButton);
1509
- let AmplifyChatbot = class AmplifyChatbot {
1510
- constructor(c, r, z) {
1511
- this.z = z;
1512
- c.detach();
1513
- this.el = r.nativeElement;
1514
- proxyOutputs(this, this.el, ['chatCompleted']);
1515
- }
1516
- };
1517
- AmplifyChatbot.decorators = [
1518
- { type: Component, args: [{
1519
- selector: 'amplify-chatbot',
1520
- changeDetection: ChangeDetectionStrategy.OnPush,
1521
- template: '<ng-content></ng-content>',
1522
- inputs: [
1523
- 'botName',
1524
- 'botTitle',
1525
- 'clearOnComplete',
1526
- 'conversationModeOn',
1527
- 'silenceThreshold',
1528
- 'silenceTime',
1529
- 'textEnabled',
1530
- 'voiceEnabled',
1531
- 'welcomeMessage',
1532
- ]
1533
- },] }
1534
- ];
1535
- AmplifyChatbot.ctorParameters = () => [
1536
- { type: ChangeDetectorRef },
1537
- { type: ElementRef },
1538
- { type: NgZone }
1539
- ];
1540
- AmplifyChatbot = __decorate([
1541
- ProxyCmp({
1542
- inputs: [
1543
- 'botName',
1544
- 'botTitle',
1545
- 'clearOnComplete',
1546
- 'conversationModeOn',
1547
- 'silenceThreshold',
1548
- 'silenceTime',
1549
- 'textEnabled',
1550
- 'voiceEnabled',
1551
- 'welcomeMessage',
1552
- ],
1553
- })
1554
- ], AmplifyChatbot);
1555
- let AmplifyCheckbox = class AmplifyCheckbox {
1556
- constructor(c, r, z) {
1557
- this.z = z;
1558
- c.detach();
1559
- this.el = r.nativeElement;
1560
- }
1561
- };
1562
- AmplifyCheckbox.decorators = [
1563
- { type: Component, args: [{
1564
- selector: 'amplify-checkbox',
1565
- changeDetection: ChangeDetectionStrategy.OnPush,
1566
- template: '<ng-content></ng-content>',
1567
- inputs: ['checked', 'disabled', 'fieldId', 'label', 'name', 'value']
1568
- },] }
1569
- ];
1570
- AmplifyCheckbox.ctorParameters = () => [
1571
- { type: ChangeDetectorRef },
1572
- { type: ElementRef },
1573
- { type: NgZone }
1574
- ];
1575
- AmplifyCheckbox = __decorate([
1576
- ProxyCmp({
1577
- inputs: ['checked', 'disabled', 'fieldId', 'label', 'name', 'value'],
1578
- })
1579
- ], AmplifyCheckbox);
1580
- let AmplifyCodeField = class AmplifyCodeField {
1581
- constructor(c, r, z) {
1582
- this.z = z;
1583
- c.detach();
1584
- this.el = r.nativeElement;
1585
- }
1586
- };
1587
- AmplifyCodeField.decorators = [
1588
- { type: Component, args: [{
1589
- selector: 'amplify-code-field',
1590
- changeDetection: ChangeDetectionStrategy.OnPush,
1591
- template: '<ng-content></ng-content>',
1592
- inputs: [
1593
- 'disabled',
1594
- 'fieldId',
1595
- 'handleInputChange',
1596
- 'hint',
1597
- 'inputProps',
1598
- 'label',
1599
- 'placeholder',
1600
- 'required',
1601
- 'value',
1602
- ]
1603
- },] }
1604
- ];
1605
- AmplifyCodeField.ctorParameters = () => [
1606
- { type: ChangeDetectorRef },
1607
- { type: ElementRef },
1608
- { type: NgZone }
1609
- ];
1610
- AmplifyCodeField = __decorate([
1611
- ProxyCmp({
1612
- inputs: [
1613
- 'disabled',
1614
- 'fieldId',
1615
- 'handleInputChange',
1616
- 'hint',
1617
- 'inputProps',
1618
- 'label',
1619
- 'placeholder',
1620
- 'required',
1621
- 'value',
1622
- ],
1623
- })
1624
- ], AmplifyCodeField);
1625
- let AmplifyConfirmSignIn = class AmplifyConfirmSignIn {
1626
- constructor(c, r, z) {
1627
- this.z = z;
1628
- c.detach();
1629
- this.el = r.nativeElement;
1630
- }
1631
- };
1632
- AmplifyConfirmSignIn.decorators = [
1633
- { type: Component, args: [{
1634
- selector: 'amplify-confirm-sign-in',
1635
- changeDetection: ChangeDetectionStrategy.OnPush,
1636
- template: '<ng-content></ng-content>',
1637
- inputs: [
1638
- 'formFields',
1639
- 'handleAuthStateChange',
1640
- 'handleSubmit',
1641
- 'headerText',
1642
- 'submitButtonText',
1643
- 'user',
1644
- ]
1645
- },] }
1646
- ];
1647
- AmplifyConfirmSignIn.ctorParameters = () => [
1648
- { type: ChangeDetectorRef },
1649
- { type: ElementRef },
1650
- { type: NgZone }
1651
- ];
1652
- AmplifyConfirmSignIn = __decorate([
1653
- ProxyCmp({
1654
- inputs: [
1655
- 'formFields',
1656
- 'handleAuthStateChange',
1657
- 'handleSubmit',
1658
- 'headerText',
1659
- 'submitButtonText',
1660
- 'user',
1661
- ],
1662
- })
1663
- ], AmplifyConfirmSignIn);
1664
- let AmplifyConfirmSignUp = class AmplifyConfirmSignUp {
1665
- constructor(c, r, z) {
1666
- this.z = z;
1667
- c.detach();
1668
- this.el = r.nativeElement;
1669
- }
1670
- };
1671
- AmplifyConfirmSignUp.decorators = [
1672
- { type: Component, args: [{
1673
- selector: 'amplify-confirm-sign-up',
1674
- changeDetection: ChangeDetectionStrategy.OnPush,
1675
- template: '<ng-content></ng-content>',
1676
- inputs: [
1677
- 'formFields',
1678
- 'handleAuthStateChange',
1679
- 'handleSubmit',
1680
- 'headerText',
1681
- 'submitButtonText',
1682
- 'user',
1683
- 'usernameAlias',
1684
- ]
1685
- },] }
1686
- ];
1687
- AmplifyConfirmSignUp.ctorParameters = () => [
1688
- { type: ChangeDetectorRef },
1689
- { type: ElementRef },
1690
- { type: NgZone }
1691
- ];
1692
- AmplifyConfirmSignUp = __decorate([
1693
- ProxyCmp({
1694
- inputs: [
1695
- 'formFields',
1696
- 'handleAuthStateChange',
1697
- 'handleSubmit',
1698
- 'headerText',
1699
- 'submitButtonText',
1700
- 'user',
1701
- 'usernameAlias',
1702
- ],
1703
- })
1704
- ], AmplifyConfirmSignUp);
1705
- class AmplifyContainer {
1706
- constructor(c, r, z) {
1707
- this.z = z;
1708
- c.detach();
1709
- this.el = r.nativeElement;
1710
- }
1711
- }
1712
- AmplifyContainer.decorators = [
1713
- { type: Component, args: [{
1714
- selector: 'amplify-container',
1715
- changeDetection: ChangeDetectionStrategy.OnPush,
1716
- template: '<ng-content></ng-content>'
1717
- },] }
1718
- ];
1719
- AmplifyContainer.ctorParameters = () => [
1720
- { type: ChangeDetectorRef },
1721
- { type: ElementRef },
1722
- { type: NgZone }
1723
- ];
1724
- let AmplifyCountryDialCode = class AmplifyCountryDialCode {
1725
- constructor(c, r, z) {
1726
- this.z = z;
1727
- c.detach();
1728
- this.el = r.nativeElement;
1729
- }
1730
- };
1731
- AmplifyCountryDialCode.decorators = [
1732
- { type: Component, args: [{
1733
- selector: 'amplify-country-dial-code',
1734
- changeDetection: ChangeDetectionStrategy.OnPush,
1735
- template: '<ng-content></ng-content>',
1736
- inputs: ['dialCode', 'fieldId', 'handleInputChange', 'options']
1737
- },] }
1738
- ];
1739
- AmplifyCountryDialCode.ctorParameters = () => [
1740
- { type: ChangeDetectorRef },
1741
- { type: ElementRef },
1742
- { type: NgZone }
1743
- ];
1744
- AmplifyCountryDialCode = __decorate([
1745
- ProxyCmp({ inputs: ['dialCode', 'fieldId', 'handleInputChange', 'options'] })
1746
- ], AmplifyCountryDialCode);
1747
- let AmplifyEmailField = class AmplifyEmailField {
1748
- constructor(c, r, z) {
1749
- this.z = z;
1750
- c.detach();
1751
- this.el = r.nativeElement;
1752
- }
1753
- };
1754
- AmplifyEmailField.decorators = [
1755
- { type: Component, args: [{
1756
- selector: 'amplify-email-field',
1757
- changeDetection: ChangeDetectionStrategy.OnPush,
1758
- template: '<ng-content></ng-content>',
1759
- inputs: [
1760
- 'disabled',
1761
- 'fieldId',
1762
- 'handleInputChange',
1763
- 'hint',
1764
- 'inputProps',
1765
- 'label',
1766
- 'placeholder',
1767
- 'required',
1768
- 'value',
1769
- ]
1770
- },] }
1771
- ];
1772
- AmplifyEmailField.ctorParameters = () => [
1773
- { type: ChangeDetectorRef },
1774
- { type: ElementRef },
1775
- { type: NgZone }
1776
- ];
1777
- AmplifyEmailField = __decorate([
1778
- ProxyCmp({
1779
- inputs: [
1780
- 'disabled',
1781
- 'fieldId',
1782
- 'handleInputChange',
1783
- 'hint',
1784
- 'inputProps',
1785
- 'label',
1786
- 'placeholder',
1787
- 'required',
1788
- 'value',
1789
- ],
1790
- })
1791
- ], AmplifyEmailField);
1792
- let AmplifyFacebookButton = class AmplifyFacebookButton {
1793
- constructor(c, r, z) {
1794
- this.z = z;
1795
- c.detach();
1796
- this.el = r.nativeElement;
1797
- }
1798
- };
1799
- AmplifyFacebookButton.decorators = [
1800
- { type: Component, args: [{
1801
- selector: 'amplify-facebook-button',
1802
- changeDetection: ChangeDetectionStrategy.OnPush,
1803
- template: '<ng-content></ng-content>',
1804
- inputs: ['appId', 'handleAuthStateChange']
1805
- },] }
1806
- ];
1807
- AmplifyFacebookButton.ctorParameters = () => [
1808
- { type: ChangeDetectorRef },
1809
- { type: ElementRef },
1810
- { type: NgZone }
1811
- ];
1812
- AmplifyFacebookButton = __decorate([
1813
- ProxyCmp({ inputs: ['appId', 'handleAuthStateChange'] })
1814
- ], AmplifyFacebookButton);
1815
- let AmplifyFederatedButtons = class AmplifyFederatedButtons {
1816
- constructor(c, r, z) {
1817
- this.z = z;
1818
- c.detach();
1819
- this.el = r.nativeElement;
1820
- }
1821
- };
1822
- AmplifyFederatedButtons.decorators = [
1823
- { type: Component, args: [{
1824
- selector: 'amplify-federated-buttons',
1825
- changeDetection: ChangeDetectionStrategy.OnPush,
1826
- template: '<ng-content></ng-content>',
1827
- inputs: ['authState', 'federated', 'handleAuthStateChange']
1828
- },] }
1829
- ];
1830
- AmplifyFederatedButtons.ctorParameters = () => [
1831
- { type: ChangeDetectorRef },
1832
- { type: ElementRef },
1833
- { type: NgZone }
1834
- ];
1835
- AmplifyFederatedButtons = __decorate([
1836
- ProxyCmp({ inputs: ['authState', 'federated', 'handleAuthStateChange'] })
1837
- ], AmplifyFederatedButtons);
1838
- let AmplifyFederatedSignIn = class AmplifyFederatedSignIn {
1839
- constructor(c, r, z) {
1840
- this.z = z;
1841
- c.detach();
1842
- this.el = r.nativeElement;
1843
- }
1844
- };
1845
- AmplifyFederatedSignIn.decorators = [
1846
- { type: Component, args: [{
1847
- selector: 'amplify-federated-sign-in',
1848
- changeDetection: ChangeDetectionStrategy.OnPush,
1849
- template: '<ng-content></ng-content>',
1850
- inputs: ['authState', 'federated']
1851
- },] }
1852
- ];
1853
- AmplifyFederatedSignIn.ctorParameters = () => [
1854
- { type: ChangeDetectorRef },
1855
- { type: ElementRef },
1856
- { type: NgZone }
1857
- ];
1858
- AmplifyFederatedSignIn = __decorate([
1859
- ProxyCmp({ inputs: ['authState', 'federated'] })
1860
- ], AmplifyFederatedSignIn);
1861
- let AmplifyForgotPassword = class AmplifyForgotPassword {
1862
- constructor(c, r, z) {
1863
- this.z = z;
1864
- c.detach();
1865
- this.el = r.nativeElement;
1866
- }
1867
- };
1868
- AmplifyForgotPassword.decorators = [
1869
- { type: Component, args: [{
1870
- selector: 'amplify-forgot-password',
1871
- changeDetection: ChangeDetectionStrategy.OnPush,
1872
- template: '<ng-content></ng-content>',
1873
- inputs: [
1874
- 'formFields',
1875
- 'handleAuthStateChange',
1876
- 'handleSend',
1877
- 'handleSubmit',
1878
- 'headerText',
1879
- 'sendButtonText',
1880
- 'submitButtonText',
1881
- 'usernameAlias',
1882
- ]
1883
- },] }
1884
- ];
1885
- AmplifyForgotPassword.ctorParameters = () => [
1886
- { type: ChangeDetectorRef },
1887
- { type: ElementRef },
1888
- { type: NgZone }
1889
- ];
1890
- AmplifyForgotPassword = __decorate([
1891
- ProxyCmp({
1892
- inputs: [
1893
- 'formFields',
1894
- 'handleAuthStateChange',
1895
- 'handleSend',
1896
- 'handleSubmit',
1897
- 'headerText',
1898
- 'sendButtonText',
1899
- 'submitButtonText',
1900
- 'usernameAlias',
1901
- ],
1902
- })
1903
- ], AmplifyForgotPassword);
1904
- let AmplifyFormField = class AmplifyFormField {
1905
- constructor(c, r, z) {
1906
- this.z = z;
1907
- c.detach();
1908
- this.el = r.nativeElement;
1909
- }
1910
- };
1911
- AmplifyFormField.decorators = [
1912
- { type: Component, args: [{
1913
- selector: 'amplify-form-field',
1914
- changeDetection: ChangeDetectionStrategy.OnPush,
1915
- template: '<ng-content></ng-content>',
1916
- inputs: [
1917
- 'description',
1918
- 'disabled',
1919
- 'fieldId',
1920
- 'handleInputChange',
1921
- 'hint',
1922
- 'inputProps',
1923
- 'label',
1924
- 'name',
1925
- 'placeholder',
1926
- 'required',
1927
- 'type',
1928
- 'value',
1929
- ]
1930
- },] }
1931
- ];
1932
- AmplifyFormField.ctorParameters = () => [
1933
- { type: ChangeDetectorRef },
1934
- { type: ElementRef },
1935
- { type: NgZone }
1936
- ];
1937
- AmplifyFormField = __decorate([
1938
- ProxyCmp({
1939
- inputs: [
1940
- 'description',
1941
- 'disabled',
1942
- 'fieldId',
1943
- 'handleInputChange',
1944
- 'hint',
1945
- 'inputProps',
1946
- 'label',
1947
- 'name',
1948
- 'placeholder',
1949
- 'required',
1950
- 'type',
1951
- 'value',
1952
- ],
1953
- })
1954
- ], AmplifyFormField);
1955
- let AmplifyFormSection = class AmplifyFormSection {
1956
- constructor(c, r, z) {
1957
- this.z = z;
1958
- c.detach();
1959
- this.el = r.nativeElement;
1960
- }
1961
- };
1962
- AmplifyFormSection.decorators = [
1963
- { type: Component, args: [{
1964
- selector: 'amplify-form-section',
1965
- changeDetection: ChangeDetectionStrategy.OnPush,
1966
- template: '<ng-content></ng-content>',
1967
- inputs: [
1968
- 'handleSubmit',
1969
- 'headerText',
1970
- 'loading',
1971
- 'secondaryFooterContent',
1972
- 'submitButtonText',
1973
- 'testDataPrefix',
1974
- ]
1975
- },] }
1976
- ];
1977
- AmplifyFormSection.ctorParameters = () => [
1978
- { type: ChangeDetectorRef },
1979
- { type: ElementRef },
1980
- { type: NgZone }
1981
- ];
1982
- AmplifyFormSection = __decorate([
1983
- ProxyCmp({
1984
- inputs: [
1985
- 'handleSubmit',
1986
- 'headerText',
1987
- 'loading',
1988
- 'secondaryFooterContent',
1989
- 'submitButtonText',
1990
- 'testDataPrefix',
1991
- ],
1992
- })
1993
- ], AmplifyFormSection);
1994
- let AmplifyGoogleButton = class AmplifyGoogleButton {
1995
- constructor(c, r, z) {
1996
- this.z = z;
1997
- c.detach();
1998
- this.el = r.nativeElement;
1999
- }
2000
- };
2001
- AmplifyGoogleButton.decorators = [
2002
- { type: Component, args: [{
2003
- selector: 'amplify-google-button',
2004
- changeDetection: ChangeDetectionStrategy.OnPush,
2005
- template: '<ng-content></ng-content>',
2006
- inputs: ['clientId', 'handleAuthStateChange']
2007
- },] }
2008
- ];
2009
- AmplifyGoogleButton.ctorParameters = () => [
2010
- { type: ChangeDetectorRef },
2011
- { type: ElementRef },
2012
- { type: NgZone }
2013
- ];
2014
- AmplifyGoogleButton = __decorate([
2015
- ProxyCmp({ inputs: ['clientId', 'handleAuthStateChange'] })
2016
- ], AmplifyGoogleButton);
2017
- let AmplifyGreetings = class AmplifyGreetings {
2018
- constructor(c, r, z) {
2019
- this.z = z;
2020
- c.detach();
2021
- this.el = r.nativeElement;
2022
- }
2023
- };
2024
- AmplifyGreetings.decorators = [
2025
- { type: Component, args: [{
2026
- selector: 'amplify-greetings',
2027
- changeDetection: ChangeDetectionStrategy.OnPush,
2028
- template: '<ng-content></ng-content>',
2029
- inputs: ['handleAuthStateChange', 'logo', 'username']
2030
- },] }
2031
- ];
2032
- AmplifyGreetings.ctorParameters = () => [
2033
- { type: ChangeDetectorRef },
2034
- { type: ElementRef },
2035
- { type: NgZone }
2036
- ];
2037
- AmplifyGreetings = __decorate([
2038
- ProxyCmp({ inputs: ['handleAuthStateChange', 'logo', 'username'] })
2039
- ], AmplifyGreetings);
2040
- class AmplifyHint {
2041
- constructor(c, r, z) {
2042
- this.z = z;
2043
- c.detach();
2044
- this.el = r.nativeElement;
2045
- }
2046
- }
2047
- AmplifyHint.decorators = [
2048
- { type: Component, args: [{
2049
- selector: 'amplify-hint',
2050
- changeDetection: ChangeDetectionStrategy.OnPush,
2051
- template: '<ng-content></ng-content>'
2052
- },] }
2053
- ];
2054
- AmplifyHint.ctorParameters = () => [
2055
- { type: ChangeDetectorRef },
2056
- { type: ElementRef },
2057
- { type: NgZone }
2058
- ];
2059
- let AmplifyIcon = class AmplifyIcon {
2060
- constructor(c, r, z) {
2061
- this.z = z;
2062
- c.detach();
2063
- this.el = r.nativeElement;
2064
- }
2065
- };
2066
- AmplifyIcon.decorators = [
2067
- { type: Component, args: [{
2068
- selector: 'amplify-icon',
2069
- changeDetection: ChangeDetectionStrategy.OnPush,
2070
- template: '<ng-content></ng-content>',
2071
- inputs: ['name']
2072
- },] }
2073
- ];
2074
- AmplifyIcon.ctorParameters = () => [
2075
- { type: ChangeDetectorRef },
2076
- { type: ElementRef },
2077
- { type: NgZone }
2078
- ];
2079
- AmplifyIcon = __decorate([
2080
- ProxyCmp({ inputs: ['name'] })
2081
- ], AmplifyIcon);
2082
- let AmplifyIconButton = class AmplifyIconButton {
2083
- constructor(c, r, z) {
2084
- this.z = z;
2085
- c.detach();
2086
- this.el = r.nativeElement;
2087
- }
2088
- };
2089
- AmplifyIconButton.decorators = [
2090
- { type: Component, args: [{
2091
- selector: 'amplify-icon-button',
2092
- changeDetection: ChangeDetectionStrategy.OnPush,
2093
- template: '<ng-content></ng-content>',
2094
- inputs: ['autoShowTooltip', 'name', 'tooltip']
2095
- },] }
2096
- ];
2097
- AmplifyIconButton.ctorParameters = () => [
2098
- { type: ChangeDetectorRef },
2099
- { type: ElementRef },
2100
- { type: NgZone }
2101
- ];
2102
- AmplifyIconButton = __decorate([
2103
- ProxyCmp({ inputs: ['autoShowTooltip', 'name', 'tooltip'] })
2104
- ], AmplifyIconButton);
2105
- let AmplifyInput = class AmplifyInput {
2106
- constructor(c, r, z) {
2107
- this.z = z;
2108
- c.detach();
2109
- this.el = r.nativeElement;
2110
- }
2111
- };
2112
- AmplifyInput.decorators = [
2113
- { type: Component, args: [{
2114
- selector: 'amplify-input',
2115
- changeDetection: ChangeDetectionStrategy.OnPush,
2116
- template: '<ng-content></ng-content>',
2117
- inputs: [
2118
- 'description',
2119
- 'disabled',
2120
- 'fieldId',
2121
- 'handleInputChange',
2122
- 'inputProps',
2123
- 'name',
2124
- 'placeholder',
2125
- 'required',
2126
- 'type',
2127
- 'value',
2128
- ]
2129
- },] }
2130
- ];
2131
- AmplifyInput.ctorParameters = () => [
2132
- { type: ChangeDetectorRef },
2133
- { type: ElementRef },
2134
- { type: NgZone }
2135
- ];
2136
- AmplifyInput = __decorate([
2137
- ProxyCmp({
2138
- inputs: [
2139
- 'description',
2140
- 'disabled',
2141
- 'fieldId',
2142
- 'handleInputChange',
2143
- 'inputProps',
2144
- 'name',
2145
- 'placeholder',
2146
- 'required',
2147
- 'type',
2148
- 'value',
2149
- ],
2150
- })
2151
- ], AmplifyInput);
2152
- let AmplifyLabel = class AmplifyLabel {
2153
- constructor(c, r, z) {
2154
- this.z = z;
2155
- c.detach();
2156
- this.el = r.nativeElement;
2157
- }
2158
- };
2159
- AmplifyLabel.decorators = [
2160
- { type: Component, args: [{
2161
- selector: 'amplify-label',
2162
- changeDetection: ChangeDetectionStrategy.OnPush,
2163
- template: '<ng-content></ng-content>',
2164
- inputs: ['htmlFor']
2165
- },] }
2166
- ];
2167
- AmplifyLabel.ctorParameters = () => [
2168
- { type: ChangeDetectorRef },
2169
- { type: ElementRef },
2170
- { type: NgZone }
2171
- ];
2172
- AmplifyLabel = __decorate([
2173
- ProxyCmp({ inputs: ['htmlFor'] })
2174
- ], AmplifyLabel);
2175
- let AmplifyLink = class AmplifyLink {
2176
- constructor(c, r, z) {
2177
- this.z = z;
2178
- c.detach();
2179
- this.el = r.nativeElement;
2180
- }
2181
- };
2182
- AmplifyLink.decorators = [
2183
- { type: Component, args: [{
2184
- selector: 'amplify-link',
2185
- changeDetection: ChangeDetectionStrategy.OnPush,
2186
- template: '<ng-content></ng-content>',
2187
- inputs: ['role']
2188
- },] }
2189
- ];
2190
- AmplifyLink.ctorParameters = () => [
2191
- { type: ChangeDetectorRef },
2192
- { type: ElementRef },
2193
- { type: NgZone }
2194
- ];
2195
- AmplifyLink = __decorate([
2196
- ProxyCmp({ inputs: ['role'] })
2197
- ], AmplifyLink);
2198
- class AmplifyLoadingSpinner {
2199
- constructor(c, r, z) {
2200
- this.z = z;
2201
- c.detach();
2202
- this.el = r.nativeElement;
2203
- }
2204
- }
2205
- AmplifyLoadingSpinner.decorators = [
2206
- { type: Component, args: [{
2207
- selector: 'amplify-loading-spinner',
2208
- changeDetection: ChangeDetectionStrategy.OnPush,
2209
- template: '<ng-content></ng-content>'
2210
- },] }
2211
- ];
2212
- AmplifyLoadingSpinner.ctorParameters = () => [
2213
- { type: ChangeDetectorRef },
2214
- { type: ElementRef },
2215
- { type: NgZone }
2216
- ];
2217
- class AmplifyNav {
2218
- constructor(c, r, z) {
2219
- this.z = z;
2220
- c.detach();
2221
- this.el = r.nativeElement;
2222
- }
2223
- }
2224
- AmplifyNav.decorators = [
2225
- { type: Component, args: [{
2226
- selector: 'amplify-nav',
2227
- changeDetection: ChangeDetectionStrategy.OnPush,
2228
- template: '<ng-content></ng-content>'
2229
- },] }
2230
- ];
2231
- AmplifyNav.ctorParameters = () => [
2232
- { type: ChangeDetectorRef },
2233
- { type: ElementRef },
2234
- { type: NgZone }
2235
- ];
2236
- let AmplifyOauthButton = class AmplifyOauthButton {
2237
- constructor(c, r, z) {
2238
- this.z = z;
2239
- c.detach();
2240
- this.el = r.nativeElement;
2241
- }
2242
- };
2243
- AmplifyOauthButton.decorators = [
2244
- { type: Component, args: [{
2245
- selector: 'amplify-oauth-button',
2246
- changeDetection: ChangeDetectionStrategy.OnPush,
2247
- template: '<ng-content></ng-content>',
2248
- inputs: ['config']
2249
- },] }
2250
- ];
2251
- AmplifyOauthButton.ctorParameters = () => [
2252
- { type: ChangeDetectorRef },
2253
- { type: ElementRef },
2254
- { type: NgZone }
2255
- ];
2256
- AmplifyOauthButton = __decorate([
2257
- ProxyCmp({ inputs: ['config'] })
2258
- ], AmplifyOauthButton);
2259
- let AmplifyPasswordField = class AmplifyPasswordField {
2260
- constructor(c, r, z) {
2261
- this.z = z;
2262
- c.detach();
2263
- this.el = r.nativeElement;
2264
- }
2265
- };
2266
- AmplifyPasswordField.decorators = [
2267
- { type: Component, args: [{
2268
- selector: 'amplify-password-field',
2269
- changeDetection: ChangeDetectionStrategy.OnPush,
2270
- template: '<ng-content></ng-content>',
2271
- inputs: [
2272
- 'disabled',
2273
- 'fieldId',
2274
- 'handleInputChange',
2275
- 'hint',
2276
- 'inputProps',
2277
- 'label',
2278
- 'placeholder',
2279
- 'required',
2280
- 'value',
2281
- ]
2282
- },] }
2283
- ];
2284
- AmplifyPasswordField.ctorParameters = () => [
2285
- { type: ChangeDetectorRef },
2286
- { type: ElementRef },
2287
- { type: NgZone }
2288
- ];
2289
- AmplifyPasswordField = __decorate([
2290
- ProxyCmp({
2291
- inputs: [
2292
- 'disabled',
2293
- 'fieldId',
2294
- 'handleInputChange',
2295
- 'hint',
2296
- 'inputProps',
2297
- 'label',
2298
- 'placeholder',
2299
- 'required',
2300
- 'value',
2301
- ],
2302
- })
2303
- ], AmplifyPasswordField);
2304
- let AmplifyPhoneField = class AmplifyPhoneField {
2305
- constructor(c, r, z) {
2306
- this.z = z;
2307
- c.detach();
2308
- this.el = r.nativeElement;
2309
- }
2310
- };
2311
- AmplifyPhoneField.decorators = [
2312
- { type: Component, args: [{
2313
- selector: 'amplify-phone-field',
2314
- changeDetection: ChangeDetectionStrategy.OnPush,
2315
- template: '<ng-content></ng-content>',
2316
- inputs: [
2317
- 'dialCode',
2318
- 'disabled',
2319
- 'fieldId',
2320
- 'handleInputChange',
2321
- 'hint',
2322
- 'inputProps',
2323
- 'label',
2324
- 'placeholder',
2325
- 'required',
2326
- 'value',
2327
- ]
2328
- },] }
2329
- ];
2330
- AmplifyPhoneField.ctorParameters = () => [
2331
- { type: ChangeDetectorRef },
2332
- { type: ElementRef },
2333
- { type: NgZone }
2334
- ];
2335
- AmplifyPhoneField = __decorate([
2336
- ProxyCmp({
2337
- inputs: [
2338
- 'dialCode',
2339
- 'disabled',
2340
- 'fieldId',
2341
- 'handleInputChange',
2342
- 'hint',
2343
- 'inputProps',
2344
- 'label',
2345
- 'placeholder',
2346
- 'required',
2347
- 'value',
2348
- ],
2349
- })
2350
- ], AmplifyPhoneField);
2351
- let AmplifyPhotoPicker = class AmplifyPhotoPicker {
2352
- constructor(c, r, z) {
2353
- this.z = z;
2354
- c.detach();
2355
- this.el = r.nativeElement;
2356
- }
2357
- };
2358
- AmplifyPhotoPicker.decorators = [
2359
- { type: Component, args: [{
2360
- selector: 'amplify-photo-picker',
2361
- changeDetection: ChangeDetectionStrategy.OnPush,
2362
- template: '<ng-content></ng-content>',
2363
- inputs: [
2364
- 'buttonText',
2365
- 'handleClick',
2366
- 'headerHint',
2367
- 'headerTitle',
2368
- 'placeholderHint',
2369
- 'previewSrc',
2370
- ]
2371
- },] }
2372
- ];
2373
- AmplifyPhotoPicker.ctorParameters = () => [
2374
- { type: ChangeDetectorRef },
2375
- { type: ElementRef },
2376
- { type: NgZone }
2377
- ];
2378
- AmplifyPhotoPicker = __decorate([
2379
- ProxyCmp({
2380
- inputs: [
2381
- 'buttonText',
2382
- 'handleClick',
2383
- 'headerHint',
2384
- 'headerTitle',
2385
- 'placeholderHint',
2386
- 'previewSrc',
2387
- ],
2388
- })
2389
- ], AmplifyPhotoPicker);
2390
- let AmplifyPicker = class AmplifyPicker {
2391
- constructor(c, r, z) {
2392
- this.z = z;
2393
- c.detach();
2394
- this.el = r.nativeElement;
2395
- }
2396
- };
2397
- AmplifyPicker.decorators = [
2398
- { type: Component, args: [{
2399
- selector: 'amplify-picker',
2400
- changeDetection: ChangeDetectionStrategy.OnPush,
2401
- template: '<ng-content></ng-content>',
2402
- inputs: ['acceptValue', 'inputHandler', 'pickerText']
2403
- },] }
2404
- ];
2405
- AmplifyPicker.ctorParameters = () => [
2406
- { type: ChangeDetectorRef },
2407
- { type: ElementRef },
2408
- { type: NgZone }
2409
- ];
2410
- AmplifyPicker = __decorate([
2411
- ProxyCmp({ inputs: ['acceptValue', 'inputHandler', 'pickerText'] })
2412
- ], AmplifyPicker);
2413
- let AmplifyRadioButton = class AmplifyRadioButton {
2414
- constructor(c, r, z) {
2415
- this.z = z;
2416
- c.detach();
2417
- this.el = r.nativeElement;
2418
- }
2419
- };
2420
- AmplifyRadioButton.decorators = [
2421
- { type: Component, args: [{
2422
- selector: 'amplify-radio-button',
2423
- changeDetection: ChangeDetectionStrategy.OnPush,
2424
- template: '<ng-content></ng-content>',
2425
- inputs: [
2426
- 'checked',
2427
- 'disabled',
2428
- 'fieldId',
2429
- 'handleInputChange',
2430
- 'inputProps',
2431
- 'label',
2432
- 'name',
2433
- 'placeholder',
2434
- 'value',
2435
- ]
2436
- },] }
2437
- ];
2438
- AmplifyRadioButton.ctorParameters = () => [
2439
- { type: ChangeDetectorRef },
2440
- { type: ElementRef },
2441
- { type: NgZone }
2442
- ];
2443
- AmplifyRadioButton = __decorate([
2444
- ProxyCmp({
2445
- inputs: [
2446
- 'checked',
2447
- 'disabled',
2448
- 'fieldId',
2449
- 'handleInputChange',
2450
- 'inputProps',
2451
- 'label',
2452
- 'name',
2453
- 'placeholder',
2454
- 'value',
2455
- ],
2456
- })
2457
- ], AmplifyRadioButton);
2458
- let AmplifyRequireNewPassword = class AmplifyRequireNewPassword {
2459
- constructor(c, r, z) {
2460
- this.z = z;
2461
- c.detach();
2462
- this.el = r.nativeElement;
2463
- }
2464
- };
2465
- AmplifyRequireNewPassword.decorators = [
2466
- { type: Component, args: [{
2467
- selector: 'amplify-require-new-password',
2468
- changeDetection: ChangeDetectionStrategy.OnPush,
2469
- template: '<ng-content></ng-content>',
2470
- inputs: [
2471
- 'formFields',
2472
- 'handleAuthStateChange',
2473
- 'handleSubmit',
2474
- 'headerText',
2475
- 'submitButtonText',
2476
- 'user',
2477
- ]
2478
- },] }
2479
- ];
2480
- AmplifyRequireNewPassword.ctorParameters = () => [
2481
- { type: ChangeDetectorRef },
2482
- { type: ElementRef },
2483
- { type: NgZone }
2484
- ];
2485
- AmplifyRequireNewPassword = __decorate([
2486
- ProxyCmp({
2487
- inputs: [
2488
- 'formFields',
2489
- 'handleAuthStateChange',
2490
- 'handleSubmit',
2491
- 'headerText',
2492
- 'submitButtonText',
2493
- 'user',
2494
- ],
2495
- })
2496
- ], AmplifyRequireNewPassword);
2497
- let AmplifyS3Album = class AmplifyS3Album {
2498
- constructor(c, r, z) {
2499
- this.z = z;
2500
- c.detach();
2501
- this.el = r.nativeElement;
2502
- }
2503
- };
2504
- AmplifyS3Album.decorators = [
2505
- { type: Component, args: [{
2506
- selector: 'amplify-s3-album',
2507
- changeDetection: ChangeDetectionStrategy.OnPush,
2508
- template: '<ng-content></ng-content>',
2509
- inputs: [
2510
- 'contentType',
2511
- 'fileToKey',
2512
- 'filter',
2513
- 'handleOnError',
2514
- 'handleOnLoad',
2515
- 'identityId',
2516
- 'level',
2517
- 'path',
2518
- 'picker',
2519
- 'pickerText',
2520
- 'sort',
2521
- 'track',
2522
- ]
2523
- },] }
2524
- ];
2525
- AmplifyS3Album.ctorParameters = () => [
2526
- { type: ChangeDetectorRef },
2527
- { type: ElementRef },
2528
- { type: NgZone }
2529
- ];
2530
- AmplifyS3Album = __decorate([
2531
- ProxyCmp({
2532
- inputs: [
2533
- 'contentType',
2534
- 'fileToKey',
2535
- 'filter',
2536
- 'handleOnError',
2537
- 'handleOnLoad',
2538
- 'identityId',
2539
- 'level',
2540
- 'path',
2541
- 'picker',
2542
- 'pickerText',
2543
- 'sort',
2544
- 'track',
2545
- ],
2546
- })
2547
- ], AmplifyS3Album);
2548
- let AmplifyS3Image = class AmplifyS3Image {
2549
- constructor(c, r, z) {
2550
- this.z = z;
2551
- c.detach();
2552
- this.el = r.nativeElement;
2553
- }
2554
- };
2555
- AmplifyS3Image.decorators = [
2556
- { type: Component, args: [{
2557
- selector: 'amplify-s3-image',
2558
- changeDetection: ChangeDetectionStrategy.OnPush,
2559
- template: '<ng-content></ng-content>',
2560
- inputs: [
2561
- 'alt',
2562
- 'body',
2563
- 'contentType',
2564
- 'handleOnError',
2565
- 'handleOnLoad',
2566
- 'identityId',
2567
- 'imgKey',
2568
- 'imgProps',
2569
- 'level',
2570
- 'path',
2571
- 'track',
2572
- ]
2573
- },] }
2574
- ];
2575
- AmplifyS3Image.ctorParameters = () => [
2576
- { type: ChangeDetectorRef },
2577
- { type: ElementRef },
2578
- { type: NgZone }
2579
- ];
2580
- AmplifyS3Image = __decorate([
2581
- ProxyCmp({
2582
- inputs: [
2583
- 'alt',
2584
- 'body',
2585
- 'contentType',
2586
- 'handleOnError',
2587
- 'handleOnLoad',
2588
- 'identityId',
2589
- 'imgKey',
2590
- 'imgProps',
2591
- 'level',
2592
- 'path',
2593
- 'track',
2594
- ],
2595
- })
2596
- ], AmplifyS3Image);
2597
- let AmplifyS3ImagePicker = class AmplifyS3ImagePicker {
2598
- constructor(c, r, z) {
2599
- this.z = z;
2600
- c.detach();
2601
- this.el = r.nativeElement;
2602
- }
2603
- };
2604
- AmplifyS3ImagePicker.decorators = [
2605
- { type: Component, args: [{
2606
- selector: 'amplify-s3-image-picker',
2607
- changeDetection: ChangeDetectionStrategy.OnPush,
2608
- template: '<ng-content></ng-content>',
2609
- inputs: [
2610
- 'buttonText',
2611
- 'contentType',
2612
- 'fileToKey',
2613
- 'headerHint',
2614
- 'headerTitle',
2615
- 'identityId',
2616
- 'level',
2617
- 'path',
2618
- 'placeholderHint',
2619
- 'track',
2620
- ]
2621
- },] }
2622
- ];
2623
- AmplifyS3ImagePicker.ctorParameters = () => [
2624
- { type: ChangeDetectorRef },
2625
- { type: ElementRef },
2626
- { type: NgZone }
2627
- ];
2628
- AmplifyS3ImagePicker = __decorate([
2629
- ProxyCmp({
2630
- inputs: [
2631
- 'buttonText',
2632
- 'contentType',
2633
- 'fileToKey',
2634
- 'headerHint',
2635
- 'headerTitle',
2636
- 'identityId',
2637
- 'level',
2638
- 'path',
2639
- 'placeholderHint',
2640
- 'track',
2641
- ],
2642
- })
2643
- ], AmplifyS3ImagePicker);
2644
- let AmplifyS3Text = class AmplifyS3Text {
2645
- constructor(c, r, z) {
2646
- this.z = z;
2647
- c.detach();
2648
- this.el = r.nativeElement;
2649
- }
2650
- };
2651
- AmplifyS3Text.decorators = [
2652
- { type: Component, args: [{
2653
- selector: 'amplify-s3-text',
2654
- changeDetection: ChangeDetectionStrategy.OnPush,
2655
- template: '<ng-content></ng-content>',
2656
- inputs: [
2657
- 'body',
2658
- 'contentType',
2659
- 'fallbackText',
2660
- 'identityId',
2661
- 'level',
2662
- 'path',
2663
- 'textKey',
2664
- 'track',
2665
- ]
2666
- },] }
2667
- ];
2668
- AmplifyS3Text.ctorParameters = () => [
2669
- { type: ChangeDetectorRef },
2670
- { type: ElementRef },
2671
- { type: NgZone }
2672
- ];
2673
- AmplifyS3Text = __decorate([
2674
- ProxyCmp({
2675
- inputs: [
2676
- 'body',
2677
- 'contentType',
2678
- 'fallbackText',
2679
- 'identityId',
2680
- 'level',
2681
- 'path',
2682
- 'textKey',
2683
- 'track',
2684
- ],
2685
- })
2686
- ], AmplifyS3Text);
2687
- let AmplifyS3TextPicker = class AmplifyS3TextPicker {
2688
- constructor(c, r, z) {
2689
- this.z = z;
2690
- c.detach();
2691
- this.el = r.nativeElement;
2692
- }
2693
- };
2694
- AmplifyS3TextPicker.decorators = [
2695
- { type: Component, args: [{
2696
- selector: 'amplify-s3-text-picker',
2697
- changeDetection: ChangeDetectionStrategy.OnPush,
2698
- template: '<ng-content></ng-content>',
2699
- inputs: [
2700
- 'contentType',
2701
- 'fallbackText',
2702
- 'fileToKey',
2703
- 'identityId',
2704
- 'level',
2705
- 'path',
2706
- 'track',
2707
- ]
2708
- },] }
2709
- ];
2710
- AmplifyS3TextPicker.ctorParameters = () => [
2711
- { type: ChangeDetectorRef },
2712
- { type: ElementRef },
2713
- { type: NgZone }
2714
- ];
2715
- AmplifyS3TextPicker = __decorate([
2716
- ProxyCmp({
2717
- inputs: [
2718
- 'contentType',
2719
- 'fallbackText',
2720
- 'fileToKey',
2721
- 'identityId',
2722
- 'level',
2723
- 'path',
2724
- 'track',
2725
- ],
2726
- })
2727
- ], AmplifyS3TextPicker);
2728
- let AmplifySection = class AmplifySection {
2729
- constructor(c, r, z) {
2730
- this.z = z;
2731
- c.detach();
2732
- this.el = r.nativeElement;
2733
- }
2734
- };
2735
- AmplifySection.decorators = [
2736
- { type: Component, args: [{
2737
- selector: 'amplify-section',
2738
- changeDetection: ChangeDetectionStrategy.OnPush,
2739
- template: '<ng-content></ng-content>',
2740
- inputs: ['role']
2741
- },] }
2742
- ];
2743
- AmplifySection.ctorParameters = () => [
2744
- { type: ChangeDetectorRef },
2745
- { type: ElementRef },
2746
- { type: NgZone }
2747
- ];
2748
- AmplifySection = __decorate([
2749
- ProxyCmp({ inputs: ['role'] })
2750
- ], AmplifySection);
2751
- let AmplifySelect = class AmplifySelect {
2752
- constructor(c, r, z) {
2753
- this.z = z;
2754
- c.detach();
2755
- this.el = r.nativeElement;
2756
- }
2757
- };
2758
- AmplifySelect.decorators = [
2759
- { type: Component, args: [{
2760
- selector: 'amplify-select',
2761
- changeDetection: ChangeDetectionStrategy.OnPush,
2762
- template: '<ng-content></ng-content>',
2763
- inputs: ['fieldId', 'handleInputChange', 'options', 'selected']
2764
- },] }
2765
- ];
2766
- AmplifySelect.ctorParameters = () => [
2767
- { type: ChangeDetectorRef },
2768
- { type: ElementRef },
2769
- { type: NgZone }
2770
- ];
2771
- AmplifySelect = __decorate([
2772
- ProxyCmp({ inputs: ['fieldId', 'handleInputChange', 'options', 'selected'] })
2773
- ], AmplifySelect);
2774
- let AmplifySelectMfaType = class AmplifySelectMfaType {
2775
- constructor(c, r, z) {
2776
- this.z = z;
2777
- c.detach();
2778
- this.el = r.nativeElement;
2779
- }
2780
- };
2781
- AmplifySelectMfaType.decorators = [
2782
- { type: Component, args: [{
2783
- selector: 'amplify-select-mfa-type',
2784
- changeDetection: ChangeDetectionStrategy.OnPush,
2785
- template: '<ng-content></ng-content>',
2786
- inputs: ['MFATypes', 'authData', 'handleSubmit']
2787
- },] }
2788
- ];
2789
- AmplifySelectMfaType.ctorParameters = () => [
2790
- { type: ChangeDetectorRef },
2791
- { type: ElementRef },
2792
- { type: NgZone }
2793
- ];
2794
- AmplifySelectMfaType = __decorate([
2795
- ProxyCmp({ inputs: ['MFATypes', 'authData', 'handleSubmit'] })
2796
- ], AmplifySelectMfaType);
2797
- let AmplifySignIn = class AmplifySignIn {
2798
- constructor(c, r, z) {
2799
- this.z = z;
2800
- c.detach();
2801
- this.el = r.nativeElement;
2802
- }
2803
- };
2804
- AmplifySignIn.decorators = [
2805
- { type: Component, args: [{
2806
- selector: 'amplify-sign-in',
2807
- changeDetection: ChangeDetectionStrategy.OnPush,
2808
- template: '<ng-content></ng-content>',
2809
- inputs: [
2810
- 'federated',
2811
- 'formFields',
2812
- 'handleAuthStateChange',
2813
- 'handleSubmit',
2814
- 'headerText',
2815
- 'hideSignUp',
2816
- 'submitButtonText',
2817
- 'usernameAlias',
2818
- ]
2819
- },] }
2820
- ];
2821
- AmplifySignIn.ctorParameters = () => [
2822
- { type: ChangeDetectorRef },
2823
- { type: ElementRef },
2824
- { type: NgZone }
2825
- ];
2826
- AmplifySignIn = __decorate([
2827
- ProxyCmp({
2828
- inputs: [
2829
- 'federated',
2830
- 'formFields',
2831
- 'handleAuthStateChange',
2832
- 'handleSubmit',
2833
- 'headerText',
2834
- 'hideSignUp',
2835
- 'submitButtonText',
2836
- 'usernameAlias',
2837
- ],
2838
- })
2839
- ], AmplifySignIn);
2840
- let AmplifySignInButton = class AmplifySignInButton {
2841
- constructor(c, r, z) {
2842
- this.z = z;
2843
- c.detach();
2844
- this.el = r.nativeElement;
2845
- }
2846
- };
2847
- AmplifySignInButton.decorators = [
2848
- { type: Component, args: [{
2849
- selector: 'amplify-sign-in-button',
2850
- changeDetection: ChangeDetectionStrategy.OnPush,
2851
- template: '<ng-content></ng-content>',
2852
- inputs: ['provider']
2853
- },] }
2854
- ];
2855
- AmplifySignInButton.ctorParameters = () => [
2856
- { type: ChangeDetectorRef },
2857
- { type: ElementRef },
2858
- { type: NgZone }
2859
- ];
2860
- AmplifySignInButton = __decorate([
2861
- ProxyCmp({ inputs: ['provider'] })
2862
- ], AmplifySignInButton);
2863
- let AmplifySignOut = class AmplifySignOut {
2864
- constructor(c, r, z) {
2865
- this.z = z;
2866
- c.detach();
2867
- this.el = r.nativeElement;
2868
- }
2869
- };
2870
- AmplifySignOut.decorators = [
2871
- { type: Component, args: [{
2872
- selector: 'amplify-sign-out',
2873
- changeDetection: ChangeDetectionStrategy.OnPush,
2874
- template: '<ng-content></ng-content>',
2875
- inputs: ['buttonText', 'handleAuthStateChange']
2876
- },] }
2877
- ];
2878
- AmplifySignOut.ctorParameters = () => [
2879
- { type: ChangeDetectorRef },
2880
- { type: ElementRef },
2881
- { type: NgZone }
2882
- ];
2883
- AmplifySignOut = __decorate([
2884
- ProxyCmp({ inputs: ['buttonText', 'handleAuthStateChange'] })
2885
- ], AmplifySignOut);
2886
- let AmplifySignUp = class AmplifySignUp {
2887
- constructor(c, r, z) {
2888
- this.z = z;
2889
- c.detach();
2890
- this.el = r.nativeElement;
2891
- }
2892
- };
2893
- AmplifySignUp.decorators = [
2894
- { type: Component, args: [{
2895
- selector: 'amplify-sign-up',
2896
- changeDetection: ChangeDetectionStrategy.OnPush,
2897
- template: '<ng-content></ng-content>',
2898
- inputs: [
2899
- 'formFields',
2900
- 'handleAuthStateChange',
2901
- 'handleSignUp',
2902
- 'handleSubmit',
2903
- 'haveAccountText',
2904
- 'headerText',
2905
- 'signInText',
2906
- 'submitButtonText',
2907
- 'usernameAlias',
2908
- 'validationErrors',
2909
- ]
2910
- },] }
2911
- ];
2912
- AmplifySignUp.ctorParameters = () => [
2913
- { type: ChangeDetectorRef },
2914
- { type: ElementRef },
2915
- { type: NgZone }
2916
- ];
2917
- AmplifySignUp = __decorate([
2918
- ProxyCmp({
2919
- inputs: [
2920
- 'formFields',
2921
- 'handleAuthStateChange',
2922
- 'handleSignUp',
2923
- 'handleSubmit',
2924
- 'haveAccountText',
2925
- 'headerText',
2926
- 'signInText',
2927
- 'submitButtonText',
2928
- 'usernameAlias',
2929
- 'validationErrors',
2930
- ],
2931
- })
2932
- ], AmplifySignUp);
2933
- class AmplifyStrike {
2934
- constructor(c, r, z) {
2935
- this.z = z;
2936
- c.detach();
2937
- this.el = r.nativeElement;
2938
- }
2939
- }
2940
- AmplifyStrike.decorators = [
2941
- { type: Component, args: [{
2942
- selector: 'amplify-strike',
2943
- changeDetection: ChangeDetectionStrategy.OnPush,
2944
- template: '<ng-content></ng-content>'
2945
- },] }
2946
- ];
2947
- AmplifyStrike.ctorParameters = () => [
2948
- { type: ChangeDetectorRef },
2949
- { type: ElementRef },
2950
- { type: NgZone }
2951
- ];
2952
- let AmplifyToast = class AmplifyToast {
2953
- constructor(c, r, z) {
2954
- this.z = z;
2955
- c.detach();
2956
- this.el = r.nativeElement;
2957
- }
2958
- };
2959
- AmplifyToast.decorators = [
2960
- { type: Component, args: [{
2961
- selector: 'amplify-toast',
2962
- changeDetection: ChangeDetectionStrategy.OnPush,
2963
- template: '<ng-content></ng-content>',
2964
- inputs: ['handleClose', 'message']
2965
- },] }
2966
- ];
2967
- AmplifyToast.ctorParameters = () => [
2968
- { type: ChangeDetectorRef },
2969
- { type: ElementRef },
2970
- { type: NgZone }
2971
- ];
2972
- AmplifyToast = __decorate([
2973
- ProxyCmp({ inputs: ['handleClose', 'message'] })
2974
- ], AmplifyToast);
2975
- let AmplifyTooltip = class AmplifyTooltip {
2976
- constructor(c, r, z) {
2977
- this.z = z;
2978
- c.detach();
2979
- this.el = r.nativeElement;
2980
- }
2981
- };
2982
- AmplifyTooltip.decorators = [
2983
- { type: Component, args: [{
2984
- selector: 'amplify-tooltip',
2985
- changeDetection: ChangeDetectionStrategy.OnPush,
2986
- template: '<ng-content></ng-content>',
2987
- inputs: ['shouldAutoShow', 'text']
2988
- },] }
2989
- ];
2990
- AmplifyTooltip.ctorParameters = () => [
2991
- { type: ChangeDetectorRef },
2992
- { type: ElementRef },
2993
- { type: NgZone }
2994
- ];
2995
- AmplifyTooltip = __decorate([
2996
- ProxyCmp({ inputs: ['shouldAutoShow', 'text'] })
2997
- ], AmplifyTooltip);
2998
- let AmplifyTotpSetup = class AmplifyTotpSetup {
2999
- constructor(c, r, z) {
3000
- this.z = z;
3001
- c.detach();
3002
- this.el = r.nativeElement;
3003
- }
3004
- };
3005
- AmplifyTotpSetup.decorators = [
3006
- { type: Component, args: [{
3007
- selector: 'amplify-totp-setup',
3008
- changeDetection: ChangeDetectionStrategy.OnPush,
3009
- template: '<ng-content></ng-content>',
3010
- inputs: [
3011
- 'handleAuthStateChange',
3012
- 'handleComplete',
3013
- 'headerText',
3014
- 'issuer',
3015
- 'standalone',
3016
- 'user',
3017
- ]
3018
- },] }
3019
- ];
3020
- AmplifyTotpSetup.ctorParameters = () => [
3021
- { type: ChangeDetectorRef },
3022
- { type: ElementRef },
3023
- { type: NgZone }
3024
- ];
3025
- AmplifyTotpSetup = __decorate([
3026
- ProxyCmp({
3027
- inputs: [
3028
- 'handleAuthStateChange',
3029
- 'handleComplete',
3030
- 'headerText',
3031
- 'issuer',
3032
- 'standalone',
3033
- 'user',
3034
- ],
3035
- })
3036
- ], AmplifyTotpSetup);
3037
- let AmplifyUsernameField = class AmplifyUsernameField {
3038
- constructor(c, r, z) {
3039
- this.z = z;
3040
- c.detach();
3041
- this.el = r.nativeElement;
3042
- }
3043
- };
3044
- AmplifyUsernameField.decorators = [
3045
- { type: Component, args: [{
3046
- selector: 'amplify-username-field',
3047
- changeDetection: ChangeDetectionStrategy.OnPush,
3048
- template: '<ng-content></ng-content>',
3049
- inputs: [
3050
- 'disabled',
3051
- 'fieldId',
3052
- 'handleInputChange',
3053
- 'hint',
3054
- 'inputProps',
3055
- 'label',
3056
- 'placeholder',
3057
- 'required',
3058
- 'value',
3059
- ]
3060
- },] }
3061
- ];
3062
- AmplifyUsernameField.ctorParameters = () => [
3063
- { type: ChangeDetectorRef },
3064
- { type: ElementRef },
3065
- { type: NgZone }
3066
- ];
3067
- AmplifyUsernameField = __decorate([
3068
- ProxyCmp({
3069
- inputs: [
3070
- 'disabled',
3071
- 'fieldId',
3072
- 'handleInputChange',
3073
- 'hint',
3074
- 'inputProps',
3075
- 'label',
3076
- 'placeholder',
3077
- 'required',
3078
- 'value',
3079
- ],
3080
- })
3081
- ], AmplifyUsernameField);
3082
- let AmplifyVerifyContact = class AmplifyVerifyContact {
3083
- constructor(c, r, z) {
3084
- this.z = z;
3085
- c.detach();
3086
- this.el = r.nativeElement;
3087
- }
1194
+ AmplifySlotComponent.propDecorators = {
1195
+ name: [{ type: Input }],
1196
+ context: [{ type: Input }],
1197
+ display: [{ type: HostBinding, args: ['style.display',] }]
3088
1198
  };
3089
- AmplifyVerifyContact.decorators = [
3090
- { type: Component, args: [{
3091
- selector: 'amplify-verify-contact',
3092
- changeDetection: ChangeDetectionStrategy.OnPush,
3093
- template: '<ng-content></ng-content>',
3094
- inputs: ['handleAuthStateChange', 'user']
3095
- },] }
3096
- ];
3097
- AmplifyVerifyContact.ctorParameters = () => [
3098
- { type: ChangeDetectorRef },
3099
- { type: ElementRef },
3100
- { type: NgZone }
3101
- ];
3102
- AmplifyVerifyContact = __decorate([
3103
- ProxyCmp({ inputs: ['handleAuthStateChange', 'user'] })
3104
- ], AmplifyVerifyContact);
3105
1199
 
3106
- customElements.define('amplify-button', AmplifyButton$1);
3107
- customElements.define('amplify-input', AmplifyInput$1);
3108
- customElements.define('amplify-toast', AmplifyToast$1);
3109
- customElements.define('amplify-chatbot', AmplifyChatbot$1);
3110
- customElements.define('amplify-s3-album', AmplifyS3Album$1);
3111
- customElements.define('amplify-s3-image-picker', AmplifyS3ImagePicker$1);
3112
- customElements.define('amplify-s3-text', AmplifyS3Text$1);
3113
- customElements.define('amplify-s3-text-picker', AmplifyS3TextPicker$1);
3114
- customElements.define('amplify-s3-image', AmplifyS3Image$1);
3115
- customElements.define('amplify-picker', AmplifyPicker$1);
3116
- customElements.define('amplify-photo-picker', AmplifyPhotoPicker$1);
3117
- class UiAngularModule {
1200
+ class AmplifyAuthenticatorModule {
3118
1201
  }
3119
- UiAngularModule.decorators = [
1202
+ AmplifyAuthenticatorModule.decorators = [
3120
1203
  { type: NgModule, args: [{
3121
1204
  declarations: [
3122
- AmplifyChatbot,
3123
- AmplifyToast,
3124
- AmplifyInput,
3125
- AmplifyButton,
3126
- AmplifyS3Album,
3127
- AmplifyS3ImagePicker,
3128
- AmplifyS3Text,
3129
- AmplifyS3TextPicker,
3130
- AmplifyS3Image,
3131
- AmplifyPicker,
3132
- AmplifyPhotoPicker,
3133
- AmplifyAuthenticatorComponent,
3134
- AmplifySignInComponent,
3135
- AmplifySignUpComponent,
3136
- AmplifyFormFieldComponent,
3137
- AmplifyErrorComponent,
1205
+ AmplifySlotComponent,
3138
1206
  AmplifySlotDirective,
3139
- AmplifyConfirmSignUpComponent,
3140
- AmplifyUserNameAliasComponent,
3141
- AmplifyConfirmSignInComponent,
3142
- AmplifySetupTotpComponent,
3143
- AmplifyForceNewPasswordComponent,
3144
- AmplifyFederatedSignInComponent,
3145
- AmplifyFederatedSignInButtonComponent,
3146
- AmplifyResetPasswordComponent,
3147
- AmplifyVerifyUserComponent,
1207
+ AuthenticatorComponent,
1208
+ ButtonComponent,
1209
+ CheckboxComponent,
3148
1210
  ConfirmResetPasswordComponent,
1211
+ ConfirmSignInComponent,
1212
+ ConfirmSignUpComponent,
3149
1213
  ConfirmVerifyUserComponent,
3150
- AmplifySelectComponent,
3151
- AmplifyButtonComponent,
3152
- AmplifyPasswordFieldComponent,
3153
- AmplifyTextFieldComponent,
3154
- TabsComponent,
1214
+ ErrorComponent,
1215
+ FederatedSignInButtonComponent,
1216
+ FederatedSignInComponent,
1217
+ ForceNewPasswordComponent,
1218
+ FormFieldComponent,
1219
+ PasswordFieldComponent,
1220
+ PhoneNumberFieldComponent,
1221
+ ResetPasswordComponent,
1222
+ SelectComponent,
1223
+ SetupTotpComponent,
1224
+ SignInComponent,
1225
+ SignUpComponent,
1226
+ SignUpFormFieldsComponent,
3155
1227
  TabItemComponent,
1228
+ TabsComponent,
1229
+ TextFieldComponent,
1230
+ UserNameAliasComponent,
1231
+ VerifyUserComponent,
3156
1232
  ],
3157
- imports: [CommonModule],
1233
+ imports: [CommonModule, BrowserModule],
3158
1234
  exports: [
3159
- AmplifyChatbot,
3160
- AmplifyToast,
3161
- AmplifyInput,
3162
- AmplifyButton,
3163
- AmplifyS3Album,
3164
- AmplifyS3ImagePicker,
3165
- AmplifyS3Text,
3166
- AmplifyS3TextPicker,
3167
- AmplifyS3Image,
3168
- AmplifyPicker,
3169
- AmplifyPhotoPicker,
3170
- AmplifyAuthenticatorComponent,
3171
- AmplifySignInComponent,
3172
- AmplifyFormFieldComponent,
3173
- AmplifyErrorComponent,
3174
1235
  AmplifySlotDirective,
1236
+ AuthenticatorComponent,
1237
+ CheckboxComponent,
1238
+ SignUpFormFieldsComponent,
1239
+ TextFieldComponent,
3175
1240
  ],
3176
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
3177
1241
  },] }
3178
1242
  ];
3179
1243
 
@@ -3185,5 +1249,5 @@ UiAngularModule.decorators = [
3185
1249
  * Generated bundle index. Do not edit.
3186
1250
  */
3187
1251
 
3188
- export { AmplifyAuthenticatorComponent, AmplifyButton, AmplifyChatbot, AmplifyConfirmSignInComponent, AmplifyConfirmSignUpComponent, AmplifyErrorComponent, AmplifyFederatedSignInButtonComponent, AmplifyFederatedSignInComponent, AmplifyForceNewPasswordComponent, AmplifyFormFieldComponent, AmplifyInput, AmplifyPhotoPicker, AmplifyPicker, AmplifyResetPasswordComponent, AmplifyS3Album, AmplifyS3Image, AmplifyS3ImagePicker, AmplifyS3Text, AmplifyS3TextPicker, AmplifySetupTotpComponent, AmplifySignInComponent, AmplifySignUpComponent, AmplifySlotDirective, AmplifyToast, AmplifyVerifyUserComponent, AuthPropService, ConfirmResetPasswordComponent, ConfirmVerifyUserComponent, StateMachineService, UiAngularModule, getAttributeMap, ProxyCmp as ɵa, AmplifyAuthenticatorComponent as ɵb, AmplifySignInComponent as ɵc, AmplifySignUpComponent as ɵd, AmplifyFormFieldComponent as ɵe, AmplifyErrorComponent as ɵf, AmplifyConfirmSignUpComponent as ɵg, AmplifyUserNameAliasComponent as ɵh, AmplifyConfirmSignInComponent as ɵi, AmplifySetupTotpComponent as ɵj, AmplifyForceNewPasswordComponent as ɵk, AmplifyFederatedSignInComponent as ɵl, AmplifyFederatedSignInButtonComponent as ɵm, AmplifyResetPasswordComponent as ɵn, AmplifyVerifyUserComponent as ɵo, ConfirmResetPasswordComponent as ɵp, ConfirmVerifyUserComponent as ɵq, AmplifySelectComponent as ɵr, AmplifyButtonComponent as ɵs, AmplifyPasswordFieldComponent as ɵt, AmplifyTextFieldComponent as ɵu, TabsComponent as ɵv, TabItemComponent as ɵw };
1252
+ export { AmplifyAuthenticatorModule, AmplifySlotDirective, AuthenticatorComponent, AuthenticatorService, ButtonComponent, CheckboxComponent, ConfirmResetPasswordComponent, ConfirmSignInComponent, ConfirmSignUpComponent, ConfirmVerifyUserComponent, CustomComponentsService, ErrorComponent, FederatedSignInButtonComponent, FederatedSignInComponent, ForceNewPasswordComponent, FormFieldComponent, PasswordFieldComponent, PhoneNumberFieldComponent, ResetPasswordComponent, SelectComponent, SetupTotpComponent, SignInComponent, SignUpComponent, SignUpFormFieldsComponent, TabItemComponent, TabsComponent, TextFieldComponent, UserNameAliasComponent, VerifyUserComponent, getAttributeMap, AmplifySlotComponent as ɵa, AuthenticatorComponent as ɵb, ButtonComponent as ɵc, CheckboxComponent as ɵd, ConfirmResetPasswordComponent as ɵe, ConfirmSignInComponent as ɵf, ConfirmSignUpComponent as ɵg, ConfirmVerifyUserComponent as ɵh, ErrorComponent as ɵi, FederatedSignInButtonComponent as ɵj, FederatedSignInComponent as ɵk, ForceNewPasswordComponent as ɵl, FormFieldComponent as ɵm, PasswordFieldComponent as ɵn, PhoneNumberFieldComponent as ɵo, ResetPasswordComponent as ɵp, SelectComponent as ɵq, SetupTotpComponent as ɵr, SignInComponent as ɵs, SignUpComponent as ɵt, SignUpFormFieldsComponent as ɵu, TabItemComponent as ɵv, TabsComponent as ɵw, TextFieldComponent as ɵx, UserNameAliasComponent as ɵy, VerifyUserComponent as ɵz };
3189
1253
  //# sourceMappingURL=aws-amplify-ui-angular.js.map