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