lkt-table 2.0.3 → 2.0.4

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,15 +1,15 @@
1
- import { defineComponent as x, ref as h, watch as F, computed as r, resolveComponent as _, createBlock as S, createElementBlock as s, unref as c, openBlock as u, normalizeProps as oe, mergeProps as Z, withCtx as P, createTextVNode as ne, toDisplayString as ue, Fragment as N, withModifiers as rt, createCommentVNode as f, resolveDynamicComponent as Y, useSlots as dt, normalizeClass as J, createElementVNode as j, createVNode as me, renderSlot as $, renderList as G, withDirectives as be, vShow as ke, mergeDefaults as _t, onMounted as zt, nextTick as Be, createSlots as at } from "vue";
2
- import { __ as st } from "lkt-i18n";
3
- import { SortDirection as ge, Column as pt, ColumnType as ae, TableRowType as se, ensureButtonConfig as ot, LktSettings as nt, extractI18nValue as ut, TablePermission as Q, PaginatorType as Se, TableType as ye, getDefaultValues as Gt, Table as Jt, ButtonType as Le } from "lkt-vue-kernel";
1
+ import { defineComponent as ee, ref as k, watch as F, computed as d, resolveComponent as W, createBlock as S, createElementBlock as s, unref as y, openBlock as u, normalizeProps as oe, mergeProps as Q, withCtx as P, createTextVNode as ne, toDisplayString as ue, Fragment as L, withModifiers as it, createCommentVNode as c, resolveDynamicComponent as Z, useSlots as rt, normalizeClass as J, createElementVNode as _, createVNode as me, renderSlot as T, renderList as G, withDirectives as be, vShow as ge, mergeDefaults as Kt, onMounted as Wt, nextTick as Be, createSlots as nt } from "vue";
2
+ import { __ as dt } from "lkt-i18n";
3
+ import { SortDirection as ke, Column as st, ColumnType as ae, TableRowType as se, ensureButtonConfig as Pe, LktSettings as Le, extractI18nValue as zt, TablePermission as X, PaginatorType as Se, TableType as ye, getDefaultValues as Gt, Table as Jt, ButtonType as Ne } from "lkt-vue-kernel";
4
4
  import { Column as na, createColumn as ua } from "lkt-vue-kernel";
5
- import { replaceAll as mt, generateRandomString as Qt } from "lkt-string-tools";
5
+ import { replaceAll as pt, generateRandomString as Qt } from "lkt-string-tools";
6
6
  import { DataState as Xt } from "lkt-data-state";
7
7
  import Yt from "sortablejs";
8
8
  import { time as pe } from "lkt-date-tools";
