@vaadin/tabs 24.0.0-alpha1 → 24.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/package.json +7 -8
- package/src/vaadin-tab.d.ts +1 -1
- package/src/vaadin-tab.js +1 -1
- package/src/vaadin-tabs.d.ts +2 -2
- package/src/vaadin-tabs.js +27 -25
- package/theme/lumo/vaadin-tab-styles.js +7 -14
- package/theme/material/vaadin-tab-styles.js +1 -2
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/tabs",
|
|
3
|
-
"version": "24.0.0-
|
|
3
|
+
"version": "24.0.0-alpha10",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -36,12 +36,11 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@polymer/polymer": "^3.0.0",
|
|
39
|
-
"@vaadin/component-base": "24.0.0-
|
|
40
|
-
"@vaadin/item": "24.0.0-
|
|
41
|
-
"@vaadin/vaadin-
|
|
42
|
-
"@vaadin/vaadin-
|
|
43
|
-
"@vaadin/vaadin-
|
|
44
|
-
"@vaadin/vaadin-themable-mixin": "24.0.0-alpha1"
|
|
39
|
+
"@vaadin/component-base": "24.0.0-alpha10",
|
|
40
|
+
"@vaadin/item": "24.0.0-alpha10",
|
|
41
|
+
"@vaadin/vaadin-lumo-styles": "24.0.0-alpha10",
|
|
42
|
+
"@vaadin/vaadin-material-styles": "24.0.0-alpha10",
|
|
43
|
+
"@vaadin/vaadin-themable-mixin": "24.0.0-alpha10"
|
|
45
44
|
},
|
|
46
45
|
"devDependencies": {
|
|
47
46
|
"@esm-bundle/chai": "^4.3.4",
|
|
@@ -52,5 +51,5 @@
|
|
|
52
51
|
"web-types.json",
|
|
53
52
|
"web-types.lit.json"
|
|
54
53
|
],
|
|
55
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "2e04534d8b47bcd216f89b5f849bafef1a73b174"
|
|
56
55
|
}
|
package/src/vaadin-tab.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2017 -
|
|
3
|
+
* Copyright (c) 2017 - 2023 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 { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
package/src/vaadin-tab.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2017 -
|
|
3
|
+
* Copyright (c) 2017 - 2023 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,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2017 -
|
|
3
|
+
* Copyright (c) 2017 - 2023 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 { ListMixin } from '@vaadin/component-base/src/list-mixin.js';
|
|
7
8
|
import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
|
|
8
|
-
import { ListMixin } from '@vaadin/vaadin-list-mixin/vaadin-list-mixin.js';
|
|
9
9
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
10
10
|
|
|
11
11
|
export type TabsOrientation = 'horizontal' | 'vertical';
|
package/src/vaadin-tabs.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2017 -
|
|
3
|
+
* Copyright (c) 2017 - 2023 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
|
+
import { getNormalizedScrollLeft } from '@vaadin/component-base/src/dir-utils.js';
|
|
9
10
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
11
|
+
import { ListMixin } from '@vaadin/component-base/src/list-mixin.js';
|
|
10
12
|
import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
|
|
11
|
-
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
14
|
|
|
14
15
|
/**
|
|
@@ -178,6 +179,28 @@ class Tabs extends ResizeMixin(ElementMixin(ListMixin(ThemableMixin(PolymerEleme
|
|
|
178
179
|
});
|
|
179
180
|
}
|
|
180
181
|
|
|
182
|
+
/**
|
|
183
|
+
* @return {number}
|
|
184
|
+
* @protected
|
|
185
|
+
*/
|
|
186
|
+
get _scrollOffset() {
|
|
187
|
+
return this._vertical ? this._scrollerElement.offsetHeight : this._scrollerElement.offsetWidth;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @return {!HTMLElement}
|
|
192
|
+
* @protected
|
|
193
|
+
* @override
|
|
194
|
+
*/
|
|
195
|
+
get _scrollerElement() {
|
|
196
|
+
return this.$.scroll;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** @private */
|
|
200
|
+
get __direction() {
|
|
201
|
+
return !this._vertical && this.__isRTL ? 1 : -1;
|
|
202
|
+
}
|
|
203
|
+
|
|
181
204
|
/** @protected */
|
|
182
205
|
ready() {
|
|
183
206
|
super.ready();
|
|
@@ -221,39 +244,18 @@ class Tabs extends ResizeMixin(ElementMixin(ListMixin(ThemableMixin(PolymerEleme
|
|
|
221
244
|
this._scroll(this.__direction * this._scrollOffset);
|
|
222
245
|
}
|
|
223
246
|
|
|
224
|
-
/**
|
|
225
|
-
* @return {number}
|
|
226
|
-
* @protected
|
|
227
|
-
*/
|
|
228
|
-
get _scrollOffset() {
|
|
229
|
-
return this._vertical ? this._scrollerElement.offsetHeight : this._scrollerElement.offsetWidth;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* @return {!HTMLElement}
|
|
234
|
-
* @protected
|
|
235
|
-
*/
|
|
236
|
-
get _scrollerElement() {
|
|
237
|
-
return this.$.scroll;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
/** @private */
|
|
241
|
-
get __direction() {
|
|
242
|
-
return !this._vertical && this.getAttribute('dir') === 'rtl' ? 1 : -1;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
247
|
/** @private */
|
|
246
248
|
_updateOverflow() {
|
|
247
249
|
const scrollPosition = this._vertical
|
|
248
250
|
? this._scrollerElement.scrollTop
|
|
249
|
-
: this.
|
|
251
|
+
: getNormalizedScrollLeft(this._scrollerElement, this.getAttribute('dir'));
|
|
250
252
|
const scrollSize = this._vertical ? this._scrollerElement.scrollHeight : this._scrollerElement.scrollWidth;
|
|
251
253
|
|
|
252
254
|
let overflow = scrollPosition > 0 ? 'start' : '';
|
|
253
255
|
overflow += scrollPosition + this._scrollOffset < scrollSize ? ' end' : '';
|
|
254
256
|
|
|
255
257
|
if (this.__direction === 1) {
|
|
256
|
-
overflow = overflow.replace(/start|end/
|
|
258
|
+
overflow = overflow.replace(/start|end/giu, (matched) => {
|
|
257
259
|
return matched === 'start' ? 'end' : 'start';
|
|
258
260
|
});
|
|
259
261
|
}
|
|
@@ -134,27 +134,23 @@ registerStyles(
|
|
|
134
134
|
color: inherit !important;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
:host ::slotted(vaadin-icon)
|
|
138
|
-
:host ::slotted(iron-icon) {
|
|
137
|
+
:host ::slotted(vaadin-icon) {
|
|
139
138
|
margin: 0 4px;
|
|
140
139
|
width: var(--lumo-icon-size-m);
|
|
141
140
|
height: var(--lumo-icon-size-m);
|
|
142
141
|
}
|
|
143
142
|
|
|
144
143
|
/* Vaadin icons are based on a 16x16 grid (unlike Lumo and Material icons with 24x24), so they look too big by default */
|
|
145
|
-
:host ::slotted(vaadin-icon[icon^='vaadin:'])
|
|
146
|
-
:host ::slotted(iron-icon[icon^='vaadin:']) {
|
|
144
|
+
:host ::slotted(vaadin-icon[icon^='vaadin:']) {
|
|
147
145
|
padding: 0.25rem;
|
|
148
146
|
box-sizing: border-box !important;
|
|
149
147
|
}
|
|
150
148
|
|
|
151
|
-
:host(:not([dir='rtl'])) ::slotted(vaadin-icon:first-child)
|
|
152
|
-
:host(:not([dir='rtl'])) ::slotted(iron-icon:first-child) {
|
|
149
|
+
:host(:not([dir='rtl'])) ::slotted(vaadin-icon:first-child) {
|
|
153
150
|
margin-left: 0;
|
|
154
151
|
}
|
|
155
152
|
|
|
156
|
-
:host(:not([dir='rtl'])) ::slotted(vaadin-icon:last-child)
|
|
157
|
-
:host(:not([dir='rtl'])) ::slotted(iron-icon:last-child) {
|
|
153
|
+
:host(:not([dir='rtl'])) ::slotted(vaadin-icon:last-child) {
|
|
158
154
|
margin-right: 0;
|
|
159
155
|
}
|
|
160
156
|
|
|
@@ -175,8 +171,7 @@ registerStyles(
|
|
|
175
171
|
padding-top: 0.25rem;
|
|
176
172
|
}
|
|
177
173
|
|
|
178
|
-
:host([theme~='icon-on-top']) ::slotted(vaadin-icon)
|
|
179
|
-
:host([theme~='icon-on-top']) ::slotted(iron-icon) {
|
|
174
|
+
:host([theme~='icon-on-top']) ::slotted(vaadin-icon) {
|
|
180
175
|
margin: 0;
|
|
181
176
|
}
|
|
182
177
|
|
|
@@ -209,13 +204,11 @@ registerStyles(
|
|
|
209
204
|
transform: translateX(50%) scale(1);
|
|
210
205
|
}
|
|
211
206
|
|
|
212
|
-
:host([dir='rtl']) ::slotted(vaadin-icon:first-child)
|
|
213
|
-
:host([dir='rtl']) ::slotted(iron-icon:first-child) {
|
|
207
|
+
:host([dir='rtl']) ::slotted(vaadin-icon:first-child) {
|
|
214
208
|
margin-right: 0;
|
|
215
209
|
}
|
|
216
210
|
|
|
217
|
-
:host([dir='rtl']) ::slotted(vaadin-icon:last-child)
|
|
218
|
-
:host([dir='rtl']) ::slotted(iron-icon:last-child) {
|
|
211
|
+
:host([dir='rtl']) ::slotted(vaadin-icon:last-child) {
|
|
219
212
|
margin-left: 0;
|
|
220
213
|
}
|
|
221
214
|
|
package/web-types.json
CHANGED