@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truenas/ui-components",
3
- "version": "0.1.73",
3
+ "version": "0.1.75",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org",
6
6
  "access": "public"
@@ -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 dialog's close button (`[base, 'close']`) or
44
- * a select's per-option id (`[base, option.label]`). Centralizing it keeps the
45
- * `string | array` flattening contract in one place rather than re-implemented
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, 'close')` yields
50
- * `[undefined, 'close']`, which `composeTestId('button', …)` renders as the
51
- * unscoped `button-close`.
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, 'close') // [undefined, 'close']
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>-close` / `-fullscreen` when a base is provided (useful
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
- /** Scoped test-id segments for the close button (`button-[<base>-]close`). */
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
- /** Scoped test-id segments for the fullscreen button (`button-[<base>-]fullscreen`). */
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;