lkt-item-crud 2.0.21 → 2.0.22

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