lkt-table 1.2.4 → 1.2.6

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