@vaadin/tabs 22.0.0-beta1 → 22.0.1

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/README.md CHANGED
@@ -1,13 +1,10 @@
1
- # <vaadin-tabs>
1
+ # @vaadin/tabs
2
2
 
3
- [Live Demo ↗](https://vaadin.com/components/vaadin-tabs/html-examples)
4
- |
5
- [API documentation ↗](https://vaadin.com/components/vaadin-tabs/html-api)
3
+ A web component for organizing and grouping content into sections.
6
4
 
7
- [<vaadin-tabs>](https://vaadin.com/components/vaadin-tabs) is a Web Component providing item navigation part of the [Vaadin components](https://vaadin.com/components). It is designed for menu and tab components.
5
+ [Documentation + Live Demo ](https://vaadin.com/docs/latest/ds/components/tabs)
8
6
 
9
7
  [![npm version](https://badgen.net/npm/v/@vaadin/tabs)](https://www.npmjs.com/package/@vaadin/tabs)
10
- [![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/vaadinvaadin-tabs)
11
8
  [![Discord](https://img.shields.io/discord/732335336448852018?label=discord)](https://discord.gg/PHmkCKC)
12
9
 
13
10
  ```html
@@ -19,45 +16,44 @@
19
16
  </vaadin-tabs>
20
17
  ```
21
18
 
22
- [<img src="https://raw.githubusercontent.com/vaadin/vaadin-tabs/master/screenshot.png" width="355" alt="Screenshot of vaadin-tabs, using the default Lumo theme">](https://vaadin.com/components/vaadin-tabs)
19
+ [<img src="https://raw.githubusercontent.com/vaadin/web-components/master/packages/tabs/screenshot.png" width="355" alt="Screenshot of vaadin-tabs">](https://vaadin.com/docs/latest/ds/components/tabs)
23
20
 
24
21
  ## Installation
25
22
 
26
- Install `vaadin-tabs`:
23
+ Install the component:
27
24
 
28
25
  ```sh
29
- npm i @vaadin/tabs --save
26
+ npm i @vaadin/tabs
30
27
  ```
31
28
 
32
- Once installed, import it in your application:
29
+ Once installed, import the component in your application:
33
30
 
34
31
  ```js
35
- import '@vaadin/tabs/vaadin-tabs.js';
32
+ import '@vaadin/tabs';
36
33
  ```
37
34
 
38
- ## Getting started
35
+ ## Themes
39
36
 
40
- Vaadin components use the Lumo theme by default.
37
+ Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/ds/customization/using-themes), Lumo and Material.
38
+ The [main entrypoint](https://github.com/vaadin/web-components/blob/master/packages/tabs/vaadin-tabs.js) of the package uses the Lumo theme.
41
39
 
42
- To use the Material theme, import the correspondent file from the `theme/material` folder.
40
+ To use the Material theme, import the component from the `theme/material` folder:
43
41
 
44
- ## Entry points
45
-
46
- - The components with the Lumo theme:
47
-
48
- `theme/lumo/vaadin-tab.js`
49
- `theme/lumo/vaadin-tabs.js`
42
+ ```js
43
+ import '@vaadin/tabs/theme/material/vaadin-tabs.js';
44
+ ```
50
45
 
51
- - The components with the Material theme:
46
+ You can also import the Lumo version of the component explicitly:
52
47
 
53
- `theme/material/vaadin-tab.js`
54
- `theme/material/vaadin-tabs.js`
48
+ ```js
49
+ import '@vaadin/tabs/theme/lumo/vaadin-tabs.js';
50
+ ```
55
51
 
56
- - Alias for `theme/lumo/vaadin-tab.js`
57
- `theme/lumo/vaadin-tabs.js`:
52
+ Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
58
53
 
59
- `vaadin-tab.js`
60
- `vaadin-tabs.js`
54
+ ```js
55
+ import '@vaadin/tabs/src/vaadin-tabs.js';
56
+ ```
61
57
 
62
58
  ## Contributing
63
59
 
@@ -67,4 +63,5 @@ Read the [contributing guide](https://vaadin.com/docs/latest/guide/contributing/
67
63
 
68
64
  Apache License 2.0
69
65
 
70
- Vaadin collects development time usage statistics to improve this product. For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics.
66
+ Vaadin collects usage statistics at development time to improve this product.
67
+ For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/tabs",
3
- "version": "22.0.0-beta1",
3
+ "version": "22.0.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -34,17 +34,17 @@
34
34
  "dependencies": {
35
35
  "@polymer/iron-resizable-behavior": "^3.0.0",
36
36
  "@polymer/polymer": "^3.0.0",
37
- "@vaadin/component-base": "22.0.0-beta1",
38
- "@vaadin/item": "22.0.0-beta1",
39
- "@vaadin/vaadin-list-mixin": "22.0.0-beta1",
40
- "@vaadin/vaadin-lumo-styles": "22.0.0-beta1",
41
- "@vaadin/vaadin-material-styles": "22.0.0-beta1",
42
- "@vaadin/vaadin-themable-mixin": "22.0.0-beta1"
37
+ "@vaadin/component-base": "^22.0.1",
38
+ "@vaadin/item": "^22.0.1",
39
+ "@vaadin/vaadin-list-mixin": "^22.0.1",
40
+ "@vaadin/vaadin-lumo-styles": "^22.0.1",
41
+ "@vaadin/vaadin-material-styles": "^22.0.1",
42
+ "@vaadin/vaadin-themable-mixin": "^22.0.1"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@esm-bundle/chai": "^4.3.4",
46
- "@vaadin/testing-helpers": "^0.3.0",
46
+ "@vaadin/testing-helpers": "^0.3.2",
47
47
  "sinon": "^9.2.1"
48
48
  },
49
- "gitHead": "4cf8a9d0504994200c610e44b3676114fef49c1e"
49
+ "gitHead": "2b0a2bff0369d6020f7cc33ad35506aa2d1f6f68"
50
50
  }
@@ -29,9 +29,7 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
29
29
  *
30
30
  * See [Styling Components](https://vaadin.com/docs/latest/ds/customization/styling-components) documentation.
31
31
  */
32
- declare class Tab extends ElementMixin(ThemableMixin(ItemMixin(HTMLElement))) {
33
- _onKeyup(event: KeyboardEvent): void;
34
- }
32
+ declare class Tab extends ElementMixin(ThemableMixin(ItemMixin(HTMLElement))) {}
35
33
 
36
34
  declare global {
37
35
  interface HTMLElementTagNameMap {
package/src/vaadin-tab.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2021 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
6
+ import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
7
7
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
8
8
  import { ItemMixin } from '@vaadin/item/src/vaadin-item-mixin.js';
9
9
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
@@ -51,13 +51,16 @@ class Tab extends ElementMixin(ThemableMixin(ItemMixin(PolymerElement))) {
51
51
  }
52
52
 
53
53
  /**
54
+ * Override an event listener from `KeyboardMixin`
55
+ * to handle clicking anchors inside the tabs.
54
56
  * @param {!KeyboardEvent} event
55
57
  * @protected
58
+ * @override
56
59
  */
57
- _onKeyup(event) {
60
+ _onKeyUp(event) {
58
61
  const willClick = this.hasAttribute('active');
59
62
 
60
- super._onKeyup(event);
63
+ super._onKeyUp(event);
61
64
 
62
65
  if (willClick) {
63
66
  const anchor = this.querySelector('a');
@@ -62,8 +62,6 @@ export interface TabsEventMap extends HTMLElementEventMap, TabsCustomEventMap {}
62
62
  * @fires {CustomEvent} selected-changed - Fired when the `selected` property changes.
63
63
  */
64
64
  declare class Tabs extends ElementMixin(ListMixin(ThemableMixin(HTMLElement))) {
65
- readonly _scrollerElement: HTMLElement;
66
-
67
65
  /**
68
66
  * The index of the selected tab.
69
67
  */
@@ -74,8 +72,6 @@ declare class Tabs extends ElementMixin(ListMixin(ThemableMixin(HTMLElement))) {
74
72
  */
75
73
  orientation: TabsOrientation;
76
74
 
77
- readonly _scrollOffset: number;
78
-
79
75
  addEventListener<K extends keyof TabsEventMap>(
80
76
  type: K,
81
77
  listener: (this: Tabs, ev: TabsEventMap[K]) => void,
@@ -3,14 +3,14 @@
3
3
  * Copyright (c) 2021 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
7
- import { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';
8
- import { mixinBehaviors } from '@polymer/polymer/lib/legacy/class.js';
6
+ import './vaadin-tab.js';
9
7
  import { IronResizableBehavior } from '@polymer/iron-resizable-behavior/iron-resizable-behavior.js';
8
+ import { mixinBehaviors } from '@polymer/polymer/lib/legacy/class.js';
9
+ import { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';
10
+ import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
10
11
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
11
12
  import { ListMixin } from '@vaadin/vaadin-list-mixin/vaadin-list-mixin.js';
12
13
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
13
- import './vaadin-tab.js';
14
14
 
15
15
  /**
16
16
  * `<vaadin-tabs>` is a Web Component for easy switching between different views.
@@ -1,8 +1,8 @@
1
- import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
2
1
  import '@vaadin/vaadin-lumo-styles/color.js';
3
2
  import '@vaadin/vaadin-lumo-styles/sizing.js';
4
3
  import '@vaadin/vaadin-lumo-styles/style.js';
5
4
  import '@vaadin/vaadin-lumo-styles/typography.js';
5
+ import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
6
6
 
7
7
  registerStyles(
8
8
  'vaadin-tab',
@@ -1,10 +1,10 @@
1
- import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
2
1
  import '@vaadin/vaadin-lumo-styles/font-icons.js';
3
2
  import '@vaadin/vaadin-lumo-styles/color.js';
4
3
  import '@vaadin/vaadin-lumo-styles/sizing.js';
5
4
  import '@vaadin/vaadin-lumo-styles/spacing.js';
6
5
  import '@vaadin/vaadin-lumo-styles/style.js';
7
6
  import '@vaadin/vaadin-lumo-styles/typography.js';
7
+ import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
8
8
 
9
9
  registerStyles(
10
10
  'vaadin-tabs',
@@ -1,6 +1,6 @@
1
- import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
2
1
  import '@vaadin/vaadin-material-styles/color.js';
3
2
  import '@vaadin/vaadin-material-styles/typography.js';
3
+ import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
4
4
 
5
5
  registerStyles(
6
6
  'vaadin-tab',
@@ -1,6 +1,6 @@
1
- import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
2
1
  import '@vaadin/vaadin-material-styles/font-icons.js';
3
2
  import '@vaadin/vaadin-material-styles/color.js';
3
+ import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
4
4
 
5
5
  registerStyles(
6
6
  'vaadin-tabs',