lkt-table 1.3.13 → 1.3.14

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