@aws-amplify/ui-angular 1.0.35-unstable.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -1
- package/aws-amplify-ui-angular.d.ts +30 -0
- package/aws-amplify-ui-angular.metadata.json +1 -0
- package/bundles/aws-amplify-ui-angular-legacy.umd.js +2229 -0
- package/bundles/aws-amplify-ui-angular-legacy.umd.js.map +1 -0
- package/bundles/aws-amplify-ui-angular-legacy.umd.min.js +16 -0
- package/bundles/aws-amplify-ui-angular-legacy.umd.min.js.map +1 -0
- package/bundles/aws-amplify-ui-angular.umd.js +1840 -0
- package/bundles/aws-amplify-ui-angular.umd.js.map +1 -0
- package/bundles/aws-amplify-ui-angular.umd.min.js +2 -0
- package/bundles/aws-amplify-ui-angular.umd.min.js.map +1 -0
- package/esm2015/aws-amplify-ui-angular.js +31 -0
- package/esm2015/index.js +26 -0
- package/esm2015/legacy/aws-amplify-ui-angular-legacy.js +6 -0
- package/esm2015/legacy/index.js +3 -0
- package/esm2015/legacy/legacy-ui-angular.module.js +53 -0
- package/esm2015/legacy/proxies.js +1839 -0
- package/esm2015/lib/common/helpers.js +3 -0
- package/esm2015/lib/common/index.js +3 -0
- package/esm2015/lib/common/types/auth-types.js +2 -0
- package/esm2015/lib/common/types/component-types.js +2 -0
- package/esm2015/lib/common/types/index.js +3 -0
- package/esm2015/lib/components/authenticator/authenticator.module.js +79 -0
- package/esm2015/lib/components/authenticator/components/authenticator/authenticator.component.js +87 -0
- package/esm2015/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.js +40 -0
- package/esm2015/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.js +57 -0
- package/esm2015/lib/components/authenticator/components/confirm-sign-up/confirm-sign-up.component.js +39 -0
- package/esm2015/lib/components/authenticator/components/confirm-verify-user/amplify-confirm-verify-user.component.js +39 -0
- package/esm2015/lib/components/authenticator/components/federated-sign-in/federated-sign-in.component.js +47 -0
- package/esm2015/lib/components/authenticator/components/federated-sign-in-button/federated-sign-in-button.component.js +27 -0
- package/esm2015/lib/components/authenticator/components/force-new-password/force-new-password.component.js +39 -0
- package/esm2015/lib/components/authenticator/components/form-field/form-field.component.js +93 -0
- package/esm2015/lib/components/authenticator/components/index.js +17 -0
- package/esm2015/lib/components/authenticator/components/reset-password/reset-password.component.js +45 -0
- package/esm2015/lib/components/authenticator/components/setup-totp/setup-totp.component.js +65 -0
- package/esm2015/lib/components/authenticator/components/sign-in/sign-in.component.js +38 -0
- package/esm2015/lib/components/authenticator/components/sign-up/sign-up-form-fields/sign-up-form-fields.component.js +34 -0
- package/esm2015/lib/components/authenticator/components/sign-up/sign-up.component.js +37 -0
- package/esm2015/lib/components/authenticator/components/user-name-alias/user-name-alias.component.js +35 -0
- package/esm2015/lib/components/authenticator/components/verify-user/verify-user.component.js +54 -0
- package/esm2015/lib/primitives/button/button.component.js +38 -0
- package/esm2015/lib/primitives/checkbox/checkbox.component.js +31 -0
- package/esm2015/lib/primitives/error/error.component.js +16 -0
- package/esm2015/lib/primitives/index.js +10 -0
- package/esm2015/lib/primitives/password-field/password-field.component.js +43 -0
- package/esm2015/lib/primitives/phone-number-field/phone-number-field.component.js +40 -0
- package/esm2015/lib/primitives/select/select.component.js +17 -0
- package/esm2015/lib/primitives/tab-item/tab-item.component.js +20 -0
- package/esm2015/lib/primitives/tabs/tabs.component.js +45 -0
- package/esm2015/lib/primitives/text-field/text-field.component.js +35 -0
- package/esm2015/lib/services/authenticator.service.js +133 -0
- package/esm2015/lib/services/custom-components.service.js +23 -0
- package/esm2015/lib/utilities/amplify-slot/amplify-slot.component.js +32 -0
- package/esm2015/lib/utilities/amplify-slot/amplify-slot.directive.js +21 -0
- package/fesm2015/aws-amplify-ui-angular-legacy.js +1846 -0
- package/fesm2015/aws-amplify-ui-angular-legacy.js.map +1 -0
- package/fesm2015/aws-amplify-ui-angular.js +1253 -0
- package/fesm2015/aws-amplify-ui-angular.js.map +1 -0
- package/index.d.ts +22 -0
- package/{dist/core.d.ts → legacy/aws-amplify-ui-angular-legacy.d.ts} +1 -0
- package/legacy/aws-amplify-ui-angular-legacy.metadata.json +1 -0
- package/legacy/index.d.ts +2 -0
- package/legacy/legacy-ui-angular.module.d.ts +2 -0
- package/legacy/package.json +11 -0
- package/{dist/directives → legacy}/proxies.d.ts +0 -0
- package/lib/common/helpers.d.ts +2 -0
- package/lib/common/index.d.ts +2 -0
- package/lib/common/types/auth-types.d.ts +3 -0
- package/lib/common/types/component-types.d.ts +23 -0
- package/lib/common/types/index.d.ts +2 -0
- package/lib/components/authenticator/authenticator.module.d.ts +2 -0
- package/lib/components/authenticator/components/authenticator/authenticator.component.d.ts +67 -0
- package/lib/components/authenticator/components/confirm-reset-password/amplify-confirm-reset-password.component.d.ts +50 -0
- package/lib/components/authenticator/components/confirm-sign-in/confirm-sign-in.component.d.ts +52 -0
- package/lib/components/authenticator/components/confirm-sign-up/confirm-sign-up.component.d.ts +49 -0
- package/lib/components/authenticator/components/confirm-verify-user/amplify-confirm-verify-user.component.d.ts +49 -0
- package/lib/components/authenticator/components/federated-sign-in/federated-sign-in.component.d.ts +19 -0
- package/lib/components/authenticator/components/federated-sign-in-button/federated-sign-in-button.component.d.ts +9 -0
- package/lib/components/authenticator/components/force-new-password/force-new-password.component.d.ts +49 -0
- package/lib/components/authenticator/components/form-field/form-field.component.d.ts +36 -0
- package/lib/components/authenticator/components/index.d.ts +16 -0
- package/lib/components/authenticator/components/reset-password/reset-password.component.d.ts +52 -0
- package/lib/components/authenticator/components/setup-totp/setup-totp.component.d.ts +53 -0
- package/lib/components/authenticator/components/sign-in/sign-in.component.d.ts +48 -0
- package/lib/components/authenticator/components/sign-up/sign-up-form-fields/sign-up-form-fields.component.d.ts +12 -0
- package/lib/components/authenticator/components/sign-up/sign-up.component.d.ts +47 -0
- package/lib/components/authenticator/components/user-name-alias/user-name-alias.component.d.ts +15 -0
- package/lib/components/authenticator/components/verify-user/verify-user.component.d.ts +54 -0
- package/lib/primitives/button/button.component.d.ts +15 -0
- package/lib/primitives/checkbox/checkbox.component.d.ts +12 -0
- package/lib/primitives/error/error.component.d.ts +4 -0
- package/lib/primitives/index.d.ts +9 -0
- package/lib/primitives/password-field/password-field.component.d.ts +15 -0
- package/lib/primitives/phone-number-field/phone-number-field.component.d.ts +16 -0
- package/lib/primitives/select/select.component.d.ts +7 -0
- package/lib/primitives/tab-item/tab-item.component.d.ts +7 -0
- package/lib/primitives/tabs/tabs.component.d.ts +9 -0
- package/lib/primitives/text-field/text-field.component.d.ts +13 -0
- package/lib/services/authenticator.service.d.ts +94 -0
- package/lib/services/custom-components.service.d.ts +9 -0
- package/lib/utilities/amplify-slot/amplify-slot.component.d.ts +12 -0
- package/lib/utilities/amplify-slot/amplify-slot.directive.d.ts +7 -0
- package/package.json +29 -49
- package/theme.css +1 -0
- package/CHANGELOG.md +0 -328
- package/dist/amplify-module.d.ts +0 -2
- package/dist/core.metadata.json +0 -1
- package/dist/fesm2015.js +0 -1532
- package/dist/fesm5.js +0 -1319
- package/dist/index.d.ts +0 -2
|
@@ -0,0 +1,1840 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/platform-browser'), require('@aws-amplify/ui'), require('@aws-amplify/core'), require('xstate'), require('aws-amplify'), require('qrcode'), require('nanoid')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@aws-amplify/ui-angular', ['exports', '@angular/core', '@angular/common', '@angular/platform-browser', '@aws-amplify/ui', '@aws-amplify/core', 'xstate', 'aws-amplify', 'qrcode', 'nanoid'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["aws-amplify"] = global["aws-amplify"] || {}, global["aws-amplify"]["ui-angular"] = {}), global.ng.core, global.ng.common, global.ng.platformBrowser, global.ui, global.core, global.xstate, global["aws-amplify"], global.QRCode, global.nanoid));
|
|
5
|
+
})(this, (function (exports, i0, common, platformBrowser, ui, core, xstate, awsAmplify, QRCode, nanoid) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
function _interopNamespace(e) {
|
|
10
|
+
if (e && e.__esModule) return e;
|
|
11
|
+
var n = Object.create(null);
|
|
12
|
+
if (e) {
|
|
13
|
+
Object.keys(e).forEach(function (k) {
|
|
14
|
+
if (k !== 'default') {
|
|
15
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return e[k]; }
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
n["default"] = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
28
|
+
var QRCode__default = /*#__PURE__*/_interopDefaultLegacy(QRCode);
|
|
29
|
+
|
|
30
|
+
var AmplifySlotDirective = /** @class */ (function () {
|
|
31
|
+
function AmplifySlotDirective(template) {
|
|
32
|
+
this.template = template;
|
|
33
|
+
}
|
|
34
|
+
Object.defineProperty(AmplifySlotDirective.prototype, "amplifySlot", {
|
|
35
|
+
set: function (component) {
|
|
36
|
+
this.name = component;
|
|
37
|
+
},
|
|
38
|
+
enumerable: false,
|
|
39
|
+
configurable: true
|
|
40
|
+
});
|
|
41
|
+
return AmplifySlotDirective;
|
|
42
|
+
}());
|
|
43
|
+
AmplifySlotDirective.decorators = [
|
|
44
|
+
{ type: i0.Directive, args: [{
|
|
45
|
+
selector: '[amplifySlot]',
|
|
46
|
+
},] }
|
|
47
|
+
];
|
|
48
|
+
AmplifySlotDirective.ctorParameters = function () { return [
|
|
49
|
+
{ type: i0.TemplateRef }
|
|
50
|
+
]; };
|
|
51
|
+
AmplifySlotDirective.propDecorators = {
|
|
52
|
+
amplifySlot: [{ type: i0.Input }]
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Stores and provides custom components that users provide with `amplify-slot`.
|
|
57
|
+
*/
|
|
58
|
+
var CustomComponentsService = /** @class */ (function () {
|
|
59
|
+
function CustomComponentsService() {
|
|
60
|
+
this._customComponents = {};
|
|
61
|
+
}
|
|
62
|
+
Object.defineProperty(CustomComponentsService.prototype, "customComponents", {
|
|
63
|
+
get: function () {
|
|
64
|
+
return this._customComponents;
|
|
65
|
+
},
|
|
66
|
+
set: function (customComponents) {
|
|
67
|
+
this._customComponents = Object.assign(Object.assign({}, this._customComponents), customComponents);
|
|
68
|
+
},
|
|
69
|
+
enumerable: false,
|
|
70
|
+
configurable: true
|
|
71
|
+
});
|
|
72
|
+
return CustomComponentsService;
|
|
73
|
+
}());
|
|
74
|
+
CustomComponentsService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function CustomComponentsService_Factory() { return new CustomComponentsService(); }, token: CustomComponentsService, providedIn: "root" });
|
|
75
|
+
CustomComponentsService.decorators = [
|
|
76
|
+
{ type: i0.Injectable, args: [{
|
|
77
|
+
providedIn: 'root',
|
|
78
|
+
},] }
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
var logger$2 = new core.Logger('state-machine');
|
|
82
|
+
/**
|
|
83
|
+
* AuthenticatorService provides access to the authenticator state and context.
|
|
84
|
+
*/
|
|
85
|
+
var AuthenticatorService = /** @class */ (function () {
|
|
86
|
+
function AuthenticatorService() {
|
|
87
|
+
}
|
|
88
|
+
AuthenticatorService.prototype.startMachine = function (_b) {
|
|
89
|
+
var _this = this;
|
|
90
|
+
var initialState = _b.initialState, loginMechanisms = _b.loginMechanisms, services = _b.services, signUpAttributes = _b.signUpAttributes, socialProviders = _b.socialProviders;
|
|
91
|
+
var machine = ui.createAuthenticatorMachine({
|
|
92
|
+
initialState: initialState,
|
|
93
|
+
loginMechanisms: loginMechanisms,
|
|
94
|
+
services: services,
|
|
95
|
+
signUpAttributes: signUpAttributes,
|
|
96
|
+
socialProviders: socialProviders,
|
|
97
|
+
});
|
|
98
|
+
var authService = xstate.interpret(machine, {
|
|
99
|
+
devTools: process.env.NODE_ENV === 'development',
|
|
100
|
+
}).start();
|
|
101
|
+
this._subscription = authService.subscribe(function (state) {
|
|
102
|
+
_this._authState = state;
|
|
103
|
+
_this._facade = ui.getServiceContextFacade(state);
|
|
104
|
+
});
|
|
105
|
+
this._sendEventAliases = ui.getSendEventAliases(authService.send);
|
|
106
|
+
this._authService = authService;
|
|
107
|
+
};
|
|
108
|
+
AuthenticatorService.prototype.ngOnDestroy = function () {
|
|
109
|
+
if (this._subscription)
|
|
110
|
+
this._subscription.unsubscribe();
|
|
111
|
+
};
|
|
112
|
+
Object.defineProperty(AuthenticatorService.prototype, "error", {
|
|
113
|
+
/**
|
|
114
|
+
* Context facades
|
|
115
|
+
*/
|
|
116
|
+
get: function () {
|
|
117
|
+
var _a;
|
|
118
|
+
return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.error;
|
|
119
|
+
},
|
|
120
|
+
enumerable: false,
|
|
121
|
+
configurable: true
|
|
122
|
+
});
|
|
123
|
+
Object.defineProperty(AuthenticatorService.prototype, "hasValidationErrors", {
|
|
124
|
+
get: function () {
|
|
125
|
+
var _a;
|
|
126
|
+
return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.hasValidationErrors;
|
|
127
|
+
},
|
|
128
|
+
enumerable: false,
|
|
129
|
+
configurable: true
|
|
130
|
+
});
|
|
131
|
+
Object.defineProperty(AuthenticatorService.prototype, "isPending", {
|
|
132
|
+
get: function () {
|
|
133
|
+
var _a;
|
|
134
|
+
return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.isPending;
|
|
135
|
+
},
|
|
136
|
+
enumerable: false,
|
|
137
|
+
configurable: true
|
|
138
|
+
});
|
|
139
|
+
Object.defineProperty(AuthenticatorService.prototype, "route", {
|
|
140
|
+
get: function () {
|
|
141
|
+
var _a;
|
|
142
|
+
return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.route;
|
|
143
|
+
},
|
|
144
|
+
enumerable: false,
|
|
145
|
+
configurable: true
|
|
146
|
+
});
|
|
147
|
+
Object.defineProperty(AuthenticatorService.prototype, "user", {
|
|
148
|
+
get: function () {
|
|
149
|
+
var _a;
|
|
150
|
+
return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.user;
|
|
151
|
+
},
|
|
152
|
+
enumerable: false,
|
|
153
|
+
configurable: true
|
|
154
|
+
});
|
|
155
|
+
Object.defineProperty(AuthenticatorService.prototype, "validationErrors", {
|
|
156
|
+
get: function () {
|
|
157
|
+
var _a;
|
|
158
|
+
return (_a = this._facade) === null || _a === void 0 ? void 0 : _a.validationErrors;
|
|
159
|
+
},
|
|
160
|
+
enumerable: false,
|
|
161
|
+
configurable: true
|
|
162
|
+
});
|
|
163
|
+
Object.defineProperty(AuthenticatorService.prototype, "updateForm", {
|
|
164
|
+
/**
|
|
165
|
+
* Service facades
|
|
166
|
+
*/
|
|
167
|
+
get: function () {
|
|
168
|
+
return this._sendEventAliases.updateForm;
|
|
169
|
+
},
|
|
170
|
+
enumerable: false,
|
|
171
|
+
configurable: true
|
|
172
|
+
});
|
|
173
|
+
Object.defineProperty(AuthenticatorService.prototype, "resendCode", {
|
|
174
|
+
get: function () {
|
|
175
|
+
return this._sendEventAliases.resendCode;
|
|
176
|
+
},
|
|
177
|
+
enumerable: false,
|
|
178
|
+
configurable: true
|
|
179
|
+
});
|
|
180
|
+
Object.defineProperty(AuthenticatorService.prototype, "signOut", {
|
|
181
|
+
get: function () {
|
|
182
|
+
return this._sendEventAliases.signOut;
|
|
183
|
+
},
|
|
184
|
+
enumerable: false,
|
|
185
|
+
configurable: true
|
|
186
|
+
});
|
|
187
|
+
Object.defineProperty(AuthenticatorService.prototype, "submitForm", {
|
|
188
|
+
get: function () {
|
|
189
|
+
return this._sendEventAliases.submitForm;
|
|
190
|
+
},
|
|
191
|
+
enumerable: false,
|
|
192
|
+
configurable: true
|
|
193
|
+
});
|
|
194
|
+
Object.defineProperty(AuthenticatorService.prototype, "toFederatedSignIn", {
|
|
195
|
+
/**
|
|
196
|
+
* Transition facades
|
|
197
|
+
*/
|
|
198
|
+
get: function () {
|
|
199
|
+
return this._sendEventAliases.toFederatedSignIn;
|
|
200
|
+
},
|
|
201
|
+
enumerable: false,
|
|
202
|
+
configurable: true
|
|
203
|
+
});
|
|
204
|
+
Object.defineProperty(AuthenticatorService.prototype, "toResetPassword", {
|
|
205
|
+
get: function () {
|
|
206
|
+
return this._sendEventAliases.toResetPassword;
|
|
207
|
+
},
|
|
208
|
+
enumerable: false,
|
|
209
|
+
configurable: true
|
|
210
|
+
});
|
|
211
|
+
Object.defineProperty(AuthenticatorService.prototype, "toSignIn", {
|
|
212
|
+
get: function () {
|
|
213
|
+
return this._sendEventAliases.toSignIn;
|
|
214
|
+
},
|
|
215
|
+
enumerable: false,
|
|
216
|
+
configurable: true
|
|
217
|
+
});
|
|
218
|
+
Object.defineProperty(AuthenticatorService.prototype, "toSignUp", {
|
|
219
|
+
get: function () {
|
|
220
|
+
return this._sendEventAliases.toSignUp;
|
|
221
|
+
},
|
|
222
|
+
enumerable: false,
|
|
223
|
+
configurable: true
|
|
224
|
+
});
|
|
225
|
+
Object.defineProperty(AuthenticatorService.prototype, "skipVerification", {
|
|
226
|
+
get: function () {
|
|
227
|
+
return this._sendEventAliases.skipVerification;
|
|
228
|
+
},
|
|
229
|
+
enumerable: false,
|
|
230
|
+
configurable: true
|
|
231
|
+
});
|
|
232
|
+
Object.defineProperty(AuthenticatorService.prototype, "authState", {
|
|
233
|
+
/**
|
|
234
|
+
* Internal utility functions
|
|
235
|
+
*/
|
|
236
|
+
/** @deprecated For internal use only */
|
|
237
|
+
get: function () {
|
|
238
|
+
return this._authState;
|
|
239
|
+
},
|
|
240
|
+
enumerable: false,
|
|
241
|
+
configurable: true
|
|
242
|
+
});
|
|
243
|
+
Object.defineProperty(AuthenticatorService.prototype, "authService", {
|
|
244
|
+
/** @deprecated For internal use only */
|
|
245
|
+
get: function () {
|
|
246
|
+
return this._authService;
|
|
247
|
+
},
|
|
248
|
+
enumerable: false,
|
|
249
|
+
configurable: true
|
|
250
|
+
});
|
|
251
|
+
Object.defineProperty(AuthenticatorService.prototype, "context", {
|
|
252
|
+
/** @deprecated For internal use only */
|
|
253
|
+
get: function () {
|
|
254
|
+
return this._authState.context;
|
|
255
|
+
},
|
|
256
|
+
enumerable: false,
|
|
257
|
+
configurable: true
|
|
258
|
+
});
|
|
259
|
+
Object.defineProperty(AuthenticatorService.prototype, "slotContext", {
|
|
260
|
+
/** @deprecated For internal use only */
|
|
261
|
+
get: function () {
|
|
262
|
+
var slotContext = Object.assign(Object.assign({}, this._facade), this._sendEventAliases);
|
|
263
|
+
return Object.assign(Object.assign({}, slotContext), { $implicit: Object.assign({}, slotContext) });
|
|
264
|
+
},
|
|
265
|
+
enumerable: false,
|
|
266
|
+
configurable: true
|
|
267
|
+
});
|
|
268
|
+
/** @deprecated For internal use only */
|
|
269
|
+
AuthenticatorService.prototype.subscribe = function (callback) {
|
|
270
|
+
if (this._authService) {
|
|
271
|
+
return this._authService.subscribe(callback);
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
logger$2.error('Subscription attempted before machine was created. This is likely a bug on the library, please consider filing a bug.');
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
/** @deprecated For internal use only */
|
|
278
|
+
AuthenticatorService.prototype.send = function (event) {
|
|
279
|
+
this.authService.send(event);
|
|
280
|
+
};
|
|
281
|
+
return AuthenticatorService;
|
|
282
|
+
}());
|
|
283
|
+
AuthenticatorService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function AuthenticatorService_Factory() { return new AuthenticatorService(); }, token: AuthenticatorService, providedIn: "root" });
|
|
284
|
+
AuthenticatorService.decorators = [
|
|
285
|
+
{ type: i0.Injectable, args: [{
|
|
286
|
+
providedIn: 'root',
|
|
287
|
+
},] }
|
|
288
|
+
];
|
|
289
|
+
|
|
290
|
+
var AuthenticatorComponent = /** @class */ (function () {
|
|
291
|
+
function AuthenticatorComponent(authenticator, contextService) {
|
|
292
|
+
this.authenticator = authenticator;
|
|
293
|
+
this.contextService = contextService;
|
|
294
|
+
this.customComponentQuery = null;
|
|
295
|
+
// translated texts
|
|
296
|
+
this.signInTitle = ui.translate('Sign In');
|
|
297
|
+
this.signUpTitle = ui.translate('Create Account');
|
|
298
|
+
}
|
|
299
|
+
AuthenticatorComponent.prototype.ngOnInit = function () {
|
|
300
|
+
var _a = this, initialState = _a.initialState, loginMechanisms = _a.loginMechanisms, services = _a.services, signUpAttributes = _a.signUpAttributes, socialProviders = _a.socialProviders;
|
|
301
|
+
this.authenticator.startMachine({
|
|
302
|
+
initialState: initialState,
|
|
303
|
+
loginMechanisms: loginMechanisms,
|
|
304
|
+
services: services,
|
|
305
|
+
signUpAttributes: signUpAttributes,
|
|
306
|
+
socialProviders: socialProviders,
|
|
307
|
+
});
|
|
308
|
+
/**
|
|
309
|
+
* handling translations after content init, because authenticator and its
|
|
310
|
+
* translations might be initialized before the main app's `ngOnInit` is run.
|
|
311
|
+
*/
|
|
312
|
+
this.signInTitle = ui.translate('Sign In');
|
|
313
|
+
this.signUpTitle = ui.translate('Create Account');
|
|
314
|
+
};
|
|
315
|
+
/**
|
|
316
|
+
* Lifecycle Methods
|
|
317
|
+
*/
|
|
318
|
+
AuthenticatorComponent.prototype.ngAfterContentInit = function () {
|
|
319
|
+
this.contextService.customComponents = this.mapCustomComponents(this.customComponentQuery);
|
|
320
|
+
};
|
|
321
|
+
Object.defineProperty(AuthenticatorComponent.prototype, "context", {
|
|
322
|
+
/**
|
|
323
|
+
* Class Functions
|
|
324
|
+
*/
|
|
325
|
+
// context passed to "authenticated" slot
|
|
326
|
+
get: function () {
|
|
327
|
+
return this.authenticator.slotContext;
|
|
328
|
+
},
|
|
329
|
+
enumerable: false,
|
|
330
|
+
configurable: true
|
|
331
|
+
});
|
|
332
|
+
Object.defineProperty(AuthenticatorComponent.prototype, "route", {
|
|
333
|
+
get: function () {
|
|
334
|
+
return this.authenticator.route;
|
|
335
|
+
},
|
|
336
|
+
enumerable: false,
|
|
337
|
+
configurable: true
|
|
338
|
+
});
|
|
339
|
+
AuthenticatorComponent.prototype.onTabChange = function () {
|
|
340
|
+
var route = this.authenticator.route;
|
|
341
|
+
if (route === 'signIn') {
|
|
342
|
+
this.authenticator.toSignUp();
|
|
343
|
+
}
|
|
344
|
+
else {
|
|
345
|
+
this.authenticator.toSignIn();
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
AuthenticatorComponent.prototype.mapCustomComponents = function (componentQuery) {
|
|
349
|
+
if (!componentQuery)
|
|
350
|
+
return {};
|
|
351
|
+
var customComponents = {};
|
|
352
|
+
componentQuery.forEach(function (component) {
|
|
353
|
+
customComponents[component.name] = component.template;
|
|
354
|
+
});
|
|
355
|
+
return customComponents;
|
|
356
|
+
};
|
|
357
|
+
return AuthenticatorComponent;
|
|
358
|
+
}());
|
|
359
|
+
AuthenticatorComponent.decorators = [
|
|
360
|
+
{ type: i0.Component, args: [{
|
|
361
|
+
selector: 'amplify-authenticator',
|
|
362
|
+
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",
|
|
363
|
+
providers: [CustomComponentsService],
|
|
364
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
365
|
+
},] }
|
|
366
|
+
];
|
|
367
|
+
AuthenticatorComponent.ctorParameters = function () { return [
|
|
368
|
+
{ type: AuthenticatorService },
|
|
369
|
+
{ type: CustomComponentsService }
|
|
370
|
+
]; };
|
|
371
|
+
AuthenticatorComponent.propDecorators = {
|
|
372
|
+
initialState: [{ type: i0.Input }],
|
|
373
|
+
loginMechanisms: [{ type: i0.Input }],
|
|
374
|
+
services: [{ type: i0.Input }],
|
|
375
|
+
signUpAttributes: [{ type: i0.Input }],
|
|
376
|
+
socialProviders: [{ type: i0.Input }],
|
|
377
|
+
variation: [{ type: i0.Input }],
|
|
378
|
+
customComponentQuery: [{ type: i0.ContentChildren, args: [AmplifySlotDirective,] }]
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
var ConfirmResetPasswordComponent = /** @class */ (function () {
|
|
382
|
+
function ConfirmResetPasswordComponent(authenticator) {
|
|
383
|
+
this.authenticator = authenticator;
|
|
384
|
+
this.dataAttr = '';
|
|
385
|
+
this.headerText = ui.translate('Reset your password');
|
|
386
|
+
// translated strings
|
|
387
|
+
this.sendCodeText = ui.translate('Send Code');
|
|
388
|
+
this.backToSignInText = ui.translate('Back to Sign In');
|
|
389
|
+
this.resendCodeText = ui.translate('Resend Code');
|
|
390
|
+
}
|
|
391
|
+
Object.defineProperty(ConfirmResetPasswordComponent.prototype, "context", {
|
|
392
|
+
get: function () {
|
|
393
|
+
return this.authenticator.slotContext;
|
|
394
|
+
},
|
|
395
|
+
enumerable: false,
|
|
396
|
+
configurable: true
|
|
397
|
+
});
|
|
398
|
+
ConfirmResetPasswordComponent.prototype.onInput = function (event) {
|
|
399
|
+
event.preventDefault();
|
|
400
|
+
var _a = event.target, name = _a.name, value = _a.value;
|
|
401
|
+
this.authenticator.updateForm({ name: name, value: value });
|
|
402
|
+
};
|
|
403
|
+
ConfirmResetPasswordComponent.prototype.onSubmit = function (event) {
|
|
404
|
+
event.preventDefault();
|
|
405
|
+
this.authenticator.submitForm();
|
|
406
|
+
};
|
|
407
|
+
return ConfirmResetPasswordComponent;
|
|
408
|
+
}());
|
|
409
|
+
ConfirmResetPasswordComponent.decorators = [
|
|
410
|
+
{ type: i0.Component, args: [{
|
|
411
|
+
selector: 'amplify-confirm-reset-password',
|
|
412
|
+
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"
|
|
413
|
+
},] }
|
|
414
|
+
];
|
|
415
|
+
ConfirmResetPasswordComponent.ctorParameters = function () { return [
|
|
416
|
+
{ type: AuthenticatorService }
|
|
417
|
+
]; };
|
|
418
|
+
ConfirmResetPasswordComponent.propDecorators = {
|
|
419
|
+
dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-confirmsignin',] }],
|
|
420
|
+
headerText: [{ type: i0.Input }]
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
var logger$1 = new awsAmplify.Logger('ConfirmSignIn');
|
|
424
|
+
var ConfirmSignInComponent = /** @class */ (function () {
|
|
425
|
+
function ConfirmSignInComponent(authenticator) {
|
|
426
|
+
this.authenticator = authenticator;
|
|
427
|
+
this.dataAttr = '';
|
|
428
|
+
this.confirmText = ui.translate('Confirm');
|
|
429
|
+
this.backToSignInText = ui.translate('Back to Sign In');
|
|
430
|
+
}
|
|
431
|
+
ConfirmSignInComponent.prototype.ngOnInit = function () {
|
|
432
|
+
this.setHeaderText();
|
|
433
|
+
};
|
|
434
|
+
Object.defineProperty(ConfirmSignInComponent.prototype, "context", {
|
|
435
|
+
get: function () {
|
|
436
|
+
return this.authenticator.slotContext;
|
|
437
|
+
},
|
|
438
|
+
enumerable: false,
|
|
439
|
+
configurable: true
|
|
440
|
+
});
|
|
441
|
+
ConfirmSignInComponent.prototype.setHeaderText = function () {
|
|
442
|
+
var state = this.authenticator.authState;
|
|
443
|
+
var actorContext = ui.getActorContext(state);
|
|
444
|
+
var challengeName = actorContext.challengeName;
|
|
445
|
+
switch (challengeName) {
|
|
446
|
+
case ui.AuthChallengeNames.SOFTWARE_TOKEN_MFA:
|
|
447
|
+
this.headerText = ui.translate('Confirm TOTP Code');
|
|
448
|
+
break;
|
|
449
|
+
case ui.AuthChallengeNames.SMS_MFA:
|
|
450
|
+
this.headerText = ui.translate('Confirm SMS Code');
|
|
451
|
+
break;
|
|
452
|
+
default:
|
|
453
|
+
logger$1.error('Unexpected challengeName', challengeName);
|
|
454
|
+
}
|
|
455
|
+
};
|
|
456
|
+
ConfirmSignInComponent.prototype.onInput = function (event) {
|
|
457
|
+
event.preventDefault();
|
|
458
|
+
var _a = event.target, name = _a.name, value = _a.value;
|
|
459
|
+
this.authenticator.updateForm({ name: name, value: value });
|
|
460
|
+
};
|
|
461
|
+
ConfirmSignInComponent.prototype.onSubmit = function (event) {
|
|
462
|
+
event.preventDefault();
|
|
463
|
+
this.authenticator.submitForm();
|
|
464
|
+
};
|
|
465
|
+
return ConfirmSignInComponent;
|
|
466
|
+
}());
|
|
467
|
+
ConfirmSignInComponent.decorators = [
|
|
468
|
+
{ type: i0.Component, args: [{
|
|
469
|
+
selector: 'amplify-confirm-sign-in',
|
|
470
|
+
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"
|
|
471
|
+
},] }
|
|
472
|
+
];
|
|
473
|
+
ConfirmSignInComponent.ctorParameters = function () { return [
|
|
474
|
+
{ type: AuthenticatorService }
|
|
475
|
+
]; };
|
|
476
|
+
ConfirmSignInComponent.propDecorators = {
|
|
477
|
+
dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-confirmsignin',] }]
|
|
478
|
+
};
|
|
479
|
+
|
|
480
|
+
var ConfirmSignUpComponent = /** @class */ (function () {
|
|
481
|
+
function ConfirmSignUpComponent(authenticator) {
|
|
482
|
+
this.authenticator = authenticator;
|
|
483
|
+
this.headerText = ui.translate('Confirm Sign Up');
|
|
484
|
+
this.dataAttr = '';
|
|
485
|
+
// translated texts
|
|
486
|
+
this.resendCodeText = ui.translate('Resend Code');
|
|
487
|
+
this.confirmText = ui.translate('Confirm');
|
|
488
|
+
}
|
|
489
|
+
Object.defineProperty(ConfirmSignUpComponent.prototype, "context", {
|
|
490
|
+
get: function () {
|
|
491
|
+
return this.authenticator.slotContext;
|
|
492
|
+
},
|
|
493
|
+
enumerable: false,
|
|
494
|
+
configurable: true
|
|
495
|
+
});
|
|
496
|
+
ConfirmSignUpComponent.prototype.onInput = function (event) {
|
|
497
|
+
event.preventDefault();
|
|
498
|
+
var _a = event.target, name = _a.name, value = _a.value;
|
|
499
|
+
this.authenticator.updateForm({ name: name, value: value });
|
|
500
|
+
};
|
|
501
|
+
ConfirmSignUpComponent.prototype.onSubmit = function (event) {
|
|
502
|
+
event.preventDefault();
|
|
503
|
+
this.authenticator.submitForm();
|
|
504
|
+
};
|
|
505
|
+
return ConfirmSignUpComponent;
|
|
506
|
+
}());
|
|
507
|
+
ConfirmSignUpComponent.decorators = [
|
|
508
|
+
{ type: i0.Component, args: [{
|
|
509
|
+
selector: 'amplify-confirm-sign-up',
|
|
510
|
+
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"
|
|
511
|
+
},] }
|
|
512
|
+
];
|
|
513
|
+
ConfirmSignUpComponent.ctorParameters = function () { return [
|
|
514
|
+
{ type: AuthenticatorService }
|
|
515
|
+
]; };
|
|
516
|
+
ConfirmSignUpComponent.propDecorators = {
|
|
517
|
+
headerText: [{ type: i0.Input }],
|
|
518
|
+
dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-confirmsignup',] }]
|
|
519
|
+
};
|
|
520
|
+
|
|
521
|
+
var ConfirmVerifyUserComponent = /** @class */ (function () {
|
|
522
|
+
function ConfirmVerifyUserComponent(authenticator) {
|
|
523
|
+
this.authenticator = authenticator;
|
|
524
|
+
this.dataAttr = '';
|
|
525
|
+
this.headerText = ui.translate('Account recovery requires verified contact information');
|
|
526
|
+
// translated texts
|
|
527
|
+
this.skipText = ui.translate('Skip');
|
|
528
|
+
this.submitText = ui.translate('Submit');
|
|
529
|
+
}
|
|
530
|
+
Object.defineProperty(ConfirmVerifyUserComponent.prototype, "context", {
|
|
531
|
+
get: function () {
|
|
532
|
+
return this.authenticator.slotContext;
|
|
533
|
+
},
|
|
534
|
+
enumerable: false,
|
|
535
|
+
configurable: true
|
|
536
|
+
});
|
|
537
|
+
ConfirmVerifyUserComponent.prototype.onInput = function (event) {
|
|
538
|
+
event.preventDefault();
|
|
539
|
+
var _a = event.target, name = _a.name, value = _a.value;
|
|
540
|
+
this.authenticator.updateForm({ name: name, value: value });
|
|
541
|
+
};
|
|
542
|
+
ConfirmVerifyUserComponent.prototype.onSubmit = function (event) {
|
|
543
|
+
event.preventDefault();
|
|
544
|
+
this.authenticator.submitForm();
|
|
545
|
+
};
|
|
546
|
+
return ConfirmVerifyUserComponent;
|
|
547
|
+
}());
|
|
548
|
+
ConfirmVerifyUserComponent.decorators = [
|
|
549
|
+
{ type: i0.Component, args: [{
|
|
550
|
+
selector: 'amplify-confirm-verify-user',
|
|
551
|
+
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"
|
|
552
|
+
},] }
|
|
553
|
+
];
|
|
554
|
+
ConfirmVerifyUserComponent.ctorParameters = function () { return [
|
|
555
|
+
{ type: AuthenticatorService }
|
|
556
|
+
]; };
|
|
557
|
+
ConfirmVerifyUserComponent.propDecorators = {
|
|
558
|
+
dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-confirmverifyuser',] }],
|
|
559
|
+
headerText: [{ type: i0.Input }]
|
|
560
|
+
};
|
|
561
|
+
|
|
562
|
+
var FederatedSignInButtonComponent = /** @class */ (function () {
|
|
563
|
+
function FederatedSignInButtonComponent(authenticator) {
|
|
564
|
+
var _this = this;
|
|
565
|
+
this.authenticator = authenticator;
|
|
566
|
+
this.onClick = function () {
|
|
567
|
+
_this.authenticator.send({
|
|
568
|
+
type: 'FEDERATED_SIGN_IN',
|
|
569
|
+
data: { provider: _this.provider },
|
|
570
|
+
});
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
return FederatedSignInButtonComponent;
|
|
574
|
+
}());
|
|
575
|
+
FederatedSignInButtonComponent.decorators = [
|
|
576
|
+
{ type: i0.Component, args: [{
|
|
577
|
+
selector: 'amplify-federated-sign-in-button',
|
|
578
|
+
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"
|
|
579
|
+
},] }
|
|
580
|
+
];
|
|
581
|
+
FederatedSignInButtonComponent.ctorParameters = function () { return [
|
|
582
|
+
{ type: AuthenticatorService }
|
|
583
|
+
]; };
|
|
584
|
+
FederatedSignInButtonComponent.propDecorators = {
|
|
585
|
+
provider: [{ type: i0.Input }],
|
|
586
|
+
text: [{ type: i0.Input }]
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
var FederatedSignInComponent = /** @class */ (function () {
|
|
590
|
+
function FederatedSignInComponent(authenticator) {
|
|
591
|
+
this.authenticator = authenticator;
|
|
592
|
+
this.FederatedProviders = ui.FederatedIdentityProviders;
|
|
593
|
+
this.includeAmazon = false;
|
|
594
|
+
this.includeApple = false;
|
|
595
|
+
this.includeFacebook = false;
|
|
596
|
+
this.includeGoogle = false;
|
|
597
|
+
this.shouldShowFederatedSignIn = false;
|
|
598
|
+
}
|
|
599
|
+
FederatedSignInComponent.prototype.ngOnInit = function () {
|
|
600
|
+
var _a;
|
|
601
|
+
var socialProviders = ((_a = this.authenticator.context) === null || _a === void 0 ? void 0 : _a.config).socialProviders;
|
|
602
|
+
this.setFederatedTexts();
|
|
603
|
+
this.includeAmazon = socialProviders === null || socialProviders === void 0 ? void 0 : socialProviders.includes('amazon');
|
|
604
|
+
this.includeApple = socialProviders === null || socialProviders === void 0 ? void 0 : socialProviders.includes('apple');
|
|
605
|
+
this.includeGoogle = socialProviders === null || socialProviders === void 0 ? void 0 : socialProviders.includes('google');
|
|
606
|
+
this.includeFacebook = socialProviders === null || socialProviders === void 0 ? void 0 : socialProviders.includes('facebook');
|
|
607
|
+
this.shouldShowFederatedSignIn =
|
|
608
|
+
this.includeAmazon ||
|
|
609
|
+
this.includeApple ||
|
|
610
|
+
this.includeFacebook ||
|
|
611
|
+
this.includeGoogle;
|
|
612
|
+
};
|
|
613
|
+
FederatedSignInComponent.prototype.setFederatedTexts = function () {
|
|
614
|
+
var route = this.authenticator.route;
|
|
615
|
+
var federatedText = route === 'signUp' ? 'Up' : 'In';
|
|
616
|
+
this.signInAmazonText = ui.translate("Sign " + federatedText + " with Amazon");
|
|
617
|
+
this.signInAppleText = ui.translate("Sign " + federatedText + " with Apple");
|
|
618
|
+
this.signInFacebookText = ui.translate("Sign " + federatedText + " with Facebook");
|
|
619
|
+
this.signInGoogleText = ui.translate("Sign " + federatedText + " with Google");
|
|
620
|
+
};
|
|
621
|
+
return FederatedSignInComponent;
|
|
622
|
+
}());
|
|
623
|
+
FederatedSignInComponent.decorators = [
|
|
624
|
+
{ type: i0.Component, args: [{
|
|
625
|
+
selector: 'amplify-federated-sign-in',
|
|
626
|
+
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"
|
|
627
|
+
},] }
|
|
628
|
+
];
|
|
629
|
+
FederatedSignInComponent.ctorParameters = function () { return [
|
|
630
|
+
{ type: AuthenticatorService }
|
|
631
|
+
]; };
|
|
632
|
+
|
|
633
|
+
var ForceNewPasswordComponent = /** @class */ (function () {
|
|
634
|
+
function ForceNewPasswordComponent(authenticator) {
|
|
635
|
+
this.authenticator = authenticator;
|
|
636
|
+
this.dataAttr = '';
|
|
637
|
+
this.headerText = ui.translate('Change Password');
|
|
638
|
+
// translated texts
|
|
639
|
+
this.changePasswordText = ui.translate('Change Password');
|
|
640
|
+
this.backToSignInText = ui.translate('Back to Sign In');
|
|
641
|
+
}
|
|
642
|
+
Object.defineProperty(ForceNewPasswordComponent.prototype, "context", {
|
|
643
|
+
get: function () {
|
|
644
|
+
return this.authenticator.slotContext;
|
|
645
|
+
},
|
|
646
|
+
enumerable: false,
|
|
647
|
+
configurable: true
|
|
648
|
+
});
|
|
649
|
+
ForceNewPasswordComponent.prototype.onInput = function (event) {
|
|
650
|
+
event.preventDefault();
|
|
651
|
+
var _a = event.target, name = _a.name, value = _a.value;
|
|
652
|
+
this.authenticator.updateForm({ name: name, value: value });
|
|
653
|
+
};
|
|
654
|
+
ForceNewPasswordComponent.prototype.onSubmit = function (event) {
|
|
655
|
+
event.preventDefault();
|
|
656
|
+
this.authenticator.submitForm();
|
|
657
|
+
};
|
|
658
|
+
return ForceNewPasswordComponent;
|
|
659
|
+
}());
|
|
660
|
+
ForceNewPasswordComponent.decorators = [
|
|
661
|
+
{ type: i0.Component, args: [{
|
|
662
|
+
selector: 'amplify-force-new-password',
|
|
663
|
+
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"
|
|
664
|
+
},] }
|
|
665
|
+
];
|
|
666
|
+
ForceNewPasswordComponent.ctorParameters = function () { return [
|
|
667
|
+
{ type: AuthenticatorService }
|
|
668
|
+
]; };
|
|
669
|
+
ForceNewPasswordComponent.propDecorators = {
|
|
670
|
+
dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-forcenewpassword',] }],
|
|
671
|
+
headerText: [{ type: i0.Input }]
|
|
672
|
+
};
|
|
673
|
+
|
|
674
|
+
var getAttributeMap = function () { return ui.authInputAttributes; };
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* Input interface opinionated for authenticator usage.
|
|
678
|
+
*
|
|
679
|
+
* TODO: Separate this component out to two parts -- 1) amplify-auth-input that
|
|
680
|
+
* contains authenticator opinionated logic and 2) amplify-text-field primitive
|
|
681
|
+
* that does not make any auth-related inference.
|
|
682
|
+
*/
|
|
683
|
+
var FormFieldComponent = /** @class */ (function () {
|
|
684
|
+
function FormFieldComponent(authenticator) {
|
|
685
|
+
this.authenticator = authenticator;
|
|
686
|
+
this.required = true;
|
|
687
|
+
this.placeholder = '';
|
|
688
|
+
this.label = '';
|
|
689
|
+
this.initialValue = '';
|
|
690
|
+
this.disabled = false;
|
|
691
|
+
this.autocomplete = '';
|
|
692
|
+
this.labelHidden = true;
|
|
693
|
+
this.countryDialCodes = ui.countryDialCodes;
|
|
694
|
+
}
|
|
695
|
+
FormFieldComponent.prototype.ngOnInit = function () {
|
|
696
|
+
// TODO: consider better default handling mechanisms across frameworks
|
|
697
|
+
if (this.isPhoneField()) {
|
|
698
|
+
var state = this.authenticator.authState;
|
|
699
|
+
var country_code = ui.getActorContext(state).country_code;
|
|
700
|
+
this.defaultCountryCode = country_code;
|
|
701
|
+
// TODO: remove this side-effect
|
|
702
|
+
this.authenticator.updateForm({
|
|
703
|
+
name: 'country_code',
|
|
704
|
+
value: country_code,
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
};
|
|
708
|
+
Object.defineProperty(FormFieldComponent.prototype, "attributeMap", {
|
|
709
|
+
get: function () {
|
|
710
|
+
return getAttributeMap();
|
|
711
|
+
},
|
|
712
|
+
enumerable: false,
|
|
713
|
+
configurable: true
|
|
714
|
+
});
|
|
715
|
+
Object.defineProperty(FormFieldComponent.prototype, "error", {
|
|
716
|
+
get: function () {
|
|
717
|
+
var formContext = ui.getActorContext(this.authenticator.authState);
|
|
718
|
+
var validationError = formContext.validationError;
|
|
719
|
+
return validationError[this.name];
|
|
720
|
+
},
|
|
721
|
+
enumerable: false,
|
|
722
|
+
configurable: true
|
|
723
|
+
});
|
|
724
|
+
FormFieldComponent.prototype.inferLabel = function () {
|
|
725
|
+
var _a;
|
|
726
|
+
var label = this.label || ((_a = this.attributeMap[this.name]) === null || _a === void 0 ? void 0 : _a.label);
|
|
727
|
+
return ui.translate(label);
|
|
728
|
+
};
|
|
729
|
+
FormFieldComponent.prototype.inferPlaceholder = function () {
|
|
730
|
+
var _a;
|
|
731
|
+
var placeholder = this.placeholder || ((_a = this.attributeMap[this.name]) === null || _a === void 0 ? void 0 : _a.placeholder) ||
|
|
732
|
+
this.inferLabel();
|
|
733
|
+
return ui.translate(placeholder);
|
|
734
|
+
};
|
|
735
|
+
// infers what the `type` of underlying input element should be.
|
|
736
|
+
FormFieldComponent.prototype.inferType = function () {
|
|
737
|
+
var _a, _b, _c;
|
|
738
|
+
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';
|
|
739
|
+
};
|
|
740
|
+
FormFieldComponent.prototype.inferAutocomplete = function () {
|
|
741
|
+
var _a;
|
|
742
|
+
return this.autocomplete || ((_a = this.attributeMap[this.name]) === null || _a === void 0 ? void 0 : _a.autocomplete);
|
|
743
|
+
};
|
|
744
|
+
// TODO(enhancement): use enum to differentiate special field types
|
|
745
|
+
FormFieldComponent.prototype.isPasswordField = function () {
|
|
746
|
+
return this.inferType() === 'password';
|
|
747
|
+
};
|
|
748
|
+
FormFieldComponent.prototype.isPhoneField = function () {
|
|
749
|
+
return this.inferType() === 'tel';
|
|
750
|
+
};
|
|
751
|
+
return FormFieldComponent;
|
|
752
|
+
}());
|
|
753
|
+
FormFieldComponent.decorators = [
|
|
754
|
+
{ type: i0.Component, args: [{
|
|
755
|
+
selector: 'amplify-form-field',
|
|
756
|
+
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"
|
|
757
|
+
},] }
|
|
758
|
+
];
|
|
759
|
+
FormFieldComponent.ctorParameters = function () { return [
|
|
760
|
+
{ type: AuthenticatorService }
|
|
761
|
+
]; };
|
|
762
|
+
FormFieldComponent.propDecorators = {
|
|
763
|
+
name: [{ type: i0.Input }],
|
|
764
|
+
type: [{ type: i0.Input }],
|
|
765
|
+
required: [{ type: i0.Input }],
|
|
766
|
+
placeholder: [{ type: i0.Input }],
|
|
767
|
+
label: [{ type: i0.Input }],
|
|
768
|
+
initialValue: [{ type: i0.Input }],
|
|
769
|
+
disabled: [{ type: i0.Input }],
|
|
770
|
+
autocomplete: [{ type: i0.Input }],
|
|
771
|
+
labelHidden: [{ type: i0.Input }]
|
|
772
|
+
};
|
|
773
|
+
|
|
774
|
+
var ResetPasswordComponent = /** @class */ (function () {
|
|
775
|
+
function ResetPasswordComponent(authenticator) {
|
|
776
|
+
this.authenticator = authenticator;
|
|
777
|
+
this.dataAttr = '';
|
|
778
|
+
this.headerText = ui.translate('Reset your password');
|
|
779
|
+
// translated texts
|
|
780
|
+
this.sendCodeText = ui.translate('Send Code');
|
|
781
|
+
this.backToSignInText = ui.translate('Back to Sign In');
|
|
782
|
+
this.labelText = ui.translate('Username');
|
|
783
|
+
}
|
|
784
|
+
ResetPasswordComponent.prototype.ngOnInit = function () {
|
|
785
|
+
var authState = this.authenticator.authState;
|
|
786
|
+
var label = ui.getAliasInfoFromContext(authState.context).label;
|
|
787
|
+
this.labelText = "Enter your " + label.toLowerCase();
|
|
788
|
+
};
|
|
789
|
+
Object.defineProperty(ResetPasswordComponent.prototype, "context", {
|
|
790
|
+
get: function () {
|
|
791
|
+
return this.authenticator.slotContext;
|
|
792
|
+
},
|
|
793
|
+
enumerable: false,
|
|
794
|
+
configurable: true
|
|
795
|
+
});
|
|
796
|
+
ResetPasswordComponent.prototype.onInput = function (event) {
|
|
797
|
+
event.preventDefault();
|
|
798
|
+
var _a = event.target, name = _a.name, value = _a.value;
|
|
799
|
+
this.authenticator.updateForm({ name: name, value: value });
|
|
800
|
+
};
|
|
801
|
+
ResetPasswordComponent.prototype.onSubmit = function (event) {
|
|
802
|
+
event.preventDefault();
|
|
803
|
+
this.authenticator.submitForm();
|
|
804
|
+
};
|
|
805
|
+
return ResetPasswordComponent;
|
|
806
|
+
}());
|
|
807
|
+
ResetPasswordComponent.decorators = [
|
|
808
|
+
{ type: i0.Component, args: [{
|
|
809
|
+
selector: 'amplify-reset-password',
|
|
810
|
+
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"
|
|
811
|
+
},] }
|
|
812
|
+
];
|
|
813
|
+
ResetPasswordComponent.ctorParameters = function () { return [
|
|
814
|
+
{ type: AuthenticatorService }
|
|
815
|
+
]; };
|
|
816
|
+
ResetPasswordComponent.propDecorators = {
|
|
817
|
+
dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-resetPassword',] }],
|
|
818
|
+
headerText: [{ type: i0.Input }]
|
|
819
|
+
};
|
|
820
|
+
|
|
821
|
+
/*! *****************************************************************************
|
|
822
|
+
Copyright (c) Microsoft Corporation.
|
|
823
|
+
|
|
824
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
825
|
+
purpose with or without fee is hereby granted.
|
|
826
|
+
|
|
827
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
828
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
829
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
830
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
831
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
832
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
833
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
834
|
+
***************************************************************************** */
|
|
835
|
+
/* global Reflect, Promise */
|
|
836
|
+
var extendStatics = function (d, b) {
|
|
837
|
+
extendStatics = Object.setPrototypeOf ||
|
|
838
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
839
|
+
function (d, b) { for (var p in b)
|
|
840
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
841
|
+
d[p] = b[p]; };
|
|
842
|
+
return extendStatics(d, b);
|
|
843
|
+
};
|
|
844
|
+
function __extends(d, b) {
|
|
845
|
+
if (typeof b !== "function" && b !== null)
|
|
846
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
847
|
+
extendStatics(d, b);
|
|
848
|
+
function __() { this.constructor = d; }
|
|
849
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
850
|
+
}
|
|
851
|
+
var __assign = function () {
|
|
852
|
+
__assign = Object.assign || function __assign(t) {
|
|
853
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
854
|
+
s = arguments[i];
|
|
855
|
+
for (var p in s)
|
|
856
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
857
|
+
t[p] = s[p];
|
|
858
|
+
}
|
|
859
|
+
return t;
|
|
860
|
+
};
|
|
861
|
+
return __assign.apply(this, arguments);
|
|
862
|
+
};
|
|
863
|
+
function __rest(s, e) {
|
|
864
|
+
var t = {};
|
|
865
|
+
for (var p in s)
|
|
866
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
867
|
+
t[p] = s[p];
|
|
868
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
869
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
870
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
871
|
+
t[p[i]] = s[p[i]];
|
|
872
|
+
}
|
|
873
|
+
return t;
|
|
874
|
+
}
|
|
875
|
+
function __decorate(decorators, target, key, desc) {
|
|
876
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
877
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
878
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
879
|
+
else
|
|
880
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
881
|
+
if (d = decorators[i])
|
|
882
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
883
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
884
|
+
}
|
|
885
|
+
function __param(paramIndex, decorator) {
|
|
886
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
887
|
+
}
|
|
888
|
+
function __metadata(metadataKey, metadataValue) {
|
|
889
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
890
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
891
|
+
}
|
|
892
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
893
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
894
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
895
|
+
function fulfilled(value) { try {
|
|
896
|
+
step(generator.next(value));
|
|
897
|
+
}
|
|
898
|
+
catch (e) {
|
|
899
|
+
reject(e);
|
|
900
|
+
} }
|
|
901
|
+
function rejected(value) { try {
|
|
902
|
+
step(generator["throw"](value));
|
|
903
|
+
}
|
|
904
|
+
catch (e) {
|
|
905
|
+
reject(e);
|
|
906
|
+
} }
|
|
907
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
908
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
909
|
+
});
|
|
910
|
+
}
|
|
911
|
+
function __generator(thisArg, body) {
|
|
912
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
913
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
914
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
915
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
916
|
+
function step(op) {
|
|
917
|
+
if (f)
|
|
918
|
+
throw new TypeError("Generator is already executing.");
|
|
919
|
+
while (_)
|
|
920
|
+
try {
|
|
921
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
922
|
+
return t;
|
|
923
|
+
if (y = 0, t)
|
|
924
|
+
op = [op[0] & 2, t.value];
|
|
925
|
+
switch (op[0]) {
|
|
926
|
+
case 0:
|
|
927
|
+
case 1:
|
|
928
|
+
t = op;
|
|
929
|
+
break;
|
|
930
|
+
case 4:
|
|
931
|
+
_.label++;
|
|
932
|
+
return { value: op[1], done: false };
|
|
933
|
+
case 5:
|
|
934
|
+
_.label++;
|
|
935
|
+
y = op[1];
|
|
936
|
+
op = [0];
|
|
937
|
+
continue;
|
|
938
|
+
case 7:
|
|
939
|
+
op = _.ops.pop();
|
|
940
|
+
_.trys.pop();
|
|
941
|
+
continue;
|
|
942
|
+
default:
|
|
943
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
944
|
+
_ = 0;
|
|
945
|
+
continue;
|
|
946
|
+
}
|
|
947
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
948
|
+
_.label = op[1];
|
|
949
|
+
break;
|
|
950
|
+
}
|
|
951
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
952
|
+
_.label = t[1];
|
|
953
|
+
t = op;
|
|
954
|
+
break;
|
|
955
|
+
}
|
|
956
|
+
if (t && _.label < t[2]) {
|
|
957
|
+
_.label = t[2];
|
|
958
|
+
_.ops.push(op);
|
|
959
|
+
break;
|
|
960
|
+
}
|
|
961
|
+
if (t[2])
|
|
962
|
+
_.ops.pop();
|
|
963
|
+
_.trys.pop();
|
|
964
|
+
continue;
|
|
965
|
+
}
|
|
966
|
+
op = body.call(thisArg, _);
|
|
967
|
+
}
|
|
968
|
+
catch (e) {
|
|
969
|
+
op = [6, e];
|
|
970
|
+
y = 0;
|
|
971
|
+
}
|
|
972
|
+
finally {
|
|
973
|
+
f = t = 0;
|
|
974
|
+
}
|
|
975
|
+
if (op[0] & 5)
|
|
976
|
+
throw op[1];
|
|
977
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
981
|
+
if (k2 === undefined)
|
|
982
|
+
k2 = k;
|
|
983
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
984
|
+
}) : (function (o, m, k, k2) {
|
|
985
|
+
if (k2 === undefined)
|
|
986
|
+
k2 = k;
|
|
987
|
+
o[k2] = m[k];
|
|
988
|
+
});
|
|
989
|
+
function __exportStar(m, o) {
|
|
990
|
+
for (var p in m)
|
|
991
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
992
|
+
__createBinding(o, m, p);
|
|
993
|
+
}
|
|
994
|
+
function __values(o) {
|
|
995
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
996
|
+
if (m)
|
|
997
|
+
return m.call(o);
|
|
998
|
+
if (o && typeof o.length === "number")
|
|
999
|
+
return {
|
|
1000
|
+
next: function () {
|
|
1001
|
+
if (o && i >= o.length)
|
|
1002
|
+
o = void 0;
|
|
1003
|
+
return { value: o && o[i++], done: !o };
|
|
1004
|
+
}
|
|
1005
|
+
};
|
|
1006
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
1007
|
+
}
|
|
1008
|
+
function __read(o, n) {
|
|
1009
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
1010
|
+
if (!m)
|
|
1011
|
+
return o;
|
|
1012
|
+
var i = m.call(o), r, ar = [], e;
|
|
1013
|
+
try {
|
|
1014
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
1015
|
+
ar.push(r.value);
|
|
1016
|
+
}
|
|
1017
|
+
catch (error) {
|
|
1018
|
+
e = { error: error };
|
|
1019
|
+
}
|
|
1020
|
+
finally {
|
|
1021
|
+
try {
|
|
1022
|
+
if (r && !r.done && (m = i["return"]))
|
|
1023
|
+
m.call(i);
|
|
1024
|
+
}
|
|
1025
|
+
finally {
|
|
1026
|
+
if (e)
|
|
1027
|
+
throw e.error;
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
return ar;
|
|
1031
|
+
}
|
|
1032
|
+
/** @deprecated */
|
|
1033
|
+
function __spread() {
|
|
1034
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
1035
|
+
ar = ar.concat(__read(arguments[i]));
|
|
1036
|
+
return ar;
|
|
1037
|
+
}
|
|
1038
|
+
/** @deprecated */
|
|
1039
|
+
function __spreadArrays() {
|
|
1040
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
1041
|
+
s += arguments[i].length;
|
|
1042
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
1043
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
1044
|
+
r[k] = a[j];
|
|
1045
|
+
return r;
|
|
1046
|
+
}
|
|
1047
|
+
function __spreadArray(to, from, pack) {
|
|
1048
|
+
if (pack || arguments.length === 2)
|
|
1049
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
1050
|
+
if (ar || !(i in from)) {
|
|
1051
|
+
if (!ar)
|
|
1052
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
1053
|
+
ar[i] = from[i];
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
1057
|
+
}
|
|
1058
|
+
function __await(v) {
|
|
1059
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
1060
|
+
}
|
|
1061
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
1062
|
+
if (!Symbol.asyncIterator)
|
|
1063
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
1064
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
1065
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
1066
|
+
function verb(n) { if (g[n])
|
|
1067
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
1068
|
+
function resume(n, v) { try {
|
|
1069
|
+
step(g[n](v));
|
|
1070
|
+
}
|
|
1071
|
+
catch (e) {
|
|
1072
|
+
settle(q[0][3], e);
|
|
1073
|
+
} }
|
|
1074
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
1075
|
+
function fulfill(value) { resume("next", value); }
|
|
1076
|
+
function reject(value) { resume("throw", value); }
|
|
1077
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
1078
|
+
resume(q[0][0], q[0][1]); }
|
|
1079
|
+
}
|
|
1080
|
+
function __asyncDelegator(o) {
|
|
1081
|
+
var i, p;
|
|
1082
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
1083
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
1084
|
+
}
|
|
1085
|
+
function __asyncValues(o) {
|
|
1086
|
+
if (!Symbol.asyncIterator)
|
|
1087
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
1088
|
+
var m = o[Symbol.asyncIterator], i;
|
|
1089
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
1090
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
1091
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
1092
|
+
}
|
|
1093
|
+
function __makeTemplateObject(cooked, raw) {
|
|
1094
|
+
if (Object.defineProperty) {
|
|
1095
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
1096
|
+
}
|
|
1097
|
+
else {
|
|
1098
|
+
cooked.raw = raw;
|
|
1099
|
+
}
|
|
1100
|
+
return cooked;
|
|
1101
|
+
}
|
|
1102
|
+
;
|
|
1103
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
1104
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1105
|
+
}) : function (o, v) {
|
|
1106
|
+
o["default"] = v;
|
|
1107
|
+
};
|
|
1108
|
+
function __importStar(mod) {
|
|
1109
|
+
if (mod && mod.__esModule)
|
|
1110
|
+
return mod;
|
|
1111
|
+
var result = {};
|
|
1112
|
+
if (mod != null)
|
|
1113
|
+
for (var k in mod)
|
|
1114
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
1115
|
+
__createBinding(result, mod, k);
|
|
1116
|
+
__setModuleDefault(result, mod);
|
|
1117
|
+
return result;
|
|
1118
|
+
}
|
|
1119
|
+
function __importDefault(mod) {
|
|
1120
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
1121
|
+
}
|
|
1122
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
1123
|
+
if (kind === "a" && !f)
|
|
1124
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
1125
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
1126
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
1127
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
1128
|
+
}
|
|
1129
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
1130
|
+
if (kind === "m")
|
|
1131
|
+
throw new TypeError("Private method is not writable");
|
|
1132
|
+
if (kind === "a" && !f)
|
|
1133
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
1134
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
1135
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
1136
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
var logger = new awsAmplify.Logger('SetupTotp');
|
|
1140
|
+
var SetupTotpComponent = /** @class */ (function () {
|
|
1141
|
+
function SetupTotpComponent(authenticator) {
|
|
1142
|
+
this.authenticator = authenticator;
|
|
1143
|
+
this.dataAttr = '';
|
|
1144
|
+
this.headerText = ui.translate('Setup TOTP');
|
|
1145
|
+
this.qrCodeSource = '';
|
|
1146
|
+
// translated texts
|
|
1147
|
+
this.backToSignInText = ui.translate('Back to Sign In');
|
|
1148
|
+
this.confirmText = ui.translate('Confirm');
|
|
1149
|
+
}
|
|
1150
|
+
SetupTotpComponent.prototype.ngOnInit = function () {
|
|
1151
|
+
this.generateQRCode();
|
|
1152
|
+
};
|
|
1153
|
+
Object.defineProperty(SetupTotpComponent.prototype, "context", {
|
|
1154
|
+
get: function () {
|
|
1155
|
+
return this.authenticator.slotContext;
|
|
1156
|
+
},
|
|
1157
|
+
enumerable: false,
|
|
1158
|
+
configurable: true
|
|
1159
|
+
});
|
|
1160
|
+
SetupTotpComponent.prototype.generateQRCode = function () {
|
|
1161
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1162
|
+
var state, actorContext, user, secretKey, issuer, totpCode, _a, err_1;
|
|
1163
|
+
return __generator(this, function (_b) {
|
|
1164
|
+
switch (_b.label) {
|
|
1165
|
+
case 0:
|
|
1166
|
+
state = this.authenticator.authState;
|
|
1167
|
+
actorContext = ui.getActorContext(state);
|
|
1168
|
+
user = actorContext.user;
|
|
1169
|
+
_b.label = 1;
|
|
1170
|
+
case 1:
|
|
1171
|
+
_b.trys.push([1, 4, , 5]);
|
|
1172
|
+
return [4 /*yield*/, awsAmplify.Auth.setupTOTP(user)];
|
|
1173
|
+
case 2:
|
|
1174
|
+
secretKey = _b.sent();
|
|
1175
|
+
issuer = 'AWSCognito';
|
|
1176
|
+
totpCode = "otpauth://totp/" + issuer + ":" + user.username + "?secret=" + secretKey + "&issuer=" + issuer;
|
|
1177
|
+
logger.info('totp code was generated:', totpCode);
|
|
1178
|
+
_a = this;
|
|
1179
|
+
return [4 /*yield*/, QRCode__default["default"].toDataURL(totpCode)];
|
|
1180
|
+
case 3:
|
|
1181
|
+
_a.qrCodeSource = _b.sent();
|
|
1182
|
+
return [3 /*break*/, 5];
|
|
1183
|
+
case 4:
|
|
1184
|
+
err_1 = _b.sent();
|
|
1185
|
+
logger.error(err_1);
|
|
1186
|
+
return [3 /*break*/, 5];
|
|
1187
|
+
case 5: return [2 /*return*/];
|
|
1188
|
+
}
|
|
1189
|
+
});
|
|
1190
|
+
});
|
|
1191
|
+
};
|
|
1192
|
+
SetupTotpComponent.prototype.onInput = function (event) {
|
|
1193
|
+
event.preventDefault();
|
|
1194
|
+
var _a = event.target, name = _a.name, value = _a.value;
|
|
1195
|
+
this.authenticator.updateForm({ name: name, value: value });
|
|
1196
|
+
};
|
|
1197
|
+
SetupTotpComponent.prototype.onSubmit = function (event) {
|
|
1198
|
+
event.preventDefault();
|
|
1199
|
+
this.authenticator.submitForm();
|
|
1200
|
+
};
|
|
1201
|
+
return SetupTotpComponent;
|
|
1202
|
+
}());
|
|
1203
|
+
SetupTotpComponent.decorators = [
|
|
1204
|
+
{ type: i0.Component, args: [{
|
|
1205
|
+
selector: 'amplify-setup-totp',
|
|
1206
|
+
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"
|
|
1207
|
+
},] }
|
|
1208
|
+
];
|
|
1209
|
+
SetupTotpComponent.ctorParameters = function () { return [
|
|
1210
|
+
{ type: AuthenticatorService }
|
|
1211
|
+
]; };
|
|
1212
|
+
SetupTotpComponent.propDecorators = {
|
|
1213
|
+
dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-setup-totp',] }]
|
|
1214
|
+
};
|
|
1215
|
+
|
|
1216
|
+
var SignInComponent = /** @class */ (function () {
|
|
1217
|
+
function SignInComponent(authenticator) {
|
|
1218
|
+
this.authenticator = authenticator;
|
|
1219
|
+
this.dataAttr = '';
|
|
1220
|
+
// translated phrases
|
|
1221
|
+
this.forgotPasswordText = ui.translate('Forgot your password? ');
|
|
1222
|
+
this.signInButtonText = ui.translate('Sign in');
|
|
1223
|
+
}
|
|
1224
|
+
Object.defineProperty(SignInComponent.prototype, "context", {
|
|
1225
|
+
get: function () {
|
|
1226
|
+
return this.authenticator.slotContext;
|
|
1227
|
+
},
|
|
1228
|
+
enumerable: false,
|
|
1229
|
+
configurable: true
|
|
1230
|
+
});
|
|
1231
|
+
SignInComponent.prototype.onInput = function (event) {
|
|
1232
|
+
event.preventDefault();
|
|
1233
|
+
var _a = event.target, name = _a.name, value = _a.value;
|
|
1234
|
+
this.authenticator.updateForm({ name: name, value: value });
|
|
1235
|
+
};
|
|
1236
|
+
SignInComponent.prototype.onSubmit = function (event) {
|
|
1237
|
+
event.preventDefault();
|
|
1238
|
+
this.authenticator.submitForm();
|
|
1239
|
+
};
|
|
1240
|
+
return SignInComponent;
|
|
1241
|
+
}());
|
|
1242
|
+
SignInComponent.decorators = [
|
|
1243
|
+
{ type: i0.Component, args: [{
|
|
1244
|
+
selector: 'amplify-sign-in',
|
|
1245
|
+
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",
|
|
1246
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
1247
|
+
},] }
|
|
1248
|
+
];
|
|
1249
|
+
SignInComponent.ctorParameters = function () { return [
|
|
1250
|
+
{ type: AuthenticatorService }
|
|
1251
|
+
]; };
|
|
1252
|
+
SignInComponent.propDecorators = {
|
|
1253
|
+
dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-signin',] }]
|
|
1254
|
+
};
|
|
1255
|
+
|
|
1256
|
+
var SignUpComponent = /** @class */ (function () {
|
|
1257
|
+
function SignUpComponent(authenticator) {
|
|
1258
|
+
this.authenticator = authenticator;
|
|
1259
|
+
this.dataAttr = '';
|
|
1260
|
+
// translated texts
|
|
1261
|
+
this.createAccountText = ui.translate('Create Account');
|
|
1262
|
+
}
|
|
1263
|
+
Object.defineProperty(SignUpComponent.prototype, "context", {
|
|
1264
|
+
get: function () {
|
|
1265
|
+
return this.authenticator.slotContext;
|
|
1266
|
+
},
|
|
1267
|
+
enumerable: false,
|
|
1268
|
+
configurable: true
|
|
1269
|
+
});
|
|
1270
|
+
SignUpComponent.prototype.onInput = function (event) {
|
|
1271
|
+
var _a = event.target, checked = _a.checked, name = _a.name, type = _a.type, value = _a.value;
|
|
1272
|
+
if (type === 'checkbox' && !checked)
|
|
1273
|
+
value = undefined;
|
|
1274
|
+
this.authenticator.updateForm({ name: name, value: value });
|
|
1275
|
+
};
|
|
1276
|
+
SignUpComponent.prototype.onSubmit = function (event) {
|
|
1277
|
+
event.preventDefault();
|
|
1278
|
+
this.authenticator.submitForm();
|
|
1279
|
+
};
|
|
1280
|
+
return SignUpComponent;
|
|
1281
|
+
}());
|
|
1282
|
+
SignUpComponent.decorators = [
|
|
1283
|
+
{ type: i0.Component, args: [{
|
|
1284
|
+
selector: 'amplify-sign-up',
|
|
1285
|
+
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"
|
|
1286
|
+
},] }
|
|
1287
|
+
];
|
|
1288
|
+
SignUpComponent.ctorParameters = function () { return [
|
|
1289
|
+
{ type: AuthenticatorService }
|
|
1290
|
+
]; };
|
|
1291
|
+
SignUpComponent.propDecorators = {
|
|
1292
|
+
dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-signup',] }]
|
|
1293
|
+
};
|
|
1294
|
+
|
|
1295
|
+
var SignUpFormFieldsComponent = /** @class */ (function () {
|
|
1296
|
+
function SignUpFormFieldsComponent(authenticator) {
|
|
1297
|
+
this.authenticator = authenticator;
|
|
1298
|
+
this.primaryAlias = '';
|
|
1299
|
+
this.secondaryAliases = [];
|
|
1300
|
+
}
|
|
1301
|
+
SignUpFormFieldsComponent.prototype.ngOnInit = function () {
|
|
1302
|
+
var context = this.authenticator.context;
|
|
1303
|
+
var _a = context.config, loginMechanisms = _a.loginMechanisms, signUpAttributes = _a.signUpAttributes;
|
|
1304
|
+
this.fieldNames = Array.from(new Set(__spread(loginMechanisms, signUpAttributes)));
|
|
1305
|
+
this.fieldNames = this.fieldNames.filter(function (fieldName) {
|
|
1306
|
+
var hasDefaultField = !!ui.authInputAttributes[fieldName];
|
|
1307
|
+
if (!hasDefaultField) {
|
|
1308
|
+
console.debug("Authenticator does not have a default implementation for " + fieldName + ". Customize Authenticator.SignUp.FormFields to add your own.");
|
|
1309
|
+
}
|
|
1310
|
+
return hasDefaultField;
|
|
1311
|
+
});
|
|
1312
|
+
// Only 1 is supported, so `['email', 'phone_number']` will only show `email`
|
|
1313
|
+
this.loginMechanism = this.fieldNames.shift();
|
|
1314
|
+
};
|
|
1315
|
+
return SignUpFormFieldsComponent;
|
|
1316
|
+
}());
|
|
1317
|
+
SignUpFormFieldsComponent.decorators = [
|
|
1318
|
+
{ type: i0.Component, args: [{
|
|
1319
|
+
selector: 'amplify-sign-up-form-fields',
|
|
1320
|
+
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"
|
|
1321
|
+
},] }
|
|
1322
|
+
];
|
|
1323
|
+
SignUpFormFieldsComponent.ctorParameters = function () { return [
|
|
1324
|
+
{ type: AuthenticatorService }
|
|
1325
|
+
]; };
|
|
1326
|
+
|
|
1327
|
+
var UserNameAliasComponent = /** @class */ (function () {
|
|
1328
|
+
function UserNameAliasComponent(authenticator) {
|
|
1329
|
+
this.authenticator = authenticator;
|
|
1330
|
+
this.name = 'username';
|
|
1331
|
+
this.disabled = false;
|
|
1332
|
+
this.initialValue = '';
|
|
1333
|
+
this.required = true;
|
|
1334
|
+
}
|
|
1335
|
+
UserNameAliasComponent.prototype.ngOnInit = function () {
|
|
1336
|
+
var context = this.authenticator.context;
|
|
1337
|
+
var _a = ui.getAliasInfoFromContext(context), label = _a.label, type = _a.type;
|
|
1338
|
+
this.label = label;
|
|
1339
|
+
this.type = type;
|
|
1340
|
+
this.placeholder = label;
|
|
1341
|
+
};
|
|
1342
|
+
return UserNameAliasComponent;
|
|
1343
|
+
}());
|
|
1344
|
+
UserNameAliasComponent.decorators = [
|
|
1345
|
+
{ type: i0.Component, args: [{
|
|
1346
|
+
selector: 'amplify-user-name-alias',
|
|
1347
|
+
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"
|
|
1348
|
+
},] }
|
|
1349
|
+
];
|
|
1350
|
+
UserNameAliasComponent.ctorParameters = function () { return [
|
|
1351
|
+
{ type: AuthenticatorService }
|
|
1352
|
+
]; };
|
|
1353
|
+
UserNameAliasComponent.propDecorators = {
|
|
1354
|
+
name: [{ type: i0.Input }],
|
|
1355
|
+
disabled: [{ type: i0.Input }],
|
|
1356
|
+
initialValue: [{ type: i0.Input }],
|
|
1357
|
+
required: [{ type: i0.Input }]
|
|
1358
|
+
};
|
|
1359
|
+
|
|
1360
|
+
var VerifyUserComponent = /** @class */ (function () {
|
|
1361
|
+
function VerifyUserComponent(authenticator) {
|
|
1362
|
+
this.authenticator = authenticator;
|
|
1363
|
+
this.dataAttr = '';
|
|
1364
|
+
this.headerText = ui.translate('Account recovery requires verified contact information');
|
|
1365
|
+
this.unverifiedAttributes = {};
|
|
1366
|
+
this.labelId = nanoid.nanoid(12);
|
|
1367
|
+
// translated texts
|
|
1368
|
+
this.skipText = ui.translate('Skip');
|
|
1369
|
+
this.verifyText = ui.translate('Verify');
|
|
1370
|
+
}
|
|
1371
|
+
VerifyUserComponent.prototype.ngOnInit = function () {
|
|
1372
|
+
var actorState = ui.getActorState(this.authenticator.authState);
|
|
1373
|
+
this.unverifiedAttributes = actorState.context.unverifiedAttributes;
|
|
1374
|
+
};
|
|
1375
|
+
Object.defineProperty(VerifyUserComponent.prototype, "context", {
|
|
1376
|
+
get: function () {
|
|
1377
|
+
return this.authenticator.slotContext;
|
|
1378
|
+
},
|
|
1379
|
+
enumerable: false,
|
|
1380
|
+
configurable: true
|
|
1381
|
+
});
|
|
1382
|
+
VerifyUserComponent.prototype.getLabelForAttr = function (authAttr) {
|
|
1383
|
+
var _a;
|
|
1384
|
+
var attributeMap = getAttributeMap();
|
|
1385
|
+
var label = (_a = attributeMap[authAttr]) === null || _a === void 0 ? void 0 : _a.label;
|
|
1386
|
+
return ui.translate(label);
|
|
1387
|
+
};
|
|
1388
|
+
VerifyUserComponent.prototype.onInput = function (event) {
|
|
1389
|
+
event.preventDefault();
|
|
1390
|
+
var _b = event.target, name = _b.name, value = _b.value;
|
|
1391
|
+
this.authenticator.updateForm({ name: name, value: value });
|
|
1392
|
+
};
|
|
1393
|
+
VerifyUserComponent.prototype.onSubmit = function (event) {
|
|
1394
|
+
event.preventDefault();
|
|
1395
|
+
this.authenticator.submitForm();
|
|
1396
|
+
};
|
|
1397
|
+
return VerifyUserComponent;
|
|
1398
|
+
}());
|
|
1399
|
+
VerifyUserComponent.decorators = [
|
|
1400
|
+
{ type: i0.Component, args: [{
|
|
1401
|
+
selector: 'amplify-verify-user',
|
|
1402
|
+
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",
|
|
1403
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
1404
|
+
},] }
|
|
1405
|
+
];
|
|
1406
|
+
VerifyUserComponent.ctorParameters = function () { return [
|
|
1407
|
+
{ type: AuthenticatorService }
|
|
1408
|
+
]; };
|
|
1409
|
+
VerifyUserComponent.propDecorators = {
|
|
1410
|
+
dataAttr: [{ type: i0.HostBinding, args: ['attr.data-amplify-authenticator-verifyuser',] }],
|
|
1411
|
+
headerText: [{ type: i0.Input }]
|
|
1412
|
+
};
|
|
1413
|
+
|
|
1414
|
+
var ButtonComponent = /** @class */ (function () {
|
|
1415
|
+
function ButtonComponent() {
|
|
1416
|
+
this.type = 'button';
|
|
1417
|
+
this.fullWidth = false;
|
|
1418
|
+
this.size = 'medium';
|
|
1419
|
+
this.variation = 'default';
|
|
1420
|
+
this.fontWeight = 'normal';
|
|
1421
|
+
this.defaultClass = true;
|
|
1422
|
+
}
|
|
1423
|
+
ButtonComponent.prototype.ngOnInit = function () {
|
|
1424
|
+
this.typeAttr = this.type;
|
|
1425
|
+
this.fullWidthAttr = this.fullWidth;
|
|
1426
|
+
this.sizeAttr = this.size;
|
|
1427
|
+
this.variationAttr = this.variation;
|
|
1428
|
+
this.fontWeightAttr = this.fontWeight;
|
|
1429
|
+
};
|
|
1430
|
+
return ButtonComponent;
|
|
1431
|
+
}());
|
|
1432
|
+
ButtonComponent.decorators = [
|
|
1433
|
+
{ type: i0.Component, args: [{
|
|
1434
|
+
selector: 'button[amplify-button]',
|
|
1435
|
+
template: "<ng-content></ng-content>\n"
|
|
1436
|
+
},] }
|
|
1437
|
+
];
|
|
1438
|
+
ButtonComponent.propDecorators = {
|
|
1439
|
+
type: [{ type: i0.Input }],
|
|
1440
|
+
fullWidth: [{ type: i0.Input }],
|
|
1441
|
+
size: [{ type: i0.Input }],
|
|
1442
|
+
variation: [{ type: i0.Input }],
|
|
1443
|
+
fontWeight: [{ type: i0.Input }],
|
|
1444
|
+
typeAttr: [{ type: i0.HostBinding, args: ['type',] }],
|
|
1445
|
+
fullWidthAttr: [{ type: i0.HostBinding, args: ['attr.data-fullwidth',] }],
|
|
1446
|
+
sizeAttr: [{ type: i0.HostBinding, args: ['attr.data-size',] }],
|
|
1447
|
+
variationAttr: [{ type: i0.HostBinding, args: ['attr.data-variation',] }],
|
|
1448
|
+
defaultClass: [{ type: i0.HostBinding, args: ['class.amplify-button',] }],
|
|
1449
|
+
fontWeightAttr: [{ type: i0.HostBinding, args: ['style.font-weight',] }]
|
|
1450
|
+
};
|
|
1451
|
+
|
|
1452
|
+
var CheckboxComponent = /** @class */ (function () {
|
|
1453
|
+
function CheckboxComponent() {
|
|
1454
|
+
this.defaultChecked = false;
|
|
1455
|
+
this.hasError = false;
|
|
1456
|
+
this.isChecked = false;
|
|
1457
|
+
}
|
|
1458
|
+
CheckboxComponent.prototype.ngOnInit = function () {
|
|
1459
|
+
if (this.defaultChecked) {
|
|
1460
|
+
this.isChecked = true;
|
|
1461
|
+
}
|
|
1462
|
+
};
|
|
1463
|
+
CheckboxComponent.prototype.handleClick = function () {
|
|
1464
|
+
this.isChecked = !this.isChecked;
|
|
1465
|
+
};
|
|
1466
|
+
return CheckboxComponent;
|
|
1467
|
+
}());
|
|
1468
|
+
CheckboxComponent.decorators = [
|
|
1469
|
+
{ type: i0.Component, args: [{
|
|
1470
|
+
selector: 'amplify-checkbox',
|
|
1471
|
+
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"
|
|
1472
|
+
},] }
|
|
1473
|
+
];
|
|
1474
|
+
CheckboxComponent.propDecorators = {
|
|
1475
|
+
defaultChecked: [{ type: i0.Input }],
|
|
1476
|
+
errorMessage: [{ type: i0.Input }],
|
|
1477
|
+
hasError: [{ type: i0.Input }],
|
|
1478
|
+
label: [{ type: i0.Input }],
|
|
1479
|
+
name: [{ type: i0.Input }],
|
|
1480
|
+
value: [{ type: i0.Input }]
|
|
1481
|
+
};
|
|
1482
|
+
|
|
1483
|
+
var ErrorComponent = /** @class */ (function () {
|
|
1484
|
+
function ErrorComponent() {
|
|
1485
|
+
this.isVisible = true;
|
|
1486
|
+
}
|
|
1487
|
+
ErrorComponent.prototype.close = function () {
|
|
1488
|
+
this.isVisible = false;
|
|
1489
|
+
};
|
|
1490
|
+
return ErrorComponent;
|
|
1491
|
+
}());
|
|
1492
|
+
ErrorComponent.decorators = [
|
|
1493
|
+
{ type: i0.Component, args: [{
|
|
1494
|
+
selector: 'amplify-error',
|
|
1495
|
+
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"
|
|
1496
|
+
},] }
|
|
1497
|
+
];
|
|
1498
|
+
|
|
1499
|
+
var PasswordFieldComponent = /** @class */ (function () {
|
|
1500
|
+
function PasswordFieldComponent() {
|
|
1501
|
+
this.autocomplete = 'new-password';
|
|
1502
|
+
this.disabled = false;
|
|
1503
|
+
this.fieldId = "amplify-field-" + nanoid.nanoid(12);
|
|
1504
|
+
this.initialValue = '';
|
|
1505
|
+
this.label = '';
|
|
1506
|
+
this.placeholder = '';
|
|
1507
|
+
this.required = true;
|
|
1508
|
+
this.labelHidden = false;
|
|
1509
|
+
this.type = 'password';
|
|
1510
|
+
this.showPassword = false;
|
|
1511
|
+
this.showPasswordButtonlabel = ui.translate('Show password');
|
|
1512
|
+
}
|
|
1513
|
+
PasswordFieldComponent.prototype.togglePasswordText = function () {
|
|
1514
|
+
this.showPassword = !this.showPassword;
|
|
1515
|
+
this.showPasswordButtonlabel = this.showPassword
|
|
1516
|
+
? ui.translate('Show password')
|
|
1517
|
+
: ui.translate('Hide password');
|
|
1518
|
+
this.type = this.showPassword ? 'text' : 'password';
|
|
1519
|
+
};
|
|
1520
|
+
return PasswordFieldComponent;
|
|
1521
|
+
}());
|
|
1522
|
+
PasswordFieldComponent.decorators = [
|
|
1523
|
+
{ type: i0.Component, args: [{
|
|
1524
|
+
selector: 'amplify-password-field',
|
|
1525
|
+
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"
|
|
1526
|
+
},] }
|
|
1527
|
+
];
|
|
1528
|
+
PasswordFieldComponent.propDecorators = {
|
|
1529
|
+
autocomplete: [{ type: i0.Input }],
|
|
1530
|
+
disabled: [{ type: i0.Input }],
|
|
1531
|
+
fieldId: [{ type: i0.Input }],
|
|
1532
|
+
initialValue: [{ type: i0.Input }],
|
|
1533
|
+
label: [{ type: i0.Input }],
|
|
1534
|
+
name: [{ type: i0.Input }],
|
|
1535
|
+
placeholder: [{ type: i0.Input }],
|
|
1536
|
+
required: [{ type: i0.Input }],
|
|
1537
|
+
labelHidden: [{ type: i0.Input }]
|
|
1538
|
+
};
|
|
1539
|
+
|
|
1540
|
+
var PhoneNumberFieldComponent = /** @class */ (function () {
|
|
1541
|
+
function PhoneNumberFieldComponent() {
|
|
1542
|
+
this.autocomplete = 'new-password';
|
|
1543
|
+
this.disabled = false;
|
|
1544
|
+
this.selectFieldId = "amplify-field-" + nanoid.nanoid(12);
|
|
1545
|
+
this.textFieldId = "amplify-field-" + nanoid.nanoid(12);
|
|
1546
|
+
this.initialValue = '';
|
|
1547
|
+
this.label = '';
|
|
1548
|
+
this.placeholder = '';
|
|
1549
|
+
this.required = true;
|
|
1550
|
+
this.labelHidden = false;
|
|
1551
|
+
this.display = 'contents';
|
|
1552
|
+
this.countryDialCodes = ui.countryDialCodes;
|
|
1553
|
+
}
|
|
1554
|
+
return PhoneNumberFieldComponent;
|
|
1555
|
+
}());
|
|
1556
|
+
PhoneNumberFieldComponent.decorators = [
|
|
1557
|
+
{ type: i0.Component, args: [{
|
|
1558
|
+
selector: 'amplify-phone-number-field',
|
|
1559
|
+
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"
|
|
1560
|
+
},] }
|
|
1561
|
+
];
|
|
1562
|
+
PhoneNumberFieldComponent.propDecorators = {
|
|
1563
|
+
autocomplete: [{ type: i0.Input }],
|
|
1564
|
+
disabled: [{ type: i0.Input }],
|
|
1565
|
+
defaultCountryCode: [{ type: i0.Input }],
|
|
1566
|
+
selectFieldId: [{ type: i0.Input }],
|
|
1567
|
+
textFieldId: [{ type: i0.Input }],
|
|
1568
|
+
initialValue: [{ type: i0.Input }],
|
|
1569
|
+
label: [{ type: i0.Input }],
|
|
1570
|
+
name: [{ type: i0.Input }],
|
|
1571
|
+
placeholder: [{ type: i0.Input }],
|
|
1572
|
+
required: [{ type: i0.Input }],
|
|
1573
|
+
type: [{ type: i0.Input }],
|
|
1574
|
+
labelHidden: [{ type: i0.Input }],
|
|
1575
|
+
display: [{ type: i0.HostBinding, args: ['style.display',] }]
|
|
1576
|
+
};
|
|
1577
|
+
|
|
1578
|
+
var SelectComponent = /** @class */ (function () {
|
|
1579
|
+
function SelectComponent() {
|
|
1580
|
+
}
|
|
1581
|
+
return SelectComponent;
|
|
1582
|
+
}());
|
|
1583
|
+
SelectComponent.decorators = [
|
|
1584
|
+
{ type: i0.Component, args: [{
|
|
1585
|
+
selector: 'amplify-form-select',
|
|
1586
|
+
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"
|
|
1587
|
+
},] }
|
|
1588
|
+
];
|
|
1589
|
+
SelectComponent.propDecorators = {
|
|
1590
|
+
items: [{ type: i0.Input }],
|
|
1591
|
+
name: [{ type: i0.Input }],
|
|
1592
|
+
label: [{ type: i0.Input }],
|
|
1593
|
+
id: [{ type: i0.Input }],
|
|
1594
|
+
defaultValue: [{ type: i0.Input }]
|
|
1595
|
+
};
|
|
1596
|
+
|
|
1597
|
+
var TabItemComponent = /** @class */ (function () {
|
|
1598
|
+
function TabItemComponent() {
|
|
1599
|
+
this.active = false;
|
|
1600
|
+
}
|
|
1601
|
+
return TabItemComponent;
|
|
1602
|
+
}());
|
|
1603
|
+
TabItemComponent.decorators = [
|
|
1604
|
+
{ type: i0.Component, args: [{
|
|
1605
|
+
selector: 'amplify-tab-item',
|
|
1606
|
+
template: "<div\n data-orientation=\"horizontal\"\n role=\"tabpanel\"\n [id]=\"id\"\n [attr.aria-labelledby]=\"labelledById\"\n [attr.data-state]=\"active ? 'active' : 'inactive'\"\n [attr.tabindex]=\"tabIndex\"\n>\n <ng-content *ngIf=\"active\"></ng-content>\n</div>\n"
|
|
1607
|
+
},] }
|
|
1608
|
+
];
|
|
1609
|
+
TabItemComponent.propDecorators = {
|
|
1610
|
+
title: [{ type: i0.Input }],
|
|
1611
|
+
active: [{ type: i0.Input }],
|
|
1612
|
+
id: [{ type: i0.Input }],
|
|
1613
|
+
labelledById: [{ type: i0.Input }],
|
|
1614
|
+
tabIndex: [{ type: i0.Input }]
|
|
1615
|
+
};
|
|
1616
|
+
|
|
1617
|
+
var TabsComponent = /** @class */ (function () {
|
|
1618
|
+
function TabsComponent() {
|
|
1619
|
+
this.tabChange = new i0.EventEmitter();
|
|
1620
|
+
}
|
|
1621
|
+
TabsComponent.prototype.ngAfterContentInit = function () {
|
|
1622
|
+
// assign ids
|
|
1623
|
+
this.tabs.forEach(function (tab, index) {
|
|
1624
|
+
tab.id = "radix-id-" + nanoid.nanoid(12) + "-1-content-" + index;
|
|
1625
|
+
tab.labelledById = "radix-id-" + nanoid.nanoid(12) + "-1-trigger-" + index;
|
|
1626
|
+
});
|
|
1627
|
+
// find active tab
|
|
1628
|
+
// TODO(enhancement): more declarative way for choosing the initial tab to render
|
|
1629
|
+
var activeTabs = this.tabs.filter(function (tab) { return tab.active; });
|
|
1630
|
+
// set active tab
|
|
1631
|
+
if (activeTabs.length !== 1) {
|
|
1632
|
+
this.selectTab(this.tabs.first);
|
|
1633
|
+
}
|
|
1634
|
+
};
|
|
1635
|
+
TabsComponent.prototype.selectTab = function (tab) {
|
|
1636
|
+
this.tabs.forEach(function (tab) {
|
|
1637
|
+
tab.active = false;
|
|
1638
|
+
});
|
|
1639
|
+
tab.active = true;
|
|
1640
|
+
};
|
|
1641
|
+
TabsComponent.prototype.handleTabClick = function (tab) {
|
|
1642
|
+
if (tab.active)
|
|
1643
|
+
return; // don't do anything if clicks the current active tab
|
|
1644
|
+
this.tabChange.emit();
|
|
1645
|
+
this.selectTab(tab);
|
|
1646
|
+
};
|
|
1647
|
+
return TabsComponent;
|
|
1648
|
+
}());
|
|
1649
|
+
TabsComponent.decorators = [
|
|
1650
|
+
{ type: i0.Component, args: [{
|
|
1651
|
+
selector: 'amplify-tabs',
|
|
1652
|
+
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"
|
|
1653
|
+
},] }
|
|
1654
|
+
];
|
|
1655
|
+
TabsComponent.propDecorators = {
|
|
1656
|
+
tabs: [{ type: i0.ContentChildren, args: [TabItemComponent,] }],
|
|
1657
|
+
tabChange: [{ type: i0.Output }]
|
|
1658
|
+
};
|
|
1659
|
+
|
|
1660
|
+
var TextFieldComponent = /** @class */ (function () {
|
|
1661
|
+
function TextFieldComponent() {
|
|
1662
|
+
this.autocomplete = 'new-password';
|
|
1663
|
+
this.disabled = false;
|
|
1664
|
+
this.fieldId = "amplify-field-" + nanoid.nanoid(12);
|
|
1665
|
+
this.initialValue = '';
|
|
1666
|
+
this.label = '';
|
|
1667
|
+
this.placeholder = '';
|
|
1668
|
+
this.required = true;
|
|
1669
|
+
this.labelHidden = false;
|
|
1670
|
+
this.display = 'contents';
|
|
1671
|
+
}
|
|
1672
|
+
return TextFieldComponent;
|
|
1673
|
+
}());
|
|
1674
|
+
TextFieldComponent.decorators = [
|
|
1675
|
+
{ type: i0.Component, args: [{
|
|
1676
|
+
selector: 'amplify-text-field',
|
|
1677
|
+
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"
|
|
1678
|
+
},] }
|
|
1679
|
+
];
|
|
1680
|
+
TextFieldComponent.propDecorators = {
|
|
1681
|
+
autocomplete: [{ type: i0.Input }],
|
|
1682
|
+
disabled: [{ type: i0.Input }],
|
|
1683
|
+
fieldId: [{ type: i0.Input }],
|
|
1684
|
+
initialValue: [{ type: i0.Input }],
|
|
1685
|
+
label: [{ type: i0.Input }],
|
|
1686
|
+
name: [{ type: i0.Input }],
|
|
1687
|
+
placeholder: [{ type: i0.Input }],
|
|
1688
|
+
required: [{ type: i0.Input }],
|
|
1689
|
+
type: [{ type: i0.Input }],
|
|
1690
|
+
labelHidden: [{ type: i0.Input }],
|
|
1691
|
+
display: [{ type: i0.HostBinding, args: ['style.display',] }]
|
|
1692
|
+
};
|
|
1693
|
+
|
|
1694
|
+
var AmplifySlotComponent = /** @class */ (function () {
|
|
1695
|
+
function AmplifySlotComponent(propService) {
|
|
1696
|
+
this.propService = propService;
|
|
1697
|
+
this.display = 'contents';
|
|
1698
|
+
this.isOverriden = false;
|
|
1699
|
+
}
|
|
1700
|
+
AmplifySlotComponent.prototype.ngAfterContentInit = function () {
|
|
1701
|
+
var customComponents = this.propService.customComponents;
|
|
1702
|
+
var overridingComponent = customComponents[this.name];
|
|
1703
|
+
if (overridingComponent) {
|
|
1704
|
+
this.overridingComponent = overridingComponent;
|
|
1705
|
+
this.isOverriden = true;
|
|
1706
|
+
}
|
|
1707
|
+
};
|
|
1708
|
+
return AmplifySlotComponent;
|
|
1709
|
+
}());
|
|
1710
|
+
AmplifySlotComponent.decorators = [
|
|
1711
|
+
{ type: i0.Component, args: [{
|
|
1712
|
+
selector: 'amplify-slot',
|
|
1713
|
+
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"
|
|
1714
|
+
},] }
|
|
1715
|
+
];
|
|
1716
|
+
AmplifySlotComponent.ctorParameters = function () { return [
|
|
1717
|
+
{ type: CustomComponentsService }
|
|
1718
|
+
]; };
|
|
1719
|
+
AmplifySlotComponent.propDecorators = {
|
|
1720
|
+
name: [{ type: i0.Input }],
|
|
1721
|
+
context: [{ type: i0.Input }],
|
|
1722
|
+
display: [{ type: i0.HostBinding, args: ['style.display',] }]
|
|
1723
|
+
};
|
|
1724
|
+
|
|
1725
|
+
var AmplifyAuthenticatorModule = /** @class */ (function () {
|
|
1726
|
+
function AmplifyAuthenticatorModule() {
|
|
1727
|
+
}
|
|
1728
|
+
return AmplifyAuthenticatorModule;
|
|
1729
|
+
}());
|
|
1730
|
+
AmplifyAuthenticatorModule.decorators = [
|
|
1731
|
+
{ type: i0.NgModule, args: [{
|
|
1732
|
+
declarations: [
|
|
1733
|
+
AmplifySlotComponent,
|
|
1734
|
+
AmplifySlotDirective,
|
|
1735
|
+
AuthenticatorComponent,
|
|
1736
|
+
ButtonComponent,
|
|
1737
|
+
CheckboxComponent,
|
|
1738
|
+
ConfirmResetPasswordComponent,
|
|
1739
|
+
ConfirmSignInComponent,
|
|
1740
|
+
ConfirmSignUpComponent,
|
|
1741
|
+
ConfirmVerifyUserComponent,
|
|
1742
|
+
ErrorComponent,
|
|
1743
|
+
FederatedSignInButtonComponent,
|
|
1744
|
+
FederatedSignInComponent,
|
|
1745
|
+
ForceNewPasswordComponent,
|
|
1746
|
+
FormFieldComponent,
|
|
1747
|
+
PasswordFieldComponent,
|
|
1748
|
+
PhoneNumberFieldComponent,
|
|
1749
|
+
ResetPasswordComponent,
|
|
1750
|
+
SelectComponent,
|
|
1751
|
+
SetupTotpComponent,
|
|
1752
|
+
SignInComponent,
|
|
1753
|
+
SignUpComponent,
|
|
1754
|
+
SignUpFormFieldsComponent,
|
|
1755
|
+
TabItemComponent,
|
|
1756
|
+
TabsComponent,
|
|
1757
|
+
TextFieldComponent,
|
|
1758
|
+
UserNameAliasComponent,
|
|
1759
|
+
VerifyUserComponent,
|
|
1760
|
+
],
|
|
1761
|
+
imports: [common.CommonModule, platformBrowser.BrowserModule],
|
|
1762
|
+
exports: [
|
|
1763
|
+
AmplifySlotDirective,
|
|
1764
|
+
AuthenticatorComponent,
|
|
1765
|
+
CheckboxComponent,
|
|
1766
|
+
SignUpFormFieldsComponent,
|
|
1767
|
+
TextFieldComponent,
|
|
1768
|
+
],
|
|
1769
|
+
},] }
|
|
1770
|
+
];
|
|
1771
|
+
|
|
1772
|
+
/*
|
|
1773
|
+
* Public API Surface of ui-angular
|
|
1774
|
+
*/
|
|
1775
|
+
|
|
1776
|
+
/**
|
|
1777
|
+
* Generated bundle index. Do not edit.
|
|
1778
|
+
*/
|
|
1779
|
+
|
|
1780
|
+
exports.AmplifyAuthenticatorModule = AmplifyAuthenticatorModule;
|
|
1781
|
+
exports.AmplifySlotDirective = AmplifySlotDirective;
|
|
1782
|
+
exports.AuthenticatorComponent = AuthenticatorComponent;
|
|
1783
|
+
exports.AuthenticatorService = AuthenticatorService;
|
|
1784
|
+
exports.ButtonComponent = ButtonComponent;
|
|
1785
|
+
exports.CheckboxComponent = CheckboxComponent;
|
|
1786
|
+
exports.ConfirmResetPasswordComponent = ConfirmResetPasswordComponent;
|
|
1787
|
+
exports.ConfirmSignInComponent = ConfirmSignInComponent;
|
|
1788
|
+
exports.ConfirmSignUpComponent = ConfirmSignUpComponent;
|
|
1789
|
+
exports.ConfirmVerifyUserComponent = ConfirmVerifyUserComponent;
|
|
1790
|
+
exports.CustomComponentsService = CustomComponentsService;
|
|
1791
|
+
exports.ErrorComponent = ErrorComponent;
|
|
1792
|
+
exports.FederatedSignInButtonComponent = FederatedSignInButtonComponent;
|
|
1793
|
+
exports.FederatedSignInComponent = FederatedSignInComponent;
|
|
1794
|
+
exports.ForceNewPasswordComponent = ForceNewPasswordComponent;
|
|
1795
|
+
exports.FormFieldComponent = FormFieldComponent;
|
|
1796
|
+
exports.PasswordFieldComponent = PasswordFieldComponent;
|
|
1797
|
+
exports.PhoneNumberFieldComponent = PhoneNumberFieldComponent;
|
|
1798
|
+
exports.ResetPasswordComponent = ResetPasswordComponent;
|
|
1799
|
+
exports.SelectComponent = SelectComponent;
|
|
1800
|
+
exports.SetupTotpComponent = SetupTotpComponent;
|
|
1801
|
+
exports.SignInComponent = SignInComponent;
|
|
1802
|
+
exports.SignUpComponent = SignUpComponent;
|
|
1803
|
+
exports.SignUpFormFieldsComponent = SignUpFormFieldsComponent;
|
|
1804
|
+
exports.TabItemComponent = TabItemComponent;
|
|
1805
|
+
exports.TabsComponent = TabsComponent;
|
|
1806
|
+
exports.TextFieldComponent = TextFieldComponent;
|
|
1807
|
+
exports.UserNameAliasComponent = UserNameAliasComponent;
|
|
1808
|
+
exports.VerifyUserComponent = VerifyUserComponent;
|
|
1809
|
+
exports.getAttributeMap = getAttributeMap;
|
|
1810
|
+
exports["ɵa"] = AmplifySlotComponent;
|
|
1811
|
+
exports["ɵb"] = AuthenticatorComponent;
|
|
1812
|
+
exports["ɵc"] = ButtonComponent;
|
|
1813
|
+
exports["ɵd"] = CheckboxComponent;
|
|
1814
|
+
exports["ɵe"] = ConfirmResetPasswordComponent;
|
|
1815
|
+
exports["ɵf"] = ConfirmSignInComponent;
|
|
1816
|
+
exports["ɵg"] = ConfirmSignUpComponent;
|
|
1817
|
+
exports["ɵh"] = ConfirmVerifyUserComponent;
|
|
1818
|
+
exports["ɵi"] = ErrorComponent;
|
|
1819
|
+
exports["ɵj"] = FederatedSignInButtonComponent;
|
|
1820
|
+
exports["ɵk"] = FederatedSignInComponent;
|
|
1821
|
+
exports["ɵl"] = ForceNewPasswordComponent;
|
|
1822
|
+
exports["ɵm"] = FormFieldComponent;
|
|
1823
|
+
exports["ɵn"] = PasswordFieldComponent;
|
|
1824
|
+
exports["ɵo"] = PhoneNumberFieldComponent;
|
|
1825
|
+
exports["ɵp"] = ResetPasswordComponent;
|
|
1826
|
+
exports["ɵq"] = SelectComponent;
|
|
1827
|
+
exports["ɵr"] = SetupTotpComponent;
|
|
1828
|
+
exports["ɵs"] = SignInComponent;
|
|
1829
|
+
exports["ɵt"] = SignUpComponent;
|
|
1830
|
+
exports["ɵu"] = SignUpFormFieldsComponent;
|
|
1831
|
+
exports["ɵv"] = TabItemComponent;
|
|
1832
|
+
exports["ɵw"] = TabsComponent;
|
|
1833
|
+
exports["ɵx"] = TextFieldComponent;
|
|
1834
|
+
exports["ɵy"] = UserNameAliasComponent;
|
|
1835
|
+
exports["ɵz"] = VerifyUserComponent;
|
|
1836
|
+
|
|
1837
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1838
|
+
|
|
1839
|
+
}));
|
|
1840
|
+
//# sourceMappingURL=aws-amplify-ui-angular.umd.js.map
|