@anarchitects/auth-angular 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,22 +1,210 @@
1
1
  import { AnarchitectsUiForm } from '@anarchitects/forms-angular/ui';
2
2
  import * as i0 from '@angular/core';
3
- import { input, output, signal, ChangeDetectionStrategy, Component, computed } from '@angular/core';
3
+ import { input, output, computed, ChangeDetectionStrategy, Component } from '@angular/core';
4
4
 
5
- class AnarchitectsAuthUiLoginForm {
6
- layout = input(null, ...(ngDevMode ? [{ debugName: "layout" }] : []));
7
- layoutOptions = input({}, ...(ngDevMode ? [{ debugName: "layoutOptions" }] : []));
8
- submitted = output();
9
- formConfig = signal({
10
- id: 'login',
5
+ const readPayloadString = (input, key) => input.payload[key];
6
+ const readStoredString = (key) => localStorage.getItem(key) || undefined;
7
+ const matchFieldsRule = (sourceField, targetField) => ({
8
+ kind: 'matchFields',
9
+ sourceField,
10
+ targetField,
11
+ message: 'Passwords must match.',
12
+ });
13
+ const LOGIN_FORM_CONFIG = {
14
+ id: 'login',
15
+ version: 1,
16
+ fields: [
17
+ {
18
+ name: 'credential',
19
+ kind: 'string',
20
+ required: true,
21
+ minLength: 2,
22
+ maxLength: 100,
23
+ ui: { label: 'Email or Username' },
24
+ },
25
+ {
26
+ name: 'password',
27
+ kind: 'password',
28
+ required: true,
29
+ minLength: 6,
30
+ ui: { label: 'Password' },
31
+ },
32
+ ],
33
+ };
34
+ const REGISTER_FORM_CONFIG = {
35
+ id: 'register',
36
+ version: 1,
37
+ fields: [
38
+ {
39
+ name: 'userName',
40
+ kind: 'string',
41
+ ui: { label: 'Username' },
42
+ required: false,
43
+ },
44
+ { name: 'email', kind: 'email', ui: { label: 'Email' }, required: true },
45
+ {
46
+ name: 'password',
47
+ kind: 'password',
48
+ ui: { label: 'Password' },
49
+ required: true,
50
+ },
51
+ {
52
+ name: 'confirmPassword',
53
+ kind: 'password',
54
+ ui: { label: 'Confirm Password' },
55
+ required: true,
56
+ },
57
+ ],
58
+ validationRules: [matchFieldsRule('password', 'confirmPassword')],
59
+ };
60
+ const CHANGE_PASSWORD_FORM_CONFIG = {
61
+ id: 'change-password',
62
+ version: 1,
63
+ fields: [
64
+ {
65
+ name: 'currentPassword',
66
+ kind: 'password',
67
+ required: true,
68
+ minLength: 6,
69
+ ui: { label: 'Current Password' },
70
+ },
71
+ {
72
+ name: 'newPassword',
73
+ kind: 'password',
74
+ required: true,
75
+ minLength: 6,
76
+ ui: { label: 'New Password' },
77
+ },
78
+ {
79
+ name: 'confirmPassword',
80
+ kind: 'password',
81
+ required: true,
82
+ minLength: 6,
83
+ ui: { label: 'Confirm Password' },
84
+ },
85
+ ],
86
+ validationRules: [matchFieldsRule('newPassword', 'confirmPassword')],
87
+ };
88
+ const FORGOT_PASSWORD_FORM_CONFIG = {
89
+ id: 'forgot-password',
90
+ version: 1,
91
+ fields: [
92
+ {
93
+ name: 'email',
94
+ kind: 'email',
95
+ required: true,
96
+ ui: { label: 'Email' },
97
+ },
98
+ ],
99
+ };
100
+ const UPDATE_EMAIL_FORM_CONFIG = {
101
+ id: 'update-email',
102
+ version: 1,
103
+ fields: [
104
+ {
105
+ name: 'newEmail',
106
+ kind: 'email',
107
+ required: true,
108
+ ui: { label: 'New Email' },
109
+ },
110
+ {
111
+ name: 'password',
112
+ kind: 'password',
113
+ required: true,
114
+ minLength: 6,
115
+ ui: { label: 'Password' },
116
+ },
117
+ ],
118
+ };
119
+ const LOGOUT_FORM_CONFIG = {
120
+ id: 'logout',
121
+ version: 1,
122
+ fields: [
123
+ {
124
+ name: 'refreshToken',
125
+ kind: 'string',
126
+ required: false,
127
+ minLength: 1,
128
+ ui: { label: 'Refresh Token' },
129
+ },
130
+ {
131
+ name: 'accessToken',
132
+ kind: 'string',
133
+ required: false,
134
+ minLength: 1,
135
+ ui: { label: 'Access Token (optional)' },
136
+ },
137
+ ],
138
+ };
139
+ const REFRESH_TOKENS_FORM_CONFIG = {
140
+ id: 'refresh-tokens',
141
+ version: 1,
142
+ fields: [
143
+ {
144
+ name: 'refreshToken',
145
+ kind: 'string',
146
+ required: false,
147
+ minLength: 1,
148
+ ui: { label: 'Refresh Token' },
149
+ },
150
+ ],
151
+ };
152
+ const resolveToken = (input, fallbackToken) => readPayloadString(input, 'token') || fallbackToken;
153
+ const loginFormBridge = {
154
+ resolveFormConfig: () => LOGIN_FORM_CONFIG,
155
+ mapSubmission: (input) => ({
156
+ credential: readPayloadString(input, 'credential'),
157
+ password: readPayloadString(input, 'password'),
158
+ }),
159
+ };
160
+ const registerFormBridge = {
161
+ resolveFormConfig: () => REGISTER_FORM_CONFIG,
162
+ mapSubmission: (input) => ({
163
+ userName: readPayloadString(input, 'userName'),
164
+ email: readPayloadString(input, 'email'),
165
+ password: readPayloadString(input, 'password'),
166
+ confirmPassword: readPayloadString(input, 'confirmPassword'),
167
+ }),
168
+ };
169
+ const activateUserFormBridge = {
170
+ resolveFormConfig: (context) => ({
171
+ id: 'activate-user',
11
172
  version: 1,
12
173
  fields: [
13
174
  {
14
- name: 'credential',
175
+ name: 'token',
15
176
  kind: 'string',
16
- required: true,
17
- minLength: 2,
18
- maxLength: 100,
19
- ui: { label: 'Email or Username' },
177
+ required: !context?.token,
178
+ minLength: 1,
179
+ ui: { label: 'Activation Token' },
180
+ },
181
+ ],
182
+ }),
183
+ mapSubmission: (input, context) => {
184
+ const token = resolveToken(input, context?.token);
185
+ if (!token) {
186
+ return undefined;
187
+ }
188
+ return { token };
189
+ },
190
+ };
191
+ const forgotPasswordFormBridge = {
192
+ resolveFormConfig: () => FORGOT_PASSWORD_FORM_CONFIG,
193
+ mapSubmission: (input) => ({
194
+ email: readPayloadString(input, 'email'),
195
+ }),
196
+ };
197
+ const resetPasswordFormBridge = {
198
+ resolveFormConfig: (context) => ({
199
+ id: 'reset-password',
200
+ version: 1,
201
+ fields: [
202
+ {
203
+ name: 'token',
204
+ kind: 'string',
205
+ required: !context?.token,
206
+ minLength: 1,
207
+ ui: { label: 'Reset Token' },
20
208
  },
21
209
  {
22
210
  name: 'password',
@@ -25,16 +213,103 @@ class AnarchitectsAuthUiLoginForm {
25
213
  minLength: 6,
26
214
  ui: { label: 'Password' },
27
215
  },
216
+ {
217
+ name: 'confirmPassword',
218
+ kind: 'password',
219
+ required: true,
220
+ minLength: 6,
221
+ ui: { label: 'Confirm Password' },
222
+ },
223
+ ],
224
+ validationRules: [matchFieldsRule('password', 'confirmPassword')],
225
+ }),
226
+ mapSubmission: (input, context) => {
227
+ const token = resolveToken(input, context?.token);
228
+ if (!token) {
229
+ return undefined;
230
+ }
231
+ return {
232
+ token,
233
+ password: readPayloadString(input, 'password'),
234
+ confirmPassword: readPayloadString(input, 'confirmPassword'),
235
+ };
236
+ },
237
+ };
238
+ const verifyEmailFormBridge = {
239
+ resolveFormConfig: (context) => ({
240
+ id: 'verify-email',
241
+ version: 1,
242
+ fields: [
243
+ {
244
+ name: 'token',
245
+ kind: 'string',
246
+ required: !context?.token,
247
+ minLength: 1,
248
+ ui: { label: 'Verification Token' },
249
+ },
28
250
  ],
29
- }, ...(ngDevMode ? [{ debugName: "formConfig" }] : []));
251
+ }),
252
+ mapSubmission: (input, context) => {
253
+ const token = resolveToken(input, context?.token);
254
+ if (!token) {
255
+ return undefined;
256
+ }
257
+ return { token };
258
+ },
259
+ };
260
+ const changePasswordFormBridge = {
261
+ resolveFormConfig: () => CHANGE_PASSWORD_FORM_CONFIG,
262
+ mapSubmission: (input) => ({
263
+ currentPassword: readPayloadString(input, 'currentPassword'),
264
+ newPassword: readPayloadString(input, 'newPassword'),
265
+ confirmPassword: readPayloadString(input, 'confirmPassword'),
266
+ }),
267
+ };
268
+ const updateEmailFormBridge = {
269
+ resolveFormConfig: () => UPDATE_EMAIL_FORM_CONFIG,
270
+ mapSubmission: (input) => ({
271
+ newEmail: readPayloadString(input, 'newEmail'),
272
+ password: readPayloadString(input, 'password'),
273
+ }),
274
+ };
275
+ const logoutFormBridge = {
276
+ resolveFormConfig: () => LOGOUT_FORM_CONFIG,
277
+ mapSubmission: (input) => {
278
+ const refreshToken = readPayloadString(input, 'refreshToken') || readStoredString('refreshToken');
279
+ const accessToken = readPayloadString(input, 'accessToken') || readStoredString('accessToken');
280
+ if (!refreshToken) {
281
+ return undefined;
282
+ }
283
+ return {
284
+ refreshToken,
285
+ ...(accessToken ? { accessToken } : {}),
286
+ };
287
+ },
288
+ };
289
+ const refreshTokensFormBridge = {
290
+ resolveFormConfig: () => REFRESH_TOKENS_FORM_CONFIG,
291
+ mapSubmission: (input) => {
292
+ const refreshToken = readPayloadString(input, 'refreshToken') || readStoredString('refreshToken');
293
+ if (!refreshToken) {
294
+ return undefined;
295
+ }
296
+ return { refreshToken };
297
+ },
298
+ };
299
+
300
+ class AnarchitectsAuthUiLoginForm {
301
+ layout = input(null, ...(ngDevMode ? [{ debugName: "layout" }] : []));
302
+ layoutOptions = input({}, ...(ngDevMode ? [{ debugName: "layoutOptions" }] : []));
303
+ submitted = output();
304
+ formConfig = computed(() => loginFormBridge.resolveFormConfig(), ...(ngDevMode ? [{ debugName: "formConfig" }] : []));
30
305
  onSubmitted(input) {
31
- this.submitted.emit({
32
- credential: input.payload['credential'],
33
- password: input.payload['password'],
34
- });
306
+ const dto = loginFormBridge.mapSubmission(input);
307
+ if (dto) {
308
+ this.submitted.emit(dto);
309
+ }
35
310
  }
36
311
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AnarchitectsAuthUiLoginForm, deps: [], target: i0.ɵɵFactoryTarget.Component });
37
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.6", type: AnarchitectsAuthUiLoginForm, isStandalone: true, selector: "anarchitects-auth-ui-login-form", inputs: { layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, layoutOptions: { classPropertyName: "layoutOptions", publicName: "layoutOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted" }, host: { attributes: { "attr.data-anx-component": "\"auth-ui-login-form\"" }, classAttribute: "anx-domain-component anx-auth-ui-login-form anx-stack" }, ngImport: i0, template: "<anarchitects-forms-ui-form\n [config]=\"formConfig()\"\n [layout]=\"layout()\"\n [layoutOptions]=\"layoutOptions()\"\n (submitted)=\"onSubmitted($event)\"\n>\n <ng-content select=\"ng-template[anxTemplate]\"></ng-content>\n <ng-content select=\"[anxSlot]\"></ng-content>\n</anarchitects-forms-ui-form>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: AnarchitectsUiForm, selector: "anarchitects-forms-ui-form", inputs: ["config", "layout", "layoutOptions"], outputs: ["submitted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
312
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.6", type: AnarchitectsAuthUiLoginForm, isStandalone: true, selector: "anarchitects-auth-ui-login-form", inputs: { layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, layoutOptions: { classPropertyName: "layoutOptions", publicName: "layoutOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted" }, host: { attributes: { "attr.data-anx-component": "\"auth-ui-login-form\"" }, classAttribute: "anx-domain-component anx-auth-ui-login-form anx-stack" }, ngImport: i0, template: "<anarchitects-forms-ui-form\n [config]=\"formConfig()\"\n [layout]=\"layout()\"\n [layoutOptions]=\"layoutOptions()\"\n (submitted)=\"onSubmitted($event)\"\n>\n <ng-content select=\"ng-template[anxTemplate]\"></ng-content>\n <ng-content select=\"[anxSlot]\"></ng-content>\n</anarchitects-forms-ui-form>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: AnarchitectsUiForm, selector: "anarchitects-forms-ui-form", inputs: ["config", "runtimeValidators", "layout", "layoutOptions"], outputs: ["submitted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
38
313
  }
