eefd7abf83
Reorganize components into category folders (forms/canvas/overlays/etc.); add the media-editor headless family (timeline, curve-editor, waveform, crop, color picker, etc.); apply perf fixes (O(1) collection lookups, plain-object drag state, gesture-leak teardown, shallowRef color state, rect caching) and replace source `any` with proper types.
34 lines
903 B
Vue
34 lines
903 B
Vue
<script lang="ts">
|
|
import type { PopperAnchorProps } from '../../overlays/popper';
|
|
|
|
/**
|
|
* Optional custom anchor for positioning the popover against an element other
|
|
* than the trigger (e.g. a field or input group). When present, the trigger
|
|
* stops acting as the anchor and the content is positioned relative to this.
|
|
*/
|
|
export interface DatePickerAnchorProps extends PopperAnchorProps {}
|
|
</script>
|
|
|
|
<script setup lang="ts">
|
|
import { onBeforeMount, onUnmounted } from 'vue';
|
|
import { PopperAnchor } from '../../overlays/popper';
|
|
import { useDatePickerRootContext } from './context';
|
|
|
|
const props = defineProps<DatePickerAnchorProps>();
|
|
|
|
const ctx = useDatePickerRootContext();
|
|
|
|
onBeforeMount(() => {
|
|
ctx.hasCustomAnchor.value = true;
|
|
});
|
|
onUnmounted(() => {
|
|
ctx.hasCustomAnchor.value = false;
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<PopperAnchor v-bind="props">
|
|
<slot />
|
|
</PopperAnchor>
|
|
</template>
|