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