bitboss-ui 0.2.50 → 0.2.52

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 (189) hide show
  1. package/dist/components/BaseButton/BaseButton.vue.d.ts +2 -2
  2. package/dist/components/BaseCheckboxGroup/BaseCheckboxGroup.vue.d.ts +24 -24
  3. package/dist/components/BaseDialog/BaseDialog.vue.d.ts +2 -2
  4. package/dist/components/BaseRadioGroup/BaseRadioGroup.vue.d.ts +24 -24
  5. package/dist/components/BaseSelect/BaseSelect.vue.d.ts +6 -6
  6. package/dist/components/BaseSlider/BaseSlider.vue.d.ts +2 -2
  7. package/dist/components/BaseSwitchGroup/BaseSwitchGroup.vue.d.ts +24 -24
  8. package/dist/components/BaseTag/BaseTag.vue.d.ts +4 -4
  9. package/dist/components/BaseTextInput/BaseTextInput.vue.d.ts +4 -4
  10. package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +4 -4
  11. package/dist/components/BbAvatar/BbAvatar.vue.d.ts +2 -2
  12. package/dist/components/BbBadge/BbBadge.vue.d.ts +4 -4
  13. package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue.d.ts +2 -2
  14. package/dist/components/BbButton/BbButton.vue.d.ts +2 -2
  15. package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +24 -24
  16. package/dist/components/BbChip/BbChip.vue.d.ts +2 -2
  17. package/dist/components/BbCollapsible/BbCollapsible.vue.d.ts +2 -2
  18. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +8 -8
  19. package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +2 -2
  20. package/dist/components/BbPagination/BbPagination.vue.d.ts +6 -6
  21. package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +24 -24
  22. package/dist/components/BbRatio/BbRatio.vue.d.ts +2 -2
  23. package/dist/components/BbSelect/BbSelect.vue.d.ts +6 -6
  24. package/dist/components/BbSmoothHeight/BbSmoothHeight.vue.d.ts +1 -1
  25. package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +24 -24
  26. package/dist/components/BbTag/BbTag.vue.d.ts +4 -4
  27. package/dist/components/BbTooltip/BbTooltip.vue.d.ts +1 -1
  28. package/dist/index101.js +32 -32
  29. package/dist/index101.js.map +1 -1
  30. package/dist/index103.js +2 -2
  31. package/dist/index103.js.map +1 -1
  32. package/dist/index105.js.map +1 -1
  33. package/dist/index107.js.map +1 -1
  34. package/dist/index109.js +1 -1
  35. package/dist/index111.js +3 -3
  36. package/dist/index111.js.map +1 -1
  37. package/dist/index113.js +1 -1
  38. package/dist/index115.js.map +1 -1
  39. package/dist/index116.js +1 -1
  40. package/dist/index116.js.map +1 -1
  41. package/dist/index117.js.map +1 -1
  42. package/dist/index118.js +1 -1
  43. package/dist/index118.js.map +1 -1
  44. package/dist/index125.js +1 -1
  45. package/dist/index126.js +1 -1
  46. package/dist/index127.js +1 -1
  47. package/dist/index13.js +5 -5
  48. package/dist/index13.js.map +1 -1
  49. package/dist/index131.js +2 -2
  50. package/dist/index15.js +8 -8
  51. package/dist/index17.js +9 -9
  52. package/dist/index19.js +3 -3
  53. package/dist/index19.js.map +1 -1
  54. package/dist/index198.js +1 -1
  55. package/dist/index199.js +3 -368
  56. package/dist/index199.js.map +1 -1
  57. package/dist/index200.js +34 -133
  58. package/dist/index200.js.map +1 -1
  59. package/dist/index201.js +6 -5
  60. package/dist/index201.js.map +1 -1
  61. package/dist/index202.js +3 -19
  62. package/dist/index202.js.map +1 -1
  63. package/dist/index203.js +3 -2
  64. package/dist/index203.js.map +1 -1
  65. package/dist/index204.js +368 -2
  66. package/dist/index204.js.map +1 -1
  67. package/dist/index205.js +130 -170
  68. package/dist/index205.js.map +1 -1
  69. package/dist/index206.js +5 -23
  70. package/dist/index206.js.map +1 -1
  71. package/dist/index207.js +18 -372
  72. package/dist/index207.js.map +1 -1
  73. package/dist/index208.js +2 -235
  74. package/dist/index208.js.map +1 -1
  75. package/dist/index209.js +2 -3
  76. package/dist/index209.js.map +1 -1
  77. package/dist/index21.js +2 -2
  78. package/dist/index21.js.map +1 -1
  79. package/dist/index210.js +172 -33
  80. package/dist/index210.js.map +1 -1
  81. package/dist/index211.js +23 -6
  82. package/dist/index211.js.map +1 -1
  83. package/dist/index212.js +371 -14
  84. package/dist/index212.js.map +1 -1
  85. package/dist/index213.js +10 -16
  86. package/dist/index213.js.map +1 -1
  87. package/dist/index214.js +2 -20
  88. package/dist/index214.js.map +1 -1
  89. package/dist/index215.js +2 -29
  90. package/dist/index215.js.map +1 -1
  91. package/dist/index216.js +235 -8
  92. package/dist/index216.js.map +1 -1
  93. package/dist/index217.js +16 -3
  94. package/dist/index217.js.map +1 -1
  95. package/dist/index218.js +16 -3
  96. package/dist/index218.js.map +1 -1
  97. package/dist/index219.js +20 -10
  98. package/dist/index219.js.map +1 -1
  99. package/dist/index220.js +29 -2
  100. package/dist/index220.js.map +1 -1
  101. package/dist/index221.js +8 -2
  102. package/dist/index221.js.map +1 -1
  103. package/dist/index223.js +4 -4
  104. package/dist/index226.js +3 -78
  105. package/dist/index226.js.map +1 -1
  106. package/dist/index227.js +79 -2
  107. package/dist/index227.js.map +1 -1
  108. package/dist/index228.js +434 -3
  109. package/dist/index228.js.map +1 -1
  110. package/dist/index229.js +88 -5
  111. package/dist/index229.js.map +1 -1
  112. package/dist/index230.js +200 -2
  113. package/dist/index230.js.map +1 -1
  114. package/dist/index231.js +2 -295
  115. package/dist/index231.js.map +1 -1
  116. package/dist/index232.js +224 -2
  117. package/dist/index232.js.map +1 -1
  118. package/dist/index233.js +258 -2
  119. package/dist/index233.js.map +1 -1
  120. package/dist/index234.js +5 -116
  121. package/dist/index234.js.map +1 -1
  122. package/dist/index235.js +2 -106
  123. package/dist/index235.js.map +1 -1
  124. package/dist/index236.js +291 -431
  125. package/dist/index236.js.map +1 -1
  126. package/dist/index237.js +2 -89
  127. package/dist/index237.js.map +1 -1
  128. package/dist/index238.js +2 -224
  129. package/dist/index238.js.map +1 -1
  130. package/dist/index239.js +105 -246
  131. package/dist/index239.js.map +1 -1
  132. package/dist/index240.js +104 -198
  133. package/dist/index240.js.map +1 -1
  134. package/dist/index241.js +160 -2
  135. package/dist/index241.js.map +1 -1
  136. package/dist/index242.js +1 -4
  137. package/dist/index242.js.map +1 -1
  138. package/dist/index243.js +69 -2
  139. package/dist/index243.js.map +1 -1
  140. package/dist/index244.js +5 -2
  141. package/dist/index244.js.map +1 -1
  142. package/dist/index245.js +15 -2
  143. package/dist/index245.js.map +1 -1
  144. package/dist/index246.js +2 -5
  145. package/dist/index246.js.map +1 -1
  146. package/dist/index247.js +2 -160
  147. package/dist/index247.js.map +1 -1
  148. package/dist/index248.js +4 -1
  149. package/dist/index248.js.map +1 -1
  150. package/dist/index249.js +2 -69
  151. package/dist/index249.js.map +1 -1
  152. package/dist/index250.js +2 -15
  153. package/dist/index250.js.map +1 -1
  154. package/dist/index254.js +2 -3
  155. package/dist/index254.js.map +1 -1
  156. package/dist/index255.js +3 -2
  157. package/dist/index255.js.map +1 -1
  158. package/dist/index27.js.map +1 -1
  159. package/dist/index29.js +2 -2
  160. package/dist/index31.js +314 -337
  161. package/dist/index31.js.map +1 -1
  162. package/dist/index33.js.map +1 -1
  163. package/dist/index37.js +6 -6
  164. package/dist/index37.js.map +1 -1
  165. package/dist/index39.js.map +1 -1
  166. package/dist/index41.js.map +1 -1
  167. package/dist/index47.js.map +1 -1
  168. package/dist/index49.js.map +1 -1
  169. package/dist/index51.js.map +1 -1
  170. package/dist/index57.js.map +1 -1
  171. package/dist/index61.js.map +1 -1
  172. package/dist/index65.js +3 -3
  173. package/dist/index65.js.map +1 -1
  174. package/dist/index72.js +1 -1
  175. package/dist/index72.js.map +1 -1
  176. package/dist/index75.js +1 -1
  177. package/dist/index75.js.map +1 -1
  178. package/dist/index77.js +7 -5
  179. package/dist/index77.js.map +1 -1
  180. package/dist/index79.js +12 -12
  181. package/dist/index79.js.map +1 -1
  182. package/dist/index85.js.map +1 -1
  183. package/dist/index9.js.map +1 -1
  184. package/dist/index91.js.map +1 -1
  185. package/dist/index93.js.map +1 -1
  186. package/dist/index97.js.map +1 -1
  187. package/dist/index99.js.map +1 -1
  188. package/dist/style.css +1 -1
  189. package/package.json +2 -2
