VHover.mjs.map 2.4 KB

1
  1. {"version":3,"file":"VHover.mjs","names":["makeDelayProps","useDelay","useProxiedModel","genericComponent","propsFactory","makeVHoverProps","disabled","Boolean","modelValue","type","default","undefined","VHover","name","props","emits","value","setup","_ref","slots","isHovering","runOpenDelay","runCloseDelay","onMouseenter","onMouseleave"],"sources":["../../../src/components/VHover/VHover.tsx"],"sourcesContent":["// Composables\nimport { makeDelayProps, useDelay } from '@/composables/delay'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { genericComponent, propsFactory } from '@/util'\n\ntype VHoverSlots = {\n default: {\n isHovering: boolean | undefined\n props: Record<string, unknown>\n }\n}\n\nexport const makeVHoverProps = propsFactory({\n disabled: Boolean,\n modelValue: {\n type: Boolean,\n default: undefined,\n },\n\n ...makeDelayProps(),\n}, 'VHover')\n\nexport const VHover = genericComponent<VHoverSlots>()({\n name: 'VHover',\n\n props: makeVHoverProps(),\n\n emits: {\n 'update:modelValue': (value: boolean) => true,\n },\n\n setup (props, { slots }) {\n const isHovering = useProxiedModel(props, 'modelValue')\n const { runOpenDelay, runCloseDelay } = useDelay(props, value => !props.disabled && (isHovering.value = value))\n\n return () => slots.default?.({\n isHovering: isHovering.value,\n props: {\n onMouseenter: runOpenDelay,\n onMouseleave: runCloseDelay,\n },\n })\n },\n})\n\nexport type VHover = InstanceType<typeof VHover>\n"],"mappings":"AAAA;AAAA,SACSA,cAAc,EAAEC,QAAQ;AAAA,SACxBC,eAAe,8CAExB;AAAA,SACSC,gBAAgB,EAAEC,YAAY;AASvC,OAAO,MAAMC,eAAe,GAAGD,YAAY,CAAC;EAC1CE,QAAQ,EAAEC,OAAO;EACjBC,UAAU,EAAE;IACVC,IAAI,EAAEF,OAAO;IACbG,OAAO,EAAEC;EACX,CAAC;EAED,GAAGX,cAAc;AACnB,CAAC,EAAE,QAAQ,CAAC;AAEZ,OAAO,MAAMY,MAAM,GAAGT,gBAAgB,EAAe,CAAC;EACpDU,IAAI,EAAE,QAAQ;EAEdC,KAAK,EAAET,eAAe,EAAE;EAExBU,KAAK,EAAE;IACL,mBAAmB,EAAGC,KAAc,IAAK;EAC3C,CAAC;EAEDC,KAAKA,CAAEH,KAAK,EAAAI,IAAA,EAAa;IAAA,IAAX;MAAEC;IAAM,CAAC,GAAAD,IAAA;IACrB,MAAME,UAAU,GAAGlB,eAAe,CAACY,KAAK,EAAE,YAAY,CAAC;IACvD,MAAM;MAAEO,YAAY;MAAEC;IAAc,CAAC,GAAGrB,QAAQ,CAACa,KAAK,EAAEE,KAAK,IAAI,CAACF,KAAK,CAACR,QAAQ,KAAKc,UAAU,CAACJ,KAAK,GAAGA,KAAK,CAAC,CAAC;IAE/G,OAAO,MAAMG,KAAK,CAACT,OAAO,GAAG;MAC3BU,UAAU,EAAEA,UAAU,CAACJ,KAAK;MAC5BF,KAAK,EAAE;QACLS,YAAY,EAAEF,YAAY;QAC1BG,YAAY,EAAEF;MAChB;IACF,CAAC,CAAC;EACJ;AACF,CAAC,CAAC"}