@dskripchenko/laravel-admin 1.9.1 → 1.9.2
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/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +767 -763
- package/dist/index.mjs.map +1 -1
- package/dist/stores/manifest.d.ts +4 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { h as be, ref as
|
|
2
|
-
import { defineStore as
|
|
1
|
+
import { h as be, ref as q, computed as M, defineComponent as ee, openBlock as o, createElementBlock as s, createVNode as v, unref as c, createBlock as V, withCtx as f, Fragment as E, renderList as Q, createTextVNode as j, toDisplayString as w, createElementVNode as u, createCommentVNode as F, renderSlot as ze, resolveDynamicComponent as Be, normalizeClass as fe, watch as xe, resolveComponent as pg, normalizeStyle as Ve, onBeforeUnmount as Dg, onUnmounted as Rg, Teleport as Tg, Transition as ug, withModifiers as ve, normalizeProps as bo, mergeProps as Un, withDirectives as w1, vModelText as $n, onMounted as e1, inject as uI, provide as ZI, nextTick as o1, withKeys as qg, vModelSelect as WI, createSlots as yI, guardReactiveProps as GI, reactive as pI, createApp as NI } from "vue";
|
|
2
|
+
import { defineStore as Ue, createPinia as XI } from "pinia";
|
|
3
3
|
import { useRouter as Xe, useRoute as l1, createWebHistory as kI, createRouter as KI } from "vue-router";
|
|
4
|
-
import { UidIcon as Y, UidMenu as Fe, UidMenuItem as Ae, UidMenuSeparator as JI, UidAvatar as $g, UidSidebarItem as YI, UidSidebar as QI, UidSidebarGroup as ew, UidSidebarLayout as aw, useToast as Fo, UidToastProvider as tw, UidAlert as
|
|
4
|
+
import { UidIcon as Y, UidMenu as Fe, UidMenuItem as Ae, UidMenuSeparator as JI, UidAvatar as $g, UidSidebarItem as YI, UidSidebar as QI, UidSidebarGroup as ew, UidSidebarLayout as aw, useToast as Fo, UidToastProvider as tw, UidAlert as We, UidInput as Ce, UidButton as te, UidCard as ge, UidSkeleton as Xn, UidCheckbox as mI, UidErrorState as Ug, UidEmptyState as Og, UidTreeView as nw, UidTable as y2, UidPagination as ow, UidGrid as vI, UidStack as cw, UidBadge as Eg, UidSelect as yg, UidStat as $o, UidGauge as iw, UidFormField as So, UidTextarea as lw, UidNumberInput as dw, UidDatePicker as rw, usePopover as sw, UidTabs as fI, UidTabPanel as MI, UidTab as Uo, UidDescriptionList as hw, UidDescriptionItem as uw, UidDrawer as yw, UidStepper as pw, UidFileUpload as kw, UidProgress as mw } from "@dskripchenko/ui";
|
|
5
5
|
import { t as vw, p as kg, u as Pe } from "./formState-DC25j4xe.js";
|
|
6
6
|
import fw from "axios";
|
|
7
7
|
import { DskWysiwyg as Mw } from "@dskripchenko/wysiwyg";
|
|
@@ -2715,7 +2715,7 @@ const ca = e("CircleArrowUpIcon", [
|
|
|
2715
2715
|
["path", { d: "m16 12-4-4-4 4", key: "177agl" }],
|
|
2716
2716
|
["path", { d: "M12 16V8", key: "1sbj14" }]
|
|
2717
2717
|
]);
|
|
2718
|
-
const
|
|
2718
|
+
const Ze = e("CircleCheckBigIcon", [
|
|
2719
2719
|
["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
|
|
2720
2720
|
["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
|
|
2721
2721
|
]);
|
|
@@ -5743,7 +5743,7 @@ const Wa = e("Grid2x2Icon", [
|
|
|
5743
5743
|
["path", { d: "M3 12h18", key: "1i2n21" }],
|
|
5744
5744
|
["path", { d: "M12 3v18", key: "108xh3" }]
|
|
5745
5745
|
]);
|
|
5746
|
-
const
|
|
5746
|
+
const Ee = e("Grid3x3Icon", [
|
|
5747
5747
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
5748
5748
|
["path", { d: "M3 9h18", key: "1pudct" }],
|
|
5749
5749
|
["path", { d: "M3 15h18", key: "5xshup" }],
|
|
@@ -13053,7 +13053,7 @@ const Iw = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
13053
13053
|
CircleArrowRight: oa,
|
|
13054
13054
|
CircleArrowUp: ca,
|
|
13055
13055
|
CircleCheck: ia,
|
|
13056
|
-
CircleCheckBig:
|
|
13056
|
+
CircleCheckBig: Ze,
|
|
13057
13057
|
CircleChevronDown: la,
|
|
13058
13058
|
CircleChevronLeft: da,
|
|
13059
13059
|
CircleChevronRight: ra,
|
|
@@ -13426,7 +13426,7 @@ const Iw = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
13426
13426
|
Grid2x2Check: Op,
|
|
13427
13427
|
Grid2x2Plus: Za,
|
|
13428
13428
|
Grid2x2X: Ep,
|
|
13429
|
-
Grid3x3:
|
|
13429
|
+
Grid3x3: Ee,
|
|
13430
13430
|
Grip: Wp,
|
|
13431
13431
|
GripHorizontal: Zp,
|
|
13432
13432
|
GripVertical: i2,
|
|
@@ -14958,10 +14958,10 @@ const ww = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
14958
14958
|
Check: Qe,
|
|
14959
14959
|
CheckCheck: Dd,
|
|
14960
14960
|
CheckCheckIcon: Dd,
|
|
14961
|
-
CheckCircle:
|
|
14961
|
+
CheckCircle: Ze,
|
|
14962
14962
|
CheckCircle2: ia,
|
|
14963
14963
|
CheckCircle2Icon: ia,
|
|
14964
|
-
CheckCircleIcon:
|
|
14964
|
+
CheckCircleIcon: Ze,
|
|
14965
14965
|
CheckIcon: Qe,
|
|
14966
14966
|
CheckSquare: Tt,
|
|
14967
14967
|
CheckSquare2: $t,
|
|
@@ -15045,8 +15045,8 @@ const ww = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
15045
15045
|
CircleArrowUp: ca,
|
|
15046
15046
|
CircleArrowUpIcon: ca,
|
|
15047
15047
|
CircleCheck: ia,
|
|
15048
|
-
CircleCheckBig:
|
|
15049
|
-
CircleCheckBigIcon:
|
|
15048
|
+
CircleCheckBig: Ze,
|
|
15049
|
+
CircleCheckBigIcon: Ze,
|
|
15050
15050
|
CircleCheckIcon: ia,
|
|
15051
15051
|
CircleChevronDown: la,
|
|
15052
15052
|
CircleChevronDownIcon: la,
|
|
@@ -15855,7 +15855,7 @@ const ww = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
15855
15855
|
GraduationCapIcon: $p,
|
|
15856
15856
|
Grape: Up,
|
|
15857
15857
|
GrapeIcon: Up,
|
|
15858
|
-
Grid:
|
|
15858
|
+
Grid: Ee,
|
|
15859
15859
|
Grid2X2: Wa,
|
|
15860
15860
|
Grid2X2Icon: Wa,
|
|
15861
15861
|
Grid2X2Plus: Za,
|
|
@@ -15868,11 +15868,11 @@ const ww = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
15868
15868
|
Grid2x2PlusIcon: Za,
|
|
15869
15869
|
Grid2x2X: Ep,
|
|
15870
15870
|
Grid2x2XIcon: Ep,
|
|
15871
|
-
Grid3X3:
|
|
15872
|
-
Grid3X3Icon:
|
|
15873
|
-
Grid3x3:
|
|
15874
|
-
Grid3x3Icon:
|
|
15875
|
-
GridIcon:
|
|
15871
|
+
Grid3X3: Ee,
|
|
15872
|
+
Grid3X3Icon: Ee,
|
|
15873
|
+
Grid3x3: Ee,
|
|
15874
|
+
Grid3x3Icon: Ee,
|
|
15875
|
+
GridIcon: Ee,
|
|
15876
15876
|
Grip: Wp,
|
|
15877
15877
|
GripHorizontal: Zp,
|
|
15878
15878
|
GripHorizontalIcon: Zp,
|
|
@@ -16548,7 +16548,7 @@ const ww = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
16548
16548
|
LucideChartSpline: Bd,
|
|
16549
16549
|
LucideCheck: Qe,
|
|
16550
16550
|
LucideCheckCheck: Dd,
|
|
16551
|
-
LucideCheckCircle:
|
|
16551
|
+
LucideCheckCircle: Ze,
|
|
16552
16552
|
LucideCheckCircle2: ia,
|
|
16553
16553
|
LucideCheckSquare: Tt,
|
|
16554
16554
|
LucideCheckSquare2: $t,
|
|
@@ -16592,7 +16592,7 @@ const ww = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
16592
16592
|
LucideCircleArrowRight: oa,
|
|
16593
16593
|
LucideCircleArrowUp: ca,
|
|
16594
16594
|
LucideCircleCheck: ia,
|
|
16595
|
-
LucideCircleCheckBig:
|
|
16595
|
+
LucideCircleCheckBig: Ze,
|
|
16596
16596
|
LucideCircleChevronDown: la,
|
|
16597
16597
|
LucideCircleChevronLeft: da,
|
|
16598
16598
|
LucideCircleChevronRight: ra,
|
|
@@ -16996,15 +16996,15 @@ const ww = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
16996
16996
|
LucideGrab: Tp,
|
|
16997
16997
|
LucideGraduationCap: $p,
|
|
16998
16998
|
LucideGrape: Up,
|
|
16999
|
-
LucideGrid:
|
|
16999
|
+
LucideGrid: Ee,
|
|
17000
17000
|
LucideGrid2X2: Wa,
|
|
17001
17001
|
LucideGrid2X2Plus: Za,
|
|
17002
17002
|
LucideGrid2x2: Wa,
|
|
17003
17003
|
LucideGrid2x2Check: Op,
|
|
17004
17004
|
LucideGrid2x2Plus: Za,
|
|
17005
17005
|
LucideGrid2x2X: Ep,
|
|
17006
|
-
LucideGrid3X3:
|
|
17007
|
-
LucideGrid3x3:
|
|
17006
|
+
LucideGrid3X3: Ee,
|
|
17007
|
+
LucideGrid3x3: Ee,
|
|
17008
17008
|
LucideGrip: Wp,
|
|
17009
17009
|
LucideGripHorizontal: Zp,
|
|
17010
17010
|
LucideGripVertical: i2,
|
|
@@ -19497,8 +19497,8 @@ const qe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
19497
19497
|
getAdminClient: Me,
|
|
19498
19498
|
hasAdminClient: Lw,
|
|
19499
19499
|
setAdminClient: II
|
|
19500
|
-
}, Symbol.toStringTag, { value: "Module" })), Zg =
|
|
19501
|
-
const a =
|
|
19500
|
+
}, Symbol.toStringTag, { value: "Module" })), Zg = Ue("admin-theme", () => {
|
|
19501
|
+
const a = q("light"), t = q(["light", "dark"]), n = M(() => a.value === "dark");
|
|
19502
19502
|
function r(h) {
|
|
19503
19503
|
a.value = h.theme, t.value = h.availableThemes, d(h.theme);
|
|
19504
19504
|
}
|
|
@@ -19553,8 +19553,8 @@ const qe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
19553
19553
|
}, null, 8, ["icon", "data-icon"])
|
|
19554
19554
|
], 8, bw));
|
|
19555
19555
|
}
|
|
19556
|
-
}), mg =
|
|
19557
|
-
const a =
|
|
19556
|
+
}), mg = Ue("admin-locale", () => {
|
|
19557
|
+
const a = q("ru"), t = q(["ru", "en"]);
|
|
19558
19558
|
function n(d) {
|
|
19559
19559
|
a.value = d.locale, t.value = d.availableLocales, i(d.locale);
|
|
19560
19560
|
}
|
|
@@ -19625,8 +19625,8 @@ const qe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
19625
19625
|
_: 1
|
|
19626
19626
|
}));
|
|
19627
19627
|
}
|
|
19628
|
-
}), vg =
|
|
19629
|
-
const a =
|
|
19628
|
+
}), vg = Ue("admin-notifications", () => {
|
|
19629
|
+
const a = q([]), t = q(0), n = q(!1), r = q("all"), l = q(null), i = q(!1), d = M(() => t.value > 0);
|
|
19630
19630
|
function h() {
|
|
19631
19631
|
i.value = !0;
|
|
19632
19632
|
}
|
|
@@ -19639,10 +19639,10 @@ const qe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
19639
19639
|
function m(p) {
|
|
19640
19640
|
t.value = p.unread_notifications_count;
|
|
19641
19641
|
}
|
|
19642
|
-
async function x(p = "all",
|
|
19642
|
+
async function x(p = "all", _ = 1) {
|
|
19643
19643
|
n.value = !0;
|
|
19644
19644
|
try {
|
|
19645
|
-
const P = await Me().get(`/notifications/list?type=${p}&page=${
|
|
19645
|
+
const P = await Me().get(`/notifications/list?type=${p}&page=${_}`);
|
|
19646
19646
|
a.value = P.data, t.value = P.meta.unread_count, l.value = {
|
|
19647
19647
|
page: P.meta.page,
|
|
19648
19648
|
per_page: P.meta.per_page,
|
|
@@ -19654,29 +19654,29 @@ const qe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
19654
19654
|
}
|
|
19655
19655
|
}
|
|
19656
19656
|
async function b() {
|
|
19657
|
-
const
|
|
19657
|
+
const _ = await Me().get(
|
|
19658
19658
|
"/notifications/unread"
|
|
19659
19659
|
);
|
|
19660
|
-
t.value =
|
|
19660
|
+
t.value = _.count, r.value === "unread" && (a.value = _.data);
|
|
19661
19661
|
}
|
|
19662
19662
|
async function L(p) {
|
|
19663
19663
|
await Me().post("/notifications/markAsRead", { id: p });
|
|
19664
|
-
const
|
|
19665
|
-
|
|
19664
|
+
const T = a.value.find((P) => P.id === p);
|
|
19665
|
+
T && T.read_at === null && (T.read_at = (/* @__PURE__ */ new Date()).toISOString(), t.value = Math.max(0, t.value - 1));
|
|
19666
19666
|
}
|
|
19667
19667
|
async function g() {
|
|
19668
19668
|
await Me().post("/notifications/markAllAsRead");
|
|
19669
|
-
const
|
|
19670
|
-
for (const
|
|
19671
|
-
|
|
19669
|
+
const _ = (/* @__PURE__ */ new Date()).toISOString();
|
|
19670
|
+
for (const T of a.value)
|
|
19671
|
+
T.read_at === null && (T.read_at = _);
|
|
19672
19672
|
t.value = 0;
|
|
19673
19673
|
}
|
|
19674
19674
|
async function S(p) {
|
|
19675
19675
|
await Me().post("/notifications/destroy", { id: p });
|
|
19676
|
-
const
|
|
19677
|
-
if (
|
|
19678
|
-
const P = a.value[
|
|
19679
|
-
a.value.splice(
|
|
19676
|
+
const T = a.value.findIndex((P) => P.id === p);
|
|
19677
|
+
if (T !== -1) {
|
|
19678
|
+
const P = a.value[T].read_at === null;
|
|
19679
|
+
a.value.splice(T, 1), P && (t.value = Math.max(0, t.value - 1));
|
|
19680
19680
|
}
|
|
19681
19681
|
}
|
|
19682
19682
|
return {
|
|
@@ -19728,7 +19728,7 @@ const qe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
19728
19728
|
], 8, Sw));
|
|
19729
19729
|
}
|
|
19730
19730
|
});
|
|
19731
|
-
class
|
|
19731
|
+
class Ge extends Error {
|
|
19732
19732
|
status;
|
|
19733
19733
|
errorKey;
|
|
19734
19734
|
payload;
|
|
@@ -19736,22 +19736,22 @@ class We extends Error {
|
|
|
19736
19736
|
super(n.message ?? `API error ${t}`), this.name = "ApiError", this.status = t, this.errorKey = n.errorKey ?? "unknown", this.payload = n;
|
|
19737
19737
|
}
|
|
19738
19738
|
}
|
|
19739
|
-
class LI extends
|
|
19739
|
+
class LI extends Ge {
|
|
19740
19740
|
constructor(t) {
|
|
19741
19741
|
super(401, t), this.name = "UnauthenticatedError";
|
|
19742
19742
|
}
|
|
19743
19743
|
}
|
|
19744
|
-
class Aw extends
|
|
19744
|
+
class Aw extends Ge {
|
|
19745
19745
|
constructor(t) {
|
|
19746
19746
|
super(403, t), this.name = "ForbiddenError";
|
|
19747
19747
|
}
|
|
19748
19748
|
}
|
|
19749
|
-
class zw extends
|
|
19749
|
+
class zw extends Ge {
|
|
19750
19750
|
constructor(t) {
|
|
19751
19751
|
super(404, t), this.name = "NotFoundError";
|
|
19752
19752
|
}
|
|
19753
19753
|
}
|
|
19754
|
-
class _o extends
|
|
19754
|
+
class _o extends Ge {
|
|
19755
19755
|
/** Field-keyed map of error messages. */
|
|
19756
19756
|
fields;
|
|
19757
19757
|
constructor(t) {
|
|
@@ -19781,11 +19781,11 @@ function Qg(a, t) {
|
|
|
19781
19781
|
case 422:
|
|
19782
19782
|
return new _o(t);
|
|
19783
19783
|
default:
|
|
19784
|
-
return new
|
|
19784
|
+
return new Ge(a, t);
|
|
19785
19785
|
}
|
|
19786
19786
|
}
|
|
19787
|
-
const
|
|
19788
|
-
const a =
|
|
19787
|
+
const Ne = Ue("admin-auth", () => {
|
|
19788
|
+
const a = q(null), t = q([]), n = q(null), r = M(() => a.value !== null), l = M(() => n.value !== null);
|
|
19789
19789
|
function i(g) {
|
|
19790
19790
|
a.value = g.user, t.value = g.permissions;
|
|
19791
19791
|
}
|
|
@@ -19811,10 +19811,10 @@ const Ge = $e("admin-auth", () => {
|
|
|
19811
19811
|
);
|
|
19812
19812
|
return p?.user && (a.value = p.user), Array.isArray(p?.permissions) && (t.value = p.permissions), n.value = null, "authenticated";
|
|
19813
19813
|
} catch (p) {
|
|
19814
|
-
if (p instanceof
|
|
19815
|
-
const
|
|
19814
|
+
if (p instanceof Ge && p.errorKey === "two_factor_required") {
|
|
19815
|
+
const _ = p.payload.challenge_token;
|
|
19816
19816
|
return n.value = {
|
|
19817
|
-
challengeToken: typeof
|
|
19817
|
+
challengeToken: typeof _ == "string" ? _ : "",
|
|
19818
19818
|
remember: g.remember ?? !1
|
|
19819
19819
|
}, "two_factor_required";
|
|
19820
19820
|
}
|
|
@@ -19878,7 +19878,7 @@ const Ge = $e("admin-auth", () => {
|
|
|
19878
19878
|
}, Vw = /* @__PURE__ */ ee({
|
|
19879
19879
|
__name: "UserMenu",
|
|
19880
19880
|
setup(a) {
|
|
19881
|
-
const t =
|
|
19881
|
+
const t = Ne(), n = Xe();
|
|
19882
19882
|
async function r() {
|
|
19883
19883
|
try {
|
|
19884
19884
|
await t.logout();
|
|
@@ -19986,9 +19986,9 @@ const Ge = $e("admin-auth", () => {
|
|
|
19986
19986
|
v(Vw)
|
|
19987
19987
|
]));
|
|
19988
19988
|
}
|
|
19989
|
-
}), bI =
|
|
19990
|
-
const a =
|
|
19991
|
-
const k =
|
|
19989
|
+
}), bI = Ue("admin-menu", () => {
|
|
19990
|
+
const a = q([]), t = q(!1), n = q(null), r = q(!1), l = M(() => {
|
|
19991
|
+
const k = Ne(), m = (x) => {
|
|
19992
19992
|
if (Array.isArray(x.permissions) && x.permissions.length > 0 && !k.hasAnyPermission(x.permissions))
|
|
19993
19993
|
return null;
|
|
19994
19994
|
const b = (x.children ?? []).map(m).filter((L) => L !== null);
|
|
@@ -20049,7 +20049,7 @@ const Ge = $e("admin-auth", () => {
|
|
|
20049
20049
|
box: e2,
|
|
20050
20050
|
briefcase: L2,
|
|
20051
20051
|
calendar: a2,
|
|
20052
|
-
"check-circle":
|
|
20052
|
+
"check-circle": Ze,
|
|
20053
20053
|
clock: S2,
|
|
20054
20054
|
code: _2,
|
|
20055
20055
|
cog: q2,
|
|
@@ -20065,10 +20065,10 @@ const Ge = $e("admin-auth", () => {
|
|
|
20065
20065
|
"folder-open": F2,
|
|
20066
20066
|
gauge: D2,
|
|
20067
20067
|
globe: c2,
|
|
20068
|
-
grid:
|
|
20068
|
+
grid: Ee,
|
|
20069
20069
|
"hard-drive": R2,
|
|
20070
20070
|
hash: T2,
|
|
20071
|
-
"health-check":
|
|
20071
|
+
"health-check": Ze,
|
|
20072
20072
|
heart: $2,
|
|
20073
20073
|
"help-circle": y1,
|
|
20074
20074
|
history: U2,
|
|
@@ -20144,7 +20144,7 @@ const Tw = ["data-depth"], $w = ["aria-expanded", "title"], Uw = { class: "uid-s
|
|
|
20144
20144
|
setup(a) {
|
|
20145
20145
|
const t = a, n = l1(), r = M(
|
|
20146
20146
|
() => Array.isArray(t.item.children) && t.item.children.length > 0
|
|
20147
|
-
), l =
|
|
20147
|
+
), l = q(!1);
|
|
20148
20148
|
function i(g) {
|
|
20149
20149
|
if (g.routeName && n.name === g.routeName || g.url && n.path === g.url) return !0;
|
|
20150
20150
|
if (g.routeName && typeof n.name == "string") {
|
|
@@ -20234,9 +20234,9 @@ const Tw = ["data-depth"], $w = ["aria-expanded", "title"], Uw = { class: "uid-s
|
|
|
20234
20234
|
_: 1
|
|
20235
20235
|
}, 8, ["to", "active", "badge", "title"])),
|
|
20236
20236
|
r.value && l.value ? (o(), s("div", Ew, [
|
|
20237
|
-
(o(!0), s(E, null, Q(a.item.children, (
|
|
20238
|
-
key:
|
|
20239
|
-
item:
|
|
20237
|
+
(o(!0), s(E, null, Q(a.item.children, (_) => (o(), V(p, {
|
|
20238
|
+
key: _.key,
|
|
20239
|
+
item: _,
|
|
20240
20240
|
depth: a.depth + 1,
|
|
20241
20241
|
collapsed: a.collapsed,
|
|
20242
20242
|
"stripe-at": a.stripeAt,
|
|
@@ -20381,7 +20381,7 @@ const Tw = ["data-depth"], $w = ["aria-expanded", "title"], Uw = { class: "uid-s
|
|
|
20381
20381
|
},
|
|
20382
20382
|
emits: ["update:collapsed", "exit-impersonation"],
|
|
20383
20383
|
setup(a, { emit: t }) {
|
|
20384
|
-
const n = a, r = t, l =
|
|
20384
|
+
const n = a, r = t, l = q(!1), i = M(() => n.collapsed !== void 0), d = M(
|
|
20385
20385
|
() => i.value ? n.collapsed : l.value
|
|
20386
20386
|
);
|
|
20387
20387
|
function h(k) {
|
|
@@ -20440,8 +20440,8 @@ const Tw = ["data-depth"], $w = ["aria-expanded", "title"], Uw = { class: "uid-s
|
|
|
20440
20440
|
}, 8, ["model-value"])
|
|
20441
20441
|
]));
|
|
20442
20442
|
}
|
|
20443
|
-
}), Wg =
|
|
20444
|
-
const a =
|
|
20443
|
+
}), Wg = Ue("admin-navigation", () => {
|
|
20444
|
+
const a = q(0), t = M(() => a.value > 0);
|
|
20445
20445
|
function n() {
|
|
20446
20446
|
a.value += 1;
|
|
20447
20447
|
}
|
|
@@ -20455,7 +20455,7 @@ const Tw = ["data-depth"], $w = ["aria-expanded", "title"], Uw = { class: "uid-s
|
|
|
20455
20455
|
}), cx = /* @__PURE__ */ ee({
|
|
20456
20456
|
__name: "AdminLoadingBar",
|
|
20457
20457
|
setup(a) {
|
|
20458
|
-
const t = Wg(), n =
|
|
20458
|
+
const t = Wg(), n = q(!1);
|
|
20459
20459
|
let r = null;
|
|
20460
20460
|
xe(
|
|
20461
20461
|
() => t.isLoading,
|
|
@@ -20538,7 +20538,7 @@ const Tw = ["data-depth"], $w = ["aria-expanded", "title"], Uw = { class: "uid-s
|
|
|
20538
20538
|
}
|
|
20539
20539
|
function k(S) {
|
|
20540
20540
|
const p = S.type.toLowerCase();
|
|
20541
|
-
return p.includes("import") || p.includes("finished") || p.includes("success") ?
|
|
20541
|
+
return p.includes("import") || p.includes("finished") || p.includes("success") ? Ze : p.includes("comment") || p.includes("message") || p.includes("mention") ? d2 : p.includes("user") || p.includes("member") || p.includes("role") ? Io : p.includes("warning") || p.includes("schedule") ? I1 : p.includes("delete") || p.includes("failed") || p.includes("error") ? Re : Ze;
|
|
20542
20542
|
}
|
|
20543
20543
|
function m(S) {
|
|
20544
20544
|
const p = S.type.toLowerCase();
|
|
@@ -20548,16 +20548,16 @@ const Tw = ["data-depth"], $w = ["aria-expanded", "title"], Uw = { class: "uid-s
|
|
|
20548
20548
|
if (!S) return "";
|
|
20549
20549
|
const p = new Date(S).getTime();
|
|
20550
20550
|
if (Number.isNaN(p)) return "";
|
|
20551
|
-
const
|
|
20552
|
-
return
|
|
20551
|
+
const _ = (Date.now() - p) / 1e3;
|
|
20552
|
+
return _ < 60 ? `${Math.max(1, Math.floor(_))} сек назад` : _ < 3600 ? `${Math.floor(_ / 60)} мин назад` : _ < 86400 ? `${Math.floor(_ / 3600)} ч назад` : _ < 86400 * 2 ? "вчера" : _ < 86400 * 7 ? `${Math.floor(_ / 86400)} д назад` : new Date(S).toLocaleDateString("ru-RU");
|
|
20553
20553
|
}
|
|
20554
20554
|
function b(S) {
|
|
20555
|
-
const p = S.data,
|
|
20556
|
-
return { title:
|
|
20555
|
+
const p = S.data, _ = typeof p.title == "string" ? p.title : typeof p.subject == "string" ? p.subject : "Уведомление", T = typeof p.description == "string" ? p.description : typeof p.message == "string" ? p.message : typeof p.text == "string" ? p.text : "";
|
|
20556
|
+
return { title: _, description: T };
|
|
20557
20557
|
}
|
|
20558
20558
|
const L = M(() => {
|
|
20559
|
-
const p = t.meta?.total ?? t.items.length,
|
|
20560
|
-
return { all: p, unread:
|
|
20559
|
+
const p = t.meta?.total ?? t.items.length, _ = t.unreadCount, T = Math.max(0, p - _);
|
|
20560
|
+
return { all: p, unread: _, read: T };
|
|
20561
20561
|
});
|
|
20562
20562
|
xe(n, async (S) => {
|
|
20563
20563
|
S ? (await t.load(t.lastFilter, 1).catch(() => {
|
|
@@ -20609,56 +20609,56 @@ const Tw = ["data-depth"], $w = ["aria-expanded", "title"], Uw = { class: "uid-s
|
|
|
20609
20609
|
])
|
|
20610
20610
|
]),
|
|
20611
20611
|
u("nav", ux, [
|
|
20612
|
-
(o(), s(E, null, Q(r, (
|
|
20613
|
-
key:
|
|
20612
|
+
(o(), s(E, null, Q(r, (_) => u("button", {
|
|
20613
|
+
key: _.key,
|
|
20614
20614
|
type: "button",
|
|
20615
20615
|
role: "tab",
|
|
20616
20616
|
class: fe([
|
|
20617
20617
|
"admin-notif-drawer__tab",
|
|
20618
20618
|
{
|
|
20619
|
-
"admin-notif-drawer__tab--active": c(t).lastFilter ===
|
|
20619
|
+
"admin-notif-drawer__tab--active": c(t).lastFilter === _.key
|
|
20620
20620
|
}
|
|
20621
20621
|
]),
|
|
20622
|
-
"aria-selected": c(t).lastFilter ===
|
|
20623
|
-
onClick: (
|
|
20622
|
+
"aria-selected": c(t).lastFilter === _.key,
|
|
20623
|
+
onClick: (T) => l(_.key)
|
|
20624
20624
|
}, [
|
|
20625
|
-
j(w(
|
|
20626
|
-
u("span", px, w(L.value[
|
|
20625
|
+
j(w(_.label) + " ", 1),
|
|
20626
|
+
u("span", px, w(L.value[_.key]), 1)
|
|
20627
20627
|
], 10, yx)), 64))
|
|
20628
20628
|
]),
|
|
20629
20629
|
u("div", kx, [
|
|
20630
20630
|
c(t).loading && c(t).items.length === 0 ? (o(), s("div", mx, " Загрузка… ")) : c(t).items.length === 0 ? (o(), s("div", vx, " Нет уведомлений ")) : (o(), s("ol", fx, [
|
|
20631
|
-
(o(!0), s(E, null, Q(c(t).items, (
|
|
20632
|
-
key:
|
|
20631
|
+
(o(!0), s(E, null, Q(c(t).items, (_) => (o(), s("li", {
|
|
20632
|
+
key: _.id,
|
|
20633
20633
|
class: fe([
|
|
20634
20634
|
"admin-notif-drawer__item",
|
|
20635
|
-
{ "admin-notif-drawer__item--unread":
|
|
20635
|
+
{ "admin-notif-drawer__item--unread": _.read_at === null }
|
|
20636
20636
|
]),
|
|
20637
|
-
onClick: (
|
|
20637
|
+
onClick: (T) => d(_)
|
|
20638
20638
|
}, [
|
|
20639
20639
|
u("span", {
|
|
20640
20640
|
class: "admin-notif-drawer__icon",
|
|
20641
|
-
"data-variant": m(
|
|
20641
|
+
"data-variant": m(_),
|
|
20642
20642
|
"aria-hidden": "true"
|
|
20643
20643
|
}, [
|
|
20644
20644
|
v(c(Y), {
|
|
20645
|
-
icon: k(
|
|
20645
|
+
icon: k(_),
|
|
20646
20646
|
size: 14
|
|
20647
20647
|
}, null, 8, ["icon"])
|
|
20648
20648
|
], 8, gx),
|
|
20649
20649
|
u("div", Ix, [
|
|
20650
20650
|
u("div", wx, [
|
|
20651
|
-
u("span", xx, w(b(
|
|
20652
|
-
u("span", Lx, w(x(
|
|
20651
|
+
u("span", xx, w(b(_).title), 1),
|
|
20652
|
+
u("span", Lx, w(x(_.created_at)), 1)
|
|
20653
20653
|
]),
|
|
20654
|
-
b(
|
|
20654
|
+
b(_).description ? (o(), s("div", bx, w(b(_).description), 1)) : F("", !0)
|
|
20655
20655
|
]),
|
|
20656
|
-
|
|
20656
|
+
_.read_at === null ? (o(), s("span", Cx)) : F("", !0),
|
|
20657
20657
|
u("button", {
|
|
20658
20658
|
type: "button",
|
|
20659
20659
|
class: "admin-notif-drawer__item-delete",
|
|
20660
20660
|
"aria-label": "Удалить",
|
|
20661
|
-
onClick: ve((
|
|
20661
|
+
onClick: ve((T) => h(_, T), ["stop"])
|
|
20662
20662
|
}, [
|
|
20663
20663
|
v(c(Y), {
|
|
20664
20664
|
icon: c(He),
|
|
@@ -20675,31 +20675,34 @@ const Tw = ["data-depth"], $w = ["aria-expanded", "title"], Uw = { class: "uid-s
|
|
|
20675
20675
|
})
|
|
20676
20676
|
]));
|
|
20677
20677
|
}
|
|
20678
|
-
}),
|
|
20679
|
-
const a =
|
|
20680
|
-
function m(
|
|
20681
|
-
return d.value.find((
|
|
20678
|
+
}), Te = Ue("admin-manifest", () => {
|
|
20679
|
+
const a = q(null), t = q(!1), n = q(null), r = q(!1), l = M(() => a.value !== null), i = M(() => a.value?.version ?? null), d = M(() => a.value?.resources ?? []), h = M(() => a.value?.screens ?? []), y = M(() => a.value?.settings ?? []), k = M(() => a.value?.plugins ?? []);
|
|
20680
|
+
function m(p) {
|
|
20681
|
+
return d.value.find((_) => _.slug === p) ?? null;
|
|
20682
|
+
}
|
|
20683
|
+
function x(p) {
|
|
20684
|
+
return h.value.find((_) => _.slug === p) ?? null;
|
|
20682
20685
|
}
|
|
20683
|
-
function
|
|
20684
|
-
return
|
|
20686
|
+
function b(p) {
|
|
20687
|
+
return y.value.find((_) => _.slug === p) ?? null;
|
|
20685
20688
|
}
|
|
20686
|
-
function
|
|
20687
|
-
|
|
20689
|
+
function L() {
|
|
20690
|
+
a.value = null;
|
|
20688
20691
|
}
|
|
20689
|
-
async function
|
|
20690
|
-
if (a.value !== null && !
|
|
20692
|
+
async function g(p = !1) {
|
|
20693
|
+
if (a.value !== null && !p)
|
|
20691
20694
|
return a.value;
|
|
20692
20695
|
t.value = !0, n.value = null;
|
|
20693
20696
|
try {
|
|
20694
|
-
const
|
|
20695
|
-
return a.value =
|
|
20696
|
-
} catch (
|
|
20697
|
-
throw n.value =
|
|
20697
|
+
const T = await Me().get("/system/manifest");
|
|
20698
|
+
return a.value = T, T;
|
|
20699
|
+
} catch (_) {
|
|
20700
|
+
throw n.value = _ instanceof Error ? _ : new Error(String(_)), _;
|
|
20698
20701
|
} finally {
|
|
20699
20702
|
t.value = !1;
|
|
20700
20703
|
}
|
|
20701
20704
|
}
|
|
20702
|
-
function
|
|
20705
|
+
function S() {
|
|
20703
20706
|
a.value = null, n.value = null, t.value = !1, r.value = !1;
|
|
20704
20707
|
}
|
|
20705
20708
|
return {
|
|
@@ -20719,8 +20722,9 @@ const Tw = ["data-depth"], $w = ["aria-expanded", "title"], Uw = { class: "uid-s
|
|
|
20719
20722
|
getResource: m,
|
|
20720
20723
|
getScreen: x,
|
|
20721
20724
|
getSettings: b,
|
|
20722
|
-
load:
|
|
20723
|
-
|
|
20725
|
+
load: g,
|
|
20726
|
+
invalidate: L,
|
|
20727
|
+
reset: S
|
|
20724
20728
|
};
|
|
20725
20729
|
});
|
|
20726
20730
|
function Do(a, t) {
|
|
@@ -20750,7 +20754,7 @@ const we = {
|
|
|
20750
20754
|
}, Hx = /* @__PURE__ */ ee({
|
|
20751
20755
|
__name: "AdminApp",
|
|
20752
20756
|
setup(a) {
|
|
20753
|
-
const t = l1(), n =
|
|
20757
|
+
const t = l1(), n = Te(), r = Ne(), l = M(() => {
|
|
20754
20758
|
const y = r.user;
|
|
20755
20759
|
return y?.impersonator ? { asName: String(y?.name ?? "?") } : null;
|
|
20756
20760
|
});
|
|
@@ -20806,18 +20810,18 @@ const we = {
|
|
|
20806
20810
|
], 64);
|
|
20807
20811
|
};
|
|
20808
20812
|
}
|
|
20809
|
-
}), SI =
|
|
20810
|
-
const a =
|
|
20813
|
+
}), SI = Ue("admin-dashboard", () => {
|
|
20814
|
+
const a = q(null), t = q(!1), n = q([]), r = q([]), l = q(!1), i = q(!1), d = M(() => JSON.stringify(n.value) !== JSON.stringify(r.value));
|
|
20811
20815
|
async function h(P) {
|
|
20812
20816
|
a.value = P, i.value = !0;
|
|
20813
20817
|
try {
|
|
20814
|
-
const
|
|
20818
|
+
const $ = ((await Me().get(
|
|
20815
20819
|
`/dashboard/get?key=${encodeURIComponent(P)}`
|
|
20816
|
-
)).layout ?? []).map((H,
|
|
20820
|
+
)).layout ?? []).map((H, U) => ({
|
|
20817
20821
|
...H,
|
|
20818
|
-
position: H.position ??
|
|
20822
|
+
position: H.position ?? U
|
|
20819
20823
|
}));
|
|
20820
|
-
r.value =
|
|
20824
|
+
r.value = $, n.value = $.map((H) => ({ ...H }));
|
|
20821
20825
|
} catch {
|
|
20822
20826
|
r.value = [], n.value = [];
|
|
20823
20827
|
} finally {
|
|
@@ -20828,7 +20832,7 @@ const we = {
|
|
|
20828
20832
|
t.value = !0;
|
|
20829
20833
|
}
|
|
20830
20834
|
function k(P) {
|
|
20831
|
-
n.value.length === 0 && (n.value = P.map((
|
|
20835
|
+
n.value.length === 0 && (n.value = P.map((z) => ({ ...z })));
|
|
20832
20836
|
}
|
|
20833
20837
|
function m() {
|
|
20834
20838
|
n.value = r.value.map((P) => ({ ...P })), t.value = !1;
|
|
@@ -20837,15 +20841,15 @@ const we = {
|
|
|
20837
20841
|
if (a.value !== null) {
|
|
20838
20842
|
l.value = !0;
|
|
20839
20843
|
try {
|
|
20840
|
-
const P = Me(),
|
|
20844
|
+
const P = Me(), z = n.value.map((W, $) => ({
|
|
20841
20845
|
slug: W.slug,
|
|
20842
20846
|
size: W.size,
|
|
20843
|
-
position:
|
|
20847
|
+
position: $,
|
|
20844
20848
|
hidden: W.hidden ?? !1,
|
|
20845
20849
|
type: W.type,
|
|
20846
20850
|
config: W.config
|
|
20847
20851
|
}));
|
|
20848
|
-
await P.post("/dashboard/save", { key: a.value, widgets:
|
|
20852
|
+
await P.post("/dashboard/save", { key: a.value, widgets: z }), r.value = n.value.map((W) => ({ ...W })), t.value = !1;
|
|
20849
20853
|
} finally {
|
|
20850
20854
|
l.value = !1;
|
|
20851
20855
|
}
|
|
@@ -20868,22 +20872,22 @@ const we = {
|
|
|
20868
20872
|
];
|
|
20869
20873
|
}
|
|
20870
20874
|
function g(P) {
|
|
20871
|
-
n.value = n.value.filter((
|
|
20875
|
+
n.value = n.value.filter((z) => z.slug !== P);
|
|
20872
20876
|
}
|
|
20873
|
-
function S(P,
|
|
20877
|
+
function S(P, z) {
|
|
20874
20878
|
n.value = n.value.map(
|
|
20875
|
-
(W) => W.slug === P ? { ...W, ...
|
|
20879
|
+
(W) => W.slug === P ? { ...W, ...z } : W
|
|
20876
20880
|
);
|
|
20877
20881
|
}
|
|
20878
|
-
function p(P,
|
|
20879
|
-
if (P ===
|
|
20880
|
-
const W = [...n.value], [
|
|
20881
|
-
W.splice(
|
|
20882
|
+
function p(P, z) {
|
|
20883
|
+
if (P === z) return;
|
|
20884
|
+
const W = [...n.value], [$] = W.splice(P, 1);
|
|
20885
|
+
W.splice(z, 0, $), n.value = W;
|
|
20882
20886
|
}
|
|
20883
|
-
function
|
|
20887
|
+
function _(P) {
|
|
20884
20888
|
n.value = P;
|
|
20885
20889
|
}
|
|
20886
|
-
function
|
|
20890
|
+
function T() {
|
|
20887
20891
|
a.value = null, t.value = !1, n.value = [], r.value = [];
|
|
20888
20892
|
}
|
|
20889
20893
|
return {
|
|
@@ -20904,11 +20908,11 @@ const we = {
|
|
|
20904
20908
|
removeWidget: g,
|
|
20905
20909
|
updateWidget: S,
|
|
20906
20910
|
moveWidget: p,
|
|
20907
|
-
setDraft:
|
|
20908
|
-
reset:
|
|
20911
|
+
setDraft: _,
|
|
20912
|
+
reset: T
|
|
20909
20913
|
};
|
|
20910
|
-
}), Gg =
|
|
20911
|
-
const a =
|
|
20914
|
+
}), Gg = Ue("admin-i18n", () => {
|
|
20915
|
+
const a = q({}), t = q("ru");
|
|
20912
20916
|
function n(d) {
|
|
20913
20917
|
const h = d.translations;
|
|
20914
20918
|
h && typeof h == "object" && (a.value = { ...h }), t.value = d.locale ?? "ru";
|
|
@@ -20962,7 +20966,7 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
20962
20966
|
type: {}
|
|
20963
20967
|
},
|
|
20964
20968
|
setup(a) {
|
|
20965
|
-
return (t, n) => (o(), V(c(
|
|
20969
|
+
return (t, n) => (o(), V(c(We), { variant: "warning" }, {
|
|
20966
20970
|
title: f(() => [
|
|
20967
20971
|
j("Неизвестный widget-тип: " + w(a.type), 1)
|
|
20968
20972
|
]),
|
|
@@ -21082,18 +21086,18 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21082
21086
|
},
|
|
21083
21087
|
emits: ["close", "add", "save"],
|
|
21084
21088
|
setup(a, { emit: t }) {
|
|
21085
|
-
const n = a, r = t, l = M(() => Fx()), i =
|
|
21089
|
+
const n = a, r = t, l = M(() => Fx()), i = q(""), d = q(""), h = q("6"), y = q(`# Новая заметка
|
|
21086
21090
|
|
|
21087
|
-
Текст…`), k =
|
|
21091
|
+
Текст…`), k = q("LABEL"), m = q("0"), x = q("50"), b = q("Янв, Фев, Мар, Апр"), L = q("10, 20, 15, 30"), g = q(""), S = q("5");
|
|
21088
21092
|
xe(
|
|
21089
21093
|
() => n.open,
|
|
21090
|
-
(
|
|
21091
|
-
if (
|
|
21094
|
+
($) => {
|
|
21095
|
+
if ($)
|
|
21092
21096
|
if (n.mode === "configure" && n.item) {
|
|
21093
21097
|
const H = n.item.config ?? {};
|
|
21094
21098
|
i.value = n.item.type ?? "", d.value = H.title ?? n.initialTitle, h.value = String(n.item.size ?? 6), y.value = H.content ?? y.value;
|
|
21095
|
-
const
|
|
21096
|
-
|
|
21099
|
+
const U = H.stats?.[0];
|
|
21100
|
+
U && (k.value = String(U.label ?? ""), m.value = String(U.value ?? "")), x.value = String(H.value ?? 50);
|
|
21097
21101
|
const G = H.labels, ae = H.datasets;
|
|
21098
21102
|
G && G.length > 0 && (b.value = G.join(", ")), ae && ae[0]?.data && (L.value = ae[0].data.join(", ")), g.value = H.resource ?? "", S.value = String(H.limit ?? 5);
|
|
21099
21103
|
} else
|
|
@@ -21102,7 +21106,7 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21102
21106
|
);
|
|
21103
21107
|
const p = M(
|
|
21104
21108
|
() => i.value !== "" && d.value.trim() !== ""
|
|
21105
|
-
),
|
|
21109
|
+
), _ = {
|
|
21106
21110
|
stat: "Stat — карточка с числом",
|
|
21107
21111
|
stats: "Stats overview — несколько метрик",
|
|
21108
21112
|
chart: "Chart — линия / столбцы / донат",
|
|
@@ -21115,43 +21119,43 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21115
21119
|
gauge: "Gauge — шкала со значением",
|
|
21116
21120
|
markdown: "Markdown — заметка / текст"
|
|
21117
21121
|
};
|
|
21118
|
-
function
|
|
21119
|
-
return
|
|
21122
|
+
function T($) {
|
|
21123
|
+
return $ === "markdown" ? "markdown" : $ === "stat" || $ === "stats" ? "stat" : $ === "gauge" ? "gauge" : $ === "chart" || $ === "bar-chart" || $ === "donut-chart" ? "chart" : $ === "recent-table" || $ === "recent_list" || $ === "recent-list" ? "recent" : null;
|
|
21120
21124
|
}
|
|
21121
21125
|
function P() {
|
|
21122
|
-
const
|
|
21123
|
-
switch (
|
|
21126
|
+
const $ = { title: d.value };
|
|
21127
|
+
switch (T(i.value)) {
|
|
21124
21128
|
case "markdown":
|
|
21125
|
-
|
|
21129
|
+
$.content = y.value;
|
|
21126
21130
|
break;
|
|
21127
21131
|
case "stat":
|
|
21128
|
-
|
|
21132
|
+
$.stats = [{ label: k.value, value: m.value }];
|
|
21129
21133
|
break;
|
|
21130
21134
|
case "gauge":
|
|
21131
|
-
|
|
21135
|
+
$.value = Number(x.value) || 0, $.min = 0, $.max = 100;
|
|
21132
21136
|
break;
|
|
21133
21137
|
case "chart": {
|
|
21134
|
-
const H = b.value.split(",").map((G) => G.trim()).filter(Boolean),
|
|
21135
|
-
|
|
21138
|
+
const H = b.value.split(",").map((G) => G.trim()).filter(Boolean), U = L.value.split(",").map((G) => Number(G.trim())).filter((G) => !Number.isNaN(G));
|
|
21139
|
+
$.labels = H, $.datasets = [{ label: d.value, data: U }], $.type = i.value === "donut-chart" ? "doughnut" : "bar";
|
|
21136
21140
|
break;
|
|
21137
21141
|
}
|
|
21138
21142
|
case "recent":
|
|
21139
|
-
|
|
21143
|
+
$.resource = g.value, $.limit = Number(S.value) || 5;
|
|
21140
21144
|
break;
|
|
21141
21145
|
}
|
|
21142
|
-
return
|
|
21146
|
+
return $;
|
|
21143
21147
|
}
|
|
21144
|
-
function
|
|
21148
|
+
function z() {
|
|
21145
21149
|
if (!p.value) return;
|
|
21146
|
-
const
|
|
21150
|
+
const $ = Math.max(1, Math.min(12, Number(h.value) || 6)), H = P();
|
|
21147
21151
|
if (n.mode === "configure" && n.item)
|
|
21148
|
-
r("save", { size:
|
|
21152
|
+
r("save", { size: $, type: i.value, config: H });
|
|
21149
21153
|
else {
|
|
21150
|
-
const
|
|
21154
|
+
const U = `custom.${i.value}.${Date.now()}`;
|
|
21151
21155
|
r("add", {
|
|
21152
|
-
slug:
|
|
21156
|
+
slug: U,
|
|
21153
21157
|
type: i.value,
|
|
21154
|
-
size:
|
|
21158
|
+
size: $,
|
|
21155
21159
|
config: H
|
|
21156
21160
|
});
|
|
21157
21161
|
}
|
|
@@ -21160,7 +21164,7 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21160
21164
|
function W() {
|
|
21161
21165
|
r("close");
|
|
21162
21166
|
}
|
|
21163
|
-
return (
|
|
21167
|
+
return ($, H) => (o(), V(Tg, { to: "body" }, [
|
|
21164
21168
|
v(ug, { name: "admin-dialog" }, {
|
|
21165
21169
|
default: f(() => [
|
|
21166
21170
|
a.open ? (o(), s("div", $x, [
|
|
@@ -21190,17 +21194,17 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21190
21194
|
u("span", { class: "admin-dialog__required" }, "*")
|
|
21191
21195
|
], -1)),
|
|
21192
21196
|
u("div", Gx, [
|
|
21193
|
-
(o(!0), s(E, null, Q(l.value, (
|
|
21194
|
-
key:
|
|
21197
|
+
(o(!0), s(E, null, Q(l.value, (U) => (o(), s("button", {
|
|
21198
|
+
key: U,
|
|
21195
21199
|
type: "button",
|
|
21196
21200
|
class: fe([
|
|
21197
21201
|
"admin-dialog__type-card",
|
|
21198
|
-
{ "admin-dialog__type-card--active": i.value ===
|
|
21202
|
+
{ "admin-dialog__type-card--active": i.value === U }
|
|
21199
21203
|
]),
|
|
21200
|
-
onClick: (G) => i.value =
|
|
21204
|
+
onClick: (G) => i.value = U
|
|
21201
21205
|
}, [
|
|
21202
|
-
u("span", Xx, w(
|
|
21203
|
-
u("span", Kx, w(
|
|
21206
|
+
u("span", Xx, w(U), 1),
|
|
21207
|
+
u("span", Kx, w(_[U] ?? ""), 1)
|
|
21204
21208
|
], 10, Nx))), 128))
|
|
21205
21209
|
])
|
|
21206
21210
|
])) : (o(), s("div", Jx, [
|
|
@@ -21214,7 +21218,7 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21214
21218
|
], -1)),
|
|
21215
21219
|
v(c(Ce), {
|
|
21216
21220
|
modelValue: d.value,
|
|
21217
|
-
"onUpdate:modelValue": H[0] || (H[0] = (
|
|
21221
|
+
"onUpdate:modelValue": H[0] || (H[0] = (U) => d.value = U),
|
|
21218
21222
|
placeholder: "Название виджета"
|
|
21219
21223
|
}, null, 8, ["modelValue"])
|
|
21220
21224
|
]),
|
|
@@ -21222,47 +21226,47 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21222
21226
|
H[13] || (H[13] = u("label", { class: "admin-dialog__label" }, "Ширина (1..12)", -1)),
|
|
21223
21227
|
v(c(Ce), {
|
|
21224
21228
|
modelValue: h.value,
|
|
21225
|
-
"onUpdate:modelValue": H[1] || (H[1] = (
|
|
21229
|
+
"onUpdate:modelValue": H[1] || (H[1] = (U) => h.value = U),
|
|
21226
21230
|
type: "number"
|
|
21227
21231
|
}, null, 8, ["modelValue"])
|
|
21228
21232
|
]),
|
|
21229
|
-
|
|
21233
|
+
T(i.value) === "markdown" ? (o(), s("div", aL, [
|
|
21230
21234
|
H[14] || (H[14] = u("label", { class: "admin-dialog__label" }, "Markdown содержимое", -1)),
|
|
21231
21235
|
w1(u("textarea", {
|
|
21232
|
-
"onUpdate:modelValue": H[2] || (H[2] = (
|
|
21236
|
+
"onUpdate:modelValue": H[2] || (H[2] = (U) => y.value = U),
|
|
21233
21237
|
class: "admin-dialog__textarea",
|
|
21234
21238
|
rows: "6"
|
|
21235
21239
|
}, null, 512), [
|
|
21236
21240
|
[$n, y.value]
|
|
21237
21241
|
])
|
|
21238
|
-
])) :
|
|
21242
|
+
])) : T(i.value) === "stat" ? (o(), s(E, { key: 3 }, [
|
|
21239
21243
|
u("div", tL, [
|
|
21240
21244
|
H[15] || (H[15] = u("label", { class: "admin-dialog__label" }, "Метка", -1)),
|
|
21241
21245
|
v(c(Ce), {
|
|
21242
21246
|
modelValue: k.value,
|
|
21243
|
-
"onUpdate:modelValue": H[3] || (H[3] = (
|
|
21247
|
+
"onUpdate:modelValue": H[3] || (H[3] = (U) => k.value = U)
|
|
21244
21248
|
}, null, 8, ["modelValue"])
|
|
21245
21249
|
]),
|
|
21246
21250
|
u("div", nL, [
|
|
21247
21251
|
H[16] || (H[16] = u("label", { class: "admin-dialog__label" }, "Значение", -1)),
|
|
21248
21252
|
v(c(Ce), {
|
|
21249
21253
|
modelValue: m.value,
|
|
21250
|
-
"onUpdate:modelValue": H[4] || (H[4] = (
|
|
21254
|
+
"onUpdate:modelValue": H[4] || (H[4] = (U) => m.value = U)
|
|
21251
21255
|
}, null, 8, ["modelValue"])
|
|
21252
21256
|
])
|
|
21253
|
-
], 64)) :
|
|
21257
|
+
], 64)) : T(i.value) === "gauge" ? (o(), s("div", oL, [
|
|
21254
21258
|
H[17] || (H[17] = u("label", { class: "admin-dialog__label" }, "Значение (0..100)", -1)),
|
|
21255
21259
|
v(c(Ce), {
|
|
21256
21260
|
modelValue: x.value,
|
|
21257
|
-
"onUpdate:modelValue": H[5] || (H[5] = (
|
|
21261
|
+
"onUpdate:modelValue": H[5] || (H[5] = (U) => x.value = U),
|
|
21258
21262
|
type: "number"
|
|
21259
21263
|
}, null, 8, ["modelValue"])
|
|
21260
|
-
])) :
|
|
21264
|
+
])) : T(i.value) === "chart" ? (o(), s(E, { key: 5 }, [
|
|
21261
21265
|
u("div", cL, [
|
|
21262
21266
|
H[18] || (H[18] = u("label", { class: "admin-dialog__label" }, "Метки (через запятую)", -1)),
|
|
21263
21267
|
v(c(Ce), {
|
|
21264
21268
|
modelValue: b.value,
|
|
21265
|
-
"onUpdate:modelValue": H[6] || (H[6] = (
|
|
21269
|
+
"onUpdate:modelValue": H[6] || (H[6] = (U) => b.value = U),
|
|
21266
21270
|
placeholder: "Янв, Фев, Мар"
|
|
21267
21271
|
}, null, 8, ["modelValue"])
|
|
21268
21272
|
]),
|
|
@@ -21270,16 +21274,16 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21270
21274
|
H[19] || (H[19] = u("label", { class: "admin-dialog__label" }, "Значения (через запятую)", -1)),
|
|
21271
21275
|
v(c(Ce), {
|
|
21272
21276
|
modelValue: L.value,
|
|
21273
|
-
"onUpdate:modelValue": H[7] || (H[7] = (
|
|
21277
|
+
"onUpdate:modelValue": H[7] || (H[7] = (U) => L.value = U),
|
|
21274
21278
|
placeholder: "10, 20, 15"
|
|
21275
21279
|
}, null, 8, ["modelValue"])
|
|
21276
21280
|
])
|
|
21277
|
-
], 64)) :
|
|
21281
|
+
], 64)) : T(i.value) === "recent" ? (o(), s(E, { key: 6 }, [
|
|
21278
21282
|
u("div", lL, [
|
|
21279
21283
|
H[20] || (H[20] = u("label", { class: "admin-dialog__label" }, "Resource slug", -1)),
|
|
21280
21284
|
v(c(Ce), {
|
|
21281
21285
|
modelValue: g.value,
|
|
21282
|
-
"onUpdate:modelValue": H[8] || (H[8] = (
|
|
21286
|
+
"onUpdate:modelValue": H[8] || (H[8] = (U) => g.value = U),
|
|
21283
21287
|
placeholder: "articles"
|
|
21284
21288
|
}, null, 8, ["modelValue"])
|
|
21285
21289
|
]),
|
|
@@ -21287,7 +21291,7 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21287
21291
|
H[21] || (H[21] = u("label", { class: "admin-dialog__label" }, "Limit", -1)),
|
|
21288
21292
|
v(c(Ce), {
|
|
21289
21293
|
modelValue: S.value,
|
|
21290
|
-
"onUpdate:modelValue": H[9] || (H[9] = (
|
|
21294
|
+
"onUpdate:modelValue": H[9] || (H[9] = (U) => S.value = U),
|
|
21291
21295
|
type: "number"
|
|
21292
21296
|
}, null, 8, ["modelValue"])
|
|
21293
21297
|
])
|
|
@@ -21312,7 +21316,7 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21312
21316
|
variant: "primary",
|
|
21313
21317
|
disabled: !p.value,
|
|
21314
21318
|
title: p.value ? void 0 : "Заполните обязательные поля",
|
|
21315
|
-
onClick:
|
|
21319
|
+
onClick: z
|
|
21316
21320
|
}, {
|
|
21317
21321
|
default: f(() => [
|
|
21318
21322
|
j(w(a.mode === "add" ? "Добавить" : "Сохранить"), 1)
|
|
@@ -21340,7 +21344,7 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21340
21344
|
},
|
|
21341
21345
|
emits: ["change-period", "export"],
|
|
21342
21346
|
setup(a, { emit: t }) {
|
|
21343
|
-
const n = a, r = t, l =
|
|
21347
|
+
const n = a, r = t, l = Te(), i = SI(), d = Gg(), h = l1(), y = M(() => {
|
|
21344
21348
|
if (n.slug) return n.slug;
|
|
21345
21349
|
const K = h?.meta?.slug;
|
|
21346
21350
|
if (typeof K == "string" && K.length > 0) return K;
|
|
@@ -21401,27 +21405,27 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21401
21405
|
const Le = String(ie.type ?? "");
|
|
21402
21406
|
return Le === "stats" || Le === "stat" ? 1 : Le === "gauge" || Le === "chart" || Le === "bar-chart" || Le === "donut-chart" || Le === "heatmap" || Le === "recent_list" || Le === "recent-list" || Le === "recent-table" || Le === "markdown" || Le === "iframe" || Le === "table" ? 2 : 1;
|
|
21403
21407
|
}
|
|
21404
|
-
const
|
|
21408
|
+
const _ = M(() => [
|
|
21405
21409
|
{ key: "7d", label: k("admin.dashboard.period.7d", "За 7 дней") },
|
|
21406
21410
|
{ key: "30d", label: k("admin.dashboard.period.30d", "За 30 дней") },
|
|
21407
21411
|
{ key: "90d", label: k("admin.dashboard.period.90d", "За 90 дней") },
|
|
21408
21412
|
{ key: "all", label: k("admin.dashboard.period.all", "Всё время") }
|
|
21409
|
-
]),
|
|
21410
|
-
async function
|
|
21411
|
-
|
|
21413
|
+
]), T = q("30d"), P = q(null);
|
|
21414
|
+
async function z(K, ie) {
|
|
21415
|
+
T.value = K, r("change-period", K), await W();
|
|
21412
21416
|
}
|
|
21413
21417
|
async function W() {
|
|
21414
21418
|
const K = y.value;
|
|
21415
21419
|
if (K)
|
|
21416
21420
|
try {
|
|
21417
21421
|
const { getAdminClient: ie } = await Promise.resolve().then(() => qe), se = await ie().get(
|
|
21418
|
-
`/dashboard/widgets?key=${encodeURIComponent(K)}&period=${encodeURIComponent(
|
|
21422
|
+
`/dashboard/widgets?key=${encodeURIComponent(K)}&period=${encodeURIComponent(T.value)}`
|
|
21419
21423
|
);
|
|
21420
21424
|
P.value = se.widgets;
|
|
21421
21425
|
} catch {
|
|
21422
21426
|
}
|
|
21423
21427
|
}
|
|
21424
|
-
let
|
|
21428
|
+
let $ = null;
|
|
21425
21429
|
const H = M(() => {
|
|
21426
21430
|
let K = 0;
|
|
21427
21431
|
for (const ie of x.value) {
|
|
@@ -21430,25 +21434,25 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21430
21434
|
}
|
|
21431
21435
|
return K;
|
|
21432
21436
|
});
|
|
21433
|
-
function
|
|
21437
|
+
function U() {
|
|
21434
21438
|
G();
|
|
21435
21439
|
const K = H.value;
|
|
21436
|
-
K <= 0 || (
|
|
21440
|
+
K <= 0 || ($ = setInterval(() => {
|
|
21437
21441
|
W();
|
|
21438
21442
|
}, K * 1e3));
|
|
21439
21443
|
}
|
|
21440
21444
|
function G() {
|
|
21441
|
-
|
|
21445
|
+
$ !== null && (clearInterval($), $ = null);
|
|
21442
21446
|
}
|
|
21443
21447
|
xe(
|
|
21444
21448
|
() => H.value,
|
|
21445
|
-
() =>
|
|
21449
|
+
() => U()
|
|
21446
21450
|
), e1(async () => {
|
|
21447
21451
|
l.manifest === null && await l.load().catch(() => {
|
|
21448
21452
|
});
|
|
21449
21453
|
const K = y.value;
|
|
21450
21454
|
K && await i.openDashboard(K).catch(() => {
|
|
21451
|
-
}),
|
|
21455
|
+
}), U();
|
|
21452
21456
|
}), Rg(() => {
|
|
21453
21457
|
G();
|
|
21454
21458
|
}), xe(
|
|
@@ -21459,15 +21463,15 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21459
21463
|
}
|
|
21460
21464
|
);
|
|
21461
21465
|
const ae = M(
|
|
21462
|
-
() =>
|
|
21463
|
-
), oe =
|
|
21466
|
+
() => _.value.find((K) => K.key === T.value)?.label ?? k("admin.dashboard.period.label", "Период")
|
|
21467
|
+
), oe = q(null), Z = q(null), X = q("");
|
|
21464
21468
|
function D() {
|
|
21465
21469
|
oe.value = "add", Z.value = null, X.value = "";
|
|
21466
21470
|
}
|
|
21467
21471
|
function I() {
|
|
21468
21472
|
oe.value = null;
|
|
21469
21473
|
}
|
|
21470
|
-
function
|
|
21474
|
+
function A() {
|
|
21471
21475
|
i.draft.length === 0 && i.seedDraft(
|
|
21472
21476
|
g.value.map(({ node: K, layoutSlug: ie }) => ({
|
|
21473
21477
|
slug: ie,
|
|
@@ -21519,7 +21523,7 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21519
21523
|
...K
|
|
21520
21524
|
});
|
|
21521
21525
|
}
|
|
21522
|
-
const de =
|
|
21526
|
+
const de = q(null), ce = q(null), me = q(!1);
|
|
21523
21527
|
function Se(K) {
|
|
21524
21528
|
if (!i.editMode) {
|
|
21525
21529
|
me.value = !1;
|
|
@@ -21563,11 +21567,11 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21563
21567
|
});
|
|
21564
21568
|
i.setDraft(K);
|
|
21565
21569
|
}
|
|
21566
|
-
const
|
|
21570
|
+
const Oe = q(null);
|
|
21567
21571
|
let Kn = 0;
|
|
21568
21572
|
function Ao(K, ie, re, se) {
|
|
21569
21573
|
if (!i.editMode) return;
|
|
21570
|
-
K.preventDefault(), K.stopPropagation(), d1(),
|
|
21574
|
+
K.preventDefault(), K.stopPropagation(), d1(), Oe.value = {
|
|
21571
21575
|
slug: ie,
|
|
21572
21576
|
startX: K.clientX,
|
|
21573
21577
|
startY: K.clientY,
|
|
@@ -21576,14 +21580,14 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21576
21580
|
}, Kn = K.target.closest(".admin-dashboard__grid")?.getBoundingClientRect().width ?? 1200, window.addEventListener("mousemove", Jn), window.addEventListener("mouseup", f2);
|
|
21577
21581
|
}
|
|
21578
21582
|
function Jn(K) {
|
|
21579
|
-
if (!
|
|
21580
|
-
const ie = Kn / 12, re = Math.round((K.clientX -
|
|
21583
|
+
if (!Oe.value) return;
|
|
21584
|
+
const ie = Kn / 12, re = Math.round((K.clientX - Oe.value.startX) / ie), se = Math.max(1, Math.min(12, Oe.value.startSpan + re)), pe = gL + IL, Le = Math.round((K.clientY - Oe.value.startY) / pe), t1 = Math.max(1, Math.min(6, Oe.value.startRowSpan + Le)), Yn = i.draft.find((Sg) => Sg.slug === Oe.value.slug);
|
|
21581
21585
|
if (!Yn) return;
|
|
21582
21586
|
const Cg = Yn.config?.rowSpan, Qn = {};
|
|
21583
|
-
Yn.size !== se && (Qn.size = se), Cg !== t1 && (Qn.config = { ...Yn.config ?? {}, rowSpan: t1 }), Object.keys(Qn).length > 0 && i.updateWidget(
|
|
21587
|
+
Yn.size !== se && (Qn.size = se), Cg !== t1 && (Qn.config = { ...Yn.config ?? {}, rowSpan: t1 }), Object.keys(Qn).length > 0 && i.updateWidget(Oe.value.slug, Qn);
|
|
21584
21588
|
}
|
|
21585
21589
|
function f2() {
|
|
21586
|
-
|
|
21590
|
+
Oe.value = null, window.removeEventListener("mousemove", Jn), window.removeEventListener("mouseup", f2);
|
|
21587
21591
|
}
|
|
21588
21592
|
function bg() {
|
|
21589
21593
|
r("export");
|
|
@@ -21621,9 +21625,9 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21621
21625
|
})
|
|
21622
21626
|
]),
|
|
21623
21627
|
default: f(() => [
|
|
21624
|
-
(o(!0), s(E, null, Q(
|
|
21628
|
+
(o(!0), s(E, null, Q(_.value, (re) => (o(), V(c(Ae), {
|
|
21625
21629
|
key: re.key,
|
|
21626
|
-
onClick: (se) =>
|
|
21630
|
+
onClick: (se) => z(re.key)
|
|
21627
21631
|
}, {
|
|
21628
21632
|
default: f(() => [
|
|
21629
21633
|
j(w(re.label), 1)
|
|
@@ -21708,7 +21712,7 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21708
21712
|
key: 0,
|
|
21709
21713
|
variant: "secondary",
|
|
21710
21714
|
size: "md",
|
|
21711
|
-
onClick:
|
|
21715
|
+
onClick: A
|
|
21712
21716
|
}, {
|
|
21713
21717
|
prepend: f(() => [
|
|
21714
21718
|
v(c(Y), {
|
|
@@ -21783,7 +21787,7 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21783
21787
|
}, bL = { class: "admin-home__grid" }, CL = ["onClick"], SL = { class: "admin-home__card-label" }, _L = { class: "admin-home__card-slug" }, qL = /* @__PURE__ */ ee({
|
|
21784
21788
|
__name: "HomePage",
|
|
21785
21789
|
setup(a) {
|
|
21786
|
-
const t =
|
|
21790
|
+
const t = Te(), n = Ne(), r = Xe(), l = M(() => n.user?.name ?? ""), i = M(() => t.manifest?.resources ?? []), d = M(
|
|
21787
21791
|
() => t.manifest?.dashboards ?? []
|
|
21788
21792
|
), h = M(
|
|
21789
21793
|
() => d.value[0]?.slug ?? null
|
|
@@ -21888,7 +21892,7 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21888
21892
|
}, DL = /* @__PURE__ */ ee({
|
|
21889
21893
|
__name: "SettingsPage",
|
|
21890
21894
|
setup(a) {
|
|
21891
|
-
const t = l1(), n =
|
|
21895
|
+
const t = l1(), n = Te(), r = M(() => String(t.params.slug ?? "")), l = M(() => n.manifest?.settings?.find((i) => i.slug === r.value) ?? null);
|
|
21892
21896
|
return (i, d) => (o(), s("div", PL, [
|
|
21893
21897
|
v(c(ge), { padding: "lg" }, {
|
|
21894
21898
|
default: f(() => [
|
|
@@ -21899,30 +21903,30 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21899
21903
|
})
|
|
21900
21904
|
]));
|
|
21901
21905
|
}
|
|
21902
|
-
}), RL =
|
|
21903
|
-
const a =
|
|
21904
|
-
function S(
|
|
21905
|
-
for (const ae of Object.keys(
|
|
21906
|
-
Object.assign(
|
|
21906
|
+
}), RL = Ue("admin-screen", () => {
|
|
21907
|
+
const a = q(null), t = q(""), n = q(null), r = q([]), l = q([]), i = q([]), d = q(null), h = q({}), y = q({}), k = q({}), m = q(!1), x = q(!1), b = q(null), L = q(null), g = M(() => b.value !== null);
|
|
21908
|
+
function S(U, G) {
|
|
21909
|
+
for (const ae of Object.keys(U)) delete U[ae];
|
|
21910
|
+
Object.assign(U, G);
|
|
21907
21911
|
}
|
|
21908
|
-
function p(
|
|
21909
|
-
return
|
|
21912
|
+
function p(U) {
|
|
21913
|
+
return U.map((G) => _(G));
|
|
21910
21914
|
}
|
|
21911
|
-
function
|
|
21912
|
-
const G = {
|
|
21913
|
-
return Array.isArray(
|
|
21914
|
-
(ae) => typeof ae == "object" && ae !== null ?
|
|
21915
|
-
) : Array.isArray(
|
|
21916
|
-
(ae) => typeof ae == "object" && ae !== null ?
|
|
21917
|
-
)),
|
|
21915
|
+
function _(U) {
|
|
21916
|
+
const G = { ...U };
|
|
21917
|
+
return Array.isArray(U.children) && U.items === void 0 ? G.items = U.children.map(
|
|
21918
|
+
(ae) => typeof ae == "object" && ae !== null ? _(ae) : ae
|
|
21919
|
+
) : Array.isArray(U.items) && (G.items = U.items.map(
|
|
21920
|
+
(ae) => typeof ae == "object" && ae !== null ? _(ae) : ae
|
|
21921
|
+
)), U.props && typeof U.props == "object" && Object.assign(G, U.props), G;
|
|
21918
21922
|
}
|
|
21919
|
-
function
|
|
21923
|
+
function T() {
|
|
21920
21924
|
a.value = null, t.value = "", n.value = null, r.value = [], l.value = [], i.value = [], d.value = null, S(h.value, {}), S(y.value, {}), k.value = {}, m.value = !1, x.value = !1, b.value = null, L.value = null;
|
|
21921
21925
|
}
|
|
21922
|
-
async function P(
|
|
21923
|
-
a.value =
|
|
21926
|
+
async function P(U, G) {
|
|
21927
|
+
a.value = U, m.value = !0, b.value = null, k.value = {};
|
|
21924
21928
|
try {
|
|
21925
|
-
const oe = await Me().get(`/${
|
|
21929
|
+
const oe = await Me().get(`/${U}/state`, {
|
|
21926
21930
|
params: G
|
|
21927
21931
|
});
|
|
21928
21932
|
t.value = oe.name, n.value = oe.description, r.value = p(oe.layout), l.value = oe.command_bar, i.value = oe.permissions, d.value = oe.etag, S(h.value, oe.state), S(y.value, oe.state);
|
|
@@ -21932,7 +21936,7 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21932
21936
|
m.value = !1;
|
|
21933
21937
|
}
|
|
21934
21938
|
}
|
|
21935
|
-
async function
|
|
21939
|
+
async function z(U, G) {
|
|
21936
21940
|
if (!a.value)
|
|
21937
21941
|
throw new Error("useScreenStore.runMethod() before slug set");
|
|
21938
21942
|
if (x.value)
|
|
@@ -21940,25 +21944,25 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21940
21944
|
x.value = !0, b.value = null, k.value = {}, L.value = null;
|
|
21941
21945
|
try {
|
|
21942
21946
|
const ae = Me(), oe = G ?? h.value, Z = await ae.post(`/${a.value}/runMethod`, {
|
|
21943
|
-
method:
|
|
21947
|
+
method: U,
|
|
21944
21948
|
payload: oe
|
|
21945
21949
|
});
|
|
21946
21950
|
return Z.state && Object.keys(Z.state).length > 0 && (S(h.value, Z.state), S(y.value, { ...Z.state })), Z.message && (L.value = Z.message), Z.refresh && await P(a.value).catch(() => {
|
|
21947
21951
|
}), Z;
|
|
21948
21952
|
} catch (ae) {
|
|
21949
|
-
throw ae instanceof _o ? k.value = { ...ae.fields } : (ae instanceof
|
|
21953
|
+
throw ae instanceof _o ? k.value = { ...ae.fields } : (ae instanceof Ge || ae instanceof Error) && (b.value = ae), ae;
|
|
21950
21954
|
} finally {
|
|
21951
21955
|
x.value = !1;
|
|
21952
21956
|
}
|
|
21953
21957
|
}
|
|
21954
|
-
function W(
|
|
21955
|
-
if (h.value[
|
|
21958
|
+
function W(U, G) {
|
|
21959
|
+
if (h.value[U] = G, k.value[U]) {
|
|
21956
21960
|
const ae = { ...k.value };
|
|
21957
|
-
delete ae[
|
|
21961
|
+
delete ae[U], k.value = ae;
|
|
21958
21962
|
}
|
|
21959
21963
|
}
|
|
21960
|
-
function
|
|
21961
|
-
k.value = {
|
|
21964
|
+
function $(U) {
|
|
21965
|
+
k.value = { ...U };
|
|
21962
21966
|
}
|
|
21963
21967
|
function H() {
|
|
21964
21968
|
k.value = {};
|
|
@@ -21982,11 +21986,11 @@ const p2 = gg(), Vx = p2.register, Px = p2.get, jx = p2.has, Fx = p2.list, GH =
|
|
|
21982
21986
|
// getters
|
|
21983
21987
|
hasError: g,
|
|
21984
21988
|
// actions
|
|
21985
|
-
reset:
|
|
21989
|
+
reset: T,
|
|
21986
21990
|
load: P,
|
|
21987
|
-
runMethod:
|
|
21991
|
+
runMethod: z,
|
|
21988
21992
|
setField: W,
|
|
21989
|
-
setErrors:
|
|
21993
|
+
setErrors: $,
|
|
21990
21994
|
clearErrors: H
|
|
21991
21995
|
};
|
|
21992
21996
|
}), Ng = /* @__PURE__ */ Symbol("admin.infolist-record");
|
|
@@ -22016,7 +22020,7 @@ const HI = /* @__PURE__ */ ee({
|
|
|
22016
22020
|
name: {}
|
|
22017
22021
|
},
|
|
22018
22022
|
setup(a) {
|
|
22019
|
-
return (t, n) => (o(), V(c(
|
|
22023
|
+
return (t, n) => (o(), V(c(We), { variant: "warning" }, {
|
|
22020
22024
|
title: f(() => [
|
|
22021
22025
|
j("Неизвестный тип поля: " + w(a.type), 1)
|
|
22022
22026
|
]),
|
|
@@ -22160,7 +22164,7 @@ const HI = /* @__PURE__ */ ee({
|
|
|
22160
22164
|
}, 1032, ["variant", "icon", "loading", "disabled", "onClick"]))), 128))
|
|
22161
22165
|
])) : F("", !0)
|
|
22162
22166
|
]),
|
|
22163
|
-
c(r).hasError ? (o(), V(c(
|
|
22167
|
+
c(r).hasError ? (o(), V(c(We), {
|
|
22164
22168
|
key: 0,
|
|
22165
22169
|
variant: "danger",
|
|
22166
22170
|
class: "admin-screen-page__alert",
|
|
@@ -22170,7 +22174,7 @@ const HI = /* @__PURE__ */ ee({
|
|
|
22170
22174
|
j(w(c(r).error?.message ?? "Не удалось выполнить действие"), 1)
|
|
22171
22175
|
]),
|
|
22172
22176
|
_: 1
|
|
22173
|
-
})) : c(r).lastMessage ? (o(), V(c(
|
|
22177
|
+
})) : c(r).lastMessage ? (o(), V(c(We), {
|
|
22174
22178
|
key: 1,
|
|
22175
22179
|
variant: "success",
|
|
22176
22180
|
class: "admin-screen-page__alert",
|
|
@@ -22213,7 +22217,7 @@ const HI = /* @__PURE__ */ ee({
|
|
|
22213
22217
|
},
|
|
22214
22218
|
emits: ["success"],
|
|
22215
22219
|
setup(a, { emit: t }) {
|
|
22216
|
-
const n = t, r =
|
|
22220
|
+
const n = t, r = Ne(), l = q(""), i = q(""), d = q(!1), h = q(!1), y = q(null), k = q({}), m = M(() => k.value.email?.[0]), x = M(() => k.value.password?.[0]);
|
|
22217
22221
|
async function b() {
|
|
22218
22222
|
if (!h.value) {
|
|
22219
22223
|
h.value = !0, y.value = null, k.value = {};
|
|
@@ -22225,7 +22229,7 @@ const HI = /* @__PURE__ */ ee({
|
|
|
22225
22229
|
});
|
|
22226
22230
|
n("success", L);
|
|
22227
22231
|
} catch (L) {
|
|
22228
|
-
(L instanceof
|
|
22232
|
+
(L instanceof Ge ? L.status : L?.response?.status) === 429 ? y.value = "Слишком много попыток входа. Подождите минуту и попробуйте снова" : L instanceof _o ? (k.value = L.fields, y.value = L.firstFieldMessage()) : L instanceof fg ? y.value = "Нет соединения с сервером" : L instanceof Ge ? y.value = L.message || "Не удалось войти" : y.value = L.message;
|
|
22229
22233
|
} finally {
|
|
22230
22234
|
h.value = !1;
|
|
22231
22235
|
}
|
|
@@ -22236,7 +22240,7 @@ const HI = /* @__PURE__ */ ee({
|
|
|
22236
22240
|
novalidate: "",
|
|
22237
22241
|
onSubmit: ve(b, ["prevent"])
|
|
22238
22242
|
}, [
|
|
22239
|
-
y.value ? (o(), V(c(
|
|
22243
|
+
y.value ? (o(), V(c(We), {
|
|
22240
22244
|
key: 0,
|
|
22241
22245
|
variant: "danger",
|
|
22242
22246
|
class: "admin-auth-card__alert",
|
|
@@ -22312,58 +22316,58 @@ const HI = /* @__PURE__ */ ee({
|
|
|
22312
22316
|
__name: "TwoFactorForm",
|
|
22313
22317
|
emits: ["success", "cancel"],
|
|
22314
22318
|
setup(a, { emit: t }) {
|
|
22315
|
-
const n = t, r =
|
|
22316
|
-
function L(
|
|
22317
|
-
W instanceof HTMLInputElement && (h.value[
|
|
22319
|
+
const n = t, r = Ne(), l = q("totp"), i = q(["", "", "", "", "", ""]), d = q(""), h = q([]), y = q(!1), k = q(null), m = q(null), x = M(() => i.value.join("")), b = M(() => l.value === "totp" ? x.value.length === 6 : d.value.trim().length > 0);
|
|
22320
|
+
function L(z, W) {
|
|
22321
|
+
W instanceof HTMLInputElement && (h.value[z] = W);
|
|
22318
22322
|
}
|
|
22319
|
-
function g(
|
|
22320
|
-
const
|
|
22321
|
-
i.value[
|
|
22323
|
+
function g(z, W) {
|
|
22324
|
+
const $ = W.target, H = $.value.replace(/\D/g, "").slice(-1);
|
|
22325
|
+
i.value[z] = H, $.value = H, H && z < i.value.length - 1 && o1(() => h.value[z + 1]?.focus()), x.value.length === i.value.length && _();
|
|
22322
22326
|
}
|
|
22323
|
-
function S(
|
|
22324
|
-
W.key === "Backspace" && !i.value[
|
|
22327
|
+
function S(z, W) {
|
|
22328
|
+
W.key === "Backspace" && !i.value[z] && z > 0 ? o1(() => h.value[z - 1]?.focus()) : W.key === "ArrowLeft" && z > 0 ? (h.value[z - 1]?.focus(), W.preventDefault()) : W.key === "ArrowRight" && z < i.value.length - 1 && (h.value[z + 1]?.focus(), W.preventDefault());
|
|
22325
22329
|
}
|
|
22326
|
-
function p(
|
|
22327
|
-
const
|
|
22328
|
-
if (
|
|
22329
|
-
|
|
22330
|
+
function p(z) {
|
|
22331
|
+
const $ = (z.clipboardData?.getData("text") ?? "").replace(/\D/g, "").slice(0, i.value.length);
|
|
22332
|
+
if ($.length !== 0) {
|
|
22333
|
+
z.preventDefault();
|
|
22330
22334
|
for (let H = 0; H < i.value.length; H++)
|
|
22331
|
-
i.value[H] =
|
|
22335
|
+
i.value[H] = $[H] ?? "";
|
|
22332
22336
|
o1(() => {
|
|
22333
|
-
h.value[Math.min(
|
|
22337
|
+
h.value[Math.min($.length, i.value.length - 1)]?.focus(), $.length === i.value.length && _();
|
|
22334
22338
|
});
|
|
22335
22339
|
}
|
|
22336
22340
|
}
|
|
22337
|
-
async function
|
|
22341
|
+
async function _() {
|
|
22338
22342
|
if (!(y.value || !b.value)) {
|
|
22339
22343
|
y.value = !0, k.value = null;
|
|
22340
22344
|
try {
|
|
22341
22345
|
if (l.value === "totp")
|
|
22342
22346
|
await r.twoFactorChallenge(x.value);
|
|
22343
22347
|
else {
|
|
22344
|
-
const
|
|
22345
|
-
m.value =
|
|
22348
|
+
const z = await r.twoFactorRecovery(d.value.trim());
|
|
22349
|
+
m.value = z.remaining;
|
|
22346
22350
|
}
|
|
22347
22351
|
n("success");
|
|
22348
|
-
} catch (
|
|
22349
|
-
|
|
22352
|
+
} catch (z) {
|
|
22353
|
+
z instanceof _o ? k.value = z.firstFieldMessage() ?? "Неверный код" : z instanceof fg ? k.value = "Нет соединения с сервером" : z instanceof Ge ? k.value = z.message || "Не удалось проверить код" : k.value = z.message;
|
|
22350
22354
|
} finally {
|
|
22351
22355
|
y.value = !1;
|
|
22352
22356
|
}
|
|
22353
22357
|
}
|
|
22354
22358
|
}
|
|
22355
|
-
function
|
|
22359
|
+
function T() {
|
|
22356
22360
|
r.cancelChallenge(), n("cancel");
|
|
22357
22361
|
}
|
|
22358
22362
|
function P() {
|
|
22359
22363
|
l.value = l.value === "totp" ? "recovery" : "totp", k.value = null;
|
|
22360
22364
|
}
|
|
22361
|
-
return (
|
|
22365
|
+
return (z, W) => (o(), s("form", {
|
|
22362
22366
|
class: "admin-auth-card__bd",
|
|
22363
22367
|
novalidate: "",
|
|
22364
|
-
onSubmit: ve(
|
|
22368
|
+
onSubmit: ve(_, ["prevent"])
|
|
22365
22369
|
}, [
|
|
22366
|
-
k.value ? (o(), V(c(
|
|
22370
|
+
k.value ? (o(), V(c(We), {
|
|
22367
22371
|
key: 0,
|
|
22368
22372
|
variant: "danger",
|
|
22369
22373
|
class: "admin-auth-card__alert",
|
|
@@ -22374,7 +22378,7 @@ const HI = /* @__PURE__ */ ee({
|
|
|
22374
22378
|
]),
|
|
22375
22379
|
_: 1
|
|
22376
22380
|
})) : F("", !0),
|
|
22377
|
-
m.value !== null ? (o(), V(c(
|
|
22381
|
+
m.value !== null ? (o(), V(c(We), {
|
|
22378
22382
|
key: 1,
|
|
22379
22383
|
variant: "info",
|
|
22380
22384
|
class: "admin-auth-card__alert",
|
|
@@ -22390,10 +22394,10 @@ const HI = /* @__PURE__ */ ee({
|
|
|
22390
22394
|
class: "admin-code-input",
|
|
22391
22395
|
onPaste: p
|
|
22392
22396
|
}, [
|
|
22393
|
-
(o(!0), s(E, null, Q(i.value, (
|
|
22397
|
+
(o(!0), s(E, null, Q(i.value, ($, H) => (o(), s("input", {
|
|
22394
22398
|
key: H,
|
|
22395
22399
|
ref_for: !0,
|
|
22396
|
-
ref: (
|
|
22400
|
+
ref: (U) => L(H, U),
|
|
22397
22401
|
value: i.value[H],
|
|
22398
22402
|
type: "text",
|
|
22399
22403
|
inputmode: "numeric",
|
|
@@ -22401,13 +22405,13 @@ const HI = /* @__PURE__ */ ee({
|
|
|
22401
22405
|
maxlength: "1",
|
|
22402
22406
|
disabled: y.value,
|
|
22403
22407
|
"aria-label": `Цифра ${H + 1}`,
|
|
22404
|
-
onInput: (
|
|
22405
|
-
onKeydown: (
|
|
22408
|
+
onInput: (U) => g(H, U),
|
|
22409
|
+
onKeydown: (U) => S(H, U)
|
|
22406
22410
|
}, null, 40, nb))), 128))
|
|
22407
22411
|
], 32)) : (o(), V(c(Ce), {
|
|
22408
22412
|
key: 3,
|
|
22409
22413
|
modelValue: d.value,
|
|
22410
|
-
"onUpdate:modelValue": W[0] || (W[0] = (
|
|
22414
|
+
"onUpdate:modelValue": W[0] || (W[0] = ($) => d.value = $),
|
|
22411
22415
|
type: "text",
|
|
22412
22416
|
label: "Recovery-код",
|
|
22413
22417
|
autocomplete: "one-time-code",
|
|
@@ -22441,7 +22445,7 @@ const HI = /* @__PURE__ */ ee({
|
|
|
22441
22445
|
u("button", {
|
|
22442
22446
|
type: "button",
|
|
22443
22447
|
class: "admin-auth-card__link",
|
|
22444
|
-
onClick:
|
|
22448
|
+
onClick: T
|
|
22445
22449
|
}, " Отмена ")
|
|
22446
22450
|
])
|
|
22447
22451
|
], 32));
|
|
@@ -22466,7 +22470,7 @@ const HI = /* @__PURE__ */ ee({
|
|
|
22466
22470
|
showCornerActions: { type: Boolean, default: !0 }
|
|
22467
22471
|
},
|
|
22468
22472
|
setup(a) {
|
|
22469
|
-
const t = a, n =
|
|
22473
|
+
const t = a, n = Ne(), r = Xe(), l = l1();
|
|
22470
22474
|
async function i() {
|
|
22471
22475
|
const d = l.query[t.redirectQueryKey];
|
|
22472
22476
|
if (typeof d == "string" && d.length > 0 && d.startsWith("/")) {
|
|
@@ -22546,7 +22550,7 @@ const HI = /* @__PURE__ */ ee({
|
|
|
22546
22550
|
loginRouteName: { default: "admin.login" }
|
|
22547
22551
|
},
|
|
22548
22552
|
setup(a) {
|
|
22549
|
-
const t = Xe(), n =
|
|
22553
|
+
const t = Xe(), n = q(""), r = q(!1), l = q(!1);
|
|
22550
22554
|
async function i() {
|
|
22551
22555
|
if (n.value.trim() === "") {
|
|
22552
22556
|
we.error("Введите email.");
|
|
@@ -22631,7 +22635,7 @@ const HI = /* @__PURE__ */ ee({
|
|
|
22631
22635
|
loginRouteName: { default: "admin.login" }
|
|
22632
22636
|
},
|
|
22633
22637
|
setup(a) {
|
|
22634
|
-
const t = a, n = Xe(), r = l1(), l = M(() => String(r.query.token ?? "")), i =
|
|
22638
|
+
const t = a, n = Xe(), r = l1(), l = M(() => String(r.query.token ?? "")), i = q(String(r.query.email ?? "")), d = q(""), h = q(""), y = q(!1), k = q("");
|
|
22635
22639
|
async function m() {
|
|
22636
22640
|
if (k.value = "", d.value.length < 8) {
|
|
22637
22641
|
k.value = "Пароль должен быть не менее 8 символов.";
|
|
@@ -22721,17 +22725,17 @@ const HI = /* @__PURE__ */ ee({
|
|
|
22721
22725
|
})
|
|
22722
22726
|
]));
|
|
22723
22727
|
}
|
|
22724
|
-
}), aI = { page: 1, per_page: 20, total: 0, last_page: 1 }, VI =
|
|
22725
|
-
const a =
|
|
22728
|
+
}), aI = { page: 1, per_page: 20, total: 0, last_page: 1 }, VI = Ue("admin-resource-index", () => {
|
|
22729
|
+
const a = q(null), t = q([]), n = q({ ...aI }), r = q(!1), l = q(!1), i = q(null);
|
|
22726
22730
|
let d = null;
|
|
22727
|
-
const h = 200, y =
|
|
22728
|
-
function
|
|
22731
|
+
const h = 200, y = q(""), k = q({}), m = q(null), x = q(null), b = q(/* @__PURE__ */ new Set()), L = M(() => !r.value && i.value === null && t.value.length === 0), g = M(() => b.value.size), S = M(() => b.value.size > 0), p = M(() => i.value !== null), _ = M(() => b.value.size === 0 || t.value.length === 0 ? "none" : t.value.every((R) => b.value.has(T(R))) ? "all" : "mixed");
|
|
22732
|
+
function T(C) {
|
|
22729
22733
|
return C.id ?? C.key ?? "";
|
|
22730
22734
|
}
|
|
22731
22735
|
function P(C) {
|
|
22732
|
-
a.value !== C && (a.value = C,
|
|
22736
|
+
a.value !== C && (a.value = C, z(), r.value = !0);
|
|
22733
22737
|
}
|
|
22734
|
-
function
|
|
22738
|
+
function z() {
|
|
22735
22739
|
t.value = [], n.value = { ...aI }, r.value = !1, i.value = null, y.value = "", k.value = {}, m.value = null, x.value = null, b.value = /* @__PURE__ */ new Set();
|
|
22736
22740
|
}
|
|
22737
22741
|
function W(C = {}) {
|
|
@@ -22747,7 +22751,7 @@ const HI = /* @__PURE__ */ ee({
|
|
|
22747
22751
|
ce == null || ce === "" || (he[de] = Array.isArray(ce) ? ce.join(",") : ce);
|
|
22748
22752
|
return Object.keys(he).length > 0 && (R.filters = he), R;
|
|
22749
22753
|
}
|
|
22750
|
-
async function
|
|
22754
|
+
async function $(C = {}) {
|
|
22751
22755
|
if (!a.value)
|
|
22752
22756
|
throw new Error("useResourceIndexStore.load() called before setSlug()");
|
|
22753
22757
|
r.value = !0, i.value = null, d !== null && clearTimeout(d), d = setTimeout(() => {
|
|
@@ -22763,40 +22767,40 @@ const HI = /* @__PURE__ */ ee({
|
|
|
22763
22767
|
}
|
|
22764
22768
|
}
|
|
22765
22769
|
async function H(C) {
|
|
22766
|
-
y.value = C, n.value.page = 1, await
|
|
22770
|
+
y.value = C, n.value.page = 1, await $();
|
|
22767
22771
|
}
|
|
22768
|
-
async function
|
|
22769
|
-
R == null || R === "" ? delete k.value[C] : k.value[C] = R, n.value.page = 1, await
|
|
22772
|
+
async function U(C, R) {
|
|
22773
|
+
R == null || R === "" ? delete k.value[C] : k.value[C] = R, n.value.page = 1, await $();
|
|
22770
22774
|
}
|
|
22771
22775
|
async function G() {
|
|
22772
|
-
k.value = {}, n.value.page = 1, await
|
|
22776
|
+
k.value = {}, n.value.page = 1, await $();
|
|
22773
22777
|
}
|
|
22774
22778
|
async function ae(C, R = "asc") {
|
|
22775
|
-
m.value = C, x.value = R, await
|
|
22779
|
+
m.value = C, x.value = R, await $();
|
|
22776
22780
|
}
|
|
22777
22781
|
async function oe(C) {
|
|
22778
|
-
m.value === C ? x.value === "asc" ? x.value = "desc" : x.value === "desc" ? (m.value = null, x.value = null) : x.value = "asc" : (m.value = C, x.value = "asc"), await
|
|
22782
|
+
m.value === C ? x.value === "asc" ? x.value = "desc" : x.value === "desc" ? (m.value = null, x.value = null) : x.value = "asc" : (m.value = C, x.value = "asc"), await $();
|
|
22779
22783
|
}
|
|
22780
22784
|
async function Z(C) {
|
|
22781
|
-
n.value.page = C, await
|
|
22785
|
+
n.value.page = C, await $();
|
|
22782
22786
|
}
|
|
22783
22787
|
function X(C) {
|
|
22784
22788
|
const R = new Set(b.value);
|
|
22785
22789
|
R.has(C) ? R.delete(C) : R.add(C), b.value = R;
|
|
22786
22790
|
}
|
|
22787
22791
|
function D() {
|
|
22788
|
-
if (
|
|
22792
|
+
if (_.value === "all") {
|
|
22789
22793
|
b.value = /* @__PURE__ */ new Set();
|
|
22790
22794
|
return;
|
|
22791
22795
|
}
|
|
22792
22796
|
const C = new Set(b.value);
|
|
22793
|
-
for (const R of t.value) C.add(
|
|
22797
|
+
for (const R of t.value) C.add(T(R));
|
|
22794
22798
|
b.value = C;
|
|
22795
22799
|
}
|
|
22796
22800
|
function I() {
|
|
22797
22801
|
b.value = /* @__PURE__ */ new Set();
|
|
22798
22802
|
}
|
|
22799
|
-
function
|
|
22803
|
+
function A(C) {
|
|
22800
22804
|
return b.value.has(C);
|
|
22801
22805
|
}
|
|
22802
22806
|
return {
|
|
@@ -22817,13 +22821,13 @@ const HI = /* @__PURE__ */ ee({
|
|
|
22817
22821
|
hasError: p,
|
|
22818
22822
|
hasSelection: S,
|
|
22819
22823
|
selectedCount: g,
|
|
22820
|
-
selectionState:
|
|
22824
|
+
selectionState: _,
|
|
22821
22825
|
// actions
|
|
22822
22826
|
setSlug: P,
|
|
22823
|
-
reset:
|
|
22824
|
-
load:
|
|
22827
|
+
reset: z,
|
|
22828
|
+
load: $,
|
|
22825
22829
|
setSearch: H,
|
|
22826
|
-
setFilter:
|
|
22830
|
+
setFilter: U,
|
|
22827
22831
|
clearFilters: G,
|
|
22828
22832
|
setSort: ae,
|
|
22829
22833
|
toggleSort: oe,
|
|
@@ -22831,8 +22835,8 @@ const HI = /* @__PURE__ */ ee({
|
|
|
22831
22835
|
toggleRow: X,
|
|
22832
22836
|
toggleAllOnPage: D,
|
|
22833
22837
|
clearSelection: I,
|
|
22834
|
-
isSelected:
|
|
22835
|
-
rowId:
|
|
22838
|
+
isSelected: A,
|
|
22839
|
+
rowId: T
|
|
22836
22840
|
};
|
|
22837
22841
|
}), Sb = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
22838
22842
|
__proto__: null,
|
|
@@ -23048,7 +23052,7 @@ const oI = ee({
|
|
|
23048
23052
|
},
|
|
23049
23053
|
emits: ["update:search", "apply-filter", "reset", "group-by", "columns-visibility", "save-view"],
|
|
23050
23054
|
setup(a, { emit: t }) {
|
|
23051
|
-
const n = a, r = t, l =
|
|
23055
|
+
const n = a, r = t, l = q(n.search);
|
|
23052
23056
|
xe(
|
|
23053
23057
|
() => n.search,
|
|
23054
23058
|
(I) => {
|
|
@@ -23065,18 +23069,18 @@ const oI = ee({
|
|
|
23065
23069
|
() => n.filters.filter((I) => d(n.values[I.name]))
|
|
23066
23070
|
), y = M(
|
|
23067
23071
|
() => n.filters.filter((I) => !d(n.values[I.name]))
|
|
23068
|
-
), k =
|
|
23072
|
+
), k = q(/* @__PURE__ */ new Set()), m = M(
|
|
23069
23073
|
() => y.value.filter(
|
|
23070
|
-
(I,
|
|
23074
|
+
(I, A) => k.value.has(I.name) || A < cI
|
|
23071
23075
|
)
|
|
23072
23076
|
), x = M(
|
|
23073
23077
|
() => y.value.filter(
|
|
23074
|
-
(I,
|
|
23078
|
+
(I, A) => !k.value.has(I.name) && A >= cI
|
|
23075
23079
|
)
|
|
23076
23080
|
);
|
|
23077
23081
|
function b(I) {
|
|
23078
|
-
const
|
|
23079
|
-
|
|
23082
|
+
const A = new Set(k.value);
|
|
23083
|
+
A.add(I), k.value = A;
|
|
23080
23084
|
}
|
|
23081
23085
|
const L = M(
|
|
23082
23086
|
() => n.search !== "" || h.value.length > 0
|
|
@@ -23085,69 +23089,69 @@ const oI = ee({
|
|
|
23085
23089
|
r("apply-filter", I, null);
|
|
23086
23090
|
}
|
|
23087
23091
|
function S(I) {
|
|
23088
|
-
const
|
|
23092
|
+
const A = n.values[I.name];
|
|
23089
23093
|
if (I.options && I.options.length > 0) {
|
|
23090
|
-
const R = (Array.isArray(
|
|
23094
|
+
const R = (Array.isArray(A) ? A : [A]).map(
|
|
23091
23095
|
(ne) => I.options?.find((ye) => String(ye.value) === String(ne))?.label ?? String(ne)
|
|
23092
23096
|
);
|
|
23093
23097
|
return `${I.label}: ${R.join(", ")}`;
|
|
23094
23098
|
}
|
|
23095
|
-
if (I.type === "date_range" &&
|
|
23096
|
-
const C =
|
|
23099
|
+
if (I.type === "date_range" && A && typeof A == "object") {
|
|
23100
|
+
const C = A;
|
|
23097
23101
|
return `${I.label}: ${C.from ?? ""} – ${C.to ?? ""}`;
|
|
23098
23102
|
}
|
|
23099
|
-
return I.type === "switcher" ? `${I.label}: ${
|
|
23103
|
+
return I.type === "switcher" ? `${I.label}: ${A ? "да" : "нет"}` : `${I.label}: ${String(A)}`;
|
|
23100
23104
|
}
|
|
23101
|
-
const p =
|
|
23102
|
-
function
|
|
23105
|
+
const p = q({});
|
|
23106
|
+
function _(I) {
|
|
23103
23107
|
return I in p.value || (p.value[I] = n.values[I] ?? null), p.value[I];
|
|
23104
23108
|
}
|
|
23105
|
-
function
|
|
23106
|
-
p.value = { ...p.value, [I]:
|
|
23109
|
+
function T(I, A) {
|
|
23110
|
+
p.value = { ...p.value, [I]: A };
|
|
23107
23111
|
}
|
|
23108
|
-
function P(I,
|
|
23109
|
-
r("apply-filter", I, p.value[I] ?? null),
|
|
23112
|
+
function P(I, A) {
|
|
23113
|
+
r("apply-filter", I, p.value[I] ?? null), A();
|
|
23110
23114
|
}
|
|
23111
|
-
function
|
|
23115
|
+
function z(I, A, C) {
|
|
23112
23116
|
if (!C) {
|
|
23113
|
-
|
|
23117
|
+
T(I, A);
|
|
23114
23118
|
return;
|
|
23115
23119
|
}
|
|
23116
|
-
const R =
|
|
23117
|
-
ye >= 0 ? ne.splice(ye, 1) : ne.push(
|
|
23120
|
+
const R = _(I), ne = Array.isArray(R) ? [...R] : [], ye = ne.findIndex((ue) => String(ue) === String(A));
|
|
23121
|
+
ye >= 0 ? ne.splice(ye, 1) : ne.push(A), T(I, ne);
|
|
23118
23122
|
}
|
|
23119
|
-
function W(I,
|
|
23120
|
-
const C =
|
|
23121
|
-
return Array.isArray(C) ? C.some((R) => String(R) === String(
|
|
23123
|
+
function W(I, A) {
|
|
23124
|
+
const C = _(I);
|
|
23125
|
+
return Array.isArray(C) ? C.some((R) => String(R) === String(A)) : C != null && String(C) === String(A);
|
|
23122
23126
|
}
|
|
23123
|
-
const
|
|
23127
|
+
const $ = M(
|
|
23124
23128
|
() => n.columns.filter((I) => I.groupable === !0 && (I.key ?? I.name))
|
|
23125
23129
|
);
|
|
23126
|
-
function H(I,
|
|
23127
|
-
r("group-by", I),
|
|
23130
|
+
function H(I, A) {
|
|
23131
|
+
r("group-by", I), A();
|
|
23128
23132
|
}
|
|
23129
|
-
function
|
|
23133
|
+
function U(I) {
|
|
23130
23134
|
return String(I.key ?? I.name ?? "");
|
|
23131
23135
|
}
|
|
23132
23136
|
function G(I) {
|
|
23133
23137
|
return String(I.label ?? I.name ?? I.key ?? "");
|
|
23134
23138
|
}
|
|
23135
23139
|
function ae(I) {
|
|
23136
|
-
const
|
|
23137
|
-
return
|
|
23140
|
+
const A = U(I);
|
|
23141
|
+
return A in n.columnVisibility ? n.columnVisibility[A] : !0;
|
|
23138
23142
|
}
|
|
23139
23143
|
function oe(I) {
|
|
23140
|
-
const
|
|
23141
|
-
r("columns-visibility", { ...n.columnVisibility, [
|
|
23144
|
+
const A = U(I);
|
|
23145
|
+
r("columns-visibility", { ...n.columnVisibility, [A]: !ae(I) });
|
|
23142
23146
|
}
|
|
23143
|
-
const Z =
|
|
23147
|
+
const Z = q("");
|
|
23144
23148
|
function X(I) {
|
|
23145
23149
|
Z.value.trim() !== "" && (r("save-view", Z.value.trim()), Z.value = "", I());
|
|
23146
23150
|
}
|
|
23147
23151
|
function D(I) {
|
|
23148
23152
|
return CI(I) ?? null;
|
|
23149
23153
|
}
|
|
23150
|
-
return (I,
|
|
23154
|
+
return (I, A) => (o(), s("div", Vb, [
|
|
23151
23155
|
u("div", Pb, [
|
|
23152
23156
|
u("label", jb, [
|
|
23153
23157
|
v(c(Y), {
|
|
@@ -23156,7 +23160,7 @@ const oI = ee({
|
|
|
23156
23160
|
class: "admin-toolbar__search-icon"
|
|
23157
23161
|
}, null, 8, ["icon"]),
|
|
23158
23162
|
w1(u("input", {
|
|
23159
|
-
"onUpdate:modelValue":
|
|
23163
|
+
"onUpdate:modelValue": A[0] || (A[0] = (C) => l.value = C),
|
|
23160
23164
|
type: "search",
|
|
23161
23165
|
placeholder: a.searchPlaceholder,
|
|
23162
23166
|
class: "admin-toolbar__search-input",
|
|
@@ -23196,23 +23200,23 @@ const oI = ee({
|
|
|
23196
23200
|
default: f(() => [
|
|
23197
23201
|
u("div", {
|
|
23198
23202
|
class: "admin-toolbar__popover",
|
|
23199
|
-
onKeydown:
|
|
23203
|
+
onKeydown: A[1] || (A[1] = ve(() => {
|
|
23200
23204
|
}, ["stop"]))
|
|
23201
23205
|
}, [
|
|
23202
23206
|
v(c(oI), {
|
|
23203
23207
|
filter: C,
|
|
23204
|
-
draft:
|
|
23208
|
+
draft: _(C.name),
|
|
23205
23209
|
"is-checked": (R) => W(C.name, R),
|
|
23206
|
-
onToggleOption: (R) =>
|
|
23207
|
-
onSetDraft: (R) =>
|
|
23210
|
+
onToggleOption: (R) => z(C.name, R, C.multiple ?? !1),
|
|
23211
|
+
onSetDraft: (R) => T(C.name, R)
|
|
23208
23212
|
}, null, 8, ["filter", "draft", "is-checked", "onToggleOption", "onSetDraft"]),
|
|
23209
23213
|
u("div", $b, [
|
|
23210
23214
|
v(c(te), {
|
|
23211
23215
|
size: "sm",
|
|
23212
23216
|
variant: "ghost",
|
|
23213
|
-
onClick: (R) =>
|
|
23217
|
+
onClick: (R) => T(C.name, null)
|
|
23214
23218
|
}, {
|
|
23215
|
-
default: f(() => [...
|
|
23219
|
+
default: f(() => [...A[12] || (A[12] = [
|
|
23216
23220
|
j(" Очистить ", -1)
|
|
23217
23221
|
])]),
|
|
23218
23222
|
_: 1
|
|
@@ -23223,7 +23227,7 @@ const oI = ee({
|
|
|
23223
23227
|
onClick: (R) => P(C.name, () => {
|
|
23224
23228
|
})
|
|
23225
23229
|
}, {
|
|
23226
|
-
default: f(() => [...
|
|
23230
|
+
default: f(() => [...A[13] || (A[13] = [
|
|
23227
23231
|
j(" Применить ", -1)
|
|
23228
23232
|
])]),
|
|
23229
23233
|
_: 1
|
|
@@ -23249,23 +23253,23 @@ const oI = ee({
|
|
|
23249
23253
|
default: f(() => [
|
|
23250
23254
|
u("div", {
|
|
23251
23255
|
class: "admin-toolbar__popover",
|
|
23252
|
-
onKeydown:
|
|
23256
|
+
onKeydown: A[2] || (A[2] = ve(() => {
|
|
23253
23257
|
}, ["stop"]))
|
|
23254
23258
|
}, [
|
|
23255
23259
|
v(c(oI), {
|
|
23256
23260
|
filter: C,
|
|
23257
|
-
draft:
|
|
23261
|
+
draft: _(C.name),
|
|
23258
23262
|
"is-checked": (R) => W(C.name, R),
|
|
23259
|
-
onToggleOption: (R) =>
|
|
23260
|
-
onSetDraft: (R) =>
|
|
23263
|
+
onToggleOption: (R) => z(C.name, R, C.multiple ?? !1),
|
|
23264
|
+
onSetDraft: (R) => T(C.name, R)
|
|
23261
23265
|
}, null, 8, ["filter", "draft", "is-checked", "onToggleOption", "onSetDraft"]),
|
|
23262
23266
|
u("div", Eb, [
|
|
23263
23267
|
v(c(te), {
|
|
23264
23268
|
size: "sm",
|
|
23265
23269
|
variant: "ghost",
|
|
23266
|
-
onClick: (R) =>
|
|
23270
|
+
onClick: (R) => T(C.name, null)
|
|
23267
23271
|
}, {
|
|
23268
|
-
default: f(() => [...
|
|
23272
|
+
default: f(() => [...A[14] || (A[14] = [
|
|
23269
23273
|
j(" Очистить ", -1)
|
|
23270
23274
|
])]),
|
|
23271
23275
|
_: 1
|
|
@@ -23276,7 +23280,7 @@ const oI = ee({
|
|
|
23276
23280
|
onClick: (R) => P(C.name, () => {
|
|
23277
23281
|
})
|
|
23278
23282
|
}, {
|
|
23279
|
-
default: f(() => [...
|
|
23283
|
+
default: f(() => [...A[15] || (A[15] = [
|
|
23280
23284
|
j(" Применить ", -1)
|
|
23281
23285
|
])]),
|
|
23282
23286
|
_: 1
|
|
@@ -23293,13 +23297,13 @@ const oI = ee({
|
|
|
23293
23297
|
icon: c(De),
|
|
23294
23298
|
size: 14
|
|
23295
23299
|
}, null, 8, ["icon"]),
|
|
23296
|
-
|
|
23300
|
+
A[16] || (A[16] = u("span", { class: "admin-toolbar__chip-text" }, "Filter", -1))
|
|
23297
23301
|
])
|
|
23298
23302
|
]),
|
|
23299
23303
|
default: f(() => [
|
|
23300
23304
|
u("div", {
|
|
23301
23305
|
class: "admin-toolbar__popover admin-toolbar__popover--list",
|
|
23302
|
-
onKeydown:
|
|
23306
|
+
onKeydown: A[3] || (A[3] = ve(() => {
|
|
23303
23307
|
}, ["stop"]))
|
|
23304
23308
|
}, [
|
|
23305
23309
|
(o(!0), s(E, null, Q(x.value, (C) => (o(), s("button", {
|
|
@@ -23320,12 +23324,12 @@ const oI = ee({
|
|
|
23320
23324
|
]),
|
|
23321
23325
|
_: 1
|
|
23322
23326
|
})) : F("", !0),
|
|
23323
|
-
|
|
23327
|
+
A[22] || (A[22] = u("span", { class: "admin-toolbar__spacer" }, null, -1)),
|
|
23324
23328
|
L.value ? (o(), V(c(te), {
|
|
23325
23329
|
key: 2,
|
|
23326
23330
|
variant: "ghost",
|
|
23327
23331
|
size: "md",
|
|
23328
|
-
onClick:
|
|
23332
|
+
onClick: A[4] || (A[4] = (C) => r("reset"))
|
|
23329
23333
|
}, {
|
|
23330
23334
|
prepend: f(() => [
|
|
23331
23335
|
v(c(Y), {
|
|
@@ -23334,32 +23338,32 @@ const oI = ee({
|
|
|
23334
23338
|
}, null, 8, ["icon"])
|
|
23335
23339
|
]),
|
|
23336
23340
|
default: f(() => [
|
|
23337
|
-
|
|
23341
|
+
A[17] || (A[17] = j(" Сбросить ", -1))
|
|
23338
23342
|
]),
|
|
23339
23343
|
_: 1
|
|
23340
23344
|
})) : F("", !0),
|
|
23341
|
-
|
|
23342
|
-
|
|
23345
|
+
$.value.length > 0 || a.columns.length > 0 || a.enableSavedViews ? (o(), s("span", Gb)) : F("", !0),
|
|
23346
|
+
$.value.length > 0 ? (o(), V(c(Fe), { key: 4 }, {
|
|
23343
23347
|
trigger: f(() => [
|
|
23344
23348
|
u("button", Nb, [
|
|
23345
23349
|
v(c(Y), {
|
|
23346
23350
|
icon: c(X2),
|
|
23347
23351
|
size: 14
|
|
23348
23352
|
}, null, 8, ["icon"]),
|
|
23349
|
-
u("span", Xb, w(a.groupBy ? `Группа: ${G(a.columns.find((C) =>
|
|
23353
|
+
u("span", Xb, w(a.groupBy ? `Группа: ${G(a.columns.find((C) => U(C) === a.groupBy) ?? {})}` : "Группировать"), 1)
|
|
23350
23354
|
])
|
|
23351
23355
|
]),
|
|
23352
23356
|
default: f(() => [
|
|
23353
23357
|
u("div", {
|
|
23354
23358
|
class: "admin-toolbar__popover admin-toolbar__popover--list",
|
|
23355
|
-
onKeydown:
|
|
23359
|
+
onKeydown: A[6] || (A[6] = ve(() => {
|
|
23356
23360
|
}, ["stop"]))
|
|
23357
23361
|
}, [
|
|
23358
23362
|
u("button", {
|
|
23359
23363
|
type: "button",
|
|
23360
23364
|
role: "menuitem",
|
|
23361
23365
|
class: "admin-toolbar__list-item",
|
|
23362
|
-
onClick:
|
|
23366
|
+
onClick: A[5] || (A[5] = (C) => H(null, () => {
|
|
23363
23367
|
}))
|
|
23364
23368
|
}, [
|
|
23365
23369
|
a.groupBy ? F("", !0) : (o(), V(c(Y), {
|
|
@@ -23367,17 +23371,17 @@ const oI = ee({
|
|
|
23367
23371
|
icon: c(Qe),
|
|
23368
23372
|
size: 14
|
|
23369
23373
|
}, null, 8, ["icon"])),
|
|
23370
|
-
|
|
23374
|
+
A[18] || (A[18] = u("span", null, "Без группировки", -1))
|
|
23371
23375
|
]),
|
|
23372
|
-
(o(!0), s(E, null, Q(
|
|
23373
|
-
key:
|
|
23376
|
+
(o(!0), s(E, null, Q($.value, (C) => (o(), s("button", {
|
|
23377
|
+
key: U(C),
|
|
23374
23378
|
type: "button",
|
|
23375
23379
|
role: "menuitem",
|
|
23376
23380
|
class: "admin-toolbar__list-item",
|
|
23377
|
-
onClick: (R) => H(
|
|
23381
|
+
onClick: (R) => H(U(C), () => {
|
|
23378
23382
|
})
|
|
23379
23383
|
}, [
|
|
23380
|
-
a.groupBy ===
|
|
23384
|
+
a.groupBy === U(C) ? (o(), V(c(Y), {
|
|
23381
23385
|
key: 0,
|
|
23382
23386
|
icon: c(Qe),
|
|
23383
23387
|
size: 14
|
|
@@ -23395,17 +23399,17 @@ const oI = ee({
|
|
|
23395
23399
|
icon: c(m1),
|
|
23396
23400
|
size: 14
|
|
23397
23401
|
}, null, 8, ["icon"]),
|
|
23398
|
-
|
|
23402
|
+
A[19] || (A[19] = u("span", { class: "admin-toolbar__chip-text" }, "Колонки", -1))
|
|
23399
23403
|
])
|
|
23400
23404
|
]),
|
|
23401
23405
|
default: f(() => [
|
|
23402
23406
|
u("div", {
|
|
23403
23407
|
class: "admin-toolbar__popover admin-toolbar__popover--list",
|
|
23404
|
-
onKeydown:
|
|
23408
|
+
onKeydown: A[7] || (A[7] = ve(() => {
|
|
23405
23409
|
}, ["stop"]))
|
|
23406
23410
|
}, [
|
|
23407
|
-
(o(!0), s(E, null, Q(a.columns.filter((C) =>
|
|
23408
|
-
key:
|
|
23411
|
+
(o(!0), s(E, null, Q(a.columns.filter((C) => U(C) !== ""), (C) => (o(), s("label", {
|
|
23412
|
+
key: U(C),
|
|
23409
23413
|
class: "admin-toolbar__list-item admin-toolbar__list-item--checkbox"
|
|
23410
23414
|
}, [
|
|
23411
23415
|
u("input", {
|
|
@@ -23426,21 +23430,21 @@ const oI = ee({
|
|
|
23426
23430
|
icon: c(En),
|
|
23427
23431
|
size: 14
|
|
23428
23432
|
}, null, 8, ["icon"]),
|
|
23429
|
-
|
|
23433
|
+
A[20] || (A[20] = u("span", { class: "admin-toolbar__chip-text" }, "Сохранить", -1))
|
|
23430
23434
|
])
|
|
23431
23435
|
]),
|
|
23432
23436
|
default: f(() => [
|
|
23433
23437
|
u("div", {
|
|
23434
23438
|
class: "admin-toolbar__popover",
|
|
23435
|
-
onKeydown:
|
|
23439
|
+
onKeydown: A[11] || (A[11] = ve(() => {
|
|
23436
23440
|
}, ["stop"]))
|
|
23437
23441
|
}, [
|
|
23438
23442
|
w1(u("input", {
|
|
23439
|
-
"onUpdate:modelValue":
|
|
23443
|
+
"onUpdate:modelValue": A[8] || (A[8] = (C) => Z.value = C),
|
|
23440
23444
|
type: "text",
|
|
23441
23445
|
placeholder: "Название view",
|
|
23442
23446
|
class: "admin-toolbar__input",
|
|
23443
|
-
onKeydown:
|
|
23447
|
+
onKeydown: A[9] || (A[9] = qg((C) => X(() => {
|
|
23444
23448
|
}), ["enter"]))
|
|
23445
23449
|
}, null, 544), [
|
|
23446
23450
|
[$n, Z.value]
|
|
@@ -23450,10 +23454,10 @@ const oI = ee({
|
|
|
23450
23454
|
size: "sm",
|
|
23451
23455
|
variant: "primary",
|
|
23452
23456
|
disabled: Z.value.trim() === "",
|
|
23453
|
-
onClick:
|
|
23457
|
+
onClick: A[10] || (A[10] = (C) => X(() => {
|
|
23454
23458
|
}))
|
|
23455
23459
|
}, {
|
|
23456
|
-
default: f(() => [...
|
|
23460
|
+
default: f(() => [...A[21] || (A[21] = [
|
|
23457
23461
|
j(" Сохранить view ", -1)
|
|
23458
23462
|
])]),
|
|
23459
23463
|
_: 1
|
|
@@ -23480,7 +23484,7 @@ const oI = ee({
|
|
|
23480
23484
|
},
|
|
23481
23485
|
emits: ["saved"],
|
|
23482
23486
|
setup(a, { emit: t }) {
|
|
23483
|
-
const n = a, r = t, l =
|
|
23487
|
+
const n = a, r = t, l = q(!1), i = q(""), d = q(!1), h = q(null), y = M(() => !(!n.editable || n.rowOverride[n.column] === !1));
|
|
23484
23488
|
async function k() {
|
|
23485
23489
|
!y.value || d.value || (i.value = n.value === null || n.value === void 0 ? "" : String(n.value), l.value = !0, await o1(), h.value?.focus(), h.value && "select" in h.value && typeof h.value.select == "function" && h.value.select());
|
|
23486
23490
|
}
|
|
@@ -23495,12 +23499,12 @@ const oI = ee({
|
|
|
23495
23499
|
}
|
|
23496
23500
|
d.value = !0;
|
|
23497
23501
|
try {
|
|
23498
|
-
const { getAdminClient: S } = await Promise.resolve().then(() => qe), p = S(),
|
|
23502
|
+
const { getAdminClient: S } = await Promise.resolve().then(() => qe), p = S(), _ = n.inputType === "switcher" ? i.value === "true" || i.value === "1" : i.value;
|
|
23499
23503
|
await p.post(`/${n.resourceSlug}/inlineUpdate`, {
|
|
23500
23504
|
id: n.rowId,
|
|
23501
23505
|
column: n.column,
|
|
23502
|
-
value:
|
|
23503
|
-
}), r("saved",
|
|
23506
|
+
value: _
|
|
23507
|
+
}), r("saved", _), l.value = !1;
|
|
23504
23508
|
} catch (S) {
|
|
23505
23509
|
typeof console < "u" && console.error("[admin] inline-update failed:", S), we.error(`Не удалось обновить «${n.column}».`);
|
|
23506
23510
|
} finally {
|
|
@@ -23530,7 +23534,7 @@ const oI = ee({
|
|
|
23530
23534
|
key: 1,
|
|
23531
23535
|
ref_key: "inputRef",
|
|
23532
23536
|
ref: h,
|
|
23533
|
-
"onUpdate:modelValue": p[0] || (p[0] = (
|
|
23537
|
+
"onUpdate:modelValue": p[0] || (p[0] = (_) => i.value = _),
|
|
23534
23538
|
type: "number",
|
|
23535
23539
|
class: "admin-inline-edit__input",
|
|
23536
23540
|
disabled: d.value,
|
|
@@ -23544,7 +23548,7 @@ const oI = ee({
|
|
|
23544
23548
|
key: 2,
|
|
23545
23549
|
ref_key: "inputRef",
|
|
23546
23550
|
ref: h,
|
|
23547
|
-
"onUpdate:modelValue": p[2] || (p[2] = (
|
|
23551
|
+
"onUpdate:modelValue": p[2] || (p[2] = (_) => i.value = _),
|
|
23548
23552
|
type: "date",
|
|
23549
23553
|
class: "admin-inline-edit__input",
|
|
23550
23554
|
disabled: d.value,
|
|
@@ -23558,7 +23562,7 @@ const oI = ee({
|
|
|
23558
23562
|
key: 3,
|
|
23559
23563
|
ref_key: "inputRef",
|
|
23560
23564
|
ref: h,
|
|
23561
|
-
"onUpdate:modelValue": p[4] || (p[4] = (
|
|
23565
|
+
"onUpdate:modelValue": p[4] || (p[4] = (_) => i.value = _),
|
|
23562
23566
|
class: "admin-inline-edit__input",
|
|
23563
23567
|
disabled: d.value,
|
|
23564
23568
|
onKeydown: b,
|
|
@@ -23567,17 +23571,17 @@ const oI = ee({
|
|
|
23567
23571
|
onClick: p[5] || (p[5] = ve(() => {
|
|
23568
23572
|
}, ["stop"]))
|
|
23569
23573
|
}, [
|
|
23570
|
-
(o(!0), s(E, null, Q(g.value, (
|
|
23571
|
-
key:
|
|
23572
|
-
value:
|
|
23573
|
-
}, w(
|
|
23574
|
+
(o(!0), s(E, null, Q(g.value, (_) => (o(), s("option", {
|
|
23575
|
+
key: _.value,
|
|
23576
|
+
value: _.value
|
|
23577
|
+
}, w(_.label), 9, iC))), 128))
|
|
23574
23578
|
], 40, cC)), [
|
|
23575
23579
|
[WI, i.value]
|
|
23576
23580
|
]) : a.inputType === "textarea" ? w1((o(), s("textarea", {
|
|
23577
23581
|
key: 4,
|
|
23578
23582
|
ref_key: "inputRef",
|
|
23579
23583
|
ref: h,
|
|
23580
|
-
"onUpdate:modelValue": p[6] || (p[6] = (
|
|
23584
|
+
"onUpdate:modelValue": p[6] || (p[6] = (_) => i.value = _),
|
|
23581
23585
|
class: "admin-inline-edit__input admin-inline-edit__input--textarea",
|
|
23582
23586
|
rows: "3",
|
|
23583
23587
|
disabled: d.value,
|
|
@@ -23591,7 +23595,7 @@ const oI = ee({
|
|
|
23591
23595
|
key: 5,
|
|
23592
23596
|
ref_key: "inputRef",
|
|
23593
23597
|
ref: h,
|
|
23594
|
-
"onUpdate:modelValue": p[8] || (p[8] = (
|
|
23598
|
+
"onUpdate:modelValue": p[8] || (p[8] = (_) => i.value = _),
|
|
23595
23599
|
type: "text",
|
|
23596
23600
|
class: "admin-inline-edit__input",
|
|
23597
23601
|
disabled: d.value,
|
|
@@ -23627,7 +23631,7 @@ const oI = ee({
|
|
|
23627
23631
|
subtitle: { default: null }
|
|
23628
23632
|
},
|
|
23629
23633
|
setup(a) {
|
|
23630
|
-
const t = a, n = Xe(), r =
|
|
23634
|
+
const t = a, n = Xe(), r = Te(), l = M(() => r.getResource(t.slug)), i = q([]), d = q(0), h = q(!1), y = q(null), k = q(""), m = q([]), x = q([]), b = M(() => t.title ?? l.value?.label ?? t.slug), L = M(() => t.subtitle ?? null), g = M(() => !!l.value?.permissions?.create), S = M(() => l.value?.label ?? t.slug);
|
|
23631
23635
|
async function p() {
|
|
23632
23636
|
h.value = !0, y.value = null;
|
|
23633
23637
|
try {
|
|
@@ -23641,20 +23645,20 @@ const oI = ee({
|
|
|
23641
23645
|
h.value = !1;
|
|
23642
23646
|
}
|
|
23643
23647
|
}
|
|
23644
|
-
function
|
|
23648
|
+
function _(C) {
|
|
23645
23649
|
const R = [], ne = (ye) => {
|
|
23646
23650
|
for (const ue of ye)
|
|
23647
23651
|
R.push(ue.key), ue.children?.length && ne(ue.children);
|
|
23648
23652
|
};
|
|
23649
23653
|
return ne(C), R;
|
|
23650
23654
|
}
|
|
23651
|
-
function
|
|
23652
|
-
m.value =
|
|
23655
|
+
function T() {
|
|
23656
|
+
m.value = _(i.value);
|
|
23653
23657
|
}
|
|
23654
23658
|
function P() {
|
|
23655
23659
|
m.value = [];
|
|
23656
23660
|
}
|
|
23657
|
-
const
|
|
23661
|
+
const z = M(() => x.value[0] ?? null);
|
|
23658
23662
|
function W(C, R) {
|
|
23659
23663
|
for (const ne of C) {
|
|
23660
23664
|
if (ne.key === R) return ne;
|
|
@@ -23665,10 +23669,10 @@ const oI = ee({
|
|
|
23665
23669
|
}
|
|
23666
23670
|
return null;
|
|
23667
23671
|
}
|
|
23668
|
-
const
|
|
23669
|
-
() =>
|
|
23670
|
-
), H = M(() =>
|
|
23671
|
-
const C =
|
|
23672
|
+
const $ = M(
|
|
23673
|
+
() => z.value === null ? null : W(i.value, z.value)
|
|
23674
|
+
), H = M(() => $.value?.slug ?? t.slug), U = M(() => {
|
|
23675
|
+
const C = $.value;
|
|
23672
23676
|
if (!C) return null;
|
|
23673
23677
|
const R = C.record?.id;
|
|
23674
23678
|
return typeof R == "string" || typeof R == "number" ? R : C.key;
|
|
@@ -23677,19 +23681,19 @@ const oI = ee({
|
|
|
23677
23681
|
n.push({ name: `admin.resource.${t.slug}.create` });
|
|
23678
23682
|
}
|
|
23679
23683
|
function ae() {
|
|
23680
|
-
|
|
23684
|
+
U.value !== null && n.push({
|
|
23681
23685
|
name: `admin.resource.${H.value}.edit`,
|
|
23682
|
-
params: { id: String(
|
|
23686
|
+
params: { id: String(U.value) }
|
|
23683
23687
|
});
|
|
23684
23688
|
}
|
|
23685
23689
|
function oe() {
|
|
23686
|
-
|
|
23690
|
+
U.value !== null && n.push({
|
|
23687
23691
|
name: `admin.resource.${H.value}.view`,
|
|
23688
|
-
params: { id: String(
|
|
23692
|
+
params: { id: String(U.value) }
|
|
23689
23693
|
});
|
|
23690
23694
|
}
|
|
23691
23695
|
const Z = M(
|
|
23692
|
-
() =>
|
|
23696
|
+
() => $.value?.actions ?? []
|
|
23693
23697
|
);
|
|
23694
23698
|
function X(C, R) {
|
|
23695
23699
|
const ne = {};
|
|
@@ -23703,23 +23707,23 @@ const oI = ee({
|
|
|
23703
23707
|
}
|
|
23704
23708
|
function D(C) {
|
|
23705
23709
|
if (C.kind !== "navigate") return;
|
|
23706
|
-
const ne =
|
|
23710
|
+
const ne = $.value?.record ?? {}, ye = X(C.to.params, ne);
|
|
23707
23711
|
n.push({
|
|
23708
23712
|
name: `admin.resource.${C.to.slug}.${C.to.screen}`,
|
|
23709
23713
|
query: ye
|
|
23710
23714
|
});
|
|
23711
23715
|
}
|
|
23712
23716
|
async function I() {
|
|
23713
|
-
if (
|
|
23717
|
+
if (U.value !== null && confirm("Удалить выбранный узел?"))
|
|
23714
23718
|
try {
|
|
23715
|
-
await Me().post(`/${H.value}/delete`, { id:
|
|
23719
|
+
await Me().post(`/${H.value}/delete`, { id: U.value }), x.value = [], await p();
|
|
23716
23720
|
} catch (C) {
|
|
23717
23721
|
y.value = C instanceof Error ? C : new Error(String(C));
|
|
23718
23722
|
}
|
|
23719
23723
|
}
|
|
23720
|
-
let
|
|
23724
|
+
let A = null;
|
|
23721
23725
|
return xe(k, () => {
|
|
23722
|
-
|
|
23726
|
+
A !== null && clearTimeout(A), A = setTimeout(() => {
|
|
23723
23727
|
p();
|
|
23724
23728
|
}, 300);
|
|
23725
23729
|
}), e1(p), (C, R) => (o(), s("div", rC, [
|
|
@@ -23764,7 +23768,7 @@ const oI = ee({
|
|
|
23764
23768
|
})
|
|
23765
23769
|
]),
|
|
23766
23770
|
default: f(() => [
|
|
23767
|
-
v(c(Ae), { onClick:
|
|
23771
|
+
v(c(Ae), { onClick: T }, {
|
|
23768
23772
|
default: f(() => [...R[6] || (R[6] = [
|
|
23769
23773
|
j("Развернуть все", -1)
|
|
23770
23774
|
])]),
|
|
@@ -23779,12 +23783,12 @@ const oI = ee({
|
|
|
23779
23783
|
]),
|
|
23780
23784
|
_: 1
|
|
23781
23785
|
}),
|
|
23782
|
-
|
|
23786
|
+
z.value !== null ? (o(), s(E, { key: 0 }, [
|
|
23783
23787
|
R[12] || (R[12] = u("span", {
|
|
23784
23788
|
class: "admin-resource-tree-page__selection-divider",
|
|
23785
23789
|
"aria-hidden": "true"
|
|
23786
23790
|
}, "|", -1)),
|
|
23787
|
-
u("span", mC, w(
|
|
23791
|
+
u("span", mC, w($.value?.label ?? z.value), 1),
|
|
23788
23792
|
v(c(te), {
|
|
23789
23793
|
variant: "ghost",
|
|
23790
23794
|
onClick: oe
|
|
@@ -23905,7 +23909,7 @@ const oI = ee({
|
|
|
23905
23909
|
},
|
|
23906
23910
|
emits: ["bulk-action", "row-click", "import", "header-action"],
|
|
23907
23911
|
setup(a, { emit: t }) {
|
|
23908
|
-
const n = Gg(), r = (O, B, N) => n.has(O) ? n.t(O, N) : B, l = a, i = t, d = VI(), h =
|
|
23912
|
+
const n = Gg(), r = (O, B, N) => n.has(O) ? n.t(O, N) : B, l = a, i = t, d = VI(), h = Te(), y = Wg(), k = Xe(), m = M(() => h.getResource(l.slug)), x = M(
|
|
23909
23913
|
() => l.title ?? m.value?.label ?? l.slug
|
|
23910
23914
|
), b = M(() => {
|
|
23911
23915
|
if (l.createRouteName !== null)
|
|
@@ -23957,11 +23961,11 @@ const oI = ee({
|
|
|
23957
23961
|
y.end();
|
|
23958
23962
|
}
|
|
23959
23963
|
}
|
|
23960
|
-
const p =
|
|
23961
|
-
function
|
|
23964
|
+
const p = q(null);
|
|
23965
|
+
function _() {
|
|
23962
23966
|
i("import"), p.value?.click();
|
|
23963
23967
|
}
|
|
23964
|
-
async function
|
|
23968
|
+
async function T(O) {
|
|
23965
23969
|
const B = O.target, N = B.files?.[0];
|
|
23966
23970
|
if (N)
|
|
23967
23971
|
try {
|
|
@@ -24003,7 +24007,7 @@ const oI = ee({
|
|
|
24003
24007
|
}
|
|
24004
24008
|
return { status: "failed", failed: 1 };
|
|
24005
24009
|
}
|
|
24006
|
-
const
|
|
24010
|
+
const z = M(() => (m.value?.features ?? {}).reorderable === !0), W = M(() => (m.value?.features ?? {}).creatable !== !1), $ = M(() => (m.value?.features ?? {}).editable !== !1), H = M(() => {
|
|
24007
24011
|
const B = (m.value?.columns ?? []).map((J) => {
|
|
24008
24012
|
const le = J;
|
|
24009
24013
|
return {
|
|
@@ -24015,7 +24019,7 @@ const oI = ee({
|
|
|
24015
24019
|
};
|
|
24016
24020
|
}).filter((J) => J.key).filter((J) => ne.value[J.key] !== !1);
|
|
24017
24021
|
return [
|
|
24018
|
-
...
|
|
24022
|
+
...z.value ? [{
|
|
24019
24023
|
key: lI,
|
|
24020
24024
|
label: "",
|
|
24021
24025
|
sortable: !1,
|
|
@@ -24032,7 +24036,7 @@ const oI = ee({
|
|
|
24032
24036
|
}
|
|
24033
24037
|
];
|
|
24034
24038
|
});
|
|
24035
|
-
function
|
|
24039
|
+
function U(O) {
|
|
24036
24040
|
const B = m.value?.columns ?? [];
|
|
24037
24041
|
for (const N of B) {
|
|
24038
24042
|
const J = N;
|
|
@@ -24079,9 +24083,9 @@ const oI = ee({
|
|
|
24079
24083
|
() => !d.isEmpty || X.value
|
|
24080
24084
|
), I = M(
|
|
24081
24085
|
() => m.value?.filters ?? []
|
|
24082
|
-
),
|
|
24086
|
+
), A = M(
|
|
24083
24087
|
() => m.value?.columns ?? []
|
|
24084
|
-
), C = M(() => `Поиск по ${(m.value?.label ?? l.slug).toLowerCase()}…`), R =
|
|
24088
|
+
), C = M(() => `Поиск по ${(m.value?.label ?? l.slug).toLowerCase()}…`), R = q(null), ne = q({});
|
|
24085
24089
|
async function ye(O, B) {
|
|
24086
24090
|
await d.setFilter(O, B);
|
|
24087
24091
|
}
|
|
@@ -24097,7 +24101,7 @@ const oI = ee({
|
|
|
24097
24101
|
function de(O) {
|
|
24098
24102
|
ne.value = O;
|
|
24099
24103
|
}
|
|
24100
|
-
const ce =
|
|
24104
|
+
const ce = q([]), me = q(null);
|
|
24101
24105
|
async function Se() {
|
|
24102
24106
|
try {
|
|
24103
24107
|
const { getAdminClient: O } = await Promise.resolve().then(() => qe), N = await O().get(`/${l.slug}_views/list`);
|
|
@@ -24153,13 +24157,13 @@ const oI = ee({
|
|
|
24153
24157
|
}
|
|
24154
24158
|
const d1 = M(() => {
|
|
24155
24159
|
const O = d.meta.total;
|
|
24156
|
-
return O === 0 ? "" : `${d.items.length} из ${O} ${
|
|
24160
|
+
return O === 0 ? "" : `${d.items.length} из ${O} ${Oe(O)}`;
|
|
24157
24161
|
});
|
|
24158
|
-
function
|
|
24162
|
+
function Oe(O) {
|
|
24159
24163
|
const B = O % 10, N = O % 100;
|
|
24160
24164
|
return B === 1 && N !== 11 ? "запись" : B >= 2 && B <= 4 && (N < 10 || N >= 20) ? "записи" : "записей";
|
|
24161
24165
|
}
|
|
24162
|
-
const Kn =
|
|
24166
|
+
const Kn = q(null), Ao = q(0);
|
|
24163
24167
|
let Jn = null;
|
|
24164
24168
|
xe(
|
|
24165
24169
|
() => d.loading,
|
|
@@ -24273,9 +24277,9 @@ const oI = ee({
|
|
|
24273
24277
|
y.end();
|
|
24274
24278
|
}
|
|
24275
24279
|
}
|
|
24276
|
-
const r1 =
|
|
24280
|
+
const r1 = q(null), L1 = q(null), zo = q("before");
|
|
24277
24281
|
function TI(O, B) {
|
|
24278
|
-
if (!
|
|
24282
|
+
if (!z.value || !B.dataTransfer) return;
|
|
24279
24283
|
if (!B.target?.closest('[data-row-drag-handle="true"]')) {
|
|
24280
24284
|
B.preventDefault();
|
|
24281
24285
|
return;
|
|
@@ -24283,7 +24287,7 @@ const oI = ee({
|
|
|
24283
24287
|
r1.value = O, B.dataTransfer.effectAllowed = "move", B.dataTransfer.setData("text/plain", String(O));
|
|
24284
24288
|
}
|
|
24285
24289
|
function $I(O, B) {
|
|
24286
|
-
if (!
|
|
24290
|
+
if (!z.value || r1.value === null) return;
|
|
24287
24291
|
B.preventDefault();
|
|
24288
24292
|
const N = B.currentTarget;
|
|
24289
24293
|
if (N) {
|
|
@@ -24296,7 +24300,7 @@ const oI = ee({
|
|
|
24296
24300
|
r1.value = null, L1.value = null;
|
|
24297
24301
|
}
|
|
24298
24302
|
async function OI(O, B) {
|
|
24299
|
-
if (B.preventDefault(), !
|
|
24303
|
+
if (B.preventDefault(), !z.value || r1.value === null) return;
|
|
24300
24304
|
const N = r1.value, J = zo.value === "after" ? O + 1 : O, le = J > N ? J - 1 : J;
|
|
24301
24305
|
if (r1.value = null, L1.value = null, N === le) return;
|
|
24302
24306
|
const _e = [...d.items], [Vo] = _e.splice(N, 1);
|
|
@@ -24499,7 +24503,7 @@ const oI = ee({
|
|
|
24499
24503
|
v(c(te), {
|
|
24500
24504
|
variant: "secondary",
|
|
24501
24505
|
size: "md",
|
|
24502
|
-
onClick:
|
|
24506
|
+
onClick: _
|
|
24503
24507
|
}, {
|
|
24504
24508
|
prepend: f(() => [
|
|
24505
24509
|
v(c(Y), {
|
|
@@ -24518,7 +24522,7 @@ const oI = ee({
|
|
|
24518
24522
|
type: "file",
|
|
24519
24523
|
class: "admin-page__import-input",
|
|
24520
24524
|
accept: ".csv,.json,.xlsx,.xls,application/json,text/csv",
|
|
24521
|
-
onChange:
|
|
24525
|
+
onChange: T
|
|
24522
24526
|
}, null, 544),
|
|
24523
24527
|
b.value && W.value ? (o(), V(c(te), {
|
|
24524
24528
|
key: 0,
|
|
@@ -24602,7 +24606,7 @@ const oI = ee({
|
|
|
24602
24606
|
"search-placeholder": C.value,
|
|
24603
24607
|
filters: I.value,
|
|
24604
24608
|
values: c(d).filters,
|
|
24605
|
-
columns:
|
|
24609
|
+
columns: A.value,
|
|
24606
24610
|
"group-by": R.value,
|
|
24607
24611
|
"column-visibility": ne.value,
|
|
24608
24612
|
"onUpdate:search": ue,
|
|
@@ -24690,7 +24694,7 @@ const oI = ee({
|
|
|
24690
24694
|
}
|
|
24691
24695
|
]),
|
|
24692
24696
|
"data-row-drag-handle": "true",
|
|
24693
|
-
draggable:
|
|
24697
|
+
draggable: z.value,
|
|
24694
24698
|
title: "Перетащить",
|
|
24695
24699
|
onDragstart: (le) => TI(
|
|
24696
24700
|
c(d).items.indexOf(Z(J) ?? {}),
|
|
@@ -24746,7 +24750,7 @@ const oI = ee({
|
|
|
24746
24750
|
}, null, 8, ["icon"])
|
|
24747
24751
|
], 8, UC)
|
|
24748
24752
|
], 64)) : (o(), s(E, { key: 0 }, [
|
|
24749
|
-
|
|
24753
|
+
$.value ? (o(), s("button", {
|
|
24750
24754
|
key: 0,
|
|
24751
24755
|
type: "button",
|
|
24752
24756
|
class: "admin-resource-index__row-action",
|
|
@@ -24758,7 +24762,7 @@ const oI = ee({
|
|
|
24758
24762
|
size: 16
|
|
24759
24763
|
}, null, 8, ["icon"])
|
|
24760
24764
|
], 8, RC)) : F("", !0),
|
|
24761
|
-
|
|
24765
|
+
$.value ? (o(), s("button", {
|
|
24762
24766
|
key: 1,
|
|
24763
24767
|
type: "button",
|
|
24764
24768
|
class: "admin-resource-index__row-action admin-resource-index__row-action--danger",
|
|
@@ -24775,7 +24779,7 @@ const oI = ee({
|
|
|
24775
24779
|
key: 2,
|
|
24776
24780
|
row: Z(J)
|
|
24777
24781
|
}, () => [
|
|
24778
|
-
|
|
24782
|
+
U(N.key) ? (o(), V(PI, {
|
|
24779
24783
|
key: 0,
|
|
24780
24784
|
"resource-slug": a.slug,
|
|
24781
24785
|
"row-id": t1(J),
|
|
@@ -24814,8 +24818,8 @@ const oI = ee({
|
|
|
24814
24818
|
])) : F("", !0)
|
|
24815
24819
|
]));
|
|
24816
24820
|
}
|
|
24817
|
-
}), Kg =
|
|
24818
|
-
const a =
|
|
24821
|
+
}), Kg = Ue("admin-resource-form", () => {
|
|
24822
|
+
const a = q(null), t = q("create"), n = q(null), r = q({}), l = q({}), i = q({}), d = q(!1), h = q(!1), y = q(!1), k = q(null), m = M(() => t.value === "create"), x = M(() => t.value === "edit"), b = M(() => t.value === "view"), L = M(() => k.value !== null), g = M(() => {
|
|
24819
24823
|
const G = r.value, ae = l.value, oe = /* @__PURE__ */ new Set([...Object.keys(G), ...Object.keys(ae)]);
|
|
24820
24824
|
for (const Z of oe)
|
|
24821
24825
|
if (!Object.is(G[Z], ae[Z]))
|
|
@@ -24832,10 +24836,10 @@ const oI = ee({
|
|
|
24832
24836
|
function p() {
|
|
24833
24837
|
S(r.value, {}), S(l.value, {}), i.value = {}, d.value = !1, h.value = !1, y.value = !1, k.value = null, n.value = null;
|
|
24834
24838
|
}
|
|
24835
|
-
function
|
|
24839
|
+
function _(G, ae = {}) {
|
|
24836
24840
|
a.value = G, t.value = "create", n.value = null, S(r.value, ae), S(l.value, ae), i.value = {}, k.value = null;
|
|
24837
24841
|
}
|
|
24838
|
-
async function
|
|
24842
|
+
async function T(G, ae, oe = "edit") {
|
|
24839
24843
|
a.value = G, t.value = oe, n.value = ae, d.value = !0, k.value = null, i.value = {};
|
|
24840
24844
|
try {
|
|
24841
24845
|
const X = await Me().get(`/${G}/read`, {
|
|
@@ -24854,14 +24858,14 @@ const oI = ee({
|
|
|
24854
24858
|
delete oe[G], i.value = oe;
|
|
24855
24859
|
}
|
|
24856
24860
|
}
|
|
24857
|
-
function
|
|
24861
|
+
function z(G) {
|
|
24858
24862
|
i.value = { ...G };
|
|
24859
24863
|
}
|
|
24860
24864
|
function W(G) {
|
|
24861
24865
|
for (const [ae, oe] of Object.entries(G))
|
|
24862
24866
|
r.value[ae] === void 0 && (r.value[ae] = oe, l.value[ae] = oe);
|
|
24863
24867
|
}
|
|
24864
|
-
function
|
|
24868
|
+
function $() {
|
|
24865
24869
|
i.value = {};
|
|
24866
24870
|
}
|
|
24867
24871
|
async function H() {
|
|
@@ -24872,20 +24876,20 @@ const oI = ee({
|
|
|
24872
24876
|
const G = Me(), ae = t.value === "create" ? `/${a.value}/create` : `/${a.value}/update`, oe = t.value === "create" ? r.value : { id: n.value, ...r.value }, Z = await G.post(ae, oe), X = Z.record?.id ?? Z.id;
|
|
24873
24877
|
if (X === void 0)
|
|
24874
24878
|
throw new Error("save: backend response does not contain record.id");
|
|
24875
|
-
return n.value = X, S(l.value, { ...r.value }), t.value = "edit", X;
|
|
24879
|
+
return n.value = X, S(l.value, { ...r.value }), t.value = "edit", Te().invalidate(), X;
|
|
24876
24880
|
} catch (G) {
|
|
24877
|
-
throw G instanceof _o ? i.value = { ...G.fields } : (G instanceof
|
|
24881
|
+
throw G instanceof _o ? i.value = { ...G.fields } : (G instanceof Ge || G instanceof Error) && (k.value = G), G;
|
|
24878
24882
|
} finally {
|
|
24879
24883
|
h.value = !1;
|
|
24880
24884
|
}
|
|
24881
24885
|
}
|
|
24882
|
-
async function
|
|
24886
|
+
async function U() {
|
|
24883
24887
|
if (!a.value || n.value === null)
|
|
24884
24888
|
throw new Error("Nothing to delete");
|
|
24885
24889
|
if (y.value) throw new Error("Already deleting");
|
|
24886
24890
|
y.value = !0, k.value = null;
|
|
24887
24891
|
try {
|
|
24888
|
-
await Me().post(`/${a.value}/delete`, { id: n.value });
|
|
24892
|
+
await Me().post(`/${a.value}/delete`, { id: n.value }), Te().invalidate();
|
|
24889
24893
|
} catch (G) {
|
|
24890
24894
|
throw G instanceof Error && (k.value = G), G;
|
|
24891
24895
|
} finally {
|
|
@@ -24912,14 +24916,14 @@ const oI = ee({
|
|
|
24912
24916
|
hasError: L,
|
|
24913
24917
|
// actions
|
|
24914
24918
|
reset: p,
|
|
24915
|
-
prepareCreate:
|
|
24916
|
-
load:
|
|
24919
|
+
prepareCreate: _,
|
|
24920
|
+
load: T,
|
|
24917
24921
|
setField: P,
|
|
24918
|
-
setErrors:
|
|
24922
|
+
setErrors: z,
|
|
24919
24923
|
seedDefaults: W,
|
|
24920
|
-
clearErrors:
|
|
24924
|
+
clearErrors: $,
|
|
24921
24925
|
save: H,
|
|
24922
|
-
destroy:
|
|
24926
|
+
destroy: U
|
|
24923
24927
|
};
|
|
24924
24928
|
}), Fg = /* @__PURE__ */ ee({
|
|
24925
24929
|
__name: "RowsLayout",
|
|
@@ -24978,16 +24982,16 @@ const oI = ee({
|
|
|
24978
24982
|
indexRouteName: { default: null }
|
|
24979
24983
|
},
|
|
24980
24984
|
setup(a) {
|
|
24981
|
-
const t = a, n = Kg(), r =
|
|
24985
|
+
const t = a, n = Kg(), r = Te(), l = Xe(), i = l1();
|
|
24982
24986
|
function d() {
|
|
24983
24987
|
const P = {};
|
|
24984
|
-
for (const [
|
|
24988
|
+
for (const [z, W] of Object.entries(i.query))
|
|
24985
24989
|
if (W != null) {
|
|
24986
24990
|
if (Array.isArray(W)) {
|
|
24987
|
-
P[
|
|
24991
|
+
P[z] = W;
|
|
24988
24992
|
continue;
|
|
24989
24993
|
}
|
|
24990
|
-
/^-?\d+$/.test(W) ? P[
|
|
24994
|
+
/^-?\d+$/.test(W) ? P[z] = parseInt(W, 10) : P[z] = W;
|
|
24991
24995
|
}
|
|
24992
24996
|
return P;
|
|
24993
24997
|
}
|
|
@@ -25005,10 +25009,10 @@ const oI = ee({
|
|
|
25005
25009
|
const y = M(() => r.getResource(t.slug)), k = M(
|
|
25006
25010
|
() => y.value?.fields ?? []
|
|
25007
25011
|
);
|
|
25008
|
-
function m(P,
|
|
25012
|
+
function m(P, z) {
|
|
25009
25013
|
for (const W of P) {
|
|
25010
|
-
const
|
|
25011
|
-
Array.isArray(
|
|
25014
|
+
const $ = W;
|
|
25015
|
+
Array.isArray($.items) && m($.items, z), !($.kind !== "field" || typeof $.name != "string") && ($.defaultValue === null || $.defaultValue === void 0 || (z[$.name] = $.defaultValue));
|
|
25012
25016
|
}
|
|
25013
25017
|
}
|
|
25014
25018
|
function x() {
|
|
@@ -25037,8 +25041,8 @@ const oI = ee({
|
|
|
25037
25041
|
}) : (n.prepareCreate(t.slug, d()), x());
|
|
25038
25042
|
}), xe(
|
|
25039
25043
|
() => [t.slug, t.id],
|
|
25040
|
-
async ([P,
|
|
25041
|
-
|
|
25044
|
+
async ([P, z]) => {
|
|
25045
|
+
z != null ? await n.load(P, z, "edit").catch(() => {
|
|
25042
25046
|
}) : (n.prepareCreate(P, d()), x());
|
|
25043
25047
|
}
|
|
25044
25048
|
);
|
|
@@ -25058,21 +25062,21 @@ const oI = ee({
|
|
|
25058
25062
|
const P = r.getResource(t.slug)?.parent_slug;
|
|
25059
25063
|
return P ? `admin.resource.${P}.index` : `admin.resource.${t.slug}.index`;
|
|
25060
25064
|
});
|
|
25061
|
-
async function
|
|
25065
|
+
async function _() {
|
|
25062
25066
|
confirm("Удалить запись?") && (await n.destroy().catch(() => {
|
|
25063
25067
|
}), n.hasError || l.push({ name: p.value }).catch(() => {
|
|
25064
25068
|
}));
|
|
25065
25069
|
}
|
|
25066
|
-
function
|
|
25070
|
+
function T() {
|
|
25067
25071
|
n.isDirty && !confirm("Несохранённые изменения будут потеряны. Продолжить?") || l.push({ name: p.value }).catch(() => {
|
|
25068
25072
|
});
|
|
25069
25073
|
}
|
|
25070
|
-
return (P,
|
|
25074
|
+
return (P, z) => (o(), s("section", GC, [
|
|
25071
25075
|
u("header", NC, [
|
|
25072
25076
|
u("div", XC, [
|
|
25073
25077
|
u("a", {
|
|
25074
25078
|
class: "admin-resource-form__back",
|
|
25075
|
-
onClick:
|
|
25079
|
+
onClick: T
|
|
25076
25080
|
}, "← Назад"),
|
|
25077
25081
|
u("h1", KC, w(b.value), 1),
|
|
25078
25082
|
L.value ? (o(), V(c(Eg), {
|
|
@@ -25089,9 +25093,9 @@ const oI = ee({
|
|
|
25089
25093
|
v(c(te), {
|
|
25090
25094
|
variant: "ghost",
|
|
25091
25095
|
disabled: c(n).saving || c(n).deleting,
|
|
25092
|
-
onClick:
|
|
25096
|
+
onClick: T
|
|
25093
25097
|
}, {
|
|
25094
|
-
default: f(() => [...
|
|
25098
|
+
default: f(() => [...z[0] || (z[0] = [
|
|
25095
25099
|
j(" Отмена ", -1)
|
|
25096
25100
|
])]),
|
|
25097
25101
|
_: 1
|
|
@@ -25101,9 +25105,9 @@ const oI = ee({
|
|
|
25101
25105
|
variant: "danger",
|
|
25102
25106
|
disabled: c(n).saving || c(n).deleting,
|
|
25103
25107
|
loading: c(n).deleting,
|
|
25104
|
-
onClick:
|
|
25108
|
+
onClick: _
|
|
25105
25109
|
}, {
|
|
25106
|
-
default: f(() => [...
|
|
25110
|
+
default: f(() => [...z[1] || (z[1] = [
|
|
25107
25111
|
j(" Удалить ", -1)
|
|
25108
25112
|
])]),
|
|
25109
25113
|
_: 1
|
|
@@ -25121,7 +25125,7 @@ const oI = ee({
|
|
|
25121
25125
|
}, 8, ["disabled", "loading"])
|
|
25122
25126
|
])
|
|
25123
25127
|
]),
|
|
25124
|
-
c(n).hasError ? (o(), V(c(
|
|
25128
|
+
c(n).hasError ? (o(), V(c(We), {
|
|
25125
25129
|
key: 0,
|
|
25126
25130
|
variant: "danger",
|
|
25127
25131
|
class: "admin-resource-form__alert",
|
|
@@ -25148,13 +25152,13 @@ const oI = ee({
|
|
|
25148
25152
|
_: 1
|
|
25149
25153
|
})),
|
|
25150
25154
|
c(n).isDirty && !c(n).loading ? (o(), s("div", QC, [
|
|
25151
|
-
|
|
25155
|
+
z[4] || (z[4] = u("span", { class: "admin-resource-form__savebar-hint" }, " Есть несохранённые изменения ", -1)),
|
|
25152
25156
|
v(c(te), {
|
|
25153
25157
|
variant: "ghost",
|
|
25154
25158
|
size: "sm",
|
|
25155
|
-
onClick:
|
|
25159
|
+
onClick: T
|
|
25156
25160
|
}, {
|
|
25157
|
-
default: f(() => [...
|
|
25161
|
+
default: f(() => [...z[2] || (z[2] = [
|
|
25158
25162
|
j("Отмена", -1)
|
|
25159
25163
|
])]),
|
|
25160
25164
|
_: 1
|
|
@@ -25166,7 +25170,7 @@ const oI = ee({
|
|
|
25166
25170
|
disabled: c(n).saving,
|
|
25167
25171
|
onClick: S
|
|
25168
25172
|
}, {
|
|
25169
|
-
default: f(() => [...
|
|
25173
|
+
default: f(() => [...z[3] || (z[3] = [
|
|
25170
25174
|
j(" Сохранить ", -1)
|
|
25171
25175
|
])]),
|
|
25172
25176
|
_: 1
|
|
@@ -25181,7 +25185,7 @@ const oI = ee({
|
|
|
25181
25185
|
name: {}
|
|
25182
25186
|
},
|
|
25183
25187
|
setup(a) {
|
|
25184
|
-
return (t, n) => (o(), V(c(
|
|
25188
|
+
return (t, n) => (o(), V(c(We), { variant: "warning" }, {
|
|
25185
25189
|
title: f(() => [
|
|
25186
25190
|
j("Неизвестный тип infolist-entry: " + w(a.type), 1)
|
|
25187
25191
|
]),
|
|
@@ -25238,8 +25242,8 @@ const oI = ee({
|
|
|
25238
25242
|
const m = Bg(t.node.type);
|
|
25239
25243
|
return m ? { kind: "entry", component: m } : { kind: "unknown" };
|
|
25240
25244
|
}), l = M(() => {
|
|
25241
|
-
const { type: m, kind: x, items: b, attributes: L, ...g } = t.node, S = L ?? {}, { preset: p, format:
|
|
25242
|
-
return
|
|
25245
|
+
const { type: m, kind: x, items: b, attributes: L, ...g } = t.node, S = L ?? {}, { preset: p, format: _, currency: T, decimals: P, ...z } = S, W = {};
|
|
25246
|
+
return _ !== void 0 && (W.format = _), T !== void 0 && (W.currency = T), P !== void 0 && (W.decimals = P), { ...g, ...z, preset: p, meta: W };
|
|
25243
25247
|
}), i = M(
|
|
25244
25248
|
() => t.node.items ?? []
|
|
25245
25249
|
), d = M(() => t.node.title ?? null), h = M(
|
|
@@ -25333,7 +25337,7 @@ const oI = ee({
|
|
|
25333
25337
|
subjectId: {}
|
|
25334
25338
|
},
|
|
25335
25339
|
setup(a) {
|
|
25336
|
-
const t = a, n =
|
|
25340
|
+
const t = a, n = q([]), r = q(!1), l = q(null);
|
|
25337
25341
|
async function i() {
|
|
25338
25342
|
if (!t.subjectType || t.subjectType === "") {
|
|
25339
25343
|
n.value = [], r.value = !1, l.value = null;
|
|
@@ -25426,25 +25430,25 @@ const oI = ee({
|
|
|
25426
25430
|
u("span", bS, w(k(p.created_at)), 1)
|
|
25427
25431
|
]),
|
|
25428
25432
|
m(p) ? (o(), s("ul", CS, [
|
|
25429
|
-
(o(!0), s(E, null, Q(p.diff, (
|
|
25430
|
-
key:
|
|
25433
|
+
(o(!0), s(E, null, Q(p.diff, (_) => (o(), s("li", {
|
|
25434
|
+
key: _.field,
|
|
25431
25435
|
class: fe(["admin-audit-timeline__diff-row", `admin-audit-timeline__diff-row--${p.event}`])
|
|
25432
25436
|
}, [
|
|
25433
|
-
u("span", SS, w(
|
|
25437
|
+
u("span", SS, w(_.field), 1),
|
|
25434
25438
|
u("span", _S, [
|
|
25435
25439
|
p.event === "created" || p.event === "restored" ? (o(), s(E, { key: 0 }, [
|
|
25436
25440
|
S[0] || (S[0] = u("span", {
|
|
25437
25441
|
class: "admin-audit-timeline__diff-arrow",
|
|
25438
25442
|
"aria-hidden": "true"
|
|
25439
25443
|
}, "→", -1)),
|
|
25440
|
-
u("span", qS, w(L(
|
|
25441
|
-
], 64)) : p.event === "deleted" || p.event === "destroyed" ? (o(), s("span", AS, w(L(
|
|
25442
|
-
u("span", zS, w(L(
|
|
25444
|
+
u("span", qS, w(L(_.after)), 1)
|
|
25445
|
+
], 64)) : p.event === "deleted" || p.event === "destroyed" ? (o(), s("span", AS, w(L(_.before)), 1)) : (o(), s(E, { key: 2 }, [
|
|
25446
|
+
u("span", zS, w(L(_.before)), 1),
|
|
25443
25447
|
S[1] || (S[1] = u("span", {
|
|
25444
25448
|
class: "admin-audit-timeline__diff-arrow",
|
|
25445
25449
|
"aria-hidden": "true"
|
|
25446
25450
|
}, "→", -1)),
|
|
25447
|
-
u("span", HS, w(L(
|
|
25451
|
+
u("span", HS, w(L(_.after)), 1)
|
|
25448
25452
|
], 64))
|
|
25449
25453
|
])
|
|
25450
25454
|
], 2))), 128))
|
|
@@ -25472,12 +25476,12 @@ const oI = ee({
|
|
|
25472
25476
|
uidPrefix: { default: "#" }
|
|
25473
25477
|
},
|
|
25474
25478
|
setup(a) {
|
|
25475
|
-
const t = a, n = Kg(), r =
|
|
25479
|
+
const t = a, n = Kg(), r = Te(), l = Xe();
|
|
25476
25480
|
AI(n.state);
|
|
25477
25481
|
const i = M(() => r.getResource(t.slug)), d = M(() => (i.value?.features ?? {}).editable !== !1), h = M(
|
|
25478
25482
|
() => i.value?.infolist ?? i.value?.fields ?? []
|
|
25479
25483
|
), y = M(() => t.auditSubjectType !== null ? t.auditSubjectType : i.value?.subject_type ?? null), k = M(() => {
|
|
25480
|
-
const
|
|
25484
|
+
const $ = n.state, H = [], U = (Z) => {
|
|
25481
25485
|
if (typeof Z != "string" || Z === "") return null;
|
|
25482
25486
|
const X = new Date(Z);
|
|
25483
25487
|
return Number.isNaN(X.getTime()) ? null : X.toLocaleString("ru-RU", {
|
|
@@ -25487,14 +25491,14 @@ const oI = ee({
|
|
|
25487
25491
|
hour: "2-digit",
|
|
25488
25492
|
minute: "2-digit"
|
|
25489
25493
|
});
|
|
25490
|
-
}, G =
|
|
25494
|
+
}, G = U($.created_at);
|
|
25491
25495
|
G && H.push({ label: "Создано", value: G });
|
|
25492
|
-
const ae =
|
|
25496
|
+
const ae = U($.updated_at);
|
|
25493
25497
|
ae && ae !== G && H.push({ label: "Обновлено", value: ae });
|
|
25494
|
-
const oe = typeof
|
|
25498
|
+
const oe = typeof $.created_by_name == "string" && $.created_by_name !== "" ? $.created_by_name : typeof $.author == "string" ? $.author : null;
|
|
25495
25499
|
return oe && H.push({ label: "Автор", value: oe }), H;
|
|
25496
25500
|
}), m = M(() => {
|
|
25497
|
-
const
|
|
25501
|
+
const $ = n.state, H = $.title ?? $.name ?? $.label;
|
|
25498
25502
|
return typeof H == "string" && H.length > 0 ? H : `${i.value?.label ?? t.slug}: запись #${t.id}`;
|
|
25499
25503
|
}), x = M(
|
|
25500
25504
|
() => i.value?.label ?? t.slug
|
|
@@ -25515,19 +25519,19 @@ const oI = ee({
|
|
|
25515
25519
|
failed: "danger",
|
|
25516
25520
|
error: "danger"
|
|
25517
25521
|
};
|
|
25518
|
-
function S(
|
|
25519
|
-
return g[
|
|
25522
|
+
function S($) {
|
|
25523
|
+
return g[$.toLowerCase()] ?? "neutral";
|
|
25520
25524
|
}
|
|
25521
25525
|
const p = M(() => (i.value?.actions ?? []).map((H) => ({
|
|
25522
25526
|
key: String(H.key ?? H.name ?? ""),
|
|
25523
25527
|
label: String(H.label ?? H.name ?? H.key ?? ""),
|
|
25524
25528
|
confirm: typeof H.confirm == "string" ? H.confirm : void 0
|
|
25525
25529
|
})).filter((H) => H.key !== "" && H.label !== ""));
|
|
25526
|
-
async function
|
|
25527
|
-
if (!(
|
|
25530
|
+
async function _($) {
|
|
25531
|
+
if (!($.confirm && !window.confirm($.confirm)))
|
|
25528
25532
|
try {
|
|
25529
25533
|
const { getAdminClient: H } = await Promise.resolve().then(() => qe);
|
|
25530
|
-
await H().post(`/${t.slug}/action/${
|
|
25534
|
+
await H().post(`/${t.slug}/action/${$.key}`, { ids: [t.id] }), await n.load(t.slug, t.id, "view").catch(() => {
|
|
25531
25535
|
});
|
|
25532
25536
|
} catch (H) {
|
|
25533
25537
|
typeof console < "u" && console.error("[admin] action failed:", H);
|
|
@@ -25539,22 +25543,22 @@ const oI = ee({
|
|
|
25539
25543
|
});
|
|
25540
25544
|
}), xe(
|
|
25541
25545
|
() => [t.slug, t.id],
|
|
25542
|
-
async ([
|
|
25543
|
-
await n.load(
|
|
25546
|
+
async ([$, H]) => {
|
|
25547
|
+
await n.load($, H, "view").catch(() => {
|
|
25544
25548
|
});
|
|
25545
25549
|
}
|
|
25546
25550
|
);
|
|
25547
|
-
const
|
|
25551
|
+
const T = M(() => {
|
|
25548
25552
|
if (t.indexRouteName) return t.indexRouteName;
|
|
25549
|
-
const
|
|
25550
|
-
return
|
|
25553
|
+
const $ = r.getResource(t.slug)?.parent_slug;
|
|
25554
|
+
return $ ? `admin.resource.${$}.index` : `admin.resource.${t.slug}.index`;
|
|
25551
25555
|
});
|
|
25552
25556
|
function P() {
|
|
25553
|
-
l.push({ name:
|
|
25557
|
+
l.push({ name: T.value }).catch(() => {
|
|
25554
25558
|
l.push(`/r/${t.slug}`);
|
|
25555
25559
|
});
|
|
25556
25560
|
}
|
|
25557
|
-
function
|
|
25561
|
+
function z() {
|
|
25558
25562
|
if (!t.editRouteName) {
|
|
25559
25563
|
l.push(`/r/${t.slug}/${t.id}/edit`).catch(() => {
|
|
25560
25564
|
});
|
|
@@ -25565,10 +25569,10 @@ const oI = ee({
|
|
|
25565
25569
|
}
|
|
25566
25570
|
async function W() {
|
|
25567
25571
|
confirm("Удалить запись?") && (await n.destroy().catch(() => {
|
|
25568
|
-
}), n.hasError || l.push({ name:
|
|
25572
|
+
}), n.hasError || l.push({ name: T.value }).catch(() => {
|
|
25569
25573
|
}));
|
|
25570
25574
|
}
|
|
25571
|
-
return (
|
|
25575
|
+
return ($, H) => (o(), s("section", jS, [
|
|
25572
25576
|
u("header", FS, [
|
|
25573
25577
|
u("div", BS, [
|
|
25574
25578
|
u("button", {
|
|
@@ -25604,7 +25608,7 @@ const oI = ee({
|
|
|
25604
25608
|
key: 0,
|
|
25605
25609
|
variant: "secondary",
|
|
25606
25610
|
size: "md",
|
|
25607
|
-
onClick:
|
|
25611
|
+
onClick: z
|
|
25608
25612
|
}, {
|
|
25609
25613
|
prepend: f(() => [
|
|
25610
25614
|
v(c(Y), {
|
|
@@ -25635,12 +25639,12 @@ const oI = ee({
|
|
|
25635
25639
|
})
|
|
25636
25640
|
]),
|
|
25637
25641
|
default: f(() => [
|
|
25638
|
-
(o(!0), s(E, null, Q(p.value, (
|
|
25639
|
-
key:
|
|
25640
|
-
onClick: (G) =>
|
|
25642
|
+
(o(!0), s(E, null, Q(p.value, (U) => (o(), V(c(Ae), {
|
|
25643
|
+
key: U.key,
|
|
25644
|
+
onClick: (G) => _(U)
|
|
25641
25645
|
}, {
|
|
25642
25646
|
default: f(() => [
|
|
25643
|
-
j(w(
|
|
25647
|
+
j(w(U.label), 1)
|
|
25644
25648
|
]),
|
|
25645
25649
|
_: 2
|
|
25646
25650
|
}, 1032, ["onClick"]))), 128)),
|
|
@@ -25664,7 +25668,7 @@ const oI = ee({
|
|
|
25664
25668
|
})
|
|
25665
25669
|
])
|
|
25666
25670
|
]),
|
|
25667
|
-
c(n).hasError ? (o(), V(c(
|
|
25671
|
+
c(n).hasError ? (o(), V(c(We), {
|
|
25668
25672
|
key: 0,
|
|
25669
25673
|
variant: "danger",
|
|
25670
25674
|
class: "admin-resource-view__alert",
|
|
@@ -25676,8 +25680,8 @@ const oI = ee({
|
|
|
25676
25680
|
_: 1
|
|
25677
25681
|
})) : F("", !0),
|
|
25678
25682
|
c(n).loading ? (o(), s("div", OS, [
|
|
25679
|
-
(o(), s(E, null, Q(8, (
|
|
25680
|
-
key:
|
|
25683
|
+
(o(), s(E, null, Q(8, (U) => v(c(Xn), {
|
|
25684
|
+
key: U,
|
|
25681
25685
|
height: "24px"
|
|
25682
25686
|
})), 64))
|
|
25683
25687
|
])) : (o(), s("div", ES, [
|
|
@@ -25688,9 +25692,9 @@ const oI = ee({
|
|
|
25688
25692
|
}, {
|
|
25689
25693
|
default: f(() => [
|
|
25690
25694
|
H[3] || (H[3] = u("h2", { class: "admin-resource-view__card-title" }, "Основные данные", -1)),
|
|
25691
|
-
(o(!0), s(E, null, Q(h.value, (
|
|
25695
|
+
(o(!0), s(E, null, Q(h.value, (U, G) => (o(), V(pS, {
|
|
25692
25696
|
key: G,
|
|
25693
|
-
node:
|
|
25697
|
+
node: U
|
|
25694
25698
|
}, null, 8, ["node"]))), 128))
|
|
25695
25699
|
]),
|
|
25696
25700
|
_: 1
|
|
@@ -25717,17 +25721,17 @@ const oI = ee({
|
|
|
25717
25721
|
default: f(() => [
|
|
25718
25722
|
H[4] || (H[4] = u("h2", { class: "admin-resource-view__card-title" }, "Метрики", -1)),
|
|
25719
25723
|
u("dl", GS, [
|
|
25720
|
-
(o(!0), s(E, null, Q(k.value, (
|
|
25721
|
-
key:
|
|
25724
|
+
(o(!0), s(E, null, Q(k.value, (U) => (o(), s(E, {
|
|
25725
|
+
key: U.label
|
|
25722
25726
|
}, [
|
|
25723
|
-
u("dt", NS, w(
|
|
25724
|
-
u("dd", XS, w(
|
|
25727
|
+
u("dt", NS, w(U.label), 1),
|
|
25728
|
+
u("dd", XS, w(U.value), 1)
|
|
25725
25729
|
], 64))), 128))
|
|
25726
25730
|
])
|
|
25727
25731
|
]),
|
|
25728
25732
|
_: 1
|
|
25729
25733
|
})) : F("", !0),
|
|
25730
|
-
ze(
|
|
25734
|
+
ze($.$slots, "sidebar", {
|
|
25731
25735
|
record: c(n).state,
|
|
25732
25736
|
resource: i.value
|
|
25733
25737
|
})
|
|
@@ -25753,35 +25757,35 @@ const oI = ee({
|
|
|
25753
25757
|
},
|
|
25754
25758
|
emits: ["update:section", "avatar-replace", "two-factor-disable", "two-factor-regenerate", "save"],
|
|
25755
25759
|
setup(a, { emit: t }) {
|
|
25756
|
-
const n = a, r = t, l =
|
|
25760
|
+
const n = a, r = t, l = Ne(), i = Zg(), d = mg(), h = [
|
|
25757
25761
|
{ id: "general", label: "Основное", icon: "user" },
|
|
25758
25762
|
{ id: "security", label: "Безопасность", icon: "shield" },
|
|
25759
25763
|
{ id: "tokens", label: "API токены", icon: "key" },
|
|
25760
25764
|
{ id: "sessions", label: "Сессии", icon: "monitor" }
|
|
25761
|
-
], y =
|
|
25762
|
-
function k(
|
|
25763
|
-
y.value =
|
|
25765
|
+
], y = q(n.section);
|
|
25766
|
+
function k(T) {
|
|
25767
|
+
y.value = T, r("update:section", T);
|
|
25764
25768
|
}
|
|
25765
|
-
const m =
|
|
25769
|
+
const m = q({
|
|
25766
25770
|
name: l.user?.name ?? "",
|
|
25767
25771
|
email: l.user?.email ?? "",
|
|
25768
25772
|
locale: d.current,
|
|
25769
25773
|
theme: i.current
|
|
25770
25774
|
}), x = M(
|
|
25771
|
-
() => d.available.map((
|
|
25775
|
+
() => d.available.map((T) => ({ value: T, label: T.toUpperCase() }))
|
|
25772
25776
|
), b = M(
|
|
25773
|
-
() => i.available.map((
|
|
25777
|
+
() => i.available.map((T) => ({ value: T, label: T === "dark" ? "Тёмная" : T === "light" ? "Светлая" : T }))
|
|
25774
25778
|
);
|
|
25775
25779
|
xe(
|
|
25776
25780
|
() => m.value.locale,
|
|
25777
|
-
(
|
|
25778
|
-
|
|
25781
|
+
(T, P) => {
|
|
25782
|
+
T === P || !T || d.setLocale(T).catch(() => {
|
|
25779
25783
|
});
|
|
25780
25784
|
}
|
|
25781
25785
|
), xe(
|
|
25782
25786
|
() => m.value.theme,
|
|
25783
|
-
(
|
|
25784
|
-
|
|
25787
|
+
(T, P) => {
|
|
25788
|
+
T === P || !T || i.setTheme(T).catch(() => {
|
|
25785
25789
|
});
|
|
25786
25790
|
}
|
|
25787
25791
|
);
|
|
@@ -25797,8 +25801,8 @@ const oI = ee({
|
|
|
25797
25801
|
function p() {
|
|
25798
25802
|
r("two-factor-regenerate");
|
|
25799
25803
|
}
|
|
25800
|
-
const
|
|
25801
|
-
return (
|
|
25804
|
+
const _ = M(() => !!l.user?.twoFactorEnabled);
|
|
25805
|
+
return (T, P) => (o(), s("section", JS, [
|
|
25802
25806
|
u("header", YS, [
|
|
25803
25807
|
u("div", QS, [
|
|
25804
25808
|
u("h1", e_, w(a.title), 1),
|
|
@@ -25807,20 +25811,20 @@ const oI = ee({
|
|
|
25807
25811
|
]),
|
|
25808
25812
|
u("div", t_, [
|
|
25809
25813
|
u("nav", n_, [
|
|
25810
|
-
(o(), s(E, null, Q(h, (
|
|
25811
|
-
key:
|
|
25814
|
+
(o(), s(E, null, Q(h, (z) => u("button", {
|
|
25815
|
+
key: z.id,
|
|
25812
25816
|
type: "button",
|
|
25813
25817
|
class: fe([
|
|
25814
25818
|
"admin-profile__nav-item",
|
|
25815
|
-
{ "admin-profile__nav-item--active": y.value ===
|
|
25819
|
+
{ "admin-profile__nav-item--active": y.value === z.id }
|
|
25816
25820
|
]),
|
|
25817
|
-
onClick: (W) => k(
|
|
25821
|
+
onClick: (W) => k(z.id)
|
|
25818
25822
|
}, [
|
|
25819
25823
|
u("span", {
|
|
25820
25824
|
class: "admin-profile__nav-icon",
|
|
25821
|
-
"data-icon":
|
|
25825
|
+
"data-icon": z.icon
|
|
25822
25826
|
}, null, 8, c_),
|
|
25823
|
-
u("span", null, w(
|
|
25827
|
+
u("span", null, w(z.label), 1)
|
|
25824
25828
|
], 10, o_)), 64))
|
|
25825
25829
|
]),
|
|
25826
25830
|
u("div", i_, [
|
|
@@ -25857,26 +25861,26 @@ const oI = ee({
|
|
|
25857
25861
|
u("div", h_, [
|
|
25858
25862
|
v(c(Ce), {
|
|
25859
25863
|
modelValue: m.value.name,
|
|
25860
|
-
"onUpdate:modelValue": P[0] || (P[0] = (
|
|
25864
|
+
"onUpdate:modelValue": P[0] || (P[0] = (z) => m.value.name = z),
|
|
25861
25865
|
label: "Имя",
|
|
25862
25866
|
name: "name"
|
|
25863
25867
|
}, null, 8, ["modelValue"]),
|
|
25864
25868
|
v(c(Ce), {
|
|
25865
25869
|
modelValue: m.value.email,
|
|
25866
|
-
"onUpdate:modelValue": P[1] || (P[1] = (
|
|
25870
|
+
"onUpdate:modelValue": P[1] || (P[1] = (z) => m.value.email = z),
|
|
25867
25871
|
label: "Email",
|
|
25868
25872
|
type: "email",
|
|
25869
25873
|
name: "email"
|
|
25870
25874
|
}, null, 8, ["modelValue"]),
|
|
25871
25875
|
v(c(yg), {
|
|
25872
25876
|
modelValue: m.value.locale,
|
|
25873
|
-
"onUpdate:modelValue": P[2] || (P[2] = (
|
|
25877
|
+
"onUpdate:modelValue": P[2] || (P[2] = (z) => m.value.locale = z),
|
|
25874
25878
|
options: x.value,
|
|
25875
25879
|
label: "Язык"
|
|
25876
25880
|
}, null, 8, ["modelValue", "options"]),
|
|
25877
25881
|
v(c(yg), {
|
|
25878
25882
|
modelValue: m.value.theme,
|
|
25879
|
-
"onUpdate:modelValue": P[3] || (P[3] = (
|
|
25883
|
+
"onUpdate:modelValue": P[3] || (P[3] = (z) => m.value.theme = z),
|
|
25880
25884
|
options: b.value,
|
|
25881
25885
|
label: "Тема"
|
|
25882
25886
|
}, null, 8, ["modelValue", "options"])
|
|
@@ -25902,17 +25906,17 @@ const oI = ee({
|
|
|
25902
25906
|
u("header", y_, [
|
|
25903
25907
|
P[8] || (P[8] = u("h3", { class: "admin-profile__card-title" }, "Двухфакторная аутентификация", -1)),
|
|
25904
25908
|
v(c(Eg), {
|
|
25905
|
-
variant:
|
|
25909
|
+
variant: _.value ? "success" : "default"
|
|
25906
25910
|
}, {
|
|
25907
25911
|
default: f(() => [
|
|
25908
|
-
j(w(
|
|
25912
|
+
j(w(_.value ? "Включена" : "Отключена"), 1)
|
|
25909
25913
|
]),
|
|
25910
25914
|
_: 1
|
|
25911
25915
|
}, 8, ["variant"])
|
|
25912
25916
|
]),
|
|
25913
|
-
|
|
25917
|
+
_.value ? (o(), s("p", p_, " 2FA включена. У вас остались recovery-коды на случай потери устройства. ")) : (o(), s("p", k_, " Включите 2FA для дополнительной защиты аккаунта. ")),
|
|
25914
25918
|
u("footer", m_, [
|
|
25915
|
-
|
|
25919
|
+
_.value ? (o(), s(E, { key: 0 }, [
|
|
25916
25920
|
v(c(te), {
|
|
25917
25921
|
variant: "ghost",
|
|
25918
25922
|
size: "sm",
|
|
@@ -25933,7 +25937,7 @@ const oI = ee({
|
|
|
25933
25937
|
])]),
|
|
25934
25938
|
_: 1
|
|
25935
25939
|
})
|
|
25936
|
-
], 64)) : ze(
|
|
25940
|
+
], 64)) : ze(T.$slots, "enable-2fa", { key: 1 }, () => [
|
|
25937
25941
|
v(c(te), {
|
|
25938
25942
|
variant: "primary",
|
|
25939
25943
|
disabled: ""
|
|
@@ -25947,7 +25951,7 @@ const oI = ee({
|
|
|
25947
25951
|
])
|
|
25948
25952
|
]),
|
|
25949
25953
|
_: 3
|
|
25950
|
-
})) : ze(
|
|
25954
|
+
})) : ze(T.$slots, y.value, {
|
|
25951
25955
|
key: 2,
|
|
25952
25956
|
section: y.value
|
|
25953
25957
|
}, () => [
|
|
@@ -26101,7 +26105,7 @@ const oI = ee({
|
|
|
26101
26105
|
return t.data.map((h, y) => {
|
|
26102
26106
|
const k = d / l.value * 2 * Math.PI;
|
|
26103
26107
|
d += h.value;
|
|
26104
|
-
const m = d / l.value * 2 * Math.PI, x = 50, b = 60, L = 60, g = b + x * Math.cos(k - Math.PI / 2), S = L + x * Math.sin(k - Math.PI / 2), p = b + x * Math.cos(m - Math.PI / 2),
|
|
26108
|
+
const m = d / l.value * 2 * Math.PI, x = 50, b = 60, L = 60, g = b + x * Math.cos(k - Math.PI / 2), S = L + x * Math.sin(k - Math.PI / 2), p = b + x * Math.cos(m - Math.PI / 2), _ = L + x * Math.sin(m - Math.PI / 2), T = m - k > Math.PI ? 1 : 0, P = t.data.length === 1 ? `M ${b - x} ${L} a ${x} ${x} 0 1 0 ${x * 2} 0 a ${x} ${x} 0 1 0 ${-x * 2} 0` : `M ${b} ${L} L ${g} ${S} A ${x} ${x} 0 ${T} 1 ${p} ${_} Z`;
|
|
26105
26109
|
return {
|
|
26106
26110
|
...h,
|
|
26107
26111
|
path: P,
|
|
@@ -26706,7 +26710,7 @@ function gq(a = {}) {
|
|
|
26706
26710
|
return (l) => {
|
|
26707
26711
|
if (l.name === t)
|
|
26708
26712
|
return !0;
|
|
26709
|
-
const i =
|
|
26713
|
+
const i = Ne();
|
|
26710
26714
|
if (l.meta?.requiresAuth === !0 && !i.isAuthenticated)
|
|
26711
26715
|
return {
|
|
26712
26716
|
name: t,
|
|
@@ -26801,7 +26805,7 @@ function Lq(a) {
|
|
|
26801
26805
|
i.addRoute(l);
|
|
26802
26806
|
}, i;
|
|
26803
26807
|
}
|
|
26804
|
-
const
|
|
26808
|
+
const $e = /* @__PURE__ */ ee({
|
|
26805
26809
|
__name: "TextField",
|
|
26806
26810
|
props: {
|
|
26807
26811
|
name: {},
|
|
@@ -27073,10 +27077,10 @@ const Te = /* @__PURE__ */ ee({
|
|
|
27073
27077
|
const t = a, n = Pe(), r = M(() => {
|
|
27074
27078
|
const Z = n.getField(t.name);
|
|
27075
27079
|
return Array.isArray(Z) ? Z.map((X) => String(X)) : typeof Z == "string" && Z !== "" ? Z.split(",").map((X) => X.trim()).filter(Boolean) : [];
|
|
27076
|
-
}), l = M(() => n.errors[t.name]?.[0]), i =
|
|
27080
|
+
}), l = M(() => n.errors[t.name]?.[0]), i = q(""), d = q(!1), h = q(null), y = q(null), k = q(null), { floatingStyle: m, update: x } = sw(y, k, {
|
|
27077
27081
|
placement: "bottom-start",
|
|
27078
27082
|
offset: 4
|
|
27079
|
-
}), b =
|
|
27083
|
+
}), b = q(0);
|
|
27080
27084
|
function L() {
|
|
27081
27085
|
b.value = y.value?.getBoundingClientRect().width ?? 0;
|
|
27082
27086
|
}
|
|
@@ -27088,8 +27092,8 @@ const Te = /* @__PURE__ */ ee({
|
|
|
27088
27092
|
function S(Z) {
|
|
27089
27093
|
const X = /* @__PURE__ */ new Set(), D = [];
|
|
27090
27094
|
for (const I of Z) {
|
|
27091
|
-
const
|
|
27092
|
-
if (!(
|
|
27095
|
+
const A = I.trim();
|
|
27096
|
+
if (!(A === "" || X.has(A)) && (X.add(A), D.push(A), t.maxItems > 0 && D.length >= t.maxItems))
|
|
27093
27097
|
break;
|
|
27094
27098
|
}
|
|
27095
27099
|
n.setField(t.name, D);
|
|
@@ -27104,25 +27108,25 @@ const Te = /* @__PURE__ */ ee({
|
|
|
27104
27108
|
S([...r.value, X]), i.value = "";
|
|
27105
27109
|
}
|
|
27106
27110
|
}
|
|
27107
|
-
function
|
|
27111
|
+
function _(Z) {
|
|
27108
27112
|
const X = [...r.value];
|
|
27109
27113
|
X.splice(Z, 1), S(X);
|
|
27110
27114
|
}
|
|
27111
|
-
function
|
|
27112
|
-
Z.key === "Enter" ? (Z.preventDefault(),
|
|
27115
|
+
function T(Z) {
|
|
27116
|
+
Z.key === "Enter" ? (Z.preventDefault(), z.value >= 0 && H.value[z.value] ? p(H.value[z.value]) : i.value.trim() !== "" && p(i.value)) : Z.key === "Backspace" && i.value === "" && r.value.length > 0 ? _(r.value.length - 1) : Z.key === "ArrowDown" ? (Z.preventDefault(), z.value = Math.min(z.value + 1, H.value.length - 1)) : Z.key === "ArrowUp" ? (Z.preventDefault(), z.value = Math.max(z.value - 1, -1)) : Z.key === "Escape" && (d.value = !1, h.value?.blur());
|
|
27113
27117
|
}
|
|
27114
27118
|
function P(Z) {
|
|
27115
27119
|
const X = Z.target.value;
|
|
27116
27120
|
if (t.separator && X.includes(t.separator)) {
|
|
27117
27121
|
const D = X.split(t.separator);
|
|
27118
|
-
D.slice(0, -1).map((
|
|
27122
|
+
D.slice(0, -1).map((A) => A.trim()).filter(Boolean).forEach(p), i.value = D[D.length - 1] ?? "";
|
|
27119
27123
|
return;
|
|
27120
27124
|
}
|
|
27121
27125
|
i.value = X;
|
|
27122
27126
|
}
|
|
27123
|
-
const
|
|
27127
|
+
const z = q(-1), W = M(
|
|
27124
27128
|
() => Array.isArray(t.suggestionsByGroup) && t.suggestionsByGroup.length > 0
|
|
27125
|
-
),
|
|
27129
|
+
), $ = M(() => {
|
|
27126
27130
|
const Z = i.value.trim().toLowerCase(), X = new Set(r.value);
|
|
27127
27131
|
return W.value ? t.suggestionsByGroup.map((D) => ({
|
|
27128
27132
|
label: D.label,
|
|
@@ -27132,15 +27136,15 @@ const Te = /* @__PURE__ */ ee({
|
|
|
27132
27136
|
})).filter((D) => D.items.length > 0) : [];
|
|
27133
27137
|
}), H = M(() => {
|
|
27134
27138
|
if (W.value)
|
|
27135
|
-
return
|
|
27139
|
+
return $.value.flatMap((D) => D.items);
|
|
27136
27140
|
const Z = i.value.trim().toLowerCase(), X = new Set(r.value);
|
|
27137
27141
|
return t.suggestions.filter((D) => !X.has(D)).filter((D) => Z === "" || D.toLowerCase().includes(Z)).slice(0, 200);
|
|
27138
27142
|
});
|
|
27139
|
-
function
|
|
27140
|
-
return Z ===
|
|
27143
|
+
function U(Z) {
|
|
27144
|
+
return Z === z.value;
|
|
27141
27145
|
}
|
|
27142
27146
|
xe(i, () => {
|
|
27143
|
-
|
|
27147
|
+
z.value = -1;
|
|
27144
27148
|
});
|
|
27145
27149
|
function G() {
|
|
27146
27150
|
t.disabled || h.value?.focus();
|
|
@@ -27187,7 +27191,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
27187
27191
|
type: "button",
|
|
27188
27192
|
class: "admin-tags__chip-remove",
|
|
27189
27193
|
"aria-label": "Удалить",
|
|
27190
|
-
onClick: ve((
|
|
27194
|
+
onClick: ve((A) => _(I), ["stop"])
|
|
27191
27195
|
}, [
|
|
27192
27196
|
v(c(Y), {
|
|
27193
27197
|
icon: c(He),
|
|
@@ -27204,7 +27208,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
27204
27208
|
class: "admin-tags__input",
|
|
27205
27209
|
type: "text",
|
|
27206
27210
|
onInput: P,
|
|
27207
|
-
onKeydown:
|
|
27211
|
+
onKeydown: T,
|
|
27208
27212
|
onFocus: X[0] || (X[0] = (D) => d.value = !0),
|
|
27209
27213
|
onBlur: oe
|
|
27210
27214
|
}, null, 40, qq),
|
|
@@ -27217,34 +27221,34 @@ const Te = /* @__PURE__ */ ee({
|
|
|
27217
27221
|
role: "listbox",
|
|
27218
27222
|
style: Ve(g.value)
|
|
27219
27223
|
}, [
|
|
27220
|
-
W.value ? (o(!0), s(E, { key: 0 }, Q(
|
|
27224
|
+
W.value ? (o(!0), s(E, { key: 0 }, Q($.value, (D, I) => (o(), s(E, {
|
|
27221
27225
|
key: `g-${I}-${D.label}`
|
|
27222
27226
|
}, [
|
|
27223
27227
|
u("div", Aq, w(D.label), 1),
|
|
27224
|
-
(o(!0), s(E, null, Q(D.items, (
|
|
27225
|
-
key:
|
|
27228
|
+
(o(!0), s(E, null, Q(D.items, (A) => (o(), s("button", {
|
|
27229
|
+
key: A,
|
|
27226
27230
|
type: "button",
|
|
27227
27231
|
role: "option",
|
|
27228
27232
|
class: fe([
|
|
27229
27233
|
"admin-tags__option",
|
|
27230
27234
|
{
|
|
27231
|
-
"admin-tags__option--active":
|
|
27232
|
-
H.value.indexOf(
|
|
27235
|
+
"admin-tags__option--active": U(
|
|
27236
|
+
H.value.indexOf(A)
|
|
27233
27237
|
)
|
|
27234
27238
|
}
|
|
27235
27239
|
]),
|
|
27236
|
-
"aria-selected":
|
|
27237
|
-
onMousedown: ve((C) => ae(
|
|
27238
|
-
onMouseenter: (C) =>
|
|
27239
|
-
}, w(
|
|
27240
|
+
"aria-selected": U(H.value.indexOf(A)),
|
|
27241
|
+
onMousedown: ve((C) => ae(A), ["prevent"]),
|
|
27242
|
+
onMouseenter: (C) => z.value = H.value.indexOf(A)
|
|
27243
|
+
}, w(A), 43, zq))), 128))
|
|
27240
27244
|
], 64))), 128)) : (o(!0), s(E, { key: 1 }, Q(H.value, (D, I) => (o(), s("button", {
|
|
27241
27245
|
key: D,
|
|
27242
27246
|
type: "button",
|
|
27243
27247
|
role: "option",
|
|
27244
|
-
class: fe(["admin-tags__option", { "admin-tags__option--active": I ===
|
|
27245
|
-
"aria-selected": I ===
|
|
27246
|
-
onMousedown: ve((
|
|
27247
|
-
onMouseenter: (
|
|
27248
|
+
class: fe(["admin-tags__option", { "admin-tags__option--active": I === z.value }]),
|
|
27249
|
+
"aria-selected": I === z.value,
|
|
27250
|
+
onMousedown: ve((A) => ae(D), ["prevent"]),
|
|
27251
|
+
onMouseenter: (A) => z.value = I
|
|
27248
27252
|
}, w(D), 43, Hq))), 128))
|
|
27249
27253
|
], 4)) : F("", !0)
|
|
27250
27254
|
]))
|
|
@@ -27288,7 +27292,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
27288
27292
|
setup(a) {
|
|
27289
27293
|
const t = a, n = Pe(), r = mg(), l = M(
|
|
27290
27294
|
() => t.locales ?? r.available ?? [r.current ?? "ru"]
|
|
27291
|
-
), i =
|
|
27295
|
+
), i = q(r.current ?? l.value[0] ?? "ru"), d = M(() => {
|
|
27292
27296
|
const m = n.getField(t.name);
|
|
27293
27297
|
return m && typeof m == "object" && !Array.isArray(m) ? m : typeof m == "string" ? { [i.value]: m } : {};
|
|
27294
27298
|
});
|
|
@@ -27386,9 +27390,9 @@ const Te = /* @__PURE__ */ ee({
|
|
|
27386
27390
|
function i(D) {
|
|
27387
27391
|
n.setField(t.name, D);
|
|
27388
27392
|
}
|
|
27389
|
-
const d =
|
|
27393
|
+
const d = q(null), h = q(null), y = q(null);
|
|
27390
27394
|
function k(D) {
|
|
27391
|
-
d.value = D,
|
|
27395
|
+
d.value = D, $(D.host);
|
|
27392
27396
|
}
|
|
27393
27397
|
function m() {
|
|
27394
27398
|
h.value?.click();
|
|
@@ -27397,14 +27401,14 @@ const Te = /* @__PURE__ */ ee({
|
|
|
27397
27401
|
const I = D.target.files?.[0];
|
|
27398
27402
|
if (D.target.value = "", !(!I || !d.value))
|
|
27399
27403
|
try {
|
|
27400
|
-
const
|
|
27401
|
-
|
|
27402
|
-
const C = await Me().post("/uploads/image",
|
|
27404
|
+
const A = new FormData();
|
|
27405
|
+
A.append("file", I);
|
|
27406
|
+
const C = await Me().post("/uploads/image", A, {
|
|
27403
27407
|
headers: { "Content-Type": "multipart/form-data" }
|
|
27404
27408
|
});
|
|
27405
27409
|
d.value.chain().setImage(C.url, C.name).run();
|
|
27406
|
-
} catch (
|
|
27407
|
-
typeof console < "u" && console.error("[admin] image upload failed:",
|
|
27410
|
+
} catch (A) {
|
|
27411
|
+
typeof console < "u" && console.error("[admin] image upload failed:", A), we.error("Не удалось загрузить изображение.");
|
|
27408
27412
|
}
|
|
27409
27413
|
}
|
|
27410
27414
|
function b(D) {
|
|
@@ -27412,9 +27416,9 @@ const Te = /* @__PURE__ */ ee({
|
|
|
27412
27416
|
const I = window.prompt("URL ссылки (пусто — удалить ссылку):", D ?? "");
|
|
27413
27417
|
I !== null && d.value.chain().setLink(I.trim() === "" ? null : I.trim()).run();
|
|
27414
27418
|
}
|
|
27415
|
-
const L =
|
|
27416
|
-
let p = null,
|
|
27417
|
-
function
|
|
27419
|
+
const L = q(null), g = q(null), S = q(null);
|
|
27420
|
+
let p = null, _ = [];
|
|
27421
|
+
function T() {
|
|
27418
27422
|
p?.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
27419
27423
|
}
|
|
27420
27424
|
function P() {
|
|
@@ -27430,32 +27434,32 @@ const Te = /* @__PURE__ */ ee({
|
|
|
27430
27434
|
h: D.height
|
|
27431
27435
|
};
|
|
27432
27436
|
}
|
|
27433
|
-
function
|
|
27437
|
+
function z(D) {
|
|
27434
27438
|
L.value !== D && (L.value && L.value.classList.remove("admin-wysiwyg-img--selected"), L.value = D, D.classList.add("admin-wysiwyg-img--selected"), D.setAttribute("draggable", "true"), P());
|
|
27435
27439
|
}
|
|
27436
27440
|
function W() {
|
|
27437
27441
|
L.value && (L.value.classList.remove("admin-wysiwyg-img--selected"), L.value.removeAttribute("draggable")), L.value = null, g.value = null;
|
|
27438
27442
|
}
|
|
27439
|
-
function
|
|
27443
|
+
function $(D) {
|
|
27440
27444
|
p = D;
|
|
27441
27445
|
const I = (he) => {
|
|
27442
27446
|
const ce = he.target?.closest("img");
|
|
27443
|
-
ce && p?.contains(ce) ?
|
|
27447
|
+
ce && p?.contains(ce) ? z(ce) : W();
|
|
27444
27448
|
};
|
|
27445
|
-
p.addEventListener("click", I),
|
|
27446
|
-
const
|
|
27449
|
+
p.addEventListener("click", I), _.push(() => p?.removeEventListener("click", I));
|
|
27450
|
+
const A = (he) => {
|
|
27447
27451
|
const de = he.target;
|
|
27448
27452
|
y.value && !y.value.contains(de) && W();
|
|
27449
27453
|
};
|
|
27450
|
-
document.addEventListener("click",
|
|
27454
|
+
document.addEventListener("click", A), _.push(() => document.removeEventListener("click", A));
|
|
27451
27455
|
const C = () => P();
|
|
27452
|
-
window.addEventListener("scroll", C, !0), window.addEventListener("resize", C),
|
|
27456
|
+
window.addEventListener("scroll", C, !0), window.addEventListener("resize", C), _.push(() => window.removeEventListener("scroll", C, !0)), _.push(() => window.removeEventListener("resize", C));
|
|
27453
27457
|
const R = (he) => {
|
|
27454
27458
|
const de = he.target;
|
|
27455
27459
|
if (!de || !p?.contains(de) || de.tagName !== "IMG") return;
|
|
27456
|
-
|
|
27460
|
+
z(de), he.dataTransfer?.setData("text/plain", "img"), he.dataTransfer && (he.dataTransfer.effectAllowed = "move");
|
|
27457
27461
|
};
|
|
27458
|
-
p.addEventListener("dragstart", R),
|
|
27462
|
+
p.addEventListener("dragstart", R), _.push(() => p?.removeEventListener("dragstart", R));
|
|
27459
27463
|
const ne = (he) => {
|
|
27460
27464
|
if (!L.value) return;
|
|
27461
27465
|
he.preventDefault(), he.dataTransfer && (he.dataTransfer.dropEffect = "move");
|
|
@@ -27469,7 +27473,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
27469
27473
|
};
|
|
27470
27474
|
}
|
|
27471
27475
|
};
|
|
27472
|
-
p.addEventListener("dragover", ne),
|
|
27476
|
+
p.addEventListener("dragover", ne), _.push(() => p?.removeEventListener("dragover", ne));
|
|
27473
27477
|
const ye = (he) => {
|
|
27474
27478
|
if (!L.value || !p) return;
|
|
27475
27479
|
he.preventDefault(), S.value = null;
|
|
@@ -27477,33 +27481,33 @@ const Te = /* @__PURE__ */ ee({
|
|
|
27477
27481
|
if (!de || de.contains(L.value))
|
|
27478
27482
|
return;
|
|
27479
27483
|
const ce = de.getBoundingClientRect(), me = he.clientY < ce.top + ce.height / 2, Se = L.value;
|
|
27480
|
-
Se.remove(), me ? de.parentNode?.insertBefore(Se, de) : de.parentNode?.insertBefore(Se, de.nextSibling), P(),
|
|
27484
|
+
Se.remove(), me ? de.parentNode?.insertBefore(Se, de) : de.parentNode?.insertBefore(Se, de.nextSibling), P(), T();
|
|
27481
27485
|
};
|
|
27482
|
-
p.addEventListener("drop", ye),
|
|
27486
|
+
p.addEventListener("drop", ye), _.push(() => p?.removeEventListener("drop", ye));
|
|
27483
27487
|
const ue = () => {
|
|
27484
27488
|
S.value = null;
|
|
27485
27489
|
};
|
|
27486
|
-
p.addEventListener("dragend", ue),
|
|
27490
|
+
p.addEventListener("dragend", ue), _.push(() => p?.removeEventListener("dragend", ue));
|
|
27487
27491
|
const Ie = new MutationObserver(() => {
|
|
27488
27492
|
L.value && !p?.contains(L.value) ? W() : P();
|
|
27489
27493
|
});
|
|
27490
|
-
Ie.observe(p, { childList: !0, subtree: !0, attributes: !0, attributeFilter: ["src", "style", "width", "height"] }),
|
|
27494
|
+
Ie.observe(p, { childList: !0, subtree: !0, attributes: !0, attributeFilter: ["src", "style", "width", "height"] }), _.push(() => Ie.disconnect());
|
|
27491
27495
|
}
|
|
27492
27496
|
function H(D, I) {
|
|
27493
27497
|
if (!p) return null;
|
|
27494
|
-
const
|
|
27498
|
+
const A = L.value?.style.pointerEvents ?? "";
|
|
27495
27499
|
L.value && (L.value.style.pointerEvents = "none");
|
|
27496
27500
|
const C = document.elementFromPoint(D, I);
|
|
27497
|
-
if (L.value && (L.value.style.pointerEvents =
|
|
27501
|
+
if (L.value && (L.value.style.pointerEvents = A), !C || !p.contains(C)) return null;
|
|
27498
27502
|
let R = C;
|
|
27499
27503
|
for (; R && R.parentElement && R.parentElement !== p; ) R = R.parentElement;
|
|
27500
27504
|
return R && R.parentElement === p ? R : null;
|
|
27501
27505
|
}
|
|
27502
|
-
const
|
|
27506
|
+
const U = q(null);
|
|
27503
27507
|
let G = null;
|
|
27504
27508
|
function ae(D, I) {
|
|
27505
27509
|
if (!L.value) return;
|
|
27506
|
-
I.preventDefault(), I.stopPropagation(),
|
|
27510
|
+
I.preventDefault(), I.stopPropagation(), U.value = D;
|
|
27507
27511
|
const C = L.value.getBoundingClientRect();
|
|
27508
27512
|
G = {
|
|
27509
27513
|
mx: I.clientX,
|
|
@@ -27514,20 +27518,20 @@ const Te = /* @__PURE__ */ ee({
|
|
|
27514
27518
|
}, window.addEventListener("mousemove", oe), window.addEventListener("mouseup", Z);
|
|
27515
27519
|
}
|
|
27516
27520
|
function oe(D) {
|
|
27517
|
-
if (
|
|
27518
|
-
const I = D.clientX - G.mx,
|
|
27519
|
-
let ne = Math.max(24, G.w + I * C), ye = Math.max(24, G.h +
|
|
27520
|
-
D.shiftKey || (Math.abs(I * C) >= Math.abs(
|
|
27521
|
+
if (!U.value || !G || !L.value) return;
|
|
27522
|
+
const I = D.clientX - G.mx, A = D.clientY - G.my, C = U.value === "nw" || U.value === "sw" ? -1 : 1, R = U.value === "nw" || U.value === "ne" ? -1 : 1;
|
|
27523
|
+
let ne = Math.max(24, G.w + I * C), ye = Math.max(24, G.h + A * R);
|
|
27524
|
+
D.shiftKey || (Math.abs(I * C) >= Math.abs(A * R) ? ye = ne / G.aspect : ne = ye * G.aspect), L.value.style.width = Math.round(ne) + "px", L.value.style.height = Math.round(ye) + "px", P();
|
|
27521
27525
|
}
|
|
27522
27526
|
function Z() {
|
|
27523
|
-
|
|
27527
|
+
U.value && (U.value = null, G = null, window.removeEventListener("mousemove", oe), window.removeEventListener("mouseup", Z), T());
|
|
27524
27528
|
}
|
|
27525
27529
|
function X(D, I) {
|
|
27526
27530
|
let R = I.x, ne = I.y;
|
|
27527
27531
|
return D === "nw" && (R = I.x - 5, ne = I.y - 5), D === "ne" && (R = I.x + I.w - 5, ne = I.y - 5), D === "sw" && (R = I.x - 5, ne = I.y + I.h - 5), D === "se" && (R = I.x + I.w - 5, ne = I.y + I.h - 5), { left: R + "px", top: ne + "px", width: "10px", height: "10px" };
|
|
27528
27532
|
}
|
|
27529
27533
|
return Dg(() => {
|
|
27530
|
-
|
|
27534
|
+
_.forEach((D) => D()), _ = [], W();
|
|
27531
27535
|
}), xe(r, () => {
|
|
27532
27536
|
L.value && p && !p.contains(L.value) && W();
|
|
27533
27537
|
}), (D, I) => (o(), s("div", {
|
|
@@ -27561,11 +27565,11 @@ const Te = /* @__PURE__ */ ee({
|
|
|
27561
27565
|
class: "admin-wysiwyg__file-input",
|
|
27562
27566
|
onChange: x
|
|
27563
27567
|
}, null, 544),
|
|
27564
|
-
g.value ? (o(), s(E, { key: 0 }, Q(["nw", "ne", "sw", "se"], (
|
|
27565
|
-
key:
|
|
27566
|
-
class: fe(["admin-wysiwyg-img__handle", `admin-wysiwyg-img__handle--${
|
|
27567
|
-
style: Ve(X(
|
|
27568
|
-
onMousedown: (C) => ae(
|
|
27568
|
+
g.value ? (o(), s(E, { key: 0 }, Q(["nw", "ne", "sw", "se"], (A) => u("div", {
|
|
27569
|
+
key: A,
|
|
27570
|
+
class: fe(["admin-wysiwyg-img__handle", `admin-wysiwyg-img__handle--${A}`]),
|
|
27571
|
+
style: Ve(X(A, g.value)),
|
|
27572
|
+
onMousedown: (C) => ae(A, C)
|
|
27569
27573
|
}, null, 46, Nq)), 64)) : F("", !0),
|
|
27570
27574
|
S.value ? (o(), s("div", {
|
|
27571
27575
|
key: 1,
|
|
@@ -27610,7 +27614,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
27610
27614
|
const t = a, n = Pe(), r = M(() => {
|
|
27611
27615
|
const L = n.getField(t.name);
|
|
27612
27616
|
return L && typeof L == "object" && "url" in L ? L : null;
|
|
27613
|
-
}), l = M(() => n.errors[t.name]?.[0]), i =
|
|
27617
|
+
}), l = M(() => n.errors[t.name]?.[0]), i = q(null), d = q(!1), h = q(!1);
|
|
27614
27618
|
function y() {
|
|
27615
27619
|
i.value?.click();
|
|
27616
27620
|
}
|
|
@@ -27738,20 +27742,20 @@ const Te = /* @__PURE__ */ ee({
|
|
|
27738
27742
|
const t = a, n = Pe(), r = M(() => {
|
|
27739
27743
|
const D = n.getField(t.name);
|
|
27740
27744
|
return D && typeof D == "object" && "url" in D ? D : null;
|
|
27741
|
-
}), l = M(() => n.errors[t.name]?.[0]), i =
|
|
27745
|
+
}), l = M(() => n.errors[t.name]?.[0]), i = q(null), d = q(!1), h = q(!1), y = q(null), k = q(null), m = q(1), x = q({ w: 0, h: 0 }), b = q({ x: 0, y: 0, w: 100, h: 100 }), L = M(() => t.aspectRatio !== null ? t.aspectRatio : t.outputWidth && t.outputHeight ? t.outputWidth / t.outputHeight : null);
|
|
27742
27746
|
function g() {
|
|
27743
27747
|
i.value?.click();
|
|
27744
27748
|
}
|
|
27745
27749
|
function S(D) {
|
|
27746
27750
|
const I = D.target.files?.[0];
|
|
27747
|
-
I &&
|
|
27751
|
+
I && _(I), D.target.value = "";
|
|
27748
27752
|
}
|
|
27749
27753
|
function p(D) {
|
|
27750
27754
|
D.preventDefault(), d.value = !1;
|
|
27751
27755
|
const I = D.dataTransfer?.files?.[0];
|
|
27752
|
-
I &&
|
|
27756
|
+
I && _(I);
|
|
27753
27757
|
}
|
|
27754
|
-
function
|
|
27758
|
+
function _(D) {
|
|
27755
27759
|
if (t.maxSize !== null && D.size > t.maxSize * 1024) {
|
|
27756
27760
|
we.error(`Файл больше ${t.maxSize} KB.`);
|
|
27757
27761
|
return;
|
|
@@ -27763,25 +27767,25 @@ const Te = /* @__PURE__ */ ee({
|
|
|
27763
27767
|
oe(), k.value = URL.createObjectURL(D);
|
|
27764
27768
|
const I = new Image();
|
|
27765
27769
|
I.onload = () => {
|
|
27766
|
-
y.value = I,
|
|
27770
|
+
y.value = I, T(), P();
|
|
27767
27771
|
}, I.src = k.value;
|
|
27768
27772
|
}
|
|
27769
|
-
function
|
|
27773
|
+
function T() {
|
|
27770
27774
|
if (!y.value) return;
|
|
27771
|
-
const D = y.value.naturalWidth, I = y.value.naturalHeight,
|
|
27772
|
-
m.value =
|
|
27775
|
+
const D = y.value.naturalWidth, I = y.value.naturalHeight, A = Math.min(qA / D, AA / I, 1);
|
|
27776
|
+
m.value = A, x.value = { w: D * A, h: I * A };
|
|
27773
27777
|
}
|
|
27774
27778
|
function P() {
|
|
27775
27779
|
const { w: D, h: I } = x.value;
|
|
27776
27780
|
if (L.value !== null) {
|
|
27777
|
-
let
|
|
27778
|
-
C > I && (C = I,
|
|
27781
|
+
let A = D, C = A / L.value;
|
|
27782
|
+
C > I && (C = I, A = C * L.value), b.value = { x: (D - A) / 2, y: (I - C) / 2, w: A, h: C };
|
|
27779
27783
|
} else {
|
|
27780
|
-
const
|
|
27781
|
-
b.value = { x:
|
|
27784
|
+
const A = Math.min(D, I) * 0.1;
|
|
27785
|
+
b.value = { x: A, y: A, w: D - 2 * A, h: I - 2 * A };
|
|
27782
27786
|
}
|
|
27783
27787
|
}
|
|
27784
|
-
const
|
|
27788
|
+
const z = q(null), W = q({
|
|
27785
27789
|
mx: 0,
|
|
27786
27790
|
my: 0,
|
|
27787
27791
|
cx: 0,
|
|
@@ -27789,46 +27793,46 @@ const Te = /* @__PURE__ */ ee({
|
|
|
27789
27793
|
cw: 0,
|
|
27790
27794
|
ch: 0
|
|
27791
27795
|
});
|
|
27792
|
-
function
|
|
27793
|
-
|
|
27796
|
+
function $(D, I) {
|
|
27797
|
+
z.value = D, W.value = {
|
|
27794
27798
|
mx: I.clientX,
|
|
27795
27799
|
my: I.clientY,
|
|
27796
27800
|
cx: b.value.x,
|
|
27797
27801
|
cy: b.value.y,
|
|
27798
27802
|
cw: b.value.w,
|
|
27799
27803
|
ch: b.value.h
|
|
27800
|
-
}, window.addEventListener("mousemove", H), window.addEventListener("mouseup",
|
|
27804
|
+
}, window.addEventListener("mousemove", H), window.addEventListener("mouseup", U), I.preventDefault();
|
|
27801
27805
|
}
|
|
27802
27806
|
function H(D) {
|
|
27803
|
-
if (
|
|
27804
|
-
const I = D.clientX - W.value.mx,
|
|
27805
|
-
if (
|
|
27806
|
-
let Se = Math.max(0, Math.min(C.cx + I, R.w - C.cw)), x1 = Math.max(0, Math.min(C.cy +
|
|
27807
|
+
if (z.value === null) return;
|
|
27808
|
+
const I = D.clientX - W.value.mx, A = D.clientY - W.value.my, C = W.value, R = x.value, ne = (t.minCropWidth ?? 32) * m.value, ye = (t.minCropHeight ?? 32) * m.value;
|
|
27809
|
+
if (z.value === "move") {
|
|
27810
|
+
let Se = Math.max(0, Math.min(C.cx + I, R.w - C.cw)), x1 = Math.max(0, Math.min(C.cy + A, R.h - C.ch));
|
|
27807
27811
|
b.value = { x: Se, y: x1, w: C.cw, h: C.ch };
|
|
27808
27812
|
return;
|
|
27809
27813
|
}
|
|
27810
27814
|
let ue = C.cx, Ie = C.cy, he = C.cx + C.cw, de = C.cy + C.ch;
|
|
27811
|
-
|
|
27815
|
+
z.value === "nw" && (ue = C.cx + I, Ie = C.cy + A), z.value === "ne" && (he = C.cx + C.cw + I, Ie = C.cy + A), z.value === "sw" && (ue = C.cx + I, de = C.cy + C.ch + A), z.value === "se" && (he = C.cx + C.cw + I, de = C.cy + C.ch + A), ue = Math.max(0, Math.min(ue, he - ne)), Ie = Math.max(0, Math.min(Ie, de - ye)), he = Math.min(R.w, Math.max(he, ue + ne)), de = Math.min(R.h, Math.max(de, Ie + ye));
|
|
27812
27816
|
let ce = he - ue, me = de - Ie;
|
|
27813
27817
|
if (L.value !== null) {
|
|
27814
27818
|
const Se = L.value;
|
|
27815
|
-
Math.abs(ce - C.cw) >= Math.abs(me - C.ch) ? me = ce / Se : ce = me * Se,
|
|
27819
|
+
Math.abs(ce - C.cw) >= Math.abs(me - C.ch) ? me = ce / Se : ce = me * Se, z.value === "nw" && (ue = he - ce, Ie = de - me), z.value === "ne" && (Ie = de - me), z.value === "sw" && (ue = he - ce), ue < 0 && (ce += ue, ue = 0, me = ce / Se, Ie = z.value === "nw" || z.value === "ne" ? de - me : Ie), Ie < 0 && (me += Ie, Ie = 0, ce = me * Se, ue = z.value === "nw" || z.value === "sw" ? he - ce : ue), ue + ce > R.w && (ce = R.w - ue, me = ce / Se), Ie + me > R.h && (me = R.h - Ie, ce = me * Se);
|
|
27816
27820
|
}
|
|
27817
27821
|
b.value = { x: ue, y: Ie, w: ce, h: me };
|
|
27818
27822
|
}
|
|
27819
|
-
function
|
|
27820
|
-
|
|
27823
|
+
function U() {
|
|
27824
|
+
z.value = null, window.removeEventListener("mousemove", H), window.removeEventListener("mouseup", U);
|
|
27821
27825
|
}
|
|
27822
27826
|
async function G() {
|
|
27823
27827
|
if (!y.value) return;
|
|
27824
|
-
const D = y.value, I = 1 / m.value,
|
|
27828
|
+
const D = y.value, I = 1 / m.value, A = b.value.x * I, C = b.value.y * I, R = b.value.w * I, ne = b.value.h * I, ye = t.outputWidth ?? Math.round(R), ue = t.outputHeight ?? Math.round(ne), Ie = document.createElement("canvas");
|
|
27825
27829
|
Ie.width = ye, Ie.height = ue;
|
|
27826
27830
|
const he = Ie.getContext("2d");
|
|
27827
27831
|
if (!he) {
|
|
27828
27832
|
we.error("Canvas недоступен.");
|
|
27829
27833
|
return;
|
|
27830
27834
|
}
|
|
27831
|
-
he.drawImage(D,
|
|
27835
|
+
he.drawImage(D, A, C, R, ne, 0, 0, ye, ue);
|
|
27832
27836
|
const de = await new Promise(
|
|
27833
27837
|
(ce) => Ie.toBlob(ce, "image/png", t.quality ?? 0.92)
|
|
27834
27838
|
);
|
|
@@ -27871,8 +27875,8 @@ const Te = /* @__PURE__ */ ee({
|
|
|
27871
27875
|
u("div", {
|
|
27872
27876
|
class: fe(["admin-image-cropper__drop", { "admin-image-cropper__drop--over": d.value }]),
|
|
27873
27877
|
onClick: g,
|
|
27874
|
-
onDragover: I[0] || (I[0] = ve((
|
|
27875
|
-
onDragleave: I[1] || (I[1] = (
|
|
27878
|
+
onDragover: I[0] || (I[0] = ve((A) => d.value = !0, ["prevent"])),
|
|
27879
|
+
onDragleave: I[1] || (I[1] = (A) => d.value = !1),
|
|
27876
27880
|
onDrop: p
|
|
27877
27881
|
}, [
|
|
27878
27882
|
v(c(Y), {
|
|
@@ -27905,23 +27909,23 @@ const Te = /* @__PURE__ */ ee({
|
|
|
27905
27909
|
u("div", {
|
|
27906
27910
|
class: "admin-image-cropper__rect",
|
|
27907
27911
|
style: Ve({ left: b.value.x + "px", top: b.value.y + "px", width: b.value.w + "px", height: b.value.h + "px" }),
|
|
27908
|
-
onMousedown: I[6] || (I[6] = (
|
|
27912
|
+
onMousedown: I[6] || (I[6] = (A) => $("move", A))
|
|
27909
27913
|
}, [
|
|
27910
27914
|
u("div", {
|
|
27911
27915
|
class: "admin-image-cropper__handle admin-image-cropper__handle--nw",
|
|
27912
|
-
onMousedown: I[2] || (I[2] = ve((
|
|
27916
|
+
onMousedown: I[2] || (I[2] = ve((A) => $("nw", A), ["stop"]))
|
|
27913
27917
|
}, null, 32),
|
|
27914
27918
|
u("div", {
|
|
27915
27919
|
class: "admin-image-cropper__handle admin-image-cropper__handle--ne",
|
|
27916
|
-
onMousedown: I[3] || (I[3] = ve((
|
|
27920
|
+
onMousedown: I[3] || (I[3] = ve((A) => $("ne", A), ["stop"]))
|
|
27917
27921
|
}, null, 32),
|
|
27918
27922
|
u("div", {
|
|
27919
27923
|
class: "admin-image-cropper__handle admin-image-cropper__handle--sw",
|
|
27920
|
-
onMousedown: I[4] || (I[4] = ve((
|
|
27924
|
+
onMousedown: I[4] || (I[4] = ve((A) => $("sw", A), ["stop"]))
|
|
27921
27925
|
}, null, 32),
|
|
27922
27926
|
u("div", {
|
|
27923
27927
|
class: "admin-image-cropper__handle admin-image-cropper__handle--se",
|
|
27924
|
-
onMousedown: I[5] || (I[5] = ve((
|
|
27928
|
+
onMousedown: I[5] || (I[5] = ve((A) => $("se", A), ["stop"]))
|
|
27925
27929
|
}, null, 32)
|
|
27926
27930
|
], 36)
|
|
27927
27931
|
], 4),
|
|
@@ -28025,7 +28029,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28025
28029
|
value: b == null ? "" : String(b)
|
|
28026
28030
|
}));
|
|
28027
28031
|
}
|
|
28028
|
-
const l =
|
|
28032
|
+
const l = q(r());
|
|
28029
28033
|
xe(
|
|
28030
28034
|
() => n.getField(t.name),
|
|
28031
28035
|
() => {
|
|
@@ -28177,7 +28181,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28177
28181
|
const L = n.getField(t.name);
|
|
28178
28182
|
return Array.isArray(L) ? L.map((g) => ({ ...g })) : [];
|
|
28179
28183
|
}
|
|
28180
|
-
const l =
|
|
28184
|
+
const l = q(r());
|
|
28181
28185
|
xe(
|
|
28182
28186
|
() => n.getField(t.name),
|
|
28183
28187
|
(L) => {
|
|
@@ -28231,7 +28235,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28231
28235
|
size: "sm",
|
|
28232
28236
|
disabled: p === 0,
|
|
28233
28237
|
"aria-label": "Выше",
|
|
28234
|
-
onClick: (
|
|
28238
|
+
onClick: (_) => x(p, -1)
|
|
28235
28239
|
}, {
|
|
28236
28240
|
default: f(() => [
|
|
28237
28241
|
v(c(Y), {
|
|
@@ -28247,7 +28251,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28247
28251
|
size: "sm",
|
|
28248
28252
|
disabled: p === l.value.length - 1,
|
|
28249
28253
|
"aria-label": "Ниже",
|
|
28250
|
-
onClick: (
|
|
28254
|
+
onClick: (_) => x(p, 1)
|
|
28251
28255
|
}, {
|
|
28252
28256
|
default: f(() => [
|
|
28253
28257
|
v(c(Y), {
|
|
@@ -28262,7 +28266,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28262
28266
|
variant: "ghost",
|
|
28263
28267
|
size: "sm",
|
|
28264
28268
|
"aria-label": "Удалить элемент",
|
|
28265
|
-
onClick: (
|
|
28269
|
+
onClick: (_) => m(p)
|
|
28266
28270
|
}, {
|
|
28267
28271
|
default: f(() => [
|
|
28268
28272
|
v(c(Y), {
|
|
@@ -28277,7 +28281,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28277
28281
|
v(BI, {
|
|
28278
28282
|
fields: a.fields,
|
|
28279
28283
|
"model-value": S,
|
|
28280
|
-
"onUpdate:modelValue": (
|
|
28284
|
+
"onUpdate:modelValue": (_) => d(p, _)
|
|
28281
28285
|
}, null, 8, ["fields", "model-value", "onUpdate:modelValue"])
|
|
28282
28286
|
]),
|
|
28283
28287
|
_: 2
|
|
@@ -28336,7 +28340,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28336
28340
|
const g = n.getField(t.name);
|
|
28337
28341
|
return Array.isArray(g) ? g.map((S) => ({ type: S.type, data: { ...S.data ?? {} } })) : [];
|
|
28338
28342
|
}
|
|
28339
|
-
const l =
|
|
28343
|
+
const l = q(r());
|
|
28340
28344
|
xe(
|
|
28341
28345
|
() => n.getField(t.name),
|
|
28342
28346
|
(g) => {
|
|
@@ -28358,8 +28362,8 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28358
28362
|
function m(g, S) {
|
|
28359
28363
|
const p = g + S;
|
|
28360
28364
|
if (p < 0 || p >= l.value.length) return;
|
|
28361
|
-
const
|
|
28362
|
-
[
|
|
28365
|
+
const _ = [...l.value];
|
|
28366
|
+
[_[g], _[p]] = [_[p], _[g]], l.value = _, i();
|
|
28363
28367
|
}
|
|
28364
28368
|
function x(g, S) {
|
|
28365
28369
|
l.value[g] = { ...l.value[g], data: S }, i();
|
|
@@ -28375,8 +28379,8 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28375
28379
|
j(w(a.label), 1),
|
|
28376
28380
|
a.required ? (o(), s("span", az, "*")) : F("", !0)
|
|
28377
28381
|
])) : F("", !0),
|
|
28378
|
-
(o(!0), s(E, null, Q(l.value, (p,
|
|
28379
|
-
key:
|
|
28382
|
+
(o(!0), s(E, null, Q(l.value, (p, _) => (o(), V(c(ge), {
|
|
28383
|
+
key: _,
|
|
28380
28384
|
padding: "md",
|
|
28381
28385
|
class: "admin-builder__block"
|
|
28382
28386
|
}, {
|
|
@@ -28388,9 +28392,9 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28388
28392
|
key: 0,
|
|
28389
28393
|
variant: "ghost",
|
|
28390
28394
|
size: "sm",
|
|
28391
|
-
disabled:
|
|
28395
|
+
disabled: _ === 0,
|
|
28392
28396
|
"aria-label": "Выше",
|
|
28393
|
-
onClick: (
|
|
28397
|
+
onClick: (T) => m(_, -1)
|
|
28394
28398
|
}, {
|
|
28395
28399
|
default: f(() => [
|
|
28396
28400
|
v(c(Y), {
|
|
@@ -28404,9 +28408,9 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28404
28408
|
key: 1,
|
|
28405
28409
|
variant: "ghost",
|
|
28406
28410
|
size: "sm",
|
|
28407
|
-
disabled:
|
|
28411
|
+
disabled: _ === l.value.length - 1,
|
|
28408
28412
|
"aria-label": "Ниже",
|
|
28409
|
-
onClick: (
|
|
28413
|
+
onClick: (T) => m(_, 1)
|
|
28410
28414
|
}, {
|
|
28411
28415
|
default: f(() => [
|
|
28412
28416
|
v(c(Y), {
|
|
@@ -28420,7 +28424,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28420
28424
|
variant: "ghost",
|
|
28421
28425
|
size: "sm",
|
|
28422
28426
|
"aria-label": "Удалить блок",
|
|
28423
|
-
onClick: (
|
|
28427
|
+
onClick: (T) => k(_)
|
|
28424
28428
|
}, {
|
|
28425
28429
|
default: f(() => [
|
|
28426
28430
|
v(c(Y), {
|
|
@@ -28436,7 +28440,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28436
28440
|
key: 0,
|
|
28437
28441
|
fields: b(p.type).fields,
|
|
28438
28442
|
"model-value": p.data,
|
|
28439
|
-
"onUpdate:modelValue": (
|
|
28443
|
+
"onUpdate:modelValue": (T) => x(_, T)
|
|
28440
28444
|
}, null, 8, ["fields", "model-value", "onUpdate:modelValue"])) : (o(), s("p", cz, "Неизвестный тип блока: " + w(p.type), 1))
|
|
28441
28445
|
]),
|
|
28442
28446
|
_: 2
|
|
@@ -28463,7 +28467,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28463
28467
|
default: f(() => [
|
|
28464
28468
|
(o(!0), s(E, null, Q(d.value, (p) => (o(), V(c(Ae), {
|
|
28465
28469
|
key: p.type,
|
|
28466
|
-
onClick: (
|
|
28470
|
+
onClick: (_) => y(p.type)
|
|
28467
28471
|
}, {
|
|
28468
28472
|
default: f(() => [
|
|
28469
28473
|
j(w(p.label), 1)
|
|
@@ -28600,7 +28604,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28600
28604
|
function l(h, y) {
|
|
28601
28605
|
return h.key ?? y;
|
|
28602
28606
|
}
|
|
28603
|
-
const i =
|
|
28607
|
+
const i = q(n.active ?? l(n.items[0] ?? {}, 0));
|
|
28604
28608
|
function d(h) {
|
|
28605
28609
|
i.value = h, r("update:active", h);
|
|
28606
28610
|
}
|
|
@@ -28649,7 +28653,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28649
28653
|
features: { default: () => ({ create: !1, delete: !1, bulkDelete: !1 }) }
|
|
28650
28654
|
},
|
|
28651
28655
|
setup(a) {
|
|
28652
|
-
const t = a, n =
|
|
28656
|
+
const t = a, n = Te(), r = Kg(), l = M(() => n.getResource(t.resource)), i = q([]), d = q(!1), h = q(null), y = q(/* @__PURE__ */ new Set()), k = q(null), m = M(() => {
|
|
28653
28657
|
const X = r.state[t.parent_field];
|
|
28654
28658
|
return X ?? null;
|
|
28655
28659
|
}), x = M(() => (l.value?.columns ?? []).filter((D) => {
|
|
@@ -28670,7 +28674,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28670
28674
|
return D.editable ?? null;
|
|
28671
28675
|
return null;
|
|
28672
28676
|
}
|
|
28673
|
-
async function
|
|
28677
|
+
async function _() {
|
|
28674
28678
|
if (m.value === null) {
|
|
28675
28679
|
i.value = [];
|
|
28676
28680
|
return;
|
|
@@ -28689,25 +28693,25 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28689
28693
|
d.value = !1;
|
|
28690
28694
|
}
|
|
28691
28695
|
}
|
|
28692
|
-
e1(
|
|
28693
|
-
function
|
|
28696
|
+
e1(_), xe(m, _);
|
|
28697
|
+
function T(X) {
|
|
28694
28698
|
return X.id ?? "";
|
|
28695
28699
|
}
|
|
28696
28700
|
function P(X) {
|
|
28697
28701
|
return X?.row;
|
|
28698
28702
|
}
|
|
28699
|
-
function
|
|
28700
|
-
const D =
|
|
28703
|
+
function z(X) {
|
|
28704
|
+
const D = T(X), I = new Set(y.value);
|
|
28701
28705
|
I.has(D) ? I.delete(D) : I.add(D), y.value = I;
|
|
28702
28706
|
}
|
|
28703
28707
|
function W() {
|
|
28704
|
-
y.value.size === i.value.length ? y.value = /* @__PURE__ */ new Set() : y.value = new Set(i.value.map(
|
|
28708
|
+
y.value.size === i.value.length ? y.value = /* @__PURE__ */ new Set() : y.value = new Set(i.value.map(T));
|
|
28705
28709
|
}
|
|
28706
|
-
async function
|
|
28707
|
-
const D =
|
|
28710
|
+
async function $(X) {
|
|
28711
|
+
const D = T(X);
|
|
28708
28712
|
if (confirm("Удалить строку?"))
|
|
28709
28713
|
try {
|
|
28710
|
-
await Me().post(`/${t.resource}/delete`, { id: D }), i.value = i.value.filter((I) =>
|
|
28714
|
+
await Me().post(`/${t.resource}/delete`, { id: D }), i.value = i.value.filter((I) => T(I) !== D), y.value.delete(D), y.value = new Set(y.value);
|
|
28711
28715
|
} catch {
|
|
28712
28716
|
we.error("Не удалось удалить строку.");
|
|
28713
28717
|
}
|
|
@@ -28716,12 +28720,12 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28716
28720
|
if (y.value.size === 0 || !confirm(`Удалить ${y.value.size} строк?`)) return;
|
|
28717
28721
|
const X = [...y.value];
|
|
28718
28722
|
try {
|
|
28719
|
-
await Promise.all(X.map((D) => Me().post(`/${t.resource}/delete`, { id: D }))), y.value = /* @__PURE__ */ new Set(), await
|
|
28723
|
+
await Promise.all(X.map((D) => Me().post(`/${t.resource}/delete`, { id: D }))), y.value = /* @__PURE__ */ new Set(), await _();
|
|
28720
28724
|
} catch {
|
|
28721
|
-
we.error("Не удалось удалить часть строк."), await
|
|
28725
|
+
we.error("Не удалось удалить часть строк."), await _();
|
|
28722
28726
|
}
|
|
28723
28727
|
}
|
|
28724
|
-
function
|
|
28728
|
+
function U() {
|
|
28725
28729
|
if (!L.value || k.value !== null) return;
|
|
28726
28730
|
const X = {};
|
|
28727
28731
|
m.value !== null && (X[t.foreign_key] = m.value), k.value = X;
|
|
@@ -28732,7 +28736,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28732
28736
|
async function ae() {
|
|
28733
28737
|
if (k.value !== null)
|
|
28734
28738
|
try {
|
|
28735
|
-
await Me().post(`/${t.resource}/create`, k.value), k.value = null, await
|
|
28739
|
+
await Me().post(`/${t.resource}/create`, k.value), k.value = null, await _();
|
|
28736
28740
|
} catch {
|
|
28737
28741
|
we.error("Не удалось создать запись.");
|
|
28738
28742
|
}
|
|
@@ -28751,7 +28755,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28751
28755
|
variant: "primary",
|
|
28752
28756
|
size: "sm",
|
|
28753
28757
|
disabled: k.value !== null,
|
|
28754
|
-
onClick:
|
|
28758
|
+
onClick: U
|
|
28755
28759
|
}, {
|
|
28756
28760
|
default: f(() => [
|
|
28757
28761
|
v(c(Y), { icon: c(De) }, null, 8, ["icon"]),
|
|
@@ -28775,7 +28779,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28775
28779
|
d.value && i.value.length === 0 ? (o(), V(c(Xn), { key: 0 })) : h.value ? (o(), V(c(Ug), {
|
|
28776
28780
|
key: 1,
|
|
28777
28781
|
message: h.value.message,
|
|
28778
|
-
onRetry:
|
|
28782
|
+
onRetry: _
|
|
28779
28783
|
}, null, 8, ["message"])) : !d.value && i.value.length === 0 && k.value === null ? (o(), V(c(Og), {
|
|
28780
28784
|
key: 2,
|
|
28781
28785
|
title: "Нет данных",
|
|
@@ -28787,32 +28791,32 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28787
28791
|
selectable: S.value,
|
|
28788
28792
|
selection: y.value,
|
|
28789
28793
|
"row-key": "id",
|
|
28790
|
-
onSelectRow:
|
|
28794
|
+
onSelectRow: z,
|
|
28791
28795
|
onSelectAll: W
|
|
28792
28796
|
}, yI({ _: 2 }, [
|
|
28793
28797
|
Q(b.value, (I) => ({
|
|
28794
28798
|
name: I.key,
|
|
28795
|
-
fn: f((
|
|
28796
|
-
P(
|
|
28799
|
+
fn: f((A) => [
|
|
28800
|
+
P(A) && p(I.key) ? (o(), V(PI, {
|
|
28797
28801
|
key: 0,
|
|
28798
28802
|
"resource-slug": a.resource,
|
|
28799
|
-
"row-id":
|
|
28803
|
+
"row-id": T(P(A)),
|
|
28800
28804
|
column: I.key,
|
|
28801
|
-
value: P(
|
|
28805
|
+
value: P(A)[I.key],
|
|
28802
28806
|
editable: !0,
|
|
28803
28807
|
"input-type": p(I.key).as,
|
|
28804
28808
|
options: p(I.key).options,
|
|
28805
|
-
"row-override": P(
|
|
28809
|
+
"row-override": P(A)._editable ?? {},
|
|
28806
28810
|
onSaved: (C) => {
|
|
28807
|
-
const R = P(
|
|
28811
|
+
const R = P(A);
|
|
28808
28812
|
R && (R[I.key] = C);
|
|
28809
28813
|
}
|
|
28810
28814
|
}, {
|
|
28811
28815
|
default: f(() => [
|
|
28812
|
-
u("span", null, w(Z(P(
|
|
28816
|
+
u("span", null, w(Z(P(A), I.key)), 1)
|
|
28813
28817
|
]),
|
|
28814
28818
|
_: 2
|
|
28815
|
-
}, 1032, ["resource-slug", "row-id", "column", "value", "input-type", "options", "row-override", "onSaved"])) : (o(), s("span", wz, w(Z(P(
|
|
28819
|
+
}, 1032, ["resource-slug", "row-id", "column", "value", "input-type", "options", "row-override", "onSaved"])) : (o(), s("span", wz, w(Z(P(A) ?? {}, I.key)), 1))
|
|
28816
28820
|
])
|
|
28817
28821
|
})),
|
|
28818
28822
|
g.value ? {
|
|
@@ -28822,7 +28826,7 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28822
28826
|
type: "button",
|
|
28823
28827
|
class: "admin-embedded-table__row-delete",
|
|
28824
28828
|
"aria-label": "Удалить",
|
|
28825
|
-
onClick: (
|
|
28829
|
+
onClick: (A) => P(I) && $(P(I))
|
|
28826
28830
|
}, [
|
|
28827
28831
|
v(c(Y), {
|
|
28828
28832
|
icon: c(Re),
|
|
@@ -28844,19 +28848,19 @@ const Te = /* @__PURE__ */ ee({
|
|
|
28844
28848
|
key: 0,
|
|
28845
28849
|
class: "admin-embedded-table__draft-input",
|
|
28846
28850
|
value: k.value[I.key] ?? "",
|
|
28847
|
-
onChange: (
|
|
28851
|
+
onChange: (A) => oe(I.key, A.target.value)
|
|
28848
28852
|
}, [
|
|
28849
28853
|
D[1] || (D[1] = u("option", { value: "" }, null, -1)),
|
|
28850
|
-
(o(!0), s(E, null, Q(p(I.key).options, (
|
|
28854
|
+
(o(!0), s(E, null, Q(p(I.key).options, (A, C) => (o(), s("option", {
|
|
28851
28855
|
key: C,
|
|
28852
28856
|
value: C
|
|
28853
|
-
}, w(
|
|
28857
|
+
}, w(A), 9, _z))), 128))
|
|
28854
28858
|
], 40, Sz)) : (o(), s("input", {
|
|
28855
28859
|
key: 1,
|
|
28856
28860
|
class: "admin-embedded-table__draft-input",
|
|
28857
28861
|
type: p(I.key)?.as === "number" ? "number" : p(I.key)?.as === "date" ? "date" : "text",
|
|
28858
28862
|
value: k.value[I.key] ?? "",
|
|
28859
|
-
onInput: (
|
|
28863
|
+
onInput: (A) => oe(I.key, A.target.value)
|
|
28860
28864
|
}, null, 40, qz))
|
|
28861
28865
|
]))), 128))
|
|
28862
28866
|
]),
|
|
@@ -28899,16 +28903,16 @@ function Pz() {
|
|
|
28899
28903
|
fields: {
|
|
28900
28904
|
// Backend Field-классы из dskripchenko/laravel-admin отдают эти fieldType()
|
|
28901
28905
|
// строки. Соответствие см. core/src/Field/{Input,TextArea,Select,...}.php.
|
|
28902
|
-
input:
|
|
28903
|
-
text:
|
|
28904
|
-
email:
|
|
28905
|
-
url:
|
|
28906
|
-
password:
|
|
28907
|
-
tel:
|
|
28908
|
-
search:
|
|
28909
|
-
slug:
|
|
28910
|
-
hidden:
|
|
28911
|
-
label:
|
|
28906
|
+
input: $e,
|
|
28907
|
+
text: $e,
|
|
28908
|
+
email: $e,
|
|
28909
|
+
url: $e,
|
|
28910
|
+
password: $e,
|
|
28911
|
+
tel: $e,
|
|
28912
|
+
search: $e,
|
|
28913
|
+
slug: $e,
|
|
28914
|
+
hidden: $e,
|
|
28915
|
+
label: $e,
|
|
28912
28916
|
textarea: Vg,
|
|
28913
28917
|
// WYSIWYG default — собственный @dskripchenko/wysiwyg (zero-dep,
|
|
28914
28918
|
// ~7 KB gzip). Host может перебить:
|
|
@@ -28948,8 +28952,8 @@ function Pz() {
|
|
|
28948
28952
|
"date-range": b1,
|
|
28949
28953
|
time: b1,
|
|
28950
28954
|
"time-picker": b1,
|
|
28951
|
-
color:
|
|
28952
|
-
"color-picker":
|
|
28955
|
+
color: $e,
|
|
28956
|
+
"color-picker": $e,
|
|
28953
28957
|
file: hI,
|
|
28954
28958
|
image: hI,
|
|
28955
28959
|
image_cropper: HA,
|
|
@@ -29256,7 +29260,7 @@ function cV(a, t = {}) {
|
|
|
29256
29260
|
});
|
|
29257
29261
|
II(l);
|
|
29258
29262
|
const i = NI(Hx), d = XI();
|
|
29259
|
-
i.use(d),
|
|
29263
|
+
i.use(d), Ne().hydrate(a), mg().hydrate(a), Zg().hydrate(a), vg().hydrate(a), Gg().hydrate(a), Pz(), dq(), Kz();
|
|
29260
29264
|
const h = Lq({
|
|
29261
29265
|
base: r,
|
|
29262
29266
|
history: t.router?.history ?? kI(r),
|
|
@@ -29302,9 +29306,9 @@ function cV(a, t = {}) {
|
|
|
29302
29306
|
}
|
|
29303
29307
|
x();
|
|
29304
29308
|
}), t.skipManifestLoad)
|
|
29305
|
-
|
|
29309
|
+
Te().bootResolved = !0;
|
|
29306
29310
|
else {
|
|
29307
|
-
const k =
|
|
29311
|
+
const k = Te(), m = Ne(), x = bI(), b = async () => {
|
|
29308
29312
|
x.load().catch(() => {
|
|
29309
29313
|
});
|
|
29310
29314
|
try {
|
|
@@ -29445,13 +29449,13 @@ const tH = { class: "admin-notifs__hd" }, nH = { class: "admin-notifs__title" },
|
|
|
29445
29449
|
}
|
|
29446
29450
|
function g(S) {
|
|
29447
29451
|
if (!S) return "";
|
|
29448
|
-
const p = new Date(S),
|
|
29449
|
-
if (
|
|
29450
|
-
if (
|
|
29451
|
-
const P = Math.floor(
|
|
29452
|
+
const p = new Date(S), _ = Math.max(0, Date.now() - p.getTime()), T = Math.floor(_ / 6e4);
|
|
29453
|
+
if (T < 1) return "только что";
|
|
29454
|
+
if (T < 60) return `${T} мин назад`;
|
|
29455
|
+
const P = Math.floor(T / 60);
|
|
29452
29456
|
if (P < 24) return `${P} ч назад`;
|
|
29453
|
-
const
|
|
29454
|
-
return
|
|
29457
|
+
const z = Math.floor(P / 24);
|
|
29458
|
+
return z < 7 ? `${z} д назад` : p.toLocaleDateString("ru-RU");
|
|
29455
29459
|
}
|
|
29456
29460
|
return (S, p) => (o(), V(c(yw), {
|
|
29457
29461
|
"model-value": a.open,
|
|
@@ -29508,38 +29512,38 @@ const tH = { class: "admin-notifs__hd" }, nH = { class: "admin-notifs__title" },
|
|
|
29508
29512
|
})
|
|
29509
29513
|
]),
|
|
29510
29514
|
default: f(() => [
|
|
29511
|
-
(o(), s(E, null, Q(["all", "unread", "read"], (
|
|
29512
|
-
key:
|
|
29513
|
-
value:
|
|
29515
|
+
(o(), s(E, null, Q(["all", "unread", "read"], (_) => v(c(MI), {
|
|
29516
|
+
key: _,
|
|
29517
|
+
value: _
|
|
29514
29518
|
}, {
|
|
29515
29519
|
default: f(() => [
|
|
29516
29520
|
u("ul", cH, [
|
|
29517
29521
|
c(l).loading ? (o(), s("li", iH, " Загрузка… ")) : c(l).items.length === 0 ? (o(), s("li", lH, " Нет уведомлений ")) : F("", !0),
|
|
29518
|
-
(o(!0), s(E, null, Q(c(l).items, (
|
|
29519
|
-
key:
|
|
29522
|
+
(o(!0), s(E, null, Q(c(l).items, (T) => (o(), s("li", {
|
|
29523
|
+
key: T.id,
|
|
29520
29524
|
class: fe([
|
|
29521
29525
|
"admin-notifs__item",
|
|
29522
|
-
`admin-notifs__item--${x(
|
|
29523
|
-
{ "admin-notifs__item--unread": !
|
|
29526
|
+
`admin-notifs__item--${x(T)}`,
|
|
29527
|
+
{ "admin-notifs__item--unread": !T.read_at }
|
|
29524
29528
|
]),
|
|
29525
|
-
onClick: (P) => k(
|
|
29529
|
+
onClick: (P) => k(T)
|
|
29526
29530
|
}, [
|
|
29527
29531
|
u("span", {
|
|
29528
29532
|
class: "admin-notifs__icon",
|
|
29529
|
-
"data-kind": x(
|
|
29533
|
+
"data-kind": x(T)
|
|
29530
29534
|
}, null, 8, rH),
|
|
29531
29535
|
u("div", sH, [
|
|
29532
29536
|
u("div", hH, [
|
|
29533
|
-
|
|
29534
|
-
u("span", pH, w(g(
|
|
29537
|
+
T.read_at ? (o(), s("span", yH, w(b(T)), 1)) : (o(), s("strong", uH, w(b(T)), 1)),
|
|
29538
|
+
u("span", pH, w(g(T.created_at)), 1)
|
|
29535
29539
|
]),
|
|
29536
|
-
L(
|
|
29540
|
+
L(T) ? (o(), s("p", kH, w(L(T)), 1)) : F("", !0)
|
|
29537
29541
|
]),
|
|
29538
29542
|
u("button", {
|
|
29539
29543
|
type: "button",
|
|
29540
29544
|
class: "admin-notifs__close",
|
|
29541
29545
|
"aria-label": "Удалить",
|
|
29542
|
-
onClick: (P) => m(
|
|
29546
|
+
onClick: (P) => m(T, P)
|
|
29543
29547
|
}, " × ", 8, mH)
|
|
29544
29548
|
], 10, dH))), 128))
|
|
29545
29549
|
])
|
|
@@ -29586,17 +29590,17 @@ const tH = { class: "admin-notifs__hd" }, nH = { class: "admin-notifs__title" },
|
|
|
29586
29590
|
{ label: "Сопоставление", description: "Колонки файла → поля" },
|
|
29587
29591
|
{ label: "Предпросмотр", description: "Проверка первых строк" },
|
|
29588
29592
|
{ label: "Импорт", description: "Запуск + сводка" }
|
|
29589
|
-
], i =
|
|
29593
|
+
], i = q(0), d = M(() => n.step ?? i.value);
|
|
29590
29594
|
function h(P) {
|
|
29591
29595
|
n.step === void 0 && (P < 0 || P >= l.length || (i.value = P));
|
|
29592
29596
|
}
|
|
29593
|
-
const y =
|
|
29597
|
+
const y = q([]);
|
|
29594
29598
|
function k(P) {
|
|
29595
29599
|
y.value = P, P.length > 0 && r("file-uploaded", P[0].file);
|
|
29596
29600
|
}
|
|
29597
|
-
const m =
|
|
29598
|
-
function x(P,
|
|
29599
|
-
m.value[P] =
|
|
29601
|
+
const m = q({});
|
|
29602
|
+
function x(P, z) {
|
|
29603
|
+
m.value[P] = z === null || z === "" ? null : String(z);
|
|
29600
29604
|
}
|
|
29601
29605
|
function b() {
|
|
29602
29606
|
return n.headers.map((P) => ({
|
|
@@ -29621,14 +29625,14 @@ const tH = { class: "admin-notifs__hd" }, nH = { class: "admin-notifs__title" },
|
|
|
29621
29625
|
default:
|
|
29622
29626
|
return !1;
|
|
29623
29627
|
}
|
|
29624
|
-
}),
|
|
29628
|
+
}), _ = M(() => [
|
|
29625
29629
|
{ value: "", label: "Не импортировать" },
|
|
29626
29630
|
...n.fieldOptions
|
|
29627
29631
|
]);
|
|
29628
|
-
function
|
|
29632
|
+
function T() {
|
|
29629
29633
|
r("cancel");
|
|
29630
29634
|
}
|
|
29631
|
-
return (P,
|
|
29635
|
+
return (P, z) => (o(), s("section", vH, [
|
|
29632
29636
|
u("header", fH, [
|
|
29633
29637
|
u("div", MH, [
|
|
29634
29638
|
u("h1", gH, w(a.title), 1)
|
|
@@ -29636,9 +29640,9 @@ const tH = { class: "admin-notifs__hd" }, nH = { class: "admin-notifs__title" },
|
|
|
29636
29640
|
u("div", IH, [
|
|
29637
29641
|
v(c(te), {
|
|
29638
29642
|
variant: "ghost",
|
|
29639
|
-
onClick:
|
|
29643
|
+
onClick: T
|
|
29640
29644
|
}, {
|
|
29641
|
-
default: f(() => [...
|
|
29645
|
+
default: f(() => [...z[2] || (z[2] = [
|
|
29642
29646
|
j("Отмена", -1)
|
|
29643
29647
|
])]),
|
|
29644
29648
|
_: 1
|
|
@@ -29655,7 +29659,7 @@ const tH = { class: "admin-notifs__hd" }, nH = { class: "admin-notifs__title" },
|
|
|
29655
29659
|
class: "admin-import-wizard__card"
|
|
29656
29660
|
}, {
|
|
29657
29661
|
default: f(() => [
|
|
29658
|
-
|
|
29662
|
+
z[3] || (z[3] = u("header", { class: "admin-import-wizard__card-hd" }, [
|
|
29659
29663
|
u("h3", null, "1. Загрузите файл"),
|
|
29660
29664
|
u("p", null, "CSV / TSV / XLSX, до 50 MB")
|
|
29661
29665
|
], -1)),
|
|
@@ -29676,7 +29680,7 @@ const tH = { class: "admin-notifs__hd" }, nH = { class: "admin-notifs__title" },
|
|
|
29676
29680
|
class: "admin-import-wizard__card"
|
|
29677
29681
|
}, {
|
|
29678
29682
|
default: f(() => [
|
|
29679
|
-
|
|
29683
|
+
z[5] || (z[5] = u("header", { class: "admin-import-wizard__card-hd" }, [
|
|
29680
29684
|
u("h3", null, "2. Сопоставьте колонки"),
|
|
29681
29685
|
u("p", null, "Выберите поле ресурса для каждой колонки файла")
|
|
29682
29686
|
], -1)),
|
|
@@ -29689,12 +29693,12 @@ const tH = { class: "admin-notifs__hd" }, nH = { class: "admin-notifs__title" },
|
|
|
29689
29693
|
u("strong", null, w(W.label), 1),
|
|
29690
29694
|
W.sample ? (o(), s("span", bH, " «" + w(W.sample) + "» ", 1)) : F("", !0)
|
|
29691
29695
|
]),
|
|
29692
|
-
|
|
29696
|
+
z[4] || (z[4] = u("span", { class: "admin-import-wizard__map-arrow" }, "→", -1)),
|
|
29693
29697
|
v(c(yg), {
|
|
29694
29698
|
"model-value": m.value[W.key] ?? "",
|
|
29695
|
-
options:
|
|
29699
|
+
options: _.value,
|
|
29696
29700
|
placeholder: "Не импортировать",
|
|
29697
|
-
"onUpdate:modelValue": (
|
|
29701
|
+
"onUpdate:modelValue": ($) => x(W.key, $)
|
|
29698
29702
|
}, null, 8, ["model-value", "options", "onUpdate:modelValue"])
|
|
29699
29703
|
]))), 128))
|
|
29700
29704
|
]))
|
|
@@ -29707,15 +29711,15 @@ const tH = { class: "admin-notifs__hd" }, nH = { class: "admin-notifs__title" },
|
|
|
29707
29711
|
}, {
|
|
29708
29712
|
default: f(() => [
|
|
29709
29713
|
u("header", CH, [
|
|
29710
|
-
|
|
29714
|
+
z[6] || (z[6] = u("h3", null, "3. Предпросмотр", -1)),
|
|
29711
29715
|
u("p", null, "Первые " + w(a.preview.length) + " строк перед импортом", 1)
|
|
29712
29716
|
]),
|
|
29713
|
-
a.preview.some((W) => W.__warning) ? (o(), V(c(
|
|
29717
|
+
a.preview.some((W) => W.__warning) ? (o(), V(c(We), {
|
|
29714
29718
|
key: 0,
|
|
29715
29719
|
variant: "warning",
|
|
29716
29720
|
style: { "margin-bottom": "var(--uid-space-md)" }
|
|
29717
29721
|
}, {
|
|
29718
|
-
default: f(() => [...
|
|
29722
|
+
default: f(() => [...z[7] || (z[7] = [
|
|
29719
29723
|
j(" Часть строк имеет предупреждения — проверьте перед импортом. ", -1)
|
|
29720
29724
|
])]),
|
|
29721
29725
|
_: 1
|
|
@@ -29733,7 +29737,7 @@ const tH = { class: "admin-notifs__hd" }, nH = { class: "admin-notifs__title" },
|
|
|
29733
29737
|
class: "admin-import-wizard__card"
|
|
29734
29738
|
}, {
|
|
29735
29739
|
default: f(() => [
|
|
29736
|
-
|
|
29740
|
+
z[8] || (z[8] = u("header", { class: "admin-import-wizard__card-hd" }, [
|
|
29737
29741
|
u("h3", null, "4. Импорт")
|
|
29738
29742
|
], -1)),
|
|
29739
29743
|
a.progress ? (o(), s(E, { key: 1 }, [
|
|
@@ -29767,21 +29771,21 @@ const tH = { class: "admin-notifs__hd" }, nH = { class: "admin-notifs__title" },
|
|
|
29767
29771
|
S.value ? (o(), V(c(te), {
|
|
29768
29772
|
key: 0,
|
|
29769
29773
|
variant: "ghost",
|
|
29770
|
-
onClick:
|
|
29774
|
+
onClick: z[0] || (z[0] = (W) => h(d.value - 1))
|
|
29771
29775
|
}, {
|
|
29772
|
-
default: f(() => [...
|
|
29776
|
+
default: f(() => [...z[9] || (z[9] = [
|
|
29773
29777
|
j(" Назад ", -1)
|
|
29774
29778
|
])]),
|
|
29775
29779
|
_: 1
|
|
29776
29780
|
})) : F("", !0),
|
|
29777
|
-
|
|
29781
|
+
z[13] || (z[13] = u("span", { style: { flex: "1" } }, null, -1)),
|
|
29778
29782
|
d.value === 0 ? (o(), V(c(te), {
|
|
29779
29783
|
key: 1,
|
|
29780
29784
|
variant: "primary",
|
|
29781
29785
|
disabled: !p.value,
|
|
29782
|
-
onClick:
|
|
29786
|
+
onClick: z[1] || (z[1] = (W) => h(1))
|
|
29783
29787
|
}, {
|
|
29784
|
-
default: f(() => [...
|
|
29788
|
+
default: f(() => [...z[10] || (z[10] = [
|
|
29785
29789
|
j(" Далее ", -1)
|
|
29786
29790
|
])]),
|
|
29787
29791
|
_: 1
|
|
@@ -29791,7 +29795,7 @@ const tH = { class: "admin-notifs__hd" }, nH = { class: "admin-notifs__title" },
|
|
|
29791
29795
|
disabled: !p.value,
|
|
29792
29796
|
onClick: L
|
|
29793
29797
|
}, {
|
|
29794
|
-
default: f(() => [...
|
|
29798
|
+
default: f(() => [...z[11] || (z[11] = [
|
|
29795
29799
|
j(" Подтвердить mapping ", -1)
|
|
29796
29800
|
])]),
|
|
29797
29801
|
_: 1
|
|
@@ -29800,7 +29804,7 @@ const tH = { class: "admin-notifs__hd" }, nH = { class: "admin-notifs__title" },
|
|
|
29800
29804
|
variant: "primary",
|
|
29801
29805
|
onClick: g
|
|
29802
29806
|
}, {
|
|
29803
|
-
default: f(() => [...
|
|
29807
|
+
default: f(() => [...z[12] || (z[12] = [
|
|
29804
29808
|
j(" Запустить импорт ", -1)
|
|
29805
29809
|
])]),
|
|
29806
29810
|
_: 1
|
|
@@ -29917,7 +29921,7 @@ export {
|
|
|
29917
29921
|
ox as AdminShell,
|
|
29918
29922
|
ax as AdminSidebar,
|
|
29919
29923
|
Dw as AdminTopBar,
|
|
29920
|
-
|
|
29924
|
+
Ge as ApiError,
|
|
29921
29925
|
Fz as BadgeEntry,
|
|
29922
29926
|
jI as BarChartWidget,
|
|
29923
29927
|
To as CheckboxField,
|
|
@@ -29961,7 +29965,7 @@ export {
|
|
|
29961
29965
|
Mz as TabsLayout,
|
|
29962
29966
|
Vg as TextAreaField,
|
|
29963
29967
|
ke as TextEntry,
|
|
29964
|
-
|
|
29968
|
+
$e as TextField,
|
|
29965
29969
|
wI as ThemeToggle,
|
|
29966
29970
|
cb as TwoFactorForm,
|
|
29967
29971
|
LI as UnauthenticatedError,
|
|
@@ -30017,10 +30021,10 @@ export {
|
|
|
30017
30021
|
Qg as toApiError,
|
|
30018
30022
|
vw as tryUseFormState,
|
|
30019
30023
|
qo as tryUseRecord,
|
|
30020
|
-
|
|
30024
|
+
Ne as useAuthStore,
|
|
30021
30025
|
Pe as useFormState,
|
|
30022
30026
|
mg as useLocaleStore,
|
|
30023
|
-
|
|
30027
|
+
Te as useManifestStore,
|
|
30024
30028
|
bI as useMenuStore,
|
|
30025
30029
|
vg as useNotificationsStore,
|
|
30026
30030
|
XH as useRecord,
|