lkt-item-crud 2.0.21 → 2.0.23

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";
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";
1
+ import { defineComponent as Xe, ref as d, watch as p, useSlots as Ke, computed as g, resolveComponent as ye, createElementBlock as W, createCommentVNode as v, openBlock as c, createBlock as R, Fragment as je, renderSlot as S, withDirectives as X, mergeProps as U, normalizeProps as Ve, unref as i, createVNode as J, vShow as K, withCtx as q, mergeDefaults as Qe, nextTick as Ye, onMounted as Ze, resolveDynamicComponent as _e, createSlots as pe, createElementVNode as xe, toDisplayString as et, renderList as tt } from "vue";
2
+ import { httpCall as ot } from "lkt-http-client";
3
+ import { DataState as Te } from "lkt-data-state";
4
+ import { ModificationView as k, ItemCrudMode as T, ItemCrudButtonNavVisibility as Fe, ButtonType as Ie, TablePermission as Re, ensureButtonConfig as Q, LktSettings as s, getFormDataState as at, ItemCrudView as Pe, getFormSlotKeys as nt, ItemCrudButtonNavPosition as Ae, NotificationType as _, getDefaultValues as ut, ItemCrud as it, ToastPositionX as le } from "lkt-vue-kernel";
5
+ import { closeModal as lt, updateModalKey as dt } from "lkt-modal";
6
+ import { __ as rt } from "lkt-i18n";
7
+ import { openToast as de } from "lkt-toast";
8
+ import { useRouter as st } from "vue-router";
9
9
  const ve = class ve {
10
10
  };
