{"version":3,"file":"trigger2.mjs","sources":["../../../../../../../packages/components/tooltip/src/trigger.ts"],"sourcesContent":["import { buildProps, definePropType } from '@hd-front-end/utils'\nimport { popperTriggerProps } from '@hd-front-end/components/popper'\nimport { EVENT_CODE } from '@hd-front-end/constants'\n\nimport type { Arrayable } from '@hd-front-end/utils'\nimport type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\n\nexport type TooltipTriggerType = 'hover' | 'focus' | 'click' | 'contextmenu'\n\nexport const useTooltipTriggerProps = buildProps({\n  ...popperTriggerProps,\n  /**\n   * @description whether Tooltip is disabled\n   */\n  disabled: Boolean,\n  /**\n   * @description How should the tooltip be triggered (to show)\n   */\n  trigger: {\n    type: definePropType<Arrayable<TooltipTriggerType>>([String, Array]),\n    default: 'hover',\n  },\n  /**\n   * @description When you click the mouse to focus on the trigger element, you can define a set of keyboard codes to control the display of tooltip through the keyboard\n   */\n  triggerKeys: {\n    type: definePropType<string[]>(Array),\n    default: () => [EVENT_CODE.enter, EVENT_CODE.numpadEnter, EVENT_CODE.space],\n  },\n  /**\n   * @description when triggering tooltips through hover, whether to focus the trigger element, which improves accessibility\n   */\n  focusOnTarget: Boolean,\n} as const)\n\nexport type ElTooltipTriggerProps = ExtractPropTypes<\n  typeof useTooltipTriggerProps\n>\n\nexport type ElTooltipTriggerPropsPublic = __ExtractPublicPropTypes<\n  typeof useTooltipTriggerProps\n>\n"],"names":[],"mappings":";;;;AASO,MAAM,yBAAyB,UAAW,CAAA;AAAA,EAC/C,GAAG,kBAAA;AAAA,EAIH,QAAU,EAAA,OAAA;AAAA,EAIV,OAAS,EAAA;AAAA,IACP,IAAM,EAAA,cAAA,CAA8C,CAAC,MAAA,EAAQ,KAAK,CAAC,CAAA;AAAA,IACnE,OAAS,EAAA,OAAA;AAAA,GACX;AAAA,EAIA,WAAa,EAAA;AAAA,IACX,IAAA,EAAM,eAAyB,KAAK,CAAA;AAAA,IACpC,OAAA,EAAS,MAAM,CAAC,UAAA,CAAW,OAAO,UAAW,CAAA,WAAA,EAAa,WAAW,KAAK,CAAA;AAAA,GAC5E;AAAA,EAIA,aAAe,EAAA,OAAA;AACjB,CAAU;;;;"}