lkt-table 1.2.5 → 1.2.6

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/build.js CHANGED
@@ -1,4 +1,4 @@
1
- import { reactive as H, defineComponent as G, ref as C, watch as U, nextTick as de, computed as f, resolveComponent as $, openBlock as s, createBlock as b, withCtx as F, createTextVNode as le, toDisplayString as j, unref as E, createElementBlock as m, Fragment as A, withModifiers as at, resolveDynamicComponent as Z, createCommentVNode as y, normalizeClass as te, createElementVNode as B, createVNode as X, renderList as P, renderSlot as N, withDirectives as x, vShow as ee, useSlots as nt, onMounted as st, createSlots as Be } from "vue";
1
+ import { reactive as H, defineComponent as G, ref as C, watch as U, nextTick as de, computed as f, resolveComponent as $, openBlock as s, createBlock as b, withCtx as F, createTextVNode as le, toDisplayString as j, unref as I, createElementBlock as m, Fragment as A, withModifiers as at, resolveDynamicComponent as Z, createCommentVNode as y, normalizeClass as te, createElementVNode as E, createVNode as X, renderList as P, renderSlot as N, withDirectives as x, vShow as ee, useSlots as nt, onMounted as st, createSlots as Be } from "vue";
2
2
  import { httpCall as ut } from "lkt-http-client";
3
3
  import { __ as q } from "lkt-i18n";
4
4
  import { createLktEvent as ce } from "lkt-events";
@@ -222,20 +222,20 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
222
222
  }, { deep: !0 }), n.column.hasToLoadResource() && n.column.loadResource();
223
223
  const v = f(() => ({ ...n.column.slotData, item: u.value }));
224
224
  return (a, i) => {
225
- const W = $("lkt-anchor"), J = $("lkt-field-text"), d = $("lkt-field-switch"), I = $("lkt-field-file"), S = $("lkt-loader"), V = $("lkt-field-select");
225
+ const W = $("lkt-anchor"), J = $("lkt-field-text"), d = $("lkt-field-switch"), L = $("lkt-field-file"), S = $("lkt-loader"), V = $("lkt-field-select");
226
226
  return a.column.type === "link" ? (s(), b(W, {
227
227
  key: 0,
228
228
  to: a.column.getHref(u.value)
229
229
  }, {
230
230
  default: F(() => [
231
- le(j(E(Y)(a.column, u.value, a.i)), 1)
231
+ le(j(I(Y)(a.column, u.value, a.i)), 1)
232
232
  ]),
233
233
  _: 1
234
234
  }, 8, ["to"])) : a.column.type === "action" ? (s(), m("a", {
235
235
  key: 1,
236
236
  href: "#",
237
237
  onClick: i[0] || (i[0] = (p) => a.column.doAction(u.value))
238
- }, j(E(Y)(a.column, u.value, a.i)), 1)) : a.column.type === "text" ? (s(), b(J, {
238
+ }, j(I(Y)(a.column, u.value, a.i)), 1)) : a.column.type === "text" ? (s(), b(J, {
239
239
  key: 2,
240
240
  "read-mode": !a.column.editable || !a.editModeEnabled,
241
241
  ref: (p) => h.value = p,
@@ -277,7 +277,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
277
277
  ref: (p) => h.value = p,
278
278
  modelValue: o.value,
279
279
  "onUpdate:modelValue": i[5] || (i[5] = (p) => o.value = p)
280
- }, null, 8, ["read-mode", "modelValue"])) : a.column.type === "file" ? (s(), b(I, {
280
+ }, null, 8, ["read-mode", "modelValue"])) : a.column.type === "file" ? (s(), b(L, {
281
281
  key: 7,
282
282
  "read-mode": !a.column.editable || !a.editModeEnabled,
283
283
  ref: (p) => h.value = p,
@@ -301,7 +301,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
301
301
  "multiple-display-edition": a.column.multipleDisplayEdition
302
302
  }, null, 8, ["read-mode", "modelValue", "slot-data", "resource", "use-resource-slot", "resource-data", "options", "multiple", "tags", "multiple-display", "multiple-display-edition"]))
303
303
  ], 64)) : (s(), m(A, { key: 9 }, [
304
- le(j(E(Y)(a.column, u.value, a.i, a.columns)), 1)
304
+ le(j(I(Y)(a.column, u.value, a.i, a.columns)), 1)
305
305
  ], 64));
