spell-ui 0.8.12 → 0.8.14
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/README-components.md +5 -3
- package/dist/{Dragging-B93hbRxF.js → Dragging-tHPSvf3G.js} +56 -13
- package/dist/Dragging-tHPSvf3G.js.map +1 -0
- package/dist/_spell-element/DOMElement.d.ts +8 -1
- package/dist/_spell-element/drawnWindow.d.ts +62 -0
- package/dist/_util/Dragging.d.ts +7 -0
- package/dist/components/components.types.d.ts +2 -0
- package/dist/components/ui-diagram/UIDiagram.d.ts +3 -0
- package/dist/components/ui-graph/GraphLayout.d.ts +54 -0
- package/dist/components/ui-graph/UIGraph.d.ts +355 -0
- package/dist/components/ui-graph/UIGraph.en.d.ts +137 -0
- package/dist/components/ui-graph/UIGraph.es.d.ts +48 -0
- package/dist/components/ui-graph/UIGraph.types.d.ts +193 -0
- package/dist/components/ui-graph/index.d.ts +5 -0
- package/dist/components/ui-json/UIJson.d.ts +275 -10
- package/dist/components/ui-json/UIJson.en.d.ts +148 -9
- package/dist/components/ui-json/UIJson.es.d.ts +34 -3
- package/dist/components/ui-json/index.d.ts +2 -2
- package/dist/components/ui-split-panel/UISplitPanel.d.ts +2 -16
- package/dist/components/ui-tree/UITree.d.ts +758 -26
- package/dist/components/ui-tree/UITree.en.d.ts +113 -3
- package/dist/components/ui-tree/UITree.es.d.ts +24 -0
- package/dist/components/ui-tree/UITree.types.d.ts +34 -0
- package/dist/components/ui-tree/UITreeItem.d.ts +40 -1
- package/dist/components/ui-tree/UITreeItem.en.d.ts +9 -0
- package/dist/components/ui-tree/UITreeItem.es.d.ts +2 -0
- package/dist/components/ui-tree/index.d.ts +3 -2
- package/dist/components/ui-tree-diagram/UITreeDiagram.d.ts +3 -0
- package/dist/{components.es-DEa8Ep42.js → components.es-DilRG1VO.js} +117 -9
- package/dist/components.es-DilRG1VO.js.map +1 -0
- package/dist/core.js +713 -671
- package/dist/core.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +97 -96
- package/dist/jsx.d.ts +489 -20
- package/dist/ui-diagram.js +2 -2
- package/dist/ui-diagram.js.map +1 -1
- package/dist/ui-graph.editor-DLsXPyby.js +5 -0
- package/dist/ui-graph.editor-DLsXPyby.js.map +1 -0
- package/dist/ui-graph.js +1295 -0
- package/dist/ui-graph.js.map +1 -0
- package/dist/ui-json.editor-BS-v1bqO.js +5 -0
- package/dist/ui-json.editor-BS-v1bqO.js.map +1 -0
- package/dist/ui-json.js +629 -32
- package/dist/ui-json.js.map +1 -1
- package/dist/ui-property-editor.js +3 -2
- package/dist/ui-property-editor.js.map +1 -1
- package/dist/ui-root.js +34 -3
- package/dist/ui-root.js.map +1 -1
- package/dist/ui-site-nav.js +4 -4
- package/dist/ui-site-nav.js.map +1 -1
- package/dist/ui-split-panel.js +31 -61
- package/dist/ui-split-panel.js.map +1 -1
- package/dist/ui-tree-diagram.js +1 -1
- package/dist/ui-tree-diagram.js.map +1 -1
- package/dist/ui-tree.editor-Bqsa0dYQ.js +5 -0
- package/dist/ui-tree.editor-Bqsa0dYQ.js.map +1 -0
- package/dist/ui-tree.js +1734 -237
- package/dist/ui-tree.js.map +1 -1
- package/dist/util/PaneSizes.d.ts +42 -0
- package/dist/util/index.d.ts +2 -0
- package/package.json +1 -1
- package/dist/Dragging-B93hbRxF.js.map +0 -1
- package/dist/components.es-DEa8Ep42.js.map +0 -1
- package/dist/ui-json.editor-BgZbrB_W.js +0 -5
- package/dist/ui-json.editor-BgZbrB_W.js.map +0 -1
- package/dist/ui-tree.editor-BoQztwdz.js +0 -5
- package/dist/ui-tree.editor-BoQztwdz.js.map +0 -1
package/dist/ui-tree.js
CHANGED
|
@@ -1,13 +1,140 @@
|
|
|
1
1
|
import "./rolldown-runtime-c6e9CmGy.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
2
|
+
import { DOMElement as e, Disclosure as t, Gt as n, Jt as r, Kt as i, ListSelection as a, OwnControls as o, PaneSizes as s, UI as c, UIComponent as l, Ut as u, Warnings as d, Wt as f, Yt as p, after as m, afterSolidUpdate as h, aria as g, beforeNextPaint as _, commaList as v, controlled as y, cssState as b, derived as ee, flatParentFor as te, isSameList as x, on as S, onChange as C, proto as ne, protoMerged as re, qt as w, scrollIntoSight as ie, scrollingBoxFor as ae, state as T, untracked as oe, watches as E } from "./core.js";
|
|
3
|
+
import { t as se } from "./Dragging-tHPSvf3G.js";
|
|
4
|
+
import { t as ce } from "./PrefStore-Di83C0bY.js";
|
|
5
|
+
import { t as D } from "./TreeMeasure-BK74uexu.js";
|
|
6
|
+
import "./ui-button.js";
|
|
5
7
|
import "./ui-icon.js";
|
|
6
8
|
import "./ui-label.js";
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
+
import "./ui-loader.js";
|
|
10
|
+
import { For as O, Show as k, createEffect as le, createMemo as ue, createSignal as de, onCleanup as fe } from "solid-js";
|
|
11
|
+
import { addEvent as pe, className as me, createComponent as A, delegateEvents as he, effect as j, getOwner as M, insert as N, isServer as P, memo as F, readShallow as I, ref as ge, setAttribute as L, setStyleProperty as R, style as _e, template as z } from "@solidjs/web";
|
|
12
|
+
var ve = 5e3, ye = 60, be = "800px", xe = 1e3, Se = "spell-more-below", Ce = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new Set();
|
|
13
|
+
function signalChanges() {
|
|
14
|
+
let [e, t] = de(void 0, { equals: !1 });
|
|
15
|
+
return {
|
|
16
|
+
read() {
|
|
17
|
+
e();
|
|
18
|
+
},
|
|
19
|
+
changed() {
|
|
20
|
+
t(void 0);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function isNeverGoingToTheTop() {
|
|
25
|
+
return !1;
|
|
26
|
+
}
|
|
27
|
+
function canDrawInWindows() {
|
|
28
|
+
return typeof IntersectionObserver < "u" && typeof document < "u";
|
|
29
|
+
}
|
|
30
|
+
function drawnInWindow({ items: e, drawItem: t, key: n, more: r, atOnce: i = 24, through: a, changes: o = signalChanges, isGoingToTheTop: s = isNeverGoingToTheTop }) {
|
|
31
|
+
let each = (e) => A(O, {
|
|
32
|
+
get each() {
|
|
33
|
+
return e();
|
|
34
|
+
},
|
|
35
|
+
children: t
|
|
36
|
+
});
|
|
37
|
+
if (!canDrawInWindows()) return each(e);
|
|
38
|
+
let c = o(), l = i, count = () => (c.read(), l), setCount = (e) => {
|
|
39
|
+
l = e, c.changed();
|
|
40
|
+
}, u = {
|
|
41
|
+
count: l,
|
|
42
|
+
scrollTop: 0,
|
|
43
|
+
scroller: void 0
|
|
44
|
+
}, d = !n, drawThrough = (e) => {
|
|
45
|
+
e < l || (l = Math.ceil((e + 1) / i) * i, u.count = l);
|
|
46
|
+
}, comeBack = () => {
|
|
47
|
+
d = !0;
|
|
48
|
+
let e = n();
|
|
49
|
+
if (!e) return;
|
|
50
|
+
let t = Ce.get(e);
|
|
51
|
+
Ce.set(e, u), t && (Object.assign(u, t), l = Math.max(t.count, i), t.scrollTop && !s() && goBackTo(u));
|
|
52
|
+
}, f = ue(() => {
|
|
53
|
+
let t = e();
|
|
54
|
+
return d || comeBack(), drawThrough(a?.() ?? -1), t.length <= count() ? t : t.slice(0, count());
|
|
55
|
+
}), morePages = () => r?.(), p = ue(() => e().length > f().length || !!morePages()?.hasMorePages), drawMore = () => {
|
|
56
|
+
e().length > count() ? (m = _.getBoundingClientRect().top, setCount(count() + i), u.count = count()) : morePages()?.readNextPage();
|
|
57
|
+
}, m, h, g = !1, watchEnd = () => !g && v.observe(_), _ = document.createElement(Se);
|
|
58
|
+
_.setAttribute("aria-hidden", "true"), _.style.cssText = "display: block; grid-column: 1 / -1; width: 100%; height: 1px; pointer-events: none";
|
|
59
|
+
let v = new IntersectionObserver((e) => e.some((e) => e.isIntersecting) && drawMore(), {
|
|
60
|
+
rootMargin: be,
|
|
61
|
+
scrollMargin: be
|
|
62
|
+
}), y;
|
|
63
|
+
le(() => [
|
|
64
|
+
f().length,
|
|
65
|
+
e().length,
|
|
66
|
+
p()
|
|
67
|
+
], ([, , e]) => {
|
|
68
|
+
v.unobserve(_), clearTimeout(h);
|
|
69
|
+
let t = m;
|
|
70
|
+
m = void 0, e && (t === void 0 ? v.observe(_) : requestAnimationFrame(() => {
|
|
71
|
+
Math.abs(_.getBoundingClientRect().top - t) >= 1 ? watchEnd() : h = setTimeout(watchEnd, xe);
|
|
72
|
+
})), n && (e || u.scroller) && (y ??= followScroll(_, u));
|
|
73
|
+
});
|
|
74
|
+
let b = { drawForFind() {
|
|
75
|
+
let t = Math.min(e().length, ve);
|
|
76
|
+
t > count() && setCount(t), u.count = count();
|
|
77
|
+
} };
|
|
78
|
+
addLive(b), fe(() => {
|
|
79
|
+
g = !0, clearTimeout(h), v.disconnect(), y?.(), removeLive(b);
|
|
80
|
+
});
|
|
81
|
+
let ee = each(f);
|
|
82
|
+
return (() => p() ? [ee, _] : ee);
|
|
83
|
+
}
|
|
84
|
+
function followScroll(e, t) {
|
|
85
|
+
let stop, n = requestAnimationFrame(() => {
|
|
86
|
+
let n = t.scroller?.deref() ?? scrollerOf(e);
|
|
87
|
+
if (!n) return;
|
|
88
|
+
t.scroller = new WeakRef(n);
|
|
89
|
+
let r = n === document.scrollingElement ? document : n, note = () => {
|
|
90
|
+
t.scrollTop = n.scrollTop;
|
|
91
|
+
};
|
|
92
|
+
r.addEventListener("scroll", note, { passive: !0 }), stop = () => r.removeEventListener("scroll", note);
|
|
93
|
+
});
|
|
94
|
+
return () => {
|
|
95
|
+
cancelAnimationFrame(n), stop?.();
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function goBackTo({ scrollTop: e, scroller: t }) {
|
|
99
|
+
let n = t?.deref();
|
|
100
|
+
if (!n) return;
|
|
101
|
+
let r = ye, i = !1, theirs = () => {
|
|
102
|
+
i = !0;
|
|
103
|
+
}, a = {
|
|
104
|
+
capture: !0,
|
|
105
|
+
once: !0,
|
|
106
|
+
passive: !0
|
|
107
|
+
};
|
|
108
|
+
addEventListener("wheel", theirs, a), addEventListener("touchstart", theirs, a), addEventListener("keydown", theirs, a);
|
|
109
|
+
let stop = () => {
|
|
110
|
+
removeEventListener("wheel", theirs, a), removeEventListener("touchstart", theirs, a), removeEventListener("keydown", theirs, a);
|
|
111
|
+
}, step = () => {
|
|
112
|
+
if (i || (n.scrollTop = e, Math.abs(n.scrollTop - e) <= 1 || --r <= 0)) return stop();
|
|
113
|
+
requestAnimationFrame(step);
|
|
114
|
+
};
|
|
115
|
+
requestAnimationFrame(step);
|
|
116
|
+
}
|
|
117
|
+
function scrollerOf(e) {
|
|
118
|
+
for (let t = te(e); t; t = te(t)) {
|
|
119
|
+
let { overflowY: e } = getComputedStyle(t);
|
|
120
|
+
if (e === "auto" || e === "scroll") return t;
|
|
121
|
+
}
|
|
122
|
+
return document.scrollingElement;
|
|
123
|
+
}
|
|
124
|
+
function drawAllOnFind(e) {
|
|
125
|
+
(e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "f" && drawAllForFind();
|
|
126
|
+
}
|
|
127
|
+
function drawAllForFind() {
|
|
128
|
+
for (let e of B) e.drawForFind();
|
|
129
|
+
}
|
|
130
|
+
function addLive(e) {
|
|
131
|
+
B.size || (addEventListener("keydown", drawAllOnFind, { capture: !0 }), addEventListener("beforeprint", drawAllForFind)), B.add(e);
|
|
132
|
+
}
|
|
133
|
+
function removeLive(e) {
|
|
134
|
+
B.delete(e), B.size || (removeEventListener("keydown", drawAllOnFind, { capture: !0 }), removeEventListener("beforeprint", drawAllForFind));
|
|
135
|
+
}
|
|
9
136
|
// src/components/ui-tree/UITree.en.ts
|
|
10
|
-
var
|
|
137
|
+
var we = {
|
|
11
138
|
tag: "ui-tree",
|
|
12
139
|
icon: "sitemap",
|
|
13
140
|
topics: ["lists", "navigation"],
|
|
@@ -39,7 +166,13 @@ var ye = {
|
|
|
39
166
|
name: "filter",
|
|
40
167
|
group: "behaviour",
|
|
41
168
|
kind: "string",
|
|
42
|
-
description: "Show only the rows whose words hold this text, whatever its case, and the rows they're inside, opened to show them. It changes no row's `open`: clearing it puts the tree back as it was. A row drawn only once its parent opens can't be found while that's closed."
|
|
169
|
+
description: "Show only the rows whose words hold this text, whatever its case, and the rows they're inside, opened to show them. It changes no row's `open`: clearing it puts the tree back as it was. A row drawn only once its parent opens can't be found while that's closed. `appearance=\"columns\"`: it filters one column, the last one on screen as the filter starts, until it's cleared; after that column's rows, it lists the matches elsewhere in the tree, at any depth, each with the rows it's inside, and a click on one opens the path to it. From `items`, it runs each `children` function to look inside, waiting for promised ones, as opening the items would, but opens no column; it lists the first 200 matches, and stops after 100,000 rows."
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: "tools",
|
|
173
|
+
group: "behaviour",
|
|
174
|
+
kind: "keyOnly",
|
|
175
|
+
description: "A line of buttons above the rows: Open 2 levels, Open 3 levels and Close all. Scripts call the same methods: `openTo(levels)` and `closeAll()`. `appearance=\"columns\"`: `openTo(2)` shows two columns, keeping each column's pick, else picking its first row that holds rows."
|
|
43
176
|
},
|
|
44
177
|
{
|
|
45
178
|
name: "label",
|
|
@@ -60,30 +193,88 @@ var ye = {
|
|
|
60
193
|
kind: "string",
|
|
61
194
|
description: "`appearance=\"columns\"`: a title over each column, by level, separated by commas (`Clients, Projects, Files`); the last one names every column deeper than the list goes. None: no titles."
|
|
62
195
|
},
|
|
196
|
+
{
|
|
197
|
+
name: "items",
|
|
198
|
+
group: "content",
|
|
199
|
+
kind: "json",
|
|
200
|
+
reflect: !1,
|
|
201
|
+
description: "`appearance=\"columns\"`: the tree as data, given as a property, in place of `<ui-tree-item>`s: `{ id, label, icon?, which?, count?, children?, data? }[]` (`TreeItemData`), where `children` is a list, or a function run the first time the item opens, which may return a promise (a spinner shows until it comes). Only the open path's columns are drawn."
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: "path",
|
|
205
|
+
group: "behaviour",
|
|
206
|
+
kind: "json",
|
|
207
|
+
reflect: !1,
|
|
208
|
+
description: "`appearance=\"columns\"`: the ids of each column's pick, from the top (`string[]`; a `<ui-tree-item>`'s id is its `value`, else its `label`). The last one's rows are the next column. Set it to open a path, its last item selected; read it as people pick."
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: "size",
|
|
212
|
+
group: "appearance",
|
|
213
|
+
kind: "string",
|
|
214
|
+
description: "`appearance=\"columns\"`: each column's width, by level, separated by commas; the last one sizes every column deeper than the list goes. Each one a number of px (`240`, `240px`), `em`, a percent of the tree's width (`30%`), `auto` to fit the column to the rows it shows (from 80px to three times `--ui-tree-column-width`), or `*` for `--ui-tree-column-width`. So `auto` fits every column to its rows, and `12em, auto` keeps the first at 12em. None: every column is `--ui-tree-column-width` wide. A column a person resizes keeps that width instead: with an `id`, the tree remembers it in this browser."
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
name: "narrow-before",
|
|
218
|
+
group: "appearance",
|
|
219
|
+
kind: "number",
|
|
220
|
+
default: 2,
|
|
221
|
+
description: "`appearance=\"columns\"`: how many columns at the end never narrow. While the columns don't fit the tree's width, the ones before those narrow, from the first, as few as it takes, each to a strip with its pick's name; the pointer or the focus on one widens it again, and so does picking it from the path line. The selected row's column never narrows."
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: "show",
|
|
225
|
+
group: "appearance",
|
|
226
|
+
kind: "string",
|
|
227
|
+
description: "`appearance=\"columns\"`: which parts each row shows, as words: `icon which count chevron`; the label always shows. None: `icon which chevron`. `count` is how many rows a row holds, when it knows."
|
|
228
|
+
},
|
|
63
229
|
{
|
|
64
230
|
name: "sticky-path",
|
|
65
231
|
group: "behaviour",
|
|
66
232
|
kind: "keyOnly",
|
|
67
|
-
description: "While the tree scrolls, one line pinned at its top names the open rows the first row in view is inside, `Solitaire › Grid › StockPile`, shortened from the left when it doesn't fit. A click on one scrolls to its row, selecting nothing. It shows only while one of them is scrolled out of sight."
|
|
233
|
+
description: "While the tree scrolls, one line pinned at its top names the open rows the first row in view is inside, `Solitaire › Grid › StockPile`, shortened from the left when it doesn't fit. A click on one scrolls to its row, selecting nothing. It shows only while one of them is scrolled out of sight. `appearance=\"columns\"`: a line above the columns naming each column's pick, shown once something is picked; a click on one picks it again, keeping the columns after it, and scrolls its column into view."
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
name: "sticky-detail",
|
|
237
|
+
group: "behaviour",
|
|
238
|
+
kind: "keyOnly",
|
|
239
|
+
description: "`appearance=\"columns\"` with a `detail` pane: the pane stays in view at the tree's end while the columns scroll sideways under it."
|
|
240
|
+
}
|
|
241
|
+
],
|
|
242
|
+
events: [
|
|
243
|
+
{
|
|
244
|
+
name: "ui-selecting",
|
|
245
|
+
cancelable: !0,
|
|
246
|
+
detail: "{ item: HTMLElement | TreeItemData, value: string, path?: string[], originalEvent?: Event }",
|
|
247
|
+
description: "A row is about to be selected, by a click, or by Enter or Space: cancel it to decide what's selected yourself, reading the keys held from `originalEvent`. `appearance=\"columns\"`: the arrow keys select as they move too; `item` is the `<ui-tree-item>`, or the `items` entry; `path`, the ids of each column's pick down to it."
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: "ui-changed",
|
|
251
|
+
detail: "{ value: string, values: string[], item?: HTMLElement | TreeItemData, path?: string[], originalEvent?: Event }",
|
|
252
|
+
description: "What's selected changed: `value`, the row clicked; `values`, every selected row in the tree's order (each one's `value`, else its `label`). `appearance=\"columns\"`: also `item` and `path`, as `ui-selecting`'s."
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
name: "ui-settled",
|
|
256
|
+
detail: "{ value: string, values: string[], item?: HTMLElement | TreeItemData, path?: string[], originalEvent?: Event }",
|
|
257
|
+
description: "What's selected has stayed put for a moment: `ui-changed`'s detail, once the arrow keys stop. For a page doing heavy work on each pick."
|
|
258
|
+
}
|
|
259
|
+
],
|
|
260
|
+
slots: [
|
|
261
|
+
{
|
|
262
|
+
name: "",
|
|
263
|
+
description: "The top rows: `<ui-tree-item>`s."
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
name: "empty",
|
|
267
|
+
description: "Shown when `filter` matches no row."
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
name: "tools",
|
|
271
|
+
description: "At the end of the line above the rows, after `tools`' buttons: a filter field, say. On a narrow tree it drops to a line of its own; slotted without `tools`, the line holds it alone."
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
name: "detail",
|
|
275
|
+
description: "`appearance=\"columns\"`: a pane after the last column, showing what's picked: any element, which the tree hands the picked row as its `item` property (the `<ui-tree-item>`, or the `items` entry), and the page can fill from `ui-changed`. Drawn only while something is slotted and something is picked, tight against the last column, as wide as its content (up to `--ui-tree-detail-max-width`) until its line is dragged."
|
|
68
276
|
}
|
|
69
277
|
],
|
|
70
|
-
events: [{
|
|
71
|
-
name: "ui-selecting",
|
|
72
|
-
cancelable: !0,
|
|
73
|
-
detail: "{ item: HTMLElement, value: string, originalEvent?: Event }",
|
|
74
|
-
description: "A row is about to be selected, by a click, or by Enter or Space: cancel it to decide what's selected yourself, reading the keys held from `originalEvent`."
|
|
75
|
-
}, {
|
|
76
|
-
name: "ui-changed",
|
|
77
|
-
detail: "{ value: string, values: string[], originalEvent?: Event }",
|
|
78
|
-
description: "What's selected changed: `value`, the row clicked; `values`, every selected row in the tree's order (each one's `value`, else its `label`)."
|
|
79
|
-
}],
|
|
80
|
-
slots: [{
|
|
81
|
-
name: "",
|
|
82
|
-
description: "The top rows: `<ui-tree-item>`s."
|
|
83
|
-
}, {
|
|
84
|
-
name: "empty",
|
|
85
|
-
description: "Shown when `filter` matches no row."
|
|
86
|
-
}],
|
|
87
278
|
parts: [
|
|
88
279
|
{
|
|
89
280
|
name: "empty",
|
|
@@ -96,6 +287,42 @@ var ye = {
|
|
|
96
287
|
{
|
|
97
288
|
name: "path-row",
|
|
98
289
|
description: "`sticky-path`: each row's name in the path."
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
name: "narrow-column",
|
|
293
|
+
description: "`appearance=\"columns\"`: a column drawn narrow, a strip with its pick (`narrow-before`): from `items`, beside `column`; from markup, the first column (each deeper one is its row's `<ui-tree-item>`'s `narrow-column`)."
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
name: "column-title",
|
|
297
|
+
description: "`appearance=\"columns\"`: a column's title (`column-titles`): every column's from `items`; from markup, the first column's (each deeper one is its row's `<ui-tree-item>`'s `column-title`)."
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
name: "column",
|
|
301
|
+
description: "`appearance=\"columns\"` with `items`: one column."
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
name: "detail",
|
|
305
|
+
description: "`appearance=\"columns\"`: the pane around the `detail` slot."
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
name: "column-row",
|
|
309
|
+
description: "`appearance=\"columns\"` with `items`: one row of a column."
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
name: "tools",
|
|
313
|
+
description: "`tools`: the line of buttons above the rows."
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
name: "tool",
|
|
317
|
+
description: "`tools`: each button."
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
name: "matches-title",
|
|
321
|
+
description: "`appearance=\"columns\"` with a `filter`: the title over the matches elsewhere in the tree."
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
name: "match",
|
|
325
|
+
description: "`appearance=\"columns\"` with a `filter`: a match elsewhere in the tree, with the rows it's inside."
|
|
99
326
|
}
|
|
100
327
|
],
|
|
101
328
|
states: [
|
|
@@ -110,18 +337,69 @@ var ye = {
|
|
|
110
337
|
{
|
|
111
338
|
name: "columns",
|
|
112
339
|
description: "Its `appearance` is `columns`: a column per level, side by side."
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
name: "resizing",
|
|
343
|
+
description: "`appearance=\"columns\"`: the line after a column is being dragged."
|
|
113
344
|
}
|
|
114
345
|
],
|
|
115
|
-
texts: [
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
346
|
+
texts: [
|
|
347
|
+
{
|
|
348
|
+
key: "noMatches",
|
|
349
|
+
text: "Nothing matches",
|
|
350
|
+
description: "Shown when `filter` matches no row and no `empty` is given."
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
key: "resizeColumn",
|
|
354
|
+
text: "Resize this column",
|
|
355
|
+
description: "`appearance=\"columns\"`: the name of the line after a column, for a screen reader: drag it, or its arrow keys, to resize the column; Option (Alt) resizes every column; a double-click fits the column to its rows."
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
key: "resizeDetail",
|
|
359
|
+
text: "Resize the detail pane",
|
|
360
|
+
description: "`appearance=\"columns\"`: the name of the line after the `detail` pane, for a screen reader: drag it, or its arrow keys, to resize the pane; a double-click sizes it to its content again."
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
key: "loading",
|
|
364
|
+
text: "Loading",
|
|
365
|
+
description: "`appearance=\"columns\"`: what a screen reader hears while a column's rows are on their way."
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
key: "openLevels",
|
|
369
|
+
text: "Open {levels} levels",
|
|
370
|
+
description: "`tools`: the button that opens the tree so that many levels of rows show."
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
key: "closeAll",
|
|
374
|
+
text: "Close all",
|
|
375
|
+
description: "`tools`: the button that closes every row."
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
key: "elsewhere",
|
|
379
|
+
text: "Elsewhere in the tree",
|
|
380
|
+
description: "`appearance=\"columns\"` with a `filter`: the title over the matches outside the filtered column."
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
key: "lookingElsewhere",
|
|
384
|
+
text: "Looking through the tree",
|
|
385
|
+
description: "`appearance=\"columns\"` with a `filter`: what a screen reader hears while promised rows are on their way."
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
key: "moreMatches",
|
|
389
|
+
text: "{count} more, not listed",
|
|
390
|
+
description: "`appearance=\"columns\"` with a `filter`: how many matches elsewhere aren't listed."
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
key: "stoppedLooking",
|
|
394
|
+
text: "Stopped looking after {count} rows",
|
|
395
|
+
description: "`appearance=\"columns\"` with a `filter`: the look through the tree went through that many rows, and stopped."
|
|
396
|
+
}
|
|
397
|
+
]
|
|
398
|
+
}, Te = [
|
|
399
|
+
"icon",
|
|
400
|
+
"which",
|
|
401
|
+
"chevron"
|
|
402
|
+
], Ee = {
|
|
125
403
|
tag: "ui-tree-item",
|
|
126
404
|
icon: "circle outline",
|
|
127
405
|
topics: ["lists", "navigation"],
|
|
@@ -260,6 +538,14 @@ var ye = {
|
|
|
260
538
|
{
|
|
261
539
|
name: "group",
|
|
262
540
|
description: "The box around the rows inside it."
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
name: "column-title",
|
|
544
|
+
description: "`appearance=\"columns\"`: the title over the column of rows inside it (the tree's `column-titles`)."
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
name: "narrow-column",
|
|
548
|
+
description: "`appearance=\"columns\"`: beside `group`, while the column of rows inside it is drawn narrow, a strip with its pick (the tree's `narrow-before`)."
|
|
263
549
|
}
|
|
264
550
|
],
|
|
265
551
|
states: [
|
|
@@ -286,6 +572,10 @@ var ye = {
|
|
|
286
572
|
{
|
|
287
573
|
name: "in-columns",
|
|
288
574
|
description: "Its tree's `appearance` is `columns`: it's a row in one of its columns, and its rows the next one."
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
name: "in-narrow",
|
|
578
|
+
description: "Its tree's `appearance` is `columns`, and its column is drawn narrow: only the column's pick shows, its name sideways."
|
|
289
579
|
}
|
|
290
580
|
],
|
|
291
581
|
texts: [{
|
|
@@ -297,14 +587,14 @@ var ye = {
|
|
|
297
587
|
text: "Close",
|
|
298
588
|
description: "The triangle's name, open."
|
|
299
589
|
}]
|
|
300
|
-
}, xe = "@layer ui.components{:host{--_ui-tree-indent:var(--ui-tree-indent,12px);--_ui-tree-row-height:var(--ui-tree-row-height,22px);--_ui-tree-gap:var(--ui-tree-gap,4px);--_ui-tree-hover-background:var(--ui-tree-hover-background,color-mix(in oklab, var(--ui-primary) 6%, transparent));--_ui-tree-selected-background:var(--ui-tree-selected-background,var(--ui-primary-background));--_ui-tree-selected-color:var(--ui-tree-selected-color,var(--ui-primary-text,var(--ui-text-color)));--_ui-tree-muted-color:var(--ui-tree-muted-color,var(--ui-text-muted));--_ui-tree-path-background:var(--ui-tree-path-background,var(--ui-background));min-width:0;color:var(--ui-text-color);cursor:var(--ui-control-cursor);overflow-anchor:none;outline:none;display:block}:host(:state(filtered-out)),:host(:state(filtering)) ::slotted(:not([label])){display:none}.empty{color:var(--_ui-tree-muted-color);padding:.5em 8px}.path{z-index:1;align-items:center;gap:var(--_ui-tree-gap);box-sizing:border-box;height:var(--_ui-tree-row-height);white-space:nowrap;background:var(--_ui-tree-path-background);backdrop-filter:blur(12px);border-block-end:1px solid var(--ui-border-color);color:var(--_ui-tree-muted-color);margin-block-end:calc(var(--_ui-tree-row-height) * -1);padding-inline:8px;display:flex;position:sticky;top:0;overflow:hidden}.path-row{text-overflow:ellipsis;flex:0 auto;min-width:1.5em;overflow:hidden}.path-row:last-child{min-width:0;color:var(--ui-text-color)}.path-row:hover{color:var(--ui-text-color);text-decoration:underline}.separator{flex:none}.row{align-items:center;gap:var(--_ui-tree-gap);box-sizing:border-box;min-height:var(--_ui-tree-row-height);padding-inline:calc(8px + var(--_ui-tree-depth,0) * var(--_ui-tree-indent)) 8px;white-space:nowrap;display:flex}.row:hover{background:var(--_ui-tree-hover-background)}:host(:state(selected))>.row{background:var(--_ui-tree-selected-background);color:var(--_ui-tree-selected-color)}:host(:focus-visible)>.row{outline:var(--ui-focus-width) solid var(--ui-focus-color);outline-offset:calc(var(--ui-focus-width) * -1)}.toggle{color:var(--_ui-tree-muted-color);flex:0 0 12px;justify-content:center;align-self:stretch;align-items:center;display:inline-flex}:host(:state(has-items))>.row>.toggle:before{content:\"\";clip-path:polygon(20% 5%,90% 50%,20% 95%);background:currentColor;width:.62em;height:.62em;transition:rotate .1s}:host(:state(has-items)[aria-expanded=true])>.row>.toggle:before,:host(:state(open):state(has-items))>.row>.toggle:before{rotate:90deg}.icon,::slotted([slot=icon]){color:var(--_ui-tree-muted-color);--ui-icon-width:1em;--ui-icon-distance:0;flex:none;margin:0}.label{text-overflow:ellipsis;flex:0 auto;gap:.33em;min-width:0;display:flex;overflow:hidden}.words{text-overflow:ellipsis;flex:0 auto;min-width:0;overflow:hidden}.which{text-overflow:ellipsis;min-width:0;color:var(--_ui-tree-muted-color);flex:0 10 auto;overflow:hidden}.actions{align-items:center;gap:var(--_ui-tree-gap);margin-inline-start:auto;display:inline-flex}:host(:state(nav)){--_ui-tree-nav-border-color:var(--ui-tree-nav-border-color,light-dark(color-mix(in oklab, var(--ui-brown-background), var(--ui-brown) 9%),var(--ui-border-color)));--_ui-tree-nav-band-background:var(--ui-tree-nav-band-background,color-mix(in oklab, var(--ui-brown-background) 50%, light-dark(#fffdf8,var(--ui-surface))));--_ui-tree-nav-band-color:var(--ui-tree-nav-band-color,var(--ui-brown-text));--_ui-tree-nav-subheading-color:var(--ui-tree-nav-subheading-color,var(--ui-text-muted));--_ui-tree-nav-current-background:var(--ui-tree-nav-current-background,light-dark(var(--ui-primary-background),var(--ui-primary)));--_ui-tree-nav-current-color:var(--ui-tree-nav-current-color,light-dark(var(--ui-primary-text),var(--ui-primary-on)));--_ui-tree-nav-open-duration:var(--ui-tree-nav-open-duration,.32s);--_ui-tree-nav-close-duration:var(--ui-tree-nav-close-duration,.14s);--_ui-tree-nav-ease:var(--ui-tree-nav-ease,var(--ui-ease-out));--_ui-tree-indent:var(--ui-tree-indent,1em);--_ui-tree-hover-background:var(--ui-tree-hover-background,oklch(from var(--ui-text-dark) l c h / .06));line-height:1.25}:host(:state(nav))>.rows{grid-template-rows:1fr;display:grid}:host(:state(nav))>.rows.shut{grid-template-rows:0fr}:host(:state(nav))>.rows>.folded{min-height:0;overflow:hidden}:host(:state(nav))>.rows.shut>.folded{visibility:hidden}@media (prefers-reduced-motion:no-preference){:host(:state(nav))>.rows{transition:grid-template-rows var(--_ui-tree-nav-open-duration) var(--_ui-tree-nav-ease)}:host(:state(nav))>.rows.shut{transition-duration:var(--_ui-tree-nav-close-duration)}:host(:state(nav))>.rows.shut>.folded{transition:visibility 0s linear var(--_ui-tree-nav-close-duration)}:host(:state(nav))>.row>.toggle{transition:opacity .15s ease-out}:host(:state(nav):state(has-items))>.row>.toggle:before{transition:rotate .2s var(--_ui-tree-nav-ease), translate .2s var(--_ui-tree-nav-ease)}}:host(:state(nav))>.row{min-height:round(2.25em, var(--ui-grid,4px));padding-block:.25em;padding-inline:calc(.75em + var(--_ui-tree-depth,0) * var(--_ui-tree-indent)) .75em;border-radius:var(--ui-radius-m);white-space:nowrap;gap:.75em;margin-inline:.571429em;font-size:.875em;font-weight:500}:host(:state(nav))>.row:hover{color:var(--ui-text-dark)}:host(:state(nav):state(selected))>.row{background:var(--_ui-tree-nav-current-background);color:var(--_ui-tree-nav-current-color)}:host(:state(nav):state(selected))>.row .icon,:host(:state(nav):state(selected))>.row>::slotted([slot=icon]){color:inherit}:host(:state(nav):state(band))>.rows>.folded>slot{padding-block:round(.375em, var(--ui-grid,4px));display:block}:host(:state(nav)[band=subheading]:first-child){margin-block-start:calc(-1 * round(.375em, var(--ui-grid,4px)))}:host(:state(nav)[band=subheading]:last-child){margin-block-end:calc(-1 * round(.375em, var(--ui-grid,4px)))}:host(:state(nav)) .icon,:host(:state(nav)) ::slotted([slot=icon]){text-align:center;--ui-icon-width:1.25em;width:1.25em;font-size:1.05em}.count::part(label),.badge::part(label){flex:none;margin:0}:host(:state(nav))>.row>.toggle{opacity:.55;flex-basis:1em;order:99;margin-inline:auto -.25em}:host(:state(nav))>.row:hover>.toggle,:host(:state(nav):focus-visible)>.row>.toggle{opacity:1}:host(:state(nav):state(has-items))>.row>.toggle:before{clip-path:none;background:0 0;border-block-end:1.5px solid;border-inline-end:1.5px solid;width:.45em;height:.45em;translate:0 -.1em;rotate:-45deg}:host(:state(nav):state(has-items)[aria-expanded=true])>.row>.toggle:before,:host(:state(nav):state(open):state(has-items))>.row>.toggle:before{translate:0 -.2em;rotate:45deg}:host(:state(nav))>.row.heading{z-index:1;border-block-start:1px solid var(--_ui-tree-nav-border-color);background:linear-gradient(var(--_ui-tree-nav-band-background), var(--_ui-tree-nav-band-background)), var(--ui-background);min-height:2.25em;color:var(--_ui-tree-nav-band-color);font:var(--ui-font-weight-bold) .75em / 1 var(--ui-font-family);letter-spacing:.01em;text-transform:uppercase;border-radius:0;gap:.5em;margin:0;padding:.25em 1em;position:sticky;top:0}:host(:state(nav):first-child)>.row.heading{border-block-start:0}:host(:state(nav))>.row.heading>.toggle,:host(:state(nav))>.row.subheading>.toggle{font-size:1.3em}:host(:state(nav))>.row.subheading{border-block-start:1px solid color-mix(in oklab, var(--_ui-tree-nav-border-color) 60%, transparent);min-height:2em;color:var(--_ui-tree-nav-subheading-color);font:500 .6875em / 1 var(--ui-font-family-mono);letter-spacing:.12em;text-transform:uppercase;border-radius:0;gap:.5em;margin:0;padding:.25em 1em}:host(:state(nav))>.row.subheading:hover{color:var(--ui-text-dark)}:host(:state(nav))>.row.heading .count::part(label),:host(:state(nav))>.row.subheading .count::part(label){font-family:var(--ui-font-family);letter-spacing:0}:host(:state(nav))>.row.group{min-height:round(2em, var(--ui-grid,4px));color:var(--_ui-tree-nav-subheading-color);margin-block-start:round(.5em, var(--ui-grid,4px));padding-block:.25em;padding-inline:.923077em .75em;font-size:.8125em;font-weight:500}:host(:state(nav):first-child)>.row.group{margin-block-start:0}:host(:state(nav))>.row.group>.toggle{display:none}:host(:state(nav))>.row.group:hover{color:var(--ui-text-dark)}:host(:state(nav):state(band))>.row:hover{background-color:#0000}:host(:state(nav):state(band):focus-visible)>.row{outline-offset:calc(var(--ui-focus-width) * -1)}}", E = "@layer ui.components{:host(:state(columns)){height:18em}.columns{--_ui-tree-column-width:var(--ui-tree-column-width,14em);--_ui-tree-title-height:calc(var(--_ui-tree-row-height) + 6px);box-sizing:border-box;contain:layout;height:100%;display:flex;overflow:auto hidden}.column{box-sizing:border-box;overflow-anchor:none;border-inline-end:1px solid var(--ui-border-color);flex:none;height:100%;overflow-y:auto}.column-edge{z-index:2;cursor:col-resize;touch-action:none;outline:none;width:7px;margin-inline-start:-4px;position:absolute;inset-block:0}.column-edge:after{content:\"\";width:1px;position:absolute;inset-block:0;inset-inline-start:3px}.column-edge:hover:after,.column-edge:active:after{background:color-mix(in oklab, var(--ui-text-color) 30%, var(--ui-border-color));width:2px;margin-inline-start:-.5px}.column-edge:focus-visible:after{width:var(--ui-focus-width);background:var(--ui-focus-color)}.column-probe{visibility:hidden;width:var(--_ui-tree-column-width);height:0;position:absolute}.column-title{z-index:1;box-sizing:border-box;height:var(--_ui-tree-title-height);border-block-end:1px solid var(--ui-border-color);background:var(--ui-background);color:var(--ui-text-muted);font-size:.85em;font-weight:var(--ui-font-weight-bold);text-overflow:ellipsis;white-space:nowrap;align-items:center;padding-inline:10px;display:flex;position:sticky;top:0;overflow:hidden}:host(:state(in-columns)){--_ui-tree-column-picked-background:var(--ui-tree-column-picked-background,color-mix(in oklab, var(--ui-text-color) 13%, transparent));--_ui-tree-column-selected-background:var(--ui-tree-column-selected-background,var(--ui-primary));--_ui-tree-column-selected-color:var(--ui-tree-column-selected-color,var(--ui-primary-on))}:host(:state(in-columns))>.row{border-radius:var(--ui-radius-s,4px);margin-inline:4px;padding-inline:6px 4px}:host(:state(in-columns):state(open))>.row{background:var(--_ui-tree-column-picked-background)}:host(:state(in-columns):state(selected))>.row{background:var(--_ui-tree-column-selected-background);color:var(--_ui-tree-column-selected-color)}:host(:state(in-columns):state(selected))>.row .icon,:host(:state(in-columns):state(selected))>.row>::slotted([slot=icon]),:host(:state(in-columns):state(selected))>.row .which,:host(:state(in-columns):state(selected))>.row>.toggle{color:inherit}:host(:state(in-columns))>.row>.toggle{flex-basis:1em;order:99;margin-inline-start:auto}:host(:state(in-columns):not(:state(has-items)))>.row>.toggle{visibility:hidden}:host(:state(in-columns):state(has-items))>.row>.toggle:before,:host(:state(in-columns):state(open):state(has-items))>.row>.toggle:before{clip-path:none;background:0 0;border-block-end:1.5px solid;border-inline-end:1.5px solid;width:.42em;height:.42em;transition:none;rotate:-45deg}:host(:state(in-columns):state(has-items):dir(rtl))>.row>.toggle:before{rotate:45deg}:host(:state(in-columns))>.row>.actions{margin-inline-start:0}:host(:state(in-columns))>.rows{box-sizing:border-box;width:var(--_ui-tree-column-own-width);overflow-anchor:none;border-inline-end:1px solid var(--ui-border-color);position:fixed;inset-block:0;inset-inline-start:var(--_ui-tree-column-start);overflow-y:auto}:host(:state(in-columns))>.rows>.folded>slot,.column>slot{padding-block:4px;display:block}}", Se = /* @__PURE__ */ T("<div><span class=toggle aria-hidden=true></span><slot name=icon></slot><span class=label><slot name=label><span class=words></span></slot></span><!><span class=actions><slot name=actions>"), Ce = /* @__PURE__ */ T("<div class=rows role=group><div class=folded><slot>"), we = /* @__PURE__ */ T("<ui-icon class=icon>", 1), Te = /* @__PURE__ */ T("<span class=which>"), Ee = /* @__PURE__ */ T("<ui-label class=count size=mini appearance=circular>", 1), De = /* @__PURE__ */ T("<ui-label class=badge size=mini color=yellow appearance=basic>", 1), Oe = /* @__PURE__ */ T("<div class=column-title aria-hidden=true>"), D, O, k, A, j, M, N, ke, Ae, je, Me, Ne, Pe, Fe, Ie, Le, Re, ze, P, F, I, L, R, z, B, V, H, U = class _UITreeItem extends (P = s, ze = [ae], Re = [oe], Le = [p("open"), ne("open")], Ie = [g], Fe = [g], Pe = [g], Ne = [p("in-columns")], Me = [p("nav"), g], je = [p("band")], Ae = [g, p("filtered-out")], ke = [g], N = [ue({ childList: !0 })], M = [p("has-items")], j = [d("expanded")], A = [d("selected")], k = [d("level")], O = [le], D = [m("selected", { defer: !0 })], P) {
|
|
590
|
+
}, De = "@layer ui.components{:host{--_ui-tree-indent:var(--ui-tree-indent,12px);--_ui-tree-row-height:var(--ui-tree-row-height,22px);--_ui-tree-gap:var(--ui-tree-gap,4px);--_ui-tree-hover-background:var(--ui-tree-hover-background,color-mix(in oklab, var(--ui-primary) 6%, transparent));--_ui-tree-selected-background:var(--ui-tree-selected-background,var(--ui-primary-background));--_ui-tree-selected-color:var(--ui-tree-selected-color,var(--ui-primary-text,var(--ui-text-color)));--_ui-tree-muted-color:var(--ui-tree-muted-color,var(--ui-text-muted));--_ui-tree-path-background:var(--ui-tree-path-background,var(--ui-background));min-width:0;color:var(--ui-text-color);cursor:var(--ui-control-cursor);overflow-anchor:none;outline:none;display:block}:host(:state(filtered-out)),:host(:state(filtering)) ::slotted(:not([label],[slot])){display:none}.tools{flex-wrap:wrap;flex:none;align-items:center;gap:4px 8px;padding:4px 8px 8px;display:flex}:host(:state(columns))>.tools{padding-inline:10px}.tool-buttons{flex-wrap:nowrap;gap:4px;min-width:0;max-width:100%;margin:-2px;padding:2px;display:flex;overflow-x:auto}.tool-buttons>ui-button{flex:none}.tools>slot{flex:12em;max-width:20em;margin-inline-start:auto;display:block}.tools ::slotted(*){box-sizing:border-box;width:100%}.empty{color:var(--_ui-tree-muted-color);padding:.5em 8px}.path{z-index:1;align-items:center;gap:var(--_ui-tree-gap);box-sizing:border-box;height:var(--_ui-tree-row-height);white-space:nowrap;background:var(--_ui-tree-path-background);backdrop-filter:blur(12px);border-block-end:1px solid var(--ui-border-color);color:var(--_ui-tree-muted-color);margin-block-end:calc(var(--_ui-tree-row-height) * -1);padding-inline:8px;display:flex;position:sticky;top:0;overflow:hidden}.path-row{text-overflow:ellipsis;flex:0 auto;min-width:1.5em;overflow:hidden}.path-row.current{min-width:0;color:var(--ui-text-color);font-weight:var(--ui-font-weight-bold)}.path-row:not(.current){cursor:pointer}.path-row.folded{flex:none;min-width:0}@media (hover:hover){.path-row:not(.current):hover{color:var(--ui-text-color);text-decoration:underline}}.separator{flex:none}.row{align-items:center;gap:var(--_ui-tree-gap);box-sizing:border-box;min-height:var(--_ui-tree-row-height);padding-inline:calc(8px + var(--_ui-tree-depth,0) * var(--_ui-tree-indent)) 8px;white-space:nowrap;display:flex}.row:hover{background:var(--_ui-tree-hover-background)}:host(:state(selected))>.row{background:var(--_ui-tree-selected-background);color:var(--_ui-tree-selected-color)}:host(:focus-visible)>.row{outline:var(--ui-focus-width) solid var(--ui-focus-color);outline-offset:calc(var(--ui-focus-width) * -1)}.toggle{color:var(--_ui-tree-muted-color);flex:0 0 12px;justify-content:center;align-self:stretch;align-items:center;display:inline-flex}:host(:state(has-items))>.row>.toggle:before{content:\"\";clip-path:polygon(20% 5%,90% 50%,20% 95%);background:currentColor;width:.62em;height:.62em;transition:rotate .1s}:host(:state(has-items)[aria-expanded=true])>.row>.toggle:before,:host(:state(open):state(has-items))>.row>.toggle:before{rotate:90deg}.icon,::slotted([slot=icon]){color:var(--_ui-tree-muted-color);--ui-icon-width:1em;--ui-icon-distance:0;flex:none;margin:0}.label{text-overflow:ellipsis;flex:0 auto;gap:.33em;min-width:0;display:flex;overflow:hidden}.words{text-overflow:ellipsis;flex:0 auto;min-width:0;overflow:hidden}.which{text-overflow:ellipsis;min-width:0;color:var(--_ui-tree-muted-color);flex:0 10 auto;overflow:hidden}.actions{align-items:center;gap:var(--_ui-tree-gap);margin-inline-start:auto;display:inline-flex}:host(:state(nav)){--_ui-tree-nav-border-color:var(--ui-tree-nav-border-color,light-dark(color-mix(in oklab, var(--ui-brown-background), var(--ui-brown) 9%),var(--ui-border-color)));--_ui-tree-nav-band-background:var(--ui-tree-nav-band-background,color-mix(in oklab, var(--ui-brown-background) 50%, light-dark(#fffdf8,var(--ui-surface))));--_ui-tree-nav-band-color:var(--ui-tree-nav-band-color,var(--ui-brown-text));--_ui-tree-nav-subheading-color:var(--ui-tree-nav-subheading-color,var(--ui-text-muted));--_ui-tree-nav-current-background:var(--ui-tree-nav-current-background,light-dark(var(--ui-primary-background),var(--ui-primary)));--_ui-tree-nav-current-color:var(--ui-tree-nav-current-color,light-dark(var(--ui-primary-text),var(--ui-primary-on)));--_ui-tree-nav-open-duration:var(--ui-tree-nav-open-duration,.32s);--_ui-tree-nav-close-duration:var(--ui-tree-nav-close-duration,.14s);--_ui-tree-nav-ease:var(--ui-tree-nav-ease,var(--ui-ease-out));--_ui-tree-indent:var(--ui-tree-indent,1em);--_ui-tree-hover-background:var(--ui-tree-hover-background,oklch(from var(--ui-text-dark) l c h / .06));line-height:1.25}:host(:state(nav))>.rows{grid-template-rows:1fr;display:grid}:host(:state(nav))>.rows.shut{grid-template-rows:0fr}:host(:state(nav))>.rows>.folded{min-height:0;overflow:hidden}:host(:state(nav))>.rows.shut>.folded{visibility:hidden}@media (prefers-reduced-motion:no-preference){:host(:state(nav))>.rows{transition:grid-template-rows var(--_ui-tree-nav-open-duration) var(--_ui-tree-nav-ease)}:host(:state(nav))>.rows.shut{transition-duration:var(--_ui-tree-nav-close-duration)}:host(:state(nav))>.rows.shut>.folded{transition:visibility 0s linear var(--_ui-tree-nav-close-duration)}:host(:state(nav))>.row>.toggle{transition:opacity .15s ease-out}:host(:state(nav):state(has-items))>.row>.toggle:before{transition:rotate .2s var(--_ui-tree-nav-ease), translate .2s var(--_ui-tree-nav-ease)}}:host(:state(nav))>.row{min-height:round(2.25em, var(--ui-grid,4px));padding-block:.25em;padding-inline:calc(.75em + var(--_ui-tree-depth,0) * var(--_ui-tree-indent)) .75em;border-radius:var(--ui-radius-m);white-space:nowrap;gap:.75em;margin-inline:.571429em;font-size:.875em;font-weight:500}:host(:state(nav))>.row:hover{color:var(--ui-text-dark)}:host(:state(nav):state(selected))>.row{background:var(--_ui-tree-nav-current-background);color:var(--_ui-tree-nav-current-color)}:host(:state(nav):state(selected))>.row .icon,:host(:state(nav):state(selected))>.row>::slotted([slot=icon]){color:inherit}:host(:state(nav):state(band))>.rows>.folded>slot{padding-block:round(.375em, var(--ui-grid,4px));display:block}:host(:state(nav)[band=subheading]:first-child){margin-block-start:calc(-1 * round(.375em, var(--ui-grid,4px)))}:host(:state(nav)[band=subheading]:last-child){margin-block-end:calc(-1 * round(.375em, var(--ui-grid,4px)))}:host(:state(nav)) .icon,:host(:state(nav)) ::slotted([slot=icon]){text-align:center;--ui-icon-width:1.25em;width:1.25em;font-size:1.05em}.count::part(label),.badge::part(label){flex:none;margin:0}:host(:state(nav))>.row>.toggle{opacity:.55;flex-basis:1em;order:99;margin-inline:auto -.25em}:host(:state(nav))>.row:hover>.toggle,:host(:state(nav):focus-visible)>.row>.toggle{opacity:1}:host(:state(nav):state(has-items))>.row>.toggle:before{clip-path:none;background:0 0;border-block-end:1.5px solid;border-inline-end:1.5px solid;width:.45em;height:.45em;translate:0 -.1em;rotate:-45deg}:host(:state(nav):state(has-items)[aria-expanded=true])>.row>.toggle:before,:host(:state(nav):state(open):state(has-items))>.row>.toggle:before{translate:0 -.2em;rotate:45deg}:host(:state(nav))>.row.heading{z-index:1;border-block-start:1px solid var(--_ui-tree-nav-border-color);background:linear-gradient(var(--_ui-tree-nav-band-background), var(--_ui-tree-nav-band-background)), var(--ui-background);min-height:2.25em;color:var(--_ui-tree-nav-band-color);font:var(--ui-font-weight-bold) .75em / 1 var(--ui-font-family);letter-spacing:.01em;text-transform:uppercase;border-radius:0;gap:.5em;margin:0;padding:.25em 1em;position:sticky;top:0}:host(:state(nav):first-child)>.row.heading{border-block-start:0}:host(:state(nav))>.row.heading>.toggle,:host(:state(nav))>.row.subheading>.toggle{font-size:1.3em}:host(:state(nav))>.row.subheading{border-block-start:1px solid color-mix(in oklab, var(--_ui-tree-nav-border-color) 60%, transparent);min-height:2em;color:var(--_ui-tree-nav-subheading-color);font:500 .6875em / 1 var(--ui-font-family-mono);letter-spacing:.12em;text-transform:uppercase;border-radius:0;gap:.5em;margin:0;padding:.25em 1em}:host(:state(nav))>.row.subheading:hover{color:var(--ui-text-dark)}:host(:state(nav))>.row.heading .count::part(label),:host(:state(nav))>.row.subheading .count::part(label){font-family:var(--ui-font-family);letter-spacing:0}:host(:state(nav))>.row.group{min-height:round(2em, var(--ui-grid,4px));color:var(--_ui-tree-nav-subheading-color);margin-block-start:round(.5em, var(--ui-grid,4px));padding-block:.25em;padding-inline:.923077em .75em;font-size:.8125em;font-weight:500}:host(:state(nav):first-child)>.row.group{margin-block-start:0}:host(:state(nav))>.row.group>.toggle{display:none}:host(:state(nav))>.row.group:hover{color:var(--ui-text-dark)}:host(:state(nav):state(band))>.row:hover{background-color:#0000}:host(:state(nav):state(band):focus-visible)>.row{outline-offset:calc(var(--ui-focus-width) * -1)}}", Oe = "@layer ui.components{:host(:state(columns)){--_ui-tree-columns-height:var(--ui-tree-columns-height,18em);height:var(--_ui-tree-columns-height);flex-direction:column;display:flex}:host(:state(columns))>.path{backdrop-filter:none;flex:none;margin-block-end:0;position:static}:host(:state(columns)),:host(:state(in-columns)){--_ui-tree-column-picked-background:var(--ui-tree-column-picked-background,color-mix(in oklab, var(--ui-text-color) 13%, transparent));--_ui-tree-column-selected-background:var(--ui-tree-column-selected-background,var(--ui-primary));--_ui-tree-column-selected-color:var(--ui-tree-column-selected-color,var(--ui-primary-on))}.columns{--_ui-tree-column-width:var(--ui-tree-column-width,14em);--_ui-tree-narrow-width:var(--ui-tree-narrow-width,2em);--_ui-tree-title-height:calc(var(--_ui-tree-row-height) + 6px);box-sizing:border-box;contain:layout;scroll-snap-type:x mandatory;flex:1 1 0;min-height:0;display:flex;overflow:auto hidden}.column{box-sizing:border-box;overflow-anchor:none;border-inline-end:1px solid var(--ui-border-color);scroll-snap-align:start;flex:none;height:100%;overflow-y:auto}.column-filler{flex:1 0 0;min-width:0}.column-filler.titled{box-sizing:border-box;height:var(--_ui-tree-title-height);border-block-end:1px solid var(--ui-border-color)}.column-edge{z-index:2;cursor:col-resize;touch-action:none;outline:none;width:7px;margin-inline-start:-4px;position:absolute;inset-block:0}.column-edge.last{margin-inline-start:-7px}.column-edge.last:after{inset-inline-start:6px}.column-edge:after{content:\"\";width:1px;position:absolute;inset-block:0;inset-inline-start:3px}.column-edge:hover:after,.column-edge:active:after{background:color-mix(in oklab, var(--ui-text-color) 30%, var(--ui-border-color));width:2px;margin-inline-start:-.5px}.column-edge:focus-visible:after{width:var(--ui-focus-width);background:var(--ui-focus-color)}.column-probe,.narrow-probe{visibility:hidden;width:var(--_ui-tree-column-width);height:0;position:absolute}.narrow-probe{width:var(--_ui-tree-narrow-width)}.detail{--_ui-tree-detail-max-width:var(--ui-tree-detail-max-width,50%);box-sizing:border-box;width:max-content;min-width:80px;max-width:var(--_ui-tree-detail-max-width);border-inline-end:1px solid var(--ui-border-color);scroll-snap-align:end;background:0 0;flex-direction:column;flex:none;height:100%;display:flex;position:relative}.detail.sized{max-width:none}.detail.sticky{--_ui-tree-detail-tint:color-mix(in oklab, var(--ui-surface) 45%, transparent);z-index:2;background:var(--ui-tree-detail-background,linear-gradient(var(--_ui-tree-detail-tint), var(--_ui-tree-detail-tint)), var(--ui-background));position:sticky;inset-inline-end:0}.detail-title{flex:none}.detail-body{box-sizing:border-box;flex:1 1 0;min-height:0;padding:8px 12px;overflow:auto}.detail-body>::slotted(*){min-width:min-content}.detail>.detail-edge{margin-inline-start:0;inset-inline:auto 0}.detail>.detail-edge:after{inset-inline:auto 0}.column-title{z-index:1;box-sizing:border-box;height:var(--_ui-tree-title-height);border-block-end:1px solid var(--ui-border-color);background:var(--ui-background);color:var(--ui-text-muted);font-size:.85em;font-weight:var(--ui-font-weight-bold);text-overflow:ellipsis;white-space:nowrap;align-items:center;padding-inline:10px;display:flex;position:sticky;top:0;overflow:hidden}:host(:state(in-columns))>.row{border-radius:var(--ui-radius-s,4px);margin-inline:4px;padding-inline:6px 4px}:host(:state(in-columns):state(open))>.row{background:var(--_ui-tree-column-picked-background)}:host(:state(in-columns):state(selected))>.row{background:var(--_ui-tree-column-selected-background);color:var(--_ui-tree-column-selected-color)}:host(:state(in-columns):state(selected))>.row .icon,:host(:state(in-columns):state(selected))>.row>::slotted([slot=icon]),:host(:state(in-columns):state(selected))>.row .which,:host(:state(in-columns):state(selected))>.row>.toggle{color:inherit}:host(:state(in-columns))>.row>.toggle{flex-basis:1em;order:99;margin-inline-start:auto}:host(:state(in-columns):not(:state(has-items)))>.row>.toggle{visibility:hidden}:host(:state(in-columns):state(has-items))>.row>.toggle:before,:host(:state(in-columns):state(open):state(has-items))>.row>.toggle:before{clip-path:none;background:0 0;border-block-end:1.5px solid;border-inline-end:1.5px solid;width:.42em;height:.42em;transition:none;rotate:-45deg}:host(:state(in-columns):state(has-items):dir(rtl))>.row>.toggle:before{rotate:45deg}:host(:state(in-columns))>.row>.actions{margin-inline-start:0}.row-count{font-variant-numeric:tabular-nums;color:var(--_ui-tree-muted-color);flex:none;margin-inline-start:auto;font-size:.85em}:host(:state(in-columns):state(selected))>.row>.row-count{color:inherit}:host(:state(in-columns))>.row>.row-count+.actions,:host(:state(in-columns))>.row>.row-count~.toggle{margin-inline-start:var(--_ui-tree-gap)}:host(:state(in-columns))>.rows{box-sizing:border-box;width:var(--_ui-tree-column-own-width);overflow-anchor:none;border-inline-end:1px solid var(--ui-border-color);scroll-snap-align:start;position:fixed;inset-block:0;inset-inline-start:var(--_ui-tree-column-start);overflow-y:auto}:host(:state(in-columns))>.rows>.folded>slot,.column>slot{padding-block:4px;display:block}:host(:state(in-columns))>.rows>.folded>.loading{position:absolute;inset:0}.column.items{grid-template-columns:auto minmax(0, var(--_tree-words-track,max-content)) minmax(0, var(--_tree-which-track,max-content)) 1fr auto auto;align-content:start;margin:0;padding:0 0 4px;list-style:none;display:grid;position:relative}.column.items:not(:has(>.column-title)){padding-block-start:4px}.column.items>.column-title{grid-column:1/-1;margin-block-end:4px}.column.items>.empty{grid-column:1/-1}.column-row,.track-probe{grid-template-columns:subgrid;box-sizing:border-box;min-height:var(--_ui-tree-row-height);border-radius:var(--ui-radius-s,4px);white-space:nowrap;outline:none;grid-column:1/-1;align-items:center;margin-inline:4px;padding-inline:6px 4px;display:grid}.column.items>.track-probe{visibility:hidden;height:0;min-height:0;overflow:hidden}.column-row:hover{background:var(--_ui-tree-hover-background)}.column-row:focus-visible{outline:var(--ui-focus-width) solid var(--ui-focus-color);outline-offset:calc(var(--ui-focus-width) * -1)}.column-row.on-path{background:var(--_ui-tree-column-picked-background)}.column-row.selected{background:var(--_ui-tree-column-selected-background);color:var(--_ui-tree-column-selected-color)}.column-row.unmatched,:host(:state(in-columns):state(unmatched))>.row{opacity:.55}.column-row.selected>.icon,.column-row.selected .which,.column-row.selected>.count{color:inherit}:is(.column-row,.track-probe)>.icon{grid-column:1;margin-inline-end:var(--_ui-tree-gap);display:inline-flex}.column-row>.label{display:contents}.column-row .words{grid-column:2}.column-row .which{grid-column:3;margin-inline-start:.33em}:is(.column-row,.track-probe)>.count{font-variant-numeric:tabular-nums;color:var(--_ui-tree-muted-color);grid-column:5;justify-self:end;margin-inline-start:var(--_ui-tree-gap);font-size:.85em}:is(.column-row,.track-probe)>.chevron{border-block-end:1.5px solid;border-inline-end:1.5px solid;grid-column:6;width:.42em;height:.42em;margin-inline:8px 4px;rotate:-45deg}.column-row>.chevron:dir(rtl){rotate:45deg}:host(:state(columns)){--_ui-tree-narrow-duration:var(--ui-duration-normal)}:host(:state(columns):state(resizing)){--_ui-tree-narrow-duration:0s}:host(:state(columns)),:host(:state(in-columns)){--_ui-tree-narrow-pill-height:8em}@media (prefers-reduced-motion:reduce){:host(:state(columns)){--_ui-tree-narrow-duration:0s}}.column,.column-edge,:host(:state(in-columns))>.rows{transition-property:width,inset-inline-start;transition-duration:var(--_ui-tree-narrow-duration,0s);transition-timing-function:ease}.column.narrow,:host(:state(in-columns))>.rows.narrow{overflow:hidden}.column.peek,:host(:state(in-columns))>.rows.peek{z-index:3;background:var(--ui-background);box-shadow:var(--ui-shadow-floating), 0 0 0 1px light-dark(#0000,oklch(100% 0 0/.08))}.column.peek{position:relative}:host(:state(in-columns))>.rows.covered{border-inline-end-color:#0000}.column-edge.narrow,.column-edge.covered,.column.narrow>.empty,.column.narrow>.track-probe,.column.narrow>.column-row:not(.on-path,.selected){display:none}.column.narrow>.column-title,:host(:state(in-columns))>.rows.narrow>.column-title{color:#0000;padding-inline:0}.column.narrow>.column-row{align-items:center;gap:var(--_ui-tree-gap);box-sizing:border-box;height:var(--_ui-tree-narrow-pill-height);writing-mode:vertical-rl;margin-inline:2px;padding:8px 0;display:flex;overflow:hidden}.column.narrow>.column-row .words{text-overflow:ellipsis;min-inline-size:0;overflow:hidden}.column.narrow>.column-row :is(.which,.count,.chevron),.column.narrow>.column-row>:is(.count,.chevron){display:none}.column.narrow>.column-row>.icon{margin:0}:host(:state(in-narrow):not(:state(open))){display:none}:host(:state(in-narrow))>.row{box-sizing:border-box;height:var(--_ui-tree-narrow-pill-height);writing-mode:vertical-rl;justify-content:start;min-height:0;margin-inline:2px;padding:8px 0;overflow:hidden}:host(:state(in-narrow))>.row>.label,:host(:state(in-narrow))>.row .words{text-overflow:ellipsis;min-inline-size:0;overflow:hidden}:host(:state(in-narrow))>.row>:is(.toggle,.row-count,.count,.badge,.actions),:host(:state(in-narrow))>.row .which{display:none}.column.items>.matches-box{grid-column:1/-1;display:block}.matches{border-block-start:1px solid var(--ui-border-color);margin-block-start:4px;padding-block:4px}.matches-title,.matches-note,.matches-loading{color:var(--_ui-tree-muted-color);padding:4px 10px;font-size:.85em}.matches-title{font-weight:var(--ui-font-weight-bold);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.matches-loading{align-items:center;gap:8px;display:flex}.match{border-radius:var(--ui-radius-s,4px);cursor:pointer;grid-template-columns:auto minmax(0,1fr);align-items:center;margin-inline:4px;padding:2px 4px 2px 6px;display:grid}.match:hover{background:var(--_ui-tree-hover-background)}.match>.icon{grid-column:1;margin-inline-end:var(--_ui-tree-gap);display:inline-flex}.match-words{min-height:var(--_ui-tree-row-height);white-space:nowrap;grid-column:2;align-items:center;display:flex;overflow:hidden}.match-words>.words{text-overflow:ellipsis;overflow:hidden}.match .which{color:var(--_ui-tree-muted-color);margin-inline-start:.33em}.match-path{color:var(--_ui-tree-muted-color);overflow-wrap:anywhere;grid-column:2;padding-block-end:2px;font-size:.85em}.column.narrow .matches,:host(:state(in-columns))>.rows.narrow .matches{display:none}}", ke = /* @__PURE__ */ z("<span class=toggle aria-hidden=true>"), Ae = /* @__PURE__ */ z("<span class=row-count>"), je = /* @__PURE__ */ z("<div><slot name=icon></slot><span class=label><slot name=label><span class=words></span></slot></span><!><!><span class=actions><slot name=actions>"), Me = /* @__PURE__ */ z("<div class=loading><ui-loader visible size=small>", 1), Ne = /* @__PURE__ */ z("<div class=empty>"), Pe = /* @__PURE__ */ z("<div class=rows role=group><div class=folded><slot></slot><!><!><!>"), Fe = /* @__PURE__ */ z("<ui-icon class=icon>", 1), Ie = /* @__PURE__ */ z("<span class=which>"), Le = /* @__PURE__ */ z("<ui-label class=count size=mini appearance=circular>", 1), Re = /* @__PURE__ */ z("<ui-label class=badge size=mini color=yellow appearance=basic>", 1), ze = /* @__PURE__ */ z("<div class=column-title aria-hidden=true>"), Be, Ve, He, Ue, We, Ge, Ke, qe, Je, Ye, Xe, Ze, Qe, $e, et, tt, nt, rt, it, at, V, H, ot, st, ct, lt, ut, dt, U, W, G = class _UITreeItem extends (V = l, at = [ne], it = [re], rt = [b("open"), y("open")], nt = [T], tt = [T], et = [T], $e = [b("in-columns")], Qe = [b("in-narrow")], Ze = [b("nav"), T], Xe = [b("band")], Ye = [T, b("filtered-out")], Je = [T, b("unmatched")], qe = [T], Ke = [E({ childList: !0 })], Ge = [b("has-items")], We = [g("expanded")], Ue = [g("selected")], He = [g("level")], Ve = [oe], Be = [C("selected", { defer: !0 })], V) {
|
|
301
591
|
constructor() {
|
|
302
|
-
super(...arguments),
|
|
592
|
+
super(...arguments), p(H, 5, this), w(this, ot, p(H, 8, this, !1)), p(H, 11, this), r(this, "disclosure", new t({
|
|
303
593
|
component: this,
|
|
304
594
|
member: "isOpen"
|
|
305
|
-
})),
|
|
595
|
+
})), w(this, st, p(H, 12, this, 0)), p(H, 15, this), w(this, ct, p(H, 16, this, 0)), p(H, 19, this), w(this, lt, p(H, 20, this)), p(H, 23, this), w(this, ut, p(H, 24, this, !1)), p(H, 27, this), w(this, dt, p(H, 28, this, !1)), p(H, 31, this), w(this, U, p(H, 32, this, !1)), p(H, 35, this), w(this, W, p(H, 36, this, !1)), p(H, 39, this), r(this, "onToggleClicked", p(H, 48, this, /* @__PURE__ */ i((e) => {
|
|
306
596
|
this.canOpen && !this.isInColumns && (e.stopPropagation(), this.disclosure.toggle(e));
|
|
307
|
-
}, "onToggleClicked"))),
|
|
597
|
+
}, "onToggleClicked"))), p(H, 51, this);
|
|
308
598
|
}
|
|
309
599
|
get tree() {
|
|
310
600
|
return this.treeElement?.component;
|
|
@@ -322,11 +612,44 @@ var ye = {
|
|
|
322
612
|
"--_ui-tree-column-own-width": e.columnWidthCSS(this.depth + 1)
|
|
323
613
|
};
|
|
324
614
|
}
|
|
615
|
+
get isInNarrowColumn() {
|
|
616
|
+
return this.isInColumns && !!this.tree?.isNarrowColumn(this.depth);
|
|
617
|
+
}
|
|
618
|
+
get hasNarrowRows() {
|
|
619
|
+
return this.isInColumns && !!this.tree?.isNarrowColumn(this.depth + 1);
|
|
620
|
+
}
|
|
621
|
+
get hasPeekingRows() {
|
|
622
|
+
return this.isInColumns && !!this.tree?.isPeekColumn(this.depth + 1);
|
|
623
|
+
}
|
|
624
|
+
get hasCoveredRows() {
|
|
625
|
+
return this.isInColumns && !!this.tree?.isCoveredColumn(this.depth + 1);
|
|
626
|
+
}
|
|
325
627
|
get isBand() {
|
|
326
628
|
return !!this.band;
|
|
327
629
|
}
|
|
630
|
+
get rowCount() {
|
|
631
|
+
return [...this.domElement.children].filter((e) => e.localName === this.domElement.localName).length;
|
|
632
|
+
}
|
|
328
633
|
get hasRows() {
|
|
329
|
-
return
|
|
634
|
+
return this.rowCount > 0;
|
|
635
|
+
}
|
|
636
|
+
shows(e) {
|
|
637
|
+
return !this.isInColumns || !!this.tree?.shows(e);
|
|
638
|
+
}
|
|
639
|
+
get isLoadingRows() {
|
|
640
|
+
return this.isInColumns && this.isOpen && !!this.expandable && !this.hasRows;
|
|
641
|
+
}
|
|
642
|
+
get hasFilteredRows() {
|
|
643
|
+
let { tree: e } = this;
|
|
644
|
+
return this.isInColumns && !!e?.filter && e.filteredRowsParent === this.domElement;
|
|
645
|
+
}
|
|
646
|
+
get showsNoMatches() {
|
|
647
|
+
let { tree: e } = this;
|
|
648
|
+
return this.hasFilteredRows && !!e?.hasNoMatches && !e.hasOtherMatches;
|
|
649
|
+
}
|
|
650
|
+
get showsMatchList() {
|
|
651
|
+
let { tree: e } = this;
|
|
652
|
+
return this.isInColumns && this.showsRows && !!e?.filter && e.filteredColumn === this.depth + 1;
|
|
330
653
|
}
|
|
331
654
|
get canOpen() {
|
|
332
655
|
return this.hasRows || !!this.expandable;
|
|
@@ -356,77 +679,130 @@ var ye = {
|
|
|
356
679
|
render() {
|
|
357
680
|
let e = this;
|
|
358
681
|
return [(() => {
|
|
359
|
-
var t =
|
|
360
|
-
return
|
|
682
|
+
var t = je(), n = t.firstChild, r = n.nextSibling, i = r.firstChild, a = i.firstChild, o = r.nextSibling, s = o.nextSibling, c = s.nextSibling, l = c.firstChild;
|
|
683
|
+
return N(t, A(k, {
|
|
684
|
+
get when() {
|
|
685
|
+
return e.shows("chevron");
|
|
686
|
+
},
|
|
687
|
+
get children() {
|
|
688
|
+
var t = ke();
|
|
689
|
+
return pe(t, "click", e.onToggleClicked, !0), j(() => ({
|
|
690
|
+
e: e.partForName("toggle"),
|
|
691
|
+
t: e.canOpen ? e.translationForKey(e.isOpen ? "close" : "open") : void 0
|
|
692
|
+
}), ({ e, t: n }, r) => {
|
|
693
|
+
e !== r?.e && L(t, "part", e), n !== r?.t && L(t, "title", n);
|
|
694
|
+
}), t;
|
|
695
|
+
}
|
|
696
|
+
}), n), n._$owner = M(), N(n, A(k, {
|
|
361
697
|
get when() {
|
|
362
|
-
return e.icon;
|
|
698
|
+
return F(() => !!e.shows("icon"))() ? e.icon : e.shows("icon");
|
|
363
699
|
},
|
|
364
700
|
children: (e) => (() => {
|
|
365
|
-
var t =
|
|
366
|
-
return t._$owner =
|
|
367
|
-
|
|
701
|
+
var t = Fe();
|
|
702
|
+
return t._$owner = M(), j(() => e(), (e) => {
|
|
703
|
+
L(t, "name", e);
|
|
368
704
|
}), t;
|
|
369
705
|
})()
|
|
370
|
-
})),
|
|
706
|
+
})), i._$owner = M(), N(a, () => e.label), N(i, A(k, {
|
|
371
707
|
get when() {
|
|
372
|
-
return e.which;
|
|
708
|
+
return F(() => !!e.shows("which"))() ? e.which : e.shows("which");
|
|
373
709
|
},
|
|
374
710
|
children: (e) => (() => {
|
|
375
|
-
var t =
|
|
376
|
-
return
|
|
711
|
+
var t = Ie();
|
|
712
|
+
return N(t, e), t;
|
|
377
713
|
})()
|
|
378
|
-
}), null),
|
|
714
|
+
}), null), N(t, A(k, {
|
|
379
715
|
get when() {
|
|
380
716
|
return e.count;
|
|
381
717
|
},
|
|
382
718
|
children: (t) => (() => {
|
|
383
|
-
var n =
|
|
384
|
-
return n._$owner =
|
|
385
|
-
|
|
719
|
+
var n = Le();
|
|
720
|
+
return n._$owner = M(), N(n, t), j(() => e.partForName("count"), (e) => {
|
|
721
|
+
L(n, "part", e);
|
|
386
722
|
}), n;
|
|
387
723
|
})()
|
|
388
|
-
}),
|
|
724
|
+
}), o), N(t, A(k, {
|
|
725
|
+
get when() {
|
|
726
|
+
return F(() => !!(e.isInColumns && !e.count && e.hasRows))() ? e.shows("count") : e.isInColumns && !e.count && e.hasRows;
|
|
727
|
+
},
|
|
728
|
+
get children() {
|
|
729
|
+
var t = Ae();
|
|
730
|
+
return N(t, () => e.rowCount), t;
|
|
731
|
+
}
|
|
732
|
+
}), s), N(t, A(k, {
|
|
389
733
|
get when() {
|
|
390
734
|
return e.badge;
|
|
391
735
|
},
|
|
392
736
|
children: (t) => (() => {
|
|
393
|
-
var n =
|
|
394
|
-
return n._$owner =
|
|
395
|
-
|
|
737
|
+
var n = Re();
|
|
738
|
+
return n._$owner = M(), N(n, t), j(() => e.partForName("badge"), (e) => {
|
|
739
|
+
L(n, "part", e);
|
|
396
740
|
}), n;
|
|
397
741
|
})()
|
|
398
|
-
}), c), l._$owner =
|
|
399
|
-
e:
|
|
742
|
+
}), c), l._$owner = M(), j(() => ({
|
|
743
|
+
e: I(["row", e.band]),
|
|
400
744
|
t: e.partForName("row"),
|
|
401
745
|
a: e.isInColumns ? 0 : e.indent,
|
|
402
|
-
o: e.
|
|
403
|
-
i: e.
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
he(t, e, l?.e), r !== l?.t && C(t, "part", r), a !== l?.a && w(t, "--_ui-tree-depth", a), o !== l?.o && C(n, "part", o), s !== l?.i && C(n, "title", s), c !== l?.n && C(i, "part", c);
|
|
746
|
+
o: e.isInColumns ? e.tree?.peekClipCSS(e.depth) : void 0,
|
|
747
|
+
i: e.partForName("label")
|
|
748
|
+
}), ({ e, t: n, a: i, o: a, i: o }, s) => {
|
|
749
|
+
me(t, e, s?.e), n !== s?.t && L(t, "part", n), i !== s?.a && R(t, "--_ui-tree-depth", i), a !== s?.o && R(t, "clip-path", a), o !== s?.i && L(r, "part", o);
|
|
407
750
|
}), t;
|
|
408
|
-
})(),
|
|
751
|
+
})(), A(k, {
|
|
409
752
|
get when() {
|
|
410
753
|
return e.drawsRows;
|
|
411
754
|
},
|
|
412
755
|
get children() {
|
|
413
|
-
var t =
|
|
414
|
-
return
|
|
756
|
+
var t = Pe(), n = t.firstChild, r = n.firstChild, i = r.nextSibling, a = i.nextSibling, o = a.nextSibling;
|
|
757
|
+
return N(t, A(k, {
|
|
415
758
|
get when() {
|
|
416
759
|
return e.columnTitle;
|
|
417
760
|
},
|
|
418
|
-
children: (
|
|
419
|
-
var
|
|
420
|
-
return
|
|
761
|
+
children: (t) => (() => {
|
|
762
|
+
var n = ze();
|
|
763
|
+
return N(n, t), j(() => ({
|
|
764
|
+
e: e.partForName("column-title"),
|
|
765
|
+
t: e.tree?.peekClipCSS(e.depth + 1)
|
|
766
|
+
}), ({ e, t }, r) => {
|
|
767
|
+
e !== r?.e && L(n, "part", e), t !== r?.t && R(n, "clip-path", t);
|
|
768
|
+
}), n;
|
|
421
769
|
})()
|
|
422
|
-
}), n), r._$owner =
|
|
770
|
+
}), n), r._$owner = M(), N(n, A(k, {
|
|
771
|
+
get when() {
|
|
772
|
+
return e.isLoadingRows;
|
|
773
|
+
},
|
|
774
|
+
get children() {
|
|
775
|
+
var t = Me(), n = t.firstChild;
|
|
776
|
+
return n._$owner = M(), j(() => e.tree?.translationForKey("loading"), (e) => {
|
|
777
|
+
L(n, "aria-label", e);
|
|
778
|
+
}), t;
|
|
779
|
+
}
|
|
780
|
+
}), i), N(n, A(k, {
|
|
781
|
+
get when() {
|
|
782
|
+
return e.showsNoMatches;
|
|
783
|
+
},
|
|
784
|
+
get children() {
|
|
785
|
+
var t = Ne();
|
|
786
|
+
return N(t, () => e.tree?.translationForKey("noMatches")), t;
|
|
787
|
+
}
|
|
788
|
+
}), a), N(n, A(k, {
|
|
789
|
+
get when() {
|
|
790
|
+
return e.showsMatchList;
|
|
791
|
+
},
|
|
792
|
+
get children() {
|
|
793
|
+
return e.tree?.matchList();
|
|
794
|
+
}
|
|
795
|
+
}), o), j(() => ({
|
|
423
796
|
e: !e.showsRows,
|
|
424
|
-
t: e.
|
|
425
|
-
a: e.
|
|
426
|
-
o: e.
|
|
427
|
-
i:
|
|
428
|
-
|
|
429
|
-
|
|
797
|
+
t: !!e.hasNarrowRows,
|
|
798
|
+
a: !!e.hasPeekingRows,
|
|
799
|
+
o: !!e.hasCoveredRows,
|
|
800
|
+
i: e.hasNarrowRows ? `${e.partForName("group")} ${e.partForName("narrow-column")}` : e.partForName("group"),
|
|
801
|
+
n: e.showsRows ? void 0 : "",
|
|
802
|
+
s: e.columnTitle,
|
|
803
|
+
h: I(e.columnPlace)
|
|
804
|
+
}), ({ e, t: n, a: r, o: i, i: a, n: o, s, h: c }, l) => {
|
|
805
|
+
e !== l?.e && t.classList.toggle("shut", e), n !== l?.t && t.classList.toggle("narrow", n), r !== l?.a && t.classList.toggle("peek", r), i !== l?.o && t.classList.toggle("covered", i), a !== l?.i && L(t, "part", a), o !== l?.n && L(t, "inert", o), s !== l?.s && L(t, "aria-label", s), _e(t, c, l?.h);
|
|
430
806
|
}), t;
|
|
431
807
|
}
|
|
432
808
|
})];
|
|
@@ -434,48 +810,58 @@ var ye = {
|
|
|
434
810
|
onConnect() {
|
|
435
811
|
super.onConnect();
|
|
436
812
|
let e = 0, t = 0, n = this.domElement.parentElement;
|
|
437
|
-
for (; n && n.localName === this.domElement.localName; n = n.parentElement) e++, n.hasAttribute(
|
|
438
|
-
this.depth = e, this.indent = t, this.isInNav = n?.getAttribute("appearance") ===
|
|
813
|
+
for (; n && n.localName === this.domElement.localName; n = n.parentElement) e++, n.hasAttribute(pt) || t++;
|
|
814
|
+
this.depth = e, this.indent = t, this.isInNav = n?.getAttribute("appearance") === ft, this.treeElement = n || void 0, h(() => this.tree?.rowConnected());
|
|
439
815
|
}
|
|
440
816
|
onSelectedChanged(e) {
|
|
441
|
-
e &&
|
|
817
|
+
e && ie(this.domElement);
|
|
442
818
|
}
|
|
443
819
|
};
|
|
444
|
-
|
|
820
|
+
H = n(V), ot = /* @__PURE__ */ new WeakMap(), st = /* @__PURE__ */ new WeakMap(), ct = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap(), ut = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), u(H, 4, "isOpen", rt, G, ot), u(H, 4, "depth", nt, G, st), u(H, 4, "indent", tt, G, ct), u(H, 4, "treeElement", et, G, lt), u(H, 2, "isInColumns", $e, G), u(H, 2, "isInNarrowColumn", Qe, G), u(H, 4, "isInNav", Ze, G, ut), u(H, 2, "isBand", Xe, G), u(H, 4, "isFilteredOut", Ye, G, dt), u(H, 4, "isUnmatched", Je, G, U), u(H, 4, "isKeptOpen", qe, G, W), u(H, 2, "rowCount", Ke, G), u(H, 2, "canOpen", Ge, G), u(H, 2, "ariaOpen", We, G), u(H, 2, "ariaIsSelected", Ue, G), u(H, 2, "ariaDepth", He, G), u(H, 1, "onSelectedChanged", Be, G), u(H, 13, "vocabulary", at, G), u(H, 13, "elementSetup", it, G), u(H, 5, "onToggleClicked", Ve, G), f(H, G), i(G, "UITreeItem"), r(G, "vocabulary", p(H, 40, G, Ee)), p(H, 43, G), r(G, "elementSetup", p(H, 44, G, {
|
|
445
821
|
styleSheets: {
|
|
446
|
-
tree:
|
|
447
|
-
columns:
|
|
822
|
+
tree: De,
|
|
823
|
+
columns: Oe
|
|
448
824
|
},
|
|
449
825
|
delegatesFocus: !1,
|
|
450
826
|
aria: { role: "treeitem" },
|
|
451
827
|
cssStates: ["selected"]
|
|
452
|
-
})),
|
|
453
|
-
var
|
|
454
|
-
|
|
828
|
+
})), p(H, 47, G);
|
|
829
|
+
var K = G, ft = "nav", pt = "band";
|
|
830
|
+
he(["click"]);
|
|
455
831
|
// src/components/ui-tree/UITree.tsx
|
|
456
|
-
var
|
|
832
|
+
var mt = /* @__PURE__ */ z("<slot>"), ht = /* @__PURE__ */ z("<div class=empty><slot name=empty>"), gt = /* @__PURE__ */ z("<span class=\"path-row folded\">"), _t = /* @__PURE__ */ z("<div class=path aria-hidden=true><!><!>"), vt = /* @__PURE__ */ z("<span class=separator>›"), yt = /* @__PURE__ */ z("<span class=path-row>"), bt = /* @__PURE__ */ z("<div class=columns><!><div class=column-filler aria-hidden=true></div><div class=column-probe aria-hidden=true></div><div class=narrow-probe aria-hidden=true>"), xt = /* @__PURE__ */ z("<div class=column><slot></slot><!><!>"), St = /* @__PURE__ */ z("<div class=column-title aria-hidden=true>"), Ct = /* @__PURE__ */ z("<div class=tool-buttons><ui-button size=mini appearance=basic>", 1), wt = /* @__PURE__ */ z("<div class=tools><!><!>"), Tt = /* @__PURE__ */ z("<ui-button size=mini appearance=basic>", 1), Et = /* @__PURE__ */ z("<div class=column-edge role=separator tabindex=0 aria-orientation=vertical>"), Dt = /* @__PURE__ */ z("<div class=\"column-title detail-title\"aria-hidden=true>"), Ot = /* @__PURE__ */ z("<div class=detail><div class=detail-body><slot></slot></div><div class=\"column-edge detail-edge\"role=separator tabindex=0 aria-orientation=vertical>"), kt = /* @__PURE__ */ z("<div class=matches-loading role=status><ui-loader visible size=mini inline aria-hidden=true>", 1), At = /* @__PURE__ */ z("<div class=matches-note>"), jt = /* @__PURE__ */ z("<div class=matches role=group><div class=matches-title aria-hidden=true></div><!><!><!><!>"), Mt = /* @__PURE__ */ z("<span class=match-path>"), Nt = /* @__PURE__ */ z("<div class=match role=treeitem aria-selected=false tabindex=-1><span class=match-words><span class=words></span></span><!>"), q = /* @__PURE__ */ z("<span class=icon><ui-icon>", 1), Pt = /* @__PURE__ */ z("<span class=which>"), Ft = /* @__PURE__ */ z("<li class=loading role=none><ui-loader visible size=small>", 1), It = /* @__PURE__ */ z("<li class=empty role=none><slot name=empty>"), Lt = /* @__PURE__ */ z("<li class=matches-box role=none>"), Rt = /* @__PURE__ */ z("<ul class=\"column items\"role=group><!><!><!><!><!><!>"), zt = /* @__PURE__ */ z("<li class=column-title role=none aria-hidden=true>"), Bt = /* @__PURE__ */ z("<li class=track-probe role=none aria-hidden=true>"), Vt = /* @__PURE__ */ z("<span class=count>"), Ht = /* @__PURE__ */ z("<span class=chevron>"), Ut = /* @__PURE__ */ z("<span class=chevron aria-hidden=true>"), Wt = /* @__PURE__ */ z("<li role=treeitem><span class=label><span class=words></span></span><!><!>"), Gt, Kt, qt, Jt, Yt, Xt, Zt, Qt, $t, en, tn, nn, rn, an, on, sn, cn, ln, un, dn, fn, pn, mn, hn, gn, _n, vn, yn, bn, xn, Sn, Cn, wn, Tn, En, Dn, On, kn, An, jn, Mn, Nn, Pn, Fn, In, Ln, Rn, zn, Bn, Vn, Hn, Un, Wn, Gn, Kn, qn, Jn, Yn, Xn, J, Y, Zn, Qn, $n, er, tr, nr, rr, ir, ar, or, sr, cr, lr, ur, dr, fr, pr, mr, hr, gr, _r, vr, yr, br, xr, X, Sr, Cr, DOMTreeElement = class extends e {
|
|
833
|
+
static {
|
|
834
|
+
i(this, "DOMTreeElement");
|
|
835
|
+
}
|
|
836
|
+
openTo(e) {
|
|
837
|
+
return this.component?.openTo(e) ?? Promise.resolve();
|
|
838
|
+
}
|
|
839
|
+
closeAll() {
|
|
840
|
+
this.component?.closeAll();
|
|
841
|
+
}
|
|
842
|
+
}, Z = class _UITree extends (J = l, Xn = [ne], Yn = [re], Jn = [T, b("no-matches")], qn = [b("filtering")], Kn = [g("multiSelectable")], Gn = [g("label")], Wn = [b("columns")], Un = [T], Hn = [T], Vn = [C("isConnected", "stickyPath")], Bn = [C("pathKey", "treeWidthPx")], zn = [S("click")], Rn = [y("path")], Ln = [C("openPath", "isReady", "rowsVersion")], In = [T], Fn = [E({ childList: !0 })], Pn = [C("canRove")], Nn = [S("keydown")], Mn = [ee({ equals: x })], jn = [T({ equals: x })], An = [T], kn = [T({ equals: x })], On = [T], Dn = [T], En = [T], Tn = [T, b("resizing")], wn = [C("isConnected", "isColumns")], Cn = [C("fitKey")], Sn = [T({ equals: x })], xn = [C("textTrackSources")], bn = [E({ childList: !0 })], yn = [T], vn = [T], _n = [C("detailElement", "pickedItem")], gn = [C("hasDetail", "detailWidthPx", "boxWidthPx", { defer: !0 })], hn = [T], mn = [T], pn = [T], fn = [T], dn = [C("isConnected", "isColumns", "isReady")], un = [S("pointerover", { target: "renderRoot" })], ln = [S("pointerleave")], cn = [S("focusin", { target: "renderRoot" })], sn = [S("focusout", { target: "renderRoot" })], on = [C("narrowColumns", { defer: !0 })], an = [T({ equals: x })], rn = [C("isConnected", "stickyPath", "isColumns")], nn = [C("filter", "isReady", "items")], tn = [T], en = [T], $t = [C("filterBase", { defer: !0 })], Qt = [E({
|
|
457
843
|
childList: !0,
|
|
458
844
|
subtree: !0,
|
|
459
845
|
attributes: !0,
|
|
460
846
|
attributeFilter: ["label", "which"]
|
|
461
|
-
})],
|
|
847
|
+
})], Zt = [T({ equals: x })], Xt = [T], Yt = [T], Jt = [T], qt = [T], Kt = [T], Gt = [C("openPath", "isReady", { defer: !0 })], J) {
|
|
462
848
|
constructor() {
|
|
463
|
-
super(...arguments),
|
|
849
|
+
super(...arguments), p(Y, 5, this), r(this, "selection", new a()), r(this, "roving"), w(this, Zn, p(Y, 8, this, !1)), p(Y, 11, this), w(this, Qn, p(Y, 12, this, 0)), p(Y, 15, this), w(this, $n, p(Y, 16, this, 0)), p(Y, 19, this), r(this, "settleTimer"), w(this, er, p(Y, 20, this, [])), p(Y, 23, this), w(this, tr, p(Y, 24, this, 0)), p(Y, 27, this), r(this, "opens", 0), r(this, "openWaits", /* @__PURE__ */ new Set()), w(this, nr, p(Y, 28, this, [])), p(Y, 31, this), w(this, rr, p(Y, 32, this)), p(Y, 35, this), w(this, ir, p(Y, 36, this, [])), p(Y, 39, this), w(this, ar, p(Y, 40, this, 0)), p(Y, 43, this), w(this, or, p(Y, 44, this, Vr)), p(Y, 47, this), w(this, sr, p(Y, 48, this, Vr)), p(Y, 51, this), w(this, cr, p(Y, 52, this, !1)), p(Y, 55, this), w(this, lr, p(Y, 56, this, [])), p(Y, 59, this), r(this, "measuredTracks", /* @__PURE__ */ new WeakMap()), w(this, ur, p(Y, 60, this)), p(Y, 63, this), w(this, dr, p(Y, 64, this, 0)), p(Y, 67, this), r(this, "detailObserver"), w(this, fr, p(Y, 68, this, 0)), p(Y, 71, this), w(this, pr, p(Y, 72, this, 0)), p(Y, 75, this), w(this, mr, p(Y, 76, this)), p(Y, 79, this), w(this, hr, p(Y, 80, this)), p(Y, 83, this), r(this, "lastNarrowColumns", []), w(this, gr, p(Y, 84, this, [])), p(Y, 87, this), r(this, "cancelPathRead"), w(this, _r, p(Y, 88, this, !1)), p(Y, 91, this), w(this, vr, p(Y, 92, this, 0)), p(Y, 95, this), w(this, yr, p(Y, 96, this, [])), p(Y, 99, this), w(this, br, p(Y, 100, this, 0)), p(Y, 103, this), w(this, xr, p(Y, 104, this, !1)), p(Y, 107, this), w(this, X, p(Y, 108, this, !1)), p(Y, 111, this), r(this, "looks", 0), r(this, "childrenOfItem", /* @__PURE__ */ new WeakMap()), w(this, Sr, p(Y, 112, this, 0)), p(Y, 115, this), w(this, Cr, p(Y, 116, this)), p(Y, 119, this);
|
|
464
850
|
}
|
|
465
851
|
get isFiltering() {
|
|
466
852
|
return !!this.filter;
|
|
467
853
|
}
|
|
468
854
|
get ariaIsMany() {
|
|
469
|
-
return this.choose ===
|
|
855
|
+
return this.choose === jr ? "true" : void 0;
|
|
470
856
|
}
|
|
471
857
|
get ariaName() {
|
|
472
858
|
return this.label;
|
|
473
859
|
}
|
|
474
860
|
get isColumns() {
|
|
475
|
-
return this.appearance ===
|
|
861
|
+
return this.appearance === Nr;
|
|
476
862
|
}
|
|
477
863
|
get columnTitleList() {
|
|
478
|
-
return
|
|
864
|
+
return v(this.columnTitles);
|
|
479
865
|
}
|
|
480
866
|
titleForColumn(e) {
|
|
481
867
|
let t = this.columnTitleList;
|
|
@@ -483,7 +869,14 @@ var He = /* @__PURE__ */ T("<div class=path aria-hidden=true>"), Ue = /* @__PURE
|
|
|
483
869
|
}
|
|
484
870
|
render() {
|
|
485
871
|
let e = this;
|
|
486
|
-
return
|
|
872
|
+
return [A(k, {
|
|
873
|
+
get when() {
|
|
874
|
+
return e.tools || e.toolsElement;
|
|
875
|
+
},
|
|
876
|
+
get children() {
|
|
877
|
+
return e.toolbar();
|
|
878
|
+
}
|
|
879
|
+
}), A(k, {
|
|
487
880
|
get when() {
|
|
488
881
|
return !e.isColumns;
|
|
489
882
|
},
|
|
@@ -493,139 +886,241 @@ var He = /* @__PURE__ */ T("<div class=path aria-hidden=true>"), Ue = /* @__PURE
|
|
|
493
886
|
get children() {
|
|
494
887
|
return e.renderRows();
|
|
495
888
|
}
|
|
496
|
-
});
|
|
889
|
+
})];
|
|
497
890
|
}
|
|
498
891
|
renderRows() {
|
|
499
892
|
let e = this;
|
|
500
893
|
return [
|
|
501
|
-
|
|
894
|
+
F(() => e.renderPath(() => e.pathRows, (t) => e.scrollToRow(t))),
|
|
895
|
+
(() => {
|
|
896
|
+
var e = mt();
|
|
897
|
+
return e._$owner = M(), e;
|
|
898
|
+
})(),
|
|
899
|
+
A(k, {
|
|
502
900
|
get when() {
|
|
503
|
-
return e.
|
|
901
|
+
return e.hasNoMatches;
|
|
504
902
|
},
|
|
505
903
|
get children() {
|
|
506
|
-
var t =
|
|
507
|
-
return
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
904
|
+
var t = ht(), n = t.firstChild;
|
|
905
|
+
return n._$owner = M(), N(n, () => e.translationForKey("noMatches")), j(() => e.partForName("empty"), (e) => {
|
|
906
|
+
L(t, "part", e);
|
|
907
|
+
}), t;
|
|
908
|
+
}
|
|
909
|
+
})
|
|
910
|
+
];
|
|
911
|
+
}
|
|
912
|
+
renderPath(e, t, n = () => e().length - 1) {
|
|
913
|
+
let r = /* @__PURE__ */ i(() => Math.max(0, Math.min(this.pathFolded, n(), e().length - 1)), "folded"), a = this;
|
|
914
|
+
return A(k, {
|
|
915
|
+
get when() {
|
|
916
|
+
return e().length;
|
|
917
|
+
},
|
|
918
|
+
get children() {
|
|
919
|
+
var o = _t(), s = o.firstChild, c = s.nextSibling;
|
|
920
|
+
return N(o, A(k, {
|
|
921
|
+
get when() {
|
|
922
|
+
return r();
|
|
923
|
+
},
|
|
924
|
+
get children() {
|
|
925
|
+
var n = gt();
|
|
926
|
+
return n._$$click = (n) => t(e()[r() - 1], r() - 1, n), N(n, Tr), j(() => ({
|
|
927
|
+
e: a.partForName("path-row"),
|
|
928
|
+
t: e().slice(0, r()).map((e) => e.label).join(Er)
|
|
929
|
+
}), ({ e, t }, r) => {
|
|
930
|
+
e !== r?.e && L(n, "part", e), t !== r?.t && L(n, "title", t);
|
|
931
|
+
}), n;
|
|
932
|
+
}
|
|
933
|
+
}), s), N(o, A(O, {
|
|
934
|
+
get each() {
|
|
935
|
+
return e().slice(r());
|
|
936
|
+
},
|
|
937
|
+
children: (o, s) => {
|
|
938
|
+
let c = /* @__PURE__ */ i(() => s() + r(), "index");
|
|
939
|
+
return [A(k, {
|
|
512
940
|
get when() {
|
|
513
|
-
return
|
|
941
|
+
return c();
|
|
514
942
|
},
|
|
515
943
|
get children() {
|
|
516
|
-
return
|
|
944
|
+
return vt();
|
|
517
945
|
}
|
|
518
946
|
}), (() => {
|
|
519
|
-
var r =
|
|
520
|
-
return r._$$click = () =>
|
|
521
|
-
e:
|
|
522
|
-
t:
|
|
523
|
-
|
|
524
|
-
|
|
947
|
+
var r = yt();
|
|
948
|
+
return r._$$click = (e) => t(o, c(), e), N(r, () => o.label), j(() => ({
|
|
949
|
+
e: c() === n(),
|
|
950
|
+
t: a.partForName("path-row"),
|
|
951
|
+
a: o.label,
|
|
952
|
+
o: c() === n() ? 0 : 100 ** (e().length - 1 - c())
|
|
953
|
+
}), ({ e, t, a: n, o: i }, a) => {
|
|
954
|
+
e !== a?.e && r.classList.toggle("current", e), t !== a?.t && L(r, "part", t), n !== a?.a && L(r, "title", n), i !== a?.o && R(r, "flex-shrink", i);
|
|
525
955
|
}), r;
|
|
526
|
-
})()]
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
|
|
956
|
+
})()];
|
|
957
|
+
}
|
|
958
|
+
}), c), j(() => a.partForName("path"), (e) => {
|
|
959
|
+
L(o, "part", e);
|
|
960
|
+
}), o;
|
|
961
|
+
}
|
|
962
|
+
});
|
|
963
|
+
}
|
|
964
|
+
get pathKey() {
|
|
965
|
+
if (!this.stickyPath) return "";
|
|
966
|
+
let e = this.isColumns ? this.columnPicks : this.pathRows;
|
|
967
|
+
if (!e.length) return "";
|
|
968
|
+
let t = this.isColumns ? this.selectedColumn : e.length - 1;
|
|
969
|
+
return JSON.stringify([e.map((e) => e.label ?? ""), t]);
|
|
970
|
+
}
|
|
971
|
+
watchTreeWidth(e, t) {
|
|
972
|
+
if (!e || !t || P) return;
|
|
973
|
+
let n = new ResizeObserver(([e]) => {
|
|
974
|
+
e && (this.treeWidthPx = Math.round(e.contentRect.width));
|
|
975
|
+
});
|
|
976
|
+
return n.observe(this.domElement), () => n.disconnect();
|
|
977
|
+
}
|
|
978
|
+
onPathLineChanged(e) {
|
|
979
|
+
if (!e || P) this.pathFolded = 0;
|
|
980
|
+
else return _(() => this.measurePathFold(e));
|
|
981
|
+
}
|
|
982
|
+
measurePathFold(e) {
|
|
983
|
+
let t = this.domElement.renderRoot.querySelector(".path");
|
|
984
|
+
if (!t) return;
|
|
985
|
+
let [n, r] = JSON.parse(e), a = t.querySelector(".path-row:not(.current)") ?? t, o = t.querySelector(".path-row.current") ?? a, s = D.fontOf(a), c = D.fontOf(o), l = /* @__PURE__ */ i((e, t) => D.widthOf(e, t) ?? 0, "widthOf"), u = getComputedStyle(t), d = parseFloat(u.fontSize) || Vr, f = t.clientWidth - (parseFloat(u.paddingInlineStart) || 0) - (parseFloat(u.paddingInlineEnd) || 0);
|
|
986
|
+
this.pathFolded = foldedNamesFor(n.map((e, t) => l(e, t === r ? c : s)), {
|
|
987
|
+
current: r,
|
|
988
|
+
room: f,
|
|
989
|
+
separator: l("›", s) + 2 * (parseFloat(u.columnGap) || 0),
|
|
990
|
+
folded: l(Tr, s),
|
|
991
|
+
least: Dr * d,
|
|
992
|
+
fewest: Or * d
|
|
993
|
+
});
|
|
994
|
+
}
|
|
995
|
+
renderColumns() {
|
|
996
|
+
let e = this;
|
|
997
|
+
return [F(() => e.renderPath(() => e.columnPicks, (t, n, r) => e.pickFromPath(n, r), () => e.selectedColumn)), (() => {
|
|
998
|
+
var t = bt(), n = t.firstChild, r = n.nextSibling, i = r.nextSibling;
|
|
999
|
+
return N(t, A(k, {
|
|
1000
|
+
get when() {
|
|
1001
|
+
return e.hasItemData;
|
|
1002
|
+
},
|
|
1003
|
+
get fallback() {
|
|
1004
|
+
return e.firstColumn();
|
|
1005
|
+
},
|
|
1006
|
+
get children() {
|
|
1007
|
+
return e.itemColumns();
|
|
530
1008
|
}
|
|
531
|
-
}),
|
|
532
|
-
(() => {
|
|
533
|
-
var e = Ue();
|
|
534
|
-
return e._$owner = b(), e;
|
|
535
|
-
})(),
|
|
536
|
-
v(_, {
|
|
1009
|
+
}), n), N(t, A(k, {
|
|
537
1010
|
get when() {
|
|
538
|
-
return e.
|
|
1011
|
+
return e.hasDetail;
|
|
539
1012
|
},
|
|
540
1013
|
get children() {
|
|
541
|
-
|
|
542
|
-
return n._$owner = b(), x(n, () => e.translationForKey("noMatches")), y(() => e.partForName("empty"), (e) => {
|
|
543
|
-
C(t, "part", e);
|
|
544
|
-
}), t;
|
|
1014
|
+
return e.detailPane();
|
|
545
1015
|
}
|
|
546
|
-
})
|
|
547
|
-
|
|
1016
|
+
}), r), N(t, A(O, {
|
|
1017
|
+
get each() {
|
|
1018
|
+
return e.columnIndexes;
|
|
1019
|
+
},
|
|
1020
|
+
children: (t) => e.columnEdge(t)
|
|
1021
|
+
}), i), j(() => e.columnTitleList.length > 0, (e) => {
|
|
1022
|
+
r.classList.toggle("titled", e);
|
|
1023
|
+
}), t;
|
|
1024
|
+
})()];
|
|
548
1025
|
}
|
|
549
|
-
|
|
1026
|
+
firstColumn() {
|
|
550
1027
|
let e = this;
|
|
551
|
-
var t =
|
|
552
|
-
return
|
|
1028
|
+
var t = xt(), n = t.firstChild, r = n.nextSibling, i = r.nextSibling;
|
|
1029
|
+
return N(t, A(k, {
|
|
553
1030
|
get when() {
|
|
554
1031
|
return e.titleForColumn(0);
|
|
555
1032
|
},
|
|
556
|
-
children: (
|
|
557
|
-
var
|
|
558
|
-
return
|
|
1033
|
+
children: (t) => (() => {
|
|
1034
|
+
var n = St();
|
|
1035
|
+
return N(n, t), j(() => e.partForName("column-title"), (e) => {
|
|
1036
|
+
L(n, "part", e);
|
|
1037
|
+
}), n;
|
|
559
1038
|
})()
|
|
560
|
-
}),
|
|
1039
|
+
}), n), n._$owner = M(), N(t, A(k, {
|
|
561
1040
|
get when() {
|
|
562
|
-
return e.hasNoMatches;
|
|
1041
|
+
return F(() => !(!e.hasNoMatches || e.hasOtherMatches))() ? e.filteredRowsParent === e.domElement : e.hasNoMatches && !e.hasOtherMatches;
|
|
563
1042
|
},
|
|
564
1043
|
get children() {
|
|
565
|
-
var t =
|
|
566
|
-
return n._$owner =
|
|
567
|
-
|
|
1044
|
+
var t = ht(), n = t.firstChild;
|
|
1045
|
+
return n._$owner = M(), N(n, () => e.translationForKey("noMatches")), j(() => e.partForName("empty"), (e) => {
|
|
1046
|
+
L(t, "part", e);
|
|
568
1047
|
}), t;
|
|
569
1048
|
}
|
|
570
|
-
}),
|
|
571
|
-
get
|
|
572
|
-
return e.
|
|
1049
|
+
}), r), N(t, A(k, {
|
|
1050
|
+
get when() {
|
|
1051
|
+
return F(() => !!e.filter)() && e.filteredColumn === 0;
|
|
573
1052
|
},
|
|
574
|
-
children
|
|
575
|
-
|
|
576
|
-
|
|
1053
|
+
get children() {
|
|
1054
|
+
return e.matchList();
|
|
1055
|
+
}
|
|
1056
|
+
}), i), j(() => ({
|
|
1057
|
+
e: !!e.isNarrowColumn(0),
|
|
1058
|
+
t: !!e.isPeekColumn(0),
|
|
1059
|
+
a: e.isNarrowColumn(0) ? e.partForName("narrow-column") : void 0,
|
|
1060
|
+
o: e.columnWidthCSS(0),
|
|
1061
|
+
i: e.peekMarginCSS(0)
|
|
1062
|
+
}), ({ e, t: n, a: r, o: i, i: a }, o) => {
|
|
1063
|
+
e !== o?.e && t.classList.toggle("narrow", e), n !== o?.t && t.classList.toggle("peek", n), r !== o?.a && L(t, "part", r), i !== o?.o && R(t, "width", i), a !== o?.i && R(t, "margin-inline-end", a);
|
|
577
1064
|
}), t;
|
|
578
1065
|
}
|
|
579
1066
|
rowsIn(e) {
|
|
580
1067
|
let t = [];
|
|
581
1068
|
for (let n of e.children) {
|
|
582
1069
|
let { component: e } = n;
|
|
583
|
-
e instanceof
|
|
1070
|
+
e instanceof K && t.push(e);
|
|
584
1071
|
}
|
|
585
1072
|
return t;
|
|
586
1073
|
}
|
|
587
1074
|
get rowsOnScreen() {
|
|
588
|
-
let e = /* @__PURE__ */
|
|
1075
|
+
let e = /* @__PURE__ */ i((t) => this.rowsIn(t).flatMap((t) => t.isFilteredOut ? [] : [t, ...t.showsRows ? e(t.domElement) : []]), "walk");
|
|
589
1076
|
return e(this.domElement);
|
|
590
1077
|
}
|
|
591
1078
|
get allRows() {
|
|
592
|
-
let e = /* @__PURE__ */
|
|
1079
|
+
let e = /* @__PURE__ */ i((t) => this.rowsIn(t).flatMap((t) => [t, ...e(t.domElement)]), "walk");
|
|
593
1080
|
return e(this.domElement);
|
|
594
1081
|
}
|
|
595
1082
|
rowOf(e) {
|
|
596
1083
|
for (let t of e.composedPath()) {
|
|
597
1084
|
if (t === this.domElement) return;
|
|
598
1085
|
let { component: e } = t;
|
|
599
|
-
if (e instanceof
|
|
1086
|
+
if (e instanceof K) return e;
|
|
600
1087
|
}
|
|
601
1088
|
}
|
|
602
1089
|
onClicked(e) {
|
|
603
1090
|
let t = this.rowOf(e);
|
|
604
|
-
t
|
|
1091
|
+
!t || o.isClicked(e, { upTo: t.domElement }) || isMatchClick(e) || (this.roving?.focus(this.roving.items.indexOf(t.domElement)), this.activate(t, e));
|
|
605
1092
|
}
|
|
606
1093
|
activate(e, t, { keepsInside: n = !1 } = {}) {
|
|
607
1094
|
if (e.group) {
|
|
608
1095
|
this.isColumns ? this.openColumnOf(e, t, n) : e.disclosure.toggle(t);
|
|
609
1096
|
return;
|
|
610
1097
|
}
|
|
611
|
-
let r = e.valueOrLabel;
|
|
1098
|
+
let r = e.valueOrLabel, i = this.isColumns ? [...this.rowsAround(e), e].map((e) => e.valueOrLabel) : void 0;
|
|
612
1099
|
if (!this.send("ui-selecting", {
|
|
613
1100
|
item: e.domElement,
|
|
614
1101
|
value: r,
|
|
1102
|
+
path: i,
|
|
615
1103
|
originalEvent: t
|
|
616
1104
|
})) return;
|
|
617
1105
|
this.isColumns && this.openColumnOf(e, t, n);
|
|
618
|
-
let
|
|
619
|
-
items:
|
|
620
|
-
selected:
|
|
1106
|
+
let a = this.rowsOnScreen.filter((e) => !e.group), o = this.allRows.filter((e) => e.selected), s = new Set(this.choose === jr ? this.selection.clicked(e, {
|
|
1107
|
+
items: a,
|
|
1108
|
+
selected: o,
|
|
621
1109
|
keys: t
|
|
622
1110
|
}) : [e]);
|
|
623
|
-
for (let e of this.allRows) !!e.selected !==
|
|
624
|
-
let
|
|
625
|
-
this.send("ui-changed", {
|
|
1111
|
+
for (let e of this.allRows) !!e.selected !== s.has(e) && (e.selected = s.has(e));
|
|
1112
|
+
let c = {
|
|
626
1113
|
value: r,
|
|
627
|
-
values: s,
|
|
1114
|
+
values: this.allRows.filter((e) => s.has(e)).map((e) => e.valueOrLabel),
|
|
1115
|
+
item: e.domElement,
|
|
1116
|
+
path: i,
|
|
628
1117
|
originalEvent: t
|
|
1118
|
+
};
|
|
1119
|
+
this.send("ui-changed", c), this.settleSoon(c);
|
|
1120
|
+
}
|
|
1121
|
+
settleSoon(e) {
|
|
1122
|
+
this.settleTimer?.cancel(), this.settleTimer = m(Mr, () => {
|
|
1123
|
+
this.settleTimer = void 0, this.send("ui-settled", e);
|
|
629
1124
|
});
|
|
630
1125
|
}
|
|
631
1126
|
openColumnOf(e, t, n = !1) {
|
|
@@ -635,7 +1130,22 @@ var He = /* @__PURE__ */ T("<div class=path aria-hidden=true>"), Ue = /* @__PURE
|
|
|
635
1130
|
let a = r.has(i) || n && e.domElement.contains(i.domElement);
|
|
636
1131
|
i.isOpen && !a && i.disclosure.close(t);
|
|
637
1132
|
}
|
|
638
|
-
e.disclosure.open(t), n || this.showNewestColumn();
|
|
1133
|
+
e.disclosure.open(t), n || this.showNewestColumn(), this.openPath = this.openChain.map((e) => e.valueOrLabel), this.keepPath(), this.filter && this.applyFilter();
|
|
1134
|
+
}
|
|
1135
|
+
onPathChanged(e) {
|
|
1136
|
+
if (!this.isColumns || this.hasItemData || !this.isReady || !this.isControlledByPage("openPath") || x(e, this.openChain.map((e) => e.valueOrLabel))) return;
|
|
1137
|
+
let t = [];
|
|
1138
|
+
for (let n of e) {
|
|
1139
|
+
let e = this.rowsIn(t.at(-1)?.domElement ?? this.domElement).find((e) => e.valueOrLabel === n);
|
|
1140
|
+
if (!e) break;
|
|
1141
|
+
t.push(e);
|
|
1142
|
+
}
|
|
1143
|
+
let n = t.at(-1);
|
|
1144
|
+
if (n) {
|
|
1145
|
+
for (let e of this.allRows) e.isOpen && !t.includes(e) && e.disclosure.close(), !!e.selected != (e === n) && (e.selected = e === n);
|
|
1146
|
+
for (let e of t) e.disclosure.open();
|
|
1147
|
+
this.showNewestColumn();
|
|
1148
|
+
}
|
|
639
1149
|
}
|
|
640
1150
|
get openChain() {
|
|
641
1151
|
this.rowsVersion;
|
|
@@ -648,7 +1158,7 @@ var He = /* @__PURE__ */ T("<div class=path aria-hidden=true>"), Ue = /* @__PURE
|
|
|
648
1158
|
}
|
|
649
1159
|
get columnIndexes() {
|
|
650
1160
|
if (!this.isColumns) return [];
|
|
651
|
-
let e = 1 + this.openChain.filter((e) => e.canOpen).length;
|
|
1161
|
+
let e = this.hasItemData ? this.columnLists.length : 1 + this.openChain.filter((e) => e.canOpen).length;
|
|
652
1162
|
return Array.from({ length: e }, (e, t) => t);
|
|
653
1163
|
}
|
|
654
1164
|
rowConnected() {
|
|
@@ -658,7 +1168,7 @@ var He = /* @__PURE__ */ T("<div class=path aria-hidden=true>"), Ue = /* @__PURE
|
|
|
658
1168
|
let t = [];
|
|
659
1169
|
for (let n = e.domElement.parentElement; n && n !== this.domElement; n = n.parentElement) {
|
|
660
1170
|
let { component: e } = n;
|
|
661
|
-
e instanceof
|
|
1171
|
+
e instanceof K && t.unshift(e);
|
|
662
1172
|
}
|
|
663
1173
|
return t;
|
|
664
1174
|
}
|
|
@@ -667,7 +1177,7 @@ var He = /* @__PURE__ */ T("<div class=path aria-hidden=true>"), Ue = /* @__PURE
|
|
|
667
1177
|
return t ? this.rowsIn(t).filter((e) => !e.isFilteredOut) : [e];
|
|
668
1178
|
}
|
|
669
1179
|
showNewestColumn() {
|
|
670
|
-
|
|
1180
|
+
P || _(() => {
|
|
671
1181
|
let e = this.domElement.renderRoot.querySelector(".columns");
|
|
672
1182
|
if (!e) return;
|
|
673
1183
|
let t = getComputedStyle(e).direction === "rtl", n = matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
@@ -677,13 +1187,119 @@ var He = /* @__PURE__ */ T("<div class=path aria-hidden=true>"), Ue = /* @__PURE
|
|
|
677
1187
|
});
|
|
678
1188
|
});
|
|
679
1189
|
}
|
|
1190
|
+
toolbar() {
|
|
1191
|
+
let e = this;
|
|
1192
|
+
var t = wt(), n = t.firstChild, r = n.nextSibling;
|
|
1193
|
+
return N(t, A(k, {
|
|
1194
|
+
get when() {
|
|
1195
|
+
return e.tools;
|
|
1196
|
+
},
|
|
1197
|
+
get children() {
|
|
1198
|
+
var t = Ct(), n = t.firstChild;
|
|
1199
|
+
return N(t, A(O, {
|
|
1200
|
+
each: kr,
|
|
1201
|
+
children: (t) => (() => {
|
|
1202
|
+
var n = Tt();
|
|
1203
|
+
return n._$$click = (n) => e.startOpening(t, n), n._$owner = M(), N(n, () => e.translationForKey("openLevels", { levels: t })), j(() => e.partForName("tool"), (e) => {
|
|
1204
|
+
L(n, "part", e);
|
|
1205
|
+
}), n;
|
|
1206
|
+
})()
|
|
1207
|
+
}), n), n._$$click = (t) => e.closeAll(t), n._$owner = M(), N(n, () => e.translationForKey("closeAll")), j(() => e.partForName("tool"), (e) => {
|
|
1208
|
+
L(n, "part", e);
|
|
1209
|
+
}), t;
|
|
1210
|
+
}
|
|
1211
|
+
}), n), N(t, A(k, {
|
|
1212
|
+
get when() {
|
|
1213
|
+
return e.toolsElement;
|
|
1214
|
+
},
|
|
1215
|
+
get children() {
|
|
1216
|
+
var t = mt();
|
|
1217
|
+
return t._$owner = M(), j(() => e.slotForName("tools"), (e) => {
|
|
1218
|
+
L(t, "name", e);
|
|
1219
|
+
}), t;
|
|
1220
|
+
}
|
|
1221
|
+
}), r), j(() => e.partForName("tools"), (e) => {
|
|
1222
|
+
L(t, "part", e);
|
|
1223
|
+
}), t;
|
|
1224
|
+
}
|
|
1225
|
+
get toolsElement() {
|
|
1226
|
+
return this.childInSlot("tools");
|
|
1227
|
+
}
|
|
1228
|
+
childInSlot(e) {
|
|
1229
|
+
if (P) return;
|
|
1230
|
+
let t = this.slotForName(e);
|
|
1231
|
+
for (let e of this.domElement.children) if (e.getAttribute("slot") === t) return e;
|
|
1232
|
+
}
|
|
1233
|
+
startOpening(e, t) {
|
|
1234
|
+
this.openTo(e, t).catch((e) => d.warn("<ui-tree>", "opening failed:", e));
|
|
1235
|
+
}
|
|
1236
|
+
openTo(e, t) {
|
|
1237
|
+
let n = Math.max(1, Math.floor(e)), r = ++this.opens;
|
|
1238
|
+
for (let e of [...this.openWaits]) e();
|
|
1239
|
+
return this.isColumns ? this.openColumnsTo(n, r, t) : this.openRowsTo(this.domElement, n, r, t);
|
|
1240
|
+
}
|
|
1241
|
+
closeAll(e) {
|
|
1242
|
+
this.startOpening(1, e);
|
|
1243
|
+
}
|
|
1244
|
+
async openRowsTo(e, t, n, r) {
|
|
1245
|
+
let i = [];
|
|
1246
|
+
for (let a of this.rowsIn(e)) {
|
|
1247
|
+
if (!a.canOpen) continue;
|
|
1248
|
+
let e = a.depth < t - 1;
|
|
1249
|
+
e ? a.disclosure.open(r) : a.disclosure.close(r), this.rowsIn(a.domElement).length ? i.push(this.openRowsTo(a.domElement, t, n, r)) : e && a.isOpen && i.push(this.whenRowsCome(a, n).then((e) => {
|
|
1250
|
+
if (e) return this.openRowsTo(a.domElement, t, n, r);
|
|
1251
|
+
}));
|
|
1252
|
+
}
|
|
1253
|
+
await Promise.all(i);
|
|
1254
|
+
}
|
|
1255
|
+
async openColumnsTo(e, t, n) {
|
|
1256
|
+
if (this.hasItemData) return this.openItemColumnsTo(e, t, n);
|
|
1257
|
+
let r = [];
|
|
1258
|
+
for (let i = this.domElement; r.length < e - 1;) {
|
|
1259
|
+
let a = this.rowsIn(i).filter((e) => !e.isFilteredOut), o = a.find((e) => e.isOpen && e.canOpen) ?? a.find((e) => e.canOpen);
|
|
1260
|
+
if (!o) break;
|
|
1261
|
+
if (r.push(o), r.length < e - 1 && !this.rowsIn(o.domElement).length && (this.openPicks(r, n), !o.isOpen || !await this.whenRowsCome(o, t))) return;
|
|
1262
|
+
i = o.domElement;
|
|
1263
|
+
}
|
|
1264
|
+
if (r.length) return this.openPicks(r, n);
|
|
1265
|
+
for (let e of this.allRows) e.isOpen && e.disclosure.close(n), e.selected &&= !1;
|
|
1266
|
+
this.openPath = [], this.keepPath();
|
|
1267
|
+
}
|
|
1268
|
+
openPicks(e, t) {
|
|
1269
|
+
for (let n of e) n.disclosure.open(t);
|
|
1270
|
+
let n = e.at(-1);
|
|
1271
|
+
n && this.activate(n, t instanceof MouseEvent ? t : new MouseEvent("click"));
|
|
1272
|
+
}
|
|
1273
|
+
async openItemColumnsTo(e, t, n) {
|
|
1274
|
+
let r = [], i = n ?? new MouseEvent("click"), a, o = -1, s = this.topItems;
|
|
1275
|
+
for (; s && r.length < e - 1;) {
|
|
1276
|
+
let n = r.length, c = this.shownIn(s, n), l = c.find((e) => e.id === this.openPath[n] && this.hasChildren(e)) ?? c.find((e) => this.hasChildren(e));
|
|
1277
|
+
if (!l) break;
|
|
1278
|
+
if (r.push(l.id), a = l, s = this.childrenOf(l), !(s || r.length >= e - 1)) {
|
|
1279
|
+
if (this.pickItem(l, n, i, { path: [...r] }), o = n, !x(this.openPath, r) || (await this.childrenOfItem.get(l), t !== this.opens || !x(this.openPath, r))) return;
|
|
1280
|
+
s = this.childrenOf(l);
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
a ? o !== r.length - 1 && this.pickItem(a, r.length - 1, i, { path: r }) : this.openPath.length && this.requestChange("openPath", [], () => !0) && this.keepPath();
|
|
1284
|
+
}
|
|
1285
|
+
async whenRowsCome(e, t) {
|
|
1286
|
+
let n = e.domElement, r = /* @__PURE__ */ i(() => [...n.children].filter((e) => e.localName === n.localName), "rows");
|
|
1287
|
+
return !r().length && !await new Promise((e) => {
|
|
1288
|
+
let t = /* @__PURE__ */ i((t) => {
|
|
1289
|
+
o.disconnect(), this.openWaits.delete(a), e(t);
|
|
1290
|
+
}, "finish"), a = /* @__PURE__ */ i(() => t(!1), "stop"), o = new MutationObserver(() => {
|
|
1291
|
+
r().length && t(!0);
|
|
1292
|
+
});
|
|
1293
|
+
o.observe(n, { childList: !0 }), this.openWaits.add(a);
|
|
1294
|
+
}) ? !1 : (await Promise.all(r().map((e) => e.ready)), t === this.opens && e.isOpen && n.isConnected);
|
|
1295
|
+
}
|
|
680
1296
|
get canRove() {
|
|
681
|
-
return this.isReady && this.isConnected;
|
|
1297
|
+
return this.isReady && this.isConnected && !this.hasItemData;
|
|
682
1298
|
}
|
|
683
1299
|
onCanRoveChanged(e) {
|
|
684
|
-
if (e) return this.roving =
|
|
1300
|
+
if (e) return this.roving = c.focus.roving({
|
|
685
1301
|
container: this.domElement,
|
|
686
|
-
items: /* @__PURE__ */
|
|
1302
|
+
items: /* @__PURE__ */ i(() => this.rowsOnScreen.map((e) => e.domElement), "items"),
|
|
687
1303
|
orientation: "vertical",
|
|
688
1304
|
wrap: !1,
|
|
689
1305
|
activeIndex: Math.max(0, this.rowsOnScreen.findIndex((e) => e.selected))
|
|
@@ -692,13 +1308,14 @@ var He = /* @__PURE__ */ T("<div class=path aria-hidden=true>"), Ue = /* @__PURE
|
|
|
692
1308
|
};
|
|
693
1309
|
}
|
|
694
1310
|
onKeyDown(e) {
|
|
1311
|
+
if (this.hasItemData) return this.onItemKeyDown(e);
|
|
695
1312
|
let t = this.rowOf(e);
|
|
696
1313
|
if (!t || e.target !== t.domElement) return;
|
|
697
1314
|
let n = this.keyActions(t)[e.key]?.(e);
|
|
698
1315
|
n !== !1 && n !== void 0 && e.preventDefault();
|
|
699
1316
|
}
|
|
700
1317
|
keyActions(e) {
|
|
701
|
-
let t = /* @__PURE__ */
|
|
1318
|
+
let t = /* @__PURE__ */ i((t) => this.activate(e, t), "select");
|
|
702
1319
|
return this.isColumns ? {
|
|
703
1320
|
Enter: t,
|
|
704
1321
|
" ": t,
|
|
@@ -706,28 +1323,28 @@ var He = /* @__PURE__ */ T("<div class=path aria-hidden=true>"), Ue = /* @__PURE
|
|
|
706
1323
|
} : {
|
|
707
1324
|
Enter: t,
|
|
708
1325
|
" ": t,
|
|
709
|
-
ArrowRight: /* @__PURE__ */
|
|
710
|
-
ArrowLeft: /* @__PURE__ */
|
|
1326
|
+
ArrowRight: /* @__PURE__ */ i(() => e.canOpen ? (e.showsRows ? this.focusRow(this.rowsIn(e.domElement).find((e) => !e.isFilteredOut)) : e.disclosure.open(), !0) : !1, "ArrowRight"),
|
|
1327
|
+
ArrowLeft: /* @__PURE__ */ i(() => {
|
|
711
1328
|
if (e.isOpen && e.canOpen) return e.disclosure.close();
|
|
712
1329
|
let t = e.domElement.parentElement?.component;
|
|
713
|
-
return t instanceof
|
|
1330
|
+
return t instanceof K ? this.focusRow(t) ?? !0 : !1;
|
|
714
1331
|
}, "ArrowLeft")
|
|
715
1332
|
};
|
|
716
1333
|
}
|
|
717
1334
|
columnKeyActions(e) {
|
|
718
|
-
let t = this.rowsBeside(e), n = t.indexOf(e),
|
|
1335
|
+
let t = this.rowsBeside(e), n = t.indexOf(e), r = /* @__PURE__ */ i((e, t, n = !1) => e ? (this.focusRow(e), this.activate(e, t, { keepsInside: n }), !0) : !1, "pick"), a = /* @__PURE__ */ i((n, i) => {
|
|
719
1336
|
let a = t[Math.max(0, Math.min(t.length - 1, n))];
|
|
720
|
-
return a === e ||
|
|
721
|
-
}, "moveTo"), o = /* @__PURE__ */
|
|
1337
|
+
return a === e || r(a, i);
|
|
1338
|
+
}, "moveTo"), o = /* @__PURE__ */ i((t) => {
|
|
722
1339
|
if (!e.showsRows) return !1;
|
|
723
1340
|
let n = this.rowsIn(e.domElement).filter((e) => !e.isFilteredOut);
|
|
724
|
-
return
|
|
725
|
-
}, "goIn"), s = /* @__PURE__ */
|
|
1341
|
+
return r(n.find((e) => e.isOpen) ?? n[0], t, !0);
|
|
1342
|
+
}, "goIn"), s = /* @__PURE__ */ i((t) => r(this.rowsAround(e).at(-1), t, !0), "goOut"), c = getComputedStyle(this.domElement).direction === "rtl";
|
|
726
1343
|
return {
|
|
727
|
-
ArrowDown: /* @__PURE__ */
|
|
728
|
-
ArrowUp: /* @__PURE__ */
|
|
729
|
-
Home: /* @__PURE__ */
|
|
730
|
-
End: /* @__PURE__ */
|
|
1344
|
+
ArrowDown: /* @__PURE__ */ i((e) => a(n + 1, e), "ArrowDown"),
|
|
1345
|
+
ArrowUp: /* @__PURE__ */ i((e) => a(n - 1, e), "ArrowUp"),
|
|
1346
|
+
Home: /* @__PURE__ */ i((e) => a(0, e), "Home"),
|
|
1347
|
+
End: /* @__PURE__ */ i((e) => a(t.length - 1, e), "End"),
|
|
731
1348
|
ArrowRight: c ? s : o,
|
|
732
1349
|
ArrowLeft: c ? o : s
|
|
733
1350
|
};
|
|
@@ -735,102 +1352,484 @@ var He = /* @__PURE__ */ T("<div class=path aria-hidden=true>"), Ue = /* @__PURE
|
|
|
735
1352
|
focusRow(e) {
|
|
736
1353
|
e && this.roving?.focus(this.roving.items.indexOf(e.domElement));
|
|
737
1354
|
}
|
|
1355
|
+
get columnSizes() {
|
|
1356
|
+
return v(this.size).map((e) => s.sizeFor(e, { source: "<ui-tree size>" }));
|
|
1357
|
+
}
|
|
1358
|
+
sizeOfColumn(e) {
|
|
1359
|
+
let t = this.columnSizes;
|
|
1360
|
+
return t.length ? t[Math.min(e, t.length - 1)] : void 0;
|
|
1361
|
+
}
|
|
1362
|
+
draggedWidthOf(e) {
|
|
1363
|
+
return this.columnWidths[e] ?? this.everyColumnWidth;
|
|
1364
|
+
}
|
|
738
1365
|
columnWidthCSS(e) {
|
|
739
|
-
|
|
740
|
-
|
|
1366
|
+
return this.isNarrowColumn(e) ? Fr : this.fullWidthCSS(e, { isShared: !this.isPeekColumn(e) });
|
|
1367
|
+
}
|
|
1368
|
+
roomOfColumnCSS(e) {
|
|
1369
|
+
return this.narrowColumns.includes(e) ? Fr : this.fullWidthCSS(e);
|
|
1370
|
+
}
|
|
1371
|
+
peekMarginCSS(e) {
|
|
1372
|
+
return this.isPeekColumn(e) ? `calc(${Fr} - ${this.fullWidthCSS(e, { isShared: !1 })})` : void 0;
|
|
1373
|
+
}
|
|
1374
|
+
fullWidthCSS(e, { isShared: t = !0 } = {}) {
|
|
1375
|
+
let n = this.fullColumnMostPx;
|
|
1376
|
+
if (t && n < this.widthPxOf(e)) return `${n}px`;
|
|
1377
|
+
let r = this.draggedWidthOf(e);
|
|
1378
|
+
if (r !== void 0) return `${r}px`;
|
|
1379
|
+
let i = this.sizeOfColumn(e);
|
|
1380
|
+
if (!i) return Pr;
|
|
1381
|
+
if (s.isAuto(i)) {
|
|
1382
|
+
let t = this.fitWidths[e];
|
|
1383
|
+
return t === void 0 ? Pr : `${t}px`;
|
|
1384
|
+
}
|
|
1385
|
+
return i.units === "%" ? `max(${$}px, ${i.value}%)` : `${i.value}${i.units}`;
|
|
1386
|
+
}
|
|
1387
|
+
shownWidthPxOf(e) {
|
|
1388
|
+
return this.narrowColumns.includes(e) ? this.narrowWidthPx : Math.min(this.fullColumnMostPx, this.widthPxOf(e));
|
|
1389
|
+
}
|
|
1390
|
+
widthPxOf(e) {
|
|
1391
|
+
let t = this.draggedWidthOf(e);
|
|
1392
|
+
if (t !== void 0) return t;
|
|
1393
|
+
let n = this.sizeOfColumn(e);
|
|
1394
|
+
return n ? s.isAuto(n) ? this.fitWidths[e] ?? this.defaultWidthPx : n.units === "%" ? Math.max($, this.boxWidthPx * n.value / 100) : n.units === "em" ? n.value * this.emPx : n.units === "rem" ? n.value * this.remPx : n.value : this.defaultWidthPx;
|
|
741
1395
|
}
|
|
742
1396
|
columnStartCSS(e) {
|
|
743
|
-
return `calc(0px + ${Array.from({ length: e }, (e, t) => this.
|
|
1397
|
+
return `calc(0px + ${Array.from({ length: e }, (e, t) => this.roomOfColumnCSS(t)).join(" + ") || "0px"})`;
|
|
744
1398
|
}
|
|
745
1399
|
columnEdge(e) {
|
|
746
1400
|
let t = this;
|
|
747
|
-
var n =
|
|
748
|
-
return n._$$dblclick = () => t.
|
|
749
|
-
e: t.
|
|
750
|
-
t:
|
|
751
|
-
a: t.
|
|
752
|
-
|
|
753
|
-
|
|
1401
|
+
var n = Et();
|
|
1402
|
+
return n._$$dblclick = (n) => t.fitColumn(e, n), n._$$keydown = (n) => t.resizeByKey(n, e), n._$$pointerdown = (n) => t.startResizing(n, e), L(n, "aria-valuemin", $), j(() => ({
|
|
1403
|
+
e: !!t.narrowColumns.includes(e),
|
|
1404
|
+
t: e > (t.peekColumn ?? Infinity),
|
|
1405
|
+
a: e === t.columnIndexes.length - 1,
|
|
1406
|
+
o: t.translationForKey("resizeColumn"),
|
|
1407
|
+
i: Math.round(t.widthPxOf(e)),
|
|
1408
|
+
n: t.columnStartCSS(e + 1)
|
|
1409
|
+
}), ({ e, t, a: r, o: i, i: a, n: o }, s) => {
|
|
1410
|
+
e !== s?.e && n.classList.toggle("narrow", e), t !== s?.t && n.classList.toggle("covered", t), r !== s?.a && n.classList.toggle("last", r), i !== s?.o && L(n, "aria-label", i), a !== s?.i && L(n, "aria-valuenow", a), o !== s?.n && R(n, "inset-inline-start", o);
|
|
754
1411
|
}), n;
|
|
755
1412
|
}
|
|
756
|
-
widthOf(e) {
|
|
757
|
-
let t = this.columnWidths[e];
|
|
758
|
-
return t === void 0 ? this.measureDefaultWidth() : t;
|
|
759
|
-
}
|
|
760
1413
|
measureDefaultWidth() {
|
|
761
|
-
let e = this.domElement.renderRoot
|
|
762
|
-
|
|
1414
|
+
let e = this.domElement.renderRoot, t = /* @__PURE__ */ i((t) => e.querySelector(t)?.getBoundingClientRect().width ?? 0, "widthOf"), n = Math.round(t(".column-probe"));
|
|
1415
|
+
n && (this.defaultWidthPx = n);
|
|
1416
|
+
let r = t(".narrow-probe");
|
|
1417
|
+
r && (this.narrowWidthPx = r);
|
|
1418
|
+
let a = e.querySelector(".columns");
|
|
1419
|
+
return a && (this.emPx = parseFloat(getComputedStyle(a).fontSize) || this.emPx), this.remPx = parseFloat(getComputedStyle(document.documentElement).fontSize) || this.remPx, n;
|
|
1420
|
+
}
|
|
1421
|
+
widthNowOf(e) {
|
|
1422
|
+
return this.defaultWidthPx || this.measureDefaultWidth(), this.widthPxOf(e);
|
|
763
1423
|
}
|
|
764
1424
|
startResizing(e, t) {
|
|
1425
|
+
let n = {
|
|
1426
|
+
columns: this.columnWidths,
|
|
1427
|
+
every: this.everyColumnWidth
|
|
1428
|
+
}, r = e.altKey;
|
|
1429
|
+
this.dragWidth(e, this.widthNowOf(t), {
|
|
1430
|
+
resize: /* @__PURE__ */ i((e) => {
|
|
1431
|
+
r ? this.setEveryColumnWidth(e, { keeps: !1 }) : this.setColumnWidth(t, e, { keeps: !1 });
|
|
1432
|
+
}, "resize"),
|
|
1433
|
+
restore: /* @__PURE__ */ i(() => {
|
|
1434
|
+
this.columnWidths = n.columns, this.everyColumnWidth = n.every;
|
|
1435
|
+
}, "restore")
|
|
1436
|
+
});
|
|
1437
|
+
}
|
|
1438
|
+
dragWidth(e, t, { resize: n, restore: r }) {
|
|
765
1439
|
if (e.button !== 0) return;
|
|
766
|
-
let
|
|
767
|
-
new
|
|
1440
|
+
let a = this.isRightToLeft ? -1 : 1;
|
|
1441
|
+
this.isResizing = !0, new se(e.currentTarget, e, {
|
|
768
1442
|
carried: [e.currentTarget],
|
|
769
1443
|
follows: !1,
|
|
770
1444
|
cursor: "col-resize",
|
|
771
|
-
placing: /* @__PURE__ */
|
|
772
|
-
onDrop: /* @__PURE__ */
|
|
773
|
-
|
|
1445
|
+
placing: /* @__PURE__ */ i((r) => n(t + (r - e.clientX) * a), "placing"),
|
|
1446
|
+
onDrop: /* @__PURE__ */ i(() => {
|
|
1447
|
+
this.isResizing = !1, this.keepWidths();
|
|
1448
|
+
}, "onDrop"),
|
|
1449
|
+
onCancel: /* @__PURE__ */ i(() => {
|
|
1450
|
+
this.isResizing = !1, r();
|
|
1451
|
+
}, "onCancel")
|
|
774
1452
|
});
|
|
775
1453
|
}
|
|
776
1454
|
resizeByKey(e, t) {
|
|
777
|
-
let n =
|
|
778
|
-
if (
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
1455
|
+
let n = this.keyStepPx(e);
|
|
1456
|
+
if (n === void 0) return;
|
|
1457
|
+
let r = this.widthNowOf(t) + n;
|
|
1458
|
+
e.altKey ? this.setEveryColumnWidth(r) : this.setColumnWidth(t, r);
|
|
1459
|
+
}
|
|
1460
|
+
keyStepPx(e) {
|
|
1461
|
+
let t = Gr[e.key];
|
|
1462
|
+
if (t) return e.preventDefault(), e.stopPropagation(), t * (this.isRightToLeft ? -1 : 1) * Ur * (e.shiftKey ? Wr : 1);
|
|
1463
|
+
}
|
|
1464
|
+
fitColumn(e, t) {
|
|
1465
|
+
if (!t.altKey) return this.setColumnWidth(e, this.measureFitWidth(e, this.boxWidthPx || Infinity));
|
|
1466
|
+
let n = this.columnIndexes.map((e) => this.isNarrowColumn(e) ? this.draggedWidthOf(e) : this.measureFitWidth(e, this.boxWidthPx || Infinity));
|
|
1467
|
+
this.everyColumnWidth = void 0, this.columnWidths = trimmedWidths(n), this.keepWidths();
|
|
782
1468
|
}
|
|
783
1469
|
setColumnWidth(e, t, { keeps: n = !0 } = {}) {
|
|
784
1470
|
let r = [...this.columnWidths];
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
1471
|
+
r[e] = t === void 0 ? void 0 : Math.round(Math.max($, t)), this.columnWidths = trimmedWidths(r), n && this.keepWidths();
|
|
1472
|
+
}
|
|
1473
|
+
setEveryColumnWidth(e, { keeps: t = !0 } = {}) {
|
|
1474
|
+
this.everyColumnWidth = Math.round(Math.max($, e)), this.columnWidths = [], t && this.keepWidths();
|
|
1475
|
+
}
|
|
1476
|
+
keepWidths() {
|
|
1477
|
+
let e = this.domElement.id;
|
|
1478
|
+
if (!e || P) return;
|
|
1479
|
+
let t = this.columnWidths, n = this.everyColumnWidth, r = this.detailWidth, i = {
|
|
1480
|
+
...t.length && { columns: t.map((e) => e ?? null) },
|
|
1481
|
+
...n !== void 0 && { every: n },
|
|
1482
|
+
...r !== void 0 && { detail: r }
|
|
1483
|
+
};
|
|
1484
|
+
_UITree.store.set(`${Lr}${e}`, i.columns || i.every || i.detail ? i : void 0);
|
|
789
1485
|
}
|
|
790
1486
|
onConnectedInColumns(e, t) {
|
|
791
|
-
if (!e || !t ||
|
|
792
|
-
|
|
1487
|
+
if (!e || !t || P) return;
|
|
1488
|
+
_(() => this.measureDefaultWidth()), this.showNewestColumn();
|
|
793
1489
|
let n = this.domElement.id;
|
|
794
1490
|
if (!n) return;
|
|
795
|
-
let r = _UITree.
|
|
796
|
-
|
|
1491
|
+
let r = _UITree.keptWidths(n);
|
|
1492
|
+
this.columnWidths = (r.columns ?? []).map((e) => typeof e == "number" ? e : void 0), this.everyColumnWidth = typeof r.every == "number" ? r.every : void 0, this.detailWidth = typeof r.detail == "number" ? r.detail : void 0, this.openKeptPath(n);
|
|
797
1493
|
}
|
|
798
1494
|
get isRightToLeft() {
|
|
799
1495
|
return getComputedStyle(this.domElement).direction === "rtl";
|
|
800
1496
|
}
|
|
801
|
-
|
|
802
|
-
return
|
|
1497
|
+
get fitKey() {
|
|
1498
|
+
return !this.isColumns || !this.isReady || !this.columnSizes.some((e) => s.isAuto(e)) ? "" : JSON.stringify([
|
|
1499
|
+
this.columnIndexes.length,
|
|
1500
|
+
this.narrowColumns,
|
|
1501
|
+
this.openPath,
|
|
1502
|
+
this.rowsVersion,
|
|
1503
|
+
this.childrenVersion,
|
|
1504
|
+
this.filter,
|
|
1505
|
+
this.filterColumn,
|
|
1506
|
+
this.show
|
|
1507
|
+
]);
|
|
1508
|
+
}
|
|
1509
|
+
onFitKeyChanged(e) {
|
|
1510
|
+
if (e && !P) return _(() => this.measureFitWidths());
|
|
1511
|
+
}
|
|
1512
|
+
measureFitWidths() {
|
|
1513
|
+
this.defaultWidthPx || this.measureDefaultWidth();
|
|
1514
|
+
let e = Math.max($, this.defaultWidthPx * Hr);
|
|
1515
|
+
this.fitWidths = this.columnIndexes.map((t) => (s.isAuto(this.sizeOfColumn(t)) && this.draggedWidthOf(t) === void 0 && !this.isNarrowColumn(t) ? this.measureFitWidth(t, e) : void 0) ?? this.fitWidths[t]);
|
|
1516
|
+
}
|
|
1517
|
+
measureFitWidth(e, t) {
|
|
1518
|
+
if (P) return;
|
|
1519
|
+
let n = this.hasItemData ? this.fitOfItemColumn(e) : this.fitOfRowColumn(e);
|
|
1520
|
+
return n === void 0 ? void 0 : Math.round(Math.min(t, Math.max($, n)));
|
|
1521
|
+
}
|
|
1522
|
+
fitOfItemColumn(e) {
|
|
1523
|
+
let t = this.itemColumnElement(e), n = this.shownIn(this.columnLists[e] ?? [], e), r = t && n.length ? this.textTracksOf(t, n) : void 0;
|
|
1524
|
+
if (!t || !r) return;
|
|
1525
|
+
let [, i = 0, a = 0, o = 0] = getComputedStyle(t).gridTemplateColumns.split(/\s+/).map(parseFloat), s = t.offsetWidth - i - a - o;
|
|
1526
|
+
return Math.ceil(s + r.words + (r.which ?? a));
|
|
1527
|
+
}
|
|
1528
|
+
itemColumnElement(e) {
|
|
1529
|
+
return this.domElement.renderRoot.querySelector(`ul[data-depth="${e}"]`) ?? void 0;
|
|
1530
|
+
}
|
|
1531
|
+
get textTrackSources() {
|
|
1532
|
+
if (this.isColumns && this.isReady && this.hasItemData) return {
|
|
1533
|
+
lists: this.columnLists.map((e, t) => this.shownIn(e ?? [], t)),
|
|
1534
|
+
show: this.show
|
|
1535
|
+
};
|
|
1536
|
+
}
|
|
1537
|
+
onTextTrackSourcesChanged(e) {
|
|
1538
|
+
if (e && !P) return _(() => {
|
|
1539
|
+
let t = e.lists.map((e, t) => {
|
|
1540
|
+
let n = this.itemColumnElement(t);
|
|
1541
|
+
return n && e.length ? this.textTracksOf(n, e) : void 0;
|
|
1542
|
+
});
|
|
1543
|
+
x(t, this.textTracks) || (this.textTracks = t);
|
|
1544
|
+
});
|
|
1545
|
+
}
|
|
1546
|
+
textTracksOf(e, t) {
|
|
1547
|
+
let n = e.querySelector(".column-row .words");
|
|
1548
|
+
if (!n) return;
|
|
1549
|
+
let r = this.shows("which") ? e.querySelector(".column-row .which") : null, a = D.fontOf(n), o = r ? D.fontOf(r) : "", s = r && parseFloat(getComputedStyle(r).marginInlineStart) || 0, c = `${a}|${o}|${s}|${this.shows("which")}`, l = this.measuredTracks.get(t);
|
|
1550
|
+
if (l?.key === c) return l.tracks;
|
|
1551
|
+
let u = /* @__PURE__ */ i((e, t) => Math.ceil(Math.max(0, ...e.map((e) => e ? D.widthOf(e, t) ?? 0 : 0))), "widest"), d = this.shows("which") && t.some((e) => e.which), f = {
|
|
1552
|
+
words: u(t.map((e) => e.label), a),
|
|
1553
|
+
which: d ? r ? u(t.map((e) => e.which), o) + Math.ceil(s) : void 0 : 0
|
|
1554
|
+
};
|
|
1555
|
+
return this.measuredTracks.set(t, {
|
|
1556
|
+
key: c,
|
|
1557
|
+
tracks: f
|
|
1558
|
+
}), f;
|
|
803
1559
|
}
|
|
804
|
-
|
|
805
|
-
|
|
1560
|
+
textTracksCSS(e) {
|
|
1561
|
+
let t = this.textTracks[e];
|
|
1562
|
+
return {
|
|
1563
|
+
"--_tree-words-track": t ? `${t.words}px` : void 0,
|
|
1564
|
+
"--_tree-which-track": t?.which === void 0 ? void 0 : `${t.which}px`
|
|
1565
|
+
};
|
|
1566
|
+
}
|
|
1567
|
+
fitOfRowColumn(e) {
|
|
1568
|
+
let t = e ? this.openChain.filter((e) => e.canOpen)[e - 1]?.domElement : this.domElement, n = e ? t?.renderRoot.querySelector(".rows") : this.domElement.renderRoot.querySelector(".column");
|
|
1569
|
+
if (!t || !n || !this.rowsIn(t).length) return;
|
|
1570
|
+
let { width: r, transition: i } = n.style;
|
|
1571
|
+
n.style.transition = "none", n.style.width = "max-content";
|
|
1572
|
+
let a = n.getBoundingClientRect().width;
|
|
1573
|
+
return n.style.width = r, n.style.transition = i, Math.ceil(a);
|
|
1574
|
+
}
|
|
1575
|
+
static get store() {
|
|
1576
|
+
return _UITree.madeStore ??= new ce(Ir);
|
|
1577
|
+
}
|
|
1578
|
+
static keptWidths(e) {
|
|
1579
|
+
let t = `${Lr}${e}`, n = new ce(Br);
|
|
1580
|
+
if (n.has(e)) {
|
|
1581
|
+
let r = n.get(e);
|
|
1582
|
+
!_UITree.store.has(t) && Array.isArray(r) && _UITree.store.set(t, { columns: r }), n.forget(e);
|
|
1583
|
+
}
|
|
1584
|
+
let r = _UITree.store.get(t);
|
|
1585
|
+
return r && typeof r == "object" ? r : {};
|
|
1586
|
+
}
|
|
1587
|
+
openKeptPath(e) {
|
|
1588
|
+
if (this.isControlledByPage("openPath") || this.openPath.length || !this.hasItemData && this.domElement.querySelector(zr)) return;
|
|
1589
|
+
let t = _UITree.store.get(`${Rr}${e}`);
|
|
1590
|
+
Array.isArray(t) && t.length && t.every((e) => typeof e == "string") && (this.openPath = t);
|
|
1591
|
+
}
|
|
1592
|
+
keepPath() {
|
|
1593
|
+
let e = this.domElement.id;
|
|
1594
|
+
if (!this.isConnected || !this.isColumns || !e || P) return;
|
|
1595
|
+
let t = this.openPath;
|
|
1596
|
+
_UITree.store.set(`${Rr}${e}`, t.length ? [...t] : void 0);
|
|
1597
|
+
}
|
|
1598
|
+
get detailElement() {
|
|
1599
|
+
return this.childInSlot("detail");
|
|
1600
|
+
}
|
|
1601
|
+
get pickedItem() {
|
|
1602
|
+
if (!this.isColumns) return;
|
|
1603
|
+
if (this.hasItemData) {
|
|
1604
|
+
let e = this.selectedDepth;
|
|
1605
|
+
return e < 0 ? void 0 : this.columnLists[e]?.find((t) => t.id === this.openPath[e]);
|
|
1606
|
+
}
|
|
1607
|
+
let e = this.openChain;
|
|
1608
|
+
return (e.find((e) => e.selected) ?? e.at(-1))?.domElement;
|
|
1609
|
+
}
|
|
1610
|
+
get hasDetail() {
|
|
1611
|
+
return this.isColumns && !!this.detailElement && this.pickedItem !== void 0;
|
|
1612
|
+
}
|
|
1613
|
+
onDetailItemChanged(e, t) {
|
|
1614
|
+
e && (e.item = t);
|
|
1615
|
+
}
|
|
1616
|
+
detailPane() {
|
|
1617
|
+
let e = this;
|
|
1618
|
+
var t = Ot(), n = t.firstChild, r = n.firstChild, i = n.nextSibling;
|
|
1619
|
+
return ge(() => (t) => e.watchDetailWidth(t), t), N(t, A(k, {
|
|
1620
|
+
get when() {
|
|
1621
|
+
return e.columnTitleList.length > 0;
|
|
1622
|
+
},
|
|
1623
|
+
get children() {
|
|
1624
|
+
var t = Dt();
|
|
1625
|
+
return j(() => e.partForName("column-title"), (e) => {
|
|
1626
|
+
L(t, "part", e);
|
|
1627
|
+
}), t;
|
|
1628
|
+
}
|
|
1629
|
+
}), n), r._$owner = M(), i._$$dblclick = () => e.setDetailWidth(void 0), i._$$keydown = (t) => e.resizeDetailByKey(t), i._$$pointerdown = (t) => e.startResizingDetail(t), L(i, "aria-valuemin", $), j(() => ({
|
|
1630
|
+
e: !!e.stickyDetail,
|
|
1631
|
+
t: e.detailWidth !== void 0,
|
|
1632
|
+
a: e.partForName("detail"),
|
|
1633
|
+
o: e.detailWidth === void 0 ? void 0 : `${e.detailWidth}px`,
|
|
1634
|
+
i: e.hasItemData ? void 0 : e.detailMarginCSS(),
|
|
1635
|
+
n: e.slotForName("detail"),
|
|
1636
|
+
s: e.translationForKey("resizeDetail"),
|
|
1637
|
+
h: Math.round(e.detailWidthPx)
|
|
1638
|
+
}), ({ e, t: n, a, o, i: s, n: c, s: l, h: u }, d) => {
|
|
1639
|
+
e !== d?.e && t.classList.toggle("sticky", e), n !== d?.t && t.classList.toggle("sized", n), a !== d?.a && L(t, "part", a), o !== d?.o && R(t, "width", o), s !== d?.i && R(t, "margin-inline-start", s), c !== d?.n && L(r, "name", c), l !== d?.s && L(i, "aria-label", l), u !== d?.h && L(i, "aria-valuenow", u);
|
|
1640
|
+
}), t;
|
|
1641
|
+
}
|
|
1642
|
+
onDetailSizeChanged() {
|
|
1643
|
+
this.isReady && this.showColumn(this.selectedColumn);
|
|
1644
|
+
}
|
|
1645
|
+
detailMarginCSS() {
|
|
1646
|
+
return `calc(${this.columnStartCSS(this.columnIndexes.length)} - ${this.columnStartCSS(1)})`;
|
|
1647
|
+
}
|
|
1648
|
+
watchDetailWidth(e) {
|
|
1649
|
+
if (P) return;
|
|
1650
|
+
let t = new ResizeObserver(([e]) => {
|
|
1651
|
+
let t = e?.borderBoxSize[0]?.inlineSize;
|
|
1652
|
+
t !== void 0 && (this.detailWidthPx = Math.round(t));
|
|
1653
|
+
});
|
|
1654
|
+
t.observe(e), this.detailObserver?.disconnect(), this.detailObserver = t;
|
|
1655
|
+
}
|
|
1656
|
+
detailWidthNow() {
|
|
1657
|
+
let e = this.domElement.renderRoot.querySelector(".detail");
|
|
1658
|
+
return this.detailWidth ?? (e?.getBoundingClientRect().width || this.detailWidthPx);
|
|
1659
|
+
}
|
|
1660
|
+
startResizingDetail(e) {
|
|
1661
|
+
let t = this.detailWidth;
|
|
1662
|
+
this.dragWidth(e, this.detailWidthNow(), {
|
|
1663
|
+
resize: /* @__PURE__ */ i((e) => this.setDetailWidth(e, { keeps: !1 }), "resize"),
|
|
1664
|
+
restore: /* @__PURE__ */ i(() => this.detailWidth = t, "restore")
|
|
1665
|
+
});
|
|
1666
|
+
}
|
|
1667
|
+
resizeDetailByKey(e) {
|
|
1668
|
+
let t = this.keyStepPx(e);
|
|
1669
|
+
t !== void 0 && this.setDetailWidth(this.detailWidthNow() + t);
|
|
1670
|
+
}
|
|
1671
|
+
setDetailWidth(e, { keeps: t = !0 } = {}) {
|
|
1672
|
+
let n = Math.max($, (this.boxWidthPx || Infinity) - $);
|
|
1673
|
+
this.detailWidth = e === void 0 ? void 0 : Math.round(Math.min(n, Math.max($, e))), t && this.keepWidths();
|
|
1674
|
+
}
|
|
1675
|
+
get columnPicks() {
|
|
1676
|
+
if (!this.stickyPath) return [];
|
|
1677
|
+
if (!this.hasItemData) return this.openChain;
|
|
1678
|
+
let e = this.columnLists;
|
|
1679
|
+
return this.openPath.flatMap((t, n) => e[n]?.find((e) => e.id === t) ?? []);
|
|
1680
|
+
}
|
|
1681
|
+
get selectedColumn() {
|
|
1682
|
+
if (this.hasItemData) return this.selectedDepth;
|
|
1683
|
+
let e = this.openChain, t = e.findIndex((e) => e.selected);
|
|
1684
|
+
return t >= 0 ? t : e.length - 1;
|
|
1685
|
+
}
|
|
1686
|
+
pickFromPath(e, t) {
|
|
1687
|
+
if (this.hasItemData) {
|
|
1688
|
+
let n = this.columnLists[e]?.find((t) => t.id === this.openPath[e]);
|
|
1689
|
+
if (!n) return;
|
|
1690
|
+
this.pickItem(n, e, t, { keepsInside: !0 }), h(() => this.focusKeyRow());
|
|
1691
|
+
} else {
|
|
1692
|
+
let n = this.openChain[e];
|
|
1693
|
+
if (!n) return;
|
|
1694
|
+
this.focusRow(n), this.activate(n, t, { keepsInside: !0 });
|
|
1695
|
+
}
|
|
1696
|
+
this.showColumn(e);
|
|
1697
|
+
}
|
|
1698
|
+
showColumn(e) {
|
|
1699
|
+
P || _(() => {
|
|
1700
|
+
let t = this.domElement.renderRoot.querySelector(".columns");
|
|
1701
|
+
if (!t) return;
|
|
1702
|
+
let n = [0];
|
|
1703
|
+
for (let t = 0; t < e; t++) n.push(n[t] + this.shownWidthPxOf(t));
|
|
1704
|
+
let r = n[e], i = r + this.shownWidthPxOf(e), a = this.isRightToLeft ? -1 : 1, o = t.scrollLeft * a, s = t.clientWidth - (this.hasDetail && this.stickyDetail ? this.detailWidthPx : 0), c;
|
|
1705
|
+
if (r < o ? c = r : i > o + s && (c = n.find((e) => e >= i - s) ?? r), c === void 0) return;
|
|
1706
|
+
c = Math.min(c, t.scrollWidth - t.clientWidth);
|
|
1707
|
+
let l = matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
1708
|
+
t.scrollTo({
|
|
1709
|
+
left: c * a,
|
|
1710
|
+
behavior: l ? "instant" : "smooth"
|
|
1711
|
+
});
|
|
1712
|
+
});
|
|
1713
|
+
}
|
|
1714
|
+
get narrowColumns() {
|
|
1715
|
+
if (!this.isColumns || !this.boxWidthPx || !this.defaultWidthPx) return [];
|
|
1716
|
+
let e = this.columnIndexes.length, t = this.selectedColumn, n = this.columnsRoomPx, r = 0;
|
|
1717
|
+
for (let t = 0; t < e; t++) r += this.widthPxOf(t);
|
|
1718
|
+
let i = [];
|
|
1719
|
+
for (let a = 0; a < e - (this.narrowBefore ?? 2) && r > n; a++) a !== t && (i.push(a), r -= this.widthPxOf(a) - this.narrowWidthPx);
|
|
1720
|
+
return i;
|
|
1721
|
+
}
|
|
1722
|
+
get columnsRoomPx() {
|
|
1723
|
+
let e = this.hasDetail ? this.detailWidthPx : 0;
|
|
1724
|
+
return Math.max($, this.boxWidthPx - e);
|
|
1725
|
+
}
|
|
1726
|
+
get peekColumn() {
|
|
1727
|
+
let e = this.narrowColumns;
|
|
1728
|
+
for (let t of [this.hoveredColumn, this.focusedColumn]) if (t !== void 0 && e.includes(t)) return t;
|
|
1729
|
+
}
|
|
1730
|
+
isNarrowColumn(e) {
|
|
1731
|
+
return this.narrowColumns.includes(e) && e !== this.peekColumn;
|
|
1732
|
+
}
|
|
1733
|
+
isPeekColumn(e) {
|
|
1734
|
+
return e === this.peekColumn;
|
|
1735
|
+
}
|
|
1736
|
+
peekClipCSS(e) {
|
|
1737
|
+
let t = this.peekColumn;
|
|
1738
|
+
if (t === void 0 || e <= t || this.hasItemData) return;
|
|
1739
|
+
let n = `max(0px, ${`${this.columnStartCSS(t)} + ${this.fullWidthCSS(t, { isShared: !1 })}`} - ${this.columnStartCSS(e)})`;
|
|
1740
|
+
return this.isRightToLeft ? `inset(0 ${n} 0 0)` : `inset(0 0 0 ${n})`;
|
|
1741
|
+
}
|
|
1742
|
+
isCoveredColumn(e) {
|
|
1743
|
+
let t = this.peekColumn;
|
|
1744
|
+
if (t === void 0 || e <= t || this.hasItemData) return !1;
|
|
1745
|
+
let n = 0;
|
|
1746
|
+
for (let t = 0; t < e; t++) n += this.shownWidthPxOf(t);
|
|
1747
|
+
let r = 0;
|
|
1748
|
+
for (let e = 0; e < t; e++) r += this.shownWidthPxOf(e);
|
|
1749
|
+
return n + this.shownWidthPxOf(e) <= r + this.widthPxOf(t);
|
|
1750
|
+
}
|
|
1751
|
+
get fullColumnMostPx() {
|
|
1752
|
+
if (!this.isColumns || !this.boxWidthPx || !this.defaultWidthPx) return Infinity;
|
|
1753
|
+
let e = this.narrowColumns, t = this.columnIndexes.filter((t) => !e.includes(t)).map((e) => this.widthPxOf(e)).sort((e, t) => e - t), n = this.columnsRoomPx - e.length * this.narrowWidthPx;
|
|
1754
|
+
if (t.reduce((e, t) => e + t, 0) <= n) return Infinity;
|
|
1755
|
+
for (let e = 0; e < t.length; e++) {
|
|
1756
|
+
let r = n / (t.length - e);
|
|
1757
|
+
if (t[e] > r) return Math.max($, Math.floor(r));
|
|
1758
|
+
n -= t[e];
|
|
1759
|
+
}
|
|
1760
|
+
return Infinity;
|
|
1761
|
+
}
|
|
1762
|
+
watchBoxWidth(e, t, n) {
|
|
1763
|
+
if (!e || !t || !n || P) return;
|
|
1764
|
+
let r = new ResizeObserver(([e]) => {
|
|
1765
|
+
e && (this.boxWidthPx = Math.round(e.contentRect.width), this.measureDefaultWidth());
|
|
1766
|
+
}), i = _(() => {
|
|
1767
|
+
let e = this.domElement.renderRoot.querySelector(".columns");
|
|
1768
|
+
e && r.observe(e);
|
|
1769
|
+
});
|
|
1770
|
+
return () => {
|
|
1771
|
+
i(), r.disconnect();
|
|
1772
|
+
};
|
|
1773
|
+
}
|
|
1774
|
+
onPointerOver(e) {
|
|
1775
|
+
if (!this.isColumns) return;
|
|
1776
|
+
let t = e.composedPath();
|
|
1777
|
+
t.some((e) => e.classList?.contains("column-edge")) || (this.hoveredColumn = this.columnOf(t));
|
|
1778
|
+
}
|
|
1779
|
+
onPointerLeft() {
|
|
1780
|
+
this.hoveredColumn = void 0;
|
|
1781
|
+
}
|
|
1782
|
+
onFocusIn(e) {
|
|
1783
|
+
this.isColumns && (this.focusedColumn = this.columnOf(e.composedPath()));
|
|
1784
|
+
}
|
|
1785
|
+
onFocusOut() {
|
|
1786
|
+
this.focusedColumn = void 0;
|
|
1787
|
+
}
|
|
1788
|
+
onNarrowColumnsChanged(e) {
|
|
1789
|
+
let t = e.filter((e) => !this.lastNarrowColumns.includes(e));
|
|
1790
|
+
this.lastNarrowColumns = e, this.hoveredColumn !== void 0 && t.includes(this.hoveredColumn) && (this.hoveredColumn = void 0), this.focusedColumn !== void 0 && t.includes(this.focusedColumn) && (this.focusedColumn = void 0);
|
|
1791
|
+
}
|
|
1792
|
+
columnOf(e) {
|
|
1793
|
+
for (let t of e) {
|
|
1794
|
+
if (t === this.domElement) return;
|
|
1795
|
+
let e = t;
|
|
1796
|
+
if (e.classList?.contains("column")) return Number(e.dataset.depth ?? 0);
|
|
1797
|
+
if (e.classList?.contains("rows")) {
|
|
1798
|
+
let { component: t } = e.getRootNode().host;
|
|
1799
|
+
if (t instanceof K) return t.depth + 1;
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
watchScrolling(e, t, n) {
|
|
1804
|
+
if (!e || !t || n || P) {
|
|
806
1805
|
this.pathRows = [];
|
|
807
1806
|
return;
|
|
808
1807
|
}
|
|
809
|
-
let
|
|
810
|
-
return document.addEventListener("scroll",
|
|
1808
|
+
let r = /* @__PURE__ */ i(() => this.readPathSoon(), "onScroll");
|
|
1809
|
+
return document.addEventListener("scroll", r, {
|
|
811
1810
|
capture: !0,
|
|
812
1811
|
passive: !0
|
|
813
1812
|
}), this.readPathSoon(), () => {
|
|
814
|
-
document.removeEventListener("scroll",
|
|
1813
|
+
document.removeEventListener("scroll", r, { capture: !0 }), this.cancelPathRead?.();
|
|
815
1814
|
};
|
|
816
1815
|
}
|
|
817
1816
|
readPathSoon() {
|
|
818
|
-
this.cancelPathRead ??=
|
|
1817
|
+
this.cancelPathRead ??= _(() => {
|
|
819
1818
|
this.cancelPathRead = void 0, this.pathRows = this.readPath();
|
|
820
1819
|
});
|
|
821
1820
|
}
|
|
822
1821
|
readPath() {
|
|
823
|
-
let e =
|
|
1822
|
+
let e = ae(this.domElement), t = Math.max(e?.getBoundingClientRect().top ?? 0, this.domElement.getBoundingClientRect().top), n = this.rowsOnScreen.find((e) => rowBoxOf(e).bottom > t + this.pathHeight);
|
|
824
1823
|
if (!n) return [];
|
|
825
1824
|
let r = [];
|
|
826
1825
|
for (let e = n.domElement.parentElement; e && e !== this.domElement; e = e.parentElement) {
|
|
827
1826
|
let { component: t } = e;
|
|
828
|
-
t instanceof
|
|
1827
|
+
t instanceof K && r.unshift(t);
|
|
829
1828
|
}
|
|
830
1829
|
return r.length && rowBoxOf(r[0]).top < t ? r : [];
|
|
831
1830
|
}
|
|
832
1831
|
scrollToRow(e) {
|
|
833
|
-
let t =
|
|
1832
|
+
let t = ae(this.domElement);
|
|
834
1833
|
if (!t) return;
|
|
835
1834
|
let n = Math.max(t.getBoundingClientRect().top, this.domElement.getBoundingClientRect().top);
|
|
836
1835
|
t.scrollTop += rowBoxOf(e).top - n - this.pathHeight;
|
|
@@ -838,14 +1837,32 @@ var He = /* @__PURE__ */ T("<div class=path aria-hidden=true>"), Ue = /* @__PURE
|
|
|
838
1837
|
get pathHeight() {
|
|
839
1838
|
return this.domElement.renderRoot.querySelector(".path")?.offsetHeight ?? 0;
|
|
840
1839
|
}
|
|
841
|
-
onFilterChanged() {
|
|
842
|
-
this.applyFilter();
|
|
1840
|
+
onFilterChanged(e) {
|
|
1841
|
+
e && !this.hadFilter && (this.filterColumn = Math.max(0, this.columnIndexes.length - 1)), this.hadFilter = !!e, this.applyFilter();
|
|
1842
|
+
}
|
|
1843
|
+
get filterText() {
|
|
1844
|
+
return (this.filter ?? "").trim().toLowerCase();
|
|
1845
|
+
}
|
|
1846
|
+
get filteredColumn() {
|
|
1847
|
+
return Math.max(0, Math.min(this.filterColumn, this.columnIndexes.length - 1));
|
|
1848
|
+
}
|
|
1849
|
+
get filteredRowsParent() {
|
|
1850
|
+
let e = this.filteredColumn;
|
|
1851
|
+
return !this.isColumns || !e ? this.domElement : this.openChain.filter((e) => e.canOpen)[e - 1]?.domElement ?? this.domElement;
|
|
1852
|
+
}
|
|
1853
|
+
get filterBase() {
|
|
1854
|
+
return !this.isColumns || !this.hasItemData ? "" : this.openPath.slice(0, this.filteredColumn).join("\n");
|
|
1855
|
+
}
|
|
1856
|
+
onFilterBaseChanged() {
|
|
1857
|
+
this.filter && this.applyFilter();
|
|
843
1858
|
}
|
|
844
1859
|
onRowsChanged() {
|
|
845
1860
|
this.rowsVersion++, this.filter && this.applyFilter(), this.roving?.refresh();
|
|
846
1861
|
}
|
|
847
1862
|
applyFilter() {
|
|
848
|
-
let e =
|
|
1863
|
+
let e = this.filterText;
|
|
1864
|
+
if (this.isColumns) return this.applyColumnFilter(e);
|
|
1865
|
+
let t = /* @__PURE__ */ i((n) => {
|
|
849
1866
|
let r = !1;
|
|
850
1867
|
for (let i of this.rowsIn(n)) {
|
|
851
1868
|
let n = t(i.domElement), a = !e || i.filterWords.toLowerCase().includes(e);
|
|
@@ -855,30 +1872,510 @@ var He = /* @__PURE__ */ T("<div class=path aria-hidden=true>"), Ue = /* @__PURE
|
|
|
855
1872
|
}, "matchIn");
|
|
856
1873
|
this.hasNoMatches = !t(this.domElement) && !!e;
|
|
857
1874
|
}
|
|
1875
|
+
applyColumnFilter(e) {
|
|
1876
|
+
if (this.hasItemData) {
|
|
1877
|
+
let t = this.filteredColumn, n = this.columnLists[t];
|
|
1878
|
+
return this.hasNoMatches = !!e && !!n?.length && !this.shownIn(n, t).length, this.lookElsewhere(e);
|
|
1879
|
+
}
|
|
1880
|
+
for (let e of this.allRows) e.isFilteredOut = !1, e.isKeptOpen = !1, e.isUnmatched = !1;
|
|
1881
|
+
let t = !1;
|
|
1882
|
+
for (let n of this.rowsIn(this.filteredRowsParent)) {
|
|
1883
|
+
let r = !e || n.filterWords.toLowerCase().includes(e);
|
|
1884
|
+
n.isFilteredOut = !r && !n.isOpen, n.isUnmatched = !r && n.isOpen, t ||= r;
|
|
1885
|
+
}
|
|
1886
|
+
this.hasNoMatches = !!e && !t, this.lookElsewhere(e);
|
|
1887
|
+
}
|
|
1888
|
+
get hasOtherMatches() {
|
|
1889
|
+
return this.otherMatches.length > 0 || this.isLooking;
|
|
1890
|
+
}
|
|
1891
|
+
lookElsewhere(e) {
|
|
1892
|
+
let t = ++this.looks;
|
|
1893
|
+
this.isLooking = !1, this.didStopLooking = !1, e ? this.hasItemData ? this.lookInItems(e, t).catch((e) => {
|
|
1894
|
+
d.warn("<ui-tree filter>", "looking through the tree failed:", e);
|
|
1895
|
+
}) : this.lookInRows(e) : (this.otherMatches = [], this.otherMatchCount = 0);
|
|
1896
|
+
}
|
|
1897
|
+
lookInRows(e) {
|
|
1898
|
+
let t = this.filteredRowsParent, n = [], r = 0, i = 0, a = [this.domElement];
|
|
1899
|
+
for (; a.length && i <= Q;) {
|
|
1900
|
+
let o = [];
|
|
1901
|
+
for (let s of a) for (let a of this.rowsIn(s)) {
|
|
1902
|
+
if (++i > Q) break;
|
|
1903
|
+
if (o.push(a.domElement), s === t || !a.filterWords.toLowerCase().includes(e) || (r++, n.length >= Ar)) continue;
|
|
1904
|
+
let c = this.rowsAround(a);
|
|
1905
|
+
n.push({
|
|
1906
|
+
label: a.label ?? a.valueOrLabel,
|
|
1907
|
+
icon: a.icon,
|
|
1908
|
+
which: a.which,
|
|
1909
|
+
path: [...c, a].map((e) => e.valueOrLabel),
|
|
1910
|
+
names: c.map((e) => e.label ?? e.valueOrLabel),
|
|
1911
|
+
row: a
|
|
1912
|
+
});
|
|
1913
|
+
}
|
|
1914
|
+
a = o;
|
|
1915
|
+
}
|
|
1916
|
+
this.otherMatches = n, this.otherMatchCount = r, this.didStopLooking = i > Q;
|
|
1917
|
+
}
|
|
1918
|
+
async lookInItems(e, t) {
|
|
1919
|
+
let n = this.openPath.slice(0, this.filteredColumn).join("\n"), r = [], i = 0, a = 0, o = !1, s = [{
|
|
1920
|
+
path: [],
|
|
1921
|
+
names: []
|
|
1922
|
+
}];
|
|
1923
|
+
for (; s.length && a <= Q;) {
|
|
1924
|
+
let c = s.map((e) => e.item ? (o ||= !this.childrenOfItem.has(e.item) && typeof e.item.children == "function", this.childrenNow(e.item)) : this.topItems).filter((e) => e instanceof Promise);
|
|
1925
|
+
if (c.length && (this.isLooking = !0, await Promise.all(c), t !== this.looks)) return;
|
|
1926
|
+
let l = [];
|
|
1927
|
+
for (let t of s) {
|
|
1928
|
+
let o = t.item ? this.childrenOfItem.get(t.item) : this.topItems, s = t.path.join("\n") === n;
|
|
1929
|
+
for (let n of Array.isArray(o) ? o : []) {
|
|
1930
|
+
if (++a > Q) break;
|
|
1931
|
+
let o = {
|
|
1932
|
+
item: n,
|
|
1933
|
+
path: [...t.path, n.id],
|
|
1934
|
+
names: [...t.names, n.label]
|
|
1935
|
+
};
|
|
1936
|
+
if (l.push(o), !s && wordsOf(n).includes(e) && (i++, r.length < Ar)) {
|
|
1937
|
+
let { label: e, icon: i, which: a } = n;
|
|
1938
|
+
r.push({
|
|
1939
|
+
label: e,
|
|
1940
|
+
icon: i,
|
|
1941
|
+
which: a,
|
|
1942
|
+
path: o.path,
|
|
1943
|
+
names: t.names,
|
|
1944
|
+
item: n
|
|
1945
|
+
});
|
|
1946
|
+
}
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
s = l, this.otherMatches = [...r], this.otherMatchCount = i;
|
|
1950
|
+
}
|
|
1951
|
+
this.isLooking = !1, this.didStopLooking = a > Q, o && this.childrenVersion++;
|
|
1952
|
+
}
|
|
1953
|
+
pickMatch(e, t) {
|
|
1954
|
+
if (e.item) {
|
|
1955
|
+
this.pickItem(e.item, e.path.length - 1, t, { path: e.path }), h(() => this.focusKeyRow());
|
|
1956
|
+
return;
|
|
1957
|
+
}
|
|
1958
|
+
let { row: n } = e;
|
|
1959
|
+
if (n) {
|
|
1960
|
+
for (let e of this.rowsAround(n)) e.disclosure.open(t);
|
|
1961
|
+
this.activate(n, t), h(() => this.focusRow(n));
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
matchList() {
|
|
1965
|
+
let e = this;
|
|
1966
|
+
return A(k, {
|
|
1967
|
+
get when() {
|
|
1968
|
+
return e.hasOtherMatches || e.didStopLooking;
|
|
1969
|
+
},
|
|
1970
|
+
get children() {
|
|
1971
|
+
var t = jt(), n = t.firstChild, r = n.nextSibling, i = r.nextSibling, a = i.nextSibling, o = a.nextSibling;
|
|
1972
|
+
return N(n, () => e.translationForKey("elsewhere")), N(t, A(O, {
|
|
1973
|
+
get each() {
|
|
1974
|
+
return e.otherMatches;
|
|
1975
|
+
},
|
|
1976
|
+
children: (t) => (() => {
|
|
1977
|
+
var n = Nt(), r = n.firstChild, i = r.firstChild, a = r.nextSibling;
|
|
1978
|
+
return n._$$click = (n) => e.pickMatch(t, n), N(n, A(k, {
|
|
1979
|
+
get when() {
|
|
1980
|
+
return F(() => !!e.shows("icon"))() ? t.icon : e.shows("icon");
|
|
1981
|
+
},
|
|
1982
|
+
children: (e) => (() => {
|
|
1983
|
+
var t = q(), n = t.firstChild;
|
|
1984
|
+
return n._$owner = M(), j(() => e(), (e) => {
|
|
1985
|
+
L(n, "name", e);
|
|
1986
|
+
}), t;
|
|
1987
|
+
})()
|
|
1988
|
+
}), r), N(i, () => t.label), N(r, A(k, {
|
|
1989
|
+
get when() {
|
|
1990
|
+
return F(() => !!e.shows("which"))() ? t.which : e.shows("which");
|
|
1991
|
+
},
|
|
1992
|
+
children: (e) => (() => {
|
|
1993
|
+
var t = Pt();
|
|
1994
|
+
return N(t, e), t;
|
|
1995
|
+
})()
|
|
1996
|
+
}), null), N(n, A(k, {
|
|
1997
|
+
get when() {
|
|
1998
|
+
return t.names.length;
|
|
1999
|
+
},
|
|
2000
|
+
get children() {
|
|
2001
|
+
var e = Mt();
|
|
2002
|
+
return N(e, () => t.names.join(Er)), e;
|
|
2003
|
+
}
|
|
2004
|
+
}), a), j(() => ({
|
|
2005
|
+
e: e.partForName("match"),
|
|
2006
|
+
t: [...t.names, t.label].join(Er)
|
|
2007
|
+
}), ({ e, t }, r) => {
|
|
2008
|
+
e !== r?.e && L(n, "part", e), t !== r?.t && L(n, "title", t);
|
|
2009
|
+
}), n;
|
|
2010
|
+
})()
|
|
2011
|
+
}), r), N(t, A(k, {
|
|
2012
|
+
get when() {
|
|
2013
|
+
return e.isLooking;
|
|
2014
|
+
},
|
|
2015
|
+
get children() {
|
|
2016
|
+
var t = kt(), n = t.firstChild;
|
|
2017
|
+
return n._$owner = M(), N(t, () => e.translationForKey("lookingElsewhere"), null), t;
|
|
2018
|
+
}
|
|
2019
|
+
}), i), N(t, A(k, {
|
|
2020
|
+
get when() {
|
|
2021
|
+
return e.otherMatchCount > e.otherMatches.length;
|
|
2022
|
+
},
|
|
2023
|
+
get children() {
|
|
2024
|
+
var t = At();
|
|
2025
|
+
return N(t, () => e.translationForKey("moreMatches", { count: e.otherMatchCount - e.otherMatches.length })), t;
|
|
2026
|
+
}
|
|
2027
|
+
}), a), N(t, A(k, {
|
|
2028
|
+
get when() {
|
|
2029
|
+
return e.didStopLooking;
|
|
2030
|
+
},
|
|
2031
|
+
get children() {
|
|
2032
|
+
var t = At();
|
|
2033
|
+
return N(t, () => e.translationForKey("stoppedLooking", { count: Q })), t;
|
|
2034
|
+
}
|
|
2035
|
+
}), o), j(() => ({
|
|
2036
|
+
e: e.translationForKey("elsewhere"),
|
|
2037
|
+
t: e.partForName("matches-title")
|
|
2038
|
+
}), ({ e, t: r }, i) => {
|
|
2039
|
+
e !== i?.e && L(t, "aria-label", e), r !== i?.t && L(n, "part", r);
|
|
2040
|
+
}), t;
|
|
2041
|
+
}
|
|
2042
|
+
});
|
|
2043
|
+
}
|
|
2044
|
+
get shownParts() {
|
|
2045
|
+
let e = (this.show ?? "").split(/\s+/).filter(Boolean);
|
|
2046
|
+
return e.length ? e : Te;
|
|
2047
|
+
}
|
|
2048
|
+
shows(e) {
|
|
2049
|
+
return this.shownParts.includes(e);
|
|
2050
|
+
}
|
|
2051
|
+
get hasItemData() {
|
|
2052
|
+
return Array.isArray(this.items);
|
|
2053
|
+
}
|
|
2054
|
+
get topItems() {
|
|
2055
|
+
return this.items ?? [];
|
|
2056
|
+
}
|
|
2057
|
+
childrenOf(e) {
|
|
2058
|
+
this.childrenVersion;
|
|
2059
|
+
let t = this.childrenOfItem.has(e), n = this.childrenNow(e);
|
|
2060
|
+
if (Array.isArray(n)) return !t && typeof e.children == "function" && this.childrenVersion++, n;
|
|
2061
|
+
}
|
|
2062
|
+
childrenNow(e) {
|
|
2063
|
+
let t = this.childrenOfItem.get(e);
|
|
2064
|
+
if (t) return t;
|
|
2065
|
+
let { children: n } = e, r = typeof n == "function" ? n() : n ?? [];
|
|
2066
|
+
if (Array.isArray(r)) return this.childrenOfItem.set(e, r), r;
|
|
2067
|
+
let i = Promise.resolve(r).then((t) => this.childrenOfItem.set(e, t)).catch((t) => {
|
|
2068
|
+
d.warn("<ui-tree items>", `\`${e.id}\`'s children didn't come:`, t), this.childrenOfItem.set(e, []);
|
|
2069
|
+
}).finally(() => this.childrenVersion++);
|
|
2070
|
+
return this.childrenOfItem.set(e, i), i;
|
|
2071
|
+
}
|
|
2072
|
+
hasChildren(e) {
|
|
2073
|
+
this.childrenVersion;
|
|
2074
|
+
let t = this.childrenOfItem.get(e);
|
|
2075
|
+
return t ? !Array.isArray(t) || t.length > 0 : typeof e.children == "function" || (e.children?.length ?? 0) > 0;
|
|
2076
|
+
}
|
|
2077
|
+
countOf(e) {
|
|
2078
|
+
this.childrenVersion;
|
|
2079
|
+
let t = this.childrenOfItem.get(e);
|
|
2080
|
+
return e.count === void 0 ? Array.isArray(t) && typeof e.children == "function" ? t.length : Array.isArray(e.children) ? e.children.length : void 0 : e.count;
|
|
2081
|
+
}
|
|
2082
|
+
get columnLists() {
|
|
2083
|
+
let e = [this.topItems];
|
|
2084
|
+
for (let t of this.openPath) {
|
|
2085
|
+
let n = e.at(-1)?.find((e) => e.id === t);
|
|
2086
|
+
if (!n || !this.hasChildren(n)) break;
|
|
2087
|
+
let r = this.childrenOf(n);
|
|
2088
|
+
if (r?.length === 0 || (e.push(r), !r)) break;
|
|
2089
|
+
}
|
|
2090
|
+
return e;
|
|
2091
|
+
}
|
|
2092
|
+
shownIn(e, t) {
|
|
2093
|
+
let n = this.filterText;
|
|
2094
|
+
if (!n || t !== this.filteredColumn) return e;
|
|
2095
|
+
let r = this.openPath[t];
|
|
2096
|
+
return e.filter((e) => e.id === r || wordsOf(e).includes(n));
|
|
2097
|
+
}
|
|
2098
|
+
get selectedDepth() {
|
|
2099
|
+
let e = this.wentBack;
|
|
2100
|
+
return e && e.path === this.openPath ? e.depth : this.openPath.length - 1;
|
|
2101
|
+
}
|
|
2102
|
+
keyItemIn(e) {
|
|
2103
|
+
let t = this.shownIn(this.columnLists[e] ?? [], e);
|
|
2104
|
+
return t.find((t) => t.id === this.openPath[e]) ?? t[0];
|
|
2105
|
+
}
|
|
2106
|
+
rowClass(e) {}
|
|
2107
|
+
itemColumns() {
|
|
2108
|
+
let e = this;
|
|
2109
|
+
return A(O, {
|
|
2110
|
+
get each() {
|
|
2111
|
+
return e.columnLists;
|
|
2112
|
+
},
|
|
2113
|
+
keyed: !1,
|
|
2114
|
+
children: (t, n) => e.itemColumn(t, n)
|
|
2115
|
+
});
|
|
2116
|
+
}
|
|
2117
|
+
itemColumn(e, t) {
|
|
2118
|
+
let n = /* @__PURE__ */ i(() => this.shownIn(e() ?? [], t), "shown"), r = this;
|
|
2119
|
+
var a = Rt(), o = a.firstChild, s = o.nextSibling, c = s.nextSibling, l = c.nextSibling, u = l.nextSibling, d = u.nextSibling;
|
|
2120
|
+
return L(a, "data-depth", t), N(a, A(k, {
|
|
2121
|
+
get when() {
|
|
2122
|
+
return r.titleForColumn(t);
|
|
2123
|
+
},
|
|
2124
|
+
children: (e) => (() => {
|
|
2125
|
+
var t = zt();
|
|
2126
|
+
return N(t, e), j(() => r.partForName("column-title"), (e) => {
|
|
2127
|
+
L(t, "part", e);
|
|
2128
|
+
}), t;
|
|
2129
|
+
})()
|
|
2130
|
+
}), o), N(a, () => r.trackProbe(n), s), N(a, () => r.itemRows(n, t), c), N(a, A(k, {
|
|
2131
|
+
get when() {
|
|
2132
|
+
return !e();
|
|
2133
|
+
},
|
|
2134
|
+
get children() {
|
|
2135
|
+
var e = Ft(), t = e.firstChild;
|
|
2136
|
+
return t._$owner = M(), j(() => r.translationForKey("loading"), (e) => {
|
|
2137
|
+
L(t, "aria-label", e);
|
|
2138
|
+
}), e;
|
|
2139
|
+
}
|
|
2140
|
+
}), l), N(a, A(k, {
|
|
2141
|
+
get when() {
|
|
2142
|
+
return F(() => !(!e()?.length || n().length))() ? !(t === r.filteredColumn && r.hasOtherMatches) : !!e()?.length && !n().length;
|
|
2143
|
+
},
|
|
2144
|
+
get children() {
|
|
2145
|
+
var e = It(), t = e.firstChild;
|
|
2146
|
+
return t._$owner = M(), N(t, () => r.translationForKey("noMatches")), j(() => r.partForName("empty"), (t) => {
|
|
2147
|
+
L(e, "part", t);
|
|
2148
|
+
}), e;
|
|
2149
|
+
}
|
|
2150
|
+
}), u), N(a, A(k, {
|
|
2151
|
+
get when() {
|
|
2152
|
+
return F(() => t === r.filteredColumn)() && !!r.filter;
|
|
2153
|
+
},
|
|
2154
|
+
get children() {
|
|
2155
|
+
var e = Lt();
|
|
2156
|
+
return N(e, () => r.matchList()), e;
|
|
2157
|
+
}
|
|
2158
|
+
}), d), j(() => ({
|
|
2159
|
+
e: !!r.isNarrowColumn(t),
|
|
2160
|
+
t: !!r.isPeekColumn(t),
|
|
2161
|
+
a: r.isNarrowColumn(t) ? `${r.partForName("column")} ${r.partForName("narrow-column")}` : r.partForName("column"),
|
|
2162
|
+
o: r.titleForColumn(t),
|
|
2163
|
+
i: e() ? void 0 : "true",
|
|
2164
|
+
n: {
|
|
2165
|
+
width: r.columnWidthCSS(t),
|
|
2166
|
+
"margin-inline-end": r.peekMarginCSS(t),
|
|
2167
|
+
...r.textTracksCSS(t)
|
|
2168
|
+
}
|
|
2169
|
+
}), ({ e, t, a: n, o: r, i, n: o }, s) => {
|
|
2170
|
+
e !== s?.e && a.classList.toggle("narrow", e), t !== s?.t && a.classList.toggle("peek", t), n !== s?.a && L(a, "part", n), r !== s?.o && L(a, "aria-label", r), i !== s?.i && L(a, "aria-busy", i), _e(a, o, s?.n);
|
|
2171
|
+
}), a;
|
|
2172
|
+
}
|
|
2173
|
+
itemRows(e, t) {
|
|
2174
|
+
return drawnInWindow({
|
|
2175
|
+
items: e,
|
|
2176
|
+
drawItem: /* @__PURE__ */ i((e) => this.itemRow(e, t), "drawItem"),
|
|
2177
|
+
through: /* @__PURE__ */ i(() => {
|
|
2178
|
+
let n = e(), r = this.keyItemIn(t), i = this.openPath[t];
|
|
2179
|
+
return Math.max(r ? n.indexOf(r) : -1, n.findIndex((e) => e.id === i));
|
|
2180
|
+
}, "through")
|
|
2181
|
+
});
|
|
2182
|
+
}
|
|
2183
|
+
trackProbe(e) {
|
|
2184
|
+
let t = this;
|
|
2185
|
+
var n = Bt();
|
|
2186
|
+
return N(n, (() => {
|
|
2187
|
+
let n = e(), r = t.shows("icon") ? n.find((e) => e.icon)?.icon : void 0, i = (t.shows("count") ? n.map((e) => t.countOf(e) ?? "").map(String) : []).reduce((e, t) => t.length > e.length ? t : e, ""), a = t.shows("chevron") && n.some((e) => t.hasChildren(e));
|
|
2188
|
+
return [
|
|
2189
|
+
r && (() => {
|
|
2190
|
+
var e = q(), t = e.firstChild;
|
|
2191
|
+
return L(t, "name", r), t._$owner = M(), e;
|
|
2192
|
+
})(),
|
|
2193
|
+
i && (() => {
|
|
2194
|
+
var e = Vt();
|
|
2195
|
+
return N(e, i), e;
|
|
2196
|
+
})(),
|
|
2197
|
+
a && Ht()
|
|
2198
|
+
];
|
|
2199
|
+
})), n;
|
|
2200
|
+
}
|
|
2201
|
+
itemRow(e, t) {
|
|
2202
|
+
let n = /* @__PURE__ */ i(() => this.openPath[t] === e.id, "isPicked"), r = /* @__PURE__ */ i(() => n() && t === this.selectedDepth, "isSelected"), a = /* @__PURE__ */ i(() => !!this.filterText && t === this.filteredColumn && !wordsOf(e).includes(this.filterText), "isUnmatched"), o = (this.rowClass(e) ?? "").split(/\s+/).filter(Boolean), s = this;
|
|
2203
|
+
var c = Wt(), l = c.firstChild, u = l.firstChild, d = l.nextSibling, f = d.nextSibling;
|
|
2204
|
+
return c._$$click = (n) => s.pickItem(e, t, n), L(c, "aria-level", t + 1), N(c, A(k, {
|
|
2205
|
+
get when() {
|
|
2206
|
+
return F(() => !!s.shows("icon"))() ? e.icon : s.shows("icon");
|
|
2207
|
+
},
|
|
2208
|
+
children: (e) => (() => {
|
|
2209
|
+
var t = q(), n = t.firstChild;
|
|
2210
|
+
return n._$owner = M(), j(() => e(), (e) => {
|
|
2211
|
+
L(n, "name", e);
|
|
2212
|
+
}), t;
|
|
2213
|
+
})()
|
|
2214
|
+
}), l), N(u, () => e.label), N(l, A(k, {
|
|
2215
|
+
get when() {
|
|
2216
|
+
return F(() => !!s.shows("which"))() ? e.which : s.shows("which");
|
|
2217
|
+
},
|
|
2218
|
+
children: (e) => (() => {
|
|
2219
|
+
var t = Pt();
|
|
2220
|
+
return N(t, e), t;
|
|
2221
|
+
})()
|
|
2222
|
+
}), null), N(c, A(k, {
|
|
2223
|
+
get when() {
|
|
2224
|
+
return F(() => !!s.shows("count"))() ? s.countOf(e) !== void 0 : s.shows("count");
|
|
2225
|
+
},
|
|
2226
|
+
get children() {
|
|
2227
|
+
var t = Vt();
|
|
2228
|
+
return N(t, () => s.countOf(e)), t;
|
|
2229
|
+
}
|
|
2230
|
+
}), d), N(c, A(k, {
|
|
2231
|
+
get when() {
|
|
2232
|
+
return F(() => !!s.shows("chevron"))() ? s.hasChildren(e) : s.shows("chevron");
|
|
2233
|
+
},
|
|
2234
|
+
get children() {
|
|
2235
|
+
return Ut();
|
|
2236
|
+
}
|
|
2237
|
+
}), f), j(() => ({
|
|
2238
|
+
e: I([
|
|
2239
|
+
"column-row",
|
|
2240
|
+
...o,
|
|
2241
|
+
{
|
|
2242
|
+
selected: r(),
|
|
2243
|
+
"on-path": n() && !r(),
|
|
2244
|
+
unmatched: a()
|
|
2245
|
+
}
|
|
2246
|
+
]),
|
|
2247
|
+
t: s.partForName("column-row"),
|
|
2248
|
+
a: e.id,
|
|
2249
|
+
o: t === Math.max(0, s.selectedDepth) && s.keyItemIn(t) === e ? "0" : "-1",
|
|
2250
|
+
i: r() ? "true" : "false",
|
|
2251
|
+
n: s.hasChildren(e) ? n() ? "true" : "false" : void 0
|
|
2252
|
+
}), ({ e, t, a: n, o: r, i, n: a }, o) => {
|
|
2253
|
+
me(c, e, o?.e), t !== o?.t && L(c, "part", t), n !== o?.a && L(c, "data-id", n), r !== o?.o && L(c, "tabindex", r), i !== o?.i && L(c, "aria-selected", i), a !== o?.n && L(c, "aria-expanded", a);
|
|
2254
|
+
}), c;
|
|
2255
|
+
}
|
|
2256
|
+
pickItem(e, t, n, { keepsInside: r = !1, path: a } = {}) {
|
|
2257
|
+
let o = this.openPath[t] === e.id, s = a ?? (r && o ? this.openPath : [...this.openPath.slice(0, t), e.id]), c = s.slice(0, t + 1), l = /* @__PURE__ */ i(() => this.send("ui-selecting", {
|
|
2258
|
+
item: e,
|
|
2259
|
+
value: e.id,
|
|
2260
|
+
path: c,
|
|
2261
|
+
originalEvent: n
|
|
2262
|
+
}), "announce");
|
|
2263
|
+
if (!(x(s, this.openPath) ? l() : this.requestChange("openPath", s, l))) return;
|
|
2264
|
+
this.wentBack = t < this.openPath.length - 1 ? {
|
|
2265
|
+
depth: t,
|
|
2266
|
+
path: this.openPath
|
|
2267
|
+
} : void 0, this.keepPath();
|
|
2268
|
+
let u = {
|
|
2269
|
+
value: e.id,
|
|
2270
|
+
values: [e.id],
|
|
2271
|
+
item: e,
|
|
2272
|
+
path: c,
|
|
2273
|
+
originalEvent: n
|
|
2274
|
+
};
|
|
2275
|
+
this.send("ui-changed", u), this.settleSoon(u), r || this.showNewestColumn(), this.showPicks();
|
|
2276
|
+
}
|
|
2277
|
+
onItemKeyDown(e) {
|
|
2278
|
+
let t = e.composedPath()[0].closest?.("li[data-id]"), n = Number(t?.parentElement?.dataset.depth);
|
|
2279
|
+
if (!t || Number.isNaN(n)) return;
|
|
2280
|
+
let r = this.shownIn(this.columnLists[n] ?? [], n), a = r.findIndex((e) => e.id === t.dataset.id), o = r[a];
|
|
2281
|
+
if (!o) return;
|
|
2282
|
+
let s = /* @__PURE__ */ i((t, r = n, i = !1) => t ? (this.pickItem(t, r, e, { keepsInside: i }), !0) : !1, "pick"), c = /* @__PURE__ */ i((e) => {
|
|
2283
|
+
let t = r[Math.max(0, Math.min(r.length - 1, e))];
|
|
2284
|
+
return t === o || s(t);
|
|
2285
|
+
}, "moveTo"), l = /* @__PURE__ */ i(() => {
|
|
2286
|
+
if (this.openPath[n] !== o.id || !this.hasChildren(o)) return !1;
|
|
2287
|
+
let e = this.shownIn(this.childrenOf(o) ?? [], n + 1);
|
|
2288
|
+
return s(e.find((e) => e.id === this.openPath[n + 1]) ?? e[0], n + 1, !0);
|
|
2289
|
+
}, "goIn"), u = /* @__PURE__ */ i(() => {
|
|
2290
|
+
if (!n) return !1;
|
|
2291
|
+
let e = this.shownIn(this.columnLists[n - 1] ?? [], n - 1);
|
|
2292
|
+
return s(e.find((e) => e.id === this.openPath[n - 1]), n - 1, !0);
|
|
2293
|
+
}, "goOut"), d = {
|
|
2294
|
+
ArrowDown: /* @__PURE__ */ i(() => c(a + 1), "ArrowDown"),
|
|
2295
|
+
ArrowUp: /* @__PURE__ */ i(() => c(a - 1), "ArrowUp"),
|
|
2296
|
+
Home: /* @__PURE__ */ i(() => c(0), "Home"),
|
|
2297
|
+
End: /* @__PURE__ */ i(() => c(r.length - 1), "End"),
|
|
2298
|
+
ArrowRight: this.isRightToLeft ? u : l,
|
|
2299
|
+
ArrowLeft: this.isRightToLeft ? l : u,
|
|
2300
|
+
Enter: /* @__PURE__ */ i(() => s(o), "Enter"),
|
|
2301
|
+
" ": /* @__PURE__ */ i(() => s(o), " ")
|
|
2302
|
+
}[e.key];
|
|
2303
|
+
d && (e.preventDefault(), d() && h(() => this.focusKeyRow()));
|
|
2304
|
+
}
|
|
2305
|
+
focusKeyRow() {
|
|
2306
|
+
let e = Math.max(0, this.selectedDepth), t = this.keyItemIn(e)?.id;
|
|
2307
|
+
if (t === void 0) return;
|
|
2308
|
+
let n = this.domElement.renderRoot.querySelector(`ul[data-depth="${e}"]`), r = n?.querySelector(`li[data-id="${CSS.escape(t)}"]`);
|
|
2309
|
+
r?.focus({ preventScroll: !0 }), r && n && revealIn(n, r);
|
|
2310
|
+
}
|
|
2311
|
+
onOpenPathChanged() {
|
|
2312
|
+
this.isColumns && this.isReady && (this.showColumn(this.selectedColumn), this.hasItemData && this.showPicks());
|
|
2313
|
+
}
|
|
2314
|
+
showPicks() {
|
|
2315
|
+
P || _(() => {
|
|
2316
|
+
for (let e of this.domElement.renderRoot.querySelectorAll("ul.column")) {
|
|
2317
|
+
let t = e.querySelector("li.selected, li.on-path");
|
|
2318
|
+
t && revealIn(e, t);
|
|
2319
|
+
}
|
|
2320
|
+
});
|
|
2321
|
+
}
|
|
858
2322
|
};
|
|
859
|
-
|
|
2323
|
+
Y = n(J), Zn = /* @__PURE__ */ new WeakMap(), Qn = /* @__PURE__ */ new WeakMap(), $n = /* @__PURE__ */ new WeakMap(), er = /* @__PURE__ */ new WeakMap(), tr = /* @__PURE__ */ new WeakMap(), nr = /* @__PURE__ */ new WeakMap(), rr = /* @__PURE__ */ new WeakMap(), ir = /* @__PURE__ */ new WeakMap(), ar = /* @__PURE__ */ new WeakMap(), or = /* @__PURE__ */ new WeakMap(), sr = /* @__PURE__ */ new WeakMap(), cr = /* @__PURE__ */ new WeakMap(), lr = /* @__PURE__ */ new WeakMap(), ur = /* @__PURE__ */ new WeakMap(), dr = /* @__PURE__ */ new WeakMap(), fr = /* @__PURE__ */ new WeakMap(), pr = /* @__PURE__ */ new WeakMap(), mr = /* @__PURE__ */ new WeakMap(), hr = /* @__PURE__ */ new WeakMap(), gr = /* @__PURE__ */ new WeakMap(), _r = /* @__PURE__ */ new WeakMap(), vr = /* @__PURE__ */ new WeakMap(), yr = /* @__PURE__ */ new WeakMap(), br = /* @__PURE__ */ new WeakMap(), xr = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), Sr = /* @__PURE__ */ new WeakMap(), Cr = /* @__PURE__ */ new WeakMap(), u(Y, 4, "hasNoMatches", Jn, Z, Zn), u(Y, 2, "isFiltering", qn, Z), u(Y, 2, "ariaIsMany", Kn, Z), u(Y, 2, "ariaName", Gn, Z), u(Y, 2, "isColumns", Wn, Z), u(Y, 4, "pathFolded", Un, Z, Qn), u(Y, 4, "treeWidthPx", Hn, Z, $n), u(Y, 1, "watchTreeWidth", Vn, Z), u(Y, 1, "onPathLineChanged", Bn, Z), u(Y, 1, "onClicked", zn, Z), u(Y, 4, "openPath", Rn, Z, er), u(Y, 1, "onPathChanged", Ln, Z), u(Y, 4, "rowsVersion", In, Z, tr), u(Y, 2, "toolsElement", Fn, Z), u(Y, 1, "onCanRoveChanged", Pn, Z), u(Y, 1, "onKeyDown", Nn, Z), u(Y, 2, "columnSizes", Mn, Z), u(Y, 4, "columnWidths", jn, Z, nr), u(Y, 4, "everyColumnWidth", An, Z, rr), u(Y, 4, "fitWidths", kn, Z, ir), u(Y, 4, "defaultWidthPx", On, Z, ar), u(Y, 4, "emPx", Dn, Z, or), u(Y, 4, "remPx", En, Z, sr), u(Y, 4, "isResizing", Tn, Z, cr), u(Y, 1, "onConnectedInColumns", wn, Z), u(Y, 1, "onFitKeyChanged", Cn, Z), u(Y, 4, "textTracks", Sn, Z, lr), u(Y, 1, "onTextTrackSourcesChanged", xn, Z), u(Y, 2, "detailElement", bn, Z), u(Y, 4, "detailWidth", yn, Z, ur), u(Y, 4, "detailWidthPx", vn, Z, dr), u(Y, 1, "onDetailItemChanged", _n, Z), u(Y, 1, "onDetailSizeChanged", gn, Z), u(Y, 4, "boxWidthPx", hn, Z, fr), u(Y, 4, "narrowWidthPx", mn, Z, pr), u(Y, 4, "hoveredColumn", pn, Z, mr), u(Y, 4, "focusedColumn", fn, Z, hr), u(Y, 1, "watchBoxWidth", dn, Z), u(Y, 1, "onPointerOver", un, Z), u(Y, 1, "onPointerLeft", ln, Z), u(Y, 1, "onFocusIn", cn, Z), u(Y, 1, "onFocusOut", sn, Z), u(Y, 1, "onNarrowColumnsChanged", on, Z), u(Y, 4, "pathRows", an, Z, gr), u(Y, 1, "watchScrolling", rn, Z), u(Y, 1, "onFilterChanged", nn, Z), u(Y, 4, "hadFilter", tn, Z, _r), u(Y, 4, "filterColumn", en, Z, vr), u(Y, 1, "onFilterBaseChanged", $t, Z), u(Y, 1, "onRowsChanged", Qt, Z), u(Y, 4, "otherMatches", Zt, Z, yr), u(Y, 4, "otherMatchCount", Xt, Z, br), u(Y, 4, "isLooking", Yt, Z, xr), u(Y, 4, "didStopLooking", Jt, Z, X), u(Y, 4, "childrenVersion", qt, Z, Sr), u(Y, 4, "wentBack", Kt, Z, Cr), u(Y, 1, "onOpenPathChanged", Gt, Z), u(Y, 13, "vocabulary", Xn, Z), u(Y, 13, "elementSetup", Yn, Z), f(Y, Z), i(Z, "UITree"), r(Z, "vocabulary", p(Y, 120, Z, we)), p(Y, 123, Z), r(Z, "elementSetup", p(Y, 124, Z, {
|
|
860
2324
|
styleSheets: {
|
|
861
|
-
tree:
|
|
862
|
-
columns:
|
|
2325
|
+
tree: De,
|
|
2326
|
+
columns: Oe
|
|
863
2327
|
},
|
|
864
2328
|
delegatesFocus: !1,
|
|
865
|
-
aria: { role: "tree" }
|
|
866
|
-
|
|
867
|
-
|
|
2329
|
+
aria: { role: "tree" },
|
|
2330
|
+
DOMElement: DOMTreeElement
|
|
2331
|
+
})), p(Y, 127, Z), r(Z, "madeStore");
|
|
2332
|
+
var wr = Z;
|
|
2333
|
+
function trimmedWidths(e) {
|
|
2334
|
+
let t = [...e];
|
|
2335
|
+
for (; t.length && t.at(-1) === void 0;) t.pop();
|
|
2336
|
+
return t;
|
|
2337
|
+
}
|
|
2338
|
+
i(trimmedWidths, "trimmedWidths");
|
|
2339
|
+
function wordsOf(e) {
|
|
2340
|
+
return `${e.label} ${e.which ?? ""}`.toLowerCase();
|
|
2341
|
+
}
|
|
2342
|
+
i(wordsOf, "wordsOf");
|
|
2343
|
+
function isMatchClick(e) {
|
|
2344
|
+
return e.composedPath().some((e) => e.classList?.contains("match"));
|
|
2345
|
+
}
|
|
2346
|
+
i(isMatchClick, "isMatchClick");
|
|
2347
|
+
function foldedNamesFor(e, { current: t, room: n, separator: r, folded: i, least: a, fewest: o }) {
|
|
2348
|
+
for (let s = 0; s < t; s++) {
|
|
2349
|
+
let c = e.slice(s), l = c.length + +!!s, u = c.reduce((e, t) => e + t, 0) + (s ? i : 0) + (l - 1) * r - n, d = !0;
|
|
2350
|
+
for (let e = 0; e < c.length; e++) {
|
|
2351
|
+
if (s + e === t) continue;
|
|
2352
|
+
let n = c[e], r = Math.min(Math.max(u, 0), Math.max(0, n - a));
|
|
2353
|
+
u -= r, n - r < Math.min(n, o) && (d = !1);
|
|
2354
|
+
}
|
|
2355
|
+
if (d) return s;
|
|
2356
|
+
}
|
|
2357
|
+
return Math.max(0, t);
|
|
2358
|
+
}
|
|
2359
|
+
i(foldedNamesFor, "foldedNamesFor");
|
|
868
2360
|
function rowBoxOf(e) {
|
|
869
2361
|
return (e.domElement.renderRoot.querySelector(".row") ?? e.domElement).getBoundingClientRect();
|
|
870
2362
|
}
|
|
871
|
-
|
|
872
|
-
|
|
2363
|
+
i(rowBoxOf, "rowBoxOf");
|
|
2364
|
+
function revealIn(e, t) {
|
|
2365
|
+
let { offsetTop: n, offsetHeight: r } = t, i = e.querySelector(".column-title")?.offsetHeight ?? 0;
|
|
2366
|
+
n - i < e.scrollTop ? e.scrollTop = n - i : n + r > e.scrollTop + e.clientHeight && (e.scrollTop = n + r - e.clientHeight);
|
|
2367
|
+
}
|
|
2368
|
+
i(revealIn, "revealIn");
|
|
2369
|
+
var Tr = "…", Er = " › ", Dr = 1.5, Or = 2.4, kr = [2, 3], Ar = 200, Q = 1e5, jr = "many", Mr = .3, Nr = "columns", Pr = "var(--_ui-tree-column-width)", Fr = "var(--_ui-tree-narrow-width)", Ir = "ui-tree", Lr = "widths:", Rr = "path:", zr = "ui-tree-item[open], ui-tree-item[selected]", Br = "ui-tree-column-widths", Vr = 16, Hr = 3, $ = 80, Ur = 16, Wr = 10, Gr = {
|
|
873
2370
|
ArrowLeft: -1,
|
|
874
2371
|
ArrowRight: 1
|
|
875
2372
|
};
|
|
876
|
-
|
|
2373
|
+
he([
|
|
877
2374
|
"click",
|
|
878
2375
|
"pointerdown",
|
|
879
2376
|
"keydown",
|
|
880
2377
|
"dblclick"
|
|
881
|
-
]),
|
|
882
|
-
export {
|
|
2378
|
+
]), wr.define(), K.define();
|
|
2379
|
+
export { DOMTreeElement, wr as UITree, K as UITreeItem };
|
|
883
2380
|
|
|
884
2381
|
//# sourceMappingURL=ui-tree.js.map
|