lkt-item-crud 2.0.16 → 2.0.17

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