@camstack/ui-library 1.2.113 → 1.2.115

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.
@@ -20,6 +20,12 @@ export interface DeviceSelectCandidate {
20
20
  readonly name: string;
21
21
  readonly location?: string | null;
22
22
  readonly features?: readonly string[];
23
+ /** Name of the container this device lives in, when it has one. */
24
+ readonly parentName?: string | null;
25
+ }
26
+ /** A picker option that still knows where its device is. */
27
+ export interface DeviceOption extends ConfigOption {
28
+ readonly location: string | null;
23
29
  }
24
30
  /**
25
31
  * Does a device satisfy the filter?
@@ -37,13 +43,35 @@ export declare function deviceOptionLabel(device: DeviceSelectCandidate): string
37
43
  * (value = the device id as a string). Sorted case-insensitively by label so
38
44
  * the picker order is stable.
39
45
  */
40
- export declare function devicesToOptions(devices: readonly DeviceSelectCandidate[], filter?: DeviceSelectFilter): ConfigOption[];
46
+ /** `Location · type · in Container` — the parts a name alone does not say. */
47
+ export declare function deviceOptionDescription(device: DeviceSelectCandidate): string;
48
+ export declare function devicesToOptions(devices: readonly DeviceSelectCandidate[], filter?: DeviceSelectFilter): DeviceOption[];
49
+ export interface DeviceFacets {
50
+ readonly locations: readonly string[];
51
+ readonly types: readonly string[];
52
+ }
53
+ /** The distinct locations and types on offer — the chips above the search. */
54
+ export declare function deviceFacets(devices: readonly DeviceSelectCandidate[]): DeviceFacets;
55
+ /** Each facet is a SET of chosen values: any of them matches, none = all. */
56
+ export interface FacetSelection {
57
+ readonly locations: readonly string[];
58
+ readonly types: readonly string[];
59
+ }
60
+ export declare const NO_FACETS: FacetSelection;
61
+ /** Every facet with a choice must match one of its values. */
62
+ export declare function matchesFacets(device: DeviceSelectCandidate, facets: FacetSelection): boolean;
63
+ export interface SuggestedPartition<T extends DeviceOption> {
64
+ readonly suggested: readonly T[];
65
+ readonly others: readonly T[];
66
+ }
67
+ /** The devices sharing `location` come first — suggested, never pre-linked. */
68
+ export declare function partitionSuggested<T extends DeviceOption>(options: readonly T[], location: string | null | undefined): SuggestedPartition<T>;
41
69
  /**
42
70
  * Free-text option filter — case-insensitive AND over whitespace tokens, each
43
71
  * matched against the option's `value` + `label` (so a device is found by name,
44
72
  * id, or location). An empty query returns every option in order.
45
73
  */
46
- export declare function filterDeviceOptions(options: readonly ConfigOption[], query: string): ConfigOption[];
74
+ export declare function filterDeviceOptions<T extends ConfigOption>(options: readonly T[], query: string): T[];
47
75
  /**
48
76
  * Resolve the currently-selected values into options IN SELECTION ORDER (so
49
77
  * chips stay stable while searching). A selected value with no matching option