@vaadin/popover 25.0.0 → 25.0.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 +10 -10
- package/src/lit/renderer-directives.d.ts +1 -1
- package/src/lit/renderer-directives.js +1 -1
- package/src/styles/vaadin-popover-overlay-base-styles.d.ts +1 -1
- package/src/styles/vaadin-popover-overlay-base-styles.js +1 -1
- package/src/vaadin-popover-overlay-mixin.js +20 -8
- package/src/vaadin-popover-overlay.js +1 -1
- package/src/vaadin-popover-position-mixin.d.ts +1 -1
- package/src/vaadin-popover-position-mixin.js +1 -1
- package/src/vaadin-popover-target-mixin.d.ts +1 -1
- package/src/vaadin-popover-target-mixin.js +1 -1
- package/src/vaadin-popover.d.ts +1 -1
- package/src/vaadin-popover.js +1 -1
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/popover",
|
|
3
|
-
"version": "25.0.
|
|
3
|
+
"version": "25.0.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -36,23 +36,23 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
39
|
-
"@vaadin/a11y-base": "~25.0.
|
|
40
|
-
"@vaadin/component-base": "~25.0.
|
|
41
|
-
"@vaadin/lit-renderer": "~25.0.
|
|
42
|
-
"@vaadin/overlay": "~25.0.
|
|
43
|
-
"@vaadin/vaadin-themable-mixin": "~25.0.
|
|
39
|
+
"@vaadin/a11y-base": "~25.0.2",
|
|
40
|
+
"@vaadin/component-base": "~25.0.2",
|
|
41
|
+
"@vaadin/lit-renderer": "~25.0.2",
|
|
42
|
+
"@vaadin/overlay": "~25.0.2",
|
|
43
|
+
"@vaadin/vaadin-themable-mixin": "~25.0.2",
|
|
44
44
|
"lit": "^3.0.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@vaadin/chai-plugins": "~25.0.
|
|
48
|
-
"@vaadin/test-runner-commands": "~25.0.
|
|
47
|
+
"@vaadin/chai-plugins": "~25.0.2",
|
|
48
|
+
"@vaadin/test-runner-commands": "~25.0.2",
|
|
49
49
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
50
|
-
"@vaadin/vaadin-lumo-styles": "~25.0.
|
|
50
|
+
"@vaadin/vaadin-lumo-styles": "~25.0.2",
|
|
51
51
|
"sinon": "^21.0.0"
|
|
52
52
|
},
|
|
53
53
|
"web-types": [
|
|
54
54
|
"web-types.json",
|
|
55
55
|
"web-types.lit.json"
|
|
56
56
|
],
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "d17c1f8b7c6f3f991cafd9dbdbe5759caa57afcd"
|
|
58
58
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2024 -
|
|
3
|
+
* Copyright (c) 2024 - 2026 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { DirectiveResult } from 'lit/directive.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2022 -
|
|
3
|
+
* Copyright (c) 2022 - 2026 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
|
|
@@ -37,11 +37,26 @@ export const PopoverOverlayMixin = (superClass) =>
|
|
|
37
37
|
|
|
38
38
|
this.removeAttribute('arrow-centered');
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
const targetRect = this.positionTarget.getBoundingClientRect();
|
|
41
|
+
const overlayRect = this.$.overlay.getBoundingClientRect();
|
|
42
|
+
const viewportWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);
|
|
43
|
+
|
|
44
|
+
// If the overlay extends beyond viewport, align the overlay to the respective edge so it isn't cut off
|
|
45
|
+
// Can skip trying to center the overlay in this case
|
|
46
|
+
let skipHorizontalCentering = false;
|
|
47
|
+
|
|
48
|
+
if (overlayRect.left < 0) {
|
|
49
|
+
this.style.left = '0px';
|
|
50
|
+
this.style.right = '';
|
|
51
|
+
skipHorizontalCentering = true;
|
|
52
|
+
} else if (overlayRect.right > viewportWidth) {
|
|
53
|
+
this.style.right = '0px';
|
|
54
|
+
this.style.left = '';
|
|
55
|
+
skipHorizontalCentering = true;
|
|
56
|
+
}
|
|
44
57
|
|
|
58
|
+
// Center the overlay horizontally
|
|
59
|
+
if (!skipHorizontalCentering && (this.position === 'bottom' || this.position === 'top')) {
|
|
45
60
|
const offset = targetRect.width / 2 - overlayRect.width / 2;
|
|
46
61
|
|
|
47
62
|
if (this.style.left) {
|
|
@@ -65,9 +80,6 @@ export const PopoverOverlayMixin = (superClass) =>
|
|
|
65
80
|
|
|
66
81
|
// Center the overlay vertically
|
|
67
82
|
if (this.position === 'start' || this.position === 'end') {
|
|
68
|
-
const targetRect = this.positionTarget.getBoundingClientRect();
|
|
69
|
-
const overlayRect = this.$.overlay.getBoundingClientRect();
|
|
70
|
-
|
|
71
83
|
const offset = targetRect.height / 2 - overlayRect.height / 2;
|
|
72
84
|
this.style.top = `${overlayRect.top + offset}px`;
|
|
73
85
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2024 -
|
|
3
|
+
* Copyright (c) 2024 - 2026 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2024 -
|
|
3
|
+
* Copyright (c) 2024 - 2026 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2024 -
|
|
3
|
+
* Copyright (c) 2024 - 2026 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { microTask } from '@vaadin/component-base/src/async.js';
|
package/src/vaadin-popover.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2024 -
|
|
3
|
+
* Copyright (c) 2024 - 2026 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
package/src/vaadin-popover.js
CHANGED
package/web-types.json
CHANGED