{"version":3,"file":"directive.mjs","names":[],"sources":["../../../../../../packages/components/popover/src/directive.ts"],"sourcesContent":["import type { DirectiveBinding, ObjectDirective } from 'vue'\nimport type { PopoverInstance } from './popover'\n\nconst attachEvents = (el: HTMLElement, binding: DirectiveBinding) => {\n  const popperComponent: PopoverInstance = binding.arg || binding.value\n  const popover = popperComponent?.popperRef\n  if (popover) {\n    popover.triggerRef = el\n  }\n}\n\nexport default {\n  mounted(el, binding) {\n    attachEvents(el, binding)\n  },\n  updated(el, binding) {\n    attachEvents(el, binding)\n  },\n} as ObjectDirective\n\nexport const VPopover = 'popover'\n"],"mappings":";AAGA,MAAM,gBAAgB,IAAiB,YAA8B;CAEnE,MAAM,WADmC,QAAQ,OAAO,QAAQ,QAC/B;AACjC,KAAI,QACF,SAAQ,aAAa;;AAIzB,wBAAe;CACb,QAAQ,IAAI,SAAS;AACnB,eAAa,IAAI,QAAQ;;CAE3B,QAAQ,IAAI,SAAS;AACnB,eAAa,IAAI,QAAQ;;CAE5B;AAED,MAAa,WAAW"}