@ixfx/components 0.2.5 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/bundle/index.d.ts +365 -143
  2. package/bundle/index.d.ts.map +1 -1
  3. package/bundle/index.js +2330 -826
  4. package/bundle/index.js.map +1 -1
  5. package/dist/ac-text.d.ts +2 -3
  6. package/dist/ac-text.d.ts.map +1 -1
  7. package/dist/ac-text.js +5 -5
  8. package/dist/ac-text.js.map +1 -1
  9. package/dist/{button-DgKUzE5o.js → button-DMt5XWUK.js} +6 -6
  10. package/dist/button-DMt5XWUK.js.map +1 -0
  11. package/dist/button.d.ts +3 -4
  12. package/dist/button.d.ts.map +1 -1
  13. package/dist/button.js +1 -1
  14. package/dist/checkbox.d.ts +3 -5
  15. package/dist/checkbox.d.ts.map +1 -1
  16. package/dist/checkbox.js +3 -3
  17. package/dist/checkbox.js.map +1 -1
  18. package/dist/{colour-C3MQIjFJ-BJV-QC-3.js → colour-C3MQIjFJ-BLXg8W3U.js} +2 -2
  19. package/dist/{colour-C3MQIjFJ-BJV-QC-3.js.map → colour-C3MQIjFJ-BLXg8W3U.js.map} +1 -1
  20. package/dist/{colour-picker-Bw-AZoWx.js → colour-picker-K6zu82lm.js} +8 -8
  21. package/dist/colour-picker-K6zu82lm.js.map +1 -0
  22. package/dist/colour-picker.d.ts +2 -2
  23. package/dist/colour-picker.js +1 -1
  24. package/dist/crumbs.d.ts +4 -6
  25. package/dist/crumbs.d.ts.map +1 -1
  26. package/dist/crumbs.js +12 -12
  27. package/dist/crumbs.js.map +1 -1
  28. package/dist/data-display.d.ts +1 -2
  29. package/dist/data-display.d.ts.map +1 -1
  30. package/dist/data-display.js +4 -5
  31. package/dist/data-display.js.map +1 -1
  32. package/dist/decorate-D7rC1gLP.js +27 -0
  33. package/dist/decorate-D7rC1gLP.js.map +1 -0
  34. package/dist/{defaults-FEZaGiYZ.js → defaults-C7elhuyJ.js} +2 -2
  35. package/dist/{defaults-FEZaGiYZ.js.map → defaults-C7elhuyJ.js.map} +1 -1
  36. package/dist/{dist-By5URG0Y.js → dist-BX0OVIm7.js} +2 -2
  37. package/dist/{dist-By5URG0Y.js.map → dist-BX0OVIm7.js.map} +1 -1
  38. package/dist/{dist-D7kJgnSE.js → dist-TAGYwaju.js} +1 -1
  39. package/dist/{dist-D7kJgnSE.js.map → dist-TAGYwaju.js.map} +1 -1
  40. package/dist/editable-label.d.ts +6 -1
  41. package/dist/editable-label.d.ts.map +1 -1
  42. package/dist/editable-label.js +51 -4
  43. package/dist/editable-label.js.map +1 -1
  44. package/dist/{hex-editor-Wd6ZtZA2.js → hex-editor-CsN_ySkH.js} +87 -87
  45. package/dist/hex-editor-CsN_ySkH.js.map +1 -0
  46. package/dist/{hex-editor-Gib1Grg2.d.ts → hex-editor-DlfoA65y.d.ts} +7 -8
  47. package/dist/hex-editor-DlfoA65y.d.ts.map +1 -0
  48. package/dist/hex.d.ts +1 -1
  49. package/dist/hex.js +1 -1
  50. package/dist/{highlight-CAjwQ4GE.js → highlight-TPbSHruI.js} +3 -3
  51. package/dist/highlight-TPbSHruI.js.map +1 -0
  52. package/dist/{icon-BR5aTIiP.js → icon-9NWTXtE1.js} +6 -7
  53. package/dist/icon-9NWTXtE1.js.map +1 -0
  54. package/dist/{icon-DQKdfR7U.d.ts → icon-CeTDJhC7.d.ts} +3 -4
  55. package/dist/icon-CeTDJhC7.d.ts.map +1 -0
  56. package/dist/icons.d.ts +2 -2
  57. package/dist/icons.js +3 -3
  58. package/dist/icons.js.map +1 -1
  59. package/dist/{incr-search-BjCNClnC.js → incr-search-DSKKsk6w.js} +119 -117
  60. package/dist/incr-search-DSKKsk6w.js.map +1 -0
  61. package/dist/incr-search.d.ts +2 -2
  62. package/dist/incr-search.js +2 -2
  63. package/dist/{index-CPVcTTXo.d.ts → index--hrxPBkQ.d.ts} +73 -74
  64. package/dist/index--hrxPBkQ.d.ts.map +1 -0
  65. package/dist/index-B1hNR7Z9.d.ts.map +1 -1
  66. package/dist/{index-CpbBI3n7.d.ts → index-CnL9krsH.d.ts} +3 -4
  67. package/dist/index-CnL9krsH.d.ts.map +1 -0
  68. package/dist/{index-CQxanqXF.d.ts → index-DSlPeWLK.d.ts} +28 -29
  69. package/dist/index-DSlPeWLK.d.ts.map +1 -0
  70. package/dist/{index-C5dK8RZa.d.ts → index-DrQjA8Gs.d.ts} +3 -4
  71. package/dist/index-DrQjA8Gs.d.ts.map +1 -0
  72. package/dist/{index-C9iBN908.d.ts → index-hXFn14tM.d.ts} +32 -32
  73. package/dist/index-hXFn14tM.d.ts.map +1 -0
  74. package/dist/index.d.ts +246 -32
  75. package/dist/index.d.ts.map +1 -1
  76. package/dist/index.js +1464 -32
  77. package/dist/index.js.map +1 -1
  78. package/dist/keyboard-De_vOHLg.js.map +1 -1
  79. package/dist/{labelled-input-base-DS6-6C0r.js → labelled-input-base-CqPL5rKm.js} +2 -2
  80. package/dist/labelled-input-base-CqPL5rKm.js.map +1 -0
  81. package/dist/{labelled-input-base-DnRh4reU.d.ts → labelled-input-base-D-Y7agky.d.ts} +2 -3
  82. package/dist/labelled-input-base-D-Y7agky.d.ts.map +1 -0
  83. package/dist/labelled-radial-input.d.ts +4 -5
  84. package/dist/labelled-radial-input.d.ts.map +1 -1
  85. package/dist/labelled-radial-input.js +5 -5
  86. package/dist/labelled-radial-input.js.map +1 -1
  87. package/dist/labelled-range-input.d.ts +1 -1
  88. package/dist/labelled-range-input.js +4 -4
  89. package/dist/labelled-range-input.js.map +1 -1
  90. package/dist/led.d.ts +2 -3
  91. package/dist/led.d.ts.map +1 -1
  92. package/dist/led.js +3 -3
  93. package/dist/led.js.map +1 -1
  94. package/dist/{menu-BV6UFx_z.js → menu-DJJuCm-5.js} +55 -55
  95. package/dist/menu-DJJuCm-5.js.map +1 -0
  96. package/dist/{menu-item-DEzL_Yjk.js → menu-item-CKRfP0pN.js} +14 -14
  97. package/dist/menu-item-CKRfP0pN.js.map +1 -0
  98. package/dist/{menu-item-Cikacp4F.d.ts → menu-item-ClQF2DKN.d.ts} +7 -8
  99. package/dist/menu-item-ClQF2DKN.d.ts.map +1 -0
  100. package/dist/menu.d.ts +3 -3
  101. package/dist/menu.js +2 -2
  102. package/dist/miller.d.ts +7 -10
  103. package/dist/miller.d.ts.map +1 -1
  104. package/dist/miller.js +17 -17
  105. package/dist/miller.js.map +1 -1
  106. package/dist/narrowed-text.d.ts +2 -3
  107. package/dist/narrowed-text.d.ts.map +1 -1
  108. package/dist/narrowed-text.js +6 -6
  109. package/dist/narrowed-text.js.map +1 -1
  110. package/dist/panel.d.ts +2 -3
  111. package/dist/panel.d.ts.map +1 -1
  112. package/dist/panel.js +4 -4
  113. package/dist/panel.js.map +1 -1
  114. package/dist/plots.d.ts +1 -1
  115. package/dist/plots.js +1 -1
  116. package/dist/polar-pad.d.ts +1 -2
  117. package/dist/polar-pad.d.ts.map +1 -1
  118. package/dist/polar-pad.js +3 -3
  119. package/dist/polar-pad.js.map +1 -1
  120. package/dist/{popup-Ddx9LCzY.js → popup-ImtS9KnS.js} +1 -1
  121. package/dist/{popup-Ddx9LCzY.js.map → popup-ImtS9KnS.js.map} +1 -1
  122. package/dist/{prominence-CreDBdCs.js → prominence--ic9uWBl.js} +1 -1
  123. package/dist/{prominence-CreDBdCs.js.map → prominence--ic9uWBl.js.map} +1 -1
  124. package/dist/{radial-input-CNJ8asY2.js → radial-input-DZA6WaFu.js} +16 -16
  125. package/dist/radial-input-DZA6WaFu.js.map +1 -0
  126. package/dist/{radial-input-xSTd4kEz.d.ts → radial-input-LUSBEycd.d.ts} +2 -3
  127. package/dist/radial-input-LUSBEycd.d.ts.map +1 -0
  128. package/dist/radial-input.d.ts +1 -1
  129. package/dist/radial-input.js +1 -1
  130. package/dist/range-input.d.ts +2 -3
  131. package/dist/range-input.d.ts.map +1 -1
  132. package/dist/range-input.js +3 -3
  133. package/dist/range-input.js.map +1 -1
  134. package/dist/range.d.ts +2 -3
  135. package/dist/range.d.ts.map +1 -1
  136. package/dist/range.js +4 -4
  137. package/dist/range.js.map +1 -1
  138. package/dist/{registry-CZEB1YI9.js → registry-Q2gYQCHM.js} +1 -1
  139. package/dist/{registry-CZEB1YI9.js.map → registry-Q2gYQCHM.js.map} +1 -1
  140. package/dist/selecthorizontal.d.ts +2 -3
  141. package/dist/selecthorizontal.d.ts.map +1 -1
  142. package/dist/selecthorizontal.js +3 -3
  143. package/dist/selecthorizontal.js.map +1 -1
  144. package/dist/snap-container.d.ts +1 -2
  145. package/dist/snap-container.d.ts.map +1 -1
  146. package/dist/snap-container.js +3 -3
  147. package/dist/snap-container.js.map +1 -1
  148. package/dist/split-layout.d.ts +2 -3
  149. package/dist/split-layout.d.ts.map +1 -1
  150. package/dist/split-layout.js +6 -6
  151. package/dist/split-layout.js.map +1 -1
  152. package/dist/swipe.d.ts +1 -2
  153. package/dist/swipe.d.ts.map +1 -1
  154. package/dist/swipe.js +4 -4
  155. package/dist/swipe.js.map +1 -1
  156. package/dist/{tab-list-CFF7uSYH.d.ts → tab-list-BnqISNvO.d.ts} +5 -6
  157. package/dist/tab-list-BnqISNvO.d.ts.map +1 -0
  158. package/dist/tabs.d.ts +1 -1
  159. package/dist/tabs.js +4 -4
  160. package/dist/tabs.js.map +1 -1
  161. package/dist/tickled-controller-Cq1Va0rR.d.ts.map +1 -1
  162. package/dist/tickled-styles-Bg3QbcrD.js.map +1 -1
  163. package/dist/{timeline-DBWJsSjd.js → timeline-Cv75Th2U.js} +123 -119
  164. package/dist/timeline-Cv75Th2U.js.map +1 -0
  165. package/dist/timeline.d.ts +2 -2
  166. package/dist/timeline.js +1 -1
  167. package/dist/{tooltip-kfUBWYVB.d.ts → tooltip-CwGfb4lp.d.ts} +2 -3
  168. package/dist/tooltip-CwGfb4lp.d.ts.map +1 -0
  169. package/dist/tree-CvvKbO-f.js +1330 -0
  170. package/dist/tree-CvvKbO-f.js.map +1 -0
  171. package/dist/{tree-component-CQpoPo4s.d.ts → tree-component-D8Bg48tt.d.ts} +12 -12
  172. package/dist/tree-component-D8Bg48tt.d.ts.map +1 -0
  173. package/dist/tree.d.ts +4 -5
  174. package/dist/tree.d.ts.map +1 -1
  175. package/dist/tree.js +1 -1143
  176. package/dist/types-BKaqnpwx.d.ts.map +1 -1
  177. package/dist/{xy-axis-CIFok7MF.d.ts → xy-axis-D9uwpGTT.d.ts} +5 -6
  178. package/dist/xy-axis-D9uwpGTT.d.ts.map +1 -0
  179. package/dist/{xy-axis-BANbgrI5.js → xy-axis-DL0tfJDr.js} +13 -13
  180. package/dist/xy-axis-DL0tfJDr.js.map +1 -0
  181. package/dist/xy-pad.d.ts +1 -2
  182. package/dist/xy-pad.d.ts.map +1 -1
  183. package/dist/xy-pad.js +4 -4
  184. package/dist/xy-pad.js.map +1 -1
  185. package/package.json +17 -13
  186. package/dist/button-DgKUzE5o.js.map +0 -1
  187. package/dist/colour-picker-Bw-AZoWx.js.map +0 -1
  188. package/dist/decorate-BZbkqIhA.js +0 -9
  189. package/dist/hex-editor-Gib1Grg2.d.ts.map +0 -1
  190. package/dist/hex-editor-Wd6ZtZA2.js.map +0 -1
  191. package/dist/highlight-CAjwQ4GE.js.map +0 -1
  192. package/dist/icon-BR5aTIiP.js.map +0 -1
  193. package/dist/icon-DQKdfR7U.d.ts.map +0 -1
  194. package/dist/incr-search-BjCNClnC.js.map +0 -1
  195. package/dist/index-C5dK8RZa.d.ts.map +0 -1
  196. package/dist/index-C9iBN908.d.ts.map +0 -1
  197. package/dist/index-CPVcTTXo.d.ts.map +0 -1
  198. package/dist/index-CQxanqXF.d.ts.map +0 -1
  199. package/dist/index-CpbBI3n7.d.ts.map +0 -1
  200. package/dist/labelled-input-base-DS6-6C0r.js.map +0 -1
  201. package/dist/labelled-input-base-DnRh4reU.d.ts.map +0 -1
  202. package/dist/menu-BV6UFx_z.js.map +0 -1
  203. package/dist/menu-item-Cikacp4F.d.ts.map +0 -1
  204. package/dist/menu-item-DEzL_Yjk.js.map +0 -1
  205. package/dist/radial-input-CNJ8asY2.js.map +0 -1
  206. package/dist/radial-input-xSTd4kEz.d.ts.map +0 -1
  207. package/dist/tab-list-CFF7uSYH.d.ts.map +0 -1
  208. package/dist/timeline-DBWJsSjd.js.map +0 -1
  209. package/dist/tooltip-kfUBWYVB.d.ts.map +0 -1
  210. package/dist/tree-component-CQpoPo4s.d.ts.map +0 -1
  211. package/dist/tree-data-model-DGvRVOFY.js +0 -190
  212. package/dist/tree-data-model-DGvRVOFY.js.map +0 -1
  213. package/dist/tree.js.map +0 -1
  214. package/dist/xy-axis-BANbgrI5.js.map +0 -1
  215. package/dist/xy-axis-CIFok7MF.d.ts.map +0 -1
  216. /package/dist/{interaction-CQDQJf2Q.js → interaction-DG7X1rhI.js} +0 -0
