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