@forgeroute/ui 0.4.90 → 0.4.92

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgeroute/ui",
3
- "version": "0.4.90",
3
+ "version": "0.4.92",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=22.0.0",
6
6
  "@angular/core": ">=22.0.0",
@@ -1,5 +1,5 @@
1
1
  import * as i0 from "@angular/core";
2
- import { EnvironmentProviders, InjectionToken } from "@angular/core";
2
+ import { EnvironmentProviders, InjectionToken, Injector } from "@angular/core";
3
3
  import { Subject } from "rxjs";
4
4
  import { HttpContextToken, HttpInterceptorFn } from "@angular/common/http";
5
5
  import { QueuedNote, UiLabelsService, UiNotesQueue } from "@forgeroute/ui";
@@ -184,11 +184,22 @@ export declare class OfflineStore {
184
184
  }
185
185
  /** string = path prefix or substring after the origin is stripped; RegExp is tested on path + query. */
186
186
  export type UrlMatcher = string | RegExp;
187
+ /**
188
+ * What a {@link QueueRule.label} callback receives as its 4th argument: the app's injector, so the label can read app services (the signed-in company's
189
+ * user type, a language service ...) with `ctx.injector.get(Token)` or `runInInjectionContext(ctx.injector, () => inject(Token))`. It is the injector of the
190
+ * HTTP request being queued; the callback runs synchronously while the change is being queued.
191
+ */
192
+ export interface QueueLabelContext {
193
+ readonly injector: Injector;
194
+ }
187
195
  export interface QueueRule {
188
196
  pattern: RegExp;
189
197
  methods: readonly string[];
190
- /** Plain-words name of the change shown in the pending-changes list (e.g. "Add lot 12"). */
191
- label?: (method: string, url: string, body: unknown) => string;
198
+ /**
199
+ * Plain-words name of the change shown in the pending-changes list (e.g. "Add lot 12"). A callback that takes only (method, url, body) keeps working
200
+ * unchanged; the optional 4th argument is a {@link QueueLabelContext} for labels that need app state.
201
+ */
202
+ label?: (method: string, url: string, body: unknown, ctx: QueueLabelContext) => string;
192
203
  entityType?: (url: string) => string | undefined;
193
204
  }
