lkt-item-crud 1.2.3 → 1.2.5

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 Ye(o?: boolean): void;
2
- declare namespace Ze {
1
+ declare function Xe(o?: boolean): void;
2
+ declare namespace Ye {
3
3
  function install(o: any, g?: {}): void;
4
4
  }
5
- declare function xe(o: any): void;
6
5
  declare function _e(o: any): void;
7
- export { Ye as debugLktItemCrud, Ze as default, xe as setItemCrudDefaultDropIcon, _e as setItemCrudDefaultSaveIcon };
6
+ declare function Ze(o: any): void;
7
+ export { Xe as debugLktItemCrud, Ye as default, _e as setItemCrudDefaultDropIcon, Ze as setItemCrudDefaultSaveIcon };
package/dist/build.js CHANGED
@@ -1,42 +1,42 @@
1
- import { defineComponent as pe, useSlots as ce, ref as v, watch as C, resolveComponent as Z, openBlock as c, createElementBlock as S, unref as f, withDirectives as I, renderSlot as k, vShow as T, createCommentVNode as m, createVNode as _, withCtx as E, createBlock as O, computed as s, nextTick as Ce, resolveDynamicComponent as ke, normalizeProps as ye, guardReactiveProps as De, createElementVNode as ge, toDisplayString as Se, createSlots as se } from "vue";
2
- import { httpCall as we } from "lkt-http-client";
3
- import { DataState as ie } from "lkt-data-state";
4
- import { execModal as Be, refreshModal as Me, closeModal as Ie, openModal as Te, reOpenModal as Ue } from "lkt-modal";
5
- import { __ as Ne } from "lkt-i18n";
1
+ import { defineComponent as ve, useSlots as pe, ref as p, watch as y, resolveComponent as Z, openBlock as s, createElementBlock as w, unref as m, withDirectives as z, renderSlot as k, vShow as K, createCommentVNode as c, createBlock as M, withCtx as E, computed as i, nextTick as he, resolveDynamicComponent as ye, normalizeProps as ke, guardReactiveProps as Ce, createElementVNode as De, toDisplayString as ge, createSlots as ne } from "vue";
2
+ import { httpCall as Se } from "lkt-http-client";
3
+ import { DataState as se } from "lkt-data-state";
4
+ import { execModal as we, refreshModal as Be, closeModal as Me, openModal as Ie, reOpenModal as Te } from "lkt-modal";
5
+ import { __ as Ue } from "lkt-i18n";
6
6
  const F = class F {
7
7
  };
8
8
  F.debugEnabled = !1, F.defaultSaveIcon = "", F.defaultDropIcon = "";
9
9
  let U = F;
10
- const i = (...o) => {
10
+ const v = (...o) => {
11
11
  U.debugEnabled && console.info("[LktItemCrud] ", ...o);
12
- }, Ye = (o = !0) => {
12
+ }, Xe = (o = !0) => {
13
13
  U.debugEnabled = o;
14
14
  }, Y = (o) => {
15
- i("runModalCallback -> init", o);
16
- let g = o.modalKey ? o.modalKey : "_", B = o.args ? o.args : {};
15
+ v("runModalCallback -> init", o);
16
+ let g = o.modalKey ? o.modalKey : "_", I = o.args ? o.args : {};
17
17
  switch (o.action) {
18
18
  case "reOpen":
19
- return Ue(o.modalName, g, B);
19
+ return Te(o.modalName, g, I);
20
20
  case "open":
21
- return Te(o.modalName, g, B);
21
+ return Ie(o.modalName, g, I);
22
22
  case "close":
23
- return Ie(o.modalName, g);
23
+ return Me(o.modalName, g);
24
24
  case "refresh":
25
- return Me(o.modalName, g, B);
25
+ return Be(o.modalName, g, I);
26
26
  case "exec":
27
27
  let e = o.method;
28
- return e ? Be(o.modalName, g, e, B) : void 0;
28
+ return e ? we(o.modalName, g, e, I) : void 0;
29
29
  }
30
- }, Re = { class: "lkt-item-crud-buttons" }, $e = {
30
+ }, Re = { class: "lkt-item-crud-buttons" }, Ne = {
31
31
  key: 0,
32
32
  class: "lkt-item-crud-buttons"
33
- }, Ee = {
33
+ }, $e = {
34
34
  key: 1,
35
35
  class: "lkt-item-crud-buttons"
36
- }, Ve = {
37
- key: 3,
36
+ }, Ee = {
37
+ key: 4,
38
38
  class: "lkt-item-crud-buttons"
39
- }, ve = /* @__PURE__ */ pe({
39
+ }, ie = /* @__PURE__ */ ve({
40
40
  __name: "ButtonNav",
41
41
  props: {
42
42
  item: { default: () => ({}) },
@@ -65,19 +65,19 @@ const i = (...o) => {
65
65
  editModeText: {}
66
66
  },
67
67
  emits: ["update:loading", "update:editing", "save", "drop"],
68
- setup(o, { expose: g, emit: B }) {
69
- const e = B, b = o, u = ce(), V = v(null), r = v(null), d = v(b.loading);
70
- C(() => b.loading, (t) => d.value = t), C(d, (t) => e("update:loading", t));
71
- const p = v(b.editing);
72
- C(() => b.editing, (t) => p.value = t), C(p, (t) => e("update:editing", t));
68
+ setup(o, { expose: g, emit: I }) {
69
+ const e = I, b = o, u = pe(), V = p(null), r = p(null), d = p(b.loading);
70
+ y(() => b.loading, (a) => d.value = a), y(d, (a) => e("update:loading", a));
71
+ const f = p(b.editing);
72
+ y(() => b.editing, (a) => f.value = a), y(f, (a) => e("update:editing", a));
73
73
  const h = () => {
74
74
  d.value = !0;
75
- }, y = () => {
75
+ }, C = () => {
76
76
  d.value = !1;
77
- }, w = () => {
78
- e("save");
79
- }, D = () => {
80
- e("drop");
77
+ }, B = (a, S) => {
78
+ e("save", a, S);
79
+ }, D = (a, S) => {
80
+ e("drop", a, S);
81
81
  };
82
82
  return g({
83
83
  doSave: () => {
@@ -86,116 +86,114 @@ const i = (...o) => {
86
86
  doDrop: () => {
87
87
  r.value && typeof r.value.click == "function" && r.value.click();
88
88
  }
89
- }), (t, L) => {
89
+ }), (a, S) => {
90
90
  const n = Z("lkt-button");
91
- return c(), S("div", Re, [
92
- f(u)["prev-buttons-ever"] ? I((c(), S("div", $e, [
93
- k(t.$slots, "prev-buttons-ever")
91
+ return s(), w("div", Re, [
92
+ m(u)["prev-buttons-ever"] ? z((s(), w("div", Ne, [
93
+ k(a.$slots, "prev-buttons-ever")
94
94
  ], 512)), [
95
- [T, !d.value]
96
- ]) : m("", !0),
97
- f(u)["prev-buttons"] ? I((c(), S("div", Ee, [
98
- k(t.$slots, "prev-buttons")
95
+ [K, !d.value]
96
+ ]) : c("", !0),
97
+ m(u)["prev-buttons"] ? z((s(), w("div", $e, [
98
+ k(a.$slots, "prev-buttons")
99
99
  ], 512)), [
100
- [T, p.value && !d.value]
101
- ]) : m("", !0),
102
- I(_(n, {
100
+ [K, f.value && !d.value]
101
+ ]) : c("", !0),
102
+ a.showSaveButton ? (s(), M(n, {
103
+ key: 2,
103
104
  ref_key: "saveButton",
104
105
  ref: V,
105
106
  palette: "success",
106
- disabled: !t.ableToSave,
107
- "confirm-modal": t.saveConfirm,
108
- "confirm-data": t.confirmData,
109
- resource: t.saveResource,
110
- "resource-data": t.saveData,
111
- text: f(u)["button-save"] ? "" : t.saveText,
112
- icon: f(u)["button-save"] ? "" : t.saveIcon,
107
+ disabled: !a.ableToSave,
108
+ "confirm-modal": a.saveConfirm,
109
+ "confirm-data": a.confirmData,
110
+ resource: a.saveResource,
111
+ "resource-data": a.saveData,
112
+ text: m(u)["button-save"] ? "" : a.saveText,
113
+ icon: m(u)["button-save"] ? "" : a.saveIcon,
113
114
  onLoading: h,
114
- onLoaded: y,
115
- onClick: w
115
+ onLoaded: C,
116
+ onClick: B
116
117
  }, {
117
118
  default: E(() => [
118
- f(u)["button-save"] ? k(t.$slots, "button-save", {
119
+ m(u)["button-save"] ? k(a.$slots, "button-save", {
119
120
  key: 0,
120
- item: t.item,
121
- editMode: p.value,
122
- isCreate: t.createMode,
123
- canUpdate: t.canUpdate,
124
- canDrop: t.canDrop
125
- }) : m("", !0)
121
+ item: a.item,
122
+ editMode: f.value,
123
+ isCreate: a.createMode,
124
+ canUpdate: a.canUpdate,
125
+ canDrop: a.canDrop
126
+ }) : c("", !0)
126
127
  ]),
127
128
  _: 3
128
- }, 8, ["disabled", "confirm-modal", "confirm-data", "resource", "resource-data", "text", "icon"]), [
129
- [T, t.showSaveButton]
130
- ]),
131
- t.createMode ? m("", !0) : I((c(), O(n, {
132
- key: 2,
129
+ }, 8, ["disabled", "confirm-modal", "confirm-data", "resource", "resource-data", "text", "icon"])) : c("", !0),
130
+ a.createMode ? c("", !0) : z((s(), M(n, {
131
+ key: 3,
133
132
  ref_key: "dropButton",
134
133
  ref: r,
135
134
  palette: "danger",
136
- disabled: !t.ableToDrop,
137
- "confirm-modal": t.dropConfirm,
138
- "confirm-data": t.dropConfirmData,
139
- resource: t.dropResource,
140
- "resource-data": t.dropData,
141
- text: f(u)["button-drop"] ? "" : t.dropText,
142
- icon: f(u)["button-drop"] ? "" : t.dropIcon,
135
+ disabled: !a.ableToDrop,
136
+ "confirm-modal": a.dropConfirm,
137
+ "confirm-data": a.dropConfirmData,
138
+ resource: a.dropResource,
139
+ "resource-data": a.dropData,
140
+ text: m(u)["button-drop"] ? "" : a.dropText,
141
+ icon: m(u)["button-drop"] ? "" : a.dropIcon,
143
142
  onLoading: h,
144
- onLoaded: y,
143
+ onLoaded: C,
145
144
  onClick: D
146
145
  }, {
147
146
  default: E(() => [
148
- f(u)["button-drop"] ? k(t.$slots, "button-drop", {
147
+ m(u)["button-drop"] ? k(a.$slots, "button-drop", {
149
148
  key: 0,
150
- item: t.item,
151
- editMode: p.value,
152
- isCreate: t.createMode,
153
- canUpdate: t.canUpdate,
154
- canDrop: t.canDrop
155
- }) : m("", !0)
149
+ item: a.item,
150
+ editMode: f.value,
151
+ isCreate: a.createMode,
152
+ canUpdate: a.canUpdate,
153
+ canDrop: a.canDrop
154
+ }) : c("", !0)
156
155
  ]),
157
156
  _: 3
158
157
  }, 8, ["disabled", "confirm-modal", "confirm-data", "resource", "resource-data", "text", "icon"])), [
159
- [T, t.showDropButton]
158
+ [K, a.showDropButton]
160
159
  ]),
161
- f(u).buttons ? I((c(), S("div", Ve, [
162
- k(t.$slots, "buttons")
160
+ m(u).buttons ? z((s(), w("div", Ee, [
161
+ k(a.$slots, "buttons")
163
162
  ], 512)), [
164
- [T, p.value && !d.value]
165
- ]) : m("", !0),
166
- I(_(n, {
167
- checked: p.value,
168
- "onUpdate:checked": L[0] || (L[0] = (A) => p.value = A),
163
+ [K, f.value && !d.value]
164
+ ]) : c("", !0),
165
+ a.showSwitchButton ? (s(), M(n, {
166
+ key: 5,
167
+ checked: f.value,
168
+ "onUpdate:checked": S[0] || (S[0] = (L) => f.value = L),
169
169
  class: "lkt-item-crud--switch-mode-button",
170
170
  "show-switch": "",
171
- text: t.editModeText
172
- }, null, 8, ["checked", "text"]), [
173
- [T, t.showSwitchButton]
174
- ])
171
+ text: a.editModeText
172
+ }, null, 8, ["checked", "text"])) : c("", !0)
175
173
  ]);
176
174
  };
177
175
  }
178
176
  });
179
- var x = /* @__PURE__ */ ((o) => (o.Top = "top", o.Bottom = "bottom", o))(x || {}), j = /* @__PURE__ */ ((o) => (o.Changed = "changed", o.Always = "always", o))(j || {});
180
- const Le = { class: "lkt-item-crud" }, Oe = {
177
+ var _ = /* @__PURE__ */ ((o) => (o.Top = "top", o.Bottom = "bottom", o))(_ || {}), j = /* @__PURE__ */ ((o) => (o.Changed = "changed", o.Always = "always", o))(j || {});
178
+ const Ve = { class: "lkt-item-crud" }, Le = {
181
179
  key: 0,
182
180
  class: "lkt-item-crud_header"
183
- }, Ae = {
181
+ }, Oe = {
184
182
  key: 0,
185
183
  class: "lkt-item-crud_header-slot"
186
- }, ze = {
184
+ }, Ae = {
187
185
  key: 1,
188
186
  class: "lkt-item-crud_header-title"
189
- }, Ke = {
187
+ }, ze = {
190
188
  key: 2,
191
189
  class: "lkt-item-crud_header-slot"
192
- }, Fe = {
193
- key: 1,
190
+ }, Ke = {
191
+ key: 2,
194
192
  class: "lkt-item-crud_content"
195
- }, Pe = {
193
+ }, Fe = {
196
194
  key: 0,
197
195
  class: "lkt-grid-1"
198
- }, Je = /* @__PURE__ */ pe({
196
+ }, Pe = /* @__PURE__ */ ve({
199
197
  __name: "LktItemCrud",
200
198
  props: {
201
199
  modelValue: { default: () => ({}) },
@@ -237,7 +235,7 @@ const Le = { class: "lkt-item-crud" }, Oe = {
237
235
  onUpdateModalCallbacks: { default: () => [] },
238
236
  onDropModalCallbacks: { default: () => [] },
239
237
  editing: { type: Boolean, default: !1 },
240
- buttonNavPosition: { default: x.Top },
238
+ buttonNavPosition: { default: _.Top },
241
239
  buttonNavVisibility: { default: j.Changed },
242
240
  size: { default: "" },
243
241
  preTitle: { default: "" },
@@ -252,75 +250,75 @@ const Le = { class: "lkt-item-crud" }, Oe = {
252
250
  beforeClose: { type: Function, default: void 0 }
253
251
  },
254
252
  emits: ["update:modelValue", "update:isCreate", "update:editing", "read", "create", "update", "drop", "before-save", "perms", "error", "modified-data"],
255
- setup(o, { expose: g, emit: B }) {
256
- const e = o, b = ce(), u = B;
253
+ setup(o, { expose: g, emit: I }) {
254
+ const e = o, b = pe(), u = I;
257
255
  let V = [];
258
- const r = v(!0), d = v(e.modelValue), p = v(V), h = v(e.editing), y = v(!1), w = v(!1), D = v(200), ee = v(null), ae = v(null), t = v(new ie(d.value, e.dataStateConfig)), L = v(new ie(e.readData)), n = v(e.isCreate), A = v(!1), P = v(null), te = s(() => n.value ? e.createConfirm : e.updateConfirm), oe = s(() => n.value ? e.createConfirmData : e.updateConfirmData), q = s(() => n.value ? e.createResource : e.updateResource), le = s(() => n.value ? { ...e.createData, ...JSON.parse(JSON.stringify(d.value)) } : { ...e.updateData, ...JSON.parse(JSON.stringify(d.value)) }), fe = s(() => n.value ? e.createDisabled : e.updateDisabled), N = s(() => !n.value && Array.isArray(p.value) && p.value.includes("update")), R = s(() => !n.value && Array.isArray(p.value) && p.value.includes("drop")), J = async () => {
259
- i("fetchItem"), r.value = !0, D.value = -1, w.value = !1;
256
+ const r = p(!0), d = p(e.modelValue), f = p(V), h = p(e.editing), C = p(!1), B = p(!1), D = p(200), x = p(null), ee = p(null), a = p(new se(d.value, e.dataStateConfig)), S = p(new se(e.readData)), n = p(e.isCreate), L = p(!1), P = p(null), te = i(() => n.value ? e.createConfirm : e.updateConfirm), ae = i(() => n.value ? e.createConfirmData : e.updateConfirmData), q = i(() => n.value ? e.createResource : e.updateResource), oe = i(() => n.value ? { ...e.createData, ...JSON.parse(JSON.stringify(d.value)) } : { ...e.updateData, ...JSON.parse(JSON.stringify(d.value)) }), ce = i(() => n.value ? e.createDisabled : e.updateDisabled), R = i(() => !n.value && Array.isArray(f.value) && f.value.includes("update")), N = i(() => !n.value && Array.isArray(f.value) && f.value.includes("drop")), J = async () => {
257
+ v("fetchItem"), r.value = !0, D.value = -1, B.value = !1;
260
258
  try {
261
- const a = await we(e.readResource, e.readData);
262
- if (i("fetchItem -> response", a), r.value = !1, D.value = a.httpStatus, !a.success) {
263
- y.value = !1, D.value = a.httpStatus, u("error", a.httpStatus);
259
+ const t = await Se(e.readResource, e.readData);
260
+ if (v("fetchItem -> response", t), r.value = !1, D.value = t.httpStatus, !t.success) {
261
+ C.value = !1, D.value = t.httpStatus, u("error", t.httpStatus);
264
262
  return;
265
263
  }
266
- y.value = !0, d.value = a.data, p.value = a.perms, t.value.increment(d.value).turnStoredIntoOriginal(), L.value.turnStoredIntoOriginal(), u("read", a);
264
+ C.value = !0, d.value = t.data, f.value = t.perms, a.value.increment(d.value).turnStoredIntoOriginal(), S.value.turnStoredIntoOriginal(), u("read", t);
267
265
  } catch {
268
- r.value = !1, y.value = !1, D.value = 404, u("error", 404);
266
+ r.value = !1, C.value = !1, D.value = 404, u("error", 404);
269
267
  return;
270
268
  }
271
269
  };
272
- C(() => e.modelValue, (a) => {
273
- d.value = a, t.value.increment(a);
274
- }, { deep: !0 }), C(d, (a) => {
275
- if (A.value = !0, i("item updated ->", d.value), typeof e.beforeEmitUpdate == "function") {
276
- i("item updated -> has beforeEmitUpdate");
270
+ y(() => e.modelValue, (t) => {
271
+ d.value = t, a.value.increment(t);
272
+ }, { deep: !0 }), y(d, (t) => {
273
+ if (L.value = !0, v("item updated ->", d.value), typeof e.beforeEmitUpdate == "function") {
274
+ v("item updated -> has beforeEmitUpdate");
277
275
  let l = e.beforeEmitUpdate(d.value);
278
- i("item updated -> override with: ", l), typeof l == "object" && (d.value = l);
276
+ v("item updated -> override with: ", l), typeof l == "object" && (d.value = l);
279
277
  }
280
- u("update:modelValue", d.value), i("item updated -> update dataState"), t.value.increment(a), Ce(() => A.value = !1);
281
- }, { deep: !0 }), C(p, () => u("perms", p.value));
282
- const z = s(() => fe.value || !n.value && !N.value || typeof e.saveValidator == "function" && !e.saveValidator(d.value) ? !1 : t.value.changed()), H = s(() => !e.dropDisabled && R.value);
283
- C(z, (a) => u("modified-data", a)), C(n, (a) => u("update:isCreate", a)), C(() => e.readData, (a) => {
284
- L.value.increment(a), L.value.changed() && J();
285
- }), C(() => e.editing, (a) => {
286
- i("editing updated -> updating editMode", a), h.value = a;
287
- }), C(h, (a) => {
288
- i("editMode updated -> emit update", a), u("update:editing", a);
289
- }), e.readResource && !n.value ? J() : n.value && (y.value = !0, h.value = !0, r.value = !1);
290
- const de = (a, l) => {
278
+ u("update:modelValue", d.value), v("item updated -> update dataState"), a.value.increment(t), he(() => L.value = !1);
279
+ }, { deep: !0 }), y(f, () => u("perms", f.value));
280
+ const O = i(() => ce.value || !n.value && !R.value || typeof e.saveValidator == "function" && !e.saveValidator(d.value) ? !1 : a.value.changed()), H = i(() => !e.dropDisabled && N.value);
281
+ y(O, (t) => u("modified-data", t)), y(n, (t) => u("update:isCreate", t)), y(() => e.readData, (t) => {
282
+ S.value.increment(t), S.value.changed() && J();
283
+ }), y(() => e.editing, (t) => {
284
+ v("editing updated -> updating editMode", t), h.value = t;
285
+ }), y(h, (t) => {
286
+ v("editMode updated -> emit update", t), u("update:editing", t);
287
+ }), e.readResource && !n.value ? J() : n.value && (C.value = !0, h.value = !0, r.value = !1);
288
+ const le = (t, l) => {
291
289
  if (r.value = !1, D.value = l.httpStatus, !l.success) {
292
- w.value = !0, u("error", l.httpStatus);
290
+ B.value = !0, u("error", l.httpStatus);
293
291
  return;
294
292
  }
295
- w.value = !0, e.onDropModalCallbacks.length > 0 && (i("onDrop -> has onDropModalCallbacks"), e.onDropModalCallbacks.forEach(($) => {
293
+ B.value = !0, e.onDropModalCallbacks.length > 0 && (v("onDrop -> has onDropModalCallbacks"), e.onDropModalCallbacks.forEach(($) => {
296
294
  Y($);
297
295
  })), u("drop", l);
298
- }, re = (a, l) => {
299
- if (i("onSave -> received response:", l), u("before-save"), q.value) {
300
- if (r.value = !1, D.value = l.httpStatus, !l.success) {
301
- w.value = !0, u("error", l.httpStatus);
296
+ }, de = (t, l) => {
297
+ if (v("onSave -> received response:", l), u("before-save"), q.value) {
298
+ if (r.value = !1, typeof l < "u" && (D.value = l.httpStatus, l.success)) {
299
+ B.value = !0, u("error", l.httpStatus);
302
300
  return;
303
301
  }
304
- w.value = !0;
302
+ B.value = !0;
305
303
  }
306
304
  let $ = n.value ? "create" : "update";
307
- n.value || (i("onSave -> turn stored data into original"), t.value.turnStoredIntoOriginal()), $ === "create" ? typeof e.onCreate == "function" && (i("onSave -> trigger onCreate callback"), e.onCreate(l), e.onCreateModalCallbacks.length > 0 && (i("onSave -> has onCreateModalCallbacks"), e.onCreateModalCallbacks.forEach((K) => {
308
- Y(K);
309
- }))) : typeof e.onUpdate == "function" && (i("onSave -> trigger onUpdate callback"), e.onUpdate(l), e.onUpdateModalCallbacks.length > 0 && (i("onSave -> has onUpdateModalCallbacks"), e.onUpdateModalCallbacks.forEach((K) => {
310
- Y(K);
311
- }))), !e.insideModal && l.autoReloadId && (i("onSave -> autoReloadId detected: ", l.autoReloadId), e.readData.id = l.autoReloadId, i("onSave -> turning off create mode"), n.value = !1, J()), u($, l);
305
+ n.value || (v("onSave -> turn stored data into original"), a.value.turnStoredIntoOriginal()), $ === "create" ? typeof e.onCreate == "function" && (v("onSave -> trigger onCreate callback"), e.onCreate(l), e.onCreateModalCallbacks.length > 0 && (v("onSave -> has onCreateModalCallbacks"), e.onCreateModalCallbacks.forEach((A) => {
306
+ Y(A);
307
+ }))) : typeof e.onUpdate == "function" && (v("onSave -> trigger onUpdate callback"), e.onUpdate(l), e.onUpdateModalCallbacks.length > 0 && (v("onSave -> has onUpdateModalCallbacks"), e.onUpdateModalCallbacks.forEach((A) => {
308
+ Y(A);
309
+ }))), !e.insideModal && l.autoReloadId && (v("onSave -> autoReloadId detected: ", l.autoReloadId), e.readData.id = l.autoReloadId, v("onSave -> turning off create mode"), n.value = !1, J()), u($, l);
312
310
  };
313
311
  g({
314
312
  doDrop: () => {
315
- P.value && ae.value.doDrop();
313
+ P.value && ee.value.doDrop();
316
314
  },
317
315
  doRefresh: J,
318
316
  doSave: () => {
319
- P.value && ee.value.doSave();
317
+ P.value && x.value.doSave();
320
318
  },
321
- hasModifiedData: () => t.value.changed()
319
+ hasModifiedData: () => a.value.changed()
322
320
  });
323
- const me = s(() => t.value.changed() ? e.editedCloseConfirm : ""), W = s(() => !N.value && R.value ? !0 : !e.hiddenDrop && !r.value && h.value && y.value), G = s(() => t.value.changed() ? !0 : r.value ? !1 : n.value ? !0 : e.buttonNavVisibility === j.Always ? z.value : !e.hiddenSave && h.value && y.value), Q = s(() => e.hideSwitchEdition || !N.value && !R.value || !N.value && R.value ? !1 : !r.value && !n.value && y.value && !(e.dropDisabled && e.updateDisabled)), ue = s(() => e.buttonNavVisibility === j.Always && (z.value || H.value) || b["prev-buttons-ever"] ? !0 : !e.hiddenButtons && (G.value || W.value || Q.value)), X = s(() => e.title.startsWith("__:") ? String(Ne(e.title.substring(3))) : e.title), be = s(() => r.value ? !1 : X.value.length > 0 || !!b["post-title"]), ne = s(() => e.insideModal ? "lkt-modal" : "section"), he = s(() => ne.value === "lkt-modal" ? {
321
+ const fe = i(() => a.value.changed() ? e.editedCloseConfirm : ""), W = i(() => !R.value && N.value ? !0 : !e.hiddenDrop && !r.value && h.value && C.value), G = i(() => a.value.changed() ? !0 : r.value ? !1 : n.value ? !0 : e.buttonNavVisibility === j.Always ? O.value : !e.hiddenSave && h.value && C.value), Q = i(() => e.hideSwitchEdition || !R.value && !N.value || !R.value && N.value ? !1 : !r.value && !n.value && C.value && !(e.dropDisabled && e.updateDisabled)), re = i(() => e.buttonNavVisibility === j.Always && (O.value || H.value) || b["prev-buttons-ever"] ? !0 : !e.hiddenButtons && (G.value || W.value || Q.value)), X = i(() => e.title.startsWith("__:") ? String(Ue(e.title.substring(3))) : e.title), me = i(() => r.value ? !1 : X.value.length > 0 || !!b["post-title"]), ue = i(() => e.insideModal ? "lkt-modal" : "section"), be = i(() => ue.value === "lkt-modal" ? {
324
322
  "modal-name": e.modalName,
325
323
  "modal-key": e.modalKey,
326
324
  "z-index": e.zIndex,
@@ -329,173 +327,172 @@ const Le = { class: "lkt-item-crud" }, Oe = {
329
327
  "before-close": e.beforeClose,
330
328
  "disabled-close": e.disabledClose,
331
329
  "disabled-veil-click": e.disabledVeilClick,
332
- "close-confirm": me.value,
330
+ "close-confirm": fe.value,
333
331
  "close-confirm-key": e.editedCloseConfirmKey,
334
332
  title: e.title,
335
333
  size: e.size
336
334
  } : {});
337
- return (a, l) => {
338
- const $ = Z("lkt-http-info"), K = Z("lkt-loader");
339
- return c(), O(ke(ne.value), ye(De(he.value)), {
335
+ return (t, l) => {
336
+ const $ = Z("lkt-http-info"), A = Z("lkt-loader");
337
+ return s(), M(ye(ue.value), ke(Ce(be.value)), {
340
338
  default: E(() => [
341
- ge("article", Le, [
342
- !a.insideModal && be.value ? (c(), S("header", Oe, [
343
- f(b)["pre-title"] ? (c(), S("div", Ae, [
344
- k(a.$slots, "pre-title", {
339
+ De("article", Ve, [
340
+ !t.insideModal && me.value ? (s(), w("header", Le, [
341
+ m(b)["pre-title"] ? (s(), w("div", Oe, [
342
+ k(t.$slots, "pre-title", {
345
343
  item: d.value,
346
344
  loading: r.value
347
345
  })
348
- ])) : m("", !0),
349
- X.value.length > 0 ? (c(), S("h1", ze, Se(X.value), 1)) : m("", !0),
350
- f(b)["post-title"] ? (c(), S("div", Ke, [
351
- k(a.$slots, "post-title", {
346
+ ])) : c("", !0),
347
+ X.value.length > 0 ? (s(), w("h1", Ae, ge(X.value), 1)) : c("", !0),
348
+ m(b)["post-title"] ? (s(), w("div", ze, [
349
+ k(t.$slots, "post-title", {
352
350
  item: d.value,
353
351
  loading: r.value
354
352
  })
355
- ])) : m("", !0)
356
- ])) : m("", !0),
357
- I(_(ve, {
353
+ ])) : c("", !0)
354
+ ])) : c("", !0),
355
+ re.value && t.buttonNavPosition === "top" ? (s(), M(ie, {
356
+ key: 1,
358
357
  ref_key: "buttonNav",
359
358
  ref: P,
360
359
  loading: r.value,
361
- "onUpdate:loading": l[0] || (l[0] = (M) => r.value = M),
360
+ "onUpdate:loading": l[0] || (l[0] = (T) => r.value = T),
362
361
  editing: h.value,
363
- "onUpdate:editing": l[1] || (l[1] = (M) => h.value = M),
362
+ "onUpdate:editing": l[1] || (l[1] = (T) => h.value = T),
364
363
  item: d.value,
365
364
  "create-mode": n.value,
366
- "can-update": N.value,
367
- "can-drop": R.value,
365
+ "can-update": R.value,
366
+ "can-drop": N.value,
368
367
  "show-switch-button": Q.value,
369
368
  "show-save-button": G.value,
370
369
  "show-drop-button": W.value,
371
- "able-to-save": z.value,
370
+ "able-to-save": O.value,
372
371
  "able-to-drop": H.value,
373
372
  "save-confirm": te.value,
374
- "drop-confirm": a.dropConfirm,
375
- "confirm-data": oe.value,
376
- "drop-confirm-data": a.dropConfirmData,
373
+ "drop-confirm": t.dropConfirm,
374
+ "confirm-data": ae.value,
375
+ "drop-confirm-data": t.dropConfirmData,
377
376
  "save-resource": q.value,
378
- "drop-resource": a.dropResource,
379
- "save-data": le.value,
380
- "drop-data": a.dropData,
381
- "save-text": a.saveText,
382
- "drop-text": a.dropText,
383
- "save-icon": a.saveIcon,
384
- "drop-icon": a.dropIcon,
385
- "edit-mode-text": a.editModeText,
386
- onSave: re,
387
- onDrop: de
388
- }, se({ _: 2 }, [
389
- f(b)["prev-buttons-ever"] ? {
377
+ "drop-resource": t.dropResource,
378
+ "save-data": oe.value,
379
+ "drop-data": t.dropData,
380
+ "save-text": t.saveText,
381
+ "drop-text": t.dropText,
382
+ "save-icon": t.saveIcon,
383
+ "drop-icon": t.dropIcon,
384
+ "edit-mode-text": t.editModeText,
385
+ onSave: de,
386
+ onDrop: le
387
+ }, ne({ _: 2 }, [
388
+ m(b)["prev-buttons-ever"] ? {
390
389
  name: "prev-buttons-ever",
391
390
  fn: E(() => [
392
- k(a.$slots, "prev-buttons-ever")
391
+ k(t.$slots, "prev-buttons-ever")
393
392
  ]),
394
393
  key: "0"
395
394
  } : void 0,
396
- f(b)["prev-buttons"] ? {
395
+ m(b)["prev-buttons"] ? {
397
396
  name: "prev-buttons-ever",
398
397
  fn: E(() => [
399
- k(a.$slots, "prev-buttons")
398
+ k(t.$slots, "prev-buttons")
400
399
  ]),
401
400
  key: "1"
402
401
  } : void 0
403
- ]), 1032, ["loading", "editing", "item", "create-mode", "can-update", "can-drop", "show-switch-button", "show-save-button", "show-drop-button", "able-to-save", "able-to-drop", "save-confirm", "drop-confirm", "confirm-data", "drop-confirm-data", "save-resource", "drop-resource", "save-data", "drop-data", "save-text", "drop-text", "save-icon", "drop-icon", "edit-mode-text"]), [
404
- [T, ue.value && a.buttonNavPosition === "top"]
405
- ]),
406
- r.value ? m("", !0) : (c(), S("div", Fe, [
407
- y.value ? (c(), S("div", Pe, [
408
- w.value ? (c(), O($, {
402
+ ]), 1032, ["loading", "editing", "item", "create-mode", "can-update", "can-drop", "show-switch-button", "show-save-button", "show-drop-button", "able-to-save", "able-to-drop", "save-confirm", "drop-confirm", "confirm-data", "drop-confirm-data", "save-resource", "drop-resource", "save-data", "drop-data", "save-text", "drop-text", "save-icon", "drop-icon", "edit-mode-text"])) : c("", !0),
403
+ r.value ? c("", !0) : (s(), w("div", Ke, [
404
+ C.value ? (s(), w("div", Fe, [
405
+ B.value ? (s(), M($, {
409
406
  key: 0,
410
407
  code: D.value,
411
408
  quick: "",
412
409
  palette: D.value === 200 ? "success" : "danger",
413
410
  "can-close": "",
414
- onClose: l[2] || (l[2] = (M) => w.value = !1)
415
- }, null, 8, ["code", "palette"])) : m("", !0),
416
- k(a.$slots, "item", {
411
+ onClose: l[2] || (l[2] = (T) => B.value = !1)
412
+ }, null, 8, ["code", "palette"])) : c("", !0),
413
+ k(t.$slots, "item", {
417
414
  item: d.value,
418
415
  loading: r.value,
419
416
  editMode: h.value,
420
417
  isCreate: n.value,
421
- canUpdate: N.value,
422
- canDrop: R.value,
423
- itemBeingEdited: A.value
418
+ canUpdate: R.value,
419
+ canDrop: N.value,
420
+ itemBeingEdited: L.value
424
421
  })
425
- ])) : (c(), O($, {
422
+ ])) : (s(), M($, {
426
423
  key: 1,
427
424
  code: D.value
428
425
  }, null, 8, ["code"]))
429
426
  ])),
430
- r.value ? (c(), O(K, { key: 2 })) : m("", !0),
431
- a.buttonNavPosition === f(x).Bottom ? I((c(), O(ve, {
432
- key: 3,
427
+ r.value ? (s(), M(A, { key: 3 })) : c("", !0),
428
+ t.buttonNavPosition === m(_).Bottom ? z((s(), M(ie, {
429
+ key: 4,
433
430
  ref_key: "buttonNav",
434
431
  ref: P,
435
432
  loading: r.value,
436
- "onUpdate:loading": l[3] || (l[3] = (M) => r.value = M),
433
+ "onUpdate:loading": l[3] || (l[3] = (T) => r.value = T),
437
434
  editing: h.value,
438
- "onUpdate:editing": l[4] || (l[4] = (M) => h.value = M),
435
+ "onUpdate:editing": l[4] || (l[4] = (T) => h.value = T),
439
436
  item: d.value,
440
437
  "create-mode": n.value,
441
- "can-update": N.value,
442
- "can-drop": R.value,
438
+ "can-update": R.value,
439
+ "can-drop": N.value,
443
440
  "show-switch-button": Q.value,
444
441
  "show-save-button": G.value,
445
442
  "show-drop-button": W.value,
446
- "able-to-save": z.value,
443
+ "able-to-save": O.value,
447
444
  "able-to-drop": H.value,
448
445
  "save-confirm": te.value,
449
- "drop-confirm": a.dropConfirm,
450
- "confirm-data": oe.value,
451
- "drop-confirm-data": a.dropConfirmData,
446
+ "drop-confirm": t.dropConfirm,
447
+ "confirm-data": ae.value,
448
+ "drop-confirm-data": t.dropConfirmData,
452
449
  "save-resource": q.value,
453
- "drop-resource": a.dropResource,
454
- "save-data": le.value,
455
- "drop-data": a.dropData,
456
- "save-text": a.saveText,
457
- "drop-text": a.dropText,
458
- "save-icon": a.saveIcon,
459
- "drop-icon": a.dropIcon,
460
- "edit-mode-text": a.editModeText,
461
- onSave: re,
462
- onDrop: de
463
- }, se({ _: 2 }, [
464
- f(b)["prev-buttons-ever"] ? {
450
+ "drop-resource": t.dropResource,
451
+ "save-data": oe.value,
452
+ "drop-data": t.dropData,
453
+ "save-text": t.saveText,
454
+ "drop-text": t.dropText,
455
+ "save-icon": t.saveIcon,
456
+ "drop-icon": t.dropIcon,
457
+ "edit-mode-text": t.editModeText,
458
+ onSave: de,
459
+ onDrop: le
460
+ }, ne({ _: 2 }, [
461
+ m(b)["prev-buttons-ever"] ? {
465
462
  name: "prev-buttons-ever",
466
463
  fn: E(() => [
467
- k(a.$slots, "prev-buttons-ever")
464
+ k(t.$slots, "prev-buttons-ever")
468
465
  ]),
469
466
  key: "0"
470
467
  } : void 0,
471
- f(b)["prev-buttons"] ? {
468
+ m(b)["prev-buttons"] ? {
472
469
  name: "prev-buttons-ever",
473
470
  fn: E(() => [
474
- k(a.$slots, "prev-buttons")
471
+ k(t.$slots, "prev-buttons")
475
472
  ]),
476
473
  key: "1"
477
474
  } : void 0
478
475
  ]), 1032, ["loading", "editing", "item", "create-mode", "can-update", "can-drop", "show-switch-button", "show-save-button", "show-drop-button", "able-to-save", "able-to-drop", "save-confirm", "drop-confirm", "confirm-data", "drop-confirm-data", "save-resource", "drop-resource", "save-data", "drop-data", "save-text", "drop-text", "save-icon", "drop-icon", "edit-mode-text"])), [
479
- [T, ue.value]
480
- ]) : m("", !0)
476
+ [K, re.value]
477
+ ]) : c("", !0)
481
478
  ])
482
479
  ]),
483
480
  _: 3
484
481
  }, 16);
485
482
  };
486
483
  }
487
- }), Ze = {
484
+ }), Ye = {
488
485
  install: (o, g = {}) => {
489
- o.component("lkt-item-crud") === void 0 && o.component("lkt-item-crud", Je);
486
+ o.component("lkt-item-crud") === void 0 && o.component("lkt-item-crud", Pe);
490
487
  }
491
- }, _e = (o) => {
488
+ }, Ze = (o) => {
492
489
  U.defaultSaveIcon = o;
493
- }, xe = (o) => {
490
+ }, _e = (o) => {
494
491
  U.defaultDropIcon = o;
495
492
  };
496
493
  export {
497
- Ye as debugLktItemCrud,
498
- Ze as default,
499
- xe as setItemCrudDefaultDropIcon,
500
- _e as setItemCrudDefaultSaveIcon
494
+ Xe as debugLktItemCrud,
495
+ Ye as default,
496
+ _e as setItemCrudDefaultDropIcon,
497
+ Ze as setItemCrudDefaultSaveIcon
501
498
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-item-crud",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "module": "./dist/build.js",
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "./styles": "./dist/style.css"
12
12
  },
13
- "types": "./dist/index.d.ts",
13
+ "types": "./dist/build.d.ts",
14
14
  "files": [
15
15
  "dist/*",
16
16
  "src/**/*.vue"
@@ -1,6 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { ref, useSlots, watch } from 'vue';
3
3
  import { LktObject } from 'lkt-ts-interfaces';
4
+ import { HTTPResponse } from 'lkt-http-client';
4
5
 
5
6
  const emit = defineEmits(['update:loading', 'update:editing', 'save', 'drop']);
6
7
 
@@ -57,11 +58,11 @@
57
58
  onButtonLoaded = () => {
58
59
  isLoading.value = false;
59
60
  },
60
- onSave = () => {
61
- emit('save');
61
+ onSave = ($event: Event, r: HTTPResponse) => {
62
+ emit('save', $event, r);
62
63
  },
63
- onDrop = () => {
64
- emit('drop');
64
+ onDrop = ($event: Event, r: HTTPResponse) => {
65
+ emit('drop', $event, r);
65
66
  };
66
67
 
67
68
  const doSave = () => {
@@ -91,7 +92,7 @@
91
92
 
92
93
  <lkt-button
93
94
  ref="saveButton"
94
- v-show="showSaveButton"
95
+ v-if="showSaveButton"
95
96
  palette="success"
96
97
  :disabled="!ableToSave"
97
98
  :confirm-modal="saveConfirm"
@@ -137,7 +138,7 @@
137
138
  </div>
138
139
 
139
140
  <lkt-button
140
- v-show="showSwitchButton"
141
+ v-if="showSwitchButton"
141
142
  v-model:checked="isEditing"
142
143
  class="lkt-item-crud--switch-mode-button"
143
144
  show-switch
@@ -289,11 +289,13 @@
289
289
  emit('before-save');
290
290
  if (saveResource.value) {
291
291
  isLoading.value = false;
292
- httpStatus.value = r.httpStatus;
293
- if (!r.success) {
294
- showStoreMessage.value = true;
295
- emit('error', r.httpStatus);
296
- return;
292
+ if (typeof r !== 'undefined') {
293
+ httpStatus.value = r.httpStatus;
294
+ if (r.success) {
295
+ showStoreMessage.value = true;
296
+ emit('error', r.httpStatus);
297
+ return;
298
+ }
297
299
  }
298
300
  showStoreMessage.value = true;
299
301
  }
@@ -449,7 +451,7 @@
449
451
 
450
452
  <button-nav
451
453
  ref="buttonNav"
452
- v-show="showButtons && buttonNavPosition === 'top'"
454
+ v-if="showButtons && buttonNavPosition === 'top'"
453
455
  v-model:loading="isLoading"
454
456
  v-model:editing="editMode"
455
457
  :item="item"
@@ -1,2 +0,0 @@
1
- export declare const debug: (...args: any[]) => void;
2
- export declare const debugLktItemCrud: (state?: boolean) => void;
@@ -1,2 +0,0 @@
1
- import { ModalCallbackConfig } from "../types/ModalCallbackConfig";
2
- export declare const runModalCallback: (cfg: ModalCallbackConfig) => void;
package/dist/index.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import { Plugin } from "vue";
2
- import "./../lkt-item-crud.css";
3
- declare const LktItemCrud: Plugin;
4
- export default LktItemCrud;
5
- export { debugLktItemCrud } from "./functions/debug";
6
- export declare const setItemCrudDefaultSaveIcon: (icon: any) => void;
7
- export declare const setItemCrudDefaultDropIcon: (icon: any) => void;
@@ -1,287 +0,0 @@
1
- import { LktObject } from "lkt-ts-interfaces";
2
- import { ModalCallbackConfig } from "../types/ModalCallbackConfig";
3
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
4
- modelValue: LktObject;
5
- title: string;
6
- editModeText: string;
7
- saveText: string;
8
- saveIcon: string;
9
- dropText: string;
10
- dropIcon: string;
11
- hiddenSave: boolean;
12
- hiddenDrop: boolean;
13
- hiddenButtons: boolean;
14
- readResource: string;
15
- createResource: string;
16
- updateResource: string;
17
- dropResource: string;
18
- readData: LktObject;
19
- createData: LktObject;
20
- updateData: LktObject;
21
- dropData: LktObject;
22
- isCreate: boolean;
23
- createConfirm: string;
24
- updateConfirm: string;
25
- dropConfirm: string;
26
- createConfirmData: LktObject;
27
- updateConfirmData: LktObject;
28
- dropConfirmData: LktObject;
29
- createDisabled: boolean;
30
- updateDisabled: boolean;
31
- dropDisabled: boolean;
32
- saveValidator: Function;
33
- beforeEmitUpdate: Function | undefined;
34
- onCreate: Function | undefined;
35
- onUpdate: Function | undefined;
36
- insideModal: boolean;
37
- hideSwitchEdition: boolean;
38
- dataStateConfig: LktObject;
39
- onCreateModalCallbacks: ModalCallbackConfig[];
40
- onUpdateModalCallbacks: ModalCallbackConfig[];
41
- onDropModalCallbacks: ModalCallbackConfig[];
42
- editing: boolean;
43
- }>, {
44
- modelValue: () => {};
45
- title: string;
46
- editModeText: string;
47
- saveText: string;
48
- dropText: string;
49
- saveIcon: () => string;
50
- dropIcon: () => string;
51
- hiddenSave: boolean;
52
- hiddenDrop: boolean;
53
- hiddenButtons: boolean;
54
- readResource: string;
55
- createResource: string;
56
- updateResource: string;
57
- dropResource: string;
58
- readData: () => {};
59
- createData: () => {};
60
- updateData: () => {};
61
- dropData: () => {};
62
- isCreate: boolean;
63
- createConfirm: string;
64
- updateConfirm: string;
65
- dropConfirm: string;
66
- createConfirmData: () => {};
67
- updateConfirmData: () => {};
68
- dropConfirmData: () => {};
69
- createDisabled: boolean;
70
- updateDisabled: boolean;
71
- dropDisabled: boolean;
72
- saveValidator: () => true;
73
- beforeEmitUpdate: undefined;
74
- onCreate: undefined;
75
- onUpdate: undefined;
76
- insideModal: boolean;
77
- hideSwitchEdition: boolean;
78
- dataStateConfig: () => {};
79
- onCreateModalCallbacks: () => never[];
80
- onUpdateModalCallbacks: () => never[];
81
- onDropModalCallbacks: () => never[];
82
- editing: boolean;
83
- }>, {
84
- doDrop: () => void;
85
- doRefresh: () => Promise<void>;
86
- doSave: () => void;
87
- hasModifiedData: () => boolean;
88
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
89
- error: (...args: any[]) => void;
90
- drop: (...args: any[]) => void;
91
- update: (...args: any[]) => void;
92
- "update:modelValue": (...args: any[]) => void;
93
- "update:isCreate": (...args: any[]) => void;
94
- "update:editing": (...args: any[]) => void;
95
- read: (...args: any[]) => void;
96
- create: (...args: any[]) => void;
97
- "before-save": (...args: any[]) => void;
98
- perms: (...args: any[]) => void;
99
- "modified-data": (...args: any[]) => void;
100
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
101
- modelValue: LktObject;
102
- title: string;
103
- editModeText: string;
104
- saveText: string;
105
- saveIcon: string;
106
- dropText: string;
107
- dropIcon: string;
108
- hiddenSave: boolean;
109
- hiddenDrop: boolean;
110
- hiddenButtons: boolean;
111
- readResource: string;
112
- createResource: string;
113
- updateResource: string;
114
- dropResource: string;
115
- readData: LktObject;
116
- createData: LktObject;
117
- updateData: LktObject;
118
- dropData: LktObject;
119
- isCreate: boolean;
120
- createConfirm: string;
121
- updateConfirm: string;
122
- dropConfirm: string;
123
- createConfirmData: LktObject;
124
- updateConfirmData: LktObject;
125
- dropConfirmData: LktObject;
126
- createDisabled: boolean;
127
- updateDisabled: boolean;
128
- dropDisabled: boolean;
129
- saveValidator: Function;
130
- beforeEmitUpdate: Function | undefined;
131
- onCreate: Function | undefined;
132
- onUpdate: Function | undefined;
133
- insideModal: boolean;
134
- hideSwitchEdition: boolean;
135
- dataStateConfig: LktObject;
136
- onCreateModalCallbacks: ModalCallbackConfig[];
137
- onUpdateModalCallbacks: ModalCallbackConfig[];
138
- onDropModalCallbacks: ModalCallbackConfig[];
139
- editing: boolean;
140
- }>, {
141
- modelValue: () => {};
142
- title: string;
143
- editModeText: string;
144
- saveText: string;
145
- dropText: string;
146
- saveIcon: () => string;
147
- dropIcon: () => string;
148
- hiddenSave: boolean;
149
- hiddenDrop: boolean;
150
- hiddenButtons: boolean;
151
- readResource: string;
152
- createResource: string;
153
- updateResource: string;
154
- dropResource: string;
155
- readData: () => {};
156
- createData: () => {};
157
- updateData: () => {};
158
- dropData: () => {};
159
- isCreate: boolean;
160
- createConfirm: string;
161
- updateConfirm: string;
162
- dropConfirm: string;
163
- createConfirmData: () => {};
164
- updateConfirmData: () => {};
165
- dropConfirmData: () => {};
166
- createDisabled: boolean;
167
- updateDisabled: boolean;
168
- dropDisabled: boolean;
169
- saveValidator: () => true;
170
- beforeEmitUpdate: undefined;
171
- onCreate: undefined;
172
- onUpdate: undefined;
173
- insideModal: boolean;
174
- hideSwitchEdition: boolean;
175
- dataStateConfig: () => {};
176
- onCreateModalCallbacks: () => never[];
177
- onUpdateModalCallbacks: () => never[];
178
- onDropModalCallbacks: () => never[];
179
- editing: boolean;
180
- }>>> & {
181
- onError?: ((...args: any[]) => any) | undefined;
182
- onDrop?: ((...args: any[]) => any) | undefined;
183
- onCreate?: ((...args: any[]) => any) | undefined;
184
- onUpdate?: ((...args: any[]) => any) | undefined;
185
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
186
- "onUpdate:isCreate"?: ((...args: any[]) => any) | undefined;
187
- "onUpdate:editing"?: ((...args: any[]) => any) | undefined;
188
- onRead?: ((...args: any[]) => any) | undefined;
189
- "onBefore-save"?: ((...args: any[]) => any) | undefined;
190
- onPerms?: ((...args: any[]) => any) | undefined;
191
- "onModified-data"?: ((...args: any[]) => any) | undefined;
192
- }, {
193
- title: string;
194
- modelValue: LktObject;
195
- editModeText: string;
196
- saveText: string;
197
- saveIcon: string;
198
- dropText: string;
199
- dropIcon: string;
200
- hiddenSave: boolean;
201
- hiddenDrop: boolean;
202
- hiddenButtons: boolean;
203
- readResource: string;
204
- createResource: string;
205
- updateResource: string;
206
- dropResource: string;
207
- readData: LktObject;
208
- createData: LktObject;
209
- updateData: LktObject;
210
- dropData: LktObject;
211
- isCreate: boolean;
212
- createConfirm: string;
213
- updateConfirm: string;
214
- dropConfirm: string;
215
- createConfirmData: LktObject;
216
- updateConfirmData: LktObject;
217
- dropConfirmData: LktObject;
218
- createDisabled: boolean;
219
- updateDisabled: boolean;
220
- dropDisabled: boolean;
221
- saveValidator: Function;
222
- beforeEmitUpdate: Function | undefined;
223
- onCreate: Function | undefined;
224
- onUpdate: Function | undefined;
225
- insideModal: boolean;
226
- hideSwitchEdition: boolean;
227
- dataStateConfig: LktObject;
228
- onCreateModalCallbacks: ModalCallbackConfig[];
229
- onUpdateModalCallbacks: ModalCallbackConfig[];
230
- onDropModalCallbacks: ModalCallbackConfig[];
231
- editing: boolean;
232
- }, {}>, {
233
- "pre-title"?(_: {
234
- item: LktObject;
235
- loading: boolean;
236
- }): any;
237
- "post-title"?(_: {
238
- item: LktObject;
239
- loading: boolean;
240
- }): any;
241
- "button-drop"?(_: {
242
- item: LktObject;
243
- editMode: boolean;
244
- isCreate: false;
245
- canUpdate: boolean;
246
- canDrop: boolean;
247
- }): any;
248
- "button-save"?(_: {
249
- item: LktObject;
250
- editMode: boolean;
251
- isCreate: boolean;
252
- canUpdate: boolean;
253
- canDrop: boolean;
254
- }): any;
255
- item?(_: {
256
- item: LktObject;
257
- loading: false;
258
- editMode: boolean;
259
- isCreate: boolean;
260
- canUpdate: boolean;
261
- canDrop: boolean;
262
- itemBeingEdited: boolean;
263
- }): any;
264
- }>;
265
- export default _default;
266
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
267
- type __VLS_TypePropsToRuntimeProps<T> = {
268
- [K in keyof T]-?: {} extends Pick<T, K> ? {
269
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
270
- } : {
271
- type: import('vue').PropType<T[K]>;
272
- required: true;
273
- };
274
- };
275
- type __VLS_WithDefaults<P, D> = {
276
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
277
- default: D[K];
278
- }> : P[K];
279
- };
280
- type __VLS_Prettify<T> = {
281
- [K in keyof T]: T[K];
282
- } & {};
283
- type __VLS_WithTemplateSlots<T, S> = T & {
284
- new (): {
285
- $slots: S;
286
- };
287
- };
@@ -1,5 +0,0 @@
1
- export declare class Settings {
2
- static debugEnabled: boolean;
3
- static defaultSaveIcon: string;
4
- static defaultDropIcon: string;
5
- }
@@ -1,8 +0,0 @@
1
- import { LktObject } from "lkt-ts-interfaces";
2
- export type ModalCallbackConfig = {
3
- modalName: string;
4
- modalKey?: '_' | string | number;
5
- action: 'refresh' | 'close' | 'reOpen' | 'exec' | 'open';
6
- method?: string;
7
- args?: LktObject;
8
- };