bitboss-ui 3.0.0-beta.2 → 3.0.0-beta.20

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 (337) hide show
  1. package/README.md +72 -33
  2. package/dist/ai/BbAccordion.md +3 -3
  3. package/dist/ai/BbAlert.md +9 -5
  4. package/dist/ai/BbAsterisk.md +17 -0
  5. package/dist/ai/BbAvatar.md +12 -3
  6. package/dist/ai/BbBadge.md +15 -10
  7. package/dist/ai/BbBadgeButton.md +16 -16
  8. package/dist/ai/BbBaseButton.md +16 -16
  9. package/dist/ai/BbBaseCheckbox.md +8 -8
  10. package/dist/ai/BbBaseCheckboxGroup.md +13 -13
  11. package/dist/ai/BbBaseCheckboxIcon.md +26 -9
  12. package/dist/ai/BbBaseColorInput.md +11 -11
  13. package/dist/ai/BbBaseDatePicker.md +6 -6
  14. package/dist/ai/BbBaseDatePickerInput.md +15 -15
  15. package/dist/ai/BbBaseInputContainer.md +12 -12
  16. package/dist/ai/BbBaseNumberInput.md +8 -8
  17. package/dist/ai/BbBaseRadio.md +5 -5
  18. package/dist/ai/BbBaseRadioGroup.md +7 -7
  19. package/dist/ai/BbBaseRadioIcon.md +25 -9
  20. package/dist/ai/BbBaseRating.md +5 -5
  21. package/dist/ai/BbBaseSelect.md +22 -21
  22. package/dist/ai/BbBaseSlider.md +9 -9
  23. package/dist/ai/BbBaseSwitch.md +8 -8
  24. package/dist/ai/BbBaseSwitchGroup.md +13 -13
  25. package/dist/ai/BbBaseSwitchIcon.md +28 -10
  26. package/dist/ai/BbBaseTag.md +10 -10
  27. package/dist/ai/BbBaseTextInput.md +9 -9
  28. package/dist/ai/BbBaseTextarea.md +9 -9
  29. package/dist/ai/BbBaseTimePickerInput.md +13 -13
  30. package/dist/ai/BbBreadcrumbs.md +2 -2
  31. package/dist/ai/BbButton.md +15 -15
  32. package/dist/ai/BbCheckbox.md +18 -17
  33. package/dist/ai/BbCheckboxGroup.md +15 -14
  34. package/dist/ai/BbCollapsible.md +11 -9
  35. package/dist/ai/BbColorInput.md +15 -15
  36. package/dist/ai/BbColorPalette.md +12 -6
  37. package/dist/ai/BbConfirm.md +12 -5
  38. package/dist/ai/BbDatePicker.md +13 -13
  39. package/dist/ai/BbDatePickerInput.md +20 -20
  40. package/dist/ai/BbDialog.md +78 -12
  41. package/dist/ai/BbDropdown.md +132 -22
  42. package/dist/ai/BbDropdownButton.md +12 -12
  43. package/dist/ai/BbDropdownGroup.md +1 -1
  44. package/dist/ai/BbDropzone.md +4 -4
  45. package/dist/ai/BbForm.md +49 -14
  46. package/dist/ai/BbIcon.md +6 -0
  47. package/dist/ai/BbIndicator.md +5 -5
  48. package/dist/ai/BbNumberInput.md +11 -11
  49. package/dist/ai/BbOffCanvas.md +90 -20
  50. package/dist/ai/BbPagination.md +3 -3
  51. package/dist/ai/BbPopover.md +32 -17
  52. package/dist/ai/BbProgress.md +7 -4
  53. package/dist/ai/BbRadio.md +16 -15
  54. package/dist/ai/BbRadioGroup.md +20 -17
  55. package/dist/ai/BbRating.md +11 -11
  56. package/dist/ai/BbSelect.md +138 -37
  57. package/dist/ai/BbSelectPopover.md +40 -41
  58. package/dist/ai/BbSlider.md +37 -22
  59. package/dist/ai/BbSmoothHeight.md +1 -1
  60. package/dist/ai/BbSwitch.md +25 -10
  61. package/dist/ai/BbSwitchGroup.md +17 -14
  62. package/dist/ai/BbTable.md +791 -88
  63. package/dist/ai/BbTabs.md +28 -14
  64. package/dist/ai/BbTabsList.md +1 -1
  65. package/dist/ai/BbTabsPanes.md +1 -1
  66. package/dist/ai/BbTabsRoot.md +10 -10
  67. package/dist/ai/BbTag.md +14 -14
  68. package/dist/ai/BbTextInput.md +16 -15
  69. package/dist/ai/BbTextarea.md +13 -13
  70. package/dist/ai/BbTimePicker.md +10 -10
  71. package/dist/ai/BbTimePickerInput.md +17 -17
  72. package/dist/ai/BbToast.md +1 -1
  73. package/dist/ai/BbToastPortal.md +1 -1
  74. package/dist/ai/BbTooltip.md +12 -10
  75. package/dist/ai/BbTree.md +1 -1
  76. package/dist/ai/ChipsBox.md +1 -1
  77. package/dist/ai/CommonInputWrapper.md +10 -10
  78. package/dist/ai/CommonPopover.md +6 -6
  79. package/dist/ai/FlatListBox.md +5 -5
  80. package/dist/ai/GroupedListBox.md +5 -5
  81. package/dist/ai/ListBox.md +4 -4
  82. package/dist/ai/OptionsContainer.md +4 -4
  83. package/dist/ai/changelog.json +110 -2
  84. package/dist/ai/components.json +882 -90
  85. package/dist/ai/composables/useBbConfig.md +72 -11
  86. package/dist/ai/composables/useConfirm.md +5 -3
  87. package/dist/ai/guides/ai-router.md +9 -4
  88. package/dist/ai/guides/component-picker.md +2 -2
  89. package/dist/ai/guides/design-language.md +14 -14
  90. package/dist/ai/guides/design-tokens.md +25 -18
  91. package/dist/ai/guides/fetch-items-playbook.md +1 -1
  92. package/dist/ai/guides/icons-policy.md +4 -2
  93. package/dist/ai/guides/installation-and-plugin-setup.md +74 -9
  94. package/dist/ai/guides/migration/components/bb-checkbox-group.md +30 -0
  95. package/dist/ai/guides/migration/components/bb-checkbox.md +37 -3
  96. package/dist/ai/guides/migration/components/bb-collapsible.md +5 -5
  97. package/dist/ai/guides/migration/components/bb-dialog.md +62 -34
  98. package/dist/ai/guides/migration/components/bb-offcanvas.md +29 -13
  99. package/dist/ai/guides/migration/components/bb-rating.md +8 -2
  100. package/dist/ai/guides/migration/components/bb-select.md +5 -2
  101. package/dist/ai/guides/migration/components/bb-table.md +446 -28
  102. package/dist/ai/guides/migration/components/bb-text-input.md +6 -6
  103. package/dist/ai/guides/migration/v2-to-v3.md +260 -89
  104. package/dist/ai/guides/ssr-prefill.md +120 -0
  105. package/dist/ai/index.md +10 -9
  106. package/dist/ai/recipes/inertia/layout-scaffold.md +5 -1
  107. package/dist/ai/recipes/inertia/ownership-atlas.md +41 -20
  108. package/dist/ai/recipes/inertia/records-workspace.md +26 -7
  109. package/dist/ai/recipes/nuxt/layout-scaffold.md +5 -1
  110. package/dist/ai/recipes/nuxt/records-workspace.md +26 -7
  111. package/dist/ai/recipes/vue/layout-scaffold.md +5 -1
  112. package/dist/ai/recipes/vue/records-workspace.md +26 -7
  113. package/dist/ai/source/BbAlert.md +60 -2
  114. package/dist/ai/source/BbAvatar.md +3 -3
  115. package/dist/ai/source/BbBadge.md +60 -15
  116. package/dist/ai/source/BbBadgeButton.md +8 -2
  117. package/dist/ai/source/BbBaseButton.md +3 -1
  118. package/dist/ai/source/BbBaseCheckboxGroup.md +6 -2
  119. package/dist/ai/source/BbBaseDatePicker.md +3 -1
  120. package/dist/ai/source/BbBaseDatePickerInput.md +5 -1
  121. package/dist/ai/source/BbBaseInputContainer.md +52 -1
  122. package/dist/ai/source/BbBaseRadioGroup.md +4 -0
  123. package/dist/ai/source/BbBaseRating.md +3 -1
  124. package/dist/ai/source/BbBaseSelect.md +71 -16
  125. package/dist/ai/source/BbBaseSwitchGroup.md +4 -0
  126. package/dist/ai/source/BbBaseTimePickerInput.md +5 -1
  127. package/dist/ai/source/BbBreadcrumbs.md +31 -0
  128. package/dist/ai/source/BbButton.md +51 -24
  129. package/dist/ai/source/BbCheckbox.md +15 -1
  130. package/dist/ai/source/BbCheckboxGroup.md +2 -1
  131. package/dist/ai/source/BbCollapsible.md +7 -1
  132. package/dist/ai/source/BbColorInput.md +3 -4
  133. package/dist/ai/source/BbColorPalette.md +3 -4
  134. package/dist/ai/source/BbDatePicker.md +5 -1
  135. package/dist/ai/source/BbDatePickerInput.md +5 -1
  136. package/dist/ai/source/BbDialog.md +175 -19
  137. package/dist/ai/source/BbDropdown.md +376 -69
  138. package/dist/ai/source/BbDropdownGroup.md +330 -59
  139. package/dist/ai/source/BbForm.md +93 -5
  140. package/dist/ai/source/BbIcon.md +46 -36
  141. package/dist/ai/source/BbNumberInput.md +3 -4
  142. package/dist/ai/source/BbOffCanvas.md +474 -194
  143. package/dist/ai/source/BbPopover.md +24 -17
  144. package/dist/ai/source/BbProgress.md +2 -2
  145. package/dist/ai/source/BbRadio.md +15 -1
  146. package/dist/ai/source/BbRadioGroup.md +3 -1
  147. package/dist/ai/source/BbSelect.md +50 -2
  148. package/dist/ai/source/BbSelectPopover.md +171 -23
  149. package/dist/ai/source/BbSlider.md +3 -4
  150. package/dist/ai/source/BbSwitch.md +15 -1
  151. package/dist/ai/source/BbSwitchGroup.md +8 -5
  152. package/dist/ai/source/BbTable.md +4642 -1387
  153. package/dist/ai/source/BbTabs.md +6 -7
  154. package/dist/ai/source/BbTabsList.md +6 -7
  155. package/dist/ai/source/BbTabsPanes.md +6 -7
  156. package/dist/ai/source/BbTabsRoot.md +6 -7
  157. package/dist/ai/source/BbTag.md +3 -4
  158. package/dist/ai/source/BbTextInput.md +3 -4
  159. package/dist/ai/source/BbTextarea.md +3 -4
  160. package/dist/ai/source/BbTimePicker.md +4 -1
  161. package/dist/ai/source/BbTimePickerInput.md +5 -1
  162. package/dist/ai/source/BbToast.md +3 -1
  163. package/dist/ai/source/BbTooltip.md +5 -1
  164. package/dist/ai/source/CommonInputWrapper.md +4 -0
  165. package/dist/ai/source/CommonPopover.md +6 -0
  166. package/dist/ai/source/FlatListBox.md +11 -5
  167. package/dist/ai/source/GroupedListBox.md +7 -5
  168. package/dist/components/BbAlert/BbAlert.vue_vue_type_script_setup_true_lang.js +4 -4
  169. package/dist/components/BbAlert/types.d.ts +10 -1
  170. package/dist/components/BbAvatar/BbAvatar.vue.d.ts +1 -1
  171. package/dist/components/BbAvatar/BbAvatar.vue_vue_type_script_setup_true_lang.js +33 -33
  172. package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +22 -16
  173. package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +36 -15
  174. package/dist/components/BbBadge/badgeButtonContext.d.ts +21 -8
  175. package/dist/components/BbBadge/types.d.ts +8 -2
  176. package/dist/components/BbBaseButton/BbBaseButton.vue_vue_type_script_setup_true_lang.js +47 -47
  177. package/dist/components/BbBaseButton/RouterComponent.vue_vue_type_script_setup_true_lang.js +14 -14
  178. package/dist/components/BbBaseCheckboxGroup/BbBaseCheckboxGroup.vue_vue_type_script_setup_true_lang.js +30 -28
  179. package/dist/components/BbBaseCheckboxGroup/types.d.ts +2 -2
  180. package/dist/components/BbBaseDatePicker/BbBaseDatePicker.vue_vue_type_script_setup_true_lang.js +167 -167
  181. package/dist/components/BbBaseDatePicker/BbBaseDatePickerInputDaySelector.vue.d.ts +9 -9
  182. package/dist/components/BbBaseDatePicker/BbBaseDatePickerInputDaySelector.vue_vue_type_script_setup_true_lang.js +78 -78
  183. package/dist/components/BbBaseDatePicker/BbBaseDatePickerMonthSelector.vue_vue_type_script_setup_true_lang.js +64 -64
  184. package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerInput.vue.d.ts +1 -1
  185. package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerInput.vue_vue_type_script_setup_true_lang.js +138 -138
  186. package/dist/components/BbBaseInputContainer/BbBaseInputContainer.vue_vue_type_script_setup_true_lang.js +2 -2
  187. package/dist/components/BbBaseRadioGroup/BbBaseRadioGroup.vue_vue_type_script_setup_true_lang.js +24 -22
  188. package/dist/components/BbBaseRating/BbBaseRating.vue_vue_type_script_setup_true_lang.js +40 -40
  189. package/dist/components/BbBaseSelect/BbBaseSelect.vue_vue_type_script_setup_true_lang.js +74 -65
  190. package/dist/components/BbBaseSelect/types.d.ts +22 -0
  191. package/dist/components/BbBaseSlider/BbBaseSlider.vue_vue_type_script_setup_true_lang.js +5 -5
  192. package/dist/components/BbBaseSwitchGroup/BbBaseSwitchGroup.vue_vue_type_script_setup_true_lang.js +30 -28
  193. package/dist/components/BbBaseTimePickerInput/BbBaseTimePickerInput.vue.d.ts +1 -1
  194. package/dist/components/BbBaseTimePickerInput/BbBaseTimePickerInput.vue_vue_type_script_setup_true_lang.js +104 -104
  195. package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +35 -35
  196. package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +85 -81
  197. package/dist/components/BbCheckboxGroup/types.d.ts +2 -1
  198. package/dist/components/BbCollapsible/types.d.ts +7 -1
  199. package/dist/components/BbColorInput/BbColorInput.vue.d.ts +1 -1
  200. package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +18 -18
  201. package/dist/components/BbColorPalette/BbColorPalette.vue.d.ts +2 -2
  202. package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +50 -50
  203. package/dist/components/BbConfirm/BbConfirm.vue_vue_type_script_setup_true_lang.js +17 -17
  204. package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +1 -1
  205. package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +100 -100
  206. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +21 -21
  207. package/dist/components/BbDialog/BbDialog.vue.d.ts +1 -1
  208. package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +133 -107
  209. package/dist/components/BbDialog/types.d.ts +29 -2
  210. package/dist/components/BbDropdown/AdaptiveDropdown.vue.d.ts +2 -0
  211. package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +99 -100
  212. package/dist/components/BbDropdown/BbDropdown.vue.d.ts +2 -2
  213. package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +208 -201
  214. package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +225 -208
  215. package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +21 -21
  216. package/dist/components/BbDropdown/types.d.ts +20 -5
  217. package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +5 -5
  218. package/dist/components/BbIcon/BbIcon.vue_vue_type_script_setup_true_lang.js +46 -46
  219. package/dist/components/BbIcon/iconCache.d.ts +33 -0
  220. package/dist/components/BbIcon/iconCache.js +17 -0
  221. package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +1 -1
  222. package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +15 -15
  223. package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +1 -1
  224. package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +254 -208
  225. package/dist/components/BbOffCanvas/types.d.ts +30 -5
  226. package/dist/components/BbPagination/BbPagination.vue.d.ts +1 -1
  227. package/dist/components/BbPopover/BbPopover.vue.d.ts +2 -2
  228. package/dist/components/BbPopover/BbPopover.vue_vue_type_script_setup_true_lang.js +149 -146
  229. package/dist/components/BbPopover/types.d.ts +3 -2
  230. package/dist/components/BbRadioGroup/types.d.ts +3 -1
  231. package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +27 -23
  232. package/dist/components/BbSelect/types.d.ts +32 -0
  233. package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +221 -213
  234. package/dist/components/BbSlider/BbSlider.vue.d.ts +1 -1
  235. package/dist/components/BbSlider/BbSlider.vue_vue_type_script_setup_true_lang.js +20 -20
  236. package/dist/components/BbTable/BbTable.vue.d.ts +8 -4
  237. package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1319 -616
  238. package/dist/components/BbTable/BbTableDataRow.d.ts +162 -0
  239. package/dist/components/BbTable/BbTableDataRow.js +136 -0
  240. package/dist/components/BbTable/BbTableExpandRow.d.ts +73 -0
  241. package/dist/components/BbTable/BbTableExpandRow.js +52 -0
  242. package/dist/components/BbTable/types.d.ts +247 -86
  243. package/dist/components/BbTable/utils.d.ts +87 -4
  244. package/dist/components/BbTable/utils.js +71 -36
  245. package/dist/components/BbTabs/types.d.ts +0 -8
  246. package/dist/components/BbTag/BbTag.vue.d.ts +1 -1
  247. package/dist/components/BbTag/BbTag.vue_vue_type_script_setup_true_lang.js +18 -18
  248. package/dist/components/BbTextInput/BbTextInput.vue.d.ts +1 -1
  249. package/dist/components/BbTextInput/BbTextInput.vue_vue_type_script_setup_true_lang.js +18 -18
  250. package/dist/components/BbTextarea/BbTextarea.vue.d.ts +1 -1
  251. package/dist/components/BbTextarea/BbTextarea.vue_vue_type_script_setup_true_lang.js +54 -54
  252. package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +1 -1
  253. package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +80 -80
  254. package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +61 -61
  255. package/dist/components/BbToast/BbToast.vue_vue_type_script_setup_true_lang.js +17 -17
  256. package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +13 -13
  257. package/dist/components/BbTooltip/types.d.ts +5 -1
  258. package/dist/components/ChipsBox/ChipsBox.vue_vue_type_script_setup_true_lang.js +17 -17
  259. package/dist/components/ClearableButton/ClearableButton.vue_vue_type_script_setup_true_lang.js +5 -5
  260. package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +2 -1
  261. package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +83 -83
  262. package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +56 -56
  263. package/dist/composables/useBaseOptions.js +30 -20
  264. package/dist/composables/useBbConfig.d.ts +27 -6
  265. package/dist/composables/useBbConfig.js +8 -2
  266. package/dist/composables/useConfig.d.ts +59 -0
  267. package/dist/composables/useConfig.js +9 -0
  268. package/dist/composables/useItemsGetter.d.ts +11 -0
  269. package/dist/composables/useItemsGetter.js +44 -18
  270. package/dist/composables/useLocale.js +10 -7
  271. package/dist/composables/useMobile.js +5 -5
  272. package/dist/composables/usePrefill.d.ts +21 -2
  273. package/dist/composables/usePrefill.js +25 -19
  274. package/dist/composables/useSsrState.d.ts +20 -0
  275. package/dist/composables/useSsrState.js +13 -0
  276. package/dist/composables/useToast.js +5 -5
  277. package/dist/deprecation/ai-deprecations.json.d.ts +99 -11
  278. package/dist/deprecation/ai-deprecations.json.js +1 -1
  279. package/dist/directives/bbDropdown.d.ts +15 -4
  280. package/dist/directives/bbDropdown.js +31 -9
  281. package/dist/directives/createPopoverDirective.d.ts +62 -0
  282. package/dist/directives/createPopoverDirective.js +63 -23
  283. package/dist/i18n/locales/cs.json +4 -1
  284. package/dist/i18n/locales/da.json +4 -1
  285. package/dist/i18n/locales/de.json +4 -1
  286. package/dist/i18n/locales/el.json +4 -1
  287. package/dist/i18n/locales/en.json +4 -1
  288. package/dist/i18n/locales/es.json +4 -1
  289. package/dist/i18n/locales/fi.json +4 -1
  290. package/dist/i18n/locales/fr.json +4 -1
  291. package/dist/i18n/locales/hu.json +4 -1
  292. package/dist/i18n/locales/it.json +4 -1
  293. package/dist/i18n/locales/ja.json +4 -1
  294. package/dist/i18n/locales/ko.json +4 -1
  295. package/dist/i18n/locales/nb.json +4 -1
  296. package/dist/i18n/locales/nl.json +4 -1
  297. package/dist/i18n/locales/pl.json +4 -1
  298. package/dist/i18n/locales/pt.json +4 -1
  299. package/dist/i18n/locales/ro.json +4 -1
  300. package/dist/i18n/locales/ru.json +4 -1
  301. package/dist/i18n/locales/sv.json +4 -1
  302. package/dist/i18n/locales/tr.json +4 -1
  303. package/dist/i18n/locales/uk.json +4 -1
  304. package/dist/i18n/locales/zh-cn.json +4 -1
  305. package/dist/index.d.ts +7 -2
  306. package/dist/index.js +69 -67
  307. package/dist/llms-full.txt +3712 -1381
  308. package/dist/llms-medium.txt +113 -43
  309. package/dist/llms.txt +7 -6
  310. package/dist/locale-blueprint.json +4 -1
  311. package/dist/nuxt-auto-imports.d.ts +100 -0
  312. package/dist/nuxt-auto-imports.js +55 -0
  313. package/dist/nuxt-module.d.ts +22 -1
  314. package/dist/nuxt.js +22 -8
  315. package/dist/plugin.d.ts +10 -1
  316. package/dist/plugin.js +20 -19
  317. package/dist/runtime/nuxt-plugin.js +28 -21
  318. package/dist/styles.css +1 -1
  319. package/dist/utilities/misc/listboxMetrics.d.ts +3 -3
  320. package/dist/utilities/misc/listboxMetrics.js +2 -2
  321. package/dist/utilities/misc/ssrStateInjectionKey.d.ts +42 -0
  322. package/dist/utilities/misc/ssrStateInjectionKey.js +4 -0
  323. package/dist/validated/BbForm.vue_vue_type_script_setup_true_lang.js +45 -27
  324. package/dist/validated/BbSelect.vue.d.ts +2 -0
  325. package/dist/validated/BbSelect.vue_vue_type_script_setup_true_lang.js +1 -0
  326. package/dist/validated/useValidatedField.js +25 -23
  327. package/dist/vite.js +6 -2
  328. package/llms.txt +8 -7
  329. package/package.json +2 -2
  330. package/scripts/lib/eslint-plugin.d.ts +19 -1
  331. package/scripts/lib/eslint-plugin.mjs +146 -0
  332. package/scripts/lib/html-attributes.mjs +91 -0
  333. package/scripts/lib/validate-bb-markup.mjs +59 -4
  334. package/dist/assets/svgs/sort.svg_raw.js +0 -4
  335. package/dist/components/BbBadge/BadgeAppendIcon.vue.d.ts +0 -3
  336. package/dist/components/BbBadge/BadgeAppendIcon.vue.js +0 -5
  337. package/dist/components/BbBadge/BadgeAppendIcon.vue_vue_type_script_setup_true_lang.js +0 -22
