@vaadin/tooltip 24.2.0-alpha4 → 24.2.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/tooltip",
3
- "version": "24.2.0-alpha4",
3
+ "version": "24.2.0-alpha5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,21 +35,21 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@polymer/polymer": "^3.0.0",
38
- "@vaadin/a11y-base": "24.2.0-alpha4",
39
- "@vaadin/component-base": "24.2.0-alpha4",
40
- "@vaadin/overlay": "24.2.0-alpha4",
41
- "@vaadin/vaadin-lumo-styles": "24.2.0-alpha4",
42
- "@vaadin/vaadin-material-styles": "24.2.0-alpha4",
43
- "@vaadin/vaadin-themable-mixin": "24.2.0-alpha4"
38
+ "@vaadin/a11y-base": "24.2.0-alpha5",
39
+ "@vaadin/component-base": "24.2.0-alpha5",
40
+ "@vaadin/overlay": "24.2.0-alpha5",
41
+ "@vaadin/vaadin-lumo-styles": "24.2.0-alpha5",
42
+ "@vaadin/vaadin-material-styles": "24.2.0-alpha5",
43
+ "@vaadin/vaadin-themable-mixin": "24.2.0-alpha5"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@esm-bundle/chai": "^4.3.4",
47
- "@vaadin/testing-helpers": "^0.4.2",
47
+ "@vaadin/testing-helpers": "^0.4.3",
48
48
  "sinon": "^13.0.2"
49
49
  },
50
50
  "web-types": [
51
51
  "web-types.json",
52
52
  "web-types.lit.json"
53
53
  ],
54
- "gitHead": "aaf7c5ebfea62628210eead4229be1718ac6b129"
54
+ "gitHead": "73db22a5e8993e3ce48d1e6540d30eff9cb5c257"
55
55
  }
@@ -3,73 +3,75 @@
3
3
  * Copyright (c) 2022 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { Overlay } from '@vaadin/overlay/src/vaadin-overlay.js';
6
+ import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
7
+ import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
8
+ import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
7
9
  import { PositionMixin } from '@vaadin/overlay/src/vaadin-overlay-position-mixin.js';
