@jdanino/inertiajs-tables-laravel-query-builder 3.0.2 → 3.0.3
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as S, onMounted as Y, onBeforeUnmount as ye, openBlock as o, createElementBlock as i, renderSlot as w, watch as
|
|
1
|
+
import { ref as S, onMounted as Y, onBeforeUnmount as ye, openBlock as o, createElementBlock as i, renderSlot as w, watch as Z, inject as M, createBlock as _, withCtx as C, createElementVNode as l, normalizeClass as k, unref as e, withModifiers as F, withDirectives as E, vShow as A, resolveDynamicComponent as z, toDisplayString as g, createCommentVNode as x, computed as $, Fragment as B, renderList as P, createVNode as D, createTextVNode as T, nextTick as we, provide as xe, onUnmounted as ke, Transition as _e } from "vue";
|
|
2
2
|
import { createPopper as $e } from "@popperjs/core/lib/popper-lite";
|
|
3
3
|
import Ce from "@popperjs/core/lib/modifiers/preventOverflow";
|
|
4
4
|
import Se from "@popperjs/core/lib/modifiers/flip";
|
|
@@ -9,11 +9,11 @@ import U from "qs";
|
|
|
9
9
|
import Oe from "lodash-es/clone";
|
|
10
10
|
import je from "lodash-es/filter";
|
|
11
11
|
import Te from "lodash-es/findKey";
|
|
12
|
-
import
|
|
12
|
+
import j from "lodash-es/forEach";
|
|
13
13
|
import Le from "lodash-es/isEqual";
|
|
14
14
|
import Ve from "lodash-es/map";
|
|
15
|
-
import
|
|
16
|
-
const
|
|
15
|
+
import ze from "lodash-es/pickBy";
|
|
16
|
+
const Me = {
|
|
17
17
|
__name: "OnClickOutside",
|
|
18
18
|
props: {
|
|
19
19
|
do: {
|
|
@@ -36,7 +36,7 @@ const ze = {
|
|
|
36
36
|
w(d.$slots, "default")
|
|
37
37
|
], 512));
|
|
38
38
|
}
|
|
39
|
-
}, Ie = { class: "relative" }, Re = ["dusk", "disabled", "onClick"], De = { class: "mt-2 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5" },
|
|
39
|
+
}, Ie = { class: "relative" }, Re = ["dusk", "disabled", "onClick"], De = { class: "mt-2 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5" }, J = {
|
|
40
40
|
__name: "ButtonWithDropdown",
|
|
41
41
|
props: {
|
|
42
42
|
placement: {
|
|
@@ -68,7 +68,7 @@ const ze = {
|
|
|
68
68
|
function r() {
|
|
69
69
|
f.value = !1;
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
Z(f, () => {
|
|
72
72
|
d.value.update();
|
|
73
73
|
});
|
|
74
74
|
const u = S(null), m = S(null);
|
|
@@ -78,8 +78,8 @@ const ze = {
|
|
|
78
78
|
modifiers: [Se, Ce]
|
|
79
79
|
});
|
|
80
80
|
}), p({ hide: r });
|
|
81
|
-
const O =
|
|
82
|
-
return (q, y) => (o(), _(
|
|
81
|
+
const O = M("activeClasses");
|
|
82
|
+
return (q, y) => (o(), _(Me, { do: r }, {
|
|
83
83
|
default: C(() => [
|
|
84
84
|
l("div", Ie, [
|
|
85
85
|
l("button", {
|
|
@@ -135,12 +135,12 @@ const ze = {
|
|
|
135
135
|
}
|
|
136
136
|
},
|
|
137
137
|
setup(s) {
|
|
138
|
-
const p = s, n =
|
|
138
|
+
const p = s, n = M("activeClasses");
|
|
139
139
|
function f() {
|
|
140
140
|
p.cell.sortable && p.cell.onSort(p.cell.key);
|
|
141
141
|
}
|
|
142
142
|
return (d, t) => E((o(), i("th", null, [
|
|
143
|
-
(o(), _(
|
|
143
|
+
(o(), _(z(s.cell.sortable ? "button" : "div"), {
|
|
144
144
|
class: "py-3 px-6 w-full",
|
|
145
145
|
dusk: s.cell.sortable ? `sort-${s.cell.key}` : null,
|
|
146
146
|
onClick: F(f, ["prevent"])
|
|
@@ -148,7 +148,7 @@ const ze = {
|
|
|
148
148
|
default: C(() => [
|
|
149
149
|
l("span", Ee, [
|
|
150
150
|
w(d.$slots, "label", {}, () => [
|
|
151
|
-
l("span", Ae,
|
|
151
|
+
l("span", Ae, g(s.cell.label), 1)
|
|
152
152
|
]),
|
|
153
153
|
w(d.$slots, "sort", {}, () => [
|
|
154
154
|
s.cell.sortable ? (o(), i("svg", {
|
|
@@ -175,7 +175,7 @@ const ze = {
|
|
|
175
175
|
[A, !s.cell.hidden]
|
|
176
176
|
]);
|
|
177
177
|
}
|
|
178
|
-
},
|
|
178
|
+
}, X = {
|
|
179
179
|
translations: {
|
|
180
180
|
next: "Next",
|
|
181
181
|
no_results_found: "No results found",
|
|
@@ -187,13 +187,13 @@ const ze = {
|
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
189
|
function de() {
|
|
190
|
-
return
|
|
190
|
+
return X.translations;
|
|
191
191
|
}
|
|
192
192
|
function Hs(s, p) {
|
|
193
|
-
|
|
193
|
+
X.translations[s] = p;
|
|
194
194
|
}
|
|
195
195
|
function Ks(s) {
|
|
196
|
-
|
|
196
|
+
X.translations = s;
|
|
197
197
|
}
|
|
198
198
|
const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
199
199
|
__name: "PerPageSelector",
|
|
@@ -235,13 +235,13 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
235
235
|
(o(!0), i(B, null, P(e(f), (r) => (o(), i("option", {
|
|
236
236
|
key: r,
|
|
237
237
|
value: r
|
|
238
|
-
},
|
|
238
|
+
}, g(r) + " " + g(e(n).per_page), 9, Ue))), 128))
|
|
239
239
|
], 40, Qe));
|
|
240
240
|
}
|
|
241
241
|
}, Ye = {
|
|
242
242
|
key: 0,
|
|
243
243
|
class: "bg-white px-4 py-3 flex items-center justify-between border-t border-gray-200 sm:px-6"
|
|
244
|
-
},
|
|
244
|
+
}, Ze = { key: 0 }, Je = /* @__PURE__ */ l("svg", {
|
|
245
245
|
xmlns: "http://www.w3.org/2000/svg",
|
|
246
246
|
class: "h-5 w-5 text-gray-400",
|
|
247
247
|
fill: "none",
|
|
@@ -254,7 +254,7 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
254
254
|
"stroke-linejoin": "round",
|
|
255
255
|
d: "M7 16l-4-4m0 0l4-4m-4 4h18"
|
|
256
256
|
})
|
|
257
|
-
], -1),
|
|
257
|
+
], -1), Xe = { class: "hidden sm:inline ml-2" }, et = { class: "hidden sm:inline mr-2" }, tt = /* @__PURE__ */ l("svg", {
|
|
258
258
|
xmlns: "http://www.w3.org/2000/svg",
|
|
259
259
|
class: "h-5 w-5 text-gray-400",
|
|
260
260
|
fill: "none",
|
|
@@ -270,7 +270,7 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
270
270
|
], -1), st = {
|
|
271
271
|
key: 2,
|
|
272
272
|
class: "hidden sm:flex-1 sm:flex sm:items-center sm:justify-between"
|
|
273
|
-
}, lt = { class: "flex flex-row
|
|
273
|
+
}, lt = { class: "flex flex-row gap-5 items-center flex-grow" }, rt = { class: "hidden lg:block text-sm text-gray-700 flex-grow" }, nt = { class: "font-medium" }, at = { class: "font-medium" }, ot = { class: "font-medium" }, ut = {
|
|
274
274
|
class: "relative z-0 inline-flex rounded-md shadow-sm -space-x-px",
|
|
275
275
|
"aria-label": "Pagination"
|
|
276
276
|
}, it = { class: "sr-only" }, ct = /* @__PURE__ */ l("svg", {
|
|
@@ -329,13 +329,12 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
329
329
|
setup(s) {
|
|
330
330
|
const p = s, n = de(), f = $(() => "links" in t.value ? t.value.links.length > 0 : !1), d = $(() => Object.keys(t.value).length > 0 && t.value.total > 1), t = $(() => p.meta), r = $(() => "prev_page_url" in t.value ? t.value.prev_page_url : null), u = $(() => "next_page_url" in t.value ? t.value.next_page_url : null), m = $(() => parseInt(t.value.per_page));
|
|
331
331
|
return (O, q) => e(d) ? (o(), i("nav", Ye, [
|
|
332
|
-
|
|
333
|
-
!s.hasData || e(t).total < 1 ? (o(), i("p", Je, v(e(n).no_results_found), 1)) : x("", !0),
|
|
332
|
+
!s.hasData || e(t).total < 1 ? (o(), i("p", Ze, g(e(n).no_results_found), 1)) : x("", !0),
|
|
334
333
|
s.hasData ? (o(), i("div", {
|
|
335
334
|
key: 1,
|
|
336
335
|
class: k(["flex-1 flex justify-between", { "sm:hidden": e(f) }])
|
|
337
336
|
}, [
|
|
338
|
-
(o(), _(
|
|
337
|
+
(o(), _(z(e(r) ? "a" : "div"), {
|
|
339
338
|
class: k([{
|
|
340
339
|
"cursor-not-allowed text-gray-400": !e(r),
|
|
341
340
|
"text-gray-700 hover:text-gray-500": e(r)
|
|
@@ -345,8 +344,8 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
345
344
|
onClick: q[0] || (q[0] = F((y) => s.onClick(e(r)), ["prevent"]))
|
|
346
345
|
}, {
|
|
347
346
|
default: C(() => [
|
|
348
|
-
|
|
349
|
-
l("span",
|
|
347
|
+
Je,
|
|
348
|
+
l("span", Xe, g(e(n).previous), 1)
|
|
350
349
|
]),
|
|
351
350
|
_: 1
|
|
352
351
|
}, 8, ["class", "href", "dusk"])),
|
|
@@ -356,7 +355,7 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
356
355
|
options: s.perPageOptions,
|
|
357
356
|
"on-change": s.onPerPageChange
|
|
358
357
|
}, null, 8, ["value", "options", "on-change"]),
|
|
359
|
-
(o(), _(
|
|
358
|
+
(o(), _(z(e(u) ? "a" : "div"), {
|
|
360
359
|
class: k([{
|
|
361
360
|
"cursor-not-allowed text-gray-400": !e(u),
|
|
362
361
|
"text-gray-700 hover:text-gray-500": e(u)
|
|
@@ -366,7 +365,7 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
366
365
|
onClick: q[1] || (q[1] = F((y) => s.onClick(e(u)), ["prevent"]))
|
|
367
366
|
}, {
|
|
368
367
|
default: C(() => [
|
|
369
|
-
l("span", et,
|
|
368
|
+
l("span", et, g(e(n).next), 1),
|
|
370
369
|
tt
|
|
371
370
|
]),
|
|
372
371
|
_: 1
|
|
@@ -381,17 +380,17 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
381
380
|
"on-change": s.onPerPageChange
|
|
382
381
|
}, null, 8, ["value", "options", "on-change"]),
|
|
383
382
|
l("p", rt, [
|
|
384
|
-
l("span", nt,
|
|
385
|
-
|
|
386
|
-
l("span", at,
|
|
387
|
-
|
|
388
|
-
l("span", ot,
|
|
389
|
-
|
|
383
|
+
l("span", nt, g(e(t).from), 1),
|
|
384
|
+
T(" " + g(e(n).to) + " ", 1),
|
|
385
|
+
l("span", at, g(e(t).to), 1),
|
|
386
|
+
T(" " + g(e(n).of) + " ", 1),
|
|
387
|
+
l("span", ot, g(e(t).total), 1),
|
|
388
|
+
T(" " + g(e(n).results), 1)
|
|
390
389
|
])
|
|
391
390
|
]),
|
|
392
391
|
l("div", null, [
|
|
393
392
|
l("nav", ut, [
|
|
394
|
-
(o(), _(
|
|
393
|
+
(o(), _(z(e(r) ? "a" : "div"), {
|
|
395
394
|
class: k([{
|
|
396
395
|
"cursor-not-allowed text-gray-400": !e(r),
|
|
397
396
|
"text-gray-500 hover:bg-gray-50": e(r)
|
|
@@ -401,14 +400,14 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
401
400
|
onClick: q[2] || (q[2] = F((y) => s.onClick(e(r)), ["prevent"]))
|
|
402
401
|
}, {
|
|
403
402
|
default: C(() => [
|
|
404
|
-
l("span", it,
|
|
403
|
+
l("span", it, g(e(n).previous), 1),
|
|
405
404
|
ct
|
|
406
405
|
]),
|
|
407
406
|
_: 1
|
|
408
407
|
}, 8, ["class", "href", "dusk"])),
|
|
409
|
-
(o(!0), i(B, null, P(e(t).links, (y,
|
|
408
|
+
(o(!0), i(B, null, P(e(t).links, (y, L) => (o(), i("div", { key: L }, [
|
|
410
409
|
w(O.$slots, "link", {}, () => [
|
|
411
|
-
!isNaN(y.label) || y.label === "..." ? (o(), _(
|
|
410
|
+
!isNaN(y.label) || y.label === "..." ? (o(), _(z(y.url ? "a" : "div"), {
|
|
412
411
|
key: 0,
|
|
413
412
|
href: y.url,
|
|
414
413
|
dusk: y.url ? `pagination-${y.label}` : null,
|
|
@@ -417,16 +416,16 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
417
416
|
"hover:bg-gray-50": y.url,
|
|
418
417
|
"bg-gray-100": y.active
|
|
419
418
|
}]),
|
|
420
|
-
onClick: F((
|
|
419
|
+
onClick: F((V) => s.onClick(y.url), ["prevent"])
|
|
421
420
|
}, {
|
|
422
421
|
default: C(() => [
|
|
423
|
-
|
|
422
|
+
T(g(y.label), 1)
|
|
424
423
|
]),
|
|
425
424
|
_: 2
|
|
426
425
|
}, 1032, ["href", "dusk", "class", "onClick"])) : x("", !0)
|
|
427
426
|
])
|
|
428
427
|
]))), 128)),
|
|
429
|
-
(o(), _(
|
|
428
|
+
(o(), _(z(e(u) ? "a" : "div"), {
|
|
430
429
|
class: k([{
|
|
431
430
|
"cursor-not-allowed text-gray-400": !e(u),
|
|
432
431
|
"text-gray-500 hover:bg-gray-50": e(u)
|
|
@@ -436,7 +435,7 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
436
435
|
onClick: q[3] || (q[3] = F((y) => s.onClick(e(u)), ["prevent"]))
|
|
437
436
|
}, {
|
|
438
437
|
default: C(() => [
|
|
439
|
-
l("span", dt,
|
|
438
|
+
l("span", dt, g(e(n).next), 1),
|
|
440
439
|
ht
|
|
441
440
|
]),
|
|
442
441
|
_: 1
|
|
@@ -457,12 +456,12 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
457
456
|
d: "M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",
|
|
458
457
|
"clip-rule": "evenodd"
|
|
459
458
|
})
|
|
460
|
-
], -1),
|
|
459
|
+
], -1), gt = {
|
|
461
460
|
role: "menu",
|
|
462
461
|
"aria-orientation": "horizontal",
|
|
463
462
|
"aria-labelledby": "add-search-input-menu",
|
|
464
463
|
class: "min-w-max"
|
|
465
|
-
},
|
|
464
|
+
}, vt = ["dusk", "onClick"], mt = {
|
|
466
465
|
__name: "TableAddSearchRow",
|
|
467
466
|
props: {
|
|
468
467
|
searchInputs: {
|
|
@@ -483,7 +482,7 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
483
482
|
function f(d) {
|
|
484
483
|
p.onAdd(d), n.value.hide();
|
|
485
484
|
}
|
|
486
|
-
return (d, t) => (o(), _(
|
|
485
|
+
return (d, t) => (o(), _(J, {
|
|
487
486
|
ref_key: "dropdown",
|
|
488
487
|
ref: n,
|
|
489
488
|
dusk: "add-search-row-dropdown",
|
|
@@ -494,14 +493,14 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
494
493
|
pt
|
|
495
494
|
]),
|
|
496
495
|
default: C(() => [
|
|
497
|
-
l("div",
|
|
496
|
+
l("div", gt, [
|
|
498
497
|
(o(!0), i(B, null, P(s.searchInputs, (r, u) => (o(), i("button", {
|
|
499
498
|
key: u,
|
|
500
499
|
dusk: `add-search-row-${r.key}`,
|
|
501
500
|
class: "text-left w-full px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900",
|
|
502
501
|
role: "menuitem",
|
|
503
502
|
onClick: F((m) => f(r.key), ["prevent"])
|
|
504
|
-
},
|
|
503
|
+
}, g(r.label), 9, vt))), 128))
|
|
505
504
|
])
|
|
506
505
|
]),
|
|
507
506
|
_: 1
|
|
@@ -536,8 +535,8 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
536
535
|
}
|
|
537
536
|
},
|
|
538
537
|
setup(s) {
|
|
539
|
-
const p = s, n =
|
|
540
|
-
return (f, d) => (o(), _(
|
|
538
|
+
const p = s, n = M("activeClasses");
|
|
539
|
+
return (f, d) => (o(), _(J, {
|
|
541
540
|
placement: "bottom-end",
|
|
542
541
|
dusk: "columns-dropdown",
|
|
543
542
|
active: s.hasHiddenColumns
|
|
@@ -561,7 +560,7 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
561
560
|
key: r,
|
|
562
561
|
class: "py-2 flex items-center justify-between"
|
|
563
562
|
}, [
|
|
564
|
-
l("p", $t,
|
|
563
|
+
l("p", $t, g(t.label), 1),
|
|
565
564
|
l("button", {
|
|
566
565
|
type: "button",
|
|
567
566
|
class: k(["ml-4 relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-light-blue-500", {
|
|
@@ -621,8 +620,8 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
621
620
|
}
|
|
622
621
|
},
|
|
623
622
|
setup(s) {
|
|
624
|
-
const p =
|
|
625
|
-
return (n, f) => (o(), _(
|
|
623
|
+
const p = M("activeClasses");
|
|
624
|
+
return (n, f) => (o(), _(J, {
|
|
626
625
|
placement: "bottom-end",
|
|
627
626
|
dusk: "filters-dropdown",
|
|
628
627
|
active: s.hasEnabledFilters
|
|
@@ -641,7 +640,7 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
641
640
|
default: C(() => [
|
|
642
641
|
l("div", Pt, [
|
|
643
642
|
(o(!0), i(B, null, P(s.filters, (d, t) => (o(), i("div", { key: t }, [
|
|
644
|
-
l("h3", Ot,
|
|
643
|
+
l("h3", Ot, g(d.label), 1),
|
|
645
644
|
l("div", jt, [
|
|
646
645
|
d.type === "select" ? (o(), i("select", {
|
|
647
646
|
key: 0,
|
|
@@ -653,7 +652,7 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
653
652
|
(o(!0), i(B, null, P(d.options, (r, u) => (o(), i("option", {
|
|
654
653
|
key: u,
|
|
655
654
|
value: u
|
|
656
|
-
},
|
|
655
|
+
}, g(r), 9, Lt))), 128))
|
|
657
656
|
], 40, Tt)) : x("", !0)
|
|
658
657
|
])
|
|
659
658
|
]))), 128))
|
|
@@ -662,7 +661,7 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
662
661
|
_: 1
|
|
663
662
|
}, 8, ["active"]));
|
|
664
663
|
}
|
|
665
|
-
},
|
|
664
|
+
}, zt = { class: "flex items-center justify-start my-3 text-sm" }, Mt = { class: "flex items-center" }, It = /* @__PURE__ */ l("svg", {
|
|
666
665
|
xmlns: "http://www.w3.org/2000/svg",
|
|
667
666
|
class: "h-5 w-5 text-gray-300",
|
|
668
667
|
viewBox: "0 0 20 20",
|
|
@@ -692,16 +691,16 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
692
691
|
}
|
|
693
692
|
},
|
|
694
693
|
setup(s) {
|
|
695
|
-
const p = s, n =
|
|
696
|
-
return (t, r) => (o(), i("div",
|
|
697
|
-
l("div",
|
|
694
|
+
const p = s, n = M("activeClasses"), f = $(() => p.filters.filter((t) => t.value !== null)), d = $(() => f.value.length);
|
|
695
|
+
return (t, r) => (o(), i("div", zt, [
|
|
696
|
+
l("div", Mt, [
|
|
698
697
|
It,
|
|
699
698
|
l("span", Rt, [
|
|
700
|
-
|
|
699
|
+
T(g(e(d)) + " active ", 1),
|
|
701
700
|
l("span", {
|
|
702
|
-
textContent:
|
|
701
|
+
textContent: g(e(d) === 1 ? "filter" : "filters")
|
|
703
702
|
}, null, 8, Dt),
|
|
704
|
-
|
|
703
|
+
T(":")
|
|
705
704
|
])
|
|
706
705
|
]),
|
|
707
706
|
(o(!0), i(B, null, P(e(f), (u) => (o(), i("button", {
|
|
@@ -711,9 +710,9 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
711
710
|
}, [
|
|
712
711
|
l("span", {
|
|
713
712
|
class: k(["capitalize text-gray-500", `group-hover:${e(n).text}`])
|
|
714
|
-
},
|
|
715
|
-
|
|
716
|
-
l("span", At,
|
|
713
|
+
}, g(u.label.replace("_", " ")), 3),
|
|
714
|
+
T(":"),
|
|
715
|
+
l("span", At, g(u.options[u.value]), 1),
|
|
717
716
|
(o(), i("svg", {
|
|
718
717
|
class: k([`group-hover:${e(n).text}`, "h-4 w-4 ml-1 text-gray-400"]),
|
|
719
718
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -723,12 +722,13 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
723
722
|
], 10, Et))), 128))
|
|
724
723
|
]));
|
|
725
724
|
}
|
|
726
|
-
}, Ht = { class: "relative" }, Kt = ["placeholder", "value"], Qt = /* @__PURE__ */ l("div", { class: "absolute inset-y-0
|
|
725
|
+
}, Ht = { class: "relative" }, Kt = ["placeholder", "value"], Qt = /* @__PURE__ */ l("div", { class: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3" }, [
|
|
727
726
|
/* @__PURE__ */ l("svg", {
|
|
728
727
|
xmlns: "http://www.w3.org/2000/svg",
|
|
729
|
-
class: "
|
|
728
|
+
class: "size-5 text-gray-400 sm:size-4",
|
|
730
729
|
viewBox: "0 0 20 20",
|
|
731
|
-
fill: "currentColor"
|
|
730
|
+
fill: "currentColor",
|
|
731
|
+
"aria-hidden": "true"
|
|
732
732
|
}, [
|
|
733
733
|
/* @__PURE__ */ l("path", {
|
|
734
734
|
"fill-rule": "evenodd",
|
|
@@ -741,7 +741,7 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
741
741
|
props: {
|
|
742
742
|
label: {
|
|
743
743
|
type: String,
|
|
744
|
-
default: "
|
|
744
|
+
default: "Zoeken...",
|
|
745
745
|
required: !1
|
|
746
746
|
},
|
|
747
747
|
value: {
|
|
@@ -755,10 +755,10 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
755
755
|
}
|
|
756
756
|
},
|
|
757
757
|
setup(s) {
|
|
758
|
-
const p =
|
|
758
|
+
const p = M("activeClasses");
|
|
759
759
|
return (n, f) => (o(), i("div", Ht, [
|
|
760
760
|
l("input", {
|
|
761
|
-
class: k(["block w-full
|
|
761
|
+
class: k(["block w-full rounded-md border-gray-300 pr-10 shadow-sm sm:text-sm", [e(p).focusRing, e(p).focusBorder]]),
|
|
762
762
|
placeholder: s.label,
|
|
763
763
|
value: s.value,
|
|
764
764
|
type: "text",
|
|
@@ -768,7 +768,7 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
768
768
|
Qt
|
|
769
769
|
]));
|
|
770
770
|
}
|
|
771
|
-
}, Yt = { class: "flex rounded-md shadow-sm relative mt-3" },
|
|
771
|
+
}, Yt = { class: "flex rounded-md shadow-sm relative mt-3" }, Zt = ["for"], Jt = /* @__PURE__ */ l("svg", {
|
|
772
772
|
xmlns: "http://www.w3.org/2000/svg",
|
|
773
773
|
class: "h-5 w-5 mr-2 text-gray-400",
|
|
774
774
|
viewBox: "0 0 20 20",
|
|
@@ -779,7 +779,7 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
779
779
|
d: "M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",
|
|
780
780
|
"clip-rule": "evenodd"
|
|
781
781
|
})
|
|
782
|
-
], -1),
|
|
782
|
+
], -1), Xt = ["id", "name", "value", "onInput"], es = { class: "absolute inset-y-0 right-0 pr-3 flex items-center" }, ts = ["dusk", "onClick"], ss = /* @__PURE__ */ l("span", { class: "sr-only" }, "Remove search", -1), ls = /* @__PURE__ */ l("svg", {
|
|
783
783
|
xmlns: "http://www.w3.org/2000/svg",
|
|
784
784
|
class: "h-5 w-5",
|
|
785
785
|
fill: "none",
|
|
@@ -821,7 +821,7 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
821
821
|
function d(t) {
|
|
822
822
|
return p.forcedVisibleSearchInputs.includes(t);
|
|
823
823
|
}
|
|
824
|
-
return
|
|
824
|
+
return Z(p.forcedVisibleSearchInputs, (t) => {
|
|
825
825
|
const r = t.length > 0 ? t[t.length - 1] : null;
|
|
826
826
|
!r || we().then(() => {
|
|
827
827
|
const u = Fe(f.value, (m) => m.__vnode.key === r);
|
|
@@ -836,9 +836,9 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
836
836
|
for: u.key,
|
|
837
837
|
class: "inline-flex items-center px-4 rounded-l-md border border-r-0 border-gray-300 bg-gray-50 text-gray-500 text-sm"
|
|
838
838
|
}, [
|
|
839
|
-
|
|
840
|
-
l("span", null,
|
|
841
|
-
], 8,
|
|
839
|
+
Jt,
|
|
840
|
+
l("span", null, g(u.label), 1)
|
|
841
|
+
], 8, Zt),
|
|
842
842
|
(o(), i("input", {
|
|
843
843
|
id: u.key,
|
|
844
844
|
ref_for: !0,
|
|
@@ -849,7 +849,7 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
849
849
|
type: "text",
|
|
850
850
|
class: "flex-1 min-w-0 block w-full px-3 py-2 rounded-none rounded-r-md focus:ring-indigo-500 focus:border-indigo-500 text-sm border-gray-300",
|
|
851
851
|
onInput: (O) => s.onChange(u.key, O.target.value)
|
|
852
|
-
}, null, 40,
|
|
852
|
+
}, null, 40, Xt)),
|
|
853
853
|
l("div", es, [
|
|
854
854
|
l("button", {
|
|
855
855
|
class: "rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",
|
|
@@ -899,19 +899,19 @@ const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
|
899
899
|
for (const [f, d] of p)
|
|
900
900
|
n[f] = d;
|
|
901
901
|
return n;
|
|
902
|
-
}, ds = {}, hs = { class: "flex flex-col" }, fs = { class: "-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8" }, ps = { class: "py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8" },
|
|
903
|
-
function
|
|
902
|
+
}, ds = {}, hs = { class: "flex flex-col" }, fs = { class: "-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8" }, ps = { class: "py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8" }, gs = { class: "shadow border-b border-gray-200 relative" };
|
|
903
|
+
function vs(s, p) {
|
|
904
904
|
return o(), i("div", hs, [
|
|
905
905
|
l("div", fs, [
|
|
906
906
|
l("div", ps, [
|
|
907
|
-
l("div",
|
|
907
|
+
l("div", gs, [
|
|
908
908
|
w(s.$slots, "default")
|
|
909
909
|
])
|
|
910
910
|
])
|
|
911
911
|
])
|
|
912
912
|
]);
|
|
913
913
|
}
|
|
914
|
-
const ms = /* @__PURE__ */ cs(ds, [["render",
|
|
914
|
+
const ms = /* @__PURE__ */ cs(ds, [["render", vs]]), bs = ["dusk"], ys = { class: "flex flex-row flex-wrap justify-start space-x-2 sm:flex-nowrap" }, ws = {
|
|
915
915
|
key: 0,
|
|
916
916
|
class: "order-2 sm:order-1"
|
|
917
917
|
}, xs = { class: "flex flex-row order-1 w-full mb-2 sm:w-auto sm:flex-grow sm:order-2 sm:mb-0" }, ks = {
|
|
@@ -995,11 +995,11 @@ const ms = /* @__PURE__ */ cs(ds, [["render", gs]]), bs = ["dusk"], ys = { class
|
|
|
995
995
|
const f = S(0), d = Be(), t = $(() => {
|
|
996
996
|
let a = d.props.queryBuilderProps ? d.props.queryBuilderProps[n.name] || {} : {};
|
|
997
997
|
return a._updates = f.value, a;
|
|
998
|
-
}), r = S(t.value), u = $(() => t.value.pageName), m = S([]), O = S(null), q = $(() => !(t.value.hasToggleableColumns || t.value.hasFilters || t.value.hasSearchInputs || t.value.globalSearch)), y = $(() => Object.keys(n.resource).length === 0 ? n.data : "data" in n.resource ? n.resource.data : n.resource),
|
|
998
|
+
}), r = S(t.value), u = $(() => t.value.pageName), m = S([]), O = S(null), q = $(() => !(t.value.hasToggleableColumns || t.value.hasFilters || t.value.hasSearchInputs || t.value.globalSearch)), y = $(() => Object.keys(n.resource).length === 0 ? n.data : "data" in n.resource ? n.resource.data : n.resource), L = $(() => Object.keys(n.resource).length === 0 ? n.meta : "links" in n.resource && "meta" in n.resource && Object.keys(n.resource.links).length === 4 && "next" in n.resource.links && "prev" in n.resource.links ? {
|
|
999
999
|
...n.resource.meta,
|
|
1000
1000
|
next_page_url: n.resource.links.next,
|
|
1001
1001
|
prev_page_url: n.resource.links.prev
|
|
1002
|
-
} : "meta" in n.resource ? n.resource.meta : n.resource),
|
|
1002
|
+
} : "meta" in n.resource ? n.resource.meta : n.resource), V = $(() => y.value.length > 0 || L.value.total > 0);
|
|
1003
1003
|
function he(a, c) {
|
|
1004
1004
|
p("rowClick", a, c);
|
|
1005
1005
|
}
|
|
@@ -1016,18 +1016,18 @@ const ms = /* @__PURE__ */ cs(ds, [["render", gs]]), bs = ["dusk"], ys = { class
|
|
|
1016
1016
|
if (a[u.value] > 1)
|
|
1017
1017
|
return !0;
|
|
1018
1018
|
const h = n.name === "default" ? "" : n.name + "_";
|
|
1019
|
-
let
|
|
1020
|
-
return
|
|
1019
|
+
let v = !1;
|
|
1020
|
+
return j(["filter", "columns", "cursor", "sort"], (b) => {
|
|
1021
1021
|
const R = a[h + b];
|
|
1022
|
-
b === "sort" && R === t.value.defaultSort || R !== void 0 && (
|
|
1023
|
-
}),
|
|
1022
|
+
b === "sort" && R === t.value.defaultSort || R !== void 0 && (v = !0);
|
|
1023
|
+
}), v;
|
|
1024
1024
|
});
|
|
1025
1025
|
function te() {
|
|
1026
|
-
m.value = [],
|
|
1026
|
+
m.value = [], j(r.value.filters, (a, c) => {
|
|
1027
1027
|
r.value.filters[c].value = null;
|
|
1028
|
-
}),
|
|
1028
|
+
}), j(r.value.searchInputs, (a, c) => {
|
|
1029
1029
|
r.value.searchInputs[c].value = null;
|
|
1030
|
-
}),
|
|
1030
|
+
}), j(r.value.columns, (a, c) => {
|
|
1031
1031
|
r.value.columns[c].hidden = a.can_be_hidden ? !t.value.defaultVisibleToggleableColumns.includes(a.key) : !1;
|
|
1032
1032
|
}), r.value.sort = null, r.value.cursor = null, r.value.page = 1;
|
|
1033
1033
|
}
|
|
@@ -1056,35 +1056,35 @@ const ms = /* @__PURE__ */ cs(ds, [["render", gs]]), bs = ["dusk"], ys = { class
|
|
|
1056
1056
|
const h = I("columns", a);
|
|
1057
1057
|
r.value.columns[h].hidden = !c;
|
|
1058
1058
|
}
|
|
1059
|
-
function
|
|
1059
|
+
function ge() {
|
|
1060
1060
|
let a = {};
|
|
1061
|
-
return
|
|
1061
|
+
return j(r.value.searchInputs, (c) => {
|
|
1062
1062
|
c.value !== null && (a[c.key] = c.value);
|
|
1063
|
-
}),
|
|
1063
|
+
}), j(r.value.filters, (c) => {
|
|
1064
1064
|
c.value !== null && (a[c.key] = c.value);
|
|
1065
1065
|
}), a;
|
|
1066
1066
|
}
|
|
1067
|
-
function
|
|
1067
|
+
function ve() {
|
|
1068
1068
|
const a = r.value.columns;
|
|
1069
|
-
let c = je(a, (
|
|
1069
|
+
let c = je(a, (v) => !v.hidden), h = Ve(c, (v) => v.key).sort();
|
|
1070
1070
|
return Le(h, t.value.defaultVisibleToggleableColumns) ? {} : h;
|
|
1071
1071
|
}
|
|
1072
1072
|
function me() {
|
|
1073
|
-
const a =
|
|
1073
|
+
const a = ge(), c = ve(), h = {};
|
|
1074
1074
|
Object.keys(a).length > 0 && (h.filter = a), Object.keys(c).length > 0 && (h.columns = c);
|
|
1075
|
-
const
|
|
1076
|
-
return
|
|
1075
|
+
const v = r.value.cursor, b = r.value.page, R = r.value.sort, ie = r.value.perPage;
|
|
1076
|
+
return v && (h.cursor = v), b > 1 && (h.page = b), ie > 1 && (h.perPage = ie), R && (h.sort = R), h;
|
|
1077
1077
|
}
|
|
1078
1078
|
function be() {
|
|
1079
1079
|
const a = U.parse(location.search.substring(1)), c = n.name === "default" ? "" : n.name + "_";
|
|
1080
|
-
|
|
1081
|
-
delete a[c +
|
|
1082
|
-
}), delete a[u.value],
|
|
1083
|
-
b === "page" ? a[u.value] =
|
|
1080
|
+
j(["filter", "columns", "cursor", "sort"], (v) => {
|
|
1081
|
+
delete a[c + v];
|
|
1082
|
+
}), delete a[u.value], j(me(), (v, b) => {
|
|
1083
|
+
b === "page" ? a[u.value] = v : b === "perPage" ? a.perPage = v : a[c + b] = v;
|
|
1084
1084
|
});
|
|
1085
1085
|
let h = U.stringify(a, {
|
|
1086
|
-
filter(
|
|
1087
|
-
return typeof b == "object" && b !== null ?
|
|
1086
|
+
filter(v, b) {
|
|
1087
|
+
return typeof b == "object" && b !== null ? ze(b) : b;
|
|
1088
1088
|
},
|
|
1089
1089
|
skipNulls: !0,
|
|
1090
1090
|
strictNullHandling: !0
|
|
@@ -1119,7 +1119,7 @@ const ms = /* @__PURE__ */ cs(ds, [["render", gs]]), bs = ["dusk"], ys = { class
|
|
|
1119
1119
|
}
|
|
1120
1120
|
);
|
|
1121
1121
|
}
|
|
1122
|
-
|
|
1122
|
+
Z(r, () => {
|
|
1123
1123
|
K(location.pathname + "?" + be());
|
|
1124
1124
|
}, { deep: !0 });
|
|
1125
1125
|
const ae = () => {
|
|
@@ -1158,7 +1158,7 @@ const ms = /* @__PURE__ */ cs(ds, [["render", gs]]), bs = ["dusk"], ys = { class
|
|
|
1158
1158
|
filters: e(t).filters,
|
|
1159
1159
|
onFilterChange: N
|
|
1160
1160
|
}, () => [
|
|
1161
|
-
e(
|
|
1161
|
+
e(V) ? (o(), _(Vt, {
|
|
1162
1162
|
key: 0,
|
|
1163
1163
|
"has-enabled-filters": e(t).hasEnabledFilters,
|
|
1164
1164
|
filters: e(t).filters,
|
|
@@ -1173,7 +1173,7 @@ const ms = /* @__PURE__ */ cs(ds, [["render", gs]]), bs = ["dusk"], ys = { class
|
|
|
1173
1173
|
value: e(t).globalSearch ? e(t).globalSearch.value : null,
|
|
1174
1174
|
onChange: le
|
|
1175
1175
|
}, () => [
|
|
1176
|
-
s.showGlobalSearch && e(t).globalSearch
|
|
1176
|
+
s.showGlobalSearch && e(t).globalSearch ? (o(), _(Ut, {
|
|
1177
1177
|
key: 0,
|
|
1178
1178
|
class: "flex-grow",
|
|
1179
1179
|
label: e(t).globalSearch.label,
|
|
@@ -1196,7 +1196,7 @@ const ms = /* @__PURE__ */ cs(ds, [["render", gs]]), bs = ["dusk"], ys = { class
|
|
|
1196
1196
|
searchInputs: e(t).searchInputsWithoutGlobal,
|
|
1197
1197
|
onAdd: ee
|
|
1198
1198
|
}, () => [
|
|
1199
|
-
s.showGlobalSearch && e(t).hasSearchInputs && e(
|
|
1199
|
+
s.showGlobalSearch && e(t).hasSearchInputs && e(V) ? (o(), _(mt, {
|
|
1200
1200
|
key: 0,
|
|
1201
1201
|
class: "order-3 sm:order-4",
|
|
1202
1202
|
"search-inputs": e(t).searchInputsWithoutGlobal,
|
|
@@ -1238,7 +1238,7 @@ const ms = /* @__PURE__ */ cs(ds, [["render", gs]]), bs = ["dusk"], ys = { class
|
|
|
1238
1238
|
filters: e(t).filters,
|
|
1239
1239
|
"on-filter-change": N
|
|
1240
1240
|
}, null, 8, ["filters"])) : x("", !0),
|
|
1241
|
-
w(a.$slots, "tableWrapper", { meta: e(
|
|
1241
|
+
w(a.$slots, "tableWrapper", { meta: e(L) }, () => [
|
|
1242
1242
|
D(ms, {
|
|
1243
1243
|
class: k({ "mt-3": !e(q) })
|
|
1244
1244
|
}, {
|
|
@@ -1261,42 +1261,42 @@ const ms = /* @__PURE__ */ cs(ds, [["render", gs]]), bs = ["dusk"], ys = { class
|
|
|
1261
1261
|
]),
|
|
1262
1262
|
l("tbody", Ss, [
|
|
1263
1263
|
w(a.$slots, "body", { show: Q }, () => [
|
|
1264
|
-
(o(!0), i(B, null, P(e(y), (h,
|
|
1265
|
-
key: `table-${s.name}-row-${
|
|
1264
|
+
(o(!0), i(B, null, P(e(y), (h, v) => (o(), i("tr", {
|
|
1265
|
+
key: `table-${s.name}-row-${v}`,
|
|
1266
1266
|
class: k(["", {
|
|
1267
|
-
"bg-gray-50": s.striped &&
|
|
1267
|
+
"bg-gray-50": s.striped && v % 2,
|
|
1268
1268
|
"hover:bg-gray-100": s.striped,
|
|
1269
1269
|
"hover:bg-gray-50": !s.striped
|
|
1270
1270
|
}]),
|
|
1271
|
-
onClick: (b) => he(h,
|
|
1271
|
+
onClick: (b) => he(h, v)
|
|
1272
1272
|
}, [
|
|
1273
1273
|
(o(!0), i(B, null, P(e(t).columns, (b) => E((o(), i("td", {
|
|
1274
|
-
key: `table-${s.name}-row-${
|
|
1274
|
+
key: `table-${s.name}-row-${v}-column-${b.key}`,
|
|
1275
1275
|
class: "px-6 py-4 text-sm text-gray-500 whitespace-nowrap"
|
|
1276
1276
|
}, [
|
|
1277
1277
|
w(a.$slots, `cell(${b.key})`, { item: h }, () => [
|
|
1278
|
-
|
|
1278
|
+
T(g(h[b.key]), 1)
|
|
1279
1279
|
])
|
|
1280
1280
|
])), [
|
|
1281
1281
|
[A, Q(b.key)]
|
|
1282
1282
|
])), 128))
|
|
1283
1283
|
], 10, qs))), 128))
|
|
1284
1284
|
]),
|
|
1285
|
-
e(
|
|
1285
|
+
e(V) ? x("", !0) : (o(), i("tr", Fs, Ps))
|
|
1286
1286
|
])
|
|
1287
1287
|
])
|
|
1288
1288
|
]),
|
|
1289
1289
|
w(a.$slots, "pagination", {
|
|
1290
1290
|
onClick: K,
|
|
1291
|
-
hasData: e(
|
|
1292
|
-
meta: e(
|
|
1291
|
+
hasData: e(V),
|
|
1292
|
+
meta: e(L),
|
|
1293
1293
|
perPageOptions: e(t).perPageOptions,
|
|
1294
1294
|
onPerPageChange: re
|
|
1295
1295
|
}, () => [
|
|
1296
1296
|
D(ft, {
|
|
1297
1297
|
"on-click": K,
|
|
1298
|
-
"has-data": e(
|
|
1299
|
-
meta: e(
|
|
1298
|
+
"has-data": e(V),
|
|
1299
|
+
meta: e(L),
|
|
1300
1300
|
"per-page-options": e(t).perPageOptions,
|
|
1301
1301
|
"on-per-page-change": re
|
|
1302
1302
|
}, null, 8, ["has-data", "meta", "per-page-options"])
|
|
@@ -1312,9 +1312,9 @@ const ms = /* @__PURE__ */ cs(ds, [["render", gs]]), bs = ["dusk"], ys = { class
|
|
|
1312
1312
|
}
|
|
1313
1313
|
};
|
|
1314
1314
|
export {
|
|
1315
|
-
|
|
1315
|
+
J as ButtonWithDropdown,
|
|
1316
1316
|
Ke as HeaderCell,
|
|
1317
|
-
|
|
1317
|
+
Me as OnClickOutside,
|
|
1318
1318
|
ft as Pagination,
|
|
1319
1319
|
Qs as Table,
|
|
1320
1320
|
mt as TableAddSearchRow,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(c,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@popperjs/core/lib/popper-lite"),require("@popperjs/core/lib/modifiers/preventOverflow"),require("@popperjs/core/lib/modifiers/flip"),require("lodash-es/uniq"),require("lodash-es/find"),require("@inertiajs/vue3"),require("qs"),require("lodash-es/clone"),require("lodash-es/filter"),require("lodash-es/findKey"),require("lodash-es/forEach"),require("lodash-es/isEqual"),require("lodash-es/map"),require("lodash-es/pickBy")):typeof define=="function"&&define.amd?define(["exports","vue","@popperjs/core/lib/popper-lite","@popperjs/core/lib/modifiers/preventOverflow","@popperjs/core/lib/modifiers/flip","lodash-es/uniq","lodash-es/find","@inertiajs/vue3","qs","lodash-es/clone","lodash-es/filter","lodash-es/findKey","lodash-es/forEach","lodash-es/isEqual","lodash-es/map","lodash-es/pickBy"],e):(c=typeof globalThis<"u"?globalThis:c||self,e((c.Inertia=c.Inertia||{},c.Inertia["js Tables for Laravel Query Builder"]={}),c.Vue,c.popperLite,c.preventOverflow,c.flip,c.uniq,c.find,c.vue3,c.qs,c.clone,c.filter,c.findKey,c.forEach,c.isEqual,c.map,c.pickBy))})(this,function(c,e,ne,le,oe,ae,se,z,ie,ce,de,ue,fe,me,pe,he){"use strict";const k=r=>r&&typeof r=="object"&&"default"in r?r:{default:r},ge=k(le),ye=k(oe),ke=k(ae),be=k(se),V=k(ie),we=k(ce),_e=k(de),xe=k(ue),w=k(fe),Ce=k(me),Be=k(pe),Ee=k(he),L={__name:"OnClickOutside",props:{do:{type:Function,required:!0}},setup(r){const f=r,l=e.ref(null),u=e.ref(null);return e.onMounted(()=>{l.value=i=>{i.target===u.value||u.value.contains(i.target)||f.do()},document.addEventListener("click",l.value),document.addEventListener("touchstart",l.value)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",l.value),document.removeEventListener("touchstart",l.value)}),(i,t)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"root",ref:u},[e.renderSlot(i.$slots,"default")],512))}},$e={class:"relative"},Ve=["dusk","disabled","onClick"],Ne={class:"mt-2 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5"},E={__name:"ButtonWithDropdown",props:{placement:{type:String,default:"bottom-start",required:!1},active:{type:Boolean,default:!1,required:!1},dusk:{type:String,default:null,required:!1},disabled:{type:Boolean,default:!1,required:!1}},setup(r,{expose:f}){const l=r,u=e.ref(!1),i=e.ref(null);function t(){u.value=!u.value}function n(){u.value=!1}e.watch(u,()=>{i.value.update()});const a=e.ref(null),p=e.ref(null);e.onMounted(()=>{i.value=ne.createPopper(a.value,p.value,{placement:l.placement,modifiers:[ye.default,ge.default]})}),f({hide:n});const b=e.inject("activeClasses");return(y,g)=>(e.openBlock(),e.createBlock(L,{do:n},{default:e.withCtx(()=>[e.createElementVNode("div",$e,[e.createElementVNode("button",{ref_key:"button",ref:a,type:"button",dusk:r.dusk,disabled:r.disabled,class:e.normalizeClass(["w-full bg-white border rounded-md shadow-sm px-4 py-2 inline-flex justify-center text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",{[e.unref(b).border]:l.active,"border-gray-300":!l.active,"cursor-not-allowed":l.disabled}]),"aria-haspopup":"true",onClick:e.withModifiers(t,["prevent"])},[e.renderSlot(y.$slots,"button")],10,Ve),e.withDirectives(e.createElementVNode("div",{ref_key:"tooltip",ref:p,class:"absolute z-10"},[e.createElementVNode("div",Ne,[e.renderSlot(y.$slots,"default")])],512),[[e.vShow,u.value]])])]),_:3}))}},Se={class:"flex flex-row items-center"},qe={class:"uppercase"},Fe=["sorted"],De={key:0,fill:"currentColor",d:"M41 288h238c21.4 0 32.1 25.9 17 41L177 448c-9.4 9.4-24.6 9.4-33.9 0L24 329c-15.1-15.1-4.4-41 17-41zm255-105L177 64c-9.4-9.4-24.6-9.4-33.9 0L24 183c-15.1 15.1-4.4 41 17 41h238c21.4 0 32.1-25.9 17-41z"},je={key:1,fill:"currentColor",d:"M279 224H41c-21.4 0-32.1-25.9-17-41L143 64c9.4-9.4 24.6-9.4 33.9 0l119 119c15.2 15.1 4.5 41-16.9 41z"},Te={key:2,fill:"currentColor",d:"M41 288h238c21.4 0 32.1 25.9 17 41L177 448c-9.4 9.4-24.6 9.4-33.9 0L24 329c-15.1-15.1-4.4-41 17-41z"},M={__name:"HeaderCell",props:{cell:{type:Object,required:!0}},setup(r){const f=r,l=e.inject("activeClasses");function u(){f.cell.sortable&&f.cell.onSort(f.cell.key)}return(i,t)=>e.withDirectives((e.openBlock(),e.createElementBlock("th",null,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.cell.sortable?"button":"div"),{class:"py-3 px-6 w-full",dusk:r.cell.sortable?`sort-${r.cell.key}`:null,onClick:e.withModifiers(u,["prevent"])},{default:e.withCtx(()=>[e.createElementVNode("span",Se,[e.renderSlot(i.$slots,"label",{},()=>[e.createElementVNode("span",qe,e.toDisplayString(r.cell.label),1)]),e.renderSlot(i.$slots,"sort",{},()=>[r.cell.sortable?(e.openBlock(),e.createElementBlock("svg",{key:0,"aria-hidden":"true",class:e.normalizeClass(["w-3 h-3 ml-2",{"text-gray-400":!r.cell.sorted,[e.unref(l).text]:r.cell.sorted}]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",sorted:r.cell.sorted},[r.cell.sorted?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("path",De)),r.cell.sorted==="asc"?(e.openBlock(),e.createElementBlock("path",je)):e.createCommentVNode("",!0),r.cell.sorted==="desc"?(e.openBlock(),e.createElementBlock("path",Te)):e.createCommentVNode("",!0)],10,Fe)):e.createCommentVNode("",!0)])])]),_:3},8,["dusk","onClick"]))],512)),[[e.vShow,!r.cell.hidden]])}},N={translations:{next:"Next",no_results_found:"No results found",of:"of",per_page:"per page",previous:"Previous",results:"results",to:"to"}};function S(){return N.translations}function ze(r,f){N.translations[r]=f}function Le(r){N.translations=r}const Me=["dusk","value"],Oe=["value"],O={__name:"PerPageSelector",props:{dusk:{type:String,default:null,required:!1},value:{type:Number,default:15,required:!1},options:{type:Array,default(){return[15,30,50,100]},required:!1},onChange:{type:Function,required:!0}},setup(r){const f=r,l=S(),u=e.computed(()=>{let i=[...f.options];return i.push(parseInt(f.value)),ke.default(i).sort((t,n)=>t-n)});return(i,t)=>(e.openBlock(),e.createElementBlock("select",{name:"per_page",dusk:r.dusk,value:r.value,class:"block focus:ring-indigo-500 focus:border-indigo-500 min-w-max shadow-sm text-sm border-gray-300 rounded-md",onChange:t[0]||(t[0]=n=>r.onChange(n.target.value))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),n=>(e.openBlock(),e.createElementBlock("option",{key:n,value:n},e.toDisplayString(n)+" "+e.toDisplayString(e.unref(l).per_page),9,Oe))),128))],40,Me))}},Pe={key:0,class:"bg-white px-4 py-3 flex items-center justify-between border-t border-gray-200 sm:px-6"},Ie={key:0},Re=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 16l-4-4m0 0l4-4m-4 4h18"})],-1),We={class:"hidden sm:inline ml-2"},Ae={class:"hidden sm:inline mr-2"},Ge=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17 8l4 4m0 0l-4 4m4-4H3"})],-1),He={key:2,class:"hidden sm:flex-1 sm:flex sm:items-center sm:justify-between"},Ke={class:"flex flex-row space-x-4 items-center flex-grow"},Qe={class:"hidden lg:block text-sm text-gray-700 flex-grow"},Ue={class:"font-medium"},Ye={class:"font-medium"},Je={class:"font-medium"},Xe={class:"relative z-0 inline-flex rounded-md shadow-sm -space-x-px","aria-label":"Pagination"},Ze={class:"sr-only"},ve=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z","clip-rule":"evenodd"})],-1),et={class:"sr-only"},tt=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z","clip-rule":"evenodd"})],-1),P={__name:"Pagination",props:{onClick:{type:Function,required:!1},perPageOptions:{type:Array,default(){return()=>[15,30,50,100]},required:!1},onPerPageChange:{type:Function,default(){return()=>{}},required:!1},hasData:{type:Boolean,required:!0},meta:{type:Object,required:!1}},setup(r){const f=r,l=S(),u=e.computed(()=>"links"in t.value?t.value.links.length>0:!1),i=e.computed(()=>Object.keys(t.value).length>0&&t.value.total>1),t=e.computed(()=>f.meta),n=e.computed(()=>"prev_page_url"in t.value?t.value.prev_page_url:null),a=e.computed(()=>"next_page_url"in t.value?t.value.next_page_url:null),p=e.computed(()=>parseInt(t.value.per_page));return(b,y)=>e.unref(i)?(e.openBlock(),e.createElementBlock("nav",Pe,[e.createTextVNode(e.toDisplayString(e.unref(i))+" ",1),!r.hasData||e.unref(t).total<1?(e.openBlock(),e.createElementBlock("p",Ie,e.toDisplayString(e.unref(l).no_results_found),1)):e.createCommentVNode("",!0),r.hasData?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex-1 flex justify-between",{"sm:hidden":e.unref(u)}])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(n)?"a":"div"),{class:e.normalizeClass([{"cursor-not-allowed text-gray-400":!e.unref(n),"text-gray-700 hover:text-gray-500":e.unref(n)},"relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md bg-white"]),href:e.unref(n),dusk:e.unref(n)?"pagination-simple-previous":null,onClick:y[0]||(y[0]=e.withModifiers(g=>r.onClick(e.unref(n)),["prevent"]))},{default:e.withCtx(()=>[Re,e.createElementVNode("span",We,e.toDisplayString(e.unref(l).previous),1)]),_:1},8,["class","href","dusk"])),e.createVNode(O,{dusk:"per-page-mobile",value:e.unref(p),options:r.perPageOptions,"on-change":r.onPerPageChange},null,8,["value","options","on-change"]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(a)?"a":"div"),{class:e.normalizeClass([{"cursor-not-allowed text-gray-400":!e.unref(a),"text-gray-700 hover:text-gray-500":e.unref(a)},"ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md bg-white"]),href:e.unref(a),dusk:e.unref(a)?"pagination-simple-next":null,onClick:y[1]||(y[1]=e.withModifiers(g=>r.onClick(e.unref(a)),["prevent"]))},{default:e.withCtx(()=>[e.createElementVNode("span",Ae,e.toDisplayString(e.unref(l).next),1),Ge]),_:1},8,["class","href","dusk"]))],2)):e.createCommentVNode("",!0),r.hasData&&e.unref(u)?(e.openBlock(),e.createElementBlock("div",He,[e.createElementVNode("div",Ke,[e.createVNode(O,{dusk:"per-page-full",value:e.unref(p),options:r.perPageOptions,"on-change":r.onPerPageChange},null,8,["value","options","on-change"]),e.createElementVNode("p",Qe,[e.createElementVNode("span",Ue,e.toDisplayString(e.unref(t).from),1),e.createTextVNode(" "+e.toDisplayString(e.unref(l).to)+" ",1),e.createElementVNode("span",Ye,e.toDisplayString(e.unref(t).to),1),e.createTextVNode(" "+e.toDisplayString(e.unref(l).of)+" ",1),e.createElementVNode("span",Je,e.toDisplayString(e.unref(t).total),1),e.createTextVNode(" "+e.toDisplayString(e.unref(l).results),1)])]),e.createElementVNode("div",null,[e.createElementVNode("nav",Xe,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(n)?"a":"div"),{class:e.normalizeClass([{"cursor-not-allowed text-gray-400":!e.unref(n),"text-gray-500 hover:bg-gray-50":e.unref(n)},"relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium"]),href:e.unref(n),dusk:e.unref(n)?"pagination-previous":null,onClick:y[2]||(y[2]=e.withModifiers(g=>r.onClick(e.unref(n)),["prevent"]))},{default:e.withCtx(()=>[e.createElementVNode("span",Ze,e.toDisplayString(e.unref(l).previous),1),ve]),_:1},8,["class","href","dusk"])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).links,(g,x)=>(e.openBlock(),e.createElementBlock("div",{key:x},[e.renderSlot(b.$slots,"link",{},()=>[!isNaN(g.label)||g.label==="..."?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g.url?"a":"div"),{key:0,href:g.url,dusk:g.url?`pagination-${g.label}`:null,class:e.normalizeClass(["relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700",{"cursor-not-allowed":!g.url,"hover:bg-gray-50":g.url,"bg-gray-100":g.active}]),onClick:e.withModifiers(_=>r.onClick(g.url),["prevent"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.label),1)]),_:2},1032,["href","dusk","class","onClick"])):e.createCommentVNode("",!0)])]))),128)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(a)?"a":"div"),{class:e.normalizeClass([{"cursor-not-allowed text-gray-400":!e.unref(a),"text-gray-500 hover:bg-gray-50":e.unref(a)},"relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium"]),href:e.unref(a),dusk:e.unref(a)?"pagination-next":null,onClick:y[3]||(y[3]=e.withModifiers(g=>r.onClick(e.unref(a)),["prevent"]))},{default:e.withCtx(()=>[e.createElementVNode("span",et,e.toDisplayString(e.unref(l).next),1),tt]),_:1},8,["class","href","dusk"]))])])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}},rt=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z","clip-rule":"evenodd"})],-1),nt={role:"menu","aria-orientation":"horizontal","aria-labelledby":"add-search-input-menu",class:"min-w-max"},lt=["dusk","onClick"],I={__name:"TableAddSearchRow",props:{searchInputs:{type:Object,required:!0},hasSearchInputsWithoutValue:{type:Boolean,required:!0},onAdd:{type:Function,required:!0}},setup(r){const f=r,l=e.ref(null);function u(i){f.onAdd(i),l.value.hide()}return(i,t)=>(e.openBlock(),e.createBlock(E,{ref_key:"dropdown",ref:l,dusk:"add-search-row-dropdown",disabled:!r.hasSearchInputsWithoutValue,class:"w-auto"},{button:e.withCtx(()=>[rt]),default:e.withCtx(()=>[e.createElementVNode("div",nt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.searchInputs,(n,a)=>(e.openBlock(),e.createElementBlock("button",{key:a,dusk:`add-search-row-${n.key}`,class:"text-left w-full px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900",role:"menuitem",onClick:e.withModifiers(p=>u(n.key),["prevent"])},e.toDisplayString(n.label),9,lt))),128))])]),_:1},8,["disabled"]))}},ot=[e.createElementVNode("path",{d:"M10 12a2 2 0 100-4 2 2 0 000 4z"},null,-1),e.createElementVNode("path",{"fill-rule":"evenodd",d:"M.458 10C1.732 5.943 5.522 3 10 3s8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7S1.732 14.057.458 10zM14 10a4 4 0 11-8 0 4 4 0 018 0z","clip-rule":"evenodd"},null,-1)],at={role:"menu","aria-orientation":"horizontal","aria-labelledby":"toggle-columns-menu",class:"min-w-max"},st={class:"px-2"},it={class:"divide-y divide-gray-200"},ct={class:"text-sm text-gray-900"},dt=["aria-pressed","aria-labelledby","aria-describedby","dusk","onClick"],ut=e.createElementVNode("span",{class:"sr-only"},"Column status",-1),R={__name:"TableColumns",props:{columns:{type:Object,required:!0},hasHiddenColumns:{type:Boolean,required:!0},onChange:{type:Function,required:!0}},setup(r){const f=r,l=e.inject("activeClasses");return(u,i)=>(e.openBlock(),e.createBlock(E,{placement:"bottom-end",dusk:"columns-dropdown",active:r.hasHiddenColumns},{button:e.withCtx(()=>[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass(["h-5 w-5",{"text-gray-400":!r.hasHiddenColumns,[e.unref(l).text]:r.hasHiddenColumns}]),viewBox:"0 0 20 20",fill:"currentColor"},ot,2))]),default:e.withCtx(()=>[e.createElementVNode("div",at,[e.createElementVNode("div",st,[e.createElementVNode("ul",it,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.columns,(t,n)=>e.withDirectives((e.openBlock(),e.createElementBlock("li",{key:n,class:"py-2 flex items-center justify-between"},[e.createElementVNode("p",ct,e.toDisplayString(t.label),1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["ml-4 relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-light-blue-500",{"bg-green-500":!t.hidden,"bg-gray-200":t.hidden}]),"aria-pressed":!t.hidden,"aria-labelledby":`toggle-column-${t.key}`,"aria-describedby":`toggle-column-${t.key}`,dusk:`toggle-column-${t.key}`,onClick:e.withModifiers(a=>r.onChange(t.key,t.hidden),["prevent"])},[ut,e.createElementVNode("span",{"aria-hidden":"true",class:e.normalizeClass([{"translate-x-5":!t.hidden,"translate-x-0":t.hidden},"inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200"])},null,2)],10,dt)])),[[e.vShow,t.can_be_hidden]])),128))])])])]),_:1},8,["active"]))}},ft=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"},null,-1)],mt={role:"menu","aria-orientation":"horizontal","aria-labelledby":"filter-menu",class:"min-w-[320px]"},pt={class:"text-xs uppercase tracking-wide bg-gray-100 p-3"},ht={class:"p-2"},gt=["name","value","onChange"],yt=["value"],W={__name:"TableFilter",props:{hasEnabledFilters:{type:Boolean,required:!0},filters:{type:Object,required:!0},onFilterChange:{type:Function,required:!0}},setup(r){const f=e.inject("activeClasses");return(l,u)=>(e.openBlock(),e.createBlock(E,{placement:"bottom-end",dusk:"filters-dropdown",active:r.hasEnabledFilters},{button:e.withCtx(()=>[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass(["h-5 w-5",{"text-gray-400":!r.hasEnabledFilters,[e.unref(f).text]:r.hasEnabledFilters}]),viewBox:"0 0 20 20",fill:"currentColor"},ft,2))]),default:e.withCtx(()=>[e.createElementVNode("div",mt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.filters,(i,t)=>(e.openBlock(),e.createElementBlock("div",{key:t},[e.createElementVNode("h3",pt,e.toDisplayString(i.label),1),e.createElementVNode("div",ht,[i.type==="select"?(e.openBlock(),e.createElementBlock("select",{key:0,name:i.key,value:i.value,class:"block focus:ring-indigo-500 focus:border-indigo-500 w-full shadow-sm text-sm border-gray-300 rounded-md",onChange:n=>r.onFilterChange(i.key,n.target.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.options,(n,a)=>(e.openBlock(),e.createElementBlock("option",{key:a,value:a},e.toDisplayString(n),9,yt))),128))],40,gt)):e.createCommentVNode("",!0)])]))),128))])]),_:1},8,["active"]))}},kt={class:"flex items-center justify-start my-3 text-sm"},bt={class:"flex items-center"},wt=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-300",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"})],-1),_t={class:"text-gray-400 ml-1"},xt=["textContent"],Ct=["onClick"],Bt={class:"ml-1"},Et=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)],$t={__name:"TableActiveFilters",props:{filters:{type:Object,required:!0},onFilterChange:{type:Function,required:!0}},setup(r){const f=r,l=e.inject("activeClasses"),u=e.computed(()=>f.filters.filter(t=>t.value!==null)),i=e.computed(()=>u.value.length);return(t,n)=>(e.openBlock(),e.createElementBlock("div",kt,[e.createElementVNode("div",bt,[wt,e.createElementVNode("span",_t,[e.createTextVNode(e.toDisplayString(e.unref(i))+" active ",1),e.createElementVNode("span",{textContent:e.toDisplayString(e.unref(i)===1?"filter":"filters")},null,8,xt),e.createTextVNode(":")])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),a=>(e.openBlock(),e.createElementBlock("button",{key:a.label,class:e.normalizeClass(["block group ml-3 flex items-center justify-between px-2 py-1 rounded bg-gray-100",`hover:${e.unref(l).text}`]),onClick:p=>r.onFilterChange(a.key,null)},[e.createElementVNode("span",{class:e.normalizeClass(["capitalize text-gray-500",`group-hover:${e.unref(l).text}`])},e.toDisplayString(a.label.replace("_"," ")),3),e.createTextVNode(":"),e.createElementVNode("span",Bt,e.toDisplayString(a.options[a.value]),1),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([`group-hover:${e.unref(l).text}`,"h-4 w-4 ml-1 text-gray-400"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Et,2))],10,Ct))),128))]))}},Vt={class:"relative"},Nt=["placeholder","value"],St=e.createElementVNode("div",{class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-5 h-5 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z","clip-rule":"evenodd"})])],-1),A={__name:"TableGlobalSearch",props:{label:{type:String,default:"Search...",required:!1},value:{type:String,default:"",required:!1},onChange:{type:Function,required:!0}},setup(r){const f=e.inject("activeClasses");return(l,u)=>(e.openBlock(),e.createElementBlock("div",Vt,[e.createElementVNode("input",{class:e.normalizeClass(["block w-full text-sm border-gray-300 rounded-md shadow-sm pl-9",[e.unref(f).focusRing,e.unref(f).focusBorder]]),placeholder:r.label,value:r.value,type:"text",name:"global",onInput:u[0]||(u[0]=i=>r.onChange(i.target.value))},null,42,Nt),St]))}},qt={class:"flex rounded-md shadow-sm relative mt-3"},Ft=["for"],Dt=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 mr-2 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z","clip-rule":"evenodd"})],-1),jt=["id","name","value","onInput"],Tt={class:"absolute inset-y-0 right-0 pr-3 flex items-center"},zt=["dusk","onClick"],Lt=[e.createElementVNode("span",{class:"sr-only"},"Remove search",-1),e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)],G={__name:"TableSearchRows",props:{searchInputs:{type:Object,required:!0},forcedVisibleSearchInputs:{type:Array,required:!0},onChange:{type:Function,required:!0},onRemove:{type:Function,required:!0}},setup(r){const f=r,l={el:e.ref([])};let u=e.computed(()=>l.el.value);function i(t){return f.forcedVisibleSearchInputs.includes(t)}return e.watch(f.forcedVisibleSearchInputs,t=>{const n=t.length>0?t[t.length-1]:null;!n||e.nextTick().then(()=>{const a=be.default(u.value,p=>p.__vnode.key===n);a&&a.focus()})},{immediate:!0}),(t,n)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.searchInputs,(a,p)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:p,class:"px-4 sm:px-0"},[e.createElementVNode("div",qt,[e.createElementVNode("label",{for:a.key,class:"inline-flex items-center px-4 rounded-l-md border border-r-0 border-gray-300 bg-gray-50 text-gray-500 text-sm"},[Dt,e.createElementVNode("span",null,e.toDisplayString(a.label),1)],8,Ft),(e.openBlock(),e.createElementBlock("input",{id:a.key,ref_for:!0,ref:l.el,key:a.key,name:a.key,value:a.value,type:"text",class:"flex-1 min-w-0 block w-full px-3 py-2 rounded-none rounded-r-md focus:ring-indigo-500 focus:border-indigo-500 text-sm border-gray-300",onInput:b=>r.onChange(a.key,b.target.value)},null,40,jt)),e.createElementVNode("div",Tt,[e.createElementVNode("button",{class:"rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",dusk:`remove-search-row-${a.key}`,onClick:e.withModifiers(b=>r.onRemove(a.key),["prevent"])},Lt,8,zt)])])])),[[e.vShow,a.value!==null||i(a.key)]])),128))}},Mt=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 mr-2 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),e.createElementVNode("span",null,"Reset",-1)],H={__name:"TableReset",props:{onClick:{type:Function,required:!0}},setup(r){return(f,l)=>(e.openBlock(),e.createElementBlock("button",{ref:"button",type:"button",dusk:"reset-table",class:"w-full bg-white border rounded-md shadow-sm px-4 py-2 inline-flex justify-center text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 border-gray-300","aria-haspopup":"true",onClick:l[0]||(l[0]=e.withModifiers((...u)=>r.onClick&&r.onClick(...u),["prevent"]))},Mt,512))}},Ot=(r,f)=>{const l=r.__vccOpts||r;for(const[u,i]of f)l[u]=i;return l},Pt={},It={class:"flex flex-col"},Rt={class:"-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8"},Wt={class:"py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8"},At={class:"shadow border-b border-gray-200 relative"};function Gt(r,f){return e.openBlock(),e.createElementBlock("div",It,[e.createElementVNode("div",Rt,[e.createElementVNode("div",Wt,[e.createElementVNode("div",At,[e.renderSlot(r.$slots,"default")])])])])}const K=Ot(Pt,[["render",Gt]]),Ht=["dusk"],Kt={class:"flex flex-row flex-wrap justify-start space-x-2 sm:flex-nowrap"},Qt={key:0,class:"order-2 sm:order-1"},Ut={class:"flex flex-row order-1 w-full mb-2 sm:w-auto sm:flex-grow sm:order-2 sm:mb-0"},Yt={key:0,class:"order-5 ml-auto sm:order-3"},Jt={class:"min-w-full bg-white divide-y divide-gray-200"},Xt={class:"bg-gray-50"},Zt={class:"px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-500 uppercase"},vt={class:"bg-white divide-y divide-gray-200"},er=["onClick"],tr={key:0},rr=[e.createElementVNode("td",{class:"px-6 py-4 text-sm text-gray-500 whitespace-nowrap text-center",colspan:100}," Geen resultaten gevonden. ",-1)],nr={__name:"Table",props:{inertia:{type:Object,default:()=>({}),required:!1},name:{type:String,default:"default",required:!1},striped:{type:Boolean,default:!1,required:!1},preventOverlappingRequests:{type:Boolean,default:!0,required:!1},inputDebounceMs:{type:Number,default:350,required:!1},preserveScroll:{type:[Boolean,String],default:!1,required:!1},resource:{type:Object,default:()=>({}),required:!1},meta:{type:Object,default:()=>({}),required:!1},data:{type:Object,default:()=>({}),required:!1},activeClasses:{type:Object,required:!1,default(){return{text:"text-green-400",border:"border-green-300",focusRing:"focus:ring-indigo-500",focusBorder:"focus:border-indigo-500"}}},showGlobalSearch:{type:[Boolean,String],default:!0,required:!1}},emits:["rowClick"],setup(r,{emit:f}){const l=r;e.provide("activeClasses",l.activeClasses);const u=e.ref(0),i=z.usePage(),t=e.computed(()=>{let o=i.props.queryBuilderProps?i.props.queryBuilderProps[l.name]||{}:{};return o._updates=u.value,o}),n=e.ref(t.value),a=e.computed(()=>t.value.pageName),p=e.ref([]),b=e.ref(null),y=e.computed(()=>!(t.value.hasToggleableColumns||t.value.hasFilters||t.value.hasSearchInputs||t.value.globalSearch)),g=e.computed(()=>Object.keys(l.resource).length===0?l.data:"data"in l.resource?l.resource.data:l.resource),x=e.computed(()=>Object.keys(l.resource).length===0?l.meta:"links"in l.resource&&"meta"in l.resource&&Object.keys(l.resource.links).length===4&&"next"in l.resource.links&&"prev"in l.resource.links?{...l.resource.meta,next_page_url:l.resource.links.next,prev_page_url:l.resource.links.prev}:"meta"in l.resource?l.resource.meta:l.resource),_=e.computed(()=>g.value.length>0||x.value.total>0);function lr(o,s){f("rowClick",o,s)}function or(o){p.value=p.value.filter(s=>s!=o),$(o,null)}function Q(o){p.value.push(o)}const ar=e.computed(()=>{if(p.value.length>0)return!0;const o=V.default.parse(location.search.substring(1));if(o[a.value]>1)return!0;const d=l.name==="default"?"":l.name+"_";let m=!1;return w.default(["filter","columns","cursor","sort"],h=>{const B=o[d+h];h==="sort"&&B===t.value.defaultSort||B!==void 0&&(m=!0)}),m});function U(){p.value=[],w.default(n.value.filters,(o,s)=>{n.value.filters[s].value=null}),w.default(n.value.searchInputs,(o,s)=>{n.value.searchInputs[s].value=null}),w.default(n.value.columns,(o,s)=>{n.value.columns[s].hidden=o.can_be_hidden?!t.value.defaultVisibleToggleableColumns.includes(o.key):!1}),n.value.sort=null,n.value.cursor=null,n.value.page=1}const Y={};function $(o,s){clearTimeout(Y[o]),Y[o]=setTimeout(()=>{D.value&&l.preventOverlappingRequests&&D.value.cancel();const d=C("searchInputs",o);n.value.searchInputs[d].value=s,n.value.cursor=null,n.value.page=1},l.inputDebounceMs)}function J(o){$("global",o)}function q(o,s){const d=C("filters",o);n.value.filters[d].value=s,n.value.cursor=null,n.value.page=1}function X(o){n.value.cursor=null,n.value.perPage=o,n.value.page=1}function C(o,s){return xe.default(n.value[o],d=>d.key==s)}function Z(o,s){const d=C("columns",o);n.value.columns[d].hidden=!s}function sr(){let o={};return w.default(n.value.searchInputs,s=>{s.value!==null&&(o[s.key]=s.value)}),w.default(n.value.filters,s=>{s.value!==null&&(o[s.key]=s.value)}),o}function ir(){const o=n.value.columns;let s=_e.default(o,m=>!m.hidden),d=Be.default(s,m=>m.key).sort();return Ce.default(d,t.value.defaultVisibleToggleableColumns)?{}:d}function cr(){const o=sr(),s=ir(),d={};Object.keys(o).length>0&&(d.filter=o),Object.keys(s).length>0&&(d.columns=s);const m=n.value.cursor,h=n.value.page,B=n.value.sort,re=n.value.perPage;return m&&(d.cursor=m),h>1&&(d.page=h),re>1&&(d.perPage=re),B&&(d.sort=B),d}function dr(){const o=V.default.parse(location.search.substring(1)),s=l.name==="default"?"":l.name+"_";w.default(["filter","columns","cursor","sort"],m=>{delete o[s+m]}),delete o[a.value],w.default(cr(),(m,h)=>{h==="page"?o[a.value]=m:h==="perPage"?o.perPage=m:o[s+h]=m});let d=V.default.stringify(o,{filter(m,h){return typeof h=="object"&&h!==null?Ee.default(h):h},skipNulls:!0,strictNullHandling:!0});return(!d||d===a.value+"=1")&&(d=""),d}const F=e.ref(!1),D=e.ref(null);function j(o){!o||z.router.get(o,{},{replace:!0,preserveState:!0,preserveScroll:l.preserveScroll!==!1,onBefore(){F.value=!0},onCancelToken(s){D.value=s},onFinish(){F.value=!1},onSuccess(){if("queryBuilderProps"in i.props&&(n.value.cursor=t.value.cursor,n.value.page=t.value.page),l.preserveScroll==="table-top"){const d=b.value.getBoundingClientRect().top+window.pageYOffset+-8;window.scrollTo({top:d})}u.value++}})}e.watch(n,()=>{j(location.pathname+"?"+dr())},{deep:!0});const v=()=>{u.value++};e.onMounted(()=>{document.addEventListener("success",v)}),e.onUnmounted(()=>{document.removeEventListener("success",v)});function ee(o){n.value.sort==o?n.value.sort=`-${o}`:n.value.sort=o,n.value.cursor=null,n.value.page=1}function T(o){const s=C("columns",o);return!n.value.columns[s].hidden}function te(o){const s=C("columns",o),d=we.default(t.value.columns[s]);return d.onSort=ee,d}return(o,s)=>(e.openBlock(),e.createBlock(e.Transition,null,{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock("fieldset",{ref_key:"tableFieldset",ref:b,key:`table-${r.name}`,dusk:`table-${r.name}`,class:e.normalizeClass(["min-w-0",{"opacity-75":F.value}])},[e.createElementVNode("div",Kt,[e.unref(t).hasFilters?(e.openBlock(),e.createElementBlock("div",Qt,[e.renderSlot(o.$slots,"tableFilter",{hasFilters:e.unref(t).hasFilters,hasEnabledFilters:e.unref(t).hasEnabledFilters,filters:e.unref(t).filters,onFilterChange:q},()=>[e.unref(_)?(e.openBlock(),e.createBlock(W,{key:0,"has-enabled-filters":e.unref(t).hasEnabledFilters,filters:e.unref(t).filters,"on-filter-change":q},null,8,["has-enabled-filters","filters"])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",Ut,[e.renderSlot(o.$slots,"tableGlobalSearch",{hasGlobalSearch:e.unref(t).globalSearch,label:e.unref(t).globalSearch?e.unref(t).globalSearch.label:null,value:e.unref(t).globalSearch?e.unref(t).globalSearch.value:null,onChange:J},()=>[r.showGlobalSearch&&e.unref(t).globalSearch&&e.unref(_)?(e.openBlock(),e.createBlock(A,{key:0,class:"flex-grow",label:e.unref(t).globalSearch.label,value:e.unref(t).globalSearch.value,"on-change":J},null,8,["label","value"])):e.createCommentVNode("",!0)])]),e.renderSlot(o.$slots,"tableReset",{canBeReset:"canBeReset",onClick:U},()=>[e.unref(ar)?(e.openBlock(),e.createElementBlock("div",Yt,[e.createVNode(H,{"on-click":U})])):e.createCommentVNode("",!0)]),e.renderSlot(o.$slots,"tableAddSearchRow",{hasSearchInputs:e.unref(t).hasSearchInputs,hasSearchInputsWithoutValue:e.unref(t).hasSearchInputsWithoutValue,searchInputs:e.unref(t).searchInputsWithoutGlobal,onAdd:Q},()=>[r.showGlobalSearch&&e.unref(t).hasSearchInputs&&e.unref(_)?(e.openBlock(),e.createBlock(I,{key:0,class:"order-3 sm:order-4","search-inputs":e.unref(t).searchInputsWithoutGlobal,"has-search-inputs-without-value":e.unref(t).hasSearchInputsWithoutValue,"on-add":Q},null,8,["search-inputs","has-search-inputs-without-value"])):e.createCommentVNode("",!0)]),e.renderSlot(o.$slots,"tableColumns",{hasColumns:e.unref(t).hasToggleableColumns,columns:e.unref(t).columns,hasHiddenColumns:e.unref(t).hasHiddenColumns,onChange:Z},()=>[e.unref(t).hasToggleableColumns?(e.openBlock(),e.createBlock(R,{key:0,class:"order-4 sm:order-5",columns:e.unref(t).columns,"has-hidden-columns":e.unref(t).hasHiddenColumns,"on-change":Z},null,8,["columns","has-hidden-columns"])):e.createCommentVNode("",!0)])]),e.renderSlot(o.$slots,"tableSearchRows",{hasSearchRowsWithValue:e.unref(t).hasSearchInputsWithValue,searchInputs:e.unref(t).searchInputsWithoutGlobal,forcedVisibleSearchInputs:p.value,onChange:$},()=>[e.unref(t).hasSearchInputsWithValue||p.value.length>0?(e.openBlock(),e.createBlock(G,{key:0,"search-inputs":e.unref(t).searchInputsWithoutGlobal,"forced-visible-search-inputs":p.value,"on-change":$,"on-remove":or},null,8,["search-inputs","forced-visible-search-inputs"])):e.createCommentVNode("",!0)]),e.unref(t).hasEnabledFilters?(e.openBlock(),e.createBlock($t,{key:0,filters:e.unref(t).filters,"on-filter-change":q},null,8,["filters"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"tableWrapper",{meta:e.unref(x)},()=>[e.createVNode(K,{class:e.normalizeClass({"mt-3":!e.unref(y)})},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"table",{},()=>[e.createElementVNode("table",Jt,[e.createElementVNode("thead",Xt,[e.renderSlot(o.$slots,"head",{show:T,sortBy:ee,header:te},()=>[e.createElementVNode("tr",Zt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).columns,d=>(e.openBlock(),e.createBlock(M,{key:`table-${r.name}-header-${d.key}`,cell:te(d.key)},null,8,["cell"]))),128))])])]),e.createElementVNode("tbody",vt,[e.renderSlot(o.$slots,"body",{show:T},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(d,m)=>(e.openBlock(),e.createElementBlock("tr",{key:`table-${r.name}-row-${m}`,class:e.normalizeClass(["",{"bg-gray-50":r.striped&&m%2,"hover:bg-gray-100":r.striped,"hover:bg-gray-50":!r.striped}]),onClick:h=>lr(d,m)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).columns,h=>e.withDirectives((e.openBlock(),e.createElementBlock("td",{key:`table-${r.name}-row-${m}-column-${h.key}`,class:"px-6 py-4 text-sm text-gray-500 whitespace-nowrap"},[e.renderSlot(o.$slots,`cell(${h.key})`,{item:d},()=>[e.createTextVNode(e.toDisplayString(d[h.key]),1)])])),[[e.vShow,T(h.key)]])),128))],10,er))),128))]),e.unref(_)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",tr,rr))])])]),e.renderSlot(o.$slots,"pagination",{onClick:j,hasData:e.unref(_),meta:e.unref(x),perPageOptions:e.unref(t).perPageOptions,onPerPageChange:X},()=>[e.createVNode(P,{"on-click":j,"has-data":e.unref(_),meta:e.unref(x),"per-page-options":e.unref(t).perPageOptions,"on-per-page-change":X},null,8,["has-data","meta","per-page-options"])])]),_:3},8,["class"])])],10,Ht))]),_:3}))}};c.ButtonWithDropdown=E,c.HeaderCell=M,c.OnClickOutside=L,c.Pagination=P,c.Table=nr,c.TableAddSearchRow=I,c.TableColumns=R,c.TableFilter=W,c.TableGlobalSearch=A,c.TableReset=H,c.TableSearchRows=G,c.TableWrapper=K,c.getTranslations=S,c.setTranslation=ze,c.setTranslations=Le,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(c,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@popperjs/core/lib/popper-lite"),require("@popperjs/core/lib/modifiers/preventOverflow"),require("@popperjs/core/lib/modifiers/flip"),require("lodash-es/uniq"),require("lodash-es/find"),require("@inertiajs/vue3"),require("qs"),require("lodash-es/clone"),require("lodash-es/filter"),require("lodash-es/findKey"),require("lodash-es/forEach"),require("lodash-es/isEqual"),require("lodash-es/map"),require("lodash-es/pickBy")):typeof define=="function"&&define.amd?define(["exports","vue","@popperjs/core/lib/popper-lite","@popperjs/core/lib/modifiers/preventOverflow","@popperjs/core/lib/modifiers/flip","lodash-es/uniq","lodash-es/find","@inertiajs/vue3","qs","lodash-es/clone","lodash-es/filter","lodash-es/findKey","lodash-es/forEach","lodash-es/isEqual","lodash-es/map","lodash-es/pickBy"],e):(c=typeof globalThis<"u"?globalThis:c||self,e((c.Inertia=c.Inertia||{},c.Inertia["js Tables for Laravel Query Builder"]={}),c.Vue,c.popperLite,c.preventOverflow,c.flip,c.uniq,c.find,c.vue3,c.qs,c.clone,c.filter,c.findKey,c.forEach,c.isEqual,c.map,c.pickBy))})(this,function(c,e,ne,le,oe,ae,se,z,ie,ce,de,ue,fe,me,pe,he){"use strict";const k=r=>r&&typeof r=="object"&&"default"in r?r:{default:r},ge=k(le),ye=k(oe),ke=k(ae),be=k(se),V=k(ie),we=k(ce),_e=k(de),xe=k(ue),w=k(fe),Ce=k(me),Be=k(pe),Ee=k(he),L={__name:"OnClickOutside",props:{do:{type:Function,required:!0}},setup(r){const f=r,l=e.ref(null),u=e.ref(null);return e.onMounted(()=>{l.value=i=>{i.target===u.value||u.value.contains(i.target)||f.do()},document.addEventListener("click",l.value),document.addEventListener("touchstart",l.value)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",l.value),document.removeEventListener("touchstart",l.value)}),(i,t)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"root",ref:u},[e.renderSlot(i.$slots,"default")],512))}},$e={class:"relative"},Ve=["dusk","disabled","onClick"],Ne={class:"mt-2 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5"},E={__name:"ButtonWithDropdown",props:{placement:{type:String,default:"bottom-start",required:!1},active:{type:Boolean,default:!1,required:!1},dusk:{type:String,default:null,required:!1},disabled:{type:Boolean,default:!1,required:!1}},setup(r,{expose:f}){const l=r,u=e.ref(!1),i=e.ref(null);function t(){u.value=!u.value}function n(){u.value=!1}e.watch(u,()=>{i.value.update()});const a=e.ref(null),p=e.ref(null);e.onMounted(()=>{i.value=ne.createPopper(a.value,p.value,{placement:l.placement,modifiers:[ye.default,ge.default]})}),f({hide:n});const b=e.inject("activeClasses");return(y,g)=>(e.openBlock(),e.createBlock(L,{do:n},{default:e.withCtx(()=>[e.createElementVNode("div",$e,[e.createElementVNode("button",{ref_key:"button",ref:a,type:"button",dusk:r.dusk,disabled:r.disabled,class:e.normalizeClass(["w-full bg-white border rounded-md shadow-sm px-4 py-2 inline-flex justify-center text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",{[e.unref(b).border]:l.active,"border-gray-300":!l.active,"cursor-not-allowed":l.disabled}]),"aria-haspopup":"true",onClick:e.withModifiers(t,["prevent"])},[e.renderSlot(y.$slots,"button")],10,Ve),e.withDirectives(e.createElementVNode("div",{ref_key:"tooltip",ref:p,class:"absolute z-10"},[e.createElementVNode("div",Ne,[e.renderSlot(y.$slots,"default")])],512),[[e.vShow,u.value]])])]),_:3}))}},Se={class:"flex flex-row items-center"},qe={class:"uppercase"},Fe=["sorted"],De={key:0,fill:"currentColor",d:"M41 288h238c21.4 0 32.1 25.9 17 41L177 448c-9.4 9.4-24.6 9.4-33.9 0L24 329c-15.1-15.1-4.4-41 17-41zm255-105L177 64c-9.4-9.4-24.6-9.4-33.9 0L24 183c-15.1 15.1-4.4 41 17 41h238c21.4 0 32.1-25.9 17-41z"},je={key:1,fill:"currentColor",d:"M279 224H41c-21.4 0-32.1-25.9-17-41L143 64c9.4-9.4 24.6-9.4 33.9 0l119 119c15.2 15.1 4.5 41-16.9 41z"},Te={key:2,fill:"currentColor",d:"M41 288h238c21.4 0 32.1 25.9 17 41L177 448c-9.4 9.4-24.6 9.4-33.9 0L24 329c-15.1-15.1-4.4-41 17-41z"},M={__name:"HeaderCell",props:{cell:{type:Object,required:!0}},setup(r){const f=r,l=e.inject("activeClasses");function u(){f.cell.sortable&&f.cell.onSort(f.cell.key)}return(i,t)=>e.withDirectives((e.openBlock(),e.createElementBlock("th",null,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.cell.sortable?"button":"div"),{class:"py-3 px-6 w-full",dusk:r.cell.sortable?`sort-${r.cell.key}`:null,onClick:e.withModifiers(u,["prevent"])},{default:e.withCtx(()=>[e.createElementVNode("span",Se,[e.renderSlot(i.$slots,"label",{},()=>[e.createElementVNode("span",qe,e.toDisplayString(r.cell.label),1)]),e.renderSlot(i.$slots,"sort",{},()=>[r.cell.sortable?(e.openBlock(),e.createElementBlock("svg",{key:0,"aria-hidden":"true",class:e.normalizeClass(["w-3 h-3 ml-2",{"text-gray-400":!r.cell.sorted,[e.unref(l).text]:r.cell.sorted}]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",sorted:r.cell.sorted},[r.cell.sorted?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("path",De)),r.cell.sorted==="asc"?(e.openBlock(),e.createElementBlock("path",je)):e.createCommentVNode("",!0),r.cell.sorted==="desc"?(e.openBlock(),e.createElementBlock("path",Te)):e.createCommentVNode("",!0)],10,Fe)):e.createCommentVNode("",!0)])])]),_:3},8,["dusk","onClick"]))],512)),[[e.vShow,!r.cell.hidden]])}},N={translations:{next:"Next",no_results_found:"No results found",of:"of",per_page:"per page",previous:"Previous",results:"results",to:"to"}};function S(){return N.translations}function ze(r,f){N.translations[r]=f}function Le(r){N.translations=r}const Me=["dusk","value"],Oe=["value"],O={__name:"PerPageSelector",props:{dusk:{type:String,default:null,required:!1},value:{type:Number,default:15,required:!1},options:{type:Array,default(){return[15,30,50,100]},required:!1},onChange:{type:Function,required:!0}},setup(r){const f=r,l=S(),u=e.computed(()=>{let i=[...f.options];return i.push(parseInt(f.value)),ke.default(i).sort((t,n)=>t-n)});return(i,t)=>(e.openBlock(),e.createElementBlock("select",{name:"per_page",dusk:r.dusk,value:r.value,class:"block focus:ring-indigo-500 focus:border-indigo-500 min-w-max shadow-sm text-sm border-gray-300 rounded-md",onChange:t[0]||(t[0]=n=>r.onChange(n.target.value))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),n=>(e.openBlock(),e.createElementBlock("option",{key:n,value:n},e.toDisplayString(n)+" "+e.toDisplayString(e.unref(l).per_page),9,Oe))),128))],40,Me))}},Pe={key:0,class:"bg-white px-4 py-3 flex items-center justify-between border-t border-gray-200 sm:px-6"},Ie={key:0},Re=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7 16l-4-4m0 0l4-4m-4 4h18"})],-1),We={class:"hidden sm:inline ml-2"},Ae={class:"hidden sm:inline mr-2"},Ge=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17 8l4 4m0 0l-4 4m4-4H3"})],-1),He={key:2,class:"hidden sm:flex-1 sm:flex sm:items-center sm:justify-between"},Ke={class:"flex flex-row gap-5 items-center flex-grow"},Qe={class:"hidden lg:block text-sm text-gray-700 flex-grow"},Ue={class:"font-medium"},Ye={class:"font-medium"},Ze={class:"font-medium"},Je={class:"relative z-0 inline-flex rounded-md shadow-sm -space-x-px","aria-label":"Pagination"},Xe={class:"sr-only"},ve=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z","clip-rule":"evenodd"})],-1),et={class:"sr-only"},tt=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z","clip-rule":"evenodd"})],-1),P={__name:"Pagination",props:{onClick:{type:Function,required:!1},perPageOptions:{type:Array,default(){return()=>[15,30,50,100]},required:!1},onPerPageChange:{type:Function,default(){return()=>{}},required:!1},hasData:{type:Boolean,required:!0},meta:{type:Object,required:!1}},setup(r){const f=r,l=S(),u=e.computed(()=>"links"in t.value?t.value.links.length>0:!1),i=e.computed(()=>Object.keys(t.value).length>0&&t.value.total>1),t=e.computed(()=>f.meta),n=e.computed(()=>"prev_page_url"in t.value?t.value.prev_page_url:null),a=e.computed(()=>"next_page_url"in t.value?t.value.next_page_url:null),p=e.computed(()=>parseInt(t.value.per_page));return(b,y)=>e.unref(i)?(e.openBlock(),e.createElementBlock("nav",Pe,[!r.hasData||e.unref(t).total<1?(e.openBlock(),e.createElementBlock("p",Ie,e.toDisplayString(e.unref(l).no_results_found),1)):e.createCommentVNode("",!0),r.hasData?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex-1 flex justify-between",{"sm:hidden":e.unref(u)}])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(n)?"a":"div"),{class:e.normalizeClass([{"cursor-not-allowed text-gray-400":!e.unref(n),"text-gray-700 hover:text-gray-500":e.unref(n)},"relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md bg-white"]),href:e.unref(n),dusk:e.unref(n)?"pagination-simple-previous":null,onClick:y[0]||(y[0]=e.withModifiers(g=>r.onClick(e.unref(n)),["prevent"]))},{default:e.withCtx(()=>[Re,e.createElementVNode("span",We,e.toDisplayString(e.unref(l).previous),1)]),_:1},8,["class","href","dusk"])),e.createVNode(O,{dusk:"per-page-mobile",value:e.unref(p),options:r.perPageOptions,"on-change":r.onPerPageChange},null,8,["value","options","on-change"]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(a)?"a":"div"),{class:e.normalizeClass([{"cursor-not-allowed text-gray-400":!e.unref(a),"text-gray-700 hover:text-gray-500":e.unref(a)},"ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md bg-white"]),href:e.unref(a),dusk:e.unref(a)?"pagination-simple-next":null,onClick:y[1]||(y[1]=e.withModifiers(g=>r.onClick(e.unref(a)),["prevent"]))},{default:e.withCtx(()=>[e.createElementVNode("span",Ae,e.toDisplayString(e.unref(l).next),1),Ge]),_:1},8,["class","href","dusk"]))],2)):e.createCommentVNode("",!0),r.hasData&&e.unref(u)?(e.openBlock(),e.createElementBlock("div",He,[e.createElementVNode("div",Ke,[e.createVNode(O,{dusk:"per-page-full",value:e.unref(p),options:r.perPageOptions,"on-change":r.onPerPageChange},null,8,["value","options","on-change"]),e.createElementVNode("p",Qe,[e.createElementVNode("span",Ue,e.toDisplayString(e.unref(t).from),1),e.createTextVNode(" "+e.toDisplayString(e.unref(l).to)+" ",1),e.createElementVNode("span",Ye,e.toDisplayString(e.unref(t).to),1),e.createTextVNode(" "+e.toDisplayString(e.unref(l).of)+" ",1),e.createElementVNode("span",Ze,e.toDisplayString(e.unref(t).total),1),e.createTextVNode(" "+e.toDisplayString(e.unref(l).results),1)])]),e.createElementVNode("div",null,[e.createElementVNode("nav",Je,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(n)?"a":"div"),{class:e.normalizeClass([{"cursor-not-allowed text-gray-400":!e.unref(n),"text-gray-500 hover:bg-gray-50":e.unref(n)},"relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium"]),href:e.unref(n),dusk:e.unref(n)?"pagination-previous":null,onClick:y[2]||(y[2]=e.withModifiers(g=>r.onClick(e.unref(n)),["prevent"]))},{default:e.withCtx(()=>[e.createElementVNode("span",Xe,e.toDisplayString(e.unref(l).previous),1),ve]),_:1},8,["class","href","dusk"])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).links,(g,_)=>(e.openBlock(),e.createElementBlock("div",{key:_},[e.renderSlot(b.$slots,"link",{},()=>[!isNaN(g.label)||g.label==="..."?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g.url?"a":"div"),{key:0,href:g.url,dusk:g.url?`pagination-${g.label}`:null,class:e.normalizeClass(["relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700",{"cursor-not-allowed":!g.url,"hover:bg-gray-50":g.url,"bg-gray-100":g.active}]),onClick:e.withModifiers(x=>r.onClick(g.url),["prevent"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.label),1)]),_:2},1032,["href","dusk","class","onClick"])):e.createCommentVNode("",!0)])]))),128)),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(a)?"a":"div"),{class:e.normalizeClass([{"cursor-not-allowed text-gray-400":!e.unref(a),"text-gray-500 hover:bg-gray-50":e.unref(a)},"relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium"]),href:e.unref(a),dusk:e.unref(a)?"pagination-next":null,onClick:y[3]||(y[3]=e.withModifiers(g=>r.onClick(e.unref(a)),["prevent"]))},{default:e.withCtx(()=>[e.createElementVNode("span",et,e.toDisplayString(e.unref(l).next),1),tt]),_:1},8,["class","href","dusk"]))])])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}},rt=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z","clip-rule":"evenodd"})],-1),nt={role:"menu","aria-orientation":"horizontal","aria-labelledby":"add-search-input-menu",class:"min-w-max"},lt=["dusk","onClick"],I={__name:"TableAddSearchRow",props:{searchInputs:{type:Object,required:!0},hasSearchInputsWithoutValue:{type:Boolean,required:!0},onAdd:{type:Function,required:!0}},setup(r){const f=r,l=e.ref(null);function u(i){f.onAdd(i),l.value.hide()}return(i,t)=>(e.openBlock(),e.createBlock(E,{ref_key:"dropdown",ref:l,dusk:"add-search-row-dropdown",disabled:!r.hasSearchInputsWithoutValue,class:"w-auto"},{button:e.withCtx(()=>[rt]),default:e.withCtx(()=>[e.createElementVNode("div",nt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.searchInputs,(n,a)=>(e.openBlock(),e.createElementBlock("button",{key:a,dusk:`add-search-row-${n.key}`,class:"text-left w-full px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900",role:"menuitem",onClick:e.withModifiers(p=>u(n.key),["prevent"])},e.toDisplayString(n.label),9,lt))),128))])]),_:1},8,["disabled"]))}},ot=[e.createElementVNode("path",{d:"M10 12a2 2 0 100-4 2 2 0 000 4z"},null,-1),e.createElementVNode("path",{"fill-rule":"evenodd",d:"M.458 10C1.732 5.943 5.522 3 10 3s8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7S1.732 14.057.458 10zM14 10a4 4 0 11-8 0 4 4 0 018 0z","clip-rule":"evenodd"},null,-1)],at={role:"menu","aria-orientation":"horizontal","aria-labelledby":"toggle-columns-menu",class:"min-w-max"},st={class:"px-2"},it={class:"divide-y divide-gray-200"},ct={class:"text-sm text-gray-900"},dt=["aria-pressed","aria-labelledby","aria-describedby","dusk","onClick"],ut=e.createElementVNode("span",{class:"sr-only"},"Column status",-1),R={__name:"TableColumns",props:{columns:{type:Object,required:!0},hasHiddenColumns:{type:Boolean,required:!0},onChange:{type:Function,required:!0}},setup(r){const f=r,l=e.inject("activeClasses");return(u,i)=>(e.openBlock(),e.createBlock(E,{placement:"bottom-end",dusk:"columns-dropdown",active:r.hasHiddenColumns},{button:e.withCtx(()=>[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass(["h-5 w-5",{"text-gray-400":!r.hasHiddenColumns,[e.unref(l).text]:r.hasHiddenColumns}]),viewBox:"0 0 20 20",fill:"currentColor"},ot,2))]),default:e.withCtx(()=>[e.createElementVNode("div",at,[e.createElementVNode("div",st,[e.createElementVNode("ul",it,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.columns,(t,n)=>e.withDirectives((e.openBlock(),e.createElementBlock("li",{key:n,class:"py-2 flex items-center justify-between"},[e.createElementVNode("p",ct,e.toDisplayString(t.label),1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["ml-4 relative inline-flex flex-shrink-0 h-6 w-11 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-light-blue-500",{"bg-green-500":!t.hidden,"bg-gray-200":t.hidden}]),"aria-pressed":!t.hidden,"aria-labelledby":`toggle-column-${t.key}`,"aria-describedby":`toggle-column-${t.key}`,dusk:`toggle-column-${t.key}`,onClick:e.withModifiers(a=>r.onChange(t.key,t.hidden),["prevent"])},[ut,e.createElementVNode("span",{"aria-hidden":"true",class:e.normalizeClass([{"translate-x-5":!t.hidden,"translate-x-0":t.hidden},"inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200"])},null,2)],10,dt)])),[[e.vShow,t.can_be_hidden]])),128))])])])]),_:1},8,["active"]))}},ft=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"},null,-1)],mt={role:"menu","aria-orientation":"horizontal","aria-labelledby":"filter-menu",class:"min-w-[320px]"},pt={class:"text-xs uppercase tracking-wide bg-gray-100 p-3"},ht={class:"p-2"},gt=["name","value","onChange"],yt=["value"],W={__name:"TableFilter",props:{hasEnabledFilters:{type:Boolean,required:!0},filters:{type:Object,required:!0},onFilterChange:{type:Function,required:!0}},setup(r){const f=e.inject("activeClasses");return(l,u)=>(e.openBlock(),e.createBlock(E,{placement:"bottom-end",dusk:"filters-dropdown",active:r.hasEnabledFilters},{button:e.withCtx(()=>[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",class:e.normalizeClass(["h-5 w-5",{"text-gray-400":!r.hasEnabledFilters,[e.unref(f).text]:r.hasEnabledFilters}]),viewBox:"0 0 20 20",fill:"currentColor"},ft,2))]),default:e.withCtx(()=>[e.createElementVNode("div",mt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.filters,(i,t)=>(e.openBlock(),e.createElementBlock("div",{key:t},[e.createElementVNode("h3",pt,e.toDisplayString(i.label),1),e.createElementVNode("div",ht,[i.type==="select"?(e.openBlock(),e.createElementBlock("select",{key:0,name:i.key,value:i.value,class:"block focus:ring-indigo-500 focus:border-indigo-500 w-full shadow-sm text-sm border-gray-300 rounded-md",onChange:n=>r.onFilterChange(i.key,n.target.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.options,(n,a)=>(e.openBlock(),e.createElementBlock("option",{key:a,value:a},e.toDisplayString(n),9,yt))),128))],40,gt)):e.createCommentVNode("",!0)])]))),128))])]),_:1},8,["active"]))}},kt={class:"flex items-center justify-start my-3 text-sm"},bt={class:"flex items-center"},wt=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 text-gray-300",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M3 3a1 1 0 011-1h12a1 1 0 011 1v3a1 1 0 01-.293.707L12 11.414V15a1 1 0 01-.293.707l-2 2A1 1 0 018 17v-5.586L3.293 6.707A1 1 0 013 6V3z","clip-rule":"evenodd"})],-1),_t={class:"text-gray-400 ml-1"},xt=["textContent"],Ct=["onClick"],Bt={class:"ml-1"},Et=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)],$t={__name:"TableActiveFilters",props:{filters:{type:Object,required:!0},onFilterChange:{type:Function,required:!0}},setup(r){const f=r,l=e.inject("activeClasses"),u=e.computed(()=>f.filters.filter(t=>t.value!==null)),i=e.computed(()=>u.value.length);return(t,n)=>(e.openBlock(),e.createElementBlock("div",kt,[e.createElementVNode("div",bt,[wt,e.createElementVNode("span",_t,[e.createTextVNode(e.toDisplayString(e.unref(i))+" active ",1),e.createElementVNode("span",{textContent:e.toDisplayString(e.unref(i)===1?"filter":"filters")},null,8,xt),e.createTextVNode(":")])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),a=>(e.openBlock(),e.createElementBlock("button",{key:a.label,class:e.normalizeClass(["block group ml-3 flex items-center justify-between px-2 py-1 rounded bg-gray-100",`hover:${e.unref(l).text}`]),onClick:p=>r.onFilterChange(a.key,null)},[e.createElementVNode("span",{class:e.normalizeClass(["capitalize text-gray-500",`group-hover:${e.unref(l).text}`])},e.toDisplayString(a.label.replace("_"," ")),3),e.createTextVNode(":"),e.createElementVNode("span",Bt,e.toDisplayString(a.options[a.value]),1),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([`group-hover:${e.unref(l).text}`,"h-4 w-4 ml-1 text-gray-400"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Et,2))],10,Ct))),128))]))}},Vt={class:"relative"},Nt=["placeholder","value"],St=e.createElementVNode("div",{class:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3"},[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"size-5 text-gray-400 sm:size-4",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z","clip-rule":"evenodd"})])],-1),A={__name:"TableGlobalSearch",props:{label:{type:String,default:"Zoeken...",required:!1},value:{type:String,default:"",required:!1},onChange:{type:Function,required:!0}},setup(r){const f=e.inject("activeClasses");return(l,u)=>(e.openBlock(),e.createElementBlock("div",Vt,[e.createElementVNode("input",{class:e.normalizeClass(["block w-full rounded-md border-gray-300 pr-10 shadow-sm sm:text-sm",[e.unref(f).focusRing,e.unref(f).focusBorder]]),placeholder:r.label,value:r.value,type:"text",name:"global",onInput:u[0]||(u[0]=i=>r.onChange(i.target.value))},null,42,Nt),St]))}},qt={class:"flex rounded-md shadow-sm relative mt-3"},Ft=["for"],Dt=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 mr-2 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z","clip-rule":"evenodd"})],-1),jt=["id","name","value","onInput"],Tt={class:"absolute inset-y-0 right-0 pr-3 flex items-center"},zt=["dusk","onClick"],Lt=[e.createElementVNode("span",{class:"sr-only"},"Remove search",-1),e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)],G={__name:"TableSearchRows",props:{searchInputs:{type:Object,required:!0},forcedVisibleSearchInputs:{type:Array,required:!0},onChange:{type:Function,required:!0},onRemove:{type:Function,required:!0}},setup(r){const f=r,l={el:e.ref([])};let u=e.computed(()=>l.el.value);function i(t){return f.forcedVisibleSearchInputs.includes(t)}return e.watch(f.forcedVisibleSearchInputs,t=>{const n=t.length>0?t[t.length-1]:null;!n||e.nextTick().then(()=>{const a=be.default(u.value,p=>p.__vnode.key===n);a&&a.focus()})},{immediate:!0}),(t,n)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.searchInputs,(a,p)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:p,class:"px-4 sm:px-0"},[e.createElementVNode("div",qt,[e.createElementVNode("label",{for:a.key,class:"inline-flex items-center px-4 rounded-l-md border border-r-0 border-gray-300 bg-gray-50 text-gray-500 text-sm"},[Dt,e.createElementVNode("span",null,e.toDisplayString(a.label),1)],8,Ft),(e.openBlock(),e.createElementBlock("input",{id:a.key,ref_for:!0,ref:l.el,key:a.key,name:a.key,value:a.value,type:"text",class:"flex-1 min-w-0 block w-full px-3 py-2 rounded-none rounded-r-md focus:ring-indigo-500 focus:border-indigo-500 text-sm border-gray-300",onInput:b=>r.onChange(a.key,b.target.value)},null,40,jt)),e.createElementVNode("div",Tt,[e.createElementVNode("button",{class:"rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",dusk:`remove-search-row-${a.key}`,onClick:e.withModifiers(b=>r.onRemove(a.key),["prevent"])},Lt,8,zt)])])])),[[e.vShow,a.value!==null||i(a.key)]])),128))}},Mt=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 mr-2 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor"},[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),e.createElementVNode("span",null,"Reset",-1)],H={__name:"TableReset",props:{onClick:{type:Function,required:!0}},setup(r){return(f,l)=>(e.openBlock(),e.createElementBlock("button",{ref:"button",type:"button",dusk:"reset-table",class:"w-full bg-white border rounded-md shadow-sm px-4 py-2 inline-flex justify-center text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 border-gray-300","aria-haspopup":"true",onClick:l[0]||(l[0]=e.withModifiers((...u)=>r.onClick&&r.onClick(...u),["prevent"]))},Mt,512))}},Ot=(r,f)=>{const l=r.__vccOpts||r;for(const[u,i]of f)l[u]=i;return l},Pt={},It={class:"flex flex-col"},Rt={class:"-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8"},Wt={class:"py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8"},At={class:"shadow border-b border-gray-200 relative"};function Gt(r,f){return e.openBlock(),e.createElementBlock("div",It,[e.createElementVNode("div",Rt,[e.createElementVNode("div",Wt,[e.createElementVNode("div",At,[e.renderSlot(r.$slots,"default")])])])])}const K=Ot(Pt,[["render",Gt]]),Ht=["dusk"],Kt={class:"flex flex-row flex-wrap justify-start space-x-2 sm:flex-nowrap"},Qt={key:0,class:"order-2 sm:order-1"},Ut={class:"flex flex-row order-1 w-full mb-2 sm:w-auto sm:flex-grow sm:order-2 sm:mb-0"},Yt={key:0,class:"order-5 ml-auto sm:order-3"},Zt={class:"min-w-full bg-white divide-y divide-gray-200"},Jt={class:"bg-gray-50"},Xt={class:"px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-500 uppercase"},vt={class:"bg-white divide-y divide-gray-200"},er=["onClick"],tr={key:0},rr=[e.createElementVNode("td",{class:"px-6 py-4 text-sm text-gray-500 whitespace-nowrap text-center",colspan:100}," Geen resultaten gevonden. ",-1)],nr={__name:"Table",props:{inertia:{type:Object,default:()=>({}),required:!1},name:{type:String,default:"default",required:!1},striped:{type:Boolean,default:!1,required:!1},preventOverlappingRequests:{type:Boolean,default:!0,required:!1},inputDebounceMs:{type:Number,default:350,required:!1},preserveScroll:{type:[Boolean,String],default:!1,required:!1},resource:{type:Object,default:()=>({}),required:!1},meta:{type:Object,default:()=>({}),required:!1},data:{type:Object,default:()=>({}),required:!1},activeClasses:{type:Object,required:!1,default(){return{text:"text-green-400",border:"border-green-300",focusRing:"focus:ring-indigo-500",focusBorder:"focus:border-indigo-500"}}},showGlobalSearch:{type:[Boolean,String],default:!0,required:!1}},emits:["rowClick"],setup(r,{emit:f}){const l=r;e.provide("activeClasses",l.activeClasses);const u=e.ref(0),i=z.usePage(),t=e.computed(()=>{let o=i.props.queryBuilderProps?i.props.queryBuilderProps[l.name]||{}:{};return o._updates=u.value,o}),n=e.ref(t.value),a=e.computed(()=>t.value.pageName),p=e.ref([]),b=e.ref(null),y=e.computed(()=>!(t.value.hasToggleableColumns||t.value.hasFilters||t.value.hasSearchInputs||t.value.globalSearch)),g=e.computed(()=>Object.keys(l.resource).length===0?l.data:"data"in l.resource?l.resource.data:l.resource),_=e.computed(()=>Object.keys(l.resource).length===0?l.meta:"links"in l.resource&&"meta"in l.resource&&Object.keys(l.resource.links).length===4&&"next"in l.resource.links&&"prev"in l.resource.links?{...l.resource.meta,next_page_url:l.resource.links.next,prev_page_url:l.resource.links.prev}:"meta"in l.resource?l.resource.meta:l.resource),x=e.computed(()=>g.value.length>0||_.value.total>0);function lr(o,s){f("rowClick",o,s)}function or(o){p.value=p.value.filter(s=>s!=o),$(o,null)}function Q(o){p.value.push(o)}const ar=e.computed(()=>{if(p.value.length>0)return!0;const o=V.default.parse(location.search.substring(1));if(o[a.value]>1)return!0;const d=l.name==="default"?"":l.name+"_";let m=!1;return w.default(["filter","columns","cursor","sort"],h=>{const B=o[d+h];h==="sort"&&B===t.value.defaultSort||B!==void 0&&(m=!0)}),m});function U(){p.value=[],w.default(n.value.filters,(o,s)=>{n.value.filters[s].value=null}),w.default(n.value.searchInputs,(o,s)=>{n.value.searchInputs[s].value=null}),w.default(n.value.columns,(o,s)=>{n.value.columns[s].hidden=o.can_be_hidden?!t.value.defaultVisibleToggleableColumns.includes(o.key):!1}),n.value.sort=null,n.value.cursor=null,n.value.page=1}const Y={};function $(o,s){clearTimeout(Y[o]),Y[o]=setTimeout(()=>{D.value&&l.preventOverlappingRequests&&D.value.cancel();const d=C("searchInputs",o);n.value.searchInputs[d].value=s,n.value.cursor=null,n.value.page=1},l.inputDebounceMs)}function Z(o){$("global",o)}function q(o,s){const d=C("filters",o);n.value.filters[d].value=s,n.value.cursor=null,n.value.page=1}function J(o){n.value.cursor=null,n.value.perPage=o,n.value.page=1}function C(o,s){return xe.default(n.value[o],d=>d.key==s)}function X(o,s){const d=C("columns",o);n.value.columns[d].hidden=!s}function sr(){let o={};return w.default(n.value.searchInputs,s=>{s.value!==null&&(o[s.key]=s.value)}),w.default(n.value.filters,s=>{s.value!==null&&(o[s.key]=s.value)}),o}function ir(){const o=n.value.columns;let s=_e.default(o,m=>!m.hidden),d=Be.default(s,m=>m.key).sort();return Ce.default(d,t.value.defaultVisibleToggleableColumns)?{}:d}function cr(){const o=sr(),s=ir(),d={};Object.keys(o).length>0&&(d.filter=o),Object.keys(s).length>0&&(d.columns=s);const m=n.value.cursor,h=n.value.page,B=n.value.sort,re=n.value.perPage;return m&&(d.cursor=m),h>1&&(d.page=h),re>1&&(d.perPage=re),B&&(d.sort=B),d}function dr(){const o=V.default.parse(location.search.substring(1)),s=l.name==="default"?"":l.name+"_";w.default(["filter","columns","cursor","sort"],m=>{delete o[s+m]}),delete o[a.value],w.default(cr(),(m,h)=>{h==="page"?o[a.value]=m:h==="perPage"?o.perPage=m:o[s+h]=m});let d=V.default.stringify(o,{filter(m,h){return typeof h=="object"&&h!==null?Ee.default(h):h},skipNulls:!0,strictNullHandling:!0});return(!d||d===a.value+"=1")&&(d=""),d}const F=e.ref(!1),D=e.ref(null);function j(o){!o||z.router.get(o,{},{replace:!0,preserveState:!0,preserveScroll:l.preserveScroll!==!1,onBefore(){F.value=!0},onCancelToken(s){D.value=s},onFinish(){F.value=!1},onSuccess(){if("queryBuilderProps"in i.props&&(n.value.cursor=t.value.cursor,n.value.page=t.value.page),l.preserveScroll==="table-top"){const d=b.value.getBoundingClientRect().top+window.pageYOffset+-8;window.scrollTo({top:d})}u.value++}})}e.watch(n,()=>{j(location.pathname+"?"+dr())},{deep:!0});const v=()=>{u.value++};e.onMounted(()=>{document.addEventListener("success",v)}),e.onUnmounted(()=>{document.removeEventListener("success",v)});function ee(o){n.value.sort==o?n.value.sort=`-${o}`:n.value.sort=o,n.value.cursor=null,n.value.page=1}function T(o){const s=C("columns",o);return!n.value.columns[s].hidden}function te(o){const s=C("columns",o),d=we.default(t.value.columns[s]);return d.onSort=ee,d}return(o,s)=>(e.openBlock(),e.createBlock(e.Transition,null,{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock("fieldset",{ref_key:"tableFieldset",ref:b,key:`table-${r.name}`,dusk:`table-${r.name}`,class:e.normalizeClass(["min-w-0",{"opacity-75":F.value}])},[e.createElementVNode("div",Kt,[e.unref(t).hasFilters?(e.openBlock(),e.createElementBlock("div",Qt,[e.renderSlot(o.$slots,"tableFilter",{hasFilters:e.unref(t).hasFilters,hasEnabledFilters:e.unref(t).hasEnabledFilters,filters:e.unref(t).filters,onFilterChange:q},()=>[e.unref(x)?(e.openBlock(),e.createBlock(W,{key:0,"has-enabled-filters":e.unref(t).hasEnabledFilters,filters:e.unref(t).filters,"on-filter-change":q},null,8,["has-enabled-filters","filters"])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",Ut,[e.renderSlot(o.$slots,"tableGlobalSearch",{hasGlobalSearch:e.unref(t).globalSearch,label:e.unref(t).globalSearch?e.unref(t).globalSearch.label:null,value:e.unref(t).globalSearch?e.unref(t).globalSearch.value:null,onChange:Z},()=>[r.showGlobalSearch&&e.unref(t).globalSearch?(e.openBlock(),e.createBlock(A,{key:0,class:"flex-grow",label:e.unref(t).globalSearch.label,value:e.unref(t).globalSearch.value,"on-change":Z},null,8,["label","value"])):e.createCommentVNode("",!0)])]),e.renderSlot(o.$slots,"tableReset",{canBeReset:"canBeReset",onClick:U},()=>[e.unref(ar)?(e.openBlock(),e.createElementBlock("div",Yt,[e.createVNode(H,{"on-click":U})])):e.createCommentVNode("",!0)]),e.renderSlot(o.$slots,"tableAddSearchRow",{hasSearchInputs:e.unref(t).hasSearchInputs,hasSearchInputsWithoutValue:e.unref(t).hasSearchInputsWithoutValue,searchInputs:e.unref(t).searchInputsWithoutGlobal,onAdd:Q},()=>[r.showGlobalSearch&&e.unref(t).hasSearchInputs&&e.unref(x)?(e.openBlock(),e.createBlock(I,{key:0,class:"order-3 sm:order-4","search-inputs":e.unref(t).searchInputsWithoutGlobal,"has-search-inputs-without-value":e.unref(t).hasSearchInputsWithoutValue,"on-add":Q},null,8,["search-inputs","has-search-inputs-without-value"])):e.createCommentVNode("",!0)]),e.renderSlot(o.$slots,"tableColumns",{hasColumns:e.unref(t).hasToggleableColumns,columns:e.unref(t).columns,hasHiddenColumns:e.unref(t).hasHiddenColumns,onChange:X},()=>[e.unref(t).hasToggleableColumns?(e.openBlock(),e.createBlock(R,{key:0,class:"order-4 sm:order-5",columns:e.unref(t).columns,"has-hidden-columns":e.unref(t).hasHiddenColumns,"on-change":X},null,8,["columns","has-hidden-columns"])):e.createCommentVNode("",!0)])]),e.renderSlot(o.$slots,"tableSearchRows",{hasSearchRowsWithValue:e.unref(t).hasSearchInputsWithValue,searchInputs:e.unref(t).searchInputsWithoutGlobal,forcedVisibleSearchInputs:p.value,onChange:$},()=>[e.unref(t).hasSearchInputsWithValue||p.value.length>0?(e.openBlock(),e.createBlock(G,{key:0,"search-inputs":e.unref(t).searchInputsWithoutGlobal,"forced-visible-search-inputs":p.value,"on-change":$,"on-remove":or},null,8,["search-inputs","forced-visible-search-inputs"])):e.createCommentVNode("",!0)]),e.unref(t).hasEnabledFilters?(e.openBlock(),e.createBlock($t,{key:0,filters:e.unref(t).filters,"on-filter-change":q},null,8,["filters"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"tableWrapper",{meta:e.unref(_)},()=>[e.createVNode(K,{class:e.normalizeClass({"mt-3":!e.unref(y)})},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"table",{},()=>[e.createElementVNode("table",Zt,[e.createElementVNode("thead",Jt,[e.renderSlot(o.$slots,"head",{show:T,sortBy:ee,header:te},()=>[e.createElementVNode("tr",Xt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).columns,d=>(e.openBlock(),e.createBlock(M,{key:`table-${r.name}-header-${d.key}`,cell:te(d.key)},null,8,["cell"]))),128))])])]),e.createElementVNode("tbody",vt,[e.renderSlot(o.$slots,"body",{show:T},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(d,m)=>(e.openBlock(),e.createElementBlock("tr",{key:`table-${r.name}-row-${m}`,class:e.normalizeClass(["",{"bg-gray-50":r.striped&&m%2,"hover:bg-gray-100":r.striped,"hover:bg-gray-50":!r.striped}]),onClick:h=>lr(d,m)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).columns,h=>e.withDirectives((e.openBlock(),e.createElementBlock("td",{key:`table-${r.name}-row-${m}-column-${h.key}`,class:"px-6 py-4 text-sm text-gray-500 whitespace-nowrap"},[e.renderSlot(o.$slots,`cell(${h.key})`,{item:d},()=>[e.createTextVNode(e.toDisplayString(d[h.key]),1)])])),[[e.vShow,T(h.key)]])),128))],10,er))),128))]),e.unref(x)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",tr,rr))])])]),e.renderSlot(o.$slots,"pagination",{onClick:j,hasData:e.unref(x),meta:e.unref(_),perPageOptions:e.unref(t).perPageOptions,onPerPageChange:J},()=>[e.createVNode(P,{"on-click":j,"has-data":e.unref(x),meta:e.unref(_),"per-page-options":e.unref(t).perPageOptions,"on-per-page-change":J},null,8,["has-data","meta","per-page-options"])])]),_:3},8,["class"])])],10,Ht))]),_:3}))}};c.ButtonWithDropdown=E,c.HeaderCell=M,c.OnClickOutside=L,c.Pagination=P,c.Table=nr,c.TableAddSearchRow=I,c.TableColumns=R,c.TableFilter=W,c.TableGlobalSearch=A,c.TableReset=H,c.TableSearchRows=G,c.TableWrapper=K,c.getTranslations=S,c.setTranslation=ze,c.setTranslations=Le,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED