@oneb/ui-vue 0.2.28 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,9 @@
1
- import { openBlock as l, createElementBlock as i, createElementVNode as c, defineComponent as ee, computed as y, normalizeClass as v, toDisplayString as R, Fragment as x, renderList as L, createCommentVNode as h, createBlock as k, resolveDynamicComponent as C, unref as p, useSlots as me, ref as N, provide as ze, watch as V, withDirectives as je, renderSlot as M, vShow as Ne, normalizeStyle as J, createTextVNode as Q, withModifiers as ce, createVNode as Ae, inject as Ke, onBeforeUnmount as Te } from "vue";
2
- import { b as we, r as Ve, a as fe } from "./ChevronRightIcon-8df1af46.js";
3
- import { S as ye } from "./SpinnerIcon-516264ba.js";
4
- import { _ as We } from "./_plugin-vue_export-helper-dad06003.js";
5
- function ge(d, a) {
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 R, renderList as E, unref as p, createCommentVNode as h, createBlock as k, resolveDynamicComponent as C, useSlots as we, ref as T, provide as Ne, watch as W, withDirectives as Te, 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 { u as ke } from "./useI18n-0a69755a.js";
3
+ import { b as Ce, r as Ue, a as ye } from "./ChevronRightIcon-8df1af46.js";
4
+ import { S as ge } from "./SpinnerIcon-516264ba.js";
5
+ import { _ as Ie } from "./_plugin-vue_export-helper-dad06003.js";
6
+ function he(d, a) {
6
7
  return l(), i("svg", {
7
8
  xmlns: "http://www.w3.org/2000/svg",
8
9
  fill: "none",
@@ -18,7 +19,7 @@ function ge(d, a) {
18
19
  })
19
20
  ]);
20
21
  }
21
- function Ue(d, a) {
22
+ function He(d, a) {
22
23
  return l(), i("svg", {
23
24
  xmlns: "http://www.w3.org/2000/svg",
24
25
  fill: "none",
@@ -34,7 +35,7 @@ function Ue(d, a) {
34
35
  })
35
36
  ]);
36
37
  }
37
- function he(d, a) {
38
+ function be(d, a) {
38
39
  return l(), i("svg", {
39
40
  xmlns: "http://www.w3.org/2000/svg",
40
41
  fill: "none",
@@ -50,7 +51,7 @@ function he(d, a) {
50
51
  })
51
52
  ]);
52
53
  }
