@dazzadev/vuetify-datatable 1.2.0 → 1.2.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/README.md
CHANGED
|
@@ -275,7 +275,7 @@ If no configuration is provided, the component uses Material Design Icons (inclu
|
|
|
275
275
|
| `view-icon` | Custom view icon |
|
|
276
276
|
| `edit-icon` | Custom edit icon |
|
|
277
277
|
| `delete-icon` | Custom delete icon |
|
|
278
|
-
| `item.tfoot` | Table footer content
|
|
278
|
+
| `item.tfoot` | Table footer content. Receives `{ columns }`: the visible headers, in display order |
|
|
279
279
|
| `selection-actions` | Bar above the table, for bulk actions. Only rendered when `showSelect`. Receives `{ selected, count, clear }` |
|
|
280
280
|
|
|
281
281
|
## Peer Dependencies
|
|
@@ -85,7 +85,9 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
|
|
|
85
85
|
item: any;
|
|
86
86
|
}) => any;
|
|
87
87
|
} & {
|
|
88
|
-
'item.tfoot'?: (props: {
|
|
88
|
+
'item.tfoot'?: (props: {
|
|
89
|
+
columns: TableHeader[];
|
|
90
|
+
}) => any;
|
|
89
91
|
};
|
|
90
92
|
emit: (event: "onLoadData" | "editItem" | "deleteItem" | "viewItem" | "update:modelValue", ...args: any[]) => void;
|
|
91
93
|
}>) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Pe, computed as c, resolveComponent as f, openBlock as m, createBlock as k, withCtx as a, createVNode as r, createTextVNode as V, toDisplayString as g, renderSlot as C, createCommentVNode as N, inject as ot, ref as v, watch as z, nextTick as lt, onMounted as nt, onBeforeUnmount as at, createElementBlock as G, normalizeStyle as st, normalizeClass as $e, withDirectives as rt, createElementVNode as P, Fragment as it, renderList as Ie, withModifiers as le, withKeys as Le, mergeProps as H, vShow as dt, createSlots as ut, resolveDynamicComponent as
|
|
1
|
+
import { defineComponent as Pe, computed as c, resolveComponent as f, openBlock as m, createBlock as k, withCtx as a, createVNode as r, createTextVNode as V, toDisplayString as g, renderSlot as C, createCommentVNode as N, inject as ot, ref as v, watch as z, nextTick as lt, onMounted as nt, onBeforeUnmount as at, createElementBlock as G, normalizeStyle as st, normalizeClass as $e, withDirectives as rt, createElementVNode as P, Fragment as it, renderList as Ie, withModifiers as le, withKeys as Le, mergeProps as H, vShow as dt, createSlots as ut, resolveDynamicComponent as he } from "vue";
|
|
2
2
|
function ct(o) {
|
|
3
3
|
return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
|
|
4
4
|
}
|
|
@@ -135,7 +135,7 @@ function Mt(o) {
|
|
|
135
135
|
const gt = '.vdt{position:relative;min-width:0}.vdt-toolbar{display:flex;justify-content:flex-start;padding-bottom:8px}.vdt-body{position:relative}.vdt--pinned .v-table__wrapper>table>thead>tr>th:last-child,.vdt--pinned .v-table__wrapper>table>tbody>tr.v-data-table__tr>td:last-child{position:sticky;right:0;z-index:2;background:rgb(var(--v-theme-surface))}.vdt--pinned.vdt--can-right .v-table__wrapper>table>thead>tr>th:last-child,.vdt--pinned.vdt--can-right .v-table__wrapper>table>tbody>tr.v-data-table__tr>td:last-child{box-shadow:inset 1px 0 rgba(var(--v-border-color),var(--v-border-opacity)),-8px 0 12px -6px #00000026}.vdt-fade{position:absolute;top:var(--vdt-scroll-top, 0px);height:var(--vdt-scroll-h, 100%);width:56px;pointer-events:none;opacity:0;transition:opacity .2s;z-index:3}.vdt-fade--left{left:0;background:linear-gradient(to left,rgba(var(--v-theme-surface),0),rgb(var(--v-theme-surface)))}.vdt-fade--right{right:var(--vdt-pinned-w, 0px);background:linear-gradient(to right,rgba(var(--v-theme-surface),0),rgb(var(--v-theme-surface)))}.vdt--can-left .vdt-fade--left,.vdt--can-right .vdt-fade--right{opacity:1}.vdt-arrow{position:absolute;top:calc(var(--vdt-scroll-top, 0px) + var(--vdt-head-h, 48px) / 2 - 16px);z-index:4;display:flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:thin solid rgba(var(--v-border-color),var(--v-border-opacity));border-radius:50%;background:rgb(var(--v-theme-surface));color:rgb(var(--v-theme-primary));box-shadow:0 4px 12px #00000026;cursor:pointer}.vdt-arrow:focus-visible{outline:2px solid rgb(var(--v-theme-primary));outline-offset:2px}.vdt-arrow--left{left:8px}.vdt-arrow--right{right:calc(var(--vdt-pinned-w, 0px) + 8px)}.vdt-hint{position:absolute;top:calc(var(--vdt-scroll-top, 0px) + var(--vdt-head-h, 48px) / 2 - 24px);right:calc(var(--vdt-pinned-w, 0px) + 8px);z-index:5;transform:translateY(-100%);padding:5px 10px;border-radius:4px;background:rgb(var(--v-theme-surface-variant));color:rgb(var(--v-theme-on-surface-variant));font-size:12px;white-space:nowrap;pointer-events:none}.vdt-hint:after{content:"";position:absolute;top:100%;right:11px;border:5px solid transparent;border-top-color:rgb(var(--v-theme-surface-variant))}.vdt-columns__actions{display:flex;justify-content:space-between;margin:4px 0}.vdt-columns__list{max-height:320px;margin:0;padding:0;overflow-y:auto;list-style:none}.vdt-columns__item{display:flex;align-items:center;gap:4px;border-radius:4px}.vdt-columns__item--over{background:rgba(var(--v-theme-primary),.08)}.vdt-columns__handle{display:flex;padding:4px;border:0;border-radius:4px;background:none;color:rgba(var(--v-theme-on-surface),var(--v-medium-emphasis-opacity));cursor:grab}.vdt-columns__handle:focus-visible{outline:2px solid rgb(var(--v-theme-primary))}', bt = { class: "vdt-toolbar" }, yt = { class: "vdt-columns__actions" }, ht = { class: "vdt-columns__list" }, xt = ["onDragstart", "onDragover", "onDrop"], wt = ["aria-label", "title", "onKeydown"], Ct = ["aria-label"], kt = ["aria-label"], Vt = {
|
|
136
136
|
key: 2,
|
|
137
137
|
class: "vdt-hint"
|
|
138
|
-
}, ae = "actions", St = 300,
|
|
138
|
+
}, ae = "actions", St = 300, xe = 2, Tt = "vuetify-datatable:columns:", Bt = "svg:M16,5V18H21V5M4,18H9V5H4M10,18H15V5H10V18Z", Dt = "svg:M9,3H11V5H9V3M13,3H15V5H13V3M9,7H11V9H9V7M13,7H15V9H13V7M9,11H11V13H9V11M13,11H15V13H13V11M9,15H11V17H9V15M13,15H15V17H13V15M9,19H11V21H9V19M13,19H15V21H13V19Z", _t = "svg:M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z", $t = "svg:M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z", It = /* @__PURE__ */ Pe({
|
|
139
139
|
inheritAttrs: !1,
|
|
140
140
|
__name: "DataTable",
|
|
141
141
|
props: {
|
|
@@ -229,7 +229,7 @@ const gt = '.vdt{position:relative;min-width:0}.vdt-toolbar{display:flex;justify
|
|
|
229
229
|
}) : U.value;
|
|
230
230
|
}), j = c(() => K.value.filter((e) => x.value.includes(e.key)).length), Ae = c(
|
|
231
231
|
() => U.value.map((e) => ({ key: e.key, title: e.title ?? "", visible: !x.value.includes(e.key) }))
|
|
232
|
-
),
|
|
232
|
+
), we = c(() => d.headers.some((e) => e.key === ae)), de = c(() => {
|
|
233
233
|
const e = new Set(K.value.map((s) => s.key)), t = [...U.value], n = d.headers.map((s) => e.has(s.key) ? t.shift() : s);
|
|
234
234
|
return [
|
|
235
235
|
...n.filter((s) => s.key !== ae && !x.value.includes(s.key)),
|
|
@@ -250,31 +250,31 @@ const gt = '.vdt{position:relative;min-width:0}.vdt-toolbar{display:flex;justify
|
|
|
250
250
|
function Se() {
|
|
251
251
|
A.value = [], x.value = [];
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function ue(e, t) {
|
|
254
254
|
const n = U.value.map((w) => w.key), s = n.indexOf(e), B = n.indexOf(t);
|
|
255
255
|
s === -1 || B === -1 || s === B || (n.splice(B, 0, ...n.splice(s, 1)), A.value = n);
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function ce(e, t) {
|
|
258
258
|
const n = U.value.map((B) => B.key), s = n[n.indexOf(e) + t];
|
|
259
|
-
s &&
|
|
259
|
+
s && ue(e, s);
|
|
260
260
|
}
|
|
261
261
|
function ze(e, t) {
|
|
262
262
|
var n;
|
|
263
263
|
J.value = t, (n = e.dataTransfer) == null || n.setData("text/plain", t);
|
|
264
264
|
}
|
|
265
265
|
function Ne(e) {
|
|
266
|
-
J.value &&
|
|
266
|
+
J.value && ue(J.value, e), Te();
|
|
267
267
|
}
|
|
268
268
|
function Te() {
|
|
269
269
|
J.value = null, X.value = null;
|
|
270
270
|
}
|
|
271
|
-
const
|
|
271
|
+
const ve = c(() => {
|
|
272
272
|
var t;
|
|
273
273
|
const e = Tt + K.value.map((n) => n.key).sort().join(",");
|
|
274
274
|
return ((t = i.storageKey) == null ? void 0 : t.call(i, e)) ?? e;
|
|
275
275
|
});
|
|
276
276
|
z(
|
|
277
|
-
|
|
277
|
+
ve,
|
|
278
278
|
(e) => {
|
|
279
279
|
try {
|
|
280
280
|
const t = JSON.parse(localStorage.getItem(e) ?? "null");
|
|
@@ -286,27 +286,27 @@ const gt = '.vdt{position:relative;min-width:0}.vdt-toolbar{display:flex;justify
|
|
|
286
286
|
{ immediate: !0 }
|
|
287
287
|
), z([A, x], ([e, t]) => {
|
|
288
288
|
try {
|
|
289
|
-
e.length || t.length ? localStorage.setItem(
|
|
289
|
+
e.length || t.length ? localStorage.setItem(ve.value, JSON.stringify({ order: e, hidden: t })) : localStorage.removeItem(ve.value);
|
|
290
290
|
} catch {
|
|
291
291
|
}
|
|
292
292
|
});
|
|
293
|
-
const
|
|
293
|
+
const me = v(null), fe = v(null), Q = v(!1), pe = v(!1), ee = v(!1), ge = v(!1), Be = v({});
|
|
294
294
|
let q = null;
|
|
295
|
-
const Ke = c(() => Q.value || j.value > 0 || re.value), De = c(() => ee.value && !
|
|
296
|
-
"vdt--pinned":
|
|
297
|
-
"vdt--can-left":
|
|
295
|
+
const Ke = c(() => Q.value || j.value > 0 || re.value), De = c(() => ee.value && !ge.value), Ue = c(() => ({
|
|
296
|
+
"vdt--pinned": we.value,
|
|
297
|
+
"vdt--can-left": pe.value,
|
|
298
298
|
"vdt--can-right": ee.value
|
|
299
299
|
}));
|
|
300
|
-
function
|
|
300
|
+
function be() {
|
|
301
301
|
var e;
|
|
302
|
-
return ((e =
|
|
302
|
+
return ((e = fe.value) == null ? void 0 : e.querySelector(".v-table__wrapper")) ?? null;
|
|
303
303
|
}
|
|
304
304
|
function te() {
|
|
305
|
-
const e =
|
|
305
|
+
const e = fe.value, t = be();
|
|
306
306
|
if (!e || !t) return;
|
|
307
307
|
const n = t.scrollWidth - t.clientWidth;
|
|
308
|
-
Q.value = n >
|
|
309
|
-
const s =
|
|
308
|
+
Q.value = n > xe, pe.value = Q.value && t.scrollLeft > xe, ee.value = Q.value && t.scrollLeft < n - xe;
|
|
309
|
+
const s = we.value ? t.querySelector("thead > tr > th:last-child") : null, B = t.querySelector("thead"), w = t.getBoundingClientRect();
|
|
310
310
|
Be.value = {
|
|
311
311
|
"--vdt-pinned-w": `${(s == null ? void 0 : s.offsetWidth) ?? 0}px`,
|
|
312
312
|
"--vdt-scroll-top": `${w.top - e.getBoundingClientRect().top}px`,
|
|
@@ -315,18 +315,18 @@ const gt = '.vdt{position:relative;min-width:0}.vdt-toolbar{display:flex;justify
|
|
|
315
315
|
};
|
|
316
316
|
}
|
|
317
317
|
function je(e) {
|
|
318
|
-
const t =
|
|
319
|
-
!t || e.target !== t || (t.scrollLeft > 10 && (
|
|
318
|
+
const t = be();
|
|
319
|
+
!t || e.target !== t || (t.scrollLeft > 10 && (ge.value = !0), te());
|
|
320
320
|
}
|
|
321
321
|
function _e(e) {
|
|
322
322
|
var t;
|
|
323
|
-
e === 1 && (
|
|
323
|
+
e === 1 && (ge.value = !0), (t = be()) == null || t.scrollBy({ left: e * St, behavior: "smooth" });
|
|
324
324
|
}
|
|
325
|
-
z([
|
|
325
|
+
z([de, () => d.items, () => d.loading], () => lt(te)), nt(() => {
|
|
326
326
|
F({
|
|
327
327
|
page: Z.value,
|
|
328
328
|
itemsPerPage: R.value
|
|
329
|
-
}), typeof ResizeObserver < "u" &&
|
|
329
|
+
}), typeof ResizeObserver < "u" && me.value && (q = new ResizeObserver(() => requestAnimationFrame(te)), q.observe(me.value)), te();
|
|
330
330
|
}), at(() => q == null ? void 0 : q.disconnect());
|
|
331
331
|
const qe = (e) => {
|
|
332
332
|
se.value = e, W.value = !0;
|
|
@@ -381,7 +381,7 @@ const gt = '.vdt{position:relative;min-width:0}.vdt-toolbar{display:flex;justify
|
|
|
381
381
|
const n = f("v-btn"), s = f("v-text-field"), B = f("v-checkbox-btn"), w = f("v-icon"), Xe = f("v-card-text"), Qe = f("v-card"), et = f("v-menu"), oe = f("v-tooltip"), tt = f("v-data-table-server");
|
|
382
382
|
return m(), G("div", {
|
|
383
383
|
ref_key: "rootRef",
|
|
384
|
-
ref:
|
|
384
|
+
ref: me,
|
|
385
385
|
class: $e(["vdt", Ue.value]),
|
|
386
386
|
style: st(Be.value)
|
|
387
387
|
}, [
|
|
@@ -393,8 +393,8 @@ const gt = '.vdt{position:relative;min-width:0}.vdt-toolbar{display:flex;justify
|
|
|
393
393
|
setVisible: ke,
|
|
394
394
|
toggleAll: Ve,
|
|
395
395
|
reset: Se,
|
|
396
|
-
move:
|
|
397
|
-
place:
|
|
396
|
+
move: ce,
|
|
397
|
+
place: ue
|
|
398
398
|
}, () => [
|
|
399
399
|
r(et, {
|
|
400
400
|
modelValue: re.value,
|
|
@@ -480,8 +480,8 @@ const gt = '.vdt{position:relative;min-width:0}.vdt-toolbar{display:flex;justify
|
|
|
480
480
|
"aria-label": `${T("moveColumn")}: ${l.title}`,
|
|
481
481
|
title: T("moveColumn"),
|
|
482
482
|
onKeydown: [
|
|
483
|
-
Le(le((u) =>
|
|
484
|
-
Le(le((u) =>
|
|
483
|
+
Le(le((u) => ce(l.key, -1), ["prevent"]), ["up"]),
|
|
484
|
+
Le(le((u) => ce(l.key, 1), ["prevent"]), ["down"])
|
|
485
485
|
]
|
|
486
486
|
}, [
|
|
487
487
|
r(w, {
|
|
@@ -506,12 +506,12 @@ const gt = '.vdt{position:relative;min-width:0}.vdt-toolbar{display:flex;justify
|
|
|
506
506
|
]),
|
|
507
507
|
P("div", {
|
|
508
508
|
ref_key: "bodyRef",
|
|
509
|
-
ref:
|
|
509
|
+
ref: fe,
|
|
510
510
|
class: "vdt-body",
|
|
511
511
|
onScrollCapturePassive: je
|
|
512
512
|
}, [
|
|
513
513
|
r(tt, H(e.$attrs, {
|
|
514
|
-
headers:
|
|
514
|
+
headers: de.value,
|
|
515
515
|
items: o.items,
|
|
516
516
|
loading: o.loading,
|
|
517
517
|
"items-length": o.totalItems,
|
|
@@ -537,7 +537,7 @@ const gt = '.vdt{position:relative;min-width:0}.vdt-toolbar{display:flex;justify
|
|
|
537
537
|
toggleExpand: D
|
|
538
538
|
}, () => [
|
|
539
539
|
r(n, {
|
|
540
|
-
onClick: (
|
|
540
|
+
onClick: (ye) => D(l),
|
|
541
541
|
rounded: ""
|
|
542
542
|
}, {
|
|
543
543
|
default: a(() => [
|
|
@@ -570,13 +570,13 @@ const gt = '.vdt{position:relative;min-width:0}.vdt-toolbar{display:flex;justify
|
|
|
570
570
|
r(n, H({
|
|
571
571
|
icon: "",
|
|
572
572
|
flat: "",
|
|
573
|
-
onClick: (
|
|
573
|
+
onClick: (ye) => Ye(l)
|
|
574
574
|
}, u, {
|
|
575
575
|
disabled: (D = o.disableView) == null ? void 0 : D.call(o, l)
|
|
576
576
|
}), {
|
|
577
577
|
default: a(() => [
|
|
578
578
|
C(e.$slots, "view-icon", {}, () => [
|
|
579
|
-
S(L.value) ? (m(), k(
|
|
579
|
+
S(L.value) ? (m(), k(he(L.value), H({
|
|
580
580
|
key: 0,
|
|
581
581
|
size: 20,
|
|
582
582
|
class: "text-info"
|
|
@@ -608,13 +608,13 @@ const gt = '.vdt{position:relative;min-width:0}.vdt-toolbar{display:flex;justify
|
|
|
608
608
|
r(n, H({
|
|
609
609
|
icon: "",
|
|
610
610
|
flat: "",
|
|
611
|
-
onClick: (
|
|
611
|
+
onClick: (ye) => Ge(l)
|
|
612
612
|
}, u, {
|
|
613
613
|
disabled: (D = o.disableEdit) == null ? void 0 : D.call(o, l)
|
|
614
614
|
}), {
|
|
615
615
|
default: a(() => [
|
|
616
616
|
C(e.$slots, "edit-icon", {}, () => [
|
|
617
|
-
S(h.value) ? (m(), k(
|
|
617
|
+
S(h.value) ? (m(), k(he(h.value), H({
|
|
618
618
|
key: 0,
|
|
619
619
|
size: 20,
|
|
620
620
|
class: "text-primary"
|
|
@@ -646,13 +646,13 @@ const gt = '.vdt{position:relative;min-width:0}.vdt-toolbar{display:flex;justify
|
|
|
646
646
|
r(n, H({
|
|
647
647
|
icon: "",
|
|
648
648
|
flat: "",
|
|
649
|
-
onClick: (
|
|
649
|
+
onClick: (ye) => qe(l)
|
|
650
650
|
}, u, {
|
|
651
651
|
disabled: (D = o.disableDelete) == null ? void 0 : D.call(o, l)
|
|
652
652
|
}), {
|
|
653
653
|
default: a(() => [
|
|
654
654
|
C(e.$slots, "delete-icon", {}, () => [
|
|
655
|
-
S(M.value) ? (m(), k(
|
|
655
|
+
S(M.value) ? (m(), k(he(M.value), H({
|
|
656
656
|
key: 0,
|
|
657
657
|
size: 20,
|
|
658
658
|
class: "text-error"
|
|
@@ -678,7 +678,7 @@ const gt = '.vdt{position:relative;min-width:0}.vdt-toolbar{display:flex;justify
|
|
|
678
678
|
]),
|
|
679
679
|
tfoot: a(() => [
|
|
680
680
|
P("tfoot", null, [
|
|
681
|
-
C(e.$slots, "item.tfoot")
|
|
681
|
+
C(e.$slots, "item.tfoot", { columns: de.value })
|
|
682
682
|
])
|
|
683
683
|
]),
|
|
684
684
|
_: 2
|
|
@@ -705,7 +705,7 @@ const gt = '.vdt{position:relative;min-width:0}.vdt-toolbar{display:flex;justify
|
|
|
705
705
|
]), 1040, ["headers", "items", "loading", "items-length", "items-per-page", "search", "sort-by", "page", "item-value", "show-expand", "show-select", "select-strategy", "modelValue", "class"]),
|
|
706
706
|
t[9] || (t[9] = P("div", { class: "vdt-fade vdt-fade--left" }, null, -1)),
|
|
707
707
|
t[10] || (t[10] = P("div", { class: "vdt-fade vdt-fade--right" }, null, -1)),
|
|
708
|
-
|
|
708
|
+
pe.value ? (m(), G("button", {
|
|
709
709
|
key: 0,
|
|
710
710
|
type: "button",
|
|
711
711
|
class: "vdt-arrow vdt-arrow--left",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(v,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(v=typeof globalThis<"u"?globalThis:v||self,e(v.VuetifyDatatable={},v.Vue))})(this,(function(v,e){"use strict";function be(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var L={exports:{}},re;function xe(){if(re)return L.exports;re=1;function l(C,w=100,k={}){if(typeof C!="function")throw new TypeError(`Expected the first parameter to be a function, got \`${typeof C}\`.`);if(w<0)throw new RangeError("`wait` must not be negative.");const{immediate:m}=typeof k=="boolean"?{immediate:k}:k;let i,u,s,V,p;function B(){const g=i,N=u;return i=void 0,u=void 0,p=C.apply(g,N),p}function S(){const g=Date.now()-V;g<w&&g>=0?s=setTimeout(S,w-g):(s=void 0,m||(p=B()))}const d=function(...g){if(i&&this!==i&&Object.getPrototypeOf(this)===Object.getPrototypeOf(i))throw new Error("Debounced method called with different contexts of the same prototype.");i=this,u=g,V=Date.now();const N=m&&!s;return s||(s=setTimeout(S,w)),N&&(p=B()),p};return Object.defineProperty(d,"isPending",{get(){return s!==void 0}}),d.clear=()=>{s&&(clearTimeout(s),s=void 0)},d.flush=()=>{s&&d.trigger()},d.trigger=()=>{p=B(),d.clear()},d}return L.exports.debounce=l,L.exports=l,L.exports}var ve=xe();const Ce=be(ve),we=e.defineComponent({__name:"ConfirmationModal",props:{show:Boolean,title:String,description:String,confirmButtonText:String,cancelButtonText:String},emits:["close","confirm"],setup(l){const C=l,w=e.computed({get:()=>C.show,set:()=>{}});return(k,m)=>{const i=e.resolveComponent("v-card-title"),u=e.resolveComponent("v-card-text"),s=e.resolveComponent("v-spacer"),V=e.resolveComponent("v-btn"),p=e.resolveComponent("v-card-actions"),B=e.resolveComponent("v-card"),S=e.resolveComponent("v-dialog");return e.openBlock(),e.createBlock(S,{modelValue:w.value,"onUpdate:modelValue":m[2]||(m[2]=d=>w.value=d),"max-width":"500px",persistent:"","no-click-animation":""},{default:e.withCtx(()=>[e.createVNode(B,null,{default:e.withCtx(()=>[e.createVNode(i,{class:"text-h5 text-center py-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.title),1)]),_:1}),l.description?(e.openBlock(),e.createBlock(u,{key:0,class:"text-center px-0 py-0"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.description)+" ",1),e.renderSlot(k.$slots,"description")]),_:3})):e.createCommentVNode("",!0),e.createVNode(p,null,{default:e.withCtx(()=>[e.createVNode(s),e.createVNode(V,{color:"error",variant:"flat",dark:"",onClick:m[0]||(m[0]=d=>k.$emit("close"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.cancelButtonText),1)]),_:1}),e.createVNode(V,{color:"success",variant:"flat",dark:"",onClick:m[1]||(m[1]=d=>k.$emit("confirm"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.confirmButtonText),1)]),_:1}),e.createVNode(s)]),_:1})]),_:3})]),_:3},8,["modelValue"])}}}),F=Symbol("DataTableConfig");function ke(l){return{install(C){C.provide(F,l)}}}const Ve='.vdt{position:relative;min-width:0}.vdt-toolbar{display:flex;justify-content:flex-start;padding-bottom:8px}.vdt-body{position:relative}.vdt--pinned .v-table__wrapper>table>thead>tr>th:last-child,.vdt--pinned .v-table__wrapper>table>tbody>tr.v-data-table__tr>td:last-child{position:sticky;right:0;z-index:2;background:rgb(var(--v-theme-surface))}.vdt--pinned.vdt--can-right .v-table__wrapper>table>thead>tr>th:last-child,.vdt--pinned.vdt--can-right .v-table__wrapper>table>tbody>tr.v-data-table__tr>td:last-child{box-shadow:inset 1px 0 rgba(var(--v-border-color),var(--v-border-opacity)),-8px 0 12px -6px #00000026}.vdt-fade{position:absolute;top:var(--vdt-scroll-top, 0px);height:var(--vdt-scroll-h, 100%);width:56px;pointer-events:none;opacity:0;transition:opacity .2s;z-index:3}.vdt-fade--left{left:0;background:linear-gradient(to left,rgba(var(--v-theme-surface),0),rgb(var(--v-theme-surface)))}.vdt-fade--right{right:var(--vdt-pinned-w, 0px);background:linear-gradient(to right,rgba(var(--v-theme-surface),0),rgb(var(--v-theme-surface)))}.vdt--can-left .vdt-fade--left,.vdt--can-right .vdt-fade--right{opacity:1}.vdt-arrow{position:absolute;top:calc(var(--vdt-scroll-top, 0px) + var(--vdt-head-h, 48px) / 2 - 16px);z-index:4;display:flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:thin solid rgba(var(--v-border-color),var(--v-border-opacity));border-radius:50%;background:rgb(var(--v-theme-surface));color:rgb(var(--v-theme-primary));box-shadow:0 4px 12px #00000026;cursor:pointer}.vdt-arrow:focus-visible{outline:2px solid rgb(var(--v-theme-primary));outline-offset:2px}.vdt-arrow--left{left:8px}.vdt-arrow--right{right:calc(var(--vdt-pinned-w, 0px) + 8px)}.vdt-hint{position:absolute;top:calc(var(--vdt-scroll-top, 0px) + var(--vdt-head-h, 48px) / 2 - 24px);right:calc(var(--vdt-pinned-w, 0px) + 8px);z-index:5;transform:translateY(-100%);padding:5px 10px;border-radius:4px;background:rgb(var(--v-theme-surface-variant));color:rgb(var(--v-theme-on-surface-variant));font-size:12px;white-space:nowrap;pointer-events:none}.vdt-hint:after{content:"";position:absolute;top:100%;right:11px;border:5px solid transparent;border-top-color:rgb(var(--v-theme-surface-variant))}.vdt-columns__actions{display:flex;justify-content:space-between;margin:4px 0}.vdt-columns__list{max-height:320px;margin:0;padding:0;overflow-y:auto;list-style:none}.vdt-columns__item{display:flex;align-items:center;gap:4px;border-radius:4px}.vdt-columns__item--over{background:rgba(var(--v-theme-primary),.08)}.vdt-columns__handle{display:flex;padding:4px;border:0;border-radius:4px;background:none;color:rgba(var(--v-theme-on-surface),var(--v-medium-emphasis-opacity));cursor:grab}.vdt-columns__handle:focus-visible{outline:2px solid rgb(var(--v-theme-primary))}',Be={class:"vdt-toolbar"},Se={class:"vdt-columns__actions"},Ne={class:"vdt-columns__list"},Te=["onDragstart","onDragover","onDrop"],De=["aria-label","title","onKeydown"],_e=["aria-label"],Ee=["aria-label"],Pe={key:2,class:"vdt-hint"},I="actions",Me=300,G=2,$e="vuetify-datatable:columns:",Le="svg:M16,5V18H21V5M4,18H9V5H4M10,18H15V5H10V18Z",Ie="svg:M9,3H11V5H9V3M13,3H15V5H13V3M9,7H11V9H9V7M13,7H15V9H13V7M9,11H11V13H9V11M13,11H15V13H13V11M9,15H11V17H9V15M13,15H15V17H13V15M9,19H11V21H9V19M13,19H15V21H13V19Z",He="svg:M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z",Oe="svg:M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z",se=e.defineComponent({inheritAttrs:!1,__name:"DataTable",props:{tableClass:{},headers:{default:()=>[]},items:{default:()=>[]},loading:{type:Boolean,default:!1},itemValue:{default:"id"},totalItems:{default:0},itemsPerPage:{default:10},search:{},showExpand:{type:Boolean,default:!1},showSelect:{type:Boolean,default:!1},selectStrategy:{default:"page"},modelValue:{default:()=>[]},showEditButton:{type:Boolean,default:!0},showDeleteButton:{type:Boolean,default:!0},showViewButton:{type:Boolean,default:!1},viewButtonText:{},deleteButtonText:{},deleteModalTitle:{},deleteModalMessage:{},deleteModalConfirmButtonText:{},deleteModalCancelButtonText:{},editButtonText:{},viewIcon:{},editIcon:{},deleteIcon:{},disableView:{},disableEdit:{},disableDelete:{}},emits:["onLoadData","editItem","deleteItem","viewItem","update:modelValue"],setup(l,{emit:C}){function w(){if(typeof document>"u"||document.getElementById("vuetify-datatable-styles"))return;const t=document.createElement("style");t.id="vuetify-datatable-styles",t.textContent=Ve,document.head.appendChild(t)}w();const k=[I,"expanded-row","data-table-expand","data-table-select"],m={columns:"Columns",hiddenColumns:t=>`Columns · ${t} hidden`,searchColumns:"Search columns",showAllColumns:"Show all",hideAllColumns:"Hide all",resetColumns:"Reset",moveColumn:"Drag or use the arrow keys to reorder",scrollHint:"Scroll to see more columns",scrollLeft:"Previous columns",scrollRight:"More columns"},i=l,u=C,s=e.inject(F,{icons:{}}),V=e.computed(()=>{var t;return i.viewIcon??((t=s.icons)==null?void 0:t.view)??"mdi-eye-outline"}),p=e.computed(()=>{var t;return i.editIcon??((t=s.icons)==null?void 0:t.edit)??"mdi-pencil-outline"}),B=e.computed(()=>{var t;return i.deleteIcon??((t=s.icons)==null?void 0:t.delete)??"mdi-trash-can-outline"}),S=e.computed(()=>s.iconProps??{}),d=e.computed(()=>i.tableClass??s.tableClass??"border rounded-md");function g(t){return typeof t!="string"}const N=e.computed({get:()=>i.modelValue,set:t=>u("update:modelValue",t)});function Re(){u("update:modelValue",[])}const T=e.ref(i.itemsPerPage),H=e.ref([]),O=e.ref(1),Y=e.ref(null),A=e.ref(!1),ze=e.computed(()=>{var t;return((t=i.headers)==null?void 0:t.filter(o=>o.key!=="actions"&&o.key!=="expanded-row"&&o.key!=="data-table-expand"))||[]});function y(t){var a;const o=((a=s.texts)==null?void 0:a[t])??m[t];return typeof o=="function"?o():o}const Z=e.ref(!1),W=e.ref(""),D=e.ref([]),f=e.ref([]),R=e.ref(null),z=e.ref(null),_=e.computed(()=>i.headers.filter(t=>!k.includes(t.key)&&!!t.title)),E=e.computed(()=>{const t=new Map(_.value.map(a=>[a.key,a]));return[...D.value.filter(a=>t.has(a)).map(a=>t.get(a)),..._.value.filter(a=>!D.value.includes(a.key))]}),Ke=e.computed(()=>{const t=(W.value??"").trim().toLowerCase();return t?E.value.filter(o=>{var a;return(a=o.title)==null?void 0:a.toLowerCase().includes(t)}):E.value}),P=e.computed(()=>_.value.filter(t=>f.value.includes(t.key)).length),je=e.computed(()=>E.value.map(t=>({key:t.key,title:t.title??"",visible:!f.value.includes(t.key)}))),ie=e.computed(()=>i.headers.some(t=>t.key===I)),ce=e.computed(()=>{const t=new Set(_.value.map(r=>r.key)),o=[...E.value],a=i.headers.map(r=>t.has(r.key)?o.shift():r);return[...a.filter(r=>r.key!==I&&!f.value.includes(r.key)),...a.filter(r=>r.key===I)]}),de=e.computed(()=>{var t;return P.value>0?(((t=s.texts)==null?void 0:t.hiddenColumns)??m.hiddenColumns)(P.value):y("columns")});function me(t,o){f.value=o?f.value.filter(a=>a!==t):[...f.value,t]}function ue(){f.value=P.value===0?_.value.map(t=>t.key):[]}function pe(){D.value=[],f.value=[]}function J(t,o){const a=E.value.map(h=>h.key),r=a.indexOf(t),b=a.indexOf(o);r===-1||b===-1||r===b||(a.splice(b,0,...a.splice(r,1)),D.value=a)}function X(t,o){const a=E.value.map(b=>b.key),r=a[a.indexOf(t)+o];r&&J(t,r)}function Ue(t,o){var a;R.value=o,(a=t.dataTransfer)==null||a.setData("text/plain",o)}function qe(t){R.value&&J(R.value,t),fe()}function fe(){R.value=null,z.value=null}const Q=e.computed(()=>{var o;const t=$e+_.value.map(a=>a.key).sort().join(",");return((o=s.storageKey)==null?void 0:o.call(s,t))??t});e.watch(Q,t=>{try{const o=JSON.parse(localStorage.getItem(t)??"null");D.value=Array.isArray(o==null?void 0:o.order)?o.order:[],f.value=Array.isArray(o==null?void 0:o.hidden)?o.hidden:[]}catch{D.value=[],f.value=[]}},{immediate:!0}),e.watch([D,f],([t,o])=>{try{t.length||o.length?localStorage.setItem(Q.value,JSON.stringify({order:t,hidden:o})):localStorage.removeItem(Q.value)}catch{}});const ee=e.ref(null),te=e.ref(null),K=e.ref(!1),oe=e.ref(!1),j=e.ref(!1),le=e.ref(!1),he=e.ref({});let M=null;const Fe=e.computed(()=>K.value||P.value>0||Z.value),ge=e.computed(()=>j.value&&!le.value),Ge=e.computed(()=>({"vdt--pinned":ie.value,"vdt--can-left":oe.value,"vdt--can-right":j.value}));function ne(){var t;return((t=te.value)==null?void 0:t.querySelector(".v-table__wrapper"))??null}function U(){const t=te.value,o=ne();if(!t||!o)return;const a=o.scrollWidth-o.clientWidth;K.value=a>G,oe.value=K.value&&o.scrollLeft>G,j.value=K.value&&o.scrollLeft<a-G;const r=ie.value?o.querySelector("thead > tr > th:last-child"):null,b=o.querySelector("thead"),h=o.getBoundingClientRect();he.value={"--vdt-pinned-w":`${(r==null?void 0:r.offsetWidth)??0}px`,"--vdt-scroll-top":`${h.top-t.getBoundingClientRect().top}px`,"--vdt-scroll-h":`${h.height}px`,"--vdt-head-h":`${(b==null?void 0:b.offsetHeight)??48}px`}}function Ye(t){const o=ne();!o||t.target!==o||(o.scrollLeft>10&&(le.value=!0),U())}function ye(t){var o;t===1&&(le.value=!0),(o=ne())==null||o.scrollBy({left:t*Me,behavior:"smooth"})}e.watch([ce,()=>i.items,()=>i.loading],()=>e.nextTick(U)),e.onMounted(()=>{$({page:O.value,itemsPerPage:T.value}),typeof ResizeObserver<"u"&&ee.value&&(M=new ResizeObserver(()=>requestAnimationFrame(U)),M.observe(ee.value)),U()}),e.onBeforeUnmount(()=>M==null?void 0:M.disconnect());const Ze=t=>{Y.value=t,A.value=!0},We=()=>{Y.value=null,A.value=!1},Je=t=>{u("editItem",t)},Xe=t=>{u("viewItem",t)},Qe=()=>{u("deleteItem",Y.value),A.value=!1},$=({page:t,itemsPerPage:o})=>{const a=H.value.map(r=>({column:r.key,direction:r.order}));u("onLoadData",{page:t,itemsPerPage:o,search:i.search,sortBy:a})};function et(){$({page:1,itemsPerPage:T.value})}const tt=Ce(et,400);return e.watch(()=>i.search,(t,o)=>{t!==o&&tt()}),e.watch(T,(t,o)=>{t!==o&&$({page:1,itemsPerPage:t})}),e.watch(H,()=>{$({page:1,itemsPerPage:T.value})}),e.watch(O,t=>{$({page:t,itemsPerPage:T.value})}),(t,o)=>{const a=e.resolveComponent("v-btn"),r=e.resolveComponent("v-text-field"),b=e.resolveComponent("v-checkbox-btn"),h=e.resolveComponent("v-icon"),ot=e.resolveComponent("v-card-text"),lt=e.resolveComponent("v-card"),nt=e.resolveComponent("v-menu"),q=e.resolveComponent("v-tooltip"),at=e.resolveComponent("v-data-table-server");return e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:ee,class:e.normalizeClass(["vdt",Ge.value]),style:e.normalizeStyle(he.value)},[e.withDirectives(e.createElementVNode("div",Be,[e.renderSlot(t.$slots,"column-chooser",{columns:je.value,hiddenCount:P.value,label:de.value,setVisible:me,toggleAll:ue,reset:pe,move:X,place:J},()=>[e.createVNode(nt,{modelValue:Z.value,"onUpdate:modelValue":o[2]||(o[2]=n=>Z.value=n),"close-on-content-click":!1,location:"bottom start"},{activator:e.withCtx(({props:n})=>[e.createVNode(a,e.mergeProps(n,{class:"vdt-columns__button",variant:"outlined",color:"primary",size:"small","prepend-icon":Le}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(de.value),1)]),_:1},16)]),default:e.withCtx(()=>[e.createVNode(lt,{class:"vdt-columns","min-width":"280"},{default:e.withCtx(()=>[e.createVNode(ot,{class:"pa-3"},{default:e.withCtx(()=>[e.createVNode(r,{modelValue:W.value,"onUpdate:modelValue":o[0]||(o[0]=n=>W.value=n),placeholder:y("searchColumns"),density:"compact",variant:"outlined","hide-details":"",clearable:""},null,8,["modelValue","placeholder"]),e.createElementVNode("div",Se,[e.createVNode(a,{variant:"text",size:"small",color:"primary",onClick:ue},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(P.value===0?y("hideAllColumns"):y("showAllColumns")),1)]),_:1}),e.createVNode(a,{variant:"text",size:"small",onClick:pe},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y("resetColumns")),1)]),_:1})]),e.createElementVNode("ul",Ne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value,n=>(e.openBlock(),e.createElementBlock("li",{key:n.key,class:e.normalizeClass(["vdt-columns__item",{"vdt-columns__item--over":z.value===n.key}]),draggable:"true",onDragstart:c=>Ue(c,n.key),onDragover:e.withModifiers(c=>z.value=n.key,["prevent"]),onDragleave:o[1]||(o[1]=c=>z.value=null),onDrop:e.withModifiers(c=>qe(n.key),["prevent"]),onDragend:fe},[e.createVNode(b,{"model-value":!f.value.includes(n.key),label:n.title,density:"compact",class:"flex-grow-1","onUpdate:modelValue":c=>me(n.key,!!c)},null,8,["model-value","label","onUpdate:modelValue"]),e.createElementVNode("button",{type:"button",class:"vdt-columns__handle","aria-label":`${y("moveColumn")}: ${n.title}`,title:y("moveColumn"),onKeydown:[e.withKeys(e.withModifiers(c=>X(n.key,-1),["prevent"]),["up"]),e.withKeys(e.withModifiers(c=>X(n.key,1),["prevent"]),["down"])]},[e.createVNode(h,{icon:Ie,size:"18"})],40,De)],42,Te))),128))])]),_:1})]),_:1})]),_:1},8,["modelValue"])])],512),[[e.vShow,Fe.value]]),e.createElementVNode("div",{ref_key:"bodyRef",ref:te,class:"vdt-body",onScrollCapturePassive:Ye},[e.createVNode(at,e.mergeProps(t.$attrs,{headers:ce.value,items:l.items,loading:l.loading,"items-length":l.totalItems,"items-per-page":T.value,"onUpdate:itemsPerPage":o[3]||(o[3]=n=>T.value=n),search:l.search,"sort-by":H.value,"onUpdate:sortBy":o[4]||(o[4]=n=>H.value=n),page:O.value,"onUpdate:page":o[5]||(o[5]=n=>O.value=n),"item-value":l.itemValue,"show-expand":l.showExpand,"show-select":l.showSelect,"select-strategy":l.selectStrategy,modelValue:N.value,"onUpdate:modelValue":o[6]||(o[6]=n=>N.value=n),class:d.value}),e.createSlots({"item.data-table-expand":e.withCtx(({internalItem:n,isExpanded:c,toggleExpand:x})=>[e.renderSlot(t.$slots,"item.data-table-expand",{internalItem:n,isExpanded:c,toggleExpand:x},()=>[e.createVNode(a,{onClick:ae=>x(n),rounded:""},{default:e.withCtx(()=>[e.createVNode(h,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c(n)?"mdi-chevron-up":"mdi-chevron-down"),1)]),_:2},1024)]),_:2},1032,["onClick"])])]),"expanded-row":e.withCtx(({columns:n,item:c})=>[e.renderSlot(t.$slots,"expanded-row",{columns:n,item:c})]),"item.actions":e.withCtx(({item:n})=>[e.renderSlot(t.$slots,"before-actions",{item:n}),l.showViewButton?(e.openBlock(),e.createBlock(q,{key:0,text:l.viewButtonText},{activator:e.withCtx(({props:c})=>{var x;return[e.createVNode(a,e.mergeProps({icon:"",flat:"",onClick:ae=>Xe(n)},c,{disabled:(x=l.disableView)==null?void 0:x.call(l,n)}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"view-icon",{},()=>[g(V.value)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(V.value),e.mergeProps({key:0,size:20,class:"text-info"},S.value),null,16)):(e.openBlock(),e.createBlock(h,{key:1,size:"20",class:"text-info"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(V.value),1)]),_:1}))])]),_:3},16,["onClick","disabled"])]}),_:2},1032,["text"])):e.createCommentVNode("",!0),l.showEditButton?(e.openBlock(),e.createBlock(q,{key:1,text:l.editButtonText},{activator:e.withCtx(({props:c})=>{var x;return[e.createVNode(a,e.mergeProps({icon:"",flat:"",onClick:ae=>Je(n)},c,{disabled:(x=l.disableEdit)==null?void 0:x.call(l,n)}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"edit-icon",{},()=>[g(p.value)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p.value),e.mergeProps({key:0,size:20,class:"text-primary"},S.value),null,16)):(e.openBlock(),e.createBlock(h,{key:1,size:"20",class:"text-primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.value),1)]),_:1}))])]),_:3},16,["onClick","disabled"])]}),_:2},1032,["text"])):e.createCommentVNode("",!0),l.showDeleteButton?(e.openBlock(),e.createBlock(q,{key:2,text:l.deleteButtonText},{activator:e.withCtx(({props:c})=>{var x;return[e.createVNode(a,e.mergeProps({icon:"",flat:"",onClick:ae=>Ze(n)},c,{disabled:(x=l.disableDelete)==null?void 0:x.call(l,n)}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"delete-icon",{},()=>[g(B.value)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(B.value),e.mergeProps({key:0,size:20,class:"text-error"},S.value),null,16)):(e.openBlock(),e.createBlock(h,{key:1,size:"20",class:"text-error"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(B.value),1)]),_:1}))])]),_:3},16,["onClick","disabled"])]}),_:2},1032,["text"])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"after-actions",{item:n})]),tfoot:e.withCtx(()=>[e.createElementVNode("tfoot",null,[e.renderSlot(t.$slots,"item.tfoot")])]),_:2},[l.showSelect?{name:"top",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"selection-actions",{selected:N.value,count:N.value.length,clear:Re})]),key:"0"}:void 0,e.renderList(ze.value,n=>({name:`item.${n.key}`,fn:e.withCtx(({item:c})=>[e.renderSlot(t.$slots,`item.${n.key}`,{item:c},()=>[e.createTextVNode(e.toDisplayString(c[n.key]),1)])])}))]),1040,["headers","items","loading","items-length","items-per-page","search","sort-by","page","item-value","show-expand","show-select","select-strategy","modelValue","class"]),o[9]||(o[9]=e.createElementVNode("div",{class:"vdt-fade vdt-fade--left"},null,-1)),o[10]||(o[10]=e.createElementVNode("div",{class:"vdt-fade vdt-fade--right"},null,-1)),oe.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"vdt-arrow vdt-arrow--left","aria-label":y("scrollLeft"),onClick:o[7]||(o[7]=n=>ye(-1))},[e.createVNode(h,{icon:He,size:"20"})],8,_e)):e.createCommentVNode("",!0),j.value?(e.openBlock(),e.createBlock(q,{key:1,text:y("scrollRight"),disabled:ge.value,location:"top"},{activator:e.withCtx(({props:n})=>[e.createElementVNode("button",e.mergeProps(n,{type:"button",class:"vdt-arrow vdt-arrow--right","aria-label":y("scrollRight"),onClick:o[8]||(o[8]=c=>ye(1))}),[e.createVNode(h,{icon:Oe,size:"20"})],16,Ee)]),_:1},8,["text","disabled"])):e.createCommentVNode("",!0),ge.value?(e.openBlock(),e.createElementBlock("span",Pe,e.toDisplayString(y("scrollHint")),1)):e.createCommentVNode("",!0)],544),e.createVNode(we,{show:A.value,title:l.deleteModalTitle,description:l.deleteModalMessage,confirmButtonText:l.deleteModalConfirmButtonText,cancelButtonText:l.deleteModalCancelButtonText,onClose:We,onConfirm:Qe},null,8,["show","title","description","confirmButtonText","cancelButtonText"])],6)}}}),Ae={install(l){l.component("DataTable",se)}};v.DATA_TABLE_CONFIG_KEY=F,v.DataTable=se,v.createDataTableConfig=ke,v.default=Ae,Object.defineProperties(v,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1
|
+
(function(v,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(v=typeof globalThis<"u"?globalThis:v||self,e(v.VuetifyDatatable={},v.Vue))})(this,(function(v,e){"use strict";function be(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var L={exports:{}},se;function xe(){if(se)return L.exports;se=1;function l(C,w=100,k={}){if(typeof C!="function")throw new TypeError(`Expected the first parameter to be a function, got \`${typeof C}\`.`);if(w<0)throw new RangeError("`wait` must not be negative.");const{immediate:m}=typeof k=="boolean"?{immediate:k}:k;let i,u,s,V,p;function B(){const g=i,N=u;return i=void 0,u=void 0,p=C.apply(g,N),p}function S(){const g=Date.now()-V;g<w&&g>=0?s=setTimeout(S,w-g):(s=void 0,m||(p=B()))}const d=function(...g){if(i&&this!==i&&Object.getPrototypeOf(this)===Object.getPrototypeOf(i))throw new Error("Debounced method called with different contexts of the same prototype.");i=this,u=g,V=Date.now();const N=m&&!s;return s||(s=setTimeout(S,w)),N&&(p=B()),p};return Object.defineProperty(d,"isPending",{get(){return s!==void 0}}),d.clear=()=>{s&&(clearTimeout(s),s=void 0)},d.flush=()=>{s&&d.trigger()},d.trigger=()=>{p=B(),d.clear()},d}return L.exports.debounce=l,L.exports=l,L.exports}var ve=xe();const Ce=be(ve),we=e.defineComponent({__name:"ConfirmationModal",props:{show:Boolean,title:String,description:String,confirmButtonText:String,cancelButtonText:String},emits:["close","confirm"],setup(l){const C=l,w=e.computed({get:()=>C.show,set:()=>{}});return(k,m)=>{const i=e.resolveComponent("v-card-title"),u=e.resolveComponent("v-card-text"),s=e.resolveComponent("v-spacer"),V=e.resolveComponent("v-btn"),p=e.resolveComponent("v-card-actions"),B=e.resolveComponent("v-card"),S=e.resolveComponent("v-dialog");return e.openBlock(),e.createBlock(S,{modelValue:w.value,"onUpdate:modelValue":m[2]||(m[2]=d=>w.value=d),"max-width":"500px",persistent:"","no-click-animation":""},{default:e.withCtx(()=>[e.createVNode(B,null,{default:e.withCtx(()=>[e.createVNode(i,{class:"text-h5 text-center py-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.title),1)]),_:1}),l.description?(e.openBlock(),e.createBlock(u,{key:0,class:"text-center px-0 py-0"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.description)+" ",1),e.renderSlot(k.$slots,"description")]),_:3})):e.createCommentVNode("",!0),e.createVNode(p,null,{default:e.withCtx(()=>[e.createVNode(s),e.createVNode(V,{color:"error",variant:"flat",dark:"",onClick:m[0]||(m[0]=d=>k.$emit("close"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.cancelButtonText),1)]),_:1}),e.createVNode(V,{color:"success",variant:"flat",dark:"",onClick:m[1]||(m[1]=d=>k.$emit("confirm"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.confirmButtonText),1)]),_:1}),e.createVNode(s)]),_:1})]),_:3})]),_:3},8,["modelValue"])}}}),F=Symbol("DataTableConfig");function ke(l){return{install(C){C.provide(F,l)}}}const Ve='.vdt{position:relative;min-width:0}.vdt-toolbar{display:flex;justify-content:flex-start;padding-bottom:8px}.vdt-body{position:relative}.vdt--pinned .v-table__wrapper>table>thead>tr>th:last-child,.vdt--pinned .v-table__wrapper>table>tbody>tr.v-data-table__tr>td:last-child{position:sticky;right:0;z-index:2;background:rgb(var(--v-theme-surface))}.vdt--pinned.vdt--can-right .v-table__wrapper>table>thead>tr>th:last-child,.vdt--pinned.vdt--can-right .v-table__wrapper>table>tbody>tr.v-data-table__tr>td:last-child{box-shadow:inset 1px 0 rgba(var(--v-border-color),var(--v-border-opacity)),-8px 0 12px -6px #00000026}.vdt-fade{position:absolute;top:var(--vdt-scroll-top, 0px);height:var(--vdt-scroll-h, 100%);width:56px;pointer-events:none;opacity:0;transition:opacity .2s;z-index:3}.vdt-fade--left{left:0;background:linear-gradient(to left,rgba(var(--v-theme-surface),0),rgb(var(--v-theme-surface)))}.vdt-fade--right{right:var(--vdt-pinned-w, 0px);background:linear-gradient(to right,rgba(var(--v-theme-surface),0),rgb(var(--v-theme-surface)))}.vdt--can-left .vdt-fade--left,.vdt--can-right .vdt-fade--right{opacity:1}.vdt-arrow{position:absolute;top:calc(var(--vdt-scroll-top, 0px) + var(--vdt-head-h, 48px) / 2 - 16px);z-index:4;display:flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:thin solid rgba(var(--v-border-color),var(--v-border-opacity));border-radius:50%;background:rgb(var(--v-theme-surface));color:rgb(var(--v-theme-primary));box-shadow:0 4px 12px #00000026;cursor:pointer}.vdt-arrow:focus-visible{outline:2px solid rgb(var(--v-theme-primary));outline-offset:2px}.vdt-arrow--left{left:8px}.vdt-arrow--right{right:calc(var(--vdt-pinned-w, 0px) + 8px)}.vdt-hint{position:absolute;top:calc(var(--vdt-scroll-top, 0px) + var(--vdt-head-h, 48px) / 2 - 24px);right:calc(var(--vdt-pinned-w, 0px) + 8px);z-index:5;transform:translateY(-100%);padding:5px 10px;border-radius:4px;background:rgb(var(--v-theme-surface-variant));color:rgb(var(--v-theme-on-surface-variant));font-size:12px;white-space:nowrap;pointer-events:none}.vdt-hint:after{content:"";position:absolute;top:100%;right:11px;border:5px solid transparent;border-top-color:rgb(var(--v-theme-surface-variant))}.vdt-columns__actions{display:flex;justify-content:space-between;margin:4px 0}.vdt-columns__list{max-height:320px;margin:0;padding:0;overflow-y:auto;list-style:none}.vdt-columns__item{display:flex;align-items:center;gap:4px;border-radius:4px}.vdt-columns__item--over{background:rgba(var(--v-theme-primary),.08)}.vdt-columns__handle{display:flex;padding:4px;border:0;border-radius:4px;background:none;color:rgba(var(--v-theme-on-surface),var(--v-medium-emphasis-opacity));cursor:grab}.vdt-columns__handle:focus-visible{outline:2px solid rgb(var(--v-theme-primary))}',Be={class:"vdt-toolbar"},Se={class:"vdt-columns__actions"},Ne={class:"vdt-columns__list"},Te=["onDragstart","onDragover","onDrop"],De=["aria-label","title","onKeydown"],_e=["aria-label"],Ee=["aria-label"],Pe={key:2,class:"vdt-hint"},I="actions",Me=300,G=2,$e="vuetify-datatable:columns:",Le="svg:M16,5V18H21V5M4,18H9V5H4M10,18H15V5H10V18Z",Ie="svg:M9,3H11V5H9V3M13,3H15V5H13V3M9,7H11V9H9V7M13,7H15V9H13V7M9,11H11V13H9V11M13,11H15V13H13V11M9,15H11V17H9V15M13,15H15V17H13V15M9,19H11V21H9V19M13,19H15V21H13V19Z",He="svg:M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z",Oe="svg:M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z",ie=e.defineComponent({inheritAttrs:!1,__name:"DataTable",props:{tableClass:{},headers:{default:()=>[]},items:{default:()=>[]},loading:{type:Boolean,default:!1},itemValue:{default:"id"},totalItems:{default:0},itemsPerPage:{default:10},search:{},showExpand:{type:Boolean,default:!1},showSelect:{type:Boolean,default:!1},selectStrategy:{default:"page"},modelValue:{default:()=>[]},showEditButton:{type:Boolean,default:!0},showDeleteButton:{type:Boolean,default:!0},showViewButton:{type:Boolean,default:!1},viewButtonText:{},deleteButtonText:{},deleteModalTitle:{},deleteModalMessage:{},deleteModalConfirmButtonText:{},deleteModalCancelButtonText:{},editButtonText:{},viewIcon:{},editIcon:{},deleteIcon:{},disableView:{},disableEdit:{},disableDelete:{}},emits:["onLoadData","editItem","deleteItem","viewItem","update:modelValue"],setup(l,{emit:C}){function w(){if(typeof document>"u"||document.getElementById("vuetify-datatable-styles"))return;const t=document.createElement("style");t.id="vuetify-datatable-styles",t.textContent=Ve,document.head.appendChild(t)}w();const k=[I,"expanded-row","data-table-expand","data-table-select"],m={columns:"Columns",hiddenColumns:t=>`Columns · ${t} hidden`,searchColumns:"Search columns",showAllColumns:"Show all",hideAllColumns:"Hide all",resetColumns:"Reset",moveColumn:"Drag or use the arrow keys to reorder",scrollHint:"Scroll to see more columns",scrollLeft:"Previous columns",scrollRight:"More columns"},i=l,u=C,s=e.inject(F,{icons:{}}),V=e.computed(()=>{var t;return i.viewIcon??((t=s.icons)==null?void 0:t.view)??"mdi-eye-outline"}),p=e.computed(()=>{var t;return i.editIcon??((t=s.icons)==null?void 0:t.edit)??"mdi-pencil-outline"}),B=e.computed(()=>{var t;return i.deleteIcon??((t=s.icons)==null?void 0:t.delete)??"mdi-trash-can-outline"}),S=e.computed(()=>s.iconProps??{}),d=e.computed(()=>i.tableClass??s.tableClass??"border rounded-md");function g(t){return typeof t!="string"}const N=e.computed({get:()=>i.modelValue,set:t=>u("update:modelValue",t)});function Re(){u("update:modelValue",[])}const T=e.ref(i.itemsPerPage),H=e.ref([]),O=e.ref(1),Y=e.ref(null),A=e.ref(!1),ze=e.computed(()=>{var t;return((t=i.headers)==null?void 0:t.filter(o=>o.key!=="actions"&&o.key!=="expanded-row"&&o.key!=="data-table-expand"))||[]});function y(t){var a;const o=((a=s.texts)==null?void 0:a[t])??m[t];return typeof o=="function"?o():o}const Z=e.ref(!1),W=e.ref(""),D=e.ref([]),f=e.ref([]),R=e.ref(null),z=e.ref(null),_=e.computed(()=>i.headers.filter(t=>!k.includes(t.key)&&!!t.title)),E=e.computed(()=>{const t=new Map(_.value.map(a=>[a.key,a]));return[...D.value.filter(a=>t.has(a)).map(a=>t.get(a)),..._.value.filter(a=>!D.value.includes(a.key))]}),Ke=e.computed(()=>{const t=(W.value??"").trim().toLowerCase();return t?E.value.filter(o=>{var a;return(a=o.title)==null?void 0:a.toLowerCase().includes(t)}):E.value}),P=e.computed(()=>_.value.filter(t=>f.value.includes(t.key)).length),je=e.computed(()=>E.value.map(t=>({key:t.key,title:t.title??"",visible:!f.value.includes(t.key)}))),ce=e.computed(()=>i.headers.some(t=>t.key===I)),J=e.computed(()=>{const t=new Set(_.value.map(r=>r.key)),o=[...E.value],a=i.headers.map(r=>t.has(r.key)?o.shift():r);return[...a.filter(r=>r.key!==I&&!f.value.includes(r.key)),...a.filter(r=>r.key===I)]}),de=e.computed(()=>{var t;return P.value>0?(((t=s.texts)==null?void 0:t.hiddenColumns)??m.hiddenColumns)(P.value):y("columns")});function me(t,o){f.value=o?f.value.filter(a=>a!==t):[...f.value,t]}function ue(){f.value=P.value===0?_.value.map(t=>t.key):[]}function pe(){D.value=[],f.value=[]}function X(t,o){const a=E.value.map(h=>h.key),r=a.indexOf(t),b=a.indexOf(o);r===-1||b===-1||r===b||(a.splice(b,0,...a.splice(r,1)),D.value=a)}function Q(t,o){const a=E.value.map(b=>b.key),r=a[a.indexOf(t)+o];r&&X(t,r)}function Ue(t,o){var a;R.value=o,(a=t.dataTransfer)==null||a.setData("text/plain",o)}function qe(t){R.value&&X(R.value,t),fe()}function fe(){R.value=null,z.value=null}const ee=e.computed(()=>{var o;const t=$e+_.value.map(a=>a.key).sort().join(",");return((o=s.storageKey)==null?void 0:o.call(s,t))??t});e.watch(ee,t=>{try{const o=JSON.parse(localStorage.getItem(t)??"null");D.value=Array.isArray(o==null?void 0:o.order)?o.order:[],f.value=Array.isArray(o==null?void 0:o.hidden)?o.hidden:[]}catch{D.value=[],f.value=[]}},{immediate:!0}),e.watch([D,f],([t,o])=>{try{t.length||o.length?localStorage.setItem(ee.value,JSON.stringify({order:t,hidden:o})):localStorage.removeItem(ee.value)}catch{}});const te=e.ref(null),oe=e.ref(null),K=e.ref(!1),le=e.ref(!1),j=e.ref(!1),ne=e.ref(!1),he=e.ref({});let M=null;const Fe=e.computed(()=>K.value||P.value>0||Z.value),ge=e.computed(()=>j.value&&!ne.value),Ge=e.computed(()=>({"vdt--pinned":ce.value,"vdt--can-left":le.value,"vdt--can-right":j.value}));function ae(){var t;return((t=oe.value)==null?void 0:t.querySelector(".v-table__wrapper"))??null}function U(){const t=oe.value,o=ae();if(!t||!o)return;const a=o.scrollWidth-o.clientWidth;K.value=a>G,le.value=K.value&&o.scrollLeft>G,j.value=K.value&&o.scrollLeft<a-G;const r=ce.value?o.querySelector("thead > tr > th:last-child"):null,b=o.querySelector("thead"),h=o.getBoundingClientRect();he.value={"--vdt-pinned-w":`${(r==null?void 0:r.offsetWidth)??0}px`,"--vdt-scroll-top":`${h.top-t.getBoundingClientRect().top}px`,"--vdt-scroll-h":`${h.height}px`,"--vdt-head-h":`${(b==null?void 0:b.offsetHeight)??48}px`}}function Ye(t){const o=ae();!o||t.target!==o||(o.scrollLeft>10&&(ne.value=!0),U())}function ye(t){var o;t===1&&(ne.value=!0),(o=ae())==null||o.scrollBy({left:t*Me,behavior:"smooth"})}e.watch([J,()=>i.items,()=>i.loading],()=>e.nextTick(U)),e.onMounted(()=>{$({page:O.value,itemsPerPage:T.value}),typeof ResizeObserver<"u"&&te.value&&(M=new ResizeObserver(()=>requestAnimationFrame(U)),M.observe(te.value)),U()}),e.onBeforeUnmount(()=>M==null?void 0:M.disconnect());const Ze=t=>{Y.value=t,A.value=!0},We=()=>{Y.value=null,A.value=!1},Je=t=>{u("editItem",t)},Xe=t=>{u("viewItem",t)},Qe=()=>{u("deleteItem",Y.value),A.value=!1},$=({page:t,itemsPerPage:o})=>{const a=H.value.map(r=>({column:r.key,direction:r.order}));u("onLoadData",{page:t,itemsPerPage:o,search:i.search,sortBy:a})};function et(){$({page:1,itemsPerPage:T.value})}const tt=Ce(et,400);return e.watch(()=>i.search,(t,o)=>{t!==o&&tt()}),e.watch(T,(t,o)=>{t!==o&&$({page:1,itemsPerPage:t})}),e.watch(H,()=>{$({page:1,itemsPerPage:T.value})}),e.watch(O,t=>{$({page:t,itemsPerPage:T.value})}),(t,o)=>{const a=e.resolveComponent("v-btn"),r=e.resolveComponent("v-text-field"),b=e.resolveComponent("v-checkbox-btn"),h=e.resolveComponent("v-icon"),ot=e.resolveComponent("v-card-text"),lt=e.resolveComponent("v-card"),nt=e.resolveComponent("v-menu"),q=e.resolveComponent("v-tooltip"),at=e.resolveComponent("v-data-table-server");return e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:te,class:e.normalizeClass(["vdt",Ge.value]),style:e.normalizeStyle(he.value)},[e.withDirectives(e.createElementVNode("div",Be,[e.renderSlot(t.$slots,"column-chooser",{columns:je.value,hiddenCount:P.value,label:de.value,setVisible:me,toggleAll:ue,reset:pe,move:Q,place:X},()=>[e.createVNode(nt,{modelValue:Z.value,"onUpdate:modelValue":o[2]||(o[2]=n=>Z.value=n),"close-on-content-click":!1,location:"bottom start"},{activator:e.withCtx(({props:n})=>[e.createVNode(a,e.mergeProps(n,{class:"vdt-columns__button",variant:"outlined",color:"primary",size:"small","prepend-icon":Le}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(de.value),1)]),_:1},16)]),default:e.withCtx(()=>[e.createVNode(lt,{class:"vdt-columns","min-width":"280"},{default:e.withCtx(()=>[e.createVNode(ot,{class:"pa-3"},{default:e.withCtx(()=>[e.createVNode(r,{modelValue:W.value,"onUpdate:modelValue":o[0]||(o[0]=n=>W.value=n),placeholder:y("searchColumns"),density:"compact",variant:"outlined","hide-details":"",clearable:""},null,8,["modelValue","placeholder"]),e.createElementVNode("div",Se,[e.createVNode(a,{variant:"text",size:"small",color:"primary",onClick:ue},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(P.value===0?y("hideAllColumns"):y("showAllColumns")),1)]),_:1}),e.createVNode(a,{variant:"text",size:"small",onClick:pe},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y("resetColumns")),1)]),_:1})]),e.createElementVNode("ul",Ne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value,n=>(e.openBlock(),e.createElementBlock("li",{key:n.key,class:e.normalizeClass(["vdt-columns__item",{"vdt-columns__item--over":z.value===n.key}]),draggable:"true",onDragstart:c=>Ue(c,n.key),onDragover:e.withModifiers(c=>z.value=n.key,["prevent"]),onDragleave:o[1]||(o[1]=c=>z.value=null),onDrop:e.withModifiers(c=>qe(n.key),["prevent"]),onDragend:fe},[e.createVNode(b,{"model-value":!f.value.includes(n.key),label:n.title,density:"compact",class:"flex-grow-1","onUpdate:modelValue":c=>me(n.key,!!c)},null,8,["model-value","label","onUpdate:modelValue"]),e.createElementVNode("button",{type:"button",class:"vdt-columns__handle","aria-label":`${y("moveColumn")}: ${n.title}`,title:y("moveColumn"),onKeydown:[e.withKeys(e.withModifiers(c=>Q(n.key,-1),["prevent"]),["up"]),e.withKeys(e.withModifiers(c=>Q(n.key,1),["prevent"]),["down"])]},[e.createVNode(h,{icon:Ie,size:"18"})],40,De)],42,Te))),128))])]),_:1})]),_:1})]),_:1},8,["modelValue"])])],512),[[e.vShow,Fe.value]]),e.createElementVNode("div",{ref_key:"bodyRef",ref:oe,class:"vdt-body",onScrollCapturePassive:Ye},[e.createVNode(at,e.mergeProps(t.$attrs,{headers:J.value,items:l.items,loading:l.loading,"items-length":l.totalItems,"items-per-page":T.value,"onUpdate:itemsPerPage":o[3]||(o[3]=n=>T.value=n),search:l.search,"sort-by":H.value,"onUpdate:sortBy":o[4]||(o[4]=n=>H.value=n),page:O.value,"onUpdate:page":o[5]||(o[5]=n=>O.value=n),"item-value":l.itemValue,"show-expand":l.showExpand,"show-select":l.showSelect,"select-strategy":l.selectStrategy,modelValue:N.value,"onUpdate:modelValue":o[6]||(o[6]=n=>N.value=n),class:d.value}),e.createSlots({"item.data-table-expand":e.withCtx(({internalItem:n,isExpanded:c,toggleExpand:x})=>[e.renderSlot(t.$slots,"item.data-table-expand",{internalItem:n,isExpanded:c,toggleExpand:x},()=>[e.createVNode(a,{onClick:re=>x(n),rounded:""},{default:e.withCtx(()=>[e.createVNode(h,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c(n)?"mdi-chevron-up":"mdi-chevron-down"),1)]),_:2},1024)]),_:2},1032,["onClick"])])]),"expanded-row":e.withCtx(({columns:n,item:c})=>[e.renderSlot(t.$slots,"expanded-row",{columns:n,item:c})]),"item.actions":e.withCtx(({item:n})=>[e.renderSlot(t.$slots,"before-actions",{item:n}),l.showViewButton?(e.openBlock(),e.createBlock(q,{key:0,text:l.viewButtonText},{activator:e.withCtx(({props:c})=>{var x;return[e.createVNode(a,e.mergeProps({icon:"",flat:"",onClick:re=>Xe(n)},c,{disabled:(x=l.disableView)==null?void 0:x.call(l,n)}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"view-icon",{},()=>[g(V.value)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(V.value),e.mergeProps({key:0,size:20,class:"text-info"},S.value),null,16)):(e.openBlock(),e.createBlock(h,{key:1,size:"20",class:"text-info"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(V.value),1)]),_:1}))])]),_:3},16,["onClick","disabled"])]}),_:2},1032,["text"])):e.createCommentVNode("",!0),l.showEditButton?(e.openBlock(),e.createBlock(q,{key:1,text:l.editButtonText},{activator:e.withCtx(({props:c})=>{var x;return[e.createVNode(a,e.mergeProps({icon:"",flat:"",onClick:re=>Je(n)},c,{disabled:(x=l.disableEdit)==null?void 0:x.call(l,n)}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"edit-icon",{},()=>[g(p.value)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p.value),e.mergeProps({key:0,size:20,class:"text-primary"},S.value),null,16)):(e.openBlock(),e.createBlock(h,{key:1,size:"20",class:"text-primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.value),1)]),_:1}))])]),_:3},16,["onClick","disabled"])]}),_:2},1032,["text"])):e.createCommentVNode("",!0),l.showDeleteButton?(e.openBlock(),e.createBlock(q,{key:2,text:l.deleteButtonText},{activator:e.withCtx(({props:c})=>{var x;return[e.createVNode(a,e.mergeProps({icon:"",flat:"",onClick:re=>Ze(n)},c,{disabled:(x=l.disableDelete)==null?void 0:x.call(l,n)}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"delete-icon",{},()=>[g(B.value)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(B.value),e.mergeProps({key:0,size:20,class:"text-error"},S.value),null,16)):(e.openBlock(),e.createBlock(h,{key:1,size:"20",class:"text-error"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(B.value),1)]),_:1}))])]),_:3},16,["onClick","disabled"])]}),_:2},1032,["text"])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"after-actions",{item:n})]),tfoot:e.withCtx(()=>[e.createElementVNode("tfoot",null,[e.renderSlot(t.$slots,"item.tfoot",{columns:J.value})])]),_:2},[l.showSelect?{name:"top",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"selection-actions",{selected:N.value,count:N.value.length,clear:Re})]),key:"0"}:void 0,e.renderList(ze.value,n=>({name:`item.${n.key}`,fn:e.withCtx(({item:c})=>[e.renderSlot(t.$slots,`item.${n.key}`,{item:c},()=>[e.createTextVNode(e.toDisplayString(c[n.key]),1)])])}))]),1040,["headers","items","loading","items-length","items-per-page","search","sort-by","page","item-value","show-expand","show-select","select-strategy","modelValue","class"]),o[9]||(o[9]=e.createElementVNode("div",{class:"vdt-fade vdt-fade--left"},null,-1)),o[10]||(o[10]=e.createElementVNode("div",{class:"vdt-fade vdt-fade--right"},null,-1)),le.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"vdt-arrow vdt-arrow--left","aria-label":y("scrollLeft"),onClick:o[7]||(o[7]=n=>ye(-1))},[e.createVNode(h,{icon:He,size:"20"})],8,_e)):e.createCommentVNode("",!0),j.value?(e.openBlock(),e.createBlock(q,{key:1,text:y("scrollRight"),disabled:ge.value,location:"top"},{activator:e.withCtx(({props:n})=>[e.createElementVNode("button",e.mergeProps(n,{type:"button",class:"vdt-arrow vdt-arrow--right","aria-label":y("scrollRight"),onClick:o[8]||(o[8]=c=>ye(1))}),[e.createVNode(h,{icon:Oe,size:"20"})],16,Ee)]),_:1},8,["text","disabled"])):e.createCommentVNode("",!0),ge.value?(e.openBlock(),e.createElementBlock("span",Pe,e.toDisplayString(y("scrollHint")),1)):e.createCommentVNode("",!0)],544),e.createVNode(we,{show:A.value,title:l.deleteModalTitle,description:l.deleteModalMessage,confirmButtonText:l.deleteModalConfirmButtonText,cancelButtonText:l.deleteModalCancelButtonText,onClose:We,onConfirm:Qe},null,8,["show","title","description","confirmButtonText","cancelButtonText"])],6)}}}),Ae={install(l){l.component("DataTable",ie)}};v.DATA_TABLE_CONFIG_KEY=F,v.DataTable=ie,v.createDataTableConfig=ke,v.default=Ae,Object.defineProperties(v,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|