lkt-item-crud 2.0.14 → 2.0.16

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