lkt-item-crud 2.0.32 → 2.0.34

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