lkt-table 2.0.26 → 2.0.28

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 { defineComponent as re, computed as s, ref as I, shallowReactive as qt, watch as F, watchEffect as Pt, onMounted as Yt, onBeforeUnmount as Aa, reactive as Ft, provide as ia, h as K, useId as Va, inject as kt, getCurrentInstance as Ra, onUnmounted as Ma, onUpdated as La, cloneVNode as Na, resolveComponent as ye, createBlock as $, createElementBlock as k, unref as B, openBlock as v, normalizeProps as Re, mergeProps as ae, withCtx as P, createTextVNode as ot, toDisplayString as Xe, Fragment as q, withModifiers as ra, createCommentVNode as D, resolveDynamicComponent as Le, useSlots as ua, normalizeClass as Z, createElementVNode as x, createVNode as se, renderSlot as O, renderList as ie, withDirectives as Oe, vShow as Ue, mergeDefaults as $a, nextTick as Tt, createSlots as Zt } from "vue";
1
+ import { defineComponent as re, computed as s, ref as I, shallowReactive as qt, watch as F, watchEffect as Pt, onMounted as Yt, onBeforeUnmount as Aa, reactive as Ft, provide as ia, h as K, useId as Va, inject as kt, getCurrentInstance as Ra, onUnmounted as Ma, onUpdated as La, cloneVNode as Na, resolveComponent as ye, createBlock as $, createElementBlock as k, unref as B, openBlock as v, mergeProps as ae, withCtx as P, createTextVNode as ot, toDisplayString as Xe, Fragment as q, withModifiers as ra, createCommentVNode as D, resolveDynamicComponent as Me, useSlots as ua, normalizeClass as Z, createElementVNode as x, createVNode as se, renderSlot as O, renderList as ie, withDirectives as Oe, vShow as Ue, mergeDefaults as $a, nextTick as Tt, createSlots as Zt, normalizeProps as _e } from "vue";
2
2
  import { __ as _a } from "lkt-i18n";
3
3
  import { SortDirection as Ge, Column as sa, extractPropValue as Oa, ColumnType as ht, FieldType as xt, prepareResourceData as da, TableRowType as nt, extractI18nValue as ca, LktSettings as be, ensureButtonConfig as Ee, TablePermission as Ae, PaginatorType as Et, TableType as qe, getDefaultValues as Ua, Table as Pa, ButtonType as jt } from "lkt-vue-kernel";
4
4
  import { Column as Cn, createColumn as wn } from "lkt-vue-kernel";
