@vaadin/tabsheet 24.2.0-dev.f254716fe → 24.3.0-alpha1

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/tabsheet",
3
- "version": "24.2.0-dev.f254716fe",
3
+ "version": "24.3.0-alpha1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,21 +36,21 @@
36
36
  ],
37
37
  "dependencies": {
38
38
  "@polymer/polymer": "^3.0.0",
39
- "@vaadin/component-base": "24.2.0-dev.f254716fe",
40
- "@vaadin/scroller": "24.2.0-dev.f254716fe",
41
- "@vaadin/tabs": "24.2.0-dev.f254716fe",
42
- "@vaadin/vaadin-lumo-styles": "24.2.0-dev.f254716fe",
43
- "@vaadin/vaadin-material-styles": "24.2.0-dev.f254716fe",
44
- "@vaadin/vaadin-themable-mixin": "24.2.0-dev.f254716fe"
39
+ "@vaadin/component-base": "24.3.0-alpha1",
40
+ "@vaadin/scroller": "24.3.0-alpha1",
41
+ "@vaadin/tabs": "24.3.0-alpha1",
42
+ "@vaadin/vaadin-lumo-styles": "24.3.0-alpha1",
43
+ "@vaadin/vaadin-material-styles": "24.3.0-alpha1",
44
+ "@vaadin/vaadin-themable-mixin": "24.3.0-alpha1"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@esm-bundle/chai": "^4.3.4",
48
- "@vaadin/testing-helpers": "^0.4.3",
48
+ "@vaadin/testing-helpers": "^0.5.0",
49
49
  "sinon": "^13.0.2"
50
50
  },
51
51
  "web-types": [
52
52
  "web-types.json",
53
53
  "web-types.lit.json"
54
54
  ],
55
- "gitHead": "da54950b9f8c14c6451ede0d426e16a489c7fb9b"
55
+ "gitHead": "9ca6f3ca220a777e8eea181a1f5717e39a732240"
56
56
  }
@@ -3,11 +3,13 @@
3
3
  * Copyright (c) 2022 - 2023 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
6
7
  import { Scroller } from '@vaadin/scroller/src/vaadin-scroller.js';
7
8
 
8
9
  /**
9
10
  * An element used internally by `<vaadin-tabsheet>`. Not intended to be used separately.
10
11
  *
12
+ * @customElement
11
13
  * @extends Scroller
12
14
  * @private
13
15
  */
@@ -17,4 +19,4 @@ class TabsheetScroller extends Scroller {
17
19
  }
18
20
  }
19
21
 
20
- customElements.define(TabsheetScroller.is, TabsheetScroller);
22
+ defineCustomElement(TabsheetScroller);
@@ -4,13 +4,14 @@
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import './vaadin-tabsheet-scroller.js';
7
- import { FlattenedNodesObserver } from '@polymer/polymer/lib/utils/flattened-nodes-observer.js';
8
7
  import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
9
8
  import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
9
+ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
10
10
  import { DelegateStateMixin } from '@vaadin/component-base/src/delegate-state-mixin.js';
11
11
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
12
12
  import { OverflowController } from '@vaadin/component-base/src/overflow-controller.js';
13
13
  import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
14
+ import { SlotObserver } from '@vaadin/component-base/src/slot-observer.js';
14
15
  import { generateUniqueId } from '@vaadin/component-base/src/unique-id-utils.js';
15
16
  import { Tabs } from '@vaadin/tabs/src/vaadin-tabs.js';
