@mkbabb/glass-ui 10.1.0 → 10.1.1
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/MIGRATION.md +25 -0
- package/dist/aurora.js +29 -29
- package/dist/{command-C-5xSEJ2.js → command-CTQCaHVA.js} +1 -1
- package/dist/command.js +1 -1
- package/dist/components/_shared/overlay/participation.d.ts +13 -1
- package/dist/components/dock/GlassDock.vue.d.ts +5 -5
- package/dist/components/dock/composables/dockContext.d.ts +16 -2
- package/dist/components/sheet/styles.css +1 -1
- package/dist/components/skeleton/Skeleton.vue.d.ts +6 -0
- package/dist/content-BhcJH1bI.js +22 -0
- package/dist/data-table-Cs93-uY7.js +511 -0
- package/dist/data-table.js +1 -1
- package/dist/dock.js +417 -409
- package/dist/easing.js +3 -3
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +8 -8
- package/dist/labeled-field.js +1 -1
- package/dist/{menu-BnmCOa3y.js → menu-DN29N6KR.js} +6 -3
- package/dist/menu.js +1 -1
- package/dist/motion-core.js +11 -11
- package/dist/participation-Cs_UX_Dc.js +55 -0
- package/dist/{popover-DA87hFBx.js → popover-CJpvT2E6.js} +9 -4
- package/dist/popover.js +1 -1
- package/dist/{select-fy3vtArm.js → select-5QMeUAU6.js} +26 -24
- package/dist/select.js +1 -1
- package/dist/{sheet-BQJyER59.js → sheet-DmJxgAHc.js} +1 -1
- package/dist/sheet.js +1 -1
- package/dist/{slider-5ChjjWSR.js → slider-D1zkobtO.js} +1 -1
- package/dist/slider.js +1 -1
- package/dist/{tabs-rdRXKXxd.js → tabs-C0PYq3Tb.js} +1 -1
- package/dist/tabs.js +1 -1
- package/dist/{tooltip-DhTHhtJN.js → tooltip-D7j6TsE4.js} +3 -3
- package/dist/tooltip.js +1 -1
- package/package.json +1 -1
- package/dist/content-So3j6SOe.js +0 -18
- package/dist/data-table-Ba_uTfPc.js +0 -493
- package/dist/participation-Di4UHbzk.js +0 -42
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
import { t as e } from "./class-names-FlXcvRRT.js";
|
|
2
|
+
import { t } from "./primitive-B2t2jdqM.js";
|
|
3
|
+
import { t as n } from "./useResizeObserver-CdUlm2QZ.js";
|
|
4
|
+
import { t as r } from "./useIntersectionPause-CzKR3EyP.js";
|
|
5
|
+
import { t as i } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
6
|
+
import { t as a } from "./focus-Duf7EpUu.js";
|
|
7
|
+
import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, effectScope as h, isRef as g, mergeProps as _, nextTick as ee, normalizeClass as v, onBeforeUpdate as te, onUpdated as ne, openBlock as y, ref as b, renderList as x, renderSlot as S, resolveDynamicComponent as C, toDisplayString as w, toValue as T, unref as E, useAttrs as D, useSlots as re, useTemplateRef as O, watch as k, withCtx as A, withModifiers as j } from "vue";
|
|
8
|
+
//#region src/components/table/Table.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
var M = {
|
|
10
|
+
"data-slot": "table-container",
|
|
11
|
+
class: "relative w-full overflow-auto"
|
|
12
|
+
}, N = [
|
|
13
|
+
"role",
|
|
14
|
+
"aria-label",
|
|
15
|
+
"aria-colcount",
|
|
16
|
+
"aria-rowcount"
|
|
17
|
+
], P = /* @__PURE__ */ m({
|
|
18
|
+
inheritAttrs: !1,
|
|
19
|
+
__name: "Table",
|
|
20
|
+
props: {
|
|
21
|
+
class: { type: [
|
|
22
|
+
Boolean,
|
|
23
|
+
null,
|
|
24
|
+
String,
|
|
25
|
+
Object,
|
|
26
|
+
Array
|
|
27
|
+
] },
|
|
28
|
+
role: {},
|
|
29
|
+
ariaLabel: {},
|
|
30
|
+
ariaColCount: {},
|
|
31
|
+
ariaRowCount: {}
|
|
32
|
+
},
|
|
33
|
+
setup(t) {
|
|
34
|
+
let n = t, r = D();
|
|
35
|
+
return (t, i) => (y(), u("div", M, [d("table", _(E(r), {
|
|
36
|
+
"data-slot": "table",
|
|
37
|
+
class: E(e)("w-full caption-bottom text-small", n.class),
|
|
38
|
+
role: n.role,
|
|
39
|
+
"aria-label": n.ariaLabel,
|
|
40
|
+
"aria-colcount": n.ariaColCount,
|
|
41
|
+
"aria-rowcount": n.ariaRowCount
|
|
42
|
+
}), [S(t.$slots, "default")], 16, N)]));
|
|
43
|
+
}
|
|
44
|
+
}), F = /* @__PURE__ */ m({
|
|
45
|
+
__name: "TableBody",
|
|
46
|
+
props: { class: { type: [
|
|
47
|
+
Boolean,
|
|
48
|
+
null,
|
|
49
|
+
String,
|
|
50
|
+
Object,
|
|
51
|
+
Array
|
|
52
|
+
] } },
|
|
53
|
+
setup(t) {
|
|
54
|
+
let n = t;
|
|
55
|
+
return (t, r) => (y(), u("tbody", { class: v(E(e)("[&_tr:last-child]:border-0", n.class)) }, [S(t.$slots, "default")], 2));
|
|
56
|
+
}
|
|
57
|
+
}), I = /* @__PURE__ */ m({
|
|
58
|
+
__name: "TableCell",
|
|
59
|
+
props: { class: { type: [
|
|
60
|
+
Boolean,
|
|
61
|
+
null,
|
|
62
|
+
String,
|
|
63
|
+
Object,
|
|
64
|
+
Array
|
|
65
|
+
] } },
|
|
66
|
+
setup(t) {
|
|
67
|
+
let n = t;
|
|
68
|
+
return (t, r) => (y(), u("td", { class: v(E(e)("table-cell align-middle [&:has([role=checkbox])]:pr-0", n.class)) }, [S(t.$slots, "default")], 2));
|
|
69
|
+
}
|
|
70
|
+
}), L = /* @__PURE__ */ m({
|
|
71
|
+
__name: "TableHead",
|
|
72
|
+
props: { class: { type: [
|
|
73
|
+
Boolean,
|
|
74
|
+
null,
|
|
75
|
+
String,
|
|
76
|
+
Object,
|
|
77
|
+
Array
|
|
78
|
+
] } },
|
|
79
|
+
setup(t) {
|
|
80
|
+
let n = t;
|
|
81
|
+
return (t, r) => (y(), u("th", { class: v(E(e)("table-head text-left data-[align=center]:text-center data-[align=right]:text-right align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0", n.class)) }, [S(t.$slots, "default")], 2));
|
|
82
|
+
}
|
|
83
|
+
}), R = /* @__PURE__ */ m({
|
|
84
|
+
__name: "TableHeader",
|
|
85
|
+
props: { class: { type: [
|
|
86
|
+
Boolean,
|
|
87
|
+
null,
|
|
88
|
+
String,
|
|
89
|
+
Object,
|
|
90
|
+
Array
|
|
91
|
+
] } },
|
|
92
|
+
setup(t) {
|
|
93
|
+
let n = t;
|
|
94
|
+
return (t, r) => (y(), u("thead", { class: v(E(e)("[&_tr]:border-b", n.class)) }, [S(t.$slots, "default")], 2));
|
|
95
|
+
}
|
|
96
|
+
}), z = /* @__PURE__ */ m({
|
|
97
|
+
__name: "TableRow",
|
|
98
|
+
props: { class: { type: [
|
|
99
|
+
Boolean,
|
|
100
|
+
null,
|
|
101
|
+
String,
|
|
102
|
+
Object,
|
|
103
|
+
Array
|
|
104
|
+
] } },
|
|
105
|
+
setup(t) {
|
|
106
|
+
let n = t;
|
|
107
|
+
return (t, r) => (y(), u("tr", { class: v(E(e)("border-b", n.class)) }, [S(t.$slots, "default")], 2));
|
|
108
|
+
}
|
|
109
|
+
}), B = { class: "flex items-center justify-center py-10" }, V = /* @__PURE__ */ m({
|
|
110
|
+
__name: "TableEmpty",
|
|
111
|
+
props: {
|
|
112
|
+
class: { type: [
|
|
113
|
+
Boolean,
|
|
114
|
+
null,
|
|
115
|
+
String,
|
|
116
|
+
Object,
|
|
117
|
+
Array
|
|
118
|
+
] },
|
|
119
|
+
colspan: { default: 1 }
|
|
120
|
+
},
|
|
121
|
+
setup(t) {
|
|
122
|
+
let n = t, r = s(() => {
|
|
123
|
+
let { class: e, ...t } = n;
|
|
124
|
+
return t;
|
|
125
|
+
});
|
|
126
|
+
return (t, i) => (y(), c(z, null, {
|
|
127
|
+
default: A(() => [p(I, _({ class: E(e)("p-4 whitespace-nowrap align-middle text-small text-foreground", n.class) }, r.value), {
|
|
128
|
+
default: A(() => [d("div", B, [S(t.$slots, "default")])]),
|
|
129
|
+
_: 3
|
|
130
|
+
}, 16, ["class"])]),
|
|
131
|
+
_: 3
|
|
132
|
+
}));
|
|
133
|
+
}
|
|
134
|
+
}), H = ["data-shimmer", "data-offscreen"], U = /*#__PURE__*/ i(/* @__PURE__ */ m({
|
|
135
|
+
inheritAttrs: !1,
|
|
136
|
+
__name: "Skeleton",
|
|
137
|
+
props: {
|
|
138
|
+
class: { type: [
|
|
139
|
+
Boolean,
|
|
140
|
+
null,
|
|
141
|
+
String,
|
|
142
|
+
Object,
|
|
143
|
+
Array
|
|
144
|
+
] },
|
|
145
|
+
shimmer: { type: Boolean }
|
|
146
|
+
},
|
|
147
|
+
setup(n) {
|
|
148
|
+
let i = n, a = D(), o = s(() => Object.fromEntries(Object.entries(t(a)).filter(([e]) => e !== "role" && !e.startsWith("aria-")))), c = O("el"), l = b(!1);
|
|
149
|
+
return k(() => i.shimmer, (e, t, n) => {
|
|
150
|
+
if (!e) return;
|
|
151
|
+
let i = h();
|
|
152
|
+
i.run(() => r(c, {
|
|
153
|
+
pause: () => l.value = !0,
|
|
154
|
+
resume: () => l.value = !1
|
|
155
|
+
})), n(() => {
|
|
156
|
+
i.stop(), l.value = !1;
|
|
157
|
+
});
|
|
158
|
+
}, { immediate: !0 }), (t, r) => (y(), u("div", _({
|
|
159
|
+
ref_key: "el",
|
|
160
|
+
ref: c
|
|
161
|
+
}, o.value, {
|
|
162
|
+
"data-slot": "skeleton",
|
|
163
|
+
"aria-hidden": "true",
|
|
164
|
+
"data-shimmer": n.shimmer || void 0,
|
|
165
|
+
"data-offscreen": n.shimmer && l.value || void 0,
|
|
166
|
+
class: E(e)("skeleton", i.class)
|
|
167
|
+
}), null, 16, H));
|
|
168
|
+
}
|
|
169
|
+
}), [["__scopeId", "data-v-5e54f919"]]);
|
|
170
|
+
//#endregion
|
|
171
|
+
//#region src/components/data-table/composables/useDataTableRowIdentity.ts
|
|
172
|
+
function W(e, t) {
|
|
173
|
+
return t.split(".").reduce((e, t) => {
|
|
174
|
+
if (!(typeof e != "object" || !e)) return e[t];
|
|
175
|
+
}, e);
|
|
176
|
+
}
|
|
177
|
+
function G(e) {
|
|
178
|
+
return g(e) ? e.value : e;
|
|
179
|
+
}
|
|
180
|
+
function K(e) {
|
|
181
|
+
return [
|
|
182
|
+
"string",
|
|
183
|
+
"number",
|
|
184
|
+
"symbol"
|
|
185
|
+
].includes(typeof e);
|
|
186
|
+
}
|
|
187
|
+
function ie(e) {
|
|
188
|
+
return { rowEntries: s(() => {
|
|
189
|
+
let t = /* @__PURE__ */ new Set(), n = G(e.getRowId);
|
|
190
|
+
return T(e.rows).map((r, i) => {
|
|
191
|
+
let a = n ? n(r) : W(r, T(e.rowKey));
|
|
192
|
+
if (!K(a)) throw TypeError(`[DataTable] Row ${i} has no stable identity.`);
|
|
193
|
+
if (t.has(a)) throw TypeError(`[DataTable] Duplicate row identity ${String(a)}.`);
|
|
194
|
+
return t.add(a), {
|
|
195
|
+
row: r,
|
|
196
|
+
key: a
|
|
197
|
+
};
|
|
198
|
+
});
|
|
199
|
+
}) };
|
|
200
|
+
}
|
|
201
|
+
//#endregion
|
|
202
|
+
//#region src/components/data-table/composables/useDataTableResponsive.ts
|
|
203
|
+
function ae(e) {
|
|
204
|
+
let { columns: t, responsive: n, cardBreakpoint: r, containerWidth: i } = e;
|
|
205
|
+
return {
|
|
206
|
+
isCard: s(() => {
|
|
207
|
+
let e = T(i);
|
|
208
|
+
return T(n) && e > 0 && e < T(r);
|
|
209
|
+
}),
|
|
210
|
+
headerColumn: s(() => T(t)[0]),
|
|
211
|
+
bodyColumns: s(() => T(t).slice(1))
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region src/components/data-table/DataTable.vue?vue&type=script&setup=true&lang.ts
|
|
216
|
+
var oe = ["data-state", "aria-busy"], se = {
|
|
217
|
+
key: 0,
|
|
218
|
+
class: "data-table-state glass-quiet",
|
|
219
|
+
role: "alert"
|
|
220
|
+
}, ce = {
|
|
221
|
+
key: 1,
|
|
222
|
+
class: "data-table-cards"
|
|
223
|
+
}, le = ["role", "aria-label"], ue = { class: "data-table-card-header" }, de = { class: "data-table-card-title" }, fe = {
|
|
224
|
+
key: 0,
|
|
225
|
+
class: "data-table-card-fields"
|
|
226
|
+
}, pe = { class: "data-table-card-label" }, me = ["data-align"], he = {
|
|
227
|
+
key: 3,
|
|
228
|
+
class: "data-table-state glass-quiet"
|
|
229
|
+
}, ge = ["data-align", "onClick"], _e = { "aria-hidden": "true" }, ve = { role: "alert" }, q = /* @__PURE__ */ m({
|
|
230
|
+
__name: "DataTable",
|
|
231
|
+
props: {
|
|
232
|
+
columns: {},
|
|
233
|
+
rows: {},
|
|
234
|
+
status: { default: "ready" },
|
|
235
|
+
filtered: {
|
|
236
|
+
type: Boolean,
|
|
237
|
+
default: !1
|
|
238
|
+
},
|
|
239
|
+
rowKey: { default: "_id" },
|
|
240
|
+
getRowId: {},
|
|
241
|
+
role: {},
|
|
242
|
+
ariaLabel: {},
|
|
243
|
+
ariaColCount: {},
|
|
244
|
+
ariaRowCount: {},
|
|
245
|
+
getRowAttrs: {},
|
|
246
|
+
getRowIndex: {},
|
|
247
|
+
rowRef: {},
|
|
248
|
+
tabbableRowId: {},
|
|
249
|
+
sort: {},
|
|
250
|
+
selectable: {
|
|
251
|
+
type: Boolean,
|
|
252
|
+
default: !1
|
|
253
|
+
},
|
|
254
|
+
selectedRowId: {},
|
|
255
|
+
responsive: {
|
|
256
|
+
type: Boolean,
|
|
257
|
+
default: !1
|
|
258
|
+
},
|
|
259
|
+
cardBreakpoint: { default: 640 },
|
|
260
|
+
class: { type: [
|
|
261
|
+
Boolean,
|
|
262
|
+
null,
|
|
263
|
+
String,
|
|
264
|
+
Object,
|
|
265
|
+
Array
|
|
266
|
+
] }
|
|
267
|
+
},
|
|
268
|
+
emits: [
|
|
269
|
+
"update:sort",
|
|
270
|
+
"update:selectedRowId",
|
|
271
|
+
"update:tabbableRowId",
|
|
272
|
+
"select"
|
|
273
|
+
],
|
|
274
|
+
setup(t, { emit: r }) {
|
|
275
|
+
let i = t, m = r, h = re(), g = s(() => !!h["row-actions"]), T = s(() => i.role ?? (i.selectable || i.tabbableRowId !== void 0 ? "grid" : void 0)), D = s(() => i.ariaColCount ?? i.columns.length + +!!g.value), O = s(() => i.ariaRowCount ?? (T.value ? i.rows.length + 1 : void 0)), k = s(() => i.status === "error" ? "error" : i.status === "loading" && i.rows.length === 0 ? "loading" : i.rows.length === 0 ? i.filtered ? "filtered-empty" : "empty" : i.status), M = b(null), N = b(0);
|
|
276
|
+
n(M, (e) => {
|
|
277
|
+
N.value = e.width;
|
|
278
|
+
});
|
|
279
|
+
let { isCard: B, headerColumn: H, bodyColumns: W } = ae({
|
|
280
|
+
columns: () => i.columns,
|
|
281
|
+
responsive: () => i.responsive,
|
|
282
|
+
cardBreakpoint: () => i.cardBreakpoint,
|
|
283
|
+
containerWidth: N
|
|
284
|
+
}), { rowEntries: G } = ie({
|
|
285
|
+
rows: () => i.rows,
|
|
286
|
+
rowKey: () => i.rowKey,
|
|
287
|
+
getRowId: s(() => i.getRowId)
|
|
288
|
+
}), K = /* @__PURE__ */ new Map();
|
|
289
|
+
function q(e, t, n) {
|
|
290
|
+
let r = n, a = n instanceof HTMLElement ? n : r?.$el, o = a instanceof HTMLElement ? a : null;
|
|
291
|
+
o ? K.set(e.key, o) : K.delete(e.key), i.rowRef?.(o, e.row, t);
|
|
292
|
+
}
|
|
293
|
+
let J = null;
|
|
294
|
+
te(() => {
|
|
295
|
+
J = Array.from(K).find(([, e]) => e === document.activeElement)?.[0] ?? null;
|
|
296
|
+
}), ne(() => {
|
|
297
|
+
J !== null && K.get(J)?.focus(), J = null;
|
|
298
|
+
});
|
|
299
|
+
let Y = Array.from({ length: 5 }, (e, t) => t);
|
|
300
|
+
function X(e, t) {
|
|
301
|
+
return t.split(".").reduce((e, t) => {
|
|
302
|
+
if (!(typeof e != "object" || !e)) return e[t];
|
|
303
|
+
}, e);
|
|
304
|
+
}
|
|
305
|
+
function Z(e, t) {
|
|
306
|
+
let n = X(e, t.key);
|
|
307
|
+
return t.formatter ? t.formatter(n, e) : n == null ? "—" : String(n);
|
|
308
|
+
}
|
|
309
|
+
function ye(e) {
|
|
310
|
+
if (!e.sortable) return;
|
|
311
|
+
let t = i.sort;
|
|
312
|
+
t?.key === e.key ? m("update:sort", {
|
|
313
|
+
key: e.key,
|
|
314
|
+
direction: t.direction === "asc" ? "desc" : "asc"
|
|
315
|
+
}) : m("update:sort", {
|
|
316
|
+
key: e.key,
|
|
317
|
+
direction: "asc"
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
function be(e) {
|
|
321
|
+
if (e.sortable) return i.sort?.key === e.key ? i.sort.direction === "asc" ? "ascending" : "descending" : "none";
|
|
322
|
+
}
|
|
323
|
+
function xe(e) {
|
|
324
|
+
return e.sortable ? i.sort?.key === e.key ? i.sort.direction === "asc" ? " ↑" : " ↓" : " ↕" : "";
|
|
325
|
+
}
|
|
326
|
+
function Se(e) {
|
|
327
|
+
return Object.is(i.selectedRowId, e.key);
|
|
328
|
+
}
|
|
329
|
+
function Q(e) {
|
|
330
|
+
m("update:selectedRowId", e.key), m("update:tabbableRowId", e.key), m("select", e.row), K.get(e.key)?.focus({ preventScroll: !0 });
|
|
331
|
+
}
|
|
332
|
+
function Ce(e, t) {
|
|
333
|
+
if (!(e.target instanceof Element)) return;
|
|
334
|
+
let n = e.target.closest(a);
|
|
335
|
+
(!n || n === e.currentTarget) && Q(t);
|
|
336
|
+
}
|
|
337
|
+
function we(e, t) {
|
|
338
|
+
if (e.target !== e.currentTarget) return;
|
|
339
|
+
if (["Enter", " "].includes(e.key)) {
|
|
340
|
+
if (!i.selectable) return;
|
|
341
|
+
e.preventDefault(), Q(t);
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
let n = e.key === "Home" ? 0 : e.key === "End" ? G.value.length - 1 : -1, r = e.key === "ArrowUp" ? -1 : +(e.key === "ArrowDown");
|
|
345
|
+
if (n < 0 && r === 0) return;
|
|
346
|
+
let a = G.value.findIndex(({ key: e }) => Object.is(e, t.key)), o = Math.max(0, Math.min(G.value.length - 1, n >= 0 ? n : a + r)), s = G.value[o];
|
|
347
|
+
s && (e.preventDefault(), m("update:tabbableRowId", s.key), ee(() => K.get(s.key)?.focus({ preventScroll: !0 })));
|
|
348
|
+
}
|
|
349
|
+
let Te = s(() => i.tabbableRowId === void 0 ? i.selectable ? G.value.find(({ key: e }) => Object.is(e, i.selectedRowId))?.key ?? G.value[0]?.key ?? null : null : G.value.some(({ key: e }) => Object.is(e, i.tabbableRowId)) ? i.tabbableRowId : null);
|
|
350
|
+
function Ee(e, t = !1) {
|
|
351
|
+
if (!i.selectable) return {};
|
|
352
|
+
let n = Se(e);
|
|
353
|
+
return {
|
|
354
|
+
class: "data-table-row-interactive",
|
|
355
|
+
role: t ? "option" : void 0,
|
|
356
|
+
"aria-selected": n,
|
|
357
|
+
"data-state": n ? "selected" : void 0,
|
|
358
|
+
onClick: (t) => Ce(t, e)
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
function $(e, t, n = !1) {
|
|
362
|
+
let r = { ...i.getRowAttrs?.(e.row, t) };
|
|
363
|
+
n ? delete r["aria-rowindex"] : i.getRowIndex && (r["aria-rowindex"] = i.getRowIndex(e.row, t));
|
|
364
|
+
let a = i.selectable || i.tabbableRowId !== void 0 ? {
|
|
365
|
+
class: "focus-ring",
|
|
366
|
+
tabindex: Object.is(Te.value, e.key) ? 0 : -1,
|
|
367
|
+
onFocus: () => m("update:tabbableRowId", e.key),
|
|
368
|
+
onKeydown: (t) => we(t, e)
|
|
369
|
+
} : {};
|
|
370
|
+
return _(r, Ee(e, n), a);
|
|
371
|
+
}
|
|
372
|
+
return (n, r) => (y(), u("div", {
|
|
373
|
+
"data-slot": "data-table",
|
|
374
|
+
ref_key: "rootRef",
|
|
375
|
+
ref: M,
|
|
376
|
+
class: v(E(e)("data-table", i.class)),
|
|
377
|
+
"data-state": k.value,
|
|
378
|
+
"aria-busy": t.status === "loading" || void 0
|
|
379
|
+
}, [E(B) ? (y(), u(o, { key: 0 }, [t.status === "error" ? (y(), u("div", se, [S(n.$slots, "error", {}, () => [r[2] ||= f("Unable to load data", -1)])])) : t.status === "loading" && t.rows.length === 0 ? (y(), u("div", ce, [(y(!0), u(o, null, x(E(Y), (e) => (y(), u("div", {
|
|
380
|
+
key: "skel-card-" + e,
|
|
381
|
+
class: "data-table-card glass-quiet"
|
|
382
|
+
}, [p(E(U), { class: "data-table-card-skeleton-title" }), p(E(U), { class: "h-3 w-3/4" })]))), 128))])) : t.rows.length > 0 ? (y(), u("div", {
|
|
383
|
+
key: 2,
|
|
384
|
+
class: "data-table-cards",
|
|
385
|
+
role: t.selectable ? "listbox" : void 0,
|
|
386
|
+
"aria-label": t.selectable ? t.ariaLabel ?? "Rows" : void 0
|
|
387
|
+
}, [(y(!0), u(o, null, x(E(G), (t, i) => (y(), u("div", _({
|
|
388
|
+
key: t.key,
|
|
389
|
+
ref_for: !0,
|
|
390
|
+
ref: (e) => q(t, i, e)
|
|
391
|
+
}, { ref_for: !0 }, $(t, i, !0), { class: "data-table-card glass-quiet" }), [d("div", ue, [d("div", de, [E(H)?.component ? (y(), c(C(E(H).component), {
|
|
392
|
+
key: 0,
|
|
393
|
+
value: X(t.row, E(H).key),
|
|
394
|
+
row: t.row
|
|
395
|
+
}, null, 8, ["value", "row"])) : E(H) ? (y(), u(o, { key: 1 }, [f(w(Z(t.row, E(H))), 1)], 64)) : l("", !0)]), g.value ? (y(), u("div", {
|
|
396
|
+
key: 0,
|
|
397
|
+
class: "data-table-actions",
|
|
398
|
+
onClick: r[0] ||= j(() => {}, ["stop"])
|
|
399
|
+
}, [S(n.$slots, "row-actions", { row: t.row })])) : l("", !0)]), E(W).length > 0 ? (y(), u("dl", fe, [(y(!0), u(o, null, x(E(W), (n) => (y(), u(o, { key: n.key }, [d("dt", pe, w(n.label), 1), d("dd", {
|
|
400
|
+
class: v(E(e)("data-table-card-value", n.class)),
|
|
401
|
+
"data-align": n.align ?? "left"
|
|
402
|
+
}, [n.component ? (y(), c(C(n.component), {
|
|
403
|
+
key: 0,
|
|
404
|
+
value: X(t.row, n.key),
|
|
405
|
+
row: t.row
|
|
406
|
+
}, null, 8, ["value", "row"])) : (y(), u(o, { key: 1 }, [f(w(Z(t.row, n)), 1)], 64))], 10, me)], 64))), 128))])) : l("", !0)], 16))), 128))], 8, le)) : (y(), u("div", he, [t.filtered ? S(n.$slots, "filtered-empty", {}, () => [r[3] ||= f("No matching rows", -1)], void 0, 0) : S(n.$slots, "empty", {}, () => [r[4] ||= f("No rows yet", -1)], void 0, 1)]))], 64)) : (y(), c(E(P), {
|
|
407
|
+
key: 1,
|
|
408
|
+
role: T.value,
|
|
409
|
+
"aria-label": t.ariaLabel,
|
|
410
|
+
"aria-col-count": D.value,
|
|
411
|
+
"aria-row-count": O.value
|
|
412
|
+
}, {
|
|
413
|
+
default: A(() => [p(E(R), null, {
|
|
414
|
+
default: A(() => [p(E(z), {
|
|
415
|
+
class: "data-table-header-row",
|
|
416
|
+
"aria-rowindex": T.value === "grid" ? 1 : void 0
|
|
417
|
+
}, {
|
|
418
|
+
default: A(() => [(y(!0), u(o, null, x(t.columns, (e) => (y(), c(E(L), {
|
|
419
|
+
key: e.key,
|
|
420
|
+
class: v(e.headerClass),
|
|
421
|
+
"data-align": e.align ?? "left",
|
|
422
|
+
"aria-sort": be(e)
|
|
423
|
+
}, {
|
|
424
|
+
default: A(() => [e.sortable ? (y(), u("button", {
|
|
425
|
+
key: 0,
|
|
426
|
+
type: "button",
|
|
427
|
+
class: "data-table-sort focus-ring",
|
|
428
|
+
"data-align": e.align ?? "left",
|
|
429
|
+
onClick: (t) => ye(e)
|
|
430
|
+
}, [d("span", null, w(e.label), 1), d("span", _e, w(xe(e)), 1)], 8, ge)) : (y(), u(o, { key: 1 }, [f(w(e.label), 1)], 64))]),
|
|
431
|
+
_: 2
|
|
432
|
+
}, 1032, [
|
|
433
|
+
"class",
|
|
434
|
+
"data-align",
|
|
435
|
+
"aria-sort"
|
|
436
|
+
]))), 128)), g.value ? (y(), c(E(L), {
|
|
437
|
+
key: 0,
|
|
438
|
+
class: "data-table-actions-cell"
|
|
439
|
+
})) : l("", !0)]),
|
|
440
|
+
_: 1
|
|
441
|
+
}, 8, ["aria-rowindex"])]),
|
|
442
|
+
_: 1
|
|
443
|
+
}), p(E(F), null, {
|
|
444
|
+
default: A(() => [t.status === "error" ? (y(), c(E(V), {
|
|
445
|
+
key: 0,
|
|
446
|
+
colspan: t.columns.length + +!!g.value,
|
|
447
|
+
role: T.value === "grid" ? "presentation" : void 0
|
|
448
|
+
}, {
|
|
449
|
+
default: A(() => [d("span", ve, [S(n.$slots, "error", {}, () => [r[5] ||= f("Unable to load data", -1)])])]),
|
|
450
|
+
_: 3
|
|
451
|
+
}, 8, ["colspan", "role"])) : t.status === "loading" && t.rows.length === 0 ? (y(!0), u(o, { key: 1 }, x(E(Y), (e) => (y(), c(E(z), { key: "skel-" + e }, {
|
|
452
|
+
default: A(() => [(y(!0), u(o, null, x(t.columns, (e) => (y(), c(E(I), {
|
|
453
|
+
key: e.key,
|
|
454
|
+
"data-align": e.align ?? "left"
|
|
455
|
+
}, {
|
|
456
|
+
default: A(() => [p(E(U), { class: "data-table-cell-skeleton" })]),
|
|
457
|
+
_: 1
|
|
458
|
+
}, 8, ["data-align"]))), 128)), g.value ? (y(), c(E(I), {
|
|
459
|
+
key: 0,
|
|
460
|
+
class: "data-table-actions-cell"
|
|
461
|
+
}, {
|
|
462
|
+
default: A(() => [p(E(U), { class: "data-table-action-skeleton" })]),
|
|
463
|
+
_: 1
|
|
464
|
+
})) : l("", !0)]),
|
|
465
|
+
_: 1
|
|
466
|
+
}))), 128)) : t.rows.length > 0 ? (y(!0), u(o, { key: 2 }, x(E(G), (e, i) => (y(), c(E(z), _({
|
|
467
|
+
key: e.key,
|
|
468
|
+
ref_for: !0,
|
|
469
|
+
ref: (t) => q(e, i, t)
|
|
470
|
+
}, { ref_for: !0 }, $(e, i)), {
|
|
471
|
+
default: A(() => [(y(!0), u(o, null, x(t.columns, (t) => (y(), c(E(I), {
|
|
472
|
+
key: t.key,
|
|
473
|
+
class: v(t.class),
|
|
474
|
+
"data-align": t.align ?? "left"
|
|
475
|
+
}, {
|
|
476
|
+
default: A(() => [t.component ? (y(), c(C(t.component), {
|
|
477
|
+
key: 0,
|
|
478
|
+
value: X(e.row, t.key),
|
|
479
|
+
row: e.row
|
|
480
|
+
}, null, 8, ["value", "row"])) : (y(), u(o, { key: 1 }, [f(w(Z(e.row, t)), 1)], 64))]),
|
|
481
|
+
_: 2
|
|
482
|
+
}, 1032, ["class", "data-align"]))), 128)), g.value ? (y(), c(E(I), {
|
|
483
|
+
key: 0,
|
|
484
|
+
class: "data-table-actions-cell",
|
|
485
|
+
onClick: r[1] ||= j(() => {}, ["stop"])
|
|
486
|
+
}, {
|
|
487
|
+
default: A(() => [S(n.$slots, "row-actions", { row: e.row })]),
|
|
488
|
+
_: 2
|
|
489
|
+
}, 1024)) : l("", !0)]),
|
|
490
|
+
_: 2
|
|
491
|
+
}, 1040))), 128)) : (y(), c(E(V), {
|
|
492
|
+
key: 3,
|
|
493
|
+
colspan: t.columns.length + +!!g.value,
|
|
494
|
+
role: T.value === "grid" ? "presentation" : void 0
|
|
495
|
+
}, {
|
|
496
|
+
default: A(() => [t.filtered ? S(n.$slots, "filtered-empty", {}, () => [r[6] ||= f("No matching rows", -1)], void 0, 0) : S(n.$slots, "empty", {}, () => [r[7] ||= f("No rows yet", -1)], void 0, 1)]),
|
|
497
|
+
_: 3
|
|
498
|
+
}, 8, ["colspan", "role"]))]),
|
|
499
|
+
_: 3
|
|
500
|
+
})]),
|
|
501
|
+
_: 3
|
|
502
|
+
}, 8, [
|
|
503
|
+
"role",
|
|
504
|
+
"aria-label",
|
|
505
|
+
"aria-col-count",
|
|
506
|
+
"aria-row-count"
|
|
507
|
+
])), S(n.$slots, "sentinel")], 10, oe));
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
//#endregion
|
|
511
|
+
export { R as a, F as c, z as i, P as l, U as n, L as o, V as r, I as s, q as t };
|
package/dist/data-table.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "./data-table-
|
|
1
|
+
import { t as e } from "./data-table-Cs93-uY7.js";
|
|
2
2
|
export { e as DataTable };
|