@icij/murmur-next 4.1.1 → 4.1.2

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.
@@ -352,8 +352,9 @@ export default defineComponent({
352
352
  }
353
353
 
354
354
  function barTooltipStyle(bar: { x: number; y: number; width: number }) {
355
- const top = `${bar.y + margin.value.top}px`
356
- const left = `${bar.x + bar.width / 2 + margin.value.left}px`
355
+ const { x, y } = el?.value?.getBoundingClientRect() ?? new DOMRect()
356
+ const top = `${y + bar.y + margin.value.top}px`
357
+ const left = `${x + bar.x + bar.width / 2 + margin.value.left}px`
357
358
  return { top, left }
358
359
  }
359
360
 
@@ -441,27 +442,29 @@ export default defineComponent({
441
442
  </g>
442
443
  </g>
443
444
  </svg>
444
- <div v-if="!noTooltips" class="column-chart__tooltips">
445
- <div v-for="(bar, index) in bars" :key="index">
446
- <div :style="barTooltipStyle(bar)" class="column-chart__tooltips__item">
447
- <transition name="fade">
448
- <div
449
- v-if="shownTooltip === index"
450
- class="column-chart__tooltips__item__wrapper"
451
- >
452
- <slot name="tooltip" v-bind="bar">
453
- <h6 class="column-chart__tooltips__item__wrapper__heading mb-0">
454
- {{ formatXDatum(bar.datum[timeseriesKey]) }}
455
- </h6>
456
- <div class="column-chart__tooltips__item__wrapper__value">
457
- {{ formatYDatum(bar.datum[seriesName]) }}
458
- </div>
459
- </slot>
460
- </div>
461
- </transition>
445
+ <teleport to="body">
446
+ <div v-if="!noTooltips" class="column-chart__tooltips">
447
+ <div v-for="(bar, index) in bars" :key="index">
448
+ <div :style="barTooltipStyle(bar)" class="column-chart__tooltips__item">
449
+ <transition name="fade">
450
+ <div
451
+ v-if="shownTooltip === index"
452
+ class="column-chart__tooltips__item__wrapper"
453
+ >
454
+ <slot name="tooltip" v-bind="bar">
455
+ <h6 class="column-chart__tooltips__item__wrapper__heading mb-0">
456
+ {{ formatXDatum(bar.datum[timeseriesKey]) }}
457
+ </h6>
458
+ <div class="column-chart__tooltips__item__wrapper__value">
459
+ {{ formatYDatum(bar.datum[seriesName]) }}
460
+ </div>
461
+ </slot>
462
+ </div>
463
+ </transition>
464
+ </div>
462
465
  </div>
463
466
  </div>
464
- </div>
467
+ </teleport>
465
468
  </div>
466
469
  </template>
467
470
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icij/murmur-next",
3
- "version": "4.1.1",
3
+ "version": "4.1.2",
4
4
  "private": false,
5
5
  "description": "Murmur is ICIJ's Design System for Bootstrap 5 and Vue.js",
6
6
  "author": "promera@icij.org",