lkt-table 1.2.11 → 1.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/build.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  declare class K {
2
- constructor(t?: string, r?: string);
2
+ constructor(t?: string, i?: string);
3
3
  key: string;
4
4
  label: string;
5
5
  sortable: boolean;
@@ -59,7 +59,7 @@ declare class K {
59
59
  setMultipleDisplayEditionToInline(): this;
60
60
  setSlotData(t: any): this;
61
61
  slotData: any;
62
- setAutoLoadSelectOptions(t?: boolean, r?: string): this;
62
+ setAutoLoadSelectOptions(t?: boolean, i?: string): this;
63
63
  autoLoadSelectOptions: boolean | undefined;
64
64
  autoLoadSelectOptionsKey: string | undefined;
65
65
  setTagMode(t?: boolean): this;
@@ -70,7 +70,7 @@ declare class K {
70
70
  useForRowKey(t?: boolean): this;
71
71
  isForRowKey: boolean | undefined;
72
72
  }
73
- declare function Tl(l: any, t: any, r: any, n?: boolean): {
73
+ declare function Tl(l: any, t: any, i: any, n?: boolean): {
74
74
  key: string;
75
75
  label: string;
76
76
  sortable: boolean;
@@ -130,7 +130,7 @@ declare function Tl(l: any, t: any, r: any, n?: boolean): {
130
130
  setMultipleDisplayEditionToInline: () => K;
131
131
  setSlotData: (t: any) => K;
132
132
  slotData: any;
133
- setAutoLoadSelectOptions: (t?: boolean, r?: string) => K;
133
+ setAutoLoadSelectOptions: (t?: boolean, i?: string) => K;
134
134
  autoLoadSelectOptions: boolean | undefined;
135
135
  autoLoadSelectOptionsKey: string | undefined;
136
136
  setTagMode: (t?: boolean) => K;
@@ -141,7 +141,7 @@ declare function Tl(l: any, t: any, r: any, n?: boolean): {
141
141
  useForRowKey: (t?: boolean) => K;
142
142
  isForRowKey: boolean | undefined;
143
143
  };
144
- declare function Ll(l: any, t: any, r?: boolean): {
144
+ declare function Ll(l: any, t: any, i?: boolean): {
145
145
  key: string;
146
146
  label: string;
147
147
  sortable: boolean;
@@ -201,7 +201,7 @@ declare function Ll(l: any, t: any, r?: boolean): {
201
201
  setMultipleDisplayEditionToInline: () => K;
202
202
  setSlotData: (t: any) => K;
203
203
  slotData: any;
204
- setAutoLoadSelectOptions: (t?: boolean, r?: string) => K;
204
+ setAutoLoadSelectOptions: (t?: boolean, i?: string) => K;
205
205
  autoLoadSelectOptions: boolean | undefined;
206
206
  autoLoadSelectOptionsKey: string | undefined;
207
207
  setTagMode: (t?: boolean) => K;
@@ -212,7 +212,7 @@ declare function Ll(l: any, t: any, r?: boolean): {
212
212
  useForRowKey: (t?: boolean) => K;
213
213
  isForRowKey: boolean | undefined;
214
214
  };
215
- declare function Dl(l: any, t: any, r?: boolean): {
215
+ declare function Dl(l: any, t: any, i?: boolean): {
216
216
  key: string;
217
217
  label: string;
218
218
  sortable: boolean;
@@ -272,7 +272,7 @@ declare function Dl(l: any, t: any, r?: boolean): {
272
272
  setMultipleDisplayEditionToInline: () => K;
273
273
  setSlotData: (t: any) => K;
274
274
  slotData: any;
275
- setAutoLoadSelectOptions: (t?: boolean, r?: string) => K;
275
+ setAutoLoadSelectOptions: (t?: boolean, i?: string) => K;
276
276
  autoLoadSelectOptions: boolean | undefined;
277
277
  autoLoadSelectOptionsKey: string | undefined;
278
278
  setTagMode: (t?: boolean) => K;
@@ -283,7 +283,7 @@ declare function Dl(l: any, t: any, r?: boolean): {
283
283
  useForRowKey: (t?: boolean) => K;
284
284
  isForRowKey: boolean | undefined;
285
285
  };
286
- declare function El(l: any, t: any, r?: boolean): {
286
+ declare function Il(l: any, t: any, i?: boolean): {
287
287
  key: string;
288
288
  label: string;
289
289
  sortable: boolean;
@@ -343,7 +343,7 @@ declare function El(l: any, t: any, r?: boolean): {
343
343
  setMultipleDisplayEditionToInline: () => K;
344
344
  setSlotData: (t: any) => K;
345
345
  slotData: any;
346
- setAutoLoadSelectOptions: (t?: boolean, r?: string) => K;
346
+ setAutoLoadSelectOptions: (t?: boolean, i?: string) => K;
347
347
  autoLoadSelectOptions: boolean | undefined;
348
348
  autoLoadSelectOptionsKey: string | undefined;
349
349
  setTagMode: (t?: boolean) => K;
@@ -354,7 +354,7 @@ declare function El(l: any, t: any, r?: boolean): {
354
354
  useForRowKey: (t?: boolean) => K;
355
355
  isForRowKey: boolean | undefined;
356
356
  };
357
- declare function $l(l: any, t: any, r?: boolean): {
357
+ declare function $l(l: any, t: any, i?: boolean): {
358
358
  key: string;
359
359
  label: string;
360
360
  sortable: boolean;
@@ -414,7 +414,7 @@ declare function $l(l: any, t: any, r?: boolean): {
414
414
  setMultipleDisplayEditionToInline: () => K;
415
415
  setSlotData: (t: any) => K;
416
416
  slotData: any;
417
- setAutoLoadSelectOptions: (t?: boolean, r?: string) => K;
417
+ setAutoLoadSelectOptions: (t?: boolean, i?: string) => K;
418
418
  autoLoadSelectOptions: boolean | undefined;
419
419
  autoLoadSelectOptionsKey: string | undefined;
420
420
  setTagMode: (t?: boolean) => K;
@@ -425,7 +425,7 @@ declare function $l(l: any, t: any, r?: boolean): {
425
425
  useForRowKey: (t?: boolean) => K;
426
426
  isForRowKey: boolean | undefined;
427
427
  };
428
- declare function wl(l: any, t: any, r: any, n?: boolean): {
428
+ declare function wl(l: any, t: any, i: any, n?: boolean): {
429
429
  key: string;
430
430
  label: string;
431
431
  sortable: boolean;
@@ -485,7 +485,7 @@ declare function wl(l: any, t: any, r: any, n?: boolean): {
485
485
  setMultipleDisplayEditionToInline: () => K;
486
486
  setSlotData: (t: any) => K;
487
487
  slotData: any;
488
- setAutoLoadSelectOptions: (t?: boolean, r?: string) => K;
488
+ setAutoLoadSelectOptions: (t?: boolean, i?: string) => K;
489
489
  autoLoadSelectOptions: boolean | undefined;
490
490
  autoLoadSelectOptionsKey: string | undefined;
491
491
  setTagMode: (t?: boolean) => K;
@@ -496,7 +496,7 @@ declare function wl(l: any, t: any, r: any, n?: boolean): {
496
496
  useForRowKey: (t?: boolean) => K;
497
497
  isForRowKey: boolean | undefined;
498
498
  };
499
- declare function Rl(l: any, t: any, r: any, n?: boolean): {
499
+ declare function Rl(l: any, t: any, i: any, n?: boolean): {
500
500
  key: string;
501
501
  label: string;
502
502
  sortable: boolean;
@@ -556,7 +556,7 @@ declare function Rl(l: any, t: any, r: any, n?: boolean): {
556
556
  setMultipleDisplayEditionToInline: () => K;
557
557
  setSlotData: (t: any) => K;
558
558
  slotData: any;
559
- setAutoLoadSelectOptions: (t?: boolean, r?: string) => K;
559
+ setAutoLoadSelectOptions: (t?: boolean, i?: string) => K;
560
560
  autoLoadSelectOptions: boolean | undefined;
561
561
  autoLoadSelectOptionsKey: string | undefined;
562
562
  setTagMode: (t?: boolean) => K;
@@ -567,7 +567,7 @@ declare function Rl(l: any, t: any, r: any, n?: boolean): {
567
567
  useForRowKey: (t?: boolean) => K;
568
568
  isForRowKey: boolean | undefined;
569
569
  };
570
- declare function Ml(l: any, t: any, r?: boolean): {
570
+ declare function Ml(l: any, t: any, i?: boolean): {
571
571
  key: string;
572
572
  label: string;
573
573
  sortable: boolean;
@@ -627,7 +627,7 @@ declare function Ml(l: any, t: any, r?: boolean): {
627
627
  setMultipleDisplayEditionToInline: () => K;
628
628
  setSlotData: (t: any) => K;
629
629
  slotData: any;
630
- setAutoLoadSelectOptions: (t?: boolean, r?: string) => K;
630
+ setAutoLoadSelectOptions: (t?: boolean, i?: string) => K;
631
631
  autoLoadSelectOptions: boolean | undefined;
632
632
  autoLoadSelectOptionsKey: string | undefined;
633
633
  setTagMode: (t?: boolean) => K;
@@ -638,7 +638,7 @@ declare function Ml(l: any, t: any, r?: boolean): {
638
638
  useForRowKey: (t?: boolean) => K;
639
639
  isForRowKey: boolean | undefined;
640
640
  };
641
- declare function Il(l: any, t: any, r?: boolean): {
641
+ declare function El(l: any, t: any, i?: boolean): {
642
642
  key: string;
643
643
  label: string;
644
644
  sortable: boolean;
@@ -698,7 +698,7 @@ declare function Il(l: any, t: any, r?: boolean): {
698
698
  setMultipleDisplayEditionToInline: () => K;
699
699
  setSlotData: (t: any) => K;
700
700
  slotData: any;
701
- setAutoLoadSelectOptions: (t?: boolean, r?: string) => K;
701
+ setAutoLoadSelectOptions: (t?: boolean, i?: string) => K;
702
702
  autoLoadSelectOptions: boolean | undefined;
703
703
  autoLoadSelectOptionsKey: string | undefined;
704
704
  setTagMode: (t?: boolean) => K;
@@ -709,7 +709,7 @@ declare function Il(l: any, t: any, r?: boolean): {
709
709
  useForRowKey: (t?: boolean) => K;
710
710
  isForRowKey: boolean | undefined;
711
711
  };
712
- declare function Bl(l: any, t: any, r?: boolean): {
712
+ declare function Bl(l: any, t: any, i?: boolean): {
713
713
  key: string;
714
714
  label: string;
715
715
  sortable: boolean;
@@ -769,7 +769,7 @@ declare function Bl(l: any, t: any, r?: boolean): {
769
769
  setMultipleDisplayEditionToInline: () => K;
770
770
  setSlotData: (t: any) => K;
771
771
  slotData: any;
772
- setAutoLoadSelectOptions: (t?: boolean, r?: string) => K;
772
+ setAutoLoadSelectOptions: (t?: boolean, i?: string) => K;
773
773
  autoLoadSelectOptions: boolean | undefined;
774
774
  autoLoadSelectOptionsKey: string | undefined;
775
775
  setTagMode: (t?: boolean) => K;
@@ -784,6 +784,6 @@ declare namespace Al {
784
784
  function install(l: any): void;
785
785
  }
786
786
  declare function Nl(l: any): boolean;
787
- declare function Fl(l: any): boolean;
788
787
  declare function Ol(l: any): boolean;
789
- export { K as LktTableColumn, Tl as createActionColumn, Ll as createCheckColumn, Dl as createColumn, El as createEmailColumn, $l as createHiddenColumn, wl as createLinkColumn, Rl as createSelectColumn, Ml as createSwitchColumn, Il as createTelColumn, Bl as createTextColumn, Al as default, Nl as setTableCreateButtonSlot, Fl as setTableDropButtonSlot, Ol as setTableNavButtonSlot };
788
+ declare function Fl(l: any): boolean;
789
+ export { K as LktTableColumn, Tl as createActionColumn, Ll as createCheckColumn, Dl as createColumn, Il as createEmailColumn, $l as createHiddenColumn, wl as createLinkColumn, Rl as createSelectColumn, Ml as createSwitchColumn, El as createTelColumn, Bl as createTextColumn, Al as default, Nl as setTableCreateButtonSlot, Ol as setTableDropButtonSlot, Fl as setTableNavButtonSlot };
package/dist/build.js CHANGED
@@ -1,6 +1,6 @@
1
- import { reactive as H, defineComponent as q, ref as C, watch as A, nextTick as de, computed as f, resolveComponent as R, openBlock as u, createBlock as b, withCtx as U, createTextVNode as le, toDisplayString as j, unref as L, createElementBlock as m, Fragment as $, withModifiers as ut, resolveDynamicComponent as Z, createCommentVNode as y, normalizeClass as te, createElementVNode as E, createVNode as X, renderList as W, renderSlot as N, withDirectives as x, vShow as ee, useSlots as st, onMounted as it, createSlots as Ee } from "vue";
2
- import { httpCall as rt } from "lkt-http-client";
3
- import { __ as z } from "lkt-i18n";
1
+ import { reactive as H, defineComponent as z, ref as C, watch as A, nextTick as de, computed as f, resolveComponent as R, openBlock as s, createBlock as b, withCtx as U, createTextVNode as le, toDisplayString as j, unref as L, createElementBlock as m, Fragment as $, withModifiers as ut, resolveDynamicComponent as Z, createCommentVNode as y, normalizeClass as te, createElementVNode as I, createVNode as X, renderList as W, renderSlot as N, withDirectives as x, vShow as ee, useSlots as st, onMounted as rt, createSlots as Ie } from "vue";
2
+ import { httpCall as it } from "lkt-http-client";
3
+ import { __ as G } from "lkt-i18n";
4
4
  import { createLktEvent as ce } from "lkt-events";
5
5
  import { generateRandomString as dt, replaceAll as ct } from "lkt-string-tools";
6
6
  import { DataState as mt } from "lkt-data-state";
@@ -14,8 +14,8 @@ import bt from "lkt-field-select";
14
14
  import gt from "lkt-field-switch";
15
15
  import Ct from "lkt-field-file";
16
16
  class K {
17
- constructor(t = "", r = "") {
18
- this.key = t, this.label = r, this.sortable = !0, this.hidden = !1, this.formatter = void 0, this.checkEmpty = void 0, this.colspan = void 0, this.resource = "", this.resourceData = {}, this.isMultiple = !1, this.isLoading = !1, this.resourceLoaded = !1, this.valueSlot = "", this.editSlot = "", this.multipleDisplay = "", this.multipleDisplayEdition = "";
17
+ constructor(t = "", i = "") {
18
+ this.key = t, this.label = i, this.sortable = !0, this.hidden = !1, this.formatter = void 0, this.checkEmpty = void 0, this.colspan = void 0, this.resource = "", this.resourceData = {}, this.isMultiple = !1, this.isLoading = !1, this.resourceLoaded = !1, this.valueSlot = "", this.editSlot = "", this.multipleDisplay = "", this.multipleDisplayEdition = "";
19
19
  }
20
20
  setIsSortable(t = !0) {
21
21
  return this.sortable = t, this;
@@ -102,7 +102,7 @@ class K {
102
102
  if (!this.resource) return this;
103
103
  try {
104
104
  this.isLoading = !0;
105
- const t = await rt(this.resource, this.resourceData);
105
+ const t = await it(this.resource, this.resourceData);
106
106
  this.options = t.data, this.isLoading = !1, this.resourceLoaded = !0;
107
107
  } catch {
108
108
  this.isLoading = !1;
@@ -139,8 +139,8 @@ class K {
139
139
  setSlotData(t) {
140
140
  return this.slotData = t, this;
141
141
  }
142
- setAutoLoadSelectOptions(t = !0, r = "") {
143
- return this.autoLoadSelectOptions = t, this.autoLoadSelectOptionsKey = r, this;
142
+ setAutoLoadSelectOptions(t = !0, i = "") {
143
+ return this.autoLoadSelectOptions = t, this.autoLoadSelectOptionsKey = i, this;
144
144
  }
145
145
  setTagMode(t = !0) {
146
146
  return this.tags = t, this;
@@ -155,38 +155,38 @@ class K {
155
155
  return this.isForRowKey = t, this;
156
156
  }
157
157
  }
158
- const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n = !0) => H(new K(l, t).setIsSortable(n).defineAsLink(r)), Tl = (l, t, r, n = !0) => H(new K(l, t).setIsSortable(n).defineAsAction(r)), Bl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r).defineAsText()), El = (l, t, r = !0) => H(new K(l, t).setIsSortable(r).defineAsEmail()), Il = (l, t, r = !0) => H(new K(l, t).setIsSortable(r).defineAsTel()), Ll = (l, t, r = !0) => H(new K(l, t).setIsSortable(r).defineAsCheck()), Ml = (l, t, r = !0) => H(new K(l, t).setIsSortable(r).defineAsSwitch()), Rl = (l, t, r, n = !0) => H(new K(l, t).setIsSortable(n).defineAsSelect(r)), $l = (l, t, r = !0) => H(new K(l, t).setIsSortable(r).setIsHidden(!0)), Ie = (l, t, r, n) => {
159
- if (!r) return 0;
160
- let s = l[r.key], o = t[r.key];
158
+ const Dl = (l, t, i = !0) => H(new K(l, t).setIsSortable(i)), wl = (l, t, i, n = !0) => H(new K(l, t).setIsSortable(n).defineAsLink(i)), Tl = (l, t, i, n = !0) => H(new K(l, t).setIsSortable(n).defineAsAction(i)), Bl = (l, t, i = !0) => H(new K(l, t).setIsSortable(i).defineAsText()), Il = (l, t, i = !0) => H(new K(l, t).setIsSortable(i).defineAsEmail()), El = (l, t, i = !0) => H(new K(l, t).setIsSortable(i).defineAsTel()), Ll = (l, t, i = !0) => H(new K(l, t).setIsSortable(i).defineAsCheck()), Ml = (l, t, i = !0) => H(new K(l, t).setIsSortable(i).defineAsSwitch()), Rl = (l, t, i, n = !0) => H(new K(l, t).setIsSortable(n).defineAsSelect(i)), $l = (l, t, i = !0) => H(new K(l, t).setIsSortable(i).setIsHidden(!0)), Ee = (l, t, i, n) => {
159
+ if (!i) return 0;
160
+ let r = l[i.key], o = t[i.key];
161
161
  if (n === "asc") {
162
- if (s > o) return 1;
163
- if (o > s) return -1;
162
+ if (r > o) return 1;
163
+ if (o > r) return -1;
164
164
  } else {
165
- if (s > o) return -1;
166
- if (o > s) return 1;
165
+ if (r > o) return -1;
166
+ if (o > r) return 1;
167
167
  }
168
168
  return 0;
169
- }, Y = (l, t, r, n = []) => {
169
+ }, Y = (l, t, i, n = []) => {
170
170
  if (l.extractTitleFromColumn) {
171
- let s = n.find((o) => o.key === l.extractTitleFromColumn);
172
- if (s)
173
- return Y(s, t, r, n);
171
+ let r = n.find((o) => o.key === l.extractTitleFromColumn);
172
+ if (r)
173
+ return Y(r, t, i, n);
174
174
  }
175
175
  if (l.formatter && typeof l.formatter == "function") {
176
- let s = l.formatter(t[l.key], t, l, r);
177
- return s.startsWith("__:") ? z(s.substring(3)) : s;
176
+ let r = l.formatter(t[l.key], t, l, i);
177
+ return r.startsWith("__:") ? G(r.substring(3)) : r;
178
178
  }
179
179
  return t[l.key];
180
- }, St = (l, t, r) => {
180
+ }, St = (l, t, i) => {
181
181
  if (!l.colspan) return -1;
182
182
  let n = t;
183
- return r.forEach((s) => {
184
- let o = me(l, s);
183
+ return i.forEach((r) => {
184
+ let o = me(l, r);
185
185
  o > 0 && o < n && (n = o);
186
186
  }), n;
187
- }, me = (l, t) => l.colspan === !1 ? !1 : typeof l.colspan == "function" ? l.colspan(t) : l.colspan, Vt = (l, t, r) => {
187
+ }, me = (l, t) => l.colspan === !1 ? !1 : typeof l.colspan == "function" ? l.colspan(t) : l.colspan, Vt = (l, t, i) => {
188
188
  if (typeof l != "object" || !l.key || t.indexOf(l.key) > -1) return !1;
189
- let n = me(l, r);
189
+ let n = me(l, i);
190
190
  return typeof l.colspan > "u" ? !0 : (typeof l.colspan < "u" && (typeof l.colspan == "function" ? n = parseInt(l.colspan()) : n = parseInt(l.colspan)), n > 0);
191
191
  }, Dt = (l = []) => {
192
192
  if (l.length > 0) {
@@ -196,11 +196,11 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
196
196
  return "";
197
197
  }, wt = (l, t) => {
198
198
  if (l.length > 0) {
199
- for (let r = 0; r < l.length; ++r)
200
- if (l[r].key === t) return l[r];
199
+ for (let i = 0; i < l.length; ++i)
200
+ if (l[i].key === t) return l[i];
201
201
  }
202
202
  return null;
203
- }, Me = /* @__PURE__ */ q({
203
+ }, Me = /* @__PURE__ */ z({
204
204
  __name: "LktTableCell",
205
205
  props: {
206
206
  modelValue: { default: () => ({}) },
@@ -211,31 +211,31 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
211
211
  },
212
212
  emits: ["update:modelValue"],
213
213
  setup(l, { emit: t }) {
214
- const r = t, n = l, s = C(n.modelValue), o = C(s.value[n.column.key]), h = C(null), g = C(n.column.showLoading());
214
+ const i = t, n = l, r = C(n.modelValue), o = C(r.value[n.column.key]), h = C(null), g = C(n.column.showLoading());
215
215
  A(o, (a) => {
216
- const i = JSON.parse(JSON.stringify(s.value));
217
- i[n.column.key] = a, r("update:modelValue", i);
216
+ const u = JSON.parse(JSON.stringify(r.value));
217
+ u[n.column.key] = a, i("update:modelValue", u);
218
218
  }), A(() => n.modelValue, (a) => {
219
- s.value = a, o.value = s.value[n.column.key];
219
+ r.value = a, o.value = r.value[n.column.key];
220
220
  }), A(() => n.column, () => {
221
221
  n.column.resourceLoaded && de(() => g.value = !1);
222
222
  }, { deep: !0 }), n.column.hasToLoadResource() && n.column.loadResource();
223
- const v = f(() => ({ ...n.column.slotData, item: s.value }));
224
- return (a, i) => {
225
- const _ = R("lkt-anchor"), J = R("lkt-field-text"), d = R("lkt-field-switch"), M = R("lkt-field-file"), S = R("lkt-loader"), V = R("lkt-field-select");
226
- return a.column.type === "link" ? (u(), b(_, {
223
+ const v = f(() => ({ ...n.column.slotData, item: r.value }));
224
+ return (a, u) => {
225
+ const _ = R("lkt-anchor"), q = R("lkt-field-text"), d = R("lkt-field-switch"), M = R("lkt-field-file"), S = R("lkt-loader"), V = R("lkt-field-select");
226
+ return a.column.type === "link" ? (s(), b(_, {
227
227
  key: 0,
228
- to: a.column.getHref(s.value)
228
+ to: a.column.getHref(r.value)
229
229
  }, {
230
230
  default: U(() => [
231
- le(j(L(Y)(a.column, s.value, a.i)), 1)
231
+ le(j(L(Y)(a.column, r.value, a.i)), 1)
232
232
  ]),
233
233
  _: 1
234
- }, 8, ["to"])) : a.column.type === "action" ? (u(), m("a", {
234
+ }, 8, ["to"])) : a.column.type === "action" ? (s(), m("a", {
235
235
  key: 1,
236
236
  href: "#",
237
- onClick: i[0] || (i[0] = (p) => a.column.doAction(s.value))
238
- }, j(L(Y)(a.column, s.value, a.i)), 1)) : a.column.type === "text" ? (u(), b(J, {
237
+ onClick: u[0] || (u[0] = (p) => a.column.doAction(r.value))
238
+ }, j(L(Y)(a.column, r.value, a.i)), 1)) : a.column.type === "text" ? (s(), b(q, {
239
239
  key: 2,
240
240
  "read-mode": !a.column.editable || !a.editModeEnabled,
241
241
  ref: (p) => h.value = p,
@@ -243,8 +243,8 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
243
243
  "value-slot": a.column.valueSlot,
244
244
  "slot-data": v.value,
245
245
  modelValue: o.value,
246
- "onUpdate:modelValue": i[1] || (i[1] = (p) => o.value = p)
247
- }, null, 8, ["read-mode", "edit-slot", "value-slot", "slot-data", "modelValue"])) : a.column.type === "email" ? (u(), b(J, {
246
+ "onUpdate:modelValue": u[1] || (u[1] = (p) => o.value = p)
247
+ }, null, 8, ["read-mode", "edit-slot", "value-slot", "slot-data", "modelValue"])) : a.column.type === "email" ? (s(), b(q, {
248
248
  key: 3,
249
249
  "read-mode": !a.column.editable || !a.editModeEnabled,
250
250
  ref: (p) => h.value = p,
@@ -253,8 +253,8 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
253
253
  "slot-data": v.value,
254
254
  "is-email": "",
255
255
  modelValue: o.value,
256
- "onUpdate:modelValue": i[2] || (i[2] = (p) => o.value = p)
257
- }, null, 8, ["read-mode", "edit-slot", "value-slot", "slot-data", "modelValue"])) : a.column.type === "tel" ? (u(), b(J, {
256
+ "onUpdate:modelValue": u[2] || (u[2] = (p) => o.value = p)
257
+ }, null, 8, ["read-mode", "edit-slot", "value-slot", "slot-data", "modelValue"])) : a.column.type === "tel" ? (s(), b(q, {
258
258
  key: 4,
259
259
  "read-mode": !a.column.editable || !a.editModeEnabled,
260
260
  ref: (p) => h.value = p,
@@ -263,33 +263,33 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
263
263
  "slot-data": v.value,
264
264
  "is-tel": "",
265
265
  modelValue: o.value,
266
- "onUpdate:modelValue": i[3] || (i[3] = (p) => o.value = p)
267
- }, null, 8, ["read-mode", "edit-slot", "value-slot", "slot-data", "modelValue"])) : a.column.type === "check" ? (u(), b(d, {
266
+ "onUpdate:modelValue": u[3] || (u[3] = (p) => o.value = p)
267
+ }, null, 8, ["read-mode", "edit-slot", "value-slot", "slot-data", "modelValue"])) : a.column.type === "check" ? (s(), b(d, {
268
268
  key: 5,
269
269
  "is-check": "",
270
270
  "read-mode": !a.column.editable || !a.editModeEnabled,
271
271
  ref: (p) => h.value = p,
272
272
  modelValue: o.value,
273
- "onUpdate:modelValue": i[4] || (i[4] = (p) => o.value = p)
274
- }, null, 8, ["read-mode", "modelValue"])) : a.column.type === "switch" ? (u(), b(d, {
273
+ "onUpdate:modelValue": u[4] || (u[4] = (p) => o.value = p)
274
+ }, null, 8, ["read-mode", "modelValue"])) : a.column.type === "switch" ? (s(), b(d, {
275
275
  key: 6,
276
276
  "read-mode": !a.column.editable || !a.editModeEnabled,
277
277
  ref: (p) => h.value = p,
278
278
  modelValue: o.value,
279
- "onUpdate:modelValue": i[5] || (i[5] = (p) => o.value = p)
280
- }, null, 8, ["read-mode", "modelValue"])) : a.column.type === "file" ? (u(), b(M, {
279
+ "onUpdate:modelValue": u[5] || (u[5] = (p) => o.value = p)
280
+ }, null, 8, ["read-mode", "modelValue"])) : a.column.type === "file" ? (s(), b(M, {
281
281
  key: 7,
282
282
  "read-mode": !a.column.editable || !a.editModeEnabled,
283
283
  ref: (p) => h.value = p,
284
284
  modelValue: o.value,
285
- "onUpdate:modelValue": i[6] || (i[6] = (p) => o.value = p)
286
- }, null, 8, ["read-mode", "modelValue"])) : a.column.type === "select" ? (u(), m($, { key: 8 }, [
287
- g.value ? (u(), b(S, { key: 0 })) : (u(), b(V, {
285
+ "onUpdate:modelValue": u[6] || (u[6] = (p) => o.value = p)
286
+ }, null, 8, ["read-mode", "modelValue"])) : a.column.type === "select" ? (s(), m($, { key: 8 }, [
287
+ g.value ? (s(), b(S, { key: 0 })) : (s(), b(V, {
288
288
  key: 1,
289
289
  "read-mode": !a.column.editable || !a.editModeEnabled,
290
290
  ref: (p) => h.value = p,
291
291
  modelValue: o.value,
292
- "onUpdate:modelValue": i[7] || (i[7] = (p) => o.value = p),
292
+ "onUpdate:modelValue": u[7] || (u[7] = (p) => o.value = p),
293
293
  "slot-data": v.value,
294
294
  resource: a.column.resource,
295
295
  "use-resource-slot": a.column.resourceSlot ? a.column.resourceSlot : a.column.resource,
@@ -300,16 +300,16 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
300
300
  "multiple-display": a.column.multipleDisplay,
301
301
  "multiple-display-edition": a.column.multipleDisplayEdition
302
302
  }, null, 8, ["read-mode", "modelValue", "slot-data", "resource", "use-resource-slot", "resource-data", "options", "multiple", "tags", "multiple-display", "multiple-display-edition"]))
303
- ], 64)) : (u(), m($, { key: 9 }, [
304
- le(j(L(Y)(a.column, s.value, a.i, a.columns)), 1)
303
+ ], 64)) : (s(), m($, { key: 9 }, [
304
+ le(j(L(Y)(a.column, r.value, a.i, a.columns)), 1)
305
305
  ], 64));
306
306
  };
307
307
  }
308
- }), O = {
308
+ }), F = {
309
309
  navButtonSlot: "",
310
310
  dropButtonSlot: "",
311
311
  createButtonSlot: ""
312
- }, Tt = /* @__PURE__ */ q({
312
+ }, Tt = /* @__PURE__ */ z({
313
313
  __name: "DropButton",
314
314
  props: {
315
315
  disabled: { type: Boolean, default: !1 },
@@ -321,36 +321,36 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
321
321
  },
322
322
  emits: ["click"],
323
323
  setup(l, { emit: t }) {
324
- const r = t, n = l, s = f(() => O.dropButtonSlot !== ""), o = f(() => O.dropButtonSlot), h = f(() => n.text.startsWith("__:") ? z(n.text.substring(3)) : n.text);
324
+ const i = t, n = l, r = f(() => F.dropButtonSlot !== ""), o = f(() => F.dropButtonSlot), h = f(() => n.text.startsWith("__:") ? G(n.text.substring(3)) : n.text);
325
325
  return (g, v) => {
326
326
  const a = R("lkt-button");
327
- return u(), b(a, {
327
+ return s(), b(a, {
328
328
  palette: "table-delete",
329
- icon: s.value ? "" : g.icon,
330
- text: s.value ? "" : h.value,
329
+ icon: r.value ? "" : g.icon,
330
+ text: r.value ? "" : h.value,
331
331
  resource: g.resource,
332
332
  "resource-data": g.resourceData,
333
333
  "confirm-modal": g.confirm,
334
334
  disabled: g.disabled,
335
- onClick: v[0] || (v[0] = ut((i) => r("click"), ["prevent", "stop"]))
335
+ onClick: v[0] || (v[0] = ut((u) => i("click"), ["prevent", "stop"]))
336
336
  }, {
337
337
  default: U(() => [
338
- s.value ? (u(), b(Z(o.value), { key: 0 })) : y("", !0)
338
+ r.value ? (s(), b(Z(o.value), { key: 0 })) : y("", !0)
339
339
  ]),
340
340
  _: 1
341
341
  }, 8, ["icon", "text", "resource", "resource-data", "confirm-modal", "disabled"]);
342
342
  };
343
343
  }
344
- }), Bt = ["data-i", "data-draggable"], Et = {
344
+ }), Bt = ["data-i", "data-draggable"], It = {
345
345
  key: 1,
346
346
  "data-role": "invalid-drag-indicator"
347
- }, It = {
347
+ }, Et = {
348
348
  key: 2,
349
349
  class: "lkt-table-nav-cell"
350
- }, Lt = { class: "lkt-table-nav-container" }, Mt = /* @__PURE__ */ E("i", { class: "" }, null, -1), Rt = /* @__PURE__ */ E("i", { class: "" }, null, -1), $t = ["data-column", "colspan", "title", "onClick"], At = {
350
+ }, Lt = { class: "lkt-table-nav-container" }, Mt = /* @__PURE__ */ I("i", { class: "" }, null, -1), Rt = /* @__PURE__ */ I("i", { class: "" }, null, -1), $t = ["data-column", "colspan", "title", "onClick"], At = {
351
351
  key: 4,
352
352
  class: "lkt-table-col-drop"
353
- }, Ot = /* @__PURE__ */ q({
353
+ }, Ft = /* @__PURE__ */ z({
354
354
  __name: "LktTableRow",
355
355
  props: {
356
356
  modelValue: { default: () => ({}) },
@@ -372,47 +372,47 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
372
372
  },
373
373
  emits: ["update:modelValue", "click", "show", "item-up", "item-down", "item-drop"],
374
374
  setup(l, { emit: t }) {
375
- const r = t, n = l, s = C(n.modelValue), o = (d, M, S) => {
376
- r("click", d, ce("", { item: M, column: S }));
375
+ const i = t, n = l, r = C(n.modelValue), o = (d, M, S) => {
376
+ i("click", d, ce("", { item: M, column: S }));
377
377
  }, h = (d, M) => {
378
- r("show", d, ce("", { i: M }));
378
+ i("show", d, ce("", { i: M }));
379
379
  }, g = f(() => {
380
380
  let d = [];
381
381
  return n.sortable && n.isDraggable && d.push("handle"), d.join(" ");
382
- }), v = f(() => O.navButtonSlot !== ""), a = f(() => O.navButtonSlot);
383
- f(() => O.dropButtonSlot !== ""), f(() => O.dropButtonSlot);
384
- const i = () => {
385
- r("item-up", n.i);
382
+ }), v = f(() => F.navButtonSlot !== ""), a = f(() => F.navButtonSlot);
383
+ f(() => F.dropButtonSlot !== ""), f(() => F.dropButtonSlot);
384
+ const u = () => {
385
+ i("item-up", n.i);
386
386
  }, _ = () => {
387
- r("item-down", n.i);
388
- }, J = () => {
389
- r("item-drop", n.i);
387
+ i("item-down", n.i);
388
+ }, q = () => {
389
+ i("item-drop", n.i);
390
390
  };
391
- return A(() => n.modelValue, (d) => s.value = d), A(s, (d) => {
392
- r("update:modelValue", d, n.i);
391
+ return A(() => n.modelValue, (d) => r.value = d), A(r, (d) => {
392
+ i("update:modelValue", d, n.i);
393
393
  }, { deep: !0 }), (d, M) => {
394
394
  const S = R("lkt-button");
395
- return u(), m("tr", {
395
+ return s(), m("tr", {
396
396
  "data-i": d.i,
397
397
  "data-draggable": d.isDraggable
398
398
  }, [
399
- d.sortable && d.isDraggable && d.editModeEnabled ? (u(), m("td", {
399
+ d.sortable && d.isDraggable && d.editModeEnabled ? (s(), m("td", {
400
400
  key: 0,
401
401
  "data-role": "drag-indicator",
402
402
  class: te(g.value)
403
- }, null, 2)) : d.sortable && d.editModeEnabled ? (u(), m("td", Et)) : y("", !0),
404
- d.addNavigation && d.editModeEnabled ? (u(), m("td", It, [
405
- E("div", Lt, [
403
+ }, null, 2)) : d.sortable && d.editModeEnabled ? (s(), m("td", It)) : y("", !0),
404
+ d.addNavigation && d.editModeEnabled ? (s(), m("td", Et, [
405
+ I("div", Lt, [
406
406
  X(S, {
407
407
  palette: "table-nav",
408
408
  disabled: d.i === 0,
409
- onClick: i
409
+ onClick: u
410
410
  }, {
411
411
  default: U(() => [
412
- v.value ? (u(), b(Z(a.value), {
412
+ v.value ? (s(), b(Z(a.value), {
413
413
  key: 0,
414
414
  direction: "up"
415
- })) : (u(), m($, { key: 1 }, [
415
+ })) : (s(), m($, { key: 1 }, [
416
416
  Mt,
417
417
  le(" UP ")
418
418
  ], 64))
@@ -425,10 +425,10 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
425
425
  onClick: _
426
426
  }, {
427
427
  default: U(() => [
428
- v.value ? (u(), b(Z(a.value), {
428
+ v.value ? (s(), b(Z(a.value), {
429
429
  key: 0,
430
430
  direction: "down"
431
- })) : (u(), m($, { key: 1 }, [
431
+ })) : (s(), m($, { key: 1 }, [
432
432
  Rt,
433
433
  le(" DOWN ")
434
434
  ], 64))
@@ -437,30 +437,30 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
437
437
  }, 8, ["disabled"])
438
438
  ])
439
439
  ])) : y("", !0),
440
- d.displayHiddenColumnsIndicator ? (u(), m("td", {
440
+ d.displayHiddenColumnsIndicator ? (s(), m("td", {
441
441
  key: 3,
442
442
  onClick: M[0] || (M[0] = (V) => h(V, d.i)),
443
443
  "data-role": "show-more",
444
444
  class: te(d.hiddenIsVisible ? "state-open" : "")
445
445
  }, null, 2)) : y("", !0),
446
- (u(!0), m($, null, W(d.visibleColumns, (V) => (u(), m($, null, [
447
- L(Vt)(V, d.emptyColumns, s.value) ? (u(), m("td", {
446
+ (s(!0), m($, null, W(d.visibleColumns, (V) => (s(), m($, null, [
447
+ L(Vt)(V, d.emptyColumns, r.value) ? (s(), m("td", {
448
448
  key: 0,
449
449
  "data-column": V.key,
450
- colspan: L(me)(V, s.value),
451
- title: L(Y)(V, s.value, d.i, d.visibleColumns),
452
- onClick: (p) => o(p, s.value, V)
450
+ colspan: L(me)(V, r.value),
451
+ title: L(Y)(V, r.value, d.i, d.visibleColumns),
452
+ onClick: (p) => o(p, r.value, V)
453
453
  }, [
454
454
  d.$slots[V.key] ? N(d.$slots, V.key, {
455
455
  key: 0,
456
- value: s.value[V.key],
457
- item: s.value,
456
+ value: r.value[V.key],
457
+ item: r.value,
458
458
  column: V,
459
459
  i: d.i
460
- }) : s.value ? (u(), b(Me, {
460
+ }) : r.value ? (s(), b(Me, {
461
461
  key: 1,
462
- modelValue: s.value,
463
- "onUpdate:modelValue": M[1] || (M[1] = (p) => s.value = p),
462
+ modelValue: r.value,
463
+ "onUpdate:modelValue": M[1] || (M[1] = (p) => r.value = p),
464
464
  column: V,
465
465
  columns: d.visibleColumns,
466
466
  "edit-mode-enabled": d.editModeEnabled,
@@ -468,20 +468,20 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
468
468
  }, null, 8, ["modelValue", "column", "columns", "edit-mode-enabled", "i"])) : y("", !0)
469
469
  ], 8, $t)) : y("", !0)
470
470
  ], 64))), 256)),
471
- d.canDrop && d.editModeEnabled ? (u(), m("td", At, [
471
+ d.canDrop && d.editModeEnabled ? (s(), m("td", At, [
472
472
  X(Tt, {
473
473
  resource: d.dropResource,
474
- "resource-data": s.value,
474
+ "resource-data": r.value,
475
475
  confirm: d.dropConfirm,
476
476
  text: d.dropText,
477
477
  icon: d.dropIcon,
478
- onClick: J
478
+ onClick: q
479
479
  }, null, 8, ["resource", "resource-data", "confirm", "text", "icon"])
480
480
  ])) : y("", !0)
481
481
  ], 8, Bt);
482
482
  };
483
483
  }
484
- }), Ft = { "data-role": "hidden-row" }, Nt = ["colspan"], Ut = ["data-column"], Ht = ["data-i"], Kt = ["data-column", "title", "onClick"], Pt = /* @__PURE__ */ q({
484
+ }), Ot = { "data-role": "hidden-row" }, Nt = ["colspan"], Ut = ["data-column"], Ht = ["data-i"], Kt = ["data-column", "title", "onClick"], Pt = /* @__PURE__ */ z({
485
485
  __name: "LktHiddenRow",
486
486
  props: {
487
487
  modelValue: { default: () => ({}) },
@@ -496,37 +496,37 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
496
496
  },
497
497
  emits: ["update:modelValue", "click"],
498
498
  setup(l, { emit: t }) {
499
- const r = t, n = l, s = C(n.modelValue), o = (h, g, v) => {
500
- r("click", h, ce("", { item: g, column: v }));
499
+ const i = t, n = l, r = C(n.modelValue), o = (h, g, v) => {
500
+ i("click", h, ce("", { item: g, column: v }));
501
501
  };
502
- return A(() => n.modelValue, (h) => s.value = h), A(s, () => r("update:modelValue", s.value)), (h, g) => x((u(), m("tr", Ft, [
503
- E("td", { colspan: h.hiddenColumnsColSpan }, [
504
- E("table", null, [
505
- E("tr", null, [
506
- (u(!0), m($, null, W(h.hiddenColumns, (v) => (u(), m("th", {
502
+ return A(() => n.modelValue, (h) => r.value = h), A(r, () => i("update:modelValue", r.value)), (h, g) => x((s(), m("tr", Ot, [
503
+ I("td", { colspan: h.hiddenColumnsColSpan }, [
504
+ I("table", null, [
505
+ I("tr", null, [
506
+ (s(!0), m($, null, W(h.hiddenColumns, (v) => (s(), m("th", {
507
507
  "data-column": v.key
508
508
  }, [
509
- E("div", null, j(v.label), 1)
509
+ I("div", null, j(v.label), 1)
510
510
  ], 8, Ut))), 256))
511
511
  ]),
512
- E("tr", { "data-i": h.i }, [
513
- (u(!0), m($, null, W(h.hiddenColumns, (v, a) => (u(), m("td", {
512
+ I("tr", { "data-i": h.i }, [
513
+ (s(!0), m($, null, W(h.hiddenColumns, (v, a) => (s(), m("td", {
514
514
  "data-column": v.key,
515
- title: L(Y)(v, s.value, a, h.hiddenColumns),
516
- onClick: (i) => o(i, s.value, v)
515
+ title: L(Y)(v, r.value, a, h.hiddenColumns),
516
+ onClick: (u) => o(u, r.value, v)
517
517
  }, [
518
518
  h.$slots[v.key] ? N(h.$slots, v.key, {
519
519
  key: 0,
520
- value: s.value[v.key],
521
- item: s.value,
520
+ value: r.value[v.key],
521
+ item: r.value,
522
522
  column: v,
523
523
  i: a
524
- }) : (u(), b(Me, {
524
+ }) : (s(), b(Me, {
525
525
  key: 1,
526
526
  column: v,
527
527
  columns: h.hiddenColumns,
528
- modelValue: s.value,
529
- "onUpdate:modelValue": g[0] || (g[0] = (i) => s.value = i),
528
+ modelValue: r.value,
529
+ "onUpdate:modelValue": g[0] || (g[0] = (u) => r.value = u),
530
530
  i: a
531
531
  }, null, 8, ["column", "columns", "modelValue", "i"]))
532
532
  ], 8, Kt))), 256))
@@ -537,7 +537,7 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
537
537
  [ee, h.hiddenIsVisible]
538
538
  ]);
539
539
  }
540
- }), Le = /* @__PURE__ */ q({
540
+ }), Le = /* @__PURE__ */ z({
541
541
  __name: "CreateButton",
542
542
  props: {
543
543
  disabled: { type: Boolean, default: !1 },
@@ -547,25 +547,25 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
547
547
  },
548
548
  emits: ["click"],
549
549
  setup(l, { emit: t }) {
550
- const r = t, n = l, s = f(() => O.createButtonSlot !== ""), o = f(() => O.createButtonSlot), h = f(() => n.text.startsWith("__:") ? z(n.text.substring(3)) : n.text);
550
+ const i = t, n = l, r = f(() => F.createButtonSlot !== ""), o = f(() => F.createButtonSlot), h = f(() => n.text.startsWith("__:") ? G(n.text.substring(3)) : n.text);
551
551
  return (g, v) => {
552
552
  const a = R("lkt-button");
553
- return u(), b(a, {
553
+ return s(), b(a, {
554
554
  palette: "table-create",
555
555
  disabled: g.disabled,
556
- icon: s.value ? "" : g.icon,
557
- text: s.value ? "" : h.value,
556
+ icon: r.value ? "" : g.icon,
557
+ text: r.value ? "" : h.value,
558
558
  "on-click-to": g.to,
559
- onClick: v[0] || (v[0] = (i) => r("click"))
559
+ onClick: v[0] || (v[0] = (u) => i("click"))
560
560
  }, {
561
561
  default: U(() => [
562
- s.value ? (u(), b(Z(o.value), { key: 0 })) : y("", !0)
562
+ r.value ? (s(), b(Z(o.value), { key: 0 })) : y("", !0)
563
563
  ]),
564
564
  _: 1
565
565
  }, 8, ["disabled", "icon", "text", "on-click-to"]);
566
566
  };
567
567
  }
568
- }), Wt = ["data-column", "data-sortable", "data-sort", "colspan", "title"], _t = /* @__PURE__ */ q({
568
+ }), Wt = ["data-column", "data-sortable", "data-sort", "colspan", "title"], _t = /* @__PURE__ */ z({
569
569
  __name: "TableHeader",
570
570
  props: {
571
571
  column: { default: () => ({}) },
@@ -576,21 +576,21 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
576
576
  },
577
577
  emits: ["click"],
578
578
  setup(l, { emit: t }) {
579
- const r = t, n = l, s = f(() => St(n.column, n.amountOfColumns, n.items)), o = f(() => n.column.sortable === !0), h = f(() => o.value && n.sortBy === n.column.key ? n.sortDirection : ""), g = f(() => n.column.label.startsWith("__:") ? z(n.column.label.substring(3)) : n.column.label), v = () => {
580
- r("click", n.column);
579
+ const i = t, n = l, r = f(() => St(n.column, n.amountOfColumns, n.items)), o = f(() => n.column.sortable === !0), h = f(() => o.value && n.sortBy === n.column.key ? n.sortDirection : ""), g = f(() => n.column.label.startsWith("__:") ? G(n.column.label.substring(3)) : n.column.label), v = () => {
580
+ i("click", n.column);
581
581
  };
582
- return (a, i) => (u(), m("th", {
582
+ return (a, u) => (s(), m("th", {
583
583
  "data-column": a.column.key,
584
584
  "data-sortable": o.value,
585
585
  "data-sort": h.value,
586
- colspan: s.value,
586
+ colspan: r.value,
587
587
  title: g.value,
588
588
  onClick: v
589
589
  }, [
590
- E("div", null, j(g.value), 1)
590
+ I("div", null, j(g.value), 1)
591
591
  ], 8, Wt));
592
592
  }
593
- }), jt = ["id"], Jt = { key: 0 }, Gt = { class: "lkt-table-page-buttons" }, zt = { key: 1 }, qt = { class: "switch-edition-mode" }, Qt = {
593
+ }), jt = ["id"], qt = { key: 0 }, Jt = { class: "lkt-table-page-buttons" }, Gt = { key: 1 }, zt = { class: "switch-edition-mode" }, Qt = {
594
594
  key: 0,
595
595
  class: "lkt-table-page-buttons"
596
596
  }, Xt = {
@@ -611,12 +611,12 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
611
611
  }, sl = {
612
612
  key: 5,
613
613
  class: "lkt-table-page-buttons lkt-table-page-buttons-bottom"
614
- }, il = /* @__PURE__ */ q({
614
+ }, rl = /* @__PURE__ */ z({
615
615
  __name: "LktTable",
616
616
  props: {
617
617
  modelValue: { default: () => [] },
618
618
  columns: { default: () => [] },
619
- sorter: { type: Function, default: Ie },
619
+ sorter: { type: Function, default: Ee },
620
620
  draggableChecker: { type: Function, default: (l) => !0 },
621
621
  checkValidDrag: { type: Function, default: void 0 },
622
622
  sortable: { type: Boolean, default: !1 },
@@ -657,16 +657,18 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
657
657
  addNavigation: { type: Boolean, default: !1 },
658
658
  itemMode: { type: Boolean, default: !1 },
659
659
  createEnabledValidator: { type: Function, default: void 0 },
660
- newValueGenerator: { type: Function, default: void 0 }
660
+ newValueGenerator: { type: Function, default: void 0 },
661
+ requiredItemsForTopCreate: { default: 0 },
662
+ requiredItemsForBottomCreate: { default: 0 }
661
663
  },
662
664
  emits: ["update:modelValue", "sort", "click", "save", "error", "before-save", "read-response"],
663
- setup(l, { expose: t, emit: r }) {
664
- const n = r, s = st(), o = l, h = {}, g = C(typeof o.sorter == "function" ? o.sorter : Ie), v = C(Dt(o.columns)), a = C("asc"), i = C(o.modelValue), _ = C(h), J = C(null), d = C(o.columns), M = C(o.page), S = C(!1), V = C(!1), p = C(o.perms), fe = C(null), Re = C({}), Q = C(new mt({ items: i.value }, o.dataStateConfig)), I = C(o.editMode), $e = (e) => {
665
- Array.isArray(e) && (i.value = e), S.value = !1, V.value = !0, Q.value.store({ items: i.value }).turnStoredIntoOriginal();
665
+ setup(l, { expose: t, emit: i }) {
666
+ const n = i, r = st(), o = l, h = {}, g = C(typeof o.sorter == "function" ? o.sorter : Ee), v = C(Dt(o.columns)), a = C("asc"), u = C(o.modelValue), _ = C(h), q = C(null), d = C(o.columns), M = C(o.page), S = C(!1), V = C(!1), p = C(o.perms), fe = C(null), Re = C({}), Q = C(new mt({ items: u.value }, o.dataStateConfig)), E = C(o.editMode), $e = (e) => {
667
+ Array.isArray(e) && (u.value = e), S.value = !1, V.value = !0, Q.value.store({ items: u.value }).turnStoredIntoOriginal();
666
668
  }, Ae = (e) => {
667
669
  p.value = e;
668
- }, Oe = (e) => {
669
670
  }, Fe = (e) => {
671
+ }, Oe = (e) => {
670
672
  n("read-response", e);
671
673
  }, Ne = () => de(() => S.value = !0), Ue = () => {
672
674
  fe.value.doRefresh();
@@ -675,7 +677,7 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
675
677
  let e = [];
676
678
  return d.value.forEach((c) => {
677
679
  let k = c.key, T = !1;
678
- i.value.forEach((D) => {
680
+ u.value.forEach((D) => {
679
681
  if (typeof D.checkEmpty == "function")
680
682
  return D.checkEmpty(D);
681
683
  D[k] && (T = !0);
@@ -686,21 +688,21 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
686
688
  return o.sortable && ++e, e;
687
689
  }), Ke = f(() => d.value.filter((e) => e.isForRowKey)), pe = f(() => se.value.length > 0 && !o.sortable), Pe = f(() => d.value.map((e) => e.key)), ve = f(() => {
688
690
  let e = [];
689
- for (let c in s) Pe.value.indexOf(c) !== -1 && e.push(c);
691
+ for (let c in r) Pe.value.indexOf(c) !== -1 && e.push(c);
690
692
  return e;
691
- }), he = f(() => o.hiddenSave || S.value || !o.saveResource ? !1 : I.value && Q.value.changed() ? !0 : I.value), We = f(() => o.switchEditionEnabled ? !0 : he.value || I.value && o.canCreate), _e = f(() => o.saveDisabled || typeof o.saveValidator == "function" && !o.saveValidator(i.value) ? !1 : Q.value.changed()), je = f(() => i.value.length), Je = f(() => ({
692
- items: i.value,
693
+ }), he = f(() => o.hiddenSave || S.value || !o.saveResource ? !1 : E.value && Q.value.changed() ? !0 : E.value), We = f(() => o.switchEditionEnabled ? !0 : he.value || E.value && o.canCreate), _e = f(() => o.saveDisabled || typeof o.saveValidator == "function" && !o.saveValidator(u.value) ? !1 : Q.value.changed()), je = f(() => u.value.length), qe = f(() => ({
694
+ items: u.value,
693
695
  ...o.saveResourceData
694
- })), Ge = f(() => o.titleTag === "" ? "h2" : o.titleTag), ze = f(() => o.wrapContentTag === "" ? "div" : o.wrapContentTag), ie = f(() => o.title.startsWith("__:") ? z(o.title.substring(3)) : o.title), qe = f(() => o.saveText.startsWith("__:") ? z(o.saveText.substring(3)) : o.saveText), Qe = f(() => o.editModeText.startsWith("__:") ? z(o.editModeText.substring(3)) : o.editModeText), ne = f(() => p.value.includes("create")), Xe = f(() => p.value.includes("read")), Ye = f(() => p.value.includes("update")), re = f(() => p.value.includes("drop")), Ze = (e) => {
696
+ })), Je = f(() => o.titleTag === "" ? "h2" : o.titleTag), Ge = f(() => o.wrapContentTag === "" ? "div" : o.wrapContentTag), re = f(() => o.title.startsWith("__:") ? G(o.title.substring(3)) : o.title), ze = f(() => o.saveText.startsWith("__:") ? G(o.saveText.substring(3)) : o.saveText), Qe = f(() => o.editModeText.startsWith("__:") ? G(o.editModeText.substring(3)) : o.editModeText), ne = f(() => p.value.includes("create")), Xe = f(() => p.value.includes("read")), Ye = f(() => p.value.includes("update")), ie = f(() => p.value.includes("drop")), Ze = (e) => {
695
697
  let c = e.target;
696
698
  if (typeof c.dataset.column > "u")
697
699
  do
698
700
  c = c.parentNode;
699
701
  while (typeof c.dataset.column > "u" && c.tagName !== "TABLE" && c.tagName !== "body");
700
702
  if (c.tagName === "TD" && (c = c.parentNode, c = c.dataset.i, typeof c < "u"))
701
- return i.value[c];
703
+ return u.value[c];
702
704
  }, ye = (e) => _.value["tr_" + e] === !0, ke = (e) => {
703
- e && e.sortable && (i.value = i.value.sort((c, k) => g.value(c, k, e, a.value)), a.value = a.value === "asc" ? "desc" : "asc", v.value = e.key, n("sort", [v.value, a.value]));
705
+ e && e.sortable && (u.value = u.value.sort((c, k) => g.value(c, k, e, a.value)), a.value = a.value === "asc" ? "desc" : "asc", v.value = e.key, n("sort", [v.value, a.value]));
704
706
  }, be = (e, c) => {
705
707
  n("click", e, c);
706
708
  }, ge = (e, c) => {
@@ -710,8 +712,8 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
710
712
  d.value.forEach((e) => {
711
713
  if (e.type === "select" && e.autoLoadSelectOptions) {
712
714
  let c = e.autoLoadSelectOptionsKey !== "" ? e.autoLoadSelectOptionsKey : e.key, k = [];
713
- i.value.forEach((D) => {
714
- Array.isArray(D[c]) && D[c].forEach((F) => k.push(F));
715
+ u.value.forEach((D) => {
716
+ Array.isArray(D[c]) && D[c].forEach((O) => k.push(O));
715
717
  });
716
718
  let T = {};
717
719
  k = k.filter(function(D) {
@@ -723,11 +725,11 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
723
725
  if (typeof o.newValueGenerator == "function") {
724
726
  let e = o.newValueGenerator();
725
727
  if (typeof e == "object") {
726
- i.value.push(e);
728
+ u.value.push(e);
727
729
  return;
728
730
  }
729
731
  }
730
- i.value.push({});
732
+ u.value.push({});
731
733
  }, et = () => {
732
734
  S.value = !0;
733
735
  }, tt = () => {
@@ -745,11 +747,11 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
745
747
  }
746
748
  return e.splice(k, 0, e.splice(c, 1)[0]), e;
747
749
  }, ot = (e) => {
748
- De(i.value, e, e - 1);
750
+ De(u.value, e, e - 1);
749
751
  }, at = (e) => {
750
- De(i.value, e, e + 1);
752
+ De(u.value, e, e + 1);
751
753
  }, we = (e) => {
752
- i.value.splice(e, 1);
754
+ u.value.splice(e, 1);
753
755
  }, nt = () => {
754
756
  let e = document.getElementById("lkt-table-body-" + oe);
755
757
  Re.value = new ft(e, {
@@ -757,8 +759,8 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
757
759
  handle: ".handle",
758
760
  animation: 150,
759
761
  onEnd: function(c) {
760
- let k = c.oldIndex, T = c.newIndex, D = JSON.parse(JSON.stringify(i.value));
761
- i.value.splice(k, 1, D[T]), i.value.splice(T, 1, D[k]);
762
+ let k = c.oldIndex, T = c.newIndex, D = JSON.parse(JSON.stringify(u.value));
763
+ u.value.splice(k, 1, D[T]), u.value.splice(T, 1, D[k]);
762
764
  },
763
765
  onMove: function(c, k) {
764
766
  return xe(c);
@@ -767,43 +769,43 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
767
769
  }, Te = (e, c, k = !1) => {
768
770
  let T = [oe, "row", c];
769
771
  return k && T.push("hidden"), Ke.value.forEach((D) => {
770
- let F = String(e[D.key]).toLowerCase();
771
- F.length > 50 && (F = F.substring(0, 50)), F = ct(F, " ", "-"), T.push(F);
772
+ let O = String(e[D.key]).toLowerCase();
773
+ O.length > 50 && (O = O.substring(0, 50)), O = ct(O, " ", "-"), T.push(O);
772
774
  }), T.join("-");
773
- }, Be = f(() => typeof o.createEnabledValidator == "function" ? o.createEnabledValidator({ items: i.value }) : !0);
774
- return it(() => {
775
- Ce(), ke(wt(o.columns, v.value)), Q.value.store({ items: i.value }).turnStoredIntoOriginal(), o.sortable && de(() => {
775
+ }, Be = f(() => typeof o.createEnabledValidator == "function" ? o.createEnabledValidator({ items: u.value }) : !0);
776
+ return rt(() => {
777
+ Ce(), ke(wt(o.columns, v.value)), Q.value.store({ items: u.value }).turnStoredIntoOriginal(), o.sortable && de(() => {
776
778
  nt();
777
779
  });
778
- }), A(() => o.editMode, (e) => I.value = e), A(() => o.columns, (e) => d.value = e), A(() => o.modelValue, (e) => i.value = e), A(i, (e) => {
780
+ }), A(() => o.editMode, (e) => E.value = e), A(() => o.columns, (e) => d.value = e), A(() => o.modelValue, (e) => u.value = e), A(u, (e) => {
779
781
  Ce(), Q.value.increment({ items: e }), n("update:modelValue", e);
780
782
  }, { deep: !0 }), t({
781
783
  getItemByEvent: Ze,
782
784
  doRefresh: Ue
783
785
  }), (e, c) => {
784
- const k = R("lkt-button"), T = R("lkt-field-switch"), D = R("lkt-loader"), F = R("lkt-paginator");
785
- return u(), m("section", {
786
+ const k = R("lkt-button"), T = R("lkt-field-switch"), D = R("lkt-loader"), O = R("lkt-paginator");
787
+ return s(), m("section", {
786
788
  class: "lkt-table-page",
787
789
  id: "lkt-table-page-" + L(oe)
788
790
  }, [
789
- ie.value || L(s).title ? (u(), m("header", Jt, [
790
- ie.value ? (u(), b(Z(Ge.value), { key: 0 }, {
791
+ re.value || L(r).title ? (s(), m("header", qt, [
792
+ re.value ? (s(), b(Z(Je.value), { key: 0 }, {
791
793
  default: U(() => [
792
- e.titleIcon ? (u(), m("i", {
794
+ e.titleIcon ? (s(), m("i", {
793
795
  key: 0,
794
796
  class: te(e.titleIcon)
795
797
  }, null, 2)) : y("", !0),
796
- le(" " + j(ie.value), 1)
798
+ le(" " + j(re.value), 1)
797
799
  ]),
798
800
  _: 1
799
801
  })) : y("", !0),
800
- L(s).title ? N(e.$slots, "title", { key: 1 }) : y("", !0)
802
+ L(r).title ? N(e.$slots, "title", { key: 1 }) : y("", !0)
801
803
  ])) : y("", !0),
802
- (u(), b(Z(ze.value), {
804
+ (s(), b(Z(Ge.value), {
803
805
  class: te(["lkt-table-page-content-wrapper", e.wrapContentClass])
804
806
  }, {
805
807
  default: U(() => [
806
- x(E("div", Gt, [
808
+ x(I("div", Jt, [
807
809
  x(X(k, {
808
810
  ref: "saveButton",
809
811
  palette: "success",
@@ -811,24 +813,24 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
811
813
  "confirm-modal": e.saveConfirm,
812
814
  "confirm-data": e.confirmData,
813
815
  resource: e.saveResource,
814
- "resource-data": Je.value,
816
+ "resource-data": qe.value,
815
817
  onLoading: et,
816
818
  onLoaded: tt,
817
819
  onClick: lt
818
820
  }, {
819
821
  default: U(() => [
820
- L(s)["button-save"] ? N(e.$slots, "button-save", {
822
+ L(r)["button-save"] ? N(e.$slots, "button-save", {
821
823
  key: 0,
822
- items: i.value,
824
+ items: u.value,
823
825
  editMode: e.editMode,
824
826
  canUpdate: !e.saveDisabled
825
- }) : (u(), m("span", zt, j(qe.value), 1))
827
+ }) : (s(), m("span", Gt, j(ze.value), 1))
826
828
  ]),
827
829
  _: 3
828
830
  }, 8, ["disabled", "confirm-modal", "confirm-data", "resource", "resource-data"]), [
829
831
  [ee, he.value]
830
832
  ]),
831
- e.canCreate && ne.value && I.value ? (u(), b(Le, {
833
+ e.canCreate && ne.value && E.value && u.value.length >= e.requiredItemsForTopCreate ? (s(), b(Le, {
832
834
  key: 0,
833
835
  disabled: !Be.value,
834
836
  text: e.createText,
@@ -836,10 +838,10 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
836
838
  to: e.createRoute,
837
839
  onClick: Ve
838
840
  }, null, 8, ["disabled", "text", "icon", "to"])) : y("", !0),
839
- E("div", qt, [
841
+ I("div", zt, [
840
842
  x(X(T, {
841
- modelValue: I.value,
842
- "onUpdate:modelValue": c[0] || (c[0] = (w) => I.value = w),
843
+ modelValue: E.value,
844
+ "onUpdate:modelValue": c[0] || (c[0] = (w) => E.value = w),
843
845
  label: Qe.value
844
846
  }, null, 8, ["modelValue", "label"]), [
845
847
  [ee, e.switchEditionEnabled]
@@ -848,63 +850,63 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
848
850
  ], 512), [
849
851
  [ee, We.value]
850
852
  ]),
851
- L(s).buttons ? (u(), m("div", Qt, [
853
+ L(r).buttons ? (s(), m("div", Qt, [
852
854
  N(e.$slots, "buttons")
853
855
  ])) : y("", !0),
854
- V.value && L(s).filters ? (u(), m("div", Xt, [
856
+ V.value && L(r).filters ? (s(), m("div", Xt, [
855
857
  N(e.$slots, "filters", {
856
- items: i.value,
858
+ items: u.value,
857
859
  isLoading: S.value
858
860
  })
859
861
  ])) : y("", !0),
860
- S.value ? (u(), b(D, { key: 2 })) : y("", !0),
861
- x(E("div", {
862
+ S.value ? (s(), b(D, { key: 2 })) : y("", !0),
863
+ x(I("div", {
862
864
  class: "lkt-table",
863
865
  "data-sortable": e.sortable
864
866
  }, [
865
- e.itemMode ? (u(), m("div", {
867
+ e.itemMode ? (s(), m("div", {
866
868
  key: 1,
867
869
  class: te(["lkt-table-items-container", e.itemsContainerClass])
868
870
  }, [
869
- (u(!0), m($, null, W(i.value, (w, B) => (u(), m("div", al, [
871
+ (s(!0), m($, null, W(u.value, (w, B) => (s(), m("div", al, [
870
872
  N(e.$slots, "item", {
871
873
  item: w,
872
874
  index: B,
873
875
  canCreate: ne.value,
874
876
  canRead: Xe.value,
875
877
  canUpdate: Ye.value,
876
- canDrop: re.value,
878
+ canDrop: ie.value,
877
879
  isLoading: S.value,
878
880
  doDrop: () => we(B)
879
881
  })
880
882
  ]))), 256))
881
- ], 2)) : (u(), m("table", Zt, [
882
- E("thead", null, [
883
- E("tr", null, [
884
- e.sortable && I.value ? (u(), m("th", xt)) : y("", !0),
885
- e.addNavigation && I.value ? (u(), m("th", el)) : y("", !0),
886
- pe.value ? (u(), m("th", tl)) : y("", !0),
887
- (u(!0), m($, null, W(ae.value, (w) => (u(), m($, null, [
888
- ue.value.indexOf(w.key) === -1 ? (u(), b(_t, {
883
+ ], 2)) : (s(), m("table", Zt, [
884
+ I("thead", null, [
885
+ I("tr", null, [
886
+ e.sortable && E.value ? (s(), m("th", xt)) : y("", !0),
887
+ e.addNavigation && E.value ? (s(), m("th", el)) : y("", !0),
888
+ pe.value ? (s(), m("th", tl)) : y("", !0),
889
+ (s(!0), m($, null, W(ae.value, (w) => (s(), m($, null, [
890
+ ue.value.indexOf(w.key) === -1 ? (s(), b(_t, {
889
891
  key: 0,
890
892
  column: w,
891
893
  "sort-by": v.value,
892
894
  "sort-direction": a.value,
893
895
  "amount-of-columns": e.columns.length,
894
- items: i.value,
896
+ items: u.value,
895
897
  onClick: (B) => ke(w)
896
898
  }, null, 8, ["column", "sort-by", "sort-direction", "amount-of-columns", "items", "onClick"])) : y("", !0)
897
899
  ], 64))), 256)),
898
- e.canDrop && re.value && I.value ? (u(), m("th", ll)) : y("", !0)
900
+ e.canDrop && ie.value && E.value ? (s(), m("th", ll)) : y("", !0)
899
901
  ])
900
902
  ]),
901
- E("tbody", {
902
- ref: (w) => J.value = w,
903
+ I("tbody", {
904
+ ref: (w) => q.value = w,
903
905
  id: "lkt-table-body-" + L(oe)
904
906
  }, [
905
- (u(!0), m($, null, W(i.value, (w, B) => (u(), b(Ot, {
906
- modelValue: i.value[B],
907
- "onUpdate:modelValue": (P) => i.value[B] = P,
907
+ (s(!0), m($, null, W(u.value, (w, B) => (s(), b(Ft, {
908
+ modelValue: u.value[B],
909
+ "onUpdate:modelValue": (P) => u.value[B] = P,
908
910
  key: Te(w, B),
909
911
  i: B,
910
912
  "display-hidden-columns-indicator": pe.value,
@@ -915,32 +917,32 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
915
917
  "add-navigation": e.addNavigation,
916
918
  "hidden-is-visible": ye(B),
917
919
  "latest-row": B + 1 === je.value,
918
- "can-drop": e.canDrop && re.value && I.value,
920
+ "can-drop": e.canDrop && ie.value && E.value,
919
921
  "drop-confirm": e.dropConfirm,
920
922
  "drop-resource": e.dropResource,
921
923
  "drop-text": e.dropText,
922
924
  "drop-icon": e.dropIcon,
923
- "edit-mode-enabled": I.value,
925
+ "edit-mode-enabled": E.value,
924
926
  onClick: be,
925
927
  onShow: ge,
926
928
  onItemUp: ot,
927
929
  onItemDown: at,
928
930
  onItemDrop: we
929
- }, Ee({ _: 2 }, [
931
+ }, Ie({ _: 2 }, [
930
932
  W(ve.value, (P) => ({
931
933
  name: P,
932
- fn: U((G) => [
934
+ fn: U((J) => [
933
935
  N(e.$slots, P, {
934
- item: G.item,
935
- value: G.value,
936
- column: G.column
936
+ item: J.item,
937
+ value: J.value,
938
+ column: J.column
937
939
  })
938
940
  ])
939
941
  }))
940
942
  ]), 1032, ["modelValue", "onUpdate:modelValue", "i", "display-hidden-columns-indicator", "is-draggable", "sortable", "visible-columns", "empty-columns", "add-navigation", "hidden-is-visible", "latest-row", "can-drop", "drop-confirm", "drop-resource", "drop-text", "drop-icon", "edit-mode-enabled"]))), 128)),
941
- se.value.length > 0 ? (u(!0), m($, { key: 0 }, W(i.value, (w, B) => (u(), b(Pt, {
942
- modelValue: i.value[B],
943
- "onUpdate:modelValue": (P) => i.value[B] = P,
943
+ se.value.length > 0 ? (s(!0), m($, { key: 0 }, W(u.value, (w, B) => (s(), b(Pt, {
944
+ modelValue: u.value[B],
945
+ "onUpdate:modelValue": (P) => u.value[B] = P,
944
946
  key: Te(w, B, !0),
945
947
  i: B,
946
948
  "hidden-columns": se.value,
@@ -952,14 +954,14 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
952
954
  "hidden-is-visible": ye(B),
953
955
  onClick: be,
954
956
  onShow: ge
955
- }, Ee({ _: 2 }, [
957
+ }, Ie({ _: 2 }, [
956
958
  W(ve.value, (P) => ({
957
959
  name: P,
958
- fn: U((G) => [
960
+ fn: U((J) => [
959
961
  N(e.$slots, P, {
960
- item: G.item,
961
- value: G.value,
962
- column: G.column
962
+ item: J.item,
963
+ value: J.value,
964
+ column: J.column
963
965
  })
964
966
  ])
965
967
  }))
@@ -967,14 +969,14 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
967
969
  ], 8, ol)
968
970
  ]))
969
971
  ], 8, Yt), [
970
- [ee, !S.value && i.value.length > 0]
972
+ [ee, !S.value && u.value.length > 0]
971
973
  ]),
972
- e.$slots["no-items"] ? (u(), m("div", nl, [
974
+ e.$slots["no-items"] ? (s(), m("div", nl, [
973
975
  N(e.$slots, "no-items")
974
976
  ])) : y("", !0),
975
- !S.value && i.value.length === 0 ? (u(), m("div", ul, j(e.noResultsText), 1)) : y("", !0),
976
- e.canCreate && ne.value && I.value ? (u(), m("div", sl, [
977
- e.canCreate && ne.value && I.value ? (u(), b(Le, {
977
+ !S.value && u.value.length === 0 ? (s(), m("div", ul, j(e.noResultsText), 1)) : y("", !0),
978
+ e.canCreate && ne.value && E.value ? (s(), m("div", sl, [
979
+ e.canCreate && ne.value && E.value && u.value.length >= e.requiredItemsForBottomCreate ? (s(), b(Le, {
978
980
  key: 0,
979
981
  disabled: !Be.value,
980
982
  text: e.createText,
@@ -983,7 +985,7 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
983
985
  onClick: Ve
984
986
  }, null, 8, ["disabled", "text", "icon", "to"])) : y("", !0)
985
987
  ])) : y("", !0),
986
- X(F, {
988
+ X(O, {
987
989
  ref_key: "paginator",
988
990
  ref: fe,
989
991
  modelValue: M.value,
@@ -993,8 +995,8 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
993
995
  onResults: $e,
994
996
  onLoading: Ne,
995
997
  onPerms: Ae,
996
- onCustom: Oe,
997
- onResponse: Fe
998
+ onCustom: Fe,
999
+ onResponse: Oe
998
1000
  }, null, 8, ["modelValue", "resource", "filters"])
999
1001
  ]),
1000
1002
  _: 3
@@ -1004,23 +1006,23 @@ const Dl = (l, t, r = !0) => H(new K(l, t).setIsSortable(r)), wl = (l, t, r, n =
1004
1006
  }
1005
1007
  }), Al = {
1006
1008
  install: (l) => {
1007
- l.component("lkt-loader") === void 0 && l.use(pt), l.component("lkt-button") === void 0 && l.use(vt), l.component("lkt-paginator") === void 0 && l.use(ht), l.component("lkt-field-text") === void 0 && l.use(yt), l.component("lkt-field-textarea") === void 0 && l.use(kt), l.component("lkt-field-select") === void 0 && l.use(bt), l.component("lkt-field-switch") === void 0 && l.use(gt), l.component("lkt-field-file") === void 0 && l.use(Ct), l.component("lkt-table") === void 0 && l.component("lkt-table", il);
1009
+ l.component("lkt-loader") === void 0 && l.use(pt), l.component("lkt-button") === void 0 && l.use(vt), l.component("lkt-paginator") === void 0 && l.use(ht), l.component("lkt-field-text") === void 0 && l.use(yt), l.component("lkt-field-textarea") === void 0 && l.use(kt), l.component("lkt-field-select") === void 0 && l.use(bt), l.component("lkt-field-switch") === void 0 && l.use(gt), l.component("lkt-field-file") === void 0 && l.use(Ct), l.component("lkt-table") === void 0 && l.component("lkt-table", rl);
1008
1010
  }
1009
- }, Ol = (l) => (O.navButtonSlot = l, !0), Fl = (l) => (O.dropButtonSlot = l, !0), Nl = (l) => (O.createButtonSlot = l, !0);
1011
+ }, Fl = (l) => (F.navButtonSlot = l, !0), Ol = (l) => (F.dropButtonSlot = l, !0), Nl = (l) => (F.createButtonSlot = l, !0);
1010
1012
  export {
1011
1013
  K as LktTableColumn,
1012
1014
  Tl as createActionColumn,
1013
1015
  Ll as createCheckColumn,
1014
1016
  Dl as createColumn,
1015
- El as createEmailColumn,
1017
+ Il as createEmailColumn,
1016
1018
  $l as createHiddenColumn,
1017
1019
  wl as createLinkColumn,
1018
1020
  Rl as createSelectColumn,
1019
1021
  Ml as createSwitchColumn,
1020
- Il as createTelColumn,
1022
+ El as createTelColumn,
1021
1023
  Bl as createTextColumn,
1022
1024
  Al as default,
1023
1025
  Nl as setTableCreateButtonSlot,
1024
- Fl as setTableDropButtonSlot,
1025
- Ol as setTableNavButtonSlot
1026
+ Ol as setTableDropButtonSlot,
1027
+ Fl as setTableNavButtonSlot
1026
1028
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-table",
3
- "version": "1.2.11",
3
+ "version": "1.2.12",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "lkt",
@@ -66,6 +66,8 @@ const props = withDefaults(defineProps<{
66
66
  itemMode?: boolean
67
67
  createEnabledValidator?: Function
68
68
  newValueGenerator?: Function
69
+ requiredItemsForTopCreate: number
70
+ requiredItemsForBottomCreate: number
69
71
  }>(), {
70
72
  modelValue: () => [],
71
73
  columns: () => [],
@@ -113,6 +115,8 @@ const props = withDefaults(defineProps<{
113
115
  itemMode: false,
114
116
  createEnabledValidator: undefined,
115
117
  newValueGenerator: undefined,
118
+ requiredItemsForTopCreate: 0,
119
+ requiredItemsForBottomCreate: 0,
116
120
  });
117
121
 
118
122
  const hiddenColumnsStack: LktObject = {};
@@ -493,7 +497,7 @@ defineExpose({
493
497
  </lkt-button>
494
498
 
495
499
  <create-button
496
- v-if="canCreate && hasCreatePerm && editModeEnabled"
500
+ v-if="canCreate && hasCreatePerm && editModeEnabled && Items.length >= requiredItemsForTopCreate"
497
501
  :disabled="!createEnabled"
498
502
  :text="createText"
499
503
  :icon="createIcon"
@@ -640,7 +644,7 @@ defineExpose({
640
644
 
641
645
  <div v-if="canCreate && hasCreatePerm && editModeEnabled" class="lkt-table-page-buttons lkt-table-page-buttons-bottom">
642
646
  <create-button
643
- v-if="canCreate && hasCreatePerm && editModeEnabled"
647
+ v-if="canCreate && hasCreatePerm && editModeEnabled && Items.length >= requiredItemsForBottomCreate"
644
648
  :disabled="!createEnabled"
645
649
  :text="createText"
646
650
  :icon="createIcon"