lkt-item-crud 2.0.38 → 2.0.39
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 +5 -5
- package/dist/build.js +404 -427
- package/dist/lib-components/LktItemCrud.vue.d.ts +18 -18
- package/package.json +1 -1
- package/src/lib-components/LktItemCrud.vue +0 -34
package/dist/build.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Je, ref as s, watch as w, useSlots as Qe, computed as y, resolveComponent as Ce, createElementBlock as S, createCommentVNode as C, openBlock as n, createBlock as c, Fragment as X, renderSlot as I, withDirectives as g, mergeProps as v, normalizeProps as Le, unref as d, renderList as z, vShow as B, createVNode as Y, withCtx as Z, mergeDefaults as nt, nextTick as Ge, onMounted as ut, resolveDynamicComponent as it, createSlots as ce, toDisplayString as lt } from "vue";
|
|
2
2
|
import { httpCall as dt } from "lkt-http-client";
|
|
3
|
-
import { DataState as
|
|
4
|
-
import { ModificationView as E, ItemCrudMode as V, ItemCrudButtonNavVisibility as
|
|
3
|
+
import { DataState as Xe } from "lkt-data-state";
|
|
4
|
+
import { ModificationView as E, ItemCrudMode as V, ItemCrudButtonNavVisibility as qe, ButtonType as He, TablePermission as Ne, ensureButtonConfig as ae, LktSettings as k, getFormDataState as rt, extractI18nValue as st, ItemCrudView as ze, getFormSlotKeys as vt, ItemCrudButtonNavPosition as Re, NotificationType as de, getDefaultValues as pt, ItemCrud as ft, ToastPositionX as me } from "lkt-vue-kernel";
|
|
5
5
|
import { closeModal as ct, updateModalKey as mt } from "lkt-modal";
|
|
6
|
-
import { openToast as
|
|
6
|
+
import { openToast as be } from "lkt-toast";
|
|
7
7
|
import { useRouter as bt } from "vue-router";
|
|
8
8
|
const De = class De {
|
|
9
9
|
};
|
|
10
10
|
De.debugEnabled = !1, De.defaultSaveIcon = "", De.defaultDropIcon = "";
|
|
11
|
-
let
|
|
12
|
-
const T = (...
|
|
13
|
-
|
|
14
|
-
}, $t = (
|
|
15
|
-
|
|
11
|
+
let ge = De;
|
|
12
|
+
const T = (...P) => {
|
|
13
|
+
ge.debugEnabled && console.info("[LktItemCrud] ", ...P);
|
|
14
|
+
}, $t = (P = !0) => {
|
|
15
|
+
ge.debugEnabled = P;
|
|
16
16
|
}, gt = {
|
|
17
17
|
key: 0,
|
|
18
18
|
class: "lkt-item-crud-buttons"
|
|
@@ -25,7 +25,7 @@ const T = (...H) => {
|
|
|
25
25
|
}, kt = {
|
|
26
26
|
key: 2,
|
|
27
27
|
class: "lkt-item-crud-buttons"
|
|
28
|
-
},
|
|
28
|
+
}, Oe = /* @__PURE__ */ Je({
|
|
29
29
|
__name: "ButtonNav",
|
|
30
30
|
props: {
|
|
31
31
|
item: { default: () => ({}) },
|
|
@@ -71,27 +71,27 @@ const T = (...H) => {
|
|
|
71
71
|
"save",
|
|
72
72
|
"drop"
|
|
73
73
|
],
|
|
74
|
-
setup(
|
|
75
|
-
const a =
|
|
74
|
+
setup(P, { expose: he, emit: $e }) {
|
|
75
|
+
const a = $e, i = P, M = s(i.pickedModificationView);
|
|
76
76
|
w(() => i.pickedModificationView, (t) => M.value = t), w(M, (t) => a("update:pickedModificationView", t));
|
|
77
|
-
const
|
|
77
|
+
const D = Qe(), m = s(null), p = s(null), U = s(null), ee = s(null), l = s(i.loading);
|
|
78
78
|
w(() => i.loading, (t) => l.value = t), w(l, (t) => {
|
|
79
79
|
i.updateConfig.executionMode === "blocking" && a("update:loading", t);
|
|
80
80
|
});
|
|
81
81
|
const f = s(i.editing);
|
|
82
82
|
w(() => i.editing, (t) => f.value = t), w(f, (t) => a("update:editing", t));
|
|
83
|
-
const
|
|
83
|
+
const O = () => {
|
|
84
84
|
l.value = !0;
|
|
85
|
-
},
|
|
85
|
+
}, R = () => {
|
|
86
86
|
l.value = !1;
|
|
87
|
-
},
|
|
88
|
-
typeof t > "u" || a("create", t,
|
|
89
|
-
},
|
|
90
|
-
typeof t > "u" || a("save", t,
|
|
91
|
-
},
|
|
92
|
-
typeof t > "u" || a("drop", t,
|
|
93
|
-
},
|
|
94
|
-
|
|
87
|
+
}, L = (t, N) => {
|
|
88
|
+
typeof t > "u" || a("create", t, N);
|
|
89
|
+
}, oe = (t, N) => {
|
|
90
|
+
typeof t > "u" || a("save", t, N);
|
|
91
|
+
}, J = (t, N) => {
|
|
92
|
+
typeof t > "u" || a("drop", t, N);
|
|
93
|
+
}, h = y(() => i.editableView === E.Modifications ? i.modifications : i.item);
|
|
94
|
+
he({
|
|
95
95
|
doSave: () => {
|
|
96
96
|
if (A.value)
|
|
97
97
|
switch (i.mode) {
|
|
@@ -104,17 +104,17 @@ const T = (...H) => {
|
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
106
|
doDrop: () => {
|
|
107
|
-
|
|
107
|
+
ee.value && typeof ee.value.click == "function" && ee.value.click();
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
|
-
const
|
|
110
|
+
const ie = y(() => !i.canDrop || i.dropButton === !1 ? !1 : !i.canUpdate && i.canDrop ? !0 : !l.value && i.editing && i.httpSuccessRead), A = y(() => i.mode === V.Create && (i.createButton === !1 || !i.canCreate) || i.mode === V.Update && (i.updateButton === !1 || !i.canUpdate) || l.value ? !1 : i.editing && i.httpSuccessRead), ne = y(() => i.editModeButton === !1 || !i.canSwitchEditMode || !i.canUpdate && !i.canDrop || !i.canUpdate && i.canDrop ? !1 : !l.value && i.mode !== V.Create && i.httpSuccessRead), Se = y(() => i.buttonNavVisibility === qe.Always || D["prev-buttons-ever"] ? !0 : i.buttonNavVisibility === qe.Never ? !1 : A.value || ie.value || ne.value), j = y(() => i.modificationView === !1 ? [] : i.modificationView === !0 ? [
|
|
111
111
|
E.Current,
|
|
112
112
|
E.Modifications,
|
|
113
113
|
E.SplitView,
|
|
114
114
|
E.Differences
|
|
115
|
-
] : Array.isArray(i.modificationView) ? i.modificationView : []),
|
|
115
|
+
] : Array.isArray(i.modificationView) ? i.modificationView : []), fe = y(() => {
|
|
116
116
|
let t = [];
|
|
117
|
-
return
|
|
117
|
+
return j.value.includes(E.Current) && t.push({
|
|
118
118
|
text: "Current",
|
|
119
119
|
icon: "lkt-icn-see",
|
|
120
120
|
disabled: M.value === E.Current,
|
|
@@ -123,7 +123,7 @@ const T = (...H) => {
|
|
|
123
123
|
M.value = E.Current;
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
}),
|
|
126
|
+
}), j.value.includes(E.Modifications) && t.push({
|
|
127
127
|
text: "Modifications",
|
|
128
128
|
icon: "lkt-icn-edit",
|
|
129
129
|
disabled: M.value === E.Modifications,
|
|
@@ -132,7 +132,7 @@ const T = (...H) => {
|
|
|
132
132
|
M.value = E.Modifications;
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
}),
|
|
135
|
+
}), j.value.includes(E.SplitView) && t.push({
|
|
136
136
|
text: "Split View",
|
|
137
137
|
icon: "lkt-icn-columns",
|
|
138
138
|
disabled: M.value === E.SplitView,
|
|
@@ -141,7 +141,7 @@ const T = (...H) => {
|
|
|
141
141
|
M.value = E.SplitView;
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
}),
|
|
144
|
+
}), j.value.includes(E.Differences) && t.push({
|
|
145
145
|
text: "Differences",
|
|
146
146
|
icon: "lkt-icn-balance",
|
|
147
147
|
disabled: M.value === E.Differences,
|
|
@@ -152,230 +152,230 @@ const T = (...H) => {
|
|
|
152
152
|
}
|
|
153
153
|
}), t;
|
|
154
154
|
});
|
|
155
|
-
return (t,
|
|
156
|
-
var
|
|
157
|
-
const r =
|
|
158
|
-
return
|
|
159
|
-
t.grouped && t.groupButtonAsModalActions ? (n(), S(
|
|
160
|
-
|
|
155
|
+
return (t, N) => {
|
|
156
|
+
var re, F, K, se, W, G;
|
|
157
|
+
const r = Ce("lkt-button");
|
|
158
|
+
return Se.value ? (n(), S("div", gt, [
|
|
159
|
+
t.grouped && t.groupButtonAsModalActions ? (n(), S(X, { key: 0 }, [
|
|
160
|
+
ne.value ? (n(), c(r, v({ key: 0 }, t.editModeButton, {
|
|
161
161
|
checked: f.value,
|
|
162
|
-
"onUpdate:checked":
|
|
162
|
+
"onUpdate:checked": N[0] || (N[0] = (b) => f.value = b),
|
|
163
163
|
class: "lkt-item-crud--switch-mode-button"
|
|
164
164
|
}), null, 16, ["checked"])) : C("", !0),
|
|
165
|
-
|
|
166
|
-
type: d(
|
|
165
|
+
j.value.length > 0 ? (n(), c(r, Le(v({ key: 1 }, {
|
|
166
|
+
type: d(He).Tooltip,
|
|
167
167
|
icon: "lkt-icn-cross-arrows",
|
|
168
168
|
class: "lkt-item-crud--modifications-button",
|
|
169
|
-
splitButtons:
|
|
169
|
+
splitButtons: fe.value,
|
|
170
170
|
tooltip: {
|
|
171
171
|
contentClass: "lkt-flex-column"
|
|
172
172
|
}
|
|
173
173
|
})), null, 16)) : C("", !0),
|
|
174
|
-
(n(!0), S(
|
|
174
|
+
(n(!0), S(X, null, z(t.navStartButtons, (b) => g((n(), c(r, v({ ref_for: !0 }, b), null, 16)), [
|
|
175
175
|
[B, !l.value]
|
|
176
176
|
])), 256)),
|
|
177
|
-
d(
|
|
177
|
+
d(D)["prev-buttons-ever"] ? I(t.$slots, "prev-buttons-ever", {
|
|
178
178
|
key: 2,
|
|
179
179
|
canUpdate: t.canUpdate,
|
|
180
180
|
canDrop: t.canDrop,
|
|
181
181
|
perms: t.perms
|
|
182
182
|
}) : C("", !0),
|
|
183
|
-
(n(!0), S(
|
|
183
|
+
(n(!0), S(X, null, z(t.navStartButtonsEditing, (b) => g((n(), c(r, v({ ref_for: !0 }, b), null, 16)), [
|
|
184
184
|
[B, f.value && !l.value]
|
|
185
185
|
])), 256)),
|
|
186
|
-
d(
|
|
186
|
+
d(D)["prev-buttons"] ? I(t.$slots, "prev-buttons", {
|
|
187
187
|
key: 3,
|
|
188
188
|
canUpdate: t.canUpdate,
|
|
189
189
|
canDrop: t.canDrop,
|
|
190
190
|
perms: t.perms
|
|
191
191
|
}) : C("", !0),
|
|
192
|
-
g(
|
|
192
|
+
g(Y(r, v({
|
|
193
193
|
ref_key: "saveButtonRef",
|
|
194
194
|
ref: U
|
|
195
195
|
}, {
|
|
196
196
|
...t.updateButton,
|
|
197
197
|
resourceData: {
|
|
198
|
-
...(
|
|
199
|
-
...
|
|
198
|
+
...(re = t.updateButton) == null ? void 0 : re.resourceData,
|
|
199
|
+
...h.value
|
|
200
200
|
},
|
|
201
201
|
disabled: !t.ableToUpdate
|
|
202
202
|
}, {
|
|
203
|
-
onLoading:
|
|
204
|
-
onLoaded:
|
|
205
|
-
onClick:
|
|
203
|
+
onLoading: O,
|
|
204
|
+
onLoaded: R,
|
|
205
|
+
onClick: oe
|
|
206
206
|
}), null, 16), [
|
|
207
207
|
[B, t.mode === d(V).Update && A.value]
|
|
208
208
|
]),
|
|
209
|
-
g(
|
|
209
|
+
g(Y(r, v({
|
|
210
210
|
ref_key: "createButtonRef",
|
|
211
211
|
ref: m
|
|
212
212
|
}, {
|
|
213
213
|
...t.createButton,
|
|
214
214
|
resourceData: {
|
|
215
|
-
...(
|
|
216
|
-
...
|
|
215
|
+
...(F = t.createButton) == null ? void 0 : F.resourceData,
|
|
216
|
+
...h.value
|
|
217
217
|
},
|
|
218
218
|
disabled: !t.ableToCreate
|
|
219
219
|
}, {
|
|
220
|
-
onLoading:
|
|
221
|
-
onLoaded:
|
|
222
|
-
onClick:
|
|
220
|
+
onLoading: O,
|
|
221
|
+
onLoaded: R,
|
|
222
|
+
onClick: L
|
|
223
223
|
}), null, 16), [
|
|
224
224
|
[B, t.mode === d(V).Create && A.value]
|
|
225
225
|
]),
|
|
226
|
-
g(
|
|
226
|
+
g(Y(r, v({
|
|
227
227
|
ref_key: "createAndNewButtonRef",
|
|
228
228
|
ref: p
|
|
229
229
|
}, {
|
|
230
230
|
...t.createAndNewButton,
|
|
231
231
|
resourceData: {
|
|
232
|
-
...(
|
|
233
|
-
...
|
|
232
|
+
...(K = t.createAndNewButton) == null ? void 0 : K.resourceData,
|
|
233
|
+
...h.value
|
|
234
234
|
},
|
|
235
235
|
disabled: !t.ableToCreate
|
|
236
236
|
}, {
|
|
237
|
-
onLoading:
|
|
238
|
-
onLoaded:
|
|
239
|
-
onClick:
|
|
237
|
+
onLoading: O,
|
|
238
|
+
onLoaded: R,
|
|
239
|
+
onClick: L
|
|
240
240
|
}), null, 16), [
|
|
241
241
|
[B, t.mode === d(V).Create && A.value && t.ableToCreateAndNew]
|
|
242
242
|
]),
|
|
243
|
-
g(
|
|
243
|
+
g(Y(r, v({
|
|
244
244
|
ref_key: "dropButtonRef",
|
|
245
|
-
ref:
|
|
245
|
+
ref: ee
|
|
246
246
|
}, t.dropButton, {
|
|
247
247
|
disabled: !t.ableToDrop,
|
|
248
|
-
onLoading:
|
|
249
|
-
onLoaded:
|
|
250
|
-
onClick:
|
|
248
|
+
onLoading: O,
|
|
249
|
+
onLoaded: R,
|
|
250
|
+
onClick: J
|
|
251
251
|
}), null, 16, ["disabled"]), [
|
|
252
|
-
[B,
|
|
252
|
+
[B, ie.value && t.mode !== d(V).Create]
|
|
253
253
|
]),
|
|
254
|
-
d(
|
|
255
|
-
(n(!0), S(
|
|
254
|
+
d(D).buttons ? I(t.$slots, "buttons", { key: 4 }) : C("", !0),
|
|
255
|
+
(n(!0), S(X, null, z(t.navEndButtons, (b) => g((n(), c(r, v({ ref_for: !0 }, b), null, 16)), [
|
|
256
256
|
[B, !l.value]
|
|
257
257
|
])), 256)),
|
|
258
|
-
(n(!0), S(
|
|
258
|
+
(n(!0), S(X, null, z(t.navEndButtonsEditing, (b) => g((n(), c(r, v({ ref_for: !0 }, b), null, 16)), [
|
|
259
259
|
[B, f.value && !l.value]
|
|
260
260
|
])), 256))
|
|
261
261
|
], 64)) : t.grouped ? (n(), c(r, v({
|
|
262
262
|
key: 1,
|
|
263
263
|
ref: "groupButton"
|
|
264
264
|
}, t.groupButton, { class: "lkt-item-crud-group-button" }), {
|
|
265
|
-
split:
|
|
266
|
-
var b,
|
|
265
|
+
split: Z(() => {
|
|
266
|
+
var b, ve, pe;
|
|
267
267
|
return [
|
|
268
|
-
|
|
268
|
+
ne.value ? (n(), c(r, v({ key: 0 }, t.editModeButton, {
|
|
269
269
|
checked: f.value,
|
|
270
|
-
"onUpdate:checked":
|
|
270
|
+
"onUpdate:checked": N[1] || (N[1] = (Q) => f.value = Q),
|
|
271
271
|
class: "lkt-item-crud--switch-mode-button"
|
|
272
272
|
}), null, 16, ["checked"])) : C("", !0),
|
|
273
|
-
|
|
274
|
-
type: d(
|
|
273
|
+
j.value.length > 0 ? (n(), c(r, Le(v({ key: 1 }, {
|
|
274
|
+
type: d(He).Tooltip,
|
|
275
275
|
icon: "lkt-icn-cross-arrows",
|
|
276
276
|
class: "lkt-item-crud--modifications-button",
|
|
277
|
-
splitButtons:
|
|
277
|
+
splitButtons: fe.value,
|
|
278
278
|
tooltip: {
|
|
279
279
|
contentClass: "lkt-flex-column"
|
|
280
280
|
}
|
|
281
281
|
})), null, 16)) : C("", !0),
|
|
282
|
-
(n(!0), S(
|
|
282
|
+
(n(!0), S(X, null, z(t.navStartButtons, (Q) => g((n(), c(r, v({ ref_for: !0 }, Q), null, 16)), [
|
|
283
283
|
[B, !l.value]
|
|
284
284
|
])), 256)),
|
|
285
|
-
d(
|
|
285
|
+
d(D)["prev-buttons-ever"] ? I(t.$slots, "prev-buttons-ever", {
|
|
286
286
|
key: 2,
|
|
287
287
|
canUpdate: t.canUpdate,
|
|
288
288
|
canDrop: t.canDrop,
|
|
289
289
|
perms: t.perms
|
|
290
290
|
}) : C("", !0),
|
|
291
|
-
(n(!0), S(
|
|
291
|
+
(n(!0), S(X, null, z(t.navStartButtonsEditing, (Q) => g((n(), c(r, v({ ref_for: !0 }, Q), null, 16)), [
|
|
292
292
|
[B, f.value && !l.value]
|
|
293
293
|
])), 256)),
|
|
294
|
-
d(
|
|
294
|
+
d(D)["prev-buttons"] ? I(t.$slots, "prev-buttons", {
|
|
295
295
|
key: 3,
|
|
296
296
|
canUpdate: t.canUpdate,
|
|
297
297
|
canDrop: t.canDrop,
|
|
298
298
|
perms: t.perms
|
|
299
299
|
}) : C("", !0),
|
|
300
|
-
g(
|
|
300
|
+
g(Y(r, v({
|
|
301
301
|
ref_key: "saveButtonRef",
|
|
302
302
|
ref: U
|
|
303
303
|
}, {
|
|
304
304
|
...t.updateButton,
|
|
305
305
|
resourceData: {
|
|
306
306
|
...(b = t.updateButton) == null ? void 0 : b.resourceData,
|
|
307
|
-
...
|
|
307
|
+
...h.value
|
|
308
308
|
},
|
|
309
309
|
disabled: !t.ableToUpdate
|
|
310
310
|
}, {
|
|
311
|
-
onLoading:
|
|
312
|
-
onLoaded:
|
|
313
|
-
onClick:
|
|
311
|
+
onLoading: O,
|
|
312
|
+
onLoaded: R,
|
|
313
|
+
onClick: oe
|
|
314
314
|
}), null, 16), [
|
|
315
315
|
[B, t.mode === d(V).Update && A.value]
|
|
316
316
|
]),
|
|
317
|
-
g(
|
|
317
|
+
g(Y(r, v({
|
|
318
318
|
ref_key: "createButtonRef",
|
|
319
319
|
ref: m
|
|
320
320
|
}, {
|
|
321
321
|
...t.createButton,
|
|
322
322
|
resourceData: {
|
|
323
|
-
...(
|
|
324
|
-
...
|
|
323
|
+
...(ve = t.createButton) == null ? void 0 : ve.resourceData,
|
|
324
|
+
...h.value
|
|
325
325
|
},
|
|
326
326
|
disabled: !t.ableToCreate
|
|
327
327
|
}, {
|
|
328
328
|
disabled: !t.ableToCreate,
|
|
329
|
-
onLoading:
|
|
330
|
-
onLoaded:
|
|
331
|
-
onClick:
|
|
329
|
+
onLoading: O,
|
|
330
|
+
onLoaded: R,
|
|
331
|
+
onClick: L
|
|
332
332
|
}), null, 16, ["disabled"]), [
|
|
333
333
|
[B, t.mode === d(V).Create && A.value]
|
|
334
334
|
]),
|
|
335
|
-
g(
|
|
335
|
+
g(Y(r, v({
|
|
336
336
|
ref_key: "createAndNewButtonRef",
|
|
337
337
|
ref: p
|
|
338
338
|
}, {
|
|
339
339
|
...t.createAndNewButton,
|
|
340
340
|
resourceData: {
|
|
341
|
-
...(
|
|
342
|
-
...
|
|
341
|
+
...(pe = t.createAndNewButton) == null ? void 0 : pe.resourceData,
|
|
342
|
+
...h.value
|
|
343
343
|
},
|
|
344
344
|
disabled: !t.ableToCreate
|
|
345
345
|
}, {
|
|
346
346
|
disabled: !t.ableToCreate,
|
|
347
|
-
onLoading:
|
|
348
|
-
onLoaded:
|
|
349
|
-
onClick:
|
|
347
|
+
onLoading: O,
|
|
348
|
+
onLoaded: R,
|
|
349
|
+
onClick: L
|
|
350
350
|
}), null, 16, ["disabled"]), [
|
|
351
351
|
[B, t.mode === d(V).Create && A.value && t.ableToCreateAndNew]
|
|
352
352
|
]),
|
|
353
|
-
g(
|
|
353
|
+
g(Y(r, v({
|
|
354
354
|
ref_key: "dropButtonRef",
|
|
355
|
-
ref:
|
|
355
|
+
ref: ee
|
|
356
356
|
}, t.dropButton, {
|
|
357
357
|
disabled: !t.ableToDrop,
|
|
358
|
-
onLoading:
|
|
359
|
-
onLoaded:
|
|
360
|
-
onClick:
|
|
358
|
+
onLoading: O,
|
|
359
|
+
onLoaded: R,
|
|
360
|
+
onClick: J
|
|
361
361
|
}), null, 16, ["disabled"]), [
|
|
362
|
-
[B,
|
|
362
|
+
[B, ie.value && t.mode !== d(V).Create]
|
|
363
363
|
]),
|
|
364
|
-
d(
|
|
365
|
-
(n(!0), S(
|
|
364
|
+
d(D).buttons ? I(t.$slots, "buttons", { key: 4 }) : C("", !0),
|
|
365
|
+
(n(!0), S(X, null, z(t.navEndButtons, (Q) => g((n(), c(r, v({ ref_for: !0 }, Q), null, 16)), [
|
|
366
366
|
[B, !l.value]
|
|
367
367
|
])), 256)),
|
|
368
|
-
(n(!0), S(
|
|
368
|
+
(n(!0), S(X, null, z(t.navEndButtonsEditing, (Q) => g((n(), c(r, v({ ref_for: !0 }, Q), null, 16)), [
|
|
369
369
|
[B, f.value && !l.value]
|
|
370
370
|
])), 256))
|
|
371
371
|
];
|
|
372
372
|
}),
|
|
373
373
|
_: 3
|
|
374
|
-
}, 16)) : (n(), S(
|
|
375
|
-
(n(!0), S(
|
|
374
|
+
}, 16)) : (n(), S(X, { key: 2 }, [
|
|
375
|
+
(n(!0), S(X, null, z(t.navStartButtons, (b) => g((n(), c(r, v({ ref_for: !0 }, b), null, 16)), [
|
|
376
376
|
[B, !l.value]
|
|
377
377
|
])), 256)),
|
|
378
|
-
d(
|
|
378
|
+
d(D)["prev-buttons-ever"] ? g((n(), S("div", Bt, [
|
|
379
379
|
I(t.$slots, "prev-buttons-ever", {
|
|
380
380
|
canUpdate: t.canUpdate,
|
|
381
381
|
canDrop: t.canDrop,
|
|
@@ -384,10 +384,10 @@ const T = (...H) => {
|
|
|
384
384
|
], 512)), [
|
|
385
385
|
[B, !l.value]
|
|
386
386
|
]) : C("", !0),
|
|
387
|
-
(n(!0), S(
|
|
387
|
+
(n(!0), S(X, null, z(t.navStartButtonsEditing, (b) => g((n(), c(r, v({ ref_for: !0 }, b), null, 16)), [
|
|
388
388
|
[B, f.value && !l.value]
|
|
389
389
|
])), 256)),
|
|
390
|
-
d(
|
|
390
|
+
d(D)["prev-buttons"] ? g((n(), S("div", yt, [
|
|
391
391
|
I(t.$slots, "prev-buttons", {
|
|
392
392
|
canUpdate: t.canUpdate,
|
|
393
393
|
canDrop: t.canDrop,
|
|
@@ -396,91 +396,91 @@ const T = (...H) => {
|
|
|
396
396
|
], 512)), [
|
|
397
397
|
[B, f.value && !l.value]
|
|
398
398
|
]) : C("", !0),
|
|
399
|
-
g(
|
|
399
|
+
g(Y(r, v({
|
|
400
400
|
ref_key: "saveButtonRef",
|
|
401
401
|
ref: U
|
|
402
402
|
}, {
|
|
403
403
|
...t.updateButton,
|
|
404
404
|
resourceData: {
|
|
405
|
-
...(
|
|
406
|
-
...
|
|
405
|
+
...(se = t.updateButton) == null ? void 0 : se.resourceData,
|
|
406
|
+
...h.value
|
|
407
407
|
},
|
|
408
408
|
disabled: !t.ableToUpdate
|
|
409
409
|
}, {
|
|
410
|
-
onLoading:
|
|
411
|
-
onLoaded:
|
|
412
|
-
onClick:
|
|
410
|
+
onLoading: O,
|
|
411
|
+
onLoaded: R,
|
|
412
|
+
onClick: oe
|
|
413
413
|
}), null, 16), [
|
|
414
414
|
[B, t.mode === d(V).Update && A.value]
|
|
415
415
|
]),
|
|
416
|
-
g(
|
|
416
|
+
g(Y(r, v({
|
|
417
417
|
ref_key: "createButtonRef",
|
|
418
418
|
ref: m
|
|
419
419
|
}, {
|
|
420
420
|
...t.createButton,
|
|
421
421
|
resourceData: {
|
|
422
|
-
...(
|
|
423
|
-
...
|
|
422
|
+
...(W = t.createButton) == null ? void 0 : W.resourceData,
|
|
423
|
+
...h.value
|
|
424
424
|
},
|
|
425
425
|
disabled: !t.ableToCreate
|
|
426
426
|
}, {
|
|
427
|
-
onLoading:
|
|
428
|
-
onLoaded:
|
|
429
|
-
onClick:
|
|
427
|
+
onLoading: O,
|
|
428
|
+
onLoaded: R,
|
|
429
|
+
onClick: L
|
|
430
430
|
}), null, 16), [
|
|
431
431
|
[B, t.mode === d(V).Create && A.value]
|
|
432
432
|
]),
|
|
433
|
-
g(
|
|
433
|
+
g(Y(r, v({
|
|
434
434
|
ref_key: "createAndNewButtonRef",
|
|
435
435
|
ref: p
|
|
436
436
|
}, {
|
|
437
437
|
...t.createAndNewButton,
|
|
438
438
|
resourceData: {
|
|
439
|
-
...(
|
|
440
|
-
...
|
|
439
|
+
...(G = t.createAndNewButton) == null ? void 0 : G.resourceData,
|
|
440
|
+
...h.value
|
|
441
441
|
},
|
|
442
442
|
disabled: !t.ableToCreate
|
|
443
443
|
}, {
|
|
444
|
-
onLoading:
|
|
445
|
-
onLoaded:
|
|
446
|
-
onClick:
|
|
444
|
+
onLoading: O,
|
|
445
|
+
onLoaded: R,
|
|
446
|
+
onClick: L
|
|
447
447
|
}), null, 16), [
|
|
448
448
|
[B, t.mode === d(V).Create && A.value && t.ableToCreateAndNew]
|
|
449
449
|
]),
|
|
450
|
-
g(
|
|
450
|
+
g(Y(r, v({
|
|
451
451
|
ref_key: "dropButtonRef",
|
|
452
|
-
ref:
|
|
452
|
+
ref: ee
|
|
453
453
|
}, t.dropButton, {
|
|
454
454
|
disabled: !t.ableToDrop,
|
|
455
|
-
onLoading:
|
|
456
|
-
onLoaded:
|
|
457
|
-
onClick:
|
|
455
|
+
onLoading: O,
|
|
456
|
+
onLoaded: R,
|
|
457
|
+
onClick: J
|
|
458
458
|
}), null, 16, ["disabled"]), [
|
|
459
|
-
[B,
|
|
459
|
+
[B, ie.value && t.mode !== d(V).Create]
|
|
460
460
|
]),
|
|
461
|
-
d(
|
|
461
|
+
d(D).buttons ? g((n(), S("div", kt, [
|
|
462
462
|
I(t.$slots, "buttons")
|
|
463
463
|
], 512)), [
|
|
464
464
|
[B, f.value && !l.value]
|
|
465
465
|
]) : C("", !0),
|
|
466
|
-
(n(!0), S(
|
|
466
|
+
(n(!0), S(X, null, z(t.navEndButtons, (b) => g((n(), c(r, v({ ref_for: !0 }, b), null, 16)), [
|
|
467
467
|
[B, !l.value]
|
|
468
468
|
])), 256)),
|
|
469
|
-
(n(!0), S(
|
|
469
|
+
(n(!0), S(X, null, z(t.navEndButtonsEditing, (b) => g((n(), c(r, v({ ref_for: !0 }, b), null, 16)), [
|
|
470
470
|
[B, f.value && !l.value]
|
|
471
471
|
])), 256)),
|
|
472
|
-
|
|
473
|
-
type: d(
|
|
472
|
+
j.value.length > 0 ? (n(), c(r, Le(v({ key: 3 }, {
|
|
473
|
+
type: d(He).Tooltip,
|
|
474
474
|
icon: "lkt-icn-cross-arrows",
|
|
475
475
|
class: "lkt-item-crud--modifications-button",
|
|
476
|
-
splitButtons:
|
|
476
|
+
splitButtons: fe.value,
|
|
477
477
|
tooltip: {
|
|
478
478
|
contentClass: "lkt-flex-column"
|
|
479
479
|
}
|
|
480
480
|
})), null, 16)) : C("", !0),
|
|
481
|
-
|
|
481
|
+
ne.value ? (n(), c(r, v({ key: 4 }, t.editModeButton, {
|
|
482
482
|
checked: f.value,
|
|
483
|
-
"onUpdate:checked":
|
|
483
|
+
"onUpdate:checked": N[2] || (N[2] = (b) => f.value = b),
|
|
484
484
|
class: "lkt-item-crud--switch-mode-button"
|
|
485
485
|
}), null, 16, ["checked"])) : C("", !0)
|
|
486
486
|
], 64))
|
|
@@ -493,10 +493,10 @@ const T = (...H) => {
|
|
|
493
493
|
}, Ct = {
|
|
494
494
|
key: 0,
|
|
495
495
|
class: "lkt-item-crud_header-slot"
|
|
496
|
-
},
|
|
496
|
+
}, Dt = {
|
|
497
497
|
key: 1,
|
|
498
498
|
class: "lkt-item-crud_header-title"
|
|
499
|
-
},
|
|
499
|
+
}, ht = {
|
|
500
500
|
key: 2,
|
|
501
501
|
class: "lkt-item-crud_header-slot"
|
|
502
502
|
}, St = {
|
|
@@ -505,7 +505,7 @@ const T = (...H) => {
|
|
|
505
505
|
}, Ut = {
|
|
506
506
|
key: 0,
|
|
507
507
|
class: "lkt-grid-1"
|
|
508
|
-
}, Et = /* @__PURE__ */
|
|
508
|
+
}, Et = /* @__PURE__ */ Je({
|
|
509
509
|
__name: "LktItemCrud",
|
|
510
510
|
props: /* @__PURE__ */ nt({
|
|
511
511
|
modelValue: {},
|
|
@@ -564,396 +564,373 @@ const T = (...H) => {
|
|
|
564
564
|
"error",
|
|
565
565
|
"modified-data"
|
|
566
566
|
],
|
|
567
|
-
setup(
|
|
568
|
-
const a =
|
|
567
|
+
setup(P, { expose: he, emit: $e }) {
|
|
568
|
+
const a = P, i = bt(), M = Qe(), D = $e, m = s(!0), p = s(a.modelValue), U = s(a.modifications), ee = s(a.customData), l = s(a.perms), f = s(a.editing), O = s(!1), R = s(!1), L = s(!1), oe = s(!1), J = s(200), h = s(new Xe(p.value, a.dataStateConfig)), ue = s(new Xe(U.value, a.dataStateConfig)), H = s(!1), ie = s(new Xe(a.readData)), A = s(a.mode === V.Create), ne = s(!1), Se = s(!1), j = s(null), fe = s(null), t = y(() => A.value && a.createButton !== !1 && Array.isArray(l.value) && l.value.includes(Ne.Create)), N = y(() => !A.value && a.updateButton !== !1 && Array.isArray(l.value) && l.value.includes(Ne.Update)), r = y(() => !A.value && a.dropButton !== !1 && Array.isArray(l.value) && l.value.includes(Ne.Drop)), re = y(() => a.editModeButton !== !1 && !A.value && Array.isArray(l.value) && l.value.includes(Ne.SwitchEditMode)), F = s(a.visibleView);
|
|
569
569
|
w(() => a.visibleView, (e) => {
|
|
570
|
-
|
|
571
|
-
}), w(
|
|
572
|
-
|
|
570
|
+
F.value = e;
|
|
571
|
+
}), w(F, (e) => {
|
|
572
|
+
D("update:visibleView", e);
|
|
573
573
|
}), w(() => a.mode, (e) => {
|
|
574
574
|
A.value = e === V.Create;
|
|
575
575
|
}), w(() => a.perms, (e) => {
|
|
576
576
|
l.value = e;
|
|
577
577
|
}), w(l, (e) => {
|
|
578
|
-
|
|
578
|
+
D("update:perms", e);
|
|
579
579
|
}), w(() => a.customData, (e) => {
|
|
580
|
-
|
|
581
|
-
}), w(
|
|
582
|
-
|
|
580
|
+
ee.value = e;
|
|
581
|
+
}), w(ee, (e) => {
|
|
582
|
+
D("update:customData", e);
|
|
583
583
|
}), w(() => a.modifications, (e) => {
|
|
584
|
-
|
|
584
|
+
ue.value.increment(e), U.value = e;
|
|
585
585
|
}, { deep: !0 }), w(U, (e) => {
|
|
586
|
-
|
|
586
|
+
je(), ue.value.increment(e), le.value === E.Modifications && (H.value = ue.value.changed()), D("update:modifications", e);
|
|
587
587
|
}, { deep: !0 });
|
|
588
|
-
const
|
|
588
|
+
const K = s(ae(a.createButton, k.defaultCreateButton)), se = s(ae(a.createAndNewButton, a.createButton)), W = s(ae(a.updateButton, k.defaultUpdateButton)), G = s(ae(a.dropButton, k.defaultDropButton)), b = s(ae(a.editModeButton, k.defaultEditModeButton)), ve = s(ae(a.groupButton, k.defaultGroupButton));
|
|
589
589
|
w(() => a.createButton, (e) => {
|
|
590
|
-
|
|
590
|
+
K.value = ae(e, k.defaultCreateButton);
|
|
591
591
|
}, { deep: !0 }), w(() => a.updateButton, (e) => {
|
|
592
|
-
|
|
592
|
+
W.value = ae(e, k.defaultUpdateButton);
|
|
593
593
|
}, { deep: !0 }), w(() => a.dropButton, (e) => {
|
|
594
|
-
|
|
594
|
+
G.value = ae(e, k.defaultDropButton);
|
|
595
595
|
}, { deep: !0 }), w(() => a.editModeButton, (e) => {
|
|
596
|
-
b.value =
|
|
596
|
+
b.value = ae(e, k.defaultEditModeButton);
|
|
597
597
|
}, { deep: !0 });
|
|
598
|
-
const
|
|
599
|
-
var e, o,
|
|
600
|
-
T("fetchItem"), m.value = !0,
|
|
598
|
+
const pe = async () => {
|
|
599
|
+
var e, o, q;
|
|
600
|
+
T("fetchItem"), m.value = !0, J.value = -1, oe.value = !1, typeof ((e = a.events) == null ? void 0 : e.httpStart) == "function" && a.events.httpStart();
|
|
601
601
|
try {
|
|
602
|
-
const
|
|
603
|
-
if ((
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
});
|
|
608
|
-
}), T("fetchItem -> response", F), m.value = !1, Q.value = F.httpStatus, te.value = F.custom, !F.success) {
|
|
609
|
-
$.value = !1, Q.value = F.httpStatus, typeof ((N = a.events) == null ? void 0 : N.httpEnd) == "function" && a.events.httpEnd({
|
|
610
|
-
httpResponse: F
|
|
611
|
-
}), h("error", F.httpStatus);
|
|
602
|
+
const $ = await dt(a.readResource, a.readData);
|
|
603
|
+
if (T("fetchItem -> response", $), m.value = !1, J.value = $.httpStatus, ee.value = $.custom, !$.success) {
|
|
604
|
+
L.value = !1, J.value = $.httpStatus, typeof ((o = a.events) == null ? void 0 : o.httpEnd) == "function" && a.events.httpEnd({
|
|
605
|
+
httpResponse: $
|
|
606
|
+
}), D("error", $.httpStatus);
|
|
612
607
|
return;
|
|
613
608
|
}
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
})), typeof ((
|
|
617
|
-
httpResponse:
|
|
618
|
-
}),
|
|
609
|
+
L.value = !0, p.value = $.data, U.value = Array.isArray($.modifications) ? {} : $.modifications, l.value = $.perms, h.value.increment(p.value).turnStoredIntoOriginal(), ue.value.increment(U.value).turnStoredIntoOriginal(), H.value = h.value.changed(), ie.value.turnStoredIntoOriginal(), Object.keys(U.value).length > 0 && (F.value = E.Modifications), te.value && (je(), Ge(() => {
|
|
610
|
+
fe.value.turnStoredIntoOriginal();
|
|
611
|
+
})), typeof ((q = a.events) == null ? void 0 : q.httpEnd) == "function" && a.events.httpEnd({
|
|
612
|
+
httpResponse: $
|
|
613
|
+
}), D("read", $);
|
|
619
614
|
} catch {
|
|
620
|
-
m.value = !1,
|
|
615
|
+
m.value = !1, L.value = !1, J.value = 404, D("error", 404);
|
|
621
616
|
return;
|
|
622
617
|
}
|
|
623
618
|
};
|
|
624
|
-
w(
|
|
625
|
-
e &&
|
|
619
|
+
w(ne, (e) => {
|
|
620
|
+
e && Ge(() => ne.value = !1);
|
|
626
621
|
}), w(() => a.modelValue, (e) => {
|
|
627
|
-
p.value = e,
|
|
622
|
+
p.value = e, h.value.increment(e);
|
|
628
623
|
}, { deep: !0 }), w(p, (e) => {
|
|
629
624
|
if (T("item updated ->", p.value), typeof a.beforeEmitUpdate == "function") {
|
|
630
625
|
T("item updated -> has beforeEmitUpdate");
|
|
631
626
|
let o = a.beforeEmitUpdate(p.value);
|
|
632
627
|
T("item updated -> override with: ", o), typeof o == "object" && (p.value = o);
|
|
633
628
|
}
|
|
634
|
-
|
|
635
|
-
}, { deep: !0 }), w(l, () =>
|
|
636
|
-
|
|
629
|
+
te.value && je(), D("update:modelValue", p.value), T("item updated -> update dataState"), h.value.increment(e), le.value === E.Current && (H.value = h.value.changed(), T("item updated -> dataState changed")), ne.value = !0;
|
|
630
|
+
}, { deep: !0 }), w(l, () => D("perms", l.value)), w(H, (e) => {
|
|
631
|
+
D("modified-data", e);
|
|
637
632
|
}), w(() => a.readData, (e) => {
|
|
638
|
-
|
|
633
|
+
ie.value.increment(e), ie.value.changed() && pe();
|
|
639
634
|
}), w(() => a.editing, (e) => {
|
|
640
635
|
T("editing updated -> updating editMode", e), f.value = e;
|
|
641
636
|
}), w(f, (e) => {
|
|
642
|
-
T("editMode updated -> emit update", e),
|
|
637
|
+
T("editMode updated -> emit update", e), D("update:editing", e);
|
|
643
638
|
});
|
|
644
|
-
const
|
|
645
|
-
|
|
639
|
+
const Q = s(void 0), je = () => {
|
|
640
|
+
te.value && (Q.value = rt(p.value, U.value, we.value));
|
|
646
641
|
};
|
|
647
642
|
ut(() => {
|
|
648
|
-
a.readResource && !A.value ?
|
|
643
|
+
a.readResource && !A.value ? pe() : (A.value, L.value = !0, f.value = !0, m.value = !1, h.value.increment(p.value).turnStoredIntoOriginal(), H.value = h.value.changed());
|
|
649
644
|
});
|
|
650
|
-
const
|
|
645
|
+
const Fe = (e, o) => {
|
|
651
646
|
if (o) {
|
|
652
|
-
if (m.value = !1, typeof e < "u" && (
|
|
653
|
-
return
|
|
654
|
-
|
|
647
|
+
if (m.value = !1, typeof e < "u" && (J.value = e.httpStatus, !e.success))
|
|
648
|
+
return oe.value = !0, D("error", e.httpStatus), !1;
|
|
649
|
+
oe.value = !0;
|
|
655
650
|
}
|
|
656
651
|
return !0;
|
|
657
|
-
},
|
|
652
|
+
}, Ke = (e, o) => {
|
|
658
653
|
if (T("doAutoReloadId -> enter: ", e), typeof e < "u" && e.autoReloadId)
|
|
659
654
|
if (T("doAutoReloadId -> autoReloadId detected: ", e.autoReloadId), typeof o < "u") {
|
|
660
|
-
let
|
|
661
|
-
typeof o == "function" && (
|
|
662
|
-
} else
|
|
663
|
-
},
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
j.category === "toast" && ue({
|
|
667
|
-
positionX: ne.Right,
|
|
668
|
-
...j.payload
|
|
669
|
-
});
|
|
670
|
-
}), !Pe(o, G.value.resource)) {
|
|
671
|
-
a.notificationType === ve.Toast && ue({
|
|
655
|
+
let q = o;
|
|
656
|
+
typeof o == "function" && (q = o(e.autoReloadId)), i.push(q);
|
|
657
|
+
} else Ae.value ? (T("doAutoReloadId -> insideModal: ", a), mt(a.modalConfig.modalName, a.modalConfig.modalKey, e.autoReloadId)) : (T("doAutoReloadId -> outsideModal"), a.readData.id = e.autoReloadId, T("doAutoReloadId -> turning off create mode"), A.value = !1, pe());
|
|
658
|
+
}, Ue = (e, o) => {
|
|
659
|
+
if (T("onCreate"), !Fe(o, K.value.resource)) {
|
|
660
|
+
a.notificationType === de.Toast && be({
|
|
672
661
|
text: k.defaultCreateErrorText,
|
|
673
662
|
details: k.defaultCreateErrorDetails,
|
|
674
663
|
icon: k.defaultCreateErrorIcon,
|
|
675
|
-
positionX:
|
|
664
|
+
positionX: me.Right,
|
|
676
665
|
...o.toast
|
|
677
666
|
});
|
|
678
667
|
return;
|
|
679
668
|
}
|
|
680
|
-
|
|
669
|
+
Se.value = !0, T("onCreate -> turn stored data into original"), h.value.increment(p.value).turnStoredIntoOriginal(), ue.value.turnStoredIntoOriginal(), a.notificationType === de.Toast && be({
|
|
681
670
|
text: k.defaultCreateSuccessText,
|
|
682
671
|
details: k.defaultCreateSuccessDetails,
|
|
683
672
|
icon: k.defaultCreateSuccessIcon,
|
|
684
|
-
positionX:
|
|
673
|
+
positionX: me.Right,
|
|
685
674
|
...o.toast
|
|
686
|
-
}),
|
|
687
|
-
},
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
j.category === "toast" && ue({
|
|
691
|
-
positionX: ne.Right,
|
|
692
|
-
...j.payload
|
|
693
|
-
});
|
|
694
|
-
}), !Pe(o, q.value.resource)) {
|
|
695
|
-
a.notificationType === ve.Toast && ue({
|
|
675
|
+
}), Ke(o, a.redirectOnCreate), T("onCreate -> beforeEmitCreate"), D("create", o);
|
|
676
|
+
}, Ee = (e, o) => {
|
|
677
|
+
if (T("onUpdate"), !Fe(o, W.value.resource)) {
|
|
678
|
+
a.notificationType === de.Toast && be({
|
|
696
679
|
text: k.defaultUpdateErrorText,
|
|
697
680
|
details: k.defaultUpdateErrorDetails,
|
|
698
681
|
icon: k.defaultUpdateErrorIcon,
|
|
699
|
-
positionX:
|
|
682
|
+
positionX: me.Right,
|
|
700
683
|
...o.toast
|
|
701
684
|
});
|
|
702
685
|
return;
|
|
703
686
|
}
|
|
704
|
-
T("onUpdate -> turn stored data into original"),
|
|
687
|
+
T("onUpdate -> turn stored data into original"), h.value.turnStoredIntoOriginal(), ue.value.turnStoredIntoOriginal(), a.notificationType === de.Toast && be({
|
|
705
688
|
text: k.defaultUpdateSuccessText,
|
|
706
689
|
details: k.defaultUpdateSuccessDetails,
|
|
707
690
|
icon: k.defaultUpdateSuccessIcon,
|
|
708
|
-
positionX:
|
|
691
|
+
positionX: me.Right,
|
|
709
692
|
...o.toast
|
|
710
|
-
}),
|
|
711
|
-
},
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
j.category === "toast" && ue({
|
|
715
|
-
positionX: ne.Right,
|
|
716
|
-
...j.payload
|
|
717
|
-
});
|
|
718
|
-
}), !Pe(o, z.value.resource)) {
|
|
719
|
-
a.notificationType === ve.Toast && ue({
|
|
693
|
+
}), Ke(o), D("update", o);
|
|
694
|
+
}, Me = (e, o) => {
|
|
695
|
+
if (T("onDrop"), !Fe(o, G.value.resource)) {
|
|
696
|
+
a.notificationType === de.Toast && be({
|
|
720
697
|
text: k.defaultDropErrorText,
|
|
721
698
|
details: k.defaultDropErrorDetails,
|
|
722
699
|
icon: k.defaultDropErrorIcon,
|
|
723
|
-
positionX:
|
|
700
|
+
positionX: me.Right,
|
|
724
701
|
...o.toast
|
|
725
702
|
});
|
|
726
703
|
return;
|
|
727
704
|
}
|
|
728
|
-
if (a.notificationType ===
|
|
705
|
+
if (a.notificationType === de.Toast && be({
|
|
729
706
|
text: k.defaultDropSuccessText,
|
|
730
707
|
details: k.defaultDropSuccessDetails,
|
|
731
708
|
icon: k.defaultDropSuccessIcon,
|
|
732
|
-
positionX:
|
|
709
|
+
positionX: me.Right,
|
|
733
710
|
...o.toast
|
|
734
|
-
}),
|
|
735
|
-
let
|
|
736
|
-
typeof a.redirectOnDrop == "function" && (
|
|
711
|
+
}), D("drop", o), a.view === ze.Modal && (T("onDrop -> close modal"), ct(a.modalConfig.modalName, a.modalConfig.modalKey)), typeof a.redirectOnDrop < "u") {
|
|
712
|
+
let q = a.redirectOnDrop;
|
|
713
|
+
typeof a.redirectOnDrop == "function" && (q = a.redirectOnDrop()), i.push(q);
|
|
737
714
|
}
|
|
738
715
|
};
|
|
739
|
-
|
|
716
|
+
he({
|
|
740
717
|
doDrop: () => {
|
|
741
|
-
|
|
718
|
+
j.value && j.value.doDrop();
|
|
742
719
|
},
|
|
743
|
-
doRefresh:
|
|
720
|
+
doRefresh: pe,
|
|
744
721
|
doSave: () => {
|
|
745
|
-
|
|
722
|
+
j.value && j.value.doSave();
|
|
746
723
|
},
|
|
747
724
|
turnStoredDataIntoOriginal: () => {
|
|
748
|
-
|
|
725
|
+
h.value.increment(p.value).turnStoredIntoOriginal();
|
|
749
726
|
},
|
|
750
|
-
hasModifiedData: () =>
|
|
727
|
+
hasModifiedData: () => h.value.changed()
|
|
751
728
|
});
|
|
752
|
-
const
|
|
753
|
-
var e, o,
|
|
754
|
-
return
|
|
755
|
-
}),
|
|
729
|
+
const Ye = y(() => {
|
|
730
|
+
var e, o, q;
|
|
731
|
+
return ke.value ? te.value ? R.value ? (e = a.modalConfig) == null ? void 0 : e.closeConfirm : "" : le.value === E.Modifications ? ue.value.changed() ? (o = a.modalConfig) == null ? void 0 : o.closeConfirm : "" : h.value.changed() ? (q = a.modalConfig) == null ? void 0 : q.closeConfirm : "" : "";
|
|
732
|
+
}), Ze = (e) => {
|
|
756
733
|
var o;
|
|
757
734
|
if (typeof ((o = a.modalConfig) == null ? void 0 : o.beforeClose) == "function")
|
|
758
735
|
return a.modalConfig.beforeClose({
|
|
759
736
|
...e,
|
|
760
|
-
itemCreated:
|
|
737
|
+
itemCreated: Se.value
|
|
761
738
|
});
|
|
762
|
-
},
|
|
739
|
+
}, Pe = y(() => st(a.title)), _e = y(() => m.value ? !1 : Pe.value.length > 0 || !!M["post-title"]), xe = y(() => m.value ? !1 : typeof a.header == "object" && Object.keys(a.header).length > 0), Ae = y(() => a.view === ze.Modal), We = y(() => Ae.value ? "lkt-modal" : "section"), Be = y(() => {
|
|
763
740
|
var e, o;
|
|
764
|
-
if (a.mode !== V.Update || !
|
|
741
|
+
if (a.mode !== V.Update || !N.value || te.value && !O.value)
|
|
765
742
|
return !1;
|
|
766
743
|
if (!a.enabledSaveWithoutChanges) {
|
|
767
|
-
if (
|
|
768
|
-
if (!
|
|
769
|
-
} else if (!
|
|
744
|
+
if (te.value) {
|
|
745
|
+
if (!R.value) return !1;
|
|
746
|
+
} else if (!H.value)
|
|
770
747
|
return !1;
|
|
771
748
|
}
|
|
772
|
-
return typeof ((e =
|
|
749
|
+
return typeof ((e = W.value) == null ? void 0 : e.disabled) == "function" ? !W.value.disabled({
|
|
773
750
|
prop: p.value
|
|
774
|
-
}) : typeof ((o =
|
|
775
|
-
}),
|
|
751
|
+
}) : typeof ((o = W.value) == null ? void 0 : o.disabled) == "boolean" ? !W.value.disabled : !0;
|
|
752
|
+
}), ye = y(() => {
|
|
776
753
|
var e, o;
|
|
777
|
-
if (a.mode !== V.Create || !t.value ||
|
|
754
|
+
if (a.mode !== V.Create || !t.value || te.value && !O.value)
|
|
778
755
|
return !1;
|
|
779
756
|
if (!a.enabledSaveWithoutChanges) {
|
|
780
|
-
if (
|
|
781
|
-
if (!
|
|
782
|
-
} else if (!
|
|
757
|
+
if (te.value) {
|
|
758
|
+
if (!R.value) return !1;
|
|
759
|
+
} else if (!H.value)
|
|
783
760
|
return !1;
|
|
784
761
|
}
|
|
785
|
-
return typeof ((e =
|
|
762
|
+
return typeof ((e = K.value) == null ? void 0 : e.disabled) == "function" ? !K.value.disabled({
|
|
786
763
|
prop: p.value
|
|
787
|
-
}) : typeof ((o =
|
|
788
|
-
}),
|
|
764
|
+
}) : typeof ((o = K.value) == null ? void 0 : o.disabled) == "boolean" ? !K.value.disabled : !0;
|
|
765
|
+
}), Te = y(() => a.createAndNewButton !== !1 && typeof a.createAndNewButton == "object" && !Array.isArray(a.createAndNewButton) && Object.keys(a.createAndNewButton).length > 0), Ve = y(() => {
|
|
789
766
|
var e, o;
|
|
790
|
-
return r.value ? typeof ((e =
|
|
767
|
+
return r.value ? typeof ((e = G.value) == null ? void 0 : e.disabled) == "function" ? !G.value.disabled({
|
|
791
768
|
prop: p.value
|
|
792
|
-
}) : typeof ((o =
|
|
793
|
-
}),
|
|
769
|
+
}) : typeof ((o = G.value) == null ? void 0 : o.disabled) == "boolean" ? !G.value.disabled : !0 : !1;
|
|
770
|
+
}), et = y(() => We.value === "lkt-modal" ? {
|
|
794
771
|
title: a.title,
|
|
795
772
|
item: p.value,
|
|
796
773
|
...a.modalConfig,
|
|
797
|
-
beforeClose:
|
|
798
|
-
closeConfirm:
|
|
774
|
+
beforeClose: Ze,
|
|
775
|
+
closeConfirm: Ye.value,
|
|
799
776
|
headerActionsButton: a.groupButton !== !1 ? {
|
|
800
|
-
dot:
|
|
777
|
+
dot: ye.value || Be.value
|
|
801
778
|
} : !1
|
|
802
|
-
} : {}),
|
|
779
|
+
} : {}), te = y(() => typeof we.value == "object" && Object.keys(we.value).length > 0), Ie = y(() => Object.keys(U.value).length === 0 ? [] : a.modificationViews), le = y(() => Object.keys(U.value).length === 0 ? E.Current : E.Modifications), ke = y(() => t.value || N.value || r.value), tt = y(() => te.value ? vt(we.value) : []), we = y(() => typeof a.form == "function" ? a.form({
|
|
803
780
|
mode: a.mode,
|
|
804
|
-
view:
|
|
781
|
+
view: F.value,
|
|
805
782
|
item: p.value,
|
|
806
783
|
modifications: U.value,
|
|
807
784
|
editing: f.value
|
|
808
785
|
}) : a.form);
|
|
809
786
|
return (e, o) => {
|
|
810
|
-
const
|
|
811
|
-
return n(), c(it(
|
|
812
|
-
default:
|
|
813
|
-
!
|
|
787
|
+
const q = Ce("lkt-header"), $ = Ce("lkt-http-info"), at = Ce("lkt-form"), ot = Ce("lkt-loader");
|
|
788
|
+
return n(), c(it(We.value), v(et.value, { class: "lkt-item-crud" }), ce({
|
|
789
|
+
default: Z(() => [
|
|
790
|
+
!Ae.value && xe.value ? (n(), c(q, Le(v({ key: 0 }, e.header)), null, 16)) : !Ae.value && _e.value ? (n(), S("header", wt, [
|
|
814
791
|
d(M)["pre-title"] ? (n(), S("div", Ct, [
|
|
815
792
|
I(e.$slots, "pre-title", {
|
|
816
793
|
item: p.value,
|
|
817
794
|
loading: m.value
|
|
818
795
|
})
|
|
819
796
|
])) : C("", !0),
|
|
820
|
-
|
|
821
|
-
d(M)["post-title"] ? (n(), S("div",
|
|
797
|
+
Pe.value.length > 0 ? (n(), S("h1", Dt, lt(Pe.value), 1)) : C("", !0),
|
|
798
|
+
d(M)["post-title"] ? (n(), S("div", ht, [
|
|
822
799
|
I(e.$slots, "post-title", {
|
|
823
800
|
item: p.value,
|
|
824
801
|
loading: m.value
|
|
825
802
|
})
|
|
826
803
|
])) : C("", !0)
|
|
827
804
|
])) : C("", !0),
|
|
828
|
-
e.buttonNavPosition === d(
|
|
805
|
+
e.buttonNavPosition === d(Re).Top && (e.groupButton === !1 || !e.groupButtonAsModalActions) && ke.value ? (n(), c(Oe, {
|
|
829
806
|
key: 2,
|
|
830
807
|
ref_key: "buttonNav",
|
|
831
|
-
ref:
|
|
808
|
+
ref: j,
|
|
832
809
|
loading: m.value,
|
|
833
810
|
"onUpdate:loading": o[3] || (o[3] = (u) => m.value = u),
|
|
834
811
|
editing: f.value,
|
|
835
812
|
"onUpdate:editing": o[4] || (o[4] = (u) => f.value = u),
|
|
836
|
-
"picked-modification-view":
|
|
837
|
-
"onUpdate:pickedModificationView": o[5] || (o[5] = (u) =>
|
|
813
|
+
"picked-modification-view": F.value,
|
|
814
|
+
"onUpdate:pickedModificationView": o[5] || (o[5] = (u) => F.value = u),
|
|
838
815
|
item: p.value,
|
|
839
816
|
modifications: U.value,
|
|
840
817
|
mode: e.mode,
|
|
841
818
|
view: e.view,
|
|
842
819
|
grouped: e.groupButton !== !1,
|
|
843
820
|
"button-nav-visibility": e.buttonNavVisibility,
|
|
844
|
-
"create-button":
|
|
845
|
-
"create-and-new-button":
|
|
846
|
-
"update-button":
|
|
847
|
-
"drop-button":
|
|
821
|
+
"create-button": K.value,
|
|
822
|
+
"create-and-new-button": se.value,
|
|
823
|
+
"update-button": W.value,
|
|
824
|
+
"drop-button": G.value,
|
|
848
825
|
"edit-mode-button": b.value,
|
|
849
|
-
"group-button":
|
|
850
|
-
"data-changed":
|
|
851
|
-
"http-success-read":
|
|
826
|
+
"group-button": ve.value,
|
|
827
|
+
"data-changed": H.value,
|
|
828
|
+
"http-success-read": L.value,
|
|
852
829
|
"can-create": t.value,
|
|
853
|
-
"can-update":
|
|
830
|
+
"can-update": N.value,
|
|
854
831
|
"can-drop": r.value,
|
|
855
|
-
"can-switch-edit-mode":
|
|
832
|
+
"can-switch-edit-mode": re.value,
|
|
856
833
|
"group-button-as-modal-actions": e.groupButtonAsModalActions,
|
|
857
|
-
"able-to-create":
|
|
858
|
-
"able-to-create-and-new":
|
|
859
|
-
"able-to-update":
|
|
860
|
-
"able-to-drop":
|
|
834
|
+
"able-to-create": ye.value,
|
|
835
|
+
"able-to-create-and-new": Te.value,
|
|
836
|
+
"able-to-update": Be.value,
|
|
837
|
+
"able-to-drop": Ve.value,
|
|
861
838
|
perms: l.value,
|
|
862
|
-
"modification-view":
|
|
863
|
-
"editable-view":
|
|
839
|
+
"modification-view": Ie.value,
|
|
840
|
+
"editable-view": le.value,
|
|
864
841
|
"nav-start-buttons": e.navStartButtons,
|
|
865
842
|
"nav-start-buttons-editing": e.navStartButtonsEditing,
|
|
866
843
|
"nav-end-buttons": e.navEndButtons,
|
|
867
844
|
"nav-end-buttons-editing": e.navEndButtonsEditing,
|
|
868
845
|
"update-config": e.updateConfig,
|
|
869
|
-
onCreate:
|
|
870
|
-
onSave:
|
|
871
|
-
onDrop:
|
|
872
|
-
},
|
|
846
|
+
onCreate: Ue,
|
|
847
|
+
onSave: Ee,
|
|
848
|
+
onDrop: Me
|
|
849
|
+
}, ce({ _: 2 }, [
|
|
873
850
|
d(M)["prev-buttons-ever"] ? {
|
|
874
851
|
name: "prev-buttons-ever",
|
|
875
|
-
fn:
|
|
852
|
+
fn: Z(({ canUpdate: u, canDrop: _, perms: x }) => [
|
|
876
853
|
I(e.$slots, "prev-buttons-ever", {
|
|
877
854
|
canUpdate: u,
|
|
878
|
-
canDrop:
|
|
879
|
-
perms:
|
|
855
|
+
canDrop: _,
|
|
856
|
+
perms: x
|
|
880
857
|
})
|
|
881
858
|
]),
|
|
882
859
|
key: "0"
|
|
883
860
|
} : void 0,
|
|
884
861
|
d(M)["prev-buttons"] ? {
|
|
885
862
|
name: "prev-buttons",
|
|
886
|
-
fn:
|
|
863
|
+
fn: Z(({ canUpdate: u, canDrop: _, perms: x }) => [
|
|
887
864
|
I(e.$slots, "prev-buttons", {
|
|
888
865
|
canUpdate: u,
|
|
889
|
-
canDrop:
|
|
890
|
-
perms:
|
|
866
|
+
canDrop: _,
|
|
867
|
+
perms: x
|
|
891
868
|
})
|
|
892
869
|
]),
|
|
893
870
|
key: "1"
|
|
894
871
|
} : void 0
|
|
895
|
-
]), 1032, ["loading", "editing", "picked-modification-view", "item", "modifications", "mode", "view", "grouped", "button-nav-visibility", "create-button", "create-and-new-button", "update-button", "drop-button", "edit-mode-button", "group-button", "data-changed", "http-success-read", "can-create", "can-update", "can-drop", "can-switch-edit-mode", "group-button-as-modal-actions", "able-to-create", "able-to-create-and-new", "able-to-update", "able-to-drop", "perms", "modification-view", "editable-view", "nav-start-buttons", "nav-start-buttons-editing", "nav-end-buttons", "nav-end-buttons-editing", "update-config"])) :
|
|
872
|
+
]), 1032, ["loading", "editing", "picked-modification-view", "item", "modifications", "mode", "view", "grouped", "button-nav-visibility", "create-button", "create-and-new-button", "update-button", "drop-button", "edit-mode-button", "group-button", "data-changed", "http-success-read", "can-create", "can-update", "can-drop", "can-switch-edit-mode", "group-button-as-modal-actions", "able-to-create", "able-to-create-and-new", "able-to-update", "able-to-drop", "perms", "modification-view", "editable-view", "nav-start-buttons", "nav-start-buttons-editing", "nav-end-buttons", "nav-end-buttons-editing", "update-config"])) : ke.value && e.buttonNavPosition === d(Re).Hidden ? g((n(), c(Oe, {
|
|
896
873
|
key: 3,
|
|
897
874
|
ref_key: "buttonNav",
|
|
898
|
-
ref:
|
|
875
|
+
ref: j,
|
|
899
876
|
loading: m.value,
|
|
900
877
|
"onUpdate:loading": o[6] || (o[6] = (u) => m.value = u),
|
|
901
878
|
editing: f.value,
|
|
902
879
|
"onUpdate:editing": o[7] || (o[7] = (u) => f.value = u),
|
|
903
|
-
"picked-modification-view":
|
|
904
|
-
"onUpdate:pickedModificationView": o[8] || (o[8] = (u) =>
|
|
880
|
+
"picked-modification-view": F.value,
|
|
881
|
+
"onUpdate:pickedModificationView": o[8] || (o[8] = (u) => F.value = u),
|
|
905
882
|
item: p.value,
|
|
906
883
|
modifications: U.value,
|
|
907
884
|
mode: e.mode,
|
|
908
885
|
view: e.view,
|
|
909
886
|
"button-nav-visibility": e.buttonNavVisibility,
|
|
910
|
-
"create-button":
|
|
911
|
-
"create-and-new-button":
|
|
912
|
-
"update-button":
|
|
913
|
-
"drop-button":
|
|
887
|
+
"create-button": K.value,
|
|
888
|
+
"create-and-new-button": se.value,
|
|
889
|
+
"update-button": W.value,
|
|
890
|
+
"drop-button": G.value,
|
|
914
891
|
"edit-mode-button": b.value,
|
|
915
|
-
"group-button":
|
|
916
|
-
"data-changed":
|
|
917
|
-
"http-success-read":
|
|
892
|
+
"group-button": ve.value,
|
|
893
|
+
"data-changed": H.value,
|
|
894
|
+
"http-success-read": L.value,
|
|
918
895
|
"can-create": t.value,
|
|
919
|
-
"can-update":
|
|
896
|
+
"can-update": N.value,
|
|
920
897
|
"can-drop": r.value,
|
|
921
|
-
"can-switch-edit-mode":
|
|
898
|
+
"can-switch-edit-mode": re.value,
|
|
922
899
|
"group-button-as-modal-actions": e.groupButtonAsModalActions,
|
|
923
|
-
"able-to-create":
|
|
924
|
-
"able-to-create-and-new":
|
|
925
|
-
"able-to-update":
|
|
926
|
-
"able-to-drop":
|
|
900
|
+
"able-to-create": ye.value,
|
|
901
|
+
"able-to-create-and-new": Te.value,
|
|
902
|
+
"able-to-update": Be.value,
|
|
903
|
+
"able-to-drop": Ve.value,
|
|
927
904
|
perms: l.value,
|
|
928
|
-
"modification-view":
|
|
929
|
-
"editable-view":
|
|
905
|
+
"modification-view": Ie.value,
|
|
906
|
+
"editable-view": le.value,
|
|
930
907
|
"nav-start-buttons": e.navStartButtons,
|
|
931
908
|
"nav-start-buttons-editing": e.navStartButtonsEditing,
|
|
932
909
|
"nav-end-buttons": e.navEndButtons,
|
|
933
910
|
"nav-end-buttons-editing": e.navEndButtonsEditing,
|
|
934
911
|
"update-config": e.updateConfig,
|
|
935
|
-
onCreate:
|
|
936
|
-
onSave:
|
|
937
|
-
onDrop:
|
|
938
|
-
},
|
|
912
|
+
onCreate: Ue,
|
|
913
|
+
onSave: Ee,
|
|
914
|
+
onDrop: Me
|
|
915
|
+
}, ce({ _: 2 }, [
|
|
939
916
|
d(M)["prev-buttons-ever"] ? {
|
|
940
917
|
name: "prev-buttons-ever",
|
|
941
|
-
fn:
|
|
918
|
+
fn: Z(({ canUpdate: u, canDrop: _, perms: x }) => [
|
|
942
919
|
I(e.$slots, "prev-buttons-ever", {
|
|
943
920
|
canUpdate: u,
|
|
944
|
-
canDrop:
|
|
945
|
-
perms:
|
|
921
|
+
canDrop: _,
|
|
922
|
+
perms: x
|
|
946
923
|
})
|
|
947
924
|
]),
|
|
948
925
|
key: "0"
|
|
949
926
|
} : void 0,
|
|
950
927
|
d(M)["prev-buttons"] ? {
|
|
951
928
|
name: "prev-buttons",
|
|
952
|
-
fn:
|
|
929
|
+
fn: Z(({ canUpdate: u, canDrop: _, perms: x }) => [
|
|
953
930
|
I(e.$slots, "prev-buttons", {
|
|
954
931
|
canUpdate: u,
|
|
955
|
-
canDrop:
|
|
956
|
-
perms:
|
|
932
|
+
canDrop: _,
|
|
933
|
+
perms: x
|
|
957
934
|
})
|
|
958
935
|
]),
|
|
959
936
|
key: "1"
|
|
@@ -962,39 +939,39 @@ const T = (...H) => {
|
|
|
962
939
|
[B, !1]
|
|
963
940
|
]) : C("", !0),
|
|
964
941
|
m.value ? C("", !0) : (n(), S("div", St, [
|
|
965
|
-
|
|
966
|
-
|
|
942
|
+
L.value ? (n(), S("div", Ut, [
|
|
943
|
+
oe.value && e.notificationType === d(de).Inline ? (n(), c($, {
|
|
967
944
|
key: 0,
|
|
968
|
-
code:
|
|
969
|
-
palette:
|
|
945
|
+
code: J.value,
|
|
946
|
+
palette: J.value === 200 ? "success" : "danger",
|
|
970
947
|
quick: "",
|
|
971
948
|
"can-close": "",
|
|
972
|
-
onClose: o[9] || (o[9] = (u) =>
|
|
949
|
+
onClose: o[9] || (o[9] = (u) => oe.value = !1)
|
|
973
950
|
}, null, 8, ["code", "palette"])) : C("", !0),
|
|
974
|
-
|
|
951
|
+
te.value ? (n(), c(at, v({
|
|
975
952
|
key: 1,
|
|
976
953
|
ref_key: "formRef",
|
|
977
|
-
ref:
|
|
954
|
+
ref: fe,
|
|
978
955
|
modelValue: p.value,
|
|
979
956
|
"onUpdate:modelValue": o[10] || (o[10] = (u) => p.value = u),
|
|
980
957
|
modifications: U.value,
|
|
981
958
|
"onUpdate:modifications": o[11] || (o[11] = (u) => U.value = u),
|
|
982
|
-
valid:
|
|
983
|
-
"onUpdate:valid": o[12] || (o[12] = (u) =>
|
|
984
|
-
changed:
|
|
985
|
-
"onUpdate:changed": o[13] || (o[13] = (u) =>
|
|
959
|
+
valid: O.value,
|
|
960
|
+
"onUpdate:valid": o[12] || (o[12] = (u) => O.value = u),
|
|
961
|
+
changed: R.value,
|
|
962
|
+
"onUpdate:changed": o[13] || (o[13] = (u) => R.value = u)
|
|
986
963
|
}, {
|
|
987
964
|
...e.formUiConfig,
|
|
988
|
-
form:
|
|
965
|
+
form: we.value,
|
|
989
966
|
differencesTableConfig: e.differencesTableConfig,
|
|
990
|
-
visibleView:
|
|
991
|
-
modificationDataState:
|
|
992
|
-
editableViews: [
|
|
967
|
+
visibleView: F.value,
|
|
968
|
+
modificationDataState: Q.value,
|
|
969
|
+
editableViews: [le.value],
|
|
993
970
|
disabled: !f.value
|
|
994
|
-
}),
|
|
995
|
-
|
|
971
|
+
}), ce({ _: 2 }, [
|
|
972
|
+
z(tt.value, (u) => ({
|
|
996
973
|
name: u,
|
|
997
|
-
fn:
|
|
974
|
+
fn: Z(({}) => [
|
|
998
975
|
I(e.$slots, u)
|
|
999
976
|
])
|
|
1000
977
|
}))
|
|
@@ -1004,72 +981,72 @@ const T = (...H) => {
|
|
|
1004
981
|
loading: m.value,
|
|
1005
982
|
editMode: f.value,
|
|
1006
983
|
isCreate: A.value,
|
|
1007
|
-
canUpdate:
|
|
984
|
+
canUpdate: N.value,
|
|
1008
985
|
canDrop: r.value,
|
|
1009
|
-
itemBeingEdited:
|
|
986
|
+
itemBeingEdited: ne.value,
|
|
1010
987
|
perms: l.value
|
|
1011
988
|
})
|
|
1012
|
-
])) : e.notificationType === d(
|
|
989
|
+
])) : e.notificationType === d(de).Inline ? (n(), c($, {
|
|
1013
990
|
key: 1,
|
|
1014
|
-
code:
|
|
991
|
+
code: J.value
|
|
1015
992
|
}, null, 8, ["code"])) : C("", !0)
|
|
1016
993
|
])),
|
|
1017
|
-
m.value ? (n(), c(
|
|
1018
|
-
e.buttonNavPosition === d(
|
|
994
|
+
m.value ? (n(), c(ot, { key: 5 })) : C("", !0),
|
|
995
|
+
e.buttonNavPosition === d(Re).Bottom && (e.groupButton === !1 || !e.groupButtonAsModalActions) && ke.value ? (n(), c(Oe, {
|
|
1019
996
|
key: 6,
|
|
1020
997
|
ref_key: "buttonNav",
|
|
1021
|
-
ref:
|
|
998
|
+
ref: j,
|
|
1022
999
|
loading: m.value,
|
|
1023
1000
|
"onUpdate:loading": o[14] || (o[14] = (u) => m.value = u),
|
|
1024
1001
|
editing: f.value,
|
|
1025
1002
|
"onUpdate:editing": o[15] || (o[15] = (u) => f.value = u),
|
|
1026
|
-
"picked-modification-view":
|
|
1027
|
-
"onUpdate:pickedModificationView": o[16] || (o[16] = (u) =>
|
|
1003
|
+
"picked-modification-view": F.value,
|
|
1004
|
+
"onUpdate:pickedModificationView": o[16] || (o[16] = (u) => F.value = u),
|
|
1028
1005
|
item: p.value,
|
|
1029
1006
|
modifications: U.value,
|
|
1030
1007
|
mode: e.mode,
|
|
1031
1008
|
view: e.view,
|
|
1032
1009
|
grouped: e.groupButton !== !1,
|
|
1033
1010
|
"button-nav-visibility": e.buttonNavVisibility,
|
|
1034
|
-
"create-button":
|
|
1035
|
-
"create-and-new-button":
|
|
1036
|
-
"update-button":
|
|
1037
|
-
"drop-button":
|
|
1011
|
+
"create-button": K.value,
|
|
1012
|
+
"create-and-new-button": se.value,
|
|
1013
|
+
"update-button": W.value,
|
|
1014
|
+
"drop-button": G.value,
|
|
1038
1015
|
"edit-mode-button": b.value,
|
|
1039
|
-
"group-button":
|
|
1040
|
-
"data-changed":
|
|
1041
|
-
"http-success-read":
|
|
1016
|
+
"group-button": ve.value,
|
|
1017
|
+
"data-changed": H.value,
|
|
1018
|
+
"http-success-read": L.value,
|
|
1042
1019
|
"can-create": t.value,
|
|
1043
|
-
"can-update":
|
|
1020
|
+
"can-update": N.value,
|
|
1044
1021
|
"can-drop": r.value,
|
|
1045
|
-
"can-switch-edit-mode":
|
|
1022
|
+
"can-switch-edit-mode": re.value,
|
|
1046
1023
|
"group-button-as-modal-actions": e.groupButtonAsModalActions,
|
|
1047
|
-
"able-to-create":
|
|
1048
|
-
"able-to-create-and-new":
|
|
1049
|
-
"able-to-update":
|
|
1050
|
-
"able-to-drop":
|
|
1024
|
+
"able-to-create": ye.value,
|
|
1025
|
+
"able-to-create-and-new": Te.value,
|
|
1026
|
+
"able-to-update": Be.value,
|
|
1027
|
+
"able-to-drop": Ve.value,
|
|
1051
1028
|
perms: l.value,
|
|
1052
|
-
"modification-view":
|
|
1053
|
-
"editable-view":
|
|
1029
|
+
"modification-view": Ie.value,
|
|
1030
|
+
"editable-view": le.value,
|
|
1054
1031
|
"nav-start-buttons": e.navStartButtons,
|
|
1055
1032
|
"nav-start-buttons-editing": e.navStartButtonsEditing,
|
|
1056
1033
|
"nav-end-buttons": e.navEndButtons,
|
|
1057
1034
|
"nav-end-buttons-editing": e.navEndButtonsEditing,
|
|
1058
1035
|
"update-config": e.updateConfig,
|
|
1059
|
-
onCreate:
|
|
1060
|
-
onSave:
|
|
1061
|
-
onDrop:
|
|
1062
|
-
},
|
|
1036
|
+
onCreate: Ue,
|
|
1037
|
+
onSave: Ee,
|
|
1038
|
+
onDrop: Me
|
|
1039
|
+
}, ce({ _: 2 }, [
|
|
1063
1040
|
d(M)["prev-buttons-ever"] ? {
|
|
1064
1041
|
name: "prev-buttons-ever",
|
|
1065
|
-
fn:
|
|
1042
|
+
fn: Z(() => [
|
|
1066
1043
|
I(e.$slots, "prev-buttons-ever")
|
|
1067
1044
|
]),
|
|
1068
1045
|
key: "0"
|
|
1069
1046
|
} : void 0,
|
|
1070
1047
|
d(M)["prev-buttons"] ? {
|
|
1071
1048
|
name: "prev-buttons-ever",
|
|
1072
|
-
fn:
|
|
1049
|
+
fn: Z(() => [
|
|
1073
1050
|
I(e.$slots, "prev-buttons")
|
|
1074
1051
|
]),
|
|
1075
1052
|
key: "1"
|
|
@@ -1078,72 +1055,72 @@ const T = (...H) => {
|
|
|
1078
1055
|
]),
|
|
1079
1056
|
_: 2
|
|
1080
1057
|
}, [
|
|
1081
|
-
e.groupButton !== !1 && e.groupButtonAsModalActions &&
|
|
1058
|
+
e.groupButton !== !1 && e.groupButtonAsModalActions && ke.value ? {
|
|
1082
1059
|
name: "header-actions",
|
|
1083
|
-
fn:
|
|
1084
|
-
e.buttonNavPosition === d(
|
|
1060
|
+
fn: Z(() => [
|
|
1061
|
+
e.buttonNavPosition === d(Re).Top ? (n(), c(Oe, {
|
|
1085
1062
|
key: 0,
|
|
1086
1063
|
ref_key: "buttonNav",
|
|
1087
|
-
ref:
|
|
1064
|
+
ref: j,
|
|
1088
1065
|
loading: m.value,
|
|
1089
1066
|
"onUpdate:loading": o[0] || (o[0] = (u) => m.value = u),
|
|
1090
1067
|
editing: f.value,
|
|
1091
1068
|
"onUpdate:editing": o[1] || (o[1] = (u) => f.value = u),
|
|
1092
|
-
"picked-modification-view":
|
|
1093
|
-
"onUpdate:pickedModificationView": o[2] || (o[2] = (u) =>
|
|
1069
|
+
"picked-modification-view": F.value,
|
|
1070
|
+
"onUpdate:pickedModificationView": o[2] || (o[2] = (u) => F.value = u),
|
|
1094
1071
|
item: p.value,
|
|
1095
1072
|
modifications: U.value,
|
|
1096
1073
|
mode: e.mode,
|
|
1097
1074
|
view: e.view,
|
|
1098
1075
|
grouped: !0,
|
|
1099
1076
|
"button-nav-visibility": e.buttonNavVisibility,
|
|
1100
|
-
"create-button":
|
|
1101
|
-
"create-and-new-button":
|
|
1102
|
-
"update-button":
|
|
1103
|
-
"drop-button":
|
|
1077
|
+
"create-button": K.value,
|
|
1078
|
+
"create-and-new-button": se.value,
|
|
1079
|
+
"update-button": W.value,
|
|
1080
|
+
"drop-button": G.value,
|
|
1104
1081
|
"edit-mode-button": b.value,
|
|
1105
|
-
"group-button":
|
|
1106
|
-
"data-changed":
|
|
1107
|
-
"http-success-read":
|
|
1082
|
+
"group-button": ve.value,
|
|
1083
|
+
"data-changed": H.value,
|
|
1084
|
+
"http-success-read": L.value,
|
|
1108
1085
|
"can-create": t.value,
|
|
1109
|
-
"can-update":
|
|
1086
|
+
"can-update": N.value,
|
|
1110
1087
|
"can-drop": r.value,
|
|
1111
|
-
"can-switch-edit-mode":
|
|
1088
|
+
"can-switch-edit-mode": re.value,
|
|
1112
1089
|
"group-button-as-modal-actions": e.groupButtonAsModalActions,
|
|
1113
|
-
"able-to-create":
|
|
1114
|
-
"able-to-create-and-new":
|
|
1115
|
-
"able-to-update":
|
|
1116
|
-
"able-to-drop":
|
|
1090
|
+
"able-to-create": ye.value,
|
|
1091
|
+
"able-to-create-and-new": Te.value,
|
|
1092
|
+
"able-to-update": Be.value,
|
|
1093
|
+
"able-to-drop": Ve.value,
|
|
1117
1094
|
perms: l.value,
|
|
1118
|
-
"modification-view":
|
|
1119
|
-
"editable-view":
|
|
1095
|
+
"modification-view": Ie.value,
|
|
1096
|
+
"editable-view": le.value,
|
|
1120
1097
|
"nav-start-buttons": e.navStartButtons,
|
|
1121
1098
|
"nav-start-buttons-editing": e.navStartButtonsEditing,
|
|
1122
1099
|
"nav-end-buttons": e.navEndButtons,
|
|
1123
1100
|
"nav-end-buttons-editing": e.navEndButtonsEditing,
|
|
1124
1101
|
"update-config": e.updateConfig,
|
|
1125
|
-
onCreate:
|
|
1126
|
-
onSave:
|
|
1127
|
-
onDrop:
|
|
1128
|
-
},
|
|
1102
|
+
onCreate: Ue,
|
|
1103
|
+
onSave: Ee,
|
|
1104
|
+
onDrop: Me
|
|
1105
|
+
}, ce({ _: 2 }, [
|
|
1129
1106
|
d(M)["prev-buttons-ever"] ? {
|
|
1130
1107
|
name: "prev-buttons-ever",
|
|
1131
|
-
fn:
|
|
1108
|
+
fn: Z(({ canUpdate: u, canDrop: _, perms: x }) => [
|
|
1132
1109
|
I(e.$slots, "prev-buttons-ever", {
|
|
1133
1110
|
canUpdate: u,
|
|
1134
|
-
canDrop:
|
|
1135
|
-
perms:
|
|
1111
|
+
canDrop: _,
|
|
1112
|
+
perms: x
|
|
1136
1113
|
})
|
|
1137
1114
|
]),
|
|
1138
1115
|
key: "0"
|
|
1139
1116
|
} : void 0,
|
|
1140
1117
|
d(M)["prev-buttons"] ? {
|
|
1141
1118
|
name: "prev-buttons",
|
|
1142
|
-
fn:
|
|
1119
|
+
fn: Z(({ canUpdate: u, canDrop: _, perms: x }) => [
|
|
1143
1120
|
I(e.$slots, "prev-buttons", {
|
|
1144
1121
|
canUpdate: u,
|
|
1145
|
-
canDrop:
|
|
1146
|
-
perms:
|
|
1122
|
+
canDrop: _,
|
|
1123
|
+
perms: x
|
|
1147
1124
|
})
|
|
1148
1125
|
]),
|
|
1149
1126
|
key: "1"
|
|
@@ -1156,17 +1133,17 @@ const T = (...H) => {
|
|
|
1156
1133
|
};
|
|
1157
1134
|
}
|
|
1158
1135
|
}), jt = {
|
|
1159
|
-
install: (
|
|
1160
|
-
|
|
1136
|
+
install: (P, he = {}) => {
|
|
1137
|
+
P.component("lkt-item-crud") === void 0 && P.component("lkt-item-crud", Et);
|
|
1161
1138
|
}
|
|
1162
|
-
}, Ft = (
|
|
1163
|
-
|
|
1164
|
-
},
|
|
1165
|
-
|
|
1139
|
+
}, Ft = (P) => {
|
|
1140
|
+
ge.defaultSaveIcon = P;
|
|
1141
|
+
}, Pt = (P) => {
|
|
1142
|
+
ge.defaultDropIcon = P;
|
|
1166
1143
|
};
|
|
1167
1144
|
export {
|
|
1168
1145
|
$t as debugLktItemCrud,
|
|
1169
1146
|
jt as default,
|
|
1170
|
-
|
|
1147
|
+
Pt as setItemCrudDefaultDropIcon,
|
|
1171
1148
|
Ft as setItemCrudDefaultSaveIcon
|
|
1172
1149
|
};
|