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.
Files changed (181) hide show
  1. package/dist/components/BaseSlider/BaseSlider.vue.d.ts +5 -0
  2. package/dist/index106.js +3 -3
  3. package/dist/index111.js +1 -1
  4. package/dist/index113.js +1 -1
  5. package/dist/index121.js +6 -6
  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 +10 -20
  11. package/dist/index137.js +2 -2
  12. package/dist/index138.js +1 -1
  13. package/dist/index139.js +2 -2
  14. package/dist/index15.js +8 -8
  15. package/dist/index17.js +3 -3
  16. package/dist/index206.js +2 -138
  17. package/dist/index207.js +2 -2
  18. package/dist/index208.js +138 -2
  19. package/dist/index209.js +1 -1
  20. package/dist/index21.js +15 -15
  21. package/dist/index211.js +1 -1
  22. package/dist/index213.js +3 -3
  23. package/dist/index214.js +1 -1
  24. package/dist/index215.js +1 -1
  25. package/dist/index216.js +1 -1
  26. package/dist/index218.js +66 -4
  27. package/dist/index220.js +13 -11
  28. package/dist/index221.js +174 -17
  29. package/dist/index222.js +2 -197
  30. package/dist/index224.js +31 -63
  31. package/dist/index225.js +6 -0
  32. package/dist/index226.js +2 -13
  33. package/dist/index227.js +9 -113
  34. package/dist/{index219.js → index228.js} +2 -2
  35. package/dist/index229.js +3 -34
  36. package/dist/index23.js +15 -15
  37. package/dist/index230.js +5 -2
  38. package/dist/index231.js +5 -2
  39. package/dist/index232.js +5 -18
  40. package/dist/index233.js +5 -12
  41. package/dist/index234.js +5 -6
  42. package/dist/index235.js +5 -4
  43. package/dist/index236.js +2 -106
  44. package/dist/index237.js +4 -0
  45. package/dist/index238.js +2 -100
  46. package/dist/index239.js +13 -0
  47. package/dist/index240.js +19 -227
  48. package/dist/index241.js +113 -3
  49. package/dist/index243.js +6 -2
  50. package/dist/index244.js +15 -12
  51. package/dist/index245.js +106 -5
  52. package/dist/index247.js +100 -5
  53. package/dist/index249.js +18 -5
  54. package/dist/index25.js +3 -3
  55. package/dist/index250.js +12 -5
  56. package/dist/index251.js +6 -2
  57. package/dist/index252.js +228 -2
  58. package/dist/index253.js +8 -175
  59. package/dist/index254.js +2 -9
  60. package/dist/index255.js +12 -2
  61. package/dist/index256.js +2 -5
  62. package/dist/index257.js +7 -5
  63. package/dist/index258.js +7 -8
  64. package/dist/index259.js +5 -250
  65. package/dist/index260.js +5 -52
  66. package/dist/index261.js +6 -42
  67. package/dist/index262.js +250 -5
  68. package/dist/index263.js +43 -51
  69. package/dist/index264.js +44 -2
  70. package/dist/index265.js +5 -9
  71. package/dist/index266.js +59 -7
  72. package/dist/index267.js +8 -8
  73. package/dist/index268.js +8 -23
  74. package/dist/index269.js +3 -9
  75. package/dist/index27.js +1 -1
  76. package/dist/index270.js +9 -3
  77. package/dist/index271.js +23 -6
  78. package/dist/index272.js +4 -16
  79. package/dist/index273.js +197 -2
  80. package/dist/index275.js +2 -5
  81. package/dist/index276.js +67 -5
  82. package/dist/index277.js +5 -8
  83. package/dist/index278.js +5 -3
  84. package/dist/index279.js +8 -17
  85. package/dist/index280.js +3 -28
  86. package/dist/index281.js +17 -3
  87. package/dist/index282.js +28 -3
  88. package/dist/index283.js +5 -0
  89. package/dist/index285.js +7 -3
  90. package/dist/index286.js +2 -7
  91. package/dist/index287.js +3 -10
  92. package/dist/index288.js +4 -4
  93. package/dist/index289.js +7 -2
  94. package/dist/index29.js +4 -4
  95. package/dist/index290.js +11 -3
  96. package/dist/index291.js +5 -3
  97. package/dist/index292.js +280 -2
  98. package/dist/index293.js +2 -4
  99. package/dist/index294.js +125 -5
  100. package/dist/index295.js +2 -280
  101. package/dist/index296.js +15 -2
  102. package/dist/index297.js +2 -125
  103. package/dist/index298.js +16 -2
  104. package/dist/index299.js +2 -15
  105. package/dist/index300.js +16 -2
  106. package/dist/index301.js +2 -16
  107. package/dist/index302.js +19 -2
  108. package/dist/index303.js +2 -16
  109. package/dist/index304.js +3 -2
  110. package/dist/index305.js +701 -19
  111. package/dist/index306.js +354 -2
  112. package/dist/index307.js +57 -5
  113. package/dist/index308.js +3 -19
  114. package/dist/index309.js +3 -2
  115. package/dist/index31.js +2 -2
  116. package/dist/index310.js +5 -26
  117. package/dist/index311.js +2 -2
  118. package/dist/index312.js +19 -2
  119. package/dist/index313.js +2 -2
  120. package/dist/index314.js +27 -2
  121. package/dist/index315.js +2 -2
  122. package/dist/index316.js +1 -21
  123. package/dist/index317.js +4 -0
  124. package/dist/index318.js +2 -5
  125. package/dist/index319.js +2 -701
  126. package/dist/index320.js +22 -354
  127. package/dist/index322.js +5 -8
  128. package/dist/index323.js +3 -6
  129. package/dist/index324.js +2 -8
  130. package/dist/index325.js +1 -1
  131. package/dist/index326.js +1 -1
  132. package/dist/index328.js +228 -2
  133. package/dist/index329.js +123 -222
  134. package/dist/index330.js +367 -56
  135. package/dist/index331.js +47 -58
  136. package/dist/index332.js +58 -47
  137. package/dist/index333.js +57 -128
  138. package/dist/index334.js +6 -368
  139. package/dist/index337.js +92 -6
  140. package/dist/index338.js +7 -92
  141. package/dist/index339.js +8 -0
  142. package/dist/index340.js +8 -3
  143. package/dist/index342.js +3 -482
  144. package/dist/index343.js +120 -427
  145. package/dist/index344.js +422 -113
  146. package/dist/index345.js +123 -43
  147. package/dist/index346.js +484 -0
  148. package/dist/index347.js +49 -0
  149. package/dist/index35.js +4 -4
  150. package/dist/index37.js +13 -13
  151. package/dist/index39.js +186 -168
  152. package/dist/index41.js +2 -2
  153. package/dist/index45.js +6 -6
  154. package/dist/index47.js +2 -2
  155. package/dist/index49.js +3 -3
  156. package/dist/index53.js +1 -1
  157. package/dist/index55.js +1 -1
  158. package/dist/index57.js +2 -2
  159. package/dist/index61.js +3 -3
  160. package/dist/index67.js +1 -1
  161. package/dist/index79.js +4 -4
  162. package/dist/index81.js +1 -1
  163. package/dist/index83.js +2 -2
  164. package/dist/index85.js +1 -1
  165. package/dist/index87.js +1 -1
  166. package/dist/index90.js +3 -3
  167. package/dist/index92.js +2 -2
  168. package/dist/index94.js +3 -3
  169. package/dist/index96.js +1 -1
  170. package/dist/utilities/functions/percentage.d.ts +14 -21
  171. package/dist/utilities/functions/snapToStep.d.ts +1 -0
  172. package/dist/utilities/functions/transpose.d.ts +1 -0
  173. package/dist/utilities/functions/transposePercent.d.ts +9 -0
  174. package/package.json +2 -2
  175. package/dist/index246.js +0 -7
  176. package/dist/index248.js +0 -7
  177. package/dist/index274.js +0 -69
  178. package/dist/index284.js +0 -9
  179. package/dist/index321.js +0 -60
  180. package/dist/index341.js +0 -131
  181. /package/dist/{index242.js → index223.js} +0 -0
