@editora/ui-core 0.1.19 → 0.1.21

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 (313) hide show
  1. package/dist/{ElementBase-1b301e7f.js → ElementBase-EV6mVBUV.js} +1 -1
  2. package/dist/{ElementBase-909688f3.mjs → ElementBase-YlTLMsGk.mjs} +3 -3
  3. package/dist/accordion.cjs.js +3 -3
  4. package/dist/accordion.esm.js +39 -62
  5. package/dist/alert-dialog.cjs.js +19 -19
  6. package/dist/alert-dialog.esm.js +69 -87
  7. package/dist/alert.cjs.js +1 -1
  8. package/dist/alert.esm.js +4 -7
  9. package/dist/anchor.cjs.js +2 -2
  10. package/dist/anchor.esm.js +3 -3
  11. package/dist/animated-beam.cjs.js +83 -83
  12. package/dist/animated-beam.esm.js +250 -277
  13. package/dist/animated-list.cjs.js +4 -4
  14. package/dist/animated-list.esm.js +47 -61
  15. package/dist/animated-text.cjs.js +2 -2
  16. package/dist/animated-text.esm.js +13 -24
  17. package/dist/app-header.cjs.js +3 -3
  18. package/dist/app-header.esm.js +11 -13
  19. package/dist/aspect-ratio.cjs.js +1 -1
  20. package/dist/aspect-ratio.esm.js +4 -7
  21. package/dist/avatar.cjs.js +1 -1
  22. package/dist/avatar.esm.js +7 -13
  23. package/dist/badge.cjs.js +1 -1
  24. package/dist/badge.esm.js +4 -7
  25. package/dist/block-controls.cjs.js +2 -2
  26. package/dist/block-controls.esm.js +19 -35
  27. package/dist/box.cjs.js +1 -1
  28. package/dist/box.esm.js +8 -15
  29. package/dist/breadcrumb.cjs.js +2 -2
  30. package/dist/breadcrumb.esm.js +20 -37
  31. package/dist/button.cjs.js +1 -521
  32. package/dist/button.esm.js +2 -671
  33. package/dist/{calendar-2c11b824.mjs → calendar-DLY4acgn.mjs} +293 -342
  34. package/dist/{calendar-a8735e40.js → calendar-Dkof-FTK.js} +25 -25
  35. package/dist/calendar.cjs.js +1 -1
  36. package/dist/calendar.esm.js +8 -9
  37. package/dist/card.cjs.js +4 -4
  38. package/dist/card.esm.js +13 -19
  39. package/dist/chart.cjs.js +64 -64
  40. package/dist/chart.esm.js +223 -254
  41. package/dist/checkbox.cjs.js +1 -1
  42. package/dist/checkbox.esm.js +2 -3
  43. package/dist/collapsible.cjs.js +1 -1
  44. package/dist/collapsible.esm.js +5 -9
  45. package/dist/{collection-a1aac0c6.mjs → collection-C7URGjEI.mjs} +8 -14
  46. package/dist/collection.cjs.js +1 -1
  47. package/dist/collection.esm.js +30 -29
  48. package/dist/color-picker.cjs.js +10 -10
  49. package/dist/color-picker.esm.js +190 -253
  50. package/dist/combobox.cjs.js +13 -13
  51. package/dist/combobox.esm.js +93 -126
  52. package/dist/command-palette.cjs.js +3 -3
  53. package/dist/command-palette.esm.js +19 -30
  54. package/dist/command.cjs.js +4 -4
  55. package/dist/command.esm.js +41 -53
  56. package/dist/components/ui-collection.d.ts.map +1 -1
  57. package/dist/components/ui-multi-select.d.ts.map +1 -1
  58. package/dist/components/ui-orbiter.d.ts.map +1 -1
  59. package/dist/components/ui-portal.d.ts.map +1 -1
  60. package/dist/components/ui-positioner.d.ts.map +1 -1
  61. package/dist/components/ui-skeleton.d.ts.map +1 -1
  62. package/dist/components/ui-sortable.d.ts +8 -0
  63. package/dist/components/ui-sortable.d.ts.map +1 -1
  64. package/dist/components/ui-split-button.d.ts +1 -0
  65. package/dist/components/ui-split-button.d.ts.map +1 -1
  66. package/dist/components/ui-tabs.d.ts.map +1 -1
  67. package/dist/components/ui-textarea.d.ts.map +1 -1
  68. package/dist/components/ui-time-picker.d.ts.map +1 -1
  69. package/dist/container.cjs.js +2 -2
  70. package/dist/container.esm.js +2 -3
  71. package/dist/context-menu.cjs.js +8 -8
  72. package/dist/context-menu.esm.js +157 -219
  73. package/dist/control-group.cjs.js +1 -1
  74. package/dist/control-group.esm.js +2 -3
  75. package/dist/data-table.cjs.js +4 -4
  76. package/dist/data-table.esm.js +299 -381
  77. package/dist/date-field.cjs.js +3 -3
  78. package/dist/date-field.esm.js +68 -80
  79. package/dist/date-picker.cjs.js +9 -9
  80. package/dist/date-picker.esm.js +69 -97
  81. package/dist/date-range-picker.cjs.js +3 -3
  82. package/dist/date-range-picker.esm.js +32 -56
  83. package/dist/date-range-time-picker.cjs.js +9 -9
  84. package/dist/date-range-time-picker.esm.js +111 -140
  85. package/dist/date-time-picker.cjs.js +7 -7
  86. package/dist/date-time-picker.esm.js +115 -147
  87. package/dist/date-time-utils-Dmost5Ee.js +1 -0
  88. package/dist/date-time-utils-y1N2gvG2.mjs +268 -0
  89. package/dist/description.cjs.js +1 -1
  90. package/dist/description.esm.js +3 -5
  91. package/dist/dialog.cjs.js +12 -12
  92. package/dist/dialog.esm.js +44 -63
  93. package/dist/direction-provider.cjs.js +1 -1
  94. package/dist/direction-provider.esm.js +2 -3
  95. package/dist/{dismissable-layer-9c7e6b58.mjs → dismissable-layer-BmPIoK80.mjs} +29 -33
  96. package/dist/dismissable-layer-DNfrKA20.js +1 -0
  97. package/dist/dismissable-layer.cjs.js +2 -2
  98. package/dist/dismissable-layer.esm.js +4 -6
  99. package/dist/dock.cjs.js +5 -5
  100. package/dist/dock.esm.js +134 -155
  101. package/dist/drawer.cjs.js +2 -2
  102. package/dist/drawer.esm.js +18 -35
  103. package/dist/dropdown.cjs.js +2 -2
  104. package/dist/dropdown.esm.js +119 -149
  105. package/dist/dropzone.cjs.js +1 -1
  106. package/dist/dropzone.esm.js +0 -1
  107. package/dist/empty-state.cjs.js +1 -1
  108. package/dist/empty-state.esm.js +1 -1
  109. package/dist/field-error.cjs.js +1 -1
  110. package/dist/field-error.esm.js +3 -5
  111. package/dist/field.cjs.js +5 -5
  112. package/dist/field.esm.js +27 -34
  113. package/dist/fieldset.cjs.js +4 -4
  114. package/dist/fieldset.esm.js +19 -24
  115. package/dist/file-upload.cjs.js +4 -4
  116. package/dist/file-upload.esm.js +69 -93
  117. package/dist/flex.cjs.js +1 -1
  118. package/dist/flex.esm.js +5 -9
  119. package/dist/floating-toolbar.cjs.js +4 -4
  120. package/dist/floating-toolbar.esm.js +60 -85
  121. package/dist/focus-scope-Bwug2gDv.js +1 -0
  122. package/dist/{focus-scope-103833ee.mjs → focus-scope-CmEsG5UZ.mjs} +39 -48
  123. package/dist/focus-scope.cjs.js +2 -2
  124. package/dist/focus-scope.esm.js +15 -20
  125. package/dist/form.cjs.js +2 -2
  126. package/dist/form.esm.js +26 -53
  127. package/dist/gantt.cjs.js +43 -43
  128. package/dist/gantt.esm.js +295 -322
  129. package/dist/grid.cjs.js +1 -1
  130. package/dist/grid.esm.js +5 -9
  131. package/dist/hover-card.cjs.js +4 -4
  132. package/dist/hover-card.esm.js +22 -28
  133. package/dist/icon-cloud.cjs.js +7 -7
  134. package/dist/icon-cloud.esm.js +48 -62
  135. package/dist/icon.cjs.js +1 -1
  136. package/dist/icon.esm.js +2 -4
  137. package/dist/index.cjs.js +1 -1
  138. package/dist/index.esm.js +378 -390
  139. package/dist/inline-edit.cjs.js +11 -11
  140. package/dist/inline-edit.esm.js +32 -36
  141. package/dist/input.cjs.js +17 -17
  142. package/dist/input.esm.js +50 -63
  143. package/dist/label.cjs.js +2 -2
  144. package/dist/label.esm.js +8 -17
  145. package/dist/layout.cjs.js +2 -2
  146. package/dist/layout.esm.js +20 -26
  147. package/dist/listbox-B6QgECax.js +46 -0
  148. package/dist/listbox-DJamVeFj.mjs +200 -0
  149. package/dist/listbox.cjs.js +1 -1
  150. package/dist/listbox.esm.js +2 -4
  151. package/dist/marquee.cjs.js +5 -5
  152. package/dist/marquee.esm.js +33 -50
  153. package/dist/masonry-grid.cjs.js +1 -1
  154. package/dist/masonry-grid.esm.js +5 -9
  155. package/dist/menu.cjs.js +3 -3
  156. package/dist/menu.esm.js +106 -126
  157. package/dist/menubar.cjs.js +5 -5
  158. package/dist/menubar.esm.js +118 -164
  159. package/dist/meter.cjs.js +2 -2
  160. package/dist/meter.esm.js +4 -4
  161. package/dist/multi-select.cjs.js +5 -5
  162. package/dist/multi-select.esm.js +125 -137
  163. package/dist/navigation-menu.cjs.js +4 -4
  164. package/dist/navigation-menu.esm.js +44 -55
  165. package/dist/number-field.cjs.js +2 -2
  166. package/dist/number-field.esm.js +73 -98
  167. package/dist/number-ticker.cjs.js +3 -3
  168. package/dist/number-ticker.esm.js +22 -43
  169. package/dist/odometer.cjs.js +1 -1
  170. package/dist/odometer.esm.js +5 -9
  171. package/dist/orbiter.cjs.js +13 -13
  172. package/dist/orbiter.esm.js +79 -90
  173. package/dist/{overlayManager-5bbd4dc3.mjs → overlayManager-BJjU1VA8.mjs} +4 -5
  174. package/dist/{overlayManager-0eda4e08.js → overlayManager-CSy3fJmJ.js} +1 -1
  175. package/dist/pagination.cjs.js +2 -2
  176. package/dist/pagination.esm.js +14 -18
  177. package/dist/{panel-group-a376cc5e.mjs → panel-group-8sVNnGxg.mjs} +24 -46
  178. package/dist/panel-group-CaD0_KQf.js +36 -0
  179. package/dist/panel-group.cjs.js +1 -1
  180. package/dist/panel-group.esm.js +2 -5
  181. package/dist/panel.cjs.js +4 -4
  182. package/dist/panel.esm.js +8 -10
  183. package/dist/password-field.cjs.js +9 -9
  184. package/dist/password-field.esm.js +62 -82
  185. package/dist/pin-input.cjs.js +3 -3
  186. package/dist/pin-input.esm.js +33 -39
  187. package/dist/placement-grid.cjs.js +4 -4
  188. package/dist/placement-grid.esm.js +108 -131
  189. package/dist/plugin-panel.cjs.js +7 -7
  190. package/dist/plugin-panel.esm.js +13 -15
  191. package/dist/popover.cjs.js +2 -2
  192. package/dist/popover.esm.js +21 -31
  193. package/dist/portal-DgpQ3Jo1.js +1 -0
  194. package/dist/{portal-fe73e5cc.mjs → portal-bR42gHvG.mjs} +43 -48
  195. package/dist/portal.cjs.js +3 -3
  196. package/dist/portal.esm.js +20 -28
  197. package/dist/{positioner-e9770c66.mjs → positioner-D0VGxtYU.mjs} +189 -209
  198. package/dist/positioner-D_fqyx_j.js +1 -0
  199. package/dist/positioner.cjs.js +2 -2
  200. package/dist/positioner.esm.js +22 -28
  201. package/dist/presence.cjs.js +1 -1
  202. package/dist/presence.esm.js +7 -13
  203. package/dist/primitives/auto-scroll.d.ts +9 -0
  204. package/dist/primitives/auto-scroll.d.ts.map +1 -0
  205. package/dist/primitives/selector.d.ts +4 -0
  206. package/dist/primitives/selector.d.ts.map +1 -0
  207. package/dist/progress.cjs.js +1 -1
  208. package/dist/progress.esm.js +5 -9
  209. package/dist/quick-actions.cjs.js +6 -6
  210. package/dist/quick-actions.esm.js +52 -62
  211. package/dist/radio-group.cjs.js +13 -13
  212. package/dist/radio-group.esm.js +39 -51
  213. package/dist/radio.cjs.js +1 -1
  214. package/dist/radio.esm.js +5 -9
  215. package/dist/rating.cjs.js +1 -1
  216. package/dist/rating.esm.js +12 -23
  217. package/dist/{roving-focus-group-4350c9a7.mjs → roving-focus-group-Dbm1Jko_.mjs} +3 -6
  218. package/dist/roving-focus-group.cjs.js +1 -1
  219. package/dist/roving-focus-group.esm.js +3 -5
  220. package/dist/runtime-CTaOSmBj.js +1 -0
  221. package/dist/{runtime-161f68a2.mjs → runtime-D1gFh1fS.mjs} +338 -366
  222. package/dist/runtime.cjs.js +1 -1
  223. package/dist/runtime.esm.js +6 -6
  224. package/dist/scroll-area.cjs.js +3 -3
  225. package/dist/scroll-area.esm.js +38 -46
  226. package/dist/{scroll-lock-31da444f.mjs → scroll-lock-LfqXXqsu.mjs} +5 -9
  227. package/dist/section.cjs.js +1 -1
  228. package/dist/section.esm.js +1 -1
  229. package/dist/select.cjs.js +7 -7
  230. package/dist/select.esm.js +67 -97
  231. package/dist/selection-popup.cjs.js +1 -1
  232. package/dist/selection-popup.esm.js +8 -15
  233. package/dist/selector-BvAh35ve.js +1 -0
  234. package/dist/selector-WI8pD7YO.mjs +18 -0
  235. package/dist/separator.cjs.js +1 -1
  236. package/dist/separator.esm.js +1 -1
  237. package/dist/sidebar.cjs.js +18 -18
  238. package/dist/sidebar.esm.js +117 -139
  239. package/dist/skeleton.cjs.js +11 -11
  240. package/dist/skeleton.esm.js +27 -24
  241. package/dist/slider.cjs.js +1 -1
  242. package/dist/slider.esm.js +6 -11
  243. package/dist/slot.cjs.js +4 -4
  244. package/dist/slot.esm.js +16 -19
  245. package/dist/sortable.cjs.js +79 -65
  246. package/dist/sortable.esm.js +714 -734
  247. package/dist/spinning-text.cjs.js +12 -12
  248. package/dist/spinning-text.esm.js +80 -92
  249. package/dist/split-button.cjs.js +4 -4
  250. package/dist/split-button.esm.js +77 -62
  251. package/dist/splitter.cjs.js +1 -1
  252. package/dist/splitter.esm.js +1 -1
  253. package/dist/stepper.cjs.js +8 -8
  254. package/dist/stepper.esm.js +32 -52
  255. package/dist/switch.cjs.js +7 -7
  256. package/dist/switch.esm.js +23 -31
  257. package/dist/table.cjs.js +2 -2
  258. package/dist/table.esm.js +46 -56
  259. package/dist/tabs.cjs.js +8 -8
  260. package/dist/tabs.esm.js +89 -109
  261. package/dist/tags-input.cjs.js +4 -4
  262. package/dist/tags-input.esm.js +45 -62
  263. package/dist/textarea.cjs.js +10 -10
  264. package/dist/textarea.esm.js +49 -52
  265. package/dist/time-field.cjs.js +4 -4
  266. package/dist/time-field.esm.js +70 -84
  267. package/dist/time-picker.cjs.js +22 -22
  268. package/dist/time-picker.esm.js +88 -110
  269. package/dist/timeline.cjs.js +1 -1
  270. package/dist/timeline.esm.js +3 -5
  271. package/dist/toast.cjs.js +2 -2
  272. package/dist/toast.esm.js +33 -47
  273. package/dist/toggle-group.cjs.js +6 -6
  274. package/dist/toggle-group.esm.js +85 -105
  275. package/dist/toggle.cjs.js +1 -1
  276. package/dist/toggle.esm.js +3 -5
  277. package/dist/toolbar.cjs.js +1 -1
  278. package/dist/toolbar.esm.js +13 -24
  279. package/dist/tooltip.cjs.js +2 -2
  280. package/dist/tooltip.esm.js +31 -42
  281. package/dist/transfer-list.cjs.js +31 -31
  282. package/dist/transfer-list.esm.js +114 -127
  283. package/dist/{tree-dcd74a4a.mjs → tree-B3kE8ESs.mjs} +55 -62
  284. package/dist/tree-Dx_kv_ih.js +39 -0
  285. package/dist/tree-item.cjs.js +2 -2
  286. package/dist/tree-item.esm.js +2 -3
  287. package/dist/tree.cjs.js +1 -1
  288. package/dist/tree.esm.js +2 -5
  289. package/dist/ui-button-Q0GNNWKC.mjs +665 -0
  290. package/dist/ui-button-rXQOS9QJ.js +521 -0
  291. package/dist/{icon-9e9da03b.js → ui-icon-BzVNC_lr.js} +4 -4
  292. package/dist/{icon-e2a85cc1.mjs → ui-icon-YI6lyuqU.mjs} +58 -65
  293. package/dist/visually-hidden.cjs.js +1 -1
  294. package/dist/visually-hidden.esm.js +1 -1
  295. package/dist/wizard.cjs.js +14 -14
  296. package/dist/wizard.esm.js +85 -105
  297. package/package.json +2 -2
  298. package/dist/date-time-utils-66480de4.js +0 -1
  299. package/dist/date-time-utils-a2c7af25.mjs +0 -307
  300. package/dist/dismissable-layer-193e3bed.js +0 -1
  301. package/dist/focus-scope-2b12b4e7.js +0 -1
  302. package/dist/listbox-308789a0.mjs +0 -210
  303. package/dist/listbox-ef2f708e.js +0 -46
  304. package/dist/panel-group-40254cdd.js +0 -36
  305. package/dist/portal-c69756c0.js +0 -1
  306. package/dist/positioner-33529bb8.js +0 -1
  307. package/dist/runtime-3f13807b.js +0 -1
  308. package/dist/tree-0a7a8d05.js +0 -39
  309. /package/dist/{collection-a2969ad2.js → collection-qv8A8rq4.js} +0 -0
  310. /package/dist/{menu-item-styles-27fdbac4.mjs → menu-item-styles-CZiPwPwl.mjs} +0 -0
  311. /package/dist/{menu-item-styles-83ad1e22.js → menu-item-styles-CbNUEwP2.js} +0 -0
  312. /package/dist/{roving-focus-group-5c059bf9.js → roving-focus-group-BdJ_4Njm.js} +0 -0
  313. /package/dist/{scroll-lock-d7b0df21.js → scroll-lock-BX6e3Ced.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { E as D } from "./ElementBase-909688f3.mjs";
1
+ import { E as D } from "./ElementBase-YlTLMsGk.mjs";
2
2
  const q = `
3
3
  :host {
4
4
  --ui-transfer-accent: var(--ui-color-primary, #2563eb);
@@ -658,72 +658,66 @@ const q = `
658
658
  }
