lkt-table 1.3.20 → 1.3.22
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 +4 -4
- package/dist/build.js +293 -277
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/lib-components/LktTable.vue +20 -0
package/dist/build.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare class
|
|
1
|
+
declare class H {
|
|
2
2
|
constructor(r?: {});
|
|
3
3
|
key: string;
|
|
4
4
|
label: string;
|
|
@@ -11,7 +11,7 @@ declare class P {
|
|
|
11
11
|
isForRowKey: boolean;
|
|
12
12
|
extractTitleFromColumn: string;
|
|
13
13
|
slotData: {};
|
|
14
|
-
field:
|
|
14
|
+
field: _e;
|
|
15
15
|
getHref(r: any): any;
|
|
16
16
|
doAction(r: any): any;
|
|
17
17
|
}
|
|
@@ -946,5 +946,5 @@ declare function _l(t: any): boolean;
|
|
|
946
946
|
declare function ea(t: any): void;
|
|
947
947
|
declare function Ol(t: any): boolean;
|
|
948
948
|
declare function ta(t: any): void;
|
|
949
|
-
import { Field as
|
|
950
|
-
export {
|
|
949
|
+
import { Field as _e } from "lkt-field";
|
|
950
|
+
export { H as Column, Hl as createActionColumn, Gl as createCheckColumn, Ul as createColumn, jl as createEmailColumn, Xl as createFileColumn, Kl as createFloatColumn, Yl as createHiddenColumn, ql as createIntegerColumn, Pl as createLinkColumn, Ql as createSelectColumn, Jl as createSwitchColumn, zl as createTelColumn, Wl as createTextColumn, Zl as default, xl as setTableCreateButtonSlot, _l as setTableDropButtonSlot, ea as setTableEmptySlot, Ol as setTableNavButtonSlot, ta as setTableSaveIcon };
|
package/dist/build.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { reactive as q, defineComponent as te, ref as b, watch as F, computed as c, resolveComponent as J, unref as f, openBlock as n, createBlock as g, withCtx as
|
|
2
|
-
import { Field as
|
|
3
|
-
import { __ as
|
|
4
|
-
import { replaceAll as
|
|
1
|
+
import { reactive as q, defineComponent as te, ref as b, watch as F, computed as c, resolveComponent as J, unref as f, openBlock as n, createBlock as g, withCtx as U, createTextVNode as de, toDisplayString as x, createElementBlock as s, mergeProps as Ze, Fragment as R, withModifiers as tt, resolveDynamicComponent as ee, createCommentVNode as v, useSlots as lt, normalizeClass as j, createElementVNode as P, createVNode as re, renderSlot as $, renderList as K, withDirectives as ve, vShow as ye, onMounted as Lt, nextTick as Re, createSlots as Oe, normalizeProps as oe } from "vue";
|
|
2
|
+
import { Field as _e } from "lkt-field";
|
|
3
|
+
import { __ as be } from "lkt-i18n";
|
|
4
|
+
import { replaceAll as at, generateRandomString as Ft } from "lkt-string-tools";
|
|
5
5
|
import { DataState as At } from "lkt-data-state";
|
|
6
6
|
import Ut from "sortablejs";
|
|
7
7
|
import { time as Be } from "lkt-date-tools";
|
|
8
|
-
var
|
|
9
|
-
class
|
|
8
|
+
var M = /* @__PURE__ */ ((t) => (t.Text = "text", t.Number = "number", t.Check = "check", t.Switch = "switch", t.Select = "select", t.Email = "email", t.Tel = "tel", t.File = "file", t.Link = "link", t.Action = "action", t.Integer = "int", t.Float = "float", t.None = "", t))(M || {});
|
|
9
|
+
class H {
|
|
10
10
|
constructor(r = {}) {
|
|
11
|
-
this.key = "", this.label = "", this.sortable = !0, this.hidden = !1, this.editable = !1, this.formatter = void 0, this.checkEmpty = void 0, this.colspan = void 0, this.preferSlot = !0, this.type =
|
|
11
|
+
this.key = "", this.label = "", this.sortable = !0, this.hidden = !1, this.editable = !1, this.formatter = void 0, this.checkEmpty = void 0, this.colspan = void 0, this.preferSlot = !0, this.type = M.None, this.link = "", this.action = void 0, this.isForRowKey = !1, this.extractTitleFromColumn = "", this.slotData = {}, this.field = new _e();
|
|
12
12
|
for (let d in r)
|
|
13
13
|
this[d] = r[d];
|
|
14
|
-
this.field = new
|
|
14
|
+
this.field = new _e(this.field);
|
|
15
15
|
}
|
|
16
16
|
getHref(r) {
|
|
17
17
|
return typeof this.link == "function" ? this.link(r) : this.link;
|
|
@@ -22,7 +22,7 @@ class P {
|
|
|
22
22
|
console.warn("No action defined");
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
const Ul = (t) => q(new
|
|
25
|
+
const Ul = (t) => q(new H(t)), Pl = (t, r, d, o = !0) => q(new H({ key: t, label: r, sortable: o, type: M.Link, link: d })), Hl = (t, r, d, o = !0) => q(new H({ key: t, label: r, sortable: o, type: M.Action, action: d })), Wl = (t, r, d = !0) => q(new H({ key: t, label: r, type: M.Text, sortable: d })), ql = (t, r, d = !0) => q(new H({ key: t, label: r, type: M.Number, sortable: d })), Kl = (t, r, d = !0) => q(new H({ key: t, label: r, type: M.Number, sortable: d })), jl = (t, r, d = !0) => q(new H({ key: t, label: r, type: M.Email, sortable: d })), zl = (t, r, d = !0) => q(new H({ key: t, label: r, type: M.Tel, sortable: d })), Gl = (t, r, d = !0) => q(new H({ key: t, label: r, type: M.Check, sortable: d })), Jl = (t, r, d = !0) => q(new H({ key: t, label: r, type: M.Switch, sortable: d })), Ql = (t, r, d, o = !0) => q(new H({ key: t, label: r, type: M.Select, sortable: o })), Xl = (t, r, d = !0) => q(new H({ key: t, label: r, type: M.File, sortable: d })), Yl = (t, r, d = !0) => q(new H({ key: t, label: r, sortable: d, hidden: !0 })), xe = (t, r, d, o) => {
|
|
26
26
|
if (!d) return 0;
|
|
27
27
|
let u = t[d.key], l = r[d.key];
|
|
28
28
|
if (o === "asc") {
|
|
@@ -33,15 +33,15 @@ const Ul = (t) => q(new P(t)), Pl = (t, r, d, o = !0) => q(new P({ key: t, label
|
|
|
33
33
|
if (l > u) return 1;
|
|
34
34
|
}
|
|
35
35
|
return 0;
|
|
36
|
-
},
|
|
36
|
+
}, ie = (t, r, d, o = []) => {
|
|
37
37
|
if (t.extractTitleFromColumn) {
|
|
38
38
|
let u = o.find((l) => l.key === t.extractTitleFromColumn);
|
|
39
39
|
if (u)
|
|
40
|
-
return
|
|
40
|
+
return ie(u, r, d, o);
|
|
41
41
|
}
|
|
42
42
|
if (t.formatter && typeof t.formatter == "function") {
|
|
43
43
|
let u = t.formatter(r[t.key], r, t, d);
|
|
44
|
-
return u.startsWith("__:") ?
|
|
44
|
+
return u.startsWith("__:") ? be(u.substring(3)) : u;
|
|
45
45
|
}
|
|
46
46
|
return r[t.key];
|
|
47
47
|
}, Pt = (t, r, d) => {
|
|
@@ -67,11 +67,11 @@ const Ul = (t) => q(new P(t)), Pl = (t, r, d, o = !0) => q(new P({ key: t, label
|
|
|
67
67
|
if (t[d].key === r) return t[d];
|
|
68
68
|
}
|
|
69
69
|
return null;
|
|
70
|
-
},
|
|
70
|
+
}, ot = (t) => t.type ? `is-${t.type}` : "", nt = /* @__PURE__ */ te({
|
|
71
71
|
__name: "LktTableCell",
|
|
72
72
|
props: {
|
|
73
73
|
modelValue: { default: () => ({}) },
|
|
74
|
-
column: { default: () => new
|
|
74
|
+
column: { default: () => new H() },
|
|
75
75
|
columns: { default: () => [] },
|
|
76
76
|
i: { default: 0 },
|
|
77
77
|
editModeEnabled: { type: Boolean, default: !1 },
|
|
@@ -79,17 +79,17 @@ const Ul = (t) => q(new P(t)), Pl = (t, r, d, o = !0) => q(new P({ key: t, label
|
|
|
79
79
|
},
|
|
80
80
|
emits: ["update:modelValue"],
|
|
81
81
|
setup(t, { emit: r }) {
|
|
82
|
-
const d = r, o = t, u = b(o.modelValue), l = b(u.value[o.column.key]),
|
|
83
|
-
let
|
|
84
|
-
[
|
|
85
|
-
const
|
|
86
|
-
|
|
82
|
+
const d = r, o = t, u = b(o.modelValue), l = b(u.value[o.column.key]), k = b(null);
|
|
83
|
+
let I = o.column.type;
|
|
84
|
+
[M.Integer, M.Float].includes(I) && (I = M.Number), F(l, (a) => {
|
|
85
|
+
const N = JSON.parse(JSON.stringify(u.value));
|
|
86
|
+
N[o.column.key] = a, d("update:modelValue", N);
|
|
87
87
|
}), F(() => o.modelValue, (a) => {
|
|
88
88
|
u.value = a, l.value = u.value[o.column.key];
|
|
89
89
|
});
|
|
90
90
|
const p = c(() => ({ ...o.column.slotData, item: u.value })), D = c(() => {
|
|
91
|
-
var a,
|
|
92
|
-
if ((a = o.column.field) != null && a.modalData && typeof ((
|
|
91
|
+
var a, N, z, L;
|
|
92
|
+
if ((a = o.column.field) != null && a.modalData && typeof ((N = o.column.field) == null ? void 0 : N.modalData) == "object")
|
|
93
93
|
for (let w in o.column.field.modalData)
|
|
94
94
|
if (typeof ((z = o.column.field) == null ? void 0 : z.modalData[w]) == "string" && o.column.field.modalData[w].startsWith("prop:")) {
|
|
95
95
|
let E = o.column.field.modalData[w].substring(5);
|
|
@@ -98,41 +98,41 @@ const Ul = (t) => q(new P(t)), Pl = (t, r, d, o = !0) => q(new P({ key: t, label
|
|
|
98
98
|
o.column.field.modalData[w];
|
|
99
99
|
return (L = o.column.field) == null ? void 0 : L.modalData;
|
|
100
100
|
});
|
|
101
|
-
return (a,
|
|
101
|
+
return (a, N) => {
|
|
102
102
|
const z = J("lkt-anchor"), L = J("lkt-field");
|
|
103
|
-
return a.column.type === f(
|
|
103
|
+
return a.column.type === f(M).Link ? (n(), g(z, {
|
|
104
104
|
key: 0,
|
|
105
105
|
to: a.column.getHref(u.value)
|
|
106
106
|
}, {
|
|
107
|
-
default:
|
|
108
|
-
|
|
107
|
+
default: U(() => [
|
|
108
|
+
de(x(f(ie)(a.column, u.value, a.i)), 1)
|
|
109
109
|
]),
|
|
110
110
|
_: 1
|
|
111
|
-
}, 8, ["to"])) : a.column.type === f(
|
|
111
|
+
}, 8, ["to"])) : a.column.type === f(M).Action ? (n(), s("a", {
|
|
112
112
|
key: 1,
|
|
113
113
|
href: "#",
|
|
114
|
-
onClick:
|
|
115
|
-
}, x(f(
|
|
116
|
-
type: f(
|
|
114
|
+
onClick: N[0] || (N[0] = (w) => a.column.doAction(u.value))
|
|
115
|
+
}, x(f(ie)(a.column, u.value, a.i)), 1)) : a.column.type !== "" && a.hasInlineEditPerm ? (n(), g(L, Ze({ key: 2 }, a.column.field, {
|
|
116
|
+
type: f(I),
|
|
117
117
|
"read-mode": !a.column.editable || !a.editModeEnabled,
|
|
118
|
-
ref: (w) =>
|
|
118
|
+
ref: (w) => k.value = w,
|
|
119
119
|
"slot-data": p.value,
|
|
120
120
|
label: a.column.type === "switch" || a.column.type === "check" ? a.column.label : "",
|
|
121
121
|
"modal-data": D.value,
|
|
122
122
|
prop: u.value,
|
|
123
123
|
modelValue: l.value,
|
|
124
|
-
"onUpdate:modelValue":
|
|
125
|
-
}), null, 16, ["type", "read-mode", "slot-data", "label", "modal-data", "prop", "modelValue"])) : a.column.type !== "" ? (n(), g(L,
|
|
126
|
-
type: f(
|
|
124
|
+
"onUpdate:modelValue": N[1] || (N[1] = (w) => l.value = w)
|
|
125
|
+
}), null, 16, ["type", "read-mode", "slot-data", "label", "modal-data", "prop", "modelValue"])) : a.column.type !== "" ? (n(), g(L, Ze({ key: 3 }, a.column.field, {
|
|
126
|
+
type: f(I),
|
|
127
127
|
"read-mode": "",
|
|
128
|
-
ref: (w) =>
|
|
128
|
+
ref: (w) => k.value = w,
|
|
129
129
|
"slot-data": p.value,
|
|
130
130
|
label: a.column.type === "switch" || a.column.type === "check" ? a.column.label : "",
|
|
131
131
|
"modal-data": D.value,
|
|
132
132
|
prop: u.value,
|
|
133
133
|
"model-value": l.value
|
|
134
|
-
}), null, 16, ["type", "slot-data", "label", "modal-data", "prop", "model-value"])) : (n(), s(
|
|
135
|
-
|
|
134
|
+
}), null, 16, ["type", "slot-data", "label", "modal-data", "prop", "model-value"])) : (n(), s(R, { key: 4 }, [
|
|
135
|
+
de(x(f(ie)(a.column, u.value, a.i, a.columns)), 1)
|
|
136
136
|
], 64));
|
|
137
137
|
};
|
|
138
138
|
}
|
|
@@ -153,9 +153,9 @@ const jt = /* @__PURE__ */ te({
|
|
|
153
153
|
emits: ["click"],
|
|
154
154
|
setup(t, { emit: r }) {
|
|
155
155
|
const d = r, o = c(() => V.dropButtonSlot !== ""), u = c(() => V.dropButtonSlot);
|
|
156
|
-
return (l,
|
|
157
|
-
const
|
|
158
|
-
return n(), g(
|
|
156
|
+
return (l, k) => {
|
|
157
|
+
const I = J("lkt-button");
|
|
158
|
+
return n(), g(I, {
|
|
159
159
|
palette: "table-delete",
|
|
160
160
|
icon: o.value ? "" : l.icon,
|
|
161
161
|
text: o.value ? "" : l.text,
|
|
@@ -163,9 +163,9 @@ const jt = /* @__PURE__ */ te({
|
|
|
163
163
|
"resource-data": l.resourceData,
|
|
164
164
|
"confirm-modal": l.confirm,
|
|
165
165
|
disabled: l.disabled,
|
|
166
|
-
onClick:
|
|
166
|
+
onClick: k[0] || (k[0] = tt((p) => d("click"), ["prevent", "stop"]))
|
|
167
167
|
}, {
|
|
168
|
-
default:
|
|
168
|
+
default: U(() => [
|
|
169
169
|
o.value ? (n(), g(ee(u.value), { key: 0 })) : v("", !0)
|
|
170
170
|
]),
|
|
171
171
|
_: 1
|
|
@@ -186,9 +186,9 @@ const jt = /* @__PURE__ */ te({
|
|
|
186
186
|
emits: ["click"],
|
|
187
187
|
setup(t, { emit: r }) {
|
|
188
188
|
const d = r, o = c(() => V.editButtonSlot !== ""), u = c(() => V.editButtonSlot);
|
|
189
|
-
return (l,
|
|
190
|
-
const
|
|
191
|
-
return n(), g(
|
|
189
|
+
return (l, k) => {
|
|
190
|
+
const I = J("lkt-button");
|
|
191
|
+
return n(), g(I, {
|
|
192
192
|
palette: "table-delete",
|
|
193
193
|
icon: o.value ? "" : l.icon,
|
|
194
194
|
text: o.value ? "" : l.text,
|
|
@@ -198,9 +198,9 @@ const jt = /* @__PURE__ */ te({
|
|
|
198
198
|
"resource-data": l.resourceData,
|
|
199
199
|
"confirm-modal": l.confirm,
|
|
200
200
|
disabled: l.disabled,
|
|
201
|
-
onClick:
|
|
201
|
+
onClick: k[0] || (k[0] = tt((p) => d("click"), ["prevent", "stop"]))
|
|
202
202
|
}, {
|
|
203
|
-
default:
|
|
203
|
+
default: U(() => [
|
|
204
204
|
o.value ? (n(), g(ee(u.value), { key: 0 })) : v("", !0)
|
|
205
205
|
]),
|
|
206
206
|
_: 1
|
|
@@ -250,70 +250,70 @@ const Gt = ["data-i", "data-draggable"], Jt = {
|
|
|
250
250
|
},
|
|
251
251
|
emits: ["update:modelValue", "click", "show", "item-up", "item-down", "item-drop"],
|
|
252
252
|
setup(t, { emit: r }) {
|
|
253
|
-
const d =
|
|
254
|
-
let
|
|
255
|
-
|
|
256
|
-
const
|
|
257
|
-
for (let i in l.value) D.value =
|
|
258
|
-
const a = (i) => o("click", i),
|
|
253
|
+
const d = lt(), o = r, u = t, l = b(u.modelValue);
|
|
254
|
+
let k = typeof u.rowDisplayType == "function" ? u.rowDisplayType(l.value, u.i) : u.rowDisplayType;
|
|
255
|
+
k || (k = _.Auto);
|
|
256
|
+
const I = [_.Auto, _.PreferCustomItem].includes(k), p = [_.Auto, _.PreferItem].includes(k), D = b(u.editLink);
|
|
257
|
+
for (let i in l.value) D.value = at(D.value, ":" + i, l.value[i]);
|
|
258
|
+
const a = (i) => o("click", i), N = (i, C) => {
|
|
259
259
|
o("show", i, C);
|
|
260
260
|
}, z = c(() => {
|
|
261
261
|
let i = [];
|
|
262
262
|
return u.sortable && u.isDraggable && i.push("handle"), i.join(" ");
|
|
263
263
|
}), L = c(() => V.navButtonSlot !== ""), w = c(() => V.navButtonSlot), E = () => {
|
|
264
264
|
o("item-up", u.i);
|
|
265
|
-
},
|
|
265
|
+
}, he = () => {
|
|
266
266
|
o("item-down", u.i);
|
|
267
267
|
}, A = () => {
|
|
268
268
|
o("item-drop", u.i);
|
|
269
|
-
},
|
|
269
|
+
}, ge = () => {
|
|
270
270
|
};
|
|
271
271
|
F(() => u.modelValue, (i) => l.value = i), F(l, (i) => {
|
|
272
272
|
o("update:modelValue", i);
|
|
273
273
|
}, { deep: !0 });
|
|
274
|
-
const
|
|
274
|
+
const se = c(() => typeof u.renderDrag == "function" ? u.renderDrag(l.value) : u.renderDrag === !0);
|
|
275
275
|
return (i, C) => {
|
|
276
|
-
const
|
|
276
|
+
const S = J("lkt-button");
|
|
277
277
|
return n(), s("tr", {
|
|
278
278
|
"data-i": i.i,
|
|
279
279
|
"data-draggable": i.isDraggable,
|
|
280
|
-
class: j({ "type-custom-item": f(
|
|
280
|
+
class: j({ "type-custom-item": f(I), "type-item": f(p) })
|
|
281
281
|
}, [
|
|
282
|
-
i.sortable && i.isDraggable && i.editModeEnabled &&
|
|
282
|
+
i.sortable && i.isDraggable && i.editModeEnabled && se.value ? (n(), s("td", {
|
|
283
283
|
key: 0,
|
|
284
284
|
"data-role": "drag-indicator",
|
|
285
285
|
class: j(z.value)
|
|
286
|
-
}, null, 2)) : i.sortable && i.editModeEnabled &&
|
|
286
|
+
}, null, 2)) : i.sortable && i.editModeEnabled && se.value ? (n(), s("td", Jt)) : v("", !0),
|
|
287
287
|
i.addNavigation && i.editModeEnabled ? (n(), s("td", Qt, [
|
|
288
|
-
|
|
289
|
-
|
|
288
|
+
P("div", Xt, [
|
|
289
|
+
re(S, {
|
|
290
290
|
palette: "table-nav",
|
|
291
291
|
disabled: i.i === 0,
|
|
292
292
|
onClick: E
|
|
293
293
|
}, {
|
|
294
|
-
default:
|
|
294
|
+
default: U(() => [
|
|
295
295
|
L.value ? (n(), g(ee(w.value), {
|
|
296
296
|
key: 0,
|
|
297
297
|
direction: "up"
|
|
298
|
-
})) : (n(), s(
|
|
299
|
-
C[3] || (C[3] =
|
|
300
|
-
C[4] || (C[4] =
|
|
298
|
+
})) : (n(), s(R, { key: 1 }, [
|
|
299
|
+
C[3] || (C[3] = P("i", { class: "" }, null, -1)),
|
|
300
|
+
C[4] || (C[4] = de(" UP "))
|
|
301
301
|
], 64))
|
|
302
302
|
]),
|
|
303
303
|
_: 1
|
|
304
304
|
}, 8, ["disabled"]),
|
|
305
|
-
|
|
305
|
+
re(S, {
|
|
306
306
|
palette: "table-nav",
|
|
307
307
|
disabled: i.latestRow,
|
|
308
|
-
onClick:
|
|
308
|
+
onClick: he
|
|
309
309
|
}, {
|
|
310
|
-
default:
|
|
310
|
+
default: U(() => [
|
|
311
311
|
L.value ? (n(), g(ee(w.value), {
|
|
312
312
|
key: 0,
|
|
313
313
|
direction: "down"
|
|
314
|
-
})) : (n(), s(
|
|
315
|
-
C[5] || (C[5] =
|
|
316
|
-
C[6] || (C[6] =
|
|
314
|
+
})) : (n(), s(R, { key: 1 }, [
|
|
315
|
+
C[5] || (C[5] = P("i", { class: "" }, null, -1)),
|
|
316
|
+
C[6] || (C[6] = de(" DOWN "))
|
|
317
317
|
], 64))
|
|
318
318
|
]),
|
|
319
319
|
_: 1
|
|
@@ -322,15 +322,15 @@ const Gt = ["data-i", "data-draggable"], Jt = {
|
|
|
322
322
|
])) : v("", !0),
|
|
323
323
|
i.displayHiddenColumnsIndicator ? (n(), s("td", {
|
|
324
324
|
key: 3,
|
|
325
|
-
onClick: C[0] || (C[0] = (B) =>
|
|
325
|
+
onClick: C[0] || (C[0] = (B) => N(B, i.i)),
|
|
326
326
|
"data-role": "show-more",
|
|
327
327
|
class: j(i.hiddenIsVisible ? "state-open" : "")
|
|
328
328
|
}, null, 2)) : v("", !0),
|
|
329
|
-
f(
|
|
329
|
+
f(I) && f(d)[`item-${i.i}`] ? (n(), s("td", {
|
|
330
330
|
key: "td" + i.i,
|
|
331
331
|
colspan: i.visibleColumns.length
|
|
332
332
|
}, [
|
|
333
|
-
|
|
333
|
+
$(i.$slots, `item-${i.i}`, {
|
|
334
334
|
item: l.value,
|
|
335
335
|
index: i.i
|
|
336
336
|
})
|
|
@@ -338,26 +338,26 @@ const Gt = ["data-i", "data-draggable"], Jt = {
|
|
|
338
338
|
key: "td" + i.i,
|
|
339
339
|
colspan: i.visibleColumns.length
|
|
340
340
|
}, [
|
|
341
|
-
|
|
341
|
+
$(i.$slots, "item", {
|
|
342
342
|
item: l.value,
|
|
343
343
|
index: i.i
|
|
344
344
|
})
|
|
345
|
-
], 8, Zt)) : (n(!0), s(
|
|
345
|
+
], 8, Zt)) : (n(!0), s(R, { key: 6 }, K(i.visibleColumns, (B) => (n(), s(R, null, [
|
|
346
346
|
f(Wt)(B, i.emptyColumns, l.value) ? (n(), s("td", {
|
|
347
347
|
key: "td" + i.i,
|
|
348
348
|
"data-column": B.key,
|
|
349
349
|
colspan: f(Me)(B, l.value),
|
|
350
|
-
title: f(
|
|
351
|
-
class: j(f(
|
|
350
|
+
title: f(ie)(B, l.value, i.i, i.visibleColumns),
|
|
351
|
+
class: j(f(ot)(B)),
|
|
352
352
|
onClick: C[2] || (C[2] = (le) => a(le))
|
|
353
353
|
}, [
|
|
354
|
-
i.$slots[B.key] && f(Ht)(B, l.value) ?
|
|
354
|
+
i.$slots[B.key] && f(Ht)(B, l.value) ? $(i.$slots, B.key, {
|
|
355
355
|
key: 0,
|
|
356
356
|
value: l.value[B.key],
|
|
357
357
|
item: l.value,
|
|
358
358
|
column: B,
|
|
359
359
|
i: i.i
|
|
360
|
-
}) : l.value ? (n(), g(
|
|
360
|
+
}) : l.value ? (n(), g(nt, {
|
|
361
361
|
key: 1,
|
|
362
362
|
modelValue: l.value,
|
|
363
363
|
"onUpdate:modelValue": C[1] || (C[1] = (le) => l.value = le),
|
|
@@ -370,7 +370,7 @@ const Gt = ["data-i", "data-draggable"], Jt = {
|
|
|
370
370
|
], 10, Ot)) : v("", !0)
|
|
371
371
|
], 64))), 256)),
|
|
372
372
|
i.canDrop && i.editModeEnabled ? (n(), s("td", _t, [
|
|
373
|
-
|
|
373
|
+
re(jt, {
|
|
374
374
|
resource: i.dropResource,
|
|
375
375
|
"resource-data": l.value,
|
|
376
376
|
confirm: i.dropConfirm,
|
|
@@ -380,12 +380,12 @@ const Gt = ["data-i", "data-draggable"], Jt = {
|
|
|
380
380
|
}, null, 8, ["resource", "resource-data", "confirm", "text", "icon"])
|
|
381
381
|
])) : v("", !0),
|
|
382
382
|
i.canEdit && i.editModeEnabled ? (n(), s("td", xt, [
|
|
383
|
-
|
|
383
|
+
re(zt, {
|
|
384
384
|
"resource-data": l.value,
|
|
385
385
|
text: i.editText,
|
|
386
386
|
icon: i.editIcon,
|
|
387
387
|
link: D.value,
|
|
388
|
-
onClick:
|
|
388
|
+
onClick: ge
|
|
389
389
|
}, null, 8, ["resource-data", "text", "icon", "link"])
|
|
390
390
|
])) : v("", !0)
|
|
391
391
|
], 10, Gt);
|
|
@@ -406,35 +406,35 @@ const Gt = ["data-i", "data-draggable"], Jt = {
|
|
|
406
406
|
},
|
|
407
407
|
emits: ["update:modelValue", "click"],
|
|
408
408
|
setup(t, { emit: r }) {
|
|
409
|
-
const d = r, o = t, u = b(o.modelValue), l = (
|
|
410
|
-
return F(() => o.modelValue, (
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
(n(!0), s(
|
|
409
|
+
const d = r, o = t, u = b(o.modelValue), l = (k) => d("click", k);
|
|
410
|
+
return F(() => o.modelValue, (k) => u.value = k), F(u, () => d("update:modelValue", u.value)), (k, I) => ve((n(), s("tr", tl, [
|
|
411
|
+
P("td", { colspan: k.hiddenColumnsColSpan }, [
|
|
412
|
+
P("table", null, [
|
|
413
|
+
P("tr", null, [
|
|
414
|
+
(n(!0), s(R, null, K(k.hiddenColumns, (p) => (n(), s("th", {
|
|
415
415
|
"data-column": p.key
|
|
416
416
|
}, [
|
|
417
|
-
|
|
417
|
+
P("div", null, x(p.label), 1)
|
|
418
418
|
], 8, al))), 256))
|
|
419
419
|
]),
|
|
420
|
-
|
|
421
|
-
(n(!0), s(
|
|
420
|
+
P("tr", { "data-i": k.i }, [
|
|
421
|
+
(n(!0), s(R, null, K(k.hiddenColumns, (p, D) => (n(), s("td", {
|
|
422
422
|
"data-column": p.key,
|
|
423
|
-
title: f(
|
|
423
|
+
title: f(ie)(p, u.value, D, k.hiddenColumns),
|
|
424
424
|
onClick: (a) => l(a, u.value)
|
|
425
425
|
}, [
|
|
426
|
-
|
|
426
|
+
k.$slots[p.key] ? $(k.$slots, p.key, {
|
|
427
427
|
key: 0,
|
|
428
428
|
value: u.value[p.key],
|
|
429
429
|
item: u.value,
|
|
430
430
|
column: p,
|
|
431
431
|
i: D
|
|
432
|
-
}) : (n(), g(
|
|
432
|
+
}) : (n(), g(nt, {
|
|
433
433
|
key: 1,
|
|
434
434
|
column: p,
|
|
435
|
-
columns:
|
|
435
|
+
columns: k.hiddenColumns,
|
|
436
436
|
modelValue: u.value,
|
|
437
|
-
"onUpdate:modelValue":
|
|
437
|
+
"onUpdate:modelValue": I[0] || (I[0] = (a) => u.value = a),
|
|
438
438
|
i: D
|
|
439
439
|
}, null, 8, ["column", "columns", "modelValue", "i"]))
|
|
440
440
|
], 8, nl))), 256))
|
|
@@ -442,10 +442,10 @@ const Gt = ["data-i", "data-draggable"], Jt = {
|
|
|
442
442
|
])
|
|
443
443
|
], 8, ll)
|
|
444
444
|
], 512)), [
|
|
445
|
-
[
|
|
445
|
+
[ye, k.hiddenIsVisible]
|
|
446
446
|
]);
|
|
447
447
|
}
|
|
448
|
-
}),
|
|
448
|
+
}), et = /* @__PURE__ */ te({
|
|
449
449
|
__name: "CreateButton",
|
|
450
450
|
props: {
|
|
451
451
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -457,12 +457,12 @@ const Gt = ["data-i", "data-draggable"], Jt = {
|
|
|
457
457
|
},
|
|
458
458
|
emits: ["click", "append"],
|
|
459
459
|
setup(t, { emit: r }) {
|
|
460
|
-
const d = r, o = t, u = c(() => V.createButtonSlot !== ""), l = c(() => V.createButtonSlot),
|
|
460
|
+
const d = r, o = t, u = c(() => V.createButtonSlot !== ""), l = c(() => V.createButtonSlot), k = {
|
|
461
461
|
...o.modalData,
|
|
462
462
|
beforeClose: (p) => {
|
|
463
463
|
"itemCreated" in p && p.itemCreated === !0 && d("append", p.item);
|
|
464
464
|
}
|
|
465
|
-
},
|
|
465
|
+
}, I = () => {
|
|
466
466
|
if (!o.modal) {
|
|
467
467
|
d("click");
|
|
468
468
|
return;
|
|
@@ -476,11 +476,11 @@ const Gt = ["data-i", "data-draggable"], Jt = {
|
|
|
476
476
|
icon: u.value ? "" : p.icon,
|
|
477
477
|
text: u.value ? "" : p.text,
|
|
478
478
|
modal: p.modal,
|
|
479
|
-
"modal-data":
|
|
479
|
+
"modal-data": k,
|
|
480
480
|
"on-click-to": p.to,
|
|
481
|
-
onClick:
|
|
481
|
+
onClick: I
|
|
482
482
|
}, {
|
|
483
|
-
default:
|
|
483
|
+
default: U(() => [
|
|
484
484
|
u.value ? (n(), g(ee(l.value), { key: 0 })) : v("", !0)
|
|
485
485
|
]),
|
|
486
486
|
_: 1
|
|
@@ -498,21 +498,21 @@ const Gt = ["data-i", "data-draggable"], Jt = {
|
|
|
498
498
|
},
|
|
499
499
|
emits: ["click"],
|
|
500
500
|
setup(t, { emit: r }) {
|
|
501
|
-
const d = r, o = t, u = c(() => Pt(o.column, o.amountOfColumns, o.items)), l = c(() => o.column.sortable === !0),
|
|
501
|
+
const d = r, o = t, u = c(() => Pt(o.column, o.amountOfColumns, o.items)), l = c(() => o.column.sortable === !0), k = c(() => l.value && o.sortBy === o.column.key ? o.sortDirection : ""), I = c(() => o.column.label.startsWith("__:") ? be(o.column.label.substring(3)) : o.column.label), p = () => d("click", o.column);
|
|
502
502
|
return (D, a) => (n(), s("th", {
|
|
503
503
|
"data-column": D.column.key,
|
|
504
504
|
"data-sortable": l.value,
|
|
505
|
-
"data-sort":
|
|
505
|
+
"data-sort": k.value,
|
|
506
506
|
colspan: u.value,
|
|
507
|
-
title:
|
|
508
|
-
class: j(f(
|
|
507
|
+
title: I.value,
|
|
508
|
+
class: j(f(ot)(D.column)),
|
|
509
509
|
onClick: p
|
|
510
510
|
}, [
|
|
511
|
-
|
|
511
|
+
P("div", null, x(I.value), 1)
|
|
512
512
|
], 10, rl));
|
|
513
513
|
}
|
|
514
514
|
});
|
|
515
|
-
var Q = /* @__PURE__ */ ((t) => (t.Table = "table", t.Item = "item", t.Ul = "ul", t.Ol = "ol", t))(Q || {}), X = /* @__PURE__ */ ((t) => (t.Create = "create", t.Update = "update", t.Edit = "edit", t.Drop = "drop", t.Sort = "sort", t.InlineEdit = "inline-edit", t.InlineCreate = "inline-create", t.ModalCreate = "modal-create", t.InlineCreateEver = "inline-create-ever", t))(X || {}),
|
|
515
|
+
var Q = /* @__PURE__ */ ((t) => (t.Table = "table", t.Item = "item", t.Ul = "ul", t.Ol = "ol", t))(Q || {}), X = /* @__PURE__ */ ((t) => (t.Create = "create", t.Update = "update", t.Edit = "edit", t.Drop = "drop", t.Sort = "sort", t.InlineEdit = "inline-edit", t.InlineCreate = "inline-create", t.ModalCreate = "modal-create", t.InlineCreateEver = "inline-create-ever", t))(X || {}), ke = /* @__PURE__ */ ((t) => (t.Asc = "asc", t.Desc = "desc", t))(ke || {});
|
|
516
516
|
const dl = ["id"], sl = {
|
|
517
517
|
key: 0,
|
|
518
518
|
class: "lkt-table-page-buttons"
|
|
@@ -543,7 +543,7 @@ const dl = ["id"], sl = {
|
|
|
543
543
|
modelValue: { default: () => [] },
|
|
544
544
|
type: { default: Q.Table },
|
|
545
545
|
columns: { default: () => [] },
|
|
546
|
-
sorter: { type: Function, default:
|
|
546
|
+
sorter: { type: Function, default: xe },
|
|
547
547
|
draggableChecker: { type: Function, default: (t) => !0 },
|
|
548
548
|
checkValidDrag: { type: Function, default: void 0 },
|
|
549
549
|
renderDrag: { type: [Boolean, Function], default: !0 },
|
|
@@ -574,6 +574,8 @@ const dl = ["id"], sl = {
|
|
|
574
574
|
confirmData: { default: () => ({}) },
|
|
575
575
|
saveResource: { default: "" },
|
|
576
576
|
saveResourceData: { default: () => ({}) },
|
|
577
|
+
saveTooltipEngine: { default: "absolute" },
|
|
578
|
+
splitSave: { type: Boolean, default: !1 },
|
|
577
579
|
saveText: { default: "Save" },
|
|
578
580
|
createText: { default: "Add item" },
|
|
579
581
|
createIcon: { default: "" },
|
|
@@ -614,19 +616,19 @@ const dl = ["id"], sl = {
|
|
|
614
616
|
"drag-end"
|
|
615
617
|
],
|
|
616
618
|
setup(t, { expose: r, emit: d }) {
|
|
617
|
-
const o = d, u =
|
|
619
|
+
const o = d, u = lt(), l = t, k = {}, I = b(typeof l.sorter == "function" ? l.sorter : xe), p = b(qt(l.columns)), D = b(ke.Asc), a = b(l.modelValue), N = b(k), z = b(null), L = b(l.columns), w = b(l.page), E = b(l.loading), he = b(!1), A = b(l.perms), ge = b(null), se = b(null), i = b({}), C = b(new At({ items: a.value }, l.dataStateConfig)), S = b(l.editMode), B = b(0), le = b(null), ne = b(!1);
|
|
618
620
|
F(E, (e) => o("update:loading", e)), F(w, (e) => o("page", e));
|
|
619
|
-
const
|
|
620
|
-
l.itemMode &&
|
|
621
|
-
const
|
|
621
|
+
const ce = b(l.type);
|
|
622
|
+
l.itemMode && ce.value === Q.Table && (ce.value = Q.Item);
|
|
623
|
+
const ut = (e) => {
|
|
622
624
|
A.value = e;
|
|
623
|
-
},
|
|
624
|
-
Array.isArray(e.data) && (a.value = e.data), E.value = !1,
|
|
625
|
+
}, rt = (e) => {
|
|
626
|
+
Array.isArray(e.data) && (a.value = e.data), E.value = !1, he.value = !0, C.value.store({ items: a.value }).turnStoredIntoOriginal(), ne.value = !1, Re(() => {
|
|
625
627
|
o("read-response", e);
|
|
626
628
|
});
|
|
627
|
-
},
|
|
628
|
-
|
|
629
|
-
},
|
|
629
|
+
}, it = () => Re(() => E.value = !0), dt = () => {
|
|
630
|
+
ge.value.doRefresh();
|
|
631
|
+
}, me = Ft(12), Ve = c(() => {
|
|
630
632
|
if (!l.hideEmptyColumns) return [];
|
|
631
633
|
let e = [];
|
|
632
634
|
return L.value.forEach((m) => {
|
|
@@ -637,17 +639,17 @@ const dl = ["id"], sl = {
|
|
|
637
639
|
Z[T] && (G = !0);
|
|
638
640
|
}), G || e.push(T);
|
|
639
641
|
}), e;
|
|
640
|
-
}),
|
|
641
|
-
let e =
|
|
642
|
+
}), Ce = c(() => L.value.filter((e) => !e.hidden)), we = c(() => L.value.filter((e) => e.hidden)), st = c(() => {
|
|
643
|
+
let e = Ce.value.length + 1;
|
|
642
644
|
return l.sortable && ++e, e;
|
|
643
|
-
}),
|
|
645
|
+
}), ct = c(() => L.value.filter((e) => e.isForRowKey)), Ne = c(() => we.value.length > 0 && !l.sortable), mt = c(() => L.value.map((e) => e.key)), Le = c(() => {
|
|
644
646
|
let e = [];
|
|
645
|
-
for (let m in u)
|
|
647
|
+
for (let m in u) mt.value.indexOf(m) !== -1 && e.push(m);
|
|
646
648
|
return e;
|
|
647
|
-
}), Fe = c(() => l.hiddenSave || E.value || !l.saveResource ? !1 :
|
|
649
|
+
}), Fe = c(() => l.hiddenSave || E.value || !l.saveResource ? !1 : S.value && ne.value ? !0 : S.value), ft = c(() => Ie.value && a.value.length >= l.requiredItemsForTopCreate || l.switchEditionEnabled ? !0 : Fe.value || S.value && ue.value), pt = c(() => l.saveDisabled || typeof l.saveValidator == "function" && !l.saveValidator(a.value) ? !1 : ne.value), vt = c(() => a.value.length), yt = c(() => ({
|
|
648
650
|
items: a.value,
|
|
649
651
|
...l.saveResourceData
|
|
650
|
-
})),
|
|
652
|
+
})), kt = c(() => l.titleTag === "" ? "h2" : l.titleTag), bt = c(() => l.wrapContentTag === "" ? "div" : l.wrapContentTag), Ee = c(() => l.title.startsWith("__:") ? be(l.title.substring(3)) : l.title), ht = c(() => l.saveText.startsWith("__:") ? be(l.saveText.substring(3)) : l.saveText), gt = c(() => l.editModeText.startsWith("__:") ? be(l.editModeText.substring(3)) : l.editModeText), ue = c(() => A.value.includes(X.Create)), Te = c(() => A.value.includes("read")), fe = c(() => A.value.includes(X.Update)), Ae = c(() => A.value.includes(X.Edit)), Ct = c(() => A.value.includes(X.InlineEdit)), St = c(() => A.value.includes(X.ModalCreate)), It = c(() => A.value.includes(X.InlineCreate)), Ue = c(() => A.value.includes(X.InlineCreateEver)), pe = c(() => A.value.includes(X.Drop)), Dt = (e) => {
|
|
651
653
|
let m = e.target;
|
|
652
654
|
if (typeof m.dataset.column > "u")
|
|
653
655
|
do
|
|
@@ -655,23 +657,27 @@ const dl = ["id"], sl = {
|
|
|
655
657
|
while (typeof m.dataset.column > "u" && m.tagName !== "TABLE" && m.tagName !== "body");
|
|
656
658
|
if (m.tagName === "TD" && (m = m.parentNode, m = m.dataset.i, typeof m < "u"))
|
|
657
659
|
return a.value[m];
|
|
658
|
-
},
|
|
660
|
+
}, Bt = (e) => a.value[e], Vt = (e) => {
|
|
659
661
|
var m;
|
|
660
662
|
return (m = z.value) == null ? void 0 : m.querySelector(`[data-i="${e}"]`);
|
|
661
|
-
}, Pe = (e) =>
|
|
662
|
-
e && e.sortable && (a.value = a.value.sort((m, T) =>
|
|
663
|
+
}, Pe = (e) => N.value["tr_" + e] === !0, He = (e) => {
|
|
664
|
+
e && e.sortable && (a.value = a.value.sort((m, T) => I.value(m, T, e, D.value)), D.value = D.value === ke.Asc ? ke.Desc : ke.Asc, p.value = e.key, o("sort", [p.value, D.value]));
|
|
663
665
|
}, We = (e) => {
|
|
664
666
|
o("click", e);
|
|
665
667
|
}, qe = (e, m) => {
|
|
666
668
|
let T = "tr_" + m;
|
|
667
|
-
|
|
668
|
-
},
|
|
669
|
+
N.value[T] = typeof N.value[T] > "u" ? !0 : !N.value[T];
|
|
670
|
+
}, wt = (e) => typeof l.checkValidDrag == "function" ? l.checkValidDrag(e) : !0, Ke = (e) => typeof l.draggableChecker == "function" ? l.draggableChecker(e) : !0, je = () => {
|
|
671
|
+
if (ue.value) {
|
|
672
|
+
o("click-create");
|
|
673
|
+
return;
|
|
674
|
+
}
|
|
669
675
|
if (Ue.value)
|
|
670
676
|
o("click-create");
|
|
671
677
|
else {
|
|
672
678
|
if (typeof l.newValueGenerator == "function") {
|
|
673
679
|
let e = l.newValueGenerator();
|
|
674
|
-
if (typeof e == "object" ||
|
|
680
|
+
if (typeof e == "object" || ce.value !== Q.Table) {
|
|
675
681
|
a.value.push(e);
|
|
676
682
|
return;
|
|
677
683
|
}
|
|
@@ -680,9 +686,9 @@ const dl = ["id"], sl = {
|
|
|
680
686
|
}
|
|
681
687
|
}, ze = (e) => {
|
|
682
688
|
a.value.push(e);
|
|
683
|
-
},
|
|
689
|
+
}, Ge = () => {
|
|
684
690
|
E.value = !0;
|
|
685
|
-
},
|
|
691
|
+
}, Je = () => {
|
|
686
692
|
E.value = !1;
|
|
687
693
|
}, Et = (e, m) => {
|
|
688
694
|
if (o("before-save"), l.saveResource && (E.value = !1, !m.success)) {
|
|
@@ -690,22 +696,22 @@ const dl = ["id"], sl = {
|
|
|
690
696
|
return;
|
|
691
697
|
}
|
|
692
698
|
C.value.turnStoredIntoOriginal(), ne.value = !1, o("save", m);
|
|
693
|
-
},
|
|
699
|
+
}, Qe = (e, m, T) => {
|
|
694
700
|
if (T >= e.length) {
|
|
695
701
|
let G = T - e.length + 1;
|
|
696
702
|
for (; G--; ) e.push(void 0);
|
|
697
703
|
}
|
|
698
704
|
return e.splice(T, 0, e.splice(m, 1)[0]), e;
|
|
699
705
|
}, Tt = (e) => {
|
|
700
|
-
|
|
706
|
+
Qe(a.value, e, e - 1), B.value = Be();
|
|
701
707
|
}, $t = (e) => {
|
|
702
|
-
|
|
708
|
+
Qe(a.value, e, e + 1), B.value = Be();
|
|
703
709
|
}, Se = (e) => {
|
|
704
710
|
a.value.splice(e, 1), B.value = Be();
|
|
705
711
|
}, Rt = () => {
|
|
706
712
|
i.value && (i.value.destroy(), i.value = {});
|
|
707
|
-
},
|
|
708
|
-
le.value || (le.value = document.getElementById("lkt-table-body-" +
|
|
713
|
+
}, Xe = () => {
|
|
714
|
+
le.value || (le.value = document.getElementById("lkt-table-body-" + me)), i.value = new Ut(le.value, {
|
|
709
715
|
direction: "vertical",
|
|
710
716
|
handle: ".handle",
|
|
711
717
|
animation: 150,
|
|
@@ -714,89 +720,99 @@ const dl = ["id"], sl = {
|
|
|
714
720
|
a.value.splice(T, 0, a.value.splice(m, 1)[0]), B.value = Be(), o("drag-end");
|
|
715
721
|
},
|
|
716
722
|
onMove: function(e, m) {
|
|
717
|
-
return
|
|
723
|
+
return wt(e);
|
|
718
724
|
}
|
|
719
725
|
});
|
|
720
726
|
}, $e = (e, m, T = !1) => {
|
|
721
|
-
let G = [B.value,
|
|
722
|
-
return T && G.push("hidden"),
|
|
727
|
+
let G = [B.value, me, "row", m];
|
|
728
|
+
return T && G.push("hidden"), ct.value.forEach((Z) => {
|
|
723
729
|
let O = String(e[Z.key]).toLowerCase();
|
|
724
|
-
O.length > 50 && (O = O.substring(0, 50)), O =
|
|
730
|
+
O.length > 50 && (O = O.substring(0, 50)), O = at(O, " ", "-"), G.push(O);
|
|
725
731
|
}), G.join("-");
|
|
726
|
-
},
|
|
732
|
+
}, Ye = c(() => typeof l.createEnabledValidator == "function" ? l.createEnabledValidator({ items: a.value }) : !0), Ie = c(() => Ue.value || ue.value && S.value || It.value && S.value || St.value && S.value), De = (e, m) => typeof l.itemDisplayChecker == "function" ? l.itemDisplayChecker(e) : !0;
|
|
727
733
|
Lt(() => {
|
|
728
734
|
l.initialSorting && He(Kt(l.columns, p.value)), C.value.store({ items: a.value }).turnStoredIntoOriginal(), ne.value = !1, l.sortable && Re(() => {
|
|
729
|
-
|
|
735
|
+
Xe();
|
|
730
736
|
});
|
|
731
737
|
}), F(() => l.sortable, (e) => {
|
|
732
|
-
e ?
|
|
733
|
-
}), F(() => l.perms, (e) => A.value = e), F(A, (e) => o("update:perms", e)), F(() => l.editMode, (e) =>
|
|
738
|
+
e ? Xe() : Rt();
|
|
739
|
+
}), F(() => l.perms, (e) => A.value = e), F(A, (e) => o("update:perms", e)), F(() => l.editMode, (e) => S.value = e), F(() => l.columns, (e) => L.value = e, { deep: !0 }), F(() => l.modelValue, (e) => a.value = e, { deep: !0 }), F(a, (e) => {
|
|
734
740
|
C.value.increment({ items: e }), ne.value = C.value.changed(), o("update:modelValue", e);
|
|
735
741
|
}, { deep: !0 }), r({
|
|
736
|
-
getItemByEvent:
|
|
737
|
-
getItemByIndex:
|
|
738
|
-
getRowByIndex:
|
|
739
|
-
doRefresh:
|
|
740
|
-
getHtml: () =>
|
|
742
|
+
getItemByEvent: Dt,
|
|
743
|
+
getItemByIndex: Bt,
|
|
744
|
+
getRowByIndex: Vt,
|
|
745
|
+
doRefresh: dt,
|
|
746
|
+
getHtml: () => se.value
|
|
741
747
|
});
|
|
742
748
|
const Mt = c(() => typeof V.defaultEmptySlot < "u"), Nt = c(() => V.defaultEmptySlot);
|
|
743
749
|
return (e, m) => {
|
|
744
750
|
const T = J("lkt-button"), G = J("lkt-field"), Z = J("lkt-loader"), O = J("lkt-paginator");
|
|
745
751
|
return n(), s("section", {
|
|
746
752
|
ref_key: "element",
|
|
747
|
-
ref:
|
|
753
|
+
ref: se,
|
|
748
754
|
class: "lkt-table-page",
|
|
749
|
-
id: "lkt-table-page-" + f(
|
|
755
|
+
id: "lkt-table-page-" + f(me)
|
|
750
756
|
}, [
|
|
751
757
|
Ee.value || f(u).title ? (n(), s("header", {
|
|
752
758
|
key: 0,
|
|
753
759
|
class: j(e.headerClass)
|
|
754
760
|
}, [
|
|
755
|
-
Ee.value ? (n(), g(ee(
|
|
756
|
-
default:
|
|
761
|
+
Ee.value ? (n(), g(ee(kt.value), { key: 0 }, {
|
|
762
|
+
default: U(() => [
|
|
757
763
|
e.titleIcon ? (n(), s("i", {
|
|
758
764
|
key: 0,
|
|
759
765
|
class: j(e.titleIcon)
|
|
760
766
|
}, null, 2)) : v("", !0),
|
|
761
|
-
|
|
767
|
+
de(" " + x(Ee.value), 1)
|
|
762
768
|
]),
|
|
763
769
|
_: 1
|
|
764
770
|
})) : v("", !0),
|
|
765
|
-
f(u).title ?
|
|
771
|
+
f(u).title ? $(e.$slots, "title", { key: 1 }) : v("", !0)
|
|
766
772
|
], 2)) : v("", !0),
|
|
767
|
-
(n(), g(ee(
|
|
773
|
+
(n(), g(ee(bt.value), {
|
|
768
774
|
class: j(["lkt-table-page-content-wrapper", e.wrapContentClass])
|
|
769
775
|
}, {
|
|
770
|
-
default:
|
|
771
|
-
|
|
772
|
-
|
|
776
|
+
default: U(() => [
|
|
777
|
+
ft.value ? (n(), s("div", sl, [
|
|
778
|
+
ve(re(T, {
|
|
773
779
|
class: "lkt-table--save-button",
|
|
774
780
|
ref: "saveButton",
|
|
775
781
|
icon: f(V).defaultSaveIcon,
|
|
776
|
-
disabled: !
|
|
782
|
+
disabled: !pt.value,
|
|
777
783
|
"confirm-modal": e.saveConfirm,
|
|
778
784
|
"confirm-data": e.confirmData,
|
|
779
785
|
resource: e.saveResource,
|
|
780
|
-
"resource-data":
|
|
781
|
-
|
|
782
|
-
|
|
786
|
+
"resource-data": yt.value,
|
|
787
|
+
split: e.splitSave,
|
|
788
|
+
"tooltip-engine": e.saveTooltipEngine,
|
|
789
|
+
onLoading: Ge,
|
|
790
|
+
onLoaded: Je,
|
|
783
791
|
onClick: Et
|
|
784
792
|
}, {
|
|
785
|
-
|
|
786
|
-
|
|
793
|
+
split: U(({ doClose: h, doRootClick: y }) => [
|
|
794
|
+
$(e.$slots, "button-save-split", {
|
|
795
|
+
doClose: h,
|
|
796
|
+
doRootClick: y,
|
|
797
|
+
onButtonLoading: Ge,
|
|
798
|
+
onButtonLoaded: Je
|
|
799
|
+
})
|
|
800
|
+
]),
|
|
801
|
+
default: U(() => [
|
|
802
|
+
f(u)["button-save"] ? $(e.$slots, "button-save", {
|
|
787
803
|
key: 0,
|
|
788
804
|
items: a.value,
|
|
789
805
|
editMode: e.editMode,
|
|
790
806
|
canUpdate: !e.saveDisabled
|
|
791
|
-
}) : (n(), s("span", cl, x(
|
|
807
|
+
}) : (n(), s("span", cl, x(ht.value), 1))
|
|
792
808
|
]),
|
|
793
809
|
_: 3
|
|
794
|
-
}, 8, ["icon", "disabled", "confirm-modal", "confirm-data", "resource", "resource-data"]), [
|
|
795
|
-
[
|
|
810
|
+
}, 8, ["icon", "disabled", "confirm-modal", "confirm-data", "resource", "resource-data", "split", "tooltip-engine"]), [
|
|
811
|
+
[ye, Fe.value]
|
|
796
812
|
]),
|
|
797
|
-
Ie.value && a.value.length >= e.requiredItemsForTopCreate ? (n(), g(
|
|
813
|
+
Ie.value && a.value.length >= e.requiredItemsForTopCreate ? (n(), g(et, {
|
|
798
814
|
key: 0,
|
|
799
|
-
disabled: !
|
|
815
|
+
disabled: !Ye.value || e.createDisabled,
|
|
800
816
|
text: e.createText,
|
|
801
817
|
icon: e.createIcon,
|
|
802
818
|
to: e.createRoute,
|
|
@@ -805,38 +821,38 @@ const dl = ["id"], sl = {
|
|
|
805
821
|
onClick: je,
|
|
806
822
|
onAppend: ze
|
|
807
823
|
}, null, 8, ["disabled", "text", "icon", "to", "modal", "modal-data"])) : v("", !0),
|
|
808
|
-
|
|
809
|
-
|
|
824
|
+
P("div", ml, [
|
|
825
|
+
ve(re(G, {
|
|
810
826
|
type: "switch",
|
|
811
|
-
modelValue:
|
|
812
|
-
"onUpdate:modelValue": m[0] || (m[0] = (h) =>
|
|
813
|
-
label:
|
|
827
|
+
modelValue: S.value,
|
|
828
|
+
"onUpdate:modelValue": m[0] || (m[0] = (h) => S.value = h),
|
|
829
|
+
label: gt.value
|
|
814
830
|
}, null, 8, ["modelValue", "label"]), [
|
|
815
|
-
[
|
|
831
|
+
[ye, e.switchEditionEnabled]
|
|
816
832
|
])
|
|
817
833
|
])
|
|
818
834
|
])) : v("", !0),
|
|
819
835
|
f(u).buttons ? (n(), s("div", fl, [
|
|
820
|
-
|
|
836
|
+
$(e.$slots, "buttons")
|
|
821
837
|
])) : v("", !0),
|
|
822
|
-
|
|
823
|
-
|
|
838
|
+
he.value && f(u).filters ? (n(), s("div", pl, [
|
|
839
|
+
$(e.$slots, "filters", {
|
|
824
840
|
items: a.value,
|
|
825
841
|
isLoading: E.value
|
|
826
842
|
})
|
|
827
843
|
])) : v("", !0),
|
|
828
844
|
E.value ? (n(), g(Z, { key: 3 })) : v("", !0),
|
|
829
|
-
|
|
845
|
+
ve(P("div", {
|
|
830
846
|
class: "lkt-table",
|
|
831
847
|
"data-sortable": e.sortable
|
|
832
848
|
}, [
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
e.sortable &&
|
|
837
|
-
e.addNavigation &&
|
|
849
|
+
ce.value === f(Q).Table ? (n(), s("table", yl, [
|
|
850
|
+
P("thead", null, [
|
|
851
|
+
P("tr", null, [
|
|
852
|
+
e.sortable && S.value ? (n(), s("th", kl)) : v("", !0),
|
|
853
|
+
e.addNavigation && S.value ? (n(), s("th", bl)) : v("", !0),
|
|
838
854
|
Ne.value ? (n(), s("th", hl)) : v("", !0),
|
|
839
|
-
(n(!0), s(
|
|
855
|
+
(n(!0), s(R, null, K(Ce.value, (h) => (n(), s(R, null, [
|
|
840
856
|
Ve.value.indexOf(h.key) === -1 ? (n(), g(il, {
|
|
841
857
|
key: 0,
|
|
842
858
|
column: h,
|
|
@@ -844,42 +860,42 @@ const dl = ["id"], sl = {
|
|
|
844
860
|
"sort-direction": D.value,
|
|
845
861
|
"amount-of-columns": e.columns.length,
|
|
846
862
|
items: a.value,
|
|
847
|
-
onClick: (
|
|
863
|
+
onClick: (y) => He(h)
|
|
848
864
|
}, null, 8, ["column", "sort-by", "sort-direction", "amount-of-columns", "items", "onClick"])) : v("", !0)
|
|
849
865
|
], 64))), 256)),
|
|
850
|
-
|
|
851
|
-
Ae.value &&
|
|
866
|
+
pe.value && S.value ? (n(), s("th", gl)) : v("", !0),
|
|
867
|
+
Ae.value && fe.value && S.value ? (n(), s("th", Cl)) : v("", !0)
|
|
852
868
|
])
|
|
853
869
|
]),
|
|
854
|
-
|
|
870
|
+
P("tbody", {
|
|
855
871
|
ref_key: "tableBody",
|
|
856
872
|
ref: z,
|
|
857
|
-
id: "lkt-table-body-" + f(
|
|
873
|
+
id: "lkt-table-body-" + f(me)
|
|
858
874
|
}, [
|
|
859
|
-
(n(!0), s(
|
|
860
|
-
modelValue: a.value[
|
|
861
|
-
"onUpdate:modelValue": (
|
|
862
|
-
key: $e(h,
|
|
863
|
-
i:
|
|
875
|
+
(n(!0), s(R, null, K(a.value, (h, y) => ve((n(), g(el, {
|
|
876
|
+
modelValue: a.value[y],
|
|
877
|
+
"onUpdate:modelValue": (W) => a.value[y] = W,
|
|
878
|
+
key: $e(h, y),
|
|
879
|
+
i: y,
|
|
864
880
|
"display-hidden-columns-indicator": Ne.value,
|
|
865
881
|
"is-draggable": Ke(h),
|
|
866
882
|
sortable: e.sortable,
|
|
867
|
-
"visible-columns":
|
|
883
|
+
"visible-columns": Ce.value,
|
|
868
884
|
"empty-columns": Ve.value,
|
|
869
885
|
"add-navigation": e.addNavigation,
|
|
870
|
-
"hidden-is-visible": Pe(
|
|
871
|
-
"latest-row":
|
|
872
|
-
"can-drop":
|
|
886
|
+
"hidden-is-visible": Pe(y),
|
|
887
|
+
"latest-row": y + 1 === vt.value,
|
|
888
|
+
"can-drop": pe.value && S.value,
|
|
873
889
|
"drop-confirm": e.dropConfirm,
|
|
874
890
|
"drop-resource": e.dropResource,
|
|
875
891
|
"drop-text": e.dropText,
|
|
876
892
|
"drop-icon": e.dropIcon,
|
|
877
|
-
"can-edit": Ae.value &&
|
|
893
|
+
"can-edit": Ae.value && fe.value && S.value,
|
|
878
894
|
"edit-text": e.editText,
|
|
879
895
|
"edit-icon": e.editIcon,
|
|
880
896
|
"edit-link": e.editLink,
|
|
881
|
-
"edit-mode-enabled":
|
|
882
|
-
"has-inline-edit-perm":
|
|
897
|
+
"edit-mode-enabled": S.value,
|
|
898
|
+
"has-inline-edit-perm": Ct.value,
|
|
883
899
|
"row-display-type": e.rowDisplayType,
|
|
884
900
|
"render-drag": e.renderDrag,
|
|
885
901
|
onClick: We,
|
|
@@ -887,30 +903,30 @@ const dl = ["id"], sl = {
|
|
|
887
903
|
onItemUp: Tt,
|
|
888
904
|
onItemDown: $t,
|
|
889
905
|
onItemDrop: Se
|
|
890
|
-
},
|
|
891
|
-
f(u)[`item-${
|
|
892
|
-
name: `item-${
|
|
893
|
-
fn:
|
|
894
|
-
|
|
895
|
-
[e.slotItemVar || ""]:
|
|
896
|
-
index:
|
|
906
|
+
}, Oe({ _: 2 }, [
|
|
907
|
+
f(u)[`item-${y}`] ? {
|
|
908
|
+
name: `item-${y}`,
|
|
909
|
+
fn: U((W) => [
|
|
910
|
+
$(e.$slots, `item-${y}`, oe({
|
|
911
|
+
[e.slotItemVar || ""]: W.item,
|
|
912
|
+
index: y
|
|
897
913
|
}))
|
|
898
914
|
]),
|
|
899
915
|
key: "0"
|
|
900
916
|
} : f(u).item ? {
|
|
901
917
|
name: "item",
|
|
902
|
-
fn:
|
|
903
|
-
|
|
904
|
-
[e.slotItemVar || ""]:
|
|
905
|
-
index:
|
|
918
|
+
fn: U((W) => [
|
|
919
|
+
$(e.$slots, "item", oe({
|
|
920
|
+
[e.slotItemVar || ""]: W.item,
|
|
921
|
+
index: y
|
|
906
922
|
}))
|
|
907
923
|
]),
|
|
908
924
|
key: "1"
|
|
909
925
|
} : void 0,
|
|
910
|
-
K(Le.value, (
|
|
911
|
-
name:
|
|
912
|
-
fn:
|
|
913
|
-
|
|
926
|
+
K(Le.value, (W) => ({
|
|
927
|
+
name: W,
|
|
928
|
+
fn: U((ae) => [
|
|
929
|
+
$(e.$slots, W, oe({
|
|
914
930
|
[e.slotItemVar || ""]: ae.item,
|
|
915
931
|
value: ae.value,
|
|
916
932
|
column: ae.column
|
|
@@ -918,27 +934,27 @@ const dl = ["id"], sl = {
|
|
|
918
934
|
])
|
|
919
935
|
}))
|
|
920
936
|
]), 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"])), [
|
|
921
|
-
[
|
|
937
|
+
[ye, De(a.value[y])]
|
|
922
938
|
])), 128)),
|
|
923
|
-
we.value.length > 0 ? (n(!0), s(
|
|
924
|
-
modelValue: a.value[
|
|
925
|
-
"onUpdate:modelValue": (
|
|
926
|
-
key: $e(h,
|
|
927
|
-
i:
|
|
939
|
+
we.value.length > 0 ? (n(!0), s(R, { key: 0 }, K(a.value, (h, y) => (n(), g(ul, {
|
|
940
|
+
modelValue: a.value[y],
|
|
941
|
+
"onUpdate:modelValue": (W) => a.value[y] = W,
|
|
942
|
+
key: $e(h, y, !0),
|
|
943
|
+
i: y,
|
|
928
944
|
"hidden-columns": we.value,
|
|
929
|
-
"hidden-columns-col-span":
|
|
945
|
+
"hidden-columns-col-span": st.value,
|
|
930
946
|
"is-draggable": Ke(h),
|
|
931
947
|
sortable: e.sortable,
|
|
932
|
-
"visible-columns":
|
|
948
|
+
"visible-columns": Ce.value,
|
|
933
949
|
"empty-columns": Ve.value,
|
|
934
|
-
"hidden-is-visible": Pe(
|
|
950
|
+
"hidden-is-visible": Pe(y),
|
|
935
951
|
onClick: We,
|
|
936
952
|
onShow: qe
|
|
937
|
-
},
|
|
938
|
-
K(Le.value, (
|
|
939
|
-
name:
|
|
940
|
-
fn:
|
|
941
|
-
|
|
953
|
+
}, Oe({ _: 2 }, [
|
|
954
|
+
K(Le.value, (W) => ({
|
|
955
|
+
name: W,
|
|
956
|
+
fn: U((ae) => [
|
|
957
|
+
$(e.$slots, W, oe({
|
|
942
958
|
[e.slotItemVar || ""]: ae.item,
|
|
943
959
|
value: ae.value,
|
|
944
960
|
column: ae.column
|
|
@@ -947,29 +963,29 @@ const dl = ["id"], sl = {
|
|
|
947
963
|
}))
|
|
948
964
|
]), 1032, ["modelValue", "onUpdate:modelValue", "i", "hidden-columns", "hidden-columns-col-span", "is-draggable", "sortable", "visible-columns", "empty-columns", "hidden-is-visible"]))), 128)) : v("", !0)
|
|
949
965
|
], 8, Sl)
|
|
950
|
-
])) :
|
|
966
|
+
])) : ce.value === f(Q).Item ? (n(), s("div", {
|
|
951
967
|
key: 1,
|
|
952
968
|
ref_key: "tableBody",
|
|
953
969
|
ref: z,
|
|
954
|
-
id: "lkt-table-body-" + f(
|
|
970
|
+
id: "lkt-table-body-" + f(me),
|
|
955
971
|
class: j(["lkt-table-items-container", e.itemsContainerClass])
|
|
956
972
|
}, [
|
|
957
|
-
(n(!0), s(
|
|
973
|
+
(n(!0), s(R, null, K(a.value, (h, y) => (n(), s(R, null, [
|
|
958
974
|
De(h) ? (n(), s("div", {
|
|
959
975
|
class: "lkt-table-item",
|
|
960
|
-
"data-i":
|
|
961
|
-
key: $e(h,
|
|
976
|
+
"data-i": y,
|
|
977
|
+
key: $e(h, y)
|
|
962
978
|
}, [
|
|
963
|
-
|
|
979
|
+
$(e.$slots, "item", oe({
|
|
964
980
|
[e.slotItemVar || ""]: h,
|
|
965
|
-
index:
|
|
966
|
-
editing:
|
|
967
|
-
canCreate:
|
|
981
|
+
index: y,
|
|
982
|
+
editing: S.value,
|
|
983
|
+
canCreate: ue.value,
|
|
968
984
|
canRead: Te.value,
|
|
969
|
-
canUpdate:
|
|
970
|
-
canDrop:
|
|
985
|
+
canUpdate: fe.value,
|
|
986
|
+
canDrop: pe.value,
|
|
971
987
|
isLoading: E.value,
|
|
972
|
-
doDrop: () => Se(
|
|
988
|
+
doDrop: () => Se(y)
|
|
973
989
|
}))
|
|
974
990
|
], 8, Dl)) : v("", !0)
|
|
975
991
|
], 64))), 256))
|
|
@@ -977,22 +993,22 @@ const dl = ["id"], sl = {
|
|
|
977
993
|
key: 2,
|
|
978
994
|
class: j(["lkt-table-items-container", e.itemsContainerClass])
|
|
979
995
|
}, [
|
|
980
|
-
(n(!0), s(
|
|
996
|
+
(n(!0), s(R, null, K(a.value, (h, y) => (n(), s(R, null, [
|
|
981
997
|
De(h) ? (n(), s("li", {
|
|
982
998
|
key: 0,
|
|
983
999
|
class: "lkt-table-item",
|
|
984
|
-
"data-i":
|
|
1000
|
+
"data-i": y
|
|
985
1001
|
}, [
|
|
986
|
-
|
|
1002
|
+
$(e.$slots, "item", oe({
|
|
987
1003
|
[e.slotItemVar || ""]: h,
|
|
988
|
-
index:
|
|
989
|
-
editing:
|
|
990
|
-
canCreate:
|
|
1004
|
+
index: y,
|
|
1005
|
+
editing: S.value,
|
|
1006
|
+
canCreate: ue.value,
|
|
991
1007
|
canRead: Te.value,
|
|
992
|
-
canUpdate:
|
|
993
|
-
canDrop:
|
|
1008
|
+
canUpdate: fe.value,
|
|
1009
|
+
canDrop: pe.value,
|
|
994
1010
|
isLoading: E.value,
|
|
995
|
-
doDrop: () => Se(
|
|
1011
|
+
doDrop: () => Se(y)
|
|
996
1012
|
}))
|
|
997
1013
|
], 8, Bl)) : v("", !0)
|
|
998
1014
|
], 64))), 256))
|
|
@@ -1000,41 +1016,41 @@ const dl = ["id"], sl = {
|
|
|
1000
1016
|
key: 3,
|
|
1001
1017
|
class: j(["lkt-table-items-container", e.itemsContainerClass])
|
|
1002
1018
|
}, [
|
|
1003
|
-
(n(!0), s(
|
|
1019
|
+
(n(!0), s(R, null, K(a.value, (h, y) => (n(), s(R, null, [
|
|
1004
1020
|
De(h) ? (n(), s("li", {
|
|
1005
1021
|
key: 0,
|
|
1006
1022
|
class: "lkt-table-item",
|
|
1007
|
-
"data-i":
|
|
1023
|
+
"data-i": y
|
|
1008
1024
|
}, [
|
|
1009
|
-
|
|
1025
|
+
$(e.$slots, "item", oe({
|
|
1010
1026
|
[e.slotItemVar || ""]: h,
|
|
1011
|
-
index:
|
|
1012
|
-
editing:
|
|
1013
|
-
canCreate:
|
|
1027
|
+
index: y,
|
|
1028
|
+
editing: S.value,
|
|
1029
|
+
canCreate: ue.value,
|
|
1014
1030
|
canRead: Te.value,
|
|
1015
|
-
canUpdate:
|
|
1016
|
-
canDrop:
|
|
1031
|
+
canUpdate: fe.value,
|
|
1032
|
+
canDrop: pe.value,
|
|
1017
1033
|
isLoading: E.value,
|
|
1018
|
-
doDrop: () => Se(
|
|
1034
|
+
doDrop: () => Se(y)
|
|
1019
1035
|
}))
|
|
1020
1036
|
], 8, Vl)) : v("", !0)
|
|
1021
1037
|
], 64))), 256))
|
|
1022
1038
|
], 2)) : v("", !0)
|
|
1023
1039
|
], 8, vl), [
|
|
1024
|
-
[
|
|
1040
|
+
[ye, !E.value && a.value.length > 0]
|
|
1025
1041
|
]),
|
|
1026
1042
|
!E.value && a.value.length === 0 ? (n(), s("div", wl, [
|
|
1027
|
-
f(u).empty ?
|
|
1043
|
+
f(u).empty ? $(e.$slots, "empty", { key: 0 }) : Mt.value ? (n(), g(ee(Nt.value), {
|
|
1028
1044
|
key: 1,
|
|
1029
1045
|
message: e.noResultsText
|
|
1030
|
-
}, null, 8, ["message"])) : e.noResultsText ? (n(), s(
|
|
1031
|
-
|
|
1046
|
+
}, null, 8, ["message"])) : e.noResultsText ? (n(), s(R, { key: 2 }, [
|
|
1047
|
+
de(x(e.noResultsText), 1)
|
|
1032
1048
|
], 64)) : v("", !0)
|
|
1033
1049
|
])) : v("", !0),
|
|
1034
1050
|
Ie.value || f(u).bottomButtons ? (n(), s("div", El, [
|
|
1035
|
-
Ie.value && a.value.length >= e.requiredItemsForBottomCreate ? (n(), g(
|
|
1051
|
+
Ie.value && a.value.length >= e.requiredItemsForBottomCreate ? (n(), g(et, {
|
|
1036
1052
|
key: 0,
|
|
1037
|
-
disabled: !
|
|
1053
|
+
disabled: !Ye.value || e.createDisabled,
|
|
1038
1054
|
text: e.createText,
|
|
1039
1055
|
icon: e.createIcon,
|
|
1040
1056
|
to: e.createRoute,
|
|
@@ -1043,19 +1059,19 @@ const dl = ["id"], sl = {
|
|
|
1043
1059
|
onClick: je,
|
|
1044
1060
|
onAppend: ze
|
|
1045
1061
|
}, null, 8, ["disabled", "text", "icon", "to", "modal", "modal-data"])) : v("", !0),
|
|
1046
|
-
|
|
1062
|
+
$(e.$slots, "bottom-buttons")
|
|
1047
1063
|
])) : v("", !0),
|
|
1048
1064
|
e.resource.length > 0 ? (n(), g(O, {
|
|
1049
1065
|
key: 6,
|
|
1050
1066
|
ref_key: "paginator",
|
|
1051
|
-
ref:
|
|
1067
|
+
ref: ge,
|
|
1052
1068
|
modelValue: w.value,
|
|
1053
1069
|
"onUpdate:modelValue": m[1] || (m[1] = (h) => w.value = h),
|
|
1054
1070
|
resource: e.resource,
|
|
1055
1071
|
filters: e.filters,
|
|
1056
|
-
onLoading:
|
|
1057
|
-
onPerms:
|
|
1058
|
-
onResponse:
|
|
1072
|
+
onLoading: it,
|
|
1073
|
+
onPerms: ut,
|
|
1074
|
+
onResponse: rt
|
|
1059
1075
|
}, null, 8, ["modelValue", "resource", "filters"])) : v("", !0)
|
|
1060
1076
|
]),
|
|
1061
1077
|
_: 3
|
|
@@ -1073,7 +1089,7 @@ const dl = ["id"], sl = {
|
|
|
1073
1089
|
V.defaultSaveIcon = t;
|
|
1074
1090
|
};
|
|
1075
1091
|
export {
|
|
1076
|
-
|
|
1092
|
+
H as Column,
|
|
1077
1093
|
Hl as createActionColumn,
|
|
1078
1094
|
Gl as createCheckColumn,
|
|
1079
1095
|
Ul as createColumn,
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.lkt-table-page{display:flex;width:100%;flex-direction:column;gap:var(--lkt-table-page-gap)}.lkt-table-page-content-wrapper{display:grid;width:100%;flex-direction:column;gap:var(--lkt-table-page-gap)}.lkt-table{width:var(--lkt-table-width);font-family:var(--lkt-table-font-family),serif}.lkt-table .lkt-field{--lkt-field-font-size: var(--lkt-table-font-size-row)}.lkt-table>table{width:100%;max-width:100%;border-collapse:var(--lkt-table-border-collapse);border-radius:var(--lkt-table-border-radius);border-spacing:var(--lkt-table-border-spacing)}.lkt-table th,.lkt-table td{vertical-align:middle;text-align:var(--lkt-table-text-align);padding:var(--lkt-table-padding-row);font-size:var(--lkt-table-font-size-row);color:var(--lkt-table-color-row)}.lkt-table th{font-family:var(--lkt-table-font-family-header),serif;padding:var(--lkt-table-padding-header)}.lkt-table thead tr{background-color:var(--lkt-table-bg-header);position:sticky;top:0;z-index:1}.lkt-table tbody tr{background-color:var(--lkt-table-bg-row)}.lkt-table tbody tr:nth-child(odd){background-color:var(--lkt-table-bg-row-odd)}.lkt-table [data-sort=asc]>div,.lkt-table [data-sort=desc]>div{display:inline-block}.lkt-table [data-sort=asc]>div:after,.lkt-table [data-sort=desc]>div:after{font-family:var(--lkt-table-font-family-sort-icon),serif;display:inline-block;font-size:var(--lkt-table-font-size-sort-icon)}.lkt-table [data-sort=asc]>div:after{content:var(--lkt-table-sort-icon-content-asc)}.lkt-table [data-sort=desc]>div:after{content:var(--lkt-table-sort-icon-content-desc)}.lkt-table td[data-role=drag-indicator],.lkt-table td[data-role=invalid-drag-indicator]{width:var(--lkt-table-width-drag);height:40px;padding:0!important;position:relative;background:#eee;cursor:pointer}.lkt-table td[data-role=drag-indicator]:before,.lkt-table td[data-role=invalid-drag-indicator]:before{content:"";display:block;background:#d4d4d4;border-bottom:1px solid #848484;margin:auto;position:absolute;top:0;left:0;height:100%;width:100%}.lkt-table td[data-role=drag-indicator]:after,.lkt-table td[data-role=invalid-drag-indicator]:after{content:"…";color:#000;display:block;position:absolute;top:50%;left:60%;font-weight:700;width:15px;height:7px;transform:rotate(90deg);transform-origin:center center}[data-lkt=empty-table]{border:1px solid #ddd;border-radius:var(--lkt-table-border-radius);width:100%;padding:10px;background-color:#f8f7e5;font-family:var(--lkt-table-font-family);font-size:13px;color:#444;text-align:var(--lkt-table-text-align)}.sortable-chosen{border:var(--lkt-table-border-sortable-chosen)}.sortable-chosen.ghost{background:var(--lkt-table-bg-sortable-chosen-ghost)}.lkt-table td.lkt-table-nav-cell{padding:0}.lkt-table-nav-container{display:flex;align-items:center;flex-direction:column;justify-content:center}.lkt-table-page-buttons{position:sticky;top:calc(-1 * var(--lkt-table-gap-buttons));display:flex;align-items:center;gap:var(--lkt-table-gap-buttons);transition:all linear .15s;background:transparent;z-index:
|
|
1
|
+
.lkt-table-page{display:flex;width:100%;flex-direction:column;gap:var(--lkt-table-page-gap)}.lkt-table-page-content-wrapper{display:grid;width:100%;flex-direction:column;gap:var(--lkt-table-page-gap)}.lkt-table{width:var(--lkt-table-width);font-family:var(--lkt-table-font-family),serif}.lkt-table .lkt-field{--lkt-field-font-size: var(--lkt-table-font-size-row)}.lkt-table>table{width:100%;max-width:100%;border-collapse:var(--lkt-table-border-collapse);border-radius:var(--lkt-table-border-radius);border-spacing:var(--lkt-table-border-spacing)}.lkt-table th,.lkt-table td{vertical-align:middle;text-align:var(--lkt-table-text-align);padding:var(--lkt-table-padding-row);font-size:var(--lkt-table-font-size-row);color:var(--lkt-table-color-row)}.lkt-table th{font-family:var(--lkt-table-font-family-header),serif;padding:var(--lkt-table-padding-header)}.lkt-table thead tr{background-color:var(--lkt-table-bg-header);position:sticky;top:0;z-index:1}.lkt-table tbody tr{background-color:var(--lkt-table-bg-row)}.lkt-table tbody tr:nth-child(odd){background-color:var(--lkt-table-bg-row-odd)}.lkt-table [data-sort=asc]>div,.lkt-table [data-sort=desc]>div{display:inline-block}.lkt-table [data-sort=asc]>div:after,.lkt-table [data-sort=desc]>div:after{font-family:var(--lkt-table-font-family-sort-icon),serif;display:inline-block;font-size:var(--lkt-table-font-size-sort-icon)}.lkt-table [data-sort=asc]>div:after{content:var(--lkt-table-sort-icon-content-asc)}.lkt-table [data-sort=desc]>div:after{content:var(--lkt-table-sort-icon-content-desc)}.lkt-table td[data-role=drag-indicator],.lkt-table td[data-role=invalid-drag-indicator]{width:var(--lkt-table-width-drag);height:40px;padding:0!important;position:relative;background:#eee;cursor:pointer}.lkt-table td[data-role=drag-indicator]:before,.lkt-table td[data-role=invalid-drag-indicator]:before{content:"";display:block;background:#d4d4d4;border-bottom:1px solid #848484;margin:auto;position:absolute;top:0;left:0;height:100%;width:100%}.lkt-table td[data-role=drag-indicator]:after,.lkt-table td[data-role=invalid-drag-indicator]:after{content:"…";color:#000;display:block;position:absolute;top:50%;left:60%;font-weight:700;width:15px;height:7px;transform:rotate(90deg);transform-origin:center center}[data-lkt=empty-table]{border:1px solid #ddd;border-radius:var(--lkt-table-border-radius);width:100%;padding:10px;background-color:#f8f7e5;font-family:var(--lkt-table-font-family);font-size:13px;color:#444;text-align:var(--lkt-table-text-align)}.sortable-chosen{border:var(--lkt-table-border-sortable-chosen)}.sortable-chosen.ghost{background:var(--lkt-table-bg-sortable-chosen-ghost)}.lkt-table td.lkt-table-nav-cell{padding:0}.lkt-table-nav-container{display:flex;align-items:center;flex-direction:column;justify-content:center}.lkt-table-page-buttons{position:sticky;top:calc(-1 * var(--lkt-table-gap-buttons));display:flex;align-items:center;gap:var(--lkt-table-gap-buttons);transition:all linear .15s;background:transparent;z-index:6}.lkt-table-page-buttons-bottom{justify-content:center}.lkt-table-page-buttons>.switch-edition-mode{margin-left:auto}.lkt-table .lkt-table-col-drop{width:var(--lkt-table-width-col-drop);text-align:var(--lkt-table-text-align-col-drop)}
|
package/package.json
CHANGED
|
@@ -74,6 +74,8 @@ const props = withDefaults(defineProps<{
|
|
|
74
74
|
confirmData?: LktObject
|
|
75
75
|
saveResource?: string
|
|
76
76
|
saveResourceData?: LktObject
|
|
77
|
+
saveTooltipEngine?: string
|
|
78
|
+
splitSave?: boolean
|
|
77
79
|
saveText?: string
|
|
78
80
|
createText?: string
|
|
79
81
|
createIcon?: string
|
|
@@ -126,6 +128,7 @@ const props = withDefaults(defineProps<{
|
|
|
126
128
|
wrapContentTag: 'div',
|
|
127
129
|
wrapContentClass: '',
|
|
128
130
|
itemsContainerClass: '',
|
|
131
|
+
saveTooltipEngine: 'absolute',
|
|
129
132
|
filters: () => [],
|
|
130
133
|
dataStateConfig: () => ({}),
|
|
131
134
|
hiddenSave: false,
|
|
@@ -136,6 +139,7 @@ const props = withDefaults(defineProps<{
|
|
|
136
139
|
confirmData: () => ({}),
|
|
137
140
|
saveResource: '',
|
|
138
141
|
saveResourceData: () => ({}),
|
|
142
|
+
splitSave: false,
|
|
139
143
|
saveText: 'Save',
|
|
140
144
|
dropText: 'Delete',
|
|
141
145
|
dropIcon: '',
|
|
@@ -378,6 +382,11 @@ const getItemByEvent = (e: any) => {
|
|
|
378
382
|
return true;
|
|
379
383
|
},
|
|
380
384
|
onClickAddItem = () => {
|
|
385
|
+
if (hasCreatePerm.value) {
|
|
386
|
+
emit('click-create');
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
|
|
381
390
|
if (!hasInlineCreateEverPerm.value) {
|
|
382
391
|
if (typeof props.newValueGenerator === 'function') {
|
|
383
392
|
let newValue = props.newValueGenerator();
|
|
@@ -489,6 +498,7 @@ const getItemByEvent = (e: any) => {
|
|
|
489
498
|
}),
|
|
490
499
|
computedDisplayCreateButton = computed(() => {
|
|
491
500
|
return hasInlineCreateEverPerm.value
|
|
501
|
+
|| (hasCreatePerm.value && editModeEnabled.value)
|
|
492
502
|
|| (hasInlineCreatePerm.value && editModeEnabled.value)
|
|
493
503
|
|| (hasModalCreatePerm.value && editModeEnabled.value);
|
|
494
504
|
}),
|
|
@@ -576,6 +586,8 @@ const hasEmptySlot = computed(() => {
|
|
|
576
586
|
:confirm-data="confirmData"
|
|
577
587
|
:resource="saveResource"
|
|
578
588
|
:resource-data="computedSaveResourceData"
|
|
589
|
+
:split="splitSave"
|
|
590
|
+
:tooltip-engine="saveTooltipEngine"
|
|
579
591
|
v-on:loading="onButtonLoading"
|
|
580
592
|
v-on:loaded="onButtonLoaded"
|
|
581
593
|
v-on:click="onSave">
|
|
@@ -585,6 +597,14 @@ const hasEmptySlot = computed(() => {
|
|
|
585
597
|
:edit-mode="editMode"
|
|
586
598
|
:can-update="!saveDisabled"></slot>
|
|
587
599
|
<span v-else>{{ computedSaveText }}</span>
|
|
600
|
+
|
|
601
|
+
<template v-slot:split="{doClose, doRootClick}">
|
|
602
|
+
<slot name="button-save-split"
|
|
603
|
+
:do-close="doClose"
|
|
604
|
+
:do-root-click="doRootClick"
|
|
605
|
+
:on-button-loading="onButtonLoading"
|
|
606
|
+
:on-button-loaded="onButtonLoaded" />
|
|
607
|
+
</template>
|
|
588
608
|
</lkt-button>
|
|
589
609
|
|
|
590
610
|
<create-button
|