@cscfi/csc-ui 1.1.1 → 1.2.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/dist/cjs/c-accordion-item.cjs.entry.js +1 -1
- package/dist/cjs/c-accordion-item.cjs.entry.js.map +1 -1
- package/dist/cjs/c-slider.cjs.entry.js +100 -0
- package/dist/cjs/c-slider.cjs.entry.js.map +1 -0
- package/dist/cjs/csc-ui.cjs.js +1 -1
- package/dist/cjs/index-91ba22ab.js +4 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/c-accordion-item/c-accordion-item.css +1 -1
- package/dist/collection/components/c-slider/c-slider.css +252 -0
- package/dist/collection/components/c-slider/c-slider.js +380 -0
- package/dist/collection/components/c-slider/c-slider.js.map +1 -0
- package/dist/components/c-accordion-item.js +1 -1
- package/dist/components/c-accordion-item.js.map +1 -1
- package/dist/components/c-slider.d.ts +11 -0
- package/dist/components/c-slider.js +134 -0
- package/dist/components/c-slider.js.map +1 -0
- package/dist/csc-ui/csc-ui.esm.js +1 -1
- package/dist/csc-ui/csc-ui.esm.js.map +1 -1
- package/dist/csc-ui/{p-5d21c4c7.entry.js → p-0569fc3e.entry.js} +2 -2
- package/dist/csc-ui/{p-5d21c4c7.entry.js.map → p-0569fc3e.entry.js.map} +1 -1
- package/dist/csc-ui/p-ba475561.entry.js +2 -0
- package/dist/csc-ui/p-ba475561.entry.js.map +1 -0
- package/dist/esm/c-accordion-item.entry.js +1 -1
- package/dist/esm/c-accordion-item.entry.js.map +1 -1
- package/dist/esm/c-slider.entry.js +96 -0
- package/dist/esm/c-slider.entry.js.map +1 -0
- package/dist/esm/csc-ui.js +1 -1
- package/dist/esm/index-47956d53.js +4 -0
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/c-slider/c-slider.d.ts +32 -0
- package/dist/types/components.d.ts +156 -0
- package/package.json +1 -1
- package/vscode-data.json +65 -0
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
html {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
*,
|
|
6
|
+
*:before,
|
|
7
|
+
*:after {
|
|
8
|
+
box-sizing: inherit;
|
|
9
|
+
-webkit-tap-highlight-color: transparent;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
:host {
|
|
13
|
+
font-family: var(--c-font-family);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
::-ms-reveal {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:host(c-slider) {
|
|
21
|
+
/**
|
|
22
|
+
* @prop --c-slider-background-color-active-disabled: Active disabled slider background color
|
|
23
|
+
* @prop --c-slider-background-color-active: Slider active background color
|
|
24
|
+
* @prop --c-slider-background-color-disabled: Disabled slider background color
|
|
25
|
+
* @prop --c-slider-background-color: Slider background color
|
|
26
|
+
* @prop --c-slider-thumb-background-color-disabled: Disabled slider thumb background color
|
|
27
|
+
* @prop --c-slider-thumb-background-color-hover: Slider thumb background color on hover
|
|
28
|
+
* @prop --c-slider-thumb-background-color: Slider thumb background color
|
|
29
|
+
* @prop --c-slider-tick-color-active: Slider active tick color
|
|
30
|
+
* @prop --c-slider-tick-color: Slider tick color
|
|
31
|
+
* @prop --c-slider-tooltip-background-color: Slider tooltip background color
|
|
32
|
+
* @prop --c-slider-tooltip-text-color: Slider tooltip text color
|
|
33
|
+
*/
|
|
34
|
+
--_c-slider-background-color-active-disabled: var(--c-slider-background-color-active-disabled, var(--c-tertiary-400));
|
|
35
|
+
--_c-slider-background-color-active: var(--c-slider-background-color-active, var(--c-primary-500));
|
|
36
|
+
--_c-slider-background-color-disabled: var(--c-slider-background-color-disabled, rgba(var(--c-tertiary-rgb), 0.2));
|
|
37
|
+
--_c-slider-background-color: var(--c-slider-background-color, rgba(var(--c-tertiary-rgb), 0.2));
|
|
38
|
+
--_c-slider-thumb-background-color-disabled: var(--c-slider-thumb-background-color-disabled, var(--c-tertiary-500));
|
|
39
|
+
--_c-slider-thumb-background-color-hover: var(--c-slider-thumb-background-color-hover, rgba(var(--c-primary-rgb), 0.2));
|
|
40
|
+
--_c-slider-thumb-background-color: var(--c-slider-thumb-background-color, var(--c-primary-600));
|
|
41
|
+
--_c-slider-tick-color-active: var(--c-slider-tick-color-active, var(--c-white));
|
|
42
|
+
--_c-slider-tick-color: var(--c-slider-tick-color, var(--c-tertiary-500));
|
|
43
|
+
--_c-slider-tooltip-background-color: var(--c-slider-tooltip-background-color, var(--c-primary-900));
|
|
44
|
+
--_c-slider-tooltip-text-color: var(--c-slider-tooltip-text-color, var(--c-white));
|
|
45
|
+
--_c-slider-outline: none;
|
|
46
|
+
--_c-slider-thumb-scale: 1;
|
|
47
|
+
--_c-slider-thumb-shadow-size: 8px;
|
|
48
|
+
--_c-slider-tooltip-opacity: 0;
|
|
49
|
+
--_c-slider-tooltip-y: -4px;
|
|
50
|
+
display: block;
|
|
51
|
+
isolation: isolate;
|
|
52
|
+
padding-block: 8px;
|
|
53
|
+
/** Mozilla Firefox */
|
|
54
|
+
}
|
|
55
|
+
:host(c-slider) .c-slider__label {
|
|
56
|
+
display: block;
|
|
57
|
+
margin-bottom: 16px;
|
|
58
|
+
margin-top: -8px;
|
|
59
|
+
}
|
|
60
|
+
:host(c-slider) .c-slider__label span.required {
|
|
61
|
+
color: var(--c-error-600);
|
|
62
|
+
}
|
|
63
|
+
:host(c-slider) .c-slider__wrapper {
|
|
64
|
+
padding-inline: 10px;
|
|
65
|
+
position: relative;
|
|
66
|
+
/** Mozilla Firefox */
|
|
67
|
+
}
|
|
68
|
+
@-moz-document url-prefix() {
|
|
69
|
+
:host(c-slider) .c-slider__wrapper {
|
|
70
|
+
padding-inline: 0;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
:host(c-slider) input[type=range] {
|
|
74
|
+
align-items: center;
|
|
75
|
+
appearance: none;
|
|
76
|
+
background-color: transparent;
|
|
77
|
+
display: flex;
|
|
78
|
+
height: 8px;
|
|
79
|
+
margin: 0;
|
|
80
|
+
position: relative;
|
|
81
|
+
width: 100%;
|
|
82
|
+
}
|
|
83
|
+
:host(c-slider) input[type=range]:focus-visible {
|
|
84
|
+
--_c-slider-outline: 2px var(--_c-slider-thumb-background-color) solid;
|
|
85
|
+
outline: none;
|
|
86
|
+
}
|
|
87
|
+
:host(c-slider) input[type=range]::-webkit-slider-runnable-track {
|
|
88
|
+
width: calc(100% - 20px);
|
|
89
|
+
margin: 0 -20px;
|
|
90
|
+
}
|
|
91
|
+
:host(c-slider) input[type=range]:active {
|
|
92
|
+
--_c-slider-thumb-scale: 1.33;
|
|
93
|
+
--_c-slider-thumb-shadow-size: 0;
|
|
94
|
+
}
|
|
95
|
+
:host(c-slider) input[type=range]::-webkit-slider-container {
|
|
96
|
+
display: flex;
|
|
97
|
+
padding: 0 10px;
|
|
98
|
+
}
|
|
99
|
+
:host(c-slider) input[type=range]::-webkit-slider-thumb {
|
|
100
|
+
appearance: none;
|
|
101
|
+
background-color: var(--_c-slider-thumb-background-color);
|
|
102
|
+
border-radius: 100%;
|
|
103
|
+
cursor: pointer;
|
|
104
|
+
height: 24px;
|
|
105
|
+
outline-offset: 4px;
|
|
106
|
+
outline: var(--_c-slider-outline);
|
|
107
|
+
position: relative;
|
|
108
|
+
transform-origin: center;
|
|
109
|
+
transform: scale(var(--_c-slider-thumb-scale));
|
|
110
|
+
transition: box-shadow 0.3s cubic-bezier(0.075, 0.82, 0.165, 1), transform 0.3s cubic-bezier(0.075, 0.82, 0.165, 1);
|
|
111
|
+
width: 24px;
|
|
112
|
+
z-index: 1;
|
|
113
|
+
}
|
|
114
|
+
:host(c-slider) input[type=range]::-webkit-slider-thumb:hover {
|
|
115
|
+
box-shadow: 0 0 0 var(--_c-slider-thumb-shadow-size) var(--_c-slider-thumb-background-color-hover);
|
|
116
|
+
}
|
|
117
|
+
:host(c-slider) input[type=range][disabled] {
|
|
118
|
+
--_c-slider-background-color: var(--_c-slider-background-color-disabled);
|
|
119
|
+
--_c-slider-background-color-active: var(--_c-slider-background-color-active-disabled);
|
|
120
|
+
--_c-slider-thumb-background-color: var(--_c-slider-thumb-background-color-disabled);
|
|
121
|
+
pointer-events: none;
|
|
122
|
+
}
|
|
123
|
+
@-moz-document url-prefix() {
|
|
124
|
+
:host(c-slider) input[type=range]::-moz-range-thumb {
|
|
125
|
+
appearance: none;
|
|
126
|
+
background-color: var(--_c-slider-thumb-background-color);
|
|
127
|
+
border-radius: 100%;
|
|
128
|
+
border: 0;
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
height: 24px;
|
|
131
|
+
outline-offset: 2px;
|
|
132
|
+
outline: var(--_c-slider-outline);
|
|
133
|
+
position: relative;
|
|
134
|
+
transform-origin: center;
|
|
135
|
+
transform: scale(var(--_c-slider-thumb-scale));
|
|
136
|
+
transition: box-shadow 0.3s cubic-bezier(0.075, 0.82, 0.165, 1), transform 0.3s cubic-bezier(0.075, 0.82, 0.165, 1);
|
|
137
|
+
width: 24px;
|
|
138
|
+
z-index: 1;
|
|
139
|
+
}
|
|
140
|
+
:host(c-slider) input[type=range]::-moz-range-thumb:hover {
|
|
141
|
+
box-shadow: 0 0 0 var(--_c-slider-thumb-shadow-size) var(--_c-slider-thumb-background-color-hover);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
:host(c-slider) .c-slider__tooltip-wrapper {
|
|
145
|
+
height: 0;
|
|
146
|
+
margin-inline: 2px;
|
|
147
|
+
position: relative;
|
|
148
|
+
/** Mozilla Firefox */
|
|
149
|
+
}
|
|
150
|
+
@-moz-document url-prefix() {
|
|
151
|
+
:host(c-slider) .c-slider__tooltip-wrapper {
|
|
152
|
+
margin-inline: 12px;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
:host(c-slider) .c-slider__tooltip-wrapper span {
|
|
156
|
+
align-items: center;
|
|
157
|
+
border-radius: 50%;
|
|
158
|
+
box-sizing: border-box;
|
|
159
|
+
display: inline-flex;
|
|
160
|
+
height: 24px;
|
|
161
|
+
justify-content: center;
|
|
162
|
+
left: calc(1% * var(--_c-slider-position));
|
|
163
|
+
opacity: var(--_c-slider-tooltip-opacity);
|
|
164
|
+
pointer-events: none;
|
|
165
|
+
position: absolute;
|
|
166
|
+
transform: translate(-50%, var(--_c-slider-tooltip-y));
|
|
167
|
+
transition: opacity 0.3s cubic-bezier(0.075, 0.82, 0.165, 1), transform 0.3s cubic-bezier(0.075, 0.82, 0.165, 1);
|
|
168
|
+
width: 24px;
|
|
169
|
+
}
|
|
170
|
+
:host(c-slider) .c-slider__tooltip-wrapper span::before {
|
|
171
|
+
align-items: center;
|
|
172
|
+
background: var(--_c-slider-tooltip-background-color);
|
|
173
|
+
border-radius: 4px;
|
|
174
|
+
bottom: 100%;
|
|
175
|
+
color: var(--_c-slider-tooltip-text-color);
|
|
176
|
+
content: attr(data-tooltip);
|
|
177
|
+
display: inline-flex;
|
|
178
|
+
flex-wrap: nowrap;
|
|
179
|
+
height: 30px;
|
|
180
|
+
padding: 6px;
|
|
181
|
+
position: absolute;
|
|
182
|
+
top: -42px;
|
|
183
|
+
white-space: nowrap;
|
|
184
|
+
}
|
|
185
|
+
:host(c-slider) .c-slider__tooltip-wrapper span::after {
|
|
186
|
+
border-left: 6px solid transparent;
|
|
187
|
+
border-right: 6px solid transparent;
|
|
188
|
+
border-top: 6px solid var(--_c-slider-tooltip-background-color);
|
|
189
|
+
content: "";
|
|
190
|
+
height: 0;
|
|
191
|
+
left: 50%;
|
|
192
|
+
margin: -42px 0 0 -6px;
|
|
193
|
+
position: absolute;
|
|
194
|
+
width: 0;
|
|
195
|
+
}
|
|
196
|
+
:host(c-slider) .c-slider__ticks {
|
|
197
|
+
--c-slider-tick-color: var(--c-tertiary-400);
|
|
198
|
+
align-items: center;
|
|
199
|
+
background: linear-gradient(to right, var(--_c-slider-background-color-active) calc(1% * var(--_c-slider-position)), var(--_c-slider-background-color) calc(1% * var(--_c-slider-position)));
|
|
200
|
+
border-radius: 100vw;
|
|
201
|
+
display: flex;
|
|
202
|
+
height: 8px;
|
|
203
|
+
justify-content: space-between;
|
|
204
|
+
margin: -8px auto 0;
|
|
205
|
+
pointer-events: none;
|
|
206
|
+
position: relative;
|
|
207
|
+
width: calc(100% - 16px);
|
|
208
|
+
z-index: -1;
|
|
209
|
+
/** Mozilla Firefox */
|
|
210
|
+
}
|
|
211
|
+
@-moz-document url-prefix() {
|
|
212
|
+
:host(c-slider) .c-slider__ticks {
|
|
213
|
+
width: calc(100% - 20px);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
:host(c-slider) .c-slider__ticks--disabled {
|
|
217
|
+
--_c-slider-background-color-active: var(--_c-slider-background-color-active-disabled);
|
|
218
|
+
}
|
|
219
|
+
:host(c-slider) .c-slider__ticks span {
|
|
220
|
+
border-radius: 50%;
|
|
221
|
+
font-size: 12px;
|
|
222
|
+
height: 4px;
|
|
223
|
+
padding: 0;
|
|
224
|
+
position: relative;
|
|
225
|
+
width: 4px;
|
|
226
|
+
}
|
|
227
|
+
:host(c-slider) .c-slider__ticks span.ticks {
|
|
228
|
+
background-color: var(--_c-slider-tick-color);
|
|
229
|
+
}
|
|
230
|
+
:host(c-slider) .c-slider__ticks span.ticks.active {
|
|
231
|
+
background-color: var(--_c-slider-tick-color-active);
|
|
232
|
+
}
|
|
233
|
+
:host(c-slider) .c-slider__ticks span.ticks:first-child, :host(c-slider) .c-slider__ticks span.ticks:last-child {
|
|
234
|
+
background-color: transparent;
|
|
235
|
+
}
|
|
236
|
+
:host(c-slider) .c-slider__ticks span.labels::after {
|
|
237
|
+
content: attr(data-value);
|
|
238
|
+
left: 2px;
|
|
239
|
+
position: absolute;
|
|
240
|
+
top: 16px;
|
|
241
|
+
transform: translate(-50%);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
:host(c-slider.c-slider--labels) {
|
|
245
|
+
padding-bottom: 24px;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
:host(c-slider:focus-within),
|
|
249
|
+
:host(c-slider:hover) {
|
|
250
|
+
--_c-slider-tooltip-opacity: 1;
|
|
251
|
+
--_c-slider-tooltip-y: -8px;
|
|
252
|
+
}
|
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
import { Host, h, } from "@stencil/core";
|
|
2
|
+
export class CSlider {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.hostId = undefined;
|
|
5
|
+
this.hostName = undefined;
|
|
6
|
+
this.ariaLabel = undefined;
|
|
7
|
+
this.max = '100';
|
|
8
|
+
this.min = '0';
|
|
9
|
+
this.step = '1';
|
|
10
|
+
this.value = '50';
|
|
11
|
+
this.unit = '%';
|
|
12
|
+
this.ticks = false;
|
|
13
|
+
this.labels = false;
|
|
14
|
+
this.disableTooltip = false;
|
|
15
|
+
this.label = undefined;
|
|
16
|
+
this.disabled = false;
|
|
17
|
+
this.segments = '10';
|
|
18
|
+
this.trackPosition = undefined;
|
|
19
|
+
this.tickPositions = [];
|
|
20
|
+
}
|
|
21
|
+
onSegmentChange() {
|
|
22
|
+
this._calculateTickPositions();
|
|
23
|
+
}
|
|
24
|
+
onValueChange(value) {
|
|
25
|
+
this._calculateTrackPosition();
|
|
26
|
+
requestAnimationFrame(() => {
|
|
27
|
+
this._inputElement.value = value.toString();
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
_formatNumber(number, decimals = 0) {
|
|
31
|
+
return new Intl.NumberFormat('fi-FI', {
|
|
32
|
+
maximumFractionDigits: decimals,
|
|
33
|
+
minimumFractionDigits: decimals,
|
|
34
|
+
}).format(number);
|
|
35
|
+
}
|
|
36
|
+
_calculateTickPositions() {
|
|
37
|
+
this.tickPositions = [...new Array(+this.segments + 1)].map((_, index) => {
|
|
38
|
+
const fraction = +this.max / +this.segments;
|
|
39
|
+
return (index * fraction).toString();
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
_calculateTrackPosition() {
|
|
43
|
+
this.trackPosition =
|
|
44
|
+
((+this.value - +this.min) / (+this.max - +this.min)) * 100;
|
|
45
|
+
}
|
|
46
|
+
_onInput(event) {
|
|
47
|
+
const { value } = event.target;
|
|
48
|
+
this.changeValue.emit(typeof this.value === 'number' ? +value : value);
|
|
49
|
+
this._calculateTrackPosition();
|
|
50
|
+
}
|
|
51
|
+
_isActive(value) {
|
|
52
|
+
return this.trackPosition >= (100 / +this.max) * value;
|
|
53
|
+
}
|
|
54
|
+
componentWillLoad() {
|
|
55
|
+
CSlider._uniqueId += 1;
|
|
56
|
+
}
|
|
57
|
+
componentDidLoad() {
|
|
58
|
+
this._calculateTrackPosition();
|
|
59
|
+
this._calculateTickPositions();
|
|
60
|
+
requestAnimationFrame(() => {
|
|
61
|
+
this._inputElement.value = this.value.toString();
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
render() {
|
|
65
|
+
const classes = {
|
|
66
|
+
'c-slider': true,
|
|
67
|
+
'c-slider--labels': this.labels,
|
|
68
|
+
};
|
|
69
|
+
const styles = {
|
|
70
|
+
'--_c-slider-position': `${this.trackPosition}`,
|
|
71
|
+
};
|
|
72
|
+
return (h(Host, { class: classes, style: styles }, !!this.label && (h("label", { class: "c-slider__label" }, !!this.label && this.label)), h("div", { class: "c-slider__wrapper" }, !this.disableTooltip && (h("div", { class: "c-slider__tooltip-wrapper", "aria-hidden": "true" }, h("span", { "data-tooltip": `${this._formatNumber(+this.value)}${this.unit}` }))), h("input", { ref: (el) => (this._inputElement = el), "aria-label": this.ariaLabel || this.label, "aria-valuenow": this.value, "aria-valuetext": `${this.value}${this.unit}`, "aria-valuemin": this.min, "aria-valuemax": this.max, type: "range", name: this.hostName, id: this.hostId || `c-slider__${CSlider._uniqueId}`, min: this.min, max: this.max, step: this.step, disabled: this.disabled, onInput: (event) => this._onInput(event) })), h("div", { class: {
|
|
73
|
+
'c-slider__ticks': true,
|
|
74
|
+
'c-slider__ticks--disabled': this.disabled,
|
|
75
|
+
}, "aria-hidden": "true" }, this.tickPositions.map((position) => (h("span", { class: {
|
|
76
|
+
active: this._isActive(Math.round(+position)),
|
|
77
|
+
ticks: this.ticks,
|
|
78
|
+
labels: this.labels,
|
|
79
|
+
}, "data-value": this._formatNumber(Math.round(+position)) }))))));
|
|
80
|
+
}
|
|
81
|
+
static get is() { return "c-slider"; }
|
|
82
|
+
static get encapsulation() { return "shadow"; }
|
|
83
|
+
static get originalStyleUrls() {
|
|
84
|
+
return {
|
|
85
|
+
"$": ["c-slider.scss"]
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
static get styleUrls() {
|
|
89
|
+
return {
|
|
90
|
+
"$": ["c-slider.css"]
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
static get properties() {
|
|
94
|
+
return {
|
|
95
|
+
"hostId": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"mutable": false,
|
|
98
|
+
"complexType": {
|
|
99
|
+
"original": "string",
|
|
100
|
+
"resolved": "string",
|
|
101
|
+
"references": {}
|
|
102
|
+
},
|
|
103
|
+
"required": false,
|
|
104
|
+
"optional": false,
|
|
105
|
+
"docs": {
|
|
106
|
+
"tags": [],
|
|
107
|
+
"text": "Id of the element"
|
|
108
|
+
},
|
|
109
|
+
"attribute": "id",
|
|
110
|
+
"reflect": false
|
|
111
|
+
},
|
|
112
|
+
"hostName": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"mutable": false,
|
|
115
|
+
"complexType": {
|
|
116
|
+
"original": "string",
|
|
117
|
+
"resolved": "string",
|
|
118
|
+
"references": {}
|
|
119
|
+
},
|
|
120
|
+
"required": false,
|
|
121
|
+
"optional": false,
|
|
122
|
+
"docs": {
|
|
123
|
+
"tags": [],
|
|
124
|
+
"text": "Id of the element"
|
|
125
|
+
},
|
|
126
|
+
"attribute": "name",
|
|
127
|
+
"reflect": false
|
|
128
|
+
},
|
|
129
|
+
"ariaLabel": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"mutable": false,
|
|
132
|
+
"complexType": {
|
|
133
|
+
"original": "string",
|
|
134
|
+
"resolved": "string",
|
|
135
|
+
"references": {}
|
|
136
|
+
},
|
|
137
|
+
"required": false,
|
|
138
|
+
"optional": false,
|
|
139
|
+
"docs": {
|
|
140
|
+
"tags": [],
|
|
141
|
+
"text": "Aria label"
|
|
142
|
+
},
|
|
143
|
+
"attribute": "aria-label",
|
|
144
|
+
"reflect": false
|
|
145
|
+
},
|
|
146
|
+
"max": {
|
|
147
|
+
"type": "string",
|
|
148
|
+
"mutable": false,
|
|
149
|
+
"complexType": {
|
|
150
|
+
"original": "string",
|
|
151
|
+
"resolved": "string",
|
|
152
|
+
"references": {}
|
|
153
|
+
},
|
|
154
|
+
"required": false,
|
|
155
|
+
"optional": false,
|
|
156
|
+
"docs": {
|
|
157
|
+
"tags": [],
|
|
158
|
+
"text": "Max value"
|
|
159
|
+
},
|
|
160
|
+
"attribute": "max",
|
|
161
|
+
"reflect": false,
|
|
162
|
+
"defaultValue": "'100'"
|
|
163
|
+
},
|
|
164
|
+
"min": {
|
|
165
|
+
"type": "string",
|
|
166
|
+
"mutable": false,
|
|
167
|
+
"complexType": {
|
|
168
|
+
"original": "string",
|
|
169
|
+
"resolved": "string",
|
|
170
|
+
"references": {}
|
|
171
|
+
},
|
|
172
|
+
"required": false,
|
|
173
|
+
"optional": false,
|
|
174
|
+
"docs": {
|
|
175
|
+
"tags": [],
|
|
176
|
+
"text": "Min value"
|
|
177
|
+
},
|
|
178
|
+
"attribute": "min",
|
|
179
|
+
"reflect": false,
|
|
180
|
+
"defaultValue": "'0'"
|
|
181
|
+
},
|
|
182
|
+
"step": {
|
|
183
|
+
"type": "string",
|
|
184
|
+
"mutable": false,
|
|
185
|
+
"complexType": {
|
|
186
|
+
"original": "string",
|
|
187
|
+
"resolved": "string",
|
|
188
|
+
"references": {}
|
|
189
|
+
},
|
|
190
|
+
"required": false,
|
|
191
|
+
"optional": false,
|
|
192
|
+
"docs": {
|
|
193
|
+
"tags": [],
|
|
194
|
+
"text": "Step"
|
|
195
|
+
},
|
|
196
|
+
"attribute": "step",
|
|
197
|
+
"reflect": false,
|
|
198
|
+
"defaultValue": "'1'"
|
|
199
|
+
},
|
|
200
|
+
"value": {
|
|
201
|
+
"type": "any",
|
|
202
|
+
"mutable": false,
|
|
203
|
+
"complexType": {
|
|
204
|
+
"original": "string | number",
|
|
205
|
+
"resolved": "number | string",
|
|
206
|
+
"references": {}
|
|
207
|
+
},
|
|
208
|
+
"required": false,
|
|
209
|
+
"optional": false,
|
|
210
|
+
"docs": {
|
|
211
|
+
"tags": [],
|
|
212
|
+
"text": "Value"
|
|
213
|
+
},
|
|
214
|
+
"attribute": "value",
|
|
215
|
+
"reflect": false,
|
|
216
|
+
"defaultValue": "'50'"
|
|
217
|
+
},
|
|
218
|
+
"unit": {
|
|
219
|
+
"type": "string",
|
|
220
|
+
"mutable": false,
|
|
221
|
+
"complexType": {
|
|
222
|
+
"original": "string",
|
|
223
|
+
"resolved": "string",
|
|
224
|
+
"references": {}
|
|
225
|
+
},
|
|
226
|
+
"required": false,
|
|
227
|
+
"optional": false,
|
|
228
|
+
"docs": {
|
|
229
|
+
"tags": [],
|
|
230
|
+
"text": "Unit"
|
|
231
|
+
},
|
|
232
|
+
"attribute": "unit",
|
|
233
|
+
"reflect": false,
|
|
234
|
+
"defaultValue": "'%'"
|
|
235
|
+
},
|
|
236
|
+
"ticks": {
|
|
237
|
+
"type": "boolean",
|
|
238
|
+
"mutable": false,
|
|
239
|
+
"complexType": {
|
|
240
|
+
"original": "boolean",
|
|
241
|
+
"resolved": "boolean",
|
|
242
|
+
"references": {}
|
|
243
|
+
},
|
|
244
|
+
"required": false,
|
|
245
|
+
"optional": false,
|
|
246
|
+
"docs": {
|
|
247
|
+
"tags": [],
|
|
248
|
+
"text": "Thow ticks"
|
|
249
|
+
},
|
|
250
|
+
"attribute": "ticks",
|
|
251
|
+
"reflect": false,
|
|
252
|
+
"defaultValue": "false"
|
|
253
|
+
},
|
|
254
|
+
"labels": {
|
|
255
|
+
"type": "boolean",
|
|
256
|
+
"mutable": false,
|
|
257
|
+
"complexType": {
|
|
258
|
+
"original": "boolean",
|
|
259
|
+
"resolved": "boolean",
|
|
260
|
+
"references": {}
|
|
261
|
+
},
|
|
262
|
+
"required": false,
|
|
263
|
+
"optional": false,
|
|
264
|
+
"docs": {
|
|
265
|
+
"tags": [],
|
|
266
|
+
"text": "Show tick labels"
|
|
267
|
+
},
|
|
268
|
+
"attribute": "labels",
|
|
269
|
+
"reflect": false,
|
|
270
|
+
"defaultValue": "false"
|
|
271
|
+
},
|
|
272
|
+
"disableTooltip": {
|
|
273
|
+
"type": "boolean",
|
|
274
|
+
"mutable": false,
|
|
275
|
+
"complexType": {
|
|
276
|
+
"original": "boolean",
|
|
277
|
+
"resolved": "boolean",
|
|
278
|
+
"references": {}
|
|
279
|
+
},
|
|
280
|
+
"required": false,
|
|
281
|
+
"optional": false,
|
|
282
|
+
"docs": {
|
|
283
|
+
"tags": [],
|
|
284
|
+
"text": "Disable tooltip"
|
|
285
|
+
},
|
|
286
|
+
"attribute": "disable-tooltip",
|
|
287
|
+
"reflect": false,
|
|
288
|
+
"defaultValue": "false"
|
|
289
|
+
},
|
|
290
|
+
"label": {
|
|
291
|
+
"type": "string",
|
|
292
|
+
"mutable": false,
|
|
293
|
+
"complexType": {
|
|
294
|
+
"original": "string",
|
|
295
|
+
"resolved": "string",
|
|
296
|
+
"references": {}
|
|
297
|
+
},
|
|
298
|
+
"required": false,
|
|
299
|
+
"optional": false,
|
|
300
|
+
"docs": {
|
|
301
|
+
"tags": [],
|
|
302
|
+
"text": "Label of the slider"
|
|
303
|
+
},
|
|
304
|
+
"attribute": "label",
|
|
305
|
+
"reflect": false
|
|
306
|
+
},
|
|
307
|
+
"disabled": {
|
|
308
|
+
"type": "boolean",
|
|
309
|
+
"mutable": false,
|
|
310
|
+
"complexType": {
|
|
311
|
+
"original": "boolean",
|
|
312
|
+
"resolved": "boolean",
|
|
313
|
+
"references": {}
|
|
314
|
+
},
|
|
315
|
+
"required": false,
|
|
316
|
+
"optional": false,
|
|
317
|
+
"docs": {
|
|
318
|
+
"tags": [],
|
|
319
|
+
"text": "Disable the slider"
|
|
320
|
+
},
|
|
321
|
+
"attribute": "disabled",
|
|
322
|
+
"reflect": false,
|
|
323
|
+
"defaultValue": "false"
|
|
324
|
+
},
|
|
325
|
+
"segments": {
|
|
326
|
+
"type": "string",
|
|
327
|
+
"mutable": false,
|
|
328
|
+
"complexType": {
|
|
329
|
+
"original": "string",
|
|
330
|
+
"resolved": "string",
|
|
331
|
+
"references": {}
|
|
332
|
+
},
|
|
333
|
+
"required": false,
|
|
334
|
+
"optional": false,
|
|
335
|
+
"docs": {
|
|
336
|
+
"tags": [],
|
|
337
|
+
"text": "Segment count"
|
|
338
|
+
},
|
|
339
|
+
"attribute": "segments",
|
|
340
|
+
"reflect": false,
|
|
341
|
+
"defaultValue": "'10'"
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
static get states() {
|
|
346
|
+
return {
|
|
347
|
+
"trackPosition": {},
|
|
348
|
+
"tickPositions": {}
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
static get events() {
|
|
352
|
+
return [{
|
|
353
|
+
"method": "changeValue",
|
|
354
|
+
"name": "changeValue",
|
|
355
|
+
"bubbles": false,
|
|
356
|
+
"cancelable": true,
|
|
357
|
+
"composed": true,
|
|
358
|
+
"docs": {
|
|
359
|
+
"tags": [],
|
|
360
|
+
"text": "Emit value changes to parent"
|
|
361
|
+
},
|
|
362
|
+
"complexType": {
|
|
363
|
+
"original": "any",
|
|
364
|
+
"resolved": "any",
|
|
365
|
+
"references": {}
|
|
366
|
+
}
|
|
367
|
+
}];
|
|
368
|
+
}
|
|
369
|
+
static get watchers() {
|
|
370
|
+
return [{
|
|
371
|
+
"propName": "segments",
|
|
372
|
+
"methodName": "onSegmentChange"
|
|
373
|
+
}, {
|
|
374
|
+
"propName": "value",
|
|
375
|
+
"methodName": "onValueChange"
|
|
376
|
+
}];
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
CSlider._uniqueId = 0;
|
|
380
|
+
//# sourceMappingURL=c-slider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"c-slider.js","sourceRoot":"","sources":["../../../../src/components/c-slider/c-slider.tsx"],"names":[],"mappings":"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","sourcesContent":["import {\n Component,\n Event,\n EventEmitter,\n Host,\n Prop,\n State,\n Watch,\n h,\n} from '@stencil/core';\n\n/**\n * @group Form\n */\n@Component({\n tag: 'c-slider',\n styleUrl: 'c-slider.scss',\n shadow: true,\n})\nexport class CSlider {\n /**\n * Id of the element\n */\n @Prop({ attribute: 'id' }) hostId: string;\n\n /**\n * Id of the element\n */\n @Prop({ attribute: 'name' }) hostName: string;\n\n /**\n * Aria label\n */\n @Prop({ attribute: 'aria-label' }) ariaLabel: string;\n\n /**\n * Max value\n */\n @Prop() max = '100';\n\n /**\n * Min value\n */\n @Prop() min = '0';\n\n /**\n * Step\n */\n @Prop() step = '1';\n\n /**\n * Value\n */\n @Prop() value: string | number = '50';\n\n /**\n * Unit\n */\n @Prop() unit = '%';\n\n /**\n * Thow ticks\n */\n @Prop() ticks = false;\n\n /**\n * Show tick labels\n */\n @Prop() labels = false;\n\n /**\n * Disable tooltip\n */\n @Prop() disableTooltip = false;\n\n /**\n * Label of the slider\n */\n @Prop() label: string;\n\n /**\n * Disable the slider\n */\n @Prop() disabled = false;\n\n /**\n * Segment count\n */\n @Prop() segments = '10';\n\n /**\n * Emit value changes to parent\n */\n @Event({ bubbles: false }) changeValue: EventEmitter;\n\n @State() trackPosition: number;\n\n @State() tickPositions: string[] = [];\n\n private static _uniqueId = 0;\n\n private _inputElement: HTMLInputElement;\n\n @Watch('segments')\n onSegmentChange() {\n this._calculateTickPositions();\n }\n\n @Watch('value')\n onValueChange(value) {\n this._calculateTrackPosition();\n\n requestAnimationFrame(() => {\n this._inputElement.value = value.toString();\n });\n }\n\n private _formatNumber(number: number, decimals = 0) {\n return new Intl.NumberFormat('fi-FI', {\n maximumFractionDigits: decimals,\n minimumFractionDigits: decimals,\n }).format(number);\n }\n\n private _calculateTickPositions() {\n this.tickPositions = [...new Array(+this.segments + 1)].map((_, index) => {\n const fraction = +this.max / +this.segments;\n\n return (index * fraction).toString();\n });\n }\n\n private _calculateTrackPosition() {\n this.trackPosition =\n ((+this.value - +this.min) / (+this.max - +this.min)) * 100;\n }\n\n private _onInput(event: Event) {\n const { value } = event.target as HTMLInputElement;\n\n this.changeValue.emit(typeof this.value === 'number' ? +value : value);\n\n this._calculateTrackPosition();\n }\n\n private _isActive(value: number) {\n return this.trackPosition >= (100 / +this.max) * value;\n }\n\n componentWillLoad() {\n CSlider._uniqueId += 1;\n }\n\n componentDidLoad() {\n this._calculateTrackPosition();\n\n this._calculateTickPositions();\n\n requestAnimationFrame(() => {\n this._inputElement.value = this.value.toString();\n });\n }\n\n render() {\n const classes = {\n 'c-slider': true,\n 'c-slider--labels': this.labels,\n };\n\n const styles = {\n '--_c-slider-position': `${this.trackPosition}`,\n };\n\n return (\n <Host class={classes} style={styles}>\n {!!this.label && (\n <label class=\"c-slider__label\">{!!this.label && this.label}</label>\n )}\n\n <div class=\"c-slider__wrapper\">\n {!this.disableTooltip && (\n <div class=\"c-slider__tooltip-wrapper\" aria-hidden=\"true\">\n <span\n data-tooltip={`${this._formatNumber(+this.value)}${this.unit}`}\n ></span>\n </div>\n )}\n\n <input\n ref={(el) => (this._inputElement = el)}\n aria-label={this.ariaLabel || this.label}\n aria-valuenow={this.value}\n aria-valuetext={`${this.value}${this.unit}`}\n aria-valuemin={this.min}\n aria-valuemax={this.max}\n type=\"range\"\n name={this.hostName}\n id={this.hostId || `c-slider__${CSlider._uniqueId}`}\n min={this.min}\n max={this.max}\n step={this.step}\n disabled={this.disabled}\n onInput={(event) => this._onInput(event)}\n />\n </div>\n\n <div\n class={{\n 'c-slider__ticks': true,\n 'c-slider__ticks--disabled': this.disabled,\n }}\n aria-hidden=\"true\"\n >\n {this.tickPositions.map((position) => (\n <span\n class={{\n active: this._isActive(Math.round(+position)),\n ticks: this.ticks,\n labels: this.labels,\n }}\n data-value={this._formatNumber(Math.round(+position))}\n ></span>\n ))}\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
|
|
|
2
2
|
import { m as mdiChevronRight } from './mdi.js';
|
|
3
3
|
import { d as defineCustomElement$2 } from './c-icon2.js';
|
|
4
4
|
|
|
5
|
-
const cAccordionItemCss = "html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host{--_c-accordion-item-header-background-color:var(--c-accordion-item-header-background-color, var(--c-primary-200));--_c-accordion-item-outline-color:var(--c-accordion-item-outline-color, var(--c-primary-600));--_c-accordion-item-text-color:var(--c-accordion-item-text-color, var(--c-primary-600));max-width:100%}:host summary::-webkit-details-marker{display:none}.c-accordion-item{--_c-accordion-item-indicator-rotation:rotate(0deg);--_c-accordion-item-content-height:0;--_c-accordion-item-min-height:46px;--_c-accordion-item-border-radius:6px;--_c-accordion-item-padding:12px;--_c-accordion-item-overflow:visible;--_c-accordion-item-outline-color-offset:
|
|
5
|
+
const cAccordionItemCss = "html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host{--_c-accordion-item-header-background-color:var(--c-accordion-item-header-background-color, var(--c-primary-200));--_c-accordion-item-outline-color:var(--c-accordion-item-outline-color, var(--c-primary-600));--_c-accordion-item-text-color:var(--c-accordion-item-text-color, var(--c-primary-600));max-width:100%}:host summary::-webkit-details-marker{display:none}.c-accordion-item{--_c-accordion-item-indicator-rotation:rotate(0deg);--_c-accordion-item-content-height:0;--_c-accordion-item-min-height:46px;--_c-accordion-item-border-radius:6px;--_c-accordion-item-padding:12px;--_c-accordion-item-overflow:visible;--_c-accordion-item-outline-color-offset:2px;display:block;overflow:var(--_c-accordion-item-overflow)}.c-accordion-item--expanding{--_c-accordion-item-overflow:hidden !important;--_c-accordion-item-outline-color:transparent}.c-accordion-item--expanded{--_c-accordion-item-content-height:auto;--_c-accordion-item-indicator-rotation:rotate(90deg);--_c-accordion-item-overflow:visible}.c-accordion-item--outlined{box-shadow:inset 0 0 0 2px var(--_c-accordion-item-header-background-color);border-radius:var(--_c-accordion-item-border-radius)}.c-accordion-item__header{min-height:var(--_c-accordion-item-min-height);user-select:none;background-color:var(--_c-accordion-item-header-background-color);display:grid;column-gap:8px;align-items:center;padding:0 var(--_c-accordion-item-padding);border-radius:var(--_c-accordion-item-border-radius);cursor:pointer;grid-template-columns:auto 1fr auto;border:none;text-align:left;margin:0;font-family:var(--c-font-family);position:relative}.c-accordion-item__header--expanded{cursor:default}.c-accordion-item__header--expanded.c-accordion-item__header--collapsable{cursor:pointer}.c-accordion-item__header:focus{outline:2px var(--_c-accordion-item-outline-color) solid;outline-offset:var(--_c-accordion-item-outline-color-offset)}@supports selector(:focus-visible){.c-accordion-item__header:focus{outline:none}}.c-accordion-item__header:focus-visible{outline:2px var(--_c-accordion-item-outline-color) solid;outline-offset:var(--_c-accordion-item-outline-color-offset)}.c-accordion-item__title{margin-top:0;margin-bottom:0;font-weight:500;font-size:16px;line-height:1;color:var(--_c-accordion-item-text-color)}.c-accordion-item__content{padding:16px}.c-accordion-item__content-wrapper{overflow:visible}.c-accordion-item__icon{height:24px;font-size:24px;color:var(--_c-accordion-item-text-color);display:flex;align-items:center}.c-accordion-item__icon>*{height:24px;display:flex;align-items:center}.c-accordion-item__indicator{display:flex;align-items:center;color:var(--_c-accordion-item-text-color)}.c-accordion-item__indicator c-icon{width:24px;height:24px !important;transform:var(--_c-accordion-item-indicator-rotation);transition:transform 0.3s ease}";
|
|
6
6
|
|
|
7
7
|
const CAccordionItem$1 = proxyCustomElement(class CAccordionItem extends HTMLElement {
|
|
8
8
|
constructor() {
|