@threadlabs/looma 0.2.5 → 0.2.6

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 (427) hide show
  1. package/dist/chunk-3K45IWIJ.js +4733 -0
  2. package/dist/chunk-MLKGABMK.js +9 -0
  3. package/dist/chunk-UHHA4WT5.js +2916 -0
  4. package/dist/declarative-generated.cjs +135 -0
  5. package/dist/declarative-generated.d.cts +10 -0
  6. package/dist/declarative-generated.d.ts +10 -0
  7. package/dist/declarative-generated.js +111 -0
  8. package/dist/declarative.cjs +2944 -0
  9. package/dist/declarative.d.cts +27 -0
  10. package/dist/declarative.d.ts +27 -0
  11. package/dist/declarative.js +13 -0
  12. package/dist/index.cjs +7480 -6457
  13. package/dist/index.d.cts +4 -58
  14. package/dist/index.d.ts +4 -58
  15. package/dist/index.js +15 -27
  16. package/dist/loader.cjs +7654 -0
  17. package/dist/loader.d.cts +4 -0
  18. package/dist/loader.d.ts +4 -0
  19. package/dist/loader.js +16 -0
  20. package/dist/valibot.cjs +31 -0
  21. package/dist/valibot.d.cts +10 -0
  22. package/dist/valibot.d.ts +1 -43
  23. package/dist/valibot.js +2 -0
  24. package/dist/{types/field/validation.d.ts → validation-bxcou-l-.d.cts} +13 -11
  25. package/dist/validation-bxcou-l-.d.ts +58 -0
  26. package/editor/{chunk-B5WVJOPV.js → chunk-BXICJBWS.js} +118 -8
  27. package/editor/{chunk-ZOUKEZ77.js → chunk-JK53ENSG.js} +8 -21
  28. package/editor/chunk-WI7ZA44X.js +2558 -0
  29. package/editor/extensions/index.d.ts +11 -2
  30. package/editor/extensions/index.js +9 -7
  31. package/editor/index.d.ts +1 -1
  32. package/editor/index.js +10 -8
  33. package/editor/ui.js +2 -2
  34. package/editor.css +32 -0
  35. package/layout/index.cjs +466 -400
  36. package/layout/index.d.cts +1 -2
  37. package/layout/index.d.ts +1 -2
  38. package/layout/index.js +471 -395
  39. package/package.json +14 -5
  40. package/vue/chunk-4DPYH3IT.js +3538 -0
  41. package/vue/editor/index.d.ts +17 -7
  42. package/vue/editor/index.js +53 -35
  43. package/vue/index.d.ts +48 -31
  44. package/vue/index.js +1 -1
  45. package/dist/chunk-24OTMNIU.js +0 -1617
  46. package/dist/chunk-D5WRORG6.js +0 -366
  47. package/dist/chunk-HNFCGIBP.js +0 -8
  48. package/dist/chunk-NB6DBRXQ.js +0 -323
  49. package/dist/chunk-OF57X5AR.js +0 -10
  50. package/dist/chunk-TL4FIE7X.js +0 -93
  51. package/dist/chunk-UL7UIUJZ.js +0 -20
  52. package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -5
  53. package/dist/cjs/controlled-state-BFya8rAX.js +0 -9
  54. package/dist/cjs/events-TcQIzpNv.js +0 -19
  55. package/dist/cjs/icons-BAdjrnhS.js +0 -680
  56. package/dist/cjs/id-CYbKpaYr.js +0 -9
  57. package/dist/cjs/index-BHG9Rpil.js +0 -1602
  58. package/dist/cjs/index.cjs.js +0 -2
  59. package/dist/cjs/loader.cjs.js +0 -13
  60. package/dist/cjs/looma.cjs.js +0 -25
  61. package/dist/cjs/manager-Ce25WRtl.js +0 -95
  62. package/dist/cjs/positioning-CCR6ifPj.js +0 -426
  63. package/dist/cjs/ui-affordance-scope.cjs.entry.js +0 -43
  64. package/dist/cjs/ui-avatar-group.cjs.entry.js +0 -43
  65. package/dist/cjs/ui-avatar.cjs.entry.js +0 -50
  66. package/dist/cjs/ui-badge.cjs.entry.js +0 -19
  67. package/dist/cjs/ui-button.cjs.entry.js +0 -75
  68. package/dist/cjs/ui-callout.cjs.entry.js +0 -27
  69. package/dist/cjs/ui-checkbox.cjs.entry.js +0 -97
  70. package/dist/cjs/ui-chip_2.cjs.entry.js +0 -258
  71. package/dist/cjs/ui-combobox.cjs.entry.js +0 -708
  72. package/dist/cjs/ui-context-menu.cjs.entry.js +0 -239
  73. package/dist/cjs/ui-dialog.cjs.entry.js +0 -131
  74. package/dist/cjs/ui-disclosure.cjs.entry.js +0 -112
  75. package/dist/cjs/ui-editable.cjs.entry.js +0 -100
  76. package/dist/cjs/ui-floating-action-button.cjs.entry.js +0 -20
  77. package/dist/cjs/ui-form-field.cjs.entry.js +0 -114
  78. package/dist/cjs/ui-icon-button.cjs.entry.js +0 -23
  79. package/dist/cjs/ui-input.cjs.entry.js +0 -106
  80. package/dist/cjs/ui-menu-item.cjs.entry.js +0 -19
  81. package/dist/cjs/ui-menu.cjs.entry.js +0 -182
  82. package/dist/cjs/ui-popover.cjs.entry.js +0 -135
  83. package/dist/cjs/ui-radio-group.cjs.entry.js +0 -134
  84. package/dist/cjs/ui-radio.cjs.entry.js +0 -94
  85. package/dist/cjs/ui-search-result-row.cjs.entry.js +0 -47
  86. package/dist/cjs/ui-search-shell.cjs.entry.js +0 -39
  87. package/dist/cjs/ui-select.cjs.entry.js +0 -108
  88. package/dist/cjs/ui-switch.cjs.entry.js +0 -74
  89. package/dist/cjs/ui-tabs.cjs.entry.js +0 -118
  90. package/dist/cjs/ui-textarea.cjs.entry.js +0 -110
  91. package/dist/cjs/ui-toast-region.cjs.entry.js +0 -93
  92. package/dist/cjs/ui-top-bar.cjs.entry.js +0 -43
  93. package/dist/cjs/ui-tree-item.cjs.entry.js +0 -135
  94. package/dist/cjs/ui-tree.cjs.entry.js +0 -500
  95. package/dist/collection/collection-manifest.json +0 -45
  96. package/dist/collection/components/ui-affordance-scope/ui-affordance-scope.css +0 -8
  97. package/dist/collection/components/ui-affordance-scope/ui-affordance-scope.js +0 -70
  98. package/dist/collection/components/ui-avatar/ui-avatar.css +0 -35
  99. package/dist/collection/components/ui-avatar/ui-avatar.js +0 -130
  100. package/dist/collection/components/ui-avatar-group/ui-avatar-group.css +0 -32
  101. package/dist/collection/components/ui-avatar-group/ui-avatar-group.js +0 -95
  102. package/dist/collection/components/ui-badge/ui-badge.css +0 -90
  103. package/dist/collection/components/ui-badge/ui-badge.js +0 -62
  104. package/dist/collection/components/ui-button/ui-button.css +0 -121
  105. package/dist/collection/components/ui-button/ui-button.js +0 -141
  106. package/dist/collection/components/ui-callout/ui-callout.css +0 -74
  107. package/dist/collection/components/ui-callout/ui-callout.js +0 -59
  108. package/dist/collection/components/ui-checkbox/ui-checkbox.css +0 -24
  109. package/dist/collection/components/ui-checkbox/ui-checkbox.js +0 -228
  110. package/dist/collection/components/ui-chip/ui-chip.css +0 -57
  111. package/dist/collection/components/ui-chip/ui-chip.js +0 -67
  112. package/dist/collection/components/ui-combobox/ui-combobox.css +0 -47
  113. package/dist/collection/components/ui-combobox/ui-combobox.js +0 -1295
  114. package/dist/collection/components/ui-context-menu/ui-context-menu.css +0 -34
  115. package/dist/collection/components/ui-context-menu/ui-context-menu.js +0 -311
  116. package/dist/collection/components/ui-dialog/ui-dialog.css +0 -72
  117. package/dist/collection/components/ui-dialog/ui-dialog.js +0 -242
  118. package/dist/collection/components/ui-disclosure/ui-disclosure.css +0 -7
  119. package/dist/collection/components/ui-disclosure/ui-disclosure.js +0 -184
  120. package/dist/collection/components/ui-editable/ui-editable.css +0 -2
  121. package/dist/collection/components/ui-editable/ui-editable.js +0 -196
  122. package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.css +0 -73
  123. package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.js +0 -85
  124. package/dist/collection/components/ui-form-field/ui-form-field.css +0 -25
  125. package/dist/collection/components/ui-form-field/ui-form-field.js +0 -180
  126. package/dist/collection/components/ui-icon-button/ui-icon-button.css +0 -145
  127. package/dist/collection/components/ui-icon-button/ui-icon-button.js +0 -128
  128. package/dist/collection/components/ui-input/ui-input.css +0 -48
  129. package/dist/collection/components/ui-input/ui-input.js +0 -217
  130. package/dist/collection/components/ui-menu/ui-menu.css +0 -73
  131. package/dist/collection/components/ui-menu/ui-menu.js +0 -280
  132. package/dist/collection/components/ui-menu-item/ui-menu-item.css +0 -32
  133. package/dist/collection/components/ui-menu-item/ui-menu-item.js +0 -64
  134. package/dist/collection/components/ui-popover/ui-popover.css +0 -58
  135. package/dist/collection/components/ui-popover/ui-popover.js +0 -232
  136. package/dist/collection/components/ui-radio/ui-radio.css +0 -22
  137. package/dist/collection/components/ui-radio/ui-radio.js +0 -226
  138. package/dist/collection/components/ui-radio-group/ui-radio-group.css +0 -10
  139. package/dist/collection/components/ui-radio-group/ui-radio-group.js +0 -247
  140. package/dist/collection/components/ui-search-result-row/ui-search-result-row.css +0 -80
  141. package/dist/collection/components/ui-search-result-row/ui-search-result-row.js +0 -100
  142. package/dist/collection/components/ui-search-shell/ui-search-shell.css +0 -63
  143. package/dist/collection/components/ui-search-shell/ui-search-shell.js +0 -46
  144. package/dist/collection/components/ui-select/ui-select.css +0 -64
  145. package/dist/collection/components/ui-select/ui-select.js +0 -218
  146. package/dist/collection/components/ui-switch/ui-switch.css +0 -63
  147. package/dist/collection/components/ui-switch/ui-switch.js +0 -185
  148. package/dist/collection/components/ui-tabs/ui-tabs.css +0 -68
  149. package/dist/collection/components/ui-tabs/ui-tabs.js +0 -190
  150. package/dist/collection/components/ui-textarea/ui-textarea.css +0 -49
  151. package/dist/collection/components/ui-textarea/ui-textarea.js +0 -241
  152. package/dist/collection/components/ui-toast-region/ui-toast-region.css +0 -59
  153. package/dist/collection/components/ui-toast-region/ui-toast-region.js +0 -126
  154. package/dist/collection/components/ui-tooltip/ui-tooltip.css +0 -43
  155. package/dist/collection/components/ui-tooltip/ui-tooltip.js +0 -430
  156. package/dist/collection/components/ui-top-bar/ui-top-bar.css +0 -51
  157. package/dist/collection/components/ui-top-bar/ui-top-bar.js +0 -52
  158. package/dist/collection/components/ui-tree/ui-tree.css +0 -12
  159. package/dist/collection/components/ui-tree/ui-tree.js +0 -515
  160. package/dist/collection/components/ui-tree-item/ui-tree-item.css +0 -217
  161. package/dist/collection/components/ui-tree-item/ui-tree-item.js +0 -406
  162. package/dist/collection/field/combobox.js +0 -4
  163. package/dist/collection/field/editable.js +0 -1
  164. package/dist/collection/field/multi-combobox.js +0 -1
  165. package/dist/collection/field/valibot.js +0 -5
  166. package/dist/collection/field/validation.js +0 -62
  167. package/dist/collection/icons.js +0 -71
  168. package/dist/collection/input-modality.js +0 -24
  169. package/dist/collection/overlay/manager.js +0 -92
  170. package/dist/collection/overlay/positioning.js +0 -424
  171. package/dist/collection/utils/controlled-state.js +0 -4
  172. package/dist/collection/utils/drag-drop.js +0 -51
  173. package/dist/collection/utils/events.js +0 -13
  174. package/dist/collection/utils/id.js +0 -5
  175. package/dist/collection/utils/initials.js +0 -11
  176. package/dist/components/index.d.ts +0 -102
  177. package/dist/components/index.js +0 -1
  178. package/dist/components/p-6SWSrfmW.js +0 -1
  179. package/dist/components/p-B_DaIVEY.js +0 -1
  180. package/dist/components/p-Bh_1GxOD.js +0 -1
  181. package/dist/components/p-BnGhGgTH.js +0 -1
  182. package/dist/components/p-BzaB_bXo.js +0 -1
  183. package/dist/components/p-C-0syqXZ.js +0 -1
  184. package/dist/components/p-CoFximGM.js +0 -13
  185. package/dist/components/p-JwSoedEO.js +0 -1
  186. package/dist/components/p-Vc4ExHFc.js +0 -1
  187. package/dist/components/p-hgBUJRDa.js +0 -1
  188. package/dist/components/ui-affordance-scope.d.ts +0 -11
  189. package/dist/components/ui-affordance-scope.js +0 -1
  190. package/dist/components/ui-avatar-group.d.ts +0 -11
  191. package/dist/components/ui-avatar-group.js +0 -1
  192. package/dist/components/ui-avatar.d.ts +0 -11
  193. package/dist/components/ui-avatar.js +0 -1
  194. package/dist/components/ui-badge.d.ts +0 -11
  195. package/dist/components/ui-badge.js +0 -1
  196. package/dist/components/ui-button.d.ts +0 -11
  197. package/dist/components/ui-button.js +0 -1
  198. package/dist/components/ui-callout.d.ts +0 -11
  199. package/dist/components/ui-callout.js +0 -1
  200. package/dist/components/ui-checkbox.d.ts +0 -11
  201. package/dist/components/ui-checkbox.js +0 -1
  202. package/dist/components/ui-chip.d.ts +0 -11
  203. package/dist/components/ui-chip.js +0 -1
  204. package/dist/components/ui-combobox.d.ts +0 -11
  205. package/dist/components/ui-combobox.js +0 -1
  206. package/dist/components/ui-context-menu.d.ts +0 -11
  207. package/dist/components/ui-context-menu.js +0 -1
  208. package/dist/components/ui-dialog.d.ts +0 -11
  209. package/dist/components/ui-dialog.js +0 -1
  210. package/dist/components/ui-disclosure.d.ts +0 -11
  211. package/dist/components/ui-disclosure.js +0 -1
  212. package/dist/components/ui-editable.d.ts +0 -11
  213. package/dist/components/ui-editable.js +0 -1
  214. package/dist/components/ui-floating-action-button.d.ts +0 -11
  215. package/dist/components/ui-floating-action-button.js +0 -1
  216. package/dist/components/ui-form-field.d.ts +0 -11
  217. package/dist/components/ui-form-field.js +0 -1
  218. package/dist/components/ui-icon-button.d.ts +0 -11
  219. package/dist/components/ui-icon-button.js +0 -1
  220. package/dist/components/ui-input.d.ts +0 -11
  221. package/dist/components/ui-input.js +0 -1
  222. package/dist/components/ui-menu-item.d.ts +0 -11
  223. package/dist/components/ui-menu-item.js +0 -1
  224. package/dist/components/ui-menu.d.ts +0 -11
  225. package/dist/components/ui-menu.js +0 -1
  226. package/dist/components/ui-popover.d.ts +0 -11
  227. package/dist/components/ui-popover.js +0 -1
  228. package/dist/components/ui-radio-group.d.ts +0 -11
  229. package/dist/components/ui-radio-group.js +0 -1
  230. package/dist/components/ui-radio.d.ts +0 -11
  231. package/dist/components/ui-radio.js +0 -1
  232. package/dist/components/ui-search-result-row.d.ts +0 -11
  233. package/dist/components/ui-search-result-row.js +0 -1
  234. package/dist/components/ui-search-shell.d.ts +0 -11
  235. package/dist/components/ui-search-shell.js +0 -1
  236. package/dist/components/ui-select.d.ts +0 -11
  237. package/dist/components/ui-select.js +0 -1
  238. package/dist/components/ui-switch.d.ts +0 -11
  239. package/dist/components/ui-switch.js +0 -1
  240. package/dist/components/ui-tabs.d.ts +0 -11
  241. package/dist/components/ui-tabs.js +0 -1
  242. package/dist/components/ui-textarea.d.ts +0 -11
  243. package/dist/components/ui-textarea.js +0 -1
  244. package/dist/components/ui-toast-region.d.ts +0 -11
  245. package/dist/components/ui-toast-region.js +0 -1
  246. package/dist/components/ui-tooltip.d.ts +0 -11
  247. package/dist/components/ui-tooltip.js +0 -1
  248. package/dist/components/ui-top-bar.d.ts +0 -11
  249. package/dist/components/ui-top-bar.js +0 -1
  250. package/dist/components/ui-tree-item.d.ts +0 -11
  251. package/dist/components/ui-tree-item.js +0 -1
  252. package/dist/components/ui-tree.d.ts +0 -11
  253. package/dist/components/ui-tree.js +0 -1
  254. package/dist/esm/app-globals-DQuL1Twl.js +0 -3
  255. package/dist/esm/controlled-state-BnGhGgTH.js +0 -6
  256. package/dist/esm/events-JwSoedEO.js +0 -15
  257. package/dist/esm/icons-CoFximGM.js +0 -678
  258. package/dist/esm/id-hgBUJRDa.js +0 -7
  259. package/dist/esm/index-8BGiMGQ0.js +0 -1593
  260. package/dist/esm/index.js +0 -1
  261. package/dist/esm/loader.js +0 -11
  262. package/dist/esm/looma.js +0 -21
  263. package/dist/esm/manager-C-0syqXZ.js +0 -91
  264. package/dist/esm/positioning-ZOr-2PSe.js +0 -421
  265. package/dist/esm/ui-affordance-scope.entry.js +0 -41
  266. package/dist/esm/ui-avatar-group.entry.js +0 -41
  267. package/dist/esm/ui-avatar.entry.js +0 -48
  268. package/dist/esm/ui-badge.entry.js +0 -17
  269. package/dist/esm/ui-button.entry.js +0 -73
  270. package/dist/esm/ui-callout.entry.js +0 -25
  271. package/dist/esm/ui-checkbox.entry.js +0 -95
  272. package/dist/esm/ui-chip_2.entry.js +0 -255
  273. package/dist/esm/ui-combobox.entry.js +0 -706
  274. package/dist/esm/ui-context-menu.entry.js +0 -237
  275. package/dist/esm/ui-dialog.entry.js +0 -129
  276. package/dist/esm/ui-disclosure.entry.js +0 -110
  277. package/dist/esm/ui-editable.entry.js +0 -98
  278. package/dist/esm/ui-floating-action-button.entry.js +0 -18
  279. package/dist/esm/ui-form-field.entry.js +0 -112
  280. package/dist/esm/ui-icon-button.entry.js +0 -21
  281. package/dist/esm/ui-input.entry.js +0 -104
  282. package/dist/esm/ui-menu-item.entry.js +0 -17
  283. package/dist/esm/ui-menu.entry.js +0 -180
  284. package/dist/esm/ui-popover.entry.js +0 -133
  285. package/dist/esm/ui-radio-group.entry.js +0 -132
  286. package/dist/esm/ui-radio.entry.js +0 -92
  287. package/dist/esm/ui-search-result-row.entry.js +0 -45
  288. package/dist/esm/ui-search-shell.entry.js +0 -37
  289. package/dist/esm/ui-select.entry.js +0 -106
  290. package/dist/esm/ui-switch.entry.js +0 -72
  291. package/dist/esm/ui-tabs.entry.js +0 -116
  292. package/dist/esm/ui-textarea.entry.js +0 -108
  293. package/dist/esm/ui-toast-region.entry.js +0 -91
  294. package/dist/esm/ui-top-bar.entry.js +0 -41
  295. package/dist/esm/ui-tree-item.entry.js +0 -133
  296. package/dist/esm/ui-tree.entry.js +0 -498
  297. package/dist/index.cjs.js +0 -1
  298. package/dist/looma/index.esm.js +0 -0
  299. package/dist/looma/looma.esm.js +0 -1
  300. package/dist/looma/p-08f80207.entry.js +0 -1
  301. package/dist/looma/p-0b5b8d9e.entry.js +0 -1
  302. package/dist/looma/p-1249a806.entry.js +0 -1
  303. package/dist/looma/p-16e0669d.entry.js +0 -1
  304. package/dist/looma/p-1c00670f.entry.js +0 -1
  305. package/dist/looma/p-1c5a7522.entry.js +0 -1
  306. package/dist/looma/p-22842f8c.entry.js +0 -1
  307. package/dist/looma/p-2915d5c0.entry.js +0 -1
  308. package/dist/looma/p-3b2961a6.entry.js +0 -1
  309. package/dist/looma/p-3f60f4c8.entry.js +0 -1
  310. package/dist/looma/p-424d6719.entry.js +0 -1
  311. package/dist/looma/p-4caccfce.entry.js +0 -1
  312. package/dist/looma/p-5fdcee1d.entry.js +0 -1
  313. package/dist/looma/p-6d8b99ee.entry.js +0 -1
  314. package/dist/looma/p-6f20d470.entry.js +0 -1
  315. package/dist/looma/p-7c0b5364.entry.js +0 -1
  316. package/dist/looma/p-8BGiMGQ0.js +0 -2
  317. package/dist/looma/p-8bdd9495.entry.js +0 -1
  318. package/dist/looma/p-99116a72.entry.js +0 -1
  319. package/dist/looma/p-9cfbf722.entry.js +0 -1
  320. package/dist/looma/p-9d2662ca.entry.js +0 -1
  321. package/dist/looma/p-9ff2fa19.entry.js +0 -1
  322. package/dist/looma/p-BnGhGgTH.js +0 -1
  323. package/dist/looma/p-C-0syqXZ.js +0 -1
  324. package/dist/looma/p-CoFximGM.js +0 -13
  325. package/dist/looma/p-DQuL1Twl.js +0 -1
  326. package/dist/looma/p-JwSoedEO.js +0 -1
  327. package/dist/looma/p-ZOr-2PSe.js +0 -1
  328. package/dist/looma/p-a2dd4c6c.entry.js +0 -1
  329. package/dist/looma/p-add67e4c.entry.js +0 -1
  330. package/dist/looma/p-b6ede6bb.entry.js +0 -1
  331. package/dist/looma/p-b76e2111.entry.js +0 -1
  332. package/dist/looma/p-ca2a54fd.entry.js +0 -1
  333. package/dist/looma/p-d372b0db.entry.js +0 -1
  334. package/dist/looma/p-d4825822.entry.js +0 -1
  335. package/dist/looma/p-d56571a2.entry.js +0 -1
  336. package/dist/looma/p-d5c3954f.entry.js +0 -1
  337. package/dist/looma/p-e604e906.entry.js +0 -1
  338. package/dist/looma/p-f1f7c5cb.entry.js +0 -1
  339. package/dist/looma/p-hgBUJRDa.js +0 -1
  340. package/dist/types/components/ui-affordance-scope/ui-affordance-scope.d.ts +0 -11
  341. package/dist/types/components/ui-avatar/ui-avatar.d.ts +0 -11
  342. package/dist/types/components/ui-avatar-group/ui-avatar-group.d.ts +0 -11
  343. package/dist/types/components/ui-badge/ui-badge.d.ts +0 -5
  344. package/dist/types/components/ui-button/ui-button.d.ts +0 -13
  345. package/dist/types/components/ui-callout/ui-callout.d.ts +0 -6
  346. package/dist/types/components/ui-checkbox/ui-checkbox.d.ts +0 -20
  347. package/dist/types/components/ui-chip/ui-chip.d.ts +0 -8
  348. package/dist/types/components/ui-combobox/ui-combobox.d.ts +0 -128
  349. package/dist/types/components/ui-context-menu/ui-context-menu.d.ts +0 -43
  350. package/dist/types/components/ui-dialog/ui-dialog.d.ts +0 -27
  351. package/dist/types/components/ui-disclosure/ui-disclosure.d.ts +0 -21
  352. package/dist/types/components/ui-editable/ui-editable.d.ts +0 -24
  353. package/dist/types/components/ui-floating-action-button/ui-floating-action-button.d.ts +0 -6
  354. package/dist/types/components/ui-form-field/ui-form-field.d.ts +0 -18
  355. package/dist/types/components/ui-icon-button/ui-icon-button.d.ts +0 -9
  356. package/dist/types/components/ui-input/ui-input.d.ts +0 -19
  357. package/dist/types/components/ui-menu/ui-menu.d.ts +0 -28
  358. package/dist/types/components/ui-menu-item/ui-menu-item.d.ts +0 -5
  359. package/dist/types/components/ui-popover/ui-popover.d.ts +0 -26
  360. package/dist/types/components/ui-radio/ui-radio.d.ts +0 -20
  361. package/dist/types/components/ui-radio-group/ui-radio-group.d.ts +0 -21
  362. package/dist/types/components/ui-search-result-row/ui-search-result-row.d.ts +0 -15
  363. package/dist/types/components/ui-search-shell/ui-search-shell.d.ts +0 -9
  364. package/dist/types/components/ui-select/ui-select.d.ts +0 -20
  365. package/dist/types/components/ui-switch/ui-switch.d.ts +0 -16
  366. package/dist/types/components/ui-tabs/ui-tabs.d.ts +0 -18
  367. package/dist/types/components/ui-textarea/ui-textarea.d.ts +0 -20
  368. package/dist/types/components/ui-toast-region/ui-toast-region.d.ts +0 -16
  369. package/dist/types/components/ui-tooltip/ui-tooltip.d.ts +0 -57
  370. package/dist/types/components/ui-top-bar/ui-top-bar.d.ts +0 -12
  371. package/dist/types/components/ui-tree/ui-tree.d.ts +0 -53
  372. package/dist/types/components/ui-tree-item/ui-tree-item.d.ts +0 -44
  373. package/dist/types/components.d.ts +0 -1889
  374. package/dist/types/field/combobox.d.ts +0 -46
  375. package/dist/types/field/editable.d.ts +0 -5
  376. package/dist/types/field/multi-combobox.d.ts +0 -11
  377. package/dist/types/field/valibot.d.ts +0 -7
  378. package/dist/types/icons.d.ts +0 -53
  379. package/dist/types/input-modality.d.ts +0 -6
  380. package/dist/types/overlay/manager.d.ts +0 -17
  381. package/dist/types/overlay/positioning.d.ts +0 -74
  382. package/dist/types/stencil-public-runtime.d.ts +0 -1860
  383. package/dist/types/utils/controlled-state.d.ts +0 -4
  384. package/dist/types/utils/drag-drop.d.ts +0 -15
  385. package/dist/types/utils/events.d.ts +0 -4
  386. package/dist/types/utils/id.d.ts +0 -1
  387. package/dist/types/utils/initials.d.ts +0 -1
  388. package/dist/ui-affordance-scope.entry-L6TIXYOP.js +0 -54
  389. package/dist/ui-avatar-group.entry-TCAA6P72.js +0 -51
  390. package/dist/ui-avatar.entry-52DQ7VXA.js +0 -51
  391. package/dist/ui-badge.entry-2XCAA6LL.js +0 -22
  392. package/dist/ui-button.entry-MNFBMNSX.js +0 -83
  393. package/dist/ui-callout.entry-SSHT5TH2.js +0 -32
  394. package/dist/ui-checkbox.entry-LOWIWIWI.js +0 -111
  395. package/dist/ui-chip_2.entry-BIMTSF6C.js +0 -272
  396. package/dist/ui-combobox.entry-25Z4MN7N.js +0 -717
  397. package/dist/ui-context-menu.entry-YZDL5Y4M.js +0 -248
  398. package/dist/ui-dialog.entry-HIXZX5AB.js +0 -146
  399. package/dist/ui-disclosure.entry-2JZHZNDQ.js +0 -126
  400. package/dist/ui-editable.entry-U3VR3XPT.js +0 -110
  401. package/dist/ui-floating-action-button.entry-6S3QN3KJ.js +0 -23
  402. package/dist/ui-form-field.entry-GQOSMLHT.js +0 -120
  403. package/dist/ui-icon-button.entry-QJXKVDM6.js +0 -26
  404. package/dist/ui-input.entry-UWMQ6JMP.js +0 -114
  405. package/dist/ui-menu-item.entry-NHNZKKJS.js +0 -22
  406. package/dist/ui-menu.entry-D53RUJND.js +0 -192
  407. package/dist/ui-popover.entry-7ZSIWCFQ.js +0 -152
  408. package/dist/ui-radio-group.entry-37MSYIH4.js +0 -142
  409. package/dist/ui-radio.entry-7YGCDHXT.js +0 -108
  410. package/dist/ui-search-result-row.entry-6FCCLGAS.js +0 -50
  411. package/dist/ui-search-shell.entry-HSBEXPER.js +0 -41
  412. package/dist/ui-select.entry-GIDIAYRD.js +0 -117
  413. package/dist/ui-switch.entry-MYAL6XPC.js +0 -87
  414. package/dist/ui-tabs.entry-R4TEXQSD.js +0 -128
  415. package/dist/ui-textarea.entry-FW32JNDV.js +0 -119
  416. package/dist/ui-toast-region.entry-BTMFPKZF.js +0 -104
  417. package/dist/ui-top-bar.entry-5DQGJF3B.js +0 -49
  418. package/dist/ui-tree-item.entry-ADT7DSOS.js +0 -145
  419. package/dist/ui-tree.entry-7PYQ5RIN.js +0 -470
  420. package/editor/chunk-64GLF274.js +0 -1271
  421. package/layout/index.css +0 -387
  422. package/loader/cdn.js +0 -1
  423. package/loader/index.cjs.js +0 -1
  424. package/loader/index.d.ts +0 -24
  425. package/loader/index.es2017.js +0 -1
  426. package/loader/index.js +0 -2
  427. package/vue/chunk-ROMBQS2L.js +0 -352
