Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/docs/src/components/PageContents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</template>

<script setup lang="ts">
import type {ContentsItem} from 'src/types'
import type {ContentsItem} from '../types'

defineProps<{contents?: ContentsItem; activeId: string | null}>()
</script>
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/components/PageContentsItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</template>

<script setup lang="ts">
import type {ContentsItem} from 'src/types'
import type {ContentsItem} from '../types'
import {computed} from 'vue'

const props = defineProps<{
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/data/components/accordion.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {
BAccordionProps,
BAccordionSlots,
} from 'bootstrap-vue-next'
import type {ComponentReference, EmitRecord, PropRecord, SlotRecord} from 'src/types'
import type {ComponentReference, EmitRecord, PropRecord, SlotRecord} from '../../types'
import {buildCommonProps} from '../../utils/commonProps'
import {pick} from '../../utils/objectUtils'
import {showHideEmits, showHideProps} from '../../utils/showHideData'
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/data/components/app.data.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {BAppProps} from 'bootstrap-vue-next'
import type {ComponentReference, PropRecord} from 'src/types'
import type {ComponentReference, PropRecord} from '../../types'

export default {
load: (): ComponentReference => ({
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/data/components/listGroup.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
import type {ComponentReference, PropRecord, SlotRecord} from '../../types'
import {pick} from '../../utils/objectUtils'
import {buildCommonProps} from '../../utils/commonProps'
import type {linkProps} from 'src/utils/linkProps'
import type {linkProps} from '../../utils/linkProps'

export default {
load: (): ComponentReference => ({
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/data/components/orchestrator.data.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {BOrchestratorProps} from 'bootstrap-vue-next'
import type {ComponentReference, PropRecord} from 'src/types'
import type {ComponentReference, PropRecord} from '../../types'

export default {
load: (): ComponentReference => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const props = withDefaults(defineProps<BOrchestratorProps>(), {
filter: () => true,
})

const orchestratorRegistry = inject(orchestratorRegistryKey)
const orchestratorRegistry = inject(orchestratorRegistryKey, null)

if (orchestratorRegistry) {
if (!orchestratorRegistry._isOrchestratorInstalled.value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const computedClasses = computed(() => ({
disabled: props.disabled,
}))

const showHideData = inject(showHideRegistryKey, undefined)
const showHideData = inject(showHideRegistryKey, null)

const collapseExpanded = computed(() => {
if (!props.target || !showHideData) return false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ const {
backdropVisible,
isVisible,
buildTriggerableEvent,
localNoAnimation,
isLeaving,
trapActive,
setLocalNoAnimation,
} = useShowHide(modelValue, props, emit as EmitFn, element, computedId, {
transitionProps: {
onAfterEnter,
Expand Down Expand Up @@ -299,15 +299,15 @@ watch(smallerOrEqualToBreakpoint, (newValue) => {
if (props.responsive === undefined) return
if (newValue === true) {
const opened = false
localNoAnimation.value = true
setLocalNoAnimation(true)
requestAnimationFrame(() => {
isOpenByBreakpoint.value = opened
})
emit('breakpoint', buildTriggerableEvent('breakpoint'), opened)
emit('hide', buildTriggerableEvent('hide'))
} else {
const opened = true
localNoAnimation.value = true
setLocalNoAnimation(true)
requestAnimationFrame(() => {
isOpenByBreakpoint.value = opened
})
Expand Down
49 changes: 25 additions & 24 deletions packages/bootstrap-vue-next/src/components/BPopover/BPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -259,30 +259,6 @@ const {floatingStyles, middlewareData, placement, update} = useFloating(

const arrowStyle = ref<CSSProperties>({position: 'absolute'})

watch(middlewareData, (newValue) => {
if (props.noHide === false) {
if (newValue.hide?.referenceHidden && !hidden.value && showRef.value) {
if (props.closeOnHide && !props.noAutoClose && !props.manual) {
throttleHide('close-on-hide')
} else {
localTemporaryHide.value = true
hidden.value = true
}
} else if (localTemporaryHide.value && !newValue.hide?.referenceHidden) {
localTemporaryHide.value = false
hidden.value = false
}
}
if (newValue.arrow) {
const {x, y} = newValue.arrow
arrowStyle.value = {
position: 'absolute',
top: y ? `${y}px` : '',
left: x ? `${x}px` : '',
}
}
})

let cleanup: ReturnType<typeof autoUpdate> | undefined
const {
showRef,
Expand All @@ -297,6 +273,7 @@ const {
isActive,
renderRef,
localTemporaryHide,
setLocalTemporaryHide,
} = useShowHide(modelValue, props, emit as EmitFn, floatingElement, computedId, {
showFn: () => {
update()
Expand All @@ -317,6 +294,30 @@ const {
},
})

watch(middlewareData, (newValue) => {
if (props.noHide === false) {
if (newValue.hide?.referenceHidden && !hidden.value && showRef.value) {
if (props.closeOnHide && !props.noAutoClose && !props.manual) {
throttleHide('close-on-hide')
} else {
setLocalTemporaryHide(true)
hidden.value = true
}
} else if (localTemporaryHide.value && !newValue.hide?.referenceHidden) {
setLocalTemporaryHide(false)
hidden.value = false
}
}
if (newValue.arrow) {
const {x, y} = newValue.arrow
arrowStyle.value = {
position: 'absolute',
top: y ? `${y}px` : '',
left: x ? `${x}px` : '',
}
}
})

const computedClasses = computed(() => {
const type = props.tooltip ? 'tooltip' : 'popover'
return [
Expand Down
Loading
Loading