659
659
  }
660
660
  `;
661
- function l(n) {
661
+ function s(n) {
662
662
  return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
663
663
  }
664
- function y(n) {
665
- if (!n)
666
- return [];
664
+ function k(n) {
665
+ if (!n) return [];
667
666
  try {
668
- const r = JSON.parse(n);
669
- if (!Array.isArray(r))
670
- return [];
667
+ const e = JSON.parse(n);
668
+ if (!Array.isArray(e)) return [];
671
669
  const t = [];
672
- return r.forEach((e) => {
673
- if (!e || typeof e != "object")
674
- return;
670
+ return e.forEach((r) => {
671
+ if (!r || typeof r != "object") return;
675
672
  const a = {
676
- value: String(e.value ?? ""),
677
- label: String(e.label ?? e.value ?? ""),
678
- disabled: !!e.disabled
673
+ value: String(r.value ?? ""),
674
+ label: String(r.label ?? r.value ?? ""),
675
+ disabled: !!r.disabled
679
676
  };
680
- e.description && (a.description = String(e.description)), a.value && t.push(a);
677
+ r.description && (a.description = String(r.description)), a.value && t.push(a);
681
678
  }), t;
682
679
  } catch {
683
680
  return [];
684
681
  }
685
682
  }
686
- function _(n) {
687
- if (!n)
688
- return [];
683
+ function w(n) {
684
+ if (!n) return [];
689
685
  try {
690
- const r = JSON.parse(n);
691
- return Array.isArray(r) ? r.map((t) => String(t)) : [];
686
+ const e = JSON.parse(n);
687
+ return Array.isArray(e) ? e.map((t) => String(t)) : [];
692
688
  } catch {
693
689
  return [];
694
690
  }
695
691
  }
696
- function k(n, r) {
697
- return new Set(Array.from(n).filter((t) => r.has(t)));
692
+ function A(n, e) {
693
+ return new Set(Array.from(n).filter((t) => e.has(t)));
698
694
  }
699
695
  function R(n) {
700
696
  return n === "tick" || n === "none" ? n : "checkbox";
701
697
  }
702
- function h(n, r) {
703
- return n == null ? r : n === "" || n === "true" || n === "1" || n === "yes" ? !0 : n === "false" || n === "0" || n === "no" ? !1 : r;
698
+ function p(n, e) {
699
+ return n == null ? e : n === "" || n === "true" || n === "1" || n === "yes" ? !0 : n === "false" || n === "0" || n === "no" ? !1 : e;
704
700
  }
705
- function w(n) {
701
+ function $(n) {
706
702
  return `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" focusable="false" aria-hidden="true"><path d="${n === "right" ? "M9 6l6 6-6 6" : "M15 6l-6 6 6 6"}"/></svg>`;
