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 +4 -4
- package/dist/build.js +224 -227
- package/package.json +2 -2
- package/src/components/ButtonNav.vue +7 -6
- package/src/lib-components/LktItemCrud.vue +8 -6
- package/dist/functions/debug.d.ts +0 -2
- package/dist/functions/modalCallbacks.d.ts +0 -2
- package/dist/index.d.ts +0 -7
- package/dist/lib-components/LktItemCrud.vue.d.ts +0 -287
- package/dist/settings/Settings.d.ts +0 -5
- package/dist/types/ModalCallbackConfig.d.ts +0 -8
package/dist/build.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
declare function
|
|
2
|
-
declare namespace
|
|
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
|
-
|
|
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
|
|
2
|
-
import { httpCall as
|
|
3
|
-
import { DataState as
|
|
4
|
-
import { execModal as
|
|
5
|
-
import { __ as
|
|
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
|
|
10
|
+
const v = (...o) => {
|
|
11
11
|
U.debugEnabled && console.info("[LktItemCrud] ", ...o);
|
|
12
|
-
},
|
|
12
|
+
}, Xe = (o = !0) => {
|
|
13
13
|
U.debugEnabled = o;
|
|
14
14
|
}, Y = (o) => {
|
|
15
|
-
|
|
16
|
-
let g = o.modalKey ? o.modalKey : "_",
|
|
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
|
|
19
|
+
return Te(o.modalName, g, I);
|
|
20
20
|
case "open":
|
|
21
|
-
return
|
|
21
|
+
return Ie(o.modalName, g, I);
|
|
22
22
|
case "close":
|
|
23
|
-
return
|
|
23
|
+
return Me(o.modalName, g);
|
|
24
24
|
case "refresh":
|
|
25
|
-
return
|
|
25
|
+
return Be(o.modalName, g, I);
|
|
26
26
|
case "exec":
|
|
27
27
|
let e = o.method;
|
|
28
|
-
return e ?
|
|
28
|
+
return e ? we(o.modalName, g, e, I) : void 0;
|
|
29
29
|
}
|
|
30
|
-
}, Re = { class: "lkt-item-crud-buttons" },
|
|
30
|
+
}, Re = { class: "lkt-item-crud-buttons" }, Ne = {
|
|
31
31
|
key: 0,
|
|
32
32
|
class: "lkt-item-crud-buttons"
|
|
33
|
-
},
|
|
33
|
+
}, $e = {
|
|
34
34
|
key: 1,
|
|
35
35
|
class: "lkt-item-crud-buttons"
|
|
36
|
-
},
|
|
37
|
-
key:
|
|
36
|
+
}, Ee = {
|
|
37
|
+
key: 4,
|
|
38
38
|
class: "lkt-item-crud-buttons"
|
|
39
|
-
},
|
|
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:
|
|
69
|
-
const e =
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
|
|
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
|
-
},
|
|
75
|
+
}, C = () => {
|
|
76
76
|
d.value = !1;
|
|
77
|
-
},
|
|
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
|
-
}), (
|
|
89
|
+
}), (a, S) => {
|
|
90
90
|
const n = Z("lkt-button");
|
|
91
|
-
return
|
|
92
|
-
|
|
93
|
-
k(
|
|
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
|
-
[
|
|
96
|
-
]) :
|
|
97
|
-
|
|
98
|
-
k(
|
|
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
|
-
[
|
|
101
|
-
]) :
|
|
102
|
-
|
|
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: !
|
|
107
|
-
"confirm-modal":
|
|
108
|
-
"confirm-data":
|
|
109
|
-
resource:
|
|
110
|
-
"resource-data":
|
|
111
|
-
text:
|
|
112
|
-
icon:
|
|
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:
|
|
115
|
-
onClick:
|
|
115
|
+
onLoaded: C,
|
|
116
|
+
onClick: B
|
|
116
117
|
}, {
|
|
117
118
|
default: E(() => [
|
|
118
|
-
|
|
119
|
+
m(u)["button-save"] ? k(a.$slots, "button-save", {
|
|
119
120
|
key: 0,
|
|
120
|
-
item:
|
|
121
|
-
editMode:
|
|
122
|
-
isCreate:
|
|
123
|
-
canUpdate:
|
|
124
|
-
canDrop:
|
|
125
|
-
}) :
|
|
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
|
-
|
|
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: !
|
|
137
|
-
"confirm-modal":
|
|
138
|
-
"confirm-data":
|
|
139
|
-
resource:
|
|
140
|
-
"resource-data":
|
|
141
|
-
text:
|
|
142
|
-
icon:
|
|
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:
|
|
143
|
+
onLoaded: C,
|
|
145
144
|
onClick: D
|
|
146
145
|
}, {
|
|
147
146
|
default: E(() => [
|
|
148
|
-
|
|
147
|
+
m(u)["button-drop"] ? k(a.$slots, "button-drop", {
|
|
149
148
|
key: 0,
|
|
150
|
-
item:
|
|
151
|
-
editMode:
|
|
152
|
-
isCreate:
|
|
153
|
-
canUpdate:
|
|
154
|
-
canDrop:
|
|
155
|
-
}) :
|
|
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
|
-
[
|
|
158
|
+
[K, a.showDropButton]
|
|
160
159
|
]),
|
|
161
|
-
|
|
162
|
-
k(
|
|
160
|
+
m(u).buttons ? z((s(), w("div", Ee, [
|
|
161
|
+
k(a.$slots, "buttons")
|
|
163
162
|
], 512)), [
|
|
164
|
-
[
|
|
165
|
-
]) :
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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:
|
|
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
|
|
180
|
-
const
|
|
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
|
-
},
|
|
181
|
+
}, Oe = {
|
|
184
182
|
key: 0,
|
|
185
183
|
class: "lkt-item-crud_header-slot"
|
|
186
|
-
},
|
|
184
|
+
}, Ae = {
|
|
187
185
|
key: 1,
|
|
188
186
|
class: "lkt-item-crud_header-title"
|
|
189
|
-
},
|
|
187
|
+
}, ze = {
|
|
190
188
|
key: 2,
|
|
191
189
|
class: "lkt-item-crud_header-slot"
|
|
192
|
-
},
|
|
193
|
-
key:
|
|
190
|
+
}, Ke = {
|
|
191
|
+
key: 2,
|
|
194
192
|
class: "lkt-item-crud_content"
|
|
195
|
-
},
|
|
193
|
+
}, Fe = {
|
|
196
194
|
key: 0,
|
|
197
195
|
class: "lkt-grid-1"
|
|
198
|
-
},
|
|
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:
|
|
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:
|
|
256
|
-
const e = o, b =
|
|
253
|
+
setup(o, { expose: g, emit: I }) {
|
|
254
|
+
const e = o, b = pe(), u = I;
|
|
257
255
|
let V = [];
|
|
258
|
-
const r =
|
|
259
|
-
|
|
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
|
|
262
|
-
if (
|
|
263
|
-
|
|
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
|
-
|
|
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,
|
|
266
|
+
r.value = !1, C.value = !1, D.value = 404, u("error", 404);
|
|
269
267
|
return;
|
|
270
268
|
}
|
|
271
269
|
};
|
|
272
|
-
|
|
273
|
-
d.value =
|
|
274
|
-
}, { deep: !0 }),
|
|
275
|
-
if (
|
|
276
|
-
|
|
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
|
-
|
|
276
|
+
v("item updated -> override with: ", l), typeof l == "object" && (d.value = l);
|
|
279
277
|
}
|
|
280
|
-
u("update:modelValue", d.value),
|
|
281
|
-
}, { deep: !0 }),
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}),
|
|
286
|
-
|
|
287
|
-
}),
|
|
288
|
-
|
|
289
|
-
}), e.readResource && !n.value ? J() : n.value && (
|
|
290
|
-
const
|
|
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
|
-
|
|
290
|
+
B.value = !0, u("error", l.httpStatus);
|
|
293
291
|
return;
|
|
294
292
|
}
|
|
295
|
-
|
|
293
|
+
B.value = !0, e.onDropModalCallbacks.length > 0 && (v("onDrop -> has onDropModalCallbacks"), e.onDropModalCallbacks.forEach(($) => {
|
|
296
294
|
Y($);
|
|
297
295
|
})), u("drop", l);
|
|
298
|
-
},
|
|
299
|
-
if (
|
|
300
|
-
if (r.value = !1, D.value = l.httpStatus,
|
|
301
|
-
|
|
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
|
-
|
|
302
|
+
B.value = !0;
|
|
305
303
|
}
|
|
306
304
|
let $ = n.value ? "create" : "update";
|
|
307
|
-
n.value || (
|
|
308
|
-
Y(
|
|
309
|
-
}))) : typeof e.onUpdate == "function" && (
|
|
310
|
-
Y(
|
|
311
|
-
}))), !e.insideModal && l.autoReloadId && (
|
|
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 &&
|
|
313
|
+
P.value && ee.value.doDrop();
|
|
316
314
|
},
|
|
317
315
|
doRefresh: J,
|
|
318
316
|
doSave: () => {
|
|
319
|
-
P.value &&
|
|
317
|
+
P.value && x.value.doSave();
|
|
320
318
|
},
|
|
321
|
-
hasModifiedData: () =>
|
|
319
|
+
hasModifiedData: () => a.value.changed()
|
|
322
320
|
});
|
|
323
|
-
const
|
|
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":
|
|
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 (
|
|
338
|
-
const $ = Z("lkt-http-info"),
|
|
339
|
-
return
|
|
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
|
-
|
|
342
|
-
!
|
|
343
|
-
|
|
344
|
-
k(
|
|
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
|
-
])) :
|
|
349
|
-
X.value.length > 0 ? (
|
|
350
|
-
|
|
351
|
-
k(
|
|
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
|
-
])) :
|
|
356
|
-
])) :
|
|
357
|
-
|
|
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] = (
|
|
360
|
+
"onUpdate:loading": l[0] || (l[0] = (T) => r.value = T),
|
|
362
361
|
editing: h.value,
|
|
363
|
-
"onUpdate:editing": l[1] || (l[1] = (
|
|
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":
|
|
367
|
-
"can-drop":
|
|
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":
|
|
370
|
+
"able-to-save": O.value,
|
|
372
371
|
"able-to-drop": H.value,
|
|
373
372
|
"save-confirm": te.value,
|
|
374
|
-
"drop-confirm":
|
|
375
|
-
"confirm-data":
|
|
376
|
-
"drop-confirm-data":
|
|
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":
|
|
379
|
-
"save-data":
|
|
380
|
-
"drop-data":
|
|
381
|
-
"save-text":
|
|
382
|
-
"drop-text":
|
|
383
|
-
"save-icon":
|
|
384
|
-
"drop-icon":
|
|
385
|
-
"edit-mode-text":
|
|
386
|
-
onSave:
|
|
387
|
-
onDrop:
|
|
388
|
-
},
|
|
389
|
-
|
|
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(
|
|
391
|
+
k(t.$slots, "prev-buttons-ever")
|
|
393
392
|
]),
|
|
394
393
|
key: "0"
|
|
395
394
|
} : void 0,
|
|
396
|
-
|
|
395
|
+
m(b)["prev-buttons"] ? {
|
|
397
396
|
name: "prev-buttons-ever",
|
|
398
397
|
fn: E(() => [
|
|
399
|
-
k(
|
|
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
|
-
|
|
405
|
-
|
|
406
|
-
|
|
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] = (
|
|
415
|
-
}, null, 8, ["code", "palette"])) :
|
|
416
|
-
k(
|
|
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:
|
|
422
|
-
canDrop:
|
|
423
|
-
itemBeingEdited:
|
|
418
|
+
canUpdate: R.value,
|
|
419
|
+
canDrop: N.value,
|
|
420
|
+
itemBeingEdited: L.value
|
|
424
421
|
})
|
|
425
|
-
])) : (
|
|
422
|
+
])) : (s(), M($, {
|
|
426
423
|
key: 1,
|
|
427
424
|
code: D.value
|
|
428
425
|
}, null, 8, ["code"]))
|
|
429
426
|
])),
|
|
430
|
-
r.value ? (
|
|
431
|
-
|
|
432
|
-
key:
|
|
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] = (
|
|
433
|
+
"onUpdate:loading": l[3] || (l[3] = (T) => r.value = T),
|
|
437
434
|
editing: h.value,
|
|
438
|
-
"onUpdate:editing": l[4] || (l[4] = (
|
|
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":
|
|
442
|
-
"can-drop":
|
|
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":
|
|
443
|
+
"able-to-save": O.value,
|
|
447
444
|
"able-to-drop": H.value,
|
|
448
445
|
"save-confirm": te.value,
|
|
449
|
-
"drop-confirm":
|
|
450
|
-
"confirm-data":
|
|
451
|
-
"drop-confirm-data":
|
|
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":
|
|
454
|
-
"save-data":
|
|
455
|
-
"drop-data":
|
|
456
|
-
"save-text":
|
|
457
|
-
"drop-text":
|
|
458
|
-
"save-icon":
|
|
459
|
-
"drop-icon":
|
|
460
|
-
"edit-mode-text":
|
|
461
|
-
onSave:
|
|
462
|
-
onDrop:
|
|
463
|
-
},
|
|
464
|
-
|
|
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(
|
|
464
|
+
k(t.$slots, "prev-buttons-ever")
|
|
468
465
|
]),
|
|
469
466
|
key: "0"
|
|
470
467
|
} : void 0,
|
|
471
|
-
|
|
468
|
+
m(b)["prev-buttons"] ? {
|
|
472
469
|
name: "prev-buttons-ever",
|
|
473
470
|
fn: E(() => [
|
|
474
|
-
k(
|
|
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
|
-
[
|
|
480
|
-
]) :
|
|
476
|
+
[K, re.value]
|
|
477
|
+
]) : c("", !0)
|
|
481
478
|
])
|
|
482
479
|
]),
|
|
483
480
|
_: 3
|
|
484
481
|
}, 16);
|
|
485
482
|
};
|
|
486
483
|
}
|
|
487
|
-
}),
|
|
484
|
+
}), Ye = {
|
|
488
485
|
install: (o, g = {}) => {
|
|
489
|
-
o.component("lkt-item-crud") === void 0 && o.component("lkt-item-crud",
|
|
486
|
+
o.component("lkt-item-crud") === void 0 && o.component("lkt-item-crud", Pe);
|
|
490
487
|
}
|
|
491
|
-
},
|
|
488
|
+
}, Ze = (o) => {
|
|
492
489
|
U.defaultSaveIcon = o;
|
|
493
|
-
},
|
|
490
|
+
}, _e = (o) => {
|
|
494
491
|
U.defaultDropIcon = o;
|
|
495
492
|
};
|
|
496
493
|
export {
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
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
|
+
"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/
|
|
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-
|
|
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-
|
|
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
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
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-
|
|
454
|
+
v-if="showButtons && buttonNavPosition === 'top'"
|
|
453
455
|
v-model:loading="isLoading"
|
|
454
456
|
v-model:editing="editMode"
|
|
455
457
|
:item="item"
|
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
|
-
};
|