9
- const Zt = (o, p, v, n) => {
10
- if (!v) return 0;
11
- let a = o[v.key], t = p[v.key];
12
- if (n === ge.Asc) {
9
+ const Zt = (o, m, f, n) => {
10
+ if (!f) return 0;
11
+ let a = o[f.key], t = m[f.key];
12
+ if (n === ke.Asc) {
13
13
  if (a > t) return 1;
14
14
  if (t > a) return -1;
15
15
  } else {
@@ -17,168 +17,158 @@ const Zt = (o, p, v, n) => {
17
17
  if (t > a) return 1;
18
18
  }
19
19
  return 0;
20
- }, ve = (o, p, v, n = []) => {
20
+ }, ve = (o, m, f, n = []) => {
21
21
  if (o.extractTitleFromColumn) {
22
22
  let a = n.find((t) => t.key === o.extractTitleFromColumn);
23
23
  if (a)
24
- return ve(a, p, v, n);
24
+ return ve(a, m, f, n);
25
25
  }
26
26
  if (o.formatter && typeof o.formatter == "function") {
27
- let a = o.formatter(p[o.key], p, o, v);
28
- return a.startsWith("__:") ? st(a.substring(3)) : a;
27
+ let a = o.formatter(m[o.key], m, o, f);
28
+ return a.startsWith("__:") ? dt(a.substring(3)) : a;
29
29
  }
30
- return p[o.key];
31
- }, xt = (o, p, v) => {
30
+ return m[o.key];
31
+ }, xt = (o, m, f) => {
32
32
  if (!o.colspan) return -1;
33
- let n = p;
34
- return v.forEach((a) => {
35
- let t = Pe(o, a);
33
+ let n = m;
34
+ return f.forEach((a) => {
35
+ let t = Fe(o, a);
36
36
  t > 0 && t < n && (n = t);
37
37
  }), n;
38
- }, Pe = (o, p) => o.colspan === !1 ? !1 : typeof o.colspan == "function" ? o.colspan(p) : o.colspan, el = (o, p) => typeof o.preferSlot > "u" ? !0 : o.preferSlot === !1 ? !1 : typeof o.preferSlot == "function" ? o.preferSlot(p) : !0, tl = (o, p, v) => {
39
- if (typeof o != "object" || !o.key || p.indexOf(o.key) > -1) return !1;
40
- let n = Pe(o, v);
41
- return typeof o.colspan > "u" ? !0 : (typeof o.colspan < "u" && (typeof o.colspan == "function" ? n = parseInt(o.colspan(v)) : n = parseInt(o.colspan)), n > 0);
38
+ }, Fe = (o, m) => o.colspan === !1 ? !1 : typeof o.colspan == "function" ? o.colspan(m) : o.colspan, el = (o, m) => typeof o.preferSlot > "u" ? !0 : o.preferSlot === !1 ? !1 : typeof o.preferSlot == "function" ? o.preferSlot(m) : !0, tl = (o, m, f) => {
39
+ if (typeof o != "object" || !o.key || m.indexOf(o.key) > -1) return !1;
40
+ let n = Fe(o, f);
41
+ return typeof o.colspan > "u" ? !0 : (typeof o.colspan < "u" && (typeof o.colspan == "function" ? n = parseInt(o.colspan(f)) : n = parseInt(o.colspan)), n > 0);
42
42
  }, ll = (o = []) => {
43
43
  if (o.length > 0) {
44
- for (let p = 0; p < o.length; ++p)
45
- if (o[p].sortable) return o[p].key;
44
+ for (let m = 0; m < o.length; ++m)
45
+ if (o[m].sortable) return o[m].key;
46
46
  }
47
47
  return "";
48
- }, al = (o, p) => {
48
+ }, al = (o, m) => {
49
49
  if (o.length > 0) {
50
- for (let v = 0; v < o.length; ++v)
51
- if (o[v].key === p) return o[v];
50
+ for (let f = 0; f < o.length; ++f)
51
+ if (o[f].key === m) return o[f];
52
52
  }
53
53
  return null;
54
- }, vt = (o) => o.type ? `is-${o.type}` : "", ft = /* @__PURE__ */ x({
54
+ }, mt = (o) => o.type ? `is-${o.type}` : "", vt = /* @__PURE__ */ ee({
55
55
  __name: "LktTableCell",
56
56
  props: {
57
57
  modelValue: { default: () => ({}) },
58
- column: { default: () => new pt() },
58
+ column: { default: () => new st() },
59
59
  columns: { default: () => [] },
60
60
  i: { default: 0 },
61
61
  editModeEnabled: { type: Boolean, default: !1 },
62
62
  hasInlineEditPerm: { type: Boolean, default: !1 }
63
63
  },
64
64
  emits: ["update:modelValue"],
65
- setup(o, { emit: p }) {
66
- const v = p, n = o, a = h(n.modelValue), t = h(a.value[n.column.key]), m = h(null);
65
+ setup(o, { emit: m }) {
66
+ const f = m, n = o, a = k(n.modelValue), t = k(a.value[n.column.key]), v = k(null);
67
67
  let D = n.column.type;
68
68
  [ae.Integer, ae.Float].includes(D) && (D = ae.Number), F(t, (l) => {
69
- const T = JSON.parse(JSON.stringify(a.value));
70
- T[n.column.key] = l, v("update:modelValue", T);
69
+ const V = JSON.parse(JSON.stringify(a.value));
70
+ V[n.column.key] = l, f("update:modelValue", V);
71
71
  }), F(() => n.modelValue, (l) => {
72
72
  a.value = l, t.value = a.value[n.column.key];
73
73
  });
74
- const k = r(() => ({ ...n.column.slotData, item: a.value })), C = r(() => {
75
- var l, T, H, O;
76
- if ((l = n.column.field) != null && l.modalData && typeof ((T = n.column.field) == null ? void 0 : T.modalData) == "object")
74
+ const g = d(() => ({ ...n.column.slotData, item: a.value })), C = d(() => {
75
+ var l, V, j, O;
76
+ if ((l = n.column.field) != null && l.modalData && typeof ((V = n.column.field) == null ? void 0 : V.modalData) == "object")
77
77
  for (let U in n.column.field.modalData)
78
- if (typeof ((H = n.column.field) == null ? void 0 : H.modalData[U]) == "string" && n.column.field.modalData[U].startsWith("prop:")) {
79
- let w = n.column.field.modalData[U].substring(5);
80
- a.value[w];
78
+ if (typeof ((j = n.column.field) == null ? void 0 : j.modalData[U]) == "string" && n.column.field.modalData[U].startsWith("prop:")) {
79
+ let I = n.column.field.modalData[U].substring(5);
80
+ a.value[I];
81
81
  } else
82
82
  n.column.field.modalData[U];
83
83
  return (O = n.column.field) == null ? void 0 : O.modalData;
84
84
  });
85
- return (l, T) => {
86
- var w, ee, E, te;
87
- const H = _("lkt-anchor"), O = _("lkt-button"), U = _("lkt-field");
88
- return l.column.type === c(ae).Anchor ? (u(), S(H, oe(Z({ key: 0 }, l.column.anchor)), {
85
+ return (l, V) => {
86
+ var I, te, E, le;
87
+ const j = W("lkt-anchor"), O = W("lkt-button"), U = W("lkt-field");
88
+ return l.column.type === y(ae).Anchor ? (u(), S(j, oe(Q({ key: 0 }, l.column.anchor)), {
89
89
  default: P(() => [
90
- ne(ue(c(ve)(l.column, a.value, l.i)), 1)
90
+ ne(ue(y(ve)(l.column, a.value, l.i)), 1)
91
91
  ]),
92
92
  _: 1
93
- }, 16)) : l.column.type === c(ae).Button ? (u(), S(O, Z({ key: 1 }, l.column.button, { prop: a.value }), {
93
+ }, 16)) : l.column.type === y(ae).Button ? (u(), S(O, Q({ key: 1 }, l.column.button, { prop: a.value }), {
94
94
  default: P(() => [
95
- ne(ue(c(ve)(l.column, a.value, l.i)), 1)
95
+ ne(ue(y(ve)(l.column, a.value, l.i)), 1)
96
96
  ]),
97
97
  _: 1
98
- }, 16, ["prop"])) : l.column.type === c(ae).Field && l.hasInlineEditPerm ? (u(), S(U, Z({ key: 2 }, l.column.field, {
98
+ }, 16, ["prop"])) : l.column.type === y(ae).Field && l.hasInlineEditPerm ? (u(), S(U, Q({ key: 2 }, l.column.field, {
99
99
  "read-mode": !l.column.editable || !l.editModeEnabled,
100
- ref: (q) => m.value = q,
101
- "slot-data": k.value,
102
- label: ((w = l.column.field) == null ? void 0 : w.type) === "switch" || ((ee = l.column.field) == null ? void 0 : ee.type) === "check" ? l.column.label : "",
100
+ ref: (H) => v.value = H,
101
+ "slot-data": g.value,
102
+ label: ((I = l.column.field) == null ? void 0 : I.type) === "switch" || ((te = l.column.field) == null ? void 0 : te.type) === "check" ? l.column.label : "",
103
103
  "modal-data": C.value,
104
104
  prop: a.value,
105
105
  modelValue: t.value,
106
- "onUpdate:modelValue": T[0] || (T[0] = (q) => t.value = q)
107
- }), null, 16, ["read-mode", "slot-data", "label", "modal-data", "prop", "modelValue"])) : l.column.type === c(ae).Field ? (u(), S(U, Z({ key: 3 }, l.column.field, {
106
+ "onUpdate:modelValue": V[0] || (V[0] = (H) => t.value = H)
107
+ }), null, 16, ["read-mode", "slot-data", "label", "modal-data", "prop", "modelValue"])) : l.column.type === y(ae).Field ? (u(), S(U, Q({ key: 3 }, l.column.field, {
108
108
  "read-mode": "",
109
- ref: (q) => m.value = q,
110
- "slot-data": k.value,
111
- label: ((E = l.column.field) == null ? void 0 : E.type) === "switch" || ((te = l.column.field) == null ? void 0 : te.type) === "check" ? l.column.label : "",
109
+ ref: (H) => v.value = H,
110
+ "slot-data": g.value,
111
+ label: ((E = l.column.field) == null ? void 0 : E.type) === "switch" || ((le = l.column.field) == null ? void 0 : le.type) === "check" ? l.column.label : "",
112
112
  "modal-data": C.value,
113
113
  prop: a.value,
114
114
  "model-value": t.value
115
- }), null, 16, ["slot-data", "label", "modal-data", "prop", "model-value"])) : (u(), s(N, { key: 4 }, [
116
- ne(ue(c(ve)(l.column, a.value, l.i, l.columns)), 1)
115
+ }), null, 16, ["slot-data", "label", "modal-data", "prop", "model-value"])) : (u(), s(L, { key: 4 }, [
116
+ ne(ue(y(ve)(l.column, a.value, l.i, l.columns)), 1)
117
117
  ], 64));
118
118
  };
119
119
  }
120
- }), X = class X {
120
+ }), Y = class Y {
121
121
  };
122
- X.navButtonSlot = "", X.dropButtonSlot = "", X.editButtonSlot = "", X.createButtonSlot = "", X.defaultEmptySlot = void 0, X.defaultSaveIcon = "", X.defaultNoResultsMessage = "No results";
123
- let M = X;
124
- const ol = /* @__PURE__ */ x({
122
+ Y.navButtonSlot = "", Y.dropButtonSlot = "", Y.editButtonSlot = "", Y.createButtonSlot = "", Y.defaultEmptySlot = void 0, Y.defaultSaveIcon = "", Y.defaultNoResultsMessage = "No results";
123
+ let $ = Y;
124
+ const ol = /* @__PURE__ */ ee({
125
125
  __name: "DropButton",
126
126
  props: {
127
127
  config: {},
128
128
  disabled: { type: Boolean, default: !1 }
129
129
  },
130
130
  emits: ["click"],
131
- setup(o, { emit: p }) {
132
- const v = p, n = o, a = r(() => M.dropButtonSlot !== ""), t = r(() => M.dropButtonSlot);
133
- return (m, D) => {
131
+ setup(o, { emit: m }) {
132
+ const f = m, n = o, a = d(() => $.dropButtonSlot !== ""), t = d(() => $.dropButtonSlot);
133
+ return (v, D) => {
134
134
  var C, l;
135
- const k = _("lkt-button");
136
- return u(), S(k, Z({ palette: "table-delete" }, n.config, {
137
- icon: a.value ? "" : (C = m.config) == null ? void 0 : C.icon,
138
- text: a.value ? "" : (l = m.config) == null ? void 0 : l.text,
139
- disabled: m.disabled,
140
- onClick: D[0] || (D[0] = rt((T) => v("click"), ["prevent", "stop"]))
135
+ const g = W("lkt-button");
136
+ return u(), S(g, Q({ palette: "table-delete" }, n.config, {
137
+ icon: a.value ? "" : (C = v.config) == null ? void 0 : C.icon,
138
+ text: a.value ? "" : (l = v.config) == null ? void 0 : l.text,
139
+ disabled: v.disabled,
140
+ onClick: D[0] || (D[0] = it((V) => f("click"), ["prevent", "stop"]))
141
141
  }), {
142
142
  default: P(() => [
143
- a.value ? (u(), S(Y(t.value), { key: 0 })) : f("", !0)
143
+ a.value ? (u(), S(Z(t.value), { key: 0 })) : c("", !0)
144
144
  ]),
145
145
  _: 1
146
146
  }, 16, ["icon", "text", "disabled"]);
147
147
  };
148
148
  }
149
- }), nl = /* @__PURE__ */ x({
149
+ }), nl = /* @__PURE__ */ ee({
150
150
  __name: "EditButton",
151
151
  props: {
152
- disabled: { type: Boolean, default: !1 },
153
- text: { default: "" },
154
- icon: { default: "" },
155
- confirm: { default: "" },
156
- link: { default: "" },
157
- resource: { default: "" },
158
- resourceData: { default: () => ({}) }
152
+ config: {},
153
+ disabled: { type: Boolean, default: !1 }
159
154
  },
160
155
  emits: ["click"],
161
- setup(o, { emit: p }) {
162
- const v = p, n = r(() => M.editButtonSlot !== ""), a = r(() => M.editButtonSlot);
163
- return (t, m) => {
164
- const D = _("lkt-button");
165
- return u(), S(D, {
166
- palette: "table-delete",
167
- icon: n.value ? "" : t.icon,
168
- text: n.value ? "" : t.text,
169
- "on-click-to": t.link,
170
- "is-anchor": t.link !== "",
171
- resource: t.resource,
172
- "resource-data": t.resourceData,
173
- "confirm-modal": t.confirm,
174
- disabled: t.disabled,
175
- onClick: m[0] || (m[0] = rt((k) => v("click"), ["prevent", "stop"]))
176
- }, {
156
+ setup(o, { emit: m }) {
157
+ const f = m, n = o, a = d(() => $.editButtonSlot !== ""), t = d(() => $.editButtonSlot);
158
+ return (v, D) => {
159
+ var C, l;
160
+ const g = W("lkt-button");
161
+ return u(), S(g, Q({ palette: "table-delete" }, n.config, {
162
+ icon: a.value ? "" : (C = v.config) == null ? void 0 : C.icon,
163
+ text: a.value ? "" : (l = v.config) == null ? void 0 : l.text,
164
+ disabled: v.disabled,
165
+ onClick: D[0] || (D[0] = it((V) => f("click"), ["prevent", "stop"]))
166
+ }), {
177
167
  default: P(() => [
178
- n.value ? (u(), S(Y(a.value), { key: 0 })) : f("", !0)
168
+ a.value ? (u(), S(Z(t.value), { key: 0 })) : c("", !0)
179
169
  ]),
180
170
  _: 1
181
- }, 8, ["icon", "text", "on-click-to", "is-anchor", "resource", "resource-data", "confirm-modal", "disabled"]);
171
+ }, 16, ["icon", "text", "disabled"]);
182
172
  };
183
173
  }
184
174
  }), ul = ["data-i", "data-draggable"], il = ["data-i"], rl = {
@@ -193,10 +183,11 @@ const ol = /* @__PURE__ */ x({
193
183
  }, cl = {
194
184
  key: 8,
195
185
  class: "lkt-table-col-edit"
196
- }, yl = /* @__PURE__ */ x({
186
+ }, yl = /* @__PURE__ */ ee({
197
187
  __name: "LktTableRow",
198
188
  props: {
199
189
  modelValue: { default: () => ({}) },
190
+ editButton: {},
200
191
  dropButton: {},
201
192
  isDraggable: { type: Boolean, default: !0 },
202
193
  sortable: { type: Boolean, default: !0 },
@@ -211,154 +202,149 @@ const ol = /* @__PURE__ */ x({
211
202
  i: { default: 0 },
212
203
  visibleColumns: { default: () => [] },
213
204
  emptyColumns: { default: () => [] },
214
- editText: { default: "" },
215
- editIcon: { default: "" },
216
- editLink: { default: "" },
217
205
  rowDisplayType: { type: [Number, Function], default: se.Auto },
218
206
  renderDrag: { type: [Boolean, Function], default: !0 },
219
207
  disabledDrag: { type: [Boolean, Function], default: !0 }
220
208
  },
221
209
  emits: ["update:modelValue", "click", "show", "item-up", "item-down", "item-drop"],
222
- setup(o, { emit: p }) {
223
- const v = dt(), n = p, a = o, t = h(a.modelValue);
224
- let m = typeof a.rowDisplayType == "function" ? a.rowDisplayType(t.value, a.i) : a.rowDisplayType;
225
- m || (m = se.Auto);
226
- const D = [se.Auto, se.PreferCustomItem].includes(m), k = [se.Auto, se.PreferItem].includes(m), C = h(a.editLink);
227
- for (let i in t.value) C.value = mt(C.value, ":" + i, t.value[i]);
228
- const l = (i) => n("click", i), T = (i, b) => {
229
- n("show", i, b);
230
- }, H = r(() => {
231
- let i = [], b = !1;
232
- return typeof a.disabledDrag == "function" ? b = a.disabledDrag(t.value) : b = De.value === !0, !b && a.sortable && a.isDraggable ? i.push("handle") : b && i.push("disabled"), i.join(" ");
233
- }), O = r(() => M.navButtonSlot !== ""), U = r(() => M.navButtonSlot), w = () => {
210
+ setup(o, { emit: m }) {
211
+ var x;
212
+ const f = rt(), n = m, a = o, t = k(a.modelValue);
213
+ let v = typeof a.rowDisplayType == "function" ? a.rowDisplayType(t.value, a.i) : a.rowDisplayType;
214
+ v || (v = se.Auto);
215
+ const D = [se.Auto, se.PreferCustomItem].includes(v), g = [se.Auto, se.PreferItem].includes(v), C = k((x = a.editButton.anchor) == null ? void 0 : x.to);
216
+ for (let i in t.value) C.value = pt(C.value, ":" + i, t.value[i]);
217
+ const l = (i) => n("click", i), V = (i, p) => {
218
+ n("show", i, p);
219
+ }, j = d(() => {
220
+ let i = [], p = !1;
221
+ return typeof a.disabledDrag == "function" ? p = a.disabledDrag(t.value) : p = De.value === !0, !p && a.sortable && a.isDraggable ? i.push("handle") : p && i.push("disabled"), i.join(" ");
222
+ }), O = d(() => $.navButtonSlot !== ""), U = d(() => $.navButtonSlot), I = () => {
234
223
  n("item-up", a.i);
235
- }, ee = () => {
224
+ }, te = () => {
236
225
  n("item-down", a.i);
237
226
  }, E = () => {
238
227
  n("item-drop", a.i);
239
- }, te = () => {
228
+ }, le = () => {
240
229
  };
241
230
  F(() => a.modelValue, (i) => t.value = i), F(t, (i) => {
242
231
  n("update:modelValue", i);
243
232
  }, { deep: !0 });
244
- const q = r(() => typeof a.renderDrag == "function" ? a.renderDrag(t.value) : a.renderDrag === !0), De = r(() => typeof a.disabledDrag == "function" ? a.disabledDrag(t.value) : a.disabledDrag === !0);
245
- return (i, b) => {
246
- const I = _("lkt-button");
233
+ const H = d(() => typeof a.renderDrag == "function" ? a.renderDrag(t.value) : a.renderDrag === !0), De = d(() => typeof a.disabledDrag == "function" ? a.disabledDrag(t.value) : a.disabledDrag === !0);
234
+ return (i, p) => {
235
+ const q = W("lkt-button");
247
236
  return u(), s("tr", {
248
237
  "data-i": i.i,
249
238
  "data-draggable": i.isDraggable,
250
- class: J({ "type-custom-item": c(D), "type-item": c(k) })
239
+ class: J({ "type-custom-item": y(D), "type-item": y(g) })
251
240
  }, [
252
- i.sortable && i.isDraggable && i.editModeEnabled && q.value ? (u(), s("td", {
241
+ i.sortable && i.isDraggable && i.editModeEnabled && H.value ? (u(), s("td", {
253
242
  key: 0,
254
243
  "data-role": "drag-indicator",
255
- class: J(H.value),
244
+ class: J(j.value),
256
245
  "data-i": i.i
257
- }, null, 10, il)) : i.sortable && i.editModeEnabled && q.value ? (u(), s("td", rl)) : f("", !0),
246
+ }, null, 10, il)) : i.sortable && i.editModeEnabled && H.value ? (u(), s("td", rl)) : c("", !0),
258
247
  i.addNavigation && i.editModeEnabled ? (u(), s("td", dl, [
259
- j("div", sl, [
260
- me(I, {
248
+ _("div", sl, [
249
+ me(q, {
261
250
  palette: "table-nav",
262
251
  disabled: i.i === 0,
263
- onClick: w
252
+ onClick: I
264
253
  }, {
265
254
  default: P(() => [
266
- O.value ? (u(), S(Y(U.value), {
255
+ O.value ? (u(), S(Z(U.value), {
267
256
  key: 0,
268
257
  direction: "up"
269
- })) : (u(), s(N, { key: 1 }, [
270
- b[3] || (b[3] = j("i", { class: "" }, null, -1)),
271
- b[4] || (b[4] = ne(" UP "))
258
+ })) : (u(), s(L, { key: 1 }, [
259
+ p[3] || (p[3] = _("i", { class: "" }, null, -1)),
260
+ p[4] || (p[4] = ne(" UP "))
272
261
  ], 64))
273
262
  ]),
274
263
  _: 1
275
264
  }, 8, ["disabled"]),
276
- me(I, {
265
+ me(q, {
277
266
  palette: "table-nav",
278
267
  disabled: i.latestRow,
279
- onClick: ee
268
+ onClick: te
280
269
  }, {
281
270
  default: P(() => [
282
- O.value ? (u(), S(Y(U.value), {
271
+ O.value ? (u(), S(Z(U.value), {
283
272
  key: 0,
284
273
  direction: "down"
285
- })) : (u(), s(N, { key: 1 }, [
286
- b[5] || (b[5] = j("i", { class: "" }, null, -1)),
287
- b[6] || (b[6] = ne(" DOWN "))
274
+ })) : (u(), s(L, { key: 1 }, [
275
+ p[5] || (p[5] = _("i", { class: "" }, null, -1)),
276
+ p[6] || (p[6] = ne(" DOWN "))
288
277
  ], 64))
289
278
  ]),
290
279
  _: 1
291
280
  }, 8, ["disabled"])
292
281
  ])
293
- ])) : f("", !0),
282
+ ])) : c("", !0),
294
283
  i.displayHiddenColumnsIndicator ? (u(), s("td", {
295
284
  key: 3,
296
- onClick: b[0] || (b[0] = (V) => T(V, i.i)),
285
+ onClick: p[0] || (p[0] = (w) => V(w, i.i)),
297
286
  "data-role": "show-more",
298
287
  class: J(i.hiddenIsVisible ? "state-open" : "")
299
- }, null, 2)) : f("", !0),
300
- c(D) && c(v)[`item-${i.i}`] ? (u(), s("td", {
288
+ }, null, 2)) : c("", !0),
289
+ y(D) && y(f)[`item-${i.i}`] ? (u(), s("td", {
301
290
  key: "td" + i.i,
302
291
  colspan: i.visibleColumns.length
303
292
  }, [
304
- $(i.$slots, `item-${i.i}`, {
293
+ T(i.$slots, `item-${i.i}`, {
305
294
  item: t.value,
306
295
  index: i.i
307
296
  })
308
- ], 8, pl)) : c(k) && c(v).item ? (u(), s("td", {
297
+ ], 8, pl)) : y(g) && y(f).item ? (u(), s("td", {
309
298
  key: "td" + i.i,
310
299
  colspan: i.visibleColumns.length
311
300
  }, [
312
- $(i.$slots, "item", {
301
+ T(i.$slots, "item", {
313
302
  item: t.value,
314
303
  index: i.i
315
304
  })
316
- ], 8, ml)) : (u(!0), s(N, { key: 6 }, G(i.visibleColumns, (V) => (u(), s(N, null, [
317
- c(tl)(V, i.emptyColumns, t.value) ? (u(), s("td", {
305
+ ], 8, ml)) : (u(!0), s(L, { key: 6 }, G(i.visibleColumns, (w) => (u(), s(L, null, [
306
+ y(tl)(w, i.emptyColumns, t.value) ? (u(), s("td", {
318
307
  key: "td" + i.i,
319
- "data-column": V.key,
320
- colspan: c(Pe)(V, t.value),
321
- title: c(ve)(V, t.value, i.i, i.visibleColumns),
322
- class: J(c(vt)(V)),
323
- onClick: b[2] || (b[2] = (le) => l(le))
308
+ "data-column": w.key,
309
+ colspan: y(Fe)(w, t.value),
310
+ title: y(ve)(w, t.value, i.i, i.visibleColumns),
311
+ class: J(y(mt)(w)),
312
+ onClick: p[2] || (p[2] = (N) => l(N))
324
313
  }, [
325
- i.$slots[V.key] && c(el)(V, t.value) ? $(i.$slots, V.key, {
314
+ i.$slots[w.key] && y(el)(w, t.value) ? T(i.$slots, w.key, {
326
315
  key: 0,
327
- value: t.value[V.key],
316
+ value: t.value[w.key],
328
317
  item: t.value,
329
- column: V,
318
+ column: w,
330
319
  i: i.i
331
- }) : t.value ? (u(), S(ft, {
320
+ }) : t.value ? (u(), S(vt, {
332
321
  key: 1,
333
322
  modelValue: t.value,
334
- "onUpdate:modelValue": b[1] || (b[1] = (le) => t.value = le),
335
- column: V,
323
+ "onUpdate:modelValue": p[1] || (p[1] = (N) => t.value = N),
324
+ column: w,
336
325
  columns: i.visibleColumns,
337
326
  "edit-mode-enabled": i.editModeEnabled,
338
327
  "has-inline-edit-perm": i.hasInlineEditPerm,
339
328
  i: i.i
340
- }, null, 8, ["modelValue", "column", "columns", "edit-mode-enabled", "has-inline-edit-perm", "i"])) : f("", !0)
341
- ], 10, vl)) : f("", !0)
329
+ }, null, 8, ["modelValue", "column", "columns", "edit-mode-enabled", "has-inline-edit-perm", "i"])) : c("", !0)
330
+ ], 10, vl)) : c("", !0)
342
331
  ], 64))), 256)),
343
332
  i.canDrop && i.editModeEnabled ? (u(), s("td", fl, [
344
333
  me(ol, {
345
334
  config: i.dropButton,
346
335
  onClick: E
347
336
  }, null, 8, ["config"])
348
- ])) : f("", !0),
337
+ ])) : c("", !0),
349
338
  i.canEdit && i.editModeEnabled ? (u(), s("td", cl, [
350
339
  me(nl, {
351
- "resource-data": t.value,
352
- text: i.editText,
353
- icon: i.editIcon,
354
- link: C.value,
355
- onClick: te
356
- }, null, 8, ["resource-data", "text", "icon", "link"])
357
- ])) : f("", !0)
340
+ config: i.editButton,
341
+ onClick: le
342
+ }, null, 8, ["config"])
343
+ ])) : c("", !0)
358
344
  ], 10, ul);
359
345
  };
360
346
  }
361
- }), bl = { "data-role": "hidden-row" }, kl = ["colspan"], gl = ["data-column"], hl = ["data-i"], Cl = ["data-column", "title"], Bl = /* @__PURE__ */ x({
347
+ }), bl = { "data-role": "hidden-row" }, gl = ["colspan"], kl = ["data-column"], hl = ["data-i"], Cl = ["data-column", "title"], Bl = /* @__PURE__ */ ee({
362
348
  __name: "LktHiddenRow",
363
349
  props: {
364
350
  modelValue: { default: () => ({}) },
@@ -374,114 +360,114 @@ const ol = /* @__PURE__ */ x({
374
360
  hasInlineEditPerm: { type: Boolean, default: !1 }
375
361
  },
376
362
  emits: ["update:modelValue", "click"],
377
- setup(o, { emit: p }) {
378
- const v = p, n = o, a = h(n.modelValue), t = (m) => v("click", m);
379
- return F(() => n.modelValue, (m) => a.value = m), F(a, () => v("update:modelValue", a.value)), (m, D) => be((u(), s("tr", bl, [
380
- j("td", { colspan: m.hiddenColumnsColSpan }, [
381
- j("table", null, [
382
- j("tr", null, [
383
- (u(!0), s(N, null, G(m.hiddenColumns, (k) => (u(), s("th", {
384
- "data-column": k.key
363
+ setup(o, { emit: m }) {
364
+ const f = m, n = o, a = k(n.modelValue), t = (v) => f("click", v);
365
+ return F(() => n.modelValue, (v) => a.value = v), F(a, () => f("update:modelValue", a.value)), (v, D) => be((u(), s("tr", bl, [
366
+ _("td", { colspan: v.hiddenColumnsColSpan }, [
367
+ _("table", null, [
368
+ _("tr", null, [
369
+ (u(!0), s(L, null, G(v.hiddenColumns, (g) => (u(), s("th", {
370
+ "data-column": g.key
385
371
  }, [
386
- j("div", null, ue(k.label), 1)
387
- ], 8, gl))), 256))
372
+ _("div", null, ue(g.label), 1)
373
+ ], 8, kl))), 256))
388
374
  ]),
389
- j("tr", { "data-i": m.i }, [
390
- (u(!0), s(N, null, G(m.hiddenColumns, (k, C) => (u(), s("td", {
391
- "data-column": k.key,
392
- title: c(ve)(k, a.value, C, m.hiddenColumns),
375
+ _("tr", { "data-i": v.i }, [
376
+ (u(!0), s(L, null, G(v.hiddenColumns, (g, C) => (u(), s("td", {
377
+ "data-column": g.key,
378
+ title: y(ve)(g, a.value, C, v.hiddenColumns),
393
379
  onClick: D[1] || (D[1] = (l) => t(l))
394
380
  }, [
395
- m.$slots[k.key] ? $(m.$slots, k.key, {
381
+ v.$slots[g.key] ? T(v.$slots, g.key, {
396
382
  key: 0,
397
- value: a.value[k.key],
383
+ value: a.value[g.key],
398
384
  item: a.value,
399
- column: k,
385
+ column: g,
400
386
  i: C
401
- }) : (u(), S(ft, {
387
+ }) : (u(), S(vt, {
402
388
  key: 1,
403
- column: k,
404
- columns: m.hiddenColumns,
389
+ column: g,
390
+ columns: v.hiddenColumns,
405
391
  modelValue: a.value,
406
392
  "onUpdate:modelValue": D[0] || (D[0] = (l) => a.value = l),
407
393
  i: C,
408
- "edit-mode-enabled": m.editModeEnabled,
409
- "has-inline-edit-perm": m.hasInlineEditPerm
394
+ "edit-mode-enabled": v.editModeEnabled,
395
+ "has-inline-edit-perm": v.hasInlineEditPerm
410
396
  }, null, 8, ["column", "columns", "modelValue", "i", "edit-mode-enabled", "has-inline-edit-perm"]))
411
397
  ], 8, Cl))), 256))
412
398
  ], 8, hl)
413
399
  ])
414
- ], 8, kl)
400
+ ], 8, gl)
415
401
  ], 512)), [
416
- [ke, m.hiddenIsVisible]
402
+ [ge, v.hiddenIsVisible]
417
403
  ]);
418
404
  }
419
- }), it = /* @__PURE__ */ x({
405
+ }), ut = /* @__PURE__ */ ee({
420
406
  __name: "CreateButton",
421
407
  props: {
422
408
  config: { default: void 0 },
423
409
  disabled: { type: Boolean, default: !1 }
424
410
  },
425
411
  emits: ["click", "append"],
426
- setup(o, { emit: p }) {
412
+ setup(o, { emit: m }) {
427
413
  var C;
428
- const v = p, n = o, a = r(() => M.createButtonSlot !== ""), t = r(() => M.createButtonSlot), m = {
414
+ const f = m, n = o, a = d(() => $.createButtonSlot !== ""), t = d(() => $.createButtonSlot), v = {
429
415
  ...(C = n.config) == null ? void 0 : C.modalData,
430
416
  beforeClose: (l) => {
431
- "itemCreated" in l && l.itemCreated === !0 && v("append", l.item);
417
+ "itemCreated" in l && l.itemCreated === !0 && f("append", l.item);
432
418
  }
433
419
  }, D = {
434
420
  ...n.config
435
421
  };
436
- D.modalData = m;
437
- const k = () => {
422
+ D.modalData = v;
423
+ const g = () => {
438
424
  var l;
439
425
  if (!((l = n.config) != null && l.modal)) {
440
- v("click");
426
+ f("click");
441
427
  return;
442
428
  }
443
429
  };
444
- return (l, T) => {
445
- const H = _("lkt-button");
446
- return u(), S(H, Z(D, {
430
+ return (l, V) => {
431
+ const j = W("lkt-button");
432
+ return u(), S(j, Q(D, {
447
433
  disabled: l.disabled,
448
- onClick: k
434
+ onClick: g
449
435
  }), {
450
436
  default: P(() => [
451
- a.value ? (u(), S(Y(t.value), { key: 0 })) : f("", !0)
437
+ a.value ? (u(), S(Z(t.value), { key: 0 })) : c("", !0)
452
438
  ]),
453
439
  _: 1
454
440
  }, 16, ["disabled"]);
455
441
  };
456
442
  }
457
- }), Sl = ["data-column", "data-sortable", "data-sort", "colspan", "title"], Dl = /* @__PURE__ */ x({
443
+ }), Sl = ["data-column", "data-sortable", "data-sort", "colspan", "title"], Dl = /* @__PURE__ */ ee({
458
444
  __name: "TableHeader",
459
445
  props: {
460
- column: { default: () => new pt() },
446
+ column: { default: () => new st() },
461
447
  sortBy: { default: "" },
462
448
  sortDirection: { default: "" },
463
449
  amountOfColumns: { default: 0 },
464
450
  items: { default: () => [] }
465
451
  },
466
452
  emits: ["click"],
467
- setup(o, { emit: p }) {
468
- const v = p, n = o, a = r(() => xt(n.column, n.amountOfColumns, n.items)), t = r(() => n.column.sortable === !0), m = r(() => t.value && n.sortBy === n.column.key ? n.sortDirection : ""), D = r(() => n.column.label.startsWith("__:") ? st(n.column.label.substring(3)) : n.column.label), k = () => v("click", n.column);
453
+ setup(o, { emit: m }) {
454
+ const f = m, n = o, a = d(() => xt(n.column, n.amountOfColumns, n.items)), t = d(() => n.column.sortable === !0), v = d(() => t.value && n.sortBy === n.column.key ? n.sortDirection : ""), D = d(() => n.column.label.startsWith("__:") ? dt(n.column.label.substring(3)) : n.column.label), g = () => f("click", n.column);
469
455
  return (C, l) => (u(), s("th", {
470
456
  "data-column": C.column.key,
471
457
  "data-sortable": t.value,
472
- "data-sort": m.value,
458
+ "data-sort": v.value,
473
459
  colspan: a.value,
474
460
  title: D.value,
475
- class: J(c(vt)(C.column)),
476
- onClick: k
461
+ class: J(y(mt)(C.column)),
462
+ onClick: g
477
463
  }, [
478
- j("div", null, ue(D.value), 1)
464
+ _("div", null, ue(D.value), 1)
479
465
  ], 10, Sl));
480
466
  }
481
467
  }), Il = ["id"], Vl = {
482
468
  key: 0,
483
469
  class: "lkt-table-page-buttons"
484
- }, wl = { class: "switch-edition-mode" }, El = {
470
+ }, El = { class: "switch-edition-mode" }, wl = {
485
471
  key: 1,
486
472
  class: "lkt-table-page-buttons"
487
473
  }, Tl = {
@@ -490,21 +476,21 @@ const ol = /* @__PURE__ */ x({
490
476
  }, $l = { class: "lkt-table" }, Ml = { key: 0 }, Rl = {
491
477
  key: 0,
492
478
  "data-role": "drag-indicator"
493
- }, Ll = { key: 1 }, Pl = { key: 2 }, Nl = {
479
+ }, Pl = { key: 1 }, Ll = { key: 2 }, Nl = {
494
480
  key: 3,
495
481
  class: "lkt-table-col-drop"
496
482
  }, Fl = {
497
483
  key: 4,
498
484
  class: "lkt-table-col-edit"
499
- }, Ol = ["id"], Ul = ["id"], Al = ["data-i"], jl = ["data-i"], Hl = {
485
+ }, Ol = ["id"], Ul = ["id"], Al = ["data-i"], _l = ["data-i"], jl = {
500
486
  key: 3,
501
487
  class: "lkt-table-empty"
502
- }, ql = {
488
+ }, Hl = {
503
489
  key: 5,
504
490
  class: "lkt-table-page-buttons lkt-table-page-buttons-bottom"
505
- }, Kl = /* @__PURE__ */ x({
491
+ }, ql = /* @__PURE__ */ ee({
506
492
  __name: "LktTable",
507
- props: /* @__PURE__ */ _t({
493
+ props: /* @__PURE__ */ Kt({
508
494
  modelValue: {},
509
495
  type: {},
510
496
  columns: {},
@@ -531,19 +517,17 @@ const ol = /* @__PURE__ */ x({
531
517
  saveButton: {},
532
518
  createButton: {},
533
519
  dropButton: {},
520
+ editButton: {},
534
521
  hiddenSave: { type: Boolean },
535
522
  wrapContentTag: {},
536
523
  wrapContentClass: {},
537
524
  itemsContainerClass: {},
538
- createEnabledValidator: { type: Function },
539
- editText: {},
540
- editIcon: {},
541
- editLink: {},
542
525
  addNavigation: { type: Boolean },
543
526
  newValueGenerator: { type: Function },
544
527
  requiredItemsForTopCreate: {},
545
528
  requiredItemsForBottomCreate: {},
546
- slotItemVar: {}
529
+ slotItemVar: {},
530
+ createEnabledValidator: { type: Function }
547
531
  }, Gt(Jt)),
548
532
  emits: [
549
533
  "update:modelValue",
@@ -559,89 +543,89 @@ const ol = /* @__PURE__ */ x({
559
543
  "page",
560
544
  "drag-end"
561
545
  ],
562
- setup(o, { expose: p, emit: v }) {
563
- var lt;
564
- const n = v, a = dt(), t = o, m = {}, D = h(typeof t.sorter == "function" ? t.sorter : Zt), k = h(ll(t.columns)), C = h(ge.Asc), l = h(t.modelValue), T = h(m), H = h(null), O = h(t.columns), U = h((lt = t.paginator) == null ? void 0 : lt.modelValue), w = h(t.loading), ee = h(!1), E = h(t.perms), te = h(null), q = h(null), De = h(null), i = h({}), b = h(new Xt({ items: l.value }, t.dataStateConfig)), I = h(t.editMode), V = h(0), le = h(null), K = h(ot(t.saveButton, nt.defaultSaveButton)), Ne = h(ot(t.createButton, nt.defaultCreateButton)), ie = h(!1);
565
- F(w, (e) => n("update:loading", e)), F(U, (e) => n("page", e));
546
+ setup(o, { expose: m, emit: f }) {
547
+ var ot;
548
+ const n = f, a = rt(), t = o, v = {}, D = k(typeof t.sorter == "function" ? t.sorter : Zt), g = k(ll(t.columns)), C = k(ke.Asc), l = k(t.modelValue), V = k(v), j = k(null), O = k(t.columns), U = k((ot = t.paginator) == null ? void 0 : ot.modelValue), I = k(t.loading), te = k(!1), E = k(t.perms), le = k(null), H = k(null), De = k(null), x = k({}), i = k(new Xt({ items: l.value }, t.dataStateConfig)), p = k(t.editMode), q = k(0), w = k(null), N = k(Pe(t.saveButton, Le.defaultSaveButton)), Oe = k(Pe(t.createButton, Le.defaultCreateButton)), ft = k(Pe(t.editModeButton, Le.defaultEditModeButton)), ie = k(!1);
549
+ F(I, (e) => n("update:loading", e)), F(U, (e) => n("page", e));
566
550
  const ct = (e) => {
567
551
  E.value = e;
568
552
  }, yt = (e) => {
569
- var d;
570
- Array.isArray(e.data) && ((!t.paginator || ![Se.LoadMore, Se.Infinite].includes((d = t.paginator) == null ? void 0 : d.type)) && l.value.splice(0, l.value.length), l.value = [...l.value, ...e.data]), w.value = !1, ee.value = !0, b.value.store({ items: l.value }).turnStoredIntoOriginal(), ie.value = !1, Be(() => {
571
- V.value = pe(), we.value, n("read-response", e);
553
+ var r;
554
+ Array.isArray(e.data) && ((!t.paginator || ![Se.LoadMore, Se.Infinite].includes((r = t.paginator) == null ? void 0 : r.type)) && l.value.splice(0, l.value.length), l.value = [...l.value, ...e.data]), I.value = !1, te.value = !0, i.value.store({ items: l.value }).turnStoredIntoOriginal(), ie.value = !1, Be(() => {
555
+ q.value = pe(), Ee.value, n("read-response", e);
572
556
  });
573
- }, bt = () => Be(() => w.value = !0), kt = () => {
574
- te.value.doRefresh();
575
- }, fe = Qt(12), Ie = r(() => {
557
+ }, bt = () => Be(() => I.value = !0), gt = () => {
558
+ le.value.doRefresh();
559
+ }, fe = Qt(12), Ie = d(() => {
576
560
  if (!t.hideEmptyColumns) return [];
577
561
  let e = [];
578
- return O.value.forEach((d) => {
579
- let g = d.key, R = !1;
562
+ return O.value.forEach((r) => {
563
+ let h = r.key, M = !1;
580
564
  l.value.forEach((A) => {
581
565
  if (typeof A.checkEmpty == "function")
582
566
  return A.checkEmpty(A);
583
- A[g] && (R = !0);
584
- }), R || e.push(g);
567
+ A[h] && (M = !0);
568
+ }), M || e.push(h);
585
569
  }), e;
586
- }), he = r(() => O.value.filter((e) => !e.hidden)), Ve = r(() => O.value.filter((e) => e.hidden)), gt = r(() => {
570
+ }), he = d(() => O.value.filter((e) => !e.hidden)), Ve = d(() => O.value.filter((e) => e.hidden)), kt = d(() => {
587
571
  let e = he.value.length + 1;
588
572
  return t.sortable && ++e, e;
589
- }), ht = r(() => O.value.filter((e) => e.isForRowKey)), Fe = r(() => Ve.value.length > 0 && !t.sortable), Ct = r(() => O.value.map((e) => e.key)), Oe = r(() => {
573
+ }), ht = d(() => O.value.filter((e) => e.isForRowKey)), Ue = d(() => Ve.value.length > 0 && !t.sortable), Ct = d(() => O.value.map((e) => e.key)), Ae = d(() => {
590
574
  let e = [];
591
- for (let d in a) Ct.value.indexOf(d) !== -1 && e.push(d);
575
+ for (let r in a) Ct.value.indexOf(r) !== -1 && e.push(r);
592
576
  return e;
593
- }), Ue = r(() => {
577
+ }), _e = d(() => {
594
578
  var e;
595
- return t.hiddenSave || w.value || !((e = K.value) != null && e.resource || K.value.type) ? !1 : I.value && ie.value ? !0 : I.value;
596
- }), Bt = r(() => Ce.value && l.value.length >= t.requiredItemsForTopCreate || Ke.value ? !0 : Ue.value || I.value && ce.value), we = r(() => {
597
- var e, d;
598
- return V.value, typeof ((e = K.value) == null ? void 0 : e.disabled) == "function" ? K.value.disabled({
579
+ return t.hiddenSave || I.value || !((e = N.value) != null && e.resource || N.value.type) ? !1 : p.value && ie.value ? !0 : p.value;
580
+ }), Bt = d(() => Ce.value && l.value.length >= t.requiredItemsForTopCreate || We.value ? !0 : _e.value || p.value && ce.value), Ee = d(() => {
581
+ var e, r;
582
+ return q.value, typeof ((e = N.value) == null ? void 0 : e.disabled) == "function" ? N.value.disabled({
599
583
  value: l.value,
600
- dataState: b.value
601
- }) : typeof ((d = K.value) == null ? void 0 : d.disabled) == "boolean" ? K.value.disabled : !ie.value;
602
- }), St = r(() => l.value.length), Dt = r(() => {
584
+ dataState: i.value
585
+ }) : typeof ((r = N.value) == null ? void 0 : r.disabled) == "boolean" ? N.value.disabled : !ie.value;
586
+ }), St = d(() => l.value.length), Dt = d(() => {
603
587
  var e;
604
588
  return {
605
589
  items: l.value,
606
- ...(e = K.value) == null ? void 0 : e.resourceData
590
+ ...(e = N.value) == null ? void 0 : e.resourceData
607
591
  };
608
- }), It = r(() => t.titleTag === "" ? "h2" : t.titleTag), Vt = r(() => t.wrapContentTag === "" ? "div" : t.wrapContentTag), Ee = r(() => ut(t.title)), wt = r(() => ut(t.editModeText)), Te = r(() => {
592
+ }), It = d(() => t.titleTag === "" ? "h2" : t.titleTag), Vt = d(() => t.wrapContentTag === "" ? "div" : t.wrapContentTag), we = d(() => zt(t.title)), Te = d(() => {
609
593
  var e;
610
594
  return (e = t.drag) == null ? void 0 : e.enabled;
611
- }), ce = r(() => E.value.includes(Q.Create)), Ae = r(() => E.value.includes("read")), re = r(() => E.value.includes(Q.Update)), je = r(() => E.value.includes(Q.Edit)), He = r(() => E.value.includes(Q.InlineEdit)), Et = r(() => E.value.includes(Q.ModalCreate)), Tt = r(() => E.value.includes(Q.InlineCreate)), qe = r(() => E.value.includes(Q.InlineCreateEver)), de = r(() => E.value.includes(Q.Drop)), $t = r(() => E.value.includes(Q.SwitchEditMode)), Ke = r(() => !$t.value || !re.value && !de.value || !re.value && de.value ? !1 : !w.value), Mt = r(() => {
595
+ }), ce = d(() => E.value.includes(X.Create)), je = d(() => E.value.includes("read")), re = d(() => E.value.includes(X.Update)), He = d(() => E.value.includes(X.Edit)), qe = d(() => E.value.includes(X.InlineEdit)), Et = d(() => E.value.includes(X.ModalCreate)), wt = d(() => E.value.includes(X.InlineCreate)), Ke = d(() => E.value.includes(X.InlineCreateEver)), de = d(() => E.value.includes(X.Drop)), Tt = d(() => E.value.includes(X.SwitchEditMode)), We = d(() => !Tt.value || !re.value && !de.value || !re.value && de.value ? !1 : !I.value), $t = d(() => {
612
596
  var e;
613
- return (typeof ((e = t.paginator) == null ? void 0 : e.type) < "u" && [Se.LoadMore, Se.Infinite].includes(t.paginator.type) || !w.value) && l.value.length > 0;
614
- }), Rt = (e) => {
615
- let d = e.target;
616
- if (typeof d.dataset.column > "u")
597
+ return (typeof ((e = t.paginator) == null ? void 0 : e.type) < "u" && [Se.LoadMore, Se.Infinite].includes(t.paginator.type) || !I.value) && l.value.length > 0;
598
+ }), Mt = (e) => {
599
+ let r = e.target;
600
+ if (typeof r.dataset.column > "u")
617
601
  do
618
- d = d.parentNode;
619
- while (typeof d.dataset.column > "u" && d.tagName !== "TABLE" && d.tagName !== "body");
620
- if (d.tagName === "TD" && (d = d.parentNode, d = d.dataset.i, typeof d < "u"))
621
- return l.value[d];
622
- }, Lt = (e) => l.value[e], Pt = (e) => {
623
- var d;
624
- return (d = H.value) == null ? void 0 : d.querySelector(`[data-i="${e}"]`);
625
- }, We = (e) => T.value["tr_" + e] === !0, _e = (e) => {
626
- e && e.sortable && (l.value = l.value.sort((d, g) => D.value(d, g, e, C.value)), C.value = C.value === ge.Asc ? ge.Desc : ge.Asc, k.value = e.key, n("sort", [k.value, C.value]));
627
- }, ze = (e) => {
628
- n("click", e);
629
- }, Ge = (e, d) => {
630
- let g = "tr_" + d;
631
- T.value[g] = typeof T.value[g] > "u" ? !0 : !T.value[g];
632
- }, Nt = (e) => {
633
- var g, R, A, W, B, y, L, z;
634
- let d = parseInt((W = (A = (R = (g = e == null ? void 0 : e.originalEvent) == null ? void 0 : g.toElement) == null ? void 0 : R.closest("tr")) == null ? void 0 : A.dataset) == null ? void 0 : W.i);
635
- return !(typeof ((B = t.drag) == null ? void 0 : B.isValid) == "function" && !((y = t.drag) != null && y.isValid(l.value[d])) || typeof ((L = t.drag) == null ? void 0 : L.isValid) == "boolean" && !((z = t.drag) != null && z.isValid));
602
+ r = r.parentNode;
603
+ while (typeof r.dataset.column > "u" && r.tagName !== "TABLE" && r.tagName !== "body");
604
+ if (r.tagName === "TD" && (r = r.parentNode, r = r.dataset.i, typeof r < "u"))
605
+ return l.value[r];
606
+ }, Rt = (e) => l.value[e], Pt = (e) => {
607
+ var r;
608
+ return (r = j.value) == null ? void 0 : r.querySelector(`[data-i="${e}"]`);
609
+ }, ze = (e) => V.value["tr_" + e] === !0, Ge = (e) => {
610
+ e && e.sortable && (l.value = l.value.sort((r, h) => D.value(r, h, e, C.value)), C.value = C.value === ke.Asc ? ke.Desc : ke.Asc, g.value = e.key, n("sort", [g.value, C.value]));
636
611
  }, Je = (e) => {
637
- var d, g;
638
- return typeof ((d = t.drag) == null ? void 0 : d.isDraggable) == "function" ? (g = t.drag) == null ? void 0 : g.isDraggable(e) : !0;
639
- }, Qe = () => {
612
+ n("click", e);
613
+ }, Qe = (e, r) => {
614
+ let h = "tr_" + r;
615
+ V.value[h] = typeof V.value[h] > "u" ? !0 : !V.value[h];
616
+ }, Lt = (e) => {
617
+ var h, M, A, K, B, b, R, z;
618
+ let r = parseInt((K = (A = (M = (h = e == null ? void 0 : e.originalEvent) == null ? void 0 : h.toElement) == null ? void 0 : M.closest("tr")) == null ? void 0 : A.dataset) == null ? void 0 : K.i);
619
+ return !(typeof ((B = t.drag) == null ? void 0 : B.isValid) == "function" && !((b = t.drag) != null && b.isValid(l.value[r])) || typeof ((R = t.drag) == null ? void 0 : R.isValid) == "boolean" && !((z = t.drag) != null && z.isValid));
620
+ }, Xe = (e) => {
621
+ var r, h;
622
+ return typeof ((r = t.drag) == null ? void 0 : r.isDraggable) == "function" ? (h = t.drag) == null ? void 0 : h.isDraggable(e) : !0;
623
+ }, Ye = () => {
640
624
  if (ce.value) {
641
625
  n("click-create");
642
626
  return;
643
627
  }
644
- if (qe.value)
628
+ if (Ke.value)
645
629
  n("click-create");
646
630
  else {
647
631
  if (typeof t.newValueGenerator == "function") {
@@ -653,372 +637,369 @@ const ol = /* @__PURE__ */ x({
653
637
  }
654
638
  l.value.push({});
655
639
  }
656
- }, Xe = (e) => {
640
+ }, Ze = (e) => {
657
641
  l.value.push(e);
658
- }, Ye = () => w.value = !0, Ze = () => w.value = !1, Ft = (e, d) => {
659
- var g, R, A;
660
- if (!((g = K.value) != null && g.type && [
661
- Le.Split,
662
- Le.SplitEver,
663
- Le.SplitLazy
664
- ].includes((R = K.value) == null ? void 0 : R.type))) {
665
- if (n("before-save"), (A = K.value) != null && A.resource && (w.value = !1, !d.success)) {
666
- n("error", d.httpStatus);
642
+ }, xe = () => I.value = !0, et = () => I.value = !1, Nt = (e, r) => {
643
+ var h, M, A;
644
+ if (!((h = N.value) != null && h.type && [
645
+ Ne.Split,
646
+ Ne.SplitEver,
647
+ Ne.SplitLazy
648
+ ].includes((M = N.value) == null ? void 0 : M.type))) {
649
+ if (n("before-save"), (A = N.value) != null && A.resource && (I.value = !1, !r.success)) {
650
+ n("error", r.httpStatus);
667
651
  return;
668
652
  }
669
- b.value.turnStoredIntoOriginal(), ie.value = !1, n("save", d);
653
+ i.value.turnStoredIntoOriginal(), ie.value = !1, n("save", r);
670
654
  }
671
- }, xe = (e, d, g) => {
672
- if (g >= e.length) {
673
- let R = g - e.length + 1;
674
- for (; R--; ) e.push(void 0);
655
+ }, tt = (e, r, h) => {
656
+ if (h >= e.length) {
657
+ let M = h - e.length + 1;
658
+ for (; M--; ) e.push(void 0);
675
659
  }
676
- return e.splice(g, 0, e.splice(d, 1)[0]), e;
660
+ return e.splice(h, 0, e.splice(r, 1)[0]), e;
661
+ }, Ft = (e) => {
662
+ tt(l.value, e, e - 1), q.value = pe();
677
663
  }, Ot = (e) => {
678
- xe(l.value, e, e - 1), V.value = pe();
679
- }, Ut = (e) => {
680
- xe(l.value, e, e + 1), V.value = pe();
664
+ tt(l.value, e, e + 1), q.value = pe();
681
665
  }, $e = (e) => {
682
- l.value.splice(e, 1), V.value = pe();
683
- }, At = () => {
666
+ l.value.splice(e, 1), q.value = pe();
667
+ }, Ut = () => {
684
668
  var e;
685
- i.value && typeof ((e = i.value) == null ? void 0 : e.destroy) == "function" && (i.value.destroy(), i.value = {});
686
- }, et = () => {
687
- le.value || (le.value = document.getElementById("lkt-table-body-" + fe)), i.value = new Yt(le.value, {
669
+ x.value && typeof ((e = x.value) == null ? void 0 : e.destroy) == "function" && (x.value.destroy(), x.value = {});
670
+ }, lt = () => {
671
+ w.value || (w.value = document.getElementById("lkt-table-body-" + fe)), x.value = new Yt(w.value, {
688
672
  direction: "vertical",
689
673
  handle: ".handle",
690
674
  animation: 150,
691
675
  onEnd: function(e) {
692
- let d = e.oldIndex, g = e.newIndex;
693
- l.value.splice(g, 0, l.value.splice(d, 1)[0]), V.value = pe(), n("drag-end", l.value[g]);
676
+ let r = e.oldIndex, h = e.newIndex;
677
+ l.value.splice(h, 0, l.value.splice(r, 1)[0]), q.value = pe(), n("drag-end", l.value[h]);
694
678
  },
695
- onMove: function(e, d) {
696
- return Nt(e);
679
+ onMove: function(e, r) {
680
+ return Lt(e);
697
681
  }
698
682
  });
699
- }, Me = (e, d, g = !1) => {
700
- let R = [V.value, fe, "row", d];
701
- return g && R.push("hidden"), ht.value.forEach((A) => {
702
- let W = String(e[A.key]).toLowerCase();
703
- W.length > 50 && (W = W.substring(0, 50)), W = mt(W, " ", "-"), R.push(W);
704
- }), R.join("-");
705
- }, tt = r(() => typeof t.createEnabledValidator == "function" ? t.createEnabledValidator({ items: l.value }) : !0), Ce = r(() => qe.value || ce.value && I.value || Tt.value && I.value || Et.value && I.value), jt = r(() => [ye.Ol, ye.Ul].includes(t.type)), Re = (e, d) => typeof t.itemDisplayChecker == "function" ? t.itemDisplayChecker(e) : !0;
706
- zt(() => {
683
+ }, Me = (e, r, h = !1) => {
684
+ let M = [q.value, fe, "row", r];
685
+ return h && M.push("hidden"), ht.value.forEach((A) => {
686
+ let K = String(e[A.key]).toLowerCase();
687
+ K.length > 50 && (K = K.substring(0, 50)), K = pt(K, " ", "-"), M.push(K);
688
+ }), M.join("-");
689
+ }, at = d(() => typeof t.createEnabledValidator == "function" ? t.createEnabledValidator({ items: l.value }) : !0), Ce = d(() => Ke.value || ce.value && p.value || wt.value && p.value || Et.value && p.value), At = d(() => [ye.Ol, ye.Ul].includes(t.type)), Re = (e, r) => typeof t.itemDisplayChecker == "function" ? t.itemDisplayChecker(e) : !0;
690
+ Wt(() => {
707
691
  var e;
708
- t.initialSorting && _e(al(t.columns, k.value)), b.value.store({ items: l.value }).turnStoredIntoOriginal(), ie.value = !1, (e = t.drag) != null && e.enabled && Be(() => {
709
- et();
692
+ t.initialSorting && Ge(al(t.columns, g.value)), i.value.store({ items: l.value }).turnStoredIntoOriginal(), ie.value = !1, (e = t.drag) != null && e.enabled && Be(() => {
693
+ lt();
710
694
  });
711
695
  }), F(() => {
712
696
  var e;
713
697
  return (e = t.drag) == null ? void 0 : e.enabled;
714
698
  }, (e) => {
715
- e ? et() : At();
716
- }), F(() => t.perms, (e) => E.value = e), F(E, (e) => n("update:perms", e)), F(() => t.editMode, (e) => I.value = e), F(() => t.columns, (e) => O.value = e, { deep: !0 }), F(() => t.modelValue, (e) => l.value = e, { deep: !0 }), F(l, (e) => {
717
- b.value.increment({ items: e }), ie.value = b.value.changed(), n("update:modelValue", e);
718
- }, { deep: !0 }), p({
719
- getItemByEvent: Rt,
720
- getItemByIndex: Lt,
699
+ e ? lt() : Ut();
700
+ }), F(() => t.perms, (e) => E.value = e), F(E, (e) => n("update:perms", e)), F(() => t.editMode, (e) => p.value = e), F(() => t.columns, (e) => O.value = e, { deep: !0 }), F(() => t.modelValue, (e) => l.value = e, { deep: !0 }), F(l, (e) => {
701
+ i.value.increment({ items: e }), ie.value = i.value.changed(), n("update:modelValue", e);
702
+ }, { deep: !0 }), m({
703
+ getItemByEvent: Mt,
704
+ getItemByIndex: Rt,
721
705
  getRowByIndex: Pt,
722
- doRefresh: kt,
723
- getHtml: () => q.value,
706
+ doRefresh: gt,
707
+ getHtml: () => H.value,
724
708
  turnStoredIntoOriginal: () => {
725
- b.value.turnStoredIntoOriginal(), Be(() => {
726
- V.value = pe();
709
+ i.value.turnStoredIntoOriginal(), Be(() => {
710
+ q.value = pe();
727
711
  });
728
712
  }
729
713
  });
730
- const Ht = r(() => typeof M.defaultEmptySlot < "u"), qt = r(() => M.defaultEmptySlot), Kt = r(() => !t.drag || Object.keys(t.drag).length === 0 || !t.drag.enabled ? !1 : typeof t.drag.canRender > "u" ? !0 : t.drag.canRender), Wt = r(() => !t.drag || Object.keys(t.drag).length === 0 || !t.drag.enabled || typeof t.drag.isDisabled > "u" ? !1 : t.drag.isDisabled);
731
- return (e, d) => {
732
- const g = _("lkt-button"), R = _("lkt-field"), A = _("lkt-loader"), W = _("lkt-paginator");
714
+ const _t = d(() => typeof $.defaultEmptySlot < "u"), jt = d(() => $.defaultEmptySlot), Ht = d(() => !t.drag || Object.keys(t.drag).length === 0 || !t.drag.enabled ? !1 : typeof t.drag.canRender > "u" ? !0 : t.drag.canRender), qt = d(() => !t.drag || Object.keys(t.drag).length === 0 || !t.drag.enabled || typeof t.drag.isDisabled > "u" ? !1 : t.drag.isDisabled);
715
+ return (e, r) => {
716
+ const h = W("lkt-button"), M = W("lkt-field"), A = W("lkt-loader"), K = W("lkt-paginator");
733
717
  return u(), s("section", {
734
718
  ref_key: "element",
735
- ref: q,
719
+ ref: H,
736
720
  class: "lkt-table-page",
737
- id: "lkt-table-page-" + c(fe)
721
+ id: "lkt-table-page-" + y(fe)
738
722
  }, [
739
- Ee.value || c(a).title ? (u(), s("header", {
723
+ we.value || y(a).title ? (u(), s("header", {
740
724
  key: 0,
741
725
  class: J(e.headerClass)
742
726
  }, [
743
- Ee.value ? (u(), S(Y(It.value), { key: 0 }, {
727
+ we.value ? (u(), S(Z(It.value), { key: 0 }, {
744
728
  default: P(() => [
745
729
  e.titleIcon ? (u(), s("i", {
746
730
  key: 0,
747
731
  class: J(e.titleIcon)
748
- }, null, 2)) : f("", !0),
749
- ne(" " + ue(Ee.value), 1)
732
+ }, null, 2)) : c("", !0),
733
+ ne(" " + ue(we.value), 1)
750
734
  ]),
751
735
  _: 1
752
- })) : f("", !0),
753
- c(a).title ? $(e.$slots, "title", { key: 1 }) : f("", !0)
754
- ], 2)) : f("", !0),
755
- (u(), S(Y(Vt.value), {
736
+ })) : c("", !0),
737
+ y(a).title ? T(e.$slots, "title", { key: 1 }) : c("", !0)
738
+ ], 2)) : c("", !0),
739
+ (u(), S(Z(Vt.value), {
756
740
  class: J(["lkt-table-page-content-wrapper", e.wrapContentClass])
757
741
  }, {
758
742
  default: P(() => [
759
743
  Bt.value ? (u(), s("div", Vl, [
760
- be(me(g, Z({
744
+ be(me(h, Q({
761
745
  class: "lkt-table--save-button",
762
746
  ref_key: "saveButtonRef",
763
747
  ref: De
764
- }, K.value, {
765
- disabled: we.value,
748
+ }, N.value, {
749
+ disabled: Ee.value,
766
750
  "modal-data": Dt.value,
767
- onLoading: Ye,
768
- onLoaded: Ze,
769
- onClick: Ft
751
+ onLoading: xe,
752
+ onLoaded: et,
753
+ onClick: Nt
770
754
  }), {
771
- split: P(({ doClose: B, doRootClick: y }) => [
772
- $(e.$slots, "button-save-split", {
755
+ split: P(({ doClose: B, doRootClick: b }) => [
756
+ T(e.$slots, "button-save-split", {
773
757
  doClose: B,
774
- doRootClick: y,
775
- dataState: b.value,
776
- onButtonLoading: Ye,
777
- onButtonLoaded: Ze
758
+ doRootClick: b,
759
+ dataState: i.value,
760
+ onButtonLoading: xe,
761
+ onButtonLoaded: et
778
762
  })
779
763
  ]),
780
764
  default: P(() => [
781
- c(a)["button-save"] ? $(e.$slots, "button-save", {
765
+ y(a)["button-save"] ? T(e.$slots, "button-save", {
782
766
  key: 0,
783
767
  items: l.value,
784
768
  editMode: e.editMode,
785
- canUpdate: !we.value
786
- }) : f("", !0)
769
+ canUpdate: !Ee.value
770
+ }) : c("", !0)
787
771
  ]),
788
772
  _: 3
789
773
  }, 16, ["disabled", "modal-data"]), [
790
- [ke, Ue.value]
774
+ [ge, _e.value]
791
775
  ]),
792
- Ce.value && l.value.length >= e.requiredItemsForTopCreate ? (u(), S(it, {
776
+ Ce.value && l.value.length >= e.requiredItemsForTopCreate ? (u(), S(ut, {
793
777
  key: 0,
794
- config: Ne.value,
795
- disabled: !tt.value,
796
- onClick: Qe,
797
- onAppend: Xe
798
- }, null, 8, ["config", "disabled"])) : f("", !0),
799
- j("div", wl, [
800
- be(me(R, {
801
- type: "switch",
802
- modelValue: I.value,
803
- "onUpdate:modelValue": d[0] || (d[0] = (B) => I.value = B),
804
- label: wt.value
805
- }, null, 8, ["modelValue", "label"]), [
806
- [ke, Ke.value]
778
+ config: Oe.value,
779
+ disabled: !at.value,
780
+ onClick: Ye,
781
+ onAppend: Ze
782
+ }, null, 8, ["config", "disabled"])) : c("", !0),
783
+ _("div", El, [
784
+ be(me(M, Q(ft.value, {
785
+ modelValue: p.value,
786
+ "onUpdate:modelValue": r[0] || (r[0] = (B) => p.value = B)
787
+ }), null, 16, ["modelValue"]), [
788
+ [ge, We.value]
807
789
  ])
808
790
  ])
809
- ])) : f("", !0),
810
- c(a).buttons ? (u(), s("div", El, [
811
- $(e.$slots, "buttons")
812
- ])) : f("", !0),
813
- ee.value && c(a).filters ? (u(), s("div", Tl, [
814
- $(e.$slots, "filters", {
791
+ ])) : c("", !0),
792
+ y(a).buttons ? (u(), s("div", wl, [
793
+ T(e.$slots, "buttons")
794
+ ])) : c("", !0),
795
+ te.value && y(a).filters ? (u(), s("div", Tl, [
796
+ T(e.$slots, "filters", {
815
797
  items: l.value,
816
- isLoading: w.value
798
+ isLoading: I.value
817
799
  })
818
- ])) : f("", !0),
819
- be(j("div", $l, [
820
- e.type === c(ye).Table ? (u(), s("table", Ml, [
821
- j("thead", null, [
822
- j("tr", null, [
823
- Te.value && I.value ? (u(), s("th", Rl)) : f("", !0),
824
- e.addNavigation && I.value ? (u(), s("th", Ll)) : f("", !0),
825
- Fe.value ? (u(), s("th", Pl)) : f("", !0),
826
- (u(!0), s(N, null, G(he.value, (B) => (u(), s(N, null, [
800
+ ])) : c("", !0),
801
+ be(_("div", $l, [
802
+ e.type === y(ye).Table ? (u(), s("table", Ml, [
803
+ _("thead", null, [
804
+ _("tr", null, [
805
+ Te.value && p.value ? (u(), s("th", Rl)) : c("", !0),
806
+ e.addNavigation && p.value ? (u(), s("th", Pl)) : c("", !0),
807
+ Ue.value ? (u(), s("th", Ll)) : c("", !0),
808
+ (u(!0), s(L, null, G(he.value, (B) => (u(), s(L, null, [
827
809
  Ie.value.indexOf(B.key) === -1 ? (u(), S(Dl, {
828
810
  key: 0,
829
811
  column: B,
830
- "sort-by": k.value,
812
+ "sort-by": g.value,
831
813
  "sort-direction": C.value,
832
814
  "amount-of-columns": e.columns.length,
833
815
  items: l.value,
834
- onClick: (y) => _e(B)
835
- }, null, 8, ["column", "sort-by", "sort-direction", "amount-of-columns", "items", "onClick"])) : f("", !0)
816
+ onClick: (b) => Ge(B)
817
+ }, null, 8, ["column", "sort-by", "sort-direction", "amount-of-columns", "items", "onClick"])) : c("", !0)
836
818
  ], 64))), 256)),
837
- de.value && I.value ? (u(), s("th", Nl)) : f("", !0),
838
- je.value && re.value && I.value ? (u(), s("th", Fl)) : f("", !0)
819
+ de.value && p.value ? (u(), s("th", Nl)) : c("", !0),
820
+ He.value && re.value && p.value ? (u(), s("th", Fl)) : c("", !0)
839
821
  ])
840
822
  ]),
841
- j("tbody", {
823
+ _("tbody", {
842
824
  ref_key: "tableBody",
843
- ref: H,
844
- id: "lkt-table-body-" + c(fe)
825
+ ref: j,
826
+ id: "lkt-table-body-" + y(fe)
845
827
  }, [
846
- (u(!0), s(N, null, G(l.value, (B, y) => be((u(), S(yl, {
847
- modelValue: l.value[y],
848
- "onUpdate:modelValue": (L) => l.value[y] = L,
849
- key: Me(B, y),
850
- i: y,
851
- "display-hidden-columns-indicator": Fe.value,
852
- "is-draggable": Je(B),
828
+ (u(!0), s(L, null, G(l.value, (B, b) => be((u(), S(yl, {
829
+ modelValue: l.value[b],
830
+ "onUpdate:modelValue": (R) => l.value[b] = R,
831
+ key: Me(B, b),
832
+ i: b,
833
+ "drop-button": e.dropButton,
834
+ "edit-button": e.editButton,
835
+ "display-hidden-columns-indicator": Ue.value,
836
+ "is-draggable": Xe(B),
853
837
  sortable: Te.value,
854
838
  "visible-columns": he.value,
855
839
  "empty-columns": Ie.value,
856
840
  "add-navigation": e.addNavigation,
857
- "hidden-is-visible": We(y),
858
- "latest-row": y + 1 === St.value,
859
- "can-drop": de.value && I.value,
860
- "can-edit": je.value && re.value && I.value,
861
- "edit-text": e.editText,
862
- "edit-icon": e.editIcon,
863
- "edit-link": e.editLink,
864
- "edit-mode-enabled": I.value,
865
- "has-inline-edit-perm": He.value,
841
+ "hidden-is-visible": ze(b),
842
+ "latest-row": b + 1 === St.value,
843
+ "can-drop": de.value && p.value,
844
+ "can-edit": He.value && re.value && p.value,
845
+ "edit-mode-enabled": p.value,
846
+ "has-inline-edit-perm": qe.value,
866
847
  "row-display-type": e.rowDisplayType,
867
- "render-drag": Kt.value,
868
- "disabled-drag": Wt.value,
869
- onClick: ze,
870
- onShow: Ge,
871
- onItemUp: Ot,
872
- onItemDown: Ut,
848
+ "render-drag": Ht.value,
849
+ "disabled-drag": qt.value,
850
+ onClick: Je,
851
+ onShow: Qe,
852
+ onItemUp: Ft,
853
+ onItemDown: Ot,
873
854
  onItemDrop: $e
874
- }, at({ _: 2 }, [
875
- c(a)[`item-${y}`] ? {
876
- name: `item-${y}`,
877
- fn: P((L) => [
878
- $(e.$slots, `item-${y}`, oe({
879
- [e.slotItemVar || ""]: L.item,
880
- index: y
855
+ }, nt({ _: 2 }, [
856
+ y(a)[`item-${b}`] ? {
857
+ name: `item-${b}`,
858
+ fn: P((R) => [
859
+ T(e.$slots, `item-${b}`, oe({
860
+ [e.slotItemVar || ""]: R.item,
861
+ index: b
881
862
  }))
882
863
  ]),
883
864
  key: "0"
884
- } : c(a).item ? {
865
+ } : y(a).item ? {
885
866
  name: "item",
886
- fn: P((L) => [
887
- $(e.$slots, "item", oe({
888
- [e.slotItemVar || ""]: L.item,
889
- index: y
867
+ fn: P((R) => [
868
+ T(e.$slots, "item", oe({
869
+ [e.slotItemVar || ""]: R.item,
870
+ index: b
890
871
  }))
891
872
  ]),
892
873
  key: "1"
893
874
  } : void 0,
894
- G(Oe.value, (L) => ({
895
- name: L,
875
+ G(Ae.value, (R) => ({
876
+ name: R,
896
877
  fn: P((z) => [
897
- $(e.$slots, L, oe({
878
+ T(e.$slots, R, oe({
898
879
  [e.slotItemVar || ""]: z.item,
899
880
  value: z.value,
900
881
  column: z.column
901
882
  }))
902
883
  ])
903
884
  }))
904
- ]), 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", "can-edit", "edit-text", "edit-icon", "edit-link", "edit-mode-enabled", "has-inline-edit-perm", "row-display-type", "render-drag", "disabled-drag"])), [
905
- [ke, Re(l.value[y])]
885
+ ]), 1032, ["modelValue", "onUpdate:modelValue", "i", "drop-button", "edit-button", "display-hidden-columns-indicator", "is-draggable", "sortable", "visible-columns", "empty-columns", "add-navigation", "hidden-is-visible", "latest-row", "can-drop", "can-edit", "edit-mode-enabled", "has-inline-edit-perm", "row-display-type", "render-drag", "disabled-drag"])), [
886
+ [ge, Re(l.value[b])]
906
887
  ])), 128)),
907
- Ve.value.length > 0 ? (u(!0), s(N, { key: 0 }, G(l.value, (B, y) => (u(), S(Bl, {
908
- modelValue: l.value[y],
909
- "onUpdate:modelValue": (L) => l.value[y] = L,
910
- key: Me(B, y, !0),
911
- i: y,
888
+ Ve.value.length > 0 ? (u(!0), s(L, { key: 0 }, G(l.value, (B, b) => (u(), S(Bl, {
889
+ modelValue: l.value[b],
890
+ "onUpdate:modelValue": (R) => l.value[b] = R,
891
+ key: Me(B, b, !0),
892
+ i: b,
912
893
  "hidden-columns": Ve.value,
913
- "hidden-columns-col-span": gt.value,
914
- "is-draggable": Je(B),
894
+ "hidden-columns-col-span": kt.value,
895
+ "is-draggable": Xe(B),
915
896
  sortable: Te.value,
916
897
  "visible-columns": he.value,
917
898
  "empty-columns": Ie.value,
918
- "hidden-is-visible": We(y),
919
- "edit-mode-enabled": I.value,
920
- "has-inline-edit-perm": He.value,
921
- onClick: ze,
922
- onShow: Ge
923
- }, at({ _: 2 }, [
924
- G(Oe.value, (L) => ({
925
- name: L,
899
+ "hidden-is-visible": ze(b),
900
+ "edit-mode-enabled": p.value,
901
+ "has-inline-edit-perm": qe.value,
902
+ onClick: Je,
903
+ onShow: Qe
904
+ }, nt({ _: 2 }, [
905
+ G(Ae.value, (R) => ({
906
+ name: R,
926
907
  fn: P((z) => [
927
- $(e.$slots, L, oe({
908
+ T(e.$slots, R, oe({
928
909
  [e.slotItemVar || ""]: z.item,
929
910
  value: z.value,
930
911
  column: z.column
931
912
  }))
932
913
  ])
933
914
  }))
934
- ]), 1032, ["modelValue", "onUpdate:modelValue", "i", "hidden-columns", "hidden-columns-col-span", "is-draggable", "sortable", "visible-columns", "empty-columns", "hidden-is-visible", "edit-mode-enabled", "has-inline-edit-perm"]))), 128)) : f("", !0)
915
+ ]), 1032, ["modelValue", "onUpdate:modelValue", "i", "hidden-columns", "hidden-columns-col-span", "is-draggable", "sortable", "visible-columns", "empty-columns", "hidden-is-visible", "edit-mode-enabled", "has-inline-edit-perm"]))), 128)) : c("", !0)
935
916
  ], 8, Ol)
936
- ])) : e.type === c(ye).Item ? (u(), s("div", {
917
+ ])) : e.type === y(ye).Item ? (u(), s("div", {
937
918
  key: 1,
938
919
  ref_key: "tableBody",
939
- ref: H,
940
- id: "lkt-table-body-" + c(fe),
920
+ ref: j,
921
+ id: "lkt-table-body-" + y(fe),
941
922
  class: J(["lkt-table-items-container", e.itemsContainerClass])
942
923
  }, [
943
- (u(!0), s(N, null, G(l.value, (B, y) => (u(), s(N, null, [
924
+ (u(!0), s(L, null, G(l.value, (B, b) => (u(), s(L, null, [
944
925
  Re(B) ? (u(), s("div", {
945
926
  class: "lkt-table-item",
946
- "data-i": y,
947
- key: Me(B, y)
927
+ "data-i": b,
928
+ key: Me(B, b)
948
929
  }, [
949
- $(e.$slots, "item", oe({
930
+ T(e.$slots, "item", oe({
950
931
  [e.slotItemVar || ""]: B,
951
- index: y,
952
- editing: I.value,
932
+ index: b,
933
+ editing: p.value,
953
934
  canCreate: ce.value,
954
- canRead: Ae.value,
935
+ canRead: je.value,
955
936
  canUpdate: re.value,
956
937
  canDrop: de.value,
957
- isLoading: w.value,
958
- doDrop: () => $e(y)
938
+ isLoading: I.value,
939
+ doDrop: () => $e(b)
959
940
  }))
960
- ], 8, Al)) : f("", !0)
941
+ ], 8, Al)) : c("", !0)
961
942
  ], 64))), 256))
962
- ], 10, Ul)) : jt.value ? (u(), S(Y(e.type), {
943
+ ], 10, Ul)) : At.value ? (u(), S(Z(e.type), {
963
944
  key: 2,
964
945
  class: J(["lkt-table-items-container", e.itemsContainerClass])
965
946
  }, {
966
947
  default: P(() => [
967
- (u(!0), s(N, null, G(l.value, (B, y) => (u(), s(N, null, [
948
+ (u(!0), s(L, null, G(l.value, (B, b) => (u(), s(L, null, [
968
949
  Re(B) ? (u(), s("li", {
969
950
  key: 0,
970
951
  class: "lkt-table-item",
971
- "data-i": y
952
+ "data-i": b
972
953
  }, [
973
- $(e.$slots, "item", oe({
954
+ T(e.$slots, "item", oe({
974
955
  [e.slotItemVar || ""]: B,
975
- index: y,
976
- editing: I.value,
956
+ index: b,
957
+ editing: p.value,
977
958
  canCreate: ce.value,
978
- canRead: Ae.value,
959
+ canRead: je.value,
979
960
  canUpdate: re.value,
980
961
  canDrop: de.value,
981
- isLoading: w.value,
982
- doDrop: () => $e(y)
962
+ isLoading: I.value,
963
+ doDrop: () => $e(b)
983
964
  }))
984
- ], 8, jl)) : f("", !0)
965
+ ], 8, _l)) : c("", !0)
985
966
  ], 64))), 256))
986
967
  ]),
987
968
  _: 3
988
- }, 8, ["class"])) : f("", !0)
969
+ }, 8, ["class"])) : c("", !0)
989
970
  ], 512), [
990
- [ke, Mt.value]
971
+ [ge, $t.value]
991
972
  ]),
992
- !w.value && l.value.length === 0 ? (u(), s("div", Hl, [
993
- c(a).empty ? $(e.$slots, "empty", { key: 0 }) : Ht.value ? (u(), S(Y(qt.value), {
973
+ !I.value && l.value.length === 0 ? (u(), s("div", jl, [
974
+ y(a).empty ? T(e.$slots, "empty", { key: 0 }) : _t.value ? (u(), S(Z(jt.value), {
994
975
  key: 1,
995
976
  message: e.noResultsText
996
- }, null, 8, ["message"])) : e.noResultsText ? (u(), s(N, { key: 2 }, [
977
+ }, null, 8, ["message"])) : e.noResultsText ? (u(), s(L, { key: 2 }, [
997
978
  ne(ue(e.noResultsText), 1)
998
- ], 64)) : f("", !0)
999
- ])) : f("", !0),
1000
- w.value ? (u(), S(A, { key: 4 })) : f("", !0),
1001
- Ce.value || c(a).bottomButtons ? (u(), s("div", ql, [
1002
- Ce.value && l.value.length >= e.requiredItemsForBottomCreate ? (u(), S(it, {
979
+ ], 64)) : c("", !0)
980
+ ])) : c("", !0),
981
+ I.value ? (u(), S(A, { key: 4 })) : c("", !0),
982
+ Ce.value || y(a).bottomButtons ? (u(), s("div", Hl, [
983
+ Ce.value && l.value.length >= e.requiredItemsForBottomCreate ? (u(), S(ut, {
1003
984
  key: 0,
1004
- config: Ne.value,
1005
- disabled: !tt.value,
1006
- onClick: Qe,
1007
- onAppend: Xe
1008
- }, null, 8, ["config", "disabled"])) : f("", !0),
1009
- $(e.$slots, "bottom-buttons")
1010
- ])) : f("", !0),
1011
- e.paginator && Object.keys(e.paginator).length > 0 ? (u(), S(W, Z({
985
+ config: Oe.value,
986
+ disabled: !at.value,
987
+ onClick: Ye,
988
+ onAppend: Ze
989
+ }, null, 8, ["config", "disabled"])) : c("", !0),
990
+ T(e.$slots, "bottom-buttons")
991
+ ])) : c("", !0),
992
+ e.paginator && Object.keys(e.paginator).length > 0 ? (u(), S(K, Q({
1012
993
  key: 6,
1013
994
  ref_key: "paginatorRef",
1014
- ref: te
995
+ ref: le
1015
996
  }, e.paginator, {
1016
997
  modelValue: U.value,
1017
- "onUpdate:modelValue": d[1] || (d[1] = (B) => U.value = B),
998
+ "onUpdate:modelValue": r[1] || (r[1] = (B) => U.value = B),
1018
999
  onLoading: bt,
1019
1000
  onPerms: ct,
1020
1001
  onResponse: yt
1021
- }), null, 16, ["modelValue"])) : f("", !0)
1002
+ }), null, 16, ["modelValue"])) : c("", !0)
1022
1003
  ]),
1023
1004
  _: 3
1024
1005
  }, 8, ["class"]))
@@ -1027,12 +1008,12 @@ const ol = /* @__PURE__ */ x({
1027
1008
  }
1028
1009
  }), Yl = {
1029
1010
  install: (o) => {
1030
- o.component("lkt-table") === void 0 && o.component("lkt-table", Kl);
1011
+ o.component("lkt-table") === void 0 && o.component("lkt-table", ql);
1031
1012
  }
1032
- }, Zl = (o) => (M.navButtonSlot = o, !0), xl = (o) => (M.dropButtonSlot = o, !0), ea = (o) => (M.createButtonSlot = o, !0), ta = (o) => {
1033
- M.defaultEmptySlot = o;
1013
+ }, Zl = (o) => ($.navButtonSlot = o, !0), xl = (o) => ($.dropButtonSlot = o, !0), ea = (o) => ($.createButtonSlot = o, !0), ta = (o) => {
1014
+ $.defaultEmptySlot = o;
1034
1015
  }, la = (o) => {
1035
- M.defaultSaveIcon = o;
1016
+ $.defaultSaveIcon = o;
1036
1017
  };
1037
1018
  export {
1038
1019
  na as Column,