bootstrap-vue-next 0.44.1 → 0.44.2
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.
- package/dist/{BDropdown-BQjX2G8g.js → BDropdown-C2L69dLN.js} +3 -3
- package/dist/BDropdown-C2L69dLN.js.map +1 -0
- package/dist/{BDropdown-t41Sj0X6.mjs → BDropdown-CKnx6hUH.mjs} +3 -3
- package/dist/BDropdown-CKnx6hUH.mjs.map +1 -0
- package/dist/{BDropdown-BOO7j78Q.js → BDropdown-CrgX7oCn.js} +2 -2
- package/dist/{BDropdown-BOO7j78Q.js.map → BDropdown-CrgX7oCn.js.map} +1 -1
- package/dist/{BDropdown-CmwJjOsO.mjs → BDropdown-k-nulez8.mjs} +2 -2
- package/dist/{BDropdown-CmwJjOsO.mjs.map → BDropdown-k-nulez8.mjs.map} +1 -1
- package/dist/{BModal-CJ2pBX28.mjs → BModal-TCXrZEZk.mjs} +2 -2
- package/dist/{BModal-CJ2pBX28.mjs.map → BModal-TCXrZEZk.mjs.map} +1 -1
- package/dist/{BModal-DLgzN4S6.js → BModal-d3FKaKhA.js} +2 -2
- package/dist/{BModal-DLgzN4S6.js.map → BModal-d3FKaKhA.js.map} +1 -1
- package/dist/{BNav-DvZQlXux.mjs → BNav-BBr8213N.mjs} +2 -2
- package/dist/{BNav-DvZQlXux.mjs.map → BNav-BBr8213N.mjs.map} +1 -1
- package/dist/{BNav-y9d8xWOd.js → BNav-BMAZcVDS.js} +2 -2
- package/dist/{BNav-y9d8xWOd.js.map → BNav-BMAZcVDS.js.map} +1 -1
- package/dist/{BOffcanvas-DI_fy_Yr.mjs → BOffcanvas-BklEA-4x.mjs} +2 -2
- package/dist/{BOffcanvas-DI_fy_Yr.mjs.map → BOffcanvas-BklEA-4x.mjs.map} +1 -1
- package/dist/{BOffcanvas-B9tBGhZF.js → BOffcanvas-YsVap-9w.js} +2 -2
- package/dist/{BOffcanvas-B9tBGhZF.js.map → BOffcanvas-YsVap-9w.js.map} +1 -1
- package/dist/bootstrap-vue-next.css +0 -5
- package/dist/bootstrap-vue-next.mjs +5 -5
- package/dist/bootstrap-vue-next.umd.js +5 -5
- package/dist/src/components/BDropdown/index.mjs +2 -2
- package/dist/src/components/BDropdown/index.umd.js +2 -2
- package/dist/src/components/BModal/index.mjs +1 -1
- package/dist/src/components/BModal/index.umd.js +1 -1
- package/dist/src/components/BNav/index.mjs +1 -1
- package/dist/src/components/BNav/index.umd.js +1 -1
- package/dist/src/components/BOffcanvas/index.mjs +1 -1
- package/dist/src/components/BOffcanvas/index.umd.js +1 -1
- package/dist/src/components/index.mjs +5 -5
- package/dist/src/components/index.umd.js +5 -5
- package/dist/src/composables/useModal/index.mjs +1 -1
- package/dist/src/composables/useModal/index.umd.js +1 -1
- package/dist/{useSafeScrollLock-PWxgzVSb.mjs → useSafeScrollLock-C9UxwgUo.mjs} +3 -2
- package/dist/{useSafeScrollLock-PWxgzVSb.mjs.map → useSafeScrollLock-C9UxwgUo.mjs.map} +1 -1
- package/dist/{useSafeScrollLock-HZn1tIAh.js → useSafeScrollLock-CP2B7aXF.js} +3 -2
- package/dist/{useSafeScrollLock-HZn1tIAh.js.map → useSafeScrollLock-CP2B7aXF.js.map} +1 -1
- package/package.json +1 -1
- package/src/styles/styles.scss +0 -5
- package/dist/BDropdown-BQjX2G8g.js.map +0 -1
- package/dist/BDropdown-t41Sj0X6.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BModal-CJ2pBX28.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 {BModalSlots, BModalSlotsData, BModalEmits, BModalProps} 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}\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 {BModalSlots, BModalSlotsData, BModalEmits, BModalProps} 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}\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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AAa,CAAA,CAAA,CAAA,CAAA;;yDA6GzE,MAAA,MAAK,CAAC,aAAnB,WAcO,KAAA,QAAA,YAAA,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
|
+
{"version":3,"file":"BModal-TCXrZEZk.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 {BModalSlots, BModalSlotsData, BModalEmits, BModalProps} 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}\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 {BModalSlots, BModalSlotsData, BModalEmits, BModalProps} 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}\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,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,eAAe,oBA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AAA;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"}
|
|
@@ -10,7 +10,7 @@ const require_BButton = require("./BButton-BID3NrxE.js");
|
|
|
10
10
|
const require_BCloseButton = require("./BCloseButton-CgIVNv2g.js");
|
|
11
11
|
const require_ConditionalTeleport = require("./ConditionalTeleport-BDWcebyD.js");
|
|
12
12
|
const require_getElement = require("./getElement-BXXYfxYW.js");
|
|
13
|
-
const require_useSafeScrollLock = require("./useSafeScrollLock-
|
|
13
|
+
const require_useSafeScrollLock = require("./useSafeScrollLock-CP2B7aXF.js");
|
|
14
14
|
let vue = require("vue");
|
|
15
15
|
//#region src/composables/useModalManager.ts
|
|
16
16
|
var modalOpenClassName = "modal-open";
|
|
@@ -515,4 +515,4 @@ Object.defineProperty(exports, "useSharedModalStack", {
|
|
|
515
515
|
}
|
|
516
516
|
});
|
|
517
517
|
|
|
518
|
-
//# sourceMappingURL=BModal-
|
|
518
|
+
//# sourceMappingURL=BModal-d3FKaKhA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BModal-DLgzN4S6.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 {BModalSlots, BModalSlotsData, BModalEmits, BModalProps} 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}\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 {BModalSlots, BModalSlotsData, BModalEmits, BModalProps} 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}\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,wB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A,GAAA,IAAA,gBAAO,uBAAA,MAAsB;MAM7B,SAAK,OAAA,OAAA,OAAA,MAAA,YAAA,GAAA,IAAA,OAAE,KAAI,CAAA,WAAA;8CARJ,QAAO,KAAA,GAAA,IAAA,OAAK,UAAS,KAAA,GAAA,IAAA,OAAI,MAAK,CAAC,iBAAa,EAAA,GAAA,IAAA,OAAK,oBAAmB,CAAA,CAAA,CAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"BModal-d3FKaKhA.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 {BModalSlots, BModalSlotsData, BModalEmits, BModalProps} 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}\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 {BModalSlots, BModalSlotsData, BModalEmits, BModalProps} 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}\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: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E,MAAK,CAAC,cAAA,GAAA,IAAA,YAcZ,KAAA,QAAA,aAAA,GAAA,IAAA,iBAAA,GAAA,IAAA,YAAA,EAAA,KAAA,GAAA,EAdgD,YAAA,MAAW,CAAA,QAc3D,EAAA,GAAA,IAAA,OAba,kBAAiB,KAAA,GAAA,IAAA,YAAA,GAAA,GAAA,IAAA,aAYtB,IAAA,aAAA,GAAA,IAAA,iBAAA,GAAA,IAAA,YAAA,EAAA,KAAA,GAAA,GAAA,GAAA,IAAA,OAZgC,wBAAuB,CAAA,CAAA,EAAA;qCAWhE,EAAA,GAAA,IAAA,iBAAA,GAAA,IAAA,oBAAA,OAAA;MARA,QAAA,GAAA,IAAA,gBAAK,CAAC,kBAAgB;6BAEO,oBAAmB;4BAAoB,gBAAe,KAAA,GAAA,IAAA,OAAI,oBAAmB;UAAiB,cAAA;;MAD1H,QAAA,GAAA,IAAA,gBAAO,uBAAA,MAAsB;MAM7B,SAAK,OAAA,OAAA,OAAA,MAAA,YAAA,GAAA,IAAA,OAAE,KAAI,CAAA,WAAA;8CARJ,QAAO,KAAA,GAAA,IAAA,OAAK,UAAS,KAAA,GAAA,IAAA,OAAI,MAAK,CAAC,iBAAa,EAAA,GAAA,IAAA,OAAK,oBAAmB,CAAA,CAAA,CAAA,CAAA,CAAA"}
|
|
@@ -2,7 +2,7 @@ import { t as useDefaults } from "./useDefaults-CCWS15M8.mjs";
|
|
|
2
2
|
import { a as pick } from "./object-B9ZW1_9f.mjs";
|
|
3
3
|
import { t as BLink_default } from "./BLink-DoYZ8dBl.mjs";
|
|
4
4
|
import { t as useAlignment } from "./useAlignment-CwuLc9mf.mjs";
|
|
5
|
-
import { t as BDropdown_default } from "./BDropdown-
|
|
5
|
+
import { t as BDropdown_default } from "./BDropdown-CKnx6hUH.mjs";
|
|
6
6
|
import { t as BForm_default } from "./BForm-CPHblWb2.mjs";
|
|
7
7
|
import { computed, createBlock, createElementBlock, createTextVNode, createVNode, defineComponent, mergeModels, mergeProps, normalizeClass, openBlock, renderSlot, resolveDynamicComponent, toDisplayString, unref, useAttrs, useModel, useTemplateRef, withCtx, withModifiers } from "vue";
|
|
8
8
|
//#endregion
|
|
@@ -419,4 +419,4 @@ var BNavText_default = /* @__PURE__ */ defineComponent({
|
|
|
419
419
|
//#endregion
|
|
420
420
|
export { BNav_default as a, BNavForm_default as i, BNavItemDropdown_default as n, BNavItem_default as r, BNavText_default as t };
|
|
421
421
|
|
|
422
|
-
//# sourceMappingURL=BNav-
|
|
422
|
+
//# sourceMappingURL=BNav-BBr8213N.mjs.map
|