8
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
10
+ import { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';
11
+ import { css, registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
9
12
 
10
- registerStyles(
11
- 'vaadin-tooltip-overlay',
12
- css`
13
- :host {
14
- z-index: 1100;
15
- }
13
+ const tooltipOverlayStyles = css`
14
+ :host {
15
+ z-index: 1100;
16
+ }
16
17
 
17
- [part='overlay'] {
18
- max-width: 40ch;
19
- }
18
+ [part='overlay'] {
19
+ max-width: 40ch;
20
+ }
20
21
 
21
- :host([position^='top'][top-aligned]) [part='overlay'],
22
- :host([position^='bottom'][top-aligned]) [part='overlay'] {
23
- margin-top: var(--vaadin-tooltip-offset-top, 0);
24
- }
22
+ :host([position^='top'][top-aligned]) [part='overlay'],
23
+ :host([position^='bottom'][top-aligned]) [part='overlay'] {
24
+ margin-top: var(--vaadin-tooltip-offset-top, 0);
25
+ }
25
26
 
26
- :host([position^='top'][bottom-aligned]) [part='overlay'],
27
- :host([position^='bottom'][bottom-aligned]) [part='overlay'] {
28
- margin-bottom: var(--vaadin-tooltip-offset-bottom, 0);
29
- }
27
+ :host([position^='top'][bottom-aligned]) [part='overlay'],
28
+ :host([position^='bottom'][bottom-aligned]) [part='overlay'] {
29
+ margin-bottom: var(--vaadin-tooltip-offset-bottom, 0);
30
+ }
30
31
 
31
- :host([position^='start'][start-aligned]) [part='overlay'],
32
- :host([position^='end'][start-aligned]) [part='overlay'] {
33
- margin-inline-start: var(--vaadin-tooltip-offset-start, 0);
34
- }
32
+ :host([position^='start'][start-aligned]) [part='overlay'],
33
+ :host([position^='end'][start-aligned]) [part='overlay'] {
34
+ margin-inline-start: var(--vaadin-tooltip-offset-start, 0);
35
+ }
35
36
 
36
- :host([position^='start'][end-aligned]) [part='overlay'],
37
- :host([position^='end'][end-aligned]) [part='overlay'] {
38
- margin-inline-end: var(--vaadin-tooltip-offset-end, 0);
39
- }
37
+ :host([position^='start'][end-aligned]) [part='overlay'],
38
+ :host([position^='end'][end-aligned]) [part='overlay'] {
39
+ margin-inline-end: var(--vaadin-tooltip-offset-end, 0);
40
+ }
40
41
 
41
- @media (forced-colors: active) {
42
- [part='overlay'] {
43
- outline: 1px dashed;
44
- }
42
+ @media (forced-colors: active) {
43
+ [part='overlay'] {
44
+ outline: 1px dashed;
45
45
  }
46
- `,
47
- { moduleId: 'vaadin-tooltip-overlay-styles' },
48
- );
46
+ }
47
+ `;
49
48
 
50
- let memoizedTemplate;
49
+ registerStyles('vaadin-tooltip-overlay', [overlayStyles, tooltipOverlayStyles], {
50
+ moduleId: 'vaadin-tooltip-overlay-styles',
51
+ });
51
52
 
52
53
  /**
53
54
  * An element used internally by `<vaadin-tooltip>`. Not intended to be used separately.
54
55
  *
55
- * @extends Overlay
56
+ * @extends HTMLElement
57
+ * @mixes DirMixin
58
+ * @mixes OverlayMixin
59
+ * @mixes PositionMixin
60
+ * @mixes ThemableMixin
56
61
  * @private
57
62
  */
58
- class TooltipOverlay extends PositionMixin(Overlay) {
63
+ class TooltipOverlay extends PositionMixin(OverlayMixin(DirMixin(ThemableMixin(PolymerElement)))) {
59
64
  static get is() {
60
65
  return 'vaadin-tooltip-overlay';
61
66
  }
62
67
 
63
68
  static get template() {
64
- if (!memoizedTemplate) {
65
- memoizedTemplate = super.template.cloneNode(true);
66
- memoizedTemplate.content.querySelector('[part~="overlay"]').removeAttribute('tabindex');
67
-
68
- // Remove whitespace text nodes around the content slot to allow "white-space: pre"
69
- memoizedTemplate.content.querySelector('[part~="content"]').innerHTML = '<slot></slot>';
70
- }
71
-
72
- return memoizedTemplate;
69
+ return html`
70
+ <div id="backdrop" part="backdrop" hidden></div>
71
+ <div part="overlay" id="overlay">
72
+ <div part="content" id="content"><slot></slot></div>
73
+ </div>
74
+ `;
73
75
  }
74
76
 
75
77
  static get properties() {
@@ -1,3 +1,2 @@
1
- import '@vaadin/overlay/theme/lumo/vaadin-overlay.js';
2
1
  import './vaadin-tooltip-styles.js';
3
2
  import '../../src/vaadin-tooltip.js';
@@ -1,3 +1,2 @@
1
- import '@vaadin/overlay/theme/material/vaadin-overlay.js';
2
1
  import './vaadin-tooltip-styles.js';
3
2
  import '../../src/vaadin-tooltip.js';
package/web-types.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/tooltip",
4
- "version": "24.2.0-alpha4",
4
+ "version": "24.2.0-alpha5",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
9
  {
10
10
  "name": "vaadin-tooltip",
11
- "description": "`<vaadin-tooltip>` is a Web Component for creating tooltips.\n\n```html\n<button id=\"confirm\">Confirm</button>\n<vaadin-tooltip text=\"Click to save changes\" for=\"confirm\"></vaadin-tooltip>\n```\n\n### Styling\n\n`<vaadin-tooltip>` uses `<vaadin-tooltip-overlay>` internal\nthemable component as the actual visible overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0-alpha4/#/elements/vaadin-overlay) documentation\nfor `<vaadin-tooltip-overlay>` parts.\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-tooltip>` is\npropagated to the internal `<vaadin-tooltip-overlay>` component.\n\n### Custom CSS Properties\n\nThe following custom CSS properties are available on the `<vaadin-tooltip>` element:\n\nCustom CSS property | Description\n---------------------------------|-------------\n`--vaadin-tooltip-offset-top` | Used as an offset when the tooltip is aligned vertically below the target\n`--vaadin-tooltip-offset-bottom` | Used as an offset when the tooltip is aligned vertically above the target\n`--vaadin-tooltip-offset-start` | Used as an offset when the tooltip is aligned horizontally after the target\n`--vaadin-tooltip-offset-end` | Used as an offset when the tooltip is aligned horizontally before the target\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
11
+ "description": "`<vaadin-tooltip>` is a Web Component for creating tooltips.\n\n```html\n<button id=\"confirm\">Confirm</button>\n<vaadin-tooltip text=\"Click to save changes\" for=\"confirm\"></vaadin-tooltip>\n```\n\n### Styling\n\n`<vaadin-tooltip>` uses `<vaadin-tooltip-overlay>` internal\nthemable component as the actual visible overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0-alpha5/#/elements/vaadin-overlay) documentation\nfor `<vaadin-tooltip-overlay>` parts.\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-tooltip>` is\npropagated to the internal `<vaadin-tooltip-overlay>` component.\n\n### Custom CSS Properties\n\nThe following custom CSS properties are available on the `<vaadin-tooltip>` element:\n\nCustom CSS property | Description\n---------------------------------|-------------\n`--vaadin-tooltip-offset-top` | Used as an offset when the tooltip is aligned vertically below the target\n`--vaadin-tooltip-offset-bottom` | Used as an offset when the tooltip is aligned vertically above the target\n`--vaadin-tooltip-offset-start` | Used as an offset when the tooltip is aligned horizontally after the target\n`--vaadin-tooltip-offset-end` | Used as an offset when the tooltip 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/tooltip",
4
- "version": "24.2.0-alpha4",
4
+ "version": "24.2.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-tooltip",
19
- "description": "`<vaadin-tooltip>` is a Web Component for creating tooltips.\n\n```html\n<button id=\"confirm\">Confirm</button>\n<vaadin-tooltip text=\"Click to save changes\" for=\"confirm\"></vaadin-tooltip>\n```\n\n### Styling\n\n`<vaadin-tooltip>` uses `<vaadin-tooltip-overlay>` internal\nthemable component as the actual visible overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0-alpha4/#/elements/vaadin-overlay) documentation\nfor `<vaadin-tooltip-overlay>` parts.\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-tooltip>` is\npropagated to the internal `<vaadin-tooltip-overlay>` component.\n\n### Custom CSS Properties\n\nThe following custom CSS properties are available on the `<vaadin-tooltip>` element:\n\nCustom CSS property | Description\n---------------------------------|-------------\n`--vaadin-tooltip-offset-top` | Used as an offset when the tooltip is aligned vertically below the target\n`--vaadin-tooltip-offset-bottom` | Used as an offset when the tooltip is aligned vertically above the target\n`--vaadin-tooltip-offset-start` | Used as an offset when the tooltip is aligned horizontally after the target\n`--vaadin-tooltip-offset-end` | Used as an offset when the tooltip is aligned horizontally before the target\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
19
+ "description": "`<vaadin-tooltip>` is a Web Component for creating tooltips.\n\n```html\n<button id=\"confirm\">Confirm</button>\n<vaadin-tooltip text=\"Click to save changes\" for=\"confirm\"></vaadin-tooltip>\n```\n\n### Styling\n\n`<vaadin-tooltip>` uses `<vaadin-tooltip-overlay>` internal\nthemable component as the actual visible overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0-alpha5/#/elements/vaadin-overlay) documentation\nfor `<vaadin-tooltip-overlay>` parts.\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-tooltip>` is\npropagated to the internal `<vaadin-tooltip-overlay>` component.\n\n### Custom CSS Properties\n\nThe following custom CSS properties are available on the `<vaadin-tooltip>` element:\n\nCustom CSS property | Description\n---------------------------------|-------------\n`--vaadin-tooltip-offset-top` | Used as an offset when the tooltip is aligned vertically below the target\n`--vaadin-tooltip-offset-bottom` | Used as an offset when the tooltip is aligned vertically above the target\n`--vaadin-tooltip-offset-start` | Used as an offset when the tooltip is aligned horizontally after the target\n`--vaadin-tooltip-offset-end` | Used as an offset when the tooltip 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
  {