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