@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
|
@@ -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
|
@@ -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';
|