bitboss-ui 3.0.0-beta.71 → 3.0.0-beta.73

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 (363) hide show
  1. package/README.md +2 -2
  2. package/bin/cli.mjs +9 -3
  3. package/dist/ai/BbAccordion.md +38 -19
  4. package/dist/ai/BbBadge.md +25 -22
  5. package/dist/ai/BbBreadcrumbs.md +1 -1
  6. package/dist/ai/BbButton.md +32 -27
  7. package/dist/ai/BbCalendar.md +1 -0
  8. package/dist/ai/BbCarousel.md +6 -4
  9. package/dist/ai/BbCheckboxGroup.md +2 -1
  10. package/dist/ai/BbColorInput.md +1 -1
  11. package/dist/ai/BbConfirm.md +65 -81
  12. package/dist/ai/BbConfirmPortal.md +2 -2
  13. package/dist/ai/BbDatePicker.md +1 -6
  14. package/dist/ai/BbDatePickerInput.md +2 -2
  15. package/dist/ai/BbDialog.md +233 -164
  16. package/dist/ai/BbDropdown.md +52 -16
  17. package/dist/ai/BbDropdownButton.md +11 -12
  18. package/dist/ai/BbDropzone.md +12 -8
  19. package/dist/ai/BbForm.md +100 -13
  20. package/dist/ai/BbHost.md +2 -2
  21. package/dist/ai/BbHoverCardPortal.md +1 -1
  22. package/dist/ai/BbIcon.md +1 -1
  23. package/dist/ai/BbIndicator.md +17 -15
  24. package/dist/ai/BbNumberInput.md +7 -5
  25. package/dist/ai/BbOffCanvas.md +29 -7
  26. package/dist/ai/BbPagination.md +2 -2
  27. package/dist/ai/BbPopover.md +15 -9
  28. package/dist/ai/BbPopoverPortal.md +1 -1
  29. package/dist/ai/BbRadioGroup.md +29 -7
  30. package/dist/ai/BbRating.md +8 -7
  31. package/dist/ai/BbSelect.md +29 -8
  32. package/dist/ai/BbSelectPopover.md +9 -3
  33. package/dist/ai/BbSlider.md +12 -8
  34. package/dist/ai/BbSpinner.md +3 -2
  35. package/dist/ai/BbSwitch.md +3 -3
  36. package/dist/ai/BbSwitchGroup.md +7 -6
  37. package/dist/ai/BbTable.md +205 -82
  38. package/dist/ai/BbTabs.md +29 -4
  39. package/dist/ai/BbTag.md +1 -1
  40. package/dist/ai/BbTextInput.md +7 -5
  41. package/dist/ai/BbTextarea.md +4 -3
  42. package/dist/ai/BbTimePickerInput.md +1 -1
  43. package/dist/ai/BbToast.md +3 -2
  44. package/dist/ai/BbTooltip.md +22 -17
  45. package/dist/ai/BbTree.md +49 -24
  46. package/dist/ai/CommonFieldInput.md +1 -1
  47. package/dist/ai/changelog.json +242 -9
  48. package/dist/ai/components.json +52 -51
  49. package/dist/ai/composables/useBbDialog.md +5 -8
  50. package/dist/ai/composables/useBbForm.md +3 -0
  51. package/dist/ai/composables/useConfirm.md +65 -56
  52. package/dist/ai/composables/useToast.md +2 -1
  53. package/dist/ai/guides/agent-contract.md +3 -3
  54. package/dist/ai/guides/app-layout.md +3 -2
  55. package/dist/ai/guides/eslint-rules.md +3 -1
  56. package/dist/ai/guides/fetch-items-playbook.md +1 -1
  57. package/dist/ai/guides/floating-bottom-panel.md +3 -2
  58. package/dist/ai/guides/icons-policy.md +7 -5
  59. package/dist/ai/guides/inertia-helpers.md +35 -30
  60. package/dist/ai/guides/installation-and-plugin-setup.md +17 -14
  61. package/dist/ai/guides/migration/adoption-checklist.md +2 -2
  62. package/dist/ai/guides/migration/components/bb-badge.md +12 -1
  63. package/dist/ai/guides/migration/components/bb-button.md +24 -0
  64. package/dist/ai/guides/migration/components/bb-dropdown-button.md +11 -0
  65. package/dist/ai/guides/migration/components/bb-tabs.md +2 -2
  66. package/dist/ai/guides/migration/components/bb-toast.md +11 -0
  67. package/dist/ai/guides/migration/components/use-confirm.md +72 -26
  68. package/dist/ai/guides/migration/v2-to-v3.md +52 -10
  69. package/dist/ai/guides/migration/v3-beta-css-classes.md +1 -1
  70. package/dist/ai/guides/options-items-playbook.md +4 -3
  71. package/dist/ai/guides/passthrough.md +2 -2
  72. package/dist/ai/helpers/inertia/manifest.json +28 -15
  73. package/dist/ai/helpers/inertia/messages.ts +3 -3
  74. package/dist/ai/helpers/inertia/useConfirmOnRouteLeave.ts +10 -10
  75. package/dist/ai/helpers/inertia/usePromiseForm.ts +1 -1
  76. package/dist/ai/helpers/inertia/usePromiseRouter.ts +7 -2
  77. package/dist/ai/index.md +3 -3
  78. package/dist/ai/manifest/common.json +3 -3
  79. package/dist/ai/manifest/components/BbAccordion.json +8 -5
  80. package/dist/ai/manifest/components/BbAccordion.tree.json +1 -0
  81. package/dist/ai/manifest/components/BbBadge.json +8 -7
  82. package/dist/ai/manifest/components/BbBadge.removed.json +3 -1
  83. package/dist/ai/manifest/components/BbBadge.tree.json +73 -0
  84. package/dist/ai/manifest/components/BbBreadcrumbs.json +1 -1
  85. package/dist/ai/manifest/components/BbButton.json +5 -6
  86. package/dist/ai/manifest/components/BbButton.removed.json +3 -1
  87. package/dist/ai/manifest/components/BbButton.tree.json +24 -7
  88. package/dist/ai/manifest/components/BbCalendar.json +2 -1
  89. package/dist/ai/manifest/components/BbCheckboxGroup.json +2 -2
  90. package/dist/ai/manifest/components/BbColorInput.json +1 -1
  91. package/dist/ai/manifest/components/BbColorInput.tree.json +1 -1
  92. package/dist/ai/manifest/components/BbConfirm.json +2 -2
  93. package/dist/ai/manifest/components/BbConfirm.removed.json +9 -0
  94. package/dist/ai/manifest/components/BbConfirm.tree.json +4 -5
  95. package/dist/ai/manifest/components/BbConfirmPortal.json +3 -3
  96. package/dist/ai/manifest/components/BbConfirmPortal.removed.json +7 -0
  97. package/dist/ai/manifest/components/BbDatePicker.json +2 -1
  98. package/dist/ai/manifest/components/BbDatePicker.tree.json +0 -6
  99. package/dist/ai/manifest/components/BbDatePickerInput.json +2 -2
  100. package/dist/ai/manifest/components/BbDatePickerInput.tree.json +1 -1
  101. package/dist/ai/manifest/components/BbDialog.json +6 -1
  102. package/dist/ai/manifest/components/BbDialog.tree.json +41 -1
  103. package/dist/ai/manifest/components/BbDropdown.json +9 -8
  104. package/dist/ai/manifest/components/BbDropdown.tree.json +4 -0
  105. package/dist/ai/manifest/components/BbDropdownButton.json +8 -9
  106. package/dist/ai/manifest/components/BbDropdownButton.removed.json +3 -1
  107. package/dist/ai/manifest/components/BbForm.json +3 -1
  108. package/dist/ai/manifest/components/BbNumberInput.json +1 -1
  109. package/dist/ai/manifest/components/BbNumberInput.tree.json +1 -1
  110. package/dist/ai/manifest/components/BbOffCanvas.json +6 -1
  111. package/dist/ai/manifest/components/BbOffCanvas.tree.json +40 -0
  112. package/dist/ai/manifest/components/BbPagination.json +1 -1
  113. package/dist/ai/manifest/components/BbRadioGroup.json +4 -3
  114. package/dist/ai/manifest/components/BbRating.json +2 -2
  115. package/dist/ai/manifest/components/BbSelect.json +16 -15
  116. package/dist/ai/manifest/components/BbSelect.tree.json +1 -1
  117. package/dist/ai/manifest/components/BbSelectPopover.json +1 -0
  118. package/dist/ai/manifest/components/BbSwitch.json +4 -4
  119. package/dist/ai/manifest/components/BbSwitchGroup.json +7 -7
  120. package/dist/ai/manifest/components/BbTable.json +15 -14
  121. package/dist/ai/manifest/components/BbTable.tree.json +2 -0
  122. package/dist/ai/manifest/components/BbTabs.json +3 -3
  123. package/dist/ai/manifest/components/BbTabsList.json +1 -1
  124. package/dist/ai/manifest/components/BbTabsRoot.json +1 -1
  125. package/dist/ai/manifest/components/BbTag.json +1 -1
  126. package/dist/ai/manifest/components/BbTag.tree.json +1 -1
  127. package/dist/ai/manifest/components/BbTextInput.json +1 -1
  128. package/dist/ai/manifest/components/BbTextInput.tree.json +1 -1
  129. package/dist/ai/manifest/components/BbTextarea.json +1 -1
  130. package/dist/ai/manifest/components/BbTextarea.tree.json +1 -1
  131. package/dist/ai/manifest/components/BbTimePicker.json +1 -1
  132. package/dist/ai/manifest/components/BbTimePickerInput.json +1 -1
  133. package/dist/ai/manifest/components/BbTimePickerInput.tree.json +1 -1
  134. package/dist/ai/manifest/components/BbToast.removed.json +2 -1
  135. package/dist/ai/manifest/components/BbTree.json +2 -2
  136. package/dist/ai/manifest/components/CommonFieldInput.tree.json +3 -3
  137. package/dist/ai/manifest/index.json +4 -4
  138. package/dist/ai/manifest/meta.json +5 -1
  139. package/dist/ai/manifest/types.advanced.json +9 -9
  140. package/dist/ai/manifest/types.api.json +6 -5
  141. package/dist/ai/recipes/inertia/approvals-inbox.md +23 -16
  142. package/dist/ai/recipes/inertia/inline-edit-workspace.md +12 -5
  143. package/dist/ai/recipes/inertia/layout-scaffold.md +5 -3
  144. package/dist/ai/recipes/inertia/onboarding.md +23 -12
  145. package/dist/ai/recipes/inertia/ownership-atlas.md +34 -18
  146. package/dist/ai/recipes/inertia/record-form.md +12 -8
  147. package/dist/ai/recipes/inertia/records-workspace.md +14 -7
  148. package/dist/ai/recipes/inertia/settings-workspace.md +75 -60
  149. package/dist/ai/recipes/inertia/upload-center.md +17 -9
  150. package/dist/ai/recipes/inertia/wizard-form.md +2 -2
  151. package/dist/ai/recipes/nuxt/approvals-inbox.md +23 -16
  152. package/dist/ai/recipes/nuxt/inline-edit-workspace.md +12 -5
  153. package/dist/ai/recipes/nuxt/layout-scaffold.md +5 -3
  154. package/dist/ai/recipes/nuxt/onboarding.md +5 -4
  155. package/dist/ai/recipes/nuxt/ownership-atlas.md +34 -18
  156. package/dist/ai/recipes/nuxt/record-form.md +14 -10
  157. package/dist/ai/recipes/nuxt/records-workspace.md +14 -7
  158. package/dist/ai/recipes/nuxt/settings-workspace.md +70 -60
  159. package/dist/ai/recipes/nuxt/upload-center.md +17 -9
  160. package/dist/ai/recipes/nuxt/wizard-form.md +4 -4
  161. package/dist/ai/recipes/vue/approvals-inbox.md +23 -16
  162. package/dist/ai/recipes/vue/inline-edit-workspace.md +12 -5
  163. package/dist/ai/recipes/vue/layout-scaffold.md +5 -3
  164. package/dist/ai/recipes/vue/onboarding.md +5 -4
  165. package/dist/ai/recipes/vue/ownership-atlas.md +34 -18
  166. package/dist/ai/recipes/vue/record-form.md +14 -10
  167. package/dist/ai/recipes/vue/records-workspace.md +14 -7
  168. package/dist/ai/recipes/vue/settings-workspace.md +70 -60
  169. package/dist/ai/recipes/vue/upload-center.md +17 -9
  170. package/dist/ai/recipes/vue/wizard-form.md +4 -4
  171. package/dist/ai/source/BbAccordion.md +50 -16
  172. package/dist/ai/source/BbBadge.md +420 -26
  173. package/dist/ai/source/BbBadgeButton.md +378 -12
  174. package/dist/ai/source/BbButton.md +205 -55
  175. package/dist/ai/source/BbCalendar.md +5 -0
  176. package/dist/ai/source/BbCheckboxGroup.md +38 -13
  177. package/dist/ai/source/BbConfigScope.md +19 -2
  178. package/dist/ai/source/BbConfirm.md +74 -80
  179. package/dist/ai/source/BbConfirmPortal.md +6 -6
  180. package/dist/ai/source/BbDatePicker.md +9 -2
  181. package/dist/ai/source/BbDatePickerInput.md +3 -1
  182. package/dist/ai/source/BbDialog.md +53 -2
  183. package/dist/ai/source/BbDropdown.md +350 -98
  184. package/dist/ai/source/BbDropdownButton.md +20 -12
  185. package/dist/ai/source/BbDropdownGroup.md +136 -58
  186. package/dist/ai/source/BbForm.md +152 -11
  187. package/dist/ai/source/BbOffCanvas.md +53 -2
  188. package/dist/ai/source/BbPagination.md +1 -1
  189. package/dist/ai/source/BbRadioGroup.md +72 -10
  190. package/dist/ai/source/BbRating.md +30 -22
  191. package/dist/ai/source/BbSelect.md +11 -1
  192. package/dist/ai/source/BbSelectPopover.md +105 -34
  193. package/dist/ai/source/BbSwitch.md +23 -8
  194. package/dist/ai/source/BbSwitchGroup.md +67 -21
  195. package/dist/ai/source/BbTable.md +359 -48
  196. package/dist/ai/source/BbTabs.md +6 -0
  197. package/dist/ai/source/BbTabsList.md +10 -0
  198. package/dist/ai/source/BbTabsPanels.md +6 -0
  199. package/dist/ai/source/BbTabsRoot.md +6 -0
  200. package/dist/ai/source/BbTree.md +14 -4
  201. package/dist/ai/source/CommonFieldInput.md +2 -1
  202. package/dist/components/BbAccordion/BbAccordion.vue.d.ts +7 -3
  203. package/dist/components/BbAccordion/BbAccordion.vue_vue_type_script_setup_true_lang.js +52 -38
  204. package/dist/components/BbAccordion/ptKeys.generated.d.ts +20 -0
  205. package/dist/components/BbAccordion/types.d.ts +21 -7
  206. package/dist/components/BbAccordion/types.js +1 -1
  207. package/dist/components/BbAlert/BbAlert.vue.d.ts +1 -1
  208. package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +5 -5
  209. package/dist/components/BbBadge/BbBadge.vue.d.ts +1 -1
  210. package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +65 -42
  211. package/dist/components/BbBadge/types.d.ts +15 -12
  212. package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +79 -73
  213. package/dist/components/BbButton/types.d.ts +7 -6
  214. package/dist/components/BbCalendar/BbCalendar.vue.d.ts +2 -1
  215. package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +2 -1
  216. package/dist/components/BbCalendar/types.d.ts +5 -0
  217. package/dist/components/BbCalendar/useCalendarGrid.js +1 -1
  218. package/dist/components/BbCalendar/useDayGrid.js +1 -1
  219. package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +10 -4
  220. package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +2 -2
  221. package/dist/components/BbCheckboxGroup/types.d.ts +2 -2
  222. package/dist/components/BbConfigScope/BbConfigScope.vue_vue_type_script_setup_true_lang.js +8 -8
  223. package/dist/components/BbConfirm/BbConfirm.vue_vue_type_script_setup_true_lang.js +71 -132
  224. package/dist/components/BbConfirm/ptKeys.generated.d.ts +5 -5
  225. package/dist/components/BbConfirm/types.d.ts +5 -5
  226. package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +2 -1
  227. package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +3 -0
  228. package/dist/components/BbDatePicker/types.d.ts +5 -0
  229. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +1 -1
  230. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +2 -0
  231. package/dist/components/BbDatePickerInput/types.d.ts +2 -1
  232. package/dist/components/BbDialog/BbDialog.vue.d.ts +3 -0
  233. package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +263 -235
  234. package/dist/components/BbDialog/overlayActions.js +94 -0
  235. package/dist/components/BbDialog/types.d.ts +24 -0
  236. package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +4 -3
  237. package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +382 -332
  238. package/dist/components/BbDropdown/dropdownHandle.js +6 -0
  239. package/dist/components/BbDropdown/normalizeGroups.js +58 -48
  240. package/dist/components/BbDropdown/types.d.ts +107 -48
  241. package/dist/components/BbDropdown/types.js +2 -2
  242. package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +71 -71
  243. package/dist/components/BbDropdownButton/types.d.ts +2 -4
  244. package/dist/components/BbForm/BbForm.vue.d.ts +2 -1
  245. package/dist/components/BbForm/BbForm.vue_vue_type_script_setup_true_lang.js +241 -199
  246. package/dist/components/BbForm/recognizeValidation.d.ts +9 -0
  247. package/dist/components/BbForm/recognizeValidation.js +55 -0
  248. package/dist/components/BbForm/validationError.d.ts +10 -0
  249. package/dist/components/BbForm/validationError.js +11 -0
  250. package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +3 -0
  251. package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +414 -389
  252. package/dist/components/BbOffCanvas/sheetAttrs.js +5 -5
  253. package/dist/components/BbOffCanvas/types.d.ts +24 -0
  254. package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +3 -3
  255. package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +10 -4
  256. package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +173 -157
  257. package/dist/components/BbRadioGroup/types.d.ts +9 -3
  258. package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +112 -103
  259. package/dist/components/BbRating/types.d.ts +3 -2
  260. package/dist/components/BbSelect/BbSelect.vue.d.ts +9 -8
  261. package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +3 -1
  262. package/dist/components/BbSelect/types.d.ts +8 -0
  263. package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +11 -4
  264. package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +513 -502
  265. package/dist/components/BbSelectPopover/types.d.ts +10 -2
  266. package/dist/components/BbSwitch/BbSwitch.vue.d.ts +2 -0
  267. package/dist/components/BbSwitch/BbSwitch.vue_vue_type_script_setup_true_lang.js +85 -73
  268. package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +10 -4
  269. package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +171 -152
  270. package/dist/components/BbSwitchGroup/types.d.ts +1 -1
  271. package/dist/components/BbTable/BbTable.vue.d.ts +36 -25
  272. package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1338 -1215
  273. package/dist/components/BbTable/BbTableDataRow.js +2 -1
  274. package/dist/components/BbTable/BbTableRowMenu.js +36 -0
  275. package/dist/components/BbTable/types.d.ts +32 -17
  276. package/dist/components/BbTabs/BbTabsList.vue_vue_type_script_setup_true_lang.js +2 -2
  277. package/dist/components/BbTabs/types.d.ts +6 -0
  278. package/dist/components/BbTextInput/BbTextInput.vue.d.ts +1 -1
  279. package/dist/components/BbTextarea/BbTextarea.vue.d.ts +1 -1
  280. package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +1 -1
  281. package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +88 -94
  282. package/dist/components/BbTree/BbTree.vue_vue_type_script_setup_true_lang.js +1 -1
  283. package/dist/components/BbTree/BbTreeLevel.vue_vue_type_script_setup_true_lang.js +9 -9
  284. package/dist/components/BbTree/types.d.ts +8 -2
  285. package/dist/components/CommonFieldInput/CommonFieldInput.vue_vue_type_script_setup_true_lang.js +39 -39
  286. package/dist/composables/formSubmitLock.js +15 -8
  287. package/dist/composables/overlayRegistry.d.ts +5 -0
  288. package/dist/composables/overlayRegistry.js +154 -148
  289. package/dist/composables/useBbDropdown.d.ts +8 -0
  290. package/dist/composables/useBbDropdown.js +3 -1
  291. package/dist/composables/useBbTabs.js +138 -138
  292. package/dist/composables/useConfirm.d.ts +63 -52
  293. package/dist/composables/useConfirm.js +22 -18
  294. package/dist/deprecation/ai-deprecations.json.js +1 -1
  295. package/dist/directives/bbDropdown.d.ts +7 -7
  296. package/dist/directives/bbDropdown.js +21 -14
  297. package/dist/directives/bbTooltip.d.ts +3 -3
  298. package/dist/directives/createPopoverDirective.js +57 -35
  299. package/dist/i18n/locales/ar.json +5 -1
  300. package/dist/i18n/locales/cs.json +5 -1
  301. package/dist/i18n/locales/da.json +5 -1
  302. package/dist/i18n/locales/de-CH.json +5 -1
  303. package/dist/i18n/locales/de.json +5 -1
  304. package/dist/i18n/locales/el.json +5 -1
  305. package/dist/i18n/locales/en-GB.json +5 -1
  306. package/dist/i18n/locales/en.json +5 -1
  307. package/dist/i18n/locales/es-MX.json +5 -1
  308. package/dist/i18n/locales/es.json +5 -1
  309. package/dist/i18n/locales/fa.json +5 -1
  310. package/dist/i18n/locales/fi.json +5 -1
  311. package/dist/i18n/locales/fr.json +5 -1
  312. package/dist/i18n/locales/he.json +5 -1
  313. package/dist/i18n/locales/hu.json +5 -1
  314. package/dist/i18n/locales/it.json +5 -1
  315. package/dist/i18n/locales/ja.json +5 -1
  316. package/dist/i18n/locales/ko.json +5 -1
  317. package/dist/i18n/locales/nb.json +5 -1
  318. package/dist/i18n/locales/nl.json +5 -1
  319. package/dist/i18n/locales/pl.json +5 -1
  320. package/dist/i18n/locales/pt-BR.json +5 -1
  321. package/dist/i18n/locales/pt-PT.json +5 -1
  322. package/dist/i18n/locales/ro.json +5 -1
  323. package/dist/i18n/locales/ru.json +5 -1
  324. package/dist/i18n/locales/sv.json +5 -1
  325. package/dist/i18n/locales/tr.json +5 -1
  326. package/dist/i18n/locales/uk.json +5 -1
  327. package/dist/i18n/locales/zh-CN.json +5 -1
  328. package/dist/i18n/locales/zh-HK.json +5 -1
  329. package/dist/i18n/locales/zh-TW.json +5 -1
  330. package/dist/index.d.ts +2 -0
  331. package/dist/index.js +4 -3
  332. package/dist/llms-full.txt +1997 -1151
  333. package/dist/llms-medium.txt +21 -18
  334. package/dist/llms.txt +2 -2
  335. package/dist/locale-blueprint.json +5 -1
  336. package/dist/plugin.js +17 -40
  337. package/dist/pluginCore.js +30 -0
  338. package/dist/styles.css +2 -2
  339. package/dist/types/ActionButton.d.ts +26 -5
  340. package/dist/types/ActionButton.js +11 -0
  341. package/dist/types/ConfigDefaults.d.ts +34 -3
  342. package/dist/types/ConfigDefaults.js +14 -8
  343. package/dist/types/ItemPath.d.ts +33 -4
  344. package/dist/types/ptComponentMap.d.ts +1 -1
  345. package/dist/utilities/functions/clickCount.js +14 -0
  346. package/dist/utilities/functions/hash.js +90 -3
  347. package/dist/utilities/functions/isEqual.js +61 -3
  348. package/dist/utils/versionCheck.js +1 -1
  349. package/dist/vite.js +0 -1
  350. package/llms.txt +2 -2
  351. package/package.json +12 -2
  352. package/scripts/README.md +43 -39
  353. package/scripts/lib/adoption-checklist.json +2 -2
  354. package/scripts/lib/eslint-disable.mjs +5 -3
  355. package/scripts/lib/eslint-plugin.d.ts +2 -0
  356. package/scripts/lib/eslint-plugin.mjs +213 -1
  357. package/scripts/lib/helpers-add.mjs +21 -2
  358. package/scripts/lib/redundant-item-accessor.mjs +4 -1
  359. package/scripts/lib/release-results.mjs +180 -5
  360. package/scripts/lib/renamed-item-field.mjs +4 -1
  361. package/scripts/lib/tab-links.mjs +4 -1
  362. package/scripts/lib/tree-default-expandable.mjs +53 -0
  363. package/scripts/lib/validate-bb-markup.mjs +536 -52
