bitboss-ui 2.1.127 → 2.1.128

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/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("./index356.js")).default;
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,36 @@
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`);
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, watchEffect as s } from "vue";
3
+ //#region src/composables/useTableWidthContext.ts
4
+ var c = i(/* @__PURE__ */ new Map()), l = "[data-bb-table-id]";
5
+ function u(u) {
6
+ let d = e().id, f = t(() => o(u.id) || d.value), p = a(null), m = i({
7
+ id: f.value,
8
+ parentId: null,
9
+ tracks: {}
26
10
  });
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));
39
- }
40
- return s;
41
- };
11
+ s(() => {
12
+ m.id = f.value, m.parentId = p.value, c.set(f.value, m);
13
+ }), r(() => {
14
+ p.value = (o(u.container)?.parentElement?.closest(l))?.dataset.bbTableId ?? null;
15
+ }), n(() => c.delete(f.value));
16
+ let h = t(() => p.value ? c.get(p.value) ?? null : null);
17
+ return {
18
+ id: f,
19
+ parentId: p,
20
+ parentNode: h,
21
+ parentHasTrack: (e) => !!h.value?.tracks[e],
22
+ parentVar: (e, t = "auto") => p.value ? `var(--bb-table-${p.value}-track-${e}, ${t})` : t,
23
+ node: m,
24
+ registry: c,
25
+ setTracks: (e) => {
26
+ m.tracks = e;
27
+ },
28
+ cssVars: t(() => {
29
+ let e = {};
30
+ for (let [t, n] of Object.entries(m.tracks)) e[`--bb-table-${f.value}-track-${t}`] = n;
31
+ return e;
32
+ })
33
+ };
34
+ }
42
35
  //#endregion
43
- export { t as applyFixedTableColumns, r as columnKeyToSlotName, a as mergeCellClasses, i as mergeHeaderClasses };
36
+ export { u as useTableWidthContext };
package/dist/index326.js CHANGED
@@ -1,450 +1,43 @@
1
- import { clamp as e } from "./index8.js";
2
- import { useId as t } from "./index12.js";
3
- import { useLogger as n } from "./index31.js";
4
- import { useLocale as r } from "./index42.js";
5
- import { hash as i } from "./index81.js";
6
- import a from "./index85.js";
7
- import { useItemsGetter as o } from "./index89.js";
8
- import { useIndexById as s } from "./index90.js";
9
- import { useItemValue as c } from "./index92.js";
10
- import { useBaseOptions as ee } from "./index93.js";
11
- import { isNil as l } from "./index94.js";
12
- import { useHashedWatcher as te } from "./index96.js";
13
- import { usePrefill as ne } from "./index97.js";
14
- import { when as re } from "./index151.js";
15
- import ie from "./index154.js";
16
- import { applyFixedTableColumns as ae, columnKeyToSlotName as oe, mergeCellClasses as se, mergeHeaderClasses as ce } from "./index325.js";
17
- import { Fragment as u, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createTextVNode as le, createVNode as g, defineComponent as _, mergeModels as v, mergeProps as ue, normalizeClass as y, normalizeStyle as b, openBlock as x, reactive as de, ref as fe, renderList as S, renderSlot as C, resolveDynamicComponent as pe, toDisplayString as w, toRef as T, unref as E, useModel as me, watch as D, withCtx as he } from "vue";
18
- //#region src/components/BbTable/BbTable.vue?vue&type=script&setup=true&lang.ts
19
- var ge = {
20
- key: 0,
21
- class: "sr-only"
22
- }, _e = ["aria-rowindex"], ve = { class: "bb-table-header__content" }, ye = { class: "bb-table-check__label-text sr-only" }, be = {
23
- key: 1,
24
- class: "bb-table-radio__label-text sr-only"
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
- let J = d(() => !!(A.multiple && A.modelValue.length > 0 && !A.selectAll || U.value && Y.size > 0)), Y = de(/* @__PURE__ */ new Set());
216
- D(() => A.unselectedItems, () => {
217
- Y.clear(), A.unselectedItems.forEach((e) => {
218
- Y.add(i(e));
219
- });
220
- });
221
- let X = (e) => {
222
- if (Z(e)) {
223
- Xe(e), j("item:unselected", e.value), Y.add(e.valueHash), j("update:unselectedItems", [...A.unselectedItems, e.value]);
224
- return;
225
- }
226
- U.value || Ye(e), j("item:selected", e.value), Y.delete(e.valueHash), j("update:unselectedItems", A.unselectedItems.filter((t) => i(t) !== i(e.value)));
227
- }, Z = (e) => Y.has(e.valueHash) ? !1 : e.selected || U.value, et = re((e) => typeof e != "string", JSON.stringify), tt = d(() => [].concat(A.modelValue ?? []).map((e) => ({
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 { O as default };
43
+ export { t as applyFixedTableColumns, r as columnKeyToSlotName, a as mergeCellClasses, i as mergeHeaderClasses };