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