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