lkt-table 2.0.7 → 2.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/build.js CHANGED
@@ -1,186 +1,1119 @@
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
- import { time as ae } from "lkt-date-tools";
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;
1
+ import { defineComponent as ae, computed as u, ref as C, shallowReactive as Pt, watch as H, watchEffect as Rt, onMounted as jt, onBeforeUnmount as wa, reactive as $t, provide as ta, h as X, useId as Ca, inject as ut, getCurrentInstance as Da, onUnmounted as Ba, onUpdated as Ia, cloneVNode as Ta, resolveComponent as ve, createBlock as $, createElementBlock as h, unref as B, openBlock as d, normalizeProps as Ee, mergeProps as fe, withCtx as F, createTextVNode as Ae, toDisplayString as Pe, Fragment as x, withModifiers as aa, createCommentVNode as A, resolveDynamicComponent as Ie, useSlots as la, normalizeClass as re, createElementVNode as J, createVNode as Be, renderSlot as z, renderList as ie, withDirectives as it, vShow as rt, mergeDefaults as Ea, nextTick as bt, createSlots as Xt } from "vue";
2
+ import { __ as Aa } from "lkt-i18n";
3
+ import { SortDirection as Oe, Column as na, ColumnType as yt, prepareResourceData as oa, TableRowType as Ze, extractI18nValue as ia, LktSettings as tt, ensureButtonConfig as ht, TablePermission as we, PaginatorType as kt, TableType as et, getDefaultValues as Va, Table as Na, ButtonType as Lt } from "lkt-vue-kernel";
4
+ import { Column as sn, createColumn as dn } from "lkt-vue-kernel";
5
+ import { replaceAll as ra, generateRandomString as _a } from "lkt-string-tools";
6
+ import { DataState as Ma } from "lkt-data-state";
7
+ import Ra from "sortablejs";
8
+ import { time as Le } from "lkt-date-tools";
9
+ /**
10
+ * Vue 3 Carousel 0.14.0
11
+ * (c) 2025
12
+ * @license MIT
13
+ */
14
+ const ua = ["viewport", "carousel"], wt = {
15
+ "bottom-to-top": "btt",
16
+ "left-to-right": "ltr",
17
+ "right-to-left": "rtl",
18
+ "top-to-bottom": "ttb"
19
+ }, sa = [
20
+ "ltr",
21
+ "left-to-right",
22
+ "rtl",
23
+ "right-to-left",
24
+ "ttb",
25
+ "top-to-bottom",
26
+ "btt",
27
+ "bottom-to-top"
28
+ ], $a = {
29
+ ariaGallery: "Gallery",
30
+ ariaNavigateToPage: "Navigate to page {slideNumber}",
31
+ ariaNavigateToSlide: "Navigate to slide {slideNumber}",
32
+ ariaNextSlide: "Navigate to next slide",
33
+ ariaPreviousSlide: "Navigate to previous slide",
34
+ iconArrowDown: "Arrow pointing downwards",
35
+ iconArrowLeft: "Arrow pointing to the left",
36
+ iconArrowRight: "Arrow pointing to the right",
37
+ iconArrowUp: "Arrow pointing upwards",
38
+ itemXofY: "Item {currentSlide} of {slidesCount}"
39
+ }, da = ["slide", "fade"], ca = [
40
+ "center",
41
+ "start",
42
+ "end",
43
+ "center-even",
44
+ "center-odd"
45
+ ], P = {
46
+ autoplay: 0,
47
+ breakpointMode: ua[0],
48
+ breakpoints: void 0,
49
+ dir: sa[0],
50
+ enabled: !0,
51
+ gap: 0,
52
+ height: "auto",
53
+ i18n: $a,
54
+ ignoreAnimations: !1,
55
+ itemsToScroll: 1,
56
+ itemsToShow: 1,
57
+ modelValue: 0,
58
+ mouseDrag: !0,
59
+ pauseAutoplayOnHover: !1,
60
+ preventExcessiveDragging: !1,
61
+ slideEffect: da[0],
62
+ snapAlign: ca[0],
63
+ touchDrag: !0,
64
+ transition: 300,
65
+ wrapAround: !1
66
+ }, Fe = Symbol("carousel"), La = (e) => {
67
+ const o = Pt([]), i = (n) => {
68
+ n !== void 0 ? o.slice(n).forEach((l, a) => {
69
+ var v;
70
+ (v = l.exposed) === null || v === void 0 || v.setIndex(n + a);
71
+ }) : o.forEach((l, a) => {
72
+ var v;
73
+ (v = l.exposed) === null || v === void 0 || v.setIndex(a);
74
+ });
75
+ };
76
+ return {
77
+ cleanup: () => {
78
+ o.splice(0, o.length);
79
+ },
80
+ getSlides: () => o,
81
+ registerSlide: (n, l) => {
82
+ if (!n || n.props.isClone)
83
+ return;
84
+ const a = l ?? o.length;
85
+ o.splice(a, 0, n), i(a), e("slide-registered", { slide: n, index: a });
86
+ },
87
+ unregisterSlide: (n) => {
88
+ const l = o.indexOf(n);
89
+ l !== -1 && (e("slide-unregistered", { slide: n, index: l }), o.splice(l, 1), i(l));
90
+ }
91
+ };
92
+ };
93
+ function Oa(e) {
94
+ return e.length === 0 ? 0 : e.reduce((i, n) => i + n, 0) / e.length;
95
+ }
96
+ function Yt({ slides: e, position: o, toShow: i }) {
97
+ const n = [], l = o === "before", a = l ? -i : 0, v = l ? 0 : i;
98
+ if (e.length <= 0)
99
+ return n;
100
+ for (let b = a; b < v; b++) {
101
+ const m = {
102
+ index: l ? b : b + e.length,
103
+ isClone: !0,
104
+ position: o,
105
+ id: void 0,
106
+ // Make sure we don't duplicate the id which would be invalid html
107
+ key: `clone-${o}-${b}`
108
+ }, r = e[(b % e.length + e.length) % e.length].vnode, T = Ta(r, m);
109
+ T.el = null, n.push(T);
110
+ }
111
+ return n;
112
+ }
113
+ const Pa = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])';
114
+ function Kt(e) {
115
+ if (!e.el || !(e.el instanceof Element))
116
+ return;
117
+ const o = e.el.querySelectorAll(Pa);
118
+ for (const i of o)
119
+ i instanceof HTMLElement && !i.hasAttribute("disabled") && i.getAttribute("aria-hidden") !== "true" && i.setAttribute("tabindex", "-1");
120
+ }
121
+ function Fa(e, o) {
122
+ return Object.keys(e).filter((i) => !o.includes(i)).reduce((i, n) => (i[n] = e[n], i), {});
123
+ }
124
+ function Ua(e) {
125
+ const { isVertical: o, isReversed: i, dragged: n, effectiveSlideSize: l } = e, a = o ? n.y : n.x;
126
+ if (a === 0)
127
+ return 0;
128
+ const v = Math.round(a / l);
129
+ return i ? v : -v;
130
+ }
131
+ function Ce({ val: e, max: o, min: i }) {
132
+ return o < i ? e : Math.min(Math.max(e, isNaN(i) ? e : i), isNaN(o) ? e : o);
133
+ }
134
+ function ja(e) {
135
+ const { transform: o } = window.getComputedStyle(e);
136
+ return o.split(/[(,)]/).slice(1, -1).map((i) => parseFloat(i));
137
+ }
138
+ function za(e) {
139
+ let o = 1, i = 1;
140
+ return e.forEach((n) => {
141
+ const l = ja(n);
142
+ l.length === 6 && (o /= l[0], i /= l[3]);
143
+ }), { widthMultiplier: o, heightMultiplier: i };
144
+ }
145
+ function Ha(e, o) {
146
+ switch (e) {
147
+ case "start":
148
+ return 0;
149
+ case "center":
150
+ case "center-odd":
151
+ return (o - 1) / 2;
152
+ case "center-even":
153
+ return (o - 2) / 2;
154
+ case "end":
155
+ return o - 1;
156
+ default:
157
+ return 0;
158
+ }
159
+ }
160
+ function xa(e, o, i) {
161
+ switch (e) {
162
+ case "start":
163
+ return 0;
164
+ case "center":
165
+ case "center-odd":
166
+ return (i - o) / 2;
167
+ case "center-even":
168
+ return i / 2 - o;
169
+ case "end":
170
+ return i - o;
171
+ default:
172
+ return 0;
173
+ }
174
+ }
175
+ function Ft({ slideSize: e, viewportSize: o, align: i, itemsToShow: n }) {
176
+ return n !== void 0 ? Ha(i, n) : e !== void 0 && o !== void 0 ? xa(i, e, o) : 0;
177
+ }
178
+ function va(e = "", o = {}) {
179
+ return Object.entries(o).reduce((i, [n, l]) => i.replace(`{${n}}`, String(l)), e);
180
+ }
181
+ function fa({ val: e, max: o, min: i = 0 }) {
182
+ const n = o - i + 1;
183
+ return ((e - i) % n + n) % n + i;
184
+ }
185
+ function Ot(e, o = 0) {
186
+ let i = !1, n = 0, l = null;
187
+ function a(...v) {
188
+ if (i)
189
+ return;
190
+ i = !0;
191
+ const b = () => {
192
+ l = requestAnimationFrame((g) => {
193
+ g - n > o ? (n = g, e(...v), i = !1) : b();
194
+ });
195
+ };
196
+ b();
197
+ }
198
+ return a.cancel = () => {
199
+ l && (cancelAnimationFrame(l), l = null, i = !1);
200
+ }, a;
201
+ }
202
+ function St(e, o = "px") {
203
+ if (!(e == null || e === ""))
204
+ return typeof e == "number" || parseFloat(e).toString() === e ? `${e}${o}` : e;
205
+ }
206
+ const qa = ae({
207
+ name: "CarouselAria",
208
+ setup() {
209
+ const e = ut(Fe);
210
+ return e ? () => X("div", {
211
+ class: ["carousel__liveregion", "carousel__sr-only"],
212
+ "aria-live": "polite",
213
+ "aria-atomic": "true"
214
+ }, va(e.config.i18n.itemXofY, {
215
+ currentSlide: e.currentSlide + 1,
216
+ slidesCount: e.slidesCount
217
+ })) : () => "";
218
+ }
219
+ }), Ga = {
220
+ // time to auto advance slides in ms
221
+ autoplay: {
222
+ default: P.autoplay,
223
+ type: Number
224
+ },
225
+ // an object to store breakpoints
226
+ breakpoints: {
227
+ default: P.breakpoints,
228
+ type: Object
229
+ },
230
+ // controls the breakpoint mode relative to the carousel container or the viewport
231
+ breakpointMode: {
232
+ default: P.breakpointMode,
233
+ validator(e) {
234
+ return ua.includes(e);
235
+ }
236
+ },
237
+ // enable/disable the carousel component
238
+ enabled: {
239
+ default: P.enabled,
240
+ type: Boolean
241
+ },
242
+ // control the gap between slides
243
+ gap: {
244
+ default: P.gap,
245
+ type: Number
246
+ },
247
+ // control the gap between slides
248
+ height: {
249
+ default: P.height,
250
+ type: [Number, String]
251
+ },
252
+ ignoreAnimations: {
253
+ default: !1,
254
+ type: [Array, Boolean, String]
255
+ },
256
+ // count of items to be scrolled
257
+ itemsToScroll: {
258
+ default: P.itemsToScroll,
259
+ type: Number
260
+ },
261
+ // count of items to showed per view
262
+ itemsToShow: {
263
+ default: P.itemsToShow,
264
+ type: [Number, String]
265
+ },
266
+ // aria-labels and additional text labels
267
+ i18n: {
268
+ default: P.i18n,
269
+ type: Object
270
+ },
271
+ // slide number number of initial slide
272
+ modelValue: {
273
+ default: void 0,
274
+ type: Number
275
+ },
276
+ // toggle mouse dragging.
277
+ mouseDrag: {
278
+ default: P.mouseDrag,
279
+ type: Boolean
280
+ },
281
+ // toggle mouse dragging.
282
+ touchDrag: {
283
+ default: P.touchDrag,
284
+ type: Boolean
285
+ },
286
+ pauseAutoplayOnHover: {
287
+ default: P.pauseAutoplayOnHover,
288
+ type: Boolean
289
+ },
290
+ preventExcessiveDragging: {
291
+ default: !1,
292
+ type: Boolean,
293
+ validator(e, o) {
294
+ return e && o.wrapAround && console.warn('[vue3-carousel warn]: "preventExcessiveDragging" cannot be used with wrapAround. The setting will be ignored.'), !0;
295
+ }
296
+ },
297
+ // control snap position alignment
298
+ snapAlign: {
299
+ default: P.snapAlign,
300
+ validator(e) {
301
+ return ca.includes(e);
302
+ }
303
+ },
304
+ slideEffect: {
305
+ type: String,
306
+ default: P.slideEffect,
307
+ validator(e) {
308
+ return da.includes(e);
309
+ }
310
+ },
311
+ // sliding transition time in ms
312
+ transition: {
313
+ default: P.transition,
314
+ type: Number
315
+ },
316
+ // control the gap between slides
317
+ dir: {
318
+ type: String,
319
+ default: P.dir,
320
+ validator(e, o) {
321
+ if (!sa.includes(e))
322
+ return !1;
323
+ const i = e in wt ? wt[e] : e;
324
+ return ["ttb", "btt"].includes(i) && (!o.height || o.height === "auto") && console.warn(`[vue3-carousel warn]: The dir "${e}" is not supported with height "auto".`), !0;
325
+ }
326
+ },
327
+ // control infinite scrolling mode
328
+ wrapAround: {
329
+ default: P.wrapAround,
330
+ type: Boolean
331
+ }
332
+ }, Xa = ae({
333
+ name: "VueCarousel",
334
+ props: Ga,
335
+ emits: [
336
+ "before-init",
337
+ "drag",
338
+ "init",
339
+ "loop",
340
+ "slide-end",
341
+ "slide-registered",
342
+ "slide-start",
343
+ "slide-unregistered",
344
+ "update:modelValue"
345
+ ],
346
+ setup(e, { slots: o, emit: i, expose: n }) {
347
+ var l;
348
+ const a = La(i), v = a.getSlides(), b = u(() => v.length), g = C(null), m = C(null), r = C(0), T = u(() => Object.assign(Object.assign(Object.assign({}, P), Fa(e, ["breakpoints", "modelValue"])), { i18n: Object.assign(Object.assign({}, P.i18n), e.i18n) })), c = Pt(Object.assign({}, T.value)), S = C((l = e.modelValue) !== null && l !== void 0 ? l : 0), E = C(S.value);
349
+ H(S, (s) => E.value = s);
350
+ const V = C(0), he = u(() => Math.ceil((b.value - 1) / 2)), O = u(() => b.value - 1), q = u(() => 0);
351
+ let ne = null, Ve = null, Z = null;
352
+ const f = u(() => r.value + c.gap), k = u(() => {
353
+ const s = c.dir || "ltr";
354
+ return s in wt ? wt[s] : s;
355
+ }), U = u(() => ["rtl", "btt"].includes(k.value)), L = u(() => ["ttb", "btt"].includes(k.value)), Q = u(() => c.itemsToShow === "auto"), R = u(() => L.value ? "height" : "width");
356
+ function Te() {
357
+ var s;
358
+ if (!ze.value)
359
+ return;
360
+ const y = (T.value.breakpointMode === "carousel" ? (s = g.value) === null || s === void 0 ? void 0 : s.getBoundingClientRect().width : typeof window < "u" ? window.innerWidth : 0) || 0, w = Object.keys(e.breakpoints || {}).map((N) => Number(N)).sort((N, G) => +G - +N), D = {};
361
+ w.some((N) => y >= N ? (Object.assign(D, e.breakpoints[N]), D.i18n && Object.assign(D.i18n, T.value.i18n, e.breakpoints[N].i18n), !0) : !1), Object.assign(c, T.value, D);
362
+ }
363
+ const Ct = Ot(() => {
364
+ Te(), ue(), me();
365
+ }), Ue = Pt(/* @__PURE__ */ new Set()), j = C([]);
366
+ function Dt({ widthMultiplier: s, heightMultiplier: y }) {
367
+ j.value = v.map((w) => {
368
+ var D;
369
+ const N = (D = w.exposed) === null || D === void 0 ? void 0 : D.getBoundingRect();
370
+ return {
371
+ width: N.width * s,
372
+ height: N.height * y
373
+ };
374
+ });
375
+ }
376
+ const Ne = C({
377
+ width: 0,
378
+ height: 0
379
+ });
380
+ function Bt({ widthMultiplier: s, heightMultiplier: y }) {
381
+ var w;
382
+ const D = ((w = m.value) === null || w === void 0 ? void 0 : w.getBoundingClientRect()) || { width: 0, height: 0 };
383
+ Ne.value = {
384
+ width: D.width * s,
385
+ height: D.height * y
386
+ };
387
+ }
388
+ function me() {
389
+ if (!m.value)
390
+ return;
391
+ const s = za(Ue);
392
+ if (Bt(s), Dt(s), Q.value)
393
+ r.value = Oa(j.value.map((y) => y[R.value]));
394
+ else {
395
+ const y = Number(c.itemsToShow), w = (y - 1) * c.gap;
396
+ r.value = (Ne.value[R.value] - w) / y;
397
+ }
398
+ }
399
+ function ue() {
400
+ !c.wrapAround && b.value > 0 && (S.value = Ce({
401
+ val: S.value,
402
+ max: O.value,
403
+ min: q.value
404
+ })), Q.value || (c.itemsToShow = Ce({
405
+ val: Number(c.itemsToShow),
406
+ max: b.value,
407
+ min: 1
408
+ }));
409
+ }
410
+ const _e = u(() => typeof e.ignoreAnimations == "string" ? e.ignoreAnimations.split(",") : Array.isArray(e.ignoreAnimations) ? e.ignoreAnimations : e.ignoreAnimations ? !1 : []);
411
+ Rt(() => ue()), Rt(() => {
412
+ me();
413
+ });
414
+ let se;
415
+ const je = (s) => {
416
+ const y = s.target;
417
+ if (!(!(y != null && y.contains(g.value)) || Array.isArray(_e.value) && _e.value.includes(s.animationName)) && (Ue.add(y), !se)) {
418
+ const w = () => {
419
+ se = requestAnimationFrame(() => {
420
+ me(), w();
421
+ });
422
+ };
423
+ w();
424
+ }
425
+ }, st = (s) => {
426
+ const y = s.target;
427
+ y && Ue.delete(y), se && Ue.size === 0 && (cancelAnimationFrame(se), me());
428
+ }, ze = C(!1);
429
+ typeof document < "u" && Rt(() => {
430
+ ze.value && _e.value !== !1 ? (document.addEventListener("animationstart", je), document.addEventListener("animationend", st)) : (document.removeEventListener("animationstart", je), document.removeEventListener("animationend", st));
431
+ }), jt(() => {
432
+ ze.value = !0, Te(), ke(), g.value && (Z = new ResizeObserver(Ct), Z.observe(g.value)), i("init");
433
+ }), wa(() => {
434
+ ze.value = !1, a.cleanup(), Ve && clearTimeout(Ve), se && cancelAnimationFrame(se), ne && clearInterval(ne), Z && (Z.disconnect(), Z = null), typeof document < "u" && ct(), g.value && (g.value.removeEventListener("transitionend", me), g.value.removeEventListener("animationiteration", me));
435
+ });
436
+ let pe = !1;
437
+ const He = { x: 0, y: 0 }, oe = $t({ x: 0, y: 0 }), xe = C(!1), qe = C(!1), It = () => {
438
+ xe.value = !0;
439
+ }, lt = () => {
440
+ xe.value = !1;
441
+ }, dt = Ot((s) => {
442
+ if (!s.ctrlKey)
443
+ switch (s.key) {
444
+ case "ArrowLeft":
445
+ case "ArrowUp":
446
+ L.value === s.key.endsWith("Up") && (U.value ? Re(!0) : Ye(!0));
447
+ break;
448
+ case "ArrowRight":
449
+ case "ArrowDown":
450
+ L.value === s.key.endsWith("Down") && (U.value ? Ye(!0) : Re(!0));
451
+ break;
452
+ }
453
+ }, 200), Tt = () => {
454
+ document.addEventListener("keydown", dt);
455
+ }, ct = () => {
456
+ document.removeEventListener("keydown", dt);
457
+ };
458
+ function vt(s) {
459
+ const y = s.target.tagName;
460
+ if (["INPUT", "TEXTAREA", "SELECT"].includes(y) || ge.value || (pe = s.type === "touchstart", !pe && (s.preventDefault(), s.button !== 0)))
461
+ return;
462
+ He.x = "touches" in s ? s.touches[0].clientX : s.clientX, He.y = "touches" in s ? s.touches[0].clientY : s.clientY;
463
+ const w = pe ? "touchmove" : "mousemove", D = pe ? "touchend" : "mouseup";
464
+ document.addEventListener(w, Me, { passive: !1 }), document.addEventListener(D, Ge, { passive: !0 });
465
+ }
466
+ const Me = Ot((s) => {
467
+ qe.value = !0;
468
+ const y = "touches" in s ? s.touches[0].clientX : s.clientX, w = "touches" in s ? s.touches[0].clientY : s.clientY;
469
+ oe.x = y - He.x, oe.y = w - He.y;
470
+ const D = Ua({
471
+ isVertical: L.value,
472
+ isReversed: U.value,
473
+ dragged: oe,
474
+ effectiveSlideSize: f.value
475
+ });
476
+ E.value = c.wrapAround ? S.value + D : Ce({
477
+ val: S.value + D,
478
+ max: O.value,
479
+ min: q.value
480
+ }), i("drag", { deltaX: oe.x, deltaY: oe.y });
481
+ });
482
+ function Ge() {
483
+ if (Me.cancel(), E.value !== S.value && !pe) {
484
+ const w = (D) => {
485
+ D.preventDefault(), window.removeEventListener("click", w);
486
+ };
487
+ window.addEventListener("click", w);
488
+ }
489
+ Se(E.value), oe.x = 0, oe.y = 0, qe.value = !1;
490
+ const s = pe ? "touchmove" : "mousemove", y = pe ? "touchend" : "mouseup";
491
+ document.removeEventListener(s, Me), document.removeEventListener(y, Ge);
492
+ }
493
+ function ke() {
494
+ !c.autoplay || c.autoplay <= 0 || (ne = setInterval(() => {
495
+ c.pauseAutoplayOnHover && xe.value || Re();
496
+ }, c.autoplay));
497
+ }
498
+ function Xe() {
499
+ ne && (clearInterval(ne), ne = null);
500
+ }
501
+ function de() {
502
+ Xe(), ke();
503
+ }
504
+ const ge = C(!1);
505
+ function Se(s, y = !1) {
506
+ if (!y && ge.value)
507
+ return;
508
+ let w = s, D = s;
509
+ V.value = S.value, c.wrapAround ? D = fa({
510
+ val: w,
511
+ max: O.value,
512
+ min: q.value
513
+ }) : w = Ce({
514
+ val: w,
515
+ max: O.value,
516
+ min: q.value
517
+ }), i("slide-start", {
518
+ slidingToIndex: s,
519
+ currentSlideIndex: S.value,
520
+ prevSlideIndex: V.value,
521
+ slidesCount: b.value
522
+ }), Xe(), ge.value = !0, S.value = w, D !== w && be.pause(), i("update:modelValue", D), Ve = setTimeout(() => {
523
+ c.wrapAround && D !== w && (be.resume(), S.value = D, i("loop", {
524
+ currentSlideIndex: S.value,
525
+ slidingToIndex: s
526
+ })), i("slide-end", {
527
+ currentSlideIndex: S.value,
528
+ prevSlideIndex: V.value,
529
+ slidesCount: b.value
530
+ }), ge.value = !1, de();
531
+ }, c.transition);
532
+ }
533
+ function Re(s = !1) {
534
+ Se(S.value + c.itemsToScroll, s);
535
+ }
536
+ function Ye(s = !1) {
537
+ Se(S.value - c.itemsToScroll, s);
538
+ }
539
+ function ft() {
540
+ Te(), ue(), me(), de();
541
+ }
542
+ H(() => [T.value, e.breakpoints], () => Te(), { deep: !0 }), H(() => e.autoplay, () => de());
543
+ const be = H(() => e.modelValue, (s) => {
544
+ s !== S.value && Se(Number(s), !0);
545
+ });
546
+ i("before-init");
547
+ const $e = u(() => {
548
+ if (!c.wrapAround)
549
+ return { before: 0, after: 0 };
550
+ if (Q.value)
551
+ return { before: v.length, after: v.length };
552
+ const s = Number(c.itemsToShow), y = Math.ceil(s + (c.itemsToScroll - 1)), w = y - E.value, D = y - (b.value - (E.value + 1));
553
+ return {
554
+ before: Math.max(0, w),
555
+ after: Math.max(0, D)
556
+ };
557
+ }), Ke = u(() => $e.value.before ? Q.value ? j.value.slice(-1 * $e.value.before).reduce((s, y) => s + y[R.value] + c.gap, 0) * -1 : $e.value.before * f.value * -1 : 0), nt = u(() => {
558
+ var s;
559
+ if (Q.value) {
560
+ const y = (S.value % v.length + v.length) % v.length;
561
+ return Ft({
562
+ slideSize: (s = j.value[y]) === null || s === void 0 ? void 0 : s[R.value],
563
+ viewportSize: Ne.value[R.value],
564
+ align: c.snapAlign
565
+ });
566
+ }
567
+ return Ft({
568
+ align: c.snapAlign,
569
+ itemsToShow: +c.itemsToShow
570
+ });
571
+ }), We = u(() => {
572
+ let s = 0;
573
+ if (Q.value) {
574
+ if (S.value < 0 ? s = j.value.slice(S.value).reduce((y, w) => y + w[R.value] + c.gap, 0) * -1 : s = j.value.slice(0, S.value).reduce((y, w) => y + w[R.value] + c.gap, 0), s -= nt.value, !c.wrapAround) {
575
+ const y = j.value.reduce((w, D) => w + D[R.value] + c.gap, 0) - Ne.value[R.value] - c.gap;
576
+ s = Ce({
577
+ val: s,
578
+ max: y,
579
+ min: 0
580
+ });
581
+ }
582
+ } else {
583
+ let y = S.value - nt.value;
584
+ c.wrapAround || (y = Ce({
585
+ val: y,
586
+ max: b.value - +c.itemsToShow,
587
+ min: 0
588
+ })), s = y * f.value;
589
+ }
590
+ return s * (U.value ? 1 : -1);
591
+ }), Et = u(() => {
592
+ var s, y;
593
+ if (!Q.value) {
594
+ const N = S.value - nt.value;
595
+ return c.wrapAround ? {
596
+ min: Math.floor(N),
597
+ max: Math.ceil(N + Number(c.itemsToShow) - 1)
598
+ } : {
599
+ min: Math.floor(Ce({
600
+ val: N,
601
+ max: b.value - Number(c.itemsToShow),
602
+ min: 0
603
+ })),
604
+ max: Math.ceil(Ce({
605
+ val: N + Number(c.itemsToShow) - 1,
606
+ max: b.value - 1,
607
+ min: 0
608
+ }))
609
+ };
610
+ }
611
+ let w = 0;
612
+ {
613
+ let N = 0, G = 0 - $e.value.before;
614
+ const le = Math.abs(We.value + Ke.value);
615
+ for (; N <= le; ) {
616
+ const ee = (G % v.length + v.length) % v.length;
617
+ N += ((s = j.value[ee]) === null || s === void 0 ? void 0 : s[R.value]) + c.gap, G++;
618
+ }
619
+ w = G - 1;
620
+ }
621
+ let D = 0;
622
+ {
623
+ let N = w, G = 0;
624
+ for (N < 0 ? G = j.value.slice(0, N).reduce((le, ee) => le + ee[R.value] + c.gap, 0) - Math.abs(We.value + Ke.value) : G = j.value.slice(0, N).reduce((le, ee) => le + ee[R.value] + c.gap, 0) - Math.abs(We.value); G < Ne.value[R.value]; ) {
625
+ const le = (N % v.length + v.length) % v.length;
626
+ G += ((y = j.value[le]) === null || y === void 0 ? void 0 : y[R.value]) + c.gap, N++;
627
+ }
628
+ D = N - 1;
629
+ }
630
+ return {
631
+ min: Math.floor(w),
632
+ max: Math.ceil(D)
633
+ };
634
+ }), At = u(() => {
635
+ if (c.slideEffect === "fade")
636
+ return;
637
+ const s = L.value ? "Y" : "X", y = L.value ? oe.y : oe.x;
638
+ let w = We.value + y;
639
+ if (!c.wrapAround && c.preventExcessiveDragging) {
640
+ let D = 0;
641
+ Q.value ? D = j.value.reduce((le, ee) => le + ee[R.value], 0) : D = (b.value - Number(c.itemsToShow)) * f.value;
642
+ const N = U.value ? 0 : -1 * D, G = U.value ? D : 0;
643
+ w = Ce({
644
+ val: w,
645
+ min: N,
646
+ max: G
647
+ });
648
+ }
649
+ return `translate${s}(${w}px)`;
650
+ }), mt = u(() => ({
651
+ "--vc-transition-duration": ge.value ? St(c.transition, "ms") : void 0,
652
+ "--vc-slide-gap": St(c.gap),
653
+ "--vc-carousel-height": St(c.height),
654
+ "--vc-cloned-offset": St(Ke.value)
655
+ })), ot = { slideTo: Se, next: Re, prev: Ye }, pt = $t({
656
+ activeSlide: E,
657
+ config: c,
658
+ currentSlide: S,
659
+ isSliding: ge,
660
+ isVertical: L,
661
+ maxSlide: O,
662
+ minSlide: q,
663
+ nav: ot,
664
+ normalizedDir: k,
665
+ slideRegistry: a,
666
+ slideSize: r,
667
+ slides: v,
668
+ slidesCount: b,
669
+ viewport: m,
670
+ visibleRange: Et
671
+ });
672
+ ta(Fe, pt);
673
+ const Je = $t({
674
+ config: c,
675
+ currentSlide: S,
676
+ maxSlide: O,
677
+ middleSlide: he,
678
+ minSlide: q,
679
+ slideSize: r,
680
+ slidesCount: b
681
+ });
682
+ return n({
683
+ data: Je,
684
+ nav: ot,
685
+ next: Re,
686
+ prev: Ye,
687
+ restartCarousel: ft,
688
+ slideTo: Se,
689
+ updateBreakpointsConfig: Te,
690
+ updateSlideSize: me,
691
+ updateSlidesData: ue
692
+ }), () => {
693
+ var s;
694
+ const y = o.default || o.slides, w = (y == null ? void 0 : y(Je)) || [], { before: D, after: N } = $e.value, G = Yt({
695
+ slides: v,
696
+ position: "before",
697
+ toShow: D
698
+ }), le = Yt({
699
+ slides: v,
700
+ position: "after",
701
+ toShow: N
702
+ }), ee = [...G, ...w, ...le];
703
+ if (!c.enabled || !ee.length)
704
+ return X("section", {
705
+ ref: g,
706
+ class: ["carousel", "is-disabled"]
707
+ }, ee);
708
+ const Vt = ((s = o.addons) === null || s === void 0 ? void 0 : s.call(o, Je)) || [], Nt = X("ol", {
709
+ class: "carousel__track",
710
+ style: { transform: At.value },
711
+ onMousedownCapture: c.mouseDrag ? vt : null,
712
+ onTouchstartPassiveCapture: c.touchDrag ? vt : null
713
+ }, ee), Qe = X("div", { class: "carousel__viewport", ref: m }, Nt);
714
+ return X("section", {
715
+ ref: g,
716
+ class: [
717
+ "carousel",
718
+ `is-${k.value}`,
719
+ `is-effect-${c.slideEffect}`,
720
+ {
721
+ "is-vertical": L.value,
722
+ "is-sliding": ge.value,
723
+ "is-dragging": qe.value,
724
+ "is-hover": xe.value
725
+ }
726
+ ],
727
+ dir: k.value,
728
+ style: mt.value,
729
+ "aria-label": c.i18n.ariaGallery,
730
+ tabindex: "0",
731
+ onFocus: Tt,
732
+ onBlur: ct,
733
+ onMouseenter: It,
734
+ onMouseleave: lt
735
+ }, [Qe, Vt, X(qa)]);
736
+ };
737
+ }
738
+ });
739
+ var Ut;
740
+ (function(e) {
741
+ e.arrowDown = "arrowDown", e.arrowLeft = "arrowLeft", e.arrowRight = "arrowRight", e.arrowUp = "arrowUp";
742
+ })(Ut || (Ut = {}));
743
+ const Wt = (e) => `icon${e.charAt(0).toUpperCase() + e.slice(1)}`, Ya = {
744
+ arrowDown: "M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z",
745
+ arrowLeft: "M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z",
746
+ arrowRight: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",
747
+ arrowUp: "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"
748
+ };
749
+ function Ka(e) {
750
+ return e in Ut;
751
+ }
752
+ const Jt = (e) => e && Ka(e), Qt = ae({
753
+ props: {
754
+ name: {
755
+ type: String,
756
+ required: !0,
757
+ validator: Jt
758
+ },
759
+ title: {
760
+ type: String,
761
+ default: (e) => e.name ? P.i18n[Wt(e.name)] : ""
762
+ }
763
+ },
764
+ setup(e) {
765
+ const o = ut(Fe, null);
766
+ return () => {
767
+ const i = e.name;
768
+ if (!i || !Jt(i))
769
+ return;
770
+ const n = Ya[i], l = X("path", { d: n }), a = (o == null ? void 0 : o.config.i18n[Wt(i)]) || e.title, v = X("title", a);
771
+ return X("svg", {
772
+ class: "carousel__icon",
773
+ viewBox: "0 0 24 24",
774
+ role: "img",
775
+ "aria-label": a
776
+ }, [v, l]);
777
+ };
778
+ }
779
+ }), Wa = ae({
780
+ name: "CarouselNavigation",
781
+ inheritAttrs: !1,
782
+ setup(e, { slots: o, attrs: i }) {
783
+ const n = ut(Fe);
784
+ if (!n)
785
+ return () => "";
786
+ const { next: l, prev: a } = o, v = () => ({
787
+ btt: "arrowDown",
788
+ ltr: "arrowLeft",
789
+ rtl: "arrowRight",
790
+ ttb: "arrowUp"
791
+ })[n.normalizedDir], b = () => ({
792
+ btt: "arrowUp",
793
+ ltr: "arrowRight",
794
+ rtl: "arrowLeft",
795
+ ttb: "arrowDown"
796
+ })[n.normalizedDir], g = u(() => !n.config.wrapAround && n.currentSlide <= n.minSlide), m = u(() => !n.config.wrapAround && n.currentSlide >= n.maxSlide);
797
+ return () => {
798
+ const { i18n: r } = n.config, T = X("button", Object.assign(Object.assign({ type: "button", disabled: g.value, "aria-label": r.ariaPreviousSlide, title: r.ariaPreviousSlide, onClick: n.nav.prev }, i), { class: [
799
+ "carousel__prev",
800
+ { "carousel__prev--disabled": g.value },
801
+ i.class
802
+ ] }), (a == null ? void 0 : a()) || X(Qt, { name: v() })), c = X("button", Object.assign(Object.assign({ type: "button", disabled: m.value, "aria-label": r.ariaNextSlide, title: r.ariaNextSlide, onClick: n.nav.next }, i), { class: [
803
+ "carousel__next",
804
+ { "carousel__next--disabled": m.value },
805
+ i.class
806
+ ] }), (l == null ? void 0 : l()) || X(Qt, { name: b() }));
807
+ return [T, c];
808
+ };
809
+ }
810
+ }), Ja = ae({
811
+ name: "CarouselPagination",
812
+ props: {
813
+ disableOnClick: {
814
+ type: Boolean
815
+ },
816
+ paginateByItemsToShow: {
817
+ type: Boolean
818
+ }
819
+ },
820
+ setup(e) {
821
+ const o = ut(Fe);
822
+ if (!o)
823
+ return () => "";
824
+ const i = u(() => o.config.itemsToShow), n = u(() => Ft({
825
+ align: o.config.snapAlign,
826
+ itemsToShow: i.value
827
+ })), l = u(() => e.paginateByItemsToShow && i.value > 1), a = u(() => Math.ceil((o.activeSlide - n.value) / i.value)), v = u(() => Math.ceil(o.slidesCount / i.value)), b = (g) => fa(l.value ? {
828
+ val: a.value,
829
+ max: v.value - 1,
830
+ min: 0
831
+ } : {
832
+ val: o.activeSlide,
833
+ max: o.maxSlide,
834
+ min: o.minSlide
835
+ }) === g;
836
+ return () => {
837
+ var g, m;
838
+ const r = [];
839
+ for (let T = l.value ? 0 : o.minSlide; T <= (l.value ? v.value - 1 : o.maxSlide); T++) {
840
+ const c = va(o.config.i18n[l.value ? "ariaNavigateToPage" : "ariaNavigateToSlide"], {
841
+ slideNumber: T + 1
842
+ }), S = b(T), E = X("button", {
843
+ type: "button",
844
+ class: {
845
+ "carousel__pagination-button": !0,
846
+ "carousel__pagination-button--active": S
847
+ },
848
+ "aria-label": c,
849
+ "aria-pressed": S,
850
+ "aria-controls": (m = (g = o.slides[T]) === null || g === void 0 ? void 0 : g.exposed) === null || m === void 0 ? void 0 : m.id,
851
+ title: c,
852
+ disabled: e.disableOnClick,
853
+ onClick: () => o.nav.slideTo(l.value ? Math.floor(T * +o.config.itemsToShow + n.value) : T)
854
+ }), V = X("li", { class: "carousel__pagination-item", key: T }, E);
855
+ r.push(V);
856
+ }
857
+ return X("ol", { class: "carousel__pagination" }, r);
858
+ };
859
+ }
860
+ }), Zt = ae({
861
+ name: "CarouselSlide",
862
+ props: {
863
+ id: {
864
+ type: String,
865
+ default: (e) => e.isClone ? void 0 : Ca()
866
+ },
867
+ index: {
868
+ type: Number,
869
+ default: void 0
870
+ },
871
+ isClone: {
872
+ type: Boolean,
873
+ default: !1
874
+ },
875
+ position: {
876
+ type: String,
877
+ default: void 0
878
+ }
879
+ },
880
+ setup(e, { attrs: o, slots: i, expose: n }) {
881
+ const l = ut(Fe);
882
+ if (ta(Fe, void 0), !l)
883
+ return () => "";
884
+ const a = C(e.index), v = (E) => {
885
+ a.value = E;
886
+ }, b = Da(), g = () => {
887
+ const E = b.vnode.el;
888
+ return E ? E.getBoundingClientRect() : { width: 0, height: 0 };
889
+ };
890
+ n({
891
+ id: e.id,
892
+ setIndex: v,
893
+ getBoundingRect: g
894
+ });
895
+ const m = u(() => a.value === l.activeSlide), r = u(() => a.value === l.activeSlide - 1), T = u(() => a.value === l.activeSlide + 1), c = u(() => a.value >= l.visibleRange.min && a.value <= l.visibleRange.max), S = u(() => {
896
+ if (l.config.itemsToShow === "auto")
897
+ return;
898
+ const E = l.config.itemsToShow, V = l.config.gap > 0 && E > 1 ? `calc(${100 / E}% - ${l.config.gap * (E - 1) / E}px)` : `${100 / E}%`;
899
+ return l.isVertical ? { height: V } : { width: V };
900
+ });
901
+ return l.slideRegistry.registerSlide(b, e.index), Ba(() => {
902
+ l.slideRegistry.unregisterSlide(b);
903
+ }), e.isClone && (jt(() => {
904
+ Kt(b.vnode);
905
+ }), Ia(() => {
906
+ Kt(b.vnode);
907
+ })), () => {
908
+ var E, V;
909
+ return l.config.enabled ? X("li", {
910
+ style: [o.style, Object.assign({}, S.value)],
911
+ class: {
912
+ carousel__slide: !0,
913
+ "carousel__slide--clone": e.isClone,
914
+ "carousel__slide--visible": c.value,
915
+ "carousel__slide--active": m.value,
916
+ "carousel__slide--prev": r.value,
917
+ "carousel__slide--next": T.value,
918
+ "carousel__slide--sliding": l.isSliding
919
+ },
920
+ onFocusin: () => {
921
+ l.viewport && (l.viewport.scrollLeft = 0), l.nav.slideTo(a.value);
922
+ },
923
+ id: e.isClone ? void 0 : e.id,
924
+ "aria-hidden": e.isClone || void 0
925
+ }, (V = i.default) === null || V === void 0 ? void 0 : V.call(i, {
926
+ currentIndex: a.value,
927
+ isActive: m.value,
928
+ isClone: e.isClone,
929
+ isPrev: r.value,
930
+ isNext: T.value,
931
+ isSliding: l.isSliding,
932
+ isVisible: c.value
933
+ })) : (E = i.default) === null || E === void 0 ? void 0 : E.call(i);
934
+ };
935
+ }
936
+ }), Qa = (e, o, i, n) => {
937
+ if (!i) return 0;
938
+ let l = String(e[i.key]).toLowerCase(), a = String(o[i.key]).toLowerCase();
939
+ if (n === Oe.Asc) {
940
+ if (l > a) return 1;
941
+ if (a > l) return -1;
15
942
  } else {
16
- if (n > t) return -1;
17
- if (t > n) return 1;
943
+ if (l > a) return -1;
944
+ if (a > l) return 1;
18
945
  }
19
946
  return 0;
20
- }, ve = (o, v, c, l = []) => {
21
- if (o.extractTitleFromColumn) {
22
- let n = l.find((t) => t.key === o.extractTitleFromColumn);
23
- if (n)
24
- return ve(n, v, c, l);
947
+ }, at = (e, o, i, n = []) => {
948
+ if (e.extractTitleFromColumn) {
949
+ let l = n.find((a) => a.key === e.extractTitleFromColumn);
950
+ if (l)
951
+ return at(l, o, i, n);
25
952
  }
26
- if (o.formatter && typeof o.formatter == "function") {
27
- let n = o.formatter(v[o.key], v, o, c);
28
- return n.startsWith("__:") ? Jt(n.substring(3)) : n;
953
+ if (e.formatter && typeof e.formatter == "function") {
954
+ let l = e.formatter(o[e.key], o, e, i);
955
+ return l.startsWith("__:") ? Aa(l.substring(3)) : l;
29
956
  }
30
- return v[o.key];
31
- }, tl = (o, v, c) => {
32
- if (!o.colspan) return -1;
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
- if (typeof o != "object" || !o.key || v.indexOf(o.key) > -1) return !1;
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
- if (o.length > 0) {
44
- for (let v = 0; v < o.length; ++v)
45
- if (o[v].sortable) return o[v].key;
957
+ return o[e.key];
958
+ }, Za = (e, o, i) => {
959
+ if (!e.colspan) return -1;
960
+ let n = o;
961
+ return i.forEach((l) => {
962
+ let a = zt(e, l);
963
+ a > 0 && a < n && (n = a);
964
+ }), n;
965
+ }, zt = (e, o) => e.colspan === !1 ? !1 : typeof e.colspan == "function" ? e.colspan(o) : e.colspan, el = (e, o) => typeof e.preferSlot > "u" ? !0 : e.preferSlot === !1 ? !1 : typeof e.preferSlot == "function" ? e.preferSlot(o) : !0, tl = (e, o, i) => {
966
+ if (typeof e != "object" || !e.key || o.indexOf(e.key) > -1) return !1;
967
+ let n = zt(e, i);
968
+ return typeof e.colspan > "u" ? !0 : (typeof e.colspan < "u" && (typeof e.colspan == "function" ? n = parseInt(e.colspan(i)) : n = parseInt(e.colspan)), n > 0);
969
+ }, al = (e = []) => {
970
+ if (e.length > 0) {
971
+ for (let o = 0; o < e.length; ++o)
972
+ if (e[o].sortable) return e[o].key;
46
973
  }
47
974
  return "";
48
- }, nl = (o, v) => {
49
- if (o.length > 0) {
50
- for (let c = 0; c < o.length; ++c)
51
- if (o[c].key === v) return o[c];
975
+ }, ll = (e, o) => {
976
+ if (e.length > 0) {
977
+ for (let i = 0; i < e.length; ++i)
978
+ if (e[i].key === o) return e[i];
52
979
  }
53
980
  return null;
54
- }, vt = (o) => o.type ? `is-${o.type}` : "", ft = /* @__PURE__ */ te({
981
+ }, ma = (e) => e.type ? `is-${e.type}` : "", pa = /* @__PURE__ */ ae({
55
982
  __name: "LktTableCell",
56
983
  props: {
57
984
  modelValue: { default: () => ({}) },
58
- column: { default: () => new st() },
985
+ column: { default: () => new na() },
59
986
  columns: { default: () => [] },
60
987
  i: { default: 0 },
61
988
  editModeEnabled: { type: Boolean, default: !1 },
62
989
  hasInlineEditPerm: { type: Boolean, default: !1 }
63
990
  },
64
- emits: ["update:modelValue"],
65
- setup(o, { emit: v }) {
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];
991
+ emits: [
992
+ "update:modelValue"
993
+ ],
994
+ setup(e, { emit: o }) {
995
+ const i = o, n = e, l = C(n.modelValue), a = C(l.value[n.column.key]), v = C(null);
996
+ H(a, (m) => {
997
+ const r = JSON.parse(JSON.stringify(l.value));
998
+ r[n.column.key] = m, i("update:modelValue", r);
999
+ }), H(() => n.modelValue, (m) => {
1000
+ l.value = m, a.value = l.value[n.column.key];
72
1001
  });
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];
1002
+ const b = u(() => ({ ...n.column.slotData, item: l.value })), g = u(() => {
1003
+ var m, r, T, c;
1004
+ if ((m = n.column.field) != null && m.modalData && typeof ((r = n.column.field) == null ? void 0 : r.modalData) == "object")
1005
+ for (let S in n.column.field.modalData)
1006
+ if (typeof ((T = n.column.field) == null ? void 0 : T.modalData[S]) == "string" && n.column.field.modalData[S].startsWith("prop:")) {
1007
+ let E = n.column.field.modalData[S].substring(5);
1008
+ l.value[E];
80
1009
  } else
81
- l.column.field.modalData[w];
82
- return (_ = l.column.field) == null ? void 0 : _.modalData;
1010
+ n.column.field.modalData[S];
1011
+ return (c = n.column.field) == null ? void 0 : c.modalData;
83
1012
  });
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
- default: L(() => [
89
- ee(ue(y(ve)(s.column, n.value, s.i)), 1)
1013
+ return (m, r) => {
1014
+ var E, V, he, O;
1015
+ const T = ve("lkt-anchor"), c = ve("lkt-button"), S = ve("lkt-field");
1016
+ return m.column.type === B(yt).Anchor ? (d(), $(T, Ee(fe({ key: 0 }, m.column.anchor)), {
1017
+ default: F(() => [
1018
+ Ae(Pe(B(at)(m.column, l.value, m.i)), 1)
90
1019
  ]),
91
1020
  _: 1
92
- }, 16)) : s.column.type === y(Se).Button ? (u(), S(_, Q({ key: 1 }, s.column.button, { prop: n.value }), {
93
- default: L(() => [
94
- ee(ue(y(ve)(s.column, n.value, s.i)), 1)
1021
+ }, 16)) : m.column.type === B(yt).Button ? (d(), $(c, fe({ key: 1 }, m.column.button, { prop: l.value }), {
1022
+ default: F(() => [
1023
+ Ae(Pe(B(at)(m.column, l.value, m.i)), 1)
95
1024
  ]),
96
1025
  _: 1
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
- "slot-data": D.value,
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
- "modal-data": k.value,
103
- prop: n.value,
104
- modelValue: t.value,
105
- "onUpdate:modelValue": a[0] || (a[0] = (W) => t.value = W)
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, {
1026
+ }, 16, ["prop"])) : m.column.type === B(yt).Field && m.hasInlineEditPerm ? (d(), $(S, fe({ key: 2 }, m.column.field, {
1027
+ "read-mode": !m.column.editable || !m.editModeEnabled,
1028
+ ref: (q) => v.value = q,
1029
+ "slot-data": b.value,
1030
+ label: ((E = m.column.field) == null ? void 0 : E.type) === "switch" || ((V = m.column.field) == null ? void 0 : V.type) === "check" ? m.column.label : "",
1031
+ "modal-data": g.value,
1032
+ prop: l.value,
1033
+ modelValue: a.value,
1034
+ "onUpdate:modelValue": r[0] || (r[0] = (q) => a.value = q)
1035
+ }), null, 16, ["read-mode", "slot-data", "label", "modal-data", "prop", "modelValue"])) : m.column.type === B(yt).Field ? (d(), $(S, fe({ key: 3 }, m.column.field, {
107
1036
  "read-mode": "",
108
- ref: (W) => b.value = W,
109
- "slot-data": D.value,
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
- "modal-data": k.value,
112
- prop: n.value,
113
- "model-value": t.value
114
- }), null, 16, ["slot-data", "label", "modal-data", "prop", "model-value"])) : (u(), p(P, { key: 4 }, [
115
- ee(ue(y(ve)(s.column, n.value, s.i, s.columns)), 1)
1037
+ ref: (q) => v.value = q,
1038
+ "slot-data": b.value,
1039
+ label: ((he = m.column.field) == null ? void 0 : he.type) === "switch" || ((O = m.column.field) == null ? void 0 : O.type) === "check" ? m.column.label : "",
1040
+ "modal-data": g.value,
1041
+ prop: l.value,
1042
+ "model-value": a.value
1043
+ }), null, 16, ["slot-data", "label", "modal-data", "prop", "model-value"])) : (d(), h(x, { key: 4 }, [
1044
+ Ae(Pe(B(at)(m.column, l.value, m.i, m.columns)), 1)
116
1045
  ], 64));
117
1046
  };
118
1047
  }
119
- }), Y = class Y {
1048
+ }), De = class De {
120
1049
  };
121
- Y.navButtonSlot = "", Y.dropButtonSlot = "", Y.editButtonSlot = "", Y.createButtonSlot = "", Y.defaultEmptySlot = void 0, Y.defaultSaveIcon = "", Y.defaultNoResultsMessage = "No results";
122
- let $ = Y;
123
- const ul = /* @__PURE__ */ te({
1050
+ De.navButtonSlot = "", De.dropButtonSlot = "", De.editButtonSlot = "", De.createButtonSlot = "", De.defaultEmptySlot = void 0, De.defaultSaveIcon = "", De.defaultNoResultsMessage = "No results";
1051
+ let Y = De;
1052
+ const nl = /* @__PURE__ */ ae({
124
1053
  __name: "DropButtonComponent",
125
1054
  props: {
126
1055
  config: {},
127
1056
  item: {},
128
1057
  disabled: { type: Boolean, default: !1 }
129
1058
  },
130
- emits: ["click"],
131
- setup(o, { emit: v }) {
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"]))
1059
+ emits: [
1060
+ "click"
1061
+ ],
1062
+ setup(e, { emit: o }) {
1063
+ const i = o, n = e, l = u(() => Y.dropButtonSlot !== ""), a = u(() => Y.dropButtonSlot), v = u(() => oa(n.config.resourceData, n.item));
1064
+ return (b, g) => {
1065
+ const m = ve("lkt-button");
1066
+ return d(), $(m, fe({ palette: "table-delete" }, n.config, {
1067
+ disabled: b.disabled,
1068
+ "resource-data": v.value,
1069
+ onClick: g[0] || (g[0] = aa((r) => i("click", r), ["prevent", "stop"]))
139
1070
  }), {
140
- default: L(() => [
141
- n.value ? (u(), S(Z(t.value), { key: 0 })) : f("", !0)
1071
+ default: F(() => [
1072
+ l.value ? (d(), $(Ie(a.value), { key: 0 })) : A("", !0)
142
1073
  ]),
143
1074
  _: 1
144
1075
  }, 16, ["disabled", "resource-data"]);
145
1076
  };
146
1077
  }
147
- }), rl = /* @__PURE__ */ te({
1078
+ }), ol = /* @__PURE__ */ ae({
148
1079
  __name: "EditButtonComponent",
149
1080
  props: {
150
1081
  config: {},
151
1082
  item: {},
152
1083
  disabled: { type: Boolean, default: !1 }
153
1084
  },
154
- emits: ["click"],
155
- setup(o, { emit: v }) {
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"]))
1085
+ emits: [
1086
+ "click"
1087
+ ],
1088
+ setup(e, { emit: o }) {
1089
+ const i = o, n = e, l = u(() => Y.editButtonSlot !== ""), a = u(() => Y.editButtonSlot), v = u(() => oa(n.config.resourceData, n.item));
1090
+ return (b, g) => {
1091
+ const m = ve("lkt-button");
1092
+ return d(), $(m, fe({ palette: "table-edit" }, n.config, {
1093
+ disabled: b.disabled,
1094
+ "resource-data": v.value,
1095
+ onClick: g[0] || (g[0] = aa((r) => i("click"), ["prevent", "stop"]))
163
1096
  }), {
164
- default: L(() => [
165
- n.value ? (u(), S(Z(t.value), { key: 0 })) : f("", !0)
1097
+ default: F(() => [
1098
+ l.value ? (d(), $(Ie(a.value), { key: 0 })) : A("", !0)
166
1099
  ]),
167
1100
  _: 1
168
1101
  }, 16, ["disabled", "resource-data"]);
169
1102
  };
170
1103
  }
171
- }), il = ["data-i", "data-draggable"], sl = ["data-i"], dl = {
1104
+ }), il = ["data-i", "data-draggable"], rl = ["data-i"], ul = {
172
1105
  key: 1,
173
1106
  "data-role": "invalid-drag-indicator"
174
- }, pl = {
1107
+ }, sl = {
175
1108
  key: 2,
176
1109
  class: "lkt-table-nav-cell"
177
- }, ml = { class: "lkt-table-nav-container" }, vl = ["colspan"], fl = ["colspan"], cl = ["data-column", "colspan", "title"], yl = {
1110
+ }, dl = { class: "lkt-table-nav-container" }, cl = ["colspan"], vl = ["colspan"], fl = ["data-column", "colspan", "title"], ml = {
178
1111
  key: 7,
179
1112
  class: "lkt-table-col-drop"
180
- }, bl = {
1113
+ }, pl = {
181
1114
  key: 8,
182
1115
  class: "lkt-table-col-edit"
183
- }, gl = /* @__PURE__ */ te({
1116
+ }, gl = /* @__PURE__ */ ae({
184
1117
  __name: "LktTableRow",
185
1118
  props: {
186
1119
  modelValue: { default: () => ({}) },
@@ -199,151 +1132,158 @@ const ul = /* @__PURE__ */ te({
199
1132
  i: { default: 0 },
200
1133
  visibleColumns: { default: () => [] },
201
1134
  emptyColumns: { default: () => [] },
202
- rowDisplayType: { type: [Number, Function], default: de.Auto },
1135
+ rowDisplayType: { type: [Number, Function], default: Ze.Auto },
203
1136
  renderDrag: { type: [Boolean, Function], default: !0 },
204
1137
  disabledDrag: { type: [Boolean, Function], default: !0 }
205
1138
  },
206
- emits: ["update:modelValue", "click", "show", "item-up", "item-down", "item-drop"],
207
- setup(o, { emit: v }) {
208
- var x;
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(() => {
217
- let r = [], m = !1;
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);
221
- }, le = () => {
222
- l("item-down", n.i);
223
- }, V = () => {
224
- l("item-drop", n.i);
225
- }, W = () => {
1139
+ emits: [
1140
+ "update:modelValue",
1141
+ "click",
1142
+ "show",
1143
+ "item-up",
1144
+ "item-down",
1145
+ "item-drop"
1146
+ ],
1147
+ setup(e, { emit: o }) {
1148
+ var Z;
1149
+ const i = la(), n = o, l = e, a = C(l.modelValue);
1150
+ let v = typeof l.rowDisplayType == "function" ? l.rowDisplayType(a.value, l.i) : l.rowDisplayType;
1151
+ v || (v = Ze.Auto);
1152
+ const b = [Ze.Auto, Ze.PreferCustomItem].includes(v), g = [Ze.Auto, Ze.PreferItem].includes(v), m = C((Z = l.editButton.anchor) == null ? void 0 : Z.to);
1153
+ for (let f in a.value) m.value = ra(m.value, ":" + f, a.value[f]);
1154
+ const r = (f) => n("click", f), T = (f, k) => {
1155
+ n("show", f, k);
1156
+ }, c = u(() => {
1157
+ let f = [], k = !1;
1158
+ return typeof l.disabledDrag == "function" ? k = l.disabledDrag(a.value) : k = Ve.value === !0, !k && l.sortable && l.isDraggable ? f.push("handle") : k && f.push("disabled"), f.join(" ");
1159
+ }), S = u(() => Y.navButtonSlot !== ""), E = u(() => Y.navButtonSlot), V = () => {
1160
+ n("item-up", l.i);
1161
+ }, he = () => {
1162
+ n("item-down", l.i);
1163
+ }, O = () => {
1164
+ n("item-drop", l.i);
1165
+ }, q = () => {
226
1166
  };
227
- F(() => n.modelValue, (r) => t.value = r), F(t, (r) => {
228
- l("update:modelValue", r);
1167
+ H(() => l.modelValue, (f) => a.value = f), H(a, (f) => {
1168
+ n("update:modelValue", f);
229
1169
  }, { deep: !0 });
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);
231
- return (r, m) => {
232
- const j = z("lkt-button");
233
- return u(), p("tr", {
234
- "data-i": r.i,
235
- "data-draggable": r.isDraggable,
236
- class: K({ "type-custom-item": y(D), "type-item": y(k) })
1170
+ const ne = u(() => typeof l.renderDrag == "function" ? l.renderDrag(a.value) : l.renderDrag === !0), Ve = u(() => typeof l.disabledDrag == "function" ? l.disabledDrag(a.value) : l.disabledDrag === !0);
1171
+ return (f, k) => {
1172
+ const U = ve("lkt-button");
1173
+ return d(), h("tr", {
1174
+ "data-i": f.i,
1175
+ "data-draggable": f.isDraggable,
1176
+ class: re({ "type-custom-item": B(b), "type-item": B(g) })
237
1177
  }, [
238
- r.sortable && r.isDraggable && r.editModeEnabled && fe.value ? (u(), p("td", {
1178
+ f.sortable && f.isDraggable && f.editModeEnabled && ne.value ? (d(), h("td", {
239
1179
  key: 0,
240
1180
  "data-role": "drag-indicator",
241
- class: K(_.value),
242
- "data-i": r.i
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, {
1181
+ class: re(c.value),
1182
+ "data-i": f.i
1183
+ }, null, 10, rl)) : f.sortable && f.editModeEnabled && ne.value ? (d(), h("td", ul)) : A("", !0),
1184
+ f.addNavigation && f.editModeEnabled ? (d(), h("td", sl, [
1185
+ J("div", dl, [
1186
+ Be(U, {
247
1187
  palette: "table-nav",
248
- disabled: r.i === 0,
249
- onClick: I
1188
+ disabled: f.i === 0,
1189
+ onClick: V
250
1190
  }, {
251
- default: L(() => [
252
- w.value ? (u(), S(Z(H.value), {
1191
+ default: F(() => [
1192
+ S.value ? (d(), $(Ie(E.value), {
253
1193
  key: 0,
254
1194
  direction: "up"
255
- })) : (u(), p(P, { key: 1 }, [
256
- m[3] || (m[3] = O("i", { class: "" }, null, -1)),
257
- m[4] || (m[4] = ee(" UP "))
1195
+ })) : (d(), h(x, { key: 1 }, [
1196
+ k[3] || (k[3] = J("i", { class: "" }, null, -1)),
1197
+ k[4] || (k[4] = Ae(" UP "))
258
1198
  ], 64))
259
1199
  ]),
260
1200
  _: 1
261
1201
  }, 8, ["disabled"]),
262
- pe(j, {
1202
+ Be(U, {
263
1203
  palette: "table-nav",
264
- disabled: r.latestRow,
265
- onClick: le
1204
+ disabled: f.latestRow,
1205
+ onClick: he
266
1206
  }, {
267
- default: L(() => [
268
- w.value ? (u(), S(Z(H.value), {
1207
+ default: F(() => [
1208
+ S.value ? (d(), $(Ie(E.value), {
269
1209
  key: 0,
270
1210
  direction: "down"
271
- })) : (u(), p(P, { key: 1 }, [
272
- m[5] || (m[5] = O("i", { class: "" }, null, -1)),
273
- m[6] || (m[6] = ee(" DOWN "))
1211
+ })) : (d(), h(x, { key: 1 }, [
1212
+ k[5] || (k[5] = J("i", { class: "" }, null, -1)),
1213
+ k[6] || (k[6] = Ae(" DOWN "))
274
1214
  ], 64))
275
1215
  ]),
276
1216
  _: 1
277
1217
  }, 8, ["disabled"])
278
1218
  ])
279
- ])) : f("", !0),
280
- r.displayHiddenColumnsIndicator ? (u(), p("td", {
1219
+ ])) : A("", !0),
1220
+ f.displayHiddenColumnsIndicator ? (d(), h("td", {
281
1221
  key: 3,
282
- onClick: m[0] || (m[0] = (E) => U(E, r.i)),
1222
+ onClick: k[0] || (k[0] = (L) => T(L, f.i)),
283
1223
  "data-role": "show-more",
284
- class: K(r.hiddenIsVisible ? "state-open" : "")
285
- }, null, 2)) : f("", !0),
286
- y(D) && y(c)[`item-${r.i}`] ? (u(), p("td", {
287
- key: "td" + r.i,
288
- colspan: r.visibleColumns.length
1224
+ class: re(f.hiddenIsVisible ? "state-open" : "")
1225
+ }, null, 2)) : A("", !0),
1226
+ B(b) && B(i)[`item-${f.i}`] ? (d(), h("td", {
1227
+ key: "td" + f.i,
1228
+ colspan: f.visibleColumns.length
289
1229
  }, [
290
- T(r.$slots, `item-${r.i}`, {
291
- item: t.value,
292
- index: r.i
1230
+ z(f.$slots, `item-${f.i}`, {
1231
+ item: a.value,
1232
+ index: f.i
293
1233
  })
294
- ], 8, vl)) : y(k) && y(c).item ? (u(), p("td", {
295
- key: "td" + r.i,
296
- colspan: r.visibleColumns.length
1234
+ ], 8, cl)) : B(g) && B(i).item ? (d(), h("td", {
1235
+ key: "td" + f.i,
1236
+ colspan: f.visibleColumns.length
297
1237
  }, [
298
- T(r.$slots, "item", {
299
- item: t.value,
300
- index: r.i
1238
+ z(f.$slots, "item", {
1239
+ item: a.value,
1240
+ index: f.i
301
1241
  })
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", {
304
- key: "td" + r.i,
305
- "data-column": E.key,
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))
1242
+ ], 8, vl)) : (d(!0), h(x, { key: 6 }, ie(f.visibleColumns, (L) => (d(), h(x, null, [
1243
+ B(tl)(L, f.emptyColumns, a.value) ? (d(), h("td", {
1244
+ key: "td" + f.i,
1245
+ "data-column": L.key,
1246
+ colspan: B(zt)(L, a.value),
1247
+ title: B(at)(L, a.value, f.i, f.visibleColumns),
1248
+ class: re(B(ma)(L)),
1249
+ onClick: k[2] || (k[2] = (Q) => r(Q))
310
1250
  }, [
311
- r.$slots[E.key] && y(ll)(E, t.value) ? T(r.$slots, E.key, {
1251
+ f.$slots[L.key] && B(el)(L, a.value) ? z(f.$slots, L.key, {
312
1252
  key: 0,
313
- value: t.value[E.key],
314
- item: t.value,
315
- column: E,
316
- i: r.i
317
- }) : t.value ? (u(), S(ft, {
1253
+ value: a.value[L.key],
1254
+ item: a.value,
1255
+ column: L,
1256
+ i: f.i
1257
+ }) : a.value ? (d(), $(pa, {
318
1258
  key: 1,
319
- modelValue: t.value,
320
- "onUpdate:modelValue": m[1] || (m[1] = (N) => t.value = N),
321
- column: E,
322
- columns: r.visibleColumns,
323
- "edit-mode-enabled": r.editModeEnabled,
324
- "has-inline-edit-perm": r.hasInlineEditPerm,
325
- i: r.i
326
- }, null, 8, ["modelValue", "column", "columns", "edit-mode-enabled", "has-inline-edit-perm", "i"])) : f("", !0)
327
- ], 10, cl)) : f("", !0)
1259
+ modelValue: a.value,
1260
+ "onUpdate:modelValue": k[1] || (k[1] = (Q) => a.value = Q),
1261
+ column: L,
1262
+ columns: f.visibleColumns,
1263
+ "edit-mode-enabled": f.editModeEnabled,
1264
+ "has-inline-edit-perm": f.hasInlineEditPerm,
1265
+ i: f.i
1266
+ }, null, 8, ["modelValue", "column", "columns", "edit-mode-enabled", "has-inline-edit-perm", "i"])) : A("", !0)
1267
+ ], 10, fl)) : A("", !0)
328
1268
  ], 64))), 256)),
329
- r.canDrop && r.editModeEnabled ? (u(), p("td", yl, [
330
- pe(ul, {
331
- config: r.dropButton,
332
- item: t.value,
333
- onClick: V
1269
+ f.canDrop && f.editModeEnabled ? (d(), h("td", ml, [
1270
+ Be(nl, {
1271
+ config: f.dropButton,
1272
+ item: a.value,
1273
+ onClick: O
334
1274
  }, null, 8, ["config", "item"])
335
- ])) : f("", !0),
336
- r.canEdit && r.editModeEnabled ? (u(), p("td", bl, [
337
- pe(rl, {
338
- config: r.editButton,
339
- item: t.value,
340
- onClick: W
1275
+ ])) : A("", !0),
1276
+ f.canEdit && f.editModeEnabled ? (d(), h("td", pl, [
1277
+ Be(ol, {
1278
+ config: f.editButton,
1279
+ item: a.value,
1280
+ onClick: q
341
1281
  }, null, 8, ["config", "item"])
342
- ])) : f("", !0)
1282
+ ])) : A("", !0)
343
1283
  ], 10, il);
344
1284
  };
345
1285
  }
346
- }), kl = { "data-role": "hidden-row" }, hl = ["colspan"], Cl = ["data-column"], Bl = ["data-i"], Sl = ["data-column", "title"], Dl = /* @__PURE__ */ te({
1286
+ }), bl = { "data-role": "hidden-row" }, yl = ["colspan"], hl = ["data-column"], kl = ["data-i"], Sl = ["data-column", "title"], wl = /* @__PURE__ */ ae({
347
1287
  __name: "LktHiddenRow",
348
1288
  props: {
349
1289
  modelValue: { default: () => ({}) },
@@ -358,144 +1298,152 @@ const ul = /* @__PURE__ */ te({
358
1298
  editModeEnabled: { type: Boolean, default: !1 },
359
1299
  hasInlineEditPerm: { type: Boolean, default: !1 }
360
1300
  },
361
- emits: ["update:modelValue", "click"],
362
- setup(o, { emit: v }) {
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
- "data-column": k.key
1301
+ emits: [
1302
+ "update:modelValue",
1303
+ "click"
1304
+ ],
1305
+ setup(e, { emit: o }) {
1306
+ const i = o, n = e, l = C(n.modelValue), a = (v) => i("click", v);
1307
+ return H(() => n.modelValue, (v) => l.value = v), H(l, () => i("update:modelValue", l.value)), (v, b) => it((d(), h("tr", bl, [
1308
+ J("td", { colspan: v.hiddenColumnsColSpan }, [
1309
+ J("table", null, [
1310
+ J("tr", null, [
1311
+ (d(!0), h(x, null, ie(v.hiddenColumns, (g) => (d(), h("th", {
1312
+ "data-column": g.key
370
1313
  }, [
371
- O("div", null, ue(k.label), 1)
372
- ], 8, Cl))), 256))
1314
+ J("div", null, Pe(g.label), 1)
1315
+ ], 8, hl))), 256))
373
1316
  ]),
374
- O("tr", { "data-i": b.i }, [
375
- (u(!0), p(P, null, J(b.hiddenColumns, (k, s) => (u(), p("td", {
376
- "data-column": k.key,
377
- title: y(ve)(k, n.value, s, b.hiddenColumns),
378
- onClick: D[1] || (D[1] = (a) => t(a))
1317
+ J("tr", { "data-i": v.i }, [
1318
+ (d(!0), h(x, null, ie(v.hiddenColumns, (g, m) => (d(), h("td", {
1319
+ "data-column": g.key,
1320
+ title: B(at)(g, l.value, m, v.hiddenColumns),
1321
+ onClick: b[1] || (b[1] = (r) => a(r))
379
1322
  }, [
380
- b.$slots[k.key] ? T(b.$slots, k.key, {
1323
+ v.$slots[g.key] ? z(v.$slots, g.key, {
381
1324
  key: 0,
382
- value: n.value[k.key],
383
- item: n.value,
384
- column: k,
385
- i: s
386
- }) : (u(), S(ft, {
1325
+ value: l.value[g.key],
1326
+ item: l.value,
1327
+ column: g,
1328
+ i: m
1329
+ }) : (d(), $(pa, {
387
1330
  key: 1,
388
- column: k,
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
1331
+ column: g,
1332
+ columns: v.hiddenColumns,
1333
+ modelValue: l.value,
1334
+ "onUpdate:modelValue": b[0] || (b[0] = (r) => l.value = r),
1335
+ i: m,
1336
+ "edit-mode-enabled": v.editModeEnabled,
1337
+ "has-inline-edit-perm": v.hasInlineEditPerm
395
1338
  }, null, 8, ["column", "columns", "modelValue", "i", "edit-mode-enabled", "has-inline-edit-perm"]))
396
1339
  ], 8, Sl))), 256))
397
- ], 8, Bl)
1340
+ ], 8, kl)
398
1341
  ])
399
- ], 8, hl)
1342
+ ], 8, yl)
400
1343
  ], 512)), [
401
- [ke, b.hiddenIsVisible]
1344
+ [rt, v.hiddenIsVisible]
402
1345
  ]);
403
1346
  }
404
- }), ut = /* @__PURE__ */ te({
1347
+ }), ea = /* @__PURE__ */ ae({
405
1348
  __name: "CreateButton",
406
1349
  props: {
407
1350
  config: { default: void 0 },
408
1351
  disabled: { type: Boolean, default: !1 }
409
1352
  },
410
- emits: ["click", "append"],
411
- setup(o, { emit: v }) {
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
- beforeClose: (a) => {
416
- "itemCreated" in a && a.itemCreated === !0 && c("append", a.item);
1353
+ emits: [
1354
+ "click",
1355
+ "append"
1356
+ ],
1357
+ setup(e, { emit: o }) {
1358
+ var m;
1359
+ const i = o, n = e, l = u(() => Y.createButtonSlot !== ""), a = u(() => Y.createButtonSlot), v = {
1360
+ ...(m = n.config) == null ? void 0 : m.modalData,
1361
+ beforeClose: (r) => {
1362
+ "itemCreated" in r && r.itemCreated === !0 && i("append", r.item);
417
1363
  }
418
- }, D = {
419
- ...l.config
1364
+ }, b = {
1365
+ ...n.config
420
1366
  };
421
- D.modalData = b;
422
- const k = () => {
423
- var a;
424
- if (!((a = l.config) != null && a.modal)) {
425
- c("click");
1367
+ b.modalData = v;
1368
+ const g = () => {
1369
+ var r;
1370
+ if (!((r = n.config) != null && r.modal)) {
1371
+ i("click");
426
1372
  return;
427
1373
  }
428
1374
  };
429
- return (a, U) => {
430
- const _ = z("lkt-button");
431
- return u(), S(_, Q(D, {
432
- disabled: a.disabled,
433
- onClick: k
1375
+ return (r, T) => {
1376
+ const c = ve("lkt-button");
1377
+ return d(), $(c, fe(b, {
1378
+ disabled: r.disabled,
1379
+ onClick: g
434
1380
  }), {
435
- default: L(() => [
436
- n.value ? (u(), S(Z(t.value), { key: 0 })) : f("", !0)
1381
+ default: F(() => [
1382
+ l.value ? (d(), $(Ie(a.value), { key: 0 })) : A("", !0)
437
1383
  ]),
438
1384
  _: 1
439
1385
  }, 16, ["disabled"]);
440
1386
  };
441
1387
  }
442
- }), Il = ["data-column", "data-sortable", "data-sort", "colspan", "title"], Vl = /* @__PURE__ */ te({
1388
+ }), Cl = ["data-column", "data-sortable", "data-sort", "colspan", "title"], Dl = /* @__PURE__ */ ae({
443
1389
  __name: "TableHeader",
444
1390
  props: {
445
- column: { default: () => new st() },
1391
+ column: { default: () => new na() },
446
1392
  sortBy: { default: "" },
447
1393
  sortDirection: { default: "" },
448
1394
  amountOfColumns: { default: 0 },
449
1395
  items: { default: () => [] }
450
1396
  },
451
- emits: ["click"],
452
- setup(o, { emit: v }) {
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
- "data-column": a.column.key,
456
- "data-sortable": t.value,
457
- "data-sort": b.value,
458
- colspan: n.value,
459
- title: D.value,
460
- class: K(y(vt)(a.column)),
461
- onClick: s
1397
+ emits: [
1398
+ "click"
1399
+ ],
1400
+ setup(e, { emit: o }) {
1401
+ const i = o, n = e, l = u(() => Za(n.column, n.amountOfColumns, n.items)), a = u(() => n.column.sortable === !0), v = u(() => a.value && n.sortBy === n.column.key ? n.sortDirection : ""), b = u(() => ia(n.column.label)), g = u(() => a.value && n.sortBy === n.column.key ? n.sortDirection === Oe.Asc ? tt.defaultTableSortAscIcon : n.sortDirection === Oe.Desc ? tt.defaultTableSortDescIcon : "" : ""), m = () => i("click", n.column);
1402
+ return (r, T) => (d(), h("th", {
1403
+ "data-column": r.column.key,
1404
+ "data-sortable": a.value,
1405
+ "data-sort": v.value,
1406
+ colspan: l.value,
1407
+ title: b.value,
1408
+ class: re(B(ma)(r.column)),
1409
+ onClick: m
462
1410
  }, [
463
- O("div", null, [
464
- ee(ue(D.value) + " ", 1),
465
- k.value ? (u(), p("i", {
1411
+ J("div", null, [
1412
+ Ae(Pe(b.value) + " ", 1),
1413
+ g.value ? (d(), h("i", {
466
1414
  key: 0,
467
- class: K(k.value)
468
- }, null, 2)) : f("", !0)
1415
+ class: re(g.value)
1416
+ }, null, 2)) : A("", !0)
469
1417
  ])
470
- ], 10, Il));
1418
+ ], 10, Cl));
471
1419
  }
472
- }), wl = ["id"], El = {
1420
+ }), Bl = ["id"], Il = {
473
1421
  key: 0,
474
1422
  class: "lkt-table-page-buttons"
475
- }, Tl = { class: "switch-edition-mode" }, $l = {
1423
+ }, Tl = { class: "switch-edition-mode" }, El = {
476
1424
  key: 1,
477
1425
  class: "lkt-table-page-buttons"
478
- }, Rl = {
1426
+ }, Al = {
479
1427
  key: 2,
480
1428
  class: "lkt-table-page-filters"
481
- }, Ml = { class: "lkt-table" }, Ll = { key: 0 }, Pl = {
1429
+ }, Vl = { class: "lkt-table" }, Nl = { key: 0 }, _l = {
482
1430
  key: 0,
483
1431
  "data-role": "drag-indicator"
484
- }, Nl = { key: 1 }, Fl = { key: 2 }, Al = {
1432
+ }, Ml = { key: 1 }, Rl = { key: 2 }, $l = {
485
1433
  key: 3,
486
1434
  class: "lkt-table-col-drop"
487
- }, Ol = {
1435
+ }, Ll = {
488
1436
  key: 4,
489
1437
  class: "lkt-table-col-edit"
490
- }, Ul = ["id"], _l = ["id"], jl = ["data-i"], Hl = ["data-i"], ql = {
1438
+ }, Ol = ["id"], Pl = ["id"], Fl = ["data-i"], Ul = ["data-i"], jl = ["id"], zl = { class: "lkt-carousel-slide" }, Hl = { class: "lkt-carousel-slide" }, xl = {
491
1439
  key: 3,
492
1440
  class: "lkt-table-empty"
493
- }, Kl = {
1441
+ }, ql = {
494
1442
  key: 5,
495
1443
  class: "lkt-table-page-buttons lkt-table-page-buttons-bottom"
496
- }, zl = /* @__PURE__ */ te({
1444
+ }, Gl = /* @__PURE__ */ ae({
497
1445
  __name: "LktTable",
498
- props: /* @__PURE__ */ Wt({
1446
+ props: /* @__PURE__ */ Ea({
499
1447
  modelValue: {},
500
1448
  type: {},
501
1449
  columns: {},
@@ -534,7 +1482,7 @@ const ul = /* @__PURE__ */ te({
534
1482
  wrapContentClass: {},
535
1483
  itemsContainerClass: {},
536
1484
  createEnabledValidator: { type: Function }
537
- }, Qt(Xt)),
1485
+ }, Va(Na)),
538
1486
  emits: [
539
1487
  "update:modelValue",
540
1488
  "update:perms",
@@ -549,485 +1497,540 @@ const ul = /* @__PURE__ */ te({
549
1497
  "page",
550
1498
  "drag-end"
551
1499
  ],
552
- setup(o, { expose: v, emit: c }) {
553
- var ot;
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) => {
557
- V.value = e;
558
- }, gt = (e) => {
559
- var d;
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);
1500
+ setup(e, { expose: o, emit: i }) {
1501
+ var qt, Gt;
1502
+ const n = i, l = la(), a = e, v = {}, b = C(typeof a.sorter == "function" ? a.sorter : Qa), g = C(al(a.columns)), m = C(Oe.Asc), r = C(a.modelValue), T = C(v), c = C(null), S = C(a.columns), E = C((qt = a.paginator) == null ? void 0 : qt.modelValue), V = C(a.loading), he = C(!1), O = C(a.perms), q = C(null), ne = C(null), Ve = C(null), Z = C({}), f = C(new Ma({ items: r.value }, a.dataStateConfig)), k = C(a.editMode), U = C(0), L = C(null), Q = C(((Gt = a.carousel) == null ? void 0 : Gt.currentSlide) || 0), R = C(ht(a.saveButton, tt.defaultSaveButton)), Te = C(ht(a.createButton, tt.defaultCreateButton)), Ct = C(ht(a.editModeButton, tt.defaultEditModeButton)), Ue = C(ht(a.dropButton, tt.defaultDropButton)), j = C(!1);
1503
+ H(V, (t) => n("update:loading", t)), H(E, (t) => n("page", t));
1504
+ const Dt = (t) => {
1505
+ O.value = t;
1506
+ }, Ne = (t) => {
1507
+ var p;
1508
+ Array.isArray(t.data) && ((!a.paginator || ![kt.LoadMore, kt.Infinite].includes((p = a.paginator) == null ? void 0 : p.type)) && r.value.splice(0, r.value.length), r.value = [...r.value, ...t.data]), V.value = !1, he.value = !0, f.value.store({ items: r.value }).turnStoredIntoOriginal(), j.value = !1, bt(() => {
1509
+ U.value = Le(), lt.value, n("read-response", t);
562
1510
  });
563
- }, kt = () => Be(() => I.value = !0), ht = () => {
564
- W.value.doRefresh();
565
- }, ce = Yt(12), we = i(() => {
566
- if (!t.hideEmptyColumns) return [];
567
- let e = [];
568
- return w.value.forEach((d) => {
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);
575
- }), e;
576
- }), he = i(() => w.value.filter((e) => !e.hidden)), Ee = i(() => w.value.filter((e) => e.hidden)), Ct = i(() => {
577
- let e = he.value.length + 1;
578
- return t.sortable && ++e, e;
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(() => {
580
- let e = [];
581
- for (let d in n) St.value.indexOf(d) !== -1 && e.push(d);
582
- return e;
583
- }), _e = i(() => {
584
- var e;
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(() => {
587
- var e, d;
588
- return j.value, typeof ((e = N.value) == null ? void 0 : e.disabled) == "function" ? N.value.disabled({
589
- value: a.value,
590
- dataState: r.value
591
- }) : typeof ((d = N.value) == null ? void 0 : d.disabled) == "boolean" ? N.value.disabled : !re.value;
592
- }), It = i(() => a.value.length), Vt = i(() => {
593
- var e;
1511
+ }, Bt = () => bt(() => V.value = !0), me = () => {
1512
+ q.value.doRefresh();
1513
+ }, ue = _a(12), _e = u(() => {
1514
+ if (!a.hideEmptyColumns) return [];
1515
+ let t = [];
1516
+ return S.value.forEach((p) => {
1517
+ let M = p.key, K = !1;
1518
+ r.value.forEach((te) => {
1519
+ if (typeof te.checkEmpty == "function")
1520
+ return te.checkEmpty(te);
1521
+ te[M] && (K = !0);
1522
+ }), K || t.push(M);
1523
+ }), t;
1524
+ }), se = u(() => S.value.filter((t) => !t.hidden)), je = u(() => S.value.filter((t) => t.hidden)), st = u(() => {
1525
+ let t = se.value.length + 1;
1526
+ return a.sortable && ++t, t;
1527
+ }), ze = u(() => S.value.filter((t) => t.isForRowKey)), pe = u(() => je.value.length > 0 && !a.sortable), He = u(() => S.value.map((t) => t.key)), oe = u(() => {
1528
+ let t = [];
1529
+ for (let p in l) He.value.indexOf(p) !== -1 && t.push(p);
1530
+ return t;
1531
+ }), xe = u(() => {
1532
+ let t = [];
1533
+ for (let p in l) p.indexOf("slide-") !== -1 && t.push(p);
1534
+ return t;
1535
+ }), qe = u(() => {
1536
+ var t;
1537
+ return a.hiddenSave || V.value || !((t = R.value) != null && t.resource || R.value.type) ? !1 : k.value && j.value ? !0 : k.value;
1538
+ }), It = u(() => gt.value && r.value.length >= a.requiredItemsForTopCreate || Ke.value ? !0 : qe.value || k.value && ke.value), lt = u(() => {
1539
+ var t, p;
1540
+ return U.value, typeof ((t = R.value) == null ? void 0 : t.disabled) == "function" ? R.value.disabled({
1541
+ value: r.value,
1542
+ dataState: f.value
1543
+ }) : typeof ((p = R.value) == null ? void 0 : p.disabled) == "boolean" ? R.value.disabled : !j.value;
1544
+ }), dt = u(() => r.value.length), Tt = u(() => {
1545
+ var t;
594
1546
  return {
595
- items: a.value,
596
- ...(e = N.value) == null ? void 0 : e.resourceData
1547
+ items: r.value,
1548
+ ...(t = R.value) == null ? void 0 : t.resourceData
597
1549
  };
598
- }), wt = i(() => t.titleTag === "" ? "h2" : t.titleTag), Et = i(() => t.wrapContentTag === "" ? "div" : t.wrapContentTag), $e = i(() => pt(t.title)), Re = i(() => {
599
- var e;
600
- return (e = t.drag) == null ? void 0 : e.enabled;
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(() => {
602
- var e;
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) => {
605
- let d = e.target;
606
- if (typeof d.dataset.column > "u")
1550
+ }), ct = u(() => a.titleTag === "" ? "h2" : a.titleTag), vt = u(() => a.wrapContentTag === "" ? "div" : a.wrapContentTag), Me = u(() => ia(a.title)), Ge = u(() => {
1551
+ var t;
1552
+ return (t = a.drag) == null ? void 0 : t.enabled;
1553
+ }), ke = u(() => O.value.includes(we.Create)), Xe = u(() => O.value.includes("read")), de = u(() => O.value.includes(we.Update)), ge = u(() => O.value.includes(we.Edit)), Se = u(() => O.value.includes(we.InlineEdit)), Re = u(() => O.value.includes(we.ModalCreate)), Ye = u(() => O.value.includes(we.InlineCreate)), ft = u(() => O.value.includes(we.InlineCreateEver)), be = u(() => O.value.includes(we.Drop)), $e = u(() => O.value.includes(we.SwitchEditMode)), Ke = u(() => !$e.value || !de.value && !be.value || !de.value && be.value ? !1 : !V.value), nt = u(() => {
1554
+ var t;
1555
+ return (typeof ((t = a.paginator) == null ? void 0 : t.type) < "u" && [kt.LoadMore, kt.Infinite].includes(a.paginator.type) || !V.value) && r.value.length > 0;
1556
+ }), We = (t) => {
1557
+ let p = t.target;
1558
+ if (typeof p.dataset.column > "u")
607
1559
  do
608
- d = d.parentNode;
609
- while (typeof d.dataset.column > "u" && d.tagName !== "TABLE" && d.tagName !== "body");
610
- if (d.tagName === "TD" && (d = d.parentNode, d = d.dataset.i, typeof d < "u"))
611
- return a.value[d];
612
- }, Pt = (e) => a.value[e], Nt = (e) => {
613
- var d;
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]));
617
- }, Je = (e) => {
618
- l("click", e);
619
- }, Qe = (e, d) => {
620
- let C = "tr_" + d;
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));
626
- }, Xe = (e) => {
627
- var d, C;
628
- return typeof ((d = t.drag) == null ? void 0 : d.isDraggable) == "function" ? (C = t.drag) == null ? void 0 : C.isDraggable(e) : !0;
629
- }, Ye = () => {
630
- if (ye.value) {
631
- l("click-create");
1560
+ p = p.parentNode;
1561
+ while (typeof p.dataset.column > "u" && p.tagName !== "TABLE" && p.tagName !== "body");
1562
+ if (p.tagName === "TD" && (p = p.parentNode, p = p.dataset.i, typeof p < "u"))
1563
+ return r.value[p];
1564
+ }, Et = (t) => r.value[t], At = (t) => {
1565
+ var p;
1566
+ return (p = c.value) == null ? void 0 : p.querySelector(`[data-i="${t}"]`);
1567
+ }, mt = (t) => T.value["tr_" + t] === !0, ot = (t) => {
1568
+ t && t.sortable && (r.value = r.value.sort((p, M) => b.value(p, M, t, m.value)), m.value = m.value === Oe.Asc ? Oe.Desc : Oe.Asc, g.value = t.key, U.value = Le(), n("sort", [g.value, m.value]));
1569
+ }, pt = (t) => {
1570
+ n("click", t);
1571
+ }, Je = (t, p) => {
1572
+ let M = "tr_" + p;
1573
+ T.value[M] = typeof T.value[M] > "u" ? !0 : !T.value[M];
1574
+ }, s = (t) => {
1575
+ var M, K, te, ce, _, I, W, ye;
1576
+ let p = parseInt((ce = (te = (K = (M = t == null ? void 0 : t.originalEvent) == null ? void 0 : M.toElement) == null ? void 0 : K.closest("tr")) == null ? void 0 : te.dataset) == null ? void 0 : ce.i);
1577
+ return !(typeof ((_ = a.drag) == null ? void 0 : _.isValid) == "function" && !((I = a.drag) != null && I.isValid(r.value[p])) || typeof ((W = a.drag) == null ? void 0 : W.isValid) == "boolean" && !((ye = a.drag) != null && ye.isValid));
1578
+ }, y = (t) => {
1579
+ var p, M;
1580
+ return typeof ((p = a.drag) == null ? void 0 : p.isDraggable) == "function" ? (M = a.drag) == null ? void 0 : M.isDraggable(t) : !0;
1581
+ }, w = () => {
1582
+ if (ke.value) {
1583
+ n("click-create");
632
1584
  return;
633
1585
  }
634
- if (Ke.value)
635
- l("click-create");
1586
+ if (ft.value)
1587
+ n("click-create");
636
1588
  else {
637
- if (typeof t.newValueGenerator == "function") {
638
- let e = t.newValueGenerator();
639
- if (typeof e == "object" || t.type !== be.Table) {
640
- a.value.push(e);
1589
+ if (typeof a.newValueGenerator == "function") {
1590
+ let t = a.newValueGenerator();
1591
+ if (typeof t == "object" || a.type !== et.Table) {
1592
+ r.value.push(t);
641
1593
  return;
642
1594
  }
643
1595
  }
644
- a.value.push({});
1596
+ r.value.push({});
645
1597
  }
646
- }, Ze = (e) => {
647
- a.value.push(e);
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 && [
651
- Ne.Split,
652
- Ne.SplitEver,
653
- Ne.SplitLazy
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);
1598
+ }, D = (t) => {
1599
+ r.value.push(t);
1600
+ }, N = () => V.value = !0, G = () => V.value = !1, le = (t, p) => {
1601
+ var M, K, te;
1602
+ if (!((M = R.value) != null && M.type && [
1603
+ Lt.Split,
1604
+ Lt.SplitEver,
1605
+ Lt.SplitLazy
1606
+ ].includes((K = R.value) == null ? void 0 : K.type))) {
1607
+ if (n("before-save"), (te = R.value) != null && te.resource && (V.value = !1, !p.success)) {
1608
+ n("error", p.httpStatus);
657
1609
  return;
658
1610
  }
659
- r.value.turnStoredIntoOriginal(), re.value = !1, l("save", d);
1611
+ f.value.turnStoredIntoOriginal(), j.value = !1, n("save", p);
660
1612
  }
661
- }, tt = (e, d, C) => {
662
- if (C >= e.length) {
663
- let R = C - e.length + 1;
664
- for (; R--; ) e.push(void 0);
1613
+ }, ee = (t, p, M) => {
1614
+ if (M >= t.length) {
1615
+ let K = M - t.length + 1;
1616
+ for (; K--; ) t.push(void 0);
665
1617
  }
666
- return e.splice(C, 0, e.splice(d, 1)[0]), e;
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();
671
- }, Me = (e) => {
672
- a.value.splice(e, 1), j.value = ae();
673
- }, _t = () => {
674
- var e;
675
- x.value && typeof ((e = x.value) == null ? void 0 : e.destroy) == "function" && (x.value.destroy(), x.value = {});
676
- }, lt = () => {
677
- E.value || (E.value = document.getElementById("lkt-table-body-" + ce)), x.value = new xt(E.value, {
1618
+ return t.splice(M, 0, t.splice(p, 1)[0]), t;
1619
+ }, Vt = (t) => {
1620
+ ee(r.value, t, t - 1), U.value = Le();
1621
+ }, Nt = (t) => {
1622
+ ee(r.value, t, t + 1), U.value = Le();
1623
+ }, Qe = (t) => {
1624
+ r.value.splice(t, 1), U.value = Le();
1625
+ }, ga = () => {
1626
+ var t;
1627
+ Z.value && typeof ((t = Z.value) == null ? void 0 : t.destroy) == "function" && (Z.value.destroy(), Z.value = {});
1628
+ }, Ht = () => {
1629
+ L.value || (L.value = document.getElementById("lkt-table-body-" + ue)), Z.value = new Ra(L.value, {
678
1630
  direction: "vertical",
679
1631
  handle: ".handle",
680
1632
  animation: 150,
681
- onEnd: function(e) {
682
- let d = e.oldIndex, C = e.newIndex;
683
- a.value.splice(C, 0, a.value.splice(d, 1)[0]), j.value = ae(), l("drag-end", a.value[C]);
1633
+ onEnd: function(t) {
1634
+ let p = t.oldIndex, M = t.newIndex;
1635
+ r.value.splice(M, 0, r.value.splice(p, 1)[0]), U.value = Le(), n("drag-end", r.value[M]);
684
1636
  },
685
- onMove: function(e, d) {
686
- return Ft(e);
1637
+ onMove: function(t, p) {
1638
+ return s(t);
687
1639
  }
688
1640
  });
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(() => {
697
- var e;
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(() => {
699
- lt();
1641
+ }, _t = (t, p, M = !1) => {
1642
+ let K = [U.value, ue, "row", p];
1643
+ return M && K.push("hidden"), ze.value.forEach((te) => {
1644
+ let ce = String(t[te.key]).toLowerCase();
1645
+ ce.length > 50 && (ce = ce.substring(0, 50)), ce = ra(ce, " ", "-"), K.push(ce);
1646
+ }), K.join("-");
1647
+ }, xt = u(() => typeof a.createEnabledValidator == "function" ? a.createEnabledValidator({ items: r.value }) : !0), gt = u(() => ft.value || ke.value && k.value || Ye.value && k.value || Re.value && k.value), ba = u(() => [et.Ol, et.Ul].includes(a.type)), Mt = (t, p) => typeof a.itemDisplayChecker == "function" ? a.itemDisplayChecker(t) : !0;
1648
+ jt(() => {
1649
+ var t;
1650
+ a.initialSorting && ot(ll(a.columns, g.value)), f.value.store({ items: r.value }).turnStoredIntoOriginal(), j.value = !1, (t = a.drag) != null && t.enabled && bt(() => {
1651
+ Ht();
700
1652
  });
701
- }), F(() => {
702
- var e;
703
- return (e = t.drag) == null ? void 0 : e.enabled;
704
- }, (e) => {
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);
708
- }, { deep: !0 }), v({
709
- getItemByEvent: Lt,
710
- getItemByIndex: Pt,
711
- getRowByIndex: Nt,
712
- doRefresh: ht,
713
- getHtml: () => fe.value,
1653
+ }), H(() => {
1654
+ var t;
1655
+ return (t = a.drag) == null ? void 0 : t.enabled;
1656
+ }, (t) => {
1657
+ t ? Ht() : ga();
1658
+ }), H(() => a.perms, (t) => O.value = t), H(O, (t) => n("update:perms", t)), H(() => a.editMode, (t) => k.value = t), H(() => a.columns, (t) => S.value = t, { deep: !0 }), H(() => a.modelValue, (t) => r.value = t, { deep: !0 }), H(r, (t) => {
1659
+ f.value.increment({ items: t }), j.value = f.value.changed(), n("update:modelValue", t);
1660
+ }, { deep: !0 }), o({
1661
+ getItemByEvent: We,
1662
+ getItemByIndex: Et,
1663
+ getRowByIndex: At,
1664
+ doRefresh: me,
1665
+ getHtml: () => ne.value,
714
1666
  turnStoredIntoOriginal: () => {
715
- r.value.turnStoredIntoOriginal(), Be(() => {
716
- j.value = ae();
1667
+ f.value.turnStoredIntoOriginal(), bt(() => {
1668
+ U.value = Le();
717
1669
  });
718
1670
  }
719
1671
  });
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);
721
- return (e, d) => {
722
- const C = z("lkt-button"), R = z("lkt-field"), A = z("lkt-loader"), q = z("lkt-paginator");
723
- return u(), p("section", {
1672
+ const ya = u(() => typeof Y.defaultEmptySlot < "u"), ha = u(() => Y.defaultEmptySlot), ka = u(() => !a.drag || Object.keys(a.drag).length === 0 || !a.drag.enabled ? !1 : typeof a.drag.canRender > "u" ? !0 : a.drag.canRender), Sa = u(() => !a.drag || Object.keys(a.drag).length === 0 || !a.drag.enabled || typeof a.drag.isDisabled > "u" ? !1 : a.drag.isDisabled);
1673
+ return (t, p) => {
1674
+ const M = ve("lkt-button"), K = ve("lkt-field"), te = ve("lkt-loader"), ce = ve("lkt-paginator");
1675
+ return d(), h("section", {
724
1676
  ref_key: "element",
725
- ref: fe,
1677
+ ref: ne,
726
1678
  class: "lkt-table-page",
727
- id: "lkt-table-page-" + y(ce)
1679
+ id: "lkt-table-page-" + B(ue)
728
1680
  }, [
729
- $e.value || y(n).title ? (u(), p("header", {
1681
+ Me.value || B(l).title ? (d(), h("header", {
730
1682
  key: 0,
731
- class: K(e.headerClass)
1683
+ class: re(t.headerClass)
732
1684
  }, [
733
- $e.value ? (u(), S(Z(wt.value), { key: 0 }, {
734
- default: L(() => [
735
- e.titleIcon ? (u(), p("i", {
1685
+ Me.value ? (d(), $(Ie(ct.value), { key: 0 }, {
1686
+ default: F(() => [
1687
+ t.titleIcon ? (d(), h("i", {
736
1688
  key: 0,
737
- class: K(e.titleIcon)
738
- }, null, 2)) : f("", !0),
739
- ee(" " + ue($e.value), 1)
1689
+ class: re(t.titleIcon)
1690
+ }, null, 2)) : A("", !0),
1691
+ Ae(" " + Pe(Me.value), 1)
740
1692
  ]),
741
1693
  _: 1
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), {
746
- class: K(["lkt-table-page-content-wrapper", e.wrapContentClass])
1694
+ })) : A("", !0),
1695
+ B(l).title ? z(t.$slots, "title", { key: 1 }) : A("", !0)
1696
+ ], 2)) : A("", !0),
1697
+ (d(), $(Ie(vt.value), {
1698
+ class: re(["lkt-table-page-content-wrapper", t.wrapContentClass])
747
1699
  }, {
748
- default: L(() => [
749
- Dt.value ? (u(), p("div", El, [
750
- ge(pe(C, Q({
1700
+ default: F(() => [
1701
+ It.value ? (d(), h("div", Il, [
1702
+ it(Be(M, fe({
751
1703
  class: "lkt-table--save-button",
752
1704
  ref_key: "saveButtonRef",
753
1705
  ref: Ve
754
- }, N.value, {
755
- disabled: Te.value,
756
- "modal-data": Vt.value,
757
- onLoading: xe,
758
- onLoaded: et,
759
- onClick: At
1706
+ }, R.value, {
1707
+ disabled: lt.value,
1708
+ "modal-data": Tt.value,
1709
+ onLoading: N,
1710
+ onLoaded: G,
1711
+ onClick: le
760
1712
  }), {
761
- split: L(({ doClose: B, doRootClick: g }) => [
762
- T(e.$slots, "button-save-split", {
763
- doClose: B,
764
- doRootClick: g,
765
- dataState: r.value,
766
- onButtonLoading: xe,
767
- onButtonLoaded: et
1713
+ split: F(({ doClose: _, doRootClick: I }) => [
1714
+ z(t.$slots, "button-save-split", {
1715
+ doClose: _,
1716
+ doRootClick: I,
1717
+ dataState: f.value,
1718
+ onButtonLoading: N,
1719
+ onButtonLoaded: G
768
1720
  })
769
1721
  ]),
770
- default: L(() => [
771
- y(n)["button-save"] ? T(e.$slots, "button-save", {
1722
+ default: F(() => [
1723
+ B(l)["button-save"] ? z(t.$slots, "button-save", {
772
1724
  key: 0,
773
- items: a.value,
774
- editMode: e.editMode,
775
- canUpdate: !Te.value
776
- }) : f("", !0)
1725
+ items: r.value,
1726
+ editMode: t.editMode,
1727
+ canUpdate: !lt.value
1728
+ }) : A("", !0)
777
1729
  ]),
778
1730
  _: 3
779
1731
  }, 16, ["disabled", "modal-data"]), [
780
- [ke, _e.value]
1732
+ [rt, qe.value]
781
1733
  ]),
782
- Ce.value && a.value.length >= e.requiredItemsForTopCreate ? (u(), S(ut, {
1734
+ gt.value && r.value.length >= t.requiredItemsForTopCreate ? (d(), $(ea, {
783
1735
  key: 0,
784
- config: Ae.value,
785
- disabled: !at.value,
786
- onClick: Ye,
787
- onAppend: Ze
788
- }, null, 8, ["config", "disabled"])) : f("", !0),
789
- O("div", Tl, [
790
- ge(pe(R, Q(ct.value, {
791
- modelValue: m.value,
792
- "onUpdate:modelValue": d[0] || (d[0] = (B) => m.value = B)
1736
+ config: Te.value,
1737
+ disabled: !xt.value,
1738
+ onClick: w,
1739
+ onAppend: D
1740
+ }, null, 8, ["config", "disabled"])) : A("", !0),
1741
+ J("div", Tl, [
1742
+ it(Be(K, fe(Ct.value, {
1743
+ modelValue: k.value,
1744
+ "onUpdate:modelValue": p[0] || (p[0] = (_) => k.value = _)
793
1745
  }), null, 16, ["modelValue"]), [
794
- [ke, ze.value]
1746
+ [rt, Ke.value]
795
1747
  ])
796
1748
  ])
797
- ])) : f("", !0),
798
- y(n).buttons ? (u(), p("div", $l, [
799
- T(e.$slots, "buttons")
800
- ])) : f("", !0),
801
- le.value && y(n).filters ? (u(), p("div", Rl, [
802
- T(e.$slots, "filters", {
803
- items: a.value,
804
- isLoading: I.value
1749
+ ])) : A("", !0),
1750
+ B(l).buttons ? (d(), h("div", El, [
1751
+ z(t.$slots, "buttons")
1752
+ ])) : A("", !0),
1753
+ he.value && B(l).filters ? (d(), h("div", Al, [
1754
+ z(t.$slots, "filters", {
1755
+ items: r.value,
1756
+ isLoading: V.value
805
1757
  })
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),
814
- (u(!0), p(P, null, J(he.value, (B) => (u(), p(P, null, [
815
- we.value.indexOf(B.key) === -1 ? (u(), S(Vl, {
1758
+ ])) : A("", !0),
1759
+ it(J("div", Vl, [
1760
+ t.type === B(et).Table ? (d(), h("table", Nl, [
1761
+ J("thead", null, [
1762
+ J("tr", null, [
1763
+ Ge.value && k.value ? (d(), h("th", _l)) : A("", !0),
1764
+ t.addNavigation && k.value ? (d(), h("th", Ml)) : A("", !0),
1765
+ pe.value ? (d(), h("th", Rl)) : A("", !0),
1766
+ (d(!0), h(x, null, ie(se.value, (_) => (d(), h(x, null, [
1767
+ _e.value.indexOf(_.key) === -1 ? (d(), $(Dl, {
816
1768
  key: 0,
817
- column: B,
818
- "sort-by": k.value,
819
- "sort-direction": s.value,
820
- "amount-of-columns": e.columns.length,
821
- items: a.value,
822
- onClick: (g) => Ge(B)
823
- }, null, 8, ["column", "sort-by", "sort-direction", "amount-of-columns", "items", "onClick"])) : f("", !0)
1769
+ column: _,
1770
+ "sort-by": g.value,
1771
+ "sort-direction": m.value,
1772
+ "amount-of-columns": t.columns.length,
1773
+ items: r.value,
1774
+ onClick: (I) => ot(_)
1775
+ }, null, 8, ["column", "sort-by", "sort-direction", "amount-of-columns", "items", "onClick"])) : A("", !0)
824
1776
  ], 64))), 256)),
825
- se.value && m.value ? (u(), p("th", Al)) : f("", !0),
826
- He.value && ie.value && m.value ? (u(), p("th", Ol)) : f("", !0)
1777
+ be.value && k.value ? (d(), h("th", $l)) : A("", !0),
1778
+ ge.value && de.value && k.value ? (d(), h("th", Ll)) : A("", !0)
827
1779
  ])
828
1780
  ]),
829
- O("tbody", {
1781
+ J("tbody", {
830
1782
  ref_key: "tableBody",
831
- ref: _,
832
- id: "lkt-table-body-" + y(ce)
1783
+ ref: c,
1784
+ id: "lkt-table-body-" + B(ue)
833
1785
  }, [
834
- (u(!0), p(P, null, J(a.value, (B, g) => ge((u(), S(gl, {
835
- modelValue: a.value[g],
836
- "onUpdate:modelValue": (M) => a.value[g] = M,
837
- key: Le(B, g),
838
- i: g,
839
- "drop-button": yt.value,
840
- "edit-button": e.editButton,
841
- "display-hidden-columns-indicator": Oe.value,
842
- "is-draggable": Xe(B),
843
- sortable: Re.value,
844
- "visible-columns": he.value,
845
- "empty-columns": we.value,
846
- "add-navigation": e.addNavigation,
847
- "hidden-is-visible": We(g),
848
- "latest-row": g + 1 === It.value,
849
- "can-drop": se.value && m.value,
850
- "can-edit": He.value && ie.value && m.value,
851
- "edit-mode-enabled": m.value,
852
- "has-inline-edit-perm": qe.value,
853
- "row-display-type": e.rowDisplayType,
854
- "render-drag": Kt.value,
855
- "disabled-drag": zt.value,
856
- onClick: Je,
857
- onShow: Qe,
858
- onItemUp: Ot,
859
- onItemDown: Ut,
860
- onItemDrop: Me
861
- }, nt({ _: 2 }, [
862
- y(n)[`item-${g}`] ? {
863
- name: `item-${g}`,
864
- fn: L((M) => [
865
- T(e.$slots, `item-${g}`, oe({
866
- [e.slotItemVar || ""]: M.item,
867
- index: g
1786
+ (d(!0), h(x, null, ie(r.value, (_, I) => it((d(), $(gl, {
1787
+ modelValue: r.value[I],
1788
+ "onUpdate:modelValue": (W) => r.value[I] = W,
1789
+ key: _t(_, I),
1790
+ i: I,
1791
+ "drop-button": Ue.value,
1792
+ "edit-button": t.editButton,
1793
+ "display-hidden-columns-indicator": pe.value,
1794
+ "is-draggable": y(_),
1795
+ sortable: Ge.value,
1796
+ "visible-columns": se.value,
1797
+ "empty-columns": _e.value,
1798
+ "add-navigation": t.addNavigation,
1799
+ "hidden-is-visible": mt(I),
1800
+ "latest-row": I + 1 === dt.value,
1801
+ "can-drop": be.value && k.value,
1802
+ "can-edit": ge.value && de.value && k.value,
1803
+ "edit-mode-enabled": k.value,
1804
+ "has-inline-edit-perm": Se.value,
1805
+ "row-display-type": t.rowDisplayType,
1806
+ "render-drag": ka.value,
1807
+ "disabled-drag": Sa.value,
1808
+ onClick: pt,
1809
+ onShow: Je,
1810
+ onItemUp: Vt,
1811
+ onItemDown: Nt,
1812
+ onItemDrop: Qe
1813
+ }, Xt({ _: 2 }, [
1814
+ B(l)[`item-${I}`] ? {
1815
+ name: `item-${I}`,
1816
+ fn: F((W) => [
1817
+ z(t.$slots, `item-${I}`, Ee({
1818
+ [t.slotItemVar || ""]: W.item,
1819
+ index: I
868
1820
  }))
869
1821
  ]),
870
1822
  key: "0"
871
- } : y(n).item ? {
1823
+ } : B(l).item ? {
872
1824
  name: "item",
873
- fn: L((M) => [
874
- T(e.$slots, "item", oe({
875
- [e.slotItemVar || ""]: M.item,
876
- index: g
1825
+ fn: F((W) => [
1826
+ z(t.$slots, "item", Ee({
1827
+ [t.slotItemVar || ""]: W.item,
1828
+ index: I
877
1829
  }))
878
1830
  ]),
879
1831
  key: "1"
880
1832
  } : void 0,
881
- J(Ue.value, (M) => ({
882
- name: M,
883
- fn: L((G) => [
884
- T(e.$slots, M, oe({
885
- [e.slotItemVar || ""]: G.item,
886
- value: G.value,
887
- column: G.column
1833
+ ie(oe.value, (W) => ({
1834
+ name: W,
1835
+ fn: F((ye) => [
1836
+ z(t.$slots, W, Ee({
1837
+ [t.slotItemVar || ""]: ye.item,
1838
+ value: ye.value,
1839
+ column: ye.column
888
1840
  }))
889
1841
  ])
890
1842
  }))
891
1843
  ]), 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"])), [
892
- [ke, Pe(a.value[g])]
1844
+ [rt, Mt(r.value[I])]
893
1845
  ])), 128)),
894
- Ee.value.length > 0 ? (u(!0), p(P, { key: 0 }, J(a.value, (B, g) => (u(), S(Dl, {
895
- modelValue: a.value[g],
896
- "onUpdate:modelValue": (M) => a.value[g] = M,
897
- key: Le(B, g, !0),
898
- i: g,
899
- "hidden-columns": Ee.value,
900
- "hidden-columns-col-span": Ct.value,
901
- "is-draggable": Xe(B),
902
- sortable: Re.value,
903
- "visible-columns": he.value,
904
- "empty-columns": we.value,
905
- "hidden-is-visible": We(g),
906
- "edit-mode-enabled": m.value,
907
- "has-inline-edit-perm": qe.value,
908
- onClick: Je,
909
- onShow: Qe
910
- }, nt({ _: 2 }, [
911
- J(Ue.value, (M) => ({
912
- name: M,
913
- fn: L((G) => [
914
- T(e.$slots, M, oe({
915
- [e.slotItemVar || ""]: G.item,
916
- value: G.value,
917
- column: G.column
1846
+ je.value.length > 0 ? (d(!0), h(x, { key: 0 }, ie(r.value, (_, I) => (d(), $(wl, {
1847
+ modelValue: r.value[I],
1848
+ "onUpdate:modelValue": (W) => r.value[I] = W,
1849
+ key: _t(_, I, !0),
1850
+ i: I,
1851
+ "hidden-columns": je.value,
1852
+ "hidden-columns-col-span": st.value,
1853
+ "is-draggable": y(_),
1854
+ sortable: Ge.value,
1855
+ "visible-columns": se.value,
1856
+ "empty-columns": _e.value,
1857
+ "hidden-is-visible": mt(I),
1858
+ "edit-mode-enabled": k.value,
1859
+ "has-inline-edit-perm": Se.value,
1860
+ onClick: pt,
1861
+ onShow: Je
1862
+ }, Xt({ _: 2 }, [
1863
+ ie(oe.value, (W) => ({
1864
+ name: W,
1865
+ fn: F((ye) => [
1866
+ z(t.$slots, W, Ee({
1867
+ [t.slotItemVar || ""]: ye.item,
1868
+ value: ye.value,
1869
+ column: ye.column
918
1870
  }))
919
1871
  ])
920
1872
  }))
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", {
1873
+ ]), 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)) : A("", !0)
1874
+ ], 8, Ol)
1875
+ ])) : t.type === B(et).Item ? (d(), h("div", {
924
1876
  key: 1,
925
1877
  ref_key: "tableBody",
926
- ref: _,
927
- id: "lkt-table-body-" + y(ce),
928
- class: K(["lkt-table-items-container", e.itemsContainerClass])
1878
+ ref: c,
1879
+ id: "lkt-table-body-" + B(ue),
1880
+ class: re(["lkt-table-items-container", t.itemsContainerClass])
929
1881
  }, [
930
- (u(!0), p(P, null, J(a.value, (B, g) => (u(), p(P, null, [
931
- Pe(B) ? (u(), p("div", {
1882
+ (d(!0), h(x, null, ie(r.value, (_, I) => (d(), h(x, null, [
1883
+ Mt(_) ? (d(), h("div", {
932
1884
  class: "lkt-table-item",
933
- "data-i": g,
934
- key: Le(B, g)
1885
+ "data-i": I,
1886
+ key: _t(_, I)
935
1887
  }, [
936
- T(e.$slots, "item", oe({
937
- [e.slotItemVar || ""]: B,
938
- index: g,
939
- editing: m.value,
940
- canCreate: ye.value,
941
- canRead: je.value,
942
- canUpdate: ie.value,
943
- canDrop: se.value,
944
- isLoading: I.value,
945
- doDrop: () => Me(g)
1888
+ z(t.$slots, "item", Ee({
1889
+ [t.slotItemVar || ""]: _,
1890
+ index: I,
1891
+ editing: k.value,
1892
+ canCreate: ke.value,
1893
+ canRead: Xe.value,
1894
+ canUpdate: de.value,
1895
+ canDrop: be.value,
1896
+ isLoading: V.value,
1897
+ doDrop: () => Qe(I)
946
1898
  }))
947
- ], 8, jl)) : f("", !0)
1899
+ ], 8, Fl)) : A("", !0)
948
1900
  ], 64))), 256))
949
- ], 10, _l)) : jt.value ? (u(), S(Z(e.type), {
1901
+ ], 10, Pl)) : ba.value ? (d(), $(Ie(t.type), {
950
1902
  key: 2,
951
- class: K(["lkt-table-items-container", e.itemsContainerClass])
1903
+ class: re(["lkt-table-items-container", t.itemsContainerClass])
952
1904
  }, {
953
- default: L(() => [
954
- (u(!0), p(P, null, J(a.value, (B, g) => (u(), p(P, null, [
955
- Pe(B) ? (u(), p("li", {
1905
+ default: F(() => [
1906
+ (d(!0), h(x, null, ie(r.value, (_, I) => (d(), h(x, null, [
1907
+ Mt(_) ? (d(), h("li", {
956
1908
  key: 0,
957
1909
  class: "lkt-table-item",
958
- "data-i": g
1910
+ "data-i": I
959
1911
  }, [
960
- T(e.$slots, "item", oe({
961
- [e.slotItemVar || ""]: B,
962
- index: g,
963
- editing: m.value,
964
- canCreate: ye.value,
965
- canRead: je.value,
966
- canUpdate: ie.value,
967
- canDrop: se.value,
968
- isLoading: I.value,
969
- doDrop: () => Me(g)
1912
+ z(t.$slots, "item", Ee({
1913
+ [t.slotItemVar || ""]: _,
1914
+ index: I,
1915
+ editing: k.value,
1916
+ canCreate: ke.value,
1917
+ canRead: Xe.value,
1918
+ canUpdate: de.value,
1919
+ canDrop: be.value,
1920
+ isLoading: V.value,
1921
+ doDrop: () => Qe(I)
970
1922
  }))
971
- ], 8, Hl)) : f("", !0)
1923
+ ], 8, Ul)) : A("", !0)
972
1924
  ], 64))), 256))
973
1925
  ]),
974
1926
  _: 3
975
- }, 8, ["class"])) : f("", !0)
1927
+ }, 8, ["class"])) : t.type === B(et).Carousel ? (d(), h("div", {
1928
+ key: 3,
1929
+ ref_key: "tableBody",
1930
+ ref: c,
1931
+ id: "lkt-table-body-" + B(ue),
1932
+ class: re(["lkt-table-items-container", t.itemsContainerClass])
1933
+ }, [
1934
+ Be(B(Xa), fe({
1935
+ modelValue: Q.value,
1936
+ "onUpdate:modelValue": p[1] || (p[1] = (_) => Q.value = _)
1937
+ }, t.carousel), {
1938
+ addons: F(() => [
1939
+ Be(B(Wa)),
1940
+ Be(B(Ja))
1941
+ ]),
1942
+ default: F(() => [
1943
+ (d(!0), h(x, null, ie(xe.value, (_, I) => (d(), $(B(Zt), {
1944
+ key: _,
1945
+ index: I
1946
+ }, {
1947
+ default: F(() => [
1948
+ J("div", zl, [
1949
+ z(t.$slots, _)
1950
+ ])
1951
+ ]),
1952
+ _: 2
1953
+ }, 1032, ["index"]))), 128)),
1954
+ (d(!0), h(x, null, ie(r.value, (_, I) => (d(), $(B(Zt), {
1955
+ key: t.slide,
1956
+ index: I
1957
+ }, {
1958
+ default: F(() => [
1959
+ J("div", Hl, [
1960
+ z(t.$slots, "item", Ee({
1961
+ [t.slotItemVar || ""]: _,
1962
+ index: I,
1963
+ editing: k.value,
1964
+ canCreate: ke.value,
1965
+ canRead: Xe.value,
1966
+ canUpdate: de.value,
1967
+ canDrop: be.value,
1968
+ isLoading: V.value,
1969
+ doDrop: () => Qe(I)
1970
+ }))
1971
+ ])
1972
+ ]),
1973
+ _: 2
1974
+ }, 1032, ["index"]))), 128))
1975
+ ]),
1976
+ _: 3
1977
+ }, 16, ["modelValue"])
1978
+ ], 10, jl)) : A("", !0)
976
1979
  ], 512), [
977
- [ke, Mt.value]
1980
+ [rt, nt.value]
978
1981
  ]),
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), {
1982
+ !V.value && r.value.length === 0 ? (d(), h("div", xl, [
1983
+ B(l).empty ? z(t.$slots, "empty", { key: 0 }) : ya.value ? (d(), $(Ie(ha.value), {
981
1984
  key: 1,
982
- message: e.noResultsText
983
- }, null, 8, ["message"])) : e.noResultsText ? (u(), p(P, { key: 2 }, [
984
- ee(ue(e.noResultsText), 1)
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, [
989
- Ce.value && a.value.length >= e.requiredItemsForBottomCreate ? (u(), S(ut, {
1985
+ message: t.noResultsText
1986
+ }, null, 8, ["message"])) : t.noResultsText ? (d(), h(x, { key: 2 }, [
1987
+ Ae(Pe(t.noResultsText), 1)
1988
+ ], 64)) : A("", !0)
1989
+ ])) : A("", !0),
1990
+ V.value ? (d(), $(te, { key: 4 })) : A("", !0),
1991
+ gt.value || B(l).bottomButtons ? (d(), h("div", ql, [
1992
+ gt.value && r.value.length >= t.requiredItemsForBottomCreate ? (d(), $(ea, {
990
1993
  key: 0,
991
- config: Ae.value,
992
- disabled: !at.value,
993
- onClick: Ye,
994
- onAppend: Ze
995
- }, null, 8, ["config", "disabled"])) : f("", !0),
996
- T(e.$slots, "bottom-buttons")
997
- ])) : f("", !0),
998
- e.paginator && Object.keys(e.paginator).length > 0 ? (u(), S(q, Q({
1994
+ config: Te.value,
1995
+ disabled: !xt.value,
1996
+ onClick: w,
1997
+ onAppend: D
1998
+ }, null, 8, ["config", "disabled"])) : A("", !0),
1999
+ z(t.$slots, "bottom-buttons")
2000
+ ])) : A("", !0),
2001
+ t.paginator && Object.keys(t.paginator).length > 0 ? (d(), $(ce, fe({
999
2002
  key: 6,
1000
2003
  ref_key: "paginatorRef",
1001
- ref: W
1002
- }, e.paginator, {
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)
2004
+ ref: q
2005
+ }, t.paginator, {
2006
+ modelValue: E.value,
2007
+ "onUpdate:modelValue": p[2] || (p[2] = (_) => E.value = _),
2008
+ onLoading: Bt,
2009
+ onPerms: Dt,
2010
+ onResponse: Ne
2011
+ }), null, 16, ["modelValue"])) : A("", !0)
1009
2012
  ]),
1010
2013
  _: 3
1011
2014
  }, 8, ["class"]))
1012
- ], 8, wl);
2015
+ ], 8, Bl);
1013
2016
  };
1014
2017
  }
1015
- }), xl = {
1016
- install: (o) => {
1017
- o.component("lkt-table") === void 0 && o.component("lkt-table", zl);
2018
+ }), en = {
2019
+ install: (e) => {
2020
+ e.component("lkt-table") === void 0 && e.component("lkt-table", Gl);
1018
2021
  }
1019
- }, ea = (o) => ($.navButtonSlot = o, !0), ta = (o) => ($.dropButtonSlot = o, !0), la = (o) => ($.createButtonSlot = o, !0), aa = (o) => {
1020
- $.defaultEmptySlot = o;
1021
- }, oa = (o) => {
1022
- $.defaultSaveIcon = o;
2022
+ }, tn = (e) => (Y.navButtonSlot = e, !0), an = (e) => (Y.dropButtonSlot = e, !0), ln = (e) => (Y.createButtonSlot = e, !0), nn = (e) => {
2023
+ Y.defaultEmptySlot = e;
2024
+ }, on = (e) => {
2025
+ Y.defaultSaveIcon = e;
1023
2026
  };
1024
2027
  export {
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
2028
+ sn as Column,
2029
+ dn as createColumn,
2030
+ en as default,
2031
+ ln as setTableCreateButtonSlot,
2032
+ an as setTableDropButtonSlot,
2033
+ nn as setTableEmptySlot,
2034
+ tn as setTableNavButtonSlot,
2035
+ on as setTableSaveIcon
1033
2036
  };