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.
Files changed (181) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index106.js +9 -9
  3. package/dist/index111.js +1 -1
  4. package/dist/index113.js +1 -1
  5. package/dist/index121.js +12 -12
  6. package/dist/index129.js +1 -1
  7. package/dist/index13.js +1 -1
  8. package/dist/index131.js +4 -4
  9. package/dist/index133.js +1 -1
  10. package/dist/index136.js +1 -1
  11. package/dist/index138.js +1 -1
  12. package/dist/index139.js +2 -2
  13. package/dist/index15.js +8 -8
  14. package/dist/index17.js +3 -3
  15. package/dist/index19.js +8 -8
  16. package/dist/index207.js +2 -2
  17. package/dist/index208.js +2 -2
  18. package/dist/index209.js +4 -2
  19. package/dist/index21.js +16 -16
  20. package/dist/index210.js +13 -4
  21. package/dist/index211.js +11 -2
  22. package/dist/index212.js +20 -5
  23. package/dist/index213.js +197 -5
  24. package/dist/index215.js +72 -5
  25. package/dist/index217.js +13 -5
  26. package/dist/index218.js +114 -2
  27. package/dist/index220.js +5 -2
  28. package/dist/index221.js +5 -13
  29. package/dist/index222.js +5 -11
  30. package/dist/index223.js +5 -20
  31. package/dist/index224.js +5 -72
  32. package/dist/index225.js +7 -0
  33. package/dist/index226.js +5 -13
  34. package/dist/index227.js +3 -114
  35. package/dist/index228.js +4 -0
  36. package/dist/index229.js +6 -84
  37. package/dist/index23.js +15 -15
  38. package/dist/index230.js +252 -0
  39. package/dist/index231.js +51 -28
  40. package/dist/index232.js +44 -16
  41. package/dist/index233.js +5 -17
  42. package/dist/index234.js +59 -50
  43. package/dist/index235.js +34 -15
  44. package/dist/index236.js +86 -3
  45. package/dist/index238.js +28 -33
  46. package/dist/index239.js +16 -2
  47. package/dist/index240.js +17 -2
  48. package/dist/index241.js +50 -6
  49. package/dist/index242.js +15 -7
  50. package/dist/index243.js +11 -182
  51. package/dist/index244.js +2 -106
  52. package/dist/index245.js +4 -0
  53. package/dist/index246.js +2 -100
  54. package/dist/index247.js +108 -0
  55. package/dist/index249.js +95 -192
  56. package/dist/index25.js +3 -3
  57. package/dist/index251.js +2 -3
  58. package/dist/index252.js +4 -5
  59. package/dist/index253.js +5 -5
  60. package/dist/index254.js +17 -7
  61. package/dist/index255.js +12 -250
  62. package/dist/index256.js +5 -51
  63. package/dist/index257.js +224 -39
  64. package/dist/index258.js +2 -5
  65. package/dist/index259.js +2 -60
  66. package/dist/index260.js +6 -12
  67. package/dist/index261.js +7 -18
  68. package/dist/index262.js +182 -11
  69. package/dist/index263.js +3 -6
  70. package/dist/index264.js +12 -228
  71. package/dist/index265.js +6 -10
  72. package/dist/index266.js +16 -3
  73. package/dist/index267.js +9 -6
  74. package/dist/index268.js +23 -16
  75. package/dist/index269.js +10 -9
  76. package/dist/index27.js +1 -1
  77. package/dist/index270.js +2 -8
  78. package/dist/index271.js +3 -23
  79. package/dist/index272.js +9 -3
  80. package/dist/index273.js +9 -2
  81. package/dist/index274.js +8 -9
  82. package/dist/index275.js +2 -8
  83. package/dist/index276.js +5 -67
  84. package/dist/index277.js +67 -5
  85. package/dist/index278.js +4 -7
  86. package/dist/index279.js +8 -5
  87. package/dist/index280.js +3 -4
  88. package/dist/index281.js +3 -280
  89. package/dist/index283.js +7 -125
  90. package/dist/index284.js +3 -2
  91. package/dist/index285.js +7 -15
  92. package/dist/index286.js +11 -2
  93. package/dist/index287.js +2 -16
  94. package/dist/index288.js +280 -2
  95. package/dist/index289.js +2 -16
  96. package/dist/index29.js +4 -4
  97. package/dist/index290.js +16 -2
  98. package/dist/index291.js +2 -19
  99. package/dist/index292.js +16 -2
  100. package/dist/index293.js +2 -3
  101. package/dist/index294.js +21 -0
  102. package/dist/index295.js +2 -7
  103. package/dist/index296.js +15 -3
  104. package/dist/index297.js +2 -7
  105. package/dist/index298.js +18 -10
  106. package/dist/index299.js +2 -4
  107. package/dist/index300.js +27 -3
  108. package/dist/index301.js +2 -17
  109. package/dist/index302.js +2 -28
  110. package/dist/index303.js +2 -6
  111. package/dist/index304.js +1 -1
  112. package/dist/index305.js +2 -3
  113. package/dist/index306.js +28 -3
  114. package/dist/index307.js +22 -3
  115. package/dist/index309.js +3 -18
  116. package/dist/index31.js +2 -2
  117. package/dist/index310.js +3 -2
  118. package/dist/index311.js +17 -27
  119. package/dist/index312.js +6 -2
  120. package/dist/index313.js +3 -2
  121. package/dist/index314.js +3 -2
  122. package/dist/index315.js +4 -2
  123. package/dist/index316.js +125 -2
  124. package/dist/index317.js +2 -22
  125. package/dist/index318.js +4 -0
  126. package/dist/index319.js +5 -2
  127. package/dist/index323.js +1 -1
  128. package/dist/index324.js +7 -2
  129. package/dist/index325.js +7 -32
  130. package/dist/index326.js +6 -28
  131. package/dist/index327.js +10 -0
  132. package/dist/index328.js +123 -222
  133. package/dist/index329.js +367 -56
  134. package/dist/index33.js +8 -8
  135. package/dist/index330.js +32 -57
  136. package/dist/index331.js +28 -8
  137. package/dist/index333.js +7 -8
  138. package/dist/index334.js +17 -45
  139. package/dist/index335.js +58 -7
  140. package/dist/index336.js +57 -128
  141. package/dist/index337.js +2 -369
  142. package/dist/index338.js +46 -6
  143. package/dist/index339.js +226 -17
  144. package/dist/index340.js +1 -1
  145. package/dist/index342.js +436 -3
  146. package/dist/index343.js +123 -484
  147. package/dist/index345.js +3 -50
  148. package/dist/index346.js +473 -421
  149. package/dist/index347.js +48 -125
  150. package/dist/index35.js +4 -4
  151. package/dist/index37.js +20 -20
  152. package/dist/index39.js +100 -104
  153. package/dist/index41.js +2 -2
  154. package/dist/index43.js +8 -8
  155. package/dist/index45.js +8 -8
  156. package/dist/index47.js +2 -2
  157. package/dist/index49.js +3 -3
  158. package/dist/index53.js +1 -1
  159. package/dist/index55.js +1 -1
  160. package/dist/index57.js +2 -2
  161. package/dist/index61.js +3 -3
  162. package/dist/index67.js +1 -1
  163. package/dist/index79.js +4 -4
  164. package/dist/index81.js +1 -1
  165. package/dist/index83.js +2 -2
  166. package/dist/index85.js +1 -1
  167. package/dist/index87.js +1 -1
  168. package/dist/index90.js +3 -3
  169. package/dist/index92.js +2 -2
  170. package/dist/index94.js +3 -3
  171. package/dist/index96.js +1 -1
  172. package/package.json +1 -1
  173. package/dist/index214.js +0 -7
  174. package/dist/index216.js +0 -7
  175. package/dist/index219.js +0 -4
  176. package/dist/index237.js +0 -14
  177. package/dist/index248.js +0 -6
  178. package/dist/index282.js +0 -4
  179. package/dist/index308.js +0 -7
  180. package/dist/index332.js +0 -8
  181. /package/dist/{index344.js → index341.js} +0 -0
