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