@arsedizioni/ars-utils 21.2.207 → 21.2.208
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/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs +1 -1
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-core.mjs +869 -510
- package/fesm2022/arsedizioni-ars-utils-core.mjs.map +1 -1
- package/package.json +1 -1
- package/types/arsedizioni-ars-utils-core.d.ts +724 -238
|
@@ -1,98 +1,172 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { PipeTransform, EventEmitter, OnDestroy, Signal } from '@angular/core';
|
|
3
3
|
import { Validator, AbstractControl, ValidationErrors } from '@angular/forms';
|
|
4
|
-
import { SafeHtml } from '@angular/platform-browser';
|
|
5
|
-
import { DateAdapter, MatDateFormats } from '@angular/material/core';
|
|
6
4
|
import { Locale } from 'date-fns';
|
|
5
|
+
import { SafeHtml, SafeResourceUrl } from '@angular/platform-browser';
|
|
6
|
+
import { DateAdapter, MatDateFormats } from '@angular/material/core';
|
|
7
7
|
import { SelectionModel } from '@angular/cdk/collections';
|
|
8
8
|
import { Observable } from 'rxjs';
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Directive that validates a file size against configurable minimum and maximum bounds.
|
|
12
|
+
* Bind `[fileSize]` together with `[size]="fileSizeInMb"`, `[maxSizeMb]`, and `[minSizeMb]`.
|
|
13
|
+
*/
|
|
14
|
+
declare class FileSizeValidatorDirective implements Validator {
|
|
15
|
+
/** Maximum allowed file size in megabytes. Defaults to 5. */
|
|
16
|
+
readonly maxSizeMb: i0.InputSignal<number>;
|
|
17
|
+
/** Minimum required file size in megabytes. Defaults to 0. */
|
|
18
|
+
readonly minSizeMb: i0.InputSignal<number>;
|
|
19
|
+
/** The actual file size in megabytes to validate against the bounds. */
|
|
20
|
+
readonly size: i0.InputSignal<number>;
|
|
21
|
+
/**
|
|
22
|
+
* Validates that the bound file size falls within the configured min/max range.
|
|
23
|
+
* Returns `null` when no control value is present.
|
|
24
|
+
* @param control - The form control to validate.
|
|
25
|
+
*/
|
|
12
26
|
validate(control: AbstractControl): ValidationErrors | null;
|
|
13
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
14
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FileSizeValidatorDirective, never>;
|
|
28
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FileSizeValidatorDirective, "[fileSize]", never, { "maxSizeMb": { "alias": "maxSizeMb"; "required": false; "isSignal": true; }; "minSizeMb": { "alias": "minSizeMb"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
15
29
|
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Directive that validates a control using the host object's `isValid()` method
|
|
33
|
+
* or a boolean expression passed via `[validIf]`.
|
|
34
|
+
*/
|
|
16
35
|
declare class ValidIfDirective implements Validator {
|
|
36
|
+
/** When `true`, the control is considered valid regardless of the bound value. */
|
|
17
37
|
readonly validIf: i0.InputSignal<boolean>;
|
|
38
|
+
/**
|
|
39
|
+
* Validates the control value against a boolean flag or the value's own `isValid()` method.
|
|
40
|
+
* @param control - The form control to validate.
|
|
41
|
+
*/
|
|
18
42
|
validate(control: AbstractControl): ValidationErrors | null;
|
|
19
43
|
static ɵfac: i0.ɵɵFactoryDeclaration<ValidIfDirective, never>;
|
|
20
44
|
static ɵdir: i0.ɵɵDirectiveDeclaration<ValidIfDirective, "[validIf]", never, { "validIf": { "alias": "validIf"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
21
45
|
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Directive that delegates validation to an externally provided validator function.
|
|
49
|
+
* Bind `[validator]="myFn"` where `myFn` is `(c: AbstractControl) => ValidationErrors | null`.
|
|
50
|
+
*/
|
|
51
|
+
declare class ValidatorDirective implements Validator {
|
|
52
|
+
/** The custom validator function to apply. */
|
|
53
|
+
readonly validator: i0.InputSignal<(control: AbstractControl) => ValidationErrors | null>;
|
|
54
|
+
/**
|
|
55
|
+
* Invokes the provided validator function against the given control.
|
|
56
|
+
* Returns `null` (valid) when no function is bound.
|
|
57
|
+
* @param control - The form control to validate.
|
|
58
|
+
*/
|
|
59
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
60
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ValidatorDirective, never>;
|
|
61
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ValidatorDirective, "[validator]", never, { "validator": { "alias": "validator"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Directive that validates that the host control's value equals the value of another control.
|
|
66
|
+
* Bind `[equals]="otherControl"`.
|
|
67
|
+
*/
|
|
22
68
|
declare class EqualsValidatorDirective implements Validator {
|
|
69
|
+
/** The control whose value must match the host control's value. */
|
|
23
70
|
readonly equals: i0.InputSignal<AbstractControl<any, any, any>>;
|
|
71
|
+
/**
|
|
72
|
+
* Validates that the host control value equals the bound control's value.
|
|
73
|
+
* Returns `null` (valid) when no control is bound.
|
|
74
|
+
* @param control - The form control to validate.
|
|
75
|
+
*/
|
|
24
76
|
validate(control: AbstractControl): ValidationErrors | null;
|
|
25
77
|
static ɵfac: i0.ɵɵFactoryDeclaration<EqualsValidatorDirective, never>;
|
|
26
78
|
static ɵdir: i0.ɵɵDirectiveDeclaration<EqualsValidatorDirective, "[equals]", never, { "equals": { "alias": "equals"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
27
79
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
declare class EmailsValidatorDirective implements Validator {
|
|
35
|
-
validate(control: AbstractControl): ValidationErrors | null;
|
|
36
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<EmailsValidatorDirective, never>;
|
|
37
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<EmailsValidatorDirective, "[emails]", never, {}, {}, never, never, true, never>;
|
|
38
|
-
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Directive that validates a control value as a GUID / UUID string.
|
|
83
|
+
* Apply `guid` to a text input that expects a valid UUID.
|
|
84
|
+
*/
|
|
39
85
|
declare class GuidValidatorDirective implements Validator {
|
|
86
|
+
/**
|
|
87
|
+
* Validates that the control value is a well-formed GUID / UUID.
|
|
88
|
+
* Returns `null` when the control is empty.
|
|
89
|
+
* @param control - The form control to validate.
|
|
90
|
+
*/
|
|
40
91
|
validate(control: AbstractControl): ValidationErrors | null;
|
|
41
92
|
static ɵfac: i0.ɵɵFactoryDeclaration<GuidValidatorDirective, never>;
|
|
42
93
|
static ɵdir: i0.ɵɵDirectiveDeclaration<GuidValidatorDirective, "[guid]", never, {}, {}, never, never, true, never>;
|
|
43
94
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
declare class
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Directive that validates a semicolon-separated list of email addresses.
|
|
98
|
+
* Apply `emails` to a text input containing one or more addresses separated by `;`.
|
|
99
|
+
*/
|
|
100
|
+
declare class EmailsValidatorDirective implements Validator {
|
|
101
|
+
/**
|
|
102
|
+
* Validates each address in a semicolon-separated email list.
|
|
103
|
+
* Returns `null` when the control is empty.
|
|
104
|
+
* @param control - The form control to validate.
|
|
105
|
+
*/
|
|
50
106
|
validate(control: AbstractControl): ValidationErrors | null;
|
|
51
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
52
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<
|
|
107
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EmailsValidatorDirective, never>;
|
|
108
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<EmailsValidatorDirective, "[emails]", never, {}, {}, never, never, true, never>;
|
|
53
109
|
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Directive that validates a control value as a well-formed URL.
|
|
113
|
+
* Apply `url` to a text input that expects a URL.
|
|
114
|
+
*/
|
|
54
115
|
declare class UrlValidatorDirective implements Validator {
|
|
116
|
+
/**
|
|
117
|
+
* Validates that the control value is a well-formed URL.
|
|
118
|
+
* Returns `null` (valid) when the control is empty.
|
|
119
|
+
* @param control - The form control to validate.
|
|
120
|
+
*/
|
|
55
121
|
validate(control: AbstractControl): ValidationErrors | null;
|
|
56
122
|
static ɵfac: i0.ɵɵFactoryDeclaration<UrlValidatorDirective, never>;
|
|
57
123
|
static ɵdir: i0.ɵɵDirectiveDeclaration<UrlValidatorDirective, "[url]", never, {}, {}, never, never, true, never>;
|
|
58
124
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<FileSizeValidatorDirective, "[fileSize]", never, { "maxSizeMb": { "alias": "maxSizeMb"; "required": false; "isSignal": true; }; "minSizeMb": { "alias": "minSizeMb"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
66
|
-
}
|
|
67
|
-
declare class MaxTermsValidatorDirective implements Validator {
|
|
68
|
-
readonly maxTerms: i0.InputSignal<number>;
|
|
69
|
-
validate(control: AbstractControl): ValidationErrors | null;
|
|
70
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MaxTermsValidatorDirective, never>;
|
|
71
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<MaxTermsValidatorDirective, "[maxTerms]", never, { "maxTerms": { "alias": "maxTerms"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
72
|
-
}
|
|
73
|
-
declare class PasswordValidatorDirective implements Validator {
|
|
74
|
-
validate(control: AbstractControl): ValidationErrors | null;
|
|
75
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<PasswordValidatorDirective, never>;
|
|
76
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<PasswordValidatorDirective, "[password]", never, {}, {}, never, never, true, never>;
|
|
77
|
-
}
|
|
78
|
-
declare class TimeValidatorDirective implements Validator {
|
|
79
|
-
readonly slots: i0.InputSignal<string>;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Directive that validates that a control value is not a future date.
|
|
128
|
+
* Apply `notFuture` to a text input that expects a date on or before today.
|
|
129
|
+
*/
|
|
130
|
+
declare class NotFutureValidatorDirective implements Validator {
|
|
80
131
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
* @
|
|
132
|
+
* Validates that the control value represents a date that is not in the future.
|
|
133
|
+
* Returns `null` when the control is empty.
|
|
134
|
+
* @param control - The form control to validate.
|
|
84
135
|
*/
|
|
85
|
-
private getTime;
|
|
86
136
|
validate(control: AbstractControl): ValidationErrors | null;
|
|
87
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
88
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<
|
|
137
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NotFutureValidatorDirective, never>;
|
|
138
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NotFutureValidatorDirective, "[notFuture]", never, {}, {}, never, never, true, never>;
|
|
89
139
|
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Directive that validates that a string control value is not blank (whitespace-only).
|
|
143
|
+
* Apply `notEmpty` to a text input where non-blank content is required.
|
|
144
|
+
*/
|
|
90
145
|
declare class NotEmptyValidatorDirective implements Validator {
|
|
146
|
+
/**
|
|
147
|
+
* Validates that the control value is a non-blank string.
|
|
148
|
+
* Returns `null` when the control is empty or not a string.
|
|
149
|
+
* @param control - The form control to validate.
|
|
150
|
+
*/
|
|
91
151
|
validate(control: AbstractControl): ValidationErrors | null;
|
|
92
152
|
static ɵfac: i0.ɵɵFactoryDeclaration<NotEmptyValidatorDirective, never>;
|
|
93
153
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NotEmptyValidatorDirective, "[notEmpty]", never, {}, {}, never, never, true, never>;
|
|
94
154
|
}
|
|
95
155
|
|
|
156
|
+
/**
|
|
157
|
+
* Directive that validates a control value as a sufficiently strong password.
|
|
158
|
+
* Apply `password` to a password input.
|
|
159
|
+
*/
|
|
160
|
+
declare class PasswordValidatorDirective implements Validator {
|
|
161
|
+
/**
|
|
162
|
+
* Validates that the control value meets the minimum password-strength requirements.
|
|
163
|
+
* @param control - The form control to validate.
|
|
164
|
+
*/
|
|
165
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
166
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PasswordValidatorDirective, never>;
|
|
167
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<PasswordValidatorDirective, "[password]", never, {}, {}, never, never, true, never>;
|
|
168
|
+
}
|
|
169
|
+
|
|
96
170
|
interface INode {
|
|
97
171
|
id: string;
|
|
98
172
|
name?: string;
|
|
@@ -155,12 +229,12 @@ declare class SystemUtils {
|
|
|
155
229
|
*/
|
|
156
230
|
static arrayToNodes(items: INode[], parent?: INode): INode[];
|
|
157
231
|
/**
|
|
158
|
-
*
|
|
159
|
-
* @param key
|
|
160
|
-
* @param order
|
|
161
|
-
* @returns
|
|
232
|
+
* Comparator factory for sorting arrays of objects by a given property key.
|
|
233
|
+
* @param key - Name of the property to sort by.
|
|
234
|
+
* @param order - Sort direction: `'asc'` (default) or `'desc'`.
|
|
235
|
+
* @returns A comparator function that returns `0`, `1`, or `-1`.
|
|
162
236
|
*/
|
|
163
|
-
static arraySortCompare(key: string, order?: string): (a:
|
|
237
|
+
static arraySortCompare(key: string, order?: string): (a: Record<string, unknown>, b: Record<string, unknown>) => number;
|
|
164
238
|
/**
|
|
165
239
|
* Format weight
|
|
166
240
|
* @param gr : grams
|
|
@@ -202,9 +276,9 @@ declare class SystemUtils {
|
|
|
202
276
|
*/
|
|
203
277
|
static join(items?: string[], sep?: string, max?: number): string | undefined;
|
|
204
278
|
/**
|
|
205
|
-
*
|
|
206
|
-
* @param s
|
|
207
|
-
* @returns
|
|
279
|
+
* Wraps bare URLs in the given string with `<a>` anchor tags.
|
|
280
|
+
* @param s - The plain-text or HTML string to process.
|
|
281
|
+
* @returns The string with URLs replaced by clickable links, or `''` when `s` is falsy.
|
|
208
282
|
*/
|
|
209
283
|
static replaceAsHtml(s?: string): string;
|
|
210
284
|
/**
|
|
@@ -268,21 +342,20 @@ declare class SystemUtils {
|
|
|
268
342
|
*/
|
|
269
343
|
static clone<T>(obj: T): T;
|
|
270
344
|
/**
|
|
271
|
-
*
|
|
272
|
-
* @param obj
|
|
273
|
-
* @
|
|
345
|
+
* Creates a deep clone of an object by recursively copying all own properties.
|
|
346
|
+
* @param obj - The source object to clone.
|
|
347
|
+
* @param dest - Optional pre-allocated destination object; a new instance is created when omitted.
|
|
348
|
+
* @returns A deep copy of `obj`.
|
|
274
349
|
*/
|
|
275
|
-
static deepClone<T>(obj:
|
|
350
|
+
static deepClone<T extends object>(obj: T, dest?: T): T;
|
|
276
351
|
/**
|
|
277
|
-
*
|
|
278
|
-
* @param value
|
|
279
|
-
* @returns : true if is a valid UUID
|
|
352
|
+
* Returns `true` when `value` is a syntactically valid UUID string.
|
|
353
|
+
* @param value - The string to validate.
|
|
280
354
|
*/
|
|
281
355
|
static parseUUID(value?: string): boolean;
|
|
282
356
|
/**
|
|
283
|
-
*
|
|
284
|
-
* @param value
|
|
285
|
-
* @returns : true if valid and not empty
|
|
357
|
+
* Returns `true` when `value` is a valid, non-empty (non-zero) UUID.
|
|
358
|
+
* @param value - The string to validate.
|
|
286
359
|
*/
|
|
287
360
|
static parseUUIDNotEmpty(value?: string): boolean;
|
|
288
361
|
/**
|
|
@@ -319,7 +392,7 @@ declare class SystemUtils {
|
|
|
319
392
|
* @param locale : the locale to use
|
|
320
393
|
* @returns : a valid Date object or null
|
|
321
394
|
*/
|
|
322
|
-
static parseDate(value?: string | Date, locale?:
|
|
395
|
+
static parseDate(value?: string | Date, locale?: Locale): Date | undefined;
|
|
323
396
|
/**
|
|
324
397
|
* Format a date
|
|
325
398
|
* @param value : the date or string to format
|
|
@@ -327,13 +400,13 @@ declare class SystemUtils {
|
|
|
327
400
|
* @param locale : the locale to use (default is IT)
|
|
328
401
|
* @returns : the formatted string
|
|
329
402
|
*/
|
|
330
|
-
static formatDate(value?: Date | string, fmt?: DateFormat | string, locale?:
|
|
403
|
+
static formatDate(value?: Date | string, fmt?: DateFormat | string, locale?: Locale): string | undefined;
|
|
331
404
|
/**
|
|
332
405
|
* Return an italian local date
|
|
333
406
|
* @param value : the date
|
|
334
407
|
* @returns : the new date
|
|
335
408
|
*/
|
|
336
|
-
static toLocalDate(value?: Date | string): Date;
|
|
409
|
+
static toLocalDate(value?: Date | string): Date | undefined;
|
|
337
410
|
/**
|
|
338
411
|
* Update a DateInterval object according to a string
|
|
339
412
|
* @param value : string value
|
|
@@ -343,40 +416,40 @@ declare class SystemUtils {
|
|
|
343
416
|
*/
|
|
344
417
|
static changeDateInterval(value: string, interval: DateInterval, end?: boolean, copy?: boolean): void;
|
|
345
418
|
/**
|
|
346
|
-
*
|
|
347
|
-
* @param value
|
|
348
|
-
* @param decimals
|
|
349
|
-
* @param locale
|
|
350
|
-
* @returns
|
|
419
|
+
* Formats a number using `Intl.NumberFormat`.
|
|
420
|
+
* @param value - The number to format.
|
|
421
|
+
* @param decimals - Maximum decimal places (default: `2`).
|
|
422
|
+
* @param locale - BCP 47 locale tag (default: `'it-IT'`).
|
|
423
|
+
* @returns The formatted number string.
|
|
351
424
|
*/
|
|
352
425
|
static formatNumber(value: number, decimals?: number, locale?: string): string;
|
|
353
426
|
/**
|
|
354
|
-
*
|
|
355
|
-
* @param value
|
|
356
|
-
* @param currency
|
|
357
|
-
* @param decimals
|
|
358
|
-
* @param locale
|
|
359
|
-
* @returns
|
|
427
|
+
* Formats a number as a currency string using `Intl.NumberFormat`.
|
|
428
|
+
* @param value - The number to format.
|
|
429
|
+
* @param currency - ISO 4217 currency code (default: `'EUR'`).
|
|
430
|
+
* @param decimals - Maximum decimal places (default: `2`).
|
|
431
|
+
* @param locale - BCP 47 locale tag (default: `'it-IT'`).
|
|
432
|
+
* @returns The formatted currency string.
|
|
360
433
|
*/
|
|
361
434
|
static formatCurrency(value: number, currency?: string, decimals?: number, locale?: string): string;
|
|
362
435
|
/**
|
|
363
|
-
*
|
|
364
|
-
* @param value
|
|
365
|
-
* @returns
|
|
436
|
+
* Percent-encodes a string for safe inclusion in a URL.
|
|
437
|
+
* @param value - The string to encode.
|
|
438
|
+
* @returns The encoded string, or `undefined` when `value` is empty.
|
|
366
439
|
*/
|
|
367
440
|
static urlEncode(value: string): string | undefined;
|
|
368
441
|
/**
|
|
369
|
-
*
|
|
370
|
-
* @param value
|
|
371
|
-
* @returns
|
|
442
|
+
* Decodes a percent-encoded URL string, treating `+` as a space.
|
|
443
|
+
* @param value - The encoded string to decode.
|
|
444
|
+
* @returns The decoded string, or `undefined` when `value` is empty or absent.
|
|
372
445
|
*/
|
|
373
446
|
static urlDecode(value?: string): string | undefined;
|
|
374
447
|
/**
|
|
375
|
-
*
|
|
376
|
-
* @param name
|
|
377
|
-
* @returns
|
|
448
|
+
* Reads a query string parameter value from the current page URL.
|
|
449
|
+
* @param name - The parameter name to look up.
|
|
450
|
+
* @returns The decoded parameter value, or `undefined` when absent or running server-side.
|
|
378
451
|
*/
|
|
379
|
-
static getQueryStringValueByName(name: string): string;
|
|
452
|
+
static getQueryStringValueByName(name: string): string | undefined;
|
|
380
453
|
/**
|
|
381
454
|
* Generate a password
|
|
382
455
|
* @returns : the password string
|
|
@@ -413,10 +486,11 @@ declare class SystemUtils {
|
|
|
413
486
|
*/
|
|
414
487
|
private static _toNodes;
|
|
415
488
|
/**
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
489
|
+
* Returns an array of individual power-of-2 flag values that are set in `value`.
|
|
490
|
+
* @param value - The bitmask to decompose.
|
|
491
|
+
* @param max - Upper-bound exponent: checks flags from `1` up to `1 << max` (default: `30`).
|
|
492
|
+
* @returns Array of set flag values, or an empty array when `value` is `0`.
|
|
493
|
+
*/
|
|
420
494
|
static getFlags(value: number, max?: number): number[];
|
|
421
495
|
/**
|
|
422
496
|
* Check if a color is light or dark
|
|
@@ -583,79 +657,241 @@ interface LoginResult<T> extends ApiResult<boolean> {
|
|
|
583
657
|
requiresMfa?: boolean;
|
|
584
658
|
}
|
|
585
659
|
|
|
586
|
-
|
|
660
|
+
/**
|
|
661
|
+
* Directive that listens to `keyup` events on a date input and debounces changes
|
|
662
|
+
* into a {@link DateInterval} model, converting shorthand strings (e.g. "d/m") to dates.
|
|
663
|
+
* Apply `[dateIntervalChange]="interval"` to the host `<input>` element.
|
|
664
|
+
*/
|
|
665
|
+
declare class DateIntervalChangeDirective {
|
|
666
|
+
/** The date interval model to update when the input value changes. */
|
|
587
667
|
readonly dateIntervalChange: i0.InputSignal<DateInterval>;
|
|
668
|
+
/** When `true`, the directive updates the interval's end date; otherwise the start date. */
|
|
588
669
|
readonly end: i0.InputSignal<boolean>;
|
|
589
670
|
private readonly subject;
|
|
590
|
-
private
|
|
591
|
-
|
|
592
|
-
|
|
671
|
+
private readonly destroyRef;
|
|
672
|
+
constructor();
|
|
673
|
+
/**
|
|
674
|
+
* Handles `keyup` events on the host element.
|
|
675
|
+
* Prevents default browser behaviour for the space key and forwards the event to the debounce pipeline.
|
|
676
|
+
* @param e - The keyboard event emitted by the host input.
|
|
677
|
+
*/
|
|
593
678
|
onKeyup(e: KeyboardEvent): void;
|
|
594
679
|
static ɵfac: i0.ɵɵFactoryDeclaration<DateIntervalChangeDirective, never>;
|
|
595
680
|
static ɵdir: i0.ɵɵDirectiveDeclaration<DateIntervalChangeDirective, "[dateIntervalChange]", never, { "dateIntervalChange": { "alias": "dateIntervalChange"; "required": false; "isSignal": true; }; "end": { "alias": "end"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
596
681
|
}
|
|
597
682
|
|
|
683
|
+
/**
|
|
684
|
+
* Directive that validates a control value as a parseable SQL-compatible date string.
|
|
685
|
+
* Apply `sqlDate` to a text input that expects a date after year 1750.
|
|
686
|
+
*/
|
|
687
|
+
declare class SqlDateValidatorDirective implements Validator {
|
|
688
|
+
/**
|
|
689
|
+
* Validates that the control value can be parsed as a date after 1750.
|
|
690
|
+
* Returns `null` when the control is empty.
|
|
691
|
+
* @param control - The form control to validate.
|
|
692
|
+
*/
|
|
693
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
694
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SqlDateValidatorDirective, never>;
|
|
695
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SqlDateValidatorDirective, "[sqlDate]", never, {}, {}, never, never, true, never>;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* Impure pipe that filters an array of searchable items against a text query.
|
|
700
|
+
*
|
|
701
|
+
* Each item is matched either via its `searchBag.name` property (when present)
|
|
702
|
+
* or by converting the item itself to a lowercase string. The optional `metadata`
|
|
703
|
+
* argument is updated in-place with the total item count and the filtered count,
|
|
704
|
+
* making it usable in the template alongside `*ngFor`.
|
|
705
|
+
*
|
|
706
|
+
* Usage:
|
|
707
|
+
* ```html
|
|
708
|
+
* <div *ngFor="let item of items | search:filterText:meta">...</div>
|
|
709
|
+
* <div>Showing {{ meta.count }} of {{ meta.total }}</div>
|
|
710
|
+
* ```
|
|
711
|
+
*/
|
|
598
712
|
declare class SearchFilterPipe implements PipeTransform {
|
|
599
|
-
|
|
713
|
+
/**
|
|
714
|
+
* Filters `items` by performing a case-insensitive substring match against `value`.
|
|
715
|
+
* When `items` or `value` is falsy the original array is returned unfiltered.
|
|
716
|
+
* @param items - The source array to filter. May be `undefined`.
|
|
717
|
+
* @param value - The search text to match against each item. May be `undefined`.
|
|
718
|
+
* @param metadata - Optional object that is updated with `total` and `count` after filtering.
|
|
719
|
+
* @returns The filtered array, the original array when no filter text is given,
|
|
720
|
+
* or `undefined` when `items` is `undefined`.
|
|
721
|
+
*/
|
|
722
|
+
transform(items?: any[], value?: string, metadata?: SearchFilterMetadata): any[] | undefined;
|
|
600
723
|
static ɵfac: i0.ɵɵFactoryDeclaration<SearchFilterPipe, never>;
|
|
601
724
|
static ɵpipe: i0.ɵɵPipeDeclaration<SearchFilterPipe, "search", true>;
|
|
602
725
|
}
|
|
603
726
|
|
|
727
|
+
/**
|
|
728
|
+
* Impure pipe that filters an array using a caller-provided predicate function.
|
|
729
|
+
* Because the pipe is impure it re-evaluates on every change-detection cycle,
|
|
730
|
+
* which is necessary when the predicate's captured state changes.
|
|
731
|
+
*
|
|
732
|
+
* Usage: `*ngFor="let item of items | callback:myFilter"`
|
|
733
|
+
*/
|
|
604
734
|
declare class SearchCallbackPipe implements PipeTransform {
|
|
605
|
-
|
|
735
|
+
/**
|
|
736
|
+
* Filters `items` by applying `callback` to each element.
|
|
737
|
+
* Returns the original array unchanged when either argument is falsy.
|
|
738
|
+
* @param items - The source array to filter. May be `undefined`.
|
|
739
|
+
* @param callback - A predicate function that returns `true` for items to keep.
|
|
740
|
+
* @returns A new filtered array, the original array when no callback is provided,
|
|
741
|
+
* or `undefined` when `items` is `undefined`.
|
|
742
|
+
*/
|
|
743
|
+
transform<T>(items: T[] | undefined, callback: ((item: T) => boolean) | undefined): T[] | undefined;
|
|
606
744
|
static ɵfac: i0.ɵɵFactoryDeclaration<SearchCallbackPipe, never>;
|
|
607
745
|
static ɵpipe: i0.ɵɵPipeDeclaration<SearchCallbackPipe, "callback", true>;
|
|
608
746
|
}
|
|
609
747
|
|
|
748
|
+
/**
|
|
749
|
+
* Pipe that marks an HTML string as trusted so Angular does not escape it when
|
|
750
|
+
* bound via `[innerHTML]`.
|
|
751
|
+
*
|
|
752
|
+
* Usage: `<div [innerHTML]="html | safeHtml"></div>`
|
|
753
|
+
*/
|
|
610
754
|
declare class SafeHtmlPipe implements PipeTransform {
|
|
611
755
|
private readonly sanitizer;
|
|
756
|
+
/**
|
|
757
|
+
* Bypasses Angular's HTML sanitization and returns a `SafeHtml` instance.
|
|
758
|
+
* @param value - The raw HTML string to trust. Treated as an empty string when `undefined`.
|
|
759
|
+
* @returns A `SafeHtml` value that can be bound to `[innerHTML]` without escaping.
|
|
760
|
+
*/
|
|
612
761
|
transform(value?: string): SafeHtml;
|
|
613
762
|
static ɵfac: i0.ɵɵFactoryDeclaration<SafeHtmlPipe, never>;
|
|
614
763
|
static ɵpipe: i0.ɵɵPipeDeclaration<SafeHtmlPipe, "safeHtml", true>;
|
|
615
764
|
}
|
|
616
765
|
|
|
766
|
+
/**
|
|
767
|
+
* Pipe that marks a URL string as a trusted resource URL so Angular does not block it
|
|
768
|
+
* when bound to attributes such as `[src]` or `[href]` on iframes, objects, or embeds.
|
|
769
|
+
*
|
|
770
|
+
* Usage: `<iframe [src]="url | safeUrl"></iframe>`
|
|
771
|
+
*/
|
|
617
772
|
declare class SafeUrlPipe implements PipeTransform {
|
|
618
773
|
private readonly sanitizer;
|
|
619
|
-
|
|
774
|
+
/**
|
|
775
|
+
* Bypasses Angular's resource-URL sanitization and returns a `SafeResourceUrl` instance.
|
|
776
|
+
* @param value - The URL string to trust. Treated as an empty string when `undefined`.
|
|
777
|
+
* @returns A `SafeResourceUrl` that can be bound to resource URL attributes without blocking.
|
|
778
|
+
*/
|
|
779
|
+
transform(value?: string): SafeResourceUrl;
|
|
620
780
|
static ɵfac: i0.ɵɵFactoryDeclaration<SafeUrlPipe, never>;
|
|
621
781
|
static ɵpipe: i0.ɵɵPipeDeclaration<SafeUrlPipe, "safeUrl", true>;
|
|
622
782
|
}
|
|
623
783
|
|
|
784
|
+
/**
|
|
785
|
+
* Pipe that applies a global regex replacement on a string and returns the result
|
|
786
|
+
* as sanitized HTML. When `regexValue` is `'\n'` and no `replaceValue` is given,
|
|
787
|
+
* newlines are replaced with `<br>` tags.
|
|
788
|
+
*
|
|
789
|
+
* Usage: `{{ text | replace:'\n':'' }}`
|
|
790
|
+
*/
|
|
624
791
|
declare class ReplacePipe implements PipeTransform {
|
|
625
792
|
private readonly sanitizer;
|
|
626
|
-
|
|
793
|
+
/**
|
|
794
|
+
* Replaces all occurrences of `regexValue` in `value` with `replaceValue`.
|
|
795
|
+
* Returns `undefined` when `value` is empty or `undefined`.
|
|
796
|
+
* @param value - The source string to process.
|
|
797
|
+
* @param regexValue - The regex pattern string to match (applied with the global flag).
|
|
798
|
+
* @param replaceValue - The replacement string. Defaults to `'<br>'` when `regexValue` is `'\n'` and this is falsy.
|
|
799
|
+
* @returns A `SafeHtml` value with all matches replaced, or `undefined` when the input is empty.
|
|
800
|
+
*/
|
|
801
|
+
transform(value: string | undefined, regexValue: string, replaceValue: string): SafeHtml | undefined;
|
|
627
802
|
static ɵfac: i0.ɵɵFactoryDeclaration<ReplacePipe, never>;
|
|
628
803
|
static ɵpipe: i0.ɵɵPipeDeclaration<ReplacePipe, "replace", true>;
|
|
629
804
|
}
|
|
630
805
|
|
|
806
|
+
/**
|
|
807
|
+
* General-purpose formatting pipe that converts a raw value to a locale-aware string
|
|
808
|
+
* based on the specified format type.
|
|
809
|
+
*
|
|
810
|
+
* Supported types: `'date'` / `'D'`, `'currency'` / `'C'`, `'number'` / `'N'`,
|
|
811
|
+
* `'number0'` / `'N0'`, `'percentage'` / `'P'`.
|
|
812
|
+
*
|
|
813
|
+
* Usage: `{{ value | format:'currency' }}`
|
|
814
|
+
*/
|
|
631
815
|
declare class FormatPipe implements PipeTransform {
|
|
816
|
+
/**
|
|
817
|
+
* Formats a value according to the specified type and optional pattern.
|
|
818
|
+
* Returns `undefined` when the value is `null` or `undefined`, or when the type is unrecognised.
|
|
819
|
+
* @param value - The raw value to format.
|
|
820
|
+
* @param type - The format type identifier (default: `'date'`).
|
|
821
|
+
* @param pattern - The date pattern used when `type` is `'date'` (default: `'dd/MM/yyyy'`).
|
|
822
|
+
* @returns A formatted string, or `undefined` when the value cannot be formatted.
|
|
823
|
+
*/
|
|
632
824
|
transform(value?: unknown, type?: string, pattern?: string): string | undefined;
|
|
633
825
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormatPipe, never>;
|
|
634
826
|
static ɵpipe: i0.ɵɵPipeDeclaration<FormatPipe, "format", true>;
|
|
635
827
|
}
|
|
636
828
|
|
|
829
|
+
/**
|
|
830
|
+
* Pipe that converts plain-text newlines (`\r\n`, `\r`, `\n`) to HTML `<br>` tags
|
|
831
|
+
* and marks the result as trusted HTML so Angular does not escape it.
|
|
832
|
+
*
|
|
833
|
+
* Usage: `{{ text | formatHtml }}`
|
|
834
|
+
*/
|
|
637
835
|
declare class FormatHtmlPipe implements PipeTransform {
|
|
638
836
|
private readonly sanitizer;
|
|
837
|
+
/**
|
|
838
|
+
* Transforms a plain-text string into sanitized HTML by replacing newline characters
|
|
839
|
+
* with `<br>` tags.
|
|
840
|
+
* @param value - The input string to transform. Treated as an empty string when `undefined`.
|
|
841
|
+
* @returns A `SafeHtml` value that can be rendered with `[innerHTML]`.
|
|
842
|
+
*/
|
|
639
843
|
transform(value?: string): SafeHtml;
|
|
640
844
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormatHtmlPipe, never>;
|
|
641
845
|
static ɵpipe: i0.ɵɵPipeDeclaration<FormatHtmlPipe, "formatHtml", true>;
|
|
642
846
|
}
|
|
643
847
|
|
|
848
|
+
/**
|
|
849
|
+
* Directive that copies a string payload to the clipboard when the host element is clicked.
|
|
850
|
+
* Bind `[copyClipboard]="text"` to provide the content to copy and listen to `(copied)` for confirmation.
|
|
851
|
+
*/
|
|
644
852
|
declare class CopyClipboardDirective {
|
|
853
|
+
/** The text to copy to the clipboard. Bound via the `copyClipboard` attribute. */
|
|
645
854
|
readonly payload: i0.InputSignal<string>;
|
|
855
|
+
/** Emits the copied text after a successful copy operation. */
|
|
646
856
|
readonly copied: i0.OutputEmitterRef<string>;
|
|
857
|
+
/**
|
|
858
|
+
* Handles click events on the host element and copies the payload to the clipboard.
|
|
859
|
+
* Emits `copied` with the copied text on success.
|
|
860
|
+
* @param e - The mouse click event.
|
|
861
|
+
*/
|
|
647
862
|
onClick(e: MouseEvent): void;
|
|
648
863
|
static ɵfac: i0.ɵɵFactoryDeclaration<CopyClipboardDirective, never>;
|
|
649
864
|
static ɵdir: i0.ɵɵDirectiveDeclaration<CopyClipboardDirective, "[copyClipboard]", never, { "payload": { "alias": "copyClipboard"; "required": false; "isSignal": true; }; }, { "copied": "copied"; }, never, never, true, never>;
|
|
650
865
|
}
|
|
651
866
|
|
|
652
|
-
|
|
867
|
+
/**
|
|
868
|
+
* Directive that moves browser focus to the host element after the first render cycle.
|
|
869
|
+
* Apply `autoFocus` to any focusable element to set focus automatically on initialisation.
|
|
870
|
+
*/
|
|
871
|
+
declare class AutoFocusDirective {
|
|
653
872
|
private readonly elementRef;
|
|
654
|
-
|
|
873
|
+
constructor();
|
|
655
874
|
static ɵfac: i0.ɵɵFactoryDeclaration<AutoFocusDirective, never>;
|
|
656
875
|
static ɵdir: i0.ɵɵDirectiveDeclaration<AutoFocusDirective, "[autoFocus]", never, {}, {}, never, never, true, never>;
|
|
657
876
|
}
|
|
658
877
|
|
|
878
|
+
/**
|
|
879
|
+
* Directive that validates that a control value does not exceed a maximum word count.
|
|
880
|
+
* Bind `[maxTerms]="10"` to allow at most 10 whitespace-separated terms.
|
|
881
|
+
*/
|
|
882
|
+
declare class MaxTermsValidatorDirective implements Validator {
|
|
883
|
+
/** The maximum number of whitespace-separated terms allowed. */
|
|
884
|
+
readonly maxTerms: i0.InputSignal<number>;
|
|
885
|
+
/**
|
|
886
|
+
* Validates that the control value contains no more than the configured number of terms.
|
|
887
|
+
* Returns `null` when the control is empty.
|
|
888
|
+
* @param control - The form control to validate.
|
|
889
|
+
*/
|
|
890
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
891
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MaxTermsValidatorDirective, never>;
|
|
892
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MaxTermsValidatorDirective, "[maxTerms]", never, { "maxTerms": { "alias": "maxTerms"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
893
|
+
}
|
|
894
|
+
|
|
659
895
|
declare const Breakpoints: {
|
|
660
896
|
XXSmall: string;
|
|
661
897
|
XSmall: string;
|
|
@@ -673,291 +909,378 @@ declare const UtilsMessages: {
|
|
|
673
909
|
UTILS_DIALOGS_SELECT_OPTIONS_CHANGED: string;
|
|
674
910
|
};
|
|
675
911
|
|
|
912
|
+
/**
|
|
913
|
+
* Generic selection model that tracks a set of selected items identified by a lookup field.
|
|
914
|
+
* Wraps Angular CDK's `SelectionModel` and adds lookup-based add/remove logic.
|
|
915
|
+
*
|
|
916
|
+
* @typeParam T - The item type held in the selection.
|
|
917
|
+
* @typeParam V - The type of the lookup key used to identify items.
|
|
918
|
+
*/
|
|
676
919
|
declare class SelectableModel<T, V> {
|
|
920
|
+
/**
|
|
921
|
+
* Emits whenever the selection changes.
|
|
922
|
+
* Carries the affected item, or `undefined` when the whole selection is cleared.
|
|
923
|
+
*/
|
|
677
924
|
readonly changed: EventEmitter<T>;
|
|
678
|
-
private _all;
|
|
925
|
+
private readonly _all;
|
|
926
|
+
/**
|
|
927
|
+
* Snapshot of all items currently tracked by this model (selected or previously toggled).
|
|
928
|
+
* Backed by a signal — reads are always up to date.
|
|
929
|
+
*/
|
|
679
930
|
get all(): T[];
|
|
680
|
-
private _current;
|
|
931
|
+
private readonly _current;
|
|
932
|
+
/** The underlying CDK `SelectionModel` (provides `.selected`, `.isSelected`, etc.). */
|
|
681
933
|
get current(): SelectionModel<T>;
|
|
682
|
-
private _lookupFieldName;
|
|
934
|
+
private readonly _lookupFieldName;
|
|
935
|
+
/** Signal that is `true` when at least one item is selected. */
|
|
936
|
+
readonly hasValue: i0.Signal<boolean>;
|
|
937
|
+
/**
|
|
938
|
+
* @param allowMultiSelect - When `true` (default), multiple items can be selected simultaneously.
|
|
939
|
+
* @param lookupFieldName - Name of the property used as the unique key when searching the internal list (default: `'id'`).
|
|
940
|
+
*/
|
|
683
941
|
constructor(allowMultiSelect?: boolean, lookupFieldName?: string);
|
|
684
942
|
/**
|
|
685
|
-
*
|
|
686
|
-
*
|
|
687
|
-
* @param
|
|
943
|
+
* Toggles the CDK selection state of an item that already exists in the tracked list.
|
|
944
|
+
* Has no effect when `lookupValue` does not match any tracked item.
|
|
945
|
+
* @param item - The item whose selection state should be toggled.
|
|
946
|
+
* @param lookupValue - The key value used to locate the item in the internal list.
|
|
688
947
|
*/
|
|
689
948
|
updateCurrent(item: T, lookupValue: V): void;
|
|
690
949
|
/**
|
|
691
|
-
*
|
|
692
|
-
*
|
|
693
|
-
* @param
|
|
950
|
+
* Toggles an item in both the internal list and the CDK selection.
|
|
951
|
+
* Adds the item when it is not yet tracked; removes it when it is.
|
|
952
|
+
* @param item - The item to toggle.
|
|
953
|
+
* @param lookupValue - The key value used to locate or register the item.
|
|
694
954
|
*/
|
|
695
955
|
toggle(item: T, lookupValue?: V): void;
|
|
696
956
|
/**
|
|
697
|
-
*
|
|
698
|
-
* @param item
|
|
699
|
-
* @param lookupValue
|
|
957
|
+
* Adds an item to the internal list (when not already present) and marks it as selected.
|
|
958
|
+
* @param item - The item to select.
|
|
959
|
+
* @param lookupValue - The key value used to locate or register the item.
|
|
700
960
|
*/
|
|
701
961
|
select(item: T, lookupValue?: V): void;
|
|
702
962
|
/**
|
|
703
|
-
*
|
|
704
|
-
*
|
|
705
|
-
* @param
|
|
963
|
+
* Removes an item from the internal list and deselects it in the CDK model.
|
|
964
|
+
* Has no effect when the item is not currently tracked.
|
|
965
|
+
* @param item - The item to deselect.
|
|
966
|
+
* @param lookupValue - The key value used to locate the item in the internal list.
|
|
706
967
|
*/
|
|
707
968
|
deselect(item: T, lookupValue?: V): void;
|
|
708
969
|
/**
|
|
709
|
-
*
|
|
710
|
-
* @param lookupValues
|
|
970
|
+
* Deselects all items whose lookup key is contained in `lookupValues`.
|
|
971
|
+
* @param lookupValues - Array of key values identifying the items to deselect.
|
|
711
972
|
*/
|
|
712
973
|
deselectByValues(lookupValues: V[]): void;
|
|
713
974
|
/**
|
|
714
|
-
*
|
|
715
|
-
*
|
|
975
|
+
* Runs `clearFunc` against every currently selected item, then clears the CDK selection.
|
|
976
|
+
* The internal tracked list is **not** affected; only the CDK selection is cleared.
|
|
977
|
+
* @param clearFunc - Callback invoked for each currently selected item before clearing.
|
|
716
978
|
*/
|
|
717
979
|
clearCurrent(clearFunc: (item: T) => void): void;
|
|
718
980
|
/**
|
|
719
|
-
*
|
|
981
|
+
* Clears both the internal tracked list and the CDK selection.
|
|
720
982
|
*/
|
|
721
983
|
clear(): void;
|
|
722
984
|
/**
|
|
723
|
-
*
|
|
724
|
-
* @param lookupValue
|
|
725
|
-
* @returns : true if the value is selected
|
|
985
|
+
* Returns `true` when the item identified by `lookupValue` is present in the tracked list.
|
|
986
|
+
* @param lookupValue - The key value to look up.
|
|
726
987
|
*/
|
|
727
988
|
isSelected(lookupValue?: V): boolean;
|
|
728
|
-
/**
|
|
729
|
-
* Checks if a selection exists
|
|
730
|
-
* @returns : true if at least one selection exists
|
|
731
|
-
*/
|
|
732
|
-
hasValue(): boolean;
|
|
733
989
|
}
|
|
734
990
|
|
|
735
991
|
/**
|
|
736
992
|
* Standard Broadcast Messages Manager
|
|
737
993
|
* https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel
|
|
738
994
|
*/
|
|
739
|
-
/**
|
|
740
|
-
* The message bag sent as a message
|
|
741
|
-
*/
|
|
995
|
+
/** The typed message payload exchanged over the broadcast channel. */
|
|
742
996
|
interface BroadcastChannelMessageBag<T> {
|
|
997
|
+
/** Unique identifier for the message type. */
|
|
743
998
|
messageId: string;
|
|
999
|
+
/** Identifier of the sender. */
|
|
744
1000
|
sender: string;
|
|
1001
|
+
/** Optional typed data attached to the message. */
|
|
745
1002
|
data?: T;
|
|
746
1003
|
}
|
|
747
|
-
/**
|
|
748
|
-
* Message subscription params
|
|
749
|
-
*/
|
|
1004
|
+
/** Subscription descriptor that pairs a message type identifier with its handler. */
|
|
750
1005
|
interface BroadcastChannelSubscriberInfo<T> {
|
|
1006
|
+
/** The message type identifier to listen for. */
|
|
751
1007
|
messageId: string;
|
|
1008
|
+
/** Callback invoked with the full message bag when a matching message is received. */
|
|
752
1009
|
action: (bag: BroadcastChannelMessageBag<T>) => void;
|
|
753
1010
|
}
|
|
754
1011
|
/**
|
|
755
|
-
* Web
|
|
756
|
-
*
|
|
1012
|
+
* Wrapper around the native Web `BroadcastChannel` API that adds typed messaging,
|
|
1013
|
+
* multiple named subscriptions, and a graceful disposal mechanism.
|
|
1014
|
+
*
|
|
1015
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel
|
|
757
1016
|
*/
|
|
758
1017
|
declare class BroadcastChannelManager {
|
|
759
1018
|
private channel?;
|
|
760
1019
|
private readonly subject;
|
|
761
1020
|
private subscriptions;
|
|
762
1021
|
/**
|
|
763
|
-
*
|
|
1022
|
+
* The name of the underlying `BroadcastChannel`, or `undefined` when the API
|
|
1023
|
+
* is not supported by the current browser.
|
|
764
1024
|
*/
|
|
765
1025
|
get currentBus(): string | undefined;
|
|
1026
|
+
/**
|
|
1027
|
+
* Opens a `BroadcastChannel` with the given name (when the API is available).
|
|
1028
|
+
* @param bus - The channel name to open (default: `'ARS-CHANNEL'`).
|
|
1029
|
+
*/
|
|
766
1030
|
constructor(bus?: string);
|
|
1031
|
+
/**
|
|
1032
|
+
* Closes the underlying channel and completes the internal subject after a short delay
|
|
1033
|
+
* to allow any in-flight messages to be delivered.
|
|
1034
|
+
*/
|
|
767
1035
|
dispose(): void;
|
|
768
1036
|
/**
|
|
769
|
-
*
|
|
770
|
-
* @param bag The message
|
|
771
|
-
*
|
|
1037
|
+
* Sends a typed message bag immediately.
|
|
1038
|
+
* @param bag - The message bag to send.
|
|
772
1039
|
* @example
|
|
773
|
-
* channel.sendMessage({ messageId: 'my-
|
|
1040
|
+
* channel.sendMessage({ messageId: 'my-message', sender: 'me', data: value });
|
|
774
1041
|
*/
|
|
775
1042
|
sendMessage<T>(bag: BroadcastChannelMessageBag<T>): void;
|
|
776
1043
|
/**
|
|
777
|
-
*
|
|
778
|
-
* @param bag The message
|
|
779
|
-
* @param delay
|
|
780
|
-
*
|
|
1044
|
+
* Sends a typed message bag after an optional delay.
|
|
1045
|
+
* @param bag - The message bag to send.
|
|
1046
|
+
* @param delay - Milliseconds to wait before posting the message.
|
|
781
1047
|
* @example
|
|
782
|
-
* channel.sendMessage({ messageId: 'my-
|
|
1048
|
+
* channel.sendMessage({ messageId: 'my-message', sender: 'me', data: value }, 250);
|
|
783
1049
|
*/
|
|
784
1050
|
sendMessage<T>(bag: BroadcastChannelMessageBag<T>, delay?: number): void;
|
|
785
1051
|
/**
|
|
786
|
-
*
|
|
787
|
-
* @param messageId The message
|
|
788
|
-
* @param data
|
|
789
|
-
*
|
|
1052
|
+
* Sends a message identified by a string ID with optional data.
|
|
1053
|
+
* @param messageId - The message type identifier.
|
|
1054
|
+
* @param data - Optional typed payload.
|
|
790
1055
|
* @example
|
|
791
|
-
* channel.sendMessage('my-
|
|
1056
|
+
* channel.sendMessage('my-message', value);
|
|
792
1057
|
*/
|
|
793
1058
|
sendMessage<T>(messageId: string, data?: T): void;
|
|
794
1059
|
/**
|
|
795
|
-
*
|
|
796
|
-
* @param messageId The message
|
|
797
|
-
* @param data
|
|
798
|
-
* @param delay
|
|
799
|
-
*
|
|
1060
|
+
* Sends a message identified by a string ID with optional data after an optional delay.
|
|
1061
|
+
* @param messageId - The message type identifier.
|
|
1062
|
+
* @param data - Optional typed payload.
|
|
1063
|
+
* @param delay - Milliseconds to wait before posting the message.
|
|
800
1064
|
* @example
|
|
801
|
-
* channel.sendMessage('my-
|
|
1065
|
+
* channel.sendMessage('my-message', value, 250);
|
|
802
1066
|
*/
|
|
803
1067
|
sendMessage<T>(messageId: string, data?: T, delay?: number): void;
|
|
804
1068
|
/**
|
|
805
|
-
*
|
|
806
|
-
*
|
|
1069
|
+
* Registers a handler for messages with the given `messageId`.
|
|
1070
|
+
* If a handler for the same `messageId` is already registered it is replaced.
|
|
1071
|
+
* @param args - The subscription descriptor containing the message ID and handler.
|
|
807
1072
|
*/
|
|
808
1073
|
subscribe<T>(args: BroadcastChannelSubscriberInfo<T>): void;
|
|
809
1074
|
/**
|
|
810
|
-
*
|
|
811
|
-
* @param messageId The message
|
|
1075
|
+
* Removes the subscription for the given message ID, if one exists.
|
|
1076
|
+
* @param messageId - The message type identifier whose subscription should be removed.
|
|
812
1077
|
*/
|
|
813
1078
|
unsubscribe(messageId: string): void;
|
|
814
1079
|
/**
|
|
815
|
-
*
|
|
1080
|
+
* Removes all registered subscriptions.
|
|
816
1081
|
*/
|
|
817
1082
|
unsubscribeAll(): void;
|
|
818
1083
|
}
|
|
819
1084
|
|
|
1085
|
+
/** Payload carried by every in-process broadcast message. */
|
|
820
1086
|
interface BroadcastMessageInfo {
|
|
1087
|
+
/** Unique identifier for the message type. */
|
|
821
1088
|
id: string;
|
|
1089
|
+
/** Optional data attached to the message. */
|
|
822
1090
|
data?: any;
|
|
823
1091
|
}
|
|
1092
|
+
/**
|
|
1093
|
+
* Application-level messaging service that combines two transports:
|
|
1094
|
+
* - An in-process RxJS `Subject` for same-tab communication (`sendMessage` / `getMessage`).
|
|
1095
|
+
* - A native `BroadcastChannel` for cross-tab communication (`sendChannelMessage` / `subscribeChannelMessage`).
|
|
1096
|
+
*/
|
|
824
1097
|
declare class BroadcastService implements OnDestroy {
|
|
825
1098
|
private readonly subject;
|
|
826
1099
|
private readonly channel;
|
|
827
1100
|
/**
|
|
828
|
-
*
|
|
1101
|
+
* Creates a new standalone `BroadcastChannelManager` instance bound to the shared ARS channel.
|
|
1102
|
+
* Useful when a caller needs direct channel access outside the service.
|
|
1103
|
+
* @returns A new `BroadcastChannelManager` connected to `'ARS-CHANNEL'`.
|
|
829
1104
|
*/
|
|
830
1105
|
static GetChannel(): BroadcastChannelManager;
|
|
831
1106
|
ngOnDestroy(): void;
|
|
832
1107
|
/**
|
|
833
|
-
*
|
|
834
|
-
* @param id
|
|
835
|
-
* @param data
|
|
836
|
-
* @param delay
|
|
1108
|
+
* Publishes a message to the in-process subject, optionally after a delay.
|
|
1109
|
+
* @param id - The message type identifier.
|
|
1110
|
+
* @param data - Optional payload to attach to the message.
|
|
1111
|
+
* @param delay - Milliseconds to wait before publishing (default: `0`).
|
|
837
1112
|
*/
|
|
838
1113
|
sendMessage(id: string, data?: any, delay?: number): void;
|
|
839
1114
|
/**
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
1115
|
+
* Publishes a typed message over the native `BroadcastChannel` (cross-tab), optionally after a delay.
|
|
1116
|
+
* @param id - The message type identifier.
|
|
1117
|
+
* @param data - Optional typed payload to send.
|
|
1118
|
+
* @param delay - Milliseconds to wait before sending (forwarded to the channel manager).
|
|
1119
|
+
*/
|
|
845
1120
|
sendChannelMessage<T>(id: string, data?: T, delay?: number): void;
|
|
846
1121
|
/**
|
|
847
|
-
*
|
|
848
|
-
* @param id
|
|
849
|
-
* @param action
|
|
1122
|
+
* Registers a handler that is invoked whenever a channel message with the given `id` is received.
|
|
1123
|
+
* @param id - The message type identifier to listen for.
|
|
1124
|
+
* @param action - Callback invoked with the full `BroadcastChannelMessageBag` when a matching message arrives.
|
|
850
1125
|
*/
|
|
851
1126
|
subscribeChannelMessage<T>(id: string, action: (bag: BroadcastChannelMessageBag<T>) => void): void;
|
|
852
1127
|
/**
|
|
853
|
-
*
|
|
854
|
-
* @returns
|
|
1128
|
+
* Returns an `Observable` that emits every in-process message published via `sendMessage`.
|
|
1129
|
+
* @returns An observable stream of `BroadcastMessageInfo` objects.
|
|
855
1130
|
*/
|
|
856
1131
|
getMessage(): Observable<BroadcastMessageInfo>;
|
|
857
1132
|
static ɵfac: i0.ɵɵFactoryDeclaration<BroadcastService, never>;
|
|
858
1133
|
static ɵprov: i0.ɵɵInjectableDeclaration<BroadcastService>;
|
|
859
1134
|
}
|
|
860
1135
|
|
|
1136
|
+
/**
|
|
1137
|
+
* Application-wide environment configuration service.
|
|
1138
|
+
* Exposes writable signals for the base URIs used throughout the application.
|
|
1139
|
+
* Values should be set once during application bootstrap (e.g. in `APP_INITIALIZER`).
|
|
1140
|
+
*/
|
|
861
1141
|
declare class EnvironmentService {
|
|
862
|
-
|
|
1142
|
+
/** Writable signal holding the base URI of the frontend application (e.g. `https://app.example.com`). */
|
|
1143
|
+
readonly appUriSignal: i0.WritableSignal<string>;
|
|
1144
|
+
/** Writable signal holding the base URI of the backend API service (e.g. `https://api.example.com`). */
|
|
1145
|
+
readonly appServiceUriSignal: i0.WritableSignal<string>;
|
|
1146
|
+
/**
|
|
1147
|
+
* Writable signal holding the redirect URI used after login.
|
|
1148
|
+
* When empty, `appLoginRedirectUri` falls back to `appUri`.
|
|
1149
|
+
*/
|
|
1150
|
+
readonly appLoginRedirectUriSignal: i0.WritableSignal<string>;
|
|
1151
|
+
/**
|
|
1152
|
+
* Writable signal holding the login endpoint URI of the backend service.
|
|
1153
|
+
* When empty, `appServiceLoginUri` falls back to `appServiceUri`.
|
|
1154
|
+
*/
|
|
1155
|
+
readonly appServiceLoginUriSignal: i0.WritableSignal<string>;
|
|
1156
|
+
private readonly _effectiveLoginRedirectUri;
|
|
1157
|
+
private readonly _effectiveServiceLoginUri;
|
|
1158
|
+
/** Base URI of the frontend application. */
|
|
863
1159
|
get appUri(): string;
|
|
1160
|
+
/** @param value - The base URI of the frontend application. */
|
|
864
1161
|
set appUri(value: string);
|
|
865
|
-
|
|
1162
|
+
/** Base URI of the backend API service. */
|
|
866
1163
|
get appServiceUri(): string;
|
|
1164
|
+
/** @param value - The base URI of the backend API service. */
|
|
867
1165
|
set appServiceUri(value: string);
|
|
868
|
-
|
|
1166
|
+
/**
|
|
1167
|
+
* Effective login redirect URI.
|
|
1168
|
+
* Returns the explicitly set value, or falls back to `appUri` when empty.
|
|
1169
|
+
*/
|
|
869
1170
|
get appLoginRedirectUri(): string;
|
|
1171
|
+
/** @param value - The redirect URI to use after login. */
|
|
870
1172
|
set appLoginRedirectUri(value: string);
|
|
871
|
-
|
|
1173
|
+
/**
|
|
1174
|
+
* Effective service login URI.
|
|
1175
|
+
* Returns the explicitly set value, or falls back to `appServiceUri` when empty.
|
|
1176
|
+
*/
|
|
872
1177
|
get appServiceLoginUri(): string;
|
|
1178
|
+
/** @param value - The login endpoint URI of the backend service. */
|
|
873
1179
|
set appServiceLoginUri(value: string);
|
|
874
1180
|
static ɵfac: i0.ɵɵFactoryDeclaration<EnvironmentService, never>;
|
|
875
1181
|
static ɵprov: i0.ɵɵInjectableDeclaration<EnvironmentService>;
|
|
876
1182
|
}
|
|
877
1183
|
|
|
1184
|
+
/**
|
|
1185
|
+
* Service that exposes reactive screen and device-capability information.
|
|
1186
|
+
*/
|
|
878
1187
|
declare class ScreenService {
|
|
1188
|
+
/**
|
|
1189
|
+
* Writable signal that holds the current Material breakpoint alias
|
|
1190
|
+
* (e.g. `'xs'`, `'sm'`, `'md'`, `'lg'`, `'xl'`).
|
|
1191
|
+
* Updated externally by the breakpoint observer in the consuming component or module.
|
|
1192
|
+
*/
|
|
879
1193
|
readonly mq: i0.WritableSignal<string>;
|
|
1194
|
+
/**
|
|
1195
|
+
* Returns `true` when the primary input mechanism can hover over elements
|
|
1196
|
+
* with coarse pointer precision (i.e. a touch screen).
|
|
1197
|
+
*/
|
|
880
1198
|
get isTouchable(): boolean;
|
|
1199
|
+
/**
|
|
1200
|
+
* Returns `true` when the current browser is Internet Explorer or the legacy Edge (EdgeHTML).
|
|
1201
|
+
* Modern Chromium-based Edge reports a different user-agent and will return `false`.
|
|
1202
|
+
*/
|
|
881
1203
|
get isIEOrEdge(): boolean;
|
|
882
1204
|
static ɵfac: i0.ɵɵFactoryDeclaration<ScreenService, never>;
|
|
883
1205
|
static ɵprov: i0.ɵɵInjectableDeclaration<ScreenService>;
|
|
884
1206
|
}
|
|
885
1207
|
|
|
1208
|
+
/** The three available theme modes: follow system preference, force light, or force dark. */
|
|
1209
|
+
type ThemeType = 'auto' | 'light' | 'dark';
|
|
886
1210
|
/**
|
|
887
|
-
*
|
|
1211
|
+
* Application-level theme management service.
|
|
1212
|
+
*
|
|
1213
|
+
* Responsibilities:
|
|
1214
|
+
* - Persists the user's preferred theme in `localStorage`.
|
|
1215
|
+
* - Applies `'light'` or `'dark'` CSS class to `<body>`.
|
|
1216
|
+
* - Reacts to OS-level colour-scheme changes when the theme is set to `'auto'`.
|
|
1217
|
+
* - Synchronises theme changes across browser tabs via `BroadcastChannel`.
|
|
1218
|
+
* - Exposes reactive signals (`themeIcon`, `themeName`, `toggleTooltip`) for the UI.
|
|
888
1219
|
*/
|
|
889
|
-
type ThemeType = 'auto' | 'light' | 'dark';
|
|
890
1220
|
declare class ThemeService implements OnDestroy {
|
|
891
1221
|
private readonly broadcastChannel;
|
|
892
1222
|
private readonly broadcastMessage;
|
|
893
1223
|
private readonly prefersColorSchemeMediaQueryList;
|
|
894
1224
|
/**
|
|
895
|
-
*
|
|
896
|
-
*
|
|
1225
|
+
* Observable that emits the resolved (`'light'` or `'dark'`) theme whenever it changes.
|
|
1226
|
+
* Useful for components that cannot consume signals directly (e.g. class-based guards).
|
|
897
1227
|
* @example
|
|
898
|
-
*
|
|
899
|
-
*
|
|
900
|
-
*
|
|
901
|
-
* .subscribe((value: ThemeType) => {
|
|
902
|
-
* // do the job done....
|
|
903
|
-
* });
|
|
1228
|
+
* this.themeService.changed
|
|
1229
|
+
* .pipe(takeUntilDestroyed(this.destroyRef))
|
|
1230
|
+
* .subscribe(theme => { ... });
|
|
904
1231
|
*/
|
|
1232
|
+
readonly changed: Observable<ThemeType>;
|
|
905
1233
|
private readonly themeChanged;
|
|
906
|
-
changed: Observable<ThemeType>;
|
|
907
1234
|
private readonly renderFactory2;
|
|
908
1235
|
private readonly renderer;
|
|
909
|
-
/**
|
|
910
|
-
* Current theme
|
|
911
|
-
*/
|
|
1236
|
+
/** The currently selected `ThemeType` (may be `'auto'`). */
|
|
912
1237
|
private readonly theme;
|
|
913
|
-
/**
|
|
914
|
-
* The current theme is "System default"
|
|
915
|
-
*/
|
|
1238
|
+
/** `true` when the theme is set to follow the system preference. */
|
|
916
1239
|
private readonly auto;
|
|
917
|
-
/**
|
|
918
|
-
* Configuration schema about the icon, the text and the toggle() sequence
|
|
919
|
-
*/
|
|
920
1240
|
private readonly themeInfo;
|
|
921
|
-
/**
|
|
922
|
-
* Icon of the current theme (mat-icon code)
|
|
923
|
-
*/
|
|
1241
|
+
/** Reactive Material icon code for the current theme (use with `<mat-icon>`). */
|
|
924
1242
|
readonly themeIcon: Signal<string>;
|
|
925
|
-
/**
|
|
926
|
-
* Current theme name
|
|
927
|
-
*/
|
|
1243
|
+
/** Reactive human-readable name of the current theme. */
|
|
928
1244
|
readonly themeName: Signal<string>;
|
|
929
|
-
/**
|
|
930
|
-
* Tooltip text on toggle
|
|
931
|
-
*/
|
|
1245
|
+
/** Reactive tooltip text for the theme toggle button. */
|
|
932
1246
|
readonly toggleTooltip: Signal<string>;
|
|
1247
|
+
constructor();
|
|
933
1248
|
/**
|
|
934
|
-
*
|
|
1249
|
+
* Initialises the service: loads the preferred theme, registers OS-change listener,
|
|
1250
|
+
* and subscribes to cross-tab broadcast messages.
|
|
1251
|
+
* Call this once during application bootstrap (e.g. in `APP_INITIALIZER`).
|
|
1252
|
+
* @param theme - The initial theme to apply (defaults to the value stored in `localStorage`).
|
|
935
1253
|
*/
|
|
936
1254
|
initialize(theme?: ThemeType): void;
|
|
937
1255
|
ngOnDestroy(): void;
|
|
938
1256
|
/**
|
|
939
|
-
*
|
|
1257
|
+
* Advances the theme through the cycle: `auto` → `light` → `dark` → `auto`.
|
|
940
1258
|
*/
|
|
941
|
-
|
|
1259
|
+
toggleTheme(): void;
|
|
942
1260
|
/**
|
|
943
|
-
*
|
|
944
|
-
*
|
|
945
|
-
* @returns
|
|
1261
|
+
* Returns the resolved effective theme (`'light'` or `'dark'`), taking the OS preference
|
|
1262
|
+
* into account when the current mode is `'auto'`.
|
|
1263
|
+
* @returns `'light'` or `'dark'` — never `'auto'`.
|
|
946
1264
|
*/
|
|
947
|
-
|
|
1265
|
+
getTheme(): ThemeType;
|
|
948
1266
|
/**
|
|
949
|
-
*
|
|
950
|
-
*
|
|
1267
|
+
* Reads the theme stored in `localStorage` and validates it.
|
|
1268
|
+
* Falls back to `'auto'` when the stored value is missing or invalid.
|
|
1269
|
+
* @returns The persisted `ThemeType`, or `'auto'` as default.
|
|
951
1270
|
*/
|
|
952
|
-
private
|
|
1271
|
+
private getPreferredTheme;
|
|
953
1272
|
/**
|
|
954
|
-
*
|
|
1273
|
+
* Returns `true` when `value` is a valid `ThemeType` string.
|
|
1274
|
+
* Acts as a TypeScript type guard.
|
|
1275
|
+
* @param value - The string to check.
|
|
955
1276
|
*/
|
|
956
|
-
|
|
1277
|
+
private isTheme;
|
|
957
1278
|
/**
|
|
958
|
-
*
|
|
1279
|
+
* Applies the given theme to `<body>` (CSS class), persists it to `localStorage`,
|
|
1280
|
+
* notifies the `changed` observable, and broadcasts the change to other tabs.
|
|
1281
|
+
* @param theme - The `ThemeType` to apply (defaults to `'auto'`).
|
|
959
1282
|
*/
|
|
960
|
-
|
|
1283
|
+
private setTheme;
|
|
961
1284
|
static ɵfac: i0.ɵɵFactoryDeclaration<ThemeService, never>;
|
|
962
1285
|
static ɵprov: i0.ɵɵInjectableDeclaration<ThemeService>;
|
|
963
1286
|
}
|
|
@@ -969,36 +1292,138 @@ declare class ArsCoreModule {
|
|
|
969
1292
|
}
|
|
970
1293
|
|
|
971
1294
|
declare const MAT_DATE_FNS_FORMATS: MatDateFormats;
|
|
972
|
-
/**
|
|
1295
|
+
/**
|
|
1296
|
+
* date-fns adapter that integrates Angular Material's date picker with the date-fns library,
|
|
1297
|
+
* applying `Europe/Rome` timezone for all parsed and created dates.
|
|
1298
|
+
*/
|
|
973
1299
|
declare class DateFnsAdapter extends DateAdapter<Date, Locale> {
|
|
974
1300
|
constructor(...args: unknown[]);
|
|
1301
|
+
/**
|
|
1302
|
+
* Returns the year component of the given date.
|
|
1303
|
+
* @param date - The source date.
|
|
1304
|
+
*/
|
|
975
1305
|
getYear(date: Date): number;
|
|
1306
|
+
/**
|
|
1307
|
+
* Returns the zero-based month index of the given date (0 = January).
|
|
1308
|
+
* @param date - The source date.
|
|
1309
|
+
*/
|
|
976
1310
|
getMonth(date: Date): number;
|
|
1311
|
+
/**
|
|
1312
|
+
* Returns the day-of-month of the given date (1-based).
|
|
1313
|
+
* @param date - The source date.
|
|
1314
|
+
*/
|
|
977
1315
|
getDate(date: Date): number;
|
|
1316
|
+
/**
|
|
1317
|
+
* Returns the day-of-week of the given date (0 = Sunday).
|
|
1318
|
+
* @param date - The source date.
|
|
1319
|
+
*/
|
|
978
1320
|
getDayOfWeek(date: Date): number;
|
|
1321
|
+
/**
|
|
1322
|
+
* Returns an array of 12 month name strings formatted for the active locale.
|
|
1323
|
+
* @param style - One of `'long'`, `'short'`, or `'narrow'`.
|
|
1324
|
+
*/
|
|
979
1325
|
getMonthNames(style: 'long' | 'short' | 'narrow'): string[];
|
|
1326
|
+
/**
|
|
1327
|
+
* Returns an array of 31 day-of-month label strings formatted using `Intl.DateTimeFormat`
|
|
1328
|
+
* when available, falling back to plain numeric strings.
|
|
1329
|
+
*/
|
|
980
1330
|
getDateNames(): string[];
|
|
1331
|
+
/**
|
|
1332
|
+
* Returns an array of 7 day-of-week name strings formatted for the active locale.
|
|
1333
|
+
* @param style - One of `'long'`, `'short'`, or `'narrow'`.
|
|
1334
|
+
*/
|
|
981
1335
|
getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[];
|
|
1336
|
+
/**
|
|
1337
|
+
* Returns the four-digit year string for the given date.
|
|
1338
|
+
* @param date - The source date.
|
|
1339
|
+
*/
|
|
982
1340
|
getYearName(date: Date): string;
|
|
1341
|
+
/**
|
|
1342
|
+
* Returns the first day of the week for the active locale (0 = Sunday, 1 = Monday, …).
|
|
1343
|
+
*/
|
|
983
1344
|
getFirstDayOfWeek(): number;
|
|
1345
|
+
/**
|
|
1346
|
+
* Returns the number of days in the month of the given date.
|
|
1347
|
+
* @param date - The source date.
|
|
1348
|
+
*/
|
|
984
1349
|
getNumDaysInMonth(date: Date): number;
|
|
1350
|
+
/**
|
|
1351
|
+
* Creates an independent copy of the given date.
|
|
1352
|
+
* @param date - The date to clone.
|
|
1353
|
+
*/
|
|
985
1354
|
clone(date: Date): Date;
|
|
1355
|
+
/**
|
|
1356
|
+
* Creates a `Date` in the `Europe/Rome` timezone for the given year, month, and day.
|
|
1357
|
+
* Throws an `Error` when any component is out of range.
|
|
1358
|
+
* @param year - Full four-digit year.
|
|
1359
|
+
* @param month - Zero-based month index (0 = January, 11 = December).
|
|
1360
|
+
* @param date - Day-of-month (1-based).
|
|
1361
|
+
*/
|
|
986
1362
|
createDate(year: number, month: number, date: number): Date;
|
|
1363
|
+
/**
|
|
1364
|
+
* Returns today's date in the local timezone.
|
|
1365
|
+
*/
|
|
987
1366
|
today(): Date;
|
|
1367
|
+
/**
|
|
1368
|
+
* Parses a value into a `Date`.
|
|
1369
|
+
* - Strings are first attempted as ISO 8601, then matched against each format in `parseFormat`.
|
|
1370
|
+
* - Numbers are treated as Unix timestamps (milliseconds).
|
|
1371
|
+
* - Existing `Date` instances are cloned.
|
|
1372
|
+
* @param value - The value to parse.
|
|
1373
|
+
* @param parseFormat - A format string or an array of format strings (date-fns tokens).
|
|
1374
|
+
* @returns A valid `Date` in `Europe/Rome`, an invalid sentinel, or `null` for unrecognised input.
|
|
1375
|
+
*/
|
|
988
1376
|
parse(value: unknown, parseFormat: string | string[]): Date | null;
|
|
1377
|
+
/**
|
|
1378
|
+
* Formats a `Date` using the given date-fns display format string.
|
|
1379
|
+
* Throws an `Error` when `date` is not valid.
|
|
1380
|
+
* @param date - The date to format.
|
|
1381
|
+
* @param displayFormat - A date-fns format string (e.g. `'P'`, `'LLL uuuu'`).
|
|
1382
|
+
*/
|
|
989
1383
|
format(date: Date, displayFormat: string): string;
|
|
1384
|
+
/**
|
|
1385
|
+
* Adds the given number of whole years to a date.
|
|
1386
|
+
* @param date - The base date.
|
|
1387
|
+
* @param years - Number of years to add (can be negative).
|
|
1388
|
+
*/
|
|
990
1389
|
addCalendarYears(date: Date, years: number): Date;
|
|
1390
|
+
/**
|
|
1391
|
+
* Adds the given number of whole months to a date.
|
|
1392
|
+
* @param date - The base date.
|
|
1393
|
+
* @param months - Number of months to add (can be negative).
|
|
1394
|
+
*/
|
|
991
1395
|
addCalendarMonths(date: Date, months: number): Date;
|
|
1396
|
+
/**
|
|
1397
|
+
* Adds the given number of whole days to a date.
|
|
1398
|
+
* @param date - The base date.
|
|
1399
|
+
* @param days - Number of days to add (can be negative).
|
|
1400
|
+
*/
|
|
992
1401
|
addCalendarDays(date: Date, days: number): Date;
|
|
1402
|
+
/**
|
|
1403
|
+
* Serialises a date to an ISO 8601 date string (`yyyy-MM-dd`).
|
|
1404
|
+
* @param date - The date to serialise.
|
|
1405
|
+
*/
|
|
993
1406
|
toIso8601(date: Date): string;
|
|
994
1407
|
/**
|
|
995
|
-
* Returns the given value
|
|
996
|
-
*
|
|
997
|
-
*
|
|
1408
|
+
* Returns the given value when it is a valid `Date`, or `null` for an empty string.
|
|
1409
|
+
* Deserialises valid ISO 8601 strings into `Date` instances.
|
|
1410
|
+
* Delegates all other values to the base-class implementation.
|
|
1411
|
+
* @param value - The raw value to deserialise.
|
|
998
1412
|
*/
|
|
999
1413
|
deserialize(value: unknown): Date | null;
|
|
1414
|
+
/**
|
|
1415
|
+
* Returns `true` when `obj` is an instance of `Date`.
|
|
1416
|
+
* @param obj - The object to test.
|
|
1417
|
+
*/
|
|
1000
1418
|
isDateInstance(obj: unknown): boolean;
|
|
1419
|
+
/**
|
|
1420
|
+
* Returns `true` when `date` represents a valid point in time.
|
|
1421
|
+
* @param date - The date to validate.
|
|
1422
|
+
*/
|
|
1001
1423
|
isValid(date: Date): boolean;
|
|
1424
|
+
/**
|
|
1425
|
+
* Returns a sentinel `Date` that represents an invalid date (`new Date(NaN)`).
|
|
1426
|
+
*/
|
|
1002
1427
|
invalid(): Date;
|
|
1003
1428
|
static ɵfac: i0.ɵɵFactoryDeclaration<DateFnsAdapter, never>;
|
|
1004
1429
|
static ɵprov: i0.ɵɵInjectableDeclaration<DateFnsAdapter>;
|
|
@@ -1009,15 +1434,76 @@ declare class ArsDateFnsModule {
|
|
|
1009
1434
|
static ɵinj: i0.ɵɵInjectorDeclaration<ArsDateFnsModule>;
|
|
1010
1435
|
}
|
|
1011
1436
|
|
|
1437
|
+
/**
|
|
1438
|
+
* Directive that removes focus from the host element after it is clicked,
|
|
1439
|
+
* preventing the browser from keeping a visible focus ring post-interaction.
|
|
1440
|
+
* Apply `removeFocus` to any focusable element (e.g. a button).
|
|
1441
|
+
*/
|
|
1012
1442
|
declare class RemoveFocusDirective {
|
|
1013
1443
|
private readonly elementRef;
|
|
1014
|
-
|
|
1444
|
+
/**
|
|
1445
|
+
* Handles click events on the host element and blurs it on the next event-loop tick
|
|
1446
|
+
* so that the click action completes before focus is removed.
|
|
1447
|
+
*/
|
|
1448
|
+
onClick(): void;
|
|
1015
1449
|
static ɵfac: i0.ɵɵFactoryDeclaration<RemoveFocusDirective, never>;
|
|
1016
1450
|
static ɵdir: i0.ɵɵDirectiveDeclaration<RemoveFocusDirective, "[removeFocus]", never, {}, {}, never, never, true, never>;
|
|
1017
1451
|
}
|
|
1018
1452
|
|
|
1453
|
+
/**
|
|
1454
|
+
* Directive that validates that the host control's value is different from another control's value.
|
|
1455
|
+
* Bind `[notEqual]="otherControl"`.
|
|
1456
|
+
*/
|
|
1457
|
+
declare class NotEqualValidatorDirective implements Validator {
|
|
1458
|
+
/** The control whose value must differ from the host control's value. */
|
|
1459
|
+
readonly notEqual: i0.InputSignal<AbstractControl<any, any, any>>;
|
|
1460
|
+
/**
|
|
1461
|
+
* Validates that the host control value is not equal to the bound control's value.
|
|
1462
|
+
* Also clears the `notequal` error on the other control when the host becomes valid.
|
|
1463
|
+
* Returns `null` (valid) when no control is bound.
|
|
1464
|
+
* @param control - The form control to validate.
|
|
1465
|
+
*/
|
|
1466
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
1467
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NotEqualValidatorDirective, never>;
|
|
1468
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NotEqualValidatorDirective, "[notEqual]", never, { "notEqual": { "alias": "notEqual"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
/**
|
|
1472
|
+
* Directive that validates a time string against optional allowed time slot ranges.
|
|
1473
|
+
* Bind `[time]` and optionally `[slots]="'08:00-12:00|14:00-18:00'"` (pipe-separated ranges).
|
|
1474
|
+
*/
|
|
1475
|
+
declare class TimeValidatorDirective implements Validator {
|
|
1476
|
+
/** Optional pipe-separated list of allowed time ranges, e.g. `"08:00-12:00|14:00-18:00"`. */
|
|
1477
|
+
readonly slots: i0.InputSignal<string>;
|
|
1478
|
+
/**
|
|
1479
|
+
* Parses a `"HH:MM"` time string into a comparable integer (e.g. `"09:30"` -> `930`).
|
|
1480
|
+
* Returns `-1` when the string is not a valid time.
|
|
1481
|
+
* @param value - The time string to parse.
|
|
1482
|
+
*/
|
|
1483
|
+
private getTime;
|
|
1484
|
+
/**
|
|
1485
|
+
* Validates that the control value is a valid time string and, when slots are configured,
|
|
1486
|
+
* that it falls within at least one of the allowed ranges.
|
|
1487
|
+
* Returns `null` when the control is empty.
|
|
1488
|
+
* @param control - The form control to validate.
|
|
1489
|
+
*/
|
|
1490
|
+
validate(control: AbstractControl): ValidationErrors | null;
|
|
1491
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TimeValidatorDirective, never>;
|
|
1492
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TimeValidatorDirective, "[time]", never, { "slots": { "alias": "slots"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
/**
|
|
1496
|
+
* Pipe that converts a Markdown string to sanitized HTML using `SystemUtils.markdownToHtml`.
|
|
1497
|
+
*
|
|
1498
|
+
* Usage: `{{ text | formatMarkdown }}`
|
|
1499
|
+
*/
|
|
1019
1500
|
declare class FormatMarkdownPipe implements PipeTransform {
|
|
1020
1501
|
private readonly sanitizer;
|
|
1502
|
+
/**
|
|
1503
|
+
* Transforms a Markdown string into sanitized HTML.
|
|
1504
|
+
* @param value - The Markdown input to convert. Treated as an empty string when `undefined`.
|
|
1505
|
+
* @returns A `SafeHtml` value that can be rendered with `[innerHTML]`.
|
|
1506
|
+
*/
|
|
1021
1507
|
transform(value?: string): SafeHtml;
|
|
1022
1508
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormatMarkdownPipe, never>;
|
|
1023
1509
|
static ɵpipe: i0.ɵɵPipeDeclaration<FormatMarkdownPipe, "formatMarkdown", true>;
|