lkt-table 2.0.6 → 2.0.8

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