@@ -4,43 +4,44 @@ import { useId as n } from "../../composables/useId.js";
4
4
  import { isTopEscapeEntry as r, pushEscapeEntry as i, removeEscapeEntry as a } from "../../utils/overlayEscapeStack.js";
5
5
  import { useBbDropdownHost as o } from "../../composables/useBbDropdown.js";
6
6
  import { useLogger as s } from "../../composables/useLogger.js";
7
- import { useMobile as c } from "../../composables/useMobile.js";
8
- import { provideSheetSurface as ee } from "../../composables/useSheetSurface.js";
9
- import { useUntil as te } from "../../composables/useUntil.js";
10
- import { useClosingInert as ne } from "../../composables/useClosingInert.js";
11
- import { useConfigDefaults as re, useConfigSetting as ie } from "../../composables/useConfigDefaults.js";
12
- import { wait as ae } from "../../utilities/functions/wait.js";
13
- import { focusQuietly as oe } from "../../utils/focusVisibility.js";
14
- import se from "../CommonPopover/CommonPopover.vue.js";
15
- import ce from "./BbDropdownList.vue.js";
16
- import le from "./AdaptiveDropdown.vue.js";
17
- import ue from "./DropdownPipelineResolver.vue.js";
18
- import { hash as de } from "../../utilities/functions/hash.js";
19
- import { readableValue as fe } from "../../utilities/functions/readableValue.js";
20
- import { settlesVisible as pe } from "../../utilities/functions/settlesVisible.js";
21
- import { domElement as me, extractDomContainer as l } from "../../utilities/functions/extractDomContainer.js";
22
- import { parseWidthString as he } from "../../utilities/functions/parseWidthString.js";
23
- import { levelHasSearch as ge, normalizeGroups as _e } from "./normalizeGroups.js";
24
- import { provideDropdownContext as ve } from "./useDropdownContext.js";
25
- import { provideDropdownGroupRegistry as ye } from "./useDropdownGroupRegistry.js";
26
- import { BB_DROPDOWN_PT as u, groupItemsAsArray as d, isGroup as f, isSelectableGroup as be } from "./types.js";
27
- import { usePassthrough as xe, variantPt as p } from "../../composables/usePassthrough.js";
28
- import { withoutClass as Se } from "../../utils/passthrough.js";
29
- import { transitions as Ce } from "../../utilities/misc/transitions.js";
30
- import { removedPropsFor as we } from "../../deprecation/removedProps.js";
31
- import { warnRemovedAttrs as Te } from "../../utilities/functions/warnRemovedAttrs.js";
32
- import { Fragment as Ee, computed as m, createBlock as h, createCommentVNode as De, createElementBlock as Oe, createElementVNode as ke, defineComponent as g, guardReactiveProps as Ae, mergeProps as _, normalizeProps as je, onBeforeUnmount as Me, onDeactivated as Ne, openBlock as v, reactive as y, ref as b, renderList as Pe, renderSlot as Fe, toDisplayString as Ie, unref as x, useSlots as Le, useTemplateRef as Re, watch as S, withCtx as ze } from "vue";
33
- import { useElementSize as Be, useIntersectionObserver as Ve } from "@vueuse/core";
7
+ import { useMobile as ee } from "../../composables/useMobile.js";
8
+ import { provideSheetSurface as te } from "../../composables/useSheetSurface.js";
9
+ import { useUntil as ne } from "../../composables/useUntil.js";
10
+ import { useClosingInert as re } from "../../composables/useClosingInert.js";
11
+ import { useConfigDefaults as ie, useConfigSetting as ae } from "../../composables/useConfigDefaults.js";
12
+ import { wait as c } from "../../utilities/functions/wait.js";
13
+ import { registerDropdownHandle as oe } from "./dropdownHandle.js";
14
+ import { focusQuietly as se } from "../../utils/focusVisibility.js";
15
+ import ce from "../CommonPopover/CommonPopover.vue.js";
16
+ import le from "./BbDropdownList.vue.js";
17
+ import ue from "./AdaptiveDropdown.vue.js";
18
+ import de from "./DropdownPipelineResolver.vue.js";
19
+ import { hash as fe } from "../../utilities/functions/hash.js";
20
+ import { readableValue as pe } from "../../utilities/functions/readableValue.js";
21
+ import { settlesVisible as me } from "../../utilities/functions/settlesVisible.js";
22
+ import { domElement as he, extractDomContainer as ge } from "../../utilities/functions/extractDomContainer.js";
23
+ import { parseWidthString as _e } from "../../utilities/functions/parseWidthString.js";
24
+ import { levelHasSearch as ve, normalizeGroups as ye } from "./normalizeGroups.js";
25
+ import { provideDropdownContext as be } from "./useDropdownContext.js";
26
+ import { provideDropdownGroupRegistry as xe } from "./useDropdownGroupRegistry.js";
27
+ import { BB_DROPDOWN_PT as Se, groupItemsAsArray as l, isGroup as u, isPrimitiveRow as d, isSelectableGroup as Ce } from "./types.js";
28
+ import { usePassthrough as we, variantPt as f } from "../../composables/usePassthrough.js";
29
+ import { withoutClass as Te } from "../../utils/passthrough.js";
30
+ import { transitions as Ee } from "../../utilities/misc/transitions.js";
31
+ import { removedPropsFor as De } from "../../deprecation/removedProps.js";
32
+ import { warnRemovedAttrs as Oe } from "../../utilities/functions/warnRemovedAttrs.js";
33
+ import { Fragment as ke, computed as p, createBlock as Ae, createCommentVNode as m, createElementBlock as h, createElementVNode as je, defineComponent as g, guardReactiveProps as Me, mergeProps as _, normalizeProps as Ne, onBeforeUnmount as Pe, onDeactivated as Fe, onMounted as Ie, openBlock as v, reactive as y, ref as b, renderList as Le, renderSlot as x, toDisplayString as Re, unref as S, useSlots as ze, useTemplateRef as Be, watch as C, withCtx as Ve } from "vue";
34
+ import { useElementSize as He, useIntersectionObserver as Ue } from "@vueuse/core";
34
35
  // src/components/BbDropdown/BbDropdown.vue?vue&type=script&setup=true&lang.ts
