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