lkt-item-crud 2.0.16 → 2.0.18

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,31 +1,32 @@
1
- import { defineComponent as Ue, useSlots as Se, ref as m, watch as D, computed as U, resolveComponent as be, createElementBlock as N, createCommentVNode as d, openBlock as b, createBlock as V, Fragment as ke, renderSlot as v, withDirectives as E, mergeProps as R, unref as u, createVNode as X, withCtx as C, vShow as L, mergeDefaults as Ae, nextTick as $e, onMounted as Ee, resolveDynamicComponent as Le, createSlots as oe, createElementVNode as Ne, toDisplayString as Ve } from "vue";
2
- import { httpCall as Oe } from "lkt-http-client";
3
- import { DataState as Ce } from "lkt-data-state";
4
- import { ItemCrudMode as S, ItemCrudButtonNavVisibility as he, TablePermission as fe, ensureButtonConfig as W, LktSettings as p, ItemCrudView as De, ItemCrudButtonNavPosition as ce, NotificationType as F, getDefaultValues as je, ItemCrud as Pe, ToastPositionX as z } from "lkt-vue-kernel";
5
- import { closeModal as Xe, updateModalKey as We } from "lkt-modal";
6
- import { __ as Ke } from "lkt-i18n";
7
- import { openToast as J } from "lkt-toast";
8
- const Y = class Y {
1
+ import { defineComponent as Me, useSlots as Te, ref as f, watch as k, computed as S, resolveComponent as ke, createElementBlock as N, createCommentVNode as d, openBlock as b, createBlock as j, Fragment as Ce, renderSlot as s, withDirectives as $, mergeProps as R, unref as u, createVNode as G, withCtx as C, vShow as L, mergeDefaults as $e, nextTick as Le, onMounted as Ne, resolveDynamicComponent as Oe, createSlots as re, createElementVNode as Ve, toDisplayString as je } from "vue";
2
+ import { httpCall as Pe } from "lkt-http-client";
3
+ import { DataState as Ue } from "lkt-data-state";
4
+ import { ItemCrudMode as I, ItemCrudButtonNavVisibility as Se, TablePermission as ge, ensureButtonConfig as q, LktSettings as i, ItemCrudView as Ie, ItemCrudButtonNavPosition as ye, NotificationType as J, getDefaultValues as Xe, ItemCrud as Fe, ToastPositionX as Z } from "lkt-vue-kernel";
5
+ import { closeModal as We, updateModalKey as Ke } from "lkt-modal";
6
+ import { __ as Ge } from "lkt-i18n";
7
+ import { openToast as _ } from "lkt-toast";
8
+ import { useRouter as qe } from "vue-router";
9
+ const ee = class ee {
9
10
  };
10
- Y.debugEnabled = !1, Y.defaultSaveIcon = "", Y.defaultDropIcon = "";
11
- let Q = Y;
12
- const y = (...T) => {
13
- Q.debugEnabled && console.info("[LktItemCrud] ", ...T);
14
- }, st = (T = !0) => {
15
- Q.debugEnabled = T;
16
- }, Fe = {
11
+ ee.debugEnabled = !1, ee.defaultSaveIcon = "", ee.defaultDropIcon = "";
12
+ let x = ee;
13
+ const B = (...T) => {
14
+ x.debugEnabled && console.info("[LktItemCrud] ", ...T);
15
+ }, ct = (T = !0) => {
16
+ x.debugEnabled = T;
17
+ }, He = {
17
18
  key: 0,
18
19
  class: "lkt-item-crud-buttons"
19
- }, Ge = {
20
+ }, ze = {
20
21
  key: 0,
21
22
  class: "lkt-item-crud-buttons"
22
- }, qe = {
23
+ }, Je = {
23
24
  key: 1,
24
25
  class: "lkt-item-crud-buttons"
25
- }, He = {
26
+ }, Qe = {
26
27
  key: 2,
27
28
  class: "lkt-item-crud-buttons"
28
- }, me = /* @__PURE__ */ Ue({
29
+ }, Be = /* @__PURE__ */ Me({
29
30
  __name: "ButtonNav",
30
31
  props: {
31
32
  item: { default: () => ({}) },
@@ -58,66 +59,66 @@ const y = (...T) => {
58
59
  "save",
59
60
  "drop"
60
61
  ],
61
- setup(T, { expose: Z, emit: ue }) {
62
- const a = ue, n = T, r = Se(), s = m(null), i = m(null), f = m(n.loading);
63
- D(() => n.loading, (e) => f.value = e), D(f, (e) => a("update:loading", e));
64
- const l = m(n.editing);
65
- D(() => n.editing, (e) => l.value = e), D(l, (e) => a("update:editing", e));
66
- const B = () => {
67
- f.value = !0;
68
- }, M = () => {
69
- f.value = !1;
70
- }, A = (e, h) => {
71
- typeof e > "u" || a("create", e, h);
72
- }, k = (e, h) => {
73
- typeof e > "u" || a("save", e, h);
74
- }, w = (e, h) => {
75
- typeof e > "u" || a("drop", e, h);
62
+ setup(T, { expose: te, emit: le }) {
63
+ const a = le, r = T, l = Te(), c = f(null), p = f(null), n = f(r.loading);
64
+ k(() => r.loading, (e) => n.value = e), k(n, (e) => a("update:loading", e));
65
+ const m = f(r.editing);
66
+ k(() => r.editing, (e) => m.value = e), k(m, (e) => a("update:editing", e));
67
+ const v = () => {
68
+ n.value = !0;
69
+ }, g = () => {
70
+ n.value = !1;
71
+ }, A = (e, D) => {
72
+ typeof e > "u" || a("create", e, D);
73
+ }, P = (e, D) => {
74
+ typeof e > "u" || a("save", e, D);
75
+ }, E = (e, D) => {
76
+ typeof e > "u" || a("drop", e, D);
76
77
  };
77
- Z({
78
+ te({
78
79
  doSave: () => {
79
- s.value && typeof s.value.click == "function" && s.value.click();
80
+ c.value && typeof c.value.click == "function" && c.value.click();
80
81
  },
81
82
  doDrop: () => {
82
- i.value && typeof i.value.click == "function" && i.value.click();
83
+ p.value && typeof p.value.click == "function" && p.value.click();
83
84
  }
84
85
  });
85
- const K = U(() => !n.canDrop || n.dropButton === !1 ? !1 : !n.canUpdate && n.canDrop ? !0 : !f.value && n.editing && n.httpSuccessRead), O = U(() => n.mode === S.Create && n.createButton === !1 || n.mode === S.Update && n.updateButton === !1 || f.value ? !1 : n.editing && n.httpSuccessRead), $ = U(() => n.editModeButton === !1 || !n.canSwitchEditMode || !n.canUpdate && !n.canDrop || !n.canUpdate && n.canDrop ? !1 : !f.value && n.mode !== S.Create && n.httpSuccessRead), G = U(() => n.buttonNavVisibility === he.Always || r["prev-buttons-ever"] ? !0 : n.buttonNavVisibility === he.Never ? !1 : O.value || K.value || $.value);
86
- return (e, h) => {
87
- const c = be("lkt-button");
88
- return G.value ? (b(), N("div", Fe, [
89
- e.grouped && e.groupButtonAsModalActions ? (b(), N(ke, { key: 0 }, [
90
- $.value ? (b(), V(c, R({ key: 0 }, e.editModeButton, {
91
- checked: l.value,
92
- "onUpdate:checked": h[0] || (h[0] = (I) => l.value = I),
86
+ const H = S(() => !r.canDrop || r.dropButton === !1 ? !1 : !r.canUpdate && r.canDrop ? !0 : !n.value && r.editing && r.httpSuccessRead), U = S(() => r.mode === I.Create && r.createButton === !1 || r.mode === I.Update && r.updateButton === !1 || n.value ? !1 : r.editing && r.httpSuccessRead), z = S(() => r.editModeButton === !1 || !r.canSwitchEditMode || !r.canUpdate && !r.canDrop || !r.canUpdate && r.canDrop ? !1 : !n.value && r.mode !== I.Create && r.httpSuccessRead), ae = S(() => r.buttonNavVisibility === Se.Always || l["prev-buttons-ever"] ? !0 : r.buttonNavVisibility === Se.Never ? !1 : U.value || H.value || z.value);
87
+ return (e, D) => {
88
+ const h = ke("lkt-button");
89
+ return ae.value ? (b(), N("div", He, [
90
+ e.grouped && e.groupButtonAsModalActions ? (b(), N(Ce, { key: 0 }, [
91
+ z.value ? (b(), j(h, R({ key: 0 }, e.editModeButton, {
92
+ checked: m.value,
93
+ "onUpdate:checked": D[0] || (D[0] = (X) => m.value = X),
93
94
  class: "lkt-item-crud--switch-mode-button"
94
95
  }), null, 16, ["checked"])) : d("", !0),
95
- u(r)["prev-buttons-ever"] ? v(e.$slots, "prev-buttons-ever", {
96
+ u(l)["prev-buttons-ever"] ? s(e.$slots, "prev-buttons-ever", {
96
97
  key: 1,
97
98
  canUpdate: e.canUpdate,
98
99
  canDrop: e.canDrop,
99
100
  perms: e.perms
100
101
  }) : d("", !0),
101
- u(r)["prev-buttons"] ? v(e.$slots, "prev-buttons", {
102
+ u(l)["prev-buttons"] ? s(e.$slots, "prev-buttons", {
102
103
  key: 2,
103
104
  canUpdate: e.canUpdate,
104
105
  canDrop: e.canDrop,
105
106
  perms: e.perms
106
107
  }) : d("", !0),
107
- E(X(c, R({
108
+ $(G(h, R({
108
109
  ref_key: "saveButtonRef",
109
- ref: s
110
+ ref: c
110
111
  }, e.updateButton, {
111
112
  disabled: !e.ableToUpdate,
112
- onLoading: B,
113
- onLoaded: M,
114
- onClick: k
113
+ onLoading: v,
114
+ onLoaded: g,
115
+ onClick: P
115
116
  }), {
116
117
  default: C(() => [
117
- u(r)["button-save"] ? v(e.$slots, "button-save", {
118
+ u(l)["button-save"] ? s(e.$slots, "button-save", {
118
119
  key: 0,
119
120
  item: e.item,
120
- editMode: l.value,
121
+ editMode: m.value,
121
122
  isCreate: !1,
122
123
  canUpdate: e.canUpdate,
123
124
  canDrop: e.canDrop
@@ -125,22 +126,22 @@ const y = (...T) => {
125
126
  ]),
126
127
  _: 3
127
128
  }, 16, ["disabled"]), [
128
- [L, e.mode === u(S).Update && O.value]
129
+ [L, e.mode === u(I).Update && U.value]
129
130
  ]),
130
- E(X(c, R({
131
+ $(G(h, R({
131
132
  ref_key: "saveButtonRef",
132
- ref: s
133
+ ref: c
133
134
  }, e.createButton, {
134
135
  disabled: !e.ableToCreate,
135
- onLoading: B,
136
- onLoaded: M,
136
+ onLoading: v,
137
+ onLoaded: g,
137
138
  onClick: A
138
139
  }), {
139
140
  default: C(() => [
140
- u(r)["button-save"] ? v(e.$slots, "button-save", {
141
+ u(l)["button-save"] ? s(e.$slots, "button-save", {
141
142
  key: 0,
142
143
  item: e.item,
143
- editMode: l.value,
144
+ editMode: m.value,
144
145
  isCreate: !0,
145
146
  canUpdate: e.canUpdate,
146
147
  canDrop: e.canDrop
@@ -148,22 +149,22 @@ const y = (...T) => {
148
149
  ]),
149
150
  _: 3
150
151
  }, 16, ["disabled"]), [
151
- [L, e.mode === u(S).Create && O.value]
152
+ [L, e.mode === u(I).Create && U.value]
152
153
  ]),
153
- E(X(c, R({
154
+ $(G(h, R({
154
155
  ref_key: "dropButtonRef",
155
- ref: i
156
+ ref: p
156
157
  }, e.dropButton, {
157
158
  disabled: !e.ableToDrop,
158
- onLoading: B,
159
- onLoaded: M,
160
- onClick: w
159
+ onLoading: v,
160
+ onLoaded: g,
161
+ onClick: E
161
162
  }), {
162
163
  default: C(() => [
163
- u(r)["button-drop"] ? v(e.$slots, "button-drop", {
164
+ u(l)["button-drop"] ? s(e.$slots, "button-drop", {
164
165
  key: 0,
165
166
  item: e.item,
166
- editMode: l.value,
167
+ editMode: m.value,
167
168
  isCreate: !1,
168
169
  canUpdate: e.canUpdate,
169
170
  canDrop: e.canDrop
@@ -171,45 +172,45 @@ const y = (...T) => {
171
172
  ]),
172
173
  _: 3
173
174
  }, 16, ["disabled"]), [
174
- [L, K.value && e.mode !== u(S).Create]
175
+ [L, H.value && e.mode !== u(I).Create]
175
176
  ]),
176
- u(r).buttons ? v(e.$slots, "buttons", { key: 3 }) : d("", !0)
177
- ], 64)) : e.grouped ? (b(), V(c, R({
177
+ u(l).buttons ? s(e.$slots, "buttons", { key: 3 }) : d("", !0)
178
+ ], 64)) : e.grouped ? (b(), j(h, R({
178
179
  key: 1,
179
180
  ref: "groupButton"
180
181
  }, e.groupButton, { class: "lkt-item-crud-group-button" }), {
181
182
  split: C(() => [
182
- $.value ? (b(), V(c, R({ key: 0 }, e.editModeButton, {
183
- checked: l.value,
184
- "onUpdate:checked": h[1] || (h[1] = (I) => l.value = I),
183
+ z.value ? (b(), j(h, R({ key: 0 }, e.editModeButton, {
184
+ checked: m.value,
185
+ "onUpdate:checked": D[1] || (D[1] = (X) => m.value = X),
185
186
  class: "lkt-item-crud--switch-mode-button"
186
187
  }), null, 16, ["checked"])) : d("", !0),
187
- u(r)["prev-buttons-ever"] ? v(e.$slots, "prev-buttons-ever", {
188
+ u(l)["prev-buttons-ever"] ? s(e.$slots, "prev-buttons-ever", {
188
189
  key: 1,
189
190
  canUpdate: e.canUpdate,
190
191
  canDrop: e.canDrop,
191
192
  perms: e.perms
192
193
  }) : d("", !0),
193
- u(r)["prev-buttons"] ? v(e.$slots, "prev-buttons", {
194
+ u(l)["prev-buttons"] ? s(e.$slots, "prev-buttons", {
194
195
  key: 2,
195
196
  canUpdate: e.canUpdate,
196
197
  canDrop: e.canDrop,
197
198
  perms: e.perms
198
199
  }) : d("", !0),
199
- E(X(c, R({
200
+ $(G(h, R({
200
201
  ref_key: "saveButtonRef",
201
- ref: s
202
+ ref: c
202
203
  }, e.updateButton, {
203
204
  disabled: !e.ableToUpdate,
204
- onLoading: B,
205
- onLoaded: M,
206
- onClick: k
205
+ onLoading: v,
206
+ onLoaded: g,
207
+ onClick: P
207
208
  }), {
208
209
  default: C(() => [
209
- u(r)["button-save"] ? v(e.$slots, "button-save", {
210
+ u(l)["button-save"] ? s(e.$slots, "button-save", {
210
211
  key: 0,
211
212
  item: e.item,
212
- editMode: l.value,
213
+ editMode: m.value,
213
214
  isCreate: !1,
214
215
  canUpdate: e.canUpdate,
215
216
  canDrop: e.canDrop
@@ -217,22 +218,22 @@ const y = (...T) => {
217
218
  ]),
218
219
  _: 3
219
220
  }, 16, ["disabled"]), [
220
- [L, e.mode === u(S).Update && O.value]
221
+ [L, e.mode === u(I).Update && U.value]
221
222
  ]),
222
- E(X(c, R({
223
+ $(G(h, R({
223
224
  ref_key: "saveButtonRef",
224
- ref: s
225
+ ref: c
225
226
  }, e.createButton, {
226
227
  disabled: !e.ableToCreate,
227
- onLoading: B,
228
- onLoaded: M,
228
+ onLoading: v,
229
+ onLoaded: g,
229
230
  onClick: A
230
231
  }), {
231
232
  default: C(() => [
232
- u(r)["button-save"] ? v(e.$slots, "button-save", {
233
+ u(l)["button-save"] ? s(e.$slots, "button-save", {
233
234
  key: 0,
234
235
  item: e.item,
235
- editMode: l.value,
236
+ editMode: m.value,
236
237
  isCreate: !0,
237
238
  canUpdate: e.canUpdate,
238
239
  canDrop: e.canDrop
@@ -240,22 +241,22 @@ const y = (...T) => {
240
241
  ]),
241
242
  _: 3
242
243
  }, 16, ["disabled"]), [
243
- [L, e.mode === u(S).Create && O.value]
244
+ [L, e.mode === u(I).Create && U.value]
244
245
  ]),
245
- E(X(c, R({
246
+ $(G(h, R({
246
247
  ref_key: "dropButtonRef",
247
- ref: i
248
+ ref: p
248
249
  }, e.dropButton, {
249
250
  disabled: !e.ableToDrop,
250
- onLoading: B,
251
- onLoaded: M,
252
- onClick: w
251
+ onLoading: v,
252
+ onLoaded: g,
253
+ onClick: E
253
254
  }), {
254
255
  default: C(() => [
255
- u(r)["button-drop"] ? v(e.$slots, "button-drop", {
256
+ u(l)["button-drop"] ? s(e.$slots, "button-drop", {
256
257
  key: 0,
257
258
  item: e.item,
258
- editMode: l.value,
259
+ editMode: m.value,
259
260
  isCreate: !1,
260
261
  canUpdate: e.canUpdate,
261
262
  canDrop: e.canDrop
@@ -263,44 +264,44 @@ const y = (...T) => {
263
264
  ]),
264
265
  _: 3
265
266
  }, 16, ["disabled"]), [
266
- [L, K.value && e.mode !== u(S).Create]
267
+ [L, H.value && e.mode !== u(I).Create]
267
268
  ]),
268
- u(r).buttons ? v(e.$slots, "buttons", { key: 3 }) : d("", !0)
269
+ u(l).buttons ? s(e.$slots, "buttons", { key: 3 }) : d("", !0)
269
270
  ]),
270
271
  _: 3
271
- }, 16)) : (b(), N(ke, { key: 2 }, [
272
- u(r)["prev-buttons-ever"] ? E((b(), N("div", Ge, [
273
- v(e.$slots, "prev-buttons-ever", {
272
+ }, 16)) : (b(), N(Ce, { key: 2 }, [
273
+ u(l)["prev-buttons-ever"] ? $((b(), N("div", ze, [
274
+ s(e.$slots, "prev-buttons-ever", {
274
275
  canUpdate: e.canUpdate,
275
276
  canDrop: e.canDrop,
276
277
  perms: e.perms
277
278
  })
278
279
  ], 512)), [
279
- [L, !f.value]
280
+ [L, !n.value]
280
281
  ]) : d("", !0),
281
- u(r)["prev-buttons"] ? E((b(), N("div", qe, [
282
- v(e.$slots, "prev-buttons", {
282
+ u(l)["prev-buttons"] ? $((b(), N("div", Je, [
283
+ s(e.$slots, "prev-buttons", {
283
284
  canUpdate: e.canUpdate,
284
285
  canDrop: e.canDrop,
285
286
  perms: e.perms
286
287
  })
287
288
  ], 512)), [
288
- [L, l.value && !f.value]
289
+ [L, m.value && !n.value]
289
290
  ]) : d("", !0),
290
- E(X(c, R({
291
+ $(G(h, R({
291
292
  ref_key: "saveButtonRef",
292
- ref: s
293
+ ref: c
293
294
  }, e.updateButton, {
294
295
  disabled: !e.ableToUpdate,
295
- onLoading: B,
296
- onLoaded: M,
297
- onClick: k
296
+ onLoading: v,
297
+ onLoaded: g,
298
+ onClick: P
298
299
  }), {
299
300
  default: C(() => [
300
- u(r)["button-save"] ? v(e.$slots, "button-save", {
301
+ u(l)["button-save"] ? s(e.$slots, "button-save", {
301
302
  key: 0,
302
303
  item: e.item,
303
- editMode: l.value,
304
+ editMode: m.value,
304
305
  isCreate: !1,
305
306
  canUpdate: e.canUpdate,
306
307
  canDrop: e.canDrop
@@ -308,22 +309,22 @@ const y = (...T) => {
308
309
  ]),
309
310
  _: 3
310
311
  }, 16, ["disabled"]), [
311
- [L, e.mode === u(S).Update && O.value]
312
+ [L, e.mode === u(I).Update && U.value]
312
313
  ]),
313
- E(X(c, R({
314
+ $(G(h, R({
314
315
  ref_key: "saveButtonRef",
315
- ref: s
316
+ ref: c
316
317
  }, e.createButton, {
317
318
  disabled: !e.ableToCreate,
318
- onLoading: B,
319
- onLoaded: M,
319
+ onLoading: v,
320
+ onLoaded: g,
320
321
  onClick: A
321
322
  }), {
322
323
  default: C(() => [
323
- u(r)["button-save"] ? v(e.$slots, "button-save", {
324
+ u(l)["button-save"] ? s(e.$slots, "button-save", {
324
325
  key: 0,
325
326
  item: e.item,
326
- editMode: l.value,
327
+ editMode: m.value,
327
328
  isCreate: !0,
328
329
  canUpdate: e.canUpdate,
329
330
  canDrop: !1
@@ -331,22 +332,22 @@ const y = (...T) => {
331
332
  ]),
332
333
  _: 3
333
334
  }, 16, ["disabled"]), [
334
- [L, e.mode === u(S).Create && O.value]
335
+ [L, e.mode === u(I).Create && U.value]
335
336
  ]),
336
- E(X(c, R({
337
+ $(G(h, R({
337
338
  ref_key: "dropButtonRef",
338
- ref: i
339
+ ref: p
339
340
  }, e.dropButton, {
340
341
  disabled: !e.ableToDrop,
341
- onLoading: B,
342
- onLoaded: M,
343
- onClick: w
342
+ onLoading: v,
343
+ onLoaded: g,
344
+ onClick: E
344
345
  }), {
345
346
  default: C(() => [
346
- u(r)["button-drop"] ? v(e.$slots, "button-drop", {
347
+ u(l)["button-drop"] ? s(e.$slots, "button-drop", {
347
348
  key: 0,
348
349
  item: e.item,
349
- editMode: l.value,
350
+ editMode: m.value,
350
351
  isCreate: !1,
351
352
  canUpdate: e.canUpdate,
352
353
  canDrop: e.canDrop
@@ -354,46 +355,47 @@ const y = (...T) => {
354
355
  ]),
355
356
  _: 3
356
357
  }, 16, ["disabled"]), [
357
- [L, K.value && e.mode !== u(S).Create]
358
+ [L, H.value && e.mode !== u(I).Create]
358
359
  ]),
359
- u(r).buttons ? E((b(), N("div", He, [
360
- v(e.$slots, "buttons")
360
+ u(l).buttons ? $((b(), N("div", Qe, [
361
+ s(e.$slots, "buttons")
361
362
  ], 512)), [
362
- [L, l.value && !f.value]
363
+ [L, m.value && !n.value]
363
364
  ]) : d("", !0),
364
- $.value ? (b(), V(c, R({ key: 3 }, e.editModeButton, {
365
- checked: l.value,
366
- "onUpdate:checked": h[2] || (h[2] = (I) => l.value = I),
365
+ z.value ? (b(), j(h, R({ key: 3 }, e.editModeButton, {
366
+ checked: m.value,
367
+ "onUpdate:checked": D[2] || (D[2] = (X) => m.value = X),
367
368
  class: "lkt-item-crud--switch-mode-button"
368
369
  }), null, 16, ["checked"])) : d("", !0)
369
370
  ], 64))
370
371
  ])) : d("", !0);
371
372
  };
372
373
  }
373
- }), ze = { class: "lkt-item-crud" }, Je = {
374
+ }), Ye = { class: "lkt-item-crud" }, Ze = {
374
375
  key: 0,
375
376
  class: "lkt-item-crud_header"
376
- }, Qe = {
377
+ }, _e = {
377
378
  key: 0,
378
379
  class: "lkt-item-crud_header-slot"
379
- }, Ye = {
380
+ }, xe = {
380
381
  key: 1,
381
382
  class: "lkt-item-crud_header-title"
382
- }, Ze = {
383
+ }, et = {
383
384
  key: 2,
384
385
  class: "lkt-item-crud_header-slot"
385
- }, _e = {
386
+ }, tt = {
386
387
  key: 2,
387
388
  class: "lkt-item-crud_content"
388
- }, xe = {
389
+ }, at = {
389
390
  key: 0,
390
391
  class: "lkt-grid-1"
391
- }, et = /* @__PURE__ */ Ue({
392
+ }, ot = /* @__PURE__ */ Me({
392
393
  __name: "LktItemCrud",
393
- props: /* @__PURE__ */ Ae({
394
+ props: /* @__PURE__ */ $e({
394
395
  modelValue: {},
395
396
  editing: { type: Boolean },
396
397
  perms: {},
398
+ customData: {},
397
399
  mode: {},
398
400
  view: {},
399
401
  editModeButton: { type: [Object, Boolean] },
@@ -412,11 +414,16 @@ const y = (...T) => {
412
414
  title: {},
413
415
  beforeEmitUpdate: { type: Function },
414
416
  notificationType: {},
415
- enabledSaveWithoutChanges: { type: Boolean }
416
- }, je(Pe)),
417
+ enabledSaveWithoutChanges: { type: Boolean },
418
+ redirectOnCreate: { type: [String, Function] },
419
+ redirectOnDrop: { type: [String, Function] },
420
+ events: {}
421
+ }, Xe(Fe)),
417
422
  emits: [
418
423
  "update:modelValue",
419
424
  "update:editing",
425
+ "update:perms",
426
+ "update:customData",
420
427
  "read",
421
428
  "create",
422
429
  "update",
@@ -426,299 +433,325 @@ const y = (...T) => {
426
433
  "error",
427
434
  "modified-data"
428
435
  ],
429
- setup(T, { expose: Z, emit: ue }) {
430
- const a = T, n = Se(), r = ue, s = m(!0), i = m(a.modelValue), f = m(a.perms), l = m(a.editing), B = m(!1), M = m(!1), A = m(200), k = m(new Ce(i.value, a.dataStateConfig)), w = m(!1), _ = m(new Ce(a.readData)), j = m(a.mode === S.Create), K = m(!1), O = m(!1), $ = m(null), G = U(() => !j.value && Array.isArray(f.value) && f.value.includes(fe.Update)), e = U(() => !j.value && Array.isArray(f.value) && f.value.includes(fe.Drop)), h = U(() => !j.value && Array.isArray(f.value) && f.value.includes(fe.SwitchEditMode));
431
- D(() => a.mode, (t) => {
432
- j.value = t === S.Create;
436
+ setup(T, { expose: te, emit: le }) {
437
+ const a = T, r = qe(), l = Te(), c = le, p = f(!0), n = f(a.modelValue), m = f(a.customData), v = f(a.perms), g = f(a.editing), A = f(!1), P = f(!1), E = f(200), M = f(new Ue(n.value, a.dataStateConfig)), O = f(!1), H = f(new Ue(a.readData)), U = f(a.mode === I.Create), z = f(!1), ae = f(!1), e = f(null), D = S(() => !U.value && Array.isArray(v.value) && v.value.includes(ge.Update)), h = S(() => !U.value && Array.isArray(v.value) && v.value.includes(ge.Drop)), X = S(() => !U.value && Array.isArray(v.value) && v.value.includes(ge.SwitchEditMode));
438
+ k(() => a.mode, (t) => {
439
+ U.value = t === I.Create;
440
+ }), k(() => a.perms, (t) => {
441
+ v.value = t;
442
+ }), k(v, (t) => {
443
+ c("update:perms", t);
444
+ }), k(() => a.customData, (t) => {
445
+ m.value = t;
446
+ }), k(m, (t) => {
447
+ c("update:customData", t);
433
448
  });
434
- const c = m(W(a.createButton, p.defaultCreateButton)), I = m(W(a.updateButton, p.defaultUpdateButton)), P = m(W(a.dropButton, p.defaultDropButton)), x = m(W(a.editModeButton, p.defaultEditModeButton)), ne = m(W(a.groupButton, p.defaultGroupButton));
435
- D(() => a.createButton, (t) => {
436
- c.value = W(t, p.defaultCreateButton);
437
- }, { deep: !0 }), D(() => a.updateButton, (t) => {
438
- I.value = W(t, p.defaultUpdateButton);
439
- }, { deep: !0 }), D(() => a.dropButton, (t) => {
440
- P.value = W(t, p.defaultDropButton);
441
- }, { deep: !0 }), D(() => a.editModeButton, (t) => {
442
- x.value = W(t, p.defaultEditModeButton);
449
+ const F = f(q(a.createButton, i.defaultCreateButton)), W = f(q(a.updateButton, i.defaultUpdateButton)), K = f(q(a.dropButton, i.defaultDropButton)), oe = f(q(a.editModeButton, i.defaultEditModeButton)), ie = f(q(a.groupButton, i.defaultGroupButton));
450
+ k(() => a.createButton, (t) => {
451
+ F.value = q(t, i.defaultCreateButton);
452
+ }, { deep: !0 }), k(() => a.updateButton, (t) => {
453
+ W.value = q(t, i.defaultUpdateButton);
454
+ }, { deep: !0 }), k(() => a.dropButton, (t) => {
455
+ K.value = q(t, i.defaultDropButton);
456
+ }, { deep: !0 }), k(() => a.editModeButton, (t) => {
457
+ oe.value = q(t, i.defaultEditModeButton);
443
458
  }, { deep: !0 });
444
- const ee = async () => {
445
- y("fetchItem"), s.value = !0, A.value = -1, M.value = !1;
459
+ const ue = async () => {
460
+ var t, o, V;
461
+ B("fetchItem"), p.value = !0, E.value = -1, P.value = !1, typeof ((t = a.events) == null ? void 0 : t.httpStart) == "function" && a.events.httpStart();
446
462
  try {
447
- const t = await Oe(a.readResource, a.readData);
448
- if (y("fetchItem -> response", t), s.value = !1, A.value = t.httpStatus, !t.success) {
449
- B.value = !1, A.value = t.httpStatus, r("error", t.httpStatus);
463
+ const w = await Pe(a.readResource, a.readData);
464
+ if (B("fetchItem -> response", w), p.value = !1, E.value = w.httpStatus, m.value = w.custom, !w.success) {
465
+ A.value = !1, E.value = w.httpStatus, typeof ((o = a.events) == null ? void 0 : o.httpEnd) == "function" && a.events.httpEnd({
466
+ httpResponse: w
467
+ }), c("error", w.httpStatus);
450
468
  return;
451
469
  }
452
- B.value = !0, i.value = t.data, f.value = t.perms, k.value.increment(i.value).turnStoredIntoOriginal(), w.value = k.value.changed(), _.value.turnStoredIntoOriginal(), r("read", t);
470
+ A.value = !0, n.value = w.data, v.value = w.perms, M.value.increment(n.value).turnStoredIntoOriginal(), O.value = M.value.changed(), H.value.turnStoredIntoOriginal(), typeof ((V = a.events) == null ? void 0 : V.httpEnd) == "function" && a.events.httpEnd({
471
+ httpResponse: w
472
+ }), c("read", w);
453
473
  } catch {
454
- s.value = !1, B.value = !1, A.value = 404, r("error", 404);
474
+ p.value = !1, A.value = !1, E.value = 404, c("error", 404);
455
475
  return;
456
476
  }
457
477
  };
458
- D(() => a.modelValue, (t) => {
459
- i.value = t, k.value.increment(t);
460
- }, { deep: !0 }), D(i, (t) => {
461
- if (K.value = !0, y("item updated ->", i.value), typeof a.beforeEmitUpdate == "function") {
462
- y("item updated -> has beforeEmitUpdate");
463
- let o = a.beforeEmitUpdate(i.value);
464
- y("item updated -> override with: ", o), typeof o == "object" && (i.value = o);
478
+ k(() => a.modelValue, (t) => {
479
+ n.value = t, M.value.increment(t);
480
+ }, { deep: !0 }), k(n, (t) => {
481
+ if (z.value = !0, B("item updated ->", n.value), typeof a.beforeEmitUpdate == "function") {
482
+ B("item updated -> has beforeEmitUpdate");
483
+ let o = a.beforeEmitUpdate(n.value);
484
+ B("item updated -> override with: ", o), typeof o == "object" && (n.value = o);
465
485
  }
466
- r("update:modelValue", i.value), y("item updated -> update dataState"), k.value.increment(t), w.value = k.value.changed(), $e(() => K.value = !1);
467
- }, { deep: !0 }), D(f, () => r("perms", f.value)), D(w, (t) => {
468
- r("modified-data", t);
469
- }), D(() => a.readData, (t) => {
470
- _.value.increment(t), _.value.changed() && ee();
471
- }), D(() => a.editing, (t) => {
472
- y("editing updated -> updating editMode", t), l.value = t;
473
- }), D(l, (t) => {
474
- y("editMode updated -> emit update", t), r("update:editing", t);
475
- }), Ee(() => {
476
- a.readResource && !j.value ? ee() : (j.value, B.value = !0, l.value = !0, s.value = !1, k.value.increment(i.value).turnStoredIntoOriginal(), w.value = k.value.changed());
486
+ c("update:modelValue", n.value), B("item updated -> update dataState"), M.value.increment(t), O.value = M.value.changed(), Le(() => z.value = !1);
487
+ }, { deep: !0 }), k(v, () => c("perms", v.value)), k(O, (t) => {
488
+ c("modified-data", t);
489
+ }), k(() => a.readData, (t) => {
490
+ H.value.increment(t), H.value.changed() && ue();
491
+ }), k(() => a.editing, (t) => {
492
+ B("editing updated -> updating editMode", t), g.value = t;
493
+ }), k(g, (t) => {
494
+ B("editMode updated -> emit update", t), c("update:editing", t);
495
+ }), Ne(() => {
496
+ a.readResource && !U.value ? ue() : (U.value, A.value = !0, g.value = !0, p.value = !1, M.value.increment(n.value).turnStoredIntoOriginal(), O.value = M.value.changed());
477
497
  });
478
- const de = (t, o) => {
498
+ const se = (t, o) => {
479
499
  if (o) {
480
- if (s.value = !1, typeof t < "u" && (A.value = t.httpStatus, !t.success))
481
- return M.value = !0, r("error", t.httpStatus), !1;
482
- M.value = !0;
500
+ if (p.value = !1, typeof t < "u" && (E.value = t.httpStatus, !t.success))
501
+ return P.value = !0, c("error", t.httpStatus), !1;
502
+ P.value = !0;
483
503
  }
484
504
  return !0;
485
- }, ge = (t) => {
486
- y("doAutoReloadId -> enter: ", t), typeof t < "u" && t.autoReloadId && (y("doAutoReloadId -> autoReloadId detected: ", t.autoReloadId), pe.value ? (y("doAutoReloadId -> insideModal: ", a), We(a.modalConfig.modalName, a.modalConfig.modalKey, t.autoReloadId)) : (y("doAutoReloadId -> outsideModal"), a.readData.id = t.autoReloadId, y("doAutoReloadId -> turning off create mode"), j.value = !1, ee()));
487
- }, re = (t, o) => {
488
- if (y("onCreate"), !de(o, c.value.resource)) {
489
- a.notificationType === F.Toast && J({
490
- text: p.defaultCreateErrorText,
491
- details: p.defaultCreateErrorDetails,
492
- icon: p.defaultCreateErrorIcon,
493
- positionX: z.Right
505
+ }, he = (t, o) => {
506
+ if (B("doAutoReloadId -> enter: ", t), typeof t < "u" && t.autoReloadId)
507
+ if (B("doAutoReloadId -> autoReloadId detected: ", t.autoReloadId), typeof o < "u") {
508
+ let V = o;
509
+ typeof o == "function" && (V = o(t.autoReloadId)), r.push(V);
510
+ } else me.value ? (B("doAutoReloadId -> insideModal: ", a), Ke(a.modalConfig.modalName, a.modalConfig.modalKey, t.autoReloadId)) : (B("doAutoReloadId -> outsideModal"), a.readData.id = t.autoReloadId, B("doAutoReloadId -> turning off create mode"), U.value = !1, ue());
511
+ }, pe = (t, o) => {
512
+ if (B("onCreate"), !se(o, F.value.resource)) {
513
+ a.notificationType === J.Toast && _({
514
+ text: i.defaultCreateErrorText,
515
+ details: i.defaultCreateErrorDetails,
516
+ icon: i.defaultCreateErrorIcon,
517
+ positionX: Z.Right
494
518
  });
495
519
  return;
496
520
  }
497
- O.value = !0, y("onCreate -> turn stored data into original"), k.value.increment(i.value).turnStoredIntoOriginal(), a.notificationType === F.Toast && J({
498
- text: p.defaultCreateSuccessText,
499
- details: p.defaultCreateSuccessDetails,
500
- icon: p.defaultCreateSuccessIcon,
501
- positionX: z.Right
502
- }), ge(o), y("onCreate -> beforeEmitCreate"), r("create", o);
503
- }, le = (t, o) => {
504
- if (y("onUpdate"), !de(o, I.value.resource)) {
505
- a.notificationType === F.Toast && J({
506
- text: p.defaultUpdateErrorText,
507
- details: p.defaultUpdateErrorDetails,
508
- icon: p.defaultUpdateErrorIcon,
509
- positionX: z.Right
521
+ ae.value = !0, B("onCreate -> turn stored data into original"), M.value.increment(n.value).turnStoredIntoOriginal(), a.notificationType === J.Toast && _({
522
+ text: i.defaultCreateSuccessText,
523
+ details: i.defaultCreateSuccessDetails,
524
+ icon: i.defaultCreateSuccessIcon,
525
+ positionX: Z.Right
526
+ }), he(o, a.redirectOnCreate), B("onCreate -> beforeEmitCreate"), c("create", o);
527
+ }, ve = (t, o) => {
528
+ if (B("onUpdate"), !se(o, W.value.resource)) {
529
+ a.notificationType === J.Toast && _({
530
+ text: i.defaultUpdateErrorText,
531
+ details: i.defaultUpdateErrorDetails,
532
+ icon: i.defaultUpdateErrorIcon,
533
+ positionX: Z.Right
510
534
  });
511
535
  return;
512
536
  }
513
- y("onUpdate -> turn stored data into original"), k.value.turnStoredIntoOriginal(), a.notificationType === F.Toast && J({
514
- text: p.defaultUpdateSuccessText,
515
- details: p.defaultUpdateSuccessDetails,
516
- icon: p.defaultUpdateSuccessIcon,
517
- positionX: z.Right
518
- }), ge(o), r("update", o);
519
- }, ie = (t, o) => {
520
- if (y("onDrop"), !de(o, P.value.resource)) {
521
- a.notificationType === F.Toast && J({
522
- text: p.defaultDropErrorText,
523
- details: p.defaultDropErrorDetails,
524
- icon: p.defaultDropErrorIcon,
525
- positionX: z.Right
537
+ B("onUpdate -> turn stored data into original"), M.value.turnStoredIntoOriginal(), a.notificationType === J.Toast && _({
538
+ text: i.defaultUpdateSuccessText,
539
+ details: i.defaultUpdateSuccessDetails,
540
+ icon: i.defaultUpdateSuccessIcon,
541
+ positionX: Z.Right
542
+ }), he(o), c("update", o);
543
+ }, fe = (t, o) => {
544
+ if (B("onDrop"), !se(o, K.value.resource)) {
545
+ a.notificationType === J.Toast && _({
546
+ text: i.defaultDropErrorText,
547
+ details: i.defaultDropErrorDetails,
548
+ icon: i.defaultDropErrorIcon,
549
+ positionX: Z.Right
526
550
  });
527
551
  return;
528
552
  }
529
- a.notificationType === F.Toast && J({
530
- text: p.defaultDropSuccessText,
531
- details: p.defaultDropSuccessDetails,
532
- icon: p.defaultDropSuccessIcon,
533
- positionX: z.Right
534
- }), r("drop", o), a.view === De.Modal && (y("onDrop -> close modal"), Xe(a.modalConfig.modalName, a.modalConfig.modalKey));
553
+ if (a.notificationType === J.Toast && _({
554
+ text: i.defaultDropSuccessText,
555
+ details: i.defaultDropSuccessDetails,
556
+ icon: i.defaultDropSuccessIcon,
557
+ positionX: Z.Right
558
+ }), c("drop", o), a.view === Ie.Modal && (B("onDrop -> close modal"), We(a.modalConfig.modalName, a.modalConfig.modalKey)), typeof a.redirectOnDrop < "u") {
559
+ let V = a.redirectOnDrop;
560
+ typeof a.redirectOnDrop == "function" && (V = a.redirectOnDrop()), r.push(V);
561
+ }
535
562
  };
536
- Z({
563
+ te({
537
564
  doDrop: () => {
538
- $.value && $.value.doDrop();
565
+ e.value && e.value.doDrop();
539
566
  },
540
- doRefresh: ee,
567
+ doRefresh: ue,
541
568
  doSave: () => {
542
- $.value && $.value.doSave();
569
+ e.value && e.value.doSave();
543
570
  },
544
571
  turnStoredDataIntoOriginal: () => {
545
- k.value.increment(i.value).turnStoredIntoOriginal();
572
+ M.value.increment(n.value).turnStoredIntoOriginal();
546
573
  },
547
- hasModifiedData: () => k.value.changed()
574
+ hasModifiedData: () => M.value.changed()
548
575
  });
549
- const Me = U(() => {
576
+ const we = S(() => {
550
577
  var t;
551
- return k.value.changed() ? (t = a.modalConfig) == null ? void 0 : t.closeConfirm : "";
552
- }), Ie = (t) => {
578
+ return M.value.changed() ? (t = a.modalConfig) == null ? void 0 : t.closeConfirm : "";
579
+ }), Re = (t) => {
553
580
  var o;
554
581
  if (typeof ((o = a.modalConfig) == null ? void 0 : o.beforeClose) == "function")
555
582
  return a.modalConfig.beforeClose({
556
583
  ...t,
557
- itemCreated: O.value
584
+ itemCreated: ae.value
558
585
  });
559
- }, se = U(() => a.title.startsWith("__:") ? String(Ke(a.title.substring(3))) : a.title), Te = U(() => s.value ? !1 : se.value.length > 0 || !!n["post-title"]), pe = U(() => a.view === De.Modal), ye = U(() => pe.value ? "lkt-modal" : "section"), te = U(() => {
586
+ }, ce = S(() => a.title.startsWith("__:") ? String(Ge(a.title.substring(3))) : a.title), Ae = S(() => p.value ? !1 : ce.value.length > 0 || !!l["post-title"]), me = S(() => a.view === Ie.Modal), De = S(() => me.value ? "lkt-modal" : "section"), ne = S(() => {
560
587
  var t, o;
561
- return a.mode !== S.Update || !G.value || !a.enabledSaveWithoutChanges && !w.value ? !1 : typeof ((t = I.value) == null ? void 0 : t.disabled) == "function" ? !I.value.disabled(i.value) : typeof ((o = I.value) == null ? void 0 : o.disabled) == "boolean" ? !I.value.disabled : !0;
562
- }), ae = U(() => {
588
+ return a.mode !== I.Update || !D.value || !a.enabledSaveWithoutChanges && !O.value ? !1 : typeof ((t = W.value) == null ? void 0 : t.disabled) == "function" ? !W.value.disabled({
589
+ prop: n.value
590
+ }) : typeof ((o = W.value) == null ? void 0 : o.disabled) == "boolean" ? !W.value.disabled : !0;
591
+ }), de = S(() => {
563
592
  var t, o;
564
- return a.mode !== S.Create || !a.enabledSaveWithoutChanges && !w.value ? !1 : typeof ((t = c.value) == null ? void 0 : t.disabled) == "function" ? !c.value.disabled(i.value) : typeof ((o = c.value) == null ? void 0 : o.disabled) == "boolean" ? !c.value.disabled : !0;
565
- }), ve = U(() => {
593
+ return a.mode !== I.Create || !a.enabledSaveWithoutChanges && !O.value ? !1 : typeof ((t = F.value) == null ? void 0 : t.disabled) == "function" ? !F.value.disabled({
594
+ prop: n.value
595
+ }) : typeof ((o = F.value) == null ? void 0 : o.disabled) == "boolean" ? !F.value.disabled : !0;
596
+ }), be = S(() => {
566
597
  var t, o;
567
- return e.value ? typeof ((t = P.value) == null ? void 0 : t.disabled) == "function" ? !P.value.disabled(i.value) : typeof ((o = P.value) == null ? void 0 : o.disabled) == "boolean" ? !P.value.disabled : !0 : !1;
568
- }), we = U(() => ye.value === "lkt-modal" ? {
598
+ return h.value ? typeof ((t = K.value) == null ? void 0 : t.disabled) == "function" ? !K.value.disabled({
599
+ prop: n.value
600
+ }) : typeof ((o = K.value) == null ? void 0 : o.disabled) == "boolean" ? !K.value.disabled : !0 : !1;
601
+ }), Ee = S(() => De.value === "lkt-modal" ? {
569
602
  title: a.title,
570
- item: i.value,
603
+ item: n.value,
571
604
  ...a.modalConfig,
572
- beforeClose: Ie,
573
- closeConfirm: Me.value,
605
+ beforeClose: Re,
606
+ closeConfirm: we.value,
574
607
  headerActionsButton: a.groupButton !== !1 ? {
575
- dot: ae.value || te.value
608
+ dot: de.value || ne.value
576
609
  } : !1
577
610
  } : {});
578
611
  return (t, o) => {
579
- const Be = be("lkt-http-info"), Re = be("lkt-loader");
580
- return b(), V(Le(ye.value), R(we.value, { class: "lkt-item-crud" }), oe({
612
+ const V = ke("lkt-http-info"), w = ke("lkt-loader");
613
+ return b(), j(Oe(De.value), R(Ee.value, { class: "lkt-item-crud" }), re({
581
614
  default: C(() => [
582
- Ne("article", ze, [
583
- !pe.value && Te.value ? (b(), N("header", Je, [
584
- u(n)["pre-title"] ? (b(), N("div", Qe, [
585
- v(t.$slots, "pre-title", {
586
- item: i.value,
587
- loading: s.value
615
+ Ve("article", Ye, [
616
+ !me.value && Ae.value ? (b(), N("header", Ze, [
617
+ u(l)["pre-title"] ? (b(), N("div", _e, [
618
+ s(t.$slots, "pre-title", {
619
+ item: n.value,
620
+ loading: p.value
588
621
  })
589
622
  ])) : d("", !0),
590
- se.value.length > 0 ? (b(), N("h1", Ye, Ve(se.value), 1)) : d("", !0),
591
- u(n)["post-title"] ? (b(), N("div", Ze, [
592
- v(t.$slots, "post-title", {
593
- item: i.value,
594
- loading: s.value
623
+ ce.value.length > 0 ? (b(), N("h1", xe, je(ce.value), 1)) : d("", !0),
624
+ u(l)["post-title"] ? (b(), N("div", et, [
625
+ s(t.$slots, "post-title", {
626
+ item: n.value,
627
+ loading: p.value
595
628
  })
596
629
  ])) : d("", !0)
597
630
  ])) : d("", !0),
598
- t.buttonNavPosition === u(ce).Top && (t.groupButton === !1 || !t.groupButtonAsModalActions) ? (b(), V(me, {
631
+ t.buttonNavPosition === u(ye).Top && (t.groupButton === !1 || !t.groupButtonAsModalActions) ? (b(), j(Be, {
599
632
  key: 1,
600
633
  ref_key: "buttonNav",
601
- ref: $,
602
- loading: s.value,
603
- "onUpdate:loading": o[2] || (o[2] = (g) => s.value = g),
604
- editing: l.value,
605
- "onUpdate:editing": o[3] || (o[3] = (g) => l.value = g),
606
- item: i.value,
634
+ ref: e,
635
+ loading: p.value,
636
+ "onUpdate:loading": o[2] || (o[2] = (y) => p.value = y),
637
+ editing: g.value,
638
+ "onUpdate:editing": o[3] || (o[3] = (y) => g.value = y),
639
+ item: n.value,
607
640
  mode: t.mode,
608
641
  view: t.view,
609
642
  grouped: t.groupButton !== !1,
610
643
  "button-nav-visibility": t.buttonNavVisibility,
611
- "create-button": c.value,
612
- "update-button": I.value,
613
- "drop-button": P.value,
614
- "edit-mode-button": x.value,
615
- "group-button": ne.value,
616
- "data-changed": w.value,
617
- "http-success-read": B.value,
618
- "can-update": G.value,
619
- "can-drop": e.value,
620
- "can-switch-edit-mode": h.value,
644
+ "create-button": F.value,
645
+ "update-button": W.value,
646
+ "drop-button": K.value,
647
+ "edit-mode-button": oe.value,
648
+ "group-button": ie.value,
649
+ "data-changed": O.value,
650
+ "http-success-read": A.value,
651
+ "can-update": D.value,
652
+ "can-drop": h.value,
653
+ "can-switch-edit-mode": X.value,
621
654
  "group-button-as-modal-actions": t.groupButtonAsModalActions,
622
- "able-to-create": ae.value,
623
- "able-to-update": te.value,
624
- "able-to-drop": ve.value,
625
- perms: f.value,
626
- onCreate: re,
627
- onSave: le,
628
- onDrop: ie
629
- }, oe({ _: 2 }, [
630
- u(n)["prev-buttons-ever"] ? {
655
+ "able-to-create": de.value,
656
+ "able-to-update": ne.value,
657
+ "able-to-drop": be.value,
658
+ perms: v.value,
659
+ onCreate: pe,
660
+ onSave: ve,
661
+ onDrop: fe
662
+ }, re({ _: 2 }, [
663
+ u(l)["prev-buttons-ever"] ? {
631
664
  name: "prev-buttons-ever",
632
- fn: C(({ canUpdate: g, canDrop: q, perms: H }) => [
633
- v(t.$slots, "prev-buttons-ever", {
634
- canUpdate: g,
635
- canDrop: q,
636
- perms: H
665
+ fn: C(({ canUpdate: y, canDrop: Q, perms: Y }) => [
666
+ s(t.$slots, "prev-buttons-ever", {
667
+ canUpdate: y,
668
+ canDrop: Q,
669
+ perms: Y
637
670
  })
638
671
  ]),
639
672
  key: "0"
640
673
  } : void 0,
641
- u(n)["prev-buttons"] ? {
674
+ u(l)["prev-buttons"] ? {
642
675
  name: "prev-buttons",
643
- fn: C(({ canUpdate: g, canDrop: q, perms: H }) => [
644
- v(t.$slots, "prev-buttons", {
645
- canUpdate: g,
646
- canDrop: q,
647
- perms: H
676
+ fn: C(({ canUpdate: y, canDrop: Q, perms: Y }) => [
677
+ s(t.$slots, "prev-buttons", {
678
+ canUpdate: y,
679
+ canDrop: Q,
680
+ perms: Y
648
681
  })
649
682
  ]),
650
683
  key: "1"
651
684
  } : void 0
652
685
  ]), 1032, ["loading", "editing", "item", "mode", "view", "grouped", "button-nav-visibility", "create-button", "update-button", "drop-button", "edit-mode-button", "group-button", "data-changed", "http-success-read", "can-update", "can-drop", "can-switch-edit-mode", "group-button-as-modal-actions", "able-to-create", "able-to-update", "able-to-drop", "perms"])) : d("", !0),
653
- s.value ? d("", !0) : (b(), N("div", _e, [
654
- B.value ? (b(), N("div", xe, [
655
- M.value && t.notificationType === u(F).Inline ? (b(), V(Be, {
686
+ p.value ? d("", !0) : (b(), N("div", tt, [
687
+ A.value ? (b(), N("div", at, [
688
+ P.value && t.notificationType === u(J).Inline ? (b(), j(V, {
656
689
  key: 0,
657
- code: A.value,
658
- palette: A.value === 200 ? "success" : "danger",
690
+ code: E.value,
691
+ palette: E.value === 200 ? "success" : "danger",
659
692
  quick: "",
660
693
  "can-close": "",
661
- onClose: o[4] || (o[4] = (g) => M.value = !1)
694
+ onClose: o[4] || (o[4] = (y) => P.value = !1)
662
695
  }, null, 8, ["code", "palette"])) : d("", !0),
663
- v(t.$slots, "item", {
664
- item: i.value,
665
- loading: s.value,
666
- editMode: l.value,
667
- isCreate: j.value,
668
- canUpdate: G.value,
669
- canDrop: e.value,
670
- itemBeingEdited: K.value,
671
- perms: f.value
696
+ s(t.$slots, "item", {
697
+ item: n.value,
698
+ loading: p.value,
699
+ editMode: g.value,
700
+ isCreate: U.value,
701
+ canUpdate: D.value,
702
+ canDrop: h.value,
703
+ itemBeingEdited: z.value,
704
+ perms: v.value
672
705
  })
673
- ])) : t.notificationType === u(F).Inline ? (b(), V(Be, {
706
+ ])) : t.notificationType === u(J).Inline ? (b(), j(V, {
674
707
  key: 1,
675
- code: A.value
708
+ code: E.value
676
709
  }, null, 8, ["code"])) : d("", !0)
677
710
  ])),
678
- s.value ? (b(), V(Re, { key: 3 })) : d("", !0),
679
- t.buttonNavPosition === u(ce).Bottom && (t.groupButton === !1 || !t.groupButtonAsModalActions) ? (b(), V(me, {
711
+ p.value ? (b(), j(w, { key: 3 })) : d("", !0),
712
+ t.buttonNavPosition === u(ye).Bottom && (t.groupButton === !1 || !t.groupButtonAsModalActions) ? (b(), j(Be, {
680
713
  key: 4,
681
714
  ref_key: "buttonNav",
682
- ref: $,
683
- loading: s.value,
684
- "onUpdate:loading": o[5] || (o[5] = (g) => s.value = g),
685
- editing: l.value,
686
- "onUpdate:editing": o[6] || (o[6] = (g) => l.value = g),
687
- item: i.value,
715
+ ref: e,
716
+ loading: p.value,
717
+ "onUpdate:loading": o[5] || (o[5] = (y) => p.value = y),
718
+ editing: g.value,
719
+ "onUpdate:editing": o[6] || (o[6] = (y) => g.value = y),
720
+ item: n.value,
688
721
  mode: t.mode,
689
722
  view: t.view,
690
723
  grouped: t.groupButton !== !1,
691
724
  "button-nav-visibility": t.buttonNavVisibility,
692
- "create-button": c.value,
693
- "update-button": I.value,
694
- "drop-button": P.value,
695
- "edit-mode-button": x.value,
696
- "group-button": ne.value,
697
- "data-changed": w.value,
698
- "http-success-read": B.value,
699
- "can-update": G.value,
700
- "can-drop": e.value,
701
- "can-switch-edit-mode": h.value,
725
+ "create-button": F.value,
726
+ "update-button": W.value,
727
+ "drop-button": K.value,
728
+ "edit-mode-button": oe.value,
729
+ "group-button": ie.value,
730
+ "data-changed": O.value,
731
+ "http-success-read": A.value,
732
+ "can-update": D.value,
733
+ "can-drop": h.value,
734
+ "can-switch-edit-mode": X.value,
702
735
  "group-button-as-modal-actions": t.groupButtonAsModalActions,
703
- "able-to-create": ae.value,
704
- "able-to-update": te.value,
705
- "able-to-drop": ve.value,
706
- perms: f.value,
707
- onCreate: re,
708
- onSave: le,
709
- onDrop: ie
710
- }, oe({ _: 2 }, [
711
- u(n)["prev-buttons-ever"] ? {
736
+ "able-to-create": de.value,
737
+ "able-to-update": ne.value,
738
+ "able-to-drop": be.value,
739
+ perms: v.value,
740
+ onCreate: pe,
741
+ onSave: ve,
742
+ onDrop: fe
743
+ }, re({ _: 2 }, [
744
+ u(l)["prev-buttons-ever"] ? {
712
745
  name: "prev-buttons-ever",
713
746
  fn: C(() => [
714
- v(t.$slots, "prev-buttons-ever")
747
+ s(t.$slots, "prev-buttons-ever")
715
748
  ]),
716
749
  key: "0"
717
750
  } : void 0,
718
- u(n)["prev-buttons"] ? {
751
+ u(l)["prev-buttons"] ? {
719
752
  name: "prev-buttons-ever",
720
753
  fn: C(() => [
721
- v(t.$slots, "prev-buttons")
754
+ s(t.$slots, "prev-buttons")
722
755
  ]),
723
756
  key: "1"
724
757
  } : void 0
@@ -730,56 +763,56 @@ const y = (...T) => {
730
763
  t.groupButton !== !1 && t.groupButtonAsModalActions ? {
731
764
  name: "header-actions",
732
765
  fn: C(() => [
733
- t.buttonNavPosition === u(ce).Top ? (b(), V(me, {
766
+ t.buttonNavPosition === u(ye).Top ? (b(), j(Be, {
734
767
  key: 0,
735
768
  ref_key: "buttonNav",
736
- ref: $,
737
- loading: s.value,
738
- "onUpdate:loading": o[0] || (o[0] = (g) => s.value = g),
739
- editing: l.value,
740
- "onUpdate:editing": o[1] || (o[1] = (g) => l.value = g),
741
- item: i.value,
769
+ ref: e,
770
+ loading: p.value,
771
+ "onUpdate:loading": o[0] || (o[0] = (y) => p.value = y),
772
+ editing: g.value,
773
+ "onUpdate:editing": o[1] || (o[1] = (y) => g.value = y),
774
+ item: n.value,
742
775
  mode: t.mode,
743
776
  view: t.view,
744
777
  grouped: !0,
745
778
  "button-nav-visibility": t.buttonNavVisibility,
746
- "create-button": c.value,
747
- "update-button": I.value,
748
- "drop-button": P.value,
749
- "edit-mode-button": x.value,
750
- "group-button": ne.value,
751
- "data-changed": w.value,
752
- "http-success-read": B.value,
753
- "can-update": G.value,
754
- "can-drop": e.value,
755
- "can-switch-edit-mode": h.value,
779
+ "create-button": F.value,
780
+ "update-button": W.value,
781
+ "drop-button": K.value,
782
+ "edit-mode-button": oe.value,
783
+ "group-button": ie.value,
784
+ "data-changed": O.value,
785
+ "http-success-read": A.value,
786
+ "can-update": D.value,
787
+ "can-drop": h.value,
788
+ "can-switch-edit-mode": X.value,
756
789
  "group-button-as-modal-actions": t.groupButtonAsModalActions,
757
- "able-to-create": ae.value,
758
- "able-to-update": te.value,
759
- "able-to-drop": ve.value,
760
- perms: f.value,
761
- onCreate: re,
762
- onSave: le,
763
- onDrop: ie
764
- }, oe({ _: 2 }, [
765
- u(n)["prev-buttons-ever"] ? {
790
+ "able-to-create": de.value,
791
+ "able-to-update": ne.value,
792
+ "able-to-drop": be.value,
793
+ perms: v.value,
794
+ onCreate: pe,
795
+ onSave: ve,
796
+ onDrop: fe
797
+ }, re({ _: 2 }, [
798
+ u(l)["prev-buttons-ever"] ? {
766
799
  name: "prev-buttons-ever",
767
- fn: C(({ canUpdate: g, canDrop: q, perms: H }) => [
768
- v(t.$slots, "prev-buttons-ever", {
769
- canUpdate: g,
770
- canDrop: q,
771
- perms: H
800
+ fn: C(({ canUpdate: y, canDrop: Q, perms: Y }) => [
801
+ s(t.$slots, "prev-buttons-ever", {
802
+ canUpdate: y,
803
+ canDrop: Q,
804
+ perms: Y
772
805
  })
773
806
  ]),
774
807
  key: "0"
775
808
  } : void 0,
776
- u(n)["prev-buttons"] ? {
809
+ u(l)["prev-buttons"] ? {
777
810
  name: "prev-buttons",
778
- fn: C(({ canUpdate: g, canDrop: q, perms: H }) => [
779
- v(t.$slots, "prev-buttons", {
780
- canUpdate: g,
781
- canDrop: q,
782
- perms: H
811
+ fn: C(({ canUpdate: y, canDrop: Q, perms: Y }) => [
812
+ s(t.$slots, "prev-buttons", {
813
+ canUpdate: y,
814
+ canDrop: Q,
815
+ perms: Y
783
816
  })
784
817
  ]),
785
818
  key: "1"
@@ -791,18 +824,18 @@ const y = (...T) => {
791
824
  ]), 1040);
792
825
  };
793
826
  }
794
- }), pt = {
795
- install: (T, Z = {}) => {
796
- T.component("lkt-item-crud") === void 0 && T.component("lkt-item-crud", et);
827
+ }), mt = {
828
+ install: (T, te = {}) => {
829
+ T.component("lkt-item-crud") === void 0 && T.component("lkt-item-crud", ot);
797
830
  }
798
- }, vt = (T) => {
799
- Q.defaultSaveIcon = T;
800
- }, ft = (T) => {
801
- Q.defaultDropIcon = T;
831
+ }, bt = (T) => {
832
+ x.defaultSaveIcon = T;
833
+ }, gt = (T) => {
834
+ x.defaultDropIcon = T;
802
835
  };
803
836
  export {
804
- st as debugLktItemCrud,
805
- pt as default,
806
- ft as setItemCrudDefaultDropIcon,
807
- vt as setItemCrudDefaultSaveIcon
837
+ ct as debugLktItemCrud,
838
+ mt as default,
839
+ gt as setItemCrudDefaultDropIcon,
840
+ bt as setItemCrudDefaultSaveIcon
808
841
  };