lkt-table 1.3.7 → 1.3.8
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 +19 -19
- package/dist/build.js +259 -256
- package/package.json +1 -1
- package/src/lib-components/LktTable.vue +3 -1
package/dist/build.d.ts
CHANGED
|
@@ -11,11 +11,11 @@ declare class F {
|
|
|
11
11
|
isForRowKey: boolean;
|
|
12
12
|
extractTitleFromColumn: string;
|
|
13
13
|
slotData: {};
|
|
14
|
-
field:
|
|
14
|
+
field: Oe;
|
|
15
15
|
getHref(r: any): any;
|
|
16
16
|
doAction(r: any): any;
|
|
17
17
|
}
|
|
18
|
-
declare function
|
|
18
|
+
declare function Ll(t: any, r: any, i: any, a?: boolean): {
|
|
19
19
|
key: string;
|
|
20
20
|
label: string;
|
|
21
21
|
sortable: boolean;
|
|
@@ -86,7 +86,7 @@ declare function Rl(t: any, r: any, i: any, a?: boolean): {
|
|
|
86
86
|
getHref: (r: any) => any;
|
|
87
87
|
doAction: (r: any) => any;
|
|
88
88
|
};
|
|
89
|
-
declare function
|
|
89
|
+
declare function Wl(t: any, r: any, i?: boolean): {
|
|
90
90
|
key: string;
|
|
91
91
|
label: string;
|
|
92
92
|
sortable: boolean;
|
|
@@ -157,7 +157,7 @@ declare function Al(t: any, r: any, i?: boolean): {
|
|
|
157
157
|
getHref: (r: any) => any;
|
|
158
158
|
doAction: (r: any) => any;
|
|
159
159
|
};
|
|
160
|
-
declare function
|
|
160
|
+
declare function $l(t: any): {
|
|
161
161
|
key: string;
|
|
162
162
|
label: string;
|
|
163
163
|
sortable: boolean;
|
|
@@ -228,7 +228,7 @@ declare function Tl(t: any): {
|
|
|
228
228
|
getHref: (r: any) => any;
|
|
229
229
|
doAction: (r: any) => any;
|
|
230
230
|
};
|
|
231
|
-
declare function
|
|
231
|
+
declare function Ul(t: any, r: any, i?: boolean): {
|
|
232
232
|
key: string;
|
|
233
233
|
label: string;
|
|
234
234
|
sortable: boolean;
|
|
@@ -299,7 +299,7 @@ declare function Nl(t: any, r: any, i?: boolean): {
|
|
|
299
299
|
getHref: (r: any) => any;
|
|
300
300
|
doAction: (r: any) => any;
|
|
301
301
|
};
|
|
302
|
-
declare function
|
|
302
|
+
declare function Pl(t: any, r: any, i?: boolean): {
|
|
303
303
|
key: string;
|
|
304
304
|
label: string;
|
|
305
305
|
sortable: boolean;
|
|
@@ -370,7 +370,7 @@ declare function Hl(t: any, r: any, i?: boolean): {
|
|
|
370
370
|
getHref: (r: any) => any;
|
|
371
371
|
doAction: (r: any) => any;
|
|
372
372
|
};
|
|
373
|
-
declare function
|
|
373
|
+
declare function Nl(t: any, r: any, i?: boolean): {
|
|
374
374
|
key: string;
|
|
375
375
|
label: string;
|
|
376
376
|
sortable: boolean;
|
|
@@ -441,7 +441,7 @@ declare function Fl(t: any, r: any, i?: boolean): {
|
|
|
441
441
|
getHref: (r: any) => any;
|
|
442
442
|
doAction: (r: any) => any;
|
|
443
443
|
};
|
|
444
|
-
declare function
|
|
444
|
+
declare function ql(t: any, r: any, i?: boolean): {
|
|
445
445
|
key: string;
|
|
446
446
|
label: string;
|
|
447
447
|
sortable: boolean;
|
|
@@ -512,7 +512,7 @@ declare function Pl(t: any, r: any, i?: boolean): {
|
|
|
512
512
|
getHref: (r: any) => any;
|
|
513
513
|
doAction: (r: any) => any;
|
|
514
514
|
};
|
|
515
|
-
declare function
|
|
515
|
+
declare function Fl(t: any, r: any, i?: boolean): {
|
|
516
516
|
key: string;
|
|
517
517
|
label: string;
|
|
518
518
|
sortable: boolean;
|
|
@@ -583,7 +583,7 @@ declare function Ml(t: any, r: any, i?: boolean): {
|
|
|
583
583
|
getHref: (r: any) => any;
|
|
584
584
|
doAction: (r: any) => any;
|
|
585
585
|
};
|
|
586
|
-
declare function
|
|
586
|
+
declare function Rl(t: any, r: any, i: any, a?: boolean): {
|
|
587
587
|
key: string;
|
|
588
588
|
label: string;
|
|
589
589
|
sortable: boolean;
|
|
@@ -725,7 +725,7 @@ declare function Kl(t: any, r: any, i: any, a?: boolean): {
|
|
|
725
725
|
getHref: (r: any) => any;
|
|
726
726
|
doAction: (r: any) => any;
|
|
727
727
|
};
|
|
728
|
-
declare function
|
|
728
|
+
declare function Hl(t: any, r: any, i?: boolean): {
|
|
729
729
|
key: string;
|
|
730
730
|
label: string;
|
|
731
731
|
sortable: boolean;
|
|
@@ -796,7 +796,7 @@ declare function Wl(t: any, r: any, i?: boolean): {
|
|
|
796
796
|
getHref: (r: any) => any;
|
|
797
797
|
doAction: (r: any) => any;
|
|
798
798
|
};
|
|
799
|
-
declare function
|
|
799
|
+
declare function Al(t: any, r: any, i?: boolean): {
|
|
800
800
|
key: string;
|
|
801
801
|
label: string;
|
|
802
802
|
sortable: boolean;
|
|
@@ -867,7 +867,7 @@ declare function Ul(t: any, r: any, i?: boolean): {
|
|
|
867
867
|
getHref: (r: any) => any;
|
|
868
868
|
doAction: (r: any) => any;
|
|
869
869
|
};
|
|
870
|
-
declare function
|
|
870
|
+
declare function Ml(t: any, r: any, i?: boolean): {
|
|
871
871
|
key: string;
|
|
872
872
|
label: string;
|
|
873
873
|
sortable: boolean;
|
|
@@ -938,13 +938,13 @@ declare function Ll(t: any, r: any, i?: boolean): {
|
|
|
938
938
|
getHref: (r: any) => any;
|
|
939
939
|
doAction: (r: any) => any;
|
|
940
940
|
};
|
|
941
|
-
declare namespace
|
|
941
|
+
declare namespace jl {
|
|
942
942
|
function install(t: any): void;
|
|
943
943
|
}
|
|
944
|
+
declare function Jl(t: any): boolean;
|
|
944
945
|
declare function Gl(t: any): boolean;
|
|
945
|
-
declare function zl(t: any): boolean;
|
|
946
|
-
declare function Jl(t: any): void;
|
|
947
|
-
declare function jl(t: any): boolean;
|
|
948
946
|
declare function Ol(t: any): void;
|
|
949
|
-
|
|
950
|
-
|
|
947
|
+
declare function zl(t: any): boolean;
|
|
948
|
+
declare function Ql(t: any): void;
|
|
949
|
+
import { Field as Oe } from "lkt-field";
|
|
950
|
+
export { F as Column, Ll as createActionColumn, Wl as createCheckColumn, $l as createColumn, Ul as createEmailColumn, Pl as createFileColumn, Nl as createFloatColumn, ql as createHiddenColumn, Fl as createIntegerColumn, Rl as createLinkColumn, Kl as createSelectColumn, Hl as createSwitchColumn, Al as createTelColumn, Ml as createTextColumn, jl as default, Jl as setTableCreateButtonSlot, Gl as setTableDropButtonSlot, Ol as setTableEmptySlot, zl as setTableNavButtonSlot, Ql as setTableSaveIcon };
|
package/dist/build.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { reactive as A, defineComponent as _, ref as h, watch as L, computed as c, resolveComponent as
|
|
2
|
-
import { Field as
|
|
1
|
+
import { reactive as A, defineComponent as _, ref as h, watch as L, computed as c, resolveComponent as P, unref as C, openBlock as u, createBlock as w, withCtx as H, createTextVNode as re, toDisplayString as Y, createElementBlock as s, mergeProps as Et, Fragment as V, withModifiers as Ye, resolveDynamicComponent as Z, createCommentVNode as v, normalizeClass as Q, createElementVNode as M, createVNode as ne, renderList as W, renderSlot as U, withDirectives as ae, vShow as oe, useSlots as Tt, onMounted as $t, nextTick as Ge, createSlots as Je, normalizeProps as ce } from "vue";
|
|
2
|
+
import { Field as Oe } from "lkt-field";
|
|
3
3
|
import { __ as pe } from "lkt-i18n";
|
|
4
|
-
import { replaceAll as
|
|
5
|
-
import { DataState as
|
|
6
|
-
import
|
|
7
|
-
import { time as
|
|
4
|
+
import { replaceAll as Ze, generateRandomString as Rt } from "lkt-string-tools";
|
|
5
|
+
import { DataState as Lt } from "lkt-data-state";
|
|
6
|
+
import Mt from "sortablejs";
|
|
7
|
+
import { time as Se } from "lkt-date-tools";
|
|
8
8
|
class F {
|
|
9
9
|
constructor(r = {}) {
|
|
10
|
-
this.key = "", this.label = "", this.sortable = !0, this.hidden = !1, this.editable = !1, this.formatter = void 0, this.checkEmpty = void 0, this.colspan = void 0, this.preferSlot = !0, this.type = "", this.link = "", this.action = void 0, this.isForRowKey = !1, this.extractTitleFromColumn = "", this.slotData = {}, this.field = new
|
|
10
|
+
this.key = "", this.label = "", this.sortable = !0, this.hidden = !1, this.editable = !1, this.formatter = void 0, this.checkEmpty = void 0, this.colspan = void 0, this.preferSlot = !0, this.type = "", this.link = "", this.action = void 0, this.isForRowKey = !1, this.extractTitleFromColumn = "", this.slotData = {}, this.field = new Oe();
|
|
11
11
|
for (let i in r)
|
|
12
12
|
this[i] = r[i];
|
|
13
|
-
this.field = new
|
|
13
|
+
this.field = new Oe(this.field);
|
|
14
14
|
}
|
|
15
15
|
getHref(r) {
|
|
16
16
|
return typeof this.link == "function" ? this.link(r) : this.link;
|
|
@@ -22,7 +22,7 @@ class F {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
var $ = /* @__PURE__ */ ((t) => (t.Text = "text", t.Number = "number", t.Check = "check", t.Switch = "switch", t.Select = "select", t.Email = "email", t.Tel = "tel", t.File = "file", t.Link = "link", t.Action = "action", t.Integer = "int", t.Float = "float", t))($ || {});
|
|
25
|
-
const
|
|
25
|
+
const $l = (t) => A(new F(t)), Rl = (t, r, i, a = !0) => A(new F({ key: t, label: r, sortable: a, type: $.Link, link: i })), Ll = (t, r, i, a = !0) => A(new F({ key: t, label: r, sortable: a, type: $.Action, action: i })), Ml = (t, r, i = !0) => A(new F({ key: t, label: r, type: $.Text, sortable: i })), Fl = (t, r, i = !0) => A(new F({ key: t, label: r, type: $.Number, sortable: i })), Nl = (t, r, i = !0) => A(new F({ key: t, label: r, type: $.Number, sortable: i })), Ul = (t, r, i = !0) => A(new F({ key: t, label: r, type: $.Email, sortable: i })), Al = (t, r, i = !0) => A(new F({ key: t, label: r, type: $.Tel, sortable: i })), Wl = (t, r, i = !0) => A(new F({ key: t, label: r, type: $.Check, sortable: i })), Hl = (t, r, i = !0) => A(new F({ key: t, label: r, type: $.Switch, sortable: i })), Kl = (t, r, i, a = !0) => A(new F({ key: t, label: r, type: $.Select, sortable: a })), Pl = (t, r, i = !0) => A(new F({ key: t, label: r, type: $.File, sortable: i })), ql = (t, r, i = !0) => A(new F({ key: t, label: r, sortable: i, hidden: !0 })), Qe = (t, r, i, a) => {
|
|
26
26
|
if (!i) return 0;
|
|
27
27
|
let n = t[i.key], l = r[i.key];
|
|
28
28
|
if (a === "asc") {
|
|
@@ -44,30 +44,30 @@ const Tl = (t) => A(new F(t)), $l = (t, r, i, a = !0) => A(new F({ key: t, label
|
|
|
44
44
|
return n.startsWith("__:") ? pe(n.substring(3)) : n;
|
|
45
45
|
}
|
|
46
46
|
return r[t.key];
|
|
47
|
-
},
|
|
47
|
+
}, Ft = (t, r, i) => {
|
|
48
48
|
if (!t.colspan) return -1;
|
|
49
49
|
let a = r;
|
|
50
50
|
return i.forEach((n) => {
|
|
51
|
-
let l =
|
|
51
|
+
let l = Ie(t, n);
|
|
52
52
|
l > 0 && l < a && (a = l);
|
|
53
53
|
}), a;
|
|
54
|
-
},
|
|
54
|
+
}, Ie = (t, r) => t.colspan === !1 ? !1 : typeof t.colspan == "function" ? t.colspan(r) : t.colspan, Nt = (t, r) => typeof t.preferSlot > "u" ? !0 : t.preferSlot === !1 ? !1 : typeof t.preferSlot == "function" ? t.preferSlot(r) : !0, Ut = (t, r, i) => {
|
|
55
55
|
if (typeof t != "object" || !t.key || r.indexOf(t.key) > -1) return !1;
|
|
56
|
-
let a =
|
|
56
|
+
let a = Ie(t, i);
|
|
57
57
|
return typeof t.colspan > "u" ? !0 : (typeof t.colspan < "u" && (typeof t.colspan == "function" ? a = parseInt(t.colspan(i)) : a = parseInt(t.colspan)), a > 0);
|
|
58
|
-
},
|
|
58
|
+
}, At = (t = []) => {
|
|
59
59
|
if (t.length > 0) {
|
|
60
60
|
for (let r = 0; r < t.length; ++r)
|
|
61
61
|
if (t[r].sortable) return t[r].key;
|
|
62
62
|
}
|
|
63
63
|
return "";
|
|
64
|
-
},
|
|
64
|
+
}, Wt = (t, r) => {
|
|
65
65
|
if (t.length > 0) {
|
|
66
66
|
for (let i = 0; i < t.length; ++i)
|
|
67
67
|
if (t[i].key === r) return t[i];
|
|
68
68
|
}
|
|
69
69
|
return null;
|
|
70
|
-
},
|
|
70
|
+
}, _e = /* @__PURE__ */ _({
|
|
71
71
|
__name: "LktTableCell",
|
|
72
72
|
props: {
|
|
73
73
|
modelValue: { default: () => ({}) },
|
|
@@ -90,8 +90,8 @@ const Tl = (t) => A(new F(t)), $l = (t, r, i, a = !0) => A(new F({ key: t, label
|
|
|
90
90
|
if ((m = a.column.field) != null && m.modalData && typeof ((o = a.column.field) == null ? void 0 : o.modalData) == "object")
|
|
91
91
|
for (let y in a.column.field.modalData)
|
|
92
92
|
if (typeof ((p = a.column.field) == null ? void 0 : p.modalData[y]) == "string" && a.column.field.modalData[y].startsWith("prop:")) {
|
|
93
|
-
let
|
|
94
|
-
n.value[
|
|
93
|
+
let z = a.column.field.modalData[y].substring(5);
|
|
94
|
+
n.value[z];
|
|
95
95
|
} else
|
|
96
96
|
a.column.field.modalData[y];
|
|
97
97
|
return (b = a.column.field) == null ? void 0 : b.modalData;
|
|
@@ -109,7 +109,7 @@ const Tl = (t) => A(new F(t)), $l = (t, r, i, a = !0) => A(new F({ key: t, label
|
|
|
109
109
|
return n.value[y];
|
|
110
110
|
}
|
|
111
111
|
return (b = a.column.field) == null ? void 0 : b.icon;
|
|
112
|
-
}),
|
|
112
|
+
}), j = c(() => {
|
|
113
113
|
var m, o, p, b;
|
|
114
114
|
if (typeof ((m = a.column.field) == null ? void 0 : m.download) == "string" && ((o = a.column.field) != null && o.download.startsWith("prop:"))) {
|
|
115
115
|
let y = (p = a.column.field) == null ? void 0 : p.download.substring(5);
|
|
@@ -123,14 +123,14 @@ const Tl = (t) => A(new F(t)), $l = (t, r, i, a = !0) => A(new F({ key: t, label
|
|
|
123
123
|
return n.value[b];
|
|
124
124
|
}
|
|
125
125
|
return a.column.field.options;
|
|
126
|
-
}),
|
|
126
|
+
}), K = c(() => [$.Integer, $.Float].includes(a.column.type) ? $.Number : a.column.type);
|
|
127
127
|
return (m, o) => {
|
|
128
|
-
const p =
|
|
128
|
+
const p = P("lkt-anchor"), b = P("lkt-field");
|
|
129
129
|
return m.column.type === C($).Link ? (u(), w(p, {
|
|
130
130
|
key: 0,
|
|
131
131
|
to: m.column.getHref(n.value)
|
|
132
132
|
}, {
|
|
133
|
-
default:
|
|
133
|
+
default: H(() => [
|
|
134
134
|
re(Y(C(ue)(m.column, n.value, m.i)), 1)
|
|
135
135
|
]),
|
|
136
136
|
_: 1
|
|
@@ -138,10 +138,10 @@ const Tl = (t) => A(new F(t)), $l = (t, r, i, a = !0) => A(new F({ key: t, label
|
|
|
138
138
|
key: 1,
|
|
139
139
|
href: "#",
|
|
140
140
|
onClick: o[0] || (o[0] = (y) => m.column.doAction(n.value))
|
|
141
|
-
}, Y(C(ue)(m.column, n.value, m.i)), 1)) : m.column.type !== "" ? (u(), w(b,
|
|
141
|
+
}, Y(C(ue)(m.column, n.value, m.i)), 1)) : m.column.type !== "" ? (u(), w(b, Et({ key: 2 }, m.column.field, {
|
|
142
142
|
icon: d.value,
|
|
143
|
-
download:
|
|
144
|
-
type:
|
|
143
|
+
download: j.value,
|
|
144
|
+
type: K.value,
|
|
145
145
|
"read-mode": !m.column.editable || !m.editModeEnabled,
|
|
146
146
|
ref: (y) => k.value = y,
|
|
147
147
|
"slot-data": E.value,
|
|
@@ -160,7 +160,7 @@ const Tl = (t) => A(new F(t)), $l = (t, r, i, a = !0) => A(new F({ key: t, label
|
|
|
160
160
|
};
|
|
161
161
|
X.navButtonSlot = "", X.dropButtonSlot = "", X.editButtonSlot = "", X.createButtonSlot = "", X.defaultEmptySlot = void 0, X.defaultSaveIcon = "";
|
|
162
162
|
let I = X;
|
|
163
|
-
const
|
|
163
|
+
const Ht = /* @__PURE__ */ _({
|
|
164
164
|
__name: "DropButton",
|
|
165
165
|
props: {
|
|
166
166
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -174,7 +174,7 @@ const Wt = /* @__PURE__ */ _({
|
|
|
174
174
|
setup(t, { emit: r }) {
|
|
175
175
|
const i = r, a = c(() => I.dropButtonSlot !== ""), n = c(() => I.dropButtonSlot);
|
|
176
176
|
return (l, k) => {
|
|
177
|
-
const E =
|
|
177
|
+
const E = P("lkt-button");
|
|
178
178
|
return u(), w(E, {
|
|
179
179
|
palette: "table-delete",
|
|
180
180
|
icon: a.value ? "" : l.icon,
|
|
@@ -183,9 +183,9 @@ const Wt = /* @__PURE__ */ _({
|
|
|
183
183
|
"resource-data": l.resourceData,
|
|
184
184
|
"confirm-modal": l.confirm,
|
|
185
185
|
disabled: l.disabled,
|
|
186
|
-
onClick: k[0] || (k[0] =
|
|
186
|
+
onClick: k[0] || (k[0] = Ye((g) => i("click"), ["prevent", "stop"]))
|
|
187
187
|
}, {
|
|
188
|
-
default:
|
|
188
|
+
default: H(() => [
|
|
189
189
|
a.value ? (u(), w(Z(n.value), { key: 0 })) : v("", !0)
|
|
190
190
|
]),
|
|
191
191
|
_: 1
|
|
@@ -207,7 +207,7 @@ const Wt = /* @__PURE__ */ _({
|
|
|
207
207
|
setup(t, { emit: r }) {
|
|
208
208
|
const i = r, a = c(() => I.editButtonSlot !== ""), n = c(() => I.editButtonSlot);
|
|
209
209
|
return (l, k) => {
|
|
210
|
-
const E =
|
|
210
|
+
const E = P("lkt-button");
|
|
211
211
|
return u(), w(E, {
|
|
212
212
|
palette: "table-delete",
|
|
213
213
|
icon: a.value ? "" : l.icon,
|
|
@@ -218,28 +218,28 @@ const Wt = /* @__PURE__ */ _({
|
|
|
218
218
|
"resource-data": l.resourceData,
|
|
219
219
|
"confirm-modal": l.confirm,
|
|
220
220
|
disabled: l.disabled,
|
|
221
|
-
onClick: k[0] || (k[0] =
|
|
221
|
+
onClick: k[0] || (k[0] = Ye((g) => i("click"), ["prevent", "stop"]))
|
|
222
222
|
}, {
|
|
223
|
-
default:
|
|
223
|
+
default: H(() => [
|
|
224
224
|
a.value ? (u(), w(Z(n.value), { key: 0 })) : v("", !0)
|
|
225
225
|
]),
|
|
226
226
|
_: 1
|
|
227
227
|
}, 8, ["icon", "text", "on-click-to", "is-anchor", "resource", "resource-data", "confirm-modal", "disabled"]);
|
|
228
228
|
};
|
|
229
229
|
}
|
|
230
|
-
}),
|
|
230
|
+
}), Pt = ["data-i", "data-draggable"], qt = {
|
|
231
231
|
key: 1,
|
|
232
232
|
"data-role": "invalid-drag-indicator"
|
|
233
|
-
},
|
|
233
|
+
}, jt = {
|
|
234
234
|
key: 2,
|
|
235
235
|
class: "lkt-table-nav-cell"
|
|
236
|
-
},
|
|
236
|
+
}, zt = { class: "lkt-table-nav-container" }, Gt = ["data-column", "colspan", "title", "onClick"], Jt = {
|
|
237
237
|
key: 4,
|
|
238
238
|
class: "lkt-table-col-drop"
|
|
239
|
-
},
|
|
239
|
+
}, Ot = {
|
|
240
240
|
key: 5,
|
|
241
241
|
class: "lkt-table-col-edit"
|
|
242
|
-
},
|
|
242
|
+
}, Qt = /* @__PURE__ */ _({
|
|
243
243
|
__name: "LktTableRow",
|
|
244
244
|
props: {
|
|
245
245
|
modelValue: { default: () => ({}) },
|
|
@@ -266,24 +266,24 @@ const Wt = /* @__PURE__ */ _({
|
|
|
266
266
|
emits: ["update:modelValue", "click", "show", "item-up", "item-down", "item-drop"],
|
|
267
267
|
setup(t, { emit: r }) {
|
|
268
268
|
const i = r, a = t, n = h(a.modelValue), l = h(a.editLink);
|
|
269
|
-
for (let o in n.value) l.value =
|
|
269
|
+
for (let o in n.value) l.value = Ze(l.value, ":" + o, n.value[o]);
|
|
270
270
|
const k = (o) => i("click", o), E = (o, p) => {
|
|
271
271
|
i("show", o, p);
|
|
272
272
|
}, g = c(() => {
|
|
273
273
|
let o = [];
|
|
274
274
|
return a.sortable && a.isDraggable && o.push("handle"), o.join(" ");
|
|
275
|
-
}), R = c(() => I.navButtonSlot !== ""), d = c(() => I.navButtonSlot),
|
|
275
|
+
}), R = c(() => I.navButtonSlot !== ""), d = c(() => I.navButtonSlot), j = () => {
|
|
276
276
|
i("item-up", a.i);
|
|
277
277
|
}, ee = () => {
|
|
278
278
|
i("item-down", a.i);
|
|
279
|
-
},
|
|
279
|
+
}, K = () => {
|
|
280
280
|
i("item-drop", a.i);
|
|
281
281
|
}, m = () => {
|
|
282
282
|
};
|
|
283
283
|
return L(() => a.modelValue, (o) => n.value = o), L(n, (o) => {
|
|
284
284
|
i("update:modelValue", o, a.i);
|
|
285
285
|
}, { deep: !0 }), (o, p) => {
|
|
286
|
-
const b =
|
|
286
|
+
const b = P("lkt-button");
|
|
287
287
|
return u(), s("tr", {
|
|
288
288
|
"data-i": o.i,
|
|
289
289
|
"data-draggable": o.isDraggable
|
|
@@ -292,15 +292,15 @@ const Wt = /* @__PURE__ */ _({
|
|
|
292
292
|
key: 0,
|
|
293
293
|
"data-role": "drag-indicator",
|
|
294
294
|
class: Q(g.value)
|
|
295
|
-
}, null, 2)) : o.sortable && o.editModeEnabled ? (u(), s("td",
|
|
296
|
-
o.addNavigation && o.editModeEnabled ? (u(), s("td",
|
|
297
|
-
M("div",
|
|
295
|
+
}, null, 2)) : o.sortable && o.editModeEnabled ? (u(), s("td", qt)) : v("", !0),
|
|
296
|
+
o.addNavigation && o.editModeEnabled ? (u(), s("td", jt, [
|
|
297
|
+
M("div", zt, [
|
|
298
298
|
ne(b, {
|
|
299
299
|
palette: "table-nav",
|
|
300
300
|
disabled: o.i === 0,
|
|
301
|
-
onClick:
|
|
301
|
+
onClick: j
|
|
302
302
|
}, {
|
|
303
|
-
default:
|
|
303
|
+
default: H(() => [
|
|
304
304
|
R.value ? (u(), w(Z(d.value), {
|
|
305
305
|
key: 0,
|
|
306
306
|
direction: "up"
|
|
@@ -316,7 +316,7 @@ const Wt = /* @__PURE__ */ _({
|
|
|
316
316
|
disabled: o.latestRow,
|
|
317
317
|
onClick: ee
|
|
318
318
|
}, {
|
|
319
|
-
default:
|
|
319
|
+
default: H(() => [
|
|
320
320
|
R.value ? (u(), w(Z(d.value), {
|
|
321
321
|
key: 0,
|
|
322
322
|
direction: "down"
|
|
@@ -336,41 +336,41 @@ const Wt = /* @__PURE__ */ _({
|
|
|
336
336
|
class: Q(o.hiddenIsVisible ? "state-open" : "")
|
|
337
337
|
}, null, 2)) : v("", !0),
|
|
338
338
|
(u(!0), s(V, null, W(o.visibleColumns, (y) => (u(), s(V, null, [
|
|
339
|
-
C(
|
|
339
|
+
C(Ut)(y, o.emptyColumns, n.value) ? (u(), s("td", {
|
|
340
340
|
key: "td" + o.i,
|
|
341
341
|
"data-column": y.key,
|
|
342
|
-
colspan: C(
|
|
342
|
+
colspan: C(Ie)(y, n.value),
|
|
343
343
|
title: C(ue)(y, n.value, o.i, o.visibleColumns),
|
|
344
|
-
onClick: (
|
|
344
|
+
onClick: (z) => k(z, n.value)
|
|
345
345
|
}, [
|
|
346
|
-
o.$slots[y.key] && C(
|
|
346
|
+
o.$slots[y.key] && C(Nt)(y, n.value) ? U(o.$slots, y.key, {
|
|
347
347
|
key: 0,
|
|
348
348
|
value: n.value[y.key],
|
|
349
349
|
item: n.value,
|
|
350
350
|
column: y,
|
|
351
351
|
i: o.i
|
|
352
|
-
}) : n.value ? (u(), w(
|
|
352
|
+
}) : n.value ? (u(), w(_e, {
|
|
353
353
|
key: 1,
|
|
354
354
|
modelValue: n.value,
|
|
355
|
-
"onUpdate:modelValue": p[1] || (p[1] = (
|
|
355
|
+
"onUpdate:modelValue": p[1] || (p[1] = (z) => n.value = z),
|
|
356
356
|
column: y,
|
|
357
357
|
columns: o.visibleColumns,
|
|
358
358
|
"edit-mode-enabled": o.editModeEnabled,
|
|
359
359
|
i: o.i
|
|
360
360
|
}, null, 8, ["modelValue", "column", "columns", "edit-mode-enabled", "i"])) : v("", !0)
|
|
361
|
-
], 8,
|
|
361
|
+
], 8, Gt)) : v("", !0)
|
|
362
362
|
], 64))), 256)),
|
|
363
|
-
o.canDrop && o.editModeEnabled ? (u(), s("td",
|
|
364
|
-
ne(
|
|
363
|
+
o.canDrop && o.editModeEnabled ? (u(), s("td", Jt, [
|
|
364
|
+
ne(Ht, {
|
|
365
365
|
resource: o.dropResource,
|
|
366
366
|
"resource-data": n.value,
|
|
367
367
|
confirm: o.dropConfirm,
|
|
368
368
|
text: o.dropText,
|
|
369
369
|
icon: o.dropIcon,
|
|
370
|
-
onClick:
|
|
370
|
+
onClick: K
|
|
371
371
|
}, null, 8, ["resource", "resource-data", "confirm", "text", "icon"])
|
|
372
372
|
])) : v("", !0),
|
|
373
|
-
o.canEdit && o.editModeEnabled ? (u(), s("td",
|
|
373
|
+
o.canEdit && o.editModeEnabled ? (u(), s("td", Ot, [
|
|
374
374
|
ne(Kt, {
|
|
375
375
|
"resource-data": n.value,
|
|
376
376
|
text: o.editText,
|
|
@@ -379,10 +379,10 @@ const Wt = /* @__PURE__ */ _({
|
|
|
379
379
|
onClick: m
|
|
380
380
|
}, null, 8, ["resource-data", "text", "icon", "link"])
|
|
381
381
|
])) : v("", !0)
|
|
382
|
-
], 8,
|
|
382
|
+
], 8, Pt);
|
|
383
383
|
};
|
|
384
384
|
}
|
|
385
|
-
}),
|
|
385
|
+
}), Xt = { "data-role": "hidden-row" }, Yt = ["colspan"], Zt = ["data-column"], _t = ["data-i"], xt = ["data-column", "title", "onClick"], el = /* @__PURE__ */ _({
|
|
386
386
|
__name: "LktHiddenRow",
|
|
387
387
|
props: {
|
|
388
388
|
modelValue: { default: () => ({}) },
|
|
@@ -398,7 +398,7 @@ const Wt = /* @__PURE__ */ _({
|
|
|
398
398
|
emits: ["update:modelValue", "click"],
|
|
399
399
|
setup(t, { emit: r }) {
|
|
400
400
|
const i = r, a = t, n = h(a.modelValue), l = (k) => i("click", k);
|
|
401
|
-
return L(() => a.modelValue, (k) => n.value = k), L(n, () => i("update:modelValue", n.value)), (k, E) => ae((u(), s("tr",
|
|
401
|
+
return L(() => a.modelValue, (k) => n.value = k), L(n, () => i("update:modelValue", n.value)), (k, E) => ae((u(), s("tr", Xt, [
|
|
402
402
|
M("td", { colspan: k.hiddenColumnsColSpan }, [
|
|
403
403
|
M("table", null, [
|
|
404
404
|
M("tr", null, [
|
|
@@ -406,7 +406,7 @@ const Wt = /* @__PURE__ */ _({
|
|
|
406
406
|
"data-column": g.key
|
|
407
407
|
}, [
|
|
408
408
|
M("div", null, Y(g.label), 1)
|
|
409
|
-
], 8,
|
|
409
|
+
], 8, Zt))), 256))
|
|
410
410
|
]),
|
|
411
411
|
M("tr", { "data-i": k.i }, [
|
|
412
412
|
(u(!0), s(V, null, W(k.hiddenColumns, (g, R) => (u(), s("td", {
|
|
@@ -420,7 +420,7 @@ const Wt = /* @__PURE__ */ _({
|
|
|
420
420
|
item: n.value,
|
|
421
421
|
column: g,
|
|
422
422
|
i: R
|
|
423
|
-
}) : (u(), w(
|
|
423
|
+
}) : (u(), w(_e, {
|
|
424
424
|
key: 1,
|
|
425
425
|
column: g,
|
|
426
426
|
columns: k.hiddenColumns,
|
|
@@ -428,15 +428,15 @@ const Wt = /* @__PURE__ */ _({
|
|
|
428
428
|
"onUpdate:modelValue": E[0] || (E[0] = (d) => n.value = d),
|
|
429
429
|
i: R
|
|
430
430
|
}, null, 8, ["column", "columns", "modelValue", "i"]))
|
|
431
|
-
], 8,
|
|
432
|
-
], 8,
|
|
431
|
+
], 8, xt))), 256))
|
|
432
|
+
], 8, _t)
|
|
433
433
|
])
|
|
434
|
-
], 8,
|
|
434
|
+
], 8, Yt)
|
|
435
435
|
], 512)), [
|
|
436
436
|
[oe, k.hiddenIsVisible]
|
|
437
437
|
]);
|
|
438
438
|
}
|
|
439
|
-
}),
|
|
439
|
+
}), Xe = /* @__PURE__ */ _({
|
|
440
440
|
__name: "CreateButton",
|
|
441
441
|
props: {
|
|
442
442
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -448,7 +448,7 @@ const Wt = /* @__PURE__ */ _({
|
|
|
448
448
|
setup(t, { emit: r }) {
|
|
449
449
|
const i = r, a = c(() => I.createButtonSlot !== ""), n = c(() => I.createButtonSlot);
|
|
450
450
|
return (l, k) => {
|
|
451
|
-
const E =
|
|
451
|
+
const E = P("lkt-button");
|
|
452
452
|
return u(), w(E, {
|
|
453
453
|
palette: "table-create",
|
|
454
454
|
disabled: l.disabled,
|
|
@@ -457,14 +457,14 @@ const Wt = /* @__PURE__ */ _({
|
|
|
457
457
|
"on-click-to": l.to,
|
|
458
458
|
onClick: k[0] || (k[0] = (g) => i("click"))
|
|
459
459
|
}, {
|
|
460
|
-
default:
|
|
460
|
+
default: H(() => [
|
|
461
461
|
a.value ? (u(), w(Z(n.value), { key: 0 })) : v("", !0)
|
|
462
462
|
]),
|
|
463
463
|
_: 1
|
|
464
464
|
}, 8, ["disabled", "icon", "text", "on-click-to"]);
|
|
465
465
|
};
|
|
466
466
|
}
|
|
467
|
-
}),
|
|
467
|
+
}), tl = ["data-column", "data-sortable", "data-sort", "colspan", "title"], ll = /* @__PURE__ */ _({
|
|
468
468
|
__name: "TableHeader",
|
|
469
469
|
props: {
|
|
470
470
|
column: { default: () => ({}) },
|
|
@@ -475,7 +475,7 @@ const Wt = /* @__PURE__ */ _({
|
|
|
475
475
|
},
|
|
476
476
|
emits: ["click"],
|
|
477
477
|
setup(t, { emit: r }) {
|
|
478
|
-
const i = r, a = t, n = c(() =>
|
|
478
|
+
const i = r, a = t, n = c(() => Ft(a.column, a.amountOfColumns, a.items)), l = c(() => a.column.sortable === !0), k = c(() => l.value && a.sortBy === a.column.key ? a.sortDirection : ""), E = c(() => a.column.label.startsWith("__:") ? pe(a.column.label.substring(3)) : a.column.label), g = () => i("click", a.column);
|
|
479
479
|
return (R, d) => (u(), s("th", {
|
|
480
480
|
"data-column": R.column.key,
|
|
481
481
|
"data-sortable": l.value,
|
|
@@ -485,47 +485,47 @@ const Wt = /* @__PURE__ */ _({
|
|
|
485
485
|
onClick: g
|
|
486
486
|
}, [
|
|
487
487
|
M("div", null, Y(E.value), 1)
|
|
488
|
-
], 8,
|
|
488
|
+
], 8, tl));
|
|
489
489
|
}
|
|
490
490
|
});
|
|
491
491
|
var O = /* @__PURE__ */ ((t) => (t.Table = "table", t.Item = "item", t.Ul = "ul", t.Ol = "ol", t))(O || {}), fe = /* @__PURE__ */ ((t) => (t.Create = "create", t.Update = "update", t.Edit = "edit", t.Drop = "drop", t.Sort = "sort", t))(fe || {}), me = /* @__PURE__ */ ((t) => (t.Asc = "asc", t.Desc = "desc", t))(me || {});
|
|
492
|
-
const
|
|
492
|
+
const al = ["id"], ol = { class: "lkt-table-page-buttons" }, nl = { key: 1 }, ul = { class: "switch-edition-mode" }, rl = {
|
|
493
493
|
key: 0,
|
|
494
494
|
class: "lkt-table-page-buttons"
|
|
495
|
-
},
|
|
495
|
+
}, il = {
|
|
496
496
|
key: 1,
|
|
497
497
|
class: "lkt-table-page-filters"
|
|
498
|
-
},
|
|
498
|
+
}, sl = ["data-sortable"], dl = { key: 0 }, cl = {
|
|
499
499
|
key: 0,
|
|
500
500
|
"data-role": "drag-indicator"
|
|
501
|
-
},
|
|
501
|
+
}, fl = { key: 1 }, ml = { key: 2 }, pl = {
|
|
502
502
|
key: 3,
|
|
503
503
|
class: "lkt-table-col-drop"
|
|
504
|
-
},
|
|
504
|
+
}, vl = {
|
|
505
505
|
key: 4,
|
|
506
506
|
class: "lkt-table-col-edit"
|
|
507
|
-
},
|
|
508
|
-
key: 0,
|
|
509
|
-
class: "lkt-table-item"
|
|
510
|
-
}, yl = {
|
|
507
|
+
}, kl = ["id"], yl = {
|
|
511
508
|
key: 0,
|
|
512
509
|
class: "lkt-table-item"
|
|
513
510
|
}, bl = {
|
|
514
511
|
key: 0,
|
|
515
512
|
class: "lkt-table-item"
|
|
516
513
|
}, hl = {
|
|
514
|
+
key: 0,
|
|
515
|
+
class: "lkt-table-item"
|
|
516
|
+
}, gl = {
|
|
517
517
|
key: 3,
|
|
518
518
|
class: "lkt-table-empty"
|
|
519
|
-
},
|
|
519
|
+
}, Cl = {
|
|
520
520
|
key: 4,
|
|
521
521
|
class: "lkt-table-page-buttons lkt-table-page-buttons-bottom"
|
|
522
|
-
},
|
|
522
|
+
}, Sl = /* @__PURE__ */ _({
|
|
523
523
|
__name: "LktTable",
|
|
524
524
|
props: {
|
|
525
525
|
modelValue: { default: () => [] },
|
|
526
526
|
type: { default: O.Table },
|
|
527
527
|
columns: { default: () => [] },
|
|
528
|
-
sorter: { type: Function, default:
|
|
528
|
+
sorter: { type: Function, default: Qe },
|
|
529
529
|
draggableChecker: { type: Function, default: (t) => !0 },
|
|
530
530
|
checkValidDrag: { type: Function, default: void 0 },
|
|
531
531
|
sortable: { type: Boolean, default: !1 },
|
|
@@ -594,23 +594,23 @@ const ll = ["id"], al = { class: "lkt-table-page-buttons" }, ol = { key: 1 }, nl
|
|
|
594
594
|
"page"
|
|
595
595
|
],
|
|
596
596
|
setup(t, { expose: r, emit: i }) {
|
|
597
|
-
const a = i, n =
|
|
597
|
+
const a = i, n = Tt(), l = t, k = {}, E = h(typeof l.sorter == "function" ? l.sorter : Qe), g = h(At(l.columns)), R = h(me.Asc), d = h(l.modelValue), j = h(k), ee = h(null), K = h(l.columns), m = h(l.page), o = h(l.loading), p = h(!1), b = h(l.perms), y = h(null), z = h(null), ve = h({}), te = h(new Lt({ items: d.value }, l.dataStateConfig)), T = h(l.editMode), ie = h(0);
|
|
598
598
|
L(o, (e) => a("update:loading", e)), L(m, (e) => a("page", e));
|
|
599
|
-
const
|
|
600
|
-
l.itemMode &&
|
|
601
|
-
const
|
|
599
|
+
const ke = h(l.type);
|
|
600
|
+
l.itemMode && ke.value === O.Table && (ke.value = O.Item);
|
|
601
|
+
const xe = (e) => {
|
|
602
602
|
Array.isArray(e) && (d.value = e), o.value = !1, p.value = !0, te.value.store({ items: d.value }).turnStoredIntoOriginal();
|
|
603
|
-
}, xe = (e) => {
|
|
604
|
-
b.value = e;
|
|
605
603
|
}, et = (e) => {
|
|
604
|
+
b.value = e;
|
|
606
605
|
}, tt = (e) => {
|
|
606
|
+
}, lt = (e) => {
|
|
607
607
|
a("read-response", e);
|
|
608
|
-
},
|
|
608
|
+
}, at = () => Ge(() => o.value = !0), ot = () => {
|
|
609
609
|
y.value.doRefresh();
|
|
610
|
-
},
|
|
610
|
+
}, ye = Rt(12), Be = c(() => {
|
|
611
611
|
if (!l.hideEmptyColumns) return [];
|
|
612
612
|
let e = [];
|
|
613
|
-
return
|
|
613
|
+
return K.value.forEach((f) => {
|
|
614
614
|
let D = f.key, N = !1;
|
|
615
615
|
d.value.forEach((G) => {
|
|
616
616
|
if (typeof G.checkEmpty == "function")
|
|
@@ -618,19 +618,19 @@ const ll = ["id"], al = { class: "lkt-table-page-buttons" }, ol = { key: 1 }, nl
|
|
|
618
618
|
G[D] && (N = !0);
|
|
619
619
|
}), N || e.push(D);
|
|
620
620
|
}), e;
|
|
621
|
-
}),
|
|
622
|
-
let e =
|
|
621
|
+
}), be = c(() => K.value.filter((e) => !e.hidden)), we = c(() => K.value.filter((e) => e.hidden)), nt = c(() => {
|
|
622
|
+
let e = be.value.length + 1;
|
|
623
623
|
return l.sortable && ++e, e;
|
|
624
|
-
}),
|
|
624
|
+
}), ut = c(() => K.value.filter((e) => e.isForRowKey)), Ee = c(() => we.value.length > 0 && !l.sortable), rt = c(() => K.value.map((e) => e.key)), Te = c(() => {
|
|
625
625
|
let e = [];
|
|
626
|
-
for (let f in n)
|
|
626
|
+
for (let f in n) rt.value.indexOf(f) !== -1 && e.push(f);
|
|
627
627
|
return e;
|
|
628
|
-
}),
|
|
628
|
+
}), $e = c(() => l.hiddenSave || o.value || !l.saveResource ? !1 : T.value && te.value.changed() ? !0 : T.value), it = c(() => ge.value && d.value.length >= l.requiredItemsForTopCreate || l.switchEditionEnabled ? !0 : $e.value || T.value && le.value), st = c(() => l.saveDisabled || typeof l.saveValidator == "function" && !l.saveValidator(d.value) ? !1 : te.value.changed()), dt = c(() => d.value.length), ct = c(() => ({
|
|
629
629
|
items: d.value,
|
|
630
630
|
...l.saveResourceData
|
|
631
|
-
})),
|
|
632
|
-
let
|
|
633
|
-
const
|
|
631
|
+
})), ft = c(() => l.titleTag === "" ? "h2" : l.titleTag), mt = c(() => l.wrapContentTag === "" ? "div" : l.wrapContentTag), De = c(() => l.title.startsWith("__:") ? pe(l.title.substring(3)) : l.title), pt = c(() => l.saveText.startsWith("__:") ? pe(l.saveText.substring(3)) : l.saveText), vt = c(() => l.editModeText.startsWith("__:") ? pe(l.editModeText.substring(3)) : l.editModeText), le = c(() => b.value.includes(fe.Create)), Ve = c(() => b.value.includes("read")), se = c(() => b.value.includes(fe.Update)), Re = c(() => b.value.includes(fe.Edit)), de = c(() => b.value.includes(fe.Drop));
|
|
632
|
+
let Le;
|
|
633
|
+
const Me = h(!1), Fe = h([]), kt = (e) => {
|
|
634
634
|
let f = e.target;
|
|
635
635
|
if (typeof f.dataset.column > "u")
|
|
636
636
|
do
|
|
@@ -638,17 +638,17 @@ const ll = ["id"], al = { class: "lkt-table-page-buttons" }, ol = { key: 1 }, nl
|
|
|
638
638
|
while (typeof f.dataset.column > "u" && f.tagName !== "TABLE" && f.tagName !== "body");
|
|
639
639
|
if (f.tagName === "TD" && (f = f.parentNode, f = f.dataset.i, typeof f < "u"))
|
|
640
640
|
return d.value[f];
|
|
641
|
-
},
|
|
641
|
+
}, yt = (e) => d.value[e], bt = (e) => {
|
|
642
642
|
var f;
|
|
643
643
|
return (f = ee.value) == null ? void 0 : f.querySelector(`tr[data-i="${e}"]`);
|
|
644
|
-
},
|
|
644
|
+
}, Ne = (e) => j.value["tr_" + e] === !0, Ue = (e) => {
|
|
645
645
|
e && e.sortable && (d.value = d.value.sort((f, D) => E.value(f, D, e, R.value)), R.value = R.value === me.Asc ? me.Desc : me.Asc, g.value = e.key, a("sort", [g.value, R.value]));
|
|
646
|
-
},
|
|
646
|
+
}, Ae = (e) => {
|
|
647
647
|
a("click", e);
|
|
648
|
-
},
|
|
648
|
+
}, We = (e, f) => {
|
|
649
649
|
let D = "tr_" + f;
|
|
650
|
-
|
|
651
|
-
},
|
|
650
|
+
j.value[D] = typeof j.value[D] > "u" ? !0 : !j.value[D];
|
|
651
|
+
}, ht = (e) => typeof l.checkValidDrag == "function" ? l.checkValidDrag(e) : !0, He = (e) => typeof l.draggableChecker == "function" ? l.draggableChecker(e) : !0, Ke = () => {
|
|
652
652
|
if (l.canCreateWithoutEdition)
|
|
653
653
|
a("click-create");
|
|
654
654
|
else {
|
|
@@ -661,146 +661,149 @@ const ll = ["id"], al = { class: "lkt-table-page-buttons" }, ol = { key: 1 }, nl
|
|
|
661
661
|
}
|
|
662
662
|
d.value.push({});
|
|
663
663
|
}
|
|
664
|
-
}, ht = () => {
|
|
665
|
-
o.value = !0;
|
|
666
664
|
}, gt = () => {
|
|
665
|
+
o.value = !0;
|
|
666
|
+
}, Ct = () => {
|
|
667
667
|
o.value = !1;
|
|
668
|
-
},
|
|
668
|
+
}, St = (e, f) => {
|
|
669
669
|
if (a("before-save"), l.saveResource && (o.value = !1, !f.success)) {
|
|
670
670
|
a("error", f.httpStatus);
|
|
671
671
|
return;
|
|
672
672
|
}
|
|
673
673
|
te.value.turnStoredIntoOriginal(), a("save", f);
|
|
674
|
-
},
|
|
674
|
+
}, Pe = (e, f, D) => {
|
|
675
675
|
if (D >= e.length) {
|
|
676
676
|
let N = D - e.length + 1;
|
|
677
677
|
for (; N--; ) e.push(void 0);
|
|
678
678
|
}
|
|
679
679
|
return e.splice(D, 0, e.splice(f, 1)[0]), e;
|
|
680
|
-
}, St = (e) => {
|
|
681
|
-
He(d.value, e, e - 1), ie.value = Ce();
|
|
682
680
|
}, Bt = (e) => {
|
|
683
|
-
|
|
684
|
-
},
|
|
685
|
-
d.value
|
|
686
|
-
},
|
|
687
|
-
|
|
688
|
-
},
|
|
689
|
-
|
|
690
|
-
|
|
681
|
+
Pe(d.value, e, e - 1), ie.value = Se();
|
|
682
|
+
}, wt = (e) => {
|
|
683
|
+
Pe(d.value, e, e + 1), ie.value = Se();
|
|
684
|
+
}, he = (e) => {
|
|
685
|
+
d.value.splice(e, 1), ie.value = Se();
|
|
686
|
+
}, Dt = () => {
|
|
687
|
+
ve.value && (ve.value.destroy(), ve.value = {});
|
|
688
|
+
}, qe = () => {
|
|
689
|
+
let e = document.getElementById("lkt-table-body-" + ye);
|
|
690
|
+
ve.value = new Mt(e, {
|
|
691
691
|
direction: "vertical",
|
|
692
692
|
handle: ".handle",
|
|
693
693
|
animation: 150,
|
|
694
694
|
onEnd: function(f) {
|
|
695
|
-
clearTimeout(
|
|
695
|
+
clearTimeout(Le);
|
|
696
696
|
let D = f.oldIndex, N = f.newIndex;
|
|
697
|
-
d.value.splice(N, 0, d.value.splice(D, 1)[0]), ie.value =
|
|
698
|
-
|
|
697
|
+
d.value.splice(N, 0, d.value.splice(D, 1)[0]), ie.value = Se(), Me.value = !0, Fe.value = [D, N], Le = setTimeout(() => {
|
|
698
|
+
Me.value = !1, Fe.value = [];
|
|
699
699
|
}, 5);
|
|
700
700
|
},
|
|
701
701
|
onMove: function(f, D) {
|
|
702
|
-
return
|
|
702
|
+
return ht(f);
|
|
703
703
|
}
|
|
704
704
|
});
|
|
705
|
-
},
|
|
706
|
-
let N = [ie.value,
|
|
707
|
-
return D && N.push("hidden"),
|
|
705
|
+
}, je = (e, f, D = !1) => {
|
|
706
|
+
let N = [ie.value, ye, "row", f];
|
|
707
|
+
return D && N.push("hidden"), ut.value.forEach((G) => {
|
|
708
708
|
let J = String(e[G.key]).toLowerCase();
|
|
709
|
-
J.length > 50 && (J = J.substring(0, 50)), J =
|
|
709
|
+
J.length > 50 && (J = J.substring(0, 50)), J = Ze(J, " ", "-"), N.push(J);
|
|
710
710
|
}), N.join("-");
|
|
711
|
-
},
|
|
712
|
-
|
|
713
|
-
l.initialSorting &&
|
|
714
|
-
|
|
711
|
+
}, ze = c(() => typeof l.createEnabledValidator == "function" ? l.createEnabledValidator({ items: d.value }) : !0), ge = c(() => le.value ? l.canCreateWithoutEdition || le.value && T.value : !1), Ce = (e, f) => typeof l.itemDisplayChecker == "function" ? l.itemDisplayChecker(e) : !0;
|
|
712
|
+
$t(() => {
|
|
713
|
+
l.initialSorting && Ue(Wt(l.columns, g.value)), te.value.store({ items: d.value }).turnStoredIntoOriginal(), l.sortable && Ge(() => {
|
|
714
|
+
qe();
|
|
715
715
|
});
|
|
716
716
|
}), L(() => l.sortable, (e) => {
|
|
717
|
-
e ?
|
|
718
|
-
}), L(() => l.perms, (e) => b.value = e), L(b, (e) => a("update:perms", e)), L(() => l.editMode, (e) => T.value = e), L(() => l.columns, (e) =>
|
|
717
|
+
e ? qe() : Dt();
|
|
718
|
+
}), L(() => l.perms, (e) => b.value = e), L(b, (e) => a("update:perms", e)), L(() => l.editMode, (e) => T.value = e), L(() => l.columns, (e) => K.value = e), L(() => l.modelValue, (e) => d.value = e), L(d, (e) => {
|
|
719
719
|
te.value.increment({ items: e }), a("update:modelValue", e);
|
|
720
720
|
}, { deep: !0 }), r({
|
|
721
|
-
getItemByEvent:
|
|
722
|
-
getItemByIndex:
|
|
723
|
-
getRowByIndex:
|
|
724
|
-
doRefresh:
|
|
721
|
+
getItemByEvent: kt,
|
|
722
|
+
getItemByIndex: yt,
|
|
723
|
+
getRowByIndex: bt,
|
|
724
|
+
doRefresh: ot,
|
|
725
|
+
getHtml: () => z.value
|
|
725
726
|
});
|
|
726
|
-
const
|
|
727
|
+
const Vt = c(() => typeof I.defaultEmptySlot < "u"), It = c(() => I.defaultEmptySlot);
|
|
727
728
|
return (e, f) => {
|
|
728
|
-
const D =
|
|
729
|
+
const D = P("lkt-button"), N = P("lkt-field"), G = P("lkt-loader"), J = P("lkt-paginator");
|
|
729
730
|
return u(), s("section", {
|
|
731
|
+
ref_key: "element",
|
|
732
|
+
ref: z,
|
|
730
733
|
class: "lkt-table-page",
|
|
731
|
-
id: "lkt-table-page-" + C(
|
|
734
|
+
id: "lkt-table-page-" + C(ye)
|
|
732
735
|
}, [
|
|
733
|
-
|
|
736
|
+
De.value || C(n).title ? (u(), s("header", {
|
|
734
737
|
key: 0,
|
|
735
738
|
class: Q(e.headerClass)
|
|
736
739
|
}, [
|
|
737
|
-
|
|
738
|
-
default:
|
|
740
|
+
De.value ? (u(), w(Z(ft.value), { key: 0 }, {
|
|
741
|
+
default: H(() => [
|
|
739
742
|
e.titleIcon ? (u(), s("i", {
|
|
740
743
|
key: 0,
|
|
741
744
|
class: Q(e.titleIcon)
|
|
742
745
|
}, null, 2)) : v("", !0),
|
|
743
|
-
re(" " + Y(
|
|
746
|
+
re(" " + Y(De.value), 1)
|
|
744
747
|
]),
|
|
745
748
|
_: 1
|
|
746
749
|
})) : v("", !0),
|
|
747
750
|
C(n).title ? U(e.$slots, "title", { key: 1 }) : v("", !0)
|
|
748
751
|
], 2)) : v("", !0),
|
|
749
|
-
(u(), w(Z(
|
|
752
|
+
(u(), w(Z(mt.value), {
|
|
750
753
|
class: Q(["lkt-table-page-content-wrapper", e.wrapContentClass])
|
|
751
754
|
}, {
|
|
752
|
-
default:
|
|
753
|
-
ae(M("div",
|
|
755
|
+
default: H(() => [
|
|
756
|
+
ae(M("div", ol, [
|
|
754
757
|
ae(ne(D, {
|
|
755
758
|
class: "lkt-table--save-button",
|
|
756
759
|
ref: "saveButton",
|
|
757
760
|
icon: C(I).defaultSaveIcon,
|
|
758
|
-
disabled: !
|
|
761
|
+
disabled: !st.value,
|
|
759
762
|
"confirm-modal": e.saveConfirm,
|
|
760
763
|
"confirm-data": e.confirmData,
|
|
761
764
|
resource: e.saveResource,
|
|
762
|
-
"resource-data":
|
|
763
|
-
onLoading:
|
|
764
|
-
onLoaded:
|
|
765
|
-
onClick:
|
|
765
|
+
"resource-data": ct.value,
|
|
766
|
+
onLoading: gt,
|
|
767
|
+
onLoaded: Ct,
|
|
768
|
+
onClick: St
|
|
766
769
|
}, {
|
|
767
|
-
default:
|
|
770
|
+
default: H(() => [
|
|
768
771
|
C(n)["button-save"] ? U(e.$slots, "button-save", {
|
|
769
772
|
key: 0,
|
|
770
773
|
items: d.value,
|
|
771
774
|
editMode: e.editMode,
|
|
772
775
|
canUpdate: !e.saveDisabled
|
|
773
|
-
}) : (u(), s("span",
|
|
776
|
+
}) : (u(), s("span", nl, Y(pt.value), 1))
|
|
774
777
|
]),
|
|
775
778
|
_: 3
|
|
776
779
|
}, 8, ["icon", "disabled", "confirm-modal", "confirm-data", "resource", "resource-data"]), [
|
|
777
|
-
[oe,
|
|
780
|
+
[oe, $e.value]
|
|
778
781
|
]),
|
|
779
|
-
|
|
782
|
+
ge.value && d.value.length >= e.requiredItemsForTopCreate ? (u(), w(Xe, {
|
|
780
783
|
key: 0,
|
|
781
|
-
disabled: !
|
|
784
|
+
disabled: !ze.value || e.createDisabled,
|
|
782
785
|
text: e.createText,
|
|
783
786
|
icon: e.createIcon,
|
|
784
787
|
to: e.createRoute,
|
|
785
788
|
onClick: Ke
|
|
786
789
|
}, null, 8, ["disabled", "text", "icon", "to"])) : v("", !0),
|
|
787
|
-
M("div",
|
|
790
|
+
M("div", ul, [
|
|
788
791
|
ae(ne(N, {
|
|
789
792
|
type: "switch",
|
|
790
793
|
modelValue: T.value,
|
|
791
794
|
"onUpdate:modelValue": f[0] || (f[0] = (B) => T.value = B),
|
|
792
|
-
label:
|
|
795
|
+
label: vt.value
|
|
793
796
|
}, null, 8, ["modelValue", "label"]), [
|
|
794
797
|
[oe, e.switchEditionEnabled]
|
|
795
798
|
])
|
|
796
799
|
])
|
|
797
800
|
], 512), [
|
|
798
|
-
[oe,
|
|
801
|
+
[oe, it.value]
|
|
799
802
|
]),
|
|
800
|
-
C(n).buttons ? (u(), s("div",
|
|
803
|
+
C(n).buttons ? (u(), s("div", rl, [
|
|
801
804
|
U(e.$slots, "buttons")
|
|
802
805
|
])) : v("", !0),
|
|
803
|
-
p.value && C(n).filters ? (u(), s("div",
|
|
806
|
+
p.value && C(n).filters ? (u(), s("div", il, [
|
|
804
807
|
U(e.$slots, "filters", {
|
|
805
808
|
items: d.value,
|
|
806
809
|
isLoading: o.value
|
|
@@ -811,65 +814,65 @@ const ll = ["id"], al = { class: "lkt-table-page-buttons" }, ol = { key: 1 }, nl
|
|
|
811
814
|
class: "lkt-table",
|
|
812
815
|
"data-sortable": e.sortable
|
|
813
816
|
}, [
|
|
814
|
-
|
|
817
|
+
ke.value === C(O).Table ? (u(), s("table", dl, [
|
|
815
818
|
M("thead", null, [
|
|
816
819
|
M("tr", null, [
|
|
817
|
-
e.sortable && T.value ? (u(), s("th",
|
|
818
|
-
e.addNavigation && T.value ? (u(), s("th",
|
|
819
|
-
|
|
820
|
-
(u(!0), s(V, null, W(
|
|
821
|
-
|
|
820
|
+
e.sortable && T.value ? (u(), s("th", cl)) : v("", !0),
|
|
821
|
+
e.addNavigation && T.value ? (u(), s("th", fl)) : v("", !0),
|
|
822
|
+
Ee.value ? (u(), s("th", ml)) : v("", !0),
|
|
823
|
+
(u(!0), s(V, null, W(be.value, (B) => (u(), s(V, null, [
|
|
824
|
+
Be.value.indexOf(B.key) === -1 ? (u(), w(ll, {
|
|
822
825
|
key: 0,
|
|
823
826
|
column: B,
|
|
824
827
|
"sort-by": g.value,
|
|
825
828
|
"sort-direction": R.value,
|
|
826
829
|
"amount-of-columns": e.columns.length,
|
|
827
830
|
items: d.value,
|
|
828
|
-
onClick: (S) =>
|
|
831
|
+
onClick: (S) => Ue(B)
|
|
829
832
|
}, null, 8, ["column", "sort-by", "sort-direction", "amount-of-columns", "items", "onClick"])) : v("", !0)
|
|
830
833
|
], 64))), 256)),
|
|
831
|
-
e.canDrop && de.value && T.value ? (u(), s("th",
|
|
832
|
-
|
|
834
|
+
e.canDrop && de.value && T.value ? (u(), s("th", pl)) : v("", !0),
|
|
835
|
+
Re.value && se.value && T.value ? (u(), s("th", vl)) : v("", !0)
|
|
833
836
|
])
|
|
834
837
|
]),
|
|
835
838
|
M("tbody", {
|
|
836
839
|
ref_key: "tableBody",
|
|
837
840
|
ref: ee,
|
|
838
|
-
id: "lkt-table-body-" + C(
|
|
841
|
+
id: "lkt-table-body-" + C(ye)
|
|
839
842
|
}, [
|
|
840
|
-
(u(!0), s(V, null, W(d.value, (B, S) => ae((u(), w(
|
|
843
|
+
(u(!0), s(V, null, W(d.value, (B, S) => ae((u(), w(Qt, {
|
|
841
844
|
modelValue: d.value[S],
|
|
842
|
-
"onUpdate:modelValue": (
|
|
843
|
-
key:
|
|
845
|
+
"onUpdate:modelValue": (q) => d.value[S] = q,
|
|
846
|
+
key: je(B, S),
|
|
844
847
|
i: S,
|
|
845
|
-
"display-hidden-columns-indicator":
|
|
846
|
-
"is-draggable":
|
|
848
|
+
"display-hidden-columns-indicator": Ee.value,
|
|
849
|
+
"is-draggable": He(B),
|
|
847
850
|
sortable: e.sortable,
|
|
848
|
-
"visible-columns":
|
|
849
|
-
"empty-columns":
|
|
851
|
+
"visible-columns": be.value,
|
|
852
|
+
"empty-columns": Be.value,
|
|
850
853
|
"add-navigation": e.addNavigation,
|
|
851
|
-
"hidden-is-visible":
|
|
852
|
-
"latest-row": S + 1 ===
|
|
854
|
+
"hidden-is-visible": Ne(S),
|
|
855
|
+
"latest-row": S + 1 === dt.value,
|
|
853
856
|
"can-drop": e.canDrop && de.value && T.value,
|
|
854
857
|
"drop-confirm": e.dropConfirm,
|
|
855
858
|
"drop-resource": e.dropResource,
|
|
856
859
|
"drop-text": e.dropText,
|
|
857
860
|
"drop-icon": e.dropIcon,
|
|
858
|
-
"can-edit":
|
|
861
|
+
"can-edit": Re.value && se.value && T.value,
|
|
859
862
|
"edit-text": e.editText,
|
|
860
863
|
"edit-icon": e.editIcon,
|
|
861
864
|
"edit-link": e.editLink,
|
|
862
865
|
"edit-mode-enabled": T.value,
|
|
863
|
-
onClick:
|
|
864
|
-
onShow:
|
|
865
|
-
onItemUp:
|
|
866
|
-
onItemDown:
|
|
867
|
-
onItemDrop:
|
|
868
|
-
},
|
|
869
|
-
W(
|
|
870
|
-
name:
|
|
871
|
-
fn:
|
|
872
|
-
U(e.$slots,
|
|
866
|
+
onClick: Ae,
|
|
867
|
+
onShow: We,
|
|
868
|
+
onItemUp: Bt,
|
|
869
|
+
onItemDown: wt,
|
|
870
|
+
onItemDrop: he
|
|
871
|
+
}, Je({ _: 2 }, [
|
|
872
|
+
W(Te.value, (q) => ({
|
|
873
|
+
name: q,
|
|
874
|
+
fn: H((x) => [
|
|
875
|
+
U(e.$slots, q, ce({
|
|
873
876
|
[e.slotItemVar || ""]: x.item,
|
|
874
877
|
value: x.value,
|
|
875
878
|
column: x.column
|
|
@@ -877,27 +880,27 @@ const ll = ["id"], al = { class: "lkt-table-page-buttons" }, ol = { key: 1 }, nl
|
|
|
877
880
|
])
|
|
878
881
|
}))
|
|
879
882
|
]), 1032, ["modelValue", "onUpdate:modelValue", "i", "display-hidden-columns-indicator", "is-draggable", "sortable", "visible-columns", "empty-columns", "add-navigation", "hidden-is-visible", "latest-row", "can-drop", "drop-confirm", "drop-resource", "drop-text", "drop-icon", "can-edit", "edit-text", "edit-icon", "edit-link", "edit-mode-enabled"])), [
|
|
880
|
-
[oe,
|
|
883
|
+
[oe, Ce(d.value[S])]
|
|
881
884
|
])), 128)),
|
|
882
|
-
|
|
885
|
+
we.value.length > 0 ? (u(!0), s(V, { key: 0 }, W(d.value, (B, S) => (u(), w(el, {
|
|
883
886
|
modelValue: d.value[S],
|
|
884
|
-
"onUpdate:modelValue": (
|
|
885
|
-
key:
|
|
887
|
+
"onUpdate:modelValue": (q) => d.value[S] = q,
|
|
888
|
+
key: je(B, S, !0),
|
|
886
889
|
i: S,
|
|
887
|
-
"hidden-columns":
|
|
888
|
-
"hidden-columns-col-span":
|
|
889
|
-
"is-draggable":
|
|
890
|
+
"hidden-columns": we.value,
|
|
891
|
+
"hidden-columns-col-span": nt.value,
|
|
892
|
+
"is-draggable": He(B),
|
|
890
893
|
sortable: e.sortable,
|
|
891
|
-
"visible-columns":
|
|
892
|
-
"empty-columns":
|
|
893
|
-
"hidden-is-visible":
|
|
894
|
-
onClick:
|
|
895
|
-
onShow:
|
|
896
|
-
},
|
|
897
|
-
W(
|
|
898
|
-
name:
|
|
899
|
-
fn:
|
|
900
|
-
U(e.$slots,
|
|
894
|
+
"visible-columns": be.value,
|
|
895
|
+
"empty-columns": Be.value,
|
|
896
|
+
"hidden-is-visible": Ne(S),
|
|
897
|
+
onClick: Ae,
|
|
898
|
+
onShow: We
|
|
899
|
+
}, Je({ _: 2 }, [
|
|
900
|
+
W(Te.value, (q) => ({
|
|
901
|
+
name: q,
|
|
902
|
+
fn: H((x) => [
|
|
903
|
+
U(e.$slots, q, ce({
|
|
901
904
|
[e.slotItemVar || ""]: x.item,
|
|
902
905
|
value: x.value,
|
|
903
906
|
column: x.column
|
|
@@ -905,23 +908,23 @@ const ll = ["id"], al = { class: "lkt-table-page-buttons" }, ol = { key: 1 }, nl
|
|
|
905
908
|
])
|
|
906
909
|
}))
|
|
907
910
|
]), 1032, ["modelValue", "onUpdate:modelValue", "i", "hidden-columns", "hidden-columns-col-span", "is-draggable", "sortable", "visible-columns", "empty-columns", "hidden-is-visible"]))), 128)) : v("", !0)
|
|
908
|
-
], 8,
|
|
909
|
-
])) :
|
|
911
|
+
], 8, kl)
|
|
912
|
+
])) : ke.value === C(O).Item ? (u(), s("div", {
|
|
910
913
|
key: 1,
|
|
911
914
|
class: Q(["lkt-table-items-container", e.itemsContainerClass])
|
|
912
915
|
}, [
|
|
913
916
|
(u(!0), s(V, null, W(d.value, (B, S) => (u(), s(V, null, [
|
|
914
|
-
|
|
917
|
+
Ce(B) ? (u(), s("div", yl, [
|
|
915
918
|
U(e.$slots, "item", ce({
|
|
916
919
|
[e.slotItemVar || ""]: B,
|
|
917
920
|
index: S,
|
|
918
921
|
editing: T.value,
|
|
919
922
|
canCreate: le.value,
|
|
920
|
-
canRead:
|
|
923
|
+
canRead: Ve.value,
|
|
921
924
|
canUpdate: se.value,
|
|
922
925
|
canDrop: de.value,
|
|
923
926
|
isLoading: o.value,
|
|
924
|
-
doDrop: () =>
|
|
927
|
+
doDrop: () => he(S)
|
|
925
928
|
}))
|
|
926
929
|
])) : v("", !0)
|
|
927
930
|
], 64))), 256))
|
|
@@ -930,17 +933,17 @@ const ll = ["id"], al = { class: "lkt-table-page-buttons" }, ol = { key: 1 }, nl
|
|
|
930
933
|
class: Q(["lkt-table-items-container", e.itemsContainerClass])
|
|
931
934
|
}, [
|
|
932
935
|
(u(!0), s(V, null, W(d.value, (B, S) => (u(), s(V, null, [
|
|
933
|
-
|
|
936
|
+
Ce(B) ? (u(), s("li", bl, [
|
|
934
937
|
U(e.$slots, "item", ce({
|
|
935
938
|
[e.slotItemVar || ""]: B,
|
|
936
939
|
index: S,
|
|
937
940
|
editing: T.value,
|
|
938
941
|
canCreate: le.value,
|
|
939
|
-
canRead:
|
|
942
|
+
canRead: Ve.value,
|
|
940
943
|
canUpdate: se.value,
|
|
941
944
|
canDrop: de.value,
|
|
942
945
|
isLoading: o.value,
|
|
943
|
-
doDrop: () =>
|
|
946
|
+
doDrop: () => he(S)
|
|
944
947
|
}))
|
|
945
948
|
])) : v("", !0)
|
|
946
949
|
], 64))), 256))
|
|
@@ -949,36 +952,36 @@ const ll = ["id"], al = { class: "lkt-table-page-buttons" }, ol = { key: 1 }, nl
|
|
|
949
952
|
class: Q(["lkt-table-items-container", e.itemsContainerClass])
|
|
950
953
|
}, [
|
|
951
954
|
(u(!0), s(V, null, W(d.value, (B, S) => (u(), s(V, null, [
|
|
952
|
-
|
|
955
|
+
Ce(B) ? (u(), s("li", hl, [
|
|
953
956
|
U(e.$slots, "item", ce({
|
|
954
957
|
[e.slotItemVar || ""]: B,
|
|
955
958
|
index: S,
|
|
956
959
|
editing: T.value,
|
|
957
960
|
canCreate: le.value,
|
|
958
|
-
canRead:
|
|
961
|
+
canRead: Ve.value,
|
|
959
962
|
canUpdate: se.value,
|
|
960
963
|
canDrop: de.value,
|
|
961
964
|
isLoading: o.value,
|
|
962
|
-
doDrop: () =>
|
|
965
|
+
doDrop: () => he(S)
|
|
963
966
|
}))
|
|
964
967
|
])) : v("", !0)
|
|
965
968
|
], 64))), 256))
|
|
966
969
|
], 2)) : v("", !0)
|
|
967
|
-
], 8,
|
|
970
|
+
], 8, sl), [
|
|
968
971
|
[oe, !o.value && d.value.length > 0]
|
|
969
972
|
]),
|
|
970
|
-
!o.value && d.value.length === 0 ? (u(), s("div",
|
|
971
|
-
C(n).empty ? U(e.$slots, "empty", { key: 0 }) :
|
|
973
|
+
!o.value && d.value.length === 0 ? (u(), s("div", gl, [
|
|
974
|
+
C(n).empty ? U(e.$slots, "empty", { key: 0 }) : Vt.value ? (u(), w(Z(It.value), {
|
|
972
975
|
key: 1,
|
|
973
976
|
message: e.noResultsText
|
|
974
977
|
}, null, 8, ["message"])) : e.noResultsText ? (u(), s(V, { key: 2 }, [
|
|
975
978
|
re(Y(e.noResultsText), 1)
|
|
976
979
|
], 64)) : v("", !0)
|
|
977
980
|
])) : v("", !0),
|
|
978
|
-
|
|
979
|
-
|
|
981
|
+
ge.value || C(n).bottomButtons ? (u(), s("div", Cl, [
|
|
982
|
+
ge.value && d.value.length >= e.requiredItemsForBottomCreate ? (u(), w(Xe, {
|
|
980
983
|
key: 0,
|
|
981
|
-
disabled: !
|
|
984
|
+
disabled: !ze.value || e.createDisabled,
|
|
982
985
|
text: e.createText,
|
|
983
986
|
icon: e.createIcon,
|
|
984
987
|
to: e.createRoute,
|
|
@@ -994,46 +997,46 @@ const ll = ["id"], al = { class: "lkt-table-page-buttons" }, ol = { key: 1 }, nl
|
|
|
994
997
|
"onUpdate:modelValue": f[1] || (f[1] = (B) => m.value = B),
|
|
995
998
|
resource: e.resource,
|
|
996
999
|
filters: e.filters,
|
|
997
|
-
onResults:
|
|
998
|
-
onLoading:
|
|
999
|
-
onPerms:
|
|
1000
|
-
onCustom:
|
|
1001
|
-
onResponse:
|
|
1000
|
+
onResults: xe,
|
|
1001
|
+
onLoading: at,
|
|
1002
|
+
onPerms: et,
|
|
1003
|
+
onCustom: tt,
|
|
1004
|
+
onResponse: lt
|
|
1002
1005
|
}, null, 8, ["modelValue", "resource", "filters"])) : v("", !0)
|
|
1003
1006
|
]),
|
|
1004
1007
|
_: 3
|
|
1005
1008
|
}, 8, ["class"]))
|
|
1006
|
-
], 8,
|
|
1009
|
+
], 8, al);
|
|
1007
1010
|
};
|
|
1008
1011
|
}
|
|
1009
|
-
}),
|
|
1012
|
+
}), jl = {
|
|
1010
1013
|
install: (t) => {
|
|
1011
|
-
t.component("lkt-table") === void 0 && t.component("lkt-table",
|
|
1014
|
+
t.component("lkt-table") === void 0 && t.component("lkt-table", Sl);
|
|
1012
1015
|
}
|
|
1013
|
-
},
|
|
1016
|
+
}, zl = (t) => (I.navButtonSlot = t, !0), Gl = (t) => (I.dropButtonSlot = t, !0), Jl = (t) => (I.createButtonSlot = t, !0), Ol = (t) => {
|
|
1014
1017
|
I.defaultEmptySlot = t;
|
|
1015
|
-
},
|
|
1018
|
+
}, Ql = (t) => {
|
|
1016
1019
|
I.defaultSaveIcon = t;
|
|
1017
1020
|
};
|
|
1018
1021
|
export {
|
|
1019
1022
|
F as Column,
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1023
|
+
Ll as createActionColumn,
|
|
1024
|
+
Wl as createCheckColumn,
|
|
1025
|
+
$l as createColumn,
|
|
1026
|
+
Ul as createEmailColumn,
|
|
1027
|
+
Pl as createFileColumn,
|
|
1028
|
+
Nl as createFloatColumn,
|
|
1029
|
+
ql as createHiddenColumn,
|
|
1030
|
+
Fl as createIntegerColumn,
|
|
1031
|
+
Rl as createLinkColumn,
|
|
1029
1032
|
Kl as createSelectColumn,
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1033
|
+
Hl as createSwitchColumn,
|
|
1034
|
+
Al as createTelColumn,
|
|
1035
|
+
Ml as createTextColumn,
|
|
1036
|
+
jl as default,
|
|
1037
|
+
Jl as setTableCreateButtonSlot,
|
|
1038
|
+
Gl as setTableDropButtonSlot,
|
|
1039
|
+
Ol as setTableEmptySlot,
|
|
1040
|
+
zl as setTableNavButtonSlot,
|
|
1041
|
+
Ql as setTableSaveIcon
|
|
1039
1042
|
};
|
package/package.json
CHANGED
|
@@ -172,6 +172,7 @@ const Page = ref(props.page),
|
|
|
172
172
|
firstLoadReady = ref(false),
|
|
173
173
|
permissions = ref(props.perms),
|
|
174
174
|
paginator = ref(null),
|
|
175
|
+
element = ref(null),
|
|
175
176
|
sortableObject = ref({}),
|
|
176
177
|
dataState = ref(new DataState({items: Items.value}, props.dataStateConfig)),
|
|
177
178
|
editModeEnabled = ref(props.editMode),
|
|
@@ -529,6 +530,7 @@ defineExpose({
|
|
|
529
530
|
getItemByIndex,
|
|
530
531
|
getRowByIndex,
|
|
531
532
|
doRefresh,
|
|
533
|
+
getHtml: () => element.value,
|
|
532
534
|
});
|
|
533
535
|
|
|
534
536
|
const hasEmptySlot = computed(() => {
|
|
@@ -541,7 +543,7 @@ const hasEmptySlot = computed(() => {
|
|
|
541
543
|
</script>
|
|
542
544
|
|
|
543
545
|
<template>
|
|
544
|
-
<section class="lkt-table-page" :id="'lkt-table-page-' + uniqueId">
|
|
546
|
+
<section ref="element" class="lkt-table-page" :id="'lkt-table-page-' + uniqueId">
|
|
545
547
|
<header v-if="computedTitle || slots.title" :class="headerClass">
|
|
546
548
|
<component :is="computedTitleTag" v-if="computedTitle">
|
|
547
549
|
<i v-if="titleIcon" :class="titleIcon"/>
|