@vaadin/popover 24.8.0-alpha3 → 24.8.0-alpha5

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/popover",
3
- "version": "24.8.0-alpha3",
3
+ "version": "24.8.0-alpha5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,18 +37,18 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@open-wc/dedupe-mixin": "^1.3.0",
40
- "@vaadin/a11y-base": "24.8.0-alpha3",
41
- "@vaadin/component-base": "24.8.0-alpha3",
42
- "@vaadin/lit-renderer": "24.8.0-alpha3",
43
- "@vaadin/overlay": "24.8.0-alpha3",
44
- "@vaadin/vaadin-lumo-styles": "24.8.0-alpha3",
45
- "@vaadin/vaadin-material-styles": "24.8.0-alpha3",
46
- "@vaadin/vaadin-themable-mixin": "24.8.0-alpha3",
40
+ "@vaadin/a11y-base": "24.8.0-alpha5",
41
+ "@vaadin/component-base": "24.8.0-alpha5",
42
+ "@vaadin/lit-renderer": "24.8.0-alpha5",
43
+ "@vaadin/overlay": "24.8.0-alpha5",
44
+ "@vaadin/vaadin-lumo-styles": "24.8.0-alpha5",
45
+ "@vaadin/vaadin-material-styles": "24.8.0-alpha5",
46
+ "@vaadin/vaadin-themable-mixin": "24.8.0-alpha5",
47
47
  "lit": "^3.0.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@vaadin/chai-plugins": "24.8.0-alpha3",
51
- "@vaadin/test-runner-commands": "24.8.0-alpha3",
50
+ "@vaadin/chai-plugins": "24.8.0-alpha5",
51
+ "@vaadin/test-runner-commands": "24.8.0-alpha5",
52
52
  "@vaadin/testing-helpers": "^1.1.0",
53
53
  "sinon": "^18.0.0"
54
54
  },
@@ -56,5 +56,5 @@
56
56
  "web-types.json",
57
57
  "web-types.lit.json"
58
58
  ],
59
- "gitHead": "8c49e2337a1905ae68d0d7aee2e672500ea72343"
59
+ "gitHead": "3bb64b9ad9b00ac3adb94eb1bedd81b0f4ae574e"
60
60
  }
