bitboss-ui 3.0.0-beta.74 → 3.0.0-beta.76

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