@arsedizioni/ars-utils 22.0.15 → 22.0.16
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-core.mjs +462 -311
- package/fesm2022/arsedizioni-ars-utils-core.mjs.map +1 -1
- package/package.json +1 -1
- package/types/arsedizioni-ars-utils-clipper.ui.d.ts +1 -1
- package/types/arsedizioni-ars-utils-core.d.ts +27 -43
- package/types/arsedizioni-ars-utils-ui.application.d.ts +2 -2
- package/types/arsedizioni-ars-utils-ui.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1053,7 +1053,7 @@ declare class ClipperDocumentMenuComponent {
|
|
|
1053
1053
|
/** Internal counter incremented on each external selection-model change to drive signal re-evaluation. */
|
|
1054
1054
|
private readonly selectionChangeTick;
|
|
1055
1055
|
readonly useSelections: _angular_core.InputSignal<boolean>;
|
|
1056
|
-
readonly selectionSource: _angular_core.InputSignal<"
|
|
1056
|
+
readonly selectionSource: _angular_core.InputSignal<"selection" | "none" | "bag">;
|
|
1057
1057
|
/**
|
|
1058
1058
|
* Computed signal that returns the current effective document selection.
|
|
1059
1059
|
* Re-evaluates when any input signal or the underlying selection model changes.
|
|
@@ -215,6 +215,8 @@ interface PasswordStrength {
|
|
|
215
215
|
isValid: boolean;
|
|
216
216
|
}
|
|
217
217
|
declare class SystemUtils {
|
|
218
|
+
/** Shared collator for locale-aware, case-insensitive string comparison. */
|
|
219
|
+
private static readonly collator;
|
|
218
220
|
/**
|
|
219
221
|
* Array find by key
|
|
220
222
|
* @param array : the array to scan
|
|
@@ -249,7 +251,7 @@ declare class SystemUtils {
|
|
|
249
251
|
* Comparator factory for sorting arrays of objects by a given property key.
|
|
250
252
|
* @param key - Name of the property to sort by.
|
|
251
253
|
* @param order - Sort direction: `'asc'` (default) or `'desc'`.
|
|
252
|
-
* @returns A comparator function that returns
|
|
254
|
+
* @returns A comparator function that returns a negative, zero, or positive number.
|
|
253
255
|
*/
|
|
254
256
|
static arraySortCompare(key: string, order?: string): (a: Record<string, unknown>, b: Record<string, unknown>) => number;
|
|
255
257
|
/**
|
|
@@ -265,7 +267,7 @@ declare class SystemUtils {
|
|
|
265
267
|
*/
|
|
266
268
|
static formatFileSize(bytes: number): string;
|
|
267
269
|
/**
|
|
268
|
-
* Compare two
|
|
270
|
+
* Compare two strings (case-insensitive, locale-aware, accent-insensitive).
|
|
269
271
|
* @param a : string a
|
|
270
272
|
* @param b : string b
|
|
271
273
|
* @returns : 0 if equals, 1 if bigger, -1 if lower
|
|
@@ -278,7 +280,7 @@ declare class SystemUtils {
|
|
|
278
280
|
*/
|
|
279
281
|
static capitalize(s?: string): string | undefined;
|
|
280
282
|
/**
|
|
281
|
-
* Truncate a string
|
|
283
|
+
* Truncate a string at the last word boundary before `max`.
|
|
282
284
|
* @param s : the string to truncate
|
|
283
285
|
* @param max : the max number of chars
|
|
284
286
|
* @returns : the truncated string
|
|
@@ -307,42 +309,10 @@ declare class SystemUtils {
|
|
|
307
309
|
/**
|
|
308
310
|
* Convert markdown to html
|
|
309
311
|
* @param markdown : the markdown data
|
|
310
|
-
* @param
|
|
312
|
+
* @param escapeHtml : true to escape HTML. Default is false
|
|
311
313
|
* @returns the html
|
|
312
314
|
*/
|
|
313
|
-
static markdownToHtml(markdown: string,
|
|
314
|
-
/**
|
|
315
|
-
* Convert markdown table to html
|
|
316
|
-
* @param markdown: the markdown string
|
|
317
|
-
* @returns : the html
|
|
318
|
-
*/
|
|
319
|
-
private static markdownConvertTables;
|
|
320
|
-
/**
|
|
321
|
-
* Convert a markdown table row to html
|
|
322
|
-
* @param row : the markdown row
|
|
323
|
-
* @param isHeader : true if is header
|
|
324
|
-
* @returns the html
|
|
325
|
-
*/
|
|
326
|
-
private static markdownConvertTableRow;
|
|
327
|
-
/**
|
|
328
|
-
* Convert a markdown list to html
|
|
329
|
-
* @param markdown : the markdown list
|
|
330
|
-
* @returns the html
|
|
331
|
-
*/
|
|
332
|
-
private static markdownConvertLists;
|
|
333
|
-
/**
|
|
334
|
-
* Wrap a list
|
|
335
|
-
* @param type: the list type
|
|
336
|
-
* @param items : the item list
|
|
337
|
-
* @returns the html
|
|
338
|
-
*/
|
|
339
|
-
private static markdownWrapList;
|
|
340
|
-
/**
|
|
341
|
-
* Convert markdown paragraphs to html
|
|
342
|
-
* @param markdown : the markdown paragraphs
|
|
343
|
-
* @returns the html
|
|
344
|
-
*/
|
|
345
|
-
private static markdownConvertParagraphs;
|
|
315
|
+
static markdownToHtml(markdown: string, escapeHtml?: boolean): string;
|
|
346
316
|
/**
|
|
347
317
|
* Compare two names
|
|
348
318
|
* @param a : name a
|
|
@@ -359,15 +329,16 @@ declare class SystemUtils {
|
|
|
359
329
|
*/
|
|
360
330
|
static cipher(text: string, key: string, reverse?: boolean): string | undefined;
|
|
361
331
|
/**
|
|
362
|
-
* Clone an object
|
|
363
|
-
*
|
|
332
|
+
* Clone an object (deep copy).
|
|
333
|
+
* Uses native structuredClone: handles Date, Map, Set, typed arrays and circular references.
|
|
334
|
+
* @param obj : the object to clone
|
|
364
335
|
* @returns : a new object
|
|
365
336
|
*/
|
|
366
337
|
static clone<T>(obj: T): T;
|
|
367
338
|
/**
|
|
368
|
-
* Creates a deep clone of an object
|
|
339
|
+
* Creates a deep clone of an object.
|
|
369
340
|
* @param obj - The source object to clone.
|
|
370
|
-
* @param dest - Optional pre-allocated destination object
|
|
341
|
+
* @param dest - Optional pre-allocated destination object to merge the clone into.
|
|
371
342
|
* @returns A deep copy of `obj`.
|
|
372
343
|
*/
|
|
373
344
|
static deepClone<T extends object>(obj: T, dest?: T): T;
|
|
@@ -397,14 +368,25 @@ declare class SystemUtils {
|
|
|
397
368
|
* @returns : the formatted UUID or the original string if it doesn't match the expected format
|
|
398
369
|
*/
|
|
399
370
|
static inflateUUID(value: string): string;
|
|
371
|
+
/** Precompiled validation patterns. */
|
|
372
|
+
private static readonly emailRegex;
|
|
373
|
+
private static readonly urlRegex;
|
|
400
374
|
/**
|
|
401
|
-
* Parse a text and return true if is a valid email or
|
|
375
|
+
* Parse a text and return true if it is a valid email (or empty)
|
|
402
376
|
* @param value : email
|
|
403
377
|
* @returns : true if the email is valid or empty
|
|
404
378
|
*/
|
|
405
379
|
static parseEmail(value?: string): boolean;
|
|
406
380
|
/**
|
|
407
|
-
* Parse a text
|
|
381
|
+
* Parse a text containing one or more email addresses separated by `;` or `,`
|
|
382
|
+
* and return true if all of them are valid (or the text is empty).
|
|
383
|
+
* Empty items caused by double or trailing separators are ignored.
|
|
384
|
+
* @param value : the email list to parse (e.g. "a@b.it; c@d.it")
|
|
385
|
+
* @returns : true if all emails are valid or the value is empty
|
|
386
|
+
*/
|
|
387
|
+
static parseEmails(value?: string): boolean;
|
|
388
|
+
/**
|
|
389
|
+
* Parse a text and return true if it is a valid url (or empty)
|
|
408
390
|
* @param value : the url to parse
|
|
409
391
|
* @returns : true if the url is valid or empty
|
|
410
392
|
*/
|
|
@@ -521,6 +503,8 @@ declare class SystemUtils {
|
|
|
521
503
|
* @returns Array of set flag values, or an empty array when `value` is `0`.
|
|
522
504
|
*/
|
|
523
505
|
static getFlags(value: number, max?: number): number[];
|
|
506
|
+
/** Cache for resolved color luminance results. */
|
|
507
|
+
private static readonly colorLightCache;
|
|
524
508
|
/**
|
|
525
509
|
* Check if a color is light or dark
|
|
526
510
|
* @param color : the color
|
|
@@ -999,7 +999,7 @@ declare class ChipsSelectorComponent implements OnDestroy, ControlValueAccessor
|
|
|
999
999
|
/** Minimum width in pixels when collapsed. Use `-1` for automatic. */
|
|
1000
1000
|
readonly collapsedWidth: _angular_core.InputSignal<number>;
|
|
1001
1001
|
/** Display mode used when the selector is in collapsed state. */
|
|
1002
|
-
readonly collapsedDisplayMode: _angular_core.InputSignal<"
|
|
1002
|
+
readonly collapsedDisplayMode: _angular_core.InputSignal<"dropdown" | "button">;
|
|
1003
1003
|
/** Pixel threshold below which the selector collapses. Use `-1` to disable. */
|
|
1004
1004
|
readonly collapseAt: _angular_core.InputSignal<number>;
|
|
1005
1005
|
/** When `true`, `collapseAt` is compared against the container width rather than the window width. */
|
|
@@ -1012,7 +1012,7 @@ declare class ChipsSelectorComponent implements OnDestroy, ControlValueAccessor
|
|
|
1012
1012
|
/** When `true`, at least one item must remain selected. */
|
|
1013
1013
|
readonly mustSelect: _angular_core.InputSignal<boolean>;
|
|
1014
1014
|
/** Layout mode: `'collapsed'` forces dropdown mode, `'dynamic'` collapses based on `collapseAt`. */
|
|
1015
|
-
readonly mode: _angular_core.InputSignal<"
|
|
1015
|
+
readonly mode: _angular_core.InputSignal<"collapsed" | "dynamic">;
|
|
1016
1016
|
/** When `true`, chips are stacked vertically instead of wrapping horizontally. */
|
|
1017
1017
|
readonly stacked: _angular_core.InputSignal<boolean>;
|
|
1018
1018
|
/** Chips below this index receive extra padding to align with other UI elements. */
|
|
@@ -393,7 +393,7 @@ declare class BusyDialogComponent {
|
|
|
393
393
|
/** Current progress value (0–100). Used when `progressMode` is `'determinate'`. */
|
|
394
394
|
readonly progress: _angular_core.WritableSignal<number>;
|
|
395
395
|
/** Progress mode passed to the Material progress components. */
|
|
396
|
-
readonly progressMode: _angular_core.WritableSignal<"
|
|
396
|
+
readonly progressMode: _angular_core.WritableSignal<"determinate" | "indeterminate">;
|
|
397
397
|
/** Message displayed above the progress indicator. */
|
|
398
398
|
readonly message: _angular_core.WritableSignal<string>;
|
|
399
399
|
/**
|