@arsedizioni/ars-utils 22.5.30 → 22.5.32

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.
@@ -2,8 +2,12 @@ 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
+ import { DialogResult, DialogOption, SelectDialogData, PromptDialogType } from '@arsedizioni/ars-utils/ui';
6
+ import { SendToDialogComponent, SelectTreeDialogComponent, SelectDialogComponent } from '@arsedizioni/ars-utils/ui.dialogs.select';
7
+ import { SelectPictureDialogComponent, SelectFileDialogComponent } from '@arsedizioni/ars-utils/ui.files';
8
+ import { PromptDialogComponent, PromptDateDialogComponent, PromptTimeDialogComponent } from '@arsedizioni/ars-utils/ui.dialogs.prompt';
9
+ import { PromptOtpDialogComponent } from '@arsedizioni/ars-utils/ui.dialogs.auth';
5
10
  import { ShellService } from '@arsedizioni/ars-utils/ui.shell';
6
- import { DialogResult, DialogOption } from '@arsedizioni/ars-utils/ui';
7
11
  import * as _angular_forms_signals from '@angular/forms/signals';
8
12
  import { SignalsUtils } from '@arsedizioni/ars-utils/core.validators';
9
13
  import { MatFormFieldAppearance } from '@angular/material/form-field';
@@ -58,7 +62,7 @@ interface DeleteDialogData {
58
62
  }
