lkt-table 1.2.23 → 1.2.24
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 +17 -17
- package/dist/build.js +145 -141
- package/package.json +1 -1
- package/src/lib-components/LktTable.vue +4 -2
package/dist/build.d.ts
CHANGED
|
@@ -75,7 +75,7 @@ declare class U {
|
|
|
75
75
|
setIsEquivalentToSelectValue(t?: boolean): this;
|
|
76
76
|
equivalentToSelectValue: boolean | undefined;
|
|
77
77
|
}
|
|
78
|
-
declare function
|
|
78
|
+
declare function Al(l: any, t: any, s: any, n?: boolean): {
|
|
79
79
|
preferSlot: boolean;
|
|
80
80
|
key: string;
|
|
81
81
|
label: string;
|
|
@@ -151,7 +151,7 @@ declare function Fl(l: any, t: any, s: any, n?: boolean): {
|
|
|
151
151
|
setIsEquivalentToSelectValue: (t?: boolean) => U;
|
|
152
152
|
equivalentToSelectValue: boolean | undefined;
|
|
153
153
|
};
|
|
154
|
-
declare function
|
|
154
|
+
declare function Hl(l: any, t: any, s?: boolean): {
|
|
155
155
|
preferSlot: boolean;
|
|
156
156
|
key: string;
|
|
157
157
|
label: string;
|
|
@@ -227,7 +227,7 @@ declare function Pl(l: any, t: any, s?: boolean): {
|
|
|
227
227
|
setIsEquivalentToSelectValue: (t?: boolean) => U;
|
|
228
228
|
equivalentToSelectValue: boolean | undefined;
|
|
229
229
|
};
|
|
230
|
-
declare function
|
|
230
|
+
declare function Rl(l: any, t: any, s?: boolean): {
|
|
231
231
|
preferSlot: boolean;
|
|
232
232
|
key: string;
|
|
233
233
|
label: string;
|
|
@@ -303,7 +303,7 @@ declare function $l(l: any, t: any, s?: boolean): {
|
|
|
303
303
|
setIsEquivalentToSelectValue: (t?: boolean) => U;
|
|
304
304
|
equivalentToSelectValue: boolean | undefined;
|
|
305
305
|
};
|
|
306
|
-
declare function
|
|
306
|
+
declare function Nl(l: any, t: any, s?: boolean): {
|
|
307
307
|
preferSlot: boolean;
|
|
308
308
|
key: string;
|
|
309
309
|
label: string;
|
|
@@ -379,7 +379,7 @@ declare function Wl(l: any, t: any, s?: boolean): {
|
|
|
379
379
|
setIsEquivalentToSelectValue: (t?: boolean) => U;
|
|
380
380
|
equivalentToSelectValue: boolean | undefined;
|
|
381
381
|
};
|
|
382
|
-
declare function
|
|
382
|
+
declare function ql(l: any, t: any, s?: boolean): {
|
|
383
383
|
preferSlot: boolean;
|
|
384
384
|
key: string;
|
|
385
385
|
label: string;
|
|
@@ -455,7 +455,7 @@ declare function jl(l: any, t: any, s?: boolean): {
|
|
|
455
455
|
setIsEquivalentToSelectValue: (t?: boolean) => U;
|
|
456
456
|
equivalentToSelectValue: boolean | undefined;
|
|
457
457
|
};
|
|
458
|
-
declare function
|
|
458
|
+
declare function Ol(l: any, t: any, s?: boolean): {
|
|
459
459
|
preferSlot: boolean;
|
|
460
460
|
key: string;
|
|
461
461
|
label: string;
|
|
@@ -531,7 +531,7 @@ declare function Nl(l: any, t: any, s?: boolean): {
|
|
|
531
531
|
setIsEquivalentToSelectValue: (t?: boolean) => U;
|
|
532
532
|
equivalentToSelectValue: boolean | undefined;
|
|
533
533
|
};
|
|
534
|
-
declare function
|
|
534
|
+
declare function jl(l: any, t: any, s?: boolean): {
|
|
535
535
|
preferSlot: boolean;
|
|
536
536
|
key: string;
|
|
537
537
|
label: string;
|
|
@@ -607,7 +607,7 @@ declare function Gl(l: any, t: any, s?: boolean): {
|
|
|
607
607
|
setIsEquivalentToSelectValue: (t?: boolean) => U;
|
|
608
608
|
equivalentToSelectValue: boolean | undefined;
|
|
609
609
|
};
|
|
610
|
-
declare function
|
|
610
|
+
declare function Ul(l: any, t: any, s?: boolean): {
|
|
611
611
|
preferSlot: boolean;
|
|
612
612
|
key: string;
|
|
613
613
|
label: string;
|
|
@@ -683,7 +683,7 @@ declare function Ol(l: any, t: any, s?: boolean): {
|
|
|
683
683
|
setIsEquivalentToSelectValue: (t?: boolean) => U;
|
|
684
684
|
equivalentToSelectValue: boolean | undefined;
|
|
685
685
|
};
|
|
686
|
-
declare function
|
|
686
|
+
declare function $l(l: any, t: any, s: any, n?: boolean): {
|
|
687
687
|
preferSlot: boolean;
|
|
688
688
|
key: string;
|
|
689
689
|
label: string;
|
|
@@ -759,7 +759,7 @@ declare function Al(l: any, t: any, s: any, n?: boolean): {
|
|
|
759
759
|
setIsEquivalentToSelectValue: (t?: boolean) => U;
|
|
760
760
|
equivalentToSelectValue: boolean | undefined;
|
|
761
761
|
};
|
|
762
|
-
declare function
|
|
762
|
+
declare function Kl(l: any, t: any, s: any, n?: boolean): {
|
|
763
763
|
preferSlot: boolean;
|
|
764
764
|
key: string;
|
|
765
765
|
label: string;
|
|
@@ -835,7 +835,7 @@ declare function ql(l: any, t: any, s: any, n?: boolean): {
|
|
|
835
835
|
setIsEquivalentToSelectValue: (t?: boolean) => U;
|
|
836
836
|
equivalentToSelectValue: boolean | undefined;
|
|
837
837
|
};
|
|
838
|
-
declare function
|
|
838
|
+
declare function Pl(l: any, t: any, s?: boolean): {
|
|
839
839
|
preferSlot: boolean;
|
|
840
840
|
key: string;
|
|
841
841
|
label: string;
|
|
@@ -911,7 +911,7 @@ declare function Kl(l: any, t: any, s?: boolean): {
|
|
|
911
911
|
setIsEquivalentToSelectValue: (t?: boolean) => U;
|
|
912
912
|
equivalentToSelectValue: boolean | undefined;
|
|
913
913
|
};
|
|
914
|
-
declare function
|
|
914
|
+
declare function Wl(l: any, t: any, s?: boolean): {
|
|
915
915
|
preferSlot: boolean;
|
|
916
916
|
key: string;
|
|
917
917
|
label: string;
|
|
@@ -987,7 +987,7 @@ declare function Hl(l: any, t: any, s?: boolean): {
|
|
|
987
987
|
setIsEquivalentToSelectValue: (t?: boolean) => U;
|
|
988
988
|
equivalentToSelectValue: boolean | undefined;
|
|
989
989
|
};
|
|
990
|
-
declare function
|
|
990
|
+
declare function Fl(l: any, t: any, s?: boolean): {
|
|
991
991
|
preferSlot: boolean;
|
|
992
992
|
key: string;
|
|
993
993
|
label: string;
|
|
@@ -1063,11 +1063,11 @@ declare function Ul(l: any, t: any, s?: boolean): {
|
|
|
1063
1063
|
setIsEquivalentToSelectValue: (t?: boolean) => U;
|
|
1064
1064
|
equivalentToSelectValue: boolean | undefined;
|
|
1065
1065
|
};
|
|
1066
|
-
declare namespace
|
|
1066
|
+
declare namespace Gl {
|
|
1067
1067
|
function install(l: any): void;
|
|
1068
1068
|
}
|
|
1069
|
-
declare function Xl(l: any): boolean;
|
|
1070
1069
|
declare function Ql(l: any): boolean;
|
|
1071
|
-
declare function Yl(l: any): void;
|
|
1072
1070
|
declare function Jl(l: any): boolean;
|
|
1073
|
-
|
|
1071
|
+
declare function Xl(l: any): void;
|
|
1072
|
+
declare function zl(l: any): boolean;
|
|
1073
|
+
export { U as LktTableColumn, Al as createActionColumn, Hl as createCheckColumn, Rl as createColumn, Nl as createEmailColumn, ql as createFileColumn, Ol as createFloatColumn, jl as createHiddenColumn, Ul as createIntegerColumn, $l as createLinkColumn, Kl as createSelectColumn, Pl as createSwitchColumn, Wl as createTelColumn, Fl as createTextColumn, Gl as default, Ql as setTableCreateButtonSlot, Jl as setTableDropButtonSlot, Xl as setTableEmptySlot, zl as setTableNavButtonSlot };
|
package/dist/build.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reactive as F, defineComponent as Q, ref as C, watch as A, nextTick as ve, computed as f, resolveComponent as L, openBlock as i, createBlock as k, withCtx as W, createTextVNode as
|
|
1
|
+
import { reactive as F, defineComponent as Q, ref as C, watch as A, nextTick as ve, computed as f, resolveComponent as L, openBlock as i, createBlock as k, withCtx as W, createTextVNode as te, toDisplayString as G, unref as V, createElementBlock as p, Fragment as M, withModifiers as Ue, resolveDynamicComponent as z, createCommentVNode as b, normalizeClass as _, createElementVNode as D, createVNode as x, renderList as q, renderSlot as N, withDirectives as ae, vShow as ne, useSlots as ft, onMounted as pt, createSlots as $e } from "vue";
|
|
2
2
|
import { httpCall as vt } from "lkt-http-client";
|
|
3
3
|
import { __ as J } from "lkt-i18n";
|
|
4
4
|
import { createLktEvent as he } from "lkt-events";
|
|
@@ -13,7 +13,7 @@ import St from "lkt-field-text";
|
|
|
13
13
|
import Vt from "lkt-field-textarea";
|
|
14
14
|
import Et from "lkt-field-select";
|
|
15
15
|
import Bt from "lkt-field-switch";
|
|
16
|
-
import
|
|
16
|
+
import Tt from "lkt-field-file";
|
|
17
17
|
class U {
|
|
18
18
|
constructor(t = "", s = "") {
|
|
19
19
|
this.preferSlot = !0, this.key = t, this.label = s, this.sortable = !0, this.hidden = !1, this.formatter = void 0, this.checkEmpty = void 0, this.colspan = void 0, this.preferSlot = !0, this.resource = "", this.resourceData = {}, this.isMultiple = !1, this.isLoading = !1, this.resourceLoaded = !1, this.valueSlot = "", this.editSlot = "", this.multipleDisplay = "", this.multipleDisplayEdition = "";
|
|
@@ -162,7 +162,7 @@ class U {
|
|
|
162
162
|
return this.equivalentToSelectValue = t, this;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
-
const
|
|
165
|
+
const Rl = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), $l = (l, t, s, n = !0) => F(new U(l, t).setIsSortable(n).defineAsLink(s)), Al = (l, t, s, n = !0) => F(new U(l, t).setIsSortable(n).defineAsAction(s)), Fl = (l, t, s = !0) => F(new U(l, t).setIsSortable(s).defineAsText()), Ul = (l, t, s = !0) => F(new U(l, t).setIsSortable(s).defineAsInteger()), Ol = (l, t, s = !0) => F(new U(l, t).setIsSortable(s).defineAsFloat()), Nl = (l, t, s = !0) => F(new U(l, t).setIsSortable(s).defineAsEmail()), Wl = (l, t, s = !0) => F(new U(l, t).setIsSortable(s).defineAsTel()), Hl = (l, t, s = !0) => F(new U(l, t).setIsSortable(s).defineAsCheck()), Pl = (l, t, s = !0) => F(new U(l, t).setIsSortable(s).defineAsSwitch()), Kl = (l, t, s, n = !0) => F(new U(l, t).setIsSortable(n).defineAsSelect(s)), ql = (l, t, s = !0) => F(new U(l, t).setIsSortable(s).defineAsFile()), jl = (l, t, s = !0) => F(new U(l, t).setIsSortable(s).setIsHidden(!0)), Ae = (l, t, s, n) => {
|
|
166
166
|
if (!s) return 0;
|
|
167
167
|
let u = l[s.key], o = t[s.key];
|
|
168
168
|
if (n === "asc") {
|
|
@@ -173,25 +173,25 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
173
173
|
if (o > u) return 1;
|
|
174
174
|
}
|
|
175
175
|
return 0;
|
|
176
|
-
},
|
|
176
|
+
}, ee = (l, t, s, n = []) => {
|
|
177
177
|
if (l.extractTitleFromColumn) {
|
|
178
178
|
let u = n.find((o) => o.key === l.extractTitleFromColumn);
|
|
179
179
|
if (u)
|
|
180
|
-
return
|
|
180
|
+
return ee(u, t, s, n);
|
|
181
181
|
}
|
|
182
182
|
if (l.formatter && typeof l.formatter == "function") {
|
|
183
183
|
let u = l.formatter(t[l.key], t, l, s);
|
|
184
184
|
return u.startsWith("__:") ? J(u.substring(3)) : u;
|
|
185
185
|
}
|
|
186
186
|
return t[l.key];
|
|
187
|
-
},
|
|
187
|
+
}, Dt = (l, t, s) => {
|
|
188
188
|
if (!l.colspan) return -1;
|
|
189
189
|
let n = t;
|
|
190
190
|
return s.forEach((u) => {
|
|
191
191
|
let o = ye(l, u);
|
|
192
192
|
o > 0 && o < n && (n = o);
|
|
193
193
|
}), n;
|
|
194
|
-
}, ye = (l, t) => l.colspan === !1 ? !1 : typeof l.colspan == "function" ? l.colspan(t) : l.colspan,
|
|
194
|
+
}, ye = (l, t) => l.colspan === !1 ? !1 : typeof l.colspan == "function" ? l.colspan(t) : l.colspan, It = (l, t) => typeof l.preferSlot > "u" ? !0 : l.preferSlot === !1 ? !1 : typeof l.preferSlot == "function" ? l.preferSlot(t) : !0, wt = (l, t, s) => {
|
|
195
195
|
if (typeof l != "object" || !l.key || t.indexOf(l.key) > -1) return !1;
|
|
196
196
|
let n = ye(l, s);
|
|
197
197
|
return typeof l.colspan > "u" ? !0 : (typeof l.colspan < "u" && (typeof l.colspan == "function" ? n = parseInt(l.colspan(s)) : n = parseInt(l.colspan)), n > 0);
|
|
@@ -235,14 +235,14 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
235
235
|
to: a.column.getHref(u.value)
|
|
236
236
|
}, {
|
|
237
237
|
default: W(() => [
|
|
238
|
-
|
|
238
|
+
te(G(V(ee)(a.column, u.value, a.i)), 1)
|
|
239
239
|
]),
|
|
240
240
|
_: 1
|
|
241
241
|
}, 8, ["to"])) : a.column.type === "action" ? (i(), p("a", {
|
|
242
242
|
key: 1,
|
|
243
243
|
href: "#",
|
|
244
244
|
onClick: r[0] || (r[0] = (c) => a.column.doAction(u.value))
|
|
245
|
-
}, G(V(
|
|
245
|
+
}, G(V(ee)(a.column, u.value, a.i)), 1)) : a.column.type === "text" ? (i(), k(P, {
|
|
246
246
|
key: 2,
|
|
247
247
|
"read-mode": !a.column.editable || !a.editModeEnabled,
|
|
248
248
|
ref: (c) => h.value = c,
|
|
@@ -328,7 +328,7 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
328
328
|
"multiple-display-edition": a.column.multipleDisplayEdition
|
|
329
329
|
}, null, 8, ["read-mode", "modelValue", "slot-data", "resource", "use-resource-slot", "resource-data", "options", "multiple", "tags", "multiple-display", "multiple-display-edition"]))
|
|
330
330
|
], 64)) : (i(), p(M, { key: 11 }, [
|
|
331
|
-
|
|
331
|
+
te(G(V(ee)(a.column, u.value, a.i, a.columns)), 1)
|
|
332
332
|
], 64));
|
|
333
333
|
};
|
|
334
334
|
}
|
|
@@ -411,7 +411,7 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
411
411
|
}, Ut = {
|
|
412
412
|
key: 2,
|
|
413
413
|
class: "lkt-table-nav-cell"
|
|
414
|
-
}, Ot = { class: "lkt-table-nav-container" }, Nt = /* @__PURE__ */
|
|
414
|
+
}, Ot = { class: "lkt-table-nav-container" }, Nt = /* @__PURE__ */ D("i", { class: "" }, null, -1), Wt = /* @__PURE__ */ D("i", { class: "" }, null, -1), Ht = ["data-column", "colspan", "title", "onClick"], Pt = {
|
|
415
415
|
key: 4,
|
|
416
416
|
class: "lkt-table-col-drop"
|
|
417
417
|
}, Kt = {
|
|
@@ -471,11 +471,11 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
471
471
|
d.sortable && d.isDraggable && d.editModeEnabled ? (i(), p("td", {
|
|
472
472
|
key: 0,
|
|
473
473
|
"data-role": "drag-indicator",
|
|
474
|
-
class:
|
|
474
|
+
class: _(v.value)
|
|
475
475
|
}, null, 2)) : d.sortable && d.editModeEnabled ? (i(), p("td", Ft)) : b("", !0),
|
|
476
476
|
d.addNavigation && d.editModeEnabled ? (i(), p("td", Ut, [
|
|
477
|
-
|
|
478
|
-
|
|
477
|
+
D("div", Ot, [
|
|
478
|
+
x(c, {
|
|
479
479
|
palette: "table-nav",
|
|
480
480
|
disabled: d.i === 0,
|
|
481
481
|
onClick: j
|
|
@@ -486,12 +486,12 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
486
486
|
direction: "up"
|
|
487
487
|
})) : (i(), p(M, { key: 1 }, [
|
|
488
488
|
Nt,
|
|
489
|
-
|
|
489
|
+
te(" UP ")
|
|
490
490
|
], 64))
|
|
491
491
|
]),
|
|
492
492
|
_: 1
|
|
493
493
|
}, 8, ["disabled"]),
|
|
494
|
-
|
|
494
|
+
x(c, {
|
|
495
495
|
palette: "table-nav",
|
|
496
496
|
disabled: d.latestRow,
|
|
497
497
|
onClick: P
|
|
@@ -502,7 +502,7 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
502
502
|
direction: "down"
|
|
503
503
|
})) : (i(), p(M, { key: 1 }, [
|
|
504
504
|
Wt,
|
|
505
|
-
|
|
505
|
+
te(" DOWN ")
|
|
506
506
|
], 64))
|
|
507
507
|
]),
|
|
508
508
|
_: 1
|
|
@@ -513,17 +513,17 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
513
513
|
key: 3,
|
|
514
514
|
onClick: $[0] || ($[0] = (E) => y(E, d.i)),
|
|
515
515
|
"data-role": "show-more",
|
|
516
|
-
class:
|
|
516
|
+
class: _(d.hiddenIsVisible ? "state-open" : "")
|
|
517
517
|
}, null, 2)) : b("", !0),
|
|
518
518
|
(i(!0), p(M, null, q(d.visibleColumns, (E) => (i(), p(M, null, [
|
|
519
|
-
V(
|
|
519
|
+
V(wt)(E, d.emptyColumns, u.value) ? (i(), p("td", {
|
|
520
520
|
key: "td" + d.i,
|
|
521
521
|
"data-column": E.key,
|
|
522
522
|
colspan: V(ye)(E, u.value),
|
|
523
|
-
title: V(
|
|
524
|
-
onClick: (
|
|
523
|
+
title: V(ee)(E, u.value, d.i, d.visibleColumns),
|
|
524
|
+
onClick: (le) => h(le, u.value, E)
|
|
525
525
|
}, [
|
|
526
|
-
d.$slots[E.key] && V(
|
|
526
|
+
d.$slots[E.key] && V(It)(E, u.value) ? N(d.$slots, E.key, {
|
|
527
527
|
key: 0,
|
|
528
528
|
value: u.value[E.key],
|
|
529
529
|
item: u.value,
|
|
@@ -532,7 +532,7 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
532
532
|
}) : u.value ? (i(), k(Ne, {
|
|
533
533
|
key: 1,
|
|
534
534
|
modelValue: u.value,
|
|
535
|
-
"onUpdate:modelValue": $[1] || ($[1] = (
|
|
535
|
+
"onUpdate:modelValue": $[1] || ($[1] = (le) => u.value = le),
|
|
536
536
|
column: E,
|
|
537
537
|
columns: d.visibleColumns,
|
|
538
538
|
"edit-mode-enabled": d.editModeEnabled,
|
|
@@ -541,7 +541,7 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
541
541
|
], 8, Ht)) : b("", !0)
|
|
542
542
|
], 64))), 256)),
|
|
543
543
|
d.canDrop && d.editModeEnabled ? (i(), p("td", Pt, [
|
|
544
|
-
|
|
544
|
+
x(Rt, {
|
|
545
545
|
resource: d.dropResource,
|
|
546
546
|
"resource-data": u.value,
|
|
547
547
|
confirm: d.dropConfirm,
|
|
@@ -551,7 +551,7 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
551
551
|
}, null, 8, ["resource", "resource-data", "confirm", "text", "icon"])
|
|
552
552
|
])) : b("", !0),
|
|
553
553
|
d.canEdit && d.editModeEnabled ? (i(), p("td", Kt, [
|
|
554
|
-
|
|
554
|
+
x($t, {
|
|
555
555
|
"resource-data": u.value,
|
|
556
556
|
text: d.editText,
|
|
557
557
|
icon: d.editIcon,
|
|
@@ -580,20 +580,20 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
580
580
|
const s = t, n = l, u = C(n.modelValue), o = (h, y, v) => {
|
|
581
581
|
s("click", h, he("", { item: y, column: v }));
|
|
582
582
|
};
|
|
583
|
-
return A(() => n.modelValue, (h) => u.value = h), A(u, () => s("update:modelValue", u.value)), (h, y) =>
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
583
|
+
return A(() => n.modelValue, (h) => u.value = h), A(u, () => s("update:modelValue", u.value)), (h, y) => ae((i(), p("tr", jt, [
|
|
584
|
+
D("td", { colspan: h.hiddenColumnsColSpan }, [
|
|
585
|
+
D("table", null, [
|
|
586
|
+
D("tr", null, [
|
|
587
587
|
(i(!0), p(M, null, q(h.hiddenColumns, (v) => (i(), p("th", {
|
|
588
588
|
"data-column": v.key
|
|
589
589
|
}, [
|
|
590
|
-
|
|
590
|
+
D("div", null, G(v.label), 1)
|
|
591
591
|
], 8, zt))), 256))
|
|
592
592
|
]),
|
|
593
|
-
|
|
593
|
+
D("tr", { "data-i": h.i }, [
|
|
594
594
|
(i(!0), p(M, null, q(h.hiddenColumns, (v, a) => (i(), p("td", {
|
|
595
595
|
"data-column": v.key,
|
|
596
|
-
title: V(
|
|
596
|
+
title: V(ee)(v, u.value, a, h.hiddenColumns),
|
|
597
597
|
onClick: (r) => o(r, u.value, v)
|
|
598
598
|
}, [
|
|
599
599
|
h.$slots[v.key] ? N(h.$slots, v.key, {
|
|
@@ -615,7 +615,7 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
615
615
|
])
|
|
616
616
|
], 8, Gt)
|
|
617
617
|
], 512)), [
|
|
618
|
-
[
|
|
618
|
+
[ne, h.hiddenIsVisible]
|
|
619
619
|
]);
|
|
620
620
|
}
|
|
621
621
|
}), Fe = /* @__PURE__ */ Q({
|
|
@@ -657,7 +657,7 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
657
657
|
},
|
|
658
658
|
emits: ["click"],
|
|
659
659
|
setup(l, { emit: t }) {
|
|
660
|
-
const s = t, n = l, u = f(() =>
|
|
660
|
+
const s = t, n = l, u = f(() => Dt(n.column, n.amountOfColumns, n.items)), o = f(() => n.column.sortable === !0), h = f(() => o.value && n.sortBy === n.column.key ? n.sortDirection : ""), y = f(() => n.column.label.startsWith("__:") ? J(n.column.label.substring(3)) : n.column.label), v = () => {
|
|
661
661
|
s("click", n.column);
|
|
662
662
|
};
|
|
663
663
|
return (a, r) => (i(), p("th", {
|
|
@@ -668,31 +668,31 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
668
668
|
title: y.value,
|
|
669
669
|
onClick: v
|
|
670
670
|
}, [
|
|
671
|
-
|
|
671
|
+
D("div", null, G(y.value), 1)
|
|
672
672
|
], 8, Yt));
|
|
673
673
|
}
|
|
674
|
-
}), _t = ["id"], xt = {
|
|
674
|
+
}), _t = ["id"], xt = { class: "lkt-table-page-buttons" }, el = { key: 1 }, tl = { class: "switch-edition-mode" }, ll = {
|
|
675
675
|
key: 0,
|
|
676
676
|
class: "lkt-table-page-buttons"
|
|
677
|
-
},
|
|
677
|
+
}, ol = {
|
|
678
678
|
key: 1,
|
|
679
679
|
class: "lkt-table-page-filters"
|
|
680
|
-
},
|
|
680
|
+
}, al = ["data-sortable"], nl = { key: 0 }, ul = {
|
|
681
681
|
key: 0,
|
|
682
682
|
"data-role": "drag-indicator"
|
|
683
|
-
},
|
|
683
|
+
}, il = { key: 1 }, rl = { key: 2 }, sl = {
|
|
684
684
|
key: 3,
|
|
685
685
|
class: "lkt-table-col-drop"
|
|
686
|
-
},
|
|
686
|
+
}, dl = {
|
|
687
687
|
key: 4,
|
|
688
688
|
class: "lkt-table-col-edit"
|
|
689
|
-
},
|
|
689
|
+
}, cl = ["id"], ml = { class: "lkt-table-item" }, fl = {
|
|
690
690
|
key: 3,
|
|
691
691
|
class: "lkt-table-empty"
|
|
692
|
-
},
|
|
692
|
+
}, pl = {
|
|
693
693
|
key: 4,
|
|
694
694
|
class: "lkt-table-page-buttons lkt-table-page-buttons-bottom"
|
|
695
|
-
},
|
|
695
|
+
}, vl = /* @__PURE__ */ Q({
|
|
696
696
|
__name: "LktTable",
|
|
697
697
|
props: {
|
|
698
698
|
modelValue: { default: () => [] },
|
|
@@ -711,6 +711,7 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
711
711
|
title: { default: "" },
|
|
712
712
|
titleTag: { default: "h2" },
|
|
713
713
|
titleIcon: { default: "" },
|
|
714
|
+
headerClass: { default: "" },
|
|
714
715
|
wrapContentTag: { default: "div" },
|
|
715
716
|
wrapContentClass: { default: "" },
|
|
716
717
|
itemsContainerClass: { default: "" },
|
|
@@ -751,7 +752,7 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
751
752
|
},
|
|
752
753
|
emits: ["update:modelValue", "update:perms", "sort", "click", "save", "error", "before-save", "read-response", "click-create"],
|
|
753
754
|
setup(l, { expose: t, emit: s }) {
|
|
754
|
-
const n = s, u = ft(), o = l, h = {}, y = C(typeof o.sorter == "function" ? o.sorter : Ae), v = C(Lt(o.columns)), a = C("asc"), r = C(o.modelValue), j = C(h), P = C(null), O = C(o.columns), Y = C(o.page), d = C(!1), $ = C(!1), c = C(o.perms), E = C(null),
|
|
755
|
+
const n = s, u = ft(), o = l, h = {}, y = C(typeof o.sorter == "function" ? o.sorter : Ae), v = C(Lt(o.columns)), a = C("asc"), r = C(o.modelValue), j = C(h), P = C(null), O = C(o.columns), Y = C(o.page), d = C(!1), $ = C(!1), c = C(o.perms), E = C(null), le = C({}), Z = C(new yt({ items: r.value }, o.dataStateConfig)), I = C(o.editMode), oe = C(0), We = (e) => {
|
|
755
756
|
Array.isArray(e) && (r.value = e), d.value = !1, $.value = !0, Z.value.store({ items: r.value }).turnStoredIntoOriginal();
|
|
756
757
|
}, He = (e) => {
|
|
757
758
|
c.value = e;
|
|
@@ -764,12 +765,12 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
764
765
|
if (!o.hideEmptyColumns) return [];
|
|
765
766
|
let e = [];
|
|
766
767
|
return O.value.forEach((m) => {
|
|
767
|
-
let g = m.key,
|
|
768
|
-
r.value.forEach((
|
|
769
|
-
if (typeof
|
|
770
|
-
return
|
|
771
|
-
|
|
772
|
-
}),
|
|
768
|
+
let g = m.key, T = !1;
|
|
769
|
+
r.value.forEach((w) => {
|
|
770
|
+
if (typeof w.checkEmpty == "function")
|
|
771
|
+
return w.checkEmpty(w);
|
|
772
|
+
w[g] && (T = !0);
|
|
773
|
+
}), T || e.push(g);
|
|
773
774
|
}), e;
|
|
774
775
|
}), ie = f(() => O.value.filter((e) => !e.hidden)), ce = f(() => O.value.filter((e) => e.hidden)), Ge = f(() => {
|
|
775
776
|
let e = ie.value.length + 1;
|
|
@@ -778,7 +779,7 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
778
779
|
let e = [];
|
|
779
780
|
for (let m in u) Je.value.indexOf(m) !== -1 && e.push(m);
|
|
780
781
|
return e;
|
|
781
|
-
}), ge = f(() => o.hiddenSave || d.value || !o.saveResource ? !1 :
|
|
782
|
+
}), ge = f(() => o.hiddenSave || d.value || !o.saveResource ? !1 : I.value && Z.value.changed() ? !0 : I.value), Qe = f(() => re.value && r.value.length >= o.requiredItemsForTopCreate || o.switchEditionEnabled ? !0 : ge.value || I.value && o.canCreate), Xe = f(() => o.saveDisabled || typeof o.saveValidator == "function" && !o.saveValidator(r.value) ? !1 : Z.value.changed()), Ye = f(() => r.value.length), Ze = f(() => ({
|
|
782
783
|
items: r.value,
|
|
783
784
|
...o.saveResourceData
|
|
784
785
|
})), _e = f(() => o.titleTag === "" ? "h2" : o.titleTag), xe = f(() => o.wrapContentTag === "" ? "div" : o.wrapContentTag), me = f(() => o.title.startsWith("__:") ? J(o.title.substring(3)) : o.title), et = f(() => o.saveText.startsWith("__:") ? J(o.saveText.substring(3)) : o.saveText), tt = f(() => o.editModeText.startsWith("__:") ? J(o.editModeText.substring(3)) : o.editModeText), Ce = f(() => c.value.includes("create")), lt = f(() => c.value.includes("read")), fe = f(() => c.value.includes("update")), pe = f(() => c.value.includes("drop")), ot = (e) => {
|
|
@@ -796,20 +797,20 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
796
797
|
}, Be = (e, m) => {
|
|
797
798
|
let g = "tr_" + m.value.i;
|
|
798
799
|
j.value[g] = typeof j.value[g] > "u" ? !0 : !j.value[g];
|
|
799
|
-
},
|
|
800
|
+
}, Te = () => {
|
|
800
801
|
O.value.forEach((e) => {
|
|
801
802
|
if (e.type === "select" && e.autoLoadSelectOptions) {
|
|
802
803
|
let m = e.autoLoadSelectOptionsKey !== "" ? e.autoLoadSelectOptionsKey : e.key, g = [];
|
|
803
|
-
r.value.forEach((
|
|
804
|
-
Array.isArray(
|
|
804
|
+
r.value.forEach((w) => {
|
|
805
|
+
Array.isArray(w[m]) && w[m].forEach((H) => g.push(H));
|
|
805
806
|
});
|
|
806
|
-
let
|
|
807
|
-
g = g.filter(function(
|
|
808
|
-
return
|
|
807
|
+
let T = {};
|
|
808
|
+
g = g.filter(function(w) {
|
|
809
|
+
return T[w.value] ? !1 : (T[w.value] = !0, !0);
|
|
809
810
|
}), e.setOptions(g);
|
|
810
811
|
}
|
|
811
812
|
});
|
|
812
|
-
}, at = (e) => typeof o.checkValidDrag == "function" ? o.checkValidDrag(e) : !0,
|
|
813
|
+
}, at = (e) => typeof o.checkValidDrag == "function" ? o.checkValidDrag(e) : !0, De = (e) => typeof o.draggableChecker == "function" ? o.draggableChecker(e) : !0, Ie = () => {
|
|
813
814
|
if (o.canCreateWithoutEdition)
|
|
814
815
|
n("click-create");
|
|
815
816
|
else {
|
|
@@ -832,75 +833,78 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
832
833
|
return;
|
|
833
834
|
}
|
|
834
835
|
Z.value.turnStoredIntoOriginal(), n("save", m);
|
|
835
|
-
},
|
|
836
|
+
}, we = (e, m, g) => {
|
|
836
837
|
if (g >= e.length) {
|
|
837
|
-
let
|
|
838
|
-
for (;
|
|
838
|
+
let T = g - e.length + 1;
|
|
839
|
+
for (; T--; ) e.push(void 0);
|
|
839
840
|
}
|
|
840
841
|
return e.splice(g, 0, e.splice(m, 1)[0]), e;
|
|
841
842
|
}, rt = (e) => {
|
|
842
|
-
|
|
843
|
+
we(r.value, e, e - 1), oe.value = se();
|
|
843
844
|
}, st = (e) => {
|
|
844
|
-
|
|
845
|
+
we(r.value, e, e + 1), oe.value = se();
|
|
845
846
|
}, Le = (e) => {
|
|
846
|
-
r.value.splice(e, 1),
|
|
847
|
+
r.value.splice(e, 1), oe.value = se();
|
|
847
848
|
}, dt = () => {
|
|
848
849
|
let e = document.getElementById("lkt-table-body-" + ue);
|
|
849
|
-
|
|
850
|
+
le.value = new kt(e, {
|
|
850
851
|
direction: "vertical",
|
|
851
852
|
handle: ".handle",
|
|
852
853
|
animation: 150,
|
|
853
854
|
onEnd: function(m) {
|
|
854
|
-
let g = m.oldIndex,
|
|
855
|
-
r.value.splice(
|
|
855
|
+
let g = m.oldIndex, T = m.newIndex;
|
|
856
|
+
r.value.splice(T, 0, r.value.splice(g, 1)[0]), oe.value = se();
|
|
856
857
|
},
|
|
857
858
|
onMove: function(m, g) {
|
|
858
859
|
return at(m);
|
|
859
860
|
}
|
|
860
861
|
});
|
|
861
862
|
}, Me = (e, m, g = !1) => {
|
|
862
|
-
let
|
|
863
|
-
return g &&
|
|
864
|
-
let H = String(e[
|
|
865
|
-
H.length > 50 && (H = H.substring(0, 50)), H = Oe(H, " ", "-"),
|
|
866
|
-
}),
|
|
867
|
-
}, Re = f(() => typeof o.createEnabledValidator == "function" ? o.createEnabledValidator({ items: r.value }) : !0), re = f(() => Ce.value ? o.canCreateWithoutEdition || o.canCreate &&
|
|
863
|
+
let T = [oe.value, ue, "row", m];
|
|
864
|
+
return g && T.push("hidden"), ze.value.forEach((w) => {
|
|
865
|
+
let H = String(e[w.key]).toLowerCase();
|
|
866
|
+
H.length > 50 && (H = H.substring(0, 50)), H = Oe(H, " ", "-"), T.push(H);
|
|
867
|
+
}), T.join("-");
|
|
868
|
+
}, Re = f(() => typeof o.createEnabledValidator == "function" ? o.createEnabledValidator({ items: r.value }) : !0), re = f(() => Ce.value ? o.canCreateWithoutEdition || o.canCreate && I.value : !1);
|
|
868
869
|
pt(() => {
|
|
869
|
-
|
|
870
|
+
Te(), o.initialSorting && Ve(Mt(o.columns, v.value)), Z.value.store({ items: r.value }).turnStoredIntoOriginal(), o.sortable && ve(() => {
|
|
870
871
|
dt();
|
|
871
872
|
});
|
|
872
|
-
}), A(() => o.perms, (e) => c.value = e), A(c, (e) => n("update:perms", e)), A(() => o.editMode, (e) =>
|
|
873
|
-
|
|
873
|
+
}), A(() => o.perms, (e) => c.value = e), A(c, (e) => n("update:perms", e)), A(() => o.editMode, (e) => I.value = e), A(() => o.columns, (e) => O.value = e), A(() => o.modelValue, (e) => r.value = e), A(r, (e) => {
|
|
874
|
+
Te(), Z.value.increment({ items: e }), n("update:modelValue", e);
|
|
874
875
|
}, { deep: !0 }), t({
|
|
875
876
|
getItemByEvent: ot,
|
|
876
877
|
doRefresh: je
|
|
877
878
|
});
|
|
878
879
|
const ct = f(() => typeof R.defaultEmptySlot < "u"), mt = f(() => R.defaultEmptySlot);
|
|
879
880
|
return (e, m) => {
|
|
880
|
-
const g = L("lkt-button"),
|
|
881
|
+
const g = L("lkt-button"), T = L("lkt-field-switch"), w = L("lkt-loader"), H = L("lkt-paginator");
|
|
881
882
|
return i(), p("section", {
|
|
882
883
|
class: "lkt-table-page",
|
|
883
884
|
id: "lkt-table-page-" + V(ue)
|
|
884
885
|
}, [
|
|
885
|
-
me.value || V(u).title ? (i(), p("header",
|
|
886
|
+
me.value || V(u).title ? (i(), p("header", {
|
|
887
|
+
key: 0,
|
|
888
|
+
class: _(e.headerClass)
|
|
889
|
+
}, [
|
|
886
890
|
me.value ? (i(), k(z(_e.value), { key: 0 }, {
|
|
887
891
|
default: W(() => [
|
|
888
892
|
e.titleIcon ? (i(), p("i", {
|
|
889
893
|
key: 0,
|
|
890
|
-
class:
|
|
894
|
+
class: _(e.titleIcon)
|
|
891
895
|
}, null, 2)) : b("", !0),
|
|
892
|
-
|
|
896
|
+
te(" " + G(me.value), 1)
|
|
893
897
|
]),
|
|
894
898
|
_: 1
|
|
895
899
|
})) : b("", !0),
|
|
896
900
|
V(u).title ? N(e.$slots, "title", { key: 1 }) : b("", !0)
|
|
897
|
-
])) : b("", !0),
|
|
901
|
+
], 2)) : b("", !0),
|
|
898
902
|
(i(), k(z(xe.value), {
|
|
899
|
-
class:
|
|
903
|
+
class: _(["lkt-table-page-content-wrapper", e.wrapContentClass])
|
|
900
904
|
}, {
|
|
901
905
|
default: W(() => [
|
|
902
|
-
|
|
903
|
-
|
|
906
|
+
ae(D("div", xt, [
|
|
907
|
+
ae(x(g, {
|
|
904
908
|
ref: "saveButton",
|
|
905
909
|
palette: "success",
|
|
906
910
|
disabled: !Xe.value,
|
|
@@ -918,11 +922,11 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
918
922
|
items: r.value,
|
|
919
923
|
editMode: e.editMode,
|
|
920
924
|
canUpdate: !e.saveDisabled
|
|
921
|
-
}) : (i(), p("span",
|
|
925
|
+
}) : (i(), p("span", el, G(et.value), 1))
|
|
922
926
|
]),
|
|
923
927
|
_: 3
|
|
924
928
|
}, 8, ["disabled", "confirm-modal", "confirm-data", "resource", "resource-data"]), [
|
|
925
|
-
[
|
|
929
|
+
[ne, ge.value]
|
|
926
930
|
]),
|
|
927
931
|
re.value && r.value.length >= e.requiredItemsForTopCreate ? (i(), k(Fe, {
|
|
928
932
|
key: 0,
|
|
@@ -930,39 +934,39 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
930
934
|
text: e.createText,
|
|
931
935
|
icon: e.createIcon,
|
|
932
936
|
to: e.createRoute,
|
|
933
|
-
onClick:
|
|
937
|
+
onClick: Ie
|
|
934
938
|
}, null, 8, ["disabled", "text", "icon", "to"])) : b("", !0),
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
modelValue:
|
|
938
|
-
"onUpdate:modelValue": m[0] || (m[0] = (S) =>
|
|
939
|
+
D("div", tl, [
|
|
940
|
+
ae(x(T, {
|
|
941
|
+
modelValue: I.value,
|
|
942
|
+
"onUpdate:modelValue": m[0] || (m[0] = (S) => I.value = S),
|
|
939
943
|
label: tt.value
|
|
940
944
|
}, null, 8, ["modelValue", "label"]), [
|
|
941
|
-
[
|
|
945
|
+
[ne, e.switchEditionEnabled]
|
|
942
946
|
])
|
|
943
947
|
])
|
|
944
948
|
], 512), [
|
|
945
|
-
[
|
|
949
|
+
[ne, Qe.value]
|
|
946
950
|
]),
|
|
947
|
-
V(u).buttons ? (i(), p("div",
|
|
951
|
+
V(u).buttons ? (i(), p("div", ll, [
|
|
948
952
|
N(e.$slots, "buttons")
|
|
949
953
|
])) : b("", !0),
|
|
950
|
-
$.value && V(u).filters ? (i(), p("div",
|
|
954
|
+
$.value && V(u).filters ? (i(), p("div", ol, [
|
|
951
955
|
N(e.$slots, "filters", {
|
|
952
956
|
items: r.value,
|
|
953
957
|
isLoading: d.value
|
|
954
958
|
})
|
|
955
959
|
])) : b("", !0),
|
|
956
|
-
d.value ? (i(), k(
|
|
957
|
-
|
|
960
|
+
d.value ? (i(), k(w, { key: 2 })) : b("", !0),
|
|
961
|
+
ae(D("div", {
|
|
958
962
|
class: "lkt-table",
|
|
959
963
|
"data-sortable": e.sortable
|
|
960
964
|
}, [
|
|
961
965
|
e.itemMode ? (i(), p("div", {
|
|
962
966
|
key: 1,
|
|
963
|
-
class:
|
|
967
|
+
class: _(["lkt-table-items-container", e.itemsContainerClass])
|
|
964
968
|
}, [
|
|
965
|
-
(i(!0), p(M, null, q(r.value, (S, B) => (i(), p("div",
|
|
969
|
+
(i(!0), p(M, null, q(r.value, (S, B) => (i(), p("div", ml, [
|
|
966
970
|
N(e.$slots, "item", {
|
|
967
971
|
item: S,
|
|
968
972
|
index: B,
|
|
@@ -974,12 +978,12 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
974
978
|
doDrop: () => Le(B)
|
|
975
979
|
})
|
|
976
980
|
]))), 256))
|
|
977
|
-
], 2)) : (i(), p("table",
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
e.sortable &&
|
|
981
|
-
e.addNavigation &&
|
|
982
|
-
ke.value ? (i(), p("th",
|
|
981
|
+
], 2)) : (i(), p("table", nl, [
|
|
982
|
+
D("thead", null, [
|
|
983
|
+
D("tr", null, [
|
|
984
|
+
e.sortable && I.value ? (i(), p("th", ul)) : b("", !0),
|
|
985
|
+
e.addNavigation && I.value ? (i(), p("th", il)) : b("", !0),
|
|
986
|
+
ke.value ? (i(), p("th", rl)) : b("", !0),
|
|
983
987
|
(i(!0), p(M, null, q(ie.value, (S) => (i(), p(M, null, [
|
|
984
988
|
de.value.indexOf(S.key) === -1 ? (i(), k(Zt, {
|
|
985
989
|
key: 0,
|
|
@@ -991,11 +995,11 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
991
995
|
onClick: (B) => Ve(S)
|
|
992
996
|
}, null, 8, ["column", "sort-by", "sort-direction", "amount-of-columns", "items", "onClick"])) : b("", !0)
|
|
993
997
|
], 64))), 256)),
|
|
994
|
-
e.canDrop && pe.value &&
|
|
995
|
-
e.canEditButton && fe.value &&
|
|
998
|
+
e.canDrop && pe.value && I.value ? (i(), p("th", sl)) : b("", !0),
|
|
999
|
+
e.canEditButton && fe.value && I.value ? (i(), p("th", dl)) : b("", !0)
|
|
996
1000
|
])
|
|
997
1001
|
]),
|
|
998
|
-
|
|
1002
|
+
D("tbody", {
|
|
999
1003
|
ref: (S) => P.value = S,
|
|
1000
1004
|
id: "lkt-table-body-" + V(ue)
|
|
1001
1005
|
}, [
|
|
@@ -1005,23 +1009,23 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
1005
1009
|
key: Me(S, B),
|
|
1006
1010
|
i: B,
|
|
1007
1011
|
"display-hidden-columns-indicator": ke.value,
|
|
1008
|
-
"is-draggable":
|
|
1012
|
+
"is-draggable": De(S),
|
|
1009
1013
|
sortable: e.sortable,
|
|
1010
1014
|
"visible-columns": ie.value,
|
|
1011
1015
|
"empty-columns": de.value,
|
|
1012
1016
|
"add-navigation": e.addNavigation,
|
|
1013
1017
|
"hidden-is-visible": Se(B),
|
|
1014
1018
|
"latest-row": B + 1 === Ye.value,
|
|
1015
|
-
"can-drop": e.canDrop && pe.value &&
|
|
1019
|
+
"can-drop": e.canDrop && pe.value && I.value,
|
|
1016
1020
|
"drop-confirm": e.dropConfirm,
|
|
1017
1021
|
"drop-resource": e.dropResource,
|
|
1018
1022
|
"drop-text": e.dropText,
|
|
1019
1023
|
"drop-icon": e.dropIcon,
|
|
1020
|
-
"can-edit": e.canEditButton && fe.value &&
|
|
1024
|
+
"can-edit": e.canEditButton && fe.value && I.value,
|
|
1021
1025
|
"edit-text": e.editText,
|
|
1022
1026
|
"edit-icon": e.editIcon,
|
|
1023
1027
|
"edit-link": e.editLink,
|
|
1024
|
-
"edit-mode-enabled":
|
|
1028
|
+
"edit-mode-enabled": I.value,
|
|
1025
1029
|
onClick: Ee,
|
|
1026
1030
|
onShow: Be,
|
|
1027
1031
|
onItemUp: rt,
|
|
@@ -1046,7 +1050,7 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
1046
1050
|
i: B,
|
|
1047
1051
|
"hidden-columns": ce.value,
|
|
1048
1052
|
"hidden-columns-col-span": Ge.value,
|
|
1049
|
-
"is-draggable":
|
|
1053
|
+
"is-draggable": De(S),
|
|
1050
1054
|
sortable: e.sortable,
|
|
1051
1055
|
"visible-columns": ie.value,
|
|
1052
1056
|
"empty-columns": de.value,
|
|
@@ -1065,27 +1069,27 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
1065
1069
|
])
|
|
1066
1070
|
}))
|
|
1067
1071
|
]), 1032, ["modelValue", "onUpdate:modelValue", "i", "hidden-columns", "hidden-columns-col-span", "is-draggable", "sortable", "visible-columns", "empty-columns", "hidden-is-visible"]))), 128)) : b("", !0)
|
|
1068
|
-
], 8,
|
|
1072
|
+
], 8, cl)
|
|
1069
1073
|
]))
|
|
1070
|
-
], 8,
|
|
1071
|
-
[
|
|
1074
|
+
], 8, al), [
|
|
1075
|
+
[ne, !d.value && r.value.length > 0]
|
|
1072
1076
|
]),
|
|
1073
|
-
!d.value && r.value.length === 0 ? (i(), p("div",
|
|
1077
|
+
!d.value && r.value.length === 0 ? (i(), p("div", fl, [
|
|
1074
1078
|
V(u).empty ? N(e.$slots, "empty", { key: 0 }) : ct.value ? (i(), k(z(mt.value), {
|
|
1075
1079
|
key: 1,
|
|
1076
1080
|
message: e.noResultsText
|
|
1077
1081
|
}, null, 8, ["message"])) : e.noResultsText ? (i(), p(M, { key: 2 }, [
|
|
1078
|
-
|
|
1082
|
+
te(G(e.noResultsText), 1)
|
|
1079
1083
|
], 64)) : b("", !0)
|
|
1080
1084
|
])) : b("", !0),
|
|
1081
|
-
re.value || V(u).bottomButtons ? (i(), p("div",
|
|
1085
|
+
re.value || V(u).bottomButtons ? (i(), p("div", pl, [
|
|
1082
1086
|
re.value && r.value.length >= e.requiredItemsForBottomCreate ? (i(), k(Fe, {
|
|
1083
1087
|
key: 0,
|
|
1084
1088
|
disabled: !Re.value || e.createDisabled,
|
|
1085
1089
|
text: e.createText,
|
|
1086
1090
|
icon: e.createIcon,
|
|
1087
1091
|
to: e.createRoute,
|
|
1088
|
-
onClick:
|
|
1092
|
+
onClick: Ie
|
|
1089
1093
|
}, null, 8, ["disabled", "text", "icon", "to"])) : b("", !0),
|
|
1090
1094
|
N(e.$slots, "bottom-buttons")
|
|
1091
1095
|
])) : b("", !0),
|
|
@@ -1109,31 +1113,31 @@ const $l = (l, t, s = !0) => F(new U(l, t).setIsSortable(s)), Al = (l, t, s, n =
|
|
|
1109
1113
|
], 8, _t);
|
|
1110
1114
|
};
|
|
1111
1115
|
}
|
|
1112
|
-
}),
|
|
1116
|
+
}), Gl = {
|
|
1113
1117
|
install: (l) => {
|
|
1114
|
-
l.component("lkt-loader") === void 0 && l.use(bt), l.component("lkt-button") === void 0 && l.use(gt), l.component("lkt-paginator") === void 0 && l.use(Ct), l.component("lkt-field-text") === void 0 && l.use(St), l.component("lkt-field-textarea") === void 0 && l.use(Vt), l.component("lkt-field-select") === void 0 && l.use(Et), l.component("lkt-field-switch") === void 0 && l.use(Bt), l.component("lkt-field-file") === void 0 && l.use(
|
|
1118
|
+
l.component("lkt-loader") === void 0 && l.use(bt), l.component("lkt-button") === void 0 && l.use(gt), l.component("lkt-paginator") === void 0 && l.use(Ct), l.component("lkt-field-text") === void 0 && l.use(St), l.component("lkt-field-textarea") === void 0 && l.use(Vt), l.component("lkt-field-select") === void 0 && l.use(Et), l.component("lkt-field-switch") === void 0 && l.use(Bt), l.component("lkt-field-file") === void 0 && l.use(Tt), l.component("lkt-table") === void 0 && l.component("lkt-table", vl);
|
|
1115
1119
|
}
|
|
1116
|
-
},
|
|
1120
|
+
}, zl = (l) => (R.navButtonSlot = l, !0), Jl = (l) => (R.dropButtonSlot = l, !0), Ql = (l) => (R.createButtonSlot = l, !0), Xl = (l) => {
|
|
1117
1121
|
R.defaultEmptySlot = l;
|
|
1118
1122
|
};
|
|
1119
1123
|
export {
|
|
1120
1124
|
U as LktTableColumn,
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1125
|
+
Al as createActionColumn,
|
|
1126
|
+
Hl as createCheckColumn,
|
|
1127
|
+
Rl as createColumn,
|
|
1128
|
+
Nl as createEmailColumn,
|
|
1129
|
+
ql as createFileColumn,
|
|
1130
|
+
Ol as createFloatColumn,
|
|
1131
|
+
jl as createHiddenColumn,
|
|
1132
|
+
Ul as createIntegerColumn,
|
|
1133
|
+
$l as createLinkColumn,
|
|
1134
|
+
Kl as createSelectColumn,
|
|
1135
|
+
Pl as createSwitchColumn,
|
|
1136
|
+
Wl as createTelColumn,
|
|
1137
|
+
Fl as createTextColumn,
|
|
1138
|
+
Gl as default,
|
|
1139
|
+
Ql as setTableCreateButtonSlot,
|
|
1140
|
+
Jl as setTableDropButtonSlot,
|
|
1141
|
+
Xl as setTableEmptySlot,
|
|
1142
|
+
zl as setTableNavButtonSlot
|
|
1139
1143
|
};
|
package/package.json
CHANGED
|
@@ -40,6 +40,7 @@ const props = withDefaults(defineProps<{
|
|
|
40
40
|
title?: string
|
|
41
41
|
titleTag?: string
|
|
42
42
|
titleIcon?: string
|
|
43
|
+
headerClass?: string
|
|
43
44
|
wrapContentTag?: string
|
|
44
45
|
wrapContentClass?: string
|
|
45
46
|
itemsContainerClass?: string
|
|
@@ -96,6 +97,7 @@ const props = withDefaults(defineProps<{
|
|
|
96
97
|
title: '',
|
|
97
98
|
titleTag: 'h2',
|
|
98
99
|
titleIcon: '',
|
|
100
|
+
headerClass: '',
|
|
99
101
|
wrapContentTag: 'div',
|
|
100
102
|
wrapContentClass: '',
|
|
101
103
|
itemsContainerClass: '',
|
|
@@ -234,7 +236,7 @@ const emptyColumns = computed(() => {
|
|
|
234
236
|
}),
|
|
235
237
|
showEditionButtons = computed(() => {
|
|
236
238
|
// if (hasCreatePerm.value || hasUpdatePerm.value || hasDropPerm.value)
|
|
237
|
-
if (computedDisplayCreateButton.value) return true;
|
|
239
|
+
if (computedDisplayCreateButton.value && Items.value.length >= props.requiredItemsForTopCreate) return true;
|
|
238
240
|
if (props.switchEditionEnabled) return true;
|
|
239
241
|
return showSaveButton.value || (editModeEnabled.value && props.canCreate);
|
|
240
242
|
}),
|
|
@@ -502,7 +504,7 @@ const hasEmptySlot = computed(() => {
|
|
|
502
504
|
|
|
503
505
|
<template>
|
|
504
506
|
<section class="lkt-table-page" :id="'lkt-table-page-' + uniqueId">
|
|
505
|
-
<header v-if="computedTitle || slots.title">
|
|
507
|
+
<header v-if="computedTitle || slots.title" :class="headerClass">
|
|
506
508
|
<component :is="computedTitleTag" v-if="computedTitle">
|
|
507
509
|
<i v-if="titleIcon" :class="titleIcon"/>
|
|
508
510
|
{{ computedTitle }}
|