bitboss-ui 2.1.103 → 2.1.105

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 (194) hide show
  1. package/dist/components/BaseSelect/BaseSelect.vue.d.ts +6 -0
  2. package/dist/components/BbSelect/BbSelect.vue.d.ts +6 -0
  3. package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +277 -0
  4. package/dist/components/FlatListBox.vue.d.ts +4 -1
  5. package/dist/components/GroupedListBox.vue.d.ts +4 -1
  6. package/dist/components/ListBox.vue.d.ts +5 -1
  7. package/dist/composables/useCoherence.d.ts +1 -0
  8. package/dist/composables/usePrefill.d.ts +13 -3
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index109.js +21 -23
  11. package/dist/index110.js +13 -7
  12. package/dist/index116.js +1 -1
  13. package/dist/index122.js +4 -4
  14. package/dist/index124.js +14 -16
  15. package/dist/index132.js +1 -1
  16. package/dist/index134.js +5 -5
  17. package/dist/index136.js +1 -1
  18. package/dist/index138.js +2 -2
  19. package/dist/index14.js +1 -1
  20. package/dist/index143.js +2 -2
  21. package/dist/index145.js +1 -1
  22. package/dist/index16.js +3 -3
  23. package/dist/index18.js +3 -3
  24. package/dist/index20.js +14 -14
  25. package/dist/index218.js +138 -2
  26. package/dist/index219.js +2 -138
  27. package/dist/index22.js +14 -14
  28. package/dist/index221.js +1 -1
  29. package/dist/index222.js +1 -1
  30. package/dist/index223.js +6 -2
  31. package/dist/index224.js +16 -2
  32. package/dist/index225.js +5 -3
  33. package/dist/index226.js +5 -33
  34. package/dist/index227.js +5 -28
  35. package/dist/index228.js +7 -0
  36. package/dist/index229.js +3 -5
  37. package/dist/index230.js +2 -5
  38. package/dist/index231.js +6 -5
  39. package/dist/index232.js +8 -5
  40. package/dist/index233.js +268 -3
  41. package/dist/index234.js +52 -2
  42. package/dist/index235.js +52 -6
  43. package/dist/index236.js +30 -6
  44. package/dist/index237.js +53 -261
  45. package/dist/index238.js +12 -51
  46. package/dist/index239.js +3 -52
  47. package/dist/index24.js +11 -11
  48. package/dist/index240.js +33 -32
  49. package/dist/index241.js +25 -57
  50. package/dist/index243.js +2 -3
  51. package/dist/index244.js +2 -86
  52. package/dist/index245.js +5 -0
  53. package/dist/index246.js +8 -28
  54. package/dist/index247.js +12 -15
  55. package/dist/index248.js +135 -17
  56. package/dist/index250.js +23 -15
  57. package/dist/index251.js +4 -12
  58. package/dist/index252.js +23 -2
  59. package/dist/index253.js +33 -4
  60. package/dist/index254.js +2 -106
  61. package/dist/{index285.js → index255.js} +1 -1
  62. package/dist/index256.js +2 -100
  63. package/dist/index257.js +6 -0
  64. package/dist/index258.js +20 -3
  65. package/dist/index259.js +34 -10
  66. package/dist/index26.js +2 -2
  67. package/dist/index260.js +86 -3
  68. package/dist/index262.js +30 -5
  69. package/dist/index263.js +17 -5
  70. package/dist/index264.js +51 -5
  71. package/dist/index265.js +18 -2
  72. package/dist/index266.js +11 -19
  73. package/dist/index267.js +18 -135
  74. package/dist/index268.js +5 -0
  75. package/dist/index269.js +10 -187
  76. package/dist/index270.js +5 -3
  77. package/dist/index272.js +9 -13
  78. package/dist/index273.js +369 -19
  79. package/dist/index275.js +25 -23
  80. package/dist/index276.js +4 -18
  81. package/dist/index277.js +9 -12
  82. package/dist/index278.js +52 -103
  83. package/dist/index279.js +187 -10
  84. package/dist/index28.js +1 -1
  85. package/dist/index280.js +3 -9
  86. package/dist/index281.js +3 -21
  87. package/dist/index282.js +18 -25
  88. package/dist/index283.js +11 -32
  89. package/dist/index284.js +106 -4
  90. package/dist/index286.js +100 -9
  91. package/dist/index288.js +107 -2
  92. package/dist/index289.js +5 -7
  93. package/dist/index290.js +5 -7
  94. package/dist/index291.js +5 -3
  95. package/dist/index292.js +2 -6
  96. package/dist/index293.js +7 -16
  97. package/dist/index294.js +7 -5
  98. package/dist/index295.js +20 -52
  99. package/dist/index296.js +7 -34
  100. package/dist/index297.js +10 -373
  101. package/dist/index298.js +5 -0
  102. package/dist/index299.js +7 -0
  103. package/dist/index30.js +2 -2
  104. package/dist/index300.js +7 -3
  105. package/dist/index302.js +3 -280
  106. package/dist/index303.js +3 -2
  107. package/dist/index304.js +17 -16
  108. package/dist/index305.js +28 -2
  109. package/dist/index306.js +719 -16
  110. package/dist/index307.js +366 -2
  111. package/dist/index308.js +56 -26
  112. package/dist/index309.js +5 -2
  113. package/dist/index310.js +1 -1
  114. package/dist/index311.js +280 -2
  115. package/dist/index312.js +2 -2
  116. package/dist/index313.js +16 -2
  117. package/dist/index314.js +2 -28
  118. package/dist/index315.js +16 -2
  119. package/dist/index316.js +2 -7
  120. package/dist/index317.js +27 -3
  121. package/dist/index318.js +2 -17
  122. package/dist/index319.js +2 -4
  123. package/dist/index32.js +2 -2
  124. package/dist/index320.js +2 -3
  125. package/dist/index321.js +2 -3
  126. package/dist/index322.js +2 -125
  127. package/dist/index323.js +2 -2
  128. package/dist/index324.js +2 -15
  129. package/dist/index325.js +3 -2
  130. package/dist/index326.js +3 -18
  131. package/dist/index327.js +3 -2
  132. package/dist/index328.js +4 -3
  133. package/dist/index329.js +3 -2
  134. package/dist/index330.js +3 -2
  135. package/dist/index331.js +2 -6
  136. package/dist/index332.js +5 -3
  137. package/dist/index333.js +125 -5
  138. package/dist/index334.js +2 -719
  139. package/dist/index335.js +15 -366
  140. package/dist/index336.js +2 -57
  141. package/dist/index337.js +19 -2
  142. package/dist/index338.js +2 -5
  143. package/dist/index339.js +227 -6
  144. package/dist/index34.js +12 -12
  145. package/dist/index340.js +67 -7
  146. package/dist/index341.js +66 -18
  147. package/dist/index342.js +92 -8
  148. package/dist/index343.js +5 -15
  149. package/dist/index344.js +6 -34
  150. package/dist/index345.js +19 -6
  151. package/dist/index346.js +7 -127
  152. package/dist/index347.js +12 -395
  153. package/dist/index348.js +7 -67
  154. package/dist/index349.js +35 -67
  155. package/dist/index350.js +6 -228
  156. package/dist/index351.js +129 -3
  157. package/dist/index352.js +396 -189
  158. package/dist/index353.js +18 -254
  159. package/dist/index355.js +136 -0
  160. package/dist/index356.js +199 -133
  161. package/dist/index357.js +257 -91
  162. package/dist/index358.js +1 -1
  163. package/dist/index359.js +1 -1
  164. package/dist/index36.js +4 -4
  165. package/dist/index363.js +1 -1
  166. package/dist/index38.js +253 -239
  167. package/dist/index40.js +6 -6
  168. package/dist/index42.js +2 -2
  169. package/dist/index44.js +27 -29
  170. package/dist/index46.js +6 -6
  171. package/dist/index50.js +2 -2
  172. package/dist/index54.js +1 -1
  173. package/dist/index56.js +1 -1
  174. package/dist/index58.js +2 -2
  175. package/dist/index60.js +2 -2
  176. package/dist/index62.js +5 -5
  177. package/dist/index68.js +1 -1
  178. package/dist/index74.js +4 -4
  179. package/dist/index82.js +7 -7
  180. package/dist/index84.js +1 -1
  181. package/dist/index86.js +2 -2
  182. package/dist/index88.js +3 -3
  183. package/dist/index90.js +1 -1
  184. package/dist/index93.js +2 -2
  185. package/dist/index95.js +2 -2
  186. package/dist/index97.js +5 -5
  187. package/package.json +2 -2
  188. package/dist/index242.js +0 -15
  189. package/dist/index249.js +0 -53
  190. package/dist/index261.js +0 -6
  191. package/dist/index274.js +0 -11
  192. package/dist/index287.js +0 -9
  193. package/dist/index301.js +0 -7
  194. package/dist/index354.js +0 -24
