@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.
@@ -1,13 +1,13 @@
1
- import { openBlock as l, createElementBlock as i, createElementVNode as c, defineComponent as ee, computed as y, normalizeClass as b, toDisplayString as S, Fragment as _, renderList as E, unref as p, createCommentVNode as h, createBlock as C, resolveDynamicComponent as k, useSlots as we, ref as N, provide as je, watch as W, withDirectives as Ne, renderSlot as P, vShow as Ae, normalizeStyle as J, createTextVNode as Q, withModifiers as fe, createVNode as Ke, inject as Ve, onBeforeUnmount as We } from "vue";
2
- import { useOnebI18n as Ce } from "../i18n/index.js";
3
- import { a as ke, r as Ue } from "../ChevronRightIcon-4549a26b.js";
4
- import { S as ye } from "../SpinnerIcon-74648c98.js";
5
- import { r as ge } from "../ChevronDownIcon-6805ce6c.js";
6
- import { r as he } from "../CheckIcon-f1c94824.js";
7
- import { _ as Ie } from "../_plugin-vue_export-helper-dad06003.js";
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 He(d, a) {
10
- return l(), i("svg", {
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 be(d, a) {
26
- return l(), i("svg", {
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 Ge = {
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
- }, Je = {
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
- }, Se = Symbol("OneDataTable"), ve = {
220
- contains: (d, a) => String(d ?? "").toLowerCase().includes(String(a).toLowerCase()),
221
- startsWith: (d, a) => String(d ?? "").toLowerCase().startsWith(String(a).toLowerCase()),
222
- endsWith: (d, a) => String(d ?? "").toLowerCase().endsWith(String(a).toLowerCase()),
223
- equals: (d, a) => String(d ?? "").toLowerCase() === String(a).toLowerCase(),
224
- notEquals: (d, a) => String(d ?? "").toLowerCase() !== String(a).toLowerCase()
225
- }, Qe = (d = !0) => {
226
- const a = ["overflow-x-auto", "w-full"];
227
- return d && a.push("border", "border-gray-100", "rounded"), a;
228
- }, Xe = (d) => {
229
- const a = ["min-w-full", "text-left", "relative"];
230
- return d === "sm" ? a.push("text-xs") : d === "lg" ? a.push("text-base") : a.push("text-sm"), a;
231
- }, X = (d, a, t = "none", o = "default", g) => {
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 o === "minimal" ? f.push(
234
- g || "bg-gray-50",
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
- g || "bg-gray-100",
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
- ), a && 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;
252
- }, Y = (d, a, t = "none", o) => {
253
- const g = ["border-b", "border-gray-100", "text-gray-900"];
254
- return o && g.push(o), a && g.push("border-r"), t === "always" ? g.push("border-r", "border-r-gray-200", "last:border-r-0") : (t === "hover" || t === "hover-table") && g.push("border-r", "border-r-transparent", "last:border-r-0"), d === "sm" ? g.push("px-1.5", "py-1") : d === "lg" ? g.push("px-4", "py-3") : g.push("px-2", "py-1.5"), g;
255
- }, Ye = (d, a, t, o, g = !1) => {
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 g && f.push("group"), o ? f.push("bg-primary-25") : d && t && f.push("bg-gray-50"), a && (o ? f.push("hover:bg-primary-25-hover", "transition-colors") : f.push("hover:bg-gray-50", "transition-colors")), f;
258
- }, U = (d) => {
259
- const a = ["w-3.5", "h-3.5", "inline-block", "ml-1"];
260
- return d ? a.push("text-primary-base") : a.push("text-gray-400"), a.push("transition-transform", "duration-200"), a;
261
- }, D = (d) => {
262
- const a = ["text-center"];
263
- return d === "sm" ? a.push("w-8") : d === "lg" ? a.push("w-14") : a.push("w-12"), a;
264
- }, me = (d) => D(d), Ze = () => [
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
- ], Z = (d) => {
275
- const a = ["bg-gray-100", "border-b", "border-gray-200"];
276
- return d === "sm" ? a.push("px-1.5", "py-1") : d === "lg" ? a.push("px-4", "py-2") : a.push("px-2", "py-1.5"), a;
277
- }, De = { class: "flex items-center gap-4" }, et = { class: "text-gray-600" }, tt = ["value"], st = ["value"], rt = { class: "flex items-center gap-1" }, lt = ["disabled"], ot = { class: "px-2 text-gray-600" }, at = ["disabled"], nt = /* @__PURE__ */ ee({
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: a }) {
299
- const t = d, o = a, g = Ce(), f = y(() => Math.ceil(t.totalRecords / t.rows)), R = y(() => Math.floor(t.first / t.rows) + 1), te = y(() => t.totalRecords === 0 ? 0 : t.first + 1), se = y(() => Math.min(t.first + t.rows, t.totalRecords)), B = y(() => t.first === 0), z = y(() => t.first + t.rows >= t.totalRecords), T = y(() => Ze()), O = (m) => {
300
- m < 0 || m >= t.totalRecords || (o("update:first", m), o("page", {
301
- first: m,
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(m / t.rows),
348
+ page: Math.floor(C / t.rows),
304
349
  pageCount: f.value
305
350
  }));
306
- }, A = () => {
307
- O(Math.max(0, t.first - t.rows));
308
- }, K = () => {
309
- O(t.first + t.rows);
310
- }, F = (m) => {
311
- const w = parseInt(m.target.value);
312
- o("update:rows", w), o("update:first", 0), o("page", {
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: w,
359
+ rows: x,
315
360
  page: 0,
316
- pageCount: Math.ceil(t.totalRecords / w)
361
+ pageCount: Math.ceil(t.totalRecords / x)
317
362
  });
318
363
  };
319
- return (m, w) => (l(), i("div", {
320
- class: b(T.value)
364
+ return (C, x) => (l(), o("div", {
365
+ class: b(A.value)
321
366
  }, [
322
- c("div", De, [
323
- c("span", et, S(te.value) + "–" + S(se.value) + " of " + S(d.totalRecords), 1),
324
- d.rowsPerPageOptions.length > 1 ? (l(), i("select", {
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: F
373
+ onChange: O
329
374
  }, [
330
- (l(!0), i(_, null, E(d.rowsPerPageOptions, (q) => (l(), i("option", {
331
- key: q,
332
- value: q
333
- }, S(p(g)("ui.dataTable.perPage", { count: q })), 9, st))), 128))
334
- ], 40, tt)) : h("", !0)
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", rt, [
381
+ c("div", bt, [
337
382
  c("button", {
338
- disabled: B.value,
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: A
385
+ onClick: G
341
386
  }, [
342
- (l(), C(k(p(He)), { class: "w-4 h-4 text-gray-600" }))
343
- ], 8, lt),
344
- c("span", ot, S(R.value) + " / " + S(f.value), 1),
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: z.value,
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: K
393
+ onClick: J
349
394
  }, [
350
- (l(), C(k(p(ke)), { class: "w-4 h-4 text-gray-600" }))
351
- ], 8, at)
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
- }), it = {
400
+ }), Ct = {
356
401
  key: 0,
357
402
  class: "mb-3"
358
- }, dt = { key: 0 }, ut = {
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
- }, pt = {
406
+ }, St = {
362
407
  key: 1,
363
408
  class: "w-5 h-5 rounded border border-gray-300 bg-white"
364
- }, ct = ["onClick"], ft = {
409
+ }, Rt = ["onClick"], Bt = {
365
410
  key: 1,
366
411
  class: "inline-flex items-center gap-1"
367
- }, yt = { key: 0 }, gt = ["value", "placeholder", "onInput"], ht = { key: 1 }, bt = ["onClick"], vt = ["onClick"], mt = {
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
- }, wt = {
415
+ }, qt = {
371
416
  key: 1,
372
417
  class: "w-5 h-5 rounded border border-gray-300 bg-white"
373
- }, Ct = ["onClick"], kt = {
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
- }, St = {
421
+ }, Tt = {
377
422
  key: 1,
378
423
  class: "w-5 h-5 rounded-full border border-gray-300 bg-white"
379
- }, xt = ["onClick"], Rt = { key: 0 }, _t = ["colspan"], Bt = { key: 2 }, Ft = ["colspan"], Mt = { class: "flex items-center justify-center gap-2 text-gray-500" }, Pt = { key: 3 }, Ot = ["colspan"], qt = { class: "text-gray-400" }, $t = { key: 4 }, Lt = ["colspan"], Et = ["disabled"], zt = {
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
- }, Tt = /* @__PURE__ */ ee({
463
+ }, Cs = /* @__PURE__ */ fe({
383
464
  __name: "OneDataTable",
384
- props: Je,
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: a }) {
404
- const t = d, o = a, g = we(), f = Ce(), R = N([]);
405
- je(Se, { registerColumn: (e) => {
406
- R.value.push(e);
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 = R.value.indexOf(e);
409
- r > -1 && R.value.splice(r, 1);
489
+ const r = S.value.indexOf(e);
490
+ r > -1 && S.value.splice(r, 1);
410
491
  } });
411
- const B = N(t.first), z = N(t.rows), T = N(t.sortField), O = N(t.sortOrder);
412
- W(
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
- B.value = e;
496
+ F.value = e;
416
497
  }
417
- ), W(
498
+ ), Q(
418
499
  () => t.rows,
419
500
  (e) => {
420
- z.value = e;
501
+ V.value = e;
421
502
  }
422
- ), W(
503
+ ), Q(
423
504
  () => t.sortField,
424
505
  (e) => {
425
- T.value = e;
506
+ A.value = e;
426
507
  }
427
- ), W(
508
+ ), Q(
428
509
  () => t.sortOrder,
429
510
  (e) => {
430
- O.value = e;
511
+ j.value = e;
431
512
  }
432
513
  );
433
- const A = y(() => B.value), K = y(() => z.value), F = y(() => T.value), m = y(() => O.value), w = (e, r) => r ? r.split(".").reduce((s, u) => s == null ? void 0 : s[u], e) : e, q = (e) => t.dataKey ? w(e, t.dataKey) : e, x = (e, r) => e == null || r == null ? e === r : t.dataKey ? w(e, t.dataKey) === w(r, t.dataKey) : e === r, xe = (e, r) => t.dataKey ? w(e, t.dataKey) : r, M = y(() => R.value.some((e) => e.props.expander)), $ = y(() => !!t.selectionMode), re = y(() => t.selectionMode === "multiple"), j = y(() => R.value.filter((e) => !e.props.expander)), V = y(
434
- () => R.value.length + ($.value ? 1 : 0) + (M.value ? 1 : 0)
435
- ), le = y(() => {
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 n = r.global.value;
523
+ const a = r.global.value;
443
524
  e = e.filter(
444
- (v) => t.globalFilterFields.some(
445
- (G) => ve.contains(w(v, G), n)
525
+ (m) => t.globalFilterFields.some(
526
+ (oe) => Be.contains(x(m, oe), a)
446
527
  )
447
528
  );
448
529
  }
449
- for (const [n, v] of Object.entries(r)) {
450
- if (n === "global" || !v.value)
530
+ for (const [a, m] of Object.entries(r)) {
531
+ if (a === "global" || !m.value)
451
532
  continue;
452
- const G = v.matchMode || "contains", ce = ve[G];
453
- ce && (e = e.filter((Te) => ce(w(Te, n), v.value)));
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
- }), Re = y(() => {
457
- const e = le.value;
458
- return t.lazy || !F.value || !m.value ? e : [...e].sort((r, s) => {
459
- const u = w(r, F.value), n = w(s, F.value);
460
- if (u == null && n == 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 (n == null)
545
+ if (a == null)
465
546
  return -1;
466
- let v;
467
- return typeof u == "number" && typeof n == "number" ? v = u - n : v = String(u).localeCompare(String(n)), m.value === 1 ? v : -v;
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
- }), oe = y(() => t.totalRecords ?? le.value.length), L = y(() => {
470
- const e = Re.value;
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 = A.value, s = r + K.value;
553
+ const r = G.value, s = r + J.value;
473
554
  return e.slice(r, s);
474
555
  }
475
556
  return e;
476
- }), _e = (e) => {
557
+ }), qe = (e) => {
477
558
  let r;
478
- F.value === e ? m.value === 1 ? r = -1 : m.value === -1 ? r = null : r = 1 : r = 1, T.value = e, O.value = r, o("update:sortField", e), o("update:sortOrder", r), o("sort", { field: e, order: r }), !t.lazy && t.paginator && (B.value = 0, o("update:first", 0));
479
- }, ae = (e) => e.props.sortField || e.props.field, Be = (e) => F.value === ae(e), I = (e) => t.selection ? t.selectionMode === "single" ? x(t.selection, e) : t.selectionMode === "multiple" ? t.selection.some((r) => x(r, e)) : !1 : !1, ne = (e, r, s) => {
480
- if (o("row-click", { originalEvent: e, data: r, index: s }), t.selectionMode === "single") {
481
- const u = x(t.selection, r) ? null : r;
482
- o("update:selection", u), u ? o("row-select", { originalEvent: e, data: r }) : o("row-unselect", { originalEvent: e, data: r });
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
- }, Fe = (e, r) => {
565
+ }, se = (e, r) => {
485
566
  if (e.stopPropagation(), t.selectionMode === "multiple") {
486
- const s = t.selection || [], u = s.some((v) => x(v, r));
487
- let n;
488
- u ? (n = s.filter((v) => !x(v, r)), o("row-unselect", { originalEvent: e, data: r })) : (n = [...s, r], o("row-select", { originalEvent: e, data: r })), o("update:selection", n);
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
- }, ie = y(() => {
571
+ }, re = y(() => {
491
572
  if (t.selectionMode !== "multiple" || !t.selection)
492
573
  return !1;
493
574
  const e = t.selection;
494
- return L.value.length > 0 && L.value.every((r) => e.some((s) => x(s, r)));
495
- }), Me = (e) => {
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 (ie.value) {
579
+ if (re.value) {
499
580
  const s = r.filter(
500
- (u) => !L.value.some((n) => x(u, n))
581
+ (u) => !P.value.some((a) => M(u, a))
501
582
  );
502
- o("update:selection", s);
583
+ i("update:selection", s);
503
584
  } else {
504
585
  const s = [...r];
505
- L.value.forEach((u) => {
506
- s.some((n) => x(n, u)) || s.push(u);
507
- }), o("update:selection", s);
586
+ P.value.forEach((u) => {
587
+ s.some((a) => M(a, u)) || s.push(u);
588
+ }), i("update:selection", s);
508
589
  }
509
- }, H = (e) => {
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) => x(r, e));
594
+ return t.expandedRows.some((r) => M(r, e));
514
595
  if (t.dataKey) {
515
- const r = String(q(e));
596
+ const r = String(T(e));
516
597
  return !!t.expandedRows[r];
517
598
  }
518
599
  return !1;
519
- }, Pe = (e, r) => {
600
+ }, le = (e, r) => {
520
601
  e.stopPropagation();
521
- const s = H(r);
602
+ const s = N(r);
522
603
  if (Array.isArray(t.expandedRows)) {
523
604
  let u;
524
- s ? (u = t.expandedRows.filter((n) => !x(n, r)), o("row-collapse", { originalEvent: e, data: r })) : (u = [...t.expandedRows, r], o("row-expand", { originalEvent: e, data: r })), o("update:expandedRows", u);
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(q(r)), n = { ...t.expandedRows };
527
- s ? (delete n[u], o("row-collapse", { originalEvent: e, data: r })) : (n[u] = !0, o("row-expand", { originalEvent: e, data: r })), o("update:expandedRows", n);
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
- }, Oe = (e, r, s) => {
530
- var n;
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 || ((n = t.filters[e]) == null ? void 0 : n.matchMode) || "contains" }
616
+ [e]: { value: r, matchMode: s || ((a = t.filters[e]) == null ? void 0 : a.matchMode) || "contains" }
536
617
  };
537
- o("update:filters", u), t.lazy && o("filter", { filters: u }), t.paginator && (B.value = 0, o("update:first", 0));
538
- }, de = (e) => {
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
- }, qe = (e) => () => {
542
- t.filters && (o("update:filters", { ...t.filters }), t.lazy && o("filter", { filters: t.filters }), t.paginator && (B.value = 0, o("update:first", 0)));
543
- }, $e = (e) => {
544
- B.value = e, o("update:first", e);
545
- }, Le = (e) => {
546
- z.value = e, o("update:rows", e);
547
- }, ue = y(() => {
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(j.value), s = [];
552
- return $.value && s.push(""), M.value && s.push(""), [...s, ...r];
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(""), M.value && e.push(""), j.value.forEach((r) => {
637
+ return $.value && e.push(""), R.value && e.push(""), te.value.forEach((r) => {
557
638
  e.push(r.props.width || "");
558
639
  }), e;
559
- }), pe = y(() => ue.value.some((e) => e !== "" && e != null)), Ee = y(() => t.wrapperClass ? ["overflow-x-auto", "w-full", t.wrapperClass] : t.verticalBorders === "hover-table" ? ["overflow-x-auto", "w-full", "border", "border-transparent", "rounded"] : Qe(t.wrapperBordered)), ze = y(() => {
560
- const e = Xe(t.size);
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
- return (e, r) => (l(), i("div", null, [
564
- Ne(c("div", null, [
565
- P(e.$slots, "default", {}, void 0, !0)
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
- [Ae, !1]
660
+ [Ie, !1]
568
661
  ]),
569
- p(g).header ? (l(), i("div", it, [
570
- P(e.$slots, "header", {}, void 0, !0)
571
- ])) : h("", !0),
572
- c("div", {
573
- class: b([...Ee.value, e.verticalBorders === "hover-table" ? "vb-hover" : ""])
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
- ...ze.value,
777
+ ...Ae.value,
578
778
  e.verticalBorders !== "none" ? "border-separate border-spacing-0" : "border-collapse",
579
779
  e.verticalBorders === "hover" ? "vb-hover" : "",
580
- pe.value ? "table-fixed" : ""
780
+ Ce.value ? "table-fixed" : ""
581
781
  ])
582
782
  }, [
583
- pe.value ? (l(), i("colgroup", dt, [
584
- (l(!0), i(_, null, E(ue.value, (s, u) => (l(), i("col", {
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: J(s ? { width: s } : {})
786
+ style: ae(s ? { width: s } : {})
587
787
  }, null, 4))), 128))
588
- ])) : h("", !0),
788
+ ])) : g("", !0),
589
789
  c("thead", null, [
590
790
  c("tr", null, [
591
- $.value ? (l(), i("th", {
791
+ $.value ? (l(), o("th", {
592
792
  key: 0,
593
793
  class: b([
594
- ...p(X)(e.size, !1, e.verticalBorders, e.headerVariant, e.headerBgClass),
595
- ...p(D)(e.size)
794
+ ...p(ie)(e.size, !1, e.verticalBorders, e.headerVariant, e.headerBgClass),
795
+ ...p(ce)(e.size)
596
796
  ])
597
797
  }, [
598
- re.value ? (l(), i("div", {
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) => Me(s))
801
+ onClick: r[0] || (r[0] = (s) => me(s))
602
802
  }, [
603
- ie.value ? (l(), i("div", ut, [
604
- (l(), C(k(p(he)), { class: "w-3.5 h-3.5" }))
605
- ])) : (l(), i("div", pt))
606
- ])) : h("", !0)
607
- ], 2)) : h("", !0),
608
- M.value ? (l(), i("th", {
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(X)(e.size, !1, e.verticalBorders, e.headerVariant, e.headerBgClass),
612
- ...p(me)(e.size)
811
+ ...p(ie)(e.size, !1, e.verticalBorders, e.headerVariant, e.headerBgClass),
812
+ ...p(Me)(e.size)
613
813
  ])
614
- }, null, 2)) : h("", !0),
615
- (l(!0), i(_, null, E(j.value, (s, u) => (l(), i("th", {
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(X)(e.size, s.props.sortable, e.verticalBorders, e.headerVariant, e.headerBgClass),
818
+ ...p(ie)(e.size, s.props.sortable, e.verticalBorders, e.headerVariant, e.headerBgClass),
619
819
  s.props.headerClass
620
820
  ]),
621
- style: J([s.props.headerStyle, s.props.width ? { width: s.props.width } : {}]),
622
- onClick: (n) => s.props.sortable ? _e(ae(s)) : void 0
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(), C(k(s.slots.header), { key: 0 })) : (l(), i("span", ft, [
625
- Q(S(s.props.header) + " ", 1),
626
- s.props.sortable ? (l(), i(_, { key: 0 }, [
627
- Be(s) ? m.value === 1 ? (l(), C(k(p(Ue)), {
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(U)(!0))
630
- }, null, 8, ["class"])) : m.value === -1 ? (l(), C(k(p(ge)), {
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(U)(!0))
633
- }, null, 8, ["class"])) : (l(), C(k(p(be)), {
832
+ class: b(p(ee)(!0))
833
+ }, null, 8, ["class"])) : (l(), v(w(p(Re)), {
634
834
  key: 3,
635
- class: b(p(U)(!1))
636
- }, null, 8, ["class"])) : (l(), C(k(p(be)), {
835
+ class: b(p(ee)(!1))
836
+ }, null, 8, ["class"])) : (l(), v(w(p(Re)), {
637
837
  key: 0,
638
- class: b(p(U)(!1))
838
+ class: b(p(ee)(!1))
639
839
  }, null, 8, ["class"]))
640
- ], 64)) : h("", !0)
840
+ ], 64)) : g("", !0)
641
841
  ]))
642
- ], 14, ct))), 128))
842
+ ], 14, Rt))), 128))
643
843
  ]),
644
- e.filterDisplay === "row" ? (l(), i("tr", yt, [
645
- $.value ? (l(), i("th", {
844
+ e.filterDisplay === "row" ? (l(), o("tr", Mt, [
845
+ $.value ? (l(), o("th", {
646
846
  key: 0,
647
- class: b(p(Z)(e.size))
648
- }, null, 2)) : h("", !0),
649
- M.value ? (l(), i("th", {
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(Z)(e.size))
652
- }, null, 2)) : h("", !0),
653
- (l(!0), i(_, null, E(j.value, (s, u) => (l(), i("th", {
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(Z)(e.size))
855
+ class: b(p(ue)(e.size))
656
856
  }, [
657
- s.props.filterable && s.slots.filter ? (l(), C(k(s.slots.filter), {
857
+ s.props.filterable && s.slots.filter ? (l(), v(w(s.slots.filter), {
658
858
  key: 0,
659
- filterModel: de(
859
+ filterModel: ke(
660
860
  s.props.filterField || s.props.field
661
861
  ),
662
- filterCallback: qe(
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(), i("input", {
865
+ }, null, 8, ["filterModel", "filterCallback"])) : s.props.filterable && s.props.field ? (l(), o("input", {
666
866
  key: 1,
667
867
  type: "text",
668
- value: de(
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: (n) => Oe(
873
+ onInput: (a) => je(
674
874
  s.props.filterField || s.props.field,
675
- n.target.value
875
+ a.target.value
676
876
  )
677
- }, null, 40, gt)) : h("", !0)
877
+ }, null, 40, Ft)) : g("", !0)
678
878
  ], 2))), 128))
679
- ])) : h("", !0)
879
+ ])) : g("", !0)
680
880
  ]),
681
- !e.loading && L.value.length > 0 ? (l(), i("tbody", ht, [
682
- (l(!0), i(_, null, E(L.value, (s, u) => (l(), i(_, {
683
- key: xe(s, u)
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(Ye)(
887
+ ...p(dt)(
688
888
  e.striped,
689
889
  e.hoverable,
690
890
  u % 2 === 1,
691
- I(s),
891
+ q(s),
692
892
  !1
693
893
  ),
694
894
  e.selectionMode ? "cursor-pointer" : ""
695
895
  ]),
696
- onClick: (n) => ne(n, s, u)
896
+ onClick: (a) => Z(a, s, u)
697
897
  }, [
698
- $.value ? (l(), i("td", {
898
+ $.value ? (l(), o("td", {
699
899
  key: 0,
700
900
  class: b([
701
- ...p(Y)(e.size, e.bordered, e.verticalBorders, e.bodyBgClass),
702
- ...p(D)(e.size)
901
+ ...p(de)(e.size, e.bordered, e.verticalBorders, e.bodyBgClass),
902
+ ...p(ce)(e.size)
703
903
  ])
704
904
  }, [
705
- re.value ? (l(), i("div", {
905
+ X.value ? (l(), o("div", {
706
906
  key: 0,
707
907
  class: "flex items-center justify-center cursor-pointer",
708
- onClick: fe((n) => Fe(n, s), ["stop"])
908
+ onClick: U((a) => se(a, s), ["stop"])
709
909
  }, [
710
- I(s) ? (l(), i("div", mt, [
711
- (l(), C(k(p(he)), { class: "w-3.5 h-3.5" }))
712
- ])) : (l(), i("div", wt))
713
- ], 8, vt)) : (l(), i("div", {
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: fe((n) => ne(n, s, u), ["stop"])
916
+ onClick: U((a) => Z(a, s, u), ["stop"])
717
917
  }, [
718
- I(s) ? (l(), i("div", kt, [...r[3] || (r[3] = [
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(), i("div", St))
721
- ], 8, Ct))
722
- ], 2)) : h("", !0),
723
- M.value ? (l(), i("td", {
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(Y)(e.size, e.bordered, e.verticalBorders, e.bodyBgClass),
727
- ...p(me)(e.size)
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: (n) => Pe(n, s)
932
+ onClick: (a) => le(a, s)
733
933
  }, [
734
- (l(), C(k(H(s) ? p(ge) : p(ke)), { class: "w-4 h-4 text-gray-500" }))
735
- ], 8, xt)
736
- ], 2)) : h("", !0),
737
- (l(!0), i(_, null, E(j.value, (n, v) => (l(), i("td", {
738
- key: v,
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(Y)(e.size, e.bordered, e.verticalBorders, e.bodyBgClass),
741
- n.props.bodyClass
940
+ ...p(de)(e.size, e.bordered, e.verticalBorders, e.bodyBgClass),
941
+ a.props.bodyClass
742
942
  ]),
743
- style: J(n.props.bodyStyle)
943
+ style: ae(a.props.bodyStyle)
744
944
  }, [
745
- n.slots.body ? (l(), C(k(n.slots.body), {
945
+ a.slots.body ? (l(), v(w(a.slots.body), {
746
946
  key: 0,
747
947
  data: s,
748
- field: n.props.field,
948
+ field: a.props.field,
749
949
  index: u
750
- }, null, 8, ["data", "field", "index"])) : n.props.field ? (l(), i(_, { key: 1 }, [
751
- Q(S(w(s, n.props.field)), 1)
752
- ], 64)) : h("", !0)
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, bt),
755
- M.value && H(s) ? (l(), i("tr", Rt, [
954
+ ], 10, Pt),
955
+ R.value && N(s) ? (l(), o("tr", zt, [
756
956
  c("td", {
757
- colspan: V.value,
957
+ colspan: Y.value,
758
958
  class: "p-0"
759
959
  }, [
760
- P(e.$slots, "expansion", {
960
+ B(e.$slots, "expansion", {
761
961
  data: s,
762
962
  index: u
763
963
  }, void 0, !0)
764
- ], 8, _t)
765
- ])) : h("", !0)
964
+ ], 8, Vt)
965
+ ])) : g("", !0)
766
966
  ], 64))), 128))
767
- ])) : e.loading ? (l(), i("tbody", Bt, [
967
+ ])) : e.loading ? (l(), o("tbody", At, [
768
968
  c("tr", null, [
769
969
  c("td", {
770
- colspan: V.value,
970
+ colspan: Y.value,
771
971
  class: "text-center py-12"
772
972
  }, [
773
- P(e.$slots, "loading", {}, () => [
774
- c("div", Mt, [
775
- Ke(ye, { class: "w-5 h-5" }),
776
- c("span", null, S(p(f)("ui.dataTable.loading")), 1)
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, Ft)
979
+ ], 8, Kt)
780
980
  ])
781
- ])) : (l(), i("tbody", Pt, [
981
+ ])) : (l(), o("tbody", Ut, [
782
982
  c("tr", null, [
783
983
  c("td", {
784
- colspan: V.value,
984
+ colspan: Y.value,
785
985
  class: "text-center py-12"
786
986
  }, [
787
- P(e.$slots, "empty", {}, () => [
788
- c("span", qt, S(p(f)("ui.dataTable.noRecords")), 1)
987
+ B(e.$slots, "empty", {}, () => [
988
+ c("span", Ht, k(p(f)("ui.dataTable.noRecords")), 1)
789
989
  ], !0)
790
- ], 8, Ot)
990
+ ], 8, Qt)
791
991
  ])
792
992
  ])),
793
- e.hasNextPage && !e.loading ? (l(), i("tfoot", $t, [
993
+ e.hasNextPage && !e.loading ? (l(), o("tfoot", Gt, [
794
994
  c("tr", null, [
795
995
  c("td", {
796
- colspan: V.value,
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) => o("load:next"))
1002
+ onClick: r[1] || (r[1] = (s) => i("load:next"))
803
1003
  }, [
804
- e.loadingNext ? (l(), C(ye, {
1004
+ e.loadingNext ? (l(), v(I, {
805
1005
  key: 0,
806
1006
  class: "w-4 h-4"
807
- })) : h("", !0),
808
- Q(" " + S(e.loadMoreLabel || p(f)("ui.dataTable.showMore")), 1)
809
- ], 8, Et)
810
- ], 8, Lt)
1007
+ })) : g("", !0),
1008
+ W(" " + k(e.loadMoreLabel || p(f)("ui.dataTable.showMore")), 1)
1009
+ ], 8, Xt)
1010
+ ], 8, Jt)
811
1011
  ])
812
- ])) : h("", !0)
1012
+ ])) : g("", !0)
813
1013
  ], 2)
814
- ], 2),
815
- e.paginator && oe.value > 0 ? (l(), C(nt, {
816
- key: 1,
817
- first: A.value,
818
- rows: K.value,
819
- "total-records": oe.value,
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": $e,
822
- "onUpdate:rows": Le,
823
- onPage: r[2] || (r[2] = (s) => o("page", s))
824
- }, null, 8, ["first", "rows", "total-records", "rows-per-page-options"])) : h("", !0),
825
- p(g).footer ? (l(), i("div", zt, [
826
- P(e.$slots, "footer", {}, void 0, !0)
827
- ])) : h("", !0)
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 Ht = /* @__PURE__ */ Ie(Tt, [["__scopeId", "data-v-abd207a8"]]), Gt = /* @__PURE__ */ ee({
1031
+ const Ps = /* @__PURE__ */ tt(Cs, [["__scopeId", "data-v-f7613b9d"]]), Ls = /* @__PURE__ */ fe({
832
1032
  __name: "OneColumn",
833
- props: Ge,
1033
+ props: rt,
834
1034
  setup(d) {
835
- const a = d, t = we(), o = Ve(Se), g = {
836
- props: a,
1035
+ const n = d, t = $e(), i = De(Le), h = {
1036
+ props: n,
837
1037
  slots: t
838
1038
  };
839
- return o && o.registerColumn(g), We(() => {
840
- o && o.unregisterColumn(g);
841
- }), (f, R) => P(f.$slots, "default");
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
- Gt as OneColumn,
846
- Ht as OneDataTable,
847
- nt as OneDataTablePaginator
1045
+ Ls as OneColumn,
1046
+ Ps as OneDataTable,
1047
+ wt as OneDataTablePaginator
848
1048
  };