194
205
  export interface OfflineSupportConfig {
@@ -385,6 +385,27 @@ export type BulkUpdateOption<T = any> = string | {
385
385
  * { field: 'status', allowedFrom: { SENT: ['DRAFT'] }, canChange: (row, target) => target !== 'SENT' || canSend(row) }
386
386
  */
387
387
  canChange?: (row: T, target: string) => boolean;
388
+ /**
389
+ * Field changes (`{ field, canApply }`): a rule on the WHOLE selection, in addition to the per-row `allowedFrom` / `canChange`. Called with every
390
+ * selected row of the loaded page and the target value; return `true` to allow, `false` (generic reason) or a string (the reason shown to the
391
+ * user) to refuse. Use it for a rule no single row can express ("an Archived invoice batch must all belong to one customer", "all rows must
392
+ * share the same status"). Keep it identical to the backend rule. A target it refuses is listed in the select but disabled, with a visible
393
+ * "<option>: <reason>" hint, and Apply re-checks it (a refused target is never confirmed or sent; the reason is shown as an error toast). A function that throws counts as
394
+ * refused. It only sees rows on the loaded page. Ignored for Delete and direct actions. Omit it and nothing changes.
395
+ *
396
+ * { field: 'status', canApply: (rows, target) => target !== 'MERGED' || new Set(rows.map(r => r.customerId)).size === 1 || 'Rows must belong to one customer.' }
397
+ */
398
+ canApply?: (rows: T[], target: string) => boolean | string;
399
+ /**
400
+ * Field changes (`{ field, listAll }`): list the FULL set of values in the "Change <column>" select instead of only the values the
401
+ * /filter-counts response currently carries (which omits values no row has yet). `true` = the filter-count values plus every target of
402
+ * `allowedFrom` that is not already listed; a list of values = exactly that set, in that order (labelled through the column's `badgeFn`). The
403
+ * `exclude`, `allowedFrom`, `canChange` and `canApply` rules and the "not already held by every selected row" rule still apply, so listing a
404
+ * value never offers a change the table knows the server refuses. An empty list is ignored. Omit it and nothing changes.
405
+ *
406
+ * { field: 'status', listAll: ['DRAFT', 'SENT', 'SIGNED', 'VOIDED'], allowedFrom: { SENT: ['DRAFT'], SIGNED: ['SENT'], VOIDED: ['DRAFT', 'SENT'] } }
407
+ */
408
+ listAll?: true | readonly string[];
388
409
  /**
389
410
  * Direct bulk action (`{ field: 'resend', action: true, label: 'Resend' }`): a bulk-bar button that is neither a field change nor
390
411
  * Delete. `field` is the action key (no column needed), the button type is `action-<field>` and there is no inline select.
@@ -501,6 +522,10 @@ export interface BulkActionDef {
501
522
  deletable?: (row: any) => boolean;
502
523
  /** Field changes: per-row check that the server will accept the move to a target (from `{ field, canChange }`). */
503
524
  canChange?: (row: any, target: string) => boolean;
525
+ /** Field changes: rule on the whole selection (from `{ field, canApply }`): true = allowed, false / a string = refused (the string is the reason). */
526
+ canApply?: (rows: any[], target: string) => boolean | string;
527
+ /** Field changes: list the full value set (from `{ field, listAll }`): `true` or the exact list of values. */
528
+ listAll?: true | readonly string[];
504
529
  /** True for a direct bulk action (from `{ field, action: true, label }`); `type` is `action-<key>` and `field` is not set (no inline select). */
505
530
  action?: boolean;
506
531
  /** Direct action: which rows the server will accept (from `{ field, action: true, eligible }`). */
@@ -2105,6 +2130,8 @@ export declare const UI_DEFAULT_LABELS: {
2105
2130
  readonly 'dataTable.skipAlreadyHas_other': "{{ count }} selected rows already have this value and will be skipped.";
2106
2131
  readonly 'dataTable.noChangesBlocked': "No changes — the selected rows can't be changed to {{ option }}.";
2107
2132
  readonly 'dataTable.noChangesAlready': "No changes — all selected {{ item }} already have {{ option }}.";
2133
+ readonly 'dataTable.bulkCannotApply': "The selected rows can't all be changed to {{ option }} together.";
2134
+ readonly 'dataTable.bulkOptionBlocked': "{{ option }}: {{ reason }}";
2108
2135
  readonly 'dataTable.doneUpdated': "updated";
2109
2136
  readonly 'dataTable.doneDeleted': "deleted";
2110
2137
  readonly 'dataTable.doneDownloaded': "downloaded";
@@ -2389,6 +2416,13 @@ export declare const UI_DEFAULT_LABELS: {
2389
2416
  readonly 'notificationBell.announce.none': "You have no unread notifications.";
2390
2417
  readonly 'notificationBell.announce.one': "You have 1 unread notification.";
2391
2418
  readonly 'notificationBell.announce.other': "You have {{ count }} unread notifications.";
2419
+ readonly 'stackingPlan.legend': "Legend";
2420
+ readonly 'stackingPlan.showTable': "Show as table";
2421
+ readonly 'stackingPlan.showPlan': "Show as plan";
2422
+ readonly 'stackingPlan.floor': "Floor";
2423
+ readonly 'stackingPlan.unit': "Unit";
2424
+ readonly 'stackingPlan.size': "Size";
2425
+ readonly 'stackingPlan.details': "Details";
2392
2426
  };
2393
2427
  export type UiLabelKey = keyof typeof UI_DEFAULT_LABELS;
2394
2428
  export type UiLabelDictionary = Partial<Record<UiLabelKey, string>>;
@@ -3854,8 +3888,17 @@ export declare class DataTableComponent<T extends Record<string, any>> implement
3854
3888
  private _actionKeyLabel;
3855
3889
  /** Runs a direct action's `eligible` predicate; a predicate that throws counts as "row not eligible". */
3856
3890
  private _isActionEligible;
3857
- /** Options for a field-based bulk action: the field's options minus the entry's `exclude` values. */
3891
+ /** Options for a field-based bulk action: the field's options (or, with `listAll`, its full value set) minus the entry's `exclude` values. */
3858
3892
  private _bulkOptionsFor;
3893
+ /**
3894
+ * `listAll` options: a list of values = exactly that set in that order; `true` = the usual options (filter counts, or the page's distinct values)
3895
+ * plus every `allowedFrom` target not yet listed. Labels go through the column's `badgeFn`, like the usual options. Blank and repeated values are dropped.
3896
+ */
3897
+ private _listAllOptions;
3898
+ /** The loaded-page rows the user has selected. */
3899
+ private _selectedRows;
3900
+ /** The `canApply` verdict of a bulk change for the whole selection: allowed, or the reason it is refused (a throwing rule refuses). */
3901
+ private _applyVerdict;
3859
3902
  /** True when a row whose field currently holds `current` may be moved to `target` by this action. */
3860
3903
  private _canBulkMove;
3861
3904
  /** True when `value` is in the action's `exclude` list (ignoring case, spaces, dashes and underscores). */
@@ -3871,10 +3914,16 @@ export declare class DataTableComponent<T extends Record<string, any>> implement
3871
3914
  protected _bulkSelectStr: string;
3872
3915
  /** Options for the active bulk action's inline select, filtered to exclude no-ops. */
3873
3916
  protected readonly _eligibleBulkOptions: Signal<{
3874
- [key: string]: any;
3875
3917
  value: string;
3876
3918
  label: string;
3919
+ disabled?: boolean;
3877
3920
  }[]>;
3921
+ /** Id prefix of the reason hints beside the inline select (the select is linked to them with aria-describedby). */
3922
+ protected readonly _bulkHintId: string;
3923
+ /** Space-separated ids of the reason hints, for the select's `aria-describedby` ('' = none, no attribute). */
3924
+ protected readonly _bulkOptionHintIds: Signal<string>;
3925
+ /** "<option>: <reason>" for each target the whole-selection rule (`canApply`) refuses right now; shown as visible text beside the inline select. */
3926
+ protected readonly _bulkOptionHints: Signal<string[]>;
3878
3927
  protected readonly _allSelected: Signal<boolean>;
3879
3928
  protected readonly _someSelected: Signal<boolean>;
3880
3929
  /**
@@ -5020,6 +5069,120 @@ export declare class StackedBarComponent {
5020
5069
  };
5021
5070
  }, {}, never, never, true, never>;
5022
5071
  }
5072
+ /** Library source 2026-11-11, not yet published. The colour of a unit of a `ui-stacking-plan`. */
5073
+ export type StackingVariant = 'green' | 'blue' | 'amber' | 'orange' | 'red' | 'slate' | 'purple' | 'teal' | 'gray';
5074
+ /** One unit (a suite) of a floor. */
5075
+ export interface StackingUnit {
5076
+ /** Stable id (emitted with the click, matched by `selectedId`). */
5077
+ id: string;
5078
+ /** Short name drawn on the unit and read out first (a suite number). */
5079
+ label: string;
5080
+ /** Size of the unit (any unit: square feet). Units of a floor share the floor's width by their size; a size of 0 or less counts as 1 so the unit stays visible. */
5081
+ size: number;
5082
+ variant: StackingVariant;
5083
+ /** What the unit is, as text: tenant, lease end ... It is the unit's accessible description, the tooltip (when `tooltip` is empty) and the "Details" cell of the table view. */
5084
+ description: string;
5085
+ /** Tooltip text on hover and keyboard focus; defaults to `description`. */
5086
+ tooltip?: string;
5087
+ }
5088
+ /** One floor: a row of units. Floors are drawn in the order given (put the top floor first). */
5089
+ export interface StackingFloor {
5090
+ key: string;
5091
+ label: string;
5092
+ units: StackingUnit[];
5093
+ }
5094
+ /** One legend entry: the colour and what it means. */
5095
+ export interface StackingLegendItem {
5096
+ variant: StackingVariant;
5097
+ label: string;
5098
+ }
5099
+ /**
5100
+ * A stacking plan: a building drawn floor by floor, each floor a row of unit buttons whose widths follow their size (and whose floor rows follow the floor's total against the largest floor), coloured by a
5101
+ * `variant` the host chooses (occupancy, lease-expiry year ...). Every unit is a real button: Tab reaches it, Enter / Space emit `(unitClick)`, the arrow keys move between units (left / right on a floor, up / down
5102
+ * between floors, Home / End on a floor), a tooltip shows on hover AND keyboard focus (library `uiTooltip`), and the button's accessible name is "<label>: <description>" inside a group named by its floor label. A tooltip that only repeats the description sits on a wrapper around the button (so a screen reader does not read the same text twice: name + description); a different `tooltip` text sits on the button and is read as its description. Colour never carries the meaning alone: the legend names
5103
+ * every colour and the "Show as table" button swaps the drawing for a real table (Floor, Unit, Size, Details) with the same facts, for screen reader users and anyone who prefers rows. On a phone the floor label sits
5104
+ * above its row and units wrap onto further lines at 44px minimum. Pure CSS, no chart library; forced-colors mode draws borders.
5105
+ *
5106
+ * Inputs: `floors`, `legend`, `ariaLabel` (the plan's name; also the table caption), `selectedId`, `formatSize` (default: a grouped number in the active locale).
5107
+ * Output: `unitClick` (the StackingUnit).
5108
+ */
5109
+ export declare class StackingPlanComponent {
5110
+ /** Unique per plan: the ids that name each floor's group. */
5111
+ protected readonly uid: string;
5112
+ protected readonly labels: UiLabelsService;
5113
+ private readonly host;
5114
+ readonly floors: import("@angular/core").InputSignal<StackingFloor[]>;
5115
+ readonly legend: import("@angular/core").InputSignal<StackingLegendItem[]>;
5116
+ readonly ariaLabel: import("@angular/core").InputSignal<string>;
5117
+ readonly selectedId: import("@angular/core").InputSignal<string | null>;
5118
+ readonly formatSize: import("@angular/core").InputSignal<((size: number) => string) | null>;
5119
+ readonly unitClick: import("@angular/core").OutputEmitterRef<StackingUnit>;
5120
+ /** Whether the table view is shown instead of the drawing. */
5121
+ protected readonly asTable: import("@angular/core").WritableSignal<boolean>;
5122
+ private format;
5123
+ /** The floors prepared for drawing: each unit's weight (its size, at least 1), accessible name and tooltip, and the floor's width against the widest floor. */
5124
+ protected readonly rows: import("@angular/core").Signal<{
5125
+ key: string;
5126
+ label: string;
5127
+ widthPct: number;
5128
+ units: {
5129
+ id: string;
5130
+ label: string;
5131
+ variant: StackingVariant;
5132
+ weight: number;
5133
+ name: string;
5134
+ tip: string;
5135
+ sameTip: boolean;
5136
+ unit: StackingUnit;
5137
+ }[];
5138
+ }[]>;
5139
+ /** One row per unit for the table view. */
5140
+ protected readonly tableRows: import("@angular/core").Signal<{
5141
+ id: string;
5142
+ floor: string;
5143
+ label: string;
5144
+ sizeText: string;
5145
+ description: string;
5146
+ }[]>;
5147
+ private weight;
5148
+ protected swatchClass(variant: StackingVariant): string;
5149
+ protected unitClass(u: {
5150
+ variant: StackingVariant;
5151
+ id: string;
5152
+ }): string;
5153
+ /** Arrow keys move the focus: left / right along a floor, up / down to the same position on the next floor, Home / End to the ends of the floor. */
5154
+ protected onKey(event: KeyboardEvent): void;
5155
+ static ɵfac: i0.ɵɵFactoryDeclaration<StackingPlanComponent, never>;
5156
+ static ɵcmp: i0.ɵɵComponentDeclaration<StackingPlanComponent, "ui-stacking-plan", never, {
5157
+ "floors": {
5158
+ "alias": "floors";
5159
+ "required": false;
5160
+ "isSignal": true;
5161
+ };
5162
+ "legend": {
5163
+ "alias": "legend";
5164
+ "required": false;
5165
+ "isSignal": true;
5166
+ };
5167
+ "ariaLabel": {
5168
+ "alias": "ariaLabel";
5169
+ "required": false;
5170
+ "isSignal": true;
5171
+ };
5172
+ "selectedId": {
5173
+ "alias": "selectedId";
5174
+ "required": false;
5175
+ "isSignal": true;
5176
+ };
5177
+ "formatSize": {
5178
+ "alias": "formatSize";
5179
+ "required": false;
5180
+ "isSignal": true;
5181
+ };
5182
+ }, {
5183
+ "unitClick": "unitClick";
5184
+ }, never, never, true, never>;
5185
+ }
5023
5186
  export type ProgressRingVariant = 'blue' | 'green' | 'amber' | 'red' | 'slate' | 'sky';
5024
5187
  /**
5025
5188
  * Circular progress ring with the rounded percentage (or a custom `label`) in the middle.
@@ -5140,7 +5303,7 @@ export declare class AudioPlayerComponent {
5140
5303
  /** Accessible name of the player. */
5141
5304
  readonly ariaLabel: import("@angular/core").InputSignal<string>;
5142
5305
  /** How much to load before play: 'metadata' (default), 'auto' or 'none'. */
5143
- readonly preload: import("@angular/core").InputSignal<"metadata" | "auto" | "none">;
5306
+ readonly preload: import("@angular/core").InputSignal<"auto" | "none" | "metadata">;
5144
5307
  /** Fires when the browser can't load or decode the source. */
5145
5308
  readonly playbackError: import("@angular/core").OutputEmitterRef<void>;
5146
5309
  protected readonly failed: import("@angular/core").WritableSignal<boolean>;
@@ -5694,7 +5857,7 @@ export declare class CheckboxComponent implements ControlValueAccessor, Validato
5694
5857
  * clicking it still toggles the box - e.g. a product name that is both the heading of its card and the label of its checkbox.
5695
5858
  * Default null: plain label text, exactly as before. Single mode only.
5696
5859
  */
5697
- readonly headingLevel: import("@angular/core").InputSignal<1 | 4 | 5 | 2 | 3 | 6 | null>;
5860
+ readonly headingLevel: import("@angular/core").InputSignal<1 | 2 | 3 | 4 | 5 | 6 | null>;
5698
5861
  readonly indeterminate: import("@angular/core").InputSignal<boolean>;
5699
5862
  readonly checked: import("@angular/core").ModelSignal<boolean>;
5700
5863
  /**
@@ -6791,7 +6954,7 @@ export declare class ButtonComponent {
6791
6954
  * `ghost-start`: a ghost button for list / section toggles - a full-width row with its content aligned to the start, transparent
6792
6955
  * background, hover tint and the normal focus ring. Pair it with `ariaExpanded` / `ariaPressed`; the label may contain a heading element.
6793
6956
  */
6794
- readonly variant: import("@angular/core").InputSignal<"link" | "ghost" | "primary" | "secondary" | "danger" | "warning" | "ghost-start" | "tab" | "icon" | "icon-danger">;
6957
+ readonly variant: import("@angular/core").InputSignal<"primary" | "secondary" | "danger" | "warning" | "link" | "ghost" | "ghost-start" | "tab" | "icon" | "icon-danger">;
6795
6958
  /** 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`). */
6796
6959
  readonly routerLink: import("@angular/core").InputSignal<string | readonly unknown[] | null>;
6797
6960
  /** Query params of the `routerLink` (e.g. `{ section: 'deal-defaults' }`). */
@@ -6837,7 +7000,7 @@ export declare class ButtonComponent {
6837
7000
  readonly color: import("@angular/core").InputSignal<string | undefined>;
6838
7001
  readonly active: import("@angular/core").InputSignal<boolean>;
6839
7002
  readonly size: import("@angular/core").InputSignal<"sm" | "md" | "lg" | "xs">;
6840
- readonly type: import("@angular/core").InputSignal<"button" | "reset" | "submit">;
7003
+ readonly type: import("@angular/core").InputSignal<"reset" | "submit" | "button">;
6841
7004
  readonly disabled: import("@angular/core").InputSignal<boolean>;
6842
7005
  readonly loading: import("@angular/core").InputSignal<boolean>;
6843
7006
  readonly fullWidth: import("@angular/core").InputSignal<boolean>;
@@ -7977,7 +8140,7 @@ export declare class TextInputComponent implements ControlValueAccessor, Validat
7977
8140
  * `search`, `text`, `none`). Empty (default) = the browser's default for the field, except `type="tel"`, which keeps `tel`.
7978
8141
  * It only picks the keyboard; it does not restrict what can be typed or pasted.
7979
8142
  */
7980
- readonly inputmode: import("@angular/core").InputSignal<"" | "email" | "text" | "decimal" | "search" | "numeric" | "none" | "tel" | "url">;
8143
+ readonly inputmode: import("@angular/core").InputSignal<"" | "email" | "text" | "numeric" | "decimal" | "none" | "search" | "tel" | "url">;
7981
8144
  readonly readonly: import("@angular/core").InputSignal<boolean>;
7982
8145
  readonly hint: import("@angular/core").InputSignal<string>;
7983
8146
  /** 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. */
@@ -9799,7 +9962,7 @@ export declare class DropdownComponent {
9799
9962
  readonly loader: import("@angular/core").InputSignal<(() => Promise<DropdownItem[]>) | null>;
9800
9963
  readonly active: import("@angular/core").InputSignal<boolean>;
9801
9964
  readonly activeValue: import("@angular/core").InputSignal<string>;
9802
- readonly variant: import("@angular/core").InputSignal<"button" | "badge">;
9965
+ readonly variant: import("@angular/core").InputSignal<"badge" | "button">;
9803
9966
  /** Trigger size for `variant="button"`: `sm` (default, the compact toolbar look) or `md` (same padding and type as a medium `ui-button`). */
9804
9967
  readonly size: import("@angular/core").InputSignal<"sm" | "md">;
9805
9968
  readonly menuWidth: import("@angular/core").InputSignal<string>;
@@ -10115,7 +10278,7 @@ export declare class FormSectionComponent {
10115
10278
  }, {}, never, ["*"], true, never>;
10116
10279
  }
10117
10280
  export declare class FormRowComponent {
10118
- readonly cols: import("@angular/core").InputSignal<1 | 4 | 2 | 3>;
10281
+ readonly cols: import("@angular/core").InputSignal<1 | 2 | 3 | 4>;
10119
10282
  static ɵfac: i0.ɵɵFactoryDeclaration<FormRowComponent, never>;
10120
10283
  static ɵcmp: i0.ɵɵComponentDeclaration<FormRowComponent, "ui-form-row", never, {
10121
10284
  "cols": {
@@ -10132,7 +10295,7 @@ export declare class FormRowComponent {
10132
10295
  * child simply takes the full width. Keep a numeric span within the row's `cols` (use `all` for the whole row).
10133
10296
  */
10134
10297
  export declare class FormColSpanDirective {
10135
- readonly uiColSpan: import("@angular/core").InputSignal<"" | "2" | 2 | 3 | "3" | "all">;
10298
+ readonly uiColSpan: import("@angular/core").InputSignal<"" | 2 | 3 | "2" | "3" | "all">;
10136
10299
  protected readonly _class: import("@angular/core").Signal<string>;
10137
10300
  static ɵfac: i0.ɵɵFactoryDeclaration<FormColSpanDirective, never>;
10138
10301
  static ɵdir: i0.ɵɵDirectiveDeclaration<FormColSpanDirective, "[uiColSpan]", never, {
@@ -11524,6 +11687,21 @@ export type ErrorAction = 'load' | 'save' | 'create' | 'update' | 'delete' | 'se
11524
11687
  * re-thrown unchanged (same instance), so `instanceof HttpErrorResponse` checks keep working.
11525
11688
  */
11526
11689
  export declare const errorContextInterceptor: HttpInterceptorFn;
11690
+ /**
11691
+ * Whole fallback sentences an app supplies instead of a bare noun phrase, so a translated app never gets an English noun inside a sentence of another
11692
+ * language. Pass it as the 2nd argument of {@link getErrorMessage} in place of the `fallbackContext` string. Texts are used exactly as given (no
11693
+ * placeholders, no article handling) except that they are trimmed and `failed` gets a full stop when it does not already end with sentence punctuation; a missing or blank entry falls back to the library's own sentence built from `context` (default "data").
11694
+ */
11695
+ export interface ErrorFallback {
11696
+ /** The sentence for "it failed" (no server message; status 0, 408, 429, 5xx, other statuses, an unknown error), e.g. "No se pudo guardar el contacto.". The library's follow-up ("Please try again.") is appended after it as before. */
11697
+ failed?: string;
11698
+ /** The whole 403 sentence, e.g. "No tienes permiso para guardar el contacto.". */
11699
+ noPermission?: string;
11700
+ /** The whole 404 sentence, e.g. "No se encontró el contacto.". */
11701
+ notFound?: string;
11702
+ /** Noun phrase used by any library sentence this object does not replace (same rules as the string form). */
11703
+ context?: string;
11704
+ }
11527
11705
  /**
11528
11706
  * Extracts a user-friendly error message from any error response.
11529
11707
  * Prioritizes: backend message > status text > typed fallback.
@@ -11534,8 +11712,11 @@ export declare const errorContextInterceptor: HttpInterceptorFn;
11534
11712
  * `fallbackContext` is a bare noun phrase ("contact", "your invoices"); an empty or whitespace-only one becomes "data".
11535
11713
  * The 404 text starts with "The <context>", so one leading article ("the", "a", "an") on the context is dropped
11536
11714
  * there: "the contact" and "a contact" both read "The contact you're looking for could not be found.".
11715
+ *
11716
+ * `fallbackContext` may instead be an {@link ErrorFallback} carrying the whole sentences (`failed`, `noPermission`, `notFound`), for apps whose language the
11717
+ * library's "There was an error <verb> <noun>." template does not fit. The string form is unchanged.
11537
11718
  */
11538
- export declare function getErrorMessage(error: unknown, fallbackContext?: string, action?: ErrorAction): string;
11719
+ export declare function getErrorMessage(error: unknown, fallbackContext?: string | ErrorFallback, action?: ErrorAction): string;
11539
11720
  export interface UsStateOption {
11540
11721
  value: string;
11541
11722
  label: string;
@@ -14362,7 +14543,7 @@ export declare class DetailCardComponent {
14362
14543
  /** true (default) = the title is displayed in capitals (CSS only); false = shown as written. The text, aria-label and heading name are never changed. */
14363
14544
  readonly uppercaseTitle: import("@angular/core").InputSignal<boolean>;
14364
14545
  /** 1-6 makes the title a real heading for screen readers (role=heading, aria-level); null keeps it plain text. */
14365
- readonly headingLevel: import("@angular/core").InputSignal<1 | 4 | 5 | 2 | 3 | 6 | null>;
14546
+ readonly headingLevel: import("@angular/core").InputSignal<1 | 2 | 3 | 4 | 5 | 6 | null>;
14366
14547
  /** Optional id for the title text; the card is then labelled by it. Without it the title is the card's aria-label. */
14367
14548
  readonly titleId: import("@angular/core").InputSignal<string>;
14368
14549
  /** Accessible name of the card when the header gives none (no header, or no title). A visible title wins; blank = no name. */
@@ -14376,7 +14557,7 @@ export declare class DetailCardComponent {
14376
14557
  /** Background colour of the footer bar (the `[card-footer]` slot) as any CSS colour. Empty = no colour of its own. */
14377
14558
  readonly footerBackground: import("@angular/core").InputSignal<string>;
14378
14559
  /** Alignment of the `[card-footer]` content: `'start'` (default, unchanged) or `'end'` = a right-aligned action row with an 8px gap. */
14379
- readonly footerAlign: import("@angular/core").InputSignal<"end" | "start">;
14560
+ readonly footerAlign: import("@angular/core").InputSignal<"start" | "end">;
14380
14561
  /** Text colour as any CSS colour (`#fff`, `var(--on-dark)` …). Empty = the default colours. Colours the title, subtitle, chevron and body text. */
14381
14562
  readonly textColor: import("@angular/core").InputSignal<string>;
14382
14563
  /** false = no header at all (no title, edit button, toggle or divider): the card is only the body, always open. */
@@ -19902,21 +20083,38 @@ export interface ModuleLabelOverrides<K extends string = string> {
19902
20083
  en?: Partial<Readonly<Record<K, string>>>;
19903
20084
  es?: Partial<Readonly<Record<K, string>>>;
19904
20085
  }
20086
+ /**
20087
+ * Where the overrides of one `provideModuleLabelOverrides` call come from: a plain object (read once, as always) or a function - typically a `computed` / signal
20088
+ * - that returns the overrides and is called on EVERY text lookup, so the texts follow runtime state (the signed-in company's user type ...) and an OnPush
20089
+ * template that reads them re-renders when a signal the function reads changes. A function that returns null / undefined / a non-object contributes nothing.
20090
+ */
20091
+ export type ModuleLabelOverridesSource<K extends string = string> = ModuleLabelOverrides<K> | (() => ModuleLabelOverrides<K> | null | undefined);
20092
+ interface CleanOverrides {
20093
+ readonly en: Record<string, string>;
20094
+ readonly es: Record<string, string>;
20095
+ }
19905
20096
  /**
19906
20097
  * Lets the host app change single texts of a module, with the semantics of `UiLabelsService.setLabels`: a key the module does not have is ignored, a blank text
19907
20098
  * is ignored (the module's own text stays) and the placeholders must be exactly those of the module's English text of that key (otherwise ignored).
19908
20099
  * Several calls for one namespace merge; the later one wins.
20100
+ * `overrides` may also be a function / signal returning the overrides (see {@link ModuleLabelOverridesSource}): it is evaluated on every lookup with the same
20101
+ * rules, so the texts follow runtime state. A static object behaves exactly as before.
19909
20102
  */
19910
- export declare function provideModuleLabelOverrides<K extends string = string>(namespace: string | Pick<ModuleLabelsHandle<K>, 'namespace'>, overrides: ModuleLabelOverrides<K>): EnvironmentProviders;
20103
+ export declare function provideModuleLabelOverrides<K extends string = string>(namespace: string | Pick<ModuleLabelsHandle<K>, 'namespace'>, overrides: ModuleLabelOverridesSource<K>): EnvironmentProviders;
19911
20104
  type Status = 'idle' | 'loading' | 'done' | 'failed';
19912
20105
  interface ModuleState {
19913
20106
  readonly handle: ModuleLabelsHandle<string>;
19914
20107
  readonly status: WritableSignal<Status>;
19915
20108
  readonly spanish: WritableSignal<Readonly<Record<string, string>> | null>;
20109
+ /** The merged overrides of the static entries; the whole answer when `sources` is null. */
19916
20110
  readonly overrides: {
19917
20111
  en: Record<string, string>;
19918
20112
  es: Record<string, string>;
19919
20113
  };
20114
+ /** Only set when at least one entry is a function: every entry of the namespace in registration order, merged afresh on each lookup. */
20115
+ readonly sources: readonly (CleanOverrides | (() => ModuleLabelOverrides | null | undefined))[] | null;
20116
+ /** Set once a function entry threw and the dev warning was shown. */
20117
+ warned?: boolean;
19920
20118
  }
19921
20119
  /** Root-level store of the module labels of one application: language, lazily loaded Spanish dictionaries (once per module), host overrides. */
19922
20120
  export declare class ModuleLabelsRegistry implements OnDestroy {
@@ -19932,6 +20130,8 @@ export declare class ModuleLabelsRegistry implements OnDestroy {
19932
20130
  stateFor(handle: ModuleLabelsHandle<string>): ModuleState;
19933
20131
  /** Downloads the Spanish texts once per module (a failed download is tried again the next time Spanish becomes active). */
19934
20132
  private load;
20133
+ /** The overrides in force right now: the precomputed static merge, or (a function / signal entry exists) a fresh merge of every entry in order. A throwing function counts as no overrides. */
20134
+ private currentOverrides;
19935
20135
  create<K extends string>(handle: ModuleLabelsHandle<K>): ModuleLabels<K>;
19936
20136
  static ɵfac: i0.ɵɵFactoryDeclaration<ModuleLabelsRegistry, never>;
19937
20137
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;