bitboss-ui 0.2.20 → 0.2.22
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/BbDropzone/BbDropzone.vue.d.ts +2 -0
- package/dist/index101.js +2 -2
- package/dist/index103.js +2 -2
- package/dist/index109.js +1 -1
- package/dist/index11.js +2 -2
- package/dist/index111.js +3 -3
- package/dist/index113.js +1 -1
- package/dist/index116.js +1 -1
- package/dist/index117.js +1 -1
- package/dist/index118.js +1 -1
- package/dist/index119.js +1 -1
- package/dist/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 +214 -357
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +2 -134
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +378 -5
- package/dist/index199.js.map +1 -1
- package/dist/index200.js +2 -19
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +2 -2
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +6 -2
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +4 -174
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +373 -23
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +3 -373
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +3 -16
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +3 -16
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +35 -20
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +5 -29
- package/dist/index209.js.map +1 -1
- package/dist/index21.js +2 -2
- package/dist/index210.js +16 -8
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +16 -2
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +19 -3
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +20 -35
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +29 -6
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +8 -2
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +134 -4
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +2 -3
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +174 -3
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +23 -2
- package/dist/index219.js.map +1 -1
- package/dist/index220.js +2 -10
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +8 -233
- package/dist/index221.js.map +1 -1
- package/dist/index223.js +4 -4
- package/dist/index224.js +1 -1
- package/dist/index226.js +1 -1
- package/dist/index227.js +4 -6
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +224 -2
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +257 -294
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +435 -2
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +89 -2
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +199 -116
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +111 -100
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +106 -2
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +295 -2
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +6 -2
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +2 -2
- package/dist/index238.js +2 -435
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +2 -89
- package/dist/index239.js.map +1 -1
- package/dist/index240.js +2 -224
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +2 -258
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +2 -4
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +2 -200
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +162 -2
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +2 -15
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +2 -162
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +69 -2
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +2 -2
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +2 -69
- package/dist/index249.js.map +1 -1
- package/dist/index25.js +2 -2
- package/dist/index253.js +15 -2
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +2 -2
- package/dist/index255.js +1 -1
- package/dist/index29.js +3 -3
- package/dist/index31.js +6 -6
- 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/index69.js +109 -103
- package/dist/index69.js.map +1 -1
- package/dist/index72.js +1 -1
- package/dist/index75.js +1 -1
- package/dist/index79.js +61 -58
- package/dist/index79.js.map +1 -1
- package/dist/index99.js +53 -52
- package/dist/index99.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index79.js
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import { defineComponent as V, ref as a, computed as
|
|
1
|
+
import { defineComponent as V, ref as a, computed as _, openBlock as p, createElementBlock as h, mergeProps as B, createElementVNode as d, renderSlot as P, normalizeProps as I, guardReactiveProps as R, unref as g, createBlock as D, Teleport as U, normalizeClass as W, normalizeStyle as j, createCommentVNode as y, withCtx as G, nextTick as J } from "vue";
|
|
2
2
|
import { useFloating as K, arrow as Q } from "./index223.js";
|
|
3
|
-
import { useFocusTrap as X } from "./
|
|
3
|
+
import { useFocusTrap as X } from "./index208.js";
|
|
4
4
|
import { useId as Y } from "./index7.js";
|
|
5
5
|
import { wait as E } from "./index122.js";
|
|
6
6
|
import Z from "./index9.js";
|
|
7
7
|
import "./index10.js";
|
|
8
|
-
import { autoUpdate as ee, flip as oe, shift as te } from "./
|
|
9
|
-
import { offset as ae } from "./
|
|
10
|
-
const re = ["id"], ne = {
|
|
8
|
+
import { autoUpdate as ee, flip as oe, shift as te } from "./index199.js";
|
|
9
|
+
import { offset as ae } from "./index204.js";
|
|
10
|
+
const re = ["id"], ne = {
|
|
11
|
+
key: 1,
|
|
12
|
+
class: "bb-popover__bubble"
|
|
13
|
+
}, se = /* @__PURE__ */ d("span", { class: "bb-popover__close-label" }, "Chiudi", -1), le = /* @__PURE__ */ d("svg", {
|
|
11
14
|
viewBox: "0 0 24 24",
|
|
12
15
|
fill: "none",
|
|
13
16
|
xmlns: "http://www.w3.org/2000/svg"
|
|
14
17
|
}, [
|
|
15
|
-
/* @__PURE__ */
|
|
18
|
+
/* @__PURE__ */ d("path", {
|
|
16
19
|
d: "M23 23L1 1M23 1L1 23",
|
|
17
20
|
stroke: "currentColor",
|
|
18
21
|
"stroke-width": "2",
|
|
@@ -36,7 +39,7 @@ const re = ["id"], ne = { class: "bb-popover__bubble" }, se = /* @__PURE__ */ l(
|
|
|
36
39
|
},
|
|
37
40
|
emits: ["shown", "hidden"],
|
|
38
41
|
setup(M, { emit: N }) {
|
|
39
|
-
const o = M,
|
|
42
|
+
const o = M, l = N, { id: S } = Y(), b = `bbp_${S.value}`, i = a(), c = a(), k = a(), { activate: L, deactivate: O } = X(c, {
|
|
40
43
|
/**
|
|
41
44
|
* This traps all clicks outside so we are pressing
|
|
42
45
|
* the trigger we just allow and process that in its
|
|
@@ -45,21 +48,21 @@ const re = ["id"], ne = { class: "bb-popover__bubble" }, se = /* @__PURE__ */ l(
|
|
|
45
48
|
* close the popover and be done
|
|
46
49
|
*/
|
|
47
50
|
clickOutsideDeactivates: (e) => {
|
|
48
|
-
var
|
|
51
|
+
var T;
|
|
49
52
|
const t = e.target;
|
|
50
|
-
return t instanceof HTMLElement && (
|
|
53
|
+
return t instanceof HTMLElement && (T = i.value) != null && T.contains(t) || (f(), l("hidden")), !0;
|
|
51
54
|
},
|
|
52
55
|
escapeDeactivates: () => (J(async () => {
|
|
53
|
-
await
|
|
56
|
+
await f(), w(), l("hidden");
|
|
54
57
|
}), !0),
|
|
55
58
|
/* We don't return focus so that when
|
|
56
59
|
* we press a button on tyhe page we can focus
|
|
57
60
|
* THAT button and not the current trigger
|
|
58
61
|
*/
|
|
59
62
|
returnFocusOnDeactivate: !1
|
|
60
|
-
}), { floatingStyles:
|
|
63
|
+
}), { floatingStyles: z, placement: v, middlewareData: $ } = K(
|
|
64
|
+
i,
|
|
61
65
|
c,
|
|
62
|
-
p,
|
|
63
66
|
{
|
|
64
67
|
placement: o.placement,
|
|
65
68
|
whileElementsMounted: ee,
|
|
@@ -68,19 +71,19 @@ const re = ["id"], ne = { class: "bb-popover__bubble" }, se = /* @__PURE__ */ l(
|
|
|
68
71
|
ae(o.offset),
|
|
69
72
|
te({ padding: o.padding }),
|
|
70
73
|
Q({
|
|
71
|
-
element:
|
|
74
|
+
element: k,
|
|
72
75
|
padding: o.arrowPadding
|
|
73
76
|
})
|
|
74
77
|
]
|
|
75
78
|
}
|
|
76
|
-
),
|
|
79
|
+
), F = _(() => ({
|
|
77
80
|
class: {
|
|
78
81
|
"bb-popover--block": o.block,
|
|
79
82
|
[`bb-popover--theme-${o.theme}`]: o.theme
|
|
80
83
|
}
|
|
81
|
-
})), r = a(!1), n = a(!1), s = a(!1), u = a(!0),
|
|
82
|
-
if (
|
|
83
|
-
const { x: e, y: t } =
|
|
84
|
+
})), r = a(!1), n = a(!1), s = a(!1), u = a(!0), H = _(() => {
|
|
85
|
+
if ($.value.arrow) {
|
|
86
|
+
const { x: e, y: t } = $.value.arrow;
|
|
84
87
|
return {
|
|
85
88
|
style: {
|
|
86
89
|
left: `${e}px`,
|
|
@@ -88,56 +91,56 @@ const re = ["id"], ne = { class: "bb-popover__bubble" }, se = /* @__PURE__ */ l(
|
|
|
88
91
|
}
|
|
89
92
|
};
|
|
90
93
|
}
|
|
91
|
-
}),
|
|
94
|
+
}), q = _(() => {
|
|
92
95
|
const e = {
|
|
93
|
-
...
|
|
96
|
+
...z.value,
|
|
94
97
|
transitionDuration: `${o.transitionDuration}ms`
|
|
95
98
|
};
|
|
96
99
|
if (o.width) {
|
|
97
100
|
let t;
|
|
98
|
-
typeof o.width == "string" && Number.isNaN(Number(o.width)) ? o.width.includes("%") ? t = `${
|
|
101
|
+
typeof o.width == "string" && Number.isNaN(Number(o.width)) ? o.width.includes("%") ? t = `${i.value.clientWidth * (+o.width.replace("%", "") / 100)}px` : t = o.width : t = `${o.width}px`, e.width = t;
|
|
99
102
|
}
|
|
100
103
|
return e;
|
|
101
|
-
}),
|
|
104
|
+
}), x = async () => {
|
|
102
105
|
u.value = !1, s.value = !1, r.value = !0, await E(50), n.value = !0, r.value = !1;
|
|
103
|
-
},
|
|
106
|
+
}, f = async () => {
|
|
104
107
|
n.value = !1, r.value = !1, s.value = !0, await E(o.transitionDuration), s.value = !1, u.value = !0;
|
|
105
|
-
},
|
|
108
|
+
}, m = a(!1), A = async () => {
|
|
106
109
|
if (n.value) {
|
|
107
|
-
await
|
|
110
|
+
await f(), w(), l("hidden");
|
|
108
111
|
return;
|
|
109
112
|
}
|
|
110
113
|
if (r.value || o.disabled)
|
|
111
114
|
return;
|
|
112
|
-
|
|
115
|
+
m.value = !0, await x();
|
|
113
116
|
let e = o.focusTarget ?? ".bb-popover__close";
|
|
114
117
|
L({
|
|
115
118
|
onPostActivate: () => {
|
|
116
|
-
if (
|
|
117
|
-
const t =
|
|
118
|
-
t instanceof HTMLElement && (t.focus(),
|
|
119
|
+
if (c.value) {
|
|
120
|
+
const t = c.value.querySelector(e);
|
|
121
|
+
t instanceof HTMLElement && (t.focus(), l("shown"));
|
|
119
122
|
}
|
|
120
123
|
}
|
|
121
124
|
});
|
|
122
|
-
},
|
|
125
|
+
}, w = () => {
|
|
123
126
|
var t;
|
|
124
|
-
const e = (t =
|
|
127
|
+
const e = (t = i.value) == null ? void 0 : t.querySelector(`[aria-controls=popover_${b}]`);
|
|
125
128
|
e instanceof HTMLElement && e.focus();
|
|
126
|
-
},
|
|
127
|
-
O(), await
|
|
129
|
+
}, C = async () => {
|
|
130
|
+
O(), await f(), w(), l("hidden");
|
|
128
131
|
};
|
|
129
|
-
return (e, t) => (
|
|
130
|
-
|
|
132
|
+
return (e, t) => (p(), h("span", B({ class: "bb-popover" }, F.value), [
|
|
133
|
+
d("span", {
|
|
131
134
|
class: "bb-popover__wrapper",
|
|
132
135
|
ref_key: "wrapper",
|
|
133
|
-
ref:
|
|
136
|
+
ref: i
|
|
134
137
|
}, [
|
|
135
|
-
|
|
138
|
+
P(e.$slots, "activator", I(R({
|
|
136
139
|
props: {
|
|
137
|
-
"aria-controls": `popover_${
|
|
140
|
+
"aria-controls": `popover_${b}`,
|
|
138
141
|
"aria-expanded": n.value,
|
|
139
142
|
onClick: A,
|
|
140
|
-
id:
|
|
143
|
+
id: b,
|
|
141
144
|
disabled: !!e.disabled
|
|
142
145
|
},
|
|
143
146
|
closed: u.value,
|
|
@@ -145,14 +148,13 @@ const re = ["id"], ne = { class: "bb-popover__bubble" }, se = /* @__PURE__ */ l(
|
|
|
145
148
|
disabled: !!e.disabled,
|
|
146
149
|
open: n.value,
|
|
147
150
|
opening: r.value,
|
|
148
|
-
placement:
|
|
151
|
+
placement: g(v)
|
|
149
152
|
})))
|
|
150
153
|
], 512),
|
|
151
|
-
(
|
|
152
|
-
|
|
153
|
-
key: 0,
|
|
154
|
+
(p(), D(U, { to: "body" }, [
|
|
155
|
+
d("span", {
|
|
154
156
|
class: W(["bb-popover__bubble-container", {
|
|
155
|
-
[`bb-popover__bubble-container--${
|
|
157
|
+
[`bb-popover__bubble-container--${g(v)}`]: !0,
|
|
156
158
|
[`bb-popover__bubble-container--${e.theme}`]: e.theme,
|
|
157
159
|
"bb-popover__bubble-container--hidden": u.value,
|
|
158
160
|
"bb-popover__bubble-container--closing": s.value,
|
|
@@ -160,38 +162,39 @@ const re = ["id"], ne = { class: "bb-popover__bubble" }, se = /* @__PURE__ */ l(
|
|
|
160
162
|
"bb-popover__bubble-container--open": n.value
|
|
161
163
|
}]),
|
|
162
164
|
ref_key: "content",
|
|
163
|
-
ref:
|
|
164
|
-
style: j(
|
|
165
|
-
id: `popover_${
|
|
165
|
+
ref: c,
|
|
166
|
+
style: j(q.value),
|
|
167
|
+
id: `popover_${b}`
|
|
166
168
|
}, [
|
|
167
|
-
|
|
169
|
+
m.value || e.eager ? (p(), h("span", B({
|
|
170
|
+
key: 0,
|
|
168
171
|
class: "bb-popover__arrow",
|
|
169
172
|
ref_key: "bubblearrow",
|
|
170
|
-
ref:
|
|
171
|
-
},
|
|
172
|
-
|
|
173
|
-
e.showClose ? (
|
|
173
|
+
ref: k
|
|
174
|
+
}, H.value), null, 16)) : y("", !0),
|
|
175
|
+
m.value || e.eager ? (p(), h("span", ne, [
|
|
176
|
+
e.showClose ? (p(), D(Z, {
|
|
174
177
|
key: 0,
|
|
175
178
|
class: "bb-popover__close",
|
|
176
|
-
onClick:
|
|
179
|
+
onClick: C
|
|
177
180
|
}, {
|
|
178
181
|
default: G(() => [
|
|
179
182
|
se,
|
|
180
183
|
le
|
|
181
184
|
]),
|
|
182
185
|
_: 1
|
|
183
|
-
})) :
|
|
184
|
-
|
|
185
|
-
close:
|
|
186
|
+
})) : y("", !0),
|
|
187
|
+
P(e.$slots, "default", {
|
|
188
|
+
close: C,
|
|
186
189
|
closed: u.value,
|
|
187
190
|
closing: s.value,
|
|
188
191
|
disabled: !!e.disabled,
|
|
189
192
|
open: n.value,
|
|
190
193
|
opening: r.value,
|
|
191
|
-
placement:
|
|
194
|
+
placement: g(v)
|
|
192
195
|
})
|
|
193
|
-
])
|
|
194
|
-
], 14, re)
|
|
196
|
+
])) : y("", !0)
|
|
197
|
+
], 14, re)
|
|
195
198
|
]))
|
|
196
199
|
], 16));
|
|
197
200
|
}
|
package/dist/index79.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index79.js","sources":["../src/components/BbPopover/BbPopover.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, createElementVNode as _createElementVNode, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock, withCtx as _withCtx, createBlock as _createBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, Teleport as _Teleport } from \"vue\"\n\nconst _hoisted_1 = [\"id\"]\nconst _hoisted_2 = { class: \"bb-popover__bubble\" }\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"span\", { class: \"bb-popover__close-label\" }, \"Chiudi\", -1)\nconst _hoisted_4 = /*#__PURE__*/_createElementVNode(\"svg\", {\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M23 23L1 1M23 1L1 23\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\"\n })\n], -1)\n\nimport { computed, nextTick, ref } from \"vue\";\nimport {\n useFloating,\n autoUpdate,\n flip,\n shift,\n offset,\n arrow,\n} from \"@floating-ui/vue\";\nimport { useFocusTrap } from \"@vueuse/integrations/useFocusTrap\";\nimport { useId } from \"@/composables/useId\";\nimport { wait } from \"@/utilities/functions/wait\";\nimport BaseButton from \"../BaseButton/BaseButton.vue\";\nimport type { CommonProps } from \"@/types/CommonProps\";\nimport type { Placement } from \"@floating-ui/vue\";\n\nexport type BbPopoverProps = Pick<\n CommonProps,\n | \"arrowPadding\"\n | \"block\"\n | \"disabled\"\n | \"eager\"\n | \"offset\"\n | \"padding\"\n | \"placement\"\n | \"showClose\"\n | \"theme\"\n | \"transitionDuration\"\n> & {\n /**\n * Elements that obtains focus immediately after opening the popover.\n * By default it's the first tabbable item.\n */\n focusTarget?: string;\n /**\n * Width of the dropdown in pixels.\n */\n width?: number | string;\n};\n\nexport type BbPopoverEvents = {\n (e: \"shown\"): void;\n (e: \"hidden\"): void;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbPopover',\n props: {\n arrowPadding: { default: 10 },\n block: { type: Boolean },\n disabled: { type: Boolean },\n eager: { type: Boolean },\n offset: { default: 3 },\n padding: { default: 10 },\n placement: { default: \"bottom\" },\n showClose: { type: Boolean, default: true },\n theme: { default: \"default\" },\n transitionDuration: { default: 150 },\n focusTarget: {},\n width: {}\n },\n emits: [\"shown\", \"hidden\"],\n setup(__props: any, { emit: __emit }) {\n\nconst props = __props;\n\nconst emit = __emit;\n\n\n\nconst { id: _id } = useId();\nconst id = `bbp_${_id.value}`;\n\nconst wrapper = ref<HTMLElement>();\nconst content = ref<HTMLElement>();\nconst bubblearrow = ref<HTMLElement>();\n\nconst { activate, deactivate } = useFocusTrap(content, {\n /**\n * This traps all clicks outside so we are pressing\n * the trigger we just allow and process that in its\n * own click handler.\n * If we are pressing anything random on the page\n * close the popover and be done\n */\n clickOutsideDeactivates: (event) => {\n const target = event.target;\n if (target instanceof HTMLElement) {\n if (wrapper.value?.contains(target)) {\n return true;\n }\n }\n closePopover();\n emit(\"hidden\");\n return true;\n },\n escapeDeactivates: () => {\n nextTick(async () => {\n await closePopover();\n focusTrigger();\n emit(\"hidden\");\n });\n return true;\n },\n /* We don't return focus so that when\n * we press a button on tyhe page we can focus\n * THAT button and not the current trigger\n */\n returnFocusOnDeactivate: false,\n});\n\nconst { floatingStyles, placement, middlewareData } = useFloating(\n wrapper,\n content,\n {\n placement: props.placement,\n whileElementsMounted: autoUpdate,\n middleware: [\n flip(),\n offset(props.offset),\n shift({ padding: props.padding }),\n arrow({\n element: bubblearrow,\n padding: props.arrowPadding,\n }),\n ],\n }\n);\n\nconst attributes = computed(() => {\n const classes = {\n \"bb-popover--block\": props.block,\n [`bb-popover--theme-${props.theme}`]: props.theme,\n };\n return {\n class: classes,\n };\n});\n\nconst opening = ref(false);\nconst open = ref(false);\nconst closing = ref(false);\nconst closed = ref(true);\n\nconst arrowAttributes = computed(() => {\n if (middlewareData.value.arrow) {\n const { x, y } = middlewareData.value.arrow;\n return {\n style: {\n left: `${x}px`,\n top: `${y}px`,\n },\n };\n }\n});\n\nconst containerStyle = computed(() => {\n const base: Record<string, any> = {\n ...floatingStyles.value,\n transitionDuration: `${props.transitionDuration}ms`,\n };\n if (props.width) {\n let width: string;\n // If the width is a css unit string use it, if it is a number or number string add px\n if (typeof props.width === \"string\" && Number.isNaN(Number(props.width))) {\n if (props.width.includes(\"%\")) {\n width = `${\n wrapper.value!.clientWidth * (+props.width.replace(\"%\", \"\") / 100)\n }px`;\n } else {\n width = props.width;\n }\n } else {\n width = `${props.width}px`;\n }\n base.width = width;\n }\n return base;\n});\n\nconst openPopover = async () => {\n closed.value = false;\n closing.value = false;\n opening.value = true;\n await wait(50);\n open.value = true;\n opening.value = false;\n};\n\nconst closePopover = async () => {\n open.value = false;\n opening.value = false;\n closing.value = true;\n await wait(props.transitionDuration);\n closing.value = false;\n closed.value = true;\n};\nconst hasOpenedOnce = ref(false);\nconst onTriggerClick = async () => {\n if (open.value) {\n await closePopover();\n focusTrigger();\n emit(\"hidden\");\n return;\n }\n if (opening.value || props.disabled) return;\n hasOpenedOnce.value = true;\n await openPopover();\n let focusTarget = props.focusTarget ?? \".bb-popover__close\";\n\n activate({\n onPostActivate: () => {\n if (content.value) {\n const target = content.value.querySelector(focusTarget);\n if (target instanceof HTMLElement) {\n target.focus();\n emit(\"shown\");\n }\n }\n },\n });\n};\n\nconst focusTrigger = () => {\n const trigger = wrapper.value?.querySelector(`[aria-controls=popover_${id}]`);\n if (trigger instanceof HTMLElement) {\n trigger.focus();\n }\n};\n\nconst onClickClose = async () => {\n deactivate();\n await closePopover();\n focusTrigger();\n emit(\"hidden\");\n};\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", _mergeProps({ class: \"bb-popover\" }, attributes.value), [\n _createElementVNode(\"span\", {\n class: \"bb-popover__wrapper\",\n ref_key: \"wrapper\",\n ref: wrapper\n }, [\n _renderSlot(_ctx.$slots, \"activator\", _normalizeProps(_guardReactiveProps({\n props: {\n 'aria-controls': `popover_${id}`,\n 'aria-expanded': open.value,\n onClick: onTriggerClick,\n id: id,\n disabled: !!_ctx.disabled,\n },\n closed: closed.value,\n closing: closing.value,\n disabled: !!_ctx.disabled,\n open: open.value,\n opening: opening.value,\n placement: _unref(placement),\n })))\n ], 512),\n (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n (hasOpenedOnce.value || _ctx.eager)\n ? (_openBlock(), _createElementBlock(\"span\", {\n key: 0,\n class: _normalizeClass([\"bb-popover__bubble-container\", {\n [`bb-popover__bubble-container--${_unref(placement)}`]: true,\n [`bb-popover__bubble-container--${_ctx.theme}`]: _ctx.theme,\n 'bb-popover__bubble-container--hidden': closed.value,\n 'bb-popover__bubble-container--closing': closing.value,\n 'bb-popover__bubble-container--opening': opening.value,\n 'bb-popover__bubble-container--open': open.value,\n }]),\n ref_key: \"content\",\n ref: content,\n style: _normalizeStyle(containerStyle.value),\n id: `popover_${id}`\n }, [\n _createElementVNode(\"span\", _mergeProps({\n class: \"bb-popover__arrow\",\n ref_key: \"bubblearrow\",\n ref: bubblearrow\n }, arrowAttributes.value), null, 16),\n _createElementVNode(\"span\", _hoisted_2, [\n (_ctx.showClose)\n ? (_openBlock(), _createBlock(BaseButton, {\n key: 0,\n class: \"bb-popover__close\",\n onClick: onClickClose\n }, {\n default: _withCtx(() => [\n _hoisted_3,\n _hoisted_4\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n _renderSlot(_ctx.$slots, \"default\", {\n close: onClickClose,\n closed: closed.value,\n closing: closing.value,\n disabled: !!_ctx.disabled,\n open: open.value,\n opening: opening.value,\n placement: _unref(placement)\n })\n ])\n ], 14, _hoisted_1))\n : _createCommentVNode(\"\", true)\n ]))\n ], 16))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_sfc_main","_defineComponent","__props","__emit","props","emit","_id","useId","id","wrapper","ref","content","bubblearrow","activate","deactivate","useFocusTrap","event","target","_a","closePopover","nextTick","focusTrigger","floatingStyles","placement","middlewareData","useFloating","autoUpdate","flip","offset","shift","arrow","attributes","computed","opening","open","closing","closed","arrowAttributes","x","y","containerStyle","base","width","openPopover","wait","hasOpenedOnce","onTriggerClick","focusTarget","trigger","onClickClose","_ctx","_cache","_openBlock","_createElementBlock","_mergeProps","_createElementVNode","_renderSlot","_normalizeProps","_guardReactiveProps","_unref","_createBlock","_Teleport","_normalizeClass","_normalizeStyle","BaseButton","_withCtx","_createCommentVNode"],"mappings":";;;;;;;;;AAGA,MAAMA,KAAa,CAAC,IAAI,GAClBC,KAAa,EAAE,OAAO,wBACtBC,uBAA8C,QAAQ,EAAE,OAAO,6BAA6B,UAAU,EAAE,GACxGC,uBAA8C,OAAO;AAAA,EACzD,SAAS;AAAA,EACT,MAAM;AAAA,EACN,OAAO;AACT,GAAG;AAAA,oBACgC,QAAQ;AAAA,IACvC,GAAG;AAAA,IACH,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,EAAA,CACnB;AACH,GAAG,EAAE,GAgDuBC,KAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,cAAc,EAAE,SAAS,GAAG;AAAA,IAC5B,OAAO,EAAE,MAAM,QAAQ;AAAA,IACvB,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,OAAO,EAAE,MAAM,QAAQ;AAAA,IACvB,QAAQ,EAAE,SAAS,EAAE;AAAA,IACrB,SAAS,EAAE,SAAS,GAAG;AAAA,IACvB,WAAW,EAAE,SAAS,SAAS;AAAA,IAC/B,WAAW,EAAE,MAAM,SAAS,SAAS,GAAK;AAAA,IAC1C,OAAO,EAAE,SAAS,UAAU;AAAA,IAC5B,oBAAoB,EAAE,SAAS,IAAI;AAAA,IACnC,aAAa,CAAC;AAAA,IACd,OAAO,CAAC;AAAA,EACV;AAAA,EACA,OAAO,CAAC,SAAS,QAAQ;AAAA,EACzB,MAAMC,GAAc,EAAE,MAAMC,KAAU;AAExC,UAAMC,IAAQF,GAERG,IAAOF,GAIP,EAAE,IAAIG,EAAI,IAAIC,EAAM,GACpBC,IAAK,OAAOF,EAAI,KAAK,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AAoB,IAAI,EAAI;AAAA,MAAA,CACjC;AAAA,OACA,EAAE;AAAA,EAEP;AAEA,CAAC;"}
|
|
1
|
+
{"version":3,"file":"index79.js","sources":["../src/components/BbPopover/BbPopover.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, createElementVNode as _createElementVNode, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, withCtx as _withCtx, createBlock as _createBlock, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, Teleport as _Teleport } from \"vue\"\n\nconst _hoisted_1 = [\"id\"]\nconst _hoisted_2 = {\n key: 1,\n class: \"bb-popover__bubble\"\n}\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"span\", { class: \"bb-popover__close-label\" }, \"Chiudi\", -1)\nconst _hoisted_4 = /*#__PURE__*/_createElementVNode(\"svg\", {\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M23 23L1 1M23 1L1 23\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\"\n })\n], -1)\n\nimport { computed, nextTick, ref } from \"vue\";\nimport {\n useFloating,\n autoUpdate,\n flip,\n shift,\n offset,\n arrow,\n} from \"@floating-ui/vue\";\nimport { useFocusTrap } from \"@vueuse/integrations/useFocusTrap\";\nimport { useId } from \"@/composables/useId\";\nimport { wait } from \"@/utilities/functions/wait\";\nimport BaseButton from \"../BaseButton/BaseButton.vue\";\nimport type { CommonProps } from \"@/types/CommonProps\";\nimport type { Placement } from \"@floating-ui/vue\";\n\nexport type BbPopoverProps = Pick<\n CommonProps,\n | \"arrowPadding\"\n | \"block\"\n | \"disabled\"\n | \"eager\"\n | \"offset\"\n | \"padding\"\n | \"placement\"\n | \"showClose\"\n | \"theme\"\n | \"transitionDuration\"\n> & {\n /**\n * Elements that obtains focus immediately after opening the popover.\n * By default it's the first tabbable item.\n */\n focusTarget?: string;\n /**\n * Width of the dropdown in pixels.\n */\n width?: number | string;\n};\n\nexport type BbPopoverEvents = {\n (e: \"shown\"): void;\n (e: \"hidden\"): void;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbPopover',\n props: {\n arrowPadding: { default: 10 },\n block: { type: Boolean },\n disabled: { type: Boolean },\n eager: { type: Boolean },\n offset: { default: 3 },\n padding: { default: 10 },\n placement: { default: \"bottom\" },\n showClose: { type: Boolean, default: true },\n theme: { default: \"default\" },\n transitionDuration: { default: 150 },\n focusTarget: {},\n width: {}\n },\n emits: [\"shown\", \"hidden\"],\n setup(__props: any, { emit: __emit }) {\n\nconst props = __props;\n\nconst emit = __emit;\n\n\n\nconst { id: _id } = useId();\nconst id = `bbp_${_id.value}`;\n\nconst wrapper = ref<HTMLElement>();\nconst content = ref<HTMLElement>();\nconst bubblearrow = ref<HTMLElement>();\n\nconst { activate, deactivate } = useFocusTrap(content, {\n /**\n * This traps all clicks outside so we are pressing\n * the trigger we just allow and process that in its\n * own click handler.\n * If we are pressing anything random on the page\n * close the popover and be done\n */\n clickOutsideDeactivates: (event) => {\n const target = event.target;\n if (target instanceof HTMLElement) {\n if (wrapper.value?.contains(target)) {\n return true;\n }\n }\n closePopover();\n emit(\"hidden\");\n return true;\n },\n escapeDeactivates: () => {\n nextTick(async () => {\n await closePopover();\n focusTrigger();\n emit(\"hidden\");\n });\n return true;\n },\n /* We don't return focus so that when\n * we press a button on tyhe page we can focus\n * THAT button and not the current trigger\n */\n returnFocusOnDeactivate: false,\n});\n\nconst { floatingStyles, placement, middlewareData } = useFloating(\n wrapper,\n content,\n {\n placement: props.placement,\n whileElementsMounted: autoUpdate,\n middleware: [\n flip(),\n offset(props.offset),\n shift({ padding: props.padding }),\n arrow({\n element: bubblearrow,\n padding: props.arrowPadding,\n }),\n ],\n }\n);\n\nconst attributes = computed(() => {\n const classes = {\n \"bb-popover--block\": props.block,\n [`bb-popover--theme-${props.theme}`]: props.theme,\n };\n return {\n class: classes,\n };\n});\n\nconst opening = ref(false);\nconst open = ref(false);\nconst closing = ref(false);\nconst closed = ref(true);\n\nconst arrowAttributes = computed(() => {\n if (middlewareData.value.arrow) {\n const { x, y } = middlewareData.value.arrow;\n return {\n style: {\n left: `${x}px`,\n top: `${y}px`,\n },\n };\n }\n});\n\nconst containerStyle = computed(() => {\n const base: Record<string, any> = {\n ...floatingStyles.value,\n transitionDuration: `${props.transitionDuration}ms`,\n };\n if (props.width) {\n let width: string;\n // If the width is a css unit string use it, if it is a number or number string add px\n if (typeof props.width === \"string\" && Number.isNaN(Number(props.width))) {\n if (props.width.includes(\"%\")) {\n width = `${\n wrapper.value!.clientWidth * (+props.width.replace(\"%\", \"\") / 100)\n }px`;\n } else {\n width = props.width;\n }\n } else {\n width = `${props.width}px`;\n }\n base.width = width;\n }\n return base;\n});\n\nconst openPopover = async () => {\n closed.value = false;\n closing.value = false;\n opening.value = true;\n await wait(50);\n open.value = true;\n opening.value = false;\n};\n\nconst closePopover = async () => {\n open.value = false;\n opening.value = false;\n closing.value = true;\n await wait(props.transitionDuration);\n closing.value = false;\n closed.value = true;\n};\nconst hasOpenedOnce = ref(false);\nconst onTriggerClick = async () => {\n if (open.value) {\n await closePopover();\n focusTrigger();\n emit(\"hidden\");\n return;\n }\n if (opening.value || props.disabled) return;\n hasOpenedOnce.value = true;\n await openPopover();\n let focusTarget = props.focusTarget ?? \".bb-popover__close\";\n\n activate({\n onPostActivate: () => {\n if (content.value) {\n const target = content.value.querySelector(focusTarget);\n if (target instanceof HTMLElement) {\n target.focus();\n emit(\"shown\");\n }\n }\n },\n });\n};\n\nconst focusTrigger = () => {\n const trigger = wrapper.value?.querySelector(`[aria-controls=popover_${id}]`);\n if (trigger instanceof HTMLElement) {\n trigger.focus();\n }\n};\n\nconst onClickClose = async () => {\n deactivate();\n await closePopover();\n focusTrigger();\n emit(\"hidden\");\n};\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", _mergeProps({ class: \"bb-popover\" }, attributes.value), [\n _createElementVNode(\"span\", {\n class: \"bb-popover__wrapper\",\n ref_key: \"wrapper\",\n ref: wrapper\n }, [\n _renderSlot(_ctx.$slots, \"activator\", _normalizeProps(_guardReactiveProps({\n props: {\n 'aria-controls': `popover_${id}`,\n 'aria-expanded': open.value,\n onClick: onTriggerClick,\n id: id,\n disabled: !!_ctx.disabled,\n },\n closed: closed.value,\n closing: closing.value,\n disabled: !!_ctx.disabled,\n open: open.value,\n opening: opening.value,\n placement: _unref(placement),\n })))\n ], 512),\n (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n _createElementVNode(\"span\", {\n class: _normalizeClass([\"bb-popover__bubble-container\", {\n [`bb-popover__bubble-container--${_unref(placement)}`]: true,\n [`bb-popover__bubble-container--${_ctx.theme}`]: _ctx.theme,\n 'bb-popover__bubble-container--hidden': closed.value,\n 'bb-popover__bubble-container--closing': closing.value,\n 'bb-popover__bubble-container--opening': opening.value,\n 'bb-popover__bubble-container--open': open.value,\n }]),\n ref_key: \"content\",\n ref: content,\n style: _normalizeStyle(containerStyle.value),\n id: `popover_${id}`\n }, [\n (hasOpenedOnce.value || _ctx.eager)\n ? (_openBlock(), _createElementBlock(\"span\", _mergeProps({\n key: 0,\n class: \"bb-popover__arrow\",\n ref_key: \"bubblearrow\",\n ref: bubblearrow\n }, arrowAttributes.value), null, 16))\n : _createCommentVNode(\"\", true),\n (hasOpenedOnce.value || _ctx.eager)\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_2, [\n (_ctx.showClose)\n ? (_openBlock(), _createBlock(BaseButton, {\n key: 0,\n class: \"bb-popover__close\",\n onClick: onClickClose\n }, {\n default: _withCtx(() => [\n _hoisted_3,\n _hoisted_4\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n _renderSlot(_ctx.$slots, \"default\", {\n close: onClickClose,\n closed: closed.value,\n closing: closing.value,\n disabled: !!_ctx.disabled,\n open: open.value,\n opening: opening.value,\n placement: _unref(placement)\n })\n ]))\n : _createCommentVNode(\"\", true)\n ], 14, _hoisted_1)\n ]))\n ], 16))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_sfc_main","_defineComponent","__props","__emit","props","emit","_id","useId","id","wrapper","ref","content","bubblearrow","activate","deactivate","useFocusTrap","event","target","_a","closePopover","nextTick","focusTrigger","floatingStyles","placement","middlewareData","useFloating","autoUpdate","flip","offset","shift","arrow","attributes","computed","opening","open","closing","closed","arrowAttributes","x","y","containerStyle","base","width","openPopover","wait","hasOpenedOnce","onTriggerClick","focusTarget","trigger","onClickClose","_ctx","_cache","_openBlock","_createElementBlock","_mergeProps","_createElementVNode","_renderSlot","_normalizeProps","_guardReactiveProps","_unref","_createBlock","_Teleport","_normalizeClass","_normalizeStyle","_createCommentVNode","BaseButton","_withCtx"],"mappings":";;;;;;;;;AAGA,MAAMA,KAAa,CAAC,IAAI,GAClBC,KAAa;AAAA,EACjB,KAAK;AAAA,EACL,OAAO;AACT,GACMC,uBAA8C,QAAQ,EAAE,OAAO,6BAA6B,UAAU,EAAE,GACxGC,uBAA8C,OAAO;AAAA,EACzD,SAAS;AAAA,EACT,MAAM;AAAA,EACN,OAAO;AACT,GAAG;AAAA,oBACgC,QAAQ;AAAA,IACvC,GAAG;AAAA,IACH,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,EAAA,CACnB;AACH,GAAG,EAAE,GAgDuBC,KAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,cAAc,EAAE,SAAS,GAAG;AAAA,IAC5B,OAAO,EAAE,MAAM,QAAQ;AAAA,IACvB,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,OAAO,EAAE,MAAM,QAAQ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ACDE,KAAcQ,EAAaK,GAAY;AAAA,cACtC,KAAK;AAAA,cACL,OAAO;AAAA,cACP,SAAShB;AAAA,YAAA,GACR;AAAA,cACD,SAASiB,EAAS,MAAM;AAAA,gBACtBpE;AAAA,gBACAC;AAAA,cAAA,CACD;AAAA,cACD,GAAG;AAAA,YAAA,CACJ,KACDiE,EAAoB,IAAI,EAAI;AAAA,YAChCR,EAAYN,EAAK,QAAQ,WAAW;AAAA,cAClC,OAAOD;AAAA,cACP,QAAQb,EAAO;AAAA,cACf,SAASD,EAAQ;AAAA,cACjB,UAAU,CAAC,CAACe,EAAK;AAAA,cACjB,MAAMhB,EAAK;AAAA,cACX,SAASD,EAAQ;AAAA,cACjB,WAAW0B,EAAOpC,CAAS;AAAA,YAAA,CAC5B;AAAA,UAAA,CACF,KACDyC,EAAoB,IAAI,EAAI;AAAA,QAAA,GAC/B,IAAIpE,EAAU;AAAA,MAAA,CAClB;AAAA,OACA,EAAE;AAAA,EAEP;AAEA,CAAC;"}
|
package/dist/index99.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { useRoute as
|
|
4
|
-
import { useRouter as
|
|
5
|
-
import { wait as
|
|
6
|
-
import
|
|
1
|
+
import { defineComponent as D, getCurrentInstance as z, ref as K, computed as v, watch as R, openBlock as u, createElementBlock as d, normalizeClass as h, unref as H, createElementVNode as p, Fragment as g, renderList as B, createVNode as J, withCtx as O, renderSlot as _, toDisplayString as j, createCommentVNode as G } from "vue";
|
|
2
|
+
import { useId as M } from "./index7.js";
|
|
3
|
+
import { useRoute as Q } from "./index129.js";
|
|
4
|
+
import { useRouter as W } from "./index130.js";
|
|
5
|
+
import { wait as X } from "./index122.js";
|
|
6
|
+
import Y from "./index9.js";
|
|
7
7
|
import "./index10.js";
|
|
8
|
-
const
|
|
8
|
+
const Z = ["id"], ee = {
|
|
9
9
|
role: "tablist",
|
|
10
10
|
class: "bb-tab__label-container"
|
|
11
|
-
},
|
|
11
|
+
}, ae = { class: "bb-tab__label" }, le = { class: "bb-tab__panes-container" }, te = ["id", "aria-labelledby"], ce = /* @__PURE__ */ D({
|
|
12
12
|
__name: "BbTab",
|
|
13
13
|
props: {
|
|
14
14
|
disabled: { type: Boolean },
|
|
@@ -21,17 +21,17 @@ const Y = ["id"], Z = {
|
|
|
21
21
|
querykey: { default: "tab" }
|
|
22
22
|
},
|
|
23
23
|
emits: ["update:modelValue"],
|
|
24
|
-
setup(
|
|
25
|
-
var
|
|
26
|
-
const l =
|
|
24
|
+
setup(F, { expose: N, emit: A }) {
|
|
25
|
+
var $, T, x, S, I, L, V;
|
|
26
|
+
const l = F, P = A, o = Q(), m = W(), w = l.id ?? M().id.value, y = `bb-tab_${w}`, q = !!((T = ($ = z()) == null ? void 0 : $.proxy) != null && T.$inertia), t = K(null), i = v(
|
|
27
27
|
() => l.items.findIndex((e) => e.key === t.value)
|
|
28
|
-
), b =
|
|
28
|
+
), b = v(() => i.value === 0), f = v(() => i.value === l.items.length - 1);
|
|
29
29
|
if (l.items.forEach((e) => {
|
|
30
30
|
if (!e.key)
|
|
31
31
|
throw console.error("A tab item has no key", e), new Error("A tab item has no key " + JSON.stringify(e));
|
|
32
|
-
}), l.navigation && ((
|
|
33
|
-
t.value = (L = (I =
|
|
34
|
-
else if (l.navigation &&
|
|
32
|
+
}), l.navigation && ((S = (x = o.value) == null ? void 0 : x.query) != null && S[l.querykey]))
|
|
33
|
+
t.value = (L = (I = o.value) == null ? void 0 : I.query) == null ? void 0 : L[l.querykey];
|
|
34
|
+
else if (l.navigation && q && ((V = globalThis == null ? void 0 : globalThis.location) != null && V.href) && new URL(globalThis.location.href).searchParams.get(l.querykey))
|
|
35
35
|
t.value = new URL(globalThis.location.href).searchParams.get(
|
|
36
36
|
l.querykey
|
|
37
37
|
);
|
|
@@ -46,22 +46,23 @@ const Y = ["id"], Z = {
|
|
|
46
46
|
const s = e.key;
|
|
47
47
|
t.value = s;
|
|
48
48
|
}
|
|
49
|
-
const c = async (e) => {
|
|
50
|
-
var
|
|
51
|
-
if (l.navigation &&
|
|
49
|
+
const c = async (e, s = !1) => {
|
|
50
|
+
var a, n, C, E;
|
|
51
|
+
if (l.navigation && o.value && ((n = (a = o.value) == null ? void 0 : a.query) == null ? void 0 : n[l.querykey]) !== e)
|
|
52
52
|
m == null || m.push({
|
|
53
|
-
...
|
|
54
|
-
query: { ...(
|
|
53
|
+
...o,
|
|
54
|
+
query: { ...(C = o.value) == null ? void 0 : C.query, [l.querykey]: e },
|
|
55
|
+
replace: s
|
|
55
56
|
});
|
|
56
|
-
else if (l.navigation &&
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
history.pushState({}, "",
|
|
57
|
+
else if (l.navigation && q && ((E = globalThis == null ? void 0 : globalThis.location) != null && E.href) && new URL(globalThis.location.href).searchParams.get(l.querykey) !== e) {
|
|
58
|
+
const k = new URL(globalThis.location.href);
|
|
59
|
+
k.searchParams.set(l.querykey, e), X(0).then(() => {
|
|
60
|
+
s ? history.replaceState({}, "", k.toString()) : history.pushState({}, "", k.toString());
|
|
60
61
|
});
|
|
61
62
|
}
|
|
62
|
-
l.modelValue !== e &&
|
|
63
|
+
l.modelValue !== e && P("update:modelValue", e), t.value = e;
|
|
63
64
|
};
|
|
64
|
-
t.value && c(t.value);
|
|
65
|
+
t.value && c(t.value, !0);
|
|
65
66
|
const r = (e) => {
|
|
66
67
|
var s = null;
|
|
67
68
|
switch (e) {
|
|
@@ -82,11 +83,11 @@ const Y = ["id"], Z = {
|
|
|
82
83
|
throw new Error("Could not navigate to next tab");
|
|
83
84
|
if (l.items[s].disabled)
|
|
84
85
|
return;
|
|
85
|
-
const a = l.items[s].key,
|
|
86
|
+
const a = l.items[s].key, n = document.querySelector(
|
|
86
87
|
`#${y}_tab_${a}`
|
|
87
88
|
);
|
|
88
|
-
|
|
89
|
-
},
|
|
89
|
+
n == null || n.focus(), c(a);
|
|
90
|
+
}, U = (e) => {
|
|
90
91
|
if (!l.disabled)
|
|
91
92
|
if (e.key === "ArrowRight")
|
|
92
93
|
r("next");
|
|
@@ -99,49 +100,49 @@ const Y = ["id"], Z = {
|
|
|
99
100
|
else
|
|
100
101
|
return;
|
|
101
102
|
};
|
|
102
|
-
return
|
|
103
|
+
return R(
|
|
103
104
|
() => l.modelValue,
|
|
104
105
|
(e) => {
|
|
105
106
|
e && c(e);
|
|
106
107
|
}
|
|
107
|
-
),
|
|
108
|
+
), R(
|
|
108
109
|
() => {
|
|
109
110
|
var e, s;
|
|
110
|
-
return (s = (e =
|
|
111
|
+
return (s = (e = o.value) == null ? void 0 : e.query) == null ? void 0 : s[l.querykey];
|
|
111
112
|
},
|
|
112
113
|
(e) => {
|
|
113
114
|
e && typeof e == "string" && c(e);
|
|
114
115
|
}
|
|
115
|
-
),
|
|
116
|
+
), N({
|
|
116
117
|
isFirst: b,
|
|
117
118
|
isLast: f,
|
|
118
119
|
current: t,
|
|
119
120
|
currentIndex: i,
|
|
120
121
|
goTo: r
|
|
121
122
|
}), (e, s) => (u(), d("div", {
|
|
122
|
-
class:
|
|
123
|
+
class: h(["bb-tab", {
|
|
123
124
|
[`bb-tab--${e.direction}`]: !0,
|
|
124
125
|
"bb-tab--disabled": !0
|
|
125
126
|
}]),
|
|
126
|
-
id:
|
|
127
|
+
id: H(w)
|
|
127
128
|
}, [
|
|
128
|
-
|
|
129
|
-
(u(!0), d(
|
|
129
|
+
p("ul", ee, [
|
|
130
|
+
(u(!0), d(g, null, B(e.items, (a) => (u(), d("li", {
|
|
130
131
|
role: "presentation",
|
|
131
132
|
key: a.key
|
|
132
133
|
}, [
|
|
133
|
-
|
|
134
|
-
class:
|
|
134
|
+
J(Y, {
|
|
135
|
+
class: h(["bb-tab__btn", { "bb-tab__btn--active": t.value === a.key }]),
|
|
135
136
|
"aria-selected": t.value === a.key,
|
|
136
137
|
disabled: a.disabled || e.disabled,
|
|
137
138
|
id: `${y}_tab_${a.key}`,
|
|
138
139
|
role: "tab",
|
|
139
140
|
tabindex: t.value === a.key ? 0 : -1,
|
|
140
|
-
onClick: (
|
|
141
|
-
onKeydown:
|
|
141
|
+
onClick: (n) => c(a.key),
|
|
142
|
+
onKeydown: U
|
|
142
143
|
}, {
|
|
143
|
-
default:
|
|
144
|
-
|
|
144
|
+
default: O(() => [
|
|
145
|
+
_(e.$slots, `label-${a.key}`, {
|
|
145
146
|
current: t.value,
|
|
146
147
|
currentIndex: i.value,
|
|
147
148
|
disabled: !!(a.disabled || e.disabled),
|
|
@@ -152,7 +153,7 @@ const Y = ["id"], Z = {
|
|
|
152
153
|
value: a.key,
|
|
153
154
|
goTo: r
|
|
154
155
|
}, () => [
|
|
155
|
-
|
|
156
|
+
_(e.$slots, "label", {
|
|
156
157
|
current: t.value,
|
|
157
158
|
currentIndex: i.value,
|
|
158
159
|
disabled: !!(a.disabled || e.disabled),
|
|
@@ -163,7 +164,7 @@ const Y = ["id"], Z = {
|
|
|
163
164
|
value: a.key,
|
|
164
165
|
goTo: r
|
|
165
166
|
}, () => [
|
|
166
|
-
|
|
167
|
+
p("span", ae, j(a.label), 1)
|
|
167
168
|
])
|
|
168
169
|
])
|
|
169
170
|
]),
|
|
@@ -171,13 +172,13 @@ const Y = ["id"], Z = {
|
|
|
171
172
|
}, 1032, ["aria-selected", "class", "disabled", "id", "tabindex", "onClick"])
|
|
172
173
|
]))), 128))
|
|
173
174
|
]),
|
|
174
|
-
|
|
175
|
-
(u(!0), d(
|
|
175
|
+
p("div", le, [
|
|
176
|
+
(u(!0), d(g, null, B(e.items, (a) => (u(), d(g, {
|
|
176
177
|
key: a.key
|
|
177
178
|
}, [
|
|
178
179
|
t.value === a.key || e.eager || a.eager ? (u(), d("section", {
|
|
179
180
|
key: 0,
|
|
180
|
-
class:
|
|
181
|
+
class: h(["bb-tab__pane", {
|
|
181
182
|
"bb-tab__pane--shown": t.value === a.key
|
|
182
183
|
}]),
|
|
183
184
|
role: "tabpanel",
|
|
@@ -185,7 +186,7 @@ const Y = ["id"], Z = {
|
|
|
185
186
|
"aria-labelledby": `${y}_tab_${a.key}`,
|
|
186
187
|
tabindex: "0"
|
|
187
188
|
}, [
|
|
188
|
-
|
|
189
|
+
_(e.$slots, a.key, {
|
|
189
190
|
current: t.value,
|
|
190
191
|
currentIndex: i.value,
|
|
191
192
|
disabled: !!(a.disabled || e.disabled),
|
|
@@ -196,13 +197,13 @@ const Y = ["id"], Z = {
|
|
|
196
197
|
value: a.key,
|
|
197
198
|
goTo: r
|
|
198
199
|
})
|
|
199
|
-
], 10,
|
|
200
|
+
], 10, te)) : G("", !0)
|
|
200
201
|
], 64))), 128))
|
|
201
202
|
])
|
|
202
|
-
], 10,
|
|
203
|
+
], 10, Z));
|
|
203
204
|
}
|
|
204
205
|
});
|
|
205
206
|
export {
|
|
206
|
-
|
|
207
|
+
ce as default
|
|
207
208
|
};
|
|
208
209
|
//# sourceMappingURL=index99.js.map
|