bitboss-ui 0.2.53 → 0.2.55

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 (116) hide show
  1. package/dist/index101.js +1 -1
  2. package/dist/index109.js +1 -1
  3. package/dist/index11.js +2 -2
  4. package/dist/index111.js +3 -3
  5. package/dist/index113.js +1 -1
  6. package/dist/index116.js +1 -1
  7. package/dist/index117.js +1 -1
  8. package/dist/index118.js +1 -1
  9. package/dist/index119.js +1 -1
  10. package/dist/index125.js +1 -1
  11. package/dist/index126.js +1 -1
  12. package/dist/index127.js +1 -1
  13. package/dist/index131.js +2 -2
  14. package/dist/index15.js +8 -8
  15. package/dist/index17.js +9 -9
  16. package/dist/index19.js +3 -3
  17. package/dist/index197.js +233 -8
  18. package/dist/index197.js.map +1 -1
  19. package/dist/index198.js +10 -5
  20. package/dist/index198.js.map +1 -1
  21. package/dist/index199.js +2 -16
  22. package/dist/index199.js.map +1 -1
  23. package/dist/index200.js +4 -16
  24. package/dist/index200.js.map +1 -1
  25. package/dist/index201.js +366 -17
  26. package/dist/index201.js.map +1 -1
  27. package/dist/index202.js +131 -17
  28. package/dist/index202.js.map +1 -1
  29. package/dist/index203.js +5 -29
  30. package/dist/index203.js.map +1 -1
  31. package/dist/index204.js +19 -8
  32. package/dist/index204.js.map +1 -1
  33. package/dist/index205.js +2 -2
  34. package/dist/index205.js.map +1 -1
  35. package/dist/index206.js +2 -2
  36. package/dist/index206.js.map +1 -1
  37. package/dist/index207.js +174 -3
  38. package/dist/index207.js.map +1 -1
  39. package/dist/index208.js +23 -35
  40. package/dist/index208.js.map +1 -1
  41. package/dist/index209.js +373 -6
  42. package/dist/index209.js.map +1 -1
  43. package/dist/index210.js +1 -1
  44. package/dist/index211.js +1 -1
  45. package/dist/index212.js +2 -368
  46. package/dist/index212.js.map +1 -1
  47. package/dist/index213.js +13 -131
  48. package/dist/index213.js.map +1 -1
  49. package/dist/index214.js +16 -2
  50. package/dist/index214.js.map +1 -1
  51. package/dist/index215.js +18 -172
  52. package/dist/index215.js.map +1 -1
  53. package/dist/index216.js +29 -23
  54. package/dist/index216.js.map +1 -1
  55. package/dist/index217.js +8 -373
  56. package/dist/index217.js.map +1 -1
  57. package/dist/index218.js +3 -235
  58. package/dist/index218.js.map +1 -1
  59. package/dist/index219.js +35 -4
  60. package/dist/index219.js.map +1 -1
  61. package/dist/index220.js +6 -2
  62. package/dist/index220.js.map +1 -1
  63. package/dist/index223.js +4 -4
  64. package/dist/index226.js +1 -1
  65. package/dist/index230.js +69 -295
  66. package/dist/index230.js.map +1 -1
  67. package/dist/index231.js +5 -6
  68. package/dist/index231.js.map +1 -1
  69. package/dist/index232.js +4 -2
  70. package/dist/index232.js.map +1 -1
  71. package/dist/index233.js +6 -2
  72. package/dist/index233.js.map +1 -1
  73. package/dist/index234.js +2 -2
  74. package/dist/index235.js +295 -2
  75. package/dist/index235.js.map +1 -1
  76. package/dist/index236.js +2 -2
  77. package/dist/index238.js +110 -428
  78. package/dist/index238.js.map +1 -1
  79. package/dist/index239.js +105 -88
  80. package/dist/index239.js.map +1 -1
  81. package/dist/index240.js +224 -69
  82. package/dist/index240.js.map +1 -1
  83. package/dist/index241.js +53 -19
  84. package/dist/index241.js.map +1 -1
  85. package/dist/index242.js +2 -258
  86. package/dist/index242.js.map +1 -1
  87. package/dist/index243.js +15 -200
  88. package/dist/index243.js.map +1 -1
  89. package/dist/index244.js +2 -2
  90. package/dist/index245.js +2 -117
  91. package/dist/index245.js.map +1 -1
  92. package/dist/index246.js +2 -106
  93. package/dist/index246.js.map +1 -1
  94. package/dist/index247.js +2 -5
  95. package/dist/index247.js.map +1 -1
  96. package/dist/index248.js +434 -3
  97. package/dist/index248.js.map +1 -1
  98. package/dist/index249.js +86 -12
  99. package/dist/index249.js.map +1 -1
  100. package/dist/index25.js +2 -2
  101. package/dist/index250.js +200 -2
  102. package/dist/index250.js.map +1 -1
  103. package/dist/index255.js +1 -1
  104. package/dist/index29.js +2 -2
  105. package/dist/index31.js +168 -168
  106. package/dist/index31.js.map +1 -1
  107. package/dist/index33.js +1 -1
  108. package/dist/index35.js +2 -2
  109. package/dist/index47.js +1 -1
  110. package/dist/index49.js +1 -1
  111. package/dist/index65.js +3 -3
  112. package/dist/index72.js +1 -1
  113. package/dist/index75.js +1 -1
  114. package/dist/index79.js +3 -3
  115. package/dist/style.css +1 -1
  116. package/package.json +1 -1
