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