@vokril/ui-solid 0.2.1 → 0.4.0

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