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