lkt-item-crud 2.0.14 → 2.0.15

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