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