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