package/dist/index38.js CHANGED
@@ -1,41 +1,40 @@
1
- import { defineComponent as tt, ref as h, computed as c, toRef as W, createBlock as K, openBlock as g, normalizeClass as te, withCtx as n, createElementVNode as L, createVNode as T, createElementBlock as C, unref as B, renderSlot as d, createCommentVNode as oe, withDirectives as ot, Fragment as ae, toDisplayString as at, withKeys as w, withModifiers as m, normalizeStyle as le, vModelDynamic as lt, normalizeProps as nt, guardReactiveProps as ut, mergeProps as ne, renderList as rt, nextTick as U } from "vue";
2
- import st from "./index114.js";
1
+ import { defineComponent as _e, ref as v, computed as m, toRef as z, createBlock as K, openBlock as y, normalizeClass as ae, withCtx as n, createElementVNode as L, createVNode as F, createElementBlock as C, unref as g, renderSlot as s, createCommentVNode as V, withDirectives as et, Fragment as le, toDisplayString as tt, withKeys as B, withModifiers as f, normalizeStyle as ne, vModelDynamic as ot, normalizeProps as at, guardReactiveProps as lt, mergeProps as ue, renderList as nt, nextTick as U } from "vue";
2
+ import ut from "./index114.js";
3
3
  /* empty css */