59
63
  declare class DeleteDialogComponent {
60
64
  /** Error text of a field: the message declared in the schema, or the shared fallback. */
61
- protected readonly getFieldErrorMessage: typeof SignalsUtils.getFieldErrorMessage;
65
+ protected readonly getErrorMessage: typeof SignalsUtils.getFieldErrorMessage;
62
66
  /** Emitted when the user makes a choice. Carries the selected result. */
63
67
  readonly choosen: i0.OutputEmitterRef<DialogResult>;
64
68
  private readonly dialogRef;
@@ -231,6 +235,117 @@ declare class DialogService extends ShellService {
231
235
  * @returns The dialog reference, or `null` outside the browser.
232
236
  */
233
237
  delete(message: string, title?: string, confirmMode?: DeleteDialogConfirmMode, okCaption?: string, cancelCaption?: string, width?: number, details?: string): MatDialogRef<DeleteDialogComponent> | null;
238
+ /**
239
+ * Open a send-to-email dialog.
240
+ * @param title - Dialog title.
241
+ * @param text - Pre-filled message body.
242
+ * @param subject - Pre-filled subject line.
243
+ * @param canPopulate - Whether the populate-recipients action is available.
244
+ * @param count - Number of documents being sent.
245
+ * @param options - Checkable option list.
246
+ * @param width - Maximum dialog width in pixels.
247
+ * @returns The opened dialog reference.
248
+ */
249
+ sendTo(title?: string, text?: string, subject?: string, canPopulate?: boolean, count?: number, options?: any, width?: number): Promise<MatDialogRef<SendToDialogComponent, any> | null>;
250
+ /**
251
+ * Open a tree-node selection dialog.
252
+ * @param nodes - The tree nodes to display.
253
+ * @param title - Dialog title.
254
+ * @param description - Optional description shown below the title.
255
+ * @param initialFilter - Pre-applied filter text.
256
+ * @param width - Maximum dialog width in pixels.
257
+ * @param okCaption - Label for the confirm button.
258
+ * @param canAppend - Whether the append-node action is available.
259
+ * @returns The opened dialog reference.
260
+ */
261
+ selectTree(nodes: any, title?: string, description?: string, initialFilter?: string, width?: number, okCaption?: string, canAppend?: boolean): Promise<MatDialogRef<SelectTreeDialogComponent, any> | null>;
262
+ /**
263
+ * Open a picture-selection dialog.
264
+ * @param title - Dialog title.
265
+ * @param description - Brief description shown in the dialog.
266
+ * @param okCaption - Label for the confirm button.
267
+ * @param options - Checkable option list.
268
+ * @param width - Maximum dialog width in pixels.
269
+ * @param maxSize - Maximum accepted file size in MB.
270
+ * @param maxPictureWidth - Maximum accepted picture width in pixels.
271
+ * @param maxPictureHeight - Maximum accepted picture height in pixels.
272
+ * @returns The opened dialog reference.
273
+ */
274
+ selectPicture(title?: string, description?: string, okCaption?: string, options?: any, width?: number, maxSize?: number, maxPictureWidth?: number, maxPictureHeight?: number): Promise<MatDialogRef<SelectPictureDialogComponent, any> | null>;
275
+ /**
276
+ * Open a file-selection dialog.
277
+ * @param title - Dialog title.
278
+ * @param description - Brief description shown in the dialog.
279
+ * @param okCaption - Label for the confirm button.
280
+ * @param helpLink - URL for the help link.
281
+ * @param helpCaption - Display text for the help link.
282
+ * @param options - Checkable option list.
283
+ * @param width - Maximum dialog width in pixels.
284
+ * @param maxSize - Maximum accepted file size in MB.
285
+ * @param accept - Accepted file extensions (e.g. `.pdf,.docx`).
286
+ * @returns The opened dialog reference.
287
+ */
288
+ selectFile(title?: string, description?: string, okCaption?: string, helpLink?: string, helpCaption?: string, options?: any, width?: number, maxSize?: number, accept?: string): Promise<MatDialogRef<SelectFileDialogComponent, any> | null>;
289
+ /**
290
+ * Open a multipurpose selection and CRUD dialog.
291
+ * @param data - The dialog configuration model.
292
+ * @param disableClose - Whether the dialog can be closed by clicking outside.
293
+ * @param closeOnNavigation - Whether the dialog closes on route navigation.
294
+ * @returns The opened dialog reference.
295
+ */
296
+ select(data: SelectDialogData, disableClose?: boolean, closeOnNavigation?: boolean): Promise<MatDialogRef<SelectDialogComponent, any> | null>;
297
+ /**
298
+ * Prompt the user to enter a value.
299
+ * @param title - Dialog title.
300
+ * @param type - The input type (default, text, number, etc.).
301
+ * @param description - Placeholder or description text.
302
+ * @param initialValue - Pre-filled value.
303
+ * @param okCaption - Label for the confirm button.
304
+ * @param cancelCaption - Label for the cancel button.
305
+ * @param options - Checkable option list.
306
+ * @param width - Maximum dialog width in pixels.
307
+ * @param required - Whether the input is required.
308
+ * @returns The opened dialog reference.
309
+ */
310
+ prompt(title: string, type?: PromptDialogType, description?: string, initialValue?: any, okCaption?: string, cancelCaption?: string, options?: any, width?: number, required?: boolean): Promise<MatDialogRef<PromptDialogComponent> | null>;
311
+ /**
312
+ * Prompt the user to enter a date or date interval.
313
+ * @param title - Dialog title.
314
+ * @param type - Date or DateInterval.
315
+ * @param description - Placeholder or description text.
316
+ * @param initialValue - Pre-filled value.
317
+ * @param okCaption - Label for the confirm button.
318
+ * @param cancelCaption - Label for the cancel button.
319
+ * @param options - Checkable option list.
320
+ * @param width - Maximum dialog width in pixels.
321
+ * @param required - Whether the input is required.
322
+ * @returns The opened dialog reference.
323
+ */
324
+ promptDate(title: string, type?: PromptDialogType.Date | PromptDialogType.DateInterval, description?: string, initialValue?: any, okCaption?: string, cancelCaption?: string, options?: any, width?: number, required?: boolean): Promise<MatDialogRef<PromptDateDialogComponent> | null>;
325
+ /**
326
+ * Prompt the user to enter a time value.
327
+ * @param title - Dialog title.
328
+ * @param description - Placeholder or description text.
329
+ * @param slots - Optional time slots string.
330
+ * @param initialValue - Pre-filled value.
331
+ * @param okCaption - Label for the confirm button.
332
+ * @param cancelCaption - Label for the cancel button.
333
+ * @param options - Checkable option list.
334
+ * @param width - Maximum dialog width in pixels.
335
+ * @param required - Whether the input is required.
336
+ * @returns The opened dialog reference.
337
+ */
338
+ promptTime(title: string, description?: string, slots?: string, initialValue?: any, okCaption?: string, cancelCaption?: string, options?: any, width?: number, required?: boolean): Promise<MatDialogRef<PromptTimeDialogComponent> | null>;
339
+ /**
340
+ * Prompt the user to enter an OTP code.
341
+ * @param title - Dialog title.
342
+ * @param description - Description text shown in the dialog.
343
+ * @param okCaption - Label for the confirm button.
344
+ * @param cancelCaption - Label for the cancel button.
345
+ * @param width - Maximum dialog width in pixels.
346
+ * @returns The opened dialog reference.
347
+ */
348
+ promptOtp(title?: string, description?: string, okCaption?: string, cancelCaption?: string, width?: number): Promise<MatDialogRef<PromptOtpDialogComponent> | null>;
234
349
  static ɵfac: i0.ɵɵFactoryDeclaration<DialogService, never>;
235
350
  static ɵprov: i0.ɵɵInjectableDeclaration<DialogService>;
236
351
  }
@@ -5,7 +5,7 @@ import { SignalsUtils } from '@arsedizioni/ars-utils/core.validators';
5
5
 
6
6
  declare class PromptDialogComponent {
7
7
  /** Error text of a field: the message declared in the schema, or the shared fallback. */
8
- protected readonly getFieldErrorMessage: typeof SignalsUtils.getFieldErrorMessage;
8
+ protected readonly getErrorMessage: typeof SignalsUtils.getFieldErrorMessage;
9
9
  readonly done: _angular_core.OutputEmitterRef<PromptDialogResult>;
10
10
  private readonly dialogService;
11
11
  protected readonly dialogData: _angular_core.WritableSignal<PromptDialogData>;
@@ -28,7 +28,7 @@ declare class PromptDialogComponent {
28
28
 
29
29
  declare class PromptDateDialogComponent {
30
30
  /** Error text of a field: the message declared in the schema, or the shared fallback. */
31
- protected readonly getFieldErrorMessage: typeof SignalsUtils.getFieldErrorMessage;
31
+ protected readonly getErrorMessage: typeof SignalsUtils.getFieldErrorMessage;
32
32
  /**
33
33
  * Error text for a date range: whichever end is in error speaks for the pair.
34
34
  * @param from - Errors of the start field, from `f.from().errors()`.
@@ -92,7 +92,7 @@ declare class PromptDateDialogComponent {
92
92
 
93
93
  declare class PromptTimeDialogComponent {
94
94
  /** Error text of a field: the message declared in the schema, or the shared fallback. */
95
- protected readonly getFieldErrorMessage: typeof SignalsUtils.getFieldErrorMessage;
95
+ protected readonly getErrorMessage: typeof SignalsUtils.getFieldErrorMessage;
96
96
  readonly done: _angular_core.OutputEmitterRef<PromptDialogResult>;
97
97
  private readonly dialogService;
98
98
  protected readonly dialogData: _angular_core.WritableSignal<PromptTimeDialogData>;
@@ -285,7 +285,7 @@ interface SendToDialogData {
285
285
  }
286
286
  declare class SendToDialogComponent implements ISendToDialog {
287
287
  /** Error text of a field: the message declared in the schema, or the shared fallback. */
288
- protected readonly getFieldErrorMessage: typeof SignalsUtils.getFieldErrorMessage;
288
+ protected readonly getErrorMessage: typeof SignalsUtils.getFieldErrorMessage;
289
289
  /** Emitted when the user confirms and sends the message. */
290
290
  readonly done: _angular_core.OutputEmitterRef<SendToDialogResult>;
291
291
  /** Emitted when the user requests to populate the recipient list. */
@@ -11,7 +11,7 @@ import { SelectFile, SelectFileDialogData, SelectPictureFileDialogData } from '@
11
11
  declare class FileInputComponent implements OnDestroy, DoCheck, MatFormFieldControl<FileInfo>, ControlValueAccessor {
12
12
  ngControl: NgControl;
13
13
  /** Error text of a field: the message declared in the schema, or the shared fallback. */
14
- protected readonly getFieldErrorMessage: typeof SignalsUtils.getFieldErrorMessage;
14
+ protected readonly getErrorMessage: typeof SignalsUtils.getFieldErrorMessage;
15
15
  /** Reference to the hidden native file input element. */
16
16
  protected readonly __file: _angular_core.Signal<ElementRef<any>>;
17
17
  private readonly renderer;
@@ -0,0 +1,4 @@
1
+ {
2
+ "module": "../fesm2022/arsedizioni-ars-utils-ui.application.mjs",
3
+ "typings": "../types/arsedizioni-ars-utils-ui.application.d.ts"
4
+ }