@editora/ui-core 0.1.18 → 0.1.20

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 (307) 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 -669
  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 +4 -7
  48. package/dist/color-picker.cjs.js +9 -9
  49. package/dist/color-picker.esm.js +189 -252
  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-button.d.ts +1 -0
  57. package/dist/components/ui-button.d.ts.map +1 -1
  58. package/dist/components/ui-date-picker.d.ts.map +1 -1
  59. package/dist/components/ui-date-range-picker.d.ts.map +1 -1
  60. package/dist/components/ui-date-range-time-picker.d.ts +1 -0
  61. package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
  62. package/dist/components/ui-date-time-picker.d.ts +1 -0
  63. package/dist/components/ui-date-time-picker.d.ts.map +1 -1
  64. package/dist/components/ui-orbiter.d.ts.map +1 -1
  65. package/dist/components/ui-skeleton.d.ts.map +1 -1
  66. package/dist/components/ui-split-button.d.ts +1 -0
  67. package/dist/components/ui-split-button.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 +30 -9
  80. package/dist/date-picker.esm.js +90 -97
  81. package/dist/date-range-picker.cjs.js +22 -3
  82. package/dist/date-range-picker.esm.js +103 -108
  83. package/dist/date-range-time-picker.cjs.js +28 -12
  84. package/dist/date-range-time-picker.esm.js +137 -150
  85. package/dist/date-time-picker.cjs.js +25 -9
  86. package/dist/date-time-picker.esm.js +139 -155
  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 +4 -4
  162. package/dist/multi-select.esm.js +120 -140
  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 +2 -2
  196. package/dist/portal.esm.js +10 -19
  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 +11 -18
  201. package/dist/presence.cjs.js +1 -1
  202. package/dist/presence.esm.js +7 -13
  203. package/dist/progress.cjs.js +1 -1
  204. package/dist/progress.esm.js +5 -9
  205. package/dist/quick-actions.cjs.js +6 -6
  206. package/dist/quick-actions.esm.js +52 -62
  207. package/dist/radio-group.cjs.js +13 -13
  208. package/dist/radio-group.esm.js +39 -51
  209. package/dist/radio.cjs.js +1 -1
  210. package/dist/radio.esm.js +5 -9
  211. package/dist/rating.cjs.js +1 -1
  212. package/dist/rating.esm.js +12 -23
  213. package/dist/{roving-focus-group-4350c9a7.mjs → roving-focus-group-Dbm1Jko_.mjs} +3 -6
  214. package/dist/roving-focus-group.cjs.js +1 -1
  215. package/dist/roving-focus-group.esm.js +3 -5
  216. package/dist/runtime-CTaOSmBj.js +1 -0
  217. package/dist/{runtime-161f68a2.mjs → runtime-D1gFh1fS.mjs} +338 -366
  218. package/dist/runtime.cjs.js +1 -1
  219. package/dist/runtime.esm.js +6 -6
  220. package/dist/scroll-area.cjs.js +3 -3
  221. package/dist/scroll-area.esm.js +38 -46
  222. package/dist/{scroll-lock-31da444f.mjs → scroll-lock-LfqXXqsu.mjs} +5 -9
  223. package/dist/section.cjs.js +1 -1
  224. package/dist/section.esm.js +1 -1
  225. package/dist/select.cjs.js +7 -7
  226. package/dist/select.esm.js +67 -97
  227. package/dist/selection-popup.cjs.js +1 -1
  228. package/dist/selection-popup.esm.js +8 -15
  229. package/dist/separator.cjs.js +1 -1
  230. package/dist/separator.esm.js +1 -1
  231. package/dist/sidebar.cjs.js +18 -18
  232. package/dist/sidebar.esm.js +117 -139
  233. package/dist/skeleton.cjs.js +11 -11
  234. package/dist/skeleton.esm.js +27 -24
  235. package/dist/slider.cjs.js +1 -1
  236. package/dist/slider.esm.js +6 -11
  237. package/dist/slot.cjs.js +4 -4
  238. package/dist/slot.esm.js +16 -19
  239. package/dist/sortable.cjs.js +45 -45
  240. package/dist/sortable.esm.js +421 -524
  241. package/dist/spinning-text.cjs.js +12 -12
  242. package/dist/spinning-text.esm.js +80 -92
  243. package/dist/split-button.cjs.js +4 -4
  244. package/dist/split-button.esm.js +77 -62
  245. package/dist/splitter.cjs.js +1 -1
  246. package/dist/splitter.esm.js +1 -1
  247. package/dist/stepper.cjs.js +8 -8
  248. package/dist/stepper.esm.js +32 -52
  249. package/dist/switch.cjs.js +7 -7
  250. package/dist/switch.esm.js +23 -31
  251. package/dist/table.cjs.js +2 -2
  252. package/dist/table.esm.js +46 -56
  253. package/dist/tabs.cjs.js +3 -3
  254. package/dist/tabs.esm.js +35 -55
  255. package/dist/tags-input.cjs.js +4 -4
  256. package/dist/tags-input.esm.js +45 -62
  257. package/dist/textarea.cjs.js +6 -6
  258. package/dist/textarea.esm.js +32 -41
  259. package/dist/time-field.cjs.js +4 -4
  260. package/dist/time-field.esm.js +70 -84
  261. package/dist/time-picker.cjs.js +29 -21
  262. package/dist/time-picker.esm.js +96 -110
  263. package/dist/timeline.cjs.js +1 -1
  264. package/dist/timeline.esm.js +3 -5
  265. package/dist/toast.cjs.js +2 -2
  266. package/dist/toast.esm.js +33 -47
  267. package/dist/toggle-group.cjs.js +6 -6
  268. package/dist/toggle-group.esm.js +85 -105
  269. package/dist/toggle.cjs.js +1 -1
  270. package/dist/toggle.esm.js +3 -5
  271. package/dist/toolbar.cjs.js +1 -1
  272. package/dist/toolbar.esm.js +13 -24
  273. package/dist/tooltip.cjs.js +2 -2
  274. package/dist/tooltip.esm.js +31 -42
  275. package/dist/transfer-list.cjs.js +19 -19
  276. package/dist/transfer-list.esm.js +98 -111
  277. package/dist/{tree-dcd74a4a.mjs → tree-B3kE8ESs.mjs} +55 -62
  278. package/dist/tree-Dx_kv_ih.js +39 -0
  279. package/dist/tree-item.cjs.js +2 -2
  280. package/dist/tree-item.esm.js +2 -3
  281. package/dist/tree.cjs.js +1 -1
  282. package/dist/tree.esm.js +2 -5
  283. package/dist/ui-button-Q0GNNWKC.mjs +665 -0
  284. package/dist/ui-button-rXQOS9QJ.js +521 -0
  285. package/dist/{icon-9e9da03b.js → ui-icon-BzVNC_lr.js} +4 -4
  286. package/dist/{icon-e2a85cc1.mjs → ui-icon-YI6lyuqU.mjs} +58 -65
  287. package/dist/visually-hidden.cjs.js +1 -1
  288. package/dist/visually-hidden.esm.js +1 -1
  289. package/dist/wizard.cjs.js +14 -14
  290. package/dist/wizard.esm.js +85 -105
  291. package/package.json +3 -3
  292. package/dist/date-time-utils-66480de4.js +0 -1
  293. package/dist/date-time-utils-a2c7af25.mjs +0 -307
  294. package/dist/dismissable-layer-193e3bed.js +0 -1
  295. package/dist/focus-scope-2b12b4e7.js +0 -1
  296. package/dist/listbox-308789a0.mjs +0 -210
  297. package/dist/listbox-ef2f708e.js +0 -46
  298. package/dist/panel-group-40254cdd.js +0 -36
  299. package/dist/portal-c69756c0.js +0 -1
  300. package/dist/positioner-33529bb8.js +0 -1
  301. package/dist/runtime-3f13807b.js +0 -1
  302. package/dist/tree-0a7a8d05.js +0 -39
  303. /package/dist/{collection-a2969ad2.js → collection-qv8A8rq4.js} +0 -0
  304. /package/dist/{menu-item-styles-27fdbac4.mjs → menu-item-styles-CZiPwPwl.mjs} +0 -0
  305. /package/dist/{menu-item-styles-83ad1e22.js → menu-item-styles-CbNUEwP2.js} +0 -0
  306. /package/dist/{roving-focus-group-5c059bf9.js → roving-focus-group-BdJ_4Njm.js} +0 -0
  307. /package/dist/{scroll-lock-d7b0df21.js → scroll-lock-BX6e3Ced.js} +0 -0
