@signal24/vue-foundation 4.28.0 → 4.28.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@signal24/vue-foundation",
3
3
  "type": "module",
4
- "version": "4.28.0",
4
+ "version": "4.28.2",
5
5
  "description": "Common components, directives, and helpers for Vue 3 apps",
6
6
  "module": "./dist/vue-foundation.es.js",
7
7
  "exports": {
@@ -14,9 +14,12 @@ import {
14
14
  renderList,
15
15
  Teleport,
16
16
  type VNode,
17
- type VNodeProps
17
+ type VNodeProps,
18
+ watch
18
19
  } from 'vue';
19
20
 
21
+ import { VfOptions } from '@/config';
22
+
20
23
  import OverlayAnchor from './overlay-anchor.vue';
21
24
  import type { OverlayAnchorOptions } from './overlay-types';
22
25
 
@@ -36,6 +39,9 @@ export interface OverlayInjection<C extends OverlayComponent, R extends Componen
36
39
 
37
40
  let overlayCount = 0;
38
41
  const OverlayInjections: OverlayInjection<any, any>[] = reactive([]);
42
+ watch(OverlayInjections, () => {
43
+ VfOptions.onOverlaysChanged?.(OverlayInjections.length);
44
+ });
39
45
 
40
46
  export const OverlayContainer = defineComponent({
41
47
  setup() {
package/src/config.ts CHANGED
@@ -4,6 +4,7 @@ interface IOptions {
4
4
  defaultDateFormat: string;
5
5
  defaultTimeFormat: string;
6
6
  defaultCurrencyDivisor: number;
7
+ onOverlaysChanged?: (count: number) => void;
7
8
  }
8
9
 
9
10
  export const VfOptions: IOptions = {
@@ -166,8 +166,8 @@ class VfTooltip {
166
166
  let tipX = e.pageX + 10,
167
167
  tipY = e.pageY + 20;
168
168
 
169
- if (tipX + tipWidth > viewWidth) tipX = e.pageX - 5 - tipWidth;
170
- if (tipY + tipHeight > viewHeight) tipY = e.pageY - 5 - tipHeight;
169
+ if (tipX + tipWidth > viewWidth) tipX = Math.max(10, e.pageX - 5 - tipWidth);
170
+ if (tipY + tipHeight > viewHeight) tipY = Math.max(10, e.pageY - 5 - tipHeight);
171
171
 
172
172
  this.tipEl!.style.left = tipX + 'px';
173
173
  this.tipEl!.style.top = tipY + 'px';