UNPKG

2.84 kBJavaScriptView Raw
1/**
2 * @license
3 * Copyright 2020 Google Inc.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 * THE SOFTWARE.
22 */
23/** Slider element classes. */
24export var cssClasses = {
25 DISABLED: 'mdc-slider--disabled',
26 DISCRETE: 'mdc-slider--discrete',
27 INPUT: 'mdc-slider__input',
28 RANGE: 'mdc-slider--range',
29 THUMB: 'mdc-slider__thumb',
30 // Applied when thumb is in the focused state.
31 THUMB_FOCUSED: 'mdc-slider__thumb--focused',
32 THUMB_KNOB: 'mdc-slider__thumb-knob',
33 // Class added to the top thumb (for overlapping thumbs in range slider).
34 THUMB_TOP: 'mdc-slider__thumb--top',
35 THUMB_WITH_INDICATOR: 'mdc-slider__thumb--with-indicator',
36 TICK_MARKS: 'mdc-slider--tick-marks',
37 TICK_MARKS_CONTAINER: 'mdc-slider__tick-marks',
38 TICK_MARK_ACTIVE: 'mdc-slider__tick-mark--active',
39 TICK_MARK_INACTIVE: 'mdc-slider__tick-mark--inactive',
40 TRACK: 'mdc-slider__track',
41 // The active track fill element that will be scaled as the value changes.
42 TRACK_ACTIVE: 'mdc-slider__track--active_fill',
43 VALUE_INDICATOR_TEXT: 'mdc-slider__value-indicator-text',
44};
45/** Slider numbers. */
46export var numbers = {
47 // Default step size.
48 STEP_SIZE: 1,
49 // Minimum absolute difference between clientX of move event / down event
50 // for which to update thumb, in the case of overlapping thumbs.
51 // This is needed to reduce chances of choosing the thumb based on
52 // pointer jitter.
53 THUMB_UPDATE_MIN_PX: 5,
54};
55/** Slider attributes. */
56export var attributes = {
57 ARIA_VALUETEXT: 'aria-valuetext',
58 INPUT_DISABLED: 'disabled',
59 INPUT_MIN: 'min',
60 INPUT_MAX: 'max',
61 INPUT_VALUE: 'value',
62 INPUT_STEP: 'step',
63};
64/** Slider events. */
65export var events = {
66 CHANGE: 'MDCSlider:change',
67 INPUT: 'MDCSlider:input',
68};
69//# sourceMappingURL=constants.js.map
\No newline at end of file