@forgeroute/ui 0.4.68 → 0.4.70
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/forgeroute-ui.mjs +1515 -138
- package/fesm2022/forgeroute-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/forgeroute-ui.d.ts +342 -17
package/package.json
CHANGED
package/types/forgeroute-ui.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import { EnvironmentProviders, InjectionToken, OnDestroy, OnInit, Signal, TemplateRef, WritableSignal } from "@angular/core";
|
|
3
3
|
import { UrlTree } from "@angular/router";
|
|
4
|
-
import { Observable } from "rxjs";
|
|
5
|
-
import { AbstractControl, ControlValueAccessor, FormControl, ValidationErrors, Validator } from "@angular/forms";
|
|
4
|
+
import { Observable, Subject } from "rxjs";
|
|
5
|
+
import { AbstractControl, ControlValueAccessor, FormControl, ValidationErrors, Validator, ValidatorFn } from "@angular/forms";
|
|
6
6
|
import { HttpInterceptorFn } from "@angular/common/http";
|
|
7
7
|
import { SafeHtml } from "@angular/platform-browser";
|
|
8
8
|
export interface ForgerouteConfig {
|
|
@@ -2387,6 +2387,54 @@ export declare class ModalComponent implements OnInit, OnDestroy {
|
|
|
2387
2387
|
}, never, ["[modal-header-end]", "*", "[modal-footer-left]", "[modal-footer-center]", "[modal-footer-right]"], true, never>;
|
|
2388
2388
|
}
|
|
2389
2389
|
export type ToastType = 'success' | 'error' | 'info';
|
|
2390
|
+
/** A button on a toast (e.g. "View Contact", "Call Back"). */
|
|
2391
|
+
export interface ToastAction {
|
|
2392
|
+
/** Identifies the button in `onAction` and in the `(action)` output; also the test id suffix (`toast-action-<id>`). */
|
|
2393
|
+
id: string;
|
|
2394
|
+
label: string;
|
|
2395
|
+
/** Look of the button. Default `secondary`. */
|
|
2396
|
+
variant?: 'primary' | 'secondary' | 'danger';
|
|
2397
|
+
disabled?: boolean;
|
|
2398
|
+
/** Keep the toast open after this button is used. Default `false`: using a button closes the toast. */
|
|
2399
|
+
keepOpen?: boolean;
|
|
2400
|
+
}
|
|
2401
|
+
/** What `(action)` / `ToastService.action$` emit when a toast button is used. */
|
|
2402
|
+
export interface ToastActionEvent {
|
|
2403
|
+
/** The `id` of the button. */
|
|
2404
|
+
id: string;
|
|
2405
|
+
/** The `key` of the toast it belongs to, when the toast had one. */
|
|
2406
|
+
key?: string;
|
|
2407
|
+
}
|
|
2408
|
+
/**
|
|
2409
|
+
* Per-message options for `show()` / `success()` / `info()` / `error()` / `notify()`. Every field is optional; a call without any of them is a plain
|
|
2410
|
+
* toast exactly as before.
|
|
2411
|
+
*/
|
|
2412
|
+
export interface ToastOptions {
|
|
2413
|
+
/** Only `notify()` reads this (`show` / `success` / `info` / `error` fix their own type). Default `success`. */
|
|
2414
|
+
type?: ToastType;
|
|
2415
|
+
/** How long it stays, in ms. Default: 3000 (4000 for errors). */
|
|
2416
|
+
duration?: number;
|
|
2417
|
+
/** A bold first line above the message. */
|
|
2418
|
+
title?: string;
|
|
2419
|
+
/** Buttons under the message. */
|
|
2420
|
+
actions?: readonly ToastAction[];
|
|
2421
|
+
/** Show "Dismissing in Ns" and a shrinking bar for this toast. Default: the outlet's / app's `countdown` setting (off). */
|
|
2422
|
+
countdown?: boolean;
|
|
2423
|
+
/** When another toast is showing, wait for it to finish instead of replacing it. Default: the outlet's / app's `queue` setting (off). */
|
|
2424
|
+
queue?: boolean;
|
|
2425
|
+
/** Identifies the toast: while one with the same key is showing or waiting, another one with that key is not added again (e.g. one per call id). */
|
|
2426
|
+
key?: string;
|
|
2427
|
+
/** Called with the `id` of a button when it is used (before the toast closes). */
|
|
2428
|
+
onAction?: (actionId: string) => void;
|
|
2429
|
+
}
|
|
2430
|
+
/** What is known about the toast on screen beyond its message and type; `null` for a plain toast. */
|
|
2431
|
+
export interface ToastDetails {
|
|
2432
|
+
title?: string;
|
|
2433
|
+
actions: readonly ToastAction[];
|
|
2434
|
+
countdown: boolean;
|
|
2435
|
+
key?: string;
|
|
2436
|
+
onAction?: (actionId: string) => void;
|
|
2437
|
+
}
|
|
2390
2438
|
export declare class ToastService implements OnDestroy {
|
|
2391
2439
|
readonly message: import("@angular/core").WritableSignal<string | null>;
|
|
2392
2440
|
readonly type: import("@angular/core").WritableSignal<ToastType>;
|
|
@@ -2402,16 +2450,42 @@ export declare class ToastService implements OnDestroy {
|
|
|
2402
2450
|
* Set once per app with `provideForgerouteToast({ persistentLiveRegion: true })`, or per outlet with `<ui-toast [persistentLiveRegion]="true" />`.
|
|
2403
2451
|
*/
|
|
2404
2452
|
readonly persistentLiveRegion: import("@angular/core").WritableSignal<boolean>;
|
|
2453
|
+
/** The title, buttons, countdown flag, key and callback of the toast on screen; `null` for a plain toast or none. */
|
|
2454
|
+
readonly details: import("@angular/core").WritableSignal<ToastDetails | null>;
|
|
2455
|
+
/** How many toasts are waiting behind the one on screen (queue mode). */
|
|
2456
|
+
readonly queuedCount: import("@angular/core").WritableSignal<number>;
|
|
2457
|
+
/** Default for `ToastOptions.queue`: new toasts wait for the one on screen instead of replacing it. Set with `provideForgerouteToast({ queue: true })` or `<ui-toast [queue]="true" />`. */
|
|
2458
|
+
readonly queueDefault: import("@angular/core").WritableSignal<boolean>;
|
|
2459
|
+
/** Default for `ToastOptions.countdown`. Set with `provideForgerouteToast({ countdown: true })` or `<ui-toast [countdown]="true" />`. */
|
|
2460
|
+
readonly countdownDefault: import("@angular/core").WritableSignal<boolean>;
|
|
2461
|
+
/** Most toasts that may wait; further ones are dropped. Default 20. Set with `provideForgerouteToast({ maxQueued })` or `<ui-toast [maxQueued]="n" />`. */
|
|
2462
|
+
readonly maxQueued: import("@angular/core").WritableSignal<number>;
|
|
2463
|
+
/** Time left of the toast on screen, in ms; only kept up to date for a toast with a countdown. */
|
|
2464
|
+
readonly remainingMs: import("@angular/core").WritableSignal<number>;
|
|
2465
|
+
/** The full time the toast on screen was given, in ms (the denominator of the countdown bar). */
|
|
2466
|
+
readonly totalMs: import("@angular/core").WritableSignal<number>;
|
|
2467
|
+
/** Emits when a toast button is used. */
|
|
2468
|
+
readonly action$: Subject<ToastActionEvent>;
|
|
2405
2469
|
private _timer;
|
|
2470
|
+
private _ticker;
|
|
2471
|
+
private _advanceTimer;
|
|
2406
2472
|
private _deadline;
|
|
2407
2473
|
private _remaining;
|
|
2408
2474
|
private _paused;
|
|
2409
|
-
|
|
2475
|
+
private _queue;
|
|
2476
|
+
/** Green success toast. `durationOrOptions` is the time in ms (default 3000) or a {@link ToastOptions} object. */
|
|
2477
|
+
show(msg: string, durationOrOptions?: number | ToastOptions): void;
|
|
2478
|
+
/** Green success toast, the explicit name for `show()` (same type, same 3000ms default, same behaviour). */
|
|
2479
|
+
success(msg: string, durationOrOptions?: number | ToastOptions): void;
|
|
2410
2480
|
/** Neutral (blue) toast for a result that is neither a success nor a failure, e.g. "No changes to save.". */
|
|
2411
|
-
info(msg: string,
|
|
2412
|
-
error(msg: string,
|
|
2413
|
-
/**
|
|
2481
|
+
info(msg: string, durationOrOptions?: number | ToastOptions): void;
|
|
2482
|
+
error(msg: string, durationOrOptions?: number | ToastOptions): void;
|
|
2483
|
+
/** A toast whose type comes from `options.type` (default `success`); the same as the named methods otherwise. */
|
|
2484
|
+
notify(msg: string, options?: ToastOptions): void;
|
|
2485
|
+
/** Removes the current toast now (close button / Escape); the next waiting one, if any, follows. Safe when nothing is showing. */
|
|
2414
2486
|
dismiss(): void;
|
|
2487
|
+
/** Uses the button `id` of the toast on screen: calls its `onAction`, emits `action$`, and closes the toast unless the button has `keepOpen`. No-op for an unknown or disabled button. */
|
|
2488
|
+
runAction(id: string): void;
|
|
2415
2489
|
/** Holds the countdown while the pointer or keyboard focus is on the toast (WCAG 2.2.1). No-op when nothing is counting down. */
|
|
2416
2490
|
pause(): void;
|
|
2417
2491
|
/** Continues after `pause()`; the toast gets at least 1000ms more so it can be read. No-op when not paused. */
|
|
@@ -2419,8 +2493,14 @@ export declare class ToastService implements OnDestroy {
|
|
|
2419
2493
|
/** The root injector is destroyed (app teardown, TestBed reset): no timer may outlive it. */
|
|
2420
2494
|
ngOnDestroy(): void;
|
|
2421
2495
|
private _clearTimer;
|
|
2496
|
+
private _clearTicker;
|
|
2497
|
+
private _clearAdvance;
|
|
2498
|
+
/** Starts the expiry timer (and the countdown ticker for a toast with a countdown). `fresh` = a new toast, not a resume after a pause. */
|
|
2422
2499
|
private _start;
|
|
2423
|
-
|
|
2500
|
+
/** The toast on screen is over (expired, dismissed or its button used): clear it and bring in the next waiting one after a short gap. */
|
|
2501
|
+
private _finish;
|
|
2502
|
+
private _enter;
|
|
2503
|
+
private _present;
|
|
2424
2504
|
static ɵfac: i0.ɵɵFactoryDeclaration<ToastService, never>;
|
|
2425
2505
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
2426
2506
|
}
|
|
@@ -2446,6 +2526,28 @@ export declare class ToastComponent {
|
|
|
2446
2526
|
*/
|
|
2447
2527
|
readonly persistentLiveRegion: import("@angular/core").InputSignal<boolean | null>;
|
|
2448
2528
|
protected readonly persistent: import("@angular/core").Signal<boolean>;
|
|
2529
|
+
/**
|
|
2530
|
+
* Outlet-wide defaults for the optional parts of a toast (a message's own options win). `null` (default) leaves the app / service setting alone
|
|
2531
|
+
* (`provideForgerouteToast`, itself off); a value is applied while this is the live outlet.
|
|
2532
|
+
*
|
|
2533
|
+
* - `queue`: a toast that arrives while another is showing waits for it instead of replacing it.
|
|
2534
|
+
* - `countdown`: show "Dismissing in Ns" and a shrinking bar on every toast.
|
|
2535
|
+
* - `maxQueued`: how many may wait (default 20).
|
|
2536
|
+
*/
|
|
2537
|
+
readonly queue: import("@angular/core").InputSignal<boolean | null>;
|
|
2538
|
+
readonly countdown: import("@angular/core").InputSignal<boolean | null>;
|
|
2539
|
+
readonly maxQueued: import("@angular/core").InputSignal<number | null>;
|
|
2540
|
+
/** Wording of the countdown line; `{n}` is the seconds left. */
|
|
2541
|
+
readonly countdownLabel: import("@angular/core").InputSignal<string>;
|
|
2542
|
+
/** Wording of the chip that says how many toasts are waiting; `{n}` is the count. */
|
|
2543
|
+
readonly queueLabel: import("@angular/core").InputSignal<string>;
|
|
2544
|
+
/** A toast button was used (also after its own `onAction`). */
|
|
2545
|
+
readonly action: import("@angular/core").OutputEmitterRef<ToastActionEvent>;
|
|
2546
|
+
protected readonly isRich: import("@angular/core").Signal<boolean>;
|
|
2547
|
+
protected readonly countdownPct: import("@angular/core").Signal<number>;
|
|
2548
|
+
protected readonly countdownText: import("@angular/core").Signal<string>;
|
|
2549
|
+
protected readonly queueText: import("@angular/core").Signal<string>;
|
|
2550
|
+
protected onAction(id: string): void;
|
|
2449
2551
|
/**
|
|
2450
2552
|
* Message that was already on screen when this instance took over from a destroyed host. While it is
|
|
2451
2553
|
* unchanged the toast renders without the entry animation and without live-region roles, so the
|
|
@@ -2476,7 +2578,34 @@ export declare class ToastComponent {
|
|
|
2476
2578
|
"required": false;
|
|
2477
2579
|
"isSignal": true;
|
|
2478
2580
|
};
|
|
2479
|
-
|
|
2581
|
+
"queue": {
|
|
2582
|
+
"alias": "queue";
|
|
2583
|
+
"required": false;
|
|
2584
|
+
"isSignal": true;
|
|
2585
|
+
};
|
|
2586
|
+
"countdown": {
|
|
2587
|
+
"alias": "countdown";
|
|
2588
|
+
"required": false;
|
|
2589
|
+
"isSignal": true;
|
|
2590
|
+
};
|
|
2591
|
+
"maxQueued": {
|
|
2592
|
+
"alias": "maxQueued";
|
|
2593
|
+
"required": false;
|
|
2594
|
+
"isSignal": true;
|
|
2595
|
+
};
|
|
2596
|
+
"countdownLabel": {
|
|
2597
|
+
"alias": "countdownLabel";
|
|
2598
|
+
"required": false;
|
|
2599
|
+
"isSignal": true;
|
|
2600
|
+
};
|
|
2601
|
+
"queueLabel": {
|
|
2602
|
+
"alias": "queueLabel";
|
|
2603
|
+
"required": false;
|
|
2604
|
+
"isSignal": true;
|
|
2605
|
+
};
|
|
2606
|
+
}, {
|
|
2607
|
+
"action": "action";
|
|
2608
|
+
}, never, never, true, never>;
|
|
2480
2609
|
}
|
|
2481
2610
|
export type ProgressBarVariant = 'blue' | 'green' | 'amber' | 'red' | 'slate';
|
|
2482
2611
|
/**
|
|
@@ -3965,7 +4094,7 @@ export declare class ButtonComponent {
|
|
|
3965
4094
|
* `ghost-start`: a ghost button for list / section toggles - a full-width row with its content aligned to the start, transparent
|
|
3966
4095
|
* background, hover tint and the normal focus ring. Pair it with `ariaExpanded` / `ariaPressed`; the label may contain a heading element.
|
|
3967
4096
|
*/
|
|
3968
|
-
readonly variant: import("@angular/core").InputSignal<"
|
|
4097
|
+
readonly variant: import("@angular/core").InputSignal<"primary" | "secondary" | "danger" | "warning" | "link" | "ghost" | "ghost-start" | "tab" | "icon" | "icon-danger">;
|
|
3969
4098
|
/** Renders an anchor to this route instead of a button (use with `variant="link"` for an inline text link). `['/settings']` or `'/settings'`. While `disabled` or `loading` it renders a non-clickable `<span role="link" aria-disabled>` with no href (like `href`). */
|
|
3970
4099
|
readonly routerLink: import("@angular/core").InputSignal<string | readonly unknown[] | null>;
|
|
3971
4100
|
/** Query params of the `routerLink` (e.g. `{ section: 'deal-defaults' }`). */
|
|
@@ -4011,7 +4140,7 @@ export declare class ButtonComponent {
|
|
|
4011
4140
|
readonly color: import("@angular/core").InputSignal<string | undefined>;
|
|
4012
4141
|
readonly active: import("@angular/core").InputSignal<boolean>;
|
|
4013
4142
|
readonly size: import("@angular/core").InputSignal<"sm" | "md" | "lg" | "xs">;
|
|
4014
|
-
readonly type: import("@angular/core").InputSignal<"
|
|
4143
|
+
readonly type: import("@angular/core").InputSignal<"reset" | "submit" | "button">;
|
|
4015
4144
|
readonly disabled: import("@angular/core").InputSignal<boolean>;
|
|
4016
4145
|
readonly loading: import("@angular/core").InputSignal<boolean>;
|
|
4017
4146
|
readonly fullWidth: import("@angular/core").InputSignal<boolean>;
|
|
@@ -4283,9 +4412,9 @@ export interface ContactLookup {
|
|
|
4283
4412
|
email: string | null;
|
|
4284
4413
|
smsOptedIn: boolean;
|
|
4285
4414
|
}
|
|
4286
|
-
declare function formatPhone(raw: string | null | undefined): string;
|
|
4415
|
+
declare function formatPhone$1(raw: string | null | undefined): string;
|
|
4287
4416
|
export declare class ContactPickerComponent {
|
|
4288
|
-
readonly formatPhone: typeof formatPhone;
|
|
4417
|
+
readonly formatPhone: typeof formatPhone$1;
|
|
4289
4418
|
readonly label: import("@angular/core").InputSignal<string>;
|
|
4290
4419
|
readonly placeholder: import("@angular/core").InputSignal<string>;
|
|
4291
4420
|
/** Helper text under the picker (linked to the search input via aria-describedby). */
|
|
@@ -4959,7 +5088,7 @@ export declare class TextInputComponent implements ControlValueAccessor, Validat
|
|
|
4959
5088
|
* `search`, `text`, `none`). Empty (default) = the browser's default for the field, except `type="tel"`, which keeps `tel`.
|
|
4960
5089
|
* It only picks the keyboard; it does not restrict what can be typed or pasted.
|
|
4961
5090
|
*/
|
|
4962
|
-
readonly inputmode: import("@angular/core").InputSignal<"" | "
|
|
5091
|
+
readonly inputmode: import("@angular/core").InputSignal<"" | "none" | "text" | "search" | "email" | "tel" | "url" | "decimal" | "numeric">;
|
|
4963
5092
|
readonly readonly: import("@angular/core").InputSignal<boolean>;
|
|
4964
5093
|
readonly hint: import("@angular/core").InputSignal<string>;
|
|
4965
5094
|
/** Id(s) of an external element that also describes this control (e.g. one shared error text for a group of fields). Space separated; MERGED after the control's own hint / error id in `aria-describedby`, never replacing it. Empty = unchanged. */
|
|
@@ -5216,6 +5345,26 @@ export declare class TextInputComponent implements ControlValueAccessor, Validat
|
|
|
5216
5345
|
"invalidChange": "invalidChange";
|
|
5217
5346
|
}, never, ["[uiLabelEnd]"], true, never>;
|
|
5218
5347
|
}
|
|
5348
|
+
/** Longest password the apps' servers accept (128 characters); use it as the password input's `maxlength`. */
|
|
5349
|
+
export declare const PASSWORD_MAX_LENGTH = 128;
|
|
5350
|
+
/**
|
|
5351
|
+
* Policy of servers that accept only these special characters: 8+ characters, an uppercase letter, a lowercase letter, a digit and one of
|
|
5352
|
+
* `@ $ ! % * ? & #`. (Anything else, e.g. `^` or a space, does NOT count as the special character.)
|
|
5353
|
+
*/
|
|
5354
|
+
export declare const LISTED_SPECIAL_PASSWORD_RULES: readonly PasswordRule[];
|
|
5355
|
+
/**
|
|
5356
|
+
* Policy of servers that accept any ASCII symbol as the special character (character codes 33-126 that are not letters or digits): 8+ characters,
|
|
5357
|
+
* an uppercase letter, a lowercase letter, a digit and one ASCII symbol. A space and non-ASCII characters (e.g. `é`) do NOT count.
|
|
5358
|
+
*/
|
|
5359
|
+
export declare const ASCII_SPECIAL_PASSWORD_RULES: readonly PasswordRule[];
|
|
5360
|
+
/**
|
|
5361
|
+
* A form validator for a sign-up / reset-password control: the value must satisfy every rule and be at most `maxLength` characters. The error key
|
|
5362
|
+
* is `passwordRules` (value `true`). A null / undefined value counts as an empty string (so it fails the rules; combine with `Validators.required`
|
|
5363
|
+
* when an empty field should show a different message).
|
|
5364
|
+
*
|
|
5365
|
+
* password = new FormControl('', [createPasswordPolicyValidator(LISTED_SPECIAL_PASSWORD_RULES)]);
|
|
5366
|
+
*/
|
|
5367
|
+
export declare function createPasswordPolicyValidator(rules: readonly PasswordRule[], maxLength?: number): ValidatorFn;
|
|
5219
5368
|
/**
|
|
5220
5369
|
* Number pad for short numeric codes such as a PIN. Shows one dot per allowed digit (filled as digits are entered) above a 3x4 grid of
|
|
5221
5370
|
* 44px+ touch targets. The value is the digit string (`''` = nothing entered); it works with `[(value)]` and with `ngModel` / `FormControl`.
|
|
@@ -6495,7 +6644,7 @@ export declare class DropdownComponent {
|
|
|
6495
6644
|
readonly loader: import("@angular/core").InputSignal<(() => Promise<DropdownItem[]>) | null>;
|
|
6496
6645
|
readonly active: import("@angular/core").InputSignal<boolean>;
|
|
6497
6646
|
readonly activeValue: import("@angular/core").InputSignal<string>;
|
|
6498
|
-
readonly variant: import("@angular/core").InputSignal<"
|
|
6647
|
+
readonly variant: import("@angular/core").InputSignal<"badge" | "button">;
|
|
6499
6648
|
/** Trigger size for `variant="button"`: `sm` (default, the compact toolbar look) or `md` (same padding and type as a medium `ui-button`). */
|
|
6500
6649
|
readonly size: import("@angular/core").InputSignal<"sm" | "md">;
|
|
6501
6650
|
readonly menuWidth: import("@angular/core").InputSignal<string>;
|
|
@@ -7322,6 +7471,7 @@ export declare class NotesComponent {
|
|
|
7322
7471
|
* providers: [provideForgerouteToast()]
|
|
7323
7472
|
* providers: [provideForgerouteToast({ dismissible: true })] // every toast also gets a close button (default: none)
|
|
7324
7473
|
* providers: [provideForgerouteToast({ persistentLiveRegion: true })] // always-present live regions: reliable announcements in VoiceOver / Safari
|
|
7474
|
+
* providers: [provideForgerouteToast({ queue: true, countdown: true, maxQueued: 10 })] // toasts wait for each other and show a countdown (defaults; a message's own options win)
|
|
7325
7475
|
*
|
|
7326
7476
|
* It is created first, so it is the registry's host and any other `<ui-toast>` (a table's own, a shell's) stays silent: each
|
|
7327
7477
|
* message renders and is announced once. Nothing happens on the server. The outlet is destroyed with the app.
|
|
@@ -7329,6 +7479,9 @@ export declare class NotesComponent {
|
|
|
7329
7479
|
export declare function provideForgerouteToast(options?: {
|
|
7330
7480
|
dismissible?: boolean;
|
|
7331
7481
|
persistentLiveRegion?: boolean;
|
|
7482
|
+
queue?: boolean;
|
|
7483
|
+
countdown?: boolean;
|
|
7484
|
+
maxQueued?: number;
|
|
7332
7485
|
}): EnvironmentProviders;
|
|
7333
7486
|
/** Payload of `(reorder)`. Apply it with `reorderItems(items, order)` or take the ready-made `items`. */
|
|
7334
7487
|
export interface ListReorderEvent<T = unknown> {
|
|
@@ -8048,6 +8201,39 @@ export interface UsStateOption {
|
|
|
8048
8201
|
label: string;
|
|
8049
8202
|
}
|
|
8050
8203
|
export declare const US_STATES: UsStateOption[];
|
|
8204
|
+
/**
|
|
8205
|
+
* The 50 US states (no DC) with their major cities, keyed by two-letter state code: `US_LOCATIONS['TX']` -> `['Abilene', ...]`. Cities are unique and
|
|
8206
|
+
* trimmed per state. Use it for a city picker that follows a state select (the state names are in `US_STATES`).
|
|
8207
|
+
*/
|
|
8208
|
+
export declare const US_LOCATIONS: Record<string, string[]>;
|
|
8209
|
+
/**
|
|
8210
|
+
* Look of the record-card groups on detail pages (the section header's title, icon and tint), so groups that exist in several apps look identical.
|
|
8211
|
+
* Icon names are from the library's icon list; `background` is the section header's own light tint.
|
|
8212
|
+
*
|
|
8213
|
+
* const GROUPS = { ...COMMON_DETAIL_GROUP_STYLES, deals: { title: 'Deals & Money', icon: 'opportunity', background: '#ecfdf5' } };
|
|
8214
|
+
*/
|
|
8215
|
+
export interface DetailGroupStyle {
|
|
8216
|
+
title: string;
|
|
8217
|
+
icon: string;
|
|
8218
|
+
background: string;
|
|
8219
|
+
}
|
|
8220
|
+
/** The groups every app's detail pages share (the same title, icon and tint everywhere). An app adds its own groups next to these. */
|
|
8221
|
+
export declare const COMMON_DETAIL_GROUP_STYLES: {
|
|
8222
|
+
readonly activity: {
|
|
8223
|
+
readonly title: "Activity";
|
|
8224
|
+
readonly icon: "message";
|
|
8225
|
+
readonly background: "#eff6ff";
|
|
8226
|
+
};
|
|
8227
|
+
readonly notes: {
|
|
8228
|
+
readonly title: "Notes";
|
|
8229
|
+
readonly icon: "add-note";
|
|
8230
|
+
readonly background: "#f1f5f9";
|
|
8231
|
+
};
|
|
8232
|
+
};
|
|
8233
|
+
/** Header background of every record card on the detail pages (bound as the library card's `headerBackground`). */
|
|
8234
|
+
export declare const DETAIL_CARD_HEADER_BG = "#f8fafc";
|
|
8235
|
+
/** Light blue behind every group section header on the detail pages (large header with an icon tile and a description). */
|
|
8236
|
+
export declare const DETAIL_GROUP_HEADER_BG = "#eaf3ff";
|
|
8051
8237
|
export interface NavLink {
|
|
8052
8238
|
label: string;
|
|
8053
8239
|
route: string;
|
|
@@ -11374,6 +11560,26 @@ declare function layoutLanes(boxes: {
|
|
|
11374
11560
|
top: number;
|
|
11375
11561
|
height: number;
|
|
11376
11562
|
}[]): Record<string, CalendarLane>;
|
|
11563
|
+
/** A heading shared by consecutive agenda days (`ui-calendar` `agendaGroupFn`). Days that return the same `key` one after another sit under one heading. */
|
|
11564
|
+
interface CalendarAgendaGroup {
|
|
11565
|
+
key: string;
|
|
11566
|
+
label: string;
|
|
11567
|
+
}
|
|
11568
|
+
/**
|
|
11569
|
+
* Ready-made `agendaGroupFn` for `ui-calendar`: Overdue (before `todayStr`), Today, Tomorrow, This Week (the rest of the current Sunday-first
|
|
11570
|
+
* week) and Later (everything after). Pure `YYYY-MM-DD` string math (a day is added with the local `Date(y, m, d + n)` constructor, so a daylight
|
|
11571
|
+
* saving change never shifts it); nothing parses a non-ISO string. A `todayStr` that is not a real day, or a day that is not a real
|
|
11572
|
+
* `YYYY-MM-DD`, gives `null` (no heading) instead of a wrong group.
|
|
11573
|
+
*
|
|
11574
|
+
* readonly group = computed(() => periodGroup(this.todayIso())); // <ui-calendar [agendaGroupFn]="group()" />
|
|
11575
|
+
*/
|
|
11576
|
+
export declare function periodGroup(todayStr: string): (dateStr: string) => CalendarAgendaGroup | null;
|
|
11577
|
+
/** Level of a day's decoration (`ui-calendar` `dayDecorationFn`), lowest to highest. */
|
|
11578
|
+
type CalendarDayLevel = 'low' | 'medium' | 'high' | 'critical';
|
|
11579
|
+
/** What a screen reader hears for a decorated day (added to the cell's label, and shown as hidden text in the week view header). */
|
|
11580
|
+
declare const DAY_LEVEL_TEXT: Record<CalendarDayLevel, string>;
|
|
11581
|
+
/** True for the four known levels (an unknown string from a loosely typed host is ignored, not drawn). */
|
|
11582
|
+
declare function isDayLevel(level: unknown): level is CalendarDayLevel;
|
|
11377
11583
|
/** One thing on the calendar. The host maps its own records to this shape. */
|
|
11378
11584
|
export interface CalendarItem {
|
|
11379
11585
|
/** Unique across ALL items passed in (prefix ids by source when merging lists, e.g. `task-…`, `event-…`). */
|
|
@@ -11428,6 +11634,29 @@ export interface CalendarSlotClick {
|
|
|
11428
11634
|
/** `HH:00` of the clicked hour row. */
|
|
11429
11635
|
time: string;
|
|
11430
11636
|
}
|
|
11637
|
+
/** What `dayDecorationFn` returns for one day: a tint level and/or a tooltip. */
|
|
11638
|
+
export interface CalendarDayDecoration {
|
|
11639
|
+
/** Tints the day (month cell background + a coloured top bar; week view day header) and adds "<level> activity" to its screen-reader label. */
|
|
11640
|
+
level?: CalendarDayLevel;
|
|
11641
|
+
/** Hover / keyboard-focus tooltip of the day (library `uiTooltip`). Empty = none. */
|
|
11642
|
+
tooltip?: string;
|
|
11643
|
+
}
|
|
11644
|
+
/** One quick action offered on an item (`itemActionsFn`). */
|
|
11645
|
+
export interface CalendarItemAction {
|
|
11646
|
+
/** Unique per item; reported back in `itemAction`. */
|
|
11647
|
+
id: string;
|
|
11648
|
+
/** Visible text (or the hover title and accessible name when `icon` is set). */
|
|
11649
|
+
label: string;
|
|
11650
|
+
/** Icon key of `<ui-icon>` (e.g. `check`, `edit`, `delete`). With an icon the button shows only the icon; without one it shows the label. */
|
|
11651
|
+
icon?: string;
|
|
11652
|
+
disabled?: boolean;
|
|
11653
|
+
/** `danger` draws it red (destructive actions). */
|
|
11654
|
+
variant?: 'default' | 'danger';
|
|
11655
|
+
}
|
|
11656
|
+
export interface CalendarItemActionEvent {
|
|
11657
|
+
item: CalendarItem;
|
|
11658
|
+
actionId: string;
|
|
11659
|
+
}
|
|
11431
11660
|
/**
|
|
11432
11661
|
* Month / week / agenda calendar. The host owns the data: it listens to `(rangeChange)`, loads that range and passes
|
|
11433
11662
|
* the result as `items`. The calendar owns navigation, the view switcher, type filters, layout and keyboard access.
|
|
@@ -11507,8 +11736,28 @@ export declare class CalendarComponent {
|
|
|
11507
11736
|
readonly startHour: import("@angular/core").InputSignal<number>;
|
|
11508
11737
|
readonly endHour: import("@angular/core").InputSignal<number>;
|
|
11509
11738
|
readonly emptyMessage: import("@angular/core").InputSignal<string>;
|
|
11510
|
-
/** Builds the screen-reader name of a month cell; default "<weekday, date>, N events". */
|
|
11739
|
+
/** Builds the screen-reader name of a month cell; default "<weekday, date>, N events" (plus ", <level> activity" when `dayDecorationFn` gives a level). */
|
|
11511
11740
|
readonly dayLabelFn: import("@angular/core").InputSignal<((dateStr: string, items: CalendarItem[]) => string) | null>;
|
|
11741
|
+
/**
|
|
11742
|
+
* Optional per-day decoration (e.g. a workload heat map): called for every visible day with its items after the active filters. A `level`
|
|
11743
|
+
* (`low` / `medium` / `high` / `critical`) tints the month cell (background + a coloured bar on top, so the level is not colour alone) and the
|
|
11744
|
+
* week view day header, and adds "<level> activity" to the cell's default screen-reader label (a custom `dayLabelFn` label is used as given)
|
|
11745
|
+
* and as hidden text in the week header. A `tooltip` shows on hover and keyboard focus (library `uiTooltip`). Null / `null` result = no change.
|
|
11746
|
+
*/
|
|
11747
|
+
readonly dayDecorationFn: import("@angular/core").InputSignal<((dateStr: string, items: CalendarItem[]) => CalendarDayDecoration | null) | null>;
|
|
11748
|
+
/**
|
|
11749
|
+
* Optional quick actions on items (e.g. Confirm / Complete): called once per item, return `[]` for none. The actions are real buttons next to the
|
|
11750
|
+
* item (month chip, all-day chip, timed event, agenda row) that appear on hover AND when keyboard focus is inside the item; they emit `itemAction`
|
|
11751
|
+
* and never `itemClick`. On touch screens the agenda view always shows them (month and week chips show them while tapped / focused). Escape inside the
|
|
11752
|
+
* actions returns focus to the item. Null = no actions and no extra DOM.
|
|
11753
|
+
*/
|
|
11754
|
+
readonly itemActionsFn: import("@angular/core").InputSignal<((item: CalendarItem) => CalendarItemAction[]) | null>;
|
|
11755
|
+
/**
|
|
11756
|
+
* Optional agenda headings: called with each agenda day; consecutive days that return the same `key` share one `<h3>` heading (a `<section>`
|
|
11757
|
+
* labelled by it). A `null` result draws that day without a heading. `periodGroup(today)` is a ready-made Overdue / Today / Tomorrow / This Week /
|
|
11758
|
+
* Later grouping. Null = one block per date, as before.
|
|
11759
|
+
*/
|
|
11760
|
+
readonly agendaGroupFn: import("@angular/core").InputSignal<((dateStr: string) => CalendarAgendaGroup | null) | null>;
|
|
11512
11761
|
/** Fires on first render and whenever the view or the visible range changes: load this range, then pass `items`. */
|
|
11513
11762
|
readonly rangeChange: import("@angular/core").OutputEmitterRef<CalendarRange>;
|
|
11514
11763
|
readonly itemClick: import("@angular/core").OutputEmitterRef<CalendarItem>;
|
|
@@ -11518,6 +11767,8 @@ export declare class CalendarComponent {
|
|
|
11518
11767
|
readonly slotClick: import("@angular/core").OutputEmitterRef<CalendarSlotClick>;
|
|
11519
11768
|
/** "+N more" clicked in a month cell. */
|
|
11520
11769
|
readonly moreClick: import("@angular/core").OutputEmitterRef<CalendarMoreClick>;
|
|
11770
|
+
/** A quick action of an item (`itemActionsFn`) was activated. Never accompanied by `itemClick`. */
|
|
11771
|
+
readonly itemAction: import("@angular/core").OutputEmitterRef<CalendarItemActionEvent>;
|
|
11521
11772
|
private readonly host;
|
|
11522
11773
|
protected readonly weekDayLabels: string[];
|
|
11523
11774
|
protected readonly weekDayNames: string[];
|
|
@@ -11566,6 +11817,8 @@ export declare class CalendarComponent {
|
|
|
11566
11817
|
overflow: number;
|
|
11567
11818
|
clickable: boolean;
|
|
11568
11819
|
label: string;
|
|
11820
|
+
level: CalendarDayLevel | null;
|
|
11821
|
+
tooltip: string;
|
|
11569
11822
|
}[];
|
|
11570
11823
|
}[]>;
|
|
11571
11824
|
/** The 7 week columns with all-day items and the timed items laid out side by side when they overlap. */
|
|
@@ -11573,6 +11826,8 @@ export declare class CalendarComponent {
|
|
|
11573
11826
|
day: import("@forgeroute/ui").CalendarDay;
|
|
11574
11827
|
label: string;
|
|
11575
11828
|
clickable: boolean;
|
|
11829
|
+
level: CalendarDayLevel | null;
|
|
11830
|
+
tooltip: string;
|
|
11576
11831
|
allDay: CalendarItem[];
|
|
11577
11832
|
timed: {
|
|
11578
11833
|
lane: CalendarLane;
|
|
@@ -11605,6 +11860,29 @@ export declare class CalendarComponent {
|
|
|
11605
11860
|
protected itemLabel(e: CalendarItem): string;
|
|
11606
11861
|
protected agendaMeta(e: CalendarItem): string[];
|
|
11607
11862
|
private dayAriaLabel;
|
|
11863
|
+
/** The decoration of one day: an unknown `level` (loosely typed host) is dropped, a missing tooltip is `''`. */
|
|
11864
|
+
private decoration;
|
|
11865
|
+
protected levelText(level: CalendarDayLevel): string;
|
|
11866
|
+
/** Quick actions per item id, computed once per input change (nothing is computed while `itemActionsFn` is null). */
|
|
11867
|
+
private readonly actionsById;
|
|
11868
|
+
private static readonly NO_ACTIONS;
|
|
11869
|
+
protected actionsFor(item: CalendarItem): CalendarItemAction[];
|
|
11870
|
+
protected actionIconD(a: CalendarItemAction): string | null;
|
|
11871
|
+
protected onActionClick(item: CalendarItem, action: CalendarItemAction, event: Event): void;
|
|
11872
|
+
/** Escape inside an item's actions: focus goes back to the item's own button. */
|
|
11873
|
+
protected onActionsEscape(event: Event): void;
|
|
11874
|
+
/** Agenda days grouped under `agendaGroupFn` headings (consecutive days with the same key), or null when no function is set. */
|
|
11875
|
+
private static nextUid;
|
|
11876
|
+
private readonly uid;
|
|
11877
|
+
protected readonly agendaSections: import("@angular/core").Signal<{
|
|
11878
|
+
key: string;
|
|
11879
|
+
label: string;
|
|
11880
|
+
id: string;
|
|
11881
|
+
groups: {
|
|
11882
|
+
dateStr: string;
|
|
11883
|
+
items: CalendarItem[];
|
|
11884
|
+
}[];
|
|
11885
|
+
}[] | null>;
|
|
11608
11886
|
protected onDateClick(dateStr: string): void;
|
|
11609
11887
|
/** Grid keys on a day cell: arrows / Home / End move the tab stop, Enter / Space create. Keys on the chips inside never reach here. */
|
|
11610
11888
|
protected onCellKey(event: KeyboardEvent, dateStr: string): void;
|
|
@@ -11724,6 +12002,21 @@ export declare class CalendarComponent {
|
|
|
11724
12002
|
"required": false;
|
|
11725
12003
|
"isSignal": true;
|
|
11726
12004
|
};
|
|
12005
|
+
"dayDecorationFn": {
|
|
12006
|
+
"alias": "dayDecorationFn";
|
|
12007
|
+
"required": false;
|
|
12008
|
+
"isSignal": true;
|
|
12009
|
+
};
|
|
12010
|
+
"itemActionsFn": {
|
|
12011
|
+
"alias": "itemActionsFn";
|
|
12012
|
+
"required": false;
|
|
12013
|
+
"isSignal": true;
|
|
12014
|
+
};
|
|
12015
|
+
"agendaGroupFn": {
|
|
12016
|
+
"alias": "agendaGroupFn";
|
|
12017
|
+
"required": false;
|
|
12018
|
+
"isSignal": true;
|
|
12019
|
+
};
|
|
11727
12020
|
}, {
|
|
11728
12021
|
"view": "viewChange";
|
|
11729
12022
|
"anchorDate": "anchorDateChange";
|
|
@@ -11733,6 +12026,7 @@ export declare class CalendarComponent {
|
|
|
11733
12026
|
"dateClick": "dateClick";
|
|
11734
12027
|
"slotClick": "slotClick";
|
|
11735
12028
|
"moreClick": "moreClick";
|
|
12029
|
+
"itemAction": "itemAction";
|
|
11736
12030
|
}, never, ["[calendar-summary]", "[calendar-actions]", "[calendar-summary-mobile]"], true, never>;
|
|
11737
12031
|
}
|
|
11738
12032
|
/**
|
|
@@ -11927,7 +12221,7 @@ export declare class ShowComponent {
|
|
|
11927
12221
|
}, {}, never, ["*"], true, never>;
|
|
11928
12222
|
}
|
|
11929
12223
|
/**
|
|
11930
|
-
* Small formatting helpers shared by apps (money
|
|
12224
|
+
* Small formatting helpers shared by apps (money, postal addresses, names, phone numbers, durations and dates).
|
|
11931
12225
|
*/
|
|
11932
12226
|
export interface FormatCurrencyOptions {
|
|
11933
12227
|
/** ISO 4217 code. Default `'USD'`. */
|
|
@@ -11969,6 +12263,37 @@ export interface FormatAddressOptions {
|
|
|
11969
12263
|
* with `{ style: 'usa' }` -> `1 Main, Austin, TX 78701`.
|
|
11970
12264
|
*/
|
|
11971
12265
|
export declare function formatAddress(parts: AddressParts, options?: FormatAddressOptions): string;
|
|
12266
|
+
/**
|
|
12267
|
+
* The first letter of the first and last name: `getInitials('Sarah', 'Chen')` -> `SC`. A missing name contributes nothing (`getInitials('Sarah', '')` -> `S`).
|
|
12268
|
+
* Letters are returned as written (not upper-cased).
|
|
12269
|
+
*/
|
|
12270
|
+
export declare function getInitials(firstName: string | null | undefined, lastName: string | null | undefined): string;
|
|
12271
|
+
/**
|
|
12272
|
+
* A length of time in seconds as text: `formatDuration(90)` -> `1m 30s`, `formatDuration(45)` -> `45s`. `null`, `undefined` and 0 give `''`.
|
|
12273
|
+
* Hours are not split out (`3700` -> `61m 40s`).
|
|
12274
|
+
*/
|
|
12275
|
+
export declare function formatDuration(seconds: number | null | undefined): string;
|
|
12276
|
+
/**
|
|
12277
|
+
* A phone number as `(555) 555-5555` while it is typed or stored: `formatPhone('5125550001')` -> `(512) 555-0001`. A US `+1` / leading `1` is dropped,
|
|
12278
|
+
* other international numbers (a `+` that is not `+1` plus 10 digits) are returned as given, fewer digits give the partial form
|
|
12279
|
+
* (`'512555'` -> `(512) 555`, `'512'` -> `512`) and more than 10 digits are cut to 10. `null`, `undefined` and `''` give `''`.
|
|
12280
|
+
*/
|
|
12281
|
+
export declare function formatPhone(raw: string | null | undefined): string;
|
|
12282
|
+
/**
|
|
12283
|
+
* A US / Canada E.164 number as `+1 512 555-0100` (for showing a stored number). Any other value is returned as given (trimmed values are
|
|
12284
|
+
* still formatted: `' +15125550100 '` -> `+1 512 555-0100`); `null` and `undefined` give `''`. Use `formatPhone` for the domestic `(512) 555-0100` form.
|
|
12285
|
+
*/
|
|
12286
|
+
export declare function formatPhoneDisplay(e164: string | null | undefined): string;
|
|
12287
|
+
/**
|
|
12288
|
+
* A date as short text: `formatShortDate('2026-01-05')` -> `Jan 5, 2026`; `''` / `null` / `undefined` give `—`. A plain `YYYY-MM-DD` is read as a LOCAL
|
|
12289
|
+
* date (so it never shifts a day with the time zone); any other string goes through `new Date(...)` and uses the same en-US format.
|
|
12290
|
+
*/
|
|
12291
|
+
export declare function formatShortDate(value: string | null | undefined): string;
|
|
12292
|
+
/**
|
|
12293
|
+
* Today's date as `YYYY-MM-DD` in the given IANA time zone (e.g. the user's profile time zone): `todayInTimezone('America/Phoenix')` -> `2026-10-13`.
|
|
12294
|
+
* No or an invalid time zone falls back to the browser's local date.
|
|
12295
|
+
*/
|
|
12296
|
+
export declare function todayInTimezone(timezone?: string | null): string;
|
|
11972
12297
|
/**
|
|
11973
12298
|
* Starts the browser download of a blob under `fileName`. The anchor is attached to the page while it is clicked (Firefox ignores a click on
|
|
11974
12299
|
* a detached anchor) and the object URL is revoked 1000 ms later (Safari reads it asynchronously, so an immediate revoke can cancel the
|
|
@@ -14097,4 +14422,4 @@ export declare class ConversationsComponent {
|
|
|
14097
14422
|
"messagesRetry": "messagesRetry";
|
|
14098
14423
|
}, never, ["[uiConversationsContext]"], true, never>;
|
|
14099
14424
|
}
|
|
14100
|
-
export type { CalendarDay, CalendarRange, CalendarViewMode };
|
|
14425
|
+
export type { CalendarAgendaGroup, CalendarDay, CalendarDayLevel, CalendarRange, CalendarViewMode };
|