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