lkt-table 1.2.13 → 1.2.15
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 +393 -393
- package/dist/build.js +235 -229
- package/package.json +3 -2
- package/src/lib-components/LktTable.vue +25 -12
package/dist/build.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { reactive as
|
|
2
|
-
import { httpCall as
|
|
1
|
+
import { reactive as W, defineComponent as J, ref as C, watch as F, nextTick as fe, computed as f, resolveComponent as L, openBlock as i, createBlock as b, withCtx as A, createTextVNode as ae, toDisplayString as j, unref as I, createElementBlock as m, Fragment as R, withModifiers as Ae, resolveDynamicComponent as X, createCommentVNode as y, normalizeClass as oe, createElementVNode as T, createVNode as Q, renderList as P, renderSlot as U, withDirectives as te, vShow as le, useSlots as rt, onMounted as dt, createSlots as Me } from "vue";
|
|
2
|
+
import { httpCall as ct } from "lkt-http-client";
|
|
3
3
|
import { __ as q } from "lkt-i18n";
|
|
4
4
|
import { createLktEvent as pe } from "lkt-events";
|
|
5
|
-
import { replaceAll as
|
|
6
|
-
import { DataState as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
class
|
|
5
|
+
import { replaceAll as Fe, generateRandomString as mt } from "lkt-string-tools";
|
|
6
|
+
import { DataState as ft } from "lkt-data-state";
|
|
7
|
+
import pt from "sortablejs";
|
|
8
|
+
import vt from "lkt-loader";
|
|
9
|
+
import ht from "lkt-button";
|
|
10
|
+
import kt from "lkt-paginator";
|
|
11
|
+
import yt from "lkt-field-text";
|
|
12
|
+
import bt from "lkt-field-textarea";
|
|
13
|
+
import gt from "lkt-field-select";
|
|
14
|
+
import Ct from "lkt-field-switch";
|
|
15
|
+
import St from "lkt-field-file";
|
|
16
|
+
class H {
|
|
17
17
|
constructor(t = "", d = "") {
|
|
18
18
|
this.key = t, this.label = d, this.sortable = !0, this.hidden = !1, this.formatter = void 0, this.checkEmpty = void 0, this.colspan = void 0, this.resource = "", this.resourceData = {}, this.isMultiple = !1, this.isLoading = !1, this.resourceLoaded = !1, this.valueSlot = "", this.editSlot = "", this.multipleDisplay = "", this.multipleDisplayEdition = "";
|
|
19
19
|
}
|
|
@@ -102,7 +102,7 @@ class K {
|
|
|
102
102
|
if (!this.resource) return this;
|
|
103
103
|
try {
|
|
104
104
|
this.isLoading = !0;
|
|
105
|
-
const t = await
|
|
105
|
+
const t = await ct(this.resource, this.resourceData);
|
|
106
106
|
this.options = t.data, this.isLoading = !1, this.resourceLoaded = !0;
|
|
107
107
|
} catch {
|
|
108
108
|
this.isLoading = !1;
|
|
@@ -155,7 +155,7 @@ class K {
|
|
|
155
155
|
return this.isForRowKey = t, this;
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
const wl = (l, t, d = !0) =>
|
|
158
|
+
const wl = (l, t, d = !0) => W(new H(l, t).setIsSortable(d)), Il = (l, t, d, a = !0) => W(new H(l, t).setIsSortable(a).defineAsLink(d)), Ll = (l, t, d, a = !0) => W(new H(l, t).setIsSortable(a).defineAsAction(d)), Ml = (l, t, d = !0) => W(new H(l, t).setIsSortable(d).defineAsText()), Rl = (l, t, d = !0) => W(new H(l, t).setIsSortable(d).defineAsEmail()), $l = (l, t, d = !0) => W(new H(l, t).setIsSortable(d).defineAsTel()), Al = (l, t, d = !0) => W(new H(l, t).setIsSortable(d).defineAsCheck()), Fl = (l, t, d = !0) => W(new H(l, t).setIsSortable(d).defineAsSwitch()), Ol = (l, t, d, a = !0) => W(new H(l, t).setIsSortable(a).defineAsSelect(d)), Nl = (l, t, d = !0) => W(new H(l, t).setIsSortable(d).setIsHidden(!0)), Re = (l, t, d, a) => {
|
|
159
159
|
if (!d) return 0;
|
|
160
160
|
let u = l[d.key], o = t[d.key];
|
|
161
161
|
if (a === "asc") {
|
|
@@ -177,14 +177,14 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
177
177
|
return u.startsWith("__:") ? q(u.substring(3)) : u;
|
|
178
178
|
}
|
|
179
179
|
return t[l.key];
|
|
180
|
-
},
|
|
180
|
+
}, Vt = (l, t, d) => {
|
|
181
181
|
if (!l.colspan) return -1;
|
|
182
182
|
let a = t;
|
|
183
183
|
return d.forEach((u) => {
|
|
184
184
|
let o = ve(l, u);
|
|
185
185
|
o > 0 && o < a && (a = o);
|
|
186
186
|
}), a;
|
|
187
|
-
}, ve = (l, t) => l.colspan === !1 ? !1 : typeof l.colspan == "function" ? l.colspan(t) : l.colspan,
|
|
187
|
+
}, ve = (l, t) => l.colspan === !1 ? !1 : typeof l.colspan == "function" ? l.colspan(t) : l.colspan, Bt = (l, t, d) => {
|
|
188
188
|
if (typeof l != "object" || !l.key || t.indexOf(l.key) > -1) return !1;
|
|
189
189
|
let a = ve(l, d);
|
|
190
190
|
return typeof l.colspan > "u" ? !0 : (typeof l.colspan < "u" && (typeof l.colspan == "function" ? a = parseInt(l.colspan()) : a = parseInt(l.colspan)), a > 0);
|
|
@@ -194,13 +194,13 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
194
194
|
if (l[t].sortable) return l[t].key;
|
|
195
195
|
}
|
|
196
196
|
return "";
|
|
197
|
-
},
|
|
197
|
+
}, Et = (l, t) => {
|
|
198
198
|
if (l.length > 0) {
|
|
199
199
|
for (let d = 0; d < l.length; ++d)
|
|
200
200
|
if (l[d].key === t) return l[d];
|
|
201
201
|
}
|
|
202
202
|
return null;
|
|
203
|
-
},
|
|
203
|
+
}, Oe = /* @__PURE__ */ J({
|
|
204
204
|
__name: "LktTableCell",
|
|
205
205
|
props: {
|
|
206
206
|
modelValue: { default: () => ({}) },
|
|
@@ -310,7 +310,7 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
310
310
|
dropButtonSlot: "",
|
|
311
311
|
editButtonSlot: "",
|
|
312
312
|
createButtonSlot: ""
|
|
313
|
-
},
|
|
313
|
+
}, Tt = /* @__PURE__ */ J({
|
|
314
314
|
__name: "DropButton",
|
|
315
315
|
props: {
|
|
316
316
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -333,7 +333,7 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
333
333
|
"resource-data": k.resourceData,
|
|
334
334
|
"confirm-modal": k.confirm,
|
|
335
335
|
disabled: k.disabled,
|
|
336
|
-
onClick: v[0] || (v[0] =
|
|
336
|
+
onClick: v[0] || (v[0] = Ae((s) => d("click"), ["prevent", "stop"]))
|
|
337
337
|
}, {
|
|
338
338
|
default: A(() => [
|
|
339
339
|
u.value ? (i(), b(X(o.value), { key: 0 })) : y("", !0)
|
|
@@ -367,7 +367,7 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
367
367
|
"resource-data": k.resourceData,
|
|
368
368
|
"confirm-modal": k.confirm,
|
|
369
369
|
disabled: k.disabled,
|
|
370
|
-
onClick: v[0] || (v[0] =
|
|
370
|
+
onClick: v[0] || (v[0] = Ae((s) => d("click"), ["prevent", "stop"]))
|
|
371
371
|
}, {
|
|
372
372
|
default: A(() => [
|
|
373
373
|
u.value ? (i(), b(X(o.value), { key: 0 })) : y("", !0)
|
|
@@ -376,19 +376,19 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
376
376
|
}, 8, ["icon", "text", "on-click-to", "resource", "resource-data", "confirm-modal", "disabled"]);
|
|
377
377
|
};
|
|
378
378
|
}
|
|
379
|
-
}),
|
|
379
|
+
}), It = ["data-i", "data-draggable"], Lt = {
|
|
380
380
|
key: 1,
|
|
381
381
|
"data-role": "invalid-drag-indicator"
|
|
382
|
-
},
|
|
382
|
+
}, Mt = {
|
|
383
383
|
key: 2,
|
|
384
384
|
class: "lkt-table-nav-cell"
|
|
385
|
-
},
|
|
385
|
+
}, Rt = { class: "lkt-table-nav-container" }, $t = /* @__PURE__ */ T("i", { class: "" }, null, -1), At = /* @__PURE__ */ T("i", { class: "" }, null, -1), Ft = ["data-column", "colspan", "title", "onClick"], Ot = {
|
|
386
386
|
key: 4,
|
|
387
387
|
class: "lkt-table-col-drop"
|
|
388
|
-
},
|
|
388
|
+
}, Nt = {
|
|
389
389
|
key: 5,
|
|
390
390
|
class: "lkt-table-col-edit"
|
|
391
|
-
},
|
|
391
|
+
}, Ut = /* @__PURE__ */ J({
|
|
392
392
|
__name: "LktTableRow",
|
|
393
393
|
props: {
|
|
394
394
|
modelValue: { default: () => ({}) },
|
|
@@ -415,7 +415,7 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
415
415
|
emits: ["update:modelValue", "click", "show", "item-up", "item-down", "item-drop"],
|
|
416
416
|
setup(l, { emit: t }) {
|
|
417
417
|
const d = t, a = l, u = C(a.modelValue), o = C(a.editLink);
|
|
418
|
-
for (let r in u.value) o.value =
|
|
418
|
+
for (let r in u.value) o.value = Fe(o.value, ":" + r, u.value[r]);
|
|
419
419
|
const h = (r, M, p) => {
|
|
420
420
|
d("click", r, pe("", { item: M, column: p }));
|
|
421
421
|
}, k = (r, M) => {
|
|
@@ -443,9 +443,9 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
443
443
|
key: 0,
|
|
444
444
|
"data-role": "drag-indicator",
|
|
445
445
|
class: oe(v.value)
|
|
446
|
-
}, null, 2)) : r.sortable && r.editModeEnabled ? (i(), m("td",
|
|
447
|
-
r.addNavigation && r.editModeEnabled ? (i(), m("td",
|
|
448
|
-
|
|
446
|
+
}, null, 2)) : r.sortable && r.editModeEnabled ? (i(), m("td", Lt)) : y("", !0),
|
|
447
|
+
r.addNavigation && r.editModeEnabled ? (i(), m("td", Mt, [
|
|
448
|
+
T("div", Rt, [
|
|
449
449
|
Q(p, {
|
|
450
450
|
palette: "table-nav",
|
|
451
451
|
disabled: r.i === 0,
|
|
@@ -456,7 +456,7 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
456
456
|
key: 0,
|
|
457
457
|
direction: "up"
|
|
458
458
|
})) : (i(), m(R, { key: 1 }, [
|
|
459
|
-
|
|
459
|
+
$t,
|
|
460
460
|
ae(" UP ")
|
|
461
461
|
], 64))
|
|
462
462
|
]),
|
|
@@ -472,7 +472,7 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
472
472
|
key: 0,
|
|
473
473
|
direction: "down"
|
|
474
474
|
})) : (i(), m(R, { key: 1 }, [
|
|
475
|
-
|
|
475
|
+
At,
|
|
476
476
|
ae(" DOWN ")
|
|
477
477
|
], 64))
|
|
478
478
|
]),
|
|
@@ -482,37 +482,37 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
482
482
|
])) : y("", !0),
|
|
483
483
|
r.displayHiddenColumnsIndicator ? (i(), m("td", {
|
|
484
484
|
key: 3,
|
|
485
|
-
onClick: M[0] || (M[0] = (
|
|
485
|
+
onClick: M[0] || (M[0] = (E) => k(E, r.i)),
|
|
486
486
|
"data-role": "show-more",
|
|
487
487
|
class: oe(r.hiddenIsVisible ? "state-open" : "")
|
|
488
488
|
}, null, 2)) : y("", !0),
|
|
489
|
-
(i(!0), m(R, null,
|
|
490
|
-
I(
|
|
489
|
+
(i(!0), m(R, null, P(r.visibleColumns, (E) => (i(), m(R, null, [
|
|
490
|
+
I(Bt)(E, r.emptyColumns, u.value) ? (i(), m("td", {
|
|
491
491
|
key: 0,
|
|
492
|
-
"data-column":
|
|
493
|
-
colspan: I(ve)(
|
|
494
|
-
title: I(x)(
|
|
495
|
-
onClick: (ee) => h(ee, u.value,
|
|
492
|
+
"data-column": E.key,
|
|
493
|
+
colspan: I(ve)(E, u.value),
|
|
494
|
+
title: I(x)(E, u.value, r.i, r.visibleColumns),
|
|
495
|
+
onClick: (ee) => h(ee, u.value, E)
|
|
496
496
|
}, [
|
|
497
|
-
r.$slots[
|
|
497
|
+
r.$slots[E.key] ? U(r.$slots, E.key, {
|
|
498
498
|
key: 0,
|
|
499
|
-
value: u.value[
|
|
499
|
+
value: u.value[E.key],
|
|
500
500
|
item: u.value,
|
|
501
|
-
column:
|
|
501
|
+
column: E,
|
|
502
502
|
i: r.i
|
|
503
|
-
}) : u.value ? (i(), b(
|
|
503
|
+
}) : u.value ? (i(), b(Oe, {
|
|
504
504
|
key: 1,
|
|
505
505
|
modelValue: u.value,
|
|
506
506
|
"onUpdate:modelValue": M[1] || (M[1] = (ee) => u.value = ee),
|
|
507
|
-
column:
|
|
507
|
+
column: E,
|
|
508
508
|
columns: r.visibleColumns,
|
|
509
509
|
"edit-mode-enabled": r.editModeEnabled,
|
|
510
510
|
i: r.i
|
|
511
511
|
}, null, 8, ["modelValue", "column", "columns", "edit-mode-enabled", "i"])) : y("", !0)
|
|
512
|
-
], 8,
|
|
512
|
+
], 8, Ft)) : y("", !0)
|
|
513
513
|
], 64))), 256)),
|
|
514
|
-
r.canDrop && r.editModeEnabled ? (i(), m("td",
|
|
515
|
-
Q(
|
|
514
|
+
r.canDrop && r.editModeEnabled ? (i(), m("td", Ot, [
|
|
515
|
+
Q(Tt, {
|
|
516
516
|
resource: r.dropResource,
|
|
517
517
|
"resource-data": u.value,
|
|
518
518
|
confirm: r.dropConfirm,
|
|
@@ -521,7 +521,7 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
521
521
|
onClick: $
|
|
522
522
|
}, null, 8, ["resource", "resource-data", "confirm", "text", "icon"])
|
|
523
523
|
])) : y("", !0),
|
|
524
|
-
r.canEdit && r.editModeEnabled ? (i(), m("td",
|
|
524
|
+
r.canEdit && r.editModeEnabled ? (i(), m("td", Nt, [
|
|
525
525
|
Q(wt, {
|
|
526
526
|
"resource-data": u.value,
|
|
527
527
|
text: r.editText,
|
|
@@ -530,10 +530,10 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
530
530
|
onClick: Y
|
|
531
531
|
}, null, 8, ["resource-data", "text", "icon", "link"])
|
|
532
532
|
])) : y("", !0)
|
|
533
|
-
], 8,
|
|
533
|
+
], 8, It);
|
|
534
534
|
};
|
|
535
535
|
}
|
|
536
|
-
}),
|
|
536
|
+
}), Wt = { "data-role": "hidden-row" }, Ht = ["colspan"], Kt = ["data-column"], Pt = ["data-i"], _t = ["data-column", "title", "onClick"], jt = /* @__PURE__ */ J({
|
|
537
537
|
__name: "LktHiddenRow",
|
|
538
538
|
props: {
|
|
539
539
|
modelValue: { default: () => ({}) },
|
|
@@ -551,18 +551,18 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
551
551
|
const d = t, a = l, u = C(a.modelValue), o = (h, k, v) => {
|
|
552
552
|
d("click", h, pe("", { item: k, column: v }));
|
|
553
553
|
};
|
|
554
|
-
return F(() => a.modelValue, (h) => u.value = h), F(u, () => d("update:modelValue", u.value)), (h, k) => te((i(), m("tr",
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
(i(!0), m(R, null,
|
|
554
|
+
return F(() => a.modelValue, (h) => u.value = h), F(u, () => d("update:modelValue", u.value)), (h, k) => te((i(), m("tr", Wt, [
|
|
555
|
+
T("td", { colspan: h.hiddenColumnsColSpan }, [
|
|
556
|
+
T("table", null, [
|
|
557
|
+
T("tr", null, [
|
|
558
|
+
(i(!0), m(R, null, P(h.hiddenColumns, (v) => (i(), m("th", {
|
|
559
559
|
"data-column": v.key
|
|
560
560
|
}, [
|
|
561
|
-
|
|
561
|
+
T("div", null, j(v.label), 1)
|
|
562
562
|
], 8, Kt))), 256))
|
|
563
563
|
]),
|
|
564
|
-
|
|
565
|
-
(i(!0), m(R, null,
|
|
564
|
+
T("tr", { "data-i": h.i }, [
|
|
565
|
+
(i(!0), m(R, null, P(h.hiddenColumns, (v, n) => (i(), m("td", {
|
|
566
566
|
"data-column": v.key,
|
|
567
567
|
title: I(x)(v, u.value, n, h.hiddenColumns),
|
|
568
568
|
onClick: (s) => o(s, u.value, v)
|
|
@@ -573,7 +573,7 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
573
573
|
item: u.value,
|
|
574
574
|
column: v,
|
|
575
575
|
i: n
|
|
576
|
-
}) : (i(), b(
|
|
576
|
+
}) : (i(), b(Oe, {
|
|
577
577
|
key: 1,
|
|
578
578
|
column: v,
|
|
579
579
|
columns: h.hiddenColumns,
|
|
@@ -581,7 +581,7 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
581
581
|
"onUpdate:modelValue": k[0] || (k[0] = (s) => u.value = s),
|
|
582
582
|
i: n
|
|
583
583
|
}, null, 8, ["column", "columns", "modelValue", "i"]))
|
|
584
|
-
], 8,
|
|
584
|
+
], 8, _t))), 256))
|
|
585
585
|
], 8, Pt)
|
|
586
586
|
])
|
|
587
587
|
], 8, Ht)
|
|
@@ -589,7 +589,7 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
589
589
|
[le, h.hiddenIsVisible]
|
|
590
590
|
]);
|
|
591
591
|
}
|
|
592
|
-
}),
|
|
592
|
+
}), $e = /* @__PURE__ */ J({
|
|
593
593
|
__name: "CreateButton",
|
|
594
594
|
props: {
|
|
595
595
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -617,7 +617,7 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
617
617
|
}, 8, ["disabled", "icon", "text", "on-click-to"]);
|
|
618
618
|
};
|
|
619
619
|
}
|
|
620
|
-
}),
|
|
620
|
+
}), qt = ["data-column", "data-sortable", "data-sort", "colspan", "title"], Jt = /* @__PURE__ */ J({
|
|
621
621
|
__name: "TableHeader",
|
|
622
622
|
props: {
|
|
623
623
|
column: { default: () => ({}) },
|
|
@@ -628,7 +628,7 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
628
628
|
},
|
|
629
629
|
emits: ["click"],
|
|
630
630
|
setup(l, { emit: t }) {
|
|
631
|
-
const d = t, a = l, u = f(() =>
|
|
631
|
+
const d = t, a = l, u = f(() => Vt(a.column, a.amountOfColumns, a.items)), o = f(() => a.column.sortable === !0), h = f(() => o.value && a.sortBy === a.column.key ? a.sortDirection : ""), k = f(() => a.column.label.startsWith("__:") ? q(a.column.label.substring(3)) : a.column.label), v = () => {
|
|
632
632
|
d("click", a.column);
|
|
633
633
|
};
|
|
634
634
|
return (n, s) => (i(), m("th", {
|
|
@@ -639,39 +639,39 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
639
639
|
title: k.value,
|
|
640
640
|
onClick: v
|
|
641
641
|
}, [
|
|
642
|
-
|
|
643
|
-
], 8,
|
|
642
|
+
T("div", null, j(k.value), 1)
|
|
643
|
+
], 8, qt));
|
|
644
644
|
}
|
|
645
|
-
}),
|
|
645
|
+
}), Gt = ["id"], zt = { key: 0 }, Qt = { class: "lkt-table-page-buttons" }, Xt = { key: 1 }, Yt = { class: "switch-edition-mode" }, Zt = {
|
|
646
646
|
key: 0,
|
|
647
647
|
class: "lkt-table-page-buttons"
|
|
648
|
-
},
|
|
648
|
+
}, xt = {
|
|
649
649
|
key: 1,
|
|
650
650
|
class: "lkt-table-page-filters"
|
|
651
|
-
},
|
|
651
|
+
}, el = ["data-sortable"], tl = { key: 0 }, ll = {
|
|
652
652
|
key: 0,
|
|
653
653
|
"data-role": "drag-indicator"
|
|
654
|
-
},
|
|
654
|
+
}, ol = { key: 1 }, al = { key: 2 }, nl = {
|
|
655
655
|
key: 3,
|
|
656
656
|
class: "lkt-table-col-drop"
|
|
657
|
-
},
|
|
657
|
+
}, ul = {
|
|
658
658
|
key: 4,
|
|
659
659
|
class: "lkt-table-col-edit"
|
|
660
|
-
},
|
|
660
|
+
}, il = ["id"], sl = { class: "lkt-table-item" }, rl = {
|
|
661
661
|
key: 3,
|
|
662
662
|
class: "lkt-empty-table"
|
|
663
|
-
},
|
|
663
|
+
}, dl = {
|
|
664
664
|
key: 4,
|
|
665
665
|
class: "lkt-table-page-empty"
|
|
666
|
-
},
|
|
666
|
+
}, cl = {
|
|
667
667
|
key: 5,
|
|
668
668
|
class: "lkt-table-page-buttons lkt-table-page-buttons-bottom"
|
|
669
|
-
},
|
|
669
|
+
}, ml = /* @__PURE__ */ J({
|
|
670
670
|
__name: "LktTable",
|
|
671
671
|
props: {
|
|
672
672
|
modelValue: { default: () => [] },
|
|
673
673
|
columns: { default: () => [] },
|
|
674
|
-
sorter: { type: Function, default:
|
|
674
|
+
sorter: { type: Function, default: Re },
|
|
675
675
|
draggableChecker: { type: Function, default: (l) => !0 },
|
|
676
676
|
checkValidDrag: { type: Function, default: void 0 },
|
|
677
677
|
sortable: { type: Boolean, default: !1 },
|
|
@@ -709,6 +709,8 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
709
709
|
editModeText: { default: "Edit mode" },
|
|
710
710
|
switchEditionEnabled: { type: Boolean, default: !1 },
|
|
711
711
|
canCreate: { type: Boolean, default: !1 },
|
|
712
|
+
canCreateWithoutEdition: { type: Boolean, default: !1 },
|
|
713
|
+
canEditButton: { type: Boolean, default: !1 },
|
|
712
714
|
canDrop: { type: Boolean, default: !1 },
|
|
713
715
|
dropConfirm: { default: "" },
|
|
714
716
|
dropResource: { default: "" },
|
|
@@ -719,39 +721,39 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
719
721
|
requiredItemsForTopCreate: { default: 0 },
|
|
720
722
|
requiredItemsForBottomCreate: { default: 0 }
|
|
721
723
|
},
|
|
722
|
-
emits: ["update:modelValue", "sort", "click", "save", "error", "before-save", "read-response"],
|
|
724
|
+
emits: ["update:modelValue", "sort", "click", "save", "error", "before-save", "read-response", "click-create"],
|
|
723
725
|
setup(l, { expose: t, emit: d }) {
|
|
724
|
-
const a = d, u =
|
|
726
|
+
const a = d, u = rt(), o = l, h = {}, k = C(typeof o.sorter == "function" ? o.sorter : Re), v = C(Dt(o.columns)), n = C("asc"), s = C(o.modelValue), _ = C(h), G = C(null), $ = C(o.columns), Y = C(o.page), r = C(!1), M = C(!1), p = C(o.perms), E = C(null), ee = C({}), Z = C(new ft({ items: s.value }, o.dataStateConfig)), w = C(o.editMode), Ne = (e) => {
|
|
725
727
|
Array.isArray(e) && (s.value = e), r.value = !1, M.value = !0, Z.value.store({ items: s.value }).turnStoredIntoOriginal();
|
|
726
|
-
}, Ne = (e) => {
|
|
727
|
-
p.value = e;
|
|
728
728
|
}, Ue = (e) => {
|
|
729
|
+
p.value = e;
|
|
730
|
+
}, We = (e) => {
|
|
729
731
|
}, He = (e) => {
|
|
730
732
|
a("read-response", e);
|
|
731
733
|
}, Ke = () => fe(() => r.value = !0), Pe = () => {
|
|
732
|
-
|
|
733
|
-
}, ne =
|
|
734
|
+
E.value.doRefresh();
|
|
735
|
+
}, ne = mt(12), se = f(() => {
|
|
734
736
|
if (!o.hideEmptyColumns) return [];
|
|
735
737
|
let e = [];
|
|
736
738
|
return $.value.forEach((c) => {
|
|
737
|
-
let g = c.key,
|
|
739
|
+
let g = c.key, B = !1;
|
|
738
740
|
s.value.forEach((S) => {
|
|
739
741
|
if (typeof S.checkEmpty == "function")
|
|
740
742
|
return S.checkEmpty(S);
|
|
741
|
-
S[g] && (
|
|
742
|
-
}),
|
|
743
|
+
S[g] && (B = !0);
|
|
744
|
+
}), B || e.push(g);
|
|
743
745
|
}), e;
|
|
744
|
-
}), ue = f(() => $.value.filter((e) => !e.hidden)), re = f(() => $.value.filter((e) => e.hidden)),
|
|
746
|
+
}), ue = f(() => $.value.filter((e) => !e.hidden)), re = f(() => $.value.filter((e) => e.hidden)), _e = f(() => {
|
|
745
747
|
let e = ue.value.length + 1;
|
|
746
748
|
return o.sortable && ++e, e;
|
|
747
|
-
}),
|
|
749
|
+
}), je = f(() => $.value.filter((e) => e.isForRowKey)), he = f(() => re.value.length > 0 && !o.sortable), qe = f(() => $.value.map((e) => e.key)), ke = f(() => {
|
|
748
750
|
let e = [];
|
|
749
|
-
for (let c in u)
|
|
751
|
+
for (let c in u) qe.value.indexOf(c) !== -1 && e.push(c);
|
|
750
752
|
return e;
|
|
751
|
-
}), ye = f(() => o.hiddenSave || r.value || !o.saveResource ? !1 :
|
|
753
|
+
}), ye = f(() => o.hiddenSave || r.value || !o.saveResource ? !1 : w.value && Z.value.changed() ? !0 : w.value), Je = f(() => ie.value || o.switchEditionEnabled ? !0 : ye.value || w.value && o.canCreate), Ge = f(() => o.saveDisabled || typeof o.saveValidator == "function" && !o.saveValidator(s.value) ? !1 : Z.value.changed()), ze = f(() => s.value.length), Qe = f(() => ({
|
|
752
754
|
items: s.value,
|
|
753
755
|
...o.saveResourceData
|
|
754
|
-
})),
|
|
756
|
+
})), Xe = f(() => o.titleTag === "" ? "h2" : o.titleTag), Ye = f(() => o.wrapContentTag === "" ? "div" : o.wrapContentTag), de = f(() => o.title.startsWith("__:") ? q(o.title.substring(3)) : o.title), Ze = f(() => o.saveText.startsWith("__:") ? q(o.saveText.substring(3)) : o.saveText), xe = f(() => o.editModeText.startsWith("__:") ? q(o.editModeText.substring(3)) : o.editModeText), be = f(() => p.value.includes("create")), et = f(() => p.value.includes("read")), ce = f(() => p.value.includes("update")), me = f(() => p.value.includes("drop")), tt = (e) => {
|
|
755
757
|
let c = e.target;
|
|
756
758
|
if (typeof c.dataset.column > "u")
|
|
757
759
|
do
|
|
@@ -759,95 +761,99 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
759
761
|
while (typeof c.dataset.column > "u" && c.tagName !== "TABLE" && c.tagName !== "body");
|
|
760
762
|
if (c.tagName === "TD" && (c = c.parentNode, c = c.dataset.i, typeof c < "u"))
|
|
761
763
|
return s.value[c];
|
|
762
|
-
},
|
|
764
|
+
}, ge = (e) => _.value["tr_" + e] === !0, Ce = (e) => {
|
|
763
765
|
e && e.sortable && (s.value = s.value.sort((c, g) => k.value(c, g, e, n.value)), n.value = n.value === "asc" ? "desc" : "asc", v.value = e.key, a("sort", [v.value, n.value]));
|
|
764
|
-
}, Ce = (e, c) => {
|
|
765
|
-
a("click", e, c);
|
|
766
766
|
}, Se = (e, c) => {
|
|
767
|
+
a("click", e, c);
|
|
768
|
+
}, Ve = (e, c) => {
|
|
767
769
|
let g = "tr_" + c.value.i;
|
|
768
770
|
_.value[g] = typeof _.value[g] > "u" ? !0 : !_.value[g];
|
|
769
|
-
},
|
|
771
|
+
}, Be = () => {
|
|
770
772
|
$.value.forEach((e) => {
|
|
771
773
|
if (e.type === "select" && e.autoLoadSelectOptions) {
|
|
772
774
|
let c = e.autoLoadSelectOptionsKey !== "" ? e.autoLoadSelectOptionsKey : e.key, g = [];
|
|
773
775
|
s.value.forEach((S) => {
|
|
774
776
|
Array.isArray(S[c]) && S[c].forEach((N) => g.push(N));
|
|
775
777
|
});
|
|
776
|
-
let
|
|
778
|
+
let B = {};
|
|
777
779
|
g = g.filter(function(S) {
|
|
778
|
-
return
|
|
780
|
+
return B[S.value] ? !1 : (B[S.value] = !0, !0);
|
|
779
781
|
}), e.setOptions(g);
|
|
780
782
|
}
|
|
781
783
|
});
|
|
782
|
-
},
|
|
783
|
-
if (
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
784
|
+
}, lt = (e) => typeof o.checkValidDrag == "function" ? o.checkValidDrag(e) : !0, De = (e) => typeof o.draggableChecker == "function" ? o.draggableChecker(e) : !0, Ee = () => {
|
|
785
|
+
if (o.canCreateWithoutEdition)
|
|
786
|
+
a("click-create");
|
|
787
|
+
else {
|
|
788
|
+
if (typeof o.newValueGenerator == "function") {
|
|
789
|
+
let e = o.newValueGenerator();
|
|
790
|
+
if (typeof e == "object") {
|
|
791
|
+
s.value.push(e);
|
|
792
|
+
return;
|
|
793
|
+
}
|
|
788
794
|
}
|
|
795
|
+
s.value.push({});
|
|
789
796
|
}
|
|
790
|
-
s.value.push({});
|
|
791
|
-
}, lt = () => {
|
|
792
|
-
r.value = !0;
|
|
793
797
|
}, ot = () => {
|
|
798
|
+
r.value = !0;
|
|
799
|
+
}, at = () => {
|
|
794
800
|
r.value = !1;
|
|
795
|
-
},
|
|
801
|
+
}, nt = (e, c) => {
|
|
796
802
|
if (a("before-save"), o.saveResource && (r.value = !1, !c.success)) {
|
|
797
803
|
a("error", c.httpStatus);
|
|
798
804
|
return;
|
|
799
805
|
}
|
|
800
806
|
Z.value.turnStoredIntoOriginal(), a("save", c);
|
|
801
|
-
},
|
|
807
|
+
}, Te = (e, c, g) => {
|
|
802
808
|
if (g >= e.length) {
|
|
803
|
-
let
|
|
804
|
-
for (;
|
|
809
|
+
let B = g - e.length + 1;
|
|
810
|
+
for (; B--; ) e.push(void 0);
|
|
805
811
|
}
|
|
806
812
|
return e.splice(g, 0, e.splice(c, 1)[0]), e;
|
|
807
|
-
}, nt = (e) => {
|
|
808
|
-
Be(s.value, e, e - 1);
|
|
809
813
|
}, ut = (e) => {
|
|
810
|
-
|
|
814
|
+
Te(s.value, e, e - 1);
|
|
815
|
+
}, it = (e) => {
|
|
816
|
+
Te(s.value, e, e + 1);
|
|
811
817
|
}, we = (e) => {
|
|
812
818
|
s.value.splice(e, 1);
|
|
813
|
-
},
|
|
819
|
+
}, st = () => {
|
|
814
820
|
let e = document.getElementById("lkt-table-body-" + ne);
|
|
815
|
-
ee.value = new
|
|
821
|
+
ee.value = new pt(e, {
|
|
816
822
|
direction: "vertical",
|
|
817
823
|
handle: ".handle",
|
|
818
824
|
animation: 150,
|
|
819
825
|
onEnd: function(c) {
|
|
820
|
-
let g = c.oldIndex,
|
|
821
|
-
s.value.splice(g, 1, S[
|
|
826
|
+
let g = c.oldIndex, B = c.newIndex, S = JSON.parse(JSON.stringify(s.value));
|
|
827
|
+
s.value.splice(g, 1, S[B]), s.value.splice(B, 1, S[g]);
|
|
822
828
|
},
|
|
823
829
|
onMove: function(c, g) {
|
|
824
|
-
return
|
|
830
|
+
return lt(c);
|
|
825
831
|
}
|
|
826
832
|
});
|
|
827
|
-
},
|
|
828
|
-
let
|
|
829
|
-
return g &&
|
|
833
|
+
}, Ie = (e, c, g = !1) => {
|
|
834
|
+
let B = [ne, "row", c];
|
|
835
|
+
return g && B.push("hidden"), je.value.forEach((S) => {
|
|
830
836
|
let N = String(e[S.key]).toLowerCase();
|
|
831
|
-
N.length > 50 && (N = N.substring(0, 50)), N =
|
|
832
|
-
}),
|
|
833
|
-
},
|
|
834
|
-
return
|
|
835
|
-
|
|
836
|
-
|
|
837
|
+
N.length > 50 && (N = N.substring(0, 50)), N = Fe(N, " ", "-"), B.push(N);
|
|
838
|
+
}), B.join("-");
|
|
839
|
+
}, Le = f(() => typeof o.createEnabledValidator == "function" ? o.createEnabledValidator({ items: s.value }) : !0), ie = f(() => be.value ? o.canCreateWithoutEdition || o.canCreate && w.value : !1);
|
|
840
|
+
return dt(() => {
|
|
841
|
+
Be(), Ce(Et(o.columns, v.value)), Z.value.store({ items: s.value }).turnStoredIntoOriginal(), o.sortable && fe(() => {
|
|
842
|
+
st();
|
|
837
843
|
});
|
|
838
|
-
}), F(() => o.editMode, (e) =>
|
|
839
|
-
|
|
844
|
+
}), F(() => o.editMode, (e) => w.value = e), F(() => o.columns, (e) => $.value = e), F(() => o.modelValue, (e) => s.value = e), F(s, (e) => {
|
|
845
|
+
Be(), Z.value.increment({ items: e }), a("update:modelValue", e);
|
|
840
846
|
}, { deep: !0 }), t({
|
|
841
|
-
getItemByEvent:
|
|
847
|
+
getItemByEvent: tt,
|
|
842
848
|
doRefresh: Pe
|
|
843
849
|
}), (e, c) => {
|
|
844
|
-
const g = L("lkt-button"),
|
|
850
|
+
const g = L("lkt-button"), B = L("lkt-field-switch"), S = L("lkt-loader"), N = L("lkt-paginator");
|
|
845
851
|
return i(), m("section", {
|
|
846
852
|
class: "lkt-table-page",
|
|
847
853
|
id: "lkt-table-page-" + I(ne)
|
|
848
854
|
}, [
|
|
849
|
-
de.value || I(u).title ? (i(), m("header",
|
|
850
|
-
de.value ? (i(), b(X(
|
|
855
|
+
de.value || I(u).title ? (i(), m("header", zt, [
|
|
856
|
+
de.value ? (i(), b(X(Xe.value), { key: 0 }, {
|
|
851
857
|
default: A(() => [
|
|
852
858
|
e.titleIcon ? (i(), m("i", {
|
|
853
859
|
key: 0,
|
|
@@ -859,22 +865,22 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
859
865
|
})) : y("", !0),
|
|
860
866
|
I(u).title ? U(e.$slots, "title", { key: 1 }) : y("", !0)
|
|
861
867
|
])) : y("", !0),
|
|
862
|
-
(i(), b(X(
|
|
868
|
+
(i(), b(X(Ye.value), {
|
|
863
869
|
class: oe(["lkt-table-page-content-wrapper", e.wrapContentClass])
|
|
864
870
|
}, {
|
|
865
871
|
default: A(() => [
|
|
866
|
-
te(
|
|
872
|
+
te(T("div", Qt, [
|
|
867
873
|
te(Q(g, {
|
|
868
874
|
ref: "saveButton",
|
|
869
875
|
palette: "success",
|
|
870
|
-
disabled: !
|
|
876
|
+
disabled: !Ge.value,
|
|
871
877
|
"confirm-modal": e.saveConfirm,
|
|
872
878
|
"confirm-data": e.confirmData,
|
|
873
879
|
resource: e.saveResource,
|
|
874
|
-
"resource-data":
|
|
875
|
-
onLoading:
|
|
876
|
-
onLoaded:
|
|
877
|
-
onClick:
|
|
880
|
+
"resource-data": Qe.value,
|
|
881
|
+
onLoading: ot,
|
|
882
|
+
onLoaded: at,
|
|
883
|
+
onClick: nt
|
|
878
884
|
}, {
|
|
879
885
|
default: A(() => [
|
|
880
886
|
I(u)["button-save"] ? U(e.$slots, "button-save", {
|
|
@@ -882,43 +888,43 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
882
888
|
items: s.value,
|
|
883
889
|
editMode: e.editMode,
|
|
884
890
|
canUpdate: !e.saveDisabled
|
|
885
|
-
}) : (i(), m("span",
|
|
891
|
+
}) : (i(), m("span", Xt, j(Ze.value), 1))
|
|
886
892
|
]),
|
|
887
893
|
_: 3
|
|
888
894
|
}, 8, ["disabled", "confirm-modal", "confirm-data", "resource", "resource-data"]), [
|
|
889
895
|
[le, ye.value]
|
|
890
896
|
]),
|
|
891
|
-
|
|
897
|
+
ie.value && s.value.length >= e.requiredItemsForTopCreate ? (i(), b($e, {
|
|
892
898
|
key: 0,
|
|
893
|
-
disabled: !
|
|
899
|
+
disabled: !Le.value,
|
|
894
900
|
text: e.createText,
|
|
895
901
|
icon: e.createIcon,
|
|
896
902
|
to: e.createRoute,
|
|
897
|
-
onClick:
|
|
903
|
+
onClick: Ee
|
|
898
904
|
}, null, 8, ["disabled", "text", "icon", "to"])) : y("", !0),
|
|
899
|
-
|
|
900
|
-
te(Q(
|
|
901
|
-
modelValue:
|
|
902
|
-
"onUpdate:modelValue": c[0] || (c[0] = (V) =>
|
|
903
|
-
label:
|
|
905
|
+
T("div", Yt, [
|
|
906
|
+
te(Q(B, {
|
|
907
|
+
modelValue: w.value,
|
|
908
|
+
"onUpdate:modelValue": c[0] || (c[0] = (V) => w.value = V),
|
|
909
|
+
label: xe.value
|
|
904
910
|
}, null, 8, ["modelValue", "label"]), [
|
|
905
911
|
[le, e.switchEditionEnabled]
|
|
906
912
|
])
|
|
907
913
|
])
|
|
908
914
|
], 512), [
|
|
909
|
-
[le,
|
|
915
|
+
[le, Je.value]
|
|
910
916
|
]),
|
|
911
|
-
I(u).buttons ? (i(), m("div",
|
|
917
|
+
I(u).buttons ? (i(), m("div", Zt, [
|
|
912
918
|
U(e.$slots, "buttons")
|
|
913
919
|
])) : y("", !0),
|
|
914
|
-
M.value && I(u).filters ? (i(), m("div",
|
|
920
|
+
M.value && I(u).filters ? (i(), m("div", xt, [
|
|
915
921
|
U(e.$slots, "filters", {
|
|
916
922
|
items: s.value,
|
|
917
923
|
isLoading: r.value
|
|
918
924
|
})
|
|
919
925
|
])) : y("", !0),
|
|
920
926
|
r.value ? (i(), b(S, { key: 2 })) : y("", !0),
|
|
921
|
-
te(
|
|
927
|
+
te(T("div", {
|
|
922
928
|
class: "lkt-table",
|
|
923
929
|
"data-sortable": e.sortable
|
|
924
930
|
}, [
|
|
@@ -926,76 +932,76 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
926
932
|
key: 1,
|
|
927
933
|
class: oe(["lkt-table-items-container", e.itemsContainerClass])
|
|
928
934
|
}, [
|
|
929
|
-
(i(!0), m(R, null,
|
|
935
|
+
(i(!0), m(R, null, P(s.value, (V, D) => (i(), m("div", sl, [
|
|
930
936
|
U(e.$slots, "item", {
|
|
931
937
|
item: V,
|
|
932
|
-
index:
|
|
933
|
-
canCreate:
|
|
934
|
-
canRead:
|
|
938
|
+
index: D,
|
|
939
|
+
canCreate: be.value,
|
|
940
|
+
canRead: et.value,
|
|
935
941
|
canUpdate: ce.value,
|
|
936
942
|
canDrop: me.value,
|
|
937
943
|
isLoading: r.value,
|
|
938
|
-
doDrop: () => we(
|
|
944
|
+
doDrop: () => we(D)
|
|
939
945
|
})
|
|
940
946
|
]))), 256))
|
|
941
|
-
], 2)) : (i(), m("table",
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
e.sortable &&
|
|
945
|
-
e.addNavigation &&
|
|
946
|
-
he.value ? (i(), m("th",
|
|
947
|
-
(i(!0), m(R, null,
|
|
948
|
-
se.value.indexOf(V.key) === -1 ? (i(), b(
|
|
947
|
+
], 2)) : (i(), m("table", tl, [
|
|
948
|
+
T("thead", null, [
|
|
949
|
+
T("tr", null, [
|
|
950
|
+
e.sortable && w.value ? (i(), m("th", ll)) : y("", !0),
|
|
951
|
+
e.addNavigation && w.value ? (i(), m("th", ol)) : y("", !0),
|
|
952
|
+
he.value ? (i(), m("th", al)) : y("", !0),
|
|
953
|
+
(i(!0), m(R, null, P(ue.value, (V) => (i(), m(R, null, [
|
|
954
|
+
se.value.indexOf(V.key) === -1 ? (i(), b(Jt, {
|
|
949
955
|
key: 0,
|
|
950
956
|
column: V,
|
|
951
957
|
"sort-by": v.value,
|
|
952
958
|
"sort-direction": n.value,
|
|
953
959
|
"amount-of-columns": e.columns.length,
|
|
954
960
|
items: s.value,
|
|
955
|
-
onClick: (
|
|
961
|
+
onClick: (D) => Ce(V)
|
|
956
962
|
}, null, 8, ["column", "sort-by", "sort-direction", "amount-of-columns", "items", "onClick"])) : y("", !0)
|
|
957
963
|
], 64))), 256)),
|
|
958
|
-
e.canDrop && me.value &&
|
|
959
|
-
ce.value &&
|
|
964
|
+
e.canDrop && me.value && w.value ? (i(), m("th", nl)) : y("", !0),
|
|
965
|
+
e.canEditButton && ce.value && w.value ? (i(), m("th", ul)) : y("", !0)
|
|
960
966
|
])
|
|
961
967
|
]),
|
|
962
|
-
|
|
968
|
+
T("tbody", {
|
|
963
969
|
ref: (V) => G.value = V,
|
|
964
970
|
id: "lkt-table-body-" + I(ne)
|
|
965
971
|
}, [
|
|
966
|
-
(i(!0), m(R, null,
|
|
967
|
-
modelValue: s.value[
|
|
968
|
-
"onUpdate:modelValue": (
|
|
969
|
-
key:
|
|
970
|
-
i:
|
|
972
|
+
(i(!0), m(R, null, P(s.value, (V, D) => (i(), b(Ut, {
|
|
973
|
+
modelValue: s.value[D],
|
|
974
|
+
"onUpdate:modelValue": (K) => s.value[D] = K,
|
|
975
|
+
key: Ie(V, D),
|
|
976
|
+
i: D,
|
|
971
977
|
"display-hidden-columns-indicator": he.value,
|
|
972
978
|
"is-draggable": De(V),
|
|
973
979
|
sortable: e.sortable,
|
|
974
980
|
"visible-columns": ue.value,
|
|
975
981
|
"empty-columns": se.value,
|
|
976
982
|
"add-navigation": e.addNavigation,
|
|
977
|
-
"hidden-is-visible":
|
|
978
|
-
"latest-row":
|
|
979
|
-
"can-drop": e.canDrop && me.value &&
|
|
983
|
+
"hidden-is-visible": ge(D),
|
|
984
|
+
"latest-row": D + 1 === ze.value,
|
|
985
|
+
"can-drop": e.canDrop && me.value && w.value,
|
|
980
986
|
"drop-confirm": e.dropConfirm,
|
|
981
987
|
"drop-resource": e.dropResource,
|
|
982
988
|
"drop-text": e.dropText,
|
|
983
989
|
"drop-icon": e.dropIcon,
|
|
984
|
-
"can-edit": ce.value &&
|
|
990
|
+
"can-edit": e.canEditButton && ce.value && w.value,
|
|
985
991
|
"edit-text": e.editText,
|
|
986
992
|
"edit-icon": e.editIcon,
|
|
987
993
|
"edit-link": e.editLink,
|
|
988
|
-
"edit-mode-enabled":
|
|
989
|
-
onClick:
|
|
990
|
-
onShow:
|
|
991
|
-
onItemUp:
|
|
992
|
-
onItemDown:
|
|
994
|
+
"edit-mode-enabled": w.value,
|
|
995
|
+
onClick: Se,
|
|
996
|
+
onShow: Ve,
|
|
997
|
+
onItemUp: ut,
|
|
998
|
+
onItemDown: it,
|
|
993
999
|
onItemDrop: we
|
|
994
|
-
},
|
|
995
|
-
|
|
996
|
-
name:
|
|
1000
|
+
}, Me({ _: 2 }, [
|
|
1001
|
+
P(ke.value, (K) => ({
|
|
1002
|
+
name: K,
|
|
997
1003
|
fn: A((z) => [
|
|
998
|
-
U(e.$slots,
|
|
1004
|
+
U(e.$slots, K, {
|
|
999
1005
|
item: z.item,
|
|
1000
1006
|
value: z.value,
|
|
1001
1007
|
column: z.column
|
|
@@ -1003,25 +1009,25 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
1003
1009
|
])
|
|
1004
1010
|
}))
|
|
1005
1011
|
]), 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"]))), 128)),
|
|
1006
|
-
re.value.length > 0 ? (i(!0), m(R, { key: 0 },
|
|
1007
|
-
modelValue: s.value[
|
|
1008
|
-
"onUpdate:modelValue": (
|
|
1009
|
-
key:
|
|
1010
|
-
i:
|
|
1012
|
+
re.value.length > 0 ? (i(!0), m(R, { key: 0 }, P(s.value, (V, D) => (i(), b(jt, {
|
|
1013
|
+
modelValue: s.value[D],
|
|
1014
|
+
"onUpdate:modelValue": (K) => s.value[D] = K,
|
|
1015
|
+
key: Ie(V, D, !0),
|
|
1016
|
+
i: D,
|
|
1011
1017
|
"hidden-columns": re.value,
|
|
1012
|
-
"hidden-columns-col-span":
|
|
1018
|
+
"hidden-columns-col-span": _e.value,
|
|
1013
1019
|
"is-draggable": De(V),
|
|
1014
1020
|
sortable: e.sortable,
|
|
1015
1021
|
"visible-columns": ue.value,
|
|
1016
1022
|
"empty-columns": se.value,
|
|
1017
|
-
"hidden-is-visible":
|
|
1018
|
-
onClick:
|
|
1019
|
-
onShow:
|
|
1020
|
-
},
|
|
1021
|
-
|
|
1022
|
-
name:
|
|
1023
|
+
"hidden-is-visible": ge(D),
|
|
1024
|
+
onClick: Se,
|
|
1025
|
+
onShow: Ve
|
|
1026
|
+
}, Me({ _: 2 }, [
|
|
1027
|
+
P(ke.value, (K) => ({
|
|
1028
|
+
name: K,
|
|
1023
1029
|
fn: A((z) => [
|
|
1024
|
-
U(e.$slots,
|
|
1030
|
+
U(e.$slots, K, {
|
|
1025
1031
|
item: z.item,
|
|
1026
1032
|
value: z.value,
|
|
1027
1033
|
column: z.column
|
|
@@ -1029,63 +1035,63 @@ const wl = (l, t, d = !0) => H(new K(l, t).setIsSortable(d)), El = (l, t, d, a =
|
|
|
1029
1035
|
])
|
|
1030
1036
|
}))
|
|
1031
1037
|
]), 1032, ["modelValue", "onUpdate:modelValue", "i", "hidden-columns", "hidden-columns-col-span", "is-draggable", "sortable", "visible-columns", "empty-columns", "hidden-is-visible"]))), 128)) : y("", !0)
|
|
1032
|
-
], 8,
|
|
1038
|
+
], 8, il)
|
|
1033
1039
|
]))
|
|
1034
|
-
], 8,
|
|
1040
|
+
], 8, el), [
|
|
1035
1041
|
[le, !r.value && s.value.length > 0]
|
|
1036
1042
|
]),
|
|
1037
|
-
e.$slots["no-items"] ? (i(), m("div",
|
|
1043
|
+
e.$slots["no-items"] ? (i(), m("div", rl, [
|
|
1038
1044
|
U(e.$slots, "no-items")
|
|
1039
1045
|
])) : y("", !0),
|
|
1040
|
-
!r.value && s.value.length === 0 ? (i(), m("div",
|
|
1041
|
-
|
|
1042
|
-
|
|
1046
|
+
!r.value && s.value.length === 0 ? (i(), m("div", dl, j(e.noResultsText), 1)) : y("", !0),
|
|
1047
|
+
ie.value ? (i(), m("div", cl, [
|
|
1048
|
+
ie.value && s.value.length >= e.requiredItemsForBottomCreate ? (i(), b($e, {
|
|
1043
1049
|
key: 0,
|
|
1044
|
-
disabled: !
|
|
1050
|
+
disabled: !Le.value,
|
|
1045
1051
|
text: e.createText,
|
|
1046
1052
|
icon: e.createIcon,
|
|
1047
1053
|
to: e.createRoute,
|
|
1048
|
-
onClick:
|
|
1054
|
+
onClick: Ee
|
|
1049
1055
|
}, null, 8, ["disabled", "text", "icon", "to"])) : y("", !0)
|
|
1050
1056
|
])) : y("", !0),
|
|
1051
1057
|
Q(N, {
|
|
1052
1058
|
ref_key: "paginator",
|
|
1053
|
-
ref:
|
|
1059
|
+
ref: E,
|
|
1054
1060
|
modelValue: Y.value,
|
|
1055
1061
|
"onUpdate:modelValue": c[1] || (c[1] = (V) => Y.value = V),
|
|
1056
1062
|
resource: e.resource,
|
|
1057
1063
|
filters: e.filters,
|
|
1058
|
-
onResults:
|
|
1064
|
+
onResults: Ne,
|
|
1059
1065
|
onLoading: Ke,
|
|
1060
|
-
onPerms:
|
|
1061
|
-
onCustom:
|
|
1066
|
+
onPerms: Ue,
|
|
1067
|
+
onCustom: We,
|
|
1062
1068
|
onResponse: He
|
|
1063
1069
|
}, null, 8, ["modelValue", "resource", "filters"])
|
|
1064
1070
|
]),
|
|
1065
1071
|
_: 3
|
|
1066
1072
|
}, 8, ["class"]))
|
|
1067
|
-
], 8,
|
|
1073
|
+
], 8, Gt);
|
|
1068
1074
|
};
|
|
1069
1075
|
}
|
|
1070
|
-
}),
|
|
1076
|
+
}), Ul = {
|
|
1071
1077
|
install: (l) => {
|
|
1072
|
-
l.component("lkt-loader") === void 0 && l.use(
|
|
1078
|
+
l.component("lkt-loader") === void 0 && l.use(vt), l.component("lkt-button") === void 0 && l.use(ht), l.component("lkt-paginator") === void 0 && l.use(kt), l.component("lkt-field-text") === void 0 && l.use(yt), l.component("lkt-field-textarea") === void 0 && l.use(bt), l.component("lkt-field-select") === void 0 && l.use(gt), l.component("lkt-field-switch") === void 0 && l.use(Ct), l.component("lkt-field-file") === void 0 && l.use(St), l.component("lkt-table") === void 0 && l.component("lkt-table", ml);
|
|
1073
1079
|
}
|
|
1074
|
-
},
|
|
1080
|
+
}, Wl = (l) => (O.navButtonSlot = l, !0), Hl = (l) => (O.dropButtonSlot = l, !0), Kl = (l) => (O.createButtonSlot = l, !0);
|
|
1075
1081
|
export {
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1082
|
+
H as LktTableColumn,
|
|
1083
|
+
Ll as createActionColumn,
|
|
1084
|
+
Al as createCheckColumn,
|
|
1079
1085
|
wl as createColumn,
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1086
|
+
Rl as createEmailColumn,
|
|
1087
|
+
Nl as createHiddenColumn,
|
|
1088
|
+
Il as createLinkColumn,
|
|
1089
|
+
Ol as createSelectColumn,
|
|
1090
|
+
Fl as createSwitchColumn,
|
|
1091
|
+
$l as createTelColumn,
|
|
1092
|
+
Ml as createTextColumn,
|
|
1093
|
+
Ul as default,
|
|
1088
1094
|
Kl as setTableCreateButtonSlot,
|
|
1089
1095
|
Hl as setTableDropButtonSlot,
|
|
1090
|
-
|
|
1096
|
+
Wl as setTableNavButtonSlot
|
|
1091
1097
|
};
|