bitboss-ui 2.1.18 → 2.1.20
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/index.css +1 -1
- package/dist/index106.js +9 -9
- package/dist/index111.js +1 -1
- package/dist/index113.js +1 -1
- package/dist/index121.js +12 -12
- package/dist/index129.js +1 -1
- package/dist/index13.js +1 -1
- package/dist/index131.js +4 -4
- package/dist/index133.js +1 -1
- package/dist/index136.js +1 -1
- package/dist/index138.js +1 -1
- package/dist/index139.js +2 -2
- package/dist/index15.js +8 -8
- package/dist/index17.js +3 -3
- package/dist/index19.js +8 -8
- package/dist/index207.js +2 -2
- package/dist/index208.js +2 -2
- package/dist/index209.js +4 -2
- package/dist/index21.js +16 -16
- package/dist/index210.js +13 -4
- package/dist/index211.js +11 -2
- package/dist/index212.js +20 -5
- package/dist/index213.js +197 -5
- package/dist/index215.js +72 -5
- package/dist/index217.js +13 -5
- package/dist/index218.js +114 -2
- package/dist/index220.js +5 -2
- package/dist/index221.js +5 -13
- package/dist/index222.js +5 -11
- package/dist/index223.js +5 -20
- package/dist/index224.js +5 -72
- package/dist/index225.js +7 -0
- package/dist/index226.js +5 -13
- package/dist/index227.js +3 -114
- package/dist/index228.js +4 -0
- package/dist/index229.js +6 -84
- package/dist/index23.js +15 -15
- package/dist/index230.js +252 -0
- package/dist/index231.js +51 -28
- package/dist/index232.js +44 -16
- package/dist/index233.js +5 -17
- package/dist/index234.js +59 -50
- package/dist/index235.js +34 -15
- package/dist/index236.js +86 -3
- package/dist/index238.js +28 -33
- package/dist/index239.js +16 -2
- package/dist/index240.js +17 -2
- package/dist/index241.js +50 -6
- package/dist/index242.js +15 -7
- package/dist/index243.js +11 -182
- package/dist/index244.js +2 -106
- package/dist/index245.js +4 -0
- package/dist/index246.js +2 -100
- package/dist/index247.js +108 -0
- package/dist/index249.js +95 -192
- package/dist/index25.js +3 -3
- package/dist/index251.js +2 -3
- package/dist/index252.js +4 -5
- package/dist/index253.js +5 -5
- package/dist/index254.js +17 -7
- package/dist/index255.js +12 -250
- package/dist/index256.js +5 -51
- package/dist/index257.js +224 -39
- package/dist/index258.js +2 -5
- package/dist/index259.js +2 -60
- package/dist/index260.js +6 -12
- package/dist/index261.js +7 -18
- package/dist/index262.js +182 -11
- package/dist/index263.js +3 -6
- package/dist/index264.js +12 -228
- package/dist/index265.js +6 -10
- package/dist/index266.js +16 -3
- package/dist/index267.js +9 -6
- package/dist/index268.js +23 -16
- package/dist/index269.js +10 -9
- package/dist/index27.js +1 -1
- package/dist/index270.js +2 -8
- package/dist/index271.js +3 -23
- package/dist/index272.js +9 -3
- package/dist/index273.js +9 -2
- package/dist/index274.js +8 -9
- package/dist/index275.js +2 -8
- package/dist/index276.js +5 -67
- package/dist/index277.js +67 -5
- package/dist/index278.js +4 -7
- package/dist/index279.js +8 -5
- package/dist/index280.js +3 -4
- package/dist/index281.js +3 -280
- package/dist/index283.js +7 -125
- package/dist/index284.js +3 -2
- package/dist/index285.js +7 -15
- package/dist/index286.js +11 -2
- package/dist/index287.js +2 -16
- package/dist/index288.js +280 -2
- package/dist/index289.js +2 -16
- package/dist/index29.js +4 -4
- package/dist/index290.js +16 -2
- package/dist/index291.js +2 -19
- package/dist/index292.js +16 -2
- package/dist/index293.js +2 -3
- package/dist/index294.js +21 -0
- package/dist/index295.js +2 -7
- package/dist/index296.js +15 -3
- package/dist/index297.js +2 -7
- package/dist/index298.js +18 -10
- package/dist/index299.js +2 -4
- package/dist/index300.js +27 -3
- package/dist/index301.js +2 -17
- package/dist/index302.js +2 -28
- package/dist/index303.js +2 -6
- package/dist/index304.js +1 -1
- package/dist/index305.js +2 -3
- package/dist/index306.js +28 -3
- package/dist/index307.js +22 -3
- package/dist/index309.js +3 -18
- package/dist/index31.js +2 -2
- package/dist/index310.js +3 -2
- package/dist/index311.js +17 -27
- package/dist/index312.js +6 -2
- package/dist/index313.js +3 -2
- package/dist/index314.js +3 -2
- package/dist/index315.js +4 -2
- package/dist/index316.js +125 -2
- package/dist/index317.js +2 -22
- package/dist/index318.js +4 -0
- package/dist/index319.js +5 -2
- package/dist/index323.js +1 -1
- package/dist/index324.js +7 -2
- package/dist/index325.js +7 -32
- package/dist/index326.js +6 -28
- package/dist/index327.js +10 -0
- package/dist/index328.js +123 -222
- package/dist/index329.js +367 -56
- package/dist/index33.js +8 -8
- package/dist/index330.js +32 -57
- package/dist/index331.js +28 -8
- package/dist/index333.js +7 -8
- package/dist/index334.js +17 -45
- package/dist/index335.js +58 -7
- package/dist/index336.js +57 -128
- package/dist/index337.js +2 -369
- package/dist/index338.js +46 -6
- package/dist/index339.js +226 -17
- package/dist/index340.js +1 -1
- package/dist/index342.js +436 -3
- package/dist/index343.js +123 -484
- package/dist/index345.js +3 -50
- package/dist/index346.js +473 -421
- package/dist/index347.js +48 -125
- package/dist/index35.js +4 -4
- package/dist/index37.js +20 -20
- package/dist/index39.js +100 -104
- package/dist/index41.js +2 -2
- package/dist/index43.js +8 -8
- package/dist/index45.js +8 -8
- package/dist/index47.js +2 -2
- package/dist/index49.js +3 -3
- package/dist/index53.js +1 -1
- package/dist/index55.js +1 -1
- package/dist/index57.js +2 -2
- package/dist/index61.js +3 -3
- package/dist/index67.js +1 -1
- package/dist/index79.js +4 -4
- package/dist/index81.js +1 -1
- package/dist/index83.js +2 -2
- package/dist/index85.js +1 -1
- package/dist/index87.js +1 -1
- package/dist/index90.js +3 -3
- package/dist/index92.js +2 -2
- package/dist/index94.js +3 -3
- package/dist/index96.js +1 -1
- package/package.json +1 -1
- package/dist/index214.js +0 -7
- package/dist/index216.js +0 -7
- package/dist/index219.js +0 -4
- package/dist/index237.js +0 -14
- package/dist/index248.js +0 -6
- package/dist/index282.js +0 -4
- package/dist/index308.js +0 -7
- package/dist/index332.js +0 -8
- /package/dist/{index344.js → index341.js} +0 -0
package/dist/index347.js
CHANGED
@@ -1,129 +1,52 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
function x(t) {
|
32
|
-
return ["top", "bottom"].includes(u(t)) ? "y" : "x";
|
33
|
-
}
|
34
|
-
function d(t) {
|
35
|
-
return h(x(t));
|
36
|
-
}
|
37
|
-
function C(t, n, e) {
|
38
|
-
e === void 0 && (e = !1);
|
39
|
-
const r = g(t), o = d(t), i = b(o);
|
40
|
-
let c = o === "x" ? r === (e ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
|
41
|
-
return n.reference[i] > n.floating[i] && (c = f(c)), [c, f(c)];
|
42
|
-
}
|
43
|
-
function L(t) {
|
44
|
-
const n = f(t);
|
45
|
-
return [s(t), n, s(n)];
|
46
|
-
}
|
47
|
-
function s(t) {
|
48
|
-
return t.replace(/start|end/g, (n) => a[n]);
|
49
|
-
}
|
50
|
-
function A(t, n, e) {
|
51
|
-
const r = ["left", "right"], o = ["right", "left"], i = ["top", "bottom"], c = ["bottom", "top"];
|
52
|
-
switch (t) {
|
53
|
-
case "top":
|
54
|
-
case "bottom":
|
55
|
-
return e ? n ? o : r : n ? r : o;
|
56
|
-
case "left":
|
57
|
-
case "right":
|
58
|
-
return n ? i : c;
|
59
|
-
default:
|
60
|
-
return [];
|
1
|
+
function T(n, i, e) {
|
2
|
+
let l = e.initialDeps ?? [], t;
|
3
|
+
function r() {
|
4
|
+
var o, m, h, f;
|
5
|
+
let g;
|
6
|
+
e.key && ((o = e.debug) != null && o.call(e)) && (g = Date.now());
|
7
|
+
const u = n();
|
8
|
+
if (!(u.length !== l.length || u.some((c, a) => l[a] !== c)))
|
9
|
+
return t;
|
10
|
+
l = u;
|
11
|
+
let s;
|
12
|
+
if (e.key && ((m = e.debug) != null && m.call(e)) && (s = Date.now()), t = i(...u), e.key && ((h = e.debug) != null && h.call(e))) {
|
13
|
+
const c = Math.round((Date.now() - g) * 100) / 100, a = Math.round((Date.now() - s) * 100) / 100, b = a / 16, w = (d, v) => {
|
14
|
+
for (d = String(d); d.length < v; )
|
15
|
+
d = " " + d;
|
16
|
+
return d;
|
17
|
+
};
|
18
|
+
console.info(
|
19
|
+
`%c⏱ ${w(a, 5)} /${w(c, 5)} ms`,
|
20
|
+
`
|
21
|
+
font-size: .6rem;
|
22
|
+
font-weight: bold;
|
23
|
+
color: hsl(${Math.max(
|
24
|
+
0,
|
25
|
+
Math.min(120 - 120 * b, 120)
|
26
|
+
)}deg 100% 31%);`,
|
27
|
+
e == null ? void 0 : e.key
|
28
|
+
);
|
29
|
+
}
|
30
|
+
return (f = e == null ? void 0 : e.onChange) == null || f.call(e, t), t;
|
61
31
|
}
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
return
|
70
|
-
}
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
bottom: 0,
|
76
|
-
left: 0,
|
77
|
-
...t
|
78
|
-
};
|
79
|
-
}
|
80
|
-
function R(t) {
|
81
|
-
return typeof t != "number" ? y(t) : {
|
82
|
-
top: t,
|
83
|
-
right: t,
|
84
|
-
bottom: t,
|
85
|
-
left: t
|
86
|
-
};
|
87
|
-
}
|
88
|
-
function T(t) {
|
89
|
-
const {
|
90
|
-
x: n,
|
91
|
-
y: e,
|
92
|
-
width: r,
|
93
|
-
height: o
|
94
|
-
} = t;
|
95
|
-
return {
|
96
|
-
width: r,
|
97
|
-
height: o,
|
98
|
-
top: e,
|
99
|
-
left: n,
|
100
|
-
right: n + r,
|
101
|
-
bottom: e + o,
|
102
|
-
x: n,
|
103
|
-
y: e
|
32
|
+
return r.updateDeps = (o) => {
|
33
|
+
l = o;
|
34
|
+
}, r;
|
35
|
+
}
|
36
|
+
function y(n, i) {
|
37
|
+
if (n === void 0)
|
38
|
+
throw new Error("Unexpected undefined");
|
39
|
+
return n;
|
40
|
+
}
|
41
|
+
const M = (n, i) => Math.abs(n - i) <= 1, k = (n, i, e) => {
|
42
|
+
let l;
|
43
|
+
return function(...t) {
|
44
|
+
n.clearTimeout(l), l = n.setTimeout(() => i.apply(this, t), e);
|
104
45
|
};
|
105
|
-
}
|
46
|
+
};
|
106
47
|
export {
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
y as
|
111
|
-
O as floor,
|
112
|
-
g as getAlignment,
|
113
|
-
d as getAlignmentAxis,
|
114
|
-
C as getAlignmentSides,
|
115
|
-
b as getAxisLength,
|
116
|
-
L as getExpandedPlacements,
|
117
|
-
s as getOppositeAlignmentPlacement,
|
118
|
-
h as getOppositeAxis,
|
119
|
-
E as getOppositeAxisPlacements,
|
120
|
-
f as getOppositePlacement,
|
121
|
-
R as getPaddingObject,
|
122
|
-
u as getSide,
|
123
|
-
x as getSideAxis,
|
124
|
-
m as max,
|
125
|
-
l as min,
|
126
|
-
T as rectToClientRect,
|
127
|
-
M as round,
|
128
|
-
P as sides
|
48
|
+
M as approxEqual,
|
49
|
+
k as debounce,
|
50
|
+
T as memo,
|
51
|
+
y as notUndefined
|
129
52
|
};
|
package/dist/index35.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import { defineComponent as I, ref as v, computed as f, createElementBlock as l, openBlock as r, mergeProps as h, createElementVNode as i, renderSlot as p, Fragment as V, renderList as M, normalizeClass as D, toDisplayString as F, unref as y } from "vue";
|
2
|
-
import { booleanishToBoolean as T } from "./
|
3
|
-
import { identity as $ } from "./
|
4
|
-
import { isCssColor as k } from "./
|
2
|
+
import { booleanishToBoolean as T } from "./index244.js";
|
3
|
+
import { identity as $ } from "./index245.js";
|
4
|
+
import { isCssColor as k } from "./index246.js";
|
5
5
|
import { isNotNil as q } from "./index140.js";
|
6
|
-
import { useLocale as x } from "./
|
6
|
+
import { useLocale as x } from "./index210.js";
|
7
7
|
const H = { class: "bb-base-rating__inner-container" }, S = { class: "bb-base-rating__label-text sr-only" }, N = ["id", "aria-describedby", "autofocus", "checked", "disabled", "name", "required", "value"], j = ["height", "width"], W = /* @__PURE__ */ I({
|
8
8
|
__name: "BaseRating",
|
9
9
|
props: {
|
package/dist/index37.js
CHANGED
@@ -5,32 +5,32 @@ import { useId as tt } from "./index8.js";
|
|
5
5
|
import { useMobile as lt } from "./index9.js";
|
6
6
|
import at from "./index111.js";
|
7
7
|
/* empty css */
|
8
|
-
import { hash as ot } from "./
|
9
|
-
import { isEmpty as nt } from "./
|
10
|
-
import { last as ut } from "./
|
11
|
-
import { matchAnyKey as ie } from "./
|
12
|
-
import { useArray as st } from "./
|
13
|
-
import { useBaseOptions as it } from "./
|
14
|
-
import { useCoherence as rt } from "./
|
15
|
-
import { useHashedWatcher as re } from "./
|
16
|
-
import { useIndexById as de } from "./
|
8
|
+
import { hash as ot } from "./index227.js";
|
9
|
+
import { isEmpty as nt } from "./index251.js";
|
10
|
+
import { last as ut } from "./index228.js";
|
11
|
+
import { matchAnyKey as ie } from "./index254.js";
|
12
|
+
import { useArray as st } from "./index255.js";
|
13
|
+
import { useBaseOptions as it } from "./index241.js";
|
14
|
+
import { useCoherence as rt } from "./index242.js";
|
15
|
+
import { useHashedWatcher as re } from "./index243.js";
|
16
|
+
import { useIndexById as de } from "./index240.js";
|
17
17
|
import { useMounted as dt, useIntersectionObserver as ct } from "./index137.js";
|
18
|
-
import { useItemsGetter as pt } from "./
|
19
|
-
import { useLocale as mt } from "./
|
20
|
-
import { usePrefill as ft } from "./
|
18
|
+
import { useItemsGetter as pt } from "./index238.js";
|
19
|
+
import { useLocale as mt } from "./index210.js";
|
20
|
+
import { usePrefill as ft } from "./index239.js";
|
21
21
|
import { wait as q } from "./index135.js";
|
22
|
-
import { waitFor as vt } from "./
|
23
|
-
import { when as ht } from "./
|
24
|
-
import yt from "./
|
22
|
+
import { waitFor as vt } from "./index256.js";
|
23
|
+
import { when as ht } from "./index252.js";
|
24
|
+
import yt from "./index247.js";
|
25
25
|
/* empty css */
|
26
|
-
import bt from "./
|
26
|
+
import bt from "./index249.js";
|
27
27
|
/* empty css */
|
28
|
-
import gt from "./
|
28
|
+
import gt from "./index215.js";
|
29
29
|
/* empty css */
|
30
|
-
import wt from "./
|
31
|
-
import Bt from "./
|
30
|
+
import wt from "./index217.js";
|
31
|
+
import Bt from "./index218.js";
|
32
32
|
/* empty css */
|
33
|
-
import Vt from "./
|
33
|
+
import Vt from "./index257.js";
|
34
34
|
const St = { class: "bb-base-select__inner-wrapper" }, kt = { class: "bb-base-select__input-container" }, Ct = {
|
35
35
|
key: 1,
|
36
36
|
class: "bb-base-select__max-reached"
|
package/dist/index39.js
CHANGED
@@ -1,17 +1,16 @@
|
|
1
|
-
import { defineComponent as
|
2
|
-
import { head as
|
3
|
-
import { isCssColor as Y } from "./
|
4
|
-
import { isNil as S } from "./
|
5
|
-
import { getAsPercentageBetween as
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
|
11
|
-
const ve = { class: "bb-base-slider__slider-container" }, fe = {
|
1
|
+
import { defineComponent as re, ref as d, computed as p, onMounted as te, watch as le, createElementBlock as y, openBlock as g, mergeProps as N, renderSlot as v, createElementVNode as m, createCommentVNode as H, Fragment as oe, renderList as ne, normalizeProps as se, guardReactiveProps as ie, unref as c, normalizeStyle as G, normalizeClass as O } from "vue";
|
2
|
+
import { head as ue } from "./index259.js";
|
3
|
+
import { isCssColor as Y } from "./index246.js";
|
4
|
+
import { isNil as S } from "./index258.js";
|
5
|
+
import { getAsPercentageBetween as x, getAsPercentage as de, getValueFromPercentageInInterval as T } from "./index136.js";
|
6
|
+
import { snapToStep as me } from "./index260.js";
|
7
|
+
import { last as ce } from "./index228.js";
|
8
|
+
import { transpose as j } from "./index261.js";
|
9
|
+
import { clamp as f } from "./index208.js";
|
10
|
+
const be = { class: "bb-base-slider__slider-container" }, ve = {
|
12
11
|
key: 0,
|
13
12
|
class: "bb-base-slider__ticks-container"
|
14
|
-
},
|
13
|
+
}, fe = ["id", "disabled", "name", "required", "value"], pe = ["aria-describedby", "aria-readonly", "aria-valuemax", "aria-valuemin", "aria-valuenow", "tabindex"], he = ["aria-describedby", "aria-readonly", "aria-valuemax", "aria-valuemin", "aria-valuenow", "tabindex"], $e = /* @__PURE__ */ re({
|
15
14
|
__name: "BaseSlider",
|
16
15
|
props: {
|
17
16
|
ariaDescribedby: {},
|
@@ -33,127 +32,127 @@ const ve = { class: "bb-base-slider__slider-container" }, fe = {
|
|
33
32
|
thumbTranslate: { type: Boolean, default: !0 }
|
34
33
|
},
|
35
34
|
emits: ["click", "focus", "active", "inactive", "keydown", "pointerdown", "pointermove", "pointerup", "update:modelValue"],
|
36
|
-
setup(
|
37
|
-
const a =
|
35
|
+
setup(J, { emit: K }) {
|
36
|
+
const a = J, s = K;
|
38
37
|
if (a.min < Number.MIN_SAFE_INTEGER || a.max > Number.MAX_SAFE_INTEGER)
|
39
38
|
throw new Error("BaseSlider min or max is too large");
|
40
|
-
const C = d(), V = d(), b = d(), u = d(), n = d(0),
|
39
|
+
const C = d(), V = d(), b = d(), u = d(), n = d(0), t = d(0), _ = p(() => Array.isArray(a.modelValue) ? ue(a.modelValue) ?? void 0 : S(a.modelValue) ? void 0 : Number(a.modelValue)), A = p(() => Array.isArray(a.modelValue) ? ce(a.modelValue) ?? void 0 : S(a.modelValue) ? void 0 : Number(a.modelValue)), P = p(() => [n.value, t.value].sort(
|
41
40
|
(e, r) => e - r
|
42
41
|
)), $ = d(!1);
|
43
42
|
if (a.range && !Array.isArray(a.modelValue))
|
44
43
|
throw new TypeError(
|
45
44
|
"BaseSlider mode is set as range but modelValue is not an array"
|
46
45
|
);
|
47
|
-
|
46
|
+
te(() => {
|
48
47
|
var e;
|
49
48
|
a.autofocus && ((e = u.value) == null || e.focus());
|
50
49
|
});
|
51
|
-
let
|
50
|
+
let L = d(!1), l = d(null);
|
52
51
|
const F = (e) => {
|
53
52
|
if (u.value && u.value.contains(e.target))
|
54
53
|
return "higher";
|
55
54
|
if (b.value && b.value.contains(e.target))
|
56
55
|
return "lower";
|
57
56
|
throw new Error("Could not identify target thumb");
|
58
|
-
},
|
59
|
-
a.disabled || a.readonly || (
|
57
|
+
}, Q = (e) => {
|
58
|
+
a.disabled || a.readonly || (l.value || (l.value = F(e)), L.value = !0, document.addEventListener("pointermove", w), document.addEventListener("pointerup", B), s("pointerdown", e));
|
60
59
|
};
|
61
|
-
let I = p(() =>
|
62
|
-
const
|
60
|
+
let I = p(() => L.value ? {} : { onPointerdown: Q });
|
61
|
+
const w = (e) => {
|
63
62
|
if (!(a.disabled || a.readonly) && V.value) {
|
64
63
|
e instanceof PointerEvent ? s("pointermove", e) : s("click", e);
|
65
|
-
const r = V.value.getBoundingClientRect(),
|
66
|
-
let
|
67
|
-
|
64
|
+
const r = V.value.getBoundingClientRect(), o = e.clientX, i = r.left, h = r.width;
|
65
|
+
let Z = j(
|
66
|
+
o,
|
68
67
|
i,
|
69
68
|
i + h,
|
70
69
|
a.min,
|
71
70
|
a.max
|
72
71
|
);
|
73
|
-
const
|
74
|
-
|
72
|
+
const ee = me(
|
73
|
+
Z,
|
75
74
|
a.min,
|
76
75
|
a.max,
|
77
76
|
a.step
|
78
|
-
),
|
79
|
-
|
77
|
+
), ae = x(
|
78
|
+
ee,
|
80
79
|
a.min,
|
81
80
|
a.max
|
82
|
-
), M = f(
|
83
|
-
|
81
|
+
), M = f(ae, 0, 100);
|
82
|
+
l.value === "higher" ? t.value = M : l.value === "lower" && (n.value = M), s("update:modelValue", z());
|
84
83
|
}
|
85
|
-
},
|
84
|
+
}, z = () => {
|
86
85
|
if (a.range)
|
87
86
|
return [
|
88
|
-
|
87
|
+
T(
|
89
88
|
n.value,
|
90
89
|
a.min,
|
91
90
|
a.max
|
92
91
|
),
|
93
|
-
|
94
|
-
|
92
|
+
T(
|
93
|
+
t.value,
|
95
94
|
a.min,
|
96
95
|
a.max
|
97
96
|
)
|
98
97
|
].sort((e, r) => e - r).map((e) => Number(e.toFixed(a.maxPrecision)));
|
99
98
|
{
|
100
|
-
const e =
|
101
|
-
|
99
|
+
const e = T(
|
100
|
+
t.value,
|
102
101
|
a.min,
|
103
102
|
a.max
|
104
103
|
);
|
105
104
|
return Number(e.toFixed(a.maxPrecision));
|
106
105
|
}
|
107
106
|
};
|
108
|
-
|
107
|
+
le(
|
109
108
|
() => a.modelValue,
|
110
109
|
(e) => {
|
111
110
|
if (a.range) {
|
112
111
|
if (!Array.isArray(e))
|
113
112
|
throw new Error("BaseSlider modelValue must be an array");
|
114
113
|
if (e.length !== 2) {
|
115
|
-
n.value = 0,
|
114
|
+
n.value = 0, t.value = 100;
|
116
115
|
return;
|
117
116
|
}
|
118
|
-
const
|
119
|
-
(i) => f(
|
117
|
+
const o = [...e].sort((i, h) => i - h).map(
|
118
|
+
(i) => f(x(i, a.min, a.max), 0, 100)
|
120
119
|
);
|
121
|
-
n.value >
|
120
|
+
n.value > t.value ? (n.value = o[1], t.value = o[0]) : (n.value = o[0], t.value = o[1]);
|
122
121
|
} else {
|
123
122
|
let r = e ?? a.min;
|
124
|
-
const
|
125
|
-
|
123
|
+
const o = j(r, a.min, a.max, 0, 100), i = f(o, 0, 100);
|
124
|
+
t.value = i;
|
126
125
|
}
|
127
126
|
},
|
128
127
|
{ immediate: !0 }
|
129
128
|
);
|
130
|
-
const
|
131
|
-
|
132
|
-
},
|
133
|
-
s("keydown", e), !(a.disabled || a.readonly || e.key !== "ArrowLeft" && e.key !== "ArrowRight") && (e.key === "ArrowLeft" ?
|
134
|
-
|
129
|
+
const B = (e) => {
|
130
|
+
L.value = !1, l.value = null, document.removeEventListener("pointermove", w), document.removeEventListener("pointerup", B), s("pointerup", e);
|
131
|
+
}, k = de(a.step, a.max - a.min), R = (e) => {
|
132
|
+
s("keydown", e), !(a.disabled || a.readonly || e.key !== "ArrowLeft" && e.key !== "ArrowRight") && (e.key === "ArrowLeft" ? l.value === "higher" || document.activeElement === u.value || e.target === u.value ? t.value = f(
|
133
|
+
t.value - k,
|
135
134
|
0,
|
136
135
|
100
|
137
|
-
) : (
|
138
|
-
n.value -
|
136
|
+
) : (l.value === "lower" || document.activeElement === b.value || e.target === b.value) && (n.value = f(
|
137
|
+
n.value - k,
|
139
138
|
0,
|
140
139
|
100
|
141
|
-
)) : e.key === "ArrowRight" && (
|
142
|
-
|
140
|
+
)) : e.key === "ArrowRight" && (l.value === "higher" || document.activeElement === u.value || e.target === u.value ? t.value = f(
|
141
|
+
t.value + k,
|
143
142
|
0,
|
144
143
|
100
|
145
|
-
) : (
|
146
|
-
n.value +
|
144
|
+
) : (l.value === "lower" || document.activeElement === b.value || e.target === b.value) && (n.value = f(
|
145
|
+
n.value + k,
|
147
146
|
0,
|
148
147
|
100
|
149
|
-
))), s("update:modelValue",
|
148
|
+
))), s("update:modelValue", z()));
|
150
149
|
}, X = (e) => {
|
151
150
|
s("focus", e);
|
152
151
|
const r = F(e);
|
153
|
-
r && (
|
154
|
-
},
|
152
|
+
r && (l.value = r), $.value || ($.value = !0, s("active"), document.addEventListener("focusin", E), document.addEventListener("click", E));
|
153
|
+
}, E = (e) => {
|
155
154
|
var r;
|
156
|
-
e.target instanceof HTMLElement && ((r = C.value) != null && r.contains(e.target) || ($.value = !1,
|
155
|
+
e.target instanceof HTMLElement && ((r = C.value) != null && r.contains(e.target) || ($.value = !1, l.value = null, s("inactive"), document.removeEventListener("focusin", E), document.removeEventListener("click", E)));
|
157
156
|
}, q = {
|
158
157
|
class: {
|
159
158
|
"bb-base-slider": !0,
|
@@ -162,54 +161,51 @@ const ve = { class: "bb-base-slider__slider-container" }, fe = {
|
|
162
161
|
"bb-base-slider--readonly": a.readonly,
|
163
162
|
[`bb-base-slider--${a.color}`]: a.color && !Y(a.color)
|
164
163
|
},
|
165
|
-
|
166
|
-
var
|
167
|
-
|
168
|
-
(t = u.value) == null || t.focus(), B(e);
|
169
|
-
const r = N();
|
170
|
-
j(r), j(a.modelValue);
|
164
|
+
onPointerdown: (e) => {
|
165
|
+
var r;
|
166
|
+
a.range || ((r = u.value) == null || r.focus(), w(e), document.addEventListener("pointermove", w), document.addEventListener("pointerup", B));
|
171
167
|
},
|
172
168
|
style: {}
|
173
169
|
};
|
174
170
|
a.color && Y(a.color) && (q.style["--color"] = a.color);
|
175
|
-
const
|
171
|
+
const U = p(() => {
|
176
172
|
const e = "bb-base-slider__track-background", r = {
|
177
|
-
width: `${
|
178
|
-
left: `${
|
173
|
+
width: `${P.value[1] - P.value[0]}%`,
|
174
|
+
left: `${P.value[0]}%`
|
179
175
|
};
|
180
176
|
return {
|
181
177
|
class: e,
|
182
178
|
style: r
|
183
179
|
};
|
184
|
-
}),
|
180
|
+
}), W = (e) => S(a.modelValue) ? !1 : Array.isArray(a.modelValue) ? a.modelValue.length === 0 ? !1 : a.modelValue[0] <= e && a.modelValue[1] >= e : e <= Number(a.modelValue), D = p(() => {
|
185
181
|
if (!a.ticks) return [];
|
186
182
|
let e = [], r = a.min;
|
187
183
|
for (; r <= a.max; ) {
|
188
|
-
let
|
189
|
-
const i =
|
184
|
+
let o = r;
|
185
|
+
const i = x(o, a.min, a.max), h = W(o);
|
190
186
|
e.push({
|
191
|
-
value:
|
187
|
+
value: o,
|
192
188
|
percent: i,
|
193
189
|
active: h
|
194
190
|
}), r += a.step;
|
195
191
|
}
|
196
192
|
return e;
|
197
193
|
});
|
198
|
-
return (e, r) => (g(), y("span",
|
194
|
+
return (e, r) => (g(), y("span", N(q, {
|
199
195
|
ref_key: "container",
|
200
196
|
ref: C
|
201
197
|
}), [
|
202
198
|
v(e.$slots, "prepend"),
|
203
|
-
m("span",
|
204
|
-
D.value.length ? (g(), y("span",
|
205
|
-
(g(!0), y(
|
206
|
-
key:
|
199
|
+
m("span", be, [
|
200
|
+
D.value.length ? (g(), y("span", ve, [
|
201
|
+
(g(!0), y(oe, null, ne(D.value, (o) => (g(), y("span", {
|
202
|
+
key: o.value,
|
207
203
|
class: "bb-base-slider__tick"
|
208
204
|
}, [
|
209
205
|
v(e.$slots, "tick", {
|
210
|
-
active:
|
211
|
-
percent:
|
212
|
-
value:
|
206
|
+
active: o.active,
|
207
|
+
percent: o.percent,
|
208
|
+
value: o.value
|
213
209
|
})
|
214
210
|
]))), 128))
|
215
211
|
])) : H("", !0),
|
@@ -218,21 +214,21 @@ const ve = { class: "bb-base-slider__slider-container" }, fe = {
|
|
218
214
|
class: "sr-only",
|
219
215
|
disabled: e.disabled,
|
220
216
|
name: e.name,
|
221
|
-
readonly:
|
217
|
+
readonly: !0,
|
222
218
|
required: e.required,
|
223
219
|
tabindex: -1,
|
224
220
|
type: "text",
|
225
221
|
value: JSON.stringify(e.modelValue)
|
226
|
-
}, null, 8,
|
222
|
+
}, null, 8, fe),
|
227
223
|
m("span", {
|
228
224
|
ref_key: "track",
|
229
225
|
ref: V,
|
230
226
|
class: "bb-base-slider__track-container"
|
231
227
|
}, [
|
232
228
|
r[0] || (r[0] = m("span", { class: "bb-base-slider__track-fill" }, null, -1)),
|
233
|
-
m("span", ie(
|
229
|
+
m("span", se(ie(U.value)), null, 16)
|
234
230
|
], 512),
|
235
|
-
a.range ? (g(), y("span",
|
231
|
+
a.range ? (g(), y("span", N({ key: 1 }, c(I), {
|
236
232
|
key: "thumblower",
|
237
233
|
ref_key: "thumblower",
|
238
234
|
ref: b,
|
@@ -241,7 +237,7 @@ const ve = { class: "bb-base-slider__slider-container" }, fe = {
|
|
241
237
|
"aria-readonly": !e.readonly,
|
242
238
|
"aria-valuemax": e.max,
|
243
239
|
"aria-valuemin": e.min,
|
244
|
-
"aria-valuenow":
|
240
|
+
"aria-valuenow": _.value,
|
245
241
|
class: "bb-base-slider__thumb-container",
|
246
242
|
"data-thumb": "lower",
|
247
243
|
role: "slider",
|
@@ -254,7 +250,7 @@ const ve = { class: "bb-base-slider__slider-container" }, fe = {
|
|
254
250
|
class: O({
|
255
251
|
"bb-base-slider__thumb": !0,
|
256
252
|
"bb-base-slider__thumb--lower": !0,
|
257
|
-
"bb-base-slider__thumb--focused": c(
|
253
|
+
"bb-base-slider__thumb--focused": c(l) === "lower"
|
258
254
|
}),
|
259
255
|
style: G({
|
260
256
|
transform: `translateY(-50%) ${e.thumbTranslate ? `translateX(-${n.value}%)` : "translateX(-50%)"}`,
|
@@ -262,19 +258,19 @@ const ve = { class: "bb-base-slider__slider-container" }, fe = {
|
|
262
258
|
})
|
263
259
|
}, [
|
264
260
|
v(e.$slots, "thumb:lower", {
|
265
|
-
focused: c(
|
261
|
+
focused: c(l) === "lower",
|
266
262
|
percent: n.value,
|
267
|
-
value:
|
263
|
+
value: _.value
|
268
264
|
}, () => [
|
269
265
|
v(e.$slots, "thumb", {
|
270
|
-
focused: c(
|
266
|
+
focused: c(l) === "lower",
|
271
267
|
percent: n.value,
|
272
|
-
value:
|
268
|
+
value: _.value
|
273
269
|
})
|
274
270
|
])
|
275
271
|
], 6)
|
276
|
-
], 16,
|
277
|
-
m("span",
|
272
|
+
], 16, pe)) : H("", !0),
|
273
|
+
m("span", N(c(I), {
|
278
274
|
key: "thumbhigher",
|
279
275
|
ref_key: "thumbhigher",
|
280
276
|
ref: u,
|
@@ -283,11 +279,11 @@ const ve = { class: "bb-base-slider__slider-container" }, fe = {
|
|
283
279
|
"aria-readonly": !e.readonly,
|
284
280
|
"aria-valuemax": e.max,
|
285
281
|
"aria-valuemin": e.min,
|
286
|
-
"aria-valuenow":
|
282
|
+
"aria-valuenow": A.value,
|
287
283
|
class: "bb-base-slider__thumb-container",
|
288
284
|
"data-thumb": "higher",
|
289
285
|
role: "slider",
|
290
|
-
style: { left: `${
|
286
|
+
style: { left: `${t.value}%` },
|
291
287
|
tabindex: e.disabled ? -1 : 0,
|
292
288
|
onFocus: X,
|
293
289
|
onKeydown: R
|
@@ -296,31 +292,31 @@ const ve = { class: "bb-base-slider__slider-container" }, fe = {
|
|
296
292
|
class: O({
|
297
293
|
"bb-base-slider__thumb": !0,
|
298
294
|
"bb-base-slider__thumb--higher": !0,
|
299
|
-
"bb-base-slider__thumb--focused": c(
|
295
|
+
"bb-base-slider__thumb--focused": c(l) === "higher"
|
300
296
|
}),
|
301
297
|
style: G({
|
302
|
-
transform: `translateY(-50%) ${e.thumbTranslate ? `translateX(-${
|
303
|
-
left: `${
|
298
|
+
transform: `translateY(-50%) ${e.thumbTranslate ? `translateX(-${t.value}%)` : "translateX(-50%)"}`,
|
299
|
+
left: `${t.value}%`
|
304
300
|
})
|
305
301
|
}, [
|
306
302
|
v(e.$slots, "thumb:higher", {
|
307
|
-
focused: c(
|
308
|
-
percent:
|
309
|
-
value:
|
303
|
+
focused: c(l) === "higher",
|
304
|
+
percent: t.value,
|
305
|
+
value: A.value
|
310
306
|
}, () => [
|
311
307
|
v(e.$slots, "thumb", {
|
312
|
-
focused: c(
|
313
|
-
percent:
|
314
|
-
value:
|
308
|
+
focused: c(l) === "higher",
|
309
|
+
percent: t.value,
|
310
|
+
value: A.value
|
315
311
|
})
|
316
312
|
])
|
317
313
|
], 6)
|
318
|
-
], 16,
|
314
|
+
], 16, he)
|
319
315
|
]),
|
320
316
|
v(e.$slots, "append")
|
321
317
|
], 16));
|
322
318
|
}
|
323
319
|
});
|
324
320
|
export {
|
325
|
-
|
321
|
+
$e as default
|
326
322
|
};
|