@@ -1,8 +1,7 @@
1
- import { E as A } from "./ElementBase-909688f3.mjs";
2
- import { n as h } from "./collection-a1aac0c6.mjs";
3
- import { c as C } from "./dismissable-layer-9c7e6b58.mjs";
4
- import { r as k } from "./listbox-308789a0.mjs";
5
- import "./collection.esm.js";
1
+ import { E as A } from "./ElementBase-YlTLMsGk.mjs";
2
+ import { n as h } from "./collection-C7URGjEI.mjs";
3
+ import { c as C } from "./dismissable-layer-BmPIoK80.mjs";
4
+ import { r as k } from "./listbox-DJamVeFj.mjs";
6
5
  const F = `
7
6
  <svg viewBox="0 0 20 20" aria-hidden="true" focusable="false">
8
7
  <path d="m6 6 8 8M14 6l-8 8" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>
@@ -476,9 +475,8 @@ const F = `
476
475
  function a(d) {
477
476
  return d.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
478
477
  }
479
- function x(d) {
480
- if (d == null)
481
- return !1;
478
+ function _(d) {
479
+ if (d == null) return !1;
482
480
  const t = String(d).toLowerCase();
483
481
  return t !== "false" && t !== "0";
484
482
  }
@@ -525,8 +523,7 @@ class E extends A {
525
523
  }), this._attachFormRegistration();
526
524
  }
527
525
  disconnectedCallback() {
528
- var t;
529
- this._unbindGlobalListeners(), this._detachDomListeners(), (t = this._dismissableLayer) == null || t.destroy(), this._dismissableLayer = null, this._observer && (this._observer.disconnect(), this._observer = null), this._debounceTimer && (clearTimeout(this._debounceTimer), this._debounceTimer = null), this._optionsRefreshFrame && (cancelAnimationFrame(this._optionsRefreshFrame), this._optionsRefreshFrame = 0), this._autofocusFrame && (cancelAnimationFrame(this._autofocusFrame), this._autofocusFrame = 0), this._formUnregister && (this._formUnregister(), this._formUnregister = null), super.disconnectedCallback();
526
+ this._unbindGlobalListeners(), this._detachDomListeners(), this._dismissableLayer?.destroy(), this._dismissableLayer = null, this._observer && (this._observer.disconnect(), this._observer = null), this._debounceTimer && (clearTimeout(this._debounceTimer), this._debounceTimer = null), this._optionsRefreshFrame && (cancelAnimationFrame(this._optionsRefreshFrame), this._optionsRefreshFrame = 0), this._autofocusFrame && (cancelAnimationFrame(this._autofocusFrame), this._autofocusFrame = 0), this._formUnregister && (this._formUnregister(), this._formUnregister = null), super.disconnectedCallback();
530
527
  }
