lkt-table 1.4.3 → 2.0.2

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