lkt-item-crud 2.0.30 → 2.0.31

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,4 +1,4 @@
1
- import { defineComponent as qe, ref as p, watch as y, useSlots as ze, computed as B, resolveComponent as me, createElementBlock as w, createCommentVNode as k, openBlock as n, createBlock as m, Fragment as F, renderSlot as R, withDirectives as h, mergeProps as f, normalizeProps as Se, unref as d, renderList as H, vShow as D, createVNode as x, withCtx as J, mergeDefaults as at, nextTick as Ke, onMounted as ot, resolveDynamicComponent as nt, createSlots as ce, toDisplayString as ut } from "vue";
1
+ import { defineComponent as qe, ref as p, watch as y, useSlots as ze, computed as B, resolveComponent as me, createElementBlock as w, createCommentVNode as k, openBlock as n, createBlock as m, Fragment as F, renderSlot as R, withDirectives as h, mergeProps as f, normalizeProps as Se, unref as s, renderList as H, vShow as D, createVNode as x, withCtx as J, mergeDefaults as at, nextTick as Ke, onMounted as ot, resolveDynamicComponent as nt, createSlots as ce, toDisplayString as ut } from "vue";
2
2
  import { httpCall as it } from "lkt-http-client";
3
3
  import { DataState as $e } from "lkt-data-state";
4
4
  import { ModificationView as S, ItemCrudMode as O, ItemCrudButtonNavVisibility as We, ButtonType as Ne, TablePermission as we, ensureButtonConfig as ee, LktSettings as g, getFormDataState as lt, ItemCrudView as Ge, getFormSlotKeys as rt, ItemCrudButtonNavPosition as je, NotificationType as ne, getDefaultValues as dt, ItemCrud as st, ToastPositionX as se } from "lkt-vue-kernel";
@@ -72,7 +72,7 @@ const V = (...N) => {
72
72
  setup(N, { expose: ge, emit: Ue }) {
73
73
  const a = Ue, u = N, M = p(u.pickedModificationView);
74
74
  y(() => u.pickedModificationView, (t) => M.value = t), y(M, (t) => a("update:pickedModificationView", t));
75
- const C = ze(), c = p(null), s = p(null), i = p(u.loading);
75
+ const C = ze(), c = p(null), r = p(null), i = p(u.loading);
76
76
  y(() => u.loading, (t) => i.value = t), y(i, (t) => a("update:loading", t));
77
77
  const E = p(u.editing);
78
78
  y(() => u.editing, (t) => E.value = t), y(E, (t) => a("update:editing", t));
@@ -92,7 +92,7 @@ const V = (...N) => {
92
92
  c.value && typeof c.value.click == "function" && c.value.click();
93
93
  },
94
94
  doDrop: () => {
95
- s.value && typeof s.value.click == "function" && s.value.click();
95
+ r.value && typeof r.value.click == "function" && r.value.click();
96
96
  }
97
97
  });
