bitboss-ui 2.0.102 → 2.0.103

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 (173) hide show
  1. package/dist/components/BaseSelect/BaseSelect.vue.d.ts +10 -16
  2. package/dist/components/BaseSwitchGroup/BaseSwitchGroup.vue.d.ts +109 -7
  3. package/dist/components/BbSelect/BbSelect.vue.d.ts +2 -16
  4. package/dist/composables/useBaseOptions.d.ts +31 -0
  5. package/dist/composables/useCoherence.d.ts +20 -0
  6. package/dist/composables/useHashedWatcher.d.ts +2 -0
  7. package/dist/composables/useIndexById.d.ts +11 -0
  8. package/dist/composables/useItemsGetter.d.ts +12 -0
  9. package/dist/composables/usePrefill.d.ts +12 -0
  10. package/dist/index100.js +88 -60
  11. package/dist/index101.js +10 -13
  12. package/dist/index111.js +154 -126
  13. package/dist/index119.js +2 -2
  14. package/dist/index121.js +5 -5
  15. package/dist/index123.js +1 -1
  16. package/dist/index127.js +1 -1
  17. package/dist/index128.js +1 -1
  18. package/dist/index129.js +1 -1
  19. package/dist/index13.js +2 -2
  20. package/dist/index131.js +1 -1
  21. package/dist/index132.js +69 -65
  22. package/dist/index15.js +4 -4
  23. package/dist/index17.js +3 -3
  24. package/dist/index19.js +126 -82
  25. package/dist/index205.js +52 -80
  26. package/dist/index207.js +13 -5
  27. package/dist/index208.js +19 -15
  28. package/dist/index209.js +4 -16
  29. package/dist/index21.js +14 -14
  30. package/dist/index210.js +124 -17
  31. package/dist/index211.js +5 -19
  32. package/dist/index212.js +121 -23
  33. package/dist/index213.js +19 -3
  34. package/dist/index214.js +16 -2
  35. package/dist/index215.js +16 -8
  36. package/dist/index216.js +2 -250
  37. package/dist/index217.js +2 -52
  38. package/dist/index218.js +41 -44
  39. package/dist/index219.js +6 -5
  40. package/dist/index220.js +5 -60
  41. package/dist/index221.js +10 -51
  42. package/dist/index222.js +371 -0
  43. package/dist/index223.js +2 -13
  44. package/dist/index224.js +4 -2
  45. package/dist/index225.js +2 -4
  46. package/dist/index226.js +3 -2
  47. package/dist/index227.js +7 -20
  48. package/dist/index228.js +8 -4
  49. package/dist/index229.js +3 -3
  50. package/dist/index23.js +16 -16
  51. package/dist/index230.js +84 -168
  52. package/dist/index232.js +10 -0
  53. package/dist/index233.js +25 -8
  54. package/dist/index234.js +14 -123
  55. package/dist/index235.js +47 -124
  56. package/dist/index236.js +15 -2
  57. package/dist/index237.js +11 -40
  58. package/dist/index238.js +16 -6
  59. package/dist/index239.js +19 -5
  60. package/dist/index240.js +27 -12
  61. package/dist/index241.js +247 -366
  62. package/dist/index242.js +52 -3
  63. package/dist/index243.js +44 -7
  64. package/dist/index244.js +5 -2
  65. package/dist/index245.js +59 -17
  66. package/dist/index246.js +2 -106
  67. package/dist/index247.js +117 -0
  68. package/dist/index248.js +3 -100
  69. package/dist/index249.js +4 -0
  70. package/dist/index25.js +6 -6
  71. package/dist/index250.js +18 -2
  72. package/dist/index251.js +106 -2
  73. package/dist/index253.js +100 -3
  74. package/dist/index255.js +12 -23
  75. package/dist/index256.js +2 -89
  76. package/dist/index257.js +4 -0
  77. package/dist/index258.js +10 -9
  78. package/dist/index259.js +3 -6
  79. package/dist/index260.js +6 -16
  80. package/dist/index261.js +15 -8
  81. package/dist/index262.js +9 -8
  82. package/dist/index263.js +23 -281
  83. package/dist/index264.js +89 -6
  84. package/dist/index266.js +3 -2
  85. package/dist/index268.js +7 -2
  86. package/dist/index269.js +176 -2
  87. package/dist/index27.js +1 -1
  88. package/dist/index270.js +281 -2
  89. package/dist/index271.js +6 -2
  90. package/dist/index272.js +2 -2
  91. package/dist/index273.js +2 -2
  92. package/dist/index274.js +2 -2
  93. package/dist/index275.js +2 -28
  94. package/dist/index276.js +2 -22
  95. package/dist/index277.js +128 -0
  96. package/dist/index278.js +429 -5
  97. package/dist/index279.js +22 -3
  98. package/dist/index281.js +2 -4
  99. package/dist/index282.js +4 -224
  100. package/dist/index283.js +23 -171
  101. package/dist/index284.js +200 -3
  102. package/dist/index285.js +435 -11
  103. package/dist/index286.js +125 -7
  104. package/dist/index287.js +87 -15
  105. package/dist/index288.js +8 -3
  106. package/dist/index289.js +3 -7
  107. package/dist/index29.js +3 -3
  108. package/dist/index290.js +7 -11
  109. package/dist/index291.js +11 -2
  110. package/dist/index292.js +15 -124
  111. package/dist/index293.js +9 -431
  112. package/dist/index294.js +7 -21
  113. package/dist/index296.js +2 -2
  114. package/dist/index297.js +2 -89
  115. package/dist/index298.js +2 -200
  116. package/dist/index299.js +2 -436
  117. package/dist/index300.js +2 -127
  118. package/dist/index301.js +22 -2
  119. package/dist/index303.js +224 -3
  120. package/dist/index304.js +3 -213
  121. package/dist/index305.js +2 -65
  122. package/dist/index306.js +213 -5
  123. package/dist/index307.js +2 -3
  124. package/dist/index308.js +5 -3
  125. package/dist/index309.js +66 -3
  126. package/dist/index31.js +2 -2
  127. package/dist/index310.js +3 -58
  128. package/dist/index311.js +3 -33
  129. package/dist/index312.js +57 -7
  130. package/dist/index313.js +32 -7
  131. package/dist/index314.js +1 -1
  132. package/dist/index315.js +1 -1
  133. package/dist/index316.js +3 -7
  134. package/dist/index317.js +3 -18
  135. package/dist/index318.js +8 -7
  136. package/dist/index319.js +8 -4
  137. package/dist/index320.js +7 -2
  138. package/dist/index321.js +17 -45
  139. package/dist/index322.js +7 -480
  140. package/dist/index323.js +49 -0
  141. package/dist/index324.js +2 -424
  142. package/dist/index326.js +480 -2
  143. package/dist/index327.js +426 -0
  144. package/dist/index329.js +4 -0
  145. package/dist/index33.js +102 -61
  146. package/dist/index35.js +3 -3
  147. package/dist/index37.js +284 -244
  148. package/dist/index39.js +5 -5
  149. package/dist/index41.js +2 -2
  150. package/dist/index43.js +129 -84
  151. package/dist/index45.js +122 -120
  152. package/dist/index47.js +2 -2
  153. package/dist/index49.js +2 -2
  154. package/dist/index55.js +1 -1
  155. package/dist/index57.js +2 -2
  156. package/dist/index61.js +2 -2
  157. package/dist/index75.js +3 -3
  158. package/dist/index79.js +2 -2
  159. package/dist/index81.js +1 -1
  160. package/dist/index84.js +3 -3
  161. package/dist/index86.js +1 -1
  162. package/dist/index88.js +4 -4
  163. package/dist/index90.js +1 -1
  164. package/package.json +1 -1
  165. package/dist/composables/useOptions.d.ts +0 -43
  166. package/dist/index206.js +0 -4
  167. package/dist/index231.js +0 -86
  168. package/dist/index252.js +0 -12
  169. package/dist/index254.js +0 -11
  170. package/dist/index265.js +0 -4
  171. package/dist/index302.js +0 -5
  172. /package/dist/{index267.js → index295.js} +0 -0
  173. /package/dist/{index325.js → index328.js} +0 -0
