@cupra/ui-kit 2.0.0-canary.64 → 2.0.0-canary.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/ds-slider/ds-slider.cjs +29 -29
- package/dist/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
- package/dist/cjs/utils/IconsManager.cjs +1 -1
- package/dist/cjs/utils/PubSub.cjs +1 -1
- package/dist/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
- package/dist/cjs/utils/cssWithTokens.cjs +1 -1
- package/dist/cjs/utils/htmlWithTokens.cjs +1 -1
- package/dist/esm/components/ds-slider/ds-slider.js +116 -134
- package/dist/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
- package/dist/esm/utils/IconsManager.js +1 -1
- package/dist/esm/utils/PubSub.js +1 -1
- package/dist/esm/utils/StylesRegistry/StylesRegistry.js +1 -1
- package/dist/esm/utils/cssWithTokens.js +1 -1
- package/dist/esm/utils/htmlWithTokens.js +1 -1
- package/dist/types/components/ds-slider/ds-slider.d.ts +8 -1
- package/dist-react/cjs/components/ds-slider/ds-slider.cjs +29 -29
- package/dist-react/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
- package/dist-react/cjs/utils/IconsManager.cjs +1 -1
- package/dist-react/cjs/utils/PubSub.cjs +1 -1
- package/dist-react/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
- package/dist-react/cjs/utils/cssWithTokens.cjs +1 -1
- package/dist-react/cjs/utils/htmlWithTokens.cjs +1 -1
- package/dist-react/esm/components/ds-slider/ds-slider.js +116 -134
- package/dist-react/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
- package/dist-react/esm/utils/IconsManager.js +1 -1
- package/dist-react/esm/utils/PubSub.js +1 -1
- package/dist-react/esm/utils/StylesRegistry/StylesRegistry.js +1 -1
- package/dist-react/esm/utils/cssWithTokens.js +1 -1
- package/dist-react/esm/utils/htmlWithTokens.js +1 -1
- package/dist-react/types/components/ds-slider/ds-slider.d.ts +8 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { UiKitElement as
|
|
2
|
-
import { getStepValue as
|
|
3
|
-
import { roundToDecimals as
|
|
1
|
+
import { UiKitElement as S } from "../base/UiKitElement.js";
|
|
2
|
+
import { getStepValue as x } from "./utils/getStepValue/getStepValue.js";
|
|
3
|
+
import { roundToDecimals as $ } from "./utils/roundToDecimals/roundToDecimals.js";
|
|
4
4
|
import { customUiKitElement as V } from "../../decorators/customUiKitElement.js";
|
|
5
5
|
import { ViewportMixin as _ } from "../../mixins/ViewportMixin.js";
|
|
6
6
|
import { booleanConverter as T } from "../../utils/booleanConverter.js";
|
|
7
|
-
import { formatNumber as
|
|
8
|
-
import { htmlWithTokens as
|
|
7
|
+
import { formatNumber as P } from "../../utils/formatNumber/formatNumber.js";
|
|
8
|
+
import { htmlWithTokens as L } from "../../utils/htmlWithTokens.js";
|
|
9
9
|
import { objectConverter as D } from "../../utils/objectConverter.js";
|
|
10
10
|
import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
|
|
11
11
|
import { nothing as h, html as l } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
@@ -13,36 +13,26 @@ import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-
|
|
|
13
13
|
import { property as r } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
|
|
14
14
|
import { state as p } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
|
|
15
15
|
import { query as k } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.js";
|
|
16
|
-
import { classMap as
|
|
17
|
-
import { live as
|
|
18
|
-
import { commonStyles as
|
|
19
|
-
var
|
|
20
|
-
for (var o =
|
|
21
|
-
(m = t[u]) && (o = (
|
|
22
|
-
return
|
|
16
|
+
import { classMap as R } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
|
|
17
|
+
import { live as E } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/live.js";
|
|
18
|
+
import { commonStyles as I, trackStyles as F, thumbStyles as C, currentValueStyles as N, rangeValueStyles as A } from "./styles/common.styles.js";
|
|
19
|
+
var U = Object.defineProperty, B = Object.getOwnPropertyDescriptor, n = (t, e, i, a) => {
|
|
20
|
+
for (var o = a > 1 ? void 0 : a ? B(e, i) : e, u = t.length - 1, m; u >= 0; u--)
|
|
21
|
+
(m = t[u]) && (o = (a ? m(e, i, o) : m(o)) || o);
|
|
22
|
+
return a && o && U(e, i, o), o;
|
|
23
23
|
};
|
|
24
|
-
let s = class extends _(
|
|
24
|
+
let s = class extends _(S) {
|
|
25
25
|
constructor() {
|
|
26
26
|
super(...arguments), this.min = 0, this.max = 100, this.minLabel = "", this.maxLabel = "", this.step = 1, this.initialValueMin = 0, this.mode = "light", this.locale = void 0, this.localeMatcher = "lookup", this.useGrouping = !0, this.minimumIntegerDigits = 1, this.minimumFractionDigits = 0, this.maximumFractionDigits = 3, this.size = "medium", this.disabled = !1, this.keyboardMode = !1, this.getNewValue = (t) => {
|
|
27
|
-
const { width: e, left: i } = this.track.getBoundingClientRect(),
|
|
28
|
-
return this.min +
|
|
27
|
+
const { width: e, left: i } = this.track.getBoundingClientRect(), a = this.thumbRadius, o = t.type.indexOf("mouse") !== -1 ? t.clientX : t.touches[0].clientX, u = e - a * 2, m = Math.min(Math.max(0, o - i - a), u), d = u > 0 ? m * 100 / u : 0;
|
|
28
|
+
return this.min + d * (this.max - this.min) / 100;
|
|
29
29
|
}, this.setActiveThumb = (t) => {
|
|
30
30
|
const e = this.getNewValue(t);
|
|
31
31
|
typeof this._valueMax != "number" || e <= this._valueMin ? this.activeThumb = "min" : e >= this._valueMax ? this.activeThumb = "max" : e - this._valueMin < this._valueMax - e ? this.activeThumb = "min" : this.activeThumb = "max";
|
|
32
32
|
}, this.handleMouseMove = (t) => {
|
|
33
33
|
this.animationFrameRequest && cancelAnimationFrame(this.animationFrameRequest), this.animationFrameRequest = requestAnimationFrame(() => {
|
|
34
|
-
const e = this.getNewValue(t), i = this.activeThumb ?? "min", { stepValue:
|
|
35
|
-
|
|
36
|
-
min: this.min,
|
|
37
|
-
max: this.max,
|
|
38
|
-
proposedValue: e,
|
|
39
|
-
role: i,
|
|
40
|
-
currentValues: {
|
|
41
|
-
1: this._valueMin,
|
|
42
|
-
...typeof this._valueMax == "number" ? { 2: this._valueMax } : {}
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
this.handleChange({ value: n, role: i });
|
|
34
|
+
const e = this.getNewValue(t), i = this.activeThumb ?? "min", { stepValue: a } = this.computeStep({ proposedValue: e, role: i });
|
|
35
|
+
this.handleChange({ value: a, role: i });
|
|
46
36
|
});
|
|
47
37
|
}, this.handleMouseDown = (t) => {
|
|
48
38
|
var e;
|
|
@@ -54,23 +44,13 @@ let s = class extends _($) {
|
|
|
54
44
|
}, this.handlePointerOrMouseDown = () => {
|
|
55
45
|
this.keyboardMode = !1;
|
|
56
46
|
}, this.onInputFocus = (t, e) => {
|
|
57
|
-
const i = t.currentTarget,
|
|
58
|
-
this.editingField =
|
|
59
|
-
const o =
|
|
47
|
+
const i = t.currentTarget, a = this.getRoleById(e);
|
|
48
|
+
this.editingField = a, i.type = "number", i.step = String(this.step ?? 1);
|
|
49
|
+
const o = a === "min" ? this._valueMin : this._valueMax;
|
|
60
50
|
i.value = String(o ?? ""), this.keyboardMode && i.classList.add("focus-visible");
|
|
61
51
|
}, this.commitInputValue = (t, e) => {
|
|
62
|
-
const i = t.currentTarget,
|
|
63
|
-
|
|
64
|
-
min: this.min,
|
|
65
|
-
max: this.max,
|
|
66
|
-
proposedValue: Number(i.value),
|
|
67
|
-
role: n,
|
|
68
|
-
currentValues: {
|
|
69
|
-
1: this._valueMin,
|
|
70
|
-
...typeof this._valueMax == "number" ? { 2: this._valueMax } : {}
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
this.handleChange({ value: o, role: n }), this.isControlled(n) || (i.value = String(o));
|
|
52
|
+
const i = t.currentTarget, a = this.getRoleById(e), { stepValue: o } = this.computeStep({ proposedValue: Number(i.value), role: a });
|
|
53
|
+
this.handleChange({ value: o, role: a }), this.isControlled(a) || (i.value = String(o));
|
|
74
54
|
}, this.onInputBlur = (t) => {
|
|
75
55
|
var i;
|
|
76
56
|
this.editingField = void 0;
|
|
@@ -81,18 +61,8 @@ let s = class extends _($) {
|
|
|
81
61
|
}, this.onThumbKeyDown = (t, e) => {
|
|
82
62
|
if (!this.disabled && (t.key === "ArrowLeft" || t.key === "ArrowRight")) {
|
|
83
63
|
t.preventDefault();
|
|
84
|
-
const i = this.step ?? 1,
|
|
85
|
-
|
|
86
|
-
min: this.min,
|
|
87
|
-
max: this.max,
|
|
88
|
-
proposedValue: m,
|
|
89
|
-
role: o,
|
|
90
|
-
currentValues: {
|
|
91
|
-
1: this._valueMin,
|
|
92
|
-
...typeof this._valueMax == "number" ? { 2: this._valueMax } : {}
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
this.handleChange({ value: b, role: o });
|
|
64
|
+
const i = this.step ?? 1, a = t.key === "ArrowLeft" ? -i : i, o = this.getRoleById(e), u = o === "min" ? this._valueMin : this._valueMax, { stepValue: m } = this.computeStep({ proposedValue: u + a, role: o });
|
|
65
|
+
this.handleChange({ value: m, role: o });
|
|
96
66
|
}
|
|
97
67
|
};
|
|
98
68
|
}
|
|
@@ -102,6 +72,25 @@ let s = class extends _($) {
|
|
|
102
72
|
isControlled(t) {
|
|
103
73
|
return typeof (t === "min" ? this.valueMin : this.valueMax) == "number";
|
|
104
74
|
}
|
|
75
|
+
getRoleById(t) {
|
|
76
|
+
return t === 1 ? "min" : "max";
|
|
77
|
+
}
|
|
78
|
+
get currentValues() {
|
|
79
|
+
return {
|
|
80
|
+
1: this._valueMin,
|
|
81
|
+
...typeof this._valueMax == "number" ? { 2: this._valueMax } : {}
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
computeStep({ proposedValue: t, role: e }) {
|
|
85
|
+
return x({
|
|
86
|
+
step: this.step,
|
|
87
|
+
min: this.min,
|
|
88
|
+
max: this.max,
|
|
89
|
+
proposedValue: t,
|
|
90
|
+
role: e,
|
|
91
|
+
currentValues: this.currentValues
|
|
92
|
+
});
|
|
93
|
+
}
|
|
105
94
|
willUpdate(t) {
|
|
106
95
|
super.willUpdate(t), typeof this.valueMin == "number" && (this._valueMin = this.valueMin), typeof this.valueMax == "number" && (this._valueMax = this.valueMax);
|
|
107
96
|
}
|
|
@@ -113,17 +102,7 @@ let s = class extends _($) {
|
|
|
113
102
|
if (this.isControlled(i)) return;
|
|
114
103
|
const o = this[i === "min" ? "initialValueMin" : "initialValueMax"];
|
|
115
104
|
if (typeof o != "number") return;
|
|
116
|
-
const { stepValue: u } =
|
|
117
|
-
step: this.step,
|
|
118
|
-
min: this.min,
|
|
119
|
-
max: this.max,
|
|
120
|
-
proposedValue: o,
|
|
121
|
-
role: i,
|
|
122
|
-
currentValues: {
|
|
123
|
-
1: this._valueMin,
|
|
124
|
-
...typeof this._valueMax == "number" ? { 2: this._valueMax } : {}
|
|
125
|
-
}
|
|
126
|
-
});
|
|
105
|
+
const { stepValue: u } = this.computeStep({ proposedValue: o, role: i });
|
|
127
106
|
this[i === "min" ? "_valueMin" : "_valueMax"] !== u && this.handleChange({ value: u, role: i });
|
|
128
107
|
});
|
|
129
108
|
}
|
|
@@ -131,9 +110,21 @@ let s = class extends _($) {
|
|
|
131
110
|
const e = this.max - this.min;
|
|
132
111
|
return e === 0 ? 0 : (t - this.min) / e * 100;
|
|
133
112
|
}
|
|
113
|
+
get thumbRadius() {
|
|
114
|
+
var e;
|
|
115
|
+
const t = (e = this.renderRoot) == null ? void 0 : e.querySelector(".thumb");
|
|
116
|
+
return t ? t.offsetWidth / 2 : 0;
|
|
117
|
+
}
|
|
118
|
+
trackPosition(t) {
|
|
119
|
+
const e = s.THUMB_RADIUS_CSS_VAR;
|
|
120
|
+
return `calc(${e} + (100% - ${e} * 2) * ${t / 100})`;
|
|
121
|
+
}
|
|
122
|
+
trackWidth(t) {
|
|
123
|
+
return `calc((100% - ${s.THUMB_RADIUS_CSS_VAR} * 2) * ${t / 100})`;
|
|
124
|
+
}
|
|
134
125
|
handleChange({ value: t, role: e }) {
|
|
135
|
-
const i =
|
|
136
|
-
this[
|
|
126
|
+
const i = $({ value: t, fractionDigits: this.maximumFractionDigits }), a = e === "min" ? "_valueMin" : "_valueMax";
|
|
127
|
+
this[a] !== i && (this.isControlled(e) || (this[a] = i), this.dispatchEvent(
|
|
137
128
|
new CustomEvent("change", {
|
|
138
129
|
bubbles: !0,
|
|
139
130
|
composed: !0,
|
|
@@ -159,58 +150,48 @@ let s = class extends _($) {
|
|
|
159
150
|
fractionSeparator: this.fractionSeparator,
|
|
160
151
|
useGrouping: this.useGrouping
|
|
161
152
|
};
|
|
162
|
-
return
|
|
153
|
+
return P(e);
|
|
163
154
|
}
|
|
164
155
|
get rangeValuesTemplates() {
|
|
165
156
|
const {
|
|
166
157
|
formattedValue: t,
|
|
167
158
|
unitSymbol: e,
|
|
168
159
|
unitSymbolPosition: i
|
|
169
|
-
} = this.formatNumber(this.min),
|
|
160
|
+
} = this.formatNumber(this.min), a = this.unitSymbol ?? e, o = this.unitSymbolPosition ?? i, { formattedValue: u } = this.formatNumber(this.max);
|
|
170
161
|
return l`
|
|
171
162
|
<div class="range-value-text">
|
|
172
163
|
${this.minLabel ? l`<span class="range-value-label">${this.minLabel}</span>` : h}
|
|
173
|
-
${o === "left" ? l`<span>${
|
|
164
|
+
${o === "left" ? l`<span>${a}</span>` : h}
|
|
174
165
|
<span>${t}</span>
|
|
175
|
-
${o === "right" ? l`<span>${
|
|
166
|
+
${o === "right" ? l`<span>${a}</span>` : h}
|
|
176
167
|
</div>
|
|
177
168
|
<div class="range-value-text">
|
|
178
169
|
${this.maxLabel ? l` <span class="range-value-label">${this.maxLabel}</span>` : h}
|
|
179
|
-
${o === "left" ? l`<span>${
|
|
170
|
+
${o === "left" ? l`<span>${a}</span>` : h}
|
|
180
171
|
<span>${u}</span>
|
|
181
|
-
${o === "right" ? l`<span>${
|
|
172
|
+
${o === "right" ? l`<span>${a}</span>` : h}
|
|
182
173
|
</div>
|
|
183
174
|
`;
|
|
184
175
|
}
|
|
185
176
|
getThumbTemplate(t) {
|
|
186
|
-
const e = t
|
|
187
|
-
step: this.step,
|
|
188
|
-
min: this.min,
|
|
189
|
-
max: this.max,
|
|
190
|
-
proposedValue: i,
|
|
191
|
-
role: e,
|
|
192
|
-
currentValues: {
|
|
193
|
-
1: this._valueMin,
|
|
194
|
-
...typeof this._valueMax == "number" ? { 2: this._valueMax } : {}
|
|
195
|
-
}
|
|
196
|
-
}), u = this.getTrackPct(i);
|
|
177
|
+
const e = this.getRoleById(t), i = e === "min" ? this._valueMin : this._valueMax, { minLimit: a, maxLimit: o } = this.computeStep({ proposedValue: i, role: e }), u = this.getTrackPct(i);
|
|
197
178
|
return l`
|
|
198
179
|
<style>
|
|
199
180
|
.thumb${t} {
|
|
200
|
-
left: ${u}
|
|
181
|
+
left: ${this.trackPosition(u)};
|
|
201
182
|
}
|
|
202
183
|
</style>
|
|
203
184
|
<div
|
|
204
185
|
class="thumb${t} thumb"
|
|
205
186
|
@focus=${() => {
|
|
206
|
-
this.activeThumb =
|
|
187
|
+
this.activeThumb = e;
|
|
207
188
|
}}
|
|
208
189
|
@keydown=${(m) => this.onThumbKeyDown(m, t)}
|
|
209
190
|
role="slider"
|
|
210
191
|
tabindex=${this.disabled ? -1 : 0}
|
|
211
192
|
aria-disabled=${String(!!this.disabled)}
|
|
212
193
|
aria-label=${t === 1 ? "Minumum value" : "Maximum Value"}
|
|
213
|
-
aria-valuemin=${
|
|
194
|
+
aria-valuemin=${a}
|
|
214
195
|
aria-valuemax=${o}
|
|
215
196
|
aria-valuenow=${i}
|
|
216
197
|
>
|
|
@@ -232,29 +213,29 @@ let s = class extends _($) {
|
|
|
232
213
|
`;
|
|
233
214
|
}
|
|
234
215
|
get trackRangeTemplate() {
|
|
235
|
-
|
|
236
|
-
return
|
|
216
|
+
const t = this.getTrackPct(this._valueMin), e = this.isRange ? this.trackPosition(t) : "0px", i = this.isRange ? this.trackWidth(this.getTrackPct(this._valueMax) - t) : this.trackPosition(t);
|
|
217
|
+
return l`
|
|
237
218
|
<style>
|
|
238
219
|
.track-range {
|
|
239
|
-
left: ${
|
|
240
|
-
width: ${
|
|
220
|
+
left: ${e};
|
|
221
|
+
width: ${i};
|
|
241
222
|
}
|
|
242
223
|
</style>
|
|
243
224
|
<div class="track-range" role="presentation"></div>
|
|
244
225
|
`;
|
|
245
226
|
}
|
|
246
227
|
getInputTemplate(t) {
|
|
247
|
-
const e = t
|
|
228
|
+
const e = this.getRoleById(t), i = this.editingField === e, a = e === "min" ? this._valueMin : this._valueMax, {
|
|
248
229
|
formattedValue: o,
|
|
249
230
|
unitSymbol: u,
|
|
250
231
|
unitSymbolPosition: m
|
|
251
|
-
} = this.formatNumber(
|
|
232
|
+
} = this.formatNumber(a), d = this.unitSymbolPosition ?? m, b = this.unitSymbol ?? u, v = b ? d === "left" ? `${b} ${o}` : `${o} ${b}` : `${o}`, g = i ? "number" : "text", y = i ? String(a ?? "") : v, f = t === 1 ? this.inputMinAriaLabel : this.inputMaxAriaLabel, M = this.isRange ? t === 1 ? "Start value" : "End value" : "Value", w = f ?? M;
|
|
252
233
|
return l`
|
|
253
234
|
<div class="input-wrapper">
|
|
254
235
|
<input
|
|
255
236
|
class="input-value input-value-${t}"
|
|
256
|
-
type=${
|
|
257
|
-
.value=${
|
|
237
|
+
type=${g}
|
|
238
|
+
.value=${E(y)}
|
|
258
239
|
step=${String(this.step ?? 1)}
|
|
259
240
|
?disabled=${this.disabled}
|
|
260
241
|
tabindex=${this.disabled ? -1 : 0}
|
|
@@ -265,7 +246,7 @@ let s = class extends _($) {
|
|
|
265
246
|
@blur=${this.onInputBlur}
|
|
266
247
|
@change=${(c) => this.commitInputValue(c, t)}
|
|
267
248
|
@keydown=${(c) => this.onInputKeyDown(c, t)}
|
|
268
|
-
title=${
|
|
249
|
+
title=${y}
|
|
269
250
|
/>
|
|
270
251
|
</div>
|
|
271
252
|
`;
|
|
@@ -289,7 +270,7 @@ let s = class extends _($) {
|
|
|
289
270
|
};
|
|
290
271
|
}
|
|
291
272
|
get styleTokens() {
|
|
292
|
-
return
|
|
273
|
+
return L`
|
|
293
274
|
<style>
|
|
294
275
|
:host{
|
|
295
276
|
color-scheme: ${this.mode};
|
|
@@ -300,7 +281,7 @@ let s = class extends _($) {
|
|
|
300
281
|
render() {
|
|
301
282
|
return l`
|
|
302
283
|
${this.styleTokens}
|
|
303
|
-
<div class=${
|
|
284
|
+
<div class=${R(this.containerClasses)}>
|
|
304
285
|
<div @touchstart=${this.handleMouseDown} @mousedown=${this.handleMouseDown} class="track" role="presentation">
|
|
305
286
|
${this.thumbTemplates}
|
|
306
287
|
${this.trackRangeTemplate}
|
|
@@ -311,114 +292,115 @@ let s = class extends _($) {
|
|
|
311
292
|
`;
|
|
312
293
|
}
|
|
313
294
|
};
|
|
314
|
-
s.styles = [
|
|
315
|
-
|
|
295
|
+
s.styles = [I, F, C, N, A];
|
|
296
|
+
s.THUMB_RADIUS_CSS_VAR = "var(--ui-kit-slider-thumb-radius, 0px)";
|
|
297
|
+
n([
|
|
316
298
|
r({ type: Number })
|
|
317
299
|
], s.prototype, "min", 2);
|
|
318
|
-
|
|
300
|
+
n([
|
|
319
301
|
r({ type: Number })
|
|
320
302
|
], s.prototype, "max", 2);
|
|
321
|
-
|
|
303
|
+
n([
|
|
322
304
|
r({ type: String, attribute: "min-label" })
|
|
323
305
|
], s.prototype, "minLabel", 2);
|
|
324
|
-
|
|
306
|
+
n([
|
|
325
307
|
r({ type: String, attribute: "max-label" })
|
|
326
308
|
], s.prototype, "maxLabel", 2);
|
|
327
|
-
|
|
309
|
+
n([
|
|
328
310
|
r({ type: Number })
|
|
329
311
|
], s.prototype, "step", 2);
|
|
330
|
-
|
|
312
|
+
n([
|
|
331
313
|
r({ type: Number, attribute: "initial-value-min" })
|
|
332
314
|
], s.prototype, "initialValueMin", 2);
|
|
333
|
-
|
|
315
|
+
n([
|
|
334
316
|
r({ type: Number, attribute: "initial-value-max" })
|
|
335
317
|
], s.prototype, "initialValueMax", 2);
|
|
336
|
-
|
|
318
|
+
n([
|
|
337
319
|
r({ type: Number, attribute: "value-min" })
|
|
338
320
|
], s.prototype, "valueMin", 2);
|
|
339
|
-
|
|
321
|
+
n([
|
|
340
322
|
r({ type: Number, attribute: "value-max" })
|
|
341
323
|
], s.prototype, "valueMax", 2);
|
|
342
|
-
|
|
324
|
+
n([
|
|
343
325
|
r({ type: String, reflect: !0 })
|
|
344
326
|
], s.prototype, "mode", 2);
|
|
345
|
-
|
|
327
|
+
n([
|
|
346
328
|
r({ type: String, attribute: "locale" })
|
|
347
329
|
], s.prototype, "locale", 2);
|
|
348
|
-
|
|
330
|
+
n([
|
|
349
331
|
r({ type: String, attribute: "locale-matcher" })
|
|
350
332
|
], s.prototype, "localeMatcher", 2);
|
|
351
|
-
|
|
333
|
+
n([
|
|
352
334
|
r({ type: String, attribute: "unit-symbol" })
|
|
353
335
|
], s.prototype, "unitSymbol", 2);
|
|
354
|
-
|
|
336
|
+
n([
|
|
355
337
|
r({ type: String, attribute: "unit-symbol-position" })
|
|
356
338
|
], s.prototype, "unitSymbolPosition", 2);
|
|
357
|
-
|
|
339
|
+
n([
|
|
358
340
|
r({ type: String, attribute: "unit-style" })
|
|
359
341
|
], s.prototype, "unitStyle", 2);
|
|
360
|
-
|
|
342
|
+
n([
|
|
361
343
|
r({ type: String, attribute: "currency" })
|
|
362
344
|
], s.prototype, "currency", 2);
|
|
363
|
-
|
|
345
|
+
n([
|
|
364
346
|
r({ type: String, attribute: "unit" })
|
|
365
347
|
], s.prototype, "unit", 2);
|
|
366
|
-
|
|
348
|
+
n([
|
|
367
349
|
r({
|
|
368
350
|
type: String,
|
|
369
351
|
attribute: "use-grouping",
|
|
370
352
|
converter: (t) => t === "auto" ? "auto" : typeof t == "boolean" ? t : t === "true" || t === "" ? !0 : t !== "false"
|
|
371
353
|
})
|
|
372
354
|
], s.prototype, "useGrouping", 2);
|
|
373
|
-
|
|
355
|
+
n([
|
|
374
356
|
r({ type: Number, attribute: "minimum-integer-digits" })
|
|
375
357
|
], s.prototype, "minimumIntegerDigits", 2);
|
|
376
|
-
|
|
358
|
+
n([
|
|
377
359
|
r({ type: Number, attribute: "minimum-fraction-digits" })
|
|
378
360
|
], s.prototype, "minimumFractionDigits", 2);
|
|
379
|
-
|
|
361
|
+
n([
|
|
380
362
|
r({ type: Number, attribute: "maximum-fraction-digits" })
|
|
381
363
|
], s.prototype, "maximumFractionDigits", 2);
|
|
382
|
-
|
|
364
|
+
n([
|
|
383
365
|
r({ type: String, attribute: "thousand-separator" })
|
|
384
366
|
], s.prototype, "thousandSeparator", 2);
|
|
385
|
-
|
|
367
|
+
n([
|
|
386
368
|
r({ type: String, attribute: "fraction-separator" })
|
|
387
369
|
], s.prototype, "fractionSeparator", 2);
|
|
388
|
-
|
|
370
|
+
n([
|
|
389
371
|
r({ type: String, converter: D })
|
|
390
372
|
], s.prototype, "size", 2);
|
|
391
|
-
|
|
373
|
+
n([
|
|
392
374
|
r({ type: Boolean, converter: T })
|
|
393
375
|
], s.prototype, "disabled", 2);
|
|
394
|
-
|
|
376
|
+
n([
|
|
395
377
|
r({ type: String, attribute: "input-min-aria-label" })
|
|
396
378
|
], s.prototype, "inputMinAriaLabel", 2);
|
|
397
|
-
|
|
379
|
+
n([
|
|
398
380
|
r({ type: String, attribute: "input-max-aria-label" })
|
|
399
381
|
], s.prototype, "inputMaxAriaLabel", 2);
|
|
400
|
-
|
|
382
|
+
n([
|
|
401
383
|
k(".track")
|
|
402
384
|
], s.prototype, "track", 2);
|
|
403
|
-
|
|
385
|
+
n([
|
|
404
386
|
p()
|
|
405
387
|
], s.prototype, "_valueMin", 2);
|
|
406
|
-
|
|
388
|
+
n([
|
|
407
389
|
p()
|
|
408
390
|
], s.prototype, "_valueMax", 2);
|
|
409
|
-
|
|
391
|
+
n([
|
|
410
392
|
p()
|
|
411
393
|
], s.prototype, "activeThumb", 2);
|
|
412
|
-
|
|
394
|
+
n([
|
|
413
395
|
p()
|
|
414
396
|
], s.prototype, "animationFrameRequest", 2);
|
|
415
|
-
|
|
397
|
+
n([
|
|
416
398
|
p()
|
|
417
399
|
], s.prototype, "editingField", 2);
|
|
418
|
-
|
|
400
|
+
n([
|
|
419
401
|
p()
|
|
420
402
|
], s.prototype, "keyboardMode", 2);
|
|
421
|
-
s =
|
|
403
|
+
s = n([
|
|
422
404
|
V("ds-slider")
|
|
423
405
|
], s);
|
|
424
406
|
export {
|
|
@@ -54,7 +54,7 @@ let m = class extends v {
|
|
|
54
54
|
}
|
|
55
55
|
loadThemeStyles() {
|
|
56
56
|
return this.loadStyles ? new Promise((t, o) => {
|
|
57
|
-
const s = "/2.0.0-canary.
|
|
57
|
+
const s = "/2.0.0-canary.65", r = `https://ds-assets.cupra.com${s}/styles/${this.theme}/theme.css`;
|
|
58
58
|
if (document.head.querySelector(`link[href="${r}"]`)) t();
|
|
59
59
|
else {
|
|
60
60
|
const e = `ui-kit-theme-${s}`, a = document.getElementById(e), n = document.createElement("link");
|
|
@@ -25,7 +25,7 @@ class l {
|
|
|
25
25
|
}), f.subscribe("theme", this.handleChangeTheme);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
const c = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.
|
|
28
|
+
const c = Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.65"), h = globalThis;
|
|
29
29
|
let i = h[c];
|
|
30
30
|
i || (i = new l(), Object.defineProperty(h, c, {
|
|
31
31
|
value: i,
|
|
@@ -18,7 +18,7 @@ class e {
|
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
const u = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.
|
|
21
|
+
const u = Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.65"), t = globalThis;
|
|
22
22
|
let b = t[u];
|
|
23
23
|
b || (b = new e(), Object.defineProperty(t, u, {
|
|
24
24
|
value: b,
|
|
@@ -7,7 +7,7 @@ class s {
|
|
|
7
7
|
theme: t
|
|
8
8
|
}) => {
|
|
9
9
|
if (!t || !e) return;
|
|
10
|
-
const c = `https://ds-assets.cupra.com/2.0.0-canary.
|
|
10
|
+
const c = `https://ds-assets.cupra.com/2.0.0-canary.65/styles/${t}/components/${e}.css`, r = this.getCachedStyleSheetPromise({ url: c });
|
|
11
11
|
if (r) return r;
|
|
12
12
|
const i = h(() => this.fetchStyle({ url: c })).then((n) => (n || this.stylePromises.delete(c), n));
|
|
13
13
|
return this.stylePromises.set(c, i), this.stylePromises.get(c);
|
|
@@ -3,7 +3,7 @@ import "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
|
|
|
3
3
|
import "../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
4
4
|
import { unsafeCSS as n, css as o } from "../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";
|
|
5
5
|
function x(t, ...r) {
|
|
6
|
-
const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
6
|
+
const e = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-65"), i = n(e);
|
|
7
7
|
return o`${i}`;
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
@@ -3,7 +3,7 @@ import { html as n } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit
|
|
|
3
3
|
import "../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
|
|
4
4
|
import { unsafeHTML as i } from "../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.js";
|
|
5
5
|
function x(t, ...r) {
|
|
6
|
-
const o = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-
|
|
6
|
+
const o = String.raw({ raw: t }, ...r).replace(/(--private-[\w-]+)(?=\s*[):,])/g, "$1-v2-0-0-canary-65"), e = i(o);
|
|
7
7
|
return n`${e}`;
|
|
8
8
|
}
|
|
9
9
|
export {
|
|
@@ -41,10 +41,17 @@ export declare class DsSlider extends DsSlider_base {
|
|
|
41
41
|
static styles: import("lit").CSSResult[];
|
|
42
42
|
protected get isRange(): boolean;
|
|
43
43
|
private isControlled;
|
|
44
|
+
private getRoleById;
|
|
45
|
+
private get currentValues();
|
|
46
|
+
private computeStep;
|
|
44
47
|
protected willUpdate(changedProps: PropertyValues): void;
|
|
45
48
|
disconnectedCallback(): void;
|
|
46
49
|
protected firstUpdated(changedProps: PropertyValues): void;
|
|
47
50
|
protected getTrackPct(value: number): number;
|
|
51
|
+
protected get thumbRadius(): number;
|
|
52
|
+
private static readonly THUMB_RADIUS_CSS_VAR;
|
|
53
|
+
private trackPosition;
|
|
54
|
+
private trackWidth;
|
|
48
55
|
protected getNewValue: (event: MouseEvent | TouchEvent) => number;
|
|
49
56
|
protected setActiveThumb: (event: MouseEvent | TouchEvent) => void;
|
|
50
57
|
protected handleMouseMove: (event: MouseEvent | TouchEvent) => void;
|
|
@@ -66,7 +73,7 @@ export declare class DsSlider extends DsSlider_base {
|
|
|
66
73
|
protected onInputBlur: (event: FocusEvent) => void;
|
|
67
74
|
protected onInputKeyDown: (event: KeyboardEvent, id: 1 | 2) => void;
|
|
68
75
|
protected onThumbKeyDown: (event: KeyboardEvent, id: 1 | 2) => void;
|
|
69
|
-
protected getInputTemplate(id:
|
|
76
|
+
protected getInputTemplate(id: 1 | 2): import("lit").TemplateResult<1>;
|
|
70
77
|
protected get inputsTemplate(): import("lit").TemplateResult<1>;
|
|
71
78
|
protected get containerClasses(): {
|
|
72
79
|
[x: string]: boolean;
|