@vaadin/tabs 22.0.0-alpha9 → 22.0.0
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 +25 -28
- package/package.json +9 -9
- package/src/vaadin-tab.d.ts +1 -3
- package/src/vaadin-tab.js +6 -3
- package/src/vaadin-tabs.d.ts +0 -4
- package/src/vaadin-tabs.js +4 -4
- package/theme/lumo/vaadin-tab-styles.js +1 -1
- package/theme/lumo/vaadin-tabs-styles.js +1 -1
- package/theme/material/vaadin-tab-styles.js +1 -1
- package/theme/material/vaadin-tabs-styles.js +1 -1
package/README.md
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @vaadin/tabs
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
[
|
|
5
|
+
[Documentation + Live Demo ↗](https://vaadin.com/docs/latest/ds/components/tabs)
|
|
8
6
|
|
|
9
7
|
[](https://www.npmjs.com/package/@vaadin/tabs)
|
|
10
|
-
[](https://vaadin.com/directory/component/vaadinvaadin-tabs)
|
|
11
8
|
[](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/
|
|
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
|
|
23
|
+
Install the component:
|
|
27
24
|
|
|
28
25
|
```sh
|
|
29
|
-
npm i @vaadin/tabs
|
|
26
|
+
npm i @vaadin/tabs
|
|
30
27
|
```
|
|
31
28
|
|
|
32
|
-
Once installed, import
|
|
29
|
+
Once installed, import the component in your application:
|
|
33
30
|
|
|
34
31
|
```js
|
|
35
|
-
import '@vaadin/tabs
|
|
32
|
+
import '@vaadin/tabs';
|
|
36
33
|
```
|
|
37
34
|
|
|
38
|
-
##
|
|
35
|
+
## Themes
|
|
39
36
|
|
|
40
|
-
Vaadin components
|
|
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
|
|
40
|
+
To use the Material theme, import the component from the `theme/material` folder:
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
46
|
+
You can also import the Lumo version of the component explicitly:
|
|
52
47
|
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
```js
|
|
49
|
+
import '@vaadin/tabs/theme/lumo/vaadin-tabs.js';
|
|
50
|
+
```
|
|
55
51
|
|
|
56
|
-
-
|
|
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
|
-
|
|
60
|
-
|
|
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
|
|
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
|
|
3
|
+
"version": "22.0.0",
|
|
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
|
|
38
|
-
"@vaadin/item": "22.0.0
|
|
39
|
-
"@vaadin/vaadin-list-mixin": "22.0.0
|
|
40
|
-
"@vaadin/vaadin-lumo-styles": "22.0.0
|
|
41
|
-
"@vaadin/vaadin-material-styles": "22.0.0
|
|
42
|
-
"@vaadin/vaadin-themable-mixin": "22.0.0
|
|
37
|
+
"@vaadin/component-base": "^22.0.0",
|
|
38
|
+
"@vaadin/item": "^22.0.0",
|
|
39
|
+
"@vaadin/vaadin-list-mixin": "^22.0.0",
|
|
40
|
+
"@vaadin/vaadin-lumo-styles": "^22.0.0",
|
|
41
|
+
"@vaadin/vaadin-material-styles": "^22.0.0",
|
|
42
|
+
"@vaadin/vaadin-themable-mixin": "^22.0.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@esm-bundle/chai": "^4.3.4",
|
|
46
|
-
"@vaadin/testing-helpers": "^0.3.
|
|
46
|
+
"@vaadin/testing-helpers": "^0.3.2",
|
|
47
47
|
"sinon": "^9.2.1"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "b668e9b1a975227fbe34beb70d1cd5b03dce2348"
|
|
50
50
|
}
|
package/src/vaadin-tab.d.ts
CHANGED
|
@@ -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 {
|
|
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
|
-
|
|
60
|
+
_onKeyUp(event) {
|
|
58
61
|
const willClick = this.hasAttribute('active');
|
|
59
62
|
|
|
60
|
-
super.
|
|
63
|
+
super._onKeyUp(event);
|
|
61
64
|
|
|
62
65
|
if (willClick) {
|
|
63
66
|
const anchor = this.querySelector('a');
|
package/src/vaadin-tabs.d.ts
CHANGED
|
@@ -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,
|
package/src/vaadin-tabs.js
CHANGED
|
@@ -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
|
|
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',
|