bitboss-ui 2.1.95 → 2.1.97

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