package/dist/index31.js CHANGED
@@ -1,36 +1,36 @@
1
- import { defineComponent as Ne, ref as v, computed as w, onMounted as $e, onBeforeUnmount as De, watch as ee, openBlock as g, createElementBlock as h, normalizeClass as I, renderSlot as b, createElementVNode as V, Fragment as L, renderList as P, toDisplayString as F, createBlock as ie, withModifiers as B, withCtx as Le, createTextVNode as le, createCommentVNode as se, withDirectives as Fe, vModelDynamic as Me, Teleport as Ae, normalizeStyle as qe, createVNode as Je, mergeProps as Re, nextTick as U } from "vue";
2
- import ze from "./index115.js";
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";
3
3
  import "./index158.js";
4
- import He from "./index119.js";
4
+ import Pe from "./index119.js";
5
5
  import "./index185.js";
6
- import { autoUpdate as Pe, computePosition as Ue, flip as je, shift as Qe } from "./index199.js";
6
+ import { autoUpdate as je, computePosition as Qe, flip as Ue, shift as We } from "./index204.js";
7
7
  import { deepEqual as re } from "./index123.js";
8
- import { head as te } from "./index221.js";
9
- import { isNotNil as E } from "./index124.js";
10
- import { last as We } from "./index204.js";
8
+ import { head as te } from "./index215.js";
9
+ import { isNotNil as I } from "./index124.js";
10
+ import { last as Re } from "./index209.js";
11
11
  import { useItemText as Ke } from "./index125.js";
12
12
  import { useItemValue as Ye } from "./index126.js";
13
- import { wait as J } from "./index122.js";
13
+ import { wait as q } from "./index122.js";
14
14
  import { when as Ze } from "./index198.js";