package/dist/index37.js CHANGED
@@ -1,36 +1,40 @@
1
- import { defineComponent as Fe, defineAsyncComponent as Me, ref as v, computed as y, toRef as V, openBlock as b, createBlock as S, normalizeClass as W, withCtx as r, renderSlot as p, unref as i, createVNode as N, createElementVNode as $, createElementBlock as T, Fragment as R, toDisplayString as Ne, createCommentVNode as J, withDirectives as He, isRef as Pe, withModifiers as d, withKeys as g, vModelDynamic as ze, renderList as Qe, mergeProps as Y, normalizeStyle as Ke, nextTick as _e } from "vue";
1
+ import { defineComponent as Ue, defineAsyncComponent as Ge, ref as f, computed as y, toRef as x, openBlock as h, createBlock as T, normalizeClass as Z, withCtx as i, renderSlot as c, createVNode as K, unref as S, createElementVNode as H, createElementBlock as A, Fragment as ee, toDisplayString as Re, createCommentVNode as te, withDirectives as je, withModifiers as p, withKeys as g, vModelDynamic as Je, renderList as Qe, mergeProps as le, normalizeStyle as Xe, nextTick as _ } from "vue";
2
2
  /* empty css */
3
3
  /* empty css */
4
- import { useId as Ue } from "./index8.js";
5
- import { useMobile as We } from "./index9.js";
6
- import Re from "./index128.js";
4
+ import { useId as Ye } from "./index8.js";
5
+ import { useMobile as Ze } from "./index9.js";
6
+ import et from "./index128.js";
7
7
  /* empty css */
8
- import { isNotNil as Je } from "./index134.js";
9
- import { last as Ye } from "./index214.js";
10
- import { matchAnyKey as j } from "./index245.js";
11
- import { useFloating as je } from "./index234.js";
12
- import { useIntersectionObserver as Ge } from "./index132.js";
13
- import { useLogger as Xe } from "./index215.js";
14
- import { useOptions as Ze } from "./index230.js";
15
- import { wait as L } from "./index130.js";
16
- import { when as et } from "./index225.js";
17
- import tt from "./index246.js";
8
+ import { last as tt } from "./index217.js";
9
+ import { matchAnyKey as ae } from "./index250.js";
10
+ import { useFloating as lt } from "./index210.js";
11
+ import { useIntersectionObserver as at } from "./index132.js";
12
+ import { wait as E } from "./index130.js";
13
+ import { when as ot } from "./index224.js";
14
+ import nt from "./index251.js";
18
15
  /* empty css */