@@ -2,98 +2,109 @@ import { useId as e } from "../../composables/useId.js";
2
2
  import { removedPropsFor as t } from "../../deprecation/removedProps.js";
3
3
  import { useLogger as n } from "../../composables/useLogger.js";
4
4
  import { warnRemovedAttrs as r } from "../../utilities/functions/warnRemovedAttrs.js";
5
- import i from "../BbBaseButton/BbBaseButton.vue.js";
6
- import a from "../BbIcon/BbIcon.vue.js";
7
- import { isNil as o } from "../../utilities/functions/isNil.js";
8
- import { useLocale as s } from "../../composables/useLocale.js";
9
- import { useItemsGetter as c } from "../../composables/useItemsGetter.js";
10
- import { useItemValue as l } from "../../composables/useItemValue.js";
5
+ import { isTopEscapeEntry as i, pushEscapeEntry as a, removeEscapeEntry as o } from "../../utils/overlayEscapeStack.js";
6
+ import s from "../BbBaseButton/BbBaseButton.vue.js";
7
+ import { useLocale as c } from "../../composables/useLocale.js";
8
+ import { isNil as l } from "../../utilities/functions/isNil.js";
11
9
  import { hash as u } from "../../utilities/functions/hash.js";
12
- import { useHashedWatcher as ee } from "../../composables/useHashedWatcher.js";
13
- import { useBbTableContextHost as te } from "../../composables/useBbTableContext.js";
14
- import { clamp as ne } from "../../utilities/functions/clamp.js";
15
- import d from "../BbBaseCheckbox/BbBaseCheckbox.vue.js";
16
- import { useIndexById as f } from "../../composables/useIndexById.js";
17
- import { useBaseOptions as re } from "../../composables/useBaseOptions.js";
18
- import { usePrefill as ie } from "../../composables/usePrefill.js";
19
- import { parseCount as ae, parsePositiveInteger as p } from "../../utilities/functions/parsePaginationNumber.js";
20
- import oe from "../BbBaseRadio/BbBaseRadio.vue.js";
21
- import { when as se } from "../../utilities/functions/when.js";
22
- import { useTableWidthContext as ce } from "../../composables/useTableWidthContext.js";
23
- import le from "../../assets/svgs/sort.svg_raw.js";
24
- import { applyFixedTableColumns as ue, columnKeyToSlotName as de, mergeCellClasses as fe, mergeHeaderClasses as pe, mergeRowClasses as me } from "./utils.js";
25
- import { Fragment as m, computed as h, createBlock as he, createCommentVNode as g, createElementBlock as _, createElementVNode as v, createTextVNode as ge, createVNode as _e, defineComponent as y, mergeModels as ve, mergeProps as ye, nextTick as be, normalizeClass as b, normalizeStyle as x, onBeforeUnmount as xe, onMounted as Se, openBlock as S, reactive as Ce, ref as C, renderList as w, renderSlot as T, resolveDynamicComponent as we, toDisplayString as E, toRef as Te, unref as D, useModel as Ee, watch as O, withCtx as De } from "vue";
10
+ import { useItemsGetter as d } from "../../composables/useItemsGetter.js";
11
+ import { useItemValue as f } from "../../composables/useItemValue.js";
12
+ import { useHashedWatcher as p } from "../../composables/useHashedWatcher.js";
13
+ import { useBbTableContextHost as ee } from "../../composables/useBbTableContext.js";
14
+ import { clamp as te } from "../../utilities/functions/clamp.js";
15
+ import ne from "../BbBaseCheckbox/BbBaseCheckbox.vue.js";
16
+ import { useIndexById as re } from "../../composables/useIndexById.js";
17
+ import { useBaseOptions as ie } from "../../composables/useBaseOptions.js";
18
+ import { usePrefill as ae } from "../../composables/usePrefill.js";
19
+ import { parseCount as oe, parsePositiveInteger as se } from "../../utilities/functions/parsePaginationNumber.js";
20
+ import { when as ce } from "../../utilities/functions/when.js";
21
+ import { useTableWidthContext as le } from "../../composables/useTableWidthContext.js";
22
+ import ue from "./BbTableDataRow.js";
23
+ import de from "./BbTableExpandRow.js";
24
+ import { applyFixedTableColumns as fe, columnKeyToSlotName as pe, completeColumnOrder as me, mergeCellClasses as he, mergeHeaderClasses as ge, mergeRowClasses as _e, moveColumnKey as ve, orderColumns as ye, readResolvedTracks as be, sameColumnOrder as xe } from "./utils.js";
25
+ import { Fragment as m, computed as h, createBlock as g, createCommentVNode as _, createElementBlock as v, createElementVNode as y, createTextVNode as Se, defineComponent as Ce, getCurrentInstance as we, mergeModels as Te, mergeProps as Ee, nextTick as De, normalizeClass as b, normalizeStyle as x, onBeforeUnmount as Oe, onMounted as ke, openBlock as S, reactive as Ae, ref as C, renderList as je, renderSlot as w, resolveDynamicComponent as Me, shallowRef as Ne, toDisplayString as T, toRef as Pe, unref as E, useModel as Fe, useSlots as Ie, watch as D, withCtx as Le, withModifiers as Re } from "vue";
26
+ import { defaultRangeExtractor as ze, elementScroll as Be, observeElementOffset as Ve, observeElementRect as He, observeWindowOffset as Ue, observeWindowRect as We, useVirtualizer as Ge, windowScroll as Ke } from "@tanstack/vue-virtual";
26
27
  //#region src/components/BbTable/BbTable.vue?vue&type=script&setup=true&lang.ts