11
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 = {
12
+ let re = ve;
13
+ const D = (...A) => {
14
+ re.debugEnabled && console.info("[LktItemCrud] ", ...A);
15
+ }, Et = (A = !0) => {
16
+ re.debugEnabled = A;
17
+ }, pt = {
18
18
  key: 0,
19
19
  class: "lkt-item-crud-buttons"
20
- }, dt = {
20
+ }, vt = {
21
21
  key: 0,
22
22
  class: "lkt-item-crud-buttons"
23
- }, rt = {
23
+ }, ct = {
24
24
  key: 1,
25
25
  class: "lkt-item-crud-buttons"
26
- }, st = {
26
+ }, ft = {
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,367 +64,345 @@ 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: ce, 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 = Ke(), 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
+ }, $ = g(() => n.editableView === k.Modifications ? n.modifications : n.item);
85
+ ce({
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 = g(() => !n.canDrop || n.dropButton === !1 ? !1 : !n.canUpdate && n.canDrop ? !0 : !m.value && n.editing && n.httpSuccessRead), h = g(() => n.mode === T.Create && n.createButton === !1 || n.mode === T.Update && n.updateButton === !1 || m.value ? !1 : n.editing && n.httpSuccessRead), Z = g(() => n.editModeButton === !1 || !n.canSwitchEditMode || !n.canUpdate && !n.canDrop || !n.canUpdate && n.canDrop ? !1 : !m.value && n.mode !== T.Create && n.httpSuccessRead), H = g(() => n.buttonNavVisibility === Fe.Always || f["prev-buttons-ever"] ? !0 : n.buttonNavVisibility === Fe.Never ? !1 : h.value || G.value || Z.value), j = g(() => n.modificationView === !1 ? [] : n.modificationView === !0 ? [
94
+ k.Current,
95
+ k.Modifications,
96
+ k.SplitView,
97
+ k.Differences
98
+ ] : Array.isArray(n.modificationView) ? n.modificationView : []), ue = g(() => {
99
99
  let t = [];
100
- return z.value.includes(g.Current) && t.push({
100
+ return j.value.includes(k.Current) && t.push({
101
101
  text: "Current",
102
102
  icon: "lkt-icn-see",
103
- disabled: C.value === g.Current,
103
+ disabled: C.value === k.Current,
104
104
  events: {
105
105
  click: () => {
106
- C.value = g.Current;
106
+ C.value = k.Current;
107
107
  }
108
108
  }
109
- }), z.value.includes(g.Modifications) && t.push({
109
+ }), j.value.includes(k.Modifications) && t.push({
110
110
  text: "Modifications",
111
111
  icon: "lkt-icn-edit",
112
- disabled: C.value === g.Modifications,
112
+ disabled: C.value === k.Modifications,
113
113
  events: {
114
114
  click: () => {
115
- C.value = g.Modifications;
115
+ C.value = k.Modifications;
116
116
  }
117
117
  }
118
- }), z.value.includes(g.SplitView) && t.push({
118
+ }), j.value.includes(k.SplitView) && t.push({
119
119
  text: "Split View",
120
120
  icon: "lkt-icn-columns",
121
- disabled: C.value === g.SplitView,
121
+ disabled: C.value === k.SplitView,
122
122
  events: {
123
123
  click: () => {
124
- C.value = g.SplitView;
124
+ C.value = k.SplitView;
125
125
  }
126
126
  }
127
- }), z.value.includes(g.Differences) && t.push({
127
+ }), j.value.includes(k.Differences) && t.push({
128
128
  text: "Differences",
129
129
  icon: "lkt-icn-balance",
130
- disabled: C.value === g.Differences,
130
+ disabled: C.value === k.Differences,
131
131
  events: {
132
132
  click: () => {
133
- C.value = g.Differences;
133
+ C.value = k.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 y = ye("lkt-button");
141
+ return H.value ? (c(), W("div", pt, [
142
+ t.grouped && t.groupButtonAsModalActions ? (c(), W(je, { key: 0 }, [
143
+ Z.value ? (c(), R(y, U({ 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(y, Ve(U({ key: 1 }, {
149
+ type: i(Ie).Tooltip,
150
150
  icon: "lkt-icn-cross-arrows",
151
151
  class: "lkt-item-crud--modifications-button",
152
- splitButtons: H.value,
152
+ splitButtons: ue.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
+ i(f)["prev-buttons-ever"] ? S(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
+ i(f)["prev-buttons"] ? S(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(J(y, U({
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
+ [K, t.mode === i(T).Update && h.value]
185
185
  ]),
186
- F(Y(h, S({
186
+ X(J(y, U({
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
+ [K, t.mode === i(T).Create && h.value]
202
202
  ]),
203
- F(Y(h, S({
203
+ X(J(y, U({
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
+ [K, G.value && t.mode !== i(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
+ i(f).buttons ? S(t.$slots, "buttons", { key: 4 }) : v("", !0)
215
+ ], 64)) : t.grouped ? (c(), R(y, U({
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(y, U({ 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(y, Ve(U({ key: 1 }, {
228
+ type: i(Ie).Tooltip,
229
229
  icon: "lkt-icn-cross-arrows",
230
230
  class: "lkt-item-crud--modifications-button",
231
- splitButtons: H.value,
231
+ splitButtons: ue.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
+ i(f)["prev-buttons-ever"] ? S(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
+ i(f)["prev-buttons"] ? S(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(J(y, U({
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
+ [K, t.mode === i(T).Update && h.value]
264
264
  ]),
265
- F(Y(h, S({
265
+ X(J(y, U({
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
+ [K, t.mode === i(T).Create && h.value]
282
282
  ]),
283
- F(Y(h, S({
283
+ X(J(y, U({
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
+ [K, G.value && t.mode !== i(T).Create]
293
293
  ]),
294
- n(c).buttons ? U(t.$slots, "buttons", { key: 4 }) : p("", !0)
294
+ i(f).buttons ? S(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, [
300
- U(t.$slots, "prev-buttons-ever", {
298
+ }, 16)) : (c(), W(je, { key: 2 }, [
299
+ i(f)["prev-buttons-ever"] ? X((c(), W("div", vt, [
300
+ S(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, [
309
- U(t.$slots, "prev-buttons", {
306
+ [K, !m.value]
307
+ ]) : v("", !0),
308
+ i(f)["prev-buttons"] ? X((c(), W("div", ct, [
309
+ S(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
+ [K, E.value && !m.value]
316
+ ]) : v("", !0),
317
+ X(J(y, U({
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
+ [K, t.mode === i(T).Update && h.value]
333
333
  ]),
334
- F(Y(h, S({
334
+ X(J(y, U({
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
+ [K, t.mode === i(T).Create && h.value]
350
350
  ]),
351
- F(Y(h, S({
351
+ X(J(y, U({
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
+ [K, G.value && t.mode !== i(T).Create]
361
361
  ]),
362
- n(c).buttons ? F((v(), J("div", st, [
363
- U(t.$slots, "buttons")
362
+ i(f).buttons ? X((c(), W("div", ft, [
363
+ S(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
+ [K, E.value && !m.value]
366
+ ]) : v("", !0),
367
+ j.value.length > 0 ? (c(), R(y, Ve(U({ key: 3 }, {
368
+ type: i(Ie).Tooltip,
369
369
  icon: "lkt-icn-cross-arrows",
370
370
  class: "lkt-item-crud--modifications-button",
371
- splitButtons: H.value,
371
+ splitButtons: ue.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(y, U({ 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
+ }), mt = { class: "lkt-item-crud" }, bt = {
408
386
  key: 0,
409
387
  class: "lkt-item-crud_header"
410
- }, ft = {
388
+ }, gt = {
411
389
  key: 0,
412
390
  class: "lkt-item-crud_header-slot"
413
- }, mt = {
391
+ }, yt = {
414
392
  key: 1,
415
393
  class: "lkt-item-crud_header-title"
416
- }, bt = {
394
+ }, kt = {
417
395
  key: 2,
418
396
  class: "lkt-item-crud_header-slot"
419
- }, gt = {
397
+ }, Bt = {
420
398
  key: 2,
421
399
  class: "lkt-item-crud_content"
422
- }, yt = {
400
+ }, Ct = {
423
401
  key: 0,
424
402
  class: "lkt-grid-1"
425
- }, kt = /* @__PURE__ */ Fe({
403
+ }, Dt = /* @__PURE__ */ Xe({
426
404
  __name: "LktItemCrud",
427
- props: /* @__PURE__ */ ze({
405
+ props: /* @__PURE__ */ Qe({
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
+ }, ut(it)),
461
439
  emits: [
462
440
  "update:modelValue",
463
441
  "update:editing",
@@ -474,453 +452,464 @@ 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: ce, emit: ke }) {
456
+ const o = A, n = st(), C = Ke(), 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), z = 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)), H = d(o.mode === T.Create), j = d(!1), ue = d(!1), t = d(null), w = g(() => !H.value && Array.isArray(b.value) && b.value.includes(Re.Update)), y = g(() => !H.value && Array.isArray(b.value) && b.value.includes(Re.Drop)), ie = g(() => !H.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
+ H.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), oe.value === k.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(Q(o.createButton, s.defaultCreateButton)), P = d(Q(o.updateButton, s.defaultUpdateButton)), M = d(Q(o.dropButton, s.defaultDropButton)), ee = d(Q(o.editModeButton, s.defaultEditModeButton)), se = d(Q(o.groupButton, s.defaultGroupButton));
477
+ p(() => o.createButton, (e) => {
478
+ F.value = Q(e, s.defaultCreateButton);
479
+ }, { deep: !0 }), p(() => o.updateButton, (e) => {
480
+ P.value = Q(e, s.defaultUpdateButton);
481
+ }, { deep: !0 }), p(() => o.dropButton, (e) => {
482
+ M.value = Q(e, s.defaultDropButton);
483
+ }, { deep: !0 }), p(() => o.editModeButton, (e) => {
484
+ ee.value = Q(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 fe = async () => {
487
+ var e, a, O;
488
+ D("fetchItem"), r.value = !0, z.value = -1, $.value = !1, typeof ((e = o.events) == null ? void 0 : e.httpStart) == "function" && o.events.httpStart();
511
489
  try {
512
- 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({
490
+ const V = await ot(o.readResource, o.readData);
491
+ if (D("fetchItem -> response", V), r.value = !1, z.value = V.httpStatus, E.value = V.custom, !V.success) {
492
+ L.value = !1, z.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 = k.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, z.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 && Ye(() => 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
+ te.value && Le(), f("update:modelValue", l.value), D("item updated -> update dataState"), I.value.increment(e), oe.value === k.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() && fe();
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
+ te.value && (Oe.value = at(l.value, m.value, o.form));
547
527
  };
548
- 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());
528
+ Ze(() => {
529
+ o.readResource && !H.value ? fe() : (H.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" && (z.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), dt(o.modalConfig.modalName, o.modalConfig.modalKey, e.autoReloadId)) : (D("doAutoReloadId -> outsideModal"), o.readData.id = e.autoReloadId, D("doAutoReloadId -> turning off create mode"), H.value = !1, fe());
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
+ ue.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"), lt(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
+ ce({
617
597
  doDrop: () => {
618
- H.value && H.value.doDrop();
598
+ t.value && t.value.doDrop();
619
599
  },
620
- doRefresh: le,
600
+ doRefresh: fe,
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 We = g(() => {
610
+ var e, a, O;
611
+ return ge.value ? te.value ? x.value ? (e = o.modalConfig) == null ? void 0 : e.closeConfirm : "" : oe.value === k.Modifications ? G.value.changed() ? (a = o.modalConfig) == null ? void 0 : a.closeConfirm : "" : I.value.changed() ? (O = o.modalConfig) == null ? void 0 : O.closeConfirm : "" : "";
612
+ }), He = (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: ue.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 = g(() => o.title.startsWith("__:") ? String(rt(o.title.substring(3))) : o.title), Ge = g(() => r.value ? !1 : we.value.length > 0 || !!C["post-title"]), Se = g(() => o.view === Pe.Modal), $e = g(() => Se.value ? "lkt-modal" : "section"), me = g(() => {
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 || te.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
+ }), be = g(() => {
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 || te.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 = g(() => {
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 y.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 = g(() => $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: He,
639
+ closeConfirm: We.value,
660
640
  headerActionsButton: o.groupButton !== !1 ? {
661
- dot: fe.value || ce.value
641
+ dot: be.value || me.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
+ } : {}), te = g(() => typeof o.form == "object" && Object.keys(o.form).length > 0), Me = g(() => Object.keys(m.value).length === 0 ? [] : o.modificationViews), oe = g(() => Object.keys(m.value).length === 0 ? k.Current : k.Modifications), ge = g(() => H.value || w.value || y.value), ze = g(() => te.value ? nt(o.form) : []);
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: _(() => [
668
- _e("article", vt, [
669
- !Se.value && He.value ? (v(), J("header", ct, [
670
- n(C)["pre-title"] ? (v(), J("div", ft, [
671
- U(e.$slots, "pre-title", {
672
- item: u.value,
645
+ const O = ye("lkt-http-info"), V = ye("lkt-form"), Je = ye("lkt-loader");
646
+ return c(), R(_e($e.value), U(qe.value, { class: "lkt-item-crud" }), pe({
647
+ default: q(() => [
648
+ xe("article", mt, [
649
+ !Se.value && Ge.value ? (c(), W("header", bt, [
650
+ i(C)["pre-title"] ? (c(), W("div", gt, [
651
+ S(e.$slots, "pre-title", {
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, [
678
- U(e.$slots, "post-title", {
679
- item: u.value,
655
+ ])) : v("", !0),
656
+ we.value.length > 0 ? (c(), W("h1", yt, et(we.value), 1)) : v("", !0),
657
+ i(C)["post-title"] ? (c(), W("div", kt, [
658
+ S(e.$slots, "post-title", {
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 === i(Ae).Top && (e.groupButton === !1 || !e.groupButtonAsModalActions) && ge.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] = (u) => r.value = u),
670
+ editing: B.value,
671
+ "onUpdate:editing": a[4] || (a[4] = (u) => B.value = u),
672
+ "picked-modification-view": N.value,
673
+ "onUpdate:pickedModificationView": a[5] || (a[5] = (u) => N.value = u),
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": y.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": be.value,
692
+ "able-to-update": me.value,
713
693
  "able-to-drop": Ue.value,
714
694
  perms: b.value,
715
695
  "modification-view": Me.value,
716
696
  "editable-view": oe.value,
717
697
  onCreate: Ce,
718
- onSave: he,
719
- onDrop: De
720
- }, ge({ _: 2 }, [
721
- n(C)["prev-buttons-ever"] ? {
698
+ onSave: De,
699
+ onDrop: he
700
+ }, pe({ _: 2 }, [
701
+ i(C)["prev-buttons-ever"] ? {
722
702
  name: "prev-buttons-ever",
723
- fn: _(({ canUpdate: l, canDrop: ae, perms: ie }) => [
724
- U(e.$slots, "prev-buttons-ever", {
725
- canUpdate: l,
703
+ fn: q(({ canUpdate: u, canDrop: ae, perms: ne }) => [
704
+ S(e.$slots, "prev-buttons-ever", {
705
+ canUpdate: u,
726
706
  canDrop: ae,
727
- perms: ie
707
+ perms: ne
728
708
  })
729
709
  ]),
730
710
  key: "0"
731
711
  } : void 0,
732
- n(C)["prev-buttons"] ? {
712
+ i(C)["prev-buttons"] ? {
733
713
  name: "prev-buttons",
734
- fn: _(({ canUpdate: l, canDrop: ae, perms: ie }) => [
735
- U(e.$slots, "prev-buttons", {
736
- canUpdate: l,
714
+ fn: q(({ canUpdate: u, canDrop: ae, perms: ne }) => [
715
+ S(e.$slots, "prev-buttons", {
716
+ canUpdate: u,
737
717
  canDrop: ae,
738
- perms: ie
718
+ perms: ne
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(), W("div", Bt, [
725
+ L.value ? (c(), W("div", Ct, [
726
+ $.value && e.notificationType === i(_).Inline ? (c(), R(O, {
747
727
  key: 0,
748
- code: I.value,
749
- palette: I.value === 200 ? "success" : "danger",
728
+ code: z.value,
729
+ palette: z.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] = (u) => $.value = !1)
733
+ }, null, 8, ["code", "palette"])) : v("", !0),
734
+ te.value ? (c(), R(V, U({
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] = (u) => l.value = u),
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] = (u) => m.value = u),
740
+ valid: Y.value,
741
+ "onUpdate:valid": a[9] || (a[9] = (u) => Y.value = u),
742
+ changed: x.value,
743
+ "onUpdate:changed": a[10] || (a[10] = (u) => x.value = u)
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
750
  editableViews: [oe.value],
769
- disabled: !k.value
770
- }), null, 16, ["modelValue", "modifications", "valid"])) : U(e.$slots, "item", {
751
+ disabled: !B.value
752
+ }), pe({ _: 2 }, [
753
+ tt(ze.value, (u) => ({
754
+ name: u,
755
+ fn: q(({}) => [
756
+ S(e.$slots, u)
757
+ ])
758
+ }))
759
+ ]), 1040, ["modelValue", "modifications", "valid", "changed"])) : S(e.$slots, "item", {
771
760
  key: 2,
772
- item: u.value,
761
+ item: l.value,
773
762
  loading: r.value,
774
- editMode: k.value,
775
- isCreate: E.value,
776
- canUpdate: t.value,
777
- canDrop: w.value,
778
- itemBeingEdited: pe.value,
763
+ editMode: B.value,
764
+ isCreate: H.value,
765
+ canUpdate: w.value,
766
+ canDrop: y.value,
767
+ itemBeingEdited: j.value,
779
768
  perms: b.value
780
769
  })
781
- ])) : e.notificationType === n(ee).Inline ? (v(), A(q, {
770
+ ])) : e.notificationType === i(_).Inline ? (c(), R(O, {
782
771
  key: 1,
783
- code: I.value
784
- }, null, 8, ["code"])) : p("", !0)
772
+ code: z.value
773
+ }, null, 8, ["code"])) : v("", !0)
785
774
  ])),
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, {
775
+ r.value ? (c(), R(Je, { key: 3 })) : v("", !0),
776
+ e.buttonNavPosition === i(Ae).Bottom && (e.groupButton === !1 || !e.groupButtonAsModalActions) && ge.value ? (c(), R(Ee, {
788
777
  key: 4,
789
778
  ref_key: "buttonNav",
790
- ref: H,
779
+ ref: t,
791
780
  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,
781
+ "onUpdate:loading": a[11] || (a[11] = (u) => r.value = u),
782
+ editing: B.value,
783
+ "onUpdate:editing": a[12] || (a[12] = (u) => B.value = u),
784
+ "picked-modification-view": N.value,
785
+ "onUpdate:pickedModificationView": a[13] || (a[13] = (u) => N.value = u),
786
+ item: l.value,
798
787
  modifications: m.value,
799
788
  mode: e.mode,
800
789
  view: e.view,
801
790
  grouped: e.groupButton !== !1,
802
791
  "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,
792
+ "create-button": F.value,
793
+ "update-button": P.value,
794
+ "drop-button": M.value,
795
+ "edit-mode-button": ee.value,
796
+ "group-button": se.value,
797
+ "data-changed": h.value,
798
+ "http-success-read": L.value,
799
+ "can-update": w.value,
800
+ "can-drop": y.value,
801
+ "can-switch-edit-mode": ie.value,
813
802
  "group-button-as-modal-actions": e.groupButtonAsModalActions,
814
- "able-to-create": fe.value,
815
- "able-to-update": ce.value,
803
+ "able-to-create": be.value,
804
+ "able-to-update": me.value,
816
805
  "able-to-drop": Ue.value,
817
806
  perms: b.value,
818
807
  "modification-view": Me.value,
819
808
  "editable-view": oe.value,
820
809
  onCreate: Ce,
821
- onSave: he,
822
- onDrop: De
823
- }, ge({ _: 2 }, [
824
- n(C)["prev-buttons-ever"] ? {
810
+ onSave: De,
811
+ onDrop: he
812
+ }, pe({ _: 2 }, [
813
+ i(C)["prev-buttons-ever"] ? {
825
814
  name: "prev-buttons-ever",
826
- fn: _(() => [
827
- U(e.$slots, "prev-buttons-ever")
815
+ fn: q(() => [
816
+ S(e.$slots, "prev-buttons-ever")
828
817
  ]),
829
818
  key: "0"
830
819
  } : void 0,
831
- n(C)["prev-buttons"] ? {
820
+ i(C)["prev-buttons"] ? {
832
821
  name: "prev-buttons-ever",
833
- fn: _(() => [
834
- U(e.$slots, "prev-buttons")
822
+ fn: q(() => [
823
+ S(e.$slots, "prev-buttons")
835
824
  ]),
836
825
  key: "1"
837
826
  } : 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)
827
+ ]), 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
828
  ])
840
829
  ]),
841
830
  _: 2
842
831
  }, [
843
- e.groupButton !== !1 && e.groupButtonAsModalActions && be.value ? {
832
+ e.groupButton !== !1 && e.groupButtonAsModalActions && ge.value ? {
844
833
  name: "header-actions",
845
- fn: _(() => [
846
- e.buttonNavPosition === n(Re).Top ? (v(), A(Ae, {
834
+ fn: q(() => [
835
+ e.buttonNavPosition === i(Ae).Top ? (c(), R(Ee, {
847
836
  key: 0,
848
837
  ref_key: "buttonNav",
849
- ref: H,
838
+ ref: t,
850
839
  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,
840
+ "onUpdate:loading": a[0] || (a[0] = (u) => r.value = u),
841
+ editing: B.value,
842
+ "onUpdate:editing": a[1] || (a[1] = (u) => B.value = u),
843
+ "picked-modification-view": N.value,
844
+ "onUpdate:pickedModificationView": a[2] || (a[2] = (u) => N.value = u),
845
+ item: l.value,
857
846
  modifications: m.value,
858
847
  mode: e.mode,
859
848
  view: e.view,
860
849
  grouped: !0,
861
850
  "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,
851
+ "create-button": F.value,
852
+ "update-button": P.value,
853
+ "drop-button": M.value,
854
+ "edit-mode-button": ee.value,
855
+ "group-button": se.value,
856
+ "data-changed": h.value,
857
+ "http-success-read": L.value,
858
+ "can-update": w.value,
859
+ "can-drop": y.value,
860
+ "can-switch-edit-mode": ie.value,
872
861
  "group-button-as-modal-actions": e.groupButtonAsModalActions,
873
- "able-to-create": fe.value,
874
- "able-to-update": ce.value,
862
+ "able-to-create": be.value,
863
+ "able-to-update": me.value,
875
864
  "able-to-drop": Ue.value,
876
865
  perms: b.value,
877
866
  "modification-view": Me.value,
878
867
  "editable-view": oe.value,
879
868
  onCreate: Ce,
880
- onSave: he,
881
- onDrop: De
882
- }, ge({ _: 2 }, [
883
- n(C)["prev-buttons-ever"] ? {
869
+ onSave: De,
870
+ onDrop: he
871
+ }, pe({ _: 2 }, [
872
+ i(C)["prev-buttons-ever"] ? {
884
873
  name: "prev-buttons-ever",
885
- fn: _(({ canUpdate: l, canDrop: ae, perms: ie }) => [
886
- U(e.$slots, "prev-buttons-ever", {
887
- canUpdate: l,
874
+ fn: q(({ canUpdate: u, canDrop: ae, perms: ne }) => [
875
+ S(e.$slots, "prev-buttons-ever", {
876
+ canUpdate: u,
888
877
  canDrop: ae,
889
- perms: ie
878
+ perms: ne
890
879
  })
891
880
  ]),
892
881
  key: "0"
893
882
  } : void 0,
894
- n(C)["prev-buttons"] ? {
883
+ i(C)["prev-buttons"] ? {
895
884
  name: "prev-buttons",
896
- fn: _(({ canUpdate: l, canDrop: ae, perms: ie }) => [
897
- U(e.$slots, "prev-buttons", {
898
- canUpdate: l,
885
+ fn: q(({ canUpdate: u, canDrop: ae, perms: ne }) => [
886
+ S(e.$slots, "prev-buttons", {
887
+ canUpdate: u,
899
888
  canDrop: ae,
900
- perms: ie
889
+ perms: ne
901
890
  })
902
891
  ]),
903
892
  key: "1"
904
893
  } : 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)
894
+ ]), 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
895
  ]),
907
896
  key: "0"
908
897
  } : void 0
909
898
  ]), 1040);
910
899
  };
911
900
  }
912
- }), Rt = {
913
- install: (B, K = {}) => {
914
- B.component("lkt-item-crud") === void 0 && B.component("lkt-item-crud", kt);
901
+ }), Ot = {
902
+ install: (A, ce = {}) => {
903
+ A.component("lkt-item-crud") === void 0 && A.component("lkt-item-crud", Dt);
915
904
  }
916
- }, At = (B) => {
917
- se.defaultSaveIcon = B;
918
- }, Ot = (B) => {
919
- se.defaultDropIcon = B;
905
+ }, Lt = (A) => {
906
+ re.defaultSaveIcon = A;
907
+ }, Nt = (A) => {
908
+ re.defaultDropIcon = A;
920
909
  };
921
910
  export {
922
- It as debugLktItemCrud,
923
- Rt as default,
924
- Ot as setItemCrudDefaultDropIcon,
925
- At as setItemCrudDefaultSaveIcon
911
+ Et as debugLktItemCrud,
912
+ Ot as default,
913
+ Nt as setItemCrudDefaultDropIcon,
914
+ Lt as setItemCrudDefaultSaveIcon
926
915
  };