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