lkt-table 1.2.26 → 1.3.1

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