reka-ui
Version:
Vue port for Radix UI Primitives.
1 lines • 981 B
Source Map (JSON)
{"version":3,"file":"usePrimitiveElement.cjs","sources":["../../src/Primitive/usePrimitiveElement.ts"],"sourcesContent":["import { unrefElement } from '@vueuse/core'\nimport { type ComponentPublicInstance, computed, ref } from 'vue'\n\nexport function usePrimitiveElement<T extends ComponentPublicInstance>() {\n const primitiveElement = ref<T>()\n const currentElement = computed<HTMLElement>(() => ['#text', '#comment'].includes(primitiveElement.value?.$el.nodeName) ? primitiveElement.value?.$el.nextElementSibling : unrefElement(primitiveElement))\n\n return {\n primitiveElement,\n currentElement,\n }\n}\n"],"names":["ref","computed","unrefElement"],"mappings":";;;;;AAGO,SAAS,mBAAyD,GAAA;AACvE,EAAA,MAAM,mBAAmBA,OAAO,EAAA;AAChC,EAAA,MAAM,iBAAiBC,YAAsB,CAAA,MAAM,CAAC,OAAS,EAAA,UAAU,EAAE,QAAS,CAAA,gBAAA,CAAiB,OAAO,GAAI,CAAA,QAAQ,IAAI,gBAAiB,CAAA,KAAA,EAAO,IAAI,kBAAqB,GAAAC,iBAAA,CAAa,gBAAgB,CAAC,CAAA;AAEzM,EAAO,OAAA;AAAA,IACL,gBAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}