@truenas/ui-components 0.8.16 → 0.8.17

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": "@truenas/ui-components",
3
- "version": "0.8.16",
3
+ "version": "0.8.17",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org",
6
6
  "access": "public"
@@ -18362,6 +18362,11 @@ export declare class TnFilePickerComponent implements ControlValueAccessor, OnIn
18362
18362
  * path to the popup.
18363
18363
  */
18364
18364
  openOnClick: import("@angular/core").InputSignal<boolean>;
18365
+ /**
18366
+ * Left at its English default, the input shows
18367
+ * `TN_FILE_PICKER_LABELS.placeholder` instead, so an app-root labels
18368
+ * provider translates it; any other value is shown as given.
18369
+ */
18365
18370
  placeholder: import("@angular/core").InputSignal<string>;
18366
18371
  disabled: import("@angular/core").InputSignal<boolean>;
18367
18372
  /**
@@ -18446,6 +18451,8 @@ export declare class TnFilePickerComponent implements ControlValueAccessor, OnIn
18446
18451
  * on disk after it was listed.
18447
18452
  */
18448
18453
  private listedItems;
18454
+ protected readonly labels: import("@angular/core").Signal<import("@truenas/ui-components").TnFilePickerLabels>;
18455
+ protected readonly resolvedPlaceholder: import("@angular/core").Signal<string>;
18449
18456
  isDisabled: import("@angular/core").Signal<boolean>;
18450
18457
  private effectiveCallbacks;
18451
18458
  private effectiveStartPath;
@@ -18696,6 +18703,70 @@ export declare class TnFilePickerComponent implements ControlValueAccessor, OnIn
18696
18703
  "error": "error";
18697
18704
  }, never, never, true, never>;
18698
18705
  }
18706
+ /**
18707
+ * Every string `tn-file-picker` and its popup render or announce. Consumers
18708
+ * translate them once at the app root by providing `TN_FILE_PICKER_LABELS` —
18709
+ * typically wired to an i18n service — instead of per call site. A
18710
+ * `placeholder` input bound to anything but its English default wins over
18711
+ * `placeholder` here.
18712
+ *
18713
+ * Strings that carry a value (a count, a path, a name) are functions, so the
18714
+ * consumer decides how to place it: a word order, an ICU plural, a translated
18715
+ * template — the library imposes no placeholder syntax.
18716
+ */
18717
+ export interface TnFilePickerLabels {
18718
+ /** Empty path input. */
18719
+ placeholder: string;
18720
+ /** Accessible name of the folder button that opens the popup. */
18721
+ openPicker: string;
18722
+ /** Accessible name of the breadcrumb `nav`. */
18723
+ breadcrumb: string;
18724
+ /** Accessible name of a collapsed (`…`) or nameless breadcrumb segment. */
18725
+ navigateTo: (path: string) => string;
18726
+ loading: string;
18727
+ /** The listing's empty state. */
18728
+ noItems: string;
18729
+ /** Visually hidden header of the multi-select checkbox column. */
18730
+ selectColumn: string;
18731
+ /** Accessible name of an item's multi-select checkbox. */
18732
+ selectItem: (name: string) => string;
18733
+ /** Accessible name and tooltip of a directory's open (chevron) button. */
18734
+ openItem: (name: string) => string;
18735
+ nameColumn: string;
18736
+ sizeColumn: string;
18737
+ modifiedColumn: string;
18738
+ /** Footer, while items are picked. */
18739
+ itemsSelected: (count: number) => string;
18740
+ /** Footer, when the browsed directory itself would be picked. */
18741
+ currentDirectorySelected: string;
18742
+ /** Footer, when nothing is picked and the directory cannot be. */
18743
+ noItemsSelected: string;
18744
+ clearSelection: string;
18745
+ /** The footer button that applies the selection. */
18746
+ select: string;
18747
+ /** Accessible name of the inline creation row's input, from the action's label. */
18748
+ inlineCreateName: (actionLabel: string) => string;
18749
+ /** Inline creation row, when the `create` callback rejects with something other than an Error. */
18750
+ inlineCreateFailed: string;
18751
+ /** Modified column, for an item changed today / yesterday; `time` is already formatted. */
18752
+ today: (time: string) => string;
18753
+ yesterday: (time: string) => string;
18754
+ /** Error messages — shown in the popup and carried by the `error` output. */
18755
+ pathOutsideRoot: (rootPath: string) => string;
18756
+ invalidPath: (path: string) => string;
18757
+ pathValidationFailed: string;
18758
+ loadFailed: string;
18759
+ createFailed: string;
18760
+ createdOutsideRoot: (rootPath: string) => string;
18761
+ }
18762
+ /** English defaults used when no `TN_FILE_PICKER_LABELS` provider is registered. */
18763
+ export declare const TN_FILE_PICKER_DEFAULT_LABELS: TnFilePickerLabels;
18764
+ /**
18765
+ * DI token for app-wide file picker labels. Provide either a static object or a
18766
+ * `Signal<TnFilePickerLabels>` — the latter lets an open picker follow a
18767
+ * language change.
18768
+ */
18769
+ export declare const TN_FILE_PICKER_LABELS: InjectionToken<TnFilePickerLabels | Signal<TnFilePickerLabels>>;
18699
18770
  /**
18700
18771
  * Harness for interacting with tn-file-picker in tests.
18701
18772
  *
@@ -19022,6 +19093,7 @@ export declare class TnFilePickerPopupComponent {
19022
19093
  * one popup can be open at a time.
19023
19094
  */
19024
19095
  testIdBase: import("@angular/core").InputSignal<TnTestIdValue>;
19096
+ protected readonly labels: import("@angular/core").Signal<import("@truenas/ui-components").TnFilePickerLabels>;
19025
19097
  private iconRegistry;
19026
19098
  private elementRef;
19027
19099
  constructor();