bitboss-ui 0.2.41 → 0.2.43
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/index.d.ts +125 -125
- package/dist/index101.js +3 -3
- package/dist/index103.js +2 -2
- package/dist/index109.js +1 -1
- package/dist/index11.js +2 -2
- package/dist/index111.js +3 -3
- package/dist/index113.js +1 -1
- package/dist/index116.js +1 -1
- package/dist/index117.js +1 -1
- package/dist/index118.js +1 -1
- package/dist/index119.js +1 -1
- package/dist/index121.js +1 -1
- package/dist/index125.js +1 -1
- package/dist/index126.js +1 -1
- package/dist/index127.js +1 -1
- package/dist/index131.js +2 -2
- package/dist/index15.js +8 -8
- package/dist/index17.js +9 -9
- package/dist/index19.js +3 -3
- package/dist/index196.js +2 -10
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +2 -3
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +4 -35
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +368 -6
- package/dist/index199.js.map +1 -1
- package/dist/index200.js +2 -235
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +2 -2
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +373 -4
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +1 -1
- package/dist/index204.js +1 -1
- package/dist/index205.js +134 -5
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +5 -16
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +18 -15
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +2 -19
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +172 -18
- package/dist/index209.js.map +1 -1
- package/dist/index210.js +23 -29
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +2 -8
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +3 -2
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +35 -2
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +6 -368
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +13 -131
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +16 -2
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +18 -172
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +29 -23
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +8 -373
- package/dist/index219.js.map +1 -1
- package/dist/index220.js +10 -2
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +235 -2
- package/dist/index221.js.map +1 -1
- package/dist/index223.js +4 -4
- package/dist/index226.js +3 -78
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +224 -2
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +257 -159
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +8 -1
- package/dist/index229.js.map +1 -1
- package/dist/index23.js +1 -1
- package/dist/index230.js +2 -69
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +295 -5
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +2 -15
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +2 -435
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +115 -87
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +106 -4
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +424 -189
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +83 -218
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +200 -258
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +78 -294
- package/dist/index239.js.map +1 -1
- package/dist/index240.js +2 -6
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +2 -2
- package/dist/index244.js +69 -2
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +160 -2
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +1 -4
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +2 -2
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +5 -2
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +11 -113
- package/dist/index249.js.map +1 -1
- package/dist/index25.js +2 -2
- package/dist/index250.js +2 -106
- package/dist/index250.js.map +1 -1
- package/dist/index254.js +2 -3
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +3 -2
- package/dist/index255.js.map +1 -1
- package/dist/index29.js +3 -3
- package/dist/index31.js +167 -182
- package/dist/index31.js.map +1 -1
- package/dist/index33.js +2 -2
- package/dist/index35.js +2 -2
- package/dist/index47.js +1 -1
- package/dist/index49.js +1 -1
- package/dist/index65.js +3 -3
- package/dist/index72.js +1 -1
- package/dist/index75.js +1 -1
- package/dist/index77.js +1 -1
- package/dist/index79.js +3 -3
- package/dist/index81.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index31.js
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import { defineComponent as Ne, ref as
|
|
1
|
+
import { defineComponent as Ne, ref as v, computed as y, onMounted as $e, onBeforeUnmount as De, watch as X, openBlock as g, createElementBlock as h, normalizeClass as I, renderSlot as b, createElementVNode as w, Fragment as L, renderList as P, toDisplayString as F, createBlock as ie, withModifiers as B, withCtx as Le, createTextVNode as ee, createCommentVNode as se, withDirectives as Fe, vModelDynamic as Me, Teleport as Ae, normalizeStyle as qe, createVNode as Je, mergeProps as Re, nextTick as le } from "vue";
|
|
2
2
|
import ze from "./index115.js";
|
|
3
3
|
import "./index158.js";
|
|
4
|
-
import
|
|
4
|
+
import He from "./index119.js";
|
|
5
5
|
import "./index185.js";
|
|
6
|
-
import { autoUpdate as
|
|
6
|
+
import { autoUpdate as Pe, computePosition as Ue, flip as je, shift as Qe } from "./index199.js";
|
|
7
7
|
import { deepEqual as re } from "./index123.js";
|
|
8
|
-
import { head as
|
|
9
|
-
import { isNotNil as
|
|
10
|
-
import { last as We } from "./
|
|
8
|
+
import { head as te } from "./index200.js";
|
|
9
|
+
import { isNotNil as E } from "./index124.js";
|
|
10
|
+
import { last as We } from "./index201.js";
|
|
11
11
|
import { useItemText as Ke } from "./index125.js";
|
|
12
12
|
import { useItemValue as Ye } from "./index126.js";
|
|
13
13
|
import { wait as J } from "./index122.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomplete", "autofocus", "disabled", "placeholder", "readonly"], tl = {
|
|
14
|
+
import { when as Ze } from "./index198.js";
|
|
15
|
+
import { offset as Ge } from "./index202.js";
|
|
16
|
+
const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomplete", "autofocus", "disabled", "placeholder", "readonly"], ll = {
|
|
18
17
|
key: 0,
|
|
19
18
|
class: "bb-base-select__loading-container"
|
|
20
|
-
},
|
|
19
|
+
}, tl = {
|
|
21
20
|
key: 1,
|
|
22
21
|
class: "bb-base-select__no-data-container"
|
|
23
|
-
},
|
|
22
|
+
}, al = ["id", "aria-selected"], nl = { class: "bb-base-select-option__content" }, ol = { class: "bb-base-select-option__text" }, ul = { class: "bb-base-select__chevron" }, il = /* @__PURE__ */ w("svg", {
|
|
24
23
|
fill: "none",
|
|
25
24
|
viewBox: "0 0 16 8",
|
|
26
25
|
xmlns: "http://www.w3.org/2000/svg"
|
|
@@ -31,7 +30,7 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
31
30
|
fill: "currentColor",
|
|
32
31
|
"fill-rule": "evenodd"
|
|
33
32
|
})
|
|
34
|
-
], -1),
|
|
33
|
+
], -1), Cl = /* @__PURE__ */ Ne({
|
|
35
34
|
__name: "BaseSelect",
|
|
36
35
|
props: {
|
|
37
36
|
allowWriting: { type: Boolean, default: !0 },
|
|
@@ -68,15 +67,15 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
68
67
|
},
|
|
69
68
|
emits: ["blur", "change", "click", "focus", "inactive", "input", "update:modelValue"],
|
|
70
69
|
setup(de, { emit: ce }) {
|
|
71
|
-
const e = de,
|
|
70
|
+
const e = de, f = ce;
|
|
72
71
|
if (e.multiple && !Array.isArray(e.modelValue))
|
|
73
72
|
throw new Error('Multiple is set to "true" but modelValue is not an array.');
|
|
74
|
-
const
|
|
75
|
-
let
|
|
73
|
+
const S = v(null), N = v(null), d = v(null), T = v(null), u = v(""), fe = y(() => s.value.length ? "" : e.placeholder), c = v(0), ve = e.transitionDuration / 1e3 + "s";
|
|
74
|
+
let ae;
|
|
76
75
|
$e(async () => {
|
|
77
|
-
e.debug && console.log("Calling onMounted"),
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
e.debug && console.log("Calling onMounted"), N.value && d.value && (ae = Pe(
|
|
77
|
+
N.value,
|
|
78
|
+
d.value,
|
|
80
79
|
ye,
|
|
81
80
|
{
|
|
82
81
|
ancestorResize: !0,
|
|
@@ -86,11 +85,11 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
86
85
|
}
|
|
87
86
|
));
|
|
88
87
|
}), De(() => {
|
|
89
|
-
e.debug && console.log("Calling onBeforeUnMount"),
|
|
88
|
+
e.debug && console.log("Calling onBeforeUnMount"), ae();
|
|
90
89
|
});
|
|
91
|
-
const
|
|
90
|
+
const ne = v([]), m = v([]), V = v([]), { getItemText: me } = Ke(), { getItemValue: pe } = Ye(), ge = y(() => ne.value.map((l, a) => {
|
|
92
91
|
e.debug && console.log("Mapping items in internalOptions", { item: l });
|
|
93
|
-
const t =
|
|
92
|
+
const t = me(l, e.itemText), n = pe(l, e.itemValue);
|
|
94
93
|
if (n === void 0)
|
|
95
94
|
throw new Error(
|
|
96
95
|
'The result of extracting "value" from option was undefined. Affected item is ' + JSON.stringify(l) + " please check itemValue property is correct."
|
|
@@ -113,7 +112,7 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
113
112
|
const a = V.value.reduce(
|
|
114
113
|
(n, o) => (n[o.id] || (n[o.id] = o), n),
|
|
115
114
|
l
|
|
116
|
-
), t =
|
|
115
|
+
), t = m.value.reduce(
|
|
117
116
|
(n, o) => (n[o.id] || (n[o.id] = o), n),
|
|
118
117
|
a
|
|
119
118
|
);
|
|
@@ -124,7 +123,7 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
124
123
|
}), Object.values(t).map(
|
|
125
124
|
(n, o) => ({
|
|
126
125
|
...n,
|
|
127
|
-
selected:
|
|
126
|
+
selected: E(be.value.get(n.value)),
|
|
128
127
|
index: o
|
|
129
128
|
})
|
|
130
129
|
);
|
|
@@ -141,8 +140,8 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
141
140
|
else if (e.filterBy.length) {
|
|
142
141
|
const n = [].concat(e.filterBy);
|
|
143
142
|
for (let o = 0; o < n.length; o++) {
|
|
144
|
-
const
|
|
145
|
-
t = t || a.original[
|
|
143
|
+
const x = n[o];
|
|
144
|
+
t = t || a.original[x] && a.original[x].toLowerCase().includes(u.value.toLowerCase());
|
|
146
145
|
}
|
|
147
146
|
}
|
|
148
147
|
} else
|
|
@@ -160,7 +159,7 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
160
159
|
}),
|
|
161
160
|
{}
|
|
162
161
|
)
|
|
163
|
-
),
|
|
162
|
+
), p = y(() => {
|
|
164
163
|
if (e.debug && console.log("Computing optionsIndexedByValue"), e.matchStrategy === "string") {
|
|
165
164
|
let l = O.value.reduce(
|
|
166
165
|
(a, t) => (a[t.jsonValue] = t, a),
|
|
@@ -191,7 +190,7 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
191
190
|
get: (a) => l[JSON.stringify(a)]
|
|
192
191
|
};
|
|
193
192
|
} else if (e.matchStrategy === "equality") {
|
|
194
|
-
const l = [].concat(e.modelValue).filter(
|
|
193
|
+
const l = [].concat(e.modelValue).filter(E).map((a, t) => [a, t]);
|
|
195
194
|
return {
|
|
196
195
|
get: (a) => {
|
|
197
196
|
var t;
|
|
@@ -201,7 +200,7 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
201
200
|
} else
|
|
202
201
|
throw new Error("No match strategy has been defined");
|
|
203
202
|
}), s = y(() => (e.debug && console.log("Computing selectedOptions"), [].concat(e.modelValue).reduce((l, a) => {
|
|
204
|
-
const t =
|
|
203
|
+
const t = p.value.get(a);
|
|
205
204
|
return t && l.push(t), l;
|
|
206
205
|
}, []))), M = (l) => {
|
|
207
206
|
e.debug && console.log("Running onOptionSelected", { option: l });
|
|
@@ -210,15 +209,15 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
210
209
|
(t) => t.id !== l.id
|
|
211
210
|
)), a = e.modelValue.filter(
|
|
212
211
|
(t) => JSON.stringify(t) !== l.jsonValue
|
|
213
|
-
), e.stash && (e.debug && console.log("onOptionSelected: inside multiple > selected > stash"),
|
|
212
|
+
), e.stash && (e.debug && console.log("onOptionSelected: inside multiple > selected > stash"), m.value = m.value.filter((t) => t.id !== l.id))) : (e.debug && console.log("onOptionSelected: inside multiple > not selected"), a = e.modelValue.concat(l.value), e.stash && (e.debug && console.log(
|
|
214
213
|
"onOptionSelected: inside multiple > not selected > stash"
|
|
215
|
-
),
|
|
214
|
+
), m.value = m.value.concat(l))), e.resetQueryOnOptionSelected && (e.debug && console.log("onOptionSelected: resetting query"), u.value = "")) : l.selected ? (l.manual && (e.debug && console.log("onOptionSelected: inside single > selected > manual"), V.value = V.value.filter(
|
|
216
215
|
(t) => t.id !== l.id
|
|
217
|
-
)), a = null, e.stash && (e.debug && console.log("onOptionSelected: inside single > selected > stash"),
|
|
218
|
-
},
|
|
216
|
+
)), a = null, e.stash && (e.debug && console.log("onOptionSelected: inside single > selected > stash"), m.value = []), u.value = "") : (e.debug && console.log("onOptionSelected: inside single > not selected"), a = l.value, e.stash && (e.debug && console.log("onOptionSelected: inside single > not selected > stash"), m.value = [l]), u.value = l.text), f("update:modelValue", a);
|
|
217
|
+
}, $ = async ({ prefill: l = !1 }) => {
|
|
219
218
|
e.debug && console.log("running getOptions");
|
|
220
219
|
let a = [];
|
|
221
|
-
Array.isArray(e.items) ? a = e.items : typeof e.items == "function" && (
|
|
220
|
+
Array.isArray(e.items) ? a = e.items : typeof e.items == "function" && (c.value++, a = await e.items(u.value, l, e.modelValue), c.value--), ne.value = a;
|
|
222
221
|
}, he = () => {
|
|
223
222
|
e.debug && console.log("running addOption");
|
|
224
223
|
const l = u.value, a = u.value, t = JSON.stringify(a), n = {
|
|
@@ -231,7 +230,7 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
231
230
|
disabled: !1
|
|
232
231
|
};
|
|
233
232
|
V.value = V.value.concat(n), u.value = "";
|
|
234
|
-
}, z = e.prefill === !0 || !e.multiple &&
|
|
233
|
+
}, z = e.prefill === !0 || !e.multiple && E(e.modelValue) || e.multiple && !!e.modelValue.length;
|
|
235
234
|
let U;
|
|
236
235
|
X(
|
|
237
236
|
() => e.modelValue,
|
|
@@ -242,31 +241,31 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
242
241
|
if (!Array.isArray(e.modelValue))
|
|
243
242
|
throw new Error("props.modelValue is not an array.");
|
|
244
243
|
let t = e.modelValue.every(
|
|
245
|
-
(n) =>
|
|
244
|
+
(n) => p.value.get(n)
|
|
246
245
|
);
|
|
247
|
-
if ((!t || a === void 0) && (await
|
|
248
|
-
(n) =>
|
|
246
|
+
if ((!t || a === void 0) && (await $({ prefill: !0 }), t = e.modelValue.every(
|
|
247
|
+
(n) => p.value.get(n)
|
|
249
248
|
)), t)
|
|
250
|
-
e.stash && (
|
|
251
|
-
(n) =>
|
|
249
|
+
e.stash && (m.value = e.modelValue.map(
|
|
250
|
+
(n) => p.value.get(n)
|
|
252
251
|
));
|
|
253
252
|
else {
|
|
254
253
|
let n = [];
|
|
255
|
-
const o = l.filter((
|
|
256
|
-
let q =
|
|
254
|
+
const o = l.filter((x) => {
|
|
255
|
+
let q = p.value.get(x);
|
|
257
256
|
return q && n.push(q), q;
|
|
258
257
|
});
|
|
259
|
-
e.stash && (
|
|
258
|
+
e.stash && (m.value = n), e.enforceCoherence && f("update:modelValue", o);
|
|
260
259
|
}
|
|
261
260
|
} else {
|
|
262
261
|
e.debug && console.log("watch.modelValue >> single");
|
|
263
|
-
let t =
|
|
264
|
-
if (!t &&
|
|
262
|
+
let t = p.value.get(e.modelValue);
|
|
263
|
+
if (!t && E(e.modelValue) || a === void 0) {
|
|
265
264
|
e.debug && console.log("watch.modelValue >> not found line 895");
|
|
266
265
|
const n = u.value;
|
|
267
|
-
u.value = "", await
|
|
266
|
+
u.value = "", await $({ prefill: !0 }), u.value = n;
|
|
268
267
|
}
|
|
269
|
-
t =
|
|
268
|
+
t = p.value.get(e.modelValue), t ? (e.debug && console.log("watch.modelValue >> found"), u.value = t.text, e.debug && console.log("watch.modelValue assigned to query"), e.stash && (m.value = [t], e.debug && console.log("watch.modelValue assigned to stash")), e.debug && console.log("watch.modelValue end of found")) : e.enforceCoherence && E(l) ? (e.debug && console.log("watch.modelValue >> not found line 911"), u.value = "", e.stash && (m.value = []), f("update:modelValue", null)) : u.value = "";
|
|
270
269
|
}
|
|
271
270
|
},
|
|
272
271
|
z ? 0 : e.modelValueDebounceTime
|
|
@@ -279,15 +278,15 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
279
278
|
async (l, a) => {
|
|
280
279
|
if (typeof l == "function" || // Circumvent arrays defined in the template by the parent
|
|
281
280
|
JSON.stringify(l) !== JSON.stringify(a))
|
|
282
|
-
if (e.debug && console.log("watch.items"), await
|
|
281
|
+
if (e.debug && console.log("watch.items"), await $({ prefill: !1 }), e.multiple) {
|
|
283
282
|
if (!e.modelValue.every(
|
|
284
|
-
(n) =>
|
|
283
|
+
(n) => p.value.get(n)
|
|
285
284
|
) && e.enforceCoherence) {
|
|
286
|
-
const n = e.modelValue.filter((o) =>
|
|
287
|
-
|
|
285
|
+
const n = e.modelValue.filter((o) => p.value.get(o));
|
|
286
|
+
f("update:modelValue", n);
|
|
288
287
|
}
|
|
289
288
|
} else
|
|
290
|
-
!
|
|
289
|
+
!p.value.get(e.modelValue) && e.enforceCoherence && E(e.modelValue) && f("update:modelValue", null), r.value = null;
|
|
291
290
|
}
|
|
292
291
|
);
|
|
293
292
|
let j;
|
|
@@ -296,19 +295,19 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
296
295
|
(l, a) => {
|
|
297
296
|
!z && e.prefill === "focus" && Y || JSON.stringify(l) !== JSON.stringify(a) && (j && clearTimeout(j), j = setTimeout(async () => {
|
|
298
297
|
if (JSON.stringify(l) !== JSON.stringify(a)) {
|
|
299
|
-
e.enforceCoherence && e.stash && (
|
|
298
|
+
e.enforceCoherence && e.stash && (m.value = []);
|
|
300
299
|
let t = u.value;
|
|
301
|
-
if (u.value = "", await
|
|
302
|
-
!
|
|
300
|
+
if (u.value = "", await $({ prefill: !0 }), u.value = t, !e.multiple)
|
|
301
|
+
!p.value.get(e.modelValue) && e.enforceCoherence && E(e.modelValue) && (u.value = "", e.stash && (m.value = []), f("update:modelValue", null));
|
|
303
302
|
else if (!e.modelValue.every(
|
|
304
|
-
(o) =>
|
|
303
|
+
(o) => p.value.get(o)
|
|
305
304
|
) && e.enforceCoherence) {
|
|
306
305
|
let o = [];
|
|
307
|
-
const
|
|
308
|
-
let G =
|
|
306
|
+
const x = e.modelValue.filter((q) => {
|
|
307
|
+
let G = p.value.get(q);
|
|
309
308
|
return G && o.push(G), G;
|
|
310
309
|
});
|
|
311
|
-
e.stash && (
|
|
310
|
+
e.stash && (m.value = o), f("update:modelValue", x);
|
|
312
311
|
}
|
|
313
312
|
}
|
|
314
313
|
}, e.depsDebounceTime));
|
|
@@ -316,72 +315,60 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
316
315
|
{ deep: !0 }
|
|
317
316
|
);
|
|
318
317
|
const ye = () => {
|
|
319
|
-
e.debug && console.log("Running display options"),
|
|
318
|
+
e.debug && console.log("Running display options"), N.value && d.value && Ue(N.value, d.value, {
|
|
320
319
|
placement: "bottom",
|
|
321
|
-
middleware: [
|
|
320
|
+
middleware: [Ge(6), je(), Qe()]
|
|
322
321
|
}).then((l) => {
|
|
323
322
|
var a;
|
|
324
|
-
|
|
323
|
+
d.value && (d.value.style.left = `${l.x}px`, d.value.style.top = `${l.y}px`, d.value.style.width = `${(a = N.value) == null ? void 0 : a.offsetWidth}px`);
|
|
325
324
|
});
|
|
326
|
-
}, k =
|
|
325
|
+
}, k = v(!1), Q = v(!1), W = v(!1), K = v(!0), D = async () => {
|
|
327
326
|
K.value = !1, Q.value = !0, await J(e.transitionDuration), Q.value = !1, k.value = !0;
|
|
328
327
|
}, A = async () => {
|
|
329
328
|
k.value = !1, W.value = !0, await J(e.transitionDuration), W.value = !1, K.value = !0;
|
|
330
|
-
},
|
|
329
|
+
}, H = v(!1);
|
|
331
330
|
let Y = !0;
|
|
332
331
|
const we = async (l) => {
|
|
333
|
-
e.debug && console.log("Running onInputFocus"),
|
|
334
|
-
},
|
|
335
|
-
if (e.debug && console.log("Running onFocusOutside"), l.target instanceof Node &&
|
|
336
|
-
A(),
|
|
337
|
-
u.value = "";
|
|
338
|
-
});
|
|
332
|
+
e.debug && console.log("Running onInputFocus"), f("focus", l), H.value = !0, document.addEventListener("click", ue), document.addEventListener("focusin", oe), T.value instanceof HTMLInputElement && T.value.select(), e.prefill === "focus" && Y && !z && (await $({ prefill: !0 }), Y = !1);
|
|
333
|
+
}, oe = async (l) => {
|
|
334
|
+
if (e.debug && console.log("Running onFocusOutside"), l.target instanceof Node && S.value && d.value && !S.value.contains(l.target) && !d.value.contains(l.target)) {
|
|
335
|
+
A(), f("inactive"), document.removeEventListener("focusin", oe), H.value = !1, e.multiple && (await J(500), u.value = "");
|
|
339
336
|
return;
|
|
340
337
|
}
|
|
341
338
|
}, Ve = async (l) => {
|
|
342
|
-
if (e.debug && console.log("Running onInputBlur"),
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
Ze(() => t !== e.modelValue).then(() => {
|
|
348
|
-
a = !0;
|
|
349
|
-
})
|
|
350
|
-
]), !a) {
|
|
351
|
-
const n = m.value.get(e.modelValue);
|
|
352
|
-
n && (u.value = n.text);
|
|
339
|
+
if (e.debug && console.log("Running onInputBlur"), f("blur", l), !e.multiple && (e.modelValue, await le(), await J(300), S.value && d.value)) {
|
|
340
|
+
const a = document.activeElement;
|
|
341
|
+
if (!S.value.contains(a) && !d.value.contains(a)) {
|
|
342
|
+
const t = p.value.get(e.modelValue);
|
|
343
|
+
t && (u.value = t.text);
|
|
353
344
|
}
|
|
354
345
|
}
|
|
355
|
-
}, Oe = (l) =>
|
|
356
|
-
e.debug && console.log("Running onInputInput"),
|
|
357
|
-
}, r =
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
inline: "start"
|
|
382
|
-
});
|
|
383
|
-
}
|
|
384
|
-
});
|
|
346
|
+
}, Oe = (l) => f("change", l), Ce = (l) => {
|
|
347
|
+
e.debug && console.log("Running onInputInput"), f("input", l), u.value === "" && (e.multiple || f("update:modelValue", null)), typeof e.items == "function" && Te();
|
|
348
|
+
}, r = v(null), _ = y(() => Number.isInteger(r.value) && r.value ? (r.value === -1 && (r.value = C.value.length - 1), r.value % C.value.length) : r.value), i = v(null), ke = async () => {
|
|
349
|
+
var l;
|
|
350
|
+
if (r.value !== null ? r.value++ : r.value = 0, await le(), _.value !== null) {
|
|
351
|
+
const a = (l = d.value) == null ? void 0 : l.querySelector(
|
|
352
|
+
`#${O.value[_.value].id}`
|
|
353
|
+
);
|
|
354
|
+
a instanceof HTMLElement && a.scrollIntoView({
|
|
355
|
+
behavior: "smooth",
|
|
356
|
+
block: "nearest",
|
|
357
|
+
inline: "start"
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
}, _e = async () => {
|
|
361
|
+
var l;
|
|
362
|
+
if (r.value !== null ? r.value-- : r.value = O.value.length - 1, await le(), _.value !== null) {
|
|
363
|
+
const a = (l = d.value) == null ? void 0 : l.querySelector(
|
|
364
|
+
`#${O.value[_.value].id}`
|
|
365
|
+
);
|
|
366
|
+
a instanceof HTMLElement && a.scrollIntoView({
|
|
367
|
+
behavior: "smooth",
|
|
368
|
+
block: "nearest",
|
|
369
|
+
inline: "start"
|
|
370
|
+
});
|
|
371
|
+
}
|
|
385
372
|
}, Se = async (l) => {
|
|
386
373
|
var a, t;
|
|
387
374
|
if (e.readonly || e.disabled) {
|
|
@@ -391,24 +378,24 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
391
378
|
switch (l.key) {
|
|
392
379
|
case "ArrowUp":
|
|
393
380
|
{
|
|
394
|
-
if (l.preventDefault(),
|
|
381
|
+
if (l.preventDefault(), c.value)
|
|
395
382
|
return;
|
|
396
|
-
i.value = null, k.value ? _e() : (s.value.length && (r.value =
|
|
383
|
+
i.value = null, k.value ? _e() : (s.value.length && (r.value = te(s.value).index), await D());
|
|
397
384
|
}
|
|
398
385
|
break;
|
|
399
386
|
case "ArrowDown":
|
|
400
387
|
{
|
|
401
|
-
if (l.preventDefault(),
|
|
388
|
+
if (l.preventDefault(), c.value)
|
|
402
389
|
return;
|
|
403
|
-
i.value = null, k.value ? ke() : (s.value.length && (r.value =
|
|
390
|
+
i.value = null, k.value ? ke() : (s.value.length && (r.value = te(s.value).index), await D());
|
|
404
391
|
}
|
|
405
392
|
break;
|
|
406
393
|
case "ArrowLeft":
|
|
407
394
|
{
|
|
408
|
-
if (
|
|
395
|
+
if (c.value)
|
|
409
396
|
return;
|
|
410
397
|
if (!u.value && s.value.length && (i.value === null ? i.value = s.value.length - 1 : i.value > 0 ? i.value-- : i.value = null, i.value !== null)) {
|
|
411
|
-
let n = s.value[i.value], o = (a =
|
|
398
|
+
let n = s.value[i.value], o = (a = d.value) == null ? void 0 : a.querySelector(
|
|
412
399
|
`#${n.id}`
|
|
413
400
|
);
|
|
414
401
|
o && (o.scrollIntoView({
|
|
@@ -421,10 +408,10 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
421
408
|
break;
|
|
422
409
|
case "ArrowRight":
|
|
423
410
|
{
|
|
424
|
-
if (
|
|
411
|
+
if (c.value)
|
|
425
412
|
return;
|
|
426
413
|
if (!u.value && s.value.length && (i.value === null ? i.value = 0 : i.value < s.value.length - 1 ? i.value++ : i.value = null, i.value !== null)) {
|
|
427
|
-
let n = s.value[i.value], o = (t =
|
|
414
|
+
let n = s.value[i.value], o = (t = d.value) == null ? void 0 : t.querySelector(
|
|
428
415
|
`#${n.id}`
|
|
429
416
|
);
|
|
430
417
|
o && (o.scrollIntoView({
|
|
@@ -437,10 +424,10 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
437
424
|
break;
|
|
438
425
|
case "Enter":
|
|
439
426
|
{
|
|
440
|
-
if (l.preventDefault(),
|
|
427
|
+
if (l.preventDefault(), c.value)
|
|
441
428
|
return;
|
|
442
429
|
if (!k.value)
|
|
443
|
-
C.value.length && s.value.length && (r.value =
|
|
430
|
+
C.value.length && s.value.length && (r.value = te(s.value).index), await D();
|
|
444
431
|
else if (_.value !== null) {
|
|
445
432
|
if (C.value[_.value].disabled)
|
|
446
433
|
return;
|
|
@@ -462,15 +449,15 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
462
449
|
break;
|
|
463
450
|
case "Tab":
|
|
464
451
|
case "Escape":
|
|
465
|
-
k.value && await A(),
|
|
452
|
+
k.value && await A(), f("inactive"), i.value = null, r.value = null;
|
|
466
453
|
break;
|
|
467
454
|
case "Shift":
|
|
468
|
-
if (
|
|
455
|
+
if (c.value)
|
|
469
456
|
return;
|
|
470
457
|
break;
|
|
471
458
|
case "Backspace":
|
|
472
459
|
{
|
|
473
|
-
if (
|
|
460
|
+
if (c.value)
|
|
474
461
|
return;
|
|
475
462
|
u.value || s.value.length && (i.value === null ? i.value = s.value.length - 1 : (M(
|
|
476
463
|
s.value[i.value]
|
|
@@ -480,11 +467,11 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
480
467
|
s.value.length - 2
|
|
481
468
|
),
|
|
482
469
|
0
|
|
483
|
-
) : i.value = null)), await
|
|
470
|
+
) : i.value = null)), await D();
|
|
484
471
|
}
|
|
485
472
|
break;
|
|
486
473
|
default:
|
|
487
|
-
i.value = null, r.value = null, await
|
|
474
|
+
i.value = null, r.value = null, await D();
|
|
488
475
|
break;
|
|
489
476
|
}
|
|
490
477
|
};
|
|
@@ -492,28 +479,26 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
492
479
|
const Te = () => {
|
|
493
480
|
Z && clearTimeout(Z), Z = setTimeout(async () => {
|
|
494
481
|
try {
|
|
495
|
-
await
|
|
482
|
+
await $({ prefill: !1 });
|
|
496
483
|
} catch (l) {
|
|
497
484
|
console.error(l);
|
|
498
485
|
}
|
|
499
486
|
}, e.queryDebounceTime);
|
|
500
487
|
}, xe = (l) => {
|
|
501
|
-
|
|
488
|
+
f("click", l), !(e.disabled || e.readonly) && (T.value instanceof HTMLElement && T.value.focus(), D());
|
|
502
489
|
}, Ie = (l) => {
|
|
503
490
|
if (l.currentTarget instanceof HTMLElement && l.currentTarget.classList.contains("bb-base-select-option")) {
|
|
504
491
|
const a = R.value[l.currentTarget.id];
|
|
505
492
|
if (a.disabled)
|
|
506
493
|
return;
|
|
507
|
-
M(a),
|
|
494
|
+
M(a), T.value instanceof HTMLInputElement && T.value.focus(), e.multiple || A();
|
|
508
495
|
}
|
|
509
|
-
},
|
|
510
|
-
if (l.target instanceof Node &&
|
|
511
|
-
A(),
|
|
512
|
-
u.value = "";
|
|
513
|
-
});
|
|
496
|
+
}, ue = async (l) => {
|
|
497
|
+
if (l.target instanceof Node && S.value && !S.value.contains(l.target)) {
|
|
498
|
+
A(), f("inactive"), document.removeEventListener("click", ue), H.value = !1, e.multiple && (await J(500), u.value = "");
|
|
514
499
|
return;
|
|
515
500
|
}
|
|
516
|
-
}, Be =
|
|
501
|
+
}, Be = Ze(
|
|
517
502
|
(l) => typeof l != "string",
|
|
518
503
|
JSON.stringify
|
|
519
504
|
), Ee = y(() => [].concat(e.modelValue).map((l) => {
|
|
@@ -527,11 +512,11 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
527
512
|
}));
|
|
528
513
|
return (l, a) => (g(), h("span", {
|
|
529
514
|
ref_key: "outerContainer",
|
|
530
|
-
ref:
|
|
531
|
-
class:
|
|
515
|
+
ref: S,
|
|
516
|
+
class: I({
|
|
532
517
|
"bb-base-select": !0,
|
|
533
|
-
"bb-base-select--active":
|
|
534
|
-
"bb-base-select--loading":
|
|
518
|
+
"bb-base-select--active": H.value,
|
|
519
|
+
"bb-base-select--loading": c.value,
|
|
535
520
|
"bb-base-select--disabled": l.disabled,
|
|
536
521
|
"bb-base-select--errors": l.hasErrors,
|
|
537
522
|
"bb-base-select--readonly": l.readonly
|
|
@@ -541,29 +526,29 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
541
526
|
b(l.$slots, "prepend-outer"),
|
|
542
527
|
w("span", {
|
|
543
528
|
ref_key: "innerContainer",
|
|
544
|
-
ref:
|
|
529
|
+
ref: N,
|
|
545
530
|
class: "bb-base-select__inner-container"
|
|
546
531
|
}, [
|
|
547
532
|
b(l.$slots, "prepend"),
|
|
548
|
-
w("span",
|
|
549
|
-
l.multiple ? (g(), h(
|
|
550
|
-
l.comma ? (g(!0), h(
|
|
533
|
+
w("span", Xe, [
|
|
534
|
+
l.multiple ? (g(), h(L, { key: 0 }, [
|
|
535
|
+
l.comma ? (g(!0), h(L, { key: 0 }, P(s.value, (t, n) => (g(), h("span", {
|
|
551
536
|
key: t.id,
|
|
552
|
-
class:
|
|
537
|
+
class: I({
|
|
553
538
|
"bb-base-select__selected": !0,
|
|
554
539
|
"bb-base-select__selected--comma": !0,
|
|
555
540
|
"bb-base-select__selected--focused": n === i.value
|
|
556
541
|
})
|
|
557
|
-
},
|
|
542
|
+
}, F(t.text) + F(n < s.value.length - 1 ? "," : ""), 3))), 128)) : (g(!0), h(L, { key: 1 }, P(s.value, (t, n) => (g(), ie(ze, {
|
|
558
543
|
key: t.id,
|
|
559
|
-
class:
|
|
544
|
+
class: I({
|
|
560
545
|
"bb-base-select__selected": !0,
|
|
561
546
|
"bb-base-select__selected--chip": !0,
|
|
562
547
|
"bb-base-select__selected--focused": n === i.value
|
|
563
548
|
}),
|
|
564
549
|
clearable: !0,
|
|
565
550
|
text: t.text,
|
|
566
|
-
"onClick:clear":
|
|
551
|
+
"onClick:clear": B((o) => M(t), ["stop"])
|
|
567
552
|
}, {
|
|
568
553
|
default: Le(() => [
|
|
569
554
|
b(l.$slots, "chip", {
|
|
@@ -571,43 +556,43 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
571
556
|
hasErrors: l.hasErrors,
|
|
572
557
|
index: t.index,
|
|
573
558
|
item: t.original,
|
|
574
|
-
loading: !!
|
|
559
|
+
loading: !!c.value,
|
|
575
560
|
manual: t.manual,
|
|
576
561
|
selected: t.selected,
|
|
577
562
|
text: t.text,
|
|
578
563
|
value: t.value
|
|
579
564
|
}, () => [
|
|
580
|
-
ee(
|
|
565
|
+
ee(F(t.text), 1)
|
|
581
566
|
])
|
|
582
567
|
]),
|
|
583
568
|
_: 2
|
|
584
569
|
}, 1032, ["class", "text", "onClick:clear"]))), 128))
|
|
585
|
-
], 64)) :
|
|
570
|
+
], 64)) : se("", !0),
|
|
586
571
|
Fe(w("input", {
|
|
587
572
|
id: l.id,
|
|
588
573
|
ref_key: "input",
|
|
589
|
-
ref:
|
|
574
|
+
ref: T,
|
|
590
575
|
"onUpdate:modelValue": a[0] || (a[0] = (t) => u.value = t),
|
|
591
576
|
autocomplete: l.autocomplete,
|
|
592
577
|
autofocus: l.autofocus,
|
|
593
|
-
class:
|
|
578
|
+
class: I("bb-base-select__text-input"),
|
|
594
579
|
disabled: l.disabled,
|
|
595
580
|
placeholder: fe.value,
|
|
596
581
|
readonly: l.readonly || !l.allowWriting,
|
|
597
582
|
type: "text",
|
|
598
|
-
onBlur:
|
|
599
|
-
onChange:
|
|
600
|
-
onFocus:
|
|
601
|
-
onInput:
|
|
602
|
-
onKeydown:
|
|
603
|
-
}, null, 40,
|
|
583
|
+
onBlur: B(Ve, ["stop"]),
|
|
584
|
+
onChange: B(Oe, ["stop"]),
|
|
585
|
+
onFocus: B(we, ["stop"]),
|
|
586
|
+
onInput: B(Ce, ["stop"]),
|
|
587
|
+
onKeydown: B(Se, ["stop"])
|
|
588
|
+
}, null, 40, el), [
|
|
604
589
|
[Me, u.value]
|
|
605
590
|
]),
|
|
606
|
-
(g(),
|
|
591
|
+
(g(), ie(Ae, { to: "body" }, [
|
|
607
592
|
w("span", {
|
|
608
593
|
ref_key: "optionsContainer",
|
|
609
|
-
ref:
|
|
610
|
-
class:
|
|
594
|
+
ref: d,
|
|
595
|
+
class: I({
|
|
611
596
|
"bb-base-select__options-container": !0,
|
|
612
597
|
"bb-base-select__options-container--shown": k.value,
|
|
613
598
|
"bb-base-select__options-container--showing": Q.value,
|
|
@@ -619,16 +604,16 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
619
604
|
tabindex: -1
|
|
620
605
|
}, [
|
|
621
606
|
b(l.$slots, "options:prepend"),
|
|
622
|
-
!C.value.length &&
|
|
607
|
+
!C.value.length && c.value ? (g(), h("span", ll, [
|
|
623
608
|
b(l.$slots, "loading", { query: u.value }, () => [
|
|
624
|
-
ee(
|
|
609
|
+
ee(F(l.loadingText), 1)
|
|
625
610
|
])
|
|
626
|
-
])) : C.value.length ?
|
|
611
|
+
])) : C.value.length ? se("", !0) : (g(), h("span", tl, [
|
|
627
612
|
b(l.$slots, "no-data", { query: u.value }, () => [
|
|
628
|
-
ee(
|
|
613
|
+
ee(F(l.noDataText), 1)
|
|
629
614
|
])
|
|
630
615
|
])),
|
|
631
|
-
(g(!0), h(
|
|
616
|
+
(g(!0), h(L, null, P(C.value, (t) => (g(), h(L, {
|
|
632
617
|
key: t.id
|
|
633
618
|
}, [
|
|
634
619
|
b(l.$slots, "option:prepend", {
|
|
@@ -637,14 +622,14 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
637
622
|
w("span", {
|
|
638
623
|
id: t.id,
|
|
639
624
|
"aria-selected": t.selected,
|
|
640
|
-
class:
|
|
625
|
+
class: I({
|
|
641
626
|
"bb-base-select-option": !0,
|
|
642
627
|
"bb-base-select-option--selected": t.selected,
|
|
643
628
|
"bb-base-select-option--focused": t.focused,
|
|
644
629
|
"bb-base-select-option--disabled": t.disabled
|
|
645
630
|
}),
|
|
646
631
|
role: "option",
|
|
647
|
-
onClick:
|
|
632
|
+
onClick: B(Ie, ["stop"])
|
|
648
633
|
}, [
|
|
649
634
|
b(l.$slots, "option", {
|
|
650
635
|
disabled: t.disabled,
|
|
@@ -652,17 +637,17 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
652
637
|
hasErrors: l.hasErrors,
|
|
653
638
|
index: t.index,
|
|
654
639
|
item: t.original,
|
|
655
|
-
loading: !!
|
|
640
|
+
loading: !!c.value,
|
|
656
641
|
manual: t.manual,
|
|
657
642
|
selected: t.selected,
|
|
658
643
|
text: t.text,
|
|
659
644
|
value: t.value
|
|
660
645
|
}, () => [
|
|
661
|
-
w("span",
|
|
662
|
-
w("span",
|
|
646
|
+
w("span", nl, [
|
|
647
|
+
w("span", ol, F(t.text), 1)
|
|
663
648
|
])
|
|
664
649
|
])
|
|
665
|
-
], 10,
|
|
650
|
+
], 10, al),
|
|
666
651
|
b(l.$slots, "option:append", {
|
|
667
652
|
item: t.original
|
|
668
653
|
})
|
|
@@ -671,36 +656,36 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
671
656
|
], 6)
|
|
672
657
|
]))
|
|
673
658
|
]),
|
|
674
|
-
w("span",
|
|
659
|
+
w("span", ul, [
|
|
675
660
|
b(l.$slots, "chevron", {
|
|
676
|
-
loading: !!
|
|
661
|
+
loading: !!c.value,
|
|
677
662
|
shown: k.value
|
|
678
663
|
}, () => [
|
|
679
|
-
|
|
664
|
+
il
|
|
680
665
|
])
|
|
681
666
|
]),
|
|
682
|
-
|
|
667
|
+
c.value ? (g(), h("span", {
|
|
683
668
|
key: 1,
|
|
684
|
-
class:
|
|
669
|
+
class: I({
|
|
685
670
|
"bb-base-select__spinner": !0,
|
|
686
|
-
"bb-base-select__spinner--loading":
|
|
671
|
+
"bb-base-select__spinner--loading": c.value
|
|
687
672
|
})
|
|
688
673
|
}, [
|
|
689
674
|
b(l.$slots, "spinner", {
|
|
690
|
-
loading: !!
|
|
675
|
+
loading: !!c.value
|
|
691
676
|
}, () => [
|
|
692
|
-
Je(
|
|
677
|
+
Je(He, { size: "sm" })
|
|
693
678
|
])
|
|
694
679
|
], 2)) : b(l.$slots, "append", { key: 0 })
|
|
695
680
|
], 512),
|
|
696
681
|
b(l.$slots, "append-outer"),
|
|
697
|
-
(g(!0), h(
|
|
682
|
+
(g(!0), h(L, null, P(Ee.value, (t) => (g(), h("input", Re({
|
|
698
683
|
key: t.value
|
|
699
684
|
}, t), null, 16))), 128))
|
|
700
685
|
], 2));
|
|
701
686
|
}
|
|
702
687
|
});
|
|
703
688
|
export {
|
|
704
|
-
|
|
689
|
+
Cl as default
|
|
705
690
|
};
|
|
706
691
|
//# sourceMappingURL=index31.js.map
|