bitboss-ui 1.0.38 → 1.0.40
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/BbTable/BbTable.vue.d.ts +11 -9
- package/dist/components/BbTable/types.d.ts +11 -9
- package/dist/index.d.ts +5 -1
- package/dist/index101.js +130 -122
- package/dist/index101.js.map +1 -1
- package/dist/index103.js +100 -96
- package/dist/index103.js.map +1 -1
- package/dist/index111.js +1 -1
- package/dist/index113.js +4 -4
- package/dist/index115.js +1 -1
- package/dist/index119.js +1 -1
- package/dist/index12.js +3 -3
- package/dist/index120.js +1 -1
- package/dist/index121.js +1 -1
- package/dist/index127.js +1 -1
- package/dist/index128.js +1 -1
- package/dist/index129.js +1 -1
- package/dist/index133.js +2 -2
- package/dist/index16.js +8 -8
- package/dist/index18.js +11 -11
- package/dist/index199.js +2 -79
- package/dist/index199.js.map +1 -1
- package/dist/index20.js +4 -4
- package/dist/index200.js +4 -5
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +2 -16
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +235 -16
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +3 -19
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +35 -20
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +6 -29
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +7 -8
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +3 -2
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +3 -2
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +79 -4
- package/dist/index209.js.map +1 -1
- package/dist/index210.js +5 -2
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +16 -3
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +16 -3
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +18 -9
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +20 -235
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +29 -2
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +8 -3
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +2 -35
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +121 -6
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +134 -7
- package/dist/index219.js.map +1 -1
- package/dist/index22.js +2 -2
- package/dist/index221.js +166 -113
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +7 -134
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +353 -159
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +372 -6
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +2 -368
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +2 -373
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +10 -2
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +6 -9
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +17 -23
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +79 -6
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +8 -16
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +23 -79
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +69 -4
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +2 -295
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +5 -6
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +4 -2
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +224 -2
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +258 -2
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +435 -2
- package/dist/index239.js.map +1 -1
- package/dist/index240.js +89 -2
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +200 -2
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +2 -224
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +294 -257
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +6 -2
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +2 -69
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +2 -5
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +2 -15
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +2 -435
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +2 -89
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +2 -200
- package/dist/index250.js.map +1 -1
- package/dist/index254.js +15 -2
- package/dist/index254.js.map +1 -1
- package/dist/index258.js +1 -1
- package/dist/index26.js +2 -2
- package/dist/index30.js +2 -2
- package/dist/index32.js +8 -8
- package/dist/index34.js +2 -2
- package/dist/index36.js +2 -2
- package/dist/index38.js +10 -10
- package/dist/index38.js.map +1 -1
- package/dist/index40.js +1 -1
- package/dist/index50.js +1 -1
- package/dist/index52.js +1 -1
- package/dist/index56.js +1 -1
- package/dist/index68.js +5 -5
- package/dist/index72.js +2 -2
- package/dist/index74.js +1 -1
- package/dist/index77.js +2 -2
- package/dist/index79.js +1 -1
- package/dist/index81.js +4 -4
- package/dist/style.css +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BbTableProps, MappedCell,
|
|
1
|
+
import type { BbTableProps, MappedCell, BbTableColumn } from './types';
|
|
2
2
|
import type { Classes } from '../../types/Classes';
|
|
3
3
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<BbTableProps>, {
|
|
4
4
|
align: string;
|
|
@@ -14,7 +14,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
14
14
|
matchStrategy: string;
|
|
15
15
|
multiple: boolean;
|
|
16
16
|
noDataText: string;
|
|
17
|
-
|
|
17
|
+
selectAllLabel: string;
|
|
18
18
|
selectText: string;
|
|
19
19
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
20
|
"click:row": (event: MouseEvent, item: any, selected: boolean) => void;
|
|
@@ -36,7 +36,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
36
36
|
matchStrategy: string;
|
|
37
37
|
multiple: boolean;
|
|
38
38
|
noDataText: string;
|
|
39
|
-
|
|
39
|
+
selectAllLabel: string;
|
|
40
40
|
selectText: string;
|
|
41
41
|
}>>> & {
|
|
42
42
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
@@ -56,22 +56,23 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
56
56
|
accessibleLabel: (columns: MappedCell[], item: any) => string;
|
|
57
57
|
actionsText: string;
|
|
58
58
|
allowSelectAll: boolean;
|
|
59
|
-
columns:
|
|
59
|
+
columns: BbTableColumn[];
|
|
60
60
|
fixedColumns: (number | {
|
|
61
61
|
index: number;
|
|
62
62
|
position: "left" | "right";
|
|
63
63
|
})[];
|
|
64
|
-
|
|
64
|
+
selectAllLabel: string;
|
|
65
65
|
selectText: string;
|
|
66
66
|
}, {}>, Readonly<{
|
|
67
67
|
thead?: ((props: object) => any) | undefined;
|
|
68
68
|
tbody?: ((props: object) => any) | undefined;
|
|
69
69
|
tfoot?: ((props: object) => any) | undefined;
|
|
70
|
-
|
|
70
|
+
'header:select'?: ((props: {
|
|
71
71
|
multiple: boolean;
|
|
72
72
|
selectAll: boolean;
|
|
73
|
+
text: string;
|
|
73
74
|
}) => any) | undefined;
|
|
74
|
-
|
|
75
|
+
'header:actions'?: ((props: {
|
|
75
76
|
text: string;
|
|
76
77
|
}) => any) | undefined;
|
|
77
78
|
loading?: ((props: {
|
|
@@ -103,11 +104,12 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
103
104
|
thead?: ((props: object) => any) | undefined;
|
|
104
105
|
tbody?: ((props: object) => any) | undefined;
|
|
105
106
|
tfoot?: ((props: object) => any) | undefined;
|
|
106
|
-
|
|
107
|
+
'header:select'?: ((props: {
|
|
107
108
|
multiple: boolean;
|
|
108
109
|
selectAll: boolean;
|
|
110
|
+
text: string;
|
|
109
111
|
}) => any) | undefined;
|
|
110
|
-
|
|
112
|
+
'header:actions'?: ((props: {
|
|
111
113
|
text: string;
|
|
112
114
|
}) => any) | undefined;
|
|
113
115
|
loading?: ((props: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Classes } from '../../types/Classes';
|
|
2
2
|
import type { InputHTMLAttributes } from 'vue';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Type used to infer the bahaviour of a single column. You can either extract data or provide elements useful for styling.
|
|
5
5
|
*/
|
|
6
|
-
export type
|
|
6
|
+
export type BbTableColumn = {
|
|
7
7
|
/**
|
|
8
8
|
* Text alignment of the column.
|
|
9
9
|
*/
|
|
@@ -71,8 +71,9 @@ export type BbTableProps = {
|
|
|
71
71
|
caption?: string;
|
|
72
72
|
/**
|
|
73
73
|
* Array of definitions of how the columns should be rendered.
|
|
74
|
+
*
|
|
74
75
|
*/
|
|
75
|
-
columns:
|
|
76
|
+
columns: BbTableColumn[];
|
|
76
77
|
/**
|
|
77
78
|
* Adds a CSS class that applies a compact style to the component.
|
|
78
79
|
*/
|
|
@@ -109,9 +110,9 @@ export type BbTableProps = {
|
|
|
109
110
|
position: 'left' | 'right';
|
|
110
111
|
})[];
|
|
111
112
|
/**
|
|
112
|
-
* Boolean that sets the headers as sticky
|
|
113
|
+
* Boolean that sets the headers as sticky to the top of the table.
|
|
113
114
|
*/
|
|
114
|
-
|
|
115
|
+
fixedHeaders?: boolean;
|
|
115
116
|
items: any[] | ((prefill: boolean, modelValue?: any[]) => Promise<any[]>) | ((prefill: boolean, modelValue?: any[]) => any[]);
|
|
116
117
|
itemValue?: string | ((item: any) => any);
|
|
117
118
|
/**
|
|
@@ -155,7 +156,7 @@ export type BbTableProps = {
|
|
|
155
156
|
/**
|
|
156
157
|
* Defines whether the table is selectable.
|
|
157
158
|
* Can be a global boolean that affects all rows or a function
|
|
158
|
-
* that accepts an
|
|
159
|
+
* that accepts an item and returns a boolean that only affects that item.
|
|
159
160
|
*/
|
|
160
161
|
selectable?: boolean | ((item: any) => boolean);
|
|
161
162
|
/**
|
|
@@ -165,7 +166,7 @@ export type BbTableProps = {
|
|
|
165
166
|
/**
|
|
166
167
|
* Text of the label used by the "Select all" boolean.
|
|
167
168
|
*/
|
|
168
|
-
|
|
169
|
+
selectAllLabel?: string;
|
|
169
170
|
/**
|
|
170
171
|
* Text of the header used for the radio inputs when the table is not `multiple`.
|
|
171
172
|
*/
|
|
@@ -236,11 +237,12 @@ export type BbTableSlots = {
|
|
|
236
237
|
thead?: (props: object) => any;
|
|
237
238
|
tbody?: (props: object) => any;
|
|
238
239
|
tfoot?: (props: object) => any;
|
|
239
|
-
|
|
240
|
+
'header:select'?: (props: {
|
|
240
241
|
multiple: boolean;
|
|
241
242
|
selectAll: boolean;
|
|
243
|
+
text: string;
|
|
242
244
|
}) => any;
|
|
243
|
-
|
|
245
|
+
'header:actions'?: (props: {
|
|
244
246
|
text: string;
|
|
245
247
|
}) => any;
|
|
246
248
|
loading?: (props: {
|
package/dist/index.d.ts
CHANGED
|
@@ -115,7 +115,11 @@ export type { BbSmoothHeightProps, BbSmoothHeightSlots, } from './components/BbS
|
|
|
115
115
|
export type { BbSpinnerProps, Size as BbSpinnerSizes, } from './components/BbSpinner/BbSpinner.vue';
|
|
116
116
|
export type { BbSwitchGroupEvents, BbSwitchGroupProps, } from './components/BbSwitchGroup/BbSwitchGroup.vue';
|
|
117
117
|
export type { BbSwitchProps, BbSwitchEvents, } from './components/BbSwitch/BbSwitch.vue';
|
|
118
|
-
export type { BbTableProps,
|
|
118
|
+
export type { BbTableProps,
|
|
119
|
+
/**
|
|
120
|
+
* @deprecated
|
|
121
|
+
*/
|
|
122
|
+
BbTableColumn as TableColumn, BbTableColumn, BbTableEvents, BbTableSlots, } from './components/BbTable/types';
|
|
119
123
|
export type { BbTabProps, BbTabEvents, BbTabItem, } from './components/BbTab/BbTab.vue';
|
|
120
124
|
export type { BbTagProps, BbTagEvents } from './components/BbTag/BbTag.vue';
|
|
121
125
|
export type { BbTextareaProps, BbTextareaEvents, } from './components/BbTextarea/BbTextarea.vue';
|
package/dist/index101.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as M, ref as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { useRoute as
|
|
1
|
+
import { defineComponent as M, ref as w, computed as k, getCurrentInstance as Q, watch as $, nextTick as W, openBlock as d, createElementBlock as c, unref as X, normalizeClass as q, createElementVNode as b, renderSlot as f, normalizeProps as U, guardReactiveProps as z, Fragment as S, renderList as D, createVNode as Y, withCtx as Z, toDisplayString as ee, createCommentVNode as le } from "vue";
|
|
2
|
+
import { useId as te } from "./index8.js";
|
|
3
|
+
import { useRoute as ae } from "./index131.js";
|
|
4
4
|
import { useRouter as se } from "./index132.js";
|
|
5
|
-
import { wait as
|
|
6
|
-
import { useScroll as
|
|
5
|
+
import { wait as ie } from "./index124.js";
|
|
6
|
+
import { useScroll as re } from "./index133.js";
|
|
7
7
|
import oe from "./index10.js";
|
|
8
8
|
import "./index11.js";
|
|
9
9
|
const ne = ["id"], ue = { class: "bb-tab__label-boundary" }, de = { class: "bb-tab__label" }, ce = { class: "bb-tab__panes-container" }, be = ["id", "aria-labelledby"], _e = /* @__PURE__ */ M({
|
|
@@ -20,106 +20,114 @@ const ne = ["id"], ue = { class: "bb-tab__label-boundary" }, de = { class: "bb-t
|
|
|
20
20
|
},
|
|
21
21
|
emits: ["update:modelValue"],
|
|
22
22
|
setup(K, { expose: H, emit: J }) {
|
|
23
|
-
var
|
|
24
|
-
const l = K, O = J,
|
|
23
|
+
var C, R, E, B, P, F, N;
|
|
24
|
+
const l = K, O = J, n = ae(), p = se(), g = w(), T = l.id ?? te().id.value, m = `bb-tab_${T}`, I = w(), { isScrolling: j, arrivedState: V } = re(I), x = k(() => ({
|
|
25
25
|
isScrolling: j.value,
|
|
26
|
-
left:
|
|
27
|
-
right:
|
|
28
|
-
})),
|
|
29
|
-
() => l.items.findIndex((e) => e.key ===
|
|
30
|
-
),
|
|
26
|
+
left: V.left,
|
|
27
|
+
right: V.right
|
|
28
|
+
})), L = !!((R = (C = Q()) == null ? void 0 : C.proxy) != null && R.$inertia), s = w(null), r = k(
|
|
29
|
+
() => l.items.findIndex((e) => e.key === s.value)
|
|
30
|
+
), h = k(() => r.value === 0), v = k(() => r.value === l.items.length - 1);
|
|
31
31
|
if (l.items.forEach((e) => {
|
|
32
32
|
if (!e.key)
|
|
33
33
|
throw console.error("A tab item has no key", e), new Error("A tab item has no key " + JSON.stringify(e));
|
|
34
|
-
}), l.navigation && ((
|
|
35
|
-
|
|
36
|
-
else if (l.navigation &&
|
|
37
|
-
|
|
34
|
+
}), l.navigation && ((B = (E = n.value) == null ? void 0 : E.query) != null && B[l.querykey]))
|
|
35
|
+
s.value = (F = (P = n.value) == null ? void 0 : P.query) == null ? void 0 : F[l.querykey];
|
|
36
|
+
else if (l.navigation && L && ((N = globalThis == null ? void 0 : globalThis.location) != null && N.href) && new URL(globalThis.location.href).searchParams.get(l.querykey))
|
|
37
|
+
s.value = new URL(globalThis.location.href).searchParams.get(
|
|
38
38
|
l.querykey
|
|
39
39
|
);
|
|
40
40
|
else if (l.modelValue)
|
|
41
|
-
|
|
41
|
+
s.value = l.modelValue;
|
|
42
42
|
else if (l.items[0]) {
|
|
43
|
-
const e = l.items.find((
|
|
43
|
+
const e = l.items.find((t) => !t.disabled);
|
|
44
44
|
if (!e)
|
|
45
45
|
throw new Error(
|
|
46
46
|
"No tab has been selected so it defaulted to the first available. Still, all the tabs are disabled so no tab can be selected."
|
|
47
47
|
);
|
|
48
|
-
const
|
|
49
|
-
|
|
48
|
+
const a = e.key;
|
|
49
|
+
s.value = a;
|
|
50
50
|
}
|
|
51
|
-
const
|
|
52
|
-
var
|
|
53
|
-
if (l.navigation &&
|
|
54
|
-
|
|
55
|
-
...
|
|
56
|
-
query: { ...(
|
|
57
|
-
replace:
|
|
51
|
+
const y = async (e, a = !1) => {
|
|
52
|
+
var t, u, i, A;
|
|
53
|
+
if (l.navigation && n.value && ((u = (t = n.value) == null ? void 0 : t.query) == null ? void 0 : u[l.querykey]) !== e)
|
|
54
|
+
p == null || p.push({
|
|
55
|
+
...n,
|
|
56
|
+
query: { ...(i = n.value) == null ? void 0 : i.query, [l.querykey]: e },
|
|
57
|
+
replace: a
|
|
58
58
|
});
|
|
59
|
-
else if (l.navigation &&
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
else if (l.navigation && L && ((A = globalThis == null ? void 0 : globalThis.location) != null && A.href) && new URL(globalThis.location.href).searchParams.get(l.querykey) !== e) {
|
|
60
|
+
const _ = new URL(globalThis.location.href);
|
|
61
|
+
_.searchParams.set(l.querykey, e), ie(0).then(() => {
|
|
62
|
+
a ? history.replaceState({}, "", _.toString()) : history.pushState({}, "", _.toString());
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
l.modelValue !== e && O("update:modelValue", e),
|
|
65
|
+
l.modelValue !== e && O("update:modelValue", e), s.value = e;
|
|
66
66
|
};
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
var
|
|
67
|
+
s.value && y(s.value, !0);
|
|
68
|
+
const o = (e) => {
|
|
69
|
+
var a = null;
|
|
70
70
|
switch (e) {
|
|
71
71
|
case "first":
|
|
72
|
-
|
|
72
|
+
for (a = 0; a < l.items.length - 1 && l.items[a].disabled; )
|
|
73
|
+
a++;
|
|
73
74
|
break;
|
|
74
|
-
case "previous":
|
|
75
|
-
|
|
75
|
+
case "previous": {
|
|
76
|
+
let i = 1;
|
|
77
|
+
for (; i < l.items.length && (a = (r.value + l.items.length - i) % l.items.length, l.items[a].disabled); )
|
|
78
|
+
i++;
|
|
76
79
|
break;
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
}
|
|
81
|
+
case "next": {
|
|
82
|
+
let i = 1;
|
|
83
|
+
for (; i < l.items.length && (a = (r.value + i) % l.items.length, l.items[a].disabled); )
|
|
84
|
+
i++;
|
|
79
85
|
break;
|
|
86
|
+
}
|
|
80
87
|
case "last":
|
|
81
|
-
|
|
88
|
+
for (a = l.items.length - 1; a >= 0 && l.items[a].disabled; )
|
|
89
|
+
a--;
|
|
82
90
|
break;
|
|
83
91
|
}
|
|
84
|
-
if (
|
|
92
|
+
if (a === null)
|
|
85
93
|
throw new Error("Could not navigate to next tab");
|
|
86
|
-
if (l.items[
|
|
94
|
+
if (l.items[a].disabled)
|
|
87
95
|
return;
|
|
88
|
-
const
|
|
89
|
-
`#${
|
|
96
|
+
const t = l.items[a].key, u = document.querySelector(
|
|
97
|
+
`#${m}_tab_${t}`
|
|
90
98
|
);
|
|
91
|
-
|
|
99
|
+
u == null || u.focus(), y(t);
|
|
92
100
|
}, G = (e) => {
|
|
93
101
|
if (!l.disabled)
|
|
94
102
|
if (e.key === "ArrowRight")
|
|
95
|
-
|
|
103
|
+
o("next");
|
|
96
104
|
else if (e.key === "ArrowLeft")
|
|
97
|
-
|
|
105
|
+
o("previous");
|
|
98
106
|
else if (e.key === "Home")
|
|
99
|
-
e.preventDefault(),
|
|
107
|
+
e.preventDefault(), o("first");
|
|
100
108
|
else if (e.key === "End")
|
|
101
|
-
e.preventDefault(),
|
|
109
|
+
e.preventDefault(), o("last");
|
|
102
110
|
else
|
|
103
111
|
return;
|
|
104
112
|
};
|
|
105
|
-
return
|
|
113
|
+
return $(
|
|
106
114
|
() => l.modelValue,
|
|
107
115
|
(e) => {
|
|
108
|
-
e &&
|
|
116
|
+
e && y(e);
|
|
109
117
|
}
|
|
110
|
-
),
|
|
118
|
+
), $(
|
|
111
119
|
() => {
|
|
112
|
-
var e,
|
|
113
|
-
return (
|
|
120
|
+
var e, a;
|
|
121
|
+
return (a = (e = n.value) == null ? void 0 : e.query) == null ? void 0 : a[l.querykey];
|
|
114
122
|
},
|
|
115
123
|
(e) => {
|
|
116
|
-
e && typeof e == "string" &&
|
|
124
|
+
e && typeof e == "string" && y(e);
|
|
117
125
|
}
|
|
118
|
-
),
|
|
119
|
-
|
|
126
|
+
), $(
|
|
127
|
+
s,
|
|
120
128
|
async () => {
|
|
121
|
-
if (
|
|
122
|
-
const e =
|
|
129
|
+
if (g.value) {
|
|
130
|
+
const e = g.value.querySelector(
|
|
123
131
|
"[role=tablist] .bb-tab__btn--active"
|
|
124
132
|
);
|
|
125
133
|
e && (await W(), e.scrollIntoView({
|
|
@@ -131,68 +139,68 @@ const ne = ["id"], ue = { class: "bb-tab__label-boundary" }, de = { class: "bb-t
|
|
|
131
139
|
},
|
|
132
140
|
{ flush: "post" }
|
|
133
141
|
), H({
|
|
134
|
-
isFirst:
|
|
135
|
-
isLast:
|
|
136
|
-
current:
|
|
142
|
+
isFirst: h,
|
|
143
|
+
isLast: v,
|
|
144
|
+
current: s,
|
|
137
145
|
currentIndex: r,
|
|
138
|
-
goTo:
|
|
139
|
-
}), (e,
|
|
140
|
-
id: X(
|
|
146
|
+
goTo: o
|
|
147
|
+
}), (e, a) => (d(), c("div", {
|
|
148
|
+
id: X(T),
|
|
141
149
|
ref_key: "tabs",
|
|
142
|
-
ref:
|
|
143
|
-
class:
|
|
150
|
+
ref: g,
|
|
151
|
+
class: q(["bb-tab", {
|
|
144
152
|
[`bb-tab--${e.direction}`]: !0,
|
|
145
153
|
"bb-tab--disabled": !0
|
|
146
154
|
}])
|
|
147
155
|
}, [
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
156
|
+
b("div", ue, [
|
|
157
|
+
b("span", null, [
|
|
158
|
+
f(e.$slots, "header:prepend", U(z(x.value)))
|
|
151
159
|
]),
|
|
152
|
-
|
|
153
|
-
class: "bb-tab__label-container",
|
|
154
|
-
role: "tablist",
|
|
160
|
+
b("ul", {
|
|
155
161
|
ref_key: "tablist",
|
|
156
|
-
ref:
|
|
162
|
+
ref: I,
|
|
163
|
+
class: "bb-tab__label-container",
|
|
164
|
+
role: "tablist"
|
|
157
165
|
}, [
|
|
158
|
-
(
|
|
159
|
-
key:
|
|
166
|
+
(d(!0), c(S, null, D(e.items, (t) => (d(), c("li", {
|
|
167
|
+
key: t.key,
|
|
160
168
|
role: "presentation"
|
|
161
169
|
}, [
|
|
162
170
|
Y(oe, {
|
|
163
|
-
id: `${
|
|
164
|
-
"aria-selected":
|
|
165
|
-
class:
|
|
166
|
-
disabled:
|
|
171
|
+
id: `${m}_tab_${t.key}`,
|
|
172
|
+
"aria-selected": s.value === t.key,
|
|
173
|
+
class: q(["bb-tab__btn", { "bb-tab__btn--active": s.value === t.key }]),
|
|
174
|
+
disabled: t.disabled || e.disabled,
|
|
167
175
|
role: "tab",
|
|
168
|
-
tabindex:
|
|
169
|
-
onClick: (
|
|
176
|
+
tabindex: s.value === t.key ? 0 : -1,
|
|
177
|
+
onClick: (u) => y(t.key),
|
|
170
178
|
onKeydown: G
|
|
171
179
|
}, {
|
|
172
180
|
default: Z(() => [
|
|
173
|
-
|
|
174
|
-
current:
|
|
181
|
+
f(e.$slots, `label-${t.key}`, {
|
|
182
|
+
current: s.value,
|
|
175
183
|
currentIndex: r.value,
|
|
176
|
-
disabled: !!(
|
|
177
|
-
goTo:
|
|
178
|
-
isFirst:
|
|
179
|
-
isLast:
|
|
180
|
-
selected:
|
|
181
|
-
text:
|
|
182
|
-
value:
|
|
184
|
+
disabled: !!(t.disabled || e.disabled),
|
|
185
|
+
goTo: o,
|
|
186
|
+
isFirst: h.value,
|
|
187
|
+
isLast: v.value,
|
|
188
|
+
selected: s.value === t.key,
|
|
189
|
+
text: t.label,
|
|
190
|
+
value: t.key
|
|
183
191
|
}, () => [
|
|
184
|
-
|
|
185
|
-
current:
|
|
192
|
+
f(e.$slots, "label", {
|
|
193
|
+
current: s.value,
|
|
186
194
|
currentIndex: r.value,
|
|
187
|
-
disabled: !!(
|
|
188
|
-
goTo:
|
|
189
|
-
isFirst:
|
|
190
|
-
isLast:
|
|
191
|
-
selected:
|
|
192
|
-
text:
|
|
193
|
-
value:
|
|
195
|
+
disabled: !!(t.disabled || e.disabled),
|
|
196
|
+
goTo: o,
|
|
197
|
+
isFirst: h.value,
|
|
198
|
+
isLast: v.value,
|
|
199
|
+
selected: s.value === t.key,
|
|
200
|
+
text: t.label,
|
|
201
|
+
value: t.key
|
|
194
202
|
}, () => [
|
|
195
|
-
|
|
203
|
+
b("span", de, ee(t.label), 1)
|
|
196
204
|
])
|
|
197
205
|
])
|
|
198
206
|
]),
|
|
@@ -200,36 +208,36 @@ const ne = ["id"], ue = { class: "bb-tab__label-boundary" }, de = { class: "bb-t
|
|
|
200
208
|
}, 1032, ["id", "aria-selected", "class", "disabled", "tabindex", "onClick"])
|
|
201
209
|
]))), 128))
|
|
202
210
|
], 512),
|
|
203
|
-
|
|
204
|
-
|
|
211
|
+
b("span", null, [
|
|
212
|
+
f(e.$slots, "header:append", U(z(x.value)))
|
|
205
213
|
])
|
|
206
214
|
]),
|
|
207
|
-
|
|
208
|
-
(
|
|
209
|
-
key:
|
|
215
|
+
b("div", ce, [
|
|
216
|
+
(d(!0), c(S, null, D(e.items, (t) => (d(), c(S, {
|
|
217
|
+
key: t.key
|
|
210
218
|
}, [
|
|
211
|
-
|
|
219
|
+
s.value === t.key || e.eager || t.eager ? (d(), c("section", {
|
|
212
220
|
key: 0,
|
|
213
|
-
id: `${
|
|
214
|
-
"aria-labelledby": `${
|
|
215
|
-
class:
|
|
216
|
-
"bb-tab__pane--shown":
|
|
221
|
+
id: `${m}_tabpanel_${t.key}`,
|
|
222
|
+
"aria-labelledby": `${m}_tab_${t.key}`,
|
|
223
|
+
class: q(["bb-tab__pane", {
|
|
224
|
+
"bb-tab__pane--shown": s.value === t.key
|
|
217
225
|
}]),
|
|
218
226
|
role: "tabpanel",
|
|
219
227
|
tabindex: "0"
|
|
220
228
|
}, [
|
|
221
|
-
|
|
222
|
-
current:
|
|
229
|
+
f(e.$slots, t.key, {
|
|
230
|
+
current: s.value,
|
|
223
231
|
currentIndex: r.value,
|
|
224
|
-
disabled: !!(
|
|
225
|
-
goTo:
|
|
226
|
-
isFirst:
|
|
227
|
-
isLast:
|
|
228
|
-
selected:
|
|
229
|
-
text:
|
|
230
|
-
value:
|
|
232
|
+
disabled: !!(t.disabled || e.disabled),
|
|
233
|
+
goTo: o,
|
|
234
|
+
isFirst: h.value,
|
|
235
|
+
isLast: v.value,
|
|
236
|
+
selected: s.value === t.key,
|
|
237
|
+
text: t.label,
|
|
238
|
+
value: t.key
|
|
231
239
|
})
|
|
232
|
-
], 10, be)) :
|
|
240
|
+
], 10, be)) : le("", !0)
|
|
233
241
|
], 64))), 128))
|
|
234
242
|
])
|
|
235
243
|
], 10, ne));
|
package/dist/index101.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index101.js","sources":["../src/components/BbTab/BbTab.vue"],"sourcesContent":["<template>\n\t<div\n\t\t:id=\"id\"\n\t\tref=\"tabs\"\n\t\tclass=\"bb-tab\"\n\t\t:class=\"{\n\t\t\t[`bb-tab--${direction}`]: true,\n\t\t\t'bb-tab--disabled': true,\n\t\t}\"\n\t>\n\t\t<div class=\"bb-tab__label-boundary\">\n\t\t\t<span><slot name=\"header:prepend\" v-bind=\"scrollStatus\"></slot></span>\n\t\t\t<ul class=\"bb-tab__label-container\" role=\"tablist\" ref=\"tablist\">\n\t\t\t\t<li v-for=\"tab in items\" :key=\"tab.key\" role=\"presentation\">\n\t\t\t\t\t<BaseButton\n\t\t\t\t\t\t:id=\"`${instanceid}_tab_${tab.key}`\"\n\t\t\t\t\t\t:aria-selected=\"selectedTab === tab.key\"\n\t\t\t\t\t\tclass=\"bb-tab__btn\"\n\t\t\t\t\t\t:class=\"{ 'bb-tab__btn--active': selectedTab === tab.key }\"\n\t\t\t\t\t\t:disabled=\"tab.disabled || disabled\"\n\t\t\t\t\t\t:role=\"'tab'\"\n\t\t\t\t\t\t:tabindex=\"selectedTab === tab.key ? 0 : -1\"\n\t\t\t\t\t\t@click=\"onTabSelected(tab.key)\"\n\t\t\t\t\t\t@keydown=\"onKeydown\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t:current=\"selectedTab\"\n\t\t\t\t\t\t\t:current-index=\"currentTabIndex\"\n\t\t\t\t\t\t\t:disabled=\"!!(tab.disabled || disabled)\"\n\t\t\t\t\t\t\t:go-to=\"goTo\"\n\t\t\t\t\t\t\t:is-first=\"isFirst\"\n\t\t\t\t\t\t\t:is-last=\"isLast\"\n\t\t\t\t\t\t\t:name=\"`label-${tab.key}`\"\n\t\t\t\t\t\t\t:selected=\"selectedTab === tab.key\"\n\t\t\t\t\t\t\t:text=\"tab.label\"\n\t\t\t\t\t\t\t:value=\"tab.key\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:current=\"selectedTab\"\n\t\t\t\t\t\t\t\t:current-index=\"currentTabIndex\"\n\t\t\t\t\t\t\t\t:disabled=\"!!(tab.disabled || disabled)\"\n\t\t\t\t\t\t\t\t:go-to=\"goTo\"\n\t\t\t\t\t\t\t\t:is-first=\"isFirst\"\n\t\t\t\t\t\t\t\t:is-last=\"isLast\"\n\t\t\t\t\t\t\t\tname=\"label\"\n\t\t\t\t\t\t\t\t:selected=\"selectedTab === tab.key\"\n\t\t\t\t\t\t\t\t:text=\"tab.label\"\n\t\t\t\t\t\t\t\t:value=\"tab.key\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<span class=\"bb-tab__label\">{{ tab.label }}</span>\n\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t</slot>\n\t\t\t\t\t</BaseButton>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t\t<span><slot name=\"header:append\" v-bind=\"scrollStatus\"></slot></span>\n\t\t</div>\n\t\t<div class=\"bb-tab__panes-container\">\n\t\t\t<template v-for=\"tab in items\" :key=\"tab.key\">\n\t\t\t\t<section\n\t\t\t\t\tv-if=\"selectedTab === tab.key || eager || tab.eager\"\n\t\t\t\t\t:id=\"`${instanceid}_tabpanel_${tab.key}`\"\n\t\t\t\t\t:aria-labelledby=\"`${instanceid}_tab_${tab.key}`\"\n\t\t\t\t\tclass=\"bb-tab__pane\"\n\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t'bb-tab__pane--shown': selectedTab === tab.key,\n\t\t\t\t\t}\"\n\t\t\t\t\trole=\"tabpanel\"\n\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t>\n\t\t\t\t\t<slot\n\t\t\t\t\t\t:current=\"selectedTab\"\n\t\t\t\t\t\t:current-index=\"currentTabIndex\"\n\t\t\t\t\t\t:disabled=\"!!(tab.disabled || disabled)\"\n\t\t\t\t\t\t:go-to=\"goTo\"\n\t\t\t\t\t\t:is-first=\"isFirst\"\n\t\t\t\t\t\t:is-last=\"isLast\"\n\t\t\t\t\t\t:name=\"tab.key\"\n\t\t\t\t\t\t:selected=\"selectedTab === tab.key\"\n\t\t\t\t\t\t:text=\"tab.label\"\n\t\t\t\t\t\t:value=\"tab.key\"\n\t\t\t\t\t></slot>\n\t\t\t\t</section>\n\t\t\t</template>\n\t\t</div>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, getCurrentInstance, computed, nextTick } from 'vue';\nimport { useId } from '@/composables/useId';\nimport { useRoute } from '@/composables/useRoute';\nimport { useRouter } from '@/composables/useRouter';\nimport { wait } from '@/utilities/functions/wait';\nimport { useScroll } from '@vueuse/core';\nimport BaseButton from '../BaseButton/BaseButton.vue';\nimport type { CommonProps } from '@/types/CommonProps';\n\nexport type BbTabItem = Pick<CommonProps, 'disabled'> & {\n\t/**\n\t * Used to render a tab even when not visible.\n\t * It's useful if you want the content of a tab in the DOM\n\t * immediately rendered\n\t * even when not visible for SEO purposes.\n\t */\n\teager?: boolean;\n\t/**\n\t * String that identifies the tab.\n\t */\n\tkey: string;\n\t/**\n\t * Label to use as the tab text.\n\t */\n\tlabel?: string;\n};\n\nexport type BbTabProps = Pick<CommonProps, 'disabled' | 'eager' | 'id'> & {\n\t/**\n\t * Direction of the tabs component\n\t */\n\tdirection?: 'horizontal' | 'vertical';\n\t/**\n\t * Array of items that define the tabs in the component.\n\t */\n\titems: BbTabItem[];\n\t/**\n\t * The current tab. Used by v-model.\n\t */\n\tmodelValue?: null | BbTabItem['key'];\n\t/**\n\t * Synchronizes the current tab with the url.\n\t */\n\tnavigation?: boolean;\n\t/**\n\t * Defines the query key to reference for maintaining navigation\n\t */\n\tquerykey?: string;\n};\n\nconst props = withDefaults(defineProps<BbTabProps>(), {\n\tdirection: 'horizontal',\n\tquerykey: 'tab',\n});\n\nexport type BbTabEvents = {\n\t(e: 'update:modelValue', value: (typeof props.items)[number]['key']): void;\n};\nconst emit = defineEmits<BbTabEvents>();\n\ntype BbStepSlots = {\n\t'header:prepend'?: (props: {\n\t\tisScrolling: boolean;\n\t\tleft: boolean;\n\t\tright: boolean;\n\t}) => any;\n\t'header:append'?: (props: {\n\t\tisScrolling: boolean;\n\t\tleft: boolean;\n\t\tright: boolean;\n\t}) => any;\n\tlabel?: (props: {\n\t\tcurrent: string | null;\n\t\tcurrentIndex: number;\n\t\tdisabled: boolean;\n\t\tisFirst: boolean;\n\t\tisLast: boolean;\n\t\tselected: boolean;\n\t\ttext: BbTabItem['label'];\n\t\tvalue: string;\n\t\tgoTo: typeof goTo;\n\t}) => any;\n} & {\n\t[key: string]: (props: {\n\t\tcurrent: string | null;\n\t\tcurrentIndex: number;\n\t\tdisabled: boolean;\n\t\tisFirst: boolean;\n\t\tisLast: boolean;\n\t\tselected: boolean;\n\t\ttext: BbTabItem['label'];\n\t\tvalue: string;\n\t\tgoTo: typeof goTo;\n\t}) => any;\n};\n\ndefineSlots<BbStepSlots>();\n\nconst route = useRoute();\nconst router = useRouter();\n\nconst tabs = ref();\n\nconst id = props.id ?? useId().id.value;\nconst instanceid = `bb-tab_${id}`;\n\nconst tablist = ref();\nconst { isScrolling, arrivedState } = useScroll(tablist);\nconst scrollStatus = computed(() => ({\n\tisScrolling: isScrolling.value,\n\tleft: arrivedState.left,\n\tright: arrivedState.right,\n}));\n\n/* Ignore because possibly undefined */\n// @ts-expect-error possibly undef\nconst isInertia = !!getCurrentInstance()?.proxy?.$inertia;\n\nconst selectedTab = ref<BbTabItem['key'] | null>(null);\n\nconst currentTabIndex = computed(() =>\n\tprops.items.findIndex((el) => el.key === selectedTab.value)\n);\nconst isFirst = computed(() => currentTabIndex.value === 0);\nconst isLast = computed(() => currentTabIndex.value === props.items.length - 1);\n\nprops.items.forEach((item) => {\n\tif (!item.key) {\n\t\tconsole.error(`A tab item has no key`, item);\n\t\tthrow new Error('A tab item has no key ' + JSON.stringify(item));\n\t}\n});\n\n/* \nThis section retrieves the current tab that should be selected\n*/\n// Retrieve tab from url on load for vue apps\nif (props.navigation && route.value?.query?.[props.querykey]) {\n\tselectedTab.value = route.value?.query?.[props.querykey] as string;\n\t// Retrieve tab from url on load for inertia app\n} else if (\n\tprops.navigation &&\n\tisInertia &&\n\tglobalThis?.location?.href &&\n\tnew URL(globalThis.location.href).searchParams.get(props.querykey)\n) {\n\tselectedTab.value = new URL(globalThis.location.href).searchParams.get(\n\t\tprops.querykey\n\t) as string;\n\t// Else whatever tab is passed first\n} else if (props.modelValue) {\n\tselectedTab.value = props.modelValue;\n\t// Else whatever tab is passed first\n} else if (props.items[0]) {\n\tconst firstSelectableTab = props.items.find((item) => !item.disabled);\n\tif (!firstSelectableTab) {\n\t\tthrow new Error(\n\t\t\t'No tab has been selected so it defaulted to the first available. Still, all the tabs are disabled so no tab can be selected.'\n\t\t);\n\t}\n\tconst key = firstSelectableTab.key;\n\tselectedTab.value = key;\n}\n/* \nOnce the current tab is found update external variables\n*/\n\nconst onTabSelected = async (tab: BbTabItem['key'], replace = false) => {\n\t/* For Vue or Nuxt context */\n\tif (\n\t\tprops.navigation &&\n\t\troute.value &&\n\t\troute.value?.query?.[props.querykey] !== tab\n\t) {\n\t\trouter?.push({\n\t\t\t...route,\n\t\t\tquery: { ...route.value?.query, [props.querykey]: tab },\n\t\t\treplace,\n\t\t});\n\t\t/* Inertia context */\n\t} else if (\n\t\tprops.navigation &&\n\t\tisInertia &&\n\t\tglobalThis?.location?.href &&\n\t\tnew URL(globalThis.location.href).searchParams.get(props.querykey) !== tab\n\t) {\n\t\tconst url = new URL(globalThis.location.href);\n\t\turl.searchParams.set(props.querykey, tab);\n\t\twait(0).then(() => {\n\t\t\tif (replace) {\n\t\t\t\thistory.replaceState({}, '', url.toString());\n\t\t\t} else {\n\t\t\t\thistory.pushState({}, '', url.toString());\n\t\t\t}\n\t\t});\n\t}\n\tif (props.modelValue !== tab) {\n\t\temit('update:modelValue', tab);\n\t}\n\tselectedTab.value = tab;\n};\n\nif (selectedTab.value) {\n\tonTabSelected(selectedTab.value, true);\n}\n\nconst goTo = (target: 'first' | 'previous' | 'next' | 'last') => {\n\tvar nextTabIndex: number | null = null;\n\tswitch (target) {\n\t\tcase 'first':\n\t\t\tnextTabIndex = 0;\n\t\t\tbreak;\n\t\tcase 'previous':\n\t\t\tnextTabIndex =\n\t\t\t\t(currentTabIndex.value + props.items.length - 1) % props.items.length;\n\t\t\tbreak;\n\t\tcase 'next':\n\t\t\tnextTabIndex = (currentTabIndex.value + 1) % props.items.length;\n\t\t\tbreak;\n\t\tcase 'last':\n\t\t\tnextTabIndex = props.items.length - 1;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\tif (nextTabIndex === null) {\n\t\tthrow new Error('Could not navigate to next tab');\n\t}\n\tif (props.items[nextTabIndex].disabled) return;\n\tconst targetKey = props.items[nextTabIndex].key;\n\tconst button: HTMLButtonElement | null = document.querySelector(\n\t\t`#${instanceid}_tab_${targetKey}`\n\t);\n\tbutton?.focus();\n\tonTabSelected(targetKey);\n};\n\nconst onKeydown = (event: KeyboardEvent) => {\n\tif (props.disabled) return;\n\tif (event.key === 'ArrowRight') {\n\t\tgoTo('next');\n\t} else if (event.key === 'ArrowLeft') {\n\t\tgoTo('previous');\n\t} else if (event.key === 'Home') {\n\t\tevent.preventDefault();\n\t\tgoTo('first');\n\t} else if (event.key === 'End') {\n\t\tevent.preventDefault();\n\t\tgoTo('last');\n\t} else {\n\t\treturn;\n\t}\n};\n\nwatch(\n\t() => props.modelValue,\n\t(value) => {\n\t\tif (value) {\n\t\t\tonTabSelected(value);\n\t\t}\n\t}\n);\n\nwatch(\n\t() => route.value?.query?.[props.querykey],\n\t(value) => {\n\t\tif (value && typeof value === 'string') {\n\t\t\tonTabSelected(value);\n\t\t}\n\t}\n);\n\nwatch(\n\tselectedTab,\n\tasync () => {\n\t\tif (tabs.value) {\n\t\t\tconst element = tabs.value.querySelector(\n\t\t\t\t`[role=tablist] .bb-tab__btn--active`\n\t\t\t);\n\t\t\tif (element) {\n\t\t\t\tawait nextTick();\n\t\t\t\telement.scrollIntoView({\n\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\tinline: 'nearest',\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t},\n\t{ flush: 'post' }\n);\n\ndefineExpose({\n\tisFirst,\n\tisLast,\n\tcurrent: selectedTab,\n\tcurrentIndex: currentTabIndex,\n\tgoTo,\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbTab';\n</style>\n"],"names":["props","__props","emit","__emit","route","useRoute","router","useRouter","tabs","ref","id","useId","instanceid","tablist","isScrolling","arrivedState","useScroll","scrollStatus","computed","isInertia","_b","_a","getCurrentInstance","selectedTab","currentTabIndex","el","isFirst","isLast","item","_d","_c","_f","_e","_g","firstSelectableTab","key","onTabSelected","tab","replace","url","wait","goTo","target","nextTabIndex","targetKey","button","onKeydown","event","watch","value","element","nextTick","__expose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA2IA,UAAMA,IAAQC,GAQRC,IAAOC,GAwCPC,IAAQC,MACRC,IAASC,MAETC,IAAOC,KAEPC,IAAKV,EAAM,MAAMW,KAAQ,GAAG,OAC5BC,IAAa,UAAUF,CAAE,IAEzBG,IAAUJ,KACV,EAAE,aAAAK,GAAa,cAAAC,EAAa,IAAIC,GAAUH,CAAO,GACjDI,IAAeC,EAAS,OAA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AU1C,EAAK,MAAM;AAAA,YAC1B;AAAA,UAAA;AAED,UAAI0C,MACH,MAAMC,EAAS,GACfD,EAAQ,eAAe;AAAA,YACtB,UAAU;AAAA,YACV,OAAO;AAAA,YACP,QAAQ;AAAA,UAAA,CACR;AAAA,QAEH;AAAA,MACD;AAAA,MACA,EAAE,OAAO,OAAO;AAAA,IAAA,GAGJE,EAAA;AAAA,MACZ,SAAA1B;AAAA,MACA,QAAAC;AAAA,MACA,SAASJ;AAAA,MACT,cAAcC;AAAA,MACd,MAAAiB;AAAA,IAAA,CACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index101.js","sources":["../src/components/BbTab/BbTab.vue"],"sourcesContent":["<template>\n\t<div\n\t\t:id=\"id\"\n\t\tref=\"tabs\"\n\t\tclass=\"bb-tab\"\n\t\t:class=\"{\n\t\t\t[`bb-tab--${direction}`]: true,\n\t\t\t'bb-tab--disabled': true,\n\t\t}\"\n\t>\n\t\t<div class=\"bb-tab__label-boundary\">\n\t\t\t<span><slot name=\"header:prepend\" v-bind=\"scrollStatus\"></slot></span>\n\t\t\t<ul ref=\"tablist\" class=\"bb-tab__label-container\" role=\"tablist\">\n\t\t\t\t<li v-for=\"tab in items\" :key=\"tab.key\" role=\"presentation\">\n\t\t\t\t\t<BaseButton\n\t\t\t\t\t\t:id=\"`${instanceid}_tab_${tab.key}`\"\n\t\t\t\t\t\t:aria-selected=\"selectedTab === tab.key\"\n\t\t\t\t\t\tclass=\"bb-tab__btn\"\n\t\t\t\t\t\t:class=\"{ 'bb-tab__btn--active': selectedTab === tab.key }\"\n\t\t\t\t\t\t:disabled=\"tab.disabled || disabled\"\n\t\t\t\t\t\t:role=\"'tab'\"\n\t\t\t\t\t\t:tabindex=\"selectedTab === tab.key ? 0 : -1\"\n\t\t\t\t\t\t@click=\"onTabSelected(tab.key)\"\n\t\t\t\t\t\t@keydown=\"onKeydown\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t:current=\"selectedTab\"\n\t\t\t\t\t\t\t:current-index=\"currentTabIndex\"\n\t\t\t\t\t\t\t:disabled=\"!!(tab.disabled || disabled)\"\n\t\t\t\t\t\t\t:go-to=\"goTo\"\n\t\t\t\t\t\t\t:is-first=\"isFirst\"\n\t\t\t\t\t\t\t:is-last=\"isLast\"\n\t\t\t\t\t\t\t:name=\"`label-${tab.key}`\"\n\t\t\t\t\t\t\t:selected=\"selectedTab === tab.key\"\n\t\t\t\t\t\t\t:text=\"tab.label\"\n\t\t\t\t\t\t\t:value=\"tab.key\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:current=\"selectedTab\"\n\t\t\t\t\t\t\t\t:current-index=\"currentTabIndex\"\n\t\t\t\t\t\t\t\t:disabled=\"!!(tab.disabled || disabled)\"\n\t\t\t\t\t\t\t\t:go-to=\"goTo\"\n\t\t\t\t\t\t\t\t:is-first=\"isFirst\"\n\t\t\t\t\t\t\t\t:is-last=\"isLast\"\n\t\t\t\t\t\t\t\tname=\"label\"\n\t\t\t\t\t\t\t\t:selected=\"selectedTab === tab.key\"\n\t\t\t\t\t\t\t\t:text=\"tab.label\"\n\t\t\t\t\t\t\t\t:value=\"tab.key\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<span class=\"bb-tab__label\">{{ tab.label }}</span>\n\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t</slot>\n\t\t\t\t\t</BaseButton>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t\t<span><slot name=\"header:append\" v-bind=\"scrollStatus\"></slot></span>\n\t\t</div>\n\t\t<div class=\"bb-tab__panes-container\">\n\t\t\t<template v-for=\"tab in items\" :key=\"tab.key\">\n\t\t\t\t<section\n\t\t\t\t\tv-if=\"selectedTab === tab.key || eager || tab.eager\"\n\t\t\t\t\t:id=\"`${instanceid}_tabpanel_${tab.key}`\"\n\t\t\t\t\t:aria-labelledby=\"`${instanceid}_tab_${tab.key}`\"\n\t\t\t\t\tclass=\"bb-tab__pane\"\n\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t'bb-tab__pane--shown': selectedTab === tab.key,\n\t\t\t\t\t}\"\n\t\t\t\t\trole=\"tabpanel\"\n\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t>\n\t\t\t\t\t<slot\n\t\t\t\t\t\t:current=\"selectedTab\"\n\t\t\t\t\t\t:current-index=\"currentTabIndex\"\n\t\t\t\t\t\t:disabled=\"!!(tab.disabled || disabled)\"\n\t\t\t\t\t\t:go-to=\"goTo\"\n\t\t\t\t\t\t:is-first=\"isFirst\"\n\t\t\t\t\t\t:is-last=\"isLast\"\n\t\t\t\t\t\t:name=\"tab.key\"\n\t\t\t\t\t\t:selected=\"selectedTab === tab.key\"\n\t\t\t\t\t\t:text=\"tab.label\"\n\t\t\t\t\t\t:value=\"tab.key\"\n\t\t\t\t\t></slot>\n\t\t\t\t</section>\n\t\t\t</template>\n\t\t</div>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, getCurrentInstance, computed, nextTick } from 'vue';\nimport { useId } from '@/composables/useId';\nimport { useRoute } from '@/composables/useRoute';\nimport { useRouter } from '@/composables/useRouter';\nimport { wait } from '@/utilities/functions/wait';\nimport { useScroll } from '@vueuse/core';\nimport BaseButton from '../BaseButton/BaseButton.vue';\nimport type { CommonProps } from '@/types/CommonProps';\n\nexport type BbTabItem = Pick<CommonProps, 'disabled'> & {\n\t/**\n\t * Used to render a tab even when not visible.\n\t * It's useful if you want the content of a tab in the DOM\n\t * immediately rendered\n\t * even when not visible for SEO purposes.\n\t */\n\teager?: boolean;\n\t/**\n\t * String that identifies the tab.\n\t */\n\tkey: string;\n\t/**\n\t * Label to use as the tab text.\n\t */\n\tlabel?: string;\n};\n\nexport type BbTabProps = Pick<CommonProps, 'disabled' | 'eager' | 'id'> & {\n\t/**\n\t * Direction of the tabs component\n\t */\n\tdirection?: 'horizontal' | 'vertical';\n\t/**\n\t * Array of items that define the tabs in the component.\n\t */\n\titems: BbTabItem[];\n\t/**\n\t * The current tab. Used by v-model.\n\t */\n\tmodelValue?: null | BbTabItem['key'];\n\t/**\n\t * Synchronizes the current tab with the url.\n\t */\n\tnavigation?: boolean;\n\t/**\n\t * Defines the query key to reference for maintaining navigation\n\t */\n\tquerykey?: string;\n};\n\nconst props = withDefaults(defineProps<BbTabProps>(), {\n\tdirection: 'horizontal',\n\tquerykey: 'tab',\n});\n\nexport type BbTabEvents = {\n\t(e: 'update:modelValue', value: (typeof props.items)[number]['key']): void;\n};\nconst emit = defineEmits<BbTabEvents>();\n\ntype BbStepSlots = {\n\t'header:prepend'?: (props: {\n\t\tisScrolling: boolean;\n\t\tleft: boolean;\n\t\tright: boolean;\n\t}) => any;\n\t'header:append'?: (props: {\n\t\tisScrolling: boolean;\n\t\tleft: boolean;\n\t\tright: boolean;\n\t}) => any;\n\tlabel?: (props: {\n\t\tcurrent: string | null;\n\t\tcurrentIndex: number;\n\t\tdisabled: boolean;\n\t\tisFirst: boolean;\n\t\tisLast: boolean;\n\t\tselected: boolean;\n\t\ttext: BbTabItem['label'];\n\t\tvalue: string;\n\t\tgoTo: typeof goTo;\n\t}) => any;\n} & {\n\t[key: string]: (props: {\n\t\tcurrent: string | null;\n\t\tcurrentIndex: number;\n\t\tdisabled: boolean;\n\t\tisFirst: boolean;\n\t\tisLast: boolean;\n\t\tselected: boolean;\n\t\ttext: BbTabItem['label'];\n\t\tvalue: string;\n\t\tgoTo: typeof goTo;\n\t}) => any;\n};\n\ndefineSlots<BbStepSlots>();\n\nconst route = useRoute();\nconst router = useRouter();\n\nconst tabs = ref();\n\nconst id = props.id ?? useId().id.value;\nconst instanceid = `bb-tab_${id}`;\n\nconst tablist = ref();\nconst { isScrolling, arrivedState } = useScroll(tablist);\nconst scrollStatus = computed(() => ({\n\tisScrolling: isScrolling.value,\n\tleft: arrivedState.left,\n\tright: arrivedState.right,\n}));\n\n/* Ignore because possibly undefined */\n// @ts-expect-error possibly undef\nconst isInertia = !!getCurrentInstance()?.proxy?.$inertia;\n\nconst selectedTab = ref<BbTabItem['key'] | null>(null);\n\nconst currentTabIndex = computed(() =>\n\tprops.items.findIndex((el) => el.key === selectedTab.value)\n);\nconst isFirst = computed(() => currentTabIndex.value === 0);\nconst isLast = computed(() => currentTabIndex.value === props.items.length - 1);\n\nprops.items.forEach((item) => {\n\tif (!item.key) {\n\t\tconsole.error(`A tab item has no key`, item);\n\t\tthrow new Error('A tab item has no key ' + JSON.stringify(item));\n\t}\n});\n\n/* \nThis section retrieves the current tab that should be selected\n*/\n// Retrieve tab from url on load for vue apps\nif (props.navigation && route.value?.query?.[props.querykey]) {\n\tselectedTab.value = route.value?.query?.[props.querykey] as string;\n\t// Retrieve tab from url on load for inertia app\n} else if (\n\tprops.navigation &&\n\tisInertia &&\n\tglobalThis?.location?.href &&\n\tnew URL(globalThis.location.href).searchParams.get(props.querykey)\n) {\n\tselectedTab.value = new URL(globalThis.location.href).searchParams.get(\n\t\tprops.querykey\n\t) as string;\n\t// Else whatever tab is passed first\n} else if (props.modelValue) {\n\tselectedTab.value = props.modelValue;\n\t// Else whatever tab is passed first\n} else if (props.items[0]) {\n\tconst firstSelectableTab = props.items.find((item) => !item.disabled);\n\tif (!firstSelectableTab) {\n\t\tthrow new Error(\n\t\t\t'No tab has been selected so it defaulted to the first available. Still, all the tabs are disabled so no tab can be selected.'\n\t\t);\n\t}\n\tconst key = firstSelectableTab.key;\n\tselectedTab.value = key;\n}\n/* \nOnce the current tab is found update external variables\n*/\n\nconst onTabSelected = async (tab: BbTabItem['key'], replace = false) => {\n\t/* For Vue or Nuxt context */\n\tif (\n\t\tprops.navigation &&\n\t\troute.value &&\n\t\troute.value?.query?.[props.querykey] !== tab\n\t) {\n\t\trouter?.push({\n\t\t\t...route,\n\t\t\tquery: { ...route.value?.query, [props.querykey]: tab },\n\t\t\treplace,\n\t\t});\n\t\t/* Inertia context */\n\t} else if (\n\t\tprops.navigation &&\n\t\tisInertia &&\n\t\tglobalThis?.location?.href &&\n\t\tnew URL(globalThis.location.href).searchParams.get(props.querykey) !== tab\n\t) {\n\t\tconst url = new URL(globalThis.location.href);\n\t\turl.searchParams.set(props.querykey, tab);\n\t\twait(0).then(() => {\n\t\t\tif (replace) {\n\t\t\t\thistory.replaceState({}, '', url.toString());\n\t\t\t} else {\n\t\t\t\thistory.pushState({}, '', url.toString());\n\t\t\t}\n\t\t});\n\t}\n\tif (props.modelValue !== tab) {\n\t\temit('update:modelValue', tab);\n\t}\n\tselectedTab.value = tab;\n};\n\nif (selectedTab.value) {\n\tonTabSelected(selectedTab.value, true);\n}\n\nconst goTo = (target: 'first' | 'previous' | 'next' | 'last') => {\n\tvar nextTabIndex: number | null = null;\n\tswitch (target) {\n\t\tcase 'first':\n\t\t\tnextTabIndex = 0;\n\t\t\twhile (nextTabIndex < props.items.length - 1) {\n\t\t\t\tif (props.items[nextTabIndex].disabled) {\n\t\t\t\t\tnextTabIndex++;\n\t\t\t\t} else break;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'previous': {\n\t\t\tlet offset = 1;\n\t\t\twhile (offset < props.items.length) {\n\t\t\t\tnextTabIndex =\n\t\t\t\t\t(currentTabIndex.value + props.items.length - offset) %\n\t\t\t\t\tprops.items.length;\n\t\t\t\tif (props.items[nextTabIndex].disabled) {\n\t\t\t\t\toffset++;\n\t\t\t\t} else break;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase 'next': {\n\t\t\tlet offset = 1;\n\t\t\twhile (offset < props.items.length) {\n\t\t\t\tnextTabIndex = (currentTabIndex.value + offset) % props.items.length;\n\t\t\t\tif (props.items[nextTabIndex].disabled) {\n\t\t\t\t\toffset++;\n\t\t\t\t} else break;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase 'last':\n\t\t\tnextTabIndex = props.items.length - 1;\n\t\t\twhile (nextTabIndex >= 0) {\n\t\t\t\tif (props.items[nextTabIndex].disabled) {\n\t\t\t\t\tnextTabIndex--;\n\t\t\t\t} else break;\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\tif (nextTabIndex === null) {\n\t\tthrow new Error('Could not navigate to next tab');\n\t}\n\tif (props.items[nextTabIndex].disabled) return;\n\tconst targetKey = props.items[nextTabIndex].key;\n\tconst button: HTMLButtonElement | null = document.querySelector(\n\t\t`#${instanceid}_tab_${targetKey}`\n\t);\n\tbutton?.focus();\n\tonTabSelected(targetKey);\n};\n\nconst onKeydown = (event: KeyboardEvent) => {\n\tif (props.disabled) return;\n\tif (event.key === 'ArrowRight') {\n\t\tgoTo('next');\n\t} else if (event.key === 'ArrowLeft') {\n\t\tgoTo('previous');\n\t} else if (event.key === 'Home') {\n\t\tevent.preventDefault();\n\t\tgoTo('first');\n\t} else if (event.key === 'End') {\n\t\tevent.preventDefault();\n\t\tgoTo('last');\n\t} else {\n\t\treturn;\n\t}\n};\n\nwatch(\n\t() => props.modelValue,\n\t(value) => {\n\t\tif (value) {\n\t\t\tonTabSelected(value);\n\t\t}\n\t}\n);\n\nwatch(\n\t() => route.value?.query?.[props.querykey],\n\t(value) => {\n\t\tif (value && typeof value === 'string') {\n\t\t\tonTabSelected(value);\n\t\t}\n\t}\n);\n\nwatch(\n\tselectedTab,\n\tasync () => {\n\t\tif (tabs.value) {\n\t\t\tconst element = tabs.value.querySelector(\n\t\t\t\t`[role=tablist] .bb-tab__btn--active`\n\t\t\t);\n\t\t\tif (element) {\n\t\t\t\tawait nextTick();\n\t\t\t\telement.scrollIntoView({\n\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\tinline: 'nearest',\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t},\n\t{ flush: 'post' }\n);\n\ndefineExpose({\n\tisFirst,\n\tisLast,\n\tcurrent: selectedTab,\n\tcurrentIndex: currentTabIndex,\n\tgoTo,\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbTab';\n</style>\n"],"names":["props","__props","emit","__emit","route","useRoute","router","useRouter","tabs","ref","id","useId","instanceid","tablist","isScrolling","arrivedState","useScroll","scrollStatus","computed","isInertia","_b","_a","getCurrentInstance","selectedTab","currentTabIndex","el","isFirst","isLast","item","_d","_c","_f","_e","_g","firstSelectableTab","key","onTabSelected","tab","replace","url","wait","goTo","target","nextTabIndex","offset","targetKey","button","onKeydown","event","watch","value","element","nextTick","__expose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA2IA,UAAMA,IAAQC,GAQRC,IAAOC,GAwCPC,IAAQC,MACRC,IAASC,MAETC,IAAOC,KAEPC,IAAKV,EAAM,MAAMW,KAAQ,GAAG,OAC5BC,IAAa,UAAUF,CAAE,IAEzBG,IAAUJ,KACV,EAAE,aAAAK,GAAa,cAAAC,EAAa,IAAIC,GAAUH,CAAO,GACjDI,IAAeC,EAAS,OAAO;AAAA,MACpC,aAAaJ,EAAY;AAAA,MACzB,MAAMC,EAAa;AAAA,MACnB,OAAOA,EAAa;AAAA,IACnB,EAAA,GAIII,IAAY,CAAC,GAACC,KAAAC,IAAAC,EAAA,MAAA,gBAAAD,EAAsB,UAAtB,QAAAD,EAA6B,WAE3CG,IAAcd,EAA6B,IAAI,GAE/Ce,IAAkBN;AAAA,MAAS,MAChClB,EAAM,MAAM,UAAU,CAACyB,MAAOA,EAAG,QAAQF,EAAY,KAAK;AAAA,IAAA,GAErDG,IAAUR,EAAS,MAAMM,EAAgB,UAAU,CAAC,GACpDG,IAAST,EAAS,MAAMM,EAAgB,UAAUxB,EAAM,MAAM,SAAS,CAAC;AAa9E,QAXMA,EAAA,MAAM,QAAQ,CAAC4B,MAAS;AACzB,UAAA,CAACA,EAAK;AACD,sBAAA,MAAM,yBAAyBA,CAAI,GACrC,IAAI,MAAM,2BAA2B,KAAK,UAAUA,CAAI,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