19
- import ot from "./index248.js";
16
+ import it from "./index253.js";
20
17
  /* empty css */
21
- import nt from "./index221.js";
18
+ import ut from "./index205.js";
22
19
  /* empty css */
23
- import lt from "./index223.js";
24
- import { waitFor as at } from "./index238.js";
25
- import it from "./index240.js";
26
- import { autoUpdate as rt, flip as st, offset as ut, shift as pt } from "./index241.js";
27
- const dt = { class: "bb-base-select__input-container" }, ct = {
20
+ import rt from "./index207.js";
21
+ import { waitFor as st } from "./index219.js";
22
+ import dt from "./index221.js";
23
+ import { useItemsGetter as ct } from "./index233.js";
24
+ import { usePrefill as pt } from "./index238.js";
25
+ import { useArray as mt } from "./index255.js";
26
+ import { useBaseOptions as ft } from "./index235.js";
27
+ import { useIndexById as oe } from "./index234.js";
28
+ import { useCoherence as vt } from "./index236.js";
29
+ import { hash as yt } from "./index229.js";
30
+ import { useHashedWatcher as ne } from "./index237.js";
31
+ import { autoUpdate as ht, flip as bt, offset as gt, shift as wt } from "./index222.js";
32
+ const Bt = { class: "bb-base-select__input-container" }, Vt = {
28
33
  key: 1,
29
34
  class: "bb-base-select__max-reached"
30
- }, ft = ["id", "aria-controls", "aria-describedby", "aria-expanded", "autocomplete", "autofocus", "disabled", "inputmode", "placeholder", "readonly", "required", "onKeydown"], Pt = /* @__PURE__ */ Fe({
35
+ }, It = ["id", "aria-controls", "aria-describedby", "aria-expanded", "autocomplete", "autofocus", "disabled", "inputmode", "placeholder", "readonly", "required", "onKeydown"], tl = /* @__PURE__ */ Ue({
31
36
  __name: "BaseSelect",
32
37
  props: {
33
- addOptions: { type: Boolean },
34
38
  allowWriting: { type: [Boolean, String], default: !0 },
35
39
  "append:icon": {},
36
40
  ariaDescribedby: {},
@@ -63,281 +67,317 @@ const dt = { class: "bb-base-select__input-container" }, ct = {
63
67
  queryDebounceTime: { default: 500 },
64
68
  readonly: { type: Boolean },
65
69
  required: { type: Boolean },
66
- resetQueryOnOptionSelected: { type: Boolean },
67
70
  stash: { type: Boolean },
68
71
  transitionDuration: { default: 300 },
69
72
  updateOnAnimationFrame: { type: Boolean, default: !1 }
70
73
  },
71
- emits: ["blur", "change", "click", "focus", "inactive", "input", "update:modelValue"],
72
- setup(G, { emit: X }) {
73
- const t = G, h = X;
74
+ emits: ["blur", "change", "click", "focus", "inactive", "input", "update:modelValue", "option:add"],
75
+ setup(ie, { emit: ue }) {
76
+ const t = ie, u = ue;
74
77
  if (t.multiple && !Array.isArray(t.modelValue))
75
78
  throw new Error('Multiple is set to "true" but modelValue is not an array.');
76
- const Z = Me(() => import("./index244.js")), A = v(null), B = v(null), a = v(null), H = v(null), P = v(null), u = y(
77
- () => t.comma ? H.value : P.value
78
- ), { isMobile: ee } = We(), te = y(
79
- () => t.allowWriting === "not-mobile" && ee.value ? "none" : void 0
80
- ), z = t.id || Ue().id.value;
81
- Ge(
82
- B,
79
+ const re = Ge(() => import("./index249.js")), F = f(null), V = f(null), n = f(null), U = f(null), G = f(null), r = y(
80
+ () => t.comma ? U.value : G.value
81
+ ), { isMobile: se } = Ze(), de = y(
82
+ () => t.allowWriting === "not-mobile" && se.value ? "none" : void 0
83
+ ), R = t.id || Ye().id.value;
84
+ at(
85
+ V,
83
86
  ([{ intersectionRatio: e }]) => {
84
- e !== 1 && C();
87
+ e !== 1 && k();
85
88
  },
86
89
  { threshold: [0, 1] }
87
90
  );
88
- const { floatingStyles: oe } = je(
89
- B,
90
- a,
91
+ const { floatingStyles: ce } = lt(
92
+ V,
93
+ n,
91
94
  {
92
95
  placement: "bottom",
93
- whileElementsMounted: rt,
94
- middleware: [st(), ut(5), pt()]
96
+ whileElementsMounted: ht,
97
+ middleware: [bt(), gt(5), wt()]
95
98
  }
96
- ), ne = y(() => {
97
- var o;
99
+ ), pe = y(() => {
100
+ var l;
98
101
  const e = {
99
- ...oe.value,
102
+ ...ce.value,
100
103
  zIndex: "10"
101
104
  };
102
- return B.value && (e.width = `${(o = B.value) == null ? void 0 : o.$el.clientWidth}px`), e;
103
- }), q = v(null), x = () => {
104
- q.value instanceof HTMLInputElement && q.value.focus();
105
- }, le = async (e) => {
106
- h("focus", e), Le(), document.addEventListener("click", k), document.addEventListener("focusin", k);
107
- }, ae = () => {
108
- t.prefill === "focus" && !Oe.value && !Ce.value && Be();
109
- }, ie = async (e) => {
110
- h("blur", e);
111
- }, re = (e) => h("change", e), se = (e) => {
112
- var o;
113
- h("input", e), l.value === "" && (t.multiple || De(null)), (o = u.value) == null || o.blur(), E.value && O(), Ve();
114
- }, k = async (e) => {
115
- if (e.target instanceof Node && A.value && a.value && !A.value.$el.contains(e.target) && !a.value.$el.contains(e.target)) {
116
- C(), Ae(), document.removeEventListener("click", k), document.removeEventListener("focusin", k), await L(t.transitionDuration), be();
105
+ return V.value && (e.width = `${(l = V.value) == null ? void 0 : l.$el.clientWidth}px`), e;
106
+ }), L = f(null), q = () => {
107
+ L.value instanceof HTMLInputElement && L.value.focus();
108
+ }, me = async (e) => {
109
+ u("focus", e), ze(), document.addEventListener("click", D), document.addEventListener("focusin", D);
110
+ }, fe = () => {
111
+ t.prefill === "focus" && !De.value && !J.value && $e();
112
+ }, ve = async (e) => {
113
+ u("blur", e);
114
+ }, ye = (e) => u("change", e), he = (e) => {
115
+ var l;
116
+ u("input", e), a.value === "" && (t.multiple || u("update:modelValue", null)), (l = r.value) == null || l.blur(), z.value && I(), Ce(a.value, !1, t.modelValue);
117
+ }, D = async (e) => {
118
+ if (e.target instanceof Node && F.value && n.value && !F.value.$el.contains(e.target) && !n.value.$el.contains(e.target)) {
119
+ k(), Ne(), document.removeEventListener("click", D), document.removeEventListener("focusin", D), await E(t.transitionDuration), b();
117
120
  return;
118
121
  }
119
- }, w = y(() => !(t.readonly || t.disabled || I.value || !u.value && t.multiple)), ue = async () => {
120
- var e, o, n;
121
- w.value && ((e = u.value) == null || e.blur(), c.value ? (o = a.value) == null || o.focusPrevious() : (await O(), await L(t.transitionDuration), (n = a.value) == null || n.focusLastSelected()));
122
- }, pe = async () => {
123
- var e, o, n;
124
- w.value && ((e = u.value) == null || e.blur(), c.value ? (o = a.value) == null || o.focusNext() : (await O(), await L(t.transitionDuration), (n = a.value) == null || n.focusFirstSelected()));
125
- }, de = (e) => {
126
- var n, s, m, D;
127
- if (!w.value || !t.multiple || l.value || (e.preventDefault(), (n = a.value) == null || n.blur(), !f.value.length)) return;
128
- (s = u.value) == null || s.focusPrevious();
129
- const o = (m = u.value) == null ? void 0 : m.getHighlighted();
130
- o && ((D = a.value) == null || D.focusByHash(o.valueHash));
131
- }, ce = (e) => {
132
- var n, s, m, D;
133
- if (!w.value || !t.multiple || l.value || (e.preventDefault(), (n = a.value) == null || n.blur(), !f.value.length)) return;
134
- (s = u.value) == null || s.focusNext();
135
- const o = (m = u.value) == null ? void 0 : m.getHighlighted();
136
- o && ((D = a.value) == null || D.focusByHash(o.valueHash));
137
- }, fe = async () => {
138
- var e, o;
139
- if (w.value) {
140
- if (!c.value)
141
- await O(), await L(t.transitionDuration), f.value.length && ((e = a.value) == null || e.focusFirstSelected());
142
- else if ((o = a.value) != null && o.getHighlighted())
143
- a.value.confirmOption();
144
- else if (t.addOptions) {
145
- if (t.itemText || t.itemValue) {
146
- const { error: s } = Xe();
147
- s(
148
- `Adding an option for mapped items is not supported. You can't create an option while passing "item-text" or "item-value".`
149
- );
150
- return;
151
- }
152
- const n = l.value.trim();
153
- if (ke(n)) return;
154
- he(), _(Ye(Ie.value));
122
+ }, w = y(() => !(t.readonly || t.disabled || O.value || !r.value && t.multiple)), be = async () => {
123
+ var e, l, o;
124
+ w.value && ((e = r.value) == null || e.blur(), m.value ? (l = n.value) == null || l.focusPrevious() : (await I(), await E(t.transitionDuration), (o = n.value) == null || o.focusLastSelected()));
125
+ }, ge = async () => {
126
+ var e, l, o;
127
+ w.value && ((e = r.value) == null || e.blur(), m.value ? (l = n.value) == null || l.focusNext() : (await I(), await E(t.transitionDuration), (o = n.value) == null || o.focusFirstSelected()));
128
+ }, we = (e) => {
129
+ var o, d, v, C;
130
+ if (!w.value || !t.multiple || a.value || (e.preventDefault(), (o = n.value) == null || o.blur(), !s.value.length)) return;
131
+ (d = r.value) == null || d.focusPrevious();
132
+ const l = (v = r.value) == null ? void 0 : v.getHighlighted();
133
+ l && ((C = n.value) == null || C.focusByHash(l.valueHash));
134
+ }, Be = (e) => {
135
+ var o, d, v, C;
136
+ if (!w.value || !t.multiple || a.value || (e.preventDefault(), (o = n.value) == null || o.blur(), !s.value.length)) return;
137
+ (d = r.value) == null || d.focusNext();
138
+ const l = (v = r.value) == null ? void 0 : v.getHighlighted();
139
+ l && ((C = n.value) == null || C.focusByHash(l.valueHash));
140
+ }, Ve = async () => {
141
+ var l, o;
142
+ if (!w.value)
143
+ return;
144
+ if (m.value) {
145
+ if ((o = n.value) != null && o.getHighlighted()) {
146
+ n.value.confirmOption();
147
+ return;
155
148
  }
149
+ } else {
150
+ await I(), await E(t.transitionDuration), s.value.length && ((l = n.value) == null || l.focusFirstSelected());
151
+ return;
152
+ }
153
+ const e = a.value.trim();
154
+ Ee(e) || (u("option:add", e), a.value = "");
155
+ }, Ie = async () => {
156
+ m.value && await k();
157
+ }, ke = async () => {
158
+ var e, l;
159
+ !w.value || a.value || !s.value.length || ((e = r.value) != null && e.getHighlighted() && r.value.confirmOption(), await _(), (l = r.value) == null || l.focusPrevious());
160
+ }, a = f(""), {
161
+ getter: M,
162
+ debouncedGetter: Ce,
163
+ items: Se,
164
+ loading: j
165
+ } = ct({
166
+ items: x(t, "items"),
167
+ debounce: t.queryDebounceTime
168
+ }), P = () => {
169
+ var e, l;
170
+ t.enforceCoherence && !Y.value && (t.multiple ? u("update:modelValue", Me.value.coherent) : u("update:modelValue", null), (e = r.value) == null || e.blur(), (l = n.value) == null || l.blur());
171
+ }, {
172
+ hasPrefilled: J,
173
+ isPrefilling: De,
174
+ prefill: $e
175
+ } = pt({
176
+ onStart: t.prefill === !0,
177
+ currentValue: t.modelValue,
178
+ multiple: t.multiple,
179
+ fn: async ({ prefill: e }) => {
180
+ await M(a.value, e, t.modelValue), P(), b();
156
181
  }
157
- }, me = async () => {
158
- c.value && await C();
159
- }, ve = async () => {
160
- var e, o;
161
- !w.value || l.value || !f.value.length || ((e = u.value) != null && e.getHighlighted() && u.value.confirmOption(), await _e(), (o = u.value) == null || o.focusPrevious());
162
- }, ye = t.prefill === !0 || !t.multiple && Je(t.modelValue) || t.multiple && !!t.modelValue.length, {
163
- query: l,
164
- alignQueryToState: be,
165
- addCurrentQueryToManualItems: he,
166
- innerLoading: Q,
167
- options: K,
168
- selectedOptions: f,
169
- selectOption: ge,
170
- unselectOption: we,
171
- prefillItems: Be,
172
- isPrefilling: Oe,
173
- hasPrefilled: Ce,
174
- updateModelValue: De,
175
- valueIsSelected: ke,
176
- manualItems: Ie,
177
- searchByQuery: Ve
178
- } = Ze({
179
- emit: h,
182
+ }), {
183
+ array: Oe,
184
+ add: xe,
185
+ remove: Te,
186
+ set: He
187
+ } = mt(), s = y(() => $.value.filter((e) => e.selected)), Ae = y(() => s.value.length ? "" : t.placeholder), { data: Q, get: Ee } = oe({
188
+ items: x(t, "modelValue")
189
+ }), { options: $ } = ft({
190
+ disabled: x(t, "disabled"),
191
+ items: y(() => [...Se.value, ...Oe.value]),
180
192
  itemText: t.itemText,
181
193
  itemValue: t.itemValue,
182
- modelValue: V(t, "modelValue"),
183
194
  max: t.max,
184
- multiple: t.multiple,
185
- resetQueryOnOptionSelected: t.resetQueryOnOptionSelected,
186
- stash: t.stash,
187
- items: V(t, "items"),
188
- enforceCoherence: t.enforceCoherence,
189
- prefill: ye,
190
- modelValueDebounceTime: t.modelValueDebounceTime,
191
- dependencies: V(t, "dependencies"),
192
- depsDebounceTime: t.depsDebounceTime,
193
- queryDebounceTime: t.queryDebounceTime,
194
- disabled: V(t, "disabled")
195
- }), Se = y(() => f.value.length ? "" : t.placeholder), I = y(() => !!(Q.value || t.loading)), $e = y(() => {
195
+ selectable: !0,
196
+ selectedIndexedByHash: Q
197
+ }), O = y(() => !!(j.value || t.loading)), Fe = y(() => {
196
198
  let e = [];
197
- const o = f.value.some(
198
- (s) => s.text === l.value
199
+ const l = s.value.some(
200
+ (d) => d.text === a.value
199
201
  );
200
- return (t.multiple && l.value || l.value && !o && !t.multiple) && t.filterBy ? e = K.value.filter((s) => {
201
- let m = !1;
202
- return typeof t.filterBy == "function" ? m = t.filterBy(s.value, s.item) : Array.isArray(t.filterBy) && t.filterBy.length && (m = m || j(s.item, t.filterBy, l.value.trim())), m || j(s, ["text"], l.value.trim());
203
- }) : e = K.value, e;
204
- }), _ = (e) => {
205
- ge(e), x(), t.multiple || C();
206
- }, U = (e) => {
207
- we(e), x();
208
- }, c = v(!1), E = v(!0), F = v(!1), O = async () => {
209
- F.value = !0, await at(() => !!a.value), E.value = !1, c.value = !0;
210
- }, C = async () => {
202
+ return (t.multiple && a.value || a.value && !l && !t.multiple) && t.filterBy ? e = $.value.filter((d) => {
203
+ let v = !1;
204
+ return typeof t.filterBy == "function" ? v = t.filterBy(d.value, d.item) : Array.isArray(t.filterBy) && t.filterBy.length && (v = v || ae(d.item, t.filterBy, a.value.trim())), v || ae(d, ["text"], a.value.trim());
205
+ }) : e = $.value, e;
206
+ }), b = () => {
207
+ if (t.multiple) {
208
+ a.value = "";
209
+ return;
210
+ }
211
+ let e;
212
+ s.value && (e = tt(s.value)), a.value = (e == null ? void 0 : e.text) || "";
213
+ }, Le = async (e) => {
214
+ t.multiple ? (u("update:modelValue", t.modelValue.concat(e.value)), t.stash && xe(e.item), b()) : (t.stash && He(e.item), u("update:modelValue", e.value), await _(), b()), q(), t.multiple || k();
215
+ }, X = async (e) => {
216
+ if (Te((l) => l.valueHash !== e.valueHash), t.multiple) {
217
+ const l = { ...Q.value };
218
+ delete l[e.valueHash], u("update:modelValue", Object.values(l));
219
+ } else
220
+ u("update:modelValue", null), await _(), b();
221
+ q();
222
+ }, { data: qe } = oe({
223
+ items: $,
224
+ key: "valueHash"
225
+ }), { coherent: Y, status: Me } = vt({
226
+ modelValue: x(t, "modelValue"),
227
+ multiple: t.multiple,
228
+ iteratee: (e) => !!qe.value[yt(e)]
229
+ });
230
+ let B = 0;
231
+ ne(
232
+ () => t.modelValue,
233
+ async () => {
234
+ B++, Y.value || (await M(a.value, !1, t.modelValue), P()), B === 1 && b(), B--;
235
+ },
236
+ {
237
+ debounce: t.modelValueDebounceTime
238
+ }
239
+ ), ne(
240
+ () => [t.dependencies, t.items],
241
+ async () => {
242
+ J.value && (B++, await M(a.value, !1, t.modelValue), B === 1 && (P(), b()), B--);
243
+ },
244
+ {
245
+ debounce: t.depsDebounceTime
246
+ }
247
+ );
248
+ const m = f(!1), z = f(!0), N = f(!1), I = async () => {
249
+ N.value = !0, await st(() => !!n.value), z.value = !1, m.value = !0;
250
+ }, k = async () => {
211
251
  var e;
212
- c.value = !1, E.value = !0, (e = u.value) == null || e.blur();
213
- }, Te = () => c.value ? C() : O(), M = v(!1), Le = () => {
214
- M.value = !0;
215
- }, Ae = () => {
216
- M.value = !1, h("inactive");
217
- }, qe = (e) => {
218
- e.preventDefault(), h("click", e), !(t.disabled || t.readonly) && (x(), Te());
219
- }, xe = et(
252
+ m.value = !1, z.value = !0, (e = r.value) == null || e.blur();
253
+ }, Pe = () => m.value ? k() : I(), W = f(!1), ze = () => {
254
+ W.value = !0;
255
+ }, Ne = () => {
256
+ W.value = !1, u("inactive");
257
+ }, We = (e) => {
258
+ e.preventDefault(), u("click", e), !(t.disabled || t.readonly) && (q(), Pe());
259
+ }, Ke = ot(
220
260
  (e) => typeof e != "string",
221
261
  JSON.stringify
222
- ), Ee = y(() => [].concat(t.modelValue).map((e) => {
223
- const o = xe(e);
262
+ ), _e = y(() => [].concat(t.modelValue).map((e) => {
263
+ const l = Ke(e);
224
264
  return {
225
265
  disabled: t.disabled,
226
266
  name: t.name,
227
267
  type: "hidden",
228
- value: o
268
+ value: l
229
269
  };
230
270
  }));
231
- return (e, o) => (b(), S(lt, {
271
+ return (e, l) => (h(), T(rt, {
232
272
  ref_key: "outerContainer",
233
- ref: A,
234
- class: W({
273
+ ref: F,
274
+ class: Z({
235
275
  "bb-base-select": !0,
236
- "bb-base-select--active": M.value,
237
- "bb-base-select--shown": c.value,
238
- "bb-base-select--loading": I.value,
276
+ "bb-base-select--active": W.value,
277
+ "bb-base-select--shown": m.value,
278
+ "bb-base-select--loading": O.value,
239
279
  "bb-base-select--disabled": e.disabled,
240
280
  "bb-base-select--errors": e.hasErrors,
241
281
  "bb-base-select--readonly": e.readonly,
242
282
  "bb-base-select--compact": e.compact
243
283
  }),
244
- onClick: qe
284
+ onClick: We
245
285
  }, {
246
- "prepend-outer": r(() => [
247
- p(e.$slots, "prepend-outer", { query: i(l) })
286
+ "prepend-outer": i(() => [
287
+ c(e.$slots, "prepend-outer", { query: a.value })
248
288
  ]),
249
- "append-outer": r(() => [
250
- p(e.$slots, "append-outer", { query: i(l) })
289
+ "append-outer": i(() => [
290
+ c(e.$slots, "append-outer", { query: a.value })
251
291
  ]),
252
- default: r(() => [
253
- N(nt, {
292
+ default: i(() => [
293
+ K(ut, {
254
294
  ref_key: "innerContainer",
255
- ref: B,
295
+ ref: V,
256
296
  "append:icon": t["append:icon"],
257
297
  "prepend:icon": t["prepend:icon"],
258
298
  "prevent-focus": !0
259
299
  }, {
260
- prepend: r(() => [
261
- p(e.$slots, "prepend", { query: i(l) })
300
+ prepend: i(() => [
301
+ c(e.$slots, "prepend", { query: a.value })
262
302
  ]),
263
- prefix: r(() => [
264
- p(e.$slots, "prefix")
303
+ prefix: i(() => [
304
+ c(e.$slots, "prefix")
265
305
  ]),
266
- append: r(() => [
267
- p(e.$slots, "append", { query: i(l) })
306
+ append: i(() => [
307
+ c(e.$slots, "append", { query: a.value })
268
308
  ]),
269
- suffix: r(() => [
270
- p(e.$slots, "suffix")
309
+ suffix: i(() => [
310
+ c(e.$slots, "suffix")
271
311
  ]),
272
- default: r(() => [
273
- N(i(Re), { tag: "span" }, {
274
- default: r(() => [
275
- $("span", dt, [
276
- e.multiple && i(f).length <= e.maxSelectedLabels ? (b(), T(R, { key: 0 }, [
277
- e.comma ? (b(), S(ot, {
312
+ default: i(() => [
313
+ K(S(et), { tag: "span" }, {
314
+ default: i(() => [
315
+ H("span", Bt, [
316
+ e.multiple && s.value.length <= e.maxSelectedLabels ? (h(), A(ee, { key: 0 }, [
317
+ e.comma ? (h(), T(it, {
278
318
  key: 0,
279
319
  ref_key: "commaBox",
280
- ref: H,
281
- options: i(f)
282
- }, null, 8, ["options"])) : (b(), S(tt, {
320
+ ref: U,
321
+ options: s.value
322
+ }, null, 8, ["options"])) : (h(), T(nt, {
283
323
  key: 1,
284
324
  ref_key: "chipsBox",
285
- ref: P,
286
- options: i(f),
287
- "onOption:unselected": U
325
+ ref: G,
326
+ options: s.value,
327
+ "onOption:unselected": X
288
328
  }, null, 8, ["options"]))
289
- ], 64)) : e.multiple ? (b(), T("span", ct, Ne(i(f).length) + " elementi selezionati ", 1)) : J("", !0),
290
- He($("input", {
291
- id: i(z),
329
+ ], 64)) : e.multiple ? (h(), A("span", Vt, Re(s.value.length) + " elementi selezionati ", 1)) : te("", !0),
330
+ je(H("input", {
331
+ id: S(R),
292
332
  ref_key: "input",
293
- ref: q,
294
- "onUpdate:modelValue": o[0] || (o[0] = (n) => Pe(l) ? l.value = n : null),
333
+ ref: L,
334
+ "onUpdate:modelValue": l[0] || (l[0] = (o) => a.value = o),
295
335
  "aria-autocomplete": "list",
296
- "aria-controls": F.value ? `${i(z)}_listbox` : void 0,
336
+ "aria-controls": N.value ? `${S(R)}_listbox` : void 0,
297
337
  "aria-describedby": e.ariaDescribedby,
298
- "aria-expanded": c.value,
338
+ "aria-expanded": m.value,
299
339
  autocomplete: e.autocomplete,
300
340
  autofocus: e.autofocus,
301
- class: W("bb-base-select__text-input"),
341
+ class: Z("bb-base-select__text-input"),
302
342
  disabled: e.disabled,
303
- inputmode: te.value,
304
- placeholder: Se.value,
343
+ inputmode: de.value,
344
+ placeholder: Ae.value,
305
345
  readonly: e.readonly || !e.allowWriting,
306
346
  required: e.required && !e.multiple || e.multiple && !e.modelValue.length,
307
347
  role: "combobox",
308
348
  size: "1",
309
349
  type: "text",
310
- onBlur: d(ie, ["stop"]),
311
- onChange: d(re, ["stop"]),
312
- onFocusOnce: d(ae, ["stop"]),
313
- onFocus: d(le, ["stop"]),
314
- onInput: d(se, ["stop"]),
350
+ onBlur: p(ve, ["stop"]),
351
+ onChange: p(ye, ["stop"]),
352
+ onFocusOnce: p(fe, ["stop"]),
353
+ onFocus: p(me, ["stop"]),
354
+ onInput: p(he, ["stop"]),
315
355
  onKeydown: [
316
- g(d(ve, ["stop"]), ["delete"]),
317
- g(d(de, ["stop"]), ["left"]),
318
- g(d(pe, ["stop", "prevent"]), ["down"]),
319
- g(d(fe, ["stop", "prevent"]), ["enter"]),
320
- g(d(me, ["stop", "prevent"]), ["esc"]),
321
- g(d(ue, ["stop", "prevent"]), ["up"]),
322
- g(d(ce, ["stop"]), ["right"])
356
+ g(p(ke, ["stop"]), ["delete"]),
357
+ g(p(we, ["stop"]), ["left"]),
358
+ g(p(ge, ["stop", "prevent"]), ["down"]),
359
+ g(p(Ve, ["stop", "prevent"]), ["enter"]),
360
+ g(p(Ie, ["stop", "prevent"]), ["esc"]),
361
+ g(p(be, ["stop", "prevent"]), ["up"]),
362
+ g(p(Be, ["stop"]), ["right"])
323
363
  ]
324
- }, null, 40, ft), [
325
- [ze, i(l)]
364
+ }, null, 40, It), [
365
+ [Je, a.value]
326
366
  ])
327
367
  ])
328
368
  ]),
329
369
  _: 1
330
370
  }),
331
- p(e.$slots, "chevron", {
332
- loading: !!i(Q),
333
- shown: c.value
371
+ c(e.$slots, "chevron", {
372
+ loading: !!S(j),
373
+ shown: m.value
334
374
  }, () => [
335
- o[1] || (o[1] = $("svg", {
375
+ l[1] || (l[1] = H("svg", {
336
376
  class: "bb-base-select__chevron",
337
377
  viewBox: "0 0 24 24",
338
378
  xmlns: "http://www.w3.org/2000/svg"
339
379
  }, [
340
- $("path", {
380
+ H("path", {
341
381
  d: "M7.41 8.58L12 13.17l4.59-4.59L18 10l-6 6l-6-6z",
342
382
  fill: "currentColor"
343
383
  })
@@ -346,53 +386,53 @@ const dt = { class: "bb-base-select__input-container" }, ct = {
346
386
  ]),
347
387
  _: 3
348
388
  }, 8, ["append:icon", "prepend:icon"]),
349
- (b(!0), T(R, null, Qe(Ee.value, (n) => (b(), T("input", Y({
350
- key: n.value,
389
+ (h(!0), A(ee, null, Qe(_e.value, (o) => (h(), A("input", le({
390
+ key: o.value,
351
391
  ref_for: !0
352
- }, n), null, 16))), 128)),
353
- F.value ? (b(), S(it, { key: 0 }, {
354
- default: r(() => [
355
- N(i(Z), {
392
+ }, o), null, 16))), 128)),
393
+ N.value ? (h(), T(dt, { key: 0 }, {
394
+ default: i(() => [
395
+ K(S(re), {
356
396
  ref_key: "optionsContainer",
357
- ref: a,
397
+ ref: n,
358
398
  compact: e.compact,
359
- loading: I.value,
399
+ loading: O.value,
360
400
  "loading-text": e.loadingText,
361
401
  "no-data-text": e.noDataText,
362
- open: c.value,
363
- options: $e.value,
364
- style: Ke(ne.value),
365
- "onOption:selected": _,
366
- "onOption:unselected": U
402
+ open: m.value,
403
+ options: Fe.value,
404
+ style: Xe(pe.value),
405
+ "onOption:selected": Le,
406
+ "onOption:unselected": X
367
407
  }, {
368
- "options:prepend": r(() => [
369
- p(e.$slots, "options:prepend")
408
+ "options:prepend": i(() => [
409
+ c(e.$slots, "options:prepend")
370
410
  ]),
371
- loading: r(() => [
372
- p(e.$slots, "loading", { query: i(l) })
411
+ loading: i(() => [
412
+ c(e.$slots, "loading", { query: a.value })
373
413
  ]),
374
- "no-data": r(() => [
375
- p(e.$slots, "no-data", { query: i(l) })
414
+ "no-data": i(() => [
415
+ c(e.$slots, "no-data", { query: a.value })
376
416
  ]),
377
- "options:append": r(() => [
378
- p(e.$slots, "options:append")
417
+ "options:append": i(() => [
418
+ c(e.$slots, "options:append")
379
419
  ]),
380
- option: r((n) => [
381
- p(e.$slots, "option", Y({
420
+ option: i((o) => [
421
+ c(e.$slots, "option", le({
382
422
  hasErrors: e.hasErrors,
383
- loading: I.value
384
- }, n))
423
+ loading: O.value
424
+ }, o))
385
425
  ]),
386
426
  _: 3
387
427
  }, 8, ["compact", "loading", "loading-text", "no-data-text", "open", "options", "style"])
388
428
  ]),
389
429
  _: 3
390
- })) : J("", !0)
430
+ })) : te("", !0)
391
431
  ]),
392
432
  _: 3
393
433
  }, 8, ["class"]));
394
434
  }
395
435
  });
396
436
  export {
397
- Pt as default
437
+ tl as default
398
438
  };