lkt-table 1.3.21 → 1.3.22

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