lkt-item-crud 2.0.33 → 2.0.34
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.js +45 -45
- package/package.json +1 -1
- package/src/lib-components/LktItemCrud.vue +2 -2
package/dist/build.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Je, ref as p, watch as C, useSlots as Qe, computed as b, resolveComponent as Be, createElementBlock as S, createCommentVNode as w, openBlock as n, createBlock as g, Fragment as F, renderSlot as I, withDirectives as B, mergeProps as v, normalizeProps as Me, unref as d, renderList as
|
|
1
|
+
import { defineComponent as Je, ref as p, watch as C, useSlots as Qe, computed as b, resolveComponent as Be, createElementBlock as S, createCommentVNode as w, openBlock as n, createBlock as g, Fragment as F, renderSlot as I, withDirectives as B, mergeProps as v, normalizeProps as Me, unref as d, renderList as H, vShow as y, createVNode as J, withCtx as _, mergeDefaults as nt, nextTick as Ge, onMounted as ut, resolveDynamicComponent as it, createSlots as ge, toDisplayString as lt } from "vue";
|
|
2
2
|
import { httpCall as rt } from "lkt-http-client";
|
|
3
3
|
import { DataState as je } from "lkt-data-state";
|
|
4
4
|
import { ModificationView as U, ItemCrudMode as V, ItemCrudButtonNavVisibility as qe, ButtonType as Fe, TablePermission as Ue, ensureButtonConfig as Z, LktSettings as k, getFormDataState as dt, ItemCrudView as ze, getFormSlotKeys as st, ItemCrudButtonNavPosition as Pe, NotificationType as ue, getDefaultValues as vt, ItemCrud as pt, ToastPositionX as fe } from "lkt-vue-kernel";
|
|
@@ -97,7 +97,7 @@ const T = (...$) => {
|
|
|
97
97
|
s.value && typeof s.value.click == "function" && s.value.click();
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
|
-
const
|
|
100
|
+
const K = b(() => !u.canDrop || u.dropButton === !1 ? !1 : !u.canUpdate && u.canDrop ? !0 : !i.value && u.editing && u.httpSuccessRead), M = b(() => u.mode === V.Create && (u.createButton === !1 || !u.canCreate) || u.mode === V.Update && (u.updateButton === !1 || !u.canUpdate) || i.value ? !1 : u.editing && u.httpSuccessRead), oe = b(() => u.editModeButton === !1 || !u.canSwitchEditMode || !u.canUpdate && !u.canDrop || !u.canUpdate && u.canDrop ? !1 : !i.value && u.mode !== V.Create && u.httpSuccessRead), Y = b(() => u.buttonNavVisibility === qe.Always || h["prev-buttons-ever"] ? !0 : u.buttonNavVisibility === qe.Never ? !1 : M.value || K.value || oe.value), G = b(() => u.modificationView === !1 ? [] : u.modificationView === !0 ? [
|
|
101
101
|
U.Current,
|
|
102
102
|
U.Modifications,
|
|
103
103
|
U.SplitView,
|
|
@@ -161,7 +161,7 @@ const T = (...$) => {
|
|
|
161
161
|
contentClass: "lkt-flex-column"
|
|
162
162
|
}
|
|
163
163
|
})), null, 16)) : w("", !0),
|
|
164
|
-
(n(!0), S(F, null,
|
|
164
|
+
(n(!0), S(F, null, H(e.navStartButtons, (c) => B((n(), g(l, v({ ref_for: !0 }, c), null, 16)), [
|
|
165
165
|
[y, !i.value]
|
|
166
166
|
])), 256)),
|
|
167
167
|
d(h)["prev-buttons-ever"] ? I(e.$slots, "prev-buttons-ever", {
|
|
@@ -170,7 +170,7 @@ const T = (...$) => {
|
|
|
170
170
|
canDrop: e.canDrop,
|
|
171
171
|
perms: e.perms
|
|
172
172
|
}) : w("", !0),
|
|
173
|
-
(n(!0), S(F, null,
|
|
173
|
+
(n(!0), S(F, null, H(e.navStartButtonsEditing, (c) => B((n(), g(l, v({ ref_for: !0 }, c), null, 16)), [
|
|
174
174
|
[y, A.value && !i.value]
|
|
175
175
|
])), 256)),
|
|
176
176
|
d(h)["prev-buttons"] ? I(e.$slots, "prev-buttons", {
|
|
@@ -239,13 +239,13 @@ const T = (...$) => {
|
|
|
239
239
|
onLoaded: D,
|
|
240
240
|
onClick: P
|
|
241
241
|
}), null, 16, ["disabled"]), [
|
|
242
|
-
[y,
|
|
242
|
+
[y, K.value && e.mode !== d(V).Create]
|
|
243
243
|
]),
|
|
244
244
|
d(h).buttons ? I(e.$slots, "buttons", { key: 4 }) : w("", !0),
|
|
245
|
-
(n(!0), S(F, null,
|
|
245
|
+
(n(!0), S(F, null, H(e.navEndButtons, (c) => B((n(), g(l, v({ ref_for: !0 }, c), null, 16)), [
|
|
246
246
|
[y, !i.value]
|
|
247
247
|
])), 256)),
|
|
248
|
-
(n(!0), S(F, null,
|
|
248
|
+
(n(!0), S(F, null, H(e.navEndButtonsEditing, (c) => B((n(), g(l, v({ ref_for: !0 }, c), null, 16)), [
|
|
249
249
|
[y, A.value && !i.value]
|
|
250
250
|
])), 256))
|
|
251
251
|
], 64)) : e.grouped ? (n(), g(l, v({
|
|
@@ -269,7 +269,7 @@ const T = (...$) => {
|
|
|
269
269
|
contentClass: "lkt-flex-column"
|
|
270
270
|
}
|
|
271
271
|
})), null, 16)) : w("", !0),
|
|
272
|
-
(n(!0), S(F, null,
|
|
272
|
+
(n(!0), S(F, null, H(e.navStartButtons, (X) => B((n(), g(l, v({ ref_for: !0 }, X), null, 16)), [
|
|
273
273
|
[y, !i.value]
|
|
274
274
|
])), 256)),
|
|
275
275
|
d(h)["prev-buttons-ever"] ? I(e.$slots, "prev-buttons-ever", {
|
|
@@ -278,7 +278,7 @@ const T = (...$) => {
|
|
|
278
278
|
canDrop: e.canDrop,
|
|
279
279
|
perms: e.perms
|
|
280
280
|
}) : w("", !0),
|
|
281
|
-
(n(!0), S(F, null,
|
|
281
|
+
(n(!0), S(F, null, H(e.navStartButtonsEditing, (X) => B((n(), g(l, v({ ref_for: !0 }, X), null, 16)), [
|
|
282
282
|
[y, A.value && !i.value]
|
|
283
283
|
])), 256)),
|
|
284
284
|
d(h)["prev-buttons"] ? I(e.$slots, "prev-buttons", {
|
|
@@ -349,20 +349,20 @@ const T = (...$) => {
|
|
|
349
349
|
onLoaded: D,
|
|
350
350
|
onClick: P
|
|
351
351
|
}), null, 16, ["disabled"]), [
|
|
352
|
-
[y,
|
|
352
|
+
[y, K.value && e.mode !== d(V).Create]
|
|
353
353
|
]),
|
|
354
354
|
d(h).buttons ? I(e.$slots, "buttons", { key: 4 }) : w("", !0),
|
|
355
|
-
(n(!0), S(F, null,
|
|
355
|
+
(n(!0), S(F, null, H(e.navEndButtons, (X) => B((n(), g(l, v({ ref_for: !0 }, X), null, 16)), [
|
|
356
356
|
[y, !i.value]
|
|
357
357
|
])), 256)),
|
|
358
|
-
(n(!0), S(F, null,
|
|
358
|
+
(n(!0), S(F, null, H(e.navEndButtonsEditing, (X) => B((n(), g(l, v({ ref_for: !0 }, X), null, 16)), [
|
|
359
359
|
[y, A.value && !i.value]
|
|
360
360
|
])), 256))
|
|
361
361
|
];
|
|
362
362
|
}),
|
|
363
363
|
_: 3
|
|
364
364
|
}, 16)) : (n(), S(F, { key: 2 }, [
|
|
365
|
-
(n(!0), S(F, null,
|
|
365
|
+
(n(!0), S(F, null, H(e.navStartButtons, (c) => B((n(), g(l, v({ ref_for: !0 }, c), null, 16)), [
|
|
366
366
|
[y, !i.value]
|
|
367
367
|
])), 256)),
|
|
368
368
|
d(h)["prev-buttons-ever"] ? B((n(), S("div", Bt, [
|
|
@@ -374,7 +374,7 @@ const T = (...$) => {
|
|
|
374
374
|
], 512)), [
|
|
375
375
|
[y, !i.value]
|
|
376
376
|
]) : w("", !0),
|
|
377
|
-
(n(!0), S(F, null,
|
|
377
|
+
(n(!0), S(F, null, H(e.navStartButtonsEditing, (c) => B((n(), g(l, v({ ref_for: !0 }, c), null, 16)), [
|
|
378
378
|
[y, A.value && !i.value]
|
|
379
379
|
])), 256)),
|
|
380
380
|
d(h)["prev-buttons"] ? B((n(), S("div", yt, [
|
|
@@ -446,17 +446,17 @@ const T = (...$) => {
|
|
|
446
446
|
onLoaded: D,
|
|
447
447
|
onClick: P
|
|
448
448
|
}), null, 16, ["disabled"]), [
|
|
449
|
-
[y,
|
|
449
|
+
[y, K.value && e.mode !== d(V).Create]
|
|
450
450
|
]),
|
|
451
451
|
d(h).buttons ? B((n(), S("div", kt, [
|
|
452
452
|
I(e.$slots, "buttons")
|
|
453
453
|
], 512)), [
|
|
454
454
|
[y, A.value && !i.value]
|
|
455
455
|
]) : w("", !0),
|
|
456
|
-
(n(!0), S(F, null,
|
|
456
|
+
(n(!0), S(F, null, H(e.navEndButtons, (c) => B((n(), g(l, v({ ref_for: !0 }, c), null, 16)), [
|
|
457
457
|
[y, !i.value]
|
|
458
458
|
])), 256)),
|
|
459
|
-
(n(!0), S(F, null,
|
|
459
|
+
(n(!0), S(F, null, H(e.navEndButtonsEditing, (c) => B((n(), g(l, v({ ref_for: !0 }, c), null, 16)), [
|
|
460
460
|
[y, A.value && !i.value]
|
|
461
461
|
])), 256)),
|
|
462
462
|
G.value.length > 0 ? (n(), g(l, Me(v({ key: 3 }, {
|
|
@@ -554,7 +554,7 @@ const T = (...$) => {
|
|
|
554
554
|
"modified-data"
|
|
555
555
|
],
|
|
556
556
|
setup($, { expose: ke, emit: Ee }) {
|
|
557
|
-
const a = $, u = bt(), E = Qe(), h = Ee, f = p(!0), s = p(a.modelValue), i = p(a.modifications), A = p(a.customData), m = p(a.perms), D = p(a.editing), Q = p(!1), x = p(!1), P = p(!1), N = p(!1), ee = p(200), O = p(new je(s.value, a.dataStateConfig)),
|
|
557
|
+
const a = $, u = bt(), E = Qe(), h = Ee, f = p(!0), s = p(a.modelValue), i = p(a.modifications), A = p(a.customData), m = p(a.perms), D = p(a.editing), Q = p(!1), x = p(!1), P = p(!1), N = p(!1), ee = p(200), O = p(new je(s.value, a.dataStateConfig)), K = p(new je(i.value, a.dataStateConfig)), M = p(!1), oe = p(new je(a.readData)), Y = p(a.mode === V.Create), G = p(!1), se = p(!1), e = p(null), L = p(null), l = b(() => Y.value && a.createButton !== !1 && Array.isArray(m.value) && m.value.includes(Ue.Create)), te = b(() => !Y.value && a.updateButton !== !1 && Array.isArray(m.value) && m.value.includes(Ue.Update)), ae = b(() => !Y.value && a.dropButton !== !1 && Array.isArray(m.value) && m.value.includes(Ue.Drop)), ve = b(() => a.editModeButton !== !1 && !Y.value && Array.isArray(m.value) && m.value.includes(Ue.SwitchEditMode)), j = p(a.visibleView);
|
|
558
558
|
C(() => a.visibleView, (t) => {
|
|
559
559
|
j.value = t;
|
|
560
560
|
}), C(j, (t) => {
|
|
@@ -570,9 +570,9 @@ const T = (...$) => {
|
|
|
570
570
|
}), C(A, (t) => {
|
|
571
571
|
h("update:customData", t);
|
|
572
572
|
}), C(() => a.modifications, (t) => {
|
|
573
|
-
|
|
573
|
+
K.value.increment(t), i.value = t;
|
|
574
574
|
}, { deep: !0 }), C(i, (t) => {
|
|
575
|
-
Ae(),
|
|
575
|
+
Ae(), K.value.increment(t), le.value === U.Modifications && (M.value = K.value.changed()), h("update:modifications", t);
|
|
576
576
|
}, { deep: !0 });
|
|
577
577
|
const q = p(Z(a.createButton, k.defaultCreateButton)), pe = p(Z(a.createAndNewButton, a.createButton)), c = p(Z(a.updateButton, k.defaultUpdateButton)), z = p(Z(a.dropButton, k.defaultDropButton)), ie = p(Z(a.editModeButton, k.defaultEditModeButton)), X = p(Z(a.groupButton, k.defaultGroupButton));
|
|
578
578
|
C(() => a.createButton, (t) => {
|
|
@@ -585,7 +585,7 @@ const T = (...$) => {
|
|
|
585
585
|
ie.value = Z(t, k.defaultEditModeButton);
|
|
586
586
|
}, { deep: !0 });
|
|
587
587
|
const Ce = async () => {
|
|
588
|
-
var t, o,
|
|
588
|
+
var t, o, W;
|
|
589
589
|
T("fetchItem"), f.value = !0, ee.value = -1, N.value = !1, typeof ((t = a.events) == null ? void 0 : t.httpStart) == "function" && a.events.httpStart();
|
|
590
590
|
try {
|
|
591
591
|
const R = await rt(a.readResource, a.readData);
|
|
@@ -595,9 +595,9 @@ const T = (...$) => {
|
|
|
595
595
|
}), h("error", R.httpStatus);
|
|
596
596
|
return;
|
|
597
597
|
}
|
|
598
|
-
P.value = !0, s.value = R.data, i.value = Array.isArray(R.modifications) ? {} : R.modifications, m.value = R.perms, O.value.increment(s.value).turnStoredIntoOriginal(),
|
|
598
|
+
P.value = !0, s.value = R.data, i.value = Array.isArray(R.modifications) ? {} : R.modifications, m.value = R.perms, O.value.increment(s.value).turnStoredIntoOriginal(), K.value.increment(i.value).turnStoredIntoOriginal(), M.value = O.value.changed(), oe.value.turnStoredIntoOriginal(), Object.keys(i.value).length > 0 && (j.value = U.Modifications), ne.value && (Ae(), Ge(() => {
|
|
599
599
|
L.value.turnStoredIntoOriginal();
|
|
600
|
-
})), typeof ((
|
|
600
|
+
})), typeof ((W = a.events) == null ? void 0 : W.httpEnd) == "function" && a.events.httpEnd({
|
|
601
601
|
httpResponse: R
|
|
602
602
|
}), h("read", R);
|
|
603
603
|
} catch {
|
|
@@ -625,8 +625,8 @@ const T = (...$) => {
|
|
|
625
625
|
}), C(D, (t) => {
|
|
626
626
|
T("editMode updated -> emit update", t), h("update:editing", t);
|
|
627
627
|
});
|
|
628
|
-
const
|
|
629
|
-
ne.value && (
|
|
628
|
+
const We = p(void 0), Ae = () => {
|
|
629
|
+
ne.value && (We.value = dt(s.value, i.value, be.value));
|
|
630
630
|
};
|
|
631
631
|
ut(() => {
|
|
632
632
|
a.readResource && !Y.value ? Ce() : (Y.value, P.value = !0, D.value = !0, f.value = !1, O.value.increment(s.value).turnStoredIntoOriginal(), M.value = O.value.changed());
|
|
@@ -638,11 +638,11 @@ const T = (...$) => {
|
|
|
638
638
|
N.value = !0;
|
|
639
639
|
}
|
|
640
640
|
return !0;
|
|
641
|
-
},
|
|
641
|
+
}, He = (t, o) => {
|
|
642
642
|
if (T("doAutoReloadId -> enter: ", t), typeof t < "u" && t.autoReloadId)
|
|
643
643
|
if (T("doAutoReloadId -> autoReloadId detected: ", t.autoReloadId), typeof o < "u") {
|
|
644
|
-
let
|
|
645
|
-
typeof o == "function" && (
|
|
644
|
+
let W = o;
|
|
645
|
+
typeof o == "function" && (W = o(t.autoReloadId)), u.push(W);
|
|
646
646
|
} else we.value ? (T("doAutoReloadId -> insideModal: ", a), ct(a.modalConfig.modalName, a.modalConfig.modalKey, t.autoReloadId)) : (T("doAutoReloadId -> outsideModal"), a.readData.id = t.autoReloadId, T("doAutoReloadId -> turning off create mode"), Y.value = !1, Ce());
|
|
647
647
|
}, Ve = (t, o) => {
|
|
648
648
|
if (T("onCreate"), !Te(o, q.value.resource)) {
|
|
@@ -654,12 +654,12 @@ const T = (...$) => {
|
|
|
654
654
|
});
|
|
655
655
|
return;
|
|
656
656
|
}
|
|
657
|
-
se.value = !0, T("onCreate -> turn stored data into original"), O.value.increment(s.value).turnStoredIntoOriginal(),
|
|
657
|
+
se.value = !0, T("onCreate -> turn stored data into original"), O.value.increment(s.value).turnStoredIntoOriginal(), K.value.turnStoredIntoOriginal(), a.notificationType === ue.Toast && ce({
|
|
658
658
|
text: k.defaultCreateSuccessText,
|
|
659
659
|
details: k.defaultCreateSuccessDetails,
|
|
660
660
|
icon: k.defaultCreateSuccessIcon,
|
|
661
661
|
positionX: fe.Right
|
|
662
|
-
}),
|
|
662
|
+
}), He(o, a.redirectOnCreate), T("onCreate -> beforeEmitCreate"), h("create", o);
|
|
663
663
|
}, Ie = (t, o) => {
|
|
664
664
|
if (T("onUpdate"), !Te(o, c.value.resource)) {
|
|
665
665
|
a.notificationType === ue.Toast && ce({
|
|
@@ -670,12 +670,12 @@ const T = (...$) => {
|
|
|
670
670
|
});
|
|
671
671
|
return;
|
|
672
672
|
}
|
|
673
|
-
T("onUpdate -> turn stored data into original"), O.value.turnStoredIntoOriginal(),
|
|
673
|
+
T("onUpdate -> turn stored data into original"), O.value.turnStoredIntoOriginal(), K.value.turnStoredIntoOriginal(), a.notificationType === ue.Toast && ce({
|
|
674
674
|
text: k.defaultUpdateSuccessText,
|
|
675
675
|
details: k.defaultUpdateSuccessDetails,
|
|
676
676
|
icon: k.defaultUpdateSuccessIcon,
|
|
677
677
|
positionX: fe.Right
|
|
678
|
-
}),
|
|
678
|
+
}), He(o), h("update", o);
|
|
679
679
|
}, Re = (t, o) => {
|
|
680
680
|
if (T("onDrop"), !Te(o, z.value.resource)) {
|
|
681
681
|
a.notificationType === ue.Toast && ce({
|
|
@@ -692,8 +692,8 @@ const T = (...$) => {
|
|
|
692
692
|
icon: k.defaultDropSuccessIcon,
|
|
693
693
|
positionX: fe.Right
|
|
694
694
|
}), h("drop", o), a.view === ze.Modal && (T("onDrop -> close modal"), ft(a.modalConfig.modalName, a.modalConfig.modalKey)), typeof a.redirectOnDrop < "u") {
|
|
695
|
-
let
|
|
696
|
-
typeof a.redirectOnDrop == "function" && (
|
|
695
|
+
let W = a.redirectOnDrop;
|
|
696
|
+
typeof a.redirectOnDrop == "function" && (W = a.redirectOnDrop()), u.push(W);
|
|
697
697
|
}
|
|
698
698
|
};
|
|
699
699
|
ke({
|
|
@@ -710,8 +710,8 @@ const T = (...$) => {
|
|
|
710
710
|
hasModifiedData: () => O.value.changed()
|
|
711
711
|
});
|
|
712
712
|
const Ye = b(() => {
|
|
713
|
-
var t, o,
|
|
714
|
-
return Se.value ? ne.value ? x.value ? (t = a.modalConfig) == null ? void 0 : t.closeConfirm : "" : le.value === U.Modifications ?
|
|
713
|
+
var t, o, W;
|
|
714
|
+
return Se.value ? ne.value ? x.value ? (t = a.modalConfig) == null ? void 0 : t.closeConfirm : "" : le.value === U.Modifications ? K.value.changed() ? (o = a.modalConfig) == null ? void 0 : o.closeConfirm : "" : O.value.changed() ? (W = a.modalConfig) == null ? void 0 : W.closeConfirm : "" : "";
|
|
715
715
|
}), Ze = (t) => {
|
|
716
716
|
var o;
|
|
717
717
|
if (typeof ((o = a.modalConfig) == null ? void 0 : o.beforeClose) == "function")
|
|
@@ -719,14 +719,14 @@ const T = (...$) => {
|
|
|
719
719
|
...t,
|
|
720
720
|
itemCreated: se.value
|
|
721
721
|
});
|
|
722
|
-
}, Ne = b(() => a.title.startsWith("__:") ? String(mt(a.title.substring(3))) : a.title), _e = b(() => f.value ? !1 : Ne.value.length > 0 || !!E["post-title"]), xe = b(() => f.value ? !1 : typeof a.header == "object" && Object.keys(a.header).length > 0), we = b(() => a.view === ze.Modal),
|
|
722
|
+
}, Ne = b(() => a.title.startsWith("__:") ? String(mt(a.title.substring(3))) : a.title), _e = b(() => f.value ? !1 : Ne.value.length > 0 || !!E["post-title"]), xe = b(() => f.value ? !1 : typeof a.header == "object" && Object.keys(a.header).length > 0), we = b(() => a.view === ze.Modal), Ke = b(() => we.value ? "lkt-modal" : "section"), he = b(() => {
|
|
723
723
|
var t, o;
|
|
724
|
-
return a.mode !== V.Update || !te.value || !a.enabledSaveWithoutChanges && !M.value || ne.value && (!Q.value || !x.value) ? !1 : typeof ((t = c.value) == null ? void 0 : t.disabled) == "function" ? !c.value.disabled({
|
|
724
|
+
return a.mode !== V.Update || !te.value || !a.enabledSaveWithoutChanges && !M.value || ne.value && (!Q.value || !a.enabledSaveWithoutChanges && !x.value) ? !1 : typeof ((t = c.value) == null ? void 0 : t.disabled) == "function" ? !c.value.disabled({
|
|
725
725
|
prop: s.value
|
|
726
726
|
}) : typeof ((o = c.value) == null ? void 0 : o.disabled) == "boolean" ? !c.value.disabled : !0;
|
|
727
727
|
}), De = b(() => {
|
|
728
728
|
var t, o;
|
|
729
|
-
return a.mode !== V.Create || !l.value || !a.enabledSaveWithoutChanges && !M.value || ne.value && !Q.value && !x.value ? !1 : typeof ((t = q.value) == null ? void 0 : t.disabled) == "function" ? !q.value.disabled({
|
|
729
|
+
return a.mode !== V.Create || !l.value || !a.enabledSaveWithoutChanges && !M.value || ne.value && (!Q.value || !a.enabledSaveWithoutChanges && !x.value) ? !1 : typeof ((t = q.value) == null ? void 0 : t.disabled) == "function" ? !q.value.disabled({
|
|
730
730
|
prop: s.value
|
|
731
731
|
}) : typeof ((o = q.value) == null ? void 0 : o.disabled) == "boolean" ? !q.value.disabled : !0;
|
|
732
732
|
}), Oe = b(() => a.createAndNewButton !== !1 && typeof a.createAndNewButton == "object" && !Array.isArray(a.createAndNewButton) && Object.keys(a.createAndNewButton).length > 0), Le = b(() => {
|
|
@@ -734,7 +734,7 @@ const T = (...$) => {
|
|
|
734
734
|
return ae.value ? typeof ((t = z.value) == null ? void 0 : t.disabled) == "function" ? !z.value.disabled({
|
|
735
735
|
prop: s.value
|
|
736
736
|
}) : typeof ((o = z.value) == null ? void 0 : o.disabled) == "boolean" ? !z.value.disabled : !0 : !1;
|
|
737
|
-
}), et = b(() =>
|
|
737
|
+
}), et = b(() => Ke.value === "lkt-modal" ? {
|
|
738
738
|
title: a.title,
|
|
739
739
|
item: s.value,
|
|
740
740
|
...a.modalConfig,
|
|
@@ -751,10 +751,10 @@ const T = (...$) => {
|
|
|
751
751
|
editing: D.value
|
|
752
752
|
}) : a.form);
|
|
753
753
|
return (t, o) => {
|
|
754
|
-
const
|
|
755
|
-
return n(), g(it(
|
|
754
|
+
const W = Be("lkt-header"), R = Be("lkt-http-info"), at = Be("lkt-form"), ot = Be("lkt-loader");
|
|
755
|
+
return n(), g(it(Ke.value), v(et.value, { class: "lkt-item-crud" }), ge({
|
|
756
756
|
default: _(() => [
|
|
757
|
-
!we.value && xe.value ? (n(), g(
|
|
757
|
+
!we.value && xe.value ? (n(), g(W, Me(v({ key: 0 }, t.header)), null, 16)) : !we.value && _e.value ? (n(), S("header", Ct, [
|
|
758
758
|
d(E)["pre-title"] ? (n(), S("div", wt, [
|
|
759
759
|
I(t.$slots, "pre-title", {
|
|
760
760
|
item: s.value,
|
|
@@ -863,11 +863,11 @@ const T = (...$) => {
|
|
|
863
863
|
form: be.value,
|
|
864
864
|
differencesTableConfig: t.differencesTableConfig,
|
|
865
865
|
visibleView: j.value,
|
|
866
|
-
modificationDataState:
|
|
866
|
+
modificationDataState: We.value,
|
|
867
867
|
editableViews: [le.value],
|
|
868
868
|
disabled: !D.value
|
|
869
869
|
}), ge({ _: 2 }, [
|
|
870
|
-
|
|
870
|
+
H(tt.value, (r) => ({
|
|
871
871
|
name: r,
|
|
872
872
|
fn: _(({}) => [
|
|
873
873
|
I(t.$slots, r)
|
package/package.json
CHANGED
|
@@ -470,7 +470,7 @@
|
|
|
470
470
|
ableToUpdate = computed(() => {
|
|
471
471
|
if (props.mode !== ItemCrudMode.Update || !canUpdate.value) return false;
|
|
472
472
|
if (!props.enabledSaveWithoutChanges && !dataChanged.value) return false;
|
|
473
|
-
if (computedHasForm.value && (!validForm.value || !changedForm.value)) return false;
|
|
473
|
+
if (computedHasForm.value && (!validForm.value || (!props.enabledSaveWithoutChanges && !changedForm.value))) return false;
|
|
474
474
|
|
|
475
475
|
if (typeof safeUpdateButton.value?.disabled === 'function') return !safeUpdateButton.value.disabled({
|
|
476
476
|
prop: item.value
|
|
@@ -482,7 +482,7 @@
|
|
|
482
482
|
ableToCreate = computed(() => {
|
|
483
483
|
if (props.mode !== ItemCrudMode.Create || !canCreate.value) return false;
|
|
484
484
|
if (!props.enabledSaveWithoutChanges && !dataChanged.value) return false;
|
|
485
|
-
if (computedHasForm.value && !validForm.value && !changedForm.value) return false;
|
|
485
|
+
if (computedHasForm.value && (!validForm.value || (!props.enabledSaveWithoutChanges && !changedForm.value))) return false;
|
|
486
486
|
|
|
487
487
|
if (typeof safeCreateButton.value?.disabled === 'function') return !safeCreateButton.value.disabled({
|
|
488
488
|
prop: item.value
|