lkt-item-crud 2.0.15 → 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 h, 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 De, TablePermission as fe, ensureButtonConfig as K, LktSettings as p, ItemCrudView as he, ItemCrudButtonNavPosition as ce, NotificationType as G, getDefaultValues as je, ItemCrud as Pe, ToastPositionX as z } from "lkt-vue-kernel";
5
- import { closeModal as Xe, updateModalKey as Ke } from "lkt-modal";
6
- import { __ as Fe } from "lkt-i18n";
7
- import { openToast as J } from "lkt-toast";
8
- const Y = class Y {
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
+ import { __ as Ke } from "lkt-i18n";
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
- }, Ge = {
17
- key: 0,
18
- class: "lkt-item-crud-buttons"
14
+ Z.debugEnabled && console.info("[LktItemCrud] ", ...T);
15
+ }, ft = (T = !0) => {
16
+ Z.debugEnabled = T;
19
17
  }, qe = {
20
18
  key: 0,
21
19
  class: "lkt-item-crud-buttons"
22
20
  }, He = {
21
+ key: 0,
22
+ class: "lkt-item-crud-buttons"
23
+ }, ze = {
23
24
  key: 1,
24
25
  class: "lkt-item-crud-buttons"
25
- }, We = {
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
- h(() => n.loading, (e) => f.value = e), h(f, (e) => a("update:loading", e));
64
- const l = m(n.editing);
65
- h(() => n.editing, (e) => l.value = e), h(l, (e) => a("update:editing", e));
66
- const B = () => {
67
- f.value = !0;
68
- }, M = () => {
69
- f.value = !1;
70
- }, A = (e, D) => {
71
- typeof e > "u" || a("create", e, D);
72
- }, k = (e, D) => {
73
- typeof e > "u" || a("save", e, D);
74
- }, w = (e, D) => {
75
- typeof e > "u" || a("drop", e, D);
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 F = 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), q = U(() => n.buttonNavVisibility === De.Always || r["prev-buttons-ever"] ? !0 : n.buttonNavVisibility === De.Never ? !1 : O.value || F.value || $.value);
86
- return (e, D) => {
87
- const c = be("lkt-button");
88
- return q.value ? (b(), N("div", Ge, [
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": D[0] || (D[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, F.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": D[1] || (D[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, F.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", qe, [
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", He, [
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, F.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", We, [
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": D[2] || (D[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: {},
@@ -411,8 +412,11 @@ const y = (...T) => {
411
412
  readData: {},
412
413
  title: {},
413
414
  beforeEmitUpdate: { type: Function },
414
- notificationType: {}
415
- }, je(Pe)),
415
+ notificationType: {},
416
+ enabledSaveWithoutChanges: { type: Boolean },
417
+ redirectOnCreate: { type: [String, Function] },
418
+ redirectOnDrop: { type: [String, Function] }
419
+ }, Pe(Xe)),
416
420
  emits: [
417
421
  "update:modelValue",
418
422
  "update:editing",
@@ -425,383 +429,390 @@ const y = (...T) => {
425
429
  "error",
426
430
  "modified-data"
427
431
  ],
428
- setup(T, { expose: Z, emit: ue }) {
429
- 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), F = m(!1), O = m(!1), $ = m(null), q = 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)), D = U(() => !j.value && Array.isArray(f.value) && f.value.includes(fe.SwitchEditMode));
430
- h(() => a.mode, (t) => {
431
- 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;
432
436
  });
433
- const c = m(K(a.createButton, p.defaultCreateButton)), I = m(K(a.updateButton, p.defaultUpdateButton)), P = m(K(a.dropButton, p.defaultDropButton)), x = m(K(a.editModeButton, p.defaultEditModeButton)), ne = m(K(a.groupButton, p.defaultGroupButton));
434
- h(() => a.createButton, (t) => {
435
- c.value = K(t, p.defaultCreateButton);
436
- }, { deep: !0 }), h(() => a.updateButton, (t) => {
437
- I.value = K(t, p.defaultUpdateButton);
438
- }, { deep: !0 }), h(() => a.dropButton, (t) => {
439
- P.value = K(t, p.defaultDropButton);
440
- }, { deep: !0 }), h(() => a.editModeButton, (t) => {
441
- x.value = K(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);
442
446
  }, { deep: !0 });
443
- const ee = async () => {
444
- 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;
445
449
  try {
446
- const t = await Oe(a.readResource, a.readData);
447
- if (y("fetchItem -> response", t), s.value = !1, A.value = t.httpStatus, !t.success) {
448
- 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);
449
453
  return;
450
454
  }
451
- 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);
452
456
  } catch {
453
- 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);
454
458
  return;
455
459
  }
456
460
  };
