@arsedizioni/ars-utils 22.5.16 → 22.5.17

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,7 +1,8 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { ElementRef } from '@angular/core';
3
- import { ControlValueAccessor, Validator, AbstractControl, ValidationErrors, NgForm } from '@angular/forms';
3
+ import { ControlValueAccessor, Validator, AbstractControl, ValidationErrors } from '@angular/forms';
4
4
  import { PasswordStrength } from '@arsedizioni/ars-utils/core';
5
+ import * as _angular_forms_signals from '@angular/forms/signals';
5
6
  import { CredentialsDialogResult, ResetPasswordDialogResult, RecoverPasswordDialogResult, PromptOtpDialogResult, PromptDialogData } from '@arsedizioni/ars-utils/ui';
6
7
  import { MatFormFieldAppearance } from '@angular/material/form-field';
7
8
 
@@ -129,8 +130,15 @@ declare class CredentialsDialogComponent {
129
130
  readonly recoveringPassword: _angular_core.OutputEmitterRef<CredentialsDialogResult>;
130
131
  /** Dialog configuration with defaults applied at construction time. */
131
132
  protected readonly dialogData: _angular_core.WritableSignal<CredentialsDialogData>;
132
- /** Current form model, pre-filled with the user name from dialog data when provided. */
133
- protected item: CredentialsDialogResult;
133
+ /** Model backing the signal form, pre-filled with the user name from dialog data when provided. */
134
+ private readonly model;
135
+ /**
136
+ * Signal form for the credentials. Validators follow the active mode: the user
137
+ * field is a required email in `email` mode and plain required in `user` mode,
138
+ * the password is required outside `otp` mode, and the OTP code is a required
139
+ * complete 6-digit code in `otp` mode.
140
+ */
141
+ protected readonly form: _angular_forms_signals.FieldTree<CredentialsDialogResult, string | number, "writable">;
134
142
  /** Whether the password field is currently shown as plain text. */
135
143
  protected readonly showPassword: _angular_core.WritableSignal<boolean>;
136
144
  /**
@@ -167,8 +175,16 @@ declare class ResetPasswordDialogComponent {
167
175
  private readonly dialogRef;
168
176
  /** Dialog configuration with defaults applied at construction time. */
169
177
  protected readonly dialogData: _angular_core.WritableSignal<ResetPasswordDialogData>;
170
- /** Current form model bound to the template inputs. */
171
- protected item: ResetPasswordDialogResult;
178
+ /** Model backing the signal form. */
179
+ private readonly model;
180
+ /**
181
+ * Signal form for the password reset. Validators follow the active mode:
182
+ * the email is required in `forgot` mode, the old password in `old` mode,
183
+ * a complete 6-digit OTP code in `otp` mode; the new password is always
184
+ * required, at least 10 characters and strong enough, and its confirmation
185
+ * (required outside `admin` mode) must match it.
186
+ */
187
+ protected readonly form: _angular_forms_signals.FieldTree<ResetPasswordDialogResult, string | number, "writable">;
172
188
  /** Whether the old-password field is currently shown as plain text. */
173
189
  protected readonly showOldPassword: _angular_core.WritableSignal<boolean>;
174
190
  /** Whether the new-password field is currently shown as plain text. */
@@ -196,8 +212,12 @@ declare class RecoverPasswordDialogComponent {
196
212
  readonly done: _angular_core.OutputEmitterRef<RecoverPasswordDialogResult>;
197
213
  /** Dialog configuration with defaults applied at construction time. */
198
214
  protected readonly dialogData: _angular_core.WritableSignal<RecoverPasswordDialogData>;
199
- /** Current form model bound to the template inputs. */
200
- protected item: RecoverPasswordDialogResult;
215
+ /** Model backing the signal form. */
216
+ private readonly model;
217
+ /**
218
+ * Signal form for the recovery request: the email is required and must be valid.
219
+ */
220
+ protected readonly form: _angular_forms_signals.FieldTree<RecoverPasswordDialogResult, string | number, "writable">;
201
221
  /**
202
222
  * Emits the current form result to trigger the password-recovery flow.
203
223
  */
@@ -207,11 +227,19 @@ declare class RecoverPasswordDialogComponent {
207
227
  }
208
228
 
209
229
  declare class PromptOtpDialogComponent {
210
- readonly f: _angular_core.Signal<NgForm>;
211
230
  readonly done: _angular_core.OutputEmitterRef<PromptOtpDialogResult>;
212
231
  private readonly dialogService;
213
232
  protected readonly dialogData: _angular_core.WritableSignal<PromptDialogData>;
214
- protected value: any;
233
+ /** Model backing the signal form. `value` holds the 6-digit OTP code. */
234
+ private readonly model;
235
+ /**
236
+ * Signal form for the OTP code. The code is always required here; the
237
+ * "complete 6 digits" rule comes from the OtpInputComponent validator,
238
+ * honoured through the ControlValueAccessor interop.
239
+ */
240
+ protected readonly form: _angular_forms_signals.FieldTree<{
241
+ value: string;
242
+ }, string | number, "writable">;
215
243
  /**
216
244
  * Validates the form and emits the OTP result, or shows an error if validation fails.
217
245
  */
@@ -1,9 +1,10 @@
1
- import * as _angular_core from '@angular/core';
1
+ import * as i0 from '@angular/core';
2
2
  import { ComponentType } from '@angular/cdk/portal';
3
3
  import { MatDialogConfig, MatDialogRef } from '@angular/material/dialog';
4
4
  import { MatSnackBarRef } from '@angular/material/snack-bar';
5
5
  import { ShellService } from '@arsedizioni/ars-utils/ui.shell';
6
6
  import { DialogResult, DialogOption } from '@arsedizioni/ars-utils/ui';
7
+ import * as _angular_forms_signals from '@angular/forms/signals';
7
8
  import { MatFormFieldAppearance } from '@angular/material/form-field';
8
9
 
9
10
  interface ConfirmDialogOption extends DialogOption {
@@ -19,10 +20,10 @@ interface ConfirmDialogData {
19
20
  }
20
21
  declare class ConfirmDialogComponent {
21
22
  /** Emitted when the user makes a choice. Carries the selected result and any option state. */
22
- readonly choosen: _angular_core.OutputEmitterRef<DialogResult>;
23
+ readonly choosen: i0.OutputEmitterRef<DialogResult>;
23
24
  private readonly dialogRef;
24
25
  /** Dialog configuration, with sensible defaults applied at construction time. */
25
- protected readonly dialogData: _angular_core.WritableSignal<ConfirmDialogData>;
26
+ protected readonly dialogData: i0.WritableSignal<ConfirmDialogData>;
26
27
  constructor();
27
28
  /**
28
29
  * Confirms the dialog, emitting `'ok'` together with the current option selections.
@@ -36,8 +37,8 @@ declare class ConfirmDialogComponent {
36
37
  * Triggers the tertiary action, emitting `'other'`.
37
38
  */
38
39
  other(): void;
39
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ConfirmDialogComponent, never>;
40
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ConfirmDialogComponent, "ng-component", never, {}, { "choosen": "choosen"; }, never, never, true, never>;
40
+ static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmDialogComponent, never>;
41
+ static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmDialogComponent, "ng-component", never, {}, { "choosen": "choosen"; }, never, never, true, never>;
41
42
  }
42
43
 
43
44
  declare enum DeleteDialogConfirmMode {
@@ -56,17 +57,24 @@ interface DeleteDialogData {
56
57
  }
57
58
  declare class DeleteDialogComponent {
58
59
  /** Emitted when the user makes a choice. Carries the selected result. */
59
- readonly choosen: _angular_core.OutputEmitterRef<DialogResult>;
60
+ readonly choosen: i0.OutputEmitterRef<DialogResult>;
60
61
  private readonly dialogRef;
61
62
  /** Dialog configuration with defaults applied at construction time. */
62
- protected readonly dialogData: _angular_core.WritableSignal<DeleteDialogData>;
63
+ protected readonly dialogData: i0.WritableSignal<DeleteDialogData>;
63
64
  /**
64
- * Whether the user has confirmed the deletion.
65
- * Starts as `true` for all modes except `Simple`, which requires explicit checkbox confirmation.
65
+ * Model backing the signal form: `confirmed` starts as `true` for all modes
66
+ * except `Simple`, which requires explicit checkbox confirmation, and
67
+ * `confirmValue` is the strong-confirmation text.
66
68
  */
67
- protected readonly confirmed: _angular_core.WritableSignal<boolean>;
68
- /** Current value typed into the strong-confirmation text field. */
69
- protected confirmValue?: string;
69
+ private readonly model;
70
+ /**
71
+ * Signal form for the confirmation. In `Simple` mode the checkbox must be
72
+ * checked; in `Strong` mode the text must be exactly the word "elimina".
73
+ */
74
+ protected readonly form: _angular_forms_signals.FieldTree<{
75
+ confirmed: boolean;
76
+ confirmValue: string;
77
+ }, string | number, "writable">;
70
78
  /**
71
79
  * Confirms the deletion, emitting `'ok'` and closing the dialog.
72
80
  */
@@ -75,8 +83,8 @@ declare class DeleteDialogComponent {
75
83
  * Cancels the operation, emitting `'cancel'` and closing the dialog.
76
84
  */
77
85
  cancel(): void;
78
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<DeleteDialogComponent, never>;
79
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DeleteDialogComponent, "ng-component", never, {}, { "choosen": "choosen"; }, never, never, true, never>;
86
+ static ɵfac: i0.ɵɵFactoryDeclaration<DeleteDialogComponent, never>;
87
+ static ɵcmp: i0.ɵɵComponentDeclaration<DeleteDialogComponent, "ng-component", never, {}, { "choosen": "choosen"; }, never, never, true, never>;
80
88
  }
81
89
 
82
90
  interface ToastData {
@@ -86,15 +94,15 @@ interface ToastData {
86
94
  }
87
95
  declare class ToastComponent {
88
96
  /** Emitted when the user clicks the optional action button. */
89
- readonly action: _angular_core.OutputEmitterRef<void>;
97
+ readonly action: i0.OutputEmitterRef<void>;
90
98
  /** Snack-bar payload with a safe fallback to an empty message when no data is injected. */
91
- protected readonly dialogData: _angular_core.WritableSignal<ToastData>;
99
+ protected readonly dialogData: i0.WritableSignal<ToastData>;
92
100
  /**
93
101
  * Emits the `action` event to notify the caller that the action button was clicked.
94
102
  */
95
103
  protected do(): void;
96
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ToastComponent, never>;
97
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ToastComponent, "ng-component", never, {}, { "action": "action"; }, never, never, true, never>;
104
+ static ɵfac: i0.ɵɵFactoryDeclaration<ToastComponent, never>;
105
+ static ɵcmp: i0.ɵɵComponentDeclaration<ToastComponent, "ng-component", never, {}, { "action": "action"; }, never, never, true, never>;
98
106
  }
99
107
 
100
108
  interface IDialogService {
@@ -110,7 +118,7 @@ declare class DialogService extends ShellService {
110
118
  * which knows nothing about Material and must not, so the two members every caller uses of
111
119
  * `UIService` are re-exposed here.
112
120
  */
113
- readonly appearance: _angular_core.WritableSignal<"fill" | "outline">;
121
+ readonly appearance: i0.WritableSignal<"fill" | "outline">;
114
122
  /**
115
123
  * Updates the global form-field appearance.
116
124
  * @param value - The new appearance value. Falls back to `'fill'` when `undefined` is passed.
@@ -220,8 +228,8 @@ declare class DialogService extends ShellService {
220
228
  * @returns The dialog reference, or `null` outside the browser.
221
229
  */
222
230
  delete(message: string, title?: string, confirmMode?: DeleteDialogConfirmMode, okCaption?: string, cancelCaption?: string, width?: number, details?: string): MatDialogRef<DeleteDialogComponent> | null;
223
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<DialogService, never>;
224
- static ɵprov: _angular_core.ɵɵInjectableDeclaration<DialogService>;
231
+ static ɵfac: i0.ɵɵFactoryDeclaration<DialogService, never>;
232
+ static ɵprov: i0.ɵɵInjectableDeclaration<DialogService>;
225
233
  }
226
234
 
227
235
  export { ConfirmDialogComponent, DeleteDialogComponent, DeleteDialogConfirmMode, DialogService, ToastComponent };
@@ -1,13 +1,20 @@
1
+ import * as _angular_forms_signals from '@angular/forms/signals';
1
2
  import * as _angular_core from '@angular/core';
2
3
  import { PromptDialogResult, PromptDialogData, PromptDateDialogResult, PromptTimeDialogData } from '@arsedizioni/ars-utils/ui';
3
- import { NgForm } from '@angular/forms';
4
4
 
5
5
  declare class PromptDialogComponent {
6
- readonly f: _angular_core.Signal<NgForm>;
7
6
  readonly done: _angular_core.OutputEmitterRef<PromptDialogResult>;
8
7
  private readonly dialogService;
9
8
  protected readonly dialogData: _angular_core.WritableSignal<PromptDialogData>;
10
- protected value: any;
9
+ /** Model backing the signal form. `value` type depends on the prompt type. */
10
+ private readonly model;
11
+ /**
12
+ * Signal form for the prompt value. Validators mirror the previous template-driven
13
+ * form: `required` follows the dialog data, `min`/`max` apply to the Number type.
14
+ */
15
+ protected readonly form: _angular_forms_signals.FieldTree<{
16
+ value: any;
17
+ }, string | number, "writable">;
11
18
  /**
12
19
  * Validates the form and emits the result, or shows an error if validation fails.
13
20
  */
@@ -17,11 +24,46 @@ declare class PromptDialogComponent {
17
24
  }
18
25
 
19
26
  declare class PromptDateDialogComponent {
20
- readonly f: _angular_core.Signal<NgForm>;
21
27
  readonly done: _angular_core.OutputEmitterRef<PromptDateDialogResult>;
22
28
  private readonly dialogService;
23
29
  protected readonly dialogData: _angular_core.WritableSignal<PromptDialogData>;
24
- protected value: any;
30
+ /**
31
+ * Model backing the signal form: `date` serves the single-date type, while
32
+ * `from`/`to` serve the date-interval type. Empty values are `null` (not
33
+ * `undefined`) because signal forms only build child fields for keys whose
34
+ * value is defined, and Material's datepicker accessors report an empty
35
+ * input as `null` anyway; values are normalized to `undefined` on emit.
36
+ */
37
+ private readonly model;
38
+ /**
39
+ * Signal form for the date value(s). `required` follows the dialog data and only
40
+ * applies to the fields of the active prompt type; the datepicker's own parse
41
+ * validators are picked up through the ControlValueAccessor interop.
42
+ */
43
+ protected readonly form: _angular_forms_signals.FieldTree<{
44
+ date: Date | null;
45
+ from: Date | null;
46
+ to: Date | null;
47
+ }, string | number, "writable">;
48
+ /** Debounced stream of keyup events on the interval inputs (shorthand typing support). */
49
+ private readonly intervalKeyup;
50
+ constructor();
51
+ /**
52
+ * Blocks the space key on the interval inputs; it is reserved as the
53
+ * "copy the other bound" shortcut handled by onIntervalKeyup.
54
+ * @param event - The keydown event from the start or end date input.
55
+ */
56
+ protected onIntervalKeydown(event: KeyboardEvent): void;
57
+ /**
58
+ * Forwards keyup events of the interval inputs to the debounced shorthand parser.
59
+ * @param event - The keyup event from the start or end date input.
60
+ * @param end - `true` when the event comes from the end-date input.
61
+ */
62
+ protected onIntervalKeyup(event: KeyboardEvent, end: boolean): void;
63
+ /**
64
+ * Clears both bounds of the date interval.
65
+ */
66
+ protected clearInterval(): void;
25
67
  /**
26
68
  * Validates the form and emits the result, or shows an error if validation fails.
27
69
  */
@@ -31,11 +73,18 @@ declare class PromptDateDialogComponent {
31
73
  }
32
74
 
33
75
  declare class PromptTimeDialogComponent {
34
- readonly f: _angular_core.Signal<NgForm>;
35
76
  readonly done: _angular_core.OutputEmitterRef<PromptDialogResult>;
36
77
  private readonly dialogService;
37
78
  protected readonly dialogData: _angular_core.WritableSignal<PromptTimeDialogData>;
38
- protected value: any;
79
+ /** Model backing the signal form. The value is a `"HH:MM"` time string. */
80
+ private readonly model;
81
+ /**
82
+ * Signal form for the time value: `required` follows the dialog data and the
83
+ * time validator enforces format and the optional allowed slots.
84
+ */
85
+ protected readonly form: _angular_forms_signals.FieldTree<{
86
+ value: string;
87
+ }, string | number, "writable">;
39
88
  /**
40
89
  * Validates the form and emits the result, or shows an error if validation fails.
41
90
  */
@@ -1,3 +1,4 @@
1
+ import * as _angular_forms_signals from '@angular/forms/signals';
1
2
  import * as _angular_core from '@angular/core';
2
3
  import { OnDestroy } from '@angular/core';
3
4
  import { MatCheckboxChange } from '@angular/material/checkbox';
@@ -31,7 +32,9 @@ declare class SelectDialogComponent {
31
32
  protected canPaginate: _angular_core.WritableSignal<boolean>;
32
33
  protected okDisabled: _angular_core.WritableSignal<boolean>;
33
34
  protected filterMetadata: SearchFilterMetadata;
34
- protected filterText: string;
35
+ protected readonly filterText: _angular_core.WritableSignal<string>;
36
+ /** Root signal form bound to the filter text input. */
37
+ protected readonly filterForm: _angular_forms_signals.FieldTree<string, string | number, "writable">;
35
38
  protected readonly filterOptions: _angular_core.WritableSignal<SelectableFilter[]>;
36
39
  protected filterOptionsInfo: _angular_core.WritableSignal<string>;
37
40
  protected lookupField: string;
@@ -190,6 +193,8 @@ declare class SelectTreeDialogComponent {
190
193
  protected readonly currentNode: _angular_core.WritableSignal<ItemNode>;
191
194
  /** Current filter text. */
192
195
  protected readonly filterText: _angular_core.WritableSignal<string>;
196
+ /** Root signal form bound to the filter text input. */
197
+ protected readonly filterForm: _angular_forms_signals.FieldTree<string, string | number, "writable">;
193
198
  /** Nodes matching the current filter text. */
194
199
  protected readonly filteredItems: _angular_core.WritableSignal<ItemNode[]>;
195
200
  /** Index of the currently highlighted filtered node (-1 = none). */
@@ -282,11 +287,15 @@ declare class SendToDialogComponent implements ISendToDialog {
282
287
  readonly done: _angular_core.OutputEmitterRef<SendToDialogResult>;
283
288
  /** Emitted when the user requests to populate the recipient list. */
284
289
  readonly populate: _angular_core.OutputEmitterRef<SendToPopulateData>;
285
- private readonly cdr;
286
290
  /** Dialog configuration, injected and exposed as a signal. */
287
291
  protected readonly dialogData: _angular_core.WritableSignal<SendToDialogData>;
288
- /** Form model for the send-to form fields. */
289
- protected item: SendToDialogResult;
292
+ /** Model backing the signal form. */
293
+ private readonly model;
294
+ /**
295
+ * Signal form for the send-to fields: recipients (a required, valid,
296
+ * semicolon-separated email list), subject and text are all required.
297
+ */
298
+ protected readonly form: _angular_forms_signals.FieldTree<SendToDialogResult, string | number, "writable">;
290
299
  /**
291
300
  * Confirm the form and emit the result.
292
301
  */