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