@@ -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 "./index252.js";
3
- import { identity as $ } from "./index251.js";
4
- import { isCssColor as k } from "./index243.js";
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 "./index219.js";
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 "./index230.js";
10
- import { last as at } from "./index231.js";
11
- import { matchAnyKey as ne } from "./index232.js";
12
- import { useArray as ot } from "./index233.js";
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 "./index219.js";
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 "./index234.js";
23
- import { when as mt } from "./index235.js";
24
- import ft from "./index236.js";
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 "./index238.js";
26
+ import vt from "./index247.js";
27
27
  /* empty css */
28
- import yt from "./index224.js";
28
+ import yt from "./index218.js";
29
29
  /* empty css */
30
- import ht from "./index226.js";
31
- import bt from "./index227.js";
30
+ import ht from "./index220.js";
31
+ import bt from "./index241.js";
32
32
  /* empty css */
33
- import gt from "./index240.js";
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 U, ref as d, computed as h, onMounted as W, watch as Z, createElementBlock as g, openBlock as w, mergeProps as T, renderSlot as f, createElementVNode as c, createCommentVNode as H, Fragment as ee, renderList as ae, normalizeProps as re, guardReactiveProps as te, unref as b, normalizeStyle as F, normalizeClass as I } from "vue";
2
- import { clamp as le } from "./index207.js";
3
- import { head as O } from "./index264.js";
4
- import { isCssColor as Y } from "./index243.js";
5
- import { isNil as P } from "./index242.js";
6
- import { isNotNil as ne } from "./index140.js";
7
- import { transposeValue as y } from "./index136.js";
8
- import { hash as J } from "./index215.js";
9
- const oe = { class: "bb-base-slider__slider-container" }, ie = {
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
- }, se = ["id", "disabled", "name", "readonly", "required", "value"], ue = ["aria-describedby", "aria-readonly", "aria-valuemax", "aria-valuemin", "aria-valuenow", "tabindex"], de = ["aria-describedby", "aria-readonly", "aria-valuemax", "aria-valuemin", "aria-valuenow", "tabindex"], we = /* @__PURE__ */ U({
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: j }) {
34
- const a = K, u = j, C = d(), B = d(), _ = d(), v = d(), n = d(0), o = d(0), E = h(() => Array.isArray(a.modelValue) ? O(a.modelValue) ?? void 0 : P(a.modelValue) ? void 0 : Number(a.modelValue)), $ = h(() => Array.isArray(a.modelValue) ? O(a.modelValue) ?? void 0 : P(a.modelValue) ? void 0 : Number(a.modelValue)), L = h(() => [n.value, o.value].sort(
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
- )), p = y({
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
- W(() => {
47
+ le(() => {
47
48
  var e;
48
- a.autofocus && ((e = v.value) == null || e.focus());
49
- }), Z(
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
- const [s = a.min, m = a.min] = e;
55
- r = [s, m];
56
- } else
57
- r = [a.min, ne(e) ? Number(e) : a.min];
58
- const [l, i] = r.map((s) => {
59
- let m = P(s) ? a.min : Number(s);
60
- return y({
61
- value: m,
62
- targetBounds: { min: 0, max: 100 },
63
- originalBounds: { min: a.min, max: a.max },
64
- step: 1
65
- });
66
- });
67
- n.value = l, o.value = i;
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
- let A = d(!1), t = d(null);
72
- const S = (e) => {
73
- if (v.value && v.value.contains(e.target))
74
- return "higher";
75
- if (_.value && _.value.contains(e.target))
76
- return "lower";
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
- ) : t.value === "lower" && (n.value = Math.min(
119
- n.value + p,
120
- o.value
121
- ))), u("update:modelValue", k()));
122
- }, q = (e) => {
123
- u("focus", e);
124
- const r = S(e);
125
- r && (t.value = r), x.value || (x.value = !0, u("active"), document.addEventListener("focusin", V), document.addEventListener("click", V));
126
- }, V = (e) => {
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) || (x.value = !1, t.value = null, u("inactive"), document.removeEventListener("focusin", V), document.removeEventListener("click", V)));
129
- }, D = {
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 l;
166
+ var t;
139
167
  if (a.range) return;
140
- (l = v.value) == null || l.focus(), N(e);
141
- const r = k();
142
- J(r) !== J(a.modelValue) && u("update:modelValue", k());
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) && (D.style["--color"] = a.color);
147
- const Q = h(() => {
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: `${L.value[1] - L.value[0]}%`,
150
- left: `${L.value[0]}%`
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
- }), R = h(() => {
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 l = r, i = y({
161
- value: l,
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: l,
191
+ value: t,
174
192
  percent: i,
175
- active: m
193
+ active: h
176
194
  }), r += a.step;
177
195
  }
178
196
  return e;
179
197
  });