package/dist/index31.js CHANGED
@@ -1,18 +1,18 @@
1
- import { defineComponent as Ne, ref as v, computed as g, onMounted as $e, onBeforeUnmount as De, watch as X, openBlock as b, createElementBlock as y, normalizeClass as B, renderSlot as h, createElementVNode as w, Fragment as L, renderList as j, toDisplayString as F, createBlock as ie, withModifiers as E, withCtx as Le, createTextVNode as ee, createCommentVNode as oe, withDirectives as Fe, vModelDynamic as Ae, Teleport as Je, normalizeStyle as Me, createVNode as qe, mergeProps as ze, nextTick as le } from "vue";
2
- import He from "./index115.js";
1
+ import { defineComponent as Ie, ref as f, computed as g, onMounted as Ne, onBeforeUnmount as $e, watch as X, openBlock as p, createElementBlock as h, normalizeClass as B, renderSlot as b, createElementVNode as w, Fragment as L, renderList as j, toDisplayString as F, createBlock as se, withModifiers as E, withCtx as De, createTextVNode as ee, createCommentVNode as ie, withDirectives as Le, vModelDynamic as Fe, Teleport as Ae, normalizeStyle as Je, createVNode as Me, mergeProps as qe, nextTick as le } from "vue";
2
+ import ze from "./index115.js";
3
3
  import "./index158.js";
4
- import Pe from "./index119.js";
4
+ import He from "./index119.js";
5
5
  import "./index185.js";
6
- import { autoUpdate as je, computePosition as Qe, flip as Ue, shift as We } from "./index212.js";
7
- import { deepEqual as re } from "./index123.js";
8
- import { head as te } from "./index220.js";
6
+ import { autoUpdate as Pe, computePosition as je, flip as Qe, shift as Ue } from "./index201.js";
7
+ import { deepEqual as oe } from "./index123.js";
8
+ import { head as We } from "./index212.js";
9
9
  import { isNotNil as I } from "./index124.js";
10
- import { last as Re } from "./index205.js";
10
+ import { last as Re } from "./index206.js";
11
11
  import { useItemText as Ke } from "./index125.js";
12
12
  import { useItemValue as Ye } from "./index126.js";
13
13
  import { wait as q } from "./index122.js";
14
- import { when as Ze } from "./index219.js";
15
- import { offset as Ge } from "./index217.js";
14
+ import { when as Ze } from "./index200.js";
15
+ import { offset as Ge } from "./index209.js";
16
16
  const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomplete", "autofocus", "disabled", "placeholder", "readonly"], ll = {
17
17
  key: 0,
18
18
  class: "bb-base-select__loading-container"
@@ -30,7 +30,7 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
30
30
  fill: "currentColor",
31
31
  "fill-rule": "evenodd"
32
32
  })
