bitboss-ui 0.2.53 → 0.2.55
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/index101.js +1 -1
- 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/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/index197.js +233 -8
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +10 -5
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +2 -16
- package/dist/index199.js.map +1 -1
- package/dist/index200.js +4 -16
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +366 -17
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +131 -17
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +5 -29
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +19 -8
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +2 -2
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +2 -2
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +174 -3
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +23 -35
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +373 -6
- package/dist/index209.js.map +1 -1
- package/dist/index210.js +1 -1
- package/dist/index211.js +1 -1
- package/dist/index212.js +2 -368
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +13 -131
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +16 -2
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +18 -172
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +29 -23
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +8 -373
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +3 -235
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +35 -4
- package/dist/index219.js.map +1 -1
- package/dist/index220.js +6 -2
- package/dist/index220.js.map +1 -1
- package/dist/index223.js +4 -4
- package/dist/index226.js +1 -1
- package/dist/index230.js +69 -295
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +5 -6
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +4 -2
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +6 -2
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +2 -2
- package/dist/index235.js +295 -2
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +2 -2
- package/dist/index238.js +110 -428
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +105 -88
- package/dist/index239.js.map +1 -1
- package/dist/index240.js +224 -69
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +53 -19
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +2 -258
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +15 -200
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +2 -2
- package/dist/index245.js +2 -117
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +2 -106
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +2 -5
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +434 -3
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +86 -12
- package/dist/index249.js.map +1 -1
- package/dist/index25.js +2 -2
- package/dist/index250.js +200 -2
- package/dist/index250.js.map +1 -1
- package/dist/index255.js +1 -1
- package/dist/index29.js +2 -2
- package/dist/index31.js +168 -168
- package/dist/index31.js.map +1 -1
- package/dist/index33.js +1 -1
- 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/index79.js +3 -3
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index31.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as Ie, ref as f, computed as g, onMounted as Ne, onBeforeUnmount as $e, watch as X, openBlock as p, createElementBlock as h, normalizeClass as B, renderSlot as b, createElementVNode as w, Fragment as L, renderList as j, toDisplayString as F, createBlock as se, withModifiers as E, withCtx as De, createTextVNode as ee, createCommentVNode as ie, withDirectives as Le, vModelDynamic as Fe, Teleport as Ae, normalizeStyle as Je, createVNode as Me, mergeProps as qe, nextTick as le } from "vue";
|
|
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
|
|
7
|
-
import { deepEqual as
|
|
8
|
-
import { head as
|
|
6
|
+
import { autoUpdate as Pe, computePosition as je, flip as Qe, shift as Ue } from "./index201.js";
|
|
7
|
+
import { deepEqual as oe } from "./index123.js";
|
|
8
|
+
import { head as We } from "./index212.js";
|
|
9
9
|
import { isNotNil as I } from "./index124.js";
|
|
10
|
-
import { last as Re } from "./
|
|
10
|
+
import { last as Re } from "./index206.js";
|
|
11
11
|
import { useItemText as Ke } from "./index125.js";
|
|
12
12
|
import { useItemValue as Ye } from "./index126.js";
|
|
13
13
|
import { wait as q } from "./index122.js";
|
|
14
|
-
import { when as Ze } from "./
|
|
15
|
-
import { offset as Ge } from "./
|
|
14
|
+
import { when as Ze } from "./index200.js";
|
|
15
|
+
import { offset as Ge } from "./index209.js";
|
|
16
16
|
const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomplete", "autofocus", "disabled", "placeholder", "readonly"], ll = {
|
|
17
17
|
key: 0,
|
|
18
18
|
class: "bb-base-select__loading-container"
|
|
@@ -30,7 +30,7 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
|
|
|
30
30
|
fill: "currentColor",
|
|
31
31
|
"fill-rule": "evenodd"
|
|
32
32
|
})
|
|
33
|
-
], -1), kl = /* @__PURE__ */
|
|
33
|
+
], -1), kl = /* @__PURE__ */ Ie({
|
|
34
34
|
__name: "BaseSelect",
|
|
35
35
|
props: {
|
|
36
36
|
allowWriting: { type: Boolean, default: !0 },
|
|
@@ -66,17 +66,17 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
|
|
|
66
66
|
updateOnAnimationFrame: { type: Boolean, default: !1 }
|
|
67
67
|
},
|
|
68
68
|
emits: ["blur", "change", "click", "focus", "inactive", "input", "update:modelValue"],
|
|
69
|
-
setup(
|
|
70
|
-
const l =
|
|
69
|
+
setup(re, { emit: ce }) {
|
|
70
|
+
const l = re, d = ce;
|
|
71
71
|
if (l.multiple && !Array.isArray(l.modelValue))
|
|
72
72
|
throw new Error('Multiple is set to "true" but modelValue is not an array.');
|
|
73
|
-
const
|
|
74
|
-
let
|
|
75
|
-
|
|
76
|
-
N.value &&
|
|
73
|
+
const _ = f(null), N = f(null), r = f(null), O = f(null), u = f(""), de = g(() => o.value.length ? "" : l.placeholder), c = f(0), fe = l.transitionDuration / 1e3 + "s";
|
|
74
|
+
let te;
|
|
75
|
+
Ne(async () => {
|
|
76
|
+
N.value && r.value && (te = Pe(
|
|
77
77
|
N.value,
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
r.value,
|
|
79
|
+
ye,
|
|
80
80
|
{
|
|
81
81
|
ancestorResize: !0,
|
|
82
82
|
ancestorScroll: !0,
|
|
@@ -84,11 +84,11 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
|
|
|
84
84
|
elementResize: !0
|
|
85
85
|
}
|
|
86
86
|
));
|
|
87
|
-
}),
|
|
88
|
-
|
|
87
|
+
}), $e(() => {
|
|
88
|
+
te();
|
|
89
89
|
});
|
|
90
|
-
const
|
|
91
|
-
const a =
|
|
90
|
+
const ae = f([]), v = f([]), V = f([]), { getItemText: ve } = Ke(), { getItemValue: me } = Ye(), pe = g(() => ae.value.map((e) => {
|
|
91
|
+
const a = ve(e, l.itemText), t = me(e, l.itemValue);
|
|
92
92
|
if (t === void 0)
|
|
93
93
|
throw new Error(
|
|
94
94
|
'The result of extracting "value" from option was undefined. Affected item is ' + JSON.stringify(e) + " please check itemValue property is correct."
|
|
@@ -103,30 +103,30 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
|
|
|
103
103
|
text: a,
|
|
104
104
|
value: t
|
|
105
105
|
};
|
|
106
|
-
})),
|
|
107
|
-
let e =
|
|
106
|
+
})), T = g(() => {
|
|
107
|
+
let e = pe.value.reduce(
|
|
108
108
|
(n, s) => (n[s.id] = s, n),
|
|
109
109
|
{}
|
|
110
110
|
);
|
|
111
111
|
const a = V.value.reduce(
|
|
112
112
|
(n, s) => (n[s.id] || (n[s.id] = s), n),
|
|
113
113
|
e
|
|
114
|
-
), t =
|
|
114
|
+
), t = v.value.reduce(
|
|
115
115
|
(n, s) => (n[s.id] || (n[s.id] = s), n),
|
|
116
116
|
a
|
|
117
117
|
);
|
|
118
118
|
return Object.values(t).map(
|
|
119
119
|
(n, s) => ({
|
|
120
120
|
...n,
|
|
121
|
-
selected: I(
|
|
121
|
+
selected: I(be.value.get(n.value)),
|
|
122
122
|
index: s
|
|
123
123
|
})
|
|
124
124
|
);
|
|
125
|
-
}),
|
|
125
|
+
}), S = g(() => {
|
|
126
126
|
let e = [];
|
|
127
127
|
return u.value && !o.value.some(
|
|
128
128
|
(a) => a.text === u.value
|
|
129
|
-
) ? e =
|
|
129
|
+
) ? e = T.value.filter((a) => {
|
|
130
130
|
let t = !1;
|
|
131
131
|
if (l.filterBy) {
|
|
132
132
|
if (typeof l.filterBy == "function")
|
|
@@ -141,21 +141,21 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
|
|
|
141
141
|
} else
|
|
142
142
|
return !0;
|
|
143
143
|
return t || a.text.toLowerCase().includes(u.value.toLowerCase());
|
|
144
|
-
}) : e =
|
|
144
|
+
}) : e = T.value, e.map((a, t) => ({
|
|
145
145
|
...a,
|
|
146
|
-
focused:
|
|
146
|
+
focused: k.value === t
|
|
147
147
|
}));
|
|
148
148
|
}), z = g(
|
|
149
|
-
() =>
|
|
149
|
+
() => T.value.reduce(
|
|
150
150
|
(e, a) => ({
|
|
151
151
|
...e,
|
|
152
152
|
[a.id]: a
|
|
153
153
|
}),
|
|
154
154
|
{}
|
|
155
155
|
)
|
|
156
|
-
),
|
|
156
|
+
), m = g(() => {
|
|
157
157
|
if (l.matchStrategy === "string") {
|
|
158
|
-
let e =
|
|
158
|
+
let e = T.value.reduce(
|
|
159
159
|
(a, t) => (a[t.jsonValue] = t, a),
|
|
160
160
|
{}
|
|
161
161
|
);
|
|
@@ -163,19 +163,19 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
|
|
|
163
163
|
get: (a) => e[JSON.stringify(a)]
|
|
164
164
|
};
|
|
165
165
|
} else if (l.matchStrategy === "equality") {
|
|
166
|
-
let e =
|
|
166
|
+
let e = T.value.map((a) => [
|
|
167
167
|
a.value,
|
|
168
168
|
a
|
|
169
169
|
]);
|
|
170
170
|
return {
|
|
171
171
|
get: (a) => {
|
|
172
172
|
var t;
|
|
173
|
-
return (t = e.find((n) =>
|
|
173
|
+
return (t = e.find((n) => oe(n[0], a))) == null ? void 0 : t[1];
|
|
174
174
|
}
|
|
175
175
|
};
|
|
176
176
|
} else
|
|
177
177
|
throw new Error("No match strategy has been defined");
|
|
178
|
-
}),
|
|
178
|
+
}), be = g(() => {
|
|
179
179
|
if (l.matchStrategy === "string") {
|
|
180
180
|
let e = {};
|
|
181
181
|
return [].concat(l.modelValue).forEach((a, t) => {
|
|
@@ -188,27 +188,27 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
|
|
|
188
188
|
return {
|
|
189
189
|
get: (a) => {
|
|
190
190
|
var t;
|
|
191
|
-
return (t = e.find((n) =>
|
|
191
|
+
return (t = e.find((n) => oe(n[0], a))) == null ? void 0 : t[1];
|
|
192
192
|
}
|
|
193
193
|
};
|
|
194
194
|
} else
|
|
195
195
|
throw new Error("No match strategy has been defined");
|
|
196
196
|
}), o = g(() => [].concat(l.modelValue).reduce((e, a) => {
|
|
197
|
-
const t =
|
|
197
|
+
const t = m.value.get(a);
|
|
198
198
|
return t && e.push(t), e;
|
|
199
199
|
}, [])), A = (e) => {
|
|
200
200
|
let a;
|
|
201
|
-
|
|
201
|
+
l.multiple ? (e.selected ? (e.manual && (V.value = V.value.filter(
|
|
202
202
|
(t) => t.id !== e.id
|
|
203
203
|
)), a = l.modelValue.filter(
|
|
204
204
|
(t) => JSON.stringify(t) !== e.jsonValue
|
|
205
|
-
), l.stash && (
|
|
205
|
+
), l.stash && (v.value = v.value.filter((t) => t.id !== e.id))) : (a = l.modelValue.concat(e.value), l.stash && (v.value = v.value.concat(e))), l.resetQueryOnOptionSelected && (u.value = "")) : e.selected ? (e.manual && (V.value = V.value.filter(
|
|
206
206
|
(t) => t.id !== e.id
|
|
207
|
-
)), a = null, l.stash && (
|
|
207
|
+
)), a = null, l.stash && (v.value = []), u.value = "") : (a = e.value, l.stash && (v.value = [e]), u.value = e.text), d("update:modelValue", a);
|
|
208
208
|
}, $ = async ({ prefill: e = !1 }) => {
|
|
209
209
|
let a = [];
|
|
210
|
-
Array.isArray(l.items) ? a = l.items : typeof l.items == "function" && (
|
|
211
|
-
},
|
|
210
|
+
Array.isArray(l.items) ? a = l.items : typeof l.items == "function" && (c.value++, a = await l.items(u.value, e, l.modelValue), c.value--), ae.value = a;
|
|
211
|
+
}, he = () => {
|
|
212
212
|
const e = u.value, a = u.value, t = JSON.stringify(a), n = {
|
|
213
213
|
text: e,
|
|
214
214
|
value: a,
|
|
@@ -230,29 +230,29 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
|
|
|
230
230
|
if (!Array.isArray(l.modelValue))
|
|
231
231
|
throw new Error("props.modelValue is not an array.");
|
|
232
232
|
let t = l.modelValue.every(
|
|
233
|
-
(n) =>
|
|
233
|
+
(n) => m.value.get(n)
|
|
234
234
|
);
|
|
235
235
|
if ((!t || a === void 0) && (await $({ prefill: !0 }), t = l.modelValue.every(
|
|
236
|
-
(n) =>
|
|
236
|
+
(n) => m.value.get(n)
|
|
237
237
|
)), t)
|
|
238
|
-
l.stash && (
|
|
239
|
-
(n) =>
|
|
238
|
+
l.stash && (v.value = l.modelValue.map(
|
|
239
|
+
(n) => m.value.get(n)
|
|
240
240
|
));
|
|
241
241
|
else {
|
|
242
242
|
let n = [];
|
|
243
243
|
const s = e.filter((x) => {
|
|
244
|
-
let M =
|
|
244
|
+
let M = m.value.get(x);
|
|
245
245
|
return M && n.push(M), M;
|
|
246
246
|
});
|
|
247
|
-
l.stash && (
|
|
247
|
+
l.stash && (v.value = n), l.enforceCoherence && d("update:modelValue", s);
|
|
248
248
|
}
|
|
249
249
|
} else {
|
|
250
|
-
let t =
|
|
250
|
+
let t = m.value.get(l.modelValue);
|
|
251
251
|
if (!t && I(l.modelValue) || a === void 0) {
|
|
252
252
|
const n = u.value;
|
|
253
253
|
u.value = "", await $({ prefill: !0 }), u.value = n;
|
|
254
254
|
}
|
|
255
|
-
t =
|
|
255
|
+
t = m.value.get(l.modelValue), t ? (u.value = t.text, l.stash && (v.value = [t])) : l.enforceCoherence && I(e) ? (u.value = "", l.stash && (v.value = []), d("update:modelValue", null)) : u.value = "";
|
|
256
256
|
}
|
|
257
257
|
},
|
|
258
258
|
H ? 0 : l.modelValueDebounceTime
|
|
@@ -267,13 +267,13 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
|
|
|
267
267
|
JSON.stringify(e) !== JSON.stringify(a))
|
|
268
268
|
if (await $({ prefill: !1 }), l.multiple) {
|
|
269
269
|
if (!l.modelValue.every(
|
|
270
|
-
(n) =>
|
|
270
|
+
(n) => m.value.get(n)
|
|
271
271
|
) && l.enforceCoherence) {
|
|
272
|
-
const n = l.modelValue.filter((s) =>
|
|
273
|
-
|
|
272
|
+
const n = l.modelValue.filter((s) => m.value.get(s));
|
|
273
|
+
d("update:modelValue", n);
|
|
274
274
|
}
|
|
275
275
|
} else
|
|
276
|
-
!
|
|
276
|
+
!m.value.get(l.modelValue) && l.enforceCoherence && I(l.modelValue) && d("update:modelValue", null), y.value = null;
|
|
277
277
|
}
|
|
278
278
|
);
|
|
279
279
|
let U;
|
|
@@ -282,61 +282,61 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
|
|
|
282
282
|
(e, a) => {
|
|
283
283
|
!H && l.prefill === "focus" && Y || JSON.stringify(e) !== JSON.stringify(a) && (U && clearTimeout(U), U = setTimeout(async () => {
|
|
284
284
|
if (JSON.stringify(e) !== JSON.stringify(a)) {
|
|
285
|
-
l.enforceCoherence && l.stash && (
|
|
285
|
+
l.enforceCoherence && l.stash && (v.value = []);
|
|
286
286
|
let t = u.value;
|
|
287
287
|
if (u.value = "", await $({ prefill: !0 }), u.value = t, !l.multiple)
|
|
288
|
-
!
|
|
288
|
+
!m.value.get(l.modelValue) && l.enforceCoherence && I(l.modelValue) && (u.value = "", l.stash && (v.value = []), d("update:modelValue", null));
|
|
289
289
|
else if (!l.modelValue.every(
|
|
290
|
-
(s) =>
|
|
290
|
+
(s) => m.value.get(s)
|
|
291
291
|
) && l.enforceCoherence) {
|
|
292
292
|
let s = [];
|
|
293
293
|
const x = l.modelValue.filter((M) => {
|
|
294
|
-
let G =
|
|
294
|
+
let G = m.value.get(M);
|
|
295
295
|
return G && s.push(G), G;
|
|
296
296
|
});
|
|
297
|
-
l.stash && (
|
|
297
|
+
l.stash && (v.value = s), d("update:modelValue", x);
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
300
|
}, l.depsDebounceTime));
|
|
301
301
|
},
|
|
302
302
|
{ deep: !0 }
|
|
303
303
|
);
|
|
304
|
-
const
|
|
305
|
-
N.value &&
|
|
304
|
+
const ye = () => {
|
|
305
|
+
N.value && r.value && je(N.value, r.value, {
|
|
306
306
|
placement: "bottom",
|
|
307
|
-
middleware: [Ge(6),
|
|
307
|
+
middleware: [Ge(6), Qe(), Ue()]
|
|
308
308
|
}).then((e) => {
|
|
309
309
|
var a;
|
|
310
|
-
|
|
310
|
+
r.value && (r.value.style.left = `${e.x}px`, r.value.style.top = `${e.y}px`, r.value.style.width = `${(a = N.value) == null ? void 0 : a.offsetWidth}px`);
|
|
311
311
|
});
|
|
312
|
-
},
|
|
313
|
-
K.value = !1, W.value = !0, await q(l.transitionDuration), W.value = !1,
|
|
312
|
+
}, C = f(!1), W = f(!1), R = f(!1), K = f(!0), D = async () => {
|
|
313
|
+
K.value = !1, W.value = !0, await q(l.transitionDuration), W.value = !1, C.value = !0;
|
|
314
314
|
}, J = async () => {
|
|
315
|
-
|
|
316
|
-
}, P =
|
|
315
|
+
C.value = !1, R.value = !0, await q(l.transitionDuration), R.value = !1, K.value = !0;
|
|
316
|
+
}, P = f(!1);
|
|
317
317
|
let Y = !0;
|
|
318
|
-
const
|
|
319
|
-
|
|
320
|
-
},
|
|
321
|
-
if (e.target instanceof Node &&
|
|
322
|
-
J(),
|
|
318
|
+
const ge = async (e) => {
|
|
319
|
+
d("focus", e), P.value = !0, document.addEventListener("click", ue), document.addEventListener("focusin", ne), O.value instanceof HTMLInputElement && O.value.select(), l.prefill === "focus" && Y && !H && (await $({ prefill: !0 }), Y = !1);
|
|
320
|
+
}, ne = async (e) => {
|
|
321
|
+
if (e.target instanceof Node && _.value && r.value && !_.value.contains(e.target) && !r.value.contains(e.target)) {
|
|
322
|
+
J(), d("inactive"), document.removeEventListener("focusin", ne), P.value = !1, l.multiple && (await q(500), u.value = "");
|
|
323
323
|
return;
|
|
324
324
|
}
|
|
325
|
-
},
|
|
326
|
-
if (
|
|
325
|
+
}, we = async (e) => {
|
|
326
|
+
if (d("blur", e), !l.multiple && (await le(), await q(300), _.value && r.value)) {
|
|
327
327
|
const a = document.activeElement;
|
|
328
|
-
if (!
|
|
329
|
-
const t =
|
|
328
|
+
if (!_.value.contains(a) && !r.value.contains(a)) {
|
|
329
|
+
const t = m.value.get(l.modelValue);
|
|
330
330
|
t && (u.value = t.text);
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
|
-
},
|
|
334
|
-
|
|
335
|
-
},
|
|
333
|
+
}, Ve = (e) => d("change", e), Ce = (e) => {
|
|
334
|
+
d("input", e), u.value === "" && (l.multiple || d("update:modelValue", null)), typeof l.items == "function" && Te();
|
|
335
|
+
}, y = f(null), k = g(() => Number.isInteger(y.value) && y.value ? y.value % S.value.length : y.value), i = f(null), ke = async () => {
|
|
336
336
|
var e;
|
|
337
|
-
if (
|
|
338
|
-
const a = (e =
|
|
339
|
-
`#${
|
|
337
|
+
if (await le(), k.value !== null) {
|
|
338
|
+
const a = (e = r.value) == null ? void 0 : e.querySelector(
|
|
339
|
+
`#${T.value[k.value].id}`
|
|
340
340
|
);
|
|
341
341
|
a instanceof HTMLElement && a.scrollIntoView({
|
|
342
342
|
behavior: "smooth",
|
|
@@ -344,11 +344,11 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
|
|
|
344
344
|
inline: "start"
|
|
345
345
|
});
|
|
346
346
|
}
|
|
347
|
-
},
|
|
347
|
+
}, _e = async () => {
|
|
348
348
|
var e;
|
|
349
|
-
if (
|
|
350
|
-
const a = (e =
|
|
351
|
-
`#${
|
|
349
|
+
if (await le(), k.value !== null) {
|
|
350
|
+
const a = (e = r.value) == null ? void 0 : e.querySelector(
|
|
351
|
+
`#${T.value[k.value].id}`
|
|
352
352
|
);
|
|
353
353
|
a instanceof HTMLElement && a.scrollIntoView({
|
|
354
354
|
behavior: "smooth",
|
|
@@ -356,7 +356,7 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
|
|
|
356
356
|
inline: "start"
|
|
357
357
|
});
|
|
358
358
|
}
|
|
359
|
-
},
|
|
359
|
+
}, Oe = async (e) => {
|
|
360
360
|
var a, t;
|
|
361
361
|
if (l.readonly || l.disabled) {
|
|
362
362
|
e.preventDefault();
|
|
@@ -365,61 +365,61 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
|
|
|
365
365
|
switch (e.key) {
|
|
366
366
|
case "ArrowUp":
|
|
367
367
|
{
|
|
368
|
-
if (e.preventDefault(),
|
|
368
|
+
if (e.preventDefault(), c.value)
|
|
369
369
|
return;
|
|
370
|
-
i.value = null,
|
|
370
|
+
i.value = null, C.value ? _e() : (o.value.length, await D());
|
|
371
371
|
}
|
|
372
372
|
break;
|
|
373
373
|
case "ArrowDown":
|
|
374
374
|
{
|
|
375
|
-
if (e.preventDefault(),
|
|
375
|
+
if (e.preventDefault(), c.value)
|
|
376
376
|
return;
|
|
377
|
-
i.value = null,
|
|
377
|
+
i.value = null, C.value ? ke() : (o.value.length, await D());
|
|
378
378
|
}
|
|
379
379
|
break;
|
|
380
380
|
case "ArrowLeft":
|
|
381
381
|
{
|
|
382
|
-
if (
|
|
382
|
+
if (c.value)
|
|
383
383
|
return;
|
|
384
384
|
if (!u.value && o.value.length && (i.value === null ? i.value = o.value.length - 1 : i.value > 0 ? i.value-- : i.value = null, i.value !== null)) {
|
|
385
|
-
let n = o.value[i.value], s = (a =
|
|
385
|
+
let n = o.value[i.value], s = (a = r.value) == null ? void 0 : a.querySelector(
|
|
386
386
|
`#${n.id}`
|
|
387
387
|
);
|
|
388
388
|
s && (s.scrollIntoView({
|
|
389
389
|
behavior: "smooth",
|
|
390
390
|
block: "nearest",
|
|
391
391
|
inline: "start"
|
|
392
|
-
}),
|
|
392
|
+
}), y.value = z.value[o.value[i.value].id].index);
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
395
|
break;
|
|
396
396
|
case "ArrowRight":
|
|
397
397
|
{
|
|
398
|
-
if (
|
|
398
|
+
if (c.value)
|
|
399
399
|
return;
|
|
400
400
|
if (!u.value && o.value.length && (i.value === null ? i.value = 0 : i.value < o.value.length - 1 ? i.value++ : i.value = null, i.value !== null)) {
|
|
401
|
-
let n = o.value[i.value], s = (t =
|
|
401
|
+
let n = o.value[i.value], s = (t = r.value) == null ? void 0 : t.querySelector(
|
|
402
402
|
`#${n.id}`
|
|
403
403
|
);
|
|
404
404
|
s && (s.scrollIntoView({
|
|
405
405
|
behavior: "smooth",
|
|
406
406
|
block: "nearest",
|
|
407
407
|
inline: "start"
|
|
408
|
-
}),
|
|
408
|
+
}), y.value = z.value[o.value[i.value].id].index);
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
411
|
break;
|
|
412
412
|
case "Enter":
|
|
413
413
|
{
|
|
414
|
-
if (e.preventDefault(),
|
|
414
|
+
if (e.preventDefault(), c.value)
|
|
415
415
|
return;
|
|
416
|
-
if (!
|
|
417
|
-
|
|
418
|
-
else if (
|
|
419
|
-
if (
|
|
416
|
+
if (!C.value)
|
|
417
|
+
S.value.length && o.value.length && (y.value = We(o.value).index), await D();
|
|
418
|
+
else if (k.value !== null) {
|
|
419
|
+
if (S.value[k.value].disabled)
|
|
420
420
|
return;
|
|
421
421
|
l.multiple || await J(), A(
|
|
422
|
-
|
|
422
|
+
S.value[k.value]
|
|
423
423
|
);
|
|
424
424
|
} else if (l.addOptions) {
|
|
425
425
|
if (l.itemText || l.itemValue) {
|
|
@@ -428,7 +428,7 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
|
|
|
428
428
|
);
|
|
429
429
|
return;
|
|
430
430
|
}
|
|
431
|
-
|
|
431
|
+
he();
|
|
432
432
|
const n = Re(V.value);
|
|
433
433
|
A(z.value[n.id]);
|
|
434
434
|
}
|
|
@@ -436,15 +436,15 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
|
|
|
436
436
|
break;
|
|
437
437
|
case "Tab":
|
|
438
438
|
case "Escape":
|
|
439
|
-
|
|
439
|
+
C.value && await J(), d("inactive"), i.value = null, y.value = null;
|
|
440
440
|
break;
|
|
441
441
|
case "Shift":
|
|
442
|
-
if (
|
|
442
|
+
if (c.value)
|
|
443
443
|
return;
|
|
444
444
|
break;
|
|
445
445
|
case "Backspace":
|
|
446
446
|
{
|
|
447
|
-
if (
|
|
447
|
+
if (c.value)
|
|
448
448
|
return;
|
|
449
449
|
u.value || o.value.length && (i.value === null ? i.value = o.value.length - 1 : (A(
|
|
450
450
|
o.value[i.value]
|
|
@@ -458,12 +458,12 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
|
|
|
458
458
|
}
|
|
459
459
|
break;
|
|
460
460
|
default:
|
|
461
|
-
i.value = null,
|
|
461
|
+
i.value = null, y.value = null, await D();
|
|
462
462
|
break;
|
|
463
463
|
}
|
|
464
464
|
};
|
|
465
465
|
let Z;
|
|
466
|
-
const
|
|
466
|
+
const Te = () => {
|
|
467
467
|
Z && clearTimeout(Z), Z = setTimeout(async () => {
|
|
468
468
|
try {
|
|
469
469
|
await $({ prefill: !1 });
|
|
@@ -471,25 +471,25 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
|
|
|
471
471
|
console.error(e);
|
|
472
472
|
}
|
|
473
473
|
}, l.queryDebounceTime);
|
|
474
|
+
}, Se = (e) => {
|
|
475
|
+
d("click", e), !(l.disabled || l.readonly) && (O.value instanceof HTMLElement && O.value.focus(), D());
|
|
474
476
|
}, xe = (e) => {
|
|
475
|
-
f("click", e), !(l.disabled || l.readonly) && (S.value instanceof HTMLElement && S.value.focus(), D());
|
|
476
|
-
}, Be = (e) => {
|
|
477
477
|
if (e.currentTarget instanceof HTMLElement && e.currentTarget.classList.contains("bb-base-select-option")) {
|
|
478
478
|
const a = z.value[e.currentTarget.id];
|
|
479
479
|
if (a.disabled)
|
|
480
480
|
return;
|
|
481
|
-
A(a),
|
|
481
|
+
A(a), O.value instanceof HTMLInputElement && O.value.focus(), l.multiple || J();
|
|
482
482
|
}
|
|
483
|
-
},
|
|
484
|
-
if (e.target instanceof Node &&
|
|
485
|
-
J(),
|
|
483
|
+
}, ue = async (e) => {
|
|
484
|
+
if (e.target instanceof Node && _.value && !_.value.contains(e.target)) {
|
|
485
|
+
J(), d("inactive"), document.removeEventListener("click", ue), P.value = !1, l.multiple && (await q(500), u.value = "");
|
|
486
486
|
return;
|
|
487
487
|
}
|
|
488
|
-
},
|
|
488
|
+
}, Be = Ze(
|
|
489
489
|
(e) => typeof e != "string",
|
|
490
490
|
JSON.stringify
|
|
491
|
-
),
|
|
492
|
-
const a =
|
|
491
|
+
), Ee = g(() => [].concat(l.modelValue).map((e) => {
|
|
492
|
+
const a = Be(e);
|
|
493
493
|
return {
|
|
494
494
|
disabled: l.disabled,
|
|
495
495
|
name: l.name,
|
|
@@ -497,36 +497,36 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
|
|
|
497
497
|
value: a
|
|
498
498
|
};
|
|
499
499
|
}));
|
|
500
|
-
return (e, a) => (
|
|
500
|
+
return (e, a) => (p(), h("span", {
|
|
501
501
|
ref_key: "outerContainer",
|
|
502
|
-
ref:
|
|
502
|
+
ref: _,
|
|
503
503
|
class: B({
|
|
504
504
|
"bb-base-select": !0,
|
|
505
505
|
"bb-base-select--active": P.value,
|
|
506
|
-
"bb-base-select--loading":
|
|
506
|
+
"bb-base-select--loading": c.value,
|
|
507
507
|
"bb-base-select--disabled": e.disabled,
|
|
508
508
|
"bb-base-select--errors": e.hasErrors,
|
|
509
509
|
"bb-base-select--readonly": e.readonly
|
|
510
510
|
}),
|
|
511
|
-
onClick:
|
|
511
|
+
onClick: Se
|
|
512
512
|
}, [
|
|
513
|
-
|
|
513
|
+
b(e.$slots, "prepend-outer"),
|
|
514
514
|
w("span", {
|
|
515
515
|
ref_key: "innerContainer",
|
|
516
516
|
ref: N,
|
|
517
517
|
class: "bb-base-select__inner-container"
|
|
518
518
|
}, [
|
|
519
|
-
|
|
519
|
+
b(e.$slots, "prepend"),
|
|
520
520
|
w("span", Xe, [
|
|
521
|
-
e.multiple ? (
|
|
522
|
-
e.comma ? (
|
|
521
|
+
e.multiple ? (p(), h(L, { key: 0 }, [
|
|
522
|
+
e.comma ? (p(!0), h(L, { key: 0 }, j(o.value, (t, n) => (p(), h("span", {
|
|
523
523
|
key: t.id,
|
|
524
524
|
class: B({
|
|
525
525
|
"bb-base-select__selected": !0,
|
|
526
526
|
"bb-base-select__selected--comma": !0,
|
|
527
527
|
"bb-base-select__selected--focused": n === i.value
|
|
528
528
|
})
|
|
529
|
-
}, F(t.text) + F(n < o.value.length - 1 ? "," : ""), 3))), 128)) : (
|
|
529
|
+
}, F(t.text) + F(n < o.value.length - 1 ? "," : ""), 3))), 128)) : (p(!0), h(L, { key: 1 }, j(o.value, (t, n) => (p(), se(ze, {
|
|
530
530
|
key: t.id,
|
|
531
531
|
class: B({
|
|
532
532
|
"bb-base-select__selected": !0,
|
|
@@ -537,13 +537,13 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
|
|
|
537
537
|
text: t.text,
|
|
538
538
|
"onClick:clear": E((s) => A(t), ["stop"])
|
|
539
539
|
}, {
|
|
540
|
-
default:
|
|
541
|
-
|
|
540
|
+
default: De(() => [
|
|
541
|
+
b(e.$slots, "chip", {
|
|
542
542
|
disabled: t.disabled,
|
|
543
543
|
hasErrors: e.hasErrors,
|
|
544
544
|
index: t.index,
|
|
545
545
|
item: t.original,
|
|
546
|
-
loading: !!
|
|
546
|
+
loading: !!c.value,
|
|
547
547
|
manual: t.manual,
|
|
548
548
|
selected: t.selected,
|
|
549
549
|
text: t.text,
|
|
@@ -554,56 +554,56 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
|
|
|
554
554
|
]),
|
|
555
555
|
_: 2
|
|
556
556
|
}, 1032, ["class", "text", "onClick:clear"]))), 128))
|
|
557
|
-
], 64)) :
|
|
558
|
-
|
|
557
|
+
], 64)) : ie("", !0),
|
|
558
|
+
Le(w("input", {
|
|
559
559
|
id: e.id,
|
|
560
560
|
ref_key: "input",
|
|
561
|
-
ref:
|
|
561
|
+
ref: O,
|
|
562
562
|
"onUpdate:modelValue": a[0] || (a[0] = (t) => u.value = t),
|
|
563
563
|
autocomplete: e.autocomplete,
|
|
564
564
|
autofocus: e.autofocus,
|
|
565
565
|
class: B("bb-base-select__text-input"),
|
|
566
566
|
disabled: e.disabled,
|
|
567
|
-
placeholder:
|
|
567
|
+
placeholder: de.value,
|
|
568
568
|
readonly: e.readonly || !e.allowWriting,
|
|
569
569
|
type: "text",
|
|
570
|
-
onBlur: E(
|
|
571
|
-
onChange: E(
|
|
572
|
-
onFocus: E(
|
|
573
|
-
onInput: E(
|
|
574
|
-
onKeydown: E(
|
|
570
|
+
onBlur: E(we, ["stop"]),
|
|
571
|
+
onChange: E(Ve, ["stop"]),
|
|
572
|
+
onFocus: E(ge, ["stop"]),
|
|
573
|
+
onInput: E(Ce, ["stop"]),
|
|
574
|
+
onKeydown: E(Oe, ["stop"])
|
|
575
575
|
}, null, 40, el), [
|
|
576
|
-
[
|
|
576
|
+
[Fe, u.value]
|
|
577
577
|
]),
|
|
578
|
-
(
|
|
578
|
+
(p(), se(Ae, { to: "body" }, [
|
|
579
579
|
w("span", {
|
|
580
580
|
ref_key: "optionsContainer",
|
|
581
|
-
ref:
|
|
581
|
+
ref: r,
|
|
582
582
|
class: B({
|
|
583
583
|
"bb-base-select__options-container": !0,
|
|
584
|
-
"bb-base-select__options-container--shown":
|
|
584
|
+
"bb-base-select__options-container--shown": C.value,
|
|
585
585
|
"bb-base-select__options-container--showing": W.value,
|
|
586
586
|
"bb-base-select__options-container--hiding": R.value,
|
|
587
587
|
"bb-base-select__options-container--hidden": K.value
|
|
588
588
|
}),
|
|
589
589
|
role: "listbox",
|
|
590
|
-
style:
|
|
590
|
+
style: Je({ transitionDuration: fe }),
|
|
591
591
|
tabindex: -1
|
|
592
592
|
}, [
|
|
593
|
-
|
|
594
|
-
!
|
|
595
|
-
|
|
593
|
+
b(e.$slots, "options:prepend"),
|
|
594
|
+
!S.value.length && c.value ? (p(), h("span", ll, [
|
|
595
|
+
b(e.$slots, "loading", { query: u.value }, () => [
|
|
596
596
|
ee(F(e.loadingText), 1)
|
|
597
597
|
])
|
|
598
|
-
])) :
|
|
599
|
-
|
|
598
|
+
])) : S.value.length ? ie("", !0) : (p(), h("span", tl, [
|
|
599
|
+
b(e.$slots, "no-data", { query: u.value }, () => [
|
|
600
600
|
ee(F(e.noDataText), 1)
|
|
601
601
|
])
|
|
602
602
|
])),
|
|
603
|
-
(
|
|
603
|
+
(p(!0), h(L, null, j(S.value, (t) => (p(), h(L, {
|
|
604
604
|
key: t.id
|
|
605
605
|
}, [
|
|
606
|
-
|
|
606
|
+
b(e.$slots, "option:prepend", {
|
|
607
607
|
item: t.original
|
|
608
608
|
}),
|
|
609
609
|
w("span", {
|
|
@@ -616,15 +616,15 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
|
|
|
616
616
|
"bb-base-select-option--disabled": t.disabled
|
|
617
617
|
}),
|
|
618
618
|
role: "option",
|
|
619
|
-
onClick: E(
|
|
619
|
+
onClick: E(xe, ["stop"])
|
|
620
620
|
}, [
|
|
621
|
-
|
|
621
|
+
b(e.$slots, "option", {
|
|
622
622
|
disabled: t.disabled,
|
|
623
623
|
focused: t.focused,
|
|
624
624
|
hasErrors: e.hasErrors,
|
|
625
625
|
index: t.index,
|
|
626
626
|
item: t.original,
|
|
627
|
-
loading: !!
|
|
627
|
+
loading: !!c.value,
|
|
628
628
|
manual: t.manual,
|
|
629
629
|
selected: t.selected,
|
|
630
630
|
text: t.text,
|
|
@@ -635,38 +635,38 @@ const Xe = { class: "bb-base-select__input-container" }, el = ["id", "autocomple
|
|
|
635
635
|
])
|
|
636
636
|
])
|
|
637
637
|
], 10, al),
|
|
638
|
-
|
|
638
|
+
b(e.$slots, "option:append", {
|
|
639
639
|
item: t.original
|
|
640
640
|
})
|
|
641
641
|
], 64))), 128)),
|
|
642
|
-
|
|
642
|
+
b(e.$slots, "options:append")
|
|
643
643
|
], 6)
|
|
644
644
|
]))
|
|
645
645
|
]),
|
|
646
646
|
w("span", sl, [
|
|
647
|
-
|
|
648
|
-
loading: !!
|
|
649
|
-
shown:
|
|
647
|
+
b(e.$slots, "chevron", {
|
|
648
|
+
loading: !!c.value,
|
|
649
|
+
shown: C.value
|
|
650
650
|
}, () => [
|
|
651
651
|
il
|
|
652
652
|
])
|
|
653
653
|
]),
|
|
654
|
-
|
|
654
|
+
c.value ? (p(), h("span", {
|
|
655
655
|
key: 1,
|
|
656
656
|
class: B({
|
|
657
657
|
"bb-base-select__spinner": !0,
|
|
658
|
-
"bb-base-select__spinner--loading":
|
|
658
|
+
"bb-base-select__spinner--loading": c.value
|
|
659
659
|
})
|
|
660
660
|
}, [
|
|
661
|
-
|
|
662
|
-
loading: !!
|
|
661
|
+
b(e.$slots, "spinner", {
|
|
662
|
+
loading: !!c.value
|
|
663
663
|
}, () => [
|
|
664
|
-
|
|
664
|
+
Me(He, { size: "sm" })
|
|
665
665
|
])
|
|
666
|
-
], 2)) :
|
|
666
|
+
], 2)) : b(e.$slots, "append", { key: 0 })
|
|
667
667
|
], 512),
|
|
668
|
-
|
|
669
|
-
(
|
|
668
|
+
b(e.$slots, "append-outer"),
|
|
669
|
+
(p(!0), h(L, null, j(Ee.value, (t) => (p(), h("input", qe({
|
|
670
670
|
key: t.value
|
|
671
671
|
}, t), null, 16))), 128))
|
|
672
672
|
], 2));
|