@fusion.dev/helix-headless 0.233.0 → 0.234.0

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.
@@ -1745,6 +1745,7 @@ let HelixHeadlessCanvas = class HelixHeadlessCanvas extends MixinViewport(HelixE
1745
1745
  data-target=${editing.target}
1746
1746
  style=${`--_canvas-editor-x: ${at.x}px; --_canvas-editor-y: ${at.y}px`}
1747
1747
  type="text"
1748
+ autocomplete="off"
1748
1749
  .value=${editing.was}
1749
1750
  @blur=${this.handleEditorBlur}
1750
1751
  @keydown=${this.handleEditorKeydown}
@@ -145,6 +145,14 @@ declare const HelixHeadlessDataTable_base: (new (...args: any[]) => import("@fus
145
145
  * In the grid, Alt+Down on a heading opens its menu, and F2 and Tab reach the
146
146
  * button.
147
147
  *
148
+ * **`min-table-width` on a column drops it from a narrow table.** While the
149
+ * table is narrower than that length, it leaves out the column's heading,
150
+ * track and cells, and brings them back when it widens. The other columns
151
+ * keep their widths and edges, `aria-colcount` counts the columns that show,
152
+ * and the column keeps its place in `order` and in the sort. One column
153
+ * always shows. `csv()` still writes every column that is not `hidden`, since
154
+ * a file has no width.
155
+ *
148
156
  * **`reorderable-rows` lets people move rows.** A column of grips leads each
149
157
  * row, named by `move-row-label`. Drag a grip to move its row, and the table
150
158
  * scrolls near an edge. Or press Space or Enter on a grip, or click it, to pick
@@ -895,6 +903,26 @@ export declare class HelixHeadlessDataTable extends HelixHeadlessDataTable_base
895
903
  * sort, which are by field, so showing it again puts it back where it was.
896
904
  */
897
905
  private get shownColumns();
906
+ /** The table's inline size as last measured, or undefined where nothing has measured it, as on a server. */
907
+ private measuredInlineSize;
908
+ /** The font sizes `em` and `rem` read against, taken with the size. */
909
+ private fontSizes;
910
+ /** The columns left out at the measured size, for their `min-table-width`. */
911
+ private dropped;
912
+ /** Measures the `table` part as it changes size, in a browser. */
913
+ private sizeObserver;
914
+ /**
915
+ * Works out which columns are left out at the measured size, and says
916
+ * whether that changed.
917
+ *
918
+ * **Asked on every resize, and the table draws again only when the answer
919
+ * changes**, so dragging a window across a hundred pixels costs a render at
920
+ * each minimum it crosses and none between them. Read off the columns in the
921
+ * order on screen, which keeps the first one there where every column would
922
+ * go. A hidden column takes no part, having no room to give back.
923
+ */
924
+ private fit;
925
+ private readonly handleSize;
898
926
  /** The fields in the order on screen. */
899
927
  private get fields();
900
928
  /** The fields of the columns drawn, in the order on screen: what a grip moves among. */
@@ -1140,8 +1168,9 @@ export declare class HelixHeadlessDataTable extends HelixHeadlessDataTable_base
1140
1168
  * **Values, not cells.** A cell may be a template, a badge or a link, so each
1141
1169
  * column gives its field's value, which is what a spreadsheet wants anyway.
1142
1170
  * A column with no field has no value and is left out, and so is a hidden
1143
- * one, which is not on screen. In `server` mode this is the page it holds,
1144
- * which is all it can know.
1171
+ * one, which is not on screen. A column dropped for its `min-table-width`
1172
+ * is kept, so the file is the same at any window width. In `server` mode
1173
+ * this is the page it holds, which is all it can know.
1145
1174
  *
1146
1175
  * **A text value that a spreadsheet would run is quoted as text.** A cell
1147
1176
  * opening with `=`, `+`, `-` or `@` is a formula to a spreadsheet, and a
@@ -1380,6 +1409,16 @@ export declare class HelixHeadlessDataTable extends HelixHeadlessDataTable_base
1380
1409
  * is the listener's owner rather than its subject.
1381
1410
  */
1382
1411
  connectedCallback(): void;
1412
+ protected firstUpdated(changed: PropertyValues): void;
1413
+ /**
1414
+ * Measures the `table` part as it changes size, once it is drawn.
1415
+ *
1416
+ * **The part and not the host.** The host has no `display` on the headless
1417
+ * tier, so it is inline, and an inline box reports no size: every column
1418
+ * with a minimum dropped at once. The part is a block, as wide as the room
1419
+ * the table has, whatever the rows hold, since it scrolls them.
1420
+ */
1421
+ private watchSize;
1383
1422
  disconnectedCallback(): void;
1384
1423
  /**
1385
1424
  * Notes whether Shift is held, before the press reaches a checkbox, whose
@@ -8,6 +8,7 @@ import { repeat } from 'lit/directives/repeat.js';
8
8
  import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
9
9
  import { html } from 'lit/static-html.js';
10
10
  import { edgeOf } from '../../table/edge.js';
11
+ import { droppedAt } from '../../table/fit.js';
11
12
  import { tracksOf } from '../../table/tracks.js';
12
13
  import '../../checkbox/index.js';
13
14
  import '../../divider/index.js';
@@ -162,6 +163,24 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
162
163
  measured: () => this.windowed,
163
164
  rows: () => (this.windowed ? this.drawn() : []),
164
165
  });
166
+ this.measuredInlineSize = undefined;
167
+ this.fontSizes = { em: 16, rem: 16 };
168
+ this.dropped = new Set();
169
+ this.sizeObserver = undefined;
170
+ this.handleSize = (entries) => {
171
+ const entry = entries[entries.length - 1];
172
+ if (!entry) {
173
+ return;
174
+ }
175
+ this.measuredInlineSize = entry.contentBoxSize?.[0]?.inlineSize ?? entry.contentRect.width;
176
+ this.fontSizes = {
177
+ em: Number.parseFloat(getComputedStyle(this).fontSize) || 16,
178
+ rem: Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 16,
179
+ };
180
+ if (this.fit()) {
181
+ requestAnimationFrame(() => this.requestUpdate());
182
+ }
183
+ };
165
184
  this.warnedAboutSize = false;
166
185
  this.toggleRow = (key, event) => {
167
186
  event.preventDefault();
@@ -686,7 +705,19 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
686
705
  return columns.map((column) => (column.field === '' ? column : (moving[next++] ?? column)));
687
706
  }
688
707
  get shownColumns() {
689
- return this.orderedColumns.filter((column) => column.shown);
708
+ return this.orderedColumns.filter((column) => column.shown && !this.dropped.has(column));
709
+ }
710
+ fit() {
711
+ const size = this.measuredInlineSize;
712
+ const columns = this.orderedColumns.filter((column) => column.shown);
713
+ const next = size === undefined || !columns.some((column) => column.minTableWidth !== '')
714
+ ? new Set()
715
+ : droppedAt(size, columns.map((column) => ({ column, minimum: column.minTableWidth })), this.fontSizes);
716
+ const same = next.size === this.dropped.size && [...next].every((column) => this.dropped.has(column));
717
+ if (!same) {
718
+ this.dropped = next;
719
+ }
720
+ return !same;
690
721
  }
691
722
  get fields() {
692
723
  return this.orderedColumns.filter((column) => column.field !== '').map((column) => column.field);
@@ -984,7 +1015,7 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
984
1015
  return this.requestOrder(fields, field);
985
1016
  }
986
1017
  csv() {
987
- const columns = this.shownColumns.filter((column) => column.field !== '');
1018
+ const columns = this.orderedColumns.filter((column) => column.shown && column.field !== '');
988
1019
  const rows = this.mode === 'server' && !this.childField ? this.rows : this.flat().rows;
989
1020
  const quote = (value) => {
990
1021
  if (value === undefined || value === null) {
@@ -1051,7 +1082,7 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
1051
1082
  if (!head?.assign) {
1052
1083
  return;
1053
1084
  }
1054
- const columns = this.orderedColumns;
1085
+ const columns = this.orderedColumns.filter((column) => !this.dropped.has(column));
1055
1086
  assignSlot(head, ...columns);
1056
1087
  const served = root.querySelector('[part="table"] > slot:not([name])');
1057
1088
  if (served) {
@@ -1107,6 +1138,7 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
1107
1138
  }
1108
1139
  willUpdate(changed) {
1109
1140
  super.willUpdate(changed);
1141
+ this.fit();
1110
1142
  this.hadFocus = this.hasUpdated && this.gridHasFocus();
1111
1143
  this.announced = this.news();
1112
1144
  hostAria(internalsOf(this), {
@@ -1459,7 +1491,9 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
1459
1491
  ${this.rowGrips ? this.renderGripHead(headStop && this.currentColumn === 0) : nothing}${this.selectable
1460
1492
  ? this.renderSelectAll(headStop && this.currentColumn === this.selectAt)
1461
1493
  : nothing}${this.assignsByName && !this.hydrating
1462
- ? this.orderedColumns.map((_, index) => html `<slot name=${`column-${index + 1}`} @slotchange=${this.handleSlotChange}></slot>`)
1494
+ ? this.orderedColumns.map((column, index) => this.dropped.has(column)
1495
+ ? nothing
1496
+ : html `<slot name=${`column-${index + 1}`} @slotchange=${this.handleSlotChange}></slot>`)
1463
1497
  : html `<slot name="columns" @slotchange=${this.handleSlotChange}></slot>`}${this.sourceKnown ? nothing : html `<slot @slotchange=${this.handleSlotChange}></slot>`}
1464
1498
  </div>
1465
1499
  ${serving
@@ -1509,6 +1543,19 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
1509
1543
  this.addEventListener('keydown', this.handleGridKey);
1510
1544
  this.addEventListener('keydown', this.handleGripKey);
1511
1545
  this.addEventListener('helix-before-resize', this.handleResize);
1546
+ this.watchSize();
1547
+ }
1548
+ firstUpdated(changed) {
1549
+ super.firstUpdated(changed);
1550
+ this.watchSize();
1551
+ }
1552
+ watchSize() {
1553
+ const table = this.partNamed('table');
1554
+ if (!table || typeof ResizeObserver === 'undefined') {
1555
+ return;
1556
+ }
1557
+ this.sizeObserver ??= new ResizeObserver(this.handleSize);
1558
+ this.sizeObserver.observe(table);
1512
1559
  }
1513
1560
  disconnectedCallback() {
1514
1561
  super.disconnectedCallback();
@@ -1523,6 +1570,7 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
1523
1570
  this.removeEventListener('keydown', this.handleGridKey);
1524
1571
  this.removeEventListener('keydown', this.handleGripKey);
1525
1572
  this.removeEventListener('helix-before-resize', this.handleResize);
1573
+ this.sizeObserver?.disconnect();
1526
1574
  }
1527
1575
  rowPartsOf(row, index) {
1528
1576
  const names = this.rowParts?.(row, index).trim();
@@ -154,12 +154,14 @@ export declare class HelixHeadlessDateInput extends HelixHeadlessDateInput_base
154
154
  protected readonly aria: AriaForwardController;
155
155
  /**
156
156
  * What the browser may autofill here, as one of the platform's own tokens,
157
- * such as `bday`.
157
+ * such as `bday`. `off` by default: the text a date is typed into is a text
158
+ * field to the browser, and its form history offered unrelated words a
159
+ * reader had typed elsewhere.
158
160
  *
159
- * Empty leaves the attribute off, which is the browser's default and is what
160
- * lets autofill work at all: hardcoding `off` here means a birthday or a
161
- * postal code can never be filled in for a reader. With `segmented`, a
162
- * hidden native date input carries it, since no browser fills the segments.
161
+ * **A default, never a fixed value.** Set a token such as `bday` and the
162
+ * browser fills it, so a birthday can still be filled in for a reader. With
163
+ * `segmented`, a hidden native date input carries the token, since no
164
+ * browser fills the segments. Set it empty to leave the attribute off.
163
165
  */
164
166
  autocomplete: string;
165
167
  /**
@@ -19,7 +19,7 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
19
19
  this.aria = new AriaForwardController(this, {
20
20
  target: () => this.partNamed('control') ?? this.segmentGroup,
21
21
  });
22
- this.autocomplete = '';
22
+ this.autocomplete = 'off';
23
23
  this.calendarLabel = 'Date Picker';
24
24
  this.clearable = false;
25
25
  this.clearLabel = 'Clear';
@@ -206,6 +206,12 @@ export declare class HelixHeadlessFilterInput extends HelixHeadlessFilterInput_b
206
206
  protected readonly aria: AriaForwardController;
207
207
  /** Typed, so every keystroke is announced. See `announcesInput`. */
208
208
  protected readonly announcesInput = true;
209
+ /**
210
+ * What the browser may autofill in the field, as an HTML `autocomplete`
211
+ * token. `off` by default, since a filter offers its own suggestions and the
212
+ * browser's form history would open a second list over them.
213
+ */
214
+ autocomplete: string;
209
215
  /**
210
216
  * Whether the field keeps a `FilterChip` for each filter in its `tags` slot,
211
217
  * from the `helix-facet` events it hears.
@@ -18,6 +18,7 @@ let HelixHeadlessFilterInput = class HelixHeadlessFilterInput extends MixinVoice
18
18
  target: () => this.partNamed('control'),
19
19
  });
20
20
  this.announcesInput = true;
21
+ this.autocomplete = 'off';
21
22
  this.chips = false;
22
23
  this.clearable = false;
23
24
  this.clearLabel = 'Clear';
@@ -644,6 +645,7 @@ let HelixHeadlessFilterInput = class HelixHeadlessFilterInput extends MixinVoice
644
645
  .value=${this.value}
645
646
  name=${this.name || nothing}
646
647
  placeholder=${this.placeholder || nothing}
648
+ autocomplete=${this.autocomplete || nothing}
647
649
  aria-describedby=${this.describedBy ?? nothing}
648
650
  aria-invalid=${this.invalidity ?? nothing}
649
651
  role=${this.suggesting ? 'combobox' : nothing}
@@ -695,6 +697,9 @@ let HelixHeadlessFilterInput = class HelixHeadlessFilterInput extends MixinVoice
695
697
  ${this.renderHint()}${this.renderFeedback()}`;
696
698
  }
697
699
  };
700
+ __decorate([
701
+ property()
702
+ ], HelixHeadlessFilterInput.prototype, "autocomplete", void 0);
698
703
  __decorate([
699
704
  property({ type: Boolean })
700
705
  ], HelixHeadlessFilterInput.prototype, "chips", void 0);
@@ -104,12 +104,13 @@ export declare class HelixHeadlessNumberInput extends HelixHeadlessNumberInput_b
104
104
  /** Typed or dragged, so every edit is announced. See `announcesInput`. */
105
105
  protected readonly announcesInput = true;
106
106
  /**
107
- * What the browser may autofill, as an HTML `autocomplete` token.
107
+ * What the browser may autofill, as an HTML `autocomplete` token, such as
108
+ * `postal-code`. `off` by default, since a number field's form history is
109
+ * every number ever typed into a field of the same name.
108
110
  *
109
- * Empty leaves the attribute off, which is the browser's default and is what
110
- * lets autofill work at all. Hardcoding `off` here is what stops a reader
111
- * having a birthday or a postal code filled in for them, with no way for a
112
- * consumer to ask for it.
111
+ * **A default, never a fixed value.** Set a token and the browser fills it,
112
+ * so a postal code or a card's expiry month can still be filled in for a
113
+ * reader. Set it empty to leave the attribute off.
113
114
  */
114
115
  autocomplete: string;
115
116
  /**
@@ -31,7 +31,7 @@ let HelixHeadlessNumberInput = class HelixHeadlessNumberInput extends MixinContr
31
31
  target: () => this.partNamed('control'),
32
32
  });
33
33
  this.announcesInput = true;
34
- this.autocomplete = '';
34
+ this.autocomplete = 'off';
35
35
  this.badInputMessage = 'Please enter a number.';
36
36
  this.decrementLabel = 'Decrease';
37
37
  this.incrementLabel = 'Increase';
@@ -147,6 +147,25 @@ export declare class HelixHeadlessTableColumn extends HelixElement {
147
147
  * `{named}` is `no` for a column without one.
148
148
  */
149
149
  menuLabel: string;
150
+ /**
151
+ * The narrowest a `DataTable` can be with this column showing, as a length
152
+ * in `px`, `rem` or `em`, such as `40rem`. While the table is narrower, it
153
+ * leaves the column out: its heading, its track and its cells.
154
+ *
155
+ * Give the columns a reader can do without the widest minimums, so they go
156
+ * first as the table narrows. The columns that stay keep their widths and
157
+ * their edges, and every row keeps its cells under their headings, as with
158
+ * `hidden`. A column left out is not in the grid at all, so `aria-colcount`
159
+ * counts the columns that show and a screen reader moves among those alone.
160
+ * Widen the table and the column comes back in its place.
161
+ *
162
+ * The table measures its own box, so a server draws every column and the
163
+ * page leaves out what does not fit once it runs. A percentage or a
164
+ * viewport unit is no width of the table, and leaves the column in. One
165
+ * column always shows. Left unset, the column shows at any width. A `Table`
166
+ * ignores it, since its cells are markup you wrote.
167
+ */
168
+ minTableWidth: string;
150
169
  /**
151
170
  * The accessible name of the grip that moves the column. `{name}` is the
152
171
  * heading text, and `{named}` is `no` for a column without one, so the
@@ -14,6 +14,7 @@ let HelixHeadlessTableColumn = class HelixHeadlessTableColumn extends HelixEleme
14
14
  this.field = '';
15
15
  this.menu = false;
16
16
  this.menuLabel = '{named, select, no {Column menu} other {{name} column menu}}';
17
+ this.minTableWidth = '';
17
18
  this.moveLabel = '{named, select, no {Move column} other {Move {name}}}';
18
19
  this.resizable = false;
19
20
  this.resizeLabel = '{named, select, no {Resize column} other {Resize {name}}}';
@@ -150,7 +151,10 @@ let HelixHeadlessTableColumn = class HelixHeadlessTableColumn extends HelixEleme
150
151
  }
151
152
  updated(changed) {
152
153
  super.updated(changed);
153
- if (changed.has('menu') || changed.has('textAlign') || changed.has('width')) {
154
+ if (changed.has('menu') ||
155
+ changed.has('minTableWidth') ||
156
+ changed.has('textAlign') ||
157
+ changed.has('width')) {
154
158
  this.tellHolder();
155
159
  }
156
160
  }
@@ -248,6 +252,9 @@ __decorate([
248
252
  words,
249
253
  property({ attribute: 'menu-label' })
250
254
  ], HelixHeadlessTableColumn.prototype, "menuLabel", void 0);
255
+ __decorate([
256
+ property({ attribute: 'min-table-width' })
257
+ ], HelixHeadlessTableColumn.prototype, "minTableWidth", void 0);
251
258
  __decorate([
252
259
  words,
253
260
  property({ attribute: 'move-label' })
@@ -0,0 +1,26 @@
1
+ /** The font sizes a length in `em` and `rem` is read against, in pixels. */
2
+ export interface FontSizes {
3
+ /** The table's own font size, which `em` is a multiple of. */
4
+ em: number;
5
+ /** The document's font size, which `rem` is a multiple of. */
6
+ rem: number;
7
+ }
8
+ /**
9
+ * A length in pixels: `640px`, `40rem`, `40em`, or a bare number, which is
10
+ * pixels. Anything else, a percentage or a viewport unit among them, is no
11
+ * length here and is `undefined`, being a share of something other than the
12
+ * table.
13
+ */
14
+ export declare const pixelsOf: (length: string, sizes: FontSizes) => number | undefined;
15
+ /**
16
+ * The columns left out of a table `inlineSize` pixels wide: each whose minimum
17
+ * table width is more than that.
18
+ *
19
+ * **One column always stays**, the first in the list, where every column would
20
+ * go: a table with no columns draws its rows as nothing, and a reader cannot
21
+ * tell it from an empty one. A minimum that is no length leaves its column in.
22
+ */
23
+ export declare const droppedAt: <Column>(inlineSize: number, columns: readonly {
24
+ column: Column;
25
+ minimum: string;
26
+ }[], sizes: FontSizes) => Set<Column>;
@@ -0,0 +1,23 @@
1
+ export const pixelsOf = (length, sizes) => {
2
+ const match = /^\s*(\d+(?:\.\d+)?|\.\d+)\s*(px|rem|em)?\s*$/i.exec(length);
3
+ if (!match) {
4
+ return undefined;
5
+ }
6
+ const amount = Number(match[1]);
7
+ const unit = (match[2] ?? 'px').toLowerCase();
8
+ return unit === 'px' ? amount : amount * (unit === 'rem' ? sizes.rem : sizes.em);
9
+ };
10
+ export const droppedAt = (inlineSize, columns, sizes) => {
11
+ const dropped = new Set();
12
+ for (const { column, minimum } of columns) {
13
+ const pixels = minimum === '' ? undefined : pixelsOf(minimum, sizes);
14
+ if (pixels !== undefined && inlineSize < pixels) {
15
+ dropped.add(column);
16
+ }
17
+ }
18
+ const first = columns[0];
19
+ if (first && dropped.size === columns.length) {
20
+ dropped.delete(first.column);
21
+ }
22
+ return dropped;
23
+ };
@@ -172,9 +172,11 @@ export declare class HelixHeadlessTimeInput extends HelixHeadlessTimeInput_base
172
172
  protected readonly aria: AriaForwardController;
173
173
  /**
174
174
  * What the browser may autofill here, as one of the platform's own tokens.
175
+ * `off` by default, since a time field's form history is unrelated text a
176
+ * reader typed elsewhere.
175
177
  *
176
- * Empty leaves the attribute off, which is the browser's default and is what
177
- * lets autofill work at all.
178
+ * A default, never a fixed value: set a token and the browser fills it, or
179
+ * set it empty to leave the attribute off.
178
180
  */
179
181
  autocomplete: string;
180
182
  /**
@@ -13,7 +13,7 @@ let HelixHeadlessTimeInput = class HelixHeadlessTimeInput extends MixinSegmented
13
13
  this.aria = new AriaForwardController(this, {
14
14
  target: () => this.partNamed('control') ?? this.segmentGroup,
15
15
  });
16
- this.autocomplete = '';
16
+ this.autocomplete = 'off';
17
17
  this.clearable = false;
18
18
  this.clearLabel = 'Clear';
19
19
  this.announcesInput = true;
@@ -37,6 +37,17 @@ declare const HelixHeadlessTreeItem_base: (new (...args: any[]) => import("@fusi
37
37
  * sends `helix-load`, the row says it is busy, and the children you add appear
38
38
  * in it. Remove `lazy` once they are in.
39
39
  *
40
+ * **The `actions` slot holds the row's own controls**, such as a button that
41
+ * opens a menu of what you can do with the item. A press, a key or a
42
+ * right-click there stays with the control: it does not choose, open, follow
43
+ * or move the row. The actions show while the pointer is over the row, while
44
+ * the row has focus, and while focus is inside them. Tab moves from the focused
45
+ * row into its actions and Shift+Tab back. Every other row's actions are
46
+ * `inert`, so Tab leaves the tree after the focused row's. A row with actions
47
+ * is named by its label alone, so the controls are not read as part of its
48
+ * name. On a touch screen the first tap on a row chooses and focuses it, which
49
+ * shows its actions.
50
+ *
40
51
  * **In a `reorderable` tree, the row has a grip** at its far end, which a
41
52
  * pointer drags to move the item among its siblings. The tree says which item
42
53
  * is moving and where the drop indicator is, with the `dragging`,
@@ -48,6 +59,7 @@ declare const HelixHeadlessTreeItem_base: (new (...args: any[]) => import("@fusi
48
59
  * @documentation https://fusion.dev/helix/components/tree
49
60
  *
50
61
  * @slot - The item's label. A nested item does not go here: give it `slot="children"`. In a development build, an item nested here is reported.
62
+ * @slot actions - Controls for the row, after `end`, such as a button that opens a menu. Shown while the row is hovered or focused.
51
63
  * @slot chevron - Replaces the expand and collapse mark of a branch, such as with your own icon.
52
64
  * @slot children - Nested items, which make this a branch.
53
65
  * @slot end - Content after the label, at the far side of the row, such as a count or a state.
@@ -59,6 +71,7 @@ declare const HelixHeadlessTreeItem_base: (new (...args: any[]) => import("@fusi
59
71
  * @event {HelixLoadEvent} helix-load - Fired when a `lazy` item opens, so you can load its children.
60
72
  * @event {ToggleEvent} toggle - Sent when the branch opens or closes, with `newState` and `oldState`.
61
73
  *
74
+ * @csspart actions - The `actions` slot, which draws no box of its own. `inert` while the actions are not shown, which takes what it holds off the tab order and out of reach of the pointer.
62
75
  * @csspart checkbox - The check mark's box, in a tree with `selection-mode="multiple"`.
63
76
  * @csspart checkbox-checked - The check mark's box while the item is checked.
64
77
  * @csspart checkbox-mixed - The check mark's box while some of a branch's items are checked.
@@ -72,6 +85,7 @@ declare const HelixHeadlessTreeItem_base: (new (...args: any[]) => import("@fusi
72
85
  *
73
86
  * @cssproperty --tree-level - How deep this row sits, counting from one as `aria-level` does, for the indent.
74
87
  *
88
+ * @cssstate actions-shown - While the row's actions are shown: the row is hovered or focused, or focus is inside the actions.
75
89
  * @cssstate checked - While it is checked, in a tree with `selection-mode="multiple"`.
76
90
  * @cssstate dragging - The item is being moved, in a `reorderable` tree.
77
91
  * @cssstate drop-after - The item being moved goes after this one when it is dropped.
@@ -162,6 +176,33 @@ export declare class HelixHeadlessTreeItem extends HelixHeadlessTreeItem_base {
162
176
  * sent.
163
177
  */
164
178
  private branch;
179
+ /** Whether the pointer is over the row. */
180
+ private hovered;
181
+ /** Whether focus is on the row, or inside its actions. */
182
+ private focusedHere;
183
+ /** Whether the row's actions are shown and can be reached. */
184
+ private get actionsShown();
185
+ /**
186
+ * Focus on this row or inside its actions shows them. Focus anywhere else,
187
+ * such as on a nested row, does not. A move from the row into its actions is
188
+ * a `focusout` and then a `focusin` in the same task, so the update between
189
+ * them never draws.
190
+ */
191
+ private readonly handleFocusIn;
192
+ /**
193
+ * **Read where focus is going, never cleared and set again.** The update a
194
+ * `focusout` asks for runs before the browser moves focus on, so clearing
195
+ * here made the actions `inert` under a Tab already headed into them, and
196
+ * focus fell to the page. Measured in Chromium: Tab from a row landed on
197
+ * `<body>`.
198
+ */
199
+ private readonly handleFocusOut;
200
+ /** Whether a node is inside what is slotted into `actions`, read up the page's own tree to this item. */
201
+ private intoActions;
202
+ private readonly handleRowEnter;
203
+ private readonly handleRowLeave;
204
+ connectedCallback(): void;
205
+ disconnectedCallback(): void;
165
206
  protected firstUpdated(changed: PropertyValues): void;
166
207
  /**
167
208
  * Moves focus to this node.
@@ -222,6 +263,8 @@ export declare class HelixHeadlessTreeItem extends HelixHeadlessTreeItem_base {
222
263
  private readonly handleCheckClick;
223
264
  private readonly handleToggleClick;
224
265
  private readonly handleRowClick;
266
+ /** Whether a press inside the actions landed on a control, which then acts on it instead of the row's link. */
267
+ private landedOnControl;
225
268
  /**
226
269
  * The expand and collapse mark of a branch, as the `chevron` slot's
227
270
  * fallback, so an icon of your own replaces it by being slotted.