180
- return (e, r) => (w(), g("span", T(D, {
198
+ return (e, r) => (g(), y("span", L(q, {
181
199
  ref_key: "container",
182
200
  ref: C
183
201
  }), [
184
- f(e.$slots, "prepend"),
185
- c("span", oe, [
186
- R.value.length ? (w(), g("span", ie, [
187
- (w(!0), g(ee, null, ae(R.value, (l) => (w(), g("span", {
188
- key: l.value,
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
- f(e.$slots, "tick", {
192
- active: l.active,
193
- percent: l.percent,
194
- value: l.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
- c("input", {
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, se),
209
- c("span", {
226
+ }, null, 8, pe),
227
+ m("span", {
210
228
  ref_key: "track",
211
- ref: B,
229
+ ref: V,
212
230
  class: "bb-base-slider__track-container"
213
231
  }, [
214
- r[0] || (r[0] = c("span", { class: "bb-base-slider__track-fill" }, null, -1)),
215
- c("span", re(te(Q.value)), null, 16)
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 ? (w(), g("span", T({ key: 1 }, b(M), {
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: q,
233
- onKeydown: X
250
+ onFocus: X,
251
+ onKeydown: R
234
252
  }), [
235
- c("span", {
236
- class: I({
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": b(t) === "lower"
257
+ "bb-base-slider__thumb--focused": c(o) === "lower"
240
258
  }),
241
- style: F({
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
- f(e.$slots, "thumb:lower", {
247
- focused: b(t) === "lower",
264
+ v(e.$slots, "thumb:lower", {
265
+ focused: c(o) === "lower",
248
266
  percent: n.value,
249
267
  value: E.value
250
268
  }, () => [
251
- f(e.$slots, "thumb", {
252
- focused: b(t) === "lower",
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, ue)) : H("", !0),
259
- c("span", T(b(M), {
276
+ ], 16, he)) : H("", !0),
277
+ m("span", L(c(I), {
260
278
  key: "thumbhigher",
261
279
  ref_key: "thumbhigher",
262
- ref: v,
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": $.value,
286
+ "aria-valuenow": _.value,
269
287
  class: "bb-base-slider__thumb-container",
270
288
  "data-thumb": "higher",
271
289
  role: "slider",
272
- style: { left: `${o.value}%` },
290
+ style: { left: `${l.value}%` },
273
291
  tabindex: e.disabled ? -1 : 0,
274
- onFocus: q,
275
- onKeydown: X
292
+ onFocus: X,
293
+ onKeydown: R
276
294
  }), [
277
- c("span", {
278
- class: I({
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": b(t) === "higher"
299
+ "bb-base-slider__thumb--focused": c(o) === "higher"
282
300
  }),
283
- style: F({
284
- transform: `translateY(-50%) ${e.thumbTranslate ? `translateX(-${o.value}%)` : "translateX(-50%)"}`,
285
- left: `${o.value}%`
301
+ style: G({
302
+ transform: `translateY(-50%) ${e.thumbTranslate ? `translateX(-${l.value}%)` : "translateX(-50%)"}`,
303
+ left: `${l.value}%`
286
304
  })
287
305
  }, [
288
- f(e.$slots, "thumb:higher", {
289
- focused: b(t) === "higher",
290
- percent: o.value,
291
- value: $.value
306
+ v(e.$slots, "thumb:higher", {
307
+ focused: c(o) === "higher",
308
+ percent: l.value,
309
+ value: _.value
292
310
  }, () => [
293
- f(e.$slots, "thumb", {
294
- focused: b(t) === "higher",
295
- percent: o.value,
296
- value: $.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, de)
318
+ ], 16, ye)
301
319
  ]),
302
- f(e.$slots, "append")
320
+ v(e.$slots, "append")
303
321
  ], 16));
304
322
  }
305
323
  });
306
324
  export {
307
- we as default
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 "./index243.js";
3
- import { when as N } from "./index235.js";
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 "./index231.js";
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 "./index236.js";
9
+ import ie from "./index245.js";
10
10
  /* empty css */
11
- import ue from "./index238.js";
11
+ import ue from "./index247.js";
12
12
  /* empty css */
13
- import se from "./index224.js";
13
+ import se from "./index218.js";
14
14
  /* empty css */
15
- import de from "./index226.js";
16
- import { isEmpty as pe } from "./index230.js";
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 "./index226.js";
3
- import G from "./index224.js";
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 "./index224.js";
2
+ import E from "./index218.js";
3
3
  /* empty css */
4
- import I from "./index226.js";
4
+ import I from "./index220.js";
5
5
  import { isNotNil as N } from "./index140.js";
6
- import { MaskInput as z } from "./index253.js";
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: {