lkt-item-crud 2.0.22 → 2.0.23
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 +242 -235
- package/dist/lib-components/LktItemCrud.vue.d.ts +7 -5
- package/package.json +1 -1
- package/src/lib-components/LktItemCrud.vue +13 -2
package/dist/build.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
declare function
|
|
2
|
-
declare namespace
|
|
3
|
-
function install(A: any,
|
|
1
|
+
declare function Et(A?: boolean): void;
|
|
2
|
+
declare namespace Ot {
|
|
3
|
+
function install(A: any, ce?: {}): void;
|
|
4
4
|
}
|
|
5
|
-
declare function
|
|
6
|
-
declare function
|
|
7
|
-
export {
|
|
5
|
+
declare function Nt(A: any): void;
|
|
6
|
+
declare function Lt(A: any): void;
|
|
7
|
+
export { Et as debugLktItemCrud, Ot as default, Nt as setItemCrudDefaultDropIcon, Lt as setItemCrudDefaultSaveIcon };
|
package/dist/build.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { defineComponent as Xe, ref as d, watch as p, useSlots as
|
|
2
|
-
import { httpCall as
|
|
1
|
+
import { defineComponent as Xe, ref as d, watch as p, useSlots as Ke, computed as g, resolveComponent as ye, createElementBlock as W, createCommentVNode as v, openBlock as c, createBlock as R, Fragment as je, renderSlot as S, withDirectives as X, mergeProps as U, normalizeProps as Ve, unref as i, createVNode as J, vShow as K, withCtx as q, mergeDefaults as Qe, nextTick as Ye, onMounted as Ze, resolveDynamicComponent as _e, createSlots as pe, createElementVNode as xe, toDisplayString as et, renderList as tt } from "vue";
|
|
2
|
+
import { httpCall as ot } from "lkt-http-client";
|
|
3
3
|
import { DataState as Te } from "lkt-data-state";
|
|
4
|
-
import { ModificationView as
|
|
5
|
-
import { closeModal as
|
|
6
|
-
import { __ as
|
|
4
|
+
import { ModificationView as k, ItemCrudMode as T, ItemCrudButtonNavVisibility as Fe, ButtonType as Ie, TablePermission as Re, ensureButtonConfig as Q, LktSettings as s, getFormDataState as at, ItemCrudView as Pe, getFormSlotKeys as nt, ItemCrudButtonNavPosition as Ae, NotificationType as _, getDefaultValues as ut, ItemCrud as it, ToastPositionX as le } from "lkt-vue-kernel";
|
|
5
|
+
import { closeModal as lt, updateModalKey as dt } from "lkt-modal";
|
|
6
|
+
import { __ as rt } from "lkt-i18n";
|
|
7
7
|
import { openToast as de } from "lkt-toast";
|
|
8
|
-
import { useRouter as
|
|
9
|
-
const
|
|
8
|
+
import { useRouter as st } from "vue-router";
|
|
9
|
+
const ve = class ve {
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
let re =
|
|
11
|
+
ve.debugEnabled = !1, ve.defaultSaveIcon = "", ve.defaultDropIcon = "";
|
|
12
|
+
let re = ve;
|
|
13
13
|
const D = (...A) => {
|
|
14
14
|
re.debugEnabled && console.info("[LktItemCrud] ", ...A);
|
|
15
|
-
},
|
|
15
|
+
}, Et = (A = !0) => {
|
|
16
16
|
re.debugEnabled = A;
|
|
17
|
-
},
|
|
17
|
+
}, pt = {
|
|
18
18
|
key: 0,
|
|
19
19
|
class: "lkt-item-crud-buttons"
|
|
20
|
-
},
|
|
20
|
+
}, vt = {
|
|
21
21
|
key: 0,
|
|
22
22
|
class: "lkt-item-crud-buttons"
|
|
23
|
-
},
|
|
23
|
+
}, ct = {
|
|
24
24
|
key: 1,
|
|
25
25
|
class: "lkt-item-crud-buttons"
|
|
26
|
-
},
|
|
26
|
+
}, ft = {
|
|
27
27
|
key: 2,
|
|
28
28
|
class: "lkt-item-crud-buttons"
|
|
29
29
|
}, Ee = /* @__PURE__ */ Xe({
|
|
@@ -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 = Ke(), 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));
|
|
@@ -81,8 +81,8 @@ const D = (...A) => {
|
|
|
81
81
|
typeof t > "u" || o("save", t, w);
|
|
82
82
|
}, L = (t, w) => {
|
|
83
83
|
typeof t > "u" || o("drop", t, w);
|
|
84
|
-
}, $ =
|
|
85
|
-
|
|
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,83 +90,83 @@ const D = (...A) => {
|
|
|
90
90
|
l.value && typeof l.value.click == "function" && l.value.click();
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
|
-
const G =
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
] : Array.isArray(n.modificationView) ? n.modificationView : []),
|
|
93
|
+
const G = g(() => !n.canDrop || n.dropButton === !1 ? !1 : !n.canUpdate && n.canDrop ? !0 : !m.value && n.editing && n.httpSuccessRead), h = g(() => n.mode === T.Create && n.createButton === !1 || n.mode === T.Update && n.updateButton === !1 || m.value ? !1 : n.editing && n.httpSuccessRead), Z = g(() => n.editModeButton === !1 || !n.canSwitchEditMode || !n.canUpdate && !n.canDrop || !n.canUpdate && n.canDrop ? !1 : !m.value && n.mode !== T.Create && n.httpSuccessRead), H = g(() => n.buttonNavVisibility === Fe.Always || f["prev-buttons-ever"] ? !0 : n.buttonNavVisibility === Fe.Never ? !1 : h.value || G.value || Z.value), j = 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 j.value.includes(
|
|
100
|
+
return j.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
|
-
}), j.value.includes(
|
|
109
|
+
}), j.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
|
-
}), j.value.includes(
|
|
118
|
+
}), j.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
|
-
}), j.value.includes(
|
|
127
|
+
}), j.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
138
|
return (t, w) => {
|
|
139
139
|
var ie, N, F, P;
|
|
140
|
-
const
|
|
141
|
-
return
|
|
142
|
-
t.grouped && t.groupButtonAsModalActions ? (c(),
|
|
143
|
-
Z.value ? (c(), R(
|
|
140
|
+
const y = ye("lkt-button");
|
|
141
|
+
return H.value ? (c(), W("div", pt, [
|
|
142
|
+
t.grouped && t.groupButtonAsModalActions ? (c(), W(je, { key: 0 }, [
|
|
143
|
+
Z.value ? (c(), R(y, U({ key: 0 }, t.editModeButton, {
|
|
144
144
|
checked: E.value,
|
|
145
145
|
"onUpdate:checked": w[0] || (w[0] = (M) => E.value = M),
|
|
146
146
|
class: "lkt-item-crud--switch-mode-button"
|
|
147
147
|
}), null, 16, ["checked"])) : v("", !0),
|
|
148
|
-
j.value.length > 0 ? (c(), R(
|
|
149
|
-
type:
|
|
148
|
+
j.value.length > 0 ? (c(), R(y, Ve(U({ key: 1 }, {
|
|
149
|
+
type: i(Ie).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"] ? S(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"] ? S(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
|
-
X(
|
|
169
|
+
X(J(y, U({
|
|
170
170
|
ref_key: "saveButtonRef",
|
|
171
171
|
ref: r
|
|
172
172
|
}, {
|
|
@@ -181,9 +181,9 @@ const D = (...A) => {
|
|
|
181
181
|
onLoaded: B,
|
|
182
182
|
onClick: x
|
|
183
183
|
}), null, 16), [
|
|
184
|
-
[
|
|
184
|
+
[K, t.mode === i(T).Update && h.value]
|
|
185
185
|
]),
|
|
186
|
-
X(
|
|
186
|
+
X(J(y, U({
|
|
187
187
|
ref_key: "saveButtonRef",
|
|
188
188
|
ref: r
|
|
189
189
|
}, {
|
|
@@ -198,9 +198,9 @@ const D = (...A) => {
|
|
|
198
198
|
onLoaded: B,
|
|
199
199
|
onClick: Y
|
|
200
200
|
}), null, 16), [
|
|
201
|
-
[
|
|
201
|
+
[K, t.mode === i(T).Create && h.value]
|
|
202
202
|
]),
|
|
203
|
-
X(
|
|
203
|
+
X(J(y, U({
|
|
204
204
|
ref_key: "dropButtonRef",
|
|
205
205
|
ref: l
|
|
206
206
|
}, t.dropButton, {
|
|
@@ -209,43 +209,43 @@ const D = (...A) => {
|
|
|
209
209
|
onLoaded: B,
|
|
210
210
|
onClick: L
|
|
211
211
|
}), null, 16, ["disabled"]), [
|
|
212
|
-
[
|
|
212
|
+
[K, G.value && t.mode !== i(T).Create]
|
|
213
213
|
]),
|
|
214
|
-
|
|
215
|
-
], 64)) : t.grouped ? (c(), R(
|
|
214
|
+
i(f).buttons ? S(t.$slots, "buttons", { key: 4 }) : v("", !0)
|
|
215
|
+
], 64)) : t.grouped ? (c(), R(y, U({
|
|
216
216
|
key: 1,
|
|
217
217
|
ref: "groupButton"
|
|
218
218
|
}, t.groupButton, { class: "lkt-item-crud-group-button" }), {
|
|
219
|
-
split:
|
|
219
|
+
split: q(() => {
|
|
220
220
|
var M, ee;
|
|
221
221
|
return [
|
|
222
|
-
Z.value ? (c(), R(
|
|
222
|
+
Z.value ? (c(), R(y, U({ key: 0 }, t.editModeButton, {
|
|
223
223
|
checked: E.value,
|
|
224
224
|
"onUpdate:checked": w[1] || (w[1] = (se) => E.value = se),
|
|
225
225
|
class: "lkt-item-crud--switch-mode-button"
|
|
226
226
|
}), null, 16, ["checked"])) : v("", !0),
|
|
227
|
-
j.value.length > 0 ? (c(), R(
|
|
228
|
-
type:
|
|
227
|
+
j.value.length > 0 ? (c(), R(y, Ve(U({ key: 1 }, {
|
|
228
|
+
type: i(Ie).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"] ? S(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"] ? S(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
|
-
X(
|
|
248
|
+
X(J(y, U({
|
|
249
249
|
ref_key: "saveButtonRef",
|
|
250
250
|
ref: r
|
|
251
251
|
}, {
|
|
@@ -260,9 +260,9 @@ const D = (...A) => {
|
|
|
260
260
|
onLoaded: B,
|
|
261
261
|
onClick: x
|
|
262
262
|
}), null, 16), [
|
|
263
|
-
[
|
|
263
|
+
[K, t.mode === i(T).Update && h.value]
|
|
264
264
|
]),
|
|
265
|
-
X(
|
|
265
|
+
X(J(y, U({
|
|
266
266
|
ref_key: "saveButtonRef",
|
|
267
267
|
ref: r
|
|
268
268
|
}, {
|
|
@@ -278,9 +278,9 @@ const D = (...A) => {
|
|
|
278
278
|
onLoaded: B,
|
|
279
279
|
onClick: Y
|
|
280
280
|
}), null, 16, ["disabled"]), [
|
|
281
|
-
[
|
|
281
|
+
[K, t.mode === i(T).Create && h.value]
|
|
282
282
|
]),
|
|
283
|
-
X(
|
|
283
|
+
X(J(y, U({
|
|
284
284
|
ref_key: "dropButtonRef",
|
|
285
285
|
ref: l
|
|
286
286
|
}, t.dropButton, {
|
|
@@ -289,32 +289,32 @@ const D = (...A) => {
|
|
|
289
289
|
onLoaded: B,
|
|
290
290
|
onClick: L
|
|
291
291
|
}), null, 16, ["disabled"]), [
|
|
292
|
-
[
|
|
292
|
+
[K, G.value && t.mode !== i(T).Create]
|
|
293
293
|
]),
|
|
294
|
-
|
|
294
|
+
i(f).buttons ? S(t.$slots, "buttons", { key: 4 }) : v("", !0)
|
|
295
295
|
];
|
|
296
296
|
}),
|
|
297
297
|
_: 3
|
|
298
|
-
}, 16)) : (c(),
|
|
299
|
-
|
|
300
|
-
|
|
298
|
+
}, 16)) : (c(), W(je, { key: 2 }, [
|
|
299
|
+
i(f)["prev-buttons-ever"] ? X((c(), W("div", vt, [
|
|
300
|
+
S(t.$slots, "prev-buttons-ever", {
|
|
301
301
|
canUpdate: t.canUpdate,
|
|
302
302
|
canDrop: t.canDrop,
|
|
303
303
|
perms: t.perms
|
|
304
304
|
})
|
|
305
305
|
], 512)), [
|
|
306
|
-
[
|
|
306
|
+
[K, !m.value]
|
|
307
307
|
]) : v("", !0),
|
|
308
|
-
|
|
309
|
-
|
|
308
|
+
i(f)["prev-buttons"] ? X((c(), W("div", ct, [
|
|
309
|
+
S(t.$slots, "prev-buttons", {
|
|
310
310
|
canUpdate: t.canUpdate,
|
|
311
311
|
canDrop: t.canDrop,
|
|
312
312
|
perms: t.perms
|
|
313
313
|
})
|
|
314
314
|
], 512)), [
|
|
315
|
-
[
|
|
315
|
+
[K, E.value && !m.value]
|
|
316
316
|
]) : v("", !0),
|
|
317
|
-
X(
|
|
317
|
+
X(J(y, U({
|
|
318
318
|
ref_key: "saveButtonRef",
|
|
319
319
|
ref: r
|
|
320
320
|
}, {
|
|
@@ -329,9 +329,9 @@ const D = (...A) => {
|
|
|
329
329
|
onLoaded: B,
|
|
330
330
|
onClick: x
|
|
331
331
|
}), null, 16), [
|
|
332
|
-
[
|
|
332
|
+
[K, t.mode === i(T).Update && h.value]
|
|
333
333
|
]),
|
|
334
|
-
X(
|
|
334
|
+
X(J(y, U({
|
|
335
335
|
ref_key: "saveButtonRef",
|
|
336
336
|
ref: r
|
|
337
337
|
}, {
|
|
@@ -346,9 +346,9 @@ const D = (...A) => {
|
|
|
346
346
|
onLoaded: B,
|
|
347
347
|
onClick: Y
|
|
348
348
|
}), null, 16), [
|
|
349
|
-
[
|
|
349
|
+
[K, t.mode === i(T).Create && h.value]
|
|
350
350
|
]),
|
|
351
|
-
X(
|
|
351
|
+
X(J(y, U({
|
|
352
352
|
ref_key: "dropButtonRef",
|
|
353
353
|
ref: l
|
|
354
354
|
}, t.dropButton, {
|
|
@@ -357,23 +357,23 @@ const D = (...A) => {
|
|
|
357
357
|
onLoaded: B,
|
|
358
358
|
onClick: L
|
|
359
359
|
}), null, 16, ["disabled"]), [
|
|
360
|
-
[
|
|
360
|
+
[K, G.value && t.mode !== i(T).Create]
|
|
361
361
|
]),
|
|
362
|
-
|
|
363
|
-
|
|
362
|
+
i(f).buttons ? X((c(), W("div", ft, [
|
|
363
|
+
S(t.$slots, "buttons")
|
|
364
364
|
], 512)), [
|
|
365
|
-
[
|
|
365
|
+
[K, E.value && !m.value]
|
|
366
366
|
]) : v("", !0),
|
|
367
|
-
j.value.length > 0 ? (c(), R(
|
|
368
|
-
type:
|
|
367
|
+
j.value.length > 0 ? (c(), R(y, Ve(U({ key: 3 }, {
|
|
368
|
+
type: i(Ie).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
|
-
Z.value ? (c(), R(
|
|
376
|
+
Z.value ? (c(), R(y, U({ key: 4 }, t.editModeButton, {
|
|
377
377
|
checked: E.value,
|
|
378
378
|
"onUpdate:checked": w[2] || (w[2] = (M) => E.value = M),
|
|
379
379
|
class: "lkt-item-crud--switch-mode-button"
|
|
@@ -382,27 +382,27 @@ const D = (...A) => {
|
|
|
382
382
|
])) : v("", !0);
|
|
383
383
|
};
|
|
384
384
|
}
|
|
385
|
-
}),
|
|
385
|
+
}), mt = { class: "lkt-item-crud" }, bt = {
|
|
386
386
|
key: 0,
|
|
387
387
|
class: "lkt-item-crud_header"
|
|
388
|
-
},
|
|
388
|
+
}, gt = {
|
|
389
389
|
key: 0,
|
|
390
390
|
class: "lkt-item-crud_header-slot"
|
|
391
|
-
},
|
|
391
|
+
}, yt = {
|
|
392
392
|
key: 1,
|
|
393
393
|
class: "lkt-item-crud_header-title"
|
|
394
|
-
},
|
|
394
|
+
}, kt = {
|
|
395
395
|
key: 2,
|
|
396
396
|
class: "lkt-item-crud_header-slot"
|
|
397
|
-
},
|
|
397
|
+
}, Bt = {
|
|
398
398
|
key: 2,
|
|
399
399
|
class: "lkt-item-crud_content"
|
|
400
|
-
},
|
|
400
|
+
}, Ct = {
|
|
401
401
|
key: 0,
|
|
402
402
|
class: "lkt-grid-1"
|
|
403
|
-
},
|
|
403
|
+
}, Dt = /* @__PURE__ */ Xe({
|
|
404
404
|
__name: "LktItemCrud",
|
|
405
|
-
props: /* @__PURE__ */
|
|
405
|
+
props: /* @__PURE__ */ Qe({
|
|
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
|
+
}, ut(it)),
|
|
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 = st(), C = Ke(), 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), Y = d(!1), x = d(!1), L = d(!1), $ = d(!1), z = d(200), I = d(new Te(l.value, o.dataStateConfig)), G = d(new Te(m.value, o.dataStateConfig)), h = d(!1), Z = d(new Te(o.readData)), H = d(o.mode === T.Create), j = d(!1), ue = d(!1), t = d(null), w = g(() => !H.value && Array.isArray(b.value) && b.value.includes(Re.Update)), y = g(() => !H.value && Array.isArray(b.value) && b.value.includes(Re.Drop)), ie = g(() => !H.value && Array.isArray(b.value) && b.value.includes(Re.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
|
+
H.value = e === T.Create;
|
|
463
463
|
}), p(() => o.perms, (e) => {
|
|
464
464
|
b.value = e;
|
|
465
465
|
}), p(b, (e) => {
|
|
@@ -471,39 +471,39 @@ const D = (...A) => {
|
|
|
471
471
|
}), p(() => o.modifications, (e) => {
|
|
472
472
|
G.value.increment(e), m.value = e;
|
|
473
473
|
}, { deep: !0 }), p(m, (e) => {
|
|
474
|
-
Le(), G.value.increment(e),
|
|
474
|
+
Le(), G.value.increment(e), oe.value === k.Modifications && (h.value = G.value.changed()), f("update:modifications", e);
|
|
475
475
|
}, { deep: !0 });
|
|
476
|
-
const F = d(
|
|
476
|
+
const F = d(Q(o.createButton, s.defaultCreateButton)), P = d(Q(o.updateButton, s.defaultUpdateButton)), M = d(Q(o.dropButton, s.defaultDropButton)), ee = d(Q(o.editModeButton, s.defaultEditModeButton)), se = d(Q(o.groupButton, s.defaultGroupButton));
|
|
477
477
|
p(() => o.createButton, (e) => {
|
|
478
|
-
F.value =
|
|
478
|
+
F.value = Q(e, s.defaultCreateButton);
|
|
479
479
|
}, { deep: !0 }), p(() => o.updateButton, (e) => {
|
|
480
|
-
P.value =
|
|
480
|
+
P.value = Q(e, s.defaultUpdateButton);
|
|
481
481
|
}, { deep: !0 }), p(() => o.dropButton, (e) => {
|
|
482
|
-
M.value =
|
|
482
|
+
M.value = Q(e, s.defaultDropButton);
|
|
483
483
|
}, { deep: !0 }), p(() => o.editModeButton, (e) => {
|
|
484
|
-
ee.value =
|
|
484
|
+
ee.value = Q(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, z.value = -1, $.value = !1, typeof ((e = o.events) == null ? void 0 : e.httpStart) == "function" && o.events.httpStart();
|
|
489
489
|
try {
|
|
490
|
-
const V = await
|
|
491
|
-
if (D("fetchItem -> response", V), r.value = !1,
|
|
492
|
-
L.value = !1,
|
|
490
|
+
const V = await ot(o.readResource, o.readData);
|
|
491
|
+
if (D("fetchItem -> response", V), r.value = !1, z.value = V.httpStatus, E.value = V.custom, !V.success) {
|
|
492
|
+
L.value = !1, z.value = V.httpStatus, typeof ((a = o.events) == null ? void 0 : a.httpEnd) == "function" && o.events.httpEnd({
|
|
493
493
|
httpResponse: V
|
|
494
494
|
}), f("error", V.httpStatus);
|
|
495
495
|
return;
|
|
496
496
|
}
|
|
497
|
-
L.value = !0, l.value = V.data, m.value = Array.isArray(V.modifications) ? {} : V.modifications, b.value = V.perms, I.value.increment(l.value).turnStoredIntoOriginal(), G.value.increment(m.value).turnStoredIntoOriginal(), h.value = I.value.changed(), Z.value.turnStoredIntoOriginal(), Object.keys(m.value).length > 0 && (N.value =
|
|
497
|
+
L.value = !0, l.value = V.data, m.value = Array.isArray(V.modifications) ? {} : V.modifications, b.value = V.perms, I.value.increment(l.value).turnStoredIntoOriginal(), G.value.increment(m.value).turnStoredIntoOriginal(), h.value = I.value.changed(), Z.value.turnStoredIntoOriginal(), Object.keys(m.value).length > 0 && (N.value = k.Modifications), typeof ((O = o.events) == null ? void 0 : O.httpEnd) == "function" && o.events.httpEnd({
|
|
498
498
|
httpResponse: V
|
|
499
499
|
}), f("read", V);
|
|
500
500
|
} catch {
|
|
501
|
-
r.value = !1, L.value = !1,
|
|
501
|
+
r.value = !1, L.value = !1, z.value = 404, f("error", 404);
|
|
502
502
|
return;
|
|
503
503
|
}
|
|
504
504
|
};
|
|
505
505
|
p(j, (e) => {
|
|
506
|
-
e &&
|
|
506
|
+
e && Ye(() => j.value = !1);
|
|
507
507
|
}), p(() => o.modelValue, (e) => {
|
|
508
508
|
l.value = e, I.value.increment(e);
|
|
509
509
|
}, { deep: !0 }), p(l, (e) => {
|
|
@@ -512,25 +512,25 @@ const D = (...A) => {
|
|
|
512
512
|
let a = o.beforeEmitUpdate(l.value);
|
|
513
513
|
D("item updated -> override with: ", a), typeof a == "object" && (l.value = a);
|
|
514
514
|
}
|
|
515
|
-
|
|
515
|
+
te.value && Le(), f("update:modelValue", l.value), D("item updated -> update dataState"), I.value.increment(e), oe.value === k.Current && (h.value = I.value.changed()), j.value = !0;
|
|
516
516
|
}, { deep: !0 }), p(b, () => f("perms", b.value)), p(h, (e) => {
|
|
517
517
|
f("modified-data", e);
|
|
518
518
|
}), p(() => o.readData, (e) => {
|
|
519
|
-
Z.value.increment(e), Z.value.changed() &&
|
|
519
|
+
Z.value.increment(e), Z.value.changed() && fe();
|
|
520
520
|
}), p(() => o.editing, (e) => {
|
|
521
521
|
D("editing updated -> updating editMode", e), B.value = e;
|
|
522
522
|
}), p(B, (e) => {
|
|
523
523
|
D("editMode updated -> emit update", e), f("update:editing", e);
|
|
524
524
|
});
|
|
525
525
|
const Oe = d(void 0), Le = () => {
|
|
526
|
-
|
|
526
|
+
te.value && (Oe.value = at(l.value, m.value, o.form));
|
|
527
527
|
};
|
|
528
|
-
|
|
529
|
-
o.readResource && !
|
|
528
|
+
Ze(() => {
|
|
529
|
+
o.readResource && !H.value ? fe() : (H.value, L.value = !0, B.value = !0, r.value = !1, I.value.increment(l.value).turnStoredIntoOriginal(), h.value = I.value.changed());
|
|
530
530
|
});
|
|
531
531
|
const Be = (e, a) => {
|
|
532
532
|
if (a) {
|
|
533
|
-
if (r.value = !1, typeof e < "u" && (
|
|
533
|
+
if (r.value = !1, typeof e < "u" && (z.value = e.httpStatus, !e.success))
|
|
534
534
|
return $.value = !0, f("error", e.httpStatus), !1;
|
|
535
535
|
$.value = !0;
|
|
536
536
|
}
|
|
@@ -540,7 +540,7 @@ const D = (...A) => {
|
|
|
540
540
|
if (D("doAutoReloadId -> autoReloadId detected: ", e.autoReloadId), typeof a < "u") {
|
|
541
541
|
let O = a;
|
|
542
542
|
typeof a == "function" && (O = a(e.autoReloadId)), n.push(O);
|
|
543
|
-
} else Se.value ? (D("doAutoReloadId -> insideModal: ", o),
|
|
543
|
+
} else Se.value ? (D("doAutoReloadId -> insideModal: ", o), dt(o.modalConfig.modalName, o.modalConfig.modalKey, e.autoReloadId)) : (D("doAutoReloadId -> outsideModal"), o.readData.id = e.autoReloadId, D("doAutoReloadId -> turning off create mode"), H.value = !1, fe());
|
|
544
544
|
}, Ce = (e, a) => {
|
|
545
545
|
if (D("onCreate"), !Be(a, F.value.resource)) {
|
|
546
546
|
o.notificationType === _.Toast && de({
|
|
@@ -551,7 +551,7 @@ const D = (...A) => {
|
|
|
551
551
|
});
|
|
552
552
|
return;
|
|
553
553
|
}
|
|
554
|
-
|
|
554
|
+
ue.value = !0, D("onCreate -> turn stored data into original"), I.value.increment(l.value).turnStoredIntoOriginal(), o.notificationType === _.Toast && de({
|
|
555
555
|
text: s.defaultCreateSuccessText,
|
|
556
556
|
details: s.defaultCreateSuccessDetails,
|
|
557
557
|
icon: s.defaultCreateSuccessIcon,
|
|
@@ -588,16 +588,16 @@ const D = (...A) => {
|
|
|
588
588
|
details: s.defaultDropSuccessDetails,
|
|
589
589
|
icon: s.defaultDropSuccessIcon,
|
|
590
590
|
positionX: le.Right
|
|
591
|
-
}), f("drop", a), o.view === Pe.Modal && (D("onDrop -> close modal"),
|
|
591
|
+
}), f("drop", a), o.view === Pe.Modal && (D("onDrop -> close modal"), lt(o.modalConfig.modalName, o.modalConfig.modalKey)), typeof o.redirectOnDrop < "u") {
|
|
592
592
|
let O = o.redirectOnDrop;
|
|
593
593
|
typeof o.redirectOnDrop == "function" && (O = o.redirectOnDrop()), n.push(O);
|
|
594
594
|
}
|
|
595
595
|
};
|
|
596
|
-
|
|
596
|
+
ce({
|
|
597
597
|
doDrop: () => {
|
|
598
598
|
t.value && t.value.doDrop();
|
|
599
599
|
},
|
|
600
|
-
doRefresh:
|
|
600
|
+
doRefresh: fe,
|
|
601
601
|
doSave: () => {
|
|
602
602
|
t.value && t.value.doSave();
|
|
603
603
|
},
|
|
@@ -606,71 +606,71 @@ const D = (...A) => {
|
|
|
606
606
|
},
|
|
607
607
|
hasModifiedData: () => I.value.changed()
|
|
608
608
|
});
|
|
609
|
-
const
|
|
609
|
+
const We = g(() => {
|
|
610
610
|
var e, a, O;
|
|
611
|
-
return
|
|
612
|
-
}),
|
|
611
|
+
return ge.value ? te.value ? x.value ? (e = o.modalConfig) == null ? void 0 : e.closeConfirm : "" : oe.value === k.Modifications ? G.value.changed() ? (a = o.modalConfig) == null ? void 0 : a.closeConfirm : "" : I.value.changed() ? (O = o.modalConfig) == null ? void 0 : O.closeConfirm : "" : "";
|
|
612
|
+
}), He = (e) => {
|
|
613
613
|
var a;
|
|
614
614
|
if (typeof ((a = o.modalConfig) == null ? void 0 : a.beforeClose) == "function")
|
|
615
615
|
return o.modalConfig.beforeClose({
|
|
616
616
|
...e,
|
|
617
|
-
itemCreated:
|
|
617
|
+
itemCreated: ue.value
|
|
618
618
|
});
|
|
619
|
-
}, we =
|
|
619
|
+
}, we = g(() => o.title.startsWith("__:") ? String(rt(o.title.substring(3))) : o.title), Ge = g(() => r.value ? !1 : we.value.length > 0 || !!C["post-title"]), Se = g(() => o.view === Pe.Modal), $e = g(() => Se.value ? "lkt-modal" : "section"), me = g(() => {
|
|
620
620
|
var e, a;
|
|
621
|
-
return o.mode !== T.Update || !w.value || !o.enabledSaveWithoutChanges && !h.value ||
|
|
621
|
+
return o.mode !== T.Update || !w.value || !o.enabledSaveWithoutChanges && !h.value || te.value && !Y.value ? !1 : typeof ((e = P.value) == null ? void 0 : e.disabled) == "function" ? !P.value.disabled({
|
|
622
622
|
prop: l.value
|
|
623
623
|
}) : typeof ((a = P.value) == null ? void 0 : a.disabled) == "boolean" ? !P.value.disabled : !0;
|
|
624
|
-
}),
|
|
624
|
+
}), be = g(() => {
|
|
625
625
|
var e, a;
|
|
626
|
-
return o.mode !== T.Create || !o.enabledSaveWithoutChanges && !h.value ||
|
|
626
|
+
return o.mode !== T.Create || !o.enabledSaveWithoutChanges && !h.value || te.value && !Y.value ? !1 : typeof ((e = F.value) == null ? void 0 : e.disabled) == "function" ? !F.value.disabled({
|
|
627
627
|
prop: l.value
|
|
628
628
|
}) : typeof ((a = F.value) == null ? void 0 : a.disabled) == "boolean" ? !F.value.disabled : !0;
|
|
629
|
-
}), Ue =
|
|
629
|
+
}), Ue = g(() => {
|
|
630
630
|
var e, a;
|
|
631
|
-
return
|
|
631
|
+
return y.value ? typeof ((e = M.value) == null ? void 0 : e.disabled) == "function" ? !M.value.disabled({
|
|
632
632
|
prop: l.value
|
|
633
633
|
}) : typeof ((a = M.value) == null ? void 0 : a.disabled) == "boolean" ? !M.value.disabled : !0 : !1;
|
|
634
|
-
}), qe =
|
|
634
|
+
}), qe = g(() => $e.value === "lkt-modal" ? {
|
|
635
635
|
title: o.title,
|
|
636
636
|
item: l.value,
|
|
637
637
|
...o.modalConfig,
|
|
638
|
-
beforeClose:
|
|
639
|
-
closeConfirm:
|
|
638
|
+
beforeClose: He,
|
|
639
|
+
closeConfirm: We.value,
|
|
640
640
|
headerActionsButton: o.groupButton !== !1 ? {
|
|
641
|
-
dot:
|
|
641
|
+
dot: be.value || me.value
|
|
642
642
|
} : !1
|
|
643
|
-
} : {}),
|
|
643
|
+
} : {}), te = g(() => typeof o.form == "object" && Object.keys(o.form).length > 0), Me = g(() => Object.keys(m.value).length === 0 ? [] : o.modificationViews), oe = g(() => Object.keys(m.value).length === 0 ? k.Current : k.Modifications), ge = g(() => H.value || w.value || y.value), ze = g(() => te.value ? nt(o.form) : []);
|
|
644
644
|
return (e, a) => {
|
|
645
|
-
const O = ye("lkt-http-info"), V = ye("lkt-form"),
|
|
646
|
-
return c(), R(
|
|
647
|
-
default:
|
|
648
|
-
|
|
649
|
-
!Se.value && Ge.value ? (c(),
|
|
650
|
-
|
|
651
|
-
|
|
645
|
+
const O = ye("lkt-http-info"), V = ye("lkt-form"), Je = ye("lkt-loader");
|
|
646
|
+
return c(), R(_e($e.value), U(qe.value, { class: "lkt-item-crud" }), pe({
|
|
647
|
+
default: q(() => [
|
|
648
|
+
xe("article", mt, [
|
|
649
|
+
!Se.value && Ge.value ? (c(), W("header", bt, [
|
|
650
|
+
i(C)["pre-title"] ? (c(), W("div", gt, [
|
|
651
|
+
S(e.$slots, "pre-title", {
|
|
652
652
|
item: l.value,
|
|
653
653
|
loading: r.value
|
|
654
654
|
})
|
|
655
655
|
])) : v("", !0),
|
|
656
|
-
we.value.length > 0 ? (c(),
|
|
657
|
-
|
|
658
|
-
|
|
656
|
+
we.value.length > 0 ? (c(), W("h1", yt, et(we.value), 1)) : v("", !0),
|
|
657
|
+
i(C)["post-title"] ? (c(), W("div", kt, [
|
|
658
|
+
S(e.$slots, "post-title", {
|
|
659
659
|
item: l.value,
|
|
660
660
|
loading: r.value
|
|
661
661
|
})
|
|
662
662
|
])) : v("", !0)
|
|
663
663
|
])) : v("", !0),
|
|
664
|
-
e.buttonNavPosition ===
|
|
664
|
+
e.buttonNavPosition === i(Ae).Top && (e.groupButton === !1 || !e.groupButtonAsModalActions) && ge.value ? (c(), R(Ee, {
|
|
665
665
|
key: 1,
|
|
666
666
|
ref_key: "buttonNav",
|
|
667
667
|
ref: t,
|
|
668
668
|
loading: r.value,
|
|
669
|
-
"onUpdate:loading": a[3] || (a[3] = (
|
|
669
|
+
"onUpdate:loading": a[3] || (a[3] = (u) => r.value = u),
|
|
670
670
|
editing: B.value,
|
|
671
|
-
"onUpdate:editing": a[4] || (a[4] = (
|
|
671
|
+
"onUpdate:editing": a[4] || (a[4] = (u) => B.value = u),
|
|
672
672
|
"picked-modification-view": N.value,
|
|
673
|
-
"onUpdate:pickedModificationView": a[5] || (a[5] = (
|
|
673
|
+
"onUpdate:pickedModificationView": a[5] || (a[5] = (u) => N.value = u),
|
|
674
674
|
item: l.value,
|
|
675
675
|
modifications: m.value,
|
|
676
676
|
mode: e.mode,
|
|
@@ -685,97 +685,104 @@ const D = (...A) => {
|
|
|
685
685
|
"data-changed": h.value,
|
|
686
686
|
"http-success-read": L.value,
|
|
687
687
|
"can-update": w.value,
|
|
688
|
-
"can-drop":
|
|
688
|
+
"can-drop": y.value,
|
|
689
689
|
"can-switch-edit-mode": ie.value,
|
|
690
690
|
"group-button-as-modal-actions": e.groupButtonAsModalActions,
|
|
691
|
-
"able-to-create":
|
|
692
|
-
"able-to-update":
|
|
691
|
+
"able-to-create": be.value,
|
|
692
|
+
"able-to-update": me.value,
|
|
693
693
|
"able-to-drop": Ue.value,
|
|
694
694
|
perms: b.value,
|
|
695
695
|
"modification-view": Me.value,
|
|
696
|
-
"editable-view":
|
|
696
|
+
"editable-view": oe.value,
|
|
697
697
|
onCreate: Ce,
|
|
698
698
|
onSave: De,
|
|
699
699
|
onDrop: he
|
|
700
|
-
},
|
|
701
|
-
|
|
700
|
+
}, pe({ _: 2 }, [
|
|
701
|
+
i(C)["prev-buttons-ever"] ? {
|
|
702
702
|
name: "prev-buttons-ever",
|
|
703
|
-
fn:
|
|
704
|
-
|
|
705
|
-
canUpdate:
|
|
706
|
-
canDrop:
|
|
707
|
-
perms:
|
|
703
|
+
fn: q(({ canUpdate: u, canDrop: ae, perms: ne }) => [
|
|
704
|
+
S(e.$slots, "prev-buttons-ever", {
|
|
705
|
+
canUpdate: u,
|
|
706
|
+
canDrop: ae,
|
|
707
|
+
perms: ne
|
|
708
708
|
})
|
|
709
709
|
]),
|
|
710
710
|
key: "0"
|
|
711
711
|
} : void 0,
|
|
712
|
-
|
|
712
|
+
i(C)["prev-buttons"] ? {
|
|
713
713
|
name: "prev-buttons",
|
|
714
|
-
fn:
|
|
715
|
-
|
|
716
|
-
canUpdate:
|
|
717
|
-
canDrop:
|
|
718
|
-
perms:
|
|
714
|
+
fn: q(({ canUpdate: u, canDrop: ae, perms: ne }) => [
|
|
715
|
+
S(e.$slots, "prev-buttons", {
|
|
716
|
+
canUpdate: u,
|
|
717
|
+
canDrop: ae,
|
|
718
|
+
perms: ne
|
|
719
719
|
})
|
|
720
720
|
]),
|
|
721
721
|
key: "1"
|
|
722
722
|
} : void 0
|
|
723
723
|
]), 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(),
|
|
725
|
-
L.value ? (c(),
|
|
726
|
-
$.value && e.notificationType ===
|
|
724
|
+
r.value ? v("", !0) : (c(), W("div", Bt, [
|
|
725
|
+
L.value ? (c(), W("div", Ct, [
|
|
726
|
+
$.value && e.notificationType === i(_).Inline ? (c(), R(O, {
|
|
727
727
|
key: 0,
|
|
728
|
-
code:
|
|
729
|
-
palette:
|
|
728
|
+
code: z.value,
|
|
729
|
+
palette: z.value === 200 ? "success" : "danger",
|
|
730
730
|
quick: "",
|
|
731
731
|
"can-close": "",
|
|
732
|
-
onClose: a[6] || (a[6] = (
|
|
732
|
+
onClose: a[6] || (a[6] = (u) => $.value = !1)
|
|
733
733
|
}, null, 8, ["code", "palette"])) : v("", !0),
|
|
734
|
-
|
|
734
|
+
te.value ? (c(), R(V, U({
|
|
735
735
|
key: 1,
|
|
736
736
|
modelValue: l.value,
|
|
737
|
-
"onUpdate:modelValue": a[7] || (a[7] = (
|
|
737
|
+
"onUpdate:modelValue": a[7] || (a[7] = (u) => l.value = u),
|
|
738
738
|
modifications: m.value,
|
|
739
|
-
"onUpdate:modifications": a[8] || (a[8] = (
|
|
739
|
+
"onUpdate:modifications": a[8] || (a[8] = (u) => m.value = u),
|
|
740
740
|
valid: Y.value,
|
|
741
|
-
"onUpdate:valid": a[9] || (a[9] = (
|
|
741
|
+
"onUpdate:valid": a[9] || (a[9] = (u) => Y.value = u),
|
|
742
742
|
changed: x.value,
|
|
743
|
-
"onUpdate:changed": a[10] || (a[10] = (
|
|
743
|
+
"onUpdate:changed": a[10] || (a[10] = (u) => x.value = u)
|
|
744
744
|
}, {
|
|
745
745
|
...e.formUiConfig,
|
|
746
746
|
form: e.form,
|
|
747
747
|
differencesTableConfig: e.differencesTableConfig,
|
|
748
748
|
visibleView: N.value,
|
|
749
749
|
modificationDataState: Oe.value,
|
|
750
|
-
editableViews: [
|
|
750
|
+
editableViews: [oe.value],
|
|
751
751
|
disabled: !B.value
|
|
752
|
-
}),
|
|
752
|
+
}), pe({ _: 2 }, [
|
|
753
|
+
tt(ze.value, (u) => ({
|
|
754
|
+
name: u,
|
|
755
|
+
fn: q(({}) => [
|
|
756
|
+
S(e.$slots, u)
|
|
757
|
+
])
|
|
758
|
+
}))
|
|
759
|
+
]), 1040, ["modelValue", "modifications", "valid", "changed"])) : S(e.$slots, "item", {
|
|
753
760
|
key: 2,
|
|
754
761
|
item: l.value,
|
|
755
762
|
loading: r.value,
|
|
756
763
|
editMode: B.value,
|
|
757
|
-
isCreate:
|
|
764
|
+
isCreate: H.value,
|
|
758
765
|
canUpdate: w.value,
|
|
759
|
-
canDrop:
|
|
766
|
+
canDrop: y.value,
|
|
760
767
|
itemBeingEdited: j.value,
|
|
761
768
|
perms: b.value
|
|
762
769
|
})
|
|
763
|
-
])) : e.notificationType ===
|
|
770
|
+
])) : e.notificationType === i(_).Inline ? (c(), R(O, {
|
|
764
771
|
key: 1,
|
|
765
|
-
code:
|
|
772
|
+
code: z.value
|
|
766
773
|
}, null, 8, ["code"])) : v("", !0)
|
|
767
774
|
])),
|
|
768
|
-
r.value ? (c(), R(
|
|
769
|
-
e.buttonNavPosition ===
|
|
775
|
+
r.value ? (c(), R(Je, { key: 3 })) : v("", !0),
|
|
776
|
+
e.buttonNavPosition === i(Ae).Bottom && (e.groupButton === !1 || !e.groupButtonAsModalActions) && ge.value ? (c(), R(Ee, {
|
|
770
777
|
key: 4,
|
|
771
778
|
ref_key: "buttonNav",
|
|
772
779
|
ref: t,
|
|
773
780
|
loading: r.value,
|
|
774
|
-
"onUpdate:loading": a[11] || (a[11] = (
|
|
781
|
+
"onUpdate:loading": a[11] || (a[11] = (u) => r.value = u),
|
|
775
782
|
editing: B.value,
|
|
776
|
-
"onUpdate:editing": a[12] || (a[12] = (
|
|
783
|
+
"onUpdate:editing": a[12] || (a[12] = (u) => B.value = u),
|
|
777
784
|
"picked-modification-view": N.value,
|
|
778
|
-
"onUpdate:pickedModificationView": a[13] || (a[13] = (
|
|
785
|
+
"onUpdate:pickedModificationView": a[13] || (a[13] = (u) => N.value = u),
|
|
779
786
|
item: l.value,
|
|
780
787
|
modifications: m.value,
|
|
781
788
|
mode: e.mode,
|
|
@@ -790,30 +797,30 @@ const D = (...A) => {
|
|
|
790
797
|
"data-changed": h.value,
|
|
791
798
|
"http-success-read": L.value,
|
|
792
799
|
"can-update": w.value,
|
|
793
|
-
"can-drop":
|
|
800
|
+
"can-drop": y.value,
|
|
794
801
|
"can-switch-edit-mode": ie.value,
|
|
795
802
|
"group-button-as-modal-actions": e.groupButtonAsModalActions,
|
|
796
|
-
"able-to-create":
|
|
797
|
-
"able-to-update":
|
|
803
|
+
"able-to-create": be.value,
|
|
804
|
+
"able-to-update": me.value,
|
|
798
805
|
"able-to-drop": Ue.value,
|
|
799
806
|
perms: b.value,
|
|
800
807
|
"modification-view": Me.value,
|
|
801
|
-
"editable-view":
|
|
808
|
+
"editable-view": oe.value,
|
|
802
809
|
onCreate: Ce,
|
|
803
810
|
onSave: De,
|
|
804
811
|
onDrop: he
|
|
805
|
-
},
|
|
806
|
-
|
|
812
|
+
}, pe({ _: 2 }, [
|
|
813
|
+
i(C)["prev-buttons-ever"] ? {
|
|
807
814
|
name: "prev-buttons-ever",
|
|
808
|
-
fn:
|
|
809
|
-
|
|
815
|
+
fn: q(() => [
|
|
816
|
+
S(e.$slots, "prev-buttons-ever")
|
|
810
817
|
]),
|
|
811
818
|
key: "0"
|
|
812
819
|
} : void 0,
|
|
813
|
-
|
|
820
|
+
i(C)["prev-buttons"] ? {
|
|
814
821
|
name: "prev-buttons-ever",
|
|
815
|
-
fn:
|
|
816
|
-
|
|
822
|
+
fn: q(() => [
|
|
823
|
+
S(e.$slots, "prev-buttons")
|
|
817
824
|
]),
|
|
818
825
|
key: "1"
|
|
819
826
|
} : void 0
|
|
@@ -822,19 +829,19 @@ const D = (...A) => {
|
|
|
822
829
|
]),
|
|
823
830
|
_: 2
|
|
824
831
|
}, [
|
|
825
|
-
e.groupButton !== !1 && e.groupButtonAsModalActions &&
|
|
832
|
+
e.groupButton !== !1 && e.groupButtonAsModalActions && ge.value ? {
|
|
826
833
|
name: "header-actions",
|
|
827
|
-
fn:
|
|
828
|
-
e.buttonNavPosition ===
|
|
834
|
+
fn: q(() => [
|
|
835
|
+
e.buttonNavPosition === i(Ae).Top ? (c(), R(Ee, {
|
|
829
836
|
key: 0,
|
|
830
837
|
ref_key: "buttonNav",
|
|
831
838
|
ref: t,
|
|
832
839
|
loading: r.value,
|
|
833
|
-
"onUpdate:loading": a[0] || (a[0] = (
|
|
840
|
+
"onUpdate:loading": a[0] || (a[0] = (u) => r.value = u),
|
|
834
841
|
editing: B.value,
|
|
835
|
-
"onUpdate:editing": a[1] || (a[1] = (
|
|
842
|
+
"onUpdate:editing": a[1] || (a[1] = (u) => B.value = u),
|
|
836
843
|
"picked-modification-view": N.value,
|
|
837
|
-
"onUpdate:pickedModificationView": a[2] || (a[2] = (
|
|
844
|
+
"onUpdate:pickedModificationView": a[2] || (a[2] = (u) => N.value = u),
|
|
838
845
|
item: l.value,
|
|
839
846
|
modifications: m.value,
|
|
840
847
|
mode: e.mode,
|
|
@@ -849,37 +856,37 @@ const D = (...A) => {
|
|
|
849
856
|
"data-changed": h.value,
|
|
850
857
|
"http-success-read": L.value,
|
|
851
858
|
"can-update": w.value,
|
|
852
|
-
"can-drop":
|
|
859
|
+
"can-drop": y.value,
|
|
853
860
|
"can-switch-edit-mode": ie.value,
|
|
854
861
|
"group-button-as-modal-actions": e.groupButtonAsModalActions,
|
|
855
|
-
"able-to-create":
|
|
856
|
-
"able-to-update":
|
|
862
|
+
"able-to-create": be.value,
|
|
863
|
+
"able-to-update": me.value,
|
|
857
864
|
"able-to-drop": Ue.value,
|
|
858
865
|
perms: b.value,
|
|
859
866
|
"modification-view": Me.value,
|
|
860
|
-
"editable-view":
|
|
867
|
+
"editable-view": oe.value,
|
|
861
868
|
onCreate: Ce,
|
|
862
869
|
onSave: De,
|
|
863
870
|
onDrop: he
|
|
864
|
-
},
|
|
865
|
-
|
|
871
|
+
}, pe({ _: 2 }, [
|
|
872
|
+
i(C)["prev-buttons-ever"] ? {
|
|
866
873
|
name: "prev-buttons-ever",
|
|
867
|
-
fn:
|
|
868
|
-
|
|
869
|
-
canUpdate:
|
|
870
|
-
canDrop:
|
|
871
|
-
perms:
|
|
874
|
+
fn: q(({ canUpdate: u, canDrop: ae, perms: ne }) => [
|
|
875
|
+
S(e.$slots, "prev-buttons-ever", {
|
|
876
|
+
canUpdate: u,
|
|
877
|
+
canDrop: ae,
|
|
878
|
+
perms: ne
|
|
872
879
|
})
|
|
873
880
|
]),
|
|
874
881
|
key: "0"
|
|
875
882
|
} : void 0,
|
|
876
|
-
|
|
883
|
+
i(C)["prev-buttons"] ? {
|
|
877
884
|
name: "prev-buttons",
|
|
878
|
-
fn:
|
|
879
|
-
|
|
880
|
-
canUpdate:
|
|
881
|
-
canDrop:
|
|
882
|
-
perms:
|
|
885
|
+
fn: q(({ canUpdate: u, canDrop: ae, perms: ne }) => [
|
|
886
|
+
S(e.$slots, "prev-buttons", {
|
|
887
|
+
canUpdate: u,
|
|
888
|
+
canDrop: ae,
|
|
889
|
+
perms: ne
|
|
883
890
|
})
|
|
884
891
|
]),
|
|
885
892
|
key: "1"
|
|
@@ -891,18 +898,18 @@ const D = (...A) => {
|
|
|
891
898
|
]), 1040);
|
|
892
899
|
};
|
|
893
900
|
}
|
|
894
|
-
}),
|
|
895
|
-
install: (A,
|
|
896
|
-
A.component("lkt-item-crud") === void 0 && A.component("lkt-item-crud",
|
|
901
|
+
}), Ot = {
|
|
902
|
+
install: (A, ce = {}) => {
|
|
903
|
+
A.component("lkt-item-crud") === void 0 && A.component("lkt-item-crud", Dt);
|
|
897
904
|
}
|
|
898
|
-
},
|
|
905
|
+
}, Lt = (A) => {
|
|
899
906
|
re.defaultSaveIcon = A;
|
|
900
|
-
},
|
|
907
|
+
}, Nt = (A) => {
|
|
901
908
|
re.defaultDropIcon = A;
|
|
902
909
|
};
|
|
903
910
|
export {
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
911
|
+
Et as debugLktItemCrud,
|
|
912
|
+
Ot as default,
|
|
913
|
+
Nt as setItemCrudDefaultDropIcon,
|
|
914
|
+
Lt as setItemCrudDefaultSaveIcon
|
|
908
915
|
};
|
|
@@ -21,7 +21,7 @@ declare var __VLS_17: {
|
|
|
21
21
|
canUpdate: boolean | undefined;
|
|
22
22
|
canDrop: boolean | undefined;
|
|
23
23
|
perms: string[] | undefined;
|
|
24
|
-
},
|
|
24
|
+
}, __VLS_53: string, __VLS_54: {}, __VLS_56: {
|
|
25
25
|
item: LktObject;
|
|
26
26
|
loading: false;
|
|
27
27
|
editMode: boolean;
|
|
@@ -30,8 +30,10 @@ declare var __VLS_17: {
|
|
|
30
30
|
canDrop: boolean;
|
|
31
31
|
itemBeingEdited: boolean;
|
|
32
32
|
perms: string[];
|
|
33
|
-
},
|
|
33
|
+
}, __VLS_77: {}, __VLS_79: {};
|
|
34
34
|
type __VLS_Slots = {} & {
|
|
35
|
+
[K in NonNullable<typeof __VLS_53>]?: (props: typeof __VLS_54) => any;
|
|
36
|
+
} & {
|
|
35
37
|
'prev-buttons-ever'?: (props: typeof __VLS_17) => any;
|
|
36
38
|
} & {
|
|
37
39
|
'prev-buttons'?: (props: typeof __VLS_19) => any;
|
|
@@ -44,11 +46,11 @@ type __VLS_Slots = {} & {
|
|
|
44
46
|
} & {
|
|
45
47
|
'prev-buttons'?: (props: typeof __VLS_38) => any;
|
|
46
48
|
} & {
|
|
47
|
-
item?: (props: typeof
|
|
49
|
+
item?: (props: typeof __VLS_56) => any;
|
|
48
50
|
} & {
|
|
49
|
-
'prev-buttons-ever'?: (props: typeof
|
|
51
|
+
'prev-buttons-ever'?: (props: typeof __VLS_77) => any;
|
|
50
52
|
} & {
|
|
51
|
-
'prev-buttons'?: (props: typeof
|
|
53
|
+
'prev-buttons'?: (props: typeof __VLS_79) => any;
|
|
52
54
|
};
|
|
53
55
|
declare const __VLS_component: import("vue").DefineComponent<ItemCrudConfig, {
|
|
54
56
|
doDrop: () => void;
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
ButtonConfig,
|
|
8
8
|
ensureButtonConfig, FormUiConfig,
|
|
9
9
|
getDefaultValues,
|
|
10
|
-
getFormDataState,
|
|
10
|
+
getFormDataState, getFormSlotKeys,
|
|
11
11
|
ItemCrud,
|
|
12
12
|
ItemCrudButtonNavPosition,
|
|
13
13
|
ItemCrudConfig,
|
|
@@ -520,6 +520,13 @@
|
|
|
520
520
|
const computedHasButtons = computed(() => {
|
|
521
521
|
return createMode.value || canUpdate.value || canDrop.value;
|
|
522
522
|
})
|
|
523
|
+
|
|
524
|
+
const computedFormSlots = computed(() => {
|
|
525
|
+
if (computedHasForm.value) {
|
|
526
|
+
return getFormSlotKeys(props.form);
|
|
527
|
+
}
|
|
528
|
+
return [];
|
|
529
|
+
})
|
|
523
530
|
</script>
|
|
524
531
|
|
|
525
532
|
<template>
|
|
@@ -664,7 +671,11 @@
|
|
|
664
671
|
editableViews: [computedEditableView],
|
|
665
672
|
disabled: !editMode,
|
|
666
673
|
}"
|
|
667
|
-
|
|
674
|
+
>
|
|
675
|
+
<template v-for="formSlot in computedFormSlots" v-slot:[formSlot]="{}">
|
|
676
|
+
<slot :name="formSlot"/>
|
|
677
|
+
</template>
|
|
678
|
+
</lkt-form>
|
|
668
679
|
</template>
|
|
669
680
|
|
|
670
681
|
<template v-else>
|