16
17
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
@@ -100,11 +101,12 @@ class TabsSlotController extends SlotController {
100
101
  * @fires {CustomEvent} items-changed - Fired when the `items` property changes.
101
102
  * @fires {CustomEvent} selected-changed - Fired when the `selected` property changes.
102
103
  *
104
+ * @customElement
103
105
  * @extends HTMLElement
104
106
  * @mixes ElementMixin
105
107
  * @mixes ThemableMixin
106
108
  * @mixes ControllerMixin
107
- * @mises DelegateStateMixin
109
+ * @mixes DelegateStateMixin
108
110
  */
109
111
  class TabSheet extends ControllerMixin(DelegateStateMixin(ElementMixin(ThemableMixin(PolymerElement)))) {
110
112
  static get template() {
@@ -222,7 +224,7 @@ class TabSheet extends ControllerMixin(DelegateStateMixin(ElementMixin(ThemableM
222
224
 
223
225
  // Observe the panels slot for nodes. Set the assigned element nodes as the __panels array.
224
226
  const panelSlot = this.shadowRoot.querySelector('#panel-slot');
225
- this.__panelsObserver = new FlattenedNodesObserver(panelSlot, () => {
227
+ this.__panelsObserver = new SlotObserver(panelSlot, () => {
226
228
  this.__panels = Array.from(panelSlot.assignedNodes({ flatten: true })).filter(
227
229
  (node) => node.nodeType === Node.ELEMENT_NODE,
228
230
  );
@@ -288,6 +290,6 @@ class TabSheet extends ControllerMixin(DelegateStateMixin(ElementMixin(ThemableM
288
290
  }
289
291
  }
290
292
 
291
- customElements.define(TabSheet.is, TabSheet);
293
+ defineCustomElement(TabSheet);
292
294
 
293
295
  export { TabSheet };
package/web-types.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/web-types",
3
+ "name": "@vaadin/tabsheet",
4
+ "version": "24.3.0-alpha1",
5
+ "description-markup": "markdown",
6
+ "contributions": {
7
+ "html": {
8
+ "elements": [
9
+ {
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```\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](hhttps://vaadin.com/docs/latest/components/ds-resources/customization/styling-components) documentation.",
12
+ "attributes": [
13
+ {
14
+ "name": "selected",
15
+ "description": "The index of the selected tab.",
16
+ "value": {
17
+ "type": [
18
+ "number",
19
+ "null",
20
+ "undefined"
21
+ ]
22
+ }
23
+ },
24
+ {
25
+ "name": "theme",
26
+ "description": "The theme variants to apply to the component.",
27
+ "value": {
28
+ "type": [
29
+ "string",
30
+ "null",
31
+ "undefined"
32
+ ]
33
+ }
34
+ }
35
+ ],
36
+ "js": {
37
+ "properties": [
38
+ {
39
+ "name": "selected",
40
+ "description": "The index of the selected tab.",
41
+ "value": {
42
+ "type": [
43
+ "number",
44
+ "null",
45
+ "undefined"
46
+ ]
47
+ }
48
+ }
49
+ ],
50
+ "events": [
51
+ {
52
+ "name": "items-changed",
53
+ "description": "Fired when the `items` property changes."
54
+ },
55
+ {
56
+ "name": "selected-changed",
57
+ "description": "Fired when the `selected` property changes."
58
+ }
59
+ ]
60
+ }
61
+ }
62
+ ]
63
+ }
64
+ }
65
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/web-types",
3
+ "name": "@vaadin/tabsheet",
4
+ "version": "24.3.0-alpha1",
5
+ "description-markup": "markdown",
6
+ "framework": "lit",
7
+ "framework-config": {
8
+ "enable-when": {
9
+ "node-packages": [
10
+ "lit"
11
+ ]
12
+ }
13
+ },
14
+ "contributions": {
15
+ "html": {
16
+ "elements": [
17
+ {
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```\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](hhttps://vaadin.com/docs/latest/components/ds-resources/customization/styling-components) documentation.",
20
+ "extension": true,
21
+ "attributes": [
22
+ {
23
+ "name": ".selected",
24
+ "description": "The index of the selected tab.",
25
+ "value": {
26
+ "kind": "expression"
27
+ }
28
+ },
29
+ {
30
+ "name": "@items-changed",
31
+ "description": "Fired when the `items` property changes.",
32
+ "value": {
33
+ "kind": "expression"
34
+ }
35
+ },
36
+ {
37
+ "name": "@selected-changed",
38
+ "description": "Fired when the `selected` property changes.",
39
+ "value": {
40
+ "kind": "expression"
41
+ }
42
+ }
43
+ ]
44
+ }
45
+ ]
46
+ }
47
+ }
48
+ }