53
- const He = {
54
+ const Ge = {
54
55
  field: {
55
56
  type: String,
56
57
  required: !1
@@ -99,7 +100,7 @@ const He = {
99
100
  type: [String, Object],
100
101
  required: !1
101
102
  }
102
- }, Ie = {
103
+ }, Je = {
103
104
  value: {
104
105
  type: Array,
105
106
  default: () => []
@@ -198,7 +199,7 @@ const He = {
198
199
  },
199
200
  loadMoreLabel: {
200
201
  type: String,
201
- default: "Show more"
202
+ default: ""
202
203
  },
203
204
  colWidths: {
204
205
  type: [Array, Function],
@@ -228,16 +229,16 @@ const He = {
228
229
  type: Boolean,
229
230
  default: !0
230
231
  }
231
- }, ke = Symbol("OneDataTable"), ve = {
232
+ }, Se = Symbol("OneDataTable"), ve = {
232
233
  contains: (d, a) => String(d ?? "").toLowerCase().includes(String(a).toLowerCase()),
233
234
  startsWith: (d, a) => String(d ?? "").toLowerCase().startsWith(String(a).toLowerCase()),
234
235
  endsWith: (d, a) => String(d ?? "").toLowerCase().endsWith(String(a).toLowerCase()),
235
236
  equals: (d, a) => String(d ?? "").toLowerCase() === String(a).toLowerCase(),
236
237
  notEquals: (d, a) => String(d ?? "").toLowerCase() !== String(a).toLowerCase()
237
- }, Ge = (d = !0) => {
238
+ }, Qe = (d = !0) => {
238
239
  const a = ["overflow-x-auto", "w-full"];
239
240
  return d && a.push("border", "border-gray-100", "rounded"), a;
240
- }, Je = (d) => {
241
+ }, Xe = (d) => {
241
242
  const a = ["min-w-full", "text-left", "relative"];
242
243
  return d === "sm" ? a.push("text-xs") : d === "lg" ? a.push("text-base") : a.push("text-sm"), a;
243
244
  }, X = (d, a, t = "none", o = "default", g) => {
@@ -264,16 +265,16 @@ const He = {
264
265
  }, Y = (d, a, t = "none", o) => {
265
266
  const g = ["border-b", "border-gray-100", "text-gray-900"];
266
267
  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;
267
- }, Qe = (d, a, t, o, g = !1) => {
268
+ }, Ye = (d, a, t, o, g = !1) => {
268
269
  const f = [];
269
270
  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;
270
- }, W = (d) => {
271
+ }, U = (d) => {
271
272
  const a = ["w-3.5", "h-3.5", "inline-block", "ml-1"];
272
273
  return d ? a.push("text-primary-base") : a.push("text-gray-400"), a.push("transition-transform", "duration-200"), a;
273
274
  }, D = (d) => {
274
275
  const a = ["text-center"];
275
276
  return d === "sm" ? a.push("w-8") : d === "lg" ? a.push("w-14") : a.push("w-12"), a;
276
- }, be = (d) => D(d), Xe = () => [
277
+ }, me = (d) => D(d), Ze = () => [
277
278
  "flex",
278
279
  "items-center",
279
280
  "justify-between",
@@ -286,7 +287,7 @@ const He = {
286
287
  ], Z = (d) => {
287
288
  const a = ["bg-gray-100", "border-b", "border-gray-200"];
288
289
  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;
289
- }, Ye = { class: "flex items-center gap-4" }, Ze = { class: "text-gray-600" }, De = ["value"], et = ["value"], tt = { class: "flex items-center gap-1" }, st = ["disabled"], rt = { class: "px-2 text-gray-600" }, lt = ["disabled"], ot = /* @__PURE__ */ ee({
290
+ }, 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({
290
291
  __name: "OneDataTablePaginator",
291
292
  props: {
292
293
  first: {
@@ -308,18 +309,18 @@ const He = {
308
309
  },
309
310
  emits: ["update:first", "update:rows", "page"],
310
311
  setup(d, { emit: a }) {
311
- const t = d, o = a, g = y(() => Math.ceil(t.totalRecords / t.rows)), f = y(() => Math.floor(t.first / t.rows) + 1), U = y(() => t.totalRecords === 0 ? 0 : t.first + 1), te = y(() => Math.min(t.first + t.rows, t.totalRecords)), _ = y(() => t.first === 0), E = y(() => t.first + t.rows >= t.totalRecords), z = y(() => Xe()), P = (m) => {
312
+ const t = d, o = a, g = ke(), f = y(() => Math.ceil(t.totalRecords / t.rows)), _ = 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), j = y(() => Ze()), O = (m) => {
312
313
  m < 0 || m >= t.totalRecords || (o("update:first", m), o("page", {
313
314
  first: m,
314
315
  rows: t.rows,
315
316
  page: Math.floor(m / t.rows),
316
- pageCount: g.value
317
+ pageCount: f.value
317
318
  }));
318
319
  }, A = () => {
319
- P(Math.max(0, t.first - t.rows));
320
+ O(Math.max(0, t.first - t.rows));
320
321
  }, K = () => {
321
- P(t.first + t.rows);
322
- }, B = (m) => {
322
+ O(t.first + t.rows);
323
+ }, F = (m) => {
323
324
  const w = parseInt(m.target.value);
324
325
  o("update:rows", w), o("update:first", 0), o("page", {
325
326
  first: 0,
@@ -329,71 +330,71 @@ const He = {
329
330
  });
330
331
  };
331
332
  return (m, w) => (l(), i("div", {
332
- class: v(z.value)
333
+ class: b(j.value)
333
334
  }, [
334
- c("div", Ye, [
335
- c("span", Ze, R(U.value) + "–" + R(te.value) + " of " + R(d.totalRecords), 1),
335
+ c("div", De, [
336
+ c("span", et, S(te.value) + "–" + S(se.value) + " of " + S(d.totalRecords), 1),
336
337
  d.rowsPerPageOptions.length > 1 ? (l(), i("select", {
337
338
  key: 0,
338
339
  value: d.rows,
339
340
  class: "border border-gray-300 rounded px-2 py-1 text-sm bg-white focus:outline-none focus:ring-1 focus:ring-primary-glow",
340
- onChange: B
341
+ onChange: F
341
342
  }, [
342
- (l(!0), i(x, null, L(d.rowsPerPageOptions, (q) => (l(), i("option", {
343
+ (l(!0), i(R, null, E(d.rowsPerPageOptions, (q) => (l(), i("option", {
343
344
  key: q,
344
345
  value: q
345
- }, R(q) + " / page", 9, et))), 128))
346
- ], 40, De)) : h("", !0)
346
+ }, S(q) + " " + S(p(g)("dataTable.perPage")), 9, st))), 128))
347
+ ], 40, tt)) : h("", !0)
347
348
  ]),
348
- c("div", tt, [
349
+ c("div", rt, [
349
350
  c("button", {
350
- disabled: _.value,
351
+ disabled: B.value,
351
352
  class: "p-1.5 rounded hover:bg-gray-100 disabled:opacity-30 disabled:cursor-default transition-colors",
352
353
  onClick: A
353
354
  }, [
354
- (l(), k(C(p(Ue)), { class: "w-4 h-4 text-gray-600" }))
355
- ], 8, st),
356
- c("span", rt, R(f.value) + " / " + R(g.value), 1),
355
+ (l(), k(C(p(He)), { class: "w-4 h-4 text-gray-600" }))
356
+ ], 8, lt),
357
+ c("span", ot, S(_.value) + " / " + S(f.value), 1),
357
358
  c("button", {
358
- disabled: E.value,
359
+ disabled: z.value,
359
360
  class: "p-1.5 rounded hover:bg-gray-100 disabled:opacity-30 disabled:cursor-default transition-colors",
360
361
  onClick: K
361
362
  }, [
362
- (l(), k(C(p(we)), { class: "w-4 h-4 text-gray-600" }))
363
- ], 8, lt)
363
+ (l(), k(C(p(Ce)), { class: "w-4 h-4 text-gray-600" }))
364
+ ], 8, at)
364
365
  ])
365
366
  ], 2));
366
367
  }
367
- }), at = {
368
+ }), it = {
368
369
  key: 0,
369
370
  class: "mb-3"
370
- }, nt = { key: 0 }, it = {
371
+ }, dt = { key: 0 }, ut = {
371
372
  key: 0,
372
373
  class: "w-5 h-5 rounded bg-primary-base flex items-center justify-center text-white"
373
- }, dt = {
374
+ }, pt = {
374
375
  key: 1,
375
376
  class: "w-5 h-5 rounded border border-gray-300 bg-white"
376
- }, ut = ["onClick"], pt = {
377
+ }, ct = ["onClick"], ft = {
377
378
  key: 1,
378
379
  class: "inline-flex items-center gap-1"
379
- }, ct = { key: 0 }, ft = ["value", "placeholder", "onInput"], yt = { key: 1 }, gt = ["onClick"], ht = ["onClick"], vt = {
380
+ }, yt = { key: 0 }, gt = ["value", "placeholder", "onInput"], ht = { key: 1 }, bt = ["onClick"], vt = ["onClick"], mt = {
380
381
  key: 0,
381
382
  class: "w-5 h-5 rounded bg-primary-base flex items-center justify-center text-white"
382
- }, bt = {
383
+ }, wt = {
383
384
  key: 1,
384
385
  class: "w-5 h-5 rounded border border-gray-300 bg-white"
385
- }, mt = ["onClick"], wt = {
386
+ }, kt = ["onClick"], Ct = {
386
387
  key: 0,
387
388
  class: "w-5 h-5 rounded-full bg-primary-base flex items-center justify-center"
388
- }, kt = {
389
+ }, St = {
389
390
  key: 1,
390
391
  class: "w-5 h-5 rounded-full border border-gray-300 bg-white"
391
- }, Ct = ["onClick"], St = { key: 0 }, xt = ["colspan"], Rt = { key: 2 }, _t = ["colspan"], Bt = { class: "flex items-center justify-center gap-2 text-gray-500" }, Ft = { key: 3 }, Mt = ["colspan"], Pt = { key: 4 }, qt = ["colspan"], Ot = ["disabled"], $t = {
392
+ }, xt = ["onClick"], _t = { key: 0 }, Rt = ["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 = {
392
393
  key: 2,
393
394
  class: "mt-3"
394
- }, Lt = /* @__PURE__ */ ee({
395
+ }, jt = /* @__PURE__ */ ee({
395
396
  __name: "OneDataTable",
396
- props: Ie,
397
+ props: Je,
397
398
  emits: [
398
399
  "update:selection",
399
400
  "update:expandedRows",
@@ -413,38 +414,38 @@ const He = {
413
414
  "load:next"
414
415
  ],
415
416
  setup(d, { emit: a }) {
416
- const t = d, o = a, g = me(), f = N([]);
417
- ze(ke, { registerColumn: (e) => {
418
- f.value.push(e);
417
+ const t = d, o = a, g = we(), f = ke(), _ = T([]);
418
+ Ne(Se, { registerColumn: (e) => {
419
+ _.value.push(e);
419
420
  }, unregisterColumn: (e) => {
420
- const r = f.value.indexOf(e);
421
- r > -1 && f.value.splice(r, 1);
421
+ const r = _.value.indexOf(e);
422
+ r > -1 && _.value.splice(r, 1);
422
423
  } });
423
- const _ = N(t.first), E = N(t.rows), z = N(t.sortField), P = N(t.sortOrder);
424
- V(
424
+ const B = T(t.first), z = T(t.rows), j = T(t.sortField), O = T(t.sortOrder);
425
+ W(
425
426
  () => t.first,
426
427
  (e) => {
427
- _.value = e;
428
+ B.value = e;
428
429
  }
429
- ), V(
430
+ ), W(
430
431
  () => t.rows,
431
432
  (e) => {
432
- E.value = e;
433
+ z.value = e;
433
434
  }
434
- ), V(
435
+ ), W(
435
436
  () => t.sortField,
436
437
  (e) => {
437
- z.value = e;
438
+ j.value = e;
438
439
  }
439
- ), V(
440
+ ), W(
440
441
  () => t.sortOrder,
441
442
  (e) => {
442
- P.value = e;
443
+ O.value = e;
443
444
  }
444
445
  );
445
- const A = y(() => _.value), K = y(() => E.value), B = y(() => z.value), m = y(() => P.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, S = (e, r) => e == null || r == null ? e === r : t.dataKey ? w(e, t.dataKey) === w(r, t.dataKey) : e === r, Ce = (e, r) => t.dataKey ? w(e, t.dataKey) : r, F = y(() => f.value.some((e) => e.props.expander)), O = y(() => !!t.selectionMode), se = y(() => t.selectionMode === "multiple"), j = y(() => f.value.filter((e) => !e.props.expander)), T = y(
446
- () => f.value.length + (O.value ? 1 : 0) + (F.value ? 1 : 0)
447
- ), re = y(() => {
446
+ const A = y(() => B.value), K = y(() => z.value), F = y(() => j.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(() => _.value.some((e) => e.props.expander)), $ = y(() => !!t.selectionMode), re = y(() => t.selectionMode === "multiple"), N = y(() => _.value.filter((e) => !e.props.expander)), V = y(
447
+ () => _.value.length + ($.value ? 1 : 0) + (M.value ? 1 : 0)
448
+ ), le = y(() => {
448
449
  var s, u;
449
450
  if (t.lazy || !t.filters)
450
451
  return t.value;
@@ -453,92 +454,92 @@ const He = {
453
454
  if ((s = r.global) != null && s.value && ((u = t.globalFilterFields) != null && u.length)) {
454
455
  const n = r.global.value;
455
456
  e = e.filter(
456
- (b) => t.globalFilterFields.some(
457
- (G) => ve.contains(w(b, G), n)
457
+ (v) => t.globalFilterFields.some(
458
+ (G) => ve.contains(w(v, G), n)
458
459
  )
459
460
  );
460
461
  }
461
- for (const [n, b] of Object.entries(r)) {
462
- if (n === "global" || !b.value)
462
+ for (const [n, v] of Object.entries(r)) {
463
+ if (n === "global" || !v.value)
463
464
  continue;
464
- const G = b.matchMode || "contains", pe = ve[G];
465
- pe && (e = e.filter((Ee) => pe(w(Ee, n), b.value)));
465
+ const G = v.matchMode || "contains", ce = ve[G];
466
+ ce && (e = e.filter((je) => ce(w(je, n), v.value)));
466
467
  }
467
468
  return e;
468
- }), Se = y(() => {
469
- const e = re.value;
470
- return t.lazy || !B.value || !m.value ? e : [...e].sort((r, s) => {
471
- const u = w(r, B.value), n = w(s, B.value);
469
+ }), _e = y(() => {
470
+ const e = le.value;
471
+ return t.lazy || !F.value || !m.value ? e : [...e].sort((r, s) => {
472
+ const u = w(r, F.value), n = w(s, F.value);
472
473
  if (u == null && n == null)
473
474
  return 0;
474
475
  if (u == null)
475
476
  return 1;
476
477
  if (n == null)
477
478
  return -1;
478
- let b;
479
- return typeof u == "number" && typeof n == "number" ? b = u - n : b = String(u).localeCompare(String(n)), m.value === 1 ? b : -b;
479
+ let v;
480
+ return typeof u == "number" && typeof n == "number" ? v = u - n : v = String(u).localeCompare(String(n)), m.value === 1 ? v : -v;
480
481
  });
481
- }), le = y(() => t.totalRecords ?? re.value.length), $ = y(() => {
482
- const e = Se.value;
482
+ }), oe = y(() => t.totalRecords ?? le.value.length), L = y(() => {
483
+ const e = _e.value;
483
484
  if (t.paginator && !t.lazy) {
484
485
  const r = A.value, s = r + K.value;
485
486
  return e.slice(r, s);
486
487
  }
487
488
  return e;
488
- }), xe = (e) => {
489
+ }), Re = (e) => {
489
490
  let r;
490
- B.value === e ? m.value === 1 ? r = -1 : m.value === -1 ? r = null : r = 1 : r = 1, z.value = e, P.value = r, o("update:sortField", e), o("update:sortOrder", r), o("sort", { field: e, order: r }), !t.lazy && t.paginator && (_.value = 0, o("update:first", 0));
491
- }, oe = (e) => e.props.sortField || e.props.field, Re = (e) => B.value === oe(e), H = (e) => t.selection ? t.selectionMode === "single" ? S(t.selection, e) : t.selectionMode === "multiple" ? t.selection.some((r) => S(r, e)) : !1 : !1, ae = (e, r, s) => {
491
+ F.value === e ? m.value === 1 ? r = -1 : m.value === -1 ? r = null : r = 1 : r = 1, j.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));
492
+ }, 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) => {
492
493
  if (o("row-click", { originalEvent: e, data: r, index: s }), t.selectionMode === "single") {
493
- const u = S(t.selection, r) ? null : r;
494
+ const u = x(t.selection, r) ? null : r;
494
495
  o("update:selection", u), u ? o("row-select", { originalEvent: e, data: r }) : o("row-unselect", { originalEvent: e, data: r });
495
496
  }
496
- }, _e = (e, r) => {
497
+ }, Fe = (e, r) => {
497
498
  if (e.stopPropagation(), t.selectionMode === "multiple") {
498
- const s = t.selection || [], u = s.some((b) => S(b, r));
499
+ const s = t.selection || [], u = s.some((v) => x(v, r));
499
500
  let n;
500
- u ? (n = s.filter((b) => !S(b, r)), o("row-unselect", { originalEvent: e, data: r })) : (n = [...s, r], o("row-select", { originalEvent: e, data: r })), o("update:selection", n);
501
+ 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);
501
502
  }
502
- }, ne = y(() => {
503
+ }, ie = y(() => {
503
504
  if (t.selectionMode !== "multiple" || !t.selection)
504
505
  return !1;
505
506
  const e = t.selection;
506
- return $.value.length > 0 && $.value.every((r) => e.some((s) => S(s, r)));
507
- }), Be = (e) => {
507
+ return L.value.length > 0 && L.value.every((r) => e.some((s) => x(s, r)));
508
+ }), Me = (e) => {
508
509
  e.stopPropagation();
509
510
  const r = t.selection || [];
510
- if (ne.value) {
511
+ if (ie.value) {
511
512
  const s = r.filter(
512
- (u) => !$.value.some((n) => S(u, n))
513
+ (u) => !L.value.some((n) => x(u, n))
513
514
  );
514
515
  o("update:selection", s);
515
516
  } else {
516
517
  const s = [...r];
517
- $.value.forEach((u) => {
518
- s.some((n) => S(n, u)) || s.push(u);
518
+ L.value.forEach((u) => {
519
+ s.some((n) => x(n, u)) || s.push(u);
519
520
  }), o("update:selection", s);
520
521
  }
521
- }, I = (e) => {
522
+ }, H = (e) => {
522
523
  if (!t.expandedRows)
523
524
  return !1;
524
525
  if (Array.isArray(t.expandedRows))
525
- return t.expandedRows.some((r) => S(r, e));
526
+ return t.expandedRows.some((r) => x(r, e));
526
527
  if (t.dataKey) {
527
528
  const r = String(q(e));
528
529
  return !!t.expandedRows[r];
529
530
  }
530
531
  return !1;
531
- }, Fe = (e, r) => {
532
+ }, Pe = (e, r) => {
532
533
  e.stopPropagation();
533
- const s = I(r);
534
+ const s = H(r);
534
535
  if (Array.isArray(t.expandedRows)) {
535
536
  let u;
536
- s ? (u = t.expandedRows.filter((n) => !S(n, r)), o("row-collapse", { originalEvent: e, data: r })) : (u = [...t.expandedRows, r], o("row-expand", { originalEvent: e, data: r })), o("update:expandedRows", u);
537
+ 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);
537
538
  } else if (t.dataKey) {
538
539
  const u = String(q(r)), n = { ...t.expandedRows };
539
540
  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);
540
541
  }
541
- }, Me = (e, r, s) => {
542
+ }, Oe = (e, r, s) => {
542
543
  var n;
543
544
  if (!t.filters)
544
545
  return;
@@ -546,209 +547,209 @@ const He = {
546
547
  ...t.filters,
547
548
  [e]: { value: r, matchMode: s || ((n = t.filters[e]) == null ? void 0 : n.matchMode) || "contains" }
548
549
  };
549
- o("update:filters", u), t.lazy && o("filter", { filters: u }), t.paginator && (_.value = 0, o("update:first", 0));
550
- }, ie = (e) => {
550
+ o("update:filters", u), t.lazy && o("filter", { filters: u }), t.paginator && (B.value = 0, o("update:first", 0));
551
+ }, de = (e) => {
551
552
  var r;
552
553
  return ((r = t.filters) == null ? void 0 : r[e]) || { value: null };
553
- }, Pe = (e) => () => {
554
- t.filters && (o("update:filters", { ...t.filters }), t.lazy && o("filter", { filters: t.filters }), t.paginator && (_.value = 0, o("update:first", 0)));
555
- }, qe = (e) => {
556
- _.value = e, o("update:first", e);
557
- }, Oe = (e) => {
558
- E.value = e, o("update:rows", e);
559
- }, de = y(() => {
554
+ }, qe = (e) => () => {
555
+ t.filters && (o("update:filters", { ...t.filters }), t.lazy && o("filter", { filters: t.filters }), t.paginator && (B.value = 0, o("update:first", 0)));
556
+ }, $e = (e) => {
557
+ B.value = e, o("update:first", e);
558
+ }, Le = (e) => {
559
+ z.value = e, o("update:rows", e);
560
+ }, ue = y(() => {
560
561
  const e = [];
561
562
  if (t.colWidths) {
562
563
  if (typeof t.colWidths == "function") {
563
- const r = t.colWidths(j.value), s = [];
564
- return O.value && s.push(""), F.value && s.push(""), [...s, ...r];
564
+ const r = t.colWidths(N.value), s = [];
565
+ return $.value && s.push(""), M.value && s.push(""), [...s, ...r];
565
566
  }
566
567
  return t.colWidths;
567
568
  }
568
- return O.value && e.push(""), F.value && e.push(""), j.value.forEach((r) => {
569
+ return $.value && e.push(""), M.value && e.push(""), N.value.forEach((r) => {
569
570
  e.push(r.props.width || "");
570
571
  }), e;
571
- }), ue = y(() => de.value.some((e) => e !== "" && e != null)), $e = y(() => t.wrapperClass ? ["overflow-x-auto", "w-full", t.wrapperClass] : t.verticalBorders === "hover-table" ? ["overflow-x-auto", "w-full", "border", "border-transparent", "rounded"] : Ge(t.wrapperBordered)), Le = y(() => {
572
- const e = Je(t.size);
572
+ }), 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(() => {
573
+ const e = Xe(t.size);
573
574
  return t.tableClass && e.push(t.tableClass), t.bordered && e.push("border", "border-gray-100"), e;
574
575
  });
575
576
  return (e, r) => (l(), i("div", null, [
576
- je(c("div", null, [
577
- M(e.$slots, "default", {}, void 0, !0)
577
+ Te(c("div", null, [
578
+ P(e.$slots, "default", {}, void 0, !0)
578
579
  ], 512), [
579
- [Ne, !1]
580
+ [Ae, !1]
580
581
  ]),
581
- p(g).header ? (l(), i("div", at, [
582
- M(e.$slots, "header", {}, void 0, !0)
582
+ p(g).header ? (l(), i("div", it, [
583
+ P(e.$slots, "header", {}, void 0, !0)
583
584
  ])) : h("", !0),
584
585
  c("div", {
585
- class: v([...$e.value, e.verticalBorders === "hover-table" ? "vb-hover" : ""])
586
+ class: b([...Ee.value, e.verticalBorders === "hover-table" ? "vb-hover" : ""])
586
587
  }, [
587
588
  c("table", {
588
- class: v([
589
- ...Le.value,
589
+ class: b([
590
+ ...ze.value,
590
591
  e.verticalBorders !== "none" ? "border-separate border-spacing-0" : "border-collapse",
591
592
  e.verticalBorders === "hover" ? "vb-hover" : "",
592
- ue.value ? "table-fixed" : ""
593
+ pe.value ? "table-fixed" : ""
593
594
  ])
594
595
  }, [
595
- ue.value ? (l(), i("colgroup", nt, [
596
- (l(!0), i(x, null, L(de.value, (s, u) => (l(), i("col", {
596
+ pe.value ? (l(), i("colgroup", dt, [
597
+ (l(!0), i(R, null, E(ue.value, (s, u) => (l(), i("col", {
597
598
  key: `col-${u}`,
598
599
  style: J(s ? { width: s } : {})
599
600
  }, null, 4))), 128))
600
601
  ])) : h("", !0),
601
602
  c("thead", null, [
602
603
  c("tr", null, [
603
- O.value ? (l(), i("th", {
604
+ $.value ? (l(), i("th", {
604
605
  key: 0,
605
- class: v([
606
+ class: b([
606
607
  ...p(X)(e.size, !1, e.verticalBorders, e.headerVariant, e.headerBgClass),
607
608
  ...p(D)(e.size)
608
609
  ])
609
610
  }, [
610
- se.value ? (l(), i("div", {
611
+ re.value ? (l(), i("div", {
611
612
  key: 0,
612
613
  class: "flex items-center justify-center cursor-pointer",
613
- onClick: r[0] || (r[0] = (s) => Be(s))
614
+ onClick: r[0] || (r[0] = (s) => Me(s))
614
615
  }, [
615
- ne.value ? (l(), i("div", it, [
616
- (l(), k(C(p(ge)), { class: "w-3.5 h-3.5" }))
617
- ])) : (l(), i("div", dt))
616
+ ie.value ? (l(), i("div", ut, [
617
+ (l(), k(C(p(he)), { class: "w-3.5 h-3.5" }))
618
+ ])) : (l(), i("div", pt))
618
619
  ])) : h("", !0)
619
620
  ], 2)) : h("", !0),
620
- F.value ? (l(), i("th", {
621
+ M.value ? (l(), i("th", {
621
622
  key: 1,
622
- class: v([
623
+ class: b([
623
624
  ...p(X)(e.size, !1, e.verticalBorders, e.headerVariant, e.headerBgClass),
624
- ...p(be)(e.size)
625
+ ...p(me)(e.size)
625
626
  ])
626
627
  }, null, 2)) : h("", !0),
627
- (l(!0), i(x, null, L(j.value, (s, u) => (l(), i("th", {
628
+ (l(!0), i(R, null, E(N.value, (s, u) => (l(), i("th", {
628
629
  key: u,
629
- class: v([
630
+ class: b([
630
631
  ...p(X)(e.size, s.props.sortable, e.verticalBorders, e.headerVariant, e.headerBgClass),
631
632
  s.props.headerClass
632
633
  ]),
633
634
  style: J([s.props.headerStyle, s.props.width ? { width: s.props.width } : {}]),
634
- onClick: (n) => s.props.sortable ? xe(oe(s)) : void 0
635
+ onClick: (n) => s.props.sortable ? Re(ae(s)) : void 0
635
636
  }, [
636
- s.slots.header ? (l(), k(C(s.slots.header), { key: 0 })) : (l(), i("span", pt, [
637
- Q(R(s.props.header) + " ", 1),
638
- s.props.sortable ? (l(), i(x, { key: 0 }, [
639
- Re(s) ? m.value === 1 ? (l(), k(C(p(Ve)), {
637
+ s.slots.header ? (l(), k(C(s.slots.header), { key: 0 })) : (l(), i("span", ft, [
638
+ Q(S(s.props.header) + " ", 1),
639
+ s.props.sortable ? (l(), i(R, { key: 0 }, [
640
+ Be(s) ? m.value === 1 ? (l(), k(C(p(Ue)), {
640
641
  key: 1,
641
- class: v(p(W)(!0))
642
- }, null, 8, ["class"])) : m.value === -1 ? (l(), k(C(p(fe)), {
642
+ class: b(p(U)(!0))
643
+ }, null, 8, ["class"])) : m.value === -1 ? (l(), k(C(p(ye)), {
643
644
  key: 2,
644
- class: v(p(W)(!0))
645
- }, null, 8, ["class"])) : (l(), k(C(p(he)), {
645
+ class: b(p(U)(!0))
646
+ }, null, 8, ["class"])) : (l(), k(C(p(be)), {
646
647
  key: 3,
647
- class: v(p(W)(!1))
648
- }, null, 8, ["class"])) : (l(), k(C(p(he)), {
648
+ class: b(p(U)(!1))
649
+ }, null, 8, ["class"])) : (l(), k(C(p(be)), {
649
650
  key: 0,
650
- class: v(p(W)(!1))
651
+ class: b(p(U)(!1))
651
652
  }, null, 8, ["class"]))
652
653
  ], 64)) : h("", !0)
653
654
  ]))
654
- ], 14, ut))), 128))
655
+ ], 14, ct))), 128))
655
656
  ]),
656
- e.filterDisplay === "row" ? (l(), i("tr", ct, [
657
- O.value ? (l(), i("th", {
657
+ e.filterDisplay === "row" ? (l(), i("tr", yt, [
658
+ $.value ? (l(), i("th", {
658
659
  key: 0,
659
- class: v(p(Z)(e.size))
660
+ class: b(p(Z)(e.size))
660
661
  }, null, 2)) : h("", !0),
661
- F.value ? (l(), i("th", {
662
+ M.value ? (l(), i("th", {
662
663
  key: 1,
663
- class: v(p(Z)(e.size))
664
+ class: b(p(Z)(e.size))
664
665
  }, null, 2)) : h("", !0),
665
- (l(!0), i(x, null, L(j.value, (s, u) => (l(), i("th", {
666
+ (l(!0), i(R, null, E(N.value, (s, u) => (l(), i("th", {
666
667
  key: `filter-${u}`,
667
- class: v(p(Z)(e.size))
668
+ class: b(p(Z)(e.size))
668
669
  }, [
669
670
  s.props.filterable && s.slots.filter ? (l(), k(C(s.slots.filter), {
670
671
  key: 0,
671
- filterModel: ie(
672
+ filterModel: de(
672
673
  s.props.filterField || s.props.field
673
674
  ),
674
- filterCallback: Pe(
675
+ filterCallback: qe(
675
676
  s.props.filterField || s.props.field
676
677
  )
677
678
  }, null, 8, ["filterModel", "filterCallback"])) : s.props.filterable && s.props.field ? (l(), i("input", {
678
679
  key: 1,
679
680
  type: "text",
680
- value: ie(
681
+ value: de(
681
682
  s.props.filterField || s.props.field
682
683
  ).value || "",
683
684
  class: "w-full border border-gray-300 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-primary-glow",
684
685
  placeholder: `Filter ${s.props.header || s.props.field}`,
685
- onInput: (n) => Me(
686
+ onInput: (n) => Oe(
686
687
  s.props.filterField || s.props.field,
687
688
  n.target.value
688
689
  )
689
- }, null, 40, ft)) : h("", !0)
690
+ }, null, 40, gt)) : h("", !0)
690
691
  ], 2))), 128))
691
692
  ])) : h("", !0)
692
693
  ]),
693
- !e.loading && $.value.length > 0 ? (l(), i("tbody", yt, [
694
- (l(!0), i(x, null, L($.value, (s, u) => (l(), i(x, {
695
- key: Ce(s, u)
694
+ !e.loading && L.value.length > 0 ? (l(), i("tbody", ht, [
695
+ (l(!0), i(R, null, E(L.value, (s, u) => (l(), i(R, {
696
+ key: xe(s, u)
696
697
  }, [
697
698
  c("tr", {
698
- class: v([
699
- ...p(Qe)(
699
+ class: b([
700
+ ...p(Ye)(
700
701
  e.striped,
701
702
  e.hoverable,
702
703
  u % 2 === 1,
703
- H(s),
704
+ I(s),
704
705
  !1
705
706
  ),
706
707
  e.selectionMode ? "cursor-pointer" : ""
707
708
  ]),
708
- onClick: (n) => ae(n, s, u)
709
+ onClick: (n) => ne(n, s, u)
709
710
  }, [
710
- O.value ? (l(), i("td", {
711
+ $.value ? (l(), i("td", {
711
712
  key: 0,
712
- class: v([
713
+ class: b([
713
714
  ...p(Y)(e.size, e.bordered, e.verticalBorders, e.bodyBgClass),
714
715
  ...p(D)(e.size)
715
716
  ])
716
717
  }, [
717
- se.value ? (l(), i("div", {
718
+ re.value ? (l(), i("div", {
718
719
  key: 0,
719
720
  class: "flex items-center justify-center cursor-pointer",
720
- onClick: ce((n) => _e(n, s), ["stop"])
721
+ onClick: fe((n) => Fe(n, s), ["stop"])
721
722
  }, [
722
- H(s) ? (l(), i("div", vt, [
723
- (l(), k(C(p(ge)), { class: "w-3.5 h-3.5" }))
724
- ])) : (l(), i("div", bt))
725
- ], 8, ht)) : (l(), i("div", {
723
+ I(s) ? (l(), i("div", mt, [
724
+ (l(), k(C(p(he)), { class: "w-3.5 h-3.5" }))
725
+ ])) : (l(), i("div", wt))
726
+ ], 8, vt)) : (l(), i("div", {
726
727
  key: 1,
727
728
  class: "flex items-center justify-center cursor-pointer",
728
- onClick: ce((n) => ae(n, s, u), ["stop"])
729
+ onClick: fe((n) => ne(n, s, u), ["stop"])
729
730
  }, [
730
- H(s) ? (l(), i("div", wt, [...r[3] || (r[3] = [
731
+ I(s) ? (l(), i("div", Ct, [...r[3] || (r[3] = [
731
732
  c("div", { class: "w-2 h-2 rounded-full bg-white" }, null, -1)
732
- ])])) : (l(), i("div", kt))
733
- ], 8, mt))
733
+ ])])) : (l(), i("div", St))
734
+ ], 8, kt))
734
735
  ], 2)) : h("", !0),
735
- F.value ? (l(), i("td", {
736
+ M.value ? (l(), i("td", {
736
737
  key: 1,
737
- class: v([
738
+ class: b([
738
739
  ...p(Y)(e.size, e.bordered, e.verticalBorders, e.bodyBgClass),
739
- ...p(be)(e.size)
740
+ ...p(me)(e.size)
740
741
  ])
741
742
  }, [
742
743
  c("button", {
743
744
  class: "p-1 rounded hover:bg-gray-100 transition-colors",
744
- onClick: (n) => Fe(n, s)
745
+ onClick: (n) => Pe(n, s)
745
746
  }, [
746
- (l(), k(C(I(s) ? p(fe) : p(we)), { class: "w-4 h-4 text-gray-500" }))
747
- ], 8, Ct)
747
+ (l(), k(C(H(s) ? p(ye) : p(Ce)), { class: "w-4 h-4 text-gray-500" }))
748
+ ], 8, xt)
748
749
  ], 2)) : h("", !0),
749
- (l(!0), i(x, null, L(j.value, (n, b) => (l(), i("td", {
750
- key: b,
751
- class: v([
750
+ (l(!0), i(R, null, E(N.value, (n, v) => (l(), i("td", {
751
+ key: v,
752
+ class: b([
752
753
  ...p(Y)(e.size, e.bordered, e.verticalBorders, e.bodyBgClass),
753
754
  n.props.bodyClass
754
755
  ]),
@@ -759,53 +760,53 @@ const He = {
759
760
  data: s,
760
761
  field: n.props.field,
761
762
  index: u
762
- }, null, 8, ["data", "field", "index"])) : n.props.field ? (l(), i(x, { key: 1 }, [
763
- Q(R(w(s, n.props.field)), 1)
763
+ }, null, 8, ["data", "field", "index"])) : n.props.field ? (l(), i(R, { key: 1 }, [
764
+ Q(S(w(s, n.props.field)), 1)
764
765
  ], 64)) : h("", !0)
765
766
  ], 6))), 128))
766
- ], 10, gt),
767
- F.value && I(s) ? (l(), i("tr", St, [
767
+ ], 10, bt),
768
+ M.value && H(s) ? (l(), i("tr", _t, [
768
769
  c("td", {
769
- colspan: T.value,
770
+ colspan: V.value,
770
771
  class: "p-0"
771
772
  }, [
772
- M(e.$slots, "expansion", {
773
+ P(e.$slots, "expansion", {
773
774
  data: s,
774
775
  index: u
775
776
  }, void 0, !0)
776
- ], 8, xt)
777
+ ], 8, Rt)
777
778
  ])) : h("", !0)
778
779
  ], 64))), 128))
779
- ])) : e.loading ? (l(), i("tbody", Rt, [
780
+ ])) : e.loading ? (l(), i("tbody", Bt, [
780
781
  c("tr", null, [
781
782
  c("td", {
782
- colspan: T.value,
783
+ colspan: V.value,
783
784
  class: "text-center py-12"
784
785
  }, [
785
- M(e.$slots, "loading", {}, () => [
786
- c("div", Bt, [
787
- Ae(ye, { class: "w-5 h-5" }),
788
- r[4] || (r[4] = c("span", null, "Loading...", -1))
786
+ P(e.$slots, "loading", {}, () => [
787
+ c("div", Mt, [
788
+ Ke(ge, { class: "w-5 h-5" }),
789
+ c("span", null, S(p(f)("dataTable.loading")), 1)
789
790
  ])
790
791
  ], !0)
791
- ], 8, _t)
792
+ ], 8, Ft)
792
793
  ])
793
- ])) : (l(), i("tbody", Ft, [
794
+ ])) : (l(), i("tbody", Pt, [
794
795
  c("tr", null, [
795
796
  c("td", {
796
- colspan: T.value,
797
+ colspan: V.value,
797
798
  class: "text-center py-12"
798
799
  }, [
799
- M(e.$slots, "empty", {}, () => [
800
- r[5] || (r[5] = c("span", { class: "text-gray-400" }, "No records found", -1))
800
+ P(e.$slots, "empty", {}, () => [
801
+ c("span", qt, S(p(f)("dataTable.noRecords")), 1)
801
802
  ], !0)
802
- ], 8, Mt)
803
+ ], 8, Ot)
803
804
  ])
804
805
  ])),
805
- e.hasNextPage && !e.loading ? (l(), i("tfoot", Pt, [
806
+ e.hasNextPage && !e.loading ? (l(), i("tfoot", $t, [
806
807
  c("tr", null, [
807
808
  c("td", {
808
- colspan: T.value,
809
+ colspan: V.value,
809
810
  class: "px-3 pb-3 pt-2"
810
811
  }, [
811
812
  c("button", {
@@ -813,49 +814,49 @@ const He = {
813
814
  disabled: e.loadingNext,
814
815
  onClick: r[1] || (r[1] = (s) => o("load:next"))
815
816
  }, [
816
- e.loadingNext ? (l(), k(ye, {
817
+ e.loadingNext ? (l(), k(ge, {
817
818
  key: 0,
818
819
  class: "w-4 h-4"
819
820
  })) : h("", !0),
820
- Q(" " + R(e.loadMoreLabel), 1)
821
- ], 8, Ot)
822
- ], 8, qt)
821
+ Q(" " + S(e.loadMoreLabel || p(f)("dataTable.showMore")), 1)
822
+ ], 8, Et)
823
+ ], 8, Lt)
823
824
  ])
824
825
  ])) : h("", !0)
825
826
  ], 2)
826
827
  ], 2),
827
- e.paginator && le.value > 0 ? (l(), k(ot, {
828
+ e.paginator && oe.value > 0 ? (l(), k(nt, {
828
829
  key: 1,
829
830
  first: A.value,
830
831
  rows: K.value,
831
- "total-records": le.value,
832
+ "total-records": oe.value,
832
833
  "rows-per-page-options": e.rowsPerPageOptions,
833
- "onUpdate:first": qe,
834
- "onUpdate:rows": Oe,
834
+ "onUpdate:first": $e,
835
+ "onUpdate:rows": Le,
835
836
  onPage: r[2] || (r[2] = (s) => o("page", s))
836
837
  }, null, 8, ["first", "rows", "total-records", "rows-per-page-options"])) : h("", !0),
837
- p(g).footer ? (l(), i("div", $t, [
838
- M(e.$slots, "footer", {}, void 0, !0)
838
+ p(g).footer ? (l(), i("div", zt, [
839
+ P(e.$slots, "footer", {}, void 0, !0)
839
840
  ])) : h("", !0)
840
841
  ]));
841
842
  }
842
843
  });
843
- const At = /* @__PURE__ */ We(Lt, [["__scopeId", "data-v-f3dfff27"]]), Kt = /* @__PURE__ */ ee({
844
+ const Wt = /* @__PURE__ */ Ie(jt, [["__scopeId", "data-v-fc1f30bd"]]), Ut = /* @__PURE__ */ ee({
844
845
  __name: "OneColumn",
845
- props: He,
846
+ props: Ge,
846
847
  setup(d) {
847
- const a = d, t = me(), o = Ke(ke), g = {
848
+ const a = d, t = we(), o = Ve(Se), g = {
848
849
  props: a,
849
850
  slots: t
850
851
  };
851
- return o && o.registerColumn(g), Te(() => {
852
+ return o && o.registerColumn(g), We(() => {
852
853
  o && o.unregisterColumn(g);
853
- }), (f, U) => M(f.$slots, "default");
854
+ }), (f, _) => P(f.$slots, "default");
854
855
  }
855
856
  });
856
857
  export {
857
- At as O,
858
- Kt as _,
859
- ot as a,
860
- ge as r
858
+ Wt as O,
859
+ Ut as _,
860
+ nt as a,
861
+ he as r
861
862
  };