@threadlabs/looma 0.19.0 → 0.20.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 (508) hide show
  1. package/components/shared/trigger.js +9 -4
  2. package/components/ui-affordance-scope/ui-affordance-scope.html +1 -1
  3. package/components/ui-avatar/ui-avatar.html +2 -2
  4. package/components/ui-avatar-group/ui-avatar-group.html +1 -1
  5. package/components/ui-avatar-group/ui-avatar-group.js +1 -1
  6. package/components/ui-badge/ui-badge.html +3 -3
  7. package/components/ui-button/ui-button.html +7 -6
  8. package/components/ui-callout/ui-callout.html +1 -1
  9. package/components/ui-card/ui-card.html +5 -4
  10. package/components/ui-checkbox/ui-checkbox.html +6 -2
  11. package/components/ui-cluster/ui-cluster.html +4 -4
  12. package/components/ui-combobox/ui-combobox.html +257 -34
  13. package/components/ui-combobox/ui-combobox.js +21 -20
  14. package/components/ui-container/ui-container.html +2 -2
  15. package/components/ui-context-menu/ui-context-menu.html +17 -5
  16. package/components/ui-cover/ui-cover.html +1 -1
  17. package/components/ui-description-list/ui-description-list.html +3 -3
  18. package/components/ui-dialog/ui-dialog.html +14 -6
  19. package/components/ui-disclosure/ui-disclosure.html +14 -5
  20. package/components/ui-editable/ui-editable.html +15 -4
  21. package/components/ui-editor-mention-menu/ui-editor-mention-menu.html +1 -1
  22. package/components/ui-editor-slash-menu/ui-editor-slash-menu.html +1 -1
  23. package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.html +26 -6
  24. package/components/ui-editor-table-overlay/ui-editor-table-overlay.html +90 -12
  25. package/components/ui-editor-table-overlay/ui-editor-table-overlay.js +5 -5
  26. package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.html +33 -7
  27. package/components/ui-grid/ui-grid.html +2 -2
  28. package/components/ui-icon-button/ui-icon-button.html +2 -2
  29. package/components/ui-input/ui-input.html +28 -6
  30. package/components/ui-list/ui-list.html +5 -4
  31. package/components/ui-list-item/ui-list-item.html +1 -1
  32. package/components/ui-listbox/ui-listbox.html +7 -1
  33. package/components/ui-menu/ui-menu.html +18 -5
  34. package/components/ui-menu-item/ui-menu-item.html +7 -2
  35. package/components/ui-meter/ui-meter.html +2 -2
  36. package/components/ui-nav-item/ui-nav-item.html +5 -4
  37. package/components/ui-page-header/ui-page-header.html +1 -1
  38. package/components/ui-popover/ui-popover.html +14 -5
  39. package/components/ui-radio/ui-radio.html +6 -2
  40. package/components/ui-radio-group/ui-radio-group.html +11 -3
  41. package/components/ui-reel/ui-reel.html +3 -3
  42. package/components/ui-scroll-area/ui-scroll-area.html +1 -1
  43. package/components/ui-search-shell/ui-search-shell.html +6 -2
  44. package/components/ui-section/ui-section.html +2 -2
  45. package/components/ui-select/ui-select.html +1 -1
  46. package/components/ui-separator/ui-separator.html +1 -1
  47. package/components/ui-sidebar/ui-sidebar.html +11 -4
  48. package/components/ui-spinner/ui-spinner.html +1 -1
  49. package/components/ui-stack/ui-stack.html +3 -3
  50. package/components/ui-status-message/ui-status-message.html +2 -2
  51. package/components/ui-switch/ui-switch.html +6 -2
  52. package/components/ui-switcher/ui-switcher.html +3 -3
  53. package/components/ui-table/ui-table.html +1 -1
  54. package/components/ui-tabs/ui-tabs.html +9 -4
  55. package/components/ui-text/ui-text.html +6 -6
  56. package/components/ui-textarea/ui-textarea.html +1 -1
  57. package/components/ui-toast/ui-toast.html +6 -2
  58. package/components/ui-toast-region/ui-toast-region.html +16 -4
  59. package/components/ui-tooltip/ui-tooltip.html +15 -6
  60. package/components/ui-tree/ui-tree.html +30 -7
  61. package/components/ui-tree-item/ui-tree-item.html +10 -6
  62. package/components/ui-tree-item/ui-tree-item.js +20 -3
  63. package/dist/index.js +1 -1
  64. package/editor/table-overlay.d.ts +1 -1
  65. package/package.json +3 -3
  66. package/styles/ui-action-bar.css +1 -1
  67. package/styles/ui-affordance-scope.css +1 -1
  68. package/styles/ui-avatar-group.css +1 -1
  69. package/styles/ui-avatar.css +1 -1
  70. package/styles/ui-badge.css +1 -1
  71. package/styles/ui-breadcrumb-item.css +1 -1
  72. package/styles/ui-breadcrumbs.css +1 -1
  73. package/styles/ui-button.css +1 -1
  74. package/styles/ui-callout.css +1 -1
  75. package/styles/ui-card.css +1 -1
  76. package/styles/ui-checkbox.css +1 -1
  77. package/styles/ui-cluster.css +1 -1
  78. package/styles/ui-combobox.css +1 -1
  79. package/styles/ui-container.css +1 -1
  80. package/styles/ui-context-menu.css +1 -1
  81. package/styles/ui-cover.css +1 -1
  82. package/styles/ui-description-item.css +1 -1
  83. package/styles/ui-description-list.css +1 -1
  84. package/styles/ui-dialog.css +1 -1
  85. package/styles/ui-disclosure.css +1 -1
  86. package/styles/ui-editable.css +1 -1
  87. package/styles/ui-editor-insert-table-grid.css +1 -1
  88. package/styles/ui-editor-mention-menu-item.css +1 -1
  89. package/styles/ui-editor-mention-menu.css +1 -1
  90. package/styles/ui-editor-slash-menu-group.css +1 -1
  91. package/styles/ui-editor-slash-menu-item.css +1 -1
  92. package/styles/ui-editor-slash-menu.css +1 -1
  93. package/styles/ui-editor-table-context-menu.css +1 -1
  94. package/styles/ui-editor-table-overlay.css +1 -1
  95. package/styles/ui-editor-table-toolbar.css +1 -1
  96. package/styles/ui-editor-toolbar.css +1 -1
  97. package/styles/ui-floating-action-button.css +1 -1
  98. package/styles/ui-form-field.css +1 -1
  99. package/styles/ui-grid.css +1 -1
  100. package/styles/ui-icon-button.css +1 -1
  101. package/styles/ui-icon.css +1 -1
  102. package/styles/ui-input-group.css +1 -1
  103. package/styles/ui-input.css +1 -1
  104. package/styles/ui-list-item.css +1 -1
  105. package/styles/ui-list.css +1 -1
  106. package/styles/ui-listbox.css +1 -1
  107. package/styles/ui-menu-group.css +1 -1
  108. package/styles/ui-menu-item.css +1 -1
  109. package/styles/ui-menu.css +1 -1
  110. package/styles/ui-meter.css +1 -1
  111. package/styles/ui-nav-item.css +1 -1
  112. package/styles/ui-page-header.css +1 -1
  113. package/styles/ui-popover.css +1 -1
  114. package/styles/ui-radio-group.css +1 -1
  115. package/styles/ui-radio.css +1 -1
  116. package/styles/ui-reel.css +1 -1
  117. package/styles/ui-scroll-area.css +1 -1
  118. package/styles/ui-search-result-row.css +1 -1
  119. package/styles/ui-search-shell.css +1 -1
  120. package/styles/ui-section.css +1 -1
  121. package/styles/ui-select.css +1 -1
  122. package/styles/ui-separator.css +1 -1
  123. package/styles/ui-sidebar.css +1 -1
  124. package/styles/ui-spinner.css +1 -1
  125. package/styles/ui-stack.css +1 -1
  126. package/styles/ui-status-message.css +1 -1
  127. package/styles/ui-switch.css +1 -1
  128. package/styles/ui-switcher.css +1 -1
  129. package/styles/ui-table.css +1 -1
  130. package/styles/ui-tabs.css +1 -1
  131. package/styles/ui-text.css +1 -1
  132. package/styles/ui-textarea.css +1 -1
  133. package/styles/ui-toast-region.css +1 -1
  134. package/styles/ui-toast.css +1 -1
  135. package/styles/ui-tooltip.css +1 -1
  136. package/styles/ui-top-bar.css +1 -1
  137. package/styles/ui-tree-item.css +6 -6
  138. package/styles/ui-tree.css +1 -1
  139. package/vanilla/UiActionBar.d.ts +1 -1
  140. package/vanilla/UiActionBar.js +5 -1
  141. package/vanilla/UiAffordanceScope.d.ts +1 -1
  142. package/vanilla/UiAffordanceScope.js +3 -2
  143. package/vanilla/UiAvatar.d.ts +1 -1
  144. package/vanilla/UiAvatar.js +4 -3
  145. package/vanilla/UiAvatarGroup.d.ts +1 -1
  146. package/vanilla/UiAvatarGroup.js +3 -2
  147. package/vanilla/UiBadge.d.ts +1 -1
  148. package/vanilla/UiBadge.js +2 -1
  149. package/vanilla/UiBreadcrumbItem.d.ts +1 -1
  150. package/vanilla/UiBreadcrumbItem.js +2 -1
  151. package/vanilla/UiBreadcrumbs.d.ts +1 -1
  152. package/vanilla/UiBreadcrumbs.js +4 -7
  153. package/vanilla/UiButton.d.ts +1 -1
  154. package/vanilla/UiButton.js +6 -4
  155. package/vanilla/UiCallout.d.ts +1 -1
  156. package/vanilla/UiCallout.js +3 -2
  157. package/vanilla/UiCard.d.ts +1 -1
  158. package/vanilla/UiCard.js +6 -2
  159. package/vanilla/UiCheckbox.d.ts +1 -1
  160. package/vanilla/UiCheckbox.js +4 -2
  161. package/vanilla/UiCluster.d.ts +1 -1
  162. package/vanilla/UiCluster.js +2 -1
  163. package/vanilla/UiCombobox.d.ts +3 -2
  164. package/vanilla/UiCombobox.js +8 -2
  165. package/vanilla/UiContainer.d.ts +1 -1
  166. package/vanilla/UiContainer.js +2 -1
  167. package/vanilla/UiContextMenu.d.ts +1 -1
  168. package/vanilla/UiContextMenu.js +3 -2
  169. package/vanilla/UiCover.d.ts +1 -1
  170. package/vanilla/UiCover.js +4 -5
  171. package/vanilla/UiDescriptionItem.d.ts +1 -1
  172. package/vanilla/UiDescriptionItem.js +4 -7
  173. package/vanilla/UiDescriptionList.d.ts +1 -1
  174. package/vanilla/UiDescriptionList.js +2 -1
  175. package/vanilla/UiDialog.d.ts +1 -1
  176. package/vanilla/UiDialog.js +4 -2
  177. package/vanilla/UiDisclosure.d.ts +1 -1
  178. package/vanilla/UiDisclosure.js +4 -2
  179. package/vanilla/UiEditable.d.ts +1 -1
  180. package/vanilla/UiEditable.js +2 -2
  181. package/vanilla/UiEditorInsertTableGrid.d.ts +1 -1
  182. package/vanilla/UiEditorInsertTableGrid.js +1 -1
  183. package/vanilla/UiEditorMentionMenu.d.ts +1 -1
  184. package/vanilla/UiEditorMentionMenu.js +5 -2
  185. package/vanilla/UiEditorMentionMenuItem.d.ts +1 -1
  186. package/vanilla/UiEditorMentionMenuItem.js +3 -1
  187. package/vanilla/UiEditorSlashMenu.d.ts +1 -1
  188. package/vanilla/UiEditorSlashMenu.js +6 -2
  189. package/vanilla/UiEditorSlashMenuGroup.d.ts +1 -1
  190. package/vanilla/UiEditorSlashMenuGroup.js +4 -7
  191. package/vanilla/UiEditorSlashMenuItem.d.ts +1 -1
  192. package/vanilla/UiEditorSlashMenuItem.js +2 -1
  193. package/vanilla/UiEditorTableContextMenu.d.ts +1 -1
  194. package/vanilla/UiEditorTableContextMenu.js +2 -2
  195. package/vanilla/UiEditorTableOverlay.d.ts +12 -2
  196. package/vanilla/UiEditorTableOverlay.js +2 -2
  197. package/vanilla/UiEditorTableToolbar.d.ts +1 -1
  198. package/vanilla/UiEditorTableToolbar.js +2 -2
  199. package/vanilla/UiEditorToolbar.d.ts +1 -1
  200. package/vanilla/UiEditorToolbar.js +2 -1
  201. package/vanilla/UiFloatingActionButton.d.ts +1 -1
  202. package/vanilla/UiFloatingActionButton.js +2 -1
  203. package/vanilla/UiFormField.d.ts +1 -1
  204. package/vanilla/UiFormField.js +6 -1
  205. package/vanilla/UiGrid.d.ts +1 -1
  206. package/vanilla/UiGrid.js +4 -3
  207. package/vanilla/UiIcon.d.ts +1 -1
  208. package/vanilla/UiIcon.js +1 -1
  209. package/vanilla/UiIconButton.d.ts +1 -1
  210. package/vanilla/UiIconButton.js +4 -3
  211. package/vanilla/UiInput.d.ts +5 -4
  212. package/vanilla/UiInput.js +16 -13
  213. package/vanilla/UiInputGroup.d.ts +1 -1
  214. package/vanilla/UiInputGroup.js +5 -1
  215. package/vanilla/UiList.d.ts +1 -1
  216. package/vanilla/UiList.js +4 -2
  217. package/vanilla/UiListItem.d.ts +1 -1
  218. package/vanilla/UiListItem.js +5 -1
  219. package/vanilla/UiListbox.d.ts +1 -1
  220. package/vanilla/UiListbox.js +3 -2
  221. package/vanilla/UiMenu.d.ts +1 -1
  222. package/vanilla/UiMenu.js +3 -2
  223. package/vanilla/UiMenuGroup.d.ts +1 -1
  224. package/vanilla/UiMenuGroup.js +2 -1
  225. package/vanilla/UiMenuItem.d.ts +1 -1
  226. package/vanilla/UiMenuItem.js +6 -2
  227. package/vanilla/UiMeter.d.ts +1 -1
  228. package/vanilla/UiMeter.js +2 -2
  229. package/vanilla/UiNavItem.d.ts +2 -2
  230. package/vanilla/UiNavItem.js +11 -5
  231. package/vanilla/UiPageHeader.d.ts +1 -1
  232. package/vanilla/UiPageHeader.js +8 -5
  233. package/vanilla/UiPopover.d.ts +1 -1
  234. package/vanilla/UiPopover.js +3 -2
  235. package/vanilla/UiRadio.d.ts +1 -1
  236. package/vanilla/UiRadio.js +4 -2
  237. package/vanilla/UiRadioGroup.d.ts +1 -1
  238. package/vanilla/UiRadioGroup.js +3 -2
  239. package/vanilla/UiReel.d.ts +1 -1
  240. package/vanilla/UiReel.js +2 -1
  241. package/vanilla/UiScrollArea.d.ts +1 -1
  242. package/vanilla/UiScrollArea.js +3 -2
  243. package/vanilla/UiSearchResultRow.d.ts +1 -1
  244. package/vanilla/UiSearchResultRow.js +6 -1
  245. package/vanilla/UiSearchShell.d.ts +1 -1
  246. package/vanilla/UiSearchShell.js +6 -2
  247. package/vanilla/UiSection.d.ts +1 -1
  248. package/vanilla/UiSection.js +5 -2
  249. package/vanilla/UiSelect.d.ts +1 -1
  250. package/vanilla/UiSelect.js +3 -2
  251. package/vanilla/UiSeparator.d.ts +1 -1
  252. package/vanilla/UiSeparator.js +3 -7
  253. package/vanilla/UiSidebar.d.ts +1 -1
  254. package/vanilla/UiSidebar.js +3 -2
  255. package/vanilla/UiSpinner.d.ts +1 -1
  256. package/vanilla/UiSpinner.js +2 -2
  257. package/vanilla/UiStack.d.ts +1 -1
  258. package/vanilla/UiStack.js +2 -1
  259. package/vanilla/UiStatusMessage.d.ts +1 -1
  260. package/vanilla/UiStatusMessage.js +4 -2
  261. package/vanilla/UiSwitch.d.ts +1 -1
  262. package/vanilla/UiSwitch.js +4 -2
  263. package/vanilla/UiSwitcher.d.ts +1 -1
  264. package/vanilla/UiSwitcher.js +3 -2
  265. package/vanilla/UiTable.d.ts +1 -1
  266. package/vanilla/UiTable.js +3 -2
  267. package/vanilla/UiTabs.d.ts +1 -1
  268. package/vanilla/UiTabs.js +4 -2
  269. package/vanilla/UiText.d.ts +1 -1
  270. package/vanilla/UiText.js +13 -2
  271. package/vanilla/UiTextarea.d.ts +1 -1
  272. package/vanilla/UiTextarea.js +3 -3
  273. package/vanilla/UiToast.d.ts +1 -1
  274. package/vanilla/UiToast.js +4 -2
  275. package/vanilla/UiToastRegion.d.ts +1 -1
  276. package/vanilla/UiToastRegion.js +3 -2
  277. package/vanilla/UiTooltip.d.ts +1 -1
  278. package/vanilla/UiTooltip.js +3 -2
  279. package/vanilla/UiTopBar.d.ts +1 -1
  280. package/vanilla/UiTopBar.js +5 -1
  281. package/vanilla/UiTree.d.ts +1 -1
  282. package/vanilla/UiTree.js +3 -2
  283. package/vanilla/UiTreeItem.d.ts +1 -1
  284. package/vanilla/UiTreeItem.js +8 -4
  285. package/vue/UiActionBar.vue +33 -2
  286. package/vue/UiAffordanceScope.d.ts +23 -8
  287. package/vue/UiAffordanceScope.vue +90 -17
  288. package/vue/UiAvatar.d.ts +77 -19
  289. package/vue/UiAvatar.vue +151 -31
  290. package/vue/UiAvatarGroup.d.ts +50 -13
  291. package/vue/UiAvatarGroup.vue +121 -23
  292. package/vue/UiBadge.d.ts +32 -10
  293. package/vue/UiBadge.vue +104 -17
  294. package/vue/UiBreadcrumbItem.d.ts +14 -6
  295. package/vue/UiBreadcrumbItem.vue +82 -15
  296. package/vue/UiBreadcrumbs.d.ts +14 -6
  297. package/vue/UiBreadcrumbs.vue +78 -10
  298. package/vue/UiButton.d.ts +122 -27
  299. package/vue/UiButton.vue +288 -64
  300. package/vue/UiCallout.d.ts +14 -6
  301. package/vue/UiCallout.vue +84 -16
  302. package/vue/UiCard.d.ts +41 -12
  303. package/vue/UiCard.vue +149 -25
  304. package/vue/UiCheckbox.d.ts +85 -28
  305. package/vue/UiCheckbox.vue +173 -43
  306. package/vue/UiCluster.d.ts +41 -7
  307. package/vue/UiCluster.vue +122 -13
  308. package/vue/UiCombobox.d.ts +303 -110
  309. package/vue/UiCombobox.vue +723 -412
  310. package/vue/UiContainer.d.ts +23 -5
  311. package/vue/UiContainer.vue +89 -9
  312. package/vue/UiContextMenu.d.ts +38 -23
  313. package/vue/UiContextMenu.vue +113 -38
  314. package/vue/UiCover.d.ts +14 -6
  315. package/vue/UiCover.vue +76 -12
  316. package/vue/UiDescriptionItem.d.ts +14 -6
  317. package/vue/UiDescriptionItem.vue +78 -11
  318. package/vue/UiDescriptionList.d.ts +32 -9
  319. package/vue/UiDescriptionList.vue +106 -16
  320. package/vue/UiDialog.d.ts +89 -30
  321. package/vue/UiDialog.vue +168 -38
  322. package/vue/UiDisclosure.d.ts +70 -27
  323. package/vue/UiDisclosure.vue +149 -36
  324. package/vue/UiEditable.d.ts +119 -41
  325. package/vue/UiEditable.vue +220 -62
  326. package/vue/UiEditorInsertTableGrid.d.ts +46 -17
  327. package/vue/UiEditorInsertTableGrid.vue +215 -40
  328. package/vue/UiEditorMentionMenu.d.ts +128 -41
  329. package/vue/UiEditorMentionMenu.vue +211 -37
  330. package/vue/UiEditorMentionMenuItem.d.ts +32 -10
  331. package/vue/UiEditorMentionMenuItem.vue +98 -17
  332. package/vue/UiEditorSlashMenu.d.ts +110 -37
  333. package/vue/UiEditorSlashMenu.vue +189 -31
  334. package/vue/UiEditorSlashMenuGroup.d.ts +14 -6
  335. package/vue/UiEditorSlashMenuGroup.vue +80 -12
  336. package/vue/UiEditorSlashMenuItem.d.ts +50 -14
  337. package/vue/UiEditorSlashMenuItem.vue +120 -23
  338. package/vue/UiEditorTableContextMenu.d.ts +64 -20
  339. package/vue/UiEditorTableContextMenu.vue +326 -91
  340. package/vue/UiEditorTableOverlay.d.ts +170 -44
  341. package/vue/UiEditorTableOverlay.vue +420 -149
  342. package/vue/UiEditorTableToolbar.d.ts +64 -20
  343. package/vue/UiEditorTableToolbar.vue +344 -107
  344. package/vue/UiEditorToolbar.d.ts +14 -6
  345. package/vue/UiEditorToolbar.vue +79 -15
  346. package/vue/UiFloatingActionButton.d.ts +32 -10
  347. package/vue/UiFloatingActionButton.vue +96 -18
  348. package/vue/UiFormField.d.ts +32 -10
  349. package/vue/UiFormField.vue +99 -19
  350. package/vue/UiGrid.d.ts +32 -6
  351. package/vue/UiGrid.vue +95 -11
  352. package/vue/UiIcon.d.ts +14 -6
  353. package/vue/UiIcon.vue +99 -14
  354. package/vue/UiIconButton.d.ts +77 -19
  355. package/vue/UiIconButton.vue +176 -39
  356. package/vue/UiInput.d.ts +50 -19
  357. package/vue/UiInput.vue +326 -33
  358. package/vue/UiInputGroup.d.ts +14 -6
  359. package/vue/UiInputGroup.vue +79 -15
  360. package/vue/UiList.d.ts +41 -12
  361. package/vue/UiList.vue +125 -22
  362. package/vue/UiListItem.d.ts +23 -8
  363. package/vue/UiListItem.vue +88 -16
  364. package/vue/UiListbox.d.ts +86 -27
  365. package/vue/UiListbox.vue +272 -64
  366. package/vue/UiMenu.d.ts +69 -33
  367. package/vue/UiMenu.vue +142 -38
  368. package/vue/UiMenuGroup.d.ts +14 -6
  369. package/vue/UiMenuGroup.vue +80 -11
  370. package/vue/UiMenuItem.d.ts +61 -25
  371. package/vue/UiMenuItem.vue +174 -45
  372. package/vue/UiMeter.d.ts +68 -18
  373. package/vue/UiMeter.vue +215 -41
  374. package/vue/UiNavItem.d.ts +50 -11
  375. package/vue/UiNavItem.vue +163 -29
  376. package/vue/UiPageHeader.d.ts +14 -6
  377. package/vue/UiPageHeader.vue +75 -12
  378. package/vue/UiPopover.d.ts +43 -21
  379. package/vue/UiPopover.vue +147 -27
  380. package/vue/UiRadio.d.ts +67 -24
  381. package/vue/UiRadio.vue +147 -36
  382. package/vue/UiRadioGroup.d.ts +79 -29
  383. package/vue/UiRadioGroup.vue +162 -41
  384. package/vue/UiReel.d.ts +32 -6
  385. package/vue/UiReel.vue +97 -11
  386. package/vue/UiScrollArea.d.ts +14 -6
  387. package/vue/UiScrollArea.vue +83 -14
  388. package/vue/UiSearchResultRow.d.ts +23 -8
  389. package/vue/UiSearchResultRow.vue +86 -16
  390. package/vue/UiSearchShell.d.ts +48 -19
  391. package/vue/UiSearchShell.vue +120 -26
  392. package/vue/UiSection.d.ts +32 -10
  393. package/vue/UiSection.vue +103 -17
  394. package/vue/UiSelect.d.ts +59 -17
  395. package/vue/UiSelect.vue +140 -29
  396. package/vue/UiSeparator.d.ts +14 -6
  397. package/vue/UiSeparator.vue +80 -9
  398. package/vue/UiSidebar.d.ts +95 -31
  399. package/vue/UiSidebar.vue +172 -39
  400. package/vue/UiSpinner.d.ts +23 -8
  401. package/vue/UiSpinner.vue +115 -24
  402. package/vue/UiStack.d.ts +32 -6
  403. package/vue/UiStack.vue +107 -11
  404. package/vue/UiStatusMessage.d.ts +32 -10
  405. package/vue/UiStatusMessage.vue +109 -19
  406. package/vue/UiSwitch.d.ts +67 -24
  407. package/vue/UiSwitch.vue +147 -36
  408. package/vue/UiSwitcher.d.ts +41 -7
  409. package/vue/UiSwitcher.vue +118 -15
  410. package/vue/UiTable.d.ts +23 -8
  411. package/vue/UiTable.vue +91 -17
  412. package/vue/UiTabs.d.ts +66 -23
  413. package/vue/UiTabs.vue +230 -44
  414. package/vue/UiText.d.ts +68 -18
  415. package/vue/UiText.vue +308 -48
  416. package/vue/UiTextarea.d.ts +84 -21
  417. package/vue/UiTextarea.vue +172 -38
  418. package/vue/UiToast.d.ts +28 -13
  419. package/vue/UiToast.vue +103 -24
  420. package/vue/UiToastRegion.d.ts +29 -14
  421. package/vue/UiToastRegion.vue +202 -47
  422. package/vue/UiTooltip.d.ts +81 -31
  423. package/vue/UiTooltip.vue +192 -37
  424. package/vue/UiTopBar.vue +33 -2
  425. package/vue/UiTree.d.ts +72 -29
  426. package/vue/UiTree.vue +170 -49
  427. package/vue/UiTreeItem.d.ts +136 -35
  428. package/vue/UiTreeItem.vue +232 -66
  429. package/vue/chunks/UiActionBar.js +16 -3
  430. package/vue/chunks/UiAffordanceScope.js +66 -11
  431. package/vue/chunks/UiAvatar.js +121 -20
  432. package/vue/chunks/UiAvatarGroup.js +94 -15
  433. package/vue/chunks/UiBadge.js +82 -10
  434. package/vue/chunks/UiBreadcrumbItem.js +43 -9
  435. package/vue/chunks/UiBreadcrumbs.js +41 -5
  436. package/vue/chunks/UiButton.js +237 -51
  437. package/vue/chunks/UiCallout.js +53 -11
  438. package/vue/chunks/UiCard.js +145 -18
  439. package/vue/chunks/UiCheckbox.js +130 -30
  440. package/vue/chunks/UiCluster.js +99 -12
  441. package/vue/chunks/UiCombobox.js +545 -162
  442. package/vue/chunks/UiContainer.js +65 -7
  443. package/vue/chunks/UiContextMenu.js +56 -11
  444. package/vue/chunks/UiCover.js +41 -6
  445. package/vue/chunks/UiDescriptionItem.js +39 -4
  446. package/vue/chunks/UiDescriptionList.js +80 -10
  447. package/vue/chunks/UiDialog.js +125 -18
  448. package/vue/chunks/UiDisclosure.js +102 -17
  449. package/vue/chunks/UiEditable.js +154 -29
  450. package/vue/chunks/UiEditorInsertTableGrid.js +154 -31
  451. package/vue/chunks/UiEditorMentionMenu.js +221 -18
  452. package/vue/chunks/UiEditorMentionMenuItem.js +64 -7
  453. package/vue/chunks/UiEditorSlashMenu.js +201 -14
  454. package/vue/chunks/UiEditorSlashMenuGroup.js +43 -9
  455. package/vue/chunks/UiEditorSlashMenuItem.js +80 -14
  456. package/vue/chunks/UiEditorTableContextMenu.js +220 -49
  457. package/vue/chunks/UiEditorTableOverlay.js +390 -85
  458. package/vue/chunks/UiEditorTableToolbar.js +248 -71
  459. package/vue/chunks/UiEditorToolbar.js +44 -10
  460. package/vue/chunks/UiFloatingActionButton.js +57 -9
  461. package/vue/chunks/UiFormField.js +63 -12
  462. package/vue/chunks/UiGrid.js +80 -9
  463. package/vue/chunks/UiIcon.js +73 -16
  464. package/vue/chunks/UiIconButton.js +126 -28
  465. package/vue/chunks/UiInput.js +328 -22
  466. package/vue/chunks/UiInputGroup.js +44 -10
  467. package/vue/chunks/UiList.js +104 -15
  468. package/vue/chunks/UiListItem.js +57 -8
  469. package/vue/chunks/UiListbox.js +208 -49
  470. package/vue/chunks/UiMenu.js +88 -15
  471. package/vue/chunks/UiMenuGroup.js +41 -5
  472. package/vue/chunks/UiMenuItem.js +111 -32
  473. package/vue/chunks/UiMeter.js +166 -36
  474. package/vue/chunks/UiNavItem.js +133 -37
  475. package/vue/chunks/UiPageHeader.js +41 -6
  476. package/vue/chunks/UiPopover.js +81 -11
  477. package/vue/chunks/UiRadio.js +115 -24
  478. package/vue/chunks/UiRadioGroup.js +108 -19
  479. package/vue/chunks/UiReel.js +81 -10
  480. package/vue/chunks/UiScrollArea.js +47 -10
  481. package/vue/chunks/UiSearchResultRow.js +47 -8
  482. package/vue/chunks/UiSearchShell.js +84 -24
  483. package/vue/chunks/UiSection.js +77 -10
  484. package/vue/chunks/UiSelect.js +108 -20
  485. package/vue/chunks/UiSeparator.js +41 -5
  486. package/vue/chunks/UiSidebar.js +136 -20
  487. package/vue/chunks/UiSpinner.js +64 -19
  488. package/vue/chunks/UiStack.js +87 -10
  489. package/vue/chunks/UiStatusMessage.js +82 -12
  490. package/vue/chunks/UiSwitch.js +115 -24
  491. package/vue/chunks/UiSwitcher.js +103 -15
  492. package/vue/chunks/UiTable.js +63 -11
  493. package/vue/chunks/UiTabs.js +170 -30
  494. package/vue/chunks/UiText.js +365 -38
  495. package/vue/chunks/UiTextarea.js +132 -26
  496. package/vue/chunks/UiToast.js +70 -12
  497. package/vue/chunks/UiToastRegion.js +154 -33
  498. package/vue/chunks/UiTooltip.js +124 -16
  499. package/vue/chunks/UiTopBar.js +16 -3
  500. package/vue/chunks/UiTree.js +107 -15
  501. package/vue/chunks/UiTreeItem.js +167 -43
  502. package/vue/chunks/control.js +171 -0
  503. package/vue/chunks/host.js +170 -27
  504. package/vue/chunks/props.js +477 -0
  505. package/vue/components.css +1197 -1197
  506. package/vue/editor/index.js +58 -15
  507. package/vue/editor/primitives.d.ts +52 -2
  508. package/vue/host.ts +370 -39
