@covalent/components 6.0.1 → 6.0.2
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/action-ribbon.mjs +9 -7
- package/alert.mjs +13 -11
- package/app-shell.mjs +10 -4
- package/aria-property.mjs +41 -0
- package/base-element.mjs +28 -0
- package/button.mjs +180 -13
- package/card.mjs +3 -3
- package/check-list-item.mjs +92 -14
- package/checkbox.mjs +26 -14
- package/circular-progress.mjs +144 -10
- package/class-map.mjs +62 -0
- package/code-snippet.mjs +6 -5
- package/covalent.mjs +2 -2
- package/covalent.umd.js +3339 -137
- package/dialog.mjs +750 -15
- package/directive-helpers.mjs +11 -0
- package/drawer.mjs +26 -15
- package/empty-state.mjs +4 -4
- package/event-options.mjs +14 -0
- package/form-element.mjs +50 -0
- package/foundation.mjs +152 -0
- package/foundation2.mjs +60 -0
- package/icon-button.mjs +130 -15
- package/icon-check-toggle.mjs +18 -8
- package/icon-radio-toggle.mjs +29 -18
- package/icon.mjs +19 -13
- package/if-defined.mjs +10 -0
- package/inert.esm.mjs +640 -0
- package/linear-progress.mjs +178 -15
- package/list-expansion.mjs +33 -22
- package/list-item.mjs +19 -20
- package/list.mjs +26 -13
- package/menu.mjs +32 -13
- package/mwc-checkbox-base.mjs +198 -0
- package/mwc-checkbox.css.mjs +10 -0
- package/mwc-drawer-base.mjs +335 -0
- package/mwc-icon.mjs +26 -0
- package/mwc-line-ripple-directive.mjs +653 -0
- package/mwc-list-base.mjs +840 -0
- package/mwc-list-item-base.mjs +202 -0
- package/mwc-list-item.css.mjs +17 -0
- package/mwc-menu-base.mjs +1145 -0
- package/mwc-radio-base.mjs +528 -0
- package/mwc-radio.css.mjs +10 -0
- package/mwc-slider.css.mjs +956 -0
- package/mwc-tab-base.mjs +694 -0
- package/mwc-top-app-bar-base.mjs +380 -0
- package/nav-list-item.mjs +28 -20
- package/observer.mjs +32 -0
- package/package.json +9 -2
- package/property.mjs +20 -0
- package/query-assigned-elements.mjs +615 -0
- package/query-assigned-nodes.mjs +17 -0
- package/query.mjs +25 -0
- package/radio-list-item.mjs +93 -12
- package/radio.mjs +28 -15
- package/ripple-handlers.mjs +761 -0
- package/select.mjs +1257 -15
- package/side-sheet.mjs +21 -16
- package/slider-range.mjs +438 -11
- package/slider.mjs +253 -13
- package/snackbar.mjs +456 -15
- package/src/action-ribbon/action-ribbon-base.d.ts +30 -0
- package/src/action-ribbon/action-ribbon-base.d.ts.map +1 -0
- package/src/action-ribbon/action-ribbon.d.ts +15 -0
- package/src/action-ribbon/action-ribbon.d.ts.map +1 -0
- package/src/alert/alert-base.d.ts +31 -0
- package/src/alert/alert-base.d.ts.map +1 -0
- package/src/alert/alert.d.ts +15 -0
- package/src/alert/alert.d.ts.map +1 -0
- package/src/app-shell/app-shell.d.ts +26 -0
- package/src/app-shell/app-shell.d.ts.map +1 -0
- package/src/button/button.d.ts +10 -0
- package/src/button/button.d.ts.map +1 -0
- package/src/card/card-base.d.ts +25 -0
- package/src/card/card-base.d.ts.map +1 -0
- package/src/card/card.d.ts +10 -0
- package/src/card/card.d.ts.map +1 -0
- package/src/checkbox/checkbox.d.ts +10 -0
- package/src/checkbox/checkbox.d.ts.map +1 -0
- package/src/chips/chip-base.d.ts +52 -0
- package/src/chips/chip-base.d.ts.map +1 -0
- package/src/chips/chip-set-base.d.ts +33 -0
- package/src/chips/chip-set-base.d.ts.map +1 -0
- package/src/chips/chip-set.d.ts +15 -0
- package/src/chips/chip-set.d.ts.map +1 -0
- package/src/chips/chip.d.ts +15 -0
- package/src/chips/chip.d.ts.map +1 -0
- package/src/chips/foundation.d.ts +60 -0
- package/src/chips/foundation.d.ts.map +1 -0
- package/src/circular-progress/circular-progress.d.ts +10 -0
- package/src/circular-progress/circular-progress.d.ts.map +1 -0
- package/src/code-snippet/code-snippet.d.ts +21 -0
- package/src/code-snippet/code-snippet.d.ts.map +1 -0
- package/src/dialog/dialog.d.ts +10 -0
- package/src/dialog/dialog.d.ts.map +1 -0
- package/src/drawer/drawer.d.ts +10 -0
- package/src/drawer/drawer.d.ts.map +1 -0
- package/src/empty-state/empty-state.d.ts +16 -0
- package/src/empty-state/empty-state.d.ts.map +1 -0
- package/src/formfield/formfield.d.ts +10 -0
- package/src/formfield/formfield.d.ts.map +1 -0
- package/src/icon/icon.d.ts +10 -0
- package/src/icon/icon.d.ts.map +1 -0
- package/src/icon-button/icon-button.d.ts +10 -0
- package/src/icon-button/icon-button.d.ts.map +1 -0
- package/src/icon-checkbox/icon-check-toggle.d.ts +15 -0
- package/src/icon-checkbox/icon-check-toggle.d.ts.map +1 -0
- package/src/icon-radio/icon-radio-toggle.d.ts +14 -0
- package/src/icon-radio/icon-radio-toggle.d.ts.map +1 -0
- package/src/index.d.ts +3 -0
- package/src/index.d.ts.map +1 -0
- package/src/linear-progress/linear-progress.d.ts +10 -0
- package/src/linear-progress/linear-progress.d.ts.map +1 -0
- package/src/list/check-list-item.d.ts +10 -0
- package/src/list/check-list-item.d.ts.map +1 -0
- package/src/list/list-expansion.d.ts +18 -0
- package/src/list/list-expansion.d.ts.map +1 -0
- package/src/list/list-item.d.ts +12 -0
- package/src/list/list-item.d.ts.map +1 -0
- package/src/list/list.d.ts +10 -0
- package/src/list/list.d.ts.map +1 -0
- package/src/list/nav-list-item.d.ts +12 -0
- package/src/list/nav-list-item.d.ts.map +1 -0
- package/src/list/radio-list-item.d.ts +10 -0
- package/src/list/radio-list-item.d.ts.map +1 -0
- package/src/menu/menu.d.ts +10 -0
- package/src/menu/menu.d.ts.map +1 -0
- package/src/radio/radio.d.ts +10 -0
- package/src/radio/radio.d.ts.map +1 -0
- package/src/select/select.d.ts +10 -0
- package/src/select/select.d.ts.map +1 -0
- package/src/side-sheet/side-sheet.d.ts +18 -0
- package/src/side-sheet/side-sheet.d.ts.map +1 -0
- package/src/slider/slider-range.d.ts +10 -0
- package/src/slider/slider-range.d.ts.map +1 -0
- package/src/slider/slider.d.ts +10 -0
- package/src/slider/slider.d.ts.map +1 -0
- package/src/snackbar/snackbar.d.ts +10 -0
- package/src/snackbar/snackbar.d.ts.map +1 -0
- package/src/status-header/status-header-base.d.ts +9 -0
- package/src/status-header/status-header-base.d.ts.map +1 -0
- package/src/status-header/status-header-item.d.ts +17 -0
- package/src/status-header/status-header-item.d.ts.map +1 -0
- package/src/status-header/status-header.d.ts +15 -0
- package/src/status-header/status-header.d.ts.map +1 -0
- package/src/switch/switch.d.ts +10 -0
- package/src/switch/switch.d.ts.map +1 -0
- package/src/tab/tab-bar.d.ts +10 -0
- package/src/tab/tab-bar.d.ts.map +1 -0
- package/src/tab/tab.d.ts +10 -0
- package/src/tab/tab.d.ts.map +1 -0
- package/src/text-lockup/text-lockup.d.ts +17 -0
- package/src/text-lockup/text-lockup.d.ts.map +1 -0
- package/src/textarea/textarea.d.ts +10 -0
- package/src/textarea/textarea.d.ts.map +1 -0
- package/src/textfield/textfield.d.ts +10 -0
- package/src/textfield/textfield.d.ts.map +1 -0
- package/src/toolbar/toolbar.d.ts +10 -0
- package/src/toolbar/toolbar.d.ts.map +1 -0
- package/src/tooltip/tooltip.d.ts +27 -0
- package/src/tooltip/tooltip.d.ts.map +1 -0
- package/src/top-app-bar/top-app-bar-fixed.d.ts +10 -0
- package/src/top-app-bar/top-app-bar-fixed.d.ts.map +1 -0
- package/src/top-app-bar/top-app-bar.d.ts +10 -0
- package/src/top-app-bar/top-app-bar.d.ts.map +1 -0
- package/src/tree-list/tree-list-item.d.ts +16 -0
- package/src/tree-list/tree-list-item.d.ts.map +1 -0
- package/src/tree-list/tree-list.d.ts +11 -0
- package/src/tree-list/tree-list.d.ts.map +1 -0
- package/src/typography/typography.d.ts +12 -0
- package/src/typography/typography.d.ts.map +1 -0
- package/state.mjs +12 -0
- package/status-header-item.mjs +16 -16
- package/status-header.mjs +5 -5
- package/style-map.mjs +40 -0
- package/switch.mjs +531 -15
- package/tab-bar.mjs +1030 -13
- package/tab.mjs +29 -15
- package/text-lockup.mjs +8 -8
- package/textarea.mjs +111 -16
- package/textfield.mjs +34 -18
- package/textfield2.mjs +929 -2
- package/toolbar.mjs +8 -3
- package/tooltip.mjs +1153 -96
- package/top-app-bar-fixed.mjs +78 -18
- package/top-app-bar.mjs +19 -15
- package/top-app-bar2.mjs +9 -2
- package/tree-list-item.mjs +3 -3
- package/tree-list.mjs +6 -7
- package/tslib.es6.mjs +82 -0
- package/typography.mjs +8 -8
- package/utils.mjs +52 -0
@@ -0,0 +1,956 @@
|
|
1
|
+
import { _ as F, a as x, b as o } from "./tslib.es6.mjs";
|
2
|
+
import { e as H, R as O } from "./ripple-handlers.mjs";
|
3
|
+
import { a as w } from "./aria-property.mjs";
|
4
|
+
import { F as B } from "./form-element.mjs";
|
5
|
+
import { y as _, b as g, i as $ } from "./query-assigned-elements.mjs";
|
6
|
+
import { e as f } from "./property.mjs";
|
7
|
+
import { t as b } from "./state.mjs";
|
8
|
+
import { i as y } from "./query.mjs";
|
9
|
+
import { o as P } from "./class-map.mjs";
|
10
|
+
import { l as R } from "./if-defined.mjs";
|
11
|
+
import { i as W } from "./style-map.mjs";
|
12
|
+
/**
|
13
|
+
* @license
|
14
|
+
* Copyright 2020 Google Inc.
|
15
|
+
*
|
16
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
17
|
+
* of this software and associated documentation files (the "Software"), to deal
|
18
|
+
* in the Software without restriction, including without limitation the rights
|
19
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
20
|
+
* copies of the Software, and to permit persons to whom the Software is
|
21
|
+
* furnished to do so, subject to the following conditions:
|
22
|
+
*
|
23
|
+
* The above copyright notice and this permission notice shall be included in
|
24
|
+
* all copies or substantial portions of the Software.
|
25
|
+
*
|
26
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
27
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
28
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
29
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
30
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
31
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
32
|
+
* THE SOFTWARE.
|
33
|
+
*/
|
34
|
+
var E;
|
35
|
+
(function(s) {
|
36
|
+
s[s.ACTIVE = 0] = "ACTIVE", s[s.INACTIVE = 1] = "INACTIVE";
|
37
|
+
})(E || (E = {}));
|
38
|
+
var r;
|
39
|
+
(function(s) {
|
40
|
+
s[s.START = 1] = "START", s[s.END = 2] = "END";
|
41
|
+
})(r || (r = {}));
|
42
|
+
/**
|
43
|
+
* @license
|
44
|
+
* Copyright 2020 Google Inc.
|
45
|
+
*
|
46
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
47
|
+
* of this software and associated documentation files (the "Software"), to deal
|
48
|
+
* in the Software without restriction, including without limitation the rights
|
49
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
50
|
+
* copies of the Software, and to permit persons to whom the Software is
|
51
|
+
* furnished to do so, subject to the following conditions:
|
52
|
+
*
|
53
|
+
* The above copyright notice and this permission notice shall be included in
|
54
|
+
* all copies or substantial portions of the Software.
|
55
|
+
*
|
56
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
57
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
58
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
59
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
60
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
61
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
62
|
+
* THE SOFTWARE.
|
63
|
+
*/
|
64
|
+
var X = (
|
65
|
+
/** @class */
|
66
|
+
function() {
|
67
|
+
function s() {
|
68
|
+
this.rafIDs = /* @__PURE__ */ new Map();
|
69
|
+
}
|
70
|
+
return s.prototype.request = function(i, t) {
|
71
|
+
var e = this;
|
72
|
+
this.cancel(i);
|
73
|
+
var n = requestAnimationFrame(function(a) {
|
74
|
+
e.rafIDs.delete(i), t(a);
|
75
|
+
});
|
76
|
+
this.rafIDs.set(i, n);
|
77
|
+
}, s.prototype.cancel = function(i) {
|
78
|
+
var t = this.rafIDs.get(i);
|
79
|
+
t && (cancelAnimationFrame(t), this.rafIDs.delete(i));
|
80
|
+
}, s.prototype.cancelAll = function() {
|
81
|
+
var i = this;
|
82
|
+
this.rafIDs.forEach(function(t, e) {
|
83
|
+
i.cancel(e);
|
84
|
+
});
|
85
|
+
}, s.prototype.getQueue = function() {
|
86
|
+
var i = [];
|
87
|
+
return this.rafIDs.forEach(function(t, e) {
|
88
|
+
i.push(e);
|
89
|
+
}), i;
|
90
|
+
}, s;
|
91
|
+
}()
|
92
|
+
);
|
93
|
+
/**
|
94
|
+
* @license
|
95
|
+
* Copyright 2016 Google Inc.
|
96
|
+
*
|
97
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
98
|
+
* of this software and associated documentation files (the "Software"), to deal
|
99
|
+
* in the Software without restriction, including without limitation the rights
|
100
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
101
|
+
* copies of the Software, and to permit persons to whom the Software is
|
102
|
+
* furnished to do so, subject to the following conditions:
|
103
|
+
*
|
104
|
+
* The above copyright notice and this permission notice shall be included in
|
105
|
+
* all copies or substantial portions of the Software.
|
106
|
+
*
|
107
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
108
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
109
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
110
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
111
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
112
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
113
|
+
* THE SOFTWARE.
|
114
|
+
*/
|
115
|
+
var V = {
|
116
|
+
animation: {
|
117
|
+
prefixed: "-webkit-animation",
|
118
|
+
standard: "animation"
|
119
|
+
},
|
120
|
+
transform: {
|
121
|
+
prefixed: "-webkit-transform",
|
122
|
+
standard: "transform"
|
123
|
+
},
|
124
|
+
transition: {
|
125
|
+
prefixed: "-webkit-transition",
|
126
|
+
standard: "transition"
|
127
|
+
}
|
128
|
+
};
|
129
|
+
function K(s) {
|
130
|
+
return Boolean(s.document) && typeof s.document.createElement == "function";
|
131
|
+
}
|
132
|
+
function L(s, i) {
|
133
|
+
if (K(s) && i in V) {
|
134
|
+
var t = s.document.createElement("div"), e = V[i], n = e.standard, a = e.prefixed, d = n in t.style;
|
135
|
+
return d ? n : a;
|
136
|
+
}
|
137
|
+
return i;
|
138
|
+
}
|
139
|
+
/**
|
140
|
+
* @license
|
141
|
+
* Copyright 2016 Google Inc.
|
142
|
+
*
|
143
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
144
|
+
* of this software and associated documentation files (the "Software"), to deal
|
145
|
+
* in the Software without restriction, including without limitation the rights
|
146
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
147
|
+
* copies of the Software, and to permit persons to whom the Software is
|
148
|
+
* furnished to do so, subject to the following conditions:
|
149
|
+
*
|
150
|
+
* The above copyright notice and this permission notice shall be included in
|
151
|
+
* all copies or substantial portions of the Software.
|
152
|
+
*
|
153
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
154
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
155
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
156
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
157
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
158
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
159
|
+
* THE SOFTWARE.
|
160
|
+
*/
|
161
|
+
var z = (
|
162
|
+
/** @class */
|
163
|
+
function() {
|
164
|
+
function s(i) {
|
165
|
+
i === void 0 && (i = {}), this.adapter = i;
|
166
|
+
}
|
167
|
+
return Object.defineProperty(s, "cssClasses", {
|
168
|
+
get: function() {
|
169
|
+
return {};
|
170
|
+
},
|
171
|
+
enumerable: !1,
|
172
|
+
configurable: !0
|
173
|
+
}), Object.defineProperty(s, "strings", {
|
174
|
+
get: function() {
|
175
|
+
return {};
|
176
|
+
},
|
177
|
+
enumerable: !1,
|
178
|
+
configurable: !0
|
179
|
+
}), Object.defineProperty(s, "numbers", {
|
180
|
+
get: function() {
|
181
|
+
return {};
|
182
|
+
},
|
183
|
+
enumerable: !1,
|
184
|
+
configurable: !0
|
185
|
+
}), Object.defineProperty(s, "defaultAdapter", {
|
186
|
+
get: function() {
|
187
|
+
return {};
|
188
|
+
},
|
189
|
+
enumerable: !1,
|
190
|
+
configurable: !0
|
191
|
+
}), s.prototype.init = function() {
|
192
|
+
}, s.prototype.destroy = function() {
|
193
|
+
}, s;
|
194
|
+
}()
|
195
|
+
);
|
196
|
+
/**
|
197
|
+
* @license
|
198
|
+
* Copyright 2020 Google Inc.
|
199
|
+
*
|
200
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
201
|
+
* of this software and associated documentation files (the "Software"), to deal
|
202
|
+
* in the Software without restriction, including without limitation the rights
|
203
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
204
|
+
* copies of the Software, and to permit persons to whom the Software is
|
205
|
+
* furnished to do so, subject to the following conditions:
|
206
|
+
*
|
207
|
+
* The above copyright notice and this permission notice shall be included in
|
208
|
+
* all copies or substantial portions of the Software.
|
209
|
+
*
|
210
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
211
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
212
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
213
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
214
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
215
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
216
|
+
* THE SOFTWARE.
|
217
|
+
*/
|
218
|
+
var h = {
|
219
|
+
DISABLED: "mdc-slider--disabled",
|
220
|
+
DISCRETE: "mdc-slider--discrete",
|
221
|
+
INPUT: "mdc-slider__input",
|
222
|
+
RANGE: "mdc-slider--range",
|
223
|
+
THUMB: "mdc-slider__thumb",
|
224
|
+
// Applied when thumb is in the focused state.
|
225
|
+
THUMB_FOCUSED: "mdc-slider__thumb--focused",
|
226
|
+
THUMB_KNOB: "mdc-slider__thumb-knob",
|
227
|
+
// Class added to the top thumb (for overlapping thumbs in range slider).
|
228
|
+
THUMB_TOP: "mdc-slider__thumb--top",
|
229
|
+
THUMB_WITH_INDICATOR: "mdc-slider__thumb--with-indicator",
|
230
|
+
TICK_MARKS: "mdc-slider--tick-marks",
|
231
|
+
TICK_MARKS_CONTAINER: "mdc-slider__tick-marks",
|
232
|
+
TICK_MARK_ACTIVE: "mdc-slider__tick-mark--active",
|
233
|
+
TICK_MARK_INACTIVE: "mdc-slider__tick-mark--inactive",
|
234
|
+
TRACK: "mdc-slider__track",
|
235
|
+
// The active track fill element that will be scaled as the value changes.
|
236
|
+
TRACK_ACTIVE: "mdc-slider__track--active_fill",
|
237
|
+
VALUE_INDICATOR_CONTAINER: "mdc-slider__value-indicator-container",
|
238
|
+
VALUE_INDICATOR_TEXT: "mdc-slider__value-indicator-text"
|
239
|
+
}, k = {
|
240
|
+
// Default step size.
|
241
|
+
STEP_SIZE: 1,
|
242
|
+
// Default minimum difference between the start and end values.
|
243
|
+
MIN_RANGE: 0,
|
244
|
+
// Minimum absolute difference between clientX of move event / down event
|
245
|
+
// for which to update thumb, in the case of overlapping thumbs.
|
246
|
+
// This is needed to reduce chances of choosing the thumb based on
|
247
|
+
// pointer jitter.
|
248
|
+
THUMB_UPDATE_MIN_PX: 5
|
249
|
+
}, c = {
|
250
|
+
ARIA_VALUETEXT: "aria-valuetext",
|
251
|
+
INPUT_DISABLED: "disabled",
|
252
|
+
INPUT_MIN: "min",
|
253
|
+
INPUT_MAX: "max",
|
254
|
+
INPUT_VALUE: "value",
|
255
|
+
INPUT_STEP: "step",
|
256
|
+
DATA_MIN_RANGE: "data-min-range"
|
257
|
+
}, p = {
|
258
|
+
VAR_VALUE_INDICATOR_CARET_LEFT: "--slider-value-indicator-caret-left",
|
259
|
+
VAR_VALUE_INDICATOR_CARET_RIGHT: "--slider-value-indicator-caret-right",
|
260
|
+
VAR_VALUE_INDICATOR_CARET_TRANSFORM: "--slider-value-indicator-caret-transform",
|
261
|
+
VAR_VALUE_INDICATOR_CONTAINER_LEFT: "--slider-value-indicator-container-left",
|
262
|
+
VAR_VALUE_INDICATOR_CONTAINER_RIGHT: "--slider-value-indicator-container-right",
|
263
|
+
VAR_VALUE_INDICATOR_CONTAINER_TRANSFORM: "--slider-value-indicator-container-transform"
|
264
|
+
};
|
265
|
+
/**
|
266
|
+
* @license
|
267
|
+
* Copyright 2020 Google Inc.
|
268
|
+
*
|
269
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
270
|
+
* of this software and associated documentation files (the "Software"), to deal
|
271
|
+
* in the Software without restriction, including without limitation the rights
|
272
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
273
|
+
* copies of the Software, and to permit persons to whom the Software is
|
274
|
+
* furnished to do so, subject to the following conditions:
|
275
|
+
*
|
276
|
+
* The above copyright notice and this permission notice shall be included in
|
277
|
+
* all copies or substantial portions of the Software.
|
278
|
+
*
|
279
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
280
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
281
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
282
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
283
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
284
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
285
|
+
* THE SOFTWARE.
|
286
|
+
*/
|
287
|
+
var S;
|
288
|
+
(function(s) {
|
289
|
+
s.SLIDER_UPDATE = "slider_update";
|
290
|
+
})(S || (S = {}));
|
291
|
+
var M = typeof window < "u", G = (
|
292
|
+
/** @class */
|
293
|
+
function(s) {
|
294
|
+
F(i, s);
|
295
|
+
function i(t) {
|
296
|
+
var e = s.call(this, x(x({}, i.defaultAdapter), t)) || this;
|
297
|
+
return e.initialStylesRemoved = !1, e.isDisabled = !1, e.isDiscrete = !1, e.step = k.STEP_SIZE, e.minRange = k.MIN_RANGE, e.hasTickMarks = !1, e.isRange = !1, e.thumb = null, e.downEventClientX = null, e.startThumbKnobWidth = 0, e.endThumbKnobWidth = 0, e.animFrame = new X(), e;
|
298
|
+
}
|
299
|
+
return Object.defineProperty(i, "defaultAdapter", {
|
300
|
+
get: function() {
|
301
|
+
return {
|
302
|
+
hasClass: function() {
|
303
|
+
return !1;
|
304
|
+
},
|
305
|
+
addClass: function() {
|
306
|
+
},
|
307
|
+
removeClass: function() {
|
308
|
+
},
|
309
|
+
addThumbClass: function() {
|
310
|
+
},
|
311
|
+
removeThumbClass: function() {
|
312
|
+
},
|
313
|
+
getAttribute: function() {
|
314
|
+
return null;
|
315
|
+
},
|
316
|
+
getInputValue: function() {
|
317
|
+
return "";
|
318
|
+
},
|
319
|
+
setInputValue: function() {
|
320
|
+
},
|
321
|
+
getInputAttribute: function() {
|
322
|
+
return null;
|
323
|
+
},
|
324
|
+
setInputAttribute: function() {
|
325
|
+
return null;
|
326
|
+
},
|
327
|
+
removeInputAttribute: function() {
|
328
|
+
return null;
|
329
|
+
},
|
330
|
+
focusInput: function() {
|
331
|
+
},
|
332
|
+
isInputFocused: function() {
|
333
|
+
return !1;
|
334
|
+
},
|
335
|
+
shouldHideFocusStylesForPointerEvents: function() {
|
336
|
+
return !1;
|
337
|
+
},
|
338
|
+
getThumbKnobWidth: function() {
|
339
|
+
return 0;
|
340
|
+
},
|
341
|
+
getValueIndicatorContainerWidth: function() {
|
342
|
+
return 0;
|
343
|
+
},
|
344
|
+
getThumbBoundingClientRect: function() {
|
345
|
+
return { top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 };
|
346
|
+
},
|
347
|
+
getBoundingClientRect: function() {
|
348
|
+
return { top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 };
|
349
|
+
},
|
350
|
+
isRTL: function() {
|
351
|
+
return !1;
|
352
|
+
},
|
353
|
+
setThumbStyleProperty: function() {
|
354
|
+
},
|
355
|
+
removeThumbStyleProperty: function() {
|
356
|
+
},
|
357
|
+
setTrackActiveStyleProperty: function() {
|
358
|
+
},
|
359
|
+
removeTrackActiveStyleProperty: function() {
|
360
|
+
},
|
361
|
+
setValueIndicatorText: function() {
|
362
|
+
},
|
363
|
+
getValueToAriaValueTextFn: function() {
|
364
|
+
return null;
|
365
|
+
},
|
366
|
+
updateTickMarks: function() {
|
367
|
+
},
|
368
|
+
setPointerCapture: function() {
|
369
|
+
},
|
370
|
+
emitChangeEvent: function() {
|
371
|
+
},
|
372
|
+
emitInputEvent: function() {
|
373
|
+
},
|
374
|
+
emitDragStartEvent: function() {
|
375
|
+
},
|
376
|
+
emitDragEndEvent: function() {
|
377
|
+
},
|
378
|
+
registerEventHandler: function() {
|
379
|
+
},
|
380
|
+
deregisterEventHandler: function() {
|
381
|
+
},
|
382
|
+
registerThumbEventHandler: function() {
|
383
|
+
},
|
384
|
+
deregisterThumbEventHandler: function() {
|
385
|
+
},
|
386
|
+
registerInputEventHandler: function() {
|
387
|
+
},
|
388
|
+
deregisterInputEventHandler: function() {
|
389
|
+
},
|
390
|
+
registerBodyEventHandler: function() {
|
391
|
+
},
|
392
|
+
deregisterBodyEventHandler: function() {
|
393
|
+
},
|
394
|
+
registerWindowEventHandler: function() {
|
395
|
+
},
|
396
|
+
deregisterWindowEventHandler: function() {
|
397
|
+
}
|
398
|
+
};
|
399
|
+
},
|
400
|
+
enumerable: !1,
|
401
|
+
configurable: !0
|
402
|
+
}), i.prototype.init = function() {
|
403
|
+
var t = this;
|
404
|
+
this.isDisabled = this.adapter.hasClass(h.DISABLED), this.isDiscrete = this.adapter.hasClass(h.DISCRETE), this.hasTickMarks = this.adapter.hasClass(h.TICK_MARKS), this.isRange = this.adapter.hasClass(h.RANGE);
|
405
|
+
var e = this.convertAttributeValueToNumber(this.adapter.getInputAttribute(c.INPUT_MIN, this.isRange ? r.START : r.END), c.INPUT_MIN), n = this.convertAttributeValueToNumber(this.adapter.getInputAttribute(c.INPUT_MAX, r.END), c.INPUT_MAX), a = this.convertAttributeValueToNumber(this.adapter.getInputAttribute(c.INPUT_VALUE, r.END), c.INPUT_VALUE), d = this.isRange ? this.convertAttributeValueToNumber(this.adapter.getInputAttribute(c.INPUT_VALUE, r.START), c.INPUT_VALUE) : e, l = this.adapter.getInputAttribute(c.INPUT_STEP, r.END), m = l ? this.convertAttributeValueToNumber(l, c.INPUT_STEP) : this.step, v = this.adapter.getAttribute(c.DATA_MIN_RANGE), T = v ? this.convertAttributeValueToNumber(v, c.DATA_MIN_RANGE) : this.minRange;
|
406
|
+
this.validateProperties({ min: e, max: n, value: a, valueStart: d, step: m, minRange: T }), this.min = e, this.max = n, this.value = a, this.valueStart = d, this.step = m, this.minRange = T, this.numDecimalPlaces = U(this.step), this.valueBeforeDownEvent = a, this.valueStartBeforeDownEvent = d, this.mousedownOrTouchstartListener = this.handleMousedownOrTouchstart.bind(this), this.moveListener = this.handleMove.bind(this), this.pointerdownListener = this.handlePointerdown.bind(this), this.pointerupListener = this.handlePointerup.bind(this), this.thumbMouseenterListener = this.handleThumbMouseenter.bind(this), this.thumbMouseleaveListener = this.handleThumbMouseleave.bind(this), this.inputStartChangeListener = function() {
|
407
|
+
t.handleInputChange(r.START);
|
408
|
+
}, this.inputEndChangeListener = function() {
|
409
|
+
t.handleInputChange(r.END);
|
410
|
+
}, this.inputStartFocusListener = function() {
|
411
|
+
t.handleInputFocus(r.START);
|
412
|
+
}, this.inputEndFocusListener = function() {
|
413
|
+
t.handleInputFocus(r.END);
|
414
|
+
}, this.inputStartBlurListener = function() {
|
415
|
+
t.handleInputBlur(r.START);
|
416
|
+
}, this.inputEndBlurListener = function() {
|
417
|
+
t.handleInputBlur(r.END);
|
418
|
+
}, this.resizeListener = this.handleResize.bind(this), this.registerEventHandlers();
|
419
|
+
}, i.prototype.destroy = function() {
|
420
|
+
this.deregisterEventHandlers();
|
421
|
+
}, i.prototype.setMin = function(t) {
|
422
|
+
this.min = t, this.isRange || (this.valueStart = t), this.updateUI();
|
423
|
+
}, i.prototype.setMax = function(t) {
|
424
|
+
this.max = t, this.updateUI();
|
425
|
+
}, i.prototype.getMin = function() {
|
426
|
+
return this.min;
|
427
|
+
}, i.prototype.getMax = function() {
|
428
|
+
return this.max;
|
429
|
+
}, i.prototype.getValue = function() {
|
430
|
+
return this.value;
|
431
|
+
}, i.prototype.setValue = function(t) {
|
432
|
+
if (this.isRange && t < this.valueStart + this.minRange)
|
433
|
+
throw new Error("end thumb value (" + t + ") must be >= start thumb " + ("value (" + this.valueStart + ") + min range (" + this.minRange + ")"));
|
434
|
+
this.updateValue(t, r.END);
|
435
|
+
}, i.prototype.getValueStart = function() {
|
436
|
+
if (!this.isRange)
|
437
|
+
throw new Error("`valueStart` is only applicable for range sliders.");
|
438
|
+
return this.valueStart;
|
439
|
+
}, i.prototype.setValueStart = function(t) {
|
440
|
+
if (!this.isRange)
|
441
|
+
throw new Error("`valueStart` is only applicable for range sliders.");
|
442
|
+
if (this.isRange && t > this.value - this.minRange)
|
443
|
+
throw new Error("start thumb value (" + t + ") must be <= end thumb " + ("value (" + this.value + ") - min range (" + this.minRange + ")"));
|
444
|
+
this.updateValue(t, r.START);
|
445
|
+
}, i.prototype.setStep = function(t) {
|
446
|
+
this.step = t, this.numDecimalPlaces = U(t), this.updateUI();
|
447
|
+
}, i.prototype.setMinRange = function(t) {
|
448
|
+
if (!this.isRange)
|
449
|
+
throw new Error("`minRange` is only applicable for range sliders.");
|
450
|
+
if (t < 0)
|
451
|
+
throw new Error("`minRange` must be non-negative. " + ("Current value: " + t));
|
452
|
+
if (this.value - this.valueStart < t)
|
453
|
+
throw new Error("start thumb value (" + this.valueStart + ") and end thumb value " + ("(" + this.value + ") must differ by at least " + t + "."));
|
454
|
+
this.minRange = t;
|
455
|
+
}, i.prototype.setIsDiscrete = function(t) {
|
456
|
+
this.isDiscrete = t, this.updateValueIndicatorUI(), this.updateTickMarksUI();
|
457
|
+
}, i.prototype.getStep = function() {
|
458
|
+
return this.step;
|
459
|
+
}, i.prototype.getMinRange = function() {
|
460
|
+
if (!this.isRange)
|
461
|
+
throw new Error("`minRange` is only applicable for range sliders.");
|
462
|
+
return this.minRange;
|
463
|
+
}, i.prototype.setHasTickMarks = function(t) {
|
464
|
+
this.hasTickMarks = t, this.updateTickMarksUI();
|
465
|
+
}, i.prototype.getDisabled = function() {
|
466
|
+
return this.isDisabled;
|
467
|
+
}, i.prototype.setDisabled = function(t) {
|
468
|
+
this.isDisabled = t, t ? (this.adapter.addClass(h.DISABLED), this.isRange && this.adapter.setInputAttribute(c.INPUT_DISABLED, "", r.START), this.adapter.setInputAttribute(c.INPUT_DISABLED, "", r.END)) : (this.adapter.removeClass(h.DISABLED), this.isRange && this.adapter.removeInputAttribute(c.INPUT_DISABLED, r.START), this.adapter.removeInputAttribute(c.INPUT_DISABLED, r.END));
|
469
|
+
}, i.prototype.getIsRange = function() {
|
470
|
+
return this.isRange;
|
471
|
+
}, i.prototype.layout = function(t) {
|
472
|
+
var e = t === void 0 ? {} : t, n = e.skipUpdateUI;
|
473
|
+
this.rect = this.adapter.getBoundingClientRect(), this.isRange && (this.startThumbKnobWidth = this.adapter.getThumbKnobWidth(r.START), this.endThumbKnobWidth = this.adapter.getThumbKnobWidth(r.END)), n || this.updateUI();
|
474
|
+
}, i.prototype.handleResize = function() {
|
475
|
+
this.layout();
|
476
|
+
}, i.prototype.handleDown = function(t) {
|
477
|
+
if (!this.isDisabled) {
|
478
|
+
this.valueStartBeforeDownEvent = this.valueStart, this.valueBeforeDownEvent = this.value;
|
479
|
+
var e = t.clientX != null ? t.clientX : t.targetTouches[0].clientX;
|
480
|
+
this.downEventClientX = e;
|
481
|
+
var n = this.mapClientXOnSliderScale(e);
|
482
|
+
this.thumb = this.getThumbFromDownEvent(e, n), this.thumb !== null && (this.handleDragStart(t, n, this.thumb), this.updateValue(n, this.thumb, { emitInputEvent: !0 }));
|
483
|
+
}
|
484
|
+
}, i.prototype.handleMove = function(t) {
|
485
|
+
if (!this.isDisabled) {
|
486
|
+
t.preventDefault();
|
487
|
+
var e = t.clientX != null ? t.clientX : t.targetTouches[0].clientX, n = this.thumb != null;
|
488
|
+
if (this.thumb = this.getThumbFromMoveEvent(e), this.thumb !== null) {
|
489
|
+
var a = this.mapClientXOnSliderScale(e);
|
490
|
+
n || (this.handleDragStart(t, a, this.thumb), this.adapter.emitDragStartEvent(a, this.thumb)), this.updateValue(a, this.thumb, { emitInputEvent: !0 });
|
491
|
+
}
|
492
|
+
}
|
493
|
+
}, i.prototype.handleUp = function() {
|
494
|
+
var t, e;
|
495
|
+
if (!(this.isDisabled || this.thumb === null)) {
|
496
|
+
!((e = (t = this.adapter).shouldHideFocusStylesForPointerEvents) === null || e === void 0) && e.call(t) && this.handleInputBlur(this.thumb);
|
497
|
+
var n = this.thumb === r.START ? this.valueStartBeforeDownEvent : this.valueBeforeDownEvent, a = this.thumb === r.START ? this.valueStart : this.value;
|
498
|
+
n !== a && this.adapter.emitChangeEvent(a, this.thumb), this.adapter.emitDragEndEvent(a, this.thumb), this.thumb = null;
|
499
|
+
}
|
500
|
+
}, i.prototype.handleThumbMouseenter = function() {
|
501
|
+
!this.isDiscrete || !this.isRange || (this.adapter.addThumbClass(h.THUMB_WITH_INDICATOR, r.START), this.adapter.addThumbClass(h.THUMB_WITH_INDICATOR, r.END));
|
502
|
+
}, i.prototype.handleThumbMouseleave = function() {
|
503
|
+
var t, e;
|
504
|
+
!this.isDiscrete || !this.isRange || !(!((e = (t = this.adapter).shouldHideFocusStylesForPointerEvents) === null || e === void 0) && e.call(t)) && (this.adapter.isInputFocused(r.START) || this.adapter.isInputFocused(r.END)) || this.thumb || (this.adapter.removeThumbClass(h.THUMB_WITH_INDICATOR, r.START), this.adapter.removeThumbClass(h.THUMB_WITH_INDICATOR, r.END));
|
505
|
+
}, i.prototype.handleMousedownOrTouchstart = function(t) {
|
506
|
+
var e = this, n = t.type === "mousedown" ? "mousemove" : "touchmove";
|
507
|
+
this.adapter.registerBodyEventHandler(n, this.moveListener);
|
508
|
+
var a = function() {
|
509
|
+
e.handleUp(), e.adapter.deregisterBodyEventHandler(n, e.moveListener), e.adapter.deregisterEventHandler("mouseup", a), e.adapter.deregisterEventHandler("touchend", a);
|
510
|
+
};
|
511
|
+
this.adapter.registerBodyEventHandler("mouseup", a), this.adapter.registerBodyEventHandler("touchend", a), this.handleDown(t);
|
512
|
+
}, i.prototype.handlePointerdown = function(t) {
|
513
|
+
var e = t.button === 0;
|
514
|
+
e && (t.pointerId != null && this.adapter.setPointerCapture(t.pointerId), this.adapter.registerEventHandler("pointermove", this.moveListener), this.handleDown(t));
|
515
|
+
}, i.prototype.handleInputChange = function(t) {
|
516
|
+
var e = Number(this.adapter.getInputValue(t));
|
517
|
+
t === r.START ? this.setValueStart(e) : this.setValue(e), this.adapter.emitChangeEvent(t === r.START ? this.valueStart : this.value, t), this.adapter.emitInputEvent(t === r.START ? this.valueStart : this.value, t);
|
518
|
+
}, i.prototype.handleInputFocus = function(t) {
|
519
|
+
if (this.adapter.addThumbClass(h.THUMB_FOCUSED, t), !!this.isDiscrete && (this.adapter.addThumbClass(h.THUMB_WITH_INDICATOR, t), this.isRange)) {
|
520
|
+
var e = t === r.START ? r.END : r.START;
|
521
|
+
this.adapter.addThumbClass(h.THUMB_WITH_INDICATOR, e);
|
522
|
+
}
|
523
|
+
}, i.prototype.handleInputBlur = function(t) {
|
524
|
+
if (this.adapter.removeThumbClass(h.THUMB_FOCUSED, t), !!this.isDiscrete && (this.adapter.removeThumbClass(h.THUMB_WITH_INDICATOR, t), this.isRange)) {
|
525
|
+
var e = t === r.START ? r.END : r.START;
|
526
|
+
this.adapter.removeThumbClass(h.THUMB_WITH_INDICATOR, e);
|
527
|
+
}
|
528
|
+
}, i.prototype.handleDragStart = function(t, e, n) {
|
529
|
+
var a, d;
|
530
|
+
this.adapter.emitDragStartEvent(e, n), this.adapter.focusInput(n), !((d = (a = this.adapter).shouldHideFocusStylesForPointerEvents) === null || d === void 0) && d.call(a) && this.handleInputFocus(n), t.preventDefault();
|
531
|
+
}, i.prototype.getThumbFromDownEvent = function(t, e) {
|
532
|
+
if (!this.isRange)
|
533
|
+
return r.END;
|
534
|
+
var n = this.adapter.getThumbBoundingClientRect(r.START), a = this.adapter.getThumbBoundingClientRect(r.END), d = t >= n.left && t <= n.right, l = t >= a.left && t <= a.right;
|
535
|
+
return d && l ? null : d ? r.START : l ? r.END : e < this.valueStart ? r.START : e > this.value ? r.END : e - this.valueStart <= this.value - e ? r.START : r.END;
|
536
|
+
}, i.prototype.getThumbFromMoveEvent = function(t) {
|
537
|
+
if (this.thumb !== null)
|
538
|
+
return this.thumb;
|
539
|
+
if (this.downEventClientX === null)
|
540
|
+
throw new Error("`downEventClientX` is null after move event.");
|
541
|
+
var e = Math.abs(this.downEventClientX - t) < k.THUMB_UPDATE_MIN_PX;
|
542
|
+
if (e)
|
543
|
+
return this.thumb;
|
544
|
+
var n = t < this.downEventClientX;
|
545
|
+
return n ? this.adapter.isRTL() ? r.END : r.START : this.adapter.isRTL() ? r.START : r.END;
|
546
|
+
}, i.prototype.updateUI = function(t) {
|
547
|
+
t ? this.updateThumbAndInputAttributes(t) : (this.updateThumbAndInputAttributes(r.START), this.updateThumbAndInputAttributes(r.END)), this.updateThumbAndTrackUI(t), this.updateValueIndicatorUI(t), this.updateTickMarksUI();
|
548
|
+
}, i.prototype.updateThumbAndInputAttributes = function(t) {
|
549
|
+
if (t) {
|
550
|
+
var e = this.isRange && t === r.START ? this.valueStart : this.value, n = String(e);
|
551
|
+
this.adapter.setInputAttribute(c.INPUT_VALUE, n, t), this.isRange && t === r.START ? this.adapter.setInputAttribute(c.INPUT_MIN, String(e + this.minRange), r.END) : this.isRange && t === r.END && this.adapter.setInputAttribute(c.INPUT_MAX, String(e - this.minRange), r.START), this.adapter.getInputValue(t) !== n && this.adapter.setInputValue(n, t);
|
552
|
+
var a = this.adapter.getValueToAriaValueTextFn();
|
553
|
+
a && this.adapter.setInputAttribute(c.ARIA_VALUETEXT, a(e, t), t);
|
554
|
+
}
|
555
|
+
}, i.prototype.updateValueIndicatorUI = function(t) {
|
556
|
+
if (this.isDiscrete) {
|
557
|
+
var e = this.isRange && t === r.START ? this.valueStart : this.value;
|
558
|
+
this.adapter.setValueIndicatorText(e, t === r.START ? r.START : r.END), !t && this.isRange && this.adapter.setValueIndicatorText(this.valueStart, r.START);
|
559
|
+
}
|
560
|
+
}, i.prototype.updateTickMarksUI = function() {
|
561
|
+
if (!(!this.isDiscrete || !this.hasTickMarks)) {
|
562
|
+
var t = (this.valueStart - this.min) / this.step, e = (this.value - this.valueStart) / this.step + 1, n = (this.max - this.value) / this.step, a = Array.from({ length: t }).fill(E.INACTIVE), d = Array.from({ length: e }).fill(E.ACTIVE), l = Array.from({ length: n }).fill(E.INACTIVE);
|
563
|
+
this.adapter.updateTickMarks(a.concat(d).concat(l));
|
564
|
+
}
|
565
|
+
}, i.prototype.mapClientXOnSliderScale = function(t) {
|
566
|
+
var e = t - this.rect.left, n = e / this.rect.width;
|
567
|
+
this.adapter.isRTL() && (n = 1 - n);
|
568
|
+
var a = this.min + n * (this.max - this.min);
|
569
|
+
return a === this.max || a === this.min ? a : Number(this.quantize(a).toFixed(this.numDecimalPlaces));
|
570
|
+
}, i.prototype.quantize = function(t) {
|
571
|
+
var e = Math.round((t - this.min) / this.step);
|
572
|
+
return this.min + e * this.step;
|
573
|
+
}, i.prototype.updateValue = function(t, e, n) {
|
574
|
+
var a = n === void 0 ? {} : n, d = a.emitInputEvent;
|
575
|
+
if (t = this.clampValue(t, e), this.isRange && e === r.START) {
|
576
|
+
if (this.valueStart === t)
|
577
|
+
return;
|
578
|
+
this.valueStart = t;
|
579
|
+
} else {
|
580
|
+
if (this.value === t)
|
581
|
+
return;
|
582
|
+
this.value = t;
|
583
|
+
}
|
584
|
+
this.updateUI(e), d && this.adapter.emitInputEvent(e === r.START ? this.valueStart : this.value, e);
|
585
|
+
}, i.prototype.clampValue = function(t, e) {
|
586
|
+
t = Math.min(Math.max(t, this.min), this.max);
|
587
|
+
var n = this.isRange && e === r.START && t > this.value - this.minRange;
|
588
|
+
if (n)
|
589
|
+
return this.value - this.minRange;
|
590
|
+
var a = this.isRange && e === r.END && t < this.valueStart + this.minRange;
|
591
|
+
return a ? this.valueStart + this.minRange : t;
|
592
|
+
}, i.prototype.updateThumbAndTrackUI = function(t) {
|
593
|
+
var e = this, n = this, a = n.max, d = n.min, l = (this.value - this.valueStart) / (a - d), m = l * this.rect.width, v = this.adapter.isRTL(), T = M ? L(window, "transform") : "transform";
|
594
|
+
if (this.isRange) {
|
595
|
+
var A = this.adapter.isRTL() ? (a - this.value) / (a - d) * this.rect.width : (this.valueStart - d) / (a - d) * this.rect.width, D = A + m;
|
596
|
+
this.animFrame.request(S.SLIDER_UPDATE, function() {
|
597
|
+
var I = !v && t === r.START || v && t !== r.START;
|
598
|
+
I ? (e.adapter.setTrackActiveStyleProperty("transform-origin", "right"), e.adapter.setTrackActiveStyleProperty("left", "auto"), e.adapter.setTrackActiveStyleProperty("right", e.rect.width - D + "px")) : (e.adapter.setTrackActiveStyleProperty("transform-origin", "left"), e.adapter.setTrackActiveStyleProperty("right", "auto"), e.adapter.setTrackActiveStyleProperty("left", A + "px")), e.adapter.setTrackActiveStyleProperty(T, "scaleX(" + l + ")");
|
599
|
+
var N = v ? D : A, C = e.adapter.isRTL() ? A : D;
|
600
|
+
(t === r.START || !t || !e.initialStylesRemoved) && (e.adapter.setThumbStyleProperty(T, "translateX(" + N + "px)", r.START), e.alignValueIndicator(r.START, N)), (t === r.END || !t || !e.initialStylesRemoved) && (e.adapter.setThumbStyleProperty(T, "translateX(" + C + "px)", r.END), e.alignValueIndicator(r.END, C)), e.removeInitialStyles(v), e.updateOverlappingThumbsUI(N, C, t);
|
601
|
+
});
|
602
|
+
} else
|
603
|
+
this.animFrame.request(S.SLIDER_UPDATE, function() {
|
604
|
+
var I = v ? e.rect.width - m : m;
|
605
|
+
e.adapter.setThumbStyleProperty(T, "translateX(" + I + "px)", r.END), e.alignValueIndicator(r.END, I), e.adapter.setTrackActiveStyleProperty(T, "scaleX(" + l + ")"), e.removeInitialStyles(v);
|
606
|
+
});
|
607
|
+
}, i.prototype.alignValueIndicator = function(t, e) {
|
608
|
+
if (this.isDiscrete) {
|
609
|
+
var n = this.adapter.getThumbBoundingClientRect(t).width / 2, a = this.adapter.getValueIndicatorContainerWidth(t), d = this.adapter.getBoundingClientRect().width;
|
610
|
+
a / 2 > e + n ? (this.adapter.setThumbStyleProperty(p.VAR_VALUE_INDICATOR_CARET_LEFT, n + "px", t), this.adapter.setThumbStyleProperty(p.VAR_VALUE_INDICATOR_CARET_RIGHT, "auto", t), this.adapter.setThumbStyleProperty(p.VAR_VALUE_INDICATOR_CARET_TRANSFORM, "translateX(-50%)", t), this.adapter.setThumbStyleProperty(p.VAR_VALUE_INDICATOR_CONTAINER_LEFT, "0", t), this.adapter.setThumbStyleProperty(p.VAR_VALUE_INDICATOR_CONTAINER_RIGHT, "auto", t), this.adapter.setThumbStyleProperty(p.VAR_VALUE_INDICATOR_CONTAINER_TRANSFORM, "none", t)) : a / 2 > d - e + n ? (this.adapter.setThumbStyleProperty(p.VAR_VALUE_INDICATOR_CARET_LEFT, "auto", t), this.adapter.setThumbStyleProperty(p.VAR_VALUE_INDICATOR_CARET_RIGHT, n + "px", t), this.adapter.setThumbStyleProperty(p.VAR_VALUE_INDICATOR_CARET_TRANSFORM, "translateX(50%)", t), this.adapter.setThumbStyleProperty(p.VAR_VALUE_INDICATOR_CONTAINER_LEFT, "auto", t), this.adapter.setThumbStyleProperty(p.VAR_VALUE_INDICATOR_CONTAINER_RIGHT, "0", t), this.adapter.setThumbStyleProperty(p.VAR_VALUE_INDICATOR_CONTAINER_TRANSFORM, "none", t)) : (this.adapter.setThumbStyleProperty(p.VAR_VALUE_INDICATOR_CARET_LEFT, "50%", t), this.adapter.setThumbStyleProperty(p.VAR_VALUE_INDICATOR_CARET_RIGHT, "auto", t), this.adapter.setThumbStyleProperty(p.VAR_VALUE_INDICATOR_CARET_TRANSFORM, "translateX(-50%)", t), this.adapter.setThumbStyleProperty(p.VAR_VALUE_INDICATOR_CONTAINER_LEFT, "50%", t), this.adapter.setThumbStyleProperty(p.VAR_VALUE_INDICATOR_CONTAINER_RIGHT, "auto", t), this.adapter.setThumbStyleProperty(p.VAR_VALUE_INDICATOR_CONTAINER_TRANSFORM, "translateX(-50%)", t));
|
611
|
+
}
|
612
|
+
}, i.prototype.removeInitialStyles = function(t) {
|
613
|
+
if (!this.initialStylesRemoved) {
|
614
|
+
var e = t ? "right" : "left";
|
615
|
+
this.adapter.removeThumbStyleProperty(e, r.END), this.isRange && this.adapter.removeThumbStyleProperty(e, r.START), this.initialStylesRemoved = !0, this.resetTrackAndThumbAnimation();
|
616
|
+
}
|
617
|
+
}, i.prototype.resetTrackAndThumbAnimation = function() {
|
618
|
+
var t = this;
|
619
|
+
if (this.isDiscrete) {
|
620
|
+
var e = M ? L(window, "transition") : "transition", n = "none 0s ease 0s";
|
621
|
+
this.adapter.setThumbStyleProperty(e, n, r.END), this.isRange && this.adapter.setThumbStyleProperty(e, n, r.START), this.adapter.setTrackActiveStyleProperty(e, n), requestAnimationFrame(function() {
|
622
|
+
t.adapter.removeThumbStyleProperty(e, r.END), t.adapter.removeTrackActiveStyleProperty(e), t.isRange && t.adapter.removeThumbStyleProperty(e, r.START);
|
623
|
+
});
|
624
|
+
}
|
625
|
+
}, i.prototype.updateOverlappingThumbsUI = function(t, e, n) {
|
626
|
+
var a = !1;
|
627
|
+
if (this.adapter.isRTL()) {
|
628
|
+
var d = t - this.startThumbKnobWidth / 2, l = e + this.endThumbKnobWidth / 2;
|
629
|
+
a = l >= d;
|
630
|
+
} else {
|
631
|
+
var m = t + this.startThumbKnobWidth / 2, v = e - this.endThumbKnobWidth / 2;
|
632
|
+
a = m >= v;
|
633
|
+
}
|
634
|
+
a ? (this.adapter.addThumbClass(
|
635
|
+
h.THUMB_TOP,
|
636
|
+
// If no thumb was dragged (in the case of initial layout), end
|
637
|
+
// thumb is on top by default.
|
638
|
+
n || r.END
|
639
|
+
), this.adapter.removeThumbClass(h.THUMB_TOP, n === r.START ? r.END : r.START)) : (this.adapter.removeThumbClass(h.THUMB_TOP, r.START), this.adapter.removeThumbClass(h.THUMB_TOP, r.END));
|
640
|
+
}, i.prototype.convertAttributeValueToNumber = function(t, e) {
|
641
|
+
if (t === null)
|
642
|
+
throw new Error("MDCSliderFoundation: `" + e + "` must be non-null.");
|
643
|
+
var n = Number(t);
|
644
|
+
if (isNaN(n))
|
645
|
+
throw new Error("MDCSliderFoundation: `" + e + "` value is `" + t + "`, but must be a number.");
|
646
|
+
return n;
|
647
|
+
}, i.prototype.validateProperties = function(t) {
|
648
|
+
var e = t.min, n = t.max, a = t.value, d = t.valueStart, l = t.step, m = t.minRange;
|
649
|
+
if (e >= n)
|
650
|
+
throw new Error("MDCSliderFoundation: min must be strictly less than max. " + ("Current: [min: " + e + ", max: " + n + "]"));
|
651
|
+
if (l <= 0)
|
652
|
+
throw new Error("MDCSliderFoundation: step must be a positive number. " + ("Current step: " + l));
|
653
|
+
if (this.isRange) {
|
654
|
+
if (a < e || a > n || d < e || d > n)
|
655
|
+
throw new Error("MDCSliderFoundation: values must be in [min, max] range. " + ("Current values: [start value: " + d + ", end value: ") + (a + ", min: " + e + ", max: " + n + "]"));
|
656
|
+
if (d > a)
|
657
|
+
throw new Error("MDCSliderFoundation: start value must be <= end value. " + ("Current values: [start value: " + d + ", end value: " + a + "]"));
|
658
|
+
if (m < 0)
|
659
|
+
throw new Error("MDCSliderFoundation: minimum range must be non-negative. " + ("Current min range: " + m));
|
660
|
+
if (a - d < m)
|
661
|
+
throw new Error("MDCSliderFoundation: start value and end value must differ by at least " + (m + ". Current values: [start value: " + d + ", ") + ("end value: " + a + "]"));
|
662
|
+
var v = (d - e) / l, T = (a - e) / l;
|
663
|
+
if (!Number.isInteger(parseFloat(v.toFixed(6))) || !Number.isInteger(parseFloat(T.toFixed(6))))
|
664
|
+
throw new Error("MDCSliderFoundation: Slider values must be valid based on the " + ("step value (" + l + "). Current values: [start value: ") + (d + ", end value: " + a + ", min: " + e + "]"));
|
665
|
+
} else {
|
666
|
+
if (a < e || a > n)
|
667
|
+
throw new Error("MDCSliderFoundation: value must be in [min, max] range. " + ("Current values: [value: " + a + ", min: " + e + ", max: " + n + "]"));
|
668
|
+
var T = (a - e) / l;
|
669
|
+
if (!Number.isInteger(parseFloat(T.toFixed(6))))
|
670
|
+
throw new Error("MDCSliderFoundation: Slider value must be valid based on the " + ("step value (" + l + "). Current value: " + a));
|
671
|
+
}
|
672
|
+
}, i.prototype.registerEventHandlers = function() {
|
673
|
+
this.adapter.registerWindowEventHandler("resize", this.resizeListener), i.SUPPORTS_POINTER_EVENTS ? (this.adapter.registerEventHandler("pointerdown", this.pointerdownListener), this.adapter.registerEventHandler("pointerup", this.pointerupListener)) : (this.adapter.registerEventHandler("mousedown", this.mousedownOrTouchstartListener), this.adapter.registerEventHandler("touchstart", this.mousedownOrTouchstartListener)), this.isRange && (this.adapter.registerThumbEventHandler(r.START, "mouseenter", this.thumbMouseenterListener), this.adapter.registerThumbEventHandler(r.START, "mouseleave", this.thumbMouseleaveListener), this.adapter.registerInputEventHandler(r.START, "change", this.inputStartChangeListener), this.adapter.registerInputEventHandler(r.START, "focus", this.inputStartFocusListener), this.adapter.registerInputEventHandler(r.START, "blur", this.inputStartBlurListener)), this.adapter.registerThumbEventHandler(r.END, "mouseenter", this.thumbMouseenterListener), this.adapter.registerThumbEventHandler(r.END, "mouseleave", this.thumbMouseleaveListener), this.adapter.registerInputEventHandler(r.END, "change", this.inputEndChangeListener), this.adapter.registerInputEventHandler(r.END, "focus", this.inputEndFocusListener), this.adapter.registerInputEventHandler(r.END, "blur", this.inputEndBlurListener);
|
674
|
+
}, i.prototype.deregisterEventHandlers = function() {
|
675
|
+
this.adapter.deregisterWindowEventHandler("resize", this.resizeListener), i.SUPPORTS_POINTER_EVENTS ? (this.adapter.deregisterEventHandler("pointerdown", this.pointerdownListener), this.adapter.deregisterEventHandler("pointerup", this.pointerupListener)) : (this.adapter.deregisterEventHandler("mousedown", this.mousedownOrTouchstartListener), this.adapter.deregisterEventHandler("touchstart", this.mousedownOrTouchstartListener)), this.isRange && (this.adapter.deregisterThumbEventHandler(r.START, "mouseenter", this.thumbMouseenterListener), this.adapter.deregisterThumbEventHandler(r.START, "mouseleave", this.thumbMouseleaveListener), this.adapter.deregisterInputEventHandler(r.START, "change", this.inputStartChangeListener), this.adapter.deregisterInputEventHandler(r.START, "focus", this.inputStartFocusListener), this.adapter.deregisterInputEventHandler(r.START, "blur", this.inputStartBlurListener)), this.adapter.deregisterThumbEventHandler(r.END, "mouseenter", this.thumbMouseenterListener), this.adapter.deregisterThumbEventHandler(r.END, "mouseleave", this.thumbMouseleaveListener), this.adapter.deregisterInputEventHandler(r.END, "change", this.inputEndChangeListener), this.adapter.deregisterInputEventHandler(r.END, "focus", this.inputEndFocusListener), this.adapter.deregisterInputEventHandler(r.END, "blur", this.inputEndBlurListener);
|
676
|
+
}, i.prototype.handlePointerup = function() {
|
677
|
+
this.handleUp(), this.adapter.deregisterEventHandler("pointermove", this.moveListener);
|
678
|
+
}, i.SUPPORTS_POINTER_EVENTS = M && Boolean(window.PointerEvent) && // #setPointerCapture is buggy on iOS, so we can't use pointer events
|
679
|
+
// until the following bug is fixed:
|
680
|
+
// https://bugs.webkit.org/show_bug.cgi?id=220196
|
681
|
+
!q(), i;
|
682
|
+
}(z)
|
683
|
+
);
|
684
|
+
function q() {
|
685
|
+
return [
|
686
|
+
"iPad Simulator",
|
687
|
+
"iPhone Simulator",
|
688
|
+
"iPod Simulator",
|
689
|
+
"iPad",
|
690
|
+
"iPhone",
|
691
|
+
"iPod"
|
692
|
+
].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
|
693
|
+
}
|
694
|
+
function U(s) {
|
695
|
+
var i = /(?:\.(\d+))?(?:[eE]([+\-]?\d+))?$/.exec(String(s));
|
696
|
+
if (!i)
|
697
|
+
return 0;
|
698
|
+
var t = i[1] || "", e = i[2] || 0;
|
699
|
+
return Math.max(
|
700
|
+
0,
|
701
|
+
// lower limit
|
702
|
+
(t === "0" ? 0 : t.length) - Number(e)
|
703
|
+
);
|
704
|
+
}
|
705
|
+
/**
|
706
|
+
* @license
|
707
|
+
* Copyright 2018 Google LLC
|
708
|
+
* SPDX-License-Identifier: Apache-2.0
|
709
|
+
*/
|
710
|
+
class u extends B {
|
711
|
+
constructor() {
|
712
|
+
super(...arguments), this.mdcFoundationClass = G, this.disabled = !1, this.min = 0, this.max = 100, this.valueEnd = 0, this.name = "", this.step = 1, this.withTickMarks = !1, this.discrete = !1, this.tickMarks = [], this.trackTransformOriginStyle = "", this.trackLeftStyle = "", this.trackRightStyle = "", this.trackTransitionStyle = "", this.endThumbWithIndicator = !1, this.endThumbTop = !1, this.shouldRenderEndRipple = !1, this.endThumbTransformStyle = "", this.endThumbTransitionStyle = "", this.endThumbCssProperties = {}, this.valueToAriaTextTransform = null, this.valueToValueIndicatorTransform = (i) => `${i}`, this.boundMoveListener = null, this.endRippleHandlers = new O(() => (this.shouldRenderEndRipple = !0, this.endRipple));
|
713
|
+
}
|
714
|
+
update(i) {
|
715
|
+
if (i.has("valueEnd") && this.mdcFoundation) {
|
716
|
+
this.mdcFoundation.setValue(this.valueEnd);
|
717
|
+
const t = this.mdcFoundation.getValue();
|
718
|
+
t !== this.valueEnd && (this.valueEnd = t);
|
719
|
+
}
|
720
|
+
i.has("discrete") && (this.discrete || (this.tickMarks = [])), super.update(i);
|
721
|
+
}
|
722
|
+
render() {
|
723
|
+
return this.renderRootEl(_`
|
724
|
+
${this.renderStartInput()}
|
725
|
+
${this.renderEndInput()}
|
726
|
+
${this.renderTrack()}
|
727
|
+
${this.renderTickMarks()}
|
728
|
+
${this.renderStartThumb()}
|
729
|
+
${this.renderEndThumb()}`);
|
730
|
+
}
|
731
|
+
renderRootEl(i) {
|
732
|
+
const t = P({
|
733
|
+
"mdc-slider--disabled": this.disabled,
|
734
|
+
"mdc-slider--discrete": this.discrete
|
735
|
+
});
|
736
|
+
return _`
|
737
|
+
<div
|
738
|
+
class="mdc-slider ${t}"
|
739
|
+
@pointerdown=${this.onPointerdown}
|
740
|
+
@pointerup=${this.onPointerup}
|
741
|
+
@contextmenu=${this.onContextmenu}>
|
742
|
+
${i}
|
743
|
+
</div>`;
|
744
|
+
}
|
745
|
+
renderStartInput() {
|
746
|
+
return g;
|
747
|
+
}
|
748
|
+
renderEndInput() {
|
749
|
+
var i;
|
750
|
+
return _`
|
751
|
+
<input
|
752
|
+
class="mdc-slider__input end"
|
753
|
+
type="range"
|
754
|
+
step=${this.step}
|
755
|
+
min=${this.min}
|
756
|
+
max=${this.max}
|
757
|
+
.value=${this.valueEnd}
|
758
|
+
@change=${this.onEndChange}
|
759
|
+
@focus=${this.onEndFocus}
|
760
|
+
@blur=${this.onEndBlur}
|
761
|
+
?disabled=${this.disabled}
|
762
|
+
name=${this.name}
|
763
|
+
aria-label=${R(this.ariaLabel)}
|
764
|
+
aria-labelledby=${R(this.ariaLabelledBy)}
|
765
|
+
aria-describedby=${R(this.ariaDescribedBy)}
|
766
|
+
aria-valuetext=${R((i = this.valueToAriaTextTransform) === null || i === void 0 ? void 0 : i.call(this, this.valueEnd))}>
|
767
|
+
`;
|
768
|
+
}
|
769
|
+
renderTrack() {
|
770
|
+
return g;
|
771
|
+
}
|
772
|
+
renderTickMarks() {
|
773
|
+
return this.withTickMarks ? _`
|
774
|
+
<div class="mdc-slider__tick-marks">
|
775
|
+
${this.tickMarks.map((i) => {
|
776
|
+
const t = i === E.ACTIVE;
|
777
|
+
return _`<div class="${t ? "mdc-slider__tick-mark--active" : "mdc-slider__tick-mark--inactive"}"></div>`;
|
778
|
+
})}
|
779
|
+
</div>` : g;
|
780
|
+
}
|
781
|
+
renderStartThumb() {
|
782
|
+
return g;
|
783
|
+
}
|
784
|
+
renderEndThumb() {
|
785
|
+
const i = P({
|
786
|
+
"mdc-slider__thumb--with-indicator": this.endThumbWithIndicator,
|
787
|
+
"mdc-slider__thumb--top": this.endThumbTop
|
788
|
+
}), t = W(Object.assign({ "-webkit-transform": this.endThumbTransformStyle, transform: this.endThumbTransformStyle, "-webkit-transition": this.endThumbTransitionStyle, transition: this.endThumbTransitionStyle, left: this.endThumbTransformStyle || getComputedStyle(this).direction === "rtl" ? "" : `calc(${(this.valueEnd - this.min) / (this.max - this.min) * 100}% - 24px)`, right: this.endThumbTransformStyle || getComputedStyle(this).direction !== "rtl" ? "" : `calc(${(this.valueEnd - this.min) / (this.max - this.min) * 100}% - 24px)` }, this.endThumbCssProperties)), e = this.shouldRenderEndRipple ? _`<mwc-ripple class="ripple" unbounded></mwc-ripple>` : g;
|
789
|
+
return _`
|
790
|
+
<div
|
791
|
+
class="mdc-slider__thumb end ${i}"
|
792
|
+
style=${t}
|
793
|
+
@mouseenter=${this.onEndMouseenter}
|
794
|
+
@mouseleave=${this.onEndMouseleave}>
|
795
|
+
${e}
|
796
|
+
${this.renderValueIndicator(this.valueToValueIndicatorTransform(this.valueEnd))}
|
797
|
+
<div class="mdc-slider__thumb-knob"></div>
|
798
|
+
</div>
|
799
|
+
`;
|
800
|
+
}
|
801
|
+
renderValueIndicator(i) {
|
802
|
+
return this.discrete ? _`
|
803
|
+
<div class="mdc-slider__value-indicator-container" aria-hidden="true">
|
804
|
+
<div class="mdc-slider__value-indicator">
|
805
|
+
<span class="mdc-slider__value-indicator-text">
|
806
|
+
${i}
|
807
|
+
</span>
|
808
|
+
</div>
|
809
|
+
</div>` : g;
|
810
|
+
}
|
811
|
+
disconnectedCallback() {
|
812
|
+
super.disconnectedCallback(), this.mdcFoundation && this.mdcFoundation.destroy();
|
813
|
+
}
|
814
|
+
createAdapter() {
|
815
|
+
}
|
816
|
+
async firstUpdated() {
|
817
|
+
super.firstUpdated(), await this.layout(!0);
|
818
|
+
}
|
819
|
+
updated(i) {
|
820
|
+
super.updated(i), this.mdcFoundation && (i.has("disabled") && this.mdcFoundation.setDisabled(this.disabled), i.has("min") && this.mdcFoundation.setMin(this.min), i.has("max") && this.mdcFoundation.setMax(this.max), i.has("step") && this.mdcFoundation.setStep(this.step), i.has("discrete") && this.mdcFoundation.setIsDiscrete(this.discrete), i.has("withTickMarks") && this.mdcFoundation.setHasTickMarks(this.withTickMarks));
|
821
|
+
}
|
822
|
+
async layout(i = !1) {
|
823
|
+
var t;
|
824
|
+
(t = this.mdcFoundation) === null || t === void 0 || t.layout({ skipUpdateUI: i }), this.requestUpdate(), await this.updateComplete;
|
825
|
+
}
|
826
|
+
onEndChange(i) {
|
827
|
+
var t;
|
828
|
+
this.valueEnd = Number(i.target.value), (t = this.mdcFoundation) === null || t === void 0 || t.handleInputChange(r.END);
|
829
|
+
}
|
830
|
+
onEndFocus() {
|
831
|
+
var i;
|
832
|
+
(i = this.mdcFoundation) === null || i === void 0 || i.handleInputFocus(r.END), this.endRippleHandlers.startFocus();
|
833
|
+
}
|
834
|
+
onEndBlur() {
|
835
|
+
var i;
|
836
|
+
(i = this.mdcFoundation) === null || i === void 0 || i.handleInputBlur(r.END), this.endRippleHandlers.endFocus();
|
837
|
+
}
|
838
|
+
onEndMouseenter() {
|
839
|
+
var i;
|
840
|
+
(i = this.mdcFoundation) === null || i === void 0 || i.handleThumbMouseenter(), this.endRippleHandlers.startHover();
|
841
|
+
}
|
842
|
+
onEndMouseleave() {
|
843
|
+
var i;
|
844
|
+
(i = this.mdcFoundation) === null || i === void 0 || i.handleThumbMouseleave(), this.endRippleHandlers.endHover();
|
845
|
+
}
|
846
|
+
onPointerdown(i) {
|
847
|
+
this.layout(), this.mdcFoundation && (this.mdcFoundation.handlePointerdown(i), this.boundMoveListener = this.mdcFoundation.handleMove.bind(this.mdcFoundation), this.mdcRoot.addEventListener("pointermove", this.boundMoveListener));
|
848
|
+
}
|
849
|
+
onPointerup() {
|
850
|
+
this.mdcFoundation && (this.mdcFoundation.handleUp(), this.boundMoveListener && (this.mdcRoot.removeEventListener("pointermove", this.boundMoveListener), this.boundMoveListener = null));
|
851
|
+
}
|
852
|
+
onContextmenu(i) {
|
853
|
+
i.preventDefault();
|
854
|
+
}
|
855
|
+
setFormData(i) {
|
856
|
+
this.name && i.append(this.name, `${this.valueEnd}`);
|
857
|
+
}
|
858
|
+
}
|
859
|
+
o([
|
860
|
+
y("input.end")
|
861
|
+
], u.prototype, "formElement", void 0);
|
862
|
+
o([
|
863
|
+
y(".mdc-slider")
|
864
|
+
], u.prototype, "mdcRoot", void 0);
|
865
|
+
o([
|
866
|
+
y(".end.mdc-slider__thumb")
|
867
|
+
], u.prototype, "endThumb", void 0);
|
868
|
+
o([
|
869
|
+
y(".end.mdc-slider__thumb .mdc-slider__thumb-knob")
|
870
|
+
], u.prototype, "endThumbKnob", void 0);
|
871
|
+
o([
|
872
|
+
y(".end.mdc-slider__thumb .mdc-slider__value-indicator-container")
|
873
|
+
], u.prototype, "endValueIndicatorContainer", void 0);
|
874
|
+
o([
|
875
|
+
H(".end .ripple")
|
876
|
+
], u.prototype, "endRipple", void 0);
|
877
|
+
o([
|
878
|
+
f({ type: Boolean, reflect: !0 })
|
879
|
+
], u.prototype, "disabled", void 0);
|
880
|
+
o([
|
881
|
+
f({ type: Number })
|
882
|
+
], u.prototype, "min", void 0);
|
883
|
+
o([
|
884
|
+
f({ type: Number })
|
885
|
+
], u.prototype, "max", void 0);
|
886
|
+
o([
|
887
|
+
f({ type: Number })
|
888
|
+
], u.prototype, "valueEnd", void 0);
|
889
|
+
o([
|
890
|
+
f({ type: String })
|
891
|
+
], u.prototype, "name", void 0);
|
892
|
+
o([
|
893
|
+
f({ type: Number })
|
894
|
+
], u.prototype, "step", void 0);
|
895
|
+
o([
|
896
|
+
f({ type: Boolean })
|
897
|
+
], u.prototype, "withTickMarks", void 0);
|
898
|
+
o([
|
899
|
+
f({ type: Boolean })
|
900
|
+
], u.prototype, "discrete", void 0);
|
901
|
+
o([
|
902
|
+
b()
|
903
|
+
], u.prototype, "tickMarks", void 0);
|
904
|
+
o([
|
905
|
+
b()
|
906
|
+
], u.prototype, "trackTransformOriginStyle", void 0);
|
907
|
+
o([
|
908
|
+
b()
|
909
|
+
], u.prototype, "trackLeftStyle", void 0);
|
910
|
+
o([
|
911
|
+
b()
|
912
|
+
], u.prototype, "trackRightStyle", void 0);
|
913
|
+
o([
|
914
|
+
b()
|
915
|
+
], u.prototype, "trackTransitionStyle", void 0);
|
916
|
+
o([
|
917
|
+
b()
|
918
|
+
], u.prototype, "endThumbWithIndicator", void 0);
|
919
|
+
o([
|
920
|
+
b()
|
921
|
+
], u.prototype, "endThumbTop", void 0);
|
922
|
+
o([
|
923
|
+
b()
|
924
|
+
], u.prototype, "shouldRenderEndRipple", void 0);
|
925
|
+
o([
|
926
|
+
b()
|
927
|
+
], u.prototype, "endThumbTransformStyle", void 0);
|
928
|
+
o([
|
929
|
+
b()
|
930
|
+
], u.prototype, "endThumbTransitionStyle", void 0);
|
931
|
+
o([
|
932
|
+
b()
|
933
|
+
], u.prototype, "endThumbCssProperties", void 0);
|
934
|
+
o([
|
935
|
+
w,
|
936
|
+
f({ type: String, attribute: "aria-label" })
|
937
|
+
], u.prototype, "ariaLabel", void 0);
|
938
|
+
o([
|
939
|
+
w,
|
940
|
+
f({ type: String, attribute: "aria-labelledby" })
|
941
|
+
], u.prototype, "ariaLabelledBy", void 0);
|
942
|
+
o([
|
943
|
+
w,
|
944
|
+
f({ type: String, attribute: "aria-describedby" })
|
945
|
+
], u.prototype, "ariaDescribedBy", void 0);
|
946
|
+
/**
|
947
|
+
* @license
|
948
|
+
* Copyright 2021 Google LLC
|
949
|
+
* SPDX-LIcense-Identifier: Apache-2.0
|
950
|
+
*/
|
951
|
+
const st = $`.mdc-slider{cursor:pointer;height:48px;margin:0 24px;position:relative;touch-action:pan-y}.mdc-slider .mdc-slider__track{height:4px;position:absolute;top:50%;transform:translateY(-50%);width:100%}.mdc-slider .mdc-slider__track--active,.mdc-slider .mdc-slider__track--inactive{display:flex;height:100%;position:absolute;width:100%}.mdc-slider .mdc-slider__track--active{border-radius:3px;height:6px;overflow:hidden;top:-1px}.mdc-slider .mdc-slider__track--active_fill{border-top:6px solid;box-sizing:border-box;height:100%;width:100%;position:relative;-webkit-transform-origin:left;transform-origin:left}[dir=rtl] .mdc-slider .mdc-slider__track--active_fill,.mdc-slider .mdc-slider__track--active_fill[dir=rtl]{-webkit-transform-origin:right;transform-origin:right}.mdc-slider .mdc-slider__track--inactive{border-radius:2px;height:4px;left:0;top:0}.mdc-slider .mdc-slider__track--inactive::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid transparent;border-radius:inherit;content:"";pointer-events:none}@media screen and (forced-colors: active){.mdc-slider .mdc-slider__track--inactive::before{border-color:CanvasText}}.mdc-slider .mdc-slider__track--active_fill{border-color:#6200ee;border-color:var(--mdc-theme-primary, #6200ee)}.mdc-slider.mdc-slider--disabled .mdc-slider__track--active_fill{border-color:#000;border-color:var(--mdc-theme-on-surface, #000)}.mdc-slider .mdc-slider__track--inactive{background-color:#6200ee;background-color:var(--mdc-theme-primary, #6200ee);opacity:.24}.mdc-slider.mdc-slider--disabled .mdc-slider__track--inactive{background-color:#000;background-color:var(--mdc-theme-on-surface, #000);opacity:.24}.mdc-slider .mdc-slider__value-indicator-container{bottom:44px;left:50%;left:var(--slider-value-indicator-container-left, 50%);pointer-events:none;position:absolute;right:var(--slider-value-indicator-container-right);transform:translateX(-50%);transform:var(--slider-value-indicator-container-transform, translateX(-50%))}.mdc-slider .mdc-slider__value-indicator{transition:transform 100ms 0ms cubic-bezier(0.4, 0, 1, 1);align-items:center;border-radius:4px;display:flex;height:32px;padding:0 12px;transform:scale(0);transform-origin:bottom}.mdc-slider .mdc-slider__value-indicator::before{border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid;bottom:-5px;content:"";height:0;left:50%;left:var(--slider-value-indicator-caret-left, 50%);position:absolute;right:var(--slider-value-indicator-caret-right);transform:translateX(-50%);transform:var(--slider-value-indicator-caret-transform, translateX(-50%));width:0}.mdc-slider .mdc-slider__value-indicator::after{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid transparent;border-radius:inherit;content:"";pointer-events:none}@media screen and (forced-colors: active){.mdc-slider .mdc-slider__value-indicator::after{border-color:CanvasText}}.mdc-slider .mdc-slider__thumb--with-indicator .mdc-slider__value-indicator-container{pointer-events:auto}.mdc-slider .mdc-slider__thumb--with-indicator .mdc-slider__value-indicator{transition:transform 100ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:scale(1)}@media(prefers-reduced-motion){.mdc-slider .mdc-slider__value-indicator,.mdc-slider .mdc-slider__thumb--with-indicator .mdc-slider__value-indicator{transition:none}}.mdc-slider .mdc-slider__value-indicator-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto, sans-serif;font-family:var(--mdc-typography-subtitle2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:0.875rem;font-size:var(--mdc-typography-subtitle2-font-size, 0.875rem);line-height:1.375rem;line-height:var(--mdc-typography-subtitle2-line-height, 1.375rem);font-weight:500;font-weight:var(--mdc-typography-subtitle2-font-weight, 500);letter-spacing:0.0071428571em;letter-spacing:var(--mdc-typography-subtitle2-letter-spacing, 0.0071428571em);text-decoration:inherit;text-decoration:var(--mdc-typography-subtitle2-text-decoration, inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle2-text-transform, inherit)}.mdc-slider .mdc-slider__value-indicator{background-color:#000;opacity:.6}.mdc-slider .mdc-slider__value-indicator::before{border-top-color:#000}.mdc-slider .mdc-slider__value-indicator{color:#fff;color:var(--mdc-theme-on-primary, #fff)}.mdc-slider .mdc-slider__thumb{display:flex;height:48px;left:-24px;outline:none;position:absolute;user-select:none;width:48px}.mdc-slider .mdc-slider__thumb--top{z-index:1}.mdc-slider .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-style:solid;border-width:1px;box-sizing:content-box}.mdc-slider .mdc-slider__thumb-knob{box-shadow:0px 2px 1px -1px rgba(0, 0, 0, 0.2),0px 1px 1px 0px rgba(0, 0, 0, 0.14),0px 1px 3px 0px rgba(0,0,0,.12);border:10px solid;border-radius:50%;box-sizing:border-box;height:20px;left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);width:20px}.mdc-slider .mdc-slider__thumb-knob{background-color:#6200ee;background-color:var(--mdc-theme-primary, #6200ee);border-color:#6200ee;border-color:var(--mdc-theme-primary, #6200ee)}.mdc-slider .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mdc-slider .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mdc-slider.mdc-slider--disabled .mdc-slider__thumb-knob{background-color:#000;background-color:var(--mdc-theme-on-surface, #000);border-color:#000;border-color:var(--mdc-theme-on-surface, #000)}.mdc-slider.mdc-slider--disabled .mdc-slider__thumb--top .mdc-slider__thumb-knob,.mdc-slider.mdc-slider--disabled .mdc-slider__thumb--top.mdc-slider__thumb:hover .mdc-slider__thumb-knob,.mdc-slider.mdc-slider--disabled .mdc-slider__thumb--top.mdc-slider__thumb--focused .mdc-slider__thumb-knob{border-color:#fff}.mdc-slider .mdc-slider__thumb::before,.mdc-slider .mdc-slider__thumb::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-slider .mdc-slider__thumb:hover::before,.mdc-slider .mdc-slider__thumb.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-slider .mdc-slider__thumb.mdc-ripple-upgraded--background-focused::before,.mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-slider .mdc-slider__thumb:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-slider .mdc-slider__thumb.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-slider .mdc-slider__tick-marks{align-items:center;box-sizing:border-box;display:flex;height:100%;justify-content:space-between;padding:0 1px;position:absolute;width:100%}.mdc-slider .mdc-slider__tick-mark--active,.mdc-slider .mdc-slider__tick-mark--inactive{border-radius:50%;height:2px;width:2px}.mdc-slider .mdc-slider__tick-mark--active{background-color:#fff;background-color:var(--mdc-theme-on-primary, #fff);opacity:.6}.mdc-slider.mdc-slider--disabled .mdc-slider__tick-mark--active{background-color:#fff;background-color:var(--mdc-theme-on-primary, #fff);opacity:.6}.mdc-slider .mdc-slider__tick-mark--inactive{background-color:#6200ee;background-color:var(--mdc-theme-primary, #6200ee);opacity:.6}.mdc-slider.mdc-slider--disabled .mdc-slider__tick-mark--inactive{background-color:#000;background-color:var(--mdc-theme-on-surface, #000);opacity:.6}.mdc-slider--discrete .mdc-slider__thumb,.mdc-slider--discrete .mdc-slider__track--active_fill{transition:transform 80ms ease}@media(prefers-reduced-motion){.mdc-slider--discrete .mdc-slider__thumb,.mdc-slider--discrete .mdc-slider__track--active_fill{transition:none}}.mdc-slider--disabled{opacity:.38;cursor:auto}.mdc-slider--disabled .mdc-slider__thumb{pointer-events:none}.mdc-slider__input{cursor:pointer;left:0;margin:0;height:100%;opacity:0;pointer-events:none;position:absolute;top:0;width:100%}:host{outline:none;display:block;-webkit-tap-highlight-color:transparent}.ripple{--mdc-ripple-color:#6200ee;--mdc-ripple-color:var(--mdc-theme-primary, #6200ee)}`;
|
952
|
+
export {
|
953
|
+
u as S,
|
954
|
+
r as T,
|
955
|
+
st as s
|
956
|
+
};
|