package/dist/index347.js CHANGED
@@ -1,129 +1,52 @@
1
- const P = ["top", "right", "bottom", "left"], l = Math.min, m = Math.max, M = Math.round, O = Math.floor, S = (t) => ({
2
- x: t,
3
- y: t
4
- }), p = {
5
- left: "right",
6
- right: "left",
7
- bottom: "top",
8
- top: "bottom"
9
- }, a = {
10
- start: "end",
11
- end: "start"
12
- };
13
- function w(t, n, e) {
14
- return m(t, l(n, e));
15
- }
16
- function j(t, n) {
17
- return typeof t == "function" ? t(n) : t;
18
- }
19
- function u(t) {
20
- return t.split("-")[0];
21
- }
22
- function g(t) {
23
- return t.split("-")[1];
24
- }
25
- function h(t) {
26
- return t === "x" ? "y" : "x";
27
- }
28
- function b(t) {
29
- return t === "y" ? "height" : "width";
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
- function E(t, n, e, r) {
64
- const o = g(t);
65
- let i = A(u(t), e === "start", r);
66
- return o && (i = i.map((c) => c + "-" + o), n && (i = i.concat(i.map(s)))), i;
67
- }
68
- function f(t) {
69
- return t.replace(/left|right|bottom|top/g, (n) => p[n]);
70
- }
71
- function y(t) {
72
- return {
73
- top: 0,
74
- right: 0,
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
- w as clamp,
108
- S as createCoords,
109
- j as evaluate,
110
- y as expandPaddingObject,
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 "./index211.js";
3
- import { identity as $ } from "./index218.js";
4
- import { isCssColor as k } from "./index209.js";
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 "./index221.js";
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 "./index236.js";
9
- import { isEmpty as nt } from "./index219.js";
10
- import { last as ut } from "./index220.js";
11
- import { matchAnyKey as ie } from "./index261.js";
12
- import { useArray as st } from "./index262.js";
13
- import { useBaseOptions as it } from "./index234.js";
14
- import { useCoherence as rt } from "./index235.js";
15
- import { useHashedWatcher as re } from "./index237.js";
16
- import { useIndexById as de } from "./index233.js";
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 "./index231.js";
19
- import { useLocale as mt } from "./index221.js";
20
- import { usePrefill as ft } from "./index232.js";
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 "./index263.js";
23
- import { when as ht } from "./index210.js";
24
- import yt from "./index244.js";
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 "./index246.js";
26
+ import bt from "./index249.js";
27
27
  /* empty css */
28
- import gt from "./index224.js";
28
+ import gt from "./index215.js";
29
29
  /* empty css */
30
- import wt from "./index226.js";
31
- import Bt from "./index227.js";
30
+ import wt from "./index217.js";
31
+ import Bt from "./index218.js";
32
32
  /* empty css */
33
- import Vt from "./index264.js";
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 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 "./index239.js";
3
- import { isCssColor as Y } from "./index209.js";
4
- import { isNil as S } from "./index240.js";
5
- import { getAsPercentageBetween as T, getAsPercentage as me, getValueFromPercentageInInterval as x } from "./index136.js";
6
- import { hash as j } from "./index236.js";
7
- import { snapToStep as ce } from "./index241.js";
8
- import { last as be } from "./index220.js";
9
- import { transpose as J } from "./index242.js";
10
- import { clamp as f } from "./index207.js";
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
- }, 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
+ }, 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(K, { emit: Q }) {
37
- const a = K, s = Q;
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), 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(
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
- le(() => {
46
+ te(() => {
48
47
  var e;
49
48
  a.autofocus && ((e = u.value) == null || e.focus());
50
49
  });
51
- let P = d(!1), o = d(null);
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
- }, 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));
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(() => P.value ? {} : { onPointerdown: U });
62
- const B = (e) => {
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(), t = e.clientX, i = r.left, h = r.width;
66
- let ee = J(
67
- t,
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 ae = ce(
74
- ee,
72
+ const ee = me(
73
+ Z,
75
74
  a.min,
76
75
  a.max,
77
76
  a.step
78
- ), re = T(
79
- ae,
77
+ ), ae = x(
78
+ ee,
80
79
  a.min,
81
80
  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());
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
- }, N = () => {
84
+ }, z = () => {
86
85
  if (a.range)
87
86
  return [
88
- x(
87
+ T(
89
88
  n.value,
90
89
  a.min,
91
90
  a.max
92
91
  ),
93
- x(
94
- l.value,
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 = x(
101
- l.value,
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
- oe(
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, l.value = 100;
114
+ n.value = 0, t.value = 100;
116
115
  return;
117
116
  }
118
- const t = [...e].sort((i, h) => i - h).map(
119
- (i) => f(T(i, a.min, a.max), 0, 100)
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 > l.value ? (n.value = t[1], l.value = t[0]) : (n.value = t[0], l.value = t[1]);
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 t = J(r, a.min, a.max, 0, 100), i = f(t, 0, 100);
125
- l.value = i;
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 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,
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
- ) : (o.value === "lower" || document.activeElement === b.value || e.target === b.value) && (n.value = f(
138
- n.value - w,
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" && (o.value === "higher" || document.activeElement === u.value || e.target === u.value ? l.value = f(
142
- l.value + w,
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
- ) : (o.value === "lower" || document.activeElement === b.value || e.target === b.value) && (n.value = f(
146
- n.value + w,
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", N()));
148
+ ))), s("update:modelValue", z()));
150
149
  }, X = (e) => {
151
150
  s("focus", e);
152
151
  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) => {
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, o.value = null, s("inactive"), document.removeEventListener("focusin", k), document.removeEventListener("click", k)));
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
- onClick: (e) => {
166
- var t;
167
- if (a.range) return;
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 W = p(() => {
171
+ const U = p(() => {
176
172
  const e = "bb-base-slider__track-background", r = {
177
- width: `${A.value[1] - A.value[0]}%`,
178
- left: `${A.value[0]}%`
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
- }), 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(() => {
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 t = r;
189
- const i = T(t, a.min, a.max), h = Z(t);
184
+ let o = r;
185
+ const i = x(o, a.min, a.max), h = W(o);
190
186
  e.push({
191
- value: t,
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", L(q, {
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", 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,
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: t.active,
211
- percent: t.percent,
212
- value: t.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: e.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, pe),
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(ue(W.value)), null, 16)
229
+ m("span", se(ie(U.value)), null, 16)
234
230
  ], 512),
235
- a.range ? (g(), y("span", L({ key: 1 }, c(I), {
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": E.value,
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(o) === "lower"
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(o) === "lower",
261
+ focused: c(l) === "lower",
266
262
  percent: n.value,
267
- value: E.value
263
+ value: _.value
268
264
  }, () => [
269
265
  v(e.$slots, "thumb", {
270
- focused: c(o) === "lower",
266
+ focused: c(l) === "lower",
271
267
  percent: n.value,
272
- value: E.value
268
+ value: _.value
273
269
  })
274
270
  ])
275
271
  ], 6)
276
- ], 16, he)) : H("", !0),
277
- m("span", L(c(I), {
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": _.value,
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: `${l.value}%` },
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(o) === "higher"
295
+ "bb-base-slider__thumb--focused": c(l) === "higher"
300
296
  }),
301
297
  style: G({
302
- transform: `translateY(-50%) ${e.thumbTranslate ? `translateX(-${l.value}%)` : "translateX(-50%)"}`,
303
- left: `${l.value}%`
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(o) === "higher",
308
- percent: l.value,
309
- value: _.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(o) === "higher",
313
- percent: l.value,
314
- value: _.value
308
+ focused: c(l) === "higher",
309
+ percent: t.value,
310
+ value: A.value
315
311
  })
316
312
  ])
317
313
  ], 6)
318
- ], 16, ye)
314
+ ], 16, he)
319
315
  ]),
320
316
  v(e.$slots, "append")
321
317
  ], 16));
322
318
  }
323
319
  });
324
320
  export {
325
- Ne as default
321
+ $e as default
326
322
  };