bootstrap-vue-next 0.44.7 → 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 (185) 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/{BDropdown-C1AxRj81.js → BDropdown-BxciLgyt.js} +15 -16
  22. package/dist/BDropdown-BxciLgyt.js.map +1 -0
  23. package/dist/{BDropdown-BW_O8vPQ.mjs → BDropdown-CRIh9xqy.mjs} +2 -2
  24. package/dist/{BDropdown-BW_O8vPQ.mjs.map → BDropdown-CRIh9xqy.mjs.map} +1 -1
  25. package/dist/{BDropdown-DAHnN54Z.mjs → BDropdown-D2pBrZsG.mjs} +15 -16
  26. package/dist/BDropdown-D2pBrZsG.mjs.map +1 -0
  27. package/dist/{BDropdown-CuVOxCzu.js → BDropdown-DgbFCKfP.js} +2 -2
  28. package/dist/{BDropdown-CuVOxCzu.js.map → BDropdown-DgbFCKfP.js.map} +1 -1
  29. package/dist/{BFormCheckbox-Bdk2rgVe.js → BFormCheckbox-BPQxUDQG.js} +5 -5
  30. package/dist/BFormCheckbox-BPQxUDQG.js.map +1 -0
  31. package/dist/{BFormCheckbox-CcDK-lh1.mjs → BFormCheckbox-DPNPjRKN.mjs} +5 -5
  32. package/dist/BFormCheckbox-DPNPjRKN.mjs.map +1 -0
  33. package/dist/{BFormRadio-DuVYw-Vs.js → BFormRadio-BZ0etDxl.js} +5 -5
  34. package/dist/BFormRadio-BZ0etDxl.js.map +1 -0
  35. package/dist/{BFormRadio-CRDbgMiR.mjs → BFormRadio-CqYd0bLV.mjs} +5 -5
  36. package/dist/BFormRadio-CqYd0bLV.mjs.map +1 -0
  37. package/dist/{BFormSelect-DIKVsG--.js → BFormSelect-B_mbfTMC.js} +5 -5
  38. package/dist/BFormSelect-B_mbfTMC.js.map +1 -0
  39. package/dist/{BFormSelect-Bb8yE8vz.mjs → BFormSelect-CpkJ1haI.mjs} +5 -5
  40. package/dist/BFormSelect-CpkJ1haI.mjs.map +1 -0
  41. package/dist/{BFormTags-BFA6xbr3.js → BFormTags-DJzXJp7d.js} +3 -3
  42. package/dist/BFormTags-DJzXJp7d.js.map +1 -0
  43. package/dist/{BFormTags-CJb4H67g.mjs → BFormTags-DWAWX2av.mjs} +3 -3
  44. package/dist/BFormTags-DWAWX2av.mjs.map +1 -0
  45. package/dist/{BInputGroup-BScMw6Zr.js → BInputGroup-Bfcs5h_Q.js} +2 -2
  46. package/dist/{BInputGroup-BScMw6Zr.js.map → BInputGroup-Bfcs5h_Q.js.map} +1 -1
  47. package/dist/{BInputGroup-DpX10xwR.mjs → BInputGroup-C5sxenhE.mjs} +3 -3
  48. package/dist/BInputGroup-C5sxenhE.mjs.map +1 -0
  49. package/dist/{BInputGroup-Duk6Jk0v.js → BInputGroup-DTP5Vf1f.js} +3 -3
  50. package/dist/BInputGroup-DTP5Vf1f.js.map +1 -0
  51. package/dist/{BInputGroup-C7k0tS9j.mjs → BInputGroup-Dl9AgpAx.mjs} +2 -2
  52. package/dist/{BInputGroup-C7k0tS9j.mjs.map → BInputGroup-Dl9AgpAx.mjs.map} +1 -1
  53. package/dist/{BModal-D0LB339D.js → BModal-BnHYbFuj.js} +5 -5
  54. package/dist/BModal-BnHYbFuj.js.map +1 -0
  55. package/dist/{BModal-Br5xLT0-.mjs → BModal-CAjLrkBp.mjs} +5 -5
  56. package/dist/BModal-CAjLrkBp.mjs.map +1 -0
  57. package/dist/{BNav-BRjdHsjC.mjs → BNav-BdO2N7G0.mjs} +4 -3
  58. package/dist/{BNav-BRjdHsjC.mjs.map → BNav-BdO2N7G0.mjs.map} +1 -1
  59. package/dist/{BNav-tYBwz1wU.js → BNav-MjroX-Jl.js} +4 -3
  60. package/dist/{BNav-tYBwz1wU.js.map → BNav-MjroX-Jl.js.map} +1 -1
  61. package/dist/{BOffcanvas-D33pEfZe.js → BOffcanvas-ColOuYdV.js} +2 -2
  62. package/dist/{BOffcanvas-D33pEfZe.js.map → BOffcanvas-ColOuYdV.js.map} +1 -1
  63. package/dist/{BOffcanvas-jETHbtC3.mjs → BOffcanvas-DmkJSSFy.mjs} +2 -2
  64. package/dist/{BOffcanvas-jETHbtC3.mjs.map → BOffcanvas-DmkJSSFy.mjs.map} +1 -1
  65. package/dist/{BPlaceholder-C4AOg29f.mjs → BPlaceholder-DKDtjMjy.mjs} +9 -9
  66. package/dist/BPlaceholder-DKDtjMjy.mjs.map +1 -0
  67. package/dist/{BPlaceholder-DYYYuNgR.js → BPlaceholder-n447tOzJ.js} +9 -9
  68. package/dist/BPlaceholder-n447tOzJ.js.map +1 -0
  69. package/dist/{BToast-DCSZYXIi.js → BToast-BFcT76M1.js} +2 -2
  70. package/dist/{BToast-DCSZYXIi.js.map → BToast-BFcT76M1.js.map} +1 -1
  71. package/dist/{BToast-B2rFKhLD.mjs → BToast-D5XkJqF4.mjs} +2 -2
  72. package/dist/{BToast-B2rFKhLD.mjs.map → BToast-D5XkJqF4.mjs.map} +1 -1
  73. package/dist/{BTooltip-CryTO-SM.js → BTooltip-BwiqjqX-.js} +2 -2
  74. package/dist/{BTooltip-CryTO-SM.js.map → BTooltip-BwiqjqX-.js.map} +1 -1
  75. package/dist/{BTooltip-DtpjIEBu.mjs → BTooltip-DohT1Q3C.mjs} +2 -2
  76. package/dist/{BTooltip-DtpjIEBu.mjs.map → BTooltip-DohT1Q3C.mjs.map} +1 -1
  77. package/dist/bootstrap-vue-next.mjs +20 -20
  78. package/dist/bootstrap-vue-next.umd.js +20 -20
  79. package/dist/components/BContainer/BCol.vue.d.mts +1 -1
  80. package/dist/components/BContainer/BCol.vue.d.ts +1 -1
  81. package/dist/components/BDropdown/BDropdown.vue.d.mts +1 -0
  82. package/dist/components/BDropdown/BDropdown.vue.d.ts +1 -0
  83. package/dist/components/BNav/BNavItemDropdown.vue.d.mts +13 -2
  84. package/dist/components/BNav/BNavItemDropdown.vue.d.ts +13 -2
  85. package/dist/{floatingUi-DHMrP__c.mjs → floatingUi-BAUk171g.mjs} +10 -2
  86. package/dist/{floatingUi-DHMrP__c.mjs.map → floatingUi-BAUk171g.mjs.map} +1 -1
  87. package/dist/{floatingUi-Cs4rDXmO.js → floatingUi-DBLN9xLH.js} +15 -1
  88. package/dist/{floatingUi-Cs4rDXmO.js.map → floatingUi-DBLN9xLH.js.map} +1 -1
  89. package/dist/keys-CQKrwmvN.mjs.map +1 -1
  90. package/dist/keys-durSVUrO.js.map +1 -1
  91. package/dist/src/components/BAlert/index.mjs +1 -1
  92. package/dist/src/components/BAlert/index.umd.js +1 -1
  93. package/dist/src/components/BAutocomplete/index.mjs +1 -1
  94. package/dist/src/components/BAutocomplete/index.umd.js +1 -1
  95. package/dist/src/components/BAvatar/index.mjs +1 -1
  96. package/dist/src/components/BAvatar/index.umd.js +1 -1
  97. package/dist/src/components/BButton/index.mjs +2 -2
  98. package/dist/src/components/BButton/index.umd.js +2 -2
  99. package/dist/src/components/BDropdown/index.mjs +2 -2
  100. package/dist/src/components/BDropdown/index.umd.js +2 -2
  101. package/dist/src/components/BFormCheckbox/index.mjs +1 -1
  102. package/dist/src/components/BFormCheckbox/index.umd.js +1 -1
  103. package/dist/src/components/BFormRadio/index.mjs +1 -1
  104. package/dist/src/components/BFormRadio/index.umd.js +1 -1
  105. package/dist/src/components/BFormSelect/index.mjs +1 -1
  106. package/dist/src/components/BFormSelect/index.umd.js +1 -1
  107. package/dist/src/components/BFormTags/index.mjs +1 -1
  108. package/dist/src/components/BFormTags/index.umd.js +1 -1
  109. package/dist/src/components/BInputGroup/index.mjs +2 -2
  110. package/dist/src/components/BInputGroup/index.umd.js +2 -2
  111. package/dist/src/components/BModal/index.mjs +1 -1
  112. package/dist/src/components/BModal/index.umd.js +1 -1
  113. package/dist/src/components/BNav/index.mjs +1 -1
  114. package/dist/src/components/BNav/index.umd.js +1 -1
  115. package/dist/src/components/BOffcanvas/index.mjs +1 -1
  116. package/dist/src/components/BOffcanvas/index.umd.js +1 -1
  117. package/dist/src/components/BPlaceholder/index.mjs +1 -1
  118. package/dist/src/components/BPlaceholder/index.umd.js +1 -1
  119. package/dist/src/components/BPopover/index.mjs +1 -1
  120. package/dist/src/components/BPopover/index.umd.js +1 -1
  121. package/dist/src/components/BToast/index.mjs +1 -1
  122. package/dist/src/components/BToast/index.umd.js +1 -1
  123. package/dist/src/components/BTooltip/index.mjs +1 -1
  124. package/dist/src/components/BTooltip/index.umd.js +1 -1
  125. package/dist/src/components/index.mjs +20 -20
  126. package/dist/src/components/index.umd.js +20 -20
  127. package/dist/src/composables/useModal/index.mjs +1 -1
  128. package/dist/src/composables/useModal/index.umd.js +1 -1
  129. package/dist/src/composables/usePopover/index.mjs +2 -2
  130. package/dist/src/composables/usePopover/index.umd.js +2 -2
  131. package/dist/src/composables/useToast/index.mjs +1 -1
  132. package/dist/src/composables/useToast/index.umd.js +1 -1
  133. package/dist/src/directives/BPopover/index.mjs +2 -2
  134. package/dist/src/directives/BPopover/index.umd.js +2 -2
  135. package/dist/src/directives/BScrollspy/index.mjs +1 -1
  136. package/dist/src/directives/BScrollspy/index.umd.js +1 -1
  137. package/dist/src/directives/BToggle/index.mjs +1 -1
  138. package/dist/src/directives/BToggle/index.umd.js +1 -1
  139. package/dist/src/directives/BTooltip/index.mjs +2 -2
  140. package/dist/src/directives/BTooltip/index.umd.js +2 -2
  141. package/dist/types/ComponentProps.d.mts +1 -0
  142. package/dist/types/ComponentProps.d.ts +1 -0
  143. package/dist/types/ComponentSlots.d.mts +2 -1
  144. package/dist/types/ComponentSlots.d.ts +2 -1
  145. package/dist/types/Size.d.mts +0 -1
  146. package/dist/types/Size.d.ts +0 -1
  147. package/dist/{useFormCheck-CJvIDxcO.mjs → useFormCheck-CbRHduFK.mjs} +3 -3
  148. package/dist/useFormCheck-CbRHduFK.mjs.map +1 -0
  149. package/dist/{useFormCheck-UHNy_iZ0.js → useFormCheck-Cj5K6pk-.js} +3 -3
  150. package/dist/useFormCheck-Cj5K6pk-.js.map +1 -0
  151. package/dist/utils/floatingUi.d.mts +1 -0
  152. package/dist/utils/floatingUi.d.ts +1 -0
  153. package/dist/utils/keys.d.mts +2 -2
  154. package/dist/utils/keys.d.ts +2 -2
  155. package/dist/{utils-CgwCsk6U.mjs → utils-D30CwVm-.mjs} +3 -4
  156. package/dist/utils-D30CwVm-.mjs.map +1 -0
  157. package/dist/{utils-CaC78Zdk.js → utils-DtPi91ue.js} +3 -4
  158. package/dist/utils-DtPi91ue.js.map +1 -0
  159. package/package.json +1 -1
  160. package/dist/BAvatar-D7aFEXLH.mjs.map +0 -1
  161. package/dist/BAvatar-lefHkDuG.js.map +0 -1
  162. package/dist/BButton-BRvIFnRm.mjs.map +0 -1
  163. package/dist/BButton-DBRs8Pz_.js.map +0 -1
  164. package/dist/BButton-DNmtqoqR.mjs.map +0 -1
  165. package/dist/BButton-kykTWnBy.js.map +0 -1
  166. package/dist/BDropdown-C1AxRj81.js.map +0 -1
  167. package/dist/BDropdown-DAHnN54Z.mjs.map +0 -1
  168. package/dist/BFormCheckbox-Bdk2rgVe.js.map +0 -1
  169. package/dist/BFormCheckbox-CcDK-lh1.mjs.map +0 -1
  170. package/dist/BFormRadio-CRDbgMiR.mjs.map +0 -1
  171. package/dist/BFormRadio-DuVYw-Vs.js.map +0 -1
  172. package/dist/BFormSelect-Bb8yE8vz.mjs.map +0 -1
  173. package/dist/BFormSelect-DIKVsG--.js.map +0 -1
  174. package/dist/BFormTags-BFA6xbr3.js.map +0 -1
  175. package/dist/BFormTags-CJb4H67g.mjs.map +0 -1
  176. package/dist/BInputGroup-DpX10xwR.mjs.map +0 -1
  177. package/dist/BInputGroup-Duk6Jk0v.js.map +0 -1
  178. package/dist/BModal-Br5xLT0-.mjs.map +0 -1
  179. package/dist/BModal-D0LB339D.js.map +0 -1
  180. package/dist/BPlaceholder-C4AOg29f.mjs.map +0 -1
  181. package/dist/BPlaceholder-DYYYuNgR.js.map +0 -1
  182. package/dist/useFormCheck-CJvIDxcO.mjs.map +0 -1
  183. package/dist/useFormCheck-UHNy_iZ0.js.map +0 -1
  184. package/dist/utils-CaC78Zdk.js.map +0 -1
  185. package/dist/utils-CgwCsk6U.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"BFormSelect-Bb8yE8vz.mjs","names":["$attrs"],"sources":["../src/components/BFormSelect/BFormSelectOptionGroup.vue","../src/components/BFormSelect/BFormSelectOptionGroup.vue","../src/components/BFormSelect/BFormSelectBase.vue","../src/components/BFormSelect/BFormSelectBase.vue","../src/components/BFormSelect/BFormSelect.vue","../src/components/BFormSelect/BFormSelect.vue"],"sourcesContent":["<template>\n <optgroup :label=\"props.label\">\n <slot name=\"first\" />\n <BFormSelectOption\n v-for=\"(option, index) in normalizedOptions\"\n :key=\"index\"\n v-bind=\"{...$attrs, ...option}\"\n >\n <slot name=\"option\" v-bind=\"option\">\n {{ option.text }}\n </slot>\n </BFormSelectOption>\n <slot />\n </optgroup>\n</template>\n\n<script setup lang=\"ts\" generic=\"T\">\nimport BFormSelectOption from './BFormSelectOption.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BFormSelectOptionGroupProps} from '../../types/ComponentProps'\nimport type {ComputedRef} from 'vue'\nimport {useFormSelect} from '../../composables/useFormSelect'\nimport type {SelectOption} from '../../types/SelectTypes'\nimport type {BFormSelectOptionGroupSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<BFormSelectOptionGroupProps>(), {\n disabledField: 'disabled',\n label: undefined,\n options: () => [],\n textField: 'text',\n valueField: 'value',\n})\nconst props = useDefaults(_props, 'BFormSelectOptionGroup')\ndefineSlots<BFormSelectOptionGroupSlots<T>>()\n\n// The form select context is injected by BFormSelectOption components automatically\n// We don't need to handle the selected value here since each BFormSelectOption\n// will inject the context directly\n\n// Type assertion is needed because useFormSelect is not generic-aware.\n// This is acceptable in the wrapper/base pattern where the wrapper (BFormSelect)\n// handles type-safe normalization before passing to base components.\nconst {normalizedOptions} = useFormSelect(() => props.options, props) as {\n normalizedOptions: ComputedRef<SelectOption<T>[]>\n}\n</script>\n","<template>\n <optgroup :label=\"props.label\">\n <slot name=\"first\" />\n <BFormSelectOption\n v-for=\"(option, index) in normalizedOptions\"\n :key=\"index\"\n v-bind=\"{...$attrs, ...option}\"\n >\n <slot name=\"option\" v-bind=\"option\">\n {{ option.text }}\n </slot>\n </BFormSelectOption>\n <slot />\n </optgroup>\n</template>\n\n<script setup lang=\"ts\" generic=\"T\">\nimport BFormSelectOption from './BFormSelectOption.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BFormSelectOptionGroupProps} from '../../types/ComponentProps'\nimport type {ComputedRef} from 'vue'\nimport {useFormSelect} from '../../composables/useFormSelect'\nimport type {SelectOption} from '../../types/SelectTypes'\nimport type {BFormSelectOptionGroupSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<BFormSelectOptionGroupProps>(), {\n disabledField: 'disabled',\n label: undefined,\n options: () => [],\n textField: 'text',\n valueField: 'value',\n})\nconst props = useDefaults(_props, 'BFormSelectOptionGroup')\ndefineSlots<BFormSelectOptionGroupSlots<T>>()\n\n// The form select context is injected by BFormSelectOption components automatically\n// We don't need to handle the selected value here since each BFormSelectOption\n// will inject the context directly\n\n// Type assertion is needed because useFormSelect is not generic-aware.\n// This is acceptable in the wrapper/base pattern where the wrapper (BFormSelect)\n// handles type-safe normalization before passing to base components.\nconst {normalizedOptions} = useFormSelect(() => props.options, props) as {\n normalizedOptions: ComputedRef<SelectOption<T>[]>\n}\n</script>\n","<template>\n <select\n :id=\"computedId\"\n ref=\"_input\"\n v-model=\"localValue\"\n :class=\"computedClasses\"\n :name=\"props.name\"\n :form=\"props.form || undefined\"\n :multiple=\"props.multiple || undefined\"\n :size=\"computedSelectSize\"\n :disabled=\"isDisabled\"\n :required=\"props.required || undefined\"\n :aria-required=\"props.required || undefined\"\n :aria-invalid=\"computedAriaInvalid\"\n >\n <slot name=\"first\" />\n <template v-for=\"(option, index) in normalizedOptsWrapper\" :key=\"index\">\n <BFormSelectOptionGroup\n v-if=\"isComplex(option)\"\n :label=\"option.label\"\n :options=\"option.options\"\n :value-field=\"props.valueField\"\n :text-field=\"props.textField\"\n :disabled-field=\"props.disabledField\"\n />\n <BFormSelectOption v-else v-bind=\"option\">\n <slot name=\"option\" v-bind=\"option\">\n {{ option.text }}\n </slot>\n </BFormSelectOption>\n </template>\n <slot />\n </select>\n</template>\n\n<script setup lang=\"ts\">\nimport type {BFormSelectBaseProps} from '../../types/ComponentProps'\nimport {computed, inject, provide, readonly, useTemplateRef} from 'vue'\nimport BFormSelectOption from './BFormSelectOption.vue'\nimport BFormSelectOptionGroup from './BFormSelectOptionGroup.vue'\nimport {useAriaInvalid} from '../../composables/useAriaInvalid'\nimport {useFocus, useToNumber} from '@vueuse/core'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport {useStateClass} from '../../composables/useStateClass'\nimport {useFormSelect} from '../../composables/useFormSelect'\nimport {formGroupKey, formSelectKey} from '../../utils/keys'\n\n/**\n * Base component for BFormSelect - non-generic implementation using useDefaults.\n * Renders a select element with normalized options and option groups.\n * Supports both simple options and complex grouped options.\n */\nconst _props = withDefaults(defineProps<Omit<BFormSelectBaseProps, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n labelField: 'label',\n multiple: false,\n name: undefined,\n options: () => [],\n optionsField: 'options',\n plain: false,\n required: false,\n selectSize: 0,\n size: 'md',\n state: null,\n textField: 'text',\n valueField: 'value',\n})\nconst props = useDefaults(_props, 'BFormSelect')\n\nconst modelValue = defineModel<unknown>({\n default: '',\n})\n\nconst computedId = useId(() => props.id, 'input')\n\nconst formGroupData = inject(formGroupKey, null)?.(computedId)\nconst isDisabled = computed(() => props.disabled || (formGroupData?.disabled.value ?? false))\n\nconst selectSizeNumber = useToNumber(() => props.selectSize)\n\nconst stateClass = useStateClass(() => props.state)\n\nconst input = useTemplateRef('_input')\n\nconst {focused} = useFocus(input, {\n initialValue: props.autofocus,\n})\n\nconst computedClasses = computed(() => [\n stateClass.value,\n {\n 'form-control': props.plain,\n [`form-control-${props.size}`]: props.size !== 'md' && props.plain,\n 'form-select': !props.plain,\n [`form-select-${props.size}`]: props.size !== 'md' && !props.plain,\n },\n])\n\nconst computedSelectSize = computed(() =>\n !props.plain && selectSizeNumber.value > 0 ? selectSizeNumber.value : undefined\n)\n\nconst computedAriaInvalid = useAriaInvalid(\n () => props.ariaInvalid,\n () => props.state\n)\n\nconst {normalizedOptions, isComplex} = useFormSelect(() => props.options, props)\n\nconst normalizedOptsWrapper = computed(() => normalizedOptions.value)\n\nconst localValue = computed({\n get: () => modelValue.value,\n set: (newValue) => {\n modelValue.value = newValue\n },\n})\n\n// Provide the current model value for child components to inject\nprovide(formSelectKey, {\n modelValue: readonly(localValue),\n})\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n element: input,\n focus: () => {\n focused.value = true\n },\n})\n</script>\n","<template>\n <select\n :id=\"computedId\"\n ref=\"_input\"\n v-model=\"localValue\"\n :class=\"computedClasses\"\n :name=\"props.name\"\n :form=\"props.form || undefined\"\n :multiple=\"props.multiple || undefined\"\n :size=\"computedSelectSize\"\n :disabled=\"isDisabled\"\n :required=\"props.required || undefined\"\n :aria-required=\"props.required || undefined\"\n :aria-invalid=\"computedAriaInvalid\"\n >\n <slot name=\"first\" />\n <template v-for=\"(option, index) in normalizedOptsWrapper\" :key=\"index\">\n <BFormSelectOptionGroup\n v-if=\"isComplex(option)\"\n :label=\"option.label\"\n :options=\"option.options\"\n :value-field=\"props.valueField\"\n :text-field=\"props.textField\"\n :disabled-field=\"props.disabledField\"\n />\n <BFormSelectOption v-else v-bind=\"option\">\n <slot name=\"option\" v-bind=\"option\">\n {{ option.text }}\n </slot>\n </BFormSelectOption>\n </template>\n <slot />\n </select>\n</template>\n\n<script setup lang=\"ts\">\nimport type {BFormSelectBaseProps} from '../../types/ComponentProps'\nimport {computed, inject, provide, readonly, useTemplateRef} from 'vue'\nimport BFormSelectOption from './BFormSelectOption.vue'\nimport BFormSelectOptionGroup from './BFormSelectOptionGroup.vue'\nimport {useAriaInvalid} from '../../composables/useAriaInvalid'\nimport {useFocus, useToNumber} from '@vueuse/core'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport {useStateClass} from '../../composables/useStateClass'\nimport {useFormSelect} from '../../composables/useFormSelect'\nimport {formGroupKey, formSelectKey} from '../../utils/keys'\n\n/**\n * Base component for BFormSelect - non-generic implementation using useDefaults.\n * Renders a select element with normalized options and option groups.\n * Supports both simple options and complex grouped options.\n */\nconst _props = withDefaults(defineProps<Omit<BFormSelectBaseProps, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n labelField: 'label',\n multiple: false,\n name: undefined,\n options: () => [],\n optionsField: 'options',\n plain: false,\n required: false,\n selectSize: 0,\n size: 'md',\n state: null,\n textField: 'text',\n valueField: 'value',\n})\nconst props = useDefaults(_props, 'BFormSelect')\n\nconst modelValue = defineModel<unknown>({\n default: '',\n})\n\nconst computedId = useId(() => props.id, 'input')\n\nconst formGroupData = inject(formGroupKey, null)?.(computedId)\nconst isDisabled = computed(() => props.disabled || (formGroupData?.disabled.value ?? false))\n\nconst selectSizeNumber = useToNumber(() => props.selectSize)\n\nconst stateClass = useStateClass(() => props.state)\n\nconst input = useTemplateRef('_input')\n\nconst {focused} = useFocus(input, {\n initialValue: props.autofocus,\n})\n\nconst computedClasses = computed(() => [\n stateClass.value,\n {\n 'form-control': props.plain,\n [`form-control-${props.size}`]: props.size !== 'md' && props.plain,\n 'form-select': !props.plain,\n [`form-select-${props.size}`]: props.size !== 'md' && !props.plain,\n },\n])\n\nconst computedSelectSize = computed(() =>\n !props.plain && selectSizeNumber.value > 0 ? selectSizeNumber.value : undefined\n)\n\nconst computedAriaInvalid = useAriaInvalid(\n () => props.ariaInvalid,\n () => props.state\n)\n\nconst {normalizedOptions, isComplex} = useFormSelect(() => props.options, props)\n\nconst normalizedOptsWrapper = computed(() => normalizedOptions.value)\n\nconst localValue = computed({\n get: () => modelValue.value,\n set: (newValue) => {\n modelValue.value = newValue\n },\n})\n\n// Provide the current model value for child components to inject\nprovide(formSelectKey, {\n modelValue: readonly(localValue),\n})\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n element: input,\n focus: () => {\n focused.value = true\n },\n})\n</script>\n","<template>\n <BFormSelectBase v-bind=\"forwardedProps\" v-model=\"modelValue\" :options=\"normalizedOptions as any\">\n <!-- Forward all slots -->\n <template #first>\n <slot name=\"first\" />\n </template>\n\n <template #option=\"slotProps\">\n <slot name=\"option\" v-bind=\"slotProps as any\" />\n </template>\n\n <slot />\n </BFormSelectBase>\n</template>\n\n<script\n setup\n lang=\"ts\"\n generic=\"\n Options extends readonly (object | string | number | boolean)[] = readonly (\n | object\n | string\n | number\n | boolean\n )[]\n \"\n>\nimport type {BFormSelectProps} from '../../types/ComponentProps'\nimport {computed} from 'vue'\nimport BFormSelectBase from './BFormSelectBase.vue'\nimport type {ComplexSelectOptionRaw, SelectOption} from '../../types/SelectTypes'\nimport type {BFormSelectSlots} from '../../types'\nimport type {OptionsValues} from '../../types/OptionsTypes'\n\n/**\n * Type-safe wrapper component for BFormSelect.\n * Provides generic type safety for options array and strongly-typed modelValue.\n * Uses Options array generic to extract union of all possible values.\n * Normalizes typed options and forwards to BFormSelectBase for rendering.\n * Supports both complex objects and simple scalar types (string, number).\n *\n * For strongly-typed modelValue:\n * - Primitive arrays: modelValue is union of those values (or array if multiple)\n * - Object arrays with 'value' field: modelValue is union of value field types\n * - Use 'as const' on options for literal type inference\n */\nconst props = withDefaults(defineProps<Omit<BFormSelectProps<Options>, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n labelField: 'label',\n multiple: false,\n name: undefined,\n options: () => [] as unknown as Options,\n optionsField: 'options',\n plain: false,\n required: false,\n selectSize: 0,\n size: 'md',\n state: null,\n textField: 'text',\n valueField: 'value',\n})\ndefineSlots<BFormSelectSlots<OptionsValues<Options>>>()\n\n// Type-safe model value - single value or array depending on multiple prop.\n// NOTE: OptionsValues assumes a static \"value\" key; custom valueField is not\n// reflected in the type — modelValue falls back to unknown in that case.\nconst modelValue = defineModel<OptionsValues<Options> | OptionsValues<Options>[] | null>({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default: '' as any,\n})\n\n// Normalize a single simple option using custom field names\nconst normalizeSimpleOption = (el: object): SelectOption =>\n ({\n ...(el as Record<string, unknown>),\n value: (el as Record<string, unknown>)[props.valueField as string],\n text: ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ?? '',\n disabled:\n ((el as Record<string, unknown>)[props.disabledField as string] as boolean | undefined) ??\n false,\n }) as SelectOption\n\nconst normalizePrimitive = (el: string | number | boolean): SelectOption =>\n ({value: el, text: String(el), disabled: false}) as SelectOption\n\n// Type-safe normalization of options (supports both simple and complex/grouped)\nconst normalizedOptions = computed(() => {\n const optionsArray = props.options ?? []\n const hasComplexOptions = optionsArray.some(\n (el) =>\n typeof el !== 'string' &&\n typeof el !== 'number' &&\n typeof el !== 'boolean' &&\n (el as Record<string, unknown>)[props.optionsField as string] !== undefined\n )\n\n if (hasComplexOptions) {\n return optionsArray.map((el) => {\n if (typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean') {\n return normalizePrimitive(el)\n }\n\n // Check if this is a complex (grouped) option\n const optionsField = (el as Record<string, unknown>)[props.optionsField as string]\n if (optionsField !== undefined && Array.isArray(optionsField)) {\n // Complex option with nested options\n const label =\n ((el as Record<string, unknown>)[props.labelField as string] as string | undefined) ??\n ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ??\n ''\n return {\n label,\n options: optionsField.map((subOpt: unknown) => {\n if (\n typeof subOpt === 'string' ||\n typeof subOpt === 'number' ||\n typeof subOpt === 'boolean'\n ) {\n return normalizePrimitive(subOpt)\n }\n return normalizeSimpleOption(subOpt as object)\n }),\n } as ComplexSelectOptionRaw\n }\n\n // Simple option - spread all properties from the original object to preserve class, data-*, etc.\n return normalizeSimpleOption(el as object)\n })\n }\n\n return optionsArray.map((el) => {\n if (typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean') {\n return normalizePrimitive(el)\n }\n // Spread all properties from the original object to preserve class, data-*, etc.\n return normalizeSimpleOption(el as object)\n })\n})\n\n// Forward all props except options (which we normalize), modelValue (handled separately),\n// and field mappings (already used for normalization)\nconst forwardedProps = computed(() => ({\n ariaInvalid: props.ariaInvalid,\n autofocus: props.autofocus,\n disabled: props.disabled,\n form: props.form,\n id: props.id,\n multiple: props.multiple,\n name: props.name,\n plain: props.plain,\n required: props.required,\n selectSize: props.selectSize,\n size: props.size,\n state: props.state,\n}))\n</script>\n","<template>\n <BFormSelectBase v-bind=\"forwardedProps\" v-model=\"modelValue\" :options=\"normalizedOptions as any\">\n <!-- Forward all slots -->\n <template #first>\n <slot name=\"first\" />\n </template>\n\n <template #option=\"slotProps\">\n <slot name=\"option\" v-bind=\"slotProps as any\" />\n </template>\n\n <slot />\n </BFormSelectBase>\n</template>\n\n<script\n setup\n lang=\"ts\"\n generic=\"\n Options extends readonly (object | string | number | boolean)[] = readonly (\n | object\n | string\n | number\n | boolean\n )[]\n \"\n>\nimport type {BFormSelectProps} from '../../types/ComponentProps'\nimport {computed} from 'vue'\nimport BFormSelectBase from './BFormSelectBase.vue'\nimport type {ComplexSelectOptionRaw, SelectOption} from '../../types/SelectTypes'\nimport type {BFormSelectSlots} from '../../types'\nimport type {OptionsValues} from '../../types/OptionsTypes'\n\n/**\n * Type-safe wrapper component for BFormSelect.\n * Provides generic type safety for options array and strongly-typed modelValue.\n * Uses Options array generic to extract union of all possible values.\n * Normalizes typed options and forwards to BFormSelectBase for rendering.\n * Supports both complex objects and simple scalar types (string, number).\n *\n * For strongly-typed modelValue:\n * - Primitive arrays: modelValue is union of those values (or array if multiple)\n * - Object arrays with 'value' field: modelValue is union of value field types\n * - Use 'as const' on options for literal type inference\n */\nconst props = withDefaults(defineProps<Omit<BFormSelectProps<Options>, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n labelField: 'label',\n multiple: false,\n name: undefined,\n options: () => [] as unknown as Options,\n optionsField: 'options',\n plain: false,\n required: false,\n selectSize: 0,\n size: 'md',\n state: null,\n textField: 'text',\n valueField: 'value',\n})\ndefineSlots<BFormSelectSlots<OptionsValues<Options>>>()\n\n// Type-safe model value - single value or array depending on multiple prop.\n// NOTE: OptionsValues assumes a static \"value\" key; custom valueField is not\n// reflected in the type — modelValue falls back to unknown in that case.\nconst modelValue = defineModel<OptionsValues<Options> | OptionsValues<Options>[] | null>({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default: '' as any,\n})\n\n// Normalize a single simple option using custom field names\nconst normalizeSimpleOption = (el: object): SelectOption =>\n ({\n ...(el as Record<string, unknown>),\n value: (el as Record<string, unknown>)[props.valueField as string],\n text: ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ?? '',\n disabled:\n ((el as Record<string, unknown>)[props.disabledField as string] as boolean | undefined) ??\n false,\n }) as SelectOption\n\nconst normalizePrimitive = (el: string | number | boolean): SelectOption =>\n ({value: el, text: String(el), disabled: false}) as SelectOption\n\n// Type-safe normalization of options (supports both simple and complex/grouped)\nconst normalizedOptions = computed(() => {\n const optionsArray = props.options ?? []\n const hasComplexOptions = optionsArray.some(\n (el) =>\n typeof el !== 'string' &&\n typeof el !== 'number' &&\n typeof el !== 'boolean' &&\n (el as Record<string, unknown>)[props.optionsField as string] !== undefined\n )\n\n if (hasComplexOptions) {\n return optionsArray.map((el) => {\n if (typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean') {\n return normalizePrimitive(el)\n }\n\n // Check if this is a complex (grouped) option\n const optionsField = (el as Record<string, unknown>)[props.optionsField as string]\n if (optionsField !== undefined && Array.isArray(optionsField)) {\n // Complex option with nested options\n const label =\n ((el as Record<string, unknown>)[props.labelField as string] as string | undefined) ??\n ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ??\n ''\n return {\n label,\n options: optionsField.map((subOpt: unknown) => {\n if (\n typeof subOpt === 'string' ||\n typeof subOpt === 'number' ||\n typeof subOpt === 'boolean'\n ) {\n return normalizePrimitive(subOpt)\n }\n return normalizeSimpleOption(subOpt as object)\n }),\n } as ComplexSelectOptionRaw\n }\n\n // Simple option - spread all properties from the original object to preserve class, data-*, etc.\n return normalizeSimpleOption(el as object)\n })\n }\n\n return optionsArray.map((el) => {\n if (typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean') {\n return normalizePrimitive(el)\n }\n // Spread all properties from the original object to preserve class, data-*, etc.\n return normalizeSimpleOption(el as object)\n })\n})\n\n// Forward all props except options (which we normalize), modelValue (handled separately),\n// and field mappings (already used for normalization)\nconst forwardedProps = computed(() => ({\n ariaInvalid: props.ariaInvalid,\n autofocus: props.autofocus,\n disabled: props.disabled,\n form: props.form,\n id: props.id,\n multiple: props.multiple,\n name: props.name,\n plain: props.plain,\n required: props.required,\n selectSize: props.selectSize,\n size: props.size,\n state: props.state,\n}))\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EAgCA,MAAM,QAAQ,YAPC,SAOmB,yBAAwB;EAU1D,MAAM,EAAC,sBAAqB,oBAAoB,MAAM,SAAS,MAAM;;uBAzCnE,mBAYW,YAAA,EAZA,OAAO,MAAA,MAAK,CAAC,OAAA,EAAA;IACtB,WAAqB,KAAA,QAAA,QAAA;sBACrB,mBAQoB,UAAA,MAAA,WAPQ,MAAA,kBAAiB,GAAnC,QAAQ,UAAK;yBADvB,YAQoB,2BARpB,WAQoB,EANjB,KAAK,OAAK,EAAA,EAAA,SAAA,MAAA,EAAA;MAAA,GACCA,KAAAA;MAAM,GAAK;MAAM,CAAA,EAAA;6BAItB,CAFP,WAEO,KAAA,QAAA,UAFP,WAEO,EAAA,SAAA,MAAA,EAFqB,OAAM,QAE3B,CAAA,gBAAA,gBADF,OAAO,KAAI,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA;;;;IAGlB,WAAQ,KAAA,QAAA,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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BAApB,UAAS,CAAA,CAAA,CAAA,CAAA;2BAG/B,CAAR,WAAQ,KAAA,QAAA,UAAA,CAAA,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BFormSelect-DIKVsG--.js","names":["$attrs"],"sources":["../src/components/BFormSelect/BFormSelectOptionGroup.vue","../src/components/BFormSelect/BFormSelectOptionGroup.vue","../src/components/BFormSelect/BFormSelectBase.vue","../src/components/BFormSelect/BFormSelectBase.vue","../src/components/BFormSelect/BFormSelect.vue","../src/components/BFormSelect/BFormSelect.vue"],"sourcesContent":["<template>\n <optgroup :label=\"props.label\">\n <slot name=\"first\" />\n <BFormSelectOption\n v-for=\"(option, index) in normalizedOptions\"\n :key=\"index\"\n v-bind=\"{...$attrs, ...option}\"\n >\n <slot name=\"option\" v-bind=\"option\">\n {{ option.text }}\n </slot>\n </BFormSelectOption>\n <slot />\n </optgroup>\n</template>\n\n<script setup lang=\"ts\" generic=\"T\">\nimport BFormSelectOption from './BFormSelectOption.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BFormSelectOptionGroupProps} from '../../types/ComponentProps'\nimport type {ComputedRef} from 'vue'\nimport {useFormSelect} from '../../composables/useFormSelect'\nimport type {SelectOption} from '../../types/SelectTypes'\nimport type {BFormSelectOptionGroupSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<BFormSelectOptionGroupProps>(), {\n disabledField: 'disabled',\n label: undefined,\n options: () => [],\n textField: 'text',\n valueField: 'value',\n})\nconst props = useDefaults(_props, 'BFormSelectOptionGroup')\ndefineSlots<BFormSelectOptionGroupSlots<T>>()\n\n// The form select context is injected by BFormSelectOption components automatically\n// We don't need to handle the selected value here since each BFormSelectOption\n// will inject the context directly\n\n// Type assertion is needed because useFormSelect is not generic-aware.\n// This is acceptable in the wrapper/base pattern where the wrapper (BFormSelect)\n// handles type-safe normalization before passing to base components.\nconst {normalizedOptions} = useFormSelect(() => props.options, props) as {\n normalizedOptions: ComputedRef<SelectOption<T>[]>\n}\n</script>\n","<template>\n <optgroup :label=\"props.label\">\n <slot name=\"first\" />\n <BFormSelectOption\n v-for=\"(option, index) in normalizedOptions\"\n :key=\"index\"\n v-bind=\"{...$attrs, ...option}\"\n >\n <slot name=\"option\" v-bind=\"option\">\n {{ option.text }}\n </slot>\n </BFormSelectOption>\n <slot />\n </optgroup>\n</template>\n\n<script setup lang=\"ts\" generic=\"T\">\nimport BFormSelectOption from './BFormSelectOption.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BFormSelectOptionGroupProps} from '../../types/ComponentProps'\nimport type {ComputedRef} from 'vue'\nimport {useFormSelect} from '../../composables/useFormSelect'\nimport type {SelectOption} from '../../types/SelectTypes'\nimport type {BFormSelectOptionGroupSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<BFormSelectOptionGroupProps>(), {\n disabledField: 'disabled',\n label: undefined,\n options: () => [],\n textField: 'text',\n valueField: 'value',\n})\nconst props = useDefaults(_props, 'BFormSelectOptionGroup')\ndefineSlots<BFormSelectOptionGroupSlots<T>>()\n\n// The form select context is injected by BFormSelectOption components automatically\n// We don't need to handle the selected value here since each BFormSelectOption\n// will inject the context directly\n\n// Type assertion is needed because useFormSelect is not generic-aware.\n// This is acceptable in the wrapper/base pattern where the wrapper (BFormSelect)\n// handles type-safe normalization before passing to base components.\nconst {normalizedOptions} = useFormSelect(() => props.options, props) as {\n normalizedOptions: ComputedRef<SelectOption<T>[]>\n}\n</script>\n","<template>\n <select\n :id=\"computedId\"\n ref=\"_input\"\n v-model=\"localValue\"\n :class=\"computedClasses\"\n :name=\"props.name\"\n :form=\"props.form || undefined\"\n :multiple=\"props.multiple || undefined\"\n :size=\"computedSelectSize\"\n :disabled=\"isDisabled\"\n :required=\"props.required || undefined\"\n :aria-required=\"props.required || undefined\"\n :aria-invalid=\"computedAriaInvalid\"\n >\n <slot name=\"first\" />\n <template v-for=\"(option, index) in normalizedOptsWrapper\" :key=\"index\">\n <BFormSelectOptionGroup\n v-if=\"isComplex(option)\"\n :label=\"option.label\"\n :options=\"option.options\"\n :value-field=\"props.valueField\"\n :text-field=\"props.textField\"\n :disabled-field=\"props.disabledField\"\n />\n <BFormSelectOption v-else v-bind=\"option\">\n <slot name=\"option\" v-bind=\"option\">\n {{ option.text }}\n </slot>\n </BFormSelectOption>\n </template>\n <slot />\n </select>\n</template>\n\n<script setup lang=\"ts\">\nimport type {BFormSelectBaseProps} from '../../types/ComponentProps'\nimport {computed, inject, provide, readonly, useTemplateRef} from 'vue'\nimport BFormSelectOption from './BFormSelectOption.vue'\nimport BFormSelectOptionGroup from './BFormSelectOptionGroup.vue'\nimport {useAriaInvalid} from '../../composables/useAriaInvalid'\nimport {useFocus, useToNumber} from '@vueuse/core'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport {useStateClass} from '../../composables/useStateClass'\nimport {useFormSelect} from '../../composables/useFormSelect'\nimport {formGroupKey, formSelectKey} from '../../utils/keys'\n\n/**\n * Base component for BFormSelect - non-generic implementation using useDefaults.\n * Renders a select element with normalized options and option groups.\n * Supports both simple options and complex grouped options.\n */\nconst _props = withDefaults(defineProps<Omit<BFormSelectBaseProps, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n labelField: 'label',\n multiple: false,\n name: undefined,\n options: () => [],\n optionsField: 'options',\n plain: false,\n required: false,\n selectSize: 0,\n size: 'md',\n state: null,\n textField: 'text',\n valueField: 'value',\n})\nconst props = useDefaults(_props, 'BFormSelect')\n\nconst modelValue = defineModel<unknown>({\n default: '',\n})\n\nconst computedId = useId(() => props.id, 'input')\n\nconst formGroupData = inject(formGroupKey, null)?.(computedId)\nconst isDisabled = computed(() => props.disabled || (formGroupData?.disabled.value ?? false))\n\nconst selectSizeNumber = useToNumber(() => props.selectSize)\n\nconst stateClass = useStateClass(() => props.state)\n\nconst input = useTemplateRef('_input')\n\nconst {focused} = useFocus(input, {\n initialValue: props.autofocus,\n})\n\nconst computedClasses = computed(() => [\n stateClass.value,\n {\n 'form-control': props.plain,\n [`form-control-${props.size}`]: props.size !== 'md' && props.plain,\n 'form-select': !props.plain,\n [`form-select-${props.size}`]: props.size !== 'md' && !props.plain,\n },\n])\n\nconst computedSelectSize = computed(() =>\n !props.plain && selectSizeNumber.value > 0 ? selectSizeNumber.value : undefined\n)\n\nconst computedAriaInvalid = useAriaInvalid(\n () => props.ariaInvalid,\n () => props.state\n)\n\nconst {normalizedOptions, isComplex} = useFormSelect(() => props.options, props)\n\nconst normalizedOptsWrapper = computed(() => normalizedOptions.value)\n\nconst localValue = computed({\n get: () => modelValue.value,\n set: (newValue) => {\n modelValue.value = newValue\n },\n})\n\n// Provide the current model value for child components to inject\nprovide(formSelectKey, {\n modelValue: readonly(localValue),\n})\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n element: input,\n focus: () => {\n focused.value = true\n },\n})\n</script>\n","<template>\n <select\n :id=\"computedId\"\n ref=\"_input\"\n v-model=\"localValue\"\n :class=\"computedClasses\"\n :name=\"props.name\"\n :form=\"props.form || undefined\"\n :multiple=\"props.multiple || undefined\"\n :size=\"computedSelectSize\"\n :disabled=\"isDisabled\"\n :required=\"props.required || undefined\"\n :aria-required=\"props.required || undefined\"\n :aria-invalid=\"computedAriaInvalid\"\n >\n <slot name=\"first\" />\n <template v-for=\"(option, index) in normalizedOptsWrapper\" :key=\"index\">\n <BFormSelectOptionGroup\n v-if=\"isComplex(option)\"\n :label=\"option.label\"\n :options=\"option.options\"\n :value-field=\"props.valueField\"\n :text-field=\"props.textField\"\n :disabled-field=\"props.disabledField\"\n />\n <BFormSelectOption v-else v-bind=\"option\">\n <slot name=\"option\" v-bind=\"option\">\n {{ option.text }}\n </slot>\n </BFormSelectOption>\n </template>\n <slot />\n </select>\n</template>\n\n<script setup lang=\"ts\">\nimport type {BFormSelectBaseProps} from '../../types/ComponentProps'\nimport {computed, inject, provide, readonly, useTemplateRef} from 'vue'\nimport BFormSelectOption from './BFormSelectOption.vue'\nimport BFormSelectOptionGroup from './BFormSelectOptionGroup.vue'\nimport {useAriaInvalid} from '../../composables/useAriaInvalid'\nimport {useFocus, useToNumber} from '@vueuse/core'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport {useStateClass} from '../../composables/useStateClass'\nimport {useFormSelect} from '../../composables/useFormSelect'\nimport {formGroupKey, formSelectKey} from '../../utils/keys'\n\n/**\n * Base component for BFormSelect - non-generic implementation using useDefaults.\n * Renders a select element with normalized options and option groups.\n * Supports both simple options and complex grouped options.\n */\nconst _props = withDefaults(defineProps<Omit<BFormSelectBaseProps, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n labelField: 'label',\n multiple: false,\n name: undefined,\n options: () => [],\n optionsField: 'options',\n plain: false,\n required: false,\n selectSize: 0,\n size: 'md',\n state: null,\n textField: 'text',\n valueField: 'value',\n})\nconst props = useDefaults(_props, 'BFormSelect')\n\nconst modelValue = defineModel<unknown>({\n default: '',\n})\n\nconst computedId = useId(() => props.id, 'input')\n\nconst formGroupData = inject(formGroupKey, null)?.(computedId)\nconst isDisabled = computed(() => props.disabled || (formGroupData?.disabled.value ?? false))\n\nconst selectSizeNumber = useToNumber(() => props.selectSize)\n\nconst stateClass = useStateClass(() => props.state)\n\nconst input = useTemplateRef('_input')\n\nconst {focused} = useFocus(input, {\n initialValue: props.autofocus,\n})\n\nconst computedClasses = computed(() => [\n stateClass.value,\n {\n 'form-control': props.plain,\n [`form-control-${props.size}`]: props.size !== 'md' && props.plain,\n 'form-select': !props.plain,\n [`form-select-${props.size}`]: props.size !== 'md' && !props.plain,\n },\n])\n\nconst computedSelectSize = computed(() =>\n !props.plain && selectSizeNumber.value > 0 ? selectSizeNumber.value : undefined\n)\n\nconst computedAriaInvalid = useAriaInvalid(\n () => props.ariaInvalid,\n () => props.state\n)\n\nconst {normalizedOptions, isComplex} = useFormSelect(() => props.options, props)\n\nconst normalizedOptsWrapper = computed(() => normalizedOptions.value)\n\nconst localValue = computed({\n get: () => modelValue.value,\n set: (newValue) => {\n modelValue.value = newValue\n },\n})\n\n// Provide the current model value for child components to inject\nprovide(formSelectKey, {\n modelValue: readonly(localValue),\n})\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n element: input,\n focus: () => {\n focused.value = true\n },\n})\n</script>\n","<template>\n <BFormSelectBase v-bind=\"forwardedProps\" v-model=\"modelValue\" :options=\"normalizedOptions as any\">\n <!-- Forward all slots -->\n <template #first>\n <slot name=\"first\" />\n </template>\n\n <template #option=\"slotProps\">\n <slot name=\"option\" v-bind=\"slotProps as any\" />\n </template>\n\n <slot />\n </BFormSelectBase>\n</template>\n\n<script\n setup\n lang=\"ts\"\n generic=\"\n Options extends readonly (object | string | number | boolean)[] = readonly (\n | object\n | string\n | number\n | boolean\n )[]\n \"\n>\nimport type {BFormSelectProps} from '../../types/ComponentProps'\nimport {computed} from 'vue'\nimport BFormSelectBase from './BFormSelectBase.vue'\nimport type {ComplexSelectOptionRaw, SelectOption} from '../../types/SelectTypes'\nimport type {BFormSelectSlots} from '../../types'\nimport type {OptionsValues} from '../../types/OptionsTypes'\n\n/**\n * Type-safe wrapper component for BFormSelect.\n * Provides generic type safety for options array and strongly-typed modelValue.\n * Uses Options array generic to extract union of all possible values.\n * Normalizes typed options and forwards to BFormSelectBase for rendering.\n * Supports both complex objects and simple scalar types (string, number).\n *\n * For strongly-typed modelValue:\n * - Primitive arrays: modelValue is union of those values (or array if multiple)\n * - Object arrays with 'value' field: modelValue is union of value field types\n * - Use 'as const' on options for literal type inference\n */\nconst props = withDefaults(defineProps<Omit<BFormSelectProps<Options>, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n labelField: 'label',\n multiple: false,\n name: undefined,\n options: () => [] as unknown as Options,\n optionsField: 'options',\n plain: false,\n required: false,\n selectSize: 0,\n size: 'md',\n state: null,\n textField: 'text',\n valueField: 'value',\n})\ndefineSlots<BFormSelectSlots<OptionsValues<Options>>>()\n\n// Type-safe model value - single value or array depending on multiple prop.\n// NOTE: OptionsValues assumes a static \"value\" key; custom valueField is not\n// reflected in the type — modelValue falls back to unknown in that case.\nconst modelValue = defineModel<OptionsValues<Options> | OptionsValues<Options>[] | null>({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default: '' as any,\n})\n\n// Normalize a single simple option using custom field names\nconst normalizeSimpleOption = (el: object): SelectOption =>\n ({\n ...(el as Record<string, unknown>),\n value: (el as Record<string, unknown>)[props.valueField as string],\n text: ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ?? '',\n disabled:\n ((el as Record<string, unknown>)[props.disabledField as string] as boolean | undefined) ??\n false,\n }) as SelectOption\n\nconst normalizePrimitive = (el: string | number | boolean): SelectOption =>\n ({value: el, text: String(el), disabled: false}) as SelectOption\n\n// Type-safe normalization of options (supports both simple and complex/grouped)\nconst normalizedOptions = computed(() => {\n const optionsArray = props.options ?? []\n const hasComplexOptions = optionsArray.some(\n (el) =>\n typeof el !== 'string' &&\n typeof el !== 'number' &&\n typeof el !== 'boolean' &&\n (el as Record<string, unknown>)[props.optionsField as string] !== undefined\n )\n\n if (hasComplexOptions) {\n return optionsArray.map((el) => {\n if (typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean') {\n return normalizePrimitive(el)\n }\n\n // Check if this is a complex (grouped) option\n const optionsField = (el as Record<string, unknown>)[props.optionsField as string]\n if (optionsField !== undefined && Array.isArray(optionsField)) {\n // Complex option with nested options\n const label =\n ((el as Record<string, unknown>)[props.labelField as string] as string | undefined) ??\n ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ??\n ''\n return {\n label,\n options: optionsField.map((subOpt: unknown) => {\n if (\n typeof subOpt === 'string' ||\n typeof subOpt === 'number' ||\n typeof subOpt === 'boolean'\n ) {\n return normalizePrimitive(subOpt)\n }\n return normalizeSimpleOption(subOpt as object)\n }),\n } as ComplexSelectOptionRaw\n }\n\n // Simple option - spread all properties from the original object to preserve class, data-*, etc.\n return normalizeSimpleOption(el as object)\n })\n }\n\n return optionsArray.map((el) => {\n if (typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean') {\n return normalizePrimitive(el)\n }\n // Spread all properties from the original object to preserve class, data-*, etc.\n return normalizeSimpleOption(el as object)\n })\n})\n\n// Forward all props except options (which we normalize), modelValue (handled separately),\n// and field mappings (already used for normalization)\nconst forwardedProps = computed(() => ({\n ariaInvalid: props.ariaInvalid,\n autofocus: props.autofocus,\n disabled: props.disabled,\n form: props.form,\n id: props.id,\n multiple: props.multiple,\n name: props.name,\n plain: props.plain,\n required: props.required,\n selectSize: props.selectSize,\n size: props.size,\n state: props.state,\n}))\n</script>\n","<template>\n <BFormSelectBase v-bind=\"forwardedProps\" v-model=\"modelValue\" :options=\"normalizedOptions as any\">\n <!-- Forward all slots -->\n <template #first>\n <slot name=\"first\" />\n </template>\n\n <template #option=\"slotProps\">\n <slot name=\"option\" v-bind=\"slotProps as any\" />\n </template>\n\n <slot />\n </BFormSelectBase>\n</template>\n\n<script\n setup\n lang=\"ts\"\n generic=\"\n Options extends readonly (object | string | number | boolean)[] = readonly (\n | object\n | string\n | number\n | boolean\n )[]\n \"\n>\nimport type {BFormSelectProps} from '../../types/ComponentProps'\nimport {computed} from 'vue'\nimport BFormSelectBase from './BFormSelectBase.vue'\nimport type {ComplexSelectOptionRaw, SelectOption} from '../../types/SelectTypes'\nimport type {BFormSelectSlots} from '../../types'\nimport type {OptionsValues} from '../../types/OptionsTypes'\n\n/**\n * Type-safe wrapper component for BFormSelect.\n * Provides generic type safety for options array and strongly-typed modelValue.\n * Uses Options array generic to extract union of all possible values.\n * Normalizes typed options and forwards to BFormSelectBase for rendering.\n * Supports both complex objects and simple scalar types (string, number).\n *\n * For strongly-typed modelValue:\n * - Primitive arrays: modelValue is union of those values (or array if multiple)\n * - Object arrays with 'value' field: modelValue is union of value field types\n * - Use 'as const' on options for literal type inference\n */\nconst props = withDefaults(defineProps<Omit<BFormSelectProps<Options>, 'modelValue'>>(), {\n ariaInvalid: undefined,\n autofocus: false,\n disabled: false,\n disabledField: 'disabled',\n form: undefined,\n id: undefined,\n labelField: 'label',\n multiple: false,\n name: undefined,\n options: () => [] as unknown as Options,\n optionsField: 'options',\n plain: false,\n required: false,\n selectSize: 0,\n size: 'md',\n state: null,\n textField: 'text',\n valueField: 'value',\n})\ndefineSlots<BFormSelectSlots<OptionsValues<Options>>>()\n\n// Type-safe model value - single value or array depending on multiple prop.\n// NOTE: OptionsValues assumes a static \"value\" key; custom valueField is not\n// reflected in the type — modelValue falls back to unknown in that case.\nconst modelValue = defineModel<OptionsValues<Options> | OptionsValues<Options>[] | null>({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n default: '' as any,\n})\n\n// Normalize a single simple option using custom field names\nconst normalizeSimpleOption = (el: object): SelectOption =>\n ({\n ...(el as Record<string, unknown>),\n value: (el as Record<string, unknown>)[props.valueField as string],\n text: ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ?? '',\n disabled:\n ((el as Record<string, unknown>)[props.disabledField as string] as boolean | undefined) ??\n false,\n }) as SelectOption\n\nconst normalizePrimitive = (el: string | number | boolean): SelectOption =>\n ({value: el, text: String(el), disabled: false}) as SelectOption\n\n// Type-safe normalization of options (supports both simple and complex/grouped)\nconst normalizedOptions = computed(() => {\n const optionsArray = props.options ?? []\n const hasComplexOptions = optionsArray.some(\n (el) =>\n typeof el !== 'string' &&\n typeof el !== 'number' &&\n typeof el !== 'boolean' &&\n (el as Record<string, unknown>)[props.optionsField as string] !== undefined\n )\n\n if (hasComplexOptions) {\n return optionsArray.map((el) => {\n if (typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean') {\n return normalizePrimitive(el)\n }\n\n // Check if this is a complex (grouped) option\n const optionsField = (el as Record<string, unknown>)[props.optionsField as string]\n if (optionsField !== undefined && Array.isArray(optionsField)) {\n // Complex option with nested options\n const label =\n ((el as Record<string, unknown>)[props.labelField as string] as string | undefined) ??\n ((el as Record<string, unknown>)[props.textField as string] as string | undefined) ??\n ''\n return {\n label,\n options: optionsField.map((subOpt: unknown) => {\n if (\n typeof subOpt === 'string' ||\n typeof subOpt === 'number' ||\n typeof subOpt === 'boolean'\n ) {\n return normalizePrimitive(subOpt)\n }\n return normalizeSimpleOption(subOpt as object)\n }),\n } as ComplexSelectOptionRaw\n }\n\n // Simple option - spread all properties from the original object to preserve class, data-*, etc.\n return normalizeSimpleOption(el as object)\n })\n }\n\n return optionsArray.map((el) => {\n if (typeof el === 'string' || typeof el === 'number' || typeof el === 'boolean') {\n return normalizePrimitive(el)\n }\n // Spread all properties from the original object to preserve class, data-*, etc.\n return normalizeSimpleOption(el as object)\n })\n})\n\n// Forward all props except options (which we normalize), modelValue (handled separately),\n// and field mappings (already used for normalization)\nconst forwardedProps = computed(() => ({\n ariaInvalid: props.ariaInvalid,\n autofocus: props.autofocus,\n disabled: props.disabled,\n form: props.form,\n id: props.id,\n multiple: props.multiple,\n name: props.name,\n plain: props.plain,\n required: props.required,\n selectSize: props.selectSize,\n size: props.size,\n state: props.state,\n}))\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EAgCA,MAAM,QAAQ,oBAAA,YAPC,SAOmB,yBAAwB;EAU1D,MAAM,EAAC,sBAAqB,sBAAA,oBAAoB,MAAM,SAAS,MAAM;;4DA7BxD,YAAA,EAZA,QAAA,GAAA,IAAA,OAAO,MAAK,CAAC,OAAA,EAAA;wBACD,KAAA,QAAA,QAAA;2DASD,IAAA,UAAA,OAAA,GAAA,IAAA,aAAA,GAAA,IAAA,OAPQ,kBAAiB,GAAnC,QAAQ,UAAK;uDAOH,0BAAA,4BAAA,GAAA,IAAA,YAAA,EANjB,KAAK,OAAK,EAAA,EAAA,SAAA,MAAA,EAAA;MAAA,GACCA,KAAAA;MAAM,GAAK;MAAM,CAAA,EAAA;sCAItB,EAAA,GAAA,IAAA,YAAA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C,aAAO,sBAAsB,OAAgB;;KAEhD;AAIH,WAAO,sBAAsB,GAAY;KAC1C;AAGH,UAAO,aAAa,KAAK,OAAO;AAC9B,QAAI,OAAO,OAAO,YAAY,OAAO,OAAO,YAAY,OAAO,OAAO,UACpE,QAAO,mBAAmB,GAAE;AAG9B,WAAO,sBAAsB,GAAY;KAC1C;IACF;EAID,MAAM,kBAAA,GAAA,IAAA,iBAAiC;GACrC,aAAa,MAAM;GACnB,WAAW,MAAM;GACjB,UAAU,MAAM;GAChB,MAAM,MAAM;GACZ,IAAI,MAAM;GACV,UAAU,MAAM;GAChB,MAAM,MAAM;GACZ,OAAO,MAAM;GACb,UAAU,MAAM;GAChB,YAAY,MAAM;GAClB,MAAM,MAAM;GACZ,OAAO,MAAM;GACd,EAAC;;qDAnJkB,0BAAA,GAAA,IAAA,YAXO,eAWP,OAXqB;gBAAW,WAAA;4EAAU,QAAA;IAAG,SAAS,kBAAA;;IAE3D,QAAA,GAAA,IAAA,eACY,EAAA,GAAA,IAAA,YAAA,KAAA,QAAA,QAAA,CAAA,CAAA;IAGZ,SAAA,GAAA,IAAA,UAAQ,cAAS,EAAA,GAAA,IAAA,YACsB,KAAA,QAAA,WAAA,GAAA,IAAA,iBAAA,GAAA,IAAA,oBAApB,UAAS,CAAA,CAAA,CAAA,CAAA;oCAG/B,EAAA,GAAA,IAAA,YAAA,KAAA,QAAA,UAAA,CAAA,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BFormTags-BFA6xbr3.js","names":[],"sources":["../src/components/BFormTags/BFormTags.vue","../src/components/BFormTags/BFormTags.vue"],"sourcesContent":["<template>\n <div\n :id=\"computedId\"\n class=\"b-form-tags form-control h-auto\"\n :class=\"computedClasses\"\n role=\"group\"\n tabindex=\"-1\"\n @click=\"onClick\"\n @focusin=\"onFocusin\"\n @focusout=\"emit('focusout', $event)\"\n >\n <output\n :id=\"`${computedId}selected_tags__`\"\n class=\"visually-hidden\"\n :for=\"_inputId\"\n :aria-live=\"focused ? 'polite' : 'off'\"\n aria-atomic=\"true\"\n aria-relevant=\"additions text\"\n >{{ tags.join(', ') }}</output\n >\n <div\n :id=\"`${computedId}removed_tags__`\"\n role=\"status\"\n :aria-live=\"focused ? 'assertive' : 'off'\"\n aria-atomic=\"true\"\n class=\"visually-hidden\"\n >\n ({{ props.tagRemovedLabel }}) {{ lastRemovedTag }}\n </div>\n\n <slot\n :add-button-text=\"props.addButtonText\"\n :add-button-variant=\"props.addButtonVariant\"\n :add-tag\n :disable-add-button=\"disableAddButton\"\n :disabled=\"props.disabled\"\n :duplicate-tag-text=\"props.duplicateTagText\"\n :duplicate-tags=\"duplicateTags\"\n :form=\"props.form\"\n :input-attrs=\"{\n ...props.inputAttrs,\n disabled: props.disabled,\n form: props.form,\n id: _inputId,\n value: inputValue,\n }\"\n :input-class=\"props.inputClass\"\n :input-handlers=\"{\n input: onInput,\n keydown: onKeydown,\n change: onChange,\n }\"\n :input-id=\"_inputId\"\n :input-type=\"props.inputType\"\n :invalid-tag-text=\"props.invalidTagText\"\n :invalid-tags\n :is-duplicate\n :is-invalid\n :is-limit-reached=\"isLimitReached\"\n :limit-tags-text=\"props.limitTagsText\"\n :limit=\"limitNumber\"\n :no-tag-remove=\"props.noTagRemove\"\n :placeholder=\"props.placeholder\"\n :remove-tag\n :required=\"props.required\"\n :separator=\"props.separator\"\n :size=\"props.size\"\n :state=\"props.state\"\n :tag-class=\"props.tagClass\"\n :tag-pills=\"props.tagPills\"\n :tag-remove-label=\"props.tagRemoveLabel\"\n :tag-variant=\"props.tagVariant\"\n :tags\n >\n <ul\n :id=\"`${computedId}tag_list__`\"\n class=\"b-form-tags-list list-unstyled mb-0 d-flex flex-wrap align-items-center\"\n >\n <template v-for=\"(tag, index) in tags\" :key=\"index\">\n <slot\n name=\"tag\"\n :tag=\"tag\"\n :tag-class=\"props.tagClass\"\n :tag-variant=\"props.tagVariant\"\n :tag-pills=\"props.tagPills\"\n :remove-tag=\"removeTag\"\n >\n <BFormTag\n :key=\"tag\"\n :class=\"props.tagClass\"\n tag=\"li\"\n :variant=\"props.tagVariant\"\n :pill=\"props.tagPills\"\n :no-remove=\"props.noTagRemove\"\n :disabled=\"props.disabled\"\n @remove=\"removeTag\"\n >{{ tag }}</BFormTag\n >\n </slot>\n </template>\n <li\n role=\"none\"\n aria-live=\"off\"\n class=\"b-from-tags-field flex-grow-1\"\n :aria-controls=\"`${computedId}tag_list__`\"\n >\n <div role=\"group\" class=\"d-flex\">\n <input\n :id=\"_inputId\"\n ref=\"_input\"\n :disabled=\"props.disabled\"\n :value=\"inputValue\"\n :type=\"props.inputType\"\n :placeholder=\"props.placeholder\"\n class=\"b-form-tags-input w-100 flex-grow-1 p-0 m-0 bg-transparent border-0\"\n style=\"outline: currentcolor none 0px; min-width: 5rem\"\n v-bind=\"props.inputAttrs\"\n :form=\"props.form\"\n :required=\"props.required || undefined\"\n :aria-required=\"props.required || undefined\"\n @input=\"onInput\"\n @change=\"onChange\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n />\n <button\n v-if=\"disableAddButton\"\n type=\"button\"\n class=\"btn b-form-tags-button py-0\"\n :class=\"[\n inputClass,\n {\n [`btn-${props.addButtonVariant}`]: props.addButtonVariant !== null,\n 'disabled invisible': inputValue.length === 0,\n },\n ]\"\n style=\"font-size: 90%\"\n :disabled=\"props.disabled || inputValue.length === 0 || isLimitReached\"\n @click=\"addTag(inputValue)\"\n >\n <slot name=\"add-button-text\">{{ props.addButtonText }}</slot>\n </button>\n </div>\n </li>\n </ul>\n <div :aria-live=\"props.feedbackAriaLive\" aria-atomic=\"true\">\n <div v-if=\"isInvalid\" class=\"d-block invalid-feedback\">\n {{ props.invalidTagText }}: {{ inputValue }}\n </div>\n <small v-if=\"isDuplicate\" class=\"form-text text-body-secondary\"\n >{{ props.duplicateTagText }}: {{ inputValue }}</small\n >\n <small v-if=\"tags.length === props.limit\" class=\"form-text text-body-secondary\">\n {{ props.limitTagsText }}</small\n >\n </div>\n </slot>\n <template v-if=\"props.name\">\n <input\n v-for=\"(tag, index) in tags\"\n :key=\"index\"\n type=\"hidden\"\n :name=\"props.name\"\n :value=\"tag\"\n />\n </template>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {onKeyStroke, syncRef, useFocus, useToNumber} from '@vueuse/core'\nimport {computed, ref, useTemplateRef} from 'vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BFormTagsProps} from '../../types/ComponentProps'\nimport {escapeRegExpChars} from '../../utils/stringUtils'\nimport BFormTag from './BFormTag.vue'\nimport {useId} from '../../composables/useId'\nimport {useStateClass} from '../../composables/useStateClass'\nimport type {BFormTagsEmits, BFormTagsSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<Omit<BFormTagsProps, 'modelValue'>>(), {\n addButtonText: 'Add',\n addButtonVariant: 'outline-secondary',\n addOnChange: false,\n autofocus: false,\n disabled: false,\n duplicateTagText: 'Duplicate tag(s)',\n feedbackAriaLive: 'assertive',\n form: undefined,\n ignoreInputFocusSelector: () => ['.b-form-tag', 'button', 'input', 'select'],\n inputAttrs: undefined,\n inputClass: undefined,\n inputId: undefined,\n inputType: 'text',\n invalidTagText: 'Invalid tag(s)',\n limit: undefined,\n limitTagsText: 'Tag limit reached',\n name: undefined,\n noAddOnEnter: false,\n noOuterFocus: false,\n noTagRemove: false,\n placeholder: 'Add tag...',\n removeOnDelete: false,\n required: false,\n separator: undefined,\n size: 'md',\n state: null,\n tagClass: undefined,\n tagPills: false,\n tagRemoveLabel: undefined,\n tagRemovedLabel: 'Tag removed',\n tagValidator: () => true,\n tagVariant: 'secondary',\n})\nconst props = useDefaults(_props, 'BFormTags')\nconst emit = defineEmits<BFormTagsEmits>()\ndefineSlots<BFormTagsSlots>()\n\nconst modelValue = defineModel<Exclude<BFormTagsProps['modelValue'], undefined>>({\n default: () => [],\n})\n\nconst computedId = useId()\n\nconst limitNumber = useToNumber(() => props.limit ?? Number.NaN)\n\nconst stateClass = useStateClass(() => props.state)\n\nconst input = useTemplateRef('_input')\n\nconst {focused} = useFocus(input, {\n initialValue: props.autofocus,\n})\n\nconst _inputId = computed(() => props.inputId || `${computedId.value}input__`)\nconst tags = ref<string[]>([...modelValue.value])\nconst inputValue = ref<string>('')\nconst shouldRemoveOnDelete = ref<boolean>(modelValue.value.length > 0)\nconst lastRemovedTag = ref<string>('')\nconst validTags = ref<string[]>([])\nconst invalidTags = ref<string[]>([])\nconst duplicateTags = ref<string[]>([])\n\nsyncRef(modelValue, tags, {\n direction: 'ltr',\n transform: {\n ltr: (v) => [...v],\n },\n})\n\nconst computedClasses = computed(() => [\n stateClass.value,\n {\n [`form-control-${props.size}`]: props.size !== 'md',\n disabled: props.disabled,\n focus: focused.value,\n },\n])\n\nconst isDuplicate = computed(() => tags.value.includes(inputValue.value))\nconst isInvalid = computed(() =>\n inputValue.value === '' ? false : !props.tagValidator(inputValue.value)\n)\nconst isLimitReached = computed(() => tags.value.length === limitNumber.value)\nconst disableAddButton = computed(() => !isInvalid.value && !isDuplicate.value)\n\nconst onFocusin = (e: Readonly<FocusEvent>): void => {\n if (props.disabled) {\n const target = e.target as HTMLDivElement\n target.blur()\n return\n }\n\n emit('focusin', e)\n}\n\nconst onClick = (e: Readonly<MouseEvent>): void => {\n if (props.disabled || props.noOuterFocus) {\n return\n }\n\n const {target} = e\n const ignoreSelectors = props.ignoreInputFocusSelector\n if (ignoreSelectors && target instanceof Element) {\n const selector =\n typeof ignoreSelectors === 'string' ? ignoreSelectors : ignoreSelectors.join(',')\n\n if (selector && target.closest(selector)) {\n return\n }\n }\n\n focused.value = true\n}\n\nconst onFocus = (e: Readonly<FocusEvent>): void => {\n if (props.disabled || props.noOuterFocus) {\n return\n }\n\n focused.value = true\n emit('focus', e)\n}\n\nconst onBlur = (e: Readonly<FocusEvent>): void => {\n focused.value = false\n emit('blur', e)\n}\n\nconst onInput = (e: Readonly<Event> | string): void => {\n const value = typeof e === 'string' ? e : (e.target as HTMLInputElement).value\n\n shouldRemoveOnDelete.value = false\n\n if (props.separator?.includes(value.charAt(0)) && value.length > 0) {\n if (input.value) {\n input.value.value = ''\n }\n return\n }\n\n inputValue.value = value\n\n if (props.separator?.includes(value.charAt(value.length - 1))) {\n addTag(value.slice(0, value.length - 1))\n return\n }\n\n validTags.value = props.tagValidator(value) && !isDuplicate.value ? [value] : []\n invalidTags.value = props.tagValidator(value) ? [] : [value]\n duplicateTags.value = isDuplicate.value ? [value] : []\n\n emit('tag-state', validTags.value, invalidTags.value, duplicateTags.value)\n}\n\nconst onChange = (e: Readonly<Event>): void => {\n if (props.addOnChange) {\n onInput(e)\n\n if (!isDuplicate.value) {\n addTag(inputValue.value)\n }\n }\n}\n\nconst onKeydown = (e: Readonly<KeyboardEvent>): void => {\n if ((e.key === 'Enter' || e.code === 'NumpadEnter') && !props.noAddOnEnter) {\n addTag(inputValue.value)\n return\n }\n\n if (\n (e.key === 'Backspace' || e.key === 'Delete') &&\n props.removeOnDelete &&\n inputValue.value === '' &&\n shouldRemoveOnDelete.value &&\n tags.value.length > 0\n ) {\n removeTag(tags.value[tags.value.length - 1])\n } else {\n shouldRemoveOnDelete.value = true\n }\n}\n\nonKeyStroke(onKeydown, {target: input, passive: true})\n\nconst separator = computed(() => {\n if (!props.separator) {\n return\n }\n\n return typeof props.separator === 'string' ? props.separator : props.separator.join('')\n})\n\nconst separatorRegExp = computed(() => {\n if (!separator.value) {\n return\n }\n\n return new RegExp(`[${escapeRegExpChars(separator.value)}]+`)\n})\n\nconst addTag = (tag?: string): void => {\n tag = (tag ?? inputValue.value).trim()\n\n const newTags = separatorRegExp.value\n ? tag.split(separatorRegExp.value).map((t) => t.trim())\n : [tag]\n const validTags: string[] = []\n\n for (const newTag of newTags) {\n if (newTag === '' || isDuplicate.value || !props.tagValidator(newTag)) {\n continue\n }\n\n if (limitNumber.value && isLimitReached.value) {\n break\n }\n\n validTags.push(newTag)\n }\n\n const newValue = [...modelValue.value, ...validTags]\n inputValue.value = ''\n shouldRemoveOnDelete.value = true\n modelValue.value = newValue\n focused.value = true\n}\n\nconst removeTag = (tag?: string): void => {\n const tagIndex = tags.value.indexOf(tag?.toString() ?? '')\n if (tagIndex === -1) return\n lastRemovedTag.value = tags.value.splice(tagIndex, 1).toString()\n modelValue.value = tags.value\n}\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n element: input,\n focus: () => {\n focused.value = true\n },\n inputValue,\n})\n</script>\n","<template>\n <div\n :id=\"computedId\"\n class=\"b-form-tags form-control h-auto\"\n :class=\"computedClasses\"\n role=\"group\"\n tabindex=\"-1\"\n @click=\"onClick\"\n @focusin=\"onFocusin\"\n @focusout=\"emit('focusout', $event)\"\n >\n <output\n :id=\"`${computedId}selected_tags__`\"\n class=\"visually-hidden\"\n :for=\"_inputId\"\n :aria-live=\"focused ? 'polite' : 'off'\"\n aria-atomic=\"true\"\n aria-relevant=\"additions text\"\n >{{ tags.join(', ') }}</output\n >\n <div\n :id=\"`${computedId}removed_tags__`\"\n role=\"status\"\n :aria-live=\"focused ? 'assertive' : 'off'\"\n aria-atomic=\"true\"\n class=\"visually-hidden\"\n >\n ({{ props.tagRemovedLabel }}) {{ lastRemovedTag }}\n </div>\n\n <slot\n :add-button-text=\"props.addButtonText\"\n :add-button-variant=\"props.addButtonVariant\"\n :add-tag\n :disable-add-button=\"disableAddButton\"\n :disabled=\"props.disabled\"\n :duplicate-tag-text=\"props.duplicateTagText\"\n :duplicate-tags=\"duplicateTags\"\n :form=\"props.form\"\n :input-attrs=\"{\n ...props.inputAttrs,\n disabled: props.disabled,\n form: props.form,\n id: _inputId,\n value: inputValue,\n }\"\n :input-class=\"props.inputClass\"\n :input-handlers=\"{\n input: onInput,\n keydown: onKeydown,\n change: onChange,\n }\"\n :input-id=\"_inputId\"\n :input-type=\"props.inputType\"\n :invalid-tag-text=\"props.invalidTagText\"\n :invalid-tags\n :is-duplicate\n :is-invalid\n :is-limit-reached=\"isLimitReached\"\n :limit-tags-text=\"props.limitTagsText\"\n :limit=\"limitNumber\"\n :no-tag-remove=\"props.noTagRemove\"\n :placeholder=\"props.placeholder\"\n :remove-tag\n :required=\"props.required\"\n :separator=\"props.separator\"\n :size=\"props.size\"\n :state=\"props.state\"\n :tag-class=\"props.tagClass\"\n :tag-pills=\"props.tagPills\"\n :tag-remove-label=\"props.tagRemoveLabel\"\n :tag-variant=\"props.tagVariant\"\n :tags\n >\n <ul\n :id=\"`${computedId}tag_list__`\"\n class=\"b-form-tags-list list-unstyled mb-0 d-flex flex-wrap align-items-center\"\n >\n <template v-for=\"(tag, index) in tags\" :key=\"index\">\n <slot\n name=\"tag\"\n :tag=\"tag\"\n :tag-class=\"props.tagClass\"\n :tag-variant=\"props.tagVariant\"\n :tag-pills=\"props.tagPills\"\n :remove-tag=\"removeTag\"\n >\n <BFormTag\n :key=\"tag\"\n :class=\"props.tagClass\"\n tag=\"li\"\n :variant=\"props.tagVariant\"\n :pill=\"props.tagPills\"\n :no-remove=\"props.noTagRemove\"\n :disabled=\"props.disabled\"\n @remove=\"removeTag\"\n >{{ tag }}</BFormTag\n >\n </slot>\n </template>\n <li\n role=\"none\"\n aria-live=\"off\"\n class=\"b-from-tags-field flex-grow-1\"\n :aria-controls=\"`${computedId}tag_list__`\"\n >\n <div role=\"group\" class=\"d-flex\">\n <input\n :id=\"_inputId\"\n ref=\"_input\"\n :disabled=\"props.disabled\"\n :value=\"inputValue\"\n :type=\"props.inputType\"\n :placeholder=\"props.placeholder\"\n class=\"b-form-tags-input w-100 flex-grow-1 p-0 m-0 bg-transparent border-0\"\n style=\"outline: currentcolor none 0px; min-width: 5rem\"\n v-bind=\"props.inputAttrs\"\n :form=\"props.form\"\n :required=\"props.required || undefined\"\n :aria-required=\"props.required || undefined\"\n @input=\"onInput\"\n @change=\"onChange\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n />\n <button\n v-if=\"disableAddButton\"\n type=\"button\"\n class=\"btn b-form-tags-button py-0\"\n :class=\"[\n inputClass,\n {\n [`btn-${props.addButtonVariant}`]: props.addButtonVariant !== null,\n 'disabled invisible': inputValue.length === 0,\n },\n ]\"\n style=\"font-size: 90%\"\n :disabled=\"props.disabled || inputValue.length === 0 || isLimitReached\"\n @click=\"addTag(inputValue)\"\n >\n <slot name=\"add-button-text\">{{ props.addButtonText }}</slot>\n </button>\n </div>\n </li>\n </ul>\n <div :aria-live=\"props.feedbackAriaLive\" aria-atomic=\"true\">\n <div v-if=\"isInvalid\" class=\"d-block invalid-feedback\">\n {{ props.invalidTagText }}: {{ inputValue }}\n </div>\n <small v-if=\"isDuplicate\" class=\"form-text text-body-secondary\"\n >{{ props.duplicateTagText }}: {{ inputValue }}</small\n >\n <small v-if=\"tags.length === props.limit\" class=\"form-text text-body-secondary\">\n {{ props.limitTagsText }}</small\n >\n </div>\n </slot>\n <template v-if=\"props.name\">\n <input\n v-for=\"(tag, index) in tags\"\n :key=\"index\"\n type=\"hidden\"\n :name=\"props.name\"\n :value=\"tag\"\n />\n </template>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {onKeyStroke, syncRef, useFocus, useToNumber} from '@vueuse/core'\nimport {computed, ref, useTemplateRef} from 'vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BFormTagsProps} from '../../types/ComponentProps'\nimport {escapeRegExpChars} from '../../utils/stringUtils'\nimport BFormTag from './BFormTag.vue'\nimport {useId} from '../../composables/useId'\nimport {useStateClass} from '../../composables/useStateClass'\nimport type {BFormTagsEmits, BFormTagsSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<Omit<BFormTagsProps, 'modelValue'>>(), {\n addButtonText: 'Add',\n addButtonVariant: 'outline-secondary',\n addOnChange: false,\n autofocus: false,\n disabled: false,\n duplicateTagText: 'Duplicate tag(s)',\n feedbackAriaLive: 'assertive',\n form: undefined,\n ignoreInputFocusSelector: () => ['.b-form-tag', 'button', 'input', 'select'],\n inputAttrs: undefined,\n inputClass: undefined,\n inputId: undefined,\n inputType: 'text',\n invalidTagText: 'Invalid tag(s)',\n limit: undefined,\n limitTagsText: 'Tag limit reached',\n name: undefined,\n noAddOnEnter: false,\n noOuterFocus: false,\n noTagRemove: false,\n placeholder: 'Add tag...',\n removeOnDelete: false,\n required: false,\n separator: undefined,\n size: 'md',\n state: null,\n tagClass: undefined,\n tagPills: false,\n tagRemoveLabel: undefined,\n tagRemovedLabel: 'Tag removed',\n tagValidator: () => true,\n tagVariant: 'secondary',\n})\nconst props = useDefaults(_props, 'BFormTags')\nconst emit = defineEmits<BFormTagsEmits>()\ndefineSlots<BFormTagsSlots>()\n\nconst modelValue = defineModel<Exclude<BFormTagsProps['modelValue'], undefined>>({\n default: () => [],\n})\n\nconst computedId = useId()\n\nconst limitNumber = useToNumber(() => props.limit ?? Number.NaN)\n\nconst stateClass = useStateClass(() => props.state)\n\nconst input = useTemplateRef('_input')\n\nconst {focused} = useFocus(input, {\n initialValue: props.autofocus,\n})\n\nconst _inputId = computed(() => props.inputId || `${computedId.value}input__`)\nconst tags = ref<string[]>([...modelValue.value])\nconst inputValue = ref<string>('')\nconst shouldRemoveOnDelete = ref<boolean>(modelValue.value.length > 0)\nconst lastRemovedTag = ref<string>('')\nconst validTags = ref<string[]>([])\nconst invalidTags = ref<string[]>([])\nconst duplicateTags = ref<string[]>([])\n\nsyncRef(modelValue, tags, {\n direction: 'ltr',\n transform: {\n ltr: (v) => [...v],\n },\n})\n\nconst computedClasses = computed(() => [\n stateClass.value,\n {\n [`form-control-${props.size}`]: props.size !== 'md',\n disabled: props.disabled,\n focus: focused.value,\n },\n])\n\nconst isDuplicate = computed(() => tags.value.includes(inputValue.value))\nconst isInvalid = computed(() =>\n inputValue.value === '' ? false : !props.tagValidator(inputValue.value)\n)\nconst isLimitReached = computed(() => tags.value.length === limitNumber.value)\nconst disableAddButton = computed(() => !isInvalid.value && !isDuplicate.value)\n\nconst onFocusin = (e: Readonly<FocusEvent>): void => {\n if (props.disabled) {\n const target = e.target as HTMLDivElement\n target.blur()\n return\n }\n\n emit('focusin', e)\n}\n\nconst onClick = (e: Readonly<MouseEvent>): void => {\n if (props.disabled || props.noOuterFocus) {\n return\n }\n\n const {target} = e\n const ignoreSelectors = props.ignoreInputFocusSelector\n if (ignoreSelectors && target instanceof Element) {\n const selector =\n typeof ignoreSelectors === 'string' ? ignoreSelectors : ignoreSelectors.join(',')\n\n if (selector && target.closest(selector)) {\n return\n }\n }\n\n focused.value = true\n}\n\nconst onFocus = (e: Readonly<FocusEvent>): void => {\n if (props.disabled || props.noOuterFocus) {\n return\n }\n\n focused.value = true\n emit('focus', e)\n}\n\nconst onBlur = (e: Readonly<FocusEvent>): void => {\n focused.value = false\n emit('blur', e)\n}\n\nconst onInput = (e: Readonly<Event> | string): void => {\n const value = typeof e === 'string' ? e : (e.target as HTMLInputElement).value\n\n shouldRemoveOnDelete.value = false\n\n if (props.separator?.includes(value.charAt(0)) && value.length > 0) {\n if (input.value) {\n input.value.value = ''\n }\n return\n }\n\n inputValue.value = value\n\n if (props.separator?.includes(value.charAt(value.length - 1))) {\n addTag(value.slice(0, value.length - 1))\n return\n }\n\n validTags.value = props.tagValidator(value) && !isDuplicate.value ? [value] : []\n invalidTags.value = props.tagValidator(value) ? [] : [value]\n duplicateTags.value = isDuplicate.value ? [value] : []\n\n emit('tag-state', validTags.value, invalidTags.value, duplicateTags.value)\n}\n\nconst onChange = (e: Readonly<Event>): void => {\n if (props.addOnChange) {\n onInput(e)\n\n if (!isDuplicate.value) {\n addTag(inputValue.value)\n }\n }\n}\n\nconst onKeydown = (e: Readonly<KeyboardEvent>): void => {\n if ((e.key === 'Enter' || e.code === 'NumpadEnter') && !props.noAddOnEnter) {\n addTag(inputValue.value)\n return\n }\n\n if (\n (e.key === 'Backspace' || e.key === 'Delete') &&\n props.removeOnDelete &&\n inputValue.value === '' &&\n shouldRemoveOnDelete.value &&\n tags.value.length > 0\n ) {\n removeTag(tags.value[tags.value.length - 1])\n } else {\n shouldRemoveOnDelete.value = true\n }\n}\n\nonKeyStroke(onKeydown, {target: input, passive: true})\n\nconst separator = computed(() => {\n if (!props.separator) {\n return\n }\n\n return typeof props.separator === 'string' ? props.separator : props.separator.join('')\n})\n\nconst separatorRegExp = computed(() => {\n if (!separator.value) {\n return\n }\n\n return new RegExp(`[${escapeRegExpChars(separator.value)}]+`)\n})\n\nconst addTag = (tag?: string): void => {\n tag = (tag ?? inputValue.value).trim()\n\n const newTags = separatorRegExp.value\n ? tag.split(separatorRegExp.value).map((t) => t.trim())\n : [tag]\n const validTags: string[] = []\n\n for (const newTag of newTags) {\n if (newTag === '' || isDuplicate.value || !props.tagValidator(newTag)) {\n continue\n }\n\n if (limitNumber.value && isLimitReached.value) {\n break\n }\n\n validTags.push(newTag)\n }\n\n const newValue = [...modelValue.value, ...validTags]\n inputValue.value = ''\n shouldRemoveOnDelete.value = true\n modelValue.value = newValue\n focused.value = true\n}\n\nconst removeTag = (tag?: string): void => {\n const tagIndex = tags.value.indexOf(tag?.toString() ?? '')\n if (tagIndex === -1) return\n lastRemovedTag.value = tags.value.splice(tagIndex, 1).toString()\n modelValue.value = tags.value\n}\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n element: input,\n focus: () => {\n focused.value = true\n },\n inputValue,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsNA,MAAM,QAAQ,oBAAA,YAlCC,SAkCmB,YAAW;EAC7C,MAAM,OAAO;EAGb,MAAM,cAAA,GAAA,IAAA,UAA0E,SAAA,aAE/E;EAED,MAAM,aAAa,cAAA,OAAM;EAEzB,MAAM,cAAc,aAAA,kBAAkB,MAAM,SAAS,IAAU;EAE/D,MAAM,aAAa,sBAAA,oBAAoB,MAAM,MAAK;EAElD,MAAM,SAAA,GAAA,IAAA,gBAAuB,SAAQ;EAErC,MAAM,EAAC,YAAW,aAAA,SAAS,OAAO,EAChC,cAAc,MAAM,WACrB,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,GAAA,IAAA,YALuB,KAAA,QAAf,KAAK,UAAK;8DAKlB,SAAA;MAJC,KAAK;MACN,MAAK;MACJ,OAAA,GAAA,IAAA,OAAM,MAAK,CAAC;MACZ,OAAO"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BFormTags-CJb4H67g.mjs","names":[],"sources":["../src/components/BFormTags/BFormTags.vue","../src/components/BFormTags/BFormTags.vue"],"sourcesContent":["<template>\n <div\n :id=\"computedId\"\n class=\"b-form-tags form-control h-auto\"\n :class=\"computedClasses\"\n role=\"group\"\n tabindex=\"-1\"\n @click=\"onClick\"\n @focusin=\"onFocusin\"\n @focusout=\"emit('focusout', $event)\"\n >\n <output\n :id=\"`${computedId}selected_tags__`\"\n class=\"visually-hidden\"\n :for=\"_inputId\"\n :aria-live=\"focused ? 'polite' : 'off'\"\n aria-atomic=\"true\"\n aria-relevant=\"additions text\"\n >{{ tags.join(', ') }}</output\n >\n <div\n :id=\"`${computedId}removed_tags__`\"\n role=\"status\"\n :aria-live=\"focused ? 'assertive' : 'off'\"\n aria-atomic=\"true\"\n class=\"visually-hidden\"\n >\n ({{ props.tagRemovedLabel }}) {{ lastRemovedTag }}\n </div>\n\n <slot\n :add-button-text=\"props.addButtonText\"\n :add-button-variant=\"props.addButtonVariant\"\n :add-tag\n :disable-add-button=\"disableAddButton\"\n :disabled=\"props.disabled\"\n :duplicate-tag-text=\"props.duplicateTagText\"\n :duplicate-tags=\"duplicateTags\"\n :form=\"props.form\"\n :input-attrs=\"{\n ...props.inputAttrs,\n disabled: props.disabled,\n form: props.form,\n id: _inputId,\n value: inputValue,\n }\"\n :input-class=\"props.inputClass\"\n :input-handlers=\"{\n input: onInput,\n keydown: onKeydown,\n change: onChange,\n }\"\n :input-id=\"_inputId\"\n :input-type=\"props.inputType\"\n :invalid-tag-text=\"props.invalidTagText\"\n :invalid-tags\n :is-duplicate\n :is-invalid\n :is-limit-reached=\"isLimitReached\"\n :limit-tags-text=\"props.limitTagsText\"\n :limit=\"limitNumber\"\n :no-tag-remove=\"props.noTagRemove\"\n :placeholder=\"props.placeholder\"\n :remove-tag\n :required=\"props.required\"\n :separator=\"props.separator\"\n :size=\"props.size\"\n :state=\"props.state\"\n :tag-class=\"props.tagClass\"\n :tag-pills=\"props.tagPills\"\n :tag-remove-label=\"props.tagRemoveLabel\"\n :tag-variant=\"props.tagVariant\"\n :tags\n >\n <ul\n :id=\"`${computedId}tag_list__`\"\n class=\"b-form-tags-list list-unstyled mb-0 d-flex flex-wrap align-items-center\"\n >\n <template v-for=\"(tag, index) in tags\" :key=\"index\">\n <slot\n name=\"tag\"\n :tag=\"tag\"\n :tag-class=\"props.tagClass\"\n :tag-variant=\"props.tagVariant\"\n :tag-pills=\"props.tagPills\"\n :remove-tag=\"removeTag\"\n >\n <BFormTag\n :key=\"tag\"\n :class=\"props.tagClass\"\n tag=\"li\"\n :variant=\"props.tagVariant\"\n :pill=\"props.tagPills\"\n :no-remove=\"props.noTagRemove\"\n :disabled=\"props.disabled\"\n @remove=\"removeTag\"\n >{{ tag }}</BFormTag\n >\n </slot>\n </template>\n <li\n role=\"none\"\n aria-live=\"off\"\n class=\"b-from-tags-field flex-grow-1\"\n :aria-controls=\"`${computedId}tag_list__`\"\n >\n <div role=\"group\" class=\"d-flex\">\n <input\n :id=\"_inputId\"\n ref=\"_input\"\n :disabled=\"props.disabled\"\n :value=\"inputValue\"\n :type=\"props.inputType\"\n :placeholder=\"props.placeholder\"\n class=\"b-form-tags-input w-100 flex-grow-1 p-0 m-0 bg-transparent border-0\"\n style=\"outline: currentcolor none 0px; min-width: 5rem\"\n v-bind=\"props.inputAttrs\"\n :form=\"props.form\"\n :required=\"props.required || undefined\"\n :aria-required=\"props.required || undefined\"\n @input=\"onInput\"\n @change=\"onChange\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n />\n <button\n v-if=\"disableAddButton\"\n type=\"button\"\n class=\"btn b-form-tags-button py-0\"\n :class=\"[\n inputClass,\n {\n [`btn-${props.addButtonVariant}`]: props.addButtonVariant !== null,\n 'disabled invisible': inputValue.length === 0,\n },\n ]\"\n style=\"font-size: 90%\"\n :disabled=\"props.disabled || inputValue.length === 0 || isLimitReached\"\n @click=\"addTag(inputValue)\"\n >\n <slot name=\"add-button-text\">{{ props.addButtonText }}</slot>\n </button>\n </div>\n </li>\n </ul>\n <div :aria-live=\"props.feedbackAriaLive\" aria-atomic=\"true\">\n <div v-if=\"isInvalid\" class=\"d-block invalid-feedback\">\n {{ props.invalidTagText }}: {{ inputValue }}\n </div>\n <small v-if=\"isDuplicate\" class=\"form-text text-body-secondary\"\n >{{ props.duplicateTagText }}: {{ inputValue }}</small\n >\n <small v-if=\"tags.length === props.limit\" class=\"form-text text-body-secondary\">\n {{ props.limitTagsText }}</small\n >\n </div>\n </slot>\n <template v-if=\"props.name\">\n <input\n v-for=\"(tag, index) in tags\"\n :key=\"index\"\n type=\"hidden\"\n :name=\"props.name\"\n :value=\"tag\"\n />\n </template>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {onKeyStroke, syncRef, useFocus, useToNumber} from '@vueuse/core'\nimport {computed, ref, useTemplateRef} from 'vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BFormTagsProps} from '../../types/ComponentProps'\nimport {escapeRegExpChars} from '../../utils/stringUtils'\nimport BFormTag from './BFormTag.vue'\nimport {useId} from '../../composables/useId'\nimport {useStateClass} from '../../composables/useStateClass'\nimport type {BFormTagsEmits, BFormTagsSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<Omit<BFormTagsProps, 'modelValue'>>(), {\n addButtonText: 'Add',\n addButtonVariant: 'outline-secondary',\n addOnChange: false,\n autofocus: false,\n disabled: false,\n duplicateTagText: 'Duplicate tag(s)',\n feedbackAriaLive: 'assertive',\n form: undefined,\n ignoreInputFocusSelector: () => ['.b-form-tag', 'button', 'input', 'select'],\n inputAttrs: undefined,\n inputClass: undefined,\n inputId: undefined,\n inputType: 'text',\n invalidTagText: 'Invalid tag(s)',\n limit: undefined,\n limitTagsText: 'Tag limit reached',\n name: undefined,\n noAddOnEnter: false,\n noOuterFocus: false,\n noTagRemove: false,\n placeholder: 'Add tag...',\n removeOnDelete: false,\n required: false,\n separator: undefined,\n size: 'md',\n state: null,\n tagClass: undefined,\n tagPills: false,\n tagRemoveLabel: undefined,\n tagRemovedLabel: 'Tag removed',\n tagValidator: () => true,\n tagVariant: 'secondary',\n})\nconst props = useDefaults(_props, 'BFormTags')\nconst emit = defineEmits<BFormTagsEmits>()\ndefineSlots<BFormTagsSlots>()\n\nconst modelValue = defineModel<Exclude<BFormTagsProps['modelValue'], undefined>>({\n default: () => [],\n})\n\nconst computedId = useId()\n\nconst limitNumber = useToNumber(() => props.limit ?? Number.NaN)\n\nconst stateClass = useStateClass(() => props.state)\n\nconst input = useTemplateRef('_input')\n\nconst {focused} = useFocus(input, {\n initialValue: props.autofocus,\n})\n\nconst _inputId = computed(() => props.inputId || `${computedId.value}input__`)\nconst tags = ref<string[]>([...modelValue.value])\nconst inputValue = ref<string>('')\nconst shouldRemoveOnDelete = ref<boolean>(modelValue.value.length > 0)\nconst lastRemovedTag = ref<string>('')\nconst validTags = ref<string[]>([])\nconst invalidTags = ref<string[]>([])\nconst duplicateTags = ref<string[]>([])\n\nsyncRef(modelValue, tags, {\n direction: 'ltr',\n transform: {\n ltr: (v) => [...v],\n },\n})\n\nconst computedClasses = computed(() => [\n stateClass.value,\n {\n [`form-control-${props.size}`]: props.size !== 'md',\n disabled: props.disabled,\n focus: focused.value,\n },\n])\n\nconst isDuplicate = computed(() => tags.value.includes(inputValue.value))\nconst isInvalid = computed(() =>\n inputValue.value === '' ? false : !props.tagValidator(inputValue.value)\n)\nconst isLimitReached = computed(() => tags.value.length === limitNumber.value)\nconst disableAddButton = computed(() => !isInvalid.value && !isDuplicate.value)\n\nconst onFocusin = (e: Readonly<FocusEvent>): void => {\n if (props.disabled) {\n const target = e.target as HTMLDivElement\n target.blur()\n return\n }\n\n emit('focusin', e)\n}\n\nconst onClick = (e: Readonly<MouseEvent>): void => {\n if (props.disabled || props.noOuterFocus) {\n return\n }\n\n const {target} = e\n const ignoreSelectors = props.ignoreInputFocusSelector\n if (ignoreSelectors && target instanceof Element) {\n const selector =\n typeof ignoreSelectors === 'string' ? ignoreSelectors : ignoreSelectors.join(',')\n\n if (selector && target.closest(selector)) {\n return\n }\n }\n\n focused.value = true\n}\n\nconst onFocus = (e: Readonly<FocusEvent>): void => {\n if (props.disabled || props.noOuterFocus) {\n return\n }\n\n focused.value = true\n emit('focus', e)\n}\n\nconst onBlur = (e: Readonly<FocusEvent>): void => {\n focused.value = false\n emit('blur', e)\n}\n\nconst onInput = (e: Readonly<Event> | string): void => {\n const value = typeof e === 'string' ? e : (e.target as HTMLInputElement).value\n\n shouldRemoveOnDelete.value = false\n\n if (props.separator?.includes(value.charAt(0)) && value.length > 0) {\n if (input.value) {\n input.value.value = ''\n }\n return\n }\n\n inputValue.value = value\n\n if (props.separator?.includes(value.charAt(value.length - 1))) {\n addTag(value.slice(0, value.length - 1))\n return\n }\n\n validTags.value = props.tagValidator(value) && !isDuplicate.value ? [value] : []\n invalidTags.value = props.tagValidator(value) ? [] : [value]\n duplicateTags.value = isDuplicate.value ? [value] : []\n\n emit('tag-state', validTags.value, invalidTags.value, duplicateTags.value)\n}\n\nconst onChange = (e: Readonly<Event>): void => {\n if (props.addOnChange) {\n onInput(e)\n\n if (!isDuplicate.value) {\n addTag(inputValue.value)\n }\n }\n}\n\nconst onKeydown = (e: Readonly<KeyboardEvent>): void => {\n if ((e.key === 'Enter' || e.code === 'NumpadEnter') && !props.noAddOnEnter) {\n addTag(inputValue.value)\n return\n }\n\n if (\n (e.key === 'Backspace' || e.key === 'Delete') &&\n props.removeOnDelete &&\n inputValue.value === '' &&\n shouldRemoveOnDelete.value &&\n tags.value.length > 0\n ) {\n removeTag(tags.value[tags.value.length - 1])\n } else {\n shouldRemoveOnDelete.value = true\n }\n}\n\nonKeyStroke(onKeydown, {target: input, passive: true})\n\nconst separator = computed(() => {\n if (!props.separator) {\n return\n }\n\n return typeof props.separator === 'string' ? props.separator : props.separator.join('')\n})\n\nconst separatorRegExp = computed(() => {\n if (!separator.value) {\n return\n }\n\n return new RegExp(`[${escapeRegExpChars(separator.value)}]+`)\n})\n\nconst addTag = (tag?: string): void => {\n tag = (tag ?? inputValue.value).trim()\n\n const newTags = separatorRegExp.value\n ? tag.split(separatorRegExp.value).map((t) => t.trim())\n : [tag]\n const validTags: string[] = []\n\n for (const newTag of newTags) {\n if (newTag === '' || isDuplicate.value || !props.tagValidator(newTag)) {\n continue\n }\n\n if (limitNumber.value && isLimitReached.value) {\n break\n }\n\n validTags.push(newTag)\n }\n\n const newValue = [...modelValue.value, ...validTags]\n inputValue.value = ''\n shouldRemoveOnDelete.value = true\n modelValue.value = newValue\n focused.value = true\n}\n\nconst removeTag = (tag?: string): void => {\n const tagIndex = tags.value.indexOf(tag?.toString() ?? '')\n if (tagIndex === -1) return\n lastRemovedTag.value = tags.value.splice(tagIndex, 1).toString()\n modelValue.value = tags.value\n}\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n element: input,\n focus: () => {\n focused.value = true\n },\n inputValue,\n})\n</script>\n","<template>\n <div\n :id=\"computedId\"\n class=\"b-form-tags form-control h-auto\"\n :class=\"computedClasses\"\n role=\"group\"\n tabindex=\"-1\"\n @click=\"onClick\"\n @focusin=\"onFocusin\"\n @focusout=\"emit('focusout', $event)\"\n >\n <output\n :id=\"`${computedId}selected_tags__`\"\n class=\"visually-hidden\"\n :for=\"_inputId\"\n :aria-live=\"focused ? 'polite' : 'off'\"\n aria-atomic=\"true\"\n aria-relevant=\"additions text\"\n >{{ tags.join(', ') }}</output\n >\n <div\n :id=\"`${computedId}removed_tags__`\"\n role=\"status\"\n :aria-live=\"focused ? 'assertive' : 'off'\"\n aria-atomic=\"true\"\n class=\"visually-hidden\"\n >\n ({{ props.tagRemovedLabel }}) {{ lastRemovedTag }}\n </div>\n\n <slot\n :add-button-text=\"props.addButtonText\"\n :add-button-variant=\"props.addButtonVariant\"\n :add-tag\n :disable-add-button=\"disableAddButton\"\n :disabled=\"props.disabled\"\n :duplicate-tag-text=\"props.duplicateTagText\"\n :duplicate-tags=\"duplicateTags\"\n :form=\"props.form\"\n :input-attrs=\"{\n ...props.inputAttrs,\n disabled: props.disabled,\n form: props.form,\n id: _inputId,\n value: inputValue,\n }\"\n :input-class=\"props.inputClass\"\n :input-handlers=\"{\n input: onInput,\n keydown: onKeydown,\n change: onChange,\n }\"\n :input-id=\"_inputId\"\n :input-type=\"props.inputType\"\n :invalid-tag-text=\"props.invalidTagText\"\n :invalid-tags\n :is-duplicate\n :is-invalid\n :is-limit-reached=\"isLimitReached\"\n :limit-tags-text=\"props.limitTagsText\"\n :limit=\"limitNumber\"\n :no-tag-remove=\"props.noTagRemove\"\n :placeholder=\"props.placeholder\"\n :remove-tag\n :required=\"props.required\"\n :separator=\"props.separator\"\n :size=\"props.size\"\n :state=\"props.state\"\n :tag-class=\"props.tagClass\"\n :tag-pills=\"props.tagPills\"\n :tag-remove-label=\"props.tagRemoveLabel\"\n :tag-variant=\"props.tagVariant\"\n :tags\n >\n <ul\n :id=\"`${computedId}tag_list__`\"\n class=\"b-form-tags-list list-unstyled mb-0 d-flex flex-wrap align-items-center\"\n >\n <template v-for=\"(tag, index) in tags\" :key=\"index\">\n <slot\n name=\"tag\"\n :tag=\"tag\"\n :tag-class=\"props.tagClass\"\n :tag-variant=\"props.tagVariant\"\n :tag-pills=\"props.tagPills\"\n :remove-tag=\"removeTag\"\n >\n <BFormTag\n :key=\"tag\"\n :class=\"props.tagClass\"\n tag=\"li\"\n :variant=\"props.tagVariant\"\n :pill=\"props.tagPills\"\n :no-remove=\"props.noTagRemove\"\n :disabled=\"props.disabled\"\n @remove=\"removeTag\"\n >{{ tag }}</BFormTag\n >\n </slot>\n </template>\n <li\n role=\"none\"\n aria-live=\"off\"\n class=\"b-from-tags-field flex-grow-1\"\n :aria-controls=\"`${computedId}tag_list__`\"\n >\n <div role=\"group\" class=\"d-flex\">\n <input\n :id=\"_inputId\"\n ref=\"_input\"\n :disabled=\"props.disabled\"\n :value=\"inputValue\"\n :type=\"props.inputType\"\n :placeholder=\"props.placeholder\"\n class=\"b-form-tags-input w-100 flex-grow-1 p-0 m-0 bg-transparent border-0\"\n style=\"outline: currentcolor none 0px; min-width: 5rem\"\n v-bind=\"props.inputAttrs\"\n :form=\"props.form\"\n :required=\"props.required || undefined\"\n :aria-required=\"props.required || undefined\"\n @input=\"onInput\"\n @change=\"onChange\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n />\n <button\n v-if=\"disableAddButton\"\n type=\"button\"\n class=\"btn b-form-tags-button py-0\"\n :class=\"[\n inputClass,\n {\n [`btn-${props.addButtonVariant}`]: props.addButtonVariant !== null,\n 'disabled invisible': inputValue.length === 0,\n },\n ]\"\n style=\"font-size: 90%\"\n :disabled=\"props.disabled || inputValue.length === 0 || isLimitReached\"\n @click=\"addTag(inputValue)\"\n >\n <slot name=\"add-button-text\">{{ props.addButtonText }}</slot>\n </button>\n </div>\n </li>\n </ul>\n <div :aria-live=\"props.feedbackAriaLive\" aria-atomic=\"true\">\n <div v-if=\"isInvalid\" class=\"d-block invalid-feedback\">\n {{ props.invalidTagText }}: {{ inputValue }}\n </div>\n <small v-if=\"isDuplicate\" class=\"form-text text-body-secondary\"\n >{{ props.duplicateTagText }}: {{ inputValue }}</small\n >\n <small v-if=\"tags.length === props.limit\" class=\"form-text text-body-secondary\">\n {{ props.limitTagsText }}</small\n >\n </div>\n </slot>\n <template v-if=\"props.name\">\n <input\n v-for=\"(tag, index) in tags\"\n :key=\"index\"\n type=\"hidden\"\n :name=\"props.name\"\n :value=\"tag\"\n />\n </template>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {onKeyStroke, syncRef, useFocus, useToNumber} from '@vueuse/core'\nimport {computed, ref, useTemplateRef} from 'vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BFormTagsProps} from '../../types/ComponentProps'\nimport {escapeRegExpChars} from '../../utils/stringUtils'\nimport BFormTag from './BFormTag.vue'\nimport {useId} from '../../composables/useId'\nimport {useStateClass} from '../../composables/useStateClass'\nimport type {BFormTagsEmits, BFormTagsSlots} from '../../types'\n\nconst _props = withDefaults(defineProps<Omit<BFormTagsProps, 'modelValue'>>(), {\n addButtonText: 'Add',\n addButtonVariant: 'outline-secondary',\n addOnChange: false,\n autofocus: false,\n disabled: false,\n duplicateTagText: 'Duplicate tag(s)',\n feedbackAriaLive: 'assertive',\n form: undefined,\n ignoreInputFocusSelector: () => ['.b-form-tag', 'button', 'input', 'select'],\n inputAttrs: undefined,\n inputClass: undefined,\n inputId: undefined,\n inputType: 'text',\n invalidTagText: 'Invalid tag(s)',\n limit: undefined,\n limitTagsText: 'Tag limit reached',\n name: undefined,\n noAddOnEnter: false,\n noOuterFocus: false,\n noTagRemove: false,\n placeholder: 'Add tag...',\n removeOnDelete: false,\n required: false,\n separator: undefined,\n size: 'md',\n state: null,\n tagClass: undefined,\n tagPills: false,\n tagRemoveLabel: undefined,\n tagRemovedLabel: 'Tag removed',\n tagValidator: () => true,\n tagVariant: 'secondary',\n})\nconst props = useDefaults(_props, 'BFormTags')\nconst emit = defineEmits<BFormTagsEmits>()\ndefineSlots<BFormTagsSlots>()\n\nconst modelValue = defineModel<Exclude<BFormTagsProps['modelValue'], undefined>>({\n default: () => [],\n})\n\nconst computedId = useId()\n\nconst limitNumber = useToNumber(() => props.limit ?? Number.NaN)\n\nconst stateClass = useStateClass(() => props.state)\n\nconst input = useTemplateRef('_input')\n\nconst {focused} = useFocus(input, {\n initialValue: props.autofocus,\n})\n\nconst _inputId = computed(() => props.inputId || `${computedId.value}input__`)\nconst tags = ref<string[]>([...modelValue.value])\nconst inputValue = ref<string>('')\nconst shouldRemoveOnDelete = ref<boolean>(modelValue.value.length > 0)\nconst lastRemovedTag = ref<string>('')\nconst validTags = ref<string[]>([])\nconst invalidTags = ref<string[]>([])\nconst duplicateTags = ref<string[]>([])\n\nsyncRef(modelValue, tags, {\n direction: 'ltr',\n transform: {\n ltr: (v) => [...v],\n },\n})\n\nconst computedClasses = computed(() => [\n stateClass.value,\n {\n [`form-control-${props.size}`]: props.size !== 'md',\n disabled: props.disabled,\n focus: focused.value,\n },\n])\n\nconst isDuplicate = computed(() => tags.value.includes(inputValue.value))\nconst isInvalid = computed(() =>\n inputValue.value === '' ? false : !props.tagValidator(inputValue.value)\n)\nconst isLimitReached = computed(() => tags.value.length === limitNumber.value)\nconst disableAddButton = computed(() => !isInvalid.value && !isDuplicate.value)\n\nconst onFocusin = (e: Readonly<FocusEvent>): void => {\n if (props.disabled) {\n const target = e.target as HTMLDivElement\n target.blur()\n return\n }\n\n emit('focusin', e)\n}\n\nconst onClick = (e: Readonly<MouseEvent>): void => {\n if (props.disabled || props.noOuterFocus) {\n return\n }\n\n const {target} = e\n const ignoreSelectors = props.ignoreInputFocusSelector\n if (ignoreSelectors && target instanceof Element) {\n const selector =\n typeof ignoreSelectors === 'string' ? ignoreSelectors : ignoreSelectors.join(',')\n\n if (selector && target.closest(selector)) {\n return\n }\n }\n\n focused.value = true\n}\n\nconst onFocus = (e: Readonly<FocusEvent>): void => {\n if (props.disabled || props.noOuterFocus) {\n return\n }\n\n focused.value = true\n emit('focus', e)\n}\n\nconst onBlur = (e: Readonly<FocusEvent>): void => {\n focused.value = false\n emit('blur', e)\n}\n\nconst onInput = (e: Readonly<Event> | string): void => {\n const value = typeof e === 'string' ? e : (e.target as HTMLInputElement).value\n\n shouldRemoveOnDelete.value = false\n\n if (props.separator?.includes(value.charAt(0)) && value.length > 0) {\n if (input.value) {\n input.value.value = ''\n }\n return\n }\n\n inputValue.value = value\n\n if (props.separator?.includes(value.charAt(value.length - 1))) {\n addTag(value.slice(0, value.length - 1))\n return\n }\n\n validTags.value = props.tagValidator(value) && !isDuplicate.value ? [value] : []\n invalidTags.value = props.tagValidator(value) ? [] : [value]\n duplicateTags.value = isDuplicate.value ? [value] : []\n\n emit('tag-state', validTags.value, invalidTags.value, duplicateTags.value)\n}\n\nconst onChange = (e: Readonly<Event>): void => {\n if (props.addOnChange) {\n onInput(e)\n\n if (!isDuplicate.value) {\n addTag(inputValue.value)\n }\n }\n}\n\nconst onKeydown = (e: Readonly<KeyboardEvent>): void => {\n if ((e.key === 'Enter' || e.code === 'NumpadEnter') && !props.noAddOnEnter) {\n addTag(inputValue.value)\n return\n }\n\n if (\n (e.key === 'Backspace' || e.key === 'Delete') &&\n props.removeOnDelete &&\n inputValue.value === '' &&\n shouldRemoveOnDelete.value &&\n tags.value.length > 0\n ) {\n removeTag(tags.value[tags.value.length - 1])\n } else {\n shouldRemoveOnDelete.value = true\n }\n}\n\nonKeyStroke(onKeydown, {target: input, passive: true})\n\nconst separator = computed(() => {\n if (!props.separator) {\n return\n }\n\n return typeof props.separator === 'string' ? props.separator : props.separator.join('')\n})\n\nconst separatorRegExp = computed(() => {\n if (!separator.value) {\n return\n }\n\n return new RegExp(`[${escapeRegExpChars(separator.value)}]+`)\n})\n\nconst addTag = (tag?: string): void => {\n tag = (tag ?? inputValue.value).trim()\n\n const newTags = separatorRegExp.value\n ? tag.split(separatorRegExp.value).map((t) => t.trim())\n : [tag]\n const validTags: string[] = []\n\n for (const newTag of newTags) {\n if (newTag === '' || isDuplicate.value || !props.tagValidator(newTag)) {\n continue\n }\n\n if (limitNumber.value && isLimitReached.value) {\n break\n }\n\n validTags.push(newTag)\n }\n\n const newValue = [...modelValue.value, ...validTags]\n inputValue.value = ''\n shouldRemoveOnDelete.value = true\n modelValue.value = newValue\n focused.value = true\n}\n\nconst removeTag = (tag?: string): void => {\n const tagIndex = tags.value.indexOf(tag?.toString() ?? '')\n if (tagIndex === -1) return\n lastRemovedTag.value = tags.value.splice(tagIndex, 1).toString()\n modelValue.value = tags.value\n}\n\ndefineExpose({\n blur: () => {\n focused.value = false\n },\n element: input,\n focus: () => {\n focused.value = true\n },\n inputValue,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;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,gBADD,MAAA,MAAK,CAAC,eAAc,GAAG,OAAE,gBAAG,WAAA,MAAU,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA;KAE9B,YAAA,SAAA,WAAA,EAAb,mBAEC,SAFD,aAEC,gBADK,MAAA,MAAK,CAAC,iBAAgB,GAAG,OAAE,gBAAG,WAAA,MAAU,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA;KAEjC,KAAA,MAAK,WAAW,MAAA,MAAK,CAAC,SAAA,WAAA,EAAnC,mBAEC,SAFD,aAEC,gBADI,MAAA,MAAK,CAAC,cAAa,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA;;IAIZ,MAAA,MAAK,CAAC,QAAA,UAAA,KAAA,EACpB,mBAME,UAAA,EAAA,KAAA,GAAA,EAAA,WALuB,KAAA,QAAf,KAAK,UAAK;yBADpB,mBAME,SAAA;MAJC,KAAK;MACN,MAAK;MACJ,MAAM,MAAA,MAAK,CAAC;MACZ,OAAO"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BInputGroup-DpX10xwR.mjs","names":[],"sources":["../src/components/BInputGroup/BInputGroup.vue","../src/components/BInputGroup/BInputGroup.vue"],"sourcesContent":["<template>\n <component\n :is=\"props.tag\"\n :id=\"props.id\"\n class=\"input-group\"\n :class=\"computedClasses\"\n role=\"group\"\n >\n <slot name=\"prepend\">\n <span v-if=\"hasPrepend\" class=\"input-group-text\">\n <span>{{ props.prepend }}</span>\n </span>\n </slot>\n <slot />\n <slot name=\"append\">\n <span v-if=\"hasAppend\" class=\"input-group-text\">\n <span>{{ props.append }}</span>\n </span>\n </slot>\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BInputGroupProps} from '../../types/ComponentProps'\nimport {computed, provide} from 'vue'\nimport {inputGroupKey} from '../../utils/keys'\nimport type {BInputGroupSlots} from '../../types'\n\nprovide(inputGroupKey, true)\n\nconst _props = withDefaults(defineProps<BInputGroupProps>(), {\n append: undefined,\n id: undefined,\n prepend: undefined,\n size: 'md',\n tag: 'div',\n})\nconst props = useDefaults(_props, 'BInputGroup')\ndefineSlots<BInputGroupSlots>()\n\nconst computedClasses = computed(() => ({\n [`input-group-${props.size}`]: props.size !== 'md',\n}))\nconst hasAppend = computed(() => !!props.append)\nconst hasPrepend = computed(() => !!props.prepend)\n</script>\n","<template>\n <component\n :is=\"props.tag\"\n :id=\"props.id\"\n class=\"input-group\"\n :class=\"computedClasses\"\n role=\"group\"\n >\n <slot name=\"prepend\">\n <span v-if=\"hasPrepend\" class=\"input-group-text\">\n <span>{{ props.prepend }}</span>\n </span>\n </slot>\n <slot />\n <slot name=\"append\">\n <span v-if=\"hasAppend\" class=\"input-group-text\">\n <span>{{ props.append }}</span>\n </span>\n </slot>\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BInputGroupProps} from '../../types/ComponentProps'\nimport {computed, provide} from 'vue'\nimport {inputGroupKey} from '../../utils/keys'\nimport type {BInputGroupSlots} from '../../types'\n\nprovide(inputGroupKey, true)\n\nconst _props = withDefaults(defineProps<BInputGroupProps>(), {\n append: undefined,\n id: undefined,\n prepend: undefined,\n size: 'md',\n tag: 'div',\n})\nconst props = useDefaults(_props, 'BInputGroup')\ndefineSlots<BInputGroupSlots>()\n\nconst computedClasses = computed(() => ({\n [`input-group-${props.size}`]: props.size !== 'md',\n}))\nconst hasAppend = computed(() => !!props.append)\nconst hasPrepend = computed(() => !!props.prepend)\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA6BA,UAAQ,eAAe,KAAI;EAS3B,MAAM,QAAQ,YAPC,SAOmB,cAAa;EAG/C,MAAM,kBAAkB,gBAAgB,GACrC,eAAe,MAAM,SAAS,MAAM,SAAS,MAC/C,EAAC;EACF,MAAM,YAAY,eAAe,CAAC,CAAC,MAAM,OAAM;EAC/C,MAAM,aAAa,eAAe,CAAC,CAAC,MAAM,QAAO;;uBA5C/C,YAkBY,wBAjBL,MAAA,MAAK,CAAC,IAAG,EAAA;IACb,IAAI,MAAA,MAAK,CAAC;IACX,OAAK,eAAA,CAAC,eACE,gBAAA,MAAe,CAAA;IACvB,MAAK;;2BAME;KAJP,WAIO,KAAA,QAAA,WAAA,EAAA,QAAA,CAHO,WAAA,SAAA,WAAA,EAAZ,mBAEO,QAFP,YAEO,CADL,mBAAgC,QAAA,MAAA,gBAAvB,MAAA,MAAK,CAAC,QAAO,EAAA,EAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA;KAG1B,WAAQ,KAAA,QAAA,UAAA;KACR,WAIO,KAAA,QAAA,UAAA,EAAA,QAAA,CAHO,UAAA,SAAA,WAAA,EAAZ,mBAEO,QAFP,YAEO,CADL,mBAA+B,QAAA,MAAA,gBAAtB,MAAA,MAAK,CAAC,OAAM,EAAA,EAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BInputGroup-Duk6Jk0v.js","names":[],"sources":["../src/components/BInputGroup/BInputGroup.vue","../src/components/BInputGroup/BInputGroup.vue"],"sourcesContent":["<template>\n <component\n :is=\"props.tag\"\n :id=\"props.id\"\n class=\"input-group\"\n :class=\"computedClasses\"\n role=\"group\"\n >\n <slot name=\"prepend\">\n <span v-if=\"hasPrepend\" class=\"input-group-text\">\n <span>{{ props.prepend }}</span>\n </span>\n </slot>\n <slot />\n <slot name=\"append\">\n <span v-if=\"hasAppend\" class=\"input-group-text\">\n <span>{{ props.append }}</span>\n </span>\n </slot>\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BInputGroupProps} from '../../types/ComponentProps'\nimport {computed, provide} from 'vue'\nimport {inputGroupKey} from '../../utils/keys'\nimport type {BInputGroupSlots} from '../../types'\n\nprovide(inputGroupKey, true)\n\nconst _props = withDefaults(defineProps<BInputGroupProps>(), {\n append: undefined,\n id: undefined,\n prepend: undefined,\n size: 'md',\n tag: 'div',\n})\nconst props = useDefaults(_props, 'BInputGroup')\ndefineSlots<BInputGroupSlots>()\n\nconst computedClasses = computed(() => ({\n [`input-group-${props.size}`]: props.size !== 'md',\n}))\nconst hasAppend = computed(() => !!props.append)\nconst hasPrepend = computed(() => !!props.prepend)\n</script>\n","<template>\n <component\n :is=\"props.tag\"\n :id=\"props.id\"\n class=\"input-group\"\n :class=\"computedClasses\"\n role=\"group\"\n >\n <slot name=\"prepend\">\n <span v-if=\"hasPrepend\" class=\"input-group-text\">\n <span>{{ props.prepend }}</span>\n </span>\n </slot>\n <slot />\n <slot name=\"append\">\n <span v-if=\"hasAppend\" class=\"input-group-text\">\n <span>{{ props.append }}</span>\n </span>\n </slot>\n </component>\n</template>\n\n<script setup lang=\"ts\">\nimport {useDefaults} from '../../composables/useDefaults'\nimport type {BInputGroupProps} from '../../types/ComponentProps'\nimport {computed, provide} from 'vue'\nimport {inputGroupKey} from '../../utils/keys'\nimport type {BInputGroupSlots} from '../../types'\n\nprovide(inputGroupKey, true)\n\nconst _props = withDefaults(defineProps<BInputGroupProps>(), {\n append: undefined,\n id: undefined,\n prepend: undefined,\n size: 'md',\n tag: 'div',\n})\nconst props = useDefaults(_props, 'BInputGroup')\ndefineSlots<BInputGroupSlots>()\n\nconst computedClasses = computed(() => ({\n [`input-group-${props.size}`]: props.size !== 'md',\n}))\nconst hasAppend = computed(() => !!props.append)\nconst hasPrepend = computed(() => !!props.prepend)\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,GAAA,GAAA,IAAA,SAAQ,aAAA,eAAe,KAAI;EAS3B,MAAM,QAAQ,oBAAA,YAPC,SAOmB,cAAa;EAG/C,MAAM,mBAAA,GAAA,IAAA,iBAAkC,GACrC,eAAe,MAAM,SAAS,MAAM,SAAS,MAC/C,EAAC;EACF,MAAM,aAAA,GAAA,IAAA,gBAA2B,CAAC,CAAC,MAAM,OAAM;EAC/C,MAAM,cAAA,GAAA,IAAA,gBAA4B,CAAC,CAAC,MAAM,QAAO;;qGA3CxC,MAAK,CAAC,IAAG,EAAA;IACb,KAAA,GAAA,IAAA,OAAI,MAAK,CAAC;IACX,QAAA,GAAA,IAAA,gBAAK,CAAC,eACE,gBAAA,MAAe,CAAA;IACvB,MAAK;;oCAME;yBAAA,KAAA,QAAA,WAAA,EAAA,QAAA,CAHO,WAAA,UAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAEL,QAFP,YAEO,EAAA,GAAA,IAAA,oBAD2B,QAAA,OAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,OAAvB,MAAK,CAAC,QAAO,EAAA,EAAA,CAAA,CAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA,CAAA,CAAA;yBAGlB,KAAA,QAAA,UAAA;yBAKD,KAAA,QAAA,UAAA,EAAA,QAAA,CAHO,UAAA,UAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,oBAEL,QAFP,YAEO,EAAA,GAAA,IAAA,oBAD0B,QAAA,OAAA,GAAA,IAAA,kBAAA,GAAA,IAAA,OAAtB,MAAK,CAAC,OAAM,EAAA,EAAA,CAAA,CAAA,KAAA,GAAA,IAAA,oBAAA,IAAA,KAAA,CAAA,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BModal-Br5xLT0-.mjs","names":["$attrs"],"sources":["../src/composables/useModalManager.ts","../src/components/BModal/BModal.vue","../src/components/BModal/BModal.vue"],"sourcesContent":["import {getSSRHandler, tryOnScopeDispose, unrefElement} from '@vueuse/core'\nimport {\n type ComponentInternalInstance,\n computed,\n getCurrentInstance,\n inject,\n type Ref,\n toValue,\n watch,\n} from 'vue'\nimport {modalManagerKey} from '../utils/keys'\nimport {getSafeDocument} from '../utils/dom'\n\nconst modalOpenClassName = 'modal-open'\n\nexport const useSharedModalStack = () => {\n const modalManagerPlugin = inject(modalManagerKey, null)\n\n /**\n * Removes an item from both the stack and registry\n */\n const dispose = (modal: Readonly<ComponentInternalInstance>): void => {\n modalManagerPlugin?.removeStack(modal)\n modalManagerPlugin?.removeRegistry(modal)\n }\n\n const updateHTMLAttrs = getSSRHandler('updateHTMLAttrs', (selector, attribute, value) => {\n const el =\n typeof selector !== 'string'\n ? unrefElement(selector)\n : selector\n ? getSafeDocument()?.querySelector(selector)\n : undefined\n if (!el) return\n\n if (attribute === 'class') {\n el.classList.toggle(modalOpenClassName, value === modalOpenClassName)\n } else {\n el.setAttribute(attribute, value)\n }\n })\n\n tryOnScopeDispose(() => {\n if (modalManagerPlugin?.countStack.value === 0) {\n updateHTMLAttrs('body', 'class', '')\n }\n })\n\n watch(\n () => modalManagerPlugin?.countStack.value,\n (newValue) => {\n if (newValue === undefined) return\n updateHTMLAttrs('body', 'class', newValue > 0 ? modalOpenClassName : '')\n }\n )\n\n return {\n ...modalManagerPlugin,\n dispose,\n }\n}\n\nexport const useModalManager = (modalOpen: Readonly<Ref<boolean>>, initialValue: boolean) => {\n const {pushRegistry, pushStack, removeStack, stack, dispose, countStack} = useSharedModalStack()\n\n const currentModal = getCurrentInstance()\n\n if (!currentModal || currentModal.type.__name !== 'BModal') {\n throw new Error('useModalManager must only use in BModal component')\n }\n\n pushRegistry?.(currentModal)\n\n tryOnScopeDispose(() => {\n dispose(currentModal)\n })\n\n const setInStack = (newValue: boolean, oldValue: boolean) => {\n if (newValue) {\n pushStack?.(currentModal)\n } else if (oldValue && !newValue) {\n removeStack?.(currentModal)\n }\n }\n\n // (initialValue, initialValue) is meant to always only ever trigger the first `if (newValue) {` block. The other block is skipped _always_\n setInStack(initialValue, initialValue)\n\n watch(modalOpen, setInStack)\n\n return {\n activePosition: computed(() =>\n stack?.value.findIndex((el) => toValue(el.exposed?.id) === toValue(currentModal.exposed?.id))\n ),\n activeModalCount: countStack,\n stackWithoutSelf: computed(\n () =>\n stack?.value.filter(\n (el) => toValue(el.exposed?.id) !== toValue(currentModal.exposed?.id)\n ) ?? []\n ),\n }\n}\n","<template>\n <ConditionalTeleport :to=\"props.teleportTo\" :disabled=\"props.teleportDisabled\">\n <Transition\n v-if=\"renderRef || contentShowing\"\n v-bind=\"transitionProps\"\n :appear=\"modelValue || props.visible\"\n >\n <div\n v-show=\"showRef && ((backdropReady && props.backdropFirst) || !props.backdropFirst)\"\n :id=\"computedId\"\n ref=\"_element\"\n class=\"modal\"\n :class=\"[\n props.modalClass,\n {\n fade: !computedNoAnimation,\n show: isVisible,\n ...sharedClasses,\n },\n ]\"\n role=\"dialog\"\n :aria-labelledby=\"!props.noHeader ? `${computedId}-label` : undefined\"\n :aria-describedby=\"`${computedId}-body`\"\n tabindex=\"-1\"\n v-bind=\"$attrs\"\n :style=\"computedZIndex\"\n style=\"display: block\"\n @mousedown.left.self=\"hide('backdrop')\"\n >\n <div class=\"modal-dialog\" :class=\"modalDialogClasses\">\n <div v-if=\"contentShowing\" class=\"modal-content\" :class=\"props.contentClass\">\n <div\n v-if=\"!props.noHeader\"\n class=\"modal-header\"\n :class=\"headerClasses\"\n v-bind=\"props.headerAttrs\"\n >\n <slot name=\"header\" v-bind=\"sharedSlots\">\n <component\n :is=\"props.titleTag\"\n :id=\"`${computedId}-label`\"\n class=\"modal-title\"\n :class=\"titleClasses\"\n >\n <slot name=\"title\" v-bind=\"sharedSlots\">\n {{ props.title }}\n </slot>\n </component>\n <template v-if=\"!props.noHeaderClose\">\n <BButton\n v-if=\"hasHeaderCloseSlot\"\n ref=\"_closeButton\"\n v-bind=\"headerCloseAttrs\"\n @click=\"hide('close')\"\n >\n <slot name=\"header-close\" v-bind=\"sharedSlots\" />\n </BButton>\n <BCloseButton\n v-else\n ref=\"_closeButton\"\n :aria-label=\"props.headerCloseLabel\"\n v-bind=\"headerCloseAttrs\"\n @click=\"hide('close')\"\n />\n </template>\n </slot>\n </div>\n <div\n :id=\"`${computedId}-body`\"\n class=\"modal-body\"\n :class=\"bodyClasses\"\n v-bind=\"props.bodyAttrs\"\n >\n <slot v-bind=\"sharedSlots\">\n {{ props.body }}\n </slot>\n </div>\n <div v-if=\"!props.noFooter\" class=\"modal-footer\" :class=\"footerClasses\">\n <slot name=\"footer\" v-bind=\"sharedSlots\">\n <slot name=\"cancel\" v-bind=\"sharedSlots\">\n <BButton\n v-if=\"!props.okOnly\"\n ref=\"_cancelButton\"\n :disabled=\"disableCancel\"\n :size=\"props.buttonSize\"\n :variant=\"props.cancelVariant\"\n :class=\"props.cancelClass\"\n @click=\"hide('cancel')\"\n >\n {{ props.cancelTitle }}\n </BButton>\n </slot>\n <slot name=\"ok\" v-bind=\"sharedSlots\">\n <BButton\n ref=\"_okButton\"\n :disabled=\"disableOk\"\n :size=\"props.buttonSize\"\n :variant=\"props.okVariant\"\n :class=\"props.okClass\"\n @click=\"hide('ok')\"\n >\n {{ props.okTitle }}\n </BButton>\n </slot>\n </slot>\n </div>\n </div>\n </div>\n <div\n v-if=\"needsFallback\"\n ref=\"_fallbackFocusElement\"\n :class=\"fallbackClassSelector\"\n tabindex=\"0\"\n style=\"width: 0; height: 0; overflow: hidden\"\n />\n </div>\n </Transition>\n <slot v-if=\"!props.noBackdrop\" name=\"backdrop\" v-bind=\"sharedSlots\">\n <Transition v-if=\"renderBackdropRef\" v-bind=\"backdropTransitionProps\">\n <div\n v-show=\"showRef || (isLeaving && props.backdropFirst && !computedNoAnimation)\"\n class=\"modal-backdrop\"\n :style=\"computedZIndexBackdrop\"\n :class=\"{\n fade: !computedNoAnimation,\n show: backdropVisible || computedNoAnimation,\n ...sharedClasses,\n }\"\n @click=\"hide('backdrop')\"\n />\n </Transition>\n </slot>\n </ConditionalTeleport>\n</template>\n\n<script setup lang=\"ts\">\nimport {onKeyStroke, unrefElement} from '@vueuse/core'\nimport {useActivatedFocusTrap} from '../../composables/useActivatedFocusTrap'\nimport {\n computed,\n type CSSProperties,\n type EmitFn,\n nextTick,\n onMounted,\n ref,\n useTemplateRef,\n watch,\n} from 'vue'\nimport type {BModalEmits, BModalProps, BModalSlots, BModalSlotsData} from '../../types'\n\nimport BButton from '../BButton/BButton.vue'\nimport BCloseButton from '../BButton/BCloseButton.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport {useSafeScrollLock} from '../../composables/useSafeScrollLock'\nimport {getModalZIndex, getSafeDocument, isEmptySlot} from '../../utils/dom'\nimport {useColorVariantClasses} from '../../composables/useColorVariantClasses'\nimport {useModalManager} from '../../composables/useModalManager'\nimport {useShowHide} from '../../composables/useShowHide'\nimport ConditionalTeleport from '../ConditionalTeleport.vue'\nimport {getElement} from '../../utils/getElement'\n\ndefineOptions({\n inheritAttrs: false,\n})\n\nconst _props = withDefaults(defineProps<Omit<BModalProps, 'modelValue'>>(), {\n focus: undefined,\n backdropFirst: false,\n body: undefined,\n bodyBgVariant: null,\n bodyAttrs: undefined,\n bodyClass: null,\n bodyScrolling: false,\n bodyTextVariant: null,\n bodyVariant: null,\n busy: false,\n buttonSize: 'md',\n cancelClass: undefined,\n cancelDisabled: false,\n cancelTitle: 'Cancel',\n cancelVariant: 'secondary',\n centered: false,\n contentClass: undefined,\n dialogClass: undefined,\n footerBgVariant: null,\n footerBorderVariant: null,\n footerClass: undefined,\n footerTextVariant: null,\n footerVariant: null,\n fullscreen: false,\n headerAttrs: undefined,\n headerBgVariant: null,\n headerBorderVariant: null,\n headerClass: undefined,\n headerCloseClass: undefined,\n headerCloseLabel: 'Close',\n headerCloseVariant: 'secondary',\n headerTextVariant: null,\n headerVariant: null,\n noFooter: false,\n noHeader: false,\n noHeaderClose: false,\n id: undefined,\n initialAnimation: false,\n lazy: false,\n modalClass: undefined,\n noBackdrop: false,\n noCloseOnBackdrop: false,\n noCloseOnEsc: false,\n noFade: false,\n noTrap: false,\n okClass: undefined,\n okDisabled: false,\n okOnly: false,\n okTitle: 'OK',\n okVariant: 'primary',\n unmountLazy: false,\n scrollable: false,\n size: 'md',\n teleportDisabled: false,\n teleportTo: 'body',\n title: undefined,\n titleClass: undefined,\n titleVisuallyHidden: false,\n titleTag: 'h5',\n show: false,\n transProps: undefined,\n visible: false,\n})\nconst props = useDefaults(_props, 'BModal')\nconst emit = defineEmits<BModalEmits>()\nconst slots = defineSlots<BModalSlots>()\n\nconst computedId = useId(() => props.id, 'modal')\n// Note: passive: true will sync an internal ref... This is required for useModalManager to exit,\n// Since the modelValue that's passed from that composable is not reactive, this internal ref _is_ and thus it will trigger closing the modal\nconst modelValue = defineModel<Exclude<BModalProps['modelValue'], undefined>>({default: false})\n\nconst element = useTemplateRef<HTMLElement | null>('_element')\nconst fallbackFocusElement = useTemplateRef<HTMLElement | null>('_fallbackFocusElement')\nconst okButton = useTemplateRef<HTMLElement | null>('_okButton')\nconst cancelButton = useTemplateRef<HTMLElement | null>('_cancelButton')\nconst closeButton = useTemplateRef<HTMLElement | null>('_closeButton')\n\nconst pickFocusItem = () => {\n if (props.focus && typeof props.focus !== 'boolean') {\n if (props.focus === 'ok') {\n return okButton\n } else if (props.focus === 'close') {\n return closeButton\n } else if (props.focus === 'cancel') {\n return cancelButton\n }\n return getElement(props.focus, element.value ?? undefined) ?? element.value\n }\n return element\n}\n\nlet activeElement: HTMLElement | null = null\nconst onAfterEnter = () => {\n const doc = getSafeDocument()\n if (props.noTrap && props.focus !== false && doc) {\n // Hypothetically this could be an issue\n activeElement = doc.activeElement as HTMLElement\n if (activeElement === element.value) {\n activeElement = null\n }\n const el = unrefElement(pickFocusItem())\n if (!el) return\n el?.focus()\n if (\n el.tagName &&\n el.tagName.toLowerCase() === 'input' &&\n typeof (el as HTMLInputElement).select === 'function'\n ) {\n ;(el as HTMLInputElement).select()\n }\n }\n}\n\nconst onAfterLeave = () => {\n if (props.noTrap && props.focus !== false && activeElement) {\n activeElement?.focus()\n activeElement = null\n }\n}\n\nconst {\n showRef,\n renderRef,\n renderBackdropRef,\n hide,\n show,\n toggle,\n computedNoAnimation,\n transitionProps,\n backdropTransitionProps,\n isLeaving,\n isVisible,\n trapActive,\n contentShowing,\n backdropReady,\n backdropVisible,\n} = useShowHide(modelValue, props, emit as EmitFn, element, computedId, {\n // addShowClass: false,\n transitionProps: {\n onAfterEnter,\n onAfterLeave,\n },\n})\n\nconst fallbackClassSelector = 'modal-fallback-focus'\nconst {needsFallback} = useActivatedFocusTrap({\n element,\n isActive: trapActive,\n noTrap: () => props.noTrap,\n fallbackFocus: {\n ref: fallbackFocusElement,\n classSelector: fallbackClassSelector,\n },\n focus: () => (props.focus === false ? false : (unrefElement(pickFocusItem()) ?? undefined)),\n // () => (typeof focus === 'boolean' ? focus : (unrefElement(focus) ?? undefined)),\n})\n\nonKeyStroke(\n 'Escape',\n () => {\n hide('esc')\n },\n {target: element, passive: true}\n)\nuseSafeScrollLock(showRef, () => props.bodyScrolling)\n\nconst hasHeaderCloseSlot = computed(() => !isEmptySlot(slots['header-close']))\n\nconst modalDialogClasses = computed(() => [\n props.dialogClass,\n {\n 'modal-fullscreen': props.fullscreen === true,\n [`modal-fullscreen-${props.fullscreen}-down`]: typeof props.fullscreen === 'string',\n [`modal-${props.size}`]: props.size !== 'md',\n 'modal-dialog-centered': props.centered,\n 'modal-dialog-scrollable': props.scrollable,\n },\n])\n\nconst bodyColorClasses = useColorVariantClasses(() => ({\n bgVariant: props.bodyBgVariant,\n textVariant: props.bodyTextVariant,\n variant: props.bodyVariant,\n}))\nconst bodyClasses = computed(() => [props.bodyClass, bodyColorClasses.value])\n\nconst headerColorClasses = useColorVariantClasses(() => ({\n bgVariant: props.headerBgVariant,\n textVariant: props.headerTextVariant,\n variant: props.headerVariant,\n borderVariant: props.headerBorderVariant,\n}))\nconst headerClasses = computed(() => [props.headerClass, headerColorClasses.value])\n\nconst headerCloseAttrs = computed(() => ({\n variant: hasHeaderCloseSlot.value ? props.headerCloseVariant : undefined,\n class: props.headerCloseClass,\n}))\n\nconst footerColorClasses = useColorVariantClasses(() => ({\n bgVariant: props.footerBgVariant,\n textVariant: props.footerTextVariant,\n variant: props.footerVariant,\n borderVariant: props.footerBorderVariant,\n}))\nconst footerClasses = computed(() => [props.footerClass, footerColorClasses.value])\n\nconst titleClasses = computed(() => [\n props.titleClass,\n {\n ['visually-hidden']: props.titleVisuallyHidden,\n },\n])\n\nconst disableCancel = computed(() => props.cancelDisabled || props.busy)\nconst disableOk = computed(() => props.okDisabled || props.busy)\n\nconst {activePosition, activeModalCount, stackWithoutSelf} = useModalManager(\n showRef,\n modelValue.value\n)\n\nconst sharedClasses = computed(() => ({\n [`stack-position-${activePosition?.value ?? 0}`]: true,\n [`stack-inverse-position-${(activeModalCount?.value ?? 1) - 1 - (activePosition?.value ?? 0)}`]: true,\n}))\n\nwatch(stackWithoutSelf, (newValue, oldValue) => {\n if (newValue.length > oldValue.length && showRef.value === true && props.noStacking) hide()\n})\n\nconst defaultModalDialogZIndex = ref(getModalZIndex(element.value ?? getSafeDocument()?.body))\n\nonMounted(() => {\n watch(\n renderRef,\n (v) => {\n if (!v) return\n nextTick(() => {\n if (!element.value) return\n defaultModalDialogZIndex.value = getModalZIndex(element.value)\n })\n },\n {immediate: true}\n )\n})\n\nconst computedZIndexNumber = computed<number>(() =>\n // Make sure that newly opened modals have a higher z-index than currently active ones.\n // All active modals have a z-index of ('defaultZIndex' - 'stackSize' - 'positionInStack').\n //\n // This means inactive modals will already be higher than active ones when opened.\n\n showRef.value || isLeaving.value\n ? // Just for reference there is a single frame in which the modal is not active but still has a higher z-index than the active ones due to _when_ it calculates its position. It's a small visual effect\n defaultModalDialogZIndex.value -\n ((activeModalCount?.value ?? 0) * 2 - (activePosition?.value ?? 0) * 2)\n : defaultModalDialogZIndex.value\n)\nconst computedZIndex = computed<CSSProperties>(() => ({\n 'z-index': computedZIndexNumber.value,\n '--b-position': activePosition?.value ?? 0,\n '--b-inverse-position': (activeModalCount?.value ?? 1) - 1 - (activePosition?.value ?? 0),\n '--b-count': activeModalCount?.value ?? 0,\n}))\nconst computedZIndexBackdrop = computed<CSSProperties>(() => ({\n 'z-index': computedZIndexNumber.value - 1,\n '--b-position': activePosition?.value ?? 0,\n '--b-inverse-position': (activeModalCount?.value ?? 1) - 1 - (activePosition?.value ?? 0),\n '--b-count': activeModalCount?.value ?? 0,\n}))\n\nconst sharedSlots = computed<BModalSlotsData>(() => ({\n id: computedId.value,\n cancel: () => {\n hide('cancel')\n },\n close: () => {\n hide('close')\n },\n hide,\n show,\n toggle,\n ok: () => {\n hide('ok')\n },\n active: showRef.value,\n visible: showRef.value,\n}))\n\ndefineExpose({\n hide,\n id: computedId,\n show,\n toggle,\n visible: showRef,\n})\n</script>\n","<template>\n <ConditionalTeleport :to=\"props.teleportTo\" :disabled=\"props.teleportDisabled\">\n <Transition\n v-if=\"renderRef || contentShowing\"\n v-bind=\"transitionProps\"\n :appear=\"modelValue || props.visible\"\n >\n <div\n v-show=\"showRef && ((backdropReady && props.backdropFirst) || !props.backdropFirst)\"\n :id=\"computedId\"\n ref=\"_element\"\n class=\"modal\"\n :class=\"[\n props.modalClass,\n {\n fade: !computedNoAnimation,\n show: isVisible,\n ...sharedClasses,\n },\n ]\"\n role=\"dialog\"\n :aria-labelledby=\"!props.noHeader ? `${computedId}-label` : undefined\"\n :aria-describedby=\"`${computedId}-body`\"\n tabindex=\"-1\"\n v-bind=\"$attrs\"\n :style=\"computedZIndex\"\n style=\"display: block\"\n @mousedown.left.self=\"hide('backdrop')\"\n >\n <div class=\"modal-dialog\" :class=\"modalDialogClasses\">\n <div v-if=\"contentShowing\" class=\"modal-content\" :class=\"props.contentClass\">\n <div\n v-if=\"!props.noHeader\"\n class=\"modal-header\"\n :class=\"headerClasses\"\n v-bind=\"props.headerAttrs\"\n >\n <slot name=\"header\" v-bind=\"sharedSlots\">\n <component\n :is=\"props.titleTag\"\n :id=\"`${computedId}-label`\"\n class=\"modal-title\"\n :class=\"titleClasses\"\n >\n <slot name=\"title\" v-bind=\"sharedSlots\">\n {{ props.title }}\n </slot>\n </component>\n <template v-if=\"!props.noHeaderClose\">\n <BButton\n v-if=\"hasHeaderCloseSlot\"\n ref=\"_closeButton\"\n v-bind=\"headerCloseAttrs\"\n @click=\"hide('close')\"\n >\n <slot name=\"header-close\" v-bind=\"sharedSlots\" />\n </BButton>\n <BCloseButton\n v-else\n ref=\"_closeButton\"\n :aria-label=\"props.headerCloseLabel\"\n v-bind=\"headerCloseAttrs\"\n @click=\"hide('close')\"\n />\n </template>\n </slot>\n </div>\n <div\n :id=\"`${computedId}-body`\"\n class=\"modal-body\"\n :class=\"bodyClasses\"\n v-bind=\"props.bodyAttrs\"\n >\n <slot v-bind=\"sharedSlots\">\n {{ props.body }}\n </slot>\n </div>\n <div v-if=\"!props.noFooter\" class=\"modal-footer\" :class=\"footerClasses\">\n <slot name=\"footer\" v-bind=\"sharedSlots\">\n <slot name=\"cancel\" v-bind=\"sharedSlots\">\n <BButton\n v-if=\"!props.okOnly\"\n ref=\"_cancelButton\"\n :disabled=\"disableCancel\"\n :size=\"props.buttonSize\"\n :variant=\"props.cancelVariant\"\n :class=\"props.cancelClass\"\n @click=\"hide('cancel')\"\n >\n {{ props.cancelTitle }}\n </BButton>\n </slot>\n <slot name=\"ok\" v-bind=\"sharedSlots\">\n <BButton\n ref=\"_okButton\"\n :disabled=\"disableOk\"\n :size=\"props.buttonSize\"\n :variant=\"props.okVariant\"\n :class=\"props.okClass\"\n @click=\"hide('ok')\"\n >\n {{ props.okTitle }}\n </BButton>\n </slot>\n </slot>\n </div>\n </div>\n </div>\n <div\n v-if=\"needsFallback\"\n ref=\"_fallbackFocusElement\"\n :class=\"fallbackClassSelector\"\n tabindex=\"0\"\n style=\"width: 0; height: 0; overflow: hidden\"\n />\n </div>\n </Transition>\n <slot v-if=\"!props.noBackdrop\" name=\"backdrop\" v-bind=\"sharedSlots\">\n <Transition v-if=\"renderBackdropRef\" v-bind=\"backdropTransitionProps\">\n <div\n v-show=\"showRef || (isLeaving && props.backdropFirst && !computedNoAnimation)\"\n class=\"modal-backdrop\"\n :style=\"computedZIndexBackdrop\"\n :class=\"{\n fade: !computedNoAnimation,\n show: backdropVisible || computedNoAnimation,\n ...sharedClasses,\n }\"\n @click=\"hide('backdrop')\"\n />\n </Transition>\n </slot>\n </ConditionalTeleport>\n</template>\n\n<script setup lang=\"ts\">\nimport {onKeyStroke, unrefElement} from '@vueuse/core'\nimport {useActivatedFocusTrap} from '../../composables/useActivatedFocusTrap'\nimport {\n computed,\n type CSSProperties,\n type EmitFn,\n nextTick,\n onMounted,\n ref,\n useTemplateRef,\n watch,\n} from 'vue'\nimport type {BModalEmits, BModalProps, BModalSlots, BModalSlotsData} from '../../types'\n\nimport BButton from '../BButton/BButton.vue'\nimport BCloseButton from '../BButton/BCloseButton.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport {useSafeScrollLock} from '../../composables/useSafeScrollLock'\nimport {getModalZIndex, getSafeDocument, isEmptySlot} from '../../utils/dom'\nimport {useColorVariantClasses} from '../../composables/useColorVariantClasses'\nimport {useModalManager} from '../../composables/useModalManager'\nimport {useShowHide} from '../../composables/useShowHide'\nimport ConditionalTeleport from '../ConditionalTeleport.vue'\nimport {getElement} from '../../utils/getElement'\n\ndefineOptions({\n inheritAttrs: false,\n})\n\nconst _props = withDefaults(defineProps<Omit<BModalProps, 'modelValue'>>(), {\n focus: undefined,\n backdropFirst: false,\n body: undefined,\n bodyBgVariant: null,\n bodyAttrs: undefined,\n bodyClass: null,\n bodyScrolling: false,\n bodyTextVariant: null,\n bodyVariant: null,\n busy: false,\n buttonSize: 'md',\n cancelClass: undefined,\n cancelDisabled: false,\n cancelTitle: 'Cancel',\n cancelVariant: 'secondary',\n centered: false,\n contentClass: undefined,\n dialogClass: undefined,\n footerBgVariant: null,\n footerBorderVariant: null,\n footerClass: undefined,\n footerTextVariant: null,\n footerVariant: null,\n fullscreen: false,\n headerAttrs: undefined,\n headerBgVariant: null,\n headerBorderVariant: null,\n headerClass: undefined,\n headerCloseClass: undefined,\n headerCloseLabel: 'Close',\n headerCloseVariant: 'secondary',\n headerTextVariant: null,\n headerVariant: null,\n noFooter: false,\n noHeader: false,\n noHeaderClose: false,\n id: undefined,\n initialAnimation: false,\n lazy: false,\n modalClass: undefined,\n noBackdrop: false,\n noCloseOnBackdrop: false,\n noCloseOnEsc: false,\n noFade: false,\n noTrap: false,\n okClass: undefined,\n okDisabled: false,\n okOnly: false,\n okTitle: 'OK',\n okVariant: 'primary',\n unmountLazy: false,\n scrollable: false,\n size: 'md',\n teleportDisabled: false,\n teleportTo: 'body',\n title: undefined,\n titleClass: undefined,\n titleVisuallyHidden: false,\n titleTag: 'h5',\n show: false,\n transProps: undefined,\n visible: false,\n})\nconst props = useDefaults(_props, 'BModal')\nconst emit = defineEmits<BModalEmits>()\nconst slots = defineSlots<BModalSlots>()\n\nconst computedId = useId(() => props.id, 'modal')\n// Note: passive: true will sync an internal ref... This is required for useModalManager to exit,\n// Since the modelValue that's passed from that composable is not reactive, this internal ref _is_ and thus it will trigger closing the modal\nconst modelValue = defineModel<Exclude<BModalProps['modelValue'], undefined>>({default: false})\n\nconst element = useTemplateRef<HTMLElement | null>('_element')\nconst fallbackFocusElement = useTemplateRef<HTMLElement | null>('_fallbackFocusElement')\nconst okButton = useTemplateRef<HTMLElement | null>('_okButton')\nconst cancelButton = useTemplateRef<HTMLElement | null>('_cancelButton')\nconst closeButton = useTemplateRef<HTMLElement | null>('_closeButton')\n\nconst pickFocusItem = () => {\n if (props.focus && typeof props.focus !== 'boolean') {\n if (props.focus === 'ok') {\n return okButton\n } else if (props.focus === 'close') {\n return closeButton\n } else if (props.focus === 'cancel') {\n return cancelButton\n }\n return getElement(props.focus, element.value ?? undefined) ?? element.value\n }\n return element\n}\n\nlet activeElement: HTMLElement | null = null\nconst onAfterEnter = () => {\n const doc = getSafeDocument()\n if (props.noTrap && props.focus !== false && doc) {\n // Hypothetically this could be an issue\n activeElement = doc.activeElement as HTMLElement\n if (activeElement === element.value) {\n activeElement = null\n }\n const el = unrefElement(pickFocusItem())\n if (!el) return\n el?.focus()\n if (\n el.tagName &&\n el.tagName.toLowerCase() === 'input' &&\n typeof (el as HTMLInputElement).select === 'function'\n ) {\n ;(el as HTMLInputElement).select()\n }\n }\n}\n\nconst onAfterLeave = () => {\n if (props.noTrap && props.focus !== false && activeElement) {\n activeElement?.focus()\n activeElement = null\n }\n}\n\nconst {\n showRef,\n renderRef,\n renderBackdropRef,\n hide,\n show,\n toggle,\n computedNoAnimation,\n transitionProps,\n backdropTransitionProps,\n isLeaving,\n isVisible,\n trapActive,\n contentShowing,\n backdropReady,\n backdropVisible,\n} = useShowHide(modelValue, props, emit as EmitFn, element, computedId, {\n // addShowClass: false,\n transitionProps: {\n onAfterEnter,\n onAfterLeave,\n },\n})\n\nconst fallbackClassSelector = 'modal-fallback-focus'\nconst {needsFallback} = useActivatedFocusTrap({\n element,\n isActive: trapActive,\n noTrap: () => props.noTrap,\n fallbackFocus: {\n ref: fallbackFocusElement,\n classSelector: fallbackClassSelector,\n },\n focus: () => (props.focus === false ? false : (unrefElement(pickFocusItem()) ?? undefined)),\n // () => (typeof focus === 'boolean' ? focus : (unrefElement(focus) ?? undefined)),\n})\n\nonKeyStroke(\n 'Escape',\n () => {\n hide('esc')\n },\n {target: element, passive: true}\n)\nuseSafeScrollLock(showRef, () => props.bodyScrolling)\n\nconst hasHeaderCloseSlot = computed(() => !isEmptySlot(slots['header-close']))\n\nconst modalDialogClasses = computed(() => [\n props.dialogClass,\n {\n 'modal-fullscreen': props.fullscreen === true,\n [`modal-fullscreen-${props.fullscreen}-down`]: typeof props.fullscreen === 'string',\n [`modal-${props.size}`]: props.size !== 'md',\n 'modal-dialog-centered': props.centered,\n 'modal-dialog-scrollable': props.scrollable,\n },\n])\n\nconst bodyColorClasses = useColorVariantClasses(() => ({\n bgVariant: props.bodyBgVariant,\n textVariant: props.bodyTextVariant,\n variant: props.bodyVariant,\n}))\nconst bodyClasses = computed(() => [props.bodyClass, bodyColorClasses.value])\n\nconst headerColorClasses = useColorVariantClasses(() => ({\n bgVariant: props.headerBgVariant,\n textVariant: props.headerTextVariant,\n variant: props.headerVariant,\n borderVariant: props.headerBorderVariant,\n}))\nconst headerClasses = computed(() => [props.headerClass, headerColorClasses.value])\n\nconst headerCloseAttrs = computed(() => ({\n variant: hasHeaderCloseSlot.value ? props.headerCloseVariant : undefined,\n class: props.headerCloseClass,\n}))\n\nconst footerColorClasses = useColorVariantClasses(() => ({\n bgVariant: props.footerBgVariant,\n textVariant: props.footerTextVariant,\n variant: props.footerVariant,\n borderVariant: props.footerBorderVariant,\n}))\nconst footerClasses = computed(() => [props.footerClass, footerColorClasses.value])\n\nconst titleClasses = computed(() => [\n props.titleClass,\n {\n ['visually-hidden']: props.titleVisuallyHidden,\n },\n])\n\nconst disableCancel = computed(() => props.cancelDisabled || props.busy)\nconst disableOk = computed(() => props.okDisabled || props.busy)\n\nconst {activePosition, activeModalCount, stackWithoutSelf} = useModalManager(\n showRef,\n modelValue.value\n)\n\nconst sharedClasses = computed(() => ({\n [`stack-position-${activePosition?.value ?? 0}`]: true,\n [`stack-inverse-position-${(activeModalCount?.value ?? 1) - 1 - (activePosition?.value ?? 0)}`]: true,\n}))\n\nwatch(stackWithoutSelf, (newValue, oldValue) => {\n if (newValue.length > oldValue.length && showRef.value === true && props.noStacking) hide()\n})\n\nconst defaultModalDialogZIndex = ref(getModalZIndex(element.value ?? getSafeDocument()?.body))\n\nonMounted(() => {\n watch(\n renderRef,\n (v) => {\n if (!v) return\n nextTick(() => {\n if (!element.value) return\n defaultModalDialogZIndex.value = getModalZIndex(element.value)\n })\n },\n {immediate: true}\n )\n})\n\nconst computedZIndexNumber = computed<number>(() =>\n // Make sure that newly opened modals have a higher z-index than currently active ones.\n // All active modals have a z-index of ('defaultZIndex' - 'stackSize' - 'positionInStack').\n //\n // This means inactive modals will already be higher than active ones when opened.\n\n showRef.value || isLeaving.value\n ? // Just for reference there is a single frame in which the modal is not active but still has a higher z-index than the active ones due to _when_ it calculates its position. It's a small visual effect\n defaultModalDialogZIndex.value -\n ((activeModalCount?.value ?? 0) * 2 - (activePosition?.value ?? 0) * 2)\n : defaultModalDialogZIndex.value\n)\nconst computedZIndex = computed<CSSProperties>(() => ({\n 'z-index': computedZIndexNumber.value,\n '--b-position': activePosition?.value ?? 0,\n '--b-inverse-position': (activeModalCount?.value ?? 1) - 1 - (activePosition?.value ?? 0),\n '--b-count': activeModalCount?.value ?? 0,\n}))\nconst computedZIndexBackdrop = computed<CSSProperties>(() => ({\n 'z-index': computedZIndexNumber.value - 1,\n '--b-position': activePosition?.value ?? 0,\n '--b-inverse-position': (activeModalCount?.value ?? 1) - 1 - (activePosition?.value ?? 0),\n '--b-count': activeModalCount?.value ?? 0,\n}))\n\nconst sharedSlots = computed<BModalSlotsData>(() => ({\n id: computedId.value,\n cancel: () => {\n hide('cancel')\n },\n close: () => {\n hide('close')\n },\n hide,\n show,\n toggle,\n ok: () => {\n hide('ok')\n },\n active: showRef.value,\n visible: showRef.value,\n}))\n\ndefineExpose({\n hide,\n id: computedId,\n show,\n toggle,\n visible: showRef,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;AAaA,IAAM,qBAAqB;AAE3B,IAAa,4BAA4B;CACvC,MAAM,qBAAqB,OAAO,iBAAiB,KAAK;;;;CAKxD,MAAM,WAAW,UAAqD;AACpE,sBAAoB,YAAY,MAAM;AACtC,sBAAoB,eAAe,MAAM;;CAG3C,MAAM,kBAAkB,cAAc,oBAAoB,UAAU,WAAW,UAAU;EACvF,MAAM,KACJ,OAAO,aAAa,WAChB,aAAa,SAAS,GACtB,WACE,iBAAiB,EAAE,cAAc,SAAS,GAC1C,KAAA;AACR,MAAI,CAAC,GAAI;AAET,MAAI,cAAc,QAChB,IAAG,UAAU,OAAO,oBAAoB,UAAU,mBAAmB;MAErE,IAAG,aAAa,WAAW,MAAM;GAEnC;AAEF,yBAAwB;AACtB,MAAI,oBAAoB,WAAW,UAAU,EAC3C,iBAAgB,QAAQ,SAAS,GAAG;GAEtC;AAEF,aACQ,oBAAoB,WAAW,QACpC,aAAa;AACZ,MAAI,aAAa,KAAA,EAAW;AAC5B,kBAAgB,QAAQ,SAAS,WAAW,IAAI,qBAAq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AAA,eAAA,WAAA,EAAA,KAAA,GAAA,EAdgD,YAAA,MAAW,CAAA,QAc3D,CAba,MAAA,kBAAiB,IAAA,WAAA,EAAnC,YAYa,YAAA,eAAA,WAAA,EAAA,KAAA,GAAA,EAZgC,MAAA,wBAAuB,CAAA,CAAA,EAAA;4BAWhE,CAAA,eAVF,mBAUE,OAAA;MARA,OAAK,eAAA,CAAC,kBAAgB;cAEO,MAAA,oBAAmB;aAAoB,MAAA,gBAAe,IAAI,MAAA,oBAAmB;UAAiB,cAAA;;MAD1H,OAAK,eAAE,uBAAA,MAAsB;MAM7B,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,MAAA,KAAI,CAAA,WAAA;2BARJ,MAAA,QAAO,IAAK,MAAA,UAAS,IAAI,MAAA,MAAK,CAAC,iBAAa,CAAK,MAAA,oBAAmB,CAAA,CAAA,CAAA,CAAA,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"BModal-D0LB339D.js","names":["$attrs"],"sources":["../src/composables/useModalManager.ts","../src/components/BModal/BModal.vue","../src/components/BModal/BModal.vue"],"sourcesContent":["import {getSSRHandler, tryOnScopeDispose, unrefElement} from '@vueuse/core'\nimport {\n type ComponentInternalInstance,\n computed,\n getCurrentInstance,\n inject,\n type Ref,\n toValue,\n watch,\n} from 'vue'\nimport {modalManagerKey} from '../utils/keys'\nimport {getSafeDocument} from '../utils/dom'\n\nconst modalOpenClassName = 'modal-open'\n\nexport const useSharedModalStack = () => {\n const modalManagerPlugin = inject(modalManagerKey, null)\n\n /**\n * Removes an item from both the stack and registry\n */\n const dispose = (modal: Readonly<ComponentInternalInstance>): void => {\n modalManagerPlugin?.removeStack(modal)\n modalManagerPlugin?.removeRegistry(modal)\n }\n\n const updateHTMLAttrs = getSSRHandler('updateHTMLAttrs', (selector, attribute, value) => {\n const el =\n typeof selector !== 'string'\n ? unrefElement(selector)\n : selector\n ? getSafeDocument()?.querySelector(selector)\n : undefined\n if (!el) return\n\n if (attribute === 'class') {\n el.classList.toggle(modalOpenClassName, value === modalOpenClassName)\n } else {\n el.setAttribute(attribute, value)\n }\n })\n\n tryOnScopeDispose(() => {\n if (modalManagerPlugin?.countStack.value === 0) {\n updateHTMLAttrs('body', 'class', '')\n }\n })\n\n watch(\n () => modalManagerPlugin?.countStack.value,\n (newValue) => {\n if (newValue === undefined) return\n updateHTMLAttrs('body', 'class', newValue > 0 ? modalOpenClassName : '')\n }\n )\n\n return {\n ...modalManagerPlugin,\n dispose,\n }\n}\n\nexport const useModalManager = (modalOpen: Readonly<Ref<boolean>>, initialValue: boolean) => {\n const {pushRegistry, pushStack, removeStack, stack, dispose, countStack} = useSharedModalStack()\n\n const currentModal = getCurrentInstance()\n\n if (!currentModal || currentModal.type.__name !== 'BModal') {\n throw new Error('useModalManager must only use in BModal component')\n }\n\n pushRegistry?.(currentModal)\n\n tryOnScopeDispose(() => {\n dispose(currentModal)\n })\n\n const setInStack = (newValue: boolean, oldValue: boolean) => {\n if (newValue) {\n pushStack?.(currentModal)\n } else if (oldValue && !newValue) {\n removeStack?.(currentModal)\n }\n }\n\n // (initialValue, initialValue) is meant to always only ever trigger the first `if (newValue) {` block. The other block is skipped _always_\n setInStack(initialValue, initialValue)\n\n watch(modalOpen, setInStack)\n\n return {\n activePosition: computed(() =>\n stack?.value.findIndex((el) => toValue(el.exposed?.id) === toValue(currentModal.exposed?.id))\n ),\n activeModalCount: countStack,\n stackWithoutSelf: computed(\n () =>\n stack?.value.filter(\n (el) => toValue(el.exposed?.id) !== toValue(currentModal.exposed?.id)\n ) ?? []\n ),\n }\n}\n","<template>\n <ConditionalTeleport :to=\"props.teleportTo\" :disabled=\"props.teleportDisabled\">\n <Transition\n v-if=\"renderRef || contentShowing\"\n v-bind=\"transitionProps\"\n :appear=\"modelValue || props.visible\"\n >\n <div\n v-show=\"showRef && ((backdropReady && props.backdropFirst) || !props.backdropFirst)\"\n :id=\"computedId\"\n ref=\"_element\"\n class=\"modal\"\n :class=\"[\n props.modalClass,\n {\n fade: !computedNoAnimation,\n show: isVisible,\n ...sharedClasses,\n },\n ]\"\n role=\"dialog\"\n :aria-labelledby=\"!props.noHeader ? `${computedId}-label` : undefined\"\n :aria-describedby=\"`${computedId}-body`\"\n tabindex=\"-1\"\n v-bind=\"$attrs\"\n :style=\"computedZIndex\"\n style=\"display: block\"\n @mousedown.left.self=\"hide('backdrop')\"\n >\n <div class=\"modal-dialog\" :class=\"modalDialogClasses\">\n <div v-if=\"contentShowing\" class=\"modal-content\" :class=\"props.contentClass\">\n <div\n v-if=\"!props.noHeader\"\n class=\"modal-header\"\n :class=\"headerClasses\"\n v-bind=\"props.headerAttrs\"\n >\n <slot name=\"header\" v-bind=\"sharedSlots\">\n <component\n :is=\"props.titleTag\"\n :id=\"`${computedId}-label`\"\n class=\"modal-title\"\n :class=\"titleClasses\"\n >\n <slot name=\"title\" v-bind=\"sharedSlots\">\n {{ props.title }}\n </slot>\n </component>\n <template v-if=\"!props.noHeaderClose\">\n <BButton\n v-if=\"hasHeaderCloseSlot\"\n ref=\"_closeButton\"\n v-bind=\"headerCloseAttrs\"\n @click=\"hide('close')\"\n >\n <slot name=\"header-close\" v-bind=\"sharedSlots\" />\n </BButton>\n <BCloseButton\n v-else\n ref=\"_closeButton\"\n :aria-label=\"props.headerCloseLabel\"\n v-bind=\"headerCloseAttrs\"\n @click=\"hide('close')\"\n />\n </template>\n </slot>\n </div>\n <div\n :id=\"`${computedId}-body`\"\n class=\"modal-body\"\n :class=\"bodyClasses\"\n v-bind=\"props.bodyAttrs\"\n >\n <slot v-bind=\"sharedSlots\">\n {{ props.body }}\n </slot>\n </div>\n <div v-if=\"!props.noFooter\" class=\"modal-footer\" :class=\"footerClasses\">\n <slot name=\"footer\" v-bind=\"sharedSlots\">\n <slot name=\"cancel\" v-bind=\"sharedSlots\">\n <BButton\n v-if=\"!props.okOnly\"\n ref=\"_cancelButton\"\n :disabled=\"disableCancel\"\n :size=\"props.buttonSize\"\n :variant=\"props.cancelVariant\"\n :class=\"props.cancelClass\"\n @click=\"hide('cancel')\"\n >\n {{ props.cancelTitle }}\n </BButton>\n </slot>\n <slot name=\"ok\" v-bind=\"sharedSlots\">\n <BButton\n ref=\"_okButton\"\n :disabled=\"disableOk\"\n :size=\"props.buttonSize\"\n :variant=\"props.okVariant\"\n :class=\"props.okClass\"\n @click=\"hide('ok')\"\n >\n {{ props.okTitle }}\n </BButton>\n </slot>\n </slot>\n </div>\n </div>\n </div>\n <div\n v-if=\"needsFallback\"\n ref=\"_fallbackFocusElement\"\n :class=\"fallbackClassSelector\"\n tabindex=\"0\"\n style=\"width: 0; height: 0; overflow: hidden\"\n />\n </div>\n </Transition>\n <slot v-if=\"!props.noBackdrop\" name=\"backdrop\" v-bind=\"sharedSlots\">\n <Transition v-if=\"renderBackdropRef\" v-bind=\"backdropTransitionProps\">\n <div\n v-show=\"showRef || (isLeaving && props.backdropFirst && !computedNoAnimation)\"\n class=\"modal-backdrop\"\n :style=\"computedZIndexBackdrop\"\n :class=\"{\n fade: !computedNoAnimation,\n show: backdropVisible || computedNoAnimation,\n ...sharedClasses,\n }\"\n @click=\"hide('backdrop')\"\n />\n </Transition>\n </slot>\n </ConditionalTeleport>\n</template>\n\n<script setup lang=\"ts\">\nimport {onKeyStroke, unrefElement} from '@vueuse/core'\nimport {useActivatedFocusTrap} from '../../composables/useActivatedFocusTrap'\nimport {\n computed,\n type CSSProperties,\n type EmitFn,\n nextTick,\n onMounted,\n ref,\n useTemplateRef,\n watch,\n} from 'vue'\nimport type {BModalEmits, BModalProps, BModalSlots, BModalSlotsData} from '../../types'\n\nimport BButton from '../BButton/BButton.vue'\nimport BCloseButton from '../BButton/BCloseButton.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport {useSafeScrollLock} from '../../composables/useSafeScrollLock'\nimport {getModalZIndex, getSafeDocument, isEmptySlot} from '../../utils/dom'\nimport {useColorVariantClasses} from '../../composables/useColorVariantClasses'\nimport {useModalManager} from '../../composables/useModalManager'\nimport {useShowHide} from '../../composables/useShowHide'\nimport ConditionalTeleport from '../ConditionalTeleport.vue'\nimport {getElement} from '../../utils/getElement'\n\ndefineOptions({\n inheritAttrs: false,\n})\n\nconst _props = withDefaults(defineProps<Omit<BModalProps, 'modelValue'>>(), {\n focus: undefined,\n backdropFirst: false,\n body: undefined,\n bodyBgVariant: null,\n bodyAttrs: undefined,\n bodyClass: null,\n bodyScrolling: false,\n bodyTextVariant: null,\n bodyVariant: null,\n busy: false,\n buttonSize: 'md',\n cancelClass: undefined,\n cancelDisabled: false,\n cancelTitle: 'Cancel',\n cancelVariant: 'secondary',\n centered: false,\n contentClass: undefined,\n dialogClass: undefined,\n footerBgVariant: null,\n footerBorderVariant: null,\n footerClass: undefined,\n footerTextVariant: null,\n footerVariant: null,\n fullscreen: false,\n headerAttrs: undefined,\n headerBgVariant: null,\n headerBorderVariant: null,\n headerClass: undefined,\n headerCloseClass: undefined,\n headerCloseLabel: 'Close',\n headerCloseVariant: 'secondary',\n headerTextVariant: null,\n headerVariant: null,\n noFooter: false,\n noHeader: false,\n noHeaderClose: false,\n id: undefined,\n initialAnimation: false,\n lazy: false,\n modalClass: undefined,\n noBackdrop: false,\n noCloseOnBackdrop: false,\n noCloseOnEsc: false,\n noFade: false,\n noTrap: false,\n okClass: undefined,\n okDisabled: false,\n okOnly: false,\n okTitle: 'OK',\n okVariant: 'primary',\n unmountLazy: false,\n scrollable: false,\n size: 'md',\n teleportDisabled: false,\n teleportTo: 'body',\n title: undefined,\n titleClass: undefined,\n titleVisuallyHidden: false,\n titleTag: 'h5',\n show: false,\n transProps: undefined,\n visible: false,\n})\nconst props = useDefaults(_props, 'BModal')\nconst emit = defineEmits<BModalEmits>()\nconst slots = defineSlots<BModalSlots>()\n\nconst computedId = useId(() => props.id, 'modal')\n// Note: passive: true will sync an internal ref... This is required for useModalManager to exit,\n// Since the modelValue that's passed from that composable is not reactive, this internal ref _is_ and thus it will trigger closing the modal\nconst modelValue = defineModel<Exclude<BModalProps['modelValue'], undefined>>({default: false})\n\nconst element = useTemplateRef<HTMLElement | null>('_element')\nconst fallbackFocusElement = useTemplateRef<HTMLElement | null>('_fallbackFocusElement')\nconst okButton = useTemplateRef<HTMLElement | null>('_okButton')\nconst cancelButton = useTemplateRef<HTMLElement | null>('_cancelButton')\nconst closeButton = useTemplateRef<HTMLElement | null>('_closeButton')\n\nconst pickFocusItem = () => {\n if (props.focus && typeof props.focus !== 'boolean') {\n if (props.focus === 'ok') {\n return okButton\n } else if (props.focus === 'close') {\n return closeButton\n } else if (props.focus === 'cancel') {\n return cancelButton\n }\n return getElement(props.focus, element.value ?? undefined) ?? element.value\n }\n return element\n}\n\nlet activeElement: HTMLElement | null = null\nconst onAfterEnter = () => {\n const doc = getSafeDocument()\n if (props.noTrap && props.focus !== false && doc) {\n // Hypothetically this could be an issue\n activeElement = doc.activeElement as HTMLElement\n if (activeElement === element.value) {\n activeElement = null\n }\n const el = unrefElement(pickFocusItem())\n if (!el) return\n el?.focus()\n if (\n el.tagName &&\n el.tagName.toLowerCase() === 'input' &&\n typeof (el as HTMLInputElement).select === 'function'\n ) {\n ;(el as HTMLInputElement).select()\n }\n }\n}\n\nconst onAfterLeave = () => {\n if (props.noTrap && props.focus !== false && activeElement) {\n activeElement?.focus()\n activeElement = null\n }\n}\n\nconst {\n showRef,\n renderRef,\n renderBackdropRef,\n hide,\n show,\n toggle,\n computedNoAnimation,\n transitionProps,\n backdropTransitionProps,\n isLeaving,\n isVisible,\n trapActive,\n contentShowing,\n backdropReady,\n backdropVisible,\n} = useShowHide(modelValue, props, emit as EmitFn, element, computedId, {\n // addShowClass: false,\n transitionProps: {\n onAfterEnter,\n onAfterLeave,\n },\n})\n\nconst fallbackClassSelector = 'modal-fallback-focus'\nconst {needsFallback} = useActivatedFocusTrap({\n element,\n isActive: trapActive,\n noTrap: () => props.noTrap,\n fallbackFocus: {\n ref: fallbackFocusElement,\n classSelector: fallbackClassSelector,\n },\n focus: () => (props.focus === false ? false : (unrefElement(pickFocusItem()) ?? undefined)),\n // () => (typeof focus === 'boolean' ? focus : (unrefElement(focus) ?? undefined)),\n})\n\nonKeyStroke(\n 'Escape',\n () => {\n hide('esc')\n },\n {target: element, passive: true}\n)\nuseSafeScrollLock(showRef, () => props.bodyScrolling)\n\nconst hasHeaderCloseSlot = computed(() => !isEmptySlot(slots['header-close']))\n\nconst modalDialogClasses = computed(() => [\n props.dialogClass,\n {\n 'modal-fullscreen': props.fullscreen === true,\n [`modal-fullscreen-${props.fullscreen}-down`]: typeof props.fullscreen === 'string',\n [`modal-${props.size}`]: props.size !== 'md',\n 'modal-dialog-centered': props.centered,\n 'modal-dialog-scrollable': props.scrollable,\n },\n])\n\nconst bodyColorClasses = useColorVariantClasses(() => ({\n bgVariant: props.bodyBgVariant,\n textVariant: props.bodyTextVariant,\n variant: props.bodyVariant,\n}))\nconst bodyClasses = computed(() => [props.bodyClass, bodyColorClasses.value])\n\nconst headerColorClasses = useColorVariantClasses(() => ({\n bgVariant: props.headerBgVariant,\n textVariant: props.headerTextVariant,\n variant: props.headerVariant,\n borderVariant: props.headerBorderVariant,\n}))\nconst headerClasses = computed(() => [props.headerClass, headerColorClasses.value])\n\nconst headerCloseAttrs = computed(() => ({\n variant: hasHeaderCloseSlot.value ? props.headerCloseVariant : undefined,\n class: props.headerCloseClass,\n}))\n\nconst footerColorClasses = useColorVariantClasses(() => ({\n bgVariant: props.footerBgVariant,\n textVariant: props.footerTextVariant,\n variant: props.footerVariant,\n borderVariant: props.footerBorderVariant,\n}))\nconst footerClasses = computed(() => [props.footerClass, footerColorClasses.value])\n\nconst titleClasses = computed(() => [\n props.titleClass,\n {\n ['visually-hidden']: props.titleVisuallyHidden,\n },\n])\n\nconst disableCancel = computed(() => props.cancelDisabled || props.busy)\nconst disableOk = computed(() => props.okDisabled || props.busy)\n\nconst {activePosition, activeModalCount, stackWithoutSelf} = useModalManager(\n showRef,\n modelValue.value\n)\n\nconst sharedClasses = computed(() => ({\n [`stack-position-${activePosition?.value ?? 0}`]: true,\n [`stack-inverse-position-${(activeModalCount?.value ?? 1) - 1 - (activePosition?.value ?? 0)}`]: true,\n}))\n\nwatch(stackWithoutSelf, (newValue, oldValue) => {\n if (newValue.length > oldValue.length && showRef.value === true && props.noStacking) hide()\n})\n\nconst defaultModalDialogZIndex = ref(getModalZIndex(element.value ?? getSafeDocument()?.body))\n\nonMounted(() => {\n watch(\n renderRef,\n (v) => {\n if (!v) return\n nextTick(() => {\n if (!element.value) return\n defaultModalDialogZIndex.value = getModalZIndex(element.value)\n })\n },\n {immediate: true}\n )\n})\n\nconst computedZIndexNumber = computed<number>(() =>\n // Make sure that newly opened modals have a higher z-index than currently active ones.\n // All active modals have a z-index of ('defaultZIndex' - 'stackSize' - 'positionInStack').\n //\n // This means inactive modals will already be higher than active ones when opened.\n\n showRef.value || isLeaving.value\n ? // Just for reference there is a single frame in which the modal is not active but still has a higher z-index than the active ones due to _when_ it calculates its position. It's a small visual effect\n defaultModalDialogZIndex.value -\n ((activeModalCount?.value ?? 0) * 2 - (activePosition?.value ?? 0) * 2)\n : defaultModalDialogZIndex.value\n)\nconst computedZIndex = computed<CSSProperties>(() => ({\n 'z-index': computedZIndexNumber.value,\n '--b-position': activePosition?.value ?? 0,\n '--b-inverse-position': (activeModalCount?.value ?? 1) - 1 - (activePosition?.value ?? 0),\n '--b-count': activeModalCount?.value ?? 0,\n}))\nconst computedZIndexBackdrop = computed<CSSProperties>(() => ({\n 'z-index': computedZIndexNumber.value - 1,\n '--b-position': activePosition?.value ?? 0,\n '--b-inverse-position': (activeModalCount?.value ?? 1) - 1 - (activePosition?.value ?? 0),\n '--b-count': activeModalCount?.value ?? 0,\n}))\n\nconst sharedSlots = computed<BModalSlotsData>(() => ({\n id: computedId.value,\n cancel: () => {\n hide('cancel')\n },\n close: () => {\n hide('close')\n },\n hide,\n show,\n toggle,\n ok: () => {\n hide('ok')\n },\n active: showRef.value,\n visible: showRef.value,\n}))\n\ndefineExpose({\n hide,\n id: computedId,\n show,\n toggle,\n visible: showRef,\n})\n</script>\n","<template>\n <ConditionalTeleport :to=\"props.teleportTo\" :disabled=\"props.teleportDisabled\">\n <Transition\n v-if=\"renderRef || contentShowing\"\n v-bind=\"transitionProps\"\n :appear=\"modelValue || props.visible\"\n >\n <div\n v-show=\"showRef && ((backdropReady && props.backdropFirst) || !props.backdropFirst)\"\n :id=\"computedId\"\n ref=\"_element\"\n class=\"modal\"\n :class=\"[\n props.modalClass,\n {\n fade: !computedNoAnimation,\n show: isVisible,\n ...sharedClasses,\n },\n ]\"\n role=\"dialog\"\n :aria-labelledby=\"!props.noHeader ? `${computedId}-label` : undefined\"\n :aria-describedby=\"`${computedId}-body`\"\n tabindex=\"-1\"\n v-bind=\"$attrs\"\n :style=\"computedZIndex\"\n style=\"display: block\"\n @mousedown.left.self=\"hide('backdrop')\"\n >\n <div class=\"modal-dialog\" :class=\"modalDialogClasses\">\n <div v-if=\"contentShowing\" class=\"modal-content\" :class=\"props.contentClass\">\n <div\n v-if=\"!props.noHeader\"\n class=\"modal-header\"\n :class=\"headerClasses\"\n v-bind=\"props.headerAttrs\"\n >\n <slot name=\"header\" v-bind=\"sharedSlots\">\n <component\n :is=\"props.titleTag\"\n :id=\"`${computedId}-label`\"\n class=\"modal-title\"\n :class=\"titleClasses\"\n >\n <slot name=\"title\" v-bind=\"sharedSlots\">\n {{ props.title }}\n </slot>\n </component>\n <template v-if=\"!props.noHeaderClose\">\n <BButton\n v-if=\"hasHeaderCloseSlot\"\n ref=\"_closeButton\"\n v-bind=\"headerCloseAttrs\"\n @click=\"hide('close')\"\n >\n <slot name=\"header-close\" v-bind=\"sharedSlots\" />\n </BButton>\n <BCloseButton\n v-else\n ref=\"_closeButton\"\n :aria-label=\"props.headerCloseLabel\"\n v-bind=\"headerCloseAttrs\"\n @click=\"hide('close')\"\n />\n </template>\n </slot>\n </div>\n <div\n :id=\"`${computedId}-body`\"\n class=\"modal-body\"\n :class=\"bodyClasses\"\n v-bind=\"props.bodyAttrs\"\n >\n <slot v-bind=\"sharedSlots\">\n {{ props.body }}\n </slot>\n </div>\n <div v-if=\"!props.noFooter\" class=\"modal-footer\" :class=\"footerClasses\">\n <slot name=\"footer\" v-bind=\"sharedSlots\">\n <slot name=\"cancel\" v-bind=\"sharedSlots\">\n <BButton\n v-if=\"!props.okOnly\"\n ref=\"_cancelButton\"\n :disabled=\"disableCancel\"\n :size=\"props.buttonSize\"\n :variant=\"props.cancelVariant\"\n :class=\"props.cancelClass\"\n @click=\"hide('cancel')\"\n >\n {{ props.cancelTitle }}\n </BButton>\n </slot>\n <slot name=\"ok\" v-bind=\"sharedSlots\">\n <BButton\n ref=\"_okButton\"\n :disabled=\"disableOk\"\n :size=\"props.buttonSize\"\n :variant=\"props.okVariant\"\n :class=\"props.okClass\"\n @click=\"hide('ok')\"\n >\n {{ props.okTitle }}\n </BButton>\n </slot>\n </slot>\n </div>\n </div>\n </div>\n <div\n v-if=\"needsFallback\"\n ref=\"_fallbackFocusElement\"\n :class=\"fallbackClassSelector\"\n tabindex=\"0\"\n style=\"width: 0; height: 0; overflow: hidden\"\n />\n </div>\n </Transition>\n <slot v-if=\"!props.noBackdrop\" name=\"backdrop\" v-bind=\"sharedSlots\">\n <Transition v-if=\"renderBackdropRef\" v-bind=\"backdropTransitionProps\">\n <div\n v-show=\"showRef || (isLeaving && props.backdropFirst && !computedNoAnimation)\"\n class=\"modal-backdrop\"\n :style=\"computedZIndexBackdrop\"\n :class=\"{\n fade: !computedNoAnimation,\n show: backdropVisible || computedNoAnimation,\n ...sharedClasses,\n }\"\n @click=\"hide('backdrop')\"\n />\n </Transition>\n </slot>\n </ConditionalTeleport>\n</template>\n\n<script setup lang=\"ts\">\nimport {onKeyStroke, unrefElement} from '@vueuse/core'\nimport {useActivatedFocusTrap} from '../../composables/useActivatedFocusTrap'\nimport {\n computed,\n type CSSProperties,\n type EmitFn,\n nextTick,\n onMounted,\n ref,\n useTemplateRef,\n watch,\n} from 'vue'\nimport type {BModalEmits, BModalProps, BModalSlots, BModalSlotsData} from '../../types'\n\nimport BButton from '../BButton/BButton.vue'\nimport BCloseButton from '../BButton/BCloseButton.vue'\nimport {useDefaults} from '../../composables/useDefaults'\nimport {useId} from '../../composables/useId'\nimport {useSafeScrollLock} from '../../composables/useSafeScrollLock'\nimport {getModalZIndex, getSafeDocument, isEmptySlot} from '../../utils/dom'\nimport {useColorVariantClasses} from '../../composables/useColorVariantClasses'\nimport {useModalManager} from '../../composables/useModalManager'\nimport {useShowHide} from '../../composables/useShowHide'\nimport ConditionalTeleport from '../ConditionalTeleport.vue'\nimport {getElement} from '../../utils/getElement'\n\ndefineOptions({\n inheritAttrs: false,\n})\n\nconst _props = withDefaults(defineProps<Omit<BModalProps, 'modelValue'>>(), {\n focus: undefined,\n backdropFirst: false,\n body: undefined,\n bodyBgVariant: null,\n bodyAttrs: undefined,\n bodyClass: null,\n bodyScrolling: false,\n bodyTextVariant: null,\n bodyVariant: null,\n busy: false,\n buttonSize: 'md',\n cancelClass: undefined,\n cancelDisabled: false,\n cancelTitle: 'Cancel',\n cancelVariant: 'secondary',\n centered: false,\n contentClass: undefined,\n dialogClass: undefined,\n footerBgVariant: null,\n footerBorderVariant: null,\n footerClass: undefined,\n footerTextVariant: null,\n footerVariant: null,\n fullscreen: false,\n headerAttrs: undefined,\n headerBgVariant: null,\n headerBorderVariant: null,\n headerClass: undefined,\n headerCloseClass: undefined,\n headerCloseLabel: 'Close',\n headerCloseVariant: 'secondary',\n headerTextVariant: null,\n headerVariant: null,\n noFooter: false,\n noHeader: false,\n noHeaderClose: false,\n id: undefined,\n initialAnimation: false,\n lazy: false,\n modalClass: undefined,\n noBackdrop: false,\n noCloseOnBackdrop: false,\n noCloseOnEsc: false,\n noFade: false,\n noTrap: false,\n okClass: undefined,\n okDisabled: false,\n okOnly: false,\n okTitle: 'OK',\n okVariant: 'primary',\n unmountLazy: false,\n scrollable: false,\n size: 'md',\n teleportDisabled: false,\n teleportTo: 'body',\n title: undefined,\n titleClass: undefined,\n titleVisuallyHidden: false,\n titleTag: 'h5',\n show: false,\n transProps: undefined,\n visible: false,\n})\nconst props = useDefaults(_props, 'BModal')\nconst emit = defineEmits<BModalEmits>()\nconst slots = defineSlots<BModalSlots>()\n\nconst computedId = useId(() => props.id, 'modal')\n// Note: passive: true will sync an internal ref... This is required for useModalManager to exit,\n// Since the modelValue that's passed from that composable is not reactive, this internal ref _is_ and thus it will trigger closing the modal\nconst modelValue = defineModel<Exclude<BModalProps['modelValue'], undefined>>({default: false})\n\nconst element = useTemplateRef<HTMLElement | null>('_element')\nconst fallbackFocusElement = useTemplateRef<HTMLElement | null>('_fallbackFocusElement')\nconst okButton = useTemplateRef<HTMLElement | null>('_okButton')\nconst cancelButton = useTemplateRef<HTMLElement | null>('_cancelButton')\nconst closeButton = useTemplateRef<HTMLElement | null>('_closeButton')\n\nconst pickFocusItem = () => {\n if (props.focus && typeof props.focus !== 'boolean') {\n if (props.focus === 'ok') {\n return okButton\n } else if (props.focus === 'close') {\n return closeButton\n } else if (props.focus === 'cancel') {\n return cancelButton\n }\n return getElement(props.focus, element.value ?? undefined) ?? element.value\n }\n return element\n}\n\nlet activeElement: HTMLElement | null = null\nconst onAfterEnter = () => {\n const doc = getSafeDocument()\n if (props.noTrap && props.focus !== false && doc) {\n // Hypothetically this could be an issue\n activeElement = doc.activeElement as HTMLElement\n if (activeElement === element.value) {\n activeElement = null\n }\n const el = unrefElement(pickFocusItem())\n if (!el) return\n el?.focus()\n if (\n el.tagName &&\n el.tagName.toLowerCase() === 'input' &&\n typeof (el as HTMLInputElement).select === 'function'\n ) {\n ;(el as HTMLInputElement).select()\n }\n }\n}\n\nconst onAfterLeave = () => {\n if (props.noTrap && props.focus !== false && activeElement) {\n activeElement?.focus()\n activeElement = null\n }\n}\n\nconst {\n showRef,\n renderRef,\n renderBackdropRef,\n hide,\n show,\n toggle,\n computedNoAnimation,\n transitionProps,\n backdropTransitionProps,\n isLeaving,\n isVisible,\n trapActive,\n contentShowing,\n backdropReady,\n backdropVisible,\n} = useShowHide(modelValue, props, emit as EmitFn, element, computedId, {\n // addShowClass: false,\n transitionProps: {\n onAfterEnter,\n onAfterLeave,\n },\n})\n\nconst fallbackClassSelector = 'modal-fallback-focus'\nconst {needsFallback} = useActivatedFocusTrap({\n element,\n isActive: trapActive,\n noTrap: () => props.noTrap,\n fallbackFocus: {\n ref: fallbackFocusElement,\n classSelector: fallbackClassSelector,\n },\n focus: () => (props.focus === false ? false : (unrefElement(pickFocusItem()) ?? undefined)),\n // () => (typeof focus === 'boolean' ? focus : (unrefElement(focus) ?? undefined)),\n})\n\nonKeyStroke(\n 'Escape',\n () => {\n hide('esc')\n },\n {target: element, passive: true}\n)\nuseSafeScrollLock(showRef, () => props.bodyScrolling)\n\nconst hasHeaderCloseSlot = computed(() => !isEmptySlot(slots['header-close']))\n\nconst modalDialogClasses = computed(() => [\n props.dialogClass,\n {\n 'modal-fullscreen': props.fullscreen === true,\n [`modal-fullscreen-${props.fullscreen}-down`]: typeof props.fullscreen === 'string',\n [`modal-${props.size}`]: props.size !== 'md',\n 'modal-dialog-centered': props.centered,\n 'modal-dialog-scrollable': props.scrollable,\n },\n])\n\nconst bodyColorClasses = useColorVariantClasses(() => ({\n bgVariant: props.bodyBgVariant,\n textVariant: props.bodyTextVariant,\n variant: props.bodyVariant,\n}))\nconst bodyClasses = computed(() => [props.bodyClass, bodyColorClasses.value])\n\nconst headerColorClasses = useColorVariantClasses(() => ({\n bgVariant: props.headerBgVariant,\n textVariant: props.headerTextVariant,\n variant: props.headerVariant,\n borderVariant: props.headerBorderVariant,\n}))\nconst headerClasses = computed(() => [props.headerClass, headerColorClasses.value])\n\nconst headerCloseAttrs = computed(() => ({\n variant: hasHeaderCloseSlot.value ? props.headerCloseVariant : undefined,\n class: props.headerCloseClass,\n}))\n\nconst footerColorClasses = useColorVariantClasses(() => ({\n bgVariant: props.footerBgVariant,\n textVariant: props.footerTextVariant,\n variant: props.footerVariant,\n borderVariant: props.footerBorderVariant,\n}))\nconst footerClasses = computed(() => [props.footerClass, footerColorClasses.value])\n\nconst titleClasses = computed(() => [\n props.titleClass,\n {\n ['visually-hidden']: props.titleVisuallyHidden,\n },\n])\n\nconst disableCancel = computed(() => props.cancelDisabled || props.busy)\nconst disableOk = computed(() => props.okDisabled || props.busy)\n\nconst {activePosition, activeModalCount, stackWithoutSelf} = useModalManager(\n showRef,\n modelValue.value\n)\n\nconst sharedClasses = computed(() => ({\n [`stack-position-${activePosition?.value ?? 0}`]: true,\n [`stack-inverse-position-${(activeModalCount?.value ?? 1) - 1 - (activePosition?.value ?? 0)}`]: true,\n}))\n\nwatch(stackWithoutSelf, (newValue, oldValue) => {\n if (newValue.length > oldValue.length && showRef.value === true && props.noStacking) hide()\n})\n\nconst defaultModalDialogZIndex = ref(getModalZIndex(element.value ?? getSafeDocument()?.body))\n\nonMounted(() => {\n watch(\n renderRef,\n (v) => {\n if (!v) return\n nextTick(() => {\n if (!element.value) return\n defaultModalDialogZIndex.value = getModalZIndex(element.value)\n })\n },\n {immediate: true}\n )\n})\n\nconst computedZIndexNumber = computed<number>(() =>\n // Make sure that newly opened modals have a higher z-index than currently active ones.\n // All active modals have a z-index of ('defaultZIndex' - 'stackSize' - 'positionInStack').\n //\n // This means inactive modals will already be higher than active ones when opened.\n\n showRef.value || isLeaving.value\n ? // Just for reference there is a single frame in which the modal is not active but still has a higher z-index than the active ones due to _when_ it calculates its position. It's a small visual effect\n defaultModalDialogZIndex.value -\n ((activeModalCount?.value ?? 0) * 2 - (activePosition?.value ?? 0) * 2)\n : defaultModalDialogZIndex.value\n)\nconst computedZIndex = computed<CSSProperties>(() => ({\n 'z-index': computedZIndexNumber.value,\n '--b-position': activePosition?.value ?? 0,\n '--b-inverse-position': (activeModalCount?.value ?? 1) - 1 - (activePosition?.value ?? 0),\n '--b-count': activeModalCount?.value ?? 0,\n}))\nconst computedZIndexBackdrop = computed<CSSProperties>(() => ({\n 'z-index': computedZIndexNumber.value - 1,\n '--b-position': activePosition?.value ?? 0,\n '--b-inverse-position': (activeModalCount?.value ?? 1) - 1 - (activePosition?.value ?? 0),\n '--b-count': activeModalCount?.value ?? 0,\n}))\n\nconst sharedSlots = computed<BModalSlotsData>(() => ({\n id: computedId.value,\n cancel: () => {\n hide('cancel')\n },\n close: () => {\n hide('close')\n },\n hide,\n show,\n toggle,\n ok: () => {\n hide('ok')\n },\n active: showRef.value,\n visible: showRef.value,\n}))\n\ndefineExpose({\n hide,\n id: computedId,\n show,\n toggle,\n visible: showRef,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;AAaA,IAAM,qBAAqB;AAE3B,IAAa,4BAA4B;CACvC,MAAM,sBAAA,GAAA,IAAA,QAA4B,aAAA,iBAAiB,KAAK;;;;CAKxD,MAAM,WAAW,UAAqD;AACpE,sBAAoB,YAAY,MAAM;AACtC,sBAAoB,eAAe,MAAM;;CAG3C,MAAM,kBAAkB,aAAA,cAAc,oBAAoB,UAAU,WAAW,UAAU;EACvF,MAAM,KACJ,OAAO,aAAa,WAChB,aAAA,aAAa,SAAS,GACtB,WACE,YAAA,iBAAiB,EAAE,cAAc,SAAS,GAC1C,KAAA;AACR,MAAI,CAAC,GAAI;AAET,MAAI,cAAc,QAChB,IAAG,UAAU,OAAO,oBAAoB,UAAU,mBAAmB;MAErE,IAAG,aAAa,WAAW,MAAM;GAEnC;AAEF,cAAA,wBAAwB;AACtB,MAAI,oBAAoB,WAAW,UAAU,EAC3C,iBAAgB,QAAQ,SAAS,GAAG;GAEtC;AAEF,EAAA,GAAA,IAAA,aACQ,oBAAoB,WAAW,QACpC,aAAa;AACZ,MAAI,aAAa,KAAA,EAAW;AAC5B,kBAAgB,QAAQ,SAAS,WAAW,IAAI,qBAAqB,GAAG;GAE3E;AAED,QAAO;EACL,GAAG;EACH;EACD;;AAGH,IAAa,mBAAmB,WAAmC,iBAA0B;CAC3F,MAAM,EAAC,cAAc,WAAW,aAAa,OAAO,SAAS,eAAc,qBAAqB;CAEhG,MAAM,gBAAA,GAAA,IAA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