package/dist/index.js CHANGED
@@ -1,32 +1,33 @@
1
- import { n as buildHighlightTargets, r as clearHighlights, t as applyHighlights } from "./highlight-CAjwQ4GE.js";
2
- import { a as svgToDataUri, i as registerIcon, n as hasIcon, r as iconBus, t as getIcon } from "./registry-CZEB1YI9.js";
3
- import { t as __decorate } from "./decorate-BZbkqIhA.js";
4
- import { t as IxfxIconElement } from "./icon-BR5aTIiP.js";
1
+ import { n as buildHighlightTargets, r as clearHighlights, t as applyHighlights } from "./highlight-TPbSHruI.js";
2
+ import { n as tickledStyles, r as TickledController } from "./tickled-styles-Bg3QbcrD.js";
3
+ import { n as safeCustomElement, t as __decorate } from "./decorate-D7rC1gLP.js";
4
+ import { a as svgToDataUri, i as registerIcon, n as hasIcon, r as iconBus, t as getIcon } from "./registry-Q2gYQCHM.js";
5
+ import { t as IxfxIconElement } from "./icon-9NWTXtE1.js";
5
6
  import { AcTextElement } from "./ac-text.js";
6
- import { i as ICON_CLOSE, n as ICON_CHECK, r as ICON_CHEVRON_DOWN, t as ICON_CARET_RIGHT } from "./defaults-FEZaGiYZ.js";
7
+ import { a as createFuzzySearch, i as createAcCompletionProvider, n as IncrSearchTreeController, r as createIncrSearch, t as createElementIncrSearch } from "./incr-search-DSKKsk6w.js";
8
+ import { i as ICON_CLOSE, n as ICON_CHECK, r as ICON_CHEVRON_DOWN, t as ICON_CARET_RIGHT } from "./defaults-C7elhuyJ.js";
7
9
  import "./icons.js";
8
- import { t as prominenceStyles } from "./prominence-CreDBdCs.js";
9
- import { n as buttonStyles, t as ButtonElement } from "./button-DgKUzE5o.js";
10
- import { t as popupSurfaceStyles } from "./popup-Ddx9LCzY.js";
11
- import "./menu-item-DEzL_Yjk.js";
10
+ import { t as prominenceStyles } from "./prominence--ic9uWBl.js";
11
+ import { n as buttonStyles, t as ButtonElement } from "./button-DMt5XWUK.js";
12
+ import { t as popupSurfaceStyles } from "./popup-ImtS9KnS.js";
13
+ import "./menu-item-CKRfP0pN.js";
12
14
  import { Checkbox } from "./checkbox.js";
13
- import { C as resultThrow, E as throwIfFailed, d as scaler, h as without, n as clamper, p as containsDuplicateInstances, y as nullUndefTest } from "./dist-D7kJgnSE.js";
14
- import { a as computeColour, c as last, i as applyAgeModification, l as QueueMutable, n as PlotSingleAxis, o as parseColourScaleAttr, r as PlotDataSeries, s as readBaseColour, t as PlotXyAxis, u as __exportAll } from "./xy-axis-BANbgrI5.js";
15
- import { a as toStringAbbreviate, c as isEqualDefault, l as isEqualValueDefault, o as defaultComparer, r as isPrimitive, u as isEqualValueIgnoreOrder } from "./dist-By5URG0Y.js";
16
- import { n as ColourPicker, t as ColourPickerPopup } from "./colour-picker-Bw-AZoWx.js";
15
+ import { C as resultThrow, E as throwIfFailed, d as scaler, h as without, n as clamper, p as containsDuplicateInstances, y as nullUndefTest } from "./dist-TAGYwaju.js";
16
+ import { a as computeColour, c as last, i as applyAgeModification, l as QueueMutable, n as PlotSingleAxis, o as parseColourScaleAttr, r as PlotDataSeries, s as readBaseColour, t as PlotXyAxis, u as __exportAll } from "./xy-axis-DL0tfJDr.js";
17
+ import { a as toStringAbbreviate, c as isEqualDefault, l as isEqualValueDefault, o as defaultComparer, r as isPrimitive, u as isEqualValueIgnoreOrder } from "./dist-BX0OVIm7.js";
18
+ import { n as ColourPicker, t as ColourPickerPopup } from "./colour-picker-K6zu82lm.js";
17
19
  import { LabelledRangeInput } from "./labelled-range-input.js";
18
- import { t as TreeDataModel } from "./tree-data-model-DGvRVOFY.js";
19
- import { a as createFuzzySearch, i as createIncrSearch, n as createAcCompletionProvider, r as createElementIncrSearch, t as IncrSearchTreeController } from "./incr-search-BjCNClnC.js";
20
+ import { i as TreeDataModel, n as TreeController, r as TreeBaseElement, t as TreeListElement } from "./tree-CvvKbO-f.js";
20
21
  import { NarrowedTextElement } from "./narrowed-text.js";
21
22
  import { CrumbNavigationElement } from "./crumbs.js";
22
23
  import { DataDisplayComponent } from "./data-display.js";
23
24
  import { EditableLabel } from "./editable-label.js";
24
25
  import { t as resolveStep } from "./keyboard-De_vOHLg.js";
25
- import { t as IxfxHexEditorElement } from "./hex-editor-Wd6ZtZA2.js";
26
- import { t as RadialInputElement } from "./radial-input-CNJ8asY2.js";
26
+ import { t as IxfxHexEditorElement } from "./hex-editor-CsN_ySkH.js";
27
+ import { t as RadialInputElement } from "./radial-input-DZA6WaFu.js";
27
28
  import { LabelledRadialInput } from "./labelled-radial-input.js";
28
29
  import { LedElement } from "./led.js";
29
- import { t as menu_exports } from "./menu-BV6UFx_z.js";
30
+ import { t as menu_exports } from "./menu-DJJuCm-5.js";
30
31
  import { MillerBaseElement, MillerListElement, MillerTreeController } from "./miller.js";
31
32
  import { PanelElement } from "./panel.js";
32
33
  import { PolarPad } from "./polar-pad.js";
@@ -38,13 +39,633 @@ import { SnapContainer } from "./snap-container.js";
38
39
  import { SplitLayoutElement } from "./split-layout.js";
39
40
  import { SwipeElement } from "./swipe.js";
40
41
  import { TabListElement } from "./tabs.js";
41
- import { a as attachTimelineInteractions, i as timelineStyles, n as IxfxTimelineElement, o as resolveCssVars, r as TimelineTrackTabElement, s as resolveGrid, t as TimelineController } from "./timeline-DBWJsSjd.js";
42
- import { TreeBaseElement, TreeController, TreeListElement } from "./tree.js";
42
+ import { a as resolveCssVars, i as attachTimelineInteractions, n as TimelineTrackTabElement, o as resolveGrid, r as timelineStyles, s as TimelineController, t as IxfxTimelineElement } from "./timeline-Cv75Th2U.js";
43
43
  import { XyPad } from "./xy-pad.js";
44
44
  import { LitElement, css, html, nothing } from "lit";
45
- import { customElement, eventOptions, property, query, queryAssignedElements, state } from "lit/decorators.js";
45
+ import { eventOptions, property, query, queryAssignedElements, state } from "lit/decorators.js";
46
46
  import { unsafeHTML } from "lit/directives/unsafe-html.js";
47
+ import { keyed } from "lit/directives/keyed.js";
47
48
  import { classMap } from "lit/directives/class-map.js";