4
- import { hash as ue } from "./index233.js";
5
- import { isEmpty as it } from "./index258.js";
6
- import { last as pt } from "./index234.js";
7
- import { matchAnyKey as re } from "./index276.js";
8
- import { useArray as dt } from "./index277.js";
9
- import { useBaseOptions as ct } from "./index249.js";
10
- import { useCoherence as mt } from "./index250.js";
11
- import { useHashedWatcher as se } from "./index251.js";
12
- import { useId as ft } from "./index8.js";
13
- import { useIndexById as ie } from "./index248.js";
14
- import { useMounted as vt, useElementSize as ht, useIntersectionObserver as yt } from "./index143.js";
15
- import { useItemsGetter as gt } from "./index246.js";
16
- import { useLocale as bt } from "./index242.js";
17
- import { useMobile as Bt } from "./index9.js";
18
- import { usePrefill as wt } from "./index247.js";
19
- import { wait as E } from "./index142.js";
20
- import { when as Vt } from "./index253.js";
21
- import St from "./index254.js";
4
+ import { hash as W } from "./index229.js";
5
+ import { isEmpty as rt } from "./index281.js";
6
+ import { last as it } from "./index230.js";
7
+ import { matchAnyKey as re } from "./index282.js";
8
+ import { useArray as st } from "./index283.js";
9
+ import { useBaseOptions as dt } from "./index264.js";
10
+ import { useCoherence as pt } from "./index265.js";
11
+ import { useHashedWatcher as ie } from "./index266.js";
12
+ import { useId as ct } from "./index8.js";
13
+ import { useIndexById as se } from "./index263.js";
14
+ import { useMounted as mt, useElementSize as ft, useIntersectionObserver as vt } from "./index143.js";
15
+ import { useItemsGetter as ht } from "./index262.js";
16
+ import { useLocale as yt } from "./index238.js";
17
+ import { useMobile as bt } from "./index9.js";
18
+ import { usePrefill as gt } from "./index267.js";
19
+ import { wait as T } from "./index142.js";
20
+ import { when as Bt } from "./index276.js";
21
+ import wt from "./index284.js";
22
22
  /* empty css */
23
- import It from "./index256.js";
23
+ import Vt from "./index286.js";
24
24
  /* empty css */
25
25
  import kt from "./index138.js";
26
26
  /* empty css */
27
- import Ct from "./index140.js";
28
- import Dt from "./index267.js";
27
+ import It from "./index140.js";
28
+ import Ct from "./index248.js";
29
29
  /* empty css */