@@ -348,7 +348,7 @@ const el = re({
348
348
  const a = Ga(i), f = a.getSlides(), y = s(() => f.length), b = I(null), T = I(null), u = I(0), m = s(() => Object.assign(Object.assign(Object.assign({}, H), Ka(t, ["breakpoints", "modelValue"])), { i18n: Object.assign(Object.assign({}, H.i18n), t.i18n) })), c = qt(Object.assign({}, m.value)), S = I((l = t.modelValue) !== null && l !== void 0 ? l : 0), V = I(S.value);
349
349
  F(S, (d) => V.value = d);
350
350
  const E = I(0), le = s(() => Math.ceil((y.value - 1) / 2)), j = s(() => y.value - 1), de = s(() => 0);
351
- let ce = null, Ne = null, ue = null;
351
+ let ce = null, Le = null, ue = null;
352
352
  const Y = s(() => u.value + c.gap), r = s(() => {
353
353
  const d = c.dir || "ltr";
354
354
  return d in Vt ? Vt[d] : d;
@@ -363,7 +363,7 @@ const el = re({
363
363
  const rt = zt(() => {
364
364
  he(), Ke(), ke();
365
365
  }), Pe = qt(/* @__PURE__ */ new Set()), ne = I([]);
366
- function $e({ widthMultiplier: d, heightMultiplier: h }) {
366
+ function Ne({ widthMultiplier: d, heightMultiplier: h }) {
367
367
  ne.value = f.map((C) => {
368
368
  var A;
369
369
  const L = (A = C.exposed) === null || A === void 0 ? void 0 : A.getBoundingRect();
@@ -389,7 +389,7 @@ const el = re({
389
389
  if (!T.value)
390
390
  return;
391
391
  const d = Qa(Pe);
392
- if (Mt(d), $e(d), U.value)
392
+ if (Mt(d), Ne(d), U.value)
393
393
  u.value = Xa(ne.value.map((h) => h[M.value]));
394
394
  else {
395
395
  const h = Number(c.itemsToShow), C = (h - 1) * c.gap;
@@ -431,14 +431,14 @@ const el = re({
431
431
  }), Yt(() => {
432
432
  Je.value = !0, he(), Ze(), b.value && (ue = new ResizeObserver(rt), ue.observe(b.value)), i("init");
433
433
  }), Aa(() => {
434
- Je.value = !1, a.cleanup(), Ne && clearTimeout(Ne), Se && cancelAnimationFrame(Se), ce && clearInterval(ce), ue && (ue.disconnect(), ue = null), typeof document < "u" && dt(), b.value && (b.value.removeEventListener("transitionend", ke), b.value.removeEventListener("animationiteration", ke));
434
+ Je.value = !1, a.cleanup(), Le && clearTimeout(Le), Se && cancelAnimationFrame(Se), ce && clearInterval(ce), ue && (ue.disconnect(), ue = null), typeof document < "u" && dt(), b.value && (b.value.removeEventListener("transitionend", ke), b.value.removeEventListener("animationiteration", ke));
435
435
  });
436
436
  let De = !1;
437
437
  const je = { x: 0, y: 0 }, fe = Ft({ x: 0, y: 0 }), ze = I(!1), ut = I(!1), st = () => {
438
438
  ze.value = !0;
439
439
  }, Lt = () => {
440
440
  ze.value = !1;
441
- }, _e = zt((d) => {
441
+ }, $e = zt((d) => {
442
442
  if (!d.ctrlKey)
443
443
  switch (d.key) {
444
444
  case "ArrowLeft":
@@ -451,9 +451,9 @@ const el = re({
451
451
  break;
452
452
  }
453
453
  }, 200), Nt = () => {
454
- document.addEventListener("keydown", _e);
454
+ document.addEventListener("keydown", $e);
455
455
  }, dt = () => {
456
- document.removeEventListener("keydown", _e);
456
+ document.removeEventListener("keydown", $e);
457
457
  };
458
458
  function St(d) {
459
459
  const h = d.target.tagName;
@@ -519,7 +519,7 @@ const el = re({
519
519
  currentSlideIndex: S.value,
520
520
  prevSlideIndex: E.value,
521
521
  slidesCount: y.value
522
- }), pe(), z.value = !0, S.value = C, A !== C && vt.pause(), i("update:modelValue", A), Ne = setTimeout(() => {
522
+ }), pe(), z.value = !0, S.value = C, A !== C && vt.pause(), i("update:modelValue", A), Le = setTimeout(() => {
523
523
  c.wrapAround && A !== C && (vt.resume(), S.value = A, i("loop", {
524
524
  currentSlideIndex: S.value,
525
525
  slidingToIndex: d
@@ -986,7 +986,8 @@ const la = (t) => t && nl(t), na = re({
986
986
  columns: { default: () => [] },
987
987
  i: { default: 0 },
988
988
  editModeEnabled: { type: Boolean, default: !1 },
989
- hasInlineEditPerm: { type: Boolean, default: !1 }
989
+ hasInlineEditPerm: { type: Boolean, default: !1 },
990
+ tableType: {}
990
991
  },
991
992
  emits: [
992
993
  "update:modelValue"
@@ -1011,19 +1012,19 @@ const la = (t) => t && nl(t), na = re({
1011
1012
  return (V = n.column.field) == null ? void 0 : V.modalData;
1012
1013
  }), T = s(() => typeof n.column.field == "string" && n.column.field.startsWith("prop:") ? Oa(n.column.field, l.value) : n.column.field), u = s(() => {
1013
1014
  var m, c, S, V;
1014
- return n.column.type === ht.Field ? !((c = (m = n.column) == null ? void 0 : m.field) != null && c.label) && [
1015
+ return n.column.type === ht.Field ? !((c = (m = n.column) == null ? void 0 : m.field) != null && c.label) && (n.column.ensureFieldLabel || [
1015
1016
  xt.Switch,
1016
1017
  xt.Check
1017
- ].includes((S = n.column.field) == null ? void 0 : S.type) ? n.column.label : (V = n.column.field) == null ? void 0 : V.label : "";
1018
+ ].includes((S = n.column.field) == null ? void 0 : S.type)) ? n.column.label : (V = n.column.field) == null ? void 0 : V.label : "";
1018
1019
  });
1019
1020
  return (m, c) => {
1020
1021
  const S = ye("lkt-anchor"), V = ye("lkt-button"), E = ye("lkt-field");
1021
- return m.column.type === B(ht).Anchor ? (v(), $(S, Re(ae({ key: 0 }, m.column.anchor)), {
1022
+ return m.column.type === B(ht).Anchor ? (v(), $(S, ae({ key: 0 }, m.column.anchor, { prop: l.value }), {
1022
1023
  default: P(() => [
1023
1024
  ot(Xe(B(it)(m.column, l.value, m.i)), 1)
1024
1025
  ]),
1025
1026
  _: 1
1026
- }, 16)) : m.column.type === B(ht).Button ? (v(), $(V, ae({ key: 1 }, m.column.button, { prop: l.value }), {
1027
+ }, 16, ["prop"])) : m.column.type === B(ht).Button ? (v(), $(V, ae({ key: 1 }, m.column.button, { prop: l.value }), {
1027
1028
  default: P(() => [
1028
1029
  ot(Xe(B(it)(m.column, l.value, m.i)), 1)
1029
1030
  ]),
@@ -1050,10 +1051,10 @@ const la = (t) => t && nl(t), na = re({
1050
1051
  ], 64));
1051
1052
  };
1052
1053
  }
1053
- }), Me = class Me {
1054
+ }), Re = class Re {
1054
1055
  };
1055
- Me.navButtonSlot = "", Me.dropButtonSlot = "", Me.editButtonSlot = "", Me.createButtonSlot = "", Me.defaultEmptySlot = void 0, Me.defaultSaveIcon = "", Me.defaultNoResultsMessage = "No results";
1056
- let W = Me;
1056
+ Re.navButtonSlot = "", Re.dropButtonSlot = "", Re.editButtonSlot = "", Re.createButtonSlot = "", Re.defaultEmptySlot = void 0, Re.defaultSaveIcon = "", Re.defaultNoResultsMessage = "No results";
1057
+ let W = Re;
1057
1058
  const fl = /* @__PURE__ */ re({
1058
1059
  __name: "DropButtonComponent",
1059
1060
  props: {
@@ -1074,7 +1075,7 @@ const fl = /* @__PURE__ */ re({
1074
1075
  onClick: b[0] || (b[0] = ra((u) => i("click", u), ["prevent", "stop"]))
1075
1076
  }), {
1076
1077
  default: P(() => [
1077
- l.value ? (v(), $(Le(a.value), { key: 0 })) : D("", !0)
1078
+ l.value ? (v(), $(Me(a.value), { key: 0 })) : D("", !0)
1078
1079
  ]),
1079
1080
  _: 1
1080
1081
  }, 16, ["disabled", "resource-data"]);
@@ -1100,7 +1101,7 @@ const fl = /* @__PURE__ */ re({
1100
1101
  onClick: b[0] || (b[0] = ra((u) => i("click"), ["prevent", "stop"]))
1101
1102
  }), {
1102
1103
  default: P(() => [
1103
- l.value ? (v(), $(Le(a.value), { key: 0 })) : D("", !0)
1104
+ l.value ? (v(), $(Me(a.value), { key: 0 })) : D("", !0)
1104
1105
  ]),
1105
1106
  _: 1
1106
1107
  }, 16, ["disabled", "resource-data"]);
@@ -1178,7 +1179,7 @@ const fl = /* @__PURE__ */ re({
1178
1179
  F(() => l.modelValue, (r) => a.value = r), F(a, (r) => {
1179
1180
  n("update:modelValue", r);
1180
1181
  }, { deep: !0 });
1181
- const de = s(() => typeof l.renderDrag == "function" ? l.renderDrag(a.value) : l.renderDrag === !0), ce = s(() => typeof l.disabledDrag == "function" ? l.disabledDrag(a.value) : l.disabledDrag === !0), Ne = s(() => c.value.includes("handle") ? "drag-indicator" : "invalid-drag-indicator"), ue = s(() => {
1182
+ const de = s(() => typeof l.renderDrag == "function" ? l.renderDrag(a.value) : l.renderDrag === !0), ce = s(() => typeof l.disabledDrag == "function" ? l.disabledDrag(a.value) : l.disabledDrag === !0), Le = s(() => c.value.includes("handle") ? "drag-indicator" : "invalid-drag-indicator"), ue = s(() => {
1182
1183
  let r = [];
1183
1184
  return y && r.push("type-custom-item"), b && r.push("type-item"), typeof l.itemContainerClass == "function" ? r.push(l.itemContainerClass(a.value, l.i)) : l.itemContainerClass !== "" && r.push(l.itemContainerClass), r.join(" ");
1184
1185
  });
@@ -1191,7 +1192,7 @@ const fl = /* @__PURE__ */ re({
1191
1192
  }, [
1192
1193
  r.sortable && r.editModeEnabled && de.value ? (v(), k("td", {
1193
1194
  key: 0,
1194
- "data-role": Ne.value,
1195
+ "data-role": Le.value,
1195
1196
  class: Z(c.value),
1196
1197
  "data-i": r.i
1197
1198
  }, _[3] || (_[3] = [
@@ -1205,7 +1206,7 @@ const fl = /* @__PURE__ */ re({
1205
1206
  onClick: E
1206
1207
  }, {
1207
1208
  default: P(() => [
1208
- S.value ? (v(), $(Le(V.value), {
1209
+ S.value ? (v(), $(Me(V.value), {
1209
1210
  key: 0,
1210
1211
  direction: "up"
1211
1212
  })) : (v(), k("i", hl))
@@ -1218,7 +1219,7 @@ const fl = /* @__PURE__ */ re({
1218
1219
  onClick: le
1219
1220
  }, {
1220
1221
  default: P(() => [
1221
- S.value ? (v(), $(Le(V.value), {
1222
+ S.value ? (v(), $(Me(V.value), {
1222
1223
  key: 0,
1223
1224
  direction: "down"
1224
1225
  })) : (v(), k("i", kl))
@@ -1402,7 +1403,7 @@ const fl = /* @__PURE__ */ re({
1402
1403
  onClick: b
1403
1404
  }), {
1404
1405
  default: P(() => [
1405
- l.value ? (v(), $(Le(a.value), { key: 0 })) : D("", !0)
1406
+ l.value ? (v(), $(Me(a.value), { key: 0 })) : D("", !0)
1406
1407
  ]),
1407
1408
  _: 1
1408
1409
  }, 16, ["disabled"]);
@@ -1525,16 +1526,16 @@ const fl = /* @__PURE__ */ re({
1525
1526
  ],
1526
1527
  setup(t, { expose: o, emit: i }) {
1527
1528
  var Jt, Qt;
1528
- const n = i, l = ua(), a = t, f = {}, y = I(typeof a.sorter == "function" ? a.sorter : rl), b = I(cl(a.columns)), T = I(Ge.Asc), u = I(a.modelValue), m = I(f), c = I(null), S = I(a.columns), V = I((Jt = a.paginator) == null ? void 0 : Jt.modelValue), E = I(a.loading), le = I(!1), j = I(a.perms), de = I(null), ce = I(null), Ne = I(null), ue = I({}), Y = I(new ja({ items: u.value }, a.dataStateConfig)), r = I(a.editMode), _ = I(0), ee = I(null), U = I(((Qt = a.carousel) == null ? void 0 : Qt.currentSlide) || 0), M = I(Ee(a.saveButton, be.defaultSaveButton)), he = I(Ee(a.createButton, be.defaultCreateButton)), rt = I(Ee(a.editModeButton, be.defaultEditModeButton)), Pe = I(Ee(a.dropButton, be.defaultDropButton)), ne = I(Ee(a.groupButton, be.defaultGroupButton));
1529
+ const n = i, l = ua(), a = t, f = {}, y = I(typeof a.sorter == "function" ? a.sorter : rl), b = I(cl(a.columns)), T = I(Ge.Asc), u = I(a.modelValue), m = I(f), c = I(null), S = I(a.columns), V = I((Jt = a.paginator) == null ? void 0 : Jt.modelValue), E = I(a.loading), le = I(!1), j = I(a.perms), de = I(null), ce = I(null), Le = I(null), ue = I({}), Y = I(new ja({ items: u.value }, a.dataStateConfig)), r = I(a.editMode), _ = I(0), ee = I(null), U = I(((Qt = a.carousel) == null ? void 0 : Qt.currentSlide) || 0), M = I(Ee(a.saveButton, be.defaultSaveButton)), he = I(Ee(a.createButton, be.defaultCreateButton)), rt = I(Ee(a.editModeButton, be.defaultEditModeButton)), Pe = I(Ee(a.dropButton, be.defaultDropButton)), ne = I(Ee(a.groupButton, be.defaultGroupButton));
1529
1530
  F(() => a.saveButton, (e) => M.value = Ee(a.saveButton, be.defaultSaveButton)), F(() => a.createButton, (e) => he.value = Ee(a.createButton, be.defaultCreateButton)), F(() => a.editModeButton, (e) => rt.value = Ee(a.editModeButton, be.defaultEditModeButton)), F(() => a.dropButton, (e) => Pe.value = Ee(a.dropButton, be.defaultDropButton));
1530
- const $e = I(!1);
1531
+ const Ne = I(!1);
1531
1532
  F(E, (e) => n("update:loading", e)), F(V, (e) => n("page", e));
1532
1533
  const Fe = (e) => {
1533
1534
  j.value = e;
1534
1535
  }, Mt = (e) => {
1535
1536
  var p;
1536
- Array.isArray(e.data) && ((!a.paginator || ![Et.LoadMore, Et.Infinite].includes((p = a.paginator) == null ? void 0 : p.type)) && u.value.splice(0, u.value.length), u.value = [...u.value, ...e.data]), E.value = !1, le.value = !0, Y.value.store({ items: u.value }).turnStoredIntoOriginal(), $e.value = !1, Tt(() => {
1537
- me(), _e.value, n("read-response", e);
1537
+ Array.isArray(e.data) && ((!a.paginator || ![Et.LoadMore, Et.Infinite].includes((p = a.paginator) == null ? void 0 : p.type)) && u.value.splice(0, u.value.length), u.value = [...u.value, ...e.data]), E.value = !1, le.value = !0, Y.value.store({ items: u.value }).turnStoredIntoOriginal(), Ne.value = !1, Tt(() => {
1538
+ me(), $e.value, n("read-response", e);
1538
1539
  });
1539
1540
  }, ke = () => Tt(() => E.value = !0), Ke = () => {
1540
1541
  de.value.doRefresh();
@@ -1562,13 +1563,13 @@ const fl = /* @__PURE__ */ re({
1562
1563
  return e;
1563
1564
  }), st = s(() => {
1564
1565
  var e;
1565
- return a.hiddenSave || E.value || !((e = M.value) != null && e.resource || M.value.type) ? !1 : r.value && $e.value ? !0 : r.value;
1566
- }), Lt = s(() => gt.value && u.value.length >= a.requiredItemsForTopCreate || He.value ? !0 : st.value || r.value && pe.value), _e = s(() => {
1566
+ return a.hiddenSave || E.value || !((e = M.value) != null && e.resource || M.value.type) ? !1 : r.value && Ne.value ? !0 : r.value;
1567
+ }), Lt = s(() => gt.value && u.value.length >= a.requiredItemsForTopCreate || He.value ? !0 : st.value || r.value && pe.value), $e = s(() => {
1567
1568
  var e, p;
1568
1569
  return _.value, typeof ((e = M.value) == null ? void 0 : e.disabled) == "function" ? M.value.disabled({
1569
1570
  value: u.value,
1570
1571
  dataState: Y.value
1571
- }) : typeof ((p = M.value) == null ? void 0 : p.disabled) == "boolean" ? M.value.disabled : !$e.value;
1572
+ }) : typeof ((p = M.value) == null ? void 0 : p.disabled) == "boolean" ? M.value.disabled : !Ne.value;
1572
1573
  }), Nt = s(() => u.value.length), dt = s(() => {
1573
1574
  var e;
1574
1575
  return {
@@ -1637,7 +1638,7 @@ const fl = /* @__PURE__ */ re({
1637
1638
  n("error", p.httpStatus);
1638
1639
  return;
1639
1640
  }
1640
- Y.value.turnStoredIntoOriginal(), $e.value = !1, n("save", p);
1641
+ Y.value.turnStoredIntoOriginal(), Ne.value = !1, n("save", p);
1641
1642
  }
1642
1643
  }, Dt = (e, p, N) => {
1643
1644
  if (N >= e.length) {
@@ -1676,7 +1677,7 @@ const fl = /* @__PURE__ */ re({
1676
1677
  }, Ut = s(() => typeof a.createEnabledValidator == "function" ? a.createEnabledValidator({ items: u.value }) : !0), gt = s(() => vt.value || pe.value && r.value || Ct.value && r.value || xe.value && r.value), Ca = s(() => [qe.Ol, qe.Ul].includes(a.type)), bt = (e, p) => typeof a.itemDisplayChecker == "function" ? a.itemDisplayChecker(e) : !0, It = (e, p) => typeof a.itemContainerClass == "function" ? a.itemContainerClass(e, p) : a.itemContainerClass, wa = (e, p) => tt.value ? e[tt.value.key] : "";
1677
1678
  Yt(() => {
1678
1679
  var e;
1679
- a.initialSorting && d(vl(a.columns, b.value)), Y.value.store({ items: u.value }).turnStoredIntoOriginal(), $e.value = !1, (e = a.drag) != null && e.enabled && Tt(() => {
1680
+ a.initialSorting && d(vl(a.columns, b.value)), Y.value.store({ items: u.value }).turnStoredIntoOriginal(), Ne.value = !1, (e = a.drag) != null && e.enabled && Tt(() => {
1680
1681
  Ot();
1681
1682
  });
1682
1683
  }), F(() => {
@@ -1692,7 +1693,7 @@ const fl = /* @__PURE__ */ re({
1692
1693
  }), F(() => a.editMode, (e) => r.value = e), F(() => a.columns, (e) => S.value = e, { deep: !0 }), F(() => a.modelValue, (e) => {
1693
1694
  u.value = e;
1694
1695
  }, { deep: !0 }), F(u, (e) => {
1695
- Y.value.increment({ items: e }), $e.value = Y.value.changed(), n("update:modelValue", e);
1696
+ Y.value.increment({ items: e }), Ne.value = Y.value.changed(), n("update:modelValue", e);
1696
1697
  }, { deep: !0 }), o({
1697
1698
  getItemByEvent: $t,
1698
1699
  getItemByIndex: wt,
@@ -1722,7 +1723,7 @@ const fl = /* @__PURE__ */ re({
1722
1723
  key: 0,
1723
1724
  class: Z(e.headerClass)
1724
1725
  }, [
1725
- Qe.value ? (v(), $(Le(St.value), { key: 0 }, {
1726
+ Qe.value ? (v(), $(Me(St.value), { key: 0 }, {
1726
1727
  default: P(() => [
1727
1728
  e.titleIcon ? (v(), k("i", {
1728
1729
  key: 0,
@@ -1734,7 +1735,7 @@ const fl = /* @__PURE__ */ re({
1734
1735
  })) : D("", !0),
1735
1736
  B(l).title ? O(e.$slots, "title", { key: 1 }) : D("", !0)
1736
1737
  ], 2)) : D("", !0),
1737
- (v(), $(Le(ct.value), {
1738
+ (v(), $(Me(ct.value), {
1738
1739
  class: Z(["lkt-table-page-content-wrapper", e.wrapContentClass])
1739
1740
  }, {
1740
1741
  default: P(() => {
@@ -1769,10 +1770,10 @@ const fl = /* @__PURE__ */ re({
1769
1770
  Oe(se(N, ae({
1770
1771
  class: "lkt-table--save-button",
1771
1772
  ref_key: "saveButtonRef",
1772
- ref: Ne
1773
+ ref: Le
1773
1774
  }, {
1774
1775
  ...M.value,
1775
- disabled: _e.value,
1776
+ disabled: $e.value,
1776
1777
  resourceData: dt.value
1777
1778
  }, {
1778
1779
  onLoading: J,
@@ -1793,7 +1794,7 @@ const fl = /* @__PURE__ */ re({
1793
1794
  key: 0,
1794
1795
  items: u.value,
1795
1796
  editMode: e.editMode,
1796
- canUpdate: !_e.value
1797
+ canUpdate: !$e.value
1797
1798
  }) : D("", !0)
1798
1799
  ]),
1799
1800
  _: 3
@@ -1825,10 +1826,10 @@ const fl = /* @__PURE__ */ re({
1825
1826
  Oe(se(N, ae({
1826
1827
  class: "lkt-table--save-button",
1827
1828
  ref_key: "saveButtonRef",
1828
- ref: Ne
1829
+ ref: Le
1829
1830
  }, {
1830
1831
  ...M.value,
1831
- disabled: _e.value,
1832
+ disabled: $e.value,
1832
1833
  resourceData: dt.value
1833
1834
  }, {
1834
1835
  onLoading: J,
@@ -1849,7 +1850,7 @@ const fl = /* @__PURE__ */ re({
1849
1850
  key: 0,
1850
1851
  items: u.value,
1851
1852
  editMode: e.editMode,
1852
- canUpdate: !_e.value
1853
+ canUpdate: !$e.value
1853
1854
  }) : D("", !0)
1854
1855
  ]),
1855
1856
  _: 3
@@ -1946,7 +1947,7 @@ const fl = /* @__PURE__ */ re({
1946
1947
  B(l)[`item-${g}`] ? {
1947
1948
  name: `item-${g}`,
1948
1949
  fn: P((R) => [
1949
- O(e.$slots, `item-${g}`, Re({
1950
+ O(e.$slots, `item-${g}`, _e({
1950
1951
  [e.slotItemVar || ""]: R.item,
1951
1952
  index: g,
1952
1953
  editing: R.editing,
@@ -1962,7 +1963,7 @@ const fl = /* @__PURE__ */ re({
1962
1963
  } : B(l).item ? {
1963
1964
  name: "item",
1964
1965
  fn: P((R) => [
1965
- O(e.$slots, "item", Re({
1966
+ O(e.$slots, "item", _e({
1966
1967
  [e.slotItemVar || ""]: R.item,
1967
1968
  index: g,
1968
1969
  editing: R.editing,
@@ -1979,7 +1980,7 @@ const fl = /* @__PURE__ */ re({
1979
1980
  ie(ze.value, (R) => ({
1980
1981
  name: R,
1981
1982
  fn: P((Be) => [
1982
- O(e.$slots, R, Re({
1983
+ O(e.$slots, R, _e({
1983
1984
  [e.slotItemVar || ""]: Be.item,
1984
1985
  value: Be.value,
1985
1986
  column: Be.column
@@ -2009,7 +2010,7 @@ const fl = /* @__PURE__ */ re({
2009
2010
  ie(ze.value, (R) => ({
2010
2011
  name: R,
2011
2012
  fn: P((Be) => [
2012
- O(e.$slots, R, Re({
2013
+ O(e.$slots, R, _e({
2013
2014
  [e.slotItemVar || ""]: Be.item,
2014
2015
  value: Be.value,
2015
2016
  column: Be.column
@@ -2031,7 +2032,7 @@ const fl = /* @__PURE__ */ re({
2031
2032
  "data-i": g,
2032
2033
  key: mt(w, g)
2033
2034
  }, [
2034
- O(e.$slots, "item", Re({
2035
+ O(e.$slots, "item", _e({
2035
2036
  [e.slotItemVar || ""]: w,
2036
2037
  index: g,
2037
2038
  editing: r.value,
@@ -2042,7 +2043,7 @@ const fl = /* @__PURE__ */ re({
2042
2043
  isLoading: E.value,
2043
2044
  doDrop: () => pt(g)
2044
2045
  }))
2045
- ], 10, Ql)) : bt(w) ? O(e.$slots, "item", Re({
2046
+ ], 10, Ql)) : bt(w) ? O(e.$slots, "item", _e({
2046
2047
  class: It(w, g),
2047
2048
  dataI: g,
2048
2049
  key: mt(w, g),
@@ -2105,7 +2106,7 @@ const fl = /* @__PURE__ */ re({
2105
2106
  _: 2
2106
2107
  }, 1040, ["class", "data-i"])) : D("", !0)
2107
2108
  ], 64))), 256))
2108
- ], 10, Zl)) : Ca.value ? (v(), $(Le(e.type), {
2109
+ ], 10, Zl)) : Ca.value ? (v(), $(Me(e.type), {
2109
2110
  key: 3,
2110
2111
  class: Z(["lkt-table-items-container", e.itemsContainerClass])
2111
2112
  }, {
@@ -2116,7 +2117,7 @@ const fl = /* @__PURE__ */ re({
2116
2117
  class: Z(["lkt-table-item", It(w, g)]),
2117
2118
  "data-i": g
2118
2119
  }, [
2119
- O(e.$slots, "item", Re({
2120
+ O(e.$slots, "item", _e({
2120
2121
  [e.slotItemVar || ""]: w,
2121
2122
  index: g,
2122
2123
  editing: r.value,
@@ -2166,7 +2167,7 @@ const fl = /* @__PURE__ */ re({
2166
2167
  }, {
2167
2168
  default: P(() => [
2168
2169
  x("div", an, [
2169
- O(e.$slots, "item", Re({
2170
+ O(e.$slots, "item", _e({
2170
2171
  [e.slotItemVar || ""]: w,
2171
2172
  index: g,
2172
2173
  editing: r.value,
@@ -2189,7 +2190,7 @@ const fl = /* @__PURE__ */ re({
2189
2190
  [Ue, et.value]
2190
2191
  ]),
2191
2192
  !E.value && u.value.length === 0 ? (v(), k("div", ln, [
2192
- B(l).empty ? O(e.$slots, "empty", { key: 0 }) : Ba.value ? (v(), $(Le(Da.value), {
2193
+ B(l).empty ? O(e.$slots, "empty", { key: 0 }) : Ba.value ? (v(), $(Me(Da.value), {
2193
2194
  key: 1,
2194
2195
  message: e.noResultsText
2195
2196
  }, null, 8, ["message"])) : e.noResultsText ? (v(), k(q, { key: 2 }, [
@@ -1,4 +1,4 @@
1
- import { Column, LktObject } from "lkt-vue-kernel";
1
+ import { Column, LktObject, TableType } from "lkt-vue-kernel";
2
2
  type __VLS_Props = {
3
3
  modelValue: LktObject;
4
4
  column: Column;
@@ -6,6 +6,7 @@ type __VLS_Props = {
6
6
  i: number;
7
7
  editModeEnabled: boolean;
8
8
  hasInlineEditPerm: boolean;
9
+ tableType: TableType;
9
10
  };
10
11
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
12
  "update:modelValue": (...args: any[]) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-table",
3
- "version": "2.0.26",
3
+ "version": "2.0.28",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "lkt",
@@ -1,7 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import {getColumnDisplayContent} from "../functions/table-functions";
3
3
  import {computed, ref, watch} from "vue";
4
- import {Column, ColumnType, extractPropValue, FieldType, LktObject} from "lkt-vue-kernel";
4
+ import {Column, ColumnType, extractPropValue, FieldType, LktObject, TableType} from "lkt-vue-kernel";
5
5
 
6
6
  const emit = defineEmits([
7
7
  'update:modelValue'
@@ -14,6 +14,7 @@ const props = withDefaults(defineProps<{
14
14
  i: number
15
15
  editModeEnabled: boolean
16
16
  hasInlineEditPerm: boolean
17
+ tableType: TableType
17
18
  }>(), {
18
19
  modelValue: () => ({}),
19
20
  column: () => (new Column()),
@@ -66,11 +67,13 @@ const computedFieldConfig = computed(() => {
66
67
 
67
68
  const computedFieldLabel = computed(() => {
68
69
  if (props.column.type === ColumnType.Field) {
69
- if (!props.column?.field?.label && [
70
- FieldType.Switch,
71
- FieldType.Check,
72
- ].includes(props.column.field?.type)) {
73
- return props.column.label;
70
+ if (!props.column?.field?.label) {
71
+ if (props.column.ensureFieldLabel || [
72
+ FieldType.Switch,
73
+ FieldType.Check,
74
+ ].includes(props.column.field?.type)) {
75
+ return props.column.label;
76
+ }
74
77
  }
75
78
 
76
79
  return props.column.field?.label;
@@ -83,6 +86,7 @@ const computedFieldLabel = computed(() => {
83
86
  <template v-if="column.type === ColumnType.Anchor">
84
87
  <lkt-anchor
85
88
  v-bind="column.anchor"
89
+ :prop="item"
86
90
  >{{ getColumnDisplayContent(column, item, i) }}</lkt-anchor>
87
91
  </template>
88
92
  <template v-else-if="column.type === ColumnType.Button">