lkt-item-crud 1.2.1 → 1.2.2
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 +6 -6
- package/dist/build.js +169 -153
- package/package.json +1 -1
- package/src/lib-components/LktItemCrud.vue +11 -1
package/dist/build.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
declare function
|
|
2
|
-
declare namespace
|
|
3
|
-
function install(
|
|
1
|
+
declare function He(a?: boolean): void;
|
|
2
|
+
declare namespace We {
|
|
3
|
+
function install(a: any, C?: {}): void;
|
|
4
4
|
}
|
|
5
|
-
declare function
|
|
6
|
-
declare function
|
|
7
|
-
export {
|
|
5
|
+
declare function Qe(a: any): void;
|
|
6
|
+
declare function Ge(a: any): void;
|
|
7
|
+
export { He as debugLktItemCrud, We as default, Qe as setItemCrudDefaultDropIcon, Ge as setItemCrudDefaultSaveIcon };
|
package/dist/build.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { defineComponent as pe, useSlots as me, ref as
|
|
2
|
-
import { httpCall as
|
|
3
|
-
import { DataState as
|
|
1
|
+
import { defineComponent as pe, useSlots as me, ref as v, computed as n, watch as S, nextTick as he, resolveComponent as x, openBlock as s, createBlock as T, resolveDynamicComponent as be, normalizeProps as Ce, guardReactiveProps as ke, withCtx as P, createElementVNode as Z, createElementBlock as b, unref as m, renderSlot as g, createCommentVNode as f, toDisplayString as ye, withDirectives as w, vShow as E, createVNode as ee } from "vue";
|
|
2
|
+
import { httpCall as De } from "lkt-http-client";
|
|
3
|
+
import { DataState as te } from "lkt-data-state";
|
|
4
4
|
import { execModal as Se, refreshModal as ge, closeModal as Me, openModal as Ie, reOpenModal as Be } from "lkt-modal";
|
|
5
5
|
import { __ as _e } from "lkt-i18n";
|
|
6
6
|
const L = class L {
|
|
7
7
|
};
|
|
8
8
|
L.debugEnabled = !1, L.defaultSaveIcon = "", L.defaultDropIcon = "";
|
|
9
|
-
let
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
}, j = (
|
|
15
|
-
|
|
16
|
-
let C =
|
|
17
|
-
switch (
|
|
9
|
+
let M = L;
|
|
10
|
+
const d = (...a) => {
|
|
11
|
+
M.debugEnabled && console.info("[LktItemCrud] ", ...a);
|
|
12
|
+
}, He = (a = !0) => {
|
|
13
|
+
M.debugEnabled = a;
|
|
14
|
+
}, j = (a) => {
|
|
15
|
+
d("runModalCallback -> init", a);
|
|
16
|
+
let C = a.modalKey ? a.modalKey : "_", R = a.args ? a.args : {};
|
|
17
|
+
switch (a.action) {
|
|
18
18
|
case "reOpen":
|
|
19
|
-
return Be(
|
|
19
|
+
return Be(a.modalName, C, R);
|
|
20
20
|
case "open":
|
|
21
|
-
return Ie(
|
|
21
|
+
return Ie(a.modalName, C, R);
|
|
22
22
|
case "close":
|
|
23
|
-
return Me(
|
|
23
|
+
return Me(a.modalName, C);
|
|
24
24
|
case "refresh":
|
|
25
|
-
return ge(
|
|
25
|
+
return ge(a.modalName, C, R);
|
|
26
26
|
case "exec":
|
|
27
|
-
let e =
|
|
28
|
-
return e ? Se(
|
|
27
|
+
let e = a.method;
|
|
28
|
+
return e ? Se(a.modalName, C, e, R) : void 0;
|
|
29
29
|
}
|
|
30
30
|
}, we = { class: "lkt-item-crud" }, Ee = {
|
|
31
31
|
key: 0,
|
|
@@ -40,24 +40,30 @@ const u = (...t) => {
|
|
|
40
40
|
key: 2,
|
|
41
41
|
class: "lkt-item-crud_header-slot"
|
|
42
42
|
}, Ve = { class: "lkt-item-crud-buttons" }, Te = {
|
|
43
|
-
key:
|
|
43
|
+
key: 0,
|
|
44
44
|
class: "lkt-item-crud-buttons"
|
|
45
45
|
}, Le = {
|
|
46
46
|
key: 1,
|
|
47
|
-
class: "lkt-item-
|
|
47
|
+
class: "lkt-item-crud-buttons"
|
|
48
|
+
}, $e = {
|
|
49
|
+
key: 3,
|
|
50
|
+
class: "lkt-item-crud-buttons"
|
|
48
51
|
}, Oe = {
|
|
52
|
+
key: 1,
|
|
53
|
+
class: "lkt-item-crud_content"
|
|
54
|
+
}, ze = {
|
|
49
55
|
key: 0,
|
|
50
56
|
class: "lkt-grid-1"
|
|
51
|
-
},
|
|
57
|
+
}, Ke = /* @__PURE__ */ pe({
|
|
52
58
|
__name: "LktItemCrud",
|
|
53
59
|
props: {
|
|
54
60
|
modelValue: { default: () => ({}) },
|
|
55
61
|
title: { default: "" },
|
|
56
62
|
editModeText: { default: "Edition Mode" },
|
|
57
63
|
saveText: { default: "Save" },
|
|
58
|
-
saveIcon: { default: () =>
|
|
64
|
+
saveIcon: { default: () => M.defaultSaveIcon },
|
|
59
65
|
dropText: { default: "Delete" },
|
|
60
|
-
dropIcon: { default: () =>
|
|
66
|
+
dropIcon: { default: () => M.defaultDropIcon },
|
|
61
67
|
hiddenSave: { type: Boolean, default: !1 },
|
|
62
68
|
hiddenDrop: { type: Boolean, default: !1 },
|
|
63
69
|
hiddenButtons: { type: Boolean, default: !1 },
|
|
@@ -103,79 +109,79 @@ const u = (...t) => {
|
|
|
103
109
|
beforeClose: { type: Function, default: void 0 }
|
|
104
110
|
},
|
|
105
111
|
emits: ["update:modelValue", "update:isCreate", "update:editing", "read", "create", "update", "drop", "before-save", "perms", "error", "modified-data"],
|
|
106
|
-
setup(
|
|
107
|
-
const e =
|
|
108
|
-
let
|
|
109
|
-
const
|
|
110
|
-
|
|
112
|
+
setup(a, { expose: C, emit: R }) {
|
|
113
|
+
const e = a, i = me(), c = R;
|
|
114
|
+
let ae = [];
|
|
115
|
+
const o = v(!0), r = v(e.modelValue), V = v(ae), p = v(e.editing), k = v(!1), I = v(!1), h = v(200), $ = v(null), O = v(null), y = v(new te(r.value, e.dataStateConfig)), K = v(new te(e.readData)), u = v(e.isCreate), F = v(!1), le = n(() => u.value ? e.createConfirm : e.updateConfirm), oe = n(() => u.value ? e.createConfirmData : e.updateConfirmData), q = n(() => u.value ? e.createResource : e.updateResource), ue = n(() => u.value ? { ...e.createData, ...JSON.parse(JSON.stringify(r.value)) } : { ...e.updateData, ...JSON.parse(JSON.stringify(r.value)) }), de = n(() => u.value ? e.createDisabled : e.updateDisabled), B = n(() => !u.value && V.value.includes("update")), _ = n(() => !u.value && V.value.includes("drop")), z = async () => {
|
|
116
|
+
d("fetchItem"), o.value = !0, h.value = -1, I.value = !1;
|
|
111
117
|
try {
|
|
112
|
-
const
|
|
113
|
-
if (
|
|
114
|
-
k.value = !1,
|
|
118
|
+
const t = await De(e.readResource, e.readData);
|
|
119
|
+
if (d("fetchItem -> response", t), o.value = !1, h.value = t.httpStatus, !t.success) {
|
|
120
|
+
k.value = !1, h.value = t.httpStatus, c("error", t.httpStatus);
|
|
115
121
|
return;
|
|
116
122
|
}
|
|
117
|
-
k.value = !0, r.value =
|
|
123
|
+
k.value = !0, r.value = t.data, V.value = t.perms, y.value.increment(r.value).turnStoredIntoOriginal(), K.value.turnStoredIntoOriginal(), c("read", t);
|
|
118
124
|
} catch {
|
|
119
|
-
|
|
125
|
+
o.value = !1, k.value = !1, h.value = 404, c("error", 404);
|
|
120
126
|
return;
|
|
121
127
|
}
|
|
122
128
|
};
|
|
123
|
-
|
|
124
|
-
r.value =
|
|
125
|
-
}, { deep: !0 }),
|
|
126
|
-
if (
|
|
127
|
-
|
|
129
|
+
S(() => e.modelValue, (t) => {
|
|
130
|
+
r.value = t, y.value.increment(t);
|
|
131
|
+
}, { deep: !0 }), S(r, (t) => {
|
|
132
|
+
if (F.value = !0, d("item updated ->", r.value), typeof e.beforeEmitUpdate == "function") {
|
|
133
|
+
d("item updated -> has beforeEmitUpdate");
|
|
128
134
|
let l = e.beforeEmitUpdate(r.value);
|
|
129
|
-
|
|
135
|
+
d("item updated -> override with: ", l), typeof l == "object" && (r.value = l);
|
|
130
136
|
}
|
|
131
|
-
|
|
132
|
-
}, { deep: !0 }),
|
|
133
|
-
const A = n(() => de.value || !
|
|
134
|
-
|
|
135
|
-
K.value.increment(
|
|
136
|
-
}),
|
|
137
|
-
|
|
138
|
-
}),
|
|
139
|
-
|
|
140
|
-
}), e.readResource && !
|
|
141
|
-
const re = (
|
|
142
|
-
if (
|
|
143
|
-
|
|
137
|
+
c("update:modelValue", r.value), d("item updated -> update dataState"), y.value.increment(t), he(() => F.value = !1);
|
|
138
|
+
}, { deep: !0 }), S(V, () => c("perms", V.value));
|
|
139
|
+
const A = n(() => de.value || !u.value && !B.value || typeof e.saveValidator == "function" && !e.saveValidator(r.value) ? !1 : y.value.changed());
|
|
140
|
+
S(A, (t) => c("modified-data", t)), S(u, (t) => c("update:isCreate", t)), S(() => e.readData, (t) => {
|
|
141
|
+
K.value.increment(t), K.value.changed() && z();
|
|
142
|
+
}), S(() => e.editing, (t) => {
|
|
143
|
+
d("editing updated -> updating editMode", t), p.value = t;
|
|
144
|
+
}), S(p, (t) => {
|
|
145
|
+
d("editMode updated -> emit update", t), c("update:editing", t);
|
|
146
|
+
}), e.readResource && !u.value ? z() : u.value && (k.value = !0, p.value = !0, o.value = !1);
|
|
147
|
+
const re = (t, l) => {
|
|
148
|
+
if (o.value = !1, h.value = l.httpStatus, !l.success) {
|
|
149
|
+
I.value = !0, c("error", l.httpStatus);
|
|
144
150
|
return;
|
|
145
151
|
}
|
|
146
|
-
|
|
152
|
+
I.value = !0, e.onDropModalCallbacks.length > 0 && (d("onDrop -> has onDropModalCallbacks"), e.onDropModalCallbacks.forEach((D) => {
|
|
147
153
|
j(D);
|
|
148
|
-
})),
|
|
149
|
-
}, ne = (
|
|
150
|
-
if (
|
|
151
|
-
if (
|
|
152
|
-
|
|
154
|
+
})), c("drop", l);
|
|
155
|
+
}, ne = (t, l) => {
|
|
156
|
+
if (d("onSave -> received response:", l), c("before-save"), q.value) {
|
|
157
|
+
if (o.value = !1, h.value = l.httpStatus, !l.success) {
|
|
158
|
+
I.value = !0, c("error", l.httpStatus);
|
|
153
159
|
return;
|
|
154
160
|
}
|
|
155
|
-
|
|
161
|
+
I.value = !0;
|
|
156
162
|
}
|
|
157
|
-
let D =
|
|
158
|
-
|
|
159
|
-
j(
|
|
160
|
-
}))) : typeof e.onUpdate == "function" && (
|
|
161
|
-
j(
|
|
162
|
-
}))), !e.insideModal && l.autoReloadId && (
|
|
163
|
+
let D = u.value ? "create" : "update";
|
|
164
|
+
u.value || (d("onSave -> turn stored data into original"), y.value.turnStoredIntoOriginal()), D === "create" ? typeof e.onCreate == "function" && (d("onSave -> trigger onCreate callback"), e.onCreate(l), e.onCreateModalCallbacks.length > 0 && (d("onSave -> has onCreateModalCallbacks"), e.onCreateModalCallbacks.forEach((U) => {
|
|
165
|
+
j(U);
|
|
166
|
+
}))) : typeof e.onUpdate == "function" && (d("onSave -> trigger onUpdate callback"), e.onUpdate(l), e.onUpdateModalCallbacks.length > 0 && (d("onSave -> has onUpdateModalCallbacks"), e.onUpdateModalCallbacks.forEach((U) => {
|
|
167
|
+
j(U);
|
|
168
|
+
}))), !e.insideModal && l.autoReloadId && (d("onSave -> autoReloadId detected: ", l.autoReloadId), e.readData.id = l.autoReloadId, d("onSave -> turning off create mode"), u.value = !1, z()), c(D, l);
|
|
163
169
|
}, H = () => {
|
|
164
|
-
|
|
170
|
+
o.value = !0, h.value = -1;
|
|
165
171
|
}, W = () => {
|
|
166
|
-
|
|
172
|
+
o.value = !1;
|
|
167
173
|
};
|
|
168
174
|
C({
|
|
169
175
|
doDrop: () => {
|
|
170
|
-
|
|
176
|
+
O.value && typeof O.value.click == "function" && O.value.click();
|
|
171
177
|
},
|
|
172
178
|
doRefresh: z,
|
|
173
179
|
doSave: () => {
|
|
174
|
-
|
|
180
|
+
$.value && typeof $.value.click == "function" && $.value.click();
|
|
175
181
|
},
|
|
176
|
-
hasModifiedData: () =>
|
|
182
|
+
hasModifiedData: () => y.value.changed()
|
|
177
183
|
});
|
|
178
|
-
const
|
|
184
|
+
const se = n(() => y.value.changed() ? e.editedCloseConfirm : ""), G = n(() => !B.value && _.value ? !0 : !e.hiddenDrop && !o.value && p.value && k.value), Q = n(() => y.value.changed() ? !0 : o.value ? !1 : u.value ? !0 : !e.hiddenSave && p.value && k.value), X = n(() => e.hideSwitchEdition || !B.value && !_.value || !B.value && _.value ? !1 : !o.value && !u.value && k.value && !(e.dropDisabled && e.updateDisabled)), ie = n(() => i["prev-buttons-ever"] ? !0 : !e.hiddenButtons && (Q.value || G.value || X.value)), J = n(() => e.title.startsWith("__:") ? String(_e(e.title.substring(3))) : e.title), ce = n(() => o.value ? !1 : J.value.length > 0 || !!i["post-title"]), Y = n(() => e.insideModal ? "lkt-modal" : "section"), ve = n(() => Y.value === "lkt-modal" ? {
|
|
179
185
|
"modal-name": e.modalName,
|
|
180
186
|
"modal-key": e.modalKey,
|
|
181
187
|
"z-index": e.zIndex,
|
|
@@ -184,149 +190,159 @@ const u = (...t) => {
|
|
|
184
190
|
"before-close": e.beforeClose,
|
|
185
191
|
"disabled-close": e.disabledClose,
|
|
186
192
|
"disabled-veil-click": e.disabledVeilClick,
|
|
187
|
-
"close-confirm":
|
|
193
|
+
"close-confirm": se.value,
|
|
188
194
|
"close-confirm-key": e.editedCloseConfirmKey,
|
|
189
195
|
title: e.title,
|
|
190
196
|
size: e.size
|
|
191
197
|
} : {});
|
|
192
|
-
return (
|
|
193
|
-
const D =
|
|
194
|
-
return
|
|
198
|
+
return (t, l) => {
|
|
199
|
+
const D = x("lkt-button"), U = x("lkt-http-info"), fe = x("lkt-loader");
|
|
200
|
+
return s(), T(be(Y.value), Ce(ke(ve.value)), {
|
|
195
201
|
default: P(() => [
|
|
196
202
|
Z("article", we, [
|
|
197
|
-
!
|
|
198
|
-
|
|
199
|
-
|
|
203
|
+
!t.insideModal && ce.value ? (s(), b("header", Ee, [
|
|
204
|
+
m(i)["pre-title"] ? (s(), b("div", Re, [
|
|
205
|
+
g(t.$slots, "pre-title", {
|
|
200
206
|
item: r.value,
|
|
201
|
-
loading:
|
|
207
|
+
loading: o.value
|
|
202
208
|
})
|
|
203
|
-
])) :
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
209
|
+
])) : f("", !0),
|
|
210
|
+
J.value.length > 0 ? (s(), b("h1", Ue, ye(J.value), 1)) : f("", !0),
|
|
211
|
+
m(i)["post-title"] ? (s(), b("div", Ne, [
|
|
212
|
+
g(t.$slots, "post-title", {
|
|
207
213
|
item: r.value,
|
|
208
|
-
loading:
|
|
214
|
+
loading: o.value
|
|
209
215
|
})
|
|
210
|
-
])) :
|
|
211
|
-
])) :
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
216
|
+
])) : f("", !0)
|
|
217
|
+
])) : f("", !0),
|
|
218
|
+
w(Z("div", Ve, [
|
|
219
|
+
m(i)["prev-buttons-ever"] ? w((s(), b("div", Te, [
|
|
220
|
+
g(t.$slots, "prev-buttons-ever")
|
|
221
|
+
], 512)), [
|
|
222
|
+
[E, !o.value]
|
|
223
|
+
]) : f("", !0),
|
|
224
|
+
m(i)["prev-buttons"] ? w((s(), b("div", Le, [
|
|
225
|
+
g(t.$slots, "prev-buttons")
|
|
226
|
+
], 512)), [
|
|
227
|
+
[E, p.value && !o.value]
|
|
228
|
+
]) : f("", !0),
|
|
229
|
+
w(ee(D, {
|
|
230
|
+
ref: (N) => $.value = N,
|
|
215
231
|
palette: "success",
|
|
216
232
|
disabled: !A.value,
|
|
217
233
|
"confirm-modal": le.value,
|
|
218
234
|
"confirm-data": oe.value,
|
|
219
235
|
resource: q.value,
|
|
220
236
|
"resource-data": ue.value,
|
|
221
|
-
text:
|
|
222
|
-
icon:
|
|
237
|
+
text: m(i)["button-save"] ? "" : t.saveText,
|
|
238
|
+
icon: m(i)["button-save"] ? "" : t.saveIcon,
|
|
223
239
|
onLoading: H,
|
|
224
240
|
onLoaded: W,
|
|
225
241
|
onClick: ne
|
|
226
242
|
}, {
|
|
227
243
|
default: P(() => [
|
|
228
|
-
|
|
244
|
+
m(i)["button-save"] ? g(t.$slots, "button-save", {
|
|
229
245
|
key: 0,
|
|
230
246
|
item: r.value,
|
|
231
|
-
editMode:
|
|
232
|
-
isCreate:
|
|
233
|
-
canUpdate:
|
|
234
|
-
canDrop:
|
|
235
|
-
}) :
|
|
247
|
+
editMode: p.value,
|
|
248
|
+
isCreate: u.value,
|
|
249
|
+
canUpdate: B.value,
|
|
250
|
+
canDrop: _.value
|
|
251
|
+
}) : f("", !0)
|
|
236
252
|
]),
|
|
237
253
|
_: 3
|
|
238
254
|
}, 8, ["disabled", "confirm-modal", "confirm-data", "resource", "resource-data", "text", "icon"]), [
|
|
239
|
-
[
|
|
255
|
+
[E, Q.value]
|
|
240
256
|
]),
|
|
241
|
-
|
|
242
|
-
key:
|
|
243
|
-
ref: (
|
|
257
|
+
u.value ? f("", !0) : w((s(), T(D, {
|
|
258
|
+
key: 2,
|
|
259
|
+
ref: (N) => O.value = N,
|
|
244
260
|
palette: "danger",
|
|
245
|
-
disabled:
|
|
246
|
-
"confirm-modal":
|
|
247
|
-
"confirm-data":
|
|
248
|
-
resource:
|
|
249
|
-
"resource-data":
|
|
250
|
-
text:
|
|
251
|
-
icon:
|
|
261
|
+
disabled: t.dropDisabled || !_.value,
|
|
262
|
+
"confirm-modal": t.dropConfirm,
|
|
263
|
+
"confirm-data": t.dropConfirmData,
|
|
264
|
+
resource: t.dropResource,
|
|
265
|
+
"resource-data": t.dropData,
|
|
266
|
+
text: m(i)["button-drop"] ? "" : t.dropText,
|
|
267
|
+
icon: m(i)["button-drop"] ? "" : t.dropIcon,
|
|
252
268
|
onLoading: H,
|
|
253
269
|
onLoaded: W,
|
|
254
270
|
onClick: re
|
|
255
271
|
}, {
|
|
256
272
|
default: P(() => [
|
|
257
|
-
|
|
273
|
+
m(i)["button-drop"] ? g(t.$slots, "button-drop", {
|
|
258
274
|
key: 0,
|
|
259
275
|
item: r.value,
|
|
260
|
-
editMode:
|
|
261
|
-
isCreate:
|
|
262
|
-
canUpdate:
|
|
263
|
-
canDrop:
|
|
264
|
-
}) :
|
|
276
|
+
editMode: p.value,
|
|
277
|
+
isCreate: u.value,
|
|
278
|
+
canUpdate: B.value,
|
|
279
|
+
canDrop: _.value
|
|
280
|
+
}) : f("", !0)
|
|
265
281
|
]),
|
|
266
282
|
_: 3
|
|
267
283
|
}, 8, ["disabled", "confirm-modal", "confirm-data", "resource", "resource-data", "text", "icon"])), [
|
|
268
|
-
[
|
|
284
|
+
[E, G.value]
|
|
269
285
|
]),
|
|
270
|
-
|
|
271
|
-
|
|
286
|
+
m(i).buttons ? w((s(), b("div", $e, [
|
|
287
|
+
g(t.$slots, "buttons")
|
|
272
288
|
], 512)), [
|
|
273
|
-
[
|
|
274
|
-
]) :
|
|
275
|
-
|
|
276
|
-
checked:
|
|
277
|
-
"onUpdate:checked": l[0] || (l[0] = (
|
|
289
|
+
[E, p.value && !o.value]
|
|
290
|
+
]) : f("", !0),
|
|
291
|
+
w(ee(D, {
|
|
292
|
+
checked: p.value,
|
|
293
|
+
"onUpdate:checked": l[0] || (l[0] = (N) => p.value = N),
|
|
278
294
|
class: "lkt-item-crud--switch-mode-button",
|
|
279
295
|
"show-switch": "",
|
|
280
|
-
text:
|
|
296
|
+
text: t.editModeText
|
|
281
297
|
}, null, 8, ["checked", "text"]), [
|
|
282
|
-
[
|
|
298
|
+
[E, X.value]
|
|
283
299
|
])
|
|
284
300
|
], 512), [
|
|
285
|
-
[
|
|
301
|
+
[E, ie.value]
|
|
286
302
|
]),
|
|
287
|
-
|
|
288
|
-
k.value ? (
|
|
289
|
-
|
|
303
|
+
o.value ? f("", !0) : (s(), b("div", Oe, [
|
|
304
|
+
k.value ? (s(), b("div", ze, [
|
|
305
|
+
I.value ? (s(), T(U, {
|
|
290
306
|
key: 0,
|
|
291
|
-
code:
|
|
307
|
+
code: h.value,
|
|
292
308
|
quick: "",
|
|
293
|
-
palette:
|
|
309
|
+
palette: h.value === 200 ? "success" : "danger",
|
|
294
310
|
"can-close": "",
|
|
295
|
-
onClose: l[1] || (l[1] = (
|
|
296
|
-
}, null, 8, ["code", "palette"])) :
|
|
297
|
-
|
|
311
|
+
onClose: l[1] || (l[1] = (N) => I.value = !1)
|
|
312
|
+
}, null, 8, ["code", "palette"])) : f("", !0),
|
|
313
|
+
g(t.$slots, "item", {
|
|
298
314
|
item: r.value,
|
|
299
|
-
loading:
|
|
300
|
-
editMode:
|
|
301
|
-
isCreate:
|
|
302
|
-
canUpdate:
|
|
303
|
-
canDrop:
|
|
304
|
-
itemBeingEdited:
|
|
315
|
+
loading: o.value,
|
|
316
|
+
editMode: p.value,
|
|
317
|
+
isCreate: u.value,
|
|
318
|
+
canUpdate: B.value,
|
|
319
|
+
canDrop: _.value,
|
|
320
|
+
itemBeingEdited: F.value
|
|
305
321
|
})
|
|
306
|
-
])) : (
|
|
322
|
+
])) : (s(), T(U, {
|
|
307
323
|
key: 1,
|
|
308
|
-
code:
|
|
324
|
+
code: h.value
|
|
309
325
|
}, null, 8, ["code"]))
|
|
310
326
|
])),
|
|
311
|
-
|
|
327
|
+
o.value ? (s(), T(fe, { key: 2 })) : f("", !0)
|
|
312
328
|
])
|
|
313
329
|
]),
|
|
314
330
|
_: 3
|
|
315
331
|
}, 16);
|
|
316
332
|
};
|
|
317
333
|
}
|
|
318
|
-
}),
|
|
319
|
-
install: (
|
|
320
|
-
|
|
334
|
+
}), We = {
|
|
335
|
+
install: (a, C = {}) => {
|
|
336
|
+
a.component("lkt-item-crud") === void 0 && a.component("lkt-item-crud", Ke);
|
|
321
337
|
}
|
|
322
|
-
},
|
|
323
|
-
|
|
324
|
-
},
|
|
325
|
-
|
|
338
|
+
}, Ge = (a) => {
|
|
339
|
+
M.defaultSaveIcon = a;
|
|
340
|
+
}, Qe = (a) => {
|
|
341
|
+
M.defaultDropIcon = a;
|
|
326
342
|
};
|
|
327
343
|
export {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
344
|
+
He as debugLktItemCrud,
|
|
345
|
+
We as default,
|
|
346
|
+
Qe as setItemCrudDefaultDropIcon,
|
|
347
|
+
Ge as setItemCrudDefaultSaveIcon
|
|
332
348
|
};
|
package/package.json
CHANGED
|
@@ -382,6 +382,7 @@
|
|
|
382
382
|
&& !(props.dropDisabled && props.updateDisabled);
|
|
383
383
|
}),
|
|
384
384
|
showButtons = computed(() => {
|
|
385
|
+
if (slots['prev-buttons-ever']) return true;
|
|
385
386
|
return !props.hiddenButtons && (showSaveButton.value || showDropButton.value || showSwitchButton.value);
|
|
386
387
|
}),
|
|
387
388
|
computedTitle = computed(() => {
|
|
@@ -436,6 +437,15 @@
|
|
|
436
437
|
</div>
|
|
437
438
|
</header>
|
|
438
439
|
<div class="lkt-item-crud-buttons" v-show="showButtons">
|
|
440
|
+
|
|
441
|
+
<div class="lkt-item-crud-buttons" v-if="slots['prev-buttons-ever']" v-show="!isLoading">
|
|
442
|
+
<slot name="prev-buttons-ever"/>
|
|
443
|
+
</div>
|
|
444
|
+
|
|
445
|
+
<div class="lkt-item-crud-buttons" v-if="slots['prev-buttons']" v-show="editMode && !isLoading">
|
|
446
|
+
<slot name="prev-buttons"/>
|
|
447
|
+
</div>
|
|
448
|
+
|
|
439
449
|
<lkt-button
|
|
440
450
|
:ref="(el:any) => saveButton = el"
|
|
441
451
|
v-show="showSaveButton"
|
|
@@ -479,7 +489,7 @@
|
|
|
479
489
|
:can-drop="canDrop"></slot>
|
|
480
490
|
</lkt-button>
|
|
481
491
|
|
|
482
|
-
<div class="lkt-item-crud-buttons" v-if="slots.buttons" v-show="editMode">
|
|
492
|
+
<div class="lkt-item-crud-buttons" v-if="slots.buttons" v-show="editMode && !isLoading">
|
|
483
493
|
<slot name="buttons"/>
|
|
484
494
|
</div>
|
|
485
495
|
|