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