lkt-item-crud 2.0.35 → 2.0.36

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,562 @@ 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
653
665
  });
654
666
  return;
655
667
  }
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({
668
+ 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
669
  text: k.defaultCreateSuccessText,
658
670
  details: k.defaultCreateSuccessDetails,
659
671
  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({
672
+ positionX: me.Right
673
+ }), Ke(o, a.redirectOnCreate), T("onCreate -> beforeEmitCreate"), D("create", o);
674
+ }, Ee = (e, o) => {
675
+ if (T("onUpdate"), !Fe(o, W.value.resource)) {
676
+ a.notificationType === de.Toast && be({
665
677
  text: k.defaultUpdateErrorText,
666
678
  details: k.defaultUpdateErrorDetails,
667
679
  icon: k.defaultUpdateErrorIcon,
668
- positionX: fe.Right
680
+ positionX: me.Right
669
681
  });
670
682
  return;
671
683
  }
672
- E("onUpdate -> turn stored data into original"), O.value.turnStoredIntoOriginal(), W.value.turnStoredIntoOriginal(), a.notificationType === ue.Toast && ce({
684
+ T("onUpdate -> turn stored data into original"), h.value.turnStoredIntoOriginal(), ue.value.turnStoredIntoOriginal(), a.notificationType === de.Toast && be({
673
685
  text: k.defaultUpdateSuccessText,
674
686
  details: k.defaultUpdateSuccessDetails,
675
687
  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({
688
+ positionX: me.Right
689
+ }), Ke(o), D("update", o);
690
+ }, Me = (e, o) => {
691
+ if (T("onDrop"), !Fe(o, G.value.resource)) {
692
+ a.notificationType === de.Toast && be({
681
693
  text: k.defaultDropErrorText,
682
694
  details: k.defaultDropErrorDetails,
683
695
  icon: k.defaultDropErrorIcon,
684
- positionX: fe.Right
696
+ positionX: me.Right
685
697
  });
686
698
  return;
687
699
  }
688
- if (a.notificationType === ue.Toast && ce({
700
+ if (a.notificationType === de.Toast && be({
689
701
  text: k.defaultDropSuccessText,
690
702
  details: k.defaultDropSuccessDetails,
691
703
  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);
704
+ positionX: me.Right
705
+ }), D("drop", o), a.view === ze.Modal && (T("onDrop -> close modal"), ct(a.modalConfig.modalName, a.modalConfig.modalKey)), typeof a.redirectOnDrop < "u") {
706
+ let q = a.redirectOnDrop;
707
+ typeof a.redirectOnDrop == "function" && (q = a.redirectOnDrop()), i.push(q);
696
708
  }
697
709
  };
698
- ke({
710
+ he({
699
711
  doDrop: () => {
700
- e.value && e.value.doDrop();
712
+ j.value && j.value.doDrop();
701
713
  },
702
- doRefresh: Ce,
714
+ doRefresh: pe,
703
715
  doSave: () => {
704
- e.value && e.value.doSave();
716
+ j.value && j.value.doSave();
705
717
  },
706
718
  turnStoredDataIntoOriginal: () => {
707
- O.value.increment(s.value).turnStoredIntoOriginal();
719
+ h.value.increment(p.value).turnStoredIntoOriginal();
708
720
  },
709
- hasModifiedData: () => O.value.changed()
721
+ hasModifiedData: () => h.value.changed()
710
722
  });
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) => {
723
+ const Ye = y(() => {
724
+ var e, o, q;
725
+ 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 : "" : "";
726
+ }), Ze = (e) => {
715
727
  var o;
716
728
  if (typeof ((o = a.modalConfig) == null ? void 0 : o.beforeClose) == "function")
717
729
  return a.modalConfig.beforeClose({
718
- ...t,
719
- itemCreated: se.value
730
+ ...e,
731
+ itemCreated: Se.value
720
732
  });
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;
733
+ }, 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(() => {
734
+ var e, o;
735
+ if (a.mode !== V.Update || !N.value || te.value && !O.value)
736
+ return !1;
724
737
  if (!a.enabledSaveWithoutChanges) {
725
- if (Z.value) {
726
- if (!ee.value) return !1;
727
- } else if (!M.value)
738
+ if (te.value) {
739
+ if (!R.value) return !1;
740
+ } else if (!H.value)
728
741
  return !1;
729
742
  }
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;
743
+ return typeof ((e = W.value) == null ? void 0 : e.disabled) == "function" ? !W.value.disabled({
744
+ prop: p.value
745
+ }) : typeof ((o = W.value) == null ? void 0 : o.disabled) == "boolean" ? !W.value.disabled : !0;
746
+ }), ye = y(() => {
747
+ var e, o;
748
+ if (a.mode !== V.Create || !t.value || te.value && !O.value)
749
+ return !1;
736
750
  if (!a.enabledSaveWithoutChanges) {
737
- if (Z.value) {
738
- if (!ee.value) return !1;
739
- } else if (!M.value)
751
+ if (te.value) {
752
+ if (!R.value) return !1;
753
+ } else if (!H.value)
740
754
  return !1;
741
755
  }
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" ? {
756
+ return typeof ((e = K.value) == null ? void 0 : e.disabled) == "function" ? !K.value.disabled({
757
+ prop: p.value
758
+ }) : typeof ((o = K.value) == null ? void 0 : o.disabled) == "boolean" ? !K.value.disabled : !0;
759
+ }), Te = y(() => a.createAndNewButton !== !1 && typeof a.createAndNewButton == "object" && !Array.isArray(a.createAndNewButton) && Object.keys(a.createAndNewButton).length > 0), Ve = y(() => {
760
+ var e, o;
761
+ return r.value ? typeof ((e = G.value) == null ? void 0 : e.disabled) == "function" ? !G.value.disabled({
762
+ prop: p.value
763
+ }) : typeof ((o = G.value) == null ? void 0 : o.disabled) == "boolean" ? !G.value.disabled : !0 : !1;
764
+ }), et = y(() => We.value === "lkt-modal" ? {
751
765
  title: a.title,
752
- item: s.value,
766
+ item: p.value,
753
767
  ...a.modalConfig,
754
768
  beforeClose: Ze,
755
769
  closeConfirm: Ye.value,
756
770
  headerActionsButton: a.groupButton !== !1 ? {
757
- dot: De.value || he.value
771
+ dot: ye.value || Be.value
758
772
  } : !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({
773
+ } : {}), 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
774
  mode: a.mode,
761
- view: j.value,
762
- item: s.value,
763
- modifications: i.value,
764
- editing: D.value
775
+ view: F.value,
776
+ item: p.value,
777
+ modifications: U.value,
778
+ editing: f.value
765
779
  }) : 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
780
+ return (e, o) => {
781
+ const q = Ce("lkt-header"), $ = Ce("lkt-http-info"), at = Ce("lkt-form"), ot = Ce("lkt-loader");
782
+ return n(), c(it(We.value), v(et.value, { class: "lkt-item-crud" }), ce({
783
+ default: Z(() => [
784
+ !Ae.value && xe.value ? (n(), c(q, Le(v({ key: 0 }, e.header)), null, 16)) : !Ae.value && _e.value ? (n(), S("header", wt, [
785
+ d(M)["pre-title"] ? (n(), S("div", Ct, [
786
+ I(e.$slots, "pre-title", {
787
+ item: p.value,
788
+ loading: m.value
775
789
  })
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
790
+ ])) : C("", !0),
791
+ Pe.value.length > 0 ? (n(), S("h1", Dt, lt(Pe.value), 1)) : C("", !0),
792
+ d(M)["post-title"] ? (n(), S("div", ht, [
793
+ I(e.$slots, "post-title", {
794
+ item: p.value,
795
+ loading: m.value
782
796
  })
783
- ])) : w("", !0)
784
- ])) : w("", !0),
785
- t.buttonNavPosition === d(Pe).Top && (t.groupButton === !1 || !t.groupButtonAsModalActions) && Se.value ? (n(), g(Xe, {
797
+ ])) : C("", !0)
798
+ ])) : C("", !0),
799
+ e.buttonNavPosition === d(Re).Top && (e.groupButton === !1 || !e.groupButtonAsModalActions) && ke.value ? (n(), c(Oe, {
786
800
  key: 2,
787
801
  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,
802
+ ref: j,
803
+ loading: m.value,
804
+ "onUpdate:loading": o[3] || (o[3] = (u) => m.value = u),
805
+ editing: f.value,
806
+ "onUpdate:editing": o[4] || (o[4] = (u) => f.value = u),
807
+ "picked-modification-view": F.value,
808
+ "onUpdate:pickedModificationView": o[5] || (o[5] = (u) => F.value = u),
809
+ item: p.value,
810
+ modifications: U.value,
811
+ mode: e.mode,
812
+ view: e.view,
813
+ grouped: e.groupButton !== !1,
814
+ "button-nav-visibility": e.buttonNavVisibility,
815
+ "create-button": K.value,
816
+ "create-and-new-button": se.value,
817
+ "update-button": W.value,
818
+ "drop-button": G.value,
819
+ "edit-mode-button": b.value,
820
+ "group-button": ve.value,
821
+ "data-changed": H.value,
822
+ "http-success-read": L.value,
823
+ "can-create": t.value,
824
+ "can-update": N.value,
825
+ "can-drop": r.value,
826
+ "can-switch-edit-mode": re.value,
827
+ "group-button-as-modal-actions": e.groupButtonAsModalActions,
828
+ "able-to-create": ye.value,
829
+ "able-to-create-and-new": Te.value,
830
+ "able-to-update": Be.value,
831
+ "able-to-drop": Ve.value,
832
+ perms: l.value,
833
+ "modification-view": Ie.value,
834
+ "editable-view": le.value,
835
+ "nav-start-buttons": e.navStartButtons,
836
+ "nav-start-buttons-editing": e.navStartButtonsEditing,
837
+ "nav-end-buttons": e.navEndButtons,
838
+ "nav-end-buttons-editing": e.navEndButtonsEditing,
839
+ "update-config": e.updateConfig,
840
+ onCreate: Ue,
841
+ onSave: Ee,
842
+ onDrop: Me
843
+ }, ce({ _: 2 }, [
844
+ d(M)["prev-buttons-ever"] ? {
845
+ name: "prev-buttons-ever",
846
+ fn: Z(({ canUpdate: u, canDrop: _, perms: x }) => [
847
+ I(e.$slots, "prev-buttons-ever", {
848
+ canUpdate: u,
849
+ canDrop: _,
850
+ perms: x
851
+ })
852
+ ]),
853
+ key: "0"
854
+ } : void 0,
855
+ d(M)["prev-buttons"] ? {
856
+ name: "prev-buttons",
857
+ fn: Z(({ canUpdate: u, canDrop: _, perms: x }) => [
858
+ I(e.$slots, "prev-buttons", {
859
+ canUpdate: u,
860
+ canDrop: _,
861
+ perms: x
862
+ })
863
+ ]),
864
+ key: "1"
865
+ } : void 0
866
+ ]), 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, {
867
+ key: 3,
868
+ ref_key: "buttonNav",
869
+ ref: j,
870
+ loading: m.value,
871
+ "onUpdate:loading": o[6] || (o[6] = (u) => m.value = u),
872
+ editing: f.value,
873
+ "onUpdate:editing": o[7] || (o[7] = (u) => f.value = u),
874
+ "picked-modification-view": F.value,
875
+ "onUpdate:pickedModificationView": o[8] || (o[8] = (u) => F.value = u),
876
+ item: p.value,
877
+ modifications: U.value,
878
+ mode: e.mode,
879
+ view: e.view,
880
+ "button-nav-visibility": e.buttonNavVisibility,
881
+ "create-button": K.value,
882
+ "create-and-new-button": se.value,
883
+ "update-button": W.value,
884
+ "drop-button": G.value,
885
+ "edit-mode-button": b.value,
886
+ "group-button": ve.value,
887
+ "data-changed": H.value,
888
+ "http-success-read": L.value,
889
+ "can-create": t.value,
890
+ "can-update": N.value,
891
+ "can-drop": r.value,
892
+ "can-switch-edit-mode": re.value,
893
+ "group-button-as-modal-actions": e.groupButtonAsModalActions,
894
+ "able-to-create": ye.value,
895
+ "able-to-create-and-new": Te.value,
896
+ "able-to-update": Be.value,
897
+ "able-to-drop": Ve.value,
898
+ perms: l.value,
899
+ "modification-view": Ie.value,
820
900
  "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"] ? {
901
+ "nav-start-buttons": e.navStartButtons,
902
+ "nav-start-buttons-editing": e.navStartButtonsEditing,
903
+ "nav-end-buttons": e.navEndButtons,
904
+ "nav-end-buttons-editing": e.navEndButtonsEditing,
905
+ "update-config": e.updateConfig,
906
+ onCreate: Ue,
907
+ onSave: Ee,
908
+ onDrop: Me
909
+ }, ce({ _: 2 }, [
910
+ d(M)["prev-buttons-ever"] ? {
830
911
  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
912
+ fn: Z(({ canUpdate: u, canDrop: _, perms: x }) => [
913
+ I(e.$slots, "prev-buttons-ever", {
914
+ canUpdate: u,
915
+ canDrop: _,
916
+ perms: x
836
917
  })
837
918
  ]),
838
919
  key: "0"
839
920
  } : void 0,
840
- d(A)["prev-buttons"] ? {
921
+ d(M)["prev-buttons"] ? {
841
922
  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
923
+ fn: Z(({ canUpdate: u, canDrop: _, perms: x }) => [
924
+ I(e.$slots, "prev-buttons", {
925
+ canUpdate: u,
926
+ canDrop: _,
927
+ perms: x
847
928
  })
848
929
  ]),
849
930
  key: "1"
850
931
  } : 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, {
932
+ ]), 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"])), [
933
+ [B, !1]
934
+ ]) : C("", !0),
935
+ m.value ? C("", !0) : (n(), S("div", St, [
936
+ L.value ? (n(), S("div", Ut, [
937
+ oe.value && e.notificationType === d(de).Inline ? (n(), c($, {
855
938
  key: 0,
856
- code: te.value,
857
- palette: te.value === 200 ? "success" : "danger",
939
+ code: J.value,
940
+ palette: J.value === 200 ? "success" : "danger",
858
941
  quick: "",
859
942
  "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({
943
+ onClose: o[9] || (o[9] = (u) => oe.value = !1)
944
+ }, null, 8, ["code", "palette"])) : C("", !0),
945
+ te.value ? (n(), c(at, v({
863
946
  key: 1,
864
947
  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)
948
+ ref: fe,
949
+ modelValue: p.value,
950
+ "onUpdate:modelValue": o[10] || (o[10] = (u) => p.value = u),
951
+ modifications: U.value,
952
+ "onUpdate:modifications": o[11] || (o[11] = (u) => U.value = u),
953
+ valid: O.value,
954
+ "onUpdate:valid": o[12] || (o[12] = (u) => O.value = u),
955
+ changed: R.value,
956
+ "onUpdate:changed": o[13] || (o[13] = (u) => R.value = u)
874
957
  }, {
875
- ...t.formUiConfig,
876
- form: be.value,
877
- differencesTableConfig: t.differencesTableConfig,
878
- visibleView: j.value,
879
- modificationDataState: He.value,
958
+ ...e.formUiConfig,
959
+ form: we.value,
960
+ differencesTableConfig: e.differencesTableConfig,
961
+ visibleView: F.value,
962
+ modificationDataState: Q.value,
880
963
  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)
964
+ disabled: !f.value
965
+ }), ce({ _: 2 }, [
966
+ z(tt.value, (u) => ({
967
+ name: u,
968
+ fn: Z(({}) => [
969
+ I(e.$slots, u)
887
970
  ])
888
971
  }))
889
- ]), 1040, ["modelValue", "modifications", "valid", "changed"])) : I(t.$slots, "item", {
972
+ ]), 1040, ["modelValue", "modifications", "valid", "changed"])) : I(e.$slots, "item", {
890
973
  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
974
+ item: p.value,
975
+ loading: m.value,
976
+ editMode: f.value,
977
+ isCreate: A.value,
978
+ canUpdate: N.value,
979
+ canDrop: r.value,
980
+ itemBeingEdited: ne.value,
981
+ perms: l.value
899
982
  })
900
- ])) : t.notificationType === d(ue).Inline ? (n(), g(R, {
983
+ ])) : e.notificationType === d(de).Inline ? (n(), c($, {
901
984
  key: 1,
902
- code: te.value
903
- }, null, 8, ["code"])) : w("", !0)
985
+ code: J.value
986
+ }, null, 8, ["code"])) : C("", !0)
904
987
  ])),
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,
988
+ m.value ? (n(), c(ot, { key: 5 })) : C("", !0),
989
+ e.buttonNavPosition === d(Re).Bottom && (e.groupButton === !1 || !e.groupButtonAsModalActions) && ke.value ? (n(), c(Oe, {
990
+ key: 6,
908
991
  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,
992
+ ref: j,
993
+ loading: m.value,
994
+ "onUpdate:loading": o[14] || (o[14] = (u) => m.value = u),
995
+ editing: f.value,
996
+ "onUpdate:editing": o[15] || (o[15] = (u) => f.value = u),
997
+ "picked-modification-view": F.value,
998
+ "onUpdate:pickedModificationView": o[16] || (o[16] = (u) => F.value = u),
999
+ item: p.value,
1000
+ modifications: U.value,
1001
+ mode: e.mode,
1002
+ view: e.view,
1003
+ grouped: e.groupButton !== !1,
1004
+ "button-nav-visibility": e.buttonNavVisibility,
1005
+ "create-button": K.value,
1006
+ "create-and-new-button": se.value,
1007
+ "update-button": W.value,
1008
+ "drop-button": G.value,
1009
+ "edit-mode-button": b.value,
1010
+ "group-button": ve.value,
1011
+ "data-changed": H.value,
1012
+ "http-success-read": L.value,
1013
+ "can-create": t.value,
1014
+ "can-update": N.value,
1015
+ "can-drop": r.value,
1016
+ "can-switch-edit-mode": re.value,
1017
+ "group-button-as-modal-actions": e.groupButtonAsModalActions,
1018
+ "able-to-create": ye.value,
1019
+ "able-to-create-and-new": Te.value,
1020
+ "able-to-update": Be.value,
1021
+ "able-to-drop": Ve.value,
1022
+ perms: l.value,
1023
+ "modification-view": Ie.value,
941
1024
  "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"] ? {
1025
+ "nav-start-buttons": e.navStartButtons,
1026
+ "nav-start-buttons-editing": e.navStartButtonsEditing,
1027
+ "nav-end-buttons": e.navEndButtons,
1028
+ "nav-end-buttons-editing": e.navEndButtonsEditing,
1029
+ "update-config": e.updateConfig,
1030
+ onCreate: Ue,
1031
+ onSave: Ee,
1032
+ onDrop: Me
1033
+ }, ce({ _: 2 }, [
1034
+ d(M)["prev-buttons-ever"] ? {
951
1035
  name: "prev-buttons-ever",
952
- fn: x(() => [
953
- I(t.$slots, "prev-buttons-ever")
1036
+ fn: Z(() => [
1037
+ I(e.$slots, "prev-buttons-ever")
954
1038
  ]),
955
1039
  key: "0"
956
1040
  } : void 0,
957
- d(A)["prev-buttons"] ? {
1041
+ d(M)["prev-buttons"] ? {
958
1042
  name: "prev-buttons-ever",
959
- fn: x(() => [
960
- I(t.$slots, "prev-buttons")
1043
+ fn: Z(() => [
1044
+ I(e.$slots, "prev-buttons")
961
1045
  ]),
962
1046
  key: "1"
963
1047
  } : 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)
1048
+ ]), 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
1049
  ]),
966
1050
  _: 2
967
1051
  }, [
968
- t.groupButton !== !1 && t.groupButtonAsModalActions && Se.value ? {
1052
+ e.groupButton !== !1 && e.groupButtonAsModalActions && ke.value ? {
969
1053
  name: "header-actions",
970
- fn: x(() => [
971
- t.buttonNavPosition === d(Pe).Top ? (n(), g(Xe, {
1054
+ fn: Z(() => [
1055
+ e.buttonNavPosition === d(Re).Top ? (n(), c(Oe, {
972
1056
  key: 0,
973
1057
  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,
1058
+ ref: j,
1059
+ loading: m.value,
1060
+ "onUpdate:loading": o[0] || (o[0] = (u) => m.value = u),
1061
+ editing: f.value,
1062
+ "onUpdate:editing": o[1] || (o[1] = (u) => f.value = u),
1063
+ "picked-modification-view": F.value,
1064
+ "onUpdate:pickedModificationView": o[2] || (o[2] = (u) => F.value = u),
1065
+ item: p.value,
1066
+ modifications: U.value,
1067
+ mode: e.mode,
1068
+ view: e.view,
985
1069
  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,
1070
+ "button-nav-visibility": e.buttonNavVisibility,
1071
+ "create-button": K.value,
1072
+ "create-and-new-button": se.value,
1073
+ "update-button": W.value,
1074
+ "drop-button": G.value,
1075
+ "edit-mode-button": b.value,
1076
+ "group-button": ve.value,
1077
+ "data-changed": H.value,
1078
+ "http-success-read": L.value,
1079
+ "can-create": t.value,
1080
+ "can-update": N.value,
1081
+ "can-drop": r.value,
1082
+ "can-switch-edit-mode": re.value,
1083
+ "group-button-as-modal-actions": e.groupButtonAsModalActions,
1084
+ "able-to-create": ye.value,
1085
+ "able-to-create-and-new": Te.value,
1086
+ "able-to-update": Be.value,
1087
+ "able-to-drop": Ve.value,
1088
+ perms: l.value,
1089
+ "modification-view": Ie.value,
1006
1090
  "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"] ? {
1091
+ "nav-start-buttons": e.navStartButtons,
1092
+ "nav-start-buttons-editing": e.navStartButtonsEditing,
1093
+ "nav-end-buttons": e.navEndButtons,
1094
+ "nav-end-buttons-editing": e.navEndButtonsEditing,
1095
+ "update-config": e.updateConfig,
1096
+ onCreate: Ue,
1097
+ onSave: Ee,
1098
+ onDrop: Me
1099
+ }, ce({ _: 2 }, [
1100
+ d(M)["prev-buttons-ever"] ? {
1016
1101
  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
1102
+ fn: Z(({ canUpdate: u, canDrop: _, perms: x }) => [
1103
+ I(e.$slots, "prev-buttons-ever", {
1104
+ canUpdate: u,
1105
+ canDrop: _,
1106
+ perms: x
1022
1107
  })
1023
1108
  ]),
1024
1109
  key: "0"
1025
1110
  } : void 0,
1026
- d(A)["prev-buttons"] ? {
1111
+ d(M)["prev-buttons"] ? {
1027
1112
  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
1113
+ fn: Z(({ canUpdate: u, canDrop: _, perms: x }) => [
1114
+ I(e.$slots, "prev-buttons", {
1115
+ canUpdate: u,
1116
+ canDrop: _,
1117
+ perms: x
1033
1118
  })
1034
1119
  ]),
1035
1120
  key: "1"
1036
1121
  } : 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)
1122
+ ]), 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
1123
  ]),
1039
1124
  key: "0"
1040
1125
  } : void 0
@@ -1042,13 +1127,13 @@ const E = (...$) => {
1042
1127
  };
1043
1128
  }
1044
1129
  }), jt = {
1045
- install: ($, ke = {}) => {
1046
- $.component("lkt-item-crud") === void 0 && $.component("lkt-item-crud", Mt);
1130
+ install: (P, he = {}) => {
1131
+ P.component("lkt-item-crud") === void 0 && P.component("lkt-item-crud", Et);
1047
1132
  }
1048
- }, Ft = ($) => {
1049
- me.defaultSaveIcon = $;
1050
- }, Pt = ($) => {
1051
- me.defaultDropIcon = $;
1133
+ }, Ft = (P) => {
1134
+ ge.defaultSaveIcon = P;
1135
+ }, Pt = (P) => {
1136
+ ge.defaultDropIcon = P;
1052
1137
  };
1053
1138
  export {
1054
1139
  $t as debugLktItemCrud,