@forgeroute/ui 0.4.98 → 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.98",
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>;
@@ -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 | 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<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;
@@ -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" | "secondary" | "danger" | "warning" | "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' }`). */
@@ -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<"" | "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. */
@@ -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, {
@@ -12776,7 +12778,7 @@ export declare class AddressInputComponent implements ControlValueAccessor, Vali
12776
12778
  * the object. `valueChange` always emits the object. A written string is read with `parseAddressValue` for display only: the control keeps
12777
12779
  * the original text until the user edits a field (so a text the parser cannot split is not rewritten on load).
12778
12780
  */
12779
- readonly valueFormat: import("@angular/core").InputSignal<"object" | "text" | "auto">;
12781
+ readonly valueFormat: import("@angular/core").InputSignal<"object" | "auto" | "text">;
12780
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. */
12781
12783
  readonly zipPattern: import("@angular/core").InputSignal<RegExp | null>;
12782
12784
  /** Message shown when the ZIP breaks `zipPattern`. */
@@ -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 | 3 | 4 | 5 | 6 | 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. */