@threadlabs/looma 0.10.1 → 0.10.3
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/components/ui-tree/ui-tree.html +9 -0
- package/components/ui-tree-item/ui-tree-item.html +68 -2
- package/components/ui-tree-item/ui-tree-item.js +41 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/styles/ui-affordance-scope.css +1 -1
- package/styles/ui-avatar-group.css +1 -1
- package/styles/ui-avatar.css +1 -1
- package/styles/ui-badge.css +1 -1
- package/styles/ui-button.css +1 -1
- package/styles/ui-callout.css +1 -1
- package/styles/ui-checkbox.css +1 -1
- package/styles/ui-cluster.css +1 -1
- package/styles/ui-combobox.css +1 -1
- package/styles/ui-container.css +1 -1
- package/styles/ui-context-menu.css +1 -1
- package/styles/ui-dialog.css +1 -1
- package/styles/ui-disclosure.css +1 -1
- package/styles/ui-editable.css +1 -1
- package/styles/ui-editor-insert-table-grid.css +1 -1
- package/styles/ui-editor-mention-menu.css +1 -1
- package/styles/ui-editor-slash-menu.css +1 -1
- package/styles/ui-editor-table-context-menu.css +1 -1
- package/styles/ui-editor-table-overlay.css +1 -1
- package/styles/ui-editor-table-toolbar.css +1 -1
- package/styles/ui-editor-toolbar.css +1 -1
- package/styles/ui-floating-action-button.css +1 -1
- package/styles/ui-form-field.css +1 -1
- package/styles/ui-grid.css +1 -1
- package/styles/ui-icon-button.css +1 -1
- package/styles/ui-icon.css +1 -1
- package/styles/ui-input.css +1 -1
- package/styles/ui-menu-item.css +1 -1
- package/styles/ui-menu.css +1 -1
- package/styles/ui-popover.css +1 -1
- package/styles/ui-radio-group.css +1 -1
- package/styles/ui-radio.css +1 -1
- package/styles/ui-reel.css +1 -1
- package/styles/ui-search-result-row.css +1 -1
- package/styles/ui-search-shell.css +1 -1
- package/styles/ui-select.css +1 -1
- package/styles/ui-separator.css +1 -1
- package/styles/ui-sidebar.css +1 -1
- package/styles/ui-stack.css +1 -1
- package/styles/ui-switch.css +1 -1
- package/styles/ui-switcher.css +1 -1
- package/styles/ui-tabs.css +1 -1
- package/styles/ui-textarea.css +1 -1
- package/styles/ui-toast-region.css +1 -1
- package/styles/ui-tooltip.css +1 -1
- package/styles/ui-top-bar.css +1 -1
- package/styles/ui-tree-item.css +76 -2
- package/styles/ui-tree.css +12 -3
- package/vanilla/UiAffordanceScope.d.ts +1 -1
- package/vanilla/UiAffordanceScope.js +1 -1
- package/vanilla/UiAvatar.d.ts +1 -1
- package/vanilla/UiAvatar.js +1 -1
- package/vanilla/UiAvatarGroup.d.ts +1 -1
- package/vanilla/UiAvatarGroup.js +1 -1
- package/vanilla/UiBadge.d.ts +1 -1
- package/vanilla/UiBadge.js +1 -1
- package/vanilla/UiButton.d.ts +1 -1
- package/vanilla/UiButton.js +1 -1
- package/vanilla/UiCallout.d.ts +1 -1
- package/vanilla/UiCallout.js +1 -1
- package/vanilla/UiCheckbox.d.ts +1 -1
- package/vanilla/UiCheckbox.js +1 -1
- package/vanilla/UiCluster.d.ts +1 -1
- package/vanilla/UiCluster.js +1 -1
- package/vanilla/UiCombobox.d.ts +1 -1
- package/vanilla/UiCombobox.js +1 -1
- package/vanilla/UiContainer.d.ts +1 -1
- package/vanilla/UiContainer.js +1 -1
- package/vanilla/UiContextMenu.d.ts +1 -1
- package/vanilla/UiContextMenu.js +1 -1
- package/vanilla/UiDialog.d.ts +1 -1
- package/vanilla/UiDialog.js +1 -1
- package/vanilla/UiDisclosure.d.ts +1 -1
- package/vanilla/UiDisclosure.js +1 -1
- package/vanilla/UiEditable.d.ts +1 -1
- package/vanilla/UiEditable.js +1 -1
- package/vanilla/UiEditorInsertTableGrid.d.ts +1 -1
- package/vanilla/UiEditorInsertTableGrid.js +1 -1
- package/vanilla/UiEditorMentionMenu.d.ts +1 -1
- package/vanilla/UiEditorMentionMenu.js +1 -1
- package/vanilla/UiEditorSlashMenu.d.ts +1 -1
- package/vanilla/UiEditorSlashMenu.js +1 -1
- package/vanilla/UiEditorTableContextMenu.d.ts +1 -1
- package/vanilla/UiEditorTableContextMenu.js +1 -1
- package/vanilla/UiEditorTableOverlay.d.ts +1 -1
- package/vanilla/UiEditorTableOverlay.js +1 -1
- package/vanilla/UiEditorTableToolbar.d.ts +1 -1
- package/vanilla/UiEditorTableToolbar.js +1 -1
- package/vanilla/UiEditorToolbar.d.ts +1 -1
- package/vanilla/UiEditorToolbar.js +1 -1
- package/vanilla/UiFloatingActionButton.d.ts +1 -1
- package/vanilla/UiFloatingActionButton.js +1 -1
- package/vanilla/UiFormField.d.ts +1 -1
- package/vanilla/UiFormField.js +1 -1
- package/vanilla/UiGrid.d.ts +1 -1
- package/vanilla/UiGrid.js +1 -1
- package/vanilla/UiIcon.d.ts +1 -1
- package/vanilla/UiIcon.js +1 -1
- package/vanilla/UiIconButton.d.ts +1 -1
- package/vanilla/UiIconButton.js +1 -1
- package/vanilla/UiInput.d.ts +1 -1
- package/vanilla/UiInput.js +1 -1
- package/vanilla/UiMenu.d.ts +1 -1
- package/vanilla/UiMenu.js +1 -1
- package/vanilla/UiMenuItem.d.ts +1 -1
- package/vanilla/UiMenuItem.js +1 -1
- package/vanilla/UiPopover.d.ts +1 -1
- package/vanilla/UiPopover.js +1 -1
- package/vanilla/UiRadio.d.ts +1 -1
- package/vanilla/UiRadio.js +1 -1
- package/vanilla/UiRadioGroup.d.ts +1 -1
- package/vanilla/UiRadioGroup.js +1 -1
- package/vanilla/UiReel.d.ts +1 -1
- package/vanilla/UiReel.js +1 -1
- package/vanilla/UiSearchResultRow.d.ts +1 -1
- package/vanilla/UiSearchResultRow.js +1 -1
- package/vanilla/UiSearchShell.d.ts +1 -1
- package/vanilla/UiSearchShell.js +1 -1
- package/vanilla/UiSelect.d.ts +1 -1
- package/vanilla/UiSelect.js +1 -1
- package/vanilla/UiSeparator.d.ts +1 -1
- package/vanilla/UiSeparator.js +1 -1
- package/vanilla/UiSidebar.d.ts +1 -1
- package/vanilla/UiSidebar.js +1 -1
- package/vanilla/UiStack.d.ts +1 -1
- package/vanilla/UiStack.js +1 -1
- package/vanilla/UiSwitch.d.ts +1 -1
- package/vanilla/UiSwitch.js +1 -1
- package/vanilla/UiSwitcher.d.ts +1 -1
- package/vanilla/UiSwitcher.js +1 -1
- package/vanilla/UiTabs.d.ts +1 -1
- package/vanilla/UiTabs.js +1 -1
- package/vanilla/UiTextarea.d.ts +1 -1
- package/vanilla/UiTextarea.js +1 -1
- package/vanilla/UiToastRegion.d.ts +1 -1
- package/vanilla/UiToastRegion.js +1 -1
- package/vanilla/UiTooltip.d.ts +1 -1
- package/vanilla/UiTooltip.js +1 -1
- package/vanilla/UiTopBar.d.ts +1 -1
- package/vanilla/UiTopBar.js +1 -1
- package/vanilla/UiTree.d.ts +2 -1
- package/vanilla/UiTree.js +2 -2
- package/vanilla/UiTreeItem.d.ts +2 -1
- package/vanilla/UiTreeItem.js +23 -20
- package/vue/UiAffordanceScope.vue +1 -1
- package/vue/UiAvatar.vue +1 -1
- package/vue/UiAvatarGroup.vue +1 -1
- package/vue/UiBadge.vue +1 -1
- package/vue/UiButton.vue +1 -1
- package/vue/UiCallout.vue +1 -1
- package/vue/UiCheckbox.vue +1 -1
- package/vue/UiCluster.vue +1 -1
- package/vue/UiCombobox.vue +1 -1
- package/vue/UiContainer.vue +1 -1
- package/vue/UiContextMenu.vue +1 -1
- package/vue/UiDialog.vue +1 -1
- package/vue/UiDisclosure.vue +1 -1
- package/vue/UiEditable.vue +1 -1
- package/vue/UiEditorInsertTableGrid.vue +1 -1
- package/vue/UiEditorMentionMenu.vue +1 -1
- package/vue/UiEditorSlashMenu.vue +1 -1
- package/vue/UiEditorTableContextMenu.vue +1 -1
- package/vue/UiEditorTableOverlay.vue +1 -1
- package/vue/UiEditorTableToolbar.vue +1 -1
- package/vue/UiEditorToolbar.vue +1 -1
- package/vue/UiFloatingActionButton.vue +1 -1
- package/vue/UiFormField.vue +1 -1
- package/vue/UiGrid.vue +1 -1
- package/vue/UiIcon.vue +1 -1
- package/vue/UiIconButton.vue +1 -1
- package/vue/UiInput.vue +1 -1
- package/vue/UiMenu.vue +1 -1
- package/vue/UiMenuItem.vue +1 -1
- package/vue/UiPopover.vue +1 -1
- package/vue/UiRadio.vue +1 -1
- package/vue/UiRadioGroup.vue +1 -1
- package/vue/UiReel.vue +1 -1
- package/vue/UiSearchResultRow.vue +1 -1
- package/vue/UiSearchShell.vue +1 -1
- package/vue/UiSelect.vue +1 -1
- package/vue/UiSeparator.vue +1 -1
- package/vue/UiSidebar.vue +1 -1
- package/vue/UiStack.vue +1 -1
- package/vue/UiSwitch.vue +1 -1
- package/vue/UiSwitcher.vue +1 -1
- package/vue/UiTabs.vue +1 -1
- package/vue/UiTextarea.vue +1 -1
- package/vue/UiToastRegion.vue +1 -1
- package/vue/UiTooltip.vue +1 -1
- package/vue/UiTopBar.vue +1 -1
- package/vue/UiTree.d.ts +2 -0
- package/vue/UiTree.vue +10 -1
- package/vue/UiTreeItem.d.ts +2 -0
- package/vue/UiTreeItem.vue +72 -3
- package/vue/chunks/UiAffordanceScope.js +1 -1
- package/vue/chunks/UiAvatar.js +1 -1
- package/vue/chunks/UiAvatarGroup.js +1 -1
- package/vue/chunks/UiBadge.js +1 -1
- package/vue/chunks/UiButton.js +1 -1
- package/vue/chunks/UiCallout.js +1 -1
- package/vue/chunks/UiCheckbox.js +1 -1
- package/vue/chunks/UiCluster.js +1 -1
- package/vue/chunks/UiCombobox.js +1 -1
- package/vue/chunks/UiContainer.js +1 -1
- package/vue/chunks/UiContextMenu.js +1 -1
- package/vue/chunks/UiDialog.js +1 -1
- package/vue/chunks/UiDisclosure.js +1 -1
- package/vue/chunks/UiEditable.js +1 -1
- package/vue/chunks/UiEditorInsertTableGrid.js +1 -1
- package/vue/chunks/UiEditorMentionMenu.js +1 -1
- package/vue/chunks/UiEditorSlashMenu.js +1 -1
- package/vue/chunks/UiEditorTableContextMenu.js +1 -1
- package/vue/chunks/UiEditorTableOverlay.js +1 -1
- package/vue/chunks/UiEditorTableToolbar.js +1 -1
- package/vue/chunks/UiEditorToolbar.js +1 -1
- package/vue/chunks/UiFloatingActionButton.js +1 -1
- package/vue/chunks/UiFormField.js +1 -1
- package/vue/chunks/UiGrid.js +1 -1
- package/vue/chunks/UiIcon.js +1 -1
- package/vue/chunks/UiIconButton.js +1 -1
- package/vue/chunks/UiInput.js +1 -1
- package/vue/chunks/UiMenu.js +1 -1
- package/vue/chunks/UiMenuItem.js +1 -1
- package/vue/chunks/UiPopover.js +1 -1
- package/vue/chunks/UiRadio.js +1 -1
- package/vue/chunks/UiRadioGroup.js +1 -1
- package/vue/chunks/UiReel.js +1 -1
- package/vue/chunks/UiSearchResultRow.js +1 -1
- package/vue/chunks/UiSearchShell.js +1 -1
- package/vue/chunks/UiSelect.js +1 -1
- package/vue/chunks/UiSeparator.js +1 -1
- package/vue/chunks/UiSidebar.js +1 -1
- package/vue/chunks/UiStack.js +1 -1
- package/vue/chunks/UiSwitch.js +1 -1
- package/vue/chunks/UiSwitcher.js +1 -1
- package/vue/chunks/UiTabs.js +1 -1
- package/vue/chunks/UiTextarea.js +1 -1
- package/vue/chunks/UiToastRegion.js +1 -1
- package/vue/chunks/UiTooltip.js +1 -1
- package/vue/chunks/UiTopBar.js +1 -1
- package/vue/chunks/UiTree.js +6 -2
- package/vue/chunks/UiTreeItem.js +15 -5
- package/vue/chunks/host.js +8 -2
- package/vue/components.css +783 -719
- package/vue/host.ts +11 -2
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
<prop name="maxDepth" type="number" default="0"
|
|
10
10
|
>The deepest level a drag may produce, counting the top level as 1. A drop that would place the dragged item, or any item beneath it, deeper than this is
|
|
11
11
|
refused and reported as reorder-rejected. 0 means no limit.</prop>
|
|
12
|
+
<prop name="marquee" type="boolean" default="false"
|
|
13
|
+
>Scrolls a name too long for its row while that row is hovered or focused, then puts it back. Off by default: a tree of names that fit should not move. An
|
|
14
|
+
item may set its own marquee to opt in or out on its own.</prop>
|
|
12
15
|
<event
|
|
13
16
|
name="reorder"
|
|
14
17
|
type="object({ sourceId: string, targetId: string, position: before | inside | after, sourceType: string, targetType: string, sourceScope: string, targetScope: string, trigger: keyboard | pointer | programmatic })"
|
|
@@ -20,6 +23,12 @@
|
|
|
20
23
|
</defs>
|
|
21
24
|
<div role="tree"><slot></slot></div>
|
|
22
25
|
<style>
|
|
26
|
+
/* Reaches the items the way density does, so the setting lives on the tree the way a reader
|
|
27
|
+
thinks about it: this list scrolls its long names. */
|
|
28
|
+
:host-state([marquee]) {
|
|
29
|
+
--ui-tree-item-marquee: 1;
|
|
30
|
+
}
|
|
31
|
+
|
|
23
32
|
:host-state([density="compact"]) {
|
|
24
33
|
--ui-tree-item-min-block-size: var(--ui-control-size-sm);
|
|
25
34
|
--ui-tree-item-font-size: var(--ui-font-size-sm);
|
|
@@ -31,6 +31,9 @@
|
|
|
31
31
|
<prop name="selected" type="boolean" default="false"
|
|
32
32
|
>Marks the item selected: it sets aria-selected and gives the row the highlighted surface. The tree does not select on click, so drive it from your own
|
|
33
33
|
state.</prop>
|
|
34
|
+
<prop name="marquee" type="boolean" default="false"
|
|
35
|
+
>Scrolls a name too long for its row while the row is hovered or focused, then puts it back. Off by default: a tree of short names should not move, and a
|
|
36
|
+
product decides whether reading the whole name matters more than a still list.</prop>
|
|
34
37
|
<prop name="disabled" type="boolean" default="false"
|
|
35
38
|
>Makes the item unavailable: faded, skipped by keyboard navigation, unable to expand or be dragged, and closed to drops inside it.</prop>
|
|
36
39
|
<state name="internalExpanded" :value="false"></state>
|
|
@@ -83,7 +86,7 @@
|
|
|
83
86
|
<span class="disclosure-icon" aria-hidden="true"></span>
|
|
84
87
|
</button>
|
|
85
88
|
<span class="leading"><slot name="leading"></slot></span>
|
|
86
|
-
<span class="label"><slot name="label"><template $value="label"></template></slot></span>
|
|
89
|
+
<span class="label"><span class="label-text" $ref="labelText"><slot name="label"><template $value="label"></template></slot></span></span>
|
|
87
90
|
<span class="actions" $ref="actions"><slot name="actions"></slot></span>
|
|
88
91
|
<span class="drop-indicator row-drop-indicator" aria-hidden="true"></span>
|
|
89
92
|
</div>
|
|
@@ -242,16 +245,79 @@
|
|
|
242
245
|
display: flex;
|
|
243
246
|
align-items: center;
|
|
244
247
|
min-inline-size: 0;
|
|
248
|
+
/* The cell clips: a name longer than the row slides inside it rather than over its icons. */
|
|
249
|
+
overflow: hidden;
|
|
245
250
|
padding: var(--ui-tree-item-label-padding-block, var(--ui-space-1)) var(--ui-tree-item-label-padding-inline, var(--ui-space-2));
|
|
246
251
|
}
|
|
247
252
|
|
|
248
253
|
/* Slotted label content fills the cell, so a link is the row's hit area rather than sizing to
|
|
249
254
|
its own text and reading as overflow. */
|
|
250
|
-
.label
|
|
255
|
+
.label-text {
|
|
256
|
+
display: flex;
|
|
257
|
+
align-items: center;
|
|
258
|
+
/* Stretches, so slotted content can still be the row's full-height hit area. */
|
|
259
|
+
align-self: stretch;
|
|
260
|
+
block-size: 100%;
|
|
261
|
+
min-inline-size: 0;
|
|
262
|
+
inline-size: 100%;
|
|
263
|
+
white-space: nowrap;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.label-text > :slotted(*) {
|
|
251
267
|
flex: 1 1 auto;
|
|
252
268
|
min-inline-size: 0;
|
|
253
269
|
}
|
|
254
270
|
|
|
271
|
+
/* A hovered row reads its whole name: the label slides far enough to show the end, waits
|
|
272
|
+
there, and comes back. Only when it actually overflows — the controller measures by how
|
|
273
|
+
much — after the controls have taken their place over its end — and hands over the distance
|
|
274
|
+
and a duration from it, so a longer name travels no faster. */
|
|
275
|
+
.row[data-ui-marquee] > .label > .label-text {
|
|
276
|
+
/* Once, and it stays at the end while the pointer is there: a name that keeps sliding back
|
|
277
|
+
and forth under the pointer is harder to read than one that arrives and holds. */
|
|
278
|
+
animation: ui-tree-item-marquee var(--_marquee-duration) linear 0.5s 1 normal forwards;
|
|
279
|
+
will-change: transform;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/* While it slides, the start fades too: the name is leaving the cell at both ends, and a hard
|
|
283
|
+
edge beside the icon reads as a collision rather than as more text. */
|
|
284
|
+
.row[data-ui-marquee] > .label {
|
|
285
|
+
mask-image: linear-gradient(
|
|
286
|
+
to right,
|
|
287
|
+
transparent 0,
|
|
288
|
+
#000 var(--ui-space-2),
|
|
289
|
+
#000 calc(100% - var(--_tree-actions-width, 1.75rem) - var(--ui-space-3)),
|
|
290
|
+
transparent calc(100% - var(--_tree-actions-width, 1.75rem))
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.row[data-ui-marquee] > .label:dir(rtl) {
|
|
295
|
+
mask-image: linear-gradient(
|
|
296
|
+
to left,
|
|
297
|
+
transparent 0,
|
|
298
|
+
#000 var(--ui-space-2),
|
|
299
|
+
#000 calc(100% - var(--_tree-actions-width, 1.75rem) - var(--ui-space-3)),
|
|
300
|
+
transparent calc(100% - var(--_tree-actions-width, 1.75rem))
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
@keyframes ui-tree-item-marquee {
|
|
305
|
+
from {
|
|
306
|
+
transform: translateX(0);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
to {
|
|
310
|
+
transform: translateX(var(--_marquee-distance));
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/* Reduced motion keeps the fade, which already says the name continues. */
|
|
315
|
+
@media (prefers-reduced-motion: reduce) {
|
|
316
|
+
.row[data-ui-marquee] > .label > .label-text {
|
|
317
|
+
animation: none;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
255
321
|
/* The controls sit over the label's end, so the text fades out where they begin. The fade is
|
|
256
322
|
the truncation mark while it shows: an ellipsis under it would read as a second one. */
|
|
257
323
|
.row:hover > .label,
|
|
@@ -11,7 +11,7 @@ function parentItem(element) {
|
|
|
11
11
|
/** Synchronizes an inferred tree hierarchy after nested component lowering. */
|
|
12
12
|
export default function controller(host) {
|
|
13
13
|
const element = host.element;
|
|
14
|
-
const { row, disclosure, children, actions } = host.refs;
|
|
14
|
+
const { row, disclosure, children, actions, labelText } = host.refs;
|
|
15
15
|
// Touch use enlarges rows and hides drag handles (see the template's styles).
|
|
16
16
|
trackInputModality(element.ownerDocument);
|
|
17
17
|
const childItems = () => Array.from(children?.children ?? [])
|
|
@@ -81,6 +81,42 @@ export default function controller(host) {
|
|
|
81
81
|
updateLevel();
|
|
82
82
|
const stop = host.effect(apply);
|
|
83
83
|
apply();
|
|
84
|
+
/**
|
|
85
|
+
* A hovered row reads its whole name. The controls overlay the label's end rather than taking
|
|
86
|
+
* width from it, so the width the name actually has while hovered is the label minus them:
|
|
87
|
+
* measuring against the full label scrolls short and leaves the tail under the controls.
|
|
88
|
+
*/
|
|
89
|
+
const MARQUEE_SPEED = 36; // CSS pixels per second.
|
|
90
|
+
const MARQUEE_SLACK = 4; // So the tail clears the edge rather than stopping on it.
|
|
91
|
+
// The tree sets this for its items; an item's own prop overrides it either way.
|
|
92
|
+
const marqueeWanted = () => host.state.marquee
|
|
93
|
+
|| getComputedStyle(element).getPropertyValue("--ui-tree-item-marquee").trim() === "1";
|
|
94
|
+
const startMarquee = () => {
|
|
95
|
+
if (!labelText || !marqueeWanted()) return;
|
|
96
|
+
const covered = actions?.offsetWidth ?? 0;
|
|
97
|
+
const visible = labelText.clientWidth - covered;
|
|
98
|
+
const overflow = Math.round(labelText.scrollWidth - visible);
|
|
99
|
+
if (overflow <= 0) return;
|
|
100
|
+
const distance = overflow + MARQUEE_SLACK;
|
|
101
|
+
const rightToLeft = getComputedStyle(element).direction === "rtl";
|
|
102
|
+
row.style.setProperty("--_marquee-distance", `${rightToLeft ? distance : -distance}px`);
|
|
103
|
+
row.style.setProperty(
|
|
104
|
+
"--_marquee-duration",
|
|
105
|
+
`${Math.min(10, Math.max(1.4, distance / MARQUEE_SPEED)).toFixed(2)}s`
|
|
106
|
+
);
|
|
107
|
+
row.dataset.uiMarquee = "";
|
|
108
|
+
};
|
|
109
|
+
const stopMarquee = () => {
|
|
110
|
+
delete row.dataset.uiMarquee;
|
|
111
|
+
row.style.removeProperty("--_marquee-distance");
|
|
112
|
+
row.style.removeProperty("--_marquee-duration");
|
|
113
|
+
};
|
|
114
|
+
// Pointer and focus both count: a keyboard walk through a tree reads the same names.
|
|
115
|
+
row.addEventListener("pointerenter", startMarquee);
|
|
116
|
+
row.addEventListener("pointerleave", stopMarquee);
|
|
117
|
+
row.addEventListener("focusin", startMarquee);
|
|
118
|
+
row.addEventListener("focusout", stopMarquee);
|
|
119
|
+
|
|
84
120
|
// The label's fade has to end where the controls begin, and only the controls know their width.
|
|
85
121
|
const actionsSize = new ResizeObserver(([entry]) => {
|
|
86
122
|
const width = entry.borderBoxSize?.[0]?.inlineSize ?? entry.contentRect.width;
|
|
@@ -92,6 +128,10 @@ export default function controller(host) {
|
|
|
92
128
|
stop?.();
|
|
93
129
|
observer.disconnect();
|
|
94
130
|
actionsSize.disconnect();
|
|
131
|
+
row.removeEventListener("pointerenter", startMarquee);
|
|
132
|
+
row.removeEventListener("pointerleave", stopMarquee);
|
|
133
|
+
row.removeEventListener("focusin", startMarquee);
|
|
134
|
+
row.removeEventListener("focusout", stopMarquee);
|
|
95
135
|
element.removeEventListener("ui-tree-auto-expand", onAutoExpand);
|
|
96
136
|
element.removeEventListener("ui-tree-structure-sync", onStructure);
|
|
97
137
|
element.removeEventListener("ui-tree-roving-tab-stop", onRoving);
|