bitboss-ui 2.1.0 → 2.1.1
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/BaseButton/BaseButton.vue.d.ts +1 -1
- package/dist/components/BaseDialog/BaseDialog.vue.d.ts +1 -1
- package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +1 -1
- package/dist/components/BbPopover/BbPopover.vue.d.ts +1 -1
- package/dist/components/BbSmoothHeight/BbSmoothHeight.vue.d.ts +2 -2
- package/dist/components/BbTooltip/BbTooltip.vue.d.ts +1 -1
- package/dist/index.css +1 -1
- package/dist/index106.js +7 -7
- package/dist/index113.js +1 -1
- package/dist/index121.js +11 -11
- package/dist/index129.js +1 -1
- package/dist/index13.js +1 -1
- package/dist/index131.js +3 -3
- package/dist/index133.js +1 -1
- package/dist/index136.js +1 -1
- package/dist/index137.js +2 -2
- package/dist/index139.js +2 -2
- package/dist/index15.js +8 -8
- package/dist/index17.js +3 -3
- package/dist/index19.js +8 -8
- package/dist/index206.js +138 -2
- package/dist/index207.js +2 -138
- package/dist/index209.js +13 -2
- package/dist/index21.js +16 -16
- package/dist/index210.js +13 -4
- package/dist/index211.js +11 -2
- package/dist/index212.js +31 -63
- package/dist/index213.js +68 -0
- package/dist/index215.js +13 -13
- package/dist/index216.js +4 -13
- package/dist/index217.js +19 -10
- package/dist/index218.js +197 -5
- package/dist/index220.js +113 -5
- package/dist/index222.js +3 -5
- package/dist/index223.js +86 -5
- package/dist/index225.js +29 -2
- package/dist/index226.js +17 -2
- package/dist/index227.js +49 -18
- package/dist/index228.js +15 -113
- package/dist/index229.js +5 -0
- package/dist/index23.js +15 -15
- package/dist/index230.js +12 -86
- package/dist/index231.js +18 -0
- package/dist/index232.js +2 -29
- package/dist/index233.js +4 -16
- package/dist/index234.js +5 -17
- package/dist/index235.js +5 -51
- package/dist/index236.js +5 -15
- package/dist/index237.js +5 -3
- package/dist/index238.js +5 -12
- package/dist/index239.js +5 -4
- package/dist/index240.js +2 -197
- package/dist/index241.js +4 -0
- package/dist/index242.js +2 -5
- package/dist/index243.js +18 -5
- package/dist/index244.js +12 -8
- package/dist/index245.js +5 -249
- package/dist/index246.js +100 -46
- package/dist/index248.js +100 -5
- package/dist/index25.js +35 -42
- package/dist/index250.js +227 -17
- package/dist/index251.js +176 -11
- package/dist/index252.js +5 -6
- package/dist/index253.js +5 -106
- package/dist/index254.js +10 -0
- package/dist/index255.js +245 -95
- package/dist/index256.js +54 -0
- package/dist/index257.js +39 -223
- package/dist/index258.js +5 -177
- package/dist/index259.js +60 -2
- package/dist/index260.js +2 -3
- package/dist/index261.js +2 -34
- package/dist/index262.js +2 -2
- package/dist/index27.js +1 -1
- package/dist/index271.js +1 -1
- package/dist/index273.js +2 -5
- package/dist/index274.js +5 -8
- package/dist/index275.js +67 -2
- package/dist/index276.js +5 -67
- package/dist/index277.js +8 -5
- package/dist/index278.js +6 -3
- package/dist/index279.js +11 -3
- package/dist/index280.js +4 -0
- package/dist/index281.js +3 -7
- package/dist/index283.js +7 -11
- package/dist/index285.js +5 -3
- package/dist/index286.js +4 -3
- package/dist/index287.js +1 -1
- package/dist/index288.js +1 -1
- package/dist/index29.js +3 -3
- package/dist/index290.js +3 -280
- package/dist/index291.js +3 -2
- package/dist/index292.js +271 -116
- package/dist/index293.js +2 -2
- package/dist/index294.js +123 -13
- package/dist/index295.js +2 -2
- package/dist/index296.js +13 -14
- package/dist/index298.js +9 -9
- package/dist/index300.js +14 -17
- package/dist/index302.js +17 -17
- package/dist/index304.js +3 -27
- package/dist/index305.js +3 -2
- package/dist/index306.js +1 -1
- package/dist/index307.js +6 -2
- package/dist/index308.js +19 -2
- package/dist/index309.js +2 -2
- package/dist/index31.js +2 -2
- package/dist/index310.js +27 -22
- package/dist/index311.js +4 -0
- package/dist/index312.js +2 -3
- package/dist/index313.js +2 -3
- package/dist/index315.js +2 -6
- package/dist/index316.js +21 -1
- package/dist/index318.js +1 -1
- package/dist/index322.js +2 -33
- package/dist/index323.js +8 -28
- package/dist/index324.js +8 -0
- package/dist/index325.js +8 -2
- package/dist/index326.js +6 -128
- package/dist/index327.js +220 -361
- package/dist/index328.js +58 -8
- package/dist/index329.js +58 -6
- package/dist/index33.js +8 -8
- package/dist/index330.js +32 -7
- package/dist/index331.js +28 -47
- package/dist/index333.js +127 -17
- package/dist/index334.js +367 -56
- package/dist/index335.js +47 -58
- package/dist/index336.js +6 -227
- package/dist/index337.js +17 -5
- package/dist/index338.js +1 -1
- package/dist/index340.js +1 -1
- package/dist/index35.js +4 -4
- package/dist/index37.js +20 -20
- package/dist/index39.js +15 -15
- package/dist/index41.js +2 -2
- package/dist/index43.js +8 -8
- package/dist/index45.js +8 -8
- package/dist/index47.js +2 -2
- package/dist/index49.js +3 -3
- package/dist/index53.js +1 -1
- package/dist/index55.js +1 -1
- package/dist/index57.js +2 -2
- package/dist/index61.js +1 -1
- package/dist/index67.js +1 -1
- package/dist/index79.js +2 -2
- package/dist/index81.js +1 -1
- package/dist/index85.js +1 -1
- package/dist/index90.js +59 -66
- package/dist/index92.js +1 -1
- package/dist/index94.js +3 -3
- package/dist/index96.js +1 -1
- package/package.json +2 -2
- package/dist/index214.js +0 -15
- package/dist/index219.js +0 -7
- package/dist/index221.js +0 -7
- package/dist/index224.js +0 -4
- package/dist/index247.js +0 -46
- package/dist/index249.js +0 -62
- package/dist/index282.js +0 -9
- package/dist/index317.js +0 -7
- package/dist/index332.js +0 -9
package/dist/index248.js
CHANGED
@@ -1,7 +1,102 @@
|
|
1
|
-
import
|
2
|
-
|
3
|
-
import
|
4
|
-
const
|
1
|
+
import { defineComponent as F, ref as H, computed as L, watch as N, createElementBlock as d, openBlock as v, Fragment as S, renderList as A, withModifiers as O, normalizeClass as P, toDisplayString as V } from "vue";
|
2
|
+
import { hash as f } from "./index229.js";
|
3
|
+
import { isNil as i } from "./index262.js";
|
4
|
+
const z = ["text", "onClick:clear"], j = /* @__PURE__ */ F({
|
5
|
+
__name: "CommaBox",
|
6
|
+
props: {
|
7
|
+
options: {}
|
8
|
+
},
|
9
|
+
emits: ["option:unselected"],
|
10
|
+
setup(m, { expose: h, emit: x }) {
|
11
|
+
const t = m, a = x, n = H(null), l = L(() => t.options.some((e) => !e.disabled)), u = (e = 1) => {
|
12
|
+
const s = i(n.value) ? -1 : n.value;
|
13
|
+
let o = (s + e) % t.options.length;
|
14
|
+
for (; t.options[o].disabled && o !== s; )
|
15
|
+
o = u(e + 1);
|
16
|
+
return o;
|
17
|
+
}, b = () => {
|
18
|
+
if (!l.value) return;
|
19
|
+
const e = u();
|
20
|
+
n.value = e;
|
21
|
+
}, c = (e = 1) => {
|
22
|
+
const s = i(n.value) ? 0 : n.value;
|
23
|
+
let o = (s - e + t.options.length) % t.options.length;
|
24
|
+
for (; t.options[o].disabled && o !== s; )
|
25
|
+
o = c(e + 1);
|
26
|
+
return o;
|
27
|
+
}, w = async () => {
|
28
|
+
if (!l.value) return;
|
29
|
+
const e = c();
|
30
|
+
n.value = e;
|
31
|
+
}, I = () => {
|
32
|
+
if (!l.value) return;
|
33
|
+
let e = 0;
|
34
|
+
for (; t.options[e].disabled; )
|
35
|
+
e++;
|
36
|
+
n.value = e;
|
37
|
+
}, g = () => {
|
38
|
+
if (!l.value) return;
|
39
|
+
let e = t.options.length - 1;
|
40
|
+
for (; t.options[e].disabled && e !== 0; )
|
41
|
+
e--;
|
42
|
+
n.value = e;
|
43
|
+
}, k = () => {
|
44
|
+
if (!l.value) return;
|
45
|
+
let e = 0;
|
46
|
+
for (; !t.options[e].selected && t.options.length !== e; )
|
47
|
+
e++;
|
48
|
+
n.value = e;
|
49
|
+
}, _ = () => {
|
50
|
+
if (!l.value) return;
|
51
|
+
let e = t.options.length - 1;
|
52
|
+
for (; t.options[e].selected && e !== 0; )
|
53
|
+
e--;
|
54
|
+
n.value = e;
|
55
|
+
}, C = (e) => {
|
56
|
+
if (!l.value) return;
|
57
|
+
const s = t.options.findIndex(
|
58
|
+
(o) => o.valueHash === e
|
59
|
+
);
|
60
|
+
s >= 0 && (n.value = s);
|
61
|
+
}, r = () => {
|
62
|
+
n.value = null;
|
63
|
+
}, y = () => {
|
64
|
+
if (i(n.value)) return;
|
65
|
+
const e = t.options[n.value];
|
66
|
+
e.selected && a("option:unselected", e);
|
67
|
+
}, B = () => i(n.value) ? void 0 : t.options[n.value];
|
68
|
+
return N(
|
69
|
+
() => t.options,
|
70
|
+
(e, s) => {
|
71
|
+
f(e) !== f(s) && r();
|
72
|
+
},
|
73
|
+
{
|
74
|
+
flush: "post"
|
75
|
+
}
|
76
|
+
), h({
|
77
|
+
focusNext: b,
|
78
|
+
focusPrevious: w,
|
79
|
+
focusFirst: I,
|
80
|
+
focusFirstSelected: k,
|
81
|
+
focusLast: g,
|
82
|
+
focusLastSelected: _,
|
83
|
+
blur: r,
|
84
|
+
confirmOption: y,
|
85
|
+
focusByHash: C,
|
86
|
+
getHighlighted: B
|
87
|
+
}), (e, s) => (v(!0), d(S, null, A(e.options, (o, p) => (v(), d("span", {
|
88
|
+
key: o.valueHash,
|
89
|
+
class: P({
|
90
|
+
"bb-commabox-item": !0,
|
91
|
+
"bb-commabox-item--focused": p === n.value,
|
92
|
+
"bb-commabox-item--has-comma": p !== e.options.length - 1
|
93
|
+
}),
|
94
|
+
clearable: !0,
|
95
|
+
text: o.text,
|
96
|
+
"onClick:clear": O((D) => a("option:unselected", o), ["stop"])
|
97
|
+
}, V(o.text), 43, z))), 128));
|
98
|
+
}
|
99
|
+
});
|
5
100
|
export {
|
6
|
-
|
101
|
+
j as default
|
7
102
|
};
|
package/dist/index25.js
CHANGED
@@ -1,22 +1,20 @@
|
|
1
|
-
import { defineComponent as P, mergeModels as D, useModel as q, computed as p, ref as E, watch as A, onMounted as H, createElementBlock as d, openBlock as u, withModifiers as K, normalizeStyle as O, normalizeClass as R, unref as v, createCommentVNode as g, Fragment as U, createElementVNode as l, renderSlot as s, createTextVNode as j, toDisplayString as T,
|
2
|
-
import { parseSize as
|
1
|
+
import { defineComponent as P, mergeModels as D, useModel as q, computed as p, ref as E, watch as A, onMounted as H, createElementBlock as d, openBlock as u, withModifiers as K, normalizeStyle as O, normalizeClass as R, unref as v, createCommentVNode as g, Fragment as U, createElementVNode as l, renderSlot as s, createTextVNode as j, toDisplayString as T, nextTick as G } from "vue";
|
2
|
+
import { parseSize as J } from "./index209.js";
|
3
3
|
import { useId as V } from "./index8.js";
|
4
|
-
import { useLocale as
|
5
|
-
import { useMobile as
|
6
|
-
import { useUntil as
|
7
|
-
import { wait as
|
8
|
-
|
9
|
-
/* empty css */
|
10
|
-
const oe = ["aria-describedby", "aria-labelledby", "aria-live", "inert"], te = {
|
4
|
+
import { useLocale as Q } from "./index210.js";
|
5
|
+
import { useMobile as X } from "./index9.js";
|
6
|
+
import { useUntil as Y } from "./index211.js";
|
7
|
+
import { wait as y } from "./index135.js";
|
8
|
+
const Z = ["aria-describedby", "aria-labelledby", "aria-live", "inert"], x = {
|
11
9
|
ref: "header",
|
12
10
|
class: "bb-base-dialog__header"
|
13
|
-
},
|
11
|
+
}, ee = { class: "bb-base-dialog__close" }, oe = ["aria-label", "disabled"], te = {
|
14
12
|
ref: "body",
|
15
13
|
class: "bb-base-dialog__body scrollbar-border"
|
16
|
-
},
|
14
|
+
}, le = {
|
17
15
|
ref: "footer",
|
18
16
|
class: "bb-base-dialog__footer"
|
19
|
-
},
|
17
|
+
}, ce = /* @__PURE__ */ P({
|
20
18
|
__name: "BaseDialog",
|
21
19
|
props: /* @__PURE__ */ D({
|
22
20
|
closeLabel: {},
|
@@ -38,44 +36,44 @@ const oe = ["aria-describedby", "aria-labelledby", "aria-live", "inert"], te = {
|
|
38
36
|
modelModifiers: {}
|
39
37
|
}),
|
40
38
|
emits: /* @__PURE__ */ D(["shown", "hidden"], ["update:modelValue"]),
|
41
|
-
setup(
|
42
|
-
const o =
|
39
|
+
setup(h, { emit: S }) {
|
40
|
+
const o = h, w = S, t = q(h, "modelValue"), { t: z } = Q(), W = p(
|
43
41
|
() => o.closeLabel || z("dialog.closeLabel").value
|
44
|
-
), n = E(null), c =
|
42
|
+
), n = E(null), c = Y(
|
45
43
|
() => t.value || o.eager,
|
46
44
|
{
|
47
45
|
initialValue: t.value || o.eager
|
48
46
|
}
|
49
|
-
), b = `title_${V().id.value}`, f = `description_${V().id.value}`,
|
47
|
+
), b = `title_${V().id.value}`, f = `description_${V().id.value}`, k = (e) => {
|
50
48
|
if (e.key === "Escape" && (o.disabled || o.persistent))
|
51
|
-
return e.preventDefault(), a.value = !0,
|
49
|
+
return e.preventDefault(), a.value = !0, y(200).then(() => {
|
52
50
|
a.value = !1;
|
53
51
|
}), !1;
|
54
|
-
},
|
52
|
+
}, C = async (e) => {
|
55
53
|
var i, B, L, M;
|
56
54
|
e ? ((i = window.globalThis) != null && i.document && !document.documentElement.style.getPropertyValue("--scrollbar-width") && (document.documentElement.style.setProperty(
|
57
55
|
"--scrollbar-width",
|
58
|
-
`${
|
59
|
-
), document.addEventListener("keydown",
|
56
|
+
`${N()}px`
|
57
|
+
), document.addEventListener("keydown", k)), (B = n.value) == null || B.showModal(), o.focusTarget && G(() => {
|
60
58
|
var $;
|
61
59
|
const m = ($ = n.value) == null ? void 0 : $.querySelector(o.focusTarget);
|
62
60
|
m && m instanceof HTMLElement && m.focus();
|
63
|
-
}), w("shown")) : (await
|
61
|
+
}), w("shown")) : (await y(o.transitionDuration), (L = window.globalThis) != null && L.document && document.removeEventListener("keydown", k), (M = n.value) == null || M.close(), w("hidden"));
|
64
62
|
};
|
65
|
-
A(t,
|
66
|
-
t.value &&
|
63
|
+
A(t, C), H(() => {
|
64
|
+
t.value && C(!0);
|
67
65
|
});
|
68
|
-
const
|
66
|
+
const I = p(() => _.value ? "100%" : J(o.size, {
|
69
67
|
sm: 384,
|
70
68
|
md: 652,
|
71
69
|
lg: 896
|
72
70
|
})), r = (e) => {
|
73
71
|
if (e.preventDefault(), o.disabled || o.persistent)
|
74
|
-
return a.value = !0,
|
72
|
+
return a.value = !0, y(300).then(() => {
|
75
73
|
a.value = !1;
|
76
74
|
}), !1;
|
77
75
|
t.value = !1;
|
78
|
-
}, a = E(!1),
|
76
|
+
}, a = E(!1), N = () => globalThis.document ? window.innerWidth - document.documentElement.clientWidth : 0, { isMobile: F } = X(), _ = p(
|
79
77
|
() => o.fullscreen === !0 || o.fullscreen === "mobile" && F.value
|
80
78
|
);
|
81
79
|
return (e, i) => (u(), d("dialog", {
|
@@ -89,7 +87,7 @@ const oe = ["aria-describedby", "aria-labelledby", "aria-live", "inert"], te = {
|
|
89
87
|
[
|
90
88
|
{
|
91
89
|
"bb-base-dialog--open": t.value,
|
92
|
-
"bb-base-dialog--fullscreen":
|
90
|
+
"bb-base-dialog--fullscreen": _.value,
|
93
91
|
"bb-base-dialog--compact": e.compact,
|
94
92
|
"bb-base-dialog--deny-close": a.value
|
95
93
|
},
|
@@ -99,14 +97,14 @@ const oe = ["aria-describedby", "aria-labelledby", "aria-live", "inert"], te = {
|
|
99
97
|
]),
|
100
98
|
inert: !t.value,
|
101
99
|
style: O({
|
102
|
-
"--max-width":
|
100
|
+
"--max-width": I.value,
|
103
101
|
"--transition-duration": `${o.transitionDuration}ms`
|
104
102
|
}),
|
105
103
|
onCancel: r,
|
106
104
|
onClick: K(r, ["self"])
|
107
105
|
}, [
|
108
106
|
v(c) ? (u(), d(U, { key: 0 }, [
|
109
|
-
l("div",
|
107
|
+
l("div", x, [
|
110
108
|
s(e.$slots, "header", {
|
111
109
|
close: r,
|
112
110
|
title: e.title,
|
@@ -120,10 +118,10 @@ const oe = ["aria-describedby", "aria-labelledby", "aria-live", "inert"], te = {
|
|
120
118
|
j(T(e.title), 1)
|
121
119
|
])
|
122
120
|
]),
|
123
|
-
l("span",
|
121
|
+
l("span", ee, [
|
124
122
|
e.showClose ? (u(), d("button", {
|
125
123
|
key: 0,
|
126
|
-
"aria-label":
|
124
|
+
"aria-label": W.value,
|
127
125
|
disabled: o.disabled,
|
128
126
|
type: "button",
|
129
127
|
onClick: r
|
@@ -145,11 +143,11 @@ const oe = ["aria-describedby", "aria-labelledby", "aria-live", "inert"], te = {
|
|
145
143
|
])
|
146
144
|
], -1))
|
147
145
|
])
|
148
|
-
], 8,
|
146
|
+
], 8, oe)) : g("", !0)
|
149
147
|
])
|
150
148
|
])
|
151
149
|
], 512),
|
152
|
-
l("div",
|
150
|
+
l("div", te, [
|
153
151
|
s(e.$slots, "description", {
|
154
152
|
descriptionId: f,
|
155
153
|
text: e.description
|
@@ -160,20 +158,15 @@ const oe = ["aria-describedby", "aria-labelledby", "aria-live", "inert"], te = {
|
|
160
158
|
class: "bb-base-dialog__description sr-only"
|
161
159
|
}, T(e.description), 1)) : g("", !0)
|
162
160
|
]),
|
163
|
-
|
164
|
-
default: J(() => [
|
165
|
-
s(e.$slots, "default")
|
166
|
-
]),
|
167
|
-
_: 3
|
168
|
-
})
|
161
|
+
s(e.$slots, "default")
|
169
162
|
], 512),
|
170
|
-
l("div",
|
163
|
+
l("div", le, [
|
171
164
|
s(e.$slots, "footer")
|
172
165
|
], 512)
|
173
166
|
], 64)) : g("", !0)
|
174
|
-
], 46,
|
167
|
+
], 46, Z));
|
175
168
|
}
|
176
169
|
});
|
177
170
|
export {
|
178
|
-
|
171
|
+
ce as default
|
179
172
|
};
|
package/dist/index250.js
CHANGED
@@ -1,20 +1,230 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
1
|
+
import { defineComponent as U, ref as f, computed as x, watch as E, createElementBlock as d, openBlock as p, withModifiers as X, normalizeStyle as h, normalizeClass as $, createElementVNode as c, renderSlot as m, createTextVNode as H, toDisplayString as g, unref as L, Fragment as Z, renderList as ee } from "vue";
|
2
|
+
import { isNil as b } from "./index262.js";
|
3
|
+
import { useVirtualizer as te } from "./index335.js";
|
4
|
+
import { isNotNil as oe } from "./index140.js";
|
5
|
+
import { hash as N } from "./index229.js";
|
6
|
+
import { useLocale as ne } from "./index210.js";
|
7
|
+
const le = { class: "bb-listbox__outer-container scrollbar-border" }, ie = {
|
8
|
+
key: 0,
|
9
|
+
class: "bb-listbox__loading"
|
10
|
+
}, se = {
|
11
|
+
key: 1,
|
12
|
+
class: "bb-listbox__no-data"
|
13
|
+
}, ae = ["aria-selected", "data-index"], ue = { class: "autocomplete-option__content" }, re = { class: "autocomplete-option__label" }, xe = /* @__PURE__ */ U({
|
14
|
+
__name: "ListBox",
|
15
|
+
props: {
|
16
|
+
compact: { type: Boolean },
|
17
|
+
options: {},
|
18
|
+
open: { type: Boolean },
|
19
|
+
loading: { type: Boolean },
|
20
|
+
multiple: { type: Boolean },
|
21
|
+
transitionDuration: { default: 250 },
|
22
|
+
loadingText: {},
|
23
|
+
noDataText: {}
|
24
|
+
},
|
25
|
+
emits: ["option:selected", "option:unselected"],
|
26
|
+
setup(V, { expose: z, emit: C }) {
|
27
|
+
const o = V, _ = C, { t: y } = ne(), s = f(null), O = (e) => "option_" + JSON.stringify(e).replace(/\W/g, "_"), i = x(
|
28
|
+
() => o.options.map((e) => ({ ...e, id: O(e.value) }))
|
29
|
+
), v = te({
|
30
|
+
get count() {
|
31
|
+
return o.options.length;
|
32
|
+
},
|
33
|
+
getScrollElement: () => s.value,
|
34
|
+
estimateSize: () => 42,
|
35
|
+
overscan: 5
|
36
|
+
}), F = (e) => {
|
37
|
+
e && v.value.measureElement(e);
|
38
|
+
}, M = x(() => v.value.getVirtualItems()), A = x(() => v.value.getTotalSize()), n = f(null), a = x(
|
39
|
+
() => o.open && o.options.some((e) => !e.disabled)
|
40
|
+
), I = (e = 1) => {
|
41
|
+
const l = b(n.value) ? -1 : n.value;
|
42
|
+
let t = (l + e) % o.options.length;
|
43
|
+
for (; o.options[t].disabled && t !== l; )
|
44
|
+
t = I(e + 1);
|
45
|
+
return t;
|
46
|
+
}, P = () => {
|
47
|
+
if (!a.value) return;
|
48
|
+
const e = I();
|
49
|
+
n.value = e, u();
|
50
|
+
}, S = (e = 1) => {
|
51
|
+
const l = b(n.value) ? 0 : n.value;
|
52
|
+
let t = (l - e + o.options.length) % o.options.length;
|
53
|
+
for (; o.options[t].disabled && t !== l; )
|
54
|
+
t = S(e + 1);
|
55
|
+
return t;
|
56
|
+
}, R = async () => {
|
57
|
+
if (!a.value) return;
|
58
|
+
const e = S();
|
59
|
+
n.value = e, u();
|
60
|
+
}, q = () => {
|
61
|
+
if (!a.value) return;
|
62
|
+
let e = 0;
|
63
|
+
for (; o.options[e].disabled; )
|
64
|
+
e++;
|
65
|
+
n.value = e, u();
|
66
|
+
}, J = () => {
|
67
|
+
if (!a.value) return;
|
68
|
+
let e = o.options.length - 1;
|
69
|
+
for (; o.options[e].disabled && e !== 0; )
|
70
|
+
e--;
|
71
|
+
n.value = e, u();
|
72
|
+
}, W = () => {
|
73
|
+
if (!a.value) return;
|
74
|
+
let e = 0;
|
75
|
+
for (; o.options[e] && !o.options[e].selected && o.options.length !== e; )
|
76
|
+
e++;
|
77
|
+
n.value = e % o.options.length, u();
|
78
|
+
}, Y = () => {
|
79
|
+
if (!a.value) return;
|
80
|
+
let e = o.options.length - 1;
|
81
|
+
for (; o.options[e].selected && e > 0; )
|
82
|
+
e--;
|
83
|
+
n.value = e === -1 ? o.options.length - 1 : e, u();
|
84
|
+
}, j = (e) => {
|
85
|
+
if (!a.value) return;
|
86
|
+
const l = o.options.findIndex(
|
87
|
+
(t) => t.valueHash === e
|
88
|
+
);
|
89
|
+
l >= 0 && (n.value = l), u();
|
90
|
+
}, k = () => {
|
91
|
+
n.value = null;
|
92
|
+
}, u = () => {
|
93
|
+
s.value && oe(n.value) && v.value.scrollToIndex(n.value, {
|
94
|
+
align: "center",
|
95
|
+
behavior: "smooth"
|
96
|
+
});
|
97
|
+
}, w = () => {
|
98
|
+
if (b(n.value) || !o.open) return;
|
99
|
+
const e = o.options[n.value];
|
100
|
+
e.selected ? _("option:unselected", e) : _("option:selected", e);
|
101
|
+
}, B = f(0), T = () => {
|
102
|
+
s.value && (B.value = s.value.scrollHeight);
|
103
|
+
}, G = (e) => !e.disabled, K = (e) => {
|
104
|
+
if (e.preventDefault(), s.value && e.target && e.target instanceof HTMLElement) {
|
105
|
+
if (!s.value.querySelector('[role="listbox"]'))
|
106
|
+
throw new Error("Could not find listbox in DOM tree.");
|
107
|
+
let t = e.target, r = t.dataset.index;
|
108
|
+
for (; b(r) && t.parentElement; )
|
109
|
+
t = t.parentElement, r = t.dataset.index;
|
110
|
+
if (r) {
|
111
|
+
const D = o.options[+r];
|
112
|
+
D && G(D) && (n.value = +r, w());
|
113
|
+
}
|
114
|
+
}
|
115
|
+
}, Q = () => b(n.value) ? void 0 : o.options[n.value];
|
116
|
+
return E(
|
117
|
+
() => o.open,
|
118
|
+
() => {
|
119
|
+
T();
|
120
|
+
},
|
121
|
+
{ flush: "post" }
|
122
|
+
), E(
|
123
|
+
() => o.options,
|
124
|
+
(e, l) => {
|
125
|
+
N(e.map((t) => t.valueHash)) !== N(l.map((t) => t.valueHash)) && (v.value.calculateRange(), T(), k());
|
126
|
+
},
|
127
|
+
{
|
128
|
+
flush: "post"
|
129
|
+
}
|
130
|
+
), z({
|
131
|
+
focusNext: P,
|
132
|
+
focusPrevious: R,
|
133
|
+
focusFirst: q,
|
134
|
+
focusFirstSelected: W,
|
135
|
+
focusLast: J,
|
136
|
+
focusLastSelected: Y,
|
137
|
+
blur: k,
|
138
|
+
confirmOption: w,
|
139
|
+
focusByHash: j,
|
140
|
+
getHighlighted: Q
|
141
|
+
}), (e, l) => (p(), d("span", {
|
142
|
+
class: $(["bb-listbox", {
|
143
|
+
"bb-listbox--compact": e.compact,
|
144
|
+
"bb-listbox--loading": e.loading,
|
145
|
+
"bb-listbox--multiple": e.multiple,
|
146
|
+
"bb-listbox--no-data": !i.value.length,
|
147
|
+
"bb-listbox--open": e.open
|
148
|
+
}]),
|
149
|
+
style: h({
|
150
|
+
"--transition-duration": `${e.transitionDuration}ms`,
|
151
|
+
"--overlay-min-height": `${B.value}px`
|
152
|
+
}),
|
153
|
+
onClick: X(K, ["stop"])
|
154
|
+
}, [
|
155
|
+
c("span", le, [
|
156
|
+
c("span", {
|
157
|
+
ref_key: "inner",
|
158
|
+
ref: s,
|
159
|
+
class: "bb-listbox__inner-container"
|
160
|
+
}, [
|
161
|
+
m(e.$slots, "options:prepend"),
|
162
|
+
e.loading && !e.options.length ? (p(), d("span", ie, [
|
163
|
+
m(e.$slots, "loading", {}, () => [
|
164
|
+
H(g(e.loadingText || L(y)("common.loadingText").value), 1)
|
165
|
+
])
|
166
|
+
])) : e.options.length ? (p(), d("span", {
|
167
|
+
key: 2,
|
168
|
+
role: "listbox",
|
169
|
+
style: h({
|
170
|
+
height: `${A.value}px`
|
171
|
+
}),
|
172
|
+
tabindex: "-1"
|
173
|
+
}, [
|
174
|
+
(p(!0), d(Z, null, ee(M.value, (t, r) => (p(), d("span", {
|
175
|
+
key: i.value[t.index].value,
|
176
|
+
ref_for: !0,
|
177
|
+
ref: F,
|
178
|
+
"aria-selected": n.value === r ? !0 : void 0,
|
179
|
+
class: $({
|
180
|
+
"bb-listbox__option autocomplete-option": !0,
|
181
|
+
"autocomplete-option--focused": n.value === t.index,
|
182
|
+
"autocomplete-option--selected": i.value[t.index].selected,
|
183
|
+
"autocomplete-option--disabled": i.value[t.index].disabled
|
184
|
+
}),
|
185
|
+
"data-index": t.index,
|
186
|
+
role: "option",
|
187
|
+
style: h({
|
188
|
+
transform: `translateY(${t.start}px)`
|
189
|
+
})
|
190
|
+
}, [
|
191
|
+
c("span", ue, [
|
192
|
+
m(e.$slots, "option", {
|
193
|
+
disabled: !!i.value[t.index].disabled,
|
194
|
+
focused: n.value === t.index,
|
195
|
+
index: t.index,
|
196
|
+
item: i.value[t.index].item,
|
197
|
+
selected: !!i.value[t.index].selected,
|
198
|
+
text: i.value[t.index].text,
|
199
|
+
value: i.value[t.index].value
|
200
|
+
}, () => [
|
201
|
+
l[0] || (l[0] = c("svg", {
|
202
|
+
class: "autocomplete-option__checkbox",
|
203
|
+
role: "presentation",
|
204
|
+
viewBox: "276.411 158.834 114.971 114.97"
|
205
|
+
}, [
|
206
|
+
c("path", {
|
207
|
+
d: "M 297.574 224.786 L 318.309 243.134 L 371.568 189.232",
|
208
|
+
fill: "none",
|
209
|
+
"stroke-linecap": "round",
|
210
|
+
"stroke-width": "14px"
|
211
|
+
})
|
212
|
+
], -1)),
|
213
|
+
c("span", re, g(i.value[t.index].text), 1)
|
214
|
+
])
|
215
|
+
])
|
216
|
+
], 14, ae))), 128))
|
217
|
+
], 4)) : (p(), d("span", se, [
|
218
|
+
m(e.$slots, "no-data", {}, () => [
|
219
|
+
H(g(e.noDataText || L(y)("common.noDataText").value), 1)
|
220
|
+
])
|
221
|
+
])),
|
222
|
+
m(e.$slots, "options:append")
|
223
|
+
], 512)
|
224
|
+
])
|
225
|
+
], 6));
|
15
226
|
}
|
16
|
-
|
17
|
-
};
|
227
|
+
});
|
18
228
|
export {
|
19
|
-
|
229
|
+
xe as default
|
20
230
|
};
|