lkt-item-crud 2.0.12 → 2.0.14

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