bitboss-ui 2.1.25 → 2.1.27
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/BaseDialog/BaseDialog.vue.d.ts +2 -7
- package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +2 -7
- package/dist/composables/useMinimalQueue.d.ts +9 -0
- package/dist/index.css +1 -1
- package/dist/index106.js +9 -9
- 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/index138.js +1 -1
- package/dist/index15.js +8 -8
- package/dist/index17.js +3 -3
- package/dist/index19.js +8 -8
- package/dist/index207.js +2 -2
- package/dist/index208.js +2 -2
- package/dist/index209.js +12 -33
- package/dist/index21.js +16 -16
- package/dist/index210.js +12 -85
- package/dist/index211.js +13 -0
- package/dist/index212.js +33 -28
- package/dist/index213.js +86 -17
- package/dist/index215.js +26 -12
- package/dist/index216.js +17 -3
- package/dist/index217.js +50 -11
- package/dist/index218.js +13 -14
- package/dist/index219.js +3 -5
- package/dist/index220.js +12 -5
- package/dist/index221.js +16 -5
- package/dist/index222.js +2 -5
- package/dist/index223.js +4 -5
- package/dist/index224.js +2 -5
- package/dist/index225.js +2 -2
- package/dist/index226.js +2 -2
- package/dist/index227.js +18 -2
- package/dist/index228.js +12 -13
- package/dist/index229.js +6 -11
- package/dist/index23.js +15 -15
- package/dist/index230.js +105 -19
- package/dist/index232.js +102 -0
- package/dist/index234.js +65 -110
- package/dist/index236.js +13 -13
- package/dist/index237.js +116 -17
- package/dist/index239.js +228 -5
- package/dist/index240.js +2 -4
- package/dist/index241.js +2 -106
- package/dist/index242.js +9 -0
- package/dist/index243.js +7 -100
- package/dist/index244.js +5 -0
- package/dist/index245.js +4 -229
- package/dist/index246.js +20 -3
- package/dist/index247.js +197 -2
- package/dist/index249.js +5 -4
- package/dist/index25.js +59 -57
- package/dist/index250.js +5 -197
- package/dist/index251.js +7 -0
- package/dist/index252.js +5 -5
- package/dist/index253.js +5 -5
- package/dist/index254.js +5 -8
- package/dist/index255.js +2 -250
- package/dist/index256.js +5 -52
- package/dist/index257.js +5 -44
- package/dist/index258.js +8 -5
- package/dist/index259.js +243 -53
- package/dist/index260.js +50 -181
- package/dist/index261.js +44 -2
- package/dist/index262.js +5 -2
- package/dist/index263.js +60 -7
- package/dist/index264.js +182 -6
- package/dist/index265.js +9 -6
- package/dist/index266.js +23 -16
- package/dist/index269.js +6 -9
- package/dist/index27.js +1 -1
- package/dist/index270.js +16 -8
- package/dist/index273.js +8 -8
- package/dist/index274.js +8 -23
- package/dist/index276.js +67 -5
- package/dist/index277.js +5 -67
- package/dist/index278.js +1 -1
- package/dist/index279.js +1 -1
- package/dist/index280.js +1 -1
- package/dist/index281.js +7 -3
- package/dist/index282.js +11 -17
- package/dist/index283.js +3 -28
- package/dist/index284.js +17 -280
- package/dist/index285.js +28 -2
- package/dist/index286.js +4 -125
- package/dist/index287.js +4 -2
- package/dist/index288.js +3 -15
- package/dist/index289.js +3 -2
- package/dist/index29.js +4 -4
- package/dist/index290.js +3 -16
- package/dist/index292.js +7 -16
- package/dist/index293.js +3 -2
- package/dist/index294.js +2 -19
- package/dist/index295.js +5 -2
- package/dist/index296.js +1 -1
- package/dist/index297.js +282 -0
- package/dist/index298.js +2 -7
- package/dist/index299.js +125 -3
- package/dist/index300.js +2 -7
- package/dist/index301.js +14 -10
- package/dist/index302.js +2 -4
- package/dist/index303.js +15 -5
- package/dist/index304.js +2 -3
- package/dist/index305.js +16 -3
- package/dist/index306.js +2 -2
- package/dist/index307.js +19 -4
- package/dist/index308.js +2 -5
- package/dist/index309.js +6 -3
- package/dist/index31.js +2 -2
- package/dist/index314.js +1 -1
- package/dist/index315.js +1 -1
- package/dist/index316.js +1 -1
- package/dist/index317.js +1 -1
- package/dist/index323.js +2 -2
- package/dist/index324.js +1 -1
- package/dist/index325.js +57 -128
- package/dist/index326.js +56 -367
- package/dist/index327.js +7 -58
- package/dist/index328.js +18 -57
- package/dist/index329.js +7 -227
- package/dist/index33.js +8 -8
- package/dist/index330.js +128 -32
- package/dist/index331.js +369 -28
- package/dist/index332.js +49 -0
- package/dist/index333.js +6 -46
- package/dist/index334.js +32 -6
- package/dist/index335.js +27 -18
- package/dist/index337.js +227 -7
- package/dist/index338.js +7 -5
- package/dist/index339.js +6 -8
- package/dist/index340.js +7 -92
- package/dist/index341.js +95 -0
- package/dist/index342.js +129 -3
- package/dist/index343.js +427 -120
- package/dist/index344.js +113 -422
- package/dist/index345.js +484 -123
- package/dist/index347.js +3 -50
- package/dist/index348.js +52 -0
- package/dist/index35.js +4 -4
- package/dist/index37.js +20 -20
- package/dist/index39.js +7 -7
- 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 +4 -4
- package/dist/index81.js +1 -1
- package/dist/index83.js +2 -2
- package/dist/index85.js +1 -1
- package/dist/index90.js +59 -57
- package/dist/index92.js +1 -1
- package/dist/index94.js +3 -3
- package/dist/index96.js +1 -1
- package/package.json +1 -1
- package/dist/index214.js +0 -53
- package/dist/index231.js +0 -71
- package/dist/index233.js +0 -15
- package/dist/index238.js +0 -14
- package/dist/index248.js +0 -4
- package/dist/index291.js +0 -4
- package/dist/index336.js +0 -9
- package/dist/index346.js +0 -490
package/dist/index234.js
CHANGED
@@ -1,116 +1,71 @@
|
|
1
|
-
import { defineComponent as
|
2
|
-
|
3
|
-
|
4
|
-
import
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
placement: o.placement,
|
30
|
-
whileElementsMounted: J,
|
31
|
-
middleware: [
|
32
|
-
...o.flip ? [q()] : [],
|
33
|
-
G(o.offset),
|
34
|
-
H({ padding: o.padding }),
|
35
|
-
I(),
|
36
|
-
j({
|
37
|
-
element: p,
|
38
|
-
padding: o.arrowPadding
|
39
|
-
})
|
40
|
-
],
|
41
|
-
strategy: "fixed"
|
42
|
-
}
|
43
|
-
), d = (e) => {
|
44
|
-
e ? (B(), o.dialog ? t.value.showModal() : t.value.showPopover()) : F(o.transitionDuration).then(() => {
|
45
|
-
t.value && (o.dialog ? t.value.close() : t.value.hidePopover());
|
46
|
-
});
|
1
|
+
import { defineComponent as k, ref as y, createElementBlock as C, openBlock as t, normalizeClass as N, renderSlot as n, createBlock as s, createCommentVNode as l, createVNode as a, createElementVNode as m, unref as i } from "vue";
|
2
|
+
/* empty css */
|
3
|
+
/* empty css */
|
4
|
+
import u from "./index85.js";
|
5
|
+
/* empty css */
|
6
|
+
import h from "./index113.js";
|
7
|
+
/* empty css */
|
8
|
+
import v from "./index334.js";
|
9
|
+
import B from "./index335.js";
|
10
|
+
/* empty css */
|
11
|
+
const E = { class: "bb-common-input-inner-container__prefix" }, I = { class: "bb-common-input-inner-container__suffix" }, R = /* @__PURE__ */ k({
|
12
|
+
__name: "CommonInputInnerContainer",
|
13
|
+
props: {
|
14
|
+
"append:icon": {},
|
15
|
+
clearable: { type: Boolean },
|
16
|
+
"prepend:icon": {},
|
17
|
+
preventFocus: { type: Boolean }
|
18
|
+
},
|
19
|
+
emits: ["click:clear"],
|
20
|
+
setup(f, { emit: d }) {
|
21
|
+
const p = f, b = d, o = y(), _ = (e) => {
|
22
|
+
var c;
|
23
|
+
if (!o.value || p.preventFocus) return;
|
24
|
+
const r = e.target;
|
25
|
+
r.tagName === "INPUT" || r.tagName === "TEXTAREA" || (c = o.value.querySelector("input,textarea")) == null || c.focus();
|
26
|
+
}, $ = () => {
|
27
|
+
var e;
|
28
|
+
b("click:clear"), (e = o.value.querySelector("input,textarea")) == null || e.focus();
|
47
29
|
};
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
const { x: e, y: u } = n.value.arrow;
|
54
|
-
return {
|
55
|
-
style: {
|
56
|
-
left: `${e}px`,
|
57
|
-
top: `${u}px`
|
58
|
-
}
|
59
|
-
};
|
60
|
-
}
|
61
|
-
}), $ = () => {
|
62
|
-
a.value = !1;
|
63
|
-
};
|
64
|
-
return (e, u) => (v(), b(g(e.dialog ? "div" : e.tag), {
|
65
|
-
ref_key: "wrapper",
|
66
|
-
ref: i,
|
67
|
-
class: E(["bb-common-popover", {
|
68
|
-
"bb-common-popover--open": a.value && !!t.value,
|
69
|
-
"bb-common-popover--block": o.block,
|
70
|
-
[`bb-common-popover--${l(_)}`]: !0
|
30
|
+
return (e, r) => (t(), C("span", {
|
31
|
+
ref_key: "container",
|
32
|
+
ref: o,
|
33
|
+
class: N(["bb-common-input-inner-container", {
|
34
|
+
"bb-common-input-inner-container--clearable": p.clearable
|
71
35
|
}]),
|
72
|
-
|
73
|
-
|
74
|
-
})
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
y(e.$slots, "default")
|
104
|
-
])
|
105
|
-
]),
|
106
|
-
_: 3
|
107
|
-
}, 16, ["class", "style", "tabindex", "onClose"])) : N("", !0)
|
108
|
-
];
|
109
|
-
}),
|
110
|
-
_: 3
|
111
|
-
}, 8, ["class", "style"]));
|
36
|
+
onClick: _
|
37
|
+
}, [
|
38
|
+
n(e.$slots, "prepend", {}, () => [
|
39
|
+
m("span", E, [
|
40
|
+
n(e.$slots, "prefix")
|
41
|
+
])
|
42
|
+
]),
|
43
|
+
e.$props["prepend:icon"] ? (t(), s(i(u), {
|
44
|
+
key: 0,
|
45
|
+
class: "bb-common-input-inner-container__prepend-icon",
|
46
|
+
type: e.$props["prepend:icon"]
|
47
|
+
}, null, 8, ["type"])) : l("", !0),
|
48
|
+
n(e.$slots, "default"),
|
49
|
+
a(B, {
|
50
|
+
"aria-hidden": !e.clearable,
|
51
|
+
tabindex: e.clearable ? 0 : -1,
|
52
|
+
onClick: $
|
53
|
+
}, null, 8, ["aria-hidden", "tabindex"]),
|
54
|
+
e.$props["append:icon"] ? (t(), s(i(u), {
|
55
|
+
key: 1,
|
56
|
+
class: "bb-common-input-inner-container__append-icon",
|
57
|
+
type: e.$props["append:icon"]
|
58
|
+
}, null, 8, ["type"])) : l("", !0),
|
59
|
+
a(v),
|
60
|
+
a(i(h)),
|
61
|
+
n(e.$slots, "append", {}, () => [
|
62
|
+
m("span", I, [
|
63
|
+
n(e.$slots, "suffix")
|
64
|
+
])
|
65
|
+
])
|
66
|
+
], 2));
|
112
67
|
}
|
113
68
|
});
|
114
69
|
export {
|
115
|
-
|
70
|
+
R as default
|
116
71
|
};
|
package/dist/index236.js
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
1
|
+
import { createElementBlock as t, openBlock as n, renderSlot as e } from "vue";
|
2
|
+
/* empty css */
|
3
|
+
import r from "./index292.js";
|
4
|
+
const s = {}, c = { class: "bb-common-input-outer-container" };
|
5
|
+
function p(o, a) {
|
6
|
+
return n(), t("span", c, [
|
7
|
+
e(o.$slots, "prepend-outer"),
|
8
|
+
e(o.$slots, "default"),
|
9
|
+
e(o.$slots, "append-outer")
|
10
|
+
]);
|
11
|
+
}
|
12
|
+
const i = /* @__PURE__ */ r(s, [["render", p]]);
|
13
13
|
export {
|
14
|
-
|
14
|
+
i as default
|
15
15
|
};
|
package/dist/index237.js
CHANGED
@@ -1,20 +1,119 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
1
|
+
import { defineComponent as V, mergeModels as A, useModel as x, ref as l, watch as S, onMounted as z, computed as E, createBlock as b, openBlock as v, resolveDynamicComponent as g, normalizeStyle as F, normalizeClass as N, unref as n, withCtx as w, renderSlot as y, createCommentVNode as q, mergeProps as h, createElementVNode as C } from "vue";
|
2
|
+
import { useMinimalQueue as Q } from "./index329.js";
|
3
|
+
import { wait as U } from "./index135.js";
|
4
|
+
import { useFloating as j, arrow as G } from "./index330.js";
|
5
|
+
import { flip as H, offset as I, shift as J, hide as K, autoUpdate as L } from "./index331.js";
|
6
|
+
const O = { class: "bb-common-popover__bubble" }, ee = /* @__PURE__ */ V({
|
7
|
+
__name: "CommonPopover",
|
8
|
+
props: /* @__PURE__ */ A({
|
9
|
+
arrowPadding: {},
|
10
|
+
offset: {},
|
11
|
+
block: { type: Boolean },
|
12
|
+
padding: { default: 0 },
|
13
|
+
placement: {},
|
14
|
+
transitionDuration: { default: 250 },
|
15
|
+
containerAttributes: {},
|
16
|
+
dialog: { type: Boolean },
|
17
|
+
renderContent: { type: Boolean, default: !0 },
|
18
|
+
tag: { default: "span" },
|
19
|
+
flip: { type: Boolean, default: !0 }
|
20
|
+
}, {
|
21
|
+
modelValue: { type: Boolean, default: !1 },
|
22
|
+
modelModifiers: {}
|
23
|
+
}),
|
24
|
+
emits: ["update:modelValue"],
|
25
|
+
setup(s) {
|
26
|
+
const o = s, a = x(s, "modelValue"), i = l(), t = l(), p = l(), { floatingStyles: k, placement: _, middlewareData: r, update: M } = j(
|
27
|
+
i,
|
28
|
+
t,
|
29
|
+
{
|
30
|
+
placement: o.placement,
|
31
|
+
whileElementsMounted: L,
|
32
|
+
middleware: [
|
33
|
+
...o.flip ? [H()] : [],
|
34
|
+
I(o.offset),
|
35
|
+
J({ padding: o.padding }),
|
36
|
+
K(),
|
37
|
+
G({
|
38
|
+
element: p,
|
39
|
+
padding: o.arrowPadding
|
40
|
+
})
|
41
|
+
],
|
42
|
+
strategy: "fixed"
|
43
|
+
}
|
44
|
+
), { queueFunction: B } = Q(), u = B(async (e) => {
|
45
|
+
e ? (M(), P()) : (await U(o.transitionDuration), t.value && (o.dialog ? t.value.close() : t.value.hidePopover()));
|
46
|
+
}), P = () => {
|
47
|
+
if (!t.value) return;
|
48
|
+
if (!o.dialog) return t.value.showPopover();
|
49
|
+
t.value.showModal();
|
50
|
+
};
|
51
|
+
S(a, u, { flush: "post" }), z(() => {
|
52
|
+
a.value && u(a.value);
|
53
|
+
});
|
54
|
+
const $ = E(() => {
|
55
|
+
if (r.value.arrow) {
|
56
|
+
const { x: e, y: d } = r.value.arrow;
|
57
|
+
return {
|
58
|
+
style: {
|
59
|
+
left: `${e}px`,
|
60
|
+
top: `${d}px`
|
61
|
+
}
|
62
|
+
};
|
63
|
+
}
|
64
|
+
}), D = () => {
|
65
|
+
a.value = !1;
|
66
|
+
};
|
67
|
+
return (e, d) => (v(), b(g(e.dialog ? "div" : e.tag), {
|
68
|
+
ref_key: "wrapper",
|
69
|
+
ref: i,
|
70
|
+
class: N(["bb-common-popover", {
|
71
|
+
"bb-common-popover--open": a.value && !!t.value,
|
72
|
+
"bb-common-popover--block": o.block,
|
73
|
+
[`bb-common-popover--${n(_)}`]: !0
|
74
|
+
}]),
|
75
|
+
style: F({
|
76
|
+
"--transition-duration": `${o.transitionDuration}ms`
|
77
|
+
})
|
78
|
+
}, {
|
79
|
+
default: w(() => {
|
80
|
+
var m, c, f;
|
81
|
+
return [
|
82
|
+
y(e.$slots, "activator"),
|
83
|
+
e.renderContent ? (v(), b(g(e.dialog ? "dialog" : e.tag), h({
|
84
|
+
key: 0,
|
85
|
+
ref_key: "content",
|
86
|
+
ref: t,
|
87
|
+
class: ["bb-common-popover__bubble-container", {
|
88
|
+
"bb-common-popover__bubble-container--open": a.value && !!t.value
|
89
|
+
}],
|
90
|
+
popover: "manual",
|
91
|
+
style: {
|
92
|
+
...((m = e.containerAttributes) == null ? void 0 : m.style) ?? {},
|
93
|
+
...n(k),
|
94
|
+
"--arrow-offset-x": Math.round(((f = (c = n(r)) == null ? void 0 : c.arrow) == null ? void 0 : f.x) ?? 0) + "px",
|
95
|
+
"--page-padding": `${e.padding}px`
|
96
|
+
},
|
97
|
+
tabindex: a.value ? void 0 : -1
|
98
|
+
}, e.containerAttributes, { onClose: n(D) }), {
|
99
|
+
default: w(() => [
|
100
|
+
C("span", h({
|
101
|
+
ref_key: "bubblearrow",
|
102
|
+
ref: p,
|
103
|
+
class: "bb-common-popover__arrow"
|
104
|
+
}, $.value), null, 16),
|
105
|
+
C("span", O, [
|
106
|
+
y(e.$slots, "default")
|
107
|
+
])
|
108
|
+
]),
|
109
|
+
_: 3
|
110
|
+
}, 16, ["class", "style", "tabindex", "onClose"])) : q("", !0)
|
111
|
+
];
|
112
|
+
}),
|
113
|
+
_: 3
|
114
|
+
}, 8, ["class", "style"]));
|
15
115
|
}
|
16
|
-
|
17
|
-
};
|
116
|
+
});
|
18
117
|
export {
|
19
|
-
|
118
|
+
ee as default
|
20
119
|
};
|
package/dist/index239.js
CHANGED
@@ -1,8 +1,231 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
import { defineComponent as U, ref as f, computed as x, watch as D, createElementBlock as d, openBlock as p, withModifiers as X, normalizeStyle as h, normalizeClass as $, createElementVNode as v, renderSlot as m, createTextVNode as z, toDisplayString as g, unref as H, Fragment as Z, renderList as ee } from "vue";
|
2
|
+
import { isNil as b } from "./index241.js";
|
3
|
+
import { useVirtualizer as te } from "./index332.js";
|
4
|
+
import { isNotNil as oe } from "./index140.js";
|
5
|
+
import { hash as L } from "./index219.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__label" }, be = /* @__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(N, { expose: V, emit: O }) {
|
27
|
+
const o = N, y = O, { t: I } = ne(), s = f(null), C = (e) => "option_" + JSON.stringify(e).replace(/\W/g, "_"), i = x(
|
28
|
+
() => o.options.map((e) => ({ ...e, id: C(e.value) }))
|
29
|
+
), c = te({
|
30
|
+
get count() {
|
31
|
+
return o.options.length;
|
32
|
+
},
|
33
|
+
getScrollElement: () => s.value ? s.value : null,
|
34
|
+
estimateSize: () => o.compact ? 32 : 40,
|
35
|
+
overscan: 5,
|
36
|
+
measureElement: () => o.compact ? 32 : 40,
|
37
|
+
useAnimationFrameWithResizeObserver: !0
|
38
|
+
}), F = (e) => {
|
39
|
+
e && c.value.measureElement(e);
|
40
|
+
}, M = x(() => c.value.getVirtualItems()), A = x(() => c.value.getTotalSize()), n = f(null), a = x(
|
41
|
+
() => o.open && o.options.some((e) => !e.disabled)
|
42
|
+
), _ = (e = 1) => {
|
43
|
+
const l = b(n.value) ? -1 : n.value;
|
44
|
+
let t = (l + e) % o.options.length;
|
45
|
+
for (; o.options[t].disabled && t !== l; )
|
46
|
+
t = _(e + 1);
|
47
|
+
return t;
|
48
|
+
}, R = () => {
|
49
|
+
if (!a.value) return;
|
50
|
+
const e = _();
|
51
|
+
n.value = e, u();
|
52
|
+
}, S = (e = 1) => {
|
53
|
+
const l = b(n.value) ? 0 : n.value;
|
54
|
+
let t = (l - e + o.options.length) % o.options.length;
|
55
|
+
for (; o.options[t].disabled && t !== l; )
|
56
|
+
t = S(e + 1);
|
57
|
+
return t;
|
58
|
+
}, P = async () => {
|
59
|
+
if (!a.value) return;
|
60
|
+
const e = S();
|
61
|
+
n.value = e, u();
|
62
|
+
}, W = () => {
|
63
|
+
if (!a.value) return;
|
64
|
+
let e = 0;
|
65
|
+
for (; o.options[e].disabled; )
|
66
|
+
e++;
|
67
|
+
n.value = e, u();
|
68
|
+
}, q = () => {
|
69
|
+
if (!a.value) return;
|
70
|
+
let e = o.options.length - 1;
|
71
|
+
for (; o.options[e].disabled && e !== 0; )
|
72
|
+
e--;
|
73
|
+
n.value = e, u();
|
74
|
+
}, J = () => {
|
75
|
+
if (!a.value) return;
|
76
|
+
let e = 0;
|
77
|
+
for (; o.options[e] && !o.options[e].selected && o.options.length !== e; )
|
78
|
+
e++;
|
79
|
+
n.value = e % o.options.length, u();
|
80
|
+
}, Y = () => {
|
81
|
+
if (!a.value) return;
|
82
|
+
let e = o.options.length - 1;
|
83
|
+
for (; o.options[e].selected && e > 0; )
|
84
|
+
e--;
|
85
|
+
n.value = e === -1 ? o.options.length - 1 : e, u();
|
86
|
+
}, j = (e) => {
|
87
|
+
if (!a.value) return;
|
88
|
+
const l = o.options.findIndex(
|
89
|
+
(t) => t.valueHash === e
|
90
|
+
);
|
91
|
+
l >= 0 && (n.value = l), u();
|
92
|
+
}, k = () => {
|
93
|
+
n.value = null;
|
94
|
+
}, u = () => {
|
95
|
+
s.value && oe(n.value) && c.value.scrollToIndex(n.value, {
|
96
|
+
align: "center",
|
97
|
+
behavior: "smooth"
|
98
|
+
});
|
99
|
+
}, w = () => {
|
100
|
+
if (b(n.value) || !o.open) return;
|
101
|
+
const e = o.options[n.value];
|
102
|
+
e.selected ? y("option:unselected", e) : y("option:selected", e);
|
103
|
+
}, B = f(0), E = () => {
|
104
|
+
s.value && (B.value = s.value.scrollHeight);
|
105
|
+
}, G = (e) => !e.disabled, K = (e) => {
|
106
|
+
if (e.preventDefault(), s.value && e.target && e.target instanceof HTMLElement) {
|
107
|
+
if (!s.value.querySelector('[role="listbox"]'))
|
108
|
+
throw new Error("Could not find listbox in DOM tree.");
|
109
|
+
let t = e.target, r = t.dataset.index;
|
110
|
+
for (; b(r) && t.parentElement; )
|
111
|
+
t = t.parentElement, r = t.dataset.index;
|
112
|
+
if (r) {
|
113
|
+
const T = o.options[+r];
|
114
|
+
T && G(T) && (n.value = +r, w());
|
115
|
+
}
|
116
|
+
}
|
117
|
+
}, Q = () => b(n.value) ? void 0 : o.options[n.value];
|
118
|
+
return D(
|
119
|
+
() => o.open,
|
120
|
+
() => {
|
121
|
+
E();
|
122
|
+
},
|
123
|
+
{ flush: "post" }
|
124
|
+
), D(
|
125
|
+
() => o.options,
|
126
|
+
(e, l) => {
|
127
|
+
L(e.map((t) => t.valueHash)) !== L(l.map((t) => t.valueHash)) && (c.value.calculateRange(), E(), k());
|
128
|
+
},
|
129
|
+
{
|
130
|
+
flush: "post"
|
131
|
+
}
|
132
|
+
), V({
|
133
|
+
focusNext: R,
|
134
|
+
focusPrevious: P,
|
135
|
+
focusFirst: W,
|
136
|
+
focusFirstSelected: J,
|
137
|
+
focusLast: q,
|
138
|
+
focusLastSelected: Y,
|
139
|
+
blur: k,
|
140
|
+
confirmOption: w,
|
141
|
+
focusByHash: j,
|
142
|
+
getHighlighted: Q
|
143
|
+
}), (e, l) => (p(), d("span", {
|
144
|
+
class: $(["bb-listbox", {
|
145
|
+
"bb-listbox--compact": e.compact,
|
146
|
+
"bb-listbox--loading": e.loading,
|
147
|
+
"bb-listbox--multiple": e.multiple,
|
148
|
+
"bb-listbox--no-data": !i.value.length,
|
149
|
+
"bb-listbox--open": e.open
|
150
|
+
}]),
|
151
|
+
style: h({
|
152
|
+
"--transition-duration": `${e.transitionDuration}ms`,
|
153
|
+
"--overlay-min-height": `${B.value}px`
|
154
|
+
}),
|
155
|
+
onClick: X(K, ["stop"])
|
156
|
+
}, [
|
157
|
+
v("span", le, [
|
158
|
+
v("span", {
|
159
|
+
ref_key: "inner",
|
160
|
+
ref: s,
|
161
|
+
class: "bb-listbox__inner-container",
|
162
|
+
tabindex: "-1"
|
163
|
+
}, [
|
164
|
+
m(e.$slots, "options:prepend"),
|
165
|
+
e.loading && !e.options.length ? (p(), d("span", ie, [
|
166
|
+
m(e.$slots, "loading", {}, () => [
|
167
|
+
z(g(e.loadingText || H(I)("common.loadingText").value), 1)
|
168
|
+
])
|
169
|
+
])) : e.options.length ? (p(), d("span", {
|
170
|
+
key: 2,
|
171
|
+
role: "listbox",
|
172
|
+
style: h({
|
173
|
+
height: `${A.value}px`
|
174
|
+
}),
|
175
|
+
tabindex: "-1"
|
176
|
+
}, [
|
177
|
+
(p(!0), d(Z, null, ee(M.value, (t, r) => (p(), d("span", {
|
178
|
+
key: i.value[t.index].value,
|
179
|
+
ref_for: !0,
|
180
|
+
ref: F,
|
181
|
+
"aria-selected": n.value === r ? !0 : void 0,
|
182
|
+
class: $({
|
183
|
+
"bb-listbox__option autocomplete-option": !0,
|
184
|
+
"autocomplete-option--focused": n.value === t.index,
|
185
|
+
"autocomplete-option--selected": i.value[t.index].selected,
|
186
|
+
"autocomplete-option--disabled": i.value[t.index].disabled
|
187
|
+
}),
|
188
|
+
"data-index": t.index,
|
189
|
+
role: "option",
|
190
|
+
style: h({
|
191
|
+
transform: `translateY(${t.start}px)`
|
192
|
+
})
|
193
|
+
}, [
|
194
|
+
m(e.$slots, "option", {
|
195
|
+
disabled: !!i.value[t.index].disabled,
|
196
|
+
focused: n.value === t.index,
|
197
|
+
index: t.index,
|
198
|
+
item: i.value[t.index].item,
|
199
|
+
selected: !!i.value[t.index].selected,
|
200
|
+
text: i.value[t.index].text,
|
201
|
+
value: i.value[t.index].value
|
202
|
+
}, () => [
|
203
|
+
l[0] || (l[0] = v("svg", {
|
204
|
+
class: "autocomplete-option__checkbox",
|
205
|
+
role: "presentation",
|
206
|
+
viewBox: "276.411 158.834 114.971 114.97"
|
207
|
+
}, [
|
208
|
+
v("path", {
|
209
|
+
d: "M 297.574 224.786 L 318.309 243.134 L 371.568 189.232",
|
210
|
+
fill: "none",
|
211
|
+
"stroke-linecap": "round",
|
212
|
+
"stroke-width": "14px"
|
213
|
+
})
|
214
|
+
], -1)),
|
215
|
+
v("span", ue, g(i.value[t.index].text), 1)
|
216
|
+
])
|
217
|
+
], 14, ae))), 128))
|
218
|
+
], 4)) : (p(), d("span", se, [
|
219
|
+
m(e.$slots, "no-data", {}, () => [
|
220
|
+
z(g(e.noDataText || H(I)("common.noDataText").value), 1)
|
221
|
+
])
|
222
|
+
])),
|
223
|
+
m(e.$slots, "options:append")
|
224
|
+
], 512)
|
225
|
+
])
|
226
|
+
], 6));
|
227
|
+
}
|
5
228
|
});
|
6
229
|
export {
|
7
|
-
|
230
|
+
be as default
|
8
231
|
};
|
package/dist/index240.js
CHANGED