39
314
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AnarchitectsAuthUiLoginForm, decorators: [{
40
315
  type: Component,
@@ -48,41 +323,15 @@ class AnarchitectsAuthUiRegisterForm {
48
323
  layout = input(null, ...(ngDevMode ? [{ debugName: "layout" }] : []));
49
324
  layoutOptions = input({}, ...(ngDevMode ? [{ debugName: "layoutOptions" }] : []));
50
325
  submitted = output();
51
- formConfig = signal({
52
- id: 'register',
53
- version: 1,
54
- fields: [
55
- {
56
- name: 'userName',
57
- kind: 'string',
58
- ui: { label: 'Username' },
59
- required: false,
60
- },
61
- { name: 'email', kind: 'email', ui: { label: 'Email' }, required: true },
62
- {
63
- name: 'password',
64
- kind: 'password',
65
- ui: { label: 'Password' },
66
- required: true,
67
- },
68
- {
69
- name: 'confirmPassword',
70
- kind: 'password',
71
- ui: { label: 'Confirm Password' },
72
- required: true,
73
- },
74
- ],
75
- }, ...(ngDevMode ? [{ debugName: "formConfig" }] : []));
326
+ formConfig = computed(() => registerFormBridge.resolveFormConfig(), ...(ngDevMode ? [{ debugName: "formConfig" }] : []));
76
327
  onSubmitted(input) {
77
- this.submitted.emit({
78
- userName: input.payload['userName'],
79
- email: input.payload['email'],
80
- password: input.payload['password'],
81
- confirmPassword: input.payload['confirmPassword'],
82
- });
328
+ const dto = registerFormBridge.mapSubmission(input);
329
+ if (dto) {
330
+ this.submitted.emit(dto);
331
+ }
83
332
  }
84
333
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AnarchitectsAuthUiRegisterForm, deps: [], target: i0.ɵɵFactoryTarget.Component });
85
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.6", type: AnarchitectsAuthUiRegisterForm, isStandalone: true, selector: "anarchitects-auth-ui-register-form", inputs: { layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, layoutOptions: { classPropertyName: "layoutOptions", publicName: "layoutOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted" }, host: { attributes: { "attr.data-anx-component": "\"auth-ui-register-form\"" }, classAttribute: "anx-domain-component anx-auth-ui-register-form anx-stack" }, ngImport: i0, template: "<anarchitects-forms-ui-form\n [config]=\"formConfig()\"\n [layout]=\"layout()\"\n [layoutOptions]=\"layoutOptions()\"\n (submitted)=\"onSubmitted($event)\"\n>\n <ng-content select=\"ng-template[anxTemplate]\"></ng-content>\n <ng-content select=\"[anxSlot]\"></ng-content>\n</anarchitects-forms-ui-form>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: AnarchitectsUiForm, selector: "anarchitects-forms-ui-form", inputs: ["config", "layout", "layoutOptions"], outputs: ["submitted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
334
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.6", type: AnarchitectsAuthUiRegisterForm, isStandalone: true, selector: "anarchitects-auth-ui-register-form", inputs: { layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, layoutOptions: { classPropertyName: "layoutOptions", publicName: "layoutOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted" }, host: { attributes: { "attr.data-anx-component": "\"auth-ui-register-form\"" }, classAttribute: "anx-domain-component anx-auth-ui-register-form anx-stack" }, ngImport: i0, template: "<anarchitects-forms-ui-form\n [config]=\"formConfig()\"\n [layout]=\"layout()\"\n [layoutOptions]=\"layoutOptions()\"\n (submitted)=\"onSubmitted($event)\"\n>\n <ng-content select=\"ng-template[anxTemplate]\"></ng-content>\n <ng-content select=\"[anxSlot]\"></ng-content>\n</anarchitects-forms-ui-form>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: AnarchitectsUiForm, selector: "anarchitects-forms-ui-form", inputs: ["config", "runtimeValidators", "layout", "layoutOptions"], outputs: ["submitted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
86
335
  }