15
- import { offset as Ge } from "./index207.js";
15
+ import { offset as Ge } from "./index212.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"
19
19
  }, tl = {
20
20
  key: 1,
21
21
  class: "bb-base-select__no-data-container"
22
- }, al = ["id", "aria-selected"], nl = { class: "bb-base-select-option__content" }, ol = { class: "bb-base-select-option__text" }, ul = { class: "bb-base-select__chevron" }, il = /* @__PURE__ */ V("svg", {
22
+ }, al = ["id", "aria-selected"], nl = { class: "bb-base-select-option__content" }, ul = { class: "bb-base-select-option__text" }, sl = { class: "bb-base-select__chevron" }, il = /* @__PURE__ */ w("svg", {
23
23
  fill: "none",
24
24
  viewBox: "0 0 16 8",
25
25
  xmlns: "http://www.w3.org/2000/svg"
26
26
  }, [
27
- /* @__PURE__ */ V("path", {
27
+ /* @__PURE__ */ w("path", {
28
28
  "clip-rule": "evenodd",
29
29
  d: "M0.851779 0.225802C0.90403 0.173418 0.966103 0.131858 1.03444 0.1035C1.10278 0.0751431 1.17604 0.0605469 1.25003 0.0605469C1.32402 0.0605469 1.39728 0.0751431 1.46562 0.1035C1.53396 0.131858 1.59603 0.173418 1.64828 0.225802L8.00003 6.57868L14.3518 0.225802C14.4041 0.173503 14.4662 0.132017 14.5345 0.103713C14.6028 0.0754093 14.6761 0.0608414 14.75 0.0608414C14.824 0.0608414 14.8972 0.0754093 14.9656 0.103713C15.0339 0.132017 15.096 0.173503 15.1483 0.225802C15.2006 0.278101 15.2421 0.340189 15.2704 0.408521C15.2987 0.476852 15.3132 0.55009 15.3132 0.624052C15.3132 0.698014 15.2987 0.771252 15.2704 0.839584C15.2421 0.907916 15.2006 0.970003 15.1483 1.0223L8.39828 7.7723C8.34603 7.82469 8.28395 7.86625 8.21562 7.8946C8.14728 7.92296 8.07402 7.93756 8.00003 7.93756C7.92604 7.93756 7.85278 7.92296 7.78444 7.8946C7.7161 7.86625 7.65403 7.82469 7.60178 7.7723L0.851779 1.0223C0.799395 0.970051 0.757835 0.907978 0.729477 0.83964C0.70112 0.771302 0.686523 0.69804 0.686523 0.624052C0.686523 0.550064 0.70112 0.476803 0.729477 0.408464C0.757835 0.340126 0.799395 0.278053 0.851779 0.225802Z",
30
30
  fill: "currentColor",
31
31
  "fill-rule": "evenodd"
32
32
  })
33
- ], -1), Cl = /* @__PURE__ */ Ne({
33
+ ], -1), kl = /* @__PURE__ */ Ne({
34
34
  __name: "BaseSelect",
35
35
  props: {
36
36
  allowWriting: { type: Boolean, default: !0 },
@@ -66,162 +66,151 @@ 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(de, { emit: ce }) {
70
- const e = de, f = ce;
71
- if (e.multiple && !Array.isArray(e.modelValue))
69
+ setup(ce, { emit: de }) {
70
+ const l = ce, f = de;
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 S = v(null), N = v(null), d = v(null), T = v(null), u = v(""), fe = w(() => s.value.length ? "" : e.placeholder), c = v(0), ve = e.transitionDuration / 1e3 + "s";
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
74
  let ae;
75
75
  $e(async () => {
76
- e.debug && console.log("Calling onMounted"), N.value && d.value && (ae = Pe(
76
+ N.value && c.value && (ae = je(
77
77
  N.value,
78
- d.value,
79
- ye,
78
+ c.value,
79
+ ge,
80
80
  {
81
81
  ancestorResize: !0,
82
82
  ancestorScroll: !0,
83
- animationFrame: e.updateOnAnimationFrame,
83
+ animationFrame: l.updateOnAnimationFrame,
84
84
  elementResize: !0
85
85
  }
86
86
  ));
87
87
  }), De(() => {
88
- e.debug && console.log("Calling onBeforeUnMount"), ae();
88
+ ae();
89
89
  });
90
- const ne = v([]), p = v([]), C = v([]), { getItemText: pe } = Ke(), { getItemValue: me } = Ye(), ge = w(() => ne.value.map((l, a) => {
91
- e.debug && console.log("Mapping items in internalOptions", { item: l });
92
- const t = pe(l, e.itemText), n = me(l, e.itemValue);
93
- if (n === void 0)
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);
92
+ if (t === void 0)
94
93
  throw new Error(
95
- 'The result of extracting "value" from option was undefined. Affected item is ' + JSON.stringify(l) + " please check itemValue property is correct."
94
+ 'The result of extracting "value" from option was undefined. Affected item is ' + JSON.stringify(e) + " please check itemValue property is correct."
96
95
  );
97
- const o = JSON.stringify(n);
96
+ const n = JSON.stringify(t);
98
97
  return {
99
- disabled: !!l.disabled,
100
- id: "option_" + o.replace(/\W/g, "_"),
101
- jsonValue: o,
98
+ disabled: !!e.disabled,
99
+ id: "option_" + n.replace(/\W/g, "_"),
100
+ jsonValue: n,
102
101
  manual: !1,
103
- original: l,
104
- text: t,
105
- value: n
102
+ original: e,
103
+ text: a,
104
+ value: t
106
105
  };
107
- })), y = w(() => {
108
- let l = ge.value.reduce(
109
- (n, o) => (n[o.id] = o, n),
106
+ })), C = g(() => {
107
+ let e = be.value.reduce(
108
+ (n, s) => (n[s.id] = s, n),
110
109
  {}
111
110
  );
112
- const a = C.value.reduce(
113
- (n, o) => (n[o.id] || (n[o.id] = o), n),
114
- l
115
- ), t = p.value.reduce(
116
- (n, o) => (n[o.id] || (n[o.id] = o), n),
111
+ const a = V.value.reduce(
112
+ (n, s) => (n[s.id] || (n[s.id] = s), n),
113
+ e
114
+ ), t = m.value.reduce(
115
+ (n, s) => (n[s.id] || (n[s.id] = s), n),
117
116
  a
118
117
  );
119
- return e.debug && console.log("Computing options in options", {
120
- fromOptions: l,
121
- withManual: a,
122
- withStash: t
123
- }), Object.values(t).map(
124
- (n, o) => ({
118
+ return Object.values(t).map(
119
+ (n, s) => ({
125
120
  ...n,
126
- selected: E(be.value.get(n.value)),
127
- index: o
121
+ selected: I(he.value.get(n.value)),
122
+ index: s
128
123
  })
129
124
  );
130
- }), O = w(() => {
131
- e.debug && console.log("Computing filtered options");
132
- let l = [];
133
- return u.value && !s.value.some(
125
+ }), k = g(() => {
126
+ let e = [];
127
+ return u.value && !o.value.some(
134
128
  (a) => a.text === u.value
135
- ) ? l = y.value.filter((a) => {
129
+ ) ? e = C.value.filter((a) => {
136
130
  let t = !1;
137
- if (e.filterBy) {
138
- if (typeof e.filterBy == "function")
139
- t = e.filterBy(a.value, a.original);
140
- else if (e.filterBy.length) {
141
- const n = [].concat(e.filterBy);
142
- for (let o = 0; o < n.length; o++) {
143
- const x = n[o];
131
+ if (l.filterBy) {
132
+ if (typeof l.filterBy == "function")
133
+ t = l.filterBy(a.value, a.original);
134
+ else if (l.filterBy.length) {
135
+ const n = [].concat(l.filterBy);
136
+ for (let s = 0; s < n.length; s++) {
137
+ const x = n[s];
144
138
  t = t || a.original[x] && a.original[x].toLowerCase().includes(u.value.toLowerCase());
145
139
  }
146
140
  }
147
141
  } else
148
142
  return !0;
149
143
  return t || a.text.toLowerCase().includes(u.value.toLowerCase());
150
- }) : l = y.value, l.map((a, t) => ({
144
+ }) : e = C.value, e.map((a, t) => ({
151
145
  ...a,
152
- focused: _.value === t
146
+ focused: O.value === t
153
147
  }));
154
- }), R = w(
155
- () => y.value.reduce(
156
- (l, a) => ({
157
- ...l,
148
+ }), z = g(
149
+ () => C.value.reduce(
150
+ (e, a) => ({
151
+ ...e,
158
152
  [a.id]: a
159
153
  }),
160
154
  {}
161
155
  )
162
- ), m = w(() => {
163
- if (e.debug && console.log("Computing optionsIndexedByValue"), e.matchStrategy === "string") {
164
- let l = y.value.reduce(
156
+ ), p = g(() => {
157
+ if (l.matchStrategy === "string") {
158
+ let e = C.value.reduce(
165
159
  (a, t) => (a[t.jsonValue] = t, a),
166
160
  {}
167
161
  );
168
162
  return {
169
- get: (a) => l[JSON.stringify(a)]
163
+ get: (a) => e[JSON.stringify(a)]
170
164
  };
171
- } else if (e.matchStrategy === "equality") {
172
- let l = y.value.map((a) => [
165
+ } else if (l.matchStrategy === "equality") {
166
+ let e = C.value.map((a) => [
173
167
  a.value,
174
168
  a
175
169
  ]);
176
170
  return {
177
171
  get: (a) => {
178
172
  var t;
179
- return (t = l.find((n) => re(n[0], a))) == null ? void 0 : t[1];
173
+ return (t = e.find((n) => re(n[0], a))) == null ? void 0 : t[1];
180
174
  }
181
175
  };
182
176
  } else
183
177
  throw new Error("No match strategy has been defined");
184
- }), be = w(() => {
185
- if (e.debug && console.log("Computing modelValueIndexed"), e.matchStrategy === "string") {
186
- let l = {};
187
- return [].concat(e.modelValue).forEach((a, t) => {
188
- l[JSON.stringify(a)] = t;
178
+ }), he = g(() => {
179
+ if (l.matchStrategy === "string") {
180
+ let e = {};
181
+ return [].concat(l.modelValue).forEach((a, t) => {
182
+ e[JSON.stringify(a)] = t;
189
183
  }), {
190
- get: (a) => l[JSON.stringify(a)]
184
+ get: (a) => e[JSON.stringify(a)]
191
185
  };
192
- } else if (e.matchStrategy === "equality") {
193
- const l = [].concat(e.modelValue).filter(E).map((a, t) => [a, t]);
186
+ } else if (l.matchStrategy === "equality") {
187
+ const e = [].concat(l.modelValue).filter(I).map((a, t) => [a, t]);
194
188
  return {
195
189
  get: (a) => {
196
190
  var t;
197
- return (t = l.find((n) => re(n[0], a))) == null ? void 0 : t[1];
191
+ return (t = e.find((n) => re(n[0], a))) == null ? void 0 : t[1];
198
192
  }
199
193
  };
200
194
  } else
201
195
  throw new Error("No match strategy has been defined");
202
- }), s = w(() => (e.debug && console.log("Computing selectedOptions"), [].concat(e.modelValue).reduce((l, a) => {
203
- const t = m.value.get(a);
204
- return t && l.push(t), l;
205
- }, []))), M = async (l) => {
206
- e.debug && console.log("Running onOptionSelected", { option: l });
196
+ }), o = g(() => [].concat(l.modelValue).reduce((e, a) => {
197
+ const t = p.value.get(a);
198
+ return t && e.push(t), e;
199
+ }, [])), A = (e) => {
207
200
  let a;
208
- e.multiple ? (l.selected ? (l.manual && (e.debug && console.log("onOptionSelected: inside multiple > selected > manual"), C.value = C.value.filter(
209
- (t) => t.id !== l.id
210
- )), a = e.modelValue.filter(
211
- (t) => JSON.stringify(t) !== l.jsonValue
212
- ), e.stash && (e.debug && console.log("onOptionSelected: inside multiple > selected > stash"), p.value = p.value.filter((t) => t.id !== l.id))) : (e.debug && console.log("onOptionSelected: inside multiple > not selected"), a = e.modelValue.concat(l.value), e.stash && (e.debug && console.log(
213
- "onOptionSelected: inside multiple > not selected > stash"
214
- ), p.value = p.value.concat(l))), e.resetQueryOnOptionSelected && (e.debug && console.log("onOptionSelected: resetting query"), u.value = "")) : l.selected ? (l.manual && (e.debug && console.log("onOptionSelected: inside single > selected > manual"), C.value = C.value.filter(
215
- (t) => t.id !== l.id
216
- )), a = null, e.stash && (e.debug && console.log("onOptionSelected: inside single > selected > stash"), p.value = []), u.value = "") : (e.debug && console.log("onOptionSelected: inside single > not selected"), a = l.value, e.stash && (e.debug && console.log("onOptionSelected: inside single > not selected > stash"), p.value = [l]), u.value = l.text), f("update:modelValue", a);
217
- }, $ = async ({ prefill: l = !1 }) => {
218
- e.debug && console.log("running getOptions");
201
+ r.value = e.index, l.multiple ? (e.selected ? (e.manual && (V.value = V.value.filter(
202
+ (t) => t.id !== e.id
203
+ )), a = l.modelValue.filter(
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(
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);
208
+ }, $ = async ({ prefill: e = !1 }) => {
219
209
  let a = [];
220
- Array.isArray(e.items) ? a = e.items : typeof e.items == "function" && (c.value++, a = await e.items(u.value, l, e.modelValue), c.value--), ne.value = a;
221
- }, he = () => {
222
- e.debug && console.log("running addOption");
223
- const l = u.value, a = u.value, t = JSON.stringify(a), n = {
224
- text: l,
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 = () => {
212
+ const e = u.value, a = u.value, t = JSON.stringify(a), n = {
213
+ text: e,
225
214
  value: a,
226
215
  jsonValue: t,
227
216
  id: "option_" + t.replace(/\W/g, "_"),
@@ -229,127 +218,125 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
229
218
  manual: !0,
230
219
  disabled: !1
231
220
  };
232
- C.value = C.value.concat(n), u.value = "";
233
- }, z = e.prefill === !0 || !e.multiple && E(e.modelValue) || e.multiple && !!e.modelValue.length;
234
- let j;
235
- ee(
236
- () => e.modelValue,
237
- (l, a) => {
238
- e.debug && console.log("running watch.modelValue"), j && clearTimeout(j), j = setTimeout(
221
+ V.value = V.value.concat(n), u.value = "";
222
+ }, H = l.prefill === !0 || !l.multiple && I(l.modelValue) || l.multiple && !!l.modelValue.length;
223
+ let Q;
224
+ X(
225
+ () => l.modelValue,
226
+ (e, a) => {
227
+ Q && clearTimeout(Q), Q = setTimeout(
239
228
  async () => {
240
- if (e.multiple) {
241
- if (!Array.isArray(e.modelValue))
229
+ if (l.multiple) {
230
+ if (!Array.isArray(l.modelValue))
242
231
  throw new Error("props.modelValue is not an array.");
243
- let t = e.modelValue.every(
244
- (n) => m.value.get(n)
232
+ let t = l.modelValue.every(
233
+ (n) => p.value.get(n)
245
234
  );
246
- if ((!t || a === void 0) && (await $({ prefill: !0 }), t = e.modelValue.every(
247
- (n) => m.value.get(n)
235
+ if ((!t || a === void 0) && (await $({ prefill: !0 }), t = l.modelValue.every(
236
+ (n) => p.value.get(n)
248
237
  )), t)
249
- e.stash && (p.value = e.modelValue.map(
250
- (n) => m.value.get(n)
238
+ l.stash && (m.value = l.modelValue.map(
239
+ (n) => p.value.get(n)
251
240
  ));
252
241
  else {
253
242
  let n = [];
254
- const o = l.filter((x) => {
255
- let q = m.value.get(x);
256
- return q && n.push(q), q;
243
+ const s = e.filter((x) => {
244
+ let M = p.value.get(x);
245
+ return M && n.push(M), M;
257
246
  });
258
- e.stash && (p.value = n), e.enforceCoherence && f("update:modelValue", o);
247
+ l.stash && (m.value = n), l.enforceCoherence && f("update:modelValue", s);
259
248
  }
260
249
  } else {
261
- e.debug && console.log("watch.modelValue >> single");
262
- let t = m.value.get(e.modelValue);
263
- if (!t && E(e.modelValue) || a === void 0) {
264
- e.debug && console.log("watch.modelValue >> not found line 895");
250
+ let t = p.value.get(l.modelValue);
251
+ if (!t && I(l.modelValue) || a === void 0) {
265
252
  const n = u.value;
266
253
  u.value = "", await $({ prefill: !0 }), u.value = n;
267
254
  }
268
- t = m.value.get(e.modelValue), t ? (e.debug && console.log("watch.modelValue >> found"), u.value = t.text, e.debug && console.log("watch.modelValue assigned to query"), e.stash && (p.value = [t], e.debug && console.log("watch.modelValue assigned to stash")), e.debug && console.log("watch.modelValue end of found")) : e.enforceCoherence && E(l) ? (e.debug && console.log("watch.modelValue >> not found line 911"), u.value = "", e.stash && (p.value = []), f("update:modelValue", null)) : u.value = "";
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 = "";
269
256
  }
270
257
  },
271
- z ? 0 : e.modelValueDebounceTime
258
+ H ? 0 : l.modelValueDebounceTime
272
259
  );
273
260
  },
274
261
  // Prefill when asked or when items are static
275
- { immediate: z, deep: !0 }
276
- ), ee(
277
- () => e.items,
278
- async (l, a) => {
279
- if (typeof l == "function" || // Circumvent arrays defined in the template by the parent
280
- JSON.stringify(l) !== JSON.stringify(a))
281
- if (e.debug && console.log("watch.items"), await $({ prefill: !1 }), e.multiple) {
282
- if (!e.modelValue.every(
283
- (n) => m.value.get(n)
284
- ) && e.enforceCoherence) {
285
- const n = e.modelValue.filter((o) => m.value.get(o));
262
+ { immediate: H, deep: !0 }
263
+ ), X(
264
+ () => l.items,
265
+ async (e, a) => {
266
+ if (typeof e == "function" || // Circumvent arrays defined in the template by the parent
267
+ JSON.stringify(e) !== JSON.stringify(a))
268
+ if (await $({ prefill: !1 }), l.multiple) {
269
+ if (!l.modelValue.every(
270
+ (n) => p.value.get(n)
271
+ ) && l.enforceCoherence) {
272
+ const n = l.modelValue.filter((s) => p.value.get(s));
286
273
  f("update:modelValue", n);
287
274
  }
288
275
  } else
289
- !m.value.get(e.modelValue) && e.enforceCoherence && E(e.modelValue) && f("update:modelValue", null), r.value = null;
276
+ !p.value.get(l.modelValue) && l.enforceCoherence && I(l.modelValue) && f("update:modelValue", null), r.value = null;
290
277
  }
291
278
  );
292
- let Q;
293
- ee(
294
- () => e.dependencies,
295
- (l, a) => {
296
- !z && e.prefill === "focus" && Z || JSON.stringify(l) !== JSON.stringify(a) && (Q && clearTimeout(Q), Q = setTimeout(async () => {
297
- if (JSON.stringify(l) !== JSON.stringify(a)) {
298
- e.enforceCoherence && e.stash && (p.value = []);
279
+ let U;
280
+ X(
281
+ () => l.dependencies,
282
+ (e, a) => {
283
+ !H && l.prefill === "focus" && Y || JSON.stringify(e) !== JSON.stringify(a) && (U && clearTimeout(U), U = setTimeout(async () => {
284
+ if (JSON.stringify(e) !== JSON.stringify(a)) {
285
+ l.enforceCoherence && l.stash && (m.value = []);
299
286
  let t = u.value;
300
- if (u.value = "", await $({ prefill: !0 }), u.value = t, !e.multiple)
301
- !m.value.get(e.modelValue) && e.enforceCoherence && E(e.modelValue) && (u.value = "", e.stash && (p.value = []), f("update:modelValue", null));
302
- else if (!e.modelValue.every(
303
- (o) => m.value.get(o)
304
- ) && e.enforceCoherence) {
305
- let o = [];
306
- const x = e.modelValue.filter((q) => {
307
- let X = m.value.get(q);
308
- return X && o.push(X), X;
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));
289
+ else if (!l.modelValue.every(
290
+ (s) => p.value.get(s)
291
+ ) && l.enforceCoherence) {
292
+ let s = [];
293
+ const x = l.modelValue.filter((M) => {
294
+ let G = p.value.get(M);
295
+ return G && s.push(G), G;
309
296
  });
310
- e.stash && (p.value = o), f("update:modelValue", x);
297
+ l.stash && (m.value = s), f("update:modelValue", x);
311
298
  }
312
299
  }
313
- }, e.depsDebounceTime));
300
+ }, l.depsDebounceTime));
314
301
  },
315
302
  { deep: !0 }
316
303
  );
317
- const ye = () => {
318
- e.debug && console.log("Running display options"), N.value && d.value && Ue(N.value, d.value, {
304
+ const ge = () => {
305
+ N.value && c.value && Qe(N.value, c.value, {
319
306
  placement: "bottom",
320
- middleware: [Ge(6), je(), Qe()]
321
- }).then((l) => {
307
+ middleware: [Ge(6), Ue(), We()]
308
+ }).then((e) => {
322
309
  var a;
323
- d.value && (d.value.style.left = `${l.x}px`, d.value.style.top = `${l.y}px`, d.value.style.width = `${(a = N.value) == null ? void 0 : a.offsetWidth}px`);
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`);
324
311
  });
325
- }, k = v(!1), W = v(!1), K = v(!1), Y = v(!0), D = async () => {
326
- Y.value = !1, W.value = !0, await J(e.transitionDuration), W.value = !1, k.value = !0;
327
- }, A = async () => {
328
- k.value = !1, K.value = !0, await J(e.transitionDuration), K.value = !1, Y.value = !0;
329
- }, H = v(!1);
330
- let Z = !0;
331
- const we = async (l) => {
332
- e.debug && console.log("Running onInputFocus"), f("focus", l), H.value = !0, document.addEventListener("click", ue), document.addEventListener("focusin", oe), T.value instanceof HTMLInputElement && T.value.select(), e.prefill === "focus" && Z && !z && (await $({ prefill: !0 }), Z = !1);
333
- }, oe = async (l) => {
334
- if (e.debug && console.log("Running onFocusOutside"), l.target instanceof Node && S.value && d.value && !S.value.contains(l.target) && !d.value.contains(l.target)) {
335
- A(), f("inactive"), document.removeEventListener("focusin", oe), H.value = !1, e.multiple && (await J(500), u.value = "");
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;
314
+ }, J = async () => {
315
+ _.value = !1, R.value = !0, await q(l.transitionDuration), R.value = !1, K.value = !0;
316
+ }, P = v(!1);
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 = "");
336
323
  return;
337
324
  }
338
- }, Ve = async (l) => {
339
- if (e.debug && console.log("Running onInputBlur"), f("blur", l), !e.multiple && (e.modelValue, await U(), await J(300), S.value && d.value)) {
325
+ }, Ve = async (e) => {
326
+ if (f("blur", e), !l.multiple && (await le(), await q(300), T.value && c.value)) {
340
327
  const a = document.activeElement;
341
- if (!S.value.contains(a) && !d.value.contains(a)) {
342
- const t = m.value.get(e.modelValue);
328
+ if (!T.value.contains(a) && !c.value.contains(a)) {
329
+ const t = p.value.get(l.modelValue);
343
330
  t && (u.value = t.text);
344
331
  }
345
332
  }
346
- }, Oe = (l) => f("change", l), Ce = (l) => {
347
- e.debug && console.log("Running onInputInput"), f("input", l), u.value === "" && (e.multiple || f("update:modelValue", null)), typeof e.items == "function" && Te();
348
- }, r = v(null), _ = w(() => Number.isInteger(r.value) && r.value ? r.value % O.value.length : r.value), i = v(null), ke = async () => {
349
- var l;
350
- if (r.value !== null ? r.value = (r.value + 1) % y.value.length : r.value = 0, await U(), _.value !== null) {
351
- const a = (l = d.value) == null ? void 0 : l.querySelector(
352
- `#${y.value[_.value].id}`
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 () => {
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}`
353
340
  );
354
341
  a instanceof HTMLElement && a.scrollIntoView({
355
342
  behavior: "smooth",
@@ -357,11 +344,11 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
357
344
  inline: "start"
358
345
  });
359
346
  }
360
- }, _e = async () => {
361
- var l;
362
- if (r.value !== null ? r.value = r.value === 0 ? y.value.length - 1 : r.value - 1 : r.value = y.value.length - 1, await U(), _.value !== null) {
363
- const a = (l = d.value) == null ? void 0 : l.querySelector(
364
- `#${y.value[_.value].id}`
347
+ }, Oe = async () => {
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}`
365
352
  );
366
353
  a instanceof HTMLElement && a.scrollIntoView({
367
354
  behavior: "smooth",
@@ -369,112 +356,102 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
369
356
  inline: "start"
370
357
  });
371
358
  }
372
- }, Se = async (l) => {
359
+ }, Te = async (e) => {
373
360
  var a, t;
374
- if (e.readonly || e.disabled) {
375
- l.preventDefault();
361
+ if (l.readonly || l.disabled) {
362
+ e.preventDefault();
376
363
  return;
377
364
  }
378
- switch (l.key) {
365
+ switch (e.key) {
379
366
  case "ArrowUp":
380
367
  {
381
- if (l.preventDefault(), c.value)
368
+ if (e.preventDefault(), d.value)
382
369
  return;
383
- if (i.value = null, k.value) {
384
- if (!O.value.length)
385
- return;
386
- _e();
387
- } else
388
- s.value.length && (r.value = te(s.value).index), await D();
370
+ i.value = null, _.value ? Oe() : (o.value.length && (r.value = te(o.value).index), await D());
389
371
  }
390
372
  break;
391
373
  case "ArrowDown":
392
374
  {
393
- if (l.preventDefault(), c.value)
375
+ if (e.preventDefault(), d.value)
394
376
  return;
395
- if (i.value = null, k.value) {
396
- if (!O.value.length)
397
- return;
398
- ke();
399
- } else
400
- s.value.length && (r.value = te(s.value).index), await D();
377
+ i.value = null, _.value ? _e() : (o.value.length && (r.value = te(o.value).index), await D());
401
378
  }
402
379
  break;
403
380
  case "ArrowLeft":
404
381
  {
405
- if (c.value)
382
+ if (d.value)
406
383
  return;
407
- if (!u.value && s.value.length && (i.value === null ? i.value = s.value.length - 1 : i.value > 0 ? i.value-- : i.value = null, i.value !== null)) {
408
- let n = s.value[i.value], o = (a = d.value) == null ? void 0 : a.querySelector(
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(
409
386
  `#${n.id}`
410
387
  );
411
- o && (o.scrollIntoView({
388
+ s && (s.scrollIntoView({
412
389
  behavior: "smooth",
413
390
  block: "nearest",
414
391
  inline: "start"
415
- }), r.value = R.value[s.value[i.value].id].index);
392
+ }), r.value = z.value[o.value[i.value].id].index);
416
393
  }
417
394
  }
418
395
  break;
419
396
  case "ArrowRight":
420
397
  {
421
- if (c.value)
398
+ if (d.value)
422
399
  return;
423
- if (!u.value && s.value.length && (i.value === null ? i.value = 0 : i.value < s.value.length - 1 ? i.value++ : i.value = null, i.value !== null)) {
424
- let n = s.value[i.value], o = (t = d.value) == null ? void 0 : t.querySelector(
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(
425
402
  `#${n.id}`
426
403
  );
427
- o && (o.scrollIntoView({
404
+ s && (s.scrollIntoView({
428
405
  behavior: "smooth",
429
406
  block: "nearest",
430
407
  inline: "start"
431
- }), r.value = R.value[s.value[i.value].id].index);
408
+ }), r.value = z.value[o.value[i.value].id].index);
432
409
  }
433
410
  }
434
411
  break;
435
412
  case "Enter":
436
413
  {
437
- if (l.preventDefault(), c.value)
414
+ if (e.preventDefault(), d.value)
438
415
  return;
439
- if (!k.value)
440
- O.value.length && s.value.length && (r.value = te(s.value).index), await D();
441
- else if (_.value !== null) {
442
- if (O.value[_.value].disabled)
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)
443
420
  return;
444
- e.multiple || await A(), M(
445
- O.value[_.value]
421
+ l.multiple || await J(), A(
422
+ k.value[O.value]
446
423
  );
447
- } else if (e.addOptions) {
448
- if (e.itemText || e.itemValue) {
424
+ } else if (l.addOptions) {
425
+ if (l.itemText || l.itemValue) {
449
426
  console.error(
450
427
  `Adding an option for mapped items is not supported. You can't create an option while passing "item-text" or "item-value".`
451
428
  );
452
429
  return;
453
430
  }
454
- he();
455
- const n = We(C.value);
456
- M(R.value[n.id]);
431
+ ye();
432
+ const n = Re(V.value);
433
+ A(z.value[n.id]);
457
434
  }
458
435
  }
459
436
  break;
460
437
  case "Tab":
461
438
  case "Escape":
462
- k.value && await A(), f("inactive"), i.value = null, r.value = null;
439
+ _.value && await J(), f("inactive"), i.value = null, r.value = null;
463
440
  break;
464
441
  case "Shift":
465
- if (c.value)
442
+ if (d.value)
466
443
  return;
467
444
  break;
468
445
  case "Backspace":
469
446
  {
470
- if (c.value)
447
+ if (d.value)
471
448
  return;
472
- u.value || s.value.length && (i.value === null ? i.value = s.value.length - 1 : (M(
473
- s.value[i.value]
474
- ), s.value.length ? i.value = Math.max(
449
+ u.value || o.value.length && (i.value === null ? i.value = o.value.length - 1 : (A(
450
+ o.value[i.value]
451
+ ), o.value.length ? i.value = Math.max(
475
452
  Math.min(
476
453
  i.value,
477
- s.value.length - 2
454
+ o.value.length - 2
478
455
  ),
479
456
  0
480
457
  ) : i.value = null)), await D();
@@ -485,217 +462,217 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
485
462
  break;
486
463
  }
487
464
  };
488
- let G;
489
- const Te = () => {
490
- G && clearTimeout(G), G = setTimeout(async () => {
465
+ let Z;
466
+ const Se = () => {
467
+ Z && clearTimeout(Z), Z = setTimeout(async () => {
491
468
  try {
492
469
  await $({ prefill: !1 });
493
- } catch (l) {
494
- console.error(l);
470
+ } catch (e) {
471
+ console.error(e);
495
472
  }
496
- }, e.queryDebounceTime);
497
- }, xe = (l) => {
498
- f("click", l), !(e.disabled || e.readonly) && (T.value instanceof HTMLElement && T.value.focus(), D());
499
- }, Ie = async (l) => {
500
- if (l.currentTarget instanceof HTMLElement && l.currentTarget.classList.contains("bb-base-select-option")) {
501
- const a = R.value[l.currentTarget.id];
473
+ }, l.queryDebounceTime);
474
+ }, xe = (e) => {
475
+ f("click", e), !(l.disabled || l.readonly) && (S.value instanceof HTMLElement && S.value.focus(), D());
476
+ }, Be = (e) => {
477
+ if (e.currentTarget instanceof HTMLElement && e.currentTarget.classList.contains("bb-base-select-option")) {
478
+ const a = z.value[e.currentTarget.id];
502
479
  if (a.disabled)
503
480
  return;
504
- await M(a), await U(), T.value instanceof HTMLInputElement && T.value.focus(), e.multiple || A();
481
+ A(a), S.value instanceof HTMLInputElement && S.value.focus(), l.multiple || J();
505
482
  }
506
- }, ue = async (l) => {
507
- if (l.target instanceof Node && S.value && !S.value.contains(l.target)) {
508
- A(), f("inactive"), document.removeEventListener("click", ue), H.value = !1, e.multiple && (await J(500), u.value = "");
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 = "");
509
486
  return;
510
487
  }
511
- }, Be = Ze(
512
- (l) => typeof l != "string",
488
+ }, Ee = Ze(
489
+ (e) => typeof e != "string",
513
490
  JSON.stringify
514
- ), Ee = w(() => [].concat(e.modelValue).map((l) => {
515
- const a = Be(l);
491
+ ), Ie = g(() => [].concat(l.modelValue).map((e) => {
492
+ const a = Ee(e);
516
493
  return {
517
- disabled: e.disabled,
518
- name: e.name,
494
+ disabled: l.disabled,
495
+ name: l.name,
519
496
  type: "hidden",
520
497
  value: a
521
498
  };
522
499
  }));
523
- return (l, a) => (g(), h("span", {
500
+ return (e, a) => (b(), y("span", {
524
501
  ref_key: "outerContainer",
525
- ref: S,
526
- class: I({
502
+ ref: T,
503
+ class: B({
527
504
  "bb-base-select": !0,
528
- "bb-base-select--active": H.value,
529
- "bb-base-select--loading": c.value,
530
- "bb-base-select--disabled": l.disabled,
531
- "bb-base-select--errors": l.hasErrors,
532
- "bb-base-select--readonly": l.readonly
505
+ "bb-base-select--active": P.value,
506
+ "bb-base-select--loading": d.value,
507
+ "bb-base-select--disabled": e.disabled,
508
+ "bb-base-select--errors": e.hasErrors,
509
+ "bb-base-select--readonly": e.readonly
533
510
  }),
534
511
  onClick: xe
535
512
  }, [
536
- b(l.$slots, "prepend-outer"),
537
- V("span", {
513
+ h(e.$slots, "prepend-outer"),
514
+ w("span", {
538
515
  ref_key: "innerContainer",
539
516
  ref: N,
540
517
  class: "bb-base-select__inner-container"
541
518
  }, [
542
- b(l.$slots, "prepend"),
543
- V("span", Xe, [
544
- l.multiple ? (g(), h(L, { key: 0 }, [
545
- l.comma ? (g(!0), h(L, { key: 0 }, P(s.value, (t, n) => (g(), h("span", {
519
+ h(e.$slots, "prepend"),
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", {
546
523
  key: t.id,
547
- class: I({
524
+ class: B({
548
525
  "bb-base-select__selected": !0,
549
526
  "bb-base-select__selected--comma": !0,
550
527
  "bb-base-select__selected--focused": n === i.value
551
528
  })
552
- }, F(t.text) + F(n < s.value.length - 1 ? "," : ""), 3))), 128)) : (g(!0), h(L, { key: 1 }, P(s.value, (t, n) => (g(), ie(ze, {
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, {
553
530
  key: t.id,
554
- class: I({
531
+ class: B({
555
532
  "bb-base-select__selected": !0,
556
533
  "bb-base-select__selected--chip": !0,
557
534
  "bb-base-select__selected--focused": n === i.value
558
535
  }),
559
536
  clearable: !0,
560
537
  text: t.text,
561
- "onClick:clear": B((o) => M(t), ["stop"])
538
+ "onClick:clear": E((s) => A(t), ["stop"])
562
539
  }, {
563
540
  default: Le(() => [
564
- b(l.$slots, "chip", {
541
+ h(e.$slots, "chip", {
565
542
  disabled: t.disabled,
566
- hasErrors: l.hasErrors,
543
+ hasErrors: e.hasErrors,
567
544
  index: t.index,
568
545
  item: t.original,
569
- loading: !!c.value,
546
+ loading: !!d.value,
570
547
  manual: t.manual,
571
548
  selected: t.selected,
572
549
  text: t.text,
573
550
  value: t.value
574
551
  }, () => [
575
- le(F(t.text), 1)
552
+ ee(F(t.text), 1)
576
553
  ])
577
554
  ]),
578
555
  _: 2
579
556
  }, 1032, ["class", "text", "onClick:clear"]))), 128))
580
- ], 64)) : se("", !0),
581
- Fe(V("input", {
582
- id: l.id,
557
+ ], 64)) : oe("", !0),
558
+ Fe(w("input", {
559
+ id: e.id,
583
560
  ref_key: "input",
584
- ref: T,
561
+ ref: S,
585
562
  "onUpdate:modelValue": a[0] || (a[0] = (t) => u.value = t),
586
- autocomplete: l.autocomplete,
587
- autofocus: l.autofocus,
588
- class: I("bb-base-select__text-input"),
589
- disabled: l.disabled,
563
+ autocomplete: e.autocomplete,
564
+ autofocus: e.autofocus,
565
+ class: B("bb-base-select__text-input"),
566
+ disabled: e.disabled,
590
567
  placeholder: fe.value,
591
- readonly: l.readonly || !l.allowWriting,
568
+ readonly: e.readonly || !e.allowWriting,
592
569
  type: "text",
593
- onBlur: B(Ve, ["stop"]),
594
- onChange: B(Oe, ["stop"]),
595
- onFocus: B(we, ["stop"]),
596
- onInput: B(Ce, ["stop"]),
597
- onKeydown: B(Se, ["stop"])
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"])
598
575
  }, null, 40, el), [
599
- [Me, u.value]
576
+ [Ae, u.value]
600
577
  ]),
601
- (g(), ie(Ae, { to: "body" }, [
602
- V("span", {
578
+ (b(), ie(Je, { to: "body" }, [
579
+ w("span", {
603
580
  ref_key: "optionsContainer",
604
- ref: d,
605
- class: I({
581
+ ref: c,
582
+ class: B({
606
583
  "bb-base-select__options-container": !0,
607
- "bb-base-select__options-container--shown": k.value,
584
+ "bb-base-select__options-container--shown": _.value,
608
585
  "bb-base-select__options-container--showing": W.value,
609
- "bb-base-select__options-container--hiding": K.value,
610
- "bb-base-select__options-container--hidden": Y.value
586
+ "bb-base-select__options-container--hiding": R.value,
587
+ "bb-base-select__options-container--hidden": K.value
611
588
  }),
612
589
  role: "listbox",
613
- style: qe({ transitionDuration: ve }),
590
+ style: Me({ transitionDuration: ve }),
614
591
  tabindex: -1
615
592
  }, [
616
- b(l.$slots, "options:prepend"),
617
- !O.value.length && c.value ? (g(), h("span", ll, [
618
- b(l.$slots, "loading", { query: u.value }, () => [
619
- le(F(l.loadingText), 1)
593
+ h(e.$slots, "options:prepend"),
594
+ !k.value.length && d.value ? (b(), y("span", ll, [
595
+ h(e.$slots, "loading", { query: u.value }, () => [
596
+ ee(F(e.loadingText), 1)
620
597
  ])
621
- ])) : O.value.length ? se("", !0) : (g(), h("span", tl, [
622
- b(l.$slots, "no-data", { query: u.value }, () => [
623
- le(F(l.noDataText), 1)
598
+ ])) : k.value.length ? oe("", !0) : (b(), y("span", tl, [
599
+ h(e.$slots, "no-data", { query: u.value }, () => [
600
+ ee(F(e.noDataText), 1)
624
601
  ])
625
602
  ])),
626
- (g(!0), h(L, null, P(O.value, (t) => (g(), h(L, {
603
+ (b(!0), y(L, null, j(k.value, (t) => (b(), y(L, {
627
604
  key: t.id
628
605
  }, [
629
- b(l.$slots, "option:prepend", {
606
+ h(e.$slots, "option:prepend", {
630
607
  item: t.original
631
608
  }),
632
- V("span", {
609
+ w("span", {
633
610
  id: t.id,
634
611
  "aria-selected": t.selected,
635
- class: I({
612
+ class: B({
636
613
  "bb-base-select-option": !0,
637
614
  "bb-base-select-option--selected": t.selected,
638
615
  "bb-base-select-option--focused": t.focused,
639
616
  "bb-base-select-option--disabled": t.disabled
640
617
  }),
641
618
  role: "option",
642
- onClick: B(Ie, ["stop"])
619
+ onClick: E(Be, ["stop"])
643
620
  }, [
644
- b(l.$slots, "option", {
621
+ h(e.$slots, "option", {
645
622
  disabled: t.disabled,
646
623
  focused: t.focused,
647
- hasErrors: l.hasErrors,
624
+ hasErrors: e.hasErrors,
648
625
  index: t.index,
649
626
  item: t.original,
650
- loading: !!c.value,
627
+ loading: !!d.value,
651
628
  manual: t.manual,
652
629
  selected: t.selected,
653
630
  text: t.text,
654
631
  value: t.value
655
632
  }, () => [
656
- V("span", nl, [
657
- V("span", ol, F(t.text), 1)
633
+ w("span", nl, [
634
+ w("span", ul, F(t.text), 1)
658
635
  ])
659
636
  ])
660
637
  ], 10, al),
661
- b(l.$slots, "option:append", {
638
+ h(e.$slots, "option:append", {
662
639
  item: t.original
663
640
  })
664
641
  ], 64))), 128)),
665
- b(l.$slots, "options:append")
642
+ h(e.$slots, "options:append")
666
643
  ], 6)
667
644
  ]))
668
645
  ]),
669
- V("span", ul, [
670
- b(l.$slots, "chevron", {
671
- loading: !!c.value,
672
- shown: k.value
646
+ w("span", sl, [
647
+ h(e.$slots, "chevron", {
648
+ loading: !!d.value,
649
+ shown: _.value
673
650
  }, () => [
674
651
  il
675
652
  ])
676
653
  ]),
677
- c.value ? (g(), h("span", {
654
+ d.value ? (b(), y("span", {
678
655
  key: 1,
679
- class: I({
656
+ class: B({
680
657
  "bb-base-select__spinner": !0,
681
- "bb-base-select__spinner--loading": c.value
658
+ "bb-base-select__spinner--loading": d.value
682
659
  })
683
660
  }, [
684
- b(l.$slots, "spinner", {
685
- loading: !!c.value
661
+ h(e.$slots, "spinner", {
662
+ loading: !!d.value
686
663
  }, () => [
687
- Je(He, { size: "sm" })
664
+ qe(Pe, { size: "sm" })
688
665
  ])
689
- ], 2)) : b(l.$slots, "append", { key: 0 })
666
+ ], 2)) : h(e.$slots, "append", { key: 0 })
690
667
  ], 512),
691
- b(l.$slots, "append-outer"),
692
- (g(!0), h(L, null, P(Ee.value, (t) => (g(), h("input", Re({
668
+ h(e.$slots, "append-outer"),
669
+ (b(!0), y(L, null, j(Ie.value, (t) => (b(), y("input", ze({
693
670
  key: t.value
694
671
  }, t), null, 16))), 128))
695
672
  ], 2));
696
673
  }
697
674
  });
698
675
  export {
699
- Cl as default
676
+ kl as default
700
677
  };
701
678
  //# sourceMappingURL=index31.js.map