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