87
336
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AnarchitectsAuthUiRegisterForm, decorators: [{
88
337
  type: Component,
@@ -97,28 +346,17 @@ class AnarchitectsAuthUiActivateUserForm {
97
346
  layout = input(null, ...(ngDevMode ? [{ debugName: "layout" }] : []));
98
347
  layoutOptions = input({}, ...(ngDevMode ? [{ debugName: "layoutOptions" }] : []));
99
348
  submitted = output();
100
- formConfig = computed(() => ({
101
- id: 'activate-user',
102
- version: 1,
103
- fields: [
104
- {
105
- name: 'token',
106
- kind: 'string',
107
- required: !this.token(),
108
- minLength: 1,
109
- ui: { label: 'Activation Token' },
110
- },
111
- ],
112
- }), ...(ngDevMode ? [{ debugName: "formConfig" }] : []));
349
+ formConfig = computed(() => activateUserFormBridge.resolveFormConfig({ token: this.token() }), ...(ngDevMode ? [{ debugName: "formConfig" }] : []));
113
350
  onSubmitted(input) {
114
- const token = input.payload['token'] || this.token();
115
- if (!token) {
116
- return;
351
+ const dto = activateUserFormBridge.mapSubmission(input, {
352
+ token: this.token(),
353
+ });
354
+ if (dto) {
355
+ this.submitted.emit(dto);
117
356
  }
118
- this.submitted.emit({ token });
119
357
  }
120
358
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AnarchitectsAuthUiActivateUserForm, deps: [], target: i0.ɵɵFactoryTarget.Component });
121
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.6", type: AnarchitectsAuthUiActivateUserForm, isStandalone: true, selector: "anarchitects-auth-ui-activate-user-form", inputs: { token: { classPropertyName: "token", publicName: "token", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, layoutOptions: { classPropertyName: "layoutOptions", publicName: "layoutOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted" }, host: { attributes: { "attr.data-anx-component": "\"auth-ui-activate-user-form\"" }, classAttribute: "anx-domain-component anx-auth-ui-activate-user-form anx-stack" }, ngImport: i0, template: "<anarchitects-forms-ui-form\n [config]=\"formConfig()\"\n [layout]=\"layout()\"\n [layoutOptions]=\"layoutOptions()\"\n (submitted)=\"onSubmitted($event)\"\n>\n <ng-content select=\"ng-template[anxTemplate]\"></ng-content>\n <ng-content select=\"[anxSlot]\"></ng-content>\n</anarchitects-forms-ui-form>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: AnarchitectsUiForm, selector: "anarchitects-forms-ui-form", inputs: ["config", "layout", "layoutOptions"], outputs: ["submitted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
359
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.6", type: AnarchitectsAuthUiActivateUserForm, isStandalone: true, selector: "anarchitects-auth-ui-activate-user-form", inputs: { token: { classPropertyName: "token", publicName: "token", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, layoutOptions: { classPropertyName: "layoutOptions", publicName: "layoutOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted" }, host: { attributes: { "attr.data-anx-component": "\"auth-ui-activate-user-form\"" }, classAttribute: "anx-domain-component anx-auth-ui-activate-user-form anx-stack" }, ngImport: i0, template: "<anarchitects-forms-ui-form\n [config]=\"formConfig()\"\n [layout]=\"layout()\"\n [layoutOptions]=\"layoutOptions()\"\n (submitted)=\"onSubmitted($event)\"\n>\n <ng-content select=\"ng-template[anxTemplate]\"></ng-content>\n <ng-content select=\"[anxSlot]\"></ng-content>\n</anarchitects-forms-ui-form>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: AnarchitectsUiForm, selector: "anarchitects-forms-ui-form", inputs: ["config", "runtimeValidators", "layout", "layoutOptions"], outputs: ["submitted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
122
360
  }
