Make TriggerType an input argument for WithTooltip

This commit is contained in:
Henrik Giesel 2021-06-12 11:08:26 +02:00
parent 62b4b4c12c
commit 98c57ce3f8

View File

@ -6,7 +6,18 @@
import { onDestroy } from "svelte"; import { onDestroy } from "svelte";
import Tooltip from "bootstrap/js/dist/tooltip"; import Tooltip from "bootstrap/js/dist/tooltip";
type TriggerType =
| "hover focus"
| "click"
| "hover"
| "focus"
| "manual"
| "click hover"
| "click focus"
| "click hover focus";
export let tooltip: string; export let tooltip: string;
export let trigger: TriggerType = "hover focus";
let tooltipObject: Tooltip; let tooltipObject: Tooltip;
@ -17,6 +28,7 @@
html: true, html: true,
offset: [0, 20], offset: [0, 20],
delay: { show: 250, hide: 0 }, delay: { show: 250, hide: 0 },
trigger,
}); });
} }