49
+ //#region src/ac-token/ac-token.ts
50
+ const DEFAULT_TOKENIZER = (text) => text.split(/[\s,;]+/);
51
+ function makeLruCache(maxSize) {
52
+ const map = /* @__PURE__ */ new Map();
53
+ return {
54
+ get: (k) => map.get(k),
55
+ set: (k, v) => {
56
+ if (map.has(k)) map.delete(k);
57
+ map.set(k, v);
58
+ if (map.size > maxSize) map.delete(map.keys().next().value);
59
+ },
60
+ has: (k) => map.has(k),
61
+ clear: () => map.clear()
62
+ };
63
+ }
64
+ let AcTokenElement = class AcTokenElement extends LitElement {
65
+ #cache;
66
+ #debounceTimer;
67
+ #abortController;
68
+ #staticProvider;
69
+ constructor() {
70
+ super();
71
+ this.placeholder = ``;
72
+ this.cacheSize = 20;
73
+ this.debounceMs = 150;
74
+ this.strict = false;
75
+ this._tokens = [];
76
+ this._draft = ``;
77
+ this._suggestions = [];
78
+ this._isOpen = false;
79
+ this._isLoading = false;
80
+ this._tickled = new TickledController(this, { getItems: () => this._suggestions.map((_, i) => ({
81
+ id: i,
82
+ enabled: true
83
+ })) });
84
+ this.#cache = makeLruCache(20);
85
+ this.#onWrapperClick = (e) => {
86
+ if (!e.target.closest(`.token-chip`)) this.shadowRoot?.querySelector(`input.draft`)?.focus();
87
+ };
88
+ this.#onFocus = () => {
89
+ this._selectedTokenIndex = void 0;
90
+ this.#scheduleSuggestionFetch(this._draft);
91
+ };
92
+ this.#onBlur = () => {
93
+ setTimeout(() => {
94
+ this._isOpen = false;
95
+ this._tickled.clearTickled();
96
+ this._selectedTokenIndex = void 0;
97
+ }, 120);
98
+ };
99
+ this.#onInput = (e) => {
100
+ const value = e.target.value;
101
+ this._selectedTokenIndex = void 0;
102
+ const parts = (this.tokenizer ?? DEFAULT_TOKENIZER)(value);
103
+ if (parts.length > 1) {
104
+ for (let i = 0; i < parts.length - 1; i++) {
105
+ const label = parts[i].trim();
106
+ if (label) this.#addToken({ label });
107
+ }
108
+ this._draft = parts[parts.length - 1] ?? ``;
109
+ } else this._draft = value;
110
+ this.#scheduleSuggestionFetch(this._draft);
111
+ };
112
+ this.#onKeyDown = (e) => {
113
+ const input = e.target;
114
+ if ((e.metaKey || e.ctrlKey) && e.key === `a`) {
115
+ e.preventDefault();
116
+ const parts = [...this._tokens.map((t) => t.label), this._draft.trim()].filter(Boolean);
117
+ navigator.clipboard.writeText(parts.join(` `)).catch(() => {});
118
+ return;
119
+ }
120
+ if (this._selectedTokenIndex !== void 0 && e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey) {
121
+ e.preventDefault();
122
+ this.#startEditingSelectedToken(e.key);
123
+ return;
124
+ }
125
+ this.#handleNavigationKey(e, input);
126
+ };
127
+ this.#onPaste = (e) => {
128
+ e.preventDefault();
129
+ const text = e.clipboardData?.getData(`text/plain`) ?? ``;
130
+ if (!text) return;
131
+ const parts = (this.tokenizer ?? DEFAULT_TOKENIZER)(this._draft + text).filter(Boolean);
132
+ if (parts.length === 0) return;
133
+ if (parts.length === 1) this._draft = parts[0];
134
+ else {
135
+ for (let i = 0; i < parts.length - 1; i++) {
136
+ const label = parts[i].trim();
137
+ if (label) this.#addToken({ label });
138
+ }
139
+ this._draft = parts[parts.length - 1] ?? ``;
140
+ }
141
+ this.updateComplete.then(() => {
142
+ this.shadowRoot?.querySelector(`input.draft`)?.setSelectionRange(this._draft.length, this._draft.length);
143
+ });
144
+ this.#scheduleSuggestionFetch(this._draft);
145
+ };
146
+ this.#onSuggestionPointerDown = (e, item) => {
147
+ e.preventDefault();
148
+ this.#selectSuggestion(item);
149
+ };
150
+ this.#onChipPointerDown = (e, index) => {
151
+ if (e.button !== 0) return;
152
+ e.preventDefault();
153
+ const el = e.currentTarget;
154
+ const startY = e.clientY;
155
+ let dragged = false;
156
+ el.setPointerCapture(e.pointerId);
157
+ const cleanup = () => {
158
+ el.removeEventListener(`pointermove`, onMove);
159
+ el.removeEventListener(`pointerup`, onUp);
160
+ };
161
+ const onMove = (me) => {
162
+ if (Math.abs(me.clientY - startY) > 28) {
163
+ dragged = true;
164
+ el.releasePointerCapture(me.pointerId);
165
+ cleanup();
166
+ this.#removeToken(index);
167
+ this.shadowRoot?.querySelector(`input.draft`)?.focus();
168
+ }
169
+ };
170
+ const onUp = () => {
171
+ cleanup();
172
+ if (!dragged) {
173
+ this._selectedTokenIndex = this._selectedTokenIndex === index ? void 0 : index;
174
+ this.shadowRoot?.querySelector(`input.draft`)?.focus();
175
+ }
176
+ };
177
+ el.addEventListener(`pointermove`, onMove);
178
+ el.addEventListener(`pointerup`, onUp);
179
+ };
180
+ this.#cache = makeLruCache(this.cacheSize);
181
+ }
182
+ get tokens() {
183
+ return this._tokens;
184
+ }
185
+ set tokens(value) {
186
+ this._tokens = [...value];
187
+ this.#emitChange();
188
+ }
189
+ /** All committed token labels joined with commas. */
190
+ get value() {
191
+ return this._tokens.map((t) => t.label).join(`, `);
192
+ }
193
+ connectedCallback() {
194
+ super.connectedCallback();
195
+ this.#buildStaticProvider();
196
+ }
197
+ disconnectedCallback() {
198
+ super.disconnectedCallback();
199
+ this.#cancelPending();
200
+ }
201
+ updated(changedProps) {
202
+ if (changedProps.has(`completionProvider`) || changedProps.has(`cacheSize`)) this.#cache = makeLruCache(this.cacheSize);
203
+ if (changedProps.has(`completionProvider`)) this.#buildStaticProvider();
204
+ }
205
+ #buildStaticProvider() {
206
+ const raw = this.getAttribute(`data-tokens`);
207
+ if (!raw || this.completionProvider) {
208
+ this.#staticProvider = void 0;
209
+ return;
210
+ }
211
+ const items = raw.trim().split(/[\s,;]+/).filter(Boolean).map((label) => ({ label }));
212
+ this.#staticProvider = createAcCompletionProvider(items);
213
+ }
214
+ #onWrapperClick;
215
+ #onFocus;
216
+ #onBlur;
217
+ #onInput;
218
+ #onKeyDown;
219
+ #handleNavigationKey(e, input) {
220
+ switch (e.key) {
221
+ case `ArrowLeft`:
222
+ if (input.selectionStart === 0 && input.selectionEnd === 0) {
223
+ e.preventDefault();
224
+ if (this._selectedTokenIndex === void 0) {
225
+ if (this._tokens.length > 0) this._selectedTokenIndex = this._tokens.length - 1;
226
+ } else if (this._selectedTokenIndex > 0) this._selectedTokenIndex--;
227
+ }
228
+ break;
229
+ case `ArrowRight`:
230
+ if (this._selectedTokenIndex !== void 0) {
231
+ e.preventDefault();
232
+ if (this._selectedTokenIndex < this._tokens.length - 1) this._selectedTokenIndex++;
233
+ else this._selectedTokenIndex = void 0;
234
+ }
235
+ break;
236
+ case `Backspace`:
237
+ if (input.selectionStart === 0 && input.selectionEnd === 0) {
238
+ e.preventDefault();
239
+ if (this._selectedTokenIndex !== void 0) this.#removeToken(this._selectedTokenIndex);
240
+ else if (this._tokens.length > 0) this.#removeToken(this._tokens.length - 1);
241
+ }
242
+ break;
243
+ case `Enter`: {
244
+ const tickledIdx = this._tickled.tickledId;
245
+ if (this._isOpen && tickledIdx !== void 0 && this._suggestions[tickledIdx]) {
246
+ e.preventDefault();
247
+ this.#selectSuggestion(this._suggestions[tickledIdx]);
248
+ } else if (!this.strict && this._draft.trim()) {
249
+ e.preventDefault();
250
+ this.#addToken({ label: this._draft.trim() });
251
+ this._draft = ``;
252
+ this.#closePopup();
253
+ }
254
+ break;
255
+ }
256
+ case `ArrowDown`:
257
+ if (!this._isOpen) return;
258
+ e.preventDefault();
259
+ this._tickled.handleKeyboardNavigation(`next`);
260
+ this.#scrollSuggestionIntoView();
261
+ break;
262
+ case `ArrowUp`:
263
+ if (!this._isOpen) return;
264
+ e.preventDefault();
265
+ this._tickled.handleKeyboardNavigation(`previous`);
266
+ this.#scrollSuggestionIntoView();
267
+ break;
268
+ case `Escape`:
269
+ e.preventDefault();
270
+ this.#closePopup();
271
+ this._selectedTokenIndex = void 0;
272
+ break;
273
+ }
274
+ }
275
+ #onPaste;
276
+ #onSuggestionPointerDown;
277
+ #onChipPointerDown;
278
+ #startEditingSelectedToken(key) {
279
+ const idx = this._selectedTokenIndex;
280
+ if (idx === void 0) return;
281
+ const token = this._tokens[idx];
282
+ if (!token) return;
283
+ const newDraft = token.label + key;
284
+ this.#removeToken(idx);
285
+ this._selectedTokenIndex = void 0;
286
+ this._draft = newDraft;
287
+ this.updateComplete.then(() => {
288
+ const inp = this.shadowRoot?.querySelector(`input.draft`);
289
+ if (!inp) return;
290
+ inp.setSelectionRange(inp.value.length, inp.value.length);
291
+ });
292
+ this.#scheduleSuggestionFetch(newDraft);
293
+ }
294
+ #addToken(item) {
295
+ const index = this._tokens.length;
296
+ this._tokens = [...this._tokens, item];
297
+ this.dispatchEvent(new CustomEvent(`ac-token-add`, {
298
+ detail: {
299
+ item,
300
+ index
301
+ },
302
+ bubbles: true,
303
+ composed: true
304
+ }));
305
+ this.#emitChange();
306
+ }
307
+ #removeToken(index) {
308
+ const item = this._tokens[index];
309
+ if (!item) return;
310
+ this._tokens = this._tokens.filter((_, i) => i !== index);
311
+ if (this._selectedTokenIndex !== void 0) {
312
+ if (this._selectedTokenIndex === index) this._selectedTokenIndex = void 0;
313
+ else if (this._selectedTokenIndex > index) this._selectedTokenIndex--;
314
+ }
315
+ this.dispatchEvent(new CustomEvent(`ac-token-remove`, {
316
+ detail: {
317
+ item,
318
+ index
319
+ },
320
+ bubbles: true,
321
+ composed: true
322
+ }));
323
+ this.#emitChange();
324
+ }
325
+ #selectSuggestion(item) {
326
+ this.#addToken(item);
327
+ this._draft = ``;
328
+ this.#closePopup();
329
+ }
330
+ #emitChange() {
331
+ this.dispatchEvent(new CustomEvent(`ac-token-change`, {
332
+ detail: { tokens: this._tokens },
333
+ bubbles: true,
334
+ composed: true
335
+ }));
336
+ }
337
+ #closePopup() {
338
+ this._isOpen = false;
339
+ this._tickled.clearTickled();
340
+ }
341
+ #cancelPending() {
342
+ if (this.#debounceTimer !== void 0) {
343
+ clearTimeout(this.#debounceTimer);
344
+ this.#debounceTimer = void 0;
345
+ }
346
+ this.#abortController?.abort();
347
+ this.#abortController = void 0;
348
+ this._isLoading = false;
349
+ }
350
+ #scheduleSuggestionFetch(query) {
351
+ const provider = this.completionProvider ?? this.#staticProvider;
352
+ if (!provider) {
353
+ this._isOpen = false;
354
+ return;
355
+ }
356
+ if (this.#debounceTimer !== void 0) clearTimeout(this.#debounceTimer);
357
+ this._isOpen = true;
358
+ this.#debounceTimer = setTimeout(() => {
359
+ this.#fetchSuggestions(query, provider);
360
+ }, this.debounceMs);
361
+ }
362
+ #fetchSuggestions(query, provider) {
363
+ const cached = this.#cache.get(query);
364
+ if (cached !== void 0) {
365
+ this._suggestions = cached;
366
+ this._tickled.clearTickled();
367
+ this._isLoading = false;
368
+ return;
369
+ }
370
+ this.#abortController?.abort();
371
+ this.#abortController = new AbortController();
372
+ const { signal } = this.#abortController;
373
+ this._isLoading = true;
374
+ Promise.resolve(provider(query, signal)).then((results) => {
375
+ if (signal.aborted) return;
376
+ this.#cache.set(query, results);
377
+ this._suggestions = results;
378
+ this._tickled.clearTickled();
379
+ this._isLoading = false;
380
+ }).catch((err) => {
381
+ if (signal.aborted) return;
382
+ console.error(`[ixfx-ac-token] completionProvider error:`, err);
383
+ this._suggestions = [];
384
+ this._isLoading = false;
385
+ });
386
+ }
387
+ #scrollSuggestionIntoView() {
388
+ this.updateComplete.then(() => {
389
+ this.shadowRoot?.querySelector(`.suggestion.tickled`)?.scrollIntoView({ block: `nearest` });
390
+ });
391
+ }
392
+ #renderChip(item, index) {
393
+ return html`
394
+ <span
395
+ class="token-chip ${this._selectedTokenIndex === index ? `selected` : ``}"
396
+ title=${item.subLabel ?? nothing}
397
+ @pointerdown=${(e) => this.#onChipPointerDown(e, index)}
398
+ >
399
+ ${item.icon ? html`<ixfx-icon class="chip-icon" name=${item.icon}></ixfx-icon>` : nothing}
400
+ <span class="chip-label">${item.label}</span>
401
+ </span>
402
+ `;
403
+ }
404
+ #renderSuggestion(item, index) {
405
+ const isTickled = this._tickled.isTickled(index);
406
+ return html`
407
+ <div
408
+ class="suggestion ${isTickled ? `tickled` : ``}"
409
+ role="option"
410
+ id="ac-token-sugg-${index}"
411
+ aria-selected=${isTickled}
412
+ @pointerenter=${() => this._tickled.handlePointerEnter(index)}
413
+ @pointerdown=${(e) => this.#onSuggestionPointerDown(e, item)}
414
+ >
415
+ ${item.icon ? html`<ixfx-icon class="sugg-icon" name=${item.icon}></ixfx-icon>` : nothing}
416
+ <span class="sugg-label">${item.label}</span>
417
+ ${item.subLabel ? html`<span class="sugg-sublabel">${item.subLabel}</span>` : nothing}
418
+ </div>
419
+ `;
420
+ }
421
+ #renderPopup() {
422
+ const showEmpty = !this._isLoading && this._suggestions.length === 0;
423
+ return html`
424
+ <div
425
+ class="popup"
426
+ role="listbox"
427
+ aria-label="Suggestions"
428
+ data-input-mode=${this._tickled.inputMode}
429
+ @pointerleave=${(e) => this._tickled.handlePointerLeave(e)}
430
+ >
431
+ ${showEmpty ? html`<div class="no-results">No matching results</div>` : this._suggestions.map((item, i) => this.#renderSuggestion(item, i))}
432
+ </div>
433
+ `;
434
+ }
435
+ render() {
436
+ const tickledIdx = this._tickled.tickledId ?? -1;
437
+ const activeDescendant = tickledIdx >= 0 ? `ac-token-sugg-${tickledIdx}` : void 0;
438
+ const showPlaceholder = this._tokens.length === 0 ? this.placeholder || nothing : nothing;
439
+ return html`
440
+ <div class="wrapper" @click=${this.#onWrapperClick}>
441
+ ${this._tokens.map((t, i) => this.#renderChip(t, i))}
442
+ <input
443
+ type="text"
444
+ class="draft"
445
+ .value=${this._draft}
446
+ placeholder=${showPlaceholder}
447
+ autocomplete="off"
448
+ spellcheck="false"
449
+ role="combobox"
450
+ aria-autocomplete="list"
451
+ aria-expanded=${this._isOpen}
452
+ aria-activedescendant=${activeDescendant ?? nothing}
453
+ @input=${this.#onInput}
454
+ @keydown=${this.#onKeyDown}
455
+ @focus=${this.#onFocus}
456
+ @blur=${this.#onBlur}
457
+ @paste=${this.#onPaste}
458
+ >
459
+ ${this._isLoading ? html`<span class="spinner" aria-hidden="true"></span>` : nothing}
460
+ </div>
461
+ ${this._isOpen ? this.#renderPopup() : nothing}
462
+ `;
463
+ }
464
+ static {
465
+ this.styles = [tickledStyles, css`
466
+ :host {
467
+ display: block;
468
+ position: relative;
469
+ font-family: var(--font-family, system-ui, sans-serif);
470
+ font-size: var(--text-m, 12px);
471
+ color: var(--surface-2-text);
472
+ }
473
+
474
+ /* ---- Wrapper (looks like a text input) ---- */
475
+
476
+ .wrapper {
477
+ display: flex;
478
+ flex-wrap: wrap;
479
+ align-items: center;
480
+ gap: var(--ac-token-chip-gap, var(--space-xs, 3px));
481
+ padding: var(--ac-token-input-padding, var(--space-xs, 3px) var(--space-m, 8px));
482
+ background: var(--ac-token-input-background, var(--surface-3, var(--surface-2)));
483
+ color: var(--surface-2-text);
484
+ border: var(--ac-token-input-border, var(--border));
485
+ border-radius: var(--ac-token-input-border-radius, var(--radius-m, 4px));
486
+ cursor: text;
487
+ min-height: 32px;
488
+ box-sizing: border-box;
489
+ transition: border-color var(--transition, 0.15s ease-out);
490
+ }
491
+
492
+ .wrapper:focus-within {
493
+ border-color: var(--accent);
494
+ }
495
+
496
+ /* ---- Token chips ---- */
497
+
498
+ .token-chip {
499
+ display: inline-flex;
500
+ align-items: center;
501
+ gap: var(--space-xs, 3px);
502
+ padding: 1px var(--space-m, 8px);
503
+ background: var(--ac-token-chip-background, var(--surface-4));
504
+ border: var(--ac-token-chip-border, var(--border));
505
+ border-radius: var(--ac-token-chip-border-radius, var(--radius-s, 3px));
506
+ user-select: none;
507
+ cursor: default;
508
+ font-size: var(--text-s, 11px);
509
+ white-space: nowrap;
510
+ touch-action: none;
511
+ transition:
512
+ background var(--transition, 0.1s ease-out),
513
+ border-color var(--transition, 0.1s ease-out),
514
+ color var(--transition, 0.1s ease-out);
515
+ }
516
+
517
+ .token-chip.selected {
518
+ background: var(--ac-token-chip-selected-background, var(--accent));
519
+ color: var(--ac-token-chip-selected-color, var(--accent-text, #fff));
520
+ border-color: var(--accent);
521
+ }
522
+
523
+ .chip-icon {
524
+ flex-shrink: 0;
525
+ width: 1em;
526
+ height: 1em;
527
+ }
528
+
529
+ /* ---- Draft input ---- */
530
+
531
+ input.draft {
532
+ flex: 1;
533
+ min-width: 60px;
534
+ border: none;
535
+ background: transparent;
536
+ color: inherit;
537
+ font: inherit;
538
+ outline: none;
539
+ caret-color: var(--accent);
540
+ padding: 1px 0;
541
+ anchor-name: --ac-token-draft;
542
+ }
543
+
544
+ input.draft::placeholder {
545
+ color: var(--surface-muted-text);
546
+ }
547
+
548
+ /* ---- Spinner ---- */
549
+
550
+ .spinner {
551
+ width: 12px;
552
+ height: 12px;
553
+ border: 2px solid var(--surface-5);
554
+ border-top-color: var(--accent);
555
+ border-radius: 50%;
556
+ animation: ac-token-spin 0.7s linear infinite;
557
+ flex-shrink: 0;
558
+ pointer-events: none;
559
+ margin-left: var(--space-xs, 3px);
560
+ }
561
+
562
+ @keyframes ac-token-spin {
563
+ to { transform: rotate(360deg); }
564
+ }
565
+
566
+ /* ---- Popup ---- */
567
+
568
+ .popup {
569
+ position: fixed;
570
+ position-anchor: --ac-token-draft;
571
+ top: anchor(bottom);
572
+ left: anchor(left);
573
+ margin-top: 2px;
574
+ position-try-fallbacks: --ac-token-popup-above;
575
+ z-index: 200;
576
+ background: var(--surface-3, var(--surface-2));
577
+ border: var(--border);
578
+ border-radius: var(--radius-m, 4px);
579
+ box-shadow: var(--shadow-l, 0 4px 24px rgba(0, 0, 0, 0.5));
580
+ padding: var(--space-xs, 3px) 0;
581
+ max-height: 260px;
582
+ min-width: 160px;
583
+ overflow-y: auto;
584
+ font-size: var(--ac-token-popup-font-size, var(--text-s, 11px));
585
+ }
586
+
587
+ @position-try --ac-token-popup-above {
588
+ top: auto;
589
+ bottom: anchor(top);
590
+ left: anchor(left);
591
+ margin-top: 0;
592
+ margin-bottom: 2px;
593
+ }
594
+
595
+ /* ---- Suggestion items ---- */
596
+
597
+ .suggestion {
598
+ display: flex;
599
+ align-items: center;
600
+ gap: var(--space-m, 8px);
601
+ padding: var(--space-xs, 3px) var(--space-l, 12px);
602
+ cursor: pointer;
603
+ border-radius: var(--radius-s, 3px);
604
+ margin: 0 var(--space-xs, 3px);
605
+ transition: background var(--transition, 0.1s ease-out);
606
+ user-select: none;
607
+ white-space: nowrap;
608
+ min-height: 28px;
609
+ }
610
+
611
+ .suggestion.tickled {
612
+ background: var(--_item-focused-bg, var(--accent));
613
+ color: var(--accent-text, #fff);
614
+ }
615
+
616
+ .suggestion.tickled .sugg-sublabel {
617
+ color: color-mix(in srgb, var(--accent-text, #fff) 70%, transparent);
618
+ }
619
+
620
+ .sugg-icon {
621
+ flex-shrink: 0;
622
+ width: 1em;
623
+ height: 1em;
624
+ }
625
+
626
+ .sugg-label {
627
+ flex: 1;
628
+ overflow: hidden;
629
+ text-overflow: ellipsis;
630
+ }
631
+
632
+ .sugg-sublabel {
633
+ flex-shrink: 0;
634
+ margin-left: auto;
635
+ color: var(--surface-muted-text);
636
+ font-size: var(--text-s, 11px);
637
+ }
638
+
639
+ /* ---- Empty state ---- */
640
+
641
+ .no-results {
642
+ padding: var(--space-m, 8px) var(--space-l, 12px);
643
+ color: var(--surface-muted-text);
644
+ font-style: italic;
645
+ }
646
+ `];
647
+ }
648
+ };
649
+ __decorate([property({ type: Object })], AcTokenElement.prototype, "completionProvider", void 0);
650
+ __decorate([property({ type: Object })], AcTokenElement.prototype, "tokenizer", void 0);
651
+ __decorate([property({ type: String })], AcTokenElement.prototype, "placeholder", void 0);
652
+ __decorate([property({
653
+ type: Number,
654
+ attribute: `cache-size`
655
+ })], AcTokenElement.prototype, "cacheSize", void 0);
656
+ __decorate([property({
657
+ type: Number,
658
+ attribute: `debounce-ms`
659
+ })], AcTokenElement.prototype, "debounceMs", void 0);
660
+ __decorate([property({ type: Boolean })], AcTokenElement.prototype, "strict", void 0);
661
+ __decorate([state()], AcTokenElement.prototype, "_tokens", void 0);
662
+ __decorate([state()], AcTokenElement.prototype, "_draft", void 0);
663
+ __decorate([state()], AcTokenElement.prototype, "_selectedTokenIndex", void 0);
664
+ __decorate([state()], AcTokenElement.prototype, "_suggestions", void 0);
665
+ __decorate([state()], AcTokenElement.prototype, "_isOpen", void 0);
666
+ __decorate([state()], AcTokenElement.prototype, "_isLoading", void 0);
667
+ AcTokenElement = __decorate([safeCustomElement(`ixfx-ac-token`)], AcTokenElement);
668
+ //#endregion
48
669
  //#region src/button/radio-group.ts
