@max-ts/svelte 1.12.3 → 1.12.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,10 +6,10 @@ import * as $ from "svelte/internal/client";
|
|
|
6
6
|
//#region src/components/Tooltip/Tooltip.svelte
|
|
7
7
|
var root_5 = $.from_svg(`<svg viewBox="0 0 7.68 4.35" xmlns="http://www.w3.org/2000/svg"><path d="m 0.52372243,0.10910656 c -0.1676883,0 -0.3188698,0.10099765 -0.38304509,0.25594925 -0.0641698,0.1548964 -0.0287017,0.3332318 0.0898753,0.4518088 L 3.5473966,4.1337031 c 0.077725,0.07778 0.1832001,0.1214516 0.2931533,0.1214516 0.1099531,0 0.2154286,-0.043672 0.2932085,-0.1214516 L 7.4505968,0.81686461 c 0.118577,-0.118577 0.1540119,-0.2969124 0.089831,-0.4518088 C 7.476247,0.21010421 7.3251098,0.10910656 7.1573882,0.10910656 Z" fill="inherit"></path></svg>`);
|
|
8
8
|
var root_2 = $.from_html(`<div role="tooltip" data-slot="tooltip-content"><!> <!></div>`);
|
|
9
|
-
var root = $.from_html(
|
|
9
|
+
var root = $.from_html(`<span style="display: contents;" data-slot="tooltip-trigger"><!></span> <!>`, 1);
|
|
10
10
|
function Tooltip($$anchor, $$props) {
|
|
11
11
|
$.push($$props, true);
|
|
12
|
-
let offset = $.prop($$props, "offset", 3, 10), placement = $.prop($$props, "placement", 3, "top"), arrow = $.prop($$props, "arrow", 3, false), delayDuration = $.prop($$props, "delayDuration", 3,
|
|
12
|
+
let offset = $.prop($$props, "offset", 3, 10), placement = $.prop($$props, "placement", 3, "top"), arrow = $.prop($$props, "arrow", 3, false), delayDuration = $.prop($$props, "delayDuration", 3, 100);
|
|
13
13
|
const store = new TooltipStore({
|
|
14
14
|
get placement() {
|
|
15
15
|
return placement();
|
|
@@ -24,9 +24,12 @@ function Tooltip($$anchor, $$props) {
|
|
|
24
24
|
$.user_effect(() => () => store.destroy());
|
|
25
25
|
var fragment = root();
|
|
26
26
|
$.event("keydown", $.window, (e) => e.key === "Escape" && store.open && store.hide());
|
|
27
|
-
var
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
var span = $.first_child(fragment);
|
|
28
|
+
var node = $.child(span);
|
|
29
|
+
$.snippet(node, () => $$props.children ?? $.noop);
|
|
30
|
+
$.reset(span);
|
|
31
|
+
$.attach(span, () => store.attachTrigger);
|
|
32
|
+
var node_1 = $.sibling(span, 2);
|
|
30
33
|
var consequent_2 = ($$anchor) => {
|
|
31
34
|
Portal($$anchor, {
|
|
32
35
|
children: ($$anchor, $$slotProps) => {
|
|
@@ -3,9 +3,7 @@ import type { Snippet } from 'svelte';
|
|
|
3
3
|
export type TooltipProps = {
|
|
4
4
|
delayDuration?: number;
|
|
5
5
|
content?: Snippet<[]> | string;
|
|
6
|
-
children?: Snippet<[
|
|
7
|
-
attach: (node: HTMLElement) => void;
|
|
8
|
-
}]>;
|
|
6
|
+
children?: Snippet<[]>;
|
|
9
7
|
arrow?: boolean;
|
|
10
8
|
offset?: number;
|
|
11
9
|
arrowClass?: string;
|