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