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