lkt-item-crud 2.0.17 → 2.0.19

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