707
703
  }
708
704
  class U extends D {
709
705
  constructor() {
710
- super(...arguments), this._options = [], this._value = [], this._selectedAvailable = /* @__PURE__ */ new Set(), this._selectedChosen = /* @__PURE__ */ new Set(), this._formUnregister = null, this._suppressValueAttr = !1, this._delegatedListenersAttached = !1, this._handleRootClick = (r) => {
711
- const t = r.target;
712
- if (!t)
713
- return;
714
- const e = t.closest(".move-btn");
715
- if (e && this.root.contains(e)) {
716
- this._move(e.getAttribute("data-action"));
706
+ super(...arguments), this._options = [], this._value = [], this._selectedAvailable = /* @__PURE__ */ new Set(), this._selectedChosen = /* @__PURE__ */ new Set(), this._formUnregister = null, this._suppressValueAttr = !1, this._delegatedListenersAttached = !1, this._handleRootClick = (e) => {
707
+ const t = e.target;
708
+ if (!t) return;
709
+ const r = t.closest(".move-btn");
710
+ if (r && this.root.contains(r)) {
711
+ this._move(r.getAttribute("data-action"));
717
712
  return;
718
713
  }
719
714
  const a = t.closest(".item");
720
715
  a && this.root.contains(a) && this._toggleItem(a);
721
- }, this._handleRootKeyDown = (r) => {
722
- const t = r.target;
723
- if (!t)
724
- return;
725
- const e = t.closest(".item");
726
- e && this.root.contains(e) && this._onItemKeyDown(r, e);
716
+ }, this._handleRootKeyDown = (e) => {
717
+ const t = e.target;
718
+ if (!t) return;
719
+ const r = t.closest(".item");
720
+ r && this.root.contains(r) && this._onItemKeyDown(e, r);
727
721
  };
728
722
  }
729
723
  static get observedAttributes() {
@@ -755,8 +749,8 @@ class U extends D {
755
749
  get value() {
756
750
  return [...this._value];
757
751
  }
758
- set value(r) {
759
- this._applyValue(r, "api");
752
+ set value(e) {
753
+ this._applyValue(e, "api");
760
754
  }
761
755
  connectedCallback() {
762
756
  super.connectedCallback(), this._attachDelegatedListeners(), this._registerWithForm();
@@ -764,141 +758,135 @@ class U extends D {
764
758
  disconnectedCallback() {
765
759
  this._formUnregister && this._formUnregister(), this._detachDelegatedListeners(), super.disconnectedCallback();
766
760
  }
767
- attributeChangedCallback(r, t, e) {
768
- t !== e && (r === "options" && (this._options = y(e)), r === "value" && !this._suppressValueAttr && (this._value = _(e)), r === "name" && this.isConnected && this._registerWithForm(), r === "disabled" && (this._selectedAvailable.clear(), this._selectedChosen.clear()), this.isConnected && this.requestRender());
761
+ attributeChangedCallback(e, t, r) {
762
+ t !== r && (e === "options" && (this._options = k(r)), e === "value" && !this._suppressValueAttr && (this._value = w(r)), e === "name" && this.isConnected && this._registerWithForm(), e === "disabled" && (this._selectedAvailable.clear(), this._selectedChosen.clear()), this.isConnected && this.requestRender());
769
763
  }
770
764
  render() {
771
- this._options.length || (this._options = y(this.getAttribute("options"))), !this._value.length && this.getAttribute("value") && (this._value = _(this.getAttribute("value")));
772
- const r = new Set(this._value), t = this._options.filter((i) => !r.has(i.value)), e = this._options.filter((i) => r.has(i.value)), a = new Set(t.map((i) => i.value)), o = new Set(e.map((i) => i.value));
773
- this._selectedAvailable = k(this._selectedAvailable, a), this._selectedChosen = k(this._selectedChosen, o);
774
- const s = this.getAttribute("label") || "", c = this.getAttribute("description") || "", u = this.getAttribute("error") || "", d = this.getAttribute("available-label") || "Available", f = this.getAttribute("selected-label") || "Selected", A = this.getAttribute("available-empty-label") || "No items available to add.", $ = this.getAttribute("selected-empty-label") || "No items selected yet.", C = R(this.getAttribute("selection-indicator")), S = this.getAttribute("add-action-label") || "Add selected", L = this.getAttribute("remove-action-label") || "Remove selected", p = h(this.getAttribute("show-action-labels"), !0), b = h(this.getAttribute("show-action-counts"), !0), m = h(this.getAttribute("show-panel-counts"), !0), g = this.getAttribute("radius"), E = g ? ` style="--ui-transfer-panel-radius:${l(g)};"` : "", v = () => C === "none" ? "" : '<span class="indicator" part="indicator" aria-hidden="true"><span class="indicator-box"><span class="indicator-mark">✓</span></span></span>', x = (i) => p ? `<span class="move-btn-text">${l(i)}</span>` : "", z = (i) => b ? `<span class="move-btn-count">${i}</span>` : "", I = t.length ? t.map(
765
+ this._options.length || (this._options = k(this.getAttribute("options"))), !this._value.length && this.getAttribute("value") && (this._value = w(this.getAttribute("value")));
766
+ const e = new Set(this._value), t = this._options.filter((i) => !e.has(i.value)), r = this._options.filter((i) => e.has(i.value)), a = new Set(t.map((i) => i.value)), l = new Set(r.map((i) => i.value));
767
+ this._selectedAvailable = A(this._selectedAvailable, a), this._selectedChosen = A(this._selectedChosen, l);
768
+ const o = this.getAttribute("label") || "", c = this.getAttribute("description") || "", d = this.getAttribute("error") || "", b = this.getAttribute("available-label") || "Available", h = this.getAttribute("selected-label") || "Selected", C = this.getAttribute("available-empty-label") || "No items available to add.", S = this.getAttribute("selected-empty-label") || "No items selected yet.", L = R(this.getAttribute("selection-indicator")), m = this.getAttribute("add-action-label") || "Add selected", g = this.getAttribute("remove-action-label") || "Remove selected", u = p(this.getAttribute("show-action-labels"), !0), f = p(this.getAttribute("show-action-counts"), !0), v = p(this.getAttribute("show-panel-counts"), !0), x = this.getAttribute("radius"), E = x ? ` style="--ui-transfer-panel-radius:${s(x)};"` : "", z = () => L === "none" ? "" : '<span class="indicator" part="indicator" aria-hidden="true"><span class="indicator-box"><span class="indicator-mark">✓</span></span></span>', y = (i) => u ? `<span class="move-btn-text">${s(i)}</span>` : "", _ = (i) => f ? `<span class="move-btn-count">${i}</span>` : "", I = t.length ? t.map(
775
769
  (i) => `<div
776
770
  class="item"
777
771
  part="item available-item"
778
772
  role="option"
779
773
  data-side="available"
780
- data-value="${l(i.value)}"
774
+ data-value="${s(i.value)}"
781
775
  data-selected="${this._selectedAvailable.has(i.value)}"
782
776
  aria-selected="${this._selectedAvailable.has(i.value) ? "true" : "false"}"
783
777
  aria-disabled="${i.disabled ? "true" : "false"}"
784
778
  tabindex="${i.disabled ? "-1" : "0"}"
785
779
  >
786
- ${v()}
780
+ ${z()}
787
781
  <div class="item-copy">
788
- <span class="item-title">${l(i.label)}</span>
789
- ${i.description ? `<span class="item-description">${l(i.description)}</span>` : ""}
782
+ <span class="item-title">${s(i.label)}</span>
783
+ ${i.description ? `<span class="item-description">${s(i.description)}</span>` : ""}
790
784
  </div>
791
785
  </div>`
792
- ).join("") : `<div class="empty" part="empty">${l(A)}</div>`, V = e.length ? e.map(
786
+ ).join("") : `<div class="empty" part="empty">${s(C)}</div>`, V = r.length ? r.map(
793
787
  (i) => `<div
794
788
  class="item"
795
789
  part="item selected-item"
796
790
  role="option"
797
791
  data-side="chosen"
798
- data-value="${l(i.value)}"
792
+ data-value="${s(i.value)}"
799
793
  data-selected="${this._selectedChosen.has(i.value)}"
800
794
  aria-selected="${this._selectedChosen.has(i.value) ? "true" : "false"}"
801
795
  aria-disabled="${i.disabled ? "true" : "false"}"
802
796
  tabindex="${i.disabled ? "-1" : "0"}"
803
797
  >
804
- ${v()}
798
+ ${z()}
805
799
  <div class="item-copy">
806
- <span class="item-title">${l(i.label)}</span>
807
- ${i.description ? `<span class="item-description">${l(i.description)}</span>` : ""}
800
+ <span class="item-title">${s(i.label)}</span>
801
+ ${i.description ? `<span class="item-description">${s(i.description)}</span>` : ""}
808
802
  </div>
809
803
  </div>`
810
- ).join("") : `<div class="empty" part="empty">${l($)}</div>`;
804
+ ).join("") : `<div class="empty" part="empty">${s(S)}</div>`;
811
805
  this.setContent(`
812
806
  <style>${q}</style>
813
807
  <div class="root"${E} part="root">
814
- ${s ? `<p class="label" part="label">${l(s)}</p>` : ""}
815
- ${c ? `<p class="description" part="description">${l(c)}</p>` : ""}
808
+ ${o ? `<p class="label" part="label">${s(o)}</p>` : ""}
809
+ ${c ? `<p class="description" part="description">${s(c)}</p>` : ""}
816
810
  <div class="shell" part="shell">
817
811
  <section class="panel" part="panel panel-available">
818
812
  <div class="panel-header" part="panel-header">
819
813
  <div class="panel-heading">
820
- <div class="panel-title">${l(d)}</div>
821
- ${m ? `<span class="panel-count" part="count">${t.length}</span>` : ""}
814
+ <div class="panel-title">${s(b)}</div>
815
+ ${v ? `<span class="panel-count" part="count">${t.length}</span>` : ""}
822
816
  </div>
823
817
  <div class="panel-help">Choose entries to move into the selected list.</div>
824
818
  </div>
825
- <div class="list" part="list available-list" data-list="available" role="listbox" aria-multiselectable="true">${I}</div>
819
+ <div class="list" part="list available-list" data-list="available" role="listbox" aria-multiselectable="true" aria-label="${s(b)}">${I}</div>
826
820
  <div class="summary" part="summary">${t.length} available</div>
827
821
  </section>
828
822
  <div class="actions" part="actions">
829
- <button class="move-btn" part="action-button action-add" data-compact="${!p && !b}" data-action="add" type="button"${this._selectedAvailable.size ? "" : " disabled"}>
830
- <span class="move-btn-icon" aria-hidden="true">${w("right")}</span>
831
- ${x(S)}
832
- ${z(this._selectedAvailable.size || 0)}
823
+ <button class="move-btn" part="action-button action-add" data-compact="${!u && !f}" data-action="add" type="button"${u ? "" : ` aria-label="${s(m)}"`}${this._selectedAvailable.size ? "" : " disabled"}>
824
+ <span class="move-btn-icon" aria-hidden="true">${$("right")}</span>
825
+ ${y(m)}
826
+ ${_(this._selectedAvailable.size || 0)}
833
827
  </button>
834
- <button class="move-btn" part="action-button action-remove" data-compact="${!p && !b}" data-action="remove" type="button"${this._selectedChosen.size ? "" : " disabled"}>
835
- <span class="move-btn-icon" aria-hidden="true">${w("left")}</span>
836
- ${x(L)}
837
- ${z(this._selectedChosen.size || 0)}
828
+ <button class="move-btn" part="action-button action-remove" data-compact="${!u && !f}" data-action="remove" type="button"${u ? "" : ` aria-label="${s(g)}"`}${this._selectedChosen.size ? "" : " disabled"}>
829
+ <span class="move-btn-icon" aria-hidden="true">${$("left")}</span>
830
+ ${y(g)}
831
+ ${_(this._selectedChosen.size || 0)}
838
832
  </button>
839
833
  </div>
840
834
  <section class="panel" part="panel panel-selected">
841
835
  <div class="panel-header" part="panel-header">
842
836
  <div class="panel-heading">
843
- <div class="panel-title">${l(f)}</div>
844
- ${m ? `<span class="panel-count" part="count">${e.length}</span>` : ""}
837
+ <div class="panel-title">${s(h)}</div>
838
+ ${v ? `<span class="panel-count" part="count">${r.length}</span>` : ""}
845
839
  </div>
846
840
  <div class="panel-help">Use the remove action to send items back.</div>
847
841
  </div>
848
- <div class="list" part="list selected-list" data-list="chosen" role="listbox" aria-multiselectable="true">${V}</div>
849
- <div class="summary" part="summary">${e.length} selected</div>
842
+ <div class="list" part="list selected-list" data-list="chosen" role="listbox" aria-multiselectable="true" aria-label="${s(h)}">${V}</div>
843
+ <div class="summary" part="summary">${r.length} selected</div>
850
844
  </section>
851
845
  </div>
852
- ${u ? `<p class="error" part="error">${l(u)}</p>` : ""}
846
+ ${d ? `<p class="error" part="error">${s(d)}</p>` : ""}
853
847
  </div>
854
848
  `);
855
849
  }
856
- _toggleItem(r) {
857
- if (this.hasAttribute("disabled"))
858
- return;
859
- const t = r.getAttribute("data-side"), e = r.getAttribute("data-value") || "";
860
- if (!e)
861
- return;
850
+ _toggleItem(e) {
851
+ if (this.hasAttribute("disabled")) return;
852
+ const t = e.getAttribute("data-side"), r = e.getAttribute("data-value") || "";
853
+ if (!r) return;
862
854
  const a = t === "chosen" ? this._selectedChosen : this._selectedAvailable;
863
- a.has(e) ? a.delete(e) : a.add(e), r.setAttribute("data-selected", a.has(e) ? "true" : "false"), r.setAttribute("aria-selected", a.has(e) ? "true" : "false"), this._syncActionButtons();
855
+ a.has(r) ? a.delete(r) : a.add(r), e.setAttribute("data-selected", a.has(r) ? "true" : "false"), e.setAttribute("aria-selected", a.has(r) ? "true" : "false"), this._syncActionButtons();
864
856
  }
865
- _onItemKeyDown(r, t) {
866
- var u, d, f;
867
- const e = t.getAttribute("data-side");
868
- if (!e)
869
- return;
870
- if (r.key === "Enter" || r.key === " ") {
871
- r.preventDefault(), this._toggleItem(t);
857
+ _onItemKeyDown(e, t) {
858
+ const r = t.getAttribute("data-side");
859
+ if (!r) return;
860
+ if (e.key === "Enter" || e.key === " ") {
861
+ e.preventDefault(), this._toggleItem(t);
872
862
  return;
873
863
  }
874
- if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(r.key))
875
- return;
876
- r.preventDefault();
877
- const a = this.root.querySelector(`[data-list="${e}"]`), o = Array.from((a == null ? void 0 : a.querySelectorAll('.item[tabindex="0"]')) || []);
878
- if (!o.length)
879
- return;
880
- const s = o.indexOf(t);
881
- if (r.key === "Home") {
882
- (u = o[0]) == null || u.focus();
864
+ if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(e.key)) return;
865
+ e.preventDefault();
866
+ const a = this.root.querySelector(`[data-list="${r}"]`), l = Array.from(a?.querySelectorAll('.item[tabindex="0"]') || []);
867
+ if (!l.length) return;
868
+ const o = l.indexOf(t);
869
+ if (e.key === "Home") {
870
+ l[0]?.focus();
883
871
  return;
884
872
  }
885
- if (r.key === "End") {
886
- (d = o[o.length - 1]) == null || d.focus();
873
+ if (e.key === "End") {
874
+ l[l.length - 1]?.focus();
887
875
  return;
888
876
  }
889
- const c = r.key === "ArrowDown" ? Math.min(o.length - 1, s + 1) : Math.max(0, s - 1);
890
- (f = o[c]) == null || f.focus();
877
+ const c = e.key === "ArrowDown" ? Math.min(l.length - 1, o + 1) : Math.max(0, o - 1);
878
+ l[c]?.focus();
891
879
  }
892
- _move(r) {
880
+ _move(e) {
893
881
  if (!this.hasAttribute("disabled")) {
894
- if (r === "add") {
895
- const t = [...this._value, ...Array.from(this._selectedAvailable).filter((e) => !this._value.includes(e))];
882
+ if (e === "add") {
883
+ const t = [...this._value, ...Array.from(this._selectedAvailable).filter((r) => !this._value.includes(r))];
896
884
  this._selectedAvailable.clear(), this._applyValue(t, "transfer-right");
897
885
  return;
898
886
  }
899
- if (r === "remove") {
900
- const t = new Set(this._selectedChosen), e = this._value.filter((a) => !t.has(a));
901
- this._selectedChosen.clear(), this._applyValue(e, "transfer-left");
887
+ if (e === "remove") {
888
+ const t = new Set(this._selectedChosen), r = this._value.filter((a) => !t.has(a));
889
+ this._selectedChosen.clear(), this._applyValue(r, "transfer-left");
902
890
  }
903
891
  }
904
892
  }
@@ -908,8 +896,8 @@ class U extends D {
908
896
  _detachDelegatedListeners() {
909
897
  this._delegatedListenersAttached && (this.root.removeEventListener("click", this._handleRootClick), this.root.removeEventListener("keydown", this._handleRootKeyDown), this._delegatedListenersAttached = !1);
910
898
  }
911
- _applyValue(r, t) {
912
- const e = new Set(this._options.map((s) => s.value)), a = Array.from(new Set(r.filter((s) => s && (e.size === 0 || e.has(s))))), o = [...this._value];
899
+ _applyValue(e, t) {
900
+ const r = new Set(this._options.map((o) => o.value)), a = Array.from(new Set(e.filter((o) => o && (r.size === 0 || r.has(o))))), l = [...this._value];
913
901
  this._value = a, this._suppressValueAttr = !0;
914
902
  try {
915
903
  a.length ? this.setAttribute("value", JSON.stringify(a)) : this.removeAttribute("value");
@@ -920,8 +908,8 @@ class U extends D {
920
908
  new CustomEvent("change", {
921
909
  detail: {
922
910
  value: [...this._value],
923
- previousValue: o,
924
- selectedItems: this._options.filter((s) => this._value.includes(s.value)),
911
+ previousValue: l,
912
+ selectedItems: this._options.filter((o) => this._value.includes(o.value)),
925
913
  source: t
926
914
  },
927
915
  bubbles: !0,
@@ -930,33 +918,32 @@ class U extends D {
930
918
  );
931
919
  }
932
920
  _syncActionButtons() {
933
- const r = this.root.querySelector('[data-action="add"]'), t = this.root.querySelector('[data-action="remove"]');
934
- if (r) {
935
- r.disabled = this._selectedAvailable.size === 0;
936
- const e = r.querySelector(".move-btn-count");
937
- e && (e.textContent = String(this._selectedAvailable.size));
921
+ const e = this.root.querySelector('[data-action="add"]'), t = this.root.querySelector('[data-action="remove"]');
922
+ if (e) {
923
+ e.disabled = this._selectedAvailable.size === 0;
924
+ const r = e.querySelector(".move-btn-count");
925
+ r && (r.textContent = String(this._selectedAvailable.size));
938
926
  }
939
927
  if (t) {
940
928
  t.disabled = this._selectedChosen.size === 0;
941
- const e = t.querySelector(".move-btn-count");
942
- e && (e.textContent = String(this._selectedChosen.size));
929
+ const r = t.querySelector(".move-btn-count");
930
+ r && (r.textContent = String(this._selectedChosen.size));
943
931
  }
944
932
  }
945
933
  _registerWithForm() {
946
- var r;
947
934
  this._formUnregister && (this._formUnregister(), this._formUnregister = null);
948
935
  try {
949
- const e = this.getRootNode().host, o = ((r = e == null ? void 0 : e.closest) == null ? void 0 : r.call(e, "ui-form")) || null || this.closest("ui-form"), s = this.getAttribute("name");
950
- o && typeof o.registerField == "function" && s && (this._formUnregister = o.registerField(s, {
951
- name: s,
936
+ const a = this.getRootNode().host?.closest?.("ui-form") || null || this.closest("ui-form"), l = this.getAttribute("name");
937
+ a && typeof a.registerField == "function" && l && (this._formUnregister = a.registerField(l, {
938
+ name: l,
952
939
  getValue: () => [...this._value],
953
- setValue: (c) => {
954
- const u = Array.isArray(c) ? c.map((d) => String(d)) : [];
955
- this._applyValue(u, "api");
940
+ setValue: (o) => {
941
+ const c = Array.isArray(o) ? o.map((d) => String(d)) : [];
942
+ this._applyValue(c, "api");
956
943
  },
957
944
  validate: async () => ({ valid: !this.hasAttribute("required") || this._value.length > 0, message: "Select at least one item." }),
958
- setError: (c) => {
959
- c ? (this.setAttribute("error", c), this.setAttribute("invalid", "")) : (this.removeAttribute("error"), this.removeAttribute("invalid")), this.requestRender();
945
+ setError: (o) => {
946
+ o ? (this.setAttribute("error", o), this.setAttribute("invalid", "")) : (this.removeAttribute("error"), this.removeAttribute("invalid")), this.requestRender();
960
947
  }
961
948
  }));
962
949
  } catch {
@@ -1,56 +1,55 @@
1
- import { E as g } from "./ElementBase-909688f3.mjs";
2
- import { n as b } from "./collection-a1aac0c6.mjs";
1
+ import { E as g } from "./ElementBase-YlTLMsGk.mjs";
2
+ import { n as b } from "./collection-C7URGjEI.mjs";
3
3
  import { UITreeItem as f } from "./tree-item.esm.js";
4
- function C(a, t) {
5
- const e = [], i = t.getExpanded || (() => !1), r = t.getDisabled || (() => !1), s = (o, d, n) => {
6
- o.forEach((l) => {
7
- const u = t.getChildren(l) || [], c = {
8
- item: l,
9
- id: t.getId(l),
10
- label: t.getLabel(l),
11
- level: d,
12
- parentId: n,
13
- disabled: r(l),
14
- expanded: i(l),
4
+ function C(l, t) {
5
+ const e = [], i = t.getExpanded || (() => !1), r = t.getDisabled || (() => !1), s = (d, n, o) => {
6
+ d.forEach((a) => {
7
+ const u = t.getChildren(a) || [], c = {
8
+ item: a,
9
+ id: t.getId(a),
10
+ label: t.getLabel(a),
11
+ level: n,
12
+ parentId: o,
13
+ disabled: r(a),
14
+ expanded: i(a),
15
15
  hasChildren: u.length > 0
16
16
  };
17
- e.push(c), s(u, d + 1, c.id);
17
+ e.push(c), s(u, n + 1, c.id);
18
18
  });
19
19
  };
20
- return s(a, 1, null), e;
20
+ return s(l, 1, null), e;
21
21
  }
22
- function _(a, t) {
23
- const e = [], i = t.getExpanded || (() => !1), r = t.getDisabled || (() => !1), s = (o, d, n) => {
24
- o.forEach((l) => {
25
- const u = t.getChildren(l) || [], c = i(l), h = {
26
- item: l,
27
- id: t.getId(l),
28
- label: t.getLabel(l),
29
- level: d,
30
- parentId: n,
31
- disabled: r(l),
22
+ function _(l, t) {
23
+ const e = [], i = t.getExpanded || (() => !1), r = t.getDisabled || (() => !1), s = (d, n, o) => {
24
+ d.forEach((a) => {
25
+ const u = t.getChildren(a) || [], c = i(a), h = {
26
+ item: a,
27
+ id: t.getId(a),
28
+ label: t.getLabel(a),
29
+ level: n,
30
+ parentId: o,
31
+ disabled: r(a),
32
32
  expanded: c,
33
33
  hasChildren: u.length > 0
34
34
  };
35
- e.push(h), h.hasChildren && c && s(u, d + 1, h.id);
35
+ e.push(h), h.hasChildren && c && s(u, n + 1, h.id);
36
36
  });
37
37
  };
38
- return s(a, 1, null), e;
38
+ return s(l, 1, null), e;
39
39
  }
40
- function p(a, t) {
41
- return a.findIndex((e) => e.id === t);
40
+ function p(l, t) {
41
+ return l.findIndex((e) => e.id === t);
42
42
  }
43
- function m(a, t) {
44
- const e = a[t];
45
- return e != null && e.parentId ? a.findIndex((i) => i.id === e.parentId) : -1;
43
+ function m(l, t) {
44
+ const e = l[t];
45
+ return e?.parentId ? l.findIndex((i) => i.id === e.parentId) : -1;
46
46
  }
47
- function y(a, t, e = -1) {
47
+ function y(l, t, e = -1) {
48
48
  const i = b(t);
49
- if (!i)
50
- return -1;
51
- for (let r = 1; r <= a.length; r += 1) {
52
- const s = (e + r + a.length) % a.length, o = a[s];
53
- if (!o.disabled && b(o.label).startsWith(i))
49
+ if (!i) return -1;
50
+ for (let r = 1; r <= l.length; r += 1) {
51
+ const s = (e + r + l.length) % l.length, d = l[s];
52
+ if (!d.disabled && b(d.label).startsWith(i))
54
53
  return s;
55
54
  }
56
55
  return -1;
@@ -100,8 +99,7 @@ class x extends g {
100
99
  super.connectedCallback(), this.addEventListener("click", this._onClick), this.addEventListener("keydown", this._onKeyDown), this._observer = new MutationObserver(this._onMutation), this._observer.observe(this, { childList: !0, subtree: !0, attributes: !0, attributeFilter: ["expanded", "selected", "disabled", "label", "value"] }), queueMicrotask(() => this._syncTree());
101
100
  }
102
101
  disconnectedCallback() {
103
- var t;
104
- this.removeEventListener("click", this._onClick), this.removeEventListener("keydown", this._onKeyDown), (t = this._observer) == null || t.disconnect(), this._observer = null, this._typeaheadTimer != null && window.clearTimeout(this._typeaheadTimer), super.disconnectedCallback();
102
+ this.removeEventListener("click", this._onClick), this.removeEventListener("keydown", this._onKeyDown), this._observer?.disconnect(), this._observer = null, this._typeaheadTimer != null && window.clearTimeout(this._typeaheadTimer), super.disconnectedCallback();
105
103
  }
106
104
  get value() {
107
105
  return this.getAttribute("value") || "";
@@ -119,8 +117,7 @@ class x extends g {
119
117
  }
120
118
  toggle(t) {
121
119
  const e = this._findByValue(t);
122
- if (!e || e.childItems.length === 0)
123
- return;
120
+ if (!e || e.childItems.length === 0) return;
124
121
  const i = !e.hasAttribute("expanded");
125
122
  e.toggleAttribute("expanded", i), this._emitToggle(e, i), this._syncTree();
126
123
  }
@@ -158,14 +155,13 @@ class x extends g {
158
155
  return this._allItems().find((e) => e.value === t) || null;
159
156
  }
160
157
  _syncTree() {
161
- var d;
162
- const t = this._allItems(), e = this._visibleRecords(), i = this.value || ((d = e.find((n) => !n.disabled)) == null ? void 0 : d.id) || "", r = this._focusedValue && e.some((n) => n.id === this._focusedValue) ? this._focusedValue : i;
158
+ const t = this._allItems(), e = this._visibleRecords(), i = this.value || e.find((n) => !n.disabled)?.id || "", r = this._focusedValue && e.some((n) => n.id === this._focusedValue) ? this._focusedValue : i;
163
159
  this._focusedValue = r || null;
164
- const s = new Set(e.map((n) => n.id)), o = new Map(e.map((n) => [n.id, n]));
160
+ const s = new Set(e.map((n) => n.id)), d = new Map(e.map((n) => [n.id, n]));
165
161
  t.forEach((n) => {
166
- const l = o.get(n.value);
162
+ const o = d.get(n.value);
167
163
  n.style.setProperty("--ui-tree-indent", this.getAttribute("indent-size") || "16px"), n.applyTreeState({
168
- level: (l == null ? void 0 : l.level) || 1,
164
+ level: o?.level || 1,
169
165
  hasChildren: n.childItems.length > 0,
170
166
  expanded: n.hasAttribute("expanded"),
171
167
  selected: n.value === i,
@@ -176,13 +172,12 @@ class x extends g {
176
172
  }
177
173
  _moveFocus(t) {
178
174
  const e = this._visibleRecords();
179
- if (!e.length)
180
- return;
175
+ if (!e.length) return;
181
176
  const i = p(e, this._focusedValue || this.value || ""), r = i >= 0 ? i : -1;
182
177
  for (let s = 1; s <= e.length; s += 1) {
183
- const o = (r + t * s + e.length) % e.length, d = e[o];
184
- if (!d.disabled) {
185
- this.focusValue(d.id);
178
+ const d = (r + t * s + e.length) % e.length, n = e[d];
179
+ if (!n.disabled) {
180
+ this.focusValue(n.id);
186
181
  return;
187
182
  }
188
183
  }
@@ -207,8 +202,7 @@ class x extends g {
207
202
  }
208
203
  _onClick(t) {
209
204
  const e = t.composedPath(), i = e.find((s) => s instanceof f);
210
- if (!i || i.hasAttribute("disabled"))
211
- return;
205
+ if (!i || i.hasAttribute("disabled")) return;
212
206
  const r = e.find((s) => s instanceof HTMLElement && s.getAttribute("data-action") === "toggle");
213
207
  if (this._focusedValue = i.value, r && i.childItems.length > 0) {
214
208
  this.toggle(i.value);
@@ -218,8 +212,7 @@ class x extends g {
218
212
  }
219
213
  _onKeyDown(t) {
220
214
  const e = this._visibleRecords();
221
- if (!e.length)
222
- return;
215
+ if (!e.length) return;
223
216
  const i = p(e, this._focusedValue || this.value || ""), r = i >= 0 ? e[i] : e[0];
224
217
  if (r) {
225
218
  if (t.key === "ArrowDown") {
@@ -245,7 +238,7 @@ class x extends g {
245
238
  }
246
239
  if (r.hasChildren && r.expanded) {
247
240
  const s = e[i + 1];
248
- (s == null ? void 0 : s.parentId) === r.id && this.focusValue(s.id);
241
+ s?.parentId === r.id && this.focusValue(s.id);
249
242
  }
250
243
  return;
251
244
  }
@@ -286,9 +279,9 @@ class x extends g {
286
279
  typeof customElements < "u" && !customElements.get("ui-tree") && customElements.define("ui-tree", x);
287
280
  export {
288
281
  x as U,
289
- _ as a,
290
- p as b,
291
- m as c,
292
- y as d,
293
- C as f
282
+ p as a,
283
+ y as b,
284
+ C as c,
285
+ _ as d,
286
+ m as f
294
287
  };