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