lkt-item-crud 2.0.17 → 2.0.18

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