lkt-item-crud 2.0.35 → 2.0.37

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,18 +1,18 @@
1
- import { defineComponent as Je, ref as p, watch as C, useSlots as Qe, computed as b, resolveComponent as Be, createElementBlock as S, createCommentVNode as w, openBlock as n, createBlock as g, Fragment as F, renderSlot as I, withDirectives as B, mergeProps as v, normalizeProps as Me, unref as d, renderList as K, vShow as y, createVNode as J, withCtx as x, mergeDefaults as nt, nextTick as Ge, onMounted as ut, resolveDynamicComponent as it, createSlots as ge, toDisplayString as lt } from "vue";
2
- import { httpCall as rt } from "lkt-http-client";
3
- import { DataState as je } from "lkt-data-state";
4
- import { ModificationView as U, ItemCrudMode as V, ItemCrudButtonNavVisibility as qe, ButtonType as Fe, TablePermission as Ue, ensureButtonConfig as _, LktSettings as k, getFormDataState as dt, extractI18nValue as st, ItemCrudView as ze, getFormSlotKeys as vt, ItemCrudButtonNavPosition as Pe, NotificationType as ue, getDefaultValues as pt, ItemCrud as ft, ToastPositionX as fe } from "lkt-vue-kernel";
1
+ import { defineComponent as Je, ref as s, watch as w, useSlots as Qe, computed as y, resolveComponent as Ce, createElementBlock as S, createCommentVNode as C, openBlock as n, createBlock as c, Fragment as X, renderSlot as I, withDirectives as g, mergeProps as v, normalizeProps as Le, unref as d, renderList as z, vShow as B, createVNode as Y, withCtx as Z, mergeDefaults as nt, nextTick as Ge, onMounted as ut, resolveDynamicComponent as it, createSlots as ce, toDisplayString as lt } from "vue";
2
+ import { httpCall as dt } from "lkt-http-client";
3
+ import { DataState as Xe } from "lkt-data-state";
4
+ import { ModificationView as E, ItemCrudMode as V, ItemCrudButtonNavVisibility as qe, ButtonType as He, TablePermission as Ne, ensureButtonConfig as ae, LktSettings as k, getFormDataState as rt, extractI18nValue as st, ItemCrudView as ze, getFormSlotKeys as vt, ItemCrudButtonNavPosition as Re, NotificationType as de, getDefaultValues as pt, ItemCrud as ft, ToastPositionX as me } from "lkt-vue-kernel";
5
5
  import { closeModal as ct, updateModalKey as mt } from "lkt-modal";
6
- import { openToast as ce } from "lkt-toast";
6
+ import { openToast as be } from "lkt-toast";
7
7
  import { useRouter as bt } from "vue-router";