30
- import Ot from "./index278.js";
31
- import { useUntil as $t } from "./index272.js";
32
- import { mapValues as Ht } from "./index148.js";
33
- import { isNil as Lt } from "./index252.js";
34
- import { get as Tt } from "./index279.js";
35
- const Et = { class: "bb-base-select__input-container" }, Ft = {
30
+ import St from "./index288.js";
31
+ import { useUntil as Dt } from "./index247.js";
32
+ import { isNil as $t } from "./index254.js";
33
+ import { get as Ht } from "./index269.js";
34
+ const Ot = { class: "bb-base-select__input-container" }, Lt = {
36
35
  key: 1,
37
36
  class: "bb-base-select__max-reached"
38
- }, At = ["id", "aria-controls", "aria-describedby", "aria-expanded", "autocomplete", "autofocus", "disabled", "inputmode", "placeholder", "readonly", "required", "onKeydown"], yo = /* @__PURE__ */ tt({
37
+ }, Ft = ["id", "aria-activedescendant", "aria-controls", "aria-describedby", "aria-expanded", "autocomplete", "autofocus", "disabled", "inputmode", "placeholder", "readonly", "required", "onKeydown"], mo = /* @__PURE__ */ _e({
39
38
  __name: "BaseSelect",
40
39
  props: {
41
40
  allowWriting: { type: [Boolean, String], default: !0 },
@@ -81,185 +80,184 @@ const Et = { class: "bb-base-select__input-container" }, Ft = {
81
80
  updateOnAnimationFrame: { type: Boolean, default: !1 }
82
81
  },
83
82
  emits: ["blur", "change", "click", "focus", "inactive", "input", "update:modelValue", "option:add"],
84
- setup(pe, { emit: de }) {
85
- const t = pe, u = de;
83
+ setup(de, { emit: pe }) {
84
+ const t = de, u = pe;
86
85
  if (t.multiple && !Array.isArray(t.modelValue))
87
86
  throw new Error('Multiple is set to "true" but modelValue is not an array.');
88
- const { t: ce } = bt(), me = vt(), F = h(null), D = h(null), s = h(null), G = h(null), R = h(null), p = c(
87
+ const { t: ce } = yt(), me = mt(), E = v(null), S = v(null), r = v(null), G = v(null), R = v(null), d = m(
89
88
  () => t.comma ? G.value : R.value
90
- ), { width: fe } = ht(D), { isMobile: ve } = Bt(), he = c(
89
+ ), { width: fe } = ft(S), { isMobile: ve } = bt(), he = m(
91
90
  () => t.allowWriting === "not-mobile" && ve.value ? "none" : void 0
92
- ), j = t.id || ft().id.value, { resume: ye, pause: ge } = yt(
93
- D,
91
+ ), j = t.id || ct().id.value, { resume: ye, pause: be } = vt(
92
+ S,
94
93
  async ([{ intersectionRatio: e }]) => {
95
- e !== 1 && r.value && await k();
94
+ e !== 1 && l.value && await I();
96
95
  },
97
96
  { threshold: [0, 1], immediate: !1 }
98
- ), be = c(() => ({
97
+ ), ge = m(() => ({
99
98
  width: `${fe.value ?? 0}px`
100
- })), A = h(null), y = () => {
99
+ })), A = v(null), q = v(), h = () => {
101
100
  A.value instanceof HTMLInputElement && A.value.focus();
102
101
  }, Be = async (e) => {
103
- u("focus", e), je(), document.addEventListener("click", O), document.addEventListener("focusin", O);
102
+ u("focus", e), je(), document.addEventListener("click", D), document.addEventListener("focusin", D);
104
103
  }, we = () => {
105
- t.prefill === "focus" && !Fe.value && !Q.value && Ae();
104
+ t.prefill === "focus" && !Pe.value && !Y.value && Me();
106
105
  }, Ve = async (e) => {
107
106
  u("blur", e);
108
- }, Se = (e) => u("change", e), Ie = (e) => {
109
- u("input", e), o.value === "" && (t.multiple || u("update:modelValue", null)), p.value?.blur(), N.value && I(), Te(o.value, !1, t.modelValue);
110
- }, O = async (e) => {
111
- if (e.target instanceof Node && F.value && !F.value.$el.contains(e.target) && !s.value?.$el?.contains(e.target)) {
112
- k(), Je(), document.removeEventListener("click", O), document.removeEventListener("focusin", O), await E(t.transitionDuration), b();
107
+ }, ke = (e) => u("change", e), Ie = (e) => {
108
+ u("input", e), o.value === "" && (t.multiple || u("update:modelValue", null)), d.value?.blur(), N.value && k(), Te(o.value, !1, t.modelValue);
109
+ }, Ce = (e) => {
110
+ q.value = e;
111
+ }, D = async (e) => {
112
+ if (e.target instanceof Node && E.value && !E.value.$el.contains(e.target) && !r.value?.$el?.contains(e.target)) {
113
+ I(), Je(), document.removeEventListener("click", D), document.removeEventListener("focusin", D), await T(t.transitionDuration), b();
113
114
  return;
114
115
  }
115
- }, V = c(() => !(t.readonly || t.disabled || H.value || !p.value && t.multiple && i.value.length <= t.maxSelectedLabels)), ke = async () => {
116
- V.value && (p.value?.blur(), r.value ? s.value?.focusPrevious() : (await I(), await E(t.transitionDuration), s.value?.focusLastSelected()));
117
- }, Ce = async () => {
118
- V.value && (p.value?.blur(), r.value ? s.value?.focusNext() : (await I(), await E(t.transitionDuration), s.value?.focusFirstSelected()));
119
- }, De = (e) => {
120
- if (!V.value || !t.multiple || o.value || (e.preventDefault(), s.value?.blur(), !i.value.length)) return;
121
- p.value?.focusPrevious();
122
- const a = p.value?.getHighlighted();
123
- a && s.value?.focusByHash(a.valueHash);
124
- }, Oe = (e) => {
125
- if (!V.value || !t.multiple || o.value || (e.preventDefault(), s.value?.blur(), !i.value.length)) return;
126
- p.value?.focusNext();
127
- const a = p.value?.getHighlighted();
128
- a && s.value?.focusByHash(a.valueHash);
129
- }, $e = async () => {
130
- if (!V.value)
116
+ }, w = m(() => !(t.readonly || t.disabled || H.value || !d.value && t.multiple && p.value.length <= t.maxSelectedLabels)), Se = async () => {
117
+ w.value && (d.value?.blur(), l.value ? r.value?.focusPrevious() : (await k(), await T(t.transitionDuration), r.value?.focusLastSelected()));
118
+ }, De = async () => {
119
+ w.value && (d.value?.blur(), l.value ? r.value?.focusNext() : (await k(), await T(t.transitionDuration), r.value?.focusFirstSelected()));
120
+ }, $e = (e) => {
121
+ if (!w.value || !t.multiple || o.value || (e.preventDefault(), r.value?.blur(), !p.value.length)) return;
122
+ d.value?.focusPrevious();
123
+ const a = d.value?.getHighlighted();
124
+ a && r.value?.focusByHash(a.valueHash);
125
+ }, He = (e) => {
126
+ if (!w.value || !t.multiple || o.value || (e.preventDefault(), r.value?.blur(), !p.value.length)) return;
127
+ d.value?.focusNext();
128
+ const a = d.value?.getHighlighted();
129
+ a && r.value?.focusByHash(a.valueHash);
130
+ }, Oe = async () => {
131
+ if (!w.value)
131
132
  return;
132
- if (r.value) {
133
- if (s.value?.getHighlighted()) {
134
- s.value.confirmOption();
133
+ if (l.value) {
134
+ if (r.value?.getHighlighted()) {
135
+ r.value.confirmOption();
135
136
  return;
136
137
  }
137
138
  } else {
138
- await I(), await E(t.transitionDuration), i.value.length && s.value?.focusFirstSelected();
139
+ await k(), await T(t.transitionDuration), p.value.length && r.value?.focusFirstSelected();
139
140
  return;
140
141
  }
141
142
  const e = o.value.trim();
142
- xe(e) || (u("option:add", e), o.value = "");
143
- }, He = async () => {
144
- r.value && await k();
143
+ Ne(e) || (u("option:add", e), o.value = "");
145
144
  }, Le = async () => {
146
- !V.value || o.value || !i.value.length || (p.value?.getHighlighted() && p.value.confirmOption(), await U(), p.value?.focusPrevious());
147
- }, o = h(""), {
148
- getter: q,
145
+ l.value && await I();
146
+ }, Fe = async () => {
147
+ !w.value || o.value || !p.value.length || (d.value?.getHighlighted() && d.value.confirmOption(), await U(), d.value?.focusPrevious());
148
+ }, o = v(""), {
149
+ getter: P,
149
150
  debouncedGetter: Te,
150
151
  items: Ee,
151
152
  loading: J
152
- } = gt({
153
- items: W(t, "items"),
153
+ } = ht({
154
+ items: z(t, "items"),
154
155
  debounce: t.queryDebounceTime
155
- }), M = () => {
156
- t.enforceCoherence && !ee.value && (t.multiple ? u("update:modelValue", Ue.value.coherent) : u("update:modelValue", null), p.value?.blur(), s.value?.blur());
157
- }, {
158
- hasPrefilled: Q,
159
- isPrefilling: Fe,
160
- prefill: Ae
161
- } = wt({
162
- onStart: t.prefill === !0,
156
+ }), {
157
+ array: Q,
158
+ add: X,
159
+ remove: Ae,
160
+ set: qe
161
+ } = st(), {
162
+ hasPrefilled: Y,
163
+ isPrefilling: Pe,
164
+ prefill: Me
165
+ } = gt({
166
+ trigger: t.prefill === !0,
163
167
  currentValue: t.modelValue,
164
168
  multiple: t.multiple,
165
- fn: async ({ prefill: e }) => {
166
- await q(o.value, e, t.modelValue), t.stash && Y(...$.value.map((a) => a.item)), M(), b();
169
+ fn: async (e) => {
170
+ await P(o.value, e, t.modelValue), t.stash && X(...$.value.map((a) => a.item)), b();
167
171
  }
168
- }), {
169
- array: X,
170
- add: Y,
171
- remove: qe,
172
- set: Me
173
- } = dt(), i = c(() => {
174
- const e = Ht(P.value, (a, l) => _.value[l]);
175
- return Object.values(e).filter(Boolean);
176
- }), Pe = c(() => i.value.length ? "" : t.placeholder), { data: P, get: xe } = ie({
172
+ }), { data: Z, get: Ne } = se({
177
173
  // Force model value to be an array
178
- items: c(() => [].concat(t.modelValue))
179
- }), { options: $ } = ct({
180
- disabled: W(t, "disabled"),
181
- items: c(() => [...Ee.value, ...X.value]),
174
+ items: m(() => [].concat(t.modelValue))
175
+ }), { options: $ } = dt({
176
+ disabled: z(t, "disabled"),
177
+ items: m(() => [...Ee.value, ...Q.value]),
182
178
  itemText: t.itemText,
183
179
  itemValue: t.itemValue,
184
180
  max: t.max,
185
181
  selectable: !0,
186
- selectedIndexedByHash: P
187
- }), H = c(() => !!(J.value || t.loading)), Z = c(() => {
188
- let e = [];
189
- const a = i.value.some(
190
- (f) => f.text === o.value
191
- );
192
- return (t.multiple && o.value || t.filterBy === "not_stashed" && o.value || o.value && !a && !t.multiple) && t.filterBy ? e = $.value.filter((f) => {
193
- let v = !1;
194
- return typeof t.filterBy == "function" ? v = t.filterBy(f.value, f.item, o.value) : t.filterBy === "not_stashed" && o.value ? v = !new Set(X.value.map((et) => et.valueHash)).has(f.valueHash) : Array.isArray(t.filterBy) && t.filterBy.length && (v = v || re(f.item, t.filterBy, o.value.trim())), v || re(f, ["text"], o.value.trim());
195
- }) : e = $.value, e;
196
- }), Ne = Symbol("default"), ze = (e) => Lt(t.groupBy) ? Ne : typeof t.groupBy == "function" ? t.groupBy(e.item) : Tt(e.item, t.groupBy), We = c(() => {
197
- const e = {};
198
- for (const l of Z.value) {
199
- const f = ze(l), v = ue(f);
200
- e[v] || (e[v] = {
201
- id: v,
202
- data: f ?? null,
203
- options: []
204
- }), e[v].options.push(l);
205
- }
206
- return Object.values(e).filter((l) => l.options.length);
207
- }), b = () => {
208
- if (t.multiple) {
209
- o.value = "";
210
- return;
211
- }
212
- let e;
213
- i.value && (e = pt(i.value)), o.value = e?.text || "";
214
- }, Ke = async (e) => {
215
- t.multiple ? (u("update:modelValue", t.modelValue.concat(e.value)), t.stash && Y(e.item), b()) : (t.stash && Me(e.item), u("update:modelValue", e.value), await U(), b()), y(), t.multiple || k();
216
- }, x = async (e) => {
217
- if (qe((a) => a.valueHash !== e.valueHash), t.multiple) {
218
- const a = { ...P.value };
219
- delete a[e.valueHash], u("update:modelValue", Object.values(a));
220
- } else
221
- u("update:modelValue", null), await U(), b();
222
- y();
223
- }, { data: _ } = ie({
182
+ selectedIndexedByHash: Z
183
+ }), { data: _ } = se({
224
184
  items: $,
225
185
  key: "valueHash"
226
- }), { coherent: ee, status: Ue } = mt({
227
- modelValue: W(t, "modelValue"),
186
+ }), { coherent: ee, coherentValue: te } = pt({
187
+ modelValue: z(t, "modelValue"),
228
188
  multiple: t.multiple,
229
- iteratee: (e) => !!_.value[ue(e)]
230
- });
231
- let S = 0;
232
- se(
189
+ iteratee: (e) => !!_.value[W(e)]
190
+ }), p = m(
191
+ () => [].concat(t.modelValue).map((e) => _.value[W(e)]).filter(Boolean)
192
+ ), H = m(() => !!(J.value || t.loading));
193
+ ie(
233
194
  () => t.modelValue,
234
195
  async () => {
235
- S++, ee.value || (await q(o.value, !0, t.modelValue), M()), S === 1 && b(), S--;
196
+ ee.value || (await P(o.value, !0, t.modelValue), t.enforceCoherence && (u("update:modelValue", te.value), d.value?.blur(), r.value?.blur())), b();
236
197
  },
237
- {
238
- debounce: t.modelValueDebounceTime
239
- }
240
- ), se(
198
+ { debounce: t.modelValueDebounceTime }
199
+ ), ie(
241
200
  () => [t.dependencies, t.items],
242
201
  async () => {
243
- Q.value && (S++, await q(o.value, !0, t.modelValue), S === 1 && (M(), b()), S--);
202
+ Y.value && (await P(o.value, !0, t.modelValue), t.enforceCoherence && !ee.value && (u("update:modelValue", te.value), d.value?.blur(), r.value?.blur()), b());
244
203
  },
245
- {
246
- debounce: t.depsDebounceTime
247
- }
204
+ { debounce: t.depsDebounceTime }
248
205
  );
249
- const r = h(!1), N = h(!0), Ge = $t(r), I = async () => {
250
- ye(), N.value = !1, r.value = !0;
251
- }, k = async () => {
252
- r.value = !1, N.value = !0, p.value?.blur(), ge();
253
- }, Re = () => r.value ? k() : I(), z = h(!1), je = () => {
254
- z.value = !0;
206
+ const b = () => {
207
+ if (t.multiple) {
208
+ o.value = "";
209
+ return;
210
+ }
211
+ let e;
212
+ p.value && (e = it(p.value)), o.value = e?.text || "";
213
+ }, xe = m(() => p.value.length ? "" : t.placeholder), ze = async (e) => {
214
+ t.multiple ? (u("update:modelValue", t.modelValue.concat(e.value)), t.stash && X(e.item), b()) : (t.stash && qe(e.item), u("update:modelValue", e.value), await U(), b()), h(), t.multiple || I();
215
+ }, M = async (e) => {
216
+ if (Ae((a) => a.valueHash !== e.valueHash), t.multiple) {
217
+ const a = { ...Z.value };
218
+ delete a[e.valueHash], u("update:modelValue", Object.values(a));
219
+ } else
220
+ u("update:modelValue", null), await U(), b();
221
+ h();
222
+ }, oe = m(() => {
223
+ const e = p.value.some(
224
+ (c) => c.text === o.value
225
+ );
226
+ if (!(t.multiple && o.value || t.filterBy === "not_stashed" && o.value || o.value && !e && !t.multiple) || !t.filterBy) return $.value;
227
+ const i = t.filterBy === "not_stashed" ? new Set(Q.value.map((c) => c.valueHash)) : null;
228
+ return $.value.filter((c) => {
229
+ let O = !1;
230
+ return typeof t.filterBy == "function" ? O = t.filterBy(c.value, c.item, o.value) : t.filterBy === "not_stashed" && o.value ? O = !i.has(c.valueHash) : Array.isArray(t.filterBy) && t.filterBy.length && (O = re(
231
+ c.item,
232
+ t.filterBy,
233
+ o.value.trim()
234
+ )), O || re(c, ["text"], o.value.trim());
235
+ });
236
+ }), Ke = Symbol("default"), Ue = (e) => $t(t.groupBy) ? Ke : typeof t.groupBy == "function" ? t.groupBy(e.item) : Ht(e.item, t.groupBy), We = m(() => {
237
+ const e = {};
238
+ for (const a of oe.value) {
239
+ const i = Ue(a), c = W(i);
240
+ e[c] || (e[c] = {
241
+ id: c,
242
+ data: i ?? null,
243
+ options: []
244
+ }), e[c].options.push(a);
245
+ }
246
+ return Object.values(e).filter((a) => a.options.length);
247
+ }), l = v(!1), N = v(!0), Ge = Dt(l), k = async () => {
248
+ ye(), N.value = !1, l.value = !0;
249
+ }, I = async () => {
250
+ l.value = !1, N.value = !0, q.value = void 0, d.value?.blur(), be();
251
+ }, Re = () => l.value ? I() : k(), x = v(!1), je = () => {
252
+ x.value = !0;
255
253
  }, Je = () => {
256
- z.value = !1, u("inactive");
254
+ x.value = !1, u("inactive");
257
255
  }, Qe = (e) => {
258
- e.preventDefault(), u("click", e), !(t.disabled || t.readonly) && (y(), Re());
259
- }, Xe = Vt(
256
+ e.preventDefault(), u("click", e), !(t.disabled || t.readonly) && (h(), Re());
257
+ }, Xe = Bt(
260
258
  (e) => typeof e != "string",
261
259
  JSON.stringify
262
- ), Ye = c(() => [].concat(t.modelValue).map((e) => {
260
+ ), Ye = m(() => [].concat(t.modelValue).map((e) => {
263
261
  const a = Xe(e);
264
262
  return {
265
263
  disabled: t.disabled,
@@ -271,13 +269,13 @@ const Et = { class: "bb-base-select__input-container" }, Ft = {
271
269
  let e = null;
272
270
  t.multiple && (e = []), u("update:modelValue", e);
273
271
  };
274
- return (e, a) => (g(), K(Ct, {
272
+ return (e, a) => (y(), K(It, {
275
273
  ref_key: "outerContainer",
276
- ref: F,
277
- class: te({
274
+ ref: E,
275
+ class: ae({
278
276
  "bb-base-select": !0,
279
- "bb-base-select--active": z.value,
280
- "bb-base-select--shown": r.value,
277
+ "bb-base-select--active": x.value,
278
+ "bb-base-select--shown": l.value,
281
279
  "bb-base-select--loading": H.value,
282
280
  "bb-base-select--disabled": e.disabled,
283
281
  "bb-base-select--errors": e.hasErrors,
@@ -287,108 +285,109 @@ const Et = { class: "bb-base-select__input-container" }, Ft = {
287
285
  onClick: Qe
288
286
  }, {
289
287
  "prepend-outer": n(() => [
290
- d(e.$slots, "prepend-outer", { query: o.value })
288
+ s(e.$slots, "prepend-outer", { query: o.value })
291
289
  ]),
292
290
  "append-outer": n(() => [
293
- d(e.$slots, "append-outer", { query: o.value })
291
+ s(e.$slots, "append-outer", { query: o.value })
294
292
  ]),
295
293
  default: n(() => [
296
294
  L("span", {
297
295
  ref_key: "innerContainer",
298
- ref: D,
296
+ ref: S,
299
297
  class: "bb-base-select__inner-wrapper"
300
298
  }, [
301
- T(kt, {
299
+ F(kt, {
302
300
  "append:icon": t["append:icon"],
303
- clearable: e.clearable && !B(it)(e.modelValue),
301
+ clearable: e.clearable && !g(rt)(e.modelValue),
304
302
  "prepend:icon": t["prepend:icon"],
305
303
  "prevent-focus": !0,
306
304
  "onClick:clear": Ze
307
305
  }, {
308
306
  prepend: n(() => [
309
- d(e.$slots, "prepend", {
307
+ s(e.$slots, "prepend", {
310
308
  query: o.value,
311
- focus: y
309
+ focus: h
312
310
  })
313
311
  ]),
314
312
  prefix: n(() => [
315
- d(e.$slots, "prefix")
313
+ s(e.$slots, "prefix")
316
314
  ]),
317
315
  append: n(() => [
318
- d(e.$slots, "append", {
316
+ s(e.$slots, "append", {
319
317
  query: o.value,
320
- focus: y
318
+ focus: h
321
319
  })
322
320
  ]),
323
321
  suffix: n(() => [
324
- d(e.$slots, "suffix")
322
+ s(e.$slots, "suffix")
325
323
  ]),
326
324
  default: n(() => [
327
- T(st, { tag: "span" }, {
325
+ F(ut, { tag: "span" }, {
328
326
  default: n(() => [
329
- L("span", Et, [
330
- e.multiple && i.value.length <= e.maxSelectedLabels ? (g(), C(ae, { key: 0 }, [
331
- e.comma ? (g(), K(It, {
327
+ L("span", Ot, [
328
+ e.multiple && p.value.length <= e.maxSelectedLabels ? (y(), C(le, { key: 0 }, [
329
+ e.comma ? (y(), K(Vt, {
332
330
  key: 0,
333
331
  ref_key: "commaBox",
334
332
  ref: G,
335
- options: i.value,
336
- "onOption:unselected": x
337
- }, null, 8, ["options"])) : (g(), K(St, {
333
+ options: p.value,
334
+ "onOption:unselected": M
335
+ }, null, 8, ["options"])) : (y(), K(wt, {
338
336
  key: 1,
339
337
  ref_key: "chipsBox",
340
338
  ref: R,
341
- options: i.value,
342
- "onOption:unselected": x
339
+ options: p.value,
340
+ "onOption:unselected": M
343
341
  }, null, 8, ["options"]))
344
- ], 64)) : e.multiple ? (g(), C("span", Ft, at(e.selectedLabelsFn ? e.selectedLabelsFn(i.value.length) : B(ce)("select.multipleMaxReached", i.value.length)), 1)) : oe("", !0),
345
- ot((g(), C("input", {
346
- id: B(j),
347
- key: `${B(me)}`,
342
+ ], 64)) : e.multiple ? (y(), C("span", Lt, tt(e.selectedLabelsFn ? e.selectedLabelsFn(p.value.length) : g(ce)("select.multipleMaxReached", p.value.length)), 1)) : V("", !0),
343
+ et((y(), C("input", {
344
+ id: g(j),
345
+ key: `${g(me)}`,
348
346
  ref_key: "input",
349
347
  ref: A,
350
- "onUpdate:modelValue": a[0] || (a[0] = (l) => o.value = l),
348
+ "onUpdate:modelValue": a[0] || (a[0] = (i) => o.value = i),
349
+ "aria-activedescendant": l.value ? q.value : void 0,
351
350
  "aria-autocomplete": "list",
352
- "aria-controls": B(Ge) ? `${B(j)}_listbox` : void 0,
351
+ "aria-controls": g(Ge) ? `${g(j)}_listbox` : void 0,
353
352
  "aria-describedby": e.ariaDescribedby,
354
- "aria-expanded": r.value,
353
+ "aria-expanded": l.value,
355
354
  autocomplete: e.autocomplete,
356
355
  autofocus: e.autofocus,
357
- class: te("bb-base-select__text-input"),
356
+ class: ae("bb-base-select__text-input"),
358
357
  disabled: e.disabled,
359
358
  inputmode: he.value,
360
- placeholder: Pe.value,
359
+ placeholder: xe.value,
361
360
  readonly: e.readonly || !e.allowWriting,
362
361
  required: e.required && (!e.multiple || !e.modelValue.length),
363
362
  role: "combobox",
364
363
  size: "1",
365
- style: le({ "--characters": o.value.length }),
364
+ style: ne({ "--characters": o.value.length }),
366
365
  type: "text",
367
- onBlur: m(Ve, ["stop"]),
368
- onChange: m(Se, ["stop"]),
369
- onFocusOnce: m(we, ["stop"]),
370
- onFocus: m(Be, ["stop"]),
371
- onInput: m(Ie, ["stop"]),
366
+ onBlur: f(Ve, ["stop"]),
367
+ onChange: f(ke, ["stop"]),
368
+ onFocusOnce: f(we, ["stop"]),
369
+ onFocus: f(Be, ["stop"]),
370
+ onInput: f(Ie, ["stop"]),
372
371
  onKeydown: [
373
- w(m(Le, ["stop"]), ["delete"]),
374
- w(m(De, ["stop"]), ["left"]),
375
- w(m(Ce, ["stop", "prevent"]), ["down"]),
376
- w(m($e, ["stop", "prevent"]), ["enter"]),
377
- w(m(He, ["stop", "prevent"]), ["esc"]),
378
- w(m(ke, ["stop", "prevent"]), ["up"]),
379
- w(m(Oe, ["stop"]), ["right"])
372
+ B(f(Fe, ["stop"]), ["delete"]),
373
+ B(f($e, ["stop"]), ["left"]),
374
+ B(f(De, ["stop", "prevent"]), ["down"]),
375
+ B(f(Oe, ["stop", "prevent"]), ["enter"]),
376
+ B(f(Le, ["stop", "prevent"]), ["esc"]),
377
+ B(f(Se, ["stop", "prevent"]), ["up"]),
378
+ B(f(He, ["stop"]), ["right"])
380
379
  ]
381
- }, null, 44, At)), [
382
- [lt, o.value]
380
+ }, null, 44, Ft)), [
381
+ [ot, o.value]
383
382
  ])
384
383
  ])
385
384
  ]),
386
385
  _: 1
387
386
  }),
388
- e.showChevron ? d(e.$slots, "chevron", {
387
+ e.showChevron ? s(e.$slots, "chevron", {
389
388
  key: 0,
390
- loading: !!B(J),
391
- shown: r.value
389
+ loading: !!g(J),
390
+ shown: l.value
392
391
  }, () => [
393
392
  a[2] || (a[2] = L("svg", {
394
393
  class: "bb-base-select__chevron",
@@ -400,74 +399,89 @@ const Et = { class: "bb-base-select__input-container" }, Ft = {
400
399
  fill: "currentColor"
401
400
  })
402
401
  ], -1))
403
- ]) : oe("", !0)
402
+ ]) : V("", !0)
404
403
  ]),
405
404
  _: 3
406
405
  }, 8, ["append:icon", "clearable", "prepend:icon"])
407
406
  ], 512),
408
- T(Dt, {
409
- modelValue: r.value,
410
- "onUpdate:modelValue": a[1] || (a[1] = (l) => r.value = l),
411
- anchor: D.value,
407
+ F(Ct, {
408
+ modelValue: l.value,
409
+ "onUpdate:modelValue": a[1] || (a[1] = (i) => l.value = i),
410
+ anchor: S.value,
412
411
  offset: 4,
413
412
  "transition-duration": e.transitionDuration
414
413
  }, {
415
414
  default: n(() => [
416
- T(Ot, {
415
+ l.value ? s(e.$slots, "options:prepend:outer", {
416
+ key: 0,
417
+ focus: h
418
+ }) : V("", !0),
419
+ F(St, {
417
420
  ref_key: "optionsContainer",
418
- ref: s,
421
+ ref: r,
419
422
  compact: e.compact,
420
423
  loading: H.value,
421
424
  "loading-text": e.loadingText,
422
425
  multiple: e.multiple,
423
426
  "no-data-text": e.noDataText,
424
- open: r.value,
425
- options: e.groupBy ? void 0 : Z.value,
427
+ open: l.value,
428
+ options: e.groupBy ? void 0 : oe.value,
426
429
  groups: e.groupBy ? We.value : void 0,
427
430
  "header-height": e.headerHeight,
428
- style: le(be.value),
431
+ style: ne(ge.value),
429
432
  "option-height": e.itemHeight,
430
- "onOption:selected": Ke,
431
- "onOption:unselected": x
433
+ "onFocused:change": Ce,
434
+ "onOption:selected": ze,
435
+ "onOption:unselected": M
432
436
  }, {
433
437
  "options:prepend": n(() => [
434
- d(e.$slots, "options:prepend", { focus: y })
438
+ l.value ? s(e.$slots, "options:prepend", {
439
+ key: 0,
440
+ focus: h
441
+ }) : V("", !0)
435
442
  ]),
436
443
  loading: n(() => [
437
- d(e.$slots, "loading", { query: o.value })
444
+ s(e.$slots, "loading", { query: o.value })
438
445
  ]),
439
446
  "no-data": n(() => [
440
- d(e.$slots, "no-data", {
447
+ s(e.$slots, "no-data", {
441
448
  query: o.value,
442
- focus: y
449
+ focus: h
443
450
  })
444
451
  ]),
445
452
  "options:append": n(() => [
446
- d(e.$slots, "options:append", { focus: y })
453
+ l.value ? s(e.$slots, "options:append", {
454
+ key: 0,
455
+ focus: h
456
+ }) : V("", !0)
447
457
  ]),
448
- option: n((l) => [
449
- d(e.$slots, "option", ne({
458
+ option: n((i) => [
459
+ s(e.$slots, "option", ue({
450
460
  hasErrors: e.hasErrors,
451
461
  loading: H.value
452
- }, l))
462
+ }, i))
453
463
  ]),
454
- group: n((l) => [
455
- d(e.$slots, "group", nt(ut(l)))
464
+ group: n((i) => [
465
+ s(e.$slots, "group", at(lt(i)))
456
466
  ]),
457
467
  _: 3
458
- }, 8, ["compact", "loading", "loading-text", "multiple", "no-data-text", "open", "options", "groups", "header-height", "style", "option-height"])
468
+ }, 8, ["compact", "loading", "loading-text", "multiple", "no-data-text", "open", "options", "groups", "header-height", "style", "option-height"]),
469
+ l.value ? s(e.$slots, "options:append:outer", {
470
+ key: 1,
471
+ focus: h
472
+ }) : V("", !0)
459
473
  ]),
460
474
  _: 3
461
475
  }, 8, ["modelValue", "anchor", "transition-duration"]),
462
- (g(!0), C(ae, null, rt(Ye.value, (l) => (g(), C("input", ne({
463
- key: l.value,
476
+ (y(!0), C(le, null, nt(Ye.value, (i) => (y(), C("input", ue({
477
+ key: i.value,
464
478
  ref_for: !0
465
- }, l), null, 16))), 128))
479
+ }, i), null, 16))), 128))
466
480
  ]),
467
481
  _: 3
468
482
  }, 8, ["class"]));
469
483
  }
470
484
  });
471
485
  export {
472
- yo as default
486
+ mo as default
473
487
  };