bitboss-ui 2.0.0 → 2.0.2
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.
- package/dist/components/BbTable/BbTable.vue.d.ts +3 -0
- package/dist/index105.js +5 -5
- package/dist/index105.js.map +1 -1
- package/dist/index113.js +1 -1
- package/dist/index115.js +2 -2
- package/dist/index117.js +1 -1
- package/dist/index12.js +1 -1
- package/dist/index121.js +1 -1
- package/dist/index122.js +1 -1
- package/dist/index123.js +1 -1
- package/dist/index128.js +1 -1
- package/dist/index14.js +3 -3
- package/dist/index16.js +2 -2
- package/dist/index18.js +8 -8
- package/dist/index199.js +158 -3
- package/dist/index199.js.map +1 -1
- package/dist/index20.js +5 -5
- package/dist/index200.js +84 -3
- package/dist/index200.js.map +1 -1
- package/dist/index202.js +3 -6
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +35 -7
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +5 -4
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +7 -2
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +5 -4
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +5 -2
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +14 -279
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +10 -10
- package/dist/index209.js.map +1 -1
- package/dist/index210.js +18 -15
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +18 -18
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +22 -14
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +8 -27
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +2 -8
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +2 -2
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +4 -158
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +2 -84
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +6 -0
- package/dist/index218.js.map +1 -0
- package/dist/index219.js +2 -2
- package/dist/index22.js +5 -5
- package/dist/index220.js +2 -2
- package/dist/index223.js +1 -1
- package/dist/index225.js +1 -1
- package/dist/index226.js +3 -3
- package/dist/index234.js +1 -1
- package/dist/index237.js +3 -224
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +11 -8
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +9 -23
- package/dist/index239.js.map +1 -1
- package/dist/index24.js +1 -1
- package/dist/index240.js +9 -431
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +15 -87
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +431 -6
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +89 -16
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +199 -3
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +7 -198
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +23 -6
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +6 -2
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +16 -2
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +9 -2
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +281 -2
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +6 -2
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +2 -2
- package/dist/index253.js +2 -3
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +2 -12
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +2 -9
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +2 -9
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +2 -17
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +4 -9
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +224 -2
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +3 -126
- package/dist/index260.js.map +1 -1
- package/dist/index262.js +10 -0
- package/dist/index262.js.map +1 -0
- package/dist/index263.js +2 -7
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +69 -2
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +5 -69
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +2 -436
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +120 -121
- package/dist/index267.js.map +1 -1
- package/dist/index270.js +1 -1
- package/dist/index272.js +431 -23
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +127 -5
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +26 -13
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +15 -4
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +11 -4
- package/dist/index276.js.map +1 -1
- package/dist/index277.js +4 -59
- package/dist/index277.js.map +1 -1
- package/dist/index278.js +4 -11
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +58 -34
- package/dist/index279.js.map +1 -1
- package/dist/index28.js +2 -2
- package/dist/index280.js +34 -46
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +1 -1
- package/dist/index282.js +50 -0
- package/dist/index282.js.map +1 -0
- package/dist/index284.js +416 -42
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +50 -0
- package/dist/index285.js.map +1 -0
- package/dist/index30.js +2 -2
- package/dist/index32.js +2 -2
- package/dist/index34.js +38 -37
- package/dist/index34.js.map +1 -1
- package/dist/index36.js +1 -1
- package/dist/index38.js +2 -2
- package/dist/index40.js +2 -2
- package/dist/index42.js +2 -2
- package/dist/index52.js +1 -1
- package/dist/index54.js +1 -1
- package/dist/index70.js +2 -2
- package/dist/index74.js +2 -2
- package/dist/index76.js +1 -1
- package/dist/index79.js +2 -2
- package/dist/index81.js +1 -1
- package/dist/index83.js +1 -1
- package/package.json +1 -1
- package/dist/index201.js +0 -38
- package/dist/index201.js.map +0 -1
- package/dist/index261.js +0 -6
- package/dist/index261.js.map +0 -1
- package/dist/index283.js +0 -424
- package/dist/index283.js.map +0 -1
package/dist/index32.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as C, ref as g, computed as f, openBlock as i, createElementBlock as l, mergeProps as h, createElementVNode as r, renderSlot as p, Fragment as I, renderList as V, normalizeClass as B, toDisplayString as M } from "vue";
|
|
2
|
-
import { booleanishToBoolean as D } from "./
|
|
2
|
+
import { booleanishToBoolean as D } from "./index217.js";
|
|
3
3
|
import { identity as F } from "./index221.js";
|
|
4
|
-
import { isCssColor as v } from "./
|
|
4
|
+
import { isCssColor as v } from "./index215.js";
|
|
5
5
|
import { isNotNil as T } from "./index129.js";
|
|
6
6
|
const $ = { class: "bb-base-rating__inner-container" }, q = { class: "bb-base-rating__label-text" }, x = ["id", "aria-describedby", "autofocus", "checked", "disabled", "name", "required", "value"], H = ["height", "width"], N = /* @__PURE__ */ r("path", {
|
|
7
7
|
d: "m8.243 7.34l-6.38.925l-.113.023a1 1 0 0 0-.44 1.684l4.622 4.499l-1.09 6.355l-.013.11a1 1 0 0 0 1.464.944l5.706-3l5.693 3l.1.046a1 1 0 0 0 1.352-1.1l-1.091-6.355l4.624-4.5l.078-.085a1 1 0 0 0-.633-1.62l-6.38-.926l-2.852-5.78a1 1 0 0 0-1.794 0L8.243 7.34z",
|
package/dist/index34.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as Me, defineAsyncComponent as Ne, ref as m, computed as y, toRef as
|
|
1
|
+
import { defineComponent as Me, defineAsyncComponent as Ne, ref as m, computed as y, toRef as I, openBlock as b, createBlock as $, normalizeClass as W, withCtx as s, renderSlot as p, unref as r, createVNode as F, createElementVNode as S, createElementBlock as M, Fragment as R, createCommentVNode as J, withDirectives as xe, isRef as He, withModifiers as c, withKeys as g, vModelDynamic as Pe, renderList as _e, mergeProps as Y, Teleport as ze, normalizeStyle as Qe, nextTick as Ke } from "vue";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import { useId as Ue } from "./index7.js";
|
|
4
4
|
import { useMobile as We } from "./index8.js";
|
|
5
5
|
import Re from "./index122.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
import { isNotNil as Je } from "./index129.js";
|
|
8
|
-
import { last as Ye } from "./
|
|
8
|
+
import { last as Ye } from "./index214.js";
|
|
9
9
|
import { matchAnyKey as j } from "./index228.js";
|
|
10
10
|
import { useFloating as je } from "./index219.js";
|
|
11
11
|
import { useIntersectionObserver as Ge } from "./index127.js";
|
|
12
|
-
import { useLogger as Xe } from "./
|
|
13
|
-
import { useOptions as Ze } from "./
|
|
12
|
+
import { useLogger as Xe } from "./index206.js";
|
|
13
|
+
import { useOptions as Ze } from "./index199.js";
|
|
14
14
|
import { wait as T } from "./index126.js";
|
|
15
|
-
import { when as et } from "./
|
|
15
|
+
import { when as et } from "./index216.js";
|
|
16
16
|
import tt from "./index229.js";
|
|
17
17
|
/* empty css */
|
|
18
18
|
import ot from "./index231.js";
|
|
@@ -20,7 +20,7 @@ import ot from "./index231.js";
|
|
|
20
20
|
import nt from "./index223.js";
|
|
21
21
|
/* empty css */
|
|
22
22
|
import lt from "./index225.js";
|
|
23
|
-
import { waitFor as at } from "./
|
|
23
|
+
import { waitFor as at } from "./index204.js";
|
|
24
24
|
import { autoUpdate as it, flip as rt, offset as st, shift as ut } from "./index226.js";
|
|
25
25
|
const pt = { class: "bb-base-select__input-container" }, ct = ["id", "aria-controls", "aria-describedby", "aria-expanded", "autocomplete", "autofocus", "disabled", "inputmode", "placeholder", "readonly", "required", "onKeydown"], dt = /* @__PURE__ */ S("svg", {
|
|
26
26
|
class: "bb-base-select__chevron",
|
|
@@ -74,11 +74,11 @@ const pt = { class: "bb-base-select__input-container" }, ct = ["id", "aria-contr
|
|
|
74
74
|
const t = G, h = X;
|
|
75
75
|
if (t.multiple && !Array.isArray(t.modelValue))
|
|
76
76
|
throw new Error('Multiple is set to "true" but modelValue is not an array.');
|
|
77
|
-
const Z = Ne(() => import("./index227.js")), A = m(null), B = m(null), a = m(null), N = m(null),
|
|
78
|
-
() => t.comma ? N.value :
|
|
77
|
+
const Z = Ne(() => import("./index227.js")), A = m(null), B = m(null), a = m(null), N = m(null), x = m(null), u = y(
|
|
78
|
+
() => t.comma ? N.value : x.value
|
|
79
79
|
), { isMobile: ee } = We(), te = y(
|
|
80
80
|
() => t.allowWriting === "not-mobile" && ee.value ? "none" : void 0
|
|
81
|
-
),
|
|
81
|
+
), H = t.id || Ue().id.value;
|
|
82
82
|
Ge(
|
|
83
83
|
B,
|
|
84
84
|
([{ intersectionRatio: e }]) => {
|
|
@@ -97,7 +97,8 @@ const pt = { class: "bb-base-select__input-container" }, ct = ["id", "aria-contr
|
|
|
97
97
|
), ne = y(() => {
|
|
98
98
|
var o;
|
|
99
99
|
const e = {
|
|
100
|
-
...oe.value
|
|
100
|
+
...oe.value,
|
|
101
|
+
zIndex: "10"
|
|
101
102
|
};
|
|
102
103
|
return B.value && (e.width = `${(o = B.value) == null ? void 0 : o.$el.clientWidth}px`), e;
|
|
103
104
|
}), q = m(null), E = () => {
|
|
@@ -110,7 +111,7 @@ const pt = { class: "bb-base-select__input-container" }, ct = ["id", "aria-contr
|
|
|
110
111
|
h("blur", e);
|
|
111
112
|
}, re = (e) => h("change", e), se = (e) => {
|
|
112
113
|
var o;
|
|
113
|
-
h("input", e), l.value === "" && (t.multiple || ke(null)), (o = u.value) == null || o.blur(),
|
|
114
|
+
h("input", e), l.value === "" && (t.multiple || ke(null)), (o = u.value) == null || o.blur(), Ie();
|
|
114
115
|
}, k = async (e) => {
|
|
115
116
|
if (e.target instanceof Node && A.value && a.value && !A.value.$el.contains(e.target) && !a.value.$el.contains(e.target)) {
|
|
116
117
|
O(), qe(), document.removeEventListener("click", k), document.removeEventListener("focusin", k), await T(t.transitionDuration), he();
|
|
@@ -151,7 +152,7 @@ const pt = { class: "bb-base-select__input-container" }, ct = ["id", "aria-contr
|
|
|
151
152
|
}
|
|
152
153
|
const n = l.value.trim();
|
|
153
154
|
if (De(n)) return;
|
|
154
|
-
be(),
|
|
155
|
+
be(), z(Ye(Ve.value));
|
|
155
156
|
}
|
|
156
157
|
}
|
|
157
158
|
}, me = async () => {
|
|
@@ -163,7 +164,7 @@ const pt = { class: "bb-base-select__input-container" }, ct = ["id", "aria-contr
|
|
|
163
164
|
query: l,
|
|
164
165
|
alignQueryToState: he,
|
|
165
166
|
addCurrentQueryToManualItems: be,
|
|
166
|
-
innerLoading:
|
|
167
|
+
innerLoading: P,
|
|
167
168
|
options: _,
|
|
168
169
|
selectedOptions: v,
|
|
169
170
|
selectOption: ge,
|
|
@@ -174,24 +175,24 @@ const pt = { class: "bb-base-select__input-container" }, ct = ["id", "aria-contr
|
|
|
174
175
|
updateModelValue: ke,
|
|
175
176
|
valueIsSelected: De,
|
|
176
177
|
manualItems: Ve,
|
|
177
|
-
searchByQuery:
|
|
178
|
+
searchByQuery: Ie
|
|
178
179
|
} = Ze({
|
|
179
180
|
emit: h,
|
|
180
181
|
itemText: t.itemText,
|
|
181
182
|
itemValue: t.itemValue,
|
|
182
|
-
modelValue:
|
|
183
|
+
modelValue: I(t, "modelValue"),
|
|
183
184
|
multiple: t.multiple,
|
|
184
185
|
resetQueryOnOptionSelected: t.resetQueryOnOptionSelected,
|
|
185
186
|
stash: t.stash,
|
|
186
|
-
items:
|
|
187
|
+
items: I(t, "items"),
|
|
187
188
|
enforceCoherence: t.enforceCoherence,
|
|
188
189
|
prefill: ye,
|
|
189
190
|
modelValueDebounceTime: t.modelValueDebounceTime,
|
|
190
|
-
dependencies:
|
|
191
|
+
dependencies: I(t, "dependencies"),
|
|
191
192
|
depsDebounceTime: t.depsDebounceTime,
|
|
192
193
|
queryDebounceTime: t.queryDebounceTime,
|
|
193
|
-
disabled:
|
|
194
|
-
}),
|
|
194
|
+
disabled: I(t, "disabled")
|
|
195
|
+
}), $e = y(() => v.value.length ? "" : t.placeholder), D = y(() => !!(P.value || t.loading)), Te = y(() => {
|
|
195
196
|
let e = [];
|
|
196
197
|
const o = v.value.some(
|
|
197
198
|
(i) => i.text === l.value
|
|
@@ -200,9 +201,9 @@ const pt = { class: "bb-base-select__input-container" }, ct = ["id", "aria-contr
|
|
|
200
201
|
let f = !1;
|
|
201
202
|
return typeof t.filterBy == "function" ? f = t.filterBy(i.value, i.item) : Array.isArray(t.filterBy) && t.filterBy.length && (f = f || j(i.item, t.filterBy, l.value.trim())), f || j(i, ["text"], l.value.trim());
|
|
202
203
|
}) : e = _.value, e;
|
|
203
|
-
}),
|
|
204
|
+
}), z = (e) => {
|
|
204
205
|
ge(e), E(), t.multiple || O();
|
|
205
|
-
},
|
|
206
|
+
}, Q = (e) => {
|
|
206
207
|
we(e), E();
|
|
207
208
|
}, d = m(!1), K = m(!0), U = m(!1), V = async () => {
|
|
208
209
|
U.value = !0, await at(() => !!a.value), K.value = !1, d.value = !0;
|
|
@@ -227,7 +228,7 @@ const pt = { class: "bb-base-select__input-container" }, ct = ["id", "aria-contr
|
|
|
227
228
|
value: o
|
|
228
229
|
};
|
|
229
230
|
}));
|
|
230
|
-
return (e, o) => (b(),
|
|
231
|
+
return (e, o) => (b(), $(lt, {
|
|
231
232
|
ref_key: "outerContainer",
|
|
232
233
|
ref: A,
|
|
233
234
|
class: W({
|
|
@@ -268,26 +269,26 @@ const pt = { class: "bb-base-select__input-container" }, ct = ["id", "aria-contr
|
|
|
268
269
|
default: s(() => [
|
|
269
270
|
S("span", pt, [
|
|
270
271
|
e.multiple ? (b(), M(R, { key: 0 }, [
|
|
271
|
-
e.comma ? (b(),
|
|
272
|
+
e.comma ? (b(), $(ot, {
|
|
272
273
|
key: 0,
|
|
273
274
|
ref_key: "commaBox",
|
|
274
275
|
ref: N,
|
|
275
276
|
options: r(v)
|
|
276
|
-
}, null, 8, ["options"])) : (b(),
|
|
277
|
+
}, null, 8, ["options"])) : (b(), $(tt, {
|
|
277
278
|
key: 1,
|
|
278
279
|
ref_key: "chipsBox",
|
|
279
|
-
ref:
|
|
280
|
+
ref: x,
|
|
280
281
|
options: r(v),
|
|
281
|
-
"onOption:unselected":
|
|
282
|
+
"onOption:unselected": Q
|
|
282
283
|
}, null, 8, ["options"]))
|
|
283
284
|
], 64)) : J("", !0),
|
|
284
|
-
|
|
285
|
-
id: r(
|
|
285
|
+
xe(S("input", {
|
|
286
|
+
id: r(H),
|
|
286
287
|
ref_key: "input",
|
|
287
288
|
ref: q,
|
|
288
|
-
"onUpdate:modelValue": o[0] || (o[0] = (n) =>
|
|
289
|
+
"onUpdate:modelValue": o[0] || (o[0] = (n) => He(l) ? l.value = n : null),
|
|
289
290
|
"aria-autocomplete": "list",
|
|
290
|
-
"aria-controls": `${r(
|
|
291
|
+
"aria-controls": `${r(H)}_listbox`,
|
|
291
292
|
"aria-describedby": e.ariaDescribedby,
|
|
292
293
|
"aria-expanded": d.value,
|
|
293
294
|
autocomplete: e.autocomplete,
|
|
@@ -295,7 +296,7 @@ const pt = { class: "bb-base-select__input-container" }, ct = ["id", "aria-contr
|
|
|
295
296
|
class: W("bb-base-select__text-input"),
|
|
296
297
|
disabled: e.disabled,
|
|
297
298
|
inputmode: te.value,
|
|
298
|
-
placeholder:
|
|
299
|
+
placeholder: $e.value,
|
|
299
300
|
readonly: e.readonly || !e.allowWriting,
|
|
300
301
|
required: e.required && !e.multiple || e.multiple && !e.modelValue.length,
|
|
301
302
|
role: "combobox",
|
|
@@ -315,14 +316,14 @@ const pt = { class: "bb-base-select__input-container" }, ct = ["id", "aria-contr
|
|
|
315
316
|
g(c(de, ["stop"]), ["right"])
|
|
316
317
|
]
|
|
317
318
|
}, null, 40, ct), [
|
|
318
|
-
[
|
|
319
|
+
[Pe, r(l)]
|
|
319
320
|
])
|
|
320
321
|
])
|
|
321
322
|
]),
|
|
322
323
|
_: 1
|
|
323
324
|
}),
|
|
324
325
|
p(e.$slots, "chevron", {
|
|
325
|
-
loading: !!r(
|
|
326
|
+
loading: !!r(P),
|
|
326
327
|
shown: d.value
|
|
327
328
|
}, () => [
|
|
328
329
|
dt
|
|
@@ -335,7 +336,7 @@ const pt = { class: "bb-base-select__input-container" }, ct = ["id", "aria-contr
|
|
|
335
336
|
key: n.value,
|
|
336
337
|
ref_for: !0
|
|
337
338
|
}, n), null, 16))), 128)),
|
|
338
|
-
U.value ? (b(),
|
|
339
|
+
U.value ? (b(), $(ze, {
|
|
339
340
|
key: 0,
|
|
340
341
|
to: "body"
|
|
341
342
|
}, [
|
|
@@ -345,9 +346,9 @@ const pt = { class: "bb-base-select__input-container" }, ct = ["id", "aria-contr
|
|
|
345
346
|
loading: D.value,
|
|
346
347
|
open: d.value,
|
|
347
348
|
options: Te.value,
|
|
348
|
-
style:
|
|
349
|
-
"onOption:selected":
|
|
350
|
-
"onOption:unselected":
|
|
349
|
+
style: Qe(ne.value),
|
|
350
|
+
"onOption:selected": z,
|
|
351
|
+
"onOption:unselected": Q
|
|
351
352
|
}, {
|
|
352
353
|
"options:prepend": s(() => [
|
|
353
354
|
p(e.$slots, "options:prepend")
|
package/dist/index34.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index34.js","sources":["../src/components/BaseSelect/BaseSelect.vue"],"sourcesContent":["<template>\n\t<CommonInputOuterContainer\n\t\tref=\"outerContainer\"\n\t\t:class=\"{\n\t\t\t'bb-base-select': true,\n\t\t\t'bb-base-select--active': active,\n\t\t\t'bb-base-select--shown': shown,\n\t\t\t'bb-base-select--loading': computedLoading,\n\t\t\t'bb-base-select--disabled': disabled,\n\t\t\t'bb-base-select--errors': hasErrors,\n\t\t\t'bb-base-select--readonly': readonly,\n\t\t}\"\n\t\t@click=\"onOuterContainerClick\"\n\t>\n\t\t<template #prepend-outer\n\t\t\t><slot name=\"prepend-outer\" :query=\"query\"></slot\n\t\t></template>\n\n\t\t<CommonInputInnerContainer\n\t\t\tref=\"innerContainer\"\n\t\t\t:append:icon=\"props['append:icon']\"\n\t\t\t:prepend:icon=\"props['prepend:icon']\"\n\t\t>\n\t\t\t<template #prepend><slot name=\"prepend\" :query=\"query\"></slot></template>\n\t\t\t<template #prefix><slot name=\"prefix\" /></template>\n\t\t\t<BbSmoothHeight tag=\"span\">\n\t\t\t\t<span class=\"bb-base-select__input-container\">\n\t\t\t\t\t<template v-if=\"multiple\">\n\t\t\t\t\t\t<template v-if=\"comma\">\n\t\t\t\t\t\t\t<CommaBox ref=\"commaBox\" :options=\"selectedOptions\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t\t<ChipsBox\n\t\t\t\t\t\t\t\tref=\"chipsBox\"\n\t\t\t\t\t\t\t\t:options=\"selectedOptions\"\n\t\t\t\t\t\t\t\t@option:unselected=\"onOptionUnselected\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</template>\n\t\t\t\t\t<input\n\t\t\t\t\t\t:id=\"id\"\n\t\t\t\t\t\tref=\"input\"\n\t\t\t\t\t\tv-model=\"query\"\n\t\t\t\t\t\t:aria-autocomplete=\"'list'\"\n\t\t\t\t\t\t:aria-controls=\"`${id}_listbox`\"\n\t\t\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t\t\t:aria-expanded=\"shown\"\n\t\t\t\t\t\t:autocomplete=\"autocomplete\"\n\t\t\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t\t\t:class=\"'bb-base-select__text-input'\"\n\t\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t\t:inputmode=\"inputmode\"\n\t\t\t\t\t\t:placeholder=\"computedPlaceholder\"\n\t\t\t\t\t\t:readonly=\"readonly || !allowWriting\"\n\t\t\t\t\t\t:required=\"\n\t\t\t\t\t\t\t(required && !multiple) || (multiple && !modelValue.length)\n\t\t\t\t\t\t\"\n\t\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\t\t:type=\"'text'\"\n\t\t\t\t\t\t@blur.stop=\"onInputBlur\"\n\t\t\t\t\t\t@change.stop=\"onInputChange\"\n\t\t\t\t\t\t@focus.once.stop=\"onInputFirstFocus\"\n\t\t\t\t\t\t@focus.stop=\"onInputFocus\"\n\t\t\t\t\t\t@input.stop=\"onInputInput\"\n\t\t\t\t\t\t@keydown.stop.delete=\"onBackspace\"\n\t\t\t\t\t\t@keydown.stop.left=\"onArrowLeft\"\n\t\t\t\t\t\t@keydown.stop.prevent.down=\"onArrowDown\"\n\t\t\t\t\t\t@keydown.stop.prevent.enter=\"onEnter\"\n\t\t\t\t\t\t@keydown.stop.prevent.esc=\"onEscape\"\n\t\t\t\t\t\t@keydown.stop.prevent.up=\"onArrowUp\"\n\t\t\t\t\t\t@keydown.stop.right=\"onArrowRight\"\n\t\t\t\t\t/>\n\t\t\t\t</span>\n\t\t\t</BbSmoothHeight>\n\t\t\t<slot :loading=\"!!innerLoading\" name=\"chevron\" :shown=\"shown\">\n\t\t\t\t<svg\n\t\t\t\t\tclass=\"bb-base-select__chevron\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M7.41 8.58L12 13.17l4.59-4.59L18 10l-6 6l-6-6z\"\n\t\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t\t/>\n\t\t\t\t</svg>\n\t\t\t</slot>\n\t\t\t<slot name=\"append\" :query=\"query\"></slot>\n\t\t\t<template #suffix><slot name=\"suffix\" /></template>\n\t\t</CommonInputInnerContainer>\n\t\t<template #append-outer\n\t\t\t><slot name=\"append-outer\" :query=\"query\"></slot\n\t\t></template>\n\t\t<input v-for=\"input in hiddenInputs\" :key=\"input.value\" v-bind=\"input\" />\n\n\t\t<teleport v-if=\"renderListBox\" to=\"body\">\n\t\t\t<ListBox\n\t\t\t\tref=\"optionsContainer\"\n\t\t\t\t:loading=\"computedLoading\"\n\t\t\t\t:open=\"shown\"\n\t\t\t\t:options=\"filteredOptions\"\n\t\t\t\t:style=\"optionsContainerStyles\"\n\t\t\t\t@option:selected=\"onOptionSelected\"\n\t\t\t\t@option:unselected=\"onOptionUnselected\"\n\t\t\t>\n\t\t\t\t<template #options:prepend><slot name=\"options:prepend\" /></template>\n\t\t\t\t<template #loading><slot name=\"loading\" :query=\"query\" /></template>\n\t\t\t\t<template #no-data><slot name=\"no-data\" :query=\"query\" /></template>\n\t\t\t\t<template #options:append><slot name=\"options:append\" /></template>\n\t\t\t\t<template #option=\"data\"\n\t\t\t\t\t><slot\n\t\t\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t\t\t:loading=\"computedLoading\"\n\t\t\t\t\t\tname=\"option\"\n\t\t\t\t\t\tv-bind=\"data\"\n\t\t\t\t/></template>\n\t\t\t</ListBox>\n\t\t</teleport>\n\t</CommonInputOuterContainer>\n</template>\n\n<script setup lang=\"ts\">\nimport { BbSmoothHeight } from '@/index';\nimport { computed, ref, nextTick, defineAsyncComponent } from 'vue';\nimport { isNotNil } from '@/utilities/functions/isNotNil';\nimport { last } from '@/utilities/functions/last';\nimport { matchAnyKey } from '@/utilities/functions/matchAnyKey';\nimport { toRef } from 'vue';\nimport { useFloating, autoUpdate, flip, shift, offset } from '@floating-ui/vue';\nimport { useId } from '@/composables/useId';\nimport { useIntersectionObserver } from '@vueuse/core';\nimport { useLogger } from '@/composables/useLogger';\nimport { useMobile } from '@/composables/useMobile';\nimport { useOptions } from '@/composables/useOptions';\nimport { wait } from '@/utilities/functions/wait';\nimport { when } from '@/utilities/functions/when';\nimport ChipsBox from '../ChipsBox.vue';\nimport CommaBox from '../CommaBox.vue';\nimport CommonInputInnerContainer from '../CommonInputInnerContainer.vue';\nimport CommonInputOuterContainer from '../CommonInputOuterContainer.vue';\nimport type { HTMLAttributes, InputHTMLAttributes } from 'vue';\nimport type { Option as BaseOption } from '@/types/Option';\nimport { waitFor } from '@/utilities/functions/waitFor';\n\nexport type BaseSelectProps = {\n\t/**\n\t * Allows the user to add options to the list by\n\t * inserting text in the input and pressing ENTER.\n\t * The value and text of the option generated is a\n\t * string equal to what has been inserted.\n\t */\n\taddOptions?: boolean;\n\n\t/**\n\t * Allows typing into the input.\n\t */\n\tallowWriting?: boolean | 'not-mobile';\n\n\t/**\n\t * Name of the icon to be added at the end of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'append:icon'?: string;\n\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tariaDescribedby?: InputHTMLAttributes['aria-describedby'];\n\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tautocomplete?: InputHTMLAttributes['autocomplete'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Sets the display model for selected values to a list\n\t * of comma separated string. In this mode the user\n\t * cannot deselect an option by pressing the close button.\n\t */\n\tcomma?: boolean;\n\n\t/**\n\t * Defines an array of dependencies that will trigger actions in the component upon change.\n\t */\n\tdependencies?: any[];\n\n\t/**\n\t * Timeout used to debounce response to changes to dependencies.\n\t */\n\tdepsDebounceTime?: number;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * If coherence is enforce the input cannot have a modelValue that is incoherent with its current items.\n\t *\n\t * e.g. You cannot set v-model to a user that is not present in the items passed.\n\t *\n\t * modelValue will be reset upon incoherence.\n\t */\n\tenforceCoherence?: boolean;\n\n\t/**\n\t * Defines how the filtering should work.\n\t * In any case options are always filtered by the text displayed but\n\t * they can also take into account other properties of the\n\t * passed elements when this property is a string or an array of string.\n\t * E.g. items could be a list of users and you can filter users by email or phone by passing `['email', 'phone']`\n\t * You can also pass false to not filter anything or a function for more granular control.\n\t *\n\t */\n\tfilterBy?:\n\t\t| string\n\t\t| string[]\n\t\t| false\n\t\t| ((value: any, item: any) => boolean)\n\t\t| null;\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Used to retrieve items can be an array or a function.\n\t */\n\titems:\n\t\t| any[]\n\t\t| ((query: string, prefill: boolean, modelValue: any) => Promise<any[]>)\n\t\t| ((query: string, prefill: boolean, modelValue: any) => any[]);\n\n\t/**\n\t * Defines a path that returns a property of the object to use as text or a function that returns a string\n\t */\n\titemText?: string | ((item: any) => string) | undefined;\n\n\t/**\n\t * Defines a path that returns a property of the object to use as value or a function that returns any value\n\t */\n\titemValue?: string | ((item: any) => string) | undefined;\n\n\t/**\n\t * Sets the component in a loading state, usually triggering some visual styles.\n\t */\n\tloading?: boolean;\n\n\t/**\n\t * String displayed while items are being loaded.\n\t */\n\tloadingText?: string;\n\n\t/**\n\t * Used by v-model. Can be any serializable type.\n\t */\n\tmodelValue: any;\n\n\t/**\n\t * Timeout used to debounce response to changes to modelValue.\n\t */\n\tmodelValueDebounceTime?: number;\n\n\t/**\n\t * Allows the selection of multiple items.\n\t */\n\tmultiple?: boolean;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * String displayed when there are no items to display.\n\t */\n\tnoDataText?: string;\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Defines the prefill strategy for the input. By default the input will prefill\n\t * on focus. It can also always prefill with `true` and only prefill on search with `false`.\n\t */\n\tprefill?: boolean | 'focus';\n\n\t/**\n\t * Name of the icon to be added at the start of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'prepend:icon'?: string;\n\n\t/**\n\t * Time to wait when the users stops writing in the input before querying data.\n\t * Especially useful when searching live data on big datasets.\n\t */\n\tqueryDebounceTime?: number;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: boolean;\n\n\t/**\n\t * Sets the input as required.\n\t */\n\trequired?: boolean;\n\n\t/**\n\t * If `true` when in multiple selection, reset the query immediately\n\t * upon selecting an option. By default the query is\n\t * not reset until focus is lost so the user can search\n\t * for \"Cath\" and select \"Cathy\" and then write more to\n\t * search for \"Catherine\"\n\t */\n\tresetQueryOnOptionSelected?: boolean;\n\n\t/**\n\t * Adds a stash to accumulate selected values. Especially\n\t * useful when searching in a big database of items.\n\t * E.g. if you search for \"John\" and then search for \"Richard\"\n\t * you either always return the previous items or you stash them passing `true` to this option.\n\t */\n\tstash?: boolean;\n\n\t/**\n\t * How long the transition has to last in milliseconds\n\t */\n\ttransitionDuration?: number;\n\n\t/**\n\t * Pass `true` if the dropdown is not updating following movement in the UI, like in modals. Very expensive so use with care.\n\t */\n\tupdateOnAnimationFrame?: boolean;\n};\nexport type BaseSelectEvents = {\n\t(e: 'blur', event: FocusEvent): void;\n\t(e: 'change', event: Event): void;\n\t(e: 'click', event: MouseEvent): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'inactive'): void;\n\t(e: 'input', event: Event): void;\n\t(e: 'update:modelValue', value: any): void;\n};\n\nexport type BaseSelectSlots = {\n\tappend?: (props: { query: string }) => any;\n\t'append-outer'?: (props: { query: string }) => any;\n\tchevron?: (props: { loading: boolean; shown: boolean }) => any;\n\tchip?: (props: {\n\t\tdisabled: boolean | undefined;\n\t\thasErrors?: boolean;\n\t\tindex: number;\n\t\titem: any;\n\t\tloading: boolean;\n\t\tmanual: boolean;\n\t\tselected: boolean | undefined;\n\t\ttext: string;\n\t\tvalue: any;\n\t}) => any;\n\tloading?: (props: { query: string }) => any;\n\t'no-data'?: (props: { query: string }) => any;\n\toption?: (props: {\n\t\tdisabled: boolean;\n\t\tfocused: boolean;\n\t\tindex: number;\n\t\thasErrors?: boolean;\n\t\titem: any;\n\t\tloading: boolean;\n\t\tselected: boolean;\n\t\ttext: string;\n\t\tvalue: any;\n\t}) => any;\n\t'option:append'?: (props: { item: any }) => any;\n\t'option:prepend'?: (props: { item: any }) => any;\n\t'options:append'?: (props: object) => any;\n\t'options:prepend'?: (props: object) => any;\n\tprefix?: (props: object) => any;\n\tprepend?: (props: { query: string }) => any;\n\t'prepend-outer'?: (props: { query: string }) => any;\n\tsuffix?: (props: object) => any;\n};\n\nconst props = withDefaults(defineProps<BaseSelectProps>(), {\n\tallowWriting: true,\n\tdepsDebounceTime: 0,\n\tdependencies: () => [],\n\tfilterBy: () => [],\n\tloadingText: 'Caricamento...',\n\tmodelValueDebounceTime: 0,\n\tnoDataText: 'Nessun elemento da visualizzare',\n\tprefill: 'focus',\n\tqueryDebounceTime: 500,\n\ttransitionDuration: 300,\n\tupdateOnAnimationFrame: false,\n});\n\nconst emit = defineEmits<BaseSelectEvents>();\n\ndefineSlots<BaseSelectSlots>();\n\nif (props.multiple && !Array.isArray(props.modelValue)) {\n\tthrow new Error('Multiple is set to \"true\" but modelValue is not an array.');\n}\n\n/**\n * START ELEMENT REFERENCES\n */\nconst ListBox = defineAsyncComponent(() => import('../ListBox.vue'));\nconst outerContainer = ref<InstanceType<\n\ttypeof CommonInputOuterContainer\n> | null>(null);\nconst innerContainer = ref<InstanceType<\n\ttypeof CommonInputInnerContainer\n> | null>(null);\nconst optionsContainer = ref<InstanceType<typeof ListBox> | null>(null);\nconst commaBox = ref<InstanceType<typeof CommaBox> | null>(null);\nconst chipsBox = ref<InstanceType<typeof ChipsBox> | null>(null);\nconst selectedBox = computed(() =>\n\tprops.comma ? commaBox.value : chipsBox.value\n);\n/**\n * END ELEMENT REFERENCES\n */\n\nconst { isMobile } = useMobile();\nconst inputmode = computed(() =>\n\tprops.allowWriting === 'not-mobile' && isMobile.value ? 'none' : undefined\n);\n\n// Always provide an id so that inputs can be focussed by clicking oin the label\nconst id = props.id || useId().id.value;\n\nuseIntersectionObserver(\n\tinnerContainer,\n\t([{ intersectionRatio }]) => {\n\t\tif (intersectionRatio !== 1) {\n\t\t\tclose();\n\t\t}\n\t},\n\t{ threshold: [0, 1] }\n);\n\nconst { floatingStyles } = useFloating(\n\tinnerContainer,\n\toptionsContainer as any,\n\t{\n\t\tplacement: 'bottom',\n\t\twhileElementsMounted: autoUpdate,\n\t\tmiddleware: [flip(), offset(5), shift()],\n\t}\n);\n\nconst optionsContainerStyles = computed(() => {\n\tconst base: Record<string, any> = {\n\t\t...floatingStyles.value,\n\t};\n\tif (innerContainer.value) {\n\t\tbase.width = `${innerContainer.value?.$el.clientWidth}px`;\n\t}\n\n\treturn base;\n});\n\n/**\n * START INPUT HANDLING\n */\nconst input = ref<HTMLElement | null>(null);\nconst focusInput = () => {\n\tif (input.value instanceof HTMLInputElement) {\n\t\tinput.value.focus();\n\t}\n};\n\n/**\n * When the focus goes to the input we select the current text\n * so the user can replace or delete it.\n * On top of that if the prefill strategy is to prefill on first focus and options\n * weren't already retrieved by the watcher on mount, we do that\n */\nconst onInputFocus = async (event: FocusEvent) => {\n\temit('focus', event);\n\tsetActive();\n\tdocument.addEventListener('click', onOutsideInteraction);\n\tdocument.addEventListener('focusin', onOutsideInteraction);\n};\n\nconst onInputFirstFocus = () => {\n\tif (props.prefill === 'focus' && !isPrefilling.value && !hasPrefilled.value) {\n\t\tprefillItems();\n\t}\n};\n\nconst onInputBlur = async (event: FocusEvent) => {\n\temit('blur', event);\n};\n\nconst onInputChange = (event: Event) => emit('change', event);\n\n/**\n * Search at every input by the user.\n * When the user deletes the query unselect the current option\n */\nconst onInputInput = (event: Event) => {\n\temit('input', event);\n\tif (query.value === '') {\n\t\tif (!props.multiple) {\n\t\t\tupdateModelValue(null);\n\t\t}\n\t}\n\tselectedBox.value?.blur();\n\tsearchByQuery();\n};\n\n/**\n * On click outside of the container close the panel, remove active state.\n * In multiple selection clear query after a timeout\n */\nconst onOutsideInteraction = async (event: Event) => {\n\tif (event.target instanceof Node) {\n\t\tif (outerContainer.value && optionsContainer.value) {\n\t\t\tif (\n\t\t\t\t!outerContainer.value.$el.contains(event.target) &&\n\t\t\t\t!optionsContainer.value.$el.contains(event.target)\n\t\t\t) {\n\t\t\t\tclose();\n\t\t\t\tsetInactive();\n\t\t\t\tdocument.removeEventListener('click', onOutsideInteraction);\n\t\t\t\tdocument.removeEventListener('focusin', onOutsideInteraction);\n\t\t\t\tawait wait(props.transitionDuration);\n\t\t\t\talignQueryToState();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n};\n\nconst canProcessKeyboardBindings = computed(() => {\n\tif (props.readonly) return false;\n\tif (props.disabled) return false;\n\tif (computedLoading.value) return false;\n\tif (!selectedBox.value && props.multiple) return false;\n\treturn true;\n});\n\n/**\n * On arrow prevent the page from scrolling.\n * Reset horizontal focus\n * When the panel is open\n * - Focus on the previous option\n * When the panel is closed\n * - focus on the first selected option\n */\nconst onArrowUp = async () => {\n\tif (!canProcessKeyboardBindings.value) {\n\t\treturn;\n\t}\n\t// Reset horizontal focus while moving vertically\n\tselectedBox.value?.blur();\n\tif (shown.value) {\n\t\toptionsContainer.value?.focusPrevious();\n\t} else {\n\t\tawait open();\n\t\tawait wait(props.transitionDuration);\n\t\toptionsContainer.value?.focusLastSelected();\n\t}\n};\n\nconst onArrowDown = async () => {\n\tif (!canProcessKeyboardBindings.value) {\n\t\treturn;\n\t}\n\t// Reset horizontal focus while moving vertically\n\tselectedBox.value?.blur();\n\tif (shown.value) {\n\t\toptionsContainer.value?.focusNext();\n\t} else {\n\t\tawait open();\n\t\tawait wait(props.transitionDuration);\n\t\toptionsContainer.value?.focusFirstSelected();\n\t}\n};\n\nconst onArrowLeft = (event: KeyboardEvent) => {\n\tif (!canProcessKeyboardBindings.value) {\n\t\treturn;\n\t}\n\tif (!props.multiple || query.value) {\n\t\treturn;\n\t}\n\tevent.preventDefault();\n\t// Reset vertical focus while moving horizontally\n\toptionsContainer.value?.blur();\n\tif (!selectedOptions.value.length) return;\n\tselectedBox.value?.focusPrevious();\n\tconst highlightedOption = selectedBox.value?.getHighlighted();\n\tif (highlightedOption) {\n\t\toptionsContainer.value?.focusByHash(highlightedOption.valueHash);\n\t}\n};\n\nconst onArrowRight = (event: KeyboardEvent) => {\n\tif (!canProcessKeyboardBindings.value) {\n\t\treturn;\n\t}\n\tif (!props.multiple || query.value) {\n\t\treturn;\n\t}\n\tevent.preventDefault();\n\t// Reset vertical focus while moving horizontally\n\toptionsContainer.value?.blur();\n\tif (!selectedOptions.value.length) return;\n\tselectedBox.value?.focusNext();\n\tconst highlightedOption = selectedBox.value?.getHighlighted();\n\tif (highlightedOption) {\n\t\toptionsContainer.value?.focusByHash(highlightedOption.valueHash);\n\t}\n};\n\nconst onEnter = async () => {\n\tif (!canProcessKeyboardBindings.value) {\n\t\treturn;\n\t}\n\tif (!shown.value) {\n\t\tawait open();\n\t\tawait wait(props.transitionDuration);\n\t\tif (selectedOptions.value.length) {\n\t\t\toptionsContainer.value?.focusFirstSelected();\n\t\t}\n\t} else if (optionsContainer.value?.getHighlighted()) {\n\t\toptionsContainer.value.confirmOption();\n\t} else if (props.addOptions) {\n\t\tif (props.itemText || props.itemValue) {\n\t\t\tconst { error } = useLogger();\n\t\t\terror(\n\t\t\t\t`Adding an option for mapped items is not supported. You can't create an option while passing \"item-text\" or \"item-value\".`\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tconst text = query.value.trim();\n\t\t// Do not add manual items that are already present\n\t\tif (valueIsSelected(text)) return;\n\t\taddCurrentQueryToManualItems();\n\t\tonOptionSelected(last(manualItems.value)!);\n\t}\n};\n\nconst onEscape = async () => {\n\tif (shown.value) {\n\t\tawait close();\n\t}\n};\n\n/**\n * Delete behavior is different when query is empty\n * If query is empty\n * If no chip is selected - select rightmost chip\n * If a chip is selected - deselect that option\n * If any option remains move focus to that or reset\n */\nconst onBackspace = async () => {\n\tif (\n\t\t!canProcessKeyboardBindings.value ||\n\t\tquery.value ||\n\t\t!selectedOptions.value.length\n\t) {\n\t\treturn;\n\t}\n\tif (selectedBox.value?.getHighlighted()) {\n\t\tselectedBox.value.confirmOption();\n\t}\n\tawait nextTick();\n\tselectedBox.value?.focusPrevious();\n};\n\n/**\n * It should prefill if asked, or\n * when single if modelValue is not null\n * when multiple if modelValue is not empty\n */\nconst shouldPrefill =\n\tprops.prefill === true ||\n\t(!props.multiple && isNotNil(props.modelValue)) ||\n\t(props.multiple && !!props.modelValue.length);\n\nconst {\n\tquery,\n\talignQueryToState,\n\taddCurrentQueryToManualItems,\n\tinnerLoading,\n\toptions,\n\tselectedOptions,\n\tselectOption,\n\tunselectOption,\n\tprefillItems,\n\tisPrefilling,\n\thasPrefilled,\n\tupdateModelValue,\n\tvalueIsSelected,\n\tmanualItems,\n\tsearchByQuery,\n} = useOptions({\n\temit,\n\titemText: props.itemText,\n\titemValue: props.itemValue,\n\tmodelValue: toRef(props, 'modelValue'),\n\tmultiple: props.multiple,\n\tresetQueryOnOptionSelected: props.resetQueryOnOptionSelected,\n\tstash: props.stash,\n\titems: toRef(props, 'items'),\n\tenforceCoherence: props.enforceCoherence,\n\tprefill: shouldPrefill,\n\tmodelValueDebounceTime: props.modelValueDebounceTime,\n\tdependencies: toRef(props, 'dependencies'),\n\tdepsDebounceTime: props.depsDebounceTime,\n\tqueryDebounceTime: props.queryDebounceTime,\n\tdisabled: toRef(props, 'disabled'),\n});\n\nconst computedPlaceholder = computed(() => {\n\tif (selectedOptions.value.length) return '';\n\telse return props.placeholder;\n});\n\nconst computedLoading = computed(() => !!(innerLoading.value || props.loading));\n\n/**\n * Filter options to be displayed based on the current query.\n * If no query is used or when query is set from the inside (after a selection) display all possible options\n */\nconst filteredOptions = computed<BaseOption[]>(() => {\n\tlet base = [];\n\t/** Only filter when a value is being searched not when the query is fully set on a selected option text */\n\tconst queryMatchesASelectedOption = selectedOptions.value.some(\n\t\t(option: BaseOption) => option.text === query.value\n\t);\n\tconst shouldFilter =\n\t\t(props.multiple && query.value) ||\n\t\t(query.value && !queryMatchesASelectedOption && !props.multiple);\n\n\tif (shouldFilter && props.filterBy) {\n\t\tbase = options.value.filter((item: BaseOption) => {\n\t\t\tlet matchedAnything = false;\n\t\t\tif (typeof props.filterBy === 'function')\n\t\t\t\tmatchedAnything = props.filterBy(item.value, item.item);\n\t\t\telse if (Array.isArray(props.filterBy) && props.filterBy.length) {\n\t\t\t\tmatchedAnything =\n\t\t\t\t\tmatchedAnything ||\n\t\t\t\t\tmatchAnyKey(item.item, props.filterBy, query.value.trim());\n\t\t\t}\n\t\t\treturn matchedAnything || matchAnyKey(item, ['text'], query.value.trim());\n\t\t});\n\t\t/** Otherwise default to the whole set of options */\n\t} else base = options.value;\n\n\t/** This is done here so that only visible options are highlighted */\n\treturn base;\n});\n\nconst onOptionSelected = (option: BaseOption) => {\n\tselectOption(option);\n\tfocusInput();\n\tif (!props.multiple) {\n\t\tclose();\n\t}\n};\n\nconst onOptionUnselected = (option: BaseOption) => {\n\tunselectOption(option);\n\tfocusInput();\n};\n\n/**\n * We need the transitions because elements must be hidden and shown\n * to accessibility tools when they are fully closed or fully open,\n * while still being animated for sighted users.\n */\n\n// Option panel is open\nconst shown = ref(false);\n// Option panel il closed\nconst hidden = ref(true);\n\nconst renderListBox = ref(false);\n\nconst open = async () => {\n\trenderListBox.value = true;\n\tawait waitFor(() => !!optionsContainer.value);\n\thidden.value = false;\n\tshown.value = true;\n};\n\nconst close = async () => {\n\tshown.value = false;\n\thidden.value = true;\n\tselectedBox.value?.blur();\n};\n\nconst toggle = () => {\n\tif (shown.value) return close();\n\treturn open();\n};\n\n/**\n * Applies a class when the user is inside this whole component.\n * We cannot use focus within as it doesn't work for elements that are teleported.\n * Also we cannot use the <input/> if we physically move focus to the options so\n * we track it manually.\n */\nconst active = ref(false);\n\nconst setActive = () => {\n\tactive.value = true;\n};\nconst setInactive = () => {\n\tactive.value = false;\n\temit('inactive');\n};\n\n/**\n * When clicking on the outside container seamlessly move focus to the input and open the panel\n */\nconst onOuterContainerClick = (event: MouseEvent) => {\n\tevent.preventDefault();\n\temit('click', event);\n\tif (props.disabled || props.readonly) return;\n\tfocusInput();\n\ttoggle();\n};\n\n/**\n * When using this component for submission we add a bunch of hidden\n * inputs so the submitted inputs are on par with v-model\n */\n/**\n * This is used to keep the value compatible to common html expected values.\n * Convert to string everything that's not but do not double encode strings\n */\nconst makeInputValue = when(\n\t(item: unknown) => typeof item !== 'string',\n\tJSON.stringify\n);\n\nconst hiddenInputs = computed(() => {\n\treturn [].concat(props.modelValue).map((current) => {\n\t\tconst value = makeInputValue(current);\n\t\treturn {\n\t\t\tdisabled: props.disabled,\n\t\t\tname: props.name,\n\t\t\ttype: 'hidden',\n\t\t\tvalue: value,\n\t\t};\n\t});\n});\n</script>\n<style lang=\"postcss\">\n@import '@/assets/css/BaseSelect';\n</style>\n"],"names":["props","__props","emit","__emit","ListBox","defineAsyncComponent","outerContainer","ref","innerContainer","optionsContainer","commaBox","chipsBox","selectedBox","computed","isMobile","useMobile","inputmode","id","useId","useIntersectionObserver","intersectionRatio","close","floatingStyles","useFloating","autoUpdate","flip","offset","shift","optionsContainerStyles","base","_a","input","focusInput","onInputFocus","event","setActive","onOutsideInteraction","onInputFirstFocus","isPrefilling","hasPrefilled","prefillItems","onInputBlur","onInputChange","onInputInput","query","updateModelValue","searchByQuery","setInactive","wait","alignQueryToState","canProcessKeyboardBindings","computedLoading","onArrowUp","shown","_b","open","_c","onArrowDown","onArrowLeft","selectedOptions","highlightedOption","_d","onArrowRight","onEnter","error","useLogger","text","valueIsSelected","addCurrentQueryToManualItems","onOptionSelected","last","manualItems","onEscape","onBackspace","nextTick","shouldPrefill","isNotNil","innerLoading","options","selectOption","unselectOption","useOptions","toRef","computedPlaceholder","filteredOptions","queryMatchesASelectedOption","option","item","matchedAnything","matchAnyKey","onOptionUnselected","hidden","renderListBox","waitFor","toggle","active","onOuterContainerClick","makeInputValue","when","hiddenInputs","current","value"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6YA,UAAMA,IAAQC,GAcRC,IAAOC;AAIb,QAAIH,EAAM,YAAY,CAAC,MAAM,QAAQA,EAAM,UAAU;AAC9C,YAAA,IAAI,MAAM,2DAA2D;AAM5E,UAAMI,IAAUC,GAAqB,MAAM,OAAO,eAAgB,CAAC,GAC7DC,IAAiBC,EAEb,IAAI,GACRC,IAAiBD,EAEb,IAAI,GACRE,IAAmBF,EAAyC,IAAI,GAChEG,IAAWH,EAA0C,IAAI,GACzDI,IAAWJ,EAA0C,IAAI,GACzDK,IAAcC;AAAA,MAAS,MAC5Bb,EAAM,QAAQU,E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AQ;AAAA,IAAA,GAGThC,IAAQ,YAAY;;AACzB,MAAAgC,EAAM,QAAQ,IACdsC,EAAO,QAAQ,KACf7D,IAAAlB,EAAY,UAAZ,QAAAkB,EAAmB;AAAA,IAAK,GAGnBgE,KAAS,MACVzC,EAAM,QAAchC,MACjBkC,EAAK,GASPwC,IAASxF,EAAI,EAAK,GAElB4B,KAAY,MAAM;AACvB,MAAA4D,EAAO,QAAQ;AAAA,IAAA,GAEVhD,KAAc,MAAM;AACzB,MAAAgD,EAAO,QAAQ,IACf7F,EAAK,UAAU;AAAA,IAAA,GAMV8F,KAAwB,CAAC9D,MAAsB;AAGhD,MAFJA,EAAM,eAAe,GACrBhC,EAAK,SAASgC,CAAK,GACf,EAAAlC,EAAM,YAAYA,EAAM,cACjBgC,KACJ8D;IAAA,GAWFG,KAAiBC;AAAA,MACtB,CAACX,MAAkB,OAAOA,KAAS;AAAA,MACnC,KAAK;AAAA,IAAA,GAGAY,KAAetF,EAAS,MACtB,CAAA,EAAG,OAAOb,EAAM,UAAU,EAAE,IAAI,CAACoG,MAAY;AAC7C,YAAAC,IAAQJ,GAAeG,CAAO;AAC7B,aAAA;AAAA,QACN,UAAUpG,EAAM;AAAA,QAChB,MAAMA,EAAM;AAAA,QACZ,MAAM;AAAA,QACN,OAAAqG;AAAA,MAAA;AAAA,IACD,CACA,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index34.js","sources":["../src/components/BaseSelect/BaseSelect.vue"],"sourcesContent":["<template>\n\t<CommonInputOuterContainer\n\t\tref=\"outerContainer\"\n\t\t:class=\"{\n\t\t\t'bb-base-select': true,\n\t\t\t'bb-base-select--active': active,\n\t\t\t'bb-base-select--shown': shown,\n\t\t\t'bb-base-select--loading': computedLoading,\n\t\t\t'bb-base-select--disabled': disabled,\n\t\t\t'bb-base-select--errors': hasErrors,\n\t\t\t'bb-base-select--readonly': readonly,\n\t\t}\"\n\t\t@click=\"onOuterContainerClick\"\n\t>\n\t\t<template #prepend-outer\n\t\t\t><slot name=\"prepend-outer\" :query=\"query\"></slot\n\t\t></template>\n\n\t\t<CommonInputInnerContainer\n\t\t\tref=\"innerContainer\"\n\t\t\t:append:icon=\"props['append:icon']\"\n\t\t\t:prepend:icon=\"props['prepend:icon']\"\n\t\t>\n\t\t\t<template #prepend><slot name=\"prepend\" :query=\"query\"></slot></template>\n\t\t\t<template #prefix><slot name=\"prefix\" /></template>\n\t\t\t<BbSmoothHeight tag=\"span\">\n\t\t\t\t<span class=\"bb-base-select__input-container\">\n\t\t\t\t\t<template v-if=\"multiple\">\n\t\t\t\t\t\t<template v-if=\"comma\">\n\t\t\t\t\t\t\t<CommaBox ref=\"commaBox\" :options=\"selectedOptions\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t\t<ChipsBox\n\t\t\t\t\t\t\t\tref=\"chipsBox\"\n\t\t\t\t\t\t\t\t:options=\"selectedOptions\"\n\t\t\t\t\t\t\t\t@option:unselected=\"onOptionUnselected\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</template>\n\t\t\t\t\t<input\n\t\t\t\t\t\t:id=\"id\"\n\t\t\t\t\t\tref=\"input\"\n\t\t\t\t\t\tv-model=\"query\"\n\t\t\t\t\t\t:aria-autocomplete=\"'list'\"\n\t\t\t\t\t\t:aria-controls=\"`${id}_listbox`\"\n\t\t\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t\t\t:aria-expanded=\"shown\"\n\t\t\t\t\t\t:autocomplete=\"autocomplete\"\n\t\t\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t\t\t:class=\"'bb-base-select__text-input'\"\n\t\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t\t:inputmode=\"inputmode\"\n\t\t\t\t\t\t:placeholder=\"computedPlaceholder\"\n\t\t\t\t\t\t:readonly=\"readonly || !allowWriting\"\n\t\t\t\t\t\t:required=\"\n\t\t\t\t\t\t\t(required && !multiple) || (multiple && !modelValue.length)\n\t\t\t\t\t\t\"\n\t\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\t\t:type=\"'text'\"\n\t\t\t\t\t\t@blur.stop=\"onInputBlur\"\n\t\t\t\t\t\t@change.stop=\"onInputChange\"\n\t\t\t\t\t\t@focus.once.stop=\"onInputFirstFocus\"\n\t\t\t\t\t\t@focus.stop=\"onInputFocus\"\n\t\t\t\t\t\t@input.stop=\"onInputInput\"\n\t\t\t\t\t\t@keydown.stop.delete=\"onBackspace\"\n\t\t\t\t\t\t@keydown.stop.left=\"onArrowLeft\"\n\t\t\t\t\t\t@keydown.stop.prevent.down=\"onArrowDown\"\n\t\t\t\t\t\t@keydown.stop.prevent.enter=\"onEnter\"\n\t\t\t\t\t\t@keydown.stop.prevent.esc=\"onEscape\"\n\t\t\t\t\t\t@keydown.stop.prevent.up=\"onArrowUp\"\n\t\t\t\t\t\t@keydown.stop.right=\"onArrowRight\"\n\t\t\t\t\t/>\n\t\t\t\t</span>\n\t\t\t</BbSmoothHeight>\n\t\t\t<slot :loading=\"!!innerLoading\" name=\"chevron\" :shown=\"shown\">\n\t\t\t\t<svg\n\t\t\t\t\tclass=\"bb-base-select__chevron\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M7.41 8.58L12 13.17l4.59-4.59L18 10l-6 6l-6-6z\"\n\t\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t\t/>\n\t\t\t\t</svg>\n\t\t\t</slot>\n\t\t\t<slot name=\"append\" :query=\"query\"></slot>\n\t\t\t<template #suffix><slot name=\"suffix\" /></template>\n\t\t</CommonInputInnerContainer>\n\t\t<template #append-outer\n\t\t\t><slot name=\"append-outer\" :query=\"query\"></slot\n\t\t></template>\n\t\t<input v-for=\"input in hiddenInputs\" :key=\"input.value\" v-bind=\"input\" />\n\n\t\t<teleport v-if=\"renderListBox\" to=\"body\">\n\t\t\t<ListBox\n\t\t\t\tref=\"optionsContainer\"\n\t\t\t\t:loading=\"computedLoading\"\n\t\t\t\t:open=\"shown\"\n\t\t\t\t:options=\"filteredOptions\"\n\t\t\t\t:style=\"optionsContainerStyles\"\n\t\t\t\t@option:selected=\"onOptionSelected\"\n\t\t\t\t@option:unselected=\"onOptionUnselected\"\n\t\t\t>\n\t\t\t\t<template #options:prepend><slot name=\"options:prepend\" /></template>\n\t\t\t\t<template #loading><slot name=\"loading\" :query=\"query\" /></template>\n\t\t\t\t<template #no-data><slot name=\"no-data\" :query=\"query\" /></template>\n\t\t\t\t<template #options:append><slot name=\"options:append\" /></template>\n\t\t\t\t<template #option=\"data\"\n\t\t\t\t\t><slot\n\t\t\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t\t\t:loading=\"computedLoading\"\n\t\t\t\t\t\tname=\"option\"\n\t\t\t\t\t\tv-bind=\"data\"\n\t\t\t\t/></template>\n\t\t\t</ListBox>\n\t\t</teleport>\n\t</CommonInputOuterContainer>\n</template>\n\n<script setup lang=\"ts\">\nimport { BbSmoothHeight } from '@/index';\nimport { computed, ref, nextTick, defineAsyncComponent } from 'vue';\nimport { isNotNil } from '@/utilities/functions/isNotNil';\nimport { last } from '@/utilities/functions/last';\nimport { matchAnyKey } from '@/utilities/functions/matchAnyKey';\nimport { toRef } from 'vue';\nimport { useFloating, autoUpdate, flip, shift, offset } from '@floating-ui/vue';\nimport { useId } from '@/composables/useId';\nimport { useIntersectionObserver } from '@vueuse/core';\nimport { useLogger } from '@/composables/useLogger';\nimport { useMobile } from '@/composables/useMobile';\nimport { useOptions } from '@/composables/useOptions';\nimport { wait } from '@/utilities/functions/wait';\nimport { when } from '@/utilities/functions/when';\nimport ChipsBox from '../ChipsBox.vue';\nimport CommaBox from '../CommaBox.vue';\nimport CommonInputInnerContainer from '../CommonInputInnerContainer.vue';\nimport CommonInputOuterContainer from '../CommonInputOuterContainer.vue';\nimport type { HTMLAttributes, InputHTMLAttributes } from 'vue';\nimport type { Option as BaseOption } from '@/types/Option';\nimport { waitFor } from '@/utilities/functions/waitFor';\n\nexport type BaseSelectProps = {\n\t/**\n\t * Allows the user to add options to the list by\n\t * inserting text in the input and pressing ENTER.\n\t * The value and text of the option generated is a\n\t * string equal to what has been inserted.\n\t */\n\taddOptions?: boolean;\n\n\t/**\n\t * Allows typing into the input.\n\t */\n\tallowWriting?: boolean | 'not-mobile';\n\n\t/**\n\t * Name of the icon to be added at the end of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'append:icon'?: string;\n\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tariaDescribedby?: InputHTMLAttributes['aria-describedby'];\n\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tautocomplete?: InputHTMLAttributes['autocomplete'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Sets the display model for selected values to a list\n\t * of comma separated string. In this mode the user\n\t * cannot deselect an option by pressing the close button.\n\t */\n\tcomma?: boolean;\n\n\t/**\n\t * Defines an array of dependencies that will trigger actions in the component upon change.\n\t */\n\tdependencies?: any[];\n\n\t/**\n\t * Timeout used to debounce response to changes to dependencies.\n\t */\n\tdepsDebounceTime?: number;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * If coherence is enforce the input cannot have a modelValue that is incoherent with its current items.\n\t *\n\t * e.g. You cannot set v-model to a user that is not present in the items passed.\n\t *\n\t * modelValue will be reset upon incoherence.\n\t */\n\tenforceCoherence?: boolean;\n\n\t/**\n\t * Defines how the filtering should work.\n\t * In any case options are always filtered by the text displayed but\n\t * they can also take into account other properties of the\n\t * passed elements when this property is a string or an array of string.\n\t * E.g. items could be a list of users and you can filter users by email or phone by passing `['email', 'phone']`\n\t * You can also pass false to not filter anything or a function for more granular control.\n\t *\n\t */\n\tfilterBy?:\n\t\t| string\n\t\t| string[]\n\t\t| false\n\t\t| ((value: any, item: any) => boolean)\n\t\t| null;\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Used to retrieve items can be an array or a function.\n\t */\n\titems:\n\t\t| any[]\n\t\t| ((query: string, prefill: boolean, modelValue: any) => Promise<any[]>)\n\t\t| ((query: string, prefill: boolean, modelValue: any) => any[]);\n\n\t/**\n\t * Defines a path that returns a property of the object to use as text or a function that returns a string\n\t */\n\titemText?: string | ((item: any) => string) | undefined;\n\n\t/**\n\t * Defines a path that returns a property of the object to use as value or a function that returns any value\n\t */\n\titemValue?: string | ((item: any) => string) | undefined;\n\n\t/**\n\t * Sets the component in a loading state, usually triggering some visual styles.\n\t */\n\tloading?: boolean;\n\n\t/**\n\t * String displayed while items are being loaded.\n\t */\n\tloadingText?: string;\n\n\t/**\n\t * Used by v-model. Can be any serializable type.\n\t */\n\tmodelValue: any;\n\n\t/**\n\t * Timeout used to debounce response to changes to modelValue.\n\t */\n\tmodelValueDebounceTime?: number;\n\n\t/**\n\t * Allows the selection of multiple items.\n\t */\n\tmultiple?: boolean;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * String displayed when there are no items to display.\n\t */\n\tnoDataText?: string;\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Defines the prefill strategy for the input. By default the input will prefill\n\t * on focus. It can also always prefill with `true` and only prefill on search with `false`.\n\t */\n\tprefill?: boolean | 'focus';\n\n\t/**\n\t * Name of the icon to be added at the start of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'prepend:icon'?: string;\n\n\t/**\n\t * Time to wait when the users stops writing in the input before querying data.\n\t * Especially useful when searching live data on big datasets.\n\t */\n\tqueryDebounceTime?: number;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: boolean;\n\n\t/**\n\t * Sets the input as required.\n\t */\n\trequired?: boolean;\n\n\t/**\n\t * If `true` when in multiple selection, reset the query immediately\n\t * upon selecting an option. By default the query is\n\t * not reset until focus is lost so the user can search\n\t * for \"Cath\" and select \"Cathy\" and then write more to\n\t * search for \"Catherine\"\n\t */\n\tresetQueryOnOptionSelected?: boolean;\n\n\t/**\n\t * Adds a stash to accumulate selected values. Especially\n\t * useful when searching in a big database of items.\n\t * E.g. if you search for \"John\" and then search for \"Richard\"\n\t * you either always return the previous items or you stash them passing `true` to this option.\n\t */\n\tstash?: boolean;\n\n\t/**\n\t * How long the transition has to last in milliseconds\n\t */\n\ttransitionDuration?: number;\n\n\t/**\n\t * Pass `true` if the dropdown is not updating following movement in the UI, like in modals. Very expensive so use with care.\n\t */\n\tupdateOnAnimationFrame?: boolean;\n};\nexport type BaseSelectEvents = {\n\t(e: 'blur', event: FocusEvent): void;\n\t(e: 'change', event: Event): void;\n\t(e: 'click', event: MouseEvent): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'inactive'): void;\n\t(e: 'input', event: Event): void;\n\t(e: 'update:modelValue', value: any): void;\n};\n\nexport type BaseSelectSlots = {\n\tappend?: (props: { query: string }) => any;\n\t'append-outer'?: (props: { query: string }) => any;\n\tchevron?: (props: { loading: boolean; shown: boolean }) => any;\n\tchip?: (props: {\n\t\tdisabled: boolean | undefined;\n\t\thasErrors?: boolean;\n\t\tindex: number;\n\t\titem: any;\n\t\tloading: boolean;\n\t\tmanual: boolean;\n\t\tselected: boolean | undefined;\n\t\ttext: string;\n\t\tvalue: any;\n\t}) => any;\n\tloading?: (props: { query: string }) => any;\n\t'no-data'?: (props: { query: string }) => any;\n\toption?: (props: {\n\t\tdisabled: boolean;\n\t\tfocused: boolean;\n\t\tindex: number;\n\t\thasErrors?: boolean;\n\t\titem: any;\n\t\tloading: boolean;\n\t\tselected: boolean;\n\t\ttext: string;\n\t\tvalue: any;\n\t}) => any;\n\t'option:append'?: (props: { item: any }) => any;\n\t'option:prepend'?: (props: { item: any }) => any;\n\t'options:append'?: (props: object) => any;\n\t'options:prepend'?: (props: object) => any;\n\tprefix?: (props: object) => any;\n\tprepend?: (props: { query: string }) => any;\n\t'prepend-outer'?: (props: { query: string }) => any;\n\tsuffix?: (props: object) => any;\n};\n\nconst props = withDefaults(defineProps<BaseSelectProps>(), {\n\tallowWriting: true,\n\tdepsDebounceTime: 0,\n\tdependencies: () => [],\n\tfilterBy: () => [],\n\tloadingText: 'Caricamento...',\n\tmodelValueDebounceTime: 0,\n\tnoDataText: 'Nessun elemento da visualizzare',\n\tprefill: 'focus',\n\tqueryDebounceTime: 500,\n\ttransitionDuration: 300,\n\tupdateOnAnimationFrame: false,\n});\n\nconst emit = defineEmits<BaseSelectEvents>();\n\ndefineSlots<BaseSelectSlots>();\n\nif (props.multiple && !Array.isArray(props.modelValue)) {\n\tthrow new Error('Multiple is set to \"true\" but modelValue is not an array.');\n}\n\n/**\n * START ELEMENT REFERENCES\n */\nconst ListBox = defineAsyncComponent(() => import('../ListBox.vue'));\nconst outerContainer = ref<InstanceType<\n\ttypeof CommonInputOuterContainer\n> | null>(null);\nconst innerContainer = ref<InstanceType<\n\ttypeof CommonInputInnerContainer\n> | null>(null);\nconst optionsContainer = ref<InstanceType<typeof ListBox> | null>(null);\nconst commaBox = ref<InstanceType<typeof CommaBox> | null>(null);\nconst chipsBox = ref<InstanceType<typeof ChipsBox> | null>(null);\nconst selectedBox = computed(() =>\n\tprops.comma ? commaBox.value : chipsBox.value\n);\n/**\n * END ELEMENT REFERENCES\n */\n\nconst { isMobile } = useMobile();\nconst inputmode = computed(() =>\n\tprops.allowWriting === 'not-mobile' && isMobile.value ? 'none' : undefined\n);\n\n// Always provide an id so that inputs can be focussed by clicking oin the label\nconst id = props.id || useId().id.value;\n\nuseIntersectionObserver(\n\tinnerContainer,\n\t([{ intersectionRatio }]) => {\n\t\tif (intersectionRatio !== 1) {\n\t\t\tclose();\n\t\t}\n\t},\n\t{ threshold: [0, 1] }\n);\n\nconst { floatingStyles } = useFloating(\n\tinnerContainer,\n\toptionsContainer as any,\n\t{\n\t\tplacement: 'bottom',\n\t\twhileElementsMounted: autoUpdate,\n\t\tmiddleware: [flip(), offset(5), shift()],\n\t}\n);\n\nconst optionsContainerStyles = computed(() => {\n\tconst base: Record<string, any> = {\n\t\t...floatingStyles.value,\n\t\tzIndex: '10',\n\t};\n\tif (innerContainer.value) {\n\t\tbase.width = `${innerContainer.value?.$el.clientWidth}px`;\n\t}\n\n\treturn base;\n});\n\n/**\n * START INPUT HANDLING\n */\nconst input = ref<HTMLElement | null>(null);\nconst focusInput = () => {\n\tif (input.value instanceof HTMLInputElement) {\n\t\tinput.value.focus();\n\t}\n};\n\n/**\n * When the focus goes to the input we select the current text\n * so the user can replace or delete it.\n * On top of that if the prefill strategy is to prefill on first focus and options\n * weren't already retrieved by the watcher on mount, we do that\n */\nconst onInputFocus = async (event: FocusEvent) => {\n\temit('focus', event);\n\tsetActive();\n\tdocument.addEventListener('click', onOutsideInteraction);\n\tdocument.addEventListener('focusin', onOutsideInteraction);\n};\n\nconst onInputFirstFocus = () => {\n\tif (props.prefill === 'focus' && !isPrefilling.value && !hasPrefilled.value) {\n\t\tprefillItems();\n\t}\n};\n\nconst onInputBlur = async (event: FocusEvent) => {\n\temit('blur', event);\n};\n\nconst onInputChange = (event: Event) => emit('change', event);\n\n/**\n * Search at every input by the user.\n * When the user deletes the query unselect the current option\n */\nconst onInputInput = (event: Event) => {\n\temit('input', event);\n\tif (query.value === '') {\n\t\tif (!props.multiple) {\n\t\t\tupdateModelValue(null);\n\t\t}\n\t}\n\tselectedBox.value?.blur();\n\tsearchByQuery();\n};\n\n/**\n * On click outside of the container close the panel, remove active state.\n * In multiple selection clear query after a timeout\n */\nconst onOutsideInteraction = async (event: Event) => {\n\tif (event.target instanceof Node) {\n\t\tif (outerContainer.value && optionsContainer.value) {\n\t\t\tif (\n\t\t\t\t!outerContainer.value.$el.contains(event.target) &&\n\t\t\t\t!optionsContainer.value.$el.contains(event.target)\n\t\t\t) {\n\t\t\t\tclose();\n\t\t\t\tsetInactive();\n\t\t\t\tdocument.removeEventListener('click', onOutsideInteraction);\n\t\t\t\tdocument.removeEventListener('focusin', onOutsideInteraction);\n\t\t\t\tawait wait(props.transitionDuration);\n\t\t\t\talignQueryToState();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n};\n\nconst canProcessKeyboardBindings = computed(() => {\n\tif (props.readonly) return false;\n\tif (props.disabled) return false;\n\tif (computedLoading.value) return false;\n\tif (!selectedBox.value && props.multiple) return false;\n\treturn true;\n});\n\n/**\n * On arrow prevent the page from scrolling.\n * Reset horizontal focus\n * When the panel is open\n * - Focus on the previous option\n * When the panel is closed\n * - focus on the first selected option\n */\nconst onArrowUp = async () => {\n\tif (!canProcessKeyboardBindings.value) {\n\t\treturn;\n\t}\n\t// Reset horizontal focus while moving vertically\n\tselectedBox.value?.blur();\n\tif (shown.value) {\n\t\toptionsContainer.value?.focusPrevious();\n\t} else {\n\t\tawait open();\n\t\tawait wait(props.transitionDuration);\n\t\toptionsContainer.value?.focusLastSelected();\n\t}\n};\n\nconst onArrowDown = async () => {\n\tif (!canProcessKeyboardBindings.value) {\n\t\treturn;\n\t}\n\t// Reset horizontal focus while moving vertically\n\tselectedBox.value?.blur();\n\tif (shown.value) {\n\t\toptionsContainer.value?.focusNext();\n\t} else {\n\t\tawait open();\n\t\tawait wait(props.transitionDuration);\n\t\toptionsContainer.value?.focusFirstSelected();\n\t}\n};\n\nconst onArrowLeft = (event: KeyboardEvent) => {\n\tif (!canProcessKeyboardBindings.value) {\n\t\treturn;\n\t}\n\tif (!props.multiple || query.value) {\n\t\treturn;\n\t}\n\tevent.preventDefault();\n\t// Reset vertical focus while moving horizontally\n\toptionsContainer.value?.blur();\n\tif (!selectedOptions.value.length) return;\n\tselectedBox.value?.focusPrevious();\n\tconst highlightedOption = selectedBox.value?.getHighlighted();\n\tif (highlightedOption) {\n\t\toptionsContainer.value?.focusByHash(highlightedOption.valueHash);\n\t}\n};\n\nconst onArrowRight = (event: KeyboardEvent) => {\n\tif (!canProcessKeyboardBindings.value) {\n\t\treturn;\n\t}\n\tif (!props.multiple || query.value) {\n\t\treturn;\n\t}\n\tevent.preventDefault();\n\t// Reset vertical focus while moving horizontally\n\toptionsContainer.value?.blur();\n\tif (!selectedOptions.value.length) return;\n\tselectedBox.value?.focusNext();\n\tconst highlightedOption = selectedBox.value?.getHighlighted();\n\tif (highlightedOption) {\n\t\toptionsContainer.value?.focusByHash(highlightedOption.valueHash);\n\t}\n};\n\nconst onEnter = async () => {\n\tif (!canProcessKeyboardBindings.value) {\n\t\treturn;\n\t}\n\tif (!shown.value) {\n\t\tawait open();\n\t\tawait wait(props.transitionDuration);\n\t\tif (selectedOptions.value.length) {\n\t\t\toptionsContainer.value?.focusFirstSelected();\n\t\t}\n\t} else if (optionsContainer.value?.getHighlighted()) {\n\t\toptionsContainer.value.confirmOption();\n\t} else if (props.addOptions) {\n\t\tif (props.itemText || props.itemValue) {\n\t\t\tconst { error } = useLogger();\n\t\t\terror(\n\t\t\t\t`Adding an option for mapped items is not supported. You can't create an option while passing \"item-text\" or \"item-value\".`\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tconst text = query.value.trim();\n\t\t// Do not add manual items that are already present\n\t\tif (valueIsSelected(text)) return;\n\t\taddCurrentQueryToManualItems();\n\t\tonOptionSelected(last(manualItems.value)!);\n\t}\n};\n\nconst onEscape = async () => {\n\tif (shown.value) {\n\t\tawait close();\n\t}\n};\n\n/**\n * Delete behavior is different when query is empty\n * If query is empty\n * If no chip is selected - select rightmost chip\n * If a chip is selected - deselect that option\n * If any option remains move focus to that or reset\n */\nconst onBackspace = async () => {\n\tif (\n\t\t!canProcessKeyboardBindings.value ||\n\t\tquery.value ||\n\t\t!selectedOptions.value.length\n\t) {\n\t\treturn;\n\t}\n\tif (selectedBox.value?.getHighlighted()) {\n\t\tselectedBox.value.confirmOption();\n\t}\n\tawait nextTick();\n\tselectedBox.value?.focusPrevious();\n};\n\n/**\n * It should prefill if asked, or\n * when single if modelValue is not null\n * when multiple if modelValue is not empty\n */\nconst shouldPrefill =\n\tprops.prefill === true ||\n\t(!props.multiple && isNotNil(props.modelValue)) ||\n\t(props.multiple && !!props.modelValue.length);\n\nconst {\n\tquery,\n\talignQueryToState,\n\taddCurrentQueryToManualItems,\n\tinnerLoading,\n\toptions,\n\tselectedOptions,\n\tselectOption,\n\tunselectOption,\n\tprefillItems,\n\tisPrefilling,\n\thasPrefilled,\n\tupdateModelValue,\n\tvalueIsSelected,\n\tmanualItems,\n\tsearchByQuery,\n} = useOptions({\n\temit,\n\titemText: props.itemText,\n\titemValue: props.itemValue,\n\tmodelValue: toRef(props, 'modelValue'),\n\tmultiple: props.multiple,\n\tresetQueryOnOptionSelected: props.resetQueryOnOptionSelected,\n\tstash: props.stash,\n\titems: toRef(props, 'items'),\n\tenforceCoherence: props.enforceCoherence,\n\tprefill: shouldPrefill,\n\tmodelValueDebounceTime: props.modelValueDebounceTime,\n\tdependencies: toRef(props, 'dependencies'),\n\tdepsDebounceTime: props.depsDebounceTime,\n\tqueryDebounceTime: props.queryDebounceTime,\n\tdisabled: toRef(props, 'disabled'),\n});\n\nconst computedPlaceholder = computed(() => {\n\tif (selectedOptions.value.length) return '';\n\telse return props.placeholder;\n});\n\nconst computedLoading = computed(() => !!(innerLoading.value || props.loading));\n\n/**\n * Filter options to be displayed based on the current query.\n * If no query is used or when query is set from the inside (after a selection) display all possible options\n */\nconst filteredOptions = computed<BaseOption[]>(() => {\n\tlet base = [];\n\t/** Only filter when a value is being searched not when the query is fully set on a selected option text */\n\tconst queryMatchesASelectedOption = selectedOptions.value.some(\n\t\t(option: BaseOption) => option.text === query.value\n\t);\n\tconst shouldFilter =\n\t\t(props.multiple && query.value) ||\n\t\t(query.value && !queryMatchesASelectedOption && !props.multiple);\n\n\tif (shouldFilter && props.filterBy) {\n\t\tbase = options.value.filter((item: BaseOption) => {\n\t\t\tlet matchedAnything = false;\n\t\t\tif (typeof props.filterBy === 'function')\n\t\t\t\tmatchedAnything = props.filterBy(item.value, item.item);\n\t\t\telse if (Array.isArray(props.filterBy) && props.filterBy.length) {\n\t\t\t\tmatchedAnything =\n\t\t\t\t\tmatchedAnything ||\n\t\t\t\t\tmatchAnyKey(item.item, props.filterBy, query.value.trim());\n\t\t\t}\n\t\t\treturn matchedAnything || matchAnyKey(item, ['text'], query.value.trim());\n\t\t});\n\t\t/** Otherwise default to the whole set of options */\n\t} else base = options.value;\n\n\t/** This is done here so that only visible options are highlighted */\n\treturn base;\n});\n\nconst onOptionSelected = (option: BaseOption) => {\n\tselectOption(option);\n\tfocusInput();\n\tif (!props.multiple) {\n\t\tclose();\n\t}\n};\n\nconst onOptionUnselected = (option: BaseOption) => {\n\tunselectOption(option);\n\tfocusInput();\n};\n\n/**\n * We need the transitions because elements must be hidden and shown\n * to accessibility tools when they are fully closed or fully open,\n * while still being animated for sighted users.\n */\n\n// Option panel is open\nconst shown = ref(false);\n// Option panel il closed\nconst hidden = ref(true);\n\nconst renderListBox = ref(false);\n\nconst open = async () => {\n\trenderListBox.value = true;\n\tawait waitFor(() => !!optionsContainer.value);\n\thidden.value = false;\n\tshown.value = true;\n};\n\nconst close = async () => {\n\tshown.value = false;\n\thidden.value = true;\n\tselectedBox.value?.blur();\n};\n\nconst toggle = () => {\n\tif (shown.value) return close();\n\treturn open();\n};\n\n/**\n * Applies a class when the user is inside this whole component.\n * We cannot use focus within as it doesn't work for elements that are teleported.\n * Also we cannot use the <input/> if we physically move focus to the options so\n * we track it manually.\n */\nconst active = ref(false);\n\nconst setActive = () => {\n\tactive.value = true;\n};\nconst setInactive = () => {\n\tactive.value = false;\n\temit('inactive');\n};\n\n/**\n * When clicking on the outside container seamlessly move focus to the input and open the panel\n */\nconst onOuterContainerClick = (event: MouseEvent) => {\n\tevent.preventDefault();\n\temit('click', event);\n\tif (props.disabled || props.readonly) return;\n\tfocusInput();\n\ttoggle();\n};\n\n/**\n * When using this component for submission we add a bunch of hidden\n * inputs so the submitted inputs are on par with v-model\n */\n/**\n * This is used to keep the value compatible to common html expected values.\n * Convert to string everything that's not but do not double encode strings\n */\nconst makeInputValue = when(\n\t(item: unknown) => typeof item !== 'string',\n\tJSON.stringify\n);\n\nconst hiddenInputs = computed(() => {\n\treturn [].concat(props.modelValue).map((current) => {\n\t\tconst value = makeInputValue(current);\n\t\treturn {\n\t\t\tdisabled: props.disabled,\n\t\t\tname: props.name,\n\t\t\ttype: 'hidden',\n\t\t\tvalue: value,\n\t\t};\n\t});\n});\n</script>\n<style lang=\"postcss\">\n@import '@/assets/css/BaseSelect';\n</style>\n"],"names":["props","__props","emit","__emit","ListBox","defineAsyncComponent","outerContainer","ref","innerContainer","optionsContainer","commaBox","chipsBox","selectedBox","computed","isMobile","useMobile","inputmode","id","useId","useIntersectionObserver","intersectionRatio","close","floatingStyles","useFloating","autoUpdate","flip","offset","shift","optionsContainerStyles","base","_a","input","focusInput","onInputFocus","event","setActive","onOutsideInteraction","onInputFirstFocus","isPrefilling","hasPrefilled","prefillItems","onInputBlur","onInputChange","onInputInput","query","updateModelValue","searchByQuery","setInactive","wait","alignQueryToState","canProcessKeyboardBindings","computedLoading","onArrowUp","shown","_b","open","_c","onArrowDown","onArrowLeft","selectedOptions","highlightedOption","_d","onArrowRight","onEnter","error","useLogger","text","valueIsSelected","addCurrentQueryToManualItems","onOptionSelected","last","manualItems","onEscape","onBackspace","nextTick","shouldPrefill","isNotNil","innerLoading","options","selectOption","unselectOption","useOptions","toRef","computedPlaceholder","filteredOptions","queryMatchesASelectedOption","option","item","matchedAnything","matchAnyKey","onOptionUnselected","hidden","renderListBox","waitFor","toggle","active","onOuterContainerClick","makeInputValue","when","hiddenInputs","current","value"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6YA,UAAMA,IAAQC,GAcRC,IAAOC;AAIb,QAAIH,EAAM,YAAY,CAAC,MAAM,QAAQA,EAAM,UAAU;AAC9C,YAAA,IAAI,MAAM,2DAA2D;AAM5E,UAAMI,IAAUC,GAAqB,MAAM,OAAO,eAAgB,CAAC,GAC7DC,IAAiBC,EAEb,IAAI,GACRC,IAAiBD,EAEb,IAAI,GACRE,IAAmBF,EAAyC,IAAI,GAChEG,IAAWH,EAA0C,IAAI,GACzDI,IAAWJ,EAA0C,IAAI,GACzDK,IAAcC;AAAA,MAAS,MAC5Bb,EAAM,QAAQU,EAAS,QAAQC,EAAS;AAAA,IAAA,GAMnC,EAAE,UAAAG,OAAaC,MACfC,KAAYH;AAAA,MAAS,MAC1Bb,EAAM,iBAAiB,gBAAgBc,GAAS,QAAQ,SAAS;AAAA,IAAA,GAI5DG,IAAKjB,EAAM,MAAMkB,KAAQ,GAAG;AAElC,IAAAC;AAAA,MACCX;AAAA,MACA,CAAC,CAAC,EAAE,mBAAAY,EAAA,CAAmB,MAAM;AAC5B,QAAIA,MAAsB,KACnBC;MAER;AAAA,MACA,EAAE,WAAW,CAAC,GAAG,CAAC,EAAE;AAAA,IAAA;AAGf,UAAA,EAAE,gBAAAC,OAAmBC;AAAA,MAC1Bf;AAAA,MACAC;AAAA,MACA;AAAA,QACC,WAAW;AAAA,QACX,sBAAsBe;AAAA,QACtB,YAAY,CAACC,GAAK,GAAGC,GAAO,CAAC,GAAGC,IAAO;AAAA,MACxC;AAAA,IAAA,GAGKC,KAAyBf,EAAS,MAAM;;AAC7C,YAAMgB,IAA4B;AAAA,QACjC,GAAGP,GAAe;AAAA,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EAAM,UAAU,EAAE,IAAI,CAACoG,MAAY;AAC7C,YAAAC,IAAQJ,GAAeG,CAAO;AAC7B,aAAA;AAAA,QACN,UAAUpG,EAAM;AAAA,QAChB,MAAMA,EAAM;AAAA,QACZ,MAAM;AAAA,QACN,OAAAqG;AAAA,MAAA;AAAA,IACD,CACA,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index36.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as U, ref as d, computed as h, onMounted as W, watch as Z, openBlock as g, createElementBlock as w, mergeProps as T, renderSlot as f, createElementVNode as b, Fragment as ee, renderList as ae, createCommentVNode as H, normalizeProps as re, guardReactiveProps as te, unref as c, normalizeClass as F, normalizeStyle as I } from "vue";
|
|
2
2
|
import { clamp as le } from "./index198.js";
|
|
3
3
|
import { head as O } from "./index233.js";
|
|
4
|
-
import { isCssColor as Y } from "./
|
|
4
|
+
import { isCssColor as Y } from "./index215.js";
|
|
5
5
|
import { isNil as P } from "./index124.js";
|
|
6
6
|
import { isNotNil as ne } from "./index129.js";
|
|
7
7
|
import { transposeValue as y } from "./index125.js";
|
package/dist/index38.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as I, ref as p, computed as n, watch as S, openBlock as h, createElementBlock as f, normalizeProps as r, guardReactiveProps as c, mergeProps as y, createCommentVNode as q, createElementVNode as l, renderSlot as A } from "vue";
|
|
2
|
-
import { isCssColor as d } from "./
|
|
3
|
-
import { when as F } from "./
|
|
2
|
+
import { isCssColor as d } from "./index215.js";
|
|
3
|
+
import { when as F } from "./index216.js";
|
|
4
4
|
const N = { class: "bb-base-switch-container" }, x = /* @__PURE__ */ l("span", { class: "bb-base-switch-container__icon-thumb" }, null, -1), J = [
|
|
5
5
|
x
|
|
6
6
|
], L = /* @__PURE__ */ I({
|
package/dist/index40.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as $, ref as p, toRef as l, openBlock as w, createBlock as B, unref as f, withCtx as i, renderSlot as s, normalizeProps as b, guardReactiveProps as h, createVNode as O, mergeProps as v, createSlots as z } from "vue";
|
|
2
|
-
import { useOptions as F } from "./
|
|
2
|
+
import { useOptions as F } from "./index199.js";
|
|
3
3
|
import M from "./index38.js";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import S from "./
|
|
5
|
+
import S from "./index200.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
const I = /* @__PURE__ */ $({
|
|
8
8
|
__name: "BaseSwitchGroup",
|
package/dist/index42.js
CHANGED
|
@@ -3,8 +3,8 @@ import { defineComponent as Z, ref as r, computed as k, toRef as B, openBlock as
|
|
|
3
3
|
import ue from "./index122.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import { isNotNil as se } from "./index129.js";
|
|
6
|
-
import { last as de } from "./
|
|
7
|
-
import { useOptions as pe } from "./
|
|
6
|
+
import { last as de } from "./index214.js";
|
|
7
|
+
import { useOptions as pe } from "./index199.js";
|
|
8
8
|
import ce from "./index229.js";
|
|
9
9
|
/* empty css */
|
|
10
10
|
import me from "./index231.js";
|
package/dist/index52.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as z, computed as b, ref as o, onMounted as g, openBlock as l, createElementBlock as i, normalizeProps as h, guardReactiveProps as k, renderSlot as y } from "vue";
|
|
2
|
-
import { isCssColor as _ } from "./
|
|
2
|
+
import { isCssColor as _ } from "./index215.js";
|
|
3
3
|
import { wait as C } from "./index126.js";
|
|
4
4
|
const w = ["alt", "sizes", "src", "srcset"], B = {
|
|
5
5
|
key: 1,
|
package/dist/index54.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as p, useSlots as d, computed as n, openBlock as m, createElementBlock as u, normalizeClass as g, createElementVNode as s, renderSlot as l, mergeProps as f, createTextVNode as _, toDisplayString as y } from "vue";
|
|
2
|
-
import { isCssColor as r } from "./
|
|
2
|
+
import { isCssColor as r } from "./index215.js";
|
|
3
3
|
import { isNil as B } from "./index124.js";
|
|
4
4
|
const C = { class: "bb-badge__wrapper" }, h = { class: "bb-badge__content-inner" }, S = /* @__PURE__ */ p({
|
|
5
5
|
__name: "BbBadge",
|
package/dist/index70.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineComponent as Y, computed as M, ref as v, openBlock as D, createElementBlock as H, mergeProps as I, createElementVNode as $, renderSlot as _, normalizeProps as Z, guardReactiveProps as ee, unref as c, createBlock as te, Teleport as oe, normalizeClass as ne, normalizeStyle as z, Fragment as N, renderList as ae, createVNode as le, withCtx as se, createCommentVNode as ie } from "vue";
|
|
2
|
-
import { findRightIndex as S } from "./
|
|
2
|
+
import { findRightIndex as S } from "./index245.js";
|
|
3
3
|
import { useFloating as re, arrow as ue } from "./index219.js";
|
|
4
4
|
import { useId as de } from "./index7.js";
|
|
5
5
|
import { wait as U } from "./index126.js";
|
|
6
6
|
import { useIntersectionObserver as ce } from "./index127.js";
|
|
7
7
|
import fe from "./index12.js";
|
|
8
8
|
/* empty css */
|
|
9
|
-
import V from "./
|
|
9
|
+
import V from "./index246.js";
|
|
10
10
|
import { autoUpdate as pe, flip as be, offset as me, shift as ve } from "./index226.js";
|
|
11
11
|
const we = ["id", "aria-labelledby"], ye = { class: "bb-dropdown__items-container" }, He = /* @__PURE__ */ Y({
|
|
12
12
|
__name: "BbDropdown",
|
package/dist/index74.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as j, ref as g, watch as x, computed as m, openBlock as V, createBlock as G, resolveDynamicComponent as K, normalizeClass as O, withCtx as M, createElementVNode as c, withModifiers as y, renderSlot as U, normalizeProps as Y, guardReactiveProps as Z, createTextVNode as J, unref as Q, createVNode as W, createElementBlock as F, Fragment as X, renderList as ee, toDisplayString as te } from "vue";
|
|
2
|
-
import { findInTree as ae } from "./
|
|
2
|
+
import { findInTree as ae } from "./index248.js";
|
|
3
3
|
import { useId as re } from "./index7.js";
|
|
4
4
|
import oe from "./index122.js";
|
|
5
5
|
/* empty css */
|
|
@@ -56,7 +56,7 @@ const le = ["accept", "autofocus", "disabled", "multiple"], se = {
|
|
|
56
56
|
const r = t.accept[a];
|
|
57
57
|
if (r.includes("/")) e.push(r);
|
|
58
58
|
else {
|
|
59
|
-
b || (b = (await import("./
|
|
59
|
+
b || (b = (await import("./index247.js")).default);
|
|
60
60
|
const o = b.getType(r);
|
|
61
61
|
if (!o)
|
|
62
62
|
throw new Error(
|
package/dist/index76.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as h, ref as t, onMounted as m, onBeforeUnmount as p, openBlock as g, createBlock as b, resolveDynamicComponent as w, withCtx as _, renderSlot as I } from "vue";
|
|
2
|
-
import { throttle as c } from "./
|
|
2
|
+
import { throttle as c } from "./index202.js";
|
|
3
3
|
const M = /* @__PURE__ */ h({
|
|
4
4
|
__name: "BbIntersection",
|
|
5
5
|
props: {
|
package/dist/index79.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as oe, ref as s, useAttrs as se, getCurrentInstance as ae, computed as v, nextTick as le, onBeforeUnmount as O, onMounted as ne, watch as ie, openBlock as _, createBlock as re, Teleport as ce, createElementVNode as a, mergeProps as S, createElementBlock as V, renderSlot as n, createTextVNode as ue, toDisplayString as z, createCommentVNode as T } from "vue";
|
|
2
|
-
import { useFocusTrap as de } from "./
|
|
2
|
+
import { useFocusTrap as de } from "./index203.js";
|
|
3
3
|
import { useId as A } from "./index7.js";
|
|
4
4
|
import { wait as E } from "./index126.js";
|
|
5
|
-
import { useModalsState as p } from "./
|
|
5
|
+
import { useModalsState as p } from "./index205.js";
|
|
6
6
|
const fe = ["inert"], ve = { class: "bb-offcanvas-close" }, pe = { class: "bb-offcanvas-close__content" }, be = { class: "bb-offcanvas-close__label" }, me = /* @__PURE__ */ a("span", { class: "bb-offcanvas-close__icon" }, [
|
|
7
7
|
/* @__PURE__ */ a("svg", {
|
|
8
8
|
fill: "none",
|
package/dist/index81.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as W, computed as y, ref as c, onMounted as w, onBeforeUnmount as R, openBlock as k, createElementBlock as V, normalizeClass as C, createElementVNode as o, createVNode as v, unref as g, withCtx as S, renderSlot as m, Fragment as F, renderList as L, toDisplayString as M, nextTick as N } from "vue";
|
|
2
|
-
import { debounce as T } from "./
|
|
2
|
+
import { debounce as T } from "./index249.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import $ from "./index12.js";
|
|
5
5
|
/* empty css */
|
package/dist/index83.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as W, ref as a, computed as _, openBlock as d, createElementBlock as g, mergeProps as D, createElementVNode as b, renderSlot as S, normalizeProps as I, guardReactiveProps as R, unref as y, createBlock as E, Teleport as U, normalizeClass as j, normalizeStyle as G, createCommentVNode as k, withCtx as J, nextTick as K, watch as Q } from "vue";
|
|
2
2
|
import { useFloating as X, arrow as Y } from "./index219.js";
|
|
3
|
-
import { useFocusTrap as Z } from "./
|
|
3
|
+
import { useFocusTrap as Z } from "./index203.js";
|
|
4
4
|
import { useId as ee } from "./index7.js";
|
|
5
5
|
import { wait as M } from "./index126.js";
|
|
6
6
|
import te from "./index12.js";
|
package/package.json
CHANGED
package/dist/index201.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { unrefElement as m } from "./index127.js";
|
|
2
|
-
import { ref as u, watch as l } from "vue";
|
|
3
|
-
import { createFocusTrap as d } from "./index240.js";
|
|
4
|
-
import { tryOnScopeDispose as D } from "./index197.js";
|
|
5
|
-
function O(i, a = {}) {
|
|
6
|
-
let e;
|
|
7
|
-
const { immediate: f, ...n } = a, c = u(!1), s = u(!1), o = (t) => e && e.activate(t), r = (t) => e && e.deactivate(t), v = () => {
|
|
8
|
-
e && (e.pause(), s.value = !0);
|
|
9
|
-
}, p = () => {
|
|
10
|
-
e && (e.unpause(), s.value = !1);
|
|
11
|
-
};
|
|
12
|
-
return l(
|
|
13
|
-
() => m(i),
|
|
14
|
-
(t) => {
|
|
15
|
-
t && (e = d(t, {
|
|
16
|
-
...n,
|
|
17
|
-
onActivate() {
|
|
18
|
-
c.value = !0, a.onActivate && a.onActivate();
|
|
19
|
-
},
|
|
20
|
-
onDeactivate() {
|
|
21
|
-
c.value = !1, a.onDeactivate && a.onDeactivate();
|
|
22
|
-
}
|
|
23
|
-
}), f && o());
|
|
24
|
-
},
|
|
25
|
-
{ flush: "post" }
|
|
26
|
-
), D(() => r()), {
|
|
27
|
-
hasFocus: c,
|
|
28
|
-
isPaused: s,
|
|
29
|
-
activate: o,
|
|
30
|
-
deactivate: r,
|
|
31
|
-
pause: v,
|
|
32
|
-
unpause: p
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export {
|
|
36
|
-
O as useFocusTrap
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=index201.js.map
|
package/dist/index201.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index201.js","sources":["../node_modules/@vueuse/integrations/useFocusTrap.mjs"],"sourcesContent":["import { unrefElement, tryOnScopeDispose } from '@vueuse/core';\nimport { ref, watch } from 'vue-demi';\nimport { createFocusTrap } from 'focus-trap';\n\nfunction useFocusTrap(target, options = {}) {\n let trap;\n const { immediate, ...focusTrapOptions } = options;\n const hasFocus = ref(false);\n const isPaused = ref(false);\n const activate = (opts) => trap && trap.activate(opts);\n const deactivate = (opts) => trap && trap.deactivate(opts);\n const pause = () => {\n if (trap) {\n trap.pause();\n isPaused.value = true;\n }\n };\n const unpause = () => {\n if (trap) {\n trap.unpause();\n isPaused.value = false;\n }\n };\n watch(\n () => unrefElement(target),\n (el) => {\n if (!el)\n return;\n trap = createFocusTrap(el, {\n ...focusTrapOptions,\n onActivate() {\n hasFocus.value = true;\n if (options.onActivate)\n options.onActivate();\n },\n onDeactivate() {\n hasFocus.value = false;\n if (options.onDeactivate)\n options.onDeactivate();\n }\n });\n if (immediate)\n activate();\n },\n { flush: \"post\" }\n );\n tryOnScopeDispose(() => deactivate());\n return {\n hasFocus,\n isPaused,\n activate,\n deactivate,\n pause,\n unpause\n };\n}\n\nexport { useFocusTrap };\n"],"names":["useFocusTrap","target","options","trap","immediate","focusTrapOptions","hasFocus","ref","isPaused","activate","opts","deactivate","pause","unpause","watch","unrefElement","el","createFocusTrap","tryOnScopeDispose"],"mappings":";;;;AAIA,SAASA,EAAaC,GAAQC,IAAU,IAAI;AAC1C,MAAIC;AACJ,QAAM,EAAE,WAAAC,GAAW,GAAGC,EAAgB,IAAKH,GACrCI,IAAWC,EAAI,EAAK,GACpBC,IAAWD,EAAI,EAAK,GACpBE,IAAW,CAACC,MAASP,KAAQA,EAAK,SAASO,CAAI,GAC/CC,IAAa,CAACD,MAASP,KAAQA,EAAK,WAAWO,CAAI,GACnDE,IAAQ,MAAM;AAClB,IAAIT,MACFA,EAAK,MAAK,GACVK,EAAS,QAAQ;AAAA,EAEvB,GACQK,IAAU,MAAM;AACpB,IAAIV,MACFA,EAAK,QAAO,GACZK,EAAS,QAAQ;AAAA,EAEvB;AACE,SAAAM;AAAA,IACE,MAAMC,EAAad,CAAM;AAAA,IACzB,CAACe,MAAO;AACN,MAAKA,MAELb,IAAOc,EAAgBD,GAAI;AAAA,QACzB,GAAGX;AAAA,QACH,aAAa;AACX,UAAAC,EAAS,QAAQ,IACbJ,EAAQ,cACVA,EAAQ,WAAU;AAAA,QACrB;AAAA,QACD,eAAe;AACb,UAAAI,EAAS,QAAQ,IACbJ,EAAQ,gBACVA,EAAQ,aAAY;AAAA,QACvB;AAAA,MACT,CAAO,GACGE,KACFK;IACH;AAAA,IACD,EAAE,OAAO,OAAQ;AAAA,EACrB,GACES,EAAkB,MAAMP,EAAU,CAAE,GAC7B;AAAA,IACL,UAAAL;AAAA,IACA,UAAAE;AAAA,IACA,UAAAC;AAAA,IACA,YAAAE;AAAA,IACA,OAAAC;AAAA,IACA,SAAAC;AAAA,EACJ;AACA;","x_google_ignoreList":[0]}
|
package/dist/index261.js
DELETED
package/dist/index261.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index261.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|