@oneb/ui-vue 0.3.15 → 0.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/composables/useMediaQuery.d.ts +5 -0
- package/dist/dataTable/dataTable.d.ts +10 -0
- package/dist/dataTable/index.cjs +1 -1
- package/dist/dataTable/index.d.ts +1 -1
- package/dist/dataTable/index.js +524 -324
- package/dist/dataTable/util.d.ts +2 -0
- package/dist/i18n/index.cjs +1 -1
- package/dist/i18n/index.js +1 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/dataTable/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { openBlock as l, createElementBlock as
|
|
2
|
-
import { useOnebI18n as
|
|
3
|
-
import { a as
|
|
4
|
-
import { S as
|
|
5
|
-
import { r as
|
|
6
|
-
import { r as
|
|
7
|
-
import { _ as
|
|
1
|
+
import { openBlock as l, createElementBlock as o, createElementVNode as c, ref as E, onMounted as Xe, toValue as _e, watch as Q, onBeforeUnmount as Fe, defineComponent as fe, computed as y, normalizeClass as b, toDisplayString as k, Fragment as _, renderList as L, unref as p, createCommentVNode as g, createBlock as v, resolveDynamicComponent as w, useSlots as $e, provide as Ye, withDirectives as Ze, renderSlot as B, vShow as Ie, normalizeStyle as ae, createTextVNode as W, withModifiers as U, createVNode as Se, inject as De } from "vue";
|
|
2
|
+
import { useOnebI18n as Pe } from "../i18n/index.js";
|
|
3
|
+
import { a as pe, r as et } from "../ChevronRightIcon-4549a26b.js";
|
|
4
|
+
import { S as I } from "../SpinnerIcon-74648c98.js";
|
|
5
|
+
import { r as ne } from "../ChevronDownIcon-6805ce6c.js";
|
|
6
|
+
import { r as D } from "../CheckIcon-f1c94824.js";
|
|
7
|
+
import { _ as tt } from "../_plugin-vue_export-helper-dad06003.js";
|
|
8
8
|
import "../SpinnerIcon.vue_vue_type_style_index_0_lang-4ed993c7.js";
|
|
9
|
-
function
|
|
10
|
-
return l(),
|
|
9
|
+
function st(d, n) {
|
|
10
|
+
return l(), o("svg", {
|
|
11
11
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12
12
|
fill: "none",
|
|
13
13
|
viewBox: "0 0 24 24",
|
|
@@ -22,8 +22,8 @@ function He(d, a) {
|
|
|
22
22
|
})
|
|
23
23
|
]);
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
return l(),
|
|
25
|
+
function Re(d, n) {
|
|
26
|
+
return l(), o("svg", {
|
|
27
27
|
xmlns: "http://www.w3.org/2000/svg",
|
|
28
28
|
fill: "none",
|
|
29
29
|
viewBox: "0 0 24 24",
|
|
@@ -38,7 +38,7 @@ function be(d, a) {
|
|
|
38
38
|
})
|
|
39
39
|
]);
|
|
40
40
|
}
|
|
41
|
-
const
|
|
41
|
+
const rt = {
|
|
42
42
|
field: {
|
|
43
43
|
type: String,
|
|
44
44
|
required: !1
|
|
@@ -86,8 +86,12 @@ const Ge = {
|
|
|
86
86
|
bodyStyle: {
|
|
87
87
|
type: [String, Object],
|
|
88
88
|
required: !1
|
|
89
|
+
},
|
|
90
|
+
visibleFrom: {
|
|
91
|
+
type: String,
|
|
92
|
+
required: !1
|
|
89
93
|
}
|
|
90
|
-
},
|
|
94
|
+
}, lt = {
|
|
91
95
|
value: {
|
|
92
96
|
type: Array,
|
|
93
97
|
default: () => []
|
|
@@ -215,23 +219,58 @@ const Ge = {
|
|
|
215
219
|
wrapperBordered: {
|
|
216
220
|
type: Boolean,
|
|
217
221
|
default: !0
|
|
222
|
+
},
|
|
223
|
+
cardBreakpoint: {
|
|
224
|
+
type: String,
|
|
225
|
+
required: !1
|
|
218
226
|
}
|
|
219
|
-
},
|
|
220
|
-
contains: (d,
|
|
221
|
-
startsWith: (d,
|
|
222
|
-
endsWith: (d,
|
|
223
|
-
equals: (d,
|
|
224
|
-
notEquals: (d,
|
|
225
|
-
},
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}
|
|
227
|
+
}, Le = Symbol("OneDataTable"), Be = {
|
|
228
|
+
contains: (d, n) => String(d ?? "").toLowerCase().includes(String(n).toLowerCase()),
|
|
229
|
+
startsWith: (d, n) => String(d ?? "").toLowerCase().startsWith(String(n).toLowerCase()),
|
|
230
|
+
endsWith: (d, n) => String(d ?? "").toLowerCase().endsWith(String(n).toLowerCase()),
|
|
231
|
+
equals: (d, n) => String(d ?? "").toLowerCase() === String(n).toLowerCase(),
|
|
232
|
+
notEquals: (d, n) => String(d ?? "").toLowerCase() !== String(n).toLowerCase()
|
|
233
|
+
}, ot = {
|
|
234
|
+
sm: 640,
|
|
235
|
+
md: 768,
|
|
236
|
+
lg: 1024,
|
|
237
|
+
xl: 1280,
|
|
238
|
+
"2xl": 1536
|
|
239
|
+
};
|
|
240
|
+
function at(d) {
|
|
241
|
+
const n = E(!1);
|
|
242
|
+
let t = null, i = null;
|
|
243
|
+
const h = () => {
|
|
244
|
+
t && i && t.removeEventListener("change", i), t = null, i = null;
|
|
245
|
+
}, f = (S) => {
|
|
246
|
+
h(), !(typeof window > "u") && (t = window.matchMedia(S), n.value = t.matches, i = (H) => {
|
|
247
|
+
n.value = H.matches;
|
|
248
|
+
}, t.addEventListener("change", i));
|
|
249
|
+
};
|
|
250
|
+
return Xe(() => {
|
|
251
|
+
f(_e(d)), Q(
|
|
252
|
+
() => _e(d),
|
|
253
|
+
(S) => {
|
|
254
|
+
f(S);
|
|
255
|
+
}
|
|
256
|
+
);
|
|
257
|
+
}), Fe(() => {
|
|
258
|
+
h();
|
|
259
|
+
}), n;
|
|
260
|
+
}
|
|
261
|
+
function z(d) {
|
|
262
|
+
return at(`(min-width: ${ot[d]}px)`);
|
|
263
|
+
}
|
|
264
|
+
const nt = (d = !0) => {
|
|
265
|
+
const n = ["overflow-x-auto", "w-full"];
|
|
266
|
+
return d && n.push("border", "border-gray-100", "rounded"), n;
|
|
267
|
+
}, it = (d) => {
|
|
268
|
+
const n = ["min-w-full", "text-left", "relative"];
|
|
269
|
+
return d === "sm" ? n.push("text-xs") : d === "lg" ? n.push("text-base") : n.push("text-sm"), n;
|
|
270
|
+
}, ie = (d, n, t = "none", i = "default", h) => {
|
|
232
271
|
const f = [];
|
|
233
|
-
return
|
|
234
|
-
|
|
272
|
+
return i === "minimal" ? f.push(
|
|
273
|
+
h || "bg-gray-50",
|
|
235
274
|
"text-gray-700",
|
|
236
275
|
"font-medium",
|
|
237
276
|
"text-sm",
|
|
@@ -239,7 +278,7 @@ const Ge = {
|
|
|
239
278
|
"border-b",
|
|
240
279
|
"border-gray-200"
|
|
241
280
|
) : f.push(
|
|
242
|
-
|
|
281
|
+
h || "bg-gray-100",
|
|
243
282
|
"text-gray-600",
|
|
244
283
|
"font-semibold",
|
|
245
284
|
"text-xs",
|
|
@@ -248,20 +287,20 @@ const Ge = {
|
|
|
248
287
|
"border-b",
|
|
249
288
|
"border-gray-200",
|
|
250
289
|
"whitespace-nowrap"
|
|
251
|
-
),
|
|
252
|
-
},
|
|
253
|
-
const
|
|
254
|
-
return
|
|
255
|
-
},
|
|
290
|
+
), n && f.push("cursor-pointer", "select-none", "hover:text-primary-base", "transition-colors"), t === "always" ? f.push("border-r", "border-r-gray-200", "last:border-r-0") : (t === "hover" || t === "hover-table") && f.push("border-r", "border-r-transparent", "last:border-r-0"), d === "sm" ? f.push("px-1.5", "py-1") : d === "lg" ? f.push("px-4", "py-3") : f.push("p-2"), f;
|
|
291
|
+
}, de = (d, n, t = "none", i) => {
|
|
292
|
+
const h = ["border-b", "border-gray-100", "text-gray-900"];
|
|
293
|
+
return i && h.push(i), n && h.push("border-r"), t === "always" ? h.push("border-r", "border-r-gray-200", "last:border-r-0") : (t === "hover" || t === "hover-table") && h.push("border-r", "border-r-transparent", "last:border-r-0"), d === "sm" ? h.push("px-1.5", "py-1") : d === "lg" ? h.push("px-4", "py-3") : h.push("px-2", "py-1.5"), h;
|
|
294
|
+
}, dt = (d, n, t, i, h = !1) => {
|
|
256
295
|
const f = [];
|
|
257
|
-
return
|
|
258
|
-
},
|
|
259
|
-
const
|
|
260
|
-
return d ?
|
|
261
|
-
},
|
|
262
|
-
const
|
|
263
|
-
return d === "sm" ?
|
|
264
|
-
},
|
|
296
|
+
return h && f.push("group"), i ? f.push("bg-primary-25") : d && t && f.push("bg-gray-50"), n && (i ? f.push("hover:bg-primary-25-hover", "transition-colors") : f.push("hover:bg-gray-50", "transition-colors")), f;
|
|
297
|
+
}, ee = (d) => {
|
|
298
|
+
const n = ["w-3.5", "h-3.5", "inline-block", "ml-1"];
|
|
299
|
+
return d ? n.push("text-primary-base") : n.push("text-gray-400"), n.push("transition-transform", "duration-200"), n;
|
|
300
|
+
}, ce = (d) => {
|
|
301
|
+
const n = ["text-center"];
|
|
302
|
+
return d === "sm" ? n.push("w-8") : d === "lg" ? n.push("w-14") : n.push("w-12"), n;
|
|
303
|
+
}, Me = (d) => ce(d), ut = () => [
|
|
265
304
|
"flex",
|
|
266
305
|
"items-center",
|
|
267
306
|
"justify-between",
|
|
@@ -271,10 +310,16 @@ const Ge = {
|
|
|
271
310
|
"border-gray-100",
|
|
272
311
|
"bg-white",
|
|
273
312
|
"text-sm"
|
|
274
|
-
],
|
|
275
|
-
const
|
|
276
|
-
return
|
|
277
|
-
},
|
|
313
|
+
], pt = (d, n) => {
|
|
314
|
+
const t = ["rounded", "border", "p-3"];
|
|
315
|
+
return n ? t.push("bg-primary-25", "border-primary-base/20") : t.push("bg-white", "border-gray-100"), d && (n ? t.push("hover:bg-primary-25-hover", "transition-colors") : t.push("hover:bg-gray-50", "transition-colors")), t;
|
|
316
|
+
}, ct = (d) => {
|
|
317
|
+
const n = ["flex", "items-start", "justify-between", "gap-2"];
|
|
318
|
+
return d === "sm" ? n.push("py-0.5") : d === "lg" ? n.push("py-2") : n.push("py-1"), n;
|
|
319
|
+
}, ue = (d) => {
|
|
320
|
+
const n = ["bg-gray-100", "border-b", "border-gray-200"];
|
|
321
|
+
return d === "sm" ? n.push("px-1.5", "py-1") : d === "lg" ? n.push("px-4", "py-2") : n.push("px-2", "py-1.5"), n;
|
|
322
|
+
}, ft = { class: "flex items-center gap-4" }, yt = { class: "text-gray-600" }, gt = ["value"], ht = ["value"], bt = { class: "flex items-center gap-1" }, vt = ["disabled"], mt = { class: "px-2 text-gray-600" }, kt = ["disabled"], wt = /* @__PURE__ */ fe({
|
|
278
323
|
__name: "OneDataTablePaginator",
|
|
279
324
|
props: {
|
|
280
325
|
first: {
|
|
@@ -295,93 +340,129 @@ const Ge = {
|
|
|
295
340
|
}
|
|
296
341
|
},
|
|
297
342
|
emits: ["update:first", "update:rows", "page"],
|
|
298
|
-
setup(d, { emit:
|
|
299
|
-
const t = d,
|
|
300
|
-
|
|
301
|
-
first:
|
|
343
|
+
setup(d, { emit: n }) {
|
|
344
|
+
const t = d, i = n, h = Pe(), f = y(() => Math.ceil(t.totalRecords / t.rows)), S = y(() => Math.floor(t.first / t.rows) + 1), H = y(() => t.totalRecords === 0 ? 0 : t.first + 1), ye = y(() => Math.min(t.first + t.rows, t.totalRecords)), F = y(() => t.first === 0), V = y(() => t.first + t.rows >= t.totalRecords), A = y(() => ut()), j = (C) => {
|
|
345
|
+
C < 0 || C >= t.totalRecords || (i("update:first", C), i("page", {
|
|
346
|
+
first: C,
|
|
302
347
|
rows: t.rows,
|
|
303
|
-
page: Math.floor(
|
|
348
|
+
page: Math.floor(C / t.rows),
|
|
304
349
|
pageCount: f.value
|
|
305
350
|
}));
|
|
306
|
-
},
|
|
307
|
-
|
|
308
|
-
},
|
|
309
|
-
|
|
310
|
-
},
|
|
311
|
-
const
|
|
312
|
-
|
|
351
|
+
}, G = () => {
|
|
352
|
+
j(Math.max(0, t.first - t.rows));
|
|
353
|
+
}, J = () => {
|
|
354
|
+
j(t.first + t.rows);
|
|
355
|
+
}, O = (C) => {
|
|
356
|
+
const x = parseInt(C.target.value);
|
|
357
|
+
i("update:rows", x), i("update:first", 0), i("page", {
|
|
313
358
|
first: 0,
|
|
314
|
-
rows:
|
|
359
|
+
rows: x,
|
|
315
360
|
page: 0,
|
|
316
|
-
pageCount: Math.ceil(t.totalRecords /
|
|
361
|
+
pageCount: Math.ceil(t.totalRecords / x)
|
|
317
362
|
});
|
|
318
363
|
};
|
|
319
|
-
return (
|
|
320
|
-
class: b(
|
|
364
|
+
return (C, x) => (l(), o("div", {
|
|
365
|
+
class: b(A.value)
|
|
321
366
|
}, [
|
|
322
|
-
c("div",
|
|
323
|
-
c("span",
|
|
324
|
-
d.rowsPerPageOptions.length > 1 ? (l(),
|
|
367
|
+
c("div", ft, [
|
|
368
|
+
c("span", yt, k(H.value) + "–" + k(ye.value) + " of " + k(d.totalRecords), 1),
|
|
369
|
+
d.rowsPerPageOptions.length > 1 ? (l(), o("select", {
|
|
325
370
|
key: 0,
|
|
326
371
|
value: d.rows,
|
|
327
372
|
class: "border border-gray-300 rounded px-2 py-1 text-sm bg-white focus:outline-none focus:ring-1 focus:ring-primary-glow",
|
|
328
|
-
onChange:
|
|
373
|
+
onChange: O
|
|
329
374
|
}, [
|
|
330
|
-
(l(!0),
|
|
331
|
-
key:
|
|
332
|
-
value:
|
|
333
|
-
},
|
|
334
|
-
], 40,
|
|
375
|
+
(l(!0), o(_, null, L(d.rowsPerPageOptions, (T) => (l(), o("option", {
|
|
376
|
+
key: T,
|
|
377
|
+
value: T
|
|
378
|
+
}, k(p(h)("ui.dataTable.perPage", { count: T })), 9, ht))), 128))
|
|
379
|
+
], 40, gt)) : g("", !0)
|
|
335
380
|
]),
|
|
336
|
-
c("div",
|
|
381
|
+
c("div", bt, [
|
|
337
382
|
c("button", {
|
|
338
|
-
disabled:
|
|
383
|
+
disabled: F.value,
|
|
339
384
|
class: "p-1.5 rounded hover:bg-gray-100 disabled:opacity-30 disabled:cursor-default transition-colors",
|
|
340
|
-
onClick:
|
|
385
|
+
onClick: G
|
|
341
386
|
}, [
|
|
342
|
-
(l(),
|
|
343
|
-
], 8,
|
|
344
|
-
c("span",
|
|
387
|
+
(l(), v(w(p(st)), { class: "w-4 h-4 text-gray-600" }))
|
|
388
|
+
], 8, vt),
|
|
389
|
+
c("span", mt, k(S.value) + " / " + k(f.value), 1),
|
|
345
390
|
c("button", {
|
|
346
|
-
disabled:
|
|
391
|
+
disabled: V.value,
|
|
347
392
|
class: "p-1.5 rounded hover:bg-gray-100 disabled:opacity-30 disabled:cursor-default transition-colors",
|
|
348
|
-
onClick:
|
|
393
|
+
onClick: J
|
|
349
394
|
}, [
|
|
350
|
-
(l(),
|
|
351
|
-
], 8,
|
|
395
|
+
(l(), v(w(p(pe)), { class: "w-4 h-4 text-gray-600" }))
|
|
396
|
+
], 8, kt)
|
|
352
397
|
])
|
|
353
398
|
], 2));
|
|
354
399
|
}
|
|
355
|
-
}),
|
|
400
|
+
}), Ct = {
|
|
356
401
|
key: 0,
|
|
357
402
|
class: "mb-3"
|
|
358
|
-
},
|
|
403
|
+
}, xt = { key: 0 }, _t = {
|
|
359
404
|
key: 0,
|
|
360
405
|
class: "w-5 h-5 rounded bg-primary-base flex items-center justify-center text-white"
|
|
361
|
-
},
|
|
406
|
+
}, St = {
|
|
362
407
|
key: 1,
|
|
363
408
|
class: "w-5 h-5 rounded border border-gray-300 bg-white"
|
|
364
|
-
},
|
|
409
|
+
}, Rt = ["onClick"], Bt = {
|
|
365
410
|
key: 1,
|
|
366
411
|
class: "inline-flex items-center gap-1"
|
|
367
|
-
},
|
|
412
|
+
}, Mt = { key: 0 }, Ft = ["value", "placeholder", "onInput"], $t = { key: 1 }, Pt = ["onClick"], Lt = ["onClick"], Ot = {
|
|
368
413
|
key: 0,
|
|
369
414
|
class: "w-5 h-5 rounded bg-primary-base flex items-center justify-center text-white"
|
|
370
|
-
},
|
|
415
|
+
}, qt = {
|
|
371
416
|
key: 1,
|
|
372
417
|
class: "w-5 h-5 rounded border border-gray-300 bg-white"
|
|
373
|
-
},
|
|
418
|
+
}, Et = ["onClick"], jt = {
|
|
374
419
|
key: 0,
|
|
375
420
|
class: "w-5 h-5 rounded-full bg-primary-base flex items-center justify-center"
|
|
376
|
-
},
|
|
421
|
+
}, Tt = {
|
|
377
422
|
key: 1,
|
|
378
423
|
class: "w-5 h-5 rounded-full border border-gray-300 bg-white"
|
|
379
|
-
},
|
|
424
|
+
}, Nt = ["onClick"], zt = { key: 0 }, Vt = ["colspan"], At = { key: 2 }, Kt = ["colspan"], Wt = { class: "flex items-center justify-center gap-2 text-gray-500" }, Ut = { key: 3 }, Qt = ["colspan"], Ht = { class: "text-gray-400" }, Gt = { key: 4 }, Jt = ["colspan"], Xt = ["disabled"], Yt = { key: 2 }, Zt = {
|
|
425
|
+
key: 0,
|
|
426
|
+
class: "text-center py-12"
|
|
427
|
+
}, It = { class: "flex items-center justify-center gap-2 text-gray-500" }, Dt = {
|
|
428
|
+
key: 1,
|
|
429
|
+
class: "text-center py-12"
|
|
430
|
+
}, es = { class: "text-gray-400" }, ts = {
|
|
380
431
|
key: 2,
|
|
432
|
+
class: "space-y-2"
|
|
433
|
+
}, ss = {
|
|
434
|
+
key: 0,
|
|
435
|
+
class: "flex items-center gap-2 px-3 py-2"
|
|
436
|
+
}, rs = {
|
|
437
|
+
key: 0,
|
|
438
|
+
class: "w-5 h-5 rounded bg-primary-base flex items-center justify-center text-white"
|
|
439
|
+
}, ls = {
|
|
440
|
+
key: 1,
|
|
441
|
+
class: "w-5 h-5 rounded border border-gray-300 bg-white"
|
|
442
|
+
}, os = { class: "text-sm text-gray-500" }, as = ["onClick"], ns = {
|
|
443
|
+
key: 0,
|
|
444
|
+
class: "flex items-center justify-between mb-2"
|
|
445
|
+
}, is = { key: 0 }, ds = ["onClick"], us = {
|
|
446
|
+
key: 0,
|
|
447
|
+
class: "w-5 h-5 rounded bg-primary-base flex items-center justify-center text-white"
|
|
448
|
+
}, ps = {
|
|
449
|
+
key: 1,
|
|
450
|
+
class: "w-5 h-5 rounded border border-gray-300 bg-white"
|
|
451
|
+
}, cs = ["onClick"], fs = {
|
|
452
|
+
key: 0,
|
|
453
|
+
class: "w-5 h-5 rounded-full bg-primary-base flex items-center justify-center"
|
|
454
|
+
}, ys = {
|
|
455
|
+
key: 1,
|
|
456
|
+
class: "w-5 h-5 rounded-full border border-gray-300 bg-white"
|
|
457
|
+
}, gs = { key: 1 }, hs = ["onClick"], bs = { class: "text-gray-500 text-xs font-medium shrink-0" }, vs = { class: "text-right" }, ms = {
|
|
458
|
+
key: 1,
|
|
459
|
+
class: "mt-2 pt-2 border-t border-gray-100"
|
|
460
|
+
}, ks = ["disabled"], ws = {
|
|
461
|
+
key: 4,
|
|
381
462
|
class: "mt-3"
|
|
382
|
-
},
|
|
463
|
+
}, Cs = /* @__PURE__ */ fe({
|
|
383
464
|
__name: "OneDataTable",
|
|
384
|
-
props:
|
|
465
|
+
props: lt,
|
|
385
466
|
emits: [
|
|
386
467
|
"update:selection",
|
|
387
468
|
"update:expandedRows",
|
|
@@ -400,449 +481,568 @@ const Ge = {
|
|
|
400
481
|
"row-collapse",
|
|
401
482
|
"load:next"
|
|
402
483
|
],
|
|
403
|
-
setup(d, { emit:
|
|
404
|
-
const t = d,
|
|
405
|
-
|
|
406
|
-
|
|
484
|
+
setup(d, { emit: n }) {
|
|
485
|
+
const t = d, i = n, h = $e(), f = Pe(), S = E([]);
|
|
486
|
+
Ye(Le, { registerColumn: (e) => {
|
|
487
|
+
S.value.push(e);
|
|
407
488
|
}, unregisterColumn: (e) => {
|
|
408
|
-
const r =
|
|
409
|
-
r > -1 &&
|
|
489
|
+
const r = S.value.indexOf(e);
|
|
490
|
+
r > -1 && S.value.splice(r, 1);
|
|
410
491
|
} });
|
|
411
|
-
const
|
|
412
|
-
|
|
492
|
+
const F = E(t.first), V = E(t.rows), A = E(t.sortField), j = E(t.sortOrder);
|
|
493
|
+
Q(
|
|
413
494
|
() => t.first,
|
|
414
495
|
(e) => {
|
|
415
|
-
|
|
496
|
+
F.value = e;
|
|
416
497
|
}
|
|
417
|
-
),
|
|
498
|
+
), Q(
|
|
418
499
|
() => t.rows,
|
|
419
500
|
(e) => {
|
|
420
|
-
|
|
501
|
+
V.value = e;
|
|
421
502
|
}
|
|
422
|
-
),
|
|
503
|
+
), Q(
|
|
423
504
|
() => t.sortField,
|
|
424
505
|
(e) => {
|
|
425
|
-
|
|
506
|
+
A.value = e;
|
|
426
507
|
}
|
|
427
|
-
),
|
|
508
|
+
), Q(
|
|
428
509
|
() => t.sortOrder,
|
|
429
510
|
(e) => {
|
|
430
|
-
|
|
511
|
+
j.value = e;
|
|
431
512
|
}
|
|
432
513
|
);
|
|
433
|
-
const
|
|
434
|
-
() =>
|
|
435
|
-
),
|
|
514
|
+
const G = y(() => F.value), J = y(() => V.value), O = y(() => A.value), C = y(() => j.value), x = (e, r) => r ? r.split(".").reduce((s, u) => s == null ? void 0 : s[u], e) : e, T = (e) => t.dataKey ? x(e, t.dataKey) : e, M = (e, r) => e == null || r == null ? e === r : t.dataKey ? x(e, t.dataKey) === x(r, t.dataKey) : e === r, ge = (e, r) => t.dataKey ? x(e, t.dataKey) : r, R = y(() => S.value.some((e) => e.props.expander)), $ = y(() => !!t.selectionMode), X = y(() => t.selectionMode === "multiple"), te = y(() => S.value.filter((e) => !e.props.expander)), Y = y(
|
|
515
|
+
() => K.value.length + ($.value ? 1 : 0) + (R.value ? 1 : 0)
|
|
516
|
+
), he = y(() => {
|
|
436
517
|
var s, u;
|
|
437
518
|
if (t.lazy || !t.filters)
|
|
438
519
|
return t.value;
|
|
439
520
|
let e = [...t.value];
|
|
440
521
|
const r = t.filters;
|
|
441
522
|
if ((s = r.global) != null && s.value && ((u = t.globalFilterFields) != null && u.length)) {
|
|
442
|
-
const
|
|
523
|
+
const a = r.global.value;
|
|
443
524
|
e = e.filter(
|
|
444
|
-
(
|
|
445
|
-
(
|
|
525
|
+
(m) => t.globalFilterFields.some(
|
|
526
|
+
(oe) => Be.contains(x(m, oe), a)
|
|
446
527
|
)
|
|
447
528
|
);
|
|
448
529
|
}
|
|
449
|
-
for (const [
|
|
450
|
-
if (
|
|
530
|
+
for (const [a, m] of Object.entries(r)) {
|
|
531
|
+
if (a === "global" || !m.value)
|
|
451
532
|
continue;
|
|
452
|
-
const
|
|
453
|
-
|
|
533
|
+
const oe = m.matchMode || "contains", xe = Be[oe];
|
|
534
|
+
xe && (e = e.filter((Je) => xe(x(Je, a), m.value)));
|
|
454
535
|
}
|
|
455
536
|
return e;
|
|
456
|
-
}),
|
|
457
|
-
const e =
|
|
458
|
-
return t.lazy || !
|
|
459
|
-
const u =
|
|
460
|
-
if (u == null &&
|
|
537
|
+
}), Oe = y(() => {
|
|
538
|
+
const e = he.value;
|
|
539
|
+
return t.lazy || !O.value || !C.value ? e : [...e].sort((r, s) => {
|
|
540
|
+
const u = x(r, O.value), a = x(s, O.value);
|
|
541
|
+
if (u == null && a == null)
|
|
461
542
|
return 0;
|
|
462
543
|
if (u == null)
|
|
463
544
|
return 1;
|
|
464
|
-
if (
|
|
545
|
+
if (a == null)
|
|
465
546
|
return -1;
|
|
466
|
-
let
|
|
467
|
-
return typeof u == "number" && typeof
|
|
547
|
+
let m;
|
|
548
|
+
return typeof u == "number" && typeof a == "number" ? m = u - a : m = String(u).localeCompare(String(a)), C.value === 1 ? m : -m;
|
|
468
549
|
});
|
|
469
|
-
}),
|
|
470
|
-
const e =
|
|
550
|
+
}), be = y(() => t.totalRecords ?? he.value.length), P = y(() => {
|
|
551
|
+
const e = Oe.value;
|
|
471
552
|
if (t.paginator && !t.lazy) {
|
|
472
|
-
const r =
|
|
553
|
+
const r = G.value, s = r + J.value;
|
|
473
554
|
return e.slice(r, s);
|
|
474
555
|
}
|
|
475
556
|
return e;
|
|
476
|
-
}),
|
|
557
|
+
}), qe = (e) => {
|
|
477
558
|
let r;
|
|
478
|
-
|
|
479
|
-
},
|
|
480
|
-
if (
|
|
481
|
-
const u =
|
|
482
|
-
|
|
559
|
+
O.value === e ? C.value === 1 ? r = -1 : C.value === -1 ? r = null : r = 1 : r = 1, A.value = e, j.value = r, i("update:sortField", e), i("update:sortOrder", r), i("sort", { field: e, order: r }), !t.lazy && t.paginator && (F.value = 0, i("update:first", 0));
|
|
560
|
+
}, ve = (e) => e.props.sortField || e.props.field, Ee = (e) => O.value === ve(e), q = (e) => t.selection ? t.selectionMode === "single" ? M(t.selection, e) : t.selectionMode === "multiple" ? t.selection.some((r) => M(r, e)) : !1 : !1, Z = (e, r, s) => {
|
|
561
|
+
if (i("row-click", { originalEvent: e, data: r, index: s }), t.selectionMode === "single") {
|
|
562
|
+
const u = M(t.selection, r) ? null : r;
|
|
563
|
+
i("update:selection", u), u ? i("row-select", { originalEvent: e, data: r }) : i("row-unselect", { originalEvent: e, data: r });
|
|
483
564
|
}
|
|
484
|
-
},
|
|
565
|
+
}, se = (e, r) => {
|
|
485
566
|
if (e.stopPropagation(), t.selectionMode === "multiple") {
|
|
486
|
-
const s = t.selection || [], u = s.some((
|
|
487
|
-
let
|
|
488
|
-
u ? (
|
|
567
|
+
const s = t.selection || [], u = s.some((m) => M(m, r));
|
|
568
|
+
let a;
|
|
569
|
+
u ? (a = s.filter((m) => !M(m, r)), i("row-unselect", { originalEvent: e, data: r })) : (a = [...s, r], i("row-select", { originalEvent: e, data: r })), i("update:selection", a);
|
|
489
570
|
}
|
|
490
|
-
},
|
|
571
|
+
}, re = y(() => {
|
|
491
572
|
if (t.selectionMode !== "multiple" || !t.selection)
|
|
492
573
|
return !1;
|
|
493
574
|
const e = t.selection;
|
|
494
|
-
return
|
|
495
|
-
}),
|
|
575
|
+
return P.value.length > 0 && P.value.every((r) => e.some((s) => M(s, r)));
|
|
576
|
+
}), me = (e) => {
|
|
496
577
|
e.stopPropagation();
|
|
497
578
|
const r = t.selection || [];
|
|
498
|
-
if (
|
|
579
|
+
if (re.value) {
|
|
499
580
|
const s = r.filter(
|
|
500
|
-
(u) => !
|
|
581
|
+
(u) => !P.value.some((a) => M(u, a))
|
|
501
582
|
);
|
|
502
|
-
|
|
583
|
+
i("update:selection", s);
|
|
503
584
|
} else {
|
|
504
585
|
const s = [...r];
|
|
505
|
-
|
|
506
|
-
s.some((
|
|
507
|
-
}),
|
|
586
|
+
P.value.forEach((u) => {
|
|
587
|
+
s.some((a) => M(a, u)) || s.push(u);
|
|
588
|
+
}), i("update:selection", s);
|
|
508
589
|
}
|
|
509
|
-
},
|
|
590
|
+
}, N = (e) => {
|
|
510
591
|
if (!t.expandedRows)
|
|
511
592
|
return !1;
|
|
512
593
|
if (Array.isArray(t.expandedRows))
|
|
513
|
-
return t.expandedRows.some((r) =>
|
|
594
|
+
return t.expandedRows.some((r) => M(r, e));
|
|
514
595
|
if (t.dataKey) {
|
|
515
|
-
const r = String(
|
|
596
|
+
const r = String(T(e));
|
|
516
597
|
return !!t.expandedRows[r];
|
|
517
598
|
}
|
|
518
599
|
return !1;
|
|
519
|
-
},
|
|
600
|
+
}, le = (e, r) => {
|
|
520
601
|
e.stopPropagation();
|
|
521
|
-
const s =
|
|
602
|
+
const s = N(r);
|
|
522
603
|
if (Array.isArray(t.expandedRows)) {
|
|
523
604
|
let u;
|
|
524
|
-
s ? (u = t.expandedRows.filter((
|
|
605
|
+
s ? (u = t.expandedRows.filter((a) => !M(a, r)), i("row-collapse", { originalEvent: e, data: r })) : (u = [...t.expandedRows, r], i("row-expand", { originalEvent: e, data: r })), i("update:expandedRows", u);
|
|
525
606
|
} else if (t.dataKey) {
|
|
526
|
-
const u = String(
|
|
527
|
-
s ? (delete
|
|
607
|
+
const u = String(T(r)), a = { ...t.expandedRows };
|
|
608
|
+
s ? (delete a[u], i("row-collapse", { originalEvent: e, data: r })) : (a[u] = !0, i("row-expand", { originalEvent: e, data: r })), i("update:expandedRows", a);
|
|
528
609
|
}
|
|
529
|
-
},
|
|
530
|
-
var
|
|
610
|
+
}, je = (e, r, s) => {
|
|
611
|
+
var a;
|
|
531
612
|
if (!t.filters)
|
|
532
613
|
return;
|
|
533
614
|
const u = {
|
|
534
615
|
...t.filters,
|
|
535
|
-
[e]: { value: r, matchMode: s || ((
|
|
616
|
+
[e]: { value: r, matchMode: s || ((a = t.filters[e]) == null ? void 0 : a.matchMode) || "contains" }
|
|
536
617
|
};
|
|
537
|
-
|
|
538
|
-
},
|
|
618
|
+
i("update:filters", u), t.lazy && i("filter", { filters: u }), t.paginator && (F.value = 0, i("update:first", 0));
|
|
619
|
+
}, ke = (e) => {
|
|
539
620
|
var r;
|
|
540
621
|
return ((r = t.filters) == null ? void 0 : r[e]) || { value: null };
|
|
541
|
-
},
|
|
542
|
-
t.filters && (
|
|
543
|
-
},
|
|
544
|
-
|
|
545
|
-
},
|
|
546
|
-
|
|
547
|
-
},
|
|
622
|
+
}, Te = (e) => () => {
|
|
623
|
+
t.filters && (i("update:filters", { ...t.filters }), t.lazy && i("filter", { filters: t.filters }), t.paginator && (F.value = 0, i("update:first", 0)));
|
|
624
|
+
}, Ne = (e) => {
|
|
625
|
+
F.value = e, i("update:first", e);
|
|
626
|
+
}, ze = (e) => {
|
|
627
|
+
V.value = e, i("update:rows", e);
|
|
628
|
+
}, we = y(() => {
|
|
548
629
|
const e = [];
|
|
549
630
|
if (t.colWidths) {
|
|
550
631
|
if (typeof t.colWidths == "function") {
|
|
551
|
-
const r = t.colWidths(
|
|
552
|
-
return $.value && s.push(""),
|
|
632
|
+
const r = t.colWidths(te.value), s = [];
|
|
633
|
+
return $.value && s.push(""), R.value && s.push(""), [...s, ...r];
|
|
553
634
|
}
|
|
554
635
|
return t.colWidths;
|
|
555
636
|
}
|
|
556
|
-
return $.value && e.push(""),
|
|
637
|
+
return $.value && e.push(""), R.value && e.push(""), te.value.forEach((r) => {
|
|
557
638
|
e.push(r.props.width || "");
|
|
558
639
|
}), e;
|
|
559
|
-
}),
|
|
560
|
-
const e =
|
|
640
|
+
}), Ce = y(() => we.value.some((e) => e !== "" && e != null)), Ve = y(() => t.wrapperClass ? ["overflow-x-auto", "w-full", t.wrapperClass] : t.verticalBorders === "hover-table" ? ["overflow-x-auto", "w-full", "border", "border-transparent", "rounded"] : nt(t.wrapperBordered)), Ae = y(() => {
|
|
641
|
+
const e = it(t.size);
|
|
561
642
|
return t.tableClass && e.push(t.tableClass), t.bordered && e.push("border", "border-gray-100"), e;
|
|
562
|
-
})
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
643
|
+
}), Ke = t.cardBreakpoint ? z(t.cardBreakpoint) : E(!0), We = y(() => !!t.cardBreakpoint && !Ke.value), Ue = {
|
|
644
|
+
sm: z("sm"),
|
|
645
|
+
md: z("md"),
|
|
646
|
+
lg: z("lg"),
|
|
647
|
+
xl: z("xl"),
|
|
648
|
+
"2xl": z("2xl")
|
|
649
|
+
}, Qe = (e) => {
|
|
650
|
+
var s;
|
|
651
|
+
if (!e.props.visibleFrom)
|
|
652
|
+
return !0;
|
|
653
|
+
const r = e.props.visibleFrom;
|
|
654
|
+
return ((s = Ue[r]) == null ? void 0 : s.value) ?? !0;
|
|
655
|
+
}, K = y(() => te.value.filter(Qe)), He = (e) => (r) => le(r, e), Ge = (e) => (r) => se(r, e);
|
|
656
|
+
return (e, r) => (l(), o("div", null, [
|
|
657
|
+
Ze(c("div", null, [
|
|
658
|
+
B(e.$slots, "default", {}, void 0, !0)
|
|
566
659
|
], 512), [
|
|
567
|
-
[
|
|
660
|
+
[Ie, !1]
|
|
568
661
|
]),
|
|
569
|
-
p(
|
|
570
|
-
|
|
571
|
-
])) :
|
|
572
|
-
|
|
573
|
-
|
|
662
|
+
p(h).header ? (l(), o("div", Ct, [
|
|
663
|
+
B(e.$slots, "header", {}, void 0, !0)
|
|
664
|
+
])) : g("", !0),
|
|
665
|
+
We.value ? (l(), o("div", Yt, [
|
|
666
|
+
e.loading ? (l(), o("div", Zt, [
|
|
667
|
+
B(e.$slots, "loading", {}, () => [
|
|
668
|
+
c("div", It, [
|
|
669
|
+
Se(I, { class: "w-5 h-5" }),
|
|
670
|
+
c("span", null, k(p(f)("ui.dataTable.loading")), 1)
|
|
671
|
+
])
|
|
672
|
+
], !0)
|
|
673
|
+
])) : P.value.length === 0 ? (l(), o("div", Dt, [
|
|
674
|
+
B(e.$slots, "empty", {}, () => [
|
|
675
|
+
c("span", es, k(p(f)("ui.dataTable.noRecords")), 1)
|
|
676
|
+
], !0)
|
|
677
|
+
])) : (l(), o("div", ts, [
|
|
678
|
+
X.value ? (l(), o("div", ss, [
|
|
679
|
+
c("div", {
|
|
680
|
+
class: "cursor-pointer",
|
|
681
|
+
onClick: r[2] || (r[2] = (s) => me(s))
|
|
682
|
+
}, [
|
|
683
|
+
re.value ? (l(), o("div", rs, [
|
|
684
|
+
(l(), v(w(p(D)), { class: "w-3.5 h-3.5" }))
|
|
685
|
+
])) : (l(), o("div", ls))
|
|
686
|
+
]),
|
|
687
|
+
c("span", os, k(p(f)("ui.dataTable.selectAll")), 1)
|
|
688
|
+
])) : g("", !0),
|
|
689
|
+
(l(!0), o(_, null, L(P.value, (s, u) => (l(), o("div", {
|
|
690
|
+
key: ge(s, u),
|
|
691
|
+
class: b([
|
|
692
|
+
...p(pt)(e.hoverable, q(s)),
|
|
693
|
+
e.selectionMode ? "cursor-pointer" : ""
|
|
694
|
+
]),
|
|
695
|
+
onClick: (a) => Z(a, s, u)
|
|
696
|
+
}, [
|
|
697
|
+
p(h).card ? B(e.$slots, "card", {
|
|
698
|
+
key: 0,
|
|
699
|
+
data: s,
|
|
700
|
+
index: u,
|
|
701
|
+
selected: q(s),
|
|
702
|
+
expanded: R.value && N(s),
|
|
703
|
+
toggleExpansion: He(s),
|
|
704
|
+
toggleSelection: Ge(s)
|
|
705
|
+
}, void 0, !0) : (l(), o(_, { key: 1 }, [
|
|
706
|
+
$.value || R.value ? (l(), o("div", ns, [
|
|
707
|
+
$.value ? (l(), o("div", is, [
|
|
708
|
+
X.value ? (l(), o("div", {
|
|
709
|
+
key: 0,
|
|
710
|
+
class: "cursor-pointer",
|
|
711
|
+
onClick: U((a) => se(a, s), ["stop"])
|
|
712
|
+
}, [
|
|
713
|
+
q(s) ? (l(), o("div", us, [
|
|
714
|
+
(l(), v(w(p(D)), { class: "w-3.5 h-3.5" }))
|
|
715
|
+
])) : (l(), o("div", ps))
|
|
716
|
+
], 8, ds)) : (l(), o("div", {
|
|
717
|
+
key: 1,
|
|
718
|
+
class: "cursor-pointer",
|
|
719
|
+
onClick: U((a) => Z(a, s, u), ["stop"])
|
|
720
|
+
}, [
|
|
721
|
+
q(s) ? (l(), o("div", fs, [...r[6] || (r[6] = [
|
|
722
|
+
c("div", { class: "w-2 h-2 rounded-full bg-white" }, null, -1)
|
|
723
|
+
])])) : (l(), o("div", ys))
|
|
724
|
+
], 8, cs))
|
|
725
|
+
])) : (l(), o("div", gs)),
|
|
726
|
+
R.value ? (l(), o("button", {
|
|
727
|
+
key: 2,
|
|
728
|
+
class: "p-1 rounded hover:bg-gray-100 transition-colors",
|
|
729
|
+
onClick: U((a) => le(a, s), ["stop"])
|
|
730
|
+
}, [
|
|
731
|
+
(l(), v(w(N(s) ? p(ne) : p(pe)), { class: "w-4 h-4 text-gray-500" }))
|
|
732
|
+
], 8, hs)) : g("", !0)
|
|
733
|
+
])) : g("", !0),
|
|
734
|
+
(l(!0), o(_, null, L(K.value, (a, m) => (l(), o("div", {
|
|
735
|
+
key: m,
|
|
736
|
+
class: b(p(ct)(e.size))
|
|
737
|
+
}, [
|
|
738
|
+
c("span", bs, k(a.props.header), 1),
|
|
739
|
+
c("div", vs, [
|
|
740
|
+
a.slots.body ? (l(), v(w(a.slots.body), {
|
|
741
|
+
key: 0,
|
|
742
|
+
data: s,
|
|
743
|
+
field: a.props.field,
|
|
744
|
+
index: u
|
|
745
|
+
}, null, 8, ["data", "field", "index"])) : a.props.field ? (l(), o(_, { key: 1 }, [
|
|
746
|
+
W(k(x(s, a.props.field)), 1)
|
|
747
|
+
], 64)) : g("", !0)
|
|
748
|
+
])
|
|
749
|
+
], 2))), 128)),
|
|
750
|
+
R.value && N(s) ? (l(), o("div", ms, [
|
|
751
|
+
B(e.$slots, "expansion", {
|
|
752
|
+
data: s,
|
|
753
|
+
index: u
|
|
754
|
+
}, void 0, !0)
|
|
755
|
+
])) : g("", !0)
|
|
756
|
+
], 64))
|
|
757
|
+
], 10, as))), 128)),
|
|
758
|
+
e.hasNextPage && !e.loading ? (l(), o("button", {
|
|
759
|
+
key: 1,
|
|
760
|
+
class: "w-full p-2 rounded bg-primary-base bg-opacity-10 text-primary-base text-sm font-medium hover:bg-opacity-20 transition-colors disabled:opacity-50 disabled:cursor-default flex items-center justify-center gap-2",
|
|
761
|
+
disabled: e.loadingNext,
|
|
762
|
+
onClick: r[3] || (r[3] = (s) => i("load:next"))
|
|
763
|
+
}, [
|
|
764
|
+
e.loadingNext ? (l(), v(I, {
|
|
765
|
+
key: 0,
|
|
766
|
+
class: "w-4 h-4"
|
|
767
|
+
})) : g("", !0),
|
|
768
|
+
W(" " + k(e.loadMoreLabel || p(f)("ui.dataTable.showMore")), 1)
|
|
769
|
+
], 8, ks)) : g("", !0)
|
|
770
|
+
]))
|
|
771
|
+
])) : (l(), o("div", {
|
|
772
|
+
key: 1,
|
|
773
|
+
class: b([...Ve.value, e.verticalBorders === "hover-table" ? "vb-hover" : ""])
|
|
574
774
|
}, [
|
|
575
775
|
c("table", {
|
|
576
776
|
class: b([
|
|
577
|
-
...
|
|
777
|
+
...Ae.value,
|
|
578
778
|
e.verticalBorders !== "none" ? "border-separate border-spacing-0" : "border-collapse",
|
|
579
779
|
e.verticalBorders === "hover" ? "vb-hover" : "",
|
|
580
|
-
|
|
780
|
+
Ce.value ? "table-fixed" : ""
|
|
581
781
|
])
|
|
582
782
|
}, [
|
|
583
|
-
|
|
584
|
-
(l(!0),
|
|
783
|
+
Ce.value ? (l(), o("colgroup", xt, [
|
|
784
|
+
(l(!0), o(_, null, L(we.value, (s, u) => (l(), o("col", {
|
|
585
785
|
key: `col-${u}`,
|
|
586
|
-
style:
|
|
786
|
+
style: ae(s ? { width: s } : {})
|
|
587
787
|
}, null, 4))), 128))
|
|
588
|
-
])) :
|
|
788
|
+
])) : g("", !0),
|
|
589
789
|
c("thead", null, [
|
|
590
790
|
c("tr", null, [
|
|
591
|
-
$.value ? (l(),
|
|
791
|
+
$.value ? (l(), o("th", {
|
|
592
792
|
key: 0,
|
|
593
793
|
class: b([
|
|
594
|
-
...p(
|
|
595
|
-
...p(
|
|
794
|
+
...p(ie)(e.size, !1, e.verticalBorders, e.headerVariant, e.headerBgClass),
|
|
795
|
+
...p(ce)(e.size)
|
|
596
796
|
])
|
|
597
797
|
}, [
|
|
598
|
-
|
|
798
|
+
X.value ? (l(), o("div", {
|
|
599
799
|
key: 0,
|
|
600
800
|
class: "flex items-center justify-center cursor-pointer",
|
|
601
|
-
onClick: r[0] || (r[0] = (s) =>
|
|
801
|
+
onClick: r[0] || (r[0] = (s) => me(s))
|
|
602
802
|
}, [
|
|
603
|
-
|
|
604
|
-
(l(),
|
|
605
|
-
])) : (l(),
|
|
606
|
-
])) :
|
|
607
|
-
], 2)) :
|
|
608
|
-
|
|
803
|
+
re.value ? (l(), o("div", _t, [
|
|
804
|
+
(l(), v(w(p(D)), { class: "w-3.5 h-3.5" }))
|
|
805
|
+
])) : (l(), o("div", St))
|
|
806
|
+
])) : g("", !0)
|
|
807
|
+
], 2)) : g("", !0),
|
|
808
|
+
R.value ? (l(), o("th", {
|
|
609
809
|
key: 1,
|
|
610
810
|
class: b([
|
|
611
|
-
...p(
|
|
612
|
-
...p(
|
|
811
|
+
...p(ie)(e.size, !1, e.verticalBorders, e.headerVariant, e.headerBgClass),
|
|
812
|
+
...p(Me)(e.size)
|
|
613
813
|
])
|
|
614
|
-
}, null, 2)) :
|
|
615
|
-
(l(!0),
|
|
814
|
+
}, null, 2)) : g("", !0),
|
|
815
|
+
(l(!0), o(_, null, L(K.value, (s, u) => (l(), o("th", {
|
|
616
816
|
key: u,
|
|
617
817
|
class: b([
|
|
618
|
-
...p(
|
|
818
|
+
...p(ie)(e.size, s.props.sortable, e.verticalBorders, e.headerVariant, e.headerBgClass),
|
|
619
819
|
s.props.headerClass
|
|
620
820
|
]),
|
|
621
|
-
style:
|
|
622
|
-
onClick: (
|
|
821
|
+
style: ae([s.props.headerStyle, s.props.width ? { width: s.props.width } : {}]),
|
|
822
|
+
onClick: (a) => s.props.sortable ? qe(ve(s)) : void 0
|
|
623
823
|
}, [
|
|
624
|
-
s.slots.header ? (l(),
|
|
625
|
-
|
|
626
|
-
s.props.sortable ? (l(),
|
|
627
|
-
|
|
824
|
+
s.slots.header ? (l(), v(w(s.slots.header), { key: 0 })) : (l(), o("span", Bt, [
|
|
825
|
+
W(k(s.props.header) + " ", 1),
|
|
826
|
+
s.props.sortable ? (l(), o(_, { key: 0 }, [
|
|
827
|
+
Ee(s) ? C.value === 1 ? (l(), v(w(p(et)), {
|
|
628
828
|
key: 1,
|
|
629
|
-
class: b(p(
|
|
630
|
-
}, null, 8, ["class"])) :
|
|
829
|
+
class: b(p(ee)(!0))
|
|
830
|
+
}, null, 8, ["class"])) : C.value === -1 ? (l(), v(w(p(ne)), {
|
|
631
831
|
key: 2,
|
|
632
|
-
class: b(p(
|
|
633
|
-
}, null, 8, ["class"])) : (l(),
|
|
832
|
+
class: b(p(ee)(!0))
|
|
833
|
+
}, null, 8, ["class"])) : (l(), v(w(p(Re)), {
|
|
634
834
|
key: 3,
|
|
635
|
-
class: b(p(
|
|
636
|
-
}, null, 8, ["class"])) : (l(),
|
|
835
|
+
class: b(p(ee)(!1))
|
|
836
|
+
}, null, 8, ["class"])) : (l(), v(w(p(Re)), {
|
|
637
837
|
key: 0,
|
|
638
|
-
class: b(p(
|
|
838
|
+
class: b(p(ee)(!1))
|
|
639
839
|
}, null, 8, ["class"]))
|
|
640
|
-
], 64)) :
|
|
840
|
+
], 64)) : g("", !0)
|
|
641
841
|
]))
|
|
642
|
-
], 14,
|
|
842
|
+
], 14, Rt))), 128))
|
|
643
843
|
]),
|
|
644
|
-
e.filterDisplay === "row" ? (l(),
|
|
645
|
-
$.value ? (l(),
|
|
844
|
+
e.filterDisplay === "row" ? (l(), o("tr", Mt, [
|
|
845
|
+
$.value ? (l(), o("th", {
|
|
646
846
|
key: 0,
|
|
647
|
-
class: b(p(
|
|
648
|
-
}, null, 2)) :
|
|
649
|
-
|
|
847
|
+
class: b(p(ue)(e.size))
|
|
848
|
+
}, null, 2)) : g("", !0),
|
|
849
|
+
R.value ? (l(), o("th", {
|
|
650
850
|
key: 1,
|
|
651
|
-
class: b(p(
|
|
652
|
-
}, null, 2)) :
|
|
653
|
-
(l(!0),
|
|
851
|
+
class: b(p(ue)(e.size))
|
|
852
|
+
}, null, 2)) : g("", !0),
|
|
853
|
+
(l(!0), o(_, null, L(K.value, (s, u) => (l(), o("th", {
|
|
654
854
|
key: `filter-${u}`,
|
|
655
|
-
class: b(p(
|
|
855
|
+
class: b(p(ue)(e.size))
|
|
656
856
|
}, [
|
|
657
|
-
s.props.filterable && s.slots.filter ? (l(),
|
|
857
|
+
s.props.filterable && s.slots.filter ? (l(), v(w(s.slots.filter), {
|
|
658
858
|
key: 0,
|
|
659
|
-
filterModel:
|
|
859
|
+
filterModel: ke(
|
|
660
860
|
s.props.filterField || s.props.field
|
|
661
861
|
),
|
|
662
|
-
filterCallback:
|
|
862
|
+
filterCallback: Te(
|
|
663
863
|
s.props.filterField || s.props.field
|
|
664
864
|
)
|
|
665
|
-
}, null, 8, ["filterModel", "filterCallback"])) : s.props.filterable && s.props.field ? (l(),
|
|
865
|
+
}, null, 8, ["filterModel", "filterCallback"])) : s.props.filterable && s.props.field ? (l(), o("input", {
|
|
666
866
|
key: 1,
|
|
667
867
|
type: "text",
|
|
668
|
-
value:
|
|
868
|
+
value: ke(
|
|
669
869
|
s.props.filterField || s.props.field
|
|
670
870
|
).value || "",
|
|
671
871
|
class: "w-full border border-gray-300 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-primary-glow",
|
|
672
872
|
placeholder: `Filter ${s.props.header || s.props.field}`,
|
|
673
|
-
onInput: (
|
|
873
|
+
onInput: (a) => je(
|
|
674
874
|
s.props.filterField || s.props.field,
|
|
675
|
-
|
|
875
|
+
a.target.value
|
|
676
876
|
)
|
|
677
|
-
}, null, 40,
|
|
877
|
+
}, null, 40, Ft)) : g("", !0)
|
|
678
878
|
], 2))), 128))
|
|
679
|
-
])) :
|
|
879
|
+
])) : g("", !0)
|
|
680
880
|
]),
|
|
681
|
-
!e.loading &&
|
|
682
|
-
(l(!0),
|
|
683
|
-
key:
|
|
881
|
+
!e.loading && P.value.length > 0 ? (l(), o("tbody", $t, [
|
|
882
|
+
(l(!0), o(_, null, L(P.value, (s, u) => (l(), o(_, {
|
|
883
|
+
key: ge(s, u)
|
|
684
884
|
}, [
|
|
685
885
|
c("tr", {
|
|
686
886
|
class: b([
|
|
687
|
-
...p(
|
|
887
|
+
...p(dt)(
|
|
688
888
|
e.striped,
|
|
689
889
|
e.hoverable,
|
|
690
890
|
u % 2 === 1,
|
|
691
|
-
|
|
891
|
+
q(s),
|
|
692
892
|
!1
|
|
693
893
|
),
|
|
694
894
|
e.selectionMode ? "cursor-pointer" : ""
|
|
695
895
|
]),
|
|
696
|
-
onClick: (
|
|
896
|
+
onClick: (a) => Z(a, s, u)
|
|
697
897
|
}, [
|
|
698
|
-
$.value ? (l(),
|
|
898
|
+
$.value ? (l(), o("td", {
|
|
699
899
|
key: 0,
|
|
700
900
|
class: b([
|
|
701
|
-
...p(
|
|
702
|
-
...p(
|
|
901
|
+
...p(de)(e.size, e.bordered, e.verticalBorders, e.bodyBgClass),
|
|
902
|
+
...p(ce)(e.size)
|
|
703
903
|
])
|
|
704
904
|
}, [
|
|
705
|
-
|
|
905
|
+
X.value ? (l(), o("div", {
|
|
706
906
|
key: 0,
|
|
707
907
|
class: "flex items-center justify-center cursor-pointer",
|
|
708
|
-
onClick:
|
|
908
|
+
onClick: U((a) => se(a, s), ["stop"])
|
|
709
909
|
}, [
|
|
710
|
-
|
|
711
|
-
(l(),
|
|
712
|
-
])) : (l(),
|
|
713
|
-
], 8,
|
|
910
|
+
q(s) ? (l(), o("div", Ot, [
|
|
911
|
+
(l(), v(w(p(D)), { class: "w-3.5 h-3.5" }))
|
|
912
|
+
])) : (l(), o("div", qt))
|
|
913
|
+
], 8, Lt)) : (l(), o("div", {
|
|
714
914
|
key: 1,
|
|
715
915
|
class: "flex items-center justify-center cursor-pointer",
|
|
716
|
-
onClick:
|
|
916
|
+
onClick: U((a) => Z(a, s, u), ["stop"])
|
|
717
917
|
}, [
|
|
718
|
-
|
|
918
|
+
q(s) ? (l(), o("div", jt, [...r[5] || (r[5] = [
|
|
719
919
|
c("div", { class: "w-2 h-2 rounded-full bg-white" }, null, -1)
|
|
720
|
-
])])) : (l(),
|
|
721
|
-
], 8,
|
|
722
|
-
], 2)) :
|
|
723
|
-
|
|
920
|
+
])])) : (l(), o("div", Tt))
|
|
921
|
+
], 8, Et))
|
|
922
|
+
], 2)) : g("", !0),
|
|
923
|
+
R.value ? (l(), o("td", {
|
|
724
924
|
key: 1,
|
|
725
925
|
class: b([
|
|
726
|
-
...p(
|
|
727
|
-
...p(
|
|
926
|
+
...p(de)(e.size, e.bordered, e.verticalBorders, e.bodyBgClass),
|
|
927
|
+
...p(Me)(e.size)
|
|
728
928
|
])
|
|
729
929
|
}, [
|
|
730
930
|
c("button", {
|
|
731
931
|
class: "p-1 rounded hover:bg-gray-100 transition-colors",
|
|
732
|
-
onClick: (
|
|
932
|
+
onClick: (a) => le(a, s)
|
|
733
933
|
}, [
|
|
734
|
-
(l(),
|
|
735
|
-
], 8,
|
|
736
|
-
], 2)) :
|
|
737
|
-
(l(!0),
|
|
738
|
-
key:
|
|
934
|
+
(l(), v(w(N(s) ? p(ne) : p(pe)), { class: "w-4 h-4 text-gray-500" }))
|
|
935
|
+
], 8, Nt)
|
|
936
|
+
], 2)) : g("", !0),
|
|
937
|
+
(l(!0), o(_, null, L(K.value, (a, m) => (l(), o("td", {
|
|
938
|
+
key: m,
|
|
739
939
|
class: b([
|
|
740
|
-
...p(
|
|
741
|
-
|
|
940
|
+
...p(de)(e.size, e.bordered, e.verticalBorders, e.bodyBgClass),
|
|
941
|
+
a.props.bodyClass
|
|
742
942
|
]),
|
|
743
|
-
style:
|
|
943
|
+
style: ae(a.props.bodyStyle)
|
|
744
944
|
}, [
|
|
745
|
-
|
|
945
|
+
a.slots.body ? (l(), v(w(a.slots.body), {
|
|
746
946
|
key: 0,
|
|
747
947
|
data: s,
|
|
748
|
-
field:
|
|
948
|
+
field: a.props.field,
|
|
749
949
|
index: u
|
|
750
|
-
}, null, 8, ["data", "field", "index"])) :
|
|
751
|
-
|
|
752
|
-
], 64)) :
|
|
950
|
+
}, null, 8, ["data", "field", "index"])) : a.props.field ? (l(), o(_, { key: 1 }, [
|
|
951
|
+
W(k(x(s, a.props.field)), 1)
|
|
952
|
+
], 64)) : g("", !0)
|
|
753
953
|
], 6))), 128))
|
|
754
|
-
], 10,
|
|
755
|
-
|
|
954
|
+
], 10, Pt),
|
|
955
|
+
R.value && N(s) ? (l(), o("tr", zt, [
|
|
756
956
|
c("td", {
|
|
757
|
-
colspan:
|
|
957
|
+
colspan: Y.value,
|
|
758
958
|
class: "p-0"
|
|
759
959
|
}, [
|
|
760
|
-
|
|
960
|
+
B(e.$slots, "expansion", {
|
|
761
961
|
data: s,
|
|
762
962
|
index: u
|
|
763
963
|
}, void 0, !0)
|
|
764
|
-
], 8,
|
|
765
|
-
])) :
|
|
964
|
+
], 8, Vt)
|
|
965
|
+
])) : g("", !0)
|
|
766
966
|
], 64))), 128))
|
|
767
|
-
])) : e.loading ? (l(),
|
|
967
|
+
])) : e.loading ? (l(), o("tbody", At, [
|
|
768
968
|
c("tr", null, [
|
|
769
969
|
c("td", {
|
|
770
|
-
colspan:
|
|
970
|
+
colspan: Y.value,
|
|
771
971
|
class: "text-center py-12"
|
|
772
972
|
}, [
|
|
773
|
-
|
|
774
|
-
c("div",
|
|
775
|
-
|
|
776
|
-
c("span", null,
|
|
973
|
+
B(e.$slots, "loading", {}, () => [
|
|
974
|
+
c("div", Wt, [
|
|
975
|
+
Se(I, { class: "w-5 h-5" }),
|
|
976
|
+
c("span", null, k(p(f)("ui.dataTable.loading")), 1)
|
|
777
977
|
])
|
|
778
978
|
], !0)
|
|
779
|
-
], 8,
|
|
979
|
+
], 8, Kt)
|
|
780
980
|
])
|
|
781
|
-
])) : (l(),
|
|
981
|
+
])) : (l(), o("tbody", Ut, [
|
|
782
982
|
c("tr", null, [
|
|
783
983
|
c("td", {
|
|
784
|
-
colspan:
|
|
984
|
+
colspan: Y.value,
|
|
785
985
|
class: "text-center py-12"
|
|
786
986
|
}, [
|
|
787
|
-
|
|
788
|
-
c("span",
|
|
987
|
+
B(e.$slots, "empty", {}, () => [
|
|
988
|
+
c("span", Ht, k(p(f)("ui.dataTable.noRecords")), 1)
|
|
789
989
|
], !0)
|
|
790
|
-
], 8,
|
|
990
|
+
], 8, Qt)
|
|
791
991
|
])
|
|
792
992
|
])),
|
|
793
|
-
e.hasNextPage && !e.loading ? (l(),
|
|
993
|
+
e.hasNextPage && !e.loading ? (l(), o("tfoot", Gt, [
|
|
794
994
|
c("tr", null, [
|
|
795
995
|
c("td", {
|
|
796
|
-
colspan:
|
|
996
|
+
colspan: Y.value,
|
|
797
997
|
class: "px-3 pb-3 pt-2"
|
|
798
998
|
}, [
|
|
799
999
|
c("button", {
|
|
800
1000
|
class: "w-full p-2 rounded bg-primary-base bg-opacity-10 text-primary-base text-sm font-medium hover:bg-opacity-20 transition-colors disabled:opacity-50 disabled:cursor-default flex items-center justify-center gap-2",
|
|
801
1001
|
disabled: e.loadingNext,
|
|
802
|
-
onClick: r[1] || (r[1] = (s) =>
|
|
1002
|
+
onClick: r[1] || (r[1] = (s) => i("load:next"))
|
|
803
1003
|
}, [
|
|
804
|
-
e.loadingNext ? (l(),
|
|
1004
|
+
e.loadingNext ? (l(), v(I, {
|
|
805
1005
|
key: 0,
|
|
806
1006
|
class: "w-4 h-4"
|
|
807
|
-
})) :
|
|
808
|
-
|
|
809
|
-
], 8,
|
|
810
|
-
], 8,
|
|
1007
|
+
})) : g("", !0),
|
|
1008
|
+
W(" " + k(e.loadMoreLabel || p(f)("ui.dataTable.showMore")), 1)
|
|
1009
|
+
], 8, Xt)
|
|
1010
|
+
], 8, Jt)
|
|
811
1011
|
])
|
|
812
|
-
])) :
|
|
1012
|
+
])) : g("", !0)
|
|
813
1013
|
], 2)
|
|
814
|
-
], 2),
|
|
815
|
-
e.paginator &&
|
|
816
|
-
key:
|
|
817
|
-
first:
|
|
818
|
-
rows:
|
|
819
|
-
"total-records":
|
|
1014
|
+
], 2)),
|
|
1015
|
+
e.paginator && be.value > 0 ? (l(), v(wt, {
|
|
1016
|
+
key: 3,
|
|
1017
|
+
first: G.value,
|
|
1018
|
+
rows: J.value,
|
|
1019
|
+
"total-records": be.value,
|
|
820
1020
|
"rows-per-page-options": e.rowsPerPageOptions,
|
|
821
|
-
"onUpdate:first":
|
|
822
|
-
"onUpdate:rows":
|
|
823
|
-
onPage: r[
|
|
824
|
-
}, null, 8, ["first", "rows", "total-records", "rows-per-page-options"])) :
|
|
825
|
-
p(
|
|
826
|
-
|
|
827
|
-
])) :
|
|
1021
|
+
"onUpdate:first": Ne,
|
|
1022
|
+
"onUpdate:rows": ze,
|
|
1023
|
+
onPage: r[4] || (r[4] = (s) => i("page", s))
|
|
1024
|
+
}, null, 8, ["first", "rows", "total-records", "rows-per-page-options"])) : g("", !0),
|
|
1025
|
+
p(h).footer ? (l(), o("div", ws, [
|
|
1026
|
+
B(e.$slots, "footer", {}, void 0, !0)
|
|
1027
|
+
])) : g("", !0)
|
|
828
1028
|
]));
|
|
829
1029
|
}
|
|
830
1030
|
});
|
|
831
|
-
const
|
|
1031
|
+
const Ps = /* @__PURE__ */ tt(Cs, [["__scopeId", "data-v-f7613b9d"]]), Ls = /* @__PURE__ */ fe({
|
|
832
1032
|
__name: "OneColumn",
|
|
833
|
-
props:
|
|
1033
|
+
props: rt,
|
|
834
1034
|
setup(d) {
|
|
835
|
-
const
|
|
836
|
-
props:
|
|
1035
|
+
const n = d, t = $e(), i = De(Le), h = {
|
|
1036
|
+
props: n,
|
|
837
1037
|
slots: t
|
|
838
1038
|
};
|
|
839
|
-
return
|
|
840
|
-
|
|
841
|
-
}), (f,
|
|
1039
|
+
return i && i.registerColumn(h), Fe(() => {
|
|
1040
|
+
i && i.unregisterColumn(h);
|
|
1041
|
+
}), (f, S) => B(f.$slots, "default");
|
|
842
1042
|
}
|
|
843
1043
|
});
|
|
844
1044
|
export {
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
1045
|
+
Ls as OneColumn,
|
|
1046
|
+
Ps as OneDataTable,
|
|
1047
|
+
wt as OneDataTablePaginator
|
|
848
1048
|
};
|