98
98
  const W = B(() => !u.canDrop || u.dropButton === !1 ? !1 : !u.canUpdate && u.canDrop ? !0 : !i.value && u.editing && u.httpSuccessRead), I = B(() => u.mode === O.Create && (u.createButton === !1 || !u.canCreate) || u.mode === O.Update && (u.updateButton === !1 || !u.canUpdate) || i.value ? !1 : u.editing && u.httpSuccessRead), ae = B(() => u.editModeButton === !1 || !u.canSwitchEditMode || !u.canUpdate && !u.canDrop || !u.canUpdate && u.canDrop ? !1 : !i.value && u.mode !== O.Create && u.httpSuccessRead), z = B(() => u.buttonNavVisibility === We.Always || C["prev-buttons-ever"] ? !0 : u.buttonNavVisibility === We.Never ? !1 : I.value || W.value || ae.value), G = B(() => u.modificationView === !1 ? [] : u.modificationView === !0 ? [
@@ -142,16 +142,16 @@ const V = (...N) => {
142
142
  });
143
143
  return (t, $) => {
144
144
  var Z, _, de, j;
145
- const r = me("lkt-button");
145
+ const d = me("lkt-button");
146
146
  return z.value ? (n(), w("div", mt, [
147
147
  t.grouped && t.groupButtonAsModalActions ? (n(), w(F, { key: 0 }, [
148
- ae.value ? (n(), m(r, f({ key: 0 }, t.editModeButton, {
148
+ ae.value ? (n(), m(d, f({ key: 0 }, t.editModeButton, {
149
149
  checked: E.value,
150
150
  "onUpdate:checked": $[0] || ($[0] = (v) => E.value = v),
151
151
  class: "lkt-item-crud--switch-mode-button"
152
152
  }), null, 16, ["checked"])) : k("", !0),
153
- G.value.length > 0 ? (n(), m(r, Se(f({ key: 1 }, {
154
- type: d(Ne).Tooltip,
153
+ G.value.length > 0 ? (n(), m(d, Se(f({ key: 1 }, {
154
+ type: s(Ne).Tooltip,
155
155
  icon: "lkt-icn-cross-arrows",
156
156
  class: "lkt-item-crud--modifications-button",
157
157
  splitButtons: re.value,
@@ -159,25 +159,25 @@ const V = (...N) => {
159
159
  contentClass: "lkt-flex-column"
160
160
  }
161
161
  })), null, 16)) : k("", !0),
162
- (n(!0), w(F, null, H(t.navStartButtons, (v) => h((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
162
+ (n(!0), w(F, null, H(t.navStartButtons, (v) => h((n(), m(d, f({ ref_for: !0 }, v), null, 16)), [
163
163
  [D, !i.value]
164
164
  ])), 256)),
165
- d(C)["prev-buttons-ever"] ? R(t.$slots, "prev-buttons-ever", {
165
+ s(C)["prev-buttons-ever"] ? R(t.$slots, "prev-buttons-ever", {
166
166
  key: 2,
167
167
  canUpdate: t.canUpdate,
168
168
  canDrop: t.canDrop,
169
169
  perms: t.perms
170
170
  }) : k("", !0),
171
- (n(!0), w(F, null, H(t.navStartButtonsEditing, (v) => h((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
171
+ (n(!0), w(F, null, H(t.navStartButtonsEditing, (v) => h((n(), m(d, f({ ref_for: !0 }, v), null, 16)), [
172
172
  [D, E.value && !i.value]
173
173
  ])), 256)),
174
- d(C)["prev-buttons"] ? R(t.$slots, "prev-buttons", {
174
+ s(C)["prev-buttons"] ? R(t.$slots, "prev-buttons", {
175
175
  key: 3,
176
176
  canUpdate: t.canUpdate,
177
177
  canDrop: t.canDrop,
178
178
  perms: t.perms
179
179
  }) : k("", !0),
180
- h(x(r, f({
180
+ h(x(d, f({
181
181
  ref_key: "saveButtonRef",
182
182
  ref: c
183
183
  }, {
@@ -192,9 +192,9 @@ const V = (...N) => {
192
192
  onLoaded: U,
193
193
  onClick: Q
194
194
  }), null, 16), [
195
- [D, t.mode === d(O).Update && I.value]
195
+ [D, t.mode === s(O).Update && I.value]
196
196
  ]),
197
- h(x(r, f({
197
+ h(x(d, f({
198
198
  ref_key: "saveButtonRef",
199
199
  ref: c
200
200
  }, {
@@ -209,40 +209,40 @@ const V = (...N) => {
209
209
  onLoaded: U,
210
210
  onClick: te
211
211
  }), null, 16), [
212
- [D, t.mode === d(O).Create && I.value]
212
+ [D, t.mode === s(O).Create && I.value]
213
213
  ]),
214
- h(x(r, f({
214
+ h(x(d, f({
215
215
  ref_key: "dropButtonRef",
216
- ref: s
216
+ ref: r
217
217
  }, t.dropButton, {
218
218
  disabled: !t.ableToDrop,
219
219
  onLoading: b,
220
220
  onLoaded: U,
221
221
  onClick: P
222
222
  }), null, 16, ["disabled"]), [
223
- [D, W.value && t.mode !== d(O).Create]
223
+ [D, W.value && t.mode !== s(O).Create]
224
224
  ]),
225
- d(C).buttons ? R(t.$slots, "buttons", { key: 4 }) : k("", !0),
226
- (n(!0), w(F, null, H(t.navEndButtons, (v) => h((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
225
+ s(C).buttons ? R(t.$slots, "buttons", { key: 4 }) : k("", !0),
226
+ (n(!0), w(F, null, H(t.navEndButtons, (v) => h((n(), m(d, f({ ref_for: !0 }, v), null, 16)), [
227
227
  [D, !i.value]
228
228
  ])), 256)),
229
- (n(!0), w(F, null, H(t.navEndButtonsEditing, (v) => h((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
229
+ (n(!0), w(F, null, H(t.navEndButtonsEditing, (v) => h((n(), m(d, f({ ref_for: !0 }, v), null, 16)), [
230
230
  [D, E.value && !i.value]
231
231
  ])), 256))
232
- ], 64)) : t.grouped ? (n(), m(r, f({
232
+ ], 64)) : t.grouped ? (n(), m(d, f({
233
233
  key: 1,
234
234
  ref: "groupButton"
235
235
  }, t.groupButton, { class: "lkt-item-crud-group-button" }), {
236
236
  split: J(() => {
237
237
  var v, q;
238
238
  return [
239
- ae.value ? (n(), m(r, f({ key: 0 }, t.editModeButton, {
239
+ ae.value ? (n(), m(d, f({ key: 0 }, t.editModeButton, {
240
240
  checked: E.value,
241
241
  "onUpdate:checked": $[1] || ($[1] = (T) => E.value = T),
242
242
  class: "lkt-item-crud--switch-mode-button"
243
243
  }), null, 16, ["checked"])) : k("", !0),
244
- G.value.length > 0 ? (n(), m(r, Se(f({ key: 1 }, {
245
- type: d(Ne).Tooltip,
244
+ G.value.length > 0 ? (n(), m(d, Se(f({ key: 1 }, {
245
+ type: s(Ne).Tooltip,
246
246
  icon: "lkt-icn-cross-arrows",
247
247
  class: "lkt-item-crud--modifications-button",
248
248
  splitButtons: re.value,
@@ -250,25 +250,25 @@ const V = (...N) => {
250
250
  contentClass: "lkt-flex-column"
251
251
  }
252
252
  })), null, 16)) : k("", !0),
253
- (n(!0), w(F, null, H(t.navStartButtons, (T) => h((n(), m(r, f({ ref_for: !0 }, T), null, 16)), [
253
+ (n(!0), w(F, null, H(t.navStartButtons, (T) => h((n(), m(d, f({ ref_for: !0 }, T), null, 16)), [
254
254
  [D, !i.value]
255
255
  ])), 256)),
256
- d(C)["prev-buttons-ever"] ? R(t.$slots, "prev-buttons-ever", {
256
+ s(C)["prev-buttons-ever"] ? R(t.$slots, "prev-buttons-ever", {
257
257
  key: 2,
258
258
  canUpdate: t.canUpdate,
259
259
  canDrop: t.canDrop,
260
260
  perms: t.perms
261
261
  }) : k("", !0),
262
- (n(!0), w(F, null, H(t.navStartButtonsEditing, (T) => h((n(), m(r, f({ ref_for: !0 }, T), null, 16)), [
262
+ (n(!0), w(F, null, H(t.navStartButtonsEditing, (T) => h((n(), m(d, f({ ref_for: !0 }, T), null, 16)), [
263
263
  [D, E.value && !i.value]
264
264
  ])), 256)),
265
- d(C)["prev-buttons"] ? R(t.$slots, "prev-buttons", {
265
+ s(C)["prev-buttons"] ? R(t.$slots, "prev-buttons", {
266
266
  key: 3,
267
267
  canUpdate: t.canUpdate,
268
268
  canDrop: t.canDrop,
269
269
  perms: t.perms
270
270
  }) : k("", !0),
271
- h(x(r, f({
271
+ h(x(d, f({
272
272
  ref_key: "saveButtonRef",
273
273
  ref: c
274
274
  }, {
@@ -283,9 +283,9 @@ const V = (...N) => {
283
283
  onLoaded: U,
284
284
  onClick: Q
285
285
  }), null, 16), [
286
- [D, t.mode === d(O).Update && I.value]
286
+ [D, t.mode === s(O).Update && I.value]
287
287
  ]),
288
- h(x(r, f({
288
+ h(x(d, f({
289
289
  ref_key: "saveButtonRef",
290
290
  ref: c
291
291
  }, {
@@ -301,34 +301,34 @@ const V = (...N) => {
301
301
  onLoaded: U,
302
302
  onClick: te
303
303
  }), null, 16, ["disabled"]), [
304
- [D, t.mode === d(O).Create && I.value]
304
+ [D, t.mode === s(O).Create && I.value]
305
305
  ]),
306
- h(x(r, f({
306
+ h(x(d, f({
307
307
  ref_key: "dropButtonRef",
308
- ref: s
308
+ ref: r
309
309
  }, t.dropButton, {
310
310
  disabled: !t.ableToDrop,
311
311
  onLoading: b,
312
312
  onLoaded: U,
313
313
  onClick: P
314
314
  }), null, 16, ["disabled"]), [
315
- [D, W.value && t.mode !== d(O).Create]
315
+ [D, W.value && t.mode !== s(O).Create]
316
316
  ]),
317
- d(C).buttons ? R(t.$slots, "buttons", { key: 4 }) : k("", !0),
318
- (n(!0), w(F, null, H(t.navEndButtons, (T) => h((n(), m(r, f({ ref_for: !0 }, T), null, 16)), [
317
+ s(C).buttons ? R(t.$slots, "buttons", { key: 4 }) : k("", !0),
318
+ (n(!0), w(F, null, H(t.navEndButtons, (T) => h((n(), m(d, f({ ref_for: !0 }, T), null, 16)), [
319
319
  [D, !i.value]
320
320
  ])), 256)),
321
- (n(!0), w(F, null, H(t.navEndButtonsEditing, (T) => h((n(), m(r, f({ ref_for: !0 }, T), null, 16)), [
321
+ (n(!0), w(F, null, H(t.navEndButtonsEditing, (T) => h((n(), m(d, f({ ref_for: !0 }, T), null, 16)), [
322
322
  [D, E.value && !i.value]
323
323
  ])), 256))
324
324
  ];
325
325
  }),
326
326
  _: 3
327
327
  }, 16)) : (n(), w(F, { key: 2 }, [
328
- (n(!0), w(F, null, H(t.navStartButtons, (v) => h((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
328
+ (n(!0), w(F, null, H(t.navStartButtons, (v) => h((n(), m(d, f({ ref_for: !0 }, v), null, 16)), [
329
329
  [D, !i.value]
330
330
  ])), 256)),
331
- d(C)["prev-buttons-ever"] ? h((n(), w("div", bt, [
331
+ s(C)["prev-buttons-ever"] ? h((n(), w("div", bt, [
332
332
  R(t.$slots, "prev-buttons-ever", {
333
333
  canUpdate: t.canUpdate,
334
334
  canDrop: t.canDrop,
@@ -337,10 +337,10 @@ const V = (...N) => {
337
337
  ], 512)), [
338
338
  [D, !i.value]
339
339
  ]) : k("", !0),
340
- (n(!0), w(F, null, H(t.navStartButtonsEditing, (v) => h((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
340
+ (n(!0), w(F, null, H(t.navStartButtonsEditing, (v) => h((n(), m(d, f({ ref_for: !0 }, v), null, 16)), [
341
341
  [D, E.value && !i.value]
342
342
  ])), 256)),
343
- d(C)["prev-buttons"] ? h((n(), w("div", gt, [
343
+ s(C)["prev-buttons"] ? h((n(), w("div", gt, [
344
344
  R(t.$slots, "prev-buttons", {
345
345
  canUpdate: t.canUpdate,
346
346
  canDrop: t.canDrop,
@@ -349,7 +349,7 @@ const V = (...N) => {
349
349
  ], 512)), [
350
350
  [D, E.value && !i.value]
351
351
  ]) : k("", !0),
352
- h(x(r, f({
352
+ h(x(d, f({
353
353
  ref_key: "saveButtonRef",
354
354
  ref: c
355
355
  }, {
@@ -364,9 +364,9 @@ const V = (...N) => {
364
364
  onLoaded: U,
365
365
  onClick: Q
366
366
  }), null, 16), [
367
- [D, t.mode === d(O).Update && I.value]
367
+ [D, t.mode === s(O).Update && I.value]
368
368
  ]),
369
- h(x(r, f({
369
+ h(x(d, f({
370
370
  ref_key: "saveButtonRef",
371
371
  ref: c
372
372
  }, {
@@ -381,32 +381,32 @@ const V = (...N) => {
381
381
  onLoaded: U,
382
382
  onClick: te
383
383
  }), null, 16), [
384
- [D, t.mode === d(O).Create && I.value]
384
+ [D, t.mode === s(O).Create && I.value]
385
385
  ]),
386
- h(x(r, f({
386
+ h(x(d, f({
387
387
  ref_key: "dropButtonRef",
388
- ref: s
388
+ ref: r
389
389
  }, t.dropButton, {
390
390
  disabled: !t.ableToDrop,
391
391
  onLoading: b,
392
392
  onLoaded: U,
393
393
  onClick: P
394
394
  }), null, 16, ["disabled"]), [
395
- [D, W.value && t.mode !== d(O).Create]
395
+ [D, W.value && t.mode !== s(O).Create]
396
396
  ]),
397
- d(C).buttons ? h((n(), w("div", yt, [
397
+ s(C).buttons ? h((n(), w("div", yt, [
398
398
  R(t.$slots, "buttons")
399
399
  ], 512)), [
400
400
  [D, E.value && !i.value]
401
401
  ]) : k("", !0),
402
- (n(!0), w(F, null, H(t.navEndButtons, (v) => h((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
402
+ (n(!0), w(F, null, H(t.navEndButtons, (v) => h((n(), m(d, f({ ref_for: !0 }, v), null, 16)), [
403
403
  [D, !i.value]
404
404
  ])), 256)),
405
- (n(!0), w(F, null, H(t.navEndButtonsEditing, (v) => h((n(), m(r, f({ ref_for: !0 }, v), null, 16)), [
405
+ (n(!0), w(F, null, H(t.navEndButtonsEditing, (v) => h((n(), m(d, f({ ref_for: !0 }, v), null, 16)), [
406
406
  [D, E.value && !i.value]
407
407
  ])), 256)),
408
- G.value.length > 0 ? (n(), m(r, Se(f({ key: 3 }, {
409
- type: d(Ne).Tooltip,
408
+ G.value.length > 0 ? (n(), m(d, Se(f({ key: 3 }, {
409
+ type: s(Ne).Tooltip,
410
410
  icon: "lkt-icn-cross-arrows",
411
411
  class: "lkt-item-crud--modifications-button",
412
412
  splitButtons: re.value,
@@ -414,7 +414,7 @@ const V = (...N) => {
414
414
  contentClass: "lkt-flex-column"
415
415
  }
416
416
  })), null, 16)) : k("", !0),
417
- ae.value ? (n(), m(r, f({ key: 4 }, t.editModeButton, {
417
+ ae.value ? (n(), m(d, f({ key: 4 }, t.editModeButton, {
418
418
  checked: E.value,
419
419
  "onUpdate:checked": $[2] || ($[2] = (v) => E.value = v),
420
420
  class: "lkt-item-crud--switch-mode-button"
@@ -499,7 +499,7 @@ const V = (...N) => {
499
499
  "modified-data"
500
500
  ],
501
501
  setup(N, { expose: ge, emit: Ue }) {
502
- const a = N, u = ct(), M = ze(), C = Ue, c = p(!0), s = p(a.modelValue), i = p(a.modifications), E = p(a.customData), b = p(a.perms), U = p(a.editing), te = p(!1), Q = p(!1), P = p(!1), K = p(!1), Y = p(200), L = p(new $e(s.value, a.dataStateConfig)), W = p(new $e(i.value, a.dataStateConfig)), I = p(!1), ae = p(new $e(a.readData)), z = p(a.mode === O.Create), G = p(!1), re = p(!1), t = p(null), $ = p(null), r = B(() => z.value && a.createButton !== !1 && Array.isArray(b.value) && b.value.includes(we.Create)), Z = B(() => !z.value && a.updateButton !== !1 && Array.isArray(b.value) && b.value.includes(we.Update)), _ = B(() => !z.value && a.dropButton !== !1 && Array.isArray(b.value) && b.value.includes(we.Drop)), de = B(() => a.editModeButton !== !1 && !z.value && Array.isArray(b.value) && b.value.includes(we.SwitchEditMode)), j = p(a.visibleView);
502
+ const a = N, u = ct(), M = ze(), C = Ue, c = p(!0), r = p(a.modelValue), i = p(a.modifications), E = p(a.customData), b = p(a.perms), U = p(a.editing), te = p(!1), Q = p(!1), P = p(!1), K = p(!1), Y = p(200), L = p(new $e(r.value, a.dataStateConfig)), W = p(new $e(i.value, a.dataStateConfig)), I = p(!1), ae = p(new $e(a.readData)), z = p(a.mode === O.Create), G = p(!1), re = p(!1), t = p(null), $ = p(null), d = B(() => z.value && a.createButton !== !1 && Array.isArray(b.value) && b.value.includes(we.Create)), Z = B(() => !z.value && a.updateButton !== !1 && Array.isArray(b.value) && b.value.includes(we.Update)), _ = B(() => !z.value && a.dropButton !== !1 && Array.isArray(b.value) && b.value.includes(we.Drop)), de = B(() => a.editModeButton !== !1 && !z.value && Array.isArray(b.value) && b.value.includes(we.SwitchEditMode)), j = p(a.visibleView);
503
503
  y(() => a.visibleView, (e) => {
504
504
  j.value = e;
505
505
  }), y(j, (e) => {
@@ -540,7 +540,7 @@ const V = (...N) => {
540
540
  }), C("error", A.httpStatus);
541
541
  return;
542
542
  }
543
- P.value = !0, s.value = A.data, i.value = Array.isArray(A.modifications) ? {} : A.modifications, b.value = A.perms, L.value.increment(s.value).turnStoredIntoOriginal(), W.value.increment(i.value).turnStoredIntoOriginal(), I.value = L.value.changed(), ae.value.turnStoredIntoOriginal(), Object.keys(i.value).length > 0 && (j.value = S.Modifications), oe.value && (Ee(), Ke(() => {
543
+ P.value = !0, r.value = A.data, i.value = Array.isArray(A.modifications) ? {} : A.modifications, b.value = A.perms, L.value.increment(r.value).turnStoredIntoOriginal(), W.value.increment(i.value).turnStoredIntoOriginal(), I.value = L.value.changed(), ae.value.turnStoredIntoOriginal(), Object.keys(i.value).length > 0 && (j.value = S.Modifications), oe.value && (Ee(), Ke(() => {
544
544
  $.value.turnStoredIntoOriginal();
545
545
  })), typeof ((X = a.events) == null ? void 0 : X.httpEnd) == "function" && a.events.httpEnd({
546
546
  httpResponse: A
@@ -553,14 +553,14 @@ const V = (...N) => {
553
553
  y(G, (e) => {
554
554
  e && Ke(() => G.value = !1);
555
555
  }), y(() => a.modelValue, (e) => {
556
- s.value = e, L.value.increment(e);
557
- }, { deep: !0 }), y(s, (e) => {
558
- if (V("item updated ->", s.value), typeof a.beforeEmitUpdate == "function") {
556
+ r.value = e, L.value.increment(e);
557
+ }, { deep: !0 }), y(r, (e) => {
558
+ if (V("item updated ->", r.value), typeof a.beforeEmitUpdate == "function") {
559
559
  V("item updated -> has beforeEmitUpdate");
560
- let o = a.beforeEmitUpdate(s.value);
561
- V("item updated -> override with: ", o), typeof o == "object" && (s.value = o);
560
+ let o = a.beforeEmitUpdate(r.value);
561
+ V("item updated -> override with: ", o), typeof o == "object" && (r.value = o);
562
562
  }
563
- oe.value && Ee(), C("update:modelValue", s.value), V("item updated -> update dataState"), L.value.increment(e), ue.value === S.Current && (I.value = L.value.changed()), G.value = !0;
563
+ oe.value && Ee(), C("update:modelValue", r.value), V("item updated -> update dataState"), L.value.increment(e), ue.value === S.Current && (I.value = L.value.changed()), G.value = !0;
564
564
  }, { deep: !0 }), y(b, () => C("perms", b.value)), y(I, (e) => {
565
565
  C("modified-data", e);
566
566
  }), y(() => a.readData, (e) => {
@@ -571,10 +571,10 @@ const V = (...N) => {
571
571
  V("editMode updated -> emit update", e), C("update:editing", e);
572
572
  });
573
573
  const Pe = p(void 0), Ee = () => {
574
- oe.value && (Pe.value = lt(s.value, i.value, fe.value));
574
+ oe.value && (Pe.value = lt(r.value, i.value, fe.value));
575
575
  };
576
576
  ot(() => {
577
- a.readResource && !z.value ? Be() : (z.value, P.value = !0, U.value = !0, c.value = !1, L.value.increment(s.value).turnStoredIntoOriginal(), I.value = L.value.changed());
577
+ a.readResource && !z.value ? Be() : (z.value, P.value = !0, U.value = !0, c.value = !1, L.value.increment(r.value).turnStoredIntoOriginal(), I.value = L.value.changed());
578
578
  });
579
579
  const Ve = (e, o) => {
580
580
  if (o) {
@@ -599,7 +599,7 @@ const V = (...N) => {
599
599
  });
600
600
  return;
601
601
  }
602
- re.value = !0, V("onCreate -> turn stored data into original"), L.value.increment(s.value).turnStoredIntoOriginal(), W.value.turnStoredIntoOriginal(), a.notificationType === ne.Toast && ve({
602
+ re.value = !0, V("onCreate -> turn stored data into original"), L.value.increment(r.value).turnStoredIntoOriginal(), W.value.turnStoredIntoOriginal(), a.notificationType === ne.Toast && ve({
603
603
  text: g.defaultCreateSuccessText,
604
604
  details: g.defaultCreateSuccessDetails,
605
605
  icon: g.defaultCreateSuccessIcon,
@@ -650,7 +650,7 @@ const V = (...N) => {
650
650
  t.value && t.value.doSave();
651
651
  },
652
652
  turnStoredDataIntoOriginal: () => {
653
- L.value.increment(s.value).turnStoredIntoOriginal();
653
+ L.value.increment(r.value).turnStoredIntoOriginal();
654
654
  },
655
655
  hasModifiedData: () => L.value.changed()
656
656
  });
@@ -667,51 +667,53 @@ const V = (...N) => {
667
667
  }, Ae = B(() => a.title.startsWith("__:") ? String(ft(a.title.substring(3))) : a.title), Ye = B(() => c.value ? !1 : Ae.value.length > 0 || !!M["post-title"]), Ze = B(() => c.value ? !1 : typeof a.header == "object" && Object.keys(a.header).length > 0), ke = B(() => a.view === Ge.Modal), He = B(() => ke.value ? "lkt-modal" : "section"), Ce = B(() => {
668
668
  var e, o;
669
669
  return a.mode !== O.Update || !Z.value || !a.enabledSaveWithoutChanges && !I.value || oe.value && (!te.value || !Q.value) ? !1 : typeof ((e = q.value) == null ? void 0 : e.disabled) == "function" ? !q.value.disabled({
670
- prop: s.value
670
+ prop: r.value
671
671
  }) : typeof ((o = q.value) == null ? void 0 : o.disabled) == "boolean" ? !q.value.disabled : !0;
672
672
  }), he = B(() => {
673
673
  var e, o;
674
- return a.mode !== O.Create || !r.value || !a.enabledSaveWithoutChanges && !I.value || oe.value && !te.value && !Q.value ? !1 : typeof ((e = v.value) == null ? void 0 : e.disabled) == "function" ? !v.value.disabled({
675
- prop: s.value
674
+ return a.mode !== O.Create || !d.value || !a.enabledSaveWithoutChanges && !I.value || oe.value && !te.value && !Q.value ? !1 : typeof ((e = v.value) == null ? void 0 : e.disabled) == "function" ? !v.value.disabled({
675
+ prop: r.value
676
676
  }) : typeof ((o = v.value) == null ? void 0 : o.disabled) == "boolean" ? !v.value.disabled : !0;
677
677
  }), Oe = B(() => {
678
678
  var e, o;
679
679
  return _.value ? typeof ((e = T.value) == null ? void 0 : e.disabled) == "function" ? !T.value.disabled({
680
- prop: s.value
680
+ prop: r.value
681
681
  }) : typeof ((o = T.value) == null ? void 0 : o.disabled) == "boolean" ? !T.value.disabled : !0 : !1;
682
682
  }), _e = B(() => He.value === "lkt-modal" ? {
683
683
  title: a.title,
684
- item: s.value,
684
+ item: r.value,
685
685
  ...a.modalConfig,
686
686
  beforeClose: Qe,
687
687
  closeConfirm: Je.value,
688
688
  headerActionsButton: a.groupButton !== !1 ? {
689
689
  dot: he.value || Ce.value
690
690
  } : !1
691
- } : {}), oe = B(() => typeof fe.value == "object" && Object.keys(fe.value).length > 0), Le = B(() => Object.keys(i.value).length === 0 ? [] : a.modificationViews), ue = B(() => Object.keys(i.value).length === 0 ? S.Current : S.Modifications), De = B(() => r.value || Z.value || _.value), xe = B(() => oe.value ? rt(fe.value) : []), fe = B(() => typeof a.form == "function" ? a.form({
691
+ } : {}), oe = B(() => typeof fe.value == "object" && Object.keys(fe.value).length > 0), Le = B(() => Object.keys(i.value).length === 0 ? [] : a.modificationViews), ue = B(() => Object.keys(i.value).length === 0 ? S.Current : S.Modifications), De = B(() => d.value || Z.value || _.value), xe = B(() => oe.value ? rt(fe.value) : []), fe = B(() => typeof a.form == "function" ? a.form({
692
692
  mode: a.mode,
693
- view: j.value
693
+ view: j.value,
694
+ item: r.value,
695
+ modifications: i.value
694
696
  }) : a.form);
695
697
  return (e, o) => {
696
698
  const X = me("lkt-header"), A = me("lkt-http-info"), et = me("lkt-form"), tt = me("lkt-loader");
697
699
  return n(), m(nt(He.value), f(_e.value, { class: "lkt-item-crud" }), ce({
698
700
  default: J(() => [
699
701
  !ke.value && Ze.value ? (n(), m(X, Se(f({ key: 0 }, e.header)), null, 16)) : !ke.value && Ye.value ? (n(), w("header", Bt, [
700
- d(M)["pre-title"] ? (n(), w("div", kt, [
702
+ s(M)["pre-title"] ? (n(), w("div", kt, [
701
703
  R(e.$slots, "pre-title", {
702
- item: s.value,
704
+ item: r.value,
703
705
  loading: c.value
704
706
  })
705
707
  ])) : k("", !0),
706
708
  Ae.value.length > 0 ? (n(), w("h1", Ct, ut(Ae.value), 1)) : k("", !0),
707
- d(M)["post-title"] ? (n(), w("div", ht, [
709
+ s(M)["post-title"] ? (n(), w("div", ht, [
708
710
  R(e.$slots, "post-title", {
709
- item: s.value,
711
+ item: r.value,
710
712
  loading: c.value
711
713
  })
712
714
  ])) : k("", !0)
713
715
  ])) : k("", !0),
714
- e.buttonNavPosition === d(je).Top && (e.groupButton === !1 || !e.groupButtonAsModalActions) && De.value ? (n(), m(Fe, {
716
+ e.buttonNavPosition === s(je).Top && (e.groupButton === !1 || !e.groupButtonAsModalActions) && De.value ? (n(), m(Fe, {
715
717
  key: 2,
716
718
  ref_key: "buttonNav",
717
719
  ref: t,
@@ -721,7 +723,7 @@ const V = (...N) => {
721
723
  "onUpdate:editing": o[4] || (o[4] = (l) => U.value = l),
722
724
  "picked-modification-view": j.value,
723
725
  "onUpdate:pickedModificationView": o[5] || (o[5] = (l) => j.value = l),
724
- item: s.value,
726
+ item: r.value,
725
727
  modifications: i.value,
726
728
  mode: e.mode,
727
729
  view: e.view,
@@ -734,7 +736,7 @@ const V = (...N) => {
734
736
  "group-button": Me.value,
735
737
  "data-changed": I.value,
736
738
  "http-success-read": P.value,
737
- "can-create": r.value,
739
+ "can-create": d.value,
738
740
  "can-update": Z.value,
739
741
  "can-drop": _.value,
740
742
  "can-switch-edit-mode": de.value,
@@ -753,7 +755,7 @@ const V = (...N) => {
753
755
  onSave: Te,
754
756
  onDrop: Re
755
757
  }, ce({ _: 2 }, [
756
- d(M)["prev-buttons-ever"] ? {
758
+ s(M)["prev-buttons-ever"] ? {
757
759
  name: "prev-buttons-ever",
758
760
  fn: J(({ canUpdate: l, canDrop: ie, perms: le }) => [
759
761
  R(e.$slots, "prev-buttons-ever", {
@@ -764,7 +766,7 @@ const V = (...N) => {
764
766
  ]),
765
767
  key: "0"
766
768
  } : void 0,
767
- d(M)["prev-buttons"] ? {
769
+ s(M)["prev-buttons"] ? {
768
770
  name: "prev-buttons",
769
771
  fn: J(({ canUpdate: l, canDrop: ie, perms: le }) => [
770
772
  R(e.$slots, "prev-buttons", {
@@ -778,7 +780,7 @@ const V = (...N) => {
778
780
  ]), 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-create", "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"])) : k("", !0),
779
781
  c.value ? k("", !0) : (n(), w("div", Dt, [
780
782
  P.value ? (n(), w("div", wt, [
781
- K.value && e.notificationType === d(ne).Inline ? (n(), m(A, {
783
+ K.value && e.notificationType === s(ne).Inline ? (n(), m(A, {
782
784
  key: 0,
783
785
  code: Y.value,
784
786
  palette: Y.value === 200 ? "success" : "danger",
@@ -790,8 +792,8 @@ const V = (...N) => {
790
792
  key: 1,
791
793
  ref_key: "formRef",
792
794
  ref: $,
793
- modelValue: s.value,
794
- "onUpdate:modelValue": o[7] || (o[7] = (l) => s.value = l),
795
+ modelValue: r.value,
796
+ "onUpdate:modelValue": o[7] || (o[7] = (l) => r.value = l),
795
797
  modifications: i.value,
796
798
  "onUpdate:modifications": o[8] || (o[8] = (l) => i.value = l),
797
799
  valid: te.value,
@@ -815,7 +817,7 @@ const V = (...N) => {
815
817
  }))
816
818
  ]), 1040, ["modelValue", "modifications", "valid", "changed"])) : R(e.$slots, "item", {
817
819
  key: 2,
818
- item: s.value,
820
+ item: r.value,
819
821
  loading: c.value,
820
822
  editMode: U.value,
821
823
  isCreate: z.value,
@@ -824,13 +826,13 @@ const V = (...N) => {
824
826
  itemBeingEdited: G.value,
825
827
  perms: b.value
826
828
  })
827
- ])) : e.notificationType === d(ne).Inline ? (n(), m(A, {
829
+ ])) : e.notificationType === s(ne).Inline ? (n(), m(A, {
828
830
  key: 1,
829
831
  code: Y.value
830
832
  }, null, 8, ["code"])) : k("", !0)
831
833
  ])),
832
834
  c.value ? (n(), m(tt, { key: 4 })) : k("", !0),
833
- e.buttonNavPosition === d(je).Bottom && (e.groupButton === !1 || !e.groupButtonAsModalActions) && De.value ? (n(), m(Fe, {
835
+ e.buttonNavPosition === s(je).Bottom && (e.groupButton === !1 || !e.groupButtonAsModalActions) && De.value ? (n(), m(Fe, {
834
836
  key: 5,
835
837
  ref_key: "buttonNav",
836
838
  ref: t,
@@ -840,7 +842,7 @@ const V = (...N) => {
840
842
  "onUpdate:editing": o[12] || (o[12] = (l) => U.value = l),
841
843
  "picked-modification-view": j.value,
842
844
  "onUpdate:pickedModificationView": o[13] || (o[13] = (l) => j.value = l),
843
- item: s.value,
845
+ item: r.value,
844
846
  modifications: i.value,
845
847
  mode: e.mode,
846
848
  view: e.view,
@@ -853,7 +855,7 @@ const V = (...N) => {
853
855
  "group-button": Me.value,
854
856
  "data-changed": I.value,
855
857
  "http-success-read": P.value,
856
- "can-create": r.value,
858
+ "can-create": d.value,
857
859
  "can-update": Z.value,
858
860
  "can-drop": _.value,
859
861
  "can-switch-edit-mode": de.value,
@@ -872,14 +874,14 @@ const V = (...N) => {
872
874
  onSave: Te,
873
875
  onDrop: Re
874
876
  }, ce({ _: 2 }, [
875
- d(M)["prev-buttons-ever"] ? {
877
+ s(M)["prev-buttons-ever"] ? {
876
878
  name: "prev-buttons-ever",
877
879
  fn: J(() => [
878
880
  R(e.$slots, "prev-buttons-ever")
879
881
  ]),
880
882
  key: "0"
881
883
  } : void 0,
882
- d(M)["prev-buttons"] ? {
884
+ s(M)["prev-buttons"] ? {
883
885
  name: "prev-buttons-ever",
884
886
  fn: J(() => [
885
887
  R(e.$slots, "prev-buttons")
@@ -893,7 +895,7 @@ const V = (...N) => {
893
895
  e.groupButton !== !1 && e.groupButtonAsModalActions && De.value ? {
894
896
  name: "header-actions",
895
897
  fn: J(() => [
896
- e.buttonNavPosition === d(je).Top ? (n(), m(Fe, {
898
+ e.buttonNavPosition === s(je).Top ? (n(), m(Fe, {
897
899
  key: 0,
898
900
  ref_key: "buttonNav",
899
901
  ref: t,
@@ -903,7 +905,7 @@ const V = (...N) => {
903
905
  "onUpdate:editing": o[1] || (o[1] = (l) => U.value = l),
904
906
  "picked-modification-view": j.value,
905
907
  "onUpdate:pickedModificationView": o[2] || (o[2] = (l) => j.value = l),
906
- item: s.value,
908
+ item: r.value,
907
909
  modifications: i.value,
908
910
  mode: e.mode,
909
911
  view: e.view,
@@ -916,7 +918,7 @@ const V = (...N) => {
916
918
  "group-button": Me.value,
917
919
  "data-changed": I.value,
918
920
  "http-success-read": P.value,
919
- "can-create": r.value,
921
+ "can-create": d.value,
920
922
  "can-update": Z.value,
921
923
  "can-drop": _.value,
922
924
  "can-switch-edit-mode": de.value,
@@ -935,7 +937,7 @@ const V = (...N) => {
935
937
  onSave: Te,
936
938
  onDrop: Re
937
939
  }, ce({ _: 2 }, [
938
- d(M)["prev-buttons-ever"] ? {
940
+ s(M)["prev-buttons-ever"] ? {
939
941
  name: "prev-buttons-ever",
940
942
  fn: J(({ canUpdate: l, canDrop: ie, perms: le }) => [
941
943
  R(e.$slots, "prev-buttons-ever", {
@@ -946,7 +948,7 @@ const V = (...N) => {
946
948
  ]),
947
949
  key: "0"
948
950
  } : void 0,
949
- d(M)["prev-buttons"] ? {
951
+ s(M)["prev-buttons"] ? {
950
952
  name: "prev-buttons",
951
953
  fn: J(({ canUpdate: l, canDrop: ie, perms: le }) => [
952
954
  R(e.$slots, "prev-buttons", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-item-crud",
3
- "version": "2.0.30",
3
+ "version": "2.0.31",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "module": "./dist/build.js",
@@ -546,6 +546,8 @@
546
546
  if (typeof props.form === 'function') return props.form({
547
547
  mode: props.mode,
548
548
  view: pickedModificationView.value,
549
+ item: item.value,
550
+ modifications: itemModifications.value
549
551
  });
550
552
  return props.form;
551
553
  })