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