@jdanino/inertiajs-tables-laravel-query-builder 2.2.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { createPopper as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { ref as S, onMounted as Y, onBeforeUnmount as ye, openBlock as o, createElementBlock as i, renderSlot as w, watch as J, inject as z, 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 M, toDisplayString as v, createCommentVNode as x, computed as $, Fragment as B, renderList as P, createTextVNode as j, createVNode as D, nextTick as we, provide as xe, onUnmounted as ke, Transition as _e } from "vue";
|
|
2
|
+
import { createPopper as $e } from "@popperjs/core/lib/popper-lite";
|
|
3
|
+
import Ce from "@popperjs/core/lib/modifiers/preventOverflow";
|
|
4
|
+
import Se from "@popperjs/core/lib/modifiers/flip";
|
|
5
|
+
import qe from "lodash-es/uniq";
|
|
6
|
+
import Fe from "lodash-es/find";
|
|
7
|
+
import { usePage as Be, router as Pe } from "@inertiajs/vue3";
|
|
7
8
|
import U from "qs";
|
|
8
9
|
import Oe from "lodash-es/clone";
|
|
9
10
|
import je from "lodash-es/filter";
|
|
10
11
|
import Te from "lodash-es/findKey";
|
|
11
|
-
import
|
|
12
|
+
import T from "lodash-es/forEach";
|
|
12
13
|
import Le from "lodash-es/isEqual";
|
|
13
14
|
import Ve from "lodash-es/map";
|
|
14
|
-
import
|
|
15
|
-
const
|
|
15
|
+
import Me from "lodash-es/pickBy";
|
|
16
|
+
const ze = {
|
|
16
17
|
__name: "OnClickOutside",
|
|
17
18
|
props: {
|
|
18
19
|
do: {
|
|
@@ -20,22 +21,22 @@ const Me = {
|
|
|
20
21
|
required: !0
|
|
21
22
|
}
|
|
22
23
|
},
|
|
23
|
-
setup(
|
|
24
|
-
const p =
|
|
24
|
+
setup(s) {
|
|
25
|
+
const p = s, n = S(null), f = S(null);
|
|
25
26
|
return Y(() => {
|
|
26
27
|
n.value = (d) => {
|
|
27
28
|
d.target === f.value || f.value.contains(d.target) || p.do();
|
|
28
29
|
}, document.addEventListener("click", n.value), document.addEventListener("touchstart", n.value);
|
|
29
|
-
}),
|
|
30
|
+
}), ye(() => {
|
|
30
31
|
document.removeEventListener("click", n.value), document.removeEventListener("touchstart", n.value);
|
|
31
|
-
}), (d,
|
|
32
|
+
}), (d, t) => (o(), i("div", {
|
|
32
33
|
ref_key: "root",
|
|
33
34
|
ref: f
|
|
34
35
|
}, [
|
|
35
|
-
|
|
36
|
+
w(d.$slots, "default")
|
|
36
37
|
], 512));
|
|
37
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" }, X = {
|
|
39
40
|
__name: "ButtonWithDropdown",
|
|
40
41
|
props: {
|
|
41
42
|
placement: {
|
|
@@ -59,54 +60,54 @@ const Me = {
|
|
|
59
60
|
required: !1
|
|
60
61
|
}
|
|
61
62
|
},
|
|
62
|
-
setup(
|
|
63
|
-
const n =
|
|
64
|
-
function
|
|
63
|
+
setup(s, { expose: p }) {
|
|
64
|
+
const n = s, f = S(!1), d = S(null);
|
|
65
|
+
function t() {
|
|
65
66
|
f.value = !f.value;
|
|
66
67
|
}
|
|
67
|
-
function
|
|
68
|
+
function r() {
|
|
68
69
|
f.value = !1;
|
|
69
70
|
}
|
|
70
71
|
J(f, () => {
|
|
71
72
|
d.value.update();
|
|
72
73
|
});
|
|
73
|
-
const
|
|
74
|
+
const u = S(null), m = S(null);
|
|
74
75
|
Y(() => {
|
|
75
|
-
d.value =
|
|
76
|
+
d.value = $e(u.value, m.value, {
|
|
76
77
|
placement: n.placement,
|
|
77
|
-
modifiers: [
|
|
78
|
+
modifiers: [Se, Ce]
|
|
78
79
|
});
|
|
79
|
-
}), p({ hide:
|
|
80
|
-
const
|
|
81
|
-
return (q,
|
|
82
|
-
default:
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
}), p({ hide: r });
|
|
81
|
+
const O = z("activeClasses");
|
|
82
|
+
return (q, y) => (o(), _(ze, { do: r }, {
|
|
83
|
+
default: C(() => [
|
|
84
|
+
l("div", Ie, [
|
|
85
|
+
l("button", {
|
|
85
86
|
ref_key: "button",
|
|
86
|
-
ref:
|
|
87
|
+
ref: u,
|
|
87
88
|
type: "button",
|
|
88
|
-
dusk:
|
|
89
|
-
disabled:
|
|
90
|
-
class:
|
|
91
|
-
[e(
|
|
89
|
+
dusk: s.dusk,
|
|
90
|
+
disabled: s.disabled,
|
|
91
|
+
class: k(["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", {
|
|
92
|
+
[e(O).border]: n.active,
|
|
92
93
|
"border-gray-300": !n.active,
|
|
93
94
|
"cursor-not-allowed": n.disabled
|
|
94
95
|
}]),
|
|
95
96
|
"aria-haspopup": "true",
|
|
96
|
-
onClick:
|
|
97
|
+
onClick: F(t, ["prevent"])
|
|
97
98
|
}, [
|
|
98
|
-
|
|
99
|
+
w(q.$slots, "button")
|
|
99
100
|
], 10, Re),
|
|
100
|
-
|
|
101
|
+
E(l("div", {
|
|
101
102
|
ref_key: "tooltip",
|
|
102
|
-
ref:
|
|
103
|
+
ref: m,
|
|
103
104
|
class: "absolute z-10"
|
|
104
105
|
}, [
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
l("div", De, [
|
|
107
|
+
w(q.$slots, "default")
|
|
107
108
|
])
|
|
108
109
|
], 512), [
|
|
109
|
-
[
|
|
110
|
+
[A, f.value]
|
|
110
111
|
])
|
|
111
112
|
])
|
|
112
113
|
]),
|
|
@@ -117,11 +118,11 @@ const Me = {
|
|
|
117
118
|
key: 0,
|
|
118
119
|
fill: "currentColor",
|
|
119
120
|
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"
|
|
120
|
-
},
|
|
121
|
+
}, Ge = {
|
|
121
122
|
key: 1,
|
|
122
123
|
fill: "currentColor",
|
|
123
124
|
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"
|
|
124
|
-
},
|
|
125
|
+
}, He = {
|
|
125
126
|
key: 2,
|
|
126
127
|
fill: "currentColor",
|
|
127
128
|
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"
|
|
@@ -133,37 +134,37 @@ const Me = {
|
|
|
133
134
|
required: !0
|
|
134
135
|
}
|
|
135
136
|
},
|
|
136
|
-
setup(
|
|
137
|
-
const p =
|
|
137
|
+
setup(s) {
|
|
138
|
+
const p = s, n = z("activeClasses");
|
|
138
139
|
function f() {
|
|
139
140
|
p.cell.sortable && p.cell.onSort(p.cell.key);
|
|
140
141
|
}
|
|
141
|
-
return (d,
|
|
142
|
-
(o(),
|
|
142
|
+
return (d, t) => E((o(), i("th", null, [
|
|
143
|
+
(o(), _(M(s.cell.sortable ? "button" : "div"), {
|
|
143
144
|
class: "py-3 px-6 w-full",
|
|
144
|
-
dusk:
|
|
145
|
-
onClick:
|
|
145
|
+
dusk: s.cell.sortable ? `sort-${s.cell.key}` : null,
|
|
146
|
+
onClick: F(f, ["prevent"])
|
|
146
147
|
}, {
|
|
147
|
-
default:
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
default: C(() => [
|
|
149
|
+
l("span", Ee, [
|
|
150
|
+
w(d.$slots, "label", {}, () => [
|
|
151
|
+
l("span", Ae, v(s.cell.label), 1)
|
|
151
152
|
]),
|
|
152
|
-
|
|
153
|
-
|
|
153
|
+
w(d.$slots, "sort", {}, () => [
|
|
154
|
+
s.cell.sortable ? (o(), i("svg", {
|
|
154
155
|
key: 0,
|
|
155
156
|
"aria-hidden": "true",
|
|
156
|
-
class:
|
|
157
|
-
"text-gray-400": !
|
|
158
|
-
[e(n).text]:
|
|
157
|
+
class: k(["w-3 h-3 ml-2", {
|
|
158
|
+
"text-gray-400": !s.cell.sorted,
|
|
159
|
+
[e(n).text]: s.cell.sorted
|
|
159
160
|
}]),
|
|
160
161
|
xmlns: "http://www.w3.org/2000/svg",
|
|
161
162
|
viewBox: "0 0 320 512",
|
|
162
|
-
sorted:
|
|
163
|
+
sorted: s.cell.sorted
|
|
163
164
|
}, [
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
s.cell.sorted ? x("", !0) : (o(), i("path", Ne)),
|
|
166
|
+
s.cell.sorted === "asc" ? (o(), i("path", Ge)) : x("", !0),
|
|
167
|
+
s.cell.sorted === "desc" ? (o(), i("path", He)) : x("", !0)
|
|
167
168
|
], 10, We)) : x("", !0)
|
|
168
169
|
])
|
|
169
170
|
])
|
|
@@ -171,7 +172,7 @@ const Me = {
|
|
|
171
172
|
_: 3
|
|
172
173
|
}, 8, ["dusk", "onClick"]))
|
|
173
174
|
], 512)), [
|
|
174
|
-
[
|
|
175
|
+
[A, !s.cell.hidden]
|
|
175
176
|
]);
|
|
176
177
|
}
|
|
177
178
|
}, Z = {
|
|
@@ -185,16 +186,16 @@ const Me = {
|
|
|
185
186
|
to: "to"
|
|
186
187
|
}
|
|
187
188
|
};
|
|
188
|
-
function
|
|
189
|
+
function de() {
|
|
189
190
|
return Z.translations;
|
|
190
191
|
}
|
|
191
|
-
function
|
|
192
|
-
Z.translations[
|
|
192
|
+
function Hs(s, p) {
|
|
193
|
+
Z.translations[s] = p;
|
|
193
194
|
}
|
|
194
|
-
function
|
|
195
|
-
Z.translations =
|
|
195
|
+
function Ks(s) {
|
|
196
|
+
Z.translations = s;
|
|
196
197
|
}
|
|
197
|
-
const Qe = ["dusk", "value"], Ue = ["value"],
|
|
198
|
+
const Qe = ["dusk", "value"], Ue = ["value"], ce = {
|
|
198
199
|
__name: "PerPageSelector",
|
|
199
200
|
props: {
|
|
200
201
|
dusk: {
|
|
@@ -219,28 +220,28 @@ const Qe = ["dusk", "value"], Ue = ["value"], de = {
|
|
|
219
220
|
required: !0
|
|
220
221
|
}
|
|
221
222
|
},
|
|
222
|
-
setup(
|
|
223
|
-
const p =
|
|
223
|
+
setup(s) {
|
|
224
|
+
const p = s, n = de(), f = $(() => {
|
|
224
225
|
let d = [...p.options];
|
|
225
|
-
return d.push(parseInt(p.value)),
|
|
226
|
+
return d.push(parseInt(p.value)), qe(d).sort((t, r) => t - r);
|
|
226
227
|
});
|
|
227
|
-
return (d,
|
|
228
|
+
return (d, t) => (o(), i("select", {
|
|
228
229
|
name: "per_page",
|
|
229
|
-
dusk:
|
|
230
|
-
value:
|
|
230
|
+
dusk: s.dusk,
|
|
231
|
+
value: s.value,
|
|
231
232
|
class: "block focus:ring-indigo-500 focus:border-indigo-500 min-w-max shadow-sm text-sm border-gray-300 rounded-md",
|
|
232
|
-
onChange:
|
|
233
|
+
onChange: t[0] || (t[0] = (r) => s.onChange(r.target.value))
|
|
233
234
|
}, [
|
|
234
|
-
(o(!0),
|
|
235
|
-
key:
|
|
236
|
-
value:
|
|
237
|
-
},
|
|
235
|
+
(o(!0), i(B, null, P(e(f), (r) => (o(), i("option", {
|
|
236
|
+
key: r,
|
|
237
|
+
value: r
|
|
238
|
+
}, v(r) + " " + v(e(n).per_page), 9, Ue))), 128))
|
|
238
239
|
], 40, Qe));
|
|
239
240
|
}
|
|
240
241
|
}, Ye = {
|
|
241
242
|
key: 0,
|
|
242
243
|
class: "bg-white px-4 py-3 flex items-center justify-between border-t border-gray-200 sm:px-6"
|
|
243
|
-
}, Je = { key: 0 }, Xe = /* @__PURE__ */
|
|
244
|
+
}, Je = { key: 0 }, Xe = /* @__PURE__ */ l("svg", {
|
|
244
245
|
xmlns: "http://www.w3.org/2000/svg",
|
|
245
246
|
class: "h-5 w-5 text-gray-400",
|
|
246
247
|
fill: "none",
|
|
@@ -248,12 +249,12 @@ const Qe = ["dusk", "value"], Ue = ["value"], de = {
|
|
|
248
249
|
stroke: "currentColor",
|
|
249
250
|
"stroke-width": "2"
|
|
250
251
|
}, [
|
|
251
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ l("path", {
|
|
252
253
|
"stroke-linecap": "round",
|
|
253
254
|
"stroke-linejoin": "round",
|
|
254
255
|
d: "M7 16l-4-4m0 0l4-4m-4 4h18"
|
|
255
256
|
})
|
|
256
|
-
], -1), Ze = { class: "hidden sm:inline ml-2" }, et = { class: "hidden sm:inline mr-2" }, tt = /* @__PURE__ */
|
|
257
|
+
], -1), Ze = { class: "hidden sm:inline ml-2" }, et = { class: "hidden sm:inline mr-2" }, tt = /* @__PURE__ */ l("svg", {
|
|
257
258
|
xmlns: "http://www.w3.org/2000/svg",
|
|
258
259
|
class: "h-5 w-5 text-gray-400",
|
|
259
260
|
fill: "none",
|
|
@@ -261,7 +262,7 @@ const Qe = ["dusk", "value"], Ue = ["value"], de = {
|
|
|
261
262
|
stroke: "currentColor",
|
|
262
263
|
"stroke-width": "2"
|
|
263
264
|
}, [
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ l("path", {
|
|
265
266
|
"stroke-linecap": "round",
|
|
266
267
|
"stroke-linejoin": "round",
|
|
267
268
|
d: "M17 8l4 4m0 0l-4 4m4-4H3"
|
|
@@ -269,27 +270,27 @@ const Qe = ["dusk", "value"], Ue = ["value"], de = {
|
|
|
269
270
|
], -1), st = {
|
|
270
271
|
key: 2,
|
|
271
272
|
class: "hidden sm:flex-1 sm:flex sm:items-center sm:justify-between"
|
|
272
|
-
}, lt = { class: "flex flex-row space-x-4 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" },
|
|
273
|
+
}, lt = { class: "flex flex-row space-x-4 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 = {
|
|
273
274
|
class: "relative z-0 inline-flex rounded-md shadow-sm -space-x-px",
|
|
274
275
|
"aria-label": "Pagination"
|
|
275
|
-
},
|
|
276
|
+
}, it = { class: "sr-only" }, ct = /* @__PURE__ */ l("svg", {
|
|
276
277
|
xmlns: "http://www.w3.org/2000/svg",
|
|
277
278
|
class: "h-5 w-5",
|
|
278
279
|
viewBox: "0 0 20 20",
|
|
279
280
|
fill: "currentColor"
|
|
280
281
|
}, [
|
|
281
|
-
/* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ l("path", {
|
|
282
283
|
"fill-rule": "evenodd",
|
|
283
284
|
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",
|
|
284
285
|
"clip-rule": "evenodd"
|
|
285
286
|
})
|
|
286
|
-
], -1), dt = { class: "sr-only" }, ht = /* @__PURE__ */
|
|
287
|
+
], -1), dt = { class: "sr-only" }, ht = /* @__PURE__ */ l("svg", {
|
|
287
288
|
xmlns: "http://www.w3.org/2000/svg",
|
|
288
289
|
class: "h-5 w-5",
|
|
289
290
|
viewBox: "0 0 20 20",
|
|
290
291
|
fill: "currentColor"
|
|
291
292
|
}, [
|
|
292
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ l("path", {
|
|
293
294
|
"fill-rule": "evenodd",
|
|
294
295
|
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",
|
|
295
296
|
"clip-rule": "evenodd"
|
|
@@ -325,116 +326,117 @@ const Qe = ["dusk", "value"], Ue = ["value"], de = {
|
|
|
325
326
|
required: !1
|
|
326
327
|
}
|
|
327
328
|
},
|
|
328
|
-
setup(
|
|
329
|
-
const p =
|
|
330
|
-
return (
|
|
331
|
-
|
|
332
|
-
|
|
329
|
+
setup(s) {
|
|
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
|
+
return (O, q) => e(d) ? (o(), i("nav", Ye, [
|
|
332
|
+
j(v(e(d)) + " ", 1),
|
|
333
|
+
!s.hasData || e(t).total < 1 ? (o(), i("p", Je, v(e(n).no_results_found), 1)) : x("", !0),
|
|
334
|
+
s.hasData ? (o(), i("div", {
|
|
333
335
|
key: 1,
|
|
334
|
-
class:
|
|
336
|
+
class: k(["flex-1 flex justify-between", { "sm:hidden": e(f) }])
|
|
335
337
|
}, [
|
|
336
|
-
(o(),
|
|
337
|
-
class:
|
|
338
|
-
"cursor-not-allowed text-gray-400": !e(
|
|
339
|
-
"text-gray-700 hover:text-gray-500": e(
|
|
338
|
+
(o(), _(M(e(r) ? "a" : "div"), {
|
|
339
|
+
class: k([{
|
|
340
|
+
"cursor-not-allowed text-gray-400": !e(r),
|
|
341
|
+
"text-gray-700 hover:text-gray-500": e(r)
|
|
340
342
|
}, "relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md bg-white"]),
|
|
341
|
-
href: e(
|
|
342
|
-
dusk: e(
|
|
343
|
-
onClick: q[0] || (q[0] =
|
|
343
|
+
href: e(r),
|
|
344
|
+
dusk: e(r) ? "pagination-simple-previous" : null,
|
|
345
|
+
onClick: q[0] || (q[0] = F((y) => s.onClick(e(r)), ["prevent"]))
|
|
344
346
|
}, {
|
|
345
|
-
default:
|
|
347
|
+
default: C(() => [
|
|
346
348
|
Xe,
|
|
347
|
-
|
|
349
|
+
l("span", Ze, v(e(n).previous), 1)
|
|
348
350
|
]),
|
|
349
351
|
_: 1
|
|
350
352
|
}, 8, ["class", "href", "dusk"])),
|
|
351
|
-
|
|
353
|
+
D(ce, {
|
|
352
354
|
dusk: "per-page-mobile",
|
|
353
|
-
value: e(
|
|
354
|
-
options:
|
|
355
|
-
"on-change":
|
|
355
|
+
value: e(m),
|
|
356
|
+
options: s.perPageOptions,
|
|
357
|
+
"on-change": s.onPerPageChange
|
|
356
358
|
}, null, 8, ["value", "options", "on-change"]),
|
|
357
|
-
(o(),
|
|
358
|
-
class:
|
|
359
|
-
"cursor-not-allowed text-gray-400": !e(
|
|
360
|
-
"text-gray-700 hover:text-gray-500": e(
|
|
359
|
+
(o(), _(M(e(u) ? "a" : "div"), {
|
|
360
|
+
class: k([{
|
|
361
|
+
"cursor-not-allowed text-gray-400": !e(u),
|
|
362
|
+
"text-gray-700 hover:text-gray-500": e(u)
|
|
361
363
|
}, "ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md bg-white"]),
|
|
362
|
-
href: e(
|
|
363
|
-
dusk: e(
|
|
364
|
-
onClick: q[1] || (q[1] =
|
|
364
|
+
href: e(u),
|
|
365
|
+
dusk: e(u) ? "pagination-simple-next" : null,
|
|
366
|
+
onClick: q[1] || (q[1] = F((y) => s.onClick(e(u)), ["prevent"]))
|
|
365
367
|
}, {
|
|
366
|
-
default:
|
|
367
|
-
|
|
368
|
+
default: C(() => [
|
|
369
|
+
l("span", et, v(e(n).next), 1),
|
|
368
370
|
tt
|
|
369
371
|
]),
|
|
370
372
|
_: 1
|
|
371
373
|
}, 8, ["class", "href", "dusk"]))
|
|
372
374
|
], 2)) : x("", !0),
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
375
|
+
s.hasData && e(f) ? (o(), i("div", st, [
|
|
376
|
+
l("div", lt, [
|
|
377
|
+
D(ce, {
|
|
376
378
|
dusk: "per-page-full",
|
|
377
|
-
value: e(
|
|
378
|
-
options:
|
|
379
|
-
"on-change":
|
|
379
|
+
value: e(m),
|
|
380
|
+
options: s.perPageOptions,
|
|
381
|
+
"on-change": s.onPerPageChange
|
|
380
382
|
}, null, 8, ["value", "options", "on-change"]),
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
383
|
+
l("p", rt, [
|
|
384
|
+
l("span", nt, v(e(t).from), 1),
|
|
385
|
+
j(" " + v(e(n).to) + " ", 1),
|
|
386
|
+
l("span", at, v(e(t).to), 1),
|
|
387
|
+
j(" " + v(e(n).of) + " ", 1),
|
|
388
|
+
l("span", ot, v(e(t).total), 1),
|
|
389
|
+
j(" " + v(e(n).results), 1)
|
|
388
390
|
])
|
|
389
391
|
]),
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
(o(),
|
|
393
|
-
class:
|
|
394
|
-
"cursor-not-allowed text-gray-400": !e(
|
|
395
|
-
"text-gray-500 hover:bg-gray-50": e(
|
|
392
|
+
l("div", null, [
|
|
393
|
+
l("nav", ut, [
|
|
394
|
+
(o(), _(M(e(r) ? "a" : "div"), {
|
|
395
|
+
class: k([{
|
|
396
|
+
"cursor-not-allowed text-gray-400": !e(r),
|
|
397
|
+
"text-gray-500 hover:bg-gray-50": e(r)
|
|
396
398
|
}, "relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium"]),
|
|
397
|
-
href: e(
|
|
398
|
-
dusk: e(
|
|
399
|
-
onClick: q[2] || (q[2] =
|
|
399
|
+
href: e(r),
|
|
400
|
+
dusk: e(r) ? "pagination-previous" : null,
|
|
401
|
+
onClick: q[2] || (q[2] = F((y) => s.onClick(e(r)), ["prevent"]))
|
|
400
402
|
}, {
|
|
401
|
-
default:
|
|
402
|
-
|
|
403
|
+
default: C(() => [
|
|
404
|
+
l("span", it, v(e(n).previous), 1),
|
|
403
405
|
ct
|
|
404
406
|
]),
|
|
405
407
|
_: 1
|
|
406
408
|
}, 8, ["class", "href", "dusk"])),
|
|
407
|
-
(o(!0),
|
|
408
|
-
|
|
409
|
-
!isNaN(
|
|
409
|
+
(o(!0), i(B, null, P(e(t).links, (y, V) => (o(), i("div", { key: V }, [
|
|
410
|
+
w(O.$slots, "link", {}, () => [
|
|
411
|
+
!isNaN(y.label) || y.label === "..." ? (o(), _(M(y.url ? "a" : "div"), {
|
|
410
412
|
key: 0,
|
|
411
|
-
href:
|
|
412
|
-
dusk:
|
|
413
|
-
class:
|
|
414
|
-
"cursor-not-allowed": !
|
|
415
|
-
"hover:bg-gray-50":
|
|
416
|
-
"bg-gray-100":
|
|
413
|
+
href: y.url,
|
|
414
|
+
dusk: y.url ? `pagination-${y.label}` : null,
|
|
415
|
+
class: k(["relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700", {
|
|
416
|
+
"cursor-not-allowed": !y.url,
|
|
417
|
+
"hover:bg-gray-50": y.url,
|
|
418
|
+
"bg-gray-100": y.active
|
|
417
419
|
}]),
|
|
418
|
-
onClick:
|
|
420
|
+
onClick: F((L) => s.onClick(y.url), ["prevent"])
|
|
419
421
|
}, {
|
|
420
|
-
default:
|
|
421
|
-
|
|
422
|
+
default: C(() => [
|
|
423
|
+
j(v(y.label), 1)
|
|
422
424
|
]),
|
|
423
425
|
_: 2
|
|
424
426
|
}, 1032, ["href", "dusk", "class", "onClick"])) : x("", !0)
|
|
425
427
|
])
|
|
426
428
|
]))), 128)),
|
|
427
|
-
(o(),
|
|
428
|
-
class:
|
|
429
|
-
"cursor-not-allowed text-gray-400": !e(
|
|
430
|
-
"text-gray-500 hover:bg-gray-50": e(
|
|
429
|
+
(o(), _(M(e(u) ? "a" : "div"), {
|
|
430
|
+
class: k([{
|
|
431
|
+
"cursor-not-allowed text-gray-400": !e(u),
|
|
432
|
+
"text-gray-500 hover:bg-gray-50": e(u)
|
|
431
433
|
}, "relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium"]),
|
|
432
|
-
href: e(
|
|
433
|
-
dusk: e(
|
|
434
|
-
onClick: q[3] || (q[3] =
|
|
434
|
+
href: e(u),
|
|
435
|
+
dusk: e(u) ? "pagination-next" : null,
|
|
436
|
+
onClick: q[3] || (q[3] = F((y) => s.onClick(e(u)), ["prevent"]))
|
|
435
437
|
}, {
|
|
436
|
-
default:
|
|
437
|
-
|
|
438
|
+
default: C(() => [
|
|
439
|
+
l("span", dt, v(e(n).next), 1),
|
|
438
440
|
ht
|
|
439
441
|
]),
|
|
440
442
|
_: 1
|
|
@@ -444,23 +446,23 @@ const Qe = ["dusk", "value"], Ue = ["value"], de = {
|
|
|
444
446
|
])) : x("", !0)
|
|
445
447
|
])) : x("", !0);
|
|
446
448
|
}
|
|
447
|
-
}, pt = /* @__PURE__ */
|
|
449
|
+
}, pt = /* @__PURE__ */ l("svg", {
|
|
448
450
|
xmlns: "http://www.w3.org/2000/svg",
|
|
449
451
|
class: "h-5 w-5 text-gray-400",
|
|
450
452
|
viewBox: "0 0 20 20",
|
|
451
453
|
fill: "currentColor"
|
|
452
454
|
}, [
|
|
453
|
-
/* @__PURE__ */
|
|
455
|
+
/* @__PURE__ */ l("path", {
|
|
454
456
|
"fill-rule": "evenodd",
|
|
455
457
|
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",
|
|
456
458
|
"clip-rule": "evenodd"
|
|
457
459
|
})
|
|
458
|
-
], -1),
|
|
460
|
+
], -1), vt = {
|
|
459
461
|
role: "menu",
|
|
460
462
|
"aria-orientation": "horizontal",
|
|
461
463
|
"aria-labelledby": "add-search-input-menu",
|
|
462
464
|
class: "min-w-max"
|
|
463
|
-
},
|
|
465
|
+
}, gt = ["dusk", "onClick"], mt = {
|
|
464
466
|
__name: "TableAddSearchRow",
|
|
465
467
|
props: {
|
|
466
468
|
searchInputs: {
|
|
@@ -476,36 +478,36 @@ const Qe = ["dusk", "value"], Ue = ["value"], de = {
|
|
|
476
478
|
required: !0
|
|
477
479
|
}
|
|
478
480
|
},
|
|
479
|
-
setup(
|
|
480
|
-
const p =
|
|
481
|
+
setup(s) {
|
|
482
|
+
const p = s, n = S(null);
|
|
481
483
|
function f(d) {
|
|
482
484
|
p.onAdd(d), n.value.hide();
|
|
483
485
|
}
|
|
484
|
-
return (d,
|
|
486
|
+
return (d, t) => (o(), _(X, {
|
|
485
487
|
ref_key: "dropdown",
|
|
486
488
|
ref: n,
|
|
487
489
|
dusk: "add-search-row-dropdown",
|
|
488
|
-
disabled: !
|
|
490
|
+
disabled: !s.hasSearchInputsWithoutValue,
|
|
489
491
|
class: "w-auto"
|
|
490
492
|
}, {
|
|
491
|
-
button:
|
|
493
|
+
button: C(() => [
|
|
492
494
|
pt
|
|
493
495
|
]),
|
|
494
|
-
default:
|
|
495
|
-
|
|
496
|
-
(o(!0),
|
|
497
|
-
key:
|
|
498
|
-
dusk: `add-search-row-${
|
|
496
|
+
default: C(() => [
|
|
497
|
+
l("div", vt, [
|
|
498
|
+
(o(!0), i(B, null, P(s.searchInputs, (r, u) => (o(), i("button", {
|
|
499
|
+
key: u,
|
|
500
|
+
dusk: `add-search-row-${r.key}`,
|
|
499
501
|
class: "text-left w-full px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 hover:text-gray-900",
|
|
500
502
|
role: "menuitem",
|
|
501
|
-
onClick:
|
|
502
|
-
},
|
|
503
|
+
onClick: F((m) => f(r.key), ["prevent"])
|
|
504
|
+
}, v(r.label), 9, gt))), 128))
|
|
503
505
|
])
|
|
504
506
|
]),
|
|
505
507
|
_: 1
|
|
506
508
|
}, 8, ["disabled"]));
|
|
507
509
|
}
|
|
508
|
-
}, bt = /* @__PURE__ */
|
|
510
|
+
}, bt = /* @__PURE__ */ l("path", { d: "M10 12a2 2 0 100-4 2 2 0 000 4z" }, null, -1), yt = /* @__PURE__ */ l("path", {
|
|
509
511
|
"fill-rule": "evenodd",
|
|
510
512
|
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",
|
|
511
513
|
"clip-rule": "evenodd"
|
|
@@ -517,7 +519,7 @@ const Qe = ["dusk", "value"], Ue = ["value"], de = {
|
|
|
517
519
|
"aria-orientation": "horizontal",
|
|
518
520
|
"aria-labelledby": "toggle-columns-menu",
|
|
519
521
|
class: "min-w-max"
|
|
520
|
-
}, kt = { class: "px-2" }, _t = { class: "divide-y divide-gray-200" }, $t = { class: "text-sm text-gray-900" }, Ct = ["aria-pressed", "aria-labelledby", "aria-describedby", "dusk", "onClick"], St = /* @__PURE__ */
|
|
522
|
+
}, kt = { class: "px-2" }, _t = { class: "divide-y divide-gray-200" }, $t = { class: "text-sm text-gray-900" }, Ct = ["aria-pressed", "aria-labelledby", "aria-describedby", "dusk", "onClick"], St = /* @__PURE__ */ l("span", { class: "sr-only" }, "Column status", -1), qt = {
|
|
521
523
|
__name: "TableColumns",
|
|
522
524
|
props: {
|
|
523
525
|
columns: {
|
|
@@ -533,56 +535,56 @@ const Qe = ["dusk", "value"], Ue = ["value"], de = {
|
|
|
533
535
|
required: !0
|
|
534
536
|
}
|
|
535
537
|
},
|
|
536
|
-
setup(
|
|
537
|
-
const p =
|
|
538
|
-
return (f, d) => (o(),
|
|
538
|
+
setup(s) {
|
|
539
|
+
const p = s, n = z("activeClasses");
|
|
540
|
+
return (f, d) => (o(), _(X, {
|
|
539
541
|
placement: "bottom-end",
|
|
540
542
|
dusk: "columns-dropdown",
|
|
541
|
-
active:
|
|
543
|
+
active: s.hasHiddenColumns
|
|
542
544
|
}, {
|
|
543
|
-
button:
|
|
544
|
-
(o(),
|
|
545
|
+
button: C(() => [
|
|
546
|
+
(o(), i("svg", {
|
|
545
547
|
xmlns: "http://www.w3.org/2000/svg",
|
|
546
|
-
class:
|
|
547
|
-
"text-gray-400": !
|
|
548
|
-
[e(n).text]:
|
|
548
|
+
class: k(["h-5 w-5", {
|
|
549
|
+
"text-gray-400": !s.hasHiddenColumns,
|
|
550
|
+
[e(n).text]: s.hasHiddenColumns
|
|
549
551
|
}]),
|
|
550
552
|
viewBox: "0 0 20 20",
|
|
551
553
|
fill: "currentColor"
|
|
552
554
|
}, wt, 2))
|
|
553
555
|
]),
|
|
554
|
-
default:
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
(o(!0),
|
|
559
|
-
key:
|
|
556
|
+
default: C(() => [
|
|
557
|
+
l("div", xt, [
|
|
558
|
+
l("div", kt, [
|
|
559
|
+
l("ul", _t, [
|
|
560
|
+
(o(!0), i(B, null, P(p.columns, (t, r) => E((o(), i("li", {
|
|
561
|
+
key: r,
|
|
560
562
|
class: "py-2 flex items-center justify-between"
|
|
561
563
|
}, [
|
|
562
|
-
|
|
563
|
-
|
|
564
|
+
l("p", $t, v(t.label), 1),
|
|
565
|
+
l("button", {
|
|
564
566
|
type: "button",
|
|
565
|
-
class:
|
|
566
|
-
"bg-green-500": !
|
|
567
|
-
"bg-gray-200":
|
|
567
|
+
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", {
|
|
568
|
+
"bg-green-500": !t.hidden,
|
|
569
|
+
"bg-gray-200": t.hidden
|
|
568
570
|
}]),
|
|
569
|
-
"aria-pressed": !
|
|
570
|
-
"aria-labelledby": `toggle-column-${
|
|
571
|
-
"aria-describedby": `toggle-column-${
|
|
572
|
-
dusk: `toggle-column-${
|
|
573
|
-
onClick:
|
|
571
|
+
"aria-pressed": !t.hidden,
|
|
572
|
+
"aria-labelledby": `toggle-column-${t.key}`,
|
|
573
|
+
"aria-describedby": `toggle-column-${t.key}`,
|
|
574
|
+
dusk: `toggle-column-${t.key}`,
|
|
575
|
+
onClick: F((u) => s.onChange(t.key, t.hidden), ["prevent"])
|
|
574
576
|
}, [
|
|
575
577
|
St,
|
|
576
|
-
|
|
578
|
+
l("span", {
|
|
577
579
|
"aria-hidden": "true",
|
|
578
|
-
class:
|
|
579
|
-
"translate-x-5": !
|
|
580
|
-
"translate-x-0":
|
|
580
|
+
class: k([{
|
|
581
|
+
"translate-x-5": !t.hidden,
|
|
582
|
+
"translate-x-0": t.hidden
|
|
581
583
|
}, "inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200"])
|
|
582
584
|
}, null, 2)
|
|
583
585
|
], 10, Ct)
|
|
584
586
|
])), [
|
|
585
|
-
[
|
|
587
|
+
[A, t.can_be_hidden]
|
|
586
588
|
])), 128))
|
|
587
589
|
])
|
|
588
590
|
])
|
|
@@ -591,7 +593,7 @@ const Qe = ["dusk", "value"], Ue = ["value"], de = {
|
|
|
591
593
|
_: 1
|
|
592
594
|
}, 8, ["active"]));
|
|
593
595
|
}
|
|
594
|
-
}, Ft = /* @__PURE__ */
|
|
596
|
+
}, Ft = /* @__PURE__ */ l("path", {
|
|
595
597
|
"fill-rule": "evenodd",
|
|
596
598
|
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",
|
|
597
599
|
"clip-rule": "evenodd"
|
|
@@ -601,7 +603,7 @@ const Qe = ["dusk", "value"], Ue = ["value"], de = {
|
|
|
601
603
|
role: "menu",
|
|
602
604
|
"aria-orientation": "horizontal",
|
|
603
605
|
"aria-labelledby": "filter-menu",
|
|
604
|
-
class: "min-w-
|
|
606
|
+
class: "min-w-[320px]"
|
|
605
607
|
}, Ot = { class: "text-xs uppercase tracking-wide bg-gray-100 p-3" }, jt = { class: "p-2" }, Tt = ["name", "value", "onChange"], Lt = ["value"], Vt = {
|
|
606
608
|
__name: "TableFilter",
|
|
607
609
|
props: {
|
|
@@ -618,40 +620,40 @@ const Qe = ["dusk", "value"], Ue = ["value"], de = {
|
|
|
618
620
|
required: !0
|
|
619
621
|
}
|
|
620
622
|
},
|
|
621
|
-
setup(
|
|
622
|
-
const p =
|
|
623
|
-
return (n, f) => (o(),
|
|
623
|
+
setup(s) {
|
|
624
|
+
const p = z("activeClasses");
|
|
625
|
+
return (n, f) => (o(), _(X, {
|
|
624
626
|
placement: "bottom-end",
|
|
625
627
|
dusk: "filters-dropdown",
|
|
626
|
-
active:
|
|
628
|
+
active: s.hasEnabledFilters
|
|
627
629
|
}, {
|
|
628
|
-
button:
|
|
629
|
-
(o(),
|
|
630
|
+
button: C(() => [
|
|
631
|
+
(o(), i("svg", {
|
|
630
632
|
xmlns: "http://www.w3.org/2000/svg",
|
|
631
|
-
class:
|
|
632
|
-
"text-gray-400": !
|
|
633
|
-
[e(p).text]:
|
|
633
|
+
class: k(["h-5 w-5", {
|
|
634
|
+
"text-gray-400": !s.hasEnabledFilters,
|
|
635
|
+
[e(p).text]: s.hasEnabledFilters
|
|
634
636
|
}]),
|
|
635
637
|
viewBox: "0 0 20 20",
|
|
636
638
|
fill: "currentColor"
|
|
637
639
|
}, Bt, 2))
|
|
638
640
|
]),
|
|
639
|
-
default:
|
|
640
|
-
|
|
641
|
-
(o(!0),
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
d.type === "select" ? (o(),
|
|
641
|
+
default: C(() => [
|
|
642
|
+
l("div", Pt, [
|
|
643
|
+
(o(!0), i(B, null, P(s.filters, (d, t) => (o(), i("div", { key: t }, [
|
|
644
|
+
l("h3", Ot, v(d.label), 1),
|
|
645
|
+
l("div", jt, [
|
|
646
|
+
d.type === "select" ? (o(), i("select", {
|
|
645
647
|
key: 0,
|
|
646
648
|
name: d.key,
|
|
647
649
|
value: d.value,
|
|
648
650
|
class: "block focus:ring-indigo-500 focus:border-indigo-500 w-full shadow-sm text-sm border-gray-300 rounded-md",
|
|
649
|
-
onChange: (
|
|
651
|
+
onChange: (r) => s.onFilterChange(d.key, r.target.value)
|
|
650
652
|
}, [
|
|
651
|
-
(o(!0),
|
|
652
|
-
key:
|
|
653
|
-
value:
|
|
654
|
-
},
|
|
653
|
+
(o(!0), i(B, null, P(d.options, (r, u) => (o(), i("option", {
|
|
654
|
+
key: u,
|
|
655
|
+
value: u
|
|
656
|
+
}, v(r), 9, Lt))), 128))
|
|
655
657
|
], 40, Tt)) : x("", !0)
|
|
656
658
|
])
|
|
657
659
|
]))), 128))
|
|
@@ -660,24 +662,24 @@ const Qe = ["dusk", "value"], Ue = ["value"], de = {
|
|
|
660
662
|
_: 1
|
|
661
663
|
}, 8, ["active"]));
|
|
662
664
|
}
|
|
663
|
-
},
|
|
665
|
+
}, Mt = { class: "flex items-center justify-start my-3 text-sm" }, zt = { class: "flex items-center" }, It = /* @__PURE__ */ l("svg", {
|
|
664
666
|
xmlns: "http://www.w3.org/2000/svg",
|
|
665
667
|
class: "h-5 w-5 text-gray-300",
|
|
666
668
|
viewBox: "0 0 20 20",
|
|
667
669
|
fill: "currentColor"
|
|
668
670
|
}, [
|
|
669
|
-
/* @__PURE__ */
|
|
671
|
+
/* @__PURE__ */ l("path", {
|
|
670
672
|
"fill-rule": "evenodd",
|
|
671
673
|
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",
|
|
672
674
|
"clip-rule": "evenodd"
|
|
673
675
|
})
|
|
674
|
-
], -1), Rt = { class: "text-gray-400 ml-1" }, Dt = ["textContent"], Et = ["onClick"], At = { class: "ml-1" }, Wt = /* @__PURE__ */
|
|
676
|
+
], -1), Rt = { class: "text-gray-400 ml-1" }, Dt = ["textContent"], Et = ["onClick"], At = { class: "ml-1" }, Wt = /* @__PURE__ */ l("path", {
|
|
675
677
|
"fill-rule": "evenodd",
|
|
676
678
|
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",
|
|
677
679
|
"clip-rule": "evenodd"
|
|
678
680
|
}, null, -1), Nt = [
|
|
679
681
|
Wt
|
|
680
|
-
],
|
|
682
|
+
], Gt = {
|
|
681
683
|
__name: "TableActiveFilters",
|
|
682
684
|
props: {
|
|
683
685
|
filters: {
|
|
@@ -689,31 +691,31 @@ const Qe = ["dusk", "value"], Ue = ["value"], de = {
|
|
|
689
691
|
required: !0
|
|
690
692
|
}
|
|
691
693
|
},
|
|
692
|
-
setup(
|
|
693
|
-
const p =
|
|
694
|
-
return (
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
textContent:
|
|
694
|
+
setup(s) {
|
|
695
|
+
const p = s, n = z("activeClasses"), f = $(() => p.filters.filter((t) => t.value !== null)), d = $(() => f.value.length);
|
|
696
|
+
return (t, r) => (o(), i("div", Mt, [
|
|
697
|
+
l("div", zt, [
|
|
698
|
+
It,
|
|
699
|
+
l("span", Rt, [
|
|
700
|
+
j(v(e(d)) + " active ", 1),
|
|
701
|
+
l("span", {
|
|
702
|
+
textContent: v(e(d) === 1 ? "filter" : "filters")
|
|
701
703
|
}, null, 8, Dt),
|
|
702
|
-
|
|
704
|
+
j(":")
|
|
703
705
|
])
|
|
704
706
|
]),
|
|
705
|
-
(o(!0),
|
|
706
|
-
key:
|
|
707
|
-
class:
|
|
708
|
-
onClick: (
|
|
707
|
+
(o(!0), i(B, null, P(e(f), (u) => (o(), i("button", {
|
|
708
|
+
key: u.label,
|
|
709
|
+
class: k(["block group ml-3 flex items-center justify-between px-2 py-1 rounded bg-gray-100", `hover:${e(n).text}`]),
|
|
710
|
+
onClick: (m) => s.onFilterChange(u.key, null)
|
|
709
711
|
}, [
|
|
710
|
-
|
|
711
|
-
class:
|
|
712
|
-
},
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
(o(),
|
|
716
|
-
class:
|
|
712
|
+
l("span", {
|
|
713
|
+
class: k(["capitalize text-gray-500", `group-hover:${e(n).text}`])
|
|
714
|
+
}, v(u.label.replace("_", " ")), 3),
|
|
715
|
+
j(":"),
|
|
716
|
+
l("span", At, v(u.options[u.value]), 1),
|
|
717
|
+
(o(), i("svg", {
|
|
718
|
+
class: k([`group-hover:${e(n).text}`, "h-4 w-4 ml-1 text-gray-400"]),
|
|
717
719
|
xmlns: "http://www.w3.org/2000/svg",
|
|
718
720
|
viewBox: "0 0 20 20",
|
|
719
721
|
fill: "currentColor"
|
|
@@ -721,14 +723,14 @@ const Qe = ["dusk", "value"], Ue = ["value"], de = {
|
|
|
721
723
|
], 10, Et))), 128))
|
|
722
724
|
]));
|
|
723
725
|
}
|
|
724
|
-
},
|
|
725
|
-
/* @__PURE__ */
|
|
726
|
+
}, Ht = { class: "relative" }, Kt = ["placeholder", "value"], Qt = /* @__PURE__ */ l("div", { class: "absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none" }, [
|
|
727
|
+
/* @__PURE__ */ l("svg", {
|
|
726
728
|
xmlns: "http://www.w3.org/2000/svg",
|
|
727
729
|
class: "w-5 h-5 text-gray-400",
|
|
728
730
|
viewBox: "0 0 20 20",
|
|
729
731
|
fill: "currentColor"
|
|
730
732
|
}, [
|
|
731
|
-
/* @__PURE__ */
|
|
733
|
+
/* @__PURE__ */ l("path", {
|
|
732
734
|
"fill-rule": "evenodd",
|
|
733
735
|
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",
|
|
734
736
|
"clip-rule": "evenodd"
|
|
@@ -752,39 +754,39 @@ const Qe = ["dusk", "value"], Ue = ["value"], de = {
|
|
|
752
754
|
required: !0
|
|
753
755
|
}
|
|
754
756
|
},
|
|
755
|
-
setup(
|
|
756
|
-
const p =
|
|
757
|
-
return (n, f) => (o(),
|
|
758
|
-
|
|
759
|
-
class:
|
|
760
|
-
placeholder:
|
|
761
|
-
value:
|
|
757
|
+
setup(s) {
|
|
758
|
+
const p = z("activeClasses");
|
|
759
|
+
return (n, f) => (o(), i("div", Ht, [
|
|
760
|
+
l("input", {
|
|
761
|
+
class: k(["block w-full text-sm border-gray-300 rounded-md shadow-sm pl-9", [e(p).focusRing, e(p).focusBorder]]),
|
|
762
|
+
placeholder: s.label,
|
|
763
|
+
value: s.value,
|
|
762
764
|
type: "text",
|
|
763
765
|
name: "global",
|
|
764
|
-
onInput: f[0] || (f[0] = (d) =>
|
|
766
|
+
onInput: f[0] || (f[0] = (d) => s.onChange(d.target.value))
|
|
765
767
|
}, null, 42, Kt),
|
|
766
768
|
Qt
|
|
767
769
|
]));
|
|
768
770
|
}
|
|
769
|
-
}, Yt = { class: "flex rounded-md shadow-sm relative mt-3" }, Jt = ["for"], Xt = /* @__PURE__ */
|
|
771
|
+
}, Yt = { class: "flex rounded-md shadow-sm relative mt-3" }, Jt = ["for"], Xt = /* @__PURE__ */ l("svg", {
|
|
770
772
|
xmlns: "http://www.w3.org/2000/svg",
|
|
771
773
|
class: "h-5 w-5 mr-2 text-gray-400",
|
|
772
774
|
viewBox: "0 0 20 20",
|
|
773
775
|
fill: "currentColor"
|
|
774
776
|
}, [
|
|
775
|
-
/* @__PURE__ */
|
|
777
|
+
/* @__PURE__ */ l("path", {
|
|
776
778
|
"fill-rule": "evenodd",
|
|
777
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",
|
|
778
780
|
"clip-rule": "evenodd"
|
|
779
781
|
})
|
|
780
|
-
], -1), Zt = ["id", "name", "value", "onInput"], es = { class: "absolute inset-y-0 right-0 pr-3 flex items-center" }, ts = ["dusk", "onClick"], ss = /* @__PURE__ */
|
|
782
|
+
], -1), Zt = ["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", {
|
|
781
783
|
xmlns: "http://www.w3.org/2000/svg",
|
|
782
784
|
class: "h-5 w-5",
|
|
783
785
|
fill: "none",
|
|
784
786
|
viewBox: "0 0 24 24",
|
|
785
787
|
stroke: "currentColor"
|
|
786
788
|
}, [
|
|
787
|
-
/* @__PURE__ */
|
|
789
|
+
/* @__PURE__ */ l("path", {
|
|
788
790
|
"stroke-linecap": "round",
|
|
789
791
|
"stroke-linejoin": "round",
|
|
790
792
|
"stroke-width": "2",
|
|
@@ -813,68 +815,68 @@ const Qe = ["dusk", "value"], Ue = ["value"], de = {
|
|
|
813
815
|
required: !0
|
|
814
816
|
}
|
|
815
817
|
},
|
|
816
|
-
setup(
|
|
817
|
-
const p =
|
|
818
|
-
let f =
|
|
819
|
-
function d(
|
|
820
|
-
return p.forcedVisibleSearchInputs.includes(
|
|
818
|
+
setup(s) {
|
|
819
|
+
const p = s, n = { el: S([]) };
|
|
820
|
+
let f = $(() => n.el.value);
|
|
821
|
+
function d(t) {
|
|
822
|
+
return p.forcedVisibleSearchInputs.includes(t);
|
|
821
823
|
}
|
|
822
|
-
return J(p.forcedVisibleSearchInputs, (
|
|
823
|
-
const
|
|
824
|
-
!
|
|
825
|
-
const
|
|
826
|
-
|
|
824
|
+
return J(p.forcedVisibleSearchInputs, (t) => {
|
|
825
|
+
const r = t.length > 0 ? t[t.length - 1] : null;
|
|
826
|
+
!r || we().then(() => {
|
|
827
|
+
const u = Fe(f.value, (m) => m.__vnode.key === r);
|
|
828
|
+
u && u.focus();
|
|
827
829
|
});
|
|
828
|
-
}, { immediate: !0 }), (
|
|
829
|
-
key:
|
|
830
|
+
}, { immediate: !0 }), (t, r) => (o(!0), i(B, null, P(s.searchInputs, (u, m) => E((o(), i("div", {
|
|
831
|
+
key: m,
|
|
830
832
|
class: "px-4 sm:px-0"
|
|
831
833
|
}, [
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
for:
|
|
834
|
+
l("div", Yt, [
|
|
835
|
+
l("label", {
|
|
836
|
+
for: u.key,
|
|
835
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"
|
|
836
838
|
}, [
|
|
837
839
|
Xt,
|
|
838
|
-
|
|
840
|
+
l("span", null, v(u.label), 1)
|
|
839
841
|
], 8, Jt),
|
|
840
|
-
(o(),
|
|
841
|
-
id:
|
|
842
|
+
(o(), i("input", {
|
|
843
|
+
id: u.key,
|
|
842
844
|
ref_for: !0,
|
|
843
845
|
ref: n.el,
|
|
844
|
-
key:
|
|
845
|
-
name:
|
|
846
|
-
value:
|
|
846
|
+
key: u.key,
|
|
847
|
+
name: u.key,
|
|
848
|
+
value: u.value,
|
|
847
849
|
type: "text",
|
|
848
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",
|
|
849
|
-
onInput: (
|
|
851
|
+
onInput: (O) => s.onChange(u.key, O.target.value)
|
|
850
852
|
}, null, 40, Zt)),
|
|
851
|
-
|
|
852
|
-
|
|
853
|
+
l("div", es, [
|
|
854
|
+
l("button", {
|
|
853
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",
|
|
854
|
-
dusk: `remove-search-row-${
|
|
855
|
-
onClick:
|
|
856
|
+
dusk: `remove-search-row-${u.key}`,
|
|
857
|
+
onClick: F((O) => s.onRemove(u.key), ["prevent"])
|
|
856
858
|
}, rs, 8, ts)
|
|
857
859
|
])
|
|
858
860
|
])
|
|
859
861
|
])), [
|
|
860
|
-
[
|
|
862
|
+
[A, u.value !== null || d(u.key)]
|
|
861
863
|
])), 128));
|
|
862
864
|
}
|
|
863
|
-
}, as = /* @__PURE__ */
|
|
865
|
+
}, as = /* @__PURE__ */ l("svg", {
|
|
864
866
|
xmlns: "http://www.w3.org/2000/svg",
|
|
865
867
|
class: "h-5 w-5 mr-2 text-gray-400",
|
|
866
868
|
viewBox: "0 0 20 20",
|
|
867
869
|
fill: "currentColor"
|
|
868
870
|
}, [
|
|
869
|
-
/* @__PURE__ */
|
|
871
|
+
/* @__PURE__ */ l("path", {
|
|
870
872
|
"fill-rule": "evenodd",
|
|
871
873
|
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",
|
|
872
874
|
"clip-rule": "evenodd"
|
|
873
875
|
})
|
|
874
|
-
], -1), os = /* @__PURE__ */
|
|
876
|
+
], -1), os = /* @__PURE__ */ l("span", null, "Reset", -1), us = [
|
|
875
877
|
as,
|
|
876
878
|
os
|
|
877
|
-
],
|
|
879
|
+
], is = {
|
|
878
880
|
__name: "TableReset",
|
|
879
881
|
props: {
|
|
880
882
|
onClick: {
|
|
@@ -882,43 +884,45 @@ const Qe = ["dusk", "value"], Ue = ["value"], de = {
|
|
|
882
884
|
required: !0
|
|
883
885
|
}
|
|
884
886
|
},
|
|
885
|
-
setup(
|
|
886
|
-
return (p, n) => (o(),
|
|
887
|
+
setup(s) {
|
|
888
|
+
return (p, n) => (o(), i("button", {
|
|
887
889
|
ref: "button",
|
|
888
890
|
type: "button",
|
|
889
891
|
dusk: "reset-table",
|
|
890
892
|
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",
|
|
891
893
|
"aria-haspopup": "true",
|
|
892
|
-
onClick: n[0] || (n[0] =
|
|
893
|
-
},
|
|
894
|
+
onClick: n[0] || (n[0] = F((...f) => s.onClick && s.onClick(...f), ["prevent"]))
|
|
895
|
+
}, us, 512));
|
|
894
896
|
}
|
|
895
|
-
}, cs = (
|
|
896
|
-
const n =
|
|
897
|
+
}, cs = (s, p) => {
|
|
898
|
+
const n = s.__vccOpts || s;
|
|
897
899
|
for (const [f, d] of p)
|
|
898
900
|
n[f] = d;
|
|
899
901
|
return n;
|
|
900
|
-
}, 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" },
|
|
901
|
-
function
|
|
902
|
-
return o(),
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
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" }, vs = { class: "shadow border-b border-gray-200 relative" };
|
|
903
|
+
function gs(s, p) {
|
|
904
|
+
return o(), i("div", hs, [
|
|
905
|
+
l("div", fs, [
|
|
906
|
+
l("div", ps, [
|
|
907
|
+
l("div", vs, [
|
|
908
|
+
w(s.$slots, "default")
|
|
907
909
|
])
|
|
908
910
|
])
|
|
909
911
|
])
|
|
910
912
|
]);
|
|
911
913
|
}
|
|
912
|
-
const ms = /* @__PURE__ */ cs(ds, [["render",
|
|
914
|
+
const ms = /* @__PURE__ */ cs(ds, [["render", gs]]), bs = ["dusk"], ys = { class: "flex flex-row flex-wrap justify-start space-x-2 sm:flex-nowrap" }, ws = {
|
|
913
915
|
key: 0,
|
|
914
916
|
class: "order-2 sm:order-1"
|
|
915
|
-
}, xs = {
|
|
916
|
-
key: 1,
|
|
917
|
-
class: "flex flex-row order-1 w-full mb-2 sm:w-auto sm:flex-grow sm:order-2 sm:mb-0"
|
|
918
|
-
}, ks = {
|
|
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 = {
|
|
919
918
|
key: 0,
|
|
920
919
|
class: "order-5 ml-auto sm:order-3"
|
|
921
|
-
}, _s = { class: "min-w-full bg-white divide-y divide-gray-200" }, $s = { class: "bg-gray-50" }, Cs = { class: "px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-500 uppercase" }, Ss = { class: "bg-white divide-y divide-gray-200" }, qs = ["onClick"],
|
|
920
|
+
}, _s = { class: "min-w-full bg-white divide-y divide-gray-200" }, $s = { class: "bg-gray-50" }, Cs = { class: "px-6 py-3 text-xs font-medium tracking-wider text-left text-gray-500 uppercase" }, Ss = { class: "bg-white divide-y divide-gray-200" }, qs = ["onClick"], Fs = { key: 0 }, Bs = /* @__PURE__ */ l("td", {
|
|
921
|
+
class: "px-6 py-4 text-sm text-gray-500 whitespace-nowrap text-center",
|
|
922
|
+
colspan: 100
|
|
923
|
+
}, " Geen resultaten gevonden. ", -1), Ps = [
|
|
924
|
+
Bs
|
|
925
|
+
], Qs = {
|
|
922
926
|
__name: "Table",
|
|
923
927
|
props: {
|
|
924
928
|
inertia: {
|
|
@@ -977,114 +981,119 @@ const ms = /* @__PURE__ */ cs(ds, [["render", vs]]), bs = ["dusk"], ys = { class
|
|
|
977
981
|
focusBorder: "focus:border-indigo-500"
|
|
978
982
|
};
|
|
979
983
|
}
|
|
984
|
+
},
|
|
985
|
+
showGlobalSearch: {
|
|
986
|
+
type: [Boolean, String],
|
|
987
|
+
default: !0,
|
|
988
|
+
required: !1
|
|
980
989
|
}
|
|
981
990
|
},
|
|
982
991
|
emits: ["rowClick"],
|
|
983
|
-
setup(
|
|
984
|
-
const n =
|
|
985
|
-
|
|
986
|
-
const f =
|
|
987
|
-
let a = d.
|
|
988
|
-
return a._updates =
|
|
989
|
-
}),
|
|
992
|
+
setup(s, { emit: p }) {
|
|
993
|
+
const n = s;
|
|
994
|
+
xe("activeClasses", n.activeClasses);
|
|
995
|
+
const f = S(0), d = Be(), t = $(() => {
|
|
996
|
+
let a = d.props.queryBuilderProps ? d.props.queryBuilderProps[n.name] || {} : {};
|
|
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), V = $(() => 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 ? {
|
|
990
999
|
...n.resource.meta,
|
|
991
1000
|
next_page_url: n.resource.links.next,
|
|
992
1001
|
prev_page_url: n.resource.links.prev
|
|
993
|
-
} : "meta" in n.resource ? n.resource.meta : n.resource),
|
|
994
|
-
function
|
|
1002
|
+
} : "meta" in n.resource ? n.resource.meta : n.resource), L = $(() => y.value.length > 0 || V.value.total > 0);
|
|
1003
|
+
function he(a, c) {
|
|
995
1004
|
p("rowClick", a, c);
|
|
996
1005
|
}
|
|
997
|
-
function
|
|
998
|
-
|
|
1006
|
+
function fe(a) {
|
|
1007
|
+
m.value = m.value.filter((c) => c != a), W(a, null);
|
|
999
1008
|
}
|
|
1000
|
-
function
|
|
1001
|
-
|
|
1009
|
+
function ee(a) {
|
|
1010
|
+
m.value.push(a);
|
|
1002
1011
|
}
|
|
1003
|
-
const
|
|
1004
|
-
if (
|
|
1012
|
+
const pe = $(() => {
|
|
1013
|
+
if (m.value.length > 0)
|
|
1005
1014
|
return !0;
|
|
1006
1015
|
const a = U.parse(location.search.substring(1));
|
|
1007
|
-
if (a[
|
|
1016
|
+
if (a[u.value] > 1)
|
|
1008
1017
|
return !0;
|
|
1009
1018
|
const h = n.name === "default" ? "" : n.name + "_";
|
|
1010
|
-
let
|
|
1011
|
-
return
|
|
1012
|
-
const R = a[h +
|
|
1013
|
-
|
|
1014
|
-
}),
|
|
1019
|
+
let g = !1;
|
|
1020
|
+
return T(["filter", "columns", "cursor", "sort"], (b) => {
|
|
1021
|
+
const R = a[h + b];
|
|
1022
|
+
b === "sort" && R === t.value.defaultSort || R !== void 0 && (g = !0);
|
|
1023
|
+
}), g;
|
|
1015
1024
|
});
|
|
1016
|
-
function
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
}),
|
|
1020
|
-
|
|
1021
|
-
}),
|
|
1022
|
-
|
|
1023
|
-
}),
|
|
1025
|
+
function te() {
|
|
1026
|
+
m.value = [], T(r.value.filters, (a, c) => {
|
|
1027
|
+
r.value.filters[c].value = null;
|
|
1028
|
+
}), T(r.value.searchInputs, (a, c) => {
|
|
1029
|
+
r.value.searchInputs[c].value = null;
|
|
1030
|
+
}), T(r.value.columns, (a, c) => {
|
|
1031
|
+
r.value.columns[c].hidden = a.can_be_hidden ? !t.value.defaultVisibleToggleableColumns.includes(a.key) : !1;
|
|
1032
|
+
}), r.value.sort = null, r.value.cursor = null, r.value.page = 1;
|
|
1024
1033
|
}
|
|
1025
|
-
const
|
|
1034
|
+
const se = {};
|
|
1026
1035
|
function W(a, c) {
|
|
1027
|
-
clearTimeout(
|
|
1028
|
-
|
|
1029
|
-
const h =
|
|
1030
|
-
|
|
1036
|
+
clearTimeout(se[a]), se[a] = setTimeout(() => {
|
|
1037
|
+
H.value && n.preventOverlappingRequests && H.value.cancel();
|
|
1038
|
+
const h = I("searchInputs", a);
|
|
1039
|
+
r.value.searchInputs[h].value = c, r.value.cursor = null, r.value.page = 1;
|
|
1031
1040
|
}, n.inputDebounceMs);
|
|
1032
1041
|
}
|
|
1033
|
-
function
|
|
1042
|
+
function le(a) {
|
|
1034
1043
|
W("global", a);
|
|
1035
1044
|
}
|
|
1036
1045
|
function N(a, c) {
|
|
1037
|
-
const h =
|
|
1038
|
-
|
|
1046
|
+
const h = I("filters", a);
|
|
1047
|
+
r.value.filters[h].value = c, r.value.cursor = null, r.value.page = 1;
|
|
1039
1048
|
}
|
|
1040
|
-
function
|
|
1041
|
-
|
|
1049
|
+
function re(a) {
|
|
1050
|
+
r.value.cursor = null, r.value.perPage = a, r.value.page = 1;
|
|
1042
1051
|
}
|
|
1043
|
-
function
|
|
1044
|
-
return Te(
|
|
1052
|
+
function I(a, c) {
|
|
1053
|
+
return Te(r.value[a], (h) => h.key == c);
|
|
1045
1054
|
}
|
|
1046
|
-
function
|
|
1047
|
-
const h =
|
|
1048
|
-
|
|
1055
|
+
function ne(a, c) {
|
|
1056
|
+
const h = I("columns", a);
|
|
1057
|
+
r.value.columns[h].hidden = !c;
|
|
1049
1058
|
}
|
|
1050
1059
|
function ve() {
|
|
1051
1060
|
let a = {};
|
|
1052
|
-
return
|
|
1061
|
+
return T(r.value.searchInputs, (c) => {
|
|
1053
1062
|
c.value !== null && (a[c.key] = c.value);
|
|
1054
|
-
}),
|
|
1063
|
+
}), T(r.value.filters, (c) => {
|
|
1055
1064
|
c.value !== null && (a[c.key] = c.value);
|
|
1056
1065
|
}), a;
|
|
1057
1066
|
}
|
|
1058
|
-
function
|
|
1059
|
-
const a =
|
|
1060
|
-
let c = je(a, (
|
|
1061
|
-
return Le(h,
|
|
1067
|
+
function ge() {
|
|
1068
|
+
const a = r.value.columns;
|
|
1069
|
+
let c = je(a, (g) => !g.hidden), h = Ve(c, (g) => g.key).sort();
|
|
1070
|
+
return Le(h, t.value.defaultVisibleToggleableColumns) ? {} : h;
|
|
1062
1071
|
}
|
|
1063
|
-
function
|
|
1064
|
-
const a = ve(), c =
|
|
1072
|
+
function me() {
|
|
1073
|
+
const a = ve(), c = ge(), h = {};
|
|
1065
1074
|
Object.keys(a).length > 0 && (h.filter = a), Object.keys(c).length > 0 && (h.columns = c);
|
|
1066
|
-
const
|
|
1067
|
-
return
|
|
1075
|
+
const g = r.value.cursor, b = r.value.page, R = r.value.sort, ie = r.value.perPage;
|
|
1076
|
+
return g && (h.cursor = g), b > 1 && (h.page = b), ie > 1 && (h.perPage = ie), R && (h.sort = R), h;
|
|
1068
1077
|
}
|
|
1069
|
-
function
|
|
1078
|
+
function be() {
|
|
1070
1079
|
const a = U.parse(location.search.substring(1)), c = n.name === "default" ? "" : n.name + "_";
|
|
1071
|
-
|
|
1072
|
-
delete a[c +
|
|
1073
|
-
}), delete a[
|
|
1074
|
-
|
|
1080
|
+
T(["filter", "columns", "cursor", "sort"], (g) => {
|
|
1081
|
+
delete a[c + g];
|
|
1082
|
+
}), delete a[u.value], T(me(), (g, b) => {
|
|
1083
|
+
b === "page" ? a[u.value] = g : b === "perPage" ? a.perPage = g : a[c + b] = g;
|
|
1075
1084
|
});
|
|
1076
1085
|
let h = U.stringify(a, {
|
|
1077
|
-
filter(
|
|
1078
|
-
return typeof
|
|
1086
|
+
filter(g, b) {
|
|
1087
|
+
return typeof b == "object" && b !== null ? Me(b) : b;
|
|
1079
1088
|
},
|
|
1080
1089
|
skipNulls: !0,
|
|
1081
1090
|
strictNullHandling: !0
|
|
1082
1091
|
});
|
|
1083
|
-
return (!h || h ===
|
|
1092
|
+
return (!h || h === u.value + "=1") && (h = ""), h;
|
|
1084
1093
|
}
|
|
1085
|
-
const
|
|
1094
|
+
const G = S(!1), H = S(null);
|
|
1086
1095
|
function K(a) {
|
|
1087
|
-
!a ||
|
|
1096
|
+
!a || Pe.get(
|
|
1088
1097
|
a,
|
|
1089
1098
|
{},
|
|
1090
1099
|
{
|
|
@@ -1092,202 +1101,204 @@ const ms = /* @__PURE__ */ cs(ds, [["render", vs]]), bs = ["dusk"], ys = { class
|
|
|
1092
1101
|
preserveState: !0,
|
|
1093
1102
|
preserveScroll: n.preserveScroll !== !1,
|
|
1094
1103
|
onBefore() {
|
|
1095
|
-
|
|
1104
|
+
G.value = !0;
|
|
1096
1105
|
},
|
|
1097
1106
|
onCancelToken(c) {
|
|
1098
|
-
|
|
1107
|
+
H.value = c;
|
|
1099
1108
|
},
|
|
1100
1109
|
onFinish() {
|
|
1101
|
-
|
|
1110
|
+
G.value = !1;
|
|
1102
1111
|
},
|
|
1103
1112
|
onSuccess() {
|
|
1104
|
-
if ("queryBuilderProps" in d.
|
|
1105
|
-
const h =
|
|
1113
|
+
if ("queryBuilderProps" in d.props && (r.value.cursor = t.value.cursor, r.value.page = t.value.page), n.preserveScroll === "table-top") {
|
|
1114
|
+
const h = O.value.getBoundingClientRect().top + window.pageYOffset + -8;
|
|
1106
1115
|
window.scrollTo({ top: h });
|
|
1107
1116
|
}
|
|
1108
|
-
|
|
1117
|
+
f.value++;
|
|
1109
1118
|
}
|
|
1110
1119
|
}
|
|
1111
1120
|
);
|
|
1112
1121
|
}
|
|
1113
|
-
J(
|
|
1114
|
-
K(location.pathname + "?" +
|
|
1122
|
+
J(r, () => {
|
|
1123
|
+
K(location.pathname + "?" + be());
|
|
1115
1124
|
}, { deep: !0 });
|
|
1116
|
-
const
|
|
1117
|
-
|
|
1125
|
+
const ae = () => {
|
|
1126
|
+
f.value++;
|
|
1118
1127
|
};
|
|
1119
1128
|
Y(() => {
|
|
1120
|
-
document.addEventListener("
|
|
1121
|
-
}),
|
|
1122
|
-
document.removeEventListener("
|
|
1129
|
+
document.addEventListener("success", ae);
|
|
1130
|
+
}), ke(() => {
|
|
1131
|
+
document.removeEventListener("success", ae);
|
|
1123
1132
|
});
|
|
1124
|
-
function
|
|
1125
|
-
|
|
1133
|
+
function oe(a) {
|
|
1134
|
+
r.value.sort == a ? r.value.sort = `-${a}` : r.value.sort = a, r.value.cursor = null, r.value.page = 1;
|
|
1126
1135
|
}
|
|
1127
1136
|
function Q(a) {
|
|
1128
|
-
const c =
|
|
1129
|
-
return !
|
|
1137
|
+
const c = I("columns", a);
|
|
1138
|
+
return !r.value.columns[c].hidden;
|
|
1130
1139
|
}
|
|
1131
1140
|
function ue(a) {
|
|
1132
|
-
const c =
|
|
1133
|
-
return h.onSort =
|
|
1141
|
+
const c = I("columns", a), h = Oe(t.value.columns[c]);
|
|
1142
|
+
return h.onSort = oe, h;
|
|
1134
1143
|
}
|
|
1135
|
-
return (a, c) => (o(),
|
|
1136
|
-
default:
|
|
1137
|
-
(o(),
|
|
1144
|
+
return (a, c) => (o(), _(_e, null, {
|
|
1145
|
+
default: C(() => [
|
|
1146
|
+
(o(), i("fieldset", {
|
|
1138
1147
|
ref_key: "tableFieldset",
|
|
1139
|
-
ref:
|
|
1140
|
-
key: `table-${
|
|
1141
|
-
dusk: `table-${
|
|
1142
|
-
class:
|
|
1148
|
+
ref: O,
|
|
1149
|
+
key: `table-${s.name}`,
|
|
1150
|
+
dusk: `table-${s.name}`,
|
|
1151
|
+
class: k(["min-w-0", { "opacity-75": G.value }])
|
|
1143
1152
|
}, [
|
|
1144
|
-
|
|
1145
|
-
e(
|
|
1146
|
-
|
|
1147
|
-
hasFilters: e(
|
|
1148
|
-
hasEnabledFilters: e(
|
|
1149
|
-
filters: e(
|
|
1153
|
+
l("div", ys, [
|
|
1154
|
+
e(t).hasFilters ? (o(), i("div", ws, [
|
|
1155
|
+
w(a.$slots, "tableFilter", {
|
|
1156
|
+
hasFilters: e(t).hasFilters,
|
|
1157
|
+
hasEnabledFilters: e(t).hasEnabledFilters,
|
|
1158
|
+
filters: e(t).filters,
|
|
1150
1159
|
onFilterChange: N
|
|
1151
1160
|
}, () => [
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
filters: e(
|
|
1161
|
+
e(L) ? (o(), _(Vt, {
|
|
1162
|
+
key: 0,
|
|
1163
|
+
"has-enabled-filters": e(t).hasEnabledFilters,
|
|
1164
|
+
filters: e(t).filters,
|
|
1155
1165
|
"on-filter-change": N
|
|
1156
|
-
}, null, 8, ["has-enabled-filters", "filters"])
|
|
1166
|
+
}, null, 8, ["has-enabled-filters", "filters"])) : x("", !0)
|
|
1157
1167
|
])
|
|
1158
1168
|
])) : x("", !0),
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
hasGlobalSearch: e(
|
|
1162
|
-
label: e(
|
|
1163
|
-
value: e(
|
|
1164
|
-
onChange:
|
|
1169
|
+
l("div", xs, [
|
|
1170
|
+
w(a.$slots, "tableGlobalSearch", {
|
|
1171
|
+
hasGlobalSearch: e(t).globalSearch,
|
|
1172
|
+
label: e(t).globalSearch ? e(t).globalSearch.label : null,
|
|
1173
|
+
value: e(t).globalSearch ? e(t).globalSearch.value : null,
|
|
1174
|
+
onChange: le
|
|
1165
1175
|
}, () => [
|
|
1166
|
-
e(
|
|
1176
|
+
s.showGlobalSearch && e(t).globalSearch && e(L) ? (o(), _(Ut, {
|
|
1167
1177
|
key: 0,
|
|
1168
1178
|
class: "flex-grow",
|
|
1169
|
-
label: e(
|
|
1170
|
-
value: e(
|
|
1171
|
-
"on-change":
|
|
1179
|
+
label: e(t).globalSearch.label,
|
|
1180
|
+
value: e(t).globalSearch.value,
|
|
1181
|
+
"on-change": le
|
|
1172
1182
|
}, null, 8, ["label", "value"])) : x("", !0)
|
|
1173
1183
|
])
|
|
1174
|
-
])
|
|
1175
|
-
|
|
1184
|
+
]),
|
|
1185
|
+
w(a.$slots, "tableReset", {
|
|
1176
1186
|
canBeReset: "canBeReset",
|
|
1177
|
-
onClick:
|
|
1187
|
+
onClick: te
|
|
1178
1188
|
}, () => [
|
|
1179
|
-
e(
|
|
1180
|
-
|
|
1189
|
+
e(pe) ? (o(), i("div", ks, [
|
|
1190
|
+
D(is, { "on-click": te })
|
|
1181
1191
|
])) : x("", !0)
|
|
1182
1192
|
]),
|
|
1183
|
-
|
|
1184
|
-
hasSearchInputs: e(
|
|
1185
|
-
hasSearchInputsWithoutValue: e(
|
|
1186
|
-
searchInputs: e(
|
|
1187
|
-
onAdd:
|
|
1193
|
+
w(a.$slots, "tableAddSearchRow", {
|
|
1194
|
+
hasSearchInputs: e(t).hasSearchInputs,
|
|
1195
|
+
hasSearchInputsWithoutValue: e(t).hasSearchInputsWithoutValue,
|
|
1196
|
+
searchInputs: e(t).searchInputsWithoutGlobal,
|
|
1197
|
+
onAdd: ee
|
|
1188
1198
|
}, () => [
|
|
1189
|
-
e(
|
|
1199
|
+
s.showGlobalSearch && e(t).hasSearchInputs && e(L) ? (o(), _(mt, {
|
|
1190
1200
|
key: 0,
|
|
1191
1201
|
class: "order-3 sm:order-4",
|
|
1192
|
-
"search-inputs": e(
|
|
1193
|
-
"has-search-inputs-without-value": e(
|
|
1194
|
-
"on-add":
|
|
1202
|
+
"search-inputs": e(t).searchInputsWithoutGlobal,
|
|
1203
|
+
"has-search-inputs-without-value": e(t).hasSearchInputsWithoutValue,
|
|
1204
|
+
"on-add": ee
|
|
1195
1205
|
}, null, 8, ["search-inputs", "has-search-inputs-without-value"])) : x("", !0)
|
|
1196
1206
|
]),
|
|
1197
|
-
|
|
1198
|
-
hasColumns: e(
|
|
1199
|
-
columns: e(
|
|
1200
|
-
hasHiddenColumns: e(
|
|
1201
|
-
onChange:
|
|
1207
|
+
w(a.$slots, "tableColumns", {
|
|
1208
|
+
hasColumns: e(t).hasToggleableColumns,
|
|
1209
|
+
columns: e(t).columns,
|
|
1210
|
+
hasHiddenColumns: e(t).hasHiddenColumns,
|
|
1211
|
+
onChange: ne
|
|
1202
1212
|
}, () => [
|
|
1203
|
-
e(
|
|
1213
|
+
e(t).hasToggleableColumns ? (o(), _(qt, {
|
|
1204
1214
|
key: 0,
|
|
1205
1215
|
class: "order-4 sm:order-5",
|
|
1206
|
-
columns: e(
|
|
1207
|
-
"has-hidden-columns": e(
|
|
1208
|
-
"on-change":
|
|
1216
|
+
columns: e(t).columns,
|
|
1217
|
+
"has-hidden-columns": e(t).hasHiddenColumns,
|
|
1218
|
+
"on-change": ne
|
|
1209
1219
|
}, null, 8, ["columns", "has-hidden-columns"])) : x("", !0)
|
|
1210
1220
|
])
|
|
1211
1221
|
]),
|
|
1212
|
-
|
|
1213
|
-
hasSearchRowsWithValue: e(
|
|
1214
|
-
searchInputs: e(
|
|
1215
|
-
forcedVisibleSearchInputs:
|
|
1222
|
+
w(a.$slots, "tableSearchRows", {
|
|
1223
|
+
hasSearchRowsWithValue: e(t).hasSearchInputsWithValue,
|
|
1224
|
+
searchInputs: e(t).searchInputsWithoutGlobal,
|
|
1225
|
+
forcedVisibleSearchInputs: m.value,
|
|
1216
1226
|
onChange: W
|
|
1217
1227
|
}, () => [
|
|
1218
|
-
e(
|
|
1228
|
+
e(t).hasSearchInputsWithValue || m.value.length > 0 ? (o(), _(ns, {
|
|
1219
1229
|
key: 0,
|
|
1220
|
-
"search-inputs": e(
|
|
1221
|
-
"forced-visible-search-inputs":
|
|
1230
|
+
"search-inputs": e(t).searchInputsWithoutGlobal,
|
|
1231
|
+
"forced-visible-search-inputs": m.value,
|
|
1222
1232
|
"on-change": W,
|
|
1223
|
-
"on-remove":
|
|
1233
|
+
"on-remove": fe
|
|
1224
1234
|
}, null, 8, ["search-inputs", "forced-visible-search-inputs"])) : x("", !0)
|
|
1225
1235
|
]),
|
|
1226
|
-
e(
|
|
1236
|
+
e(t).hasEnabledFilters ? (o(), _(Gt, {
|
|
1227
1237
|
key: 0,
|
|
1228
|
-
filters: e(
|
|
1238
|
+
filters: e(t).filters,
|
|
1229
1239
|
"on-filter-change": N
|
|
1230
1240
|
}, null, 8, ["filters"])) : x("", !0),
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
class:
|
|
1241
|
+
w(a.$slots, "tableWrapper", { meta: e(V) }, () => [
|
|
1242
|
+
D(ms, {
|
|
1243
|
+
class: k({ "mt-3": !e(q) })
|
|
1234
1244
|
}, {
|
|
1235
|
-
default:
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1245
|
+
default: C(() => [
|
|
1246
|
+
w(a.$slots, "table", {}, () => [
|
|
1247
|
+
l("table", _s, [
|
|
1248
|
+
l("thead", $s, [
|
|
1249
|
+
w(a.$slots, "head", {
|
|
1240
1250
|
show: Q,
|
|
1241
|
-
sortBy:
|
|
1251
|
+
sortBy: oe,
|
|
1242
1252
|
header: ue
|
|
1243
1253
|
}, () => [
|
|
1244
|
-
|
|
1245
|
-
(o(!0),
|
|
1246
|
-
key: `table-${
|
|
1254
|
+
l("tr", Cs, [
|
|
1255
|
+
(o(!0), i(B, null, P(e(t).columns, (h) => (o(), _(Ke, {
|
|
1256
|
+
key: `table-${s.name}-header-${h.key}`,
|
|
1247
1257
|
cell: ue(h.key)
|
|
1248
1258
|
}, null, 8, ["cell"]))), 128))
|
|
1249
1259
|
])
|
|
1250
1260
|
])
|
|
1251
1261
|
]),
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
(o(!0),
|
|
1255
|
-
key: `table-${
|
|
1256
|
-
class:
|
|
1257
|
-
"bg-gray-50":
|
|
1258
|
-
"hover:bg-gray-100":
|
|
1259
|
-
"hover:bg-gray-50": !
|
|
1262
|
+
l("tbody", Ss, [
|
|
1263
|
+
w(a.$slots, "body", { show: Q }, () => [
|
|
1264
|
+
(o(!0), i(B, null, P(e(y), (h, g) => (o(), i("tr", {
|
|
1265
|
+
key: `table-${s.name}-row-${g}`,
|
|
1266
|
+
class: k(["", {
|
|
1267
|
+
"bg-gray-50": s.striped && g % 2,
|
|
1268
|
+
"hover:bg-gray-100": s.striped,
|
|
1269
|
+
"hover:bg-gray-50": !s.striped
|
|
1260
1270
|
}]),
|
|
1261
|
-
onClick: (
|
|
1271
|
+
onClick: (b) => he(h, g)
|
|
1262
1272
|
}, [
|
|
1263
|
-
(o(!0),
|
|
1264
|
-
key: `table-${
|
|
1273
|
+
(o(!0), i(B, null, P(e(t).columns, (b) => E((o(), i("td", {
|
|
1274
|
+
key: `table-${s.name}-row-${g}-column-${b.key}`,
|
|
1265
1275
|
class: "px-6 py-4 text-sm text-gray-500 whitespace-nowrap"
|
|
1266
1276
|
}, [
|
|
1267
|
-
|
|
1268
|
-
|
|
1277
|
+
w(a.$slots, `cell(${b.key})`, { item: h }, () => [
|
|
1278
|
+
j(v(h[b.key]), 1)
|
|
1269
1279
|
])
|
|
1270
1280
|
])), [
|
|
1271
|
-
[
|
|
1281
|
+
[A, Q(b.key)]
|
|
1272
1282
|
])), 128))
|
|
1273
1283
|
], 10, qs))), 128))
|
|
1274
|
-
])
|
|
1284
|
+
]),
|
|
1285
|
+
e(L) ? x("", !0) : (o(), i("tr", Fs, Ps))
|
|
1275
1286
|
])
|
|
1276
1287
|
])
|
|
1277
1288
|
]),
|
|
1278
|
-
|
|
1289
|
+
w(a.$slots, "pagination", {
|
|
1279
1290
|
onClick: K,
|
|
1280
|
-
hasData: e(
|
|
1281
|
-
meta: e(
|
|
1282
|
-
perPageOptions: e(
|
|
1283
|
-
onPerPageChange:
|
|
1291
|
+
hasData: e(L),
|
|
1292
|
+
meta: e(V),
|
|
1293
|
+
perPageOptions: e(t).perPageOptions,
|
|
1294
|
+
onPerPageChange: re
|
|
1284
1295
|
}, () => [
|
|
1285
|
-
|
|
1296
|
+
D(ft, {
|
|
1286
1297
|
"on-click": K,
|
|
1287
|
-
"has-data": e(
|
|
1288
|
-
meta: e(
|
|
1289
|
-
"per-page-options": e(
|
|
1290
|
-
"on-per-page-change":
|
|
1298
|
+
"has-data": e(L),
|
|
1299
|
+
meta: e(V),
|
|
1300
|
+
"per-page-options": e(t).perPageOptions,
|
|
1301
|
+
"on-per-page-change": re
|
|
1291
1302
|
}, null, 8, ["has-data", "meta", "per-page-options"])
|
|
1292
1303
|
])
|
|
1293
1304
|
]),
|
|
@@ -1303,17 +1314,17 @@ const ms = /* @__PURE__ */ cs(ds, [["render", vs]]), bs = ["dusk"], ys = { class
|
|
|
1303
1314
|
export {
|
|
1304
1315
|
X as ButtonWithDropdown,
|
|
1305
1316
|
Ke as HeaderCell,
|
|
1306
|
-
|
|
1317
|
+
ze as OnClickOutside,
|
|
1307
1318
|
ft as Pagination,
|
|
1308
|
-
|
|
1319
|
+
Qs as Table,
|
|
1309
1320
|
mt as TableAddSearchRow,
|
|
1310
1321
|
qt as TableColumns,
|
|
1311
1322
|
Vt as TableFilter,
|
|
1312
1323
|
Ut as TableGlobalSearch,
|
|
1313
|
-
|
|
1324
|
+
is as TableReset,
|
|
1314
1325
|
ns as TableSearchRows,
|
|
1315
1326
|
ms as TableWrapper,
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1327
|
+
de as getTranslations,
|
|
1328
|
+
Hs as setTranslation,
|
|
1329
|
+
Ks as setTranslations
|
|
1319
1330
|
};
|