lkt-item-crud 2.0.28 → 2.0.29

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,7 +1,7 @@
1
- declare function Ot($?: boolean): void;
2
- declare namespace Lt {
3
- function install($: any, be?: {}): void;
1
+ declare function Lt($?: boolean): void;
2
+ declare namespace $t {
3
+ function install($: any, ge?: {}): void;
4
4
  }
5
+ declare function jt($: any): void;
5
6
  declare function Nt($: any): void;
6
- declare function $t($: any): void;
7
- export { Ot as debugLktItemCrud, Lt as default, Nt as setItemCrudDefaultDropIcon, $t as setItemCrudDefaultSaveIcon };
7
+ export { Lt as debugLktItemCrud, $t as default, jt as setItemCrudDefaultDropIcon, Nt as setItemCrudDefaultSaveIcon };
package/dist/build.js CHANGED
@@ -1,32 +1,32 @@
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
- import { DataState as Ae } from "lkt-data-state";
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";
1
+ import { defineComponent as Ge, ref as p, watch as g, useSlots as qe, computed as k, resolveComponent as me, createElementBlock as w, createCommentVNode as B, openBlock as n, createBlock as m, Fragment as F, renderSlot as T, withDirectives as C, mergeProps as f, normalizeProps as De, unref as d, renderList as H, vShow as D, createVNode as x, withCtx as Q, mergeDefaults as tt, nextTick as He, onMounted as at, resolveDynamicComponent as ot, createSlots as ce, toDisplayString as nt } from "vue";
2
+ import { httpCall as ut } from "lkt-http-client";
3
+ import { DataState as Oe } from "lkt-data-state";
4
+ import { ModificationView as S, ItemCrudMode as A, ItemCrudButtonNavVisibility as Ke, ButtonType as Le, TablePermission as $e, ensureButtonConfig as ee, LktSettings as b, getFormDataState as it, ItemCrudView as We, getFormSlotKeys as lt, ItemCrudButtonNavPosition as Ne, NotificationType as ne, getDefaultValues as rt, ItemCrud as dt, ToastPositionX as se } from "lkt-vue-kernel";
5
+ import { closeModal as st, updateModalKey as vt } from "lkt-modal";
6
+ import { __ as pt } from "lkt-i18n";
7
7
  import { openToast as ve } from "lkt-toast";
8
- import { useRouter as pt } from "vue-router";
9
- const me = class me {
8
+ import { useRouter as ft } from "vue-router";
9
+ const be = class be {
10
10
  };
11
- me.debugEnabled = !1, me.defaultSaveIcon = "", me.defaultDropIcon = "";
12
- let pe = me;
11
+ be.debugEnabled = !1, be.defaultSaveIcon = "", be.defaultDropIcon = "";
12
+ let pe = be;
13
13
  const V = (...$) => {
14
14
  pe.debugEnabled && console.info("[LktItemCrud] ", ...$);
15
- }, Ot = ($ = !0) => {
15
+ }, Lt = ($ = !0) => {
16
16
  pe.debugEnabled = $;
17
- }, ft = {
18
- key: 0,
19
- class: "lkt-item-crud-buttons"
20
17
  }, ct = {
21
18
  key: 0,
22
19
  class: "lkt-item-crud-buttons"
23
20
  }, mt = {
24
- key: 1,
21
+ key: 0,
25
22
  class: "lkt-item-crud-buttons"
26
23
  }, bt = {
24
+ key: 1,
25
+ class: "lkt-item-crud-buttons"
26
+ }, gt = {
27
27
  key: 2,
28
28
  class: "lkt-item-crud-buttons"
29
- }, Ne = /* @__PURE__ */ We({
29
+ }, je = /* @__PURE__ */ Ge({
30
30
  __name: "ButtonNav",
31
31
  props: {
32
32
  item: { default: () => ({}) },
@@ -68,14 +68,14 @@ const V = (...$) => {
68
68
  "save",
69
69
  "drop"
70
70
  ],
71
- setup($, { expose: be, emit: De }) {
72
- const a = De, u = $, M = p(u.pickedModificationView);
71
+ setup($, { expose: ge, emit: we }) {
72
+ const a = we, u = $, M = p(u.pickedModificationView);
73
73
  g(() => u.pickedModificationView, (t) => M.value = t), g(M, (t) => a("update:pickedModificationView", t));
74
- const y = Ge(), c = p(null), s = p(null), i = p(u.loading);
74
+ const y = qe(), c = p(null), s = p(null), i = p(u.loading);
75
75
  g(() => u.loading, (t) => i.value = t), g(i, (t) => a("update:loading", t));
76
76
  const E = p(u.editing);
77
77
  g(() => u.editing, (t) => E.value = t), g(E, (t) => a("update:editing", t));
78
- const k = () => {
78
+ const h = () => {
79
79
  i.value = !0;
80
80
  }, U = () => {
81
81
  i.value = !1;
@@ -83,10 +83,10 @@ const V = (...$) => {
83
83
  typeof t > "u" || a("create", t, L);
84
84
  }, Y = (t, L) => {
85
85
  typeof t > "u" || a("save", t, L);
86
- }, F = (t, L) => {
86
+ }, P = (t, L) => {
87
87
  typeof t > "u" || a("drop", t, L);
88
- }, K = h(() => u.editableView === S.Modifications ? u.modifications : u.item);
89
- be({
88
+ }, K = k(() => u.editableView === S.Modifications ? u.modifications : u.item);
89
+ ge({
90
90
  doSave: () => {
91
91
  c.value && typeof c.value.click == "function" && c.value.click();
92
92
  },
@@ -94,12 +94,12 @@ const V = (...$) => {
94
94
  s.value && typeof s.value.click == "function" && s.value.click();
95
95
  }
96
96
  });
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 ? [
97
+ const W = k(() => !u.canDrop || u.dropButton === !1 ? !1 : !u.canUpdate && u.canDrop ? !0 : !i.value && u.editing && u.httpSuccessRead), I = k(() => u.mode === A.Create && u.createButton === !1 || u.mode === A.Update && u.updateButton === !1 || i.value ? !1 : u.editing && u.httpSuccessRead), ae = k(() => u.editModeButton === !1 || !u.canSwitchEditMode || !u.canUpdate && !u.canDrop || !u.canUpdate && u.canDrop ? !1 : !i.value && u.mode !== A.Create && u.httpSuccessRead), J = k(() => u.buttonNavVisibility === Ke.Always || y["prev-buttons-ever"] ? !0 : u.buttonNavVisibility === Ke.Never ? !1 : I.value || W.value || ae.value), G = k(() => 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 = h(() => {
102
+ ] : Array.isArray(u.modificationView) ? u.modificationView : []), re = k(() => {
103
103
  let t = [];
104
104
  return G.value.includes(S.Current) && t.push({
105
105
  text: "Current",
@@ -140,17 +140,17 @@ const V = (...$) => {
140
140
  }), t;
141
141
  });
142
142
  return (t, L) => {
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 }, [
143
+ var _, de, N, q;
144
+ const r = me("lkt-button");
145
+ return J.value ? (n(), w("div", ct, [
146
+ t.grouped && t.groupButtonAsModalActions ? (n(), w(F, { key: 0 }, [
147
147
  ae.value ? (n(), m(r, f({ key: 0 }, t.editModeButton, {
148
148
  checked: E.value,
149
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(), m(r, Ce(f({ key: 1 }, {
153
- type: d(Oe).Tooltip,
152
+ G.value.length > 0 ? (n(), m(r, De(f({ key: 1 }, {
153
+ type: d(Le).Tooltip,
154
154
  icon: "lkt-icn-cross-arrows",
155
155
  class: "lkt-item-crud--modifications-button",
156
156
  splitButtons: re.value,
@@ -158,7 +158,7 @@ const V = (...$) => {
158
158
  contentClass: "lkt-flex-column"
159
159
  }
160
160
  })), null, 16)) : B("", !0),
161
- (n(!0), w(j, null, H(t.navStartButtons, (v) => C((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
161
+ (n(!0), w(F, 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,7 +167,7 @@ const V = (...$) => {
167
167
  canDrop: t.canDrop,
168
168
  perms: t.perms
169
169
  }) : B("", !0),
170
- (n(!0), w(j, null, H(t.navStartButtonsEditing, (v) => C((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
170
+ (n(!0), w(F, null, H(t.navStartButtonsEditing, (v) => C((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
171
171
  [D, E.value && !i.value]
172
172
  ])), 256)),
173
173
  d(y)["prev-buttons"] ? T(t.$slots, "prev-buttons", {
@@ -187,7 +187,7 @@ const V = (...$) => {
187
187
  },
188
188
  disabled: !t.ableToUpdate
189
189
  }, {
190
- onLoading: k,
190
+ onLoading: h,
191
191
  onLoaded: U,
192
192
  onClick: Y
193
193
  }), null, 16), [
@@ -204,7 +204,7 @@ const V = (...$) => {
204
204
  },
205
205
  disabled: !t.ableToCreate
206
206
  }, {
207
- onLoading: k,
207
+ onLoading: h,
208
208
  onLoaded: U,
209
209
  onClick: te
210
210
  }), null, 16), [
@@ -215,17 +215,17 @@ const V = (...$) => {
215
215
  ref: s
216
216
  }, t.dropButton, {
217
217
  disabled: !t.ableToDrop,
218
- onLoading: k,
218
+ onLoading: h,
219
219
  onLoaded: U,
220
- onClick: F
220
+ onClick: P
221
221
  }), null, 16, ["disabled"]), [
222
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), w(j, null, H(t.navEndButtons, (v) => C((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
225
+ (n(!0), w(F, 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), w(j, null, H(t.navEndButtonsEditing, (v) => C((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
228
+ (n(!0), w(F, null, H(t.navEndButtonsEditing, (v) => C((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
229
229
  [D, E.value && !i.value]
230
230
  ])), 256))
231
231
  ], 64)) : t.grouped ? (n(), m(r, f({
@@ -237,11 +237,11 @@ const V = (...$) => {
237
237
  return [
238
238
  ae.value ? (n(), m(r, f({ key: 0 }, t.editModeButton, {
239
239
  checked: E.value,
240
- "onUpdate:checked": L[1] || (L[1] = (N) => E.value = N),
240
+ "onUpdate:checked": L[1] || (L[1] = (j) => E.value = j),
241
241
  class: "lkt-item-crud--switch-mode-button"
242
242
  }), null, 16, ["checked"])) : B("", !0),
243
- G.value.length > 0 ? (n(), m(r, Ce(f({ key: 1 }, {
244
- type: d(Oe).Tooltip,
243
+ G.value.length > 0 ? (n(), m(r, De(f({ key: 1 }, {
244
+ type: d(Le).Tooltip,
245
245
  icon: "lkt-icn-cross-arrows",
246
246
  class: "lkt-item-crud--modifications-button",
247
247
  splitButtons: re.value,
@@ -249,7 +249,7 @@ const V = (...$) => {
249
249
  contentClass: "lkt-flex-column"
250
250
  }
251
251
  })), null, 16)) : B("", !0),
252
- (n(!0), w(j, null, H(t.navStartButtons, (N) => C((n(), m(r, f({ ref_for: !0 }, N), null, 16)), [
252
+ (n(!0), w(F, null, H(t.navStartButtons, (j) => C((n(), m(r, f({ ref_for: !0 }, j), null, 16)), [
253
253
  [D, !i.value]
254
254
  ])), 256)),
255
255
  d(y)["prev-buttons-ever"] ? T(t.$slots, "prev-buttons-ever", {
@@ -258,7 +258,7 @@ const V = (...$) => {
258
258
  canDrop: t.canDrop,
259
259
  perms: t.perms
260
260
  }) : B("", !0),
261
- (n(!0), w(j, null, H(t.navStartButtonsEditing, (N) => C((n(), m(r, f({ ref_for: !0 }, N), null, 16)), [
261
+ (n(!0), w(F, null, H(t.navStartButtonsEditing, (j) => C((n(), m(r, f({ ref_for: !0 }, j), null, 16)), [
262
262
  [D, E.value && !i.value]
263
263
  ])), 256)),
264
264
  d(y)["prev-buttons"] ? T(t.$slots, "prev-buttons", {
@@ -278,7 +278,7 @@ const V = (...$) => {
278
278
  },
279
279
  disabled: !t.ableToUpdate
280
280
  }, {
281
- onLoading: k,
281
+ onLoading: h,
282
282
  onLoaded: U,
283
283
  onClick: Y
284
284
  }), null, 16), [
@@ -296,7 +296,7 @@ const V = (...$) => {
296
296
  disabled: !t.ableToCreate
297
297
  }, {
298
298
  disabled: !t.ableToCreate,
299
- onLoading: k,
299
+ onLoading: h,
300
300
  onLoaded: U,
301
301
  onClick: te
302
302
  }), null, 16, ["disabled"]), [
@@ -307,27 +307,27 @@ const V = (...$) => {
307
307
  ref: s
308
308
  }, t.dropButton, {
309
309
  disabled: !t.ableToDrop,
310
- onLoading: k,
310
+ onLoading: h,
311
311
  onLoaded: U,
312
- onClick: F
312
+ onClick: P
313
313
  }), null, 16, ["disabled"]), [
314
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), w(j, null, H(t.navEndButtons, (N) => C((n(), m(r, f({ ref_for: !0 }, N), null, 16)), [
317
+ (n(!0), w(F, null, H(t.navEndButtons, (j) => C((n(), m(r, f({ ref_for: !0 }, j), null, 16)), [
318
318
  [D, !i.value]
319
319
  ])), 256)),
320
- (n(!0), w(j, null, H(t.navEndButtonsEditing, (N) => C((n(), m(r, f({ ref_for: !0 }, N), null, 16)), [
320
+ (n(!0), w(F, null, H(t.navEndButtonsEditing, (j) => C((n(), m(r, f({ ref_for: !0 }, j), null, 16)), [
321
321
  [D, E.value && !i.value]
322
322
  ])), 256))
323
323
  ];
324
324
  }),
325
325
  _: 3
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)), [
326
+ }, 16)) : (n(), w(F, { key: 2 }, [
327
+ (n(!0), w(F, 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(), w("div", ct, [
330
+ d(y)["prev-buttons-ever"] ? C((n(), w("div", mt, [
331
331
  T(t.$slots, "prev-buttons-ever", {
332
332
  canUpdate: t.canUpdate,
333
333
  canDrop: t.canDrop,
@@ -336,10 +336,10 @@ const V = (...$) => {
336
336
  ], 512)), [
337
337
  [D, !i.value]
338
338
  ]) : B("", !0),
339
- (n(!0), w(j, null, H(t.navStartButtonsEditing, (v) => C((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
339
+ (n(!0), w(F, null, H(t.navStartButtonsEditing, (v) => C((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
340
340
  [D, E.value && !i.value]
341
341
  ])), 256)),
342
- d(y)["prev-buttons"] ? C((n(), w("div", mt, [
342
+ d(y)["prev-buttons"] ? C((n(), w("div", bt, [
343
343
  T(t.$slots, "prev-buttons", {
344
344
  canUpdate: t.canUpdate,
345
345
  canDrop: t.canDrop,
@@ -354,12 +354,12 @@ const V = (...$) => {
354
354
  }, {
355
355
  ...t.updateButton,
356
356
  resourceData: {
357
- ...(P = t.updateButton) == null ? void 0 : P.resourceData,
357
+ ...(N = t.updateButton) == null ? void 0 : N.resourceData,
358
358
  ...K.value
359
359
  },
360
360
  disabled: !t.ableToUpdate
361
361
  }, {
362
- onLoading: k,
362
+ onLoading: h,
363
363
  onLoaded: U,
364
364
  onClick: Y
365
365
  }), null, 16), [
@@ -376,7 +376,7 @@ const V = (...$) => {
376
376
  },
377
377
  disabled: !t.ableToCreate
378
378
  }, {
379
- onLoading: k,
379
+ onLoading: h,
380
380
  onLoaded: U,
381
381
  onClick: te
382
382
  }), null, 16), [
@@ -387,25 +387,25 @@ const V = (...$) => {
387
387
  ref: s
388
388
  }, t.dropButton, {
389
389
  disabled: !t.ableToDrop,
390
- onLoading: k,
390
+ onLoading: h,
391
391
  onLoaded: U,
392
- onClick: F
392
+ onClick: P
393
393
  }), null, 16, ["disabled"]), [
394
394
  [D, W.value && t.mode !== d(A).Create]
395
395
  ]),
396
- d(y).buttons ? C((n(), w("div", bt, [
396
+ d(y).buttons ? C((n(), w("div", gt, [
397
397
  T(t.$slots, "buttons")
398
398
  ], 512)), [
399
399
  [D, E.value && !i.value]
400
400
  ]) : B("", !0),
401
- (n(!0), w(j, null, H(t.navEndButtons, (v) => C((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
401
+ (n(!0), w(F, 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), w(j, null, H(t.navEndButtonsEditing, (v) => C((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
404
+ (n(!0), w(F, null, H(t.navEndButtonsEditing, (v) => C((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
405
405
  [D, E.value && !i.value]
406
406
  ])), 256)),
407
- G.value.length > 0 ? (n(), m(r, Ce(f({ key: 3 }, {
408
- type: d(Oe).Tooltip,
407
+ G.value.length > 0 ? (n(), m(r, De(f({ key: 3 }, {
408
+ type: d(Le).Tooltip,
409
409
  icon: "lkt-icn-cross-arrows",
410
410
  class: "lkt-item-crud--modifications-button",
411
411
  splitButtons: re.value,
@@ -422,33 +422,33 @@ const V = (...$) => {
422
422
  ])) : B("", !0);
423
423
  };
424
424
  }
425
- }), gt = {
425
+ }), Bt = {
426
426
  key: 1,
427
427
  class: "lkt-item-crud_header"
428
- }, Bt = {
428
+ }, yt = {
429
429
  key: 0,
430
430
  class: "lkt-item-crud_header-slot"
431
- }, yt = {
431
+ }, kt = {
432
432
  key: 1,
433
433
  class: "lkt-item-crud_header-title"
434
- }, kt = {
434
+ }, ht = {
435
435
  key: 2,
436
436
  class: "lkt-item-crud_header-slot"
437
- }, ht = {
437
+ }, Ct = {
438
438
  key: 3,
439
439
  class: "lkt-item-crud_content"
440
- }, Ct = {
440
+ }, Dt = {
441
441
  key: 0,
442
442
  class: "lkt-grid-1"
443
- }, Dt = /* @__PURE__ */ We({
443
+ }, wt = /* @__PURE__ */ Ge({
444
444
  __name: "LktItemCrud",
445
- props: /* @__PURE__ */ et({
445
+ props: /* @__PURE__ */ tt({
446
446
  modelValue: {},
447
447
  modifications: {},
448
448
  editing: { type: Boolean },
449
449
  perms: {},
450
450
  customData: {},
451
- form: {},
451
+ form: { type: [Object, Function] },
452
452
  formUiConfig: {},
453
453
  mode: {},
454
454
  view: {},
@@ -480,7 +480,7 @@ const V = (...$) => {
480
480
  navEndButtons: {},
481
481
  navEndButtonsEditing: {},
482
482
  events: {}
483
- }, lt(rt)),
483
+ }, rt(dt)),
484
484
  emits: [
485
485
  "update:modelValue",
486
486
  "update:editing",
@@ -497,17 +497,17 @@ const V = (...$) => {
497
497
  "error",
498
498
  "modified-data"
499
499
  ],
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);
500
+ setup($, { expose: ge, emit: we }) {
501
+ const a = $, u = ft(), M = qe(), y = we, c = p(!0), s = p(a.modelValue), i = p(a.modifications), E = p(a.customData), h = p(a.perms), U = p(a.editing), te = p(!1), Y = p(!1), P = p(!1), K = p(!1), Z = p(200), O = p(new Oe(s.value, a.dataStateConfig)), W = p(new Oe(i.value, a.dataStateConfig)), I = p(!1), ae = p(new Oe(a.readData)), J = p(a.mode === A.Create), G = p(!1), re = p(!1), t = p(null), L = p(null), r = k(() => !J.value && a.updateButton !== !1 && Array.isArray(h.value) && h.value.includes($e.Update)), _ = k(() => !J.value && a.dropButton !== !1 && Array.isArray(h.value) && h.value.includes($e.Drop)), de = k(() => a.editModeButton !== !1 && !J.value && Array.isArray(h.value) && h.value.includes($e.SwitchEditMode)), N = p(a.visibleView);
502
502
  g(() => a.visibleView, (e) => {
503
- P.value = e;
504
- }), g(P, (e) => {
503
+ N.value = e;
504
+ }), g(N, (e) => {
505
505
  y("update:visibleView", e);
506
506
  }), g(() => a.mode, (e) => {
507
507
  J.value = e === A.Create;
508
508
  }), g(() => a.perms, (e) => {
509
- k.value = e;
510
- }), g(k, (e) => {
509
+ h.value = e;
510
+ }), g(h, (e) => {
511
511
  y("update:perms", e);
512
512
  }), g(() => a.customData, (e) => {
513
513
  E.value = e;
@@ -516,9 +516,9 @@ const V = (...$) => {
516
516
  }), g(() => a.modifications, (e) => {
517
517
  W.value.increment(e), i.value = e;
518
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
+ Ue(), W.value.increment(e), ue.value === S.Modifications && (I.value = W.value.changed()), y("update:modifications", e);
520
520
  }, { deep: !0 });
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));
521
+ const q = p(ee(a.createButton, b.defaultCreateButton)), v = p(ee(a.updateButton, b.defaultUpdateButton)), z = p(ee(a.dropButton, b.defaultDropButton)), j = p(ee(a.editModeButton, b.defaultEditModeButton)), Se = p(ee(a.groupButton, b.defaultGroupButton));
522
522
  g(() => a.createButton, (e) => {
523
523
  q.value = ee(e, b.defaultCreateButton);
524
524
  }, { deep: !0 }), g(() => a.updateButton, (e) => {
@@ -526,31 +526,31 @@ const V = (...$) => {
526
526
  }, { deep: !0 }), g(() => a.dropButton, (e) => {
527
527
  z.value = ee(e, b.defaultDropButton);
528
528
  }, { deep: !0 }), g(() => a.editModeButton, (e) => {
529
- N.value = ee(e, b.defaultEditModeButton);
529
+ j.value = ee(e, b.defaultEditModeButton);
530
530
  }, { deep: !0 });
531
- const ge = async () => {
531
+ const Be = async () => {
532
532
  var e, o, X;
533
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();
534
534
  try {
535
- const R = await nt(a.readResource, a.readData);
535
+ const R = await ut(a.readResource, a.readData);
536
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
+ P.value = !1, Z.value = R.httpStatus, typeof ((o = a.events) == null ? void 0 : o.httpEnd) == "function" && a.events.httpEnd({
538
538
  httpResponse: R
539
539
  }), y("error", R.httpStatus);
540
540
  return;
541
541
  }
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
+ P.value = !0, s.value = R.data, i.value = Array.isArray(R.modifications) ? {} : R.modifications, h.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 && (N.value = S.Modifications), oe.value && (Ue(), He(() => {
543
543
  L.value.turnStoredIntoOriginal();
544
544
  })), typeof ((X = a.events) == null ? void 0 : X.httpEnd) == "function" && a.events.httpEnd({
545
545
  httpResponse: R
546
546
  }), y("read", R);
547
547
  } catch {
548
- c.value = !1, F.value = !1, Z.value = 404, y("error", 404);
548
+ c.value = !1, P.value = !1, Z.value = 404, y("error", 404);
549
549
  return;
550
550
  }
551
551
  };
552
552
  g(G, (e) => {
553
- e && Xe(() => G.value = !1);
553
+ e && He(() => G.value = !1);
554
554
  }), g(() => a.modelValue, (e) => {
555
555
  s.value = e, O.value.increment(e);
556
556
  }, { deep: !0 }), g(s, (e) => {
@@ -559,37 +559,37 @@ const V = (...$) => {
559
559
  let o = a.beforeEmitUpdate(s.value);
560
560
  V("item updated -> override with: ", o), typeof o == "object" && (s.value = o);
561
561
  }
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) => {
562
+ oe.value && Ue(), 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(h, () => y("perms", h.value)), g(I, (e) => {
564
564
  y("modified-data", e);
565
565
  }), g(() => a.readData, (e) => {
566
- ae.value.increment(e), ae.value.changed() && ge();
566
+ ae.value.increment(e), ae.value.changed() && Be();
567
567
  }), g(() => a.editing, (e) => {
568
568
  V("editing updated -> updating editMode", e), U.value = e;
569
569
  }), g(U, (e) => {
570
570
  V("editMode updated -> emit update", e), y("update:editing", e);
571
571
  });
572
- const je = p(void 0), Se = () => {
573
- oe.value && (je.value = ut(s.value, i.value, a.form));
572
+ const Fe = p(void 0), Ue = () => {
573
+ oe.value && (Fe.value = it(s.value, i.value, fe.value));
574
574
  };
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());
575
+ at(() => {
576
+ 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());
577
577
  });
578
- const Ue = (e, o) => {
578
+ const Me = (e, o) => {
579
579
  if (o) {
580
580
  if (c.value = !1, typeof e < "u" && (Z.value = e.httpStatus, !e.success))
581
581
  return K.value = !0, y("error", e.httpStatus), !1;
582
582
  K.value = !0;
583
583
  }
584
584
  return !0;
585
- }, Fe = (e, o) => {
585
+ }, Pe = (e, o) => {
586
586
  if (V("doAutoReloadId -> enter: ", e), typeof e < "u" && e.autoReloadId)
587
587
  if (V("doAutoReloadId -> autoReloadId detected: ", e.autoReloadId), typeof o < "u") {
588
588
  let X = o;
589
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)) {
590
+ } else ye.value ? (V("doAutoReloadId -> insideModal: ", a), vt(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());
591
+ }, Ee = (e, o) => {
592
+ if (V("onCreate"), !Me(o, q.value.resource)) {
593
593
  a.notificationType === ne.Toast && ve({
594
594
  text: b.defaultCreateErrorText,
595
595
  details: b.defaultCreateErrorDetails,
@@ -603,9 +603,9 @@ const V = (...$) => {
603
603
  details: b.defaultCreateSuccessDetails,
604
604
  icon: b.defaultCreateSuccessIcon,
605
605
  positionX: se.Right
606
- }), Fe(o, a.redirectOnCreate), V("onCreate -> beforeEmitCreate"), y("create", o);
607
- }, Ee = (e, o) => {
608
- if (V("onUpdate"), !Ue(o, v.value.resource)) {
606
+ }), Pe(o, a.redirectOnCreate), V("onCreate -> beforeEmitCreate"), y("create", o);
607
+ }, Ve = (e, o) => {
608
+ if (V("onUpdate"), !Me(o, v.value.resource)) {
609
609
  a.notificationType === ne.Toast && ve({
610
610
  text: b.defaultUpdateErrorText,
611
611
  details: b.defaultUpdateErrorDetails,
@@ -619,9 +619,9 @@ const V = (...$) => {
619
619
  details: b.defaultUpdateSuccessDetails,
620
620
  icon: b.defaultUpdateSuccessIcon,
621
621
  positionX: se.Right
622
- }), Fe(o), y("update", o);
623
- }, Ve = (e, o) => {
624
- if (V("onDrop"), !Ue(o, z.value.resource)) {
622
+ }), Pe(o), y("update", o);
623
+ }, Ie = (e, o) => {
624
+ if (V("onDrop"), !Me(o, z.value.resource)) {
625
625
  a.notificationType === ne.Toast && ve({
626
626
  text: b.defaultDropErrorText,
627
627
  details: b.defaultDropErrorDetails,
@@ -635,16 +635,16 @@ const V = (...$) => {
635
635
  details: b.defaultDropSuccessDetails,
636
636
  icon: b.defaultDropSuccessIcon,
637
637
  positionX: se.Right
638
- }), y("drop", o), a.view === Ke.Modal && (V("onDrop -> close modal"), dt(a.modalConfig.modalName, a.modalConfig.modalKey)), typeof a.redirectOnDrop < "u") {
638
+ }), y("drop", o), a.view === We.Modal && (V("onDrop -> close modal"), st(a.modalConfig.modalName, a.modalConfig.modalKey)), typeof a.redirectOnDrop < "u") {
639
639
  let X = a.redirectOnDrop;
640
640
  typeof a.redirectOnDrop == "function" && (X = a.redirectOnDrop()), u.push(X);
641
641
  }
642
642
  };
643
- be({
643
+ ge({
644
644
  doDrop: () => {
645
645
  t.value && t.value.doDrop();
646
646
  },
647
- doRefresh: ge,
647
+ doRefresh: Be,
648
648
  doSave: () => {
649
649
  t.value && t.value.doSave();
650
650
  },
@@ -653,61 +653,64 @@ const V = (...$) => {
653
653
  },
654
654
  hasModifiedData: () => O.value.changed()
655
655
  });
656
- const qe = h(() => {
656
+ const ze = k(() => {
657
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 : "" : "";
659
- }), ze = (e) => {
658
+ return Ce.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 : "" : "";
659
+ }), Je = (e) => {
660
660
  var o;
661
661
  if (typeof ((o = a.modalConfig) == null ? void 0 : o.beforeClose) == "function")
662
662
  return a.modalConfig.beforeClose({
663
663
  ...e,
664
664
  itemCreated: re.value
665
665
  });
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
+ }, Te = k(() => a.title.startsWith("__:") ? String(pt(a.title.substring(3))) : a.title), Qe = k(() => c.value ? !1 : Te.value.length > 0 || !!M["post-title"]), Ye = k(() => c.value ? !1 : typeof a.header == "object" && Object.keys(a.header).length > 0), ye = k(() => a.view === We.Modal), Xe = k(() => ye.value ? "lkt-modal" : "section"), ke = k(() => {
667
667
  var e, o;
668
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({
669
669
  prop: s.value
670
670
  }) : typeof ((o = v.value) == null ? void 0 : o.disabled) == "boolean" ? !v.value.disabled : !0;
671
- }), ke = h(() => {
671
+ }), he = k(() => {
672
672
  var e, o;
673
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({
674
674
  prop: s.value
675
675
  }) : typeof ((o = q.value) == null ? void 0 : o.disabled) == "boolean" ? !q.value.disabled : !0;
676
- }), Te = h(() => {
676
+ }), Re = k(() => {
677
677
  var e, o;
678
678
  return _.value ? typeof ((e = z.value) == null ? void 0 : e.disabled) == "function" ? !z.value.disabled({
679
679
  prop: s.value
680
680
  }) : typeof ((o = z.value) == null ? void 0 : o.disabled) == "boolean" ? !z.value.disabled : !0 : !1;
681
- }), Ye = h(() => Pe.value === "lkt-modal" ? {
681
+ }), Ze = k(() => Xe.value === "lkt-modal" ? {
682
682
  title: a.title,
683
683
  item: s.value,
684
684
  ...a.modalConfig,
685
- beforeClose: ze,
686
- closeConfirm: qe.value,
685
+ beforeClose: Je,
686
+ closeConfirm: ze.value,
687
687
  headerActionsButton: a.groupButton !== !1 ? {
688
- dot: ke.value || ye.value
688
+ dot: he.value || ke.value
689
689
  } : !1
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
+ } : {}), oe = k(() => typeof fe.value == "object" && Object.keys(fe.value).length > 0), Ae = k(() => Object.keys(i.value).length === 0 ? [] : a.modificationViews), ue = k(() => Object.keys(i.value).length === 0 ? S.Current : S.Modifications), Ce = k(() => J.value || r.value || _.value), _e = k(() => oe.value ? lt(fe.value) : []), fe = k(() => typeof a.form == "function" ? a.form({
691
+ mode: a.mode,
692
+ view: N.value
693
+ }) : a.form);
691
694
  return (e, o) => {
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({
695
+ const X = me("lkt-header"), R = me("lkt-http-info"), xe = me("lkt-form"), et = me("lkt-loader");
696
+ return n(), m(ot(Xe.value), f(Ze.value, { class: "lkt-item-crud" }), ce({
694
697
  default: Q(() => [
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, [
698
+ !ye.value && Ye.value ? (n(), m(X, De(f({ key: 0 }, e.header)), null, 16)) : !ye.value && Qe.value ? (n(), w("header", Bt, [
699
+ d(M)["pre-title"] ? (n(), w("div", yt, [
697
700
  T(e.$slots, "pre-title", {
698
701
  item: s.value,
699
702
  loading: c.value
700
703
  })
701
704
  ])) : B("", !0),
702
- Ie.value.length > 0 ? (n(), w("h1", yt, ot(Ie.value), 1)) : B("", !0),
703
- d(M)["post-title"] ? (n(), w("div", kt, [
705
+ Te.value.length > 0 ? (n(), w("h1", kt, nt(Te.value), 1)) : B("", !0),
706
+ d(M)["post-title"] ? (n(), w("div", ht, [
704
707
  T(e.$slots, "post-title", {
705
708
  item: s.value,
706
709
  loading: c.value
707
710
  })
708
711
  ])) : B("", !0)
709
712
  ])) : B("", !0),
710
- e.buttonNavPosition === d($e).Top && (e.groupButton === !1 || !e.groupButtonAsModalActions) && he.value ? (n(), m(Ne, {
713
+ e.buttonNavPosition === d(Ne).Top && (e.groupButton === !1 || !e.groupButtonAsModalActions) && Ce.value ? (n(), m(je, {
711
714
  key: 2,
712
715
  ref_key: "buttonNav",
713
716
  ref: t,
@@ -715,8 +718,8 @@ const V = (...$) => {
715
718
  "onUpdate:loading": o[3] || (o[3] = (l) => c.value = l),
716
719
  editing: U.value,
717
720
  "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),
721
+ "picked-modification-view": N.value,
722
+ "onUpdate:pickedModificationView": o[5] || (o[5] = (l) => N.value = l),
720
723
  item: s.value,
721
724
  modifications: i.value,
722
725
  mode: e.mode,
@@ -726,28 +729,28 @@ const V = (...$) => {
726
729
  "create-button": q.value,
727
730
  "update-button": v.value,
728
731
  "drop-button": z.value,
729
- "edit-mode-button": N.value,
730
- "group-button": we.value,
732
+ "edit-mode-button": j.value,
733
+ "group-button": Se.value,
731
734
  "data-changed": I.value,
732
- "http-success-read": F.value,
735
+ "http-success-read": P.value,
733
736
  "can-update": r.value,
734
737
  "can-drop": _.value,
735
738
  "can-switch-edit-mode": de.value,
736
739
  "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,
740
+ "able-to-create": he.value,
741
+ "able-to-update": ke.value,
742
+ "able-to-drop": Re.value,
743
+ perms: h.value,
744
+ "modification-view": Ae.value,
742
745
  "editable-view": ue.value,
743
746
  "nav-start-buttons": e.navStartButtons,
744
747
  "nav-start-buttons-editing": e.navStartButtonsEditing,
745
748
  "nav-end-buttons": e.navEndButtons,
746
749
  "nav-end-buttons-editing": e.navEndButtonsEditing,
747
- onCreate: Me,
748
- onSave: Ee,
749
- onDrop: Ve
750
- }, fe({ _: 2 }, [
750
+ onCreate: Ee,
751
+ onSave: Ve,
752
+ onDrop: Ie
753
+ }, ce({ _: 2 }, [
751
754
  d(M)["prev-buttons-ever"] ? {
752
755
  name: "prev-buttons-ever",
753
756
  fn: Q(({ canUpdate: l, canDrop: ie, perms: le }) => [
@@ -771,8 +774,8 @@ const V = (...$) => {
771
774
  key: "1"
772
775
  } : void 0
773
776
  ]), 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, [
777
+ c.value ? B("", !0) : (n(), w("div", Ct, [
778
+ P.value ? (n(), w("div", Dt, [
776
779
  K.value && e.notificationType === d(ne).Inline ? (n(), m(R, {
777
780
  key: 0,
778
781
  code: Z.value,
@@ -781,7 +784,7 @@ const V = (...$) => {
781
784
  "can-close": "",
782
785
  onClose: o[6] || (o[6] = (l) => K.value = !1)
783
786
  }, null, 8, ["code", "palette"])) : B("", !0),
784
- oe.value ? (n(), m(_e, f({
787
+ oe.value ? (n(), m(xe, f({
785
788
  key: 1,
786
789
  ref_key: "formRef",
787
790
  ref: L,
@@ -795,14 +798,14 @@ const V = (...$) => {
795
798
  "onUpdate:changed": o[10] || (o[10] = (l) => Y.value = l)
796
799
  }, {
797
800
  ...e.formUiConfig,
798
- form: e.form,
801
+ form: fe.value,
799
802
  differencesTableConfig: e.differencesTableConfig,
800
- visibleView: P.value,
801
- modificationDataState: je.value,
803
+ visibleView: N.value,
804
+ modificationDataState: Fe.value,
802
805
  editableViews: [ue.value],
803
806
  disabled: !U.value
804
- }), fe({ _: 2 }, [
805
- H(Ze.value, (l) => ({
807
+ }), ce({ _: 2 }, [
808
+ H(_e.value, (l) => ({
806
809
  name: l,
807
810
  fn: Q(({}) => [
808
811
  T(e.$slots, l)
@@ -817,15 +820,15 @@ const V = (...$) => {
817
820
  canUpdate: r.value,
818
821
  canDrop: _.value,
819
822
  itemBeingEdited: G.value,
820
- perms: k.value
823
+ perms: h.value
821
824
  })
822
825
  ])) : e.notificationType === d(ne).Inline ? (n(), m(R, {
823
826
  key: 1,
824
827
  code: Z.value
825
828
  }, null, 8, ["code"])) : B("", !0)
826
829
  ])),
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, {
830
+ c.value ? (n(), m(et, { key: 4 })) : B("", !0),
831
+ e.buttonNavPosition === d(Ne).Bottom && (e.groupButton === !1 || !e.groupButtonAsModalActions) && Ce.value ? (n(), m(je, {
829
832
  key: 5,
830
833
  ref_key: "buttonNav",
831
834
  ref: t,
@@ -833,8 +836,8 @@ const V = (...$) => {
833
836
  "onUpdate:loading": o[11] || (o[11] = (l) => c.value = l),
834
837
  editing: U.value,
835
838
  "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),
839
+ "picked-modification-view": N.value,
840
+ "onUpdate:pickedModificationView": o[13] || (o[13] = (l) => N.value = l),
838
841
  item: s.value,
839
842
  modifications: i.value,
840
843
  mode: e.mode,
@@ -844,28 +847,28 @@ const V = (...$) => {
844
847
  "create-button": q.value,
845
848
  "update-button": v.value,
846
849
  "drop-button": z.value,
847
- "edit-mode-button": N.value,
848
- "group-button": we.value,
850
+ "edit-mode-button": j.value,
851
+ "group-button": Se.value,
849
852
  "data-changed": I.value,
850
- "http-success-read": F.value,
853
+ "http-success-read": P.value,
851
854
  "can-update": r.value,
852
855
  "can-drop": _.value,
853
856
  "can-switch-edit-mode": de.value,
854
857
  "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,
858
+ "able-to-create": he.value,
859
+ "able-to-update": ke.value,
860
+ "able-to-drop": Re.value,
861
+ perms: h.value,
862
+ "modification-view": Ae.value,
860
863
  "editable-view": ue.value,
861
864
  "nav-start-buttons": e.navStartButtons,
862
865
  "nav-start-buttons-editing": e.navStartButtonsEditing,
863
866
  "nav-end-buttons": e.navEndButtons,
864
867
  "nav-end-buttons-editing": e.navEndButtonsEditing,
865
- onCreate: Me,
866
- onSave: Ee,
867
- onDrop: Ve
868
- }, fe({ _: 2 }, [
868
+ onCreate: Ee,
869
+ onSave: Ve,
870
+ onDrop: Ie
871
+ }, ce({ _: 2 }, [
869
872
  d(M)["prev-buttons-ever"] ? {
870
873
  name: "prev-buttons-ever",
871
874
  fn: Q(() => [
@@ -884,10 +887,10 @@ const V = (...$) => {
884
887
  ]),
885
888
  _: 2
886
889
  }, [
887
- e.groupButton !== !1 && e.groupButtonAsModalActions && he.value ? {
890
+ e.groupButton !== !1 && e.groupButtonAsModalActions && Ce.value ? {
888
891
  name: "header-actions",
889
892
  fn: Q(() => [
890
- e.buttonNavPosition === d($e).Top ? (n(), m(Ne, {
893
+ e.buttonNavPosition === d(Ne).Top ? (n(), m(je, {
891
894
  key: 0,
892
895
  ref_key: "buttonNav",
893
896
  ref: t,
@@ -895,8 +898,8 @@ const V = (...$) => {
895
898
  "onUpdate:loading": o[0] || (o[0] = (l) => c.value = l),
896
899
  editing: U.value,
897
900
  "onUpdate:editing": o[1] || (o[1] = (l) => U.value = l),
898
- "picked-modification-view": P.value,
899
- "onUpdate:pickedModificationView": o[2] || (o[2] = (l) => P.value = l),
901
+ "picked-modification-view": N.value,
902
+ "onUpdate:pickedModificationView": o[2] || (o[2] = (l) => N.value = l),
900
903
  item: s.value,
901
904
  modifications: i.value,
902
905
  mode: e.mode,
@@ -906,28 +909,28 @@ const V = (...$) => {
906
909
  "create-button": q.value,
907
910
  "update-button": v.value,
908
911
  "drop-button": z.value,
909
- "edit-mode-button": N.value,
910
- "group-button": we.value,
912
+ "edit-mode-button": j.value,
913
+ "group-button": Se.value,
911
914
  "data-changed": I.value,
912
- "http-success-read": F.value,
915
+ "http-success-read": P.value,
913
916
  "can-update": r.value,
914
917
  "can-drop": _.value,
915
918
  "can-switch-edit-mode": de.value,
916
919
  "group-button-as-modal-actions": e.groupButtonAsModalActions,
917
- "able-to-create": ke.value,
918
- "able-to-update": ye.value,
919
- "able-to-drop": Te.value,
920
- perms: k.value,
921
- "modification-view": Re.value,
920
+ "able-to-create": he.value,
921
+ "able-to-update": ke.value,
922
+ "able-to-drop": Re.value,
923
+ perms: h.value,
924
+ "modification-view": Ae.value,
922
925
  "editable-view": ue.value,
923
926
  "nav-start-buttons": e.navStartButtons,
924
927
  "nav-start-buttons-editing": e.navStartButtonsEditing,
925
928
  "nav-end-buttons": e.navEndButtons,
926
929
  "nav-end-buttons-editing": e.navEndButtonsEditing,
927
- onCreate: Me,
928
- onSave: Ee,
929
- onDrop: Ve
930
- }, fe({ _: 2 }, [
930
+ onCreate: Ee,
931
+ onSave: Ve,
932
+ onDrop: Ie
933
+ }, ce({ _: 2 }, [
931
934
  d(M)["prev-buttons-ever"] ? {
932
935
  name: "prev-buttons-ever",
933
936
  fn: Q(({ canUpdate: l, canDrop: ie, perms: le }) => [
@@ -957,18 +960,18 @@ const V = (...$) => {
957
960
  ]), 1040);
958
961
  };
959
962
  }
960
- }), Lt = {
961
- install: ($, be = {}) => {
962
- $.component("lkt-item-crud") === void 0 && $.component("lkt-item-crud", Dt);
963
+ }), $t = {
964
+ install: ($, ge = {}) => {
965
+ $.component("lkt-item-crud") === void 0 && $.component("lkt-item-crud", wt);
963
966
  }
964
- }, $t = ($) => {
965
- pe.defaultSaveIcon = $;
966
967
  }, Nt = ($) => {
968
+ pe.defaultSaveIcon = $;
969
+ }, jt = ($) => {
967
970
  pe.defaultDropIcon = $;
968
971
  };
969
972
  export {
970
- Ot as debugLktItemCrud,
971
- Lt as default,
972
- Nt as setItemCrudDefaultDropIcon,
973
- $t as setItemCrudDefaultSaveIcon
973
+ Lt as debugLktItemCrud,
974
+ $t as default,
975
+ jt as setItemCrudDefaultDropIcon,
976
+ Nt as setItemCrudDefaultSaveIcon
974
977
  };
@@ -90,7 +90,7 @@ declare const __VLS_component: import("vue").DefineComponent<ItemCrudConfig, {
90
90
  "onModified-data"?: ((...args: any[]) => any) | undefined;
91
91
  }>, {
92
92
  view: ItemCrudView;
93
- form: import("lkt-vue-kernel").FormConfig;
93
+ form: import("lkt-vue-kernel").FormConfig | Function;
94
94
  header: import("lkt-vue-kernel").HeaderConfig;
95
95
  title: string;
96
96
  mode: ItemCrudMode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-item-crud",
3
- "version": "2.0.28",
3
+ "version": "2.0.29",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "module": "./dist/build.js",
@@ -252,7 +252,7 @@
252
252
  const formDifferencesChecker = ref(undefined);
253
253
  const resetFormDifferencesChecker = () => {
254
254
  if (computedHasForm.value) {
255
- formDifferencesChecker.value = getFormDataState(item.value, itemModifications.value, props.form);
255
+ formDifferencesChecker.value = getFormDataState(item.value, itemModifications.value, computedForm.value);
256
256
  }
257
257
  }
258
258
 
@@ -520,7 +520,7 @@
520
520
  return {};
521
521
  }),
522
522
  computedHasForm = computed(() => {
523
- return typeof props.form === 'object' && Object.keys(props.form).length > 0;
523
+ return (typeof computedForm.value === 'object' && Object.keys(computedForm.value).length > 0);
524
524
  }),
525
525
  computedModificationViews = computed(() => {
526
526
  if (Object.keys(itemModifications.value).length === 0) return [];
@@ -537,11 +537,17 @@
537
537
  })
538
538
 
539
539
  const computedFormSlots = computed(() => {
540
- if (computedHasForm.value) {
541
- return getFormSlotKeys(props.form);
542
- }
540
+ if (computedHasForm.value) return getFormSlotKeys(computedForm.value);
543
541
  return [];
544
542
  })
543
+
544
+ const computedForm = computed(() => {
545
+ if (typeof props.form === 'function') return props.form({
546
+ mode: props.mode,
547
+ view: pickedModificationView.value,
548
+ });
549
+ return props.form;
550
+ })
545
551
  </script>
546
552
 
547
553
  <template>
@@ -688,7 +694,7 @@
688
694
  v-model:changed="changedForm"
689
695
  v-bind="<FormUiConfig>{
690
696
  ...formUiConfig,
691
- form,
697
+ form: computedForm,
692
698
  differencesTableConfig,
693
699
  visibleView: pickedModificationView,
694
700
  modificationDataState: formDifferencesChecker,