@vaadin/slider 25.4.0-dev.55bb86e155 → 25.4.0-rc1
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/custom-elements.json +11 -44
- package/package.json +11 -11
- package/src/vaadin-range-slider.js +73 -74
- package/src/vaadin-slider-bubble-overlay.js +9 -0
- package/src/vaadin-slider.js +46 -47
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
package/custom-elements.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"modules": [
|
|
5
5
|
{
|
|
6
6
|
"kind": "javascript-module",
|
|
7
|
-
"path": "vaadin-slider.js",
|
|
7
|
+
"path": "vaadin-range-slider.js",
|
|
8
8
|
"declarations": [],
|
|
9
9
|
"exports": [
|
|
10
10
|
{
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
"name": "*",
|
|
13
13
|
"declaration": {
|
|
14
14
|
"name": "*",
|
|
15
|
-
"module": "src/vaadin-slider.js"
|
|
15
|
+
"module": "src/vaadin-range-slider.js"
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
]
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
"kind": "javascript-module",
|
|
22
|
-
"path": "vaadin-
|
|
22
|
+
"path": "vaadin-slider.js",
|
|
23
23
|
"declarations": [],
|
|
24
24
|
"exports": [
|
|
25
25
|
{
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"name": "*",
|
|
28
28
|
"declaration": {
|
|
29
29
|
"name": "*",
|
|
30
|
-
"module": "src/vaadin-
|
|
30
|
+
"module": "src/vaadin-slider.js"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
]
|
|
@@ -306,8 +306,7 @@
|
|
|
306
306
|
"type": {
|
|
307
307
|
"text": "array"
|
|
308
308
|
},
|
|
309
|
-
"description": "The value of the slider."
|
|
310
|
-
"attribute": "value"
|
|
309
|
+
"description": "The value of the slider."
|
|
311
310
|
},
|
|
312
311
|
{
|
|
313
312
|
"kind": "field",
|
|
@@ -326,26 +325,18 @@
|
|
|
326
325
|
],
|
|
327
326
|
"events": [
|
|
328
327
|
{
|
|
329
|
-
"name": "change",
|
|
330
328
|
"type": {
|
|
331
329
|
"text": "Event"
|
|
332
330
|
},
|
|
333
331
|
"description": "Fired when the user commits a value change.",
|
|
334
|
-
"
|
|
335
|
-
"name": "SliderMixin",
|
|
336
|
-
"module": "src/vaadin-slider-mixin.js"
|
|
337
|
-
}
|
|
332
|
+
"name": "change"
|
|
338
333
|
},
|
|
339
334
|
{
|
|
340
|
-
"name": "input",
|
|
341
335
|
"type": {
|
|
342
336
|
"text": "Event"
|
|
343
337
|
},
|
|
344
338
|
"description": "Fired when the slider value changes during user interaction.",
|
|
345
|
-
"
|
|
346
|
-
"name": "SliderMixin",
|
|
347
|
-
"module": "src/vaadin-slider-mixin.js"
|
|
348
|
-
}
|
|
339
|
+
"name": "input"
|
|
349
340
|
},
|
|
350
341
|
{
|
|
351
342
|
"type": {
|
|
@@ -355,15 +346,11 @@
|
|
|
355
346
|
"name": "invalid-changed"
|
|
356
347
|
},
|
|
357
348
|
{
|
|
358
|
-
"name": "validated",
|
|
359
349
|
"type": {
|
|
360
350
|
"text": "CustomEvent"
|
|
361
351
|
},
|
|
362
352
|
"description": "Fired whenever the field is validated.",
|
|
363
|
-
"
|
|
364
|
-
"name": "ValidateMixin",
|
|
365
|
-
"package": "@vaadin/field-base/src/validate-mixin.js"
|
|
366
|
-
}
|
|
353
|
+
"name": "validated"
|
|
367
354
|
},
|
|
368
355
|
{
|
|
369
356
|
"type": {
|
|
@@ -577,14 +564,6 @@
|
|
|
577
564
|
"description": "The theme variants to apply to the component.",
|
|
578
565
|
"name": "theme"
|
|
579
566
|
},
|
|
580
|
-
{
|
|
581
|
-
"name": "value",
|
|
582
|
-
"type": {
|
|
583
|
-
"text": "array"
|
|
584
|
-
},
|
|
585
|
-
"description": "The value of the slider.",
|
|
586
|
-
"fieldName": "value"
|
|
587
|
-
},
|
|
588
567
|
{
|
|
589
568
|
"name": "value-always-visible",
|
|
590
569
|
"type": {
|
|
@@ -1109,26 +1088,18 @@
|
|
|
1109
1088
|
],
|
|
1110
1089
|
"events": [
|
|
1111
1090
|
{
|
|
1112
|
-
"name": "change",
|
|
1113
1091
|
"type": {
|
|
1114
1092
|
"text": "Event"
|
|
1115
1093
|
},
|
|
1116
1094
|
"description": "Fired when the user commits a value change.",
|
|
1117
|
-
"
|
|
1118
|
-
"name": "SliderMixin",
|
|
1119
|
-
"module": "src/vaadin-slider-mixin.js"
|
|
1120
|
-
}
|
|
1095
|
+
"name": "change"
|
|
1121
1096
|
},
|
|
1122
1097
|
{
|
|
1123
|
-
"name": "input",
|
|
1124
1098
|
"type": {
|
|
1125
1099
|
"text": "Event"
|
|
1126
1100
|
},
|
|
1127
1101
|
"description": "Fired when the slider value changes during user interaction.",
|
|
1128
|
-
"
|
|
1129
|
-
"name": "SliderMixin",
|
|
1130
|
-
"module": "src/vaadin-slider-mixin.js"
|
|
1131
|
-
}
|
|
1102
|
+
"name": "input"
|
|
1132
1103
|
},
|
|
1133
1104
|
{
|
|
1134
1105
|
"type": {
|
|
@@ -1138,15 +1109,11 @@
|
|
|
1138
1109
|
"name": "invalid-changed"
|
|
1139
1110
|
},
|
|
1140
1111
|
{
|
|
1141
|
-
"name": "validated",
|
|
1142
1112
|
"type": {
|
|
1143
1113
|
"text": "CustomEvent"
|
|
1144
1114
|
},
|
|
1145
1115
|
"description": "Fired whenever the field is validated.",
|
|
1146
|
-
"
|
|
1147
|
-
"name": "ValidateMixin",
|
|
1148
|
-
"package": "@vaadin/field-base/src/validate-mixin.js"
|
|
1149
|
-
}
|
|
1116
|
+
"name": "validated"
|
|
1150
1117
|
},
|
|
1151
1118
|
{
|
|
1152
1119
|
"type": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/slider",
|
|
3
|
-
"version": "25.4.0-
|
|
3
|
+
"version": "25.4.0-rc1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,24 +35,24 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
|
-
"@vaadin/a11y-base": "25.4.0-
|
|
39
|
-
"@vaadin/component-base": "25.4.0-
|
|
40
|
-
"@vaadin/field-base": "25.4.0-
|
|
41
|
-
"@vaadin/overlay": "25.4.0-
|
|
42
|
-
"@vaadin/vaadin-themable-mixin": "25.4.0-
|
|
38
|
+
"@vaadin/a11y-base": "25.4.0-rc1",
|
|
39
|
+
"@vaadin/component-base": "25.4.0-rc1",
|
|
40
|
+
"@vaadin/field-base": "25.4.0-rc1",
|
|
41
|
+
"@vaadin/overlay": "25.4.0-rc1",
|
|
42
|
+
"@vaadin/vaadin-themable-mixin": "25.4.0-rc1",
|
|
43
43
|
"lit": "^3.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@vaadin/aura": "25.4.0-
|
|
47
|
-
"@vaadin/chai-plugins": "25.4.0-
|
|
48
|
-
"@vaadin/test-runner-commands": "25.4.0-
|
|
46
|
+
"@vaadin/aura": "25.4.0-rc1",
|
|
47
|
+
"@vaadin/chai-plugins": "25.4.0-rc1",
|
|
48
|
+
"@vaadin/test-runner-commands": "25.4.0-rc1",
|
|
49
49
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
50
|
-
"@vaadin/vaadin-lumo-styles": "25.4.0-
|
|
50
|
+
"@vaadin/vaadin-lumo-styles": "25.4.0-rc1"
|
|
51
51
|
},
|
|
52
52
|
"customElements": "custom-elements.json",
|
|
53
53
|
"web-types": [
|
|
54
54
|
"web-types.json",
|
|
55
55
|
"web-types.lit.json"
|
|
56
56
|
],
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "abe6d2338024cb71110c7df9bd5d97c0d110a135"
|
|
58
58
|
}
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import './vaadin-slider-bubble.js';
|
|
7
|
-
import { css, html, LitElement
|
|
7
|
+
import { css, html, LitElement } from 'lit';
|
|
8
8
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
9
9
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
10
10
|
import { FocusMixin } from '@vaadin/a11y-base/src/focus-mixin.js';
|
|
11
11
|
import { isElementFocused } from '@vaadin/a11y-base/src/focus-utils.js';
|
|
12
12
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
13
|
+
import { slotContent } from '@vaadin/component-base/src/directives/slot-content.js';
|
|
13
14
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
14
15
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
15
16
|
import { generateUniqueId } from '@vaadin/component-base/src/unique-id-utils.js';
|
|
@@ -327,8 +328,8 @@ class RangeSlider extends FieldMixin(
|
|
|
327
328
|
</div>
|
|
328
329
|
<div part="thumb thumb-start"></div>
|
|
329
330
|
<div part="thumb thumb-end"></div>
|
|
330
|
-
<slot name="input"></slot>
|
|
331
|
-
<slot name="bubble"></slot>
|
|
331
|
+
<slot name="input" ${slotContent(this.__renderInputs())}></slot>
|
|
332
|
+
<slot name="bubble" ${slotContent(this.__renderBubbles())}></slot>
|
|
332
333
|
</div>
|
|
333
334
|
|
|
334
335
|
<div part="marks" aria-hidden="true">
|
|
@@ -347,6 +348,75 @@ class RangeSlider extends FieldMixin(
|
|
|
347
348
|
`;
|
|
348
349
|
}
|
|
349
350
|
|
|
351
|
+
/** @private */
|
|
352
|
+
__renderInputs() {
|
|
353
|
+
const [startValue, endValue] = this.__value;
|
|
354
|
+
const { min, max, step } = this.__getConstraints();
|
|
355
|
+
|
|
356
|
+
return html`
|
|
357
|
+
<input
|
|
358
|
+
type="range"
|
|
359
|
+
id="${this.__inputId0}"
|
|
360
|
+
slot="input"
|
|
361
|
+
aria-label="${this.accessibleNameStart || this.__getAriaLabel('min')}"
|
|
362
|
+
.min="${min}"
|
|
363
|
+
.max="${max}"
|
|
364
|
+
.step="${step}"
|
|
365
|
+
.value="${startValue}"
|
|
366
|
+
.disabled="${this.disabled}"
|
|
367
|
+
tabindex="${this.disabled ? -1 : 0}"
|
|
368
|
+
@pointerenter="${this.__onStartPointerEnter}"
|
|
369
|
+
@pointermove="${this.__onStartPointerMove}"
|
|
370
|
+
@pointerleave="${this.__onStartPointerLeave}"
|
|
371
|
+
@keydown="${this.__onKeyDown}"
|
|
372
|
+
@input="${this.__onStartInput}"
|
|
373
|
+
@change="${this.__onChange}"
|
|
374
|
+
/>
|
|
375
|
+
<input
|
|
376
|
+
type="range"
|
|
377
|
+
id="${this.__inputId1}"
|
|
378
|
+
slot="input"
|
|
379
|
+
aria-label="${this.accessibleNameEnd || this.__getAriaLabel('max')}"
|
|
380
|
+
.min="${min}"
|
|
381
|
+
.max="${max}"
|
|
382
|
+
.step="${step}"
|
|
383
|
+
.value="${endValue}"
|
|
384
|
+
.disabled="${this.disabled}"
|
|
385
|
+
tabindex="${this.disabled ? -1 : 0}"
|
|
386
|
+
@pointerenter="${this.__onEndPointerEnter}"
|
|
387
|
+
@pointermove="${this.__onEndPointerMove}"
|
|
388
|
+
@pointerleave="${this.__onEndPointerLeave}"
|
|
389
|
+
@keydown="${this.__onKeyDown}"
|
|
390
|
+
@input="${this.__onEndInput}"
|
|
391
|
+
@change="${this.__onChange}"
|
|
392
|
+
/>
|
|
393
|
+
`;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/** @private */
|
|
397
|
+
__renderBubbles() {
|
|
398
|
+
const [startValue, endValue] = this.__value;
|
|
399
|
+
|
|
400
|
+
return html`
|
|
401
|
+
<vaadin-slider-bubble
|
|
402
|
+
slot="bubble"
|
|
403
|
+
.positionTarget="${this.__thumbStartElement}"
|
|
404
|
+
.opened="${this.valueAlwaysVisible || this.__startBubbleOpened}"
|
|
405
|
+
theme="${ifDefined(this._theme)}"
|
|
406
|
+
>
|
|
407
|
+
${startValue}
|
|
408
|
+
</vaadin-slider-bubble>
|
|
409
|
+
<vaadin-slider-bubble
|
|
410
|
+
slot="bubble"
|
|
411
|
+
.positionTarget="${this.__thumbEndElement}"
|
|
412
|
+
.opened="${this.valueAlwaysVisible || this.__endBubbleOpened}"
|
|
413
|
+
theme="${ifDefined(this._theme)}"
|
|
414
|
+
>
|
|
415
|
+
${endValue}
|
|
416
|
+
</vaadin-slider-bubble>
|
|
417
|
+
`;
|
|
418
|
+
}
|
|
419
|
+
|
|
350
420
|
constructor() {
|
|
351
421
|
super();
|
|
352
422
|
|
|
@@ -393,77 +463,6 @@ class RangeSlider extends FieldMixin(
|
|
|
393
463
|
this.removeAttribute('end-active');
|
|
394
464
|
}
|
|
395
465
|
|
|
396
|
-
/**
|
|
397
|
-
* Override update to render slotted `<input type="range" />`
|
|
398
|
-
* into light DOM after rendering shadow DOM.
|
|
399
|
-
* @protected
|
|
400
|
-
*/
|
|
401
|
-
update(props) {
|
|
402
|
-
super.update(props);
|
|
403
|
-
|
|
404
|
-
const [startValue, endValue] = this.__value;
|
|
405
|
-
const { min, max, step } = this.__getConstraints();
|
|
406
|
-
|
|
407
|
-
render(
|
|
408
|
-
html`
|
|
409
|
-
<input
|
|
410
|
-
type="range"
|
|
411
|
-
id="${this.__inputId0}"
|
|
412
|
-
slot="input"
|
|
413
|
-
aria-label="${this.accessibleNameStart || this.__getAriaLabel('min')}"
|
|
414
|
-
.min="${min}"
|
|
415
|
-
.max="${max}"
|
|
416
|
-
.step="${step}"
|
|
417
|
-
.value="${startValue}"
|
|
418
|
-
.disabled="${this.disabled}"
|
|
419
|
-
tabindex="${this.disabled ? -1 : 0}"
|
|
420
|
-
@pointerenter="${this.__onStartPointerEnter}"
|
|
421
|
-
@pointermove="${this.__onStartPointerMove}"
|
|
422
|
-
@pointerleave="${this.__onStartPointerLeave}"
|
|
423
|
-
@keydown="${this.__onKeyDown}"
|
|
424
|
-
@input="${this.__onStartInput}"
|
|
425
|
-
@change="${this.__onChange}"
|
|
426
|
-
/>
|
|
427
|
-
<input
|
|
428
|
-
type="range"
|
|
429
|
-
id="${this.__inputId1}"
|
|
430
|
-
slot="input"
|
|
431
|
-
aria-label="${this.accessibleNameEnd || this.__getAriaLabel('max')}"
|
|
432
|
-
.min="${min}"
|
|
433
|
-
.max="${max}"
|
|
434
|
-
.step="${step}"
|
|
435
|
-
.value="${endValue}"
|
|
436
|
-
.disabled="${this.disabled}"
|
|
437
|
-
tabindex="${this.disabled ? -1 : 0}"
|
|
438
|
-
@pointerenter="${this.__onEndPointerEnter}"
|
|
439
|
-
@pointermove="${this.__onEndPointerMove}"
|
|
440
|
-
@pointerleave="${this.__onEndPointerLeave}"
|
|
441
|
-
@keydown="${this.__onKeyDown}"
|
|
442
|
-
@input="${this.__onEndInput}"
|
|
443
|
-
@change="${this.__onChange}"
|
|
444
|
-
/>
|
|
445
|
-
<vaadin-slider-bubble
|
|
446
|
-
slot="bubble"
|
|
447
|
-
.positionTarget="${this.__thumbStartElement}"
|
|
448
|
-
.opened="${this.valueAlwaysVisible || this.__startBubbleOpened}"
|
|
449
|
-
theme="${ifDefined(this._theme)}"
|
|
450
|
-
>
|
|
451
|
-
${startValue}
|
|
452
|
-
</vaadin-slider-bubble>
|
|
453
|
-
<vaadin-slider-bubble
|
|
454
|
-
slot="bubble"
|
|
455
|
-
.positionTarget="${this.__thumbEndElement}"
|
|
456
|
-
.opened="${this.valueAlwaysVisible || this.__endBubbleOpened}"
|
|
457
|
-
theme="${ifDefined(this._theme)}"
|
|
458
|
-
>
|
|
459
|
-
${endValue}
|
|
460
|
-
</vaadin-slider-bubble>
|
|
461
|
-
`,
|
|
462
|
-
this,
|
|
463
|
-
{ host: this },
|
|
464
|
-
);
|
|
465
|
-
}
|
|
466
|
-
|
|
467
466
|
/** @protected */
|
|
468
467
|
willUpdate(props) {
|
|
469
468
|
super.willUpdate(props);
|
|
@@ -36,6 +36,15 @@ class SliderBubbleOverlay extends PositionMixin(
|
|
|
36
36
|
return { ...super.lumoInjector, includeBaseStyles: true };
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Override method from `OverlayFocusMixin` to opt out of focus management.
|
|
41
|
+
* @protected
|
|
42
|
+
* @override
|
|
43
|
+
*/
|
|
44
|
+
static get manageFocus() {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
|
|
39
48
|
/** @protected */
|
|
40
49
|
render() {
|
|
41
50
|
return html`
|
package/src/vaadin-slider.js
CHANGED
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import './vaadin-slider-bubble.js';
|
|
7
|
-
import { css, html, LitElement
|
|
7
|
+
import { css, html, LitElement } from 'lit';
|
|
8
8
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
9
9
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
10
10
|
import { FocusMixin } from '@vaadin/a11y-base/src/focus-mixin.js';
|
|
11
11
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
12
|
+
import { slotContent } from '@vaadin/component-base/src/directives/slot-content.js';
|
|
12
13
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
13
14
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
14
15
|
import { generateUniqueId } from '@vaadin/component-base/src/unique-id-utils.js';
|
|
@@ -229,8 +230,8 @@ class Slider extends FieldMixin(
|
|
|
229
230
|
<div part="track-fill"></div>
|
|
230
231
|
</div>
|
|
231
232
|
<div part="thumb"></div>
|
|
232
|
-
<slot name="input"></slot>
|
|
233
|
-
<slot name="bubble"></slot>
|
|
233
|
+
<slot name="input" ${slotContent(this.__renderInput())}></slot>
|
|
234
|
+
<slot name="bubble" ${slotContent(this.__renderBubble())}></slot>
|
|
234
235
|
</div>
|
|
235
236
|
|
|
236
237
|
<div part="marks" aria-hidden="true">
|
|
@@ -249,6 +250,48 @@ class Slider extends FieldMixin(
|
|
|
249
250
|
`;
|
|
250
251
|
}
|
|
251
252
|
|
|
253
|
+
/** @private */
|
|
254
|
+
__renderInput() {
|
|
255
|
+
const [value] = this.__value;
|
|
256
|
+
const { min, max, step } = this.__getConstraints();
|
|
257
|
+
|
|
258
|
+
return html`
|
|
259
|
+
<input
|
|
260
|
+
type="range"
|
|
261
|
+
id="${this.__inputId}"
|
|
262
|
+
slot="input"
|
|
263
|
+
.min="${min}"
|
|
264
|
+
.max="${max}"
|
|
265
|
+
.value="${value}"
|
|
266
|
+
.step="${step}"
|
|
267
|
+
.disabled="${this.disabled}"
|
|
268
|
+
tabindex="${this.disabled ? -1 : 0}"
|
|
269
|
+
@pointerenter="${this.__onPointerEnter}"
|
|
270
|
+
@pointermove="${this.__onPointerMove}"
|
|
271
|
+
@pointerleave="${this.__onPointerLeave}"
|
|
272
|
+
@keydown="${this.__onKeyDown}"
|
|
273
|
+
@input="${this.__onInput}"
|
|
274
|
+
@change="${this.__onChange}"
|
|
275
|
+
/>
|
|
276
|
+
`;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/** @private */
|
|
280
|
+
__renderBubble() {
|
|
281
|
+
const [value] = this.__value;
|
|
282
|
+
|
|
283
|
+
return html`
|
|
284
|
+
<vaadin-slider-bubble
|
|
285
|
+
slot="bubble"
|
|
286
|
+
.positionTarget="${this.__thumbElement}"
|
|
287
|
+
.opened="${this.valueAlwaysVisible || this.__bubbleOpened}"
|
|
288
|
+
theme="${ifDefined(this._theme)}"
|
|
289
|
+
>
|
|
290
|
+
${value}
|
|
291
|
+
</vaadin-slider-bubble>
|
|
292
|
+
`;
|
|
293
|
+
}
|
|
294
|
+
|
|
252
295
|
constructor() {
|
|
253
296
|
super();
|
|
254
297
|
|
|
@@ -290,50 +333,6 @@ class Slider extends FieldMixin(
|
|
|
290
333
|
this.removeAttribute('active');
|
|
291
334
|
}
|
|
292
335
|
|
|
293
|
-
/**
|
|
294
|
-
* Override update to render slotted `<input type="range" />`
|
|
295
|
-
* into light DOM after rendering shadow DOM.
|
|
296
|
-
* @protected
|
|
297
|
-
*/
|
|
298
|
-
update(props) {
|
|
299
|
-
super.update(props);
|
|
300
|
-
|
|
301
|
-
const [value] = this.__value;
|
|
302
|
-
const { min, max, step } = this.__getConstraints();
|
|
303
|
-
|
|
304
|
-
render(
|
|
305
|
-
html`
|
|
306
|
-
<input
|
|
307
|
-
type="range"
|
|
308
|
-
id="${this.__inputId}"
|
|
309
|
-
slot="input"
|
|
310
|
-
.min="${min}"
|
|
311
|
-
.max="${max}"
|
|
312
|
-
.value="${value}"
|
|
313
|
-
.step="${step}"
|
|
314
|
-
.disabled="${this.disabled}"
|
|
315
|
-
tabindex="${this.disabled ? -1 : 0}"
|
|
316
|
-
@pointerenter="${this.__onPointerEnter}"
|
|
317
|
-
@pointermove="${this.__onPointerMove}"
|
|
318
|
-
@pointerleave="${this.__onPointerLeave}"
|
|
319
|
-
@keydown="${this.__onKeyDown}"
|
|
320
|
-
@input="${this.__onInput}"
|
|
321
|
-
@change="${this.__onChange}"
|
|
322
|
-
/>
|
|
323
|
-
<vaadin-slider-bubble
|
|
324
|
-
slot="bubble"
|
|
325
|
-
.positionTarget="${this.__thumbElement}"
|
|
326
|
-
.opened="${this.valueAlwaysVisible || this.__bubbleOpened}"
|
|
327
|
-
theme="${ifDefined(this._theme)}"
|
|
328
|
-
>
|
|
329
|
-
${value}
|
|
330
|
-
</vaadin-slider-bubble>
|
|
331
|
-
`,
|
|
332
|
-
this,
|
|
333
|
-
{ host: this },
|
|
334
|
-
);
|
|
335
|
-
}
|
|
336
|
-
|
|
337
336
|
/** @protected */
|
|
338
337
|
willUpdate(props) {
|
|
339
338
|
super.willUpdate(props);
|
package/web-types.json
CHANGED
package/web-types.lit.json
CHANGED