lkt-table 2.0.2 → 2.0.4

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