4
4
normalisedClient ,
5
5
isInRange ,
6
6
isSelected ,
7
- getValueFromIndex
7
+ getValueFromIndex ,
8
+ isOutOfLimit
8
9
} from " ../utils.js" ;
9
10
export let range = false ;
10
11
export let min = 0 ;
@@ -16,6 +17,7 @@ export let vertical = false;
16
17
export let reversed = false ;
17
18
export let hoverable = true ;
18
19
export let disabled = false ;
20
+ export let limits = null ;
19
21
export let pipstep = void 0 ;
20
22
export let all = true ;
21
23
export let first = void 0 ;
@@ -64,6 +66,7 @@ function labelUp(pipValue, event) {
64
66
class = " pip first"
65
67
class: selected= {isSelected (min, values, precision)}
66
68
class: in - range= {isInRange (min, values, range)}
69
+ class: out- of - limit= {isOutOfLimit (min, limits)}
67
70
style= " {orientationStart}: 0%;"
68
71
data- val= {coerceFloat (min, precision)}
69
72
on: pointerdown= {(e ) => {
@@ -91,6 +94,7 @@ function labelUp(pipValue, event) {
91
94
class = " pip"
92
95
class: selected= {isSelected (val, values, precision)}
93
96
class: in - range= {isInRange (val, values, range)}
97
+ class: out- of - limit= {isOutOfLimit (val, limits)}
94
98
style= " {orientationStart}: {valueAsPercent(val, min, max, precision)}%;"
95
99
data- val= {val}
96
100
on: pointerdown= {(e ) => {
@@ -117,6 +121,7 @@ function labelUp(pipValue, event) {
117
121
class = " pip last"
118
122
class: selected= {isSelected (max, values, precision)}
119
123
class: in - range= {isInRange (max, values, range)}
124
+ class: out- of - limit= {isOutOfLimit (max, limits)}
120
125
style= " {orientationStart}: 100%;"
121
126
data- val= {coerceFloat (max, precision)}
122
127
on: pointerdown= {(e ) => {
@@ -151,6 +156,8 @@ function labelUp(pipValue, event) {
151
156
-- pip- hover- text: var (-- range- pip- hover- text, var (-- pip- hover));
152
157
-- pip- in - range: var (-- range- pip- in - range, var (-- pip- active));
153
158
-- pip- in - range- text: var (-- range- pip- in - range- text, var (-- pip- active- text));
159
+ -- pip- out- of - range: var (-- range- pip- out- of - range, #aebecf);
160
+ -- pip- out- of - range- text: var (-- range- pip- out- of - range- text, var (-- pip- out- of - range));
154
161
}
155
162
156
163
: global (.rangePips ) {
@@ -225,7 +232,7 @@ function labelUp(pipValue, event) {
225
232
background- color: var (-- pip- active);
226
233
}
227
234
228
- : global (.rangePips .hoverable : not (.disabled ) .pip : hover) {
235
+ : global (.rangePips .hoverable : not (.disabled ) .pip : not (. out - of - limit) : hover) {
229
236
color: darkslategrey;
230
237
color: var (-- pip- hover- text);
231
238
background- color: darkslategrey;
@@ -239,6 +246,13 @@ function labelUp(pipValue, event) {
239
246
background- color: var (-- pip- in - range);
240
247
}
241
248
249
+ : global (.rangePips .pip .out - of - limit ) {
250
+ color: #aebecf;
251
+ color: var (-- pip- out- of - range- text);
252
+ background- color: #aebecf;
253
+ background- color: var (-- pip- out- of - range);
254
+ }
255
+
242
256
: global (.rangePips .pip .selected ) {
243
257
height: 0 .75em ;
244
258
}
@@ -258,11 +272,13 @@ function labelUp(pipValue, event) {
258
272
left: 0 .75em ;
259
273
}
260
274
261
- : global (.rangePips .hoverable : not (.disabled ) .pip : not (.selected ): hover) {
275
+ : global (.rangePips .hoverable : not (.disabled ) .pip : not (.selected ): not (. out - of - limit) : hover) {
262
276
transition: none;
263
277
}
264
278
265
- : global (.rangePips .hoverable : not (.disabled ) .pip : not (.selected ): hover .pipVal ) {
279
+ : global (
280
+ .rangePips .hoverable : not (.disabled ) .pip : not (.selected ): not (.out - of - limit): hover .pipVal
281
+ ) {
266
282
transition: none;
267
283
font- weight: bold;
268
284
}
0 commit comments