@@ -1,24 +1,34 @@
1
- <!-- Generated by HTML Next 1.0.0-alpha.7 for Vue 3.5. Do not edit. -->
1
+ <!-- Generated by HTML Next 1.0.0-alpha.11 for Vue 3.5. Do not edit. -->
2
2
  <script setup lang="ts">
3
- import { computed, ref, useTemplateRef } from 'vue'
4
- import * as controllerModule from '../components/ui-combobox/ui-combobox.js'
3
+ import {
4
+ computed,
5
+ defineComponent,
6
+ getCurrentInstance,
7
+ h,
8
+ ref,
9
+ useTemplateRef,
10
+ watchSyncEffect,
11
+ } from 'vue'
12
+ import type { PropType, VNode } from 'vue'
13
+ import { vBindControl } from './control'
5
14
  import { createDispatch, useComponentHost } from './host'
15
+ import { checkedProp } from './props'
6
16
  import UiBadge from './UiBadge.vue'
7
17
  import UiTooltip from './UiTooltip.vue'
8
18
 
9
19
  defineOptions({ inheritAttrs: false })
10
20
 
11
- const props = withDefaults(
12
- defineProps<{
13
- allowCreate?: boolean
14
- allowFreeText?: boolean
15
- clearable?: boolean
16
- disabled?: boolean
17
- disclosure?: boolean
18
- filter?: 'label' | 'none'
19
- help?: string
20
- invalid?: boolean
21
- items?:
21
+ const props = defineProps({
22
+ allowCreate: { type: null as unknown as PropType<boolean | null>, default: false },
23
+ allowFreeText: { type: null as unknown as PropType<boolean | null>, default: false },
24
+ clearable: { type: null as unknown as PropType<boolean | null>, default: false },
25
+ disabled: { type: null as unknown as PropType<boolean | null>, default: false },
26
+ disclosure: { type: null as unknown as PropType<boolean | null>, default: false },
27
+ filter: { type: null as unknown as PropType<'label' | 'none' | null>, default: 'label' },
28
+ help: { type: null as unknown as PropType<string | null>, default: '' },
29
+ invalid: { type: null as unknown as PropType<boolean | null>, default: false },
30
+ items: {
31
+ type: null as unknown as PropType<
22
32
  readonly ({
23
33
  readonly id: string
24
34
  readonly value: string
@@ -31,57 +41,342 @@ const props = withDefaults(
31
41
  readonly tone?: 'neutral' | 'accent' | 'info' | 'success' | 'warning' | 'danger'
32
42
  readonly color?: string
33
43
  }
34
- })[]
35
- label?: string
36
- labelVisibility?: 'visible' | 'sr-only'
37
- loading?: boolean
38
- multiple?: boolean
39
- name?: string
40
- openOnFocus?: boolean
41
- placeholder?: string
42
- query?: string
43
- readonly?: boolean
44
- required?: boolean
45
- selectedValues?: readonly (string)[]
46
- size?: 'sm' | 'md' | 'lg'
47
- tokenSeparators?: readonly (string)[]
48
- value?: string | null
49
- }>(),
50
- {
51
- allowCreate: false,
52
- allowFreeText: false,
53
- clearable: false,
54
- disabled: false,
55
- disclosure: false,
56
- filter: 'label',
57
- help: '',
58
- invalid: false,
59
- label: '',
60
- labelVisibility: 'visible',
61
- loading: false,
62
- multiple: false,
63
- name: '',
64
- openOnFocus: false,
65
- placeholder: '',
66
- readonly: false,
67
- required: false,
68
- size: 'md',
44
+ })[] | null
45
+ >,
46
+ default: null,
69
47
  },
70
- )
48
+ label: { type: null as unknown as PropType<string | null>, default: '' },
49
+ labelVisibility: {
50
+ type: null as unknown as PropType<'visible' | 'sr-only' | null>,
51
+ default: 'visible',
52
+ },
53
+ loading: { type: null as unknown as PropType<boolean | null>, default: false },
54
+ multiple: { type: null as unknown as PropType<boolean | null>, default: false },
55
+ name: { type: null as unknown as PropType<string | null>, default: '' },
56
+ openOnFocus: { type: null as unknown as PropType<boolean | null>, default: false },
57
+ placeholder: { type: null as unknown as PropType<string | null>, default: '' },
58
+ query: { type: null as unknown as PropType<string | null>, default: null },
59
+ readonly: { type: null as unknown as PropType<boolean | null>, default: false },
60
+ required: { type: null as unknown as PropType<boolean | null>, default: false },
61
+ selectedValues: { type: null as unknown as PropType<readonly (string)[] | null>, default: null },
62
+ size: { type: null as unknown as PropType<'sm' | 'md' | 'lg' | null>, default: 'md' },
63
+ tokenSeparators: { type: null as unknown as PropType<readonly (string)[] | null>, default: null },
64
+ value: { type: null as unknown as PropType<string | null>, default: null },
65
+ })
66
+ const checkedProps = computed(() => ({
67
+ allowCreate: checkedProp<boolean>(
68
+ props['allowCreate'],
69
+ { kind: 'terminal', name: 'boolean' },
70
+ false,
71
+ 'allowCreate',
72
+ undefined,
73
+ undefined,
74
+ ) as boolean,
75
+ allowFreeText: checkedProp<boolean>(
76
+ props['allowFreeText'],
77
+ { kind: 'terminal', name: 'boolean' },
78
+ false,
79
+ 'allowFreeText',
80
+ undefined,
81
+ undefined,
82
+ ) as boolean,
83
+ clearable: checkedProp<boolean>(
84
+ props['clearable'],
85
+ { kind: 'terminal', name: 'boolean' },
86
+ false,
87
+ 'clearable',
88
+ undefined,
89
+ undefined,
90
+ ) as boolean,
91
+ disabled: checkedProp<boolean>(
92
+ props['disabled'],
93
+ { kind: 'terminal', name: 'boolean' },
94
+ false,
95
+ 'disabled',
96
+ undefined,
97
+ undefined,
98
+ ) as boolean,
99
+ disclosure: checkedProp<boolean>(
100
+ props['disclosure'],
101
+ { kind: 'terminal', name: 'boolean' },
102
+ false,
103
+ 'disclosure',
104
+ undefined,
105
+ undefined,
106
+ ) as boolean,
107
+ filter: checkedProp<'label' | 'none'>(
108
+ props['filter'],
109
+ { kind: 'terminal', name: 'keyword' },
110
+ false,
111
+ 'filter',
112
+ undefined,
113
+ ['label', 'none'],
114
+ ) as 'label' | 'none',
115
+ help: checkedProp<string>(
116
+ props['help'],
117
+ { kind: 'terminal', name: 'string' },
118
+ false,
119
+ 'help',
120
+ undefined,
121
+ undefined,
122
+ ) as string,
123
+ invalid: checkedProp<boolean>(
124
+ props['invalid'],
125
+ { kind: 'terminal', name: 'boolean' },
126
+ false,
127
+ 'invalid',
128
+ undefined,
129
+ undefined,
130
+ ) as boolean,
131
+ items: checkedProp<
132
+ readonly ({
133
+ readonly id: string
134
+ readonly value: string
135
+ readonly label: string
136
+ readonly group?: string
137
+ readonly disabled?: boolean
138
+ readonly description?: string
139
+ readonly tag?: {
140
+ readonly label: string
141
+ readonly tone?: 'neutral' | 'accent' | 'info' | 'success' | 'warning' | 'danger'
142
+ readonly color?: string
143
+ }
144
+ })[]
145
+ >(
146
+ props['items'],
147
+ {
148
+ kind: 'list',
149
+ item: {
150
+ kind: 'object',
151
+ fields: [
152
+ { name: 'id', type: { kind: 'terminal', name: 'string' }, optional: false },
153
+ { name: 'value', type: { kind: 'terminal', name: 'string' }, optional: false },
154
+ { name: 'label', type: { kind: 'terminal', name: 'string' }, optional: false },
155
+ { name: 'group', type: { kind: 'terminal', name: 'string' }, optional: true },
156
+ { name: 'disabled', type: { kind: 'terminal', name: 'boolean' }, optional: true },
157
+ { name: 'description', type: { kind: 'terminal', name: 'string' }, optional: true },
158
+ {
159
+ name: 'tag',
160
+ type: {
161
+ kind: 'object',
162
+ fields: [{
163
+ name: 'label',
164
+ type: { kind: 'terminal', name: 'string' },
165
+ optional: false,
166
+ }, {
167
+ name: 'tone',
168
+ type: {
169
+ kind: 'constrained',
170
+ base: { kind: 'terminal', name: 'keyword' },
171
+ values: ['neutral', 'accent', 'info', 'success', 'warning', 'danger'],
172
+ },
173
+ optional: true,
174
+ }, { name: 'color', type: { kind: 'terminal', name: 'string' }, optional: true }],
175
+ open: false,
176
+ },
177
+ optional: true,
178
+ },
179
+ ],
180
+ open: false,
181
+ },
182
+ },
183
+ false,
184
+ 'items',
185
+ undefined,
186
+ undefined,
187
+ ),
188
+ label: checkedProp<string>(
189
+ props['label'],
190
+ { kind: 'terminal', name: 'string' },
191
+ false,
192
+ 'label',
193
+ undefined,
194
+ undefined,
195
+ ) as string,
196
+ labelVisibility: checkedProp<'visible' | 'sr-only'>(
197
+ props['labelVisibility'],
198
+ { kind: 'terminal', name: 'keyword' },
199
+ false,
200
+ 'labelVisibility',
201
+ undefined,
202
+ ['visible', 'sr-only'],
203
+ ) as 'visible' | 'sr-only',
204
+ loading: checkedProp<boolean>(
205
+ props['loading'],
206
+ { kind: 'terminal', name: 'boolean' },
207
+ false,
208
+ 'loading',
209
+ undefined,
210
+ undefined,
211
+ ) as boolean,
212
+ multiple: checkedProp<boolean>(
213
+ props['multiple'],
214
+ { kind: 'terminal', name: 'boolean' },
215
+ false,
216
+ 'multiple',
217
+ undefined,
218
+ undefined,
219
+ ) as boolean,
220
+ name: checkedProp<string>(
221
+ props['name'],
222
+ { kind: 'terminal', name: 'string' },
223
+ false,
224
+ 'name',
225
+ undefined,
226
+ undefined,
227
+ ) as string,
228
+ openOnFocus: checkedProp<boolean>(
229
+ props['openOnFocus'],
230
+ { kind: 'terminal', name: 'boolean' },
231
+ false,
232
+ 'openOnFocus',
233
+ undefined,
234
+ undefined,
235
+ ) as boolean,
236
+ placeholder: checkedProp<string>(
237
+ props['placeholder'],
238
+ { kind: 'terminal', name: 'string' },
239
+ false,
240
+ 'placeholder',
241
+ undefined,
242
+ undefined,
243
+ ) as string,
244
+ query: checkedProp<string>(
245
+ props['query'],
246
+ { kind: 'terminal', name: 'string' },
247
+ false,
248
+ 'query',
249
+ undefined,
250
+ undefined,
251
+ ),
252
+ readonly: checkedProp<boolean>(
253
+ props['readonly'],
254
+ { kind: 'terminal', name: 'boolean' },
255
+ false,
256
+ 'readonly',
257
+ undefined,
258
+ undefined,
259
+ ) as boolean,
260
+ required: checkedProp<boolean>(
261
+ props['required'],
262
+ { kind: 'terminal', name: 'boolean' },
263
+ false,
264
+ 'required',
265
+ undefined,
266
+ undefined,
267
+ ) as boolean,
268
+ selectedValues: checkedProp<readonly (string)[]>(
269
+ props['selectedValues'],
270
+ { kind: 'list', item: { kind: 'terminal', name: 'string' } },
271
+ false,
272
+ 'selectedValues',
273
+ undefined,
274
+ undefined,
275
+ ),
276
+ size: checkedProp<'sm' | 'md' | 'lg'>(
277
+ props['size'],
278
+ { kind: 'terminal', name: 'keyword' },
279
+ false,
280
+ 'size',
281
+ undefined,
282
+ ['sm', 'md', 'lg'],
283
+ ) as 'sm' | 'md' | 'lg',
284
+ tokenSeparators: checkedProp<readonly (string)[]>(
285
+ props['tokenSeparators'],
286
+ { kind: 'list', item: { kind: 'terminal', name: 'string' } },
287
+ false,
288
+ 'tokenSeparators',
289
+ undefined,
290
+ undefined,
291
+ ),
292
+ value: checkedProp<string>(
293
+ props['value'],
294
+ { kind: 'terminal', name: 'string' },
295
+ false,
296
+ 'value',
297
+ undefined,
298
+ undefined,
299
+ ),
300
+ }))
301
+ void checkedProps.value
302
+ watchSyncEffect(() => {
303
+ void checkedProps.value
304
+ })
305
+ function nativeAttrs(attrs: Record<string, unknown>): Record<string, unknown> {
306
+ const names = Object.keys(attrs)
307
+ if (!names.some((name) => Object.hasOwn(Object.prototype, name))) return attrs
308
+ return Object.fromEntries(names.map((name) => [
309
+ Object.hasOwn(Object.prototype, name)
310
+ ? name === '__proto__' ? '__Proto__' : name[0]!.toUpperCase() + name.slice(1)
311
+ : name,
312
+ attrs[name],
313
+ ]))
314
+ }
315
+ const KeyedFailure = defineComponent({
316
+ props: { error: { type: null, required: true } },
317
+ setup(props) {
318
+ return () => {
319
+ throw props.error
320
+ }
321
+ },
322
+ })
323
+ const KeyedBoundary = defineComponent({
324
+ setup(_props, { slots }) {
325
+ let last: VNode[] = []
326
+ return () => {
327
+ try {
328
+ last = slots.default?.() ?? []
329
+ return last
330
+ } catch (error) {
331
+ if (
332
+ !(error instanceof Error)
333
+ || (error as Error & { diagnostic?: { code?: string } }).diagnostic?.code !== 'HR004'
334
+ ) throw error
335
+ if (typeof window === 'undefined') throw error
336
+ return [...last, h(KeyedFailure, { error })]
337
+ }
338
+ }
339
+ },
340
+ })
341
+ const componentInstance = getCurrentInstance()
342
+ function reflectedProp(
343
+ name: string,
344
+ kebab: string,
345
+ value: unknown,
346
+ fallback: string | undefined,
347
+ bound: boolean,
348
+ separator?: string,
349
+ ): string | undefined {
350
+ const incoming = componentInstance?.vnode.props
351
+ if (
352
+ !bound
353
+ && (incoming === null || incoming === undefined
354
+ || (!Object.hasOwn(incoming, name) && !Object.hasOwn(incoming, kebab)))
355
+ ) return fallback
356
+ if (value === null || value === undefined) return undefined
357
+ return Array.isArray(value) && separator !== undefined
358
+ ? value.join(separator)
359
+ : typeof value === 'object'
360
+ ? JSON.stringify(value)
361
+ : String(value)
362
+ }
363
+ const hydrationInstance = getCurrentInstance()
71
364
  const emit = defineEmits<{
72
365
  'update:query': [value: string]
73
366
  'update:selectedValues': [value: readonly (string)[]]
74
- 'update:value': [value: string | null]
367
+ 'update:value': [value: string]
75
368
  'query-change': [
76
- detail: {
77
- readonly query: string
78
- readonly display: string
79
- readonly trigger: 'keyboard' | 'pointer' | 'programmatic'
80
- },
369
+ event: CustomEvent<
370
+ {
371
+ readonly query: string
372
+ readonly display: string
373
+ readonly trigger: 'keyboard' | 'pointer' | 'programmatic'
374
+ }
375
+ >,
81
376
  ]
82
377
  'value-change': [
83
- detail:
84
- | {
378
+ event: CustomEvent<
379
+ {
85
380
  readonly value: string | null
86
381
  readonly query: string
87
382
  readonly option: {
@@ -100,7 +395,11 @@ const emit = defineEmits<{
100
395
  readonly kind: 'selection' | 'clear' | 'free-entry' | 'create'
101
396
  readonly trigger: 'keyboard' | 'pointer' | 'programmatic'
102
397
  }
103
- | readonly ({
398
+ >,
399
+ ]
400
+ 'items-change': [
401
+ event: CustomEvent<
402
+ readonly ({
104
403
  readonly id: string
105
404
  readonly value: string
106
405
  readonly label: string
@@ -112,66 +411,73 @@ const emit = defineEmits<{
112
411
  readonly tone?: 'neutral' | 'accent' | 'info' | 'success' | 'warning' | 'danger'
113
412
  readonly color?: string
114
413
  }
115
- })[],
414
+ })[]
415
+ >,
116
416
  ]
117
417
  'free-entry': [
118
- detail: {
119
- readonly value: string | null
120
- readonly query: string
121
- readonly option: {
122
- readonly id: string
123
- readonly value: string
124
- readonly label: string
125
- readonly group?: string
126
- readonly disabled?: boolean
127
- readonly description?: string
128
- readonly tag?: {
418
+ event: CustomEvent<
419
+ {
420
+ readonly value: string | null
421
+ readonly query: string
422
+ readonly option: {
423
+ readonly id: string
424
+ readonly value: string
129
425
  readonly label: string
130
- readonly tone?: 'neutral' | 'accent' | 'info' | 'success' | 'warning' | 'danger'
131
- readonly color?: string
132
- }
133
- } | null
134
- readonly kind: 'selection' | 'clear' | 'free-entry' | 'create'
135
- readonly trigger: 'keyboard' | 'pointer' | 'programmatic'
136
- },
426
+ readonly group?: string
427
+ readonly disabled?: boolean
428
+ readonly description?: string
429
+ readonly tag?: {
430
+ readonly label: string
431
+ readonly tone?: 'neutral' | 'accent' | 'info' | 'success' | 'warning' | 'danger'
432
+ readonly color?: string
433
+ }
434
+ } | null
435
+ readonly kind: 'selection' | 'clear' | 'free-entry' | 'create'
436
+ readonly trigger: 'keyboard' | 'pointer' | 'programmatic'
437
+ }
438
+ >,
137
439
  ]
138
440
  'create-entry': [
139
- detail: {
140
- readonly value: string | null
141
- readonly query: string
142
- readonly option: {
143
- readonly id: string
144
- readonly value: string
145
- readonly label: string
146
- readonly group?: string
147
- readonly disabled?: boolean
148
- readonly description?: string
149
- readonly tag?: {
441
+ event: CustomEvent<
442
+ {
443
+ readonly value: string | null
444
+ readonly query: string
445
+ readonly option: {
446
+ readonly id: string
447
+ readonly value: string
150
448
  readonly label: string
151
- readonly tone?: 'neutral' | 'accent' | 'info' | 'success' | 'warning' | 'danger'
152
- readonly color?: string
153
- }
154
- } | null
155
- readonly kind: 'selection' | 'clear' | 'free-entry' | 'create'
156
- readonly trigger: 'keyboard' | 'pointer' | 'programmatic'
157
- },
449
+ readonly group?: string
450
+ readonly disabled?: boolean
451
+ readonly description?: string
452
+ readonly tag?: {
453
+ readonly label: string
454
+ readonly tone?: 'neutral' | 'accent' | 'info' | 'success' | 'warning' | 'danger'
455
+ readonly color?: string
456
+ }
457
+ } | null
458
+ readonly kind: 'selection' | 'clear' | 'free-entry' | 'create'
459
+ readonly trigger: 'keyboard' | 'pointer' | 'programmatic'
460
+ }
461
+ >,
158
462
  ]
159
463
  'validation-change': [
160
- detail: {
161
- readonly status: 'pristine' | 'pending' | 'valid' | 'warning' | 'error'
162
- readonly touched: boolean
163
- readonly dirty: boolean
164
- readonly issues:
165
- readonly ({
166
- readonly message: string
167
- readonly path?: readonly (unknown)[]
168
- readonly severity?: 'error' | 'warning'
169
- })[]
170
- readonly output?: unknown
171
- },
464
+ event: CustomEvent<
465
+ {
466
+ readonly status: 'pristine' | 'pending' | 'valid' | 'warning' | 'error'
467
+ readonly touched: boolean
468
+ readonly dirty: boolean
469
+ readonly issues:
470
+ readonly ({
471
+ readonly message: string
472
+ readonly path?: readonly (unknown)[]
473
+ readonly severity?: 'error' | 'warning'
474
+ })[]
475
+ readonly output?: unknown
476
+ }
477
+ >,
172
478
  ]
173
479
  'options-change': [
174
- detail:
480
+ event: CustomEvent<
175
481
  readonly ({
176
482
  readonly id: string
177
483
  readonly value: string
@@ -184,54 +490,63 @@ const emit = defineEmits<{
184
490
  readonly tone?: 'neutral' | 'accent' | 'info' | 'success' | 'warning' | 'danger'
185
491
  readonly color?: string
186
492
  }
187
- })[],
493
+ })[]
494
+ >,
188
495
  ]
189
496
  'add-item': [
190
- detail: {
191
- readonly item: {
192
- readonly id: string
193
- readonly value: string
194
- readonly label: string
195
- readonly group?: string
196
- readonly disabled?: boolean
197
- readonly description?: string
198
- readonly tag?: {
497
+ event: CustomEvent<
498
+ {
499
+ readonly item: {
500
+ readonly id: string
501
+ readonly value: string
199
502
  readonly label: string
200
- readonly tone?: 'neutral' | 'accent' | 'info' | 'success' | 'warning' | 'danger'
201
- readonly color?: string
503
+ readonly group?: string
504
+ readonly disabled?: boolean
505
+ readonly description?: string
506
+ readonly tag?: {
507
+ readonly label: string
508
+ readonly tone?: 'neutral' | 'accent' | 'info' | 'success' | 'warning' | 'danger'
509
+ readonly color?: string
510
+ }
202
511
  }
512
+ readonly index: number
513
+ readonly trigger: 'keyboard' | 'pointer' | 'programmatic'
203
514
  }
204
- readonly index: number
205
- readonly trigger: 'keyboard' | 'pointer' | 'programmatic'
206
- },
515
+ >,
207
516
  ]
208
517
  'remove-item': [
209
- detail: {
210
- readonly item: {
211
- readonly id: string
212
- readonly value: string
213
- readonly label: string
214
- readonly group?: string
215
- readonly disabled?: boolean
216
- readonly description?: string
217
- readonly tag?: {
518
+ event: CustomEvent<
519
+ {
520
+ readonly item: {
521
+ readonly id: string
522
+ readonly value: string
218
523
  readonly label: string
219
- readonly tone?: 'neutral' | 'accent' | 'info' | 'success' | 'warning' | 'danger'
220
- readonly color?: string
524
+ readonly group?: string
525
+ readonly disabled?: boolean
526
+ readonly description?: string
527
+ readonly tag?: {
528
+ readonly label: string
529
+ readonly tone?: 'neutral' | 'accent' | 'info' | 'success' | 'warning' | 'danger'
530
+ readonly color?: string
531
+ }
221
532
  }
533
+ readonly index: number
534
+ readonly trigger: 'keyboard' | 'pointer' | 'programmatic'
222
535
  }
223
- readonly index: number
224
- readonly trigger: 'keyboard' | 'pointer' | 'programmatic'
225
- },
536
+ >,
226
537
  ]
227
538
  'create-item': [
228
- detail: { readonly query: string; readonly trigger: 'keyboard' | 'pointer' | 'programmatic' },
539
+ event: CustomEvent<
540
+ { readonly query: string; readonly trigger: 'keyboard' | 'pointer' | 'programmatic' }
541
+ >,
229
542
  ]
230
543
  'selected-values-change': [
231
- detail: {
232
- readonly selectedValues: readonly (string)[]
233
- readonly trigger: 'keyboard' | 'pointer' | 'programmatic'
234
- },
544
+ event: CustomEvent<
545
+ {
546
+ readonly selectedValues: readonly (string)[]
547
+ readonly trigger: 'keyboard' | 'pointer' | 'programmatic'
548
+ }
549
+ >,
235
550
  ]
236
551
  }>()
237
552
 
@@ -319,15 +634,50 @@ const createIndex = ref(0)
319
634
  const message = ref('')
320
635
  const statusText = ref('')
321
636
  const validationStatus = ref('pristine')
637
+ let guardedPrevious: any
638
+ const guarded = computed(() => {
639
+ if (
640
+ !(internalItems.value?.['0'] == null
641
+ || (typeof internalItems.value?.['0'] === 'object' && internalItems.value?.['0'] !== null
642
+ && !Array.isArray(internalItems.value?.['0'])))
643
+ ) return guardedPrevious
644
+ return guardedPrevious = checkedProps.value.required
645
+ && !(checkedProps.value.multiple && internalItems.value[0])
646
+ })
647
+ let guardedBindingPrevious: any
648
+ const guardedBinding = computed(() => {
649
+ if (
650
+ !(selected.value == null || (typeof selected.value === 'string' || selected.value === null))
651
+ ) return guardedBindingPrevious
652
+ return guardedBindingPrevious = checkedProps.value.disabled || checkedProps.value.readonly
653
+ || (!raw.value && (checkedProps.value.multiple || selected.value === null))
654
+ })
655
+ const hydrationNode = hydrationInstance?.vnode.el
656
+ if (
657
+ typeof window !== 'undefined' && hydrationNode != null
658
+ && (!(hydrationNode instanceof Element) || hydrationNode.localName !== ('div'))
659
+ ) {
660
+ throw Object.assign(
661
+ new Error('HR005: Server markup for <ui-combobox> has an incompatible root.'),
662
+ {
663
+ name: 'HtmlDiagnosticError',
664
+ diagnostic: Object.freeze({
665
+ code: 'HR005',
666
+ message: 'Server markup for <ui-combobox> has an incompatible root.',
667
+ }),
668
+ },
669
+ )
670
+ }
322
671
 
323
672
  /** The values the styles' :host-state() rules test. */
324
673
  const hostState = computed(() =>
325
674
  [
326
- props.size && `size size=${props.size}`,
675
+ checkedProps.value.size && 'size',
676
+ checkedProps.value.size != null && `size=${encodeURIComponent(checkedProps.value.size)}`,
327
677
  validationStatus.value && 'validationStatus',
328
678
  `validationStatus=${encodeURIComponent(validationStatus.value)}`,
329
- props.invalid && 'invalid',
330
- props.multiple && 'multiple',
679
+ checkedProps.value.invalid && 'invalid',
680
+ checkedProps.value.multiple && 'multiple',
331
681
  ].filter(Boolean).join(' ')
332
682
  )
333
683
 
@@ -340,137 +690,6 @@ const isQueryChangeDetail = (detail: unknown): boolean =>
340
690
  || (detail as Record<string, unknown>)['trigger'] === 'programmatic')
341
691
  && Object.keys(detail as object).every((key) => ['query', 'display', 'trigger'].includes(key))
342
692
  const isValueChangeDetail = (detail: unknown): boolean =>
343
- (detail !== null && typeof detail === 'object' && !Array.isArray(detail)
344
- && (typeof (detail as Record<string, unknown>)['value'] === 'string'
345
- || (detail as Record<string, unknown>)['value'] === null)
346
- && typeof (detail as Record<string, unknown>)['query'] === 'string'
347
- && (((detail as Record<string, unknown>)['option'] !== null
348
- && typeof (detail as Record<string, unknown>)['option'] === 'object'
349
- && !Array.isArray((detail as Record<string, unknown>)['option'])
350
- && typeof ((detail as Record<string, unknown>)['option'] as Record<string, unknown>)['id']
351
- === 'string'
352
- && typeof ((detail as Record<string, unknown>)['option'] as Record<string, unknown>)['value']
353
- === 'string'
354
- && typeof ((detail as Record<string, unknown>)['option'] as Record<string, unknown>)['label']
355
- === 'string'
356
- && (((detail as Record<string, unknown>)['option'] as Record<string, unknown>)['group']
357
- === undefined
358
- || typeof ((detail as Record<string, unknown>)['option'] as Record<string, unknown>)[
359
- 'group'
360
- ] === 'string')
361
- && (((detail as Record<string, unknown>)['option'] as Record<string, unknown>)['disabled']
362
- === undefined
363
- || typeof ((detail as Record<string, unknown>)['option'] as Record<string, unknown>)[
364
- 'disabled'
365
- ] === 'boolean')
366
- && (((detail as Record<string, unknown>)['option'] as Record<string, unknown>)['description']
367
- === undefined
368
- || typeof ((detail as Record<string, unknown>)['option'] as Record<string, unknown>)[
369
- 'description'
370
- ] === 'string')
371
- && (((detail as Record<string, unknown>)['option'] as Record<string, unknown>)['tag']
372
- === undefined
373
- || (((detail as Record<string, unknown>)['option'] as Record<string, unknown>)['tag']
374
- !== null
375
- && typeof ((detail as Record<string, unknown>)['option'] as Record<string, unknown>)[
376
- 'tag'
377
- ] === 'object'
378
- && !Array.isArray(
379
- ((detail as Record<string, unknown>)['option'] as Record<string, unknown>)['tag'],
380
- )
381
- && typeof (((detail as Record<string, unknown>)['option'] as Record<string, unknown>)[
382
- 'tag'
383
- ] as Record<string, unknown>)['label'] === 'string'
384
- && ((((detail as Record<string, unknown>)['option'] as Record<string, unknown>)[
385
- 'tag'
386
- ] as Record<string, unknown>)['tone'] === undefined
387
- || ((((detail as Record<string, unknown>)['option'] as Record<string, unknown>)[
388
- 'tag'
389
- ] as Record<string, unknown>)['tone'] === 'neutral'
390
- || (((detail as Record<string, unknown>)['option'] as Record<string, unknown>)[
391
- 'tag'
392
- ] as Record<string, unknown>)['tone'] === 'accent'
393
- || (((detail as Record<string, unknown>)['option'] as Record<string, unknown>)[
394
- 'tag'
395
- ] as Record<string, unknown>)['tone'] === 'info'
396
- || (((detail as Record<string, unknown>)['option'] as Record<string, unknown>)[
397
- 'tag'
398
- ] as Record<string, unknown>)['tone'] === 'success'
399
- || (((detail as Record<string, unknown>)['option'] as Record<string, unknown>)[
400
- 'tag'
401
- ] as Record<string, unknown>)['tone'] === 'warning'
402
- || (((detail as Record<string, unknown>)['option'] as Record<string, unknown>)[
403
- 'tag'
404
- ] as Record<string, unknown>)['tone'] === 'danger'))
405
- && ((((detail as Record<string, unknown>)['option'] as Record<string, unknown>)[
406
- 'tag'
407
- ] as Record<string, unknown>)['color'] === undefined
408
- || typeof (((detail as Record<string, unknown>)['option'] as Record<string, unknown>)[
409
- 'tag'
410
- ] as Record<string, unknown>)['color'] === 'string')
411
- && Object.keys(
412
- ((detail as Record<string, unknown>)['option'] as Record<string, unknown>)[
413
- 'tag'
414
- ] as object,
415
- ).every((key) => ['label', 'tone', 'color'].includes(key))))
416
- && Object.keys((detail as Record<string, unknown>)['option'] as object).every((key) =>
417
- ['id', 'value', 'label', 'group', 'disabled', 'description', 'tag'].includes(key)
418
- )) || (detail as Record<string, unknown>)['option'] === null)
419
- && ((detail as Record<string, unknown>)['kind'] === 'selection'
420
- || (detail as Record<string, unknown>)['kind'] === 'clear'
421
- || (detail as Record<string, unknown>)['kind'] === 'free-entry'
422
- || (detail as Record<string, unknown>)['kind'] === 'create')
423
- && ((detail as Record<string, unknown>)['trigger'] === 'keyboard'
424
- || (detail as Record<string, unknown>)['trigger'] === 'pointer'
425
- || (detail as Record<string, unknown>)['trigger'] === 'programmatic')
426
- && Object.keys(detail as object).every((key) =>
427
- ['value', 'query', 'option', 'kind', 'trigger'].includes(key)
428
- ))
429
- || (Array.isArray(detail)
430
- && (detail as unknown[]).every((
431
- item: unknown,
432
- ) => (item !== null && typeof item === 'object' && !Array.isArray(item)
433
- && typeof (item as Record<string, unknown>)['id'] === 'string'
434
- && typeof (item as Record<string, unknown>)['value'] === 'string'
435
- && typeof (item as Record<string, unknown>)['label'] === 'string'
436
- && ((item as Record<string, unknown>)['group'] === undefined
437
- || typeof (item as Record<string, unknown>)['group'] === 'string')
438
- && ((item as Record<string, unknown>)['disabled'] === undefined
439
- || typeof (item as Record<string, unknown>)['disabled'] === 'boolean')
440
- && ((item as Record<string, unknown>)['description'] === undefined
441
- || typeof (item as Record<string, unknown>)['description'] === 'string')
442
- && ((item as Record<string, unknown>)['tag'] === undefined
443
- || ((item as Record<string, unknown>)['tag'] !== null
444
- && typeof (item as Record<string, unknown>)['tag'] === 'object'
445
- && !Array.isArray((item as Record<string, unknown>)['tag'])
446
- && typeof ((item as Record<string, unknown>)['tag'] as Record<string, unknown>)['label']
447
- === 'string'
448
- && (((item as Record<string, unknown>)['tag'] as Record<string, unknown>)['tone']
449
- === undefined
450
- || (((item as Record<string, unknown>)['tag'] as Record<string, unknown>)['tone']
451
- === 'neutral'
452
- || ((item as Record<string, unknown>)['tag'] as Record<string, unknown>)['tone']
453
- === 'accent'
454
- || ((item as Record<string, unknown>)['tag'] as Record<string, unknown>)['tone']
455
- === 'info'
456
- || ((item as Record<string, unknown>)['tag'] as Record<string, unknown>)['tone']
457
- === 'success'
458
- || ((item as Record<string, unknown>)['tag'] as Record<string, unknown>)['tone']
459
- === 'warning'
460
- || ((item as Record<string, unknown>)['tag'] as Record<string, unknown>)['tone']
461
- === 'danger'))
462
- && (((item as Record<string, unknown>)['tag'] as Record<string, unknown>)['color']
463
- === undefined
464
- || typeof ((item as Record<string, unknown>)['tag'] as Record<string, unknown>)['color']
465
- === 'string')
466
- && Object.keys((item as Record<string, unknown>)['tag'] as object).every((key) =>
467
- ['label', 'tone', 'color'].includes(key)
468
- )))
469
- && Object.keys(item as object).every((key) =>
470
- ['id', 'value', 'label', 'group', 'disabled', 'description', 'tag'].includes(key)
471
- ))
472
- ))
473
- const isFreeEntryDetail = (detail: unknown): boolean =>
474
693
  detail !== null && typeof detail === 'object' && !Array.isArray(detail)
475
694
  && (typeof (detail as Record<string, unknown>)['value'] === 'string'
476
695
  || (detail as Record<string, unknown>)['value'] === null)
@@ -555,37 +774,7 @@ const isFreeEntryDetail = (detail: unknown): boolean =>
555
774
  && Object.keys(detail as object).every((key) =>
556
775
  ['value', 'query', 'option', 'kind', 'trigger'].includes(key)
557
776
  )
558
- const isValidationChangeDetail = (detail: unknown): boolean =>
559
- detail !== null && typeof detail === 'object' && !Array.isArray(detail)
560
- && ((detail as Record<string, unknown>)['status'] === 'pristine'
561
- || (detail as Record<string, unknown>)['status'] === 'pending'
562
- || (detail as Record<string, unknown>)['status'] === 'valid'
563
- || (detail as Record<string, unknown>)['status'] === 'warning'
564
- || (detail as Record<string, unknown>)['status'] === 'error')
565
- && typeof (detail as Record<string, unknown>)['touched'] === 'boolean'
566
- && typeof (detail as Record<string, unknown>)['dirty'] === 'boolean'
567
- && (Array.isArray((detail as Record<string, unknown>)['issues'])
568
- && ((detail as Record<string, unknown>)['issues'] as unknown[]).every((
569
- item: unknown,
570
- ) => (item !== null && typeof item === 'object' && !Array.isArray(item)
571
- && typeof (item as Record<string, unknown>)['message'] === 'string'
572
- && ((item as Record<string, unknown>)['path'] === undefined
573
- || (Array.isArray((item as Record<string, unknown>)['path'])
574
- && ((item as Record<string, unknown>)['path'] as unknown[]).every((item: unknown) =>
575
- true
576
- )))
577
- && ((item as Record<string, unknown>)['severity'] === undefined
578
- || ((item as Record<string, unknown>)['severity'] === 'error'
579
- || (item as Record<string, unknown>)['severity'] === 'warning'))
580
- && Object.keys(item as object).every((key) =>
581
- ['message', 'path', 'severity'].includes(key)
582
- ))
583
- ))
584
- && ((detail as Record<string, unknown>)['output'] === undefined || true)
585
- && Object.keys(detail as object).every((key) =>
586
- ['status', 'touched', 'dirty', 'issues', 'output'].includes(key)
587
- )
588
- const isOptionsChangeDetail = (detail: unknown): boolean =>
777
+ const isItemsChangeDetail = (detail: unknown): boolean =>
589
778
  Array.isArray(detail)
590
779
  && (detail as unknown[]).every((
591
780
  item: unknown,
@@ -630,6 +819,36 @@ const isOptionsChangeDetail = (detail: unknown): boolean =>
630
819
  ['id', 'value', 'label', 'group', 'disabled', 'description', 'tag'].includes(key)
631
820
  ))
632
821
  )
822
+ const isValidationChangeDetail = (detail: unknown): boolean =>
823
+ detail !== null && typeof detail === 'object' && !Array.isArray(detail)
824
+ && ((detail as Record<string, unknown>)['status'] === 'pristine'
825
+ || (detail as Record<string, unknown>)['status'] === 'pending'
826
+ || (detail as Record<string, unknown>)['status'] === 'valid'
827
+ || (detail as Record<string, unknown>)['status'] === 'warning'
828
+ || (detail as Record<string, unknown>)['status'] === 'error')
829
+ && typeof (detail as Record<string, unknown>)['touched'] === 'boolean'
830
+ && typeof (detail as Record<string, unknown>)['dirty'] === 'boolean'
831
+ && (Array.isArray((detail as Record<string, unknown>)['issues'])
832
+ && ((detail as Record<string, unknown>)['issues'] as unknown[]).every((
833
+ item: unknown,
834
+ ) => (item !== null && typeof item === 'object' && !Array.isArray(item)
835
+ && typeof (item as Record<string, unknown>)['message'] === 'string'
836
+ && ((item as Record<string, unknown>)['path'] === undefined
837
+ || (Array.isArray((item as Record<string, unknown>)['path'])
838
+ && ((item as Record<string, unknown>)['path'] as unknown[]).every((item: unknown) =>
839
+ true
840
+ )))
841
+ && ((item as Record<string, unknown>)['severity'] === undefined
842
+ || ((item as Record<string, unknown>)['severity'] === 'error'
843
+ || (item as Record<string, unknown>)['severity'] === 'warning'))
844
+ && Object.keys(item as object).every((key) =>
845
+ ['message', 'path', 'severity'].includes(key)
846
+ ))
847
+ ))
848
+ && ((detail as Record<string, unknown>)['output'] === undefined || true)
849
+ && Object.keys(detail as object).every((key) =>
850
+ ['status', 'touched', 'dirty', 'issues', 'output'].includes(key)
851
+ )
633
852
  const isAddItemDetail = (detail: unknown): boolean =>
634
853
  detail !== null && typeof detail === 'object' && !Array.isArray(detail)
635
854
  && ((detail as Record<string, unknown>)['item'] !== null
@@ -727,10 +946,11 @@ const dispatch = createDispatch(root, emit as (name: string, detail: unknown) =>
727
946
  checks: {
728
947
  'query-change': isQueryChangeDetail,
729
948
  'value-change': isValueChangeDetail,
730
- 'free-entry': isFreeEntryDetail,
731
- 'create-entry': isFreeEntryDetail,
949
+ 'items-change': isItemsChangeDetail,
950
+ 'free-entry': isValueChangeDetail,
951
+ 'create-entry': isValueChangeDetail,
732
952
  'validation-change': isValidationChangeDetail,
733
- 'options-change': isOptionsChangeDetail,
953
+ 'options-change': isItemsChangeDetail,
734
954
  'add-item': isAddItemDetail,
735
955
  'remove-item': isAddItemDetail,
736
956
  'create-item': isCreateItemDetail,
@@ -739,10 +959,14 @@ const dispatch = createDispatch(root, emit as (name: string, detail: unknown) =>
739
959
  modeled: ['query', 'selectedValues', 'value'],
740
960
  })
741
961
 
742
- const { host, ready } = useComponentHost(controllerModule.default, {
962
+ const { host, ready } = useComponentHost(() => import('../components/ui-combobox/ui-combobox.js'), {
743
963
  root,
744
964
  dispatch,
745
- props,
965
+ controllerSource: {
966
+ specifier: '../components/ui-combobox/ui-combobox.js',
967
+ definition: './components/ui-combobox/ui-combobox.html',
968
+ },
969
+ props: checkedProps,
746
970
  refs: {
747
971
  field: fieldElement,
748
972
  input: inputElement,
@@ -774,86 +998,165 @@ const { host, ready } = useComponentHost(controllerModule.default, {
774
998
 
775
999
  defineExpose({
776
1000
  validate: async (...args: unknown[]) => {
777
- await ready()
778
- return (controllerModule as Record<string, (...values: unknown[]) => unknown>)['validate']!(
779
- host,
780
- ...args,
781
- )
1001
+ const controllerModule = await ready()
1002
+ if (controllerModule === undefined) {
1003
+ throw new TypeError('Controller method `validate` is not ready for <ui-combobox>.')
1004
+ }
1005
+ const method = Reflect.get(controllerModule, 'validate')
1006
+ if (typeof method !== 'function') {
1007
+ throw Object.assign(new Error('HJ003: Controller does not export method `validate`.'), {
1008
+ name: 'HtmlDiagnosticError',
1009
+ diagnostic: Object.freeze({
1010
+ code: 'HJ003',
1011
+ message: 'Controller does not export method `validate`.',
1012
+ }),
1013
+ })
1014
+ }
1015
+ return method(host, ...args)
782
1016
  },
783
1017
  focusInput: async (...args: unknown[]) => {
784
- await ready()
785
- return (controllerModule as Record<string, (...values: unknown[]) => unknown>)['focusInput']!(
786
- host,
787
- ...args,
788
- )
1018
+ const controllerModule = await ready()
1019
+ if (controllerModule === undefined) {
1020
+ throw new TypeError('Controller method `focusInput` is not ready for <ui-combobox>.')
1021
+ }
1022
+ const method = Reflect.get(controllerModule, 'focusInput')
1023
+ if (typeof method !== 'function') {
1024
+ throw Object.assign(new Error('HJ003: Controller does not export method `focusInput`.'), {
1025
+ name: 'HtmlDiagnosticError',
1026
+ diagnostic: Object.freeze({
1027
+ code: 'HJ003',
1028
+ message: 'Controller does not export method `focusInput`.',
1029
+ }),
1030
+ })
1031
+ }
1032
+ return method(host, ...args)
789
1033
  },
790
1034
  })
1035
+
1036
+ function text(value: unknown): string {
1037
+ if (Array.isArray(value)) return value.map(text).join(' ')
1038
+ return value === null || value === undefined || typeof value === 'object' ? '' : String(value)
1039
+ }
1040
+
1041
+ function uniqueKeys<T>(
1042
+ items: readonly T[],
1043
+ keyOf: (
1044
+ item: T,
1045
+ index: number,
1046
+ loop: { index: number; first: boolean; last: boolean; count: number },
1047
+ ) => unknown,
1048
+ ): readonly T[] {
1049
+ const seen = new Set<unknown>()
1050
+ for (let index = 0; index < items.length; index += 1) {
1051
+ const key = keyOf(items[index]!, index, {
1052
+ index,
1053
+ first: index === 0,
1054
+ last: index === items.length - 1,
1055
+ count: items.length,
1056
+ })
1057
+ if (seen.has(key)) {
1058
+ const message = `A keyed list produced duplicate key \`${text(key)}\`.`
1059
+ throw Object.assign(new Error(`HR004: ${message}`), {
1060
+ name: 'HtmlDiagnosticError',
1061
+ diagnostic: Object.freeze({ code: 'HR004', message }),
1062
+ })
1063
+ }
1064
+ seen.add(key)
1065
+ }
1066
+ return items
1067
+ }
791
1068
  </script>
792
1069
 
793
1070
  <template>
794
1071
  <div
795
1072
  data-component="ui-combobox"
796
- v-bind="$attrs"
1073
+ v-bind="nativeAttrs($attrs)"
1074
+ :data-allow-create="reflectedProp('allowCreate', 'allow-create', checkedProps.allowCreate, undefined, false)"
1075
+ :data-allow-free-text="reflectedProp('allowFreeText', 'allow-free-text', checkedProps.allowFreeText, undefined, false)"
1076
+ :data-clearable="reflectedProp('clearable', 'clearable', checkedProps.clearable, undefined, false)"
1077
+ :data-disabled="reflectedProp('disabled', 'disabled', checkedProps.disabled, undefined, false)"
1078
+ :data-disclosure="reflectedProp('disclosure', 'disclosure', checkedProps.disclosure, undefined, false)"
1079
+ :data-filter="reflectedProp('filter', 'filter', checkedProps.filter, undefined, false)"
1080
+ :data-help="reflectedProp('help', 'help', checkedProps.help, undefined, false)"
1081
+ :data-invalid="reflectedProp('invalid', 'invalid', checkedProps.invalid, undefined, false)"
1082
+ :data-items="reflectedProp('items', 'items', checkedProps.items, undefined, false)"
1083
+ :data-label="reflectedProp('label', 'label', checkedProps.label, undefined, false)"
1084
+ :data-label-visibility="reflectedProp('labelVisibility', 'label-visibility', checkedProps.labelVisibility, undefined, false)"
1085
+ :data-loading="reflectedProp('loading', 'loading', checkedProps.loading, undefined, false)"
1086
+ :data-multiple="reflectedProp('multiple', 'multiple', checkedProps.multiple, undefined, false)"
1087
+ :data-name="reflectedProp('name', 'name', checkedProps.name, undefined, false)"
1088
+ :data-open-on-focus="reflectedProp('openOnFocus', 'open-on-focus', checkedProps.openOnFocus, undefined, false)"
1089
+ :data-placeholder="reflectedProp('placeholder', 'placeholder', checkedProps.placeholder, undefined, false)"
1090
+ :data-query="reflectedProp('query', 'query', checkedProps.query, undefined, false)"
1091
+ :data-readonly="reflectedProp('readonly', 'readonly', checkedProps.readonly, undefined, false)"
1092
+ :data-required="reflectedProp('required', 'required', checkedProps.required, undefined, false)"
1093
+ :data-selected-values="reflectedProp('selectedValues', 'selected-values', checkedProps.selectedValues, undefined, false)"
1094
+ :data-size="reflectedProp('size', 'size', checkedProps.size, undefined, false)"
1095
+ :data-token-separators="reflectedProp('tokenSeparators', 'token-separators', checkedProps.tokenSeparators, undefined, false)"
1096
+ :data-value="reflectedProp('value', 'value', checkedProps.value, undefined, false)"
797
1097
  :data-ui-combobox-state="hostState || undefined"
798
1098
  ref="root"
799
1099
  >
800
- <label :for="`${uid}-input`" :class="{ 'sr-only': labelVisibility === 'sr-only' }">{{ label }}
801
- <template v-if="required">
1100
+ <label
1101
+ :for="`${uid}-input`"
1102
+ :class="{ 'sr-only': checkedProps.labelVisibility === 'sr-only' }"
1103
+ >{{ checkedProps.label }}
1104
+ <template v-if="checkedProps.required">
802
1105
  *</template></label>
803
1106
  <div class="control">
804
1107
  <div class="field" ref="field">
805
1108
  <div class="entry">
806
1109
  <slot name="start" />
807
- <template v-if="multiple"><button
808
- v-for="(item, index) in internalItems"
809
- :key="item.id"
810
- class="item"
811
- type="button"
812
- tabindex="-1"
813
- :data-index="index"
814
- :disabled="disabled || readonly || item.disabled"
815
- :aria-label="`${item.label}, press Delete or Backspace to remove`"
816
- >
817
- <slot :name="`item-${item.id}`"><UiBadge>{{ item.label }}</UiBadge></slot>
818
- </button></template>
1110
+ <template v-if="checkedProps.multiple"><KeyedBoundary><button
1111
+ v-for="(item, index) in uniqueKeys(internalItems, (item, index, loop) => item.id)"
1112
+ :key="item.id"
1113
+ class="item"
1114
+ type="button"
1115
+ tabindex="-1"
1116
+ :data-index="index"
1117
+ :disabled="checkedProps.disabled || checkedProps.readonly || item.disabled"
1118
+ :aria-label="`${item.label}, press Delete or Backspace to remove`"
1119
+ >
1120
+ <slot :name="`item-${item.id}`"><UiBadge>{{ item.label }}</UiBadge></slot>
1121
+ </button></KeyedBoundary></template>
819
1122
  <input
820
1123
  role="combobox"
821
1124
  aria-autocomplete="list"
822
1125
  autocomplete="off"
1126
+ v-bind-control="{ tag: 'input', name: 'value', value: display, nativeProperty: true, defaultValue: '' }"
823
1127
  :id="`${uid}-input`"
824
1128
  :aria-controls="`${uid}-listbox`"
825
1129
  :aria-expanded="expanded"
826
- :aria-invalid="invalid || validationStatus === 'error'"
827
- :aria-busy="loading || validationStatus === 'pending'"
828
- :value.prop="display"
829
- :placeholder="placeholder"
830
- :disabled="disabled"
831
- :readonly="readonly"
832
- :required="required && !(multiple && internalItems[0])"
1130
+ :aria-invalid="checkedProps.invalid || validationStatus === 'error'"
1131
+ :aria-busy="checkedProps.loading || validationStatus === 'pending'"
1132
+ :placeholder="checkedProps.placeholder ?? undefined"
1133
+ :disabled="checkedProps.disabled ?? undefined"
1134
+ :readonly="checkedProps.readonly ?? undefined"
1135
+ :required="guarded"
833
1136
  ref="input"
834
1137
  >
835
1138
  </div>
836
1139
  <input
837
- v-if="name && !multiple"
1140
+ v-if="checkedProps.name && !checkedProps.multiple"
838
1141
  type="hidden"
839
- :name="name"
840
- :value="submitted"
841
- :disabled="disabled"
1142
+ :name="checkedProps.name ?? undefined"
1143
+ :value.attr="submitted"
1144
+ :disabled="checkedProps.disabled ?? undefined"
842
1145
  >
843
- <template v-if="name && multiple"><input
844
- v-for="item in internalItems"
845
- :key="item.id"
846
- type="hidden"
847
- :name="name"
848
- :value="item.value"
849
- :disabled="disabled"
850
- ></template>
1146
+ <template v-if="checkedProps.name && checkedProps.multiple"><KeyedBoundary><input
1147
+ v-for="item in uniqueKeys(internalItems, (item, index, loop) => item.id)"
1148
+ :key="item.id"
1149
+ type="hidden"
1150
+ :name="checkedProps.name ?? undefined"
1151
+ :value.attr="item.value"
1152
+ :disabled="checkedProps.disabled ?? undefined"
1153
+ ></KeyedBoundary></template>
851
1154
  <button
852
- v-if="clearable"
1155
+ v-if="checkedProps.clearable"
853
1156
  type="button"
854
1157
  data-combobox-action="clear"
855
1158
  aria-label="Clear"
856
- :disabled="disabled || readonly || (!raw && (multiple || selected === null))"
1159
+ :disabled="guardedBinding"
857
1160
  >
858
1161
  <svg
859
1162
  class="affordance-icon"
@@ -868,13 +1171,13 @@ defineExpose({
868
1171
  </svg>
869
1172
  </button>
870
1173
  <button
871
- v-if="disclosure"
1174
+ v-if="checkedProps.disclosure"
872
1175
  type="button"
873
1176
  data-combobox-action="disclosure"
874
1177
  tabindex="-1"
875
1178
  aria-label="Show suggestions"
876
1179
  :aria-controls="`${uid}-listbox`"
877
- :disabled="disabled || readonly"
1180
+ :disabled="checkedProps.disabled || checkedProps.readonly"
878
1181
  >
879
1182
  <svg
880
1183
  class="affordance-icon"
@@ -891,12 +1194,12 @@ defineExpose({
891
1194
  </button>
892
1195
  </div>
893
1196
  <button
894
- v-if="help"
1197
+ v-if="checkedProps.help"
895
1198
  class="help"
896
1199
  type="button"
897
1200
  aria-label="Help"
898
1201
  :id="`${uid}-help`"
899
- :disabled="disabled"
1202
+ :disabled="checkedProps.disabled ?? undefined"
900
1203
  >
901
1204
  <svg
902
1205
  class="help-icon"
@@ -914,66 +1217,69 @@ defineExpose({
914
1217
  </svg>
915
1218
  </button>
916
1219
  </div>
917
- <UiTooltip v-if="help" trigger="click" :id="`${uid}-help-text`" :for="`${uid}-help`">{{
918
- help
919
- }}</UiTooltip>
1220
+ <UiTooltip
1221
+ v-if="checkedProps.help"
1222
+ trigger="click"
1223
+ :id="`${uid}-help-text`"
1224
+ :for="`${uid}-help`"
1225
+ >{{ checkedProps.help }}</UiTooltip>
920
1226
  <div class="popup" :hidden="!expanded" ref="popup">
921
1227
  <div
922
1228
  role="listbox"
923
1229
  :id="`${uid}-listbox`"
924
- :aria-label="`${label} suggestions`"
925
- :aria-busy="loading"
1230
+ :aria-label="`${checkedProps.label ?? ''} suggestions`"
1231
+ :aria-busy="checkedProps.loading ?? undefined"
926
1232
  ref="listbox"
927
1233
  >
928
- <div
929
- v-for="group in groups"
930
- :key="group.name"
931
- :role="group.role"
932
- :aria-label="group.label ?? undefined"
933
- >
934
- <div v-if="group.name" class="group">{{ group.name }}</div>
935
- <div
936
- v-for="row in group.rows"
937
- :key="row.id"
938
- class="option"
939
- role="option"
940
- data-ui-choice-option=""
941
- :data-multiple="multiple ? '' : undefined"
942
- :id="`${uid}-option-${row.index}`"
943
- :aria-selected="row.selected"
944
- :aria-disabled="row.disabled"
945
- :data-index="row.index"
946
- :aria-labelledby="row.labelledBy ?? undefined"
947
- :aria-describedby="row.detail ?? undefined"
948
- :class="{ active: row.index === active }"
1234
+ <KeyedBoundary><div
1235
+ v-for="group in uniqueKeys(groups, (group, indexLoop, loop) => group.name)"
1236
+ :key="group.name"
1237
+ :role="group.role"
1238
+ :aria-label="group.label ?? undefined"
949
1239
  >
950
- <slot :name="`option-${row.id}`"><span v-if="row.detail" class="detail"><span
951
- class="line"
952
- ><span class="primary" :id="`${uid}-option-${row.index}-label`">{{
953
- row.label
954
- }}</span>
955
- <UiBadge
956
- v-if="row.tag"
957
- :tone="row.tag?.tone"
958
- :style="{ '--ui-badge-color': row.tag?.color }"
959
- ><span :id="`${uid}-option-${row.index}-tag`">{{
960
- row.tag?.label
961
- }}</span></UiBadge></span>
962
- <span
963
- v-if="row.description"
964
- class="description"
965
- :id="`${uid}-option-${row.index}-description`"
966
- >{{ row.description }}</span></span>
967
- <span v-if="!row.detail" class="primary">{{ row.label }}</span></slot>
968
- </div>
969
- </div>
1240
+ <div v-if="group.name" class="group">{{ group.name }}</div>
1241
+ <KeyedBoundary><div
1242
+ v-for="row in uniqueKeys(group.rows, (row, indexLoop2, loop) => row.id)"
1243
+ :key="row.id"
1244
+ class="option"
1245
+ role="option"
1246
+ data-ui-choice-option=""
1247
+ :data-multiple="checkedProps.multiple ? '' : undefined"
1248
+ :id="`${uid}-option-${row.index}`"
1249
+ :aria-selected="row.selected"
1250
+ :aria-disabled="row.disabled"
1251
+ :data-index="row.index"
1252
+ :aria-labelledby="row.labelledBy ?? undefined"
1253
+ :aria-describedby="row.detail ?? undefined"
1254
+ :class="{ active: row.index === active }"
1255
+ >
1256
+ <slot :name="`option-${row.id}`"><span v-if="row.detail" class="detail"><span
1257
+ class="line"
1258
+ ><span class="primary" :id="`${uid}-option-${row.index}-label`">{{
1259
+ row.label
1260
+ }}</span>
1261
+ <UiBadge
1262
+ v-if="row.tag"
1263
+ :tone="row.tag?.tone"
1264
+ :style="{ '--ui-badge-color': row.tag?.color ?? undefined }"
1265
+ ><span :id="`${uid}-option-${row.index}-tag`">{{
1266
+ row.tag?.label
1267
+ }}</span></UiBadge></span>
1268
+ <span
1269
+ v-if="row.description"
1270
+ class="description"
1271
+ :id="`${uid}-option-${row.index}-description`"
1272
+ >{{ row.description }}</span></span>
1273
+ <span v-if="!row.detail" class="primary">{{ row.label }}</span></slot>
1274
+ </div></KeyedBoundary>
1275
+ </div></KeyedBoundary>
970
1276
  <div
971
1277
  v-if="creatable"
972
1278
  class="option"
973
1279
  role="option"
974
1280
  data-ui-choice-option=""
975
1281
  aria-selected="false"
976
- :data-multiple="multiple ? '' : undefined"
1282
+ :data-multiple="checkedProps.multiple ? '' : undefined"
977
1283
  :id="`${uid}-option-${createIndex}`"
978
1284
  :data-index="createIndex"
979
1285
  :class="{ active: createIndex === active }"
@@ -981,14 +1287,19 @@ defineExpose({
981
1287
  {{ `Create “${raw}”` }}
982
1288
  </div>
983
1289
  <div v-if="message" class="message">{{ message }}</div>
984
- <div v-if="!loading && !(rows[0]) && !creatable && !lookupError" class="message">
1290
+ <div
1291
+ v-if="!checkedProps.loading && !(rows[0]) && !creatable && !lookupError"
1292
+ class="message"
1293
+ >
985
1294
  <slot name="empty">No suggestions.</slot>
986
1295
  </div>
987
1296
  </div>
988
1297
  <slot name="footer" />
989
1298
  </div>
990
1299
  <div class="message" :id="`${uid}-validation`" :hidden="!validation.issues.length">
991
- <div v-for="(issue, index) in validation.issues" :key="index">{{ issue.message }}</div>
1300
+ <div v-for="(issue, indexLoop3) in validation.issues" :key="indexLoop3">
1301
+ {{ issue.message }}
1302
+ </div>
992
1303
  </div>
993
1304
  <div class="sr-only" role="status" aria-live="polite" aria-atomic="true">{{ statusText }}</div>
994
1305
  <div class="authored-options" hidden="" aria-hidden="true" ref="options"><slot /></div>