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