@arsedizioni/ars-utils 22.5.28 → 22.5.30

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.
@@ -5,6 +5,7 @@ import { PasswordStrength } from '@arsedizioni/ars-utils/core';
5
5
  import * as _angular_forms_signals from '@angular/forms/signals';
6
6
  import { CredentialsDialogResult, ResetPasswordDialogResult, RecoverPasswordDialogResult, PromptOtpDialogResult, PromptDialogData } from '@arsedizioni/ars-utils/ui';
7
7
  import { MatFormFieldAppearance } from '@angular/material/form-field';
8
+ import { SignalsUtils } from '@arsedizioni/ars-utils/core.validators';
8
9
 
9
10
  declare class OtpInputComponent implements ControlValueAccessor, Validator {
10
11
  /** Signal-based query for all individual OTP digit input elements. */
@@ -124,6 +125,8 @@ interface CredentialsDialogData {
124
125
  appearance?: MatFormFieldAppearance;
125
126
  }
126
127
  declare class CredentialsDialogComponent {
128
+ /** Error text of a field: the message declared in the schema, or the shared fallback. */
129
+ protected readonly getFieldErrorMessage: typeof SignalsUtils.getFieldErrorMessage;
127
130
  /** Emitted when the user submits the form. Carries the entered credentials. */
128
131
  readonly done: _angular_core.OutputEmitterRef<CredentialsDialogResult>;
129
132
  /** Emitted when the user requests a password-recovery flow. */
@@ -169,6 +172,8 @@ interface ResetPasswordDialogData {
169
172
  appearance?: MatFormFieldAppearance;
170
173
  }
171
174
  declare class ResetPasswordDialogComponent {
175
+ /** Error text of a field: the message declared in the schema, or the shared fallback. */
176
+ protected readonly getFieldErrorMessage: typeof SignalsUtils.getFieldErrorMessage;
172
177
  /** Emitted when the user submits the new password. Carries the entered password data. */
173
178
  readonly done: _angular_core.OutputEmitterRef<ResetPasswordDialogResult>;
174
179
  private readonly dialogService;
@@ -208,6 +213,8 @@ interface RecoverPasswordDialogData {
208
213
  appearance?: MatFormFieldAppearance;
209
214
  }
210
215
  declare class RecoverPasswordDialogComponent {
216
+ /** Error text of a field: the message declared in the schema, or the shared fallback. */
217
+ protected readonly getFieldErrorMessage: typeof SignalsUtils.getFieldErrorMessage;
211
218
  /** Emitted when the user submits the recovery request. Carries the entered email and recaptcha state. */
212
219
  readonly done: _angular_core.OutputEmitterRef<RecoverPasswordDialogResult>;
213
220
  /** Dialog configuration with defaults applied at construction time. */
@@ -5,6 +5,7 @@ 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
7
  import * as _angular_forms_signals from '@angular/forms/signals';
8
+ import { SignalsUtils } from '@arsedizioni/ars-utils/core.validators';
8
9
  import { MatFormFieldAppearance } from '@angular/material/form-field';
9
10
 
10
11
  interface ConfirmDialogOption extends DialogOption {
@@ -56,6 +57,8 @@ interface DeleteDialogData {
56
57
  appearance?: MatFormFieldAppearance;
57
58
  }
58
59
  declare class DeleteDialogComponent {
60
+ /** Error text of a field: the message declared in the schema, or the shared fallback. */
61
+ protected readonly getFieldErrorMessage: typeof SignalsUtils.getFieldErrorMessage;
59
62
  /** Emitted when the user makes a choice. Carries the selected result. */
60
63
  readonly choosen: i0.OutputEmitterRef<DialogResult>;
61
64
  private readonly dialogRef;
@@ -1,8 +1,11 @@
1
1
  import * as _angular_forms_signals from '@angular/forms/signals';
2
2
  import * as _angular_core from '@angular/core';
3
3
  import { PromptDialogResult, PromptDialogData, PromptDateDialogResult, PromptTimeDialogData } from '@arsedizioni/ars-utils/ui';
4
+ import { SignalsUtils } from '@arsedizioni/ars-utils/core.validators';
4
5
 
5
6
  declare class PromptDialogComponent {
7
+ /** Error text of a field: the message declared in the schema, or the shared fallback. */
8
+ protected readonly getFieldErrorMessage: typeof SignalsUtils.getFieldErrorMessage;
6
9
  readonly done: _angular_core.OutputEmitterRef<PromptDialogResult>;
7
10
  private readonly dialogService;
8
11
  protected readonly dialogData: _angular_core.WritableSignal<PromptDialogData>;
@@ -24,6 +27,21 @@ declare class PromptDialogComponent {
24
27
  }
25
28
 
26
29
  declare class PromptDateDialogComponent {
30
+ /** Error text of a field: the message declared in the schema, or the shared fallback. */
31
+ protected readonly getFieldErrorMessage: typeof SignalsUtils.getFieldErrorMessage;
32
+ /**
33
+ * Error text for a date range: whichever end is in error speaks for the pair.
34
+ * @param from - Errors of the start field, from `f.from().errors()`.
35
+ * @param to - Errors of the end field, from `f.to().errors()`.
36
+ * @returns The text to show under the range, or `undefined` when neither end is in error.
37
+ */
38
+ protected rangeErrorMessage(from: readonly {
39
+ kind: string;
40
+ message?: string;
41
+ }[], to: readonly {
42
+ kind: string;
43
+ message?: string;
44
+ }[]): string | undefined;
27
45
  readonly done: _angular_core.OutputEmitterRef<PromptDateDialogResult>;
28
46
  private readonly dialogService;
29
47
  protected readonly dialogData: _angular_core.WritableSignal<PromptDialogData>;
@@ -73,6 +91,8 @@ declare class PromptDateDialogComponent {
73
91
  }
74
92
 
75
93
  declare class PromptTimeDialogComponent {
94
+ /** Error text of a field: the message declared in the schema, or the shared fallback. */
95
+ protected readonly getFieldErrorMessage: typeof SignalsUtils.getFieldErrorMessage;
76
96
  readonly done: _angular_core.OutputEmitterRef<PromptDialogResult>;
77
97
  private readonly dialogService;
78
98
  protected readonly dialogData: _angular_core.WritableSignal<PromptTimeDialogData>;
@@ -9,6 +9,7 @@ import { SelectDialogData, SelectDialogResult, SelectDialogEdit, SelectableItem,
9
9
  import * as rxjs from 'rxjs';
10
10
  import { MatTree } from '@angular/material/tree';
11
11
  import { MatFormFieldAppearance } from '@angular/material/form-field';
12
+ import { SignalsUtils } from '@arsedizioni/ars-utils/core.validators';
12
13
 
13
14
  declare class SelectDialogComponent {
14
15
  readonly paginator: _angular_core.Signal<MatPaginator>;
@@ -283,6 +284,8 @@ interface SendToDialogData {
283
284
  options?: any;
284
285
  }
285
286
  declare class SendToDialogComponent implements ISendToDialog {
287
+ /** Error text of a field: the message declared in the schema, or the shared fallback. */
288
+ protected readonly getFieldErrorMessage: typeof SignalsUtils.getFieldErrorMessage;
286
289
  /** Emitted when the user confirms and sends the message. */
287
290
  readonly done: _angular_core.OutputEmitterRef<SendToDialogResult>;
288
291
  /** Emitted when the user requests to populate the recipient list. */
@@ -2,6 +2,7 @@ import * as _angular_forms_signals from '@angular/forms/signals';
2
2
  import * as _angular_core from '@angular/core';
3
3
  import { OnDestroy, DoCheck, ElementRef } from '@angular/core';
4
4
  import { ControlValueAccessor, NgControl } from '@angular/forms';
5
+ import { SignalsUtils } from '@arsedizioni/ars-utils/core.validators';
5
6
  import { MatFormFieldControl } from '@angular/material/form-field';
6
7
  import { FileInfo } from '@arsedizioni/ars-utils/core';
7
8
  import { Subject } from 'rxjs';
@@ -9,6 +10,8 @@ import { SelectFile, SelectFileDialogData, SelectPictureFileDialogData } from '@
9
10
 
10
11
  declare class FileInputComponent implements OnDestroy, DoCheck, MatFormFieldControl<FileInfo>, ControlValueAccessor {
11
12
  ngControl: NgControl;
13
+ /** Error text of a field: the message declared in the schema, or the shared fallback. */
14
+ protected readonly getFieldErrorMessage: typeof SignalsUtils.getFieldErrorMessage;
12
15
  /** Reference to the hidden native file input element. */
13
16
  protected readonly __file: _angular_core.Signal<ElementRef<any>>;
14
17
  private readonly renderer;