49
670
  let RadioGroup = class RadioGroup extends LitElement {
50
671
  constructor(..._args) {
@@ -371,7 +992,7 @@ __decorate([property({
371
992
  __decorate([state()], RadioGroup.prototype, "_computedItems", void 0);
372
993
  __decorate([state()], RadioGroup.prototype, "_icons", void 0);
373
994
  __decorate([query(`slot`)], RadioGroup.prototype, "_slot", void 0);
374
- RadioGroup = __decorate([customElement(`ixfx-radio-group`)], RadioGroup);
995
+ RadioGroup = __decorate([safeCustomElement(`ixfx-radio-group`)], RadioGroup);
375
996
  //#endregion
376
997
  //#region src/button/split-button.ts
377
998
  let SplitButton = class SplitButton extends ButtonElement {
@@ -760,7 +1381,7 @@ __decorate([state()], SplitButton.prototype, "_switcherItems", void 0);
760
1381
  __decorate([state()], SplitButton.prototype, "_dynamicItems", void 0);
761
1382
  __decorate([state()], SplitButton.prototype, "_loadingItems", void 0);
762
1383
  __decorate([state()], SplitButton.prototype, "_menuHasItems", void 0);
763
- SplitButton = __decorate([customElement(`ixfx-split-button`)], SplitButton);
1384
+ SplitButton = __decorate([safeCustomElement(`ixfx-split-button`)], SplitButton);
764
1385
  //#endregion
765
1386
  //#region node_modules/.pnpm/@ixfx+collections@0.56.12/node_modules/@ixfx/collections/dist/StackMutable-B9Qm32K8.js
766
1387
  const trimStack = (opts, stack, toAdd) => {
@@ -4174,7 +4795,7 @@ __decorate([state()], CrumbPathElement.prototype, "_dropdownActiveIndex", void 0
4174
4795
  __decorate([state()], CrumbPathElement.prototype, "_editingCancelled", void 0);
4175
4796
  __decorate([state()], CrumbPathElement.prototype, "_editStartIndex", void 0);
4176
4797
  __decorate([state()], CrumbPathElement.prototype, "_openCumPath", void 0);
4177
- CrumbPathElement = __decorate([customElement(`ixfx-crumb-path`)], CrumbPathElement);
4798
+ CrumbPathElement = __decorate([safeCustomElement(`ixfx-crumb-path`)], CrumbPathElement);
4178
4799
  //#endregion
4179
4800
  //#region src/editable-label/editable-number.ts
4180
4801
  const DRAG_THRESHOLD_PX = 3;
@@ -4752,7 +5373,7 @@ __decorate([property({
4752
5373
  attribute: `no-drag`
4753
5374
  })], EditableNumber.prototype, "noDrag", void 0);
4754
5375
  __decorate([property({ type: Number })], EditableNumber.prototype, "precision", void 0);
4755
- EditableNumber = __decorate([customElement(`ixfx-editable-number`)], EditableNumber);
5376
+ EditableNumber = __decorate([safeCustomElement(`ixfx-editable-number`)], EditableNumber);
4756
5377
  //#endregion
4757
5378
  //#region src/panel/panel-group.ts
4758
5379
  let PanelGroupElement = class PanelGroupElement extends LitElement {
@@ -4840,7 +5461,7 @@ __decorate([property({
4840
5461
  })], PanelGroupElement.prototype, "allowMultiple", void 0);
4841
5462
  __decorate([property()], PanelGroupElement.prototype, "gap", void 0);
4842
5463
  __decorate([queryAssignedElements({ slot: `` })], PanelGroupElement.prototype, "_panels", void 0);
4843
- PanelGroupElement = __decorate([customElement(`ixfx-panel-group`)], PanelGroupElement);
5464
+ PanelGroupElement = __decorate([safeCustomElement(`ixfx-panel-group`)], PanelGroupElement);
4844
5465
  //#endregion
4845
5466
  //#region src/util/drag.ts
4846
5467
  function getCoordinates(event) {
@@ -5353,7 +5974,7 @@ __decorate([property({ type: Number })], RangeMultiElement.prototype, "max", nul
5353
5974
  __decorate([property({ type: Number })], RangeMultiElement.prototype, "min", null);
5354
5975
  __decorate([eventOptions({ capture: true })], RangeMultiElement.prototype, "_onInput", null);
5355
5976
  __decorate([eventOptions({ capture: true })], RangeMultiElement.prototype, "_onPointerDown", null);
5356
- RangeMultiElement = __decorate([customElement(`ixfx-range-multi`)], RangeMultiElement);
5977
+ RangeMultiElement = __decorate([safeCustomElement(`ixfx-range-multi`)], RangeMultiElement);
5357
5978
  //#endregion
5358
5979
  //#region src/tabs/tab-list-item.ts
5359
5980
  let TabListItemElement = class TabListItemElement extends LitElement {
@@ -5515,7 +6136,7 @@ __decorate([property({
5515
6136
  })], TabListItemElement.prototype, "commandActive", void 0);
5516
6137
  __decorate([property({ attribute: false })], TabListItemElement.prototype, "registry", void 0);
5517
6138
  __decorate([state()], TabListItemElement.prototype, "_compact", void 0);
5518
- TabListItemElement = __decorate([customElement(`ixfx-tab-list-item`)], TabListItemElement);
6139
+ TabListItemElement = __decorate([safeCustomElement(`ixfx-tab-list-item`)], TabListItemElement);
5519
6140
  //#endregion
5520
6141
  //#region src/tabs/tab-panel.ts
5521
6142
  let TabPanelElement = class TabPanelElement extends LitElement {
@@ -5537,7 +6158,7 @@ let TabPanelElement = class TabPanelElement extends LitElement {
5537
6158
  `;
5538
6159
  }
5539
6160
  };
5540
- TabPanelElement = __decorate([customElement(`ixfx-tab-panel`)], TabPanelElement);
6161
+ TabPanelElement = __decorate([safeCustomElement(`ixfx-tab-panel`)], TabPanelElement);
5541
6162
  //#endregion
5542
6163
  //#region src/tabs/tab-panels.ts
5543
6164
  let TabPanelsElement = class TabPanelsElement extends LitElement {
@@ -5592,7 +6213,249 @@ let TabPanelsElement = class TabPanelsElement extends LitElement {
5592
6213
  }
5593
6214
  };
5594
6215
  __decorate([queryAssignedElements()], TabPanelsElement.prototype, "_listItems", void 0);
5595
- TabPanelsElement = __decorate([customElement(`ixfx-tab-panels`)], TabPanelsElement);
6216
+ TabPanelsElement = __decorate([safeCustomElement(`ixfx-tab-panels`)], TabPanelsElement);
6217
+ //#endregion
6218
+ //#region src/transitory-label/transitory-label.ts
6219
+ let TransitoryLabelElement = class TransitoryLabelElement extends LitElement {
6220
+ constructor(..._args) {
6221
+ super(..._args);
6222
+ this.text = ``;
6223
+ this.effect = `fade`;
6224
+ this.duration = 300;
6225
+ this.easing = `ease`;
6226
+ this._currentText = ``;
6227
+ this._outgoingText = ``;
6228
+ this._transitionId = 0;
6229
+ this._queue = [];
6230
+ this.#onOutgoingEnd = () => {
6231
+ this._onTransitionEnd();
6232
+ };
6233
+ this.#onLastCharOut = () => {
6234
+ this._onTransitionEnd();
6235
+ };
6236
+ }
6237
+ setText(msg, effect) {
6238
+ this._pendingEffect = effect;
6239
+ this.text = msg;
6240
+ }
6241
+ updated(changed) {
6242
+ if (changed.has(`text`) && this.text !== this._currentText) {
6243
+ const effect = this._pendingEffect ?? this.effect;
6244
+ this._pendingEffect = void 0;
6245
+ if (this._activeEffect !== void 0) this._queue.push({
6246
+ text: this.text,
6247
+ effect
6248
+ });
6249
+ else this._startTransition(this.text, effect);
6250
+ }
6251
+ }
6252
+ _startTransition(newText, effect) {
6253
+ const prevText = this._currentText;
6254
+ this._currentText = newText;
6255
+ this._outgoingText = prevText;
6256
+ if (prevText !== ``) {
6257
+ this._transitionId++;
6258
+ this._activeEffect = effect;
6259
+ }
6260
+ }
6261
+ _onTransitionEnd() {
6262
+ this._outgoingText = ``;
6263
+ this._activeEffect = void 0;
6264
+ if (this._queue.length > 0) {
6265
+ const next = this._queue.shift();
6266
+ this._startTransition(next.text, next.effect);
6267
+ }
6268
+ }
6269
+ #onOutgoingEnd;
6270
+ #onLastCharOut;
6271
+ #renderCharSwap() {
6272
+ const charDuration = Math.round(this.duration * .3);
6273
+ const charStagger = Math.round(this.duration * .1);
6274
+ const currentChars = this._currentText.split(``);
6275
+ const outgoingChars = this._outgoingText.split(``);
6276
+ const lastIdx = outgoingChars.length - 1;
6277
+ const charStyle = (i) => `animation-duration:${charDuration}ms;animation-delay:${i * charStagger}ms;animation-timing-function:${this.easing}`;
6278
+ return html`
6279
+ ${keyed(`cc${this._transitionId}`, html`
6280
+ <span class="layer current char-swap">
6281
+ ${currentChars.map((ch, i) => html`<span class="char in" style=${charStyle(i)}>${ch}</span>`)}
6282
+ </span>
6283
+ `)}
6284
+ ${this._outgoingText ? keyed(this._transitionId, html`
6285
+ <span class="layer outgoing char-swap">
6286
+ ${outgoingChars.map((ch, i) => html`<span
6287
+ class="char out"
6288
+ style=${charStyle(i)}
6289
+ @animationend=${i === lastIdx ? this.#onLastCharOut : void 0}
6290
+ >${ch}</span>`)}
6291
+ </span>
6292
+ `) : nothing}
6293
+ `;
6294
+ }
6295
+ render() {
6296
+ if (this._activeEffect === `character-swap`) return html`<span class="container">${this.#renderCharSwap()}</span>`;
6297
+ const effect = this._activeEffect ?? ``;
6298
+ const durStyle = this._activeEffect ? `animation-duration:${this.duration}ms;animation-timing-function:${this.easing}` : ``;
6299
+ return html`
6300
+ <span class="container">
6301
+ ${this._outgoingText ? keyed(this._transitionId, html`
6302
+ <span class="layer outgoing ${effect}" style=${durStyle} @animationend=${this.#onOutgoingEnd}>
6303
+ ${this._outgoingText}
6304
+ </span>
6305
+ `) : nothing}
6306
+ ${keyed(`c${this._transitionId}`, html`
6307
+ <span class="layer current ${effect}" style=${durStyle}>
6308
+ ${this._currentText}
6309
+ </span>
6310
+ `)}
6311
+ </span>
6312
+ `;
6313
+ }
6314
+ static {
6315
+ this.styles = css`
6316
+ :host {
6317
+ display: inline-block;
6318
+ --transitory-label-easing: ease;
6319
+ }
6320
+
6321
+ .container {
6322
+ display: inline-grid;
6323
+ overflow: hidden;
6324
+ }
6325
+
6326
+ .layer {
6327
+ grid-area: 1 / 1;
6328
+ white-space: nowrap;
6329
+ }
6330
+
6331
+ .layer.outgoing {
6332
+ pointer-events: none;
6333
+ }
6334
+
6335
+ /* slide-right */
6336
+ .layer.current.slide-right {
6337
+ transform: translateX(-100%);
6338
+ animation: tl-slide-in-left var(--transitory-label-easing) forwards;
6339
+ }
6340
+ .layer.outgoing.slide-right {
6341
+ animation: tl-slide-out-right var(--transitory-label-easing) forwards;
6342
+ }
6343
+
6344
+ @keyframes tl-slide-in-left {
6345
+ from { transform: translateX(-100%); }
6346
+ to { transform: translateX(0); }
6347
+ }
6348
+ @keyframes tl-slide-out-right {
6349
+ from { transform: translateX(0); }
6350
+ to { transform: translateX(100%); }
6351
+ }
6352
+
6353
+ /* slide-left */
6354
+ .layer.current.slide-left {
6355
+ transform: translateX(100%);
6356
+ animation: tl-slide-in-right var(--transitory-label-easing) forwards;
6357
+ }
6358
+ .layer.outgoing.slide-left {
6359
+ animation: tl-slide-out-left var(--transitory-label-easing) forwards;
6360
+ }
6361
+
6362
+ @keyframes tl-slide-in-right {
6363
+ from { transform: translateX(100%); }
6364
+ to { transform: translateX(0); }
6365
+ }
6366
+ @keyframes tl-slide-out-left {
6367
+ from { transform: translateX(0); }
6368
+ to { transform: translateX(-100%); }
6369
+ }
6370
+
6371
+ /* slide-up */
6372
+ .layer.current.slide-up {
6373
+ transform: translateY(100%);
6374
+ animation: tl-slide-in-bottom var(--transitory-label-easing) forwards;
6375
+ }
6376
+ .layer.outgoing.slide-up {
6377
+ animation: tl-slide-out-top var(--transitory-label-easing) forwards;
6378
+ }
6379
+
6380
+ @keyframes tl-slide-in-bottom {
6381
+ from { transform: translateY(100%); }
6382
+ to { transform: translateY(0); }
6383
+ }
6384
+ @keyframes tl-slide-out-top {
6385
+ from { transform: translateY(0); }
6386
+ to { transform: translateY(-100%); }
6387
+ }
6388
+
6389
+ /* slide-down */
6390
+ .layer.current.slide-down {
6391
+ transform: translateY(-100%);
6392
+ animation: tl-slide-in-top var(--transitory-label-easing) forwards;
6393
+ }
6394
+ .layer.outgoing.slide-down {
6395
+ animation: tl-slide-out-bottom var(--transitory-label-easing) forwards;
6396
+ }
6397
+
6398
+ @keyframes tl-slide-in-top {
6399
+ from { transform: translateY(-100%); }
6400
+ to { transform: translateY(0); }
6401
+ }
6402
+ @keyframes tl-slide-out-bottom {
6403
+ from { transform: translateY(0); }
6404
+ to { transform: translateY(100%); }
6405
+ }
6406
+
6407
+ /* fade */
6408
+ .layer.current.fade {
6409
+ opacity: 0;
6410
+ animation: tl-fade-in var(--transitory-label-easing) forwards;
6411
+ }
6412
+ .layer.outgoing.fade {
6413
+ animation: tl-fade-out var(--transitory-label-easing) forwards;
6414
+ }
6415
+
6416
+ @keyframes tl-fade-in {
6417
+ from { opacity: 0; }
6418
+ to { opacity: 1; }
6419
+ }
6420
+ @keyframes tl-fade-out {
6421
+ from { opacity: 1; }
6422
+ to { opacity: 0; }
6423
+ }
6424
+
6425
+ /* character-swap */
6426
+ .char {
6427
+ display: inline-block;
6428
+ }
6429
+
6430
+ .char.in {
6431
+ opacity: 0;
6432
+ animation: tl-char-in var(--transitory-label-easing) forwards;
6433
+ }
6434
+
6435
+ .char.out {
6436
+ animation: tl-char-out var(--transitory-label-easing) forwards;
6437
+ }
6438
+
6439
+ @keyframes tl-char-in {
6440
+ from { opacity: 0; transform: translateY(-0.3em) scale(0.8); }
6441
+ to { opacity: 1; transform: translateY(0) scale(1); }
6442
+ }
6443
+ @keyframes tl-char-out {
6444
+ from { opacity: 1; transform: translateY(0) scale(1); }
6445
+ to { opacity: 0; transform: translateY(0.3em) scale(0.8); }
6446
+ }
6447
+ `;
6448
+ }
6449
+ };
6450
+ __decorate([property({ type: String })], TransitoryLabelElement.prototype, "text", void 0);
6451
+ __decorate([property({ type: String })], TransitoryLabelElement.prototype, "effect", void 0);
6452
+ __decorate([property({ type: Number })], TransitoryLabelElement.prototype, "duration", void 0);
6453
+ __decorate([property({ type: String })], TransitoryLabelElement.prototype, "easing", void 0);
6454
+ __decorate([state()], TransitoryLabelElement.prototype, "_currentText", void 0);
6455
+ __decorate([state()], TransitoryLabelElement.prototype, "_outgoingText", void 0);
6456
+ __decorate([state()], TransitoryLabelElement.prototype, "_activeEffect", void 0);
6457
+ __decorate([state()], TransitoryLabelElement.prototype, "_transitionId", void 0);
6458
+ TransitoryLabelElement = __decorate([safeCustomElement(`ixfx-transitory-label`)], TransitoryLabelElement);
5596
6459
  //#endregion
5597
6460
  //#region src/util/checkbox.ts
5598
6461
  function isCheckboxLike(el) {
@@ -5719,13 +6582,582 @@ __decorate([property({ type: String })], TooltipElement.prototype, "orientation"
5719
6582
  __decorate([property({ type: String })], TooltipElement.prototype, "anchor", void 0);
5720
6583
  __decorate([property()], TooltipElement.prototype, "value", void 0);
5721
6584
  __decorate([property({ type: String })], TooltipElement.prototype, "icon", void 0);
5722
- TooltipElement = _TooltipElement = __decorate([customElement(`ixfx-tooltip`)], TooltipElement);
6585
+ TooltipElement = _TooltipElement = __decorate([safeCustomElement(`ixfx-tooltip`)], TooltipElement);
6586
+ //#endregion
6587
+ //#region src/vertical-list/vertical-list.ts
6588
+ const ITEM_SELECTOR = `li, [data-list-item]`;
6589
+ function isMultiMode(mode) {
6590
+ return mode === `checked` || mode === `vscode` || mode === `standard`;
6591
+ }
6592
+ let VerticalListElement = class VerticalListElement extends LitElement {
6593
+ constructor(..._args) {
6594
+ super(..._args);
6595
+ this.selectionMode = `single`;
6596
+ this.interactionMode = `standard`;
6597
+ this._selectedItems = /* @__PURE__ */ new Set();
6598
+ this._searchVisible = false;
6599
+ this._searchQuery = ``;
6600
+ this.tickled = new TickledController(this, {
6601
+ getItems: () => this._getVisibleItems().map((el) => ({
6602
+ id: el,
6603
+ enabled: true
6604
+ })),
6605
+ onTickle: (id) => {
6606
+ if (id !== void 0) this._dispatch(`list-tickle`, { item: id });
6607
+ },
6608
+ onStateChange: () => this._syncItemStates()
6609
+ });
6610
+ this._onPointerOver = (e) => {
6611
+ const item = this._findListItem(e.composedPath());
6612
+ if (item) this.tickled.handlePointerEnter(item);
6613
+ };
6614
+ this._onPointerLeave = (e) => {
6615
+ this.tickled.handlePointerLeave(e);
6616
+ };
6617
+ this._onKeyDown = (e) => {
6618
+ if ((e.ctrlKey || e.metaKey) && e.key === `f`) {
6619
+ e.preventDefault();
6620
+ this._openSearch();
6621
+ return;
6622
+ }
6623
+ if ((e.ctrlKey || e.metaKey) && e.key === `a`) {
6624
+ if ((this.selectionMode === `multiple` || isMultiMode(this.interactionMode)) && this.selectionMode !== `none`) {
6625
+ e.preventDefault();
6626
+ this._selectAll();
6627
+ }
6628
+ return;
6629
+ }
6630
+ if (this._searchVisible) return;
6631
+ switch (e.key) {
6632
+ case `ArrowDown`:
6633
+ e.preventDefault();
6634
+ this.tickled.handleKeyboardNavigation(`next`);
6635
+ if (e.shiftKey && this.interactionMode === `vscode`) {
6636
+ const cur = this.tickled.tickledId;
6637
+ if (cur) this._rangeSelectTo(cur);
6638
+ }
6639
+ break;
6640
+ case `ArrowUp`:
6641
+ e.preventDefault();
6642
+ this.tickled.handleKeyboardNavigation(`previous`);
6643
+ if (e.shiftKey && this.interactionMode === `vscode`) {
6644
+ const cur = this.tickled.tickledId;
6645
+ if (cur) this._rangeSelectTo(cur);
6646
+ }
6647
+ break;
6648
+ case `Enter`: {
6649
+ const id = this.tickled.tickledId;
6650
+ if (id) {
6651
+ e.preventDefault();
6652
+ this._dispatch(`list-item-click`, { item: id });
6653
+ this._activateItem(id);
6654
+ }
6655
+ break;
6656
+ }
6657
+ case ` `: {
6658
+ const id = this.tickled.tickledId;
6659
+ if (id) {
6660
+ e.preventDefault();
6661
+ this._handleSpaceKey(id);
6662
+ }
6663
+ break;
6664
+ }
6665
+ case `Escape`:
6666
+ this._clearSelection();
6667
+ break;
6668
+ }
6669
+ };
6670
+ this._onClick = (e) => {
6671
+ const item = this._findListItem(e.composedPath());
6672
+ if (!item) return;
6673
+ this._dispatch(`list-item-click`, { item });
6674
+ this._handleClickSelection(item, e);
6675
+ };
6676
+ this._onDblClick = (e) => {
6677
+ const item = this._findListItem(e.composedPath());
6678
+ if (item) this._activateItem(item);
6679
+ };
6680
+ this._onSearchInput = (e) => {
6681
+ const input = e.target;
6682
+ this._searchQuery = input.value;
6683
+ this.#search?.setQuery(this._searchQuery);
6684
+ };
6685
+ this._onSearchKeydown = (e) => {
6686
+ if (e.key === `Escape`) {
6687
+ e.stopPropagation();
6688
+ this._closeSearch();
6689
+ } else if (e.key === `ArrowDown`) {
6690
+ e.preventDefault();
6691
+ this.tickled.handleKeyboardNavigation(`next`);
6692
+ } else if (e.key === `ArrowUp`) {
6693
+ e.preventDefault();
6694
+ this.tickled.handleKeyboardNavigation(`previous`);
6695
+ } else if (e.key === `Enter`) {
6696
+ e.preventDefault();
6697
+ e.stopPropagation();
6698
+ const id = this.tickled.tickledId ?? this._getVisibleItems()[0];
6699
+ if (id) {
6700
+ this._dispatch(`list-item-click`, { item: id });
6701
+ this._activateItem(id);
6702
+ this._closeSearch();
6703
+ }
6704
+ }
6705
+ };
6706
+ }
6707
+ #search;
6708
+ #selectionAnchor;
6709
+ connectedCallback() {
6710
+ super.connectedCallback();
6711
+ if (!this.hasAttribute(`tabindex`)) this.tabIndex = 0;
6712
+ this.addEventListener(`pointerover`, this._onPointerOver);
6713
+ this.addEventListener(`pointerleave`, this._onPointerLeave);
6714
+ this.addEventListener(`keydown`, this._onKeyDown);
6715
+ this.addEventListener(`click`, this._onClick);
6716
+ this.addEventListener(`dblclick`, this._onDblClick);
6717
+ }
6718
+ disconnectedCallback() {
6719
+ super.disconnectedCallback();
6720
+ this.removeEventListener(`pointerover`, this._onPointerOver);
6721
+ this.removeEventListener(`pointerleave`, this._onPointerLeave);
6722
+ this.removeEventListener(`keydown`, this._onKeyDown);
6723
+ this.removeEventListener(`click`, this._onClick);
6724
+ this.removeEventListener(`dblclick`, this._onDblClick);
6725
+ this.#search?.dispose();
6726
+ this.#search = void 0;
6727
+ }
6728
+ firstUpdated() {
6729
+ this.#search = createElementIncrSearch({
6730
+ container: this,
6731
+ itemSelector: ITEM_SELECTOR,
6732
+ getLabel: (el) => el.getAttribute(`data-search-label`) ?? el.textContent?.trim() ?? ``,
6733
+ getKey: (el) => el.getAttribute(`data-key`) ?? el.getAttribute(`data-search-label`) ?? el.textContent?.trim() ?? ``,
6734
+ highlightKey: `vertical-list-search`
6735
+ });
6736
+ }
6737
+ updated(changed) {
6738
+ super.updated(changed);
6739
+ if (changed.has(`interactionMode`)) {
6740
+ this.#selectionAnchor = void 0;
6741
+ this._clearSelection();
6742
+ }
6743
+ }
6744
+ /** The most recently selected item, or `undefined` if nothing is selected. */
6745
+ get selectedItem() {
6746
+ return [...this._selectedItems].at(-1);
6747
+ }
6748
+ /** The full current selection set (read-only). */
6749
+ get selectedItems() {
6750
+ return this._selectedItems;
6751
+ }
6752
+ addItem(item) {
6753
+ if (typeof item === `string`) {
6754
+ const li = document.createElement(`li`);
6755
+ li.textContent = item;
6756
+ this.appendChild(li);
6757
+ } else this.appendChild(item);
6758
+ if (this.interactionMode === `checked`) this._syncCheckboxes();
6759
+ }
6760
+ removeItem(item) {
6761
+ item.remove();
6762
+ }
6763
+ clearItems() {
6764
+ this.replaceChildren();
6765
+ this.#selectionAnchor = void 0;
6766
+ this._selectedItems = /* @__PURE__ */ new Set();
6767
+ this._syncItemStates();
6768
+ }
6769
+ select(item) {
6770
+ this._replaceSelection(item);
6771
+ }
6772
+ selectMany(items) {
6773
+ if (this.selectionMode !== `multiple`) throw new Error(`selectMany requires selectionMode="multiple" (current: "${this.selectionMode}")`);
6774
+ const previous = this._selectedItems;
6775
+ const next = new Set(items);
6776
+ if (next.size === 0) return;
6777
+ this._selectedItems = next;
6778
+ this.#selectionAnchor = [...next].at(-1);
6779
+ this._syncItemStates();
6780
+ this._dispatch(`list-select`, {
6781
+ selected: next,
6782
+ previous
6783
+ });
6784
+ }
6785
+ deselect(item) {
6786
+ if (!this._selectedItems.has(item)) return;
6787
+ const previous = this._selectedItems;
6788
+ const next = new Set(this._selectedItems);
6789
+ next.delete(item);
6790
+ this._selectedItems = next;
6791
+ this._syncItemStates();
6792
+ this._dispatch(`list-select`, {
6793
+ selected: next,
6794
+ previous
6795
+ });
6796
+ }
6797
+ clearSelection() {
6798
+ this._clearSelection();
6799
+ }
6800
+ selectAll() {
6801
+ if ((this.selectionMode === `multiple` || isMultiMode(this.interactionMode)) && this.selectionMode !== `none`) this._selectAll();
6802
+ }
6803
+ _replaceSelection(item) {
6804
+ if (this.selectionMode === `none`) return;
6805
+ const previous = this._selectedItems;
6806
+ const next = new Set([item]);
6807
+ this._selectedItems = next;
6808
+ this.#selectionAnchor = item;
6809
+ this._syncItemStates();
6810
+ this._dispatch(`list-select`, {
6811
+ selected: next,
6812
+ previous
6813
+ });
6814
+ }
6815
+ _toggleItem(item) {
6816
+ const effectiveMultiple = this.selectionMode === `multiple` || isMultiMode(this.interactionMode);
6817
+ if (this.selectionMode === `none` && this.interactionMode !== `checked`) return;
6818
+ const previous = this._selectedItems;
6819
+ const next = new Set(this._selectedItems);
6820
+ if (next.has(item)) next.delete(item);
6821
+ else {
6822
+ if (!effectiveMultiple) next.clear();
6823
+ next.add(item);
6824
+ }
6825
+ this._selectedItems = next;
6826
+ this._syncItemStates();
6827
+ this._dispatch(`list-select`, {
6828
+ selected: next,
6829
+ previous
6830
+ });
6831
+ }
6832
+ _rangeSelectTo(item) {
6833
+ if (this.selectionMode === `none`) return;
6834
+ if (!this.#selectionAnchor) {
6835
+ this._replaceSelection(item);
6836
+ return;
6837
+ }
6838
+ const visible = this._getVisibleItems();
6839
+ const anchorIdx = visible.indexOf(this.#selectionAnchor);
6840
+ const targetIdx = visible.indexOf(item);
6841
+ if (anchorIdx === -1 || targetIdx === -1) {
6842
+ this._replaceSelection(item);
6843
+ return;
6844
+ }
6845
+ const start = Math.min(anchorIdx, targetIdx);
6846
+ const end = Math.max(anchorIdx, targetIdx);
6847
+ const previous = this._selectedItems;
6848
+ const next = new Set(visible.slice(start, end + 1));
6849
+ this._selectedItems = next;
6850
+ this._syncItemStates();
6851
+ this._dispatch(`list-select`, {
6852
+ selected: next,
6853
+ previous
6854
+ });
6855
+ }
6856
+ _clearSelection() {
6857
+ if (this._selectedItems.size === 0) return;
6858
+ const previous = this._selectedItems;
6859
+ this._selectedItems = /* @__PURE__ */ new Set();
6860
+ this._syncItemStates();
6861
+ this._dispatch(`list-select`, {
6862
+ selected: /* @__PURE__ */ new Set(),
6863
+ previous
6864
+ });
6865
+ }
6866
+ _selectAll() {
6867
+ const visible = this._getVisibleItems();
6868
+ if (visible.length === 0) return;
6869
+ const previous = this._selectedItems;
6870
+ const next = new Set(visible);
6871
+ this._selectedItems = next;
6872
+ this._syncItemStates();
6873
+ this._dispatch(`list-select`, {
6874
+ selected: next,
6875
+ previous
6876
+ });
6877
+ }
6878
+ _handleClickSelection(item, e) {
6879
+ const mode = this.interactionMode;
6880
+ if (mode === `manual`) return;
6881
+ if (this.selectionMode === `none` && mode !== `checked`) return;
6882
+ switch (mode) {
6883
+ case `implicit`:
6884
+ this._replaceSelection(item);
6885
+ break;
6886
+ case `standard`:
6887
+ case `vscode`:
6888
+ if (e.ctrlKey || e.metaKey) {
6889
+ if (this.selectionMode === `multiple` || mode === `vscode`) this._toggleItem(item);
6890
+ } else if (e.shiftKey && (this.selectionMode === `multiple` || mode === `vscode`)) this._rangeSelectTo(item);
6891
+ else this._replaceSelection(item);
6892
+ break;
6893
+ case `checked`: break;
6894
+ }
6895
+ }
6896
+ _handleSpaceKey(item) {
6897
+ const mode = this.interactionMode;
6898
+ if (mode === `manual`) return;
6899
+ if (mode === `implicit`) this._replaceSelection(item);
6900
+ else this._toggleItem(item);
6901
+ }
6902
+ _getVisibleItems() {
6903
+ return Array.from(this.querySelectorAll(ITEM_SELECTOR)).filter((el) => {
6904
+ if (el.hidden) return false;
6905
+ if (this.filterPredicate && !this.filterPredicate(el)) return false;
6906
+ return true;
6907
+ });
6908
+ }
6909
+ _syncItemStates() {
6910
+ for (const el of this.querySelectorAll(ITEM_SELECTOR)) {
6911
+ el.toggleAttribute(`data-tickled`, this.tickled.isTickled(el));
6912
+ el.toggleAttribute(`data-selected`, this._selectedItems.has(el));
6913
+ if (this.interactionMode === `checked`) el.toggleAttribute(`data-checked`, this._selectedItems.has(el));
6914
+ else el.removeAttribute(`data-checked`);
6915
+ }
6916
+ this.dataset.inputMode = this.tickled.inputMode;
6917
+ this._syncCheckboxes();
6918
+ }
6919
+ _syncCheckboxes() {
6920
+ const inCheckedMode = this.interactionMode === `checked`;
6921
+ for (const el of this.querySelectorAll(`li`)) {
6922
+ let cb = el.querySelector(`input.ixfx-list-checkbox`);
6923
+ if (inCheckedMode) {
6924
+ if (!cb) {
6925
+ cb = document.createElement(`input`);
6926
+ cb.type = `checkbox`;
6927
+ cb.className = `ixfx-list-checkbox`;
6928
+ cb.style.cssText = `flex-shrink:0;margin:0 6px 0 0;cursor:pointer;accent-color:var(--accent,#60a5fa);pointer-events:auto`;
6929
+ cb.tabIndex = -1;
6930
+ cb.addEventListener(`click`, (e) => {
6931
+ e.stopPropagation();
6932
+ this._toggleItem(el);
6933
+ });
6934
+ el.prepend(cb);
6935
+ }
6936
+ cb.checked = this._selectedItems.has(el);
6937
+ } else if (cb) cb.remove();
6938
+ }
6939
+ }
6940
+ _findListItem(path) {
6941
+ for (const target of path) {
6942
+ if (!(target instanceof Element)) continue;
6943
+ if (target === this) break;
6944
+ if (target.parentElement === this && target.matches(ITEM_SELECTOR)) return target;
6945
+ }
6946
+ }
6947
+ _dispatch(name, detail) {
6948
+ this.dispatchEvent(new CustomEvent(name, {
6949
+ detail,
6950
+ bubbles: true,
6951
+ composed: true
6952
+ }));
6953
+ }
6954
+ _openSearch() {
6955
+ this._searchVisible = true;
6956
+ this.updateComplete.then(() => this._searchInputEl?.focus());
6957
+ }
6958
+ _closeSearch() {
6959
+ this._searchVisible = false;
6960
+ this._searchQuery = ``;
6961
+ this.#search?.clearQuery();
6962
+ this.focus();
6963
+ }
6964
+ _activateItem(item) {
6965
+ if (this.interactionMode !== `manual`) this._replaceSelection(item);
6966
+ this._dispatch(`list-activate`, { item });
6967
+ }
6968
+ static {
6969
+ this.styles = css`
6970
+ :host {
6971
+ display: block;
6972
+ position: relative;
6973
+ background: var(--list-bg, var(--surface-3));
6974
+ color: var(--list-text, var(--surface-3-text));
6975
+ border-radius: var(--list-radius, var(--radius-s));
6976
+ border: 1px solid var(--list-border, var(--border));
6977
+ width: 100%;
6978
+ height: 100%;
6979
+ overflow: hidden;
6980
+ box-sizing: border-box;
6981
+ outline: none;
6982
+ }
6983
+
6984
+ :host(:focus-visible) {
6985
+ outline: 2px solid var(--accent);
6986
+ outline-offset: 2px;
6987
+ }
6988
+
6989
+ .container {
6990
+ position: relative;
6991
+ width: 100%;
6992
+ height: 100%;
6993
+ }
6994
+
6995
+ ul {
6996
+ list-style: none;
6997
+ margin: 0;
6998
+ padding: 0;
6999
+ width: 100%;
7000
+ height: 100%;
7001
+ overflow-y: auto;
7002
+ box-sizing: border-box;
7003
+ }
7004
+
7005
+ ::slotted([hidden]) {
7006
+ display: none !important;
7007
+ }
7008
+
7009
+ ::slotted(li) {
7010
+ display: flex;
7011
+ align-items: center;
7012
+ padding: var(--list-item-padding, 4px var(--space-m, 8px));
7013
+ min-height: var(--list-item-height, 28px);
7014
+ cursor: pointer;
7015
+ user-select: none;
7016
+ transition: background var(--transition, 0.1s ease-out),
7017
+ outline-color var(--transition, 0.1s ease-out);
7018
+ box-sizing: border-box;
7019
+ outline: 1px solid transparent;
7020
+ }
7021
+
7022
+ /* Custom shadow-DOM components handle their own internal layout/padding */
7023
+ ::slotted([data-list-item]) {
7024
+ display: block;
7025
+ cursor: pointer;
7026
+ user-select: none;
7027
+ transition: background var(--transition, 0.1s ease-out),
7028
+ outline-color var(--transition, 0.1s ease-out);
7029
+ outline: 1px solid transparent;
7030
+ }
7031
+
7032
+ ::slotted([data-tickled]) {
7033
+ background: var(--item-bg-tickled, rgba(0, 0, 0, 0.06));
7034
+ outline: 1px solid var(--accent, #60a5fa);
7035
+ }
7036
+
7037
+ ::slotted([data-selected]) {
7038
+ background: var(--item-bg-selected, rgba(25, 118, 210, 1));
7039
+ color: var(--item-text-selected, #fff);
7040
+ outline: 1px solid transparent;
7041
+ }
7042
+
7043
+ ::slotted([data-selected][data-tickled]) {
7044
+ background: var(--item-bg-selected-tickled, rgba(21, 101, 192, 1));
7045
+ outline: 2px dashed var(--surface-3, #1e1e1e);
7046
+ outline-offset: -2px;
7047
+ }
7048
+
7049
+ /* checked mode: checkbox (injected into li) communicates selection — suppress bg highlight */
7050
+ :host([interaction-mode="checked"]) ::slotted([data-selected]) {
7051
+ background: transparent;
7052
+ color: inherit;
7053
+ outline: 1px solid transparent;
7054
+ }
7055
+
7056
+ :host([interaction-mode="checked"]) ::slotted([data-selected][data-tickled]) {
7057
+ background: var(--item-bg-tickled, rgba(0, 0, 0, 0.06));
7058
+ color: inherit;
7059
+ outline: 1px solid var(--accent, #60a5fa);
7060
+ }
7061
+
7062
+ /* checked mode: left-border indicator for custom shadow-DOM items (no checkbox injection possible) */
7063
+ :host([interaction-mode="checked"]) ::slotted([data-list-item]) {
7064
+ border-left: 3px solid transparent;
7065
+ transition: background var(--transition, 0.1s ease-out),
7066
+ border-color var(--transition, 0.1s ease-out);
7067
+ }
7068
+
7069
+ :host([interaction-mode="checked"]) ::slotted([data-list-item][data-checked]) {
7070
+ border-left: 3px solid var(--accent, #60a5fa);
7071
+ }
7072
+
7073
+ .search-overlay {
7074
+ position: absolute;
7075
+ top: 8px;
7076
+ right: 8px;
7077
+ z-index: 10;
7078
+ display: flex;
7079
+ align-items: center;
7080
+ gap: 4px;
7081
+ background: var(--surface-4, #2a2a2a);
7082
+ border: 1px solid var(--border, #444);
7083
+ border-radius: var(--radius-m, 4px);
7084
+ padding: 4px 6px;
7085
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
7086
+ }
7087
+
7088
+ .search-overlay[hidden] {
7089
+ display: none;
7090
+ }
7091
+
7092
+ .search-input {
7093
+ background: transparent;
7094
+ border: none;
7095
+ outline: none;
7096
+ color: inherit;
7097
+ font-size: var(--text-m, 0.875em);
7098
+ min-width: 140px;
7099
+ }
7100
+
7101
+ .search-close {
7102
+ background: transparent;
7103
+ border: none;
7104
+ color: var(--surface-muted-text, #888);
7105
+ cursor: pointer;
7106
+ font-size: 1.1em;
7107
+ line-height: 1;
7108
+ padding: 0 2px;
7109
+ }
7110
+
7111
+ .search-close:hover {
7112
+ color: inherit;
7113
+ }
7114
+ `;
7115
+ }
7116
+ render() {
7117
+ return html`
7118
+ <div class="container">
7119
+ <ul part="list">
7120
+ <slot></slot>
7121
+ </ul>
7122
+ <div
7123
+ class="search-overlay"
7124
+ part="search-overlay"
7125
+ ?hidden=${!this._searchVisible}
7126
+ >
7127
+ <input
7128
+ type="text"
7129
+ class="search-input"
7130
+ placeholder="Search…"
7131
+ .value=${this._searchQuery}
7132
+ @input=${this._onSearchInput}
7133
+ @keydown=${this._onSearchKeydown}
7134
+ />
7135
+ <button class="search-close" @click=${this._closeSearch} title="Close search (Esc)">×</button>
7136
+ </div>
7137
+ </div>
7138
+ `;
7139
+ }
7140
+ };
7141
+ __decorate([property({
7142
+ type: String,
7143
+ attribute: `selection-mode`
7144
+ })], VerticalListElement.prototype, "selectionMode", void 0);
7145
+ __decorate([property({
7146
+ type: String,
7147
+ attribute: `interaction-mode`
7148
+ })], VerticalListElement.prototype, "interactionMode", void 0);
7149
+ __decorate([property({ attribute: false })], VerticalListElement.prototype, "filterPredicate", void 0);
7150
+ __decorate([state()], VerticalListElement.prototype, "_selectedItems", void 0);
7151
+ __decorate([state()], VerticalListElement.prototype, "_searchVisible", void 0);
7152
+ __decorate([state()], VerticalListElement.prototype, "_searchQuery", void 0);
7153
+ __decorate([query(`.search-input`)], VerticalListElement.prototype, "_searchInputEl", void 0);
7154
+ VerticalListElement = __decorate([safeCustomElement(`ixfx-vertical-list`)], VerticalListElement);
5723
7155
  //#endregion
5724
7156
  //#region src/index.ts
5725
7157
  function init() {
5726
7158
  console.log(`Init`);
5727
7159
  }
5728
7160
  //#endregion
5729
- export { AcTextElement, ButtonElement, Checkbox, ColourPicker, ColourPickerPopup, CrumbNavigationElement, CrumbPathController, CrumbPathElement, DataDisplayComponent, EditableLabel, EditableNumber, ICON_CARET_RIGHT, ICON_CHECK, ICON_CHEVRON_DOWN, ICON_CLOSE, IncrSearchTreeController as IncrSearchMillerController, IncrSearchTreeController, IxfxHexEditorElement, IxfxIconElement, IxfxTimelineElement, LabelledRadialInput, LabelledRangeInput, LedElement, menu_exports as Menu, MillerBaseElement, MillerListElement, MillerTreeController, NarrowedTextElement, PanelElement, PanelGroupElement, PlotDataSeries, PlotSingleAxis, PlotXyAxis, PolarPad, RadialInputElement, RadioGroup, RangeElement, RangeInput, RangeMultiElement, SelectHorizontalElement, SnapContainer, SplitButton, SplitLayoutElement, SwipeElement, TabListElement, TabListItemElement, TabPanelElement, TabPanelsElement, TimelineController, TimelineTrackTabElement, TooltipElement, TreeBaseElement, TreeController, TreeDataModel, TreeListElement, XyPad, applyAgeModification, applyHighlights, attachTimelineInteractions, buildHighlightTargets, clearHighlights, computeColour, createAcCompletionProvider, createElementIncrSearch, createFuzzySearch, createIncrSearch, getIcon, hasIcon, iconBus, init, monitorIndeterminate, parseColourScaleAttr, readBaseColour, registerIcon, resolveCssVars, resolveGrid, svgToDataUri, timelineStyles };
7161
+ export { AcTextElement, AcTokenElement, ButtonElement, Checkbox, ColourPicker, ColourPickerPopup, CrumbNavigationElement, CrumbPathController, CrumbPathElement, DataDisplayComponent, EditableLabel, EditableNumber, ICON_CARET_RIGHT, ICON_CHECK, ICON_CHEVRON_DOWN, ICON_CLOSE, IncrSearchTreeController as IncrSearchMillerController, IncrSearchTreeController, IxfxHexEditorElement, IxfxIconElement, IxfxTimelineElement, LabelledRadialInput, LabelledRangeInput, LedElement, menu_exports as Menu, MillerBaseElement, MillerListElement, MillerTreeController, NarrowedTextElement, PanelElement, PanelGroupElement, PlotDataSeries, PlotSingleAxis, PlotXyAxis, PolarPad, RadialInputElement, RadioGroup, RangeElement, RangeInput, RangeMultiElement, SelectHorizontalElement, SnapContainer, SplitButton, SplitLayoutElement, SwipeElement, TabListElement, TabListItemElement, TabPanelElement, TabPanelsElement, TimelineController, TimelineTrackTabElement, TooltipElement, TransitoryLabelElement, TreeBaseElement, TreeController, TreeDataModel, TreeListElement, VerticalListElement, XyPad, applyAgeModification, applyHighlights, attachTimelineInteractions, buildHighlightTargets, clearHighlights, computeColour, createAcCompletionProvider, createElementIncrSearch, createFuzzySearch, createIncrSearch, getIcon, hasIcon, iconBus, init, monitorIndeterminate, parseColourScaleAttr, readBaseColour, registerIcon, resolveCssVars, resolveGrid, svgToDataUri, timelineStyles };
5730
7162
 
5731
7163
  //# sourceMappingURL=index.js.map