@esri/calcite-components 1.0.0-next.323 → 1.0.0-next.324
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/calcite/calcite.esm.js +1 -1
- package/dist/calcite/p-7efe15d0.entry.js +5 -0
- package/dist/calcite/p-8e252799.system.js +1 -1
- package/dist/calcite/{p-3dd6830e.entry.js → p-9b117f75.entry.js} +1 -1
- package/dist/calcite/{p-f017cbc6.system.entry.js → p-ba1cabf2.system.entry.js} +1 -1
- package/dist/calcite/p-e2058b98.system.entry.js +5 -0
- package/dist/cjs/calcite-graph_2.cjs.entry.js +15 -4
- package/dist/cjs/calcite-tip_3.cjs.entry.js +1 -1
- package/dist/cjs/calcite.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/calcite-slider/calcite-slider.css +139 -160
- package/dist/collection/components/calcite-slider/calcite-slider.js +57 -22
- package/dist/collection/components/calcite-tip-manager/calcite-tip-manager.css +1 -1
- package/dist/components/calcite-slider.js +16 -4
- package/dist/components/calcite-tip-manager.js +1 -1
- package/dist/custom-elements/index.js +17 -6
- package/dist/esm/calcite-graph_2.entry.js +15 -4
- package/dist/esm/calcite-tip_3.entry.js +1 -1
- package/dist/esm/calcite.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/calcite-graph_2.entry.js +2 -2
- package/dist/esm-es5/calcite-tip_3.entry.js +1 -1
- package/dist/esm-es5/calcite.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/extras/docs-json.json +27 -1
- package/dist/types/components/calcite-slider/calcite-slider.d.ts +5 -0
- package/dist/types/components.d.ts +8 -0
- package/hydrate/index.js +17 -5
- package/package.json +1 -1
- package/readme.md +2 -2
- package/dist/calcite/p-94f690de.system.entry.js +0 -5
- package/dist/calcite/p-d575e6f4.entry.js +0 -5
|
@@ -90,6 +90,46 @@
|
|
|
90
90
|
display: none;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
.scale--s {
|
|
94
|
+
--calcite-slider-handle-size: 10px;
|
|
95
|
+
--calcite-slider-handle-extension-height: 6.5px;
|
|
96
|
+
--calcite-slider-container-font-size: var(--calcite-font-size--3);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.scale--s .handle__label,
|
|
100
|
+
.scale--s .tick__label {
|
|
101
|
+
line-height: .75rem;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.scale--m {
|
|
105
|
+
--calcite-slider-handle-size: 14px;
|
|
106
|
+
--calcite-slider-handle-extension-height: 8px;
|
|
107
|
+
--calcite-slider-container-font-size: var(--calcite-font-size--2);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.scale--m .handle__label,
|
|
111
|
+
.scale--m .tick__label {
|
|
112
|
+
line-height: 1rem;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.scale--l {
|
|
116
|
+
--calcite-slider-handle-size: 16px;
|
|
117
|
+
--calcite-slider-handle-extension-height: 10.5px;
|
|
118
|
+
--calcite-slider-container-font-size: var(--calcite-font-size--1);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.scale--l .handle__label,
|
|
122
|
+
.scale--l .tick__label {
|
|
123
|
+
line-height: 1rem;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.handle__label,
|
|
127
|
+
.tick__label {
|
|
128
|
+
font-weight: var(--calcite-font-weight-medium);
|
|
129
|
+
color: var(--calcite-ui-text-2);
|
|
130
|
+
font-size: var(--calcite-slider-container-font-size);
|
|
131
|
+
}
|
|
132
|
+
|
|
93
133
|
:host {
|
|
94
134
|
display: block;
|
|
95
135
|
}
|
|
@@ -97,8 +137,11 @@
|
|
|
97
137
|
.container {
|
|
98
138
|
display: block;
|
|
99
139
|
position: relative;
|
|
100
|
-
padding:
|
|
101
|
-
margin:
|
|
140
|
+
padding: calc(var(--calcite-slider-handle-size) * 0.5);
|
|
141
|
+
margin: calc(var(--calcite-slider-handle-size) * 0.5) 0;
|
|
142
|
+
--calcite-slider-full-handle-height: calc(
|
|
143
|
+
var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height)
|
|
144
|
+
);
|
|
102
145
|
}
|
|
103
146
|
|
|
104
147
|
:host([disabled]) {
|
|
@@ -111,34 +154,29 @@
|
|
|
111
154
|
background-color: var(--calcite-ui-text-3);
|
|
112
155
|
}
|
|
113
156
|
|
|
114
|
-
:
|
|
115
|
-
|
|
157
|
+
.scale--s .thumb:not(.thumb--precise) {
|
|
158
|
+
--calcite-slider-thumb-y-offset: -6px;
|
|
116
159
|
}
|
|
117
160
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
* with text elements to prevent overlap
|
|
121
|
-
*/
|
|
122
|
-
|
|
123
|
-
:host([label-handles]) .container,
|
|
124
|
-
:host([precise]:not([precise=false])) .container {
|
|
125
|
-
margin-top: 21px;
|
|
161
|
+
.scale--m .thumb:not(.thumb--precise) {
|
|
162
|
+
--calcite-slider-thumb-y-offset: -8px;
|
|
126
163
|
}
|
|
127
164
|
|
|
128
|
-
:
|
|
129
|
-
:
|
|
130
|
-
margin-bottom: 21px;
|
|
165
|
+
.scale--l .thumb:not(.thumb--precise) {
|
|
166
|
+
--calcite-slider-thumb-y-offset: -9px;
|
|
131
167
|
}
|
|
132
168
|
|
|
133
|
-
:host([precise]:not([
|
|
134
|
-
|
|
169
|
+
:host([precise]:not([has-histogram])) .container .thumb--value {
|
|
170
|
+
--calcite-slider-thumb-y-offset: calc(var(--calcite-slider-full-handle-height) * -1);
|
|
135
171
|
}
|
|
136
172
|
|
|
137
|
-
|
|
138
|
-
|
|
173
|
+
.thumb-container {
|
|
174
|
+
max-width: 100%;
|
|
175
|
+
position: relative;
|
|
139
176
|
}
|
|
140
177
|
|
|
141
178
|
.thumb {
|
|
179
|
+
--calcite-slider-thumb-x-offset: calc(var(--calcite-slider-handle-size) * 0.5);
|
|
142
180
|
position: absolute;
|
|
143
181
|
border-style: none;
|
|
144
182
|
background-color: transparent;
|
|
@@ -151,16 +189,7 @@
|
|
|
151
189
|
flex-direction: column;
|
|
152
190
|
align-items: center;
|
|
153
191
|
font-family: inherit;
|
|
154
|
-
|
|
155
|
-
transform: translate(7px, -8px);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.thumb .handle__label {
|
|
159
|
-
font-size: var(--calcite-font-size--2);
|
|
160
|
-
font-weight: 500;
|
|
161
|
-
line-height: 1;
|
|
162
|
-
color: var(--calcite-ui-text-2);
|
|
163
|
-
margin-bottom: 5px;
|
|
192
|
+
transform: translate(var(--calcite-slider-thumb-x-offset), var(--calcite-slider-thumb-y-offset));
|
|
164
193
|
}
|
|
165
194
|
|
|
166
195
|
.thumb .handle__label.static, .thumb .handle__label.transformed {
|
|
@@ -180,18 +209,18 @@
|
|
|
180
209
|
outline-offset: 0;
|
|
181
210
|
outline-color: transparent;
|
|
182
211
|
transition: outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;
|
|
183
|
-
height: 14px;
|
|
184
|
-
width: 14px;
|
|
185
212
|
box-sizing: border-box;
|
|
186
|
-
border-radius:
|
|
213
|
+
border-radius: 9999px;
|
|
187
214
|
background-color: var(--calcite-ui-foreground-1);
|
|
215
|
+
height: var(--calcite-slider-handle-size);
|
|
216
|
+
width: var(--calcite-slider-handle-size);
|
|
188
217
|
box-shadow: 0 0 0 2px var(--calcite-ui-text-3) inset;
|
|
189
218
|
transition: border 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
|
|
190
219
|
}
|
|
191
220
|
|
|
192
221
|
.thumb .handle-extension {
|
|
193
|
-
width:
|
|
194
|
-
height:
|
|
222
|
+
width: 0.125rem;
|
|
223
|
+
height: var(--calcite-slider-handle-extension-height);
|
|
195
224
|
background-color: var(--calcite-ui-text-3);
|
|
196
225
|
}
|
|
197
226
|
|
|
@@ -206,112 +235,56 @@
|
|
|
206
235
|
.thumb:focus .handle {
|
|
207
236
|
outline: 2px solid var(--calcite-ui-brand);
|
|
208
237
|
outline-offset: 2px;
|
|
209
|
-
outline-offset: 2px;
|
|
210
238
|
}
|
|
211
239
|
|
|
212
240
|
.thumb:focus .handle-extension {
|
|
213
241
|
background-color: var(--calcite-ui-brand);
|
|
214
242
|
}
|
|
215
243
|
|
|
216
|
-
.thumb--minValue {
|
|
217
|
-
transform: translate(-
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
/* uncomment for helpful debugging UI */
|
|
221
|
-
|
|
222
|
-
:host([label-handles]) .thumb {
|
|
223
|
-
transform: translate(50%, -25px);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
:host([label-handles]) .thumb--minValue {
|
|
227
|
-
transform: translate(-50%, -25px);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
:host([has-histogram][label-handles]) .thumb {
|
|
231
|
-
transform: translate(50%, -8px);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
:host([has-histogram][label-handles]) .thumb .handle__label {
|
|
235
|
-
margin-bottom: unset;
|
|
236
|
-
margin-top: 5px;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
:host([has-histogram][label-handles]) .thumb--minValue {
|
|
240
|
-
transform: translate(-50%, -8px);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
:host([precise]:not([precise=false])) .thumb {
|
|
244
|
-
transform: translate(7px, -21px);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
:host([precise]:not([precise=false])) .thumb--minValue {
|
|
248
|
-
transform: translate(-7px, -2px);
|
|
244
|
+
.thumb.thumb--minValue {
|
|
245
|
+
transform: translate(calc(var(--calcite-slider-thumb-x-offset) * -1), var(--calcite-slider-thumb-y-offset));
|
|
249
246
|
}
|
|
250
247
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
margin-top: 5px;
|
|
248
|
+
.thumb.thumb--precise {
|
|
249
|
+
--calcite-slider-thumb-y-offset: -2px;
|
|
254
250
|
}
|
|
255
251
|
|
|
256
|
-
:host([
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
:host([has-histogram][precise]:not([precise=false])) .thumb--minValue {
|
|
261
|
-
transform: translate(-50%, -2px);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
:host([ticks][precise]:not([precise=false])) .thumb {
|
|
265
|
-
transform: translate(7px, -20px);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
:host([ticks][precise]:not([precise=false])) .thumb--minValue {
|
|
269
|
-
transform: translate(-7px, -3px);
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
:host([has-histogram][ticks][precise]:not([precise=false])) .thumb {
|
|
273
|
-
transform: translate(7px, -3px);
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
:host([has-histogram][ticks][precise]:not([precise=false])) .thumb--minValue {
|
|
277
|
-
transform: translate(-50%, -3px);
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
:host([label-handles][precise]:not([precise=false])) .thumb {
|
|
281
|
-
transform: translate(50%, -38px);
|
|
252
|
+
:host([label-handles]) .thumb {
|
|
253
|
+
--calcite-slider-thumb-x-offset: 50%;
|
|
282
254
|
}
|
|
283
255
|
|
|
284
|
-
:host([label-handles]
|
|
285
|
-
|
|
256
|
+
:host([label-handles]):host(:not([has-histogram])) .scale--s .thumb:not(.thumb--precise) {
|
|
257
|
+
--calcite-slider-thumb-y-offset: -23px;
|
|
286
258
|
}
|
|
287
259
|
|
|
288
|
-
:host([
|
|
289
|
-
|
|
260
|
+
:host([label-handles]):host(:not([has-histogram])) .scale--m .thumb:not(.thumb--precise) {
|
|
261
|
+
--calcite-slider-thumb-y-offset: -30px;
|
|
290
262
|
}
|
|
291
263
|
|
|
292
|
-
:host([
|
|
293
|
-
|
|
264
|
+
:host([label-handles]):host(:not([has-histogram])) .scale--l .thumb:not(.thumb--precise) {
|
|
265
|
+
--calcite-slider-thumb-y-offset: -32px;
|
|
294
266
|
}
|
|
295
267
|
|
|
296
|
-
:host([
|
|
297
|
-
|
|
268
|
+
:host([has-histogram][label-handles]) .handle__label,
|
|
269
|
+
:host([label-handles]:not([has-histogram])) .thumb--minValue.thumb--precise .handle__label {
|
|
270
|
+
margin-top: 0.5em;
|
|
298
271
|
}
|
|
299
272
|
|
|
300
|
-
:host([
|
|
301
|
-
|
|
273
|
+
:host(:not([has-histogram]):not([precise])) .handle__label,
|
|
274
|
+
:host([label-handles]:not([has-histogram])) .thumb--value .handle__label {
|
|
275
|
+
margin-bottom: 0.5em;
|
|
302
276
|
}
|
|
303
277
|
|
|
304
|
-
:host([
|
|
305
|
-
|
|
278
|
+
:host([label-handles][precise]):host(:not([has-histogram])) .scale--s .thumb--value {
|
|
279
|
+
--calcite-slider-thumb-y-offset: -33px;
|
|
306
280
|
}
|
|
307
281
|
|
|
308
|
-
:host([
|
|
309
|
-
|
|
282
|
+
:host([label-handles][precise]):host(:not([has-histogram])) .scale--m .thumb--value {
|
|
283
|
+
--calcite-slider-thumb-y-offset: -44px;
|
|
310
284
|
}
|
|
311
285
|
|
|
312
|
-
.thumb
|
|
313
|
-
|
|
314
|
-
z-index: 3;
|
|
286
|
+
:host([label-handles][precise]):host(:not([has-histogram])) .scale--l .thumb--value {
|
|
287
|
+
--calcite-slider-thumb-y-offset: -49px;
|
|
315
288
|
}
|
|
316
289
|
|
|
317
290
|
.thumb:focus .handle,
|
|
@@ -327,18 +300,17 @@
|
|
|
327
300
|
}
|
|
328
301
|
|
|
329
302
|
.track {
|
|
330
|
-
height:
|
|
303
|
+
height: 0.125rem;
|
|
331
304
|
border-radius: 0;
|
|
332
|
-
|
|
305
|
+
position: relative;
|
|
333
306
|
background-color: var(--calcite-ui-border-2);
|
|
334
307
|
transition: all 250ms ease-in;
|
|
335
|
-
position: relative;
|
|
336
308
|
}
|
|
337
309
|
|
|
338
310
|
.track__range {
|
|
339
311
|
position: absolute;
|
|
340
312
|
top: 0;
|
|
341
|
-
height:
|
|
313
|
+
height: 0.125rem;
|
|
342
314
|
background-color: var(--calcite-ui-brand);
|
|
343
315
|
}
|
|
344
316
|
|
|
@@ -347,23 +319,24 @@
|
|
|
347
319
|
}
|
|
348
320
|
|
|
349
321
|
.container--range .track__range:after {
|
|
350
|
-
content: "";
|
|
351
322
|
position: absolute;
|
|
352
|
-
top: -5px;
|
|
353
323
|
width: 100%;
|
|
354
|
-
|
|
324
|
+
content: "";
|
|
325
|
+
top: calc(var(--calcite-slider-full-handle-height) * 0.5 * -1);
|
|
326
|
+
height: calc(var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height));
|
|
355
327
|
}
|
|
356
328
|
|
|
357
329
|
.tick {
|
|
358
330
|
position: absolute;
|
|
331
|
+
width: 0.125rem;
|
|
332
|
+
height: 0.25rem;
|
|
333
|
+
border-width: 1px;
|
|
334
|
+
border-style: solid;
|
|
335
|
+
background-color: var(--calcite-ui-border-input);
|
|
336
|
+
border-color: var(--calcite-ui-foreground-1);
|
|
359
337
|
top: -2px;
|
|
360
|
-
width: 2px;
|
|
361
|
-
height: 4px;
|
|
362
|
-
left: var(--calcite-ui-border-1-offset);
|
|
363
|
-
margin-left: -2px;
|
|
364
|
-
border: 1px solid var(--calcite-ui-foreground-1);
|
|
365
|
-
background-color: var(--calcite-ui-border-1);
|
|
366
338
|
pointer-events: none;
|
|
339
|
+
margin-inline-start: calc(-1 * 0.125rem);
|
|
367
340
|
}
|
|
368
341
|
|
|
369
342
|
.tick--active {
|
|
@@ -371,43 +344,25 @@
|
|
|
371
344
|
}
|
|
372
345
|
|
|
373
346
|
.tick__label {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
font-weight: 500;
|
|
377
|
-
color: var(--calcite-ui-text-2);
|
|
378
|
-
width: 4em;
|
|
379
|
-
margin: 14px -2em;
|
|
380
|
-
text-align: center;
|
|
381
|
-
display: block;
|
|
347
|
+
display: flex;
|
|
348
|
+
justify-content: center;
|
|
382
349
|
pointer-events: none;
|
|
350
|
+
margin-top: 0.875rem;
|
|
383
351
|
}
|
|
384
352
|
|
|
385
353
|
.tick__label--min {
|
|
386
|
-
left: 0;
|
|
387
|
-
margin: 14px -3px;
|
|
388
|
-
text-align: left;
|
|
389
354
|
transition: opacity 150ms;
|
|
390
355
|
}
|
|
391
356
|
|
|
392
357
|
.tick__label--max {
|
|
393
|
-
left: unset;
|
|
394
|
-
right: 0;
|
|
395
|
-
margin: 14px -3px;
|
|
396
|
-
text-align: right;
|
|
397
358
|
transition: opacity 50ms;
|
|
398
359
|
}
|
|
399
360
|
|
|
400
361
|
:host([has-histogram][label-handles]) .tick__label--min,
|
|
401
|
-
:host([has-histogram][label-handles]) .tick__label--max
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
:host([has-histogram][precise]:not([precise=false])) .tick__label--min,
|
|
408
|
-
:host([has-histogram][precise]:not([precise=false])) .tick__label--max {
|
|
409
|
-
margin: 6px -3px;
|
|
410
|
-
font-weight: 300;
|
|
362
|
+
:host([has-histogram][label-handles]) .tick__label--max,
|
|
363
|
+
:host([has-histogram][precise]) .tick__label--min,
|
|
364
|
+
:host([has-histogram][precise]) .tick__label--max {
|
|
365
|
+
font-weight: var(--calcite-font-weight-normal);
|
|
411
366
|
color: var(--calcite-ui-text-3);
|
|
412
367
|
}
|
|
413
368
|
|
|
@@ -415,16 +370,40 @@
|
|
|
415
370
|
color: var(--calcite-ui-foreground-3);
|
|
416
371
|
}
|
|
417
372
|
|
|
418
|
-
:host([
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
373
|
+
:host([label-ticks][ticks]) .container {
|
|
374
|
+
padding-bottom: calc(0.875rem + var(--calcite-slider-container-font-size));
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
:host([has-histogram]):host([precise][label-handles]) .container {
|
|
378
|
+
padding-bottom: calc(var(--calcite-slider-full-handle-height) + 1em);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
:host([has-histogram]):host([label-handles]:not([precise])) .container {
|
|
382
|
+
padding-bottom: calc(var(--calcite-slider-handle-size) * 0.5 + 1em);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
:host([has-histogram]):host([precise]:not([label-handles])) .container {
|
|
386
|
+
padding-bottom: var(--calcite-slider-full-handle-height);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
:host(:not([has-histogram])):host([precise]:not([label-handles])) .container {
|
|
390
|
+
padding-top: var(--calcite-slider-full-handle-height);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
:host(:not([has-histogram])):host([precise]:not([label-handles])) .container--range {
|
|
394
|
+
padding-bottom: var(--calcite-slider-full-handle-height);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
:host(:not([has-histogram])):host([label-handles]:not([precise])) .container {
|
|
398
|
+
padding-top: calc(var(--calcite-slider-full-handle-height) + 4px);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
:host(:not([has-histogram])):host([label-handles][precise]) .container {
|
|
402
|
+
padding-top: calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px);
|
|
422
403
|
}
|
|
423
404
|
|
|
424
|
-
:host(
|
|
425
|
-
|
|
426
|
-
left: 0;
|
|
427
|
-
text-align: left;
|
|
405
|
+
:host(:not([has-histogram])):host([label-handles][precise]) .container--range {
|
|
406
|
+
padding-bottom: calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px);
|
|
428
407
|
}
|
|
429
408
|
|
|
430
409
|
::slotted(input[slot=hidden-form-input]) {
|
|
@@ -45,6 +45,10 @@ export class CalciteSlider {
|
|
|
45
45
|
this.step = 1;
|
|
46
46
|
/** Currently selected number (if single select) */
|
|
47
47
|
this.value = null;
|
|
48
|
+
/**
|
|
49
|
+
* Specify the scale of the slider, defaults to m
|
|
50
|
+
*/
|
|
51
|
+
this.scale = "m";
|
|
48
52
|
this.guid = `calcite-slider-${guid()}`;
|
|
49
53
|
this.isRange = false;
|
|
50
54
|
this.activeProp = "value";
|
|
@@ -259,7 +263,11 @@ export class CalciteSlider {
|
|
|
259
263
|
h("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue static" }, this.minValue && this.minValue.toLocaleString()),
|
|
260
264
|
h("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue transformed" }, this.minValue && this.minValue.toLocaleString())));
|
|
261
265
|
return (h(Host, { id: id, onTouchStart: this.handleTouchStart },
|
|
262
|
-
h("div", { class: {
|
|
266
|
+
h("div", { class: {
|
|
267
|
+
["container"]: true,
|
|
268
|
+
["container--range"]: this.isRange,
|
|
269
|
+
[`scale--${this.scale}`]: true
|
|
270
|
+
} },
|
|
263
271
|
this.renderGraph(),
|
|
264
272
|
h("div", { class: "track", ref: this.storeTrackRef },
|
|
265
273
|
h("div", { class: "track__range", onPointerDown: () => this.dragStart("minMaxValue"), style: {
|
|
@@ -280,27 +288,31 @@ export class CalciteSlider {
|
|
|
280
288
|
right: mirror ? tickOffset : ""
|
|
281
289
|
} }, this.renderTickLabel(tick)));
|
|
282
290
|
}))),
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
!this.
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
291
|
+
h("div", { class: "thumb-container" },
|
|
292
|
+
!this.precise && !this.labelHandles && this.isRange && minHandle,
|
|
293
|
+
!this.hasHistogram &&
|
|
294
|
+
!this.precise &&
|
|
295
|
+
this.labelHandles &&
|
|
296
|
+
this.isRange &&
|
|
297
|
+
minLabeledHandle,
|
|
298
|
+
this.precise && !this.labelHandles && this.isRange && minPreciseHandle,
|
|
299
|
+
this.precise && this.labelHandles && this.isRange && minLabeledPreciseHandle,
|
|
300
|
+
this.hasHistogram &&
|
|
301
|
+
!this.precise &&
|
|
302
|
+
this.labelHandles &&
|
|
303
|
+
this.isRange &&
|
|
304
|
+
minHistogramLabeledHandle,
|
|
305
|
+
!this.precise && !this.labelHandles && handle,
|
|
306
|
+
!this.hasHistogram && !this.precise && this.labelHandles && labeledHandle,
|
|
307
|
+
!this.hasHistogram && this.precise && !this.labelHandles && preciseHandle,
|
|
308
|
+
this.hasHistogram && this.precise && !this.labelHandles && histogramPreciseHandle,
|
|
309
|
+
!this.hasHistogram && this.precise && this.labelHandles && labeledPreciseHandle,
|
|
310
|
+
this.hasHistogram && !this.precise && this.labelHandles && histogramLabeledHandle,
|
|
311
|
+
this.hasHistogram &&
|
|
312
|
+
this.precise &&
|
|
313
|
+
this.labelHandles &&
|
|
314
|
+
histogramLabeledPreciseHandle,
|
|
315
|
+
h(HiddenFormInputSlot, { component: this })))));
|
|
304
316
|
}
|
|
305
317
|
renderGraph() {
|
|
306
318
|
return this.histogram ? (h("div", { class: "graph" },
|
|
@@ -1143,6 +1155,29 @@ export class CalciteSlider {
|
|
|
1143
1155
|
"attribute": "value",
|
|
1144
1156
|
"reflect": true,
|
|
1145
1157
|
"defaultValue": "null"
|
|
1158
|
+
},
|
|
1159
|
+
"scale": {
|
|
1160
|
+
"type": "string",
|
|
1161
|
+
"mutable": false,
|
|
1162
|
+
"complexType": {
|
|
1163
|
+
"original": "Scale",
|
|
1164
|
+
"resolved": "\"l\" | \"m\" | \"s\"",
|
|
1165
|
+
"references": {
|
|
1166
|
+
"Scale": {
|
|
1167
|
+
"location": "import",
|
|
1168
|
+
"path": "../interfaces"
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
},
|
|
1172
|
+
"required": false,
|
|
1173
|
+
"optional": false,
|
|
1174
|
+
"docs": {
|
|
1175
|
+
"tags": [],
|
|
1176
|
+
"text": "Specify the scale of the slider, defaults to m"
|
|
1177
|
+
},
|
|
1178
|
+
"attribute": "scale",
|
|
1179
|
+
"reflect": false,
|
|
1180
|
+
"defaultValue": "\"m\""
|
|
1146
1181
|
}
|
|
1147
1182
|
}; }
|
|
1148
1183
|
static get states() { return {
|
|
@@ -202,7 +202,7 @@ h5.heading {
|
|
|
202
202
|
transition: outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;
|
|
203
203
|
margin-top: 1px;
|
|
204
204
|
animation-name: none;
|
|
205
|
-
animation-duration:
|
|
205
|
+
animation-duration: var(--calcite-internal-animation-timing);
|
|
206
206
|
height: var(--calcite-tip-manager-height);
|
|
207
207
|
}
|
|
208
208
|
|
|
@@ -10,7 +10,7 @@ import { c as connectLabel, d as disconnectLabel } from './label.js';
|
|
|
10
10
|
import { c as connectForm, d as disconnectForm, a as afterConnectDefaultValueSet, H as HiddenFormInputSlot } from './form.js';
|
|
11
11
|
import { d as defineCustomElement$2 } from './calcite-graph2.js';
|
|
12
12
|
|
|
13
|
-
const calciteSliderCss = "@charset \"UTF-8\";@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-internal-animation-timing-factor:var(--calcite-animation-timing-factor, 1);--calcite-internal-animation-timing:calc(150ms * var(--calcite-internal-animation-timing-factor));--calcite-internal-animation-timing-quick:calc(100ms * var(--calcite-internal-animation-timing-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-animation-timing-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-animation-timing-factor))}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-internal-animation-timing);animation-duration:var(--calcite-internal-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:150ms ease-in-out}:host([hidden]){display:none}:host{display:block}.container{display:block;position:relative;padding:7px 0;margin:7px 0.5rem}:host([disabled]){opacity:var(--calcite-ui-opacity-disabled);pointer-events:none}:host([disabled]) .track__range,:host([disabled]) .tick--active{background-color:var(--calcite-ui-text-3)}:host([disabled]) .graph .graph-path--highlight{fill:var(--calcite-ui-text-3)}:host([label-handles]) .container,:host([precise]:not([precise=false])) .container{margin-top:21px}:host([label-ticks]),:host([precise]:not([precise=false])) .container--range{margin-bottom:21px}:host([precise]:not([precise=false])[label-handles]) .container{margin-top:35px}:host([precise]:not([precise=false])[label-handles]) .container--range{margin-bottom:35px}.thumb{position:absolute;border-style:none;background-color:transparent;cursor:pointer;outline:2px solid transparent;outline-offset:2px;padding:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;font-family:inherit;z-index:2;-webkit-transform:translate(7px, -8px);transform:translate(7px, -8px)}.thumb .handle__label{font-size:var(--calcite-font-size--2);font-weight:500;line-height:1;color:var(--calcite-ui-text-2);margin-bottom:5px}.thumb .handle__label.static,.thumb .handle__label.transformed{opacity:0;position:absolute;top:0;bottom:0}.thumb .handle__label.hyphen::after{content:\"—\";display:inline-block;width:1em}.thumb .handle{outline-offset:0;outline-color:transparent;-webkit-transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;height:14px;width:14px;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:100%;background-color:var(--calcite-ui-foreground-1);-webkit-box-shadow:0 0 0 2px var(--calcite-ui-text-3) inset;box-shadow:0 0 0 2px var(--calcite-ui-text-3) inset;-webkit-transition:border 0.25s ease, background-color 0.25s ease, -webkit-box-shadow 0.25s ease;transition:border 0.25s ease, background-color 0.25s ease, -webkit-box-shadow 0.25s ease;transition:border 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;transition:border 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease, -webkit-box-shadow 0.25s ease}.thumb .handle-extension{width:2px;height:7px;background-color:var(--calcite-ui-text-3)}.thumb:hover .handle{-webkit-box-shadow:0 0 0 3px var(--calcite-ui-brand) inset;box-shadow:0 0 0 3px var(--calcite-ui-brand) inset}.thumb:hover .handle-extension{background-color:var(--calcite-ui-brand)}.thumb:focus .handle{outline:2px solid var(--calcite-ui-brand);outline-offset:2px;outline-offset:2px}.thumb:focus .handle-extension{background-color:var(--calcite-ui-brand)}.thumb--minValue{-webkit-transform:translate(-7px, -8px);transform:translate(-7px, -8px)}:host([label-handles]) .thumb{-webkit-transform:translate(50%, -25px);transform:translate(50%, -25px)}:host([label-handles]) .thumb--minValue{-webkit-transform:translate(-50%, -25px);transform:translate(-50%, -25px)}:host([has-histogram][label-handles]) .thumb{-webkit-transform:translate(50%, -8px);transform:translate(50%, -8px)}:host([has-histogram][label-handles]) .thumb .handle__label{margin-bottom:unset;margin-top:5px}:host([has-histogram][label-handles]) .thumb--minValue{-webkit-transform:translate(-50%, -8px);transform:translate(-50%, -8px)}:host([precise]:not([precise=false])) .thumb{-webkit-transform:translate(7px, -21px);transform:translate(7px, -21px)}:host([precise]:not([precise=false])) .thumb--minValue{-webkit-transform:translate(-7px, -2px);transform:translate(-7px, -2px)}:host([precise]:not([precise=false])) .thumb--minValue .handle__label{margin-bottom:unset;margin-top:5px}:host([has-histogram][precise]:not([precise=false])) .thumb{-webkit-transform:translate(7px, -2px);transform:translate(7px, -2px)}:host([has-histogram][precise]:not([precise=false])) .thumb--minValue{-webkit-transform:translate(-50%, -2px);transform:translate(-50%, -2px)}:host([ticks][precise]:not([precise=false])) .thumb{-webkit-transform:translate(7px, -20px);transform:translate(7px, -20px)}:host([ticks][precise]:not([precise=false])) .thumb--minValue{-webkit-transform:translate(-7px, -3px);transform:translate(-7px, -3px)}:host([has-histogram][ticks][precise]:not([precise=false])) .thumb{-webkit-transform:translate(7px, -3px);transform:translate(7px, -3px)}:host([has-histogram][ticks][precise]:not([precise=false])) .thumb--minValue{-webkit-transform:translate(-50%, -3px);transform:translate(-50%, -3px)}:host([label-handles][precise]:not([precise=false])) .thumb{-webkit-transform:translate(50%, -38px);transform:translate(50%, -38px)}:host([label-handles][precise]:not([precise=false])) .thumb--minValue{-webkit-transform:translate(-50%, -2px);transform:translate(-50%, -2px)}:host([has-histogram][label-handles][precise]:not([precise=false])) .thumb{-webkit-transform:translate(50%, -2px);transform:translate(50%, -2px)}:host([has-histogram][label-handles][precise]:not([precise=false])) .thumb--minValue{-webkit-transform:translate(-50%, -2px);transform:translate(-50%, -2px)}:host([ticks][label-handles][precise]:not([precise=false])) .thumb{-webkit-transform:translate(50%, -37px);transform:translate(50%, -37px)}:host([ticks][label-handles][precise]:not([precise=false])) .thumb--minValue{-webkit-transform:translate(-50%, -3px);transform:translate(-50%, -3px)}:host([has-histogram][ticks][label-handles][precise]:not([precise=false])) .thumb{-webkit-transform:translate(50%, -3px);transform:translate(50%, -3px)}:host([has-histogram][ticks][label-handles][precise]:not([precise=false])) .thumb--minValue{-webkit-transform:translate(-50%, -3px);transform:translate(-50%, -3px)}.thumb:focus,.thumb--active{z-index:3}.thumb:focus .handle,.thumb--active .handle{background-color:var(--calcite-ui-brand);-webkit-box-shadow:0 0 8px 0 rgba(0, 0, 0, 0.16);box-shadow:0 0 8px 0 rgba(0, 0, 0, 0.16)}.thumb:hover.thumb--precise:after,.thumb:focus.thumb--precise:after,.thumb--active.thumb--precise:after{background-color:var(--calcite-ui-brand)}.track{height:2px;border-radius:0;z-index:1;background-color:var(--calcite-ui-border-2);-webkit-transition:all 250ms ease-in;transition:all 250ms ease-in;position:relative}.track__range{position:absolute;top:0;height:2px;background-color:var(--calcite-ui-brand)}.container--range .track__range:hover{cursor:ew-resize}.container--range .track__range:after{content:\"\";position:absolute;top:-5px;width:100%;height:14px}.tick{position:absolute;top:-2px;width:2px;height:4px;left:var(--calcite-ui-border-1-offset);margin-left:-2px;border:1px solid var(--calcite-ui-foreground-1);background-color:var(--calcite-ui-border-1);pointer-events:none}.tick--active{background-color:var(--calcite-ui-brand)}.tick__label{position:absolute;font-size:var(--calcite-font-size--2);font-weight:500;color:var(--calcite-ui-text-2);width:4em;margin:14px -2em;text-align:center;display:block;pointer-events:none}.tick__label--min{left:0;margin:14px -3px;text-align:left;-webkit-transition:opacity 150ms;transition:opacity 150ms}.tick__label--max{left:unset;right:0;margin:14px -3px;text-align:right;-webkit-transition:opacity 50ms;transition:opacity 50ms}:host([has-histogram][label-handles]) .tick__label--min,:host([has-histogram][label-handles]) .tick__label--max{margin:6px -3px;font-weight:300;color:var(--calcite-ui-text-3)}:host([has-histogram][precise]:not([precise=false])) .tick__label--min,:host([has-histogram][precise]:not([precise=false])) .tick__label--max{margin:6px -3px;font-weight:300;color:var(--calcite-ui-text-3)}.graph{color:var(--calcite-ui-foreground-3)}:host([mirrored]:not([has-histogram])) .tick__label--min{right:0;left:unset;text-align:right}:host([mirrored]:not([has-histogram])) .tick__label--max{right:unset;left:0;text-align:left}::slotted(input[slot=hidden-form-input]){bottom:0 !important;left:0 !important;margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;right:0 !important;top:0 !important;-webkit-transform:none !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}";
|
|
13
|
+
const calciteSliderCss = "@charset \"UTF-8\";@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-internal-animation-timing-factor:var(--calcite-animation-timing-factor, 1);--calcite-internal-animation-timing:calc(150ms * var(--calcite-internal-animation-timing-factor));--calcite-internal-animation-timing-quick:calc(100ms * var(--calcite-internal-animation-timing-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-animation-timing-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-animation-timing-factor))}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-internal-animation-timing);animation-duration:var(--calcite-internal-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:150ms ease-in-out}:host([hidden]){display:none}.scale--s{--calcite-slider-handle-size:10px;--calcite-slider-handle-extension-height:6.5px;--calcite-slider-container-font-size:var(--calcite-font-size--3)}.scale--s .handle__label,.scale--s .tick__label{line-height:.75rem}.scale--m{--calcite-slider-handle-size:14px;--calcite-slider-handle-extension-height:8px;--calcite-slider-container-font-size:var(--calcite-font-size--2)}.scale--m .handle__label,.scale--m .tick__label{line-height:1rem}.scale--l{--calcite-slider-handle-size:16px;--calcite-slider-handle-extension-height:10.5px;--calcite-slider-container-font-size:var(--calcite-font-size--1)}.scale--l .handle__label,.scale--l .tick__label{line-height:1rem}.handle__label,.tick__label{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2);font-size:var(--calcite-slider-container-font-size)}:host{display:block}.container{display:block;position:relative;padding:calc(var(--calcite-slider-handle-size) * 0.5);margin:calc(var(--calcite-slider-handle-size) * 0.5) 0;--calcite-slider-full-handle-height:calc(\n var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height)\n )}:host([disabled]){opacity:var(--calcite-ui-opacity-disabled);pointer-events:none}:host([disabled]) .track__range,:host([disabled]) .tick--active{background-color:var(--calcite-ui-text-3)}.scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-6px}.scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-8px}.scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-9px}:host([precise]:not([has-histogram])) .container .thumb--value{--calcite-slider-thumb-y-offset:calc(var(--calcite-slider-full-handle-height) * -1)}.thumb-container{max-width:100%;position:relative}.thumb{--calcite-slider-thumb-x-offset:calc(var(--calcite-slider-handle-size) * 0.5);position:absolute;border-style:none;background-color:transparent;cursor:pointer;outline:2px solid transparent;outline-offset:2px;padding:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;font-family:inherit;-webkit-transform:translate(var(--calcite-slider-thumb-x-offset), var(--calcite-slider-thumb-y-offset));transform:translate(var(--calcite-slider-thumb-x-offset), var(--calcite-slider-thumb-y-offset))}.thumb .handle__label.static,.thumb .handle__label.transformed{opacity:0;position:absolute;top:0;bottom:0}.thumb .handle__label.hyphen::after{content:\"—\";display:inline-block;width:1em}.thumb .handle{outline-offset:0;outline-color:transparent;-webkit-transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:9999px;background-color:var(--calcite-ui-foreground-1);height:var(--calcite-slider-handle-size);width:var(--calcite-slider-handle-size);-webkit-box-shadow:0 0 0 2px var(--calcite-ui-text-3) inset;box-shadow:0 0 0 2px var(--calcite-ui-text-3) inset;-webkit-transition:border 0.25s ease, background-color 0.25s ease, -webkit-box-shadow 0.25s ease;transition:border 0.25s ease, background-color 0.25s ease, -webkit-box-shadow 0.25s ease;transition:border 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;transition:border 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease, -webkit-box-shadow 0.25s ease}.thumb .handle-extension{width:0.125rem;height:var(--calcite-slider-handle-extension-height);background-color:var(--calcite-ui-text-3)}.thumb:hover .handle{-webkit-box-shadow:0 0 0 3px var(--calcite-ui-brand) inset;box-shadow:0 0 0 3px var(--calcite-ui-brand) inset}.thumb:hover .handle-extension{background-color:var(--calcite-ui-brand)}.thumb:focus .handle{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}.thumb:focus .handle-extension{background-color:var(--calcite-ui-brand)}.thumb.thumb--minValue{-webkit-transform:translate(calc(var(--calcite-slider-thumb-x-offset) * -1), var(--calcite-slider-thumb-y-offset));transform:translate(calc(var(--calcite-slider-thumb-x-offset) * -1), var(--calcite-slider-thumb-y-offset))}.thumb.thumb--precise{--calcite-slider-thumb-y-offset:-2px}:host([label-handles]) .thumb{--calcite-slider-thumb-x-offset:50%}:host([label-handles]):host(:not([has-histogram])) .scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-23px}:host([label-handles]):host(:not([has-histogram])) .scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-30px}:host([label-handles]):host(:not([has-histogram])) .scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-32px}:host([has-histogram][label-handles]) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--minValue.thumb--precise .handle__label{margin-top:0.5em}:host(:not([has-histogram]):not([precise])) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--value .handle__label{margin-bottom:0.5em}:host([label-handles][precise]):host(:not([has-histogram])) .scale--s .thumb--value{--calcite-slider-thumb-y-offset:-33px}:host([label-handles][precise]):host(:not([has-histogram])) .scale--m .thumb--value{--calcite-slider-thumb-y-offset:-44px}:host([label-handles][precise]):host(:not([has-histogram])) .scale--l .thumb--value{--calcite-slider-thumb-y-offset:-49px}.thumb:focus .handle,.thumb--active .handle{background-color:var(--calcite-ui-brand);-webkit-box-shadow:0 0 8px 0 rgba(0, 0, 0, 0.16);box-shadow:0 0 8px 0 rgba(0, 0, 0, 0.16)}.thumb:hover.thumb--precise:after,.thumb:focus.thumb--precise:after,.thumb--active.thumb--precise:after{background-color:var(--calcite-ui-brand)}.track{height:0.125rem;border-radius:0;position:relative;background-color:var(--calcite-ui-border-2);-webkit-transition:all 250ms ease-in;transition:all 250ms ease-in}.track__range{position:absolute;top:0;height:0.125rem;background-color:var(--calcite-ui-brand)}.container--range .track__range:hover{cursor:ew-resize}.container--range .track__range:after{position:absolute;width:100%;content:\"\";top:calc(var(--calcite-slider-full-handle-height) * 0.5 * -1);height:calc(var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height))}.tick{position:absolute;width:0.125rem;height:0.25rem;border-width:1px;border-style:solid;background-color:var(--calcite-ui-border-input);border-color:var(--calcite-ui-foreground-1);top:-2px;pointer-events:none;-webkit-margin-start:calc(-1 * 0.125rem);margin-inline-start:calc(-1 * 0.125rem)}.tick--active{background-color:var(--calcite-ui-brand)}.tick__label{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;pointer-events:none;margin-top:0.875rem}.tick__label--min{-webkit-transition:opacity 150ms;transition:opacity 150ms}.tick__label--max{-webkit-transition:opacity 50ms;transition:opacity 50ms}:host([has-histogram][label-handles]) .tick__label--min,:host([has-histogram][label-handles]) .tick__label--max,:host([has-histogram][precise]) .tick__label--min,:host([has-histogram][precise]) .tick__label--max{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-3)}.graph{color:var(--calcite-ui-foreground-3)}:host([label-ticks][ticks]) .container{padding-bottom:calc(0.875rem + var(--calcite-slider-container-font-size))}:host([has-histogram]):host([precise][label-handles]) .container{padding-bottom:calc(var(--calcite-slider-full-handle-height) + 1em)}:host([has-histogram]):host([label-handles]:not([precise])) .container{padding-bottom:calc(var(--calcite-slider-handle-size) * 0.5 + 1em)}:host([has-histogram]):host([precise]:not([label-handles])) .container{padding-bottom:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container{padding-top:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container--range{padding-bottom:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([label-handles]:not([precise])) .container{padding-top:calc(var(--calcite-slider-full-handle-height) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container{padding-top:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container--range{padding-bottom:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}::slotted(input[slot=hidden-form-input]){bottom:0 !important;left:0 !important;margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;right:0 !important;top:0 !important;-webkit-transform:none !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}";
|
|
14
14
|
|
|
15
15
|
let CalciteSlider$1 = class extends HTMLElement {
|
|
16
16
|
constructor() {
|
|
@@ -55,6 +55,10 @@ let CalciteSlider$1 = class extends HTMLElement {
|
|
|
55
55
|
this.step = 1;
|
|
56
56
|
/** Currently selected number (if single select) */
|
|
57
57
|
this.value = null;
|
|
58
|
+
/**
|
|
59
|
+
* Specify the scale of the slider, defaults to m
|
|
60
|
+
*/
|
|
61
|
+
this.scale = "m";
|
|
58
62
|
this.guid = `calcite-slider-${guid()}`;
|
|
59
63
|
this.isRange = false;
|
|
60
64
|
this.activeProp = "value";
|
|
@@ -229,7 +233,11 @@ let CalciteSlider$1 = class extends HTMLElement {
|
|
|
229
233
|
"thumb--active": this.dragProp === "minValue",
|
|
230
234
|
"thumb--precise": true
|
|
231
235
|
}, disabled: this.disabled, onBlur: () => (this.activeProp = null), onFocus: () => (this.activeProp = "minValue"), onPointerDown: () => this.dragStart("minValue"), ref: (el) => (this.minHandle = el), role: "slider", style: { left: leftThumbOffset } }, h("div", { class: "handle-extension" }), h("div", { class: "handle" }), h("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue" }, this.minValue && this.minValue.toLocaleString()), h("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue static" }, this.minValue && this.minValue.toLocaleString()), h("span", { "aria-hidden": "true", class: "handle__label handle__label--minValue transformed" }, this.minValue && this.minValue.toLocaleString())));
|
|
232
|
-
return (h(Host, { id: id, onTouchStart: this.handleTouchStart }, h("div", { class: {
|
|
236
|
+
return (h(Host, { id: id, onTouchStart: this.handleTouchStart }, h("div", { class: {
|
|
237
|
+
["container"]: true,
|
|
238
|
+
["container--range"]: this.isRange,
|
|
239
|
+
[`scale--${this.scale}`]: true
|
|
240
|
+
} }, this.renderGraph(), h("div", { class: "track", ref: this.storeTrackRef }, h("div", { class: "track__range", onPointerDown: () => this.dragStart("minMaxValue"), style: {
|
|
233
241
|
left: `${mirror ? 100 - maxInterval : minInterval}%`,
|
|
234
242
|
right: `${mirror ? minInterval : 100 - maxInterval}%`
|
|
235
243
|
} }), h("div", { class: "ticks" }, this.tickValues.map((tick) => {
|
|
@@ -245,7 +253,7 @@ let CalciteSlider$1 = class extends HTMLElement {
|
|
|
245
253
|
left: mirror ? "" : tickOffset,
|
|
246
254
|
right: mirror ? tickOffset : ""
|
|
247
255
|
} }, this.renderTickLabel(tick)));
|
|
248
|
-
}))), !this.precise && !this.labelHandles && this.isRange && minHandle, !this.hasHistogram &&
|
|
256
|
+
}))), h("div", { class: "thumb-container" }, !this.precise && !this.labelHandles && this.isRange && minHandle, !this.hasHistogram &&
|
|
249
257
|
!this.precise &&
|
|
250
258
|
this.labelHandles &&
|
|
251
259
|
this.isRange &&
|
|
@@ -253,7 +261,10 @@ let CalciteSlider$1 = class extends HTMLElement {
|
|
|
253
261
|
!this.precise &&
|
|
254
262
|
this.labelHandles &&
|
|
255
263
|
this.isRange &&
|
|
256
|
-
minHistogramLabeledHandle, !this.precise && !this.labelHandles && handle, !this.hasHistogram && !this.precise && this.labelHandles && labeledHandle, !this.hasHistogram && this.precise && !this.labelHandles && preciseHandle, this.hasHistogram && this.precise && !this.labelHandles && histogramPreciseHandle, !this.hasHistogram && this.precise && this.labelHandles && labeledPreciseHandle, this.hasHistogram && !this.precise && this.labelHandles && histogramLabeledHandle, this.hasHistogram &&
|
|
264
|
+
minHistogramLabeledHandle, !this.precise && !this.labelHandles && handle, !this.hasHistogram && !this.precise && this.labelHandles && labeledHandle, !this.hasHistogram && this.precise && !this.labelHandles && preciseHandle, this.hasHistogram && this.precise && !this.labelHandles && histogramPreciseHandle, !this.hasHistogram && this.precise && this.labelHandles && labeledPreciseHandle, this.hasHistogram && !this.precise && this.labelHandles && histogramLabeledHandle, this.hasHistogram &&
|
|
265
|
+
this.precise &&
|
|
266
|
+
this.labelHandles &&
|
|
267
|
+
histogramLabeledPreciseHandle, h(HiddenFormInputSlot, { component: this })))));
|
|
257
268
|
}
|
|
258
269
|
renderGraph() {
|
|
259
270
|
return this.histogram ? (h("div", { class: "graph" }, h("calcite-graph", { colorStops: this.histogramStops, data: this.histogram, "data-style": "slider-histogram", height: 48, highlightMax: this.isRange ? this.maxValue : this.value, highlightMin: this.isRange ? this.minValue : this.min, max: this.max, min: this.min, width: 300 }))) : null;
|
|
@@ -735,6 +746,7 @@ CalciteSlider$1 = /*@__PURE__*/ proxyCustomElement(CalciteSlider$1, [1, "calcite
|
|
|
735
746
|
"step": [2],
|
|
736
747
|
"ticks": [2],
|
|
737
748
|
"value": [1538],
|
|
749
|
+
"scale": [1],
|
|
738
750
|
"activeProp": [32],
|
|
739
751
|
"minMaxValueRange": [32],
|
|
740
752
|
"minValueDragRange": [32],
|