lkt-item-crud 2.0.26 → 2.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/build.js CHANGED
@@ -1,32 +1,32 @@
1
- import { defineComponent as He, ref as p, watch as b, useSlots as Ge, computed as w, resolveComponent as ke, createElementBlock as h, createCommentVNode as B, openBlock as n, createBlock as g, Fragment as F, renderSlot as T, withDirectives as C, mergeProps as f, normalizeProps as Re, unref as d, renderList as K, vShow as D, createVNode as x, withCtx as Q, mergeDefaults as _e, nextTick as Xe, onMounted as xe, resolveDynamicComponent as et, createSlots as fe, createElementVNode as tt, toDisplayString as at } from "vue";
2
- import { httpCall as ot } from "lkt-http-client";
1
+ import { defineComponent as We, ref as p, watch as g, useSlots as Ge, computed as h, resolveComponent as ce, createElementBlock as w, createCommentVNode as B, openBlock as n, createBlock as m, Fragment as j, renderSlot as T, withDirectives as C, mergeProps as f, normalizeProps as Ce, unref as d, renderList as H, vShow as D, createVNode as x, withCtx as Q, mergeDefaults as et, nextTick as Xe, onMounted as tt, resolveDynamicComponent as at, createSlots as fe, toDisplayString as ot } from "vue";
2
+ import { httpCall as nt } from "lkt-http-client";
3
3
  import { DataState as Ae } from "lkt-data-state";
4
- import { ModificationView as S, ItemCrudMode as A, ItemCrudButtonNavVisibility as Ke, ButtonType as Oe, TablePermission as Le, ensureButtonConfig as ee, LktSettings as m, getFormDataState as nt, ItemCrudView as We, getFormSlotKeys as ut, ItemCrudButtonNavPosition as Ne, NotificationType as ne, getDefaultValues as it, ItemCrud as lt, ToastPositionX as se } from "lkt-vue-kernel";
5
- import { closeModal as rt, updateModalKey as dt } from "lkt-modal";
6
- import { __ as st } from "lkt-i18n";
4
+ import { ModificationView as S, ItemCrudMode as A, ItemCrudButtonNavVisibility as He, ButtonType as Oe, TablePermission as Le, ensureButtonConfig as ee, LktSettings as b, getFormDataState as ut, ItemCrudView as Ke, getFormSlotKeys as it, ItemCrudButtonNavPosition as $e, NotificationType as ne, getDefaultValues as lt, ItemCrud as rt, ToastPositionX as se } from "lkt-vue-kernel";
5
+ import { closeModal as dt, updateModalKey as st } from "lkt-modal";
6
+ import { __ as vt } from "lkt-i18n";
7
7
  import { openToast as ve } from "lkt-toast";
