@rokkit/actions 1.0.3 → 1.0.5
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/package.json +1 -1
- package/src/tooltip.svelte.js +3 -0
package/package.json
CHANGED
package/src/tooltip.svelte.js
CHANGED
|
@@ -43,6 +43,7 @@ function resolveFlip(triggerRect, tooltipRect, preferred) {
|
|
|
43
43
|
return Object.keys(fits).find((p) => fits[p]) ?? preferred
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
// eslint-disable-next-line max-lines-per-function
|
|
46
47
|
function positionTooltip(trigger, tooltipEl, preferred) {
|
|
47
48
|
const triggerRect = trigger.getBoundingClientRect()
|
|
48
49
|
const container = tooltipEl.parentElement
|
|
@@ -84,7 +85,9 @@ function positionTooltip(trigger, tooltipEl, preferred) {
|
|
|
84
85
|
tooltipEl.style.left = `${left}px`
|
|
85
86
|
}
|
|
86
87
|
|
|
88
|
+
// eslint-disable-next-line max-lines-per-function
|
|
87
89
|
export function tooltip(node, options = {}) {
|
|
90
|
+
// eslint-disable-next-line max-lines-per-function
|
|
88
91
|
$effect(() => {
|
|
89
92
|
const opts = { content: '', position: 'top', delay: 300, ...options }
|
|
90
93
|
const id = uid()
|