@statistikzh/leu 0.10.0 → 0.11.1
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/.github/workflows/deploy-github-pages.yaml +2 -2
- package/.github/workflows/release-please.yml +1 -1
- package/CHANGELOG.md +15 -0
- package/dist/Accordion.d.ts +1 -1
- package/dist/Accordion.d.ts.map +1 -1
- package/dist/Accordion.js +22 -30
- package/dist/Breadcrumb.d.ts +1 -1
- package/dist/Breadcrumb.d.ts.map +1 -1
- package/dist/Breadcrumb.js +3 -8
- package/dist/Button.d.ts +1 -1
- package/dist/Button.js +3 -3
- package/dist/ButtonGroup.d.ts +1 -1
- package/dist/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup.js +3 -8
- package/dist/Checkbox.d.ts +1 -1
- package/dist/Checkbox.js +2 -2
- package/dist/CheckboxGroup.d.ts +1 -1
- package/dist/CheckboxGroup.js +2 -2
- package/dist/Chip.d.ts +1 -1
- package/dist/Chip.d.ts.map +1 -1
- package/dist/Chip.js +3 -5
- package/dist/ChipGroup.d.ts +1 -1
- package/dist/ChipGroup.js +2 -2
- package/dist/ChipLink.js +1 -1
- package/dist/ChipRemovable.js +1 -1
- package/dist/ChipSelectable.js +1 -1
- package/dist/Dialog.d.ts +1 -1
- package/dist/Dialog.d.ts.map +1 -1
- package/dist/Dialog.js +3 -7
- package/dist/Dropdown.d.ts +1 -1
- package/dist/Dropdown.d.ts.map +1 -1
- package/dist/Dropdown.js +4 -9
- package/dist/Icon.d.ts +1 -1
- package/dist/Icon.js +2 -2
- package/dist/Input.d.ts +1 -1
- package/dist/Input.d.ts.map +1 -1
- package/dist/Input.js +3 -8
- package/dist/{LeuElement-6fbc0dee.d.ts → LeuElement-e092765a.d.ts} +1 -1
- package/dist/LeuElement-e092765a.d.ts.map +1 -0
- package/dist/{LeuElement-6fbc0dee.js → LeuElement-e092765a.js} +10 -2
- package/dist/Menu.d.ts +1 -1
- package/dist/Menu.d.ts.map +1 -1
- package/dist/Menu.js +3 -8
- package/dist/MenuItem.d.ts +1 -1
- package/dist/MenuItem.d.ts.map +1 -1
- package/dist/MenuItem.js +3 -8
- package/dist/Pagination.d.ts +1 -1
- package/dist/Pagination.js +3 -3
- package/dist/Popup.d.ts +1 -1
- package/dist/Popup.d.ts.map +1 -1
- package/dist/Popup.js +3 -8
- package/dist/Radio.d.ts +1 -1
- package/dist/Radio.js +2 -2
- package/dist/RadioGroup.d.ts +1 -1
- package/dist/RadioGroup.js +2 -2
- package/dist/Range.d.ts +60 -0
- package/dist/Range.d.ts.map +1 -0
- package/dist/Range.js +413 -0
- package/dist/ScrollTop.d.ts +1 -1
- package/dist/ScrollTop.js +3 -3
- package/dist/Select.d.ts +1 -1
- package/dist/Select.d.ts.map +1 -1
- package/dist/Select.js +4 -9
- package/dist/Spinner.d.ts +1 -1
- package/dist/Spinner.js +2 -2
- package/dist/Table.d.ts +1 -1
- package/dist/Table.js +3 -3
- package/dist/VisuallyHidden.d.ts +1 -1
- package/dist/VisuallyHidden.js +2 -2
- package/dist/{hasSlotController-04d0dfa2.d.ts → hasSlotController-d1f26756.d.ts} +1 -1
- package/dist/{hasSlotController-04d0dfa2.d.ts.map → hasSlotController-d1f26756.d.ts.map} +1 -1
- package/dist/{hasSlotController-04d0dfa2.js → hasSlotController-d1f26756.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/leu-accordion.js +1 -1
- package/dist/leu-breadcrumb.js +1 -1
- package/dist/leu-button-group.js +1 -1
- package/dist/leu-button.js +2 -2
- package/dist/leu-checkbox-group.js +1 -1
- package/dist/leu-checkbox.js +1 -1
- package/dist/leu-chip-group.js +1 -1
- package/dist/leu-chip-link.js +1 -1
- package/dist/leu-chip-removable.js +1 -1
- package/dist/leu-chip-selectable.js +1 -1
- package/dist/leu-dialog.js +2 -2
- package/dist/leu-dropdown.js +2 -2
- package/dist/leu-icon.js +1 -1
- package/dist/leu-input.js +1 -1
- package/dist/leu-menu-item.js +1 -1
- package/dist/leu-menu.js +1 -1
- package/dist/leu-pagination.js +2 -2
- package/dist/leu-popup.js +1 -1
- package/dist/leu-radio-group.js +1 -1
- package/dist/leu-radio.js +1 -1
- package/dist/leu-range.d.ts +3 -0
- package/dist/leu-range.d.ts.map +1 -0
- package/dist/leu-range.js +7 -0
- package/dist/leu-scroll-top.js +2 -2
- package/dist/leu-select.js +2 -2
- package/dist/leu-spinner.js +1 -1
- package/dist/leu-table.js +2 -2
- package/dist/leu-visually-hidden.js +1 -1
- package/dist/vscode.html-custom-data.json +130 -110
- package/dist/vue/index.d.ts +194 -153
- package/dist/web-types.json +243 -199
- package/package.json +1 -1
- package/scripts/generate-component/templates/[Name].js +1 -1
- package/scripts/generate-component/templates/[name].css +0 -5
- package/src/components/accordion/Accordion.js +10 -6
- package/src/components/accordion/accordion.css +9 -22
- package/src/components/breadcrumb/Breadcrumb.js +1 -1
- package/src/components/breadcrumb/breadcrumb.css +0 -5
- package/src/components/button/Button.js +1 -1
- package/src/components/button-group/ButtonGroup.js +1 -1
- package/src/components/button-group/button-group.css +0 -5
- package/src/components/checkbox/Checkbox.js +1 -1
- package/src/components/checkbox/CheckboxGroup.js +1 -1
- package/src/components/chip/Chip.js +1 -1
- package/src/components/chip/ChipGroup.js +1 -1
- package/src/components/chip/chip.css +0 -2
- package/src/components/dialog/Dialog.js +1 -1
- package/src/components/dialog/dialog.css +0 -5
- package/src/components/dropdown/Dropdown.js +1 -1
- package/src/components/dropdown/dropdown.css +0 -5
- package/src/components/icon/Icon.js +1 -1
- package/src/components/input/Input.js +1 -1
- package/src/components/input/input.css +0 -5
- package/src/components/menu/Menu.js +1 -1
- package/src/components/menu/MenuItem.js +1 -1
- package/src/components/menu/menu-item.css +0 -5
- package/src/components/menu/menu.css +0 -5
- package/src/components/pagination/Pagination.js +1 -1
- package/src/components/popup/Popup.js +1 -1
- package/src/components/popup/popup.css +0 -5
- package/src/components/radio/Radio.js +1 -1
- package/src/components/radio/RadioGroup.js +1 -1
- package/src/components/range/Range.js +237 -0
- package/src/components/range/leu-range.js +5 -0
- package/src/components/range/range.css +180 -0
- package/src/components/range/stories/range-slider.stories.js +142 -0
- package/src/components/range/test/range-test.js +24 -0
- package/src/components/scroll-top/ScrollTop.js +1 -1
- package/src/components/select/Select.js +1 -1
- package/src/components/select/select.css +0 -5
- package/src/components/spinner/Spinner.js +1 -1
- package/src/components/table/Table.js +1 -1
- package/src/components/visually-hidden/VisuallyHidden.js +1 -1
- package/src/lib/LeuElement.js +3 -0
- package/src/styles/common-styles.css +5 -0
- package/src/styles/style.stories.js +1 -0
- package/web-dev-server.config.mjs +1 -0
- package/dist/LeuElement-6fbc0dee.d.ts.map +0 -1
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
@import url("../../styles/custom-media.css");
|
|
2
2
|
|
|
3
|
-
:host,
|
|
4
|
-
:host * {
|
|
5
|
-
box-sizing: border-box;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
3
|
:host {
|
|
9
4
|
--accordion-font-regular: var(--leu-font-family-regular);
|
|
10
5
|
--accordion-font-black: var(--leu-font-family-black);
|
|
@@ -19,17 +14,9 @@
|
|
|
19
14
|
|
|
20
15
|
--transition: 0.1s ease;
|
|
21
16
|
|
|
22
|
-
font-family: var(--
|
|
17
|
+
font-family: var(--accordion-font-regular);
|
|
23
18
|
|
|
24
19
|
position: relative;
|
|
25
|
-
display: grid;
|
|
26
|
-
grid-template-rows: auto 0fr;
|
|
27
|
-
|
|
28
|
-
transition: grid-template-rows var(--transition);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
:host([open]) {
|
|
32
|
-
grid-template-rows: auto 1fr;
|
|
33
20
|
}
|
|
34
21
|
|
|
35
22
|
.heading {
|
|
@@ -115,15 +102,18 @@
|
|
|
115
102
|
flex-grow: 1;
|
|
116
103
|
}
|
|
117
104
|
|
|
105
|
+
.contentwrapper {
|
|
106
|
+
display: grid;
|
|
107
|
+
grid-template-rows: 1fr;
|
|
108
|
+
transition: grid-template-rows var(--transition);
|
|
109
|
+
}
|
|
110
|
+
|
|
118
111
|
.content {
|
|
119
112
|
overflow: hidden;
|
|
120
|
-
transition: visibility var(--transition), opacity var(--transition);
|
|
121
113
|
}
|
|
122
114
|
|
|
123
|
-
.
|
|
124
|
-
|
|
125
|
-
visibility: hidden;
|
|
126
|
-
opacity: 0;
|
|
115
|
+
.contentwrapper[hidden] {
|
|
116
|
+
grid-template-rows: 0fr;
|
|
127
117
|
}
|
|
128
118
|
|
|
129
119
|
slot[name="content"] {
|
|
@@ -140,9 +130,6 @@ slot[name="content"] {
|
|
|
140
130
|
}
|
|
141
131
|
|
|
142
132
|
.divider {
|
|
143
|
-
position: absolute;
|
|
144
|
-
top: 100%;
|
|
145
|
-
left: 0;
|
|
146
133
|
|
|
147
134
|
width: 100%;
|
|
148
135
|
height: 1px;
|
|
@@ -11,7 +11,7 @@ import styles from "./button-group.css"
|
|
|
11
11
|
* @fires input - When the value of the group changes by clicking a button
|
|
12
12
|
*/
|
|
13
13
|
export class LeuButtonGroup extends LeuElement {
|
|
14
|
-
static styles = styles
|
|
14
|
+
static styles = [LeuElement.styles, styles]
|
|
15
15
|
|
|
16
16
|
constructor() {
|
|
17
17
|
super()
|
|
@@ -10,7 +10,7 @@ import styles from "./checkbox-group.css"
|
|
|
10
10
|
* @tagname leu-checkbox-group
|
|
11
11
|
*/
|
|
12
12
|
export class LeuCheckboxGroup extends LeuElement {
|
|
13
|
-
static styles = styles
|
|
13
|
+
static styles = [LeuElement.styles, styles]
|
|
14
14
|
|
|
15
15
|
static properties = {
|
|
16
16
|
orientation: { type: String, reflect: true },
|
|
@@ -6,7 +6,7 @@ import styles from "./chip.css"
|
|
|
6
6
|
/* Design: https://www.figma.com/file/d6Pv21UVUbnBs3AdcZijHmbN/KTZH-Design-System?type=design&node-id=21161-184433&mode=design&t=Kjo5VDiqivihn8dh-11 */
|
|
7
7
|
|
|
8
8
|
export class LeuChipBase extends LeuElement {
|
|
9
|
-
static styles = styles
|
|
9
|
+
static styles = [LeuElement.styles, styles]
|
|
10
10
|
|
|
11
11
|
/** @internal */
|
|
12
12
|
static shadowRootOptions = {
|
|
@@ -19,7 +19,7 @@ export const SELECTION_MODES = Object.freeze({
|
|
|
19
19
|
* @tagname leu-chip-group
|
|
20
20
|
*/
|
|
21
21
|
export class LeuChipGroup extends LeuElement {
|
|
22
|
-
static styles = styles
|
|
22
|
+
static styles = [LeuElement.styles, styles]
|
|
23
23
|
|
|
24
24
|
static properties = {
|
|
25
25
|
inverted: { type: Boolean, reflect: true },
|
|
@@ -2,11 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
/* figma https://www.figma.com/design/d6Pv21UVUbnBs3AdcZijHmbN/KTZH-Design-System?node-id=21161-186812&t=8VgDy9avMRG5aL7s-0 */
|
|
4
4
|
|
|
5
|
-
:host,
|
|
6
|
-
:host * {
|
|
7
|
-
box-sizing: border-box;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
5
|
:host {
|
|
11
6
|
--dialog-font-regular: var(--leu-font-family-regular);
|
|
12
7
|
--dialog-font-black: var(--leu-font-family-black);
|
|
@@ -17,7 +17,7 @@ import { paths } from "./paths.js"
|
|
|
17
17
|
* @cssprop --leu-icon-size - The size of the icon.
|
|
18
18
|
*/
|
|
19
19
|
export class LeuIcon extends LeuElement {
|
|
20
|
-
static styles = styles
|
|
20
|
+
static styles = [LeuElement.styles, styles]
|
|
21
21
|
|
|
22
22
|
static properties = {
|
|
23
23
|
name: { type: String, reflect: true },
|
|
@@ -16,7 +16,7 @@ import styles from "./menu.css"
|
|
|
16
16
|
* @property {SelectsType} selects - This has only an effect when the role is 'menu'. It defines which role the menu items will get. Default is 'none'.
|
|
17
17
|
*/
|
|
18
18
|
export class LeuMenu extends LeuElement {
|
|
19
|
-
static styles = styles
|
|
19
|
+
static styles = [LeuElement.styles, styles]
|
|
20
20
|
|
|
21
21
|
static shadowRootOptions = {
|
|
22
22
|
...LeuElement.shadowRootOptions,
|
|
@@ -10,7 +10,7 @@ import styles from "./radio-group.css"
|
|
|
10
10
|
* @tagname leu-radio-group
|
|
11
11
|
*/
|
|
12
12
|
export class LeuRadioGroup extends LeuElement {
|
|
13
|
-
static styles = styles
|
|
13
|
+
static styles = [LeuElement.styles, styles]
|
|
14
14
|
|
|
15
15
|
static properties = {
|
|
16
16
|
orientation: { type: String, reflect: true },
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { html } from "lit"
|
|
2
|
+
|
|
3
|
+
import styles from "./range.css"
|
|
4
|
+
import { LeuElement } from "../../lib/LeuElement.js"
|
|
5
|
+
|
|
6
|
+
const defaultValueConverter = {
|
|
7
|
+
fromAttribute(value) {
|
|
8
|
+
return value.split(",").map((v) => Number(v.trim()))
|
|
9
|
+
},
|
|
10
|
+
toAttribute(value) {
|
|
11
|
+
return value.join(",")
|
|
12
|
+
},
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const RANGE_LABELS = ["Von", "Bis"]
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @tagname leu-range
|
|
19
|
+
*/
|
|
20
|
+
export class LeuRange extends LeuElement {
|
|
21
|
+
static styles = [LeuElement.styles, styles]
|
|
22
|
+
|
|
23
|
+
static shadowRootOptions = {
|
|
24
|
+
...LeuElement.shadowRootOptions,
|
|
25
|
+
delegatesFocus: true,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
static properties = {
|
|
29
|
+
defaultValue: { converter: defaultValueConverter, attribute: "value" },
|
|
30
|
+
min: { type: Number, reflect: true },
|
|
31
|
+
max: { type: Number, reflect: true },
|
|
32
|
+
step: { type: Number, reflect: true },
|
|
33
|
+
name: { type: String, reflect: true },
|
|
34
|
+
label: { type: String, reflect: true },
|
|
35
|
+
disabled: { type: Boolean, reflect: true },
|
|
36
|
+
multiple: { type: Boolean, reflect: true },
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
constructor() {
|
|
40
|
+
super()
|
|
41
|
+
this.defaultValue = [50]
|
|
42
|
+
this.min = 0
|
|
43
|
+
this.max = 100
|
|
44
|
+
this.step = 1
|
|
45
|
+
this.name = ""
|
|
46
|
+
this.label = ""
|
|
47
|
+
this.disabled = false
|
|
48
|
+
this.multiple = false
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
updated() {
|
|
52
|
+
this._updateStyles()
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
_updateStyles() {
|
|
56
|
+
const normalizedRange = this._getNormalizedRange()
|
|
57
|
+
this.style.setProperty("--low", normalizedRange[0].toString())
|
|
58
|
+
this.style.setProperty("--high", normalizedRange[1].toString())
|
|
59
|
+
|
|
60
|
+
const inputs = this.multiple
|
|
61
|
+
? [this._getBaseInput(), this._getGhostInput()]
|
|
62
|
+
: [this._getBaseInput()]
|
|
63
|
+
|
|
64
|
+
inputs.forEach((input) => {
|
|
65
|
+
/** @type {HTMLOutputElement} */
|
|
66
|
+
const output = this.shadowRoot.querySelector(`.output[for=${input.id}]`)
|
|
67
|
+
const normalizedValue = this._getNormalizedValue(input.valueAsNumber)
|
|
68
|
+
output.style.setProperty("--value", normalizedValue.toString())
|
|
69
|
+
output.value = input.value
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
get value() {
|
|
74
|
+
const inputs = Array.from(this.shadowRoot.querySelectorAll("input"))
|
|
75
|
+
return inputs.map((input) => input.value).join(",")
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Sets the value of the underlying input element(s).
|
|
80
|
+
* The value has to be an array if "multiple" range is used.
|
|
81
|
+
* Otherwise it has to be a string.
|
|
82
|
+
* @param {string | Array} value
|
|
83
|
+
*/
|
|
84
|
+
set value(value) {
|
|
85
|
+
if (this.multiple && Array.isArray(value)) {
|
|
86
|
+
const inputs = Array.from(this.shadowRoot.querySelectorAll("input"))
|
|
87
|
+
value.forEach((v, i) => {
|
|
88
|
+
inputs[i].value = v
|
|
89
|
+
})
|
|
90
|
+
this._updateStyles()
|
|
91
|
+
} else if (!this.multiple) {
|
|
92
|
+
this._getBaseInput().value = value
|
|
93
|
+
this._updateStyles()
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
get valueAsArray() {
|
|
98
|
+
return Array.from(this.shadowRoot.querySelectorAll("input")).map(
|
|
99
|
+
(input) => input.valueAsNumber
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
get valueLow() {
|
|
104
|
+
const inputs = Array.from(this.shadowRoot.querySelectorAll("input"))
|
|
105
|
+
|
|
106
|
+
if (this.multiple) {
|
|
107
|
+
return inputs.map((input) => input.valueAsNumber).sort((a, b) => a - b)[0]
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return inputs[0].value
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
get valueHigh() {
|
|
114
|
+
const inputs = Array.from(this.shadowRoot.querySelectorAll("input"))
|
|
115
|
+
|
|
116
|
+
if (this.multiple) {
|
|
117
|
+
return inputs.map((input) => input.valueAsNumber).sort((a, b) => a - b)[1]
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return inputs[0].value
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* @returns {HTMLInputElement | null}
|
|
125
|
+
*/
|
|
126
|
+
_getBaseInput() {
|
|
127
|
+
return this.shadowRoot.querySelector(".range--base")
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* @returns {HTMLInputElement | null}
|
|
132
|
+
*/
|
|
133
|
+
_getGhostInput() {
|
|
134
|
+
return this.shadowRoot.querySelector(".range--ghost")
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
*
|
|
139
|
+
* @param {number} _index
|
|
140
|
+
* @param {InputEvent & {target: HTMLInputElement}} _e
|
|
141
|
+
*/
|
|
142
|
+
_handleInput(_index, _e) {
|
|
143
|
+
this._updateStyles()
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
*
|
|
148
|
+
* @param {number} value
|
|
149
|
+
* @returns {number}
|
|
150
|
+
*/
|
|
151
|
+
_getNormalizedValue(value) {
|
|
152
|
+
return (value - this.min) / (this.max - this.min)
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
_getNormalizedRange() {
|
|
156
|
+
if (this.multiple) {
|
|
157
|
+
return this.valueAsArray
|
|
158
|
+
.map((value) => this._getNormalizedValue(value))
|
|
159
|
+
.sort((a, b) => a - b)
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return [0, this._getNormalizedValue(this.valueAsArray[0])]
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Determine if the "click" (pointer event) is closer the
|
|
167
|
+
* the value of the other input element. Swap the values if this is the case.
|
|
168
|
+
* @param {PointerEvent & {target: HTMLInputElement}} e
|
|
169
|
+
*/
|
|
170
|
+
_handlePointerDown(e) {
|
|
171
|
+
const clickValue =
|
|
172
|
+
this.min + ((this.max - this.min) * e.offsetX) / this.offsetWidth
|
|
173
|
+
const middleValue = (this.valueAsArray[0] + this.valueAsArray[1]) / 2
|
|
174
|
+
|
|
175
|
+
if (
|
|
176
|
+
(e.target.valueAsNumber === this.valueLow) ===
|
|
177
|
+
clickValue > middleValue
|
|
178
|
+
) {
|
|
179
|
+
/**
|
|
180
|
+
* As the pointerdown event is fired before the input event, we first overwrite the value
|
|
181
|
+
* of the input element that was not clicked on. The active input element will update itself.
|
|
182
|
+
*/
|
|
183
|
+
// this._value = [e.target.valueAsNumber, e.target.valueAsNumber]
|
|
184
|
+
this._getGhostInput().value = e.target.value
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
render() {
|
|
189
|
+
const inputs = this.multiple ? ["base", "ghost"] : ["base"]
|
|
190
|
+
|
|
191
|
+
const { multiple, disabled, label, defaultValue } = this
|
|
192
|
+
|
|
193
|
+
return html`
|
|
194
|
+
<div
|
|
195
|
+
role=${multiple ? "group" : undefined}
|
|
196
|
+
aria-labelledby=${multiple ? "group-label" : undefined}
|
|
197
|
+
>
|
|
198
|
+
${multiple
|
|
199
|
+
? html`<span id="group-label" class="label">${label}</span>`
|
|
200
|
+
: html`<label for="input-base" class="label">${label}</label>`}
|
|
201
|
+
<div class="outputs">
|
|
202
|
+
${inputs.map(
|
|
203
|
+
(type, index) =>
|
|
204
|
+
html`<output
|
|
205
|
+
class="output"
|
|
206
|
+
for="input-${type}"
|
|
207
|
+
value=${defaultValue[index]}
|
|
208
|
+
></output>`
|
|
209
|
+
)}
|
|
210
|
+
</div>
|
|
211
|
+
<div class="inputs">
|
|
212
|
+
${inputs.map(
|
|
213
|
+
(type, index) =>
|
|
214
|
+
html`
|
|
215
|
+
<input
|
|
216
|
+
@input=${(e) => this._handleInput(index, e)}
|
|
217
|
+
@pointerdown=${multiple && !disabled && index === 0
|
|
218
|
+
? this._handlePointerDown
|
|
219
|
+
: undefined}
|
|
220
|
+
type="range"
|
|
221
|
+
class="range range--${type}"
|
|
222
|
+
id="input-${type}"
|
|
223
|
+
name=${this.name}
|
|
224
|
+
min=${this.min}
|
|
225
|
+
max=${this.max}
|
|
226
|
+
step=${this.step}
|
|
227
|
+
aria-label=${multiple ? RANGE_LABELS[index] : undefined}
|
|
228
|
+
?disabled=${disabled}
|
|
229
|
+
.value=${defaultValue[index].toString()}
|
|
230
|
+
/>
|
|
231
|
+
`
|
|
232
|
+
)}
|
|
233
|
+
</div>
|
|
234
|
+
</div>
|
|
235
|
+
`
|
|
236
|
+
}
|
|
237
|
+
}
|