{"version":3,"file":"directive.mjs","sources":["../../../../../../packages/components/popover/src/directive.ts"],"sourcesContent":["import type { DirectiveBinding, ObjectDirective } from 'vue'\r\nimport type { PopoverInstance } from './popover'\r\n\r\nconst attachEvents = (el: HTMLElement, binding: DirectiveBinding) => {\r\n  const popperComponent: PopoverInstance = binding.arg || binding.value\r\n  const popover = popperComponent?.popperRef\r\n  if (popover) {\r\n    popover.triggerRef = el\r\n  }\r\n}\r\n\r\nexport default {\r\n  mounted(el, binding) {\r\n    attachEvents(el, binding)\r\n  },\r\n  updated(el, binding) {\r\n    attachEvents(el, binding)\r\n  },\r\n} as ObjectDirective\r\n\r\nexport const VPopover = 'popover'\r\n"],"names":[],"mappings":"AAAA,MAAM,YAAY,GAAG,CAAC,EAAE,EAAE,OAAO,KAAK;AACtC,EAAE,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC;AACvD,EAAE,MAAM,OAAO,GAAG,eAAe,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,eAAe,CAAC,SAAS,CAAC;AAC/E,EAAE,IAAI,OAAO,EAAE;AACf,IAAI,OAAO,CAAC,UAAU,GAAG,EAAE,CAAC;AAC5B,GAAG;AACH,CAAC,CAAC;AACF,uBAAe;AACf,EAAE,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE;AACvB,IAAI,YAAY,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;AAC9B,GAAG;AACH,EAAE,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE;AACvB,IAAI,YAAY,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;AAC9B,GAAG;AACH,CAAC,CAAC;AACU,MAAC,QAAQ,GAAG;;;;"}