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