@@ -4,7 +4,6 @@
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { css, html, LitElement } from 'lit';
7
- import { isElementFocused } from '@vaadin/a11y-base/src/focus-utils.js';
8
7
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
9
8
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
10
9
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
@@ -108,24 +107,6 @@ class PopoverOverlay extends PopoverOverlayMixin(DirMixin(ThemableMixin(PolylitM
108
107
  </div>
109
108
  `;
110
109
  }
111
-
112
- /**
113
- * Override method inherited from `OverlayMixin` to not close
114
- * modal popover on outside click when opening on focus.
115
- *
116
- * @param {Event} event
117
- * @return {boolean}
118
- * @protected
119
- */
120
- _shouldCloseOnOutsideClick(event) {
121
- // When opening a modal popover on mouse focusin, the focus moves to the overlay
122
- // and then outside click listener is fired. Detect this case and prevent closing.
123
- if (this.owner.__hasTrigger('focus') && isElementFocused(this)) {
124
- return false;
125
- }
126
-
127
- return super._shouldCloseOnOutsideClick(event);
128
- }
129
110
  }
130
111
 
131
112
  defineCustomElement(PopoverOverlay);
@@ -67,11 +67,17 @@ class PopoverOpenedStateController {
67
67
  * @param {Object} options
68
68
  */
69
69
  open(options = { immediate: false }) {
70
+ if (this.isClosing) {
71
+ // Abort closing on overlay mouseenter.
72
+ this.__abortClose();
73
+ return;
74
+ }
75
+
70
76
  const { immediate, trigger } = options;
71
77
  const shouldDelayHover = trigger === 'hover' && this.__hoverDelay > 0;
72
78
  const shouldDelayFocus = trigger === 'focus' && this.__focusDelay > 0;
73
79
 
74
- if (!immediate && (shouldDelayHover || shouldDelayFocus) && !this.__closeTimeout) {
80
+ if (!immediate && (shouldDelayHover || shouldDelayFocus)) {
75
81
  this.__scheduleOpen(trigger);
76
82
  } else {
77
83
  this.__showPopover();
@@ -83,14 +89,16 @@ class PopoverOpenedStateController {
83
89
  * @param {boolean} immediate
84
90
  */
85
91
  close(immediate) {
86
- if (!immediate && this.__hideDelay > 0) {
87
- this.__scheduleClose();
88
- } else {
92
+ if (this.__openTimeout != null) {
93
+ // Close immediately if still opening to not wait for hide delay.
94
+ this.__abortOpen();
95
+ } else if (immediate || this.__hideDelay === 0) {
96
+ // Close immediately e.g. on Esc press or with zero hide delay.
89
97
  this.__abortClose();
90
98
  this.__setOpened(false);
99
+ } else {
100
+ this.__scheduleClose();
91
101
  }
92
-
93
- this.__abortOpen();
94
102
  }
95
103
 
96
104
  /** @private */
package/web-types.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/popover",
4
- "version": "24.8.0-alpha3",
4
+ "version": "24.8.0-alpha5",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
9
  {
10
10
  "name": "vaadin-popover",
11
- "description": "`<vaadin-popover>` is a Web Component for creating overlays\nthat are positioned next to specified DOM element (target).\n\nUnlike `<vaadin-tooltip>`, the popover supports rich content\nthat can be provided by using `renderer` function.\n\n### Styling\n\n`<vaadin-popover>` uses `<vaadin-popover-overlay>` internal\nthemable component as the actual visible overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.8.0-alpha3/#/elements/vaadin-overlay) documentation\nfor `<vaadin-popover-overlay>` parts.\n\nIn addition to `<vaadin-overlay>` parts, the following parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`arrow` | Optional arrow pointing to the target when using `theme=\"arrow\"`\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|----------------------------------------\n`position` | Reflects the `position` property value.\n\nNote: the `theme` attribute value set on `<vaadin-popover>` is\npropagated to the internal `<vaadin-popover-overlay>` component.\n\n### Custom CSS Properties\n\nThe following custom CSS properties are available on the `<vaadin-popover>` element:\n\nCustom CSS property | Description\n---------------------------------|-------------\n`--vaadin-popover-offset-top` | Used as an offset when the popover is aligned vertically below the target\n`--vaadin-popover-offset-bottom` | Used as an offset when the popover is aligned vertically above the target\n`--vaadin-popover-offset-start` | Used as an offset when the popover is aligned horizontally after the target\n`--vaadin-popover-offset-end` | Used as an offset when the popover is aligned horizontally before the target\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
11
+ "description": "`<vaadin-popover>` is a Web Component for creating overlays\nthat are positioned next to specified DOM element (target).\n\nUnlike `<vaadin-tooltip>`, the popover supports rich content\nthat can be provided by using `renderer` function.\n\n### Styling\n\n`<vaadin-popover>` uses `<vaadin-popover-overlay>` internal\nthemable component as the actual visible overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.8.0-alpha5/#/elements/vaadin-overlay) documentation\nfor `<vaadin-popover-overlay>` parts.\n\nIn addition to `<vaadin-overlay>` parts, the following parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`arrow` | Optional arrow pointing to the target when using `theme=\"arrow\"`\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|----------------------------------------\n`position` | Reflects the `position` property value.\n\nNote: the `theme` attribute value set on `<vaadin-popover>` is\npropagated to the internal `<vaadin-popover-overlay>` component.\n\n### Custom CSS Properties\n\nThe following custom CSS properties are available on the `<vaadin-popover>` element:\n\nCustom CSS property | Description\n---------------------------------|-------------\n`--vaadin-popover-offset-top` | Used as an offset when the popover is aligned vertically below the target\n`--vaadin-popover-offset-bottom` | Used as an offset when the popover is aligned vertically above the target\n`--vaadin-popover-offset-start` | Used as an offset when the popover is aligned horizontally after the target\n`--vaadin-popover-offset-end` | Used as an offset when the popover is aligned horizontally before the target\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
12
12
  "attributes": [
13
13
  {
14
14
  "name": "overlay-class",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/popover",
4
- "version": "24.8.0-alpha3",
4
+ "version": "24.8.0-alpha5",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -16,7 +16,7 @@
16
16
  "elements": [
17
17
  {
18
18
  "name": "vaadin-popover",
19
- "description": "`<vaadin-popover>` is a Web Component for creating overlays\nthat are positioned next to specified DOM element (target).\n\nUnlike `<vaadin-tooltip>`, the popover supports rich content\nthat can be provided by using `renderer` function.\n\n### Styling\n\n`<vaadin-popover>` uses `<vaadin-popover-overlay>` internal\nthemable component as the actual visible overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.8.0-alpha3/#/elements/vaadin-overlay) documentation\nfor `<vaadin-popover-overlay>` parts.\n\nIn addition to `<vaadin-overlay>` parts, the following parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`arrow` | Optional arrow pointing to the target when using `theme=\"arrow\"`\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|----------------------------------------\n`position` | Reflects the `position` property value.\n\nNote: the `theme` attribute value set on `<vaadin-popover>` is\npropagated to the internal `<vaadin-popover-overlay>` component.\n\n### Custom CSS Properties\n\nThe following custom CSS properties are available on the `<vaadin-popover>` element:\n\nCustom CSS property | Description\n---------------------------------|-------------\n`--vaadin-popover-offset-top` | Used as an offset when the popover is aligned vertically below the target\n`--vaadin-popover-offset-bottom` | Used as an offset when the popover is aligned vertically above the target\n`--vaadin-popover-offset-start` | Used as an offset when the popover is aligned horizontally after the target\n`--vaadin-popover-offset-end` | Used as an offset when the popover is aligned horizontally before the target\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
19
+ "description": "`<vaadin-popover>` is a Web Component for creating overlays\nthat are positioned next to specified DOM element (target).\n\nUnlike `<vaadin-tooltip>`, the popover supports rich content\nthat can be provided by using `renderer` function.\n\n### Styling\n\n`<vaadin-popover>` uses `<vaadin-popover-overlay>` internal\nthemable component as the actual visible overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.8.0-alpha5/#/elements/vaadin-overlay) documentation\nfor `<vaadin-popover-overlay>` parts.\n\nIn addition to `<vaadin-overlay>` parts, the following parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`arrow` | Optional arrow pointing to the target when using `theme=\"arrow\"`\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|----------------------------------------\n`position` | Reflects the `position` property value.\n\nNote: the `theme` attribute value set on `<vaadin-popover>` is\npropagated to the internal `<vaadin-popover-overlay>` component.\n\n### Custom CSS Properties\n\nThe following custom CSS properties are available on the `<vaadin-popover>` element:\n\nCustom CSS property | Description\n---------------------------------|-------------\n`--vaadin-popover-offset-top` | Used as an offset when the popover is aligned vertically below the target\n`--vaadin-popover-offset-bottom` | Used as an offset when the popover is aligned vertically above the target\n`--vaadin-popover-offset-start` | Used as an offset when the popover is aligned horizontally after the target\n`--vaadin-popover-offset-end` | Used as an offset when the popover is aligned horizontally before the target\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
20
20
  "extension": true,
21
21
  "attributes": [
22
22
  {