@forgeroute/ui 0.4.98 → 0.5.0

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.98",
3
+ "version": "0.5.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=22.0.0",
6
6
  "@angular/core": ">=22.0.0",
@@ -3277,7 +3277,7 @@ export declare class SelectComponent implements ControlValueAccessor, Validator,
3277
3277
  readonly error: import("@angular/core").InputSignal<string>;
3278
3278
  /** The host's "tried to submit" flag (e.g. after a failed Save click). `true` reveals the message of an untouched field at once (the field also shows it after the user left THIS field); switching it from true back to false forgets that the field was left. */
3279
3279
  readonly showErrors: import("@angular/core").InputSignal<boolean>;
3280
- readonly size: import("@angular/core").InputSignal<"default" | "sm">;
3280
+ readonly size: import("@angular/core").InputSignal<"sm" | "default">;
3281
3281
  readonly _disabledInput: import("@angular/core").InputSignal<boolean>;
3282
3282
  private readonly _cvaDisabled;
3283
3283
  protected readonly disabled: import("@angular/core").Signal<boolean>;
@@ -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" | "hidden" | "visible">;
4709
+ readonly bodyOverflow: import("@angular/core").InputSignal<"hidden" | "auto" | "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<"auto" | "none" | "metadata">;
5488
+ readonly preload: import("@angular/core").InputSignal<"none" | "metadata" | "auto">;
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<2 | 1 | 3 | 4 | 5 | 6 | null>;
6042
+ readonly headingLevel: import("@angular/core").InputSignal<1 | 2 | 5 | 3 | 6 | 4 | 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<2 | 1 | 3>;
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;
@@ -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" | "search" | "numeric" | "decimal" | "none" | "tel" | "url">;
8328
+ readonly inputmode: import("@angular/core").InputSignal<"" | "email" | "text" | "none" | "search" | "numeric" | "decimal" | "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. */
@@ -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<2 | 1 | 3 | 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<"" | 2 | "2" | "3" | 3 | "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, {
@@ -12272,7 +12274,7 @@ export declare class IconComponent {
12272
12274
  readonly ariaLabel: import("@angular/core").InputSignal<string>;
12273
12275
  /** Icon size in px. */
12274
12276
  readonly size: import("@angular/core").InputSignal<number>;
12275
- readonly variant: import("@angular/core").InputSignal<"default" | "danger">;
12277
+ readonly variant: import("@angular/core").InputSignal<"danger" | "default">;
12276
12278
  readonly disabled: import("@angular/core").InputSignal<boolean>;
12277
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. */
12278
12280
  readonly loading: import("@angular/core").InputSignal<boolean>;
@@ -13409,6 +13411,31 @@ export declare class LiveRegionComponent {
13409
13411
  };
13410
13412
  }, {}, never, never, true, never>;
13411
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>;
13412
13439
  /**
13413
13440
  * Inline field error for controls that have no `error` input of their own — e.g. an app-specific
13414
13441
  * picker. Renders exactly like the library inputs' own field error (small red text under the field,
@@ -14795,7 +14822,7 @@ export declare class DetailCardComponent {
14795
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. */
14796
14823
  readonly uppercaseTitle: import("@angular/core").InputSignal<boolean>;
14797
14824
  /** 1-6 makes the title a real heading for screen readers (role=heading, aria-level); null keeps it plain text. */
14798
- readonly headingLevel: import("@angular/core").InputSignal<2 | 1 | 3 | 4 | 5 | 6 | null>;
14825
+ readonly headingLevel: import("@angular/core").InputSignal<1 | 2 | 5 | 3 | 6 | 4 | null>;
14799
14826
  /** Optional id for the title text; the card is then labelled by it. Without it the title is the card's aria-label. */
14800
14827
  readonly titleId: import("@angular/core").InputSignal<string>;
14801
14828
  /** Accessible name of the card when the header gives none (no header, or no title). A visible title wins; blank = no name. */