@@ -1,717 +0,0 @@
1
- import {
2
- closeOverlay,
3
- openOverlay
4
- } from "./chunk-TL4FIE7X.js";
5
- import {
6
- createAnchoredSurface
7
- } from "./chunk-D5WRORG6.js";
8
- import {
9
- Host,
10
- createEvent,
11
- getElement,
12
- h,
13
- registerInstance
14
- } from "./chunk-24OTMNIU.js";
15
-
16
- // dist/esm/ui-combobox.entry.js
17
- function formatEditingValue(raw, selection, format) {
18
- const unchanged = { display: raw, selection };
19
- if (!format)
20
- return unchanged;
21
- let result;
22
- try {
23
- result = format(raw, selection);
24
- } catch {
25
- return unchanged;
26
- }
27
- if (!result)
28
- return unchanged;
29
- const characters = Array.from(raw);
30
- let cursor = 0;
31
- for (const character of result.display)
32
- if (character === characters[cursor])
33
- cursor += 1;
34
- if (!Number.isInteger(result.selection.start) || !Number.isInteger(result.selection.end) || cursor !== characters.length || result.selection.start < 0 || result.selection.end < result.selection.start || result.selection.end > result.display.length)
35
- return unchanged;
36
- return result;
37
- }
38
- async function validateField(request, config) {
39
- let output = request.raw;
40
- let issues = [];
41
- const check = () => request.signal.throwIfAborted();
42
- try {
43
- check();
44
- if (config.parse)
45
- output = await config.parse(request.raw, request);
46
- check();
47
- if (config.schema) {
48
- const result = await config.schema["~standard"].validate(output);
49
- check();
50
- if (result.issues)
51
- issues = result.issues;
52
- else if ("value" in result)
53
- output = result.value;
54
- }
55
- if (!issues.some((issue) => issue.severity !== "warning")) {
56
- if (config.normalize)
57
- output = await config.normalize(output, request);
58
- check();
59
- if (config.validator) {
60
- const result = await config.validator(output, request);
61
- check();
62
- issues = [...issues, ...result.issues ?? []];
63
- if ("output" in result)
64
- output = result.output;
65
- }
66
- }
67
- } catch (error) {
68
- check();
69
- issues = [{ message: error instanceof Error ? error.message : "Unable to validate this value." }];
70
- }
71
- issues = [...issues, ...config.issues ?? []];
72
- return { output: issues.some((issue) => issue.severity !== "warning") ? void 0 : output, issues };
73
- }
74
- var uiComboboxCss = () => `:host{display:grid;gap:var(--ui-space-1);min-inline-size:0;color:var(--ui-text-primary);font:inherit}label{color:var(--ui-field-label-color, var(--ui-text-primary));font-size:var(--ui-field-label-size, 0.875rem);font-weight:var(--ui-field-label-weight, 500)}.field{display:flex;min-inline-size:0;border:1px solid var(--ui-control-border, var(--ui-border-default));border-radius:var(--ui-radius-2);background:var(--ui-control-surface, var(--ui-surface-default))}.field:focus-within{border-color:var(--ui-control-focus, var(--ui-focus-ring));outline:2px solid var(--ui-control-focus, var(--ui-focus-ring));outline-offset:1px}input{appearance:none;width:100%;min-inline-size:0;min-block-size:var(--ui-control-min-block-size, 2.75rem);box-sizing:border-box;border:0;border-radius:inherit;background:transparent;color:inherit;font:inherit;line-height:var(--ui-line-height-md);padding:var(--ui-space-2) var(--ui-space-3);margin:0;outline:none}:host([data-size='sm']) input{min-block-size:var(--ui-field-compact-size, 2rem);padding:var(--ui-space-1) var(--ui-space-2)}button{appearance:none;border:0;border-radius:var(--ui-radius-2);background:transparent;color:var(--ui-field-affordance-color, var(--ui-text-secondary));font:inherit;font-weight:var(--ui-field-affordance-weight, 400);min-inline-size:2rem;padding:var(--ui-space-1);cursor:pointer}button:hover:enabled{background:var(--ui-surface-muted);color:var(--ui-text-primary)}button:focus-visible{outline:2px solid var(--ui-focus-ring);outline-offset:-3px}input:disabled,button:disabled{color:var(--ui-text-muted);cursor:not-allowed}.field:has(input:disabled){background:var(--ui-control-surface-disabled, var(--ui-surface-muted))}:host([data-validation='error']) .field{border-color:var(--ui-danger-solid, var(--ui-accent-active))}.popup{box-sizing:border-box;min-inline-size:12rem;max-inline-size:calc(100vw - 1rem);max-block-size:var(--ui-combobox-max-block-size, 18rem);overflow:auto;margin:0;padding:var(--ui-space-1);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-2);background:var(--ui-surface-elevated);color:var(--ui-text-primary);box-shadow:var(--ui-shadow-md)}[hidden]{display:none !important}.option{padding:var(--ui-space-2) var(--ui-space-3);border-radius:var(--ui-radius-1);cursor:pointer;overflow-wrap:anywhere}.option:hover,.option[data-active]{background:var(--ui-surface-muted);outline:1px solid var(--ui-focus-ring);outline-offset:-1px}.option[aria-disabled='true']{color:var(--ui-text-muted);cursor:not-allowed}.primary{display:block;color:var(--ui-option-primary-color, var(--ui-text-primary));font-weight:var(--ui-option-primary-weight, 500)}.secondary{display:block;color:var(--ui-option-secondary-color, var(--ui-text-secondary));font-weight:var(--ui-option-secondary-weight, 400);font-size:var(--ui-font-size-sm)}.message,.group{color:var(--ui-field-message-color, var(--ui-text-secondary));font-weight:var(--ui-field-message-weight, 400);font-size:var(--ui-font-size-sm);line-height:var(--ui-line-height-md);overflow-wrap:anywhere}.group,.popup .message{padding:var(--ui-space-2) var(--ui-space-3)}.sr-only{position:absolute;inline-size:1px;block-size:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@media (pointer: coarse){button{min-inline-size:2.75rem;min-block-size:2.75rem}}@media (forced-colors: active){.field,.popup{border-color:CanvasText}.option[data-active]{outline-color:Highlight}}:host([multiple]) .field{flex-wrap:wrap;align-items:center;gap:var(--ui-space-1);min-block-size:var(--ui-multi-combobox-min-block-size, 2.5rem);padding:var(--ui-space-1)}:host([multiple]) input{flex:1 0 var(--ui-multi-combobox-input-min-inline-size, 5rem);width:auto;min-block-size:1.75rem;padding:var(--ui-space-0-5) var(--ui-space-1)}.items{display:contents}.item{appearance:none;display:inline-flex;min-inline-size:0;max-inline-size:min(100%, var(--ui-multi-combobox-item-max-inline-size, 12rem));overflow:hidden;padding:0;border:0;border-radius:var(--ui-radius-1);background:transparent;color:inherit;font:inherit;cursor:default}.item>slot{display:block;min-inline-size:0;max-inline-size:100%;overflow:hidden}.item>slot::slotted(*){min-inline-size:0;max-inline-size:100%}.item:focus-visible{outline:2px solid var(--ui-focus-ring);outline-offset:1px}.item:disabled{opacity:.6}`;
75
- var UICombobox = class {
76
- constructor(hostRef) {
77
- registerInstance(this, hostRef);
78
- this.queryChange = createEvent(this, "query-change");
79
- this.valueChange = createEvent(this, "value-change");
80
- this.freeEntry = createEvent(this, "free-entry");
81
- this.createEntry = createEvent(this, "create-entry");
82
- this.dependencyInvalidate = createEvent(this, "dependency-invalidate");
83
- this.validationChange = createEvent(this, "validation-change");
84
- this.optionsChange = createEvent(this, "options-change");
85
- this.addItem = createEvent(this, "add-item");
86
- this.removeItem = createEvent(this, "remove-item");
87
- this.createItem = createEvent(this, "create-item");
88
- }
89
- get host() {
90
- return getElement(this);
91
- }
92
- /** Accessible visible label, associated with the native text input. */
93
- label = "";
94
- placeholder = "";
95
- name = "";
96
- /**
97
- * Controlled canonical value. Undefined selects uncontrolled mode; null means no selection.
98
- * With `multiple`, this is the controlled list of selected items instead.
99
- */
100
- value;
101
- defaultValue;
102
- /** Render selected values as removable chips before the cursor. `value` becomes the item list. */
103
- multiple = false;
104
- /** Characters that commit the current query and leave the input ready for the next item (multiple only). */
105
- tokenSeparators = [];
106
- /** Controlled raw editing text; independent of canonical selection. */
107
- query;
108
- defaultQuery = "";
109
- /** Immutable configuration; replace the object/context when dependencies change. */
110
- config = {};
111
- disabled = false;
112
- readOnly = false;
113
- required = false;
114
- size = "md";
115
- /** Keep the native label accessible while allowing compact composed controls. */
116
- labelVisibility = "visible";
117
- disclosure = false;
118
- clearable = false;
119
- /** Optional description shown by the connected question-mark button. */
120
- help = "";
121
- queryChange;
122
- /** Single mode: the ComboboxChange. Multiple mode: the full current item list on any change. */
123
- valueChange;
124
- freeEntry;
125
- createEntry;
126
- dependencyInvalidate;
127
- validationChange;
128
- /** Supplies the current result rows for framework-owned rich slots. */
129
- optionsChange;
130
- /** Multiple mode: a suggestion or exact-match token was committed as a new item. */
131
- addItem;
132
- /** Multiple mode: a selected item was removed via chip keyboard controls. */
133
- removeItem;
134
- /** Multiple mode: an unmatched query was submitted for creation. */
135
- createItem;
136
- raw = "";
137
- display = "";
138
- selected = null;
139
- expanded = false;
140
- rows = [];
141
- active = -1;
142
- loading = false;
143
- helpOpen = false;
144
- lookupError = "";
145
- validation = { status: "pristine", touched: false, dirty: false, issues: [] };
146
- input;
147
- popup;
148
- field;
149
- surface;
150
- lookup;
151
- validationRun;
152
- lookupTimer;
153
- composing = false;
154
- initialRaw = "";
155
- overlayId = `ui-combobox-${Math.random().toString(36).slice(2)}`;
156
- alive = false;
157
- fullSet = false;
158
- knownOptions = /* @__PURE__ */ new Map();
159
- awaitingLabel = null;
160
- proposedChange;
161
- formattedRaw;
162
- formattedWith;
163
- /** Multiple mode: the controlled selected items (from `value`). Empty otherwise. */
164
- get items() {
165
- return this.multiple && Array.isArray(this.value) ? this.value : [];
166
- }
167
- get selectedValues() {
168
- return new Set(this.items.map((item) => item.value));
169
- }
170
- componentWillLoad() {
171
- if (this.multiple) {
172
- this.selected = null;
173
- this.raw = this.query ?? this.defaultQuery;
174
- this.display = this.raw;
175
- this.initialRaw = this.raw;
176
- this.applyServerIssues();
177
- return;
178
- }
179
- this.selected = this.value !== void 0 ? this.value : this.defaultValue ?? null;
180
- this.raw = this.query ?? this.defaultQuery;
181
- if (this.query === void 0 && !this.raw && this.selected !== null) {
182
- this.raw = this.config.options?.find((row) => row.value === this.selected)?.label ?? this.selected;
183
- }
184
- if (this.query === void 0 && this.selected !== null && this.raw === this.selected)
185
- this.awaitingLabel = this.selected;
186
- this.display = this.raw;
187
- this.initialRaw = this.raw;
188
- this.applyServerIssues();
189
- }
190
- connectedCallback() {
191
- this.alive = true;
192
- this.setupSurface();
193
- }
194
- componentDidLoad() {
195
- this.setupSurface();
196
- }
197
- componentDidUpdate() {
198
- if (this.input && !this.composing && this.input.value !== this.display)
199
- this.input.value = this.display;
200
- if (this.expanded)
201
- this.surface?.refresh();
202
- }
203
- disconnectedCallback() {
204
- this.alive = false;
205
- this.close();
206
- this.validationRun?.abort();
207
- this.surface?.destroy();
208
- this.surface = void 0;
209
- }
210
- setupSurface() {
211
- if (!this.surface && this.popup && this.field)
212
- this.surface = createAnchoredSurface(this.popup, { anchor: this.field, placement: "bottom-start" });
213
- }
214
- syncValue() {
215
- if (this.multiple || this.value === void 0)
216
- return;
217
- this.selected = this.value;
218
- if (this.query === void 0) {
219
- const proposal = this.proposedChange;
220
- const option = this.config.options?.find((row) => row.value === this.selected) ?? (this.selected === null ? void 0 : this.knownOptions.get(this.selected));
221
- const nextRaw = proposal?.value === this.selected ? proposal.query : option?.label ?? this.selected ?? "";
222
- if (proposal?.value !== this.selected || nextRaw !== this.raw) {
223
- this.raw = nextRaw;
224
- this.display = this.raw;
225
- this.formattedRaw = void 0;
226
- }
227
- this.awaitingLabel = !option && this.selected !== null ? this.selected : null;
228
- }
229
- this.resetValidation();
230
- }
231
- syncQuery() {
232
- if (this.query === void 0 || this.query === this.raw)
233
- return;
234
- if (this.value === void 0 && this.proposedChange?.query !== this.query)
235
- this.selected = null;
236
- this.awaitingLabel = null;
237
- this.formattedRaw = void 0;
238
- this.raw = this.query;
239
- this.display = this.raw;
240
- this.resetValidation();
241
- if (this.expanded)
242
- this.search("input");
243
- }
244
- syncDisabled() {
245
- if (this.disabled || this.readOnly) {
246
- this.close();
247
- this.resetValidation();
248
- }
249
- }
250
- syncConfig(next, previous) {
251
- this.validationRun?.abort();
252
- if (next.provider !== previous?.provider || next.context !== previous?.context)
253
- this.knownOptions.clear();
254
- if (next.context !== previous?.context) {
255
- this.close();
256
- const policy = next.invalidation ?? "retain-query";
257
- if (this.multiple) {
258
- if (policy === "clear")
259
- this.setMultiQuery("", "programmatic");
260
- } else {
261
- const value = policy === "retain" ? this.selected : null;
262
- const query = policy === "clear" ? "" : this.raw;
263
- this.commit(value, query, null, "invalidation", "programmatic");
264
- }
265
- this.validation = { status: "pristine", touched: false, dirty: this.raw !== this.initialRaw, issues: [] };
266
- }
267
- this.applyServerIssues();
268
- if (this.expanded)
269
- this.search("context");
270
- }
271
- applyServerIssues() {
272
- const issues = this.config.issues ?? [];
273
- if (issues.length)
274
- this.setValidation({ issues }, this.validation.touched);
275
- else
276
- this.resetValidation();
277
- }
278
- resetValidation() {
279
- this.validationRun?.abort();
280
- this.validation = { status: "pristine", touched: this.validation.touched, dirty: this.raw !== this.initialRaw, issues: [] };
281
- this.validationChange?.emit(this.validation);
282
- }
283
- cancelLookup() {
284
- clearTimeout(this.lookupTimer);
285
- this.lookup?.abort();
286
- this.lookup = void 0;
287
- this.loading = false;
288
- }
289
- close() {
290
- this.expanded = false;
291
- this.active = -1;
292
- this.cancelLookup();
293
- this.surface?.hide();
294
- closeOverlay(this.overlayId);
295
- }
296
- open(reason = "input") {
297
- if (this.disabled || this.readOnly)
298
- return;
299
- this.expanded = true;
300
- if (this.popup && this.field)
301
- this.popup.style.minWidth = `${this.field.getBoundingClientRect().width}px`;
302
- this.surface?.show();
303
- openOverlay({
304
- id: this.overlayId,
305
- element: this.popup,
306
- relatedElements: [this.host],
307
- modal: false,
308
- requestClose: () => this.close()
309
- });
310
- this.search(reason);
311
- }
312
- search(reason) {
313
- this.cancelLookup();
314
- this.fullSet = reason === "disclosure";
315
- this.active = -1;
316
- this.lookupError = "";
317
- const config = this.config;
318
- const query = this.fullSet ? "" : this.raw;
319
- const controller = new AbortController();
320
- this.lookup = controller;
321
- const apply = (options) => {
322
- if (controller.signal.aborted || !this.alive)
323
- return;
324
- for (const option of options)
325
- this.knownOptions.set(option.value, option);
326
- const selectedOption = this.selected === null ? void 0 : this.knownOptions.get(this.selected);
327
- if (this.query === void 0 && this.awaitingLabel === this.selected && selectedOption) {
328
- this.raw = selectedOption.label;
329
- this.display = this.raw;
330
- this.awaitingLabel = null;
331
- this.formattedRaw = void 0;
332
- this.resetValidation();
333
- }
334
- const ids = /* @__PURE__ */ new Set();
335
- const selected = this.multiple ? this.selectedValues : void 0;
336
- this.rows = options.filter((option) => {
337
- if (ids.has(option.id))
338
- return false;
339
- ids.add(option.id);
340
- if (this.fullSet)
341
- return true;
342
- if (selected)
343
- return !selected.has(option.value) && (config.filter ? config.filter(option, query, config.context) : option.label.toLocaleLowerCase().includes(query.toLocaleLowerCase()));
344
- return config.filter ? config.filter(option, query, config.context) : config.provider ? true : option.label.toLocaleLowerCase().includes(query.toLocaleLowerCase());
345
- });
346
- const groups = /* @__PURE__ */ new Map();
347
- for (const row of this.rows) {
348
- const group = row.group ?? "";
349
- if (!groups.has(group))
350
- groups.set(group, []);
351
- groups.get(group).push(row);
352
- }
353
- this.rows = [...groups.values()].flat();
354
- this.loading = false;
355
- this.optionsChange.emit(this.rows);
356
- };
357
- if (!config.provider) {
358
- apply(config.options ?? []);
359
- return;
360
- }
361
- this.rows = [];
362
- this.loading = true;
363
- this.lookupTimer = setTimeout(async () => {
364
- try {
365
- apply(await config.provider({ query, context: config.context, signal: controller.signal, reason }));
366
- } catch (error) {
367
- if (controller.signal.aborted || !this.alive)
368
- return;
369
- this.loading = false;
370
- this.lookupError = error instanceof Error ? error.message : "Unable to load suggestions.";
371
- }
372
- }, reason === "disclosure" ? 0 : Math.max(0, config.debounce ?? 200));
373
- }
374
- get canCreate() {
375
- const candidates = this.config.options ? [...this.config.options, ...this.rows] : this.rows;
376
- return Boolean(this.config.allowCreate && this.raw.trim() && !this.loading && !this.lookupError && !candidates.some((row) => row.label.toLocaleLowerCase() === this.raw.toLocaleLowerCase()));
377
- }
378
- format(timing) {
379
- if ((this.config.formatOn ?? "blur") !== timing || !this.input)
380
- return;
381
- if (this.formattedRaw === this.raw && this.formattedWith === this.config.format)
382
- return;
383
- const result = formatEditingValue(this.raw, {
384
- start: this.input.selectionStart ?? this.raw.length,
385
- end: this.input.selectionEnd ?? this.raw.length,
386
- direction: this.input.selectionDirection ?? "none"
387
- }, this.config.format);
388
- this.formattedRaw = this.raw;
389
- this.formattedWith = this.config.format;
390
- this.display = result.display;
391
- if (this.input.value !== result.display) {
392
- this.input.value = result.display;
393
- this.input.setSelectionRange(result.selection.start, result.selection.end, result.selection.direction);
394
- }
395
- }
396
- onInput = (event) => {
397
- if (this.composing || event.isComposing)
398
- return;
399
- this.awaitingLabel = null;
400
- this.formattedRaw = void 0;
401
- this.raw = this.input.value;
402
- this.display = this.raw;
403
- this.resetValidation();
404
- this.format("input");
405
- this.queryChange.emit({ query: this.raw, display: this.display, trigger: "keyboard" });
406
- if (this.selected !== null)
407
- this.commit(null, this.raw, null, "clear", "keyboard");
408
- this.open();
409
- if (this.config.validateOn === "input")
410
- void this.validate();
411
- queueMicrotask(() => {
412
- if (this.query !== void 0 && this.query !== this.raw)
413
- this.syncQuery();
414
- });
415
- };
416
- commit(value, query, option, kind, trigger) {
417
- this.awaitingLabel = null;
418
- const queryChanged = query !== this.raw;
419
- if (this.value === void 0)
420
- this.selected = value;
421
- if (this.query === void 0 && queryChanged) {
422
- this.raw = query;
423
- this.display = query;
424
- this.formattedRaw = void 0;
425
- }
426
- this.resetValidation();
427
- const detail = { value, query, option, kind, trigger };
428
- const proposal = { value, query };
429
- this.proposedChange = proposal;
430
- this.valueChange.emit(detail);
431
- if (queryChanged)
432
- this.queryChange.emit({ query, display: query, trigger });
433
- if (kind === "create")
434
- this.createEntry.emit(detail);
435
- if (kind === "free-entry")
436
- this.freeEntry.emit(detail);
437
- if (kind === "invalidation")
438
- this.dependencyInvalidate.emit(detail);
439
- queueMicrotask(() => {
440
- if (this.proposedChange !== proposal)
441
- return;
442
- if (this.value !== void 0 && this.value !== proposal.value)
443
- this.syncValue();
444
- if (this.query !== void 0 && this.query !== proposal.query) {
445
- if (this.value === void 0) {
446
- this.selected = null;
447
- this.resetValidation();
448
- }
449
- this.syncQuery();
450
- }
451
- this.proposedChange = void 0;
452
- });
453
- }
454
- choose(index, trigger) {
455
- const option = this.rows[index];
456
- if (option?.disabled)
457
- return;
458
- if (this.multiple) {
459
- if (option)
460
- this.addSelectedItem(option, trigger);
461
- else if (this.canCreate && index === this.rows.length)
462
- this.createSelectedItem(this.raw.trim(), trigger);
463
- else
464
- return;
465
- this.setMultiQuery("", trigger);
466
- this.close();
467
- this.input?.focus();
468
- return;
469
- }
470
- if (option)
471
- this.commit(option.value, option.label, option, "selection", trigger);
472
- else if (this.canCreate && index === this.rows.length)
473
- this.commit(null, this.raw, null, "create", trigger);
474
- else
475
- return;
476
- this.close();
477
- this.input?.focus();
478
- if (this.config.validateOn !== "submit")
479
- queueMicrotask(() => void this.validate());
480
- }
481
- // --- Multiple-mode helpers ---------------------------------------------
482
- emitItems(items) {
483
- this.valueChange.emit(items);
484
- }
485
- setMultiQuery(query, trigger) {
486
- if (this.query === void 0) {
487
- this.raw = query;
488
- this.display = query;
489
- this.formattedRaw = void 0;
490
- }
491
- if (this.input)
492
- this.input.value = query;
493
- this.queryChange.emit({ query, display: query, trigger });
494
- }
495
- addSelectedItem(option, trigger) {
496
- this.addItem.emit({ item: option, index: this.items.length, trigger });
497
- this.emitItems([...this.items, option]);
498
- }
499
- createSelectedItem(query, trigger) {
500
- if (!query)
501
- return;
502
- this.createItem.emit({ query, trigger });
503
- }
504
- commitQuery(trigger) {
505
- const query = this.raw.trim();
506
- if (!query)
507
- return;
508
- const normalized = query.toLocaleLowerCase();
509
- const option = this.rows.find((row) => row.label.trim().toLocaleLowerCase() === normalized);
510
- if (option) {
511
- this.setMultiQuery("", trigger);
512
- this.addSelectedItem(option, trigger);
513
- } else if (this.config.allowCreate) {
514
- this.setMultiQuery("", trigger);
515
- this.createSelectedItem(query, trigger);
516
- }
517
- }
518
- removeItemAt(index, trigger) {
519
- const item = this.items[index];
520
- if (!item || item.disabled || this.disabled || this.readOnly)
521
- return;
522
- this.removeItem.emit({ item, index, trigger });
523
- this.emitItems(this.items.filter((_, position) => position !== index));
524
- requestAnimationFrame(() => {
525
- const buttons = this.host.shadowRoot?.querySelectorAll('[part="item"]') ?? [];
526
- const next = buttons[Math.min(index, buttons.length - 1)] ?? buttons[index - 1];
527
- if (next && next.dataset.value !== item.value)
528
- next.focus();
529
- else
530
- void this.focusInput();
531
- });
532
- }
533
- focusItem(index) {
534
- this.host.shadowRoot?.querySelectorAll('[part="item"]')[index]?.focus();
535
- }
536
- onItemKeyDown = (event, index) => {
537
- if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
538
- return;
539
- if (event.key === "ArrowLeft") {
540
- event.preventDefault();
541
- event.stopPropagation();
542
- this.focusItem(Math.max(0, index - 1));
543
- } else if (event.key === "ArrowRight") {
544
- event.preventDefault();
545
- event.stopPropagation();
546
- if (index === this.items.length - 1)
547
- void this.focusInput();
548
- else
549
- this.focusItem(index + 1);
550
- } else if (event.key === "Backspace" || event.key === "Delete") {
551
- event.preventDefault();
552
- event.stopPropagation();
553
- this.removeItemAt(index, "keyboard");
554
- }
555
- };
556
- handleMultipleKeydown(event) {
557
- if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
558
- return false;
559
- if (this.tokenSeparators.includes(event.key)) {
560
- event.preventDefault();
561
- event.stopPropagation();
562
- this.commitQuery("keyboard");
563
- return true;
564
- }
565
- if (this.raw || (this.input?.selectionStart ?? 0) > 0)
566
- return false;
567
- if (event.key === "ArrowLeft" && this.items.length) {
568
- event.preventDefault();
569
- this.focusItem(this.items.length - 1);
570
- return true;
571
- }
572
- if (event.key === "Backspace" && this.items.length) {
573
- event.preventDefault();
574
- this.removeItemAt(this.items.length - 1, "keyboard");
575
- return true;
576
- }
577
- return false;
578
- }
579
- move(key) {
580
- const indices = this.rows.flatMap((row, index) => row.disabled ? [] : [index]);
581
- if (this.canCreate)
582
- indices.push(this.rows.length);
583
- if (!indices.length)
584
- return;
585
- const current = indices.indexOf(this.active);
586
- const next = key === "Home" ? 0 : key === "End" ? indices.length - 1 : key === "ArrowDown" ? Math.min(current + 1, indices.length - 1) : current < 0 ? indices.length - 1 : Math.max(0, current - 1);
587
- this.active = indices[next];
588
- requestAnimationFrame(() => this.host.shadowRoot?.getElementById(`option-${this.active}`)?.scrollIntoView({ block: "nearest" }));
589
- }
590
- onKeydown = (event) => {
591
- if (this.composing || event.isComposing || this.disabled || this.readOnly)
592
- return;
593
- if (this.multiple && this.handleMultipleKeydown(event))
594
- return;
595
- if (event.key === "Escape" && this.expanded) {
596
- event.preventDefault();
597
- event.stopPropagation();
598
- this.close();
599
- return;
600
- }
601
- if (event.key === "Tab") {
602
- this.close();
603
- return;
604
- }
605
- if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
606
- return;
607
- if (event.key === "ArrowDown" || event.key === "ArrowUp") {
608
- event.preventDefault();
609
- if (!this.expanded)
610
- this.open("disclosure");
611
- this.move(event.key);
612
- } else if ((event.key === "Home" || event.key === "End") && this.expanded && this.active >= 0) {
613
- event.preventDefault();
614
- this.move(event.key);
615
- } else if (event.key === "Enter" && this.expanded) {
616
- if (this.active >= 0) {
617
- event.preventDefault();
618
- this.choose(this.active, "keyboard");
619
- } else if (this.config.allowFreeText) {
620
- event.preventDefault();
621
- this.commit(null, this.raw, null, "free-entry", "keyboard");
622
- this.close();
623
- }
624
- }
625
- };
626
- onFocusOut = (event) => {
627
- if (event.relatedTarget instanceof Node && this.host.shadowRoot?.contains(event.relatedTarget))
628
- return;
629
- this.close();
630
- this.format("blur");
631
- this.validation = { ...this.validation, touched: true };
632
- if (!this.multiple && this.config.allowFreeText && this.selected === null)
633
- this.commit(null, this.raw, null, "free-entry", "keyboard");
634
- if ((this.config.validateOn ?? "blur") === "blur")
635
- void this.validate();
636
- };
637
- setValidation(result, touched = this.validation.touched) {
638
- const blocking = result.issues.some((issue) => issue.severity !== "warning");
639
- this.validation = {
640
- status: blocking ? "error" : result.issues.length ? "warning" : "valid",
641
- touched,
642
- dirty: this.raw !== this.initialRaw,
643
- ...result
644
- };
645
- this.validationChange?.emit(this.validation);
646
- }
647
- /** Validate for submission. Caller submits only non-pending, non-error output. */
648
- async validate() {
649
- this.validationRun?.abort();
650
- const run = new AbortController();
651
- this.validationRun = run;
652
- this.validation = { ...this.validation, status: "pending", output: void 0 };
653
- this.validationChange.emit(this.validation);
654
- try {
655
- const result = await validateField({ raw: this.raw, value: this.selected, context: this.config.context, signal: run.signal }, this.config);
656
- if (this.required && !this.raw.trim())
657
- result.issues = [...result.issues, { message: "A value is required." }];
658
- else if (this.raw && this.selected === null && !this.config.allowFreeText && !this.config.allowCreate)
659
- result.issues = [...result.issues, { message: "Choose a suggestion." }];
660
- if (result.issues.some((issue) => issue.severity !== "warning"))
661
- result.output = void 0;
662
- if (!run.signal.aborted && this.alive)
663
- this.setValidation(result);
664
- } catch {
665
- }
666
- return this.validation;
667
- }
668
- /** Focus the native editing input from a composed control. */
669
- async focusInput() {
670
- this.input?.focus();
671
- }
672
- render() {
673
- const description = [this.helpOpen ? "help-text" : "", this.validation.issues.length ? "validation" : ""].filter(Boolean).join(" ") || void 0;
674
- const status = this.loading ? "Loading suggestions\u2026" : this.lookupError || (this.expanded ? `${this.rows.length} suggestions available.` : "");
675
- const groups = [...new Set(this.rows.map((row) => row.group ?? ""))];
676
- return h(Host, { key: "fc4c0192d3be88d8c0199ae1bcca44232bd22351", "data-size": this.size, "data-validation": this.validation.status, onFocusout: this.onFocusOut }, h("label", { key: "bdd0d244c6ef448978fa77aac3a2d3b71d713553", htmlFor: "input", part: "label", class: this.labelVisibility === "sr-only" ? "sr-only" : void 0 }, this.label, this.required ? " *" : ""), h("div", { key: "afb3972aab52171a3b25ede863c31059e56f5d91", class: "field", part: "field", ref: (element) => this.field = element, onClick: (event) => {
677
- if (!event.composedPath().some((node) => node instanceof HTMLButtonElement))
678
- this.input?.focus();
679
- } }, h("slot", { key: "65e4e201d6c11cd2638e392e1298662de7ba4d57", name: "start" }), this.multiple && h("div", { key: "b80b5b85fa0540139b9756fcc494aef9df245c15", class: "items", role: "group", "aria-label": `Selected ${this.label}` }, this.items.map((item, index) => h("button", { type: "button", part: "item", class: "item", "data-value": item.value, tabIndex: -1, disabled: this.disabled || this.readOnly || item.disabled, "aria-label": `${item.label}, press Delete or Backspace to remove`, onKeyDown: (event) => this.onItemKeyDown(event, index) }, h("slot", { name: `item-${item.id}` }, h("ui-chip", { appearance: "pill" }, item.label))))), h("input", { key: "64f76055ae412cc87119270eec10c69000a72563", id: "input", ref: (element) => this.input = element, role: "combobox", "aria-autocomplete": "list", "aria-expanded": String(this.expanded), "aria-controls": "listbox", "aria-activedescendant": this.expanded && this.active >= 0 ? `option-${this.active}` : void 0, "aria-describedby": description, "aria-invalid": String(this.validation.status === "error"), "aria-busy": String(this.validation.status === "pending"), value: this.display, placeholder: this.placeholder, name: this.name || void 0, disabled: this.disabled, readOnly: this.readOnly, required: this.required, autoComplete: "off", part: "input", onInput: this.onInput, onKeyDown: this.onKeydown, onCompositionstart: () => this.composing = true, onCompositionend: () => {
680
- this.composing = false;
681
- this.onInput(new InputEvent("input"));
682
- } }), this.clearable && h("button", { key: "eac4c18dadcea92065af4ecd871d925ef1248d47", type: "button", part: "affordance", "aria-label": `Clear ${this.label}`, disabled: this.disabled || this.readOnly, onClick: () => {
683
- this.commit(null, "", null, "clear", "pointer");
684
- this.close();
685
- this.input?.focus();
686
- } }, "\xD7"), this.help && h("button", { key: "9a559d49a495ead3dbf159f170c594e0aaa0d0d0", id: "help", type: "button", part: "affordance", "aria-label": `Help for ${this.label}`, disabled: this.disabled }, h("span", { key: "73940e568b976f85399d5baa5e247a4a606d0039", "aria-hidden": "true" }, "?")), this.disclosure && h("button", { key: "30dd6746ffb121888a4c4fb6df54720906badf78", type: "button", part: "affordance", "aria-label": `Suggestions for ${this.label}`, "aria-controls": "listbox", "aria-expanded": String(this.expanded), disabled: this.disabled || this.readOnly, onClick: () => {
687
- if (this.expanded)
688
- this.close();
689
- else
690
- this.open("disclosure");
691
- this.input?.focus();
692
- } }, h("span", { key: "7d3b10a765ee0a6c40d7b0b49e98c676a5837944", "aria-hidden": "true" }, "\u2304"))), this.help && h("ui-tooltip", { key: "efff00f45dc281b727789eb2aa84ff772bb5c925", id: "help-text", for: "help", toggleOnClick: true, onOpen: () => this.helpOpen = true, onClose: () => this.helpOpen = false }, this.help), h("div", { key: "770bc12b873026b571bd3ae2a80416e8af52b8d4", class: "popup", part: "popup", hidden: !this.expanded, ref: (element) => this.popup = element }, h("div", { key: "ed48c8dd8b672a577d567ca5e795b8a53fde2761", id: "listbox", role: "listbox", "aria-label": `${this.label} suggestions`, "aria-busy": String(this.loading) }, groups.map((group) => h("div", { role: group ? "group" : "presentation", "aria-label": group || void 0 }, group && h("div", { class: "group", part: "group" }, group), this.rows.map((row, index) => (row.group ?? "") !== group ? null : h("div", { id: `option-${index}`, role: "option", "aria-selected": String(this.selected === row.value), "aria-disabled": String(Boolean(row.disabled)), "data-active": this.active === index ? "" : void 0, part: "option", class: "option", onPointerDown: (event) => event.preventDefault(), onClick: () => this.choose(index, "pointer") }, h("slot", { name: `option-${row.id}` }, h("span", { class: "primary", part: "option-primary" }, row.label), row.description && h("span", { class: "secondary", part: "option-secondary" }, row.description)))))), this.canCreate && h("div", { key: "43215f449bbccde407ef818cee473f69870f6f8c", id: `option-${this.rows.length}`, role: "option", "aria-selected": "false", class: "option", part: "option", "data-active": this.active === this.rows.length ? "" : void 0, onPointerDown: (event) => event.preventDefault(), onClick: () => this.choose(this.rows.length, "pointer") }, h("slot", { key: "3ff70ff3ab8e24afc369a26e8474e7d1220ed6eb", name: "create" }, "Create \u201C", this.raw, "\u201D"))), this.loading ? h("div", { class: "message" }, h("slot", { name: "loading" }, "Loading suggestions\u2026")) : this.lookupError ? h("div", { class: "message" }, h("slot", { name: "error" }, this.lookupError)) : !this.rows.length && !this.canCreate ? h("div", { class: "message" }, h("slot", { name: "empty" }, "No suggestions.")) : null, h("slot", { key: "8b1fbd4f5c372393d294d8c218ae1785e6b0334f", name: "footer" })), h("div", { key: "18e68687f04e35535edee363683523ce6bbb0291", id: "validation", class: "message", part: "validation", hidden: !this.validation.issues.length }, this.validation.issues.map((issue) => h("div", null, issue.message))), h("div", { key: "e4a7db06abcfaf08b8ac592107531a13ef3a5897", class: "sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true" }, status, " ", this.validation.status === "pending" ? "Checking value\u2026" : this.validation.issues.map((issue) => issue.message).join(" ")));
693
- }
694
- static get watchers() {
695
- return {
696
- "value": [{
697
- "syncValue": 0
698
- }],
699
- "query": [{
700
- "syncQuery": 0
701
- }],
702
- "disabled": [{
703
- "syncDisabled": 0
704
- }],
705
- "readOnly": [{
706
- "syncDisabled": 0
707
- }],
708
- "config": [{
709
- "syncConfig": 0
710
- }]
711
- };
712
- }
713
- };
714
- UICombobox.style = uiComboboxCss();
715
- export {
716
- UICombobox as ui_combobox
717
- };