123
361
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AnarchitectsAuthUiActivateUserForm, decorators: [{
124
362
  type: Component,
@@ -132,25 +370,15 @@ class AnarchitectsAuthUiForgotPasswordForm {
132
370
  layout = input(null, ...(ngDevMode ? [{ debugName: "layout" }] : []));
133
371
  layoutOptions = input({}, ...(ngDevMode ? [{ debugName: "layoutOptions" }] : []));
134
372
  submitted = output();
135
- formConfig = signal({
136
- id: 'forgot-password',
137
- version: 1,
138
- fields: [
139
- {
140
- name: 'email',
141
- kind: 'email',
142
- required: true,
143
- ui: { label: 'Email' },
144
- },
145
- ],
146
- }, ...(ngDevMode ? [{ debugName: "formConfig" }] : []));
373
+ formConfig = computed(() => forgotPasswordFormBridge.resolveFormConfig(), ...(ngDevMode ? [{ debugName: "formConfig" }] : []));
147
374
  onSubmitted(input) {
148
- this.submitted.emit({
149
- email: input.payload['email'],
150
- });
375
+ const dto = forgotPasswordFormBridge.mapSubmission(input);
376
+ if (dto) {
377
+ this.submitted.emit(dto);
378
+ }
151
379
  }
152
380
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AnarchitectsAuthUiForgotPasswordForm, deps: [], target: i0.ɵɵFactoryTarget.Component });
153
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.6", type: AnarchitectsAuthUiForgotPasswordForm, isStandalone: true, selector: "anarchitects-auth-ui-forgot-password-form", inputs: { layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, layoutOptions: { classPropertyName: "layoutOptions", publicName: "layoutOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted" }, host: { attributes: { "attr.data-anx-component": "\"auth-ui-forgot-password-form\"" }, classAttribute: "anx-domain-component anx-auth-ui-forgot-password-form anx-stack" }, ngImport: i0, template: "<anarchitects-forms-ui-form\n [config]=\"formConfig()\"\n [layout]=\"layout()\"\n [layoutOptions]=\"layoutOptions()\"\n (submitted)=\"onSubmitted($event)\"\n>\n <ng-content select=\"ng-template[anxTemplate]\"></ng-content>\n <ng-content select=\"[anxSlot]\"></ng-content>\n</anarchitects-forms-ui-form>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: AnarchitectsUiForm, selector: "anarchitects-forms-ui-form", inputs: ["config", "layout", "layoutOptions"], outputs: ["submitted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
381
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.6", type: AnarchitectsAuthUiForgotPasswordForm, isStandalone: true, selector: "anarchitects-auth-ui-forgot-password-form", inputs: { layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, layoutOptions: { classPropertyName: "layoutOptions", publicName: "layoutOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted" }, host: { attributes: { "attr.data-anx-component": "\"auth-ui-forgot-password-form\"" }, classAttribute: "anx-domain-component anx-auth-ui-forgot-password-form anx-stack" }, ngImport: i0, template: "<anarchitects-forms-ui-form\n [config]=\"formConfig()\"\n [layout]=\"layout()\"\n [layoutOptions]=\"layoutOptions()\"\n (submitted)=\"onSubmitted($event)\"\n>\n <ng-content select=\"ng-template[anxTemplate]\"></ng-content>\n <ng-content select=\"[anxSlot]\"></ng-content>\n</anarchitects-forms-ui-form>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: AnarchitectsUiForm, selector: "anarchitects-forms-ui-form", inputs: ["config", "runtimeValidators", "layout", "layoutOptions"], outputs: ["submitted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
154
382
  }
