lkt-table 2.0.2 → 2.0.3

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