bitboss-ui 2.1.127 → 2.1.129
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/ai/BbTable.md +875 -6
- package/dist/components/BbTable/types.d.ts +38 -0
- package/dist/composables/useTableWidthContext.d.ts +42 -0
- package/dist/index.css +1 -1
- package/dist/index.js +9 -9
- package/dist/index240.js +1 -1
- package/dist/index270.js +1 -1
- package/dist/index325.js +38 -41
- package/dist/index326.js +40 -447
- package/dist/index327.js +664 -0
- package/dist/index329.js +5 -154
- package/dist/index330.js +155 -0
- package/dist/index332.js +5 -141
- package/dist/index333.js +142 -0
- package/dist/index335.js +5 -154
- package/dist/index336.js +155 -0
- package/dist/index338.js +5 -57
- package/dist/index339.js +57 -4
- package/dist/index340.js +4 -19
- package/dist/index341.js +20 -0
- package/dist/index343.js +5 -141
- package/dist/index344.js +142 -0
- package/dist/index346.js +5 -3
- package/dist/index347.js +3 -108
- package/dist/index348.js +109 -0
- package/dist/index350.js +5 -54
- package/dist/index351.js +54 -23
- package/dist/index352.js +12 -11
- package/dist/index353.js +22 -838
- package/dist/index354.js +811 -446
- package/dist/index355.js +472 -50
- package/dist/index356.js +51 -6
- package/dist/index357.js +7 -0
- package/package.json +2 -2
- package/dist/index328.js +0 -6
- package/dist/index331.js +0 -6
- package/dist/index334.js +0 -6
- package/dist/index337.js +0 -6
- package/dist/index342.js +0 -6
- package/dist/index345.js +0 -6
- package/dist/index349.js +0 -6
package/dist/index270.js
CHANGED
|
@@ -56,7 +56,7 @@ var w = [
|
|
|
56
56
|
let n = A.accept[t];
|
|
57
57
|
if (n.includes("/")) e.push(n);
|
|
58
58
|
else {
|
|
59
|
-
k ||= (await import("./
|
|
59
|
+
k ||= (await import("./index357.js")).default;
|
|
60
60
|
let t = k.getType(n);
|
|
61
61
|
if (!t) throw Error(`Could not detect the correct mime associated with ${n}`);
|
|
62
62
|
e.push(t);
|
package/dist/index325.js
CHANGED
|
@@ -1,43 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
})).sort((e, t) => e.position === t.position ? e.position === "left" ? e.index - t.index : t.index - e.index : e.position === "left" ? -1 : 1).reduce((e, t) => {
|
|
11
|
-
let n = r[t.index];
|
|
12
|
-
if (!n) return i(`BbTable fixedColumns: Cannot affix column at index ${t.index}. Table has ${a} columns (valid indices: 0–${a - 1}).`), e;
|
|
13
|
-
let { width: o } = n.getBoundingClientRect(), s = e.filter((e) => e.position === t.position).reduce((e, t) => e + t.width, 0);
|
|
14
|
-
return e.push({
|
|
15
|
-
index: t.index,
|
|
16
|
-
position: t.position,
|
|
17
|
-
width: Math.floor(o),
|
|
18
|
-
offset: s
|
|
19
|
-
}), e;
|
|
20
|
-
}, []);
|
|
21
|
-
Array.from(t.querySelectorAll(":scope > thead > tr, :scope > tbody > tr")).forEach((e) => {
|
|
22
|
-
o.forEach((t) => {
|
|
23
|
-
let n = e.querySelector(`:scope > :nth-child(${t.index + 1})`);
|
|
24
|
-
n && (n.style.position = "sticky", n.style[t.position] = `${t.offset}px`);
|
|
25
|
-
});
|
|
1
|
+
import { useId as e } from "./index12.js";
|
|
2
|
+
import { computed as t, onBeforeUnmount as n, onMounted as r, reactive as i, ref as a, toValue as o, watch as s, watchEffect as c } from "vue";
|
|
3
|
+
//#region src/composables/useTableWidthContext.ts
|
|
4
|
+
var l = i(/* @__PURE__ */ new Map()), u = "[data-bb-table-id]";
|
|
5
|
+
function d(d) {
|
|
6
|
+
let f = e().id, p = t(() => o(d.id) || f.value), m = a(null), h = i({
|
|
7
|
+
id: p.value,
|
|
8
|
+
parentId: null,
|
|
9
|
+
tracks: {}
|
|
26
10
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
11
|
+
c(() => {
|
|
12
|
+
h.id = p.value, h.parentId = m.value, l.set(p.value, h);
|
|
13
|
+
});
|
|
14
|
+
let g = () => {
|
|
15
|
+
let e = o(d.container), t = o(d.inheritFrom), n = e?.parentElement?.closest(u) ?? null;
|
|
16
|
+
if (t) for (; n && n.dataset.bbTableId !== t;) n = n.parentElement?.closest(u) ?? null;
|
|
17
|
+
m.value = n?.dataset.bbTableId ?? null;
|
|
18
|
+
};
|
|
19
|
+
r(g), s(() => o(d.inheritFrom), g), n(() => l.delete(p.value));
|
|
20
|
+
let _ = t(() => m.value ? l.get(m.value) ?? null : null);
|
|
21
|
+
return {
|
|
22
|
+
id: p,
|
|
23
|
+
parentId: m,
|
|
24
|
+
parentNode: _,
|
|
25
|
+
parentHasTrack: (e) => !!_.value?.tracks[e],
|
|
26
|
+
parentVar: (e, t = "auto") => m.value ? `var(--bb-table-${m.value}-track-${e}, ${t})` : t,
|
|
27
|
+
node: h,
|
|
28
|
+
registry: l,
|
|
29
|
+
setTracks: (e) => {
|
|
30
|
+
h.tracks = e;
|
|
31
|
+
},
|
|
32
|
+
cssVars: t(() => {
|
|
33
|
+
let e = {};
|
|
34
|
+
for (let [t, n] of Object.entries(h.tracks)) e[`--bb-table-${p.value}-track-${t}`] = n;
|
|
35
|
+
return e;
|
|
36
|
+
})
|
|
37
|
+
};
|
|
38
|
+
}
|
|
42
39
|
//#endregion
|
|
43
|
-
export {
|
|
40
|
+
export { d as useTableWidthContext };
|
package/dist/index326.js
CHANGED
|
@@ -1,450 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}, xe = ["aria-sort"], Se = { class: "bb-table-header__content" }, Ce = { class: "bb-table-header__content sr-only" }, we = ["aria-rowindex"], Te = {
|
|
26
|
-
key: 0,
|
|
27
|
-
class: "bb-table-skeleton__cell bb-table-skeleton__cell--select"
|
|
28
|
-
}, Ee = {
|
|
29
|
-
key: 0,
|
|
30
|
-
class: "bb-table-skeleton__cell-content"
|
|
31
|
-
}, De = {
|
|
32
|
-
key: 1,
|
|
33
|
-
class: "bb-table-skeleton__avatar"
|
|
34
|
-
}, Oe = {
|
|
35
|
-
key: 2,
|
|
36
|
-
class: "bb-table-skeleton__avatar-text"
|
|
37
|
-
}, ke = { class: "bb-table-skeleton__cell-content" }, Ae = {
|
|
38
|
-
key: 3,
|
|
39
|
-
class: "bb-table-skeleton__image"
|
|
40
|
-
}, je = {
|
|
41
|
-
key: 4,
|
|
42
|
-
class: "bb-table-skeleton__badge"
|
|
43
|
-
}, Me = {
|
|
44
|
-
key: 1,
|
|
45
|
-
class: "bb-table-skeleton__cell bb-table-skeleton__cell--actions"
|
|
46
|
-
}, Ne = ["aria-rowindex"], Pe = ["colspan"], Fe = { class: "bb-table-loading__text sr-only" }, Ie = ["aria-rowindex"], Le = ["colspan"], Re = { class: "bb-table-no-data__text" }, ze = [
|
|
47
|
-
"aria-rowindex",
|
|
48
|
-
"onClick",
|
|
49
|
-
"onContextmenu",
|
|
50
|
-
"onDblclick"
|
|
51
|
-
], Be = { class: "bb-table-check__label-text sr-only" }, Ve = { class: "bb-table-radio__label-text sr-only" }, He = ["aria-rowindex", "id"], Ue = ["colspan"], O = /* @__PURE__ */ _({
|
|
52
|
-
__name: "BbTable",
|
|
53
|
-
props: /* @__PURE__ */ v({
|
|
54
|
-
accessibleLabel: {},
|
|
55
|
-
actions: { type: Boolean },
|
|
56
|
-
actionsText: { default: "Azioni" },
|
|
57
|
-
align: { default: "left" },
|
|
58
|
-
allowSelectAll: {
|
|
59
|
-
type: Boolean,
|
|
60
|
-
default: !0
|
|
61
|
-
},
|
|
62
|
-
caption: {},
|
|
63
|
-
compact: { type: Boolean },
|
|
64
|
-
dependencies: { default: () => [] },
|
|
65
|
-
depsDebounceTime: { default: 0 },
|
|
66
|
-
disabled: { type: Boolean },
|
|
67
|
-
displayCaption: { type: Boolean },
|
|
68
|
-
fixed: { type: Boolean },
|
|
69
|
-
fixedColumns: { default: () => [] },
|
|
70
|
-
fixedHeaders: { type: Boolean },
|
|
71
|
-
items: {
|
|
72
|
-
type: [Array, Function],
|
|
73
|
-
default: () => []
|
|
74
|
-
},
|
|
75
|
-
itemValue: {},
|
|
76
|
-
legend: {},
|
|
77
|
-
loading: { type: Boolean },
|
|
78
|
-
loadingText: {},
|
|
79
|
-
max: { default: Infinity },
|
|
80
|
-
modelValue: { default: () => [] },
|
|
81
|
-
multiple: {
|
|
82
|
-
type: Boolean,
|
|
83
|
-
default: !0
|
|
84
|
-
},
|
|
85
|
-
name: {},
|
|
86
|
-
noDataText: {},
|
|
87
|
-
page: {},
|
|
88
|
-
perPage: {},
|
|
89
|
-
readonly: { type: Boolean },
|
|
90
|
-
selectAll: { type: Boolean },
|
|
91
|
-
selectable: { type: [Boolean, Function] },
|
|
92
|
-
selectAllLabel: {},
|
|
93
|
-
selectText: {},
|
|
94
|
-
tdClass: {},
|
|
95
|
-
thClass: {},
|
|
96
|
-
totalItems: {},
|
|
97
|
-
unselectedItems: { default: () => [] },
|
|
98
|
-
columns: { default: () => [] }
|
|
99
|
-
}, {
|
|
100
|
-
selectAll: {
|
|
101
|
-
type: Boolean,
|
|
102
|
-
required: !1,
|
|
103
|
-
default: !1
|
|
104
|
-
},
|
|
105
|
-
selectAllModifiers: {},
|
|
106
|
-
expandedItems: {
|
|
107
|
-
required: !1,
|
|
108
|
-
default: () => []
|
|
109
|
-
},
|
|
110
|
-
expandedItemsModifiers: {}
|
|
111
|
-
}),
|
|
112
|
-
emits: /* @__PURE__ */ v([
|
|
113
|
-
"click:row",
|
|
114
|
-
"contextmenu:row",
|
|
115
|
-
"dblclick:row",
|
|
116
|
-
"update:modelValue",
|
|
117
|
-
"update:selectAll",
|
|
118
|
-
"update:expandedItems",
|
|
119
|
-
"update:unselectedItems",
|
|
120
|
-
"item:selected",
|
|
121
|
-
"item:unselected"
|
|
122
|
-
], ["update:selectAll", "update:expandedItems"]),
|
|
123
|
-
setup(_, { emit: v }) {
|
|
124
|
-
let { getItemValue: O } = c(), k = t().id.value, A = _, j = v;
|
|
125
|
-
A.multiple && !Array.isArray(A.modelValue) && n().throw("BbTable is set for multiple selection but modelValue is not an array.");
|
|
126
|
-
let { t: M } = r(), N = fe(), We = (e) => [M("table.select").value, ...e.map((e) => e.content)].join(" "), Ge = d(() => A.selectable ? "fieldset" : "div"), P = d(() => A.loading || qe.value), F = d(() => !l(A.page) && !l(A.perPage) && !l(A.totalItems)), Ke = d(() => ({
|
|
127
|
-
"bb-table": !0,
|
|
128
|
-
[`bb-table--align-${A.align}`]: !0,
|
|
129
|
-
"bb-table--compact": A.compact,
|
|
130
|
-
"bb-table--fixed": A.fixed,
|
|
131
|
-
"bb-table--fixed-header": A.fixedHeaders,
|
|
132
|
-
"bb-table--loading": P.value,
|
|
133
|
-
"bb-table--empty": !V.value.length,
|
|
134
|
-
"bb-table--selectable": !!A.selectable
|
|
135
|
-
})), I = d(() => A.columns.length + Number(!!A.selectable) + Number(!!A.actions)), L = d(() => Object.fromEntries(A.columns.map((e) => [e.key, oe(e.key)]))), { getter: R, items: z, loading: qe } = o({ items: T(A, "items") }), { hasPrefilled: Je } = ne({
|
|
136
|
-
trigger: !0,
|
|
137
|
-
fn: async (e) => {
|
|
138
|
-
await R(e, A.modelValue);
|
|
139
|
-
}
|
|
140
|
-
}), { data: B } = s({ items: T(A, "modelValue") }), { options: V } = ee({
|
|
141
|
-
disabled: T(A, "disabled"),
|
|
142
|
-
items: z,
|
|
143
|
-
itemText: void 0,
|
|
144
|
-
itemValue: A.itemValue,
|
|
145
|
-
max: A.max,
|
|
146
|
-
selectable: !0,
|
|
147
|
-
selectedIndexedByHash: B
|
|
148
|
-
}), Ye = async (e) => {
|
|
149
|
-
A.multiple ? j("update:modelValue", A.modelValue.concat(e.value)) : j("update:modelValue", e.value);
|
|
150
|
-
}, Xe = async (e) => {
|
|
151
|
-
if (A.multiple) {
|
|
152
|
-
let t = { ...B.value };
|
|
153
|
-
delete t[e.valueHash], j("update:modelValue", Object.values(t));
|
|
154
|
-
} else j("update:modelValue", null);
|
|
155
|
-
};
|
|
156
|
-
te(() => [A.dependencies, A.items], async () => {
|
|
157
|
-
Je.value && await R(!1, A.modelValue);
|
|
158
|
-
}, { debounce: A.depsDebounceTime });
|
|
159
|
-
let Ze = (e, t) => {
|
|
160
|
-
let n = L.value[e.key], r = e.align ?? "left", i = O(t.item, e.key);
|
|
161
|
-
return e.formatter && (!l(i) || e.formatOnNull !== !1) && (i = e.formatter(i, e.key, t.item)), e.placeholder && l(i) && (i = e.placeholder), {
|
|
162
|
-
align: r,
|
|
163
|
-
classes: se([`bb-table-data__cell--${r}`], A.tdClass, e.tdClass, i, e.key, t.item),
|
|
164
|
-
content: i,
|
|
165
|
-
key: e.key,
|
|
166
|
-
label: e.label,
|
|
167
|
-
slotName: n
|
|
168
|
-
};
|
|
169
|
-
}, Qe = d(() => A.columns.map((e) => {
|
|
170
|
-
let t = e.align ?? "left", n = `header:${L.value[e.key]}`, r = e.sorted ? e.sorted === "asc" ? "ascending" : "descending" : void 0;
|
|
171
|
-
return {
|
|
172
|
-
align: t,
|
|
173
|
-
key: e.key,
|
|
174
|
-
label: e.label,
|
|
175
|
-
slotName: n,
|
|
176
|
-
classes: ce([`bb-table-header--${t}`], A.thClass, e.thClass),
|
|
177
|
-
sortDirection: r
|
|
178
|
-
};
|
|
179
|
-
})), H = d(() => {
|
|
180
|
-
let e = 0;
|
|
181
|
-
return V.value.map((t, n) => {
|
|
182
|
-
let r = !A.selectable || typeof A.selectable == "function" && !A.selectable(t.item) || !!t.disabled, i = (A.page ?? -1) * (A.perPage ?? 0), a = n + 1, o = i + 1 + a + e, s = A.columns.map((e) => Ze(e, t)), c = G.value[t.valueHash] ?? !1;
|
|
183
|
-
return c && e++, {
|
|
184
|
-
accessibleLabel: We(s),
|
|
185
|
-
cols: s,
|
|
186
|
-
expanded: c,
|
|
187
|
-
onRowClick: (e) => j("click:row", e, t, !!t.selected),
|
|
188
|
-
onRowContextMenu: (e) => j("contextmenu:row", e, t, !!t.selected),
|
|
189
|
-
onRowDblClick: (e) => j("dblclick:row", e, t, !!t.selected),
|
|
190
|
-
item: t.item,
|
|
191
|
-
text: t.text,
|
|
192
|
-
rowIndex: o,
|
|
193
|
-
valueHash: t.valueHash,
|
|
194
|
-
value: t.value,
|
|
195
|
-
selected: t.selected,
|
|
196
|
-
disabled: r
|
|
197
|
-
};
|
|
198
|
-
});
|
|
199
|
-
}), U = me(_, "selectAll"), W = me(_, "expandedItems"), { data: G } = s({ items: W }), $e = (e, t) => {
|
|
200
|
-
e.target instanceof HTMLElement && (e.target instanceof HTMLButtonElement || e.key !== "Enter" && e.key !== " " || (e.preventDefault(), q(t)));
|
|
201
|
-
}, K = (e) => ({
|
|
202
|
-
"aria-controls": l(G.value[e.valueHash]) ? void 0 : `expanded_${e.valueHash}`,
|
|
203
|
-
"aria-expanded": e.expanded ? "true" : "false",
|
|
204
|
-
onClick: (t) => {
|
|
205
|
-
t.stopPropagation(), q(e.valueHash);
|
|
206
|
-
},
|
|
207
|
-
onKeydown: (t) => $e(t, e.valueHash)
|
|
208
|
-
}), q = (e) => {
|
|
209
|
-
let t = V.value.find((t) => t.valueHash === e);
|
|
210
|
-
t && (e in G.value ? W.value = W.value.filter((t) => i(t) !== e) : W.value = [...W.value, t.value]);
|
|
211
|
-
};
|
|
212
|
-
D(U, () => {
|
|
213
|
-
Y.clear(), j("update:unselectedItems", []), j("update:modelValue", []);
|
|
1
|
+
import { useLogger as e } from "./index31.js";
|
|
2
|
+
//#region src/components/BbTable/utils.ts
|
|
3
|
+
var t = (t, n) => {
|
|
4
|
+
if (!n.length) return;
|
|
5
|
+
let r = Array.from(t.querySelectorAll(":scope > thead th"));
|
|
6
|
+
if (!r.length) return;
|
|
7
|
+
let { error: i } = e(), a = r.length, o = n.map((e) => ({
|
|
8
|
+
index: typeof e == "number" ? e : e.index,
|
|
9
|
+
position: typeof e == "number" ? "left" : e.position
|
|
10
|
+
})).sort((e, t) => e.position === t.position ? e.position === "left" ? e.index - t.index : t.index - e.index : e.position === "left" ? -1 : 1).reduce((e, t) => {
|
|
11
|
+
let n = r[t.index];
|
|
12
|
+
if (!n) return i(`BbTable fixedColumns: Cannot affix column at index ${t.index}. Table has ${a} columns (valid indices: 0–${a - 1}).`), e;
|
|
13
|
+
let { width: o } = n.getBoundingClientRect(), s = e.filter((e) => e.position === t.position).reduce((e, t) => e + t.width, 0);
|
|
14
|
+
return e.push({
|
|
15
|
+
index: t.index,
|
|
16
|
+
position: t.position,
|
|
17
|
+
width: Math.floor(o),
|
|
18
|
+
offset: s
|
|
19
|
+
}), e;
|
|
20
|
+
}, []);
|
|
21
|
+
Array.from(t.querySelectorAll(":scope > thead > tr, :scope > tbody > tr")).forEach((e) => {
|
|
22
|
+
o.forEach((t) => {
|
|
23
|
+
let n = e.querySelector(`:scope > :nth-child(${t.index + 1})`);
|
|
24
|
+
n && (n.style.position = "sticky", n.style[t.position] = `${t.offset}px`);
|
|
214
25
|
});
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
disabled: A.disabled,
|
|
229
|
-
name: A.name,
|
|
230
|
-
type: "hidden",
|
|
231
|
-
value: et(e)
|
|
232
|
-
}))), Q = [
|
|
233
|
-
70,
|
|
234
|
-
45,
|
|
235
|
-
85,
|
|
236
|
-
55
|
|
237
|
-
], $ = d(() => e(V.value.length || A.columns.length || 1, 4, 10));
|
|
238
|
-
return D(() => [H.value, A.fixedColumns], () => {
|
|
239
|
-
N.value && A.fixedColumns?.length && ae(N.value, A.fixedColumns);
|
|
240
|
-
}, { flush: "post" }), (e, t) => (x(), f(pe(Ge.value), {
|
|
241
|
-
"aria-busy": P.value,
|
|
242
|
-
"aria-rowcount": F.value ? A.totalItems : void 0,
|
|
243
|
-
class: y(Ke.value),
|
|
244
|
-
inert: e.disabled
|
|
245
|
-
}, {
|
|
246
|
-
default: he(() => [
|
|
247
|
-
e.selectable ? (x(), m("legend", ge, w(e.legend), 1)) : p("", !0),
|
|
248
|
-
h("table", {
|
|
249
|
-
ref_key: "tableRef",
|
|
250
|
-
ref: N
|
|
251
|
-
}, [
|
|
252
|
-
e.caption ? (x(), m("caption", {
|
|
253
|
-
key: 0,
|
|
254
|
-
class: y({
|
|
255
|
-
"bb-table-caption": !0,
|
|
256
|
-
"sr-only": !e.displayCaption
|
|
257
|
-
})
|
|
258
|
-
}, w(e.caption), 3)) : p("", !0),
|
|
259
|
-
h("thead", null, [C(e.$slots, "thead", {}, () => [h("tr", {
|
|
260
|
-
"aria-rowindex": F.value ? 1 : void 0,
|
|
261
|
-
class: "bb-table-header-row"
|
|
262
|
-
}, [
|
|
263
|
-
e.selectable ? (x(), m("th", {
|
|
264
|
-
key: 0,
|
|
265
|
-
class: y(["bb-table-header bb-table-header--select", e.thClass]),
|
|
266
|
-
scope: "col"
|
|
267
|
-
}, [C(e.$slots, "header:select", {
|
|
268
|
-
multiple: e.multiple,
|
|
269
|
-
selectAll: !!U.value,
|
|
270
|
-
text: e.selectText || E(M)("table.selectText").value
|
|
271
|
-
}, () => [h("span", ve, [e.allowSelectAll && e.multiple ? (x(), m("label", {
|
|
272
|
-
key: 0,
|
|
273
|
-
class: y(["bb-table-check__label", { "bb-table-check__label--disabled": e.disabled }])
|
|
274
|
-
}, [(x(), f(a, {
|
|
275
|
-
key: J.value.toString(),
|
|
276
|
-
modelValue: U.value,
|
|
277
|
-
"onUpdate:modelValue": t[0] ||= (e) => U.value = e,
|
|
278
|
-
class: "bb-table-check",
|
|
279
|
-
disabled: e.disabled,
|
|
280
|
-
indeterminate: J.value,
|
|
281
|
-
name: `select_all_${e.name || ""}`,
|
|
282
|
-
readonly: e.readonly
|
|
283
|
-
}, null, 8, [
|
|
284
|
-
"modelValue",
|
|
285
|
-
"disabled",
|
|
286
|
-
"indeterminate",
|
|
287
|
-
"name",
|
|
288
|
-
"readonly"
|
|
289
|
-
])), h("span", ye, w(e.selectAllLabel || E(M)("table.selectAllLabel").value), 1)], 2)) : e.multiple ? p("", !0) : (x(), m("span", be, w(e.selectText || E(M)("table.selectText").value), 1))])])], 2)) : p("", !0),
|
|
290
|
-
(x(!0), m(u, null, S(Qe.value, (t) => (x(), m("th", {
|
|
291
|
-
key: t.key,
|
|
292
|
-
"aria-sort": t.sortDirection,
|
|
293
|
-
class: y(["bb-table-header", t.classes]),
|
|
294
|
-
scope: "col"
|
|
295
|
-
}, [C(e.$slots, t.slotName, {
|
|
296
|
-
classes: t.classes,
|
|
297
|
-
items: E(z),
|
|
298
|
-
label: t.label
|
|
299
|
-
}, () => [h("span", Se, w(t.label), 1)])], 10, xe))), 128)),
|
|
300
|
-
e.actions ? (x(), m("th", {
|
|
301
|
-
key: 1,
|
|
302
|
-
class: y(["bb-table-header bb-table-header--actions", e.thClass]),
|
|
303
|
-
scope: "col"
|
|
304
|
-
}, [C(e.$slots, "header:actions", { text: e.actionsText }, () => [h("span", Ce, w(e.actionsText), 1)])], 2)) : p("", !0)
|
|
305
|
-
], 8, _e)])]),
|
|
306
|
-
h("tbody", null, [P.value ? C(e.$slots, "loading", {
|
|
307
|
-
key: 0,
|
|
308
|
-
items: E(z)
|
|
309
|
-
}, () => [(x(!0), m(u, null, S($.value, (n, r) => (x(), m("tr", {
|
|
310
|
-
key: r,
|
|
311
|
-
"aria-rowindex": F.value ? r + 2 : void 0,
|
|
312
|
-
class: "bb-table-skeleton__row"
|
|
313
|
-
}, [
|
|
314
|
-
e.selectable ? (x(), m("td", Te, t[1] ||= [h("div", { class: "bb-table-skeleton__placeholder" }, null, -1)])) : p("", !0),
|
|
315
|
-
(x(!0), m(u, null, S(A.columns, (e, n) => (x(), m("td", {
|
|
316
|
-
key: e.key,
|
|
317
|
-
class: y(["bb-table-skeleton__cell", `bb-table-skeleton__cell--${e.skeleton ?? "text"}`])
|
|
318
|
-
}, [!e.skeleton || e.skeleton === "text" ? (x(), m("div", Ee, [h("div", {
|
|
319
|
-
class: "bb-table-skeleton__line",
|
|
320
|
-
style: b({ width: `${Q[(r + n) % 4]}%` })
|
|
321
|
-
}, null, 4), h("div", {
|
|
322
|
-
class: "bb-table-skeleton__line",
|
|
323
|
-
style: b({ width: `${Q[(r + n + 2) % 4]}%` })
|
|
324
|
-
}, null, 4)])) : e.skeleton === "avatar" ? (x(), m("div", De)) : e.skeleton === "avatar-text" ? (x(), m("div", Oe, [t[2] ||= h("div", { class: "bb-table-skeleton__avatar" }, null, -1), h("div", ke, [h("div", {
|
|
325
|
-
class: "bb-table-skeleton__line",
|
|
326
|
-
style: b({ width: `${Q[(r + n) % 4]}%` })
|
|
327
|
-
}, null, 4), h("div", {
|
|
328
|
-
class: "bb-table-skeleton__line",
|
|
329
|
-
style: b({ width: `${Q[(r + n + 2) % 4]}%` })
|
|
330
|
-
}, null, 4)])])) : e.skeleton === "image" ? (x(), m("div", Ae)) : e.skeleton === "badge" ? (x(), m("div", je)) : p("", !0)], 2))), 128)),
|
|
331
|
-
e.actions ? (x(), m("td", Me, t[3] ||= [h("div", { class: "bb-table-skeleton__placeholder" }, null, -1)])) : p("", !0)
|
|
332
|
-
], 8, we))), 128)), h("tr", {
|
|
333
|
-
"aria-rowindex": F.value ? $.value + 2 : void 0,
|
|
334
|
-
class: "bb-table-loading__row bb-table-loading__row--sr-only"
|
|
335
|
-
}, [h("td", {
|
|
336
|
-
colspan: I.value,
|
|
337
|
-
class: "bb-table-loading__cell",
|
|
338
|
-
"aria-live": "polite",
|
|
339
|
-
role: "status"
|
|
340
|
-
}, [h("span", Fe, w(e.loadingText), 1)], 8, Pe)], 8, Ne)]) : E(V).length ? C(e.$slots, "tbody", { key: 2 }, () => [(x(!0), m(u, null, S(H.value, (t) => (x(), m(u, { key: t.valueHash }, [h("tr", {
|
|
341
|
-
"aria-rowindex": F.value && t.rowIndex ? t.rowIndex : void 0,
|
|
342
|
-
class: "bb-table-data__row",
|
|
343
|
-
onClick: t.onRowClick,
|
|
344
|
-
onContextmenu: t.onRowContextMenu,
|
|
345
|
-
onDblclick: t.onRowDblClick
|
|
346
|
-
}, [
|
|
347
|
-
e.selectable ? (x(), m("td", {
|
|
348
|
-
key: 0,
|
|
349
|
-
class: y(["bb-table-data__cell bb-table-data__cell--select", e.tdClass])
|
|
350
|
-
}, [C(e.$slots, "select", {
|
|
351
|
-
checked: Z(t),
|
|
352
|
-
disabled: !!t.disabled,
|
|
353
|
-
inputName: E(k),
|
|
354
|
-
item: t.item,
|
|
355
|
-
readonly: !!e.readonly,
|
|
356
|
-
value: t.value
|
|
357
|
-
}, () => [e.multiple ? (x(), m("label", {
|
|
358
|
-
key: 0,
|
|
359
|
-
class: y(["bb-table-check__label", { "bb-table-check__label--disabled": t.disabled }])
|
|
360
|
-
}, [g(a, {
|
|
361
|
-
checked: Z(t),
|
|
362
|
-
class: "bb-table-check",
|
|
363
|
-
disabled: t.disabled,
|
|
364
|
-
readonly: e.readonly,
|
|
365
|
-
onChange: () => X(t)
|
|
366
|
-
}, null, 8, [
|
|
367
|
-
"checked",
|
|
368
|
-
"disabled",
|
|
369
|
-
"readonly",
|
|
370
|
-
"onChange"
|
|
371
|
-
]), h("span", Be, w(t.accessibleLabel), 1)], 2)) : (x(), m("label", {
|
|
372
|
-
key: 1,
|
|
373
|
-
class: y(["bb-table-radio__label", { "bb-table-radio__label--disabled": t.disabled }])
|
|
374
|
-
}, [g(ie, {
|
|
375
|
-
checked: t.selected,
|
|
376
|
-
class: "bb-table-radio",
|
|
377
|
-
disabled: t.disabled,
|
|
378
|
-
name: E(k),
|
|
379
|
-
readonly: e.readonly,
|
|
380
|
-
value: t.value,
|
|
381
|
-
onChange: () => X(t)
|
|
382
|
-
}, null, 8, [
|
|
383
|
-
"checked",
|
|
384
|
-
"disabled",
|
|
385
|
-
"name",
|
|
386
|
-
"readonly",
|
|
387
|
-
"value",
|
|
388
|
-
"onChange"
|
|
389
|
-
]), h("span", Ve, w(t.accessibleLabel), 1)], 2))])], 2)) : p("", !0),
|
|
390
|
-
(x(!0), m(u, null, S(t.cols, (n) => (x(), m("td", {
|
|
391
|
-
key: n.key,
|
|
392
|
-
class: y(["bb-table-data__cell", n.classes])
|
|
393
|
-
}, [C(e.$slots, n.slotName, {
|
|
394
|
-
classes: n.classes,
|
|
395
|
-
content: n.content,
|
|
396
|
-
expanded: t.expanded,
|
|
397
|
-
item: t.item,
|
|
398
|
-
expandProps: K(t),
|
|
399
|
-
toggleExpanded: () => q(t.valueHash),
|
|
400
|
-
value: t.value
|
|
401
|
-
}, () => [le(w(n.content), 1)])], 2))), 128)),
|
|
402
|
-
e.actions ? (x(), m("td", {
|
|
403
|
-
key: 1,
|
|
404
|
-
class: y(["bb-table__cell bb-table__cell--actions", e.tdClass])
|
|
405
|
-
}, [C(e.$slots, "actions", {
|
|
406
|
-
expanded: t.expanded,
|
|
407
|
-
item: t.item,
|
|
408
|
-
expandProps: K(t),
|
|
409
|
-
toggleExpanded: () => q(t.valueHash),
|
|
410
|
-
value: t.value
|
|
411
|
-
})], 2)) : p("", !0)
|
|
412
|
-
], 40, ze), t.expanded ? (x(), m("tr", {
|
|
413
|
-
key: 0,
|
|
414
|
-
"aria-rowindex": F.value && t.rowIndex ? t.rowIndex + 1 : void 0,
|
|
415
|
-
id: `expanded_${t.valueHash}`,
|
|
416
|
-
class: "bb-table-expand__row"
|
|
417
|
-
}, [h("td", {
|
|
418
|
-
colspan: I.value,
|
|
419
|
-
class: "bb-table-expand__cell"
|
|
420
|
-
}, [C(e.$slots, "expand", {
|
|
421
|
-
expanded: t.expanded,
|
|
422
|
-
item: t.item,
|
|
423
|
-
expandProps: K(t),
|
|
424
|
-
toggleExpanded: () => q(t.valueHash),
|
|
425
|
-
value: t.value
|
|
426
|
-
})], 8, Ue)], 8, He)) : p("", !0)], 64))), 128))]) : C(e.$slots, "no-data", { key: 1 }, () => [h("tr", {
|
|
427
|
-
"aria-rowindex": F.value ? 2 : void 0,
|
|
428
|
-
class: "bb-table-no-data__row"
|
|
429
|
-
}, [h("td", {
|
|
430
|
-
class: "bb-table-no-data__cell",
|
|
431
|
-
colspan: I.value
|
|
432
|
-
}, [h("span", Re, w(e.noDataText || E(M)("table.noDataText").value), 1)], 8, Le)], 8, Ie)])]),
|
|
433
|
-
h("tfoot", null, [C(e.$slots, "tfoot")])
|
|
434
|
-
], 512),
|
|
435
|
-
(x(!0), m(u, null, S(tt.value, (e) => (x(), m("input", ue({
|
|
436
|
-
key: e.value,
|
|
437
|
-
ref_for: !0
|
|
438
|
-
}, e), null, 16))), 128))
|
|
439
|
-
]),
|
|
440
|
-
_: 3
|
|
441
|
-
}, 8, [
|
|
442
|
-
"aria-busy",
|
|
443
|
-
"aria-rowcount",
|
|
444
|
-
"class",
|
|
445
|
-
"inert"
|
|
446
|
-
]));
|
|
26
|
+
});
|
|
27
|
+
}, n = (e) => Array.isArray(e) ? e : [e], r = (e) => e.split(/\W+/g).join("_").toLowerCase(), i = (e, t, r) => {
|
|
28
|
+
let i = [...n(e)];
|
|
29
|
+
return t && i.push(...n(t)), r && i.push(...n(r)), i;
|
|
30
|
+
}, a = (e, t, r, i, a, o) => {
|
|
31
|
+
let s = [...n(e)], c = (e) => typeof e == "function" ? e(i, a, o) : e;
|
|
32
|
+
if (t) {
|
|
33
|
+
let e = c(t);
|
|
34
|
+
e && s.push(...n(e));
|
|
35
|
+
}
|
|
36
|
+
if (r) {
|
|
37
|
+
let e = c(r);
|
|
38
|
+
e && s.push(...n(e));
|
|
447
39
|
}
|
|
448
|
-
|
|
40
|
+
return s;
|
|
41
|
+
};
|
|
449
42
|
//#endregion
|
|
450
|
-
export {
|
|
43
|
+
export { t as applyFixedTableColumns, r as columnKeyToSlotName, a as mergeCellClasses, i as mergeHeaderClasses };
|