155
383
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AnarchitectsAuthUiForgotPasswordForm, decorators: [{
156
384
  type: Component,
@@ -165,46 +393,17 @@ class AnarchitectsAuthUiResetPasswordForm {
165
393
  layout = input(null, ...(ngDevMode ? [{ debugName: "layout" }] : []));
166
394
  layoutOptions = input({}, ...(ngDevMode ? [{ debugName: "layoutOptions" }] : []));
167
395
  submitted = output();
168
- formConfig = computed(() => ({
169
- id: 'reset-password',
170
- version: 1,
171
- fields: [
172
- {
173
- name: 'token',
174
- kind: 'string',
175
- required: !this.token(),
176
- minLength: 1,
177
- ui: { label: 'Reset Token' },
178
- },
179
- {
180
- name: 'password',
181
- kind: 'password',
182
- required: true,
183
- minLength: 6,
184
- ui: { label: 'Password' },
185
- },
186
- {
187
- name: 'confirmPassword',
188
- kind: 'password',
189
- required: true,
190
- minLength: 6,
191
- ui: { label: 'Confirm Password' },
192
- },
193
- ],
194
- }), ...(ngDevMode ? [{ debugName: "formConfig" }] : []));
396
+ formConfig = computed(() => resetPasswordFormBridge.resolveFormConfig({ token: this.token() }), ...(ngDevMode ? [{ debugName: "formConfig" }] : []));
195
397
  onSubmitted(input) {
196
- const token = input.payload['token'] || this.token();
197
- if (!token) {
198
- return;
199
- }
200
- this.submitted.emit({
201
- token,
202
- password: input.payload['password'],
203
- confirmPassword: input.payload['confirmPassword'],
398
+ const dto = resetPasswordFormBridge.mapSubmission(input, {
399
+ token: this.token(),
204
400
  });
401
+ if (dto) {
402
+ this.submitted.emit(dto);
403
+ }
205
404
  }
206
405
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AnarchitectsAuthUiResetPasswordForm, deps: [], target: i0.ɵɵFactoryTarget.Component });
207
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.6", type: AnarchitectsAuthUiResetPasswordForm, isStandalone: true, selector: "anarchitects-auth-ui-reset-password-form", inputs: { token: { classPropertyName: "token", publicName: "token", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, layoutOptions: { classPropertyName: "layoutOptions", publicName: "layoutOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted" }, host: { attributes: { "attr.data-anx-component": "\"auth-ui-reset-password-form\"" }, classAttribute: "anx-domain-component anx-auth-ui-reset-password-form anx-stack" }, ngImport: i0, template: "<anarchitects-forms-ui-form\n [config]=\"formConfig()\"\n [layout]=\"layout()\"\n [layoutOptions]=\"layoutOptions()\"\n (submitted)=\"onSubmitted($event)\"\n>\n <ng-content select=\"ng-template[anxTemplate]\"></ng-content>\n <ng-content select=\"[anxSlot]\"></ng-content>\n</anarchitects-forms-ui-form>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: AnarchitectsUiForm, selector: "anarchitects-forms-ui-form", inputs: ["config", "layout", "layoutOptions"], outputs: ["submitted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
406
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.6", type: AnarchitectsAuthUiResetPasswordForm, isStandalone: true, selector: "anarchitects-auth-ui-reset-password-form", inputs: { token: { classPropertyName: "token", publicName: "token", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, layoutOptions: { classPropertyName: "layoutOptions", publicName: "layoutOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted" }, host: { attributes: { "attr.data-anx-component": "\"auth-ui-reset-password-form\"" }, classAttribute: "anx-domain-component anx-auth-ui-reset-password-form anx-stack" }, ngImport: i0, template: "<anarchitects-forms-ui-form\n [config]=\"formConfig()\"\n [layout]=\"layout()\"\n [layoutOptions]=\"layoutOptions()\"\n (submitted)=\"onSubmitted($event)\"\n>\n <ng-content select=\"ng-template[anxTemplate]\"></ng-content>\n <ng-content select=\"[anxSlot]\"></ng-content>\n</anarchitects-forms-ui-form>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: AnarchitectsUiForm, selector: "anarchitects-forms-ui-form", inputs: ["config", "runtimeValidators", "layout", "layoutOptions"], outputs: ["submitted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
208
407
  }
