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