306
306
  };
307
307
  }
@@ -347,7 +347,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
347
347
  }, Bt = {
348
348
  key: 2,
349
349
  class: "lkt-table-nav-cell"
350
- }, Et = { class: "lkt-table-nav-container" }, It = /* @__PURE__ */ B("i", { class: "" }, null, -1), Lt = /* @__PURE__ */ B("i", { class: "" }, null, -1), Mt = ["data-column", "colspan", "title", "onClick"], $t = {
350
+ }, Et = { class: "lkt-table-nav-container" }, It = /* @__PURE__ */ E("i", { class: "" }, null, -1), Lt = /* @__PURE__ */ E("i", { class: "" }, null, -1), Mt = ["data-column", "colspan", "title", "onClick"], $t = {
351
351
  key: 4,
352
352
  class: "lkt-table-col-drop"
353
353
  }, At = /* @__PURE__ */ G({
@@ -372,10 +372,10 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
372
372
  },
373
373
  emits: ["update:modelValue", "click", "show", "item-up", "item-down", "item-drop"],
374
374
  setup(l, { emit: t }) {
375
- const r = t, n = l, u = C(n.modelValue), o = (d, I, S) => {
376
- r("click", d, ce("", { item: I, column: S }));
377
- }, h = (d, I) => {
378
- r("show", d, ce("", { i: I }));
375
+ const r = t, n = l, u = C(n.modelValue), o = (d, L, S) => {
376
+ r("click", d, ce("", { item: L, column: S }));
377
+ }, h = (d, L) => {
378
+ r("show", d, ce("", { i: L }));
379
379
  }, g = f(() => {
380
380
  let d = [];
381
381
  return n.sortable && n.isDraggable && d.push("handle"), d.join(" ");
@@ -390,7 +390,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
390
390
  };
391
391
  return U(() => n.modelValue, (d) => u.value = d), U(u, (d) => {
392
392
  r("update:modelValue", d, n.i);
393
- }, { deep: !0 }), (d, I) => {
393
+ }, { deep: !0 }), (d, L) => {
394
394
  const S = $("lkt-button");
395
395
  return s(), m("tr", {
396
396
  "data-i": d.i,
@@ -402,7 +402,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
402
402
  class: te(g.value)
403
403
  }, null, 2)) : d.sortable && d.editModeEnabled ? (s(), m("td", Tt)) : y("", !0),
404
404
  d.addNavigation && d.editModeEnabled ? (s(), m("td", Bt, [
405
- B("div", Et, [
405
+ E("div", Et, [
406
406
  X(S, {
407
407
  palette: "table-nav",
408
408
  disabled: d.i === 0,
@@ -439,16 +439,16 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
439
439
  ])) : y("", !0),
440
440
  d.displayHiddenColumnsIndicator ? (s(), m("td", {
441
441
  key: 3,
442
- onClick: I[0] || (I[0] = (V) => h(V, d.i)),
442
+ onClick: L[0] || (L[0] = (V) => h(V, d.i)),
443
443
  "data-role": "show-more",
444
444
  class: te(d.hiddenIsVisible ? "state-open" : "")
445
445
  }, null, 2)) : y("", !0),
446
446
  (s(!0), m(A, null, P(d.visibleColumns, (V) => (s(), m(A, null, [
447
- E(Ct)(V, d.emptyColumns, u.value) ? (s(), m("td", {
447
+ I(Ct)(V, d.emptyColumns, u.value) ? (s(), m("td", {
448
448
  key: 0,
449
449
  "data-column": V.key,
450
- colspan: E(me)(V, u.value),
451
- title: E(Y)(V, u.value, d.i, d.visibleColumns),
450
+ colspan: I(me)(V, u.value),
451
+ title: I(Y)(V, u.value, d.i, d.visibleColumns),
452
452
  onClick: (p) => o(p, u.value, V)
453
453
  }, [
454
454
  d.$slots[V.key] ? N(d.$slots, V.key, {
@@ -460,7 +460,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
460
460
  }) : u.value ? (s(), b(Le, {
461
461
  key: 1,
462
462
  modelValue: u.value,
463
- "onUpdate:modelValue": I[1] || (I[1] = (p) => u.value = p),
463
+ "onUpdate:modelValue": L[1] || (L[1] = (p) => u.value = p),
464
464
  column: V,
465
465
  columns: d.visibleColumns,
466
466
  "edit-mode-enabled": d.editModeEnabled,
@@ -500,19 +500,19 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
500
500
  r("click", h, ce("", { item: g, column: v }));
501
501
  };
502
502
  return U(() => n.modelValue, (h) => u.value = h), U(u, () => r("update:modelValue", u.value)), (h, g) => x((s(), m("tr", Rt, [
503
- B("td", { colspan: h.hiddenColumnsColSpan }, [
504
- B("table", null, [
505
- B("tr", null, [
503
+ E("td", { colspan: h.hiddenColumnsColSpan }, [
504
+ E("table", null, [
505
+ E("tr", null, [
506
506
  (s(!0), m(A, null, P(h.hiddenColumns, (v) => (s(), m("th", {
507
507
  "data-column": v.key
508
508
  }, [
509
- B("div", null, j(v.label), 1)
509
+ E("div", null, j(v.label), 1)
510
510
  ], 8, Nt))), 256))
511
511
  ]),
512
- B("tr", { "data-i": h.i }, [
512
+ E("tr", { "data-i": h.i }, [
513
513
  (s(!0), m(A, null, P(h.hiddenColumns, (v, a) => (s(), m("td", {
514
514
  "data-column": v.key,
515
- title: E(Y)(v, u.value, a, h.hiddenColumns),
515
+ title: I(Y)(v, u.value, a, h.hiddenColumns),
516
516
  onClick: (i) => o(i, u.value, v)
517
517
  }, [
518
518
  h.$slots[v.key] ? N(h.$slots, v.key, {
@@ -585,7 +585,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
585
585
  title: g.value,
586
586
  onClick: v
587
587
  }, [
588
- B("div", null, j(g.value), 1)
588
+ E("div", null, j(g.value), 1)
589
589
  ], 8, Kt));
590
590
  }
591
591
  }), Pt = ["id"], Wt = { key: 0 }, jt = { class: "lkt-table-page-buttons" }, Jt = { key: 1 }, zt = { class: "switch-edition-mode" }, qt = {
@@ -657,7 +657,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
657
657
  },
658
658
  emits: ["update:modelValue", "sort", "click", "save", "error", "before-save"],
659
659
  setup(l, { expose: t, emit: r }) {
660
- const n = r, u = nt(), o = l, h = {}, g = C(typeof o.sorter == "function" ? o.sorter : Ee), v = C(St(o.columns)), a = C("asc"), i = C(o.modelValue), W = C(h), J = C(null), d = C(o.columns), I = C(o.page), S = C(!1), V = C(!1), p = C(o.perms), fe = C(null), Me = C({}), Q = C(new dt({ items: i.value }, o.dataStateConfig)), L = C(o.editMode), $e = (e) => {
660
+ const n = r, u = nt(), o = l, h = {}, g = C(typeof o.sorter == "function" ? o.sorter : Ee), v = C(St(o.columns)), a = C("asc"), i = C(o.modelValue), W = C(h), J = C(null), d = C(o.columns), L = C(o.page), S = C(!1), V = C(!1), p = C(o.perms), fe = C(null), Me = C({}), Q = C(new dt({ items: i.value }, o.dataStateConfig)), M = C(o.editMode), $e = (e) => {
661
661
  Array.isArray(e) && (i.value = e), S.value = !1, V.value = !0, Q.value.store({ items: i.value }).turnStoredIntoOriginal();
662
662
  }, Ae = (e) => {
663
663
  p.value = e;
@@ -681,7 +681,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
681
681
  let e = [];
682
682
  for (let c in u) Ue.value.indexOf(c) !== -1 && e.push(c);
683
683
  return e;
684
- }), he = f(() => o.hiddenSave || S.value || !o.saveResource ? !1 : L.value && Q.value.changed() ? !0 : L.value), He = f(() => o.switchEditionEnabled ? !0 : he.value || L.value && o.canCreate), Ke = f(() => o.saveDisabled || typeof o.saveValidator == "function" && !o.saveValidator(i.value) ? !1 : Q.value.changed()), _e = f(() => i.value.length), Pe = f(() => ({
684
+ }), he = f(() => o.hiddenSave || S.value || !o.saveResource ? !1 : M.value && Q.value.changed() ? !0 : M.value), He = f(() => o.switchEditionEnabled ? !0 : he.value || M.value && o.canCreate), Ke = f(() => o.saveDisabled || typeof o.saveValidator == "function" && !o.saveValidator(i.value) ? !1 : Q.value.changed()), _e = f(() => i.value.length), Pe = f(() => ({
685
685
  items: i.value,
686
686
  ...o.saveResourceData
687
687
  })), We = f(() => o.titleTag === "" ? "h2" : o.titleTag), je = f(() => o.wrapContentTag === "" ? "div" : o.wrapContentTag), ie = f(() => o.title.startsWith("__:") ? q(o.title.substring(3)) : o.title), Je = f(() => o.saveText.startsWith("__:") ? q(o.saveText.substring(3)) : o.saveText), ze = f(() => o.editModeText.startsWith("__:") ? q(o.editModeText.substring(3)) : o.editModeText), ne = f(() => p.value.includes("create")), qe = f(() => p.value.includes("read")), Ge = f(() => p.value.includes("update")), re = f(() => p.value.includes("drop")), Qe = (e) => {
@@ -770,9 +770,9 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
770
770
  const k = $("lkt-button"), T = $("lkt-field-switch"), D = $("lkt-loader"), O = $("lkt-paginator");
771
771
  return s(), m("section", {
772
772
  class: "lkt-table-page",
773
- id: "lkt-table-page-" + E(oe)
773
+ id: "lkt-table-page-" + I(oe)
774
774
  }, [
775
- ie.value || E(u).title ? (s(), m("header", Wt, [
775
+ ie.value || I(u).title ? (s(), m("header", Wt, [
776
776
  ie.value ? (s(), b(Z(We.value), { key: 0 }, {
777
777
  default: F(() => [
778
778
  e.titleIcon ? (s(), m("i", {
@@ -783,13 +783,13 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
783
783
  ]),
784
784
  _: 1
785
785
  })) : y("", !0),
786
- E(u).title ? N(e.$slots, "title", { key: 1 }) : y("", !0)
786
+ I(u).title ? N(e.$slots, "title", { key: 1 }) : y("", !0)
787
787
  ])) : y("", !0),
788
788
  (s(), b(Z(je.value), {
789
789
  class: te(["lkt-table-page-content-wrapper", e.wrapContentClass])
790
790
  }, {
791
791
  default: F(() => [
792
- x(B("div", jt, [
792
+ x(E("div", jt, [
793
793
  x(X(k, {
794
794
  ref: "saveButton",
795
795
  palette: "success",
@@ -803,7 +803,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
803
803
  onClick: xe
804
804
  }, {
805
805
  default: F(() => [
806
- E(u)["button-save"] ? N(e.$slots, "button-save", {
806
+ I(u)["button-save"] ? N(e.$slots, "button-save", {
807
807
  key: 0,
808
808
  items: i.value,
809
809
  editMode: e.editMode,
@@ -814,17 +814,17 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
814
814
  }, 8, ["disabled", "confirm-modal", "confirm-data", "resource", "resource-data"]), [
815
815
  [ee, he.value]
816
816
  ]),
817
- e.canCreate && ne.value && L.value ? (s(), b(Ie, {
817
+ e.canCreate && ne.value && M.value ? (s(), b(Ie, {
818
818
  key: 0,
819
819
  disabled: !Te.value,
820
820
  text: e.createText,
821
821
  icon: e.createIcon,
822
822
  onClick: Ve
823
823
  }, null, 8, ["disabled", "text", "icon"])) : y("", !0),
824
- B("div", zt, [
824
+ E("div", zt, [
825
825
  x(X(T, {
826
- modelValue: L.value,
827
- "onUpdate:modelValue": c[0] || (c[0] = (w) => L.value = w),
826
+ modelValue: M.value,
827
+ "onUpdate:modelValue": c[0] || (c[0] = (w) => M.value = w),
828
828
  label: ze.value
829
829
  }, null, 8, ["modelValue", "label"]), [
830
830
  [ee, e.switchEditionEnabled]
@@ -833,17 +833,17 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
833
833
  ], 512), [
834
834
  [ee, He.value]
835
835
  ]),
836
- E(u).buttons ? (s(), m("div", qt, [
836
+ I(u).buttons ? (s(), m("div", qt, [
837
837
  N(e.$slots, "buttons")
838
838
  ])) : y("", !0),
839
- V.value && E(u).filters ? (s(), m("div", Gt, [
839
+ V.value && I(u).filters ? (s(), m("div", Gt, [
840
840
  N(e.$slots, "filters", {
841
841
  items: i.value,
842
842
  isLoading: S.value
843
843
  })
844
844
  ])) : y("", !0),
845
845
  S.value ? (s(), b(D, { key: 2 })) : y("", !0),
846
- x(B("div", {
846
+ x(E("div", {
847
847
  class: "lkt-table",
848
848
  "data-sortable": e.sortable
849
849
  }, [
@@ -851,9 +851,10 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
851
851
  key: 1,
852
852
  class: te(["lkt-table-items-container", e.itemsContainerClass])
853
853
  }, [
854
- (s(!0), m(A, null, P(i.value, (w) => (s(), m("div", ll, [
854
+ (s(!0), m(A, null, P(i.value, (w, B) => (s(), m("div", ll, [
855
855
  N(e.$slots, "item", {
856
856
  item: w,
857
+ index: B,
857
858
  canCreate: ne.value,
858
859
  canRead: qe.value,
859
860
  canUpdate: Ge.value,
@@ -862,10 +863,10 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
862
863
  })
863
864
  ]))), 256))
864
865
  ], 2)) : (s(), m("table", Xt, [
865
- B("thead", null, [
866
- B("tr", null, [
867
- e.sortable && L.value ? (s(), m("th", Yt)) : y("", !0),
868
- e.addNavigation && L.value ? (s(), m("th", Zt)) : y("", !0),
866
+ E("thead", null, [
867
+ E("tr", null, [
868
+ e.sortable && M.value ? (s(), m("th", Yt)) : y("", !0),
869
+ e.addNavigation && M.value ? (s(), m("th", Zt)) : y("", !0),
869
870
  pe.value ? (s(), m("th", xt)) : y("", !0),
870
871
  (s(!0), m(A, null, P(ae.value, (w) => (s(), m(A, null, [
871
872
  se.value.indexOf(w.key) === -1 ? (s(), b(_t, {
@@ -875,35 +876,35 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
875
876
  "sort-direction": a.value,
876
877
  "amount-of-columns": e.columns.length,
877
878
  items: i.value,
878
- onClick: (M) => ke(w)
879
+ onClick: (B) => ke(w)
879
880
  }, null, 8, ["column", "sort-by", "sort-direction", "amount-of-columns", "items", "onClick"])) : y("", !0)
880
881
  ], 64))), 256)),
881
- e.canDrop && re.value && L.value ? (s(), m("th", el)) : y("", !0)
882
+ e.canDrop && re.value && M.value ? (s(), m("th", el)) : y("", !0)
882
883
  ])
883
884
  ]),
884
- B("tbody", {
885
+ E("tbody", {
885
886
  ref: (w) => J.value = w,
886
- id: "lkt-table-body-" + E(oe)
887
+ id: "lkt-table-body-" + I(oe)
887
888
  }, [
888
- (s(!0), m(A, null, P(i.value, (w, M) => (s(), b(At, {
889
- modelValue: i.value[M],
890
- "onUpdate:modelValue": (_) => i.value[M] = _,
891
- key: we(w, M),
892
- i: M,
889
+ (s(!0), m(A, null, P(i.value, (w, B) => (s(), b(At, {
890
+ modelValue: i.value[B],
891
+ "onUpdate:modelValue": (_) => i.value[B] = _,
892
+ key: we(w, B),
893
+ i: B,
893
894
  "display-hidden-columns-indicator": pe.value,
894
895
  "is-draggable": Se(w),
895
896
  sortable: e.sortable,
896
897
  "visible-columns": ae.value,
897
898
  "empty-columns": se.value,
898
899
  "add-navigation": e.addNavigation,
899
- "hidden-is-visible": ye(M),
900
- "latest-row": M + 1 === _e.value,
901
- "can-drop": e.canDrop && re.value && L.value,
900
+ "hidden-is-visible": ye(B),
901
+ "latest-row": B + 1 === _e.value,
902
+ "can-drop": e.canDrop && re.value && M.value,
902
903
  "drop-confirm": e.dropConfirm,
903
904
  "drop-resource": e.dropResource,
904
905
  "drop-text": e.dropText,
905
906
  "drop-icon": e.dropIcon,
906
- "edit-mode-enabled": L.value,
907
+ "edit-mode-enabled": M.value,
907
908
  onClick: be,
908
909
  onShow: ge,
909
910
  onItemUp: et,
@@ -921,18 +922,18 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
921
922
  ])
922
923
  }))
923
924
  ]), 1032, ["modelValue", "onUpdate:modelValue", "i", "display-hidden-columns-indicator", "is-draggable", "sortable", "visible-columns", "empty-columns", "add-navigation", "hidden-is-visible", "latest-row", "can-drop", "drop-confirm", "drop-resource", "drop-text", "drop-icon", "edit-mode-enabled"]))), 128)),
924
- ue.value.length > 0 ? (s(!0), m(A, { key: 0 }, P(i.value, (w, M) => (s(), b(Ht, {
925
- modelValue: i.value[M],
926
- "onUpdate:modelValue": (_) => i.value[M] = _,
927
- key: we(w, M, !0),
928
- i: M,
925
+ ue.value.length > 0 ? (s(!0), m(A, { key: 0 }, P(i.value, (w, B) => (s(), b(Ht, {
926
+ modelValue: i.value[B],
927
+ "onUpdate:modelValue": (_) => i.value[B] = _,
928
+ key: we(w, B, !0),
929
+ i: B,
929
930
  "hidden-columns": ue.value,
930
931
  "hidden-columns-col-span": Ne.value,
931
932
  "is-draggable": Se(w),
932
933
  sortable: e.sortable,
933
934
  "visible-columns": ae.value,
934
935
  "empty-columns": se.value,
935
- "hidden-is-visible": ye(M),
936
+ "hidden-is-visible": ye(B),
936
937
  onClick: be,
937
938
  onShow: ge
938
939
  }, Be({ _: 2 }, [
@@ -956,8 +957,8 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
956
957
  N(e.$slots, "no-items")
957
958
  ])) : y("", !0),
958
959
  !S.value && i.value.length === 0 ? (s(), m("div", al, j(e.noResultsText), 1)) : y("", !0),
959
- e.canCreate && ne.value && L.value ? (s(), m("div", nl, [
960
- e.canCreate && ne.value && L.value ? (s(), b(Ie, {
960
+ e.canCreate && ne.value && M.value ? (s(), m("div", nl, [
961
+ e.canCreate && ne.value && M.value ? (s(), b(Ie, {
961
962
  key: 0,
962
963
  disabled: !Te.value,
963
964
  text: e.createText,
@@ -968,8 +969,8 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
968
969
  X(O, {
969
970
  ref_key: "paginator",
970
971
  ref: fe,
971
- modelValue: I.value,
972
- "onUpdate:modelValue": c[1] || (c[1] = (w) => I.value = w),
972
+ modelValue: L.value,
973
+ "onUpdate:modelValue": c[1] || (c[1] = (w) => L.value = w),
973
974
  resource: e.resource,
974
975
  filters: e.filters,
975
976
  onResults: $e,
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .lkt-table-page,.lkt-table-page-content-wrapper{display:flex;width:100%;flex-direction:column;gap:var(--lkt-table-page-gap)}.lkt-table{width:var(--lkt-table-width);overflow-x:auto;font-family:var(--lkt-table-font-family),serif}.lkt-table .lkt-field{--lkt-field-font-size: var(--lkt-table-font-size-row)}.lkt-table>table{width:100%;max-width:100%;border-collapse:var(--lkt-table-border-collapse);border-radius:var(--lkt-table-border-radius);border-spacing:var(--lkt-table-border-spacing)}.lkt-table th,.lkt-table td{vertical-align:middle;text-align:var(--lkt-table-text-align);padding:var(--lkt-table-padding-row);font-size:var(--lkt-table-font-size-row);color:var(--lkt-table-color-row)}.lkt-table th{font-family:var(--lkt-table-font-family-header),serif;padding:var(--lkt-table-padding-header)}.lkt-table thead tr{background-color:var(--lkt-table-bg-header)}.lkt-table tbody tr{background-color:var(--lkt-table-bg-row)}.lkt-table tbody tr:nth-child(odd){background-color:var(--lkt-table-bg-row-odd)}.lkt-table [data-sort=asc]>div,.lkt-table [data-sort=desc]>div{display:inline-block}.lkt-table [data-sort=asc]>div:after,.lkt-table [data-sort=desc]>div:after{font-family:var(--lkt-table-font-family-sort-icon),serif;display:inline-block;font-size:var(--lkt-table-font-size-sort-icon)}.lkt-table [data-sort=asc]>div:after{content:var(--lkt-table-sort-icon-content-asc)}.lkt-table [data-sort=desc]>div:after{content:var(--lkt-table-sort-icon-content-desc)}.lkt-table td[data-role=drag-indicator],.lkt-table td[data-role=invalid-drag-indicator]{width:var(--lkt-table-width-drag);height:40px;padding:0!important;position:relative;background:#eee;cursor:pointer}.lkt-table td[data-role=drag-indicator]:before,.lkt-table td[data-role=invalid-drag-indicator]:before{content:"";display:block;background:#eee;width:18px;height:36px;margin:auto}.lkt-table td[data-role=drag-indicator]:after,.lkt-table td[data-role=invalid-drag-indicator]:after{content:"…";color:#000;display:block;position:absolute;top:50%;left:50%;font-weight:700;width:15px;height:7px;transform:rotate(90deg);transform-origin:center center}[data-lkt=empty-table]{border:1px solid #ddd;border-radius:var(--lkt-table-border-radius);width:100%;padding:10px;background-color:#f8f7e5;font-family:var(--lkt-table-font-family);font-size:13px;color:#444;text-align:var(--lkt-table-text-align)}.sortable-chosen{border:var(--lkt-table-border-sortable-chosen)}.sortable-chosen.ghost{background:var(--lkt-table-bg-sortable-chosen-ghost)}.lkt-table td.lkt-table-nav-cell{padding:0}.lkt-table-nav-container{display:flex;align-items:center;flex-direction:column;justify-content:center}.lkt-table-page-buttons{position:sticky;top:calc(-1 * var(--lkt-table-gap-buttons));display:flex;align-items:center;gap:var(--lkt-table-gap-buttons);transition:all linear .15s;background:transparent;z-index:2}.lkt-table-page-buttons-bottom{justify-content:center}.lkt-table-page-buttons>.switch-edition-mode{margin-left:auto}.lkt-table .lkt-table-col-drop{width:var(--lkt-table-width-col-drop);text-align:var(--lkt-table-text-align-col-drop)}
1
+ .lkt-table-page,.lkt-table-page-content-wrapper{display:flex;width:100%;flex-direction:column;gap:var(--lkt-table-page-gap)}.lkt-table{width:var(--lkt-table-width);font-family:var(--lkt-table-font-family),serif}.lkt-table .lkt-field{--lkt-field-font-size: var(--lkt-table-font-size-row)}.lkt-table>table{width:100%;max-width:100%;border-collapse:var(--lkt-table-border-collapse);border-radius:var(--lkt-table-border-radius);border-spacing:var(--lkt-table-border-spacing)}.lkt-table th,.lkt-table td{vertical-align:middle;text-align:var(--lkt-table-text-align);padding:var(--lkt-table-padding-row);font-size:var(--lkt-table-font-size-row);color:var(--lkt-table-color-row)}.lkt-table th{font-family:var(--lkt-table-font-family-header),serif;padding:var(--lkt-table-padding-header)}.lkt-table thead tr{background-color:var(--lkt-table-bg-header)}.lkt-table tbody tr{background-color:var(--lkt-table-bg-row)}.lkt-table tbody tr:nth-child(odd){background-color:var(--lkt-table-bg-row-odd)}.lkt-table [data-sort=asc]>div,.lkt-table [data-sort=desc]>div{display:inline-block}.lkt-table [data-sort=asc]>div:after,.lkt-table [data-sort=desc]>div:after{font-family:var(--lkt-table-font-family-sort-icon),serif;display:inline-block;font-size:var(--lkt-table-font-size-sort-icon)}.lkt-table [data-sort=asc]>div:after{content:var(--lkt-table-sort-icon-content-asc)}.lkt-table [data-sort=desc]>div:after{content:var(--lkt-table-sort-icon-content-desc)}.lkt-table td[data-role=drag-indicator],.lkt-table td[data-role=invalid-drag-indicator]{width:var(--lkt-table-width-drag);height:40px;padding:0!important;position:relative;background:#eee;cursor:pointer}.lkt-table td[data-role=drag-indicator]:before,.lkt-table td[data-role=invalid-drag-indicator]:before{content:"";display:block;background:#eee;width:18px;height:36px;margin:auto}.lkt-table td[data-role=drag-indicator]:after,.lkt-table td[data-role=invalid-drag-indicator]:after{content:"…";color:#000;display:block;position:absolute;top:50%;left:50%;font-weight:700;width:15px;height:7px;transform:rotate(90deg);transform-origin:center center}[data-lkt=empty-table]{border:1px solid #ddd;border-radius:var(--lkt-table-border-radius);width:100%;padding:10px;background-color:#f8f7e5;font-family:var(--lkt-table-font-family);font-size:13px;color:#444;text-align:var(--lkt-table-text-align)}.sortable-chosen{border:var(--lkt-table-border-sortable-chosen)}.sortable-chosen.ghost{background:var(--lkt-table-bg-sortable-chosen-ghost)}.lkt-table td.lkt-table-nav-cell{padding:0}.lkt-table-nav-container{display:flex;align-items:center;flex-direction:column;justify-content:center}.lkt-table-page-buttons{position:sticky;top:calc(-1 * var(--lkt-table-gap-buttons));display:flex;align-items:center;gap:var(--lkt-table-gap-buttons);transition:all linear .15s;background:transparent;z-index:2}.lkt-table-page-buttons-bottom{justify-content:center}.lkt-table-page-buttons>.switch-edition-mode{margin-left:auto}.lkt-table .lkt-table-col-drop{width:var(--lkt-table-width-col-drop);text-align:var(--lkt-table-text-align-col-drop)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-table",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "lkt",
@@ -594,9 +594,10 @@ defineExpose({
594
594
  </table>
595
595
 
596
596
  <div v-else class="lkt-table-items-container" :class="itemsContainerClass">
597
- <div class="lkt-table-item" v-for="item in Items">
597
+ <div class="lkt-table-item" v-for="(item, i) in Items">
598
598
  <slot name="item"
599
599
  v-bind:item="item"
600
+ v-bind:index="i"
600
601
  v-bind:can-create="hasCreatePerm"
601
602
  v-bind:can-read="hasReadPerm"
602
603
  v-bind:can-update="hasUpdatePerm"