lkt-item-crud 2.0.6 → 2.0.7

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.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- declare function xe(B?: boolean): void;
2
- declare namespace et {
3
- function install(B: any, G?: {}): void;
1
+ declare function tt(B?: boolean): void;
2
+ declare namespace at {
3
+ function install(B: any, J?: {}): void;
4
4
  }
5
- declare function at(B: any): void;
6
- declare function tt(B: any): void;
7
- export { xe as debugLktItemCrud, et as default, at as setItemCrudDefaultDropIcon, tt as setItemCrudDefaultSaveIcon };
5
+ declare function ut(B: any): void;
6
+ declare function ot(B: any): void;
7
+ export { tt as debugLktItemCrud, at as default, ut as setItemCrudDefaultDropIcon, ot as setItemCrudDefaultSaveIcon };
package/dist/build.js CHANGED
@@ -1,31 +1,31 @@
1
- import { defineComponent as me, ref as l, watch as h, useSlots as be, computed as y, resolveComponent as ie, createElementBlock as w, createCommentVNode as v, openBlock as s, withDirectives as Z, createBlock as T, unref as c, renderSlot as k, vShow as x, mergeProps as ee, withCtx as $, mergeDefaults as Ce, nextTick as ke, onMounted as De, resolveDynamicComponent as Se, normalizeProps as Ie, guardReactiveProps as Ue, createElementVNode as we, toDisplayString as Te, createSlots as se } from "vue";
2
- import { httpCall as Me } from "lkt-http-client";
3
- import { DataState as ve } from "lkt-data-state";
4
- import { ensureButtonConfig as E, LktSettings as n, ItemCrudMode as U, ItemCrudButtonNavVisibility as ne, TablePermission as de, ItemCrudView as pe, ItemCrudButtonNavPosition as ce, NotificationType as N, getDefaultValues as Re, ItemCrud as Ee, ToastPositionX as X } from "lkt-vue-kernel";
5
- import { closeModal as Ne } from "lkt-modal";
6
- import { __ as $e } from "lkt-i18n";
7
- import { openToast as _ } from "lkt-toast";
8
- const W = class W {
1
+ import { defineComponent as ge, ref as l, watch as h, useSlots as ye, computed as y, resolveComponent as le, createElementBlock as T, createCommentVNode as p, openBlock as s, withDirectives as _, createBlock as M, unref as c, renderSlot as D, vShow as x, mergeProps as ee, withCtx as $, mergeDefaults as De, nextTick as Se, onMounted as Ue, resolveDynamicComponent as Ie, normalizeProps as we, guardReactiveProps as Te, createElementVNode as Me, toDisplayString as Re, createSlots as ve } from "vue";
2
+ import { httpCall as Ee } from "lkt-http-client";
3
+ import { DataState as ce } from "lkt-data-state";
4
+ import { ensureButtonConfig as E, LktSettings as n, ItemCrudMode as w, ItemCrudButtonNavVisibility as re, TablePermission as ie, ItemCrudView as fe, ItemCrudButtonNavPosition as me, NotificationType as N, getDefaultValues as Ne, ItemCrud as $e, ToastPositionX as q } from "lkt-vue-kernel";
5
+ import { closeModal as Ve } from "lkt-modal";
6
+ import { __ as Le } from "lkt-i18n";
7
+ import { openToast as z } from "lkt-toast";
8
+ const G = class G {
9
9
  };
10
- W.debugEnabled = !1, W.defaultSaveIcon = "", W.defaultDropIcon = "";
11
- let q = W;
10
+ G.debugEnabled = !1, G.defaultSaveIcon = "", G.defaultDropIcon = "";
11
+ let F = G;
12
12
  const g = (...B) => {
13
- q.debugEnabled && console.info("[LktItemCrud] ", ...B);
14
- }, xe = (B = !0) => {
15
- q.debugEnabled = B;
16
- }, Ve = {
13
+ F.debugEnabled && console.info("[LktItemCrud] ", ...B);
14
+ }, tt = (B = !0) => {
15
+ F.debugEnabled = B;
16
+ }, Oe = {
17
17
  key: 0,
18
18
  class: "lkt-item-crud-buttons"
19
- }, Le = {
19
+ }, Ae = {
20
20
  key: 0,
21
21
  class: "lkt-item-crud-buttons"
22
- }, Oe = {
22
+ }, je = {
23
23
  key: 1,
24
24
  class: "lkt-item-crud-buttons"
25
- }, Ae = {
25
+ }, Pe = {
26
26
  key: 5,
27
27
  class: "lkt-item-crud-buttons"
28
- }, fe = /* @__PURE__ */ me({
28
+ }, be = /* @__PURE__ */ ge({
29
29
  __name: "ButtonNav",
30
30
  props: {
31
31
  item: { default: () => ({}) },
@@ -41,6 +41,7 @@ const g = (...B) => {
41
41
  canUpdate: { type: Boolean },
42
42
  canDrop: { type: Boolean },
43
43
  canSwitchEditMode: { type: Boolean },
44
+ perms: {},
44
45
  httpSuccessRead: { type: Boolean },
45
46
  buttonNavVisibility: {}
46
47
  },
@@ -51,164 +52,172 @@ const g = (...B) => {
51
52
  "save",
52
53
  "drop"
53
54
  ],
54
- setup(B, { expose: G, emit: te }) {
55
- const o = te, a = B, f = l(E(a.createButton, n.defaultCreateButton)), i = l(E(a.updateButton, n.defaultUpdateButton)), d = l(E(a.dropButton, n.defaultDropButton)), D = l(E(a.editModeButton, n.defaultEditModeButton));
55
+ setup(B, { expose: J, emit: te }) {
56
+ const o = te, a = B, f = l(E(a.createButton, n.defaultCreateButton)), r = l(E(a.updateButton, n.defaultUpdateButton)), d = l(E(a.dropButton, n.defaultDropButton)), C = l(E(a.editModeButton, n.defaultEditModeButton));
56
57
  h(() => a.createButton, (t) => {
57
58
  f.value = E(t, n.defaultCreateButton);
58
59
  }, { deep: !0 }), h(() => a.updateButton, (t) => {
59
- i.value = E(t, n.defaultUpdateButton);
60
+ r.value = E(t, n.defaultUpdateButton);
60
61
  }, { deep: !0 }), h(() => a.dropButton, (t) => {
61
62
  d.value = E(t, n.defaultDropButton);
62
63
  }, { deep: !0 }), h(() => a.editModeButton, (t) => {
63
- D.value = E(t, n.defaultEditModeButton);
64
+ C.value = E(t, n.defaultEditModeButton);
64
65
  }, { deep: !0 });
65
- const b = be(), C = l(null), I = l(null), p = l(a.loading);
66
- h(() => a.loading, (t) => p.value = t), h(p, (t) => o("update:loading", t));
67
- const r = l(a.editing);
68
- h(() => a.editing, (t) => r.value = t), h(r, (t) => o("update:editing", t));
69
- const S = () => {
70
- p.value = !0;
66
+ const b = ye(), k = l(null), I = l(null), v = l(a.loading);
67
+ h(() => a.loading, (t) => v.value = t), h(v, (t) => o("update:loading", t));
68
+ const i = l(a.editing);
69
+ h(() => a.editing, (t) => i.value = t), h(i, (t) => o("update:editing", t));
70
+ const U = () => {
71
+ v.value = !0;
71
72
  }, V = () => {
72
- p.value = !1;
73
- }, M = (t, m) => {
73
+ v.value = !1;
74
+ }, R = (t, m) => {
74
75
  typeof t > "u" || o("create", t, m);
75
- }, z = (t, m) => {
76
+ }, H = (t, m) => {
76
77
  typeof t > "u" || o("save", t, m);
77
- }, J = (t, m) => {
78
+ }, Q = (t, m) => {
78
79
  typeof t > "u" || o("drop", t, m);
79
80
  };
80
- G({
81
+ J({
81
82
  doSave: () => {
82
- C.value && typeof C.value.click == "function" && C.value.click();
83
+ k.value && typeof k.value.click == "function" && k.value.click();
83
84
  },
84
85
  doDrop: () => {
85
86
  I.value && typeof I.value.click == "function" && I.value.click();
86
87
  }
87
88
  });
88
- const A = y(() => {
89
+ const O = y(() => {
89
90
  var t, m;
90
- return a.mode !== U.Create && !a.canUpdate || !a.dataChanged ? !1 : typeof ((t = i.value) == null ? void 0 : t.disabled) == "function" ? !i.value.disabled(a.item) : typeof ((m = i.value) == null ? void 0 : m.disabled) == "boolean" ? !i.value.disabled : !0;
91
- }), F = y(() => {
91
+ return a.mode !== w.Update || !a.canUpdate || !a.dataChanged ? !1 : typeof ((t = r.value) == null ? void 0 : t.disabled) == "function" ? !r.value.disabled(a.item) : typeof ((m = r.value) == null ? void 0 : m.disabled) == "boolean" ? !r.value.disabled : !0;
92
+ }), j = y(() => {
92
93
  var t, m;
93
- return a.mode !== U.Create || !a.dataChanged ? !1 : typeof ((t = f.value) == null ? void 0 : t.disabled) == "function" ? !f.value.disabled(a.item) : typeof ((m = f.value) == null ? void 0 : m.disabled) == "boolean" ? !f.value.disabled : !0;
94
- }), O = y(() => {
94
+ return a.mode !== w.Create || !a.dataChanged ? !1 : typeof ((t = f.value) == null ? void 0 : t.disabled) == "function" ? !f.value.disabled(a.item) : typeof ((m = f.value) == null ? void 0 : m.disabled) == "boolean" ? !f.value.disabled : !0;
95
+ }), A = y(() => {
95
96
  var t, m;
96
97
  return a.canDrop ? typeof ((t = d.value) == null ? void 0 : t.disabled) == "function" ? !d.value.disabled(a.item) : typeof ((m = d.value) == null ? void 0 : m.disabled) == "boolean" ? !d.value.disabled : !0 : !1;
97
- }), j = y(() => !a.canDrop || a.dropButton === !1 ? !1 : !a.canUpdate && a.canDrop ? !0 : !p.value && a.editing && a.httpSuccessRead), P = y(() => a.mode === U.Create && a.createButton === !1 || a.mode === U.Update && a.updateButton === !1 ? !1 : a.dataChanged ? !0 : p.value ? !1 : a.mode === U.Create ? !0 : a.buttonNavVisibility === ne.Never ? !1 : a.editing && a.httpSuccessRead), H = y(() => a.editModeButton === !1 || !a.canSwitchEditMode || !a.canUpdate && !a.canDrop || !a.canUpdate && a.canDrop ? !1 : !p.value && a.mode !== U.Create && a.httpSuccessRead), Y = y(() => a.buttonNavVisibility === ne.Always && (A.value || F.value || O.value) || b["prev-buttons-ever"] ? !0 : a.buttonNavVisibility === ne.Never ? !1 : P.value || j.value || H.value);
98
+ }), P = y(() => !a.canDrop || a.dropButton === !1 ? !1 : !a.canUpdate && a.canDrop ? !0 : !v.value && a.editing && a.httpSuccessRead), X = y(() => a.mode === w.Create && a.createButton === !1 || a.mode === w.Update && a.updateButton === !1 ? !1 : a.dataChanged ? O.value || j.value : v.value ? !1 : a.mode === w.Create ? !0 : a.buttonNavVisibility === re.Never ? !1 : a.editing && a.httpSuccessRead), K = y(() => a.editModeButton === !1 || !a.canSwitchEditMode || !a.canUpdate && !a.canDrop || !a.canUpdate && a.canDrop ? !1 : !v.value && a.mode !== w.Create && a.httpSuccessRead), Z = y(() => a.buttonNavVisibility === re.Always && (O.value || j.value || A.value) || b["prev-buttons-ever"] ? !0 : a.buttonNavVisibility === re.Never ? !1 : X.value || P.value || K.value);
98
99
  return (t, m) => {
99
- const K = ie("lkt-button");
100
- return Y.value ? (s(), w("div", Ve, [
101
- c(b)["prev-buttons-ever"] ? Z((s(), w("div", Le, [
102
- k(t.$slots, "prev-buttons-ever")
100
+ const W = le("lkt-button");
101
+ return Z.value ? (s(), T("div", Oe, [
102
+ c(b)["prev-buttons-ever"] ? _((s(), T("div", Ae, [
103
+ D(t.$slots, "prev-buttons-ever", {
104
+ canUpdate: t.canUpdate,
105
+ canDrop: t.canDrop,
106
+ perms: t.perms
107
+ })
103
108
  ], 512)), [
104
- [x, !p.value]
105
- ]) : v("", !0),
106
- c(b)["prev-buttons"] ? Z((s(), w("div", Oe, [
107
- k(t.$slots, "prev-buttons")
109
+ [x, !v.value]
110
+ ]) : p("", !0),
111
+ c(b)["prev-buttons"] ? _((s(), T("div", je, [
112
+ D(t.$slots, "prev-buttons", {
113
+ canUpdate: t.canUpdate,
114
+ canDrop: t.canDrop,
115
+ perms: t.perms
116
+ })
108
117
  ], 512)), [
109
- [x, r.value && !p.value]
110
- ]) : v("", !0),
111
- t.mode === c(U).Update && P.value ? (s(), T(K, ee({
118
+ [x, i.value && !v.value]
119
+ ]) : p("", !0),
120
+ t.mode === c(w).Update && X.value ? (s(), M(W, ee({
112
121
  key: 2,
113
122
  ref_key: "saveButtonRef",
114
- ref: C
115
- }, i.value, {
116
- disabled: !A.value,
117
- onLoading: S,
123
+ ref: k
124
+ }, r.value, {
125
+ disabled: !O.value,
126
+ onLoading: U,
118
127
  onLoaded: V,
119
- onClick: z
128
+ onClick: H
120
129
  }), {
121
130
  default: $(() => [
122
- c(b)["button-save"] ? k(t.$slots, "button-save", {
131
+ c(b)["button-save"] ? D(t.$slots, "button-save", {
123
132
  key: 0,
124
133
  item: t.item,
125
- editMode: r.value,
134
+ editMode: i.value,
126
135
  isCreate: !1,
127
136
  canUpdate: t.canUpdate,
128
137
  canDrop: t.canDrop
129
- }) : v("", !0)
138
+ }) : p("", !0)
130
139
  ]),
131
140
  _: 3
132
- }, 16, ["disabled"])) : t.mode === c(U).Create && P.value ? (s(), T(K, ee({
141
+ }, 16, ["disabled"])) : t.mode === c(w).Create && X.value ? (s(), M(W, ee({
133
142
  key: 3,
134
143
  ref_key: "saveButtonRef",
135
- ref: C
144
+ ref: k
136
145
  }, f.value, {
137
- disabled: !F.value,
138
- onLoading: S,
146
+ disabled: !j.value,
147
+ onLoading: U,
139
148
  onLoaded: V,
140
- onClick: M
149
+ onClick: R
141
150
  }), {
142
151
  default: $(() => [
143
- c(b)["button-save"] ? k(t.$slots, "button-save", {
152
+ c(b)["button-save"] ? D(t.$slots, "button-save", {
144
153
  key: 0,
145
154
  item: t.item,
146
- editMode: r.value,
155
+ editMode: i.value,
147
156
  isCreate: !0,
148
157
  canUpdate: t.canUpdate,
149
158
  canDrop: t.canDrop
150
- }) : v("", !0)
159
+ }) : p("", !0)
151
160
  ]),
152
161
  _: 3
153
- }, 16, ["disabled"])) : v("", !0),
154
- t.mode !== c(U).Create ? Z((s(), T(K, ee({
162
+ }, 16, ["disabled"])) : p("", !0),
163
+ t.mode !== c(w).Create ? _((s(), M(W, ee({
155
164
  key: 4,
156
165
  ref_key: "dropButtonRef",
157
166
  ref: I
158
167
  }, d.value, {
159
- disabled: !O.value,
160
- onLoading: S,
168
+ disabled: !A.value,
169
+ onLoading: U,
161
170
  onLoaded: V,
162
- onClick: J
171
+ onClick: Q
163
172
  }), {
164
173
  default: $(() => [
165
- c(b)["button-drop"] ? k(t.$slots, "button-drop", {
174
+ c(b)["button-drop"] ? D(t.$slots, "button-drop", {
166
175
  key: 0,
167
176
  item: t.item,
168
- editMode: r.value,
177
+ editMode: i.value,
169
178
  isCreate: !1,
170
179
  canUpdate: t.canUpdate,
171
180
  canDrop: t.canDrop
172
- }) : v("", !0)
181
+ }) : p("", !0)
173
182
  ]),
174
183
  _: 3
175
184
  }, 16, ["disabled"])), [
176
- [x, j.value]
177
- ]) : v("", !0),
178
- c(b).buttons ? Z((s(), w("div", Ae, [
179
- k(t.$slots, "buttons")
185
+ [x, P.value]
186
+ ]) : p("", !0),
187
+ c(b).buttons ? _((s(), T("div", Pe, [
188
+ D(t.$slots, "buttons")
180
189
  ], 512)), [
181
- [x, r.value && !p.value]
182
- ]) : v("", !0),
183
- H.value ? (s(), T(K, ee({ key: 6 }, D.value, {
184
- checked: r.value,
185
- "onUpdate:checked": m[0] || (m[0] = (ae) => r.value = ae),
190
+ [x, i.value && !v.value]
191
+ ]) : p("", !0),
192
+ K.value ? (s(), M(W, ee({ key: 6 }, C.value, {
193
+ checked: i.value,
194
+ "onUpdate:checked": m[0] || (m[0] = (ae) => i.value = ae),
186
195
  class: "lkt-item-crud--switch-mode-button"
187
- }), null, 16, ["checked"])) : v("", !0)
188
- ])) : v("", !0);
196
+ }), null, 16, ["checked"])) : p("", !0)
197
+ ])) : p("", !0);
189
198
  };
190
199
  }
191
- }), je = { class: "lkt-item-crud" }, Pe = {
200
+ }), Xe = { class: "lkt-item-crud" }, qe = {
192
201
  key: 0,
193
202
  class: "lkt-item-crud_header"
194
- }, Xe = {
203
+ }, ze = {
195
204
  key: 0,
196
205
  class: "lkt-item-crud_header-slot"
197
- }, _e = {
206
+ }, Fe = {
198
207
  key: 1,
199
208
  class: "lkt-item-crud_header-title"
200
- }, qe = {
209
+ }, He = {
201
210
  key: 2,
202
211
  class: "lkt-item-crud_header-slot"
203
- }, ze = {
212
+ }, Ke = {
204
213
  key: 2,
205
214
  class: "lkt-item-crud_content"
206
- }, Fe = {
215
+ }, We = {
207
216
  key: 0,
208
217
  class: "lkt-grid-1"
209
- }, He = /* @__PURE__ */ me({
218
+ }, Ge = /* @__PURE__ */ ge({
210
219
  __name: "LktItemCrud",
211
- props: /* @__PURE__ */ Ce({
220
+ props: /* @__PURE__ */ De({
212
221
  modelValue: {},
213
222
  editing: { type: Boolean },
214
223
  perms: {},
@@ -228,7 +237,7 @@ const g = (...B) => {
228
237
  title: {},
229
238
  beforeEmitUpdate: { type: Function },
230
239
  notificationType: {}
231
- }, Re(Ee)),
240
+ }, Ne($e)),
232
241
  emits: [
233
242
  "update:modelValue",
234
243
  "update:editing",
@@ -241,154 +250,154 @@ const g = (...B) => {
241
250
  "error",
242
251
  "modified-data"
243
252
  ],
244
- setup(B, { expose: G, emit: te }) {
245
- const o = B, a = be(), f = te, i = l(!0), d = l(o.modelValue), D = l(o.perms), b = l(o.editing), C = l(!1), I = l(!1), p = l(200), r = l(new ve(d.value, o.dataStateConfig)), S = l(!1), V = l(new ve(o.readData)), M = l(o.mode === U.Create), z = l(!1), J = l(!1), L = l(null), Q = y(() => !M.value && Array.isArray(D.value) && D.value.includes(de.Update)), A = y(() => !M.value && Array.isArray(D.value) && D.value.includes(de.Drop)), F = y(() => !M.value && Array.isArray(D.value) && D.value.includes(de.SwitchEditMode)), O = async () => {
246
- g("fetchItem"), i.value = !0, p.value = -1, I.value = !1;
253
+ setup(B, { expose: J, emit: te }) {
254
+ const o = B, a = ye(), f = te, r = l(!0), d = l(o.modelValue), C = l(o.perms), b = l(o.editing), k = l(!1), I = l(!1), v = l(200), i = l(new ce(d.value, o.dataStateConfig)), U = l(!1), V = l(new ce(o.readData)), R = l(o.mode === w.Create), H = l(!1), Q = l(!1), L = l(null), Y = y(() => !R.value && Array.isArray(C.value) && C.value.includes(ie.Update)), O = y(() => !R.value && Array.isArray(C.value) && C.value.includes(ie.Drop)), j = y(() => !R.value && Array.isArray(C.value) && C.value.includes(ie.SwitchEditMode)), A = async () => {
255
+ g("fetchItem"), r.value = !0, v.value = -1, I.value = !1;
247
256
  try {
248
- const e = await Me(o.readResource, o.readData);
249
- if (g("fetchItem -> response", e), i.value = !1, p.value = e.httpStatus, !e.success) {
250
- C.value = !1, p.value = e.httpStatus, f("error", e.httpStatus);
257
+ const e = await Ee(o.readResource, o.readData);
258
+ if (g("fetchItem -> response", e), r.value = !1, v.value = e.httpStatus, !e.success) {
259
+ k.value = !1, v.value = e.httpStatus, f("error", e.httpStatus);
251
260
  return;
252
261
  }
253
- C.value = !0, d.value = e.data, D.value = e.perms, r.value.increment(d.value).turnStoredIntoOriginal(), S.value = r.value.changed(), V.value.turnStoredIntoOriginal(), f("read", e);
262
+ k.value = !0, d.value = e.data, C.value = e.perms, i.value.increment(d.value).turnStoredIntoOriginal(), U.value = i.value.changed(), V.value.turnStoredIntoOriginal(), f("read", e);
254
263
  } catch {
255
- i.value = !1, C.value = !1, p.value = 404, f("error", 404);
264
+ r.value = !1, k.value = !1, v.value = 404, f("error", 404);
256
265
  return;
257
266
  }
258
267
  };
259
268
  h(() => o.modelValue, (e) => {
260
- d.value = e, r.value.increment(e);
269
+ d.value = e, i.value.increment(e);
261
270
  }, { deep: !0 }), h(d, (e) => {
262
- if (z.value = !0, g("item updated ->", d.value), typeof o.beforeEmitUpdate == "function") {
271
+ if (H.value = !0, g("item updated ->", d.value), typeof o.beforeEmitUpdate == "function") {
263
272
  g("item updated -> has beforeEmitUpdate");
264
273
  let u = o.beforeEmitUpdate(d.value);
265
274
  g("item updated -> override with: ", u), typeof u == "object" && (d.value = u);
266
275
  }
267
- f("update:modelValue", d.value), g("item updated -> update dataState"), r.value.increment(e), S.value = r.value.changed(), ke(() => z.value = !1);
268
- }, { deep: !0 }), h(D, () => f("perms", D.value)), h(S, (e) => {
276
+ f("update:modelValue", d.value), g("item updated -> update dataState"), i.value.increment(e), U.value = i.value.changed(), Se(() => H.value = !1);
277
+ }, { deep: !0 }), h(C, () => f("perms", C.value)), h(U, (e) => {
269
278
  f("modified-data", e);
270
279
  }), h(() => o.readData, (e) => {
271
- V.value.increment(e), V.value.changed() && O();
280
+ V.value.increment(e), V.value.changed() && A();
272
281
  }), h(() => o.editing, (e) => {
273
282
  g("editing updated -> updating editMode", e), b.value = e;
274
283
  }), h(b, (e) => {
275
284
  g("editMode updated -> emit update", e), f("update:editing", e);
276
- }), De(() => {
277
- o.readResource && !M.value ? O() : (M.value, C.value = !0, b.value = !0, i.value = !1, r.value.increment(d.value).turnStoredIntoOriginal(), S.value = r.value.changed());
285
+ }), Ue(() => {
286
+ o.readResource && !R.value ? A() : (R.value, k.value = !0, b.value = !0, r.value = !1, i.value.increment(d.value).turnStoredIntoOriginal(), U.value = i.value.changed());
278
287
  });
279
- const j = (e, u) => {
288
+ const P = (e, u) => {
280
289
  if (u) {
281
- if (i.value = !1, typeof e < "u" && (p.value = e.httpStatus, !e.success))
290
+ if (r.value = !1, typeof e < "u" && (v.value = e.httpStatus, !e.success))
282
291
  return I.value = !0, f("error", e.httpStatus), !1;
283
292
  I.value = !0;
284
293
  }
285
294
  return !0;
286
- }, P = (e) => {
287
- !ue.value && e.autoReloadId && (g("doAutoReloadId -> autoReloadId detected: ", e.autoReloadId), o.readData.id = e.autoReloadId, g("doAutoReloadId -> turning off create mode"), M.value = !1, O());
288
- }, H = (e, u) => {
289
- if (g("onCreate"), !j(u, o.createButton.resource)) {
290
- o.notificationType === N.Toast && _({
295
+ }, X = (e) => {
296
+ !ue.value && e.autoReloadId && (g("doAutoReloadId -> autoReloadId detected: ", e.autoReloadId), o.readData.id = e.autoReloadId, g("doAutoReloadId -> turning off create mode"), R.value = !1, A());
297
+ }, K = (e, u) => {
298
+ if (g("onCreate"), !P(u, o.createButton.resource)) {
299
+ o.notificationType === N.Toast && z({
291
300
  text: n.defaultCreateErrorText,
292
301
  details: n.defaultCreateErrorDetails,
293
302
  icon: n.defaultCreateErrorIcon,
294
- positionX: X.Right
303
+ positionX: q.Right
295
304
  });
296
305
  return;
297
306
  }
298
- J.value = !0, g("onCreate -> turn stored data into original"), r.value.increment(d.value).turnStoredIntoOriginal(), o.notificationType === N.Toast && _({
307
+ Q.value = !0, g("onCreate -> turn stored data into original"), i.value.increment(d.value).turnStoredIntoOriginal(), o.notificationType === N.Toast && z({
299
308
  text: n.defaultCreateSuccessText,
300
309
  details: n.defaultCreateSuccessDetails,
301
310
  icon: n.defaultCreateSuccessIcon,
302
- positionX: X.Right
303
- }), P(u), f("create", u);
304
- }, Y = (e, u) => {
305
- if (g("onUpdate"), !j(u, o.updateButton.resource)) {
306
- o.notificationType === N.Toast && _({
311
+ positionX: q.Right
312
+ }), X(u), f("create", u);
313
+ }, Z = (e, u) => {
314
+ if (g("onUpdate"), !P(u, o.updateButton.resource)) {
315
+ o.notificationType === N.Toast && z({
307
316
  text: n.defaultUpdateErrorText,
308
317
  details: n.defaultUpdateErrorDetails,
309
318
  icon: n.defaultUpdateErrorIcon,
310
- positionX: X.Right
319
+ positionX: q.Right
311
320
  });
312
321
  return;
313
322
  }
314
- g("onUpdate -> turn stored data into original"), r.value.turnStoredIntoOriginal(), o.notificationType === N.Toast && _({
323
+ g("onUpdate -> turn stored data into original"), i.value.turnStoredIntoOriginal(), o.notificationType === N.Toast && z({
315
324
  text: n.defaultUpdateSuccessText,
316
325
  details: n.defaultUpdateSuccessDetails,
317
326
  icon: n.defaultUpdateSuccessIcon,
318
- positionX: X.Right
319
- }), P(u), f("update", u);
327
+ positionX: q.Right
328
+ }), X(u), f("update", u);
320
329
  }, t = (e, u) => {
321
- if (g("onDrop"), !j(u, o.dropButton.resource)) {
322
- o.notificationType === N.Toast && _({
330
+ if (g("onDrop"), !P(u, o.dropButton.resource)) {
331
+ o.notificationType === N.Toast && z({
323
332
  text: n.defaultDropErrorText,
324
333
  details: n.defaultDropErrorDetails,
325
334
  icon: n.defaultDropErrorIcon,
326
- positionX: X.Right
335
+ positionX: q.Right
327
336
  });
328
337
  return;
329
338
  }
330
- o.notificationType === N.Toast && _({
339
+ o.notificationType === N.Toast && z({
331
340
  text: n.defaultDropSuccessText,
332
341
  details: n.defaultDropSuccessDetails,
333
342
  icon: n.defaultDropSuccessIcon,
334
- positionX: X.Right
335
- }), f("drop", u), o.view === pe.Modal && (g("onDrop -> close modal"), Ne(o.modalConfig.modalName, o.modalConfig.modalKey));
343
+ positionX: q.Right
344
+ }), f("drop", u), o.view === fe.Modal && (g("onDrop -> close modal"), Ve(o.modalConfig.modalName, o.modalConfig.modalKey));
336
345
  };
337
- G({
346
+ J({
338
347
  doDrop: () => {
339
348
  L.value && L.value.doDrop();
340
349
  },
341
- doRefresh: O,
350
+ doRefresh: A,
342
351
  doSave: () => {
343
352
  L.value && L.value.doSave();
344
353
  },
345
- hasModifiedData: () => r.value.changed()
354
+ hasModifiedData: () => i.value.changed()
346
355
  });
347
356
  const ae = y(() => {
348
357
  var e;
349
- return r.value.changed() ? (e = o.modalConfig) == null ? void 0 : e.closeConfirm : "";
350
- }), ge = (e) => {
358
+ return i.value.changed() ? (e = o.modalConfig) == null ? void 0 : e.closeConfirm : "";
359
+ }), he = (e) => {
351
360
  var u;
352
361
  if (typeof ((u = o.modalConfig) == null ? void 0 : u.beforeClose) == "function")
353
362
  return o.modalConfig.beforeClose({
354
363
  ...e,
355
- itemCreated: J.value
364
+ itemCreated: Q.value
356
365
  });
357
- }, oe = y(() => o.title.startsWith("__:") ? String($e(o.title.substring(3))) : o.title), ye = y(() => i.value ? !1 : oe.value.length > 0 || !!a["post-title"]), ue = y(() => o.view === pe.Modal), re = y(() => ue.value ? "lkt-modal" : "section"), he = y(() => re.value === "lkt-modal" ? {
366
+ }, oe = y(() => o.title.startsWith("__:") ? String(Le(o.title.substring(3))) : o.title), Be = y(() => r.value ? !1 : oe.value.length > 0 || !!a["post-title"]), ue = y(() => o.view === fe.Modal), se = y(() => ue.value ? "lkt-modal" : "section"), ke = y(() => se.value === "lkt-modal" ? {
358
367
  title: o.title,
359
368
  item: d.value,
360
369
  ...o.modalConfig,
361
- beforeClose: ge,
370
+ beforeClose: he,
362
371
  closeConfirm: ae.value
363
372
  } : {});
364
373
  return (e, u) => {
365
- const le = ie("lkt-http-info"), Be = ie("lkt-loader");
366
- return s(), T(Se(re.value), Ie(Ue(he.value)), {
374
+ const pe = le("lkt-http-info"), Ce = le("lkt-loader");
375
+ return s(), M(Ie(se.value), we(Te(ke.value)), {
367
376
  default: $(() => [
368
- we("article", je, [
369
- !ue.value && ye.value ? (s(), w("header", Pe, [
370
- c(a)["pre-title"] ? (s(), w("div", Xe, [
371
- k(e.$slots, "pre-title", {
377
+ Me("article", Xe, [
378
+ !ue.value && Be.value ? (s(), T("header", qe, [
379
+ c(a)["pre-title"] ? (s(), T("div", ze, [
380
+ D(e.$slots, "pre-title", {
372
381
  item: d.value,
373
- loading: i.value
382
+ loading: r.value
374
383
  })
375
- ])) : v("", !0),
376
- oe.value.length > 0 ? (s(), w("h1", _e, Te(oe.value), 1)) : v("", !0),
377
- c(a)["post-title"] ? (s(), w("div", qe, [
378
- k(e.$slots, "post-title", {
384
+ ])) : p("", !0),
385
+ oe.value.length > 0 ? (s(), T("h1", Fe, Re(oe.value), 1)) : p("", !0),
386
+ c(a)["post-title"] ? (s(), T("div", He, [
387
+ D(e.$slots, "post-title", {
379
388
  item: d.value,
380
- loading: i.value
389
+ loading: r.value
381
390
  })
382
- ])) : v("", !0)
383
- ])) : v("", !0),
384
- e.buttonNavPosition === c(ce).Top ? (s(), T(fe, {
391
+ ])) : p("", !0)
392
+ ])) : p("", !0),
393
+ e.buttonNavPosition === c(me).Top ? (s(), M(be, {
385
394
  key: 1,
386
395
  ref_key: "buttonNav",
387
396
  ref: L,
388
- loading: i.value,
389
- "onUpdate:loading": u[0] || (u[0] = (R) => i.value = R),
397
+ loading: r.value,
398
+ "onUpdate:loading": u[0] || (u[0] = (S) => r.value = S),
390
399
  editing: b.value,
391
- "onUpdate:editing": u[1] || (u[1] = (R) => b.value = R),
400
+ "onUpdate:editing": u[1] || (u[1] = (S) => b.value = S),
392
401
  item: d.value,
393
402
  mode: e.mode,
394
403
  view: e.view,
@@ -397,63 +406,72 @@ const g = (...B) => {
397
406
  "update-button": e.updateButton,
398
407
  "drop-button": e.dropButton,
399
408
  "edit-mode-button": e.editModeButton,
400
- "data-changed": S.value,
401
- "http-success-read": C.value,
402
- "can-update": Q.value,
403
- "can-drop": A.value,
404
- "can-switch-edit-mode": F.value,
405
- onCreate: H,
406
- onSave: Y,
409
+ "data-changed": U.value,
410
+ "http-success-read": k.value,
411
+ "can-update": Y.value,
412
+ "can-drop": O.value,
413
+ "can-switch-edit-mode": j.value,
414
+ perms: C.value,
415
+ onCreate: K,
416
+ onSave: Z,
407
417
  onDrop: t
408
- }, se({ _: 2 }, [
418
+ }, ve({ _: 2 }, [
409
419
  c(a)["prev-buttons-ever"] ? {
410
420
  name: "prev-buttons-ever",
411
- fn: $(() => [
412
- k(e.$slots, "prev-buttons-ever")
421
+ fn: $(({ canUpdate: S, canDrop: ne, perms: de }) => [
422
+ D(e.$slots, "prev-buttons-ever", {
423
+ canUpdate: S,
424
+ canDrop: ne,
425
+ perms: de
426
+ })
413
427
  ]),
414
428
  key: "0"
415
429
  } : void 0,
416
430
  c(a)["prev-buttons"] ? {
417
431
  name: "prev-buttons-ever",
418
- fn: $(() => [
419
- k(e.$slots, "prev-buttons")
432
+ fn: $(({ canUpdate: S, canDrop: ne, perms: de }) => [
433
+ D(e.$slots, "prev-buttons", {
434
+ canUpdate: S,
435
+ canDrop: ne,
436
+ perms: de
437
+ })
420
438
  ]),
421
439
  key: "1"
422
440
  } : void 0
423
- ]), 1032, ["loading", "editing", "item", "mode", "view", "button-nav-visibility", "create-button", "update-button", "drop-button", "edit-mode-button", "data-changed", "http-success-read", "can-update", "can-drop", "can-switch-edit-mode"])) : v("", !0),
424
- i.value ? v("", !0) : (s(), w("div", ze, [
425
- C.value ? (s(), w("div", Fe, [
426
- I.value && e.notificationType === c(N).Inline ? (s(), T(le, {
441
+ ]), 1032, ["loading", "editing", "item", "mode", "view", "button-nav-visibility", "create-button", "update-button", "drop-button", "edit-mode-button", "data-changed", "http-success-read", "can-update", "can-drop", "can-switch-edit-mode", "perms"])) : p("", !0),
442
+ r.value ? p("", !0) : (s(), T("div", Ke, [
443
+ k.value ? (s(), T("div", We, [
444
+ I.value && e.notificationType === c(N).Inline ? (s(), M(pe, {
427
445
  key: 0,
428
- code: p.value,
429
- palette: p.value === 200 ? "success" : "danger",
446
+ code: v.value,
447
+ palette: v.value === 200 ? "success" : "danger",
430
448
  quick: "",
431
449
  "can-close": "",
432
- onClose: u[2] || (u[2] = (R) => I.value = !1)
433
- }, null, 8, ["code", "palette"])) : v("", !0),
434
- k(e.$slots, "item", {
450
+ onClose: u[2] || (u[2] = (S) => I.value = !1)
451
+ }, null, 8, ["code", "palette"])) : p("", !0),
452
+ D(e.$slots, "item", {
435
453
  item: d.value,
436
- loading: i.value,
454
+ loading: r.value,
437
455
  editMode: b.value,
438
- isCreate: M.value,
439
- canUpdate: Q.value,
440
- canDrop: A.value,
441
- itemBeingEdited: z.value
456
+ isCreate: R.value,
457
+ canUpdate: Y.value,
458
+ canDrop: O.value,
459
+ itemBeingEdited: H.value
442
460
  })
443
- ])) : e.notificationType === c(N).Inline ? (s(), T(le, {
461
+ ])) : e.notificationType === c(N).Inline ? (s(), M(pe, {
444
462
  key: 1,
445
- code: p.value
446
- }, null, 8, ["code"])) : v("", !0)
463
+ code: v.value
464
+ }, null, 8, ["code"])) : p("", !0)
447
465
  ])),
448
- i.value ? (s(), T(Be, { key: 3 })) : v("", !0),
449
- e.buttonNavPosition === c(ce).Bottom ? (s(), T(fe, {
466
+ r.value ? (s(), M(Ce, { key: 3 })) : p("", !0),
467
+ e.buttonNavPosition === c(me).Bottom ? (s(), M(be, {
450
468
  key: 4,
451
469
  ref_key: "buttonNav",
452
470
  ref: L,
453
- loading: i.value,
454
- "onUpdate:loading": u[3] || (u[3] = (R) => i.value = R),
471
+ loading: r.value,
472
+ "onUpdate:loading": u[3] || (u[3] = (S) => r.value = S),
455
473
  editing: b.value,
456
- "onUpdate:editing": u[4] || (u[4] = (R) => b.value = R),
474
+ "onUpdate:editing": u[4] || (u[4] = (S) => b.value = S),
457
475
  item: d.value,
458
476
  mode: e.mode,
459
477
  view: e.view,
@@ -462,48 +480,48 @@ const g = (...B) => {
462
480
  "update-button": e.updateButton,
463
481
  "drop-button": e.dropButton,
464
482
  "edit-mode-button": e.editModeButton,
465
- "data-changed": S.value,
466
- "http-success-read": C.value,
467
- "can-update": Q.value,
468
- "can-drop": A.value,
469
- "can-switch-edit-mode": F.value,
470
- onCreate: H,
471
- onSave: Y,
483
+ "data-changed": U.value,
484
+ "http-success-read": k.value,
485
+ "can-update": Y.value,
486
+ "can-drop": O.value,
487
+ "can-switch-edit-mode": j.value,
488
+ onCreate: K,
489
+ onSave: Z,
472
490
  onDrop: t
473
- }, se({ _: 2 }, [
491
+ }, ve({ _: 2 }, [
474
492
  c(a)["prev-buttons-ever"] ? {
475
493
  name: "prev-buttons-ever",
476
494
  fn: $(() => [
477
- k(e.$slots, "prev-buttons-ever")
495
+ D(e.$slots, "prev-buttons-ever")
478
496
  ]),
479
497
  key: "0"
480
498
  } : void 0,
481
499
  c(a)["prev-buttons"] ? {
482
500
  name: "prev-buttons-ever",
483
501
  fn: $(() => [
484
- k(e.$slots, "prev-buttons")
502
+ D(e.$slots, "prev-buttons")
485
503
  ]),
486
504
  key: "1"
487
505
  } : void 0
488
- ]), 1032, ["loading", "editing", "item", "mode", "view", "button-nav-visibility", "create-button", "update-button", "drop-button", "edit-mode-button", "data-changed", "http-success-read", "can-update", "can-drop", "can-switch-edit-mode"])) : v("", !0)
506
+ ]), 1032, ["loading", "editing", "item", "mode", "view", "button-nav-visibility", "create-button", "update-button", "drop-button", "edit-mode-button", "data-changed", "http-success-read", "can-update", "can-drop", "can-switch-edit-mode"])) : p("", !0)
489
507
  ])
490
508
  ]),
491
509
  _: 3
492
510
  }, 16);
493
511
  };
494
512
  }
495
- }), et = {
496
- install: (B, G = {}) => {
497
- B.component("lkt-item-crud") === void 0 && B.component("lkt-item-crud", He);
513
+ }), at = {
514
+ install: (B, J = {}) => {
515
+ B.component("lkt-item-crud") === void 0 && B.component("lkt-item-crud", Ge);
498
516
  }
499
- }, tt = (B) => {
500
- q.defaultSaveIcon = B;
501
- }, at = (B) => {
502
- q.defaultDropIcon = B;
517
+ }, ot = (B) => {
518
+ F.defaultSaveIcon = B;
519
+ }, ut = (B) => {
520
+ F.defaultDropIcon = B;
503
521
  };
504
522
  export {
505
- xe as debugLktItemCrud,
506
- et as default,
507
- at as setItemCrudDefaultDropIcon,
508
- tt as setItemCrudDefaultSaveIcon
523
+ tt as debugLktItemCrud,
524
+ at as default,
525
+ ut as setItemCrudDefaultDropIcon,
526
+ ot as setItemCrudDefaultSaveIcon
509
527
  };
@@ -15,6 +15,7 @@ type __VLS_Props = {
15
15
  canUpdate?: boolean;
16
16
  canDrop?: boolean;
17
17
  canSwitchEditMode?: boolean;
18
+ perms?: Array<string>;
18
19
  httpSuccessRead?: boolean;
19
20
  buttonNavVisibility: ItemCrudButtonNavVisibility;
20
21
  };
@@ -1651,7 +1652,15 @@ declare const isEditing: import("vue").Ref<boolean, boolean>;
1651
1652
  declare const onButtonLoading: () => void, onButtonLoaded: () => void, onCreate: ($event: Event | undefined, r: HTTPResponse) => void, onSave: ($event: Event | undefined, r: HTTPResponse) => void, onDrop: ($event: Event | undefined, r: HTTPResponse) => void;
1652
1653
  declare const ableToUpdate: import("vue").ComputedRef<boolean>, ableToCreate: import("vue").ComputedRef<boolean>, ableToDrop: import("vue").ComputedRef<boolean>, showDropButton: import("vue").ComputedRef<boolean>, showSaveButton: import("vue").ComputedRef<boolean>, showSwitchButton: import("vue").ComputedRef<boolean>, showButtons: import("vue").ComputedRef<boolean>;
1653
1654
  declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
1654
- declare var __VLS_1: {}, __VLS_3: {}, __VLS_17: {
1655
+ declare var __VLS_1: {
1656
+ canUpdate: boolean | undefined;
1657
+ canDrop: boolean | undefined;
1658
+ perms: string[] | undefined;
1659
+ }, __VLS_3: {
1660
+ canUpdate: boolean | undefined;
1661
+ canDrop: boolean | undefined;
1662
+ perms: string[] | undefined;
1663
+ }, __VLS_17: {
1655
1664
  item: LktObject;
1656
1665
  editMode: boolean;
1657
1666
  isCreate: boolean;
@@ -3,7 +3,7 @@ import { HTTPResponse } from 'lkt-http-client';
3
3
  import { ItemCrudButtonNavPosition, ItemCrudConfig, ItemCrudMode, ItemCrudView, LktObject, NotificationType } from 'lkt-vue-kernel';
4
4
  import ButtonNav from '../components/ButtonNav.vue';
5
5
  declare const slots: SetupContext['slots'];
6
- declare const isLoading: import("vue").Ref<boolean, boolean>, item: import("vue").Ref<LktObject, LktObject>, editMode: import("vue").Ref<boolean, boolean>, httpSuccessRead: import("vue").Ref<boolean, boolean>, showStoreMessage: import("vue").Ref<boolean, boolean>, httpStatus: import("vue").Ref<number, number>, dataChanged: import("vue").Ref<boolean, boolean>, createMode: import("vue").Ref<boolean, boolean>, itemBeingEdited: import("vue").Ref<boolean, boolean>, buttonNav: import("vue").Ref<null, null>, canUpdate: import("vue").ComputedRef<boolean>, canDrop: import("vue").ComputedRef<boolean>, canSwitchEditMode: import("vue").ComputedRef<boolean>;
6
+ declare const isLoading: import("vue").Ref<boolean, boolean>, item: import("vue").Ref<LktObject, LktObject>, perms: import("vue").Ref<string[], string[]>, editMode: import("vue").Ref<boolean, boolean>, httpSuccessRead: import("vue").Ref<boolean, boolean>, showStoreMessage: import("vue").Ref<boolean, boolean>, httpStatus: import("vue").Ref<number, number>, dataChanged: import("vue").Ref<boolean, boolean>, createMode: import("vue").Ref<boolean, boolean>, itemBeingEdited: import("vue").Ref<boolean, boolean>, buttonNav: import("vue").Ref<null, null>, canUpdate: import("vue").ComputedRef<boolean>, canDrop: import("vue").ComputedRef<boolean>, canSwitchEditMode: import("vue").ComputedRef<boolean>;
7
7
  declare const onCreate: ($event: PointerEvent, r: HTTPResponse) => void, onUpdate: ($event: PointerEvent, r: HTTPResponse) => void, onDrop: ($event: PointerEvent, r: HTTPResponse) => void;
8
8
  declare const computedTitle: import("vue").ComputedRef<string>, displayHeader: import("vue").ComputedRef<boolean>, computedInsideModal: import("vue").ComputedRef<boolean>, computedContainerTag: import("vue").ComputedRef<"lkt-modal" | "section">, computedContainerAttrs: import("vue").ComputedRef<{}>;
9
9
  declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
@@ -13,7 +13,15 @@ declare var __VLS_6: {
13
13
  }, __VLS_8: {
14
14
  item: LktObject;
15
15
  loading: boolean;
16
- }, __VLS_21: {}, __VLS_23: {}, __VLS_33: {
16
+ }, __VLS_21: {
17
+ canUpdate: boolean | undefined;
18
+ canDrop: boolean | undefined;
19
+ perms: string[] | undefined;
20
+ }, __VLS_23: {
21
+ canUpdate: boolean | undefined;
22
+ canDrop: boolean | undefined;
23
+ perms: string[] | undefined;
24
+ }, __VLS_33: {
17
25
  item: LktObject;
18
26
  loading: false;
19
27
  editMode: boolean;
@@ -44,6 +52,7 @@ declare const __VLS_self: import("vue").DefineComponent<ItemCrudConfig, {
44
52
  slots: typeof slots;
45
53
  isLoading: typeof isLoading;
46
54
  item: typeof item;
55
+ perms: typeof perms;
47
56
  editMode: typeof editMode;
48
57
  httpSuccessRead: typeof httpSuccessRead;
49
58
  showStoreMessage: typeof showStoreMessage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-item-crud",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "module": "./dist/build.js",
@@ -37,6 +37,7 @@
37
37
  canUpdate?: boolean
38
38
  canDrop?: boolean
39
39
  canSwitchEditMode?: boolean
40
+ perms?: Array<string>
40
41
 
41
42
  httpSuccessRead?: boolean
42
43
 
@@ -114,7 +115,7 @@
114
115
 
115
116
 
116
117
  const ableToUpdate = computed(() => {
117
- if (props.mode !== ItemCrudMode.Create && !props.canUpdate) return false;
118
+ if (props.mode !== ItemCrudMode.Update || !props.canUpdate) return false;
118
119
  if (!props.dataChanged) return false;
119
120
 
120
121
  if (typeof safeUpdateButton.value?.disabled === 'function') return !safeUpdateButton.value.disabled(props.item);
@@ -151,7 +152,9 @@
151
152
  showSaveButton = computed(() => {
152
153
  if (props.mode === ItemCrudMode.Create && props.createButton === false) return false;
153
154
  if (props.mode === ItemCrudMode.Update && props.updateButton === false) return false;
154
- if (props.dataChanged) return true;
155
+ if (props.dataChanged) {
156
+ return ableToUpdate.value || ableToCreate.value;
157
+ }
155
158
  if (isLoading.value) return false;
156
159
 
157
160
  if (props.mode === ItemCrudMode.Create) {
@@ -188,11 +191,19 @@
188
191
  <div v-if="showButtons" class="lkt-item-crud-buttons">
189
192
 
190
193
  <div class="lkt-item-crud-buttons" v-if="slots['prev-buttons-ever']" v-show="!isLoading">
191
- <slot name="prev-buttons-ever" />
194
+ <slot name="prev-buttons-ever"
195
+ :can-update="canUpdate"
196
+ :can-drop="canDrop"
197
+ :perms="perms"
198
+ />
192
199
  </div>
193
200
 
194
201
  <div class="lkt-item-crud-buttons" v-if="slots['prev-buttons']" v-show="isEditing && !isLoading">
195
- <slot name="prev-buttons" />
202
+ <slot name="prev-buttons"
203
+ :can-update="canUpdate"
204
+ :can-drop="canDrop"
205
+ :perms="perms"
206
+ />
196
207
  </div>
197
208
 
198
209
  <lkt-button
@@ -362,15 +362,24 @@
362
362
  :can-update="canUpdate"
363
363
  :can-drop="canDrop"
364
364
  :can-switch-edit-mode="canSwitchEditMode"
365
+ :perms="perms"
365
366
  @create="onCreate"
366
367
  @save="onUpdate"
367
368
  @drop="onDrop"
368
369
  >
369
- <template #prev-buttons-ever v-if="slots['prev-buttons-ever']">
370
- <slot name="prev-buttons-ever" />
370
+ <template #prev-buttons-ever="{canUpdate, canDrop, perms}" v-if="slots['prev-buttons-ever']">
371
+ <slot name="prev-buttons-ever"
372
+ :can-update="canUpdate"
373
+ :can-drop="canDrop"
374
+ :perms="perms"
375
+ />
371
376
  </template>
372
- <template #prev-buttons-ever v-if="slots['prev-buttons']">
373
- <slot name="prev-buttons" />
377
+ <template #prev-buttons-ever="{canUpdate, canDrop, perms}" v-if="slots['prev-buttons']">
378
+ <slot name="prev-buttons"
379
+ :can-update="canUpdate"
380
+ :can-drop="canDrop"
381
+ :perms="perms"
382
+ />
374
383
  </template>
375
384
  </button-nav>
376
385