bootstrap-vue-next 0.44.6 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/dist/{BAlert-BnT7fF6B.js → BAlert-CHbgLTZH.js} +2 -2
  2. package/dist/{BAlert-BnT7fF6B.js.map → BAlert-CHbgLTZH.js.map} +1 -1
  3. package/dist/{BAlert-Qiyqq4rE.mjs → BAlert-CRRUJXYi.mjs} +2 -2
  4. package/dist/{BAlert-Qiyqq4rE.mjs.map → BAlert-CRRUJXYi.mjs.map} +1 -1
  5. package/dist/{BAutocomplete-jAlZC6_t.js → BAutocomplete-4CFl6XQR.js} +3 -3
  6. package/dist/{BAutocomplete-jAlZC6_t.js.map → BAutocomplete-4CFl6XQR.js.map} +1 -1
  7. package/dist/{BAutocomplete-QBIaWPY1.mjs → BAutocomplete-B7yzKPIp.mjs} +3 -3
  8. package/dist/{BAutocomplete-QBIaWPY1.mjs.map → BAutocomplete-B7yzKPIp.mjs.map} +1 -1
  9. package/dist/{BAvatar-lefHkDuG.js → BAvatar-BHqTW5Ll.js} +1 -2
  10. package/dist/BAvatar-BHqTW5Ll.js.map +1 -0
  11. package/dist/{BAvatar-D7aFEXLH.mjs → BAvatar-BSLk69M0.mjs} +1 -2
  12. package/dist/BAvatar-BSLk69M0.mjs.map +1 -0
  13. package/dist/{BButton-kykTWnBy.js → BButton-BUYwco3v.js} +4 -4
  14. package/dist/BButton-BUYwco3v.js.map +1 -0
  15. package/dist/{BButton-DBRs8Pz_.js → BButton-Bw4HgpsF.js} +10 -13
  16. package/dist/BButton-Bw4HgpsF.js.map +1 -0
  17. package/dist/{BButton-BRvIFnRm.mjs → BButton-CDo9SRvU.mjs} +10 -13
  18. package/dist/BButton-CDo9SRvU.mjs.map +1 -0
  19. package/dist/{BButton-DNmtqoqR.mjs → BButton-DgequxLk.mjs} +4 -4
  20. package/dist/BButton-DgequxLk.mjs.map +1 -0
  21. package/dist/{BCarousel-Be7z13f9.js → BCarousel-BgT74ryc.js} +87 -87
  22. package/dist/BCarousel-BgT74ryc.js.map +1 -0
  23. package/dist/{BCarousel-D81alfFC.mjs → BCarousel-D9Yei1Q4.mjs} +88 -88
  24. package/dist/BCarousel-D9Yei1Q4.mjs.map +1 -0
  25. package/dist/{BDropdown-C1AxRj81.js → BDropdown-BxciLgyt.js} +15 -16
  26. package/dist/BDropdown-BxciLgyt.js.map +1 -0
  27. package/dist/{BDropdown-BW_O8vPQ.mjs → BDropdown-CRIh9xqy.mjs} +2 -2
  28. package/dist/{BDropdown-BW_O8vPQ.mjs.map → BDropdown-CRIh9xqy.mjs.map} +1 -1
  29. package/dist/{BDropdown-DAHnN54Z.mjs → BDropdown-D2pBrZsG.mjs} +15 -16
  30. package/dist/BDropdown-D2pBrZsG.mjs.map +1 -0
  31. package/dist/{BDropdown-CuVOxCzu.js → BDropdown-DgbFCKfP.js} +2 -2
  32. package/dist/{BDropdown-CuVOxCzu.js.map → BDropdown-DgbFCKfP.js.map} +1 -1
  33. package/dist/{BFormCheckbox-Bdk2rgVe.js → BFormCheckbox-BPQxUDQG.js} +5 -5
  34. package/dist/BFormCheckbox-BPQxUDQG.js.map +1 -0
  35. package/dist/{BFormCheckbox-CcDK-lh1.mjs → BFormCheckbox-DPNPjRKN.mjs} +5 -5
  36. package/dist/BFormCheckbox-DPNPjRKN.mjs.map +1 -0
  37. package/dist/{BFormRadio-DuVYw-Vs.js → BFormRadio-BZ0etDxl.js} +5 -5
  38. package/dist/BFormRadio-BZ0etDxl.js.map +1 -0
  39. package/dist/{BFormRadio-CRDbgMiR.mjs → BFormRadio-CqYd0bLV.mjs} +5 -5
  40. package/dist/BFormRadio-CqYd0bLV.mjs.map +1 -0
  41. package/dist/{BFormSelect-DIKVsG--.js → BFormSelect-B_mbfTMC.js} +5 -5
  42. package/dist/BFormSelect-B_mbfTMC.js.map +1 -0
  43. package/dist/{BFormSelect-Bb8yE8vz.mjs → BFormSelect-CpkJ1haI.mjs} +5 -5
  44. package/dist/BFormSelect-CpkJ1haI.mjs.map +1 -0
  45. package/dist/{BFormTags-BFA6xbr3.js → BFormTags-DJzXJp7d.js} +3 -3
  46. package/dist/BFormTags-DJzXJp7d.js.map +1 -0
  47. package/dist/{BFormTags-CJb4H67g.mjs → BFormTags-DWAWX2av.mjs} +3 -3
  48. package/dist/BFormTags-DWAWX2av.mjs.map +1 -0
  49. package/dist/{BInputGroup-BScMw6Zr.js → BInputGroup-Bfcs5h_Q.js} +2 -2
  50. package/dist/{BInputGroup-BScMw6Zr.js.map → BInputGroup-Bfcs5h_Q.js.map} +1 -1
  51. package/dist/{BInputGroup-DpX10xwR.mjs → BInputGroup-C5sxenhE.mjs} +3 -3
  52. package/dist/BInputGroup-C5sxenhE.mjs.map +1 -0
  53. package/dist/{BInputGroup-Duk6Jk0v.js → BInputGroup-DTP5Vf1f.js} +3 -3
  54. package/dist/BInputGroup-DTP5Vf1f.js.map +1 -0
  55. package/dist/{BInputGroup-C7k0tS9j.mjs → BInputGroup-Dl9AgpAx.mjs} +2 -2
  56. package/dist/{BInputGroup-C7k0tS9j.mjs.map → BInputGroup-Dl9AgpAx.mjs.map} +1 -1
  57. package/dist/{BModal-D0LB339D.js → BModal-BnHYbFuj.js} +5 -5
  58. package/dist/BModal-BnHYbFuj.js.map +1 -0
  59. package/dist/{BModal-Br5xLT0-.mjs → BModal-CAjLrkBp.mjs} +5 -5
  60. package/dist/BModal-CAjLrkBp.mjs.map +1 -0
  61. package/dist/{BNav-BRjdHsjC.mjs → BNav-BdO2N7G0.mjs} +4 -3
  62. package/dist/{BNav-BRjdHsjC.mjs.map → BNav-BdO2N7G0.mjs.map} +1 -1
  63. package/dist/{BNav-tYBwz1wU.js → BNav-MjroX-Jl.js} +4 -3
  64. package/dist/{BNav-tYBwz1wU.js.map → BNav-MjroX-Jl.js.map} +1 -1
  65. package/dist/{BOffcanvas-D33pEfZe.js → BOffcanvas-ColOuYdV.js} +2 -2
  66. package/dist/{BOffcanvas-D33pEfZe.js.map → BOffcanvas-ColOuYdV.js.map} +1 -1
  67. package/dist/{BOffcanvas-jETHbtC3.mjs → BOffcanvas-DmkJSSFy.mjs} +2 -2
  68. package/dist/{BOffcanvas-jETHbtC3.mjs.map → BOffcanvas-DmkJSSFy.mjs.map} +1 -1
  69. package/dist/{BPlaceholder-C4AOg29f.mjs → BPlaceholder-DKDtjMjy.mjs} +9 -9
  70. package/dist/BPlaceholder-DKDtjMjy.mjs.map +1 -0
  71. package/dist/{BPlaceholder-DYYYuNgR.js → BPlaceholder-n447tOzJ.js} +9 -9
  72. package/dist/BPlaceholder-n447tOzJ.js.map +1 -0
  73. package/dist/{BToast-DCSZYXIi.js → BToast-BFcT76M1.js} +2 -2
  74. package/dist/{BToast-DCSZYXIi.js.map → BToast-BFcT76M1.js.map} +1 -1
  75. package/dist/{BToast-B2rFKhLD.mjs → BToast-D5XkJqF4.mjs} +2 -2
  76. package/dist/{BToast-B2rFKhLD.mjs.map → BToast-D5XkJqF4.mjs.map} +1 -1
  77. package/dist/{BTooltip-CryTO-SM.js → BTooltip-BwiqjqX-.js} +2 -2
  78. package/dist/{BTooltip-CryTO-SM.js.map → BTooltip-BwiqjqX-.js.map} +1 -1
  79. package/dist/{BTooltip-DtpjIEBu.mjs → BTooltip-DohT1Q3C.mjs} +2 -2
  80. package/dist/{BTooltip-DtpjIEBu.mjs.map → BTooltip-DohT1Q3C.mjs.map} +1 -1
  81. package/dist/bootstrap-vue-next.mjs +21 -21
  82. package/dist/bootstrap-vue-next.umd.js +21 -21
  83. package/dist/components/BCarousel/BCarousel.vue.d.mts +4 -4
  84. package/dist/components/BCarousel/BCarousel.vue.d.ts +4 -4
  85. package/dist/components/BContainer/BCol.vue.d.mts +1 -1
  86. package/dist/components/BContainer/BCol.vue.d.ts +1 -1
  87. package/dist/components/BDropdown/BDropdown.vue.d.mts +1 -0
  88. package/dist/components/BDropdown/BDropdown.vue.d.ts +1 -0
  89. package/dist/components/BNav/BNavItemDropdown.vue.d.mts +13 -2
  90. package/dist/components/BNav/BNavItemDropdown.vue.d.ts +13 -2
  91. package/dist/{floatingUi-DHMrP__c.mjs → floatingUi-BAUk171g.mjs} +10 -2
  92. package/dist/{floatingUi-DHMrP__c.mjs.map → floatingUi-BAUk171g.mjs.map} +1 -1
  93. package/dist/{floatingUi-Cs4rDXmO.js → floatingUi-DBLN9xLH.js} +15 -1
  94. package/dist/{floatingUi-Cs4rDXmO.js.map → floatingUi-DBLN9xLH.js.map} +1 -1
  95. package/dist/keys-CQKrwmvN.mjs.map +1 -1
  96. package/dist/keys-durSVUrO.js.map +1 -1
  97. package/dist/src/components/BAlert/index.mjs +1 -1
  98. package/dist/src/components/BAlert/index.umd.js +1 -1
  99. package/dist/src/components/BAutocomplete/index.mjs +1 -1
  100. package/dist/src/components/BAutocomplete/index.umd.js +1 -1
  101. package/dist/src/components/BAvatar/index.mjs +1 -1
  102. package/dist/src/components/BAvatar/index.umd.js +1 -1
  103. package/dist/src/components/BButton/index.mjs +2 -2
  104. package/dist/src/components/BButton/index.umd.js +2 -2
  105. package/dist/src/components/BCarousel/index.mjs +1 -1
  106. package/dist/src/components/BCarousel/index.umd.js +1 -1
  107. package/dist/src/components/BDropdown/index.mjs +2 -2
  108. package/dist/src/components/BDropdown/index.umd.js +2 -2
  109. package/dist/src/components/BFormCheckbox/index.mjs +1 -1
  110. package/dist/src/components/BFormCheckbox/index.umd.js +1 -1
  111. package/dist/src/components/BFormRadio/index.mjs +1 -1
  112. package/dist/src/components/BFormRadio/index.umd.js +1 -1
  113. package/dist/src/components/BFormSelect/index.mjs +1 -1
  114. package/dist/src/components/BFormSelect/index.umd.js +1 -1
  115. package/dist/src/components/BFormTags/index.mjs +1 -1
  116. package/dist/src/components/BFormTags/index.umd.js +1 -1
  117. package/dist/src/components/BInputGroup/index.mjs +2 -2
  118. package/dist/src/components/BInputGroup/index.umd.js +2 -2
  119. package/dist/src/components/BModal/index.mjs +1 -1
  120. package/dist/src/components/BModal/index.umd.js +1 -1
  121. package/dist/src/components/BNav/index.mjs +1 -1
  122. package/dist/src/components/BNav/index.umd.js +1 -1
  123. package/dist/src/components/BOffcanvas/index.mjs +1 -1
  124. package/dist/src/components/BOffcanvas/index.umd.js +1 -1
  125. package/dist/src/components/BPlaceholder/index.mjs +1 -1
  126. package/dist/src/components/BPlaceholder/index.umd.js +1 -1
  127. package/dist/src/components/BPopover/index.mjs +1 -1
  128. package/dist/src/components/BPopover/index.umd.js +1 -1
  129. package/dist/src/components/BToast/index.mjs +1 -1
  130. package/dist/src/components/BToast/index.umd.js +1 -1
  131. package/dist/src/components/BTooltip/index.mjs +1 -1
  132. package/dist/src/components/BTooltip/index.umd.js +1 -1
  133. package/dist/src/components/index.mjs +21 -21
  134. package/dist/src/components/index.umd.js +21 -21
  135. package/dist/src/composables/useModal/index.mjs +1 -1
  136. package/dist/src/composables/useModal/index.umd.js +1 -1
  137. package/dist/src/composables/usePopover/index.mjs +2 -2
  138. package/dist/src/composables/usePopover/index.umd.js +2 -2
  139. package/dist/src/composables/useToast/index.mjs +1 -1
  140. package/dist/src/composables/useToast/index.umd.js +1 -1
  141. package/dist/src/directives/BPopover/index.mjs +2 -2
  142. package/dist/src/directives/BPopover/index.umd.js +2 -2
  143. package/dist/src/directives/BScrollspy/index.mjs +1 -1
  144. package/dist/src/directives/BScrollspy/index.umd.js +1 -1
  145. package/dist/src/directives/BToggle/index.mjs +1 -1
  146. package/dist/src/directives/BToggle/index.umd.js +1 -1
  147. package/dist/src/directives/BTooltip/index.mjs +2 -2
  148. package/dist/src/directives/BTooltip/index.umd.js +2 -2
  149. package/dist/types/ComponentProps.d.mts +1 -0
  150. package/dist/types/ComponentProps.d.ts +1 -0
  151. package/dist/types/ComponentSlots.d.mts +2 -1
  152. package/dist/types/ComponentSlots.d.ts +2 -1
  153. package/dist/types/Size.d.mts +0 -1
  154. package/dist/types/Size.d.ts +0 -1
  155. package/dist/{useFormCheck-CJvIDxcO.mjs → useFormCheck-CbRHduFK.mjs} +3 -3
  156. package/dist/useFormCheck-CbRHduFK.mjs.map +1 -0
  157. package/dist/{useFormCheck-UHNy_iZ0.js → useFormCheck-Cj5K6pk-.js} +3 -3
  158. package/dist/useFormCheck-Cj5K6pk-.js.map +1 -0
  159. package/dist/utils/floatingUi.d.mts +1 -0
  160. package/dist/utils/floatingUi.d.ts +1 -0
  161. package/dist/utils/keys.d.mts +2 -2
  162. package/dist/utils/keys.d.ts +2 -2
  163. package/dist/{utils-CgwCsk6U.mjs → utils-D30CwVm-.mjs} +3 -4
  164. package/dist/utils-D30CwVm-.mjs.map +1 -0
  165. package/dist/{utils-CaC78Zdk.js → utils-DtPi91ue.js} +3 -4
  166. package/dist/utils-DtPi91ue.js.map +1 -0
  167. package/package.json +1 -1
  168. package/dist/BAvatar-D7aFEXLH.mjs.map +0 -1
  169. package/dist/BAvatar-lefHkDuG.js.map +0 -1
  170. package/dist/BButton-BRvIFnRm.mjs.map +0 -1
  171. package/dist/BButton-DBRs8Pz_.js.map +0 -1
  172. package/dist/BButton-DNmtqoqR.mjs.map +0 -1
  173. package/dist/BButton-kykTWnBy.js.map +0 -1
  174. package/dist/BCarousel-Be7z13f9.js.map +0 -1
  175. package/dist/BCarousel-D81alfFC.mjs.map +0 -1
  176. package/dist/BDropdown-C1AxRj81.js.map +0 -1
  177. package/dist/BDropdown-DAHnN54Z.mjs.map +0 -1
  178. package/dist/BFormCheckbox-Bdk2rgVe.js.map +0 -1
  179. package/dist/BFormCheckbox-CcDK-lh1.mjs.map +0 -1
  180. package/dist/BFormRadio-CRDbgMiR.mjs.map +0 -1
  181. package/dist/BFormRadio-DuVYw-Vs.js.map +0 -1
  182. package/dist/BFormSelect-Bb8yE8vz.mjs.map +0 -1
  183. package/dist/BFormSelect-DIKVsG--.js.map +0 -1
  184. package/dist/BFormTags-BFA6xbr3.js.map +0 -1
  185. package/dist/BFormTags-CJb4H67g.mjs.map +0 -1
  186. package/dist/BInputGroup-DpX10xwR.mjs.map +0 -1
  187. package/dist/BInputGroup-Duk6Jk0v.js.map +0 -1
  188. package/dist/BModal-Br5xLT0-.mjs.map +0 -1
  189. package/dist/BModal-D0LB339D.js.map +0 -1
  190. package/dist/BPlaceholder-C4AOg29f.mjs.map +0 -1
  191. package/dist/BPlaceholder-DYYYuNgR.js.map +0 -1
  192. package/dist/useFormCheck-CJvIDxcO.mjs.map +0 -1
  193. package/dist/useFormCheck-UHNy_iZ0.js.map +0 -1
  194. package/dist/utils-CaC78Zdk.js.map +0 -1
  195. package/dist/utils-CgwCsk6U.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils-D30CwVm-.mjs","names":[],"sources":["../src/directives/utils.ts"],"sourcesContent":["import type {ComponentInternalInstance, Directive, DirectiveBinding, Ref, VNode} from 'vue'\nimport type {BPopoverProps} from '../types/ComponentProps'\nimport {\n bind,\n type ElementWithPopper,\n resolveActiveStatus,\n resolveContent,\n resolveDirectiveProps,\n unbind,\n updateBind,\n} from '../utils/floatingUi'\nimport {defaultsKey} from '../utils/keys'\n\ninterface _ComponentInternalInstance extends ComponentInternalInstance {\n provides?: Record<string, unknown>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setupState?: any\n}\n\ninterface _VNode extends VNode {\n ctx?: _ComponentInternalInstance | null\n ssContent?: VNode | null\n}\n\n/**\n * Represents per-instance state for directives using UID namespacing\n */\nexport interface DirectiveInstanceState {\n binding: string // JSON.stringify cache for change detection\n destroying: boolean // Flag to prevent race conditions during cleanup\n}\n\n/**\n * Gets the component instance UID from a directive binding\n * @throws Error if binding.instance is not available\n */\nexport function getDirectiveUid(binding: DirectiveBinding): number {\n if (!binding.instance) {\n throw new Error('[Bootstrap-Vue-Next] Directive binding.instance is not available')\n }\n return binding.instance.$.uid\n}\n\n/**\n * Initializes UID-namespaced storage on an element for a directive\n * @param el - The HTML element\n * @param propertyName - The property name (e.g., '$__tooltip', '$__popover')\n * @param uid - The component instance UID\n * @param binding - The directive binding value to cache\n * @returns The initialized instance state\n */\nexport function initDirectiveInstance(\n el: HTMLElement & Record<string, unknown>,\n propertyName: string,\n uid: number,\n binding: DirectiveBinding\n): DirectiveInstanceState {\n // Initialize UID namespace for this directive\n const elWithProps = el as Record<string, unknown>\n elWithProps[propertyName] = elWithProps[propertyName] ?? Object.create(null)\n\n // Store per-instance state with JSON cache for change detection\n const state: DirectiveInstanceState = {\n binding: JSON.stringify([binding.modifiers, binding.value]),\n destroying: false,\n }\n\n ;(elWithProps[propertyName] as Record<string, unknown>)[uid] = state\n return state\n}\n\n/**\n * Gets the instance state for a directive, if it exists\n * @param el - The HTML element\n * @param propertyName - The property name (e.g., '$__tooltip', '$__popover')\n * @param uid - The component instance UID\n * @returns The instance state or undefined if not found\n */\nexport function getDirectiveInstance(\n el: HTMLElement & Record<string, unknown>,\n propertyName: string,\n uid: number\n): DirectiveInstanceState | undefined {\n const elWithProps = el as Record<string, unknown>\n return (elWithProps[propertyName] as Record<string, unknown> | undefined)?.[uid] as\n | DirectiveInstanceState\n | undefined\n}\n\n/**\n * Checks if the directive binding has changed for this instance\n * @param instance - The directive instance state\n * @param binding - The current directive binding\n * @returns true if the binding has changed, false otherwise\n */\nexport function hasBindingChanged(\n instance: DirectiveInstanceState,\n binding: DirectiveBinding\n): boolean {\n const newBinding = JSON.stringify([binding.modifiers, binding.value])\n return instance.binding !== newBinding\n}\n\n/**\n * Updates the cached binding value for a directive instance\n * @param instance - The directive instance state\n * @param binding - The new directive binding\n */\nexport function updateBindingCache(\n instance: DirectiveInstanceState,\n binding: DirectiveBinding\n): void {\n instance.binding = JSON.stringify([binding.modifiers, binding.value])\n}\n\n/**\n * Cleans up a directive instance\n * @param el - The HTML element\n * @param propertyName - The property name (e.g., '$__tooltip', '$__popover')\n * @param uid - The component instance UID\n */\nexport function cleanupDirectiveInstance(\n el: HTMLElement & Record<string, unknown>,\n propertyName: string,\n uid: number\n): void {\n const elWithProps = el as Record<string, unknown>\n const instance = (elWithProps[propertyName] as Record<string, unknown> | undefined)?.[uid] as\n | DirectiveInstanceState\n | undefined\n if (instance) {\n instance.destroying = true\n delete (elWithProps[propertyName] as Record<string, unknown>)[uid]\n }\n}\n\n// taken from vuetify https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/composables/directiveComponent.ts\n\nexport function findProvides(binding: DirectiveBinding, vnode: _VNode): Record<string, unknown> {\n const provides =\n (vnode.ctx === binding.instance!.$\n ? findComponentParent(vnode, binding.instance!.$)?.provides\n : vnode.ctx?.provides) ?? binding.instance!.$.provides\n\n return provides\n}\n\nexport function findComponentParent(\n vnode: VNode,\n root: ComponentInternalInstance\n): _ComponentInternalInstance | null {\n // Walk the tree from root until we find the child vnode\n const stack = new Set<VNode>()\n const walk = (children: _VNode[]): boolean => {\n for (const child of children) {\n if (!child) continue\n\n if (child === vnode || (child.el && vnode.el && child.el === vnode.el)) {\n return true\n }\n\n stack.add(child)\n let result\n if (child.suspense) {\n result = walk([child.ssContent!])\n } else if (Array.isArray(child.children)) {\n result = walk(child.children as VNode[])\n } else if (child.component?.vnode) {\n result = walk([child.component?.subTree])\n }\n if (result) {\n return result\n }\n stack.delete(child)\n }\n\n return false\n }\n if (!walk([root.subTree])) {\n console.error('Could not find original vnode, will not inherit provides')\n return root\n }\n\n // Return the first component parent\n const result = Array.from(stack).reverse()\n for (const child of result) {\n if (child.component) {\n return child.component\n }\n }\n return root\n}\n\n/**\n * Creates a floating UI directive (tooltip or popover) with UID-namespaced state management\n * @param propertyName - The property name for storing state (e.g., '$__tooltip', '$__popover')\n * @param componentDefaultsKey - The key for accessing component defaults (e.g., 'BTooltip', 'BPopover')\n * @param buildProps - Optional function to customize the props passed to bind()\n * @returns A Vue directive object\n */\nexport function createFloatingDirective(\n propertyName: string,\n componentDefaultsKey: string,\n buildProps?: (\n text: {title?: string; body?: string},\n defaults: unknown,\n binding: Readonly<DirectiveBinding>,\n el: Readonly<HTMLElement>\n ) => BPopoverProps\n): Directive<ElementWithPopper> {\n return {\n mounted(el, binding, vnode) {\n const uid = getDirectiveUid(binding)\n const defaultsMap = (findProvides(binding, vnode) as Record<symbol, Ref>)[defaultsKey]\n ?.value as Record<string, unknown> | undefined\n const isActive = resolveActiveStatus(binding.value)\n if (!isActive) return\n\n const text = resolveContent(binding.value, el)\n\n if (!text.body && !text.title) return\n\n // Initialize per-instance state with UID namespacing\n initDirectiveInstance(el, propertyName, uid, binding)\n\n const props = buildProps\n ? buildProps(text, defaultsMap?.[componentDefaultsKey], binding, el)\n : {\n ...(defaultsMap?.[componentDefaultsKey] || undefined),\n ...resolveDirectiveProps(binding, el),\n ...text,\n }\n\n bind(el, binding, props)\n },\n\n updated(el, binding, vnode) {\n const uid = getDirectiveUid(binding)\n let instance = getDirectiveInstance(el, propertyName, uid)\n\n const defaultsMap = (findProvides(binding, vnode) as Record<symbol, Ref>)[defaultsKey]\n ?.value as Record<string, unknown> | undefined\n\n const isActive = resolveActiveStatus(binding.value)\n\n // If inactive, clean up existing instance if present\n if (!isActive) {\n if (instance && el.$__element) {\n unbind(el)\n cleanupDirectiveInstance(el, propertyName, uid)\n }\n return\n }\n\n const text = resolveContent(binding.value, el)\n\n if (!text.body && !text.title) {\n // Clean up if no content\n if (instance && el.$__element) {\n unbind(el)\n cleanupDirectiveInstance(el, propertyName, uid)\n }\n return\n }\n\n // If instance doesn't exist, this is a transition from inactive/no-content to active\n // Initialize the instance now (similar to mounted)\n if (!instance) {\n instance = initDirectiveInstance(el, propertyName, uid, binding)\n\n const props = buildProps\n ? buildProps(text, defaultsMap?.[componentDefaultsKey], binding, el)\n : {\n ...(defaultsMap?.[componentDefaultsKey] || undefined),\n ...resolveDirectiveProps(binding, el),\n ...text,\n }\n\n bind(el, binding, props)\n return\n }\n\n // Check if binding changed for THIS instance\n if (!hasBindingChanged(instance, binding)) return\n\n // Prevent race conditions during update\n if (instance.destroying) return\n\n const props = buildProps\n ? buildProps(text, defaultsMap?.[componentDefaultsKey], binding, el)\n : {\n ...(defaultsMap?.[componentDefaultsKey] || undefined),\n ...resolveDirectiveProps(binding, el),\n ...text,\n }\n\n // Update props in-place so the tooltip stays visible if it was open\n updateBind(el, binding, props)\n\n // Update THIS instance's cache\n updateBindingCache(instance, binding)\n },\n\n beforeUnmount(el, binding) {\n const uid = getDirectiveUid(binding)\n const instance = getDirectiveInstance(el, propertyName, uid)\n\n if (!instance) return\n\n unbind(el)\n cleanupDirectiveInstance(el, propertyName, uid)\n },\n }\n}\n"],"mappings":";;;;;;;AAoCA,SAAgB,gBAAgB,SAAmC;AACjE,KAAI,CAAC,QAAQ,SACX,OAAM,IAAI,MAAM,mEAAmE;AAErF,QAAO,QAAQ,SAAS,EAAE;;;;;;;;;;AAW5B,SAAgB,sBACd,IACA,cACA,KACA,SACwB;CAExB,MAAM,cAAc;AACpB,aAAY,gBAAgB,YAAY,iBAAiB,OAAO,OAAO,KAAK;CAG5E,MAAM,QAAgC;EACpC,SAAS,KAAK,UAAU,CAAC,QAAQ,WAAW,QAAQ,MAAM,CAAC;EAC3D,YAAY;EACb;AAEC,aAAY,cAA0C,OAAO;AAC/D,QAAO;;;;;;;;;AAUT,SAAgB,qBACd,IACA,cACA,KACoC;AAEpC,QADoB,GACA,gBAAwD;;;;;;;;AAW9E,SAAgB,kBACd,UACA,SACS;CACT,MAAM,aAAa,KAAK,UAAU,CAAC,QAAQ,WAAW,QAAQ,MAAM,CAAC;AACrE,QAAO,SAAS,YAAY;;;;;;;AAQ9B,SAAgB,mBACd,UACA,SACM;AACN,UAAS,UAAU,KAAK,UAAU,CAAC,QAAQ,WAAW,QAAQ,MAAM,CAAC;;;;;;;;AASvE,SAAgB,yBACd,IACA,cACA,KACM;CACN,MAAM,cAAc;CACpB,MAAM,WAAY,YAAY,gBAAwD;AAGtF,KAAI,UAAU;AACZ,WAAS,aAAa;AACtB,SAAQ,YAAY,cAA0C;;;AAMlE,SAAgB,aAAa,SAA2B,OAAwC;AAM9F,SAJG,MAAM,QAAQ,QAAQ,SAAU,IAC7B,oBAAoB,OAAO,QAAQ,SAAU,EAAE,EAAE,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-1,5 +1,5 @@
1
1
  const require_keys = require("./keys-durSVUrO.js");
2
- const require_floatingUi = require("./floatingUi-Cs4rDXmO.js");
2
+ const require_floatingUi = require("./floatingUi-DBLN9xLH.js");
3
3
  //#region src/directives/utils.ts
4
4
  /**
5
5
  * Gets the component instance UID from a directive binding
@@ -148,8 +148,7 @@ function createFloatingDirective(propertyName, componentDefaultsKey, buildProps)
148
148
  }
149
149
  if (!hasBindingChanged(instance, binding)) return;
150
150
  if (instance.destroying) return;
151
- require_floatingUi.unbind(el);
152
- require_floatingUi.bind(el, binding, buildProps ? buildProps(text, defaultsMap?.[componentDefaultsKey], binding, el) : {
151
+ require_floatingUi.updateBind(el, binding, buildProps ? buildProps(text, defaultsMap?.[componentDefaultsKey], binding, el) : {
153
152
  ...defaultsMap?.[componentDefaultsKey] || void 0,
154
153
  ...require_floatingUi.resolveDirectiveProps(binding, el),
155
154
  ...text
@@ -184,4 +183,4 @@ Object.defineProperty(exports, "getDirectiveUid", {
184
183
  }
185
184
  });
186
185
 
187
- //# sourceMappingURL=utils-CaC78Zdk.js.map
186
+ //# sourceMappingURL=utils-DtPi91ue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils-DtPi91ue.js","names":[],"sources":["../src/directives/utils.ts"],"sourcesContent":["import type {ComponentInternalInstance, Directive, DirectiveBinding, Ref, VNode} from 'vue'\nimport type {BPopoverProps} from '../types/ComponentProps'\nimport {\n bind,\n type ElementWithPopper,\n resolveActiveStatus,\n resolveContent,\n resolveDirectiveProps,\n unbind,\n updateBind,\n} from '../utils/floatingUi'\nimport {defaultsKey} from '../utils/keys'\n\ninterface _ComponentInternalInstance extends ComponentInternalInstance {\n provides?: Record<string, unknown>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setupState?: any\n}\n\ninterface _VNode extends VNode {\n ctx?: _ComponentInternalInstance | null\n ssContent?: VNode | null\n}\n\n/**\n * Represents per-instance state for directives using UID namespacing\n */\nexport interface DirectiveInstanceState {\n binding: string // JSON.stringify cache for change detection\n destroying: boolean // Flag to prevent race conditions during cleanup\n}\n\n/**\n * Gets the component instance UID from a directive binding\n * @throws Error if binding.instance is not available\n */\nexport function getDirectiveUid(binding: DirectiveBinding): number {\n if (!binding.instance) {\n throw new Error('[Bootstrap-Vue-Next] Directive binding.instance is not available')\n }\n return binding.instance.$.uid\n}\n\n/**\n * Initializes UID-namespaced storage on an element for a directive\n * @param el - The HTML element\n * @param propertyName - The property name (e.g., '$__tooltip', '$__popover')\n * @param uid - The component instance UID\n * @param binding - The directive binding value to cache\n * @returns The initialized instance state\n */\nexport function initDirectiveInstance(\n el: HTMLElement & Record<string, unknown>,\n propertyName: string,\n uid: number,\n binding: DirectiveBinding\n): DirectiveInstanceState {\n // Initialize UID namespace for this directive\n const elWithProps = el as Record<string, unknown>\n elWithProps[propertyName] = elWithProps[propertyName] ?? Object.create(null)\n\n // Store per-instance state with JSON cache for change detection\n const state: DirectiveInstanceState = {\n binding: JSON.stringify([binding.modifiers, binding.value]),\n destroying: false,\n }\n\n ;(elWithProps[propertyName] as Record<string, unknown>)[uid] = state\n return state\n}\n\n/**\n * Gets the instance state for a directive, if it exists\n * @param el - The HTML element\n * @param propertyName - The property name (e.g., '$__tooltip', '$__popover')\n * @param uid - The component instance UID\n * @returns The instance state or undefined if not found\n */\nexport function getDirectiveInstance(\n el: HTMLElement & Record<string, unknown>,\n propertyName: string,\n uid: number\n): DirectiveInstanceState | undefined {\n const elWithProps = el as Record<string, unknown>\n return (elWithProps[propertyName] as Record<string, unknown> | undefined)?.[uid] as\n | DirectiveInstanceState\n | undefined\n}\n\n/**\n * Checks if the directive binding has changed for this instance\n * @param instance - The directive instance state\n * @param binding - The current directive binding\n * @returns true if the binding has changed, false otherwise\n */\nexport function hasBindingChanged(\n instance: DirectiveInstanceState,\n binding: DirectiveBinding\n): boolean {\n const newBinding = JSON.stringify([binding.modifiers, binding.value])\n return instance.binding !== newBinding\n}\n\n/**\n * Updates the cached binding value for a directive instance\n * @param instance - The directive instance state\n * @param binding - The new directive binding\n */\nexport function updateBindingCache(\n instance: DirectiveInstanceState,\n binding: DirectiveBinding\n): void {\n instance.binding = JSON.stringify([binding.modifiers, binding.value])\n}\n\n/**\n * Cleans up a directive instance\n * @param el - The HTML element\n * @param propertyName - The property name (e.g., '$__tooltip', '$__popover')\n * @param uid - The component instance UID\n */\nexport function cleanupDirectiveInstance(\n el: HTMLElement & Record<string, unknown>,\n propertyName: string,\n uid: number\n): void {\n const elWithProps = el as Record<string, unknown>\n const instance = (elWithProps[propertyName] as Record<string, unknown> | undefined)?.[uid] as\n | DirectiveInstanceState\n | undefined\n if (instance) {\n instance.destroying = true\n delete (elWithProps[propertyName] as Record<string, unknown>)[uid]\n }\n}\n\n// taken from vuetify https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/composables/directiveComponent.ts\n\nexport function findProvides(binding: DirectiveBinding, vnode: _VNode): Record<string, unknown> {\n const provides =\n (vnode.ctx === binding.instance!.$\n ? findComponentParent(vnode, binding.instance!.$)?.provides\n : vnode.ctx?.provides) ?? binding.instance!.$.provides\n\n return provides\n}\n\nexport function findComponentParent(\n vnode: VNode,\n root: ComponentInternalInstance\n): _ComponentInternalInstance | null {\n // Walk the tree from root until we find the child vnode\n const stack = new Set<VNode>()\n const walk = (children: _VNode[]): boolean => {\n for (const child of children) {\n if (!child) continue\n\n if (child === vnode || (child.el && vnode.el && child.el === vnode.el)) {\n return true\n }\n\n stack.add(child)\n let result\n if (child.suspense) {\n result = walk([child.ssContent!])\n } else if (Array.isArray(child.children)) {\n result = walk(child.children as VNode[])\n } else if (child.component?.vnode) {\n result = walk([child.component?.subTree])\n }\n if (result) {\n return result\n }\n stack.delete(child)\n }\n\n return false\n }\n if (!walk([root.subTree])) {\n console.error('Could not find original vnode, will not inherit provides')\n return root\n }\n\n // Return the first component parent\n const result = Array.from(stack).reverse()\n for (const child of result) {\n if (child.component) {\n return child.component\n }\n }\n return root\n}\n\n/**\n * Creates a floating UI directive (tooltip or popover) with UID-namespaced state management\n * @param propertyName - The property name for storing state (e.g., '$__tooltip', '$__popover')\n * @param componentDefaultsKey - The key for accessing component defaults (e.g., 'BTooltip', 'BPopover')\n * @param buildProps - Optional function to customize the props passed to bind()\n * @returns A Vue directive object\n */\nexport function createFloatingDirective(\n propertyName: string,\n componentDefaultsKey: string,\n buildProps?: (\n text: {title?: string; body?: string},\n defaults: unknown,\n binding: Readonly<DirectiveBinding>,\n el: Readonly<HTMLElement>\n ) => BPopoverProps\n): Directive<ElementWithPopper> {\n return {\n mounted(el, binding, vnode) {\n const uid = getDirectiveUid(binding)\n const defaultsMap = (findProvides(binding, vnode) as Record<symbol, Ref>)[defaultsKey]\n ?.value as Record<string, unknown> | undefined\n const isActive = resolveActiveStatus(binding.value)\n if (!isActive) return\n\n const text = resolveContent(binding.value, el)\n\n if (!text.body && !text.title) return\n\n // Initialize per-instance state with UID namespacing\n initDirectiveInstance(el, propertyName, uid, binding)\n\n const props = buildProps\n ? buildProps(text, defaultsMap?.[componentDefaultsKey], binding, el)\n : {\n ...(defaultsMap?.[componentDefaultsKey] || undefined),\n ...resolveDirectiveProps(binding, el),\n ...text,\n }\n\n bind(el, binding, props)\n },\n\n updated(el, binding, vnode) {\n const uid = getDirectiveUid(binding)\n let instance = getDirectiveInstance(el, propertyName, uid)\n\n const defaultsMap = (findProvides(binding, vnode) as Record<symbol, Ref>)[defaultsKey]\n ?.value as Record<string, unknown> | undefined\n\n const isActive = resolveActiveStatus(binding.value)\n\n // If inactive, clean up existing instance if present\n if (!isActive) {\n if (instance && el.$__element) {\n unbind(el)\n cleanupDirectiveInstance(el, propertyName, uid)\n }\n return\n }\n\n const text = resolveContent(binding.value, el)\n\n if (!text.body && !text.title) {\n // Clean up if no content\n if (instance && el.$__element) {\n unbind(el)\n cleanupDirectiveInstance(el, propertyName, uid)\n }\n return\n }\n\n // If instance doesn't exist, this is a transition from inactive/no-content to active\n // Initialize the instance now (similar to mounted)\n if (!instance) {\n instance = initDirectiveInstance(el, propertyName, uid, binding)\n\n const props = buildProps\n ? buildProps(text, defaultsMap?.[componentDefaultsKey], binding, el)\n : {\n ...(defaultsMap?.[componentDefaultsKey] || undefined),\n ...resolveDirectiveProps(binding, el),\n ...text,\n }\n\n bind(el, binding, props)\n return\n }\n\n // Check if binding changed for THIS instance\n if (!hasBindingChanged(instance, binding)) return\n\n // Prevent race conditions during update\n if (instance.destroying) return\n\n const props = buildProps\n ? buildProps(text, defaultsMap?.[componentDefaultsKey], binding, el)\n : {\n ...(defaultsMap?.[componentDefaultsKey] || undefined),\n ...resolveDirectiveProps(binding, el),\n ...text,\n }\n\n // Update props in-place so the tooltip stays visible if it was open\n updateBind(el, binding, props)\n\n // Update THIS instance's cache\n updateBindingCache(instance, binding)\n },\n\n beforeUnmount(el, binding) {\n const uid = getDirectiveUid(binding)\n const instance = getDirectiveInstance(el, propertyName, uid)\n\n if (!instance) return\n\n unbind(el)\n cleanupDirectiveInstance(el, propertyName, uid)\n },\n }\n}\n"],"mappings":";;;;;;;AAoCA,SAAgB,gBAAgB,SAAmC;AACjE,KAAI,CAAC,QAAQ,SACX,OAAM,IAAI,MAAM,mEAAmE;AAErF,QAAO,QAAQ,SAAS,EAAE;;;;;;;;;;AAW5B,SAAgB,sBACd,IACA,cACA,KACA,SACwB;CAExB,MAAM,cAAc;AACpB,aAAY,gBAAgB,YAAY,iBAAiB,OAAO,OAAO,KAAK;CAG5E,MAAM,QAAgC;EACpC,SAAS,KAAK,UAAU,CAAC,QAAQ,WAAW,QAAQ,MAAM,CAAC;EAC3D,YAAY;EACb;AAEC,aAAY,cAA0C,OAAO;AAC/D,QAAO;;;;;;;;;AAUT,SAAgB,qBACd,IACA,cACA,KACoC;AAEpC,QADoB,GACA,gBAAwD;;;;;;;;AAW9E,SAAgB,kBACd,UACA,SACS;CACT,MAAM,aAAa,KAAK,UAAU,CAAC,QAAQ,WAAW,QAAQ,MAAM,CAAC;AACrE,QAAO,SAAS,YAAY;;;;;;;AAQ9B,SAAgB,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AACxB;;AAIF,OAAI,CAAC,kBAAkB,UAAU,QAAQ,CAAE;AAG3C,OAAI,SAAS,WAAY;AAWzB,sBAAA,WAAW,IAAI,SATD,aACV,WAAW,MAAM,cAAc,uBAAuB,SAAS,GAAG,GAClE;IACE,GAAI,cAAc,yBAAyB,KAAA;IAC3C,GAAG,mBAAA,sBAAsB,SAAS,GAAG;IACrC,GAAG;IACJ,CAGyB;AAG9B,sBAAmB,UAAU,QAAQ;;EAGvC,cAAc,IAAI,SAAS;GACzB,MAAM,MAAM,gBAAgB,QAAQ;AAGpC,OAAI,CAFa,qBAAqB,IAAI,cAAc,IAAI,CAE7C;AAEf,sBAAA,OAAO,GAAG;AACV,4BAAyB,IAAI,cAAc,IAAI;;EAElD"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "bootstrap-vue-next",
3
3
  "displayName": "BootstrapVueNext",
4
4
  "description": "Seamless integration of Vue 3, Bootstrap 5, and TypeScript for modern, type-safe UI development",
5
- "version": "0.44.6",
5
+ "version": "0.45.0",
6
6
  "license": "MIT",
7
7
  "main": "./dist/bootstrap-vue-next.umd.js",
8
8
  "module": "./dist/bootstrap-vue-next.mjs",
@@ -1 +0,0 @@
1
- {"version":3,"file":"BAvatar-D7aFEXLH.mjs","names":[],"sources":["../src/components/BAvatar/BAvatar.vue","../src/components/BAvatar/BAvatar.vue","../src/components/BAvatar/BAvatarGroup.vue","../src/components/BAvatar/BAvatarGroup.vue"],"sourcesContent":["<template>\n <component\n :is=\"computedTag\"\n class=\"b-avatar\"\n :class=\"computedClasses\"\n :style=\"computedStyle\"\n v-bind=\"computedLinkProps\"\n :type=\"props.button && !computedLink ? props.buttonType : undefined\"\n :disabled=\"props.disabled || null\"\n :variant=\"null\"\n @click=\"clicked\"\n >\n <span v-if=\"hasDefaultSlot\" class=\"b-avatar-custom\">\n <slot />\n </span>\n <span v-else-if=\"!!localSrc\" class=\"b-avatar-img\">\n <img :src=\"localSrc\" :alt=\"props.alt\" @error=\"onImgError\" />\n </span>\n <span v-else-if=\"!!props.text\" class=\"b-avatar-text\" :style=\"textFontStyle\">\n {{ props.text }}\n </span>\n <span v-else class=\"b-avatar-img\"\n ><svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"80%\"\n height=\"80%\"\n fill=\"currentColor\"\n class=\"bi bi-person-fill\"\n viewBox=\"0 0 16 16\"\n >\n <path d=\"M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6\" />\n </svg>\n </span>\n <BBadge\n v-if=\"showBadge\"\n :pill=\"props.badgePill\"\n :dot-indicator=\"props.badgeDotIndicator || badgeImplicitlyDot\"\n :variant=\"props.badgeVariant\"\n :bg-variant=\"props.badgeBgVariant\"\n :text-variant=\"props.badgeTextVariant\"\n :style=\"badgeStyle\"\n :placement=\"props.badgePlacement\"\n >\n <slot name=\"badge\">\n {{ badgeText }}\n </slot>\n </BBadge>\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {avatarGroupInjectionKey} from '../../utils/keys'\nimport {computed, type CSSProperties, inject, ref, type StyleValue, watch} from 'vue'\nimport type {BAvatarProps} from '../../types/ComponentProps'\nimport BLink from '../BLink/BLink.vue'\nimport BBadge from '../BBadge/BBadge.vue'\nimport {useBLinkHelper} from '../../composables/useBLinkHelper'\nimport {isEmptySlot} from '../../utils/dom'\nimport {useNumberishToStyle} from '../../composables/useNumberishToStyle'\nimport {useRadiusElementClasses} from '../../composables/useRadiusElementClasses'\nimport {useColorVariantClasses} from '../../composables/useColorVariantClasses'\nimport type {BAvatarEmits, BAvatarSlots, Size} from '../../types'\nimport {useDefaults} from '../../composables/useDefaults'\n\nconst _props = withDefaults(defineProps<BAvatarProps>(), {\n alt: 'avatar',\n badge: false,\n badgeBgVariant: null,\n badgeTextVariant: null,\n badgeVariant: 'primary',\n badgePlacement: 'bottom-end',\n badgeDotIndicator: false,\n badgePill: false,\n button: false,\n buttonType: 'button',\n size: undefined,\n square: false,\n src: undefined,\n text: undefined,\n // Link props\n variant: 'secondary',\n // All others use defaults\n active: undefined,\n activeClass: undefined,\n disabled: undefined,\n exactActiveClass: undefined,\n href: undefined,\n opacity: undefined,\n opacityHover: undefined,\n rel: undefined,\n replace: undefined,\n stretched: false,\n routerComponentName: undefined,\n target: undefined,\n underlineOffset: undefined,\n underlineOffsetHover: undefined,\n underlineOpacity: undefined,\n underlineOpacityHover: undefined,\n underlineVariant: undefined,\n // End link props\n // ColorExtendables props\n // Variant is here as well\n bgVariant: null,\n textVariant: null,\n // End ColorExtendables props\n // RadiusElementExtendables props\n rounded: 'circle',\n roundedBottom: undefined,\n roundedEnd: undefined,\n roundedStart: undefined,\n roundedTop: undefined,\n // End RadiusElementExtendables props\n})\nconst props = useDefaults(_props, 'BAvatar')\nconst emit = defineEmits<BAvatarEmits>()\nconst slots = defineSlots<BAvatarSlots>()\n\nconst localSrc = ref(props.src)\nwatch(\n () => props.src,\n (value) => {\n localSrc.value = value\n }\n)\n\nconst {computedLink, computedLinkProps} = useBLinkHelper(props)\n\nconst parentData = inject(avatarGroupInjectionKey, null)\n\nconst SIZES = Object.freeze([\n null,\n ...Object.keys({\n lg: null,\n md: null,\n sm: null,\n } satisfies Record<Size, null>),\n] as (string | null)[])\nconst FONT_SIZE_SCALE = 0.4\nconst BADGE_FONT_SIZE_SCALE = FONT_SIZE_SCALE * 0.7\n\nconst hasDefaultSlot = computed(() => !isEmptySlot(slots.default))\nconst hasBadgeSlot = computed(() => !isEmptySlot(slots.badge))\n\nconst showBadge = computed(() => !!props.badge || props.badge === '' || hasBadgeSlot.value)\nconst computedSquare = computed(() => parentData?.square.value || props.square)\n\n// const computedPropSize = useNumberishToStyle(() => props.size)\n// const propSizeIsLiteralSize = (val: unknown): val is Size =>\n// !!val && typeof val === 'string' && SIZES.includes(val)\n// const computedParentSize = useNumberishToStyle(() => parentData?.size.value)\n// const computedSize = computed(() => computedParentSize.value ?? computedPropSize.value)\n// const computedPropSizeIsLiteralSize = computed(() => propSizeIsLiteralSize(computedSize.value))\n\nconst computedSize = useNumberishToStyle(() => parentData?.size.value ?? props.size)\nconst computedSizeIsLiteralSize = computed(\n () => !!computedSize.value && SIZES.includes(computedSize.value)\n)\n\nconst computedVariant = computed(() => parentData?.variant.value ?? props.variant)\nconst computedRounded = computed(() => parentData?.rounded.value ?? props.rounded)\nconst computedRoundedTop = computed(() => parentData?.roundedTop.value ?? props.roundedTop)\nconst computedRoundedBottom = computed(() => parentData?.roundedBottom.value ?? props.roundedBottom)\nconst computedRoundedStart = computed(() => parentData?.roundedStart.value ?? props.roundedStart)\nconst computedRoundedEnd = computed(() => parentData?.roundedEnd.value ?? props.roundedEnd)\n\nconst radiusElementClasses = useRadiusElementClasses(() => ({\n rounded: computedRounded.value,\n roundedTop: computedRoundedTop.value,\n roundedBottom: computedRoundedBottom.value,\n roundedStart: computedRoundedStart.value,\n roundedEnd: computedRoundedEnd.value,\n}))\n\nconst badgeText = computed(() => (props.badge === true ? '' : props.badge))\nconst badgeImplicitlyDot = computed(() => !badgeText.value && !hasBadgeSlot.value)\n\nconst colorClasses = useColorVariantClasses(() => ({\n bgVariant: parentData?.bgVariant.value ?? props.bgVariant,\n textVariant: parentData?.textVariant.value ?? props.textVariant,\n variant: computedVariant.value,\n}))\nconst computedClasses = computed(() => [\n colorClasses.value,\n // Square overwrites all else\n computedSquare.value === true ? undefined : radiusElementClasses.value,\n {\n [`b-avatar-${computedSize.value}`]:\n computedSizeIsLiteralSize.value && computedSize.value !== 'md',\n [`btn-${computedVariant.value}`]: props.button ? computedVariant.value !== null : false,\n 'badge': !props.button && computedVariant.value !== null && hasDefaultSlot.value,\n 'btn': props.button,\n // Square is the same as rounded-0 class\n 'rounded-0': computedSquare.value === true,\n },\n])\n\nconst badgeStyle = computed<StyleValue>(() => ({\n fontSize:\n (!computedSizeIsLiteralSize.value\n ? `calc(${computedSize.value} * ${BADGE_FONT_SIZE_SCALE})`\n : '') || '',\n}))\n\nconst textFontStyle = computed<StyleValue>(() => {\n const fontSize = !computedSizeIsLiteralSize.value\n ? `calc(${computedSize.value} * ${FONT_SIZE_SCALE})`\n : null\n return fontSize ? {fontSize} : {}\n})\n\nconst marginStyle = computed(() => {\n const overlapScale = parentData?.overlapScale?.value || 0\n\n const value =\n computedSize.value && overlapScale ? `calc(${computedSize.value} * -${overlapScale})` : null\n return value ? {marginLeft: value, marginRight: value} : {}\n})\n\nconst computedTag = computed(() => (computedLink.value ? BLink : props.button ? 'button' : 'span'))\n\nconst computedStyle = computed<CSSProperties>(() => ({\n ...marginStyle.value,\n ...(!computedSizeIsLiteralSize.value\n ? {\n width: computedSize.value,\n height: computedSize.value,\n }\n : undefined),\n}))\n\nconst clicked = (e: Readonly<MouseEvent>): void => {\n if (!props.disabled && (computedLink.value || props.button)) emit('click', e)\n}\n\nconst onImgError = (e: Readonly<Event>) => {\n localSrc.value = undefined\n emit('img-error', e)\n}\n</script>\n","<template>\n <component\n :is=\"computedTag\"\n class=\"b-avatar\"\n :class=\"computedClasses\"\n :style=\"computedStyle\"\n v-bind=\"computedLinkProps\"\n :type=\"props.button && !computedLink ? props.buttonType : undefined\"\n :disabled=\"props.disabled || null\"\n :variant=\"null\"\n @click=\"clicked\"\n >\n <span v-if=\"hasDefaultSlot\" class=\"b-avatar-custom\">\n <slot />\n </span>\n <span v-else-if=\"!!localSrc\" class=\"b-avatar-img\">\n <img :src=\"localSrc\" :alt=\"props.alt\" @error=\"onImgError\" />\n </span>\n <span v-else-if=\"!!props.text\" class=\"b-avatar-text\" :style=\"textFontStyle\">\n {{ props.text }}\n </span>\n <span v-else class=\"b-avatar-img\"\n ><svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"80%\"\n height=\"80%\"\n fill=\"currentColor\"\n class=\"bi bi-person-fill\"\n viewBox=\"0 0 16 16\"\n >\n <path d=\"M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6\" />\n </svg>\n </span>\n <BBadge\n v-if=\"showBadge\"\n :pill=\"props.badgePill\"\n :dot-indicator=\"props.badgeDotIndicator || badgeImplicitlyDot\"\n :variant=\"props.badgeVariant\"\n :bg-variant=\"props.badgeBgVariant\"\n :text-variant=\"props.badgeTextVariant\"\n :style=\"badgeStyle\"\n :placement=\"props.badgePlacement\"\n >\n <slot name=\"badge\">\n {{ badgeText }}\n </slot>\n </BBadge>\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {avatarGroupInjectionKey} from '../../utils/keys'\nimport {computed, type CSSProperties, inject, ref, type StyleValue, watch} from 'vue'\nimport type {BAvatarProps} from '../../types/ComponentProps'\nimport BLink from '../BLink/BLink.vue'\nimport BBadge from '../BBadge/BBadge.vue'\nimport {useBLinkHelper} from '../../composables/useBLinkHelper'\nimport {isEmptySlot} from '../../utils/dom'\nimport {useNumberishToStyle} from '../../composables/useNumberishToStyle'\nimport {useRadiusElementClasses} from '../../composables/useRadiusElementClasses'\nimport {useColorVariantClasses} from '../../composables/useColorVariantClasses'\nimport type {BAvatarEmits, BAvatarSlots, Size} from '../../types'\nimport {useDefaults} from '../../composables/useDefaults'\n\nconst _props = withDefaults(defineProps<BAvatarProps>(), {\n alt: 'avatar',\n badge: false,\n badgeBgVariant: null,\n badgeTextVariant: null,\n badgeVariant: 'primary',\n badgePlacement: 'bottom-end',\n badgeDotIndicator: false,\n badgePill: false,\n button: false,\n buttonType: 'button',\n size: undefined,\n square: false,\n src: undefined,\n text: undefined,\n // Link props\n variant: 'secondary',\n // All others use defaults\n active: undefined,\n activeClass: undefined,\n disabled: undefined,\n exactActiveClass: undefined,\n href: undefined,\n opacity: undefined,\n opacityHover: undefined,\n rel: undefined,\n replace: undefined,\n stretched: false,\n routerComponentName: undefined,\n target: undefined,\n underlineOffset: undefined,\n underlineOffsetHover: undefined,\n underlineOpacity: undefined,\n underlineOpacityHover: undefined,\n underlineVariant: undefined,\n // End link props\n // ColorExtendables props\n // Variant is here as well\n bgVariant: null,\n textVariant: null,\n // End ColorExtendables props\n // RadiusElementExtendables props\n rounded: 'circle',\n roundedBottom: undefined,\n roundedEnd: undefined,\n roundedStart: undefined,\n roundedTop: undefined,\n // End RadiusElementExtendables props\n})\nconst props = useDefaults(_props, 'BAvatar')\nconst emit = defineEmits<BAvatarEmits>()\nconst slots = defineSlots<BAvatarSlots>()\n\nconst localSrc = ref(props.src)\nwatch(\n () => props.src,\n (value) => {\n localSrc.value = value\n }\n)\n\nconst {computedLink, computedLinkProps} = useBLinkHelper(props)\n\nconst parentData = inject(avatarGroupInjectionKey, null)\n\nconst SIZES = Object.freeze([\n null,\n ...Object.keys({\n lg: null,\n md: null,\n sm: null,\n } satisfies Record<Size, null>),\n] as (string | null)[])\nconst FONT_SIZE_SCALE = 0.4\nconst BADGE_FONT_SIZE_SCALE = FONT_SIZE_SCALE * 0.7\n\nconst hasDefaultSlot = computed(() => !isEmptySlot(slots.default))\nconst hasBadgeSlot = computed(() => !isEmptySlot(slots.badge))\n\nconst showBadge = computed(() => !!props.badge || props.badge === '' || hasBadgeSlot.value)\nconst computedSquare = computed(() => parentData?.square.value || props.square)\n\n// const computedPropSize = useNumberishToStyle(() => props.size)\n// const propSizeIsLiteralSize = (val: unknown): val is Size =>\n// !!val && typeof val === 'string' && SIZES.includes(val)\n// const computedParentSize = useNumberishToStyle(() => parentData?.size.value)\n// const computedSize = computed(() => computedParentSize.value ?? computedPropSize.value)\n// const computedPropSizeIsLiteralSize = computed(() => propSizeIsLiteralSize(computedSize.value))\n\nconst computedSize = useNumberishToStyle(() => parentData?.size.value ?? props.size)\nconst computedSizeIsLiteralSize = computed(\n () => !!computedSize.value && SIZES.includes(computedSize.value)\n)\n\nconst computedVariant = computed(() => parentData?.variant.value ?? props.variant)\nconst computedRounded = computed(() => parentData?.rounded.value ?? props.rounded)\nconst computedRoundedTop = computed(() => parentData?.roundedTop.value ?? props.roundedTop)\nconst computedRoundedBottom = computed(() => parentData?.roundedBottom.value ?? props.roundedBottom)\nconst computedRoundedStart = computed(() => parentData?.roundedStart.value ?? props.roundedStart)\nconst computedRoundedEnd = computed(() => parentData?.roundedEnd.value ?? props.roundedEnd)\n\nconst radiusElementClasses = useRadiusElementClasses(() => ({\n rounded: computedRounded.value,\n roundedTop: computedRoundedTop.value,\n roundedBottom: computedRoundedBottom.value,\n roundedStart: computedRoundedStart.value,\n roundedEnd: computedRoundedEnd.value,\n}))\n\nconst badgeText = computed(() => (props.badge === true ? '' : props.badge))\nconst badgeImplicitlyDot = computed(() => !badgeText.value && !hasBadgeSlot.value)\n\nconst colorClasses = useColorVariantClasses(() => ({\n bgVariant: parentData?.bgVariant.value ?? props.bgVariant,\n textVariant: parentData?.textVariant.value ?? props.textVariant,\n variant: computedVariant.value,\n}))\nconst computedClasses = computed(() => [\n colorClasses.value,\n // Square overwrites all else\n computedSquare.value === true ? undefined : radiusElementClasses.value,\n {\n [`b-avatar-${computedSize.value}`]:\n computedSizeIsLiteralSize.value && computedSize.value !== 'md',\n [`btn-${computedVariant.value}`]: props.button ? computedVariant.value !== null : false,\n 'badge': !props.button && computedVariant.value !== null && hasDefaultSlot.value,\n 'btn': props.button,\n // Square is the same as rounded-0 class\n 'rounded-0': computedSquare.value === true,\n },\n])\n\nconst badgeStyle = computed<StyleValue>(() => ({\n fontSize:\n (!computedSizeIsLiteralSize.value\n ? `calc(${computedSize.value} * ${BADGE_FONT_SIZE_SCALE})`\n : '') || '',\n}))\n\nconst textFontStyle = computed<StyleValue>(() => {\n const fontSize = !computedSizeIsLiteralSize.value\n ? `calc(${computedSize.value} * ${FONT_SIZE_SCALE})`\n : null\n return fontSize ? {fontSize} : {}\n})\n\nconst marginStyle = computed(() => {\n const overlapScale = parentData?.overlapScale?.value || 0\n\n const value =\n computedSize.value && overlapScale ? `calc(${computedSize.value} * -${overlapScale})` : null\n return value ? {marginLeft: value, marginRight: value} : {}\n})\n\nconst computedTag = computed(() => (computedLink.value ? BLink : props.button ? 'button' : 'span'))\n\nconst computedStyle = computed<CSSProperties>(() => ({\n ...marginStyle.value,\n ...(!computedSizeIsLiteralSize.value\n ? {\n width: computedSize.value,\n height: computedSize.value,\n }\n : undefined),\n}))\n\nconst clicked = (e: Readonly<MouseEvent>): void => {\n if (!props.disabled && (computedLink.value || props.button)) emit('click', e)\n}\n\nconst onImgError = (e: Readonly<Event>) => {\n localSrc.value = undefined\n emit('img-error', e)\n}\n</script>\n","<template>\n <component :is=\"props.tag\" class=\"b-avatar-group\" role=\"group\">\n <div class=\"b-avatar-group-inner\" :style=\"paddingStyle\">\n <slot />\n </div>\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, provide, type StyleValue, toRef} from 'vue'\nimport type {BAvatarGroupProps} from '../../types/ComponentProps'\nimport {avatarGroupInjectionKey} from '../../utils/keys'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useToNumber} from '@vueuse/core'\nimport {useNumberishToStyle} from '../../composables/useNumberishToStyle'\nimport type {BAvatarGroupSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<BAvatarGroupProps>(), {\n overlap: 0.3,\n size: undefined,\n square: false,\n tag: 'div',\n // RadiusElementExtendables props\n rounded: 'circle',\n roundedBottom: undefined,\n roundedEnd: undefined,\n roundedStart: undefined,\n roundedTop: undefined,\n // End RadiusElementExtendables props\n // ColorExtendables props\n bgVariant: null,\n textVariant: null,\n variant: null,\n // End ColorExtendables props\n})\nconst props = useDefaults(_props, 'BAvatarGroup')\ndefineSlots<BAvatarGroupSlots>()\n\nconst overlapNumber = useToNumber(() => props.overlap)\n\nconst computedSize = useNumberishToStyle(() => props.size)\nconst overlapScale = computed(() => Math.min(Math.max(overlapNumber.value, 0), 1) / 2)\n\nconst paddingStyle = computed<StyleValue>(() => {\n const value = computedSize.value ? `calc(${computedSize.value} * ${overlapScale.value})` : null\n return value ? {paddingLeft: value, paddingRight: value} : {}\n})\n\nprovide(avatarGroupInjectionKey, {\n overlapScale,\n size: toRef(() => props.size),\n square: toRef(() => props.square),\n rounded: toRef(() => props.rounded),\n roundedTop: toRef(() => props.roundedTop),\n roundedBottom: toRef(() => props.roundedBottom),\n roundedStart: toRef(() => props.roundedStart),\n roundedEnd: toRef(() => props.roundedEnd),\n variant: toRef(() => props.variant),\n bgVariant: toRef(() => props.bgVariant),\n textVariant: toRef(() => props.textVariant),\n})\n</script>\n","<template>\n <component :is=\"props.tag\" class=\"b-avatar-group\" role=\"group\">\n <div class=\"b-avatar-group-inner\" :style=\"paddingStyle\">\n <slot />\n </div>\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, provide, type StyleValue, toRef} from 'vue'\nimport type {BAvatarGroupProps} from '../../types/ComponentProps'\nimport {avatarGroupInjectionKey} from '../../utils/keys'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useToNumber} from '@vueuse/core'\nimport {useNumberishToStyle} from '../../composables/useNumberishToStyle'\nimport type {BAvatarGroupSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<BAvatarGroupProps>(), {\n overlap: 0.3,\n size: undefined,\n square: false,\n tag: 'div',\n // RadiusElementExtendables props\n rounded: 'circle',\n roundedBottom: undefined,\n roundedEnd: undefined,\n roundedStart: undefined,\n roundedTop: undefined,\n // End RadiusElementExtendables props\n // ColorExtendables props\n bgVariant: null,\n textVariant: null,\n variant: null,\n // End ColorExtendables props\n})\nconst props = useDefaults(_props, 'BAvatarGroup')\ndefineSlots<BAvatarGroupSlots>()\n\nconst overlapNumber = useToNumber(() => props.overlap)\n\nconst computedSize = useNumberishToStyle(() => props.size)\nconst overlapScale = computed(() => Math.min(Math.max(overlapNumber.value, 0), 1) / 2)\n\nconst paddingStyle = computed<StyleValue>(() => {\n const value = computedSize.value ? `calc(${computedSize.value} * ${overlapScale.value})` : null\n return value ? {paddingLeft: value, paddingRight: value} : {}\n})\n\nprovide(avatarGroupInjectionKey, {\n overlapScale,\n size: toRef(() => props.size),\n square: toRef(() => props.square),\n rounded: toRef(() => props.rounded),\n roundedTop: toRef(() => props.roundedTop),\n roundedBottom: toRef(() => props.roundedBottom),\n roundedStart: toRef(() => props.roundedStart),\n roundedEnd: toRef(() => props.roundedEnd),\n variant: toRef(() => props.variant),\n bgVariant: toRef(() => props.bgVariant),\n textVariant: toRef(() => props.textVariant),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyIA,IAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAxBxB,MAAM,QAAQ,YAjDC,SAiDmB,UAAS;EAC3C,MAAM,OAAO;EACb,MAAM,QAAQ,UAAA;EAEd,MAAM,WAAW,IAAI,MAAM,IAAG;AAC9B,cACQ,MAAM,MACX,UAAU;AACT,YAAS,QAAQ;IAErB;EAEA,MAAM,EAAC,cAAc,sBAAqB,eAAe,MAAK;EAE9D,MAAM,aAAa,OAAO,yBAAyB,KAAI;EAEvD,MAAM,QAAQ,OAAO,OAAO,CAC1B,MACA,GAAG,OAAO,KAAK;GACb,IAAI;GACJ,IAAI;GACJ,IAAI;GACL,CAA8B,CAChC,CAAqB;EAEtB,MAAM,wBAAwB,kBAAkB;EAEhD,MAAM,iBAAiB,eAAe,CAAC,YAAY,MAAM,QAAQ,CAAA;EACjE,MAAM,eAAe,eAAe,CAAC,YAAY,MAAM,MAAM,CAAA;EAE7D,MAAM,YAAY,eAAe,CAAC,CAAC,MAAM,SAAS,MAAM,UAAU,MAAM,aAAa,MAAK;EAC1F,MAAM,iBAAiB,eAAe,YAAY,OAAO,SAAS,MAAM,OAAM;EAS9E,MAAM,eAAe,0BAA0B,YAAY,KAAK,SAAS,MAAM,KAAI;EACnF,MAAM,4BAA4B,eAC1B,CAAC,CAAC,aAAa,SAAS,MAAM,SAAS,aAAa,MAAK,CACjE;EAEA,MAAM,kBAAkB,eAAe,YAAY,QAAQ,SAAS,MAAM,QAAO;EACjF,MAAM,kBAAkB,eAAe,YA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AAM,OAAO;GACjC,SAAS,YAAY,MAAM,QAAQ;GACnC,YAAY,YAAY,MAAM,WAAW;GACzC,eAAe,YAAY,MAAM,cAAc;GAC/C,cAAc,YAAY,MAAM,aAAa;GAC7C,YAAY,YAAY,MAAM,WAAW;GACzC,SAAS,YAAY,MAAM,QAAQ;GACnC,WAAW,YAAY,MAAM,UAAU;GACvC,aAAa,YAAY,MAAM,YAAA;GAChC,CAAA;;uBA3DC,YAIY,wBAJI,MAAA,MAAK,CAAC,IAAG,EAAA;IAAE,OAAM;IAAiB,MAAK;;2BAG/C,CAFN,mBAEM,OAAA;KAFD,OAAM;KAAwB,OAAK,eAAE,aAAA,MAAA;QACxC,WAAQ,KAAA,QAAA,UAAA,CAAA,EAAA,EAAA,CAAA,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BAvatar-lefHkDuG.js","names":[],"sources":["../src/components/BAvatar/BAvatar.vue","../src/components/BAvatar/BAvatar.vue","../src/components/BAvatar/BAvatarGroup.vue","../src/components/BAvatar/BAvatarGroup.vue"],"sourcesContent":["<template>\n <component\n :is=\"computedTag\"\n class=\"b-avatar\"\n :class=\"computedClasses\"\n :style=\"computedStyle\"\n v-bind=\"computedLinkProps\"\n :type=\"props.button && !computedLink ? props.buttonType : undefined\"\n :disabled=\"props.disabled || null\"\n :variant=\"null\"\n @click=\"clicked\"\n >\n <span v-if=\"hasDefaultSlot\" class=\"b-avatar-custom\">\n <slot />\n </span>\n <span v-else-if=\"!!localSrc\" class=\"b-avatar-img\">\n <img :src=\"localSrc\" :alt=\"props.alt\" @error=\"onImgError\" />\n </span>\n <span v-else-if=\"!!props.text\" class=\"b-avatar-text\" :style=\"textFontStyle\">\n {{ props.text }}\n </span>\n <span v-else class=\"b-avatar-img\"\n ><svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"80%\"\n height=\"80%\"\n fill=\"currentColor\"\n class=\"bi bi-person-fill\"\n viewBox=\"0 0 16 16\"\n >\n <path d=\"M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6\" />\n </svg>\n </span>\n <BBadge\n v-if=\"showBadge\"\n :pill=\"props.badgePill\"\n :dot-indicator=\"props.badgeDotIndicator || badgeImplicitlyDot\"\n :variant=\"props.badgeVariant\"\n :bg-variant=\"props.badgeBgVariant\"\n :text-variant=\"props.badgeTextVariant\"\n :style=\"badgeStyle\"\n :placement=\"props.badgePlacement\"\n >\n <slot name=\"badge\">\n {{ badgeText }}\n </slot>\n </BBadge>\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {avatarGroupInjectionKey} from '../../utils/keys'\nimport {computed, type CSSProperties, inject, ref, type StyleValue, watch} from 'vue'\nimport type {BAvatarProps} from '../../types/ComponentProps'\nimport BLink from '../BLink/BLink.vue'\nimport BBadge from '../BBadge/BBadge.vue'\nimport {useBLinkHelper} from '../../composables/useBLinkHelper'\nimport {isEmptySlot} from '../../utils/dom'\nimport {useNumberishToStyle} from '../../composables/useNumberishToStyle'\nimport {useRadiusElementClasses} from '../../composables/useRadiusElementClasses'\nimport {useColorVariantClasses} from '../../composables/useColorVariantClasses'\nimport type {BAvatarEmits, BAvatarSlots, Size} from '../../types'\nimport {useDefaults} from '../../composables/useDefaults'\n\nconst _props = withDefaults(defineProps<BAvatarProps>(), {\n alt: 'avatar',\n badge: false,\n badgeBgVariant: null,\n badgeTextVariant: null,\n badgeVariant: 'primary',\n badgePlacement: 'bottom-end',\n badgeDotIndicator: false,\n badgePill: false,\n button: false,\n buttonType: 'button',\n size: undefined,\n square: false,\n src: undefined,\n text: undefined,\n // Link props\n variant: 'secondary',\n // All others use defaults\n active: undefined,\n activeClass: undefined,\n disabled: undefined,\n exactActiveClass: undefined,\n href: undefined,\n opacity: undefined,\n opacityHover: undefined,\n rel: undefined,\n replace: undefined,\n stretched: false,\n routerComponentName: undefined,\n target: undefined,\n underlineOffset: undefined,\n underlineOffsetHover: undefined,\n underlineOpacity: undefined,\n underlineOpacityHover: undefined,\n underlineVariant: undefined,\n // End link props\n // ColorExtendables props\n // Variant is here as well\n bgVariant: null,\n textVariant: null,\n // End ColorExtendables props\n // RadiusElementExtendables props\n rounded: 'circle',\n roundedBottom: undefined,\n roundedEnd: undefined,\n roundedStart: undefined,\n roundedTop: undefined,\n // End RadiusElementExtendables props\n})\nconst props = useDefaults(_props, 'BAvatar')\nconst emit = defineEmits<BAvatarEmits>()\nconst slots = defineSlots<BAvatarSlots>()\n\nconst localSrc = ref(props.src)\nwatch(\n () => props.src,\n (value) => {\n localSrc.value = value\n }\n)\n\nconst {computedLink, computedLinkProps} = useBLinkHelper(props)\n\nconst parentData = inject(avatarGroupInjectionKey, null)\n\nconst SIZES = Object.freeze([\n null,\n ...Object.keys({\n lg: null,\n md: null,\n sm: null,\n } satisfies Record<Size, null>),\n] as (string | null)[])\nconst FONT_SIZE_SCALE = 0.4\nconst BADGE_FONT_SIZE_SCALE = FONT_SIZE_SCALE * 0.7\n\nconst hasDefaultSlot = computed(() => !isEmptySlot(slots.default))\nconst hasBadgeSlot = computed(() => !isEmptySlot(slots.badge))\n\nconst showBadge = computed(() => !!props.badge || props.badge === '' || hasBadgeSlot.value)\nconst computedSquare = computed(() => parentData?.square.value || props.square)\n\n// const computedPropSize = useNumberishToStyle(() => props.size)\n// const propSizeIsLiteralSize = (val: unknown): val is Size =>\n// !!val && typeof val === 'string' && SIZES.includes(val)\n// const computedParentSize = useNumberishToStyle(() => parentData?.size.value)\n// const computedSize = computed(() => computedParentSize.value ?? computedPropSize.value)\n// const computedPropSizeIsLiteralSize = computed(() => propSizeIsLiteralSize(computedSize.value))\n\nconst computedSize = useNumberishToStyle(() => parentData?.size.value ?? props.size)\nconst computedSizeIsLiteralSize = computed(\n () => !!computedSize.value && SIZES.includes(computedSize.value)\n)\n\nconst computedVariant = computed(() => parentData?.variant.value ?? props.variant)\nconst computedRounded = computed(() => parentData?.rounded.value ?? props.rounded)\nconst computedRoundedTop = computed(() => parentData?.roundedTop.value ?? props.roundedTop)\nconst computedRoundedBottom = computed(() => parentData?.roundedBottom.value ?? props.roundedBottom)\nconst computedRoundedStart = computed(() => parentData?.roundedStart.value ?? props.roundedStart)\nconst computedRoundedEnd = computed(() => parentData?.roundedEnd.value ?? props.roundedEnd)\n\nconst radiusElementClasses = useRadiusElementClasses(() => ({\n rounded: computedRounded.value,\n roundedTop: computedRoundedTop.value,\n roundedBottom: computedRoundedBottom.value,\n roundedStart: computedRoundedStart.value,\n roundedEnd: computedRoundedEnd.value,\n}))\n\nconst badgeText = computed(() => (props.badge === true ? '' : props.badge))\nconst badgeImplicitlyDot = computed(() => !badgeText.value && !hasBadgeSlot.value)\n\nconst colorClasses = useColorVariantClasses(() => ({\n bgVariant: parentData?.bgVariant.value ?? props.bgVariant,\n textVariant: parentData?.textVariant.value ?? props.textVariant,\n variant: computedVariant.value,\n}))\nconst computedClasses = computed(() => [\n colorClasses.value,\n // Square overwrites all else\n computedSquare.value === true ? undefined : radiusElementClasses.value,\n {\n [`b-avatar-${computedSize.value}`]:\n computedSizeIsLiteralSize.value && computedSize.value !== 'md',\n [`btn-${computedVariant.value}`]: props.button ? computedVariant.value !== null : false,\n 'badge': !props.button && computedVariant.value !== null && hasDefaultSlot.value,\n 'btn': props.button,\n // Square is the same as rounded-0 class\n 'rounded-0': computedSquare.value === true,\n },\n])\n\nconst badgeStyle = computed<StyleValue>(() => ({\n fontSize:\n (!computedSizeIsLiteralSize.value\n ? `calc(${computedSize.value} * ${BADGE_FONT_SIZE_SCALE})`\n : '') || '',\n}))\n\nconst textFontStyle = computed<StyleValue>(() => {\n const fontSize = !computedSizeIsLiteralSize.value\n ? `calc(${computedSize.value} * ${FONT_SIZE_SCALE})`\n : null\n return fontSize ? {fontSize} : {}\n})\n\nconst marginStyle = computed(() => {\n const overlapScale = parentData?.overlapScale?.value || 0\n\n const value =\n computedSize.value && overlapScale ? `calc(${computedSize.value} * -${overlapScale})` : null\n return value ? {marginLeft: value, marginRight: value} : {}\n})\n\nconst computedTag = computed(() => (computedLink.value ? BLink : props.button ? 'button' : 'span'))\n\nconst computedStyle = computed<CSSProperties>(() => ({\n ...marginStyle.value,\n ...(!computedSizeIsLiteralSize.value\n ? {\n width: computedSize.value,\n height: computedSize.value,\n }\n : undefined),\n}))\n\nconst clicked = (e: Readonly<MouseEvent>): void => {\n if (!props.disabled && (computedLink.value || props.button)) emit('click', e)\n}\n\nconst onImgError = (e: Readonly<Event>) => {\n localSrc.value = undefined\n emit('img-error', e)\n}\n</script>\n","<template>\n <component\n :is=\"computedTag\"\n class=\"b-avatar\"\n :class=\"computedClasses\"\n :style=\"computedStyle\"\n v-bind=\"computedLinkProps\"\n :type=\"props.button && !computedLink ? props.buttonType : undefined\"\n :disabled=\"props.disabled || null\"\n :variant=\"null\"\n @click=\"clicked\"\n >\n <span v-if=\"hasDefaultSlot\" class=\"b-avatar-custom\">\n <slot />\n </span>\n <span v-else-if=\"!!localSrc\" class=\"b-avatar-img\">\n <img :src=\"localSrc\" :alt=\"props.alt\" @error=\"onImgError\" />\n </span>\n <span v-else-if=\"!!props.text\" class=\"b-avatar-text\" :style=\"textFontStyle\">\n {{ props.text }}\n </span>\n <span v-else class=\"b-avatar-img\"\n ><svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"80%\"\n height=\"80%\"\n fill=\"currentColor\"\n class=\"bi bi-person-fill\"\n viewBox=\"0 0 16 16\"\n >\n <path d=\"M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6\" />\n </svg>\n </span>\n <BBadge\n v-if=\"showBadge\"\n :pill=\"props.badgePill\"\n :dot-indicator=\"props.badgeDotIndicator || badgeImplicitlyDot\"\n :variant=\"props.badgeVariant\"\n :bg-variant=\"props.badgeBgVariant\"\n :text-variant=\"props.badgeTextVariant\"\n :style=\"badgeStyle\"\n :placement=\"props.badgePlacement\"\n >\n <slot name=\"badge\">\n {{ badgeText }}\n </slot>\n </BBadge>\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {avatarGroupInjectionKey} from '../../utils/keys'\nimport {computed, type CSSProperties, inject, ref, type StyleValue, watch} from 'vue'\nimport type {BAvatarProps} from '../../types/ComponentProps'\nimport BLink from '../BLink/BLink.vue'\nimport BBadge from '../BBadge/BBadge.vue'\nimport {useBLinkHelper} from '../../composables/useBLinkHelper'\nimport {isEmptySlot} from '../../utils/dom'\nimport {useNumberishToStyle} from '../../composables/useNumberishToStyle'\nimport {useRadiusElementClasses} from '../../composables/useRadiusElementClasses'\nimport {useColorVariantClasses} from '../../composables/useColorVariantClasses'\nimport type {BAvatarEmits, BAvatarSlots, Size} from '../../types'\nimport {useDefaults} from '../../composables/useDefaults'\n\nconst _props = withDefaults(defineProps<BAvatarProps>(), {\n alt: 'avatar',\n badge: false,\n badgeBgVariant: null,\n badgeTextVariant: null,\n badgeVariant: 'primary',\n badgePlacement: 'bottom-end',\n badgeDotIndicator: false,\n badgePill: false,\n button: false,\n buttonType: 'button',\n size: undefined,\n square: false,\n src: undefined,\n text: undefined,\n // Link props\n variant: 'secondary',\n // All others use defaults\n active: undefined,\n activeClass: undefined,\n disabled: undefined,\n exactActiveClass: undefined,\n href: undefined,\n opacity: undefined,\n opacityHover: undefined,\n rel: undefined,\n replace: undefined,\n stretched: false,\n routerComponentName: undefined,\n target: undefined,\n underlineOffset: undefined,\n underlineOffsetHover: undefined,\n underlineOpacity: undefined,\n underlineOpacityHover: undefined,\n underlineVariant: undefined,\n // End link props\n // ColorExtendables props\n // Variant is here as well\n bgVariant: null,\n textVariant: null,\n // End ColorExtendables props\n // RadiusElementExtendables props\n rounded: 'circle',\n roundedBottom: undefined,\n roundedEnd: undefined,\n roundedStart: undefined,\n roundedTop: undefined,\n // End RadiusElementExtendables props\n})\nconst props = useDefaults(_props, 'BAvatar')\nconst emit = defineEmits<BAvatarEmits>()\nconst slots = defineSlots<BAvatarSlots>()\n\nconst localSrc = ref(props.src)\nwatch(\n () => props.src,\n (value) => {\n localSrc.value = value\n }\n)\n\nconst {computedLink, computedLinkProps} = useBLinkHelper(props)\n\nconst parentData = inject(avatarGroupInjectionKey, null)\n\nconst SIZES = Object.freeze([\n null,\n ...Object.keys({\n lg: null,\n md: null,\n sm: null,\n } satisfies Record<Size, null>),\n] as (string | null)[])\nconst FONT_SIZE_SCALE = 0.4\nconst BADGE_FONT_SIZE_SCALE = FONT_SIZE_SCALE * 0.7\n\nconst hasDefaultSlot = computed(() => !isEmptySlot(slots.default))\nconst hasBadgeSlot = computed(() => !isEmptySlot(slots.badge))\n\nconst showBadge = computed(() => !!props.badge || props.badge === '' || hasBadgeSlot.value)\nconst computedSquare = computed(() => parentData?.square.value || props.square)\n\n// const computedPropSize = useNumberishToStyle(() => props.size)\n// const propSizeIsLiteralSize = (val: unknown): val is Size =>\n// !!val && typeof val === 'string' && SIZES.includes(val)\n// const computedParentSize = useNumberishToStyle(() => parentData?.size.value)\n// const computedSize = computed(() => computedParentSize.value ?? computedPropSize.value)\n// const computedPropSizeIsLiteralSize = computed(() => propSizeIsLiteralSize(computedSize.value))\n\nconst computedSize = useNumberishToStyle(() => parentData?.size.value ?? props.size)\nconst computedSizeIsLiteralSize = computed(\n () => !!computedSize.value && SIZES.includes(computedSize.value)\n)\n\nconst computedVariant = computed(() => parentData?.variant.value ?? props.variant)\nconst computedRounded = computed(() => parentData?.rounded.value ?? props.rounded)\nconst computedRoundedTop = computed(() => parentData?.roundedTop.value ?? props.roundedTop)\nconst computedRoundedBottom = computed(() => parentData?.roundedBottom.value ?? props.roundedBottom)\nconst computedRoundedStart = computed(() => parentData?.roundedStart.value ?? props.roundedStart)\nconst computedRoundedEnd = computed(() => parentData?.roundedEnd.value ?? props.roundedEnd)\n\nconst radiusElementClasses = useRadiusElementClasses(() => ({\n rounded: computedRounded.value,\n roundedTop: computedRoundedTop.value,\n roundedBottom: computedRoundedBottom.value,\n roundedStart: computedRoundedStart.value,\n roundedEnd: computedRoundedEnd.value,\n}))\n\nconst badgeText = computed(() => (props.badge === true ? '' : props.badge))\nconst badgeImplicitlyDot = computed(() => !badgeText.value && !hasBadgeSlot.value)\n\nconst colorClasses = useColorVariantClasses(() => ({\n bgVariant: parentData?.bgVariant.value ?? props.bgVariant,\n textVariant: parentData?.textVariant.value ?? props.textVariant,\n variant: computedVariant.value,\n}))\nconst computedClasses = computed(() => [\n colorClasses.value,\n // Square overwrites all else\n computedSquare.value === true ? undefined : radiusElementClasses.value,\n {\n [`b-avatar-${computedSize.value}`]:\n computedSizeIsLiteralSize.value && computedSize.value !== 'md',\n [`btn-${computedVariant.value}`]: props.button ? computedVariant.value !== null : false,\n 'badge': !props.button && computedVariant.value !== null && hasDefaultSlot.value,\n 'btn': props.button,\n // Square is the same as rounded-0 class\n 'rounded-0': computedSquare.value === true,\n },\n])\n\nconst badgeStyle = computed<StyleValue>(() => ({\n fontSize:\n (!computedSizeIsLiteralSize.value\n ? `calc(${computedSize.value} * ${BADGE_FONT_SIZE_SCALE})`\n : '') || '',\n}))\n\nconst textFontStyle = computed<StyleValue>(() => {\n const fontSize = !computedSizeIsLiteralSize.value\n ? `calc(${computedSize.value} * ${FONT_SIZE_SCALE})`\n : null\n return fontSize ? {fontSize} : {}\n})\n\nconst marginStyle = computed(() => {\n const overlapScale = parentData?.overlapScale?.value || 0\n\n const value =\n computedSize.value && overlapScale ? `calc(${computedSize.value} * -${overlapScale})` : null\n return value ? {marginLeft: value, marginRight: value} : {}\n})\n\nconst computedTag = computed(() => (computedLink.value ? BLink : props.button ? 'button' : 'span'))\n\nconst computedStyle = computed<CSSProperties>(() => ({\n ...marginStyle.value,\n ...(!computedSizeIsLiteralSize.value\n ? {\n width: computedSize.value,\n height: computedSize.value,\n }\n : undefined),\n}))\n\nconst clicked = (e: Readonly<MouseEvent>): void => {\n if (!props.disabled && (computedLink.value || props.button)) emit('click', e)\n}\n\nconst onImgError = (e: Readonly<Event>) => {\n localSrc.value = undefined\n emit('img-error', e)\n}\n</script>\n","<template>\n <component :is=\"props.tag\" class=\"b-avatar-group\" role=\"group\">\n <div class=\"b-avatar-group-inner\" :style=\"paddingStyle\">\n <slot />\n </div>\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, provide, type StyleValue, toRef} from 'vue'\nimport type {BAvatarGroupProps} from '../../types/ComponentProps'\nimport {avatarGroupInjectionKey} from '../../utils/keys'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useToNumber} from '@vueuse/core'\nimport {useNumberishToStyle} from '../../composables/useNumberishToStyle'\nimport type {BAvatarGroupSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<BAvatarGroupProps>(), {\n overlap: 0.3,\n size: undefined,\n square: false,\n tag: 'div',\n // RadiusElementExtendables props\n rounded: 'circle',\n roundedBottom: undefined,\n roundedEnd: undefined,\n roundedStart: undefined,\n roundedTop: undefined,\n // End RadiusElementExtendables props\n // ColorExtendables props\n bgVariant: null,\n textVariant: null,\n variant: null,\n // End ColorExtendables props\n})\nconst props = useDefaults(_props, 'BAvatarGroup')\ndefineSlots<BAvatarGroupSlots>()\n\nconst overlapNumber = useToNumber(() => props.overlap)\n\nconst computedSize = useNumberishToStyle(() => props.size)\nconst overlapScale = computed(() => Math.min(Math.max(overlapNumber.value, 0), 1) / 2)\n\nconst paddingStyle = computed<StyleValue>(() => {\n const value = computedSize.value ? `calc(${computedSize.value} * ${overlapScale.value})` : null\n return value ? {paddingLeft: value, paddingRight: value} : {}\n})\n\nprovide(avatarGroupInjectionKey, {\n overlapScale,\n size: toRef(() => props.size),\n square: toRef(() => props.square),\n rounded: toRef(() => props.rounded),\n roundedTop: toRef(() => props.roundedTop),\n roundedBottom: toRef(() => props.roundedBottom),\n roundedStart: toRef(() => props.roundedStart),\n roundedEnd: toRef(() => props.roundedEnd),\n variant: toRef(() => props.variant),\n bgVariant: toRef(() => props.bgVariant),\n textVariant: toRef(() => props.textVariant),\n})\n</script>\n","<template>\n <component :is=\"props.tag\" class=\"b-avatar-group\" role=\"group\">\n <div class=\"b-avatar-group-inner\" :style=\"paddingStyle\">\n <slot />\n </div>\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, provide, type StyleValue, toRef} from 'vue'\nimport type {BAvatarGroupProps} from '../../types/ComponentProps'\nimport {avatarGroupInjectionKey} from '../../utils/keys'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useToNumber} from '@vueuse/core'\nimport {useNumberishToStyle} from '../../composables/useNumberishToStyle'\nimport type {BAvatarGroupSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<BAvatarGroupProps>(), {\n overlap: 0.3,\n size: undefined,\n square: false,\n tag: 'div',\n // RadiusElementExtendables props\n rounded: 'circle',\n roundedBottom: undefined,\n roundedEnd: undefined,\n roundedStart: undefined,\n roundedTop: undefined,\n // End RadiusElementExtendables props\n // ColorExtendables props\n bgVariant: null,\n textVariant: null,\n variant: null,\n // End ColorExtendables props\n})\nconst props = useDefaults(_props, 'BAvatarGroup')\ndefineSlots<BAvatarGroupSlots>()\n\nconst overlapNumber = useToNumber(() => props.overlap)\n\nconst computedSize = useNumberishToStyle(() => props.size)\nconst overlapScale = computed(() => Math.min(Math.max(overlapNumber.value, 0), 1) / 2)\n\nconst paddingStyle = computed<StyleValue>(() => {\n const value = computedSize.value ? `calc(${computedSize.value} * ${overlapScale.value})` : null\n return value ? {paddingLeft: value, paddingRight: value} : {}\n})\n\nprovide(avatarGroupInjectionKey, {\n overlapScale,\n size: toRef(() => props.size),\n square: toRef(() => props.square),\n rounded: toRef(() => props.rounded),\n roundedTop: toRef(() => props.roundedTop),\n roundedBottom: toRef(() => props.roundedBottom),\n roundedStart: toRef(() => props.roundedStart),\n roundedEnd: toRef(() => props.roundedEnd),\n variant: toRef(() => props.variant),\n bgVariant: toRef(() => props.bgVariant),\n textVariant: toRef(() => props.textVariant),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyIA,IAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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],"sourcesContent":["<template>\n <component\n :is=\"computedTag\"\n ref=\"_element\"\n class=\"btn\"\n v-bind=\"linkProps\"\n :class=\"computedClasses\"\n :aria-disabled=\"computedAriaDisabled\"\n :aria-pressed=\"isToggle ? pressedValue : null\"\n :autocomplete=\"isToggle ? 'off' : null\"\n :disabled=\"isButton ? props.disabled : null\"\n :href=\"props.href\"\n :rel=\"computedLink ? props.rel : null\"\n :role=\"nonStandardTag || computedLink ? 'button' : null\"\n :target=\"computedLink ? props.target : null\"\n :type=\"isButton ? props.type : null\"\n :to=\"!isButton ? props.to : null\"\n @click=\"clicked\"\n >\n <slot v-if=\"props.loading\" name=\"loading\">\n <template v-if=\"!props.loadingFill\">\n {{ props.loadingText }}\n </template>\n <slot name=\"loading-spinner\">\n <BSpinner\n :small=\"props.size !== 'lg'\"\n :label=\"props.loadingFill ? props.loadingText : undefined\"\n />\n </slot>\n </slot>\n <slot v-else />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, useTemplateRef} from 'vue'\nimport BSpinner from '../BSpinner/BSpinner.vue'\nimport {useBLinkHelper} from '../../composables/useBLinkHelper'\nimport BLink from '../BLink/BLink.vue'\nimport {useLinkClasses} from '../../composables/useLinkClasses'\nimport {onKeyStroke} from '@vueuse/core'\nimport type {BButtonProps} from '../../types/ComponentProps'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {ColorVariant} from '../../types/ColorTypes'\nimport {type BButtonEmits, type BButtonSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<Omit<BButtonProps, 'pressed'>>(), {\n loading: false,\n loadingFill: false,\n loadingText: 'Loading...',\n pill: false,\n size: 'md',\n squared: false,\n tag: 'button',\n type: 'button',\n // Link props\n active: false, // Why is this active: false?\n variant: 'secondary',\n // All others use defaults\n activeClass: undefined,\n disabled: undefined,\n exactActiveClass: undefined,\n stretched: false,\n href: undefined,\n icon: false,\n opacity: undefined,\n opacityHover: undefined,\n rel: undefined,\n replace: undefined,\n routerComponentName: undefined,\n routerTag: undefined,\n target: undefined,\n to: undefined,\n underlineOffset: undefined,\n underlineOffsetHover: undefined,\n underlineOpacity: undefined,\n underlineOpacityHover: undefined,\n underlineVariant: null,\n // End link props\n})\nconst props = useDefaults(_props, 'BButton')\nconst emit = defineEmits<BButtonEmits>()\ndefineSlots<BButtonSlots>()\n\nconst element = useTemplateRef<HTMLButtonElement | null>('_element')\n\nconst pressedValue = defineModel<BButtonProps['pressed']>('pressed', {default: undefined})\n\nconst {computedLink, computedLinkProps} = useBLinkHelper(props, [\n 'activeClass',\n 'exactActiveClass',\n 'replace',\n 'routerComponentName',\n 'routerTag',\n 'noPrefetch',\n 'prefetch',\n 'prefetchOn',\n 'prefetchedClass',\n])\n\nconst isToggle = computed(() => typeof pressedValue.value === 'boolean')\nconst isButton = computed(\n () => props.tag === 'button' && props.href === undefined && props.to === undefined\n)\nconst isBLink = computed(() => props.to !== undefined)\nconst nonStandardTag = computed(() => (props.href !== undefined ? false : !isButton.value))\n\nconst linkProps = computed(() => (isBLink.value ? computedLinkProps.value : []))\nconst computedAriaDisabled = computed(() => {\n if (props.href === '#' && props.disabled) return true\n\n return nonStandardTag.value ? props.disabled : null\n})\n\nconst variantIsLinkType = computed(() => props.variant?.startsWith('link') || false)\nconst variantIsLinkTypeSubset = computed(() => props.variant?.startsWith('link-') || false)\nconst linkValueClasses = useLinkClasses(\n computed(() => ({\n ...(variantIsLinkType.value\n ? {\n icon: props.icon,\n opacity: props.opacity,\n opacityHover: props.opacityHover,\n underlineOffset: props.underlineOffset,\n underlineOffsetHover: props.underlineOffsetHover,\n underlineOpacity: props.underlineOpacity,\n underlineOpacityHover: props.underlineOpacityHover,\n underlineVariant: props.underlineVariant,\n variant:\n variantIsLinkTypeSubset.value === true\n ? (props.variant?.slice(5) as ColorVariant)\n : null,\n }\n : undefined),\n }))\n)\nconst computedClasses = computed(() => [\n variantIsLinkType.value === true && computedLink.value === false\n ? linkValueClasses.value\n : undefined,\n [`btn-${props.size}`],\n {\n [`btn-${props.variant}`]: props.variant !== null && variantIsLinkTypeSubset.value === false,\n 'active': props.active || pressedValue.value,\n 'rounded-pill': props.pill,\n 'rounded-0': props.squared,\n 'disabled': props.disabled,\n },\n])\n\nconst computedTag = computed(() => (isBLink.value ? BLink : props.href ? 'a' : props.tag))\n\nconst clicked = (e: Readonly<MouseEvent>): void => {\n if (props.disabled) {\n e.preventDefault()\n e.stopPropagation()\n return\n }\n emit('click', e)\n if (isToggle.value) pressedValue.value = !pressedValue.value\n}\n\nonKeyStroke(\n [' ', 'enter'],\n (e) => {\n if (props.href === '#') {\n e.preventDefault()\n element.value?.click()\n }\n },\n {target: element}\n)\n</script>\n","<template>\n <component\n :is=\"computedTag\"\n ref=\"_element\"\n class=\"btn\"\n v-bind=\"linkProps\"\n :class=\"computedClasses\"\n :aria-disabled=\"computedAriaDisabled\"\n :aria-pressed=\"isToggle ? pressedValue : null\"\n :autocomplete=\"isToggle ? 'off' : null\"\n :disabled=\"isButton ? props.disabled : null\"\n :href=\"props.href\"\n :rel=\"computedLink ? props.rel : null\"\n :role=\"nonStandardTag || computedLink ? 'button' : null\"\n :target=\"computedLink ? props.target : null\"\n :type=\"isButton ? props.type : null\"\n :to=\"!isButton ? props.to : null\"\n @click=\"clicked\"\n >\n <slot v-if=\"props.loading\" name=\"loading\">\n <template v-if=\"!props.loadingFill\">\n {{ props.loadingText }}\n </template>\n <slot name=\"loading-spinner\">\n <BSpinner\n :small=\"props.size !== 'lg'\"\n :label=\"props.loadingFill ? props.loadingText : undefined\"\n />\n </slot>\n </slot>\n <slot v-else />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, useTemplateRef} from 'vue'\nimport BSpinner from '../BSpinner/BSpinner.vue'\nimport {useBLinkHelper} from '../../composables/useBLinkHelper'\nimport BLink from '../BLink/BLink.vue'\nimport {useLinkClasses} from '../../composables/useLinkClasses'\nimport {onKeyStroke} from '@vueuse/core'\nimport type {BButtonProps} from '../../types/ComponentProps'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {ColorVariant} from '../../types/ColorTypes'\nimport {type BButtonEmits, type BButtonSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<Omit<BButtonProps, 'pressed'>>(), {\n loading: false,\n loadingFill: false,\n loadingText: 'Loading...',\n pill: false,\n size: 'md',\n squared: false,\n tag: 'button',\n type: 'button',\n // Link props\n active: false, // Why is this active: false?\n variant: 'secondary',\n // All others use defaults\n activeClass: undefined,\n disabled: undefined,\n exactActiveClass: undefined,\n stretched: false,\n href: undefined,\n icon: false,\n opacity: undefined,\n opacityHover: undefined,\n rel: undefined,\n replace: undefined,\n routerComponentName: undefined,\n routerTag: undefined,\n target: undefined,\n to: undefined,\n underlineOffset: undefined,\n underlineOffsetHover: undefined,\n underlineOpacity: undefined,\n underlineOpacityHover: undefined,\n underlineVariant: null,\n // End link props\n})\nconst props = useDefaults(_props, 'BButton')\nconst emit = defineEmits<BButtonEmits>()\ndefineSlots<BButtonSlots>()\n\nconst element = useTemplateRef<HTMLButtonElement | null>('_element')\n\nconst pressedValue = defineModel<BButtonProps['pressed']>('pressed', {default: undefined})\n\nconst {computedLink, computedLinkProps} = useBLinkHelper(props, [\n 'activeClass',\n 'exactActiveClass',\n 'replace',\n 'routerComponentName',\n 'routerTag',\n 'noPrefetch',\n 'prefetch',\n 'prefetchOn',\n 'prefetchedClass',\n])\n\nconst isToggle = computed(() => typeof pressedValue.value === 'boolean')\nconst isButton = computed(\n () => props.tag === 'button' && props.href === undefined && props.to === undefined\n)\nconst isBLink = computed(() => props.to !== undefined)\nconst nonStandardTag = computed(() => (props.href !== undefined ? false : !isButton.value))\n\nconst linkProps = computed(() => (isBLink.value ? computedLinkProps.value : []))\nconst computedAriaDisabled = computed(() => {\n if (props.href === '#' && props.disabled) return true\n\n return nonStandardTag.value ? props.disabled : null\n})\n\nconst variantIsLinkType = computed(() => props.variant?.startsWith('link') || false)\nconst variantIsLinkTypeSubset = computed(() => props.variant?.startsWith('link-') || false)\nconst linkValueClasses = useLinkClasses(\n computed(() => ({\n ...(variantIsLinkType.value\n ? {\n icon: props.icon,\n opacity: props.opacity,\n opacityHover: props.opacityHover,\n underlineOffset: props.underlineOffset,\n underlineOffsetHover: props.underlineOffsetHover,\n underlineOpacity: props.underlineOpacity,\n underlineOpacityHover: props.underlineOpacityHover,\n underlineVariant: props.underlineVariant,\n variant:\n variantIsLinkTypeSubset.value === true\n ? (props.variant?.slice(5) as ColorVariant)\n : null,\n }\n : undefined),\n }))\n)\nconst computedClasses = computed(() => [\n variantIsLinkType.value === true && computedLink.value === false\n ? linkValueClasses.value\n : undefined,\n [`btn-${props.size}`],\n {\n [`btn-${props.variant}`]: props.variant !== null && variantIsLinkTypeSubset.value === false,\n 'active': props.active || pressedValue.value,\n 'rounded-pill': props.pill,\n 'rounded-0': props.squared,\n 'disabled': props.disabled,\n },\n])\n\nconst computedTag = computed(() => (isBLink.value ? BLink : props.href ? 'a' : props.tag))\n\nconst clicked = (e: Readonly<MouseEvent>): void => {\n if (props.disabled) {\n e.preventDefault()\n e.stopPropagation()\n return\n }\n emit('click', e)\n if (isToggle.value) pressedValue.value = !pressedValue.value\n}\n\nonKeyStroke(\n [' ', 'enter'],\n (e) => {\n if (props.href === '#') {\n e.preventDefault()\n element.value?.click()\n }\n },\n {target: element}\n)\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgFA,MAAM,QAAQ,YAlCC,SAkCmB,UAAS;EAC3C,MAAM,OAAO;EAGb,MAAM,UAAU,eAAyC,WAAU;EAEnE,MAAM,eAAe,SAAoC,SAAC,UAA+B;EAEzF,MAAM,EAAC,cAAc,sBAAqB,eAAe,OAAO;GAC9D;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAAA;EAED,MAAM,WAAW,eAAe,OAAO,aAAa,UAAU,UAAS;EACvE,MAAM,WAAW,eACT,MAAM,QAAQ,YAAY,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Ac,KAAA;0CAItD,WAAe,KAAA,QAAA,WAAA,EAAA,KAAA,GAAA,CAAA,CAAA,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BButton-DBRs8Pz_.js","names":[],"sources":["../src/components/BButton/BButton.vue","../src/components/BButton/BButton.vue"],"sourcesContent":["<template>\n <component\n :is=\"computedTag\"\n ref=\"_element\"\n class=\"btn\"\n v-bind=\"linkProps\"\n :class=\"computedClasses\"\n :aria-disabled=\"computedAriaDisabled\"\n :aria-pressed=\"isToggle ? pressedValue : null\"\n :autocomplete=\"isToggle ? 'off' : null\"\n :disabled=\"isButton ? props.disabled : null\"\n :href=\"props.href\"\n :rel=\"computedLink ? props.rel : null\"\n :role=\"nonStandardTag || computedLink ? 'button' : null\"\n :target=\"computedLink ? props.target : null\"\n :type=\"isButton ? props.type : null\"\n :to=\"!isButton ? props.to : null\"\n @click=\"clicked\"\n >\n <slot v-if=\"props.loading\" name=\"loading\">\n <template v-if=\"!props.loadingFill\">\n {{ props.loadingText }}\n </template>\n <slot name=\"loading-spinner\">\n <BSpinner\n :small=\"props.size !== 'lg'\"\n :label=\"props.loadingFill ? props.loadingText : undefined\"\n />\n </slot>\n </slot>\n <slot v-else />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, useTemplateRef} from 'vue'\nimport BSpinner from '../BSpinner/BSpinner.vue'\nimport {useBLinkHelper} from '../../composables/useBLinkHelper'\nimport BLink from '../BLink/BLink.vue'\nimport {useLinkClasses} from '../../composables/useLinkClasses'\nimport {onKeyStroke} from '@vueuse/core'\nimport type {BButtonProps} from '../../types/ComponentProps'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {ColorVariant} from '../../types/ColorTypes'\nimport {type BButtonEmits, type BButtonSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<Omit<BButtonProps, 'pressed'>>(), {\n loading: false,\n loadingFill: false,\n loadingText: 'Loading...',\n pill: false,\n size: 'md',\n squared: false,\n tag: 'button',\n type: 'button',\n // Link props\n active: false, // Why is this active: false?\n variant: 'secondary',\n // All others use defaults\n activeClass: undefined,\n disabled: undefined,\n exactActiveClass: undefined,\n stretched: false,\n href: undefined,\n icon: false,\n opacity: undefined,\n opacityHover: undefined,\n rel: undefined,\n replace: undefined,\n routerComponentName: undefined,\n routerTag: undefined,\n target: undefined,\n to: undefined,\n underlineOffset: undefined,\n underlineOffsetHover: undefined,\n underlineOpacity: undefined,\n underlineOpacityHover: undefined,\n underlineVariant: null,\n // End link props\n})\nconst props = useDefaults(_props, 'BButton')\nconst emit = defineEmits<BButtonEmits>()\ndefineSlots<BButtonSlots>()\n\nconst element = useTemplateRef<HTMLButtonElement | null>('_element')\n\nconst pressedValue = defineModel<BButtonProps['pressed']>('pressed', {default: undefined})\n\nconst {computedLink, computedLinkProps} = useBLinkHelper(props, [\n 'activeClass',\n 'exactActiveClass',\n 'replace',\n 'routerComponentName',\n 'routerTag',\n 'noPrefetch',\n 'prefetch',\n 'prefetchOn',\n 'prefetchedClass',\n])\n\nconst isToggle = computed(() => typeof pressedValue.value === 'boolean')\nconst isButton = computed(\n () => props.tag === 'button' && props.href === undefined && props.to === undefined\n)\nconst isBLink = computed(() => props.to !== undefined)\nconst nonStandardTag = computed(() => (props.href !== undefined ? false : !isButton.value))\n\nconst linkProps = computed(() => (isBLink.value ? computedLinkProps.value : []))\nconst computedAriaDisabled = computed(() => {\n if (props.href === '#' && props.disabled) return true\n\n return nonStandardTag.value ? props.disabled : null\n})\n\nconst variantIsLinkType = computed(() => props.variant?.startsWith('link') || false)\nconst variantIsLinkTypeSubset = computed(() => props.variant?.startsWith('link-') || false)\nconst linkValueClasses = useLinkClasses(\n computed(() => ({\n ...(variantIsLinkType.value\n ? {\n icon: props.icon,\n opacity: props.opacity,\n opacityHover: props.opacityHover,\n underlineOffset: props.underlineOffset,\n underlineOffsetHover: props.underlineOffsetHover,\n underlineOpacity: props.underlineOpacity,\n underlineOpacityHover: props.underlineOpacityHover,\n underlineVariant: props.underlineVariant,\n variant:\n variantIsLinkTypeSubset.value === true\n ? (props.variant?.slice(5) as ColorVariant)\n : null,\n }\n : undefined),\n }))\n)\nconst computedClasses = computed(() => [\n variantIsLinkType.value === true && computedLink.value === false\n ? linkValueClasses.value\n : undefined,\n [`btn-${props.size}`],\n {\n [`btn-${props.variant}`]: props.variant !== null && variantIsLinkTypeSubset.value === false,\n 'active': props.active || pressedValue.value,\n 'rounded-pill': props.pill,\n 'rounded-0': props.squared,\n 'disabled': props.disabled,\n },\n])\n\nconst computedTag = computed(() => (isBLink.value ? BLink : props.href ? 'a' : props.tag))\n\nconst clicked = (e: Readonly<MouseEvent>): void => {\n if (props.disabled) {\n e.preventDefault()\n e.stopPropagation()\n return\n }\n emit('click', e)\n if (isToggle.value) pressedValue.value = !pressedValue.value\n}\n\nonKeyStroke(\n [' ', 'enter'],\n (e) => {\n if (props.href === '#') {\n e.preventDefault()\n element.value?.click()\n }\n },\n {target: element}\n)\n</script>\n","<template>\n <component\n :is=\"computedTag\"\n ref=\"_element\"\n class=\"btn\"\n v-bind=\"linkProps\"\n :class=\"computedClasses\"\n :aria-disabled=\"computedAriaDisabled\"\n :aria-pressed=\"isToggle ? pressedValue : null\"\n :autocomplete=\"isToggle ? 'off' : null\"\n :disabled=\"isButton ? props.disabled : null\"\n :href=\"props.href\"\n :rel=\"computedLink ? props.rel : null\"\n :role=\"nonStandardTag || computedLink ? 'button' : null\"\n :target=\"computedLink ? props.target : null\"\n :type=\"isButton ? props.type : null\"\n :to=\"!isButton ? props.to : null\"\n @click=\"clicked\"\n >\n <slot v-if=\"props.loading\" name=\"loading\">\n <template v-if=\"!props.loadingFill\">\n {{ props.loadingText }}\n </template>\n <slot name=\"loading-spinner\">\n <BSpinner\n :small=\"props.size !== 'lg'\"\n :label=\"props.loadingFill ? props.loadingText : undefined\"\n />\n </slot>\n </slot>\n <slot v-else />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, useTemplateRef} from 'vue'\nimport BSpinner from '../BSpinner/BSpinner.vue'\nimport {useBLinkHelper} from '../../composables/useBLinkHelper'\nimport BLink from '../BLink/BLink.vue'\nimport {useLinkClasses} from '../../composables/useLinkClasses'\nimport {onKeyStroke} from '@vueuse/core'\nimport type {BButtonProps} from '../../types/ComponentProps'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {ColorVariant} from '../../types/ColorTypes'\nimport {type BButtonEmits, type BButtonSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<Omit<BButtonProps, 'pressed'>>(), {\n loading: false,\n loadingFill: false,\n loadingText: 'Loading...',\n pill: false,\n size: 'md',\n squared: false,\n tag: 'button',\n type: 'button',\n // Link props\n active: false, // Why is this active: false?\n variant: 'secondary',\n // All others use defaults\n activeClass: undefined,\n disabled: undefined,\n exactActiveClass: undefined,\n stretched: false,\n href: undefined,\n icon: false,\n opacity: undefined,\n opacityHover: undefined,\n rel: undefined,\n replace: undefined,\n routerComponentName: undefined,\n routerTag: undefined,\n target: undefined,\n to: undefined,\n underlineOffset: undefined,\n underlineOffsetHover: undefined,\n underlineOpacity: undefined,\n underlineOpacityHover: undefined,\n underlineVariant: null,\n // End link props\n})\nconst props = useDefaults(_props, 'BButton')\nconst emit = defineEmits<BButtonEmits>()\ndefineSlots<BButtonSlots>()\n\nconst element = useTemplateRef<HTMLButtonElement | null>('_element')\n\nconst pressedValue = defineModel<BButtonProps['pressed']>('pressed', {default: undefined})\n\nconst {computedLink, computedLinkProps} = useBLinkHelper(props, [\n 'activeClass',\n 'exactActiveClass',\n 'replace',\n 'routerComponentName',\n 'routerTag',\n 'noPrefetch',\n 'prefetch',\n 'prefetchOn',\n 'prefetchedClass',\n])\n\nconst isToggle = computed(() => typeof pressedValue.value === 'boolean')\nconst isButton = computed(\n () => props.tag === 'button' && props.href === undefined && props.to === undefined\n)\nconst isBLink = computed(() => props.to !== undefined)\nconst nonStandardTag = computed(() => (props.href !== undefined ? false : !isButton.value))\n\nconst linkProps = computed(() => (isBLink.value ? computedLinkProps.value : []))\nconst computedAriaDisabled = computed(() => {\n if (props.href === '#' && props.disabled) return true\n\n return nonStandardTag.value ? props.disabled : null\n})\n\nconst variantIsLinkType = computed(() => props.variant?.startsWith('link') || false)\nconst variantIsLinkTypeSubset = computed(() => props.variant?.startsWith('link-') || false)\nconst linkValueClasses = useLinkClasses(\n computed(() => ({\n ...(variantIsLinkType.value\n ? {\n icon: props.icon,\n opacity: props.opacity,\n opacityHover: props.opacityHover,\n underlineOffset: props.underlineOffset,\n underlineOffsetHover: props.underlineOffsetHover,\n underlineOpacity: props.underlineOpacity,\n underlineOpacityHover: props.underlineOpacityHover,\n underlineVariant: props.underlineVariant,\n variant:\n variantIsLinkTypeSubset.value === true\n ? (props.variant?.slice(5) as ColorVariant)\n : null,\n }\n : undefined),\n }))\n)\nconst computedClasses = computed(() => [\n variantIsLinkType.value === true && computedLink.value === false\n ? linkValueClasses.value\n : undefined,\n [`btn-${props.size}`],\n {\n [`btn-${props.variant}`]: props.variant !== null && variantIsLinkTypeSubset.value === false,\n 'active': props.active || pressedValue.value,\n 'rounded-pill': props.pill,\n 'rounded-0': props.squared,\n 'disabled': props.disabled,\n },\n])\n\nconst computedTag = computed(() => (isBLink.value ? BLink : props.href ? 'a' : props.tag))\n\nconst clicked = (e: Readonly<MouseEvent>): void => {\n if (props.disabled) {\n e.preventDefault()\n e.stopPropagation()\n return\n }\n emit('click', e)\n if (isToggle.value) pressedValue.value = !pressedValue.value\n}\n\nonKeyStroke(\n [' ', 'enter'],\n (e) => {\n if (props.href === '#') {\n e.preventDefault()\n element.value?.click()\n }\n },\n {target: element}\n)\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgFA,MAAM,QAAQ,oBAAA,YAlCC,SAkCmB,UAAS;EAC3C,MAAM,OAAO;EAGb,MAAM,WAAA,GAAA,IAAA,gBAAmD,WAAU;EAEnE,MAAM,gBAAA,GAAA,IA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SAAA,SAAA,GAAA,IAAA,OAAW,MAAK,CAAC,KAAE;IACxB,SAAO;;oCAYD,EAAA,GAAA,IAAA,OAVK,MAAK,CAAC,WAAA,GAAA,IAAA,YAUX,KAAA,QAAA,WAAA,EAAA,KAAA,GAAA,QAAA,CAAA,EAAA,GAAA,IAAA,OATY,MAAK,CAAC,gBAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAEZ,IAAA,UAAA,EAAA,KAAA,GAAA,EAAA,EAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,OADN,MAAK,CAAC,YAAW,EAAA,EAAA,CAAA,EAAA,GAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA,GAAA,GAAA,IAAA,YAOf,KAAA,QAAA,mBAAA,EAAA,QAAA,EAAA,GAAA,IAAA,aADH,iBAAA,kBAAA;KAFC,QAAA,GAAA,IAAA,OAAO,MAAK,CAAC,SAAI;KACjB,QAAA,GAAA,IAAA,OAAO,MAAK,CAAC,eAAA,GAAA,IAAA,OAAc,MAAK,CAAC,cAAc,KAAA;8DAIvC,KAAA,QAAA,WAAA,EAAA,KAAA,GAAA,CAAA,CAAA,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BButton-DNmtqoqR.mjs","names":[],"sources":["../src/components/BButton/BButtonGroup.vue","../src/components/BButton/BButtonGroup.vue","../src/components/BButton/BButtonToolbar.vue","../src/components/BButton/BButtonToolbar.vue"],"sourcesContent":["<template>\n <component :is=\"props.tag\" :class=\"computedClasses\" role=\"group\" :aria-label=\"props.ariaLabel\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BButtonGroupProps} from '../../types/ComponentProps'\nimport {computed, provide} from 'vue'\nimport {buttonGroupKey} from '../../utils/keys'\nimport type {BButtonGroupSlots} from '../../types'\n\nprovide(buttonGroupKey, true)\n\nconst _props = withDefaults(defineProps<BButtonGroupProps>(), {\n ariaLabel: 'Group',\n size: 'md',\n tag: 'div',\n vertical: false,\n})\nconst props = useDefaults(_props, 'BButtonGroup')\ndefineSlots<BButtonGroupSlots>()\n\nconst computedClasses = computed(() => ({\n 'btn-group': !props.vertical,\n [`btn-group-${props.size}`]: props.size !== 'md',\n 'btn-group-vertical': props.vertical,\n}))\n</script>\n","<template>\n <component :is=\"props.tag\" :class=\"computedClasses\" role=\"group\" :aria-label=\"props.ariaLabel\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BButtonGroupProps} from '../../types/ComponentProps'\nimport {computed, provide} from 'vue'\nimport {buttonGroupKey} from '../../utils/keys'\nimport type {BButtonGroupSlots} from '../../types'\n\nprovide(buttonGroupKey, true)\n\nconst _props = withDefaults(defineProps<BButtonGroupProps>(), {\n ariaLabel: 'Group',\n size: 'md',\n tag: 'div',\n vertical: false,\n})\nconst props = useDefaults(_props, 'BButtonGroup')\ndefineSlots<BButtonGroupSlots>()\n\nconst computedClasses = computed(() => ({\n 'btn-group': !props.vertical,\n [`btn-group-${props.size}`]: props.size !== 'md',\n 'btn-group-vertical': props.vertical,\n}))\n</script>\n","<template>\n <div\n ref=\"toolbarRef\"\n :class=\"computedClasses\"\n class=\"btn-toolbar\"\n :role=\"props.role\"\n :aria-label=\"props.ariaLabel\"\n @keydown=\"handleKeyNav\"\n >\n <slot />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport type {BButtonToolbarSlots, BButtonToolbarProps} from '../../types'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {computed, nextTick, useTemplateRef} from 'vue'\nimport {CODE_DOWN, CODE_END, CODE_HOME, CODE_LEFT, CODE_RIGHT, CODE_UP} from '../../utils/constants'\nimport {getActiveElement, getSafeWindow} from '../../utils/dom'\n\nconst _props = withDefaults(defineProps<BButtonToolbarProps>(), {\n ariaLabel: 'Group',\n justify: false,\n keyNav: false,\n role: 'toolbar',\n})\nconst props = useDefaults(_props, 'BButtonToolbar')\ndefineSlots<BButtonToolbarSlots>()\n\nconst toolbarRef = useTemplateRef<HTMLElement>('toolbarRef')\n\nconst computedClasses = computed(() => ({\n 'justify-content-between': props.justify,\n}))\n\n// Get all focusable elements within the toolbar\nconst getFocusableElements = (): HTMLElement[] => {\n if (!toolbarRef.value) return []\n\n const selector =\n 'button:not(:disabled), [href]:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"]):not(:disabled)'\n const elements = Array.from(toolbarRef.value.querySelectorAll(selector)) as HTMLElement[]\n\n // Filter out elements that are not visible or have display:none\n return elements.filter((el) => {\n const style = getSafeWindow()?.getComputedStyle(el)\n return style && style.display !== 'none' && style.visibility !== 'hidden'\n })\n}\n\nconst isDisabled = (element: HTMLElement): boolean =>\n element.hasAttribute('disabled') || element.getAttribute('aria-disabled') === 'true'\n\nconst focusFirst = () => {\n nextTick(() => {\n const elements = getFocusableElements()\n const firstEnabled = elements.find((el) => !isDisabled(el))\n firstEnabled?.focus()\n })\n}\n\nconst focusLast = () => {\n nextTick(() => {\n const elements = getFocusableElements()\n const lastEnabled = elements.reverse().find((el) => !isDisabled(el))\n lastEnabled?.focus()\n })\n}\n\nconst focusPrev = () => {\n nextTick(() => {\n const elements = getFocusableElements()\n const activeElement = getActiveElement() as HTMLElement\n const currentIndex = elements.indexOf(activeElement)\n\n if (currentIndex > 0) {\n // Look backwards for the first non-disabled element\n for (let i = currentIndex - 1; i >= 0; i--) {\n const el = elements[i]\n if (el !== undefined && !isDisabled(el)) {\n elements[i]?.focus()\n break\n }\n }\n }\n })\n}\n\nconst focusNext = () => {\n nextTick(() => {\n const elements = getFocusableElements()\n const activeElement = getActiveElement() as HTMLElement\n const currentIndex = elements.indexOf(activeElement)\n\n if (currentIndex < elements.length - 1) {\n // Look forwards for the first non-disabled element\n for (let i = currentIndex + 1; i < elements.length; i++) {\n const el = elements[i]\n if (el !== undefined && !isDisabled(el)) {\n elements[i]?.focus()\n break\n }\n }\n }\n })\n}\n\nconst handleKeyNav = (event: KeyboardEvent) => {\n if (!props.keyNav) return\n\n const {code, shiftKey} = event\n\n if (code === CODE_LEFT || code === CODE_UP) {\n event.preventDefault()\n if (shiftKey) {\n focusFirst()\n } else {\n focusPrev()\n }\n } else if (code === CODE_RIGHT || code === CODE_DOWN) {\n event.preventDefault()\n if (shiftKey) {\n focusLast()\n } else {\n focusNext()\n }\n } else if (code === CODE_HOME) {\n event.preventDefault()\n focusFirst()\n } else if (code === CODE_END) {\n event.preventDefault()\n focusLast()\n }\n}\n</script>\n","<template>\n <div\n ref=\"toolbarRef\"\n :class=\"computedClasses\"\n class=\"btn-toolbar\"\n :role=\"props.role\"\n :aria-label=\"props.ariaLabel\"\n @keydown=\"handleKeyNav\"\n >\n <slot />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport type {BButtonToolbarSlots, BButtonToolbarProps} from '../../types'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {computed, nextTick, useTemplateRef} from 'vue'\nimport {CODE_DOWN, CODE_END, CODE_HOME, CODE_LEFT, CODE_RIGHT, CODE_UP} from '../../utils/constants'\nimport {getActiveElement, getSafeWindow} from '../../utils/dom'\n\nconst _props = withDefaults(defineProps<BButtonToolbarProps>(), {\n ariaLabel: 'Group',\n justify: false,\n keyNav: false,\n role: 'toolbar',\n})\nconst props = useDefaults(_props, 'BButtonToolbar')\ndefineSlots<BButtonToolbarSlots>()\n\nconst toolbarRef = useTemplateRef<HTMLElement>('toolbarRef')\n\nconst computedClasses = computed(() => ({\n 'justify-content-between': props.justify,\n}))\n\n// Get all focusable elements within the toolbar\nconst getFocusableElements = (): HTMLElement[] => {\n if (!toolbarRef.value) return []\n\n const selector =\n 'button:not(:disabled), [href]:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"]):not(:disabled)'\n const elements = Array.from(toolbarRef.value.querySelectorAll(selector)) as HTMLElement[]\n\n // Filter out elements that are not visible or have display:none\n return elements.filter((el) => {\n const style = getSafeWindow()?.getComputedStyle(el)\n return style && style.display !== 'none' && style.visibility !== 'hidden'\n })\n}\n\nconst isDisabled = (element: HTMLElement): boolean =>\n element.hasAttribute('disabled') || element.getAttribute('aria-disabled') === 'true'\n\nconst focusFirst = () => {\n nextTick(() => {\n const elements = getFocusableElements()\n const firstEnabled = elements.find((el) => !isDisabled(el))\n firstEnabled?.focus()\n })\n}\n\nconst focusLast = () => {\n nextTick(() => {\n const elements = getFocusableElements()\n const lastEnabled = elements.reverse().find((el) => !isDisabled(el))\n lastEnabled?.focus()\n })\n}\n\nconst focusPrev = () => {\n nextTick(() => {\n const elements = getFocusableElements()\n const activeElement = getActiveElement() as HTMLElement\n const currentIndex = elements.indexOf(activeElement)\n\n if (currentIndex > 0) {\n // Look backwards for the first non-disabled element\n for (let i = currentIndex - 1; i >= 0; i--) {\n const el = elements[i]\n if (el !== undefined && !isDisabled(el)) {\n elements[i]?.focus()\n break\n }\n }\n }\n })\n}\n\nconst focusNext = () => {\n nextTick(() => {\n const elements = getFocusableElements()\n const activeElement = getActiveElement() as HTMLElement\n const currentIndex = elements.indexOf(activeElement)\n\n if (currentIndex < elements.length - 1) {\n // Look forwards for the first non-disabled element\n for (let i = currentIndex + 1; i < elements.length; i++) {\n const el = elements[i]\n if (el !== undefined && !isDisabled(el)) {\n elements[i]?.focus()\n break\n }\n }\n }\n })\n}\n\nconst handleKeyNav = (event: KeyboardEvent) => {\n if (!props.keyNav) return\n\n const {code, shiftKey} = event\n\n if (code === CODE_LEFT || code === CODE_UP) {\n event.preventDefault()\n if (shiftKey) {\n focusFirst()\n } else {\n focusPrev()\n }\n } else if (code === CODE_RIGHT || code === CODE_DOWN) {\n event.preventDefault()\n if (shiftKey) {\n focusLast()\n } else {\n focusNext()\n }\n } else if (code === CODE_HOME) {\n event.preventDefault()\n focusFirst()\n } else if (code === CODE_END) {\n event.preventDefault()\n focusLast()\n }\n}\n</script>\n"],"mappings":";;;;;;;;;;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","../src/components/BButton/BButtonToolbar.vue","../src/components/BButton/BButtonToolbar.vue"],"sourcesContent":["<template>\n <component :is=\"props.tag\" :class=\"computedClasses\" role=\"group\" :aria-label=\"props.ariaLabel\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BButtonGroupProps} from '../../types/ComponentProps'\nimport {computed, provide} from 'vue'\nimport {buttonGroupKey} from '../../utils/keys'\nimport type {BButtonGroupSlots} from '../../types'\n\nprovide(buttonGroupKey, true)\n\nconst _props = withDefaults(defineProps<BButtonGroupProps>(), {\n ariaLabel: 'Group',\n size: 'md',\n tag: 'div',\n vertical: false,\n})\nconst props = useDefaults(_props, 'BButtonGroup')\ndefineSlots<BButtonGroupSlots>()\n\nconst computedClasses = computed(() => ({\n 'btn-group': !props.vertical,\n [`btn-group-${props.size}`]: props.size !== 'md',\n 'btn-group-vertical': props.vertical,\n}))\n</script>\n","<template>\n <component :is=\"props.tag\" :class=\"computedClasses\" role=\"group\" :aria-label=\"props.ariaLabel\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BButtonGroupProps} from '../../types/ComponentProps'\nimport {computed, provide} from 'vue'\nimport {buttonGroupKey} from '../../utils/keys'\nimport type {BButtonGroupSlots} from '../../types'\n\nprovide(buttonGroupKey, true)\n\nconst _props = withDefaults(defineProps<BButtonGroupProps>(), {\n ariaLabel: 'Group',\n size: 'md',\n tag: 'div',\n vertical: false,\n})\nconst props = useDefaults(_props, 'BButtonGroup')\ndefineSlots<BButtonGroupSlots>()\n\nconst computedClasses = computed(() => ({\n 'btn-group': !props.vertical,\n [`btn-group-${props.size}`]: props.size !== 'md',\n 'btn-group-vertical': props.vertical,\n}))\n</script>\n","<template>\n <div\n ref=\"toolbarRef\"\n :class=\"computedClasses\"\n class=\"btn-toolbar\"\n :role=\"props.role\"\n :aria-label=\"props.ariaLabel\"\n @keydown=\"handleKeyNav\"\n >\n <slot />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport type {BButtonToolbarSlots, BButtonToolbarProps} from '../../types'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {computed, nextTick, useTemplateRef} from 'vue'\nimport {CODE_DOWN, CODE_END, CODE_HOME, CODE_LEFT, CODE_RIGHT, CODE_UP} from '../../utils/constants'\nimport {getActiveElement, getSafeWindow} from '../../utils/dom'\n\nconst _props = withDefaults(defineProps<BButtonToolbarProps>(), {\n ariaLabel: 'Group',\n justify: false,\n keyNav: false,\n role: 'toolbar',\n})\nconst props = useDefaults(_props, 'BButtonToolbar')\ndefineSlots<BButtonToolbarSlots>()\n\nconst toolbarRef = useTemplateRef<HTMLElement>('toolbarRef')\n\nconst computedClasses = computed(() => ({\n 'justify-content-between': props.justify,\n}))\n\n// Get all focusable elements within the toolbar\nconst getFocusableElements = (): HTMLElement[] => {\n if (!toolbarRef.value) return []\n\n const selector =\n 'button:not(:disabled), [href]:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"]):not(:disabled)'\n const elements = Array.from(toolbarRef.value.querySelectorAll(selector)) as HTMLElement[]\n\n // Filter out elements that are not visible or have display:none\n return elements.filter((el) => {\n const style = getSafeWindow()?.getComputedStyle(el)\n return style && style.display !== 'none' && style.visibility !== 'hidden'\n })\n}\n\nconst isDisabled = (element: HTMLElement): boolean =>\n element.hasAttribute('disabled') || element.getAttribute('aria-disabled') === 'true'\n\nconst focusFirst = () => {\n nextTick(() => {\n const elements = getFocusableElements()\n const firstEnabled = elements.find((el) => !isDisabled(el))\n firstEnabled?.focus()\n })\n}\n\nconst focusLast = () => {\n nextTick(() => {\n const elements = getFocusableElements()\n const lastEnabled = elements.reverse().find((el) => !isDisabled(el))\n lastEnabled?.focus()\n })\n}\n\nconst focusPrev = () => {\n nextTick(() => {\n const elements = getFocusableElements()\n const activeElement = getActiveElement() as HTMLElement\n const currentIndex = elements.indexOf(activeElement)\n\n if (currentIndex > 0) {\n // Look backwards for the first non-disabled element\n for (let i = currentIndex - 1; i >= 0; i--) {\n const el = elements[i]\n if (el !== undefined && !isDisabled(el)) {\n elements[i]?.focus()\n break\n }\n }\n }\n })\n}\n\nconst focusNext = () => {\n nextTick(() => {\n const elements = getFocusableElements()\n const activeElement = getActiveElement() as HTMLElement\n const currentIndex = elements.indexOf(activeElement)\n\n if (currentIndex < elements.length - 1) {\n // Look forwards for the first non-disabled element\n for (let i = currentIndex + 1; i < elements.length; i++) {\n const el = elements[i]\n if (el !== undefined && !isDisabled(el)) {\n elements[i]?.focus()\n break\n }\n }\n }\n })\n}\n\nconst handleKeyNav = (event: KeyboardEvent) => {\n if (!props.keyNav) return\n\n const {code, shiftKey} = event\n\n if (code === CODE_LEFT || code === CODE_UP) {\n event.preventDefault()\n if (shiftKey) {\n focusFirst()\n } else {\n focusPrev()\n }\n } else if (code === CODE_RIGHT || code === CODE_DOWN) {\n event.preventDefault()\n if (shiftKey) {\n focusLast()\n } else {\n focusNext()\n }\n } else if (code === CODE_HOME) {\n event.preventDefault()\n focusFirst()\n } else if (code === CODE_END) {\n event.preventDefault()\n focusLast()\n }\n}\n</script>\n","<template>\n <div\n ref=\"toolbarRef\"\n :class=\"computedClasses\"\n class=\"btn-toolbar\"\n :role=\"props.role\"\n :aria-label=\"props.ariaLabel\"\n @keydown=\"handleKeyNav\"\n >\n <slot />\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport type {BButtonToolbarSlots, BButtonToolbarProps} from '../../types'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {computed, nextTick, useTemplateRef} from 'vue'\nimport {CODE_DOWN, CODE_END, CODE_HOME, CODE_LEFT, CODE_RIGHT, CODE_UP} from '../../utils/constants'\nimport {getActiveElement, getSafeWindow} from '../../utils/dom'\n\nconst _props = withDefaults(defineProps<BButtonToolbarProps>(), {\n ariaLabel: 'Group',\n justify: false,\n keyNav: false,\n role: 'toolbar',\n})\nconst props = useDefaults(_props, 'BButtonToolbar')\ndefineSlots<BButtonToolbarSlots>()\n\nconst toolbarRef = useTemplateRef<HTMLElement>('toolbarRef')\n\nconst computedClasses = computed(() => ({\n 'justify-content-between': props.justify,\n}))\n\n// Get all focusable elements within the toolbar\nconst getFocusableElements = (): HTMLElement[] => {\n if (!toolbarRef.value) return []\n\n const selector =\n 'button:not(:disabled), [href]:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"]):not(:disabled)'\n const elements = Array.from(toolbarRef.value.querySelectorAll(selector)) as HTMLElement[]\n\n // Filter out elements that are not visible or have display:none\n return elements.filter((el) => {\n const style = getSafeWindow()?.getComputedStyle(el)\n return style && style.display !== 'none' && style.visibility !== 'hidden'\n })\n}\n\nconst isDisabled = (element: HTMLElement): boolean =>\n element.hasAttribute('disabled') || element.getAttribute('aria-disabled') === 'true'\n\nconst focusFirst = () => {\n nextTick(() => {\n const elements = getFocusableElements()\n const firstEnabled = elements.find((el) => !isDisabled(el))\n firstEnabled?.focus()\n })\n}\n\nconst focusLast = () => {\n nextTick(() => {\n const elements = getFocusableElements()\n const lastEnabled = elements.reverse().find((el) => !isDisabled(el))\n lastEnabled?.focus()\n })\n}\n\nconst focusPrev = () => {\n nextTick(() => {\n const elements = getFocusableElements()\n const activeElement = getActiveElement() as HTMLElement\n const currentIndex = elements.indexOf(activeElement)\n\n if (currentIndex > 0) {\n // Look backwards for the first non-disabled element\n for (let i = currentIndex - 1; i >= 0; i--) {\n const el = elements[i]\n if (el !== undefined && !isDisabled(el)) {\n elements[i]?.focus()\n break\n }\n }\n }\n })\n}\n\nconst focusNext = () => {\n nextTick(() => {\n const elements = getFocusableElements()\n const activeElement = getActiveElement() as HTMLElement\n const currentIndex = elements.indexOf(activeElement)\n\n if (currentIndex < elements.length - 1) {\n // Look forwards for the first non-disabled element\n for (let i = currentIndex + 1; i < elements.length; i++) {\n const el = elements[i]\n if (el !== undefined && !isDisabled(el)) {\n elements[i]?.focus()\n break\n }\n }\n }\n })\n}\n\nconst handleKeyNav = (event: KeyboardEvent) => {\n if (!props.keyNav) return\n\n const {code, shiftKey} = event\n\n if (code === CODE_LEFT || code === CODE_UP) {\n event.preventDefault()\n if (shiftKey) {\n focusFirst()\n } else {\n focusPrev()\n }\n } else if (code === CODE_RIGHT || code === CODE_DOWN) {\n event.preventDefault()\n if (shiftKey) {\n focusLast()\n } else {\n focusNext()\n }\n } else if (code === CODE_HOME) {\n event.preventDefault()\n focusFirst()\n } else if (code === CODE_END) {\n event.preventDefault()\n focusLast()\n }\n}\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAaA,GAAA,GAAA,IAAA,SAAQ,aAAA,gBAAgB,KAAI;EAQ5B,MAAM,QAAQ,oBAAA,YANC,SAMmB,eAAc;EAGhD,MAAM,mBAAA,GAAA,IAAA,iBAAkC;GACtC,aAAa,CAAC,MAAM;IACnB,aAAa,MAAM,SAAS,MAAM,SAAS;GAC5C,sBAAsB,MAAM;GAC7B,EAAC;;qGA3BgB,MAAK,CAAC,IAAG,EAAA;IAAG,QAAA,GAAA,IAAA,gBAAO,gBAAA,MAAe;IAAE,MAAK;IAAS,eAAA,GAAA,IAAA,OAAY,MAAK,CAAC;;oCAC1E,EAAA,GAAA,IAAA,YAAA,KAAA,QAAA,UAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;EEwBZ,MAAM,QAAQ,oBAAA,YANC,SAMmB,iBAAgB;EAGlD,MAAM,cAAA,GAAA,IAAA,gBAAyC,aAAY;EAE3D,MAAM,mBAAA,GAAA,IAAA,iBAAkC,EACtC,2BAA2B,MAAM,SAClC,EAAC;EAGF,MAAM,6BAA4C;AAChD,OAAI,CAAC,WAAW,MAAO,QAAO,EAAC;AAO/B,UAHiB,MAAM,KAAK,WAAW,MAAM,iBAD3C,uKACqE,CAAC,CAGxD,QAAQ,OAAO;IAC7B,MAAM,QAAQ,YAAA,eAAe,EAAE,iBAAiB,GAAE;AAClD,WAAO,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,gBAAe;AACrB,QAAI,SACF,aAAW;QAEX,YAAU;cAEH,SAAA,gBAAuB,SAAA,aAAoB;AACpD,UAAM,gBAAe;AACrB,QAAI,SACF,YAAU;QAEV,YAAU;cAEH,SAAA,QAAoB;AAC7B,UAAM,gBAAe;AACrB,gBAAW;cACF,SAAA,OAAmB;AAC5B,UAAM,gBAAe;AACrB,eAAU;;;;4DAzHN,OAAA;aARA;IAAJ,KAAI;IACH,QAAA,GAAA,IAAA,gBAAK,CAAE,gBAAA,OACF,cAAa,CAAA;IAClB,OAAA,GAAA,IAAA,OAAM,MAAK,CAAC;IACZ,eAAA,GAAA,IAAA,OAAY,MAAK,CAAC;IAClB,WAAS;2BAEF,KAAA,QAAA,UAAA,CAAA,EAAA,IAAA,WAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BCarousel-Be7z13f9.js","names":[],"sources":["../src/utils/getSlotElements.ts","../src/components/BCarousel/BCarousel.vue","../src/components/BCarousel/BCarousel.vue","../src/components/BCarousel/BCarouselSlide.vue","../src/components/BCarousel/BCarouselSlide.vue"],"sourcesContent":["import type {Slot, VNode} from 'vue'\n\nexport const getSlotElements = (slot: Slot | undefined, filterBy: string): VNode[] =>\n (slot?.() ?? [])\n .reduce((arr: VNode[], slot: VNode) => {\n if (typeof slot.type === 'symbol') {\n arr = arr.concat(slot.children as unknown as VNode)\n } else {\n arr.push(slot)\n }\n return arr\n }, [])\n .filter((child) => (child.type as {__name: string} | undefined)?.__name === filterBy)\n","<template>\n <div\n :id=\"computedId\"\n ref=\"_element\"\n class=\"carousel slide pointer-event\"\n :class=\"computedClasses\"\n >\n <div\n v-if=\"props.indicators\"\n class=\"carousel-indicators\"\n :aria-label=\"props.labelIndicators\"\n :aria-owns=\"buttonOwnership\"\n >\n <!-- :data-bs-target=\"`#${computedId}`\" is required since the classes target elems with that attr -->\n <button\n v-for=\"(_, i) in slides.length\"\n :key=\"i\"\n type=\"button\"\n data-bs-target=\"\"\n :class=\"i === modelValue ? 'active' : ''\"\n :aria-current=\"i === modelValue ? true : undefined\"\n :aria-label=\"`${props.indicatorsButtonLabel} ${i}`\"\n :aria-controls=\"buttonOwnership\"\n :aria-describedby=\"slideValues?.[i]?._id\"\n @click=\"goToValue(i)\"\n />\n </div>\n\n <div ref=\"_relatedTarget\" class=\"carousel-inner\">\n <TransitionGroup\n :enter-from-class=\"enterClasses\"\n :enter-active-class=\"enterClasses\"\n :enter-to-class=\"enterClasses\"\n :leave-from-class=\"leaveClasses\"\n :leave-active-class=\"leaveClasses\"\n :leave-to-class=\"leaveClasses\"\n @before-leave=\"onBeforeLeave\"\n @after-leave=\"onAfterLeave\"\n @after-enter=\"onAfterEnter\"\n @enter=\"onEnter\"\n >\n <component\n :is=\"slide\"\n v-for=\"(slide, i) in slides\"\n v-show=\"i === modelValue\"\n :key=\"i\"\n ref=\"_slideValues\"\n :class=\"{active: i === modelValue && isTransitioning === false}\"\n :style=\"props.noAnimation && {transition: 'none'}\"\n />\n </TransitionGroup>\n </div>\n\n <template v-if=\"props.controls\">\n <button class=\"carousel-control-prev\" type=\"button\" @click=\"onClickPrev\">\n <span class=\"carousel-control-prev-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsPrevText }}</span>\n </button>\n <button class=\"carousel-control-next\" type=\"button\" @click=\"onClickNext\">\n <span class=\"carousel-control-next-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsNextText }}</span>\n </button>\n </template>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {BvCarouselEvent} from '../../utils'\nimport {computed, onMounted, provide, ref, toRef, useTemplateRef, watch} from 'vue'\nimport {useId} from '../../composables/useId'\nimport type {BCarouselProps} from '../../types/ComponentProps'\nimport {onKeyStroke, useElementHover, useIntervalFn, useSwipe, useToNumber} from '@vueuse/core'\nimport type BCarouselSlide from './BCarouselSlide.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {Numberish} from '../../types/CommonTypes'\nimport {getSlotElements} from '../../utils/getSlotElements'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport type {BCarouselEmits, BCarouselSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<Omit<BCarouselProps, 'modelValue'>>(), {\n background: undefined,\n controls: false,\n controlsNextText: 'Next',\n controlsPrevText: 'Previous',\n fade: false,\n id: undefined,\n imgHeight: undefined,\n imgWidth: undefined,\n indicators: false,\n indicatorsButtonLabel: 'Slide',\n interval: 5000,\n labelIndicators: 'Select a slide to display',\n keyboard: true,\n noAnimation: false,\n noHoverPause: false,\n noTouch: false,\n noWrap: false,\n ride: false,\n rideReverse: false,\n touchThreshold: 50,\n})\nconst props = useDefaults(_props, 'BCarousel')\nconst emit = defineEmits<BCarouselEmits>()\nconst slots = defineSlots<BCarouselSlots>()\n\nconst computedId = useId(() => props.id, 'carousel')\nconst buttonOwnership = useId(undefined, 'carousel-button-ownership')\n\nconst modelValue = defineModel<Exclude<BCarouselProps['modelValue'], undefined>>({default: 0})\n\nconst slideValues = useTemplateRef<InstanceType<typeof BCarouselSlide>[]>('_slideValues')\n\nconst touchThresholdNumber = useToNumber(() => props.touchThreshold)\nconst slideInterval = ref<Numberish | null>(null)\nonMounted(() => {\n slideInterval.value =\n slideValues.value?.find((slid) => slid.$el.style.display !== 'none')?._interval ?? null\n})\nconst intervalNumber = useToNumber(() => slideInterval.value ?? props.interval)\n\nconst isTransitioning = ref(false)\nconst rideStarted = ref(false)\nconst direction = ref(true)\nconst relatedTarget = useTemplateRef('_relatedTarget')\nconst element = useTemplateRef('_element')\nconst previousModelValue = ref(modelValue.value)\n\nconst isHovering = useElementHover(element)\n\n// Class carousel-item is a static property\n// If you make it static, the direction can be reversed -- properly (atm it does the carousel-item-${} logic backwards for entering, a weird hack)\n// So all that would be great. However, when you do this, it will break the transition flow. Something about it breaks and I'm not sure why!\n// Try it by removing carousel-item from below and making `!direction.value` => `direction.value` for enter\n// Then reviewing the behavior\nconst enterClasses = computed(\n () =>\n `carousel-item carousel-item-${!direction.value ? 'next' : 'prev'} carousel-item-${\n !direction.value ? 'start' : 'end'\n }`\n)\nconst leaveClasses = computed(\n () => `carousel-item active carousel-item-${direction.value ? 'start' : 'end'}`\n)\n\nconst {pause, resume} = useIntervalFn(\n () => {\n if (props.rideReverse) {\n prev()\n return\n }\n next()\n },\n intervalNumber,\n {immediate: props.ride === 'carousel'}\n)\n\nconst isRiding = computed(\n () => (props.ride === true && rideStarted.value === true) || props.ride === 'carousel'\n)\nconst slides = computed(() => getSlotElements(slots.default, 'BCarouselSlide'))\nconst computedClasses = computed(() => ({'carousel-fade': props.fade}))\n\nconst buildBvCarouselEvent = (event: 'slid' | 'slide') =>\n new BvCarouselEvent(event, {\n componentId: computedId.value,\n cancelable: false,\n target: element.value,\n direction: direction.value ? 'right' : 'left',\n from: previousModelValue.value,\n to: modelValue.value,\n relatedTarget: relatedTarget.value?.children[modelValue.value] ?? null,\n })\n\nconst goToValue = (value: number): void => {\n if (isTransitioning.value === true) return\n\n if (props.ride === true) {\n rideStarted.value = true\n }\n if (isRiding.value === true) {\n resume()\n }\n direction.value = value < modelValue.value ? false : true\n if (value >= slides.value.length) {\n if (props.noWrap) return\n modelValue.value = 0\n return\n }\n if (value < 0) {\n if (props.noWrap) return\n modelValue.value = slides.value.length - 1\n return\n }\n previousModelValue.value = modelValue.value\n modelValue.value = value\n}\n\nconst prev = (): void => {\n goToValue(modelValue.value - 1)\n}\nconst next = (): void => {\n goToValue(modelValue.value + 1)\n}\n\nconst onKeydown = (fn: () => void) => {\n if (props.keyboard === false) return\n fn()\n}\n\nconst onMouseEnter = () => {\n if (props.noHoverPause) return\n pause()\n}\nconst onMouseLeave = () => {\n if (!isRiding.value) return\n resume()\n}\n\nconst {lengthX} = useSwipe(element, {\n passive: true,\n onSwipeStart() {\n if (props.noTouch === true) return\n pause()\n },\n onSwipeEnd() {\n if (props.noTouch === true) return\n const resumeRiding = () => {\n if (isRiding.value === false) return\n resume()\n }\n if (lengthX.value >= touchThresholdNumber.value) {\n next()\n resumeRiding()\n return\n }\n if (lengthX.value <= -touchThresholdNumber.value) {\n prev()\n resumeRiding()\n }\n },\n})\n\nconst onBeforeLeave = () => {\n emit('slide', buildBvCarouselEvent('slide'))\n isTransitioning.value = true\n}\nconst onAfterLeave = () => {\n emit('slid', buildBvCarouselEvent('slid'))\n isTransitioning.value = false\n}\n// carousel-item class is removed from the slide during the transition,\n// as is included within enter classes.\n// The first slide recovers carousel-item class,\nconst onAfterEnter = (el: Readonly<Element>) => {\n if (modelValue.value !== 0) {\n el.classList.add('carousel-item')\n }\n}\nconst onEnter = (el: Readonly<Element>) => {\n slideInterval.value = slideValues.value?.find((slid) => slid.$el === el)?._interval ?? null\n}\n\nonKeyStroke(\n 'ArrowLeft',\n () => {\n onKeydown(prev)\n },\n {target: element}\n)\nonKeyStroke(\n 'ArrowRight',\n () => {\n onKeydown(next)\n },\n {target: element, passive: true}\n)\n\nwatch(\n () => props.ride,\n () => {\n rideStarted.value = false\n }\n)\n\nwatch(isHovering, (newValue) => {\n if (newValue) {\n onMouseEnter()\n return\n }\n onMouseLeave()\n})\n\nconst onClickPrev = (event: MouseEvent) => {\n emit('prev-click', event)\n if (event.defaultPrevented) return\n prev()\n}\nconst onClickNext = (event: MouseEvent) => {\n emit('next-click', event)\n if (event.defaultPrevented) return\n next()\n}\n\ndefineExpose({\n next,\n pause,\n prev,\n resume,\n})\n\nprovide(carouselInjectionKey, {\n background: toRef(() => props.background),\n width: toRef(() => props.imgWidth),\n height: toRef(() => props.imgHeight),\n})\n</script>\n","<template>\n <div\n :id=\"computedId\"\n ref=\"_element\"\n class=\"carousel slide pointer-event\"\n :class=\"computedClasses\"\n >\n <div\n v-if=\"props.indicators\"\n class=\"carousel-indicators\"\n :aria-label=\"props.labelIndicators\"\n :aria-owns=\"buttonOwnership\"\n >\n <!-- :data-bs-target=\"`#${computedId}`\" is required since the classes target elems with that attr -->\n <button\n v-for=\"(_, i) in slides.length\"\n :key=\"i\"\n type=\"button\"\n data-bs-target=\"\"\n :class=\"i === modelValue ? 'active' : ''\"\n :aria-current=\"i === modelValue ? true : undefined\"\n :aria-label=\"`${props.indicatorsButtonLabel} ${i}`\"\n :aria-controls=\"buttonOwnership\"\n :aria-describedby=\"slideValues?.[i]?._id\"\n @click=\"goToValue(i)\"\n />\n </div>\n\n <div ref=\"_relatedTarget\" class=\"carousel-inner\">\n <TransitionGroup\n :enter-from-class=\"enterClasses\"\n :enter-active-class=\"enterClasses\"\n :enter-to-class=\"enterClasses\"\n :leave-from-class=\"leaveClasses\"\n :leave-active-class=\"leaveClasses\"\n :leave-to-class=\"leaveClasses\"\n @before-leave=\"onBeforeLeave\"\n @after-leave=\"onAfterLeave\"\n @after-enter=\"onAfterEnter\"\n @enter=\"onEnter\"\n >\n <component\n :is=\"slide\"\n v-for=\"(slide, i) in slides\"\n v-show=\"i === modelValue\"\n :key=\"i\"\n ref=\"_slideValues\"\n :class=\"{active: i === modelValue && isTransitioning === false}\"\n :style=\"props.noAnimation && {transition: 'none'}\"\n />\n </TransitionGroup>\n </div>\n\n <template v-if=\"props.controls\">\n <button class=\"carousel-control-prev\" type=\"button\" @click=\"onClickPrev\">\n <span class=\"carousel-control-prev-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsPrevText }}</span>\n </button>\n <button class=\"carousel-control-next\" type=\"button\" @click=\"onClickNext\">\n <span class=\"carousel-control-next-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsNextText }}</span>\n </button>\n </template>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {BvCarouselEvent} from '../../utils'\nimport {computed, onMounted, provide, ref, toRef, useTemplateRef, watch} from 'vue'\nimport {useId} from '../../composables/useId'\nimport type {BCarouselProps} from '../../types/ComponentProps'\nimport {onKeyStroke, useElementHover, useIntervalFn, useSwipe, useToNumber} from '@vueuse/core'\nimport type BCarouselSlide from './BCarouselSlide.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {Numberish} from '../../types/CommonTypes'\nimport {getSlotElements} from '../../utils/getSlotElements'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport type {BCarouselEmits, BCarouselSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<Omit<BCarouselProps, 'modelValue'>>(), {\n background: undefined,\n controls: false,\n controlsNextText: 'Next',\n controlsPrevText: 'Previous',\n fade: false,\n id: undefined,\n imgHeight: undefined,\n imgWidth: undefined,\n indicators: false,\n indicatorsButtonLabel: 'Slide',\n interval: 5000,\n labelIndicators: 'Select a slide to display',\n keyboard: true,\n noAnimation: false,\n noHoverPause: false,\n noTouch: false,\n noWrap: false,\n ride: false,\n rideReverse: false,\n touchThreshold: 50,\n})\nconst props = useDefaults(_props, 'BCarousel')\nconst emit = defineEmits<BCarouselEmits>()\nconst slots = defineSlots<BCarouselSlots>()\n\nconst computedId = useId(() => props.id, 'carousel')\nconst buttonOwnership = useId(undefined, 'carousel-button-ownership')\n\nconst modelValue = defineModel<Exclude<BCarouselProps['modelValue'], undefined>>({default: 0})\n\nconst slideValues = useTemplateRef<InstanceType<typeof BCarouselSlide>[]>('_slideValues')\n\nconst touchThresholdNumber = useToNumber(() => props.touchThreshold)\nconst slideInterval = ref<Numberish | null>(null)\nonMounted(() => {\n slideInterval.value =\n slideValues.value?.find((slid) => slid.$el.style.display !== 'none')?._interval ?? null\n})\nconst intervalNumber = useToNumber(() => slideInterval.value ?? props.interval)\n\nconst isTransitioning = ref(false)\nconst rideStarted = ref(false)\nconst direction = ref(true)\nconst relatedTarget = useTemplateRef('_relatedTarget')\nconst element = useTemplateRef('_element')\nconst previousModelValue = ref(modelValue.value)\n\nconst isHovering = useElementHover(element)\n\n// Class carousel-item is a static property\n// If you make it static, the direction can be reversed -- properly (atm it does the carousel-item-${} logic backwards for entering, a weird hack)\n// So all that would be great. However, when you do this, it will break the transition flow. Something about it breaks and I'm not sure why!\n// Try it by removing carousel-item from below and making `!direction.value` => `direction.value` for enter\n// Then reviewing the behavior\nconst enterClasses = computed(\n () =>\n `carousel-item carousel-item-${!direction.value ? 'next' : 'prev'} carousel-item-${\n !direction.value ? 'start' : 'end'\n }`\n)\nconst leaveClasses = computed(\n () => `carousel-item active carousel-item-${direction.value ? 'start' : 'end'}`\n)\n\nconst {pause, resume} = useIntervalFn(\n () => {\n if (props.rideReverse) {\n prev()\n return\n }\n next()\n },\n intervalNumber,\n {immediate: props.ride === 'carousel'}\n)\n\nconst isRiding = computed(\n () => (props.ride === true && rideStarted.value === true) || props.ride === 'carousel'\n)\nconst slides = computed(() => getSlotElements(slots.default, 'BCarouselSlide'))\nconst computedClasses = computed(() => ({'carousel-fade': props.fade}))\n\nconst buildBvCarouselEvent = (event: 'slid' | 'slide') =>\n new BvCarouselEvent(event, {\n componentId: computedId.value,\n cancelable: false,\n target: element.value,\n direction: direction.value ? 'right' : 'left',\n from: previousModelValue.value,\n to: modelValue.value,\n relatedTarget: relatedTarget.value?.children[modelValue.value] ?? null,\n })\n\nconst goToValue = (value: number): void => {\n if (isTransitioning.value === true) return\n\n if (props.ride === true) {\n rideStarted.value = true\n }\n if (isRiding.value === true) {\n resume()\n }\n direction.value = value < modelValue.value ? false : true\n if (value >= slides.value.length) {\n if (props.noWrap) return\n modelValue.value = 0\n return\n }\n if (value < 0) {\n if (props.noWrap) return\n modelValue.value = slides.value.length - 1\n return\n }\n previousModelValue.value = modelValue.value\n modelValue.value = value\n}\n\nconst prev = (): void => {\n goToValue(modelValue.value - 1)\n}\nconst next = (): void => {\n goToValue(modelValue.value + 1)\n}\n\nconst onKeydown = (fn: () => void) => {\n if (props.keyboard === false) return\n fn()\n}\n\nconst onMouseEnter = () => {\n if (props.noHoverPause) return\n pause()\n}\nconst onMouseLeave = () => {\n if (!isRiding.value) return\n resume()\n}\n\nconst {lengthX} = useSwipe(element, {\n passive: true,\n onSwipeStart() {\n if (props.noTouch === true) return\n pause()\n },\n onSwipeEnd() {\n if (props.noTouch === true) return\n const resumeRiding = () => {\n if (isRiding.value === false) return\n resume()\n }\n if (lengthX.value >= touchThresholdNumber.value) {\n next()\n resumeRiding()\n return\n }\n if (lengthX.value <= -touchThresholdNumber.value) {\n prev()\n resumeRiding()\n }\n },\n})\n\nconst onBeforeLeave = () => {\n emit('slide', buildBvCarouselEvent('slide'))\n isTransitioning.value = true\n}\nconst onAfterLeave = () => {\n emit('slid', buildBvCarouselEvent('slid'))\n isTransitioning.value = false\n}\n// carousel-item class is removed from the slide during the transition,\n// as is included within enter classes.\n// The first slide recovers carousel-item class,\nconst onAfterEnter = (el: Readonly<Element>) => {\n if (modelValue.value !== 0) {\n el.classList.add('carousel-item')\n }\n}\nconst onEnter = (el: Readonly<Element>) => {\n slideInterval.value = slideValues.value?.find((slid) => slid.$el === el)?._interval ?? null\n}\n\nonKeyStroke(\n 'ArrowLeft',\n () => {\n onKeydown(prev)\n },\n {target: element}\n)\nonKeyStroke(\n 'ArrowRight',\n () => {\n onKeydown(next)\n },\n {target: element, passive: true}\n)\n\nwatch(\n () => props.ride,\n () => {\n rideStarted.value = false\n }\n)\n\nwatch(isHovering, (newValue) => {\n if (newValue) {\n onMouseEnter()\n return\n }\n onMouseLeave()\n})\n\nconst onClickPrev = (event: MouseEvent) => {\n emit('prev-click', event)\n if (event.defaultPrevented) return\n prev()\n}\nconst onClickNext = (event: MouseEvent) => {\n emit('next-click', event)\n if (event.defaultPrevented) return\n next()\n}\n\ndefineExpose({\n next,\n pause,\n prev,\n resume,\n})\n\nprovide(carouselInjectionKey, {\n background: toRef(() => props.background),\n width: toRef(() => props.imgWidth),\n height: toRef(() => props.imgHeight),\n})\n</script>\n","<template>\n <div :id=\"computedId\" class=\"carousel-item\" :style=\"computedStyle\">\n <slot name=\"img\">\n <BImg\n class=\"d-block w-100\"\n :alt=\"props.imgAlt\"\n :srcset=\"props.imgSrcset\"\n :src=\"props.imgSrc\"\n :width=\"props.imgWidth || parentData?.width.value\"\n :height=\"props.imgHeight || parentData?.height.value\"\n :blank=\"props.imgBlank\"\n :blank-color=\"props.imgBlankColor\"\n />\n </slot>\n <component\n :is=\"props.contentTag\"\n v-if=\"hasContent\"\n class=\"carousel-caption\"\n :class=\"computedContentClasses\"\n >\n <component :is=\"props.captionTag\" v-if=\"hasCaption\">\n <slot name=\"caption\">\n <span>{{ props.caption }}</span>\n </slot>\n </component>\n <component :is=\"props.textTag\" v-if=\"hasText\">\n <slot name=\"text\">\n <span>{{ props.text }}</span>\n </slot>\n </component>\n <slot />\n </component>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, type CSSProperties, inject, toRef} from 'vue'\nimport type {BCarouselSlideProps} from '../../types/ComponentProps'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport BImg from '../BImg/BImg.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {isEmptySlot} from '../../utils/dom'\nimport {useId} from '../../composables/useId'\nimport type {BCarouselSlideSlots} from '../../types/ComponentSlots'\n\nconst _props = withDefaults(defineProps<BCarouselSlideProps>(), {\n background: undefined,\n caption: undefined,\n captionTag: 'h3',\n contentTag: 'div',\n contentVisibleUp: undefined,\n id: undefined,\n imgAlt: undefined,\n imgBlank: false,\n imgBlankColor: 'transparent',\n imgHeight: undefined,\n imgSrc: undefined,\n imgSrcset: undefined,\n imgWidth: undefined,\n interval: undefined,\n text: undefined,\n textTag: 'p',\n})\nconst props = useDefaults(_props, 'BCarouselSlide')\nconst slots = defineSlots<BCarouselSlideSlots>()\n\nconst computedId = useId(() => props.id, 'carousel-slide')\nconst parentData = inject(carouselInjectionKey, null)\n\nconst hasText = computed(() => props.text || !isEmptySlot(slots.text))\nconst hasCaption = computed(() => props.caption || !isEmptySlot(slots.caption))\nconst hasContent = computed(() => hasText.value || hasCaption.value || !isEmptySlot(slots.default))\n\nconst computedStyle = computed<CSSProperties>(() => ({\n background: `${\n props.background || parentData?.background.value || 'rgb(171, 171, 171)'\n } none repeat scroll 0% 0%`,\n}))\n\nconst computedContentClasses = computed(() => ({\n 'd-none': props.contentVisibleUp !== undefined,\n [`d-${props.contentVisibleUp}-block`]: props.contentVisibleUp !== undefined,\n}))\n\ndefineExpose({\n _interval: toRef(() => props.interval),\n _id: computedId,\n})\n</script>\n","<template>\n <div :id=\"computedId\" class=\"carousel-item\" :style=\"computedStyle\">\n <slot name=\"img\">\n <BImg\n class=\"d-block w-100\"\n :alt=\"props.imgAlt\"\n :srcset=\"props.imgSrcset\"\n :src=\"props.imgSrc\"\n :width=\"props.imgWidth || parentData?.width.value\"\n :height=\"props.imgHeight || parentData?.height.value\"\n :blank=\"props.imgBlank\"\n :blank-color=\"props.imgBlankColor\"\n />\n </slot>\n <component\n :is=\"props.contentTag\"\n v-if=\"hasContent\"\n class=\"carousel-caption\"\n :class=\"computedContentClasses\"\n >\n <component :is=\"props.captionTag\" v-if=\"hasCaption\">\n <slot name=\"caption\">\n <span>{{ props.caption }}</span>\n </slot>\n </component>\n <component :is=\"props.textTag\" v-if=\"hasText\">\n <slot name=\"text\">\n <span>{{ props.text }}</span>\n </slot>\n </component>\n <slot />\n </component>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, type CSSProperties, inject, toRef} from 'vue'\nimport type {BCarouselSlideProps} from '../../types/ComponentProps'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport BImg from '../BImg/BImg.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {isEmptySlot} from '../../utils/dom'\nimport {useId} from '../../composables/useId'\nimport type {BCarouselSlideSlots} from '../../types/ComponentSlots'\n\nconst _props = withDefaults(defineProps<BCarouselSlideProps>(), {\n background: undefined,\n caption: undefined,\n captionTag: 'h3',\n contentTag: 'div',\n contentVisibleUp: undefined,\n id: undefined,\n imgAlt: undefined,\n imgBlank: false,\n imgBlankColor: 'transparent',\n imgHeight: undefined,\n imgSrc: undefined,\n imgSrcset: undefined,\n imgWidth: undefined,\n interval: undefined,\n text: undefined,\n textTag: 'p',\n})\nconst props = useDefaults(_props, 'BCarouselSlide')\nconst slots = defineSlots<BCarouselSlideSlots>()\n\nconst computedId = useId(() => props.id, 'carousel-slide')\nconst parentData = inject(carouselInjectionKey, null)\n\nconst hasText = computed(() => props.text || !isEmptySlot(slots.text))\nconst hasCaption = computed(() => props.caption || !isEmptySlot(slots.caption))\nconst hasContent = computed(() => hasText.value || hasCaption.value || !isEmptySlot(slots.default))\n\nconst computedStyle = computed<CSSProperties>(() => ({\n background: `${\n props.background || parentData?.background.value || 'rgb(171, 171, 171)'\n } none repeat scroll 0% 0%`,\n}))\n\nconst computedContentClasses = computed(() => ({\n 'd-none': props.contentVisibleUp !== undefined,\n [`d-${props.contentVisibleUp}-block`]: props.contentVisibleUp !== undefined,\n}))\n\ndefineExpose({\n _interval: toRef(() => props.interval),\n _id: computedId,\n})\n</script>\n"],"mappings":";;;;;;;;;;AAEA,IAAa,mBAAmB,MAAwB,cACrD,QAAQ,IAAI,EAAE,EACZ,QAAQ,KAAc,SAAgB;AACrC,KAAI,OAAO,KAAK,SAAS,SACvB,OAAM,IAAI,OAAO,KAAK,SAA6B;KAEnD,KAAI,KAAK,KAAK;AAEhB,QAAO;GACN,EAAE,CAAC,CACL,QAAQ,UAAW,MAAM,MAAuC,WAAW,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ECyFzF,MAAM,QAAQ,oBAAA,YAtBC,SAsBmB,YAAW;EAC7C,MAAM,OAAO;EACb,MAAM,SAAA,GAAA,IAAA,WAAQ;EAEd,MAAM,aAAa,cAAA,YAAY,MAAM,IAAI,WAAU;EACnD,MAAM,kBAAkB,cAAA,MAAM,KAAA,GAAW,4BAA2B;EAEpE,MAAM,cAAA,GAAA,IAAA,UAA0E,SAAA,aAAa;EAE7F,MAAM,eAAA,GAAA,IAAA,gBAAoE,eAAc;EAExF,MAAM,uBAAuB,aAAA,kBAAkB,MAAM,eAAc;EACnE,MAAM,iBAAA,GAAA,IAAA,KAAsC,KAAI;AAChD,GAAA,GAAA,IAAA,iBAAgB;AACd,iB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,KAAA,GAAA,EAAA;sCAGpB,EAAA,GAAA,IAAA,YAAA,KAAA,QAAA,QAAA,EAAA,QAAA,EAAA,GAAA,IAAA,oBADwB,QAAA,OAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,OAApB,MAAK,CAAC,KAAI,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA;;;yBAGf,KAAA,QAAA,UAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BCarousel-D81alfFC.mjs","names":[],"sources":["../src/utils/getSlotElements.ts","../src/components/BCarousel/BCarousel.vue","../src/components/BCarousel/BCarousel.vue","../src/components/BCarousel/BCarouselSlide.vue","../src/components/BCarousel/BCarouselSlide.vue"],"sourcesContent":["import type {Slot, VNode} from 'vue'\n\nexport const getSlotElements = (slot: Slot | undefined, filterBy: string): VNode[] =>\n (slot?.() ?? [])\n .reduce((arr: VNode[], slot: VNode) => {\n if (typeof slot.type === 'symbol') {\n arr = arr.concat(slot.children as unknown as VNode)\n } else {\n arr.push(slot)\n }\n return arr\n }, [])\n .filter((child) => (child.type as {__name: string} | undefined)?.__name === filterBy)\n","<template>\n <div\n :id=\"computedId\"\n ref=\"_element\"\n class=\"carousel slide pointer-event\"\n :class=\"computedClasses\"\n >\n <div\n v-if=\"props.indicators\"\n class=\"carousel-indicators\"\n :aria-label=\"props.labelIndicators\"\n :aria-owns=\"buttonOwnership\"\n >\n <!-- :data-bs-target=\"`#${computedId}`\" is required since the classes target elems with that attr -->\n <button\n v-for=\"(_, i) in slides.length\"\n :key=\"i\"\n type=\"button\"\n data-bs-target=\"\"\n :class=\"i === modelValue ? 'active' : ''\"\n :aria-current=\"i === modelValue ? true : undefined\"\n :aria-label=\"`${props.indicatorsButtonLabel} ${i}`\"\n :aria-controls=\"buttonOwnership\"\n :aria-describedby=\"slideValues?.[i]?._id\"\n @click=\"goToValue(i)\"\n />\n </div>\n\n <div ref=\"_relatedTarget\" class=\"carousel-inner\">\n <TransitionGroup\n :enter-from-class=\"enterClasses\"\n :enter-active-class=\"enterClasses\"\n :enter-to-class=\"enterClasses\"\n :leave-from-class=\"leaveClasses\"\n :leave-active-class=\"leaveClasses\"\n :leave-to-class=\"leaveClasses\"\n @before-leave=\"onBeforeLeave\"\n @after-leave=\"onAfterLeave\"\n @after-enter=\"onAfterEnter\"\n @enter=\"onEnter\"\n >\n <component\n :is=\"slide\"\n v-for=\"(slide, i) in slides\"\n v-show=\"i === modelValue\"\n :key=\"i\"\n ref=\"_slideValues\"\n :class=\"{active: i === modelValue && isTransitioning === false}\"\n :style=\"props.noAnimation && {transition: 'none'}\"\n />\n </TransitionGroup>\n </div>\n\n <template v-if=\"props.controls\">\n <button class=\"carousel-control-prev\" type=\"button\" @click=\"onClickPrev\">\n <span class=\"carousel-control-prev-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsPrevText }}</span>\n </button>\n <button class=\"carousel-control-next\" type=\"button\" @click=\"onClickNext\">\n <span class=\"carousel-control-next-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsNextText }}</span>\n </button>\n </template>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {BvCarouselEvent} from '../../utils'\nimport {computed, onMounted, provide, ref, toRef, useTemplateRef, watch} from 'vue'\nimport {useId} from '../../composables/useId'\nimport type {BCarouselProps} from '../../types/ComponentProps'\nimport {onKeyStroke, useElementHover, useIntervalFn, useSwipe, useToNumber} from '@vueuse/core'\nimport type BCarouselSlide from './BCarouselSlide.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {Numberish} from '../../types/CommonTypes'\nimport {getSlotElements} from '../../utils/getSlotElements'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport type {BCarouselEmits, BCarouselSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<Omit<BCarouselProps, 'modelValue'>>(), {\n background: undefined,\n controls: false,\n controlsNextText: 'Next',\n controlsPrevText: 'Previous',\n fade: false,\n id: undefined,\n imgHeight: undefined,\n imgWidth: undefined,\n indicators: false,\n indicatorsButtonLabel: 'Slide',\n interval: 5000,\n labelIndicators: 'Select a slide to display',\n keyboard: true,\n noAnimation: false,\n noHoverPause: false,\n noTouch: false,\n noWrap: false,\n ride: false,\n rideReverse: false,\n touchThreshold: 50,\n})\nconst props = useDefaults(_props, 'BCarousel')\nconst emit = defineEmits<BCarouselEmits>()\nconst slots = defineSlots<BCarouselSlots>()\n\nconst computedId = useId(() => props.id, 'carousel')\nconst buttonOwnership = useId(undefined, 'carousel-button-ownership')\n\nconst modelValue = defineModel<Exclude<BCarouselProps['modelValue'], undefined>>({default: 0})\n\nconst slideValues = useTemplateRef<InstanceType<typeof BCarouselSlide>[]>('_slideValues')\n\nconst touchThresholdNumber = useToNumber(() => props.touchThreshold)\nconst slideInterval = ref<Numberish | null>(null)\nonMounted(() => {\n slideInterval.value =\n slideValues.value?.find((slid) => slid.$el.style.display !== 'none')?._interval ?? null\n})\nconst intervalNumber = useToNumber(() => slideInterval.value ?? props.interval)\n\nconst isTransitioning = ref(false)\nconst rideStarted = ref(false)\nconst direction = ref(true)\nconst relatedTarget = useTemplateRef('_relatedTarget')\nconst element = useTemplateRef('_element')\nconst previousModelValue = ref(modelValue.value)\n\nconst isHovering = useElementHover(element)\n\n// Class carousel-item is a static property\n// If you make it static, the direction can be reversed -- properly (atm it does the carousel-item-${} logic backwards for entering, a weird hack)\n// So all that would be great. However, when you do this, it will break the transition flow. Something about it breaks and I'm not sure why!\n// Try it by removing carousel-item from below and making `!direction.value` => `direction.value` for enter\n// Then reviewing the behavior\nconst enterClasses = computed(\n () =>\n `carousel-item carousel-item-${!direction.value ? 'next' : 'prev'} carousel-item-${\n !direction.value ? 'start' : 'end'\n }`\n)\nconst leaveClasses = computed(\n () => `carousel-item active carousel-item-${direction.value ? 'start' : 'end'}`\n)\n\nconst {pause, resume} = useIntervalFn(\n () => {\n if (props.rideReverse) {\n prev()\n return\n }\n next()\n },\n intervalNumber,\n {immediate: props.ride === 'carousel'}\n)\n\nconst isRiding = computed(\n () => (props.ride === true && rideStarted.value === true) || props.ride === 'carousel'\n)\nconst slides = computed(() => getSlotElements(slots.default, 'BCarouselSlide'))\nconst computedClasses = computed(() => ({'carousel-fade': props.fade}))\n\nconst buildBvCarouselEvent = (event: 'slid' | 'slide') =>\n new BvCarouselEvent(event, {\n componentId: computedId.value,\n cancelable: false,\n target: element.value,\n direction: direction.value ? 'right' : 'left',\n from: previousModelValue.value,\n to: modelValue.value,\n relatedTarget: relatedTarget.value?.children[modelValue.value] ?? null,\n })\n\nconst goToValue = (value: number): void => {\n if (isTransitioning.value === true) return\n\n if (props.ride === true) {\n rideStarted.value = true\n }\n if (isRiding.value === true) {\n resume()\n }\n direction.value = value < modelValue.value ? false : true\n if (value >= slides.value.length) {\n if (props.noWrap) return\n modelValue.value = 0\n return\n }\n if (value < 0) {\n if (props.noWrap) return\n modelValue.value = slides.value.length - 1\n return\n }\n previousModelValue.value = modelValue.value\n modelValue.value = value\n}\n\nconst prev = (): void => {\n goToValue(modelValue.value - 1)\n}\nconst next = (): void => {\n goToValue(modelValue.value + 1)\n}\n\nconst onKeydown = (fn: () => void) => {\n if (props.keyboard === false) return\n fn()\n}\n\nconst onMouseEnter = () => {\n if (props.noHoverPause) return\n pause()\n}\nconst onMouseLeave = () => {\n if (!isRiding.value) return\n resume()\n}\n\nconst {lengthX} = useSwipe(element, {\n passive: true,\n onSwipeStart() {\n if (props.noTouch === true) return\n pause()\n },\n onSwipeEnd() {\n if (props.noTouch === true) return\n const resumeRiding = () => {\n if (isRiding.value === false) return\n resume()\n }\n if (lengthX.value >= touchThresholdNumber.value) {\n next()\n resumeRiding()\n return\n }\n if (lengthX.value <= -touchThresholdNumber.value) {\n prev()\n resumeRiding()\n }\n },\n})\n\nconst onBeforeLeave = () => {\n emit('slide', buildBvCarouselEvent('slide'))\n isTransitioning.value = true\n}\nconst onAfterLeave = () => {\n emit('slid', buildBvCarouselEvent('slid'))\n isTransitioning.value = false\n}\n// carousel-item class is removed from the slide during the transition,\n// as is included within enter classes.\n// The first slide recovers carousel-item class,\nconst onAfterEnter = (el: Readonly<Element>) => {\n if (modelValue.value !== 0) {\n el.classList.add('carousel-item')\n }\n}\nconst onEnter = (el: Readonly<Element>) => {\n slideInterval.value = slideValues.value?.find((slid) => slid.$el === el)?._interval ?? null\n}\n\nonKeyStroke(\n 'ArrowLeft',\n () => {\n onKeydown(prev)\n },\n {target: element}\n)\nonKeyStroke(\n 'ArrowRight',\n () => {\n onKeydown(next)\n },\n {target: element, passive: true}\n)\n\nwatch(\n () => props.ride,\n () => {\n rideStarted.value = false\n }\n)\n\nwatch(isHovering, (newValue) => {\n if (newValue) {\n onMouseEnter()\n return\n }\n onMouseLeave()\n})\n\nconst onClickPrev = (event: MouseEvent) => {\n emit('prev-click', event)\n if (event.defaultPrevented) return\n prev()\n}\nconst onClickNext = (event: MouseEvent) => {\n emit('next-click', event)\n if (event.defaultPrevented) return\n next()\n}\n\ndefineExpose({\n next,\n pause,\n prev,\n resume,\n})\n\nprovide(carouselInjectionKey, {\n background: toRef(() => props.background),\n width: toRef(() => props.imgWidth),\n height: toRef(() => props.imgHeight),\n})\n</script>\n","<template>\n <div\n :id=\"computedId\"\n ref=\"_element\"\n class=\"carousel slide pointer-event\"\n :class=\"computedClasses\"\n >\n <div\n v-if=\"props.indicators\"\n class=\"carousel-indicators\"\n :aria-label=\"props.labelIndicators\"\n :aria-owns=\"buttonOwnership\"\n >\n <!-- :data-bs-target=\"`#${computedId}`\" is required since the classes target elems with that attr -->\n <button\n v-for=\"(_, i) in slides.length\"\n :key=\"i\"\n type=\"button\"\n data-bs-target=\"\"\n :class=\"i === modelValue ? 'active' : ''\"\n :aria-current=\"i === modelValue ? true : undefined\"\n :aria-label=\"`${props.indicatorsButtonLabel} ${i}`\"\n :aria-controls=\"buttonOwnership\"\n :aria-describedby=\"slideValues?.[i]?._id\"\n @click=\"goToValue(i)\"\n />\n </div>\n\n <div ref=\"_relatedTarget\" class=\"carousel-inner\">\n <TransitionGroup\n :enter-from-class=\"enterClasses\"\n :enter-active-class=\"enterClasses\"\n :enter-to-class=\"enterClasses\"\n :leave-from-class=\"leaveClasses\"\n :leave-active-class=\"leaveClasses\"\n :leave-to-class=\"leaveClasses\"\n @before-leave=\"onBeforeLeave\"\n @after-leave=\"onAfterLeave\"\n @after-enter=\"onAfterEnter\"\n @enter=\"onEnter\"\n >\n <component\n :is=\"slide\"\n v-for=\"(slide, i) in slides\"\n v-show=\"i === modelValue\"\n :key=\"i\"\n ref=\"_slideValues\"\n :class=\"{active: i === modelValue && isTransitioning === false}\"\n :style=\"props.noAnimation && {transition: 'none'}\"\n />\n </TransitionGroup>\n </div>\n\n <template v-if=\"props.controls\">\n <button class=\"carousel-control-prev\" type=\"button\" @click=\"onClickPrev\">\n <span class=\"carousel-control-prev-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsPrevText }}</span>\n </button>\n <button class=\"carousel-control-next\" type=\"button\" @click=\"onClickNext\">\n <span class=\"carousel-control-next-icon\" aria-hidden=\"true\" />\n <span class=\"visually-hidden\">{{ props.controlsNextText }}</span>\n </button>\n </template>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {BvCarouselEvent} from '../../utils'\nimport {computed, onMounted, provide, ref, toRef, useTemplateRef, watch} from 'vue'\nimport {useId} from '../../composables/useId'\nimport type {BCarouselProps} from '../../types/ComponentProps'\nimport {onKeyStroke, useElementHover, useIntervalFn, useSwipe, useToNumber} from '@vueuse/core'\nimport type BCarouselSlide from './BCarouselSlide.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {Numberish} from '../../types/CommonTypes'\nimport {getSlotElements} from '../../utils/getSlotElements'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport type {BCarouselEmits, BCarouselSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<Omit<BCarouselProps, 'modelValue'>>(), {\n background: undefined,\n controls: false,\n controlsNextText: 'Next',\n controlsPrevText: 'Previous',\n fade: false,\n id: undefined,\n imgHeight: undefined,\n imgWidth: undefined,\n indicators: false,\n indicatorsButtonLabel: 'Slide',\n interval: 5000,\n labelIndicators: 'Select a slide to display',\n keyboard: true,\n noAnimation: false,\n noHoverPause: false,\n noTouch: false,\n noWrap: false,\n ride: false,\n rideReverse: false,\n touchThreshold: 50,\n})\nconst props = useDefaults(_props, 'BCarousel')\nconst emit = defineEmits<BCarouselEmits>()\nconst slots = defineSlots<BCarouselSlots>()\n\nconst computedId = useId(() => props.id, 'carousel')\nconst buttonOwnership = useId(undefined, 'carousel-button-ownership')\n\nconst modelValue = defineModel<Exclude<BCarouselProps['modelValue'], undefined>>({default: 0})\n\nconst slideValues = useTemplateRef<InstanceType<typeof BCarouselSlide>[]>('_slideValues')\n\nconst touchThresholdNumber = useToNumber(() => props.touchThreshold)\nconst slideInterval = ref<Numberish | null>(null)\nonMounted(() => {\n slideInterval.value =\n slideValues.value?.find((slid) => slid.$el.style.display !== 'none')?._interval ?? null\n})\nconst intervalNumber = useToNumber(() => slideInterval.value ?? props.interval)\n\nconst isTransitioning = ref(false)\nconst rideStarted = ref(false)\nconst direction = ref(true)\nconst relatedTarget = useTemplateRef('_relatedTarget')\nconst element = useTemplateRef('_element')\nconst previousModelValue = ref(modelValue.value)\n\nconst isHovering = useElementHover(element)\n\n// Class carousel-item is a static property\n// If you make it static, the direction can be reversed -- properly (atm it does the carousel-item-${} logic backwards for entering, a weird hack)\n// So all that would be great. However, when you do this, it will break the transition flow. Something about it breaks and I'm not sure why!\n// Try it by removing carousel-item from below and making `!direction.value` => `direction.value` for enter\n// Then reviewing the behavior\nconst enterClasses = computed(\n () =>\n `carousel-item carousel-item-${!direction.value ? 'next' : 'prev'} carousel-item-${\n !direction.value ? 'start' : 'end'\n }`\n)\nconst leaveClasses = computed(\n () => `carousel-item active carousel-item-${direction.value ? 'start' : 'end'}`\n)\n\nconst {pause, resume} = useIntervalFn(\n () => {\n if (props.rideReverse) {\n prev()\n return\n }\n next()\n },\n intervalNumber,\n {immediate: props.ride === 'carousel'}\n)\n\nconst isRiding = computed(\n () => (props.ride === true && rideStarted.value === true) || props.ride === 'carousel'\n)\nconst slides = computed(() => getSlotElements(slots.default, 'BCarouselSlide'))\nconst computedClasses = computed(() => ({'carousel-fade': props.fade}))\n\nconst buildBvCarouselEvent = (event: 'slid' | 'slide') =>\n new BvCarouselEvent(event, {\n componentId: computedId.value,\n cancelable: false,\n target: element.value,\n direction: direction.value ? 'right' : 'left',\n from: previousModelValue.value,\n to: modelValue.value,\n relatedTarget: relatedTarget.value?.children[modelValue.value] ?? null,\n })\n\nconst goToValue = (value: number): void => {\n if (isTransitioning.value === true) return\n\n if (props.ride === true) {\n rideStarted.value = true\n }\n if (isRiding.value === true) {\n resume()\n }\n direction.value = value < modelValue.value ? false : true\n if (value >= slides.value.length) {\n if (props.noWrap) return\n modelValue.value = 0\n return\n }\n if (value < 0) {\n if (props.noWrap) return\n modelValue.value = slides.value.length - 1\n return\n }\n previousModelValue.value = modelValue.value\n modelValue.value = value\n}\n\nconst prev = (): void => {\n goToValue(modelValue.value - 1)\n}\nconst next = (): void => {\n goToValue(modelValue.value + 1)\n}\n\nconst onKeydown = (fn: () => void) => {\n if (props.keyboard === false) return\n fn()\n}\n\nconst onMouseEnter = () => {\n if (props.noHoverPause) return\n pause()\n}\nconst onMouseLeave = () => {\n if (!isRiding.value) return\n resume()\n}\n\nconst {lengthX} = useSwipe(element, {\n passive: true,\n onSwipeStart() {\n if (props.noTouch === true) return\n pause()\n },\n onSwipeEnd() {\n if (props.noTouch === true) return\n const resumeRiding = () => {\n if (isRiding.value === false) return\n resume()\n }\n if (lengthX.value >= touchThresholdNumber.value) {\n next()\n resumeRiding()\n return\n }\n if (lengthX.value <= -touchThresholdNumber.value) {\n prev()\n resumeRiding()\n }\n },\n})\n\nconst onBeforeLeave = () => {\n emit('slide', buildBvCarouselEvent('slide'))\n isTransitioning.value = true\n}\nconst onAfterLeave = () => {\n emit('slid', buildBvCarouselEvent('slid'))\n isTransitioning.value = false\n}\n// carousel-item class is removed from the slide during the transition,\n// as is included within enter classes.\n// The first slide recovers carousel-item class,\nconst onAfterEnter = (el: Readonly<Element>) => {\n if (modelValue.value !== 0) {\n el.classList.add('carousel-item')\n }\n}\nconst onEnter = (el: Readonly<Element>) => {\n slideInterval.value = slideValues.value?.find((slid) => slid.$el === el)?._interval ?? null\n}\n\nonKeyStroke(\n 'ArrowLeft',\n () => {\n onKeydown(prev)\n },\n {target: element}\n)\nonKeyStroke(\n 'ArrowRight',\n () => {\n onKeydown(next)\n },\n {target: element, passive: true}\n)\n\nwatch(\n () => props.ride,\n () => {\n rideStarted.value = false\n }\n)\n\nwatch(isHovering, (newValue) => {\n if (newValue) {\n onMouseEnter()\n return\n }\n onMouseLeave()\n})\n\nconst onClickPrev = (event: MouseEvent) => {\n emit('prev-click', event)\n if (event.defaultPrevented) return\n prev()\n}\nconst onClickNext = (event: MouseEvent) => {\n emit('next-click', event)\n if (event.defaultPrevented) return\n next()\n}\n\ndefineExpose({\n next,\n pause,\n prev,\n resume,\n})\n\nprovide(carouselInjectionKey, {\n background: toRef(() => props.background),\n width: toRef(() => props.imgWidth),\n height: toRef(() => props.imgHeight),\n})\n</script>\n","<template>\n <div :id=\"computedId\" class=\"carousel-item\" :style=\"computedStyle\">\n <slot name=\"img\">\n <BImg\n class=\"d-block w-100\"\n :alt=\"props.imgAlt\"\n :srcset=\"props.imgSrcset\"\n :src=\"props.imgSrc\"\n :width=\"props.imgWidth || parentData?.width.value\"\n :height=\"props.imgHeight || parentData?.height.value\"\n :blank=\"props.imgBlank\"\n :blank-color=\"props.imgBlankColor\"\n />\n </slot>\n <component\n :is=\"props.contentTag\"\n v-if=\"hasContent\"\n class=\"carousel-caption\"\n :class=\"computedContentClasses\"\n >\n <component :is=\"props.captionTag\" v-if=\"hasCaption\">\n <slot name=\"caption\">\n <span>{{ props.caption }}</span>\n </slot>\n </component>\n <component :is=\"props.textTag\" v-if=\"hasText\">\n <slot name=\"text\">\n <span>{{ props.text }}</span>\n </slot>\n </component>\n <slot />\n </component>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, type CSSProperties, inject, toRef} from 'vue'\nimport type {BCarouselSlideProps} from '../../types/ComponentProps'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport BImg from '../BImg/BImg.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {isEmptySlot} from '../../utils/dom'\nimport {useId} from '../../composables/useId'\nimport type {BCarouselSlideSlots} from '../../types/ComponentSlots'\n\nconst _props = withDefaults(defineProps<BCarouselSlideProps>(), {\n background: undefined,\n caption: undefined,\n captionTag: 'h3',\n contentTag: 'div',\n contentVisibleUp: undefined,\n id: undefined,\n imgAlt: undefined,\n imgBlank: false,\n imgBlankColor: 'transparent',\n imgHeight: undefined,\n imgSrc: undefined,\n imgSrcset: undefined,\n imgWidth: undefined,\n interval: undefined,\n text: undefined,\n textTag: 'p',\n})\nconst props = useDefaults(_props, 'BCarouselSlide')\nconst slots = defineSlots<BCarouselSlideSlots>()\n\nconst computedId = useId(() => props.id, 'carousel-slide')\nconst parentData = inject(carouselInjectionKey, null)\n\nconst hasText = computed(() => props.text || !isEmptySlot(slots.text))\nconst hasCaption = computed(() => props.caption || !isEmptySlot(slots.caption))\nconst hasContent = computed(() => hasText.value || hasCaption.value || !isEmptySlot(slots.default))\n\nconst computedStyle = computed<CSSProperties>(() => ({\n background: `${\n props.background || parentData?.background.value || 'rgb(171, 171, 171)'\n } none repeat scroll 0% 0%`,\n}))\n\nconst computedContentClasses = computed(() => ({\n 'd-none': props.contentVisibleUp !== undefined,\n [`d-${props.contentVisibleUp}-block`]: props.contentVisibleUp !== undefined,\n}))\n\ndefineExpose({\n _interval: toRef(() => props.interval),\n _id: computedId,\n})\n</script>\n","<template>\n <div :id=\"computedId\" class=\"carousel-item\" :style=\"computedStyle\">\n <slot name=\"img\">\n <BImg\n class=\"d-block w-100\"\n :alt=\"props.imgAlt\"\n :srcset=\"props.imgSrcset\"\n :src=\"props.imgSrc\"\n :width=\"props.imgWidth || parentData?.width.value\"\n :height=\"props.imgHeight || parentData?.height.value\"\n :blank=\"props.imgBlank\"\n :blank-color=\"props.imgBlankColor\"\n />\n </slot>\n <component\n :is=\"props.contentTag\"\n v-if=\"hasContent\"\n class=\"carousel-caption\"\n :class=\"computedContentClasses\"\n >\n <component :is=\"props.captionTag\" v-if=\"hasCaption\">\n <slot name=\"caption\">\n <span>{{ props.caption }}</span>\n </slot>\n </component>\n <component :is=\"props.textTag\" v-if=\"hasText\">\n <slot name=\"text\">\n <span>{{ props.text }}</span>\n </slot>\n </component>\n <slot />\n </component>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {computed, type CSSProperties, inject, toRef} from 'vue'\nimport type {BCarouselSlideProps} from '../../types/ComponentProps'\nimport {carouselInjectionKey} from '../../utils/keys'\nimport BImg from '../BImg/BImg.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {isEmptySlot} from '../../utils/dom'\nimport {useId} from '../../composables/useId'\nimport type {BCarouselSlideSlots} from '../../types/ComponentSlots'\n\nconst _props = withDefaults(defineProps<BCarouselSlideProps>(), {\n background: undefined,\n caption: undefined,\n captionTag: 'h3',\n contentTag: 'div',\n contentVisibleUp: undefined,\n id: undefined,\n imgAlt: undefined,\n imgBlank: false,\n imgBlankColor: 'transparent',\n imgHeight: undefined,\n imgSrc: undefined,\n imgSrcset: undefined,\n imgWidth: undefined,\n interval: undefined,\n text: undefined,\n textTag: 'p',\n})\nconst props = useDefaults(_props, 'BCarouselSlide')\nconst slots = defineSlots<BCarouselSlideSlots>()\n\nconst computedId = useId(() => props.id, 'carousel-slide')\nconst parentData = inject(carouselInjectionKey, null)\n\nconst hasText = computed(() => props.text || !isEmptySlot(slots.text))\nconst hasCaption = computed(() => props.caption || !isEmptySlot(slots.caption))\nconst hasContent = computed(() => hasText.value || hasCaption.value || !isEmptySlot(slots.default))\n\nconst computedStyle = computed<CSSProperties>(() => ({\n background: `${\n props.background || parentData?.background.value || 'rgb(171, 171, 171)'\n } none repeat scroll 0% 0%`,\n}))\n\nconst computedContentClasses = computed(() => ({\n 'd-none': props.contentVisibleUp !== undefined,\n [`d-${props.contentVisibleUp}-block`]: props.contentVisibleUp !== undefined,\n}))\n\ndefineExpose({\n _interval: toRef(() => props.interval),\n _id: computedId,\n})\n</script>\n"],"mappings":";;;;;;;;;AAEA,IAAa,mBAAmB,MAAwB,cACrD,QAAQ,IAAI,EAAE,EACZ,QAAQ,KAAc,SAAgB;AACrC,KAAI,OAAO,KAAK,SAAS,SACvB,OAAM,IAAI,OAAO,KAAK,SAA6B;KAEnD,KAAI,KAAK,KAAK;AAEhB,QAAO;GACN,EAAE,CAAC,CACL,QAAQ,UAAW,MAAM,MAAuC,WAAW,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ECyFzF,MAAM,QAAQ,YAtBC,SAsBmB,YAAW;EAC7C,MAAM,OAAO;EACb,MAAM,QAAQ,UAAA;EAEd,MAAM,aAAa,cAAY,MAAM,IAAI,WAAU;EACnD,MAAM,kBAAkB,QAAM,KAAA,GAAW,4BAA2B;EAEpE,MAAM,aAAa,SAA6D,SAAA,aAAa;EAE7F,MAAM,cAAc,eAAsD,eAAc;EAExF,MAAM,uBAAuB,kBAAkB,MAAM,eAAc;EACnE,MAAM,gBAAgB,IAAsB,KAAI;AAChD,kBAAgB;AACd,iBAAc,QACZ,YAAY,OAAO,MAAM,SAAS,KAAK,IAAI,MAAM,YAAY,OAAO,EAAE,aAAa;IACtF;EACD,MAAM,iBAAiB,kBAAkB,cAAc,SAAS,MAAM,SAAQ;EAE9E,MAAM,kBAAkB,IAAI,MAAK;EACjC,MAAM,cAAc,IAAI,MAAK;EAC7B,MAAM,YAAY,IAAI,KAAI;EAC1B,MAAM,gBAAgB,eAAe,iBAAgB;EACrD,MAAM,UAAU,eAAe,WAAU;EACzC,MAAM,qBAAqB,IAAI,WAAW,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