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