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