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