@forgeroute/ui 0.4.97 → 0.4.99

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.97",
3
+ "version": "0.4.99",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=22.0.0",
6
6
  "@angular/core": ">=22.0.0",
@@ -3750,6 +3750,8 @@ export declare class DataTableComponent<T extends Record<string, any>> implement
3750
3750
  * Rows with nothing to show get no "⋮" trigger; the Actions column is dropped when no row has View.
3751
3751
  */
3752
3752
  readonly permission: import("@angular/core").InputSignal<TablePermission>;
3753
+ /** The app's optional central read-only switch (`provideReadOnlyMode`): while it is on, every table is read-only whatever its `permission` says. Off / not provided = no effect. */
3754
+ private readonly _readOnlyMode;
3753
3755
  protected readonly _canEdit: Signal<boolean>;
3754
3756
  /** Enable row checkboxes and selection count bar (without bulk actions). */
3755
3757
  readonly selectable: import("@angular/core").InputSignal<boolean>;
@@ -4704,7 +4706,7 @@ export declare class ModalComponent implements OnInit, OnDestroy {
4704
4706
  */
4705
4707
  readonly describedBy: import("@angular/core").InputSignal<string | null>;
4706
4708
  readonly maxWidth: import("@angular/core").InputSignal<string>;
4707
- readonly bodyOverflow: import("@angular/core").InputSignal<"auto" | "visible" | "hidden">;
4709
+ readonly bodyOverflow: import("@angular/core").InputSignal<"auto" | "hidden" | "visible">;
4708
4710
  /** `data-testid` of the dialog element itself (the host `<ui-modal>` is always in the page, the dialog only while open). None when empty. */
4709
4711
  readonly dialogTestId: import("@angular/core").InputSignal<string>;
4710
4712
  /** Hides the header X button (e.g. while a request is running). Escape and a backdrop click still close unless `closable` is false. */
@@ -5483,7 +5485,7 @@ export declare class AudioPlayerComponent {
5483
5485
  /** Accessible name of the player. */
5484
5486
  readonly ariaLabel: import("@angular/core").InputSignal<string>;
5485
5487
  /** How much to load before play: 'metadata' (default), 'auto' or 'none'. */
5486
- readonly preload: import("@angular/core").InputSignal<"none" | "auto" | "metadata">;
5488
+ readonly preload: import("@angular/core").InputSignal<"auto" | "none" | "metadata">;
5487
5489
  /** Fires when the browser can't load or decode the source. */
5488
5490
  readonly playbackError: import("@angular/core").OutputEmitterRef<void>;
5489
5491
  protected readonly failed: import("@angular/core").WritableSignal<boolean>;
@@ -6037,7 +6039,7 @@ export declare class CheckboxComponent implements ControlValueAccessor, Validato
6037
6039
  * 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.
6038
6040
  * Default null: plain label text, exactly as before. Single mode only.
6039
6041
  */
6040
- readonly headingLevel: import("@angular/core").InputSignal<3 | 2 | 1 | 4 | 5 | 6 | null>;
6042
+ readonly headingLevel: import("@angular/core").InputSignal<1 | 2 | 3 | 4 | 5 | 6 | null>;
6041
6043
  readonly indeterminate: import("@angular/core").InputSignal<boolean>;
6042
6044
  readonly checked: import("@angular/core").ModelSignal<boolean>;
6043
6045
  /**
@@ -7018,7 +7020,7 @@ export declare class PhoneNumberPickerComponent {
7018
7020
  protected readonly modeCtl: FormControl<string>;
7019
7021
  protected readonly zipCtl: FormControl<string>;
7020
7022
  protected readonly areaCtl: FormControl<string>;
7021
- protected readonly step: import("@angular/core").WritableSignal<3 | 2 | 1>;
7023
+ protected readonly step: import("@angular/core").WritableSignal<1 | 2 | 3>;
7022
7024
  protected readonly mode: import("@angular/core").WritableSignal<PhoneNumberSearchMode>;
7023
7025
  private readonly _zip;
7024
7026
  private readonly _area;
@@ -7134,7 +7136,7 @@ export declare class ButtonComponent {
7134
7136
  * `ghost-start`: a ghost button for list / section toggles - a full-width row with its content aligned to the start, transparent
7135
7137
  * background, hover tint and the normal focus ring. Pair it with `ariaExpanded` / `ariaPressed`; the label may contain a heading element.
7136
7138
  */
7137
- readonly variant: import("@angular/core").InputSignal<"link" | "primary" | "danger" | "warning" | "secondary" | "ghost" | "ghost-start" | "tab" | "icon" | "icon-danger">;
7139
+ readonly variant: import("@angular/core").InputSignal<"primary" | "secondary" | "danger" | "warning" | "link" | "ghost" | "ghost-start" | "tab" | "icon" | "icon-danger">;
7138
7140
  /** 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`). */
7139
7141
  readonly routerLink: import("@angular/core").InputSignal<string | readonly unknown[] | null>;
7140
7142
  /** Query params of the `routerLink` (e.g. `{ section: 'deal-defaults' }`). */
@@ -7155,7 +7157,7 @@ export declare class ButtonComponent {
7155
7157
  */
7156
7158
  readonly href: import("@angular/core").InputSignal<string | null>;
7157
7159
  /** Where to open the `href` (`_blank` = a new tab). */
7158
- readonly target: import("@angular/core").InputSignal<"_blank" | "_self" | "_parent" | "_top" | null>;
7160
+ readonly target: import("@angular/core").InputSignal<"_self" | "_blank" | "_parent" | "_top" | null>;
7159
7161
  /** `rel` of the `href` link. A `_blank` target always gets `noopener noreferrer` added. */
7160
7162
  readonly rel: import("@angular/core").InputSignal<string | null>;
7161
7163
  /** The href when it is allowed (http, https, mailto, tel, sms or a relative URL), else null. */
@@ -7430,7 +7432,7 @@ export declare class PillTabsComponent {
7430
7432
  */
7431
7433
  readonly showDescription: import("@angular/core").InputSignal<boolean>;
7432
7434
  /** Heading level of the active tab's title when `showDescription` is on: 2 (default) or 3. */
7433
- readonly headingLevel: import("@angular/core").InputSignal<3 | 2>;
7435
+ readonly headingLevel: import("@angular/core").InputSignal<2 | 3>;
7434
7436
  readonly tabChange: import("@angular/core").OutputEmitterRef<string>;
7435
7437
  protected readonly activeTab: import("@angular/core").Signal<PillTab | null>;
7436
7438
  protected titleId(): string;
@@ -8323,7 +8325,7 @@ export declare class TextInputComponent implements ControlValueAccessor, Validat
8323
8325
  * `search`, `text`, `none`). Empty (default) = the browser's default for the field, except `type="tel"`, which keeps `tel`.
8324
8326
  * It only picks the keyboard; it does not restrict what can be typed or pasted.
8325
8327
  */
8326
- readonly inputmode: import("@angular/core").InputSignal<"" | "email" | "text" | "decimal" | "none" | "tel" | "url" | "numeric" | "search">;
8328
+ readonly inputmode: import("@angular/core").InputSignal<"" | "numeric" | "decimal" | "email" | "text" | "none" | "search" | "tel" | "url">;
8327
8329
  readonly readonly: import("@angular/core").InputSignal<boolean>;
8328
8330
  readonly hint: import("@angular/core").InputSignal<string>;
8329
8331
  /** 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. */
@@ -9348,7 +9350,7 @@ export declare class CopyFieldComponent implements OnDestroy {
9348
9350
  /** Neither the Clipboard API nor the fallback could copy. */
9349
9351
  readonly copyFailed: import("@angular/core").OutputEmitterRef<void>;
9350
9352
  protected readonly _id: string;
9351
- protected readonly _state: import("@angular/core").WritableSignal<"idle" | "failed" | "copied">;
9353
+ protected readonly _state: import("@angular/core").WritableSignal<"idle" | "copied" | "failed">;
9352
9354
  protected readonly _announcement: import("@angular/core").Signal<string>;
9353
9355
  protected readonly _buttonName: import("@angular/core").Signal<string>;
9354
9356
  protected readonly _describedBy: import("@angular/core").Signal<string | null>;
@@ -10477,7 +10479,7 @@ export declare class FormSectionComponent {
10477
10479
  }, {}, never, ["*"], true, never>;
10478
10480
  }
10479
10481
  export declare class FormRowComponent {
10480
- readonly cols: import("@angular/core").InputSignal<3 | 2 | 1 | 4>;
10482
+ readonly cols: import("@angular/core").InputSignal<1 | 2 | 3 | 4>;
10481
10483
  static ɵfac: i0.ɵɵFactoryDeclaration<FormRowComponent, never>;
10482
10484
  static ɵcmp: i0.ɵɵComponentDeclaration<FormRowComponent, "ui-form-row", never, {
10483
10485
  "cols": {
@@ -10494,7 +10496,7 @@ export declare class FormRowComponent {
10494
10496
  * child simply takes the full width. Keep a numeric span within the row's `cols` (use `all` for the whole row).
10495
10497
  */
10496
10498
  export declare class FormColSpanDirective {
10497
- readonly uiColSpan: import("@angular/core").InputSignal<"" | 3 | 2 | "3" | "2" | "all">;
10499
+ readonly uiColSpan: import("@angular/core").InputSignal<"" | 2 | 3 | "2" | "3" | "all">;
10498
10500
  protected readonly _class: import("@angular/core").Signal<string>;
10499
10501
  static ɵfac: i0.ɵɵFactoryDeclaration<FormColSpanDirective, never>;
10500
10502
  static ɵdir: i0.ɵɵDirectiveDeclaration<FormColSpanDirective, "[uiColSpan]", never, {
@@ -11810,7 +11812,7 @@ export declare class ChipGroupComponent {
11810
11812
  readonly spaceAbove: import("@angular/core").InputSignal<"none" | "sm" | "md">;
11811
11813
  /** Space below the chip group. */
11812
11814
  readonly spaceBelow: import("@angular/core").InputSignal<"none" | "sm" | "md">;
11813
- protected readonly _gap: import("@angular/core").Signal<"8px" | "6px" | "12px">;
11815
+ protected readonly _gap: import("@angular/core").Signal<"6px" | "12px" | "8px">;
11814
11816
  protected readonly _spaceAbove: import("@angular/core").Signal<"0" | "6px" | "12px">;
11815
11817
  protected readonly _spaceBelow: import("@angular/core").Signal<"0" | "6px" | "12px">;
11816
11818
  static ɵfac: i0.ɵɵFactoryDeclaration<ChipGroupComponent, never>;
@@ -11931,6 +11933,21 @@ export interface UsStateOption {
11931
11933
  export declare const US_STATES: UsStateOption[];
11932
11934
  /** The name of a state in the app's active language (`usState.<code>` labels); the given English name when the code is unknown. */
11933
11935
  export declare function usStateName(code: string, fallback?: string): string;
11936
+ /**
11937
+ * THE State select options for every app, so every State dropdown shows the same names in the same order: the 50 states (+ DC only with `includeDc: true`),
11938
+ * each labelled with the state NAME (in the app's active language when the `usState.<code>` labels have one, else English), sorted A to Z by that label.
11939
+ * `store` is what the form saves: `'code'` (default) = the two-letter code, `'name'` = the English state name. `label` overrides how a state is worded
11940
+ * (an app that keeps its own translations of the names). Pass the result to `<ui-select [options]>` or `<ui-address-input [states]>`.
11941
+ */
11942
+ export declare function usStateSelectOptions(opts?: {
11943
+ store?: 'code' | 'name';
11944
+ includeDc?: boolean;
11945
+ label?: (state: UsStateOption) => string;
11946
+ locale?: string;
11947
+ }): {
11948
+ value: string;
11949
+ label: string;
11950
+ }[];
11934
11951
  /**
11935
11952
  * The 50 US states (no DC) with their major cities, keyed by two-letter state code: `US_LOCATIONS['TX']` -> `['Abilene', ...]`. Cities are unique and
11936
11953
  * trimmed per state. Use it for a city picker that follows a state select (the state names are in `US_STATES`).
@@ -12257,7 +12274,7 @@ export declare class IconComponent {
12257
12274
  readonly ariaLabel: import("@angular/core").InputSignal<string>;
12258
12275
  /** Icon size in px. */
12259
12276
  readonly size: import("@angular/core").InputSignal<number>;
12260
- readonly variant: import("@angular/core").InputSignal<"danger" | "default">;
12277
+ readonly variant: import("@angular/core").InputSignal<"default" | "danger">;
12261
12278
  readonly disabled: import("@angular/core").InputSignal<boolean>;
12262
12279
  /** The host is running the request this icon started: a spinner replaces the picture and the button is disabled (no click) until it is false again. */
12263
12280
  readonly loading: import("@angular/core").InputSignal<boolean>;
@@ -12761,7 +12778,7 @@ export declare class AddressInputComponent implements ControlValueAccessor, Vali
12761
12778
  * the object. `valueChange` always emits the object. A written string is read with `parseAddressValue` for display only: the control keeps
12762
12779
  * the original text until the user edits a field (so a text the parser cannot split is not rewritten on load).
12763
12780
  */
12764
- readonly valueFormat: import("@angular/core").InputSignal<"object" | "text" | "auto">;
12781
+ readonly valueFormat: import("@angular/core").InputSignal<"object" | "auto" | "text">;
12765
12782
  /** ZIP rule; the default is the US 5 digits / 5+4 rule. `null` accepts any non-empty ZIP. The ZIP is validated and stored trimmed. */
12766
12783
  readonly zipPattern: import("@angular/core").InputSignal<RegExp | null>;
12767
12784
  /** Message shown when the ZIP breaks `zipPattern`. */
@@ -13394,6 +13411,31 @@ export declare class LiveRegionComponent {
13394
13411
  };
13395
13412
  }, {}, never, never, true, never>;
13396
13413
  }
13414
+ /**
13415
+ * The app's ONE central "everything is read-only right now" switch (optional).
13416
+ *
13417
+ * Some apps have a state in which the whole signed-in area must be view-only for reasons that are not a user's role: an expired trial or sandbox, a suspended
13418
+ * account, a maintenance window. The server refuses the writes anyway, but without this every page still offers Add / Edit / Delete and each one fails on its own.
13419
+ * Provide this once and every `<ui-data-table>` in the app behaves exactly as if its `[permission]` were not `'full'` (no Add / Import / bulk actions / checkbox
13420
+ * column / mutating row actions: see `DataTableComponent.permission`); pages that have their own buttons read it with {@link injectReadOnlyMode}.
13421
+ *
13422
+ * Nothing changes for an app that does not provide it: the table and every helper behave exactly as before.
13423
+ */
13424
+ export interface ReadOnlyMode {
13425
+ /** `true` while the app is read-only. A signal, so screens follow it live (it may flip while a page is open). */
13426
+ readonly active: Signal<boolean>;
13427
+ }
13428
+ export declare const UI_READ_ONLY_MODE: InjectionToken<ReadOnlyMode>;
13429
+ /**
13430
+ * Provides the central read-only switch. `active` runs once, in an injection context, so it can `inject()` the app's own state service:
13431
+ *
13432
+ * ```ts
13433
+ * provideReadOnlyMode(() => inject(SandboxService).expired)
13434
+ * ```
13435
+ */
13436
+ export declare function provideReadOnlyMode(active: () => Signal<boolean>): Provider;
13437
+ /** The central read-only signal (always `false` when the app did not provide one). Call it in an injection context (a field initialiser or constructor). */
13438
+ export declare function injectReadOnlyMode(): Signal<boolean>;
13397
13439
  /**
13398
13440
  * Inline field error for controls that have no `error` input of their own — e.g. an app-specific
13399
13441
  * picker. Renders exactly like the library inputs' own field error (small red text under the field,
@@ -14780,7 +14822,7 @@ export declare class DetailCardComponent {
14780
14822
  /** true (default) = the title is displayed in capitals (CSS only); false = shown as written. The text, aria-label and heading name are never changed. */
14781
14823
  readonly uppercaseTitle: import("@angular/core").InputSignal<boolean>;
14782
14824
  /** 1-6 makes the title a real heading for screen readers (role=heading, aria-level); null keeps it plain text. */
14783
- readonly headingLevel: import("@angular/core").InputSignal<3 | 2 | 1 | 4 | 5 | 6 | null>;
14825
+ readonly headingLevel: import("@angular/core").InputSignal<1 | 2 | 3 | 4 | 5 | 6 | null>;
14784
14826
  /** Optional id for the title text; the card is then labelled by it. Without it the title is the card's aria-label. */
14785
14827
  readonly titleId: import("@angular/core").InputSignal<string>;
14786
14828
  /** Accessible name of the card when the header gives none (no header, or no title). A visible title wins; blank = no name. */
@@ -14794,7 +14836,7 @@ export declare class DetailCardComponent {
14794
14836
  /** Background colour of the footer bar (the `[card-footer]` slot) as any CSS colour. Empty = no colour of its own. */
14795
14837
  readonly footerBackground: import("@angular/core").InputSignal<string>;
14796
14838
  /** Alignment of the `[card-footer]` content: `'start'` (default, unchanged) or `'end'` = a right-aligned action row with an 8px gap. */
14797
- readonly footerAlign: import("@angular/core").InputSignal<"end" | "start">;
14839
+ readonly footerAlign: import("@angular/core").InputSignal<"start" | "end">;
14798
14840
  /** Text colour as any CSS colour (`#fff`, `var(--on-dark)` …). Empty = the default colours. Colours the title, subtitle, chevron and body text. */
14799
14841
  readonly textColor: import("@angular/core").InputSignal<string>;
14800
14842
  /** false = no header at all (no title, edit button, toggle or divider): the card is only the body, always open. */
@@ -19858,7 +19900,7 @@ export declare class PaymentSidePanelComponent {
19858
19900
  private readonly terminalAvailable;
19859
19901
  /** value -> label of every live method the rendered plugins contribute (the first plugin wins a duplicate value). */
19860
19902
  private readonly liveMethods;
19861
- protected readonly kind: import("@angular/core").Signal<"none" | "manual" | "live" | "terminal">;
19903
+ protected readonly kind: import("@angular/core").Signal<"none" | "live" | "terminal" | "manual">;
19862
19904
  private kindOf;
19863
19905
  /** The method list as shown: record-only built-ins (a plugin takes over its own values), plugin extras, and only manual ones while a split is being built. */
19864
19906
  readonly methodList: import("@angular/core").Signal<PaymentMethodOption[]>;