@v-c/slider 1.0.2 → 1.0.4
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/Handles/Handle.cjs +195 -1
- package/dist/Handles/Handle.d.ts +17 -5
- package/dist/Handles/Handle.js +191 -202
- package/dist/Handles/index.cjs +108 -1
- package/dist/Handles/index.d.ts +20 -4
- package/dist/Handles/index.js +105 -116
- package/dist/Marks/Mark.cjs +51 -1
- package/dist/Marks/Mark.d.ts +2 -2
- package/dist/Marks/Mark.js +48 -39
- package/dist/Marks/index.cjs +39 -1
- package/dist/Marks/index.d.ts +2 -2
- package/dist/Marks/index.js +36 -32
- package/dist/Slider.cjs +569 -1
- package/dist/Slider.d.ts +60 -263
- package/dist/Slider.js +563 -352
- package/dist/Steps/Dot.cjs +52 -1
- package/dist/Steps/Dot.d.ts +2 -2
- package/dist/Steps/Dot.js +49 -38
- package/dist/Steps/index.cjs +64 -1
- package/dist/Steps/index.d.ts +2 -2
- package/dist/Steps/index.js +61 -41
- package/dist/Tracks/Track.cjs +74 -1
- package/dist/Tracks/Track.js +70 -81
- package/dist/Tracks/index.cjs +70 -1
- package/dist/Tracks/index.js +66 -82
- package/dist/_virtual/rolldown_runtime.cjs +21 -0
- package/dist/context.cjs +39 -1
- package/dist/context.d.ts +13 -7
- package/dist/context.js +29 -24
- package/dist/hooks/useDrag.cjs +160 -1
- package/dist/hooks/useDrag.d.ts +2 -2
- package/dist/hooks/useDrag.js +155 -86
- package/dist/hooks/useOffset.cjs +124 -1
- package/dist/hooks/useOffset.d.ts +2 -1
- package/dist/hooks/useOffset.js +122 -97
- package/dist/hooks/useRange.cjs +21 -1
- package/dist/hooks/useRange.js +18 -9
- package/dist/index.cjs +6 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -4
- package/dist/interface.cjs +0 -1
- package/dist/interface.js +0 -1
- package/dist/util.cjs +32 -1
- package/dist/util.js +27 -26
- package/package.json +18 -10
- package/docs/TooltipSlider.tsx +0 -94
- package/docs/assets/anim.less +0 -63
- package/docs/assets/bootstrap.less +0 -163
- package/docs/assets/index.less +0 -337
- package/docs/debug.vue +0 -60
- package/docs/editable.vue +0 -59
- package/docs/handle.vue +0 -45
- package/docs/marks.vue +0 -94
- package/docs/multiple.vue +0 -54
- package/docs/range.vue +0 -211
- package/docs/slider.stories.vue +0 -45
- package/docs/sliderDemo.vue +0 -267
- package/docs/vertical.vue +0 -122
- package/src/Handles/Handle.tsx +0 -223
- package/src/Handles/index.tsx +0 -124
- package/src/Marks/Mark.tsx +0 -40
- package/src/Marks/index.tsx +0 -40
- package/src/Slider.tsx +0 -593
- package/src/Steps/Dot.tsx +0 -40
- package/src/Steps/index.tsx +0 -54
- package/src/Tracks/Track.tsx +0 -89
- package/src/Tracks/index.tsx +0 -92
- package/src/context.ts +0 -65
- package/src/hooks/useDrag.ts +0 -243
- package/src/hooks/useOffset.ts +0 -264
- package/src/hooks/useRange.ts +0 -24
- package/src/index.ts +0 -8
- package/src/interface.ts +0 -17
- package/src/util.ts +0 -41
- package/vite.config.ts +0 -18
- package/vitest.config.ts +0 -11
package/dist/Slider.js
CHANGED
|
@@ -1,353 +1,564 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
default: !1
|
|
26
|
-
},
|
|
27
|
-
keyboard: {
|
|
28
|
-
type: Boolean,
|
|
29
|
-
default: !0
|
|
30
|
-
},
|
|
31
|
-
autoFocus: Boolean,
|
|
32
|
-
min: {
|
|
33
|
-
type: Number,
|
|
34
|
-
default: 0
|
|
35
|
-
},
|
|
36
|
-
max: {
|
|
37
|
-
type: Number,
|
|
38
|
-
default: 100
|
|
39
|
-
},
|
|
40
|
-
step: {
|
|
41
|
-
type: Number,
|
|
42
|
-
default: 1
|
|
43
|
-
},
|
|
44
|
-
value: [Number, Array],
|
|
45
|
-
defaultValue: [Number, Array],
|
|
46
|
-
range: [Boolean, Object],
|
|
47
|
-
count: Number,
|
|
48
|
-
allowCross: {
|
|
49
|
-
type: Boolean,
|
|
50
|
-
default: !0
|
|
51
|
-
},
|
|
52
|
-
pushable: {
|
|
53
|
-
type: [Boolean, Number],
|
|
54
|
-
default: !1
|
|
55
|
-
},
|
|
56
|
-
reverse: Boolean,
|
|
57
|
-
vertical: Boolean,
|
|
58
|
-
included: {
|
|
59
|
-
type: Boolean,
|
|
60
|
-
default: !0
|
|
61
|
-
},
|
|
62
|
-
startPoint: Number,
|
|
63
|
-
trackStyle: [Object, Array],
|
|
64
|
-
handleStyle: [Object, Array],
|
|
65
|
-
railStyle: Object,
|
|
66
|
-
dotStyle: [Object, Function],
|
|
67
|
-
activeDotStyle: [Object, Function],
|
|
68
|
-
marks: Object,
|
|
69
|
-
dots: Boolean,
|
|
70
|
-
handleRender: Function,
|
|
71
|
-
activeHandleRender: Function,
|
|
72
|
-
track: {
|
|
73
|
-
type: Boolean,
|
|
74
|
-
default: !0
|
|
75
|
-
},
|
|
76
|
-
tabIndex: {
|
|
77
|
-
type: [Number, Array],
|
|
78
|
-
default: 0
|
|
79
|
-
},
|
|
80
|
-
ariaLabelForHandle: [String, Array],
|
|
81
|
-
ariaLabelledByForHandle: [String, Array],
|
|
82
|
-
ariaRequired: Boolean,
|
|
83
|
-
ariaValueTextFormatterForHandle: [Function, Array],
|
|
84
|
-
onFocus: Function,
|
|
85
|
-
onBlur: Function,
|
|
86
|
-
onChange: Function,
|
|
87
|
-
/** @deprecated It's always better to use `onChange` instead */
|
|
88
|
-
onBeforeChange: Function,
|
|
89
|
-
/** @deprecated Use `onChangeComplete` instead */
|
|
90
|
-
onAfterChange: Function,
|
|
91
|
-
onChangeComplete: Function
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
const we = /* @__PURE__ */ ve({
|
|
95
|
-
name: "Slider",
|
|
96
|
-
props: {
|
|
97
|
-
...pe()
|
|
98
|
-
},
|
|
99
|
-
emits: ["focus", "blur", "change", "beforeChange", "afterChange", "changeComplete"],
|
|
100
|
-
slots: Object,
|
|
101
|
-
setup(l, {
|
|
102
|
-
attrs: Y,
|
|
103
|
-
emit: d,
|
|
104
|
-
expose: Z,
|
|
105
|
-
slots: ee
|
|
106
|
-
}) {
|
|
107
|
-
const h = F(), A = F(), B = w("ltr");
|
|
108
|
-
fe([() => l.reverse, () => l.vertical], ([e, a]) => {
|
|
109
|
-
a ? B.value = e ? "ttb" : "btt" : B.value = e ? "rtl" : "ltr";
|
|
110
|
-
}, {
|
|
111
|
-
immediate: !0
|
|
112
|
-
});
|
|
113
|
-
const g = w(0), k = w(100), E = w(1), O = F([]), y = F(l.defaultValue || l.value), n = F([]), r = F(), D = F();
|
|
114
|
-
M(() => {
|
|
115
|
-
const {
|
|
116
|
-
range: e,
|
|
117
|
-
min: a,
|
|
118
|
-
max: t,
|
|
119
|
-
step: o,
|
|
120
|
-
pushable: i,
|
|
121
|
-
marks: b,
|
|
122
|
-
allowCross: C,
|
|
123
|
-
value: v,
|
|
124
|
-
count: f
|
|
125
|
-
} = l, [s, x, L, P, $] = xe(e);
|
|
126
|
-
r.value = {
|
|
127
|
-
rangeEnabled: s,
|
|
128
|
-
rangeEditable: x,
|
|
129
|
-
rangeDraggableTrack: L,
|
|
130
|
-
minCount: P,
|
|
131
|
-
maxCount: $
|
|
132
|
-
}, g.value = isFinite(a) ? a : 0, k.value = isFinite(t) ? t : 100, E.value = o !== null && o <= 0 ? 1 : o;
|
|
133
|
-
const q = S(() => typeof i == "boolean" ? i ? E.value : !1 : i >= 0 ? i : !1);
|
|
134
|
-
O.value = Object.keys(b || {}).map((m) => {
|
|
135
|
-
const c = b?.[m], u = {
|
|
136
|
-
value: Number(m)
|
|
137
|
-
};
|
|
138
|
-
return c && typeof c == "object" && !ge(c) && ("label" in c || "style" in c) ? (u.style = c.style, u.label = c.label) : u.label = c, u;
|
|
139
|
-
}).filter(({
|
|
140
|
-
label: m
|
|
141
|
-
}) => m || typeof m == "number").sort((m, c) => m.value - c.value);
|
|
142
|
-
const [T, H] = Ce(g.value, k.value, E.value, O.value, C, q.value);
|
|
143
|
-
D.value = {
|
|
144
|
-
formatValue: T,
|
|
145
|
-
offsetValues: H
|
|
146
|
-
}, v !== void 0 && (y.value = v);
|
|
147
|
-
const de = S(() => {
|
|
148
|
-
const m = y.value === null || y.value === void 0 ? [] : Array.isArray(y.value) ? y.value : [y.value], [c = g.value] = m;
|
|
149
|
-
let u = y.value === null ? [] : [c];
|
|
150
|
-
if (s) {
|
|
151
|
-
if (u = [...m], f || y.value === void 0) {
|
|
152
|
-
const V = f >= 0 ? f + 1 : 2;
|
|
153
|
-
for (u = u.slice(0, V); u.length < V; )
|
|
154
|
-
u.push(u[u.length - 1] ?? g.value);
|
|
155
|
-
}
|
|
156
|
-
u.sort((V, z) => V - z);
|
|
157
|
-
}
|
|
158
|
-
return u.forEach((V, z) => {
|
|
159
|
-
u[z] = T(V);
|
|
160
|
-
}), u;
|
|
161
|
-
});
|
|
162
|
-
n.value = de.value;
|
|
163
|
-
});
|
|
164
|
-
const p = (e) => r.value.rangeEnabled ? e : e[0], R = (e) => {
|
|
165
|
-
const a = [...e].sort((t, o) => t - o);
|
|
166
|
-
be(a, n.value, !0) || d("change", p(a)), y.value = a;
|
|
167
|
-
}, _ = (e) => {
|
|
168
|
-
e && h.value?.hideHelp();
|
|
169
|
-
const a = p(n.value);
|
|
170
|
-
l.onAfterChange && (d("afterChange", a), X(!1, "[vc-slider] `onAfterChange` is deprecated. Please use `onChangeComplete` instead.")), d("changeComplete", a);
|
|
171
|
-
}, ae = (e) => {
|
|
172
|
-
if (l.disabled || !r.value.rangeEditable || n.value.length <= r.value.minCount)
|
|
173
|
-
return;
|
|
174
|
-
const a = [...n.value];
|
|
175
|
-
a.splice(e, 1), d("beforeChange", p(a)), R(a);
|
|
176
|
-
const t = Math.max(0, e - 1);
|
|
177
|
-
h.value?.hideHelp(), h.value?.focus(t);
|
|
178
|
-
}, [G, le, te, J, K] = ye(A, B, n, g, k, D.value.formatValue, R, _, D.value.offsetValues, r.value.rangeEditable, r.value.minCount), Q = (e, a) => {
|
|
179
|
-
if (!l.disabled) {
|
|
180
|
-
const t = [...n.value];
|
|
181
|
-
let o = 0, i = 0, b = k.value - g.value;
|
|
182
|
-
n.value.forEach((f, s) => {
|
|
183
|
-
const x = Math.abs(e - f);
|
|
184
|
-
x <= b && (b = x, o = s), f < e && (i = s);
|
|
185
|
-
});
|
|
186
|
-
let C = o;
|
|
187
|
-
r.value.rangeEditable && b !== 0 && (!r.value.maxCount || n.value.length < r.value.maxCount) ? (t.splice(i + 1, 0, e), C = i + 1) : t[o] = e, r.value.rangeEnabled && !n.value.length && l.count === void 0 && t.push(e);
|
|
188
|
-
const v = p(t);
|
|
189
|
-
d("beforeChange", v), R(t), a ? (document.activeElement?.blur?.(), h.value?.focus(C), K(a, C, t)) : (l.onAfterChange && (d("afterChange", v), X(!1, "[vc-slider] `onAfterChange` is deprecated. Please use `onChangeComplete` instead.")), d("changeComplete", v));
|
|
190
|
-
}
|
|
191
|
-
}, ne = (e) => {
|
|
192
|
-
e.preventDefault();
|
|
193
|
-
const {
|
|
194
|
-
width: a,
|
|
195
|
-
height: t,
|
|
196
|
-
left: o,
|
|
197
|
-
top: i,
|
|
198
|
-
bottom: b,
|
|
199
|
-
right: C
|
|
200
|
-
} = A.value.getBoundingClientRect(), {
|
|
201
|
-
clientX: v,
|
|
202
|
-
clientY: f
|
|
203
|
-
} = e;
|
|
204
|
-
let s;
|
|
205
|
-
switch (B.value) {
|
|
206
|
-
case "btt":
|
|
207
|
-
s = (b - f) / t;
|
|
208
|
-
break;
|
|
209
|
-
case "ttb":
|
|
210
|
-
s = (f - i) / t;
|
|
211
|
-
break;
|
|
212
|
-
case "rtl":
|
|
213
|
-
s = (C - v) / a;
|
|
214
|
-
break;
|
|
215
|
-
default:
|
|
216
|
-
s = (v - o) / a;
|
|
217
|
-
}
|
|
218
|
-
const x = g.value + s * (k.value - g.value);
|
|
219
|
-
Q(D.value.formatValue(x), e);
|
|
220
|
-
}, j = F(null), ue = (e, a) => {
|
|
221
|
-
if (!l.disabled) {
|
|
222
|
-
const t = D.value.offsetValues(n.value, e, a);
|
|
223
|
-
d("beforeChange", p(n.value)), R(t.values), j.value = t.value;
|
|
224
|
-
}
|
|
225
|
-
};
|
|
226
|
-
M(() => {
|
|
227
|
-
if (j.value !== null) {
|
|
228
|
-
const e = n.value.indexOf(j.value);
|
|
229
|
-
e >= 0 && h.value?.focus(e);
|
|
230
|
-
}
|
|
231
|
-
j.value = null;
|
|
232
|
-
});
|
|
233
|
-
const re = S(() => r.value.rangeDraggableTrack && E.value === null ? (process.env.NODE_ENV !== "production" && X(!1, "`draggableTrack` is not supported when `step` is `null`."), !1) : r.value.rangeDraggableTrack), U = (e, a) => {
|
|
234
|
-
K(e, a), d("beforeChange", p(n.value));
|
|
235
|
-
}, oe = S(() => G.value !== -1);
|
|
236
|
-
M(() => {
|
|
237
|
-
if (!oe.value) {
|
|
238
|
-
const e = n.value.lastIndexOf(le.value);
|
|
239
|
-
h.value?.focus(e);
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
const I = S(() => [...J.value].sort((e, a) => e - a)), [se, ie] = S(() => r.value.rangeEnabled ? [I.value[0], I.value[I.value.length - 1]] : [g.value, I.value[0]]).value;
|
|
243
|
-
Z({
|
|
244
|
-
focus: () => {
|
|
245
|
-
h.value?.focus(0);
|
|
246
|
-
},
|
|
247
|
-
blur: () => {
|
|
248
|
-
const {
|
|
249
|
-
activeElement: e
|
|
250
|
-
} = document;
|
|
251
|
-
A.value?.contains(e) && e?.blur();
|
|
252
|
-
}
|
|
253
|
-
}), M(() => {
|
|
254
|
-
l.autoFocus && h.value?.focus(0);
|
|
255
|
-
});
|
|
256
|
-
const ce = S(() => ({
|
|
257
|
-
min: g,
|
|
258
|
-
max: k,
|
|
259
|
-
direction: B,
|
|
260
|
-
disabled: l.disabled,
|
|
261
|
-
keyboard: l.keyboard,
|
|
262
|
-
step: E,
|
|
263
|
-
included: l.included,
|
|
264
|
-
includedStart: se,
|
|
265
|
-
includedEnd: ie,
|
|
266
|
-
range: r.value.rangeEnabled,
|
|
267
|
-
tabIndex: l.tabIndex,
|
|
268
|
-
ariaLabelForHandle: l.ariaLabelForHandle,
|
|
269
|
-
ariaLabelledByForHandle: l.ariaLabelledByForHandle,
|
|
270
|
-
ariaRequired: l.ariaRequired,
|
|
271
|
-
ariaValueTextFormatterForHandle: l.ariaValueTextFormatterForHandle,
|
|
272
|
-
styles: l.styles || {},
|
|
273
|
-
classNames: l.classNames || {}
|
|
274
|
-
}));
|
|
275
|
-
return me(ce.value), () => {
|
|
276
|
-
const {
|
|
277
|
-
prefixCls: e = "vc-slider",
|
|
278
|
-
id: a,
|
|
279
|
-
// Status
|
|
280
|
-
disabled: t = !1,
|
|
281
|
-
vertical: o,
|
|
282
|
-
// Style
|
|
283
|
-
startPoint: i,
|
|
284
|
-
trackStyle: b,
|
|
285
|
-
handleStyle: C,
|
|
286
|
-
railStyle: v,
|
|
287
|
-
dotStyle: f,
|
|
288
|
-
activeDotStyle: s,
|
|
289
|
-
// Decorations
|
|
290
|
-
dots: x,
|
|
291
|
-
handleRender: L,
|
|
292
|
-
activeHandleRender: P,
|
|
293
|
-
// Components
|
|
294
|
-
track: $,
|
|
295
|
-
classNames: q,
|
|
296
|
-
styles: T
|
|
297
|
-
} = l;
|
|
298
|
-
return N("div", {
|
|
299
|
-
ref: A,
|
|
300
|
-
class: W(e, [Y.class], {
|
|
301
|
-
[`${e}-disabled`]: t,
|
|
302
|
-
[`${e}-vertical`]: o,
|
|
303
|
-
[`${e}-horizontal`]: !o,
|
|
304
|
-
[`${e}-with-marks`]: O.value.length
|
|
305
|
-
}),
|
|
306
|
-
style: Y.style,
|
|
307
|
-
onMousedown: ne,
|
|
308
|
-
id: a
|
|
309
|
-
}, [N("div", {
|
|
310
|
-
class: W(`${e}-rail`, q?.rail),
|
|
311
|
-
style: {
|
|
312
|
-
...v,
|
|
313
|
-
...T?.rail
|
|
314
|
-
}
|
|
315
|
-
}, null), $ && N(ke, {
|
|
316
|
-
prefixCls: e,
|
|
317
|
-
trackStyle: b,
|
|
318
|
-
values: n.value,
|
|
319
|
-
startPoint: i,
|
|
320
|
-
onStartMove: re.value ? U : void 0
|
|
321
|
-
}, null), N(Se, {
|
|
322
|
-
prefixCls: e,
|
|
323
|
-
marks: O.value,
|
|
324
|
-
dots: x,
|
|
325
|
-
style: f,
|
|
326
|
-
activeStyle: s
|
|
327
|
-
}, null), N(he, {
|
|
328
|
-
ref: h,
|
|
329
|
-
prefixCls: e,
|
|
330
|
-
handleStyle: C,
|
|
331
|
-
values: J.value,
|
|
332
|
-
draggingIndex: G.value,
|
|
333
|
-
draggingDelete: te.value,
|
|
334
|
-
onStartMove: U,
|
|
335
|
-
onOffsetChange: ue,
|
|
336
|
-
onFocus: (H) => d("focus", H),
|
|
337
|
-
onBlur: (H) => d("blur", H),
|
|
338
|
-
handleRender: L,
|
|
339
|
-
activeHandleRender: P,
|
|
340
|
-
onChangeComplete: _,
|
|
341
|
-
onDelete: r.value.rangeEditable ? ae : () => {
|
|
342
|
-
}
|
|
343
|
-
}, null), N(Fe, {
|
|
344
|
-
prefixCls: e,
|
|
345
|
-
marks: O.value,
|
|
346
|
-
onClick: Q
|
|
347
|
-
}, ee)]);
|
|
348
|
-
};
|
|
349
|
-
}
|
|
350
|
-
});
|
|
351
|
-
export {
|
|
352
|
-
we as default
|
|
1
|
+
import { useProviderSliderContext } from "./context.js";
|
|
2
|
+
import Handles_default from "./Handles/index.js";
|
|
3
|
+
import useDrag_default from "./hooks/useDrag.js";
|
|
4
|
+
import useOffset from "./hooks/useOffset.js";
|
|
5
|
+
import useRange from "./hooks/useRange.js";
|
|
6
|
+
import Marks_default from "./Marks/index.js";
|
|
7
|
+
import Steps_default from "./Steps/index.js";
|
|
8
|
+
import Tracks_default from "./Tracks/index.js";
|
|
9
|
+
import { computed, createVNode, defineComponent, isVNode, mergeDefaults, ref, shallowRef, watch } from "vue";
|
|
10
|
+
import { classNames } from "@v-c/util";
|
|
11
|
+
import isEqual from "@v-c/util/dist/isEqual";
|
|
12
|
+
import warning from "@v-c/util/dist/warning";
|
|
13
|
+
var sliderDefaults = {
|
|
14
|
+
prefixCls: "vc-slider",
|
|
15
|
+
keyboard: true,
|
|
16
|
+
disabled: false,
|
|
17
|
+
min: 0,
|
|
18
|
+
max: 100,
|
|
19
|
+
step: 1,
|
|
20
|
+
allowCross: true,
|
|
21
|
+
pushable: false,
|
|
22
|
+
included: true,
|
|
23
|
+
tabIndex: 0,
|
|
24
|
+
track: true
|
|
353
25
|
};
|
|
26
|
+
var Slider_default = /* @__PURE__ */ defineComponent((props, { attrs, slots, emit, expose }) => {
|
|
27
|
+
const prefixCls = computed(() => props.prefixCls ?? sliderDefaults.prefixCls);
|
|
28
|
+
const disabled = computed(() => props.disabled ?? sliderDefaults.disabled);
|
|
29
|
+
const keyboard = computed(() => props.keyboard ?? sliderDefaults.keyboard);
|
|
30
|
+
const included = computed(() => props.included ?? sliderDefaults.included);
|
|
31
|
+
const tabIndex = computed(() => props.tabIndex ?? sliderDefaults.tabIndex);
|
|
32
|
+
const allowCross = computed(() => props.allowCross ?? sliderDefaults.allowCross);
|
|
33
|
+
const direction = computed(() => {
|
|
34
|
+
if (props.vertical) return props.reverse ? "ttb" : "btt";
|
|
35
|
+
return props.reverse ? "rtl" : "ltr";
|
|
36
|
+
});
|
|
37
|
+
const rangeConfig = computed(() => {
|
|
38
|
+
const [rangeEnabled$1, rangeEditable$1, rangeDraggableTrack$1, minCount$1, maxCount$1] = useRange(props.range);
|
|
39
|
+
return {
|
|
40
|
+
rangeEnabled: rangeEnabled$1,
|
|
41
|
+
rangeEditable: rangeEditable$1,
|
|
42
|
+
rangeDraggableTrack: rangeDraggableTrack$1,
|
|
43
|
+
minCount: minCount$1,
|
|
44
|
+
maxCount: maxCount$1
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
const rangeEnabled = computed(() => rangeConfig.value.rangeEnabled);
|
|
48
|
+
const rangeEditable = computed(() => rangeConfig.value.rangeEditable);
|
|
49
|
+
const rangeDraggableTrack = computed(() => rangeConfig.value.rangeDraggableTrack);
|
|
50
|
+
const minCount = computed(() => rangeConfig.value.minCount ?? 0);
|
|
51
|
+
const maxCount = computed(() => rangeConfig.value.maxCount);
|
|
52
|
+
const mergedMin = computed(() => Number.isFinite(props.min ?? 0) ? props.min ?? 0 : 0);
|
|
53
|
+
const mergedMax = computed(() => Number.isFinite(props.max ?? 100) ? props.max ?? 100 : 100);
|
|
54
|
+
const mergedStep = computed(() => {
|
|
55
|
+
const step = props.step ?? sliderDefaults.step;
|
|
56
|
+
if (step !== null && step <= 0) return 1;
|
|
57
|
+
return step;
|
|
58
|
+
});
|
|
59
|
+
const mergedPush = computed(() => {
|
|
60
|
+
const pushable = props.pushable ?? sliderDefaults.pushable;
|
|
61
|
+
if (typeof pushable === "boolean") return pushable ? mergedStep.value : false;
|
|
62
|
+
return pushable >= 0 ? pushable : false;
|
|
63
|
+
});
|
|
64
|
+
const markList = computed(() => {
|
|
65
|
+
return Object.keys(props.marks || {}).map((key) => {
|
|
66
|
+
const mark = props.marks?.[key];
|
|
67
|
+
const markObj = { value: Number(key) };
|
|
68
|
+
if (mark && typeof mark === "object" && !isVNode(mark) && ("label" in mark || "style" in mark)) {
|
|
69
|
+
markObj.style = mark.style;
|
|
70
|
+
markObj.label = mark.label;
|
|
71
|
+
} else markObj.label = mark;
|
|
72
|
+
return markObj;
|
|
73
|
+
}).filter(({ label }) => label || typeof label === "number").sort((a, b) => a.value - b.value);
|
|
74
|
+
});
|
|
75
|
+
const [formatValue, offsetValues] = useOffset(mergedMin, mergedMax, mergedStep, markList, allowCross, mergedPush);
|
|
76
|
+
const formatValueRef = computed(() => formatValue);
|
|
77
|
+
const offsetValuesRef = computed(() => offsetValues);
|
|
78
|
+
const mergedValue = shallowRef(props.value !== void 0 ? props.value : props.defaultValue);
|
|
79
|
+
watch(() => props.value, (val) => {
|
|
80
|
+
if (val !== void 0) mergedValue.value = val;
|
|
81
|
+
});
|
|
82
|
+
const rawValues = computed(() => {
|
|
83
|
+
const valueList = mergedValue.value === null || mergedValue.value === void 0 ? [] : Array.isArray(mergedValue.value) ? mergedValue.value : [mergedValue.value];
|
|
84
|
+
const [val0 = mergedMin.value] = valueList;
|
|
85
|
+
let returnValues = mergedValue.value === null ? [] : [val0];
|
|
86
|
+
if (rangeEnabled.value) {
|
|
87
|
+
returnValues = [...valueList];
|
|
88
|
+
if (typeof props.count === "number" || mergedValue.value === void 0) {
|
|
89
|
+
const pointCount = typeof props.count === "number" && props.count >= 0 ? props.count + 1 : 2;
|
|
90
|
+
returnValues = returnValues.slice(0, pointCount);
|
|
91
|
+
while (returnValues.length < pointCount) returnValues.push(returnValues[returnValues.length - 1] ?? mergedMin.value);
|
|
92
|
+
}
|
|
93
|
+
returnValues.sort((a, b) => a - b);
|
|
94
|
+
}
|
|
95
|
+
returnValues.forEach((val, index) => {
|
|
96
|
+
returnValues[index] = formatValue(val);
|
|
97
|
+
});
|
|
98
|
+
return returnValues;
|
|
99
|
+
});
|
|
100
|
+
const handlesRef = ref();
|
|
101
|
+
const containerRef = ref();
|
|
102
|
+
const getTriggerValue = (triggerValues) => rangeEnabled.value ? triggerValues : triggerValues[0];
|
|
103
|
+
const triggerChange = (nextValues) => {
|
|
104
|
+
const cloneNextValues = [...nextValues].sort((a, b) => a - b);
|
|
105
|
+
if (!isEqual(cloneNextValues, rawValues.value, true)) {
|
|
106
|
+
const triggerValue = getTriggerValue(cloneNextValues);
|
|
107
|
+
emit("change", triggerValue);
|
|
108
|
+
props.onChange?.(triggerValue);
|
|
109
|
+
}
|
|
110
|
+
mergedValue.value = cloneNextValues;
|
|
111
|
+
};
|
|
112
|
+
const finishChange = (draggingDelete$1) => {
|
|
113
|
+
if (draggingDelete$1) handlesRef.value?.hideHelp();
|
|
114
|
+
const finishValue = getTriggerValue(rawValues.value);
|
|
115
|
+
emit("afterChange", finishValue);
|
|
116
|
+
props.onAfterChange?.(finishValue);
|
|
117
|
+
warning(!props.onAfterChange, "[vc-slider] `onAfterChange` is deprecated. Please use `onChangeComplete` instead.");
|
|
118
|
+
emit("changeComplete", finishValue);
|
|
119
|
+
props.onChangeComplete?.(finishValue);
|
|
120
|
+
};
|
|
121
|
+
const onDelete = (index) => {
|
|
122
|
+
if (disabled.value || !rangeEditable.value || rawValues.value.length <= minCount.value) return;
|
|
123
|
+
const cloneNextValues = [...rawValues.value];
|
|
124
|
+
cloneNextValues.splice(index, 1);
|
|
125
|
+
const triggerValue = getTriggerValue(cloneNextValues);
|
|
126
|
+
emit("beforeChange", triggerValue);
|
|
127
|
+
props.onBeforeChange?.(triggerValue);
|
|
128
|
+
triggerChange(cloneNextValues);
|
|
129
|
+
const nextFocusIndex = Math.max(0, index - 1);
|
|
130
|
+
handlesRef.value?.hideHelp();
|
|
131
|
+
handlesRef.value?.focus(nextFocusIndex);
|
|
132
|
+
};
|
|
133
|
+
const [draggingIndex, draggingValue, draggingDelete, cacheValues, onStartDrag] = useDrag_default(containerRef, direction, rawValues, mergedMin, mergedMax, formatValueRef, triggerChange, finishChange, offsetValuesRef, rangeEditable, minCount);
|
|
134
|
+
const changeToCloseValue = (newValue, e) => {
|
|
135
|
+
if (!disabled.value) {
|
|
136
|
+
const cloneNextValues = [...rawValues.value];
|
|
137
|
+
let valueIndex = 0;
|
|
138
|
+
let valueBeforeIndex = 0;
|
|
139
|
+
let valueDist = mergedMax.value - mergedMin.value;
|
|
140
|
+
rawValues.value.forEach((val, index) => {
|
|
141
|
+
const dist = Math.abs(newValue - val);
|
|
142
|
+
if (dist <= valueDist) {
|
|
143
|
+
valueDist = dist;
|
|
144
|
+
valueIndex = index;
|
|
145
|
+
}
|
|
146
|
+
if (val < newValue) valueBeforeIndex = index;
|
|
147
|
+
});
|
|
148
|
+
let focusIndex = valueIndex;
|
|
149
|
+
if (rangeEditable.value && valueDist !== 0 && (!maxCount.value || rawValues.value.length < maxCount.value)) {
|
|
150
|
+
cloneNextValues.splice(valueBeforeIndex + 1, 0, newValue);
|
|
151
|
+
focusIndex = valueBeforeIndex + 1;
|
|
152
|
+
} else cloneNextValues[valueIndex] = newValue;
|
|
153
|
+
if (rangeEnabled.value && !rawValues.value.length && props.count === void 0) cloneNextValues.push(newValue);
|
|
154
|
+
const nextValue = getTriggerValue(cloneNextValues);
|
|
155
|
+
emit("beforeChange", nextValue);
|
|
156
|
+
props.onBeforeChange?.(nextValue);
|
|
157
|
+
triggerChange(cloneNextValues);
|
|
158
|
+
if (e) {
|
|
159
|
+
document.activeElement?.blur?.();
|
|
160
|
+
handlesRef.value?.focus(focusIndex);
|
|
161
|
+
onStartDrag(e, focusIndex, cloneNextValues);
|
|
162
|
+
} else {
|
|
163
|
+
emit("afterChange", nextValue);
|
|
164
|
+
props.onAfterChange?.(nextValue);
|
|
165
|
+
warning(!props.onAfterChange, "[vc-slider] `onAfterChange` is deprecated. Please use `onChangeComplete` instead.");
|
|
166
|
+
emit("changeComplete", nextValue);
|
|
167
|
+
props.onChangeComplete?.(nextValue);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
const onSliderMouseDown = (e) => {
|
|
172
|
+
e.preventDefault();
|
|
173
|
+
const rect = containerRef.value?.getBoundingClientRect();
|
|
174
|
+
if (!rect) return;
|
|
175
|
+
const { width, height, left, top, bottom, right } = rect;
|
|
176
|
+
const { clientX, clientY } = e;
|
|
177
|
+
let percent;
|
|
178
|
+
switch (direction.value) {
|
|
179
|
+
case "btt":
|
|
180
|
+
percent = (bottom - clientY) / height;
|
|
181
|
+
break;
|
|
182
|
+
case "ttb":
|
|
183
|
+
percent = (clientY - top) / height;
|
|
184
|
+
break;
|
|
185
|
+
case "rtl":
|
|
186
|
+
percent = (right - clientX) / width;
|
|
187
|
+
break;
|
|
188
|
+
default: percent = (clientX - left) / width;
|
|
189
|
+
}
|
|
190
|
+
changeToCloseValue(formatValue(mergedMin.value + percent * (mergedMax.value - mergedMin.value)), e);
|
|
191
|
+
};
|
|
192
|
+
const keyboardValue = shallowRef(null);
|
|
193
|
+
const onHandleOffsetChange = (offset, valueIndex) => {
|
|
194
|
+
if (!disabled.value) {
|
|
195
|
+
const next = offsetValues(rawValues.value, offset, valueIndex);
|
|
196
|
+
const currentValue = getTriggerValue(rawValues.value);
|
|
197
|
+
emit("beforeChange", currentValue);
|
|
198
|
+
props.onBeforeChange?.(currentValue);
|
|
199
|
+
triggerChange(next.values);
|
|
200
|
+
keyboardValue.value = next.value;
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
watch(keyboardValue, (val) => {
|
|
204
|
+
if (val !== null) {
|
|
205
|
+
const valueIndex = rawValues.value.indexOf(val);
|
|
206
|
+
if (valueIndex >= 0) handlesRef.value?.focus(valueIndex);
|
|
207
|
+
}
|
|
208
|
+
keyboardValue.value = null;
|
|
209
|
+
});
|
|
210
|
+
const mergedDraggableTrack = computed(() => {
|
|
211
|
+
if (rangeDraggableTrack.value && mergedStep.value === null) {
|
|
212
|
+
if (process.env.NODE_ENV !== "production") warning(false, "`draggableTrack` is not supported when `step` is `null`.");
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
return rangeDraggableTrack.value;
|
|
216
|
+
});
|
|
217
|
+
const onStartMove = (e, valueIndex) => {
|
|
218
|
+
onStartDrag(e, valueIndex);
|
|
219
|
+
const triggerValue = getTriggerValue(rawValues.value);
|
|
220
|
+
emit("beforeChange", triggerValue);
|
|
221
|
+
props.onBeforeChange?.(triggerValue);
|
|
222
|
+
};
|
|
223
|
+
watch(computed(() => draggingIndex.value !== -1), (isDragging) => {
|
|
224
|
+
if (!isDragging && draggingValue.value !== null && draggingValue.value !== void 0) {
|
|
225
|
+
const valueIndex = rawValues.value.lastIndexOf(draggingValue.value);
|
|
226
|
+
if (valueIndex >= 0) handlesRef.value?.focus(valueIndex);
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
const sortedCacheValues = computed(() => [...cacheValues.value].sort((a, b) => a - b));
|
|
230
|
+
const includedRange = computed(() => {
|
|
231
|
+
if (!rangeEnabled.value) return [mergedMin.value, sortedCacheValues.value[0] ?? mergedMin.value];
|
|
232
|
+
if (!sortedCacheValues.value.length) return [mergedMin.value, mergedMin.value];
|
|
233
|
+
return [sortedCacheValues.value[0], sortedCacheValues.value[sortedCacheValues.value.length - 1]];
|
|
234
|
+
});
|
|
235
|
+
const includedStart = computed(() => includedRange.value[0]);
|
|
236
|
+
const includedEnd = computed(() => includedRange.value[1]);
|
|
237
|
+
expose({
|
|
238
|
+
focus: () => {
|
|
239
|
+
handlesRef.value?.focus(0);
|
|
240
|
+
},
|
|
241
|
+
blur: () => {
|
|
242
|
+
const { activeElement } = document;
|
|
243
|
+
if (containerRef.value?.contains(activeElement)) activeElement?.blur();
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
watch(() => props.autoFocus, (autoFocus) => {
|
|
247
|
+
if (autoFocus) handlesRef.value?.focus(0);
|
|
248
|
+
}, { immediate: true });
|
|
249
|
+
useProviderSliderContext(computed(() => ({
|
|
250
|
+
min: mergedMin.value,
|
|
251
|
+
max: mergedMax.value,
|
|
252
|
+
direction: direction.value,
|
|
253
|
+
disabled: disabled.value,
|
|
254
|
+
keyboard: keyboard.value,
|
|
255
|
+
step: mergedStep.value,
|
|
256
|
+
included: included.value,
|
|
257
|
+
includedStart: includedStart.value,
|
|
258
|
+
includedEnd: includedEnd.value,
|
|
259
|
+
range: rangeEnabled.value,
|
|
260
|
+
tabIndex: tabIndex.value,
|
|
261
|
+
ariaLabelForHandle: props.ariaLabelForHandle,
|
|
262
|
+
ariaLabelledByForHandle: props.ariaLabelledByForHandle,
|
|
263
|
+
ariaRequired: props.ariaRequired,
|
|
264
|
+
ariaValueTextFormatterForHandle: props.ariaValueTextFormatterForHandle,
|
|
265
|
+
styles: props.styles || {},
|
|
266
|
+
classNames: props.classNames || {}
|
|
267
|
+
})));
|
|
268
|
+
return () => {
|
|
269
|
+
const { id, startPoint, trackStyle, handleStyle, railStyle, dotStyle, activeDotStyle, dots, handleRender, activeHandleRender } = props;
|
|
270
|
+
const mergedClassName = classNames(prefixCls.value, props.className, attrs.class, {
|
|
271
|
+
[`${prefixCls.value}-disabled`]: disabled.value,
|
|
272
|
+
[`${prefixCls.value}-vertical`]: props.vertical,
|
|
273
|
+
[`${prefixCls.value}-horizontal`]: !props.vertical,
|
|
274
|
+
[`${prefixCls.value}-with-marks`]: markList.value.length
|
|
275
|
+
});
|
|
276
|
+
const mergedStyle = {
|
|
277
|
+
...props.style,
|
|
278
|
+
...attrs.style
|
|
279
|
+
};
|
|
280
|
+
return createVNode("div", {
|
|
281
|
+
"ref": containerRef,
|
|
282
|
+
"class": mergedClassName,
|
|
283
|
+
"style": mergedStyle,
|
|
284
|
+
"onMousedown": onSliderMouseDown,
|
|
285
|
+
"id": id
|
|
286
|
+
}, [
|
|
287
|
+
createVNode("div", {
|
|
288
|
+
"class": classNames(`${prefixCls.value}-rail`, props.classNames?.rail),
|
|
289
|
+
"style": {
|
|
290
|
+
...railStyle,
|
|
291
|
+
...props.styles?.rail
|
|
292
|
+
}
|
|
293
|
+
}, null),
|
|
294
|
+
props.track !== false && createVNode(Tracks_default, {
|
|
295
|
+
"prefixCls": prefixCls.value,
|
|
296
|
+
"trackStyle": trackStyle,
|
|
297
|
+
"values": rawValues.value,
|
|
298
|
+
"startPoint": startPoint,
|
|
299
|
+
"onStartMove": mergedDraggableTrack.value ? onStartMove : void 0
|
|
300
|
+
}, null),
|
|
301
|
+
createVNode(Steps_default, {
|
|
302
|
+
"prefixCls": prefixCls.value,
|
|
303
|
+
"marks": markList.value,
|
|
304
|
+
"dots": dots,
|
|
305
|
+
"style": dotStyle,
|
|
306
|
+
"activeStyle": activeDotStyle
|
|
307
|
+
}, null),
|
|
308
|
+
createVNode(Handles_default, {
|
|
309
|
+
"ref": handlesRef,
|
|
310
|
+
"prefixCls": prefixCls.value,
|
|
311
|
+
"handleStyle": handleStyle,
|
|
312
|
+
"values": cacheValues.value,
|
|
313
|
+
"draggingIndex": draggingIndex.value,
|
|
314
|
+
"draggingDelete": draggingDelete.value,
|
|
315
|
+
"onStartMove": onStartMove,
|
|
316
|
+
"onOffsetChange": onHandleOffsetChange,
|
|
317
|
+
"onFocus": (e) => {
|
|
318
|
+
emit("focus", e);
|
|
319
|
+
props.onFocus?.(e);
|
|
320
|
+
},
|
|
321
|
+
"onBlur": (e) => {
|
|
322
|
+
emit("blur", e);
|
|
323
|
+
props.onBlur?.(e);
|
|
324
|
+
},
|
|
325
|
+
"handleRender": handleRender,
|
|
326
|
+
"activeHandleRender": activeHandleRender,
|
|
327
|
+
"onChangeComplete": finishChange,
|
|
328
|
+
"onDelete": rangeEditable.value ? onDelete : () => {}
|
|
329
|
+
}, null),
|
|
330
|
+
createVNode(Marks_default, {
|
|
331
|
+
"prefixCls": prefixCls.value,
|
|
332
|
+
"marks": markList.value,
|
|
333
|
+
"onClick": changeToCloseValue
|
|
334
|
+
}, slots)
|
|
335
|
+
]);
|
|
336
|
+
};
|
|
337
|
+
}, { props: /* @__PURE__ */ mergeDefaults({
|
|
338
|
+
prefixCls: {
|
|
339
|
+
type: String,
|
|
340
|
+
required: false,
|
|
341
|
+
default: void 0
|
|
342
|
+
},
|
|
343
|
+
className: {
|
|
344
|
+
type: String,
|
|
345
|
+
required: false,
|
|
346
|
+
default: void 0
|
|
347
|
+
},
|
|
348
|
+
style: {
|
|
349
|
+
type: null,
|
|
350
|
+
required: false,
|
|
351
|
+
default: void 0
|
|
352
|
+
},
|
|
353
|
+
classNames: {
|
|
354
|
+
type: Object,
|
|
355
|
+
required: false,
|
|
356
|
+
default: void 0
|
|
357
|
+
},
|
|
358
|
+
styles: {
|
|
359
|
+
type: Object,
|
|
360
|
+
required: false,
|
|
361
|
+
default: void 0
|
|
362
|
+
},
|
|
363
|
+
id: {
|
|
364
|
+
type: String,
|
|
365
|
+
required: false,
|
|
366
|
+
default: void 0
|
|
367
|
+
},
|
|
368
|
+
disabled: {
|
|
369
|
+
type: Boolean,
|
|
370
|
+
required: false,
|
|
371
|
+
default: void 0
|
|
372
|
+
},
|
|
373
|
+
keyboard: {
|
|
374
|
+
type: Boolean,
|
|
375
|
+
required: false,
|
|
376
|
+
default: void 0
|
|
377
|
+
},
|
|
378
|
+
autoFocus: {
|
|
379
|
+
type: Boolean,
|
|
380
|
+
required: false,
|
|
381
|
+
default: void 0
|
|
382
|
+
},
|
|
383
|
+
onFocus: {
|
|
384
|
+
type: Function,
|
|
385
|
+
required: false,
|
|
386
|
+
default: void 0
|
|
387
|
+
},
|
|
388
|
+
onBlur: {
|
|
389
|
+
type: Function,
|
|
390
|
+
required: false,
|
|
391
|
+
default: void 0
|
|
392
|
+
},
|
|
393
|
+
range: {
|
|
394
|
+
type: [Boolean, Object],
|
|
395
|
+
required: false,
|
|
396
|
+
default: void 0
|
|
397
|
+
},
|
|
398
|
+
count: {
|
|
399
|
+
type: Number,
|
|
400
|
+
required: false,
|
|
401
|
+
default: void 0
|
|
402
|
+
},
|
|
403
|
+
min: {
|
|
404
|
+
type: Number,
|
|
405
|
+
required: false,
|
|
406
|
+
default: void 0
|
|
407
|
+
},
|
|
408
|
+
max: {
|
|
409
|
+
type: Number,
|
|
410
|
+
required: false,
|
|
411
|
+
default: void 0
|
|
412
|
+
},
|
|
413
|
+
step: {
|
|
414
|
+
type: [Number, null],
|
|
415
|
+
required: false,
|
|
416
|
+
default: void 0
|
|
417
|
+
},
|
|
418
|
+
value: {
|
|
419
|
+
type: [
|
|
420
|
+
Number,
|
|
421
|
+
Array,
|
|
422
|
+
null
|
|
423
|
+
],
|
|
424
|
+
required: false,
|
|
425
|
+
default: void 0
|
|
426
|
+
},
|
|
427
|
+
defaultValue: {
|
|
428
|
+
type: [
|
|
429
|
+
Number,
|
|
430
|
+
Array,
|
|
431
|
+
null
|
|
432
|
+
],
|
|
433
|
+
required: false,
|
|
434
|
+
default: void 0
|
|
435
|
+
},
|
|
436
|
+
onChange: {
|
|
437
|
+
type: Function,
|
|
438
|
+
required: false,
|
|
439
|
+
default: void 0
|
|
440
|
+
},
|
|
441
|
+
onBeforeChange: {
|
|
442
|
+
type: Function,
|
|
443
|
+
required: false,
|
|
444
|
+
default: void 0
|
|
445
|
+
},
|
|
446
|
+
onAfterChange: {
|
|
447
|
+
type: Function,
|
|
448
|
+
required: false,
|
|
449
|
+
default: void 0
|
|
450
|
+
},
|
|
451
|
+
onChangeComplete: {
|
|
452
|
+
type: Function,
|
|
453
|
+
required: false,
|
|
454
|
+
default: void 0
|
|
455
|
+
},
|
|
456
|
+
allowCross: {
|
|
457
|
+
type: Boolean,
|
|
458
|
+
required: false,
|
|
459
|
+
default: void 0
|
|
460
|
+
},
|
|
461
|
+
pushable: {
|
|
462
|
+
type: [Boolean, Number],
|
|
463
|
+
required: false,
|
|
464
|
+
default: void 0
|
|
465
|
+
},
|
|
466
|
+
reverse: {
|
|
467
|
+
type: Boolean,
|
|
468
|
+
required: false,
|
|
469
|
+
default: void 0
|
|
470
|
+
},
|
|
471
|
+
vertical: {
|
|
472
|
+
type: Boolean,
|
|
473
|
+
required: false,
|
|
474
|
+
default: void 0
|
|
475
|
+
},
|
|
476
|
+
included: {
|
|
477
|
+
type: Boolean,
|
|
478
|
+
required: false,
|
|
479
|
+
default: void 0
|
|
480
|
+
},
|
|
481
|
+
startPoint: {
|
|
482
|
+
type: Number,
|
|
483
|
+
required: false,
|
|
484
|
+
default: void 0
|
|
485
|
+
},
|
|
486
|
+
trackStyle: {
|
|
487
|
+
type: null,
|
|
488
|
+
required: false,
|
|
489
|
+
default: void 0
|
|
490
|
+
},
|
|
491
|
+
handleStyle: {
|
|
492
|
+
type: null,
|
|
493
|
+
required: false,
|
|
494
|
+
default: void 0
|
|
495
|
+
},
|
|
496
|
+
railStyle: {
|
|
497
|
+
type: null,
|
|
498
|
+
required: false,
|
|
499
|
+
default: void 0
|
|
500
|
+
},
|
|
501
|
+
dotStyle: {
|
|
502
|
+
type: Function,
|
|
503
|
+
required: false,
|
|
504
|
+
skipCheck: true,
|
|
505
|
+
default: void 0
|
|
506
|
+
},
|
|
507
|
+
activeDotStyle: {
|
|
508
|
+
type: Function,
|
|
509
|
+
required: false,
|
|
510
|
+
skipCheck: true,
|
|
511
|
+
default: void 0
|
|
512
|
+
},
|
|
513
|
+
marks: {
|
|
514
|
+
type: Object,
|
|
515
|
+
required: false,
|
|
516
|
+
default: void 0
|
|
517
|
+
},
|
|
518
|
+
dots: {
|
|
519
|
+
type: Boolean,
|
|
520
|
+
required: false,
|
|
521
|
+
default: void 0
|
|
522
|
+
},
|
|
523
|
+
handleRender: {
|
|
524
|
+
type: Function,
|
|
525
|
+
required: false,
|
|
526
|
+
default: void 0
|
|
527
|
+
},
|
|
528
|
+
activeHandleRender: {
|
|
529
|
+
type: Function,
|
|
530
|
+
required: false,
|
|
531
|
+
default: void 0
|
|
532
|
+
},
|
|
533
|
+
track: {
|
|
534
|
+
type: Boolean,
|
|
535
|
+
required: false,
|
|
536
|
+
default: void 0
|
|
537
|
+
},
|
|
538
|
+
tabIndex: {
|
|
539
|
+
type: [Number, Array],
|
|
540
|
+
required: false,
|
|
541
|
+
default: void 0
|
|
542
|
+
},
|
|
543
|
+
ariaLabelForHandle: {
|
|
544
|
+
type: [String, Array],
|
|
545
|
+
required: false,
|
|
546
|
+
default: void 0
|
|
547
|
+
},
|
|
548
|
+
ariaLabelledByForHandle: {
|
|
549
|
+
type: [String, Array],
|
|
550
|
+
required: false,
|
|
551
|
+
default: void 0
|
|
552
|
+
},
|
|
553
|
+
ariaRequired: {
|
|
554
|
+
type: Boolean,
|
|
555
|
+
required: false,
|
|
556
|
+
default: void 0
|
|
557
|
+
},
|
|
558
|
+
ariaValueTextFormatterForHandle: {
|
|
559
|
+
type: [Function, Array],
|
|
560
|
+
required: false,
|
|
561
|
+
default: void 0
|
|
562
|
+
}
|
|
563
|
+
}, sliderDefaults) });
|
|
564
|
+
export { Slider_default as default };
|