27
- var Oe = {
28
+ var qe = {
28
29
  key: 0,
29
30
  class: "sr-only"
30
- }, ke = ["aria-rowcount"], Ae = ["inert"], je = ["aria-rowindex"], Me = { class: "bb-table-header__content" }, Ne = { class: "bb-table-check__label-text sr-only" }, Pe = {
31
+ }, Je = ["id"], Ye = ["id"], Xe = {
32
+ "aria-live": "polite",
33
+ class: "bb-table-loading__text sr-only",
34
+ role: "status"
35
+ }, Ze = {
36
+ "aria-live": "polite",
37
+ class: "bb-table__reorder-status sr-only",
38
+ role: "status"
39
+ }, Qe = ["aria-labelledby", "aria-rowcount"], $e = ["inert"], et = ["aria-rowindex"], tt = { class: "bb-table-header__content" }, nt = { class: "bb-table-check__label-text sr-only" }, rt = {
31
40
  key: 1,
32
41
  class: "bb-table-radio__label-text sr-only"
33
- }, Fe = ["aria-sort"], Ie = { class: "bb-table-header__content" }, Le = {
42
+ }, it = [
43
+ "aria-describedby",
44
+ "aria-sort",
45
+ "data-column-key",
46
+ "tabindex",
47
+ "onClick",
48
+ "onFocus",
49
+ "onKeydown"
50
+ ], at = { class: "bb-table-header__content" }, ot = {
34
51
  key: 1,
35
52
  class: "bb-table-header__content"
36
- }, Re = { class: "bb-table-header__content sr-only" }, ze = ["aria-rowindex"], Be = {
53
+ }, st = ["onDblclick", "onPointerdown"], ct = { class: "bb-table-header__content sr-only" }, lt = ["aria-rowindex"], ut = {
37
54
  key: 0,
38
- class: "bb-table-skeleton__cell bb-table-skeleton__cell--select"
39
- }, Ve = {
55
+ class: "bb-table-skeleton__cell bb-table-skeleton__cell--select",
56
+ role: "cell"
57
+ }, dt = {
40
58
  key: 0,
41
59
  class: "bb-table-skeleton__cell-content"
42
- }, He = {
60
+ }, ft = {
43
61
  key: 1,
44
62
  class: "bb-table-skeleton__avatar"
45
- }, Ue = {
63
+ }, pt = {
46
64
  key: 2,
47
65
  class: "bb-table-skeleton__avatar-text"
48
- }, We = { class: "bb-table-skeleton__cell-content" }, Ge = {
66
+ }, mt = { class: "bb-table-skeleton__cell-content" }, ht = {
49
67
  key: 3,
50
68
  class: "bb-table-skeleton__image"
51
- }, Ke = {
69
+ }, gt = {
52
70
  key: 4,
53
71
  class: "bb-table-skeleton__badge"
54
- }, qe = {
72
+ }, _t = {
55
73
  key: 1,
56
- class: "bb-table-skeleton__cell bb-table-skeleton__cell--actions"
57
- }, Je = ["aria-rowindex"], Ye = ["colspan"], Xe = { class: "bb-table-no-data__text" }, Ze = [
58
- "aria-current",
59
- "aria-rowindex",
60
- "inert",
61
- "tabindex",
62
- "onClick",
63
- "onContextmenu",
64
- "onDblclick",
65
- "onFocus",
66
- "onKeydown"
67
- ], Qe = { class: "bb-table-check__label-text sr-only" }, $e = { class: "bb-table-radio__label-text sr-only" }, et = ["id", "aria-rowindex"], tt = ["colspan"], nt = ["aria-rowindex"], rt = ["colspan"], it = { class: "bb-table-loading__text sr-only" }, at = 10, k = /*@__PURE__*/ y({
74
+ class: "bb-table-skeleton__cell bb-table-skeleton__cell--actions",
75
+ role: "cell"
76
+ }, vt = ["aria-rowindex"], yt = ["aria-colspan"], bt = { class: "bb-table-no-data__text" }, xt = ["data-index"], St = ["role"], Ct = 48, wt = 10, Tt = "bb-table-resizing", Et = 5, Dt = 10, Ot = 500, kt = 40, At = 12, jt = 4, Mt = 12, Nt = "a, button:not(.bb-table-sort), input, select, textarea, [contenteditable], [role=\"button\"], .bb-table-header__resizer", Pt = 12, Ft = 10, It = 600, Lt = 120, Rt = 6, zt = 120, Bt = 10, O = /*@__PURE__*/ Ce({
68
77
  __name: "BbTable",
69
- props: /*@__PURE__*/ ve({
78
+ props: /*@__PURE__*/ Te({
70
79
  accessibleLabel: {},
71
80
  actions: { type: Boolean },
72
81
  actionsText: {},
73
82
  align: { default: "left" },
74
- id: {},
75
- inheritColumnWidths: { type: [Boolean, String] },
76
- disableSelectAll: { type: Boolean },
77
83
  caption: {},
78
84
  compact: { type: Boolean },
79
85
  dependencies: { default: () => [] },
80
86
  depsDebounceTime: { default: 0 },
81
87
  disabled: { type: Boolean },
82
- enforceCoherence: { type: Boolean },
88
+ disableSelectAll: { type: Boolean },
83
89
  displayCaption: { type: Boolean },
90
+ enforceCoherence: { type: Boolean },
91
+ expandedItems: {},
84
92
  fixed: { type: Boolean },
85
93
  fixedColumns: { default: () => [] },
86
94
  fixedHeaders: { type: Boolean },
95
+ headerRowClass: {},
87
96
  highlighted: {},
97
+ id: {},
98
+ inheritColumnWidths: { type: [Boolean, String] },
99
+ interactiveWhileLoading: { type: Boolean },
88
100
  items: {
89
101
  type: [Array, Function],
90
102
  default: () => []
91
103
  },
92
- keyboardNavigation: { type: Boolean },
93
104
  itemValue: {},
105
+ keyboardNavigation: { type: Boolean },
94
106
  legend: {},
95
107
  loading: { type: Boolean },
96
- interactiveWhileLoading: { type: Boolean },
97
108
  loadingText: {},
98
109
  max: { default: Infinity },
99
110
  modelValue: { default: () => [] },
@@ -103,22 +114,24 @@ var Oe = {
103
114
  },
104
115
  name: {},
105
116
  noDataText: {},
117
+ order: {},
106
118
  page: {},
107
119
  perPage: {},
108
120
  readonly: { type: Boolean },
121
+ reorderable: { type: Boolean },
122
+ resizable: { type: Boolean },
109
123
  rowClass: {},
110
- headerRowClass: {},
111
- selectAll: { type: Boolean },
112
124
  selectable: { type: [Boolean, Function] },
113
- sort: {},
114
- expandedItems: {},
125
+ selectAll: { type: Boolean },
115
126
  selectAllLabel: {},
116
127
  selectText: {},
128
+ sort: {},
117
129
  tdClass: {},
118
130
  thClass: {},
119
131
  totalItems: {},
120
132
  totalPages: {},
121
133
  unselectedItems: { default: () => [] },
134
+ virtual: { type: Boolean },
122
135
  columns: { default: () => [] }
123
136
  }, {
124
137
  selectAll: {
@@ -132,6 +145,11 @@ var Oe = {
132
145
  default: () => []
133
146
  },
134
147
  sortModifiers: {},
148
+ order: {
149
+ required: !1,
150
+ default: () => []
151
+ },
152
+ orderModifiers: {},
135
153
  highlighted: {
136
154
  required: !1,
137
155
  default: void 0
@@ -143,7 +161,7 @@ var Oe = {
143
161
  },
144
162
  expandedItemsModifiers: {}
145
163
  }),
146
- emits: /*@__PURE__*/ ve([
164
+ emits: /*@__PURE__*/ Te([
147
165
  "click:row",
148
166
  "contextmenu:row",
149
167
  "dblclick:row",
@@ -151,6 +169,8 @@ var Oe = {
151
169
  "update:modelValue",
152
170
  "update:selectAll",
153
171
  "update:sort",
172
+ "update:order",
173
+ "resize:column",
154
174
  "update:expandedItems",
155
175
  "update:unselectedItems",
156
176
  "item:selected",
@@ -158,413 +178,1051 @@ var Oe = {
158
178
  ], [
159
179
  "update:selectAll",
160
180
  "update:sort",
181
+ "update:order",
161
182
  "update:highlighted",
162
183
  "update:expandedItems"
163
184
  ]),
164
- setup(y, { emit: ve }) {
165
- let k = Ee(y, "selectAll"), A = Ee(y, "sort"), j = Ee(y, "highlighted"), M = Ee(y, "expandedItems"), N = y, P = ve;
185
+ setup(Ce, { emit: Te }) {
186
+ let O = Fe(Ce, "selectAll"), k = Fe(Ce, "sort"), Vt = Fe(Ce, "order"), A = Fe(Ce, "highlighted"), j = Fe(Ce, "expandedItems"), M = Ce, N = Te, P = Ie();
166
187
  process.env.NODE_ENV !== "production" && r("BbTable", t("BbTable"));
167
- let { getItemValue: ot } = l(), st = e().id.value;
168
- N.multiple && !Array.isArray(N.modelValue) && n().throw("BbTable is set for multiple selection but modelValue is not an array.");
169
- let ct = ["actions", "select"];
188
+ let { getItemValue: Ht } = f(), Ut = e().id.value;
189
+ M.multiple && !Array.isArray(M.modelValue) && n().throw("BbTable is set for multiple selection but modelValue is not an array.");
190
+ let Wt = ["actions", "select"], Gt = ["prepend", "append"], Kt = (e) => Gt.includes(e);
170
191
  if (process.env.NODE_ENV !== "production") {
171
- let e = N.columns.filter((e) => ct.includes(e.key));
192
+ let e = M.columns.filter((e) => Wt.includes(e.key));
172
193
  for (let t of e) n().warn(`BbTable: \`{ key: '${String(t.key)}' }\` is a reserved column and must not appear in \`columns\`. ` + (t.key === "actions" ? "Set the `actions` prop and fill the `#actions` slot instead." : "Selection is controlled by the `selectable` prop."));
194
+ for (let e of M.columns) {
195
+ let t = pe(e.key);
196
+ Kt(t) && n().warn(`BbTable: column key '${String(e.key)}' normalizes to the slot name '${t}', which collides with the table-wide \`#header:${t}\` slot. That name keeps its table-wide meaning and per-column header slots are unavailable for this column.`);
197
+ }
173
198
  }
174
- let { t: F } = s(), I = C(), L = C(), { id: lt, parentId: R, parentNode: ut, cssVars: dt, parentVar: ft, setTracks: pt } = ce({
175
- id: () => N.id,
199
+ let { t: F } = c(), I = C(), L = C(), { id: qt, parentId: Jt, parentNode: Yt, node: Xt, cssVars: Zt, parentVar: Qt, setTracks: $t } = le({
200
+ id: () => M.id,
176
201
  container: () => L.value,
177
- inheritFrom: () => typeof N.inheritColumnWidths == "string" ? N.inheritColumnWidths : void 0
178
- }), { data: mt } = f({ items: h(() => o(j.value) ? [] : [j.value]) }), z = (e) => {
179
- let t = e.valueHash in mt.value;
180
- j.value = t ? null : e.value;
181
- }, ht = (e, t) => {
182
- e.target instanceof Element && (e.target.closest("a, button, input, label, select, textarea, [contenteditable], [role=\"button\"]") || window.getSelection()?.toString() || z(t));
183
- }, gt = (e) => A.value.find(([t]) => t === e)?.[1] ?? null, _t = (e) => {
184
- let t = gt(e);
185
- t === null ? A.value = [...A.value, [e, "asc"]] : t === "asc" ? A.value = A.value.map((t) => t[0] === e ? [e, "desc"] : t) : A.value = A.value.filter(([t]) => t !== e);
186
- }, { state: B, isReady: vt } = te(() => lt.value, {
202
+ inheritFrom: () => typeof M.inheritColumnWidths == "string" ? M.inheritColumnWidths : void 0
203
+ }), en = h(() => `${qt.value}__caption`), tn = h(() => `${qt.value}__header_instructions`), nn = h(() => !!(M.reorderable || M.resizable)), rn = h(() => M.columns.map((e) => String(e.key))), R = C(null), z = h(() => {
204
+ let e = R.value ?? Vt.value;
205
+ if (!e.length) return M.columns;
206
+ let t = ye(M.columns, e);
207
+ return t.every((e, t) => e === M.columns[t]) ? M.columns : t;
208
+ }), an = h(() => z.value.map((e) => String(e.key))), on = (e, t) => {
209
+ let n = me(Vt.value, rn.value), r = ve(Vt.value, rn.value, e, t);
210
+ return xe(r, n) ? null : r;
211
+ }, sn = C("");
212
+ D(() => M.reorderable, () => {
213
+ sn.value = "";
214
+ });
215
+ let cn = (e, t) => {
216
+ let n = z.value, r = n.findIndex((t) => String(t.key) === e);
217
+ r < 0 || r === t || (sn.value = F("table.columnMoved", n[r].label, r + 1, n.length).value);
218
+ }, ln = C(null), un = h(() => {
219
+ let e = an.value, t = ln.value;
220
+ return t !== null && e.includes(t) ? t : e[0] ?? null;
221
+ }), dn = (e, t) => {
222
+ if (!t.sortable) return;
223
+ let n = e.target;
224
+ if (!(n instanceof Element)) return;
225
+ let r = e.currentTarget;
226
+ if (n.closest(".bb-table-sort")) return;
227
+ let i = n.closest(Nt);
228
+ i && r.contains(i) || window.getSelection()?.toString() || mr(t.key);
229
+ }, fn = (e) => {
230
+ nn.value && (ln.value = e);
231
+ }, pn = (e) => I.value?.querySelector(`:scope > .bb-table__head > .bb-table-header-row > [data-column-key="${CSS.escape(e)}"]`) ?? null, mn = (e) => {
232
+ let t = an.value, n = t[Math.max(0, Math.min(t.length - 1, e))];
233
+ n && (ln.value = n, pn(n)?.focus());
234
+ }, hn = async (e, t) => {
235
+ if (!nn.value) return;
236
+ let n = e.currentTarget, r = e.target;
237
+ if (!(r instanceof Element) || r !== n && !r.closest(".bb-table-sort")) return;
238
+ let i = getComputedStyle(n).direction === "rtl";
239
+ if (e.altKey && !e.ctrlKey && !e.metaKey) {
240
+ if (!gn.value || e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
241
+ e.preventDefault();
242
+ let r = e.key === "ArrowRight" !== i, a = B.value[t] ?? n.getBoundingClientRect().width;
243
+ wn({ [t]: a + (r ? 1 : -1) * wt });
244
+ return;
245
+ }
246
+ if (e.ctrlKey || e.metaKey) return;
247
+ let a = an.value, o = a.indexOf(t);
248
+ if (o < 0) return;
249
+ let s;
250
+ switch (e.key) {
251
+ case "ArrowLeft":
252
+ s = i ? o + 1 : o - 1;
253
+ break;
254
+ case "ArrowRight":
255
+ s = i ? o - 1 : o + 1;
256
+ break;
257
+ case "Home":
258
+ s = 0;
259
+ break;
260
+ case "End":
261
+ s = a.length - 1;
262
+ break;
263
+ case "Enter":
264
+ case " ":
265
+ if (r !== n || !z.value[o]?.sortable) return;
266
+ e.preventDefault(), mr(t);
267
+ return;
268
+ default: return;
269
+ }
270
+ if (e.preventDefault(), !e.shiftKey) {
271
+ mn(s);
272
+ return;
273
+ }
274
+ if (!M.reorderable) return;
275
+ let c = on(t, s);
276
+ c && (sn.value = "", Vt.value = c, ln.value = t, await De(), pn(t)?.focus(), cn(t, o));
277
+ };
278
+ process.env.NODE_ENV !== "production" && (D(Vt, (e) => {
279
+ new Set(e).size !== e.length && n().warn("BbTable: `order` lists a key more than once — the first occurrence wins.");
280
+ }, { immediate: !0 }), D(() => M.columns.some((e) => e.snap != null) && (!!M.reorderable || z.value !== M.columns), (e) => {
281
+ e && n().warn("BbTable: `snap` is positional in the parent's rendered order and does not compose with `order` / `reorderable` on the same table — order the parent (a snap-mapped child follows its slots), or drop the snaps and share the parent's `order` with a same-key child.");
282
+ }, { immediate: !0 }));
283
+ let gn = h(() => !!M.resizable && !K.value), B = C({}), V = C(null), _n = C(null), vn = (e) => {
284
+ let t = String(e.key);
285
+ return V.value?.[t] ?? B.value[t] ?? e.width ?? (q.value ? J.value[t] : void 0);
286
+ }, yn = (e) => {
287
+ let t = String(e.key);
288
+ return V.value?.[t] !== void 0 || t in B.value;
289
+ }, bn = h(() => Object.keys(V.value ?? {}).join(" ")), xn = h(() => /* @__PURE__ */ new Set([...Object.keys(B.value), ...bn.value.split(" ").filter(Boolean)])), Sn = h(() => {
290
+ let e = /* @__PURE__ */ new Map(), t = xn.value, n = q.value, r = J.value;
291
+ for (let i of z.value) {
292
+ let a = String(i.key), o = n && i.width == null, s = [];
293
+ o && s.push("bb-table-data__cell--nowrap"), t.has(a) && s.push("bb-table-data__cell--resized"), (t.has(a) || o && a in r) && s.push("bb-table-data__cell--clip"), s.length && e.set(a, s.join(" "));
294
+ }
295
+ return e;
296
+ }), Cn = h(() => V.value !== null || Object.keys(B.value).length > 0), wn = (e) => {
297
+ let t = { ...B.value }, n = [];
298
+ for (let [r, i] of Object.entries(e)) {
299
+ let e = Math.max(Ct, Math.round(i));
300
+ t[r] !== e && (t[r] = e, n.push([r, e]));
301
+ }
302
+ if (n.length) {
303
+ B.value = t;
304
+ for (let [e, t] of n) N("resize:column", e, t);
305
+ }
306
+ }, Tn = (e) => {
307
+ if (!(e in B.value)) return;
308
+ let { [e]: t, ...n } = B.value;
309
+ B.value = n, N("resize:column", e, null);
310
+ };
311
+ D(() => M.columns.map((e) => [String(e.key), e.width]), (e, t) => {
312
+ if (!t || !Object.keys(B.value).length) return;
313
+ let n = new Map(t), r = B.value, i = e.filter(([e, t]) => n.has(e) && n.get(e) !== t && e in r && t !== r[e]);
314
+ if (!i.length) return;
315
+ let a = { ...r };
316
+ for (let [e] of i) delete a[e];
317
+ B.value = a;
318
+ });
319
+ let H = null, En = () => {
320
+ document.removeEventListener("pointermove", On), document.removeEventListener("pointerup", kn), document.removeEventListener("pointercancel", An), document.removeEventListener("keydown", jn, !0), window.removeEventListener("blur", An);
321
+ }, Dn = () => {
322
+ if (En(), H) try {
323
+ H.handle.releasePointerCapture(H.pointerId);
324
+ } catch {}
325
+ document.documentElement.classList.remove(Tt), H = null, V.value = null, _n.value = null, I.value && (I.value.style.gridTemplateColumns = Xr.value);
326
+ }, On = (e) => {
327
+ if (!H || e.pointerId !== H.pointerId) return;
328
+ let t = (e.clientX - H.x0) * (H.rtl ? -1 : 1);
329
+ t = Math.max(Ct - H.startWidth, t);
330
+ let { neighbour: n } = H;
331
+ if (e.shiftKey && n) {
332
+ t = Math.min(n.startWidth - Ct, t), V.value = {
333
+ [H.key]: Math.round(H.startWidth + t),
334
+ [n.key]: Math.round(n.startWidth - t)
335
+ };
336
+ return;
337
+ }
338
+ V.value = { [H.key]: Math.round(H.startWidth + t) };
339
+ }, kn = (e) => {
340
+ if (!H || e.pointerId !== H.pointerId) return;
341
+ let { key: t, startWidth: n, neighbour: r } = H, i = V.value;
342
+ if (Dn(), !i) return;
343
+ let a = {};
344
+ i[t] !== Math.round(n) && (a[t] = i[t]), r && i[r.key] !== void 0 && i[r.key] !== Math.round(r.startWidth) && (a[r.key] = i[r.key]), wn(a);
345
+ }, An = (e) => {
346
+ H && (e instanceof PointerEvent && e.pointerId !== H.pointerId || Dn());
347
+ }, jn = (e) => {
348
+ !H || e.key !== "Escape" || (e.preventDefault(), e.stopImmediatePropagation(), Dn());
349
+ }, Mn = (e, t) => {
350
+ if (!gn.value || vi.value || H || !e.isPrimary || e.button !== 0) return;
351
+ let n = pn(t);
352
+ if (!n) return;
353
+ e.preventDefault();
354
+ let r = e.currentTarget;
355
+ try {
356
+ r.setPointerCapture(e.pointerId);
357
+ } catch {}
358
+ document.documentElement.classList.add(Tt);
359
+ let i = an.value, a = i[i.indexOf(t) + 1], o = a ? pn(a) : null;
360
+ H = {
361
+ pointerId: e.pointerId,
362
+ handle: r,
363
+ key: t,
364
+ x0: e.clientX,
365
+ startWidth: n.getBoundingClientRect().width,
366
+ neighbour: a && o ? {
367
+ key: a,
368
+ startWidth: o.getBoundingClientRect().width
369
+ } : null,
370
+ rtl: getComputedStyle(n).direction === "rtl"
371
+ }, _n.value = t, document.addEventListener("pointermove", On), document.addEventListener("pointerup", kn), document.addEventListener("pointercancel", An), document.addEventListener("keydown", jn, !0), window.addEventListener("blur", An);
372
+ };
373
+ Oe(Dn);
374
+ let U = C("idle"), Nn = C(null), Pn = C(""), Fn = C(), In = Symbol("bb-table-column-drag"), W = null, Ln = (e) => Math.max(0, Math.min(1, e)), Rn = () => {
375
+ let e = Sr.value ? L.value?.parentElement ?? null : L.value ?? null;
376
+ for (; e;) {
377
+ let t = getComputedStyle(e).overflowX;
378
+ if (t === "auto" || t === "scroll") return e;
379
+ e = e.parentElement;
380
+ }
381
+ return null;
382
+ }, zn = () => {
383
+ let e = W?.scrollport?.getBoundingClientRect(), t = Math.max(e?.left ?? 0, 0), n = Math.min(e?.right ?? window.innerWidth, window.innerWidth);
384
+ return {
385
+ left: t,
386
+ right: Math.max(t + 1, n)
387
+ };
388
+ }, Bn = (e) => Array.from(e.children).filter((e) => e instanceof HTMLElement && e.classList.contains("bb-table-header") && !!e.dataset.columnKey), Vn = () => {
389
+ let e = Fn.value;
390
+ e?.isConnected && !e.matches(":popover-open") && e.showPopover();
391
+ }, Hn = () => {
392
+ let e = Fn.value;
393
+ e && e.matches(":popover-open") && e.hidePopover();
394
+ }, Un = (e, t) => {
395
+ let n = Fn.value;
396
+ n && (n.style.translate = `${e + Mt}px ${t + Mt}px`);
397
+ }, Wn = (e) => {
398
+ if (!W || U.value !== "dragging") return;
399
+ let t = zn(), n = Math.max(t.left, Math.min(e, t.right - 1)), r = Bn(W.row);
400
+ if (r.length < 2) return;
401
+ let i = (e) => e.style.position === "sticky", a = new Map(r.map((e) => [e, e.getBoundingClientRect()])), o = [...r.filter(i), ...r.filter((e) => !i(e))].filter((e) => e.dataset.columnKey !== W.key), s = an.value, c = s.indexOf(W.key);
402
+ if (c < 0) return;
403
+ let l = Infinity, u = -Infinity;
404
+ for (let e of a.values()) l = Math.min(l, e.left), u = Math.max(u, e.right);
405
+ let d, f;
406
+ if (n < l) d = "\0start", f = W.rtl ? s.length - 1 : 0;
407
+ else if (n >= u) d = "\0end", f = W.rtl ? 0 : s.length - 1;
408
+ else {
409
+ let e = o.find((e) => {
410
+ let t = a.get(e);
411
+ return n >= t.left && n < t.right;
412
+ });
413
+ if (!e) return;
414
+ d = e.dataset.columnKey, f = s.indexOf(d);
415
+ }
416
+ if (f < 0 || f === c) return;
417
+ let p = f > c;
418
+ if (W.target?.key === d && W.target.after === p) return;
419
+ let ee = ve(W.base, rn.value, W.key, f);
420
+ if (xe(ee, R.value ?? W.base)) {
421
+ W.target = {
422
+ key: d,
423
+ after: p
424
+ };
425
+ return;
426
+ }
427
+ ((W.rtl ? !p : p) ? n <= W.lastMoveX + jt : n >= W.lastMoveX - jt) || (W.target = {
428
+ key: d,
429
+ after: p
430
+ }, W.lastMoveX = n, R.value = ee);
431
+ }, Gn = () => {
432
+ if (!W || U.value !== "dragging" || !W.scrollDirection) {
433
+ W && (W.raf = void 0);
434
+ return;
435
+ }
436
+ let e = zn(), t = W.scrollDirection < 0 ? W.lastX - e.left : e.right - W.lastX, n = Math.ceil(At * (1 - Ln(t / kt))), r = W.scrollport ?? document.scrollingElement;
437
+ r && (r.scrollLeft += W.scrollDirection * n), Wn(W.lastX), W.raf = requestAnimationFrame(Gn);
438
+ }, Kn = () => {
439
+ if (!W) return;
440
+ let e = zn(), t = W.lastX - e.left, n = e.right - W.lastX;
441
+ W.scrollDirection = t < kt ? -1 : +(n < kt), W.scrollDirection && W.raf === void 0 && (W.raf = requestAnimationFrame(Gn));
442
+ }, qn = () => {
443
+ document.removeEventListener("pointermove", Zn), document.removeEventListener("pointerup", Qn), document.removeEventListener("pointercancel", $n), document.removeEventListener("keydown", tr, !0), document.removeEventListener("dragstart", nr), document.removeEventListener("contextmenu", nr, !0), window.removeEventListener("blur", $n), W?.row.removeEventListener("lostpointercapture", er);
444
+ }, Jn = () => {
445
+ if (W) {
446
+ clearTimeout(W.timer), W.raf !== void 0 && cancelAnimationFrame(W.raf), qn();
447
+ try {
448
+ W.row.hasPointerCapture(W.pointerId) && W.row.releasePointerCapture(W.pointerId);
449
+ } catch {}
450
+ Hn(), o(In), Nn.value = null, R.value = null, U.value = "idle", W = null;
451
+ }
452
+ }, Yn = () => {
453
+ W && (W.raf !== void 0 && cancelAnimationFrame(W.raf), W.raf = void 0, W.scrollDirection = 0, Hn(), o(In), Nn.value = null, R.value = null, U.value = "cancelled");
454
+ }, Xn = () => {
455
+ if (!(!W || U.value !== "armed")) {
456
+ clearTimeout(W.timer), W.timer = void 0;
457
+ try {
458
+ W.row.setPointerCapture(W.pointerId);
459
+ } catch {}
460
+ W.row.addEventListener("lostpointercapture", er), W.base = me(Vt.value, rn.value), W.rtl = getComputedStyle(W.row).direction === "rtl", W.scrollport = Rn(), W.lastMoveX = W.x0, W.target = null, R.value = W.base, Nn.value = W.key, Pn.value = W.label, U.value = "dragging", a(In), Vn(), Un(W.lastX, W.lastY), Wn(W.lastX), Kn();
461
+ }
462
+ }, Zn = (e) => {
463
+ if (!(!W || e.pointerId !== W.pointerId)) {
464
+ if (W.lastX = e.clientX, W.lastY = e.clientY, U.value === "armed") {
465
+ let t = Math.hypot(e.clientX - W.x0, e.clientY - W.y0);
466
+ if (W.pointerType === "touch") {
467
+ t >= Dt && Jn();
468
+ return;
469
+ }
470
+ if (t < Et) return;
471
+ Xn();
472
+ return;
473
+ }
474
+ U.value === "dragging" && (Un(e.clientX, e.clientY), Wn(e.clientX), Kn());
475
+ }
476
+ }, Qn = (e) => {
477
+ if (!W || e.pointerId !== W.pointerId) return;
478
+ let { key: t } = W, n = W.base ? W.base.filter((e) => rn.value.includes(e)).indexOf(t) : -1, r = U.value === "dragging" && R.value !== null && !xe(R.value, W.base) ? R.value : null;
479
+ Jn(), r && (sn.value = "", Vt.value = r, De(() => cn(t, n)));
480
+ }, $n = (e) => {
481
+ W && (e instanceof PointerEvent && e.pointerId !== W.pointerId || Jn());
482
+ }, er = () => {
483
+ W && U.value === "dragging" && Jn();
484
+ }, tr = (e) => {
485
+ !W || U.value !== "dragging" || e.key !== "Escape" || !i(In) || (e.preventDefault(), e.stopImmediatePropagation(), Yn());
486
+ }, nr = (e) => {
487
+ W && U.value !== "idle" && e.preventDefault();
488
+ }, rr = (e) => {
489
+ if (!M.reorderable || vi.value || P.thead || !e.isPrimary || e.button !== 0 || W || z.value.length < 2) return;
490
+ let t = e.target;
491
+ if (!(t instanceof Element)) return;
492
+ let n = e.currentTarget, r = t.closest(".bb-table-header");
493
+ if (!r || r.parentElement !== n || !r.dataset.columnKey) return;
494
+ let i = t.closest(Nt);
495
+ if (i && r.contains(i)) return;
496
+ let a = r.dataset.columnKey, o = z.value.find((e) => String(e.key) === a);
497
+ o && (W = {
498
+ pointerId: e.pointerId,
499
+ pointerType: e.pointerType,
500
+ key: a,
501
+ label: o.label,
502
+ row: n,
503
+ x0: e.clientX,
504
+ y0: e.clientY,
505
+ lastX: e.clientX,
506
+ lastY: e.clientY,
507
+ lastMoveX: e.clientX,
508
+ rtl: !1,
509
+ base: [],
510
+ scrollport: null,
511
+ target: null,
512
+ timer: void 0,
513
+ raf: void 0,
514
+ scrollDirection: 0
515
+ }, U.value = "armed", document.addEventListener("pointermove", Zn), document.addEventListener("pointerup", Qn), document.addEventListener("pointercancel", $n), document.addEventListener("keydown", tr, !0), document.addEventListener("dragstart", nr), document.addEventListener("contextmenu", nr, !0), window.addEventListener("blur", $n), e.pointerType === "touch" && (W.timer = setTimeout(Xn, Ot)));
516
+ }, ir = (e) => {
517
+ W && (U.value === "dragging" || U.value === "cancelled") && e.cancelable && e.preventDefault();
518
+ };
519
+ Oe(Jn);
520
+ let { data: ar } = re({ items: h(() => l(A.value) ? [] : [A.value]) }), or = h(() => A.value !== void 0 || G.highlighted !== void 0), sr = we(), cr = () => {
521
+ let e = sr?.vnode.props ?? {};
522
+ return "highlighted" in e || "onUpdate:highlighted" in e;
523
+ };
524
+ process.env.NODE_ENV !== "production" && D(() => A.value === void 0 && cr(), (e) => {
525
+ e && n().warn("BbTable: `highlighted` is bound but its value is `undefined`, so the highlight mechanic stays off. Initialise it to `null` — `ref(null)`, not `ref()` — to be considered bound. `undefined` means \"never initialised\" and switches highlight off entirely; `null` means \"initialised and currently empty\".");
526
+ }, { immediate: !0 });
527
+ let lr = !1, ur = () => {
528
+ process.env.NODE_ENV !== "production" && (lr || (lr = !0, n().warn("BbTable: `toggleHighlighted` was called from a slot, but highlight is not connected, so nothing happened. Bind `v-model:highlighted` (initialised to `null`), or seed `highlighted` through `useBbTableContext(id, { highlighted })`, or drop the call — with nothing bound the table has nowhere to put the value.")));
529
+ }, dr = (e, { viaSlot: t = !1 } = {}) => {
530
+ if (!or.value) {
531
+ t && ur();
532
+ return;
533
+ }
534
+ let n = e.valueHash in ar.value;
535
+ A.value = n ? null : e.value;
536
+ }, fr = (e, t) => {
537
+ e.target instanceof Element && (e.target.closest("a, button, input, label, select, textarea, [contenteditable], [role=\"button\"]") || window.getSelection()?.toString() || dr(t));
538
+ }, pr = (e) => k.value.find(([t]) => t === e)?.[1] ?? null, mr = (e) => {
539
+ let t = pr(e);
540
+ t === null ? k.value = [...k.value, [e, "asc"]] : t === "asc" ? k.value = k.value.map((t) => t[0] === e ? [e, "desc"] : t) : k.value = k.value.filter(([t]) => t !== e);
541
+ }, { state: G, isReady: hr } = ee(() => qt.value, {
187
542
  selected: {
188
- get: () => N.modelValue,
189
- set: (e) => P("update:modelValue", e)
543
+ get: () => M.modelValue,
544
+ set: (e) => N("update:modelValue", e)
190
545
  },
191
546
  unselected: {
192
- get: () => N.unselectedItems,
193
- set: (e) => P("update:unselectedItems", e)
547
+ get: () => M.unselectedItems,
548
+ set: (e) => N("update:unselectedItems", e)
194
549
  },
195
550
  all: {
196
- get: () => k.value,
551
+ get: () => O.value,
197
552
  set: (e) => {
198
- k.value = e;
553
+ O.value = e;
199
554
  }
200
555
  },
201
556
  sort: {
202
- get: () => A.value,
557
+ get: () => k.value,
203
558
  set: (e) => {
204
- A.value = e;
559
+ k.value = e;
205
560
  }
206
561
  },
207
562
  highlighted: {
208
- get: () => j.value ?? null,
563
+ get: () => A.value,
209
564
  set: (e) => {
210
- j.value = e;
565
+ A.value = e;
211
566
  }
212
567
  },
213
- page: { get: () => N.page === void 0 ? void 0 : p(N.page, 1) },
568
+ page: { get: () => M.page === void 0 ? M.virtual ? 1 : void 0 : se(M.page, 1) },
214
569
  perPage: {
215
- get: () => ae(N.perPage),
216
- infer: () => Array.isArray(N.items) ? N.items.length : void 0
570
+ get: () => oe(M.perPage),
571
+ infer: () => Array.isArray(M.items) ? M.items.length : void 0
217
572
  },
218
573
  totalItems: {
219
- get: () => ae(N.totalItems),
220
- infer: () => Array.isArray(N.items) ? N.items.length : void 0
574
+ get: () => oe(M.totalItems),
575
+ infer: () => Array.isArray(M.items) ? M.items.length : void 0
221
576
  },
222
- totalPages: { get: () => N.totalPages === void 0 ? void 0 : p(N.totalPages, 1) }
223
- }), yt = h(() => N.columns.some((e) => e.snap != null)), V = h(() => !!N.inheritColumnWidths || yt.value), H = h(() => N.fixed || yt.value || N.columns.some((e) => e.width != null) || V.value && !!R.value), bt = h(() => V.value && !!R.value), xt = bt, St = (e) => {
577
+ totalPages: { get: () => M.totalPages === void 0 ? void 0 : se(M.totalPages, 1) }
578
+ }), gr = h(() => M.columns.some((e) => e.snap != null)), _r = h(() => !!M.inheritColumnWidths || gr.value), vr = h(() => M.fixed || gr.value || M.columns.some((e) => e.width != null) || Cn.value || _r.value && !!Jt.value), K = h(() => _r.value && !!Jt.value), q = h(() => !!M.virtual && !K.value && !P.tbody), J = C({}), Y = C({}), yr = C(""), br = h(() => q.value && !!yr.value && qr.value.every((e) => !e.contentSized)), xr = (e) => q.value && e.width == null && !yn(e) && String(e.key) in J.value, Sr = K, Cr = (e) => {
224
579
  if (typeof e == "number") return `${e}px`;
225
580
  let t = e.trim();
226
581
  return /^-?\d*\.?\d+$/.test(t) ? `${t}px` : t;
227
- }, Ct = h(() => {
228
- let e = ut.value?.tracks;
582
+ }, wr = h(() => {
583
+ let e = Yt.value?.tracks;
229
584
  return e ? Object.keys(e).filter((e) => /^\d+$/.test(e)).length : 0;
230
- }), wt = h(() => {
231
- let e = ut.value?.tracks ?? {}, t = [];
585
+ }), Tr = h(() => {
586
+ let e = Yt.value?.tracks ?? {}, t = [];
232
587
  "select" in e && t.push("select");
233
- for (let e = 0; e < Ct.value; e++) t.push(String(e));
588
+ for (let e = 0; e < wr.value; e++) t.push(String(e));
234
589
  return "actions" in e && t.push("actions"), t;
235
- }), Tt = h(() => +("select" in (ut.value?.tracks ?? {}))), Et = h(() => Tt.value + Ct.value), Dt = h(() => wt.value.length), Ot = (e) => {
236
- let t = wt.value[e];
237
- return t ? ft(t, "0px") : "0px";
238
- }, kt = (e, t) => {
239
- if (!R.value || t - e <= 1e-6) return null;
590
+ }), Er = h(() => +("select" in (Yt.value?.tracks ?? {}))), Dr = h(() => Er.value + wr.value), Or = h(() => Tr.value.length), kr = (e) => {
591
+ let t = Tr.value[e];
592
+ return t ? Qt(t, "0px") : "0px";
593
+ }, Ar = (e, t) => {
594
+ if (!Jt.value || t - e <= 1e-6) return null;
240
595
  let n = [];
241
596
  for (let r = Math.floor(e); r < Math.ceil(t - 1e-6); r++) {
242
597
  let i = Math.min(t, r + 1) - Math.max(e, r);
243
598
  if (i <= 1e-6) continue;
244
- let a = Ot(r);
599
+ let a = kr(r);
245
600
  n.push(i >= .999999 ? a : `${Number(i.toFixed(4))} * ${a}`);
246
601
  }
247
602
  return n.length ? n.length === 1 && !n[0].includes("*") ? n[0] : `calc(${n.join(" + ")})` : null;
248
- }, At = h(() => {
249
- let e = N.columns, t = e.map((e) => typeof e.snap == "number" ? e.snap : Array.isArray(e.snap) ? e.snap[0] : null), n = Tt.value;
250
- return e.map((e, r) => {
251
- let i = t[r] ?? n, a;
252
- if (Array.isArray(e.snap)) a = e.snap[1] === -1 ? Et.value : e.snap[1];
603
+ }, jr = h(() => {
604
+ let e = z.value, t = e.map((e) => typeof e.snap == "number" ? e.snap : Array.isArray(e.snap) ? e.snap[0] : null), n = Er.value;
605
+ return e.map((r, i) => {
606
+ let a = t[i] ?? n, o;
607
+ if (Array.isArray(r.snap)) o = r.snap[1] === -1 ? Dr.value : r.snap[1];
253
608
  else {
254
- let e = t[r + 1];
255
- a = e != null && e > i ? e : Math.floor(i) + 1;
609
+ let n = t[i + 1];
610
+ o = n != null && n > a ? n : Math.floor(a) + 1, i === e.length - 1 && r.width == null && (o = Math.max(o, Dr.value));
256
611
  }
257
- return n = a, {
258
- start: i,
259
- end: a
612
+ return n = o, {
613
+ start: a,
614
+ end: o
260
615
  };
261
616
  });
262
- }), jt = (e) => bt.value && e.start >= Et.value, Mt = h(() => At.value.some(jt)), Nt = (e) => N.columns[e]?.width == null && !bt.value, Pt = h(() => {
263
- if (!bt.value) return -1;
264
- for (let e = N.columns.length - 1; e >= 0; e--) {
265
- let t = N.columns[e];
266
- if (t.width == null && t.snap == null) return e;
617
+ }), Mr = (e) => K.value && e.start >= Dr.value, Nr = h(() => jr.value.some(Mr)), Pr = (e) => {
618
+ let t = z.value[e];
619
+ return (t ? vn(t) : null) == null && !K.value;
620
+ }, Fr = h(() => {
621
+ if (!K.value) return -1;
622
+ let e = z.value;
623
+ for (let t = e.length - 1; t >= 0; t--) {
624
+ let n = e[t];
625
+ if (n.width == null && n.snap == null) return t;
267
626
  }
268
627
  return -1;
269
- }), Ft = h(() => {
270
- let e = At.value[0];
271
- if (!V.value || !R.value || !e) return null;
272
- let t = kt(0, e.start), n = N.selectable ? U.select : null;
273
- return n ? `calc(${t ?? "0px"} - ${n})` : t;
274
- }), It = h(() => {
275
- let e = At.value, t = e[e.length - 1];
276
- if (!V.value || !R.value || !t || Mt.value || Pt.value === N.columns.length - 1) return null;
277
- let n = kt(t.end, Dt.value), r = N.actions ? U.actions : null;
278
- return r ? `calc(${n ?? "0px"} - ${r})` : n;
279
- }), Lt = h(() => Ft.value !== null), Rt = h(() => It.value !== null), U = Ce({
280
- select: null,
281
- actions: null
282
- }), zt = h(() => {
283
- let e = (e) => V.value ? ft(e) : "auto", t = (t) => H.value && U[t] ? U[t] : e(t), n = [];
284
- N.selectable && n.push({
628
+ }), Ir = h(() => {
629
+ let e = jr.value[0];
630
+ return !_r.value || !Jt.value || !e ? null : Ar(0, e.start);
631
+ }), Lr = h(() => {
632
+ let e = jr.value, t = e[e.length - 1];
633
+ return !_r.value || !Jt.value || !t || Nr.value ? null : Ar(t.end, Or.value);
634
+ }), Rr = (e) => Xt.tracks[e] ?? null, zr = (e, t, n) => !_r.value || !Jt.value ? null : n ? t ? `calc(${e ?? "0px"} - ${t})` : null : e, Br = h(() => zr(Ir.value, M.selectable ? Rr("select") : null, !!M.selectable)), Vr = h(() => Nr.value ? null : zr(Lr.value, M.actions ? Rr("actions") : null, !!M.actions)), Hr = h(() => Br.value !== null), Ur = h(() => Vr.value !== null), Wr = (e, t) => {
635
+ let n = q.value ? Y.value[t] : null;
636
+ return n == null ? e && Gr.value ? `minmax(${e}, max-content)` : "max-content" : `${n}px`;
637
+ }, Gr = h(() => Object.keys(Yt.value?.tracks ?? {}).length > 0), Kr = (e) => /^(auto|min-content|max-content|fit-content\(.*\)|-?[\d.]+fr)$/.test(e.trim()), qr = h(() => {
638
+ let e = [];
639
+ M.selectable && e.push({
285
640
  key: "select",
286
- width: t("select")
641
+ width: Wr(Ir.value, "select"),
642
+ contentSized: Y.value.select == null
287
643
  });
288
- let r = N.columns.length - 1;
289
- return N.columns.forEach((e, t) => {
290
- let i = String(t), a = e.width == null ? null : St(e.width), o = At.value[t];
291
- if (t === Pt.value && !Mt.value) {
292
- n.push({
293
- key: i,
294
- width: "auto"
644
+ let t = z.value, n = t.length - 1, r = !K.value && M.columns.length > 0 && M.columns.every((e) => e.width != null);
645
+ return t.forEach((t, i) => {
646
+ let a = String(i), o = vn(t), s = o == null ? null : Cr(o), c = jr.value[i], l = null, u = null;
647
+ if (s != null && Kr(s) ? u = s : s != null && r && !yn(t) ? u = `minmax(${s}, ${parseFloat(s) || 1}fr)` : s != null && xr(t) ? u = `minmax(${s}, 1fr)` : s == null ? Pr(i) ? u = M.fixed ? "minmax(0, 1fr)" : "auto" : Gr.value ? Mr(c) ? u = "min-content" : (l = Ar(c.start, c.end), l === null && (u = "auto")) : u = "max-content" : l = s, u !== null) {
648
+ e.push({
649
+ key: a,
650
+ width: u,
651
+ contentSized: /^(auto|min-content|max-content)$/.test(u)
295
652
  });
296
653
  return;
297
654
  }
298
- let s;
299
- s = a ?? (Nt(t) ? H.value && Kt.value[t] || null : jt(o) ? qt.value[t] ?? null : kt(o.start, o.end));
300
- let c = [];
301
- t === 0 && Lt.value && c.push("var(--offset-internal-start, 0px)"), t === r && Rt.value && c.push("var(--offset-internal-end, 0px)");
302
- let l = c.length ? `calc(${[...c, s ?? "0px"].join(" + ")})` : s ?? "auto";
303
- n.push({
304
- key: i,
305
- width: l
655
+ let d = [];
656
+ i === 0 && Hr.value && d.push("var(--offset-internal-start, 0px)"), i === n && Ur.value && d.push("var(--offset-internal-end, 0px)");
657
+ let f = d.length ? `calc(${[...d, l].join(" + ")})` : l, p = i === Fr.value && !Nr.value ? `minmax(${f}, 1fr)` : f;
658
+ e.push({
659
+ key: a,
660
+ width: p,
661
+ contentSized: !1
306
662
  });
307
- }), N.actions && n.push({
663
+ }), M.actions && e.push({
308
664
  key: "actions",
309
- width: t("actions")
310
- }), n;
311
- }), Bt = h(() => {
665
+ width: Wr(Lr.value, "actions"),
666
+ contentSized: Y.value.actions == null
667
+ }), e;
668
+ }), Jr = h(() => {
669
+ let e = z.value, t = [];
670
+ for (let n of qr.value) {
671
+ if (n.contentSized) continue;
672
+ let r = e[Number(n.key)];
673
+ r && t.push(String(r.key));
674
+ }
675
+ return t.join(" ");
676
+ }), Yr = h(() => new Set(Jr.value.split(" ").filter(Boolean))), Xr = h(() => qr.value.map((e) => e.width).join(" ")), Zr = C(Xr.value), Qr = h(() => `grid-template-columns: ${Zr.value}`);
677
+ D(Xr, (e) => {
678
+ if (H && I.value) {
679
+ I.value.style.gridTemplateColumns = e;
680
+ return;
681
+ }
682
+ Zr.value = e;
683
+ }, { flush: "sync" });
684
+ let $r = h(() => {
312
685
  let e = {};
313
- return Ft.value && (e["--offset-start"] = Ft.value), It.value && (e["--offset-end"] = It.value), e;
314
- }), Vt = h(() => {
315
- let e = {
316
- ...dt.value,
317
- ...Bt.value
318
- };
319
- return Jt.value && (e["--natural-width"] = Jt.value), W.value > 0 && (e["--fill"] = `${W.value}px`), e;
320
- }), Ht = () => Array.from(I.value?.querySelectorAll(":scope > thead > tr.bb-table-header-row > th") ?? []), Ut = () => {
321
- let e = zt.value.map((e) => e.key), t = {};
322
- Ht().forEach((n, r) => {
323
- let i = e[r];
324
- i != null && (t[i] = `${n.getBoundingClientRect().width}px`);
325
- }), pt(t);
326
- }, Wt = () => {
327
- let e = I.value;
328
- if (!e) return;
329
- let t = [
330
- "block",
331
- "flex",
332
- "grid",
333
- "flow-root",
334
- "list-item"
335
- ], n = [
336
- "BUTTON",
337
- "INPUT",
338
- "SELECT",
339
- "TEXTAREA",
340
- "IMG",
341
- "svg",
342
- "VIDEO",
343
- "CANVAS"
344
- ], r = (e) => {
345
- let i = getComputedStyle(e), a = i.display.includes("flex") || i.display.includes("grid"), o = 0, s = 0;
346
- if (e.querySelectorAll(":scope > *").forEach((e) => {
347
- let i = getComputedStyle(e);
348
- if (i.position === "absolute" || i.position === "fixed") return;
349
- let c = parseFloat(i.marginLeft) + parseFloat(i.marginRight), l = !a && !n.includes(e.tagName) && i.cssFloat === "none" && t.includes(i.display) ? r(e) + parseFloat(i.paddingLeft) + parseFloat(i.paddingRight) + parseFloat(i.borderLeftWidth) + parseFloat(i.borderRightWidth) : e.getBoundingClientRect().width;
350
- o += l + (c || 0), s += 1;
351
- }), s === 0) {
352
- let t = document.createRange();
353
- return t.selectNodeContents(e), t.getBoundingClientRect().width;
354
- }
355
- if (s > 1) {
356
- let e = parseFloat(i.columnGap);
357
- e && (o += e * (s - 1));
686
+ return Br.value && (e["--offset-start"] = Br.value), Vr.value && (e["--offset-end"] = Vr.value), e;
687
+ }), X = C({}), ei = [
688
+ .62,
689
+ .42,
690
+ .78,
691
+ .52
692
+ ], ti = (e) => {
693
+ let t = ["transparent 0"], n = 0;
694
+ return e.forEach((e, r) => {
695
+ let i = ei[r % ei.length], a = Math.round((e - Pt * 2) * i);
696
+ if (a >= Ft) {
697
+ let e = Math.round(n + Pt);
698
+ t.push(`transparent ${e}px`, `currentColor ${e}px ${e + a}px`, `transparent ${e + a}px`);
358
699
  }
359
- return o;
360
- }, i = (t) => {
361
- let n = 0;
362
- return e.querySelectorAll(t).forEach((e) => {
363
- let t = getComputedStyle(e), i = parseFloat(t.paddingLeft) + parseFloat(t.paddingRight);
364
- n = Math.max(n, r(e) + i);
365
- }), n > 0 ? `${Math.ceil(n)}px` : null;
366
- };
367
- U.select = N.selectable ? i(":scope > thead > tr > th.bb-table-header--select, :scope > tbody > tr > td.bb-table-data__cell--select") : null, U.actions = N.actions ? i(":scope > thead > tr > th.bb-table-header--actions, :scope > tbody > tr > td.bb-table__cell--actions") : null;
368
- }, Gt = () => {
369
- Wt(), Ut();
370
- }, Kt = C([]), qt = C([]), W = C(0), Jt = C(null), Yt = () => {
371
- let e = L.value;
372
- if (!e || !H.value || !N.columns.some((e) => e.width != null) && !Mt.value && Pt.value < 0) return;
373
- let t = e.offsetWidth, n = +!!N.selectable, r = U.select ? parseFloat(U.select) : 0, i = U.actions ? parseFloat(U.actions) : 0, a = Ht(), o = 0, s = 0;
374
- N.columns.forEach((e, t) => {
375
- let r = a[n + t]?.getBoundingClientRect().width ?? 0;
376
- e.width != null && (o += r), Nt(t) || (s += r);
700
+ n += e;
701
+ }), `linear-gradient(90deg, ${t.join(",")})`;
702
+ }, ni = (e) => {
703
+ if (!q.value) {
704
+ X.value["--placeholder-bars"] && (X.value = {});
705
+ return;
706
+ }
707
+ let t = e.map((e) => parseFloat(e));
708
+ t.some((e) => !(e >= 0)) || (X.value = {
709
+ ...X.value,
710
+ "--placeholder-bars": ti(t)
377
711
  });
378
- let c = document.createElement("div");
379
- c.style.cssText = [
380
- "position:absolute",
381
- "top:-9999px",
382
- "left:-9999px",
383
- "visibility:hidden",
384
- "pointer-events:none",
385
- `width:${t}px`,
386
- `height:${e.offsetHeight}px`,
387
- "overflow:visible"
388
- ].join(";");
389
- let l = e.cloneNode(!0);
390
- l.classList.remove("bb-table--fixed"), l.querySelectorAll(".bb-table-expand__row").forEach((e) => e.remove());
391
- let u = Array.from(l.querySelectorAll("col"));
392
- N.columns.forEach((e, t) => {
393
- if (e.width == null) {
394
- let e = u[n + t];
395
- e && (e.style.width = "");
396
- }
712
+ }, ri = () => {
713
+ if (!q.value) return;
714
+ let e = Math.round(ba.value || ra.value);
715
+ if (!(e > 0)) return;
716
+ let t = `${e}px`;
717
+ X.value["--row-h"] !== t && (X.value = {
718
+ ...X.value,
719
+ "--row-h": t
397
720
  });
398
- let ee = l.querySelector("table");
399
- ee && (ee.style.width = "min-content", ee.style.minWidth = "0"), c.appendChild(l), document.body.appendChild(c);
400
- let te = c.querySelector("table thead tr.bb-table-header-row"), ne = te ? Array.from(te.querySelectorAll(":scope > th")) : [], d = N.columns.map((e, t) => {
401
- if (e.width != null) return 0;
402
- let r = ne[n + t];
403
- return r ? r.getBoundingClientRect().width : 0;
721
+ }, ii = h(() => ({
722
+ ...Zt.value,
723
+ ...$r.value,
724
+ ...X.value,
725
+ ...M.fixedHeaders || q.value ? { "--stuck-head-h": `${si.value}px` } : null,
726
+ ...br.value ? { "--virtual-row-tracks": yr.value } : null
727
+ })), ai = () => {
728
+ let e = I.value, t = qr.value.length;
729
+ if (!e || !t) return [];
730
+ let n = e.querySelector(":scope > .bb-table__head > .bb-table-header-row"), r = [...n ? [n] : [], ...Array.from(e.querySelectorAll(":scope > .bb-table__head > [role=\"row\"], :scope > .bb-table__body > [role=\"row\"]"))].find((e) => e.children.length >= t);
731
+ return r ? Array.from(r.children) : [];
732
+ }, oi = "", si = C(0), ci = () => {
733
+ let e = I.value;
734
+ if (!e) return;
735
+ if (M.fixedHeaders || q.value) {
736
+ let t = e.querySelector(":scope > .bb-table__head"), n = t ? Math.round(t.getBoundingClientRect().height) : 0;
737
+ n !== si.value && (si.value = n);
738
+ }
739
+ let t = be(e);
740
+ if (!t) return;
741
+ let n = qr.value.map((e) => e.key);
742
+ if (t.length !== n.length) return;
743
+ let r = t.join(" "), i = `${pi.value}|${r}`;
744
+ if (i === oi) return;
745
+ oi = i;
746
+ let a = {};
747
+ n.forEach((e, n) => {
748
+ a[e] = t[n];
404
749
  });
405
- document.body.removeChild(c);
406
- let f = N.columns.reduce((e, t, n) => e + (Nt(n) ? d[n] : 0), 0), re = t - s - r - i, ie = (e) => `${Number(e.toFixed(3))}px`;
407
- if (Kt.value = N.columns.map((e, t) => {
408
- if (!Nt(t)) return null;
409
- let n = d[t];
410
- if (f <= 0) return ie(n);
411
- let r = re > 0 ? n / f * re : 0;
412
- return ie(Math.max(n, r));
413
- }), qt.value = d.map((e) => e > 0 ? ie(e) : null), Pt.value >= 0) {
414
- let e = Object.values(ut.value?.tracks ?? {}).reduce((e, t) => e + (parseFloat(t) || 0), 0), t = a.reduce((e, t) => e + t.getBoundingClientRect().width, 0);
415
- W.value = Math.max(0, e - t + W.value);
416
- } else W.value = 0;
417
- let ae = d.reduce((e, t) => e + t, 0), p = o + ae + r + i;
418
- Jt.value = p > 0 ? `${Math.ceil(p)}px` : null;
419
- }, G = null, Xt, Zt = C(!1), Qt = !1, $t = () => {
420
- let e = L.value, t = I.value;
421
- Qt = !!e && !!t && t.getBoundingClientRect().width > e.clientWidth + 1;
422
- }, en = () => {
423
- G !== null && clearTimeout(G), G = setTimeout(() => {
424
- G = null, Yt(), be(() => {
425
- Zt.value = !1, $t();
426
- });
427
- }, 200);
428
- }, K, tn, nn = () => {
429
- K && (K.disconnect(), Ht().forEach((e) => K?.observe(e)), Gt());
750
+ let o = String(M.columns.length - 1), s = Br.value, c = Vr.value;
751
+ s && a[0] && (a[0] = `calc(${a[0]} - (${s}))`, !M.selectable && Ir.value && (a.select = Ir.value)), c && a[o] && (a[o] = `calc(${a[o]} - (${c}))`, !M.actions && Lr.value && (a.actions = Lr.value)), Fa(t), ni(t), q.value && (yr.value = r), li = t, $t(a), M.fixedColumns?.length && fe(e, M.fixedColumns, t);
752
+ }, li = null, ui, di = () => {
753
+ if (!ui) return;
754
+ ui.disconnect();
755
+ let e = ai();
756
+ e.forEach((e) => ui?.observe(e)), e.length && ci();
430
757
  };
431
- Se(() => {
432
- K = new ResizeObserver(() => Gt()), nn(), be(Yt), I.value && (Xt = new MutationObserver(en), Xt.observe(I.value, {
433
- childList: !0,
434
- subtree: !0,
435
- characterData: !0
436
- })), L.value && (tn = new ResizeObserver(() => {
437
- Qt || (Zt.value = !0), en();
438
- }), tn.observe(L.value));
439
- }), xe(() => {
440
- K?.disconnect(), tn?.disconnect(), Xt?.disconnect(), G !== null && clearTimeout(G);
441
- }), O(zt, () => be(nn), { flush: "post" });
442
- let rn = (e, t) => N.accessibleLabel ? N.accessibleLabel(e, t) : [F("table.select").value, ...e.map((e) => e.content)].join(" "), an = h(() => N.selectable ? "fieldset" : "div"), on = h(() => N.legend || N.caption || F("table.selectableLegend").value), q = h(() => N.loading || pn.value), sn = h(() => q.value && !N.interactiveWhileLoading), J = h(() => vt.value && !o(B.page) && !o(B.perPage) && !o(B.totalItems) && B.page >= 1 && B.perPage > 0 && B.totalItems >= 0), cn = h(() => ({
758
+ ke(() => {
759
+ ui = new ResizeObserver(ci), di();
760
+ }), Oe(() => {
761
+ ui?.disconnect();
762
+ });
763
+ let fi = h(() => qr.value.map((e) => e.key).join(" ")), pi = h(() => an.value.join(" "));
764
+ D([fi, pi], () => {
765
+ De(di), requestAnimationFrame(() => {
766
+ I.value && ci();
767
+ });
768
+ }, { flush: "post" });
769
+ let mi = (e, t) => M.accessibleLabel ? M.accessibleLabel(e, t) : [F("table.select").value, ...e.map((e) => e.content)].join(" "), hi = h(() => M.selectable ? "fieldset" : "div"), gi = h(() => M.legend || M.caption || F("table.selectableLegend").value), _i = h(() => M.loading || Di.value), vi = h(() => _i.value && !M.interactiveWhileLoading), yi = h(() => hr.value && !l(G.page) && !l(G.perPage) && !l(G.totalItems) && G.page >= 1 && G.perPage > 0 && G.totalItems >= 0), bi = h(() => ({
443
770
  "bb-table": !0,
444
- [`bb-table--align-${N.align}`]: !0,
445
- "bb-table--compact": N.compact,
446
- "bb-table--fixed": H.value,
447
- "bb-table--inherit-widths": xt.value,
448
- "bb-table--fixed-header": N.fixedHeaders,
449
- "bb-table--loading": q.value,
450
- "bb-table--empty": !Y.value.length,
451
- "bb-table--selectable": !!N.selectable,
452
- "bb-table--measuring": Zt.value,
771
+ [`bb-table--align-${M.align}`]: !0,
772
+ "bb-table--compact": M.compact,
773
+ "bb-table--reorderable": !!M.reorderable,
774
+ "bb-table--resizable": gn.value,
775
+ "bb-table--fixed": vr.value,
776
+ "bb-table--inherit-widths": Sr.value,
777
+ "bb-table--fixed-header": M.fixedHeaders || q.value,
778
+ "bb-table--virtual": q.value,
779
+ "bb-table--virtual-flat": br.value,
780
+ "bb-table--loading": _i.value,
781
+ "bb-table--empty": !Z.value.length,
782
+ "bb-table--selectable": !!M.selectable,
453
783
  "scrollbar-border": !0
454
- })), ln = h(() => N.columns.length + Number(!!N.selectable) + Number(!!N.actions)), un = h(() => Object.fromEntries(N.columns.map((e) => [e.key, de(e.key)]))), { getter: dn, items: fn, loading: pn } = c({ items: Te(N, "items") }), { hasPrefilled: mn } = ie({
784
+ })), xi = h(() => M.columns.length + Number(!!M.selectable) + Number(!!M.actions)), Si = h(() => Object.fromEntries(M.columns.map((e) => [e.key, pe(e.key)]))), { getter: Ci, clientReproducible: wi, hydratedFromSsr: Ti, items: Ei, loading: Di } = d({ items: Pe(M, "items") }), { hasPrefilled: Oi } = ae({
785
+ alreadyLoaded: Ti,
786
+ clientReproducible: wi,
455
787
  trigger: !0,
456
788
  fn: async (e) => {
457
- await dn(e, B.selected), yn();
789
+ await Ci(e, G.selected), Ni();
458
790
  }
459
- }), { data: hn } = f({ items: h(() => B.selected) }), { options: Y, baseOptions: gn } = re({
460
- disabled: Te(N, "disabled"),
461
- items: fn,
791
+ }), { data: ki } = re({ items: h(() => G.selected) }), { options: Z, baseOptions: Ai } = ie({
792
+ disabled: Pe(M, "disabled"),
793
+ items: Ei,
462
794
  itemText: void 0,
463
- itemValue: N.itemValue,
464
- max: N.max,
795
+ itemValue: M.itemValue,
796
+ max: M.max,
465
797
  selectable: !0,
466
- selectedIndexedByHash: hn
467
- }), _n = async (e) => {
468
- N.multiple ? B.selected = (B.selected ?? []).concat(e.value) : B.selected = e.value;
469
- }, vn = async (e) => {
470
- if (N.multiple) {
471
- let t = { ...hn.value };
472
- delete t[e.valueHash], B.selected = Object.values(t);
473
- } else B.selected = null;
798
+ selectedIndexedByHash: ki
799
+ }), ji = async (e) => {
800
+ M.multiple ? G.selected = (G.selected ?? []).concat(e.value) : G.selected = e.value;
801
+ }, Mi = async (e) => {
802
+ if (M.multiple) {
803
+ let t = { ...ki.value };
804
+ delete t[e.valueHash], G.selected = Object.values(t);
805
+ } else G.selected = null;
474
806
  };
475
- ee(() => [
476
- N.dependencies,
477
- N.items,
478
- typeof N.items == "function" ? [B.page, B.perPage] : void 0
807
+ p(() => [
808
+ M.dependencies,
809
+ M.items,
810
+ typeof M.items == "function" ? [G.page, G.perPage] : void 0
479
811
  ], async () => {
480
- mn.value && (await dn(!0, B.selected), yn());
481
- }, { debounce: N.depsDebounceTime });
482
- let yn = () => {
483
- if (!N.enforceCoherence) return;
484
- let e = new Set(Y.value.map((e) => e.valueHash)), t = (t) => e.has(u(t));
485
- if (N.multiple) {
486
- let e = B.selected ?? [];
487
- e.every(t) || (B.selected = e.filter(t));
488
- } else !o(B.selected) && !t(B.selected) && (B.selected = null);
489
- let n = B.unselected ?? [];
490
- n.every(t) || (B.unselected = n.filter(t)), !o(j.value) && !t(j.value) && (j.value = null), M.value.every(t) || (M.value = M.value.filter(t));
491
- }, bn = (e, t) => {
492
- let n = un.value[e.key], r = e.align ?? "left", i = ot(t.item, e.key);
493
- return e.formatter && (!o(i) || e.formatOnNull !== !1) && (i = e.formatter(i, e.key, t.item)), e.placeholder && o(i) && (i = e.placeholder), {
812
+ Oi.value && (await Ci(!0, G.selected), Ni());
813
+ }, { debounce: M.depsDebounceTime });
814
+ let Ni = () => {
815
+ if (!M.enforceCoherence) return;
816
+ let e = new Set(Z.value.map((e) => e.valueHash)), t = (t) => e.has(u(t));
817
+ if (M.multiple) {
818
+ let e = G.selected ?? [];
819
+ e.every(t) || (G.selected = e.filter(t));
820
+ } else !l(G.selected) && !t(G.selected) && (G.selected = null);
821
+ let n = G.unselected ?? [];
822
+ n.every(t) || (G.unselected = n.filter(t)), !l(A.value) && !t(A.value) && (A.value = null), j.value.every(t) || (j.value = j.value.filter(t));
823
+ }, Pi = (e, t) => {
824
+ let n = Si.value[e.key], r = e.align ?? "left", i = Ht(t.item, e.key);
825
+ return e.formatter && (!l(i) || e.formatOnNull !== !1) && (i = e.formatter(i, e.key, t.item)), e.placeholder && l(i) && (i = e.placeholder), {
494
826
  align: r,
495
- classes: fe([`bb-table-data__cell--${r}`], N.tdClass, e.tdClass, i, e.key, t.item),
827
+ get classes() {
828
+ return he([`bb-table-data__cell--${r}`], M.tdClass, e.tdClass, i, e.key, t.item);
829
+ },
496
830
  content: i,
497
831
  key: e.key,
498
832
  label: e.label,
499
833
  slotName: n
500
834
  };
501
- }, xn = h(() => N.columns.map((e) => {
502
- let t = e.align ?? "left", n = `header:${un.value[e.key]}`, r = gt(e.key), i = r ?? e.sorted, a = i ? i === "asc" ? "ascending" : "descending" : void 0;
835
+ }, Fi = h(() => z.value.map((e) => {
836
+ let t = e.align ?? "left", n = Si.value[e.key], r = Kt(n) ? `header:${n} (shadowed)` : `header:${n}`, i = pr(e.key), a = i ?? e.sorted, o = a ? a === "asc" ? "ascending" : "descending" : void 0;
503
837
  return {
504
838
  align: t,
505
839
  key: e.key,
506
840
  label: e.label,
507
- slotName: n,
508
- classes: pe([`bb-table-header--${t}`], N.thClass, e.thClass),
841
+ slotName: r,
842
+ classes: ge([`bb-table-header--${t}`], M.thClass, e.thClass),
509
843
  sortable: !!e.sortable,
510
- sortDirection: a,
511
- sortOrder: r
844
+ sortDirection: o,
845
+ sortOrder: i
512
846
  };
513
- })), Sn = (e, t) => {
514
- let n = Y.value[e];
515
- return n && n.valueHash === t ? n : Y.value.find((e) => e.valueHash === t);
516
- }, Cn = h(() => gn.value.map((e, t) => {
517
- let n = N.columns.map((t) => bn(t, e));
847
+ })), Ii = (e, t) => {
848
+ let n = Si.value[e];
849
+ return (Kt(n) ? void 0 : P[`header:${n}:${t}`]) ?? P[`header:${t}`];
850
+ }, Li = (e) => ({
851
+ classes: e.classes,
852
+ columnKey: e.key,
853
+ items: Ei.value,
854
+ label: e.label,
855
+ sortable: e.sortable,
856
+ sortOrder: e.sortOrder,
857
+ toggleSort: () => mr(e.key)
858
+ }), Ri = (e, t) => {
859
+ let n = Z.value[e];
860
+ return n && n.valueHash === t ? n : Z.value.find((e) => e.valueHash === t);
861
+ }, zi = (e) => {
862
+ let t = Ai.value[e], n = z.value.map((e) => Pi(e, t));
518
863
  return {
519
- accessibleLabel: rn(n, e.item),
864
+ accessibleLabel: mi(n, t.item),
520
865
  cols: n,
521
- rowClasses: me(N.rowClass, N.columns, n, e.item),
866
+ get rowClasses() {
867
+ return _e(M.rowClass, z.value, n, t.item);
868
+ },
522
869
  onRowClick: (n) => {
523
- let r = Sn(t, e.valueHash);
524
- r && (ht(n, r), P("click:row", n, r, !!r.selected));
870
+ let r = Ri(e, t.valueHash);
871
+ r && (fr(n, r), N("click:row", n, r.item));
525
872
  },
526
873
  onRowContextMenu: (n) => {
527
- let r = Sn(t, e.valueHash);
528
- r && P("contextmenu:row", n, r, !!r.selected);
874
+ let r = Ri(e, t.valueHash);
875
+ r && N("contextmenu:row", n, r.item);
529
876
  },
530
877
  onRowDblClick: (n) => {
531
- let r = Sn(t, e.valueHash);
532
- r && P("dblclick:row", n, r, !!r.selected);
878
+ let r = Ri(e, t.valueHash);
879
+ r && N("dblclick:row", n, r.item);
880
+ },
881
+ item: t.item,
882
+ get text() {
883
+ return t.text;
884
+ },
885
+ valueHash: t.valueHash,
886
+ value: t.value
887
+ };
888
+ }, Bi = h(() => {
889
+ Ai.value, Si.value, M.tdClass, M.rowClass, M.accessibleLabel;
890
+ for (let e of z.value) e.align, e.formatOnNull, e.formatter, e.key, e.label, e.placeholder, e.tdClass;
891
+ return /* @__PURE__ */ new Map();
892
+ }), Vi = (e) => {
893
+ if (!(!q.value || e.size <= It)) {
894
+ for (let t of e.keys()) if (e.delete(t), e.size <= It) break;
895
+ }
896
+ }, Hi = (e) => {
897
+ let t = Bi.value, n = t.get(e);
898
+ if (n) return n;
899
+ let r = zi(e);
900
+ return t.set(e, r), Vi(t), r;
901
+ }, Ui = h(() => (Bi.value, Q.value, Z.value, ar.value, M.selectable, /* @__PURE__ */ new Map())), Wi = (e) => {
902
+ let t = Ui.value, n = t.get(e.index);
903
+ if (n) return n;
904
+ let r = Hi(e.index), i = Z.value[e.index], a = !M.selectable || typeof M.selectable == "function" && !M.selectable(r.item) || !!i.disabled, o = {
905
+ accessibleLabel: r.accessibleLabel,
906
+ cols: r.cols,
907
+ item: r.item,
908
+ onRowClick: r.onRowClick,
909
+ onRowContextMenu: r.onRowContextMenu,
910
+ onRowDblClick: r.onRowDblClick,
911
+ get rowClasses() {
912
+ return r.rowClasses;
913
+ },
914
+ get text() {
915
+ return r.text;
533
916
  },
534
- item: e.item,
535
- text: e.text,
536
- valueHash: e.valueHash,
537
- value: e.value
917
+ value: r.value,
918
+ valueHash: r.valueHash,
919
+ expanded: e.expanded,
920
+ highlighted: r.valueHash in ar.value,
921
+ rowIndex: e.rowIndex,
922
+ selected: i.selected,
923
+ disabled: a,
924
+ expandProps: {},
925
+ toggleExpanded: () => qa(r.valueHash),
926
+ toggleHighlighted: () => dr(r, { viaSlot: !0 }),
927
+ toggleSelected: () => eo(o)
538
928
  };
539
- })), wn = h(() => {
540
- let e = 0, t = ((B.page ?? 0) - 1) * (B.perPage ?? 0);
541
- return Cn.value.map((n, r) => {
542
- let i = Y.value[r], a = !N.selectable || typeof N.selectable == "function" && !N.selectable(n.item) || !!i.disabled, o = r + 1, s = t + 1 + o + e, c = kn.value[n.valueHash] ?? !1;
543
- return c && e++, {
544
- ...n,
545
- expanded: c,
546
- highlighted: n.valueHash in mt.value,
547
- rowIndex: s,
548
- selected: i.selected,
549
- disabled: a
929
+ return o.expandProps = Ka(o), t.set(e.index, o), Vi(t), o;
930
+ }, Gi = C(0);
931
+ D(() => Ai.value.length, (e) => {
932
+ Gi.value = te(Gi.value, 0, Math.max(0, e - 1));
933
+ });
934
+ let Ki = () => I.value?.querySelectorAll(":scope > .bb-table__body > .bb-table-data__row"), qi = (e) => {
935
+ let t = Ki();
936
+ if (t) {
937
+ if (!q.value) return t[e];
938
+ for (let n of t) if (Q.value[Number(n.dataset.index)]?.index === e) return n;
939
+ }
940
+ }, Ji = () => new Promise((e) => requestAnimationFrame(() => e())), Yi = async (e) => {
941
+ Gi.value = e;
942
+ let t = qi(e);
943
+ if (q.value && !t) {
944
+ let n = Q.value.findIndex((t) => t.kind === "row" && t.index === e);
945
+ if (n >= 0) {
946
+ pa++, va();
947
+ try {
948
+ for (let r = 0; r < 8 && !t; r++) Ma.value.scrollToIndex(n, { align: "auto" }), await Ji(), await De(), t = qi(e);
949
+ } finally {
950
+ pa--;
951
+ }
952
+ }
953
+ }
954
+ if (t?.focus(), t?.scrollIntoView({ block: "nearest" }), t && q.value) for (let e = 0; e < 4; e++) {
955
+ let e = t.getBoundingClientRect().top;
956
+ if (await Ji(), t.scrollIntoView({ block: "nearest" }), Math.abs(t.getBoundingClientRect().top - e) < .5) break;
957
+ }
958
+ }, Xi = (e) => {
959
+ M.keyboardNavigation && (Gi.value = e);
960
+ }, Q = h(() => {
961
+ let e = [], t = 0, n = ((G.page ?? 0) - 1) * (G.perPage ?? 0);
962
+ return Ai.value.forEach((r, i) => {
963
+ let a = r.valueHash in Wa.value, o = n + 1 + i + 1 + t;
964
+ e.push({
965
+ kind: "row",
966
+ index: i,
967
+ key: `r:${r.valueHash}`,
968
+ virtualIndex: e.length,
969
+ expanded: a,
970
+ rowIndex: o
971
+ }), a && (t++, e.push({
972
+ kind: "expand",
973
+ index: i,
974
+ key: `x:${r.valueHash}`,
975
+ virtualIndex: e.length,
976
+ expanded: a,
977
+ rowIndex: o
978
+ }));
979
+ }), e;
980
+ }), Zi = (e, t, n, r) => {
981
+ let i;
982
+ return {
983
+ kind: t,
984
+ index: e.index,
985
+ key: n,
986
+ virtualIndex: e.virtualIndex,
987
+ height: r,
988
+ get item() {
989
+ return i ??= Wi(e);
990
+ }
991
+ };
992
+ }, Qi = Ne(null), $i = C(0), ea = C(null), ta = (e) => /^(auto|scroll)$/.test(getComputedStyle(e).overflowY), na = () => {
993
+ let e = L.value, t = ea.value, n = I.value;
994
+ if (!q.value || !e || !t || !n) {
995
+ Qi.value = null;
996
+ return;
997
+ }
998
+ let r = e.getBoundingClientRect(), i = n.getBoundingClientRect().bottom - r.top, a = getComputedStyle(e).maxHeight !== "none" || e.scrollHeight > e.clientHeight + 1 || e.clientHeight > i + 1, o = window;
999
+ if (a) o = e;
1000
+ else {
1001
+ let t = e.parentElement;
1002
+ for (; t && t !== document.body && t !== document.documentElement;) {
1003
+ if (ta(t)) {
1004
+ o = t;
1005
+ break;
1006
+ }
1007
+ t = t.parentElement;
1008
+ }
1009
+ }
1010
+ let s = t.getBoundingClientRect().top, c = o === window ? s + window.scrollY : s - o.getBoundingClientRect().top + o.scrollTop;
1011
+ $i.value !== c && ($i.value = c), Qi.value !== o && (Qi.value = o);
1012
+ }, ra = C(37), ia = () => {
1013
+ let e = L.value;
1014
+ if (!e) return;
1015
+ let t = parseFloat(getComputedStyle(e).getPropertyValue("--cell-h"));
1016
+ t > 0 && (ra.value = t + 1);
1017
+ }, aa = C(null), oa = (e) => {
1018
+ if (!q.value || !ea.value) return;
1019
+ let t = e.target;
1020
+ for (; t && t.parentElement !== ea.value;) t = t.parentElement;
1021
+ let n = Number(t?.dataset.index);
1022
+ aa.value = Number.isInteger(n) ? n : null;
1023
+ }, sa = (e) => {
1024
+ if (!q.value) return;
1025
+ let t = e.relatedTarget;
1026
+ (!t || !ea.value?.contains(t)) && (aa.value = null);
1027
+ }, ca = C(0), la = 0, ua = C(!1), da, fa = {
1028
+ offset: 0,
1029
+ time: 0
1030
+ }, pa = 0, ma = /* @__PURE__ */ new Set(), ha = null, ga = 0, _a = (e) => {
1031
+ ga = ga ? ga * .7 + e * .3 : e;
1032
+ }, va = () => {
1033
+ clearTimeout(da), da = void 0, ua.value && (ua.value = !1, Ea());
1034
+ }, ya = (e) => {
1035
+ let t = performance.now(), n = t - fa.time, r = e - fa.offset;
1036
+ if (fa = {
1037
+ offset: e,
1038
+ time: t
1039
+ }, pa > 0) return;
1040
+ let i = ha;
1041
+ if (n > 0 && n < 250 && i && ga) {
1042
+ let e = $?.scrollRect?.height ?? 0, t = (i.end - i.start + e) / 2;
1043
+ Math.abs(r) / n * ga > t && (ua.value = !0);
1044
+ }
1045
+ clearTimeout(da), da = setTimeout(va, zt);
1046
+ }, ba = C(0), xa = -1, Sa = !1, Ca = () => {
1047
+ let e = $?.itemSizeCache;
1048
+ if (!e?.size || e.size === xa) return;
1049
+ xa = e.size;
1050
+ let t = /* @__PURE__ */ new Map(), n = 0;
1051
+ for (let [r, i] of e) {
1052
+ if (typeof r != "string" || !r.startsWith("r:")) continue;
1053
+ let e = Math.round(i);
1054
+ t.set(e, (t.get(e) ?? 0) + 1), n++;
1055
+ }
1056
+ if (n >= 5) {
1057
+ let e = 0, r = -1;
1058
+ for (let [n, i] of t) (i > r || i === r && n < e) && (r = i, e = n);
1059
+ e > 0 && !Sa && (ba.value = e, n >= 20 && (Sa = !0));
1060
+ }
1061
+ ri();
1062
+ }, $ = null, wa = !1;
1063
+ D(q, (e) => {
1064
+ wa = e;
1065
+ }, { immediate: !0 });
1066
+ let Ta = Ne([]), Ea = (e = !1) => {
1067
+ if (la &&= (cancelAnimationFrame(la), 0), !$) return;
1068
+ let t = q.value ? $.getVirtualItems() : [];
1069
+ ca.value = $.getTotalSize();
1070
+ let n = [], r = null;
1071
+ if (t.length) {
1072
+ let e = $.measurementsCache, i = Q.value.length, a = $.range, o = a ? a.startIndex : t[0].index, s = a ? a.endIndex : t[t.length - 1].index;
1073
+ for (let e of t) n.push({
1074
+ index: e.index,
1075
+ start: e.start,
1076
+ end: e.end,
1077
+ size: e.size
1078
+ });
1079
+ let c = e?.[Math.max(0, o - Rt)], l = e?.[Math.min(i - 1, s + Rt)] ?? c;
1080
+ c && l && (r = {
1081
+ start: c.start,
1082
+ end: l.end
1083
+ });
1084
+ }
1085
+ let i = !Da || !r || Da.start !== r.start || Da.end !== r.end;
1086
+ if (Da = r, Ta.value = n, !r) return;
1087
+ if (!e || !i) {
1088
+ ha = r;
1089
+ return;
1090
+ }
1091
+ let a = performance.now(), o = r;
1092
+ De(() => {
1093
+ _a(performance.now() - a), ha = o;
1094
+ });
1095
+ }, Da = null, Oa = () => {
1096
+ la ||= requestAnimationFrame(() => {
1097
+ la = 0, Ca(), Ea();
1098
+ });
1099
+ }, ka = (e, t) => {
1100
+ t ? (ya(e.getScrollOffset()), Ea(!0)) : Oa();
1101
+ }, Aa = (e) => Q.value[e]?.key ?? e, ja = (e) => (Q.value[e]?.kind === "expand" ? 3 : 1) * (ba.value || ra.value), Ma = Ge(h(() => {
1102
+ let e = Qi.value, t = e === window, n = aa.value;
1103
+ return {
1104
+ onChange: ka,
1105
+ count: q.value ? Q.value.length : 0,
1106
+ enabled: q.value,
1107
+ getScrollElement: () => e,
1108
+ estimateSize: ja,
1109
+ getItemKey: Aa,
1110
+ overscan: Rt,
1111
+ scrollMargin: $i.value,
1112
+ initialRect: {
1113
+ width: 0,
1114
+ height: 800
1115
+ },
1116
+ rangeExtractor: (e) => {
1117
+ let t = ze(e.endIndex - e.startIndex > Lt ? {
1118
+ ...e,
1119
+ endIndex: e.startIndex + Lt
1120
+ } : e);
1121
+ return n == null || n >= e.count || t.includes(n) ? t : [...t, n].sort((e, t) => e - t);
1122
+ },
1123
+ observeElementRect: t ? We : He,
1124
+ observeElementOffset: t ? Ue : Ve,
1125
+ scrollToFn: t ? Ke : Be
1126
+ };
1127
+ }));
1128
+ $ = Ma.value, Ea();
1129
+ let Na = (e) => {
1130
+ wa && $?.measureElement(e);
1131
+ }, Pa = h(() => {
1132
+ let e = Q.value;
1133
+ if (Ui.value, !q.value) return e.map((e) => Zi(e, e.kind, e.key, 0));
1134
+ let t = Ta.value;
1135
+ if (!t.length) return [];
1136
+ let n = [], r = $i.value, i = ua.value, a = r, o;
1137
+ for (let r of t) {
1138
+ let t = e[r.index];
1139
+ if (!t) continue;
1140
+ let s = r.start - a;
1141
+ s > .5 && n.push(Zi(t, "spacer", `s:${t.key}`, s)), i && t.kind === "row" && !ma.has(t.key) ? n.push(Zi(t, "placeholder", `p:${t.key}`, r.size)) : n.push(Zi(t, t.kind, t.key, 0)), a = r.end, o = t;
1142
+ }
1143
+ let s = ca.value - (a - r);
1144
+ return s > .5 && o && n.push(Zi(o, "spacer", "s:end", s)), n;
1145
+ });
1146
+ D(Pa, (e) => {
1147
+ if (q.value) for (let t of e) (t.kind === "row" || t.kind === "expand") && ma.add(t.key);
1148
+ }, { flush: "post" });
1149
+ let Fa = (e) => {
1150
+ let t = I.value;
1151
+ if (!q.value || !t || !t.querySelector(":scope > .bb-table__body > .bb-table-data__row")) return;
1152
+ let n = z.value, r = null, i = null;
1153
+ if (qr.value.forEach((t, a) => {
1154
+ if (t.key === "select" || t.key === "actions") {
1155
+ if (t.key in Y.value) return;
1156
+ let n = parseFloat(e[a]);
1157
+ if (!(n > 0)) return;
1158
+ (i ??= { ...Y.value })[t.key] = n;
1159
+ return;
1160
+ }
1161
+ let o = n[Number(t.key)];
1162
+ if (!o || o.width != null) return;
1163
+ let s = String(o.key);
1164
+ if (s in J.value || s in (r ?? {})) return;
1165
+ let c = parseFloat(e[a]);
1166
+ c > 0 && ((r ??= { ...J.value })[s] = c);
1167
+ }), !r && !i || Ia) return;
1168
+ let a = r, o = i;
1169
+ Ia = requestAnimationFrame(() => {
1170
+ Ia = 0, a && (J.value = {
1171
+ ...J.value,
1172
+ ...a
1173
+ }), o && (Y.value = {
1174
+ ...Y.value,
1175
+ ...o
1176
+ });
1177
+ });
1178
+ }, Ia = 0;
1179
+ D(() => [q.value, Z.value.length === 0], ([e, t]) => {
1180
+ (!e || t) && (J.value = {}, Y.value = {}, yr.value = "");
1181
+ }), D(ra, () => {
1182
+ q.value && Ma.value.measure();
1183
+ });
1184
+ let La, Ra, za = () => {
1185
+ La?.disconnect(), La = void 0, Ra?.(), Ra = void 0;
1186
+ let e = L.value;
1187
+ if (!q.value || !e) return;
1188
+ let t = 0, n = () => {
1189
+ t ||= requestAnimationFrame(() => {
1190
+ t = 0, na();
1191
+ });
1192
+ };
1193
+ if (Qi.value === e) La = new ResizeObserver(() => na()), La.observe(e);
1194
+ else {
1195
+ window.addEventListener("resize", n);
1196
+ let e = new ResizeObserver(n);
1197
+ e.observe(document.documentElement), Ra = () => {
1198
+ window.removeEventListener("resize", n), e.disconnect(), t && cancelAnimationFrame(t);
550
1199
  };
1200
+ }
1201
+ };
1202
+ D(Qi, za), D(() => [q.value, Q.value.length], () => {
1203
+ De(() => {
1204
+ ia(), na(), za(), ma = /* @__PURE__ */ new Set(), xa = -1, Sa = !1, Ea();
551
1205
  });
552
- }), X = C(0);
553
- O(() => wn.value.length, (e) => {
554
- X.value = ne(X.value, 0, Math.max(0, e - 1));
1206
+ }, { flush: "post" });
1207
+ let Ba = () => {
1208
+ q.value && Object.keys(J.value).length && (J.value = {});
1209
+ }, Va, Ha = () => {
1210
+ let e = typeof document < "u" ? document.fonts : void 0;
1211
+ !e || Va || (e.status !== "loaded" && e.ready.then(Ba), e.addEventListener("loadingdone", Ba), Va = () => e.removeEventListener("loadingdone", Ba));
1212
+ };
1213
+ ke(() => {
1214
+ ia(), ri(), na(), za(), Ea(), q.value && Ha();
1215
+ }), D(q, (e) => {
1216
+ e && Ha(), li && ni(li), ri();
1217
+ }), Oe(() => {
1218
+ La?.disconnect(), Ra?.(), Va?.(), la && cancelAnimationFrame(la);
555
1219
  });
556
- let Tn = () => I.value?.querySelectorAll(":scope > tbody > tr.bb-table-data__row"), En = (e) => {
557
- X.value = e;
558
- let t = Tn()?.[e];
559
- t?.focus(), t?.scrollIntoView({ block: "nearest" });
560
- }, Dn = (e) => {
561
- N.keyboardNavigation && (X.value = e);
562
- }, On = (e, t) => {
563
- if (!N.keyboardNavigation || e.target !== e.currentTarget) return;
564
- let n = wn.value.length - 1;
1220
+ let Ua = (e, t) => {
1221
+ if (!M.keyboardNavigation || e.target !== e.currentTarget) return;
1222
+ let n = Ai.value.length - 1;
565
1223
  if (n < 0) return;
566
1224
  let r = (t) => {
567
- e.preventDefault(), En(ne(t, 0, n));
1225
+ e.preventDefault(), Yi(te(t, 0, n));
568
1226
  };
569
1227
  switch (e.key) {
570
1228
  case "ArrowDown":
@@ -574,10 +1232,10 @@ var Oe = {
574
1232
  r(t - 1);
575
1233
  break;
576
1234
  case "PageDown":
577
- r(t + at);
1235
+ r(t + Bt);
578
1236
  break;
579
1237
  case "PageUp":
580
- r(t - at);
1238
+ r(t - Bt);
581
1239
  break;
582
1240
  case "Home":
583
1241
  r(0);
@@ -590,105 +1248,175 @@ var Oe = {
590
1248
  e.preventDefault(), e.currentTarget.click();
591
1249
  break;
592
1250
  }
593
- }, { data: kn } = f({ items: M }), An = (e, t) => {
594
- e.target instanceof HTMLElement && (e.target instanceof HTMLButtonElement || e.key !== "Enter" && e.key !== " " || (e.preventDefault(), Z(t)));
595
- }, jn = (e) => ({
596
- "aria-controls": o(kn.value[e.valueHash]) ? void 0 : `expanded_${e.valueHash}`,
1251
+ }, { data: Wa } = re({ items: j }), Ga = (e, t) => {
1252
+ e.target instanceof HTMLElement && (e.target instanceof HTMLButtonElement || e.key !== "Enter" && e.key !== " " || (e.preventDefault(), qa(t)));
1253
+ }, Ka = (e) => ({
1254
+ "aria-controls": l(Wa.value[e.valueHash]) ? void 0 : `expanded_${e.valueHash}`,
597
1255
  "aria-expanded": e.expanded ? "true" : "false",
598
1256
  onClick: (t) => {
599
- t.stopPropagation(), Z(e.valueHash);
1257
+ t.stopPropagation(), qa(e.valueHash);
600
1258
  },
601
- onKeydown: (t) => An(t, e.valueHash)
602
- }), Z = (e) => {
603
- let t = Y.value.find((t) => t.valueHash === e);
604
- t && (e in kn.value ? M.value = M.value.filter((t) => u(t) !== e) : M.value = [...M.value, t.value]);
1259
+ onKeydown: (t) => Ga(t, e.valueHash)
1260
+ }), qa = (e) => {
1261
+ let t = Z.value.find((t) => t.valueHash === e);
1262
+ t && (e in Wa.value ? j.value = j.value.filter((t) => u(t) !== e) : j.value = [...j.value, t.value]);
605
1263
  };
606
- O(k, () => {
607
- Q.clear(), B.unselected = [], B.selected = [];
1264
+ D(O, () => {
1265
+ Ya.clear(), G.unselected = [], G.selected = [];
608
1266
  });
609
- let Mn = h(() => {
610
- let e = Array.isArray(B.selected) ? B.selected.length : 0;
611
- return !!(N.multiple && e > 0 && !k.value || k.value && Q.size > 0);
612
- }), Q = Ce(/* @__PURE__ */ new Set());
613
- O(() => B.unselected, (e) => {
614
- Q.clear(), (e ?? []).forEach((e) => {
615
- Q.add(u(e));
1267
+ let Ja = h(() => {
1268
+ let e = Array.isArray(G.selected) ? G.selected.length : 0;
1269
+ return !!(M.multiple && e > 0 && !O.value || O.value && Ya.size > 0);
1270
+ }), Ya = Ae(/* @__PURE__ */ new Set());
1271
+ D(() => G.unselected, (e) => {
1272
+ Ya.clear(), (e ?? []).forEach((e) => {
1273
+ Ya.add(u(e));
616
1274
  });
617
1275
  }, { immediate: !0 });
618
- let Nn = (e) => {
619
- let t = B.unselected ?? [];
620
- if ($(e)) {
621
- vn(e), P("item:unselected", e.value), Q.add(e.valueHash), B.unselected = [...t, e.value];
1276
+ let Xa = (e) => {
1277
+ let t = G.unselected ?? [];
1278
+ if (Za(e)) {
1279
+ Mi(e), N("item:unselected", e.value), Ya.add(e.valueHash), G.unselected = [...t, e.value];
622
1280
  return;
623
1281
  }
624
- k.value || _n(e), P("item:selected", e.value), Q.delete(e.valueHash), B.unselected = t.filter((t) => u(t) !== u(e.value));
625
- }, $ = (e) => Q.has(e.valueHash) ? !1 : e.selected || k.value, Pn = (e) => {
626
- if (N.disabled || N.readonly || typeof N.selectable == "function" && !N.selectable(e.item)) return !0;
627
- let t = Y.value.find((t) => t.valueHash === e.valueHash);
1282
+ O.value || ji(e), N("item:selected", e.value), Ya.delete(e.valueHash), G.unselected = t.filter((t) => u(t) !== u(e.value));
1283
+ }, Za = (e) => Ya.has(e.valueHash) ? !1 : e.selected || O.value, Qa = h(() => {
1284
+ let e = /* @__PURE__ */ new Map();
1285
+ for (let t of Z.value) e.set(t.valueHash, t);
1286
+ return e;
1287
+ }), $a = (e) => {
1288
+ if (M.disabled || M.readonly || typeof M.selectable == "function" && !M.selectable(e.item)) return !0;
1289
+ let t = Qa.value.get(e.valueHash);
628
1290
  return !t || !!t.disabled;
629
- }, Fn = (e) => {
630
- Pn(e) || Nn(e);
631
- }, In = se((e) => typeof e != "string", JSON.stringify), Ln = h(() => [].concat(B.selected ?? []).map((e) => ({
632
- disabled: N.disabled,
633
- name: N.name,
1291
+ }, eo = (e) => {
1292
+ $a(e) || Xa(e);
1293
+ }, to = ce((e) => typeof e != "string", JSON.stringify), no = h(() => [].concat(G.selected ?? []).map((e) => ({
1294
+ disabled: M.disabled,
1295
+ name: M.name,
634
1296
  type: "hidden",
635
- value: In(e)
636
- }))), Rn = [
1297
+ value: to(e)
1298
+ }))), ro = [
637
1299
  70,
638
1300
  45,
639
1301
  85,
640
1302
  55
641
- ], zn = h(() => ne(Y.value.length || N.columns.length || 1, 4, 10));
642
- return O(() => [wn.value, N.fixedColumns], () => {
643
- I.value && N.fixedColumns?.length && ue(I.value, N.fixedColumns);
644
- }, { flush: "post" }), (e, t) => (S(), he(we(an.value), {
1303
+ ], io = h(() => te(Z.value.length || M.columns.length || 1, 4, 10)), ao = h(() => {
1304
+ let e = /* @__PURE__ */ new Map();
1305
+ for (let [t, n] of k.value) e.has(t) || e.set(t, n);
1306
+ return e;
1307
+ }), oo = h(() => ({
1308
+ slots: P,
1309
+ selectable: M.selectable,
1310
+ multiple: !!M.multiple,
1311
+ readonly: !!M.readonly,
1312
+ actions: !!M.actions,
1313
+ keyboardNavigation: !!M.keyboardNavigation,
1314
+ contentInert: vi.value,
1315
+ hasRowIndex: yi.value,
1316
+ columnSpan: xi.value,
1317
+ inputName: Ut,
1318
+ tdClass: M.tdClass,
1319
+ cellClasses: Sn.value,
1320
+ sortOrders: ao.value,
1321
+ measureRow: Na,
1322
+ onInputChange: Xa,
1323
+ onRowFocus: Xi,
1324
+ onRowKeydown: Ua
1325
+ })), so = h(() => (M.fixedColumns ?? []).map((e) => typeof e == "number" ? `${e}:left` : `${e.index}:${e.position}`).join(","));
1326
+ return D(() => [
1327
+ Pa.value,
1328
+ so.value,
1329
+ fi.value
1330
+ ], ([, e, t], n) => {
1331
+ let r = n?.[1], i = M.fixedColumns;
1332
+ if (I.value && (e.length || r?.length)) {
1333
+ let a = e === r && t === n?.[2];
1334
+ fe(I.value, i ?? [], a ? li : null, a);
1335
+ }
1336
+ P.thead && De(di);
1337
+ }, { flush: "post" }), (e, t) => (S(), g(Me(hi.value), {
645
1338
  id: e.id,
646
1339
  ref_key: "containerRef",
647
1340
  ref: L,
648
- "aria-busy": q.value,
649
- class: b(cn.value),
650
- "data-bb-table-id": D(lt),
1341
+ "aria-busy": _i.value,
1342
+ class: b(bi.value),
1343
+ "data-bb-table-id": E(qt),
651
1344
  inert: e.disabled,
652
- style: x(Vt.value)
1345
+ style: x(ii.value)
653
1346
  }, {
654
- default: De(() => [
655
- e.selectable ? (S(), _("legend", Oe, E(on.value), 1)) : g("", !0),
656
- v("table", {
1347
+ default: Le(() => [
1348
+ e.selectable ? (S(), v("legend", qe, T(gi.value), 1)) : _("", !0),
1349
+ e.caption ? (S(), v("div", {
1350
+ key: 1,
1351
+ id: en.value,
1352
+ class: b(["bb-table-caption", { "sr-only": !e.displayCaption }])
1353
+ }, T(e.caption), 11, Je)) : _("", !0),
1354
+ e.reorderable || e.resizable ? (S(), v("div", {
1355
+ key: 2,
1356
+ id: tn.value,
1357
+ class: "sr-only"
1358
+ }, [e.reorderable ? (S(), v(m, { key: 0 }, [Se(T(E(F)("table.reorderInstructions").value), 1)], 64)) : _("", !0), e.resizable && !K.value ? (S(), v(m, { key: 1 }, [Se(T(E(F)("table.resizeInstructions").value), 1)], 64)) : _("", !0)], 8, Ye)) : _("", !0),
1359
+ y("span", Xe, T(_i.value ? e.loadingText || E(F)("common.loadingText").value : ""), 1),
1360
+ e.reorderable ? (S(), v(m, { key: 3 }, [y("span", Ze, T(sn.value), 1), y("div", {
1361
+ ref_key: "ghostRef",
1362
+ ref: Fn,
1363
+ "aria-hidden": "true",
1364
+ class: "bb-table-column-ghost",
1365
+ popover: "manual"
1366
+ }, [t[1] ||= y("svg", {
1367
+ "aria-hidden": "true",
1368
+ class: "bb-table-column-ghost__icon",
1369
+ fill: "none",
1370
+ height: "1em",
1371
+ stroke: "currentColor",
1372
+ "stroke-linecap": "round",
1373
+ "stroke-linejoin": "round",
1374
+ "stroke-width": "2",
1375
+ viewBox: "0 0 24 24",
1376
+ width: "1em"
1377
+ }, [y("path", { d: "M12 2v20M2 12h20M5 9l-3 3 3 3M9 5l3-3 3 3M15 19l-3 3-3-3M19 9l3 3-3 3" })], -1), y("span", null, T(Pn.value), 1)], 512)], 64)) : _("", !0),
1378
+ y("div", {
657
1379
  ref_key: "tableRef",
658
1380
  ref: I,
659
- "aria-rowcount": J.value ? D(B).totalItems : void 0
1381
+ "aria-labelledby": e.caption ? en.value : void 0,
1382
+ "aria-rowcount": yi.value && E(G).totalItems != null ? E(G).totalItems + 1 : void 0,
1383
+ class: "bb-table__table",
1384
+ role: "table",
1385
+ style: x(Qr.value)
660
1386
  }, [
661
- e.caption ? (S(), _("caption", {
662
- key: 0,
663
- class: b(["bb-table-caption", { "sr-only": !e.displayCaption }])
664
- }, E(e.caption), 3)) : g("", !0),
665
- v("colgroup", null, [(S(!0), _(m, null, w(zt.value, (e) => (S(), _("col", {
666
- key: e.key,
667
- style: x({ width: e.width })
668
- }, null, 4))), 128))]),
669
- v("thead", { inert: sn.value }, [T(e.$slots, "thead", {}, () => [v("tr", {
670
- "aria-rowindex": J.value ? 1 : void 0,
671
- class: b(["bb-table-header-row", e.headerRowClass])
1387
+ y("div", {
1388
+ class: b(["bb-table__head", {
1389
+ "bb-table__head--dragging": U.value === "dragging",
1390
+ "bb-table__head--resizing": _n.value !== null
1391
+ }]),
1392
+ inert: vi.value,
1393
+ role: "rowgroup"
1394
+ }, [w(e.$slots, "thead", {}, () => [y("div", {
1395
+ "aria-rowindex": yi.value ? 1 : void 0,
1396
+ class: b(["bb-table-header-row", e.headerRowClass]),
1397
+ role: "row",
1398
+ onPointerdown: rr,
1399
+ onTouchmove: ir
672
1400
  }, [
673
- e.selectable ? (S(), _("th", {
1401
+ e.selectable ? (S(), v("div", {
674
1402
  key: 0,
675
1403
  class: b(["bb-table-header bb-table-header--select", e.thClass]),
676
- scope: "col"
677
- }, [T(e.$slots, "header:select", {
1404
+ role: "columnheader"
1405
+ }, [w(e.$slots, "header:select", {
678
1406
  multiple: e.multiple,
679
- selectAll: !!k.value,
680
- text: e.selectText || D(F)("table.selectText").value
681
- }, () => [v("span", Me, [!e.disableSelectAll && e.multiple ? (S(), _("label", {
1407
+ selectAll: !!O.value,
1408
+ text: e.selectText || E(F)("table.selectText").value
1409
+ }, () => [y("span", tt, [!e.disableSelectAll && e.multiple ? (S(), v("label", {
682
1410
  key: 0,
683
1411
  class: b(["bb-table-check__label", { "bb-table-check__label--disabled": e.disabled }])
684
- }, [(S(), he(d, {
685
- key: Mn.value.toString(),
686
- modelValue: k.value,
687
- "onUpdate:modelValue": t[0] ||= (e) => k.value = e,
688
- checked: !!k.value,
1412
+ }, [(S(), g(ne, {
1413
+ key: Ja.value.toString(),
1414
+ modelValue: O.value,
1415
+ "onUpdate:modelValue": t[0] ||= (e) => O.value = e,
1416
+ checked: !!O.value,
689
1417
  class: "bb-table-check",
690
1418
  disabled: e.disabled,
691
- indeterminate: Mn.value,
1419
+ indeterminate: Ja.value,
692
1420
  name: `select_all_${e.name || ""}`,
693
1421
  readonly: e.readonly
694
1422
  }, null, 8, [
@@ -698,198 +1426,173 @@ var Oe = {
698
1426
  "indeterminate",
699
1427
  "name",
700
1428
  "readonly"
701
- ])), v("span", Ne, E(e.selectAllLabel || D(F)("table.selectAllLabel").value), 1)], 2)) : e.multiple ? g("", !0) : (S(), _("span", Pe, E(e.selectText || D(F)("table.selectText").value), 1))])])], 2)) : g("", !0),
702
- (S(!0), _(m, null, w(xn.value, (t, n) => (S(), _("th", {
703
- key: t.key,
704
- "aria-sort": t.sortDirection ?? (t.sortable ? "none" : void 0),
705
- class: b(["bb-table-header", [t.classes, {
706
- "bb-table-header--edge-start": n === 0,
707
- "bb-table-header--edge-end": n === xn.value.length - 1
1429
+ ])), y("span", nt, T(e.selectAllLabel || E(F)("table.selectAllLabel").value), 1)], 2)) : e.multiple ? _("", !0) : (S(), v("span", rt, T(e.selectText || E(F)("table.selectText").value), 1))])])], 2)) : _("", !0),
1430
+ (S(!0), v(m, null, je(Fi.value, (n, r) => (S(), v("div", {
1431
+ key: n.key,
1432
+ "aria-describedby": nn.value ? tn.value : void 0,
1433
+ "aria-sort": n.sortDirection ?? (n.sortable ? "none" : void 0),
1434
+ class: b(["bb-table-header", [n.classes, {
1435
+ "bb-table-header--edge-start": r === 0,
1436
+ "bb-table-header--edge-end": r === Fi.value.length - 1,
1437
+ "bb-table-header--clip": Yr.value.has(n.key),
1438
+ "bb-table-header--dragging": Nn.value === n.key,
1439
+ "bb-table-header--sortable": n.sortable,
1440
+ "bb-table-header--resizing": _n.value === n.key
708
1441
  }]]),
709
- scope: "col"
710
- }, [T(e.$slots, t.slotName, {
711
- classes: t.classes,
712
- items: D(fn),
713
- label: t.label,
714
- sortOrder: t.sortOrder,
715
- sortable: t.sortable,
716
- toggleSort: () => _t(t.key)
717
- }, () => [t.sortable ? (S(), he(i, {
718
- key: 0,
719
- class: b(["bb-table-sort", {
720
- "bb-table-sort--asc": t.sortOrder === "asc",
721
- "bb-table-sort--desc": t.sortOrder === "desc"
722
- }]),
723
- type: "button",
724
- onClick: () => _t(t.key)
725
- }, {
726
- default: De(() => [v("span", Ie, E(t.label), 1), _e(a, {
727
- class: "bb-table-sort__icon",
728
- icon: D(le),
729
- size: "sm"
730
- }, null, 8, ["icon"])]),
731
- _: 2
732
- }, 1032, ["class", "onClick"])) : (S(), _("span", Le, E(t.label), 1))])], 10, Fe))), 128)),
733
- e.actions ? (S(), _("th", {
1442
+ "data-column-key": nn.value ? n.key : void 0,
1443
+ role: "columnheader",
1444
+ tabindex: nn.value ? n.key === un.value ? 0 : -1 : void 0,
1445
+ onClick: (e) => dn(e, n),
1446
+ onFocus: (e) => fn(n.key),
1447
+ onKeydown: (e) => hn(e, n.key)
1448
+ }, [
1449
+ Ii(n.key, "prepend") ? (S(), g(Me(Ii(n.key, "prepend")), Ee({
1450
+ key: 0,
1451
+ ref_for: !0
1452
+ }, Li(n)), null, 16)) : _("", !0),
1453
+ w(e.$slots, n.slotName, {
1454
+ classes: n.classes,
1455
+ items: E(Ei),
1456
+ label: n.label,
1457
+ sortOrder: n.sortOrder,
1458
+ sortable: n.sortable,
1459
+ toggleSort: () => mr(n.key)
1460
+ }, () => [n.sortable ? (S(), g(s, {
1461
+ key: 0,
1462
+ class: b(["bb-table-sort", {
1463
+ "bb-table-sort--asc": n.sortOrder === "asc",
1464
+ "bb-table-sort--desc": n.sortOrder === "desc"
1465
+ }]),
1466
+ tabindex: nn.value ? -1 : void 0,
1467
+ type: "button",
1468
+ onClick: () => mr(n.key)
1469
+ }, {
1470
+ default: Le(() => [y("span", at, T(n.label), 1), t[2] ||= y("svg", {
1471
+ "aria-hidden": "true",
1472
+ class: "bb-table-sort__icon",
1473
+ fill: "none",
1474
+ height: "1em",
1475
+ stroke: "currentColor",
1476
+ "stroke-linecap": "round",
1477
+ "stroke-linejoin": "round",
1478
+ "stroke-width": "2",
1479
+ viewBox: "0 0 24 24",
1480
+ width: "1em"
1481
+ }, [y("path", { d: "M12 20V4m-7 7l7-7l7 7" })], -1)]),
1482
+ _: 2
1483
+ }, 1032, [
1484
+ "class",
1485
+ "tabindex",
1486
+ "onClick"
1487
+ ])) : (S(), v("span", ot, T(n.label), 1))]),
1488
+ Ii(n.key, "append") ? (S(), g(Me(Ii(n.key, "append")), Ee({
1489
+ key: 1,
1490
+ ref_for: !0
1491
+ }, Li(n)), null, 16)) : _("", !0),
1492
+ e.resizable && !K.value ? (S(), v("div", {
1493
+ key: 2,
1494
+ "aria-hidden": "true",
1495
+ class: "bb-table-header__resizer",
1496
+ onDblclick: Re((e) => Tn(n.key), ["stop"]),
1497
+ onPointerdown: (e) => Mn(e, n.key)
1498
+ }, null, 40, st)) : _("", !0)
1499
+ ], 42, it))), 128)),
1500
+ e.actions ? (S(), v("div", {
734
1501
  key: 1,
735
1502
  class: b(["bb-table-header bb-table-header--actions", e.thClass]),
736
- scope: "col"
737
- }, [T(e.$slots, "header:actions", { text: e.actionsText || D(F)("table.actionsText").value }, () => [v("span", Re, E(e.actionsText || D(F)("table.actionsText").value), 1)])], 2)) : g("", !0)
738
- ], 10, je)])], 8, Ae),
739
- v("tbody", null, [q.value && !D(Y).length ? T(e.$slots, "loading", {
1503
+ role: "columnheader"
1504
+ }, [w(e.$slots, "header:actions", { text: e.actionsText || E(F)("table.actionsText").value }, () => [y("span", ct, T(e.actionsText || E(F)("table.actionsText").value), 1)])], 2)) : _("", !0)
1505
+ ], 42, et)])], 10, $e),
1506
+ y("div", {
1507
+ ref_key: "bodyRef",
1508
+ ref: ea,
1509
+ class: "bb-table__body",
1510
+ role: "rowgroup",
1511
+ onFocusin: oa,
1512
+ onFocusout: sa
1513
+ }, [_i.value && !E(Z).length ? w(e.$slots, "loading", {
740
1514
  key: 0,
741
- items: D(fn)
742
- }, () => [(S(!0), _(m, null, w(zn.value, (n, r) => (S(), _("tr", {
1515
+ items: E(Ei)
1516
+ }, () => [(S(!0), v(m, null, je(io.value, (n, r) => (S(), v("div", {
743
1517
  key: r,
744
- "aria-rowindex": J.value ? r + 2 : void 0,
745
- class: "bb-table-skeleton__row"
1518
+ "aria-rowindex": yi.value ? r + 2 : void 0,
1519
+ class: "bb-table-skeleton__row",
1520
+ role: "row"
746
1521
  }, [
747
- e.selectable ? (S(), _("td", Be, t[1] ||= [v("div", { class: "bb-table-skeleton__placeholder" }, null, -1)])) : g("", !0),
748
- (S(!0), _(m, null, w(N.columns, (e, n) => (S(), _("td", {
1522
+ e.selectable ? (S(), v("div", ut, t[3] ||= [y("div", { class: "bb-table-skeleton__placeholder" }, null, -1)])) : _("", !0),
1523
+ (S(!0), v(m, null, je(z.value, (e, n) => (S(), v("div", {
749
1524
  key: e.key,
750
- class: b(["bb-table-skeleton__cell", [`bb-table-skeleton__cell--${e.skeleton ?? "text"}`]])
751
- }, [!e.skeleton || e.skeleton === "text" ? (S(), _("div", Ve, [v("div", {
1525
+ class: b(["bb-table-skeleton__cell", [`bb-table-skeleton__cell--${e.skeleton ?? "text"}`]]),
1526
+ role: "cell"
1527
+ }, [!e.skeleton || e.skeleton === "text" ? (S(), v("div", dt, [y("div", {
752
1528
  class: "bb-table-skeleton__line",
753
- style: x({ width: `${Rn[(r + n) % 4]}%` })
754
- }, null, 4), v("div", {
1529
+ style: x({ width: `${ro[(r + n) % 4]}%` })
1530
+ }, null, 4), y("div", {
755
1531
  class: "bb-table-skeleton__line",
756
- style: x({ width: `${Rn[(r + n + 2) % 4]}%` })
757
- }, null, 4)])) : e.skeleton === "avatar" ? (S(), _("div", He)) : e.skeleton === "avatar-text" ? (S(), _("div", Ue, [t[2] ||= v("div", { class: "bb-table-skeleton__avatar" }, null, -1), v("div", We, [v("div", {
1532
+ style: x({ width: `${ro[(r + n + 2) % 4]}%` })
1533
+ }, null, 4)])) : e.skeleton === "avatar" ? (S(), v("div", ft)) : e.skeleton === "avatar-text" ? (S(), v("div", pt, [t[4] ||= y("div", { class: "bb-table-skeleton__avatar" }, null, -1), y("div", mt, [y("div", {
758
1534
  class: "bb-table-skeleton__line",
759
- style: x({ width: `${Rn[(r + n) % 4]}%` })
760
- }, null, 4), v("div", {
1535
+ style: x({ width: `${ro[(r + n) % 4]}%` })
1536
+ }, null, 4), y("div", {
761
1537
  class: "bb-table-skeleton__line",
762
- style: x({ width: `${Rn[(r + n + 2) % 4]}%` })
763
- }, null, 4)])])) : e.skeleton === "image" ? (S(), _("div", Ge)) : e.skeleton === "badge" ? (S(), _("div", Ke)) : g("", !0)], 2))), 128)),
764
- e.actions ? (S(), _("td", qe, t[3] ||= [v("div", { class: "bb-table-skeleton__placeholder" }, null, -1)])) : g("", !0)
765
- ], 8, ze))), 128))]) : D(Y).length ? T(e.$slots, "tbody", { key: 2 }, () => [(S(!0), _(m, null, w(wn.value, (t, n) => (S(), _(m, { key: t.valueHash }, [v("tr", {
766
- "aria-current": t.highlighted ? "true" : void 0,
767
- "aria-rowindex": J.value && t.rowIndex ? t.rowIndex : void 0,
768
- class: b(["bb-table-data__row", [t.rowClasses, { "bb-table-data__row--highlighted": t.highlighted }]]),
769
- inert: sn.value,
770
- tabindex: e.keyboardNavigation ? n === X.value ? 0 : -1 : void 0,
771
- onClick: t.onRowClick,
772
- onContextmenu: t.onRowContextMenu,
773
- onDblclick: t.onRowDblClick,
774
- onFocus: () => Dn(n),
775
- onKeydown: (e) => On(e, n)
776
- }, [
777
- e.selectable ? (S(), _("td", {
778
- key: 0,
779
- class: b(["bb-table-data__cell bb-table-data__cell--select", e.tdClass])
780
- }, [T(e.$slots, "select", {
781
- checked: $(t),
782
- disabled: Pn(t),
783
- inputName: D(st),
784
- item: t.item,
785
- readonly: !!e.readonly,
786
- toggleSelected: () => Fn(t),
787
- value: t.value
788
- }, () => [e.multiple ? (S(), _("label", {
789
- key: 0,
790
- class: b(["bb-table-check__label", { "bb-table-check__label--disabled": t.disabled }])
791
- }, [_e(d, {
792
- checked: $(t),
793
- class: "bb-table-check",
794
- disabled: t.disabled,
795
- readonly: e.readonly,
796
- onChange: () => Nn(t)
797
- }, null, 8, [
798
- "checked",
799
- "disabled",
800
- "readonly",
801
- "onChange"
802
- ]), v("span", Qe, E(t.accessibleLabel), 1)], 2)) : (S(), _("label", {
803
- key: 1,
804
- class: b(["bb-table-radio__label", { "bb-table-radio__label--disabled": t.disabled }])
805
- }, [_e(oe, {
806
- checked: t.selected,
807
- class: "bb-table-radio",
808
- disabled: t.disabled,
809
- name: D(st),
810
- readonly: e.readonly,
811
- value: t.value,
812
- onChange: () => Nn(t)
813
- }, null, 8, [
814
- "checked",
815
- "disabled",
816
- "name",
817
- "readonly",
818
- "value",
819
- "onChange"
820
- ]), v("span", $e, E(t.accessibleLabel), 1)], 2))])], 2)) : g("", !0),
821
- (S(!0), _(m, null, w(t.cols, (n, r) => (S(), _("td", {
822
- key: n.key,
823
- class: b(["bb-table-data__cell", [n.classes, {
824
- "bb-table-data__cell--edge-start": r === 0,
825
- "bb-table-data__cell--edge-end": r === t.cols.length - 1
826
- }]])
827
- }, [T(e.$slots, n.slotName, {
828
- classes: n.classes,
829
- content: n.content,
830
- expandProps: jn(t),
831
- expanded: t.expanded,
832
- highlighted: t.highlighted,
833
- item: t.item,
834
- selected: $(t),
835
- sortOrder: gt(n.key),
836
- toggleExpanded: () => Z(t.valueHash),
837
- toggleHighlighted: () => z(t),
838
- toggleSelected: () => Fn(t),
839
- value: t.value
840
- }, () => [ge(E(n.content), 1)])], 2))), 128)),
841
- e.actions ? (S(), _("td", {
842
- key: 1,
843
- class: b(["bb-table__cell bb-table__cell--actions", e.tdClass])
844
- }, [T(e.$slots, "actions", {
845
- expandProps: jn(t),
846
- expanded: t.expanded,
847
- highlighted: t.highlighted,
848
- item: t.item,
849
- selected: $(t),
850
- toggleExpanded: () => Z(t.valueHash),
851
- toggleHighlighted: () => z(t),
852
- toggleSelected: () => Fn(t),
853
- value: t.value
854
- })], 2)) : g("", !0)
855
- ], 42, Ze), t.expanded ? (S(), _("tr", {
1538
+ style: x({ width: `${ro[(r + n + 2) % 4]}%` })
1539
+ }, null, 4)])])) : e.skeleton === "image" ? (S(), v("div", ht)) : e.skeleton === "badge" ? (S(), v("div", gt)) : _("", !0)], 2))), 128)),
1540
+ e.actions ? (S(), v("div", _t, t[5] ||= [y("div", { class: "bb-table-skeleton__placeholder" }, null, -1)])) : _("", !0)
1541
+ ], 8, lt))), 128))]) : E(Z).length ? w(e.$slots, "tbody", { key: 2 }, () => [(S(!0), v(m, null, je(Pa.value, (e) => (S(), v(m, { key: e.key }, [e.kind === "spacer" ? (S(), v("div", {
856
1542
  key: 0,
857
- id: `expanded_${t.valueHash}`,
858
- "aria-rowindex": J.value && t.rowIndex ? t.rowIndex + 1 : void 0,
859
- class: b(["bb-table-expand__row", { "bb-table-expand__row--highlighted": t.highlighted }])
860
- }, [v("td", {
861
- class: "bb-table-expand__cell",
862
- colspan: ln.value
863
- }, [T(e.$slots, "expand", {
864
- expandProps: jn(t),
865
- expanded: t.expanded,
866
- highlighted: t.highlighted,
867
- item: t.item,
868
- selected: $(t),
869
- toggleExpanded: () => Z(t.valueHash),
870
- toggleHighlighted: () => z(t),
871
- toggleSelected: () => Fn(t),
872
- value: t.value
873
- })], 8, tt)], 10, et)) : g("", !0)], 64))), 128))]) : (S(), _("tr", {
1543
+ "aria-hidden": "true",
1544
+ class: "bb-table-spacer__row bb-table-placeholder__row",
1545
+ style: x({ height: `${e.height}px` })
1546
+ }, null, 4)) : e.kind === "placeholder" ? (S(), v("div", {
874
1547
  key: 1,
875
- "aria-rowindex": J.value ? 2 : void 0,
876
- class: "bb-table-no-data__row"
877
- }, [v("td", {
878
- class: "bb-table-no-data__cell",
879
- colspan: ln.value
880
- }, [T(e.$slots, "no-data", {}, () => [v("span", Xe, E(e.noDataText || D(F)("common.noDataText").value), 1)])], 8, Ye)], 8, Je)), q.value ? (S(), _("tr", {
1548
+ "aria-hidden": "true",
1549
+ class: "bb-table-placeholder__row bb-table-placeholder__row--pending",
1550
+ "data-index": e.virtualIndex,
1551
+ style: x({ height: `${e.height}px` })
1552
+ }, null, 12, xt)) : e.kind === "row" ? (S(), g(E(ue), {
1553
+ key: 2,
1554
+ active: e.index === Gi.value,
1555
+ context: oo.value,
1556
+ index: e.index,
1557
+ item: e.item,
1558
+ "select-blocked": $a(e.item),
1559
+ selected: Za(e.item),
1560
+ "virtual-index": e.virtualIndex
1561
+ }, null, 8, [
1562
+ "active",
1563
+ "context",
1564
+ "index",
1565
+ "item",
1566
+ "select-blocked",
1567
+ "selected",
1568
+ "virtual-index"
1569
+ ])) : (S(), g(E(de), {
881
1570
  key: 3,
882
- "aria-rowindex": J.value && !D(Y).length ? zn.value + 2 : void 0,
883
- class: "bb-table-loading__row bb-table-loading__row--sr-only"
884
- }, [v("td", {
885
- "aria-live": "polite",
886
- class: "bb-table-loading__cell",
887
- colspan: ln.value,
888
- role: "status"
889
- }, [v("span", it, E(e.loadingText || D(F)("common.loadingText").value), 1)], 8, rt)], 8, nt)) : g("", !0)]),
890
- v("tfoot", null, [T(e.$slots, "tfoot", { columnCount: ln.value })])
891
- ], 8, ke),
892
- (S(!0), _(m, null, w(Ln.value, (e) => (S(), _("input", ye({
1571
+ context: oo.value,
1572
+ item: e.item,
1573
+ selected: Za(e.item),
1574
+ "virtual-index": e.virtualIndex
1575
+ }, null, 8, [
1576
+ "context",
1577
+ "item",
1578
+ "selected",
1579
+ "virtual-index"
1580
+ ]))], 64))), 128))]) : (S(), v("div", {
1581
+ key: 1,
1582
+ "aria-rowindex": yi.value ? 2 : void 0,
1583
+ class: "bb-table-no-data__row",
1584
+ role: "row"
1585
+ }, [y("div", {
1586
+ "aria-colspan": xi.value,
1587
+ class: "bb-table-no-data__cell",
1588
+ role: "cell"
1589
+ }, [w(e.$slots, "no-data", {}, () => [y("span", bt, T(e.noDataText || E(F)("common.noDataText").value), 1)])], 8, yt)], 8, vt))], 544),
1590
+ y("div", {
1591
+ class: "bb-table__foot",
1592
+ role: P.tfoot ? "rowgroup" : void 0
1593
+ }, [w(e.$slots, "tfoot", { columnCount: xi.value })], 8, St)
1594
+ ], 12, Qe),
1595
+ (S(!0), v(m, null, je(no.value, (e) => (S(), v("input", Ee({
893
1596
  key: e.value,
894
1597
  ref_for: !0
895
1598
  }, e), null, 16))), 128))
@@ -906,4 +1609,4 @@ var Oe = {
906
1609
  }
907
1610
  });
908
1611
  //#endregion
909
- export { k as default };
1612
+ export { O as default };