33
- ], -1), kl = /* @__PURE__ */ Ne({
33
+ ], -1), kl = /* @__PURE__ */ Ie({
34
34
  __name: "BaseSelect",
35
35
  props: {
36
36
  allowWriting: { type: Boolean, default: !0 },
@@ -66,17 +66,17 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
66
66
  updateOnAnimationFrame: { type: Boolean, default: !1 }
67
67
  },
68
68
  emits: ["blur", "change", "click", "focus", "inactive", "input", "update:modelValue"],
69
- setup(ce, { emit: de }) {
70
- const l = ce, f = de;
69
+ setup(re, { emit: ce }) {
70
+ const l = re, d = ce;
71
71
  if (l.multiple && !Array.isArray(l.modelValue))
72
72
  throw new Error('Multiple is set to "true" but modelValue is not an array.');
73
- const T = v(null), N = v(null), c = v(null), S = v(null), u = v(""), fe = g(() => o.value.length ? "" : l.placeholder), d = v(0), ve = l.transitionDuration / 1e3 + "s";
74
- let ae;
75
- $e(async () => {
76
- N.value && c.value && (ae = je(
73
+ const _ = f(null), N = f(null), r = f(null), O = f(null), u = f(""), de = g(() => o.value.length ? "" : l.placeholder), c = f(0), fe = l.transitionDuration / 1e3 + "s";
74
+ let te;
75
+ Ne(async () => {
76
+ N.value && r.value && (te = Pe(
77
77
  N.value,
78
- c.value,
79
- ge,
78
+ r.value,
79
+ ye,
80
80
  {
81
81
  ancestorResize: !0,
82
82
  ancestorScroll: !0,
@@ -84,11 +84,11 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
84
84
  elementResize: !0
85
85
  }
86
86
  ));
87
- }), De(() => {
88
- ae();
87
+ }), $e(() => {
88
+ te();
89
89
  });
90
- const ne = v([]), m = v([]), V = v([]), { getItemText: me } = Ke(), { getItemValue: pe } = Ye(), be = g(() => ne.value.map((e) => {
91
- const a = me(e, l.itemText), t = pe(e, l.itemValue);
90
+ const ae = f([]), v = f([]), V = f([]), { getItemText: ve } = Ke(), { getItemValue: me } = Ye(), pe = g(() => ae.value.map((e) => {
91
+ const a = ve(e, l.itemText), t = me(e, l.itemValue);
92
92
  if (t === void 0)
93
93
  throw new Error(
94
94
  'The result of extracting "value" from option was undefined. Affected item is ' + JSON.stringify(e) + " please check itemValue property is correct."
@@ -103,30 +103,30 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
103
103
  text: a,
104
104
  value: t
105
105
  };
106
- })), C = g(() => {
107
- let e = be.value.reduce(
106
+ })), T = g(() => {
107
+ let e = pe.value.reduce(
108
108
  (n, s) => (n[s.id] = s, n),
109
109
  {}
110
110
  );
111
111
  const a = V.value.reduce(
112
112
  (n, s) => (n[s.id] || (n[s.id] = s), n),
113
113
  e
114
- ), t = m.value.reduce(
114
+ ), t = v.value.reduce(
115
115
  (n, s) => (n[s.id] || (n[s.id] = s), n),
116
116
  a
117
117
  );
118
118
  return Object.values(t).map(
119
119
  (n, s) => ({
120
120
  ...n,
121
- selected: I(he.value.get(n.value)),
121
+ selected: I(be.value.get(n.value)),
122
122
  index: s
123
123
  })
124
124
  );
125
- }), k = g(() => {
125
+ }), S = g(() => {
126
126
  let e = [];
127
127
  return u.value && !o.value.some(
128
128
  (a) => a.text === u.value
129
- ) ? e = C.value.filter((a) => {
129
+ ) ? e = T.value.filter((a) => {
130
130
  let t = !1;
131
131
  if (l.filterBy) {
132
132
  if (typeof l.filterBy == "function")
@@ -141,21 +141,21 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
141
141
  } else
142
142
  return !0;
143
143
  return t || a.text.toLowerCase().includes(u.value.toLowerCase());
144
- }) : e = C.value, e.map((a, t) => ({
144
+ }) : e = T.value, e.map((a, t) => ({
145
145
  ...a,
146
- focused: O.value === t
146
+ focused: k.value === t
147
147
  }));
148
148
  }), z = g(
149
- () => C.value.reduce(
149
+ () => T.value.reduce(
150
150
  (e, a) => ({
151
151
  ...e,
152
152
  [a.id]: a
153
153
  }),
154
154
  {}
155
155
  )
156
- ), p = g(() => {
156
+ ), m = g(() => {
157
157
  if (l.matchStrategy === "string") {
158
- let e = C.value.reduce(
158
+ let e = T.value.reduce(
159
159
  (a, t) => (a[t.jsonValue] = t, a),
160
160
  {}
161
161
  );
@@ -163,19 +163,19 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
163
163
  get: (a) => e[JSON.stringify(a)]
164
164
  };
165
165
  } else if (l.matchStrategy === "equality") {
166
- let e = C.value.map((a) => [
166
+ let e = T.value.map((a) => [
167
167
  a.value,
168
168
  a
169
169
  ]);
170
170
  return {
171
171
  get: (a) => {
172
172
  var t;
173
- return (t = e.find((n) => re(n[0], a))) == null ? void 0 : t[1];
173
+ return (t = e.find((n) => oe(n[0], a))) == null ? void 0 : t[1];
174
174
  }
175
175
  };
176
176
  } else
177
177
  throw new Error("No match strategy has been defined");
178
- }), he = g(() => {
178
+ }), be = g(() => {
179
179
  if (l.matchStrategy === "string") {
180
180
  let e = {};
181
181
  return [].concat(l.modelValue).forEach((a, t) => {
@@ -188,27 +188,27 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
188
188
  return {
189
189
  get: (a) => {
190
190
  var t;
191
- return (t = e.find((n) => re(n[0], a))) == null ? void 0 : t[1];
191
+ return (t = e.find((n) => oe(n[0], a))) == null ? void 0 : t[1];
192
192
  }
193
193
  };
194
194
  } else
195
195
  throw new Error("No match strategy has been defined");
196
196
  }), o = g(() => [].concat(l.modelValue).reduce((e, a) => {
197
- const t = p.value.get(a);
197
+ const t = m.value.get(a);
198
198
  return t && e.push(t), e;
199
199
  }, [])), A = (e) => {
200
200
  let a;
201
- r.value = e.index, l.multiple ? (e.selected ? (e.manual && (V.value = V.value.filter(
201
+ l.multiple ? (e.selected ? (e.manual && (V.value = V.value.filter(
202
202
  (t) => t.id !== e.id
203
203
  )), a = l.modelValue.filter(
204
204
  (t) => JSON.stringify(t) !== e.jsonValue
205
- ), l.stash && (m.value = m.value.filter((t) => t.id !== e.id))) : (a = l.modelValue.concat(e.value), l.stash && (m.value = m.value.concat(e))), l.resetQueryOnOptionSelected && (u.value = "")) : e.selected ? (e.manual && (V.value = V.value.filter(
205
+ ), l.stash && (v.value = v.value.filter((t) => t.id !== e.id))) : (a = l.modelValue.concat(e.value), l.stash && (v.value = v.value.concat(e))), l.resetQueryOnOptionSelected && (u.value = "")) : e.selected ? (e.manual && (V.value = V.value.filter(
206
206
  (t) => t.id !== e.id
207
- )), a = null, l.stash && (m.value = []), u.value = "") : (a = e.value, l.stash && (m.value = [e]), u.value = e.text), f("update:modelValue", a);
207
+ )), a = null, l.stash && (v.value = []), u.value = "") : (a = e.value, l.stash && (v.value = [e]), u.value = e.text), d("update:modelValue", a);
208
208
  }, $ = async ({ prefill: e = !1 }) => {
209
209
  let a = [];
210
- Array.isArray(l.items) ? a = l.items : typeof l.items == "function" && (d.value++, a = await l.items(u.value, e, l.modelValue), d.value--), ne.value = a;
211
- }, ye = () => {
210
+ Array.isArray(l.items) ? a = l.items : typeof l.items == "function" && (c.value++, a = await l.items(u.value, e, l.modelValue), c.value--), ae.value = a;
211
+ }, he = () => {
212
212
  const e = u.value, a = u.value, t = JSON.stringify(a), n = {
213
213
  text: e,
214
214
  value: a,
@@ -230,29 +230,29 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
230
230
  if (!Array.isArray(l.modelValue))
231
231
  throw new Error("props.modelValue is not an array.");
232
232
  let t = l.modelValue.every(
233
- (n) => p.value.get(n)
233
+ (n) => m.value.get(n)
234
234
  );
235
235
  if ((!t || a === void 0) && (await $({ prefill: !0 }), t = l.modelValue.every(
236
- (n) => p.value.get(n)
236
+ (n) => m.value.get(n)
237
237
  )), t)
238
- l.stash && (m.value = l.modelValue.map(
239
- (n) => p.value.get(n)
238
+ l.stash && (v.value = l.modelValue.map(
239
+ (n) => m.value.get(n)
240
240
  ));
241
241
  else {
242
242
  let n = [];
243
243
  const s = e.filter((x) => {
244
- let M = p.value.get(x);
244
+ let M = m.value.get(x);
245
245
  return M && n.push(M), M;
246
246
  });
247
- l.stash && (m.value = n), l.enforceCoherence && f("update:modelValue", s);
247
+ l.stash && (v.value = n), l.enforceCoherence && d("update:modelValue", s);
248
248
  }
249
249
  } else {
250
- let t = p.value.get(l.modelValue);
250
+ let t = m.value.get(l.modelValue);
251
251
  if (!t && I(l.modelValue) || a === void 0) {
252
252
  const n = u.value;
253
253
  u.value = "", await $({ prefill: !0 }), u.value = n;
254
254
  }
255
- t = p.value.get(l.modelValue), t ? (u.value = t.text, l.stash && (m.value = [t])) : l.enforceCoherence && I(e) ? (u.value = "", l.stash && (m.value = []), f("update:modelValue", null)) : u.value = "";
255
+ t = m.value.get(l.modelValue), t ? (u.value = t.text, l.stash && (v.value = [t])) : l.enforceCoherence && I(e) ? (u.value = "", l.stash && (v.value = []), d("update:modelValue", null)) : u.value = "";
256
256
  }
257
257
  },
258
258
  H ? 0 : l.modelValueDebounceTime
@@ -267,13 +267,13 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
267
267
  JSON.stringify(e) !== JSON.stringify(a))
268
268
  if (await $({ prefill: !1 }), l.multiple) {
269
269
  if (!l.modelValue.every(
270
- (n) => p.value.get(n)
270
+ (n) => m.value.get(n)
271
271
  ) && l.enforceCoherence) {
272
- const n = l.modelValue.filter((s) => p.value.get(s));
273
- f("update:modelValue", n);
272
+ const n = l.modelValue.filter((s) => m.value.get(s));
273
+ d("update:modelValue", n);
274
274
  }
275
275
  } else
276
- !p.value.get(l.modelValue) && l.enforceCoherence && I(l.modelValue) && f("update:modelValue", null), r.value = null;
276
+ !m.value.get(l.modelValue) && l.enforceCoherence && I(l.modelValue) && d("update:modelValue", null), y.value = null;
277
277
  }
278
278
  );
279
279
  let U;
@@ -282,61 +282,61 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
282
282
  (e, a) => {
283
283
  !H && l.prefill === "focus" && Y || JSON.stringify(e) !== JSON.stringify(a) && (U && clearTimeout(U), U = setTimeout(async () => {
284
284
  if (JSON.stringify(e) !== JSON.stringify(a)) {
285
- l.enforceCoherence && l.stash && (m.value = []);
285
+ l.enforceCoherence && l.stash && (v.value = []);
286
286
  let t = u.value;
287
287
  if (u.value = "", await $({ prefill: !0 }), u.value = t, !l.multiple)
288
- !p.value.get(l.modelValue) && l.enforceCoherence && I(l.modelValue) && (u.value = "", l.stash && (m.value = []), f("update:modelValue", null));
288
+ !m.value.get(l.modelValue) && l.enforceCoherence && I(l.modelValue) && (u.value = "", l.stash && (v.value = []), d("update:modelValue", null));
289
289
  else if (!l.modelValue.every(
290
- (s) => p.value.get(s)
290
+ (s) => m.value.get(s)
291
291
  ) && l.enforceCoherence) {
292
292
  let s = [];
293
293
  const x = l.modelValue.filter((M) => {
294
- let G = p.value.get(M);
294
+ let G = m.value.get(M);
295
295
  return G && s.push(G), G;
296
296
  });
297
- l.stash && (m.value = s), f("update:modelValue", x);
297
+ l.stash && (v.value = s), d("update:modelValue", x);
298
298
  }
299
299
  }
300
300
  }, l.depsDebounceTime));
301
301
  },
302
302
  { deep: !0 }
303
303
  );
304
- const ge = () => {
305
- N.value && c.value && Qe(N.value, c.value, {
304
+ const ye = () => {
305
+ N.value && r.value && je(N.value, r.value, {
306
306
  placement: "bottom",
307
- middleware: [Ge(6), Ue(), We()]
307
+ middleware: [Ge(6), Qe(), Ue()]
308
308
  }).then((e) => {
309
309
  var a;
310
- c.value && (c.value.style.left = `${e.x}px`, c.value.style.top = `${e.y}px`, c.value.style.width = `${(a = N.value) == null ? void 0 : a.offsetWidth}px`);
310
+ r.value && (r.value.style.left = `${e.x}px`, r.value.style.top = `${e.y}px`, r.value.style.width = `${(a = N.value) == null ? void 0 : a.offsetWidth}px`);
311
311
  });
312
- }, _ = v(!1), W = v(!1), R = v(!1), K = v(!0), D = async () => {
313
- K.value = !1, W.value = !0, await q(l.transitionDuration), W.value = !1, _.value = !0;
312
+ }, C = f(!1), W = f(!1), R = f(!1), K = f(!0), D = async () => {
313
+ K.value = !1, W.value = !0, await q(l.transitionDuration), W.value = !1, C.value = !0;
314
314
  }, J = async () => {
315
- _.value = !1, R.value = !0, await q(l.transitionDuration), R.value = !1, K.value = !0;
316
- }, P = v(!1);
315
+ C.value = !1, R.value = !0, await q(l.transitionDuration), R.value = !1, K.value = !0;
316
+ }, P = f(!1);
317
317
  let Y = !0;
318
- const we = async (e) => {
319
- f("focus", e), P.value = !0, document.addEventListener("click", se), document.addEventListener("focusin", ue), S.value instanceof HTMLInputElement && S.value.select(), l.prefill === "focus" && Y && !H && (await $({ prefill: !0 }), Y = !1);
320
- }, ue = async (e) => {
321
- if (e.target instanceof Node && T.value && c.value && !T.value.contains(e.target) && !c.value.contains(e.target)) {
322
- J(), f("inactive"), document.removeEventListener("focusin", ue), P.value = !1, l.multiple && (await q(500), u.value = "");
318
+ const ge = async (e) => {
319
+ d("focus", e), P.value = !0, document.addEventListener("click", ue), document.addEventListener("focusin", ne), O.value instanceof HTMLInputElement && O.value.select(), l.prefill === "focus" && Y && !H && (await $({ prefill: !0 }), Y = !1);
320
+ }, ne = async (e) => {
321
+ if (e.target instanceof Node && _.value && r.value && !_.value.contains(e.target) && !r.value.contains(e.target)) {
322
+ J(), d("inactive"), document.removeEventListener("focusin", ne), P.value = !1, l.multiple && (await q(500), u.value = "");
323
323
  return;
324
324
  }
325
- }, Ve = async (e) => {
326
- if (f("blur", e), !l.multiple && (await le(), await q(300), T.value && c.value)) {
325
+ }, we = async (e) => {
326
+ if (d("blur", e), !l.multiple && (await le(), await q(300), _.value && r.value)) {
327
327
  const a = document.activeElement;
328
- if (!T.value.contains(a) && !c.value.contains(a)) {
329
- const t = p.value.get(l.modelValue);
328
+ if (!_.value.contains(a) && !r.value.contains(a)) {
329
+ const t = m.value.get(l.modelValue);
330
330
  t && (u.value = t.text);
331
331
  }
332
332
  }
333
- }, Ce = (e) => f("change", e), ke = (e) => {
334
- f("input", e), u.value === "" && (l.multiple || f("update:modelValue", null)), typeof l.items == "function" && Se();
335
- }, r = v(null), O = g(() => Number.isInteger(r.value) && r.value ? (r.value === -1 && (r.value = k.value.length - 1), r.value % k.value.length) : r.value), i = v(null), _e = async () => {
333
+ }, Ve = (e) => d("change", e), Ce = (e) => {
334
+ d("input", e), u.value === "" && (l.multiple || d("update:modelValue", null)), typeof l.items == "function" && Te();
335
+ }, y = f(null), k = g(() => Number.isInteger(y.value) && y.value ? y.value % S.value.length : y.value), i = f(null), ke = async () => {
336
336
  var e;
337
- if (r.value !== null ? r.value++ : r.value = 0, await le(), O.value !== null) {
338
- const a = (e = c.value) == null ? void 0 : e.querySelector(
339
- `#${C.value[O.value].id}`
337
+ if (await le(), k.value !== null) {
338
+ const a = (e = r.value) == null ? void 0 : e.querySelector(
339
+ `#${T.value[k.value].id}`
340
340
  );
341
341
  a instanceof HTMLElement && a.scrollIntoView({
342
342
  behavior: "smooth",
@@ -344,11 +344,11 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
344
344
  inline: "start"
345
345
  });
346
346
  }
347
- }, Oe = async () => {
347
+ }, _e = async () => {
348
348
  var e;
349
- if (r.value !== null ? r.value-- : r.value = C.value.length - 1, await le(), O.value !== null) {
350
- const a = (e = c.value) == null ? void 0 : e.querySelector(
351
- `#${C.value[O.value].id}`
349
+ if (await le(), k.value !== null) {
350
+ const a = (e = r.value) == null ? void 0 : e.querySelector(
351
+ `#${T.value[k.value].id}`
352
352
  );
353
353
  a instanceof HTMLElement && a.scrollIntoView({
354
354
  behavior: "smooth",
@@ -356,7 +356,7 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
356
356
  inline: "start"
357
357
  });
358
358
  }
359
- }, Te = async (e) => {
359
+ }, Oe = async (e) => {
360
360
  var a, t;
361
361
  if (l.readonly || l.disabled) {
362
362
  e.preventDefault();
@@ -365,61 +365,61 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
365
365
  switch (e.key) {
366
366
  case "ArrowUp":
367
367
  {
368
- if (e.preventDefault(), d.value)
368
+ if (e.preventDefault(), c.value)
369
369
  return;
370
- i.value = null, _.value ? Oe() : (o.value.length && (r.value = te(o.value).index), await D());
370
+ i.value = null, C.value ? _e() : (o.value.length, await D());
371
371
  }
372
372
  break;
373
373
  case "ArrowDown":
374
374
  {
375
- if (e.preventDefault(), d.value)
375
+ if (e.preventDefault(), c.value)
376
376
  return;
377
- i.value = null, _.value ? _e() : (o.value.length && (r.value = te(o.value).index), await D());
377
+ i.value = null, C.value ? ke() : (o.value.length, await D());
378
378
  }
379
379
  break;
380
380
  case "ArrowLeft":
381
381
  {
382
- if (d.value)
382
+ if (c.value)
383
383
  return;
384
384
  if (!u.value && o.value.length && (i.value === null ? i.value = o.value.length - 1 : i.value > 0 ? i.value-- : i.value = null, i.value !== null)) {
385
- let n = o.value[i.value], s = (a = c.value) == null ? void 0 : a.querySelector(
385
+ let n = o.value[i.value], s = (a = r.value) == null ? void 0 : a.querySelector(
386
386
  `#${n.id}`
387
387
  );
388
388
  s && (s.scrollIntoView({
389
389
  behavior: "smooth",
390
390
  block: "nearest",
391
391
  inline: "start"
392
- }), r.value = z.value[o.value[i.value].id].index);
392
+ }), y.value = z.value[o.value[i.value].id].index);
393
393
  }
394
394
  }
395
395
  break;
396
396
  case "ArrowRight":
397
397
  {
398
- if (d.value)
398
+ if (c.value)
399
399
  return;
400
400
  if (!u.value && o.value.length && (i.value === null ? i.value = 0 : i.value < o.value.length - 1 ? i.value++ : i.value = null, i.value !== null)) {
401
- let n = o.value[i.value], s = (t = c.value) == null ? void 0 : t.querySelector(
401
+ let n = o.value[i.value], s = (t = r.value) == null ? void 0 : t.querySelector(
402
402
  `#${n.id}`
403
403
  );
404
404
  s && (s.scrollIntoView({
405
405
  behavior: "smooth",
406
406
  block: "nearest",
407
407
  inline: "start"
408
- }), r.value = z.value[o.value[i.value].id].index);
408
+ }), y.value = z.value[o.value[i.value].id].index);
409
409
  }
410
410
  }
411
411
  break;
412
412
  case "Enter":
413
413
  {
414
- if (e.preventDefault(), d.value)
414
+ if (e.preventDefault(), c.value)
415
415
  return;
416
- if (!_.value)
417
- k.value.length && o.value.length && (r.value = te(o.value).index), await D();
418
- else if (O.value !== null) {
419
- if (k.value[O.value].disabled)
416
+ if (!C.value)
417
+ S.value.length && o.value.length && (y.value = We(o.value).index), await D();
418
+ else if (k.value !== null) {
419
+ if (S.value[k.value].disabled)
420
420
  return;
421
421
  l.multiple || await J(), A(
422
- k.value[O.value]
422
+ S.value[k.value]
423
423
  );
424
424
  } else if (l.addOptions) {
425
425
  if (l.itemText || l.itemValue) {
@@ -428,7 +428,7 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
428
428
  );
429
429
  return;
430
430
  }
431
- ye();
431
+ he();
432
432
  const n = Re(V.value);
433
433
  A(z.value[n.id]);
434
434
  }
@@ -436,15 +436,15 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
436
436
  break;
437
437
  case "Tab":
438
438
  case "Escape":
439
- _.value && await J(), f("inactive"), i.value = null, r.value = null;
439
+ C.value && await J(), d("inactive"), i.value = null, y.value = null;
440
440
  break;
441
441
  case "Shift":
442
- if (d.value)
442
+ if (c.value)
443
443
  return;
444
444
  break;
445
445
  case "Backspace":
446
446
  {
447
- if (d.value)
447
+ if (c.value)
448
448
  return;
449
449
  u.value || o.value.length && (i.value === null ? i.value = o.value.length - 1 : (A(
450
450
  o.value[i.value]
@@ -458,12 +458,12 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
458
458
  }
459
459
  break;
460
460
  default:
461
- i.value = null, r.value = null, await D();
461
+ i.value = null, y.value = null, await D();
462
462
  break;
463
463
  }
464
464
  };
465
465
  let Z;
466
- const Se = () => {
466
+ const Te = () => {
467
467
  Z && clearTimeout(Z), Z = setTimeout(async () => {
468
468
  try {
469
469
  await $({ prefill: !1 });
@@ -471,25 +471,25 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
471
471
  console.error(e);
472
472
  }
473
473
  }, l.queryDebounceTime);
474
+ }, Se = (e) => {
475
+ d("click", e), !(l.disabled || l.readonly) && (O.value instanceof HTMLElement && O.value.focus(), D());
474
476
  }, xe = (e) => {
475
- f("click", e), !(l.disabled || l.readonly) && (S.value instanceof HTMLElement && S.value.focus(), D());
476
- }, Be = (e) => {
477
477
  if (e.currentTarget instanceof HTMLElement && e.currentTarget.classList.contains("bb-base-select-option")) {
478
478
  const a = z.value[e.currentTarget.id];
479
479
  if (a.disabled)
480
480
  return;
481
- A(a), S.value instanceof HTMLInputElement && S.value.focus(), l.multiple || J();
481
+ A(a), O.value instanceof HTMLInputElement && O.value.focus(), l.multiple || J();
482
482
  }
483
- }, se = async (e) => {
484
- if (e.target instanceof Node && T.value && !T.value.contains(e.target)) {
485
- J(), f("inactive"), document.removeEventListener("click", se), P.value = !1, l.multiple && (await q(500), u.value = "");
483
+ }, ue = async (e) => {
484
+ if (e.target instanceof Node && _.value && !_.value.contains(e.target)) {
485
+ J(), d("inactive"), document.removeEventListener("click", ue), P.value = !1, l.multiple && (await q(500), u.value = "");
486
486
  return;
487
487
  }
488
- }, Ee = Ze(
488
+ }, Be = Ze(
489
489
  (e) => typeof e != "string",
490
490
  JSON.stringify
491
- ), Ie = g(() => [].concat(l.modelValue).map((e) => {
492
- const a = Ee(e);
491
+ ), Ee = g(() => [].concat(l.modelValue).map((e) => {
492
+ const a = Be(e);
493
493
  return {
494
494
  disabled: l.disabled,
495
495
  name: l.name,
@@ -497,36 +497,36 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
497
497
  value: a
498
498
  };
499
499
  }));
500
- return (e, a) => (b(), y("span", {
500
+ return (e, a) => (p(), h("span", {
501
501
  ref_key: "outerContainer",
502
- ref: T,
502
+ ref: _,
503
503
  class: B({
504
504
  "bb-base-select": !0,
505
505
  "bb-base-select--active": P.value,
506
- "bb-base-select--loading": d.value,
506
+ "bb-base-select--loading": c.value,
507
507
  "bb-base-select--disabled": e.disabled,
508
508
  "bb-base-select--errors": e.hasErrors,
509
509
  "bb-base-select--readonly": e.readonly
510
510
  }),
511
- onClick: xe
511
+ onClick: Se
512
512
  }, [
513
- h(e.$slots, "prepend-outer"),
513
+ b(e.$slots, "prepend-outer"),
514
514
  w("span", {
515
515
  ref_key: "innerContainer",
516
516
  ref: N,
517
517
  class: "bb-base-select__inner-container"
518
518
  }, [
519
- h(e.$slots, "prepend"),
519
+ b(e.$slots, "prepend"),
520
520
  w("span", Xe, [
521
- e.multiple ? (b(), y(L, { key: 0 }, [
522
- e.comma ? (b(!0), y(L, { key: 0 }, j(o.value, (t, n) => (b(), y("span", {
521
+ e.multiple ? (p(), h(L, { key: 0 }, [
522
+ e.comma ? (p(!0), h(L, { key: 0 }, j(o.value, (t, n) => (p(), h("span", {
523
523
  key: t.id,
524
524
  class: B({
525
525
  "bb-base-select__selected": !0,
526
526
  "bb-base-select__selected--comma": !0,
527
527
  "bb-base-select__selected--focused": n === i.value
528
528
  })
529
- }, F(t.text) + F(n < o.value.length - 1 ? "," : ""), 3))), 128)) : (b(!0), y(L, { key: 1 }, j(o.value, (t, n) => (b(), ie(He, {
529
+ }, F(t.text) + F(n < o.value.length - 1 ? "," : ""), 3))), 128)) : (p(!0), h(L, { key: 1 }, j(o.value, (t, n) => (p(), se(ze, {
530
530
  key: t.id,
531
531
  class: B({
532
532
  "bb-base-select__selected": !0,
@@ -537,13 +537,13 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
537
537
  text: t.text,
538
538
  "onClick:clear": E((s) => A(t), ["stop"])
539
539
  }, {
540
- default: Le(() => [
541
- h(e.$slots, "chip", {
540
+ default: De(() => [
541
+ b(e.$slots, "chip", {
542
542
  disabled: t.disabled,
543
543
  hasErrors: e.hasErrors,
544
544
  index: t.index,
545
545
  item: t.original,
546
- loading: !!d.value,
546
+ loading: !!c.value,
547
547
  manual: t.manual,
548
548
  selected: t.selected,
549
549
  text: t.text,
@@ -554,56 +554,56 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
554
554
  ]),
555
555
  _: 2
556
556
  }, 1032, ["class", "text", "onClick:clear"]))), 128))
557
- ], 64)) : oe("", !0),
558
- Fe(w("input", {
557
+ ], 64)) : ie("", !0),
558
+ Le(w("input", {
559
559
  id: e.id,
560
560
  ref_key: "input",
561
- ref: S,
561
+ ref: O,
562
562
  "onUpdate:modelValue": a[0] || (a[0] = (t) => u.value = t),
563
563
  autocomplete: e.autocomplete,
564
564
  autofocus: e.autofocus,
565
565
  class: B("bb-base-select__text-input"),
566
566
  disabled: e.disabled,
567
- placeholder: fe.value,
567
+ placeholder: de.value,
568
568
  readonly: e.readonly || !e.allowWriting,
569
569
  type: "text",
570
- onBlur: E(Ve, ["stop"]),
571
- onChange: E(Ce, ["stop"]),
572
- onFocus: E(we, ["stop"]),
573
- onInput: E(ke, ["stop"]),
574
- onKeydown: E(Te, ["stop"])
570
+ onBlur: E(we, ["stop"]),
571
+ onChange: E(Ve, ["stop"]),
572
+ onFocus: E(ge, ["stop"]),
573
+ onInput: E(Ce, ["stop"]),
574
+ onKeydown: E(Oe, ["stop"])
575
575
  }, null, 40, el), [
576
- [Ae, u.value]
576
+ [Fe, u.value]
577
577
  ]),
578
- (b(), ie(Je, { to: "body" }, [
578
+ (p(), se(Ae, { to: "body" }, [
579
579
  w("span", {
580
580
  ref_key: "optionsContainer",
581
- ref: c,
581
+ ref: r,
582
582
  class: B({
583
583
  "bb-base-select__options-container": !0,
584
- "bb-base-select__options-container--shown": _.value,
584
+ "bb-base-select__options-container--shown": C.value,
585
585
  "bb-base-select__options-container--showing": W.value,
586
586
  "bb-base-select__options-container--hiding": R.value,
587
587
  "bb-base-select__options-container--hidden": K.value
588
588
  }),
589
589
  role: "listbox",
590
- style: Me({ transitionDuration: ve }),
590
+ style: Je({ transitionDuration: fe }),
591
591
  tabindex: -1
592
592
  }, [
593
- h(e.$slots, "options:prepend"),
594
- !k.value.length && d.value ? (b(), y("span", ll, [
595
- h(e.$slots, "loading", { query: u.value }, () => [
593
+ b(e.$slots, "options:prepend"),
594
+ !S.value.length && c.value ? (p(), h("span", ll, [
595
+ b(e.$slots, "loading", { query: u.value }, () => [
596
596
  ee(F(e.loadingText), 1)
597
597
  ])
598
- ])) : k.value.length ? oe("", !0) : (b(), y("span", tl, [
599
- h(e.$slots, "no-data", { query: u.value }, () => [
598
+ ])) : S.value.length ? ie("", !0) : (p(), h("span", tl, [
599
+ b(e.$slots, "no-data", { query: u.value }, () => [
600
600
  ee(F(e.noDataText), 1)
601
601
  ])
602
602
  ])),
603
- (b(!0), y(L, null, j(k.value, (t) => (b(), y(L, {
603
+ (p(!0), h(L, null, j(S.value, (t) => (p(), h(L, {
604
604
  key: t.id
605
605
  }, [
606
- h(e.$slots, "option:prepend", {
606
+ b(e.$slots, "option:prepend", {
607
607
  item: t.original
608
608
  }),
609
609
  w("span", {
@@ -616,15 +616,15 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
616
616
  "bb-base-select-option--disabled": t.disabled
617
617
  }),
618
618
  role: "option",
619
- onClick: E(Be, ["stop"])
619
+ onClick: E(xe, ["stop"])
620
620
  }, [
621
- h(e.$slots, "option", {
621
+ b(e.$slots, "option", {
622
622
  disabled: t.disabled,
623
623
  focused: t.focused,
624
624
  hasErrors: e.hasErrors,
625
625
  index: t.index,
626
626
  item: t.original,
627
- loading: !!d.value,
627
+ loading: !!c.value,
628
628
  manual: t.manual,
629
629
  selected: t.selected,
630
630
  text: t.text,
@@ -635,38 +635,38 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
635
635
  ])
636
636
  ])
637
637
  ], 10, al),
638
- h(e.$slots, "option:append", {
638
+ b(e.$slots, "option:append", {
639
639
  item: t.original
640
640
  })
641
641
  ], 64))), 128)),
642
- h(e.$slots, "options:append")
642
+ b(e.$slots, "options:append")
643
643
  ], 6)
644
644
  ]))
645
645
  ]),
646
646
  w("span", sl, [
647
- h(e.$slots, "chevron", {
648
- loading: !!d.value,
649
- shown: _.value
647
+ b(e.$slots, "chevron", {
648
+ loading: !!c.value,
649
+ shown: C.value
650
650
  }, () => [
651
651
  il
652
652
  ])
653
653
  ]),
654
- d.value ? (b(), y("span", {
654
+ c.value ? (p(), h("span", {
655
655
  key: 1,
656
656
  class: B({
657
657
  "bb-base-select__spinner": !0,
658
- "bb-base-select__spinner--loading": d.value
658
+ "bb-base-select__spinner--loading": c.value
659
659
  })
660
660
  }, [
661
- h(e.$slots, "spinner", {
662
- loading: !!d.value
661
+ b(e.$slots, "spinner", {
662
+ loading: !!c.value
663
663
  }, () => [
664
- qe(Pe, { size: "sm" })
664
+ Me(He, { size: "sm" })
665
665
  ])
666
- ], 2)) : h(e.$slots, "append", { key: 0 })
666
+ ], 2)) : b(e.$slots, "append", { key: 0 })
667
667
  ], 512),
668
- h(e.$slots, "append-outer"),
669
- (b(!0), y(L, null, j(Ie.value, (t) => (b(), y("input", ze({
668
+ b(e.$slots, "append-outer"),
669
+ (p(!0), h(L, null, j(Ee.value, (t) => (p(), h("input", qe({
670
670
  key: t.value
671
671
  }, t), null, 16))), 128))
672
672
  ], 2));