lkt-table 1.2.7 → 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 +114 -108
- package/package.json +1 -1
- package/src/components/CreateButton.vue +3 -0
- package/src/lib-components/LktTable.vue +5 -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";
|
|
@@ -155,7 +155,7 @@ class K {
|
|
|
155
155
|
return this.isForRowKey = t, this;
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n = !0) => H(new K(l, t).setIsSortable(n).defineAsLink(r)), Dl = (l, t, r, n = !0) => H(new K(l, t).setIsSortable(n).defineAsAction(r)), wl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r).defineAsText()), Tl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r).defineAsEmail()), Bl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r).defineAsTel()), El = (l, t, r = !0) => H(new K(l, t).setIsSortable(r).defineAsCheck()), Il = (l, t, r = !0) => H(new K(l, t).setIsSortable(r).defineAsSwitch()), Ll = (l, t, r, n = !0) => H(new K(l, t).setIsSortable(n).defineAsSelect(r)), Ml = (l, t, r = !0) => H(new K(l, t).setIsSortable(r).setIsHidden(!0)),
|
|
158
|
+
const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n = !0) => H(new K(l, t).setIsSortable(n).defineAsLink(r)), Dl = (l, t, r, n = !0) => H(new K(l, t).setIsSortable(n).defineAsAction(r)), wl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r).defineAsText()), Tl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r).defineAsEmail()), Bl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r).defineAsTel()), El = (l, t, r = !0) => H(new K(l, t).setIsSortable(r).defineAsCheck()), Il = (l, t, r = !0) => H(new K(l, t).setIsSortable(r).defineAsSwitch()), Ll = (l, t, r, n = !0) => H(new K(l, t).setIsSortable(n).defineAsSelect(r)), Ml = (l, t, r = !0) => H(new K(l, t).setIsSortable(r).setIsHidden(!0)), Ie = (l, t, r, n) => {
|
|
159
159
|
if (!r) return 0;
|
|
160
160
|
let s = l[r.key], o = t[r.key];
|
|
161
161
|
if (n === "asc") {
|
|
@@ -200,7 +200,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
200
200
|
if (l[r].key === t) return l[r];
|
|
201
201
|
}
|
|
202
202
|
return null;
|
|
203
|
-
},
|
|
203
|
+
}, Me = /* @__PURE__ */ q({
|
|
204
204
|
__name: "LktTableCell",
|
|
205
205
|
props: {
|
|
206
206
|
modelValue: { default: () => ({}) },
|
|
@@ -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,
|
|
@@ -457,7 +457,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
457
457
|
item: s.value,
|
|
458
458
|
column: V,
|
|
459
459
|
i: d.i
|
|
460
|
-
}) : s.value ? (u(), b(
|
|
460
|
+
}) : s.value ? (u(), b(Me, {
|
|
461
461
|
key: 1,
|
|
462
462
|
modelValue: s.value,
|
|
463
463
|
"onUpdate:modelValue": L[1] || (L[1] = (p) => s.value = p),
|
|
@@ -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)
|
|
@@ -521,7 +521,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
521
521
|
item: s.value,
|
|
522
522
|
column: v,
|
|
523
523
|
i: a
|
|
524
|
-
}) : (u(), b(
|
|
524
|
+
}) : (u(), b(Me, {
|
|
525
525
|
key: 1,
|
|
526
526
|
column: v,
|
|
527
527
|
columns: h.hiddenColumns,
|
|
@@ -537,33 +537,35 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
537
537
|
[ee, h.hiddenIsVisible]
|
|
538
538
|
]);
|
|
539
539
|
}
|
|
540
|
-
}),
|
|
540
|
+
}), Le = /* @__PURE__ */ q({
|
|
541
541
|
__name: "CreateButton",
|
|
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 = {
|
|
@@ -614,7 +616,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
614
616
|
props: {
|
|
615
617
|
modelValue: { default: () => [] },
|
|
616
618
|
columns: { default: () => [] },
|
|
617
|
-
sorter: { type: Function, default:
|
|
619
|
+
sorter: { type: Function, default: Ie },
|
|
618
620
|
draggableChecker: { type: Function, default: (l) => !0 },
|
|
619
621
|
checkValidDrag: { type: Function, default: void 0 },
|
|
620
622
|
sortable: { type: Boolean, default: !1 },
|
|
@@ -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,11 +661,11 @@ 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 :
|
|
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();
|
|
667
670
|
}, oe = it(12), ue = f(() => {
|
|
668
671
|
if (!o.hideEmptyColumns) return [];
|
|
@@ -675,17 +678,17 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
675
678
|
D[k] && (T = !0);
|
|
676
679
|
}), T || e.push(k);
|
|
677
680
|
}), e;
|
|
678
|
-
}), ae = f(() => d.value.filter((e) => !e.hidden)), se = f(() => d.value.filter((e) => e.hidden)),
|
|
681
|
+
}), ae = f(() => d.value.filter((e) => !e.hidden)), se = f(() => d.value.filter((e) => e.hidden)), Ne = f(() => {
|
|
679
682
|
let e = ae.value.length + 1;
|
|
680
683
|
return o.sortable && ++e, e;
|
|
681
|
-
}),
|
|
684
|
+
}), Ue = f(() => d.value.filter((e) => e.isForRowKey)), pe = f(() => se.value.length > 0 && !o.sortable), He = f(() => d.value.map((e) => e.key)), ve = f(() => {
|
|
682
685
|
let e = [];
|
|
683
|
-
for (let c in s)
|
|
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),
|
|
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) => {
|
|
689
692
|
let c = e.target;
|
|
690
693
|
if (typeof c.dataset.column > "u")
|
|
691
694
|
do
|
|
@@ -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) {
|
|
@@ -713,7 +716,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
713
716
|
}), e.setOptions(k);
|
|
714
717
|
}
|
|
715
718
|
});
|
|
716
|
-
},
|
|
719
|
+
}, Ye = (e) => typeof o.checkValidDrag == "function" ? o.checkValidDrag(e) : !0, Se = (e) => typeof o.draggableChecker == "function" ? o.draggableChecker(e) : !0, Ve = () => {
|
|
717
720
|
if (typeof o.newValueGenerator == "function") {
|
|
718
721
|
let e = o.newValueGenerator();
|
|
719
722
|
if (typeof e == "object") {
|
|
@@ -722,11 +725,11 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
722
725
|
}
|
|
723
726
|
}
|
|
724
727
|
i.value.push({});
|
|
725
|
-
}, Ye = () => {
|
|
726
|
-
S.value = !0;
|
|
727
728
|
}, Ze = () => {
|
|
729
|
+
S.value = !0;
|
|
730
|
+
}, xe = () => {
|
|
728
731
|
S.value = !1;
|
|
729
|
-
},
|
|
732
|
+
}, et = (e, c) => {
|
|
730
733
|
if (n("before-save"), o.saveResource && (S.value = !1, !c.success)) {
|
|
731
734
|
n("error", c.httpStatus);
|
|
732
735
|
return;
|
|
@@ -738,15 +741,15 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
738
741
|
for (; T--; ) e.push(void 0);
|
|
739
742
|
}
|
|
740
743
|
return e.splice(k, 0, e.splice(c, 1)[0]), e;
|
|
741
|
-
}, et = (e) => {
|
|
742
|
-
De(i.value, e, e - 1);
|
|
743
744
|
}, tt = (e) => {
|
|
744
|
-
De(i.value, e, e
|
|
745
|
+
De(i.value, e, e - 1);
|
|
745
746
|
}, lt = (e) => {
|
|
747
|
+
De(i.value, e, e + 1);
|
|
748
|
+
}, we = (e) => {
|
|
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,
|
|
@@ -755,16 +758,16 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
755
758
|
i.value.splice(k, 1, D[T]), i.value.splice(T, 1, D[k]);
|
|
756
759
|
},
|
|
757
760
|
onMove: function(c, k) {
|
|
758
|
-
return
|
|
761
|
+
return Ye(c);
|
|
759
762
|
}
|
|
760
763
|
});
|
|
761
|
-
},
|
|
764
|
+
}, Te = (e, c, k = !1) => {
|
|
762
765
|
let T = [oe, "row", c];
|
|
763
|
-
return k && T.push("hidden"),
|
|
766
|
+
return k && T.push("hidden"), Ue.value.forEach((D) => {
|
|
764
767
|
let O = String(e[D.key]).toLowerCase();
|
|
765
768
|
O.length > 50 && (O = O.substring(0, 50)), O = rt(O, " ", "-"), T.push(O);
|
|
766
769
|
}), T.join("-");
|
|
767
|
-
},
|
|
770
|
+
}, Be = f(() => typeof o.createEnabledValidator == "function" ? o.createEnabledValidator({ items: i.value }) : !0);
|
|
768
771
|
return ut(() => {
|
|
769
772
|
Ce(), ke(Vt(o.columns, v.value)), Q.value.store({ items: i.value }).turnStoredIntoOriginal(), o.sortable && de(() => {
|
|
770
773
|
ot();
|
|
@@ -772,16 +775,16 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
772
775
|
}), U(() => o.columns, (e) => d.value = e), U(() => o.modelValue, (e) => i.value = e), U(i, (e) => {
|
|
773
776
|
Ce(), Q.value.increment({ items: e }), n("update:modelValue", e);
|
|
774
777
|
}, { deep: !0 }), t({
|
|
775
|
-
getItemByEvent:
|
|
776
|
-
doRefresh:
|
|
778
|
+
getItemByEvent: Xe,
|
|
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",
|
|
784
|
-
ie.value ? (u(), b(Z(
|
|
786
|
+
ie.value || I(s).title ? (u(), m("header", _t, [
|
|
787
|
+
ie.value ? (u(), b(Z(je.value), { key: 0 }, {
|
|
785
788
|
default: N(() => [
|
|
786
789
|
e.titleIcon ? (u(), m("i", {
|
|
787
790
|
key: 0,
|
|
@@ -793,7 +796,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
793
796
|
})) : y("", !0),
|
|
794
797
|
I(s).title ? F(e.$slots, "title", { key: 1 }) : y("", !0)
|
|
795
798
|
])) : y("", !0),
|
|
796
|
-
(u(), b(Z(
|
|
799
|
+
(u(), b(Z(Je.value), {
|
|
797
800
|
class: te(["lkt-table-page-content-wrapper", e.wrapContentClass])
|
|
798
801
|
}, {
|
|
799
802
|
default: N(() => [
|
|
@@ -801,14 +804,14 @@ 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":
|
|
809
|
-
onLoading:
|
|
810
|
-
onLoaded:
|
|
811
|
-
onClick:
|
|
811
|
+
"resource-data": _e.value,
|
|
812
|
+
onLoading: Ze,
|
|
813
|
+
onLoaded: xe,
|
|
814
|
+
onClick: et
|
|
812
815
|
}, {
|
|
813
816
|
default: N(() => [
|
|
814
817
|
I(s)["button-save"] ? F(e.$slots, "button-save", {
|
|
@@ -816,30 +819,31 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
816
819
|
items: i.value,
|
|
817
820
|
editMode: e.editMode,
|
|
818
821
|
canUpdate: !e.saveDisabled
|
|
819
|
-
}) : (u(), m("span", Jt, j(
|
|
822
|
+
}) : (u(), m("span", Jt, j(Ge.value), 1))
|
|
820
823
|
]),
|
|
821
824
|
_: 3
|
|
822
825
|
}, 8, ["disabled", "confirm-modal", "confirm-data", "resource", "resource-data"]), [
|
|
823
826
|
[ee, he.value]
|
|
824
827
|
]),
|
|
825
|
-
e.canCreate && ne.value && M.value ? (u(), b(
|
|
828
|
+
e.canCreate && ne.value && M.value ? (u(), b(Le, {
|
|
826
829
|
key: 0,
|
|
827
|
-
disabled: !
|
|
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,
|
|
835
839
|
"onUpdate:modelValue": c[0] || (c[0] = (w) => M.value = w),
|
|
836
|
-
label:
|
|
840
|
+
label: ze.value
|
|
837
841
|
}, null, 8, ["modelValue", "label"]), [
|
|
838
842
|
[ee, e.switchEditionEnabled]
|
|
839
843
|
])
|
|
840
844
|
])
|
|
841
845
|
], 512), [
|
|
842
|
-
[ee,
|
|
846
|
+
[ee, Ke.value]
|
|
843
847
|
]),
|
|
844
848
|
I(s).buttons ? (u(), m("div", zt, [
|
|
845
849
|
F(e.$slots, "buttons")
|
|
@@ -859,15 +863,16 @@ 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,
|
|
866
870
|
canCreate: ne.value,
|
|
867
|
-
canRead:
|
|
868
|
-
canUpdate:
|
|
871
|
+
canRead: qe.value,
|
|
872
|
+
canUpdate: Qe.value,
|
|
869
873
|
canDrop: re.value,
|
|
870
|
-
isLoading: S.value
|
|
874
|
+
isLoading: S.value,
|
|
875
|
+
doDrop: () => we(B)
|
|
871
876
|
})
|
|
872
877
|
]))), 256))
|
|
873
878
|
], 2)) : (u(), m("table", Xt, [
|
|
@@ -876,8 +881,8 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
876
881
|
e.sortable && M.value ? (u(), m("th", Yt)) : y("", !0),
|
|
877
882
|
e.addNavigation && M.value ? (u(), m("th", Zt)) : y("", !0),
|
|
878
883
|
pe.value ? (u(), m("th", xt)) : y("", !0),
|
|
879
|
-
(u(!0), m(
|
|
880
|
-
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, {
|
|
881
886
|
key: 0,
|
|
882
887
|
column: w,
|
|
883
888
|
"sort-by": v.value,
|
|
@@ -894,10 +899,10 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
894
899
|
ref: (w) => J.value = w,
|
|
895
900
|
id: "lkt-table-body-" + I(oe)
|
|
896
901
|
}, [
|
|
897
|
-
(u(!0), m(
|
|
902
|
+
(u(!0), m($, null, W(i.value, (w, B) => (u(), b($t, {
|
|
898
903
|
modelValue: i.value[B],
|
|
899
|
-
"onUpdate:modelValue": (
|
|
900
|
-
key:
|
|
904
|
+
"onUpdate:modelValue": (P) => i.value[B] = P,
|
|
905
|
+
key: Te(w, B),
|
|
901
906
|
i: B,
|
|
902
907
|
"display-hidden-columns-indicator": pe.value,
|
|
903
908
|
"is-draggable": Se(w),
|
|
@@ -906,7 +911,7 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
906
911
|
"empty-columns": ue.value,
|
|
907
912
|
"add-navigation": e.addNavigation,
|
|
908
913
|
"hidden-is-visible": ye(B),
|
|
909
|
-
"latest-row": B + 1 ===
|
|
914
|
+
"latest-row": B + 1 === We.value,
|
|
910
915
|
"can-drop": e.canDrop && re.value && M.value,
|
|
911
916
|
"drop-confirm": e.dropConfirm,
|
|
912
917
|
"drop-resource": e.dropResource,
|
|
@@ -915,14 +920,14 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
915
920
|
"edit-mode-enabled": M.value,
|
|
916
921
|
onClick: be,
|
|
917
922
|
onShow: ge,
|
|
918
|
-
onItemUp:
|
|
919
|
-
onItemDown:
|
|
920
|
-
onItemDrop:
|
|
921
|
-
},
|
|
922
|
-
|
|
923
|
-
name:
|
|
923
|
+
onItemUp: tt,
|
|
924
|
+
onItemDown: lt,
|
|
925
|
+
onItemDrop: we
|
|
926
|
+
}, Ee({ _: 2 }, [
|
|
927
|
+
W(ve.value, (P) => ({
|
|
928
|
+
name: P,
|
|
924
929
|
fn: N((G) => [
|
|
925
|
-
F(e.$slots,
|
|
930
|
+
F(e.$slots, P, {
|
|
926
931
|
item: G.item,
|
|
927
932
|
value: G.value,
|
|
928
933
|
column: G.column
|
|
@@ -930,13 +935,13 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
930
935
|
])
|
|
931
936
|
}))
|
|
932
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)),
|
|
933
|
-
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, {
|
|
934
939
|
modelValue: i.value[B],
|
|
935
|
-
"onUpdate:modelValue": (
|
|
936
|
-
key:
|
|
940
|
+
"onUpdate:modelValue": (P) => i.value[B] = P,
|
|
941
|
+
key: Te(w, B, !0),
|
|
937
942
|
i: B,
|
|
938
943
|
"hidden-columns": se.value,
|
|
939
|
-
"hidden-columns-col-span":
|
|
944
|
+
"hidden-columns-col-span": Ne.value,
|
|
940
945
|
"is-draggable": Se(w),
|
|
941
946
|
sortable: e.sortable,
|
|
942
947
|
"visible-columns": ae.value,
|
|
@@ -944,11 +949,11 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
944
949
|
"hidden-is-visible": ye(B),
|
|
945
950
|
onClick: be,
|
|
946
951
|
onShow: ge
|
|
947
|
-
},
|
|
948
|
-
|
|
949
|
-
name:
|
|
952
|
+
}, Ee({ _: 2 }, [
|
|
953
|
+
W(ve.value, (P) => ({
|
|
954
|
+
name: P,
|
|
950
955
|
fn: N((G) => [
|
|
951
|
-
F(e.$slots,
|
|
956
|
+
F(e.$slots, P, {
|
|
952
957
|
item: G.item,
|
|
953
958
|
value: G.value,
|
|
954
959
|
column: G.column
|
|
@@ -966,13 +971,14 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
966
971
|
])) : y("", !0),
|
|
967
972
|
!S.value && i.value.length === 0 ? (u(), m("div", al, j(e.noResultsText), 1)) : y("", !0),
|
|
968
973
|
e.canCreate && ne.value && M.value ? (u(), m("div", nl, [
|
|
969
|
-
e.canCreate && ne.value && M.value ? (u(), b(
|
|
974
|
+
e.canCreate && ne.value && M.value ? (u(), b(Le, {
|
|
970
975
|
key: 0,
|
|
971
|
-
disabled: !
|
|
976
|
+
disabled: !Be.value,
|
|
972
977
|
text: e.createText,
|
|
973
978
|
icon: e.createIcon,
|
|
979
|
+
to: e.createRoute,
|
|
974
980
|
onClick: Ve
|
|
975
|
-
}, null, 8, ["disabled", "text", "icon"])) : y("", !0)
|
|
981
|
+
}, null, 8, ["disabled", "text", "icon", "to"])) : y("", !0)
|
|
976
982
|
])) : y("", !0),
|
|
977
983
|
X(O, {
|
|
978
984
|
ref_key: "paginator",
|
|
@@ -982,20 +988,20 @@ const Sl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), Vl = (l, t, r, n =
|
|
|
982
988
|
resource: e.resource,
|
|
983
989
|
filters: e.filters,
|
|
984
990
|
onResults: $e,
|
|
985
|
-
onLoading:
|
|
991
|
+
onLoading: Oe,
|
|
986
992
|
onPerms: Ae
|
|
987
993
|
}, null, 8, ["modelValue", "resource", "filters"])
|
|
988
994
|
]),
|
|
989
995
|
_: 3
|
|
990
996
|
}, 8, ["class"]))
|
|
991
|
-
], 8,
|
|
997
|
+
], 8, Wt);
|
|
992
998
|
};
|
|
993
999
|
}
|
|
994
|
-
}),
|
|
1000
|
+
}), Rl = {
|
|
995
1001
|
install: (l) => {
|
|
996
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);
|
|
997
1003
|
}
|
|
998
|
-
},
|
|
1004
|
+
}, $l = (l) => (A.navButtonSlot = l, !0), Al = (l) => (A.dropButtonSlot = l, !0), Ol = (l) => (A.createButtonSlot = l, !0);
|
|
999
1005
|
export {
|
|
1000
1006
|
K as LktTableColumn,
|
|
1001
1007
|
Dl as createActionColumn,
|
|
@@ -1008,8 +1014,8 @@ export {
|
|
|
1008
1014
|
Il as createSwitchColumn,
|
|
1009
1015
|
Bl as createTelColumn,
|
|
1010
1016
|
wl as createTextColumn,
|
|
1011
|
-
|
|
1017
|
+
Rl as default,
|
|
1012
1018
|
Ol as setTableCreateButtonSlot,
|
|
1013
|
-
|
|
1014
|
-
|
|
1019
|
+
Al as setTableDropButtonSlot,
|
|
1020
|
+
$l as setTableNavButtonSlot
|
|
1015
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
|
|
|
@@ -613,6 +616,7 @@ defineExpose({
|
|
|
613
616
|
v-bind:can-update="hasUpdatePerm"
|
|
614
617
|
v-bind:can-drop="hasDropPerm"
|
|
615
618
|
v-bind:is-loading="loading"
|
|
619
|
+
v-bind:do-drop="() => onItemDrop(i)"
|
|
616
620
|
/>
|
|
617
621
|
</div>
|
|
618
622
|
</div>
|
|
@@ -633,6 +637,7 @@ defineExpose({
|
|
|
633
637
|
:disabled="!createEnabled"
|
|
634
638
|
:text="createText"
|
|
635
639
|
:icon="createIcon"
|
|
640
|
+
:to="createRoute"
|
|
636
641
|
@click="onClickAddItem"
|
|
637
642
|
/>
|
|
638
643
|
</div>
|