209
408
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AnarchitectsAuthUiResetPasswordForm, decorators: [{
210
409
  type: Component,
@@ -219,28 +418,17 @@ class AnarchitectsAuthUiVerifyEmailForm {
219
418
  layout = input(null, ...(ngDevMode ? [{ debugName: "layout" }] : []));
220
419
  layoutOptions = input({}, ...(ngDevMode ? [{ debugName: "layoutOptions" }] : []));
221
420
  submitted = output();
222
- formConfig = computed(() => ({
223
- id: 'verify-email',
224
- version: 1,
225
- fields: [
226
- {
227
- name: 'token',
228
- kind: 'string',
229
- required: !this.token(),
230
- minLength: 1,
231
- ui: { label: 'Verification Token' },
232
- },
233
- ],
234
- }), ...(ngDevMode ? [{ debugName: "formConfig" }] : []));
421
+ formConfig = computed(() => verifyEmailFormBridge.resolveFormConfig({ token: this.token() }), ...(ngDevMode ? [{ debugName: "formConfig" }] : []));
235
422
  onSubmitted(input) {
236
- const token = input.payload['token'] || this.token();
237
- if (!token) {
238
- return;
423
+ const dto = verifyEmailFormBridge.mapSubmission(input, {
424
+ token: this.token(),
425
+ });
426
+ if (dto) {
427
+ this.submitted.emit(dto);
239
428
  }
240
- this.submitted.emit({ token });
241
429
  }
242
430
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AnarchitectsAuthUiVerifyEmailForm, deps: [], target: i0.ɵɵFactoryTarget.Component });
243
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.6", type: AnarchitectsAuthUiVerifyEmailForm, isStandalone: true, selector: "anarchitects-auth-ui-verify-email-form", inputs: { token: { classPropertyName: "token", publicName: "token", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, layoutOptions: { classPropertyName: "layoutOptions", publicName: "layoutOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted" }, host: { attributes: { "attr.data-anx-component": "\"auth-ui-verify-email-form\"" }, classAttribute: "anx-domain-component anx-auth-ui-verify-email-form anx-stack" }, ngImport: i0, template: "<anarchitects-forms-ui-form\n [config]=\"formConfig()\"\n [layout]=\"layout()\"\n [layoutOptions]=\"layoutOptions()\"\n (submitted)=\"onSubmitted($event)\"\n>\n <ng-content select=\"ng-template[anxTemplate]\"></ng-content>\n <ng-content select=\"[anxSlot]\"></ng-content>\n</anarchitects-forms-ui-form>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: AnarchitectsUiForm, selector: "anarchitects-forms-ui-form", inputs: ["config", "layout", "layoutOptions"], outputs: ["submitted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
431
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.6", type: AnarchitectsAuthUiVerifyEmailForm, isStandalone: true, selector: "anarchitects-auth-ui-verify-email-form", inputs: { token: { classPropertyName: "token", publicName: "token", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, layoutOptions: { classPropertyName: "layoutOptions", publicName: "layoutOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted" }, host: { attributes: { "attr.data-anx-component": "\"auth-ui-verify-email-form\"" }, classAttribute: "anx-domain-component anx-auth-ui-verify-email-form anx-stack" }, ngImport: i0, template: "<anarchitects-forms-ui-form\n [config]=\"formConfig()\"\n [layout]=\"layout()\"\n [layoutOptions]=\"layoutOptions()\"\n (submitted)=\"onSubmitted($event)\"\n>\n <ng-content select=\"ng-template[anxTemplate]\"></ng-content>\n <ng-content select=\"[anxSlot]\"></ng-content>\n</anarchitects-forms-ui-form>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: AnarchitectsUiForm, selector: "anarchitects-forms-ui-form", inputs: ["config", "runtimeValidators", "layout", "layoutOptions"], outputs: ["submitted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
244
432
  }
245
433
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AnarchitectsAuthUiVerifyEmailForm, decorators: [{
246
434
  type: Component,
@@ -254,42 +442,15 @@ class AnarchitectsAuthUiChangePasswordForm {
254
442
  layout = input(null, ...(ngDevMode ? [{ debugName: "layout" }] : []));
255
443
  layoutOptions = input({}, ...(ngDevMode ? [{ debugName: "layoutOptions" }] : []));
256
444
  submitted = output();
257
- formConfig = signal({
258
- id: 'change-password',
259
- version: 1,
260
- fields: [
261
- {
262
- name: 'currentPassword',
263
- kind: 'password',
264
- required: true,
265
- minLength: 6,
266
- ui: { label: 'Current Password' },
267
- },
268
- {
269
- name: 'newPassword',
270
- kind: 'password',
271
- required: true,
272
- minLength: 6,
273
- ui: { label: 'New Password' },
274
- },
275
- {
276
- name: 'confirmPassword',
277
- kind: 'password',
278
- required: true,
279
- minLength: 6,
280
- ui: { label: 'Confirm Password' },
281
- },
282
- ],
283
- }, ...(ngDevMode ? [{ debugName: "formConfig" }] : []));
445
+ formConfig = computed(() => changePasswordFormBridge.resolveFormConfig(), ...(ngDevMode ? [{ debugName: "formConfig" }] : []));
284
446
  onSubmitted(input) {
285
- this.submitted.emit({
286
- currentPassword: input.payload['currentPassword'],
287
- newPassword: input.payload['newPassword'],
288
- confirmPassword: input.payload['confirmPassword'],
289
- });
447
+ const dto = changePasswordFormBridge.mapSubmission(input);
448
+ if (dto) {
449
+ this.submitted.emit(dto);
450
+ }
290
451
  }
291
452
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AnarchitectsAuthUiChangePasswordForm, deps: [], target: i0.ɵɵFactoryTarget.Component });
292
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.6", type: AnarchitectsAuthUiChangePasswordForm, isStandalone: true, selector: "anarchitects-auth-ui-change-password-form", inputs: { layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, layoutOptions: { classPropertyName: "layoutOptions", publicName: "layoutOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted" }, host: { attributes: { "attr.data-anx-component": "\"auth-ui-change-password-form\"" }, classAttribute: "anx-domain-component anx-auth-ui-change-password-form anx-stack" }, ngImport: i0, template: "<anarchitects-forms-ui-form\n [config]=\"formConfig()\"\n [layout]=\"layout()\"\n [layoutOptions]=\"layoutOptions()\"\n (submitted)=\"onSubmitted($event)\"\n>\n <ng-content select=\"ng-template[anxTemplate]\"></ng-content>\n <ng-content select=\"[anxSlot]\"></ng-content>\n</anarchitects-forms-ui-form>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: AnarchitectsUiForm, selector: "anarchitects-forms-ui-form", inputs: ["config", "layout", "layoutOptions"], outputs: ["submitted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
453
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.6", type: AnarchitectsAuthUiChangePasswordForm, isStandalone: true, selector: "anarchitects-auth-ui-change-password-form", inputs: { layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, layoutOptions: { classPropertyName: "layoutOptions", publicName: "layoutOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted" }, host: { attributes: { "attr.data-anx-component": "\"auth-ui-change-password-form\"" }, classAttribute: "anx-domain-component anx-auth-ui-change-password-form anx-stack" }, ngImport: i0, template: "<anarchitects-forms-ui-form\n [config]=\"formConfig()\"\n [layout]=\"layout()\"\n [layoutOptions]=\"layoutOptions()\"\n (submitted)=\"onSubmitted($event)\"\n>\n <ng-content select=\"ng-template[anxTemplate]\"></ng-content>\n <ng-content select=\"[anxSlot]\"></ng-content>\n</anarchitects-forms-ui-form>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: AnarchitectsUiForm, selector: "anarchitects-forms-ui-form", inputs: ["config", "runtimeValidators", "layout", "layoutOptions"], outputs: ["submitted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
293
454
  }
