@bagelink/vue 1.12.44 → 1.12.47
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/components/AddressSearch.vue.d.ts.map +1 -1
- package/dist/components/Dropdown.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +218 -215
- package/package.json +1 -1
- package/src/components/Dropdown.vue +6 -3
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@ export type Alignment = 'start' | 'end'
|
|
|
11
11
|
export type AlignedPlacement = 'auto' | Side | `${Side}-${Alignment}`
|
|
12
12
|
export type TriggerEvent = 'click' | 'hover'
|
|
13
13
|
|
|
14
|
-
defineOptions({ inheritAttrs: false })
|
|
14
|
+
defineOptions({ inheritAttrs: false, name: 'DropDown' })
|
|
15
15
|
|
|
16
16
|
const props = withDefaults(defineProps<{
|
|
17
17
|
value?: string
|
|
@@ -38,6 +38,8 @@ const props = withDefaults(defineProps<{
|
|
|
38
38
|
showGroup?: string
|
|
39
39
|
card?: boolean
|
|
40
40
|
delay?: number | { show: number; hide: number }
|
|
41
|
+
/** Override the anchor element used for positioning. When provided, the #trigger slot is not rendered. */
|
|
42
|
+
referenceEl?: Element | null
|
|
41
43
|
}>(), {
|
|
42
44
|
thin: true,
|
|
43
45
|
flat: true,
|
|
@@ -97,7 +99,7 @@ const resolvedDelay = computed((): { show: number; hide: number } => {
|
|
|
97
99
|
const groupRegistry = new Map<string, Set<() => void>>()
|
|
98
100
|
|
|
99
101
|
async function updatePosition() {
|
|
100
|
-
const triggerEl = triggerWrapRef.value?.firstElementChild as HTMLElement | null
|
|
102
|
+
const triggerEl = (props.referenceEl ?? triggerWrapRef.value?.firstElementChild) as HTMLElement | null
|
|
101
103
|
if (!popoverRef.value || !triggerEl || shouldDisablePositioning.value) return
|
|
102
104
|
|
|
103
105
|
const isAuto = props.placement === 'auto'
|
|
@@ -245,8 +247,9 @@ defineExpose({ show, hide, shown })
|
|
|
245
247
|
|
|
246
248
|
<template>
|
|
247
249
|
<div style="display: contents">
|
|
248
|
-
<!-- Trigger wrapper —
|
|
250
|
+
<!-- Trigger wrapper — omitted when referenceEl is provided externally -->
|
|
249
251
|
<div
|
|
252
|
+
v-if="!referenceEl"
|
|
250
253
|
ref="triggerWrapRef" v-bind="$attrs"
|
|
251
254
|
@mouseenter="onTriggerMouseenter" @mouseleave="onTriggerMouseleave" @focus="onTriggerMouseenter"
|
|
252
255
|
@blur="onTriggerMouseleave"
|