457
- h(() => a.modelValue, (t) => {
458
- i.value = t, k.value.increment(t);
459
- }, { deep: !0 }), h(i, (t) => {
460
- if (F.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") {
461
465
  y("item updated -> has beforeEmitUpdate");
462
- let o = a.beforeEmitUpdate(i.value);
463
- 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);
464
468
  }
465
- r("update:modelValue", i.value), y("item updated -> update dataState"), k.value.increment(t), w.value = k.value.changed(), $e(() => F.value = !1);
466
- }, { deep: !0 }), h(f, () => r("perms", f.value)), h(w, (t) => {
467
- r("modified-data", t);
468
- }), h(() => a.readData, (t) => {
469
- _.value.increment(t), _.value.changed() && ee();
470
- }), h(() => a.editing, (t) => {
471
- y("editing updated -> updating editMode", t), l.value = t;
472
- }), h(l, (t) => {
473
- y("editMode updated -> emit update", t), r("update:editing", t);
474
- }), Ee(() => {
475
- 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());
476
480
  });
477
- const de = (t, o) => {
481
+ const le = (t, o) => {
478
482
  if (o) {
479
- if (s.value = !1, typeof t < "u" && (A.value = t.httpStatus, !t.success))
480
- return M.value = !0, r("error", t.httpStatus), !1;
481
- 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;
482
486
  }
483
487
  return !0;
484
- }, ge = (t) => {
485
- y("doAutoReloadId -> enter: ", t), typeof t < "u" && t.autoReloadId && (y("doAutoReloadId -> autoReloadId detected: ", t.autoReloadId), pe.value ? (y("doAutoReloadId -> insideModal: ", a), Ke(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()));
486
- }, re = (t, o) => {
487
- if (y("onCreate"), !de(o, c.value.resource)) {
488
- a.notificationType === G.Toast && J({
489
- text: p.defaultCreateErrorText,
490
- details: p.defaultCreateErrorDetails,
491
- icon: p.defaultCreateErrorIcon,
492
- 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
493
501
  });
494
502
  return;
495
503
  }
496
- O.value = !0, y("onCreate -> turn stored data into original"), k.value.increment(i.value).turnStoredIntoOriginal(), a.notificationType === G.Toast && J({
497
- text: p.defaultCreateSuccessText,
498
- details: p.defaultCreateSuccessDetails,
499
- icon: p.defaultCreateSuccessIcon,
500
- positionX: z.Right
501
- }), ge(o), y("onCreate -> beforeEmitCreate"), r("create", o);
502
- }, le = (t, o) => {
503
- if (y("onUpdate"), !de(o, I.value.resource)) {
504
- a.notificationType === G.Toast && J({
505
- text: p.defaultUpdateErrorText,
506
- details: p.defaultUpdateErrorDetails,
507
- icon: p.defaultUpdateErrorIcon,
508
- 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
509
517
  });
510
518
  return;
511
519
  }
512
- y("onUpdate -> turn stored data into original"), k.value.turnStoredIntoOriginal(), a.notificationType === G.Toast && J({
513
- text: p.defaultUpdateSuccessText,
514
- details: p.defaultUpdateSuccessDetails,
515
- icon: p.defaultUpdateSuccessIcon,
516
- positionX: z.Right
517
- }), ge(o), r("update", o);
518
- }, ie = (t, o) => {
519
- if (y("onDrop"), !de(o, P.value.resource)) {
520
- a.notificationType === G.Toast && J({
521
- text: p.defaultDropErrorText,
522
- details: p.defaultDropErrorDetails,
523
- icon: p.defaultDropErrorIcon,
524
- 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
525
533
  });
526
534
  return;
527
535
  }
528
- a.notificationType === G.Toast && J({
529
- text: p.defaultDropSuccessText,
530
- details: p.defaultDropSuccessDetails,
531
- icon: p.defaultDropSuccessIcon,
532
- positionX: z.Right
533
- }), r("drop", o), a.view === he.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
+ }
534
545
  };
535
- Z({
546
+ x({
536
547
  doDrop: () => {
537
- $.value && $.value.doDrop();
548
+ P.value && P.value.doDrop();
538
549
  },
539
- doRefresh: ee,
550
+ doRefresh: ae,
540
551
  doSave: () => {
541
- $.value && $.value.doSave();
552
+ P.value && P.value.doSave();
542
553
  },
543
554
  turnStoredDataIntoOriginal: () => {
544
- k.value.increment(i.value).turnStoredIntoOriginal();
555
+ k.value.increment(n.value).turnStoredIntoOriginal();
545
556
  },
546
557
  hasModifiedData: () => k.value.changed()
547
558
  });
548
- const Me = U(() => {
559
+ const Me = S(() => {
549
560
  var t;
550
561
  return k.value.changed() ? (t = a.modalConfig) == null ? void 0 : t.closeConfirm : "";
551
- }), Ie = (t) => {
562
+ }), Te = (t) => {
552
563
  var o;
553
564
  if (typeof ((o = a.modalConfig) == null ? void 0 : o.beforeClose) == "function")
554
565
  return a.modalConfig.beforeClose({
555
566
  ...t,
556
- itemCreated: O.value
567
+ itemCreated: H.value
557
568
  });
558
- }, se = U(() => a.title.startsWith("__:") ? String(Fe(a.title.substring(3))) : a.title), Te = U(() => s.value ? !1 : se.value.length > 0 || !!n["post-title"]), pe = U(() => a.view === he.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(() => {
559
570
  var t, o;
560
- return a.mode !== S.Update || !q.value || !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;
561
- }), 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(() => {
562
573
  var t, o;
563
- return a.mode !== S.Create || !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;
564
- }), 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(() => {
565
576
  var t, o;
566
- 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;
567
- }), 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" ? {
568
579
  title: a.title,
569
- item: i.value,
580
+ item: n.value,
570
581
  ...a.modalConfig,
571
- beforeClose: Ie,
582
+ beforeClose: Te,
572
583
  closeConfirm: Me.value,
573
584
  headerActionsButton: a.groupButton !== !1 ? {
574
- dot: ae.value || te.value
585
+ dot: ue.value || oe.value
575
586
  } : !1
576
587
  } : {});
577
588
  return (t, o) => {
578
- const Be = be("lkt-http-info"), Re = be("lkt-loader");
579
- return b(), V(Le(ye.value), R(we.value, { class: "lkt-item-crud" }), oe({
580
- default: C(() => [
581
- Ne("article", ze, [
582
- !pe.value && Te.value ? (b(), N("header", Je, [
583
- u(n)["pre-title"] ? (b(), N("div", Qe, [
584
- v(t.$slots, "pre-title", {
585
- item: i.value,
586
- 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
587
598
  })
588
- ])) : d("", !0),
589
- se.value.length > 0 ? (b(), N("h1", Ye, Ve(se.value), 1)) : d("", !0),
590
- u(n)["post-title"] ? (b(), N("div", Ze, [
591
- v(t.$slots, "post-title", {
592
- item: i.value,
593
- 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
594
605
  })
595
- ])) : d("", !0)
596
- ])) : d("", !0),
597
- 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, {
598
609
  key: 1,
599
610
  ref_key: "buttonNav",
600
- ref: $,
601
- loading: s.value,
602
- "onUpdate:loading": o[2] || (o[2] = (g) => s.value = g),
603
- editing: l.value,
604
- "onUpdate:editing": o[3] || (o[3] = (g) => l.value = g),
605
- 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,
606
617
  mode: t.mode,
607
618
  view: t.view,
608
619
  grouped: t.groupButton !== !1,
609
620
  "button-nav-visibility": t.buttonNavVisibility,
610
- "create-button": c.value,
611
- "update-button": I.value,
612
- "drop-button": P.value,
613
- "edit-mode-button": x.value,
614
- "group-button": ne.value,
615
- "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,
616
627
  "http-success-read": B.value,
617
- "can-update": q.value,
618
- "can-drop": e.value,
619
- "can-switch-edit-mode": D.value,
628
+ "can-update": e.value,
629
+ "can-drop": C.value,
630
+ "can-switch-edit-mode": h.value,
620
631
  "group-button-as-modal-actions": t.groupButtonAsModalActions,
621
- "able-to-create": ae.value,
622
- "able-to-update": te.value,
623
- "able-to-drop": ve.value,
624
- perms: f.value,
625
- onCreate: re,
626
- onSave: le,
627
- onDrop: ie
628
- }, oe({ _: 2 }, [
629
- 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"] ? {
630
641
  name: "prev-buttons-ever",
631
- fn: C(({ canUpdate: g, canDrop: H, perms: W }) => [
632
- v(t.$slots, "prev-buttons-ever", {
642
+ fn: D(({ canUpdate: g, canDrop: z, perms: J }) => [
643
+ p(t.$slots, "prev-buttons-ever", {
633
644
  canUpdate: g,
634
- canDrop: H,
635
- perms: W
645
+ canDrop: z,
646
+ perms: J
636
647
  })
637
648
  ]),
638
649
  key: "0"
639
650
  } : void 0,
640
- u(n)["prev-buttons"] ? {
651
+ u(i)["prev-buttons"] ? {
641
652
  name: "prev-buttons",
642
- fn: C(({ canUpdate: g, canDrop: H, perms: W }) => [
643
- v(t.$slots, "prev-buttons", {
653
+ fn: D(({ canUpdate: g, canDrop: z, perms: J }) => [
654
+ p(t.$slots, "prev-buttons", {
644
655
  canUpdate: g,
645
- canDrop: H,
646
- perms: W
656
+ canDrop: z,
657
+ perms: J
647
658
  })
648
659
  ]),
649
660
  key: "1"
650
661
  } : void 0
651
- ]), 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),
652
- s.value ? d("", !0) : (b(), N("div", _e, [
653
- B.value ? (b(), N("div", xe, [
654
- M.value && t.notificationType === u(G).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, {
655
666
  key: 0,
656
667
  code: A.value,
657
668
  palette: A.value === 200 ? "success" : "danger",
658
669
  quick: "",
659
670
  "can-close": "",
660
- onClose: o[4] || (o[4] = (g) => M.value = !1)
661
- }, null, 8, ["code", "palette"])) : d("", !0),
662
- v(t.$slots, "item", {
663
- item: i.value,
664
- loading: s.value,
665
- editMode: l.value,
666
- isCreate: j.value,
667
- canUpdate: q.value,
668
- canDrop: e.value,
669
- itemBeingEdited: F.value,
670
- 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
671
682
  })
672
- ])) : t.notificationType === u(G).Inline ? (b(), V(Be, {
683
+ ])) : t.notificationType === u(q).Inline ? (c(), V(G, {
673
684
  key: 1,
674
685
  code: A.value
675
- }, null, 8, ["code"])) : d("", !0)
686
+ }, null, 8, ["code"])) : r("", !0)
676
687
  ])),
677
- s.value ? (b(), V(Re, { key: 3 })) : d("", !0),
678
- 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, {
679
690
  key: 4,
680
691
  ref_key: "buttonNav",
681
- ref: $,
682
- loading: s.value,
683
- "onUpdate:loading": o[5] || (o[5] = (g) => s.value = g),
684
- editing: l.value,
685
- "onUpdate:editing": o[6] || (o[6] = (g) => l.value = g),
686
- 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,
687
698
  mode: t.mode,
688
699
  view: t.view,
689
700
  grouped: t.groupButton !== !1,
690
701
  "button-nav-visibility": t.buttonNavVisibility,
691
- "create-button": c.value,
692
- "update-button": I.value,
693
- "drop-button": P.value,
694
- "edit-mode-button": x.value,
695
- "group-button": ne.value,
696
- "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,
697
708
  "http-success-read": B.value,
698
- "can-update": q.value,
699
- "can-drop": e.value,
700
- "can-switch-edit-mode": D.value,
709
+ "can-update": e.value,
710
+ "can-drop": C.value,
711
+ "can-switch-edit-mode": h.value,
701
712
  "group-button-as-modal-actions": t.groupButtonAsModalActions,
702
- "able-to-create": ae.value,
703
- "able-to-update": te.value,
704
- "able-to-drop": ve.value,
705
- perms: f.value,
706
- onCreate: re,
707
- onSave: le,
708
- onDrop: ie
709
- }, oe({ _: 2 }, [
710
- 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"] ? {
711
722
  name: "prev-buttons-ever",
712
- fn: C(() => [
713
- v(t.$slots, "prev-buttons-ever")
723
+ fn: D(() => [
724
+ p(t.$slots, "prev-buttons-ever")
714
725
  ]),
715
726
  key: "0"
716
727
  } : void 0,
717
- u(n)["prev-buttons"] ? {
728
+ u(i)["prev-buttons"] ? {
718
729
  name: "prev-buttons-ever",
719
- fn: C(() => [
720
- v(t.$slots, "prev-buttons")
730
+ fn: D(() => [
731
+ p(t.$slots, "prev-buttons")
721
732
  ]),
722
733
  key: "1"
723
734
  } : void 0
724
- ]), 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)
725
736
  ])
726
737
  ]),
727
738
  _: 2
728
739
  }, [
729
740
  t.groupButton !== !1 && t.groupButtonAsModalActions ? {
730
741
  name: "header-actions",
731
- fn: C(() => [
732
- t.buttonNavPosition === u(ce).Top ? (b(), V(me, {
742
+ fn: D(() => [
743
+ t.buttonNavPosition === u(be).Top ? (c(), V(ge, {
733
744
  key: 0,
734
745
  ref_key: "buttonNav",
735
- ref: $,
736
- loading: s.value,
737
- "onUpdate:loading": o[0] || (o[0] = (g) => s.value = g),
738
- editing: l.value,
739
- "onUpdate:editing": o[1] || (o[1] = (g) => l.value = g),
740
- 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,
741
752
  mode: t.mode,
742
753
  view: t.view,
743
754
  grouped: !0,
744
755
  "button-nav-visibility": t.buttonNavVisibility,
745
- "create-button": c.value,
746
- "update-button": I.value,
747
- "drop-button": P.value,
748
- "edit-mode-button": x.value,
749
- "group-button": ne.value,
750
- "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,
751
762
  "http-success-read": B.value,
752
- "can-update": q.value,
753
- "can-drop": e.value,
754
- "can-switch-edit-mode": D.value,
763
+ "can-update": e.value,
764
+ "can-drop": C.value,
765
+ "can-switch-edit-mode": h.value,
755
766
  "group-button-as-modal-actions": t.groupButtonAsModalActions,
756
- "able-to-create": ae.value,
757
- "able-to-update": te.value,
758
- "able-to-drop": ve.value,
759
- perms: f.value,
760
- onCreate: re,
761
- onSave: le,
762
- onDrop: ie
763
- }, oe({ _: 2 }, [
764
- 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"] ? {
765
776
  name: "prev-buttons-ever",
766
- fn: C(({ canUpdate: g, canDrop: H, perms: W }) => [
767
- v(t.$slots, "prev-buttons-ever", {
777
+ fn: D(({ canUpdate: g, canDrop: z, perms: J }) => [
778
+ p(t.$slots, "prev-buttons-ever", {
768
779
  canUpdate: g,
769
- canDrop: H,
770
- perms: W
780
+ canDrop: z,
781
+ perms: J
771
782
  })
772
783
  ]),
773
784
  key: "0"
774
785
  } : void 0,
775
- u(n)["prev-buttons"] ? {
786
+ u(i)["prev-buttons"] ? {
776
787
  name: "prev-buttons",
777
- fn: C(({ canUpdate: g, canDrop: H, perms: W }) => [
778
- v(t.$slots, "prev-buttons", {
788
+ fn: D(({ canUpdate: g, canDrop: z, perms: J }) => [
789
+ p(t.$slots, "prev-buttons", {
779
790
  canUpdate: g,
780
- canDrop: H,
781
- perms: W
791
+ canDrop: z,
792
+ perms: J
782
793
  })
783
794
  ]),
784
795
  key: "1"
785
796
  } : void 0
786
- ]), 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)
787
798
  ]),
788
799
  key: "0"
789
800
  } : void 0
790
801
  ]), 1040);
791
802
  };
792
803
  }
793
- }), pt = {
794
- install: (T, Z = {}) => {
795
- 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);
796
807
  }
797
- }, vt = (T) => {
798
- Q.defaultSaveIcon = T;
799
- }, ft = (T) => {
800
- Q.defaultDropIcon = T;
808
+ }, mt = (T) => {
809
+ Z.defaultSaveIcon = T;
810
+ }, bt = (T) => {
811
+ Z.defaultDropIcon = T;
801
812
  };
802
813
  export {
803
- st as debugLktItemCrud,
804
- pt as default,
805
- ft as setItemCrudDefaultDropIcon,
806
- vt as setItemCrudDefaultSaveIcon
814
+ ft as debugLktItemCrud,
815
+ ct as default,
816
+ bt as setItemCrudDefaultDropIcon,
817
+ mt as setItemCrudDefaultSaveIcon
807
818
  };