@vaadin/tabs 25.0.0-alpha2 → 25.0.0-alpha4

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/tabs",
3
- "version": "25.0.0-alpha2",
3
+ "version": "25.0.0-alpha4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,16 +35,16 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
- "@vaadin/a11y-base": "25.0.0-alpha2",
39
- "@vaadin/component-base": "25.0.0-alpha2",
40
- "@vaadin/item": "25.0.0-alpha2",
41
- "@vaadin/vaadin-lumo-styles": "25.0.0-alpha2",
42
- "@vaadin/vaadin-themable-mixin": "25.0.0-alpha2",
38
+ "@vaadin/a11y-base": "25.0.0-alpha4",
39
+ "@vaadin/component-base": "25.0.0-alpha4",
40
+ "@vaadin/item": "25.0.0-alpha4",
41
+ "@vaadin/vaadin-lumo-styles": "25.0.0-alpha4",
42
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha4",
43
43
  "lit": "^3.0.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@vaadin/chai-plugins": "25.0.0-alpha2",
47
- "@vaadin/test-runner-commands": "25.0.0-alpha2",
46
+ "@vaadin/chai-plugins": "25.0.0-alpha4",
47
+ "@vaadin/test-runner-commands": "25.0.0-alpha4",
48
48
  "@vaadin/testing-helpers": "^2.0.0",
49
49
  "sinon": "^18.0.0"
50
50
  },
@@ -52,5 +52,5 @@
52
52
  "web-types.json",
53
53
  "web-types.lit.json"
54
54
  ],
55
- "gitHead": "67ffcd5355cf21ce1b5039c598525109fc4c164b"
55
+ "gitHead": "ce4421f0daf26027b863b91787a474e4cc264344"
56
56
  }
package/src/vaadin-tab.js CHANGED
@@ -8,9 +8,9 @@ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
8
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
9
9
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
10
10
  import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
11
+ import { ItemMixin } from '@vaadin/item/src/vaadin-item-mixin.js';
11
12
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
12
- import { TabMixin } from './vaadin-tab-mixin.js';
13
- import { tabStyles } from './vaadin-tab-styles.js';
13
+ import { tabStyles } from './styles/vaadin-tab-styles.js';
14
14
 
15
15
  /**
16
16
  * `<vaadin-tab>` is a Web Component providing an accessible and customizable tab.
@@ -37,10 +37,10 @@ import { tabStyles } from './vaadin-tab-styles.js';
37
37
  * @customElement
38
38
  * @extends HTMLElement
39
39
  * @mixes ElementMixin
40
+ * @mixes ItemMixin
40
41
  * @mixes ThemableMixin
41
- * @mixes TabMixin
42
42
  */
43
- class Tab extends TabMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {
43
+ class Tab extends ItemMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {
44
44
  static get is() {
45
45
  return 'vaadin-tab';
46
46
  }
@@ -61,9 +61,31 @@ class Tab extends TabMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))
61
61
  ready() {
62
62
  super.ready();
63
63
 
64
+ this.setAttribute('role', 'tab');
65
+
64
66
  this._tooltipController = new TooltipController(this);
65
67
  this.addController(this._tooltipController);
66
68
  }
69
+
70
+ /**
71
+ * Override an event listener from `KeyboardMixin`
72
+ * to handle clicking anchors inside the tabs.
73
+ * @param {!KeyboardEvent} event
74
+ * @protected
75
+ * @override
76
+ */
77
+ _onKeyUp(event) {
78
+ const willClick = this.hasAttribute('active');
79
+
80
+ super._onKeyUp(event);
81
+
82
+ if (willClick) {
83
+ const anchor = this.querySelector('a');
84
+ if (anchor) {
85
+ anchor.click();
86
+ }
87
+ }
88
+ }
67
89
  }
68
90
 
69
91
  defineCustomElement(Tab);
@@ -9,8 +9,8 @@ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
9
9
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
10
10
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
11
11
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
12
+ import { tabsStyles } from './styles/vaadin-tabs-styles.js';
12
13
  import { TabsMixin } from './vaadin-tabs-mixin.js';
13
- import { tabsStyles } from './vaadin-tabs-styles.js';
14
14
 
15
15
  /**
16
16
  * `<vaadin-tabs>` is a Web Component for organizing and grouping content into sections.
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/tabs",
4
- "version": "25.0.0-alpha2",
4
+ "version": "25.0.0-alpha4",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/tabs",
4
- "version": "25.0.0-alpha2",
4
+ "version": "25.0.0-alpha4",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -1,18 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import type { Constructor } from '@open-wc/dedupe-mixin';
7
- import type { ActiveMixinClass } from '@vaadin/a11y-base/src/active-mixin.js';
8
- import type { DisabledMixinClass } from '@vaadin/a11y-base/src/disabled-mixin.js';
9
- import type { FocusMixinClass } from '@vaadin/a11y-base/src/focus-mixin.js';
10
- import type { ItemMixinClass } from '@vaadin/item/src/vaadin-item-mixin.js';
11
-
12
- export declare function TabMixin<T extends Constructor<HTMLElement>>(
13
- base: T,
14
- ): Constructor<ActiveMixinClass> &
15
- Constructor<DisabledMixinClass> &
16
- Constructor<FocusMixinClass> &
17
- Constructor<ItemMixinClass> &
18
- T;
@@ -1,40 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { ItemMixin } from '@vaadin/item/src/vaadin-item-mixin.js';
7
-
8
- /**
9
- * @polymerMixin
10
- * @mixes ItemMixin
11
- */
12
- export const TabMixin = (superClass) =>
13
- class TabMixinClass extends ItemMixin(superClass) {
14
- /** @protected */
15
- ready() {
16
- super.ready();
17
-
18
- this.setAttribute('role', 'tab');
19
- }
20
-
21
- /**
22
- * Override an event listener from `KeyboardMixin`
23
- * to handle clicking anchors inside the tabs.
24
- * @param {!KeyboardEvent} event
25
- * @protected
26
- * @override
27
- */
28
- _onKeyUp(event) {
29
- const willClick = this.hasAttribute('active');
30
-
31
- super._onKeyUp(event);
32
-
33
- if (willClick) {
34
- const anchor = this.querySelector('a');
35
- if (anchor) {
36
- anchor.click();
37
- }
38
- }
39
- }
40
- };