@truenas/ui-components 0.1.73 → 0.1.75
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
|
@@ -40,20 +40,24 @@ declare function kebabTestSegment(part: string | number): string;
|
|
|
40
40
|
* Normalizes the base — a single token or an array of segments — into a flat
|
|
41
41
|
* segment array and appends the suffixes, producing a value that is itself a
|
|
42
42
|
* valid {@link TnTestIdValue}. This is the canonical "derive a per-child id from
|
|
43
|
-
* a parent base" operation, e.g. a
|
|
44
|
-
* a
|
|
45
|
-
* `string | array` flattening contract in one place rather than
|
|
46
|
-
* at each call site.
|
|
43
|
+
* a parent base" operation, e.g. a select's per-option id
|
|
44
|
+
* (`[base, option.label]`) or a menu item's id (`[base, item.id]`). Centralizing
|
|
45
|
+
* it keeps the `string | array` flattening contract in one place rather than
|
|
46
|
+
* re-implemented at each call site.
|
|
47
|
+
*
|
|
48
|
+
* Note this is *base-first*: the suffix trails the base. Fixed chrome whose role
|
|
49
|
+
* should lead (e.g. `tn-dialog-shell`'s `button-close-<base>`) prepends the role
|
|
50
|
+
* manually instead of calling this.
|
|
47
51
|
*
|
|
48
52
|
* Falsy segments are preserved here (not filtered) so `composeTestId` can apply
|
|
49
|
-
* its own drop/scoping rules — `scopeTestId(undefined, '
|
|
50
|
-
* `[undefined, '
|
|
51
|
-
* unscoped `
|
|
53
|
+
* its own drop/scoping rules — `scopeTestId(undefined, 'edit')` yields
|
|
54
|
+
* `[undefined, 'edit']`, which `composeTestId('menu-item', …)` renders as the
|
|
55
|
+
* unscoped `menu-item-edit`.
|
|
52
56
|
*
|
|
53
57
|
* @example
|
|
54
58
|
* scopeTestId('actions', 'edit') // ['actions', 'edit']
|
|
55
59
|
* scopeTestId(['menu', 'main'], 'edit') // ['menu', 'main', 'edit']
|
|
56
|
-
* scopeTestId(undefined, '
|
|
60
|
+
* scopeTestId(undefined, 'edit') // [undefined, 'edit']
|
|
57
61
|
*/
|
|
58
62
|
declare function scopeTestId(base: TnTestIdValue, ...suffix: (string | number | null | undefined)[]): (string | number | null | undefined)[];
|
|
59
63
|
/**
|
|
@@ -6223,13 +6227,28 @@ declare class TnDialogShellComponent implements OnInit {
|
|
|
6223
6227
|
/**
|
|
6224
6228
|
* Optional semantic base that scopes the shell's chrome buttons. The close
|
|
6225
6229
|
* and fullscreen buttons emit `button-close` / `button-fullscreen` by default,
|
|
6226
|
-
* or `button-<testId
|
|
6227
|
-
* when more than one dialog can be open).
|
|
6230
|
+
* or `button-close-<testId>` / `button-fullscreen-<testId>` when a base is
|
|
6231
|
+
* provided (useful when more than one dialog can be open).
|
|
6228
6232
|
*/
|
|
6229
6233
|
testId: _angular_core.InputSignal<TnTestIdValue>;
|
|
6230
|
-
/**
|
|
6234
|
+
/**
|
|
6235
|
+
* The `testId` base normalized to a flat segment array. Nothing is dropped
|
|
6236
|
+
* here — `composeTestId` (via the `[tnTestId]` directive) filters falsy
|
|
6237
|
+
* segments, so an unset base collapses to the bare role (`button-close`).
|
|
6238
|
+
*/
|
|
6239
|
+
private readonly baseSegments;
|
|
6240
|
+
/**
|
|
6241
|
+
* Role-first test-id segments for the close button: `button-close[-<base>]`.
|
|
6242
|
+
*
|
|
6243
|
+
* The close and fullscreen buttons are fixed dialog chrome, not content
|
|
6244
|
+
* children, so the role leads rather than the base (content children are
|
|
6245
|
+
* base-first via `scopeTestId`). This keeps every dialog's close button under
|
|
6246
|
+
* a shared `button-close-*` prefix — it matches webui's established
|
|
6247
|
+
* close-button ids and lets automation target "all close buttons" with one
|
|
6248
|
+
* selector.
|
|
6249
|
+
*/
|
|
6231
6250
|
protected closeTestId: _angular_core.Signal<(string | number | null | undefined)[]>;
|
|
6232
|
-
/**
|
|
6251
|
+
/** Role-first test-id segments for the fullscreen button: `button-fullscreen[-<base>]`. */
|
|
6233
6252
|
protected fullscreenTestId: _angular_core.Signal<(string | number | null | undefined)[]>;
|
|
6234
6253
|
/** Stable id for the title heading, referenced by the dialog's aria-labelledby. */
|
|
6235
6254
|
readonly titleId: string;
|