35
- var He = [
36
+ var We = [
36
37
  "id",
37
38
  "aria-labelledby",
38
39
  "role"
39
- ], Ue = {
40
+ ], Ge = {
40
41
  class: "bb-sr-only",
41
42
  role: "status"
42
- }, We = "bb-dropdown:open", Ge = 500, Ke = 10, C = /*@__PURE__*/ g({
43
- mixins: [p(u)],
43
+ }, Ke = "bb-dropdown:open", qe = 500, Je = 10, w = /*@__PURE__*/ g({
44
+ mixins: [f(Se)],
44
45
  inheritAttrs: !1,
45
46
  __name: "BbDropdown",
46
47
  props: {
@@ -121,6 +122,7 @@ var He = [
121
122
  enforceCoherence: { type: Boolean },
122
123
  id: {},
123
124
  items: {},
125
+ keepActivator: { type: Boolean },
124
126
  loadingText: {},
125
127
  emptyText: {},
126
128
  failedText: {},
@@ -129,7 +131,7 @@ var He = [
129
131
  padding: { default: 10 },
130
132
  placement: { default: "bottom" },
131
133
  queryDebounceTime: { default: 300 },
132
- transitionDuration: { default: Ce.fast },
134
+ transitionDuration: { default: Ee.fast },
133
135
  trigger: { default: "click" },
134
136
  width: { default: "auto" }
135
137
  },
@@ -141,44 +143,44 @@ var He = [
141
143
  "item:selected",
142
144
  "item:unselected"
143
145
  ],
144
- setup(p, { emit: Ce }) {
145
- let g = p, C = Ce, qe = ie(null, "popoverOffset"), w = xe({
146
+ setup(f, { emit: Ee }) {
147
+ let g = f, w = Ee, Ye = ae(null, "popoverOffset"), T = we({
146
148
  component: "BbDropdown",
147
149
  props: g,
148
- parts: u.parts,
149
- states: u.states,
150
- active: { open: () => k.value },
151
- variant: u.variant
150
+ parts: Se.parts,
151
+ states: Se.states,
152
+ active: { open: () => j.value },
153
+ variant: Se.variant
152
154
  });
153
- process.env.NODE_ENV !== "production" && Te("BbDropdown", we("BbDropdown"));
154
- let Je = s(), Ye = n().id.value, T = g.id ?? `bb_${Ye}`, E = Symbol("bb-dropdown-escape"), D = b(T), O = b(), Xe = m(() => l(O.value)), Ze = m(() => g.activator != null), k = b(!1), Qe = {
155
- onShow: () => C("show"),
156
- onShown: () => C("shown"),
157
- onHide: () => C("hide"),
158
- onHidden: () => C("hidden")
159
- }, $e = te(k, { initialValue: g.eager }), et = ne(k, () => g.transitionDuration), tt = m(() => g.eager || !et.value), nt = ({ availableHeight: e }) => _({
160
- id: B.value ? `dialog_${T}` : void 0,
161
- "aria-labelledby": B.value ? D.value : void 0,
162
- class: ["bb-dropdown__panel", { "bb-dropdown__panel--reserve-check": fn.value }],
163
- "data-bb-dropdown-surface": T,
164
- inert: et.value,
165
- role: B.value ? "dialog" : void 0,
155
+ process.env.NODE_ENV !== "production" && Oe("BbDropdown", De("BbDropdown"));
156
+ let Xe = s(), Ze = n().id.value, E = g.id ?? `bb_${Ze}`, D = Symbol("bb-dropdown-escape"), O = b(E), k = b(), A = p(() => ge(k.value)), Qe = p(() => g.activator != null), j = b(!1), $e = {
157
+ onShow: () => w("show"),
158
+ onShown: () => w("shown"),
159
+ onHide: () => w("hide"),
160
+ onHidden: () => w("hidden")
161
+ }, et = ne(j, { initialValue: g.eager }), tt = re(j, () => g.transitionDuration), nt = p(() => g.eager || !tt.value), rt = ({ availableHeight: e }) => _({
162
+ id: z.value ? `dialog_${E}` : void 0,
163
+ "aria-labelledby": z.value ? O.value : void 0,
164
+ class: ["bb-dropdown__panel", { "bb-dropdown__panel--reserve-check": Cn.value }],
165
+ "data-bb-dropdown-surface": E,
166
+ inert: tt.value,
167
+ role: z.value ? "dialog" : void 0,
166
168
  style: {
167
- "--w": mn.value,
169
+ "--w": Tn.value,
168
170
  "--max-h": e == null ? void 0 : `${e}px`
169
171
  }
170
- }, w.panel), A = y({}), rt = y(/* @__PURE__ */ new Set()), { isMobile: it } = c(), j = re("BbDropdown", g, {
172
+ }, T.panel), it = y({}), at = y(/* @__PURE__ */ new Set()), { isMobile: ot } = ee(), st = ie("BbDropdown", g, {
171
173
  adaptive: !0,
172
174
  compact: !1
173
- }), at = () => j.adaptive && it.value ? "canvas" : "popover", ot = b(at()), M = m(() => ot.value === "canvas");
174
- S([
175
- () => j.adaptive,
176
- it,
177
- k
175
+ }), ct = () => st.adaptive && ot.value ? "canvas" : "popover", lt = b(ct()), M = p(() => lt.value === "canvas");
176
+ C([
177
+ () => st.adaptive,
178
+ ot,
179
+ j
178
180
  ], () => {
179
- k.value || (ot.value = at());
180
- }), ee(M);
181
- let st = m(() => ({
181
+ j.value || (lt.value = ct());
182
+ }), te(M);
183
+ let ut = p(() => ({
182
184
  side: "bottom",
183
185
  size: "auto",
184
186
  draggable: !0,
@@ -186,11 +188,11 @@ var He = [
186
188
  transitionDuration: g.transitionDuration,
187
189
  hideClose: !0,
188
190
  ...g.offCanvasProps
189
- })), ct = m(() => {
191
+ })), dt = p(() => {
190
192
  let e = g.trigger;
191
193
  return new Set(Array.isArray(e) ? e : [e]);
192
- }), lt = (e, t) => {
193
- let n = Xe.value, r = n?.getBoundingClientRect(), i = r ? e - r.left : 0, a = r ? t - r.top : 0;
194
+ }), ft = (e, t) => {
195
+ let n = A.value, r = n?.getBoundingClientRect(), i = r ? e - r.left : 0, a = r ? t - r.top : 0;
194
196
  return {
195
197
  contextElement: n ?? void 0,
196
198
  getBoundingClientRect: () => {
@@ -210,25 +212,26 @@ var He = [
210
212
  };
211
213
  }
212
214
  };
213
- }, N = b(null), ut = m(() => g.anchor ?? O.value), dt = m(() => l(ut.value)), ft = m(() => g.placement === "cursor" && N.value ? N.value : ut.value), pt = (e) => {
214
- let t = l(e);
215
- t && (O.value = t);
216
- }, mt = !1, { resume: ht, pause: gt } = Ve(() => me(Xe.value), async ([{ intersectionRatio: e }]) => {
217
- if (mt) {
218
- mt = !1;
215
+ }, N = b(null), pt = p(() => g.anchor ?? k.value), mt = p(() => ge(pt.value)), ht = p(() => g.placement === "cursor" && N.value ? N.value : pt.value), gt = (e) => {
216
+ let t = ge(e);
217
+ t && (k.value = t);
218
+ }, _t = !1, { resume: vt, pause: yt } = Ue(() => he(A.value), async ([{ intersectionRatio: e }]) => {
219
+ if (_t) {
220
+ _t = !1;
219
221
  return;
220
222
  }
221
- if (e >= .99 || !k.value) return;
222
- let t = Xe.value;
223
- t && await pe(t) || k.value && await $();
223
+ if (e >= .99 || !j.value) return;
224
+ let t = A.value;
225
+ t && await me(t) || j.value && await $();
224
226
  }, {
225
227
  threshold: [0, 1],
226
228
  immediate: !1
227
- }), P = y({}), _t = y(/* @__PURE__ */ new Map()), F = y(/* @__PURE__ */ new Map()), I = /* @__PURE__ */ new Map(), vt = /* @__PURE__ */ new Map(), yt = !1, bt = (e) => !!I.get(e)?.controlled(), L = (e, t) => I.get(e)?.request(t), R = (e, t) => {
229
+ }), P = y({}), bt = y(/* @__PURE__ */ new Map()), F = y(/* @__PURE__ */ new Map()), I = /* @__PURE__ */ new Map(), xt = /* @__PURE__ */ new Map(), St = !1, Ct = (e) => !!I.get(e)?.controlled(), L = (e, t) => I.get(e)?.request(t), R = (e, t) => {
228
230
  for (let n of e) {
229
- if (f(n)) {
231
+ if (d(n)) continue;
232
+ if (u(n)) {
230
233
  if (n.id === t) return n;
231
- for (let e of d(n.items)) {
234
+ for (let e of l(n.items)) {
232
235
  let n = Array.isArray(e) ? e : [e];
233
236
  for (let e of n) {
234
237
  let n = e.items ? R(e.items, t) : void 0;
@@ -245,18 +248,20 @@ var He = [
245
248
  let e = n.items ? R(n.items, t) : void 0;
246
249
  if (e) return e;
247
250
  }
248
- }, xt = (e, t) => {
249
- for (let n of e) if (Array.isArray(n)) {
250
- let e = xt(n, t);
251
+ }, wt = (e, t) => {
252
+ for (let n of e) if (d(n)) {
253
+ if (n === t) return "item";
254
+ } else if (Array.isArray(n)) {
255
+ let e = wt(n, t);
251
256
  if (e) return e;
252
- } else if (f(n)) {
257
+ } else if (u(n)) {
253
258
  if (n.id === t) return "group";
254
- for (let e of d(n.items)) {
259
+ for (let e of l(n.items)) {
255
260
  let n = Array.isArray(e) ? e : [e];
256
261
  for (let e of n) {
257
262
  if (e.value === t) return "item";
258
263
  if (e.items) {
259
- let n = xt(e.items, t);
264
+ let n = wt(e.items, t);
260
265
  if (n) return n;
261
266
  }
262
267
  }
@@ -264,11 +269,11 @@ var He = [
264
269
  } else {
265
270
  if (n.value === t) return "item";
266
271
  if (n.items) {
267
- let e = xt(n.items, t);
272
+ let e = wt(n.items, t);
268
273
  if (e) return e;
269
274
  }
270
275
  }
271
- }, St = m(() => Array.from(_t.values()).map((e) => e.value).sort((e, t) => e.order - t.order)), Ct = (e, t) => ({
276
+ }, Tt = p(() => Array.from(bt.values()).map((e) => e.value).sort((e, t) => e.order - t.order)), Et = (e, t) => ({
272
277
  ...e,
273
278
  group: !0,
274
279
  id: e.id,
@@ -282,7 +287,7 @@ var He = [
282
287
  "append:icon": t["append:icon"] ?? e["append:icon"],
283
288
  variant: t.variant ?? e.variant,
284
289
  onClick: t.onClick ?? e.onClick
285
- }), wt = (e, t) => ({
290
+ }), Dt = (e, t) => ({
286
291
  group: !0,
287
292
  id: e.key,
288
293
  label: e.label ?? t?.label,
@@ -295,10 +300,10 @@ var He = [
295
300
  "append:icon": e["append:icon"] ?? t?.["append:icon"],
296
301
  variant: e.variant ?? t?.variant,
297
302
  onClick: e.onClick ?? t?.onClick
298
- }), Tt = (e, t) => {
303
+ }), Ot = (e, t) => {
299
304
  let n = !1, r = (e) => {
300
305
  if (!e.items) return e;
301
- let r = Tt(e.items, t);
306
+ let r = Ot(e.items, t);
302
307
  return r.found ? (n = !0, {
303
308
  ...e,
304
309
  items: r.items
@@ -306,55 +311,57 @@ var He = [
306
311
  };
307
312
  return {
308
313
  items: e.map((e) => {
309
- if (f(e)) {
310
- if (e.id === t.id) return n = !0, Ct(e, t);
314
+ if (u(e)) {
315
+ if (e.id === t.id) return n = !0, Et(e, t);
311
316
  if (typeof e.items == "function") return e;
312
- let i = d(e.items).map((e) => Array.isArray(e) ? e.map((e) => r(e)) : r(e));
317
+ let i = l(e.items).map((e) => Array.isArray(e) ? e.map((e) => r(e)) : r(e));
313
318
  return {
314
319
  ...e,
315
320
  items: i
316
321
  };
317
322
  }
318
323
  if (Array.isArray(e)) {
319
- let r = Tt(e, t);
324
+ let r = Ot(e, t);
320
325
  return r.found && (n = !0), r.items;
321
326
  }
322
- return r(e);
327
+ return d(e) ? e : r(e);
323
328
  }),
324
329
  found: n
325
330
  };
326
- }, z = m(() => {
331
+ }, kt = p(() => {
327
332
  let e = [...g.items ?? []];
328
- for (let t of St.value) {
333
+ for (let t of Tt.value) {
329
334
  let n = R(e, t.key);
330
- !n && !t.items?.length && (xt(e, t.key) === "item" && Je.throw(`[BbDropdownGroup] "${t.key}" refers to a menu item, not a selectable group. \`<BbDropdownGroup>\` can only attach to a group (an entry with \`selectable\`, \`multiple\`, or \`group: true\`). Point \`id\` at a group \`id\`.`), Je.throw(`[BbDropdownGroup] Missing minimum config for group "${t.key}". Provide \`items\`, \`selectable\`, \`multiple\`, or \`group\` keys in order to identify a group or define a baseline group with the same \`id\` in \`BbDropdown.items\`.`));
331
- let r = wt(t, n), i = Tt(e, r);
335
+ !n && !t.items?.length && (wt(e, t.key) === "item" && Xe.throw(`[BbDropdownGroup] "${t.key}" refers to a menu item, not a selectable group. \`<BbDropdownGroup>\` can only attach to a group (an entry with \`selectable\`, \`multiple\`, or \`group: true\`). Point \`id\` at a group \`id\`.`), Xe.throw(`[BbDropdownGroup] Missing minimum config for group "${t.key}". Provide \`items\`, \`selectable\`, \`multiple\`, or \`group\` keys in order to identify a group or define a baseline group with the same \`id\` in \`BbDropdown.items\`.`));
336
+ let r = Dt(t, n), i = Ot(e, r);
332
337
  e = i.found ? i.items : [...i.items, r];
333
338
  }
334
339
  return e;
335
- }), Et = (e) => {
340
+ }), At = (e) => {
336
341
  let t = P[e.id ?? ""] ?? [];
337
342
  if (e.multiple || t.length || !e.id) return t;
338
- let n = H.value.includes(e.id), r = e.items.find((t) => !t.keyless && !t.placeholder && (n ? U[e.id]?.valueByKey.get(t.rowKey) === null : t.value === null));
343
+ let n = V.value.includes(e.id), r = e.items.find((t) => !t.keyless && !t.placeholder && (n ? H[e.id]?.valueByKey.get(t.rowKey) === null : t.value === null));
339
344
  return r ? [r.rowKey] : t;
340
- }, Dt = m(() => _e(z.value)), Ot = m(() => Dt.value.map((e) => e.selectable ? {
345
+ }, jt = p(() => ye(kt.value)), Mt = p(() => jt.value.map((e) => e.selectable ? {
341
346
  ...e,
342
- selected: Et(e)
343
- } : e)), B = m(() => ge(Ot.value)), kt = b(), At = m(() => B.value || M.value ? "dialog" : "menu"), jt = m(() => B.value && !M.value ? `dialog_${T}` : `menu_${T}`), Mt = (e) => typeof e.items == "function" || e.itemText != null || e.itemProps != null || e.itemValue != null || e.max != null, V = (e, t = []) => {
344
- for (let n of e) if (f(n)) {
345
- n.id && Mt(n) && t.push(n.id);
346
- for (let e of d(n.items)) for (let n of Array.isArray(e) ? e : [e]) n.items && V(n.items, t);
347
- } else Array.isArray(n) ? V(n, t) : n.items && V(n.items, t);
347
+ selected: At(e)
348
+ } : e)), z = p(() => ve(Mt.value)), Nt = b(), Pt = p(() => z.value || M.value ? "dialog" : "menu"), Ft = p(() => z.value && !M.value ? `dialog_${E}` : `menu_${E}`), It = (e) => typeof e.items == "function" || e.itemText != null || e.itemProps != null || e.itemValue != null || e.max != null, B = (e, t = []) => {
349
+ for (let n of e) if (!d(n)) {
350
+ if (u(n)) {
351
+ n.id && It(n) && t.push(n.id);
352
+ for (let e of l(n.items)) for (let n of Array.isArray(e) ? e : [e]) n.items && B(n.items, t);
353
+ } else Array.isArray(n) ? B(n, t) : n.items && B(n.items, t);
354
+ }
348
355
  return t;
349
- }, H = m(() => V(g.items ?? [])), Nt = m(() => (g.items ?? []).filter((e) => f(e) && !!e.id && Mt(e)).map((e) => e.id)), U = y({}), Pt = y({}), Ft = y({}), W = (e, t) => H.value.includes(e) ? U[e]?.valueByKey.get(t) : K(e)?.items.find((e) => e.rowKey === t && !e.keyless)?.value, G = (e) => {
356
+ }, V = p(() => B(g.items ?? [])), Lt = p(() => (g.items ?? []).filter((e) => u(e) && !!e.id && It(e)).map((e) => e.id)), H = y({}), Rt = y({}), zt = y({}), U = (e, t) => V.value.includes(e) ? H[e]?.valueByKey.get(t) : G(e)?.items.find((e) => e.rowKey === t && !e.keyless)?.value, W = (e) => {
350
357
  let t = R(g.items ?? [], e);
351
358
  if (t) return {
352
359
  multiple: t.multiple ?? !1,
353
- selectable: be(t)
360
+ selectable: Ce(t)
354
361
  };
355
- }, K = (e) => {
362
+ }, G = (e) => {
356
363
  let t = (n) => {
357
- for (let r of _e(n)) {
364
+ for (let r of ye(n)) {
358
365
  if (r.id === e) return r;
359
366
  for (let e of r.items) if (e.items) {
360
367
  let n = t(e.items);
@@ -362,76 +369,106 @@ var He = [
362
369
  }
363
370
  }
364
371
  };
365
- return t(z.value);
366
- }, It = (e, t) => de(t), Lt = (e) => {
372
+ return t(kt.value);
373
+ }, Bt = (e, t) => fe(t), Vt = (e) => {
367
374
  if (F.has(e)) return F.get(e);
368
- let t = (P[e] ?? []).map((t) => W(e, t));
369
- return G(e)?.multiple ? t : t[0] ?? null;
370
- }, Rt = (e, t) => [].concat(F.get(e) ?? []).find((n) => It(e, n) === t);
371
- ye({
375
+ let t = (P[e] ?? []).map((t) => U(e, t));
376
+ return W(e)?.multiple ? t : t[0] ?? null;
377
+ }, Ht = (e, t) => [].concat(F.get(e) ?? []).find((n) => Bt(e, n) === t);
378
+ xe({
372
379
  bindController: (e, t) => I.set(e, t),
373
380
  unbindController: (e, t) => I.get(e) === t && (I.delete(e), !0),
374
381
  onPick: (e, t) => {
375
- t ? vt.set(e, t) : vt.delete(e);
382
+ t ? xt.set(e, t) : xt.delete(e);
376
383
  },
377
- isControlled: bt,
384
+ isControlled: Ct,
378
385
  request: L,
379
- register: (e, t) => _t.set(e, t),
380
- unregister: (e) => _t.delete(e),
386
+ register: (e, t) => bt.set(e, t),
387
+ unregister: (e) => bt.delete(e),
381
388
  seed: (e, t) => {
382
389
  e in P || (P[e] = t);
383
390
  },
384
391
  setSelection: (e, t) => {
385
- yt = !0;
392
+ St = !0;
386
393
  try {
387
394
  P[e] = t;
388
395
  } finally {
389
- yt = !1;
396
+ St = !1;
390
397
  }
391
398
  },
392
- isAppWrite: () => yt,
399
+ isAppWrite: () => St,
393
400
  selectionFor: (e) => P[e] ?? [],
394
- isPipeline: (e) => H.value.includes(e),
401
+ isPipeline: (e) => V.value.includes(e),
395
402
  publishPipeline: (e, t) => {
396
- t ? U[e] = t : delete U[e];
403
+ t ? H[e] = t : delete H[e];
397
404
  },
398
405
  publishLoading: (e, t) => {
399
- t ? Pt[e] = !0 : delete Pt[e];
406
+ t ? Rt[e] = !0 : delete Rt[e];
400
407
  },
401
408
  publishFetching: (e, t) => {
402
- t ? Ft[e] = !0 : delete Ft[e];
409
+ t ? zt[e] = !0 : delete zt[e];
403
410
  },
404
411
  publishModel: (e, t) => {
405
412
  t === void 0 ? F.delete(e) : F.set(e, t);
406
413
  },
407
- modelValueFor: Lt,
408
- valueForKey: W,
409
- keyForValue: It,
410
- itemForKey: (e, t) => U[e]?.itemByKey.get(t) ?? K(e)?.items.find((e) => e.rowKey === t),
414
+ modelValueFor: Vt,
415
+ valueForKey: U,
416
+ keyForValue: Bt,
417
+ itemForKey: (e, t) => H[e]?.itemByKey.get(t) ?? G(e)?.items.find((e) => e.rowKey === t),
411
418
  configFor: (e) => R(g.items ?? [], e),
412
- itemsFor: (e) => K(e)?.items ?? [],
413
- selectableFor: (e) => G(e)?.selectable,
414
- multipleFor: (e) => G(e)?.multiple
419
+ itemsFor: (e) => G(e)?.items ?? [],
420
+ selectableFor: (e) => W(e)?.selectable,
421
+ multipleFor: (e) => W(e)?.multiple
415
422
  });
416
- let q = (e, t = []) => {
417
- for (let n of e) if (f(n)) {
418
- n.id && be(n) && t.push(n.id);
419
- for (let e of d(n.items)) for (let n of Array.isArray(e) ? e : [e]) n.items && q(n.items, t);
420
- } else Array.isArray(n) ? q(n, t) : n.items && q(n.items, t);
423
+ let Ut = b(!!ze().default);
424
+ Ie(() => Ut.value = !1);
425
+ let Wt = p(() => V.value.some((e) => !Tt.value.some((t) => t.key === e && Array.isArray(t.items)))), K = p(() => !Ut.value && !Wt.value && !jt.value.length), Gt = p(() => !!g.keepActivator || dt.value.has("contextMenu")), Kt = b(!1), qt = p(() => !K.value || Gt.value || Kt.value);
426
+ C(K, (e) => {
427
+ if (!e) {
428
+ Kt.value = !1;
429
+ return;
430
+ }
431
+ if (j.value) {
432
+ let e = !!document.activeElement?.closest(`[data-bb-dropdown-surface="${CSS.escape(E)}"]`);
433
+ $(), e && rn();
434
+ }
435
+ let t = A.value;
436
+ if (Gt.value || !(t instanceof HTMLElement) || !t.contains(document.activeElement)) return;
437
+ Kt.value = !0;
438
+ let n = (e) => {
439
+ t.contains(e.relatedTarget) || (t.removeEventListener("focusout", n), Kt.value = !1);
440
+ };
441
+ t.addEventListener("focusout", n);
442
+ }), C([k, () => Qe.value && !qt.value], ([e, t], n, r) => {
443
+ if (!t || !e) return;
444
+ let { style: i } = e;
445
+ if (!i) return;
446
+ let a = i.getPropertyValue("display"), o = i.getPropertyPriority("display");
447
+ i.setProperty("display", "none"), r(() => {
448
+ i.getPropertyValue("display") === "none" && (a ? i.setProperty("display", a, o) : i.removeProperty("display"));
449
+ });
450
+ }, { immediate: !0 });
451
+ let Jt = (e, t = []) => {
452
+ for (let n of e) if (!d(n)) {
453
+ if (u(n)) {
454
+ n.id && Ce(n) && t.push(n.id);
455
+ for (let e of l(n.items)) for (let n of Array.isArray(e) ? e : [e]) n.items && Jt(n.items, t);
456
+ } else Array.isArray(n) ? Jt(n, t) : n.items && Jt(n.items, t);
457
+ }
421
458
  return t;
422
- }, zt = m(() => {
459
+ }, Yt = p(() => {
423
460
  let e = {};
424
- for (let t of q(z.value)) {
425
- let n = Lt(t), r = (G(t)?.multiple ? [].concat(n) : [n]).filter((e) => e != null), i = U[t], a = K(t), o = R(z.value, t), { items: s, ...c } = o ?? {};
461
+ for (let t of Jt(kt.value)) {
462
+ let n = Vt(t), r = (W(t)?.multiple ? [].concat(n) : [n]).filter((e) => e != null), i = H[t], a = G(t), o = R(kt.value, t), { items: s, ...ee } = o ?? {};
426
463
  e[t] = {
427
- ...c,
464
+ ...ee,
428
465
  id: t,
429
466
  value: n,
430
467
  multiple: o?.multiple ?? !1,
431
- selectable: o ? be(o) : !1,
432
- loading: !!Ft[t],
468
+ selectable: o ? Ce(o) : !1,
469
+ loading: !!zt[t],
433
470
  selectedOptions: r.map((e) => {
434
- let n = It(t, e), r = a?.items.find((e) => e.rowKey === n);
471
+ let n = Bt(t, e), r = a?.items.find((e) => e.rowKey === n);
435
472
  return {
436
473
  value: e,
437
474
  label: i?.textByKey.get(n) ?? r?.label,
@@ -444,284 +481,297 @@ var He = [
444
481
  return e;
445
482
  });
446
483
  o(() => g.id, {
447
- open: () => k.value,
448
- groups: () => zt.value
484
+ open: () => j.value,
485
+ empty: () => K.value,
486
+ groups: () => Yt.value
449
487
  });
450
- let Bt = (e, t) => {
488
+ let Xt = (e, t) => {
451
489
  let n = e.id;
452
490
  if (!n) return;
453
- let r = Et(e), i = new Set(r);
491
+ let r = At(e), i = new Set(r);
454
492
  e.multiple ? i.has(t.rowKey) ? i.delete(t.rowKey) : i.add(t.rowKey) : i.has(t.rowKey) ? e.clearable && i.clear() : (i.clear(), i.add(t.rowKey));
455
- let a = [...i], o = a.filter((e) => !r.includes(e)), s = r.filter((e) => !a.includes(e)), c = bt(n);
456
- if (c) {
457
- let r = W(n, t.rowKey);
458
- o.length && vt.get(n)?.(t.rowKey), e.multiple ? o.length ? L(n, { add: r }) : s.length && L(n, { remove: r }) : o.length ? L(n, { replace: r }) : s.length && L(n, { clear: !0 });
493
+ let a = [...i], o = a.filter((e) => !r.includes(e)), s = r.filter((e) => !a.includes(e)), ee = Ct(n);
494
+ if (ee) {
495
+ let r = U(n, t.rowKey);
496
+ o.length && xt.get(n)?.(t.rowKey), e.multiple ? o.length ? L(n, { add: r }) : s.length && L(n, { remove: r }) : o.length ? L(n, { replace: r }) : s.length && L(n, { clear: !0 });
459
497
  } else P[n] = a;
460
- let ee = (t) => e.items.find((e) => e.rowKey === t);
498
+ let te = (t) => e.items.find((e) => e.rowKey === t);
461
499
  o.forEach((e) => {
462
- ee(e) && C("item:selected", W(n, e));
500
+ te(e) && w("item:selected", U(n, e));
463
501
  }), s.forEach((e) => {
464
- ee(e) ? C("item:unselected", W(n, e)) : c && C("item:unselected", Rt(n, e));
465
- }), (o.length > 0 || s.length > 0 || r.includes(t.rowKey) && a.includes(t.rowKey)) && (g.closeOnSelect ?? !e.multiple) && Wt();
466
- }, J = y(/* @__PURE__ */ new Set()), Vt = (e) => J.has(e), Ht = m(() => J.size > 0), Ut = (e) => e != null && (typeof e == "object" || typeof e == "function") && typeof e.then == "function", Wt = async () => {
502
+ te(e) ? w("item:unselected", U(n, e)) : ee && w("item:unselected", Ht(n, e));
503
+ }), (o.length > 0 || s.length > 0 || r.includes(t.rowKey) && a.includes(t.rowKey)) && (g.closeOnSelect ?? !e.multiple) && tn();
504
+ }, Zt = y(/* @__PURE__ */ new Set()), Qt = (e) => Zt.has(e), $t = p(() => Zt.size > 0), en = (e) => e != null && (typeof e == "object" || typeof e == "function") && typeof e.then == "function", tn = async () => {
467
505
  await $();
468
506
  let e = document.activeElement;
469
- e instanceof HTMLElement && e !== document.body && !e.closest(`[data-bb-dropdown-surface="${T}"]`) || qt();
470
- }, Gt = async (e, t, { close: n = !1 } = {}) => {
507
+ e instanceof HTMLElement && e !== document.body && !e.closest(`[data-bb-dropdown-surface="${E}"]`) || rn();
508
+ }, nn = async (e, t, { close: n = !1 } = {}) => {
471
509
  let r = e.onClick?.(t);
472
- if (n && await Wt(), Ut(r)) {
473
- J.add(e.rowKey);
510
+ if (n && await tn(), en(r)) {
511
+ Zt.add(e.rowKey);
474
512
  try {
475
513
  await r;
476
514
  } finally {
477
- J.delete(e.rowKey);
515
+ Zt.delete(e.rowKey);
478
516
  }
479
517
  }
480
- }, Kt = Re("root-list"), Y, qt = () => {
481
- (O.value ?? (D.value ? document.getElementById(D.value) : null))?.focus();
482
- };
483
- ve({
484
- passthrough: w,
485
- rootId: T,
486
- activatorId: D,
518
+ }, q = Be("root-list"), J, rn = () => {
519
+ (k.value ?? (O.value ? document.getElementById(O.value) : null) ?? an)?.focus();
520
+ }, an = null;
521
+ be({
522
+ passthrough: T,
523
+ rootId: E,
524
+ activatorId: O,
487
525
  setStatus: (e) => {
488
- kt.value = e;
526
+ Nt.value = e;
489
527
  },
490
- status: kt,
491
- open: k,
492
- queryFor: (e) => A[e] ?? "",
528
+ status: Nt,
529
+ open: j,
530
+ queryFor: (e) => it[e] ?? "",
493
531
  setQuery: (e, t) => {
494
- A[e] = t;
532
+ it[e] = t;
495
533
  },
496
534
  activateGroup: (e) => {
497
- rt.has(e) || rt.add(e);
535
+ at.has(e) || at.add(e);
498
536
  },
499
- isActivated: (e) => rt.has(e),
500
- isPipelineGroup: (e) => H.value.includes(e),
501
- isGroupLoading: (e) => !!Pt[e],
502
- isTopLevelPipeline: (e) => Nt.value.includes(e),
503
- queryDebounceTime: m(() => g.queryDebounceTime ?? 300),
537
+ isActivated: (e) => at.has(e),
538
+ isPipelineGroup: (e) => V.value.includes(e),
539
+ isGroupLoading: (e) => !!Rt[e],
540
+ isTopLevelPipeline: (e) => Lt.value.includes(e),
541
+ queryDebounceTime: p(() => g.queryDebounceTime ?? 300),
504
542
  selectedFor: (e) => {
505
- let t = K(e);
506
- return t ? Et(t) : P[e] ?? [];
543
+ let t = G(e);
544
+ return t ? At(t) : P[e] ?? [];
507
545
  },
508
- loadingText: m(() => g.loadingText),
509
- emptyText: m(() => g.emptyText),
510
- failedText: m(() => g.failedText),
511
- enforceCoherence: m(() => g.enforceCoherence),
512
- placement: m(() => g.placement),
513
- disabled: m(() => !!g.disabled),
546
+ loadingText: p(() => g.loadingText),
547
+ emptyText: p(() => g.emptyText),
548
+ failedText: p(() => g.failedText),
549
+ enforceCoherence: p(() => g.enforceCoherence),
550
+ placement: p(() => g.placement),
551
+ disabled: p(() => !!g.disabled),
514
552
  selectedChipsFor: (e) => {
515
- let t = K(e), n = U[e];
553
+ let t = G(e), n = H[e];
516
554
  return (P[e] ?? []).map((r) => ({
517
555
  key: r,
518
- text: n?.textByKey.get(r) ?? t?.items.find((e) => e.rowKey === r)?.label ?? fe(W(e, r) ?? Rt(e, r))
556
+ text: n?.textByKey.get(r) ?? t?.items.find((e) => e.rowKey === r)?.label ?? pe(U(e, r) ?? Ht(e, r))
519
557
  }));
520
558
  },
521
559
  deselect: (e, t) => {
522
560
  let n = P[e] ?? [];
523
561
  if (n.includes(t)) {
524
- if (bt(e)) {
525
- let n = W(e, t) ?? Rt(e, t);
526
- L(e, { remove: n }), C("item:unselected", n);
527
- } else P[e] = n.filter((e) => e !== t), C("item:unselected", W(e, t));
562
+ if (Ct(e)) {
563
+ let n = U(e, t) ?? Ht(e, t);
564
+ L(e, { remove: n }), w("item:unselected", n);
565
+ } else P[e] = n.filter((e) => e !== t), w("item:unselected", U(e, t));
528
566
  }
529
567
  },
530
568
  close: () => $(),
531
- focusActivator: qt,
532
- ownsEscape: () => r(E),
533
- openModality: () => Y,
534
- toggleSelect: Bt,
535
- isItemLoading: Vt,
536
- runItemAction: Gt,
537
- slots: Le()
569
+ focusActivator: rn,
570
+ ownsEscape: () => r(D),
571
+ openModality: () => J,
572
+ toggleSelect: Xt,
573
+ isItemLoading: Qt,
574
+ runItemAction: nn,
575
+ slots: ze()
538
576
  });
539
- let Jt = (e) => {
540
- if (g.disabled) return;
541
- if (Qt) {
542
- Qt = !1, e.preventDefault(), e.stopPropagation();
577
+ let on = (e) => {
578
+ if (g.disabled || K.value) return;
579
+ if (X) {
580
+ X = !1, e.preventDefault(), e.stopPropagation();
543
581
  return;
544
582
  }
545
- e.stopPropagation(), g.placement === "cursor" && (N.value = lt(e.clientX, e.clientY));
546
- let t = k.value;
547
- Yt(e), Y = e.detail ? "pointer" : void 0, t ? $() : Q();
548
- }, Yt = (e) => {
583
+ e.stopPropagation(), g.placement === "cursor" && (N.value = ft(e.clientX, e.clientY));
584
+ let t = j.value;
585
+ sn(e), J = e.detail ? "pointer" : void 0, t ? $() : Q();
586
+ }, sn = (e) => {
549
587
  let t = e.currentTarget;
550
- e.detail && t instanceof HTMLElement && (t.contains(document.activeElement) || oe(t, { preventScroll: !0 }));
551
- }, Xt = async (e) => {
552
- if (!g.disabled) {
588
+ e.detail && t instanceof HTMLElement && (t.contains(document.activeElement) || se(t, { preventScroll: !0 }));
589
+ }, cn = async (e) => {
590
+ if (!(g.disabled || K.value)) {
553
591
  if (e.preventDefault(), e.stopPropagation(), g.placement === "cursor") {
554
- let t = lt(e.clientX, e.clientY);
555
- if (k.value) {
556
- await $(), await ae(g.transitionDuration), N.value = t, await Q();
592
+ let t = ft(e.clientX, e.clientY);
593
+ if (j.value) {
594
+ await $(), await c(g.transitionDuration), N.value = t, await Q();
557
595
  return;
558
596
  }
559
597
  N.value = t;
560
598
  }
561
- k.value ? $() : Q();
599
+ j.value ? $() : Q();
562
600
  }
563
- }, Zt, X = null, Qt = !1, $t = () => {
564
- clearTimeout(Zt), X = null;
565
- }, en = (e) => {
566
- g.disabled || e.pointerType === "mouse" || (Qt = !1, X = {
601
+ }, ln, Y = null, X = !1, un = () => {
602
+ clearTimeout(ln), Y = null;
603
+ }, dn = (e) => {
604
+ g.disabled || K.value || e.pointerType === "mouse" || (X = !1, Y = {
567
605
  x: e.clientX,
568
606
  y: e.clientY
569
- }, Zt = setTimeout(() => {
570
- Qt = !0, g.placement === "cursor" && X && (N.value = lt(X.x, X.y)), X = null, Y = "pointer", Q();
571
- }, Ge));
572
- }, tn = (e) => {
573
- if (!X) return;
574
- let t = e.clientX - X.x, n = e.clientY - X.y;
575
- Math.sqrt(t * t + n * n) > Ke && $t();
576
- }, nn = () => {
577
- $t();
578
- }, rn = async (e) => {
579
- g.disabled || (e.key === "ArrowDown" ? (e.preventDefault(), k.value || (Y = "keyboard", await Q()), await ae(0), Kt.value?.focusFirst(!0)) : e.key === "ArrowUp" ? (e.preventDefault(), k.value || (Y = "keyboard", await Q()), await ae(0), Kt.value?.focusLast(!0)) : e.key === "Tab" && k.value && !e.shiftKey && (e.preventDefault(), Kt.value?.focusFirst(!0)));
580
- }, an = !1, on = () => {
581
- an = !0, setTimeout(() => an = !1, 0);
607
+ }, ln = setTimeout(() => {
608
+ X = !0, g.placement === "cursor" && Y && (N.value = ft(Y.x, Y.y)), Y = null, J = "pointer", Q();
609
+ }, qe));
610
+ }, fn = (e) => {
611
+ if (!Y) return;
612
+ let t = e.clientX - Y.x, n = e.clientY - Y.y;
613
+ Math.sqrt(t * t + n * n) > Je && un();
614
+ }, pn = () => {
615
+ un();
616
+ }, mn = (e) => {
617
+ X && e.cancelable && (e.preventDefault(), X = !1);
618
+ }, hn = async (e) => {
619
+ g.disabled || K.value || (e.key === "ArrowDown" ? (e.preventDefault(), j.value || (J = "keyboard", await Q()), await c(0), q.value?.focusFirst(!0)) : e.key === "ArrowUp" ? (e.preventDefault(), j.value || (J = "keyboard", await Q()), await c(0), q.value?.focusLast(!0)) : e.key === "Tab" && j.value && !e.shiftKey && (e.preventDefault(), q.value?.focusFirst(!0)));
620
+ }, gn = !1, _n = () => {
621
+ gn = !0, setTimeout(() => gn = !1, 0);
582
622
  }, Z = (e) => {
583
623
  let t = e.target;
584
- t instanceof HTMLElement && (e.type === "focusin" && an && O.value?.contains(t) || t.closest(`[data-bb-dropdown-surface="${T}"]`) || e.type === "focusin" && t.querySelector(`[data-bb-dropdown-surface="${T}"]`) || $());
585
- }, sn = (e) => {
624
+ t instanceof HTMLElement && (e.type === "focusin" && gn && k.value?.contains(t) || t.closest(`[data-bb-dropdown-surface="${E}"]`) || e.type === "focusin" && t.querySelector(`[data-bb-dropdown-surface="${E}"]`) || $());
625
+ }, vn = (e) => {
586
626
  let t = e.detail;
587
- t && t.surfaceId !== T && (t.activator?.closest(`[data-bb-dropdown-surface="${T}"]`) || $());
588
- }, cn = () => {
627
+ t && t.surfaceId !== E && (t.activator?.closest(`[data-bb-dropdown-surface="${E}"]`) || $());
628
+ }, yn = () => {
589
629
  let e = document.activeElement?.closest("[data-bb-dropdown-surface]");
590
- return e?.getAttribute("data-bb-dropdown-surface") === T && !!e.closest(".bb-dropdown--submenu");
591
- }, ln = (e) => {
592
- k.value && e.key === "Escape" && r(E) && (cn() || (e.stopImmediatePropagation(), e.preventDefault(), document.activeElement !== O.value && qt(), $()));
630
+ return e?.getAttribute("data-bb-dropdown-surface") === E && !!e.closest(".bb-dropdown--submenu");
631
+ }, bn = (e) => {
632
+ j.value && e.key === "Escape" && r(D) && (yn() || (e.stopImmediatePropagation(), e.preventDefault(), document.activeElement !== k.value && rn(), $()));
593
633
  }, Q = async () => {
594
- ot.value = at(), mt = !0, k.value = !0, document.dispatchEvent(new CustomEvent(We, { detail: {
595
- surfaceId: T,
596
- activator: O.value
597
- } })), M.value || (ht(), i(E, { element: () => document.querySelector(`[data-bb-dropdown-surface="${CSS.escape(String(T))}"]`) }), document.addEventListener("click", Z, { passive: !0 }), document.addEventListener("contextmenu", Z, { passive: !0 }), document.addEventListener("focusin", Z, { passive: !0 }), document.addEventListener("keydown", ln, { capture: !0 }), document.addEventListener(We, sn));
634
+ K.value || (lt.value = ct(), _t = !0, j.value = !0, document.dispatchEvent(new CustomEvent(Ke, { detail: {
635
+ surfaceId: E,
636
+ activator: k.value
637
+ } })), M.value || (vt(), i(D, { element: () => document.querySelector(`[data-bb-dropdown-surface="${CSS.escape(String(E))}"]`) }), document.addEventListener("click", Z, { passive: !0 }), document.addEventListener("contextmenu", Z, { passive: !0 }), document.addEventListener("focusin", Z, { passive: !0 }), document.addEventListener("keydown", bn, { capture: !0 }), document.addEventListener(Ke, vn)));
598
638
  }, $ = async () => {
599
- k.value = !1, gt();
600
- }, un = () => {
601
- a(E), document.removeEventListener("click", Z), document.removeEventListener("contextmenu", Z), document.removeEventListener("focusin", Z), document.removeEventListener("keydown", ln, { capture: !0 }), document.removeEventListener(We, sn);
639
+ j.value = !1, yt();
640
+ };
641
+ oe({
642
+ open: async (e, t, n) => {
643
+ j.value && (await $(), await c(g.transitionDuration)), N.value = e, an = n ?? null, J = t, await Q(), t === "keyboard" && j.value && (await c(0), q.value?.focusFirst(!0));
644
+ },
645
+ close: $,
646
+ isOpen: () => j.value
647
+ });
648
+ let xn = () => {
649
+ a(D), document.removeEventListener("click", Z), document.removeEventListener("contextmenu", Z), document.removeEventListener("focusin", Z), document.removeEventListener("keydown", bn, { capture: !0 }), document.removeEventListener(Ke, vn);
602
650
  };
603
- S(k, (e) => {
651
+ C(j, (e) => {
604
652
  if (!e) {
605
- Y = void 0, un();
606
- for (let e of Object.keys(A)) A[e] = "";
653
+ J = void 0, xn();
654
+ for (let e of Object.keys(it)) it[e] = "";
607
655
  }
608
- }), S(() => g.activator, (t, n) => {
609
- let r = O.value;
610
- t ? O.value = l(t) ?? void 0 : n && (O.value = void 0), r && !O.value && k.value && e({
611
- inPanel: (e) => !!e.closest(`[data-bb-dropdown-surface="${T}"]`),
656
+ }), C(() => g.activator, (t, n) => {
657
+ let r = k.value;
658
+ t ? k.value = ge(t) ?? void 0 : n && (k.value = void 0), r && !k.value && j.value && e({
659
+ inPanel: (e) => !!e.closest(`[data-bb-dropdown-surface="${E}"]`),
612
660
  close: $,
613
- activator: () => O.value
661
+ activator: () => k.value
614
662
  });
615
663
  }, { immediate: !0 });
616
- let dn = null;
617
- S([O, ct], ([e, t]) => {
618
- if (dn &&= (dn(), null), !e) return;
664
+ let Sn = null;
665
+ C([k, dt], ([e, t]) => {
666
+ if (Sn &&= (Sn(), null), !e) return;
619
667
  let n = !1;
620
- e.id || (e.id = T, n = !0), D.value = e.id;
668
+ e.id || (e.id = E, n = !0), O.value = e.id;
621
669
  let r = [];
622
- t.has("click") && (e.addEventListener("click", Jt), e.addEventListener("mousedown", on), r.push(() => {
623
- e.removeEventListener("click", Jt), e.removeEventListener("mousedown", on);
624
- })), t.has("contextMenu") && (e.addEventListener("contextmenu", Xt), e.addEventListener("pointerdown", en), e.addEventListener("pointermove", tn), e.addEventListener("pointerup", nn), e.addEventListener("pointercancel", nn), r.push(() => {
625
- e.removeEventListener("contextmenu", Xt), e.removeEventListener("pointerdown", en), e.removeEventListener("pointermove", tn), e.removeEventListener("pointerup", nn), e.removeEventListener("pointercancel", nn), $t();
626
- })), e.addEventListener("keydown", rn), r.push(() => e.removeEventListener("keydown", rn)), dn = () => {
670
+ t.has("click") && (e.addEventListener("click", on), e.addEventListener("mousedown", _n), r.push(() => {
671
+ e.removeEventListener("click", on), e.removeEventListener("mousedown", _n);
672
+ })), t.has("contextMenu") && (e.addEventListener("contextmenu", cn), e.addEventListener("pointerdown", dn), e.addEventListener("pointermove", fn), e.addEventListener("pointerup", pn), e.addEventListener("pointercancel", pn), e.addEventListener("touchend", mn), r.push(() => {
673
+ e.removeEventListener("contextmenu", cn), e.removeEventListener("pointerdown", dn), e.removeEventListener("pointermove", fn), e.removeEventListener("pointerup", pn), e.removeEventListener("pointercancel", pn), e.removeEventListener("touchend", mn), un();
674
+ })), e.addEventListener("keydown", hn), r.push(() => e.removeEventListener("keydown", hn)), Sn = () => {
627
675
  r.forEach((e) => e()), n && e.removeAttribute("id"), e.removeAttribute("aria-haspopup"), e.removeAttribute("aria-expanded"), e.removeAttribute("aria-controls");
628
676
  };
629
- }, { immediate: !0 }), S([
630
- O,
677
+ }, { immediate: !0 }), C([
631
678
  k,
632
- $e,
633
- At,
634
- jt
635
- ], ([e, t, n, r, i]) => {
636
- e && (e.setAttribute("aria-haspopup", r), e.setAttribute("aria-expanded", n ? String(t) : "false"), n ? e.setAttribute("aria-controls", i) : e.removeAttribute("aria-controls"));
637
- }, { immediate: !0 }), Me(() => {
638
- $t(), dn?.(), un();
679
+ j,
680
+ et,
681
+ Pt,
682
+ Ft,
683
+ K
684
+ ], ([e, t, n, r, i, a]) => {
685
+ e && (a ? (e.removeAttribute("aria-haspopup"), e.removeAttribute("aria-expanded"), e.removeAttribute("aria-controls")) : (e.setAttribute("aria-haspopup", r), e.setAttribute("aria-expanded", n ? String(t) : "false"), n ? e.setAttribute("aria-controls", i) : e.removeAttribute("aria-controls")));
686
+ }, { immediate: !0 }), Pe(() => {
687
+ un(), Sn?.(), xn();
639
688
  });
640
- let fn = m(() => g.width === "auto"), { width: pn } = Be(m(() => me(k.value ? dt.value : null)), {
689
+ let Cn = p(() => g.width === "auto"), { width: wn } = He(p(() => he(j.value ? mt.value : null)), {
641
690
  width: 0,
642
691
  height: 0
643
- }, { box: "border-box" }), mn = m(() => {
692
+ }, { box: "border-box" }), Tn = p(() => {
644
693
  if (g.width !== "auto") {
645
694
  if (g.width) {
646
- let { value: e, unit: t } = he(g.width);
647
- return t === "%" ? dt.value ? `${pn.value * (e / 100)}px` : "0px" : `${e}px`;
695
+ let { value: e, unit: t } = _e(g.width);
696
+ return t === "%" ? mt.value ? `${wn.value * (e / 100)}px` : "0px" : `${e}px`;
648
697
  }
649
698
  return "0px";
650
699
  }
651
700
  });
652
- return Ne(() => {
701
+ return Fe(() => {
653
702
  $();
654
- }), (e, n) => (v(), Oe(Ee, null, [
655
- Ze.value ? De("", !0) : Fe(e.$slots, "activator", je(Ae({
656
- props: { ref: pt },
657
- disabled: p.disabled,
658
- loading: Ht.value,
659
- open: k.value,
660
- placement: p.placement
661
- })), void 0, void 0, 0),
662
- Fe(e.$slots, "default"),
663
- (v(!0), Oe(Ee, null, Pe(H.value, (e) => (v(), h(ue, {
703
+ }), (e, n) => (v(), h(ke, null, [
704
+ !Qe.value && qt.value ? x(e.$slots, "activator", Ne(Me({
705
+ props: { ref: gt },
706
+ disabled: f.disabled,
707
+ empty: K.value,
708
+ loading: $t.value,
709
+ open: j.value,
710
+ placement: f.placement
711
+ })), void 0, void 0, 0) : m("", !0),
712
+ x(e.$slots, "default"),
713
+ (v(!0), h(ke, null, Le(V.value, (e) => (v(), Ae(de, {
664
714
  id: e,
665
715
  key: e
666
716
  }, null, 8, ["id"]))), 128)),
667
- M.value ? (v(), h(le, _({
717
+ M.value ? (v(), Ae(ue, _({
668
718
  key: 1,
669
- modelValue: k.value,
670
- "onUpdate:modelValue": n[0] ||= (e) => k.value = e,
671
- compact: x(j).compact,
672
- "off-canvas-props": st.value,
673
- "root-groups": Ot.value
674
- }, _(Qe, x(t)(x(Se)(e.$attrs)))), null, 16, [
719
+ modelValue: j.value,
720
+ "onUpdate:modelValue": n[0] ||= (e) => j.value = e,
721
+ compact: S(st).compact,
722
+ "off-canvas-props": ut.value,
723
+ "root-groups": Mt.value
724
+ }, _($e, S(t)(S(Te)(e.$attrs)))), null, 16, [
675
725
  "modelValue",
676
726
  "compact",
677
727
  "off-canvas-props",
678
728
  "root-groups"
679
- ])) : (v(), h(se, _({
729
+ ])) : (v(), Ae(ce, _({
680
730
  key: 2,
681
- modelValue: k.value,
682
- "onUpdate:modelValue": n[1] ||= (e) => k.value = e,
683
- anchor: ft.value,
684
- boundary: p.boundary,
685
- "bubble-attrs": nt,
731
+ modelValue: j.value,
732
+ "onUpdate:modelValue": n[1] ||= (e) => j.value = e,
733
+ anchor: ht.value,
734
+ boundary: f.boundary,
735
+ "bubble-attrs": rt,
686
736
  class: ["bb-dropdown", {
687
- "bb-dropdown--mobile": x(it),
688
- "bb-dropdown--compact": x(j).compact
737
+ "bb-dropdown--mobile": S(ot),
738
+ "bb-dropdown--compact": S(st).compact
689
739
  }],
690
- eager: p.eager,
740
+ eager: f.eager,
691
741
  "hide-arrow": "",
692
- offset: p.offset ?? x(qe)() ?? 4,
693
- padding: p.padding,
694
- placement: p.placement === "cursor" ? "bottom-start" : p.placement,
695
- "transition-duration": p.transitionDuration
696
- }, _(Qe, e.$attrs, x(w).root)), {
697
- default: ze(() => [
698
- e.$slots.header ? (v(), Oe("div", _({
742
+ offset: f.offset ?? S(Ye)() ?? 4,
743
+ padding: f.padding,
744
+ placement: f.placement === "cursor" ? "bottom-start" : f.placement,
745
+ "transition-duration": f.transitionDuration
746
+ }, _($e, e.$attrs, S(T).root)), {
747
+ default: Ve(() => [
748
+ e.$slots.header ? (v(), h("div", _({
699
749
  key: 0,
700
750
  class: "bb-dropdown__header"
701
- }, x(w).header), [Fe(e.$slots, "header", {
702
- disabled: p.disabled,
703
- open: k.value,
704
- placement: p.placement
705
- })], 16)) : De("", !0),
706
- ke("span", _({
707
- id: `menu_${x(T)}`,
708
- "aria-labelledby": B.value ? void 0 : D.value,
751
+ }, S(T).header), [x(e.$slots, "header", {
752
+ disabled: f.disabled,
753
+ open: j.value,
754
+ placement: f.placement
755
+ })], 16)) : m("", !0),
756
+ je("span", _({
757
+ id: `menu_${S(E)}`,
758
+ "aria-labelledby": z.value ? void 0 : O.value,
709
759
  class: "bb-dropdown__list scrollbar-border",
710
- role: B.value ? "none" : "menu"
711
- }, x(w).list), [tt.value ? (v(), h(ce, {
760
+ role: z.value ? "none" : "menu"
761
+ }, S(T).list), [nt.value ? (v(), Ae(le, {
712
762
  key: 0,
713
763
  ref: "root-list",
714
- groups: Ot.value
715
- }, null, 8, ["groups"])) : De("", !0)], 16, He),
716
- ke("span", Ue, Ie(kt.value), 1),
717
- e.$slots.footer ? (v(), Oe("div", _({
764
+ groups: Mt.value
765
+ }, null, 8, ["groups"])) : m("", !0)], 16, We),
766
+ je("span", Ge, Re(Nt.value), 1),
767
+ e.$slots.footer ? (v(), h("div", _({
718
768
  key: 1,
719
769
  class: "bb-dropdown__footer"
720
- }, x(w).footer), [Fe(e.$slots, "footer", {
721
- disabled: p.disabled,
722
- open: k.value,
723
- placement: p.placement
724
- })], 16)) : De("", !0)
770
+ }, S(T).footer), [x(e.$slots, "footer", {
771
+ disabled: f.disabled,
772
+ open: j.value,
773
+ placement: f.placement
774
+ })], 16)) : m("", !0)
725
775
  ]),
726
776
  _: 3
727
777
  }, 16, [
@@ -738,4 +788,4 @@ var He = [
738
788
  ], 64));
739
789
  }
740
790
  });
741
- export { C as default };
791
+ export { w as default };