@vaadin/tabsheet 25.0.0-alpha1 → 25.0.0-alpha11
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 +10 -11
- package/src/styles/vaadin-tabsheet-base-styles.d.ts +8 -0
- package/src/styles/vaadin-tabsheet-base-styles.js +75 -0
- package/src/vaadin-tabsheet.d.ts +13 -13
- package/src/vaadin-tabsheet.js +18 -43
- package/vaadin-tabsheet.js +1 -1
- package/web-types.json +2 -2
- package/web-types.lit.json +2 -2
- package/theme/lumo/vaadin-tabsheet-styles.d.ts +0 -5
- package/theme/lumo/vaadin-tabsheet-styles.js +0 -49
- package/theme/lumo/vaadin-tabsheet.d.ts +0 -4
- package/theme/lumo/vaadin-tabsheet.js +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/tabsheet",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-alpha11",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"files": [
|
|
23
23
|
"src",
|
|
24
|
-
"theme",
|
|
25
24
|
"vaadin-*.d.ts",
|
|
26
25
|
"vaadin-*.js",
|
|
27
26
|
"web-types.json",
|
|
@@ -35,22 +34,22 @@
|
|
|
35
34
|
],
|
|
36
35
|
"dependencies": {
|
|
37
36
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
|
-
"@vaadin/component-base": "25.0.0-
|
|
39
|
-
"@vaadin/scroller": "25.0.0-
|
|
40
|
-
"@vaadin/tabs": "25.0.0-
|
|
41
|
-
"@vaadin/vaadin-
|
|
42
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha1",
|
|
37
|
+
"@vaadin/component-base": "25.0.0-alpha11",
|
|
38
|
+
"@vaadin/scroller": "25.0.0-alpha11",
|
|
39
|
+
"@vaadin/tabs": "25.0.0-alpha11",
|
|
40
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha11",
|
|
43
41
|
"lit": "^3.0.0"
|
|
44
42
|
},
|
|
45
43
|
"devDependencies": {
|
|
46
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
47
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
48
|
-
"@vaadin/testing-helpers": "^
|
|
44
|
+
"@vaadin/chai-plugins": "25.0.0-alpha11",
|
|
45
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha11",
|
|
46
|
+
"@vaadin/testing-helpers": "^2.0.0",
|
|
47
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha11",
|
|
49
48
|
"sinon": "^18.0.0"
|
|
50
49
|
},
|
|
51
50
|
"web-types": [
|
|
52
51
|
"web-types.json",
|
|
53
52
|
"web-types.lit.json"
|
|
54
53
|
],
|
|
55
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "abfd315ba5a7484a613e0768635a4e8fe945a44b"
|
|
56
55
|
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2022 - 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/styles/style-props.js';
|
|
7
|
+
import { css } from 'lit';
|
|
8
|
+
import { loaderStyles } from '@vaadin/component-base/src/styles/loader-styles.js';
|
|
9
|
+
|
|
10
|
+
export const tabSheetStyles = [
|
|
11
|
+
loaderStyles,
|
|
12
|
+
css`
|
|
13
|
+
:host {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
border: var(--vaadin-tabsheet-border-width, 1px) solid
|
|
17
|
+
var(--vaadin-tabsheet-border-color, var(--vaadin-border-color));
|
|
18
|
+
border-radius: var(--vaadin-tabsheet-border-radius, var(--vaadin-radius-l));
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host([hidden]) {
|
|
23
|
+
display: none !important;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
[part='tabs-container'] {
|
|
27
|
+
position: relative;
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
gap: var(--vaadin-tabsheet-gap, var(--vaadin-gap-container-inline));
|
|
31
|
+
padding: var(--vaadin-tabsheet-padding, var(--vaadin-padding));
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
::slotted([slot='tabs']) {
|
|
36
|
+
flex: 1;
|
|
37
|
+
align-self: stretch;
|
|
38
|
+
min-width: 128px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
[part='content'] {
|
|
42
|
+
position: relative;
|
|
43
|
+
flex: 1;
|
|
44
|
+
box-sizing: border-box;
|
|
45
|
+
padding: var(--vaadin-tabsheet-padding, var(--vaadin-padding));
|
|
46
|
+
border-top: var(--vaadin-tabsheet-border-width, 1px) solid transparent;
|
|
47
|
+
margin-top: calc(var(--vaadin-tabsheet-border-width, 1px) * -1);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
[part='content'][focus-ring] {
|
|
51
|
+
border-bottom-left-radius: inherit;
|
|
52
|
+
border-bottom-right-radius: inherit;
|
|
53
|
+
outline-offset: calc(var(--vaadin-focus-ring-width) * -1);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
[part='content'][overflow~='top'] {
|
|
57
|
+
border-top-color: var(--vaadin-tabsheet-border-color, var(--vaadin-border-color));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:host([loading]) [part='content'] {
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:host([theme~='no-border']) {
|
|
67
|
+
border: 0;
|
|
68
|
+
border-radius: 0;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:host([theme~='no-padding']) [part='content'] {
|
|
72
|
+
padding: 0 !important;
|
|
73
|
+
}
|
|
74
|
+
`,
|
|
75
|
+
];
|
package/src/vaadin-tabsheet.d.ts
CHANGED
|
@@ -30,21 +30,21 @@ export interface TabSheetEventMap extends HTMLElementEventMap, TabSheetCustomEve
|
|
|
30
30
|
* `<vaadin-tabsheet>` is a Web Component for organizing and grouping content
|
|
31
31
|
* into scrollable panels. The panels can be switched between by using tabs.
|
|
32
32
|
*
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
33
|
+
* ```html
|
|
34
|
+
* <vaadin-tabsheet>
|
|
35
|
+
* <div slot="prefix">Prefix</div>
|
|
36
|
+
* <div slot="suffix">Suffix</div>
|
|
37
37
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
38
|
+
* <vaadin-tabs slot="tabs">
|
|
39
|
+
* <vaadin-tab id="tab-1">Tab 1</vaadin-tab>
|
|
40
|
+
* <vaadin-tab id="tab-2">Tab 2</vaadin-tab>
|
|
41
|
+
* <vaadin-tab id="tab-3">Tab 3</vaadin-tab>
|
|
42
|
+
* </vaadin-tabs>
|
|
43
43
|
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
44
|
+
* <div tab="tab-1">Panel 1</div>
|
|
45
|
+
* <div tab="tab-2">Panel 2</div>
|
|
46
|
+
* <div tab="tab-3">Panel 3</div>
|
|
47
|
+
* </vaadin-tabsheet>
|
|
48
48
|
* ```
|
|
49
49
|
*
|
|
50
50
|
* ### Styling
|
package/src/vaadin-tabsheet.js
CHANGED
|
@@ -5,32 +5,34 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import '@vaadin/tabs/src/vaadin-tabs.js';
|
|
7
7
|
import './vaadin-tabsheet-scroller.js';
|
|
8
|
-
import {
|
|
8
|
+
import { html, LitElement } from 'lit';
|
|
9
9
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
10
10
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
11
11
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
12
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
12
13
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
14
|
+
import { tabSheetStyles } from './styles/vaadin-tabsheet-base-styles.js';
|
|
13
15
|
import { TabSheetMixin } from './vaadin-tabsheet-mixin.js';
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
* `<vaadin-tabsheet>` is a Web Component for organizing and grouping content
|
|
17
19
|
* into scrollable panels. The panels can be switched between by using tabs.
|
|
18
20
|
*
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* ```html
|
|
22
|
+
* <vaadin-tabsheet>
|
|
23
|
+
* <div slot="prefix">Prefix</div>
|
|
24
|
+
* <div slot="suffix">Suffix</div>
|
|
23
25
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
26
|
+
* <vaadin-tabs slot="tabs">
|
|
27
|
+
* <vaadin-tab id="tab-1">Tab 1</vaadin-tab>
|
|
28
|
+
* <vaadin-tab id="tab-2">Tab 2</vaadin-tab>
|
|
29
|
+
* <vaadin-tab id="tab-3">Tab 3</vaadin-tab>
|
|
30
|
+
* </vaadin-tabs>
|
|
29
31
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
32
|
+
* <div tab="tab-1">Panel 1</div>
|
|
33
|
+
* <div tab="tab-2">Panel 2</div>
|
|
34
|
+
* <div tab="tab-3">Panel 3</div>
|
|
35
|
+
* </vaadin-tabsheet>
|
|
34
36
|
* ```
|
|
35
37
|
*
|
|
36
38
|
* ### Styling
|
|
@@ -60,40 +62,13 @@ import { TabSheetMixin } from './vaadin-tabsheet-mixin.js';
|
|
|
60
62
|
* @mixes ElementMixin
|
|
61
63
|
* @mixes ThemableMixin
|
|
62
64
|
*/
|
|
63
|
-
class TabSheet extends TabSheetMixin(ThemableMixin(ElementMixin(PolylitMixin(LitElement)))) {
|
|
65
|
+
class TabSheet extends TabSheetMixin(ThemableMixin(ElementMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
64
66
|
static get is() {
|
|
65
67
|
return 'vaadin-tabsheet';
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
static get styles() {
|
|
69
|
-
return
|
|
70
|
-
:host {
|
|
71
|
-
display: flex;
|
|
72
|
-
flex-direction: column;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
:host([hidden]) {
|
|
76
|
-
display: none !important;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
[part='tabs-container'] {
|
|
80
|
-
position: relative;
|
|
81
|
-
display: flex;
|
|
82
|
-
align-items: center;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
::slotted([slot='tabs']) {
|
|
86
|
-
flex: 1;
|
|
87
|
-
align-self: stretch;
|
|
88
|
-
min-width: 8em;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
[part='content'] {
|
|
92
|
-
position: relative;
|
|
93
|
-
flex: 1;
|
|
94
|
-
box-sizing: border-box;
|
|
95
|
-
}
|
|
96
|
-
`;
|
|
71
|
+
return tabSheetStyles;
|
|
97
72
|
}
|
|
98
73
|
|
|
99
74
|
/** @protected */
|
package/vaadin-tabsheet.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import './
|
|
1
|
+
import './src/vaadin-tabsheet.js';
|
|
2
2
|
export * from './src/vaadin-tabsheet.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/tabsheet",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha11",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-tabsheet",
|
|
11
|
-
"description": "`<vaadin-tabsheet>` is a Web Component for organizing and grouping content\ninto scrollable panels. The panels can be switched between by using tabs.\n\n
|
|
11
|
+
"description": "`<vaadin-tabsheet>` is a Web Component for organizing and grouping content\ninto scrollable panels. The panels can be switched between by using tabs.\n\n```html\n<vaadin-tabsheet>\n <div slot=\"prefix\">Prefix</div>\n <div slot=\"suffix\">Suffix</div>\n\n <vaadin-tabs slot=\"tabs\">\n <vaadin-tab id=\"tab-1\">Tab 1</vaadin-tab>\n <vaadin-tab id=\"tab-2\">Tab 2</vaadin-tab>\n <vaadin-tab id=\"tab-3\">Tab 3</vaadin-tab>\n </vaadin-tabs>\n\n <div tab=\"tab-1\">Panel 1</div>\n <div tab=\"tab-2\">Panel 2</div>\n <div tab=\"tab-3\">Panel 3</div>\n</vaadin-tabsheet>\n```\n\n### Styling\n\nThe following shadow DOM parts are exposed for styling:\n\nPart name | Description\n--------- | ---------------\n`tabs-container` | The container for the slotted prefix, tabs and suffix\n`content` | The container for the slotted panels\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n------------------|-------------\n`loading` | Set when a tab without associated content is selected\n`overflow` | Set to `top`, `bottom`, `start`, `end`, all of them, or none.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "selected",
|
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/tabsheet",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha11",
|
|
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-tabsheet",
|
|
19
|
-
"description": "`<vaadin-tabsheet>` is a Web Component for organizing and grouping content\ninto scrollable panels. The panels can be switched between by using tabs.\n\n
|
|
19
|
+
"description": "`<vaadin-tabsheet>` is a Web Component for organizing and grouping content\ninto scrollable panels. The panels can be switched between by using tabs.\n\n```html\n<vaadin-tabsheet>\n <div slot=\"prefix\">Prefix</div>\n <div slot=\"suffix\">Suffix</div>\n\n <vaadin-tabs slot=\"tabs\">\n <vaadin-tab id=\"tab-1\">Tab 1</vaadin-tab>\n <vaadin-tab id=\"tab-2\">Tab 2</vaadin-tab>\n <vaadin-tab id=\"tab-3\">Tab 3</vaadin-tab>\n </vaadin-tabs>\n\n <div tab=\"tab-1\">Panel 1</div>\n <div tab=\"tab-2\">Panel 2</div>\n <div tab=\"tab-3\">Panel 3</div>\n</vaadin-tabsheet>\n```\n\n### Styling\n\nThe following shadow DOM parts are exposed for styling:\n\nPart name | Description\n--------- | ---------------\n`tabs-container` | The container for the slotted prefix, tabs and suffix\n`content` | The container for the slotted panels\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n------------------|-------------\n`loading` | Set when a tab without associated content is selected\n`overflow` | Set to `top`, `bottom`, `start`, `end`, all of them, or none.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-lumo-styles/color.js';
|
|
2
|
-
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
3
|
-
import '@vaadin/vaadin-lumo-styles/typography.js';
|
|
4
|
-
import { loader } from '@vaadin/vaadin-lumo-styles/mixins/loader.js';
|
|
5
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
6
|
-
|
|
7
|
-
const tabsheet = css`
|
|
8
|
-
:host {
|
|
9
|
-
font-size: var(--lumo-font-size-m);
|
|
10
|
-
line-height: var(--lumo-line-height-m);
|
|
11
|
-
font-family: var(--lumo-font-family);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
:host([theme~='bordered']) {
|
|
15
|
-
border: 1px solid var(--lumo-contrast-20pct);
|
|
16
|
-
border-radius: var(--lumo-border-radius-l);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
[part='tabs-container'] {
|
|
20
|
-
box-shadow: inset 0 -1px 0 0 var(--lumo-contrast-10pct);
|
|
21
|
-
padding: var(--lumo-space-xs) var(--lumo-space-s);
|
|
22
|
-
gap: var(--lumo-space-s);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
::slotted([slot='tabs']) {
|
|
26
|
-
box-shadow: initial;
|
|
27
|
-
margin: calc(var(--lumo-space-xs) * -1) calc(var(--lumo-space-s) * -1);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
[part='content'] {
|
|
31
|
-
padding: var(--lumo-space-s) var(--lumo-space-m);
|
|
32
|
-
border-bottom-left-radius: inherit;
|
|
33
|
-
border-bottom-right-radius: inherit;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
:host([loading]) [part='content'] {
|
|
37
|
-
display: flex;
|
|
38
|
-
align-items: center;
|
|
39
|
-
justify-content: center;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
:host([theme~='no-padding']) [part='content'] {
|
|
43
|
-
padding: 0;
|
|
44
|
-
}
|
|
45
|
-
`;
|
|
46
|
-
|
|
47
|
-
registerStyles('vaadin-tabsheet', [tabsheet, loader], { moduleId: 'lumo-tabsheet' });
|
|
48
|
-
|
|
49
|
-
export { tabsheet };
|