8
- const ye = class ye {
8
+ const De = class De {
9
9
  };
10
- ye.debugEnabled = !1, ye.defaultSaveIcon = "", ye.defaultDropIcon = "";
11
- let me = ye;
12
- const E = (...$) => {
13
- me.debugEnabled && console.info("[LktItemCrud] ", ...$);
14
- }, $t = ($ = !0) => {
15
- me.debugEnabled = $;
10
+ De.debugEnabled = !1, De.defaultSaveIcon = "", De.defaultDropIcon = "";
11
+ let ge = De;
12
+ const T = (...P) => {
13
+ ge.debugEnabled && console.info("[LktItemCrud] ", ...P);
14
+ }, $t = (P = !0) => {
15
+ ge.debugEnabled = P;
16
16
  }, gt = {
17
17
  key: 0,
18
18
  class: "lkt-item-crud-buttons"
@@ -25,7 +25,7 @@ const E = (...$) => {
25
25
  }, kt = {
26
26
  key: 2,
27
27
  class: "lkt-item-crud-buttons"
28
- }, Xe = /* @__PURE__ */ Je({
28
+ }, Oe = /* @__PURE__ */ Je({
29
29
  __name: "ButtonNav",
30
30
  props: {
31
31
  item: { default: () => ({}) },
@@ -60,7 +60,8 @@ const E = (...$) => {
60
60
  navStartButtons: {},
61
61
  navStartButtonsEditing: {},
62
62
  navEndButtons: {},
63
- navEndButtonsEditing: {}
63
+ navEndButtonsEditing: {},
64
+ updateConfig: {}
64
65
  },
65
66
  emits: [
66
67
  "update:loading",
@@ -70,431 +71,441 @@ const E = (...$) => {
70
71
  "save",
71
72
  "drop"
72
73
  ],
73
- setup($, { expose: ke, emit: Ee }) {
74
- const a = Ee, u = $, A = p(u.pickedModificationView);
75
- C(() => u.pickedModificationView, (e) => A.value = e), C(A, (e) => a("update:pickedModificationView", e));
76
- const h = Qe(), f = p(null), s = p(null), i = p(u.loading);
77
- C(() => u.loading, (e) => i.value = e), C(i, (e) => a("update:loading", e));
78
- const T = p(u.editing);
79
- C(() => u.editing, (e) => T.value = e), C(T, (e) => a("update:editing", e));
80
- const m = () => {
81
- i.value = !0;
82
- }, D = () => {
83
- i.value = !1;
84
- }, Q = (e, L) => {
85
- typeof e > "u" || a("create", e, L);
86
- }, ee = (e, L) => {
87
- typeof e > "u" || a("save", e, L);
88
- }, P = (e, L) => {
89
- typeof e > "u" || a("drop", e, L);
90
- }, N = b(() => u.editableView === U.Modifications ? u.modifications : u.item);
91
- ke({
74
+ setup(P, { expose: he, emit: $e }) {
75
+ const a = $e, i = P, M = s(i.pickedModificationView);
76
+ w(() => i.pickedModificationView, (t) => M.value = t), w(M, (t) => a("update:pickedModificationView", t));
77
+ const D = Qe(), m = s(null), p = s(null), U = s(null), ee = s(null), l = s(i.loading);
78
+ w(() => i.loading, (t) => l.value = t), w(l, (t) => {
79
+ i.updateConfig.executionMode === "blocking" && a("update:loading", t);
80
+ });
81
+ const f = s(i.editing);
82
+ w(() => i.editing, (t) => f.value = t), w(f, (t) => a("update:editing", t));
83
+ const O = () => {
84
+ l.value = !0;
85
+ }, R = () => {
86
+ l.value = !1;
87
+ }, L = (t, N) => {
88
+ typeof t > "u" || a("create", t, N);
89
+ }, oe = (t, N) => {
90
+ typeof t > "u" || a("save", t, N);
91
+ }, J = (t, N) => {
92
+ typeof t > "u" || a("drop", t, N);
93
+ }, h = y(() => i.editableView === E.Modifications ? i.modifications : i.item);
94
+ he({
92
95
  doSave: () => {
93
- f.value && typeof f.value.click == "function" && f.value.click();
96
+ if (A.value)
97
+ switch (i.mode) {
98
+ case V.Update:
99
+ U.value && typeof U.value.click == "function" && U.value.click();
100
+ break;
101
+ case V.Create:
102
+ m.value && typeof m.value.click == "function" && m.value.click();
103
+ break;
104
+ }
94
105
  },
95
106
  doDrop: () => {
96
- s.value && typeof s.value.click == "function" && s.value.click();
107
+ ee.value && typeof ee.value.click == "function" && ee.value.click();
97
108
  }
98
109
  });
99
- const W = b(() => !u.canDrop || u.dropButton === !1 ? !1 : !u.canUpdate && u.canDrop ? !0 : !i.value && u.editing && u.httpSuccessRead), M = b(() => u.mode === V.Create && (u.createButton === !1 || !u.canCreate) || u.mode === V.Update && (u.updateButton === !1 || !u.canUpdate) || i.value ? !1 : u.editing && u.httpSuccessRead), ne = b(() => u.editModeButton === !1 || !u.canSwitchEditMode || !u.canUpdate && !u.canDrop || !u.canUpdate && u.canDrop ? !1 : !i.value && u.mode !== V.Create && u.httpSuccessRead), Y = b(() => u.buttonNavVisibility === qe.Always || h["prev-buttons-ever"] ? !0 : u.buttonNavVisibility === qe.Never ? !1 : M.value || W.value || ne.value), G = b(() => u.modificationView === !1 ? [] : u.modificationView === !0 ? [
100
- U.Current,
101
- U.Modifications,
102
- U.SplitView,
103
- U.Differences
104
- ] : Array.isArray(u.modificationView) ? u.modificationView : []), se = b(() => {
105
- let e = [];
106
- return G.value.includes(U.Current) && e.push({
110
+ const ie = y(() => !i.canDrop || i.dropButton === !1 ? !1 : !i.canUpdate && i.canDrop ? !0 : !l.value && i.editing && i.httpSuccessRead), A = y(() => i.mode === V.Create && (i.createButton === !1 || !i.canCreate) || i.mode === V.Update && (i.updateButton === !1 || !i.canUpdate) || l.value ? !1 : i.editing && i.httpSuccessRead), ne = y(() => i.editModeButton === !1 || !i.canSwitchEditMode || !i.canUpdate && !i.canDrop || !i.canUpdate && i.canDrop ? !1 : !l.value && i.mode !== V.Create && i.httpSuccessRead), Se = y(() => i.buttonNavVisibility === qe.Always || D["prev-buttons-ever"] ? !0 : i.buttonNavVisibility === qe.Never ? !1 : A.value || ie.value || ne.value), j = y(() => i.modificationView === !1 ? [] : i.modificationView === !0 ? [
111
+ E.Current,
112
+ E.Modifications,
113
+ E.SplitView,
114
+ E.Differences
115
+ ] : Array.isArray(i.modificationView) ? i.modificationView : []), fe = y(() => {
116
+ let t = [];
117
+ return j.value.includes(E.Current) && t.push({
107
118
  text: "Current",
108
119
  icon: "lkt-icn-see",
109
- disabled: A.value === U.Current,
120
+ disabled: M.value === E.Current,
110
121
  events: {
111
122
  click: () => {
112
- A.value = U.Current;
123
+ M.value = E.Current;
113
124
  }
114
125
  }
115
- }), G.value.includes(U.Modifications) && e.push({
126
+ }), j.value.includes(E.Modifications) && t.push({
116
127
  text: "Modifications",
117
128
  icon: "lkt-icn-edit",
118
- disabled: A.value === U.Modifications,
129
+ disabled: M.value === E.Modifications,
119
130
  events: {
120
131
  click: () => {
121
- A.value = U.Modifications;
132
+ M.value = E.Modifications;
122
133
  }
123
134
  }
124
- }), G.value.includes(U.SplitView) && e.push({
135
+ }), j.value.includes(E.SplitView) && t.push({
125
136
  text: "Split View",
126
137
  icon: "lkt-icn-columns",
127
- disabled: A.value === U.SplitView,
138
+ disabled: M.value === E.SplitView,
128
139
  events: {
129
140
  click: () => {
130
- A.value = U.SplitView;
141
+ M.value = E.SplitView;
131
142
  }
132
143
  }
133
- }), G.value.includes(U.Differences) && e.push({
144
+ }), j.value.includes(E.Differences) && t.push({
134
145
  text: "Differences",
135
146
  icon: "lkt-icn-balance",
136
- disabled: A.value === U.Differences,
147
+ disabled: M.value === E.Differences,
137
148
  events: {
138
149
  click: () => {
139
- A.value = U.Differences;
150
+ M.value = E.Differences;
140
151
  }
141
152
  }
142
- }), e;
153
+ }), t;
143
154
  });
144
- return (e, L) => {
145
- var ae, oe, ve, j, q, pe;
146
- const l = Be("lkt-button");
147
- return Y.value ? (n(), S("div", gt, [
148
- e.grouped && e.groupButtonAsModalActions ? (n(), S(F, { key: 0 }, [
149
- ne.value ? (n(), g(l, v({ key: 0 }, e.editModeButton, {
150
- checked: T.value,
151
- "onUpdate:checked": L[0] || (L[0] = (c) => T.value = c),
155
+ return (t, N) => {
156
+ var re, F, K, se, W, G;
157
+ const r = Ce("lkt-button");
158
+ return Se.value ? (n(), S("div", gt, [
159
+ t.grouped && t.groupButtonAsModalActions ? (n(), S(X, { key: 0 }, [
160
+ ne.value ? (n(), c(r, v({ key: 0 }, t.editModeButton, {
161
+ checked: f.value,
162
+ "onUpdate:checked": N[0] || (N[0] = (b) => f.value = b),
152
163
  class: "lkt-item-crud--switch-mode-button"
153
- }), null, 16, ["checked"])) : w("", !0),
154
- G.value.length > 0 ? (n(), g(l, Me(v({ key: 1 }, {
155
- type: d(Fe).Tooltip,
164
+ }), null, 16, ["checked"])) : C("", !0),
165
+ j.value.length > 0 ? (n(), c(r, Le(v({ key: 1 }, {
166
+ type: d(He).Tooltip,
156
167
  icon: "lkt-icn-cross-arrows",
157
168
  class: "lkt-item-crud--modifications-button",
158
- splitButtons: se.value,
169
+ splitButtons: fe.value,
159
170
  tooltip: {
160
171
  contentClass: "lkt-flex-column"
161
172
  }
162
- })), null, 16)) : w("", !0),
163
- (n(!0), S(F, null, K(e.navStartButtons, (c) => B((n(), g(l, v({ ref_for: !0 }, c), null, 16)), [
164
- [y, !i.value]
173
+ })), null, 16)) : C("", !0),
174
+ (n(!0), S(X, null, z(t.navStartButtons, (b) => g((n(), c(r, v({ ref_for: !0 }, b), null, 16)), [
175
+ [B, !l.value]
165
176
  ])), 256)),
166
- d(h)["prev-buttons-ever"] ? I(e.$slots, "prev-buttons-ever", {
177
+ d(D)["prev-buttons-ever"] ? I(t.$slots, "prev-buttons-ever", {
167
178
  key: 2,
168
- canUpdate: e.canUpdate,
169
- canDrop: e.canDrop,
170
- perms: e.perms
171
- }) : w("", !0),
172
- (n(!0), S(F, null, K(e.navStartButtonsEditing, (c) => B((n(), g(l, v({ ref_for: !0 }, c), null, 16)), [
173
- [y, T.value && !i.value]
179
+ canUpdate: t.canUpdate,
180
+ canDrop: t.canDrop,
181
+ perms: t.perms
182
+ }) : C("", !0),
183
+ (n(!0), S(X, null, z(t.navStartButtonsEditing, (b) => g((n(), c(r, v({ ref_for: !0 }, b), null, 16)), [
184
+ [B, f.value && !l.value]
174
185
  ])), 256)),
175
- d(h)["prev-buttons"] ? I(e.$slots, "prev-buttons", {
186
+ d(D)["prev-buttons"] ? I(t.$slots, "prev-buttons", {
176
187
  key: 3,
177
- canUpdate: e.canUpdate,
178
- canDrop: e.canDrop,
179
- perms: e.perms
180
- }) : w("", !0),
181
- B(J(l, v({
188
+ canUpdate: t.canUpdate,
189
+ canDrop: t.canDrop,
190
+ perms: t.perms
191
+ }) : C("", !0),
192
+ g(Y(r, v({
182
193
  ref_key: "saveButtonRef",
183
- ref: f
194
+ ref: U
184
195
  }, {
185
- ...e.updateButton,
196
+ ...t.updateButton,
186
197
  resourceData: {
187
- ...(ae = e.updateButton) == null ? void 0 : ae.resourceData,
188
- ...N.value
198
+ ...(re = t.updateButton) == null ? void 0 : re.resourceData,
199
+ ...h.value
189
200
  },
190
- disabled: !e.ableToUpdate
201
+ disabled: !t.ableToUpdate
191
202
  }, {
192
- onLoading: m,
193
- onLoaded: D,
194
- onClick: ee
203
+ onLoading: O,
204
+ onLoaded: R,
205
+ onClick: oe
195
206
  }), null, 16), [
196
- [y, e.mode === d(V).Update && M.value]
207
+ [B, t.mode === d(V).Update && A.value]
197
208
  ]),
198
- B(J(l, v({
199
- ref_key: "saveButtonRef",
200
- ref: f
209
+ g(Y(r, v({
210
+ ref_key: "createButtonRef",
211
+ ref: m
201
212
  }, {
202
- ...e.createButton,
213
+ ...t.createButton,
203
214
  resourceData: {
204
- ...(oe = e.createButton) == null ? void 0 : oe.resourceData,
205
- ...N.value
215
+ ...(F = t.createButton) == null ? void 0 : F.resourceData,
216
+ ...h.value
206
217
  },
207
- disabled: !e.ableToCreate
218
+ disabled: !t.ableToCreate
208
219
  }, {
209
- onLoading: m,
210
- onLoaded: D,
211
- onClick: Q
220
+ onLoading: O,
221
+ onLoaded: R,
222
+ onClick: L
212
223
  }), null, 16), [
213
- [y, e.mode === d(V).Create && M.value]
224
+ [B, t.mode === d(V).Create && A.value]
214
225
  ]),
215
- B(J(l, v({
216
- ref_key: "saveButtonRef",
217
- ref: f
226
+ g(Y(r, v({
227
+ ref_key: "createAndNewButtonRef",
228
+ ref: p
218
229
  }, {
219
- ...e.createAndNewButton,
230
+ ...t.createAndNewButton,
220
231
  resourceData: {
221
- ...(ve = e.createAndNewButton) == null ? void 0 : ve.resourceData,
222
- ...N.value
232
+ ...(K = t.createAndNewButton) == null ? void 0 : K.resourceData,
233
+ ...h.value
223
234
  },
224
- disabled: !e.ableToCreate
235
+ disabled: !t.ableToCreate
225
236
  }, {
226
- onLoading: m,
227
- onLoaded: D,
228
- onClick: Q
237
+ onLoading: O,
238
+ onLoaded: R,
239
+ onClick: L
229
240
  }), null, 16), [
230
- [y, e.mode === d(V).Create && M.value && e.ableToCreateAndNew]
241
+ [B, t.mode === d(V).Create && A.value && t.ableToCreateAndNew]
231
242
  ]),
232
- B(J(l, v({
243
+ g(Y(r, v({
233
244
  ref_key: "dropButtonRef",
234
- ref: s
235
- }, e.dropButton, {
236
- disabled: !e.ableToDrop,
237
- onLoading: m,
238
- onLoaded: D,
239
- onClick: P
245
+ ref: ee
246
+ }, t.dropButton, {
247
+ disabled: !t.ableToDrop,
248
+ onLoading: O,
249
+ onLoaded: R,
250
+ onClick: J
240
251
  }), null, 16, ["disabled"]), [
241
- [y, W.value && e.mode !== d(V).Create]
252
+ [B, ie.value && t.mode !== d(V).Create]
242
253
  ]),
243
- d(h).buttons ? I(e.$slots, "buttons", { key: 4 }) : w("", !0),
244
- (n(!0), S(F, null, K(e.navEndButtons, (c) => B((n(), g(l, v({ ref_for: !0 }, c), null, 16)), [
245
- [y, !i.value]
254
+ d(D).buttons ? I(t.$slots, "buttons", { key: 4 }) : C("", !0),
255
+ (n(!0), S(X, null, z(t.navEndButtons, (b) => g((n(), c(r, v({ ref_for: !0 }, b), null, 16)), [
256
+ [B, !l.value]
246
257
  ])), 256)),
247
- (n(!0), S(F, null, K(e.navEndButtonsEditing, (c) => B((n(), g(l, v({ ref_for: !0 }, c), null, 16)), [
248
- [y, T.value && !i.value]
258
+ (n(!0), S(X, null, z(t.navEndButtonsEditing, (b) => g((n(), c(r, v({ ref_for: !0 }, b), null, 16)), [
259
+ [B, f.value && !l.value]
249
260
  ])), 256))
250
- ], 64)) : e.grouped ? (n(), g(l, v({
261
+ ], 64)) : t.grouped ? (n(), c(r, v({
251
262
  key: 1,
252
263
  ref: "groupButton"
253
- }, e.groupButton, { class: "lkt-item-crud-group-button" }), {
254
- split: x(() => {
255
- var c, z, ie;
264
+ }, t.groupButton, { class: "lkt-item-crud-group-button" }), {
265
+ split: Z(() => {
266
+ var b, ve, pe;
256
267
  return [
257
- ne.value ? (n(), g(l, v({ key: 0 }, e.editModeButton, {
258
- checked: T.value,
259
- "onUpdate:checked": L[1] || (L[1] = (X) => T.value = X),
268
+ ne.value ? (n(), c(r, v({ key: 0 }, t.editModeButton, {
269
+ checked: f.value,
270
+ "onUpdate:checked": N[1] || (N[1] = (Q) => f.value = Q),
260
271
  class: "lkt-item-crud--switch-mode-button"
261
- }), null, 16, ["checked"])) : w("", !0),
262
- G.value.length > 0 ? (n(), g(l, Me(v({ key: 1 }, {
263
- type: d(Fe).Tooltip,
272
+ }), null, 16, ["checked"])) : C("", !0),
273
+ j.value.length > 0 ? (n(), c(r, Le(v({ key: 1 }, {
274
+ type: d(He).Tooltip,
264
275
  icon: "lkt-icn-cross-arrows",
265
276
  class: "lkt-item-crud--modifications-button",
266
- splitButtons: se.value,
277
+ splitButtons: fe.value,
267
278
  tooltip: {
268
279
  contentClass: "lkt-flex-column"
269
280
  }
270
- })), null, 16)) : w("", !0),
271
- (n(!0), S(F, null, K(e.navStartButtons, (X) => B((n(), g(l, v({ ref_for: !0 }, X), null, 16)), [
272
- [y, !i.value]
281
+ })), null, 16)) : C("", !0),
282
+ (n(!0), S(X, null, z(t.navStartButtons, (Q) => g((n(), c(r, v({ ref_for: !0 }, Q), null, 16)), [
283
+ [B, !l.value]
273
284
  ])), 256)),
274
- d(h)["prev-buttons-ever"] ? I(e.$slots, "prev-buttons-ever", {
285
+ d(D)["prev-buttons-ever"] ? I(t.$slots, "prev-buttons-ever", {
275
286
  key: 2,
276
- canUpdate: e.canUpdate,
277
- canDrop: e.canDrop,
278
- perms: e.perms
279
- }) : w("", !0),
280
- (n(!0), S(F, null, K(e.navStartButtonsEditing, (X) => B((n(), g(l, v({ ref_for: !0 }, X), null, 16)), [
281
- [y, T.value && !i.value]
287
+ canUpdate: t.canUpdate,
288
+ canDrop: t.canDrop,
289
+ perms: t.perms
290
+ }) : C("", !0),
291
+ (n(!0), S(X, null, z(t.navStartButtonsEditing, (Q) => g((n(), c(r, v({ ref_for: !0 }, Q), null, 16)), [
292
+ [B, f.value && !l.value]
282
293
  ])), 256)),
283
- d(h)["prev-buttons"] ? I(e.$slots, "prev-buttons", {
294
+ d(D)["prev-buttons"] ? I(t.$slots, "prev-buttons", {
284
295
  key: 3,
285
- canUpdate: e.canUpdate,
286
- canDrop: e.canDrop,
287
- perms: e.perms
288
- }) : w("", !0),
289
- B(J(l, v({
296
+ canUpdate: t.canUpdate,
297
+ canDrop: t.canDrop,
298
+ perms: t.perms
299
+ }) : C("", !0),
300
+ g(Y(r, v({
290
301
  ref_key: "saveButtonRef",
291
- ref: f
302
+ ref: U
292
303
  }, {
293
- ...e.updateButton,
304
+ ...t.updateButton,
294
305
  resourceData: {
295
- ...(c = e.updateButton) == null ? void 0 : c.resourceData,
296
- ...N.value
306
+ ...(b = t.updateButton) == null ? void 0 : b.resourceData,
307
+ ...h.value
297
308
  },
298
- disabled: !e.ableToUpdate
309
+ disabled: !t.ableToUpdate
299
310
  }, {
300
- onLoading: m,
301
- onLoaded: D,
302
- onClick: ee
311
+ onLoading: O,
312
+ onLoaded: R,
313
+ onClick: oe
303
314
  }), null, 16), [
304
- [y, e.mode === d(V).Update && M.value]
315
+ [B, t.mode === d(V).Update && A.value]
305
316
  ]),
306
- B(J(l, v({
307
- ref_key: "saveButtonRef",
308
- ref: f
317
+ g(Y(r, v({
318
+ ref_key: "createButtonRef",
319
+ ref: m
309
320
  }, {
310
- ...e.createButton,
321
+ ...t.createButton,
311
322
  resourceData: {
312
- ...(z = e.createButton) == null ? void 0 : z.resourceData,
313
- ...N.value
323
+ ...(ve = t.createButton) == null ? void 0 : ve.resourceData,
324
+ ...h.value
314
325
  },
315
- disabled: !e.ableToCreate
326
+ disabled: !t.ableToCreate
316
327
  }, {
317
- disabled: !e.ableToCreate,
318
- onLoading: m,
319
- onLoaded: D,
320
- onClick: Q
328
+ disabled: !t.ableToCreate,
329
+ onLoading: O,
330
+ onLoaded: R,
331
+ onClick: L
321
332
  }), null, 16, ["disabled"]), [
322
- [y, e.mode === d(V).Create && M.value]
333
+ [B, t.mode === d(V).Create && A.value]
323
334
  ]),
324
- B(J(l, v({
325
- ref_key: "saveButtonRef",
326
- ref: f
335
+ g(Y(r, v({
336
+ ref_key: "createAndNewButtonRef",
337
+ ref: p
327
338
  }, {
328
- ...e.createAndNewButton,
339
+ ...t.createAndNewButton,
329
340
  resourceData: {
330
- ...(ie = e.createAndNewButton) == null ? void 0 : ie.resourceData,
331
- ...N.value
341
+ ...(pe = t.createAndNewButton) == null ? void 0 : pe.resourceData,
342
+ ...h.value
332
343
  },
333
- disabled: !e.ableToCreate
344
+ disabled: !t.ableToCreate
334
345
  }, {
335
- disabled: !e.ableToCreate,
336
- onLoading: m,
337
- onLoaded: D,
338
- onClick: Q
346
+ disabled: !t.ableToCreate,
347
+ onLoading: O,
348
+ onLoaded: R,
349
+ onClick: L
339
350
  }), null, 16, ["disabled"]), [
340
- [y, e.mode === d(V).Create && M.value && e.ableToCreateAndNew]
351
+ [B, t.mode === d(V).Create && A.value && t.ableToCreateAndNew]
341
352
  ]),
342
- B(J(l, v({
353
+ g(Y(r, v({
343
354
  ref_key: "dropButtonRef",
344
- ref: s
345
- }, e.dropButton, {
346
- disabled: !e.ableToDrop,
347
- onLoading: m,
348
- onLoaded: D,
349
- onClick: P
355
+ ref: ee
356
+ }, t.dropButton, {
357
+ disabled: !t.ableToDrop,
358
+ onLoading: O,
359
+ onLoaded: R,
360
+ onClick: J
350
361
  }), null, 16, ["disabled"]), [
351
- [y, W.value && e.mode !== d(V).Create]
362
+ [B, ie.value && t.mode !== d(V).Create]
352
363
  ]),
353
- d(h).buttons ? I(e.$slots, "buttons", { key: 4 }) : w("", !0),
354
- (n(!0), S(F, null, K(e.navEndButtons, (X) => B((n(), g(l, v({ ref_for: !0 }, X), null, 16)), [
355
- [y, !i.value]
364
+ d(D).buttons ? I(t.$slots, "buttons", { key: 4 }) : C("", !0),
365
+ (n(!0), S(X, null, z(t.navEndButtons, (Q) => g((n(), c(r, v({ ref_for: !0 }, Q), null, 16)), [
366
+ [B, !l.value]
356
367
  ])), 256)),
357
- (n(!0), S(F, null, K(e.navEndButtonsEditing, (X) => B((n(), g(l, v({ ref_for: !0 }, X), null, 16)), [
358
- [y, T.value && !i.value]
368
+ (n(!0), S(X, null, z(t.navEndButtonsEditing, (Q) => g((n(), c(r, v({ ref_for: !0 }, Q), null, 16)), [
369
+ [B, f.value && !l.value]
359
370
  ])), 256))
360
371
  ];
361
372
  }),
362
373
  _: 3
363
- }, 16)) : (n(), S(F, { key: 2 }, [
364
- (n(!0), S(F, null, K(e.navStartButtons, (c) => B((n(), g(l, v({ ref_for: !0 }, c), null, 16)), [
365
- [y, !i.value]
374
+ }, 16)) : (n(), S(X, { key: 2 }, [
375
+ (n(!0), S(X, null, z(t.navStartButtons, (b) => g((n(), c(r, v({ ref_for: !0 }, b), null, 16)), [
376
+ [B, !l.value]
366
377
  ])), 256)),
367
- d(h)["prev-buttons-ever"] ? B((n(), S("div", Bt, [
368
- I(e.$slots, "prev-buttons-ever", {
369
- canUpdate: e.canUpdate,
370
- canDrop: e.canDrop,
371
- perms: e.perms
378
+ d(D)["prev-buttons-ever"] ? g((n(), S("div", Bt, [
379
+ I(t.$slots, "prev-buttons-ever", {
380
+ canUpdate: t.canUpdate,
381
+ canDrop: t.canDrop,
382
+ perms: t.perms
372
383
  })
373
384
  ], 512)), [
374
- [y, !i.value]
375
- ]) : w("", !0),
376
- (n(!0), S(F, null, K(e.navStartButtonsEditing, (c) => B((n(), g(l, v({ ref_for: !0 }, c), null, 16)), [
377
- [y, T.value && !i.value]
385
+ [B, !l.value]
386
+ ]) : C("", !0),
387
+ (n(!0), S(X, null, z(t.navStartButtonsEditing, (b) => g((n(), c(r, v({ ref_for: !0 }, b), null, 16)), [
388
+ [B, f.value && !l.value]
378
389
  ])), 256)),
379
- d(h)["prev-buttons"] ? B((n(), S("div", yt, [
380
- I(e.$slots, "prev-buttons", {
381
- canUpdate: e.canUpdate,
382
- canDrop: e.canDrop,
383
- perms: e.perms
390
+ d(D)["prev-buttons"] ? g((n(), S("div", yt, [
391
+ I(t.$slots, "prev-buttons", {
392
+ canUpdate: t.canUpdate,
393
+ canDrop: t.canDrop,
394
+ perms: t.perms
384
395
  })
385
396
  ], 512)), [
386
- [y, T.value && !i.value]
387
- ]) : w("", !0),
388
- B(J(l, v({
397
+ [B, f.value && !l.value]
398
+ ]) : C("", !0),
399
+ g(Y(r, v({
389
400
  ref_key: "saveButtonRef",
390
- ref: f
401
+ ref: U
391
402
  }, {
392
- ...e.updateButton,
403
+ ...t.updateButton,
393
404
  resourceData: {
394
- ...(j = e.updateButton) == null ? void 0 : j.resourceData,
395
- ...N.value
405
+ ...(se = t.updateButton) == null ? void 0 : se.resourceData,
406
+ ...h.value
396
407
  },
397
- disabled: !e.ableToUpdate
408
+ disabled: !t.ableToUpdate
398
409
  }, {
399
- onLoading: m,
400
- onLoaded: D,
401
- onClick: ee
410
+ onLoading: O,
411
+ onLoaded: R,
412
+ onClick: oe
402
413
  }), null, 16), [
403
- [y, e.mode === d(V).Update && M.value]
414
+ [B, t.mode === d(V).Update && A.value]
404
415
  ]),
405
- B(J(l, v({
406
- ref_key: "saveButtonRef",
407
- ref: f
416
+ g(Y(r, v({
417
+ ref_key: "createButtonRef",
418
+ ref: m
408
419
  }, {
409
- ...e.createButton,
420
+ ...t.createButton,
410
421
  resourceData: {
411
- ...(q = e.createButton) == null ? void 0 : q.resourceData,
412
- ...N.value
422
+ ...(W = t.createButton) == null ? void 0 : W.resourceData,
423
+ ...h.value
413
424
  },
414
- disabled: !e.ableToCreate
425
+ disabled: !t.ableToCreate
415
426
  }, {
416
- onLoading: m,
417
- onLoaded: D,
418
- onClick: Q
427
+ onLoading: O,
428
+ onLoaded: R,
429
+ onClick: L
419
430
  }), null, 16), [
420
- [y, e.mode === d(V).Create && M.value]
431
+ [B, t.mode === d(V).Create && A.value]
421
432
  ]),
422
- B(J(l, v({
423
- ref_key: "saveButtonRef",
424
- ref: f
433
+ g(Y(r, v({
434
+ ref_key: "createAndNewButtonRef",
435
+ ref: p
425
436
  }, {
426
- ...e.createAndNewButton,
437
+ ...t.createAndNewButton,
427
438
  resourceData: {
428
- ...(pe = e.createAndNewButton) == null ? void 0 : pe.resourceData,
429
- ...N.value
439
+ ...(G = t.createAndNewButton) == null ? void 0 : G.resourceData,
440
+ ...h.value
430
441
  },
431
- disabled: !e.ableToCreate
442
+ disabled: !t.ableToCreate
432
443
  }, {
433
- onLoading: m,
434
- onLoaded: D,
435
- onClick: Q
444
+ onLoading: O,
445
+ onLoaded: R,
446
+ onClick: L
436
447
  }), null, 16), [
437
- [y, e.mode === d(V).Create && M.value && e.ableToCreateAndNew]
448
+ [B, t.mode === d(V).Create && A.value && t.ableToCreateAndNew]
438
449
  ]),
439
- B(J(l, v({
450
+ g(Y(r, v({
440
451
  ref_key: "dropButtonRef",
441
- ref: s
442
- }, e.dropButton, {
443
- disabled: !e.ableToDrop,
444
- onLoading: m,
445
- onLoaded: D,
446
- onClick: P
452
+ ref: ee
453
+ }, t.dropButton, {
454
+ disabled: !t.ableToDrop,
455
+ onLoading: O,
456
+ onLoaded: R,
457
+ onClick: J
447
458
  }), null, 16, ["disabled"]), [
448
- [y, W.value && e.mode !== d(V).Create]
459
+ [B, ie.value && t.mode !== d(V).Create]
449
460
  ]),
450
- d(h).buttons ? B((n(), S("div", kt, [
451
- I(e.$slots, "buttons")
461
+ d(D).buttons ? g((n(), S("div", kt, [
462
+ I(t.$slots, "buttons")
452
463
  ], 512)), [
453
- [y, T.value && !i.value]
454
- ]) : w("", !0),
455
- (n(!0), S(F, null, K(e.navEndButtons, (c) => B((n(), g(l, v({ ref_for: !0 }, c), null, 16)), [
456
- [y, !i.value]
464
+ [B, f.value && !l.value]
465
+ ]) : C("", !0),
466
+ (n(!0), S(X, null, z(t.navEndButtons, (b) => g((n(), c(r, v({ ref_for: !0 }, b), null, 16)), [
467
+ [B, !l.value]
457
468
  ])), 256)),
458
- (n(!0), S(F, null, K(e.navEndButtonsEditing, (c) => B((n(), g(l, v({ ref_for: !0 }, c), null, 16)), [
459
- [y, T.value && !i.value]
469
+ (n(!0), S(X, null, z(t.navEndButtonsEditing, (b) => g((n(), c(r, v({ ref_for: !0 }, b), null, 16)), [
470
+ [B, f.value && !l.value]
460
471
  ])), 256)),
461
- G.value.length > 0 ? (n(), g(l, Me(v({ key: 3 }, {
462
- type: d(Fe).Tooltip,
472
+ j.value.length > 0 ? (n(), c(r, Le(v({ key: 3 }, {
473
+ type: d(He).Tooltip,
463
474
  icon: "lkt-icn-cross-arrows",
464
475
  class: "lkt-item-crud--modifications-button",
465
- splitButtons: se.value,
476
+ splitButtons: fe.value,
466
477
  tooltip: {
467
478
  contentClass: "lkt-flex-column"
468
479
  }
469
- })), null, 16)) : w("", !0),
470
- ne.value ? (n(), g(l, v({ key: 4 }, e.editModeButton, {
471
- checked: T.value,
472
- "onUpdate:checked": L[2] || (L[2] = (c) => T.value = c),
480
+ })), null, 16)) : C("", !0),
481
+ ne.value ? (n(), c(r, v({ key: 4 }, t.editModeButton, {
482
+ checked: f.value,
483
+ "onUpdate:checked": N[2] || (N[2] = (b) => f.value = b),
473
484
  class: "lkt-item-crud--switch-mode-button"
474
- }), null, 16, ["checked"])) : w("", !0)
485
+ }), null, 16, ["checked"])) : C("", !0)
475
486
  ], 64))
476
- ])) : w("", !0);
487
+ ])) : C("", !0);
477
488
  };
478
489
  }
479
- }), Ct = {
490
+ }), wt = {
480
491
  key: 1,
481
492
  class: "lkt-item-crud_header"
482
- }, wt = {
493
+ }, Ct = {
483
494
  key: 0,
484
495
  class: "lkt-item-crud_header-slot"
485
- }, ht = {
496
+ }, Dt = {
486
497
  key: 1,
487
498
  class: "lkt-item-crud_header-title"
488
- }, Dt = {
499
+ }, ht = {
489
500
  key: 2,
490
501
  class: "lkt-item-crud_header-slot"
491
502
  }, St = {
492
- key: 3,
503
+ key: 4,
493
504
  class: "lkt-item-crud_content"
494
505
  }, Ut = {
495
506
  key: 0,
496
507
  class: "lkt-grid-1"
497
- }, Mt = /* @__PURE__ */ Je({
508
+ }, Et = /* @__PURE__ */ Je({
498
509
  __name: "LktItemCrud",
499
510
  props: /* @__PURE__ */ nt({
500
511
  modelValue: {},
@@ -534,7 +545,8 @@ const E = (...$) => {
534
545
  navStartButtonsEditing: {},
535
546
  navEndButtons: {},
536
547
  navEndButtonsEditing: {},
537
- events: {}
548
+ events: {},
549
+ updateConfig: {}
538
550
  }, pt(ft)),
539
551
  emits: [
540
552
  "update:modelValue",
@@ -552,489 +564,568 @@ const E = (...$) => {
552
564
  "error",
553
565
  "modified-data"
554
566
  ],
555
- setup($, { expose: ke, emit: Ee }) {
556
- const a = $, u = bt(), A = Qe(), h = Ee, f = p(!0), s = p(a.modelValue), i = p(a.modifications), T = p(a.customData), m = p(a.perms), D = p(a.editing), Q = p(!1), ee = p(!1), P = p(!1), N = p(!1), te = p(200), O = p(new je(s.value, a.dataStateConfig)), W = p(new je(i.value, a.dataStateConfig)), M = p(!1), ne = p(new je(a.readData)), Y = p(a.mode === V.Create), G = p(!1), se = p(!1), e = p(null), L = p(null), l = b(() => Y.value && a.createButton !== !1 && Array.isArray(m.value) && m.value.includes(Ue.Create)), ae = b(() => !Y.value && a.updateButton !== !1 && Array.isArray(m.value) && m.value.includes(Ue.Update)), oe = b(() => !Y.value && a.dropButton !== !1 && Array.isArray(m.value) && m.value.includes(Ue.Drop)), ve = b(() => a.editModeButton !== !1 && !Y.value && Array.isArray(m.value) && m.value.includes(Ue.SwitchEditMode)), j = p(a.visibleView);
557
- C(() => a.visibleView, (t) => {
558
- j.value = t;
559
- }), C(j, (t) => {
560
- h("update:visibleView", t);
561
- }), C(() => a.mode, (t) => {
562
- Y.value = t === V.Create;
563
- }), C(() => a.perms, (t) => {
564
- m.value = t;
565
- }), C(m, (t) => {
566
- h("update:perms", t);
567
- }), C(() => a.customData, (t) => {
568
- T.value = t;
569
- }), C(T, (t) => {
570
- h("update:customData", t);
571
- }), C(() => a.modifications, (t) => {
572
- W.value.increment(t), i.value = t;
573
- }, { deep: !0 }), C(i, (t) => {
574
- Ae(), W.value.increment(t), le.value === U.Modifications && (M.value = W.value.changed()), h("update:modifications", t);
567
+ setup(P, { expose: he, emit: $e }) {
568
+ const a = P, i = bt(), M = Qe(), D = $e, m = s(!0), p = s(a.modelValue), U = s(a.modifications), ee = s(a.customData), l = s(a.perms), f = s(a.editing), O = s(!1), R = s(!1), L = s(!1), oe = s(!1), J = s(200), h = s(new Xe(p.value, a.dataStateConfig)), ue = s(new Xe(U.value, a.dataStateConfig)), H = s(!1), ie = s(new Xe(a.readData)), A = s(a.mode === V.Create), ne = s(!1), Se = s(!1), j = s(null), fe = s(null), t = y(() => A.value && a.createButton !== !1 && Array.isArray(l.value) && l.value.includes(Ne.Create)), N = y(() => !A.value && a.updateButton !== !1 && Array.isArray(l.value) && l.value.includes(Ne.Update)), r = y(() => !A.value && a.dropButton !== !1 && Array.isArray(l.value) && l.value.includes(Ne.Drop)), re = y(() => a.editModeButton !== !1 && !A.value && Array.isArray(l.value) && l.value.includes(Ne.SwitchEditMode)), F = s(a.visibleView);
569
+ w(() => a.visibleView, (e) => {
570
+ F.value = e;
571
+ }), w(F, (e) => {
572
+ D("update:visibleView", e);
573
+ }), w(() => a.mode, (e) => {
574
+ A.value = e === V.Create;
575
+ }), w(() => a.perms, (e) => {
576
+ l.value = e;
577
+ }), w(l, (e) => {
578
+ D("update:perms", e);
579
+ }), w(() => a.customData, (e) => {
580
+ ee.value = e;
581
+ }), w(ee, (e) => {
582
+ D("update:customData", e);
583
+ }), w(() => a.modifications, (e) => {
584
+ ue.value.increment(e), U.value = e;
585
+ }, { deep: !0 }), w(U, (e) => {
586
+ je(), ue.value.increment(e), le.value === E.Modifications && (H.value = ue.value.changed()), D("update:modifications", e);
575
587
  }, { deep: !0 });
576
- const q = p(_(a.createButton, k.defaultCreateButton)), pe = p(_(a.createAndNewButton, a.createButton)), c = p(_(a.updateButton, k.defaultUpdateButton)), z = p(_(a.dropButton, k.defaultDropButton)), ie = p(_(a.editModeButton, k.defaultEditModeButton)), X = p(_(a.groupButton, k.defaultGroupButton));
577
- C(() => a.createButton, (t) => {
578
- q.value = _(t, k.defaultCreateButton);
579
- }, { deep: !0 }), C(() => a.updateButton, (t) => {
580
- c.value = _(t, k.defaultUpdateButton);
581
- }, { deep: !0 }), C(() => a.dropButton, (t) => {
582
- z.value = _(t, k.defaultDropButton);
583
- }, { deep: !0 }), C(() => a.editModeButton, (t) => {
584
- ie.value = _(t, k.defaultEditModeButton);
588
+ const K = s(ae(a.createButton, k.defaultCreateButton)), se = s(ae(a.createAndNewButton, a.createButton)), W = s(ae(a.updateButton, k.defaultUpdateButton)), G = s(ae(a.dropButton, k.defaultDropButton)), b = s(ae(a.editModeButton, k.defaultEditModeButton)), ve = s(ae(a.groupButton, k.defaultGroupButton));
589
+ w(() => a.createButton, (e) => {
590
+ K.value = ae(e, k.defaultCreateButton);
591
+ }, { deep: !0 }), w(() => a.updateButton, (e) => {
592
+ W.value = ae(e, k.defaultUpdateButton);
593
+ }, { deep: !0 }), w(() => a.dropButton, (e) => {
594
+ G.value = ae(e, k.defaultDropButton);
595
+ }, { deep: !0 }), w(() => a.editModeButton, (e) => {
596
+ b.value = ae(e, k.defaultEditModeButton);
585
597
  }, { deep: !0 });
586
- const Ce = async () => {
587
- var t, o, H;
588
- E("fetchItem"), f.value = !0, te.value = -1, N.value = !1, typeof ((t = a.events) == null ? void 0 : t.httpStart) == "function" && a.events.httpStart();
598
+ const pe = async () => {
599
+ var e, o, q;
600
+ T("fetchItem"), m.value = !0, J.value = -1, oe.value = !1, typeof ((e = a.events) == null ? void 0 : e.httpStart) == "function" && a.events.httpStart();
589
601
  try {
590
- const R = await rt(a.readResource, a.readData);
591
- if (E("fetchItem -> response", R), f.value = !1, te.value = R.httpStatus, T.value = R.custom, !R.success) {
592
- P.value = !1, te.value = R.httpStatus, typeof ((o = a.events) == null ? void 0 : o.httpEnd) == "function" && a.events.httpEnd({
593
- httpResponse: R
594
- }), h("error", R.httpStatus);
602
+ const $ = await dt(a.readResource, a.readData);
603
+ if (T("fetchItem -> response", $), m.value = !1, J.value = $.httpStatus, ee.value = $.custom, !$.success) {
604
+ L.value = !1, J.value = $.httpStatus, typeof ((o = a.events) == null ? void 0 : o.httpEnd) == "function" && a.events.httpEnd({
605
+ httpResponse: $
606
+ }), D("error", $.httpStatus);
595
607
  return;
596
608
  }
597
- P.value = !0, s.value = R.data, i.value = Array.isArray(R.modifications) ? {} : R.modifications, m.value = R.perms, O.value.increment(s.value).turnStoredIntoOriginal(), W.value.increment(i.value).turnStoredIntoOriginal(), M.value = O.value.changed(), ne.value.turnStoredIntoOriginal(), Object.keys(i.value).length > 0 && (j.value = U.Modifications), Z.value && (Ae(), Ge(() => {
598
- L.value.turnStoredIntoOriginal();
599
- })), typeof ((H = a.events) == null ? void 0 : H.httpEnd) == "function" && a.events.httpEnd({
600
- httpResponse: R
601
- }), h("read", R);
609
+ L.value = !0, p.value = $.data, U.value = Array.isArray($.modifications) ? {} : $.modifications, l.value = $.perms, h.value.increment(p.value).turnStoredIntoOriginal(), ue.value.increment(U.value).turnStoredIntoOriginal(), H.value = h.value.changed(), ie.value.turnStoredIntoOriginal(), Object.keys(U.value).length > 0 && (F.value = E.Modifications), te.value && (je(), Ge(() => {
610
+ fe.value.turnStoredIntoOriginal();
611
+ })), typeof ((q = a.events) == null ? void 0 : q.httpEnd) == "function" && a.events.httpEnd({
612
+ httpResponse: $
613
+ }), D("read", $);
602
614
  } catch {
603
- f.value = !1, P.value = !1, te.value = 404, h("error", 404);
615
+ m.value = !1, L.value = !1, J.value = 404, D("error", 404);
604
616
  return;
605
617
  }
606
618
  };
607
- C(G, (t) => {
608
- t && Ge(() => G.value = !1);
609
- }), C(() => a.modelValue, (t) => {
610
- s.value = t, O.value.increment(t);
611
- }, { deep: !0 }), C(s, (t) => {
612
- if (E("item updated ->", s.value), typeof a.beforeEmitUpdate == "function") {
613
- E("item updated -> has beforeEmitUpdate");
614
- let o = a.beforeEmitUpdate(s.value);
615
- E("item updated -> override with: ", o), typeof o == "object" && (s.value = o);
619
+ w(ne, (e) => {
620
+ e && Ge(() => ne.value = !1);
621
+ }), w(() => a.modelValue, (e) => {
622
+ p.value = e, h.value.increment(e);
623
+ }, { deep: !0 }), w(p, (e) => {
624
+ if (T("item updated ->", p.value), typeof a.beforeEmitUpdate == "function") {
625
+ T("item updated -> has beforeEmitUpdate");
626
+ let o = a.beforeEmitUpdate(p.value);
627
+ T("item updated -> override with: ", o), typeof o == "object" && (p.value = o);
616
628
  }
617
- Z.value && Ae(), h("update:modelValue", s.value), E("item updated -> update dataState"), O.value.increment(t), le.value === U.Current && (M.value = O.value.changed(), E("item updated -> dataState changed")), G.value = !0;
618
- }, { deep: !0 }), C(m, () => h("perms", m.value)), C(M, (t) => {
619
- h("modified-data", t);
620
- }), C(() => a.readData, (t) => {
621
- ne.value.increment(t), ne.value.changed() && Ce();
622
- }), C(() => a.editing, (t) => {
623
- E("editing updated -> updating editMode", t), D.value = t;
624
- }), C(D, (t) => {
625
- E("editMode updated -> emit update", t), h("update:editing", t);
629
+ te.value && je(), D("update:modelValue", p.value), T("item updated -> update dataState"), h.value.increment(e), le.value === E.Current && (H.value = h.value.changed(), T("item updated -> dataState changed")), ne.value = !0;
630
+ }, { deep: !0 }), w(l, () => D("perms", l.value)), w(H, (e) => {
631
+ D("modified-data", e);
632
+ }), w(() => a.readData, (e) => {
633
+ ie.value.increment(e), ie.value.changed() && pe();
634
+ }), w(() => a.editing, (e) => {
635
+ T("editing updated -> updating editMode", e), f.value = e;
636
+ }), w(f, (e) => {
637
+ T("editMode updated -> emit update", e), D("update:editing", e);
626
638
  });
627
- const He = p(void 0), Ae = () => {
628
- Z.value && (He.value = dt(s.value, i.value, be.value));
639
+ const Q = s(void 0), je = () => {
640
+ te.value && (Q.value = rt(p.value, U.value, we.value));
629
641
  };
630
642
  ut(() => {
631
- a.readResource && !Y.value ? Ce() : (Y.value, P.value = !0, D.value = !0, f.value = !1, O.value.increment(s.value).turnStoredIntoOriginal(), M.value = O.value.changed());
643
+ a.readResource && !A.value ? pe() : (A.value, L.value = !0, f.value = !0, m.value = !1, h.value.increment(p.value).turnStoredIntoOriginal(), H.value = h.value.changed());
632
644
  });
633
- const Te = (t, o) => {
645
+ const Fe = (e, o) => {
634
646
  if (o) {
635
- if (f.value = !1, typeof t < "u" && (te.value = t.httpStatus, !t.success))
636
- return N.value = !0, h("error", t.httpStatus), !1;
637
- N.value = !0;
647
+ if (m.value = !1, typeof e < "u" && (J.value = e.httpStatus, !e.success))
648
+ return oe.value = !0, D("error", e.httpStatus), !1;
649
+ oe.value = !0;
638
650
  }
639
651
  return !0;
640
- }, Ke = (t, o) => {
641
- if (E("doAutoReloadId -> enter: ", t), typeof t < "u" && t.autoReloadId)
642
- if (E("doAutoReloadId -> autoReloadId detected: ", t.autoReloadId), typeof o < "u") {
643
- let H = o;
644
- typeof o == "function" && (H = o(t.autoReloadId)), u.push(H);
645
- } else we.value ? (E("doAutoReloadId -> insideModal: ", a), mt(a.modalConfig.modalName, a.modalConfig.modalKey, t.autoReloadId)) : (E("doAutoReloadId -> outsideModal"), a.readData.id = t.autoReloadId, E("doAutoReloadId -> turning off create mode"), Y.value = !1, Ce());
646
- }, Ve = (t, o) => {
647
- if (E("onCreate"), !Te(o, q.value.resource)) {
648
- a.notificationType === ue.Toast && ce({
652
+ }, Ke = (e, o) => {
653
+ if (T("doAutoReloadId -> enter: ", e), typeof e < "u" && e.autoReloadId)
654
+ if (T("doAutoReloadId -> autoReloadId detected: ", e.autoReloadId), typeof o < "u") {
655
+ let q = o;
656
+ typeof o == "function" && (q = o(e.autoReloadId)), i.push(q);
657
+ } else Ae.value ? (T("doAutoReloadId -> insideModal: ", a), mt(a.modalConfig.modalName, a.modalConfig.modalKey, e.autoReloadId)) : (T("doAutoReloadId -> outsideModal"), a.readData.id = e.autoReloadId, T("doAutoReloadId -> turning off create mode"), A.value = !1, pe());
658
+ }, Ue = (e, o) => {
659
+ if (T("onCreate"), !Fe(o, K.value.resource)) {
660
+ a.notificationType === de.Toast && be({
649
661
  text: k.defaultCreateErrorText,
650
662
  details: k.defaultCreateErrorDetails,
651
663
  icon: k.defaultCreateErrorIcon,
652
- positionX: fe.Right
664
+ positionX: me.Right,
665
+ ...o.toast
653
666
  });
654
667
  return;
655
668
  }
656
- se.value = !0, E("onCreate -> turn stored data into original"), O.value.increment(s.value).turnStoredIntoOriginal(), W.value.turnStoredIntoOriginal(), a.notificationType === ue.Toast && ce({
669
+ Se.value = !0, T("onCreate -> turn stored data into original"), h.value.increment(p.value).turnStoredIntoOriginal(), ue.value.turnStoredIntoOriginal(), a.notificationType === de.Toast && be({
657
670
  text: k.defaultCreateSuccessText,
658
671
  details: k.defaultCreateSuccessDetails,
659
672
  icon: k.defaultCreateSuccessIcon,
660
- positionX: fe.Right
661
- }), Ke(o, a.redirectOnCreate), E("onCreate -> beforeEmitCreate"), h("create", o);
662
- }, Ie = (t, o) => {
663
- if (E("onUpdate"), !Te(o, c.value.resource)) {
664
- a.notificationType === ue.Toast && ce({
673
+ positionX: me.Right,
674
+ ...o.toast
675
+ }), Ke(o, a.redirectOnCreate), T("onCreate -> beforeEmitCreate"), D("create", o);
676
+ }, Ee = (e, o) => {
677
+ if (T("onUpdate"), !Fe(o, W.value.resource)) {
678
+ a.notificationType === de.Toast && be({
665
679
  text: k.defaultUpdateErrorText,
666
680
  details: k.defaultUpdateErrorDetails,
667
681
  icon: k.defaultUpdateErrorIcon,
668
- positionX: fe.Right
682
+ positionX: me.Right,
683
+ ...o.toast
669
684
  });
670
685
  return;
671
686
  }
672
- E("onUpdate -> turn stored data into original"), O.value.turnStoredIntoOriginal(), W.value.turnStoredIntoOriginal(), a.notificationType === ue.Toast && ce({
687
+ T("onUpdate -> turn stored data into original"), h.value.turnStoredIntoOriginal(), ue.value.turnStoredIntoOriginal(), a.notificationType === de.Toast && be({
673
688
  text: k.defaultUpdateSuccessText,
674
689
  details: k.defaultUpdateSuccessDetails,
675
690
  icon: k.defaultUpdateSuccessIcon,
676
- positionX: fe.Right
677
- }), Ke(o), h("update", o);
678
- }, Re = (t, o) => {
679
- if (E("onDrop"), !Te(o, z.value.resource)) {
680
- a.notificationType === ue.Toast && ce({
691
+ positionX: me.Right,
692
+ ...o.toast
693
+ }), Ke(o), D("update", o);
694
+ }, Me = (e, o) => {
695
+ if (T("onDrop"), !Fe(o, G.value.resource)) {
696
+ a.notificationType === de.Toast && be({
681
697
  text: k.defaultDropErrorText,
682
698
  details: k.defaultDropErrorDetails,
683
699
  icon: k.defaultDropErrorIcon,
684
- positionX: fe.Right
700
+ positionX: me.Right,
701
+ ...o.toast
685
702
  });
686
703
  return;
687
704
  }
688
- if (a.notificationType === ue.Toast && ce({
705
+ if (a.notificationType === de.Toast && be({
689
706
  text: k.defaultDropSuccessText,
690
707
  details: k.defaultDropSuccessDetails,
691
708
  icon: k.defaultDropSuccessIcon,
692
- positionX: fe.Right
693
- }), h("drop", o), a.view === ze.Modal && (E("onDrop -> close modal"), ct(a.modalConfig.modalName, a.modalConfig.modalKey)), typeof a.redirectOnDrop < "u") {
694
- let H = a.redirectOnDrop;
695
- typeof a.redirectOnDrop == "function" && (H = a.redirectOnDrop()), u.push(H);
709
+ positionX: me.Right,
710
+ ...o.toast
711
+ }), D("drop", o), a.view === ze.Modal && (T("onDrop -> close modal"), ct(a.modalConfig.modalName, a.modalConfig.modalKey)), typeof a.redirectOnDrop < "u") {
712
+ let q = a.redirectOnDrop;
713
+ typeof a.redirectOnDrop == "function" && (q = a.redirectOnDrop()), i.push(q);
696
714
  }
697
715
  };
698
- ke({
716
+ he({
699
717
  doDrop: () => {
700
- e.value && e.value.doDrop();
718
+ j.value && j.value.doDrop();
701
719
  },
702
- doRefresh: Ce,
720
+ doRefresh: pe,
703
721
  doSave: () => {
704
- e.value && e.value.doSave();
722
+ j.value && j.value.doSave();
705
723
  },
706
724
  turnStoredDataIntoOriginal: () => {
707
- O.value.increment(s.value).turnStoredIntoOriginal();
725
+ h.value.increment(p.value).turnStoredIntoOriginal();
708
726
  },
709
- hasModifiedData: () => O.value.changed()
727
+ hasModifiedData: () => h.value.changed()
710
728
  });
711
- const Ye = b(() => {
712
- var t, o, H;
713
- return Se.value ? Z.value ? ee.value ? (t = a.modalConfig) == null ? void 0 : t.closeConfirm : "" : le.value === U.Modifications ? W.value.changed() ? (o = a.modalConfig) == null ? void 0 : o.closeConfirm : "" : O.value.changed() ? (H = a.modalConfig) == null ? void 0 : H.closeConfirm : "" : "";
714
- }), Ze = (t) => {
729
+ const Ye = y(() => {
730
+ var e, o, q;
731
+ return ke.value ? te.value ? R.value ? (e = a.modalConfig) == null ? void 0 : e.closeConfirm : "" : le.value === E.Modifications ? ue.value.changed() ? (o = a.modalConfig) == null ? void 0 : o.closeConfirm : "" : h.value.changed() ? (q = a.modalConfig) == null ? void 0 : q.closeConfirm : "" : "";
732
+ }), Ze = (e) => {
715
733
  var o;
716
734
  if (typeof ((o = a.modalConfig) == null ? void 0 : o.beforeClose) == "function")
717
735
  return a.modalConfig.beforeClose({
718
- ...t,
719
- itemCreated: se.value
736
+ ...e,
737
+ itemCreated: Se.value
720
738
  });
721
- }, Ne = b(() => st(a.title)), _e = b(() => f.value ? !1 : Ne.value.length > 0 || !!A["post-title"]), xe = b(() => f.value ? !1 : typeof a.header == "object" && Object.keys(a.header).length > 0), we = b(() => a.view === ze.Modal), We = b(() => we.value ? "lkt-modal" : "section"), he = b(() => {
722
- var t, o;
723
- if (a.mode !== V.Update || !ae.value || !(Z.value && Q.value)) return !1;
739
+ }, Pe = y(() => st(a.title)), _e = y(() => m.value ? !1 : Pe.value.length > 0 || !!M["post-title"]), xe = y(() => m.value ? !1 : typeof a.header == "object" && Object.keys(a.header).length > 0), Ae = y(() => a.view === ze.Modal), We = y(() => Ae.value ? "lkt-modal" : "section"), Be = y(() => {
740
+ var e, o;
741
+ if (a.mode !== V.Update || !N.value || te.value && !O.value)
742
+ return !1;
724
743
  if (!a.enabledSaveWithoutChanges) {
725
- if (Z.value) {
726
- if (!ee.value) return !1;
727
- } else if (!M.value)
744
+ if (te.value) {
745
+ if (!R.value) return !1;
746
+ } else if (!H.value)
728
747
  return !1;
729
748
  }
730
- return typeof ((t = c.value) == null ? void 0 : t.disabled) == "function" ? !c.value.disabled({
731
- prop: s.value
732
- }) : typeof ((o = c.value) == null ? void 0 : o.disabled) == "boolean" ? !c.value.disabled : !0;
733
- }), De = b(() => {
734
- var t, o;
735
- if (a.mode !== V.Create || !l.value || !(Z.value && Q.value)) return !1;
749
+ return typeof ((e = W.value) == null ? void 0 : e.disabled) == "function" ? !W.value.disabled({
750
+ prop: p.value
751
+ }) : typeof ((o = W.value) == null ? void 0 : o.disabled) == "boolean" ? !W.value.disabled : !0;
752
+ }), ye = y(() => {
753
+ var e, o;
754
+ if (a.mode !== V.Create || !t.value || te.value && !O.value)
755
+ return !1;
736
756
  if (!a.enabledSaveWithoutChanges) {
737
- if (Z.value) {
738
- if (!ee.value) return !1;
739
- } else if (!M.value)
757
+ if (te.value) {
758
+ if (!R.value) return !1;
759
+ } else if (!H.value)
740
760
  return !1;
741
761
  }
742
- return typeof ((t = q.value) == null ? void 0 : t.disabled) == "function" ? !q.value.disabled({
743
- prop: s.value
744
- }) : typeof ((o = q.value) == null ? void 0 : o.disabled) == "boolean" ? !q.value.disabled : !0;
745
- }), Oe = b(() => a.createAndNewButton !== !1 && typeof a.createAndNewButton == "object" && !Array.isArray(a.createAndNewButton) && Object.keys(a.createAndNewButton).length > 0), Le = b(() => {
746
- var t, o;
747
- return oe.value ? typeof ((t = z.value) == null ? void 0 : t.disabled) == "function" ? !z.value.disabled({
748
- prop: s.value
749
- }) : typeof ((o = z.value) == null ? void 0 : o.disabled) == "boolean" ? !z.value.disabled : !0 : !1;
750
- }), et = b(() => We.value === "lkt-modal" ? {
762
+ return typeof ((e = K.value) == null ? void 0 : e.disabled) == "function" ? !K.value.disabled({
763
+ prop: p.value
764
+ }) : typeof ((o = K.value) == null ? void 0 : o.disabled) == "boolean" ? !K.value.disabled : !0;
765
+ }), Te = y(() => a.createAndNewButton !== !1 && typeof a.createAndNewButton == "object" && !Array.isArray(a.createAndNewButton) && Object.keys(a.createAndNewButton).length > 0), Ve = y(() => {
766
+ var e, o;
767
+ return r.value ? typeof ((e = G.value) == null ? void 0 : e.disabled) == "function" ? !G.value.disabled({
768
+ prop: p.value
769
+ }) : typeof ((o = G.value) == null ? void 0 : o.disabled) == "boolean" ? !G.value.disabled : !0 : !1;
770
+ }), et = y(() => We.value === "lkt-modal" ? {
751
771
  title: a.title,
752
- item: s.value,
772
+ item: p.value,
753
773
  ...a.modalConfig,
754
774
  beforeClose: Ze,
755
775
  closeConfirm: Ye.value,
756
776
  headerActionsButton: a.groupButton !== !1 ? {
757
- dot: De.value || he.value
777
+ dot: ye.value || Be.value
758
778
  } : !1
759
- } : {}), Z = b(() => typeof be.value == "object" && Object.keys(be.value).length > 0), $e = b(() => Object.keys(i.value).length === 0 ? [] : a.modificationViews), le = b(() => Object.keys(i.value).length === 0 ? U.Current : U.Modifications), Se = b(() => l.value || ae.value || oe.value), tt = b(() => Z.value ? vt(be.value) : []), be = b(() => typeof a.form == "function" ? a.form({
779
+ } : {}), te = y(() => typeof we.value == "object" && Object.keys(we.value).length > 0), Ie = y(() => Object.keys(U.value).length === 0 ? [] : a.modificationViews), le = y(() => Object.keys(U.value).length === 0 ? E.Current : E.Modifications), ke = y(() => t.value || N.value || r.value), tt = y(() => te.value ? vt(we.value) : []), we = y(() => typeof a.form == "function" ? a.form({
760
780
  mode: a.mode,
761
- view: j.value,
762
- item: s.value,
763
- modifications: i.value,
764
- editing: D.value
781
+ view: F.value,
782
+ item: p.value,
783
+ modifications: U.value,
784
+ editing: f.value
765
785
  }) : a.form);
766
- return (t, o) => {
767
- const H = Be("lkt-header"), R = Be("lkt-http-info"), at = Be("lkt-form"), ot = Be("lkt-loader");
768
- return n(), g(it(We.value), v(et.value, { class: "lkt-item-crud" }), ge({
769
- default: x(() => [
770
- !we.value && xe.value ? (n(), g(H, Me(v({ key: 0 }, t.header)), null, 16)) : !we.value && _e.value ? (n(), S("header", Ct, [
771
- d(A)["pre-title"] ? (n(), S("div", wt, [
772
- I(t.$slots, "pre-title", {
773
- item: s.value,
774
- loading: f.value
786
+ return (e, o) => {
787
+ const q = Ce("lkt-header"), $ = Ce("lkt-http-info"), at = Ce("lkt-form"), ot = Ce("lkt-loader");
788
+ return n(), c(it(We.value), v(et.value, { class: "lkt-item-crud" }), ce({
789
+ default: Z(() => [
790
+ !Ae.value && xe.value ? (n(), c(q, Le(v({ key: 0 }, e.header)), null, 16)) : !Ae.value && _e.value ? (n(), S("header", wt, [
791
+ d(M)["pre-title"] ? (n(), S("div", Ct, [
792
+ I(e.$slots, "pre-title", {
793
+ item: p.value,
794
+ loading: m.value
775
795
  })
776
- ])) : w("", !0),
777
- Ne.value.length > 0 ? (n(), S("h1", ht, lt(Ne.value), 1)) : w("", !0),
778
- d(A)["post-title"] ? (n(), S("div", Dt, [
779
- I(t.$slots, "post-title", {
780
- item: s.value,
781
- loading: f.value
796
+ ])) : C("", !0),
797
+ Pe.value.length > 0 ? (n(), S("h1", Dt, lt(Pe.value), 1)) : C("", !0),
798
+ d(M)["post-title"] ? (n(), S("div", ht, [
799
+ I(e.$slots, "post-title", {
800
+ item: p.value,
801
+ loading: m.value
782
802
  })
783
- ])) : w("", !0)
784
- ])) : w("", !0),
785
- t.buttonNavPosition === d(Pe).Top && (t.groupButton === !1 || !t.groupButtonAsModalActions) && Se.value ? (n(), g(Xe, {
803
+ ])) : C("", !0)
804
+ ])) : C("", !0),
805
+ e.buttonNavPosition === d(Re).Top && (e.groupButton === !1 || !e.groupButtonAsModalActions) && ke.value ? (n(), c(Oe, {
786
806
  key: 2,
787
807
  ref_key: "buttonNav",
788
- ref: e,
789
- loading: f.value,
790
- "onUpdate:loading": o[3] || (o[3] = (r) => f.value = r),
791
- editing: D.value,
792
- "onUpdate:editing": o[4] || (o[4] = (r) => D.value = r),
793
- "picked-modification-view": j.value,
794
- "onUpdate:pickedModificationView": o[5] || (o[5] = (r) => j.value = r),
795
- item: s.value,
796
- modifications: i.value,
797
- mode: t.mode,
798
- view: t.view,
799
- grouped: t.groupButton !== !1,
800
- "button-nav-visibility": t.buttonNavVisibility,
801
- "create-button": q.value,
802
- "create-and-new-button": pe.value,
803
- "update-button": c.value,
804
- "drop-button": z.value,
805
- "edit-mode-button": ie.value,
806
- "group-button": X.value,
807
- "data-changed": M.value,
808
- "http-success-read": P.value,
809
- "can-create": l.value,
810
- "can-update": ae.value,
811
- "can-drop": oe.value,
812
- "can-switch-edit-mode": ve.value,
813
- "group-button-as-modal-actions": t.groupButtonAsModalActions,
814
- "able-to-create": De.value,
815
- "able-to-create-and-new": Oe.value,
816
- "able-to-update": he.value,
817
- "able-to-drop": Le.value,
818
- perms: m.value,
819
- "modification-view": $e.value,
808
+ ref: j,
809
+ loading: m.value,
810
+ "onUpdate:loading": o[3] || (o[3] = (u) => m.value = u),
811
+ editing: f.value,
812
+ "onUpdate:editing": o[4] || (o[4] = (u) => f.value = u),
813
+ "picked-modification-view": F.value,
814
+ "onUpdate:pickedModificationView": o[5] || (o[5] = (u) => F.value = u),
815
+ item: p.value,
816
+ modifications: U.value,
817
+ mode: e.mode,
818
+ view: e.view,
819
+ grouped: e.groupButton !== !1,
820
+ "button-nav-visibility": e.buttonNavVisibility,
821
+ "create-button": K.value,
822
+ "create-and-new-button": se.value,
823
+ "update-button": W.value,
824
+ "drop-button": G.value,
825
+ "edit-mode-button": b.value,
826
+ "group-button": ve.value,
827
+ "data-changed": H.value,
828
+ "http-success-read": L.value,
829
+ "can-create": t.value,
830
+ "can-update": N.value,
831
+ "can-drop": r.value,
832
+ "can-switch-edit-mode": re.value,
833
+ "group-button-as-modal-actions": e.groupButtonAsModalActions,
834
+ "able-to-create": ye.value,
835
+ "able-to-create-and-new": Te.value,
836
+ "able-to-update": Be.value,
837
+ "able-to-drop": Ve.value,
838
+ perms: l.value,
839
+ "modification-view": Ie.value,
840
+ "editable-view": le.value,
841
+ "nav-start-buttons": e.navStartButtons,
842
+ "nav-start-buttons-editing": e.navStartButtonsEditing,
843
+ "nav-end-buttons": e.navEndButtons,
844
+ "nav-end-buttons-editing": e.navEndButtonsEditing,
845
+ "update-config": e.updateConfig,
846
+ onCreate: Ue,
847
+ onSave: Ee,
848
+ onDrop: Me
849
+ }, ce({ _: 2 }, [
850
+ d(M)["prev-buttons-ever"] ? {
851
+ name: "prev-buttons-ever",
852
+ fn: Z(({ canUpdate: u, canDrop: _, perms: x }) => [
853
+ I(e.$slots, "prev-buttons-ever", {
854
+ canUpdate: u,
855
+ canDrop: _,
856
+ perms: x
857
+ })
858
+ ]),
859
+ key: "0"
860
+ } : void 0,
861
+ d(M)["prev-buttons"] ? {
862
+ name: "prev-buttons",
863
+ fn: Z(({ canUpdate: u, canDrop: _, perms: x }) => [
864
+ I(e.$slots, "prev-buttons", {
865
+ canUpdate: u,
866
+ canDrop: _,
867
+ perms: x
868
+ })
869
+ ]),
870
+ key: "1"
871
+ } : void 0
872
+ ]), 1032, ["loading", "editing", "picked-modification-view", "item", "modifications", "mode", "view", "grouped", "button-nav-visibility", "create-button", "create-and-new-button", "update-button", "drop-button", "edit-mode-button", "group-button", "data-changed", "http-success-read", "can-create", "can-update", "can-drop", "can-switch-edit-mode", "group-button-as-modal-actions", "able-to-create", "able-to-create-and-new", "able-to-update", "able-to-drop", "perms", "modification-view", "editable-view", "nav-start-buttons", "nav-start-buttons-editing", "nav-end-buttons", "nav-end-buttons-editing", "update-config"])) : ke.value && e.buttonNavPosition === d(Re).Hidden ? g((n(), c(Oe, {
873
+ key: 3,
874
+ ref_key: "buttonNav",
875
+ ref: j,
876
+ loading: m.value,
877
+ "onUpdate:loading": o[6] || (o[6] = (u) => m.value = u),
878
+ editing: f.value,
879
+ "onUpdate:editing": o[7] || (o[7] = (u) => f.value = u),
880
+ "picked-modification-view": F.value,
881
+ "onUpdate:pickedModificationView": o[8] || (o[8] = (u) => F.value = u),
882
+ item: p.value,
883
+ modifications: U.value,
884
+ mode: e.mode,
885
+ view: e.view,
886
+ "button-nav-visibility": e.buttonNavVisibility,
887
+ "create-button": K.value,
888
+ "create-and-new-button": se.value,
889
+ "update-button": W.value,
890
+ "drop-button": G.value,
891
+ "edit-mode-button": b.value,
892
+ "group-button": ve.value,
893
+ "data-changed": H.value,
894
+ "http-success-read": L.value,
895
+ "can-create": t.value,
896
+ "can-update": N.value,
897
+ "can-drop": r.value,
898
+ "can-switch-edit-mode": re.value,
899
+ "group-button-as-modal-actions": e.groupButtonAsModalActions,
900
+ "able-to-create": ye.value,
901
+ "able-to-create-and-new": Te.value,
902
+ "able-to-update": Be.value,
903
+ "able-to-drop": Ve.value,
904
+ perms: l.value,
905
+ "modification-view": Ie.value,
820
906
  "editable-view": le.value,
821
- "nav-start-buttons": t.navStartButtons,
822
- "nav-start-buttons-editing": t.navStartButtonsEditing,
823
- "nav-end-buttons": t.navEndButtons,
824
- "nav-end-buttons-editing": t.navEndButtonsEditing,
825
- onCreate: Ve,
826
- onSave: Ie,
827
- onDrop: Re
828
- }, ge({ _: 2 }, [
829
- d(A)["prev-buttons-ever"] ? {
907
+ "nav-start-buttons": e.navStartButtons,
908
+ "nav-start-buttons-editing": e.navStartButtonsEditing,
909
+ "nav-end-buttons": e.navEndButtons,
910
+ "nav-end-buttons-editing": e.navEndButtonsEditing,
911
+ "update-config": e.updateConfig,
912
+ onCreate: Ue,
913
+ onSave: Ee,
914
+ onDrop: Me
915
+ }, ce({ _: 2 }, [
916
+ d(M)["prev-buttons-ever"] ? {
830
917
  name: "prev-buttons-ever",
831
- fn: x(({ canUpdate: r, canDrop: re, perms: de }) => [
832
- I(t.$slots, "prev-buttons-ever", {
833
- canUpdate: r,
834
- canDrop: re,
835
- perms: de
918
+ fn: Z(({ canUpdate: u, canDrop: _, perms: x }) => [
919
+ I(e.$slots, "prev-buttons-ever", {
920
+ canUpdate: u,
921
+ canDrop: _,
922
+ perms: x
836
923
  })
837
924
  ]),
838
925
  key: "0"
839
926
  } : void 0,
840
- d(A)["prev-buttons"] ? {
927
+ d(M)["prev-buttons"] ? {
841
928
  name: "prev-buttons",
842
- fn: x(({ canUpdate: r, canDrop: re, perms: de }) => [
843
- I(t.$slots, "prev-buttons", {
844
- canUpdate: r,
845
- canDrop: re,
846
- perms: de
929
+ fn: Z(({ canUpdate: u, canDrop: _, perms: x }) => [
930
+ I(e.$slots, "prev-buttons", {
931
+ canUpdate: u,
932
+ canDrop: _,
933
+ perms: x
847
934
  })
848
935
  ]),
849
936
  key: "1"
850
937
  } : void 0
851
- ]), 1032, ["loading", "editing", "picked-modification-view", "item", "modifications", "mode", "view", "grouped", "button-nav-visibility", "create-button", "create-and-new-button", "update-button", "drop-button", "edit-mode-button", "group-button", "data-changed", "http-success-read", "can-create", "can-update", "can-drop", "can-switch-edit-mode", "group-button-as-modal-actions", "able-to-create", "able-to-create-and-new", "able-to-update", "able-to-drop", "perms", "modification-view", "editable-view", "nav-start-buttons", "nav-start-buttons-editing", "nav-end-buttons", "nav-end-buttons-editing"])) : w("", !0),
852
- f.value ? w("", !0) : (n(), S("div", St, [
853
- P.value ? (n(), S("div", Ut, [
854
- N.value && t.notificationType === d(ue).Inline ? (n(), g(R, {
938
+ ]), 1032, ["loading", "editing", "picked-modification-view", "item", "modifications", "mode", "view", "button-nav-visibility", "create-button", "create-and-new-button", "update-button", "drop-button", "edit-mode-button", "group-button", "data-changed", "http-success-read", "can-create", "can-update", "can-drop", "can-switch-edit-mode", "group-button-as-modal-actions", "able-to-create", "able-to-create-and-new", "able-to-update", "able-to-drop", "perms", "modification-view", "editable-view", "nav-start-buttons", "nav-start-buttons-editing", "nav-end-buttons", "nav-end-buttons-editing", "update-config"])), [
939
+ [B, !1]
940
+ ]) : C("", !0),
941
+ m.value ? C("", !0) : (n(), S("div", St, [
942
+ L.value ? (n(), S("div", Ut, [
943
+ oe.value && e.notificationType === d(de).Inline ? (n(), c($, {
855
944
  key: 0,
856
- code: te.value,
857
- palette: te.value === 200 ? "success" : "danger",
945
+ code: J.value,
946
+ palette: J.value === 200 ? "success" : "danger",
858
947
  quick: "",
859
948
  "can-close": "",
860
- onClose: o[6] || (o[6] = (r) => N.value = !1)
861
- }, null, 8, ["code", "palette"])) : w("", !0),
862
- Z.value ? (n(), g(at, v({
949
+ onClose: o[9] || (o[9] = (u) => oe.value = !1)
950
+ }, null, 8, ["code", "palette"])) : C("", !0),
951
+ te.value ? (n(), c(at, v({
863
952
  key: 1,
864
953
  ref_key: "formRef",
865
- ref: L,
866
- modelValue: s.value,
867
- "onUpdate:modelValue": o[7] || (o[7] = (r) => s.value = r),
868
- modifications: i.value,
869
- "onUpdate:modifications": o[8] || (o[8] = (r) => i.value = r),
870
- valid: Q.value,
871
- "onUpdate:valid": o[9] || (o[9] = (r) => Q.value = r),
872
- changed: ee.value,
873
- "onUpdate:changed": o[10] || (o[10] = (r) => ee.value = r)
954
+ ref: fe,
955
+ modelValue: p.value,
956
+ "onUpdate:modelValue": o[10] || (o[10] = (u) => p.value = u),
957
+ modifications: U.value,
958
+ "onUpdate:modifications": o[11] || (o[11] = (u) => U.value = u),
959
+ valid: O.value,
960
+ "onUpdate:valid": o[12] || (o[12] = (u) => O.value = u),
961
+ changed: R.value,
962
+ "onUpdate:changed": o[13] || (o[13] = (u) => R.value = u)
874
963
  }, {
875
- ...t.formUiConfig,
876
- form: be.value,
877
- differencesTableConfig: t.differencesTableConfig,
878
- visibleView: j.value,
879
- modificationDataState: He.value,
964
+ ...e.formUiConfig,
965
+ form: we.value,
966
+ differencesTableConfig: e.differencesTableConfig,
967
+ visibleView: F.value,
968
+ modificationDataState: Q.value,
880
969
  editableViews: [le.value],
881
- disabled: !D.value
882
- }), ge({ _: 2 }, [
883
- K(tt.value, (r) => ({
884
- name: r,
885
- fn: x(({}) => [
886
- I(t.$slots, r)
970
+ disabled: !f.value
971
+ }), ce({ _: 2 }, [
972
+ z(tt.value, (u) => ({
973
+ name: u,
974
+ fn: Z(({}) => [
975
+ I(e.$slots, u)
887
976
  ])
888
977
  }))
889
- ]), 1040, ["modelValue", "modifications", "valid", "changed"])) : I(t.$slots, "item", {
978
+ ]), 1040, ["modelValue", "modifications", "valid", "changed"])) : I(e.$slots, "item", {
890
979
  key: 2,
891
- item: s.value,
892
- loading: f.value,
893
- editMode: D.value,
894
- isCreate: Y.value,
895
- canUpdate: ae.value,
896
- canDrop: oe.value,
897
- itemBeingEdited: G.value,
898
- perms: m.value
980
+ item: p.value,
981
+ loading: m.value,
982
+ editMode: f.value,
983
+ isCreate: A.value,
984
+ canUpdate: N.value,
985
+ canDrop: r.value,
986
+ itemBeingEdited: ne.value,
987
+ perms: l.value
899
988
  })
900
- ])) : t.notificationType === d(ue).Inline ? (n(), g(R, {
989
+ ])) : e.notificationType === d(de).Inline ? (n(), c($, {
901
990
  key: 1,
902
- code: te.value
903
- }, null, 8, ["code"])) : w("", !0)
991
+ code: J.value
992
+ }, null, 8, ["code"])) : C("", !0)
904
993
  ])),
905
- f.value ? (n(), g(ot, { key: 4 })) : w("", !0),
906
- t.buttonNavPosition === d(Pe).Bottom && (t.groupButton === !1 || !t.groupButtonAsModalActions) && Se.value ? (n(), g(Xe, {
907
- key: 5,
994
+ m.value ? (n(), c(ot, { key: 5 })) : C("", !0),
995
+ e.buttonNavPosition === d(Re).Bottom && (e.groupButton === !1 || !e.groupButtonAsModalActions) && ke.value ? (n(), c(Oe, {
996
+ key: 6,
908
997
  ref_key: "buttonNav",
909
- ref: e,
910
- loading: f.value,
911
- "onUpdate:loading": o[11] || (o[11] = (r) => f.value = r),
912
- editing: D.value,
913
- "onUpdate:editing": o[12] || (o[12] = (r) => D.value = r),
914
- "picked-modification-view": j.value,
915
- "onUpdate:pickedModificationView": o[13] || (o[13] = (r) => j.value = r),
916
- item: s.value,
917
- modifications: i.value,
918
- mode: t.mode,
919
- view: t.view,
920
- grouped: t.groupButton !== !1,
921
- "button-nav-visibility": t.buttonNavVisibility,
922
- "create-button": q.value,
923
- "create-and-new-button": pe.value,
924
- "update-button": c.value,
925
- "drop-button": z.value,
926
- "edit-mode-button": ie.value,
927
- "group-button": X.value,
928
- "data-changed": M.value,
929
- "http-success-read": P.value,
930
- "can-create": l.value,
931
- "can-update": ae.value,
932
- "can-drop": oe.value,
933
- "can-switch-edit-mode": ve.value,
934
- "group-button-as-modal-actions": t.groupButtonAsModalActions,
935
- "able-to-create": De.value,
936
- "able-to-create-and-new": Oe.value,
937
- "able-to-update": he.value,
938
- "able-to-drop": Le.value,
939
- perms: m.value,
940
- "modification-view": $e.value,
998
+ ref: j,
999
+ loading: m.value,
1000
+ "onUpdate:loading": o[14] || (o[14] = (u) => m.value = u),
1001
+ editing: f.value,
1002
+ "onUpdate:editing": o[15] || (o[15] = (u) => f.value = u),
1003
+ "picked-modification-view": F.value,
1004
+ "onUpdate:pickedModificationView": o[16] || (o[16] = (u) => F.value = u),
1005
+ item: p.value,
1006
+ modifications: U.value,
1007
+ mode: e.mode,
1008
+ view: e.view,
1009
+ grouped: e.groupButton !== !1,
1010
+ "button-nav-visibility": e.buttonNavVisibility,
1011
+ "create-button": K.value,
1012
+ "create-and-new-button": se.value,
1013
+ "update-button": W.value,
1014
+ "drop-button": G.value,
1015
+ "edit-mode-button": b.value,
1016
+ "group-button": ve.value,
1017
+ "data-changed": H.value,
1018
+ "http-success-read": L.value,
1019
+ "can-create": t.value,
1020
+ "can-update": N.value,
1021
+ "can-drop": r.value,
1022
+ "can-switch-edit-mode": re.value,
1023
+ "group-button-as-modal-actions": e.groupButtonAsModalActions,
1024
+ "able-to-create": ye.value,
1025
+ "able-to-create-and-new": Te.value,
1026
+ "able-to-update": Be.value,
1027
+ "able-to-drop": Ve.value,
1028
+ perms: l.value,
1029
+ "modification-view": Ie.value,
941
1030
  "editable-view": le.value,
942
- "nav-start-buttons": t.navStartButtons,
943
- "nav-start-buttons-editing": t.navStartButtonsEditing,
944
- "nav-end-buttons": t.navEndButtons,
945
- "nav-end-buttons-editing": t.navEndButtonsEditing,
946
- onCreate: Ve,
947
- onSave: Ie,
948
- onDrop: Re
949
- }, ge({ _: 2 }, [
950
- d(A)["prev-buttons-ever"] ? {
1031
+ "nav-start-buttons": e.navStartButtons,
1032
+ "nav-start-buttons-editing": e.navStartButtonsEditing,
1033
+ "nav-end-buttons": e.navEndButtons,
1034
+ "nav-end-buttons-editing": e.navEndButtonsEditing,
1035
+ "update-config": e.updateConfig,
1036
+ onCreate: Ue,
1037
+ onSave: Ee,
1038
+ onDrop: Me
1039
+ }, ce({ _: 2 }, [
1040
+ d(M)["prev-buttons-ever"] ? {
951
1041
  name: "prev-buttons-ever",
952
- fn: x(() => [
953
- I(t.$slots, "prev-buttons-ever")
1042
+ fn: Z(() => [
1043
+ I(e.$slots, "prev-buttons-ever")
954
1044
  ]),
955
1045
  key: "0"
956
1046
  } : void 0,
957
- d(A)["prev-buttons"] ? {
1047
+ d(M)["prev-buttons"] ? {
958
1048
  name: "prev-buttons-ever",
959
- fn: x(() => [
960
- I(t.$slots, "prev-buttons")
1049
+ fn: Z(() => [
1050
+ I(e.$slots, "prev-buttons")
961
1051
  ]),
962
1052
  key: "1"
963
1053
  } : void 0
964
- ]), 1032, ["loading", "editing", "picked-modification-view", "item", "modifications", "mode", "view", "grouped", "button-nav-visibility", "create-button", "create-and-new-button", "update-button", "drop-button", "edit-mode-button", "group-button", "data-changed", "http-success-read", "can-create", "can-update", "can-drop", "can-switch-edit-mode", "group-button-as-modal-actions", "able-to-create", "able-to-create-and-new", "able-to-update", "able-to-drop", "perms", "modification-view", "editable-view", "nav-start-buttons", "nav-start-buttons-editing", "nav-end-buttons", "nav-end-buttons-editing"])) : w("", !0)
1054
+ ]), 1032, ["loading", "editing", "picked-modification-view", "item", "modifications", "mode", "view", "grouped", "button-nav-visibility", "create-button", "create-and-new-button", "update-button", "drop-button", "edit-mode-button", "group-button", "data-changed", "http-success-read", "can-create", "can-update", "can-drop", "can-switch-edit-mode", "group-button-as-modal-actions", "able-to-create", "able-to-create-and-new", "able-to-update", "able-to-drop", "perms", "modification-view", "editable-view", "nav-start-buttons", "nav-start-buttons-editing", "nav-end-buttons", "nav-end-buttons-editing", "update-config"])) : C("", !0)
965
1055
  ]),
966
1056
  _: 2
967
1057
  }, [
968
- t.groupButton !== !1 && t.groupButtonAsModalActions && Se.value ? {
1058
+ e.groupButton !== !1 && e.groupButtonAsModalActions && ke.value ? {
969
1059
  name: "header-actions",
970
- fn: x(() => [
971
- t.buttonNavPosition === d(Pe).Top ? (n(), g(Xe, {
1060
+ fn: Z(() => [
1061
+ e.buttonNavPosition === d(Re).Top ? (n(), c(Oe, {
972
1062
  key: 0,
973
1063
  ref_key: "buttonNav",
974
- ref: e,
975
- loading: f.value,
976
- "onUpdate:loading": o[0] || (o[0] = (r) => f.value = r),
977
- editing: D.value,
978
- "onUpdate:editing": o[1] || (o[1] = (r) => D.value = r),
979
- "picked-modification-view": j.value,
980
- "onUpdate:pickedModificationView": o[2] || (o[2] = (r) => j.value = r),
981
- item: s.value,
982
- modifications: i.value,
983
- mode: t.mode,
984
- view: t.view,
1064
+ ref: j,
1065
+ loading: m.value,
1066
+ "onUpdate:loading": o[0] || (o[0] = (u) => m.value = u),
1067
+ editing: f.value,
1068
+ "onUpdate:editing": o[1] || (o[1] = (u) => f.value = u),
1069
+ "picked-modification-view": F.value,
1070
+ "onUpdate:pickedModificationView": o[2] || (o[2] = (u) => F.value = u),
1071
+ item: p.value,
1072
+ modifications: U.value,
1073
+ mode: e.mode,
1074
+ view: e.view,
985
1075
  grouped: !0,
986
- "button-nav-visibility": t.buttonNavVisibility,
987
- "create-button": q.value,
988
- "create-and-new-button": pe.value,
989
- "update-button": c.value,
990
- "drop-button": z.value,
991
- "edit-mode-button": ie.value,
992
- "group-button": X.value,
993
- "data-changed": M.value,
994
- "http-success-read": P.value,
995
- "can-create": l.value,
996
- "can-update": ae.value,
997
- "can-drop": oe.value,
998
- "can-switch-edit-mode": ve.value,
999
- "group-button-as-modal-actions": t.groupButtonAsModalActions,
1000
- "able-to-create": De.value,
1001
- "able-to-create-and-new": Oe.value,
1002
- "able-to-update": he.value,
1003
- "able-to-drop": Le.value,
1004
- perms: m.value,
1005
- "modification-view": $e.value,
1076
+ "button-nav-visibility": e.buttonNavVisibility,
1077
+ "create-button": K.value,
1078
+ "create-and-new-button": se.value,
1079
+ "update-button": W.value,
1080
+ "drop-button": G.value,
1081
+ "edit-mode-button": b.value,
1082
+ "group-button": ve.value,
1083
+ "data-changed": H.value,
1084
+ "http-success-read": L.value,
1085
+ "can-create": t.value,
1086
+ "can-update": N.value,
1087
+ "can-drop": r.value,
1088
+ "can-switch-edit-mode": re.value,
1089
+ "group-button-as-modal-actions": e.groupButtonAsModalActions,
1090
+ "able-to-create": ye.value,
1091
+ "able-to-create-and-new": Te.value,
1092
+ "able-to-update": Be.value,
1093
+ "able-to-drop": Ve.value,
1094
+ perms: l.value,
1095
+ "modification-view": Ie.value,
1006
1096
  "editable-view": le.value,
1007
- "nav-start-buttons": t.navStartButtons,
1008
- "nav-start-buttons-editing": t.navStartButtonsEditing,
1009
- "nav-end-buttons": t.navEndButtons,
1010
- "nav-end-buttons-editing": t.navEndButtonsEditing,
1011
- onCreate: Ve,
1012
- onSave: Ie,
1013
- onDrop: Re
1014
- }, ge({ _: 2 }, [
1015
- d(A)["prev-buttons-ever"] ? {
1097
+ "nav-start-buttons": e.navStartButtons,
1098
+ "nav-start-buttons-editing": e.navStartButtonsEditing,
1099
+ "nav-end-buttons": e.navEndButtons,
1100
+ "nav-end-buttons-editing": e.navEndButtonsEditing,
1101
+ "update-config": e.updateConfig,
1102
+ onCreate: Ue,
1103
+ onSave: Ee,
1104
+ onDrop: Me
1105
+ }, ce({ _: 2 }, [
1106
+ d(M)["prev-buttons-ever"] ? {
1016
1107
  name: "prev-buttons-ever",
1017
- fn: x(({ canUpdate: r, canDrop: re, perms: de }) => [
1018
- I(t.$slots, "prev-buttons-ever", {
1019
- canUpdate: r,
1020
- canDrop: re,
1021
- perms: de
1108
+ fn: Z(({ canUpdate: u, canDrop: _, perms: x }) => [
1109
+ I(e.$slots, "prev-buttons-ever", {
1110
+ canUpdate: u,
1111
+ canDrop: _,
1112
+ perms: x
1022
1113
  })
1023
1114
  ]),
1024
1115
  key: "0"
1025
1116
  } : void 0,
1026
- d(A)["prev-buttons"] ? {
1117
+ d(M)["prev-buttons"] ? {
1027
1118
  name: "prev-buttons",
1028
- fn: x(({ canUpdate: r, canDrop: re, perms: de }) => [
1029
- I(t.$slots, "prev-buttons", {
1030
- canUpdate: r,
1031
- canDrop: re,
1032
- perms: de
1119
+ fn: Z(({ canUpdate: u, canDrop: _, perms: x }) => [
1120
+ I(e.$slots, "prev-buttons", {
1121
+ canUpdate: u,
1122
+ canDrop: _,
1123
+ perms: x
1033
1124
  })
1034
1125
  ]),
1035
1126
  key: "1"
1036
1127
  } : void 0
1037
- ]), 1032, ["loading", "editing", "picked-modification-view", "item", "modifications", "mode", "view", "button-nav-visibility", "create-button", "create-and-new-button", "update-button", "drop-button", "edit-mode-button", "group-button", "data-changed", "http-success-read", "can-create", "can-update", "can-drop", "can-switch-edit-mode", "group-button-as-modal-actions", "able-to-create", "able-to-create-and-new", "able-to-update", "able-to-drop", "perms", "modification-view", "editable-view", "nav-start-buttons", "nav-start-buttons-editing", "nav-end-buttons", "nav-end-buttons-editing"])) : w("", !0)
1128
+ ]), 1032, ["loading", "editing", "picked-modification-view", "item", "modifications", "mode", "view", "button-nav-visibility", "create-button", "create-and-new-button", "update-button", "drop-button", "edit-mode-button", "group-button", "data-changed", "http-success-read", "can-create", "can-update", "can-drop", "can-switch-edit-mode", "group-button-as-modal-actions", "able-to-create", "able-to-create-and-new", "able-to-update", "able-to-drop", "perms", "modification-view", "editable-view", "nav-start-buttons", "nav-start-buttons-editing", "nav-end-buttons", "nav-end-buttons-editing", "update-config"])) : C("", !0)
1038
1129
  ]),
1039
1130
  key: "0"
1040
1131
  } : void 0
@@ -1042,13 +1133,13 @@ const E = (...$) => {
1042
1133
  };
1043
1134
  }
1044
1135
  }), jt = {
1045
- install: ($, ke = {}) => {
1046
- $.component("lkt-item-crud") === void 0 && $.component("lkt-item-crud", Mt);
1136
+ install: (P, he = {}) => {
1137
+ P.component("lkt-item-crud") === void 0 && P.component("lkt-item-crud", Et);
1047
1138
  }
1048
- }, Ft = ($) => {
1049
- me.defaultSaveIcon = $;
1050
- }, Pt = ($) => {
1051
- me.defaultDropIcon = $;
1139
+ }, Ft = (P) => {
1140
+ ge.defaultSaveIcon = P;
1141
+ }, Pt = (P) => {
1142
+ ge.defaultDropIcon = P;
1052
1143
  };
1053
1144
  export {
1054
1145
  $t as debugLktItemCrud,