@vokril/ui-solid 0.19.1 → 0.20.1
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/CHANGELOG.md +14 -0
- package/README.md +38 -2
- package/dist/createResizableSidebar-CeksJQ9Q.cjs +1 -0
- package/dist/createResizableSidebar-DnHgvr7P.js +472 -0
- package/dist/createVirtualWindow-C8_UuF7B.cjs +1 -0
- package/dist/createVirtualWindow-CGPw2jm_.js +121 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +108 -104
- package/dist/layout/createVirtualScroller.d.cts +8 -31
- package/dist/layout/createVirtualScroller.d.ts +8 -31
- package/dist/layout/createVirtualWindow.d.cts +66 -0
- package/dist/layout/createVirtualWindow.d.ts +66 -0
- package/dist/layout/index.cjs +1 -1
- package/dist/layout/index.d.cts +2 -0
- package/dist/layout/index.d.ts +2 -0
- package/dist/layout/index.js +7 -6
- package/dist/layout/virtualScrollerUtils.d.cts +58 -22
- package/dist/layout/virtualScrollerUtils.d.ts +58 -22
- package/dist/rowSource-CfGSdY64.js +1236 -0
- package/dist/rowSource-D0MM14Bu.cjs +1 -0
- package/dist/server/createResizableSidebar-B0NDaq7D.cjs +1 -0
- package/dist/server/createResizableSidebar-Dn9UMUf_.js +310 -0
- package/dist/server/createVirtualWindow-C8_UuF7B.cjs +1 -0
- package/dist/server/createVirtualWindow-CGPw2jm_.js +121 -0
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.js +110 -106
- package/dist/server/layout/index.cjs +1 -1
- package/dist/server/layout/index.js +7 -6
- package/dist/server/rowSource-BGuQROhJ.js +1122 -0
- package/dist/server/rowSource-IX742JOS.cjs +1 -0
- package/dist/server/tree/index.cjs +1 -1
- package/dist/server/tree/index.js +11 -8
- package/dist/solid/layout/createVirtualScroller.js +17 -100
- package/dist/solid/layout/createVirtualWindow.js +142 -0
- package/dist/solid/layout/index.js +1 -0
- package/dist/solid/layout/virtualScrollerUtils.js +31 -32
- package/dist/solid/tree/TreeSurface.jsx +20 -13
- package/dist/solid/tree/createTreeController.js +110 -62
- package/dist/solid/tree/createTreeSurface.js +29 -12
- package/dist/solid/tree/index.js +1 -0
- package/dist/solid/tree/rowSource.js +93 -0
- package/dist/solid/tree/selectAllInScope.js +31 -25
- package/dist/solid/tree/stickyScroll.js +12 -10
- package/dist/solid/tree/treeAria.js +11 -30
- package/dist/solid/tree/treeKeymap.js +2 -24
- package/dist/solid/tree/viewportAnchor.js +23 -0
- package/dist/style.css +1 -1
- package/dist/tree/TreeStickyHeader.d.cts +1 -1
- package/dist/tree/TreeStickyHeader.d.ts +1 -1
- package/dist/tree/TreeSurface.d.cts +1 -1
- package/dist/tree/TreeSurface.d.ts +1 -1
- package/dist/tree/createTreeController.d.cts +19 -8
- package/dist/tree/createTreeController.d.ts +19 -8
- package/dist/tree/createTreeSurface.d.cts +8 -3
- package/dist/tree/createTreeSurface.d.ts +8 -3
- package/dist/tree/descriptor.d.cts +8 -9
- package/dist/tree/descriptor.d.ts +8 -9
- package/dist/tree/index.cjs +1 -1
- package/dist/tree/index.d.cts +1 -0
- package/dist/tree/index.d.ts +1 -0
- package/dist/tree/index.js +11 -8
- package/dist/tree/rowSource.d.cts +41 -0
- package/dist/tree/rowSource.d.ts +41 -0
- package/dist/tree/selectAllInScope.d.cts +20 -2
- package/dist/tree/selectAllInScope.d.ts +20 -2
- package/dist/tree/stickyScroll.d.cts +32 -5
- package/dist/tree/stickyScroll.d.ts +32 -5
- package/dist/tree/treeAria.d.cts +26 -10
- package/dist/tree/treeAria.d.ts +26 -10
- package/dist/tree/treeKeymap.d.cts +2 -16
- package/dist/tree/treeKeymap.d.ts +2 -16
- package/dist/tree/viewportAnchor.d.cts +21 -0
- package/dist/tree/viewportAnchor.d.ts +21 -0
- package/dist/ui.css +1 -1
- package/package.json +1 -1
- package/dist/createResizableSidebar-Dau7TIuH.cjs +0 -1
- package/dist/createResizableSidebar-gvf9me4K.js +0 -449
- package/dist/createVirtualScroller-CL49JE2P.cjs +0 -1
- package/dist/createVirtualScroller-vu-l4rVv.js +0 -93
- package/dist/descriptor-CaHgh9N_.cjs +0 -1
- package/dist/descriptor-eGtcBtpI.js +0 -1106
- package/dist/server/createResizableSidebar-BQG5elmd.js +0 -287
- package/dist/server/createResizableSidebar-tU8FO2MK.cjs +0 -1
- package/dist/server/createVirtualScroller-CL49JE2P.cjs +0 -1
- package/dist/server/createVirtualScroller-vu-l4rVv.js +0 -93
- package/dist/server/descriptor-CEGvvJZh.cjs +0 -1
- package/dist/server/descriptor-GLoKPx6x.js +0 -992
|
@@ -1,1106 +0,0 @@
|
|
|
1
|
-
import { createComponent as b, insert as I, effect as G, className as E, memo as z, spread as le, mergeProps as ie, setStyleProperty as Y, template as L, use as ue, delegateEvents as ye, setAttribute as me } from "solid-js/web";
|
|
2
|
-
import { createMemo as Q, Show as P, For as Se, createEffect as ke, Index as se, createSignal as X, onCleanup as xe, useContext as Ce } from "solid-js";
|
|
3
|
-
import { VpLoader2 as be, VpChevronRight as Re, VpSearch as Te } from "@vokril/icons";
|
|
4
|
-
import { O as _e } from "./OverlayScrollArea-c8Za77qs.js";
|
|
5
|
-
import { t as Ae } from "./i18n-DW9kcu0G.js";
|
|
6
|
-
import { c as Ie } from "./errorHandler-BvPGW-Nm.js";
|
|
7
|
-
import { i as de, n as Me } from "./keys-B2nlkpqc.js";
|
|
8
|
-
import { a as De } from "./useListCommands-BO_XrRHj.js";
|
|
9
|
-
import { a as Ee } from "./builtins-XOM9gfIx.js";
|
|
10
|
-
import { c as $e } from "./createVirtualScroller-vu-l4rVv.js";
|
|
11
|
-
import { D as Ke } from "./DesktopContextMenuContext-DJ3PnqAv.js";
|
|
12
|
-
import { B as Ge } from "./bugIndicatingError-h3J5qkL6.js";
|
|
13
|
-
const he = {
|
|
14
|
-
canExpand: !0,
|
|
15
|
-
canMultiSelect: !0,
|
|
16
|
-
canTypeAhead: !0,
|
|
17
|
-
canRename: !1,
|
|
18
|
-
canDestroy: !1,
|
|
19
|
-
expandAll: !1
|
|
20
|
-
};
|
|
21
|
-
function fe(e, a) {
|
|
22
|
-
return `${e}-row-${a}`;
|
|
23
|
-
}
|
|
24
|
-
function He(e) {
|
|
25
|
-
const { treeId: a, label: n, multiSelectable: t, focusMode: o, cursorKey: c } = e;
|
|
26
|
-
return {
|
|
27
|
-
role: e.flat === !0 ? "listbox" : "tree",
|
|
28
|
-
// With roving tabindex the container yields its tab stop to the cursor row
|
|
29
|
-
// once there is one; with active-descendant the container IS the tab stop.
|
|
30
|
-
tabIndex: o === "active-descendant" || c === null ? 0 : -1,
|
|
31
|
-
"aria-label": n,
|
|
32
|
-
"aria-multiselectable": t ? !0 : void 0,
|
|
33
|
-
"aria-activedescendant": o === "active-descendant" && c !== null ? fe(a, c) : void 0
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
function Oe(e) {
|
|
37
|
-
const { treeId: a, rows: n, index: t, focusMode: o, isCursor: c, isSelected: r } = e, i = n[t], u = e.flat === !0;
|
|
38
|
-
let d = t;
|
|
39
|
-
for (let m = t - 1; m >= 0; m--) {
|
|
40
|
-
const $ = n[m].depth;
|
|
41
|
-
if ($ < i.depth) break;
|
|
42
|
-
$ === i.depth && (d = m);
|
|
43
|
-
}
|
|
44
|
-
let h = t;
|
|
45
|
-
for (let m = t + 1; m < n.length; m++) {
|
|
46
|
-
const $ = n[m].depth;
|
|
47
|
-
if ($ < i.depth) break;
|
|
48
|
-
$ === i.depth && (h = m);
|
|
49
|
-
}
|
|
50
|
-
let S = 0, A = 0;
|
|
51
|
-
for (let m = d; m <= h; m++)
|
|
52
|
-
n[m].depth === i.depth && (S++, m <= t && A++);
|
|
53
|
-
return {
|
|
54
|
-
role: u ? "option" : "treeitem",
|
|
55
|
-
id: fe(a, i.key),
|
|
56
|
-
tabIndex: o === "roving-tabindex" && c ? 0 : -1,
|
|
57
|
-
// A listbox option has no level, and no expanded state to advertise.
|
|
58
|
-
"aria-level": u ? void 0 : i.depth + 1,
|
|
59
|
-
"aria-setsize": S,
|
|
60
|
-
"aria-posinset": A,
|
|
61
|
-
"aria-selected": r,
|
|
62
|
-
"aria-expanded": !u && i.expandable ? i.expanded : void 0,
|
|
63
|
-
// Announced while the row is fetching its children — silence is what a
|
|
64
|
-
// screen-reader user got before, for as long as the query took.
|
|
65
|
-
"aria-busy": i.busy === !0 ? !0 : void 0
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
const Pe = /[\^$.*+?(){}|[\]\\]/;
|
|
69
|
-
function Le(e) {
|
|
70
|
-
const a = e.trim();
|
|
71
|
-
if (a.length === 0) return null;
|
|
72
|
-
if (Pe.test(a))
|
|
73
|
-
try {
|
|
74
|
-
const t = new RegExp(a, "gi");
|
|
75
|
-
return (o) => Fe(o, t);
|
|
76
|
-
} catch (t) {
|
|
77
|
-
Ie("fall through to substring", t);
|
|
78
|
-
}
|
|
79
|
-
const n = a.toLowerCase();
|
|
80
|
-
return (t) => Ne(t, n, a.length);
|
|
81
|
-
}
|
|
82
|
-
function Fe(e, a) {
|
|
83
|
-
a.lastIndex = 0;
|
|
84
|
-
const n = [];
|
|
85
|
-
let t = 0, o;
|
|
86
|
-
for (; (o = a.exec(e)) !== null; )
|
|
87
|
-
o.index > t && n.push({ text: e.slice(t, o.index), match: !1 }), n.push({ text: o[0], match: !0 }), t = o.index + o[0].length, o[0].length === 0 && (a.lastIndex += 1);
|
|
88
|
-
return t < e.length && n.push({ text: e.slice(t), match: !1 }), n.length > 0 ? n : [{ text: e, match: !1 }];
|
|
89
|
-
}
|
|
90
|
-
function Ne(e, a, n) {
|
|
91
|
-
if (n === 0) return [{ text: e, match: !1 }];
|
|
92
|
-
const t = e.toLowerCase(), o = [];
|
|
93
|
-
let c = 0;
|
|
94
|
-
for (; c <= e.length; ) {
|
|
95
|
-
const r = t.indexOf(a, c);
|
|
96
|
-
if (r === -1) {
|
|
97
|
-
c < e.length && o.push({ text: e.slice(c), match: !1 });
|
|
98
|
-
break;
|
|
99
|
-
}
|
|
100
|
-
r > c && o.push({ text: e.slice(c, r), match: !1 }), o.push({ text: e.slice(r, r + n), match: !0 }), c = r + n;
|
|
101
|
-
}
|
|
102
|
-
return o.length > 0 ? o : [{ text: e, match: !1 }];
|
|
103
|
-
}
|
|
104
|
-
const Be = "vk_treeStickyHost_6aT7a", Ue = "vk_treeViewport_Ku3yB", Qe = "vk_treeContainer_iMrOQ", qe = "vk_treeSlice_homAf", Ve = "vk_treeRow_Hh9r0", We = "vk_treeRowCursor_QlUrp", Ye = "vk_treeRowSelected_UdZj-", ze = "vk_treeIndentGuides_W4J04", Xe = "vk_treeIndentGuideActive_9m4l3", Ze = "vk_treeRowChevron_6WMjE", je = "vk_treeRowChevronSpacer_Jbp-q", Je = "vk_treeRowChevronIcon_KP24Y", pe = "vk_treeRowChevronIconOpen_fRKNn", et = "vk_treeRowContent_RR7pP", tt = "vk_treeRowActions_LYQUv", nt = "vk_treeEmpty_s8RQ-", rt = "vk_treeRowChevronBusy_lZT8a", ot = "vk_treeSpeedSearchBadge_9GHNi", at = "vk_treeSpeedSearchIcon_48Ae2", ct = "vk_treeSpeedSearchText_F4SZ8", lt = "vk_treeMatchHighlight_NY75y", C = {
|
|
105
|
-
treeStickyHost: Be,
|
|
106
|
-
treeViewport: Ue,
|
|
107
|
-
treeContainer: Qe,
|
|
108
|
-
treeSlice: qe,
|
|
109
|
-
treeRow: Ve,
|
|
110
|
-
treeRowCursor: We,
|
|
111
|
-
treeRowSelected: Ye,
|
|
112
|
-
treeIndentGuides: ze,
|
|
113
|
-
treeIndentGuideActive: Xe,
|
|
114
|
-
treeRowChevron: Ze,
|
|
115
|
-
treeRowChevronSpacer: je,
|
|
116
|
-
treeRowChevronIcon: Je,
|
|
117
|
-
treeRowChevronIconOpen: pe,
|
|
118
|
-
treeRowContent: et,
|
|
119
|
-
treeRowActions: tt,
|
|
120
|
-
treeEmpty: nt,
|
|
121
|
-
treeRowChevronBusy: rt,
|
|
122
|
-
treeSpeedSearchBadge: ot,
|
|
123
|
-
treeSpeedSearchIcon: at,
|
|
124
|
-
treeSpeedSearchText: ct,
|
|
125
|
-
treeMatchHighlight: lt
|
|
126
|
-
};
|
|
127
|
-
var it = /* @__PURE__ */ L("<span aria-hidden=true tabindex=-1>"), J = /* @__PURE__ */ L("<span aria-hidden=true>"), ut = /* @__PURE__ */ L("<span tabindex=-1>"), st = /* @__PURE__ */ L("<div><span>"), dt = /* @__PURE__ */ L("<mark>");
|
|
128
|
-
function ht(e) {
|
|
129
|
-
return e.ctrlKey || e.metaKey ? "toggle" : e.shiftKey ? "range" : "replace";
|
|
130
|
-
}
|
|
131
|
-
function ge(e) {
|
|
132
|
-
let a;
|
|
133
|
-
ke(() => {
|
|
134
|
-
if (e.sticky === !0 || !e.isCursor || !e.treeHasFocus()) return;
|
|
135
|
-
const t = a;
|
|
136
|
-
!t || t.contains(t.ownerDocument.activeElement) || queueMicrotask(() => t.focus({
|
|
137
|
-
preventScroll: !0
|
|
138
|
-
}));
|
|
139
|
-
});
|
|
140
|
-
const n = () => b(P, {
|
|
141
|
-
get when() {
|
|
142
|
-
return e.row.expandable;
|
|
143
|
-
},
|
|
144
|
-
get fallback() {
|
|
145
|
-
return (() => {
|
|
146
|
-
var t = J();
|
|
147
|
-
return G(() => E(t, C.treeRowChevronSpacer)), t;
|
|
148
|
-
})();
|
|
149
|
-
},
|
|
150
|
-
get children() {
|
|
151
|
-
var t = it();
|
|
152
|
-
return t.$$dblclick = (o) => o.stopPropagation(), t.$$keydown = (o) => {
|
|
153
|
-
(de(o, "Enter") || o.key === " ") && (o.stopPropagation(), e.onToggle(e.row));
|
|
154
|
-
}, t.$$click = (o) => {
|
|
155
|
-
o.stopPropagation(), e.onToggle(e.row);
|
|
156
|
-
}, I(t, b(P, {
|
|
157
|
-
get when() {
|
|
158
|
-
return e.row.busy;
|
|
159
|
-
},
|
|
160
|
-
get fallback() {
|
|
161
|
-
return b(Re, {
|
|
162
|
-
get class() {
|
|
163
|
-
return `${C.treeRowChevronIcon} ${e.row.expanded ? C.treeRowChevronIconOpen : ""}`;
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
},
|
|
167
|
-
get children() {
|
|
168
|
-
return b(be, {
|
|
169
|
-
"data-motion-exempt": "true",
|
|
170
|
-
get class() {
|
|
171
|
-
return `${C.treeRowChevronIcon} ${C.treeRowChevronBusy}`;
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
})), G(() => E(t, C.treeRowChevron)), t;
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
return (() => {
|
|
179
|
-
var t = st(), o = t.firstChild, c = a;
|
|
180
|
-
return typeof c == "function" ? ue(c, t) : a = t, le(t, ie({
|
|
181
|
-
get tabIndex() {
|
|
182
|
-
return e.sticky === !0 ? -1 : 0;
|
|
183
|
-
}
|
|
184
|
-
}, () => e.sticky === !0 ? {
|
|
185
|
-
tabIndex: -1
|
|
186
|
-
} : e.aria, {
|
|
187
|
-
get onKeyDown() {
|
|
188
|
-
var r;
|
|
189
|
-
return (r = e.dom) == null ? void 0 : r.onKeyDown;
|
|
190
|
-
},
|
|
191
|
-
get class() {
|
|
192
|
-
var r;
|
|
193
|
-
return `${C.treeRow} ${((r = e.dom) == null ? void 0 : r.class) ?? ""}`;
|
|
194
|
-
},
|
|
195
|
-
get classList() {
|
|
196
|
-
return {
|
|
197
|
-
[C.treeRowCursor]: e.isCursor,
|
|
198
|
-
[C.treeRowSelected]: e.isSelected
|
|
199
|
-
};
|
|
200
|
-
},
|
|
201
|
-
get style() {
|
|
202
|
-
return {
|
|
203
|
-
height: `${e.rowHeight}px`,
|
|
204
|
-
// Depth travels as a CSS variable so indent stays ONE formula in the
|
|
205
|
-
// stylesheet. Four surfaces used to hardcode it four different ways.
|
|
206
|
-
"--tree-depth": String(e.row.depth)
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
}, () => e.sticky === !0 ? {
|
|
210
|
-
"data-tree-sticky-key": e.row.key
|
|
211
|
-
} : {
|
|
212
|
-
"data-tree-row-key": e.row.key
|
|
213
|
-
}, () => {
|
|
214
|
-
var r;
|
|
215
|
-
return ((r = e.dom) == null ? void 0 : r.title) !== void 0 ? {
|
|
216
|
-
title: e.dom.title
|
|
217
|
-
} : {};
|
|
218
|
-
}, () => {
|
|
219
|
-
var r;
|
|
220
|
-
return ((r = e.dom) == null ? void 0 : r.draggable) !== void 0 ? {
|
|
221
|
-
draggable: e.dom.draggable
|
|
222
|
-
} : {};
|
|
223
|
-
}, () => {
|
|
224
|
-
var r;
|
|
225
|
-
return (r = e.dom) != null && r.onDragStart ? {
|
|
226
|
-
onDragStart: e.dom.onDragStart
|
|
227
|
-
} : {};
|
|
228
|
-
}, () => {
|
|
229
|
-
var r;
|
|
230
|
-
return (r = e.dom) != null && r.onDragOver ? {
|
|
231
|
-
onDragOver: e.dom.onDragOver
|
|
232
|
-
} : {};
|
|
233
|
-
}, () => {
|
|
234
|
-
var r;
|
|
235
|
-
return (r = e.dom) != null && r.onDragLeave ? {
|
|
236
|
-
onDragLeave: e.dom.onDragLeave
|
|
237
|
-
} : {};
|
|
238
|
-
}, () => {
|
|
239
|
-
var r;
|
|
240
|
-
return (r = e.dom) != null && r.onDrop ? {
|
|
241
|
-
onDrop: e.dom.onDrop
|
|
242
|
-
} : {};
|
|
243
|
-
}, () => {
|
|
244
|
-
var r;
|
|
245
|
-
return (r = e.dom) != null && r.onDragEnd ? {
|
|
246
|
-
onDragEnd: e.dom.onDragEnd
|
|
247
|
-
} : {};
|
|
248
|
-
}, () => {
|
|
249
|
-
var r;
|
|
250
|
-
return (r = e.dom) != null && r.onMouseEnter ? {
|
|
251
|
-
onMouseEnter: e.dom.onMouseEnter
|
|
252
|
-
} : {};
|
|
253
|
-
}, () => {
|
|
254
|
-
var r;
|
|
255
|
-
return (r = e.dom) != null && r.onMouseLeave ? {
|
|
256
|
-
onMouseLeave: e.dom.onMouseLeave
|
|
257
|
-
} : {};
|
|
258
|
-
}, {
|
|
259
|
-
onMouseDown: (r) => {
|
|
260
|
-
if (r.button === 2) {
|
|
261
|
-
e.isSelected ? e.onFocusRow(e.index) : e.onSelect(e.index, "replace");
|
|
262
|
-
return;
|
|
263
|
-
}
|
|
264
|
-
r.button === 0 && e.onSelect(e.index, ht(r));
|
|
265
|
-
},
|
|
266
|
-
onClick: (r) => e.onActivateClick(e.row, "single-click", r),
|
|
267
|
-
onDblClick: (r) => e.onActivateClick(e.row, "double-click", r),
|
|
268
|
-
onContextMenu: (r) => {
|
|
269
|
-
r.preventDefault(), r.stopPropagation(), e.onOpenMenu(e.row, r);
|
|
270
|
-
}
|
|
271
|
-
}), !1, !0), I(t, b(P, {
|
|
272
|
-
get when() {
|
|
273
|
-
return z(() => e.indentGuide !== "none")() && e.row.depth > 0;
|
|
274
|
-
},
|
|
275
|
-
get children() {
|
|
276
|
-
var r = J();
|
|
277
|
-
return G(() => E(r, C.treeIndentGuides)), r;
|
|
278
|
-
}
|
|
279
|
-
}), o), I(t, b(P, {
|
|
280
|
-
get when() {
|
|
281
|
-
return z(() => e.indentGuide === "active" && e.activeGuideDepth >= 0)() && e.row.depth > e.activeGuideDepth;
|
|
282
|
-
},
|
|
283
|
-
get children() {
|
|
284
|
-
var r = J();
|
|
285
|
-
return G((i) => {
|
|
286
|
-
var u = C.treeIndentGuideActive, d = `${e.activeGuideDepth}`;
|
|
287
|
-
return u !== i.e && E(r, i.e = u), d !== i.t && Y(r, "--tree-active-col", i.t = d), i;
|
|
288
|
-
}, {
|
|
289
|
-
e: void 0,
|
|
290
|
-
t: void 0
|
|
291
|
-
}), r;
|
|
292
|
-
}
|
|
293
|
-
}), o), I(t, b(P, {
|
|
294
|
-
get when() {
|
|
295
|
-
return e.showChevronGutter;
|
|
296
|
-
},
|
|
297
|
-
get children() {
|
|
298
|
-
return n();
|
|
299
|
-
}
|
|
300
|
-
}), o), I(o, () => e.content), I(t, b(P, {
|
|
301
|
-
get when() {
|
|
302
|
-
return e.actions;
|
|
303
|
-
},
|
|
304
|
-
get children() {
|
|
305
|
-
var r = ut();
|
|
306
|
-
return r.$$dblclick = (i) => i.stopPropagation(), r.$$keydown = (i) => i.stopPropagation(), r.$$click = (i) => i.stopPropagation(), I(r, () => e.actions), G(() => E(r, C.treeRowActions)), r;
|
|
307
|
-
}
|
|
308
|
-
}), null), G(() => E(o, C.treeRowContent)), t;
|
|
309
|
-
})();
|
|
310
|
-
}
|
|
311
|
-
function jt(e) {
|
|
312
|
-
const a = () => e.query ? typeof e.query == "function" ? e.query() : e.query : "", n = Q(() => {
|
|
313
|
-
const t = a().trim();
|
|
314
|
-
if (t.length === 0) return null;
|
|
315
|
-
const o = Le(t);
|
|
316
|
-
return o ? o(e.text) : null;
|
|
317
|
-
});
|
|
318
|
-
return b(P, {
|
|
319
|
-
get when() {
|
|
320
|
-
return n();
|
|
321
|
-
},
|
|
322
|
-
get fallback() {
|
|
323
|
-
return z(() => e.text);
|
|
324
|
-
},
|
|
325
|
-
get children() {
|
|
326
|
-
return b(Se, {
|
|
327
|
-
get each() {
|
|
328
|
-
return n();
|
|
329
|
-
},
|
|
330
|
-
children: (t) => b(P, {
|
|
331
|
-
get when() {
|
|
332
|
-
return t.match;
|
|
333
|
-
},
|
|
334
|
-
get fallback() {
|
|
335
|
-
return z(() => t.text);
|
|
336
|
-
},
|
|
337
|
-
get children() {
|
|
338
|
-
var o = dt();
|
|
339
|
-
return I(o, () => t.text), G(() => E(o, e.class ?? C.treeMatchHighlight)), o;
|
|
340
|
-
}
|
|
341
|
-
})
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
ye(["click", "keydown", "dblclick"]);
|
|
347
|
-
const ft = "vk_treeStickyWidget_Q-8QQ", gt = "vk_treeStickyRow_7gWG2", ne = {
|
|
348
|
-
treeStickyWidget: ft,
|
|
349
|
-
treeStickyRow: gt
|
|
350
|
-
};
|
|
351
|
-
var wt = /* @__PURE__ */ L("<div role=list>"), vt = /* @__PURE__ */ L("<div role=listitem>");
|
|
352
|
-
function yt(e) {
|
|
353
|
-
return (() => {
|
|
354
|
-
var a = wt();
|
|
355
|
-
return I(a, b(se, {
|
|
356
|
-
get each() {
|
|
357
|
-
return e.rows;
|
|
358
|
-
},
|
|
359
|
-
children: (n, t) => (() => {
|
|
360
|
-
var o = vt();
|
|
361
|
-
return I(o, b(ge, {
|
|
362
|
-
sticky: !0,
|
|
363
|
-
get row() {
|
|
364
|
-
return n().row;
|
|
365
|
-
},
|
|
366
|
-
get index() {
|
|
367
|
-
return n().index;
|
|
368
|
-
},
|
|
369
|
-
get rowHeight() {
|
|
370
|
-
return e.descriptor.rowHeight;
|
|
371
|
-
},
|
|
372
|
-
get isCursor() {
|
|
373
|
-
return e.isCursor(n().index);
|
|
374
|
-
},
|
|
375
|
-
get isSelected() {
|
|
376
|
-
return e.isSelected(n().row);
|
|
377
|
-
},
|
|
378
|
-
treeHasFocus: () => !1,
|
|
379
|
-
get showChevronGutter() {
|
|
380
|
-
return e.showChevronGutter;
|
|
381
|
-
},
|
|
382
|
-
get indentGuide() {
|
|
383
|
-
return e.indentGuide;
|
|
384
|
-
},
|
|
385
|
-
get activeGuideDepth() {
|
|
386
|
-
return e.activeGuideDepth;
|
|
387
|
-
},
|
|
388
|
-
get dom() {
|
|
389
|
-
var c, r;
|
|
390
|
-
return (r = (c = e.descriptor).rowProps) == null ? void 0 : r.call(c, n().row);
|
|
391
|
-
},
|
|
392
|
-
get content() {
|
|
393
|
-
return e.descriptor.renderContent(n().row);
|
|
394
|
-
},
|
|
395
|
-
get actions() {
|
|
396
|
-
var c, r;
|
|
397
|
-
return (r = (c = e.descriptor).renderActions) == null ? void 0 : r.call(c, n().row);
|
|
398
|
-
},
|
|
399
|
-
get onSelect() {
|
|
400
|
-
return e.onSelect;
|
|
401
|
-
},
|
|
402
|
-
get onFocusRow() {
|
|
403
|
-
return e.onFocusRow;
|
|
404
|
-
},
|
|
405
|
-
get onToggle() {
|
|
406
|
-
return e.onToggle;
|
|
407
|
-
},
|
|
408
|
-
onActivateClick: () => e.onReveal(n().index),
|
|
409
|
-
get onOpenMenu() {
|
|
410
|
-
return e.onOpenMenu;
|
|
411
|
-
}
|
|
412
|
-
})), G((c) => {
|
|
413
|
-
var r = ne.treeStickyRow, i = `${n().top}px`, u = `${e.rows.length - t}`;
|
|
414
|
-
return r !== c.e && E(o, c.e = r), i !== c.t && Y(o, "top", c.t = i), u !== c.a && Y(o, "z-index", c.a = u), c;
|
|
415
|
-
}, {
|
|
416
|
-
e: void 0,
|
|
417
|
-
t: void 0,
|
|
418
|
-
a: void 0
|
|
419
|
-
}), o;
|
|
420
|
-
})()
|
|
421
|
-
})), G((n) => {
|
|
422
|
-
var t = ne.treeStickyWidget, o = e.label, c = `${e.height}px`;
|
|
423
|
-
return t !== n.e && E(a, n.e = t), o !== n.t && me(a, "aria-label", n.t = o), c !== n.a && Y(a, "height", n.a = c), n;
|
|
424
|
-
}, {
|
|
425
|
-
e: void 0,
|
|
426
|
-
t: void 0,
|
|
427
|
-
a: void 0
|
|
428
|
-
}), a;
|
|
429
|
-
})();
|
|
430
|
-
}
|
|
431
|
-
var mt = /* @__PURE__ */ L("<div role=status aria-live=polite aria-atomic=true><span>"), St = /* @__PURE__ */ L("<div><div>"), kt = /* @__PURE__ */ L("<p>"), xt = /* @__PURE__ */ L("<div>");
|
|
432
|
-
const re = "roving-tabindex";
|
|
433
|
-
function Jt(e) {
|
|
434
|
-
const a = () => e.surface.descriptor, n = () => e.surface.controller;
|
|
435
|
-
let t;
|
|
436
|
-
const o = Q(() => ({
|
|
437
|
-
...he,
|
|
438
|
-
...a().capabilities
|
|
439
|
-
})), c = () => o().canExpand && (a().chevronGutter ?? !0), r = Q(() => {
|
|
440
|
-
if ((a().indentGuide ?? "none") !== "active") return -1;
|
|
441
|
-
const w = e.surface.rows()[n().cursorIndex()];
|
|
442
|
-
return w ? w.depth - 1 : -1;
|
|
443
|
-
});
|
|
444
|
-
De({
|
|
445
|
-
container: () => t,
|
|
446
|
-
supportsMultiselect: () => o().canMultiSelect,
|
|
447
|
-
verbs: {
|
|
448
|
-
selectAll: () => n().selectAll()
|
|
449
|
-
}
|
|
450
|
-
});
|
|
451
|
-
const i = Ee() === null, u = (w) => (w.key === "a" || w.key === "A") && (w.ctrlKey || w.metaKey) && !w.altKey && !w.shiftKey, d = Q(() => He({
|
|
452
|
-
treeId: a().id,
|
|
453
|
-
label: a().ariaLabel,
|
|
454
|
-
multiSelectable: o().canMultiSelect,
|
|
455
|
-
focusMode: re,
|
|
456
|
-
cursorKey: n().cursorKey(),
|
|
457
|
-
flat: !o().canExpand
|
|
458
|
-
})), h = (w) => {
|
|
459
|
-
const s = w;
|
|
460
|
-
return s != null && s.tagName ? s.tagName === "INPUT" || s.tagName === "TEXTAREA" || s.isContentEditable === !0 : !1;
|
|
461
|
-
}, S = () => t !== void 0 && t.contains(t.ownerDocument.activeElement), A = (w, s) => {
|
|
462
|
-
n().selectIndex(w, s);
|
|
463
|
-
}, m = (w, s, R) => {
|
|
464
|
-
var T, k;
|
|
465
|
-
(k = (T = a()).onActivate) == null || k.call(T, w, s, R);
|
|
466
|
-
}, $ = (w, s) => {
|
|
467
|
-
e.surface.openMenu(w, {
|
|
468
|
-
x: s.clientX,
|
|
469
|
-
y: s.clientY
|
|
470
|
-
}, s);
|
|
471
|
-
}, B = (w) => {
|
|
472
|
-
t == null || t.focus({
|
|
473
|
-
preventScroll: !0
|
|
474
|
-
}), e.surface.scroller.scrollToIndex(w, "auto", e.surface.stickyInsetFor(w));
|
|
475
|
-
};
|
|
476
|
-
return (() => {
|
|
477
|
-
var w = xt();
|
|
478
|
-
return I(w, b(P, {
|
|
479
|
-
get when() {
|
|
480
|
-
return n().typeAheadQuery().length > 0;
|
|
481
|
-
},
|
|
482
|
-
get children() {
|
|
483
|
-
var s = mt(), R = s.firstChild;
|
|
484
|
-
return I(s, b(Te, {
|
|
485
|
-
get class() {
|
|
486
|
-
return C.treeSpeedSearchIcon;
|
|
487
|
-
}
|
|
488
|
-
}), R), I(R, () => n().typeAheadQuery()), G((T) => {
|
|
489
|
-
var k = C.treeSpeedSearchBadge, H = C.treeSpeedSearchText;
|
|
490
|
-
return k !== T.e && E(s, T.e = k), H !== T.t && E(R, T.t = H), T;
|
|
491
|
-
}, {
|
|
492
|
-
e: void 0,
|
|
493
|
-
t: void 0
|
|
494
|
-
}), s;
|
|
495
|
-
}
|
|
496
|
-
}), null), I(w, b(_e, {
|
|
497
|
-
viewportRef: (s) => {
|
|
498
|
-
var R;
|
|
499
|
-
e.surface.scroller.containerRef(s), (R = e.viewportRef) == null || R.call(e, s);
|
|
500
|
-
},
|
|
501
|
-
get viewportClass() {
|
|
502
|
-
return `${C.treeViewport} ${e.viewportClass ?? ""}`.trim();
|
|
503
|
-
},
|
|
504
|
-
get children() {
|
|
505
|
-
return [(() => {
|
|
506
|
-
var s = St(), R = s.firstChild, T = t;
|
|
507
|
-
return typeof T == "function" ? ue(T, s) : t = s, le(s, ie(d, {
|
|
508
|
-
get class() {
|
|
509
|
-
return C.treeContainer;
|
|
510
|
-
},
|
|
511
|
-
get style() {
|
|
512
|
-
return {
|
|
513
|
-
height: `${e.surface.scroller.totalHeight()}px`
|
|
514
|
-
};
|
|
515
|
-
},
|
|
516
|
-
onKeyDown: (k) => {
|
|
517
|
-
if (!h(k.target)) {
|
|
518
|
-
if (i && u(k) && o().canMultiSelect) {
|
|
519
|
-
k.preventDefault(), n().selectAll();
|
|
520
|
-
return;
|
|
521
|
-
}
|
|
522
|
-
n().handleKeyDown(k);
|
|
523
|
-
}
|
|
524
|
-
},
|
|
525
|
-
onFocus: (k) => {
|
|
526
|
-
k.target === k.currentTarget && n().cursorIndex() < 0 && n().focusIndex(0);
|
|
527
|
-
}
|
|
528
|
-
}), !1, !0), I(R, b(se, {
|
|
529
|
-
get each() {
|
|
530
|
-
return e.surface.scroller.visibleItems();
|
|
531
|
-
},
|
|
532
|
-
children: (k) => {
|
|
533
|
-
const H = () => k().item, U = () => k().index, Z = () => n().cursorIndex() === U(), l = () => n().selectedKeys().has(H().key);
|
|
534
|
-
return b(ge, {
|
|
535
|
-
get row() {
|
|
536
|
-
return H();
|
|
537
|
-
},
|
|
538
|
-
get index() {
|
|
539
|
-
return U();
|
|
540
|
-
},
|
|
541
|
-
get aria() {
|
|
542
|
-
return Oe({
|
|
543
|
-
treeId: a().id,
|
|
544
|
-
rows: e.surface.rows(),
|
|
545
|
-
index: U(),
|
|
546
|
-
focusMode: re,
|
|
547
|
-
isCursor: Z(),
|
|
548
|
-
isSelected: l(),
|
|
549
|
-
flat: !o().canExpand
|
|
550
|
-
});
|
|
551
|
-
},
|
|
552
|
-
get rowHeight() {
|
|
553
|
-
return a().rowHeight;
|
|
554
|
-
},
|
|
555
|
-
get isCursor() {
|
|
556
|
-
return Z();
|
|
557
|
-
},
|
|
558
|
-
get isSelected() {
|
|
559
|
-
return l();
|
|
560
|
-
},
|
|
561
|
-
treeHasFocus: S,
|
|
562
|
-
get showChevronGutter() {
|
|
563
|
-
return c();
|
|
564
|
-
},
|
|
565
|
-
get indentGuide() {
|
|
566
|
-
return a().indentGuide ?? "none";
|
|
567
|
-
},
|
|
568
|
-
get activeGuideDepth() {
|
|
569
|
-
return r();
|
|
570
|
-
},
|
|
571
|
-
get dom() {
|
|
572
|
-
var f, g;
|
|
573
|
-
return (g = (f = a()).rowProps) == null ? void 0 : g.call(f, H());
|
|
574
|
-
},
|
|
575
|
-
get content() {
|
|
576
|
-
return a().renderContent(H());
|
|
577
|
-
},
|
|
578
|
-
get actions() {
|
|
579
|
-
var f, g;
|
|
580
|
-
return (g = (f = a()).renderActions) == null ? void 0 : g.call(f, H());
|
|
581
|
-
},
|
|
582
|
-
onSelect: A,
|
|
583
|
-
onFocusRow: (f) => n().focusIndex(f),
|
|
584
|
-
onToggle: (f) => {
|
|
585
|
-
var g, y;
|
|
586
|
-
return (y = (g = a()).onToggle) == null ? void 0 : y.call(g, f);
|
|
587
|
-
},
|
|
588
|
-
onActivateClick: m,
|
|
589
|
-
onOpenMenu: $
|
|
590
|
-
});
|
|
591
|
-
}
|
|
592
|
-
})), G((k) => {
|
|
593
|
-
var H = C.treeSlice, U = `translate3d(0, ${e.surface.scroller.offsetY()}px, 0)`;
|
|
594
|
-
return H !== k.e && E(R, k.e = H), U !== k.t && Y(R, "transform", k.t = U), k;
|
|
595
|
-
}, {
|
|
596
|
-
e: void 0,
|
|
597
|
-
t: void 0
|
|
598
|
-
}), s;
|
|
599
|
-
})(), b(P, {
|
|
600
|
-
get when() {
|
|
601
|
-
return z(() => e.surface.rows().length === 0)() && a().emptyLabel;
|
|
602
|
-
},
|
|
603
|
-
get children() {
|
|
604
|
-
var s = kt();
|
|
605
|
-
return I(s, () => a().emptyLabel), G(() => E(s, C.treeEmpty)), s;
|
|
606
|
-
}
|
|
607
|
-
})];
|
|
608
|
-
}
|
|
609
|
-
}), null), I(w, b(P, {
|
|
610
|
-
get when() {
|
|
611
|
-
return e.surface.stickyState().rows.length > 0;
|
|
612
|
-
},
|
|
613
|
-
get children() {
|
|
614
|
-
return b(yt, {
|
|
615
|
-
get rows() {
|
|
616
|
-
return e.surface.stickyState().rows;
|
|
617
|
-
},
|
|
618
|
-
get height() {
|
|
619
|
-
return e.surface.stickyState().height;
|
|
620
|
-
},
|
|
621
|
-
get label() {
|
|
622
|
-
return Ae("Sticky parent rows");
|
|
623
|
-
},
|
|
624
|
-
get descriptor() {
|
|
625
|
-
return a();
|
|
626
|
-
},
|
|
627
|
-
get showChevronGutter() {
|
|
628
|
-
return c();
|
|
629
|
-
},
|
|
630
|
-
get indentGuide() {
|
|
631
|
-
return a().indentGuide ?? "none";
|
|
632
|
-
},
|
|
633
|
-
get activeGuideDepth() {
|
|
634
|
-
return r();
|
|
635
|
-
},
|
|
636
|
-
isCursor: (s) => n().cursorIndex() === s,
|
|
637
|
-
isSelected: (s) => n().selectedKeys().has(s.key),
|
|
638
|
-
onSelect: A,
|
|
639
|
-
onFocusRow: (s) => n().focusIndex(s),
|
|
640
|
-
onToggle: (s) => {
|
|
641
|
-
var R, T;
|
|
642
|
-
return (T = (R = a()).onToggle) == null ? void 0 : T.call(R, s);
|
|
643
|
-
},
|
|
644
|
-
onReveal: B,
|
|
645
|
-
onOpenMenu: $
|
|
646
|
-
});
|
|
647
|
-
}
|
|
648
|
-
}), null), G((s) => {
|
|
649
|
-
var R = C.treeStickyHost, T = `${a().indentBaseRem ?? 0}rem`;
|
|
650
|
-
return R !== s.e && E(w, s.e = R), T !== s.t && Y(w, "--tree-indent-base", s.t = T), s;
|
|
651
|
-
}, {
|
|
652
|
-
e: void 0,
|
|
653
|
-
t: void 0
|
|
654
|
-
}), w;
|
|
655
|
-
})();
|
|
656
|
-
}
|
|
657
|
-
const oe = 10, W = (e, a) => Math.max(0, Math.min(e, a - 1));
|
|
658
|
-
function Ct(e) {
|
|
659
|
-
return e.key.length === 1 && e.key !== " " && !e.ctrlKey && !e.metaKey && !e.altKey;
|
|
660
|
-
}
|
|
661
|
-
function bt(e, a) {
|
|
662
|
-
const { index: n, rowCount: t, capabilities: o } = a;
|
|
663
|
-
if (t === 0) return null;
|
|
664
|
-
const c = n < 0 ? -1 : n;
|
|
665
|
-
switch (Me(e)) {
|
|
666
|
-
case "ArrowDown":
|
|
667
|
-
return e.shiftKey && o.canMultiSelect ? { type: "extend", to: W(c + 1, t) } : { type: "move", to: W(c + 1, t) };
|
|
668
|
-
case "ArrowUp":
|
|
669
|
-
return c < 0 ? { type: "move", to: t - 1 } : e.shiftKey && o.canMultiSelect ? { type: "extend", to: W(c - 1, t) } : { type: "move", to: W(c - 1, t) };
|
|
670
|
-
case "Home":
|
|
671
|
-
return { type: "move", to: 0 };
|
|
672
|
-
case "End":
|
|
673
|
-
return { type: "move", to: t - 1 };
|
|
674
|
-
case "PageDown":
|
|
675
|
-
return {
|
|
676
|
-
type: "move",
|
|
677
|
-
to: W(Math.max(c, 0) + oe, t)
|
|
678
|
-
};
|
|
679
|
-
case "PageUp":
|
|
680
|
-
return {
|
|
681
|
-
type: "move",
|
|
682
|
-
to: W(Math.max(c, 0) - oe, t)
|
|
683
|
-
};
|
|
684
|
-
case "ArrowRight":
|
|
685
|
-
return o.canExpand ? { type: "expandOrDescend" } : { type: "flatNavigate", direction: "in" };
|
|
686
|
-
case "ArrowLeft":
|
|
687
|
-
return e.ctrlKey || e.metaKey ? null : o.canExpand ? { type: "collapseOrAscend" } : { type: "flatNavigate", direction: "out" };
|
|
688
|
-
case "Enter":
|
|
689
|
-
return { type: "activate" };
|
|
690
|
-
case "ContextMenu":
|
|
691
|
-
return { type: "openMenu" };
|
|
692
|
-
case "F10":
|
|
693
|
-
return e.shiftKey ? { type: "openMenu" } : null;
|
|
694
|
-
}
|
|
695
|
-
return e.key === " " ? o.canExpand ? { type: "toggle" } : null : o.canTypeAhead && Ct(e) ? { type: "typeAhead", char: e.key } : null;
|
|
696
|
-
}
|
|
697
|
-
function q(e, a) {
|
|
698
|
-
const n = e[a];
|
|
699
|
-
if (!n) return -1;
|
|
700
|
-
for (let t = a - 1; t >= 0; t--)
|
|
701
|
-
if (e[t].depth < n.depth) return t;
|
|
702
|
-
return -1;
|
|
703
|
-
}
|
|
704
|
-
function we(e, a) {
|
|
705
|
-
const n = e[a];
|
|
706
|
-
if (!n) return null;
|
|
707
|
-
const t = a + 1;
|
|
708
|
-
if (t >= e.length || e[t].depth <= n.depth) return null;
|
|
709
|
-
let o = t;
|
|
710
|
-
for (; o + 1 < e.length && e[o + 1].depth > n.depth; ) o++;
|
|
711
|
-
return { start: t, end: o };
|
|
712
|
-
}
|
|
713
|
-
function Rt(e, a, n, t = !1) {
|
|
714
|
-
const o = n.toLowerCase();
|
|
715
|
-
if (o.length === 0) return -1;
|
|
716
|
-
const c = e.length;
|
|
717
|
-
if (c === 0) return -1;
|
|
718
|
-
const r = t ? 0 : 1;
|
|
719
|
-
for (let i = r; i <= c; i++) {
|
|
720
|
-
const u = (a + i + c) % c;
|
|
721
|
-
if (e[u].label.toLowerCase().startsWith(o)) return u;
|
|
722
|
-
}
|
|
723
|
-
for (let i = r; i <= c; i++) {
|
|
724
|
-
const u = (a + i + c) % c;
|
|
725
|
-
if (e[u].label.toLowerCase().includes(o)) return u;
|
|
726
|
-
}
|
|
727
|
-
return -1;
|
|
728
|
-
}
|
|
729
|
-
function Tt(e, a, n) {
|
|
730
|
-
const t = new Map(e.map((h, S) => [h.key, S])), o = [...n].filter((h) => t.has(h)), c = _t(e, a, o, t), r = At(e, c), i = (h) => h.selectable !== !1 && (r === void 0 || h.kind === r), u = new Set(o);
|
|
731
|
-
let d = c < 0 ? -1 : q(e, c);
|
|
732
|
-
for (; ; ) {
|
|
733
|
-
const h = It(e, d).filter(i).map((m) => m.key);
|
|
734
|
-
if (d < 0) return h;
|
|
735
|
-
const S = h.length === u.size && h.every((m) => u.has(m));
|
|
736
|
-
if (h.length > 0 && !S) return h;
|
|
737
|
-
const A = e[d];
|
|
738
|
-
if (h.length > 0 && i(A))
|
|
739
|
-
return [A.key, ...h];
|
|
740
|
-
d = q(e, d);
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
function _t(e, a, n, t) {
|
|
744
|
-
var r;
|
|
745
|
-
const o = (r = e[a]) == null ? void 0 : r.key;
|
|
746
|
-
if (o !== void 0 && !n.includes(o)) return a;
|
|
747
|
-
const c = n[0];
|
|
748
|
-
return c === void 0 ? -1 : t.get(c) ?? -1;
|
|
749
|
-
}
|
|
750
|
-
function At(e, a) {
|
|
751
|
-
const n = e[a];
|
|
752
|
-
if (n && n.selectable !== !1) return n.kind;
|
|
753
|
-
const t = (c) => c.selectable !== !1, o = e.slice(Math.max(a, 0)).find(t) ?? e.find(t);
|
|
754
|
-
return o == null ? void 0 : o.kind;
|
|
755
|
-
}
|
|
756
|
-
function It(e, a) {
|
|
757
|
-
if (a < 0) return e;
|
|
758
|
-
const n = we(e, a);
|
|
759
|
-
return n ? e.slice(n.start, n.end + 1) : [];
|
|
760
|
-
}
|
|
761
|
-
const ae = 1e3;
|
|
762
|
-
function Mt(e) {
|
|
763
|
-
const a = () => ({
|
|
764
|
-
...he,
|
|
765
|
-
...e.capabilities,
|
|
766
|
-
expandAll: !1
|
|
767
|
-
}), [n, t] = X(-1), [o, c] = X(
|
|
768
|
-
/* @__PURE__ */ new Set()
|
|
769
|
-
), [r, i] = X(-1), [u, d] = X("");
|
|
770
|
-
let h = 0, S;
|
|
771
|
-
const A = () => {
|
|
772
|
-
S !== void 0 && (clearTimeout(S), S = void 0), u().length > 0 && d("");
|
|
773
|
-
}, m = () => {
|
|
774
|
-
S !== void 0 && (clearTimeout(S), S = void 0), S = setTimeout(() => {
|
|
775
|
-
d(""), S = void 0;
|
|
776
|
-
}, ae);
|
|
777
|
-
};
|
|
778
|
-
xe(() => {
|
|
779
|
-
S !== void 0 && (clearTimeout(S), S = void 0);
|
|
780
|
-
});
|
|
781
|
-
const $ = Q(
|
|
782
|
-
() => {
|
|
783
|
-
var l;
|
|
784
|
-
return ((l = e.rows()[n()]) == null ? void 0 : l.key) ?? null;
|
|
785
|
-
}
|
|
786
|
-
), B = (l) => {
|
|
787
|
-
var g;
|
|
788
|
-
const f = e.rows();
|
|
789
|
-
l < 0 || l >= f.length || l === n() || (t(l), i(l), (g = e.onScrollToIndex) == null || g.call(e, l));
|
|
790
|
-
}, w = (l, f) => {
|
|
791
|
-
var x;
|
|
792
|
-
const g = e.rows(), y = (x = g[l]) == null ? void 0 : x.kind, [v, D] = l <= f ? [l, f] : [f, l], M = /* @__PURE__ */ new Set();
|
|
793
|
-
for (let K = v; K <= D; K++) {
|
|
794
|
-
const _ = g[K];
|
|
795
|
-
_ && _.selectable !== !1 && (y !== void 0 && _.kind !== y || M.add(_.key));
|
|
796
|
-
}
|
|
797
|
-
return M;
|
|
798
|
-
};
|
|
799
|
-
return {
|
|
800
|
-
cursorIndex: n,
|
|
801
|
-
cursorKey: $,
|
|
802
|
-
selectedKeys: o,
|
|
803
|
-
typeAheadQuery: u,
|
|
804
|
-
get capabilities() {
|
|
805
|
-
return a();
|
|
806
|
-
},
|
|
807
|
-
focusIndex: B,
|
|
808
|
-
selectIndex: (l, f) => {
|
|
809
|
-
var v, D, M;
|
|
810
|
-
A();
|
|
811
|
-
const y = e.rows()[l];
|
|
812
|
-
if (y) {
|
|
813
|
-
if (y.selectable === !1 && f !== "range") {
|
|
814
|
-
B(l);
|
|
815
|
-
return;
|
|
816
|
-
}
|
|
817
|
-
if (f === "toggle" && a().canMultiSelect) {
|
|
818
|
-
const x = new Set(o());
|
|
819
|
-
x.has(y.key) ? x.delete(y.key) : x.add(y.key), c(x), t(l), i(l), (v = e.onScrollToIndex) == null || v.call(e, l);
|
|
820
|
-
return;
|
|
821
|
-
}
|
|
822
|
-
if (f === "range" && a().canMultiSelect) {
|
|
823
|
-
const x = r() >= 0 ? r() : l;
|
|
824
|
-
c(w(x, l)), t(l), (D = e.onScrollToIndex) == null || D.call(e, l);
|
|
825
|
-
return;
|
|
826
|
-
}
|
|
827
|
-
c(/* @__PURE__ */ new Set([y.key])), t(l), i(l), (M = e.onScrollToIndex) == null || M.call(e, l);
|
|
828
|
-
}
|
|
829
|
-
},
|
|
830
|
-
clearSelection: () => {
|
|
831
|
-
A(), o().size > 0 && c(/* @__PURE__ */ new Set());
|
|
832
|
-
},
|
|
833
|
-
selectChildren: (l) => {
|
|
834
|
-
var K;
|
|
835
|
-
const f = e.rows(), g = f[l];
|
|
836
|
-
if (!g) return;
|
|
837
|
-
const y = g.depth + 1, v = /* @__PURE__ */ new Set();
|
|
838
|
-
let D, M = !1, x = -1;
|
|
839
|
-
for (let _ = l + 1; _ < f.length; _++) {
|
|
840
|
-
const F = f[_];
|
|
841
|
-
if (F.depth <= g.depth) break;
|
|
842
|
-
if (F.depth === y && F.selectable !== !1) {
|
|
843
|
-
if (!M)
|
|
844
|
-
D = F.kind, x = _, M = !0;
|
|
845
|
-
else if (D !== void 0 && F.kind !== D) continue;
|
|
846
|
-
v.add(F.key);
|
|
847
|
-
}
|
|
848
|
-
}
|
|
849
|
-
v.size !== 0 && (c(v), x >= 0 && (t(x), i(x), (K = e.onScrollToIndex) == null || K.call(e, x)));
|
|
850
|
-
},
|
|
851
|
-
selectAll: () => {
|
|
852
|
-
a().canMultiSelect && c(
|
|
853
|
-
new Set(Tt(e.rows(), n(), o()))
|
|
854
|
-
);
|
|
855
|
-
},
|
|
856
|
-
childKindsHomogeneous: (l) => {
|
|
857
|
-
const f = e.rows(), g = f[l];
|
|
858
|
-
if (!g) return { homogeneous: !1, total: 0, selectable: 0 };
|
|
859
|
-
const y = g.depth + 1;
|
|
860
|
-
let v, D = !1, M = 0, x = 0;
|
|
861
|
-
for (let K = l + 1; K < f.length; K++) {
|
|
862
|
-
const _ = f[K];
|
|
863
|
-
if (_.depth <= g.depth) break;
|
|
864
|
-
_.depth === y && _.selectable !== !1 && (M++, D ? (v === void 0 || _.kind === v) && x++ : (v = _.kind, D = !0, x++));
|
|
865
|
-
}
|
|
866
|
-
return {
|
|
867
|
-
homogeneous: M > 0 && M === x,
|
|
868
|
-
total: M,
|
|
869
|
-
selectable: x
|
|
870
|
-
};
|
|
871
|
-
},
|
|
872
|
-
handleKeyDown: (l) => {
|
|
873
|
-
var D, M, x, K, _, F, p, ee;
|
|
874
|
-
if (de(l, "Escape") && u().length > 0) {
|
|
875
|
-
l.preventDefault(), l.stopPropagation(), A();
|
|
876
|
-
return;
|
|
877
|
-
}
|
|
878
|
-
const f = e.rows(), g = n(), y = bt(l, {
|
|
879
|
-
index: g,
|
|
880
|
-
rowCount: f.length,
|
|
881
|
-
capabilities: a()
|
|
882
|
-
});
|
|
883
|
-
if (!y) return;
|
|
884
|
-
const v = f[g];
|
|
885
|
-
switch (y.type) {
|
|
886
|
-
case "move":
|
|
887
|
-
l.preventDefault(), B(y.to);
|
|
888
|
-
return;
|
|
889
|
-
case "extend": {
|
|
890
|
-
l.preventDefault();
|
|
891
|
-
const O = r() >= 0 ? r() : g;
|
|
892
|
-
c(w(O, y.to)), t(y.to), (D = e.onScrollToIndex) == null || D.call(e, y.to);
|
|
893
|
-
return;
|
|
894
|
-
}
|
|
895
|
-
case "expandOrDescend":
|
|
896
|
-
if (!v) return;
|
|
897
|
-
if (l.preventDefault(), v.expandable && !v.expanded) {
|
|
898
|
-
(M = e.onToggle) == null || M.call(e, v);
|
|
899
|
-
return;
|
|
900
|
-
}
|
|
901
|
-
B(g + 1);
|
|
902
|
-
return;
|
|
903
|
-
case "collapseOrAscend": {
|
|
904
|
-
if (!v) return;
|
|
905
|
-
if (l.preventDefault(), v.expandable && v.expanded) {
|
|
906
|
-
(x = e.onToggle) == null || x.call(e, v);
|
|
907
|
-
return;
|
|
908
|
-
}
|
|
909
|
-
const O = q(f, g);
|
|
910
|
-
O >= 0 && B(O);
|
|
911
|
-
return;
|
|
912
|
-
}
|
|
913
|
-
case "toggle":
|
|
914
|
-
if (!(v != null && v.expandable)) return;
|
|
915
|
-
l.preventDefault(), (K = e.onToggle) == null || K.call(e, v);
|
|
916
|
-
return;
|
|
917
|
-
case "flatNavigate":
|
|
918
|
-
l.preventDefault(), (_ = e.onFlatNavigate) == null || _.call(e, y.direction, v);
|
|
919
|
-
return;
|
|
920
|
-
case "activate":
|
|
921
|
-
if (!v) return;
|
|
922
|
-
l.preventDefault(), (F = e.onActivate) == null || F.call(e, v);
|
|
923
|
-
return;
|
|
924
|
-
case "openMenu": {
|
|
925
|
-
if (!v) return;
|
|
926
|
-
l.preventDefault();
|
|
927
|
-
const O = l.target, N = O == null ? void 0 : O.getBoundingClientRect();
|
|
928
|
-
(p = e.onOpenMenu) == null || p.call(e, v, {
|
|
929
|
-
x: Math.round((N == null ? void 0 : N.left) ?? 0),
|
|
930
|
-
y: Math.round((N == null ? void 0 : N.bottom) ?? 0)
|
|
931
|
-
});
|
|
932
|
-
return;
|
|
933
|
-
}
|
|
934
|
-
case "typeAhead": {
|
|
935
|
-
const O = ((ee = e.now) == null ? void 0 : ee.call(e)) ?? Date.now(), N = O - h > ae, V = N ? "" : u(), j = V.length === 1 && V.toLowerCase() === y.char.toLowerCase() ? V : `${V}${y.char}`, te = Rt(
|
|
936
|
-
f,
|
|
937
|
-
g,
|
|
938
|
-
j,
|
|
939
|
-
j.length > 1 && !N
|
|
940
|
-
);
|
|
941
|
-
if (h = O, te < 0) {
|
|
942
|
-
d(V), V.length > 0 ? m() : A();
|
|
943
|
-
return;
|
|
944
|
-
}
|
|
945
|
-
d(j), m(), l.preventDefault(), B(te);
|
|
946
|
-
return;
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
},
|
|
950
|
-
openMenuAt: (l, f) => {
|
|
951
|
-
var y;
|
|
952
|
-
const g = e.rows()[l];
|
|
953
|
-
g && ((y = e.onOpenMenu) == null || y.call(e, g, f));
|
|
954
|
-
}
|
|
955
|
-
};
|
|
956
|
-
}
|
|
957
|
-
const Dt = 0.4, Et = { rows: [], height: 0 };
|
|
958
|
-
function ve(e) {
|
|
959
|
-
return Math.max(Math.floor(e), 1);
|
|
960
|
-
}
|
|
961
|
-
function $t(e, a, n) {
|
|
962
|
-
let t = a, o = q(e, t);
|
|
963
|
-
for (; o !== -1; ) {
|
|
964
|
-
if (o === n) return t;
|
|
965
|
-
t = o, o = q(e, t);
|
|
966
|
-
}
|
|
967
|
-
return n === -1 ? t : -1;
|
|
968
|
-
}
|
|
969
|
-
function Kt(e, a, n, t) {
|
|
970
|
-
let o = e;
|
|
971
|
-
for (let r = 0; r < e.length; r++)
|
|
972
|
-
if (e[r].top + t > n || r >= a) {
|
|
973
|
-
o = e.slice(0, r);
|
|
974
|
-
break;
|
|
975
|
-
}
|
|
976
|
-
const c = o[o.length - 1];
|
|
977
|
-
return c ? { rows: o, height: c.top + t } : { rows: [], height: 0 };
|
|
978
|
-
}
|
|
979
|
-
function Gt(e) {
|
|
980
|
-
const { rows: a, scrollTop: n, rowHeight: t, viewportHeight: o } = e;
|
|
981
|
-
if (a.length === 0 || t <= 0) return Et;
|
|
982
|
-
const c = ve(e.maxCount), r = [];
|
|
983
|
-
let i = 0, u = -1;
|
|
984
|
-
for (; ; ) {
|
|
985
|
-
const d = Math.floor((n + i) / t);
|
|
986
|
-
if (d < 0 || d >= a.length) break;
|
|
987
|
-
const h = $t(a, d, u);
|
|
988
|
-
if (h === -1) break;
|
|
989
|
-
const S = we(a, h);
|
|
990
|
-
if (S === null || h === d && n === h * t - i) break;
|
|
991
|
-
const A = (S.end + 1) * t - n, m = i, $ = m + t > A && m <= A ? A - t : m;
|
|
992
|
-
if (r.push({ index: h, row: a[h], top: $ }), i = $ + t, u = h, r.length >= c) break;
|
|
993
|
-
}
|
|
994
|
-
return Kt(
|
|
995
|
-
r,
|
|
996
|
-
c,
|
|
997
|
-
o * Dt,
|
|
998
|
-
t
|
|
999
|
-
);
|
|
1000
|
-
}
|
|
1001
|
-
function Ht(e, a, n, t) {
|
|
1002
|
-
if (a < 0 || a >= e.length) return 0;
|
|
1003
|
-
let o = 0, c = q(e, a);
|
|
1004
|
-
for (; c !== -1; )
|
|
1005
|
-
o++, c = q(e, c);
|
|
1006
|
-
return Math.min(o, ve(t)) * n;
|
|
1007
|
-
}
|
|
1008
|
-
const Ot = 8, ce = 7, Pt = { rows: [], height: 0 };
|
|
1009
|
-
function pt(e) {
|
|
1010
|
-
const a = Ce(Ke), n = Q(() => [...e.rows()]), t = $e({
|
|
1011
|
-
items: n,
|
|
1012
|
-
itemHeight: e.rowHeight,
|
|
1013
|
-
overscan: e.overscan ?? Ot
|
|
1014
|
-
}), o = Q(() => e.stickyScroll !== !0 ? Pt : Gt({
|
|
1015
|
-
rows: n(),
|
|
1016
|
-
scrollTop: t.scrollTop(),
|
|
1017
|
-
rowHeight: e.rowHeight,
|
|
1018
|
-
viewportHeight: t.viewportHeight(),
|
|
1019
|
-
maxCount: e.stickyScrollMaxCount ?? ce
|
|
1020
|
-
})), c = (u) => e.stickyScroll === !0 ? Ht(
|
|
1021
|
-
n(),
|
|
1022
|
-
u,
|
|
1023
|
-
e.rowHeight,
|
|
1024
|
-
e.stickyScrollMaxCount ?? ce
|
|
1025
|
-
) : 0, r = Mt({
|
|
1026
|
-
rows: n,
|
|
1027
|
-
...e.capabilities ? { capabilities: e.capabilities } : {},
|
|
1028
|
-
onToggle: (u) => {
|
|
1029
|
-
var d;
|
|
1030
|
-
return (d = e.onToggle) == null ? void 0 : d.call(e, u);
|
|
1031
|
-
},
|
|
1032
|
-
onActivate: (u) => {
|
|
1033
|
-
var d;
|
|
1034
|
-
return (d = e.onActivate) == null ? void 0 : d.call(e, u, "keyboard");
|
|
1035
|
-
},
|
|
1036
|
-
onOpenMenu: (u, d) => i(u, d),
|
|
1037
|
-
onCollapseAll: () => {
|
|
1038
|
-
var u;
|
|
1039
|
-
return (u = e.onCollapseAll) == null ? void 0 : u.call(e);
|
|
1040
|
-
},
|
|
1041
|
-
onFlatNavigate: (u, d) => {
|
|
1042
|
-
var h;
|
|
1043
|
-
return (h = e.onFlatNavigate) == null ? void 0 : h.call(
|
|
1044
|
-
e,
|
|
1045
|
-
u,
|
|
1046
|
-
d
|
|
1047
|
-
);
|
|
1048
|
-
},
|
|
1049
|
-
onRename: (u) => {
|
|
1050
|
-
var d;
|
|
1051
|
-
return (d = e.onRename) == null ? void 0 : d.call(e, u);
|
|
1052
|
-
},
|
|
1053
|
-
onDestroy: (u) => {
|
|
1054
|
-
var d;
|
|
1055
|
-
return (d = e.onDestroy) == null ? void 0 : d.call(e, u);
|
|
1056
|
-
},
|
|
1057
|
-
// Arrow keys in a virtualized list are a lie without this: the row the
|
|
1058
|
-
// cursor lands on may not be mounted yet.
|
|
1059
|
-
//
|
|
1060
|
-
// The inset is what keeps them honest once rows are pinned on top: "scroll
|
|
1061
|
-
// just enough" would otherwise stop the moment the cursor row reached the
|
|
1062
|
-
// viewport's top edge — which is now underneath the widget. Arrowing UP into
|
|
1063
|
-
// a parent would walk the cursor into a row nobody can see. Every scroll the
|
|
1064
|
-
// controller does — focus, the three selects, select-children, extend —
|
|
1065
|
-
// comes through this one call, so this is the only place it has to be said.
|
|
1066
|
-
onScrollToIndex: (u) => t.scrollToIndex(u, "auto", c(u))
|
|
1067
|
-
});
|
|
1068
|
-
function i(u, d, h) {
|
|
1069
|
-
if (e.openMenu) {
|
|
1070
|
-
e.openMenu(u, d, h);
|
|
1071
|
-
return;
|
|
1072
|
-
}
|
|
1073
|
-
if (!e.buildMenu) return;
|
|
1074
|
-
const S = e.buildMenu(u, r.selectedKeys());
|
|
1075
|
-
if (S.length !== 0) {
|
|
1076
|
-
if (!a)
|
|
1077
|
-
throw new Ge(
|
|
1078
|
-
"createTreeSurface: descriptor builds a context menu but no DesktopContextMenuProvider is mounted"
|
|
1079
|
-
);
|
|
1080
|
-
a.open(d.x, d.y, S, h);
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
return {
|
|
1084
|
-
descriptor: e,
|
|
1085
|
-
controller: r,
|
|
1086
|
-
scroller: t,
|
|
1087
|
-
rows: n,
|
|
1088
|
-
stickyState: o,
|
|
1089
|
-
stickyInsetFor: c,
|
|
1090
|
-
openMenu: i
|
|
1091
|
-
};
|
|
1092
|
-
}
|
|
1093
|
-
const en = 0.85;
|
|
1094
|
-
export {
|
|
1095
|
-
he as D,
|
|
1096
|
-
en as T,
|
|
1097
|
-
jt as a,
|
|
1098
|
-
ge as b,
|
|
1099
|
-
Jt as c,
|
|
1100
|
-
He as d,
|
|
1101
|
-
Oe as e,
|
|
1102
|
-
Mt as f,
|
|
1103
|
-
pt as g,
|
|
1104
|
-
Tt as s,
|
|
1105
|
-
fe as t
|
|
1106
|
-
};
|