@vaadin/tabs 24.8.4 → 25.0.0-alpha10
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 +0 -23
- package/package.json +13 -14
- package/src/styles/vaadin-tab-base-styles.js +91 -0
- package/src/styles/vaadin-tab-core-styles.d.ts +8 -0
- package/src/styles/vaadin-tabs-base-styles.js +104 -0
- package/src/styles/vaadin-tabs-core-styles.d.ts +8 -0
- package/src/{vaadin-tabs-styles.js → styles/vaadin-tabs-core-styles.js} +0 -2
- package/src/vaadin-tab.d.ts +3 -6
- package/src/vaadin-tab.js +42 -19
- package/src/vaadin-tabs-mixin.js +1 -0
- package/src/vaadin-tabs.d.ts +7 -7
- package/src/vaadin-tabs.js +25 -20
- package/theme/lumo/vaadin-tabs-styles.js +0 -1
- package/web-types.json +3 -3
- package/web-types.lit.json +3 -3
- package/src/vaadin-lit-tab.js +0 -57
- package/src/vaadin-lit-tabs.js +0 -54
- package/src/vaadin-tab-mixin.d.ts +0 -18
- package/src/vaadin-tab-mixin.js +0 -40
- package/theme/lumo/vaadin-lit-tab.d.ts +0 -2
- package/theme/lumo/vaadin-lit-tab.js +0 -2
- package/theme/lumo/vaadin-lit-tabs.d.ts +0 -3
- package/theme/lumo/vaadin-lit-tabs.js +0 -3
- package/theme/material/vaadin-lit-tab.d.ts +0 -2
- package/theme/material/vaadin-lit-tab.js +0 -2
- package/theme/material/vaadin-lit-tabs.d.ts +0 -3
- package/theme/material/vaadin-lit-tabs.js +0 -3
- package/theme/material/vaadin-tab-styles.d.ts +0 -2
- package/theme/material/vaadin-tab-styles.js +0 -141
- package/theme/material/vaadin-tab.d.ts +0 -2
- package/theme/material/vaadin-tab.js +0 -2
- package/theme/material/vaadin-tabs-styles.d.ts +0 -2
- package/theme/material/vaadin-tabs-styles.js +0 -88
- package/theme/material/vaadin-tabs.d.ts +0 -3
- package/theme/material/vaadin-tabs.js +0 -3
- package/vaadin-lit-tab.d.ts +0 -1
- package/vaadin-lit-tab.js +0 -2
- package/vaadin-lit-tabs.d.ts +0 -1
- package/vaadin-lit-tabs.js +0 -2
- /package/src/{vaadin-tab-styles.d.ts → styles/vaadin-tab-base-styles.d.ts} +0 -0
- /package/src/{vaadin-tab-styles.js → styles/vaadin-tab-core-styles.js} +0 -0
- /package/src/{vaadin-tabs-styles.d.ts → styles/vaadin-tabs-base-styles.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -31,29 +31,6 @@ Once installed, import the component in your application:
|
|
|
31
31
|
import '@vaadin/tabs';
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
## Themes
|
|
35
|
-
|
|
36
|
-
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
|
|
37
|
-
The [main entrypoint](https://github.com/vaadin/web-components/blob/main/packages/tabs/vaadin-tabs.js) of the package uses the Lumo theme.
|
|
38
|
-
|
|
39
|
-
To use the Material theme, import the component from the `theme/material` folder:
|
|
40
|
-
|
|
41
|
-
```js
|
|
42
|
-
import '@vaadin/tabs/theme/material/vaadin-tabs.js';
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
You can also import the Lumo version of the component explicitly:
|
|
46
|
-
|
|
47
|
-
```js
|
|
48
|
-
import '@vaadin/tabs/theme/lumo/vaadin-tabs.js';
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
|
|
52
|
-
|
|
53
|
-
```js
|
|
54
|
-
import '@vaadin/tabs/src/vaadin-tabs.js';
|
|
55
|
-
```
|
|
56
|
-
|
|
57
34
|
## Contributing
|
|
58
35
|
|
|
59
36
|
Read the [contributing guide](https://vaadin.com/docs/latest/contributing) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/tabs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.0.0-alpha10",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"files": [
|
|
23
23
|
"src",
|
|
24
|
+
"!src/styles/*-base-styles.d.ts",
|
|
25
|
+
"!src/styles/*-base-styles.js",
|
|
24
26
|
"theme",
|
|
25
27
|
"vaadin-*.d.ts",
|
|
26
28
|
"vaadin-*.js",
|
|
@@ -31,29 +33,26 @@
|
|
|
31
33
|
"Vaadin",
|
|
32
34
|
"vaadin-tabs",
|
|
33
35
|
"web-components",
|
|
34
|
-
"web-component"
|
|
35
|
-
"polymer"
|
|
36
|
+
"web-component"
|
|
36
37
|
],
|
|
37
38
|
"dependencies": {
|
|
38
39
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
39
|
-
"@
|
|
40
|
-
"@vaadin/
|
|
41
|
-
"@vaadin/
|
|
42
|
-
"@vaadin/
|
|
43
|
-
"@vaadin/vaadin-
|
|
44
|
-
"@vaadin/vaadin-material-styles": "~24.8.4",
|
|
45
|
-
"@vaadin/vaadin-themable-mixin": "~24.8.4",
|
|
40
|
+
"@vaadin/a11y-base": "25.0.0-alpha10",
|
|
41
|
+
"@vaadin/component-base": "25.0.0-alpha10",
|
|
42
|
+
"@vaadin/item": "25.0.0-alpha10",
|
|
43
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha10",
|
|
44
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha10",
|
|
46
45
|
"lit": "^3.0.0"
|
|
47
46
|
},
|
|
48
47
|
"devDependencies": {
|
|
49
|
-
"@vaadin/chai-plugins": "
|
|
50
|
-
"@vaadin/test-runner-commands": "
|
|
51
|
-
"@vaadin/testing-helpers": "^
|
|
48
|
+
"@vaadin/chai-plugins": "25.0.0-alpha10",
|
|
49
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha10",
|
|
50
|
+
"@vaadin/testing-helpers": "^2.0.0",
|
|
52
51
|
"sinon": "^18.0.0"
|
|
53
52
|
},
|
|
54
53
|
"web-types": [
|
|
55
54
|
"web-types.json",
|
|
56
55
|
"web-types.lit.json"
|
|
57
56
|
],
|
|
58
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "6cc6c94079e805fa5b2f0af4dbf3b2a7485e57d0"
|
|
59
58
|
}
|
|
@@ -0,0 +1,91 @@
|
|
|
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 '@vaadin/component-base/src/style-props.js';
|
|
7
|
+
import { css } from 'lit';
|
|
8
|
+
|
|
9
|
+
export const tabStyles = css`
|
|
10
|
+
:host {
|
|
11
|
+
flex-shrink: 0;
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
gap: var(--vaadin-tab-gap, var(--vaadin-gap-container-inline));
|
|
16
|
+
padding: var(--vaadin-tab-padding, var(--vaadin-padding-container));
|
|
17
|
+
cursor: var(--vaadin-clickable-cursor);
|
|
18
|
+
font-size: var(--vaadin-tab-font-size, 1em);
|
|
19
|
+
font-weight: var(--vaadin-tab-font-weight, 500);
|
|
20
|
+
line-height: var(--vaadin-tab-line-height, inherit);
|
|
21
|
+
color: var(--vaadin-tab-color, var(--vaadin-color-subtle));
|
|
22
|
+
background: var(--vaadin-tab-background, transparent);
|
|
23
|
+
border-radius: var(--vaadin-tab-border-radius, var(--vaadin-radius-m));
|
|
24
|
+
-webkit-tap-highlight-color: transparent;
|
|
25
|
+
-webkit-user-select: none;
|
|
26
|
+
user-select: none;
|
|
27
|
+
touch-action: manipulation;
|
|
28
|
+
position: relative;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:host([hidden]) {
|
|
32
|
+
display: none !important;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host([orientation='vertical']) {
|
|
36
|
+
justify-content: start;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:host([selected]) {
|
|
40
|
+
--vaadin-tab-background: var(--vaadin-background-container);
|
|
41
|
+
--vaadin-tab-color: var(--vaadin-color);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
:host([disabled]) {
|
|
45
|
+
cursor: var(--vaadin-disabled-cursor);
|
|
46
|
+
opacity: 0.5;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:host(:is([focus-ring], :focus-visible)) {
|
|
50
|
+
outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
|
|
51
|
+
outline-offset: calc(var(--vaadin-focus-ring-width) * -1);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
slot {
|
|
55
|
+
gap: inherit;
|
|
56
|
+
align-items: inherit;
|
|
57
|
+
justify-content: inherit;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
::slotted(a) {
|
|
61
|
+
color: inherit;
|
|
62
|
+
cursor: inherit;
|
|
63
|
+
text-decoration: inherit;
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: inherit;
|
|
66
|
+
justify-content: inherit;
|
|
67
|
+
gap: inherit;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
::slotted(a)::before {
|
|
71
|
+
content: '';
|
|
72
|
+
position: absolute;
|
|
73
|
+
inset: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@media (forced-colors: active) {
|
|
77
|
+
:host {
|
|
78
|
+
border: 1px solid Canvas;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:host([selected]) {
|
|
82
|
+
color: Highlight;
|
|
83
|
+
border-color: Highlight;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
:host([disabled]) {
|
|
87
|
+
color: GrayText;
|
|
88
|
+
opacity: 1;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
`;
|
|
@@ -0,0 +1,104 @@
|
|
|
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 '@vaadin/component-base/src/style-props.js';
|
|
7
|
+
import { css } from 'lit';
|
|
8
|
+
|
|
9
|
+
export const tabsStyles = css`
|
|
10
|
+
:host {
|
|
11
|
+
display: flex;
|
|
12
|
+
max-width: 100%;
|
|
13
|
+
max-height: 100%;
|
|
14
|
+
position: relative;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:host([hidden]) {
|
|
18
|
+
display: none !important;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:host([orientation='vertical']) {
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
[part='tabs'] {
|
|
26
|
+
flex: 1;
|
|
27
|
+
overflow: auto;
|
|
28
|
+
overscroll-behavior: contain;
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
gap: var(--vaadin-tabs-gap, var(--vaadin-gap-container-inline));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host([orientation='horizontal']) [part='tabs'] {
|
|
35
|
+
flex-direction: row;
|
|
36
|
+
scrollbar-width: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* scrollbar-width is supported in Safari 18.2, use the following for earlier */
|
|
40
|
+
:host([orientation='horizontal']) [part='tabs']::-webkit-scrollbar {
|
|
41
|
+
display: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
[part$='button'] {
|
|
45
|
+
position: absolute;
|
|
46
|
+
z-index: 1;
|
|
47
|
+
pointer-events: none;
|
|
48
|
+
opacity: 0;
|
|
49
|
+
cursor: var(--vaadin-clickable-cursor);
|
|
50
|
+
box-sizing: border-box;
|
|
51
|
+
height: 100%;
|
|
52
|
+
padding: var(--vaadin-tab-padding, var(--vaadin-padding-container));
|
|
53
|
+
background: var(--vaadin-background-color);
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
-webkit-tap-highlight-color: transparent;
|
|
58
|
+
touch-action: manipulation;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
[part='forward-button'] {
|
|
62
|
+
inset-inline-end: 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:host([overflow~='start']) [part='back-button'],
|
|
66
|
+
:host([overflow~='end']) [part='forward-button'] {
|
|
67
|
+
pointer-events: auto;
|
|
68
|
+
opacity: 1;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
[part$='button']::before {
|
|
72
|
+
content: '';
|
|
73
|
+
display: block;
|
|
74
|
+
width: var(--vaadin-icon-size, 1lh);
|
|
75
|
+
height: var(--vaadin-icon-size, 1lh);
|
|
76
|
+
background: currentColor;
|
|
77
|
+
mask-image: var(--_vaadin-icon-chevron-down);
|
|
78
|
+
rotate: 90deg;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
[part='forward-button']::before {
|
|
82
|
+
rotate: -90deg;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:host(:is([orientation='vertical'], [theme~='hide-scroll-buttons'])) [part$='button'] {
|
|
86
|
+
display: none;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@media (pointer: coarse) {
|
|
90
|
+
:host(:not([theme~='show-scroll-buttons'])) [part$='button'] {
|
|
91
|
+
display: none;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
:host([dir='rtl']) [part$='button']::before {
|
|
96
|
+
scale: 1 -1;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@media (forced-colors: active) {
|
|
100
|
+
[part$='button']::before {
|
|
101
|
+
background: CanvasText;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
`;
|
|
@@ -24,7 +24,6 @@ export const tabsStyles = css`
|
|
|
24
24
|
display: flex;
|
|
25
25
|
align-self: stretch;
|
|
26
26
|
overflow-x: auto;
|
|
27
|
-
-webkit-overflow-scrolling: touch;
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
/* This seems more future-proof than \`overflow: -moz-scrollbars-none\` which is marked obsolete
|
|
@@ -43,7 +42,6 @@ export const tabsStyles = css`
|
|
|
43
42
|
:host([orientation='vertical']) [part='tabs'] {
|
|
44
43
|
height: 100%;
|
|
45
44
|
overflow-y: auto;
|
|
46
|
-
-webkit-overflow-scrolling: touch;
|
|
47
45
|
}
|
|
48
46
|
|
|
49
47
|
[part='back-button'],
|
package/src/vaadin-tab.d.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* Copyright (c) 2017 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
|
7
6
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
8
7
|
import { ItemMixin } from '@vaadin/item/src/vaadin-item-mixin.js';
|
|
9
8
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
@@ -11,10 +10,8 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
11
10
|
/**
|
|
12
11
|
* `<vaadin-tab>` is a Web Component providing an accessible and customizable tab.
|
|
13
12
|
*
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* Tab 1
|
|
17
|
-
* </vaadin-tab>
|
|
13
|
+
* ```html
|
|
14
|
+
* <vaadin-tab>Tab 1</vaadin-tab>
|
|
18
15
|
* ```
|
|
19
16
|
*
|
|
20
17
|
* The following state attributes are available for styling:
|
|
@@ -30,7 +27,7 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
30
27
|
*
|
|
31
28
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
32
29
|
*/
|
|
33
|
-
declare class Tab extends ElementMixin(ThemableMixin(ItemMixin(
|
|
30
|
+
declare class Tab extends ElementMixin(ThemableMixin(ItemMixin(HTMLElement))) {}
|
|
34
31
|
|
|
35
32
|
declare global {
|
|
36
33
|
interface HTMLElementTagNameMap {
|
package/src/vaadin-tab.js
CHANGED
|
@@ -3,24 +3,21 @@
|
|
|
3
3
|
* Copyright (c) 2017 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import { html,
|
|
7
|
-
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
|
6
|
+
import { html, LitElement } from 'lit';
|
|
8
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
8
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
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 {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
registerStyles('vaadin-tab', tabStyles, { moduleId: 'vaadin-tab-styles' });
|
|
11
|
+
import { ItemMixin } from '@vaadin/item/src/vaadin-item-mixin.js';
|
|
12
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
13
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
14
|
+
import { tabStyles } from './styles/vaadin-tab-core-styles.js';
|
|
16
15
|
|
|
17
16
|
/**
|
|
18
17
|
* `<vaadin-tab>` is a Web Component providing an accessible and customizable tab.
|
|
19
18
|
*
|
|
20
|
-
* ```
|
|
21
|
-
*
|
|
22
|
-
* Tab 1
|
|
23
|
-
* </vaadin-tab>
|
|
19
|
+
* ```html
|
|
20
|
+
* <vaadin-tab>Tab 1</vaadin-tab>
|
|
24
21
|
* ```
|
|
25
22
|
*
|
|
26
23
|
* The following state attributes are available for styling:
|
|
@@ -38,30 +35,56 @@ registerStyles('vaadin-tab', tabStyles, { moduleId: 'vaadin-tab-styles' });
|
|
|
38
35
|
*
|
|
39
36
|
* @customElement
|
|
40
37
|
* @extends HTMLElement
|
|
41
|
-
* @mixes ControllerMixin
|
|
42
38
|
* @mixes ElementMixin
|
|
39
|
+
* @mixes ItemMixin
|
|
43
40
|
* @mixes ThemableMixin
|
|
44
|
-
* @mixes TabMixin
|
|
45
41
|
*/
|
|
46
|
-
class Tab extends
|
|
47
|
-
static get
|
|
42
|
+
class Tab extends ItemMixin(ThemableMixin(ElementMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
43
|
+
static get is() {
|
|
44
|
+
return 'vaadin-tab';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
static get styles() {
|
|
48
|
+
return tabStyles;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** @protected */
|
|
52
|
+
render() {
|
|
48
53
|
return html`
|
|
49
54
|
<slot></slot>
|
|
50
55
|
<slot name="tooltip"></slot>
|
|
51
56
|
`;
|
|
52
57
|
}
|
|
53
58
|
|
|
54
|
-
static get is() {
|
|
55
|
-
return 'vaadin-tab';
|
|
56
|
-
}
|
|
57
|
-
|
|
58
59
|
/** @protected */
|
|
59
60
|
ready() {
|
|
60
61
|
super.ready();
|
|
61
62
|
|
|
63
|
+
this.setAttribute('role', 'tab');
|
|
64
|
+
|
|
62
65
|
this._tooltipController = new TooltipController(this);
|
|
63
66
|
this.addController(this._tooltipController);
|
|
64
67
|
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Override an event listener from `KeyboardMixin`
|
|
71
|
+
* to handle clicking anchors inside the tabs.
|
|
72
|
+
* @param {!KeyboardEvent} event
|
|
73
|
+
* @protected
|
|
74
|
+
* @override
|
|
75
|
+
*/
|
|
76
|
+
_onKeyUp(event) {
|
|
77
|
+
const willClick = this.hasAttribute('active');
|
|
78
|
+
|
|
79
|
+
super._onKeyUp(event);
|
|
80
|
+
|
|
81
|
+
if (willClick) {
|
|
82
|
+
const anchor = this.querySelector('a');
|
|
83
|
+
if (anchor) {
|
|
84
|
+
anchor.click();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
65
88
|
}
|
|
66
89
|
|
|
67
90
|
defineCustomElement(Tab);
|
package/src/vaadin-tabs-mixin.js
CHANGED
package/src/vaadin-tabs.d.ts
CHANGED
|
@@ -30,13 +30,13 @@ export interface TabsEventMap extends HTMLElementEventMap, TabsCustomEventMap {}
|
|
|
30
30
|
/**
|
|
31
31
|
* `<vaadin-tabs>` is a Web Component for organizing and grouping content into sections.
|
|
32
32
|
*
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
33
|
+
* ```html
|
|
34
|
+
* <vaadin-tabs selected="4">
|
|
35
|
+
* <vaadin-tab>Page 1</vaadin-tab>
|
|
36
|
+
* <vaadin-tab>Page 2</vaadin-tab>
|
|
37
|
+
* <vaadin-tab>Page 3</vaadin-tab>
|
|
38
|
+
* <vaadin-tab>Page 4</vaadin-tab>
|
|
39
|
+
* </vaadin-tabs>
|
|
40
40
|
* ```
|
|
41
41
|
*
|
|
42
42
|
* ### Styling
|
package/src/vaadin-tabs.js
CHANGED
|
@@ -4,25 +4,25 @@
|
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import './vaadin-tab.js';
|
|
7
|
-
import { html,
|
|
7
|
+
import { html, LitElement } from 'lit';
|
|
8
8
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
9
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
10
|
-
import {
|
|
10
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
12
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
+
import { tabsStyles } from './styles/vaadin-tabs-core-styles.js';
|
|
11
14
|
import { TabsMixin } from './vaadin-tabs-mixin.js';
|
|
12
|
-
import { tabsStyles } from './vaadin-tabs-styles.js';
|
|
13
|
-
|
|
14
|
-
registerStyles('vaadin-tabs', tabsStyles, { moduleId: 'vaadin-tabs-styles' });
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* `<vaadin-tabs>` is a Web Component for organizing and grouping content into sections.
|
|
18
18
|
*
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
19
|
+
* ```html
|
|
20
|
+
* <vaadin-tabs selected="4">
|
|
21
|
+
* <vaadin-tab>Page 1</vaadin-tab>
|
|
22
|
+
* <vaadin-tab>Page 2</vaadin-tab>
|
|
23
|
+
* <vaadin-tab>Page 3</vaadin-tab>
|
|
24
|
+
* <vaadin-tab>Page 4</vaadin-tab>
|
|
25
|
+
* </vaadin-tabs>
|
|
26
26
|
* ```
|
|
27
27
|
*
|
|
28
28
|
* ### Styling
|
|
@@ -53,22 +53,27 @@ registerStyles('vaadin-tabs', tabsStyles, { moduleId: 'vaadin-tabs-styles' });
|
|
|
53
53
|
* @mixes TabsMixin
|
|
54
54
|
* @mixes ThemableMixin
|
|
55
55
|
*/
|
|
56
|
-
class Tabs extends TabsMixin(ElementMixin(ThemableMixin(
|
|
57
|
-
static get
|
|
56
|
+
class Tabs extends TabsMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
57
|
+
static get is() {
|
|
58
|
+
return 'vaadin-tabs';
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
static get styles() {
|
|
62
|
+
return tabsStyles;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** @protected */
|
|
66
|
+
render() {
|
|
58
67
|
return html`
|
|
59
|
-
<div
|
|
68
|
+
<div @click="${this._scrollBack}" part="back-button" aria-hidden="true"></div>
|
|
60
69
|
|
|
61
70
|
<div id="scroll" part="tabs">
|
|
62
71
|
<slot></slot>
|
|
63
72
|
</div>
|
|
64
73
|
|
|
65
|
-
<div
|
|
74
|
+
<div @click="${this._scrollForward}" part="forward-button" aria-hidden="true"></div>
|
|
66
75
|
`;
|
|
67
76
|
}
|
|
68
|
-
|
|
69
|
-
static get is() {
|
|
70
|
-
return 'vaadin-tabs';
|
|
71
|
-
}
|
|
72
77
|
}
|
|
73
78
|
|
|
74
79
|
defineCustomElement(Tabs);
|
package/web-types.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/tabs",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "25.0.0-alpha10",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-tab",
|
|
11
|
-
"description": "`<vaadin-tab>` is a Web Component providing an accessible and customizable tab.\n\n
|
|
11
|
+
"description": "`<vaadin-tab>` is a Web Component providing an accessible and customizable tab.\n\n```html\n<vaadin-tab>Tab 1</vaadin-tab>\n```\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n-----------|-------------|------------\n`disabled` | Set to a disabled tab | :host\n`focused` | Set when the element is focused | :host\n`focus-ring` | Set when the element is keyboard focused | :host\n`selected` | Set when the tab is selected | :host\n`active` | Set when mousedown or enter/spacebar pressed | :host\n`orientation` | Set to `horizontal` or `vertical` depending on the direction of items | :host\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "disabled",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
"name": "vaadin-tabs",
|
|
82
|
-
"description": "`<vaadin-tabs>` is a Web Component for organizing and grouping content into sections.\n\n
|
|
82
|
+
"description": "`<vaadin-tabs>` is a Web Component for organizing and grouping content into sections.\n\n```html\n<vaadin-tabs selected=\"4\">\n <vaadin-tab>Page 1</vaadin-tab>\n <vaadin-tab>Page 2</vaadin-tab>\n <vaadin-tab>Page 3</vaadin-tab>\n <vaadin-tab>Page 4</vaadin-tab>\n</vaadin-tabs>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n------------------|--------------------------------------\n`back-button` | Button for moving the scroll back\n`tabs` | The tabs container\n`forward-button` | Button for moving the scroll forward\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n-----------|-------------|------------\n`orientation` | Tabs disposition, valid values are `horizontal` and `vertical`. | :host\n`overflow` | It's set to `start`, `end`, none or both. | :host\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
83
83
|
"attributes": [
|
|
84
84
|
{
|
|
85
85
|
"name": "disabled",
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/tabs",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "25.0.0-alpha10",
|
|
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-tab",
|
|
19
|
-
"description": "`<vaadin-tab>` is a Web Component providing an accessible and customizable tab.\n\n
|
|
19
|
+
"description": "`<vaadin-tab>` is a Web Component providing an accessible and customizable tab.\n\n```html\n<vaadin-tab>Tab 1</vaadin-tab>\n```\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n-----------|-------------|------------\n`disabled` | Set to a disabled tab | :host\n`focused` | Set when the element is focused | :host\n`focus-ring` | Set when the element is keyboard focused | :host\n`selected` | Set when the tab is selected | :host\n`active` | Set when mousedown or enter/spacebar pressed | :host\n`orientation` | Set to `horizontal` or `vertical` depending on the direction of items | :host\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
"name": "vaadin-tabs",
|
|
47
|
-
"description": "`<vaadin-tabs>` is a Web Component for organizing and grouping content into sections.\n\n
|
|
47
|
+
"description": "`<vaadin-tabs>` is a Web Component for organizing and grouping content into sections.\n\n```html\n<vaadin-tabs selected=\"4\">\n <vaadin-tab>Page 1</vaadin-tab>\n <vaadin-tab>Page 2</vaadin-tab>\n <vaadin-tab>Page 3</vaadin-tab>\n <vaadin-tab>Page 4</vaadin-tab>\n</vaadin-tabs>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n------------------|--------------------------------------\n`back-button` | Button for moving the scroll back\n`tabs` | The tabs container\n`forward-button` | Button for moving the scroll forward\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n-----------|-------------|------------\n`orientation` | Tabs disposition, valid values are `horizontal` and `vertical`. | :host\n`overflow` | It's set to `start`, `end`, none or both. | :host\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
48
48
|
"extension": true,
|
|
49
49
|
"attributes": [
|
|
50
50
|
{
|
package/src/vaadin-lit-tab.js
DELETED
|
@@ -1,57 +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 { html, LitElement } from 'lit';
|
|
7
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
-
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
9
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
|
-
import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
|
|
11
|
-
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';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* LitElement based version of `<vaadin-tab>` web component.
|
|
17
|
-
*
|
|
18
|
-
* ## Disclaimer
|
|
19
|
-
*
|
|
20
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
21
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
22
|
-
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
23
|
-
*
|
|
24
|
-
* @extends HTMLElement
|
|
25
|
-
* @mixes ElementMixin
|
|
26
|
-
* @mixes TabMixin
|
|
27
|
-
* @mixes ThemableMixin
|
|
28
|
-
*/
|
|
29
|
-
class Tab extends TabMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {
|
|
30
|
-
static get is() {
|
|
31
|
-
return 'vaadin-tab';
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
static get styles() {
|
|
35
|
-
return [tabStyles];
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/** @protected */
|
|
39
|
-
render() {
|
|
40
|
-
return html`
|
|
41
|
-
<slot></slot>
|
|
42
|
-
<slot name="tooltip"></slot>
|
|
43
|
-
`;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/** @protected */
|
|
47
|
-
ready() {
|
|
48
|
-
super.ready();
|
|
49
|
-
|
|
50
|
-
this._tooltipController = new TooltipController(this);
|
|
51
|
-
this.addController(this._tooltipController);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
defineCustomElement(Tab);
|
|
56
|
-
|
|
57
|
-
export { Tab };
|
package/src/vaadin-lit-tabs.js
DELETED
|
@@ -1,54 +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 './vaadin-lit-tab.js';
|
|
7
|
-
import { html, LitElement } from 'lit';
|
|
8
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
|
-
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
10
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
|
-
import { TabsMixin } from './vaadin-tabs-mixin.js';
|
|
13
|
-
import { tabsStyles } from './vaadin-tabs-styles.js';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* LitElement based version of `<vaadin-tabs>` web component.
|
|
17
|
-
*
|
|
18
|
-
* ## Disclaimer
|
|
19
|
-
*
|
|
20
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
21
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
22
|
-
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
23
|
-
*
|
|
24
|
-
* @extends HTMLElement
|
|
25
|
-
* @mixes ElementMixin
|
|
26
|
-
* @mixes TabsMixin
|
|
27
|
-
* @mixes ThemableMixin
|
|
28
|
-
*/
|
|
29
|
-
class Tabs extends TabsMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
30
|
-
static get is() {
|
|
31
|
-
return 'vaadin-tabs';
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
static get styles() {
|
|
35
|
-
return [tabsStyles];
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/** @protected */
|
|
39
|
-
render() {
|
|
40
|
-
return html`
|
|
41
|
-
<div @click="${this._scrollBack}" part="back-button" aria-hidden="true"></div>
|
|
42
|
-
|
|
43
|
-
<div id="scroll" part="tabs">
|
|
44
|
-
<slot></slot>
|
|
45
|
-
</div>
|
|
46
|
-
|
|
47
|
-
<div @click="${this._scrollForward}" part="forward-button" aria-hidden="true"></div>
|
|
48
|
-
`;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
defineCustomElement(Tabs);
|
|
53
|
-
|
|
54
|
-
export { Tabs };
|
|
@@ -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;
|
package/src/vaadin-tab-mixin.js
DELETED
|
@@ -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
|
-
};
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-material-styles/color.js';
|
|
2
|
-
import '@vaadin/vaadin-material-styles/typography.js';
|
|
3
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
4
|
-
|
|
5
|
-
registerStyles(
|
|
6
|
-
'vaadin-tab',
|
|
7
|
-
css`
|
|
8
|
-
:host {
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
flex-shrink: 0;
|
|
12
|
-
flex-grow: 1;
|
|
13
|
-
align-items: center;
|
|
14
|
-
justify-content: center;
|
|
15
|
-
text-align: center;
|
|
16
|
-
min-width: 90px;
|
|
17
|
-
padding: 12px 16px;
|
|
18
|
-
box-sizing: border-box;
|
|
19
|
-
font-family: var(--material-font-family);
|
|
20
|
-
font-size: var(--material-button-font-size);
|
|
21
|
-
text-transform: uppercase;
|
|
22
|
-
letter-spacing: 0.05em;
|
|
23
|
-
white-space: nowrap;
|
|
24
|
-
min-height: 48px;
|
|
25
|
-
line-height: 1.2;
|
|
26
|
-
font-weight: 500;
|
|
27
|
-
color: var(--material-secondary-text-color);
|
|
28
|
-
overflow: hidden;
|
|
29
|
-
position: relative;
|
|
30
|
-
cursor: pointer;
|
|
31
|
-
outline: none;
|
|
32
|
-
-webkit-font-smoothing: antialiased;
|
|
33
|
-
-moz-osx-font-smoothing: grayscale;
|
|
34
|
-
transition: box-shadow 0.3s;
|
|
35
|
-
-webkit-user-select: none;
|
|
36
|
-
user-select: none;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/* do not prevent click on slotted links */
|
|
40
|
-
:host::before,
|
|
41
|
-
:host::after {
|
|
42
|
-
pointer-events: none;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
:host::before {
|
|
46
|
-
content: '';
|
|
47
|
-
position: absolute;
|
|
48
|
-
inset: 0;
|
|
49
|
-
background-color: var(--material-primary-color);
|
|
50
|
-
opacity: 0;
|
|
51
|
-
transition: opacity 0.1s linear;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
:host(:hover)::before {
|
|
55
|
-
opacity: 0.04;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
:host([focus-ring])::before {
|
|
59
|
-
opacity: 0.1;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
:host([selected]) {
|
|
63
|
-
color: var(--material-primary-text-color);
|
|
64
|
-
box-shadow: inset 0 -2px 0 0 var(--material-primary-color);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
:host([orientation='vertical'][selected]) {
|
|
68
|
-
box-shadow: inset 2px 0 0 0 var(--material-primary-color);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/* Ripple */
|
|
72
|
-
|
|
73
|
-
:host::after {
|
|
74
|
-
content: '';
|
|
75
|
-
position: absolute;
|
|
76
|
-
top: 50%;
|
|
77
|
-
left: 50%;
|
|
78
|
-
width: 100px;
|
|
79
|
-
height: 100px;
|
|
80
|
-
border-radius: 50%;
|
|
81
|
-
transform: translate(-50%, -50%) scale(0);
|
|
82
|
-
background-color: var(--material-primary-color);
|
|
83
|
-
opacity: 0;
|
|
84
|
-
transition:
|
|
85
|
-
transform 0s cubic-bezier(0.05, 0.8, 0.5, 1),
|
|
86
|
-
opacity 0s linear;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
:host([focused]:not([focus-ring]))::after,
|
|
90
|
-
:host([focused][active])::after,
|
|
91
|
-
:host([focus-ring][selected])::after {
|
|
92
|
-
transform: translate(-50%, -50%) scale(3);
|
|
93
|
-
opacity: 0;
|
|
94
|
-
transition-duration: 2s, 0.6s;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
:host([active]:not([selected]))::after {
|
|
98
|
-
opacity: 0.2;
|
|
99
|
-
transition-duration: 2s, 0s;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/* Disabled */
|
|
103
|
-
:host([disabled]) {
|
|
104
|
-
pointer-events: none;
|
|
105
|
-
opacity: 1;
|
|
106
|
-
color: var(--material-disabled-text-color);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
:host ::slotted(a) {
|
|
110
|
-
display: flex;
|
|
111
|
-
align-items: center;
|
|
112
|
-
justify-content: center;
|
|
113
|
-
width: 100%;
|
|
114
|
-
height: 100%;
|
|
115
|
-
margin: -12px -16px;
|
|
116
|
-
padding: 12px 16px;
|
|
117
|
-
text-decoration: none;
|
|
118
|
-
color: inherit;
|
|
119
|
-
outline: none;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/* Touch device adjustments */
|
|
123
|
-
@media (pointer: coarse) {
|
|
124
|
-
:host(:hover)::before {
|
|
125
|
-
display: none;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/* Small space between icon and label */
|
|
130
|
-
::slotted(vaadin-icon:not(:only-child)) {
|
|
131
|
-
margin-bottom: 8px;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/* RTL specific styles */
|
|
135
|
-
|
|
136
|
-
:host([dir='rtl'][orientation='vertical'][selected]) {
|
|
137
|
-
box-shadow: inset -2px 0 0 0 var(--material-primary-color);
|
|
138
|
-
}
|
|
139
|
-
`,
|
|
140
|
-
{ moduleId: 'material-tab' },
|
|
141
|
-
);
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-material-styles/font-icons.js';
|
|
2
|
-
import '@vaadin/vaadin-material-styles/color.js';
|
|
3
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
4
|
-
|
|
5
|
-
registerStyles(
|
|
6
|
-
'vaadin-tabs',
|
|
7
|
-
css`
|
|
8
|
-
:host {
|
|
9
|
-
-webkit-tap-highlight-color: transparent;
|
|
10
|
-
display: flex;
|
|
11
|
-
flex-shrink: 0;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/* Hide scroll buttons when no needed, and on touch devices */
|
|
15
|
-
|
|
16
|
-
:host(:not([overflow])) [part='forward-button'],
|
|
17
|
-
:host(:not([overflow])) [part='back-button'] {
|
|
18
|
-
display: none;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
@media (pointer: coarse) {
|
|
22
|
-
[part='back-button'],
|
|
23
|
-
[part='forward-button'] {
|
|
24
|
-
display: none !important;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
[part='forward-button'],
|
|
29
|
-
[part='back-button'] {
|
|
30
|
-
font-family: material-icons;
|
|
31
|
-
color: var(--material-secondary-text-color);
|
|
32
|
-
font-size: 24px;
|
|
33
|
-
display: flex;
|
|
34
|
-
flex-shrink: 0;
|
|
35
|
-
flex-grow: 0;
|
|
36
|
-
align-items: center;
|
|
37
|
-
justify-content: center;
|
|
38
|
-
width: 48px;
|
|
39
|
-
height: 100%;
|
|
40
|
-
transition: 0.2s opacity;
|
|
41
|
-
top: 0;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
[part='forward-button']:hover,
|
|
45
|
-
[part='back-button']:hover {
|
|
46
|
-
color: inherit;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
:host(:not([dir='rtl'])) [part='forward-button'] {
|
|
50
|
-
right: 0;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
[part='forward-button']::after {
|
|
54
|
-
content: var(--material-icons-chevron-right);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
[part='back-button']::after {
|
|
58
|
-
content: var(--material-icons-chevron-left);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
:host([overflow]) [part='tabs']::after {
|
|
62
|
-
content: '';
|
|
63
|
-
display: flex;
|
|
64
|
-
flex-shrink: 0;
|
|
65
|
-
width: 32px;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/* Fixed width tabs */
|
|
69
|
-
:host([theme~='fixed']) [part='tabs'] ::slotted(vaadin-tab) {
|
|
70
|
-
flex-basis: 0.0001px;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/* RTL specific styles */
|
|
74
|
-
|
|
75
|
-
:host([dir='rtl']) [part='forward-button'] {
|
|
76
|
-
left: 0;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
:host([dir='rtl']) [part='forward-button']::after {
|
|
80
|
-
content: var(--material-icons-chevron-left);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
:host([dir='rtl']) [part='back-button']::after {
|
|
84
|
-
content: var(--material-icons-chevron-right);
|
|
85
|
-
}
|
|
86
|
-
`,
|
|
87
|
-
{ moduleId: 'material-tabs' },
|
|
88
|
-
);
|
package/vaadin-lit-tab.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/vaadin-tab.js';
|
package/vaadin-lit-tab.js
DELETED
package/vaadin-lit-tabs.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/vaadin-tabs.js';
|
package/vaadin-lit-tabs.js
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|