@vaadin/tabs 23.0.0-alpha2 → 23.0.0-beta1
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 +9 -8
- package/src/vaadin-tab.d.ts +1 -1
- package/src/vaadin-tab.js +1 -1
- package/src/vaadin-tabs.d.ts +3 -2
- package/src/vaadin-tabs.js +16 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/tabs",
|
|
3
|
-
"version": "23.0.0-
|
|
3
|
+
"version": "23.0.0-beta1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"main": "vaadin-tabs.js",
|
|
20
20
|
"module": "vaadin-tabs.js",
|
|
21
|
+
"type": "module",
|
|
21
22
|
"files": [
|
|
22
23
|
"src",
|
|
23
24
|
"theme",
|
|
@@ -33,17 +34,17 @@
|
|
|
33
34
|
],
|
|
34
35
|
"dependencies": {
|
|
35
36
|
"@polymer/polymer": "^3.0.0",
|
|
36
|
-
"@vaadin/component-base": "23.0.0-
|
|
37
|
-
"@vaadin/item": "23.0.0-
|
|
38
|
-
"@vaadin/vaadin-list-mixin": "23.0.0-
|
|
39
|
-
"@vaadin/vaadin-lumo-styles": "23.0.0-
|
|
40
|
-
"@vaadin/vaadin-material-styles": "23.0.0-
|
|
41
|
-
"@vaadin/vaadin-themable-mixin": "23.0.0-
|
|
37
|
+
"@vaadin/component-base": "23.0.0-beta1",
|
|
38
|
+
"@vaadin/item": "23.0.0-beta1",
|
|
39
|
+
"@vaadin/vaadin-list-mixin": "23.0.0-beta1",
|
|
40
|
+
"@vaadin/vaadin-lumo-styles": "23.0.0-beta1",
|
|
41
|
+
"@vaadin/vaadin-material-styles": "23.0.0-beta1",
|
|
42
|
+
"@vaadin/vaadin-themable-mixin": "23.0.0-beta1"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
45
|
"@esm-bundle/chai": "^4.3.4",
|
|
45
46
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
46
47
|
"sinon": "^9.2.1"
|
|
47
48
|
},
|
|
48
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "467244b76021176c109df675799b07029b293e58"
|
|
49
50
|
}
|
package/src/vaadin-tab.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2017 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
package/src/vaadin-tab.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2017 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
package/src/vaadin-tabs.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2017 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
7
|
+
import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
|
|
7
8
|
import { ListMixin } from '@vaadin/vaadin-list-mixin/vaadin-list-mixin.js';
|
|
8
9
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
10
|
|
|
@@ -61,7 +62,7 @@ export interface TabsEventMap extends HTMLElementEventMap, TabsCustomEventMap {}
|
|
|
61
62
|
* @fires {CustomEvent} items-changed - Fired when the `items` property changes.
|
|
62
63
|
* @fires {CustomEvent} selected-changed - Fired when the `selected` property changes.
|
|
63
64
|
*/
|
|
64
|
-
declare class Tabs extends ElementMixin(ListMixin(ThemableMixin(HTMLElement))) {
|
|
65
|
+
declare class Tabs extends ResizeMixin(ElementMixin(ListMixin(ThemableMixin(HTMLElement)))) {
|
|
65
66
|
/**
|
|
66
67
|
* The index of the selected tab.
|
|
67
68
|
*/
|
package/src/vaadin-tabs.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2017 - 2022 Vaadin Ltd.
|
|
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
7
|
import { afterNextRender } from '@polymer/polymer/lib/utils/render-status.js';
|
|
8
8
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
9
9
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
10
|
+
import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
|
|
10
11
|
import { ListMixin } from '@vaadin/vaadin-list-mixin/vaadin-list-mixin.js';
|
|
11
12
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
13
|
|
|
@@ -48,8 +49,9 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
48
49
|
* @mixes ElementMixin
|
|
49
50
|
* @mixes ListMixin
|
|
50
51
|
* @mixes ThemableMixin
|
|
52
|
+
* @mixes ResizeMixin
|
|
51
53
|
*/
|
|
52
|
-
class Tabs extends ElementMixin(ListMixin(ThemableMixin(PolymerElement))) {
|
|
54
|
+
class Tabs extends ResizeMixin(ElementMixin(ListMixin(ThemableMixin(PolymerElement)))) {
|
|
53
55
|
static get template() {
|
|
54
56
|
return html`
|
|
55
57
|
<style>
|
|
@@ -171,8 +173,8 @@ class Tabs extends ElementMixin(ListMixin(ThemableMixin(PolymerElement))) {
|
|
|
171
173
|
constructor() {
|
|
172
174
|
super();
|
|
173
175
|
|
|
174
|
-
this.
|
|
175
|
-
|
|
176
|
+
this.__itemsResizeObserver = new ResizeObserver(() => {
|
|
177
|
+
setTimeout(() => this._updateOverflow());
|
|
176
178
|
});
|
|
177
179
|
}
|
|
178
180
|
|
|
@@ -187,15 +189,22 @@ class Tabs extends ElementMixin(ListMixin(ThemableMixin(PolymerElement))) {
|
|
|
187
189
|
});
|
|
188
190
|
}
|
|
189
191
|
|
|
192
|
+
/**
|
|
193
|
+
* @protected
|
|
194
|
+
* @override
|
|
195
|
+
*/
|
|
196
|
+
_onResize() {
|
|
197
|
+
this._updateOverflow();
|
|
198
|
+
}
|
|
199
|
+
|
|
190
200
|
/** @private */
|
|
191
201
|
__tabsItemsChanged(items) {
|
|
192
202
|
// Disconnected to unobserve any removed items
|
|
193
|
-
this.
|
|
194
|
-
this.__resizeObserver.observe(this);
|
|
203
|
+
this.__itemsResizeObserver.disconnect();
|
|
195
204
|
|
|
196
205
|
// Observe current items
|
|
197
206
|
(items || []).forEach((item) => {
|
|
198
|
-
this.
|
|
207
|
+
this.__itemsResizeObserver.observe(item);
|
|
199
208
|
});
|
|
200
209
|
|
|
201
210
|
this._updateOverflow();
|