@intechstudio/grid-uikit 1.20260922.1158 → 1.20260922.1223
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.
- package/dist/MoltenTooltip.svelte +76 -73
- package/package.json +1 -1
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
|
|
22
22
|
let showbuttons = $state(false);
|
|
23
23
|
let showTooltip = $state(false);
|
|
24
|
-
let tooltipKey = $state(0);
|
|
25
24
|
let popperInstance: any = $state();
|
|
26
25
|
|
|
27
26
|
// Popper computes its position/flip-away-from-edge decision once, when
|
|
@@ -86,7 +85,13 @@
|
|
|
86
85
|
}
|
|
87
86
|
if (triggerEvents.includes("show-buttons")) {
|
|
88
87
|
clearTimeout(openTimeout);
|
|
89
|
-
|
|
88
|
+
// Show buttons on the existing (already-positioned) popover. Do NOT
|
|
89
|
+
// recreate the Popover here: recreating it while it is already open
|
|
90
|
+
// (e.g. hover opened it first) mounts the new instance with isOpen
|
|
91
|
+
// already true, and popper fails to attach — the surface then renders
|
|
92
|
+
// in-tree next to the reference instead of absolutely positioned. The
|
|
93
|
+
// $effect below calls popperInstance.update() to reposition for the
|
|
94
|
+
// taller buttons content.
|
|
90
95
|
showTooltip = true;
|
|
91
96
|
if (buttons.length > 0) {
|
|
92
97
|
showbuttons = true;
|
|
@@ -271,81 +276,79 @@
|
|
|
271
276
|
}
|
|
272
277
|
</script>
|
|
273
278
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
279
|
+
<Popover
|
|
280
|
+
isOpen={showTooltip}
|
|
281
|
+
triggerEvents={["manual"]}
|
|
282
|
+
{referenceElement}
|
|
283
|
+
bind:placement
|
|
284
|
+
bind:popperInstance
|
|
285
|
+
spaceAway={10}
|
|
286
|
+
>
|
|
287
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
288
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
289
|
+
<div
|
|
290
|
+
on:mouseenter={handleMouseEnter}
|
|
291
|
+
on:mouseleave={handleMouseLeave}
|
|
292
|
+
on:click={handleClick}
|
|
293
|
+
bind:this={tooltipElement}
|
|
294
|
+
tabindex="-1"
|
|
295
|
+
class="{className} tooltip-container"
|
|
296
|
+
transition:fade|global={{
|
|
297
|
+
duration: instant ? 0 : duration, //Make it instant when explicitly clicked
|
|
298
|
+
}}
|
|
282
299
|
>
|
|
283
|
-
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
284
|
-
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
285
300
|
<div
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
on:click={handleClick}
|
|
289
|
-
bind:this={tooltipElement}
|
|
290
|
-
tabindex="-1"
|
|
291
|
-
class="{className} tooltip-container"
|
|
292
|
-
transition:fade|global={{
|
|
293
|
-
duration: instant ? 0 : duration, //Make it instant when explicitly clicked
|
|
294
|
-
}}
|
|
301
|
+
class="tooltip-container-content"
|
|
302
|
+
class:tooltip-gap-2={buttons.length > 0}
|
|
295
303
|
>
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
/>
|
|
332
|
-
{/each}
|
|
333
|
-
</div>
|
|
334
|
-
{/if}
|
|
335
|
-
</div>
|
|
304
|
+
{#if typeof component === "undefined"}
|
|
305
|
+
<div
|
|
306
|
+
class="tooltip-container-text"
|
|
307
|
+
class:tooltip-whitespace-nowrap={nowrap}
|
|
308
|
+
>
|
|
309
|
+
{showbuttons && extendedText !== undefined ? extendedText : text}
|
|
310
|
+
</div>
|
|
311
|
+
{:else}
|
|
312
|
+
<svelte:component
|
|
313
|
+
this={component.object}
|
|
314
|
+
{...component.props}
|
|
315
|
+
class="tooltip-container-component"
|
|
316
|
+
on:event={interceptEvent}
|
|
317
|
+
/>
|
|
318
|
+
{/if}
|
|
319
|
+
|
|
320
|
+
{#if showbuttons}
|
|
321
|
+
<div
|
|
322
|
+
transition:fade|global={{ duration: instant ? 0 : 100 }}
|
|
323
|
+
class="tooltip-container-buttons"
|
|
324
|
+
>
|
|
325
|
+
{#each buttons as button}
|
|
326
|
+
<MoltenPushButton
|
|
327
|
+
text={button.label}
|
|
328
|
+
snap={"full"}
|
|
329
|
+
click={() => {
|
|
330
|
+
if (typeof button.handler !== "undefined") {
|
|
331
|
+
button.handler();
|
|
332
|
+
}
|
|
333
|
+
close();
|
|
334
|
+
}}
|
|
335
|
+
/>
|
|
336
|
+
{/each}
|
|
337
|
+
</div>
|
|
338
|
+
{/if}
|
|
336
339
|
</div>
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
</
|
|
348
|
-
|
|
340
|
+
</div>
|
|
341
|
+
<div
|
|
342
|
+
transition:fade|global={{
|
|
343
|
+
duration: instant ? 0 : duration,
|
|
344
|
+
}}
|
|
345
|
+
class="tooltip-absolute"
|
|
346
|
+
id="arrow"
|
|
347
|
+
data-popper-arrow
|
|
348
|
+
>
|
|
349
|
+
<div class="tooltip-absolute" id="arrow_face" />
|
|
350
|
+
</div>
|
|
351
|
+
</Popover>
|
|
349
352
|
|
|
350
353
|
<style>
|
|
351
354
|
div.tooltip-container {
|