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