531
528
  attributeChangedCallback(t, e, i) {
532
529
  if (e !== i) {
@@ -567,7 +564,7 @@ class E extends A {
567
564
  this._setOpen(t, "api");
568
565
  }
569
566
  _isDisabled() {
570
- return x(this.getAttribute("disabled"));
567
+ return _(this.getAttribute("disabled"));
571
568
  }
572
569
  _isReadonly() {
573
570
  return this.hasAttribute("readonly");
@@ -581,46 +578,44 @@ class E extends A {
581
578
  }
582
579
  _stateText() {
583
580
  const t = this.getAttribute("state-text");
584
- if (t)
585
- return t;
581
+ if (t) return t;
586
582
  const e = this._state();
587
583
  return e === "loading" ? "Syncing results" : e === "error" ? "Unable to load results" : e === "success" ? "Results up to date" : "";
588
584
  }
589
585
  _emitOpenState(t, e, i) {
590
- const s = { open: t, previousOpen: e, source: i };
586
+ const r = { open: t, previousOpen: e, source: i };
591
587
  this.dispatchEvent(
592
588
  new CustomEvent(t ? "open" : "close", {
593
- detail: s,
589
+ detail: r,
594
590
  bubbles: !0,
595
591
  composed: !0
596
592
  })
597
593
  ), this.dispatchEvent(
598
594
  new CustomEvent(t ? "ui-open" : "ui-close", {
599
- detail: s,
595
+ detail: r,
600
596
  bubbles: !0,
601
597
  composed: !0
602
598
  })
603
599
  );
604
600
  }
605
601
  _attachFormRegistration() {
606
- var t;
607
602
  try {
608
- const i = this.getRootNode().host, r = ((t = i == null ? void 0 : i.closest) == null ? void 0 : t.call(i, "ui-form")) || null || this.closest("ui-form"), o = this.getAttribute("name");
609
- r && typeof r.registerField == "function" && o && (this._formUnregister = r.registerField(o, {
610
- name: o,
603
+ const r = this.getRootNode().host?.closest?.("ui-form") || null || this.closest("ui-form"), s = this.getAttribute("name");
604
+ r && typeof r.registerField == "function" && s && (this._formUnregister = r.registerField(s, {
605
+ name: s,
611
606
  getValue: () => this.value,
612
- setValue: (n) => {
613
- this.value = n;
607
+ setValue: (o) => {
608
+ this.value = o;
614
609
  },
615
610
  validate: async () => {
616
- const n = this._isCurrentValueValid();
611
+ const o = this._isCurrentValueValid();
617
612
  return {
618
- valid: n,
619
- message: n ? void 0 : "Please select a value from the list."
613
+ valid: o,
614
+ message: o ? void 0 : "Please select a value from the list."
620
615
  };
621
616
  },
622
- setError: (n) => {
623
- n ? (this.setAttribute("validation", "error"), this.setAttribute("data-error", n)) : (this.removeAttribute("validation"), this.removeAttribute("data-error"));
617
+ setError: (o) => {
618
+ o ? (this.setAttribute("validation", "error"), this.setAttribute("data-error", o)) : (this.removeAttribute("validation"), this.removeAttribute("data-error"));
624
619
  }
625
620
  }));
626
621
  } catch {
@@ -634,17 +629,16 @@ class E extends A {
634
629
  const t = Array.from(
635
630
  this.querySelectorAll("option,[data-combobox-option]")
636
631
  ), e = /* @__PURE__ */ new Set();
637
- return t.map((i, s) => {
638
- const r = i.tagName.toLowerCase() === "option", o = i, n = r ? o.value || o.textContent || "" : i.getAttribute("value") || i.getAttribute("data-value") || i.textContent || "", l = r ? (o.label || o.textContent || o.value || "").trim() : (i.getAttribute("label") || i.textContent || n).trim(), b = (i.getAttribute("description") || i.getAttribute("data-description") || "").trim(), u = r ? o.disabled : x(i.getAttribute("disabled")), c = n.trim();
639
- if (!c && !l)
640
- return null;
641
- const m = `${c}::${l}`;
642
- return e.has(m) ? null : (e.add(m), {
632
+ return t.map((i, r) => {
633
+ const s = i.tagName.toLowerCase() === "option", o = i, n = s ? o.value || o.textContent || "" : i.getAttribute("value") || i.getAttribute("data-value") || i.textContent || "", l = s ? (o.label || o.textContent || o.value || "").trim() : (i.getAttribute("label") || i.textContent || n).trim(), b = (i.getAttribute("description") || i.getAttribute("data-description") || "").trim(), u = s ? o.disabled : _(i.getAttribute("disabled")), c = n.trim();
634
+ if (!c && !l) return null;
635
+ const p = `${c}::${l}`;
636
+ return e.has(p) ? null : (e.add(p), {
643
637
  value: c,
644
638
  label: l,
645
639
  description: b,
646
640
  disabled: u,
647
- sourceIndex: s
641
+ sourceIndex: r
648
642
  });
649
643
  }).filter((i) => !!i);
650
644
  }
@@ -658,17 +652,17 @@ class E extends A {
658
652
  ) || null;
659
653
  }
660
654
  _rebuildFiltered(t) {
661
- const e = h(this._query), i = this.hasAttribute("no-filter"), s = this._filtered[this._highlightedIndex];
662
- if (this._filtered = this._options.filter((o) => i || !e ? !0 : h(o.label).includes(e) || h(o.value).includes(e)), t != null && t.preserveHighlight && s) {
663
- const o = this._filtered.findIndex((n) => n.sourceIndex === s.sourceIndex);
655
+ const e = h(this._query), i = this.hasAttribute("no-filter"), r = this._filtered[this._highlightedIndex];
656
+ if (this._filtered = this._options.filter((o) => i || !e ? !0 : h(o.label).includes(e) || h(o.value).includes(e)), t?.preserveHighlight && r) {
657
+ const o = this._filtered.findIndex((n) => n.sourceIndex === r.sourceIndex);
664
658
  if (o >= 0 && !this._filtered[o].disabled) {
665
659
  this._highlightedIndex = o;
666
660
  return;
667
661
  }
668
662
  }
669
- const r = this._findOptionByValue(this.value);
670
- if (r) {
671
- const o = this._filtered.findIndex((n) => n.sourceIndex === r.sourceIndex);
663
+ const s = this._findOptionByValue(this.value);
664
+ if (s) {
665
+ const o = this._filtered.findIndex((n) => n.sourceIndex === s.sourceIndex);
672
666
  if (o >= 0 && !this._filtered[o].disabled) {
673
667
  this._highlightedIndex = o;
674
668
  return;
@@ -679,8 +673,7 @@ class E extends A {
679
673
  });
680
674
  }
681
675
  _renderList() {
682
- if (!this._panel)
683
- return;
676
+ if (!this._panel) return;
684
677
  const t = this._renderStateRow(), e = this.getAttribute("empty-text") || "No matches found", i = [
685
678
  t,
686
679
  e,
@@ -701,8 +694,8 @@ class E extends A {
701
694
  this._panel.innerHTML = `${t}<div class="empty" part="empty">${a(e)}</div>`, this._listStructureFingerprint = i, this._panel.refresh(), this._panel.clearActive(), this._syncActiveDescendant();
702
695
  return;
703
696
  }
704
- const s = this.value, r = this._filtered.map((o, n) => {
705
- const l = o.value === s, b = n === this._highlightedIndex, u = o.disabled;
697
+ const r = this.value, s = this._filtered.map((o, n) => {
698
+ const l = o.value === r, b = n === this._highlightedIndex, u = o.disabled;
706
699
  return `
707
700
  <button
708
701
  type="button"
@@ -723,23 +716,20 @@ class E extends A {
723
716
  </button>
724
717
  `;
725
718
  }).join("");
726
- this._panel.innerHTML = `${t}${r}`, this._listStructureFingerprint = i, this._panel.refresh(), this._syncActiveDescendant(), this._scrollHighlightedIntoView();
719
+ this._panel.innerHTML = `${t}${s}`, this._listStructureFingerprint = i, this._panel.refresh(), this._syncActiveDescendant(), this._scrollHighlightedIntoView();
727
720
  }
728
721
  _syncRenderedListState() {
729
- if (!this._panel)
730
- return !1;
722
+ if (!this._panel) return !1;
731
723
  if (this._filtered.length === 0)
732
724
  return this._panel.querySelector(".empty") ? (this._panel.clearActive(), this._syncActiveDescendant(), !0) : !1;
733
725
  const t = Array.from(this._panel.querySelectorAll(".option[data-option-index]"));
734
- if (t.length !== this._filtered.length)
735
- return !1;
726
+ if (t.length !== this._filtered.length) return !1;
736
727
  const e = this.value;
737
- return t.forEach((i, s) => {
738
- const r = this._filtered[s];
739
- if (!r)
740
- return;
741
- const o = r.value === e, n = s === this._highlightedIndex;
742
- i.setAttribute("aria-selected", o ? "true" : "false"), i.setAttribute("aria-disabled", r.disabled ? "true" : "false"), i.setAttribute("data-highlighted", n ? "true" : "false"), i.setAttribute("data-selected", o ? "true" : "false"), i.disabled = r.disabled;
728
+ return t.forEach((i, r) => {
729
+ const s = this._filtered[r];
730
+ if (!s) return;
731
+ const o = s.value === e, n = r === this._highlightedIndex;
732
+ i.setAttribute("aria-selected", o ? "true" : "false"), i.setAttribute("aria-disabled", s.disabled ? "true" : "false"), i.setAttribute("data-highlighted", n ? "true" : "false"), i.setAttribute("data-selected", o ? "true" : "false"), i.disabled = s.disabled;
743
733
  }), this._syncActiveDescendant(), this._scrollHighlightedIntoView(), !0;
744
734
  }
745
735
  _renderStateRow() {
@@ -747,16 +737,13 @@ class E extends A {
747
737
  return e ? `<div class="status-row" part="status" data-state="${a(t)}" aria-live="polite">${a(e)}</div>` : "";
748
738
  }
749
739
  _syncInputFromValue() {
750
- if (!this._input || this._isFocused && this.open)
751
- return;
740
+ if (!this._input || this._isFocused && this.open) return;
752
741
  const t = this._findOptionByValue(this.value);
753
742
  t ? (this._query = t.label, this._input.value = t.label) : (this._query = this.value, this._input.value = this.value), this._rebuildFiltered({ preserveHighlight: !1 }), this._renderList();
754
743
  }
755
744
  _syncActiveDescendant() {
756
- var e, i;
757
- if (!this._input)
758
- return;
759
- const t = (e = this._panel) == null ? void 0 : e.querySelector(`[data-option-index="${this._highlightedIndex}"]`);
745
+ if (!this._input) return;
746
+ const t = this._panel?.querySelector(`[data-option-index="${this._highlightedIndex}"]`);
760
747
  if (t && this._panel) {
761
748
  this._panel.setActiveItem(t, {
762
749
  focus: !1,
@@ -765,11 +752,10 @@ class E extends A {
765
752
  });
766
753
  return;
767
754
  }
768
- (i = this._panel) == null || i.clearActive(), this._input.removeAttribute("aria-activedescendant");
755
+ this._panel?.clearActive(), this._input.removeAttribute("aria-activedescendant");
769
756
  }
770
757
  _scrollHighlightedIntoView() {
771
- if (!this._panel || this._highlightedIndex < 0)
772
- return;
758
+ if (!this._panel || this._highlightedIndex < 0) return;
773
759
  const t = this._panel.querySelector(`[data-option-index="${this._highlightedIndex}"]`);
774
760
  this._panel.setActiveItem(t, {
775
761
  focus: !1,
@@ -778,16 +764,13 @@ class E extends A {
778
764
  });
779
765
  }
780
766
  _updateClearButton() {
781
- if (!this._clearBtn)
782
- return;
767
+ if (!this._clearBtn) return;
783
768
  this.hasAttribute("clearable") && !this._isDisabled() && !this._isReadonly() && !this._isLoading() && (this._query.length > 0 || this.value.length > 0) ? this._clearBtn.removeAttribute("hidden") : this._clearBtn.setAttribute("hidden", "");
784
769
  }
785
770
  _applyOpenState() {
786
- var i;
787
- if (!this._panel || !this._input || !this._toggleBtn)
788
- return;
771
+ if (!this._panel || !this._input || !this._toggleBtn) return;
789
772
  const t = this.open, e = this._isLoading();
790
- t ? (this._bindGlobalListeners(), this._panel.setAttribute("data-open", "true"), this._panel.removeAttribute("hidden"), this._panel.setAttribute("aria-hidden", "false"), this._input.setAttribute("aria-expanded", "true"), this._toggleBtn.setAttribute("data-open", "true"), this._rebuildFiltered({ preserveHighlight: !0 }), this._renderList(), this._syncDismissableLayer()) : (this._unbindGlobalListeners(), (i = this._dismissableLayer) == null || i.destroy(), this._dismissableLayer = null, this._panel.setAttribute("hidden", ""), this._panel.removeAttribute("data-open"), this._panel.setAttribute("aria-hidden", "true"), this._input.setAttribute("aria-expanded", "false"), this._toggleBtn.setAttribute("data-open", "false")), this._toggleBtn.disabled = this._isDisabled(), this._clearBtn && (this._clearBtn.disabled = this._isDisabled() || this._isReadonly()), this._input.setAttribute("aria-busy", e ? "true" : "false"), this._panel.setAttribute("aria-busy", e ? "true" : "false");
773
+ t ? (this._bindGlobalListeners(), this._panel.setAttribute("data-open", "true"), this._panel.removeAttribute("hidden"), this._panel.setAttribute("aria-hidden", "false"), this._input.setAttribute("aria-expanded", "true"), this._toggleBtn.setAttribute("data-open", "true"), this._rebuildFiltered({ preserveHighlight: !0 }), this._renderList(), this._syncDismissableLayer()) : (this._unbindGlobalListeners(), this._dismissableLayer?.destroy(), this._dismissableLayer = null, this._panel.setAttribute("hidden", ""), this._panel.removeAttribute("data-open"), this._panel.setAttribute("aria-hidden", "true"), this._input.setAttribute("aria-expanded", "false"), this._toggleBtn.setAttribute("data-open", "false")), this._toggleBtn.disabled = this._isDisabled(), this._clearBtn && (this._clearBtn.disabled = this._isDisabled() || this._isReadonly()), this._input.setAttribute("aria-busy", e ? "true" : "false"), this._panel.setAttribute("aria-busy", e ? "true" : "false");
791
774
  }
792
775
  _bindGlobalListeners() {
793
776
  this._globalListenersBound || (this._globalListenersBound = !0);
@@ -796,14 +779,13 @@ class E extends A {
796
779
  this._globalListenersBound && (this._globalListenersBound = !1);
797
780
  }
798
781
  _syncDismissableLayer() {
799
- var t;
800
- !this.open || !this._panel || ((t = this._dismissableLayer) == null || t.destroy(), this._dismissableLayer = C({
782
+ !this.open || !this._panel || (this._dismissableLayer?.destroy(), this._dismissableLayer = C({
801
783
  node: this._panel,
802
784
  trigger: this._control,
803
785
  closeOnEscape: !1,
804
786
  closeOnPointerOutside: !0,
805
- onDismiss: (e) => {
806
- e === "outside-pointer" && (this.hasAttribute("allow-custom") ? this._commitCustomValue() : this._syncInputFromValue(), this._closePanel("outside"));
787
+ onDismiss: (t) => {
788
+ t === "outside-pointer" && (this.hasAttribute("allow-custom") ? this._commitCustomValue() : this._syncInputFromValue(), this._closePanel("outside"));
807
789
  }
808
790
  }));
809
791
  }
@@ -817,8 +799,7 @@ class E extends A {
817
799
  this._setOpen(!1, t);
818
800
  }
819
801
  _commitSelection(t) {
820
- if (this._isDisabled() || this._isReadonly() || t.disabled)
821
- return;
802
+ if (this._isDisabled() || this._isReadonly() || t.disabled) return;
822
803
  const e = this.value;
823
804
  this._suppressValueSync = !0, this.value = t.value, this._suppressValueSync = !1, this._input && (this._input.value = t.label), this._query = t.label, this._rebuildFiltered({ preserveHighlight: !1 }), this._renderList(), this._updateClearButton(), this._closePanel("selection"), e !== t.value && this.dispatchEvent(
824
805
  new CustomEvent("change", {
@@ -835,8 +816,7 @@ class E extends A {
835
816
  );
836
817
  }
837
818
  _commitCustomValue() {
838
- if (this._isDisabled() || this._isReadonly() || !this.hasAttribute("allow-custom"))
839
- return;
819
+ if (this._isDisabled() || this._isReadonly() || !this.hasAttribute("allow-custom")) return;
840
820
  const t = this._query.trim(), e = this.value;
841
821
  this._suppressValueSync = !0, this.value = t, this._suppressValueSync = !1, this._updateClearButton(), e !== t && this.dispatchEvent(
842
822
  new CustomEvent("change", {
@@ -847,29 +827,26 @@ class E extends A {
847
827
  );
848
828
  }
849
829
  _moveHighlight(t) {
850
- var r, o;
851
- if (this._filtered.length === 0)
852
- return;
853
- const e = (r = this._panel) == null ? void 0 : r.querySelector(`[data-option-index="${this._highlightedIndex}"]`), i = ((o = this._panel) == null ? void 0 : o.move(t > 0 ? 1 : -1, {
830
+ if (this._filtered.length === 0) return;
831
+ const e = this._panel?.querySelector(`[data-option-index="${this._highlightedIndex}"]`), i = this._panel?.move(t > 0 ? 1 : -1, {
854
832
  current: e,
855
833
  focus: !1,
856
834
  owner: this._input,
857
835
  scroll: !0
858
- })) || null;
859
- if (!i)
860
- return;
861
- const s = Number(i.getAttribute("data-option-index") || "-1");
862
- s < 0 || (this._highlightedIndex = s, this._renderList());
836
+ }) || null;
837
+ if (!i) return;
838
+ const r = Number(i.getAttribute("data-option-index") || "-1");
839
+ r < 0 || (this._highlightedIndex = r, this._renderList());
863
840
  }
864
841
  render() {
865
- const t = this.hasAttribute("headless"), e = this.getAttribute("disabled"), i = x(e), s = this._isReadonly(), r = this._state(), o = r === "loading", n = this.getAttribute("placeholder") || "Search...", l = this.getAttribute("maxlength"), b = this.hasAttribute("required"), u = this.getAttribute("label") || "", c = this.getAttribute("description") || "", f = this.getAttribute("data-error") || "" || (r === "error" ? this._stateText() || "Unable to load options." : ""), _ = this.getAttribute("validation") === "error" || r === "error" || !!f, v = !!(u || this.querySelector('[slot="label"]')), g = !!(c || this.querySelector('[slot="description"]')), y = `${this._uid}-error`, w = [g ? `${this._uid}-description` : "", _ ? y : ""].filter(Boolean).join(" ");
842
+ const t = this.hasAttribute("headless"), e = this.getAttribute("disabled"), i = _(e), r = this._isReadonly(), s = this._state(), o = s === "loading", n = this.getAttribute("placeholder") || "Search...", l = this.getAttribute("maxlength"), b = this.hasAttribute("required"), u = this.getAttribute("label") || "", c = this.getAttribute("description") || "", x = this.getAttribute("data-error") || "" || (s === "error" ? this._stateText() || "Unable to load options." : ""), m = this.getAttribute("validation") === "error" || s === "error" || !!x, f = !!(u || this.querySelector('[slot="label"]')), g = !!(c || this.querySelector('[slot="description"]')), v = `${this._uid}-error`, y = [g ? `${this._uid}-description` : "", m ? v : ""].filter(Boolean).join(" ");
866
843
  if (this._options = this._readOptions(), !this._query) {
867
- const p = this._findOptionByValue(this.value);
868
- this._query = p ? p.label : this.value;
844
+ const w = this._findOptionByValue(this.value);
845
+ this._query = w ? w.label : this.value;
869
846
  }
870
847
  this._rebuildFiltered({ preserveHighlight: !1 }), this.setContent(`
871
848
  ${t ? "" : `<style>${$}</style>`}
872
- ${v || g ? `
849
+ ${f || g ? `
873
850
  <div class="label-row">
874
851
  <label class="label" part="label" id="${this._uid}-label"><slot name="label">${a(u)}</slot></label>
875
852
  <div class="description" part="description" id="${this._uid}-description"><slot name="description">${a(c)}</slot></div>
@@ -877,7 +854,7 @@ class E extends A {
877
854
  ` : ""}
878
855
 
879
856
  <div class="root" part="root">
880
- <div class="control" part="control" data-focused="${this._isFocused ? "true" : "false"}" data-state="${a(r)}">
857
+ <div class="control" part="control" data-focused="${this._isFocused ? "true" : "false"}" data-state="${a(s)}">
881
858
  <input
882
859
  id="${this._uid}-input"
883
860
  part="input"
@@ -886,29 +863,28 @@ class E extends A {
886
863
  aria-autocomplete="list"
887
864
  aria-expanded="${this.open ? "true" : "false"}"
888
865
  aria-controls="${this._uid}-listbox"
889
- ${v ? `aria-labelledby="${this._uid}-label"` : ""}
890
- ${w ? `aria-describedby="${w}"` : ""}
891
- ${_ ? 'aria-invalid="true"' : ""}
866
+ ${f ? `aria-labelledby="${this._uid}-label"` : ""}
867
+ ${y ? `aria-describedby="${y}"` : ""}
868
+ ${m ? 'aria-invalid="true"' : ""}
892
869
  aria-busy="${o ? "true" : "false"}"
893
870
  value="${a(this._query)}"
894
871
  placeholder="${a(n)}"
895
872
  ${i ? "disabled" : ""}
896
- ${s ? "readonly" : ""}
873
+ ${r ? "readonly" : ""}
897
874
  ${b ? "required" : ""}
898
875
  ${l ? `maxlength="${a(l)}"` : ""}
899
876
  />
900
- <button type="button" part="clear" class="icon-btn clear-btn" aria-label="Clear value" hidden ${s ? "disabled" : ""}>${F}</button>
877
+ <button type="button" part="clear" class="icon-btn clear-btn" aria-label="Clear value" hidden ${r ? "disabled" : ""}>${F}</button>
901
878
  <button type="button" part="toggle" class="icon-btn toggle-btn" data-open="${this.open ? "true" : "false"}" aria-label="Toggle options">${L}</button>
902
879
  </div>
903
- <ui-listbox class="panel" id="${this._uid}-listbox" part="panel" role="listbox" item-selector=".option[data-option-index]" item-role="option" active-attribute="data-highlighted" aria-busy="${o ? "true" : "false"}" data-state="${a(r)}" ${this.open ? 'data-open="true" aria-hidden="false"' : 'hidden aria-hidden="true"'}></ui-listbox>
880
+ <ui-listbox class="panel" id="${this._uid}-listbox" part="panel" role="listbox" item-selector=".option[data-option-index]" item-role="option" active-attribute="data-highlighted" aria-busy="${o ? "true" : "false"}" data-state="${a(s)}" ${this.open ? 'data-open="true" aria-hidden="false"' : 'hidden aria-hidden="true"'}></ui-listbox>
904
881
  </div>
905
882
  <slot hidden></slot>
906
- <div class="error" part="error" id="${y}" ${_ ? "" : "hidden"}>${a(f)}</div>
883
+ <div class="error" part="error" id="${v}" ${m ? "" : "hidden"}>${a(x)}</div>
907
884
  `), this._detachDomListeners(), this._input = this.root.querySelector("input"), this._control = this.root.querySelector(".control"), this._panel = this.root.querySelector("ui-listbox.panel"), this._clearBtn = this.root.querySelector(".clear-btn"), this._toggleBtn = this.root.querySelector(".toggle-btn"), this._listStructureFingerprint = "", this._renderList(), this._updateClearButton(), this._applyOpenState(), this._input && (this._input.addEventListener("input", this._onInput), this._input.addEventListener("change", this._onNativeChange), this._input.addEventListener("focus", this._onFocusIn), this._input.addEventListener("blur", this._onFocusOut), this._input.addEventListener("keydown", this._onKeyDown), this.hasAttribute("autofocus") && (this._autofocusFrame && cancelAnimationFrame(this._autofocusFrame), this._autofocusFrame = requestAnimationFrame(() => {
908
- var p;
909
885
  this._autofocusFrame = 0;
910
886
  try {
911
- (p = this._input) == null || p.focus();
887
+ this._input?.focus();
912
888
  } catch {
913
889
  }
914
890
  }))), this._clearBtn && this._clearBtn.addEventListener("click", this._onClearClick), this._toggleBtn && this._toggleBtn.addEventListener("click", this._onToggleClick), this._panel && (this._panel.addEventListener("pointerdown", this._onPanelPointerDown), this._panel.addEventListener("click", this._onPanelClick));
@@ -917,8 +893,7 @@ class E extends A {
917
893
  this._input && (this._input.removeEventListener("input", this._onInput), this._input.removeEventListener("change", this._onNativeChange), this._input.removeEventListener("focus", this._onFocusIn), this._input.removeEventListener("blur", this._onFocusOut), this._input.removeEventListener("keydown", this._onKeyDown)), this._clearBtn && this._clearBtn.removeEventListener("click", this._onClearClick), this._toggleBtn && this._toggleBtn.removeEventListener("click", this._onToggleClick), this._panel && (this._panel.removeEventListener("pointerdown", this._onPanelPointerDown), this._panel.removeEventListener("click", this._onPanelClick));
918
894
  }
919
895
  _onInput(t) {
920
- if (!this._input || this._isDisabled() || this._isReadonly())
921
- return;
896
+ if (!this._input || this._isDisabled() || this._isReadonly()) return;
922
897
  const e = t.target.value;
923
898
  this._query = e, this._openPanel("keyboard"), this._rebuildFiltered({ preserveHighlight: !1 }), this._renderList(), this._updateClearButton(), this.dispatchEvent(
924
899
  new CustomEvent("input", {
@@ -974,18 +949,17 @@ class E extends A {
974
949
  }));
975
950
  }
976
951
  _onKeyDown(t) {
977
- var e, i;
978
952
  if (!this._isDisabled() && this._input) {
979
953
  if (t.key === "Home" && this.open) {
980
954
  t.preventDefault();
981
- const s = ((e = this._panel) == null ? void 0 : e.focusBoundary("first", { focus: !1, owner: this._input, scroll: !0 })) || null;
982
- this._highlightedIndex = Number((s == null ? void 0 : s.getAttribute("data-option-index")) || "-1"), this._renderList();
955
+ const e = this._panel?.focusBoundary("first", { focus: !1, owner: this._input, scroll: !0 }) || null;
956
+ this._highlightedIndex = Number(e?.getAttribute("data-option-index") || "-1"), this._renderList();
983
957
  return;
984
958
  }
985
959
  if (t.key === "End" && this.open) {
986
960
  t.preventDefault();
987
- const s = ((i = this._panel) == null ? void 0 : i.focusBoundary("last", { focus: !1, owner: this._input, scroll: !0 })) || null;
988
- this._highlightedIndex = Number((s == null ? void 0 : s.getAttribute("data-option-index")) || "-1"), this._renderList();
961
+ const e = this._panel?.focusBoundary("last", { focus: !1, owner: this._input, scroll: !0 }) || null;
962
+ this._highlightedIndex = Number(e?.getAttribute("data-option-index") || "-1"), this._renderList();
989
963
  return;
990
964
  }
991
965
  if (t.key === "ArrowDown") {
@@ -999,15 +973,15 @@ class E extends A {
999
973
  if (t.key === "Enter") {
1000
974
  if (this.open && this._highlightedIndex >= 0) {
1001
975
  t.preventDefault();
1002
- const s = this._filtered[this._highlightedIndex];
1003
- s && this._commitSelection(s);
976
+ const e = this._filtered[this._highlightedIndex];
977
+ e && this._commitSelection(e);
1004
978
  } else if (this.hasAttribute("allow-custom"))
1005
979
  t.preventDefault(), this._commitCustomValue(), this._closePanel("keyboard");
1006
980
  else if (this.open)
1007
981
  t.preventDefault(), this._syncInputFromValue(), this._closePanel("keyboard");
1008
982
  else {
1009
- const s = this._findExactOptionByQuery(this._query);
1010
- s && (t.preventDefault(), this._commitSelection(s));
983
+ const e = this._findExactOptionByQuery(this._query);
984
+ e && (t.preventDefault(), this._commitSelection(e));
1011
985
  }
1012
986
  return;
1013
987
  }
@@ -1034,25 +1008,18 @@ class E extends A {
1034
1008
  )));
1035
1009
  }
1036
1010
  _onToggleClick(t) {
1037
- var e;
1038
- t.preventDefault(), !this._isDisabled() && (this.open ? this._closePanel("toggle") : this._openPanel("toggle"), (e = this._input) == null || e.focus());
1011
+ t.preventDefault(), !this._isDisabled() && (this.open ? this._closePanel("toggle") : this._openPanel("toggle"), this._input?.focus());
1039
1012
  }
1040
1013
  _onPanelPointerDown(t) {
1041
- if (this._isReadonly())
1042
- return;
1043
- const e = t.target;
1044
- e != null && e.closest("[data-option-index]") && (this._panelPointerDown = !0, t.preventDefault());
1014
+ this._isReadonly() || !t.target?.closest("[data-option-index]") || (this._panelPointerDown = !0, t.preventDefault());
1045
1015
  }
1046
1016
  _onPanelClick(t) {
1047
- if (this._isReadonly())
1048
- return;
1017
+ if (this._isReadonly()) return;
1049
1018
  const i = t.target.closest("[data-option-index]");
1050
- if (!i)
1051
- return;
1052
- const s = i.getAttribute("data-option-index"), r = s == null ? -1 : Number(s);
1053
- if (!Number.isFinite(r) || r < 0)
1054
- return;
1055
- const o = this._filtered[r];
1019
+ if (!i) return;
1020
+ const r = i.getAttribute("data-option-index"), s = r == null ? -1 : Number(r);
1021
+ if (!Number.isFinite(s) || s < 0) return;
1022
+ const o = this._filtered[s];
1056
1023
  !o || o.disabled || this._commitSelection(o);
1057
1024
  }
1058
1025
  }
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("./ElementBase-1b301e7f.js"),n=require("./overlayManager-0eda4e08.js");require("./command.cjs.js");require("./scroll-lock-d7b0df21.js");require("./listbox-ef2f708e.js");require("./collection-a2969ad2.js");require("./collection.cjs.js");const r=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("./ElementBase-EV6mVBUV.js"),n=require("./overlayManager-CSy3fJmJ.js");require("./command.cjs.js");const r=`
2
2
  :host {
3
3
  position: fixed;
4
4
  inset: 0;
@@ -56,7 +56,7 @@
56
56
  --ui-command-backdrop: rgba(0, 0, 0, 0.72);
57
57
  }
58
58
  }
59
- `;class o extends a.ElementBase{constructor(){super(),this._command=null,this._globalListenersBound=!1,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onSelect=this._onSelect.bind(this)}static get observedAttributes(){return["open","headless","placeholder","empty-text","query"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onClick),this._syncOpenState()}disconnectedCallback(){var e;this.root.removeEventListener("click",this._onClick),(e=this._command)==null||e.removeEventListener("select",this._onSelect),this._unbindGlobalListeners();try{n.OverlayManager.unregister(this),n.OverlayManager.releaseLock()}catch{}super.disconnectedCallback()}attributeChangedCallback(e,t,s){if(t!==s){if(e==="open"){this._syncOpenState(),this.dispatchEvent(new CustomEvent(s!=null?"open":"close",{bubbles:!0}));return}if(e==="placeholder"||e==="empty-text"){this.isConnected&&this.requestRender();return}if(e==="query"){const i=s||"";this._command&&this._command.query!==i&&(this._command.query=i);return}e==="headless"&&this.isConnected&&this.requestRender()}}openPalette(){this.setAttribute("open","")}closePalette(){this.removeAttribute("open")}get query(){var t;const e=this.getAttribute("query");return typeof e=="string"?e:((t=this._command)==null?void 0:t.query)??""}set query(e){const t=e||"";t?this.setAttribute("query",t):this.removeAttribute("query"),this._command&&this._command.query!==t&&(this._command.query=t)}focusSearch(){var e;(e=this._command)==null||e.focusSearch()}clearQuery(){this.query=""}_syncOpenState(){var e;if(this.hasAttribute("open")){this._bindGlobalListeners();try{n.OverlayManager.register(this),n.OverlayManager.acquireLock()}catch{}setTimeout(()=>{var t;(t=this._command)==null||t.focusSearch()},0)}else{this._unbindGlobalListeners(),(e=this._command)==null||e.clearQuery();try{n.OverlayManager.unregister(this),n.OverlayManager.releaseLock()}catch{}}}render(){var i;const e=this.getAttribute("placeholder")||"Search commands...",t=this.getAttribute("empty-text")||"No commands found.";this.setContent(`
59
+ `;class o extends a.ElementBase{constructor(){super(),this._command=null,this._globalListenersBound=!1,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onSelect=this._onSelect.bind(this)}static get observedAttributes(){return["open","headless","placeholder","empty-text","query"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onClick),this._syncOpenState()}disconnectedCallback(){this.root.removeEventListener("click",this._onClick),this._command?.removeEventListener("select",this._onSelect),this._unbindGlobalListeners();try{n.OverlayManager.unregister(this),n.OverlayManager.releaseLock()}catch{}super.disconnectedCallback()}attributeChangedCallback(e,t,s){if(t!==s){if(e==="open"){this._syncOpenState(),this.dispatchEvent(new CustomEvent(s!=null?"open":"close",{bubbles:!0}));return}if(e==="placeholder"||e==="empty-text"){this.isConnected&&this.requestRender();return}if(e==="query"){const i=s||"";this._command&&this._command.query!==i&&(this._command.query=i);return}e==="headless"&&this.isConnected&&this.requestRender()}}openPalette(){this.setAttribute("open","")}closePalette(){this.removeAttribute("open")}get query(){const e=this.getAttribute("query");return typeof e=="string"?e:this._command?.query??""}set query(e){const t=e||"";t?this.setAttribute("query",t):this.removeAttribute("query"),this._command&&this._command.query!==t&&(this._command.query=t)}focusSearch(){this._command?.focusSearch()}clearQuery(){this.query=""}_syncOpenState(){if(this.hasAttribute("open")){this._bindGlobalListeners();try{n.OverlayManager.register(this),n.OverlayManager.acquireLock()}catch{}setTimeout(()=>{this._command?.focusSearch()},0)}else{this._unbindGlobalListeners(),this._command?.clearQuery();try{n.OverlayManager.unregister(this),n.OverlayManager.releaseLock()}catch{}}}render(){const e=this.getAttribute("placeholder")||"Search commands...",t=this.getAttribute("empty-text")||"No commands found.";this.setContent(`
60
60
  <style>${r}</style>
61
61
  <div class="overlay" part="overlay"></div>
62
62
  <section class="panel" part="panel" role="dialog" aria-modal="true" aria-label="Command palette">
@@ -64,4 +64,4 @@
64
64
  <slot slot="command" name="command"></slot>
65
65
  </ui-command>
66
66
  </section>
67
- `);const s=this.root.querySelector("ui-command");this._command&&this._command!==s&&this._command.removeEventListener("select",this._onSelect),this._command=s,(i=this._command)==null||i.addEventListener("select",this._onSelect),this._command&&this._command.query!==this.query&&(this._command.query=this.query)}_bindGlobalListeners(){this._globalListenersBound||(document.addEventListener("keydown",this._onKeyDown),this._globalListenersBound=!0)}_unbindGlobalListeners(){this._globalListenersBound&&(document.removeEventListener("keydown",this._onKeyDown),this._globalListenersBound=!1)}_onClick(e){const t=e.target;t!=null&&t.classList.contains("overlay")&&this.closePalette()}_onSelect(e){this.closePalette()}_onKeyDown(e){this.hasAttribute("open")&&e.key==="Escape"&&(e.preventDefault(),this.closePalette())}}typeof customElements<"u"&&!customElements.get("ui-command-palette")&&customElements.define("ui-command-palette",o);exports.UICommandPalette=o;
67
+ `);const s=this.root.querySelector("ui-command");this._command&&this._command!==s&&this._command.removeEventListener("select",this._onSelect),this._command=s,this._command?.addEventListener("select",this._onSelect),this._command&&this._command.query!==this.query&&(this._command.query=this.query)}_bindGlobalListeners(){this._globalListenersBound||(document.addEventListener("keydown",this._onKeyDown),this._globalListenersBound=!0)}_unbindGlobalListeners(){this._globalListenersBound&&(document.removeEventListener("keydown",this._onKeyDown),this._globalListenersBound=!1)}_onClick(e){e.target?.classList.contains("overlay")&&this.closePalette()}_onSelect(e){this.closePalette()}_onKeyDown(e){this.hasAttribute("open")&&e.key==="Escape"&&(e.preventDefault(),this.closePalette())}}typeof customElements<"u"&&!customElements.get("ui-command-palette")&&customElements.define("ui-command-palette",o);exports.UICommandPalette=o;
@@ -1,11 +1,7 @@
1
- import { E as o } from "./ElementBase-909688f3.mjs";
2
- import { O as i } from "./overlayManager-5bbd4dc3.mjs";
1
+ import { E as o } from "./ElementBase-YlTLMsGk.mjs";
2
+ import { O as n } from "./overlayManager-BJjU1VA8.mjs";
3
3
  import "./command.esm.js";
4
- import "./scroll-lock-31da444f.mjs";
5
- import "./listbox-308789a0.mjs";
6
- import "./collection-a1aac0c6.mjs";
7
- import "./collection.esm.js";
8
- const r = `
4
+ const a = `
9
5
  :host {
10
6
  position: fixed;
11
7
  inset: 0;
@@ -64,7 +60,7 @@ const r = `
64
60
  }
65
61
  }
66
62
  `;
67
- class a extends o {
63
+ class r extends o {
68
64
  constructor() {
69
65
  super(), this._command = null, this._globalListenersBound = !1, this._onClick = this._onClick.bind(this), this._onKeyDown = this._onKeyDown.bind(this), this._onSelect = this._onSelect.bind(this);
70
66
  }
@@ -75,10 +71,9 @@ class a extends o {
75
71
  super.connectedCallback(), this.root.addEventListener("click", this._onClick), this._syncOpenState();
76
72
  }
77
73
  disconnectedCallback() {
78
- var e;
79
- this.root.removeEventListener("click", this._onClick), (e = this._command) == null || e.removeEventListener("select", this._onSelect), this._unbindGlobalListeners();
74
+ this.root.removeEventListener("click", this._onClick), this._command?.removeEventListener("select", this._onSelect), this._unbindGlobalListeners();
80
75
  try {
81
- i.unregister(this), i.releaseLock();
76
+ n.unregister(this), n.releaseLock();
82
77
  } catch {
83
78
  }
84
79
  super.disconnectedCallback();
@@ -94,8 +89,8 @@ class a extends o {
94
89
  return;
95
90
  }
96
91
  if (e === "query") {
97
- const n = s || "";
98
- this._command && this._command.query !== n && (this._command.query = n);
92
+ const i = s || "";
93
+ this._command && this._command.query !== i && (this._command.query = i);
99
94
  return;
100
95
  }
101
96
  e === "headless" && this.isConnected && this.requestRender();
@@ -108,46 +103,41 @@ class a extends o {
108
103
  this.removeAttribute("open");
109
104
  }
110
105
  get query() {
111
- var t;
112
106
  const e = this.getAttribute("query");
113
- return typeof e == "string" ? e : ((t = this._command) == null ? void 0 : t.query) ?? "";
107
+ return typeof e == "string" ? e : this._command?.query ?? "";
114
108
  }
115
109
  set query(e) {
116
110
  const t = e || "";
117
111
  t ? this.setAttribute("query", t) : this.removeAttribute("query"), this._command && this._command.query !== t && (this._command.query = t);
118
112
  }
119
113
  focusSearch() {
120
- var e;
121
- (e = this._command) == null || e.focusSearch();
114
+ this._command?.focusSearch();
122
115
  }
123
116
  clearQuery() {
124
117
  this.query = "";
125
118
  }
126
119
  _syncOpenState() {
127
- var e;
128
120
  if (this.hasAttribute("open")) {
129
121
  this._bindGlobalListeners();
130
122
  try {
131
- i.register(this), i.acquireLock();
123
+ n.register(this), n.acquireLock();
132
124
  } catch {
133
125
  }
134
126
  setTimeout(() => {
135
- var t;
136
- (t = this._command) == null || t.focusSearch();
127
+ this._command?.focusSearch();
137
128
  }, 0);
138
129
  } else {
139
- this._unbindGlobalListeners(), (e = this._command) == null || e.clearQuery();
130
+ this._unbindGlobalListeners(), this._command?.clearQuery();
140
131
  try {
141
- i.unregister(this), i.releaseLock();
132
+ n.unregister(this), n.releaseLock();
142
133
  } catch {
143
134
  }
144
135
  }
145
136
  }
146
137
  render() {
147
- var n;
148
138
  const e = this.getAttribute("placeholder") || "Search commands...", t = this.getAttribute("empty-text") || "No commands found.";
149
139
  this.setContent(`
150
- <style>${r}</style>
140
+ <style>${a}</style>
151
141
  <div class="overlay" part="overlay"></div>
152
142
  <section class="panel" part="panel" role="dialog" aria-modal="true" aria-label="Command palette">
153
143
  <ui-command class="command" part="command" placeholder="${e}" empty-text="${t}">
@@ -156,7 +146,7 @@ class a extends o {
156
146
  </section>
157
147
  `);
158
148
  const s = this.root.querySelector("ui-command");
159
- this._command && this._command !== s && this._command.removeEventListener("select", this._onSelect), this._command = s, (n = this._command) == null || n.addEventListener("select", this._onSelect), this._command && this._command.query !== this.query && (this._command.query = this.query);
149
+ this._command && this._command !== s && this._command.removeEventListener("select", this._onSelect), this._command = s, this._command?.addEventListener("select", this._onSelect), this._command && this._command.query !== this.query && (this._command.query = this.query);
160
150
  }
161
151
  _bindGlobalListeners() {
162
152
  this._globalListenersBound || (document.addEventListener("keydown", this._onKeyDown), this._globalListenersBound = !0);
@@ -165,8 +155,7 @@ class a extends o {
165
155
  this._globalListenersBound && (document.removeEventListener("keydown", this._onKeyDown), this._globalListenersBound = !1);
166
156
  }
167
157
  _onClick(e) {
168
- const t = e.target;
169
- t != null && t.classList.contains("overlay") && this.closePalette();
158
+ e.target?.classList.contains("overlay") && this.closePalette();
170
159
  }
171
160
  _onSelect(e) {
172
161
  this.closePalette();
@@ -175,7 +164,7 @@ class a extends o {
175
164
  this.hasAttribute("open") && e.key === "Escape" && (e.preventDefault(), this.closePalette());
176
165
  }
177
166
  }
178
- typeof customElements < "u" && !customElements.get("ui-command-palette") && customElements.define("ui-command-palette", a);
167
+ typeof customElements < "u" && !customElements.get("ui-command-palette") && customElements.define("ui-command-palette", r);
179
168
  export {
180
- a as UICommandPalette
169
+ r as UICommandPalette
181
170
  };