lkt-table 1.2.8 → 1.2.9
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 +3 -3
- package/dist/build.js +68 -63
- package/package.json +1 -1
- package/src/components/CreateButton.vue +3 -0
- package/src/lib-components/LktTable.vue +4 -0
package/dist/build.d.ts
CHANGED
|
@@ -780,10 +780,10 @@ declare function wl(l: any, t: any, r?: boolean): {
|
|
|
780
780
|
useForRowKey: (t?: boolean) => K;
|
|
781
781
|
isForRowKey: boolean | undefined;
|
|
782
782
|
};
|
|
783
|
-
declare namespace
|
|
783
|
+
declare namespace Rl {
|
|
784
784
|
function install(l: any): void;
|
|
785
785
|
}
|
|
786
786
|
declare function Ol(l: any): boolean;
|
|
787
|
-
declare function Rl(l: any): boolean;
|
|
788
787
|
declare function Al(l: any): boolean;
|
|
789
|
-
|
|
788
|
+
declare function $l(l: any): boolean;
|
|
789
|
+
export { K as LktTableColumn, Dl as createActionColumn, El as createCheckColumn, Sl as createColumn, Tl as createEmailColumn, Ml as createHiddenColumn, Vl as createLinkColumn, Ll as createSelectColumn, Il as createSwitchColumn, Bl as createTelColumn, wl as createTextColumn, Rl as default, Ol as setTableCreateButtonSlot, Al as setTableDropButtonSlot, $l as setTableNavButtonSlot };
|
package/dist/build.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reactive as H, defineComponent as q, ref as C, watch as U, nextTick as de, computed as f, resolveComponent as
|
|
1
|
+
import { reactive as H, defineComponent as q, ref as C, watch as U, nextTick as de, computed as f, resolveComponent as R, openBlock as u, createBlock as b, withCtx as N, createTextVNode as le, toDisplayString as j, unref as I, createElementBlock as m, Fragment as $, withModifiers as at, resolveDynamicComponent as Z, createCommentVNode as y, normalizeClass as te, createElementVNode as E, createVNode as X, renderList as W, renderSlot as F, withDirectives as x, vShow as ee, useSlots as nt, onMounted as ut, createSlots as Ee } from "vue";
|
|
2
2
|
import { httpCall as st } from "lkt-http-client";
|
|
3
3
|
import { __ as z } from "lkt-i18n";
|
|
4
4
|
import { createLktEvent as ce } from "lkt-events";
|
|
@@ -222,8 +222,8 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
222
222
|
}, { deep: !0 }), n.column.hasToLoadResource() && n.column.loadResource();
|
|
223
223
|
const v = f(() => ({ ...n.column.slotData, item: s.value }));
|
|
224
224
|
return (a, i) => {
|
|
225
|
-
const
|
|
226
|
-
return a.column.type === "link" ? (u(), b(
|
|
225
|
+
const _ = R("lkt-anchor"), J = R("lkt-field-text"), d = R("lkt-field-switch"), L = R("lkt-field-file"), S = R("lkt-loader"), V = R("lkt-field-select");
|
|
226
|
+
return a.column.type === "link" ? (u(), b(_, {
|
|
227
227
|
key: 0,
|
|
228
228
|
to: a.column.getHref(s.value)
|
|
229
229
|
}, {
|
|
@@ -283,7 +283,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
283
283
|
ref: (p) => h.value = p,
|
|
284
284
|
modelValue: o.value,
|
|
285
285
|
"onUpdate:modelValue": i[6] || (i[6] = (p) => o.value = p)
|
|
286
|
-
}, null, 8, ["read-mode", "modelValue"])) : a.column.type === "select" ? (u(), m(
|
|
286
|
+
}, null, 8, ["read-mode", "modelValue"])) : a.column.type === "select" ? (u(), m($, { key: 8 }, [
|
|
287
287
|
g.value ? (u(), b(S, { key: 0 })) : (u(), b(V, {
|
|
288
288
|
key: 1,
|
|
289
289
|
"read-mode": !a.column.editable || !a.editModeEnabled,
|
|
@@ -300,12 +300,12 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
300
300
|
"multiple-display": a.column.multipleDisplay,
|
|
301
301
|
"multiple-display-edition": a.column.multipleDisplayEdition
|
|
302
302
|
}, null, 8, ["read-mode", "modelValue", "slot-data", "resource", "use-resource-slot", "resource-data", "options", "multiple", "tags", "multiple-display", "multiple-display-edition"]))
|
|
303
|
-
], 64)) : (u(), m(
|
|
303
|
+
], 64)) : (u(), m($, { key: 9 }, [
|
|
304
304
|
le(j(I(Y)(a.column, s.value, a.i, a.columns)), 1)
|
|
305
305
|
], 64));
|
|
306
306
|
};
|
|
307
307
|
}
|
|
308
|
-
}),
|
|
308
|
+
}), A = {
|
|
309
309
|
navButtonSlot: "",
|
|
310
310
|
dropButtonSlot: "",
|
|
311
311
|
createButtonSlot: ""
|
|
@@ -321,9 +321,9 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
321
321
|
},
|
|
322
322
|
emits: ["click"],
|
|
323
323
|
setup(l, { emit: t }) {
|
|
324
|
-
const r = t, n = l, s = f(() =>
|
|
324
|
+
const r = t, n = l, s = f(() => A.dropButtonSlot !== ""), o = f(() => A.dropButtonSlot), h = f(() => n.text.startsWith("__:") ? z(n.text.substring(3)) : n.text);
|
|
325
325
|
return (g, v) => {
|
|
326
|
-
const a =
|
|
326
|
+
const a = R("lkt-button");
|
|
327
327
|
return u(), b(a, {
|
|
328
328
|
palette: "table-delete",
|
|
329
329
|
icon: s.value ? "" : g.icon,
|
|
@@ -347,10 +347,10 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
347
347
|
}, Bt = {
|
|
348
348
|
key: 2,
|
|
349
349
|
class: "lkt-table-nav-cell"
|
|
350
|
-
}, Et = { class: "lkt-table-nav-container" }, It = /* @__PURE__ */ E("i", { class: "" }, null, -1), Lt = /* @__PURE__ */ E("i", { class: "" }, null, -1), Mt = ["data-column", "colspan", "title", "onClick"],
|
|
350
|
+
}, Et = { class: "lkt-table-nav-container" }, It = /* @__PURE__ */ E("i", { class: "" }, null, -1), Lt = /* @__PURE__ */ E("i", { class: "" }, null, -1), Mt = ["data-column", "colspan", "title", "onClick"], Rt = {
|
|
351
351
|
key: 4,
|
|
352
352
|
class: "lkt-table-col-drop"
|
|
353
|
-
},
|
|
353
|
+
}, $t = /* @__PURE__ */ q({
|
|
354
354
|
__name: "LktTableRow",
|
|
355
355
|
props: {
|
|
356
356
|
modelValue: { default: () => ({}) },
|
|
@@ -379,11 +379,11 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
379
379
|
}, g = f(() => {
|
|
380
380
|
let d = [];
|
|
381
381
|
return n.sortable && n.isDraggable && d.push("handle"), d.join(" ");
|
|
382
|
-
}), v = f(() =>
|
|
383
|
-
f(() =>
|
|
382
|
+
}), v = f(() => A.navButtonSlot !== ""), a = f(() => A.navButtonSlot);
|
|
383
|
+
f(() => A.dropButtonSlot !== ""), f(() => A.dropButtonSlot);
|
|
384
384
|
const i = () => {
|
|
385
385
|
r("item-up", n.i);
|
|
386
|
-
},
|
|
386
|
+
}, _ = () => {
|
|
387
387
|
r("item-down", n.i);
|
|
388
388
|
}, J = () => {
|
|
389
389
|
r("item-drop", n.i);
|
|
@@ -391,7 +391,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
391
391
|
return U(() => n.modelValue, (d) => s.value = d), U(s, (d) => {
|
|
392
392
|
r("update:modelValue", d, n.i);
|
|
393
393
|
}, { deep: !0 }), (d, L) => {
|
|
394
|
-
const S =
|
|
394
|
+
const S = R("lkt-button");
|
|
395
395
|
return u(), m("tr", {
|
|
396
396
|
"data-i": d.i,
|
|
397
397
|
"data-draggable": d.isDraggable
|
|
@@ -412,7 +412,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
412
412
|
v.value ? (u(), b(Z(a.value), {
|
|
413
413
|
key: 0,
|
|
414
414
|
direction: "up"
|
|
415
|
-
})) : (u(), m(
|
|
415
|
+
})) : (u(), m($, { key: 1 }, [
|
|
416
416
|
It,
|
|
417
417
|
le(" UP ")
|
|
418
418
|
], 64))
|
|
@@ -422,13 +422,13 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
422
422
|
X(S, {
|
|
423
423
|
palette: "table-nav",
|
|
424
424
|
disabled: d.latestRow,
|
|
425
|
-
onClick:
|
|
425
|
+
onClick: _
|
|
426
426
|
}, {
|
|
427
427
|
default: N(() => [
|
|
428
428
|
v.value ? (u(), b(Z(a.value), {
|
|
429
429
|
key: 0,
|
|
430
430
|
direction: "down"
|
|
431
|
-
})) : (u(), m(
|
|
431
|
+
})) : (u(), m($, { key: 1 }, [
|
|
432
432
|
Lt,
|
|
433
433
|
le(" DOWN ")
|
|
434
434
|
], 64))
|
|
@@ -443,7 +443,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
443
443
|
"data-role": "show-more",
|
|
444
444
|
class: te(d.hiddenIsVisible ? "state-open" : "")
|
|
445
445
|
}, null, 2)) : y("", !0),
|
|
446
|
-
(u(!0), m(
|
|
446
|
+
(u(!0), m($, null, W(d.visibleColumns, (V) => (u(), m($, null, [
|
|
447
447
|
I(Ct)(V, d.emptyColumns, s.value) ? (u(), m("td", {
|
|
448
448
|
key: 0,
|
|
449
449
|
"data-column": V.key,
|
|
@@ -468,7 +468,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
468
468
|
}, null, 8, ["modelValue", "column", "columns", "edit-mode-enabled", "i"])) : y("", !0)
|
|
469
469
|
], 8, Mt)) : y("", !0)
|
|
470
470
|
], 64))), 256)),
|
|
471
|
-
d.canDrop && d.editModeEnabled ? (u(), m("td",
|
|
471
|
+
d.canDrop && d.editModeEnabled ? (u(), m("td", Rt, [
|
|
472
472
|
X(Dt, {
|
|
473
473
|
resource: d.dropResource,
|
|
474
474
|
"resource-data": s.value,
|
|
@@ -481,7 +481,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
481
481
|
], 8, wt);
|
|
482
482
|
};
|
|
483
483
|
}
|
|
484
|
-
}),
|
|
484
|
+
}), At = { "data-role": "hidden-row" }, Ot = ["colspan"], Ft = ["data-column"], Nt = ["data-i"], Ut = ["data-column", "title", "onClick"], Ht = /* @__PURE__ */ q({
|
|
485
485
|
__name: "LktHiddenRow",
|
|
486
486
|
props: {
|
|
487
487
|
modelValue: { default: () => ({}) },
|
|
@@ -499,18 +499,18 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
499
499
|
const r = t, n = l, s = C(n.modelValue), o = (h, g, v) => {
|
|
500
500
|
r("click", h, ce("", { item: g, column: v }));
|
|
501
501
|
};
|
|
502
|
-
return U(() => n.modelValue, (h) => s.value = h), U(s, () => r("update:modelValue", s.value)), (h, g) => x((u(), m("tr",
|
|
502
|
+
return U(() => n.modelValue, (h) => s.value = h), U(s, () => r("update:modelValue", s.value)), (h, g) => x((u(), m("tr", At, [
|
|
503
503
|
E("td", { colspan: h.hiddenColumnsColSpan }, [
|
|
504
504
|
E("table", null, [
|
|
505
505
|
E("tr", null, [
|
|
506
|
-
(u(!0), m(
|
|
506
|
+
(u(!0), m($, null, W(h.hiddenColumns, (v) => (u(), m("th", {
|
|
507
507
|
"data-column": v.key
|
|
508
508
|
}, [
|
|
509
509
|
E("div", null, j(v.label), 1)
|
|
510
510
|
], 8, Ft))), 256))
|
|
511
511
|
]),
|
|
512
512
|
E("tr", { "data-i": h.i }, [
|
|
513
|
-
(u(!0), m(
|
|
513
|
+
(u(!0), m($, null, W(h.hiddenColumns, (v, a) => (u(), m("td", {
|
|
514
514
|
"data-column": v.key,
|
|
515
515
|
title: I(Y)(v, s.value, a, h.hiddenColumns),
|
|
516
516
|
onClick: (i) => o(i, s.value, v)
|
|
@@ -542,28 +542,30 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
542
542
|
props: {
|
|
543
543
|
disabled: { type: Boolean, default: !1 },
|
|
544
544
|
text: { default: "" },
|
|
545
|
-
icon: { default: "" }
|
|
545
|
+
icon: { default: "" },
|
|
546
|
+
to: { default: "" }
|
|
546
547
|
},
|
|
547
548
|
emits: ["click"],
|
|
548
549
|
setup(l, { emit: t }) {
|
|
549
|
-
const r = t, n = l, s = f(() =>
|
|
550
|
+
const r = t, n = l, s = f(() => A.createButtonSlot !== ""), o = f(() => A.createButtonSlot), h = f(() => n.text.startsWith("__:") ? z(n.text.substring(3)) : n.text);
|
|
550
551
|
return (g, v) => {
|
|
551
|
-
const a =
|
|
552
|
+
const a = R("lkt-button");
|
|
552
553
|
return u(), b(a, {
|
|
553
554
|
palette: "table-create",
|
|
554
555
|
disabled: g.disabled,
|
|
555
556
|
icon: s.value ? "" : g.icon,
|
|
556
557
|
text: s.value ? "" : h.value,
|
|
558
|
+
"on-click-to": g.to,
|
|
557
559
|
onClick: v[0] || (v[0] = (i) => r("click"))
|
|
558
560
|
}, {
|
|
559
561
|
default: N(() => [
|
|
560
562
|
s.value ? (u(), b(Z(o.value), { key: 0 })) : y("", !0)
|
|
561
563
|
]),
|
|
562
564
|
_: 1
|
|
563
|
-
}, 8, ["disabled", "icon", "text"]);
|
|
565
|
+
}, 8, ["disabled", "icon", "text", "on-click-to"]);
|
|
564
566
|
};
|
|
565
567
|
}
|
|
566
|
-
}), Kt = ["data-column", "data-sortable", "data-sort", "colspan", "title"],
|
|
568
|
+
}), Kt = ["data-column", "data-sortable", "data-sort", "colspan", "title"], Pt = /* @__PURE__ */ q({
|
|
567
569
|
__name: "TableHeader",
|
|
568
570
|
props: {
|
|
569
571
|
column: { default: () => ({}) },
|
|
@@ -588,7 +590,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
588
590
|
E("div", null, j(g.value), 1)
|
|
589
591
|
], 8, Kt));
|
|
590
592
|
}
|
|
591
|
-
}),
|
|
593
|
+
}), Wt = ["id"], _t = { key: 0 }, jt = { class: "lkt-table-page-buttons" }, Jt = { key: 1 }, Gt = { class: "switch-edition-mode" }, zt = {
|
|
592
594
|
key: 0,
|
|
593
595
|
class: "lkt-table-page-buttons"
|
|
594
596
|
}, qt = {
|
|
@@ -643,6 +645,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
643
645
|
saveText: { default: "Save" },
|
|
644
646
|
createText: { default: "Add item" },
|
|
645
647
|
createIcon: { default: "" },
|
|
648
|
+
createRoute: { default: "" },
|
|
646
649
|
dropText: { default: "Delete" },
|
|
647
650
|
dropIcon: { default: "" },
|
|
648
651
|
editModeText: { default: "Edit mode" },
|
|
@@ -658,9 +661,9 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
658
661
|
},
|
|
659
662
|
emits: ["update:modelValue", "sort", "click", "save", "error", "before-save"],
|
|
660
663
|
setup(l, { expose: t, emit: r }) {
|
|
661
|
-
const n = r, s = nt(), o = l, h = {}, g = C(typeof o.sorter == "function" ? o.sorter : Ie), v = C(St(o.columns)), a = C("asc"), i = C(o.modelValue),
|
|
664
|
+
const n = r, s = nt(), o = l, h = {}, g = C(typeof o.sorter == "function" ? o.sorter : Ie), v = C(St(o.columns)), a = C("asc"), i = C(o.modelValue), _ = C(h), J = C(null), d = C(o.columns), L = C(o.page), S = C(!1), V = C(!1), p = C(o.perms), fe = C(null), Re = C({}), Q = C(new dt({ items: i.value }, o.dataStateConfig)), M = C(o.editMode), $e = (e) => {
|
|
662
665
|
Array.isArray(e) && (i.value = e), S.value = !1, V.value = !0, Q.value.store({ items: i.value }).turnStoredIntoOriginal();
|
|
663
|
-
},
|
|
666
|
+
}, Ae = (e) => {
|
|
664
667
|
p.value = e;
|
|
665
668
|
}, Oe = () => de(() => S.value = !0), Fe = () => {
|
|
666
669
|
fe.value.doRefresh();
|
|
@@ -682,7 +685,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
682
685
|
let e = [];
|
|
683
686
|
for (let c in s) He.value.indexOf(c) !== -1 && e.push(c);
|
|
684
687
|
return e;
|
|
685
|
-
}), he = f(() => o.hiddenSave || S.value || !o.saveResource ? !1 : M.value && Q.value.changed() ? !0 : M.value), Ke = f(() => o.switchEditionEnabled ? !0 : he.value || M.value && o.canCreate),
|
|
688
|
+
}), he = f(() => o.hiddenSave || S.value || !o.saveResource ? !1 : M.value && Q.value.changed() ? !0 : M.value), Ke = f(() => o.switchEditionEnabled ? !0 : he.value || M.value && o.canCreate), Pe = f(() => o.saveDisabled || typeof o.saveValidator == "function" && !o.saveValidator(i.value) ? !1 : Q.value.changed()), We = f(() => i.value.length), _e = f(() => ({
|
|
686
689
|
items: i.value,
|
|
687
690
|
...o.saveResourceData
|
|
688
691
|
})), je = f(() => o.titleTag === "" ? "h2" : o.titleTag), Je = f(() => o.wrapContentTag === "" ? "div" : o.wrapContentTag), ie = f(() => o.title.startsWith("__:") ? z(o.title.substring(3)) : o.title), Ge = f(() => o.saveText.startsWith("__:") ? z(o.saveText.substring(3)) : o.saveText), ze = f(() => o.editModeText.startsWith("__:") ? z(o.editModeText.substring(3)) : o.editModeText), ne = f(() => p.value.includes("create")), qe = f(() => p.value.includes("read")), Qe = f(() => p.value.includes("update")), re = f(() => p.value.includes("drop")), Xe = (e) => {
|
|
@@ -693,13 +696,13 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
693
696
|
while (typeof c.dataset.column > "u" && c.tagName !== "TABLE" && c.tagName !== "body");
|
|
694
697
|
if (c.tagName === "TD" && (c = c.parentNode, c = c.dataset.i, typeof c < "u"))
|
|
695
698
|
return i.value[c];
|
|
696
|
-
}, ye = (e) =>
|
|
699
|
+
}, ye = (e) => _.value["tr_" + e] === !0, ke = (e) => {
|
|
697
700
|
e && e.sortable && (i.value = i.value.sort((c, k) => g.value(c, k, e, a.value)), a.value = a.value === "asc" ? "desc" : "asc", v.value = e.key, n("sort", [v.value, a.value]));
|
|
698
701
|
}, be = (e, c) => {
|
|
699
702
|
n("click", e, c);
|
|
700
703
|
}, ge = (e, c) => {
|
|
701
704
|
let k = "tr_" + c.value.i;
|
|
702
|
-
|
|
705
|
+
_.value[k] = typeof _.value[k] > "u" ? !0 : !_.value[k];
|
|
703
706
|
}, Ce = () => {
|
|
704
707
|
d.value.forEach((e) => {
|
|
705
708
|
if (e.type === "select" && e.autoLoadSelectOptions) {
|
|
@@ -746,7 +749,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
746
749
|
i.value.splice(e, 1);
|
|
747
750
|
}, ot = () => {
|
|
748
751
|
let e = document.getElementById("lkt-table-body-" + oe);
|
|
749
|
-
|
|
752
|
+
Re.value = new ct(e, {
|
|
750
753
|
direction: "vertical",
|
|
751
754
|
handle: ".handle",
|
|
752
755
|
animation: 150,
|
|
@@ -775,12 +778,12 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
775
778
|
getItemByEvent: Xe,
|
|
776
779
|
doRefresh: Fe
|
|
777
780
|
}), (e, c) => {
|
|
778
|
-
const k =
|
|
781
|
+
const k = R("lkt-button"), T = R("lkt-field-switch"), D = R("lkt-loader"), O = R("lkt-paginator");
|
|
779
782
|
return u(), m("section", {
|
|
780
783
|
class: "lkt-table-page",
|
|
781
784
|
id: "lkt-table-page-" + I(oe)
|
|
782
785
|
}, [
|
|
783
|
-
ie.value || I(s).title ? (u(), m("header",
|
|
786
|
+
ie.value || I(s).title ? (u(), m("header", _t, [
|
|
784
787
|
ie.value ? (u(), b(Z(je.value), { key: 0 }, {
|
|
785
788
|
default: N(() => [
|
|
786
789
|
e.titleIcon ? (u(), m("i", {
|
|
@@ -801,11 +804,11 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
801
804
|
x(X(k, {
|
|
802
805
|
ref: "saveButton",
|
|
803
806
|
palette: "success",
|
|
804
|
-
disabled: !
|
|
807
|
+
disabled: !Pe.value,
|
|
805
808
|
"confirm-modal": e.saveConfirm,
|
|
806
809
|
"confirm-data": e.confirmData,
|
|
807
810
|
resource: e.saveResource,
|
|
808
|
-
"resource-data":
|
|
811
|
+
"resource-data": _e.value,
|
|
809
812
|
onLoading: Ze,
|
|
810
813
|
onLoaded: xe,
|
|
811
814
|
onClick: et
|
|
@@ -827,8 +830,9 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
827
830
|
disabled: !Be.value,
|
|
828
831
|
text: e.createText,
|
|
829
832
|
icon: e.createIcon,
|
|
833
|
+
to: e.createRoute,
|
|
830
834
|
onClick: Ve
|
|
831
|
-
}, null, 8, ["disabled", "text", "icon"])) : y("", !0),
|
|
835
|
+
}, null, 8, ["disabled", "text", "icon", "to"])) : y("", !0),
|
|
832
836
|
E("div", Gt, [
|
|
833
837
|
x(X(T, {
|
|
834
838
|
modelValue: M.value,
|
|
@@ -859,7 +863,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
859
863
|
key: 1,
|
|
860
864
|
class: te(["lkt-table-items-container", e.itemsContainerClass])
|
|
861
865
|
}, [
|
|
862
|
-
(u(!0), m(
|
|
866
|
+
(u(!0), m($, null, W(i.value, (w, B) => (u(), m("div", ll, [
|
|
863
867
|
F(e.$slots, "item", {
|
|
864
868
|
item: w,
|
|
865
869
|
index: B,
|
|
@@ -877,8 +881,8 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
877
881
|
e.sortable && M.value ? (u(), m("th", Yt)) : y("", !0),
|
|
878
882
|
e.addNavigation && M.value ? (u(), m("th", Zt)) : y("", !0),
|
|
879
883
|
pe.value ? (u(), m("th", xt)) : y("", !0),
|
|
880
|
-
(u(!0), m(
|
|
881
|
-
ue.value.indexOf(w.key) === -1 ? (u(), b(
|
|
884
|
+
(u(!0), m($, null, W(ae.value, (w) => (u(), m($, null, [
|
|
885
|
+
ue.value.indexOf(w.key) === -1 ? (u(), b(Pt, {
|
|
882
886
|
key: 0,
|
|
883
887
|
column: w,
|
|
884
888
|
"sort-by": v.value,
|
|
@@ -895,9 +899,9 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
895
899
|
ref: (w) => J.value = w,
|
|
896
900
|
id: "lkt-table-body-" + I(oe)
|
|
897
901
|
}, [
|
|
898
|
-
(u(!0), m(
|
|
902
|
+
(u(!0), m($, null, W(i.value, (w, B) => (u(), b($t, {
|
|
899
903
|
modelValue: i.value[B],
|
|
900
|
-
"onUpdate:modelValue": (
|
|
904
|
+
"onUpdate:modelValue": (P) => i.value[B] = P,
|
|
901
905
|
key: Te(w, B),
|
|
902
906
|
i: B,
|
|
903
907
|
"display-hidden-columns-indicator": pe.value,
|
|
@@ -907,7 +911,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
907
911
|
"empty-columns": ue.value,
|
|
908
912
|
"add-navigation": e.addNavigation,
|
|
909
913
|
"hidden-is-visible": ye(B),
|
|
910
|
-
"latest-row": B + 1 ===
|
|
914
|
+
"latest-row": B + 1 === We.value,
|
|
911
915
|
"can-drop": e.canDrop && re.value && M.value,
|
|
912
916
|
"drop-confirm": e.dropConfirm,
|
|
913
917
|
"drop-resource": e.dropResource,
|
|
@@ -920,10 +924,10 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
920
924
|
onItemDown: lt,
|
|
921
925
|
onItemDrop: we
|
|
922
926
|
}, Ee({ _: 2 }, [
|
|
923
|
-
|
|
924
|
-
name:
|
|
927
|
+
W(ve.value, (P) => ({
|
|
928
|
+
name: P,
|
|
925
929
|
fn: N((G) => [
|
|
926
|
-
F(e.$slots,
|
|
930
|
+
F(e.$slots, P, {
|
|
927
931
|
item: G.item,
|
|
928
932
|
value: G.value,
|
|
929
933
|
column: G.column
|
|
@@ -931,9 +935,9 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
931
935
|
])
|
|
932
936
|
}))
|
|
933
937
|
]), 1032, ["modelValue", "onUpdate:modelValue", "i", "display-hidden-columns-indicator", "is-draggable", "sortable", "visible-columns", "empty-columns", "add-navigation", "hidden-is-visible", "latest-row", "can-drop", "drop-confirm", "drop-resource", "drop-text", "drop-icon", "edit-mode-enabled"]))), 128)),
|
|
934
|
-
se.value.length > 0 ? (u(!0), m(
|
|
938
|
+
se.value.length > 0 ? (u(!0), m($, { key: 0 }, W(i.value, (w, B) => (u(), b(Ht, {
|
|
935
939
|
modelValue: i.value[B],
|
|
936
|
-
"onUpdate:modelValue": (
|
|
940
|
+
"onUpdate:modelValue": (P) => i.value[B] = P,
|
|
937
941
|
key: Te(w, B, !0),
|
|
938
942
|
i: B,
|
|
939
943
|
"hidden-columns": se.value,
|
|
@@ -946,10 +950,10 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
946
950
|
onClick: be,
|
|
947
951
|
onShow: ge
|
|
948
952
|
}, Ee({ _: 2 }, [
|
|
949
|
-
|
|
950
|
-
name:
|
|
953
|
+
W(ve.value, (P) => ({
|
|
954
|
+
name: P,
|
|
951
955
|
fn: N((G) => [
|
|
952
|
-
F(e.$slots,
|
|
956
|
+
F(e.$slots, P, {
|
|
953
957
|
item: G.item,
|
|
954
958
|
value: G.value,
|
|
955
959
|
column: G.column
|
|
@@ -972,8 +976,9 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
972
976
|
disabled: !Be.value,
|
|
973
977
|
text: e.createText,
|
|
974
978
|
icon: e.createIcon,
|
|
979
|
+
to: e.createRoute,
|
|
975
980
|
onClick: Ve
|
|
976
|
-
}, null, 8, ["disabled", "text", "icon"])) : y("", !0)
|
|
981
|
+
}, null, 8, ["disabled", "text", "icon", "to"])) : y("", !0)
|
|
977
982
|
])) : y("", !0),
|
|
978
983
|
X(O, {
|
|
979
984
|
ref_key: "paginator",
|
|
@@ -982,21 +987,21 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
982
987
|
"onUpdate:modelValue": c[1] || (c[1] = (w) => L.value = w),
|
|
983
988
|
resource: e.resource,
|
|
984
989
|
filters: e.filters,
|
|
985
|
-
onResults:
|
|
990
|
+
onResults: $e,
|
|
986
991
|
onLoading: Oe,
|
|
987
|
-
onPerms:
|
|
992
|
+
onPerms: Ae
|
|
988
993
|
}, null, 8, ["modelValue", "resource", "filters"])
|
|
989
994
|
]),
|
|
990
995
|
_: 3
|
|
991
996
|
}, 8, ["class"]))
|
|
992
|
-
], 8,
|
|
997
|
+
], 8, Wt);
|
|
993
998
|
};
|
|
994
999
|
}
|
|
995
|
-
}),
|
|
1000
|
+
}), Rl = {
|
|
996
1001
|
install: (l) => {
|
|
997
1002
|
l.component("lkt-loader") === void 0 && l.use(mt), l.component("lkt-button") === void 0 && l.use(ft), l.component("lkt-paginator") === void 0 && l.use(pt), l.component("lkt-field-text") === void 0 && l.use(vt), l.component("lkt-field-textarea") === void 0 && l.use(ht), l.component("lkt-field-select") === void 0 && l.use(yt), l.component("lkt-field-switch") === void 0 && l.use(kt), l.component("lkt-field-file") === void 0 && l.use(bt), l.component("lkt-table") === void 0 && l.component("lkt-table", ul);
|
|
998
1003
|
}
|
|
999
|
-
},
|
|
1004
|
+
}, $l = (l) => (A.navButtonSlot = l, !0), Al = (l) => (A.dropButtonSlot = l, !0), Ol = (l) => (A.createButtonSlot = l, !0);
|
|
1000
1005
|
export {
|
|
1001
1006
|
K as LktTableColumn,
|
|
1002
1007
|
Dl as createActionColumn,
|
|
@@ -1009,8 +1014,8 @@ export {
|
|
|
1009
1014
|
Il as createSwitchColumn,
|
|
1010
1015
|
Bl as createTelColumn,
|
|
1011
1016
|
wl as createTextColumn,
|
|
1012
|
-
|
|
1017
|
+
Rl as default,
|
|
1013
1018
|
Ol as setTableCreateButtonSlot,
|
|
1014
|
-
|
|
1015
|
-
|
|
1019
|
+
Al as setTableDropButtonSlot,
|
|
1020
|
+
$l as setTableNavButtonSlot
|
|
1016
1021
|
};
|
package/package.json
CHANGED
|
@@ -9,10 +9,12 @@ const props = withDefaults(defineProps<{
|
|
|
9
9
|
disabled: boolean
|
|
10
10
|
text: string
|
|
11
11
|
icon: string
|
|
12
|
+
to: string
|
|
12
13
|
}>(), {
|
|
13
14
|
disabled: false,
|
|
14
15
|
text: '',
|
|
15
16
|
icon: '',
|
|
17
|
+
to: '',
|
|
16
18
|
});
|
|
17
19
|
|
|
18
20
|
const hasCreateButtonSlot = computed(() => {
|
|
@@ -35,6 +37,7 @@ const hasCreateButtonSlot = computed(() => {
|
|
|
35
37
|
:disabled="disabled"
|
|
36
38
|
:icon="hasCreateButtonSlot ? '' : icon"
|
|
37
39
|
:text="hasCreateButtonSlot ? '' : computedText"
|
|
40
|
+
:on-click-to="to"
|
|
38
41
|
@click="emit('click')">
|
|
39
42
|
<template v-if="hasCreateButtonSlot">
|
|
40
43
|
<component
|
|
@@ -53,6 +53,7 @@ const props = withDefaults(defineProps<{
|
|
|
53
53
|
saveText?: string
|
|
54
54
|
createText?: string
|
|
55
55
|
createIcon?: string
|
|
56
|
+
createRoute?: string
|
|
56
57
|
dropText?: string
|
|
57
58
|
dropIcon?: string
|
|
58
59
|
editModeText?: string
|
|
@@ -101,6 +102,7 @@ const props = withDefaults(defineProps<{
|
|
|
101
102
|
dropIcon: '',
|
|
102
103
|
createText: 'Add item',
|
|
103
104
|
createIcon: '',
|
|
105
|
+
createRoute: '',
|
|
104
106
|
editModeText: 'Edit mode',
|
|
105
107
|
switchEditionEnabled: false,
|
|
106
108
|
canCreate: false,
|
|
@@ -488,6 +490,7 @@ defineExpose({
|
|
|
488
490
|
:disabled="!createEnabled"
|
|
489
491
|
:text="createText"
|
|
490
492
|
:icon="createIcon"
|
|
493
|
+
:to="createRoute"
|
|
491
494
|
@click="onClickAddItem"
|
|
492
495
|
/>
|
|
493
496
|
|
|
@@ -634,6 +637,7 @@ defineExpose({
|
|
|
634
637
|
:disabled="!createEnabled"
|
|
635
638
|
:text="createText"
|
|
636
639
|
:icon="createIcon"
|
|
640
|
+
:to="createRoute"
|
|
637
641
|
@click="onClickAddItem"
|
|
638
642
|
/>
|
|
639
643
|
</div>
|