element-plus
Version:
A Component Library for Vue 3
1 lines • 1.94 kB
Source Map (JSON)
{"version":3,"file":"popper.vue2.mjs","sources":["../../../../../../packages/components/popper/src/popper.vue"],"sourcesContent":["<template>\n <slot />\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, provide, ref } from 'vue'\nimport { POPPER_INJECTION_KEY } from './constants'\n\nimport type { Instance as PopperInstance } from '@popperjs/core'\nimport type { ElPopperInjectionContext } from './constants'\nimport type { PopperProps } from './popper'\n\ndefineOptions({\n name: 'ElPopper',\n inheritAttrs: false,\n})\nconst props = withDefaults(defineProps<PopperProps>(), {\n role: 'tooltip',\n})\n\nconst triggerRef = ref<HTMLElement>()\nconst popperInstanceRef = ref<PopperInstance>()\nconst contentRef = ref<HTMLElement>()\nconst referenceRef = ref<HTMLElement>()\nconst role = computed(() => props.role)\n\nconst popperProvides = {\n /**\n * @description trigger element\n */\n triggerRef,\n /**\n * @description popperjs instance\n */\n popperInstanceRef,\n /**\n * @description popper content element\n */\n contentRef,\n /**\n * @description popper reference element\n */\n referenceRef,\n /**\n * @description role determines how aria attributes are distributed\n */\n role,\n} as ElPopperInjectionContext\n\ndefineExpose(popperProvides)\n\nprovide(POPPER_INJECTION_KEY, popperProvides)\n</script>\n"],"names":["_renderSlot"],"mappings":";;;;;;;;;;;;AAgBA,IAAA,MAAM,KAAA,GAAQ,OAAA;AAId,IAAA,MAAM,aAAa,GAAA,EAAiB;AACpC,IAAA,MAAM,oBAAoB,GAAA,EAAoB;AAC9C,IAAA,MAAM,aAAa,GAAA,EAAiB;AACpC,IAAA,MAAM,eAAe,GAAA,EAAiB;AACtC,IAAA,MAAM,IAAA,GAAO,QAAA,CAAS,MAAM,KAAA,CAAM,IAAI,CAAA;AAEtC,IAAA,MAAM,cAAA,GAAiB;AAAA;AAAA;AAAA;AAAA,MAIrB,UAAA;AAAA;AAAA;AAAA;AAAA,MAIA,iBAAA;AAAA;AAAA;AAAA;AAAA,MAIA,UAAA;AAAA;AAAA;AAAA;AAAA,MAIA,YAAA;AAAA;AAAA;AAAA;AAAA,MAIA;AAAA,KACF;AAEA,IAAA,QAAA,CAAa,cAAc,CAAA;AAE3B,IAAA,OAAA,CAAQ,sBAAsB,cAAc,CAAA;;aAlD1CA,UAAA,CAAQ,IAAA,CAAA,MAAA,EAAA,SAAA,CAAA;AAAA;;;;;;"}