294
455
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AnarchitectsAuthUiChangePasswordForm, decorators: [{
295
456
  type: Component,
@@ -303,33 +464,15 @@ class AnarchitectsAuthUiUpdateEmailForm {
303
464
  layout = input(null, ...(ngDevMode ? [{ debugName: "layout" }] : []));
304
465
  layoutOptions = input({}, ...(ngDevMode ? [{ debugName: "layoutOptions" }] : []));
305
466
  submitted = output();
306
- formConfig = signal({
307
- id: 'update-email',
308
- version: 1,
309
- fields: [
310
- {
311
- name: 'newEmail',
312
- kind: 'email',
313
- required: true,
314
- ui: { label: 'New Email' },
315
- },
316
- {
317
- name: 'password',
318
- kind: 'password',
319
- required: true,
320
- minLength: 6,
321
- ui: { label: 'Password' },
322
- },
323
- ],
324
- }, ...(ngDevMode ? [{ debugName: "formConfig" }] : []));
467
+ formConfig = computed(() => updateEmailFormBridge.resolveFormConfig(), ...(ngDevMode ? [{ debugName: "formConfig" }] : []));
325
468
  onSubmitted(input) {
326
- this.submitted.emit({
327
- newEmail: input.payload['newEmail'],
328
- password: input.payload['password'],
329
- });
469
+ const dto = updateEmailFormBridge.mapSubmission(input);
470
+ if (dto) {
471
+ this.submitted.emit(dto);
472
+ }
330
473
  }
331
474
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AnarchitectsAuthUiUpdateEmailForm, deps: [], target: i0.ɵɵFactoryTarget.Component });
332
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.6", type: AnarchitectsAuthUiUpdateEmailForm, isStandalone: true, selector: "anarchitects-auth-ui-update-email-form", inputs: { layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, layoutOptions: { classPropertyName: "layoutOptions", publicName: "layoutOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted" }, host: { attributes: { "attr.data-anx-component": "\"auth-ui-update-email-form\"" }, classAttribute: "anx-domain-component anx-auth-ui-update-email-form anx-stack" }, ngImport: i0, template: "<anarchitects-forms-ui-form\n [config]=\"formConfig()\"\n [layout]=\"layout()\"\n [layoutOptions]=\"layoutOptions()\"\n (submitted)=\"onSubmitted($event)\"\n>\n <ng-content select=\"ng-template[anxTemplate]\"></ng-content>\n <ng-content select=\"[anxSlot]\"></ng-content>\n</anarchitects-forms-ui-form>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: AnarchitectsUiForm, selector: "anarchitects-forms-ui-form", inputs: ["config", "layout", "layoutOptions"], outputs: ["submitted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
475
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.6", type: AnarchitectsAuthUiUpdateEmailForm, isStandalone: true, selector: "anarchitects-auth-ui-update-email-form", inputs: { layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, layoutOptions: { classPropertyName: "layoutOptions", publicName: "layoutOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted" }, host: { attributes: { "attr.data-anx-component": "\"auth-ui-update-email-form\"" }, classAttribute: "anx-domain-component anx-auth-ui-update-email-form anx-stack" }, ngImport: i0, template: "<anarchitects-forms-ui-form\n [config]=\"formConfig()\"\n [layout]=\"layout()\"\n [layoutOptions]=\"layoutOptions()\"\n (submitted)=\"onSubmitted($event)\"\n>\n <ng-content select=\"ng-template[anxTemplate]\"></ng-content>\n <ng-content select=\"[anxSlot]\"></ng-content>\n</anarchitects-forms-ui-form>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: AnarchitectsUiForm, selector: "anarchitects-forms-ui-form", inputs: ["config", "runtimeValidators", "layout", "layoutOptions"], outputs: ["submitted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
333
476
  }
