bitboss-ui 2.0.175 → 2.0.176
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/BaseColorInput/BaseColorInput.vue.d.ts +1 -0
- package/dist/components/BaseDialog/BaseDialog.vue.d.ts +34 -27
- package/dist/components/BbConfirm/BbConfirm.vue.d.ts +1 -1
- package/dist/components/BbDialog/BbDialog.vue.d.ts +8 -3
- package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +1 -1
- package/dist/components/BbToast/BbToast.vue.d.ts +1 -1
- package/dist/index.css +1 -1
- package/dist/index106.js +9 -9
- package/dist/index111.js +1 -1
- package/dist/index113.js +1 -1
- package/dist/index121.js +11 -11
- package/dist/index129.js +20 -26
- package/dist/index13.js +1 -1
- package/dist/index131.js +4 -4
- package/dist/index133.js +1 -1
- package/dist/index136.js +1 -1
- package/dist/index137.js +2 -2
- package/dist/index138.js +1 -1
- package/dist/index139.js +2 -2
- package/dist/index15.js +9 -9
- package/dist/index17.js +2 -2
- package/dist/index19.js +8 -8
- package/dist/index207.js +2 -2
- package/dist/index208.js +2 -2
- package/dist/index209.js +13 -86
- package/dist/index21.js +16 -16
- package/dist/index210.js +68 -0
- package/dist/index212.js +175 -15
- package/dist/index213.js +86 -51
- package/dist/index215.js +29 -3
- package/dist/index216.js +16 -11
- package/dist/index217.js +48 -13
- package/dist/index218.js +15 -2
- package/dist/index219.js +3 -2
- package/dist/index220.js +11 -17
- package/dist/index221.js +15 -11
- package/dist/index222.js +33 -12
- package/dist/index223.js +2 -6
- package/dist/index224.js +1 -1
- package/dist/index225.js +2 -106
- package/dist/index226.js +7 -0
- package/dist/index227.js +5 -100
- package/dist/index228.js +7 -0
- package/dist/index229.js +5 -66
- package/dist/index23.js +15 -15
- package/dist/index230.js +7 -0
- package/dist/index231.js +5 -13
- package/dist/index232.js +2 -120
- package/dist/index233.js +4 -0
- package/dist/index234.js +2 -228
- package/dist/index235.js +13 -2
- package/dist/index236.js +11 -2
- package/dist/index237.js +20 -2
- package/dist/index238.js +113 -41
- package/dist/index240.js +102 -11
- package/dist/index242.js +100 -3
- package/dist/index244.js +4 -34
- package/dist/index245.js +194 -174
- package/dist/index247.js +18 -5
- package/dist/index248.js +12 -5
- package/dist/index249.js +6 -5
- package/dist/index25.js +154 -224
- package/dist/index250.js +228 -5
- package/dist/index251.js +13 -5
- package/dist/index252.js +3 -5
- package/dist/index253.js +5 -8
- package/dist/index254.js +5 -250
- package/dist/index255.js +6 -50
- package/dist/index256.js +242 -36
- package/dist/index257.js +52 -5
- package/dist/index258.js +31 -47
- package/dist/index259.js +5 -4
- package/dist/index260.js +60 -11
- package/dist/index261.js +2 -20
- package/dist/index262.js +2 -200
- package/dist/index263.js +11 -0
- package/dist/index264.js +23 -5
- package/dist/index265.js +10 -2
- package/dist/index266.js +3 -2
- package/dist/index267.js +41 -6
- package/dist/index268.js +7 -16
- package/dist/index269.js +15 -3
- package/dist/index27.js +1 -1
- package/dist/index270.js +3 -9
- package/dist/index271.js +6 -23
- package/dist/index272.js +16 -9
- package/dist/index273.js +9 -9
- package/dist/index274.js +9 -8
- package/dist/index275.js +7 -66
- package/dist/index276.js +2 -5
- package/dist/index277.js +5 -2
- package/dist/index278.js +67 -5
- package/dist/index279.js +4 -7
- package/dist/index280.js +8 -3
- package/dist/index282.js +7 -28
- package/dist/index283.js +3 -471
- package/dist/index284.js +3 -2
- package/dist/index285.js +17 -7
- package/dist/index286.js +27 -10
- package/dist/index287.js +2 -4
- package/dist/index289.js +4 -5
- package/dist/index29.js +3 -3
- package/dist/index290.js +278 -198
- package/dist/index291.js +2 -3
- package/dist/index292.js +125 -3
- package/dist/index293.js +2 -3
- package/dist/index294.js +17 -0
- package/dist/index295.js +2 -7
- package/dist/index296.js +16 -3
- package/dist/index297.js +2 -2
- package/dist/index298.js +16 -3
- package/dist/index299.js +2 -280
- package/dist/index300.js +19 -2
- package/dist/index301.js +2 -16
- package/dist/index302.js +3 -2
- package/dist/index303.js +7 -16
- package/dist/index304.js +11 -2
- package/dist/index305.js +3 -19
- package/dist/index306.js +3 -2
- package/dist/index307.js +3 -15
- package/dist/index308.js +6 -2
- package/dist/index309.js +2 -19
- package/dist/index31.js +1 -1
- package/dist/index310.js +5 -2
- package/dist/index311.js +15 -23
- package/dist/index313.js +27 -2
- package/dist/index314.js +2 -2
- package/dist/index316.js +1 -1
- package/dist/index317.js +1 -21
- package/dist/index318.js +4 -0
- package/dist/index319.js +22 -6
- package/dist/index321.js +471 -2
- package/dist/index322.js +1 -1
- package/dist/index323.js +2 -2
- package/dist/index324.js +199 -700
- package/dist/index325.js +699 -352
- package/dist/index326.js +354 -58
- package/dist/index327.js +58 -2
- package/dist/index328.js +2 -228
- package/dist/index329.js +6 -128
- package/dist/index33.js +8 -8
- package/dist/index330.js +44 -366
- package/dist/index331.js +128 -6
- package/dist/index332.js +366 -16
- package/dist/index333.js +6 -6
- package/dist/index334.js +17 -45
- package/dist/index335.js +32 -7
- package/dist/index336.js +28 -6
- package/dist/index340.js +7 -32
- package/dist/index341.js +6 -28
- package/dist/index343.js +221 -86
- package/dist/index344.js +89 -125
- package/dist/index345.js +467 -421
- package/dist/index346.js +123 -121
- package/dist/index348.js +5 -0
- package/dist/index349.js +47 -3
- package/dist/index35.js +4 -4
- package/dist/index350.js +429 -40
- package/dist/index351.js +129 -0
- package/dist/index37.js +19 -19
- package/dist/index39.js +5 -5
- package/dist/index41.js +1 -1
- 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 +3 -3
- package/dist/index67.js +1 -1
- package/dist/index73.js +23 -26
- package/dist/index77.js +32 -34
- 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/index87.js +1 -1
- package/dist/index90.js +4 -4
- package/dist/index92.js +2 -2
- package/dist/index94.js +7 -6
- package/dist/index96.js +1 -1
- package/dist/utilities/functions/parseSize.d.ts +2 -0
- package/package.json +2 -2
- package/dist/index211.js +0 -31
- package/dist/index214.js +0 -17
- package/dist/index239.js +0 -9
- package/dist/index241.js +0 -12
- package/dist/index243.js +0 -5
- package/dist/index246.js +0 -7
- package/dist/index281.js +0 -19
- package/dist/index320.js +0 -127
- package/dist/index347.js +0 -484
- /package/dist/{index337.js → index342.js} +0 -0
package/dist/index25.js
CHANGED
@@ -1,248 +1,178 @@
|
|
1
|
-
import { defineComponent as
|
2
|
-
import {
|
3
|
-
import { useId as
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import
|
9
|
-
import { useLocale as me } from "./index222.js";
|
10
|
-
import ye from "./index111.js";
|
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 t, renderSlot as s, createTextVNode as j, toDisplayString as T, createVNode as G, withCtx as J, nextTick as Q } from "vue";
|
2
|
+
import { parseSize as X } from "./index251.js";
|
3
|
+
import { useId as V } from "./index8.js";
|
4
|
+
import { useLocale as Y } from "./index235.js";
|
5
|
+
import { useMobile as Z } from "./index9.js";
|
6
|
+
import { useUntil as x } from "./index236.js";
|
7
|
+
import { wait as h } from "./index135.js";
|
8
|
+
import ee from "./index111.js";
|
11
9
|
/* empty css */
|
12
|
-
const
|
10
|
+
const oe = ["aria-describedby", "aria-labelledby", "aria-live"], te = {
|
11
|
+
ref: "header",
|
12
|
+
class: "bb-base-dialog__header"
|
13
|
+
}, le = { class: "bb-base-dialog__close" }, se = ["aria-label", "disabled"], ae = {
|
14
|
+
ref: "body",
|
15
|
+
class: "bb-base-dialog__body scrollbar-border"
|
16
|
+
}, ie = {
|
17
|
+
ref: "footer",
|
18
|
+
class: "bb-base-dialog__footer"
|
19
|
+
}, ve = /* @__PURE__ */ P({
|
13
20
|
__name: "BaseDialog",
|
14
|
-
props: {
|
21
|
+
props: /* @__PURE__ */ D({
|
15
22
|
closeLabel: {},
|
16
23
|
compact: { type: Boolean },
|
17
24
|
disabled: { type: Boolean },
|
18
25
|
eager: { type: Boolean },
|
19
|
-
panelClasses: { default: () => [] },
|
20
|
-
overlayClasses: { default: () => [] },
|
21
26
|
persistent: { type: Boolean },
|
22
27
|
showClose: { type: Boolean, default: !0 },
|
23
28
|
title: {},
|
24
|
-
|
25
|
-
transitionDuration: { default: 200 },
|
29
|
+
transitionDuration: { default: 300 },
|
26
30
|
size: { default: "sm" },
|
27
31
|
description: {},
|
28
32
|
focusTarget: {},
|
29
33
|
fullscreen: { type: [Boolean, String] },
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
/* On esc deactivate the trap, return focus and then close the modal */
|
45
|
-
escapeDeactivates: () => (N(async () => {
|
46
|
-
l.persistent ? (b.value = !0, await g(100), b.value = !1) : u("update:modelValue", !1);
|
47
|
-
}), !l.persistent)
|
48
|
-
}), Q = se(), { t: X } = me(), Y = i(
|
49
|
-
() => l.closeLabel || X("dialog.closeLabel").value
|
50
|
-
);
|
51
|
-
ne(async () => {
|
52
|
-
!l.modelValue && !n.value || T && !globalThis.document || S();
|
53
|
-
});
|
54
|
-
const v = a(!1), c = a(!1), C = a(!0), f = a(!1), n = a(l.eager || l.modelValue), L = i(() => c.value || f.value), Z = () => {
|
55
|
-
if (!globalThis.document) return;
|
56
|
-
const e = window.innerWidth - document.documentElement.clientWidth;
|
57
|
-
document.body.style.overflow = "hidden", document.body.style.paddingRight = `${e}px`;
|
58
|
-
}, z = () => {
|
59
|
-
globalThis.document && (document.body.style.overflow = "auto", document.body.style.paddingRight = "0px");
|
60
|
-
};
|
61
|
-
ie(() => {
|
62
|
-
if (l.modelValue) {
|
63
|
-
const { openedModals: e, modalHasClosed: t } = h();
|
64
|
-
e.value && (t(), p.value = 0, z());
|
65
|
-
}
|
66
|
-
});
|
67
|
-
const S = async () => {
|
68
|
-
if (l.modelValue) {
|
69
|
-
n.value || (n.value = !0, await be(() => !!$.value), await N()), C.value = !1, f.value = !1, c.value = !0;
|
70
|
-
const { modalHasOpened: e, openedModals: t } = h();
|
71
|
-
e(), p.value = t.value, Z(), await g(l.transitionDuration), c.value = !1, v.value = !0, u("shown"), J();
|
72
|
-
} else {
|
73
|
-
D(), c.value = !1, v.value = !1, f.value = !0, await g(l.transitionDuration), f.value = !1, C.value = !0;
|
74
|
-
const { modalHasClosed: e, openedModals: t } = h();
|
75
|
-
e(), p.value = 0, t.value || z(), u("hidden");
|
34
|
+
panelClasses: { default: () => [] },
|
35
|
+
overlayClasses: { default: () => [] }
|
36
|
+
}, {
|
37
|
+
modelValue: { type: Boolean, default: !1 },
|
38
|
+
modelModifiers: {}
|
39
|
+
}),
|
40
|
+
emits: /* @__PURE__ */ D(["shown", "hidden"], ["update:modelValue"]),
|
41
|
+
setup(y, { emit: S }) {
|
42
|
+
const o = y, w = S, l = q(y, "modelValue"), { t: z } = Y(), N = p(
|
43
|
+
() => o.closeLabel || z("dialog.closeLabel").value
|
44
|
+
), n = E(null), c = x(
|
45
|
+
() => l.value || o.eager,
|
46
|
+
{
|
47
|
+
initialValue: l.value || o.eager
|
76
48
|
}
|
49
|
+
), b = `title_${V().id.value}`, f = `description_${V().id.value}`, C = (e) => {
|
50
|
+
if (e.key === "Escape" && (o.disabled || o.persistent))
|
51
|
+
return e.preventDefault(), a.value = !0, h(200).then(() => {
|
52
|
+
a.value = !1;
|
53
|
+
}), !1;
|
54
|
+
}, _ = async (e) => {
|
55
|
+
var i, B, L, M;
|
56
|
+
e ? ((i = window.globalThis) != null && i.document && !document.documentElement.style.getPropertyValue("--scrollbar-width") && (document.documentElement.style.setProperty(
|
57
|
+
"--scrollbar-width",
|
58
|
+
`${I()}px`
|
59
|
+
), document.addEventListener("keydown", C)), (B = n.value) == null || B.showModal(), o.focusTarget && Q(() => {
|
60
|
+
var $;
|
61
|
+
const m = ($ = n.value) == null ? void 0 : $.querySelector(o.focusTarget);
|
62
|
+
m && m instanceof HTMLElement && m.focus();
|
63
|
+
}), w("shown")) : (await h(o.transitionDuration), (L = window.globalThis) != null && L.document && document.removeEventListener("keydown", C), (M = n.value) == null || M.close(), w("hidden"));
|
77
64
|
};
|
78
|
-
|
79
|
-
()
|
80
|
-
() => {
|
81
|
-
!l.modelValue && !n.value || T && !globalThis.document || S();
|
82
|
-
},
|
83
|
-
{ flush: "post" }
|
84
|
-
);
|
85
|
-
const m = (e) => {
|
86
|
-
e.target === d.value && e.preventDefault();
|
87
|
-
}, b = a(!1), ee = async (e) => {
|
88
|
-
l.disabled || L.value || d.value && e.target === d.value && (l.persistent ? k.value && (b.value = !0, await g(100), b.value = !1) : u("update:modelValue", !1));
|
89
|
-
}, x = () => {
|
90
|
-
l.disabled || L.value || (D(), u("update:modelValue", !1));
|
91
|
-
}, le = i(() => {
|
92
|
-
const e = [
|
93
|
-
{
|
94
|
-
"bb-base-dialog bb-base-dialog__overlay": !0,
|
95
|
-
"bb-base-dialog--fullscreen": M.value,
|
96
|
-
"bb-base-dialog--faded": !G.value,
|
97
|
-
"bb-base-dialog--open": v.value,
|
98
|
-
"bb-base-dialog--opening": c.value,
|
99
|
-
"bb-base-dialog--closed": C.value,
|
100
|
-
"bb-base-dialog--closing": f.value,
|
101
|
-
"bb-base-dialog--attempted-closing": b.value
|
102
|
-
},
|
103
|
-
l.overlayClasses
|
104
|
-
].flat(), t = {
|
105
|
-
onClick: ee,
|
106
|
-
onScroll: m,
|
107
|
-
onTouchmove: m,
|
108
|
-
onWheel: m,
|
109
|
-
onKeydown: m
|
110
|
-
}, s = {
|
111
|
-
"--transition-duration": l.transitionDuration / 1e3 + "s"
|
112
|
-
};
|
113
|
-
return {
|
114
|
-
class: e,
|
115
|
-
style: s,
|
116
|
-
...t,
|
117
|
-
...Q
|
118
|
-
};
|
119
|
-
}), te = i(() => {
|
120
|
-
const e = [
|
121
|
-
{
|
122
|
-
"bb-base-dialog__panel": !0,
|
123
|
-
"bb-base-dialog__panel--compact": l.compact
|
124
|
-
},
|
125
|
-
l.panelClasses
|
126
|
-
].flat(), t = {
|
127
|
-
role: "dialog",
|
128
|
-
"aria-modal": !0,
|
129
|
-
"aria-live": v.value ? "polite" : "off"
|
130
|
-
};
|
131
|
-
n.value && (l.title && (t["aria-labelledby"] = _), l.description && (t["aria-describedby"] = w));
|
132
|
-
let s;
|
133
|
-
const I = {
|
134
|
-
sm: 384,
|
135
|
-
md: 652,
|
136
|
-
lg: 896
|
137
|
-
};
|
138
|
-
return M.value ? s = "100%" : typeof l.size == "number" ? s = l.size + "px" : l.size in I ? s = I[l.size] + "px" : s = l.size + "px", {
|
139
|
-
class: e,
|
140
|
-
style: {
|
141
|
-
maxWidth: s
|
142
|
-
},
|
143
|
-
...t
|
144
|
-
};
|
65
|
+
A(l, _), H(() => {
|
66
|
+
l.value && _(!0);
|
145
67
|
});
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
68
|
+
const W = p(() => k.value ? "100%" : X(o.size, {
|
69
|
+
sm: 384,
|
70
|
+
md: 652,
|
71
|
+
lg: 896
|
72
|
+
})), r = (e) => {
|
73
|
+
if (e.preventDefault(), o.disabled || o.persistent)
|
74
|
+
return a.value = !0, h(300).then(() => {
|
75
|
+
a.value = !1;
|
76
|
+
}), !1;
|
77
|
+
l.value = !1;
|
78
|
+
}, a = E(!1), I = () => globalThis.document ? window.innerWidth - document.documentElement.clientWidth : 0, { isMobile: F } = Z(), k = p(
|
79
|
+
() => o.fullscreen === !0 || o.fullscreen === "mobile" && F.value
|
80
|
+
);
|
81
|
+
return (e, i) => (u(), d("dialog", {
|
82
|
+
ref_key: "dialog",
|
83
|
+
ref: n,
|
84
|
+
"aria-describedby": v(c) && e.description ? f : void 0,
|
85
|
+
"aria-labelledby": v(c) && e.title ? b : void 0,
|
86
|
+
"aria-live": l.value ? "polite" : "off",
|
87
|
+
class: R([
|
88
|
+
"bb-base-dialog",
|
89
|
+
[
|
90
|
+
{
|
91
|
+
"bb-base-dialog--open": l.value,
|
92
|
+
"bb-base-dialog--fullscreen": k.value,
|
93
|
+
"bb-base-dialog--compact": e.compact,
|
94
|
+
"bb-base-dialog--deny-close": a.value
|
95
|
+
},
|
96
|
+
e.overlayClasses,
|
97
|
+
e.panelClasses
|
98
|
+
].flat()
|
99
|
+
]),
|
100
|
+
style: O({
|
101
|
+
"--max-width": W.value,
|
102
|
+
"--transition-duration": `${o.transitionDuration}ms`
|
103
|
+
}),
|
104
|
+
onCancel: r,
|
105
|
+
onClick: K(r, ["self"])
|
106
|
+
}, [
|
107
|
+
v(c) ? (u(), d(U, { key: 0 }, [
|
108
|
+
t("div", te, [
|
109
|
+
s(e.$slots, "header", {
|
110
|
+
close: r,
|
111
|
+
title: e.title,
|
112
|
+
titleId: b
|
113
|
+
}, () => [
|
114
|
+
t("span", {
|
115
|
+
id: b,
|
116
|
+
class: "bb-base-dialog__title"
|
161
117
|
}, [
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
118
|
+
s(e.$slots, "title", { text: e.title }, () => [
|
119
|
+
j(T(e.title), 1)
|
120
|
+
])
|
121
|
+
]),
|
122
|
+
t("span", le, [
|
123
|
+
e.showClose ? (u(), d("button", {
|
124
|
+
key: 0,
|
125
|
+
"aria-label": N.value,
|
126
|
+
disabled: o.disabled,
|
127
|
+
type: "button",
|
128
|
+
onClick: r
|
166
129
|
}, [
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
class: "bb-base-dialog__title"
|
175
|
-
}, [
|
176
|
-
r(e.$slots, "title", { text: e.title }, () => [
|
177
|
-
de(E(e.title), 1)
|
178
|
-
])
|
179
|
-
]),
|
180
|
-
o("span", ge, [
|
181
|
-
e.showClose ? (y(), B("button", {
|
182
|
-
key: 0,
|
183
|
-
"aria-label": Y.value,
|
184
|
-
type: "button",
|
185
|
-
onClick: x
|
130
|
+
s(e.$slots, "close", {}, () => [
|
131
|
+
i[0] || (i[0] = t("span", { class: "bb-base-dialog__close-icon" }, [
|
132
|
+
t("svg", {
|
133
|
+
"aria-hidden": "true",
|
134
|
+
fill: "none",
|
135
|
+
viewBox: "0 0 24 24",
|
136
|
+
xmlns: "http://www.w3.org/2000/svg"
|
186
137
|
}, [
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
o("path", {
|
196
|
-
d: "M23 23L1 1M23 1L1 23",
|
197
|
-
stroke: "currentColor",
|
198
|
-
"stroke-linecap": "round",
|
199
|
-
"stroke-width": "3"
|
200
|
-
})
|
201
|
-
])
|
202
|
-
], -1))
|
203
|
-
])
|
204
|
-
], 8, he)) : V("", !0)
|
205
|
-
])
|
138
|
+
t("path", {
|
139
|
+
d: "M23 23L1 1M23 1L1 23",
|
140
|
+
stroke: "currentColor",
|
141
|
+
"stroke-linecap": "round",
|
142
|
+
"stroke-width": "3"
|
143
|
+
})
|
144
|
+
])
|
145
|
+
], -1))
|
206
146
|
])
|
207
|
-
],
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
class: "bb-base-dialog__footer"
|
235
|
-
}, [
|
236
|
-
r(e.$slots, "footer")
|
237
|
-
], 512)
|
238
|
-
], 512)) : V("", !0)
|
239
|
-
], 16)
|
240
|
-
], 16)
|
241
|
-
]),
|
242
|
-
_: 3
|
243
|
-
}));
|
147
|
+
], 8, se)) : g("", !0)
|
148
|
+
])
|
149
|
+
])
|
150
|
+
], 512),
|
151
|
+
t("div", ae, [
|
152
|
+
s(e.$slots, "description", {
|
153
|
+
descriptionId: f,
|
154
|
+
text: e.description
|
155
|
+
}, () => [
|
156
|
+
e.description ? (u(), d("div", {
|
157
|
+
key: 0,
|
158
|
+
id: f,
|
159
|
+
class: "bb-base-dialog__description sr-only"
|
160
|
+
}, T(e.description), 1)) : g("", !0)
|
161
|
+
]),
|
162
|
+
G(ee, { "transition-duration": 500 }, {
|
163
|
+
default: J(() => [
|
164
|
+
s(e.$slots, "default")
|
165
|
+
]),
|
166
|
+
_: 3
|
167
|
+
})
|
168
|
+
], 512),
|
169
|
+
t("div", ie, [
|
170
|
+
s(e.$slots, "footer")
|
171
|
+
], 512)
|
172
|
+
], 64)) : g("", !0)
|
173
|
+
], 46, oe));
|
244
174
|
}
|
245
175
|
});
|
246
176
|
export {
|
247
|
-
|
177
|
+
ve as default
|
248
178
|
};
|
package/dist/index250.js
CHANGED
@@ -1,7 +1,230 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
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 "./index330.js";
|
4
|
+
import { isNotNil as oe } from "./index140.js";
|
5
|
+
import { hash as N } from "./index219.js";
|
6
|
+
import { useLocale as ne } from "./index235.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));
|
226
|
+
}
|
227
|
+
});
|
5
228
|
export {
|
6
|
-
|
229
|
+
xe as default
|
7
230
|
};
|
package/dist/index251.js
CHANGED
@@ -1,7 +1,15 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
const c = (t, r) => {
|
2
|
+
if (typeof t == "string") {
|
3
|
+
const e = /^(\d+)([a-zA-Z%]+)?$/, n = t.match(e);
|
4
|
+
if (n) {
|
5
|
+
const [, o, a] = n;
|
6
|
+
return a ? t : o + "px";
|
7
|
+
} else if (t in r)
|
8
|
+
return r[t] + "px";
|
9
|
+
throw new Error(`Invalid size: ${t}`);
|
10
|
+
}
|
11
|
+
return t + "px";
|
12
|
+
};
|
5
13
|
export {
|
6
|
-
|
14
|
+
c as parseSize
|
7
15
|
};
|