{"version":3,"file":"use-content-dom.mjs","sources":["../../../../../../../packages/components/popper/src/composables/use-content-dom.ts"],"sourcesContent":["import { computed, ref, unref } from 'vue'\nimport { useNamespace, useZIndex } from '@element-plus/hooks'\n\nimport { isNumber } from '@element-plus/utils'\nimport type { CSSProperties, StyleValue } from 'vue'\nimport type { UsePopperReturn } from '@element-plus/hooks'\nimport type { UsePopperContentReturn } from './use-content'\nimport type { PopperContentProps } from '../content'\n\nexport const usePopperContentDOM = (\n props: PopperContentProps,\n {\n attributes,\n styles,\n role,\n }: Pick &\n Pick\n) => {\n const { nextZIndex } = useZIndex()\n const ns = useNamespace('popper')\n\n const contentAttrs = computed(() => unref(attributes).popper)\n const contentZIndex = ref(\n isNumber(props.zIndex) ? props.zIndex : nextZIndex()\n )\n const contentClass = computed(() => [\n ns.b(),\n ns.is('pure', props.pure),\n ns.is(props.effect),\n props.popperClass,\n ])\n const contentStyle = computed(() => {\n return [\n { zIndex: unref(contentZIndex) } as CSSProperties,\n unref(styles).popper as CSSProperties,\n props.popperStyle || {},\n ]\n })\n const ariaModal = computed(() =>\n role.value === 'dialog' ? 'false' : undefined\n )\n const arrowStyle = computed(\n () => (unref(styles).arrow || {}) as CSSProperties\n )\n\n const updateZIndex = () => {\n contentZIndex.value = isNumber(props.zIndex) ? props.zIndex : nextZIndex()\n }\n\n return {\n ariaModal,\n arrowStyle,\n contentAttrs,\n contentClass,\n contentStyle,\n contentZIndex,\n\n updateZIndex,\n }\n}\n\nexport type UsePopperContentDOMReturn = ReturnType\n"],"names":[],"mappings":";;;;;;;AAGY,MAAC,mBAAmB,GAAG,CAAC,KAAK,EAAE;AAC3C,EAAE,UAAU;AACZ,EAAE,MAAM;AACR,EAAE,IAAI;AACN,CAAC,KAAK;AACN,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,SAAS,EAAE,CAAC;AACrC,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;AACpC,EAAE,MAAM,YAAY,GAAG,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