334
477
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AnarchitectsAuthUiUpdateEmailForm, decorators: [{
335
478
  type: Component,
@@ -343,43 +486,15 @@ class AnarchitectsAuthUiLogoutForm {
343
486
  layout = input(null, ...(ngDevMode ? [{ debugName: "layout" }] : []));
344
487
  layoutOptions = input({}, ...(ngDevMode ? [{ debugName: "layoutOptions" }] : []));
345
488
  submitted = output();
346
- formConfig = signal({
347
- id: 'logout',
348
- version: 1,
349
- fields: [
350
- {
351
- name: 'refreshToken',
352
- kind: 'string',
353
- required: false,
354
- minLength: 1,
355
- ui: { label: 'Refresh Token' },
356
- },
357
- {
358
- name: 'accessToken',
359
- kind: 'string',
360
- required: false,
361
- minLength: 1,
362
- ui: { label: 'Access Token (optional)' },
363
- },
364
- ],
365
- }, ...(ngDevMode ? [{ debugName: "formConfig" }] : []));
489
+ formConfig = computed(() => logoutFormBridge.resolveFormConfig(), ...(ngDevMode ? [{ debugName: "formConfig" }] : []));
366
490
  onSubmitted(input) {
367
- const refreshToken = input.payload['refreshToken'] ||
368
- localStorage.getItem('refreshToken') ||
369
- undefined;
370
- const accessToken = input.payload['accessToken'] ||
371
- localStorage.getItem('accessToken') ||
372
- undefined;
373
- if (!refreshToken) {
374
- return;
491
+ const dto = logoutFormBridge.mapSubmission(input);
492
+ if (dto) {
493
+ this.submitted.emit(dto);
375
494
  }
376
- this.submitted.emit({
377
- refreshToken,
378
- ...(accessToken ? { accessToken } : {}),
379
- });
380
495
  }
381
496
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AnarchitectsAuthUiLogoutForm, deps: [], target: i0.ɵɵFactoryTarget.Component });
382
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.6", type: AnarchitectsAuthUiLogoutForm, isStandalone: true, selector: "anarchitects-auth-ui-logout-form", inputs: { layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, layoutOptions: { classPropertyName: "layoutOptions", publicName: "layoutOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted" }, host: { attributes: { "attr.data-anx-component": "\"auth-ui-logout-form\"" }, classAttribute: "anx-domain-component anx-auth-ui-logout-form anx-stack" }, ngImport: i0, template: "<anarchitects-forms-ui-form\n [config]=\"formConfig()\"\n [layout]=\"layout()\"\n [layoutOptions]=\"layoutOptions()\"\n (submitted)=\"onSubmitted($event)\"\n>\n <ng-content select=\"ng-template[anxTemplate]\"></ng-content>\n <ng-content select=\"[anxSlot]\"></ng-content>\n</anarchitects-forms-ui-form>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: AnarchitectsUiForm, selector: "anarchitects-forms-ui-form", inputs: ["config", "layout", "layoutOptions"], outputs: ["submitted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
497
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.6", type: AnarchitectsAuthUiLogoutForm, isStandalone: true, selector: "anarchitects-auth-ui-logout-form", inputs: { layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, layoutOptions: { classPropertyName: "layoutOptions", publicName: "layoutOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted" }, host: { attributes: { "attr.data-anx-component": "\"auth-ui-logout-form\"" }, classAttribute: "anx-domain-component anx-auth-ui-logout-form anx-stack" }, ngImport: i0, template: "<anarchitects-forms-ui-form\n [config]=\"formConfig()\"\n [layout]=\"layout()\"\n [layoutOptions]=\"layoutOptions()\"\n (submitted)=\"onSubmitted($event)\"\n>\n <ng-content select=\"ng-template[anxTemplate]\"></ng-content>\n <ng-content select=\"[anxSlot]\"></ng-content>\n</anarchitects-forms-ui-form>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: AnarchitectsUiForm, selector: "anarchitects-forms-ui-form", inputs: ["config", "runtimeValidators", "layout", "layoutOptions"], outputs: ["submitted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
383
498
  }
384
499
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AnarchitectsAuthUiLogoutForm, decorators: [{
385
500
  type: Component,
@@ -393,30 +508,15 @@ class AnarchitectsAuthUiRefreshTokensForm {
393
508
  layout = input(null, ...(ngDevMode ? [{ debugName: "layout" }] : []));
394
509
  layoutOptions = input({}, ...(ngDevMode ? [{ debugName: "layoutOptions" }] : []));
395
510
  submitted = output();
396
- formConfig = signal({
397
- id: 'refresh-tokens',
398
- version: 1,
399
- fields: [
400
- {
401
- name: 'refreshToken',
402
- kind: 'string',
403
- required: false,
404
- minLength: 1,
405
- ui: { label: 'Refresh Token' },
406
- },
407
- ],
408
- }, ...(ngDevMode ? [{ debugName: "formConfig" }] : []));
511
+ formConfig = computed(() => refreshTokensFormBridge.resolveFormConfig(), ...(ngDevMode ? [{ debugName: "formConfig" }] : []));
409
512
  onSubmitted(input) {
410
- const refreshToken = input.payload['refreshToken'] ||
411
- localStorage.getItem('refreshToken') ||
412
- undefined;
413
- if (!refreshToken) {
414
- return;
513
+ const dto = refreshTokensFormBridge.mapSubmission(input);
514
+ if (dto) {
515
+ this.submitted.emit(dto);
415
516
  }
416
- this.submitted.emit({ refreshToken });
417
517
  }
418
518
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AnarchitectsAuthUiRefreshTokensForm, deps: [], target: i0.ɵɵFactoryTarget.Component });
419
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.6", type: AnarchitectsAuthUiRefreshTokensForm, isStandalone: true, selector: "anarchitects-auth-ui-refresh-tokens-form", inputs: { layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, layoutOptions: { classPropertyName: "layoutOptions", publicName: "layoutOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted" }, host: { attributes: { "attr.data-anx-component": "\"auth-ui-refresh-tokens-form\"" }, classAttribute: "anx-domain-component anx-auth-ui-refresh-tokens-form anx-stack" }, ngImport: i0, template: "<anarchitects-forms-ui-form\n [config]=\"formConfig()\"\n [layout]=\"layout()\"\n [layoutOptions]=\"layoutOptions()\"\n (submitted)=\"onSubmitted($event)\"\n>\n <ng-content select=\"ng-template[anxTemplate]\"></ng-content>\n <ng-content select=\"[anxSlot]\"></ng-content>\n</anarchitects-forms-ui-form>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: AnarchitectsUiForm, selector: "anarchitects-forms-ui-form", inputs: ["config", "layout", "layoutOptions"], outputs: ["submitted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
519
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.6", type: AnarchitectsAuthUiRefreshTokensForm, isStandalone: true, selector: "anarchitects-auth-ui-refresh-tokens-form", inputs: { layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, layoutOptions: { classPropertyName: "layoutOptions", publicName: "layoutOptions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted" }, host: { attributes: { "attr.data-anx-component": "\"auth-ui-refresh-tokens-form\"" }, classAttribute: "anx-domain-component anx-auth-ui-refresh-tokens-form anx-stack" }, ngImport: i0, template: "<anarchitects-forms-ui-form\n [config]=\"formConfig()\"\n [layout]=\"layout()\"\n [layoutOptions]=\"layoutOptions()\"\n (submitted)=\"onSubmitted($event)\"\n>\n <ng-content select=\"ng-template[anxTemplate]\"></ng-content>\n <ng-content select=\"[anxSlot]\"></ng-content>\n</anarchitects-forms-ui-form>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: AnarchitectsUiForm, selector: "anarchitects-forms-ui-form", inputs: ["config", "runtimeValidators", "layout", "layoutOptions"], outputs: ["submitted"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
420
520
  }
421
521
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: AnarchitectsAuthUiRefreshTokensForm, decorators: [{
422
522
  type: Component,