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