8
- import { useRouter as vt } from "vue-router";
9
- const ce = class ce {
8
+ import { useRouter as pt } from "vue-router";
9
+ const me = class me {
10
10
  };
11
- ce.debugEnabled = !1, ce.defaultSaveIcon = "", ce.defaultDropIcon = "";
12
- let pe = ce;
13
- const V = (...N) => {
14
- pe.debugEnabled && console.info("[LktItemCrud] ", ...N);
15
- }, Ot = (N = !0) => {
16
- pe.debugEnabled = N;
17
- }, pt = {
18
- key: 0,
19
- class: "lkt-item-crud-buttons"
11
+ me.debugEnabled = !1, me.defaultSaveIcon = "", me.defaultDropIcon = "";
12
+ let pe = me;
13
+ const V = (...$) => {
14
+ pe.debugEnabled && console.info("[LktItemCrud] ", ...$);
15
+ }, Ot = ($ = !0) => {
16
+ pe.debugEnabled = $;
20
17
  }, ft = {
21
18
  key: 0,
22
19
  class: "lkt-item-crud-buttons"
23
20
  }, ct = {
24
- key: 1,
21
+ key: 0,
25
22
  class: "lkt-item-crud-buttons"
26
23
  }, mt = {
24
+ key: 1,
25
+ class: "lkt-item-crud-buttons"
26
+ }, bt = {
27
27
  key: 2,
28
28
  class: "lkt-item-crud-buttons"
29
- }, $e = /* @__PURE__ */ He({
29
+ }, Ne = /* @__PURE__ */ We({
30
30
  __name: "ButtonNav",
31
31
  props: {
32
32
  item: { default: () => ({}) },
@@ -68,13 +68,13 @@ const V = (...N) => {
68
68
  "save",
69
69
  "drop"
70
70
  ],
71
- setup(N, { expose: me, emit: Ce }) {
72
- const a = Ce, u = N, E = p(u.pickedModificationView);
73
- b(() => u.pickedModificationView, (t) => E.value = t), b(E, (t) => a("update:pickedModificationView", t));
71
+ setup($, { expose: be, emit: De }) {
72
+ const a = De, u = $, M = p(u.pickedModificationView);
73
+ g(() => u.pickedModificationView, (t) => M.value = t), g(M, (t) => a("update:pickedModificationView", t));
74
74
  const y = Ge(), c = p(null), s = p(null), i = p(u.loading);
75
- b(() => u.loading, (t) => i.value = t), b(i, (t) => a("update:loading", t));
76
- const M = p(u.editing);
77
- b(() => u.editing, (t) => M.value = t), b(M, (t) => a("update:editing", t));
75
+ g(() => u.loading, (t) => i.value = t), g(i, (t) => a("update:loading", t));
76
+ const E = p(u.editing);
77
+ g(() => u.editing, (t) => E.value = t), g(E, (t) => a("update:editing", t));
78
78
  const k = () => {
79
79
  i.value = !0;
80
80
  }, U = () => {
@@ -83,10 +83,10 @@ const V = (...N) => {
83
83
  typeof t > "u" || a("create", t, L);
84
84
  }, Y = (t, L) => {
85
85
  typeof t > "u" || a("save", t, L);
86
- }, P = (t, L) => {
86
+ }, F = (t, L) => {
87
87
  typeof t > "u" || a("drop", t, L);
88
- }, W = w(() => u.editableView === S.Modifications ? u.modifications : u.item);
89
- me({
88
+ }, K = h(() => u.editableView === S.Modifications ? u.modifications : u.item);
89
+ be({
90
90
  doSave: () => {
91
91
  c.value && typeof c.value.click == "function" && c.value.click();
92
92
  },
@@ -94,62 +94,62 @@ const V = (...N) => {
94
94
  s.value && typeof s.value.click == "function" && s.value.click();
95
95
  }
96
96
  });
97
- const H = w(() => !u.canDrop || u.dropButton === !1 ? !1 : !u.canUpdate && u.canDrop ? !0 : !i.value && u.editing && u.httpSuccessRead), I = w(() => u.mode === A.Create && u.createButton === !1 || u.mode === A.Update && u.updateButton === !1 || i.value ? !1 : u.editing && u.httpSuccessRead), ae = w(() => u.editModeButton === !1 || !u.canSwitchEditMode || !u.canUpdate && !u.canDrop || !u.canUpdate && u.canDrop ? !1 : !i.value && u.mode !== A.Create && u.httpSuccessRead), J = w(() => u.buttonNavVisibility === Ke.Always || y["prev-buttons-ever"] ? !0 : u.buttonNavVisibility === Ke.Never ? !1 : I.value || H.value || ae.value), G = w(() => u.modificationView === !1 ? [] : u.modificationView === !0 ? [
97
+ const W = h(() => !u.canDrop || u.dropButton === !1 ? !1 : !u.canUpdate && u.canDrop ? !0 : !i.value && u.editing && u.httpSuccessRead), I = h(() => u.mode === A.Create && u.createButton === !1 || u.mode === A.Update && u.updateButton === !1 || i.value ? !1 : u.editing && u.httpSuccessRead), ae = h(() => u.editModeButton === !1 || !u.canSwitchEditMode || !u.canUpdate && !u.canDrop || !u.canUpdate && u.canDrop ? !1 : !i.value && u.mode !== A.Create && u.httpSuccessRead), J = h(() => u.buttonNavVisibility === He.Always || y["prev-buttons-ever"] ? !0 : u.buttonNavVisibility === He.Never ? !1 : I.value || W.value || ae.value), G = h(() => u.modificationView === !1 ? [] : u.modificationView === !0 ? [
98
98
  S.Current,
99
99
  S.Modifications,
100
100
  S.SplitView,
101
101
  S.Differences
102
- ] : Array.isArray(u.modificationView) ? u.modificationView : []), re = w(() => {
102
+ ] : Array.isArray(u.modificationView) ? u.modificationView : []), re = h(() => {
103
103
  let t = [];
104
104
  return G.value.includes(S.Current) && t.push({
105
105
  text: "Current",
106
106
  icon: "lkt-icn-see",
107
- disabled: E.value === S.Current,
107
+ disabled: M.value === S.Current,
108
108
  events: {
109
109
  click: () => {
110
- E.value = S.Current;
110
+ M.value = S.Current;
111
111
  }
112
112
  }
113
113
  }), G.value.includes(S.Modifications) && t.push({
114
114
  text: "Modifications",
115
115
  icon: "lkt-icn-edit",
116
- disabled: E.value === S.Modifications,
116
+ disabled: M.value === S.Modifications,
117
117
  events: {
118
118
  click: () => {
119
- E.value = S.Modifications;
119
+ M.value = S.Modifications;
120
120
  }
121
121
  }
122
122
  }), G.value.includes(S.SplitView) && t.push({
123
123
  text: "Split View",
124
124
  icon: "lkt-icn-columns",
125
- disabled: E.value === S.SplitView,
125
+ disabled: M.value === S.SplitView,
126
126
  events: {
127
127
  click: () => {
128
- E.value = S.SplitView;
128
+ M.value = S.SplitView;
129
129
  }
130
130
  }
131
131
  }), G.value.includes(S.Differences) && t.push({
132
132
  text: "Differences",
133
133
  icon: "lkt-icn-balance",
134
- disabled: E.value === S.Differences,
134
+ disabled: M.value === S.Differences,
135
135
  events: {
136
136
  click: () => {
137
- E.value = S.Differences;
137
+ M.value = S.Differences;
138
138
  }
139
139
  }
140
140
  }), t;
141
141
  });
142
142
  return (t, L) => {
143
- var _, de, X, q;
144
- const r = ke("lkt-button");
145
- return J.value ? (n(), h("div", pt, [
146
- t.grouped && t.groupButtonAsModalActions ? (n(), h(F, { key: 0 }, [
147
- ae.value ? (n(), g(r, f({ key: 0 }, t.editModeButton, {
148
- checked: M.value,
149
- "onUpdate:checked": L[0] || (L[0] = (v) => M.value = v),
143
+ var _, de, P, q;
144
+ const r = ce("lkt-button");
145
+ return J.value ? (n(), w("div", ft, [
146
+ t.grouped && t.groupButtonAsModalActions ? (n(), w(j, { key: 0 }, [
147
+ ae.value ? (n(), m(r, f({ key: 0 }, t.editModeButton, {
148
+ checked: E.value,
149
+ "onUpdate:checked": L[0] || (L[0] = (v) => E.value = v),
150
150
  class: "lkt-item-crud--switch-mode-button"
151
151
  }), null, 16, ["checked"])) : B("", !0),
152
- G.value.length > 0 ? (n(), g(r, Re(f({ key: 1 }, {
152
+ G.value.length > 0 ? (n(), m(r, Ce(f({ key: 1 }, {
153
153
  type: d(Oe).Tooltip,
154
154
  icon: "lkt-icn-cross-arrows",
155
155
  class: "lkt-item-crud--modifications-button",
@@ -158,7 +158,7 @@ const V = (...N) => {
158
158
  contentClass: "lkt-flex-column"
159
159
  }
160
160
  })), null, 16)) : B("", !0),
161
- (n(!0), h(F, null, K(t.navStartButtons, (v) => C((n(), g(r, f({ ref_for: !0 }, v), null, 16)), [
161
+ (n(!0), w(j, null, H(t.navStartButtons, (v) => C((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
162
162
  [D, !i.value]
163
163
  ])), 256)),
164
164
  d(y)["prev-buttons-ever"] ? T(t.$slots, "prev-buttons-ever", {
@@ -167,8 +167,8 @@ const V = (...N) => {
167
167
  canDrop: t.canDrop,
168
168
  perms: t.perms
169
169
  }) : B("", !0),
170
- (n(!0), h(F, null, K(t.navStartButtonsEditing, (v) => C((n(), g(r, f({ ref_for: !0 }, v), null, 16)), [
171
- [D, M.value && !i.value]
170
+ (n(!0), w(j, null, H(t.navStartButtonsEditing, (v) => C((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
171
+ [D, E.value && !i.value]
172
172
  ])), 256)),
173
173
  d(y)["prev-buttons"] ? T(t.$slots, "prev-buttons", {
174
174
  key: 3,
@@ -183,7 +183,7 @@ const V = (...N) => {
183
183
  ...t.updateButton,
184
184
  resourceData: {
185
185
  ...(_ = t.updateButton) == null ? void 0 : _.resourceData,
186
- ...W.value
186
+ ...K.value
187
187
  },
188
188
  disabled: !t.ableToUpdate
189
189
  }, {
@@ -200,7 +200,7 @@ const V = (...N) => {
200
200
  ...t.createButton,
201
201
  resourceData: {
202
202
  ...(de = t.createButton) == null ? void 0 : de.resourceData,
203
- ...W.value
203
+ ...K.value
204
204
  },
205
205
  disabled: !t.ableToCreate
206
206
  }, {
@@ -217,30 +217,30 @@ const V = (...N) => {
217
217
  disabled: !t.ableToDrop,
218
218
  onLoading: k,
219
219
  onLoaded: U,
220
- onClick: P
220
+ onClick: F
221
221
  }), null, 16, ["disabled"]), [
222
- [D, H.value && t.mode !== d(A).Create]
222
+ [D, W.value && t.mode !== d(A).Create]
223
223
  ]),
224
224
  d(y).buttons ? T(t.$slots, "buttons", { key: 4 }) : B("", !0),
225
- (n(!0), h(F, null, K(t.navEndButtons, (v) => C((n(), g(r, f({ ref_for: !0 }, v), null, 16)), [
225
+ (n(!0), w(j, null, H(t.navEndButtons, (v) => C((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
226
226
  [D, !i.value]
227
227
  ])), 256)),
228
- (n(!0), h(F, null, K(t.navEndButtonsEditing, (v) => C((n(), g(r, f({ ref_for: !0 }, v), null, 16)), [
229
- [D, M.value && !i.value]
228
+ (n(!0), w(j, null, H(t.navEndButtonsEditing, (v) => C((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
229
+ [D, E.value && !i.value]
230
230
  ])), 256))
231
- ], 64)) : t.grouped ? (n(), g(r, f({
231
+ ], 64)) : t.grouped ? (n(), m(r, f({
232
232
  key: 1,
233
233
  ref: "groupButton"
234
234
  }, t.groupButton, { class: "lkt-item-crud-group-button" }), {
235
235
  split: Q(() => {
236
236
  var v, z;
237
237
  return [
238
- ae.value ? (n(), g(r, f({ key: 0 }, t.editModeButton, {
239
- checked: M.value,
240
- "onUpdate:checked": L[1] || (L[1] = ($) => M.value = $),
238
+ ae.value ? (n(), m(r, f({ key: 0 }, t.editModeButton, {
239
+ checked: E.value,
240
+ "onUpdate:checked": L[1] || (L[1] = (N) => E.value = N),
241
241
  class: "lkt-item-crud--switch-mode-button"
242
242
  }), null, 16, ["checked"])) : B("", !0),
243
- G.value.length > 0 ? (n(), g(r, Re(f({ key: 1 }, {
243
+ G.value.length > 0 ? (n(), m(r, Ce(f({ key: 1 }, {
244
244
  type: d(Oe).Tooltip,
245
245
  icon: "lkt-icn-cross-arrows",
246
246
  class: "lkt-item-crud--modifications-button",
@@ -249,7 +249,7 @@ const V = (...N) => {
249
249
  contentClass: "lkt-flex-column"
250
250
  }
251
251
  })), null, 16)) : B("", !0),
252
- (n(!0), h(F, null, K(t.navStartButtons, ($) => C((n(), g(r, f({ ref_for: !0 }, $), null, 16)), [
252
+ (n(!0), w(j, null, H(t.navStartButtons, (N) => C((n(), m(r, f({ ref_for: !0 }, N), null, 16)), [
253
253
  [D, !i.value]
254
254
  ])), 256)),
255
255
  d(y)["prev-buttons-ever"] ? T(t.$slots, "prev-buttons-ever", {
@@ -258,8 +258,8 @@ const V = (...N) => {
258
258
  canDrop: t.canDrop,
259
259
  perms: t.perms
260
260
  }) : B("", !0),
261
- (n(!0), h(F, null, K(t.navStartButtonsEditing, ($) => C((n(), g(r, f({ ref_for: !0 }, $), null, 16)), [
262
- [D, M.value && !i.value]
261
+ (n(!0), w(j, null, H(t.navStartButtonsEditing, (N) => C((n(), m(r, f({ ref_for: !0 }, N), null, 16)), [
262
+ [D, E.value && !i.value]
263
263
  ])), 256)),
264
264
  d(y)["prev-buttons"] ? T(t.$slots, "prev-buttons", {
265
265
  key: 3,
@@ -274,7 +274,7 @@ const V = (...N) => {
274
274
  ...t.updateButton,
275
275
  resourceData: {
276
276
  ...(v = t.updateButton) == null ? void 0 : v.resourceData,
277
- ...W.value
277
+ ...K.value
278
278
  },
279
279
  disabled: !t.ableToUpdate
280
280
  }, {
@@ -291,7 +291,7 @@ const V = (...N) => {
291
291
  ...t.createButton,
292
292
  resourceData: {
293
293
  ...(z = t.createButton) == null ? void 0 : z.resourceData,
294
- ...W.value
294
+ ...K.value
295
295
  },
296
296
  disabled: !t.ableToCreate
297
297
  }, {
@@ -309,25 +309,25 @@ const V = (...N) => {
309
309
  disabled: !t.ableToDrop,
310
310
  onLoading: k,
311
311
  onLoaded: U,
312
- onClick: P
312
+ onClick: F
313
313
  }), null, 16, ["disabled"]), [
314
- [D, H.value && t.mode !== d(A).Create]
314
+ [D, W.value && t.mode !== d(A).Create]
315
315
  ]),
316
316
  d(y).buttons ? T(t.$slots, "buttons", { key: 4 }) : B("", !0),
317
- (n(!0), h(F, null, K(t.navEndButtons, ($) => C((n(), g(r, f({ ref_for: !0 }, $), null, 16)), [
317
+ (n(!0), w(j, null, H(t.navEndButtons, (N) => C((n(), m(r, f({ ref_for: !0 }, N), null, 16)), [
318
318
  [D, !i.value]
319
319
  ])), 256)),
320
- (n(!0), h(F, null, K(t.navEndButtonsEditing, ($) => C((n(), g(r, f({ ref_for: !0 }, $), null, 16)), [
321
- [D, M.value && !i.value]
320
+ (n(!0), w(j, null, H(t.navEndButtonsEditing, (N) => C((n(), m(r, f({ ref_for: !0 }, N), null, 16)), [
321
+ [D, E.value && !i.value]
322
322
  ])), 256))
323
323
  ];
324
324
  }),
325
325
  _: 3
326
- }, 16)) : (n(), h(F, { key: 2 }, [
327
- (n(!0), h(F, null, K(t.navStartButtons, (v) => C((n(), g(r, f({ ref_for: !0 }, v), null, 16)), [
326
+ }, 16)) : (n(), w(j, { key: 2 }, [
327
+ (n(!0), w(j, null, H(t.navStartButtons, (v) => C((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
328
328
  [D, !i.value]
329
329
  ])), 256)),
330
- d(y)["prev-buttons-ever"] ? C((n(), h("div", ft, [
330
+ d(y)["prev-buttons-ever"] ? C((n(), w("div", ct, [
331
331
  T(t.$slots, "prev-buttons-ever", {
332
332
  canUpdate: t.canUpdate,
333
333
  canDrop: t.canDrop,
@@ -336,17 +336,17 @@ const V = (...N) => {
336
336
  ], 512)), [
337
337
  [D, !i.value]
338
338
  ]) : B("", !0),
339
- (n(!0), h(F, null, K(t.navStartButtonsEditing, (v) => C((n(), g(r, f({ ref_for: !0 }, v), null, 16)), [
340
- [D, M.value && !i.value]
339
+ (n(!0), w(j, null, H(t.navStartButtonsEditing, (v) => C((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
340
+ [D, E.value && !i.value]
341
341
  ])), 256)),
342
- d(y)["prev-buttons"] ? C((n(), h("div", ct, [
342
+ d(y)["prev-buttons"] ? C((n(), w("div", mt, [
343
343
  T(t.$slots, "prev-buttons", {
344
344
  canUpdate: t.canUpdate,
345
345
  canDrop: t.canDrop,
346
346
  perms: t.perms
347
347
  })
348
348
  ], 512)), [
349
- [D, M.value && !i.value]
349
+ [D, E.value && !i.value]
350
350
  ]) : B("", !0),
351
351
  C(x(r, f({
352
352
  ref_key: "saveButtonRef",
@@ -354,8 +354,8 @@ const V = (...N) => {
354
354
  }, {
355
355
  ...t.updateButton,
356
356
  resourceData: {
357
- ...(X = t.updateButton) == null ? void 0 : X.resourceData,
358
- ...W.value
357
+ ...(P = t.updateButton) == null ? void 0 : P.resourceData,
358
+ ...K.value
359
359
  },
360
360
  disabled: !t.ableToUpdate
361
361
  }, {
@@ -372,7 +372,7 @@ const V = (...N) => {
372
372
  ...t.createButton,
373
373
  resourceData: {
374
374
  ...(q = t.createButton) == null ? void 0 : q.resourceData,
375
- ...W.value
375
+ ...K.value
376
376
  },
377
377
  disabled: !t.ableToCreate
378
378
  }, {
@@ -389,22 +389,22 @@ const V = (...N) => {
389
389
  disabled: !t.ableToDrop,
390
390
  onLoading: k,
391
391
  onLoaded: U,
392
- onClick: P
392
+ onClick: F
393
393
  }), null, 16, ["disabled"]), [
394
- [D, H.value && t.mode !== d(A).Create]
394
+ [D, W.value && t.mode !== d(A).Create]
395
395
  ]),
396
- d(y).buttons ? C((n(), h("div", mt, [
396
+ d(y).buttons ? C((n(), w("div", bt, [
397
397
  T(t.$slots, "buttons")
398
398
  ], 512)), [
399
- [D, M.value && !i.value]
399
+ [D, E.value && !i.value]
400
400
  ]) : B("", !0),
401
- (n(!0), h(F, null, K(t.navEndButtons, (v) => C((n(), g(r, f({ ref_for: !0 }, v), null, 16)), [
401
+ (n(!0), w(j, null, H(t.navEndButtons, (v) => C((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
402
402
  [D, !i.value]
403
403
  ])), 256)),
404
- (n(!0), h(F, null, K(t.navEndButtonsEditing, (v) => C((n(), g(r, f({ ref_for: !0 }, v), null, 16)), [
405
- [D, M.value && !i.value]
404
+ (n(!0), w(j, null, H(t.navEndButtonsEditing, (v) => C((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
405
+ [D, E.value && !i.value]
406
406
  ])), 256)),
407
- G.value.length > 0 ? (n(), g(r, Re(f({ key: 3 }, {
407
+ G.value.length > 0 ? (n(), m(r, Ce(f({ key: 3 }, {
408
408
  type: d(Oe).Tooltip,
409
409
  icon: "lkt-icn-cross-arrows",
410
410
  class: "lkt-item-crud--modifications-button",
@@ -413,17 +413,17 @@ const V = (...N) => {
413
413
  contentClass: "lkt-flex-column"
414
414
  }
415
415
  })), null, 16)) : B("", !0),
416
- ae.value ? (n(), g(r, f({ key: 4 }, t.editModeButton, {
417
- checked: M.value,
418
- "onUpdate:checked": L[2] || (L[2] = (v) => M.value = v),
416
+ ae.value ? (n(), m(r, f({ key: 4 }, t.editModeButton, {
417
+ checked: E.value,
418
+ "onUpdate:checked": L[2] || (L[2] = (v) => E.value = v),
419
419
  class: "lkt-item-crud--switch-mode-button"
420
420
  }), null, 16, ["checked"])) : B("", !0)
421
421
  ], 64))
422
422
  ])) : B("", !0);
423
423
  };
424
424
  }
425
- }), bt = { class: "lkt-item-crud" }, gt = {
426
- key: 0,
425
+ }), gt = {
426
+ key: 1,
427
427
  class: "lkt-item-crud_header"
428
428
  }, Bt = {
429
429
  key: 0,
@@ -434,15 +434,15 @@ const V = (...N) => {
434
434
  }, kt = {
435
435
  key: 2,
436
436
  class: "lkt-item-crud_header-slot"
437
- }, Ct = {
438
- key: 2,
437
+ }, ht = {
438
+ key: 3,
439
439
  class: "lkt-item-crud_content"
440
- }, Dt = {
440
+ }, Ct = {
441
441
  key: 0,
442
442
  class: "lkt-grid-1"
443
- }, ht = /* @__PURE__ */ He({
443
+ }, Dt = /* @__PURE__ */ We({
444
444
  __name: "LktItemCrud",
445
- props: /* @__PURE__ */ _e({
445
+ props: /* @__PURE__ */ et({
446
446
  modelValue: {},
447
447
  modifications: {},
448
448
  editing: { type: Boolean },
@@ -468,6 +468,7 @@ const V = (...N) => {
468
468
  readResource: {},
469
469
  readData: {},
470
470
  title: {},
471
+ header: {},
471
472
  beforeEmitUpdate: { type: Function },
472
473
  notificationType: {},
473
474
  enabledSaveWithoutChanges: { type: Boolean },
@@ -479,14 +480,14 @@ const V = (...N) => {
479
480
  navEndButtons: {},
480
481
  navEndButtonsEditing: {},
481
482
  events: {}
482
- }, it(lt)),
483
+ }, lt(rt)),
483
484
  emits: [
484
485
  "update:modelValue",
485
486
  "update:editing",
486
487
  "update:perms",
487
488
  "update:customData",
488
489
  "update:modifications",
489
- "update:modificationView",
490
+ "update:visibleView",
490
491
  "read",
491
492
  "create",
492
493
  "update",
@@ -496,154 +497,154 @@ const V = (...N) => {
496
497
  "error",
497
498
  "modified-data"
498
499
  ],
499
- setup(N, { expose: me, emit: Ce }) {
500
- const a = N, u = vt(), E = Ge(), y = Ce, c = p(!0), s = p(a.modelValue), i = p(a.modifications), M = p(a.customData), k = p(a.perms), U = p(a.editing), te = p(!1), Y = p(!1), P = p(!1), W = p(!1), Z = p(200), O = p(new Ae(s.value, a.dataStateConfig)), H = p(new Ae(i.value, a.dataStateConfig)), I = p(!1), ae = p(new Ae(a.readData)), J = p(a.mode === A.Create), G = p(!1), re = p(!1), t = p(null), L = p(null), r = w(() => !J.value && a.updateButton !== !1 && Array.isArray(k.value) && k.value.includes(Le.Update)), _ = w(() => !J.value && a.dropButton !== !1 && Array.isArray(k.value) && k.value.includes(Le.Drop)), de = w(() => a.editModeButton !== !1 && !J.value && Array.isArray(k.value) && k.value.includes(Le.SwitchEditMode)), X = p(a.visibleView);
501
- b(() => a.visibleView, (e) => {
502
- X.value = e;
503
- }), b(X, (e) => {
504
- y("update:modificationView", e);
505
- }), b(() => a.mode, (e) => {
500
+ setup($, { expose: be, emit: De }) {
501
+ const a = $, u = pt(), M = Ge(), y = De, c = p(!0), s = p(a.modelValue), i = p(a.modifications), E = p(a.customData), k = p(a.perms), U = p(a.editing), te = p(!1), Y = p(!1), F = p(!1), K = p(!1), Z = p(200), O = p(new Ae(s.value, a.dataStateConfig)), W = p(new Ae(i.value, a.dataStateConfig)), I = p(!1), ae = p(new Ae(a.readData)), J = p(a.mode === A.Create), G = p(!1), re = p(!1), t = p(null), L = p(null), r = h(() => !J.value && a.updateButton !== !1 && Array.isArray(k.value) && k.value.includes(Le.Update)), _ = h(() => !J.value && a.dropButton !== !1 && Array.isArray(k.value) && k.value.includes(Le.Drop)), de = h(() => a.editModeButton !== !1 && !J.value && Array.isArray(k.value) && k.value.includes(Le.SwitchEditMode)), P = p(a.visibleView);
502
+ g(() => a.visibleView, (e) => {
503
+ P.value = e;
504
+ }), g(P, (e) => {
505
+ y("update:visibleView", e);
506
+ }), g(() => a.mode, (e) => {
506
507
  J.value = e === A.Create;
507
- }), b(() => a.perms, (e) => {
508
+ }), g(() => a.perms, (e) => {
508
509
  k.value = e;
509
- }), b(k, (e) => {
510
+ }), g(k, (e) => {
510
511
  y("update:perms", e);
511
- }), b(() => a.customData, (e) => {
512
- M.value = e;
513
- }), b(M, (e) => {
512
+ }), g(() => a.customData, (e) => {
513
+ E.value = e;
514
+ }), g(E, (e) => {
514
515
  y("update:customData", e);
515
- }), b(() => a.modifications, (e) => {
516
- H.value.increment(e), i.value = e;
517
- }, { deep: !0 }), b(i, (e) => {
518
- he(), H.value.increment(e), ue.value === S.Modifications && (I.value = H.value.changed()), y("update:modifications", e);
516
+ }), g(() => a.modifications, (e) => {
517
+ W.value.increment(e), i.value = e;
518
+ }, { deep: !0 }), g(i, (e) => {
519
+ Se(), W.value.increment(e), ue.value === S.Modifications && (I.value = W.value.changed()), y("update:modifications", e);
519
520
  }, { deep: !0 });
520
- const q = p(ee(a.createButton, m.defaultCreateButton)), v = p(ee(a.updateButton, m.defaultUpdateButton)), z = p(ee(a.dropButton, m.defaultDropButton)), $ = p(ee(a.editModeButton, m.defaultEditModeButton)), De = p(ee(a.groupButton, m.defaultGroupButton));
521
- b(() => a.createButton, (e) => {
522
- q.value = ee(e, m.defaultCreateButton);
523
- }, { deep: !0 }), b(() => a.updateButton, (e) => {
524
- v.value = ee(e, m.defaultUpdateButton);
525
- }, { deep: !0 }), b(() => a.dropButton, (e) => {
526
- z.value = ee(e, m.defaultDropButton);
527
- }, { deep: !0 }), b(() => a.editModeButton, (e) => {
528
- $.value = ee(e, m.defaultEditModeButton);
521
+ const q = p(ee(a.createButton, b.defaultCreateButton)), v = p(ee(a.updateButton, b.defaultUpdateButton)), z = p(ee(a.dropButton, b.defaultDropButton)), N = p(ee(a.editModeButton, b.defaultEditModeButton)), we = p(ee(a.groupButton, b.defaultGroupButton));
522
+ g(() => a.createButton, (e) => {
523
+ q.value = ee(e, b.defaultCreateButton);
524
+ }, { deep: !0 }), g(() => a.updateButton, (e) => {
525
+ v.value = ee(e, b.defaultUpdateButton);
526
+ }, { deep: !0 }), g(() => a.dropButton, (e) => {
527
+ z.value = ee(e, b.defaultDropButton);
528
+ }, { deep: !0 }), g(() => a.editModeButton, (e) => {
529
+ N.value = ee(e, b.defaultEditModeButton);
529
530
  }, { deep: !0 });
530
- const be = async () => {
531
- var e, o, j;
532
- V("fetchItem"), c.value = !0, Z.value = -1, W.value = !1, typeof ((e = a.events) == null ? void 0 : e.httpStart) == "function" && a.events.httpStart();
531
+ const ge = async () => {
532
+ var e, o, X;
533
+ V("fetchItem"), c.value = !0, Z.value = -1, K.value = !1, typeof ((e = a.events) == null ? void 0 : e.httpStart) == "function" && a.events.httpStart();
533
534
  try {
534
- const R = await ot(a.readResource, a.readData);
535
- if (V("fetchItem -> response", R), c.value = !1, Z.value = R.httpStatus, M.value = R.custom, !R.success) {
536
- P.value = !1, Z.value = R.httpStatus, typeof ((o = a.events) == null ? void 0 : o.httpEnd) == "function" && a.events.httpEnd({
535
+ const R = await nt(a.readResource, a.readData);
536
+ if (V("fetchItem -> response", R), c.value = !1, Z.value = R.httpStatus, E.value = R.custom, !R.success) {
537
+ F.value = !1, Z.value = R.httpStatus, typeof ((o = a.events) == null ? void 0 : o.httpEnd) == "function" && a.events.httpEnd({
537
538
  httpResponse: R
538
539
  }), y("error", R.httpStatus);
539
540
  return;
540
541
  }
541
- P.value = !0, s.value = R.data, i.value = Array.isArray(R.modifications) ? {} : R.modifications, k.value = R.perms, O.value.increment(s.value).turnStoredIntoOriginal(), H.value.increment(i.value).turnStoredIntoOriginal(), I.value = O.value.changed(), ae.value.turnStoredIntoOriginal(), Object.keys(i.value).length > 0 && (X.value = S.Modifications), oe.value && (he(), Xe(() => {
542
+ F.value = !0, s.value = R.data, i.value = Array.isArray(R.modifications) ? {} : R.modifications, k.value = R.perms, O.value.increment(s.value).turnStoredIntoOriginal(), W.value.increment(i.value).turnStoredIntoOriginal(), I.value = O.value.changed(), ae.value.turnStoredIntoOriginal(), Object.keys(i.value).length > 0 && (P.value = S.Modifications), oe.value && (Se(), Xe(() => {
542
543
  L.value.turnStoredIntoOriginal();
543
- })), typeof ((j = a.events) == null ? void 0 : j.httpEnd) == "function" && a.events.httpEnd({
544
+ })), typeof ((X = a.events) == null ? void 0 : X.httpEnd) == "function" && a.events.httpEnd({
544
545
  httpResponse: R
545
546
  }), y("read", R);
546
547
  } catch {
547
- c.value = !1, P.value = !1, Z.value = 404, y("error", 404);
548
+ c.value = !1, F.value = !1, Z.value = 404, y("error", 404);
548
549
  return;
549
550
  }
550
551
  };
551
- b(G, (e) => {
552
+ g(G, (e) => {
552
553
  e && Xe(() => G.value = !1);
553
- }), b(() => a.modelValue, (e) => {
554
+ }), g(() => a.modelValue, (e) => {
554
555
  s.value = e, O.value.increment(e);
555
- }, { deep: !0 }), b(s, (e) => {
556
+ }, { deep: !0 }), g(s, (e) => {
556
557
  if (V("item updated ->", s.value), typeof a.beforeEmitUpdate == "function") {
557
558
  V("item updated -> has beforeEmitUpdate");
558
559
  let o = a.beforeEmitUpdate(s.value);
559
560
  V("item updated -> override with: ", o), typeof o == "object" && (s.value = o);
560
561
  }
561
- oe.value && he(), y("update:modelValue", s.value), V("item updated -> update dataState"), O.value.increment(e), ue.value === S.Current && (I.value = O.value.changed()), G.value = !0;
562
- }, { deep: !0 }), b(k, () => y("perms", k.value)), b(I, (e) => {
562
+ oe.value && Se(), y("update:modelValue", s.value), V("item updated -> update dataState"), O.value.increment(e), ue.value === S.Current && (I.value = O.value.changed()), G.value = !0;
563
+ }, { deep: !0 }), g(k, () => y("perms", k.value)), g(I, (e) => {
563
564
  y("modified-data", e);
564
- }), b(() => a.readData, (e) => {
565
- ae.value.increment(e), ae.value.changed() && be();
566
- }), b(() => a.editing, (e) => {
565
+ }), g(() => a.readData, (e) => {
566
+ ae.value.increment(e), ae.value.changed() && ge();
567
+ }), g(() => a.editing, (e) => {
567
568
  V("editing updated -> updating editMode", e), U.value = e;
568
- }), b(U, (e) => {
569
+ }), g(U, (e) => {
569
570
  V("editMode updated -> emit update", e), y("update:editing", e);
570
571
  });
571
- const je = p(void 0), he = () => {
572
- oe.value && (je.value = nt(s.value, i.value, a.form));
572
+ const je = p(void 0), Se = () => {
573
+ oe.value && (je.value = ut(s.value, i.value, a.form));
573
574
  };
574
- xe(() => {
575
- a.readResource && !J.value ? be() : (J.value, P.value = !0, U.value = !0, c.value = !1, O.value.increment(s.value).turnStoredIntoOriginal(), I.value = O.value.changed());
575
+ tt(() => {
576
+ a.readResource && !J.value ? ge() : (J.value, F.value = !0, U.value = !0, c.value = !1, O.value.increment(s.value).turnStoredIntoOriginal(), I.value = O.value.changed());
576
577
  });
577
- const we = (e, o) => {
578
+ const Ue = (e, o) => {
578
579
  if (o) {
579
580
  if (c.value = !1, typeof e < "u" && (Z.value = e.httpStatus, !e.success))
580
- return W.value = !0, y("error", e.httpStatus), !1;
581
- W.value = !0;
581
+ return K.value = !0, y("error", e.httpStatus), !1;
582
+ K.value = !0;
582
583
  }
583
584
  return !0;
584
585
  }, Fe = (e, o) => {
585
586
  if (V("doAutoReloadId -> enter: ", e), typeof e < "u" && e.autoReloadId)
586
587
  if (V("doAutoReloadId -> autoReloadId detected: ", e.autoReloadId), typeof o < "u") {
587
- let j = o;
588
- typeof o == "function" && (j = o(e.autoReloadId)), u.push(j);
589
- } else Ve.value ? (V("doAutoReloadId -> insideModal: ", a), dt(a.modalConfig.modalName, a.modalConfig.modalKey, e.autoReloadId)) : (V("doAutoReloadId -> outsideModal"), a.readData.id = e.autoReloadId, V("doAutoReloadId -> turning off create mode"), J.value = !1, be());
590
- }, Se = (e, o) => {
591
- if (V("onCreate"), !we(o, q.value.resource)) {
588
+ let X = o;
589
+ typeof o == "function" && (X = o(e.autoReloadId)), u.push(X);
590
+ } else Be.value ? (V("doAutoReloadId -> insideModal: ", a), st(a.modalConfig.modalName, a.modalConfig.modalKey, e.autoReloadId)) : (V("doAutoReloadId -> outsideModal"), a.readData.id = e.autoReloadId, V("doAutoReloadId -> turning off create mode"), J.value = !1, ge());
591
+ }, Me = (e, o) => {
592
+ if (V("onCreate"), !Ue(o, q.value.resource)) {
592
593
  a.notificationType === ne.Toast && ve({
593
- text: m.defaultCreateErrorText,
594
- details: m.defaultCreateErrorDetails,
595
- icon: m.defaultCreateErrorIcon,
594
+ text: b.defaultCreateErrorText,
595
+ details: b.defaultCreateErrorDetails,
596
+ icon: b.defaultCreateErrorIcon,
596
597
  positionX: se.Right
597
598
  });
598
599
  return;
599
600
  }
600
- re.value = !0, V("onCreate -> turn stored data into original"), O.value.increment(s.value).turnStoredIntoOriginal(), H.value.turnStoredIntoOriginal(), a.notificationType === ne.Toast && ve({
601
- text: m.defaultCreateSuccessText,
602
- details: m.defaultCreateSuccessDetails,
603
- icon: m.defaultCreateSuccessIcon,
601
+ re.value = !0, V("onCreate -> turn stored data into original"), O.value.increment(s.value).turnStoredIntoOriginal(), W.value.turnStoredIntoOriginal(), a.notificationType === ne.Toast && ve({
602
+ text: b.defaultCreateSuccessText,
603
+ details: b.defaultCreateSuccessDetails,
604
+ icon: b.defaultCreateSuccessIcon,
604
605
  positionX: se.Right
605
606
  }), Fe(o, a.redirectOnCreate), V("onCreate -> beforeEmitCreate"), y("create", o);
606
- }, Ue = (e, o) => {
607
- if (V("onUpdate"), !we(o, v.value.resource)) {
607
+ }, Ee = (e, o) => {
608
+ if (V("onUpdate"), !Ue(o, v.value.resource)) {
608
609
  a.notificationType === ne.Toast && ve({
609
- text: m.defaultUpdateErrorText,
610
- details: m.defaultUpdateErrorDetails,
611
- icon: m.defaultUpdateErrorIcon,
610
+ text: b.defaultUpdateErrorText,
611
+ details: b.defaultUpdateErrorDetails,
612
+ icon: b.defaultUpdateErrorIcon,
612
613
  positionX: se.Right
613
614
  });
614
615
  return;
615
616
  }
616
- V("onUpdate -> turn stored data into original"), O.value.turnStoredIntoOriginal(), H.value.turnStoredIntoOriginal(), a.notificationType === ne.Toast && ve({
617
- text: m.defaultUpdateSuccessText,
618
- details: m.defaultUpdateSuccessDetails,
619
- icon: m.defaultUpdateSuccessIcon,
617
+ V("onUpdate -> turn stored data into original"), O.value.turnStoredIntoOriginal(), W.value.turnStoredIntoOriginal(), a.notificationType === ne.Toast && ve({
618
+ text: b.defaultUpdateSuccessText,
619
+ details: b.defaultUpdateSuccessDetails,
620
+ icon: b.defaultUpdateSuccessIcon,
620
621
  positionX: se.Right
621
622
  }), Fe(o), y("update", o);
622
- }, Ee = (e, o) => {
623
- if (V("onDrop"), !we(o, z.value.resource)) {
623
+ }, Ve = (e, o) => {
624
+ if (V("onDrop"), !Ue(o, z.value.resource)) {
624
625
  a.notificationType === ne.Toast && ve({
625
- text: m.defaultDropErrorText,
626
- details: m.defaultDropErrorDetails,
627
- icon: m.defaultDropErrorIcon,
626
+ text: b.defaultDropErrorText,
627
+ details: b.defaultDropErrorDetails,
628
+ icon: b.defaultDropErrorIcon,
628
629
  positionX: se.Right
629
630
  });
630
631
  return;
631
632
  }
632
633
  if (a.notificationType === ne.Toast && ve({
633
- text: m.defaultDropSuccessText,
634
- details: m.defaultDropSuccessDetails,
635
- icon: m.defaultDropSuccessIcon,
634
+ text: b.defaultDropSuccessText,
635
+ details: b.defaultDropSuccessDetails,
636
+ icon: b.defaultDropSuccessIcon,
636
637
  positionX: se.Right
637
- }), y("drop", o), a.view === We.Modal && (V("onDrop -> close modal"), rt(a.modalConfig.modalName, a.modalConfig.modalKey)), typeof a.redirectOnDrop < "u") {
638
- let j = a.redirectOnDrop;
639
- typeof a.redirectOnDrop == "function" && (j = a.redirectOnDrop()), u.push(j);
638
+ }), y("drop", o), a.view === Ke.Modal && (V("onDrop -> close modal"), dt(a.modalConfig.modalName, a.modalConfig.modalKey)), typeof a.redirectOnDrop < "u") {
639
+ let X = a.redirectOnDrop;
640
+ typeof a.redirectOnDrop == "function" && (X = a.redirectOnDrop()), u.push(X);
640
641
  }
641
642
  };
642
- me({
643
+ be({
643
644
  doDrop: () => {
644
645
  t.value && t.value.doDrop();
645
646
  },
646
- doRefresh: be,
647
+ doRefresh: ge,
647
648
  doSave: () => {
648
649
  t.value && t.value.doSave();
649
650
  },
@@ -652,9 +653,9 @@ const V = (...N) => {
652
653
  },
653
654
  hasModifiedData: () => O.value.changed()
654
655
  });
655
- const qe = w(() => {
656
- var e, o, j;
657
- return ye.value ? oe.value ? Y.value ? (e = a.modalConfig) == null ? void 0 : e.closeConfirm : "" : ue.value === S.Modifications ? H.value.changed() ? (o = a.modalConfig) == null ? void 0 : o.closeConfirm : "" : O.value.changed() ? (j = a.modalConfig) == null ? void 0 : j.closeConfirm : "" : "";
656
+ const qe = h(() => {
657
+ var e, o, X;
658
+ return he.value ? oe.value ? Y.value ? (e = a.modalConfig) == null ? void 0 : e.closeConfirm : "" : ue.value === S.Modifications ? W.value.changed() ? (o = a.modalConfig) == null ? void 0 : o.closeConfirm : "" : O.value.changed() ? (X = a.modalConfig) == null ? void 0 : X.closeConfirm : "" : "";
658
659
  }), ze = (e) => {
659
660
  var o;
660
661
  if (typeof ((o = a.modalConfig) == null ? void 0 : o.beforeClose) == "function")
@@ -662,233 +663,231 @@ const V = (...N) => {
662
663
  ...e,
663
664
  itemCreated: re.value
664
665
  });
665
- }, Me = w(() => a.title.startsWith("__:") ? String(st(a.title.substring(3))) : a.title), Je = w(() => c.value ? !1 : Me.value.length > 0 || !!E["post-title"]), Ve = w(() => a.view === We.Modal), Pe = w(() => Ve.value ? "lkt-modal" : "section"), ge = w(() => {
666
+ }, Ie = h(() => a.title.startsWith("__:") ? String(vt(a.title.substring(3))) : a.title), Je = h(() => c.value ? !1 : Ie.value.length > 0 || !!M["post-title"]), Qe = h(() => c.value ? !1 : typeof a.header == "object" && Object.keys(a.header).length > 0), Be = h(() => a.view === Ke.Modal), Pe = h(() => Be.value ? "lkt-modal" : "section"), ye = h(() => {
666
667
  var e, o;
667
668
  return a.mode !== A.Update || !r.value || !a.enabledSaveWithoutChanges && !I.value || oe.value && (!te.value || !Y.value) ? !1 : typeof ((e = v.value) == null ? void 0 : e.disabled) == "function" ? !v.value.disabled({
668
669
  prop: s.value
669
670
  }) : typeof ((o = v.value) == null ? void 0 : o.disabled) == "boolean" ? !v.value.disabled : !0;
670
- }), Be = w(() => {
671
+ }), ke = h(() => {
671
672
  var e, o;
672
673
  return a.mode !== A.Create || !a.enabledSaveWithoutChanges && !I.value || oe.value && !te.value && !Y.value ? !1 : typeof ((e = q.value) == null ? void 0 : e.disabled) == "function" ? !q.value.disabled({
673
674
  prop: s.value
674
675
  }) : typeof ((o = q.value) == null ? void 0 : o.disabled) == "boolean" ? !q.value.disabled : !0;
675
- }), Ie = w(() => {
676
+ }), Te = h(() => {
676
677
  var e, o;
677
678
  return _.value ? typeof ((e = z.value) == null ? void 0 : e.disabled) == "function" ? !z.value.disabled({
678
679
  prop: s.value
679
680
  }) : typeof ((o = z.value) == null ? void 0 : o.disabled) == "boolean" ? !z.value.disabled : !0 : !1;
680
- }), Qe = w(() => Pe.value === "lkt-modal" ? {
681
+ }), Ye = h(() => Pe.value === "lkt-modal" ? {
681
682
  title: a.title,
682
683
  item: s.value,
683
684
  ...a.modalConfig,
684
685
  beforeClose: ze,
685
686
  closeConfirm: qe.value,
686
687
  headerActionsButton: a.groupButton !== !1 ? {
687
- dot: Be.value || ge.value
688
+ dot: ke.value || ye.value
688
689
  } : !1
689
- } : {}), oe = w(() => typeof a.form == "object" && Object.keys(a.form).length > 0), Te = w(() => Object.keys(i.value).length === 0 ? [] : a.modificationViews), ue = w(() => Object.keys(i.value).length === 0 ? S.Current : S.Modifications), ye = w(() => J.value || r.value || _.value), Ye = w(() => oe.value ? ut(a.form) : []);
690
+ } : {}), oe = h(() => typeof a.form == "object" && Object.keys(a.form).length > 0), Re = h(() => Object.keys(i.value).length === 0 ? [] : a.modificationViews), ue = h(() => Object.keys(i.value).length === 0 ? S.Current : S.Modifications), he = h(() => J.value || r.value || _.value), Ze = h(() => oe.value ? it(a.form) : []);
690
691
  return (e, o) => {
691
- const j = ke("lkt-http-info"), R = ke("lkt-form"), Ze = ke("lkt-loader");
692
- return n(), g(et(Pe.value), f(Qe.value, { class: "lkt-item-crud" }), fe({
692
+ const X = ce("lkt-header"), R = ce("lkt-http-info"), _e = ce("lkt-form"), xe = ce("lkt-loader");
693
+ return n(), m(at(Pe.value), f(Ye.value, { class: "lkt-item-crud" }), fe({
693
694
  default: Q(() => [
694
- tt("article", bt, [
695
- !Ve.value && Je.value ? (n(), h("header", gt, [
696
- d(E)["pre-title"] ? (n(), h("div", Bt, [
697
- T(e.$slots, "pre-title", {
698
- item: s.value,
699
- loading: c.value
700
- })
701
- ])) : B("", !0),
702
- Me.value.length > 0 ? (n(), h("h1", yt, at(Me.value), 1)) : B("", !0),
703
- d(E)["post-title"] ? (n(), h("div", kt, [
704
- T(e.$slots, "post-title", {
705
- item: s.value,
706
- loading: c.value
707
- })
708
- ])) : B("", !0)
695
+ !Be.value && Qe.value ? (n(), m(X, Ce(f({ key: 0 }, e.header)), null, 16)) : !Be.value && Je.value ? (n(), w("header", gt, [
696
+ d(M)["pre-title"] ? (n(), w("div", Bt, [
697
+ T(e.$slots, "pre-title", {
698
+ item: s.value,
699
+ loading: c.value
700
+ })
709
701
  ])) : B("", !0),
710
- e.buttonNavPosition === d(Ne).Top && (e.groupButton === !1 || !e.groupButtonAsModalActions) && ye.value ? (n(), g($e, {
711
- key: 1,
712
- ref_key: "buttonNav",
713
- ref: t,
714
- loading: c.value,
715
- "onUpdate:loading": o[3] || (o[3] = (l) => c.value = l),
716
- editing: U.value,
717
- "onUpdate:editing": o[4] || (o[4] = (l) => U.value = l),
718
- "picked-modification-view": X.value,
719
- "onUpdate:pickedModificationView": o[5] || (o[5] = (l) => X.value = l),
720
- item: s.value,
721
- modifications: i.value,
722
- mode: e.mode,
723
- view: e.view,
724
- grouped: e.groupButton !== !1,
725
- "button-nav-visibility": e.buttonNavVisibility,
726
- "create-button": q.value,
727
- "update-button": v.value,
728
- "drop-button": z.value,
729
- "edit-mode-button": $.value,
730
- "group-button": De.value,
731
- "data-changed": I.value,
732
- "http-success-read": P.value,
733
- "can-update": r.value,
734
- "can-drop": _.value,
735
- "can-switch-edit-mode": de.value,
736
- "group-button-as-modal-actions": e.groupButtonAsModalActions,
737
- "able-to-create": Be.value,
738
- "able-to-update": ge.value,
739
- "able-to-drop": Ie.value,
740
- perms: k.value,
741
- "modification-view": Te.value,
742
- "editable-view": ue.value,
743
- "nav-start-buttons": e.navStartButtons,
744
- "nav-start-buttons-editing": e.navStartButtonsEditing,
745
- "nav-end-buttons": e.navEndButtons,
746
- "nav-end-buttons-editing": e.navEndButtonsEditing,
747
- onCreate: Se,
748
- onSave: Ue,
749
- onDrop: Ee
750
- }, fe({ _: 2 }, [
751
- d(E)["prev-buttons-ever"] ? {
752
- name: "prev-buttons-ever",
753
- fn: Q(({ canUpdate: l, canDrop: ie, perms: le }) => [
754
- T(e.$slots, "prev-buttons-ever", {
755
- canUpdate: l,
756
- canDrop: ie,
757
- perms: le
758
- })
759
- ]),
760
- key: "0"
761
- } : void 0,
762
- d(E)["prev-buttons"] ? {
763
- name: "prev-buttons",
764
- fn: Q(({ canUpdate: l, canDrop: ie, perms: le }) => [
765
- T(e.$slots, "prev-buttons", {
766
- canUpdate: l,
767
- canDrop: ie,
768
- perms: le
769
- })
770
- ]),
771
- key: "1"
772
- } : void 0
773
- ]), 1032, ["loading", "editing", "picked-modification-view", "item", "modifications", "mode", "view", "grouped", "button-nav-visibility", "create-button", "update-button", "drop-button", "edit-mode-button", "group-button", "data-changed", "http-success-read", "can-update", "can-drop", "can-switch-edit-mode", "group-button-as-modal-actions", "able-to-create", "able-to-update", "able-to-drop", "perms", "modification-view", "editable-view", "nav-start-buttons", "nav-start-buttons-editing", "nav-end-buttons", "nav-end-buttons-editing"])) : B("", !0),
774
- c.value ? B("", !0) : (n(), h("div", Ct, [
775
- P.value ? (n(), h("div", Dt, [
776
- W.value && e.notificationType === d(ne).Inline ? (n(), g(j, {
777
- key: 0,
778
- code: Z.value,
779
- palette: Z.value === 200 ? "success" : "danger",
780
- quick: "",
781
- "can-close": "",
782
- onClose: o[6] || (o[6] = (l) => W.value = !1)
783
- }, null, 8, ["code", "palette"])) : B("", !0),
784
- oe.value ? (n(), g(R, f({
785
- key: 1,
786
- ref_key: "formRef",
787
- ref: L,
788
- modelValue: s.value,
789
- "onUpdate:modelValue": o[7] || (o[7] = (l) => s.value = l),
790
- modifications: i.value,
791
- "onUpdate:modifications": o[8] || (o[8] = (l) => i.value = l),
792
- valid: te.value,
793
- "onUpdate:valid": o[9] || (o[9] = (l) => te.value = l),
794
- changed: Y.value,
795
- "onUpdate:changed": o[10] || (o[10] = (l) => Y.value = l)
796
- }, {
797
- ...e.formUiConfig,
798
- form: e.form,
799
- differencesTableConfig: e.differencesTableConfig,
800
- visibleView: X.value,
801
- modificationDataState: je.value,
802
- editableViews: [ue.value],
803
- disabled: !U.value
804
- }), fe({ _: 2 }, [
805
- K(Ye.value, (l) => ({
806
- name: l,
807
- fn: Q(({}) => [
808
- T(e.$slots, l)
809
- ])
810
- }))
811
- ]), 1040, ["modelValue", "modifications", "valid", "changed"])) : T(e.$slots, "item", {
812
- key: 2,
813
- item: s.value,
814
- loading: c.value,
815
- editMode: U.value,
816
- isCreate: J.value,
817
- canUpdate: r.value,
818
- canDrop: _.value,
819
- itemBeingEdited: G.value,
820
- perms: k.value
702
+ Ie.value.length > 0 ? (n(), w("h1", yt, ot(Ie.value), 1)) : B("", !0),
703
+ d(M)["post-title"] ? (n(), w("div", kt, [
704
+ T(e.$slots, "post-title", {
705
+ item: s.value,
706
+ loading: c.value
707
+ })
708
+ ])) : B("", !0)
709
+ ])) : B("", !0),
710
+ e.buttonNavPosition === d($e).Top && (e.groupButton === !1 || !e.groupButtonAsModalActions) && he.value ? (n(), m(Ne, {
711
+ key: 2,
712
+ ref_key: "buttonNav",
713
+ ref: t,
714
+ loading: c.value,
715
+ "onUpdate:loading": o[3] || (o[3] = (l) => c.value = l),
716
+ editing: U.value,
717
+ "onUpdate:editing": o[4] || (o[4] = (l) => U.value = l),
718
+ "picked-modification-view": P.value,
719
+ "onUpdate:pickedModificationView": o[5] || (o[5] = (l) => P.value = l),
720
+ item: s.value,
721
+ modifications: i.value,
722
+ mode: e.mode,
723
+ view: e.view,
724
+ grouped: e.groupButton !== !1,
725
+ "button-nav-visibility": e.buttonNavVisibility,
726
+ "create-button": q.value,
727
+ "update-button": v.value,
728
+ "drop-button": z.value,
729
+ "edit-mode-button": N.value,
730
+ "group-button": we.value,
731
+ "data-changed": I.value,
732
+ "http-success-read": F.value,
733
+ "can-update": r.value,
734
+ "can-drop": _.value,
735
+ "can-switch-edit-mode": de.value,
736
+ "group-button-as-modal-actions": e.groupButtonAsModalActions,
737
+ "able-to-create": ke.value,
738
+ "able-to-update": ye.value,
739
+ "able-to-drop": Te.value,
740
+ perms: k.value,
741
+ "modification-view": Re.value,
742
+ "editable-view": ue.value,
743
+ "nav-start-buttons": e.navStartButtons,
744
+ "nav-start-buttons-editing": e.navStartButtonsEditing,
745
+ "nav-end-buttons": e.navEndButtons,
746
+ "nav-end-buttons-editing": e.navEndButtonsEditing,
747
+ onCreate: Me,
748
+ onSave: Ee,
749
+ onDrop: Ve
750
+ }, fe({ _: 2 }, [
751
+ d(M)["prev-buttons-ever"] ? {
752
+ name: "prev-buttons-ever",
753
+ fn: Q(({ canUpdate: l, canDrop: ie, perms: le }) => [
754
+ T(e.$slots, "prev-buttons-ever", {
755
+ canUpdate: l,
756
+ canDrop: ie,
757
+ perms: le
821
758
  })
822
- ])) : e.notificationType === d(ne).Inline ? (n(), g(j, {
759
+ ]),
760
+ key: "0"
761
+ } : void 0,
762
+ d(M)["prev-buttons"] ? {
763
+ name: "prev-buttons",
764
+ fn: Q(({ canUpdate: l, canDrop: ie, perms: le }) => [
765
+ T(e.$slots, "prev-buttons", {
766
+ canUpdate: l,
767
+ canDrop: ie,
768
+ perms: le
769
+ })
770
+ ]),
771
+ key: "1"
772
+ } : void 0
773
+ ]), 1032, ["loading", "editing", "picked-modification-view", "item", "modifications", "mode", "view", "grouped", "button-nav-visibility", "create-button", "update-button", "drop-button", "edit-mode-button", "group-button", "data-changed", "http-success-read", "can-update", "can-drop", "can-switch-edit-mode", "group-button-as-modal-actions", "able-to-create", "able-to-update", "able-to-drop", "perms", "modification-view", "editable-view", "nav-start-buttons", "nav-start-buttons-editing", "nav-end-buttons", "nav-end-buttons-editing"])) : B("", !0),
774
+ c.value ? B("", !0) : (n(), w("div", ht, [
775
+ F.value ? (n(), w("div", Ct, [
776
+ K.value && e.notificationType === d(ne).Inline ? (n(), m(R, {
777
+ key: 0,
778
+ code: Z.value,
779
+ palette: Z.value === 200 ? "success" : "danger",
780
+ quick: "",
781
+ "can-close": "",
782
+ onClose: o[6] || (o[6] = (l) => K.value = !1)
783
+ }, null, 8, ["code", "palette"])) : B("", !0),
784
+ oe.value ? (n(), m(_e, f({
823
785
  key: 1,
824
- code: Z.value
825
- }, null, 8, ["code"])) : B("", !0)
826
- ])),
827
- c.value ? (n(), g(Ze, { key: 3 })) : B("", !0),
828
- e.buttonNavPosition === d(Ne).Bottom && (e.groupButton === !1 || !e.groupButtonAsModalActions) && ye.value ? (n(), g($e, {
829
- key: 4,
830
- ref_key: "buttonNav",
831
- ref: t,
832
- loading: c.value,
833
- "onUpdate:loading": o[11] || (o[11] = (l) => c.value = l),
834
- editing: U.value,
835
- "onUpdate:editing": o[12] || (o[12] = (l) => U.value = l),
836
- "picked-modification-view": X.value,
837
- "onUpdate:pickedModificationView": o[13] || (o[13] = (l) => X.value = l),
838
- item: s.value,
839
- modifications: i.value,
840
- mode: e.mode,
841
- view: e.view,
842
- grouped: e.groupButton !== !1,
843
- "button-nav-visibility": e.buttonNavVisibility,
844
- "create-button": q.value,
845
- "update-button": v.value,
846
- "drop-button": z.value,
847
- "edit-mode-button": $.value,
848
- "group-button": De.value,
849
- "data-changed": I.value,
850
- "http-success-read": P.value,
851
- "can-update": r.value,
852
- "can-drop": _.value,
853
- "can-switch-edit-mode": de.value,
854
- "group-button-as-modal-actions": e.groupButtonAsModalActions,
855
- "able-to-create": Be.value,
856
- "able-to-update": ge.value,
857
- "able-to-drop": Ie.value,
858
- perms: k.value,
859
- "modification-view": Te.value,
860
- "editable-view": ue.value,
861
- "nav-start-buttons": e.navStartButtons,
862
- "nav-start-buttons-editing": e.navStartButtonsEditing,
863
- "nav-end-buttons": e.navEndButtons,
864
- "nav-end-buttons-editing": e.navEndButtonsEditing,
865
- onCreate: Se,
866
- onSave: Ue,
867
- onDrop: Ee
868
- }, fe({ _: 2 }, [
869
- d(E)["prev-buttons-ever"] ? {
870
- name: "prev-buttons-ever",
871
- fn: Q(() => [
872
- T(e.$slots, "prev-buttons-ever")
873
- ]),
874
- key: "0"
875
- } : void 0,
876
- d(E)["prev-buttons"] ? {
877
- name: "prev-buttons-ever",
878
- fn: Q(() => [
879
- T(e.$slots, "prev-buttons")
880
- ]),
881
- key: "1"
882
- } : void 0
883
- ]), 1032, ["loading", "editing", "picked-modification-view", "item", "modifications", "mode", "view", "grouped", "button-nav-visibility", "create-button", "update-button", "drop-button", "edit-mode-button", "group-button", "data-changed", "http-success-read", "can-update", "can-drop", "can-switch-edit-mode", "group-button-as-modal-actions", "able-to-create", "able-to-update", "able-to-drop", "perms", "modification-view", "editable-view", "nav-start-buttons", "nav-start-buttons-editing", "nav-end-buttons", "nav-end-buttons-editing"])) : B("", !0)
884
- ])
786
+ ref_key: "formRef",
787
+ ref: L,
788
+ modelValue: s.value,
789
+ "onUpdate:modelValue": o[7] || (o[7] = (l) => s.value = l),
790
+ modifications: i.value,
791
+ "onUpdate:modifications": o[8] || (o[8] = (l) => i.value = l),
792
+ valid: te.value,
793
+ "onUpdate:valid": o[9] || (o[9] = (l) => te.value = l),
794
+ changed: Y.value,
795
+ "onUpdate:changed": o[10] || (o[10] = (l) => Y.value = l)
796
+ }, {
797
+ ...e.formUiConfig,
798
+ form: e.form,
799
+ differencesTableConfig: e.differencesTableConfig,
800
+ visibleView: P.value,
801
+ modificationDataState: je.value,
802
+ editableViews: [ue.value],
803
+ disabled: !U.value
804
+ }), fe({ _: 2 }, [
805
+ H(Ze.value, (l) => ({
806
+ name: l,
807
+ fn: Q(({}) => [
808
+ T(e.$slots, l)
809
+ ])
810
+ }))
811
+ ]), 1040, ["modelValue", "modifications", "valid", "changed"])) : T(e.$slots, "item", {
812
+ key: 2,
813
+ item: s.value,
814
+ loading: c.value,
815
+ editMode: U.value,
816
+ isCreate: J.value,
817
+ canUpdate: r.value,
818
+ canDrop: _.value,
819
+ itemBeingEdited: G.value,
820
+ perms: k.value
821
+ })
822
+ ])) : e.notificationType === d(ne).Inline ? (n(), m(R, {
823
+ key: 1,
824
+ code: Z.value
825
+ }, null, 8, ["code"])) : B("", !0)
826
+ ])),
827
+ c.value ? (n(), m(xe, { key: 4 })) : B("", !0),
828
+ e.buttonNavPosition === d($e).Bottom && (e.groupButton === !1 || !e.groupButtonAsModalActions) && he.value ? (n(), m(Ne, {
829
+ key: 5,
830
+ ref_key: "buttonNav",
831
+ ref: t,
832
+ loading: c.value,
833
+ "onUpdate:loading": o[11] || (o[11] = (l) => c.value = l),
834
+ editing: U.value,
835
+ "onUpdate:editing": o[12] || (o[12] = (l) => U.value = l),
836
+ "picked-modification-view": P.value,
837
+ "onUpdate:pickedModificationView": o[13] || (o[13] = (l) => P.value = l),
838
+ item: s.value,
839
+ modifications: i.value,
840
+ mode: e.mode,
841
+ view: e.view,
842
+ grouped: e.groupButton !== !1,
843
+ "button-nav-visibility": e.buttonNavVisibility,
844
+ "create-button": q.value,
845
+ "update-button": v.value,
846
+ "drop-button": z.value,
847
+ "edit-mode-button": N.value,
848
+ "group-button": we.value,
849
+ "data-changed": I.value,
850
+ "http-success-read": F.value,
851
+ "can-update": r.value,
852
+ "can-drop": _.value,
853
+ "can-switch-edit-mode": de.value,
854
+ "group-button-as-modal-actions": e.groupButtonAsModalActions,
855
+ "able-to-create": ke.value,
856
+ "able-to-update": ye.value,
857
+ "able-to-drop": Te.value,
858
+ perms: k.value,
859
+ "modification-view": Re.value,
860
+ "editable-view": ue.value,
861
+ "nav-start-buttons": e.navStartButtons,
862
+ "nav-start-buttons-editing": e.navStartButtonsEditing,
863
+ "nav-end-buttons": e.navEndButtons,
864
+ "nav-end-buttons-editing": e.navEndButtonsEditing,
865
+ onCreate: Me,
866
+ onSave: Ee,
867
+ onDrop: Ve
868
+ }, fe({ _: 2 }, [
869
+ d(M)["prev-buttons-ever"] ? {
870
+ name: "prev-buttons-ever",
871
+ fn: Q(() => [
872
+ T(e.$slots, "prev-buttons-ever")
873
+ ]),
874
+ key: "0"
875
+ } : void 0,
876
+ d(M)["prev-buttons"] ? {
877
+ name: "prev-buttons-ever",
878
+ fn: Q(() => [
879
+ T(e.$slots, "prev-buttons")
880
+ ]),
881
+ key: "1"
882
+ } : void 0
883
+ ]), 1032, ["loading", "editing", "picked-modification-view", "item", "modifications", "mode", "view", "grouped", "button-nav-visibility", "create-button", "update-button", "drop-button", "edit-mode-button", "group-button", "data-changed", "http-success-read", "can-update", "can-drop", "can-switch-edit-mode", "group-button-as-modal-actions", "able-to-create", "able-to-update", "able-to-drop", "perms", "modification-view", "editable-view", "nav-start-buttons", "nav-start-buttons-editing", "nav-end-buttons", "nav-end-buttons-editing"])) : B("", !0)
885
884
  ]),
886
885
  _: 2
887
886
  }, [
888
- e.groupButton !== !1 && e.groupButtonAsModalActions && ye.value ? {
887
+ e.groupButton !== !1 && e.groupButtonAsModalActions && he.value ? {
889
888
  name: "header-actions",
890
889
  fn: Q(() => [
891
- e.buttonNavPosition === d(Ne).Top ? (n(), g($e, {
890
+ e.buttonNavPosition === d($e).Top ? (n(), m(Ne, {
892
891
  key: 0,
893
892
  ref_key: "buttonNav",
894
893
  ref: t,
@@ -896,8 +895,8 @@ const V = (...N) => {
896
895
  "onUpdate:loading": o[0] || (o[0] = (l) => c.value = l),
897
896
  editing: U.value,
898
897
  "onUpdate:editing": o[1] || (o[1] = (l) => U.value = l),
899
- "picked-modification-view": X.value,
900
- "onUpdate:pickedModificationView": o[2] || (o[2] = (l) => X.value = l),
898
+ "picked-modification-view": P.value,
899
+ "onUpdate:pickedModificationView": o[2] || (o[2] = (l) => P.value = l),
901
900
  item: s.value,
902
901
  modifications: i.value,
903
902
  mode: e.mode,
@@ -907,29 +906,29 @@ const V = (...N) => {
907
906
  "create-button": q.value,
908
907
  "update-button": v.value,
909
908
  "drop-button": z.value,
910
- "edit-mode-button": $.value,
911
- "group-button": De.value,
909
+ "edit-mode-button": N.value,
910
+ "group-button": we.value,
912
911
  "data-changed": I.value,
913
- "http-success-read": P.value,
912
+ "http-success-read": F.value,
914
913
  "can-update": r.value,
915
914
  "can-drop": _.value,
916
915
  "can-switch-edit-mode": de.value,
917
916
  "group-button-as-modal-actions": e.groupButtonAsModalActions,
918
- "able-to-create": Be.value,
919
- "able-to-update": ge.value,
920
- "able-to-drop": Ie.value,
917
+ "able-to-create": ke.value,
918
+ "able-to-update": ye.value,
919
+ "able-to-drop": Te.value,
921
920
  perms: k.value,
922
- "modification-view": Te.value,
921
+ "modification-view": Re.value,
923
922
  "editable-view": ue.value,
924
923
  "nav-start-buttons": e.navStartButtons,
925
924
  "nav-start-buttons-editing": e.navStartButtonsEditing,
926
925
  "nav-end-buttons": e.navEndButtons,
927
926
  "nav-end-buttons-editing": e.navEndButtonsEditing,
928
- onCreate: Se,
929
- onSave: Ue,
930
- onDrop: Ee
927
+ onCreate: Me,
928
+ onSave: Ee,
929
+ onDrop: Ve
931
930
  }, fe({ _: 2 }, [
932
- d(E)["prev-buttons-ever"] ? {
931
+ d(M)["prev-buttons-ever"] ? {
933
932
  name: "prev-buttons-ever",
934
933
  fn: Q(({ canUpdate: l, canDrop: ie, perms: le }) => [
935
934
  T(e.$slots, "prev-buttons-ever", {
@@ -940,7 +939,7 @@ const V = (...N) => {
940
939
  ]),
941
940
  key: "0"
942
941
  } : void 0,
943
- d(E)["prev-buttons"] ? {
942
+ d(M)["prev-buttons"] ? {
944
943
  name: "prev-buttons",
945
944
  fn: Q(({ canUpdate: l, canDrop: ie, perms: le }) => [
946
945
  T(e.$slots, "prev-buttons", {
@@ -959,17 +958,17 @@ const V = (...N) => {
959
958
  };
960
959
  }
961
960
  }), Lt = {
962
- install: (N, me = {}) => {
963
- N.component("lkt-item-crud") === void 0 && N.component("lkt-item-crud", ht);
961
+ install: ($, be = {}) => {
962
+ $.component("lkt-item-crud") === void 0 && $.component("lkt-item-crud", Dt);
964
963
  }
965
- }, Nt = (N) => {
966
- pe.defaultSaveIcon = N;
967
- }, $t = (N) => {
968
- pe.defaultDropIcon = N;
964
+ }, $t = ($) => {
965
+ pe.defaultSaveIcon = $;
966
+ }, Nt = ($) => {
967
+ pe.defaultDropIcon = $;
969
968
  };
970
969
  export {
971
970
  Ot as debugLktItemCrud,
972
971
  Lt as default,
973
- $t as setItemCrudDefaultDropIcon,
974
- Nt as setItemCrudDefaultSaveIcon
972
+ Nt as setItemCrudDefaultDropIcon,
973
+ $t as setItemCrudDefaultSaveIcon
975
974
  };