{"version":3,"file":"AlertDialogContent.cjs","sources":["../../src/AlertDialog/AlertDialogContent.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type {\n  DialogContentEmits,\n  DialogContentProps,\n} from '@/Dialog'\nimport { createContext, useEmitAsProps, useForwardExpose } from '@/shared'\n\ninterface AlertDialogContentContext {\n  onCancelElementChange: (el: HTMLElement | undefined) => void\n}\n\nexport const [injectAlertDialogContentContext, provideAlertDialogContentContext]\n  = createContext<AlertDialogContentContext>('AlertDialogContent')\n\nexport type AlertDialogContentEmits = DialogContentEmits\nexport interface AlertDialogContentProps extends DialogContentProps {}\n</script>\n\n<script setup lang=\"ts\">\nimport { nextTick, ref } from 'vue'\nimport { DialogContent } from '@/Dialog'\n\nconst props = defineProps<AlertDialogContentProps>()\nconst emits = defineEmits<AlertDialogContentEmits>()\n\nconst emitsAsProps = useEmitAsProps(emits)\nuseForwardExpose()\n\nconst cancelElement = ref<HTMLElement | undefined>()\n\nprovideAlertDialogContentContext({\n  onCancelElementChange: (el) => {\n    cancelElement.value = el\n  },\n})\n</script>\n\n<template>\n  <DialogContent\n    v-bind=\"{ ...props, ...emitsAsProps }\"\n    role=\"alertdialog\"\n    @pointer-down-outside.prevent\n    @interact-outside.prevent\n    @open-auto-focus=\"\n      () => {\n        nextTick(() => {\n          cancelElement?.focus({\n            preventScroll: true,\n          });\n        });\n      }\n    \"\n  >\n    <slot />\n  </DialogContent>\n</template>\n"],"names":["createContext","useEmitAsProps","useForwardExpose","ref"],"mappings":";;;;;;;;AAWO,MAAM,CAAC,+BAAA,EAAiC,gCAAgC,CAAA,GAC3EA,mCAAyC,oBAAoB;;;;;;;;;;;;AAUjE,IAAA,MAAM,KAAQ,GAAA,OAAA;AACd,IAAA,MAAM,KAAQ,GAAA,MAAA;AAEd,IAAM,MAAA,YAAA,GAAeC,qCAAe,KAAK,CAAA;AACzC,IAAiBC,wCAAA,EAAA;AAEjB,IAAA,MAAM,gBAAgBC,OAA6B,EAAA;AAEnD,IAAiC,gCAAA,CAAA;AAAA,MAC/B,qBAAA,EAAuB,CAAC,EAAO,KAAA;AAC7B,QAAA,aAAA,CAAc,KAAQ,GAAA,EAAA;AAAA;AACxB,KACD,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}