@webx-ui/module-admin 0.17.0 → 0.18.0
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/collections/api.d.ts +29 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1565 -1272
- package/dist/index.js.map +1 -1
- package/dist/relations/RelationsField.d.ts +25 -0
- package/dist/relations/api.d.ts +45 -0
- package/dist/screenTypes.d.ts +3 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
import { RouterLink as
|
|
3
|
-
import { WxSortableList as
|
|
4
|
-
import { watchSystemTheme as
|
|
5
|
-
import { WxScreenRenderer as
|
|
6
|
-
const
|
|
7
|
-
function
|
|
8
|
-
const e =
|
|
1
|
+
import { inject as se, reactive as be, defineComponent as M, useModel as re, ref as L, watch as te, computed as g, openBlock as m, createElementBlock as $, createVNode as w, unref as a, withCtx as y, createElementVNode as B, toDisplayString as A, createBlock as S, createTextVNode as z, createCommentVNode as N, mergeModels as ne, provide as ze, normalizeClass as oe, createSlots as ke, nextTick as Ie, useId as Tt, Fragment as j, onMounted as Ee, renderList as ae, mergeProps as et, withModifiers as tt, useSlots as St, useTemplateRef as lt, renderSlot as Y, normalizeProps as Ct, guardReactiveProps as Wt, resolveComponent as X, watchEffect as At, onUnmounted as Vt, isRef as at, createApp as Lt, h as ce, withKeys as nt, onBeforeUnmount as ot } from "vue";
|
|
2
|
+
import { RouterLink as Nt, useRouter as _e, useRoute as st, createRouter as Rt, createWebHistory as Ut, onBeforeRouteLeave as zt } from "vue-router";
|
|
3
|
+
import { WxSortableList as Be, WxAction as ue, WxBadge as $e, WxSelect as we, WxAutocomplete as Ne, WxSwitch as Ae, WxInputNumber as It, WxButton as le, WxSegmented as Et, WxText as ee, WxInput as Te, WxCheckbox as He, WxActions as Bt, WxDropdownItem as Mt, useElementWidth as Pt, WxHeading as Ft, WxIcon as Me, WxTabs as Dt, WxCard as Re, WxRichText as Ot, useLocales as it, WxAlert as Se, WxResult as Ht, useResponsiveShell as jt, shellLayoutFor as Kt, WxToaster as qt, WebxUI as Yt, dateLocaleKey as Xt, localesKey as Gt, useModal as Jt, WxDialog as rt, WxFormItem as Qt, WxSpace as Zt, createModal as el, WxSkeleton as me, WxEmpty as ut, WxTooltip as dt, toast as K, confirm as xe, localizedValue as tl, WxBreadcrumb as ll, WxBreadcrumbItem as je, WxActionBar as al, WxPopover as nl, WxAvatar as ol, WxTextarea as Ke } from "@webx-ui/core";
|
|
4
|
+
import { watchSystemTheme as sl, applyTheme as il, systemTheme as rl } from "@webx-ui/tokens";
|
|
5
|
+
import { WxScreenRenderer as ul } from "@webx-ui/schema";
|
|
6
|
+
const Ce = /* @__PURE__ */ Symbol("webx-i18n");
|
|
7
|
+
function dl() {
|
|
8
|
+
const e = se(Ce, null);
|
|
9
9
|
if (e === null)
|
|
10
10
|
throw new Error("useI18n() was called outside a panel created by createAdmin().");
|
|
11
11
|
return e;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
const t =
|
|
15
|
-
return t === null ?
|
|
13
|
+
function D(e) {
|
|
14
|
+
const t = se(Ce, null);
|
|
15
|
+
return t === null ? Pe().scope(e) : t.scope(e);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
e.provide(
|
|
17
|
+
function cl(e, t) {
|
|
18
|
+
e.provide(Ce, t);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const t = e.fallback ?? "en",
|
|
20
|
+
function Pe(e = {}) {
|
|
21
|
+
const t = e.fallback ?? "en", l = be({
|
|
22
22
|
locale: e.locale ?? t,
|
|
23
23
|
fallback: t,
|
|
24
24
|
panelLocales: [],
|
|
25
25
|
contentLocales: []
|
|
26
|
-
}),
|
|
26
|
+
}), n = {}, o = be({ value: {} });
|
|
27
27
|
function i(r, u, d) {
|
|
28
28
|
let h = r[u]?.[d[0] ?? ""];
|
|
29
|
-
for (const
|
|
29
|
+
for (const f of d.slice(1)) {
|
|
30
30
|
if (typeof h != "object" || h === null)
|
|
31
31
|
return null;
|
|
32
|
-
h = h[
|
|
32
|
+
h = h[f];
|
|
33
33
|
}
|
|
34
34
|
return typeof h == "string" ? h : null;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
const [h,
|
|
36
|
+
function s(r, u, d) {
|
|
37
|
+
const [h, f] = u.includes("::") ? u.split("::", 2) : [r, u], v = f.split("."), c = i(o.value, h, v) ?? i(n, h, v) ?? // Not an empty string: a key on screen is ugly, but it says which key, and a blank
|
|
38
38
|
// label says nothing to anybody trying to fix it.
|
|
39
39
|
u;
|
|
40
|
-
return d === void 0 ? c :
|
|
40
|
+
return d === void 0 ? c : ml(c, d);
|
|
41
41
|
}
|
|
42
42
|
return {
|
|
43
|
-
state:
|
|
43
|
+
state: l,
|
|
44
44
|
defaults(r, u) {
|
|
45
|
-
|
|
45
|
+
n[r] = { ...n[r], ...u };
|
|
46
46
|
},
|
|
47
47
|
load(r, u, d) {
|
|
48
|
-
|
|
48
|
+
o.value = r ?? {}, l.locale = u ?? l.locale, d !== void 0 && (l.fallback = d);
|
|
49
49
|
},
|
|
50
50
|
scope(r) {
|
|
51
|
-
return (u, d) =>
|
|
51
|
+
return (u, d) => s(r, u, d);
|
|
52
52
|
},
|
|
53
|
-
t: (r, u) =>
|
|
53
|
+
t: (r, u) => s("", r, u)
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
let
|
|
58
|
-
for (const [
|
|
59
|
-
|
|
60
|
-
return
|
|
56
|
+
function ml(e, t) {
|
|
57
|
+
let l = e;
|
|
58
|
+
for (const [n, o] of Object.entries(t))
|
|
59
|
+
l = l.replaceAll(`:${n}`, String(o));
|
|
60
|
+
return l;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
const
|
|
62
|
+
function ve(e, t) {
|
|
63
|
+
const l = `${e.apiPath}/${t.replace(/^\/+|\/+$/g, "")}`, n = (o) => o.data;
|
|
64
64
|
return {
|
|
65
|
-
list: (
|
|
65
|
+
list: (o = {}) => {
|
|
66
66
|
const i = new URLSearchParams();
|
|
67
|
-
return
|
|
67
|
+
return o.q && i.set("q", o.q), o.visible && i.set("visible", "1"), e.http.get(i.size > 0 ? `${l}?${i}` : l);
|
|
68
68
|
},
|
|
69
|
-
create: (
|
|
70
|
-
get: (
|
|
71
|
-
save: (
|
|
72
|
-
remove: (
|
|
69
|
+
create: (o) => e.http.post(l, o).then(n),
|
|
70
|
+
get: (o) => e.http.get(`${l}/${o}`).then(n),
|
|
71
|
+
save: (o, i) => e.http.put(`${l}/${o}`, { values: i }).then(n),
|
|
72
|
+
remove: (o) => e.http.delete(`${l}/${o}`).then(() => {
|
|
73
73
|
}),
|
|
74
|
-
restore: (
|
|
75
|
-
reorder: (
|
|
74
|
+
restore: (o) => e.http.post(`${l}/${o}/restore`, {}).then(n),
|
|
75
|
+
reorder: (o) => e.http.post(`${l}/reorder`, { ids: o }).then(() => {
|
|
76
76
|
})
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
const
|
|
81
|
-
return e.http.post(`${
|
|
79
|
+
function fl(e, t, l, n = null) {
|
|
80
|
+
const o = `${e.apiPath}/${t.replace(/^\/+|\/+$/g, "")}`;
|
|
81
|
+
return e.http.post(`${o}/reorder`, n === null ? { ids: l } : { ids: l, category: n }).then(() => {
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
const
|
|
84
|
+
const vl = { class: "wx-categories-field" }, pl = { class: "wx-categories-field__name" }, hl = /* @__PURE__ */ M({
|
|
85
85
|
name: "WxCategoriesField",
|
|
86
86
|
__name: "CategoriesField",
|
|
87
|
-
props: /* @__PURE__ */
|
|
87
|
+
props: /* @__PURE__ */ ne({
|
|
88
88
|
source: {},
|
|
89
89
|
main: { type: Boolean, default: !0 },
|
|
90
90
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -99,12 +99,12 @@ const ca = { class: "wx-categories-field" }, ma = { class: "wx-categories-field_
|
|
|
99
99
|
}),
|
|
100
100
|
emits: ["update:modelValue"],
|
|
101
101
|
setup(e) {
|
|
102
|
-
const t = e,
|
|
103
|
-
|
|
102
|
+
const t = e, l = re(e, "modelValue"), n = J(), o = D("webx-admin"), i = L([]);
|
|
103
|
+
te(
|
|
104
104
|
() => t.source,
|
|
105
|
-
async (
|
|
105
|
+
async (v) => {
|
|
106
106
|
try {
|
|
107
|
-
const c = await
|
|
107
|
+
const c = await ve(n, v).list();
|
|
108
108
|
i.value = c.data.map((x) => ({ id: x.id, name: x.name }));
|
|
109
109
|
} catch {
|
|
110
110
|
i.value = [];
|
|
@@ -112,22 +112,22 @@ const ca = { class: "wx-categories-field" }, ma = { class: "wx-categories-field_
|
|
|
112
112
|
},
|
|
113
113
|
{ immediate: !0 }
|
|
114
114
|
);
|
|
115
|
-
const
|
|
116
|
-
get: () =>
|
|
117
|
-
set: (
|
|
118
|
-
|
|
115
|
+
const s = g(() => Array.isArray(l.value) ? l.value : []), r = g(() => new Map(i.value.map((v) => [v.id, v.name]))), u = g({
|
|
116
|
+
get: () => s.value.map((v) => ({ id: v, name: r.value.get(v) ?? `#${v}` })),
|
|
117
|
+
set: (v) => {
|
|
118
|
+
l.value = v.map((c) => c.id);
|
|
119
119
|
}
|
|
120
|
-
}), d =
|
|
121
|
-
() => i.value.filter((
|
|
120
|
+
}), d = g(
|
|
121
|
+
() => i.value.filter((v) => !s.value.includes(v.id)).map((v) => ({ label: v.name, value: v.id }))
|
|
122
122
|
);
|
|
123
|
-
function h(
|
|
124
|
-
typeof
|
|
123
|
+
function h(v) {
|
|
124
|
+
typeof v != "number" || s.value.includes(v) || (l.value = [...s.value, v]);
|
|
125
125
|
}
|
|
126
|
-
function
|
|
127
|
-
|
|
126
|
+
function f(v) {
|
|
127
|
+
l.value = s.value.filter((c) => c !== v);
|
|
128
128
|
}
|
|
129
|
-
return (
|
|
130
|
-
|
|
129
|
+
return (v, c) => (m(), $("div", vl, [
|
|
130
|
+
w(a(Be), {
|
|
131
131
|
modelValue: u.value,
|
|
132
132
|
"onUpdate:modelValue": c[0] || (c[0] = (x) => u.value = x),
|
|
133
133
|
plain: "",
|
|
@@ -135,79 +135,387 @@ const ca = { class: "wx-categories-field" }, ma = { class: "wx-categories-field_
|
|
|
135
135
|
"item-key": "id",
|
|
136
136
|
"item-label": "name",
|
|
137
137
|
disabled: t.disabled,
|
|
138
|
-
"empty-text": t.emptyText ??
|
|
138
|
+
"empty-text": t.emptyText ?? a(o)("categories.field-empty")
|
|
139
139
|
}, {
|
|
140
140
|
default: y(({ item: x, index: p }) => [
|
|
141
|
-
B("span",
|
|
142
|
-
t.main && p === 0 ? (
|
|
141
|
+
B("span", pl, A(x.name), 1),
|
|
142
|
+
t.main && p === 0 ? (m(), S(a($e), {
|
|
143
143
|
key: 0,
|
|
144
144
|
type: "primary"
|
|
145
145
|
}, {
|
|
146
146
|
default: y(() => [
|
|
147
|
-
|
|
147
|
+
z(A(t.mainText ?? a(o)("categories.field-main")), 1)
|
|
148
148
|
]),
|
|
149
149
|
_: 1
|
|
150
150
|
})) : N("", !0)
|
|
151
151
|
]),
|
|
152
152
|
actions: y(({ item: x }) => [
|
|
153
|
-
|
|
153
|
+
w(a(ue), {
|
|
154
154
|
type: "remove",
|
|
155
155
|
size: "sm",
|
|
156
156
|
disabled: t.disabled,
|
|
157
|
-
title: t.removeText ??
|
|
158
|
-
onClick: (p) =>
|
|
157
|
+
title: t.removeText ?? a(o)("categories.field-remove"),
|
|
158
|
+
onClick: (p) => f(x.id)
|
|
159
159
|
}, null, 8, ["disabled", "title", "onClick"])
|
|
160
160
|
]),
|
|
161
161
|
_: 1
|
|
162
162
|
}, 8, ["modelValue", "disabled", "empty-text"]),
|
|
163
|
-
|
|
163
|
+
w(a(we), {
|
|
164
164
|
"model-value": null,
|
|
165
165
|
options: d.value,
|
|
166
|
-
placeholder: t.addText ??
|
|
166
|
+
placeholder: t.addText ?? a(o)("categories.field-add"),
|
|
167
167
|
disabled: t.disabled || d.value.length === 0,
|
|
168
|
-
"empty-text": t.noneLeftText ??
|
|
168
|
+
"empty-text": t.noneLeftText ?? a(o)("categories.field-none-left"),
|
|
169
169
|
filterable: "",
|
|
170
170
|
teleport: "",
|
|
171
|
-
"aria-label": t.addText ??
|
|
171
|
+
"aria-label": t.addText ?? a(o)("categories.field-add"),
|
|
172
172
|
"onUpdate:modelValue": h
|
|
173
173
|
}, null, 8, ["options", "placeholder", "disabled", "empty-text", "aria-label"])
|
|
174
174
|
]));
|
|
175
175
|
}
|
|
176
|
-
}),
|
|
177
|
-
const
|
|
178
|
-
for (const [
|
|
179
|
-
|
|
180
|
-
return
|
|
181
|
-
},
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
176
|
+
}), G = (e, t) => {
|
|
177
|
+
const l = e.__vccOpts || e;
|
|
178
|
+
for (const [n, o] of t)
|
|
179
|
+
l[n] = o;
|
|
180
|
+
return l;
|
|
181
|
+
}, gl = /* @__PURE__ */ G(hl, [["__scopeId", "data-v-640cd836"]]);
|
|
182
|
+
class fe extends Error {
|
|
183
|
+
constructor(t, l, n = {}, o = null, i = null) {
|
|
184
|
+
super(t), this.status = l, this.errors = n, this.retryAfter = o, this.body = i, this.name = "HttpError";
|
|
185
|
+
}
|
|
186
|
+
status;
|
|
187
|
+
errors;
|
|
188
|
+
retryAfter;
|
|
189
|
+
body;
|
|
190
|
+
/** A failed form rather than a failed request. */
|
|
191
|
+
get isValidation() {
|
|
192
|
+
return this.status === 422;
|
|
193
|
+
}
|
|
194
|
+
get isUnauthenticated() {
|
|
195
|
+
return this.status === 401;
|
|
196
|
+
}
|
|
197
|
+
get isThrottled() {
|
|
198
|
+
return this.status === 429;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
const yl = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]);
|
|
202
|
+
function bl(e = {}) {
|
|
203
|
+
const t = (e.baseUrl ?? "").replace(/\/$/, ""), l = e.csrfUrl ?? "/api/cms/auth/csrf-cookie", n = e.fetch ?? globalThis.fetch.bind(globalThis), o = e.onUnauthenticated, i = e.headers;
|
|
204
|
+
let s = !1;
|
|
205
|
+
async function r(d = !1) {
|
|
206
|
+
s && !d && qe("XSRF-TOKEN") !== null || (await n(l, { credentials: "same-origin" }), s = !0);
|
|
207
|
+
}
|
|
208
|
+
async function u(d, h, f, v = {}, c = !1) {
|
|
209
|
+
const x = yl.has(d);
|
|
210
|
+
x && await r();
|
|
211
|
+
const p = {
|
|
212
|
+
Accept: "application/json",
|
|
213
|
+
"X-Requested-With": "XMLHttpRequest",
|
|
214
|
+
// Standing headers first, so a caller can still override one for a single request.
|
|
215
|
+
...i?.(),
|
|
216
|
+
...v.headers
|
|
217
|
+
};
|
|
218
|
+
if (x) {
|
|
219
|
+
const T = qe("XSRF-TOKEN");
|
|
220
|
+
T !== null && (p["X-XSRF-TOKEN"] = T);
|
|
221
|
+
}
|
|
222
|
+
f !== void 0 && (p["Content-Type"] = "application/json");
|
|
223
|
+
const b = await n(xl(t, h, v.query), {
|
|
224
|
+
method: d,
|
|
225
|
+
credentials: "same-origin",
|
|
226
|
+
headers: p,
|
|
227
|
+
signal: v.signal,
|
|
228
|
+
body: f === void 0 ? void 0 : JSON.stringify(f)
|
|
229
|
+
});
|
|
230
|
+
if (b.status === 419 && x && !c)
|
|
231
|
+
return await r(!0), u(d, h, f, v, !0);
|
|
232
|
+
if (b.status === 401 && o?.(), !b.ok)
|
|
233
|
+
throw await wl(b);
|
|
234
|
+
if (b.status !== 204)
|
|
235
|
+
return await b.json();
|
|
236
|
+
}
|
|
237
|
+
return {
|
|
238
|
+
get: (d, h) => u("GET", d, void 0, h),
|
|
239
|
+
post: (d, h, f) => u("POST", d, h, f),
|
|
240
|
+
put: (d, h, f) => u("PUT", d, h, f),
|
|
241
|
+
patch: (d, h, f) => u("PATCH", d, h, f),
|
|
242
|
+
delete: (d, h) => u("DELETE", d, void 0, h)
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
async function wl(e) {
|
|
246
|
+
let t = null;
|
|
247
|
+
try {
|
|
248
|
+
t = await e.json();
|
|
249
|
+
} catch {
|
|
250
|
+
}
|
|
251
|
+
const l = t ?? {}, n = typeof l.message == "string" && l.message !== "" ? l.message : e.statusText || `Request failed with ${e.status}`, o = l.errors !== null && typeof l.errors == "object" ? l.errors : {}, i = e.headers.get("Retry-After"), s = i === null ? null : Number.parseInt(i, 10);
|
|
252
|
+
return new fe(
|
|
253
|
+
n,
|
|
254
|
+
e.status,
|
|
255
|
+
o,
|
|
256
|
+
Number.isFinite(s) ? s : null,
|
|
257
|
+
t
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
function xl(e, t, l) {
|
|
261
|
+
const o = /^https?:\/\//i.test(t) ? t : `${e}/${t.replace(/^\//, "")}`;
|
|
262
|
+
if (l === void 0)
|
|
263
|
+
return o;
|
|
264
|
+
const i = new URLSearchParams();
|
|
265
|
+
for (const [r, u] of Object.entries(l))
|
|
266
|
+
u != null && i.set(r, String(u));
|
|
267
|
+
const s = i.toString();
|
|
268
|
+
return s === "" ? o : `${o}${o.includes("?") ? "&" : "?"}${s}`;
|
|
269
|
+
}
|
|
270
|
+
function qe(e) {
|
|
271
|
+
if (typeof document > "u")
|
|
272
|
+
return null;
|
|
273
|
+
for (const t of document.cookie.split(";")) {
|
|
274
|
+
const [l, ...n] = t.trim().split("=");
|
|
275
|
+
if (l === e)
|
|
276
|
+
return decodeURIComponent(n.join("="));
|
|
277
|
+
}
|
|
278
|
+
return null;
|
|
279
|
+
}
|
|
280
|
+
function kl(e, t) {
|
|
281
|
+
const l = `${e.apiPath}/relations/${encodeURIComponent(t)}`;
|
|
282
|
+
return {
|
|
283
|
+
search: (n) => e.http.get(l, { query: { q: n } }).then((o) => o.data),
|
|
284
|
+
named: (n) => n.length === 0 ? Promise.resolve([]) : e.http.get(`${l}?${n.map((o) => `ids[]=${o}`).join("&")}`).then((o) => o.data)
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
function _l(e) {
|
|
288
|
+
return Array.isArray(e) ? [...new Set(e.map(Number).filter((t) => Number.isInteger(t) && t > 0))] : [];
|
|
289
|
+
}
|
|
290
|
+
const ct = /* @__PURE__ */ Symbol("wx-relation-owner");
|
|
291
|
+
function zn(e) {
|
|
292
|
+
ze(ct, e);
|
|
293
|
+
}
|
|
294
|
+
function $l() {
|
|
295
|
+
return se(ct, null);
|
|
296
|
+
}
|
|
297
|
+
const Tl = ["src"], Sl = { class: "wx-relations-field__text" }, Cl = { class: "wx-relations-field__title" }, Wl = {
|
|
298
|
+
key: 0,
|
|
299
|
+
class: "wx-relations-field__subtitle"
|
|
300
|
+
}, Al = {
|
|
301
|
+
key: 0,
|
|
302
|
+
class: "wx-relations-field__note"
|
|
303
|
+
}, Vl = {
|
|
304
|
+
key: 1,
|
|
305
|
+
class: "wx-relations-field__add"
|
|
306
|
+
}, Ll = /* @__PURE__ */ M({
|
|
307
|
+
name: "WxRelationsField",
|
|
308
|
+
__name: "RelationsField",
|
|
309
|
+
props: /* @__PURE__ */ ne({
|
|
310
|
+
target: {},
|
|
311
|
+
max: { default: null },
|
|
312
|
+
sortable: { type: Boolean, default: !0 },
|
|
313
|
+
disabled: { type: Boolean, default: !1 },
|
|
314
|
+
addText: { default: void 0 },
|
|
315
|
+
emptyText: { default: void 0 }
|
|
316
|
+
}, {
|
|
317
|
+
modelValue: { default: () => [] },
|
|
318
|
+
modelModifiers: {}
|
|
319
|
+
}),
|
|
320
|
+
emits: ["update:modelValue"],
|
|
321
|
+
setup(e) {
|
|
322
|
+
const t = e, l = re(e, "modelValue"), n = J(), o = $l(), i = D("webx-admin"), s = g(() => kl(n, t.target)), r = L(/* @__PURE__ */ new Map()), u = L(/* @__PURE__ */ new Set()), d = L(!1), h = L([]), f = L(!1), v = L(""), c = g(() => _l(l.value));
|
|
323
|
+
function x(R) {
|
|
324
|
+
const U = new Map(r.value);
|
|
325
|
+
for (const I of R) U.set(I.id, I);
|
|
326
|
+
r.value = U;
|
|
327
|
+
}
|
|
328
|
+
async function p(R) {
|
|
329
|
+
const U = R.filter((I) => !r.value.has(I) && !u.value.has(I));
|
|
330
|
+
if (!(U.length === 0 || d.value))
|
|
331
|
+
try {
|
|
332
|
+
const I = await s.value.named(U);
|
|
333
|
+
x(I);
|
|
334
|
+
const de = new Set(I.map((ie) => ie.id));
|
|
335
|
+
u.value = /* @__PURE__ */ new Set([...u.value, ...U.filter((ie) => !de.has(ie))]);
|
|
336
|
+
} catch (I) {
|
|
337
|
+
I instanceof fe && I.status === 403 && (d.value = !0);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
te(
|
|
341
|
+
() => t.target,
|
|
342
|
+
() => {
|
|
343
|
+
r.value = /* @__PURE__ */ new Map(), u.value = /* @__PURE__ */ new Set(), d.value = !1, h.value = [], p(c.value);
|
|
344
|
+
}
|
|
345
|
+
), te(c, (R) => {
|
|
346
|
+
p(R);
|
|
347
|
+
}, { immediate: !0 });
|
|
348
|
+
const b = g({
|
|
349
|
+
get: () => c.value.map((R) => {
|
|
350
|
+
const U = r.value.get(R) ?? null;
|
|
351
|
+
return { id: R, title: U?.title || `#${R}`, candidate: U };
|
|
352
|
+
}),
|
|
353
|
+
set: (R) => {
|
|
354
|
+
l.value = R.map((U) => U.id);
|
|
355
|
+
}
|
|
356
|
+
}), T = g(() => t.max !== null && c.value.length >= t.max), F = g(() => o !== null && o.type === t.target ? o.id.value : null), Q = g(
|
|
357
|
+
() => h.value.filter((R) => R.id !== F.value && !c.value.includes(R.id)).map((R) => ({
|
|
358
|
+
value: R.title,
|
|
359
|
+
description: [R.subtitle, R.visible ? null : i("relations.field-hidden")].filter((U) => typeof U == "string" && U !== "").join(" · "),
|
|
360
|
+
id: R.id
|
|
361
|
+
}))
|
|
362
|
+
);
|
|
363
|
+
async function H(R) {
|
|
364
|
+
f.value = !0;
|
|
365
|
+
try {
|
|
366
|
+
const U = await s.value.search(R);
|
|
367
|
+
h.value = U, x(U);
|
|
368
|
+
} catch (U) {
|
|
369
|
+
h.value = [], U instanceof fe && U.status === 403 && (d.value = !0);
|
|
370
|
+
} finally {
|
|
371
|
+
f.value = !1;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
function V(R) {
|
|
375
|
+
const U = Number(R.id);
|
|
376
|
+
!Number.isInteger(U) || c.value.includes(U) || T.value || (l.value = [...c.value, U], Ie(() => {
|
|
377
|
+
v.value = "";
|
|
378
|
+
}));
|
|
379
|
+
}
|
|
380
|
+
function k(R) {
|
|
381
|
+
l.value = c.value.filter((U) => U !== R);
|
|
382
|
+
}
|
|
383
|
+
const C = g(() => t.disabled || d.value), _ = g(
|
|
384
|
+
() => T.value ? i("relations.field-full", { max: String(t.max) }) : t.addText ?? i("relations.field-add")
|
|
385
|
+
);
|
|
386
|
+
function q(R) {
|
|
387
|
+
return R.candidate === null ? u.value.has(R.id) ? i("relations.field-missing") : null : R.candidate.trashed === !0 ? i("relations.field-trashed") : R.candidate.visible ? null : i("relations.field-hidden");
|
|
388
|
+
}
|
|
389
|
+
return (R, U) => (m(), $("div", {
|
|
390
|
+
class: oe(["wx-relations-field", { "is-unordered": !t.sortable }])
|
|
391
|
+
}, [
|
|
392
|
+
w(a(Be), {
|
|
393
|
+
modelValue: b.value,
|
|
394
|
+
"onUpdate:modelValue": U[0] || (U[0] = (I) => b.value = I),
|
|
395
|
+
plain: "",
|
|
396
|
+
size: "sm",
|
|
397
|
+
"item-key": "id",
|
|
398
|
+
"item-label": "title",
|
|
399
|
+
disabled: C.value || !t.sortable,
|
|
400
|
+
"empty-text": t.emptyText ?? a(i)("relations.field-empty"),
|
|
401
|
+
"drag-label": a(i)("relations.field-drag")
|
|
402
|
+
}, ke({
|
|
403
|
+
default: y(({ item: I }) => [
|
|
404
|
+
I.candidate?.thumb ? (m(), $("img", {
|
|
405
|
+
key: 0,
|
|
406
|
+
class: "wx-relations-field__thumb",
|
|
407
|
+
src: I.candidate.thumb,
|
|
408
|
+
alt: ""
|
|
409
|
+
}, null, 8, Tl)) : N("", !0),
|
|
410
|
+
B("span", Sl, [
|
|
411
|
+
B("span", Cl, A(I.title), 1),
|
|
412
|
+
I.candidate?.subtitle ? (m(), $("span", Wl, A(I.candidate.subtitle), 1)) : N("", !0)
|
|
413
|
+
]),
|
|
414
|
+
q(I) ? (m(), S(a($e), {
|
|
415
|
+
key: 1,
|
|
416
|
+
type: "warning"
|
|
417
|
+
}, {
|
|
418
|
+
default: y(() => [
|
|
419
|
+
z(A(q(I)), 1)
|
|
420
|
+
]),
|
|
421
|
+
_: 2
|
|
422
|
+
}, 1024)) : N("", !0)
|
|
423
|
+
]),
|
|
424
|
+
_: 2
|
|
425
|
+
}, [
|
|
426
|
+
C.value ? void 0 : {
|
|
427
|
+
name: "actions",
|
|
428
|
+
fn: y(({ item: I }) => [
|
|
429
|
+
w(a(ue), {
|
|
430
|
+
type: "remove",
|
|
431
|
+
size: "sm",
|
|
432
|
+
title: a(i)("relations.field-remove"),
|
|
433
|
+
onClick: (de) => k(I.id)
|
|
434
|
+
}, null, 8, ["title", "onClick"])
|
|
435
|
+
]),
|
|
436
|
+
key: "0"
|
|
437
|
+
}
|
|
438
|
+
]), 1032, ["modelValue", "disabled", "empty-text", "drag-label"]),
|
|
439
|
+
d.value ? (m(), $("p", Al, A(a(i)("relations.field-forbidden")), 1)) : (m(), $("div", Vl, [
|
|
440
|
+
w(a(Ne), {
|
|
441
|
+
modelValue: v.value,
|
|
442
|
+
"onUpdate:modelValue": U[1] || (U[1] = (I) => v.value = I),
|
|
443
|
+
options: Q.value,
|
|
444
|
+
remote: "",
|
|
445
|
+
teleport: "",
|
|
446
|
+
loading: f.value,
|
|
447
|
+
"loading-text": a(i)("relations.field-searching"),
|
|
448
|
+
"empty-text": a(i)("relations.field-nothing"),
|
|
449
|
+
placeholder: _.value,
|
|
450
|
+
"aria-label": _.value,
|
|
451
|
+
disabled: t.disabled || T.value,
|
|
452
|
+
onSearch: H,
|
|
453
|
+
onSelect: V
|
|
454
|
+
}, null, 8, ["modelValue", "options", "loading", "loading-text", "empty-text", "placeholder", "aria-label", "disabled"])
|
|
455
|
+
]))
|
|
456
|
+
], 2));
|
|
457
|
+
}
|
|
458
|
+
}), mt = /* @__PURE__ */ G(Ll, [["__scopeId", "data-v-5ecf0e47"]]), ft = 100, Ve = /* @__PURE__ */ new WeakMap();
|
|
459
|
+
function Nl(e) {
|
|
460
|
+
let t = Ve.get(e);
|
|
461
|
+
return t === void 0 && (t = e.http.get(`${e.apiPath}/collections`).then((l) => l.data.map((n) => ({ ...n, relations: Rl(n) }))), t.catch(() => Ve.delete(e)), Ve.set(e, t)), t;
|
|
185
462
|
}
|
|
186
|
-
function
|
|
187
|
-
|
|
463
|
+
function Rl(e) {
|
|
464
|
+
return Array.isArray(e.relations) ? e.relations.flatMap((t) => {
|
|
465
|
+
if (typeof t == "string") return t === "" ? [] : [{ key: t, title: t }];
|
|
466
|
+
if (typeof t == "object" && t !== null && typeof t.key == "string") {
|
|
467
|
+
const { key: l, title: n } = t;
|
|
468
|
+
return [{ key: l, title: typeof n == "string" && n !== "" ? n : l }];
|
|
469
|
+
}
|
|
470
|
+
return [];
|
|
471
|
+
}) : [];
|
|
472
|
+
}
|
|
473
|
+
function vt(e) {
|
|
474
|
+
return Array.isArray(e) ? [...new Set(e.map(Number).filter((t) => Number.isInteger(t) && t > 0))].sort(
|
|
475
|
+
(t, l) => t - l
|
|
476
|
+
) : [];
|
|
477
|
+
}
|
|
478
|
+
function Ul(e) {
|
|
479
|
+
if (typeof e != "object" || e === null || Array.isArray(e)) return null;
|
|
480
|
+
const {
|
|
481
|
+
type: t,
|
|
482
|
+
ids: l,
|
|
483
|
+
current: n
|
|
484
|
+
} = e;
|
|
485
|
+
if (n === !0 && typeof t == "string" && t !== "")
|
|
486
|
+
return { type: t, ids: [], current: !0 };
|
|
487
|
+
const o = vt(l);
|
|
488
|
+
return typeof t == "string" && t !== "" && o.length > 0 ? { type: t, ids: o } : null;
|
|
489
|
+
}
|
|
490
|
+
function Ye(e) {
|
|
491
|
+
const t = typeof e == "object" && e !== null && !Array.isArray(e) ? e : {}, l = typeof t.limit == "number" && Number.isInteger(t.limit) ? t.limit : null;
|
|
188
492
|
return {
|
|
189
|
-
categories:
|
|
190
|
-
|
|
493
|
+
categories: vt(t.categories),
|
|
494
|
+
related: Ul(t.related),
|
|
495
|
+
limit: l !== null && l >= 1 ? Math.min(l, ft) : null,
|
|
191
496
|
filter: t.filter === !0,
|
|
192
497
|
markup: typeof t.markup == "boolean" ? t.markup : null
|
|
193
498
|
};
|
|
194
499
|
}
|
|
195
|
-
function
|
|
196
|
-
return e.categories.length === 0;
|
|
500
|
+
function Xe(e) {
|
|
501
|
+
return e.categories.length === 0 && e.related === null;
|
|
197
502
|
}
|
|
198
|
-
const
|
|
503
|
+
const zl = ["aria-busy"], Il = {
|
|
199
504
|
key: 0,
|
|
200
505
|
class: "wx-collection-field__note"
|
|
201
|
-
},
|
|
506
|
+
}, El = { class: "wx-collection-field__note" }, Bl = {
|
|
202
507
|
key: 0,
|
|
203
508
|
class: "wx-collection-field__row"
|
|
204
|
-
},
|
|
205
|
-
key:
|
|
509
|
+
}, Ml = ["for"], Pl = {
|
|
510
|
+
key: 1,
|
|
511
|
+
class: "wx-collection-field__row"
|
|
512
|
+
}, Fl = { class: "wx-collection-field__label" }, Dl = { class: "wx-collection-field__hint" }, Ol = { class: "wx-collection-field__row" }, Hl = ["for"], jl = { class: "wx-collection-field__limit" }, Kl = {
|
|
513
|
+
key: 3,
|
|
206
514
|
class: "wx-collection-field__markup"
|
|
207
|
-
},
|
|
515
|
+
}, ql = { class: "wx-collection-field__hint" }, Yl = /* @__PURE__ */ M({
|
|
208
516
|
name: "WxCollectionField",
|
|
209
517
|
__name: "CollectionField",
|
|
210
|
-
props: /* @__PURE__ */
|
|
518
|
+
props: /* @__PURE__ */ ne({
|
|
211
519
|
source: {},
|
|
212
520
|
disabled: { type: Boolean, default: !1 }
|
|
213
521
|
}, {
|
|
@@ -216,127 +524,178 @@ const ha = ["aria-busy"], ga = {
|
|
|
216
524
|
}),
|
|
217
525
|
emits: ["update:modelValue"],
|
|
218
526
|
setup(e) {
|
|
219
|
-
const t = e,
|
|
220
|
-
|
|
527
|
+
const t = e, l = re(e, "modelValue"), n = J(), o = D("webx-admin"), i = Tt(), s = L(void 0), r = L([]);
|
|
528
|
+
te(
|
|
221
529
|
() => t.source,
|
|
222
|
-
async (
|
|
223
|
-
|
|
530
|
+
async (k) => {
|
|
531
|
+
s.value = void 0, r.value = [];
|
|
224
532
|
try {
|
|
225
|
-
|
|
533
|
+
s.value = (await Nl(n)).find((C) => C.key === k) ?? null;
|
|
226
534
|
} catch {
|
|
227
|
-
|
|
535
|
+
s.value = null;
|
|
228
536
|
}
|
|
229
|
-
if (
|
|
537
|
+
if (s.value?.categories)
|
|
230
538
|
try {
|
|
231
|
-
const
|
|
232
|
-
r.value =
|
|
539
|
+
const C = await ve(n, s.value.categories).list();
|
|
540
|
+
r.value = C.data.map((_) => ({ label: _.name, value: _.id }));
|
|
233
541
|
} catch {
|
|
234
542
|
r.value = [];
|
|
235
543
|
}
|
|
236
544
|
},
|
|
237
545
|
{ immediate: !0 }
|
|
238
546
|
);
|
|
239
|
-
const u =
|
|
240
|
-
function d(
|
|
241
|
-
|
|
547
|
+
const u = g(() => Ye(l.value));
|
|
548
|
+
function d(k) {
|
|
549
|
+
l.value = Ye({ ...u.value, ...k });
|
|
550
|
+
}
|
|
551
|
+
const h = g(() => {
|
|
552
|
+
const k = new Set(r.value.map((_) => _.value)), C = u.value.categories.filter((_) => !k.has(_)).map((_) => ({ label: `#${_}`, value: _ }));
|
|
553
|
+
return [...r.value, ...C];
|
|
554
|
+
});
|
|
555
|
+
function f(k) {
|
|
556
|
+
d({ categories: Array.isArray(k) ? k.map(Number) : [] });
|
|
242
557
|
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
558
|
+
function v(k) {
|
|
559
|
+
d({ limit: k ?? null });
|
|
560
|
+
}
|
|
561
|
+
const c = L(null), x = g(
|
|
562
|
+
() => (s.value?.relations ?? []).map((k) => ({ label: k.title, value: k.key }))
|
|
563
|
+
), p = g(() => {
|
|
564
|
+
const k = s.value?.relations ?? [];
|
|
565
|
+
if (k.length === 1) return k[0];
|
|
566
|
+
const C = u.value.related?.type ?? c.value;
|
|
567
|
+
return k.find((_) => _.key === C) ?? null;
|
|
246
568
|
});
|
|
247
|
-
function
|
|
248
|
-
|
|
569
|
+
function b(k) {
|
|
570
|
+
c.value = typeof k == "string" ? k : null, d({ related: null });
|
|
571
|
+
}
|
|
572
|
+
function T(k) {
|
|
573
|
+
const C = p.value?.key;
|
|
574
|
+
d({ related: C && k && k.length > 0 ? { type: C, ids: k } : null });
|
|
249
575
|
}
|
|
250
|
-
function
|
|
251
|
-
|
|
576
|
+
function F(k) {
|
|
577
|
+
const C = p.value?.key;
|
|
578
|
+
d({ related: k && C ? { type: C, ids: [], current: !0 } : null });
|
|
252
579
|
}
|
|
253
|
-
const
|
|
254
|
-
function
|
|
255
|
-
d({ markup:
|
|
580
|
+
const Q = g(() => u.value.markup ?? Xe(u.value));
|
|
581
|
+
function H(k) {
|
|
582
|
+
d({ markup: k === !0 });
|
|
256
583
|
}
|
|
257
|
-
const
|
|
258
|
-
() =>
|
|
259
|
-
|
|
584
|
+
const V = g(
|
|
585
|
+
() => o(
|
|
586
|
+
Xe(u.value) ? "collections.field-markup-auto-on" : "collections.field-markup-auto-off"
|
|
260
587
|
)
|
|
261
588
|
);
|
|
262
|
-
return (
|
|
589
|
+
return (k, C) => (m(), $("div", {
|
|
263
590
|
class: "wx-collection-field",
|
|
264
|
-
"aria-busy":
|
|
591
|
+
"aria-busy": s.value === void 0
|
|
265
592
|
}, [
|
|
266
|
-
|
|
267
|
-
B("p",
|
|
268
|
-
|
|
593
|
+
s.value === null ? (m(), $("p", Il, A(a(o)("collections.field-unavailable", { source: t.source })), 1)) : s.value ? (m(), $(j, { key: 1 }, [
|
|
594
|
+
B("p", El, A(a(o)("collections.field-source", { source: s.value.title })), 1),
|
|
595
|
+
s.value.categories ? (m(), $("div", Bl, [
|
|
269
596
|
B("label", {
|
|
270
597
|
class: "wx-collection-field__label",
|
|
271
|
-
for: `${
|
|
272
|
-
},
|
|
273
|
-
|
|
274
|
-
id: `${
|
|
598
|
+
for: `${a(i)}-categories`
|
|
599
|
+
}, A(a(o)("collections.field-categories")), 9, Ml),
|
|
600
|
+
w(a(we), {
|
|
601
|
+
id: `${a(i)}-categories`,
|
|
275
602
|
"model-value": u.value.categories,
|
|
276
603
|
options: h.value,
|
|
277
|
-
placeholder: u.value.categories.length === 0 ?
|
|
278
|
-
"empty-text":
|
|
604
|
+
placeholder: u.value.categories.length === 0 ? a(o)("collections.field-all") : "",
|
|
605
|
+
"empty-text": a(o)("collections.field-no-categories"),
|
|
279
606
|
disabled: t.disabled,
|
|
280
607
|
multiple: "",
|
|
281
608
|
filterable: "",
|
|
282
609
|
clearable: "",
|
|
283
610
|
teleport: "",
|
|
284
|
-
"onUpdate:modelValue":
|
|
611
|
+
"onUpdate:modelValue": f
|
|
285
612
|
}, null, 8, ["id", "model-value", "options", "placeholder", "empty-text", "disabled"])
|
|
286
613
|
])) : N("", !0),
|
|
287
|
-
|
|
614
|
+
s.value.relations.length > 0 ? (m(), $("div", Pl, [
|
|
615
|
+
B("span", Fl, A(s.value.relations.length === 1 ? a(o)("relations.collection-related-to", { target: s.value.relations[0].title }) : a(o)("relations.collection-related")), 1),
|
|
616
|
+
s.value.relations.length > 1 ? (m(), S(a(we), {
|
|
617
|
+
key: 0,
|
|
618
|
+
"model-value": p.value?.key ?? null,
|
|
619
|
+
options: x.value,
|
|
620
|
+
placeholder: a(o)("relations.collection-related-type"),
|
|
621
|
+
"aria-label": a(o)("relations.collection-related-type"),
|
|
622
|
+
disabled: t.disabled,
|
|
623
|
+
clearable: "",
|
|
624
|
+
teleport: "",
|
|
625
|
+
"onUpdate:modelValue": b
|
|
626
|
+
}, null, 8, ["model-value", "options", "placeholder", "aria-label", "disabled"])) : N("", !0),
|
|
627
|
+
p.value ? (m(), $(j, { key: 1 }, [
|
|
628
|
+
w(a(Ae), {
|
|
629
|
+
"model-value": u.value.related?.current === !0,
|
|
630
|
+
label: a(o)("relations.collection-related-current"),
|
|
631
|
+
disabled: t.disabled,
|
|
632
|
+
"onUpdate:modelValue": C[0] || (C[0] = (_) => F(_ === !0))
|
|
633
|
+
}, null, 8, ["model-value", "label", "disabled"]),
|
|
634
|
+
B("p", Dl, A(a(o)("relations.collection-related-current-hint", { target: p.value.title })), 1)
|
|
635
|
+
], 64)) : N("", !0),
|
|
636
|
+
p.value && u.value.related?.current !== !0 ? (m(), S(mt, {
|
|
637
|
+
key: 2,
|
|
638
|
+
"model-value": u.value.related?.ids ?? [],
|
|
639
|
+
target: p.value.key,
|
|
640
|
+
sortable: !1,
|
|
641
|
+
"empty-text": a(o)("relations.collection-related-any"),
|
|
642
|
+
disabled: t.disabled,
|
|
643
|
+
"onUpdate:modelValue": T
|
|
644
|
+
}, null, 8, ["model-value", "target", "empty-text", "disabled"])) : N("", !0)
|
|
645
|
+
])) : N("", !0),
|
|
646
|
+
B("div", Ol, [
|
|
288
647
|
B("label", {
|
|
289
648
|
class: "wx-collection-field__label",
|
|
290
|
-
for: `${
|
|
291
|
-
},
|
|
292
|
-
B("div",
|
|
293
|
-
|
|
294
|
-
id: `${
|
|
649
|
+
for: `${a(i)}-limit`
|
|
650
|
+
}, A(a(o)("collections.field-limit")), 9, Hl),
|
|
651
|
+
B("div", jl, [
|
|
652
|
+
w(a(It), {
|
|
653
|
+
id: `${a(i)}-limit`,
|
|
295
654
|
"model-value": u.value.limit,
|
|
296
655
|
min: 1,
|
|
297
|
-
max:
|
|
656
|
+
max: a(ft),
|
|
298
657
|
step: 1,
|
|
299
658
|
precision: 0,
|
|
300
|
-
placeholder:
|
|
659
|
+
placeholder: a(o)("collections.field-limit-all"),
|
|
301
660
|
disabled: t.disabled,
|
|
302
|
-
"onUpdate:modelValue":
|
|
661
|
+
"onUpdate:modelValue": v
|
|
303
662
|
}, null, 8, ["id", "model-value", "max", "placeholder", "disabled"])
|
|
304
663
|
])
|
|
305
664
|
]),
|
|
306
|
-
|
|
307
|
-
key:
|
|
665
|
+
s.value.categories ? (m(), S(a(Ae), {
|
|
666
|
+
key: 2,
|
|
308
667
|
"model-value": u.value.filter,
|
|
309
|
-
label:
|
|
668
|
+
label: a(o)("collections.field-filter"),
|
|
310
669
|
disabled: t.disabled,
|
|
311
|
-
"onUpdate:modelValue":
|
|
670
|
+
"onUpdate:modelValue": C[1] || (C[1] = (_) => d({ filter: _ === !0 }))
|
|
312
671
|
}, null, 8, ["model-value", "label", "disabled"])) : N("", !0),
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
"model-value":
|
|
316
|
-
label:
|
|
672
|
+
s.value.markup ? (m(), $("div", Kl, [
|
|
673
|
+
w(a(Ae), {
|
|
674
|
+
"model-value": Q.value,
|
|
675
|
+
label: a(o)("collections.field-markup"),
|
|
317
676
|
disabled: t.disabled,
|
|
318
|
-
"onUpdate:modelValue":
|
|
677
|
+
"onUpdate:modelValue": H
|
|
319
678
|
}, null, 8, ["model-value", "label", "disabled"]),
|
|
320
|
-
B("p",
|
|
321
|
-
u.value.markup !== null ? (
|
|
679
|
+
B("p", ql, A(V.value), 1),
|
|
680
|
+
u.value.markup !== null ? (m(), S(a(le), {
|
|
322
681
|
key: 0,
|
|
323
682
|
class: "wx-collection-field__reset",
|
|
324
683
|
variant: "text",
|
|
325
684
|
size: "sm",
|
|
326
685
|
disabled: t.disabled,
|
|
327
|
-
onClick:
|
|
686
|
+
onClick: C[2] || (C[2] = (_) => d({ markup: null }))
|
|
328
687
|
}, {
|
|
329
688
|
default: y(() => [
|
|
330
|
-
|
|
689
|
+
z(A(a(o)("collections.field-markup-reset")), 1)
|
|
331
690
|
]),
|
|
332
691
|
_: 1
|
|
333
692
|
}, 8, ["disabled"])) : N("", !0)
|
|
334
693
|
])) : N("", !0)
|
|
335
694
|
], 64)) : N("", !0)
|
|
336
|
-
], 8,
|
|
695
|
+
], 8, zl));
|
|
337
696
|
}
|
|
338
|
-
}),
|
|
339
|
-
function
|
|
697
|
+
}), Xl = /* @__PURE__ */ G(Yl, [["__scopeId", "data-v-023ad095"]]);
|
|
698
|
+
function Gl() {
|
|
340
699
|
return {
|
|
341
700
|
target: "entity",
|
|
342
701
|
entity_type: null,
|
|
@@ -347,31 +706,31 @@ function Wa() {
|
|
|
347
706
|
rel: []
|
|
348
707
|
};
|
|
349
708
|
}
|
|
350
|
-
function
|
|
351
|
-
const t = `${e.apiPath}/links`,
|
|
709
|
+
function Jl(e) {
|
|
710
|
+
const t = `${e.apiPath}/links`, l = (n) => n.data;
|
|
352
711
|
return {
|
|
353
|
-
sources: () => e.http.get(`${t}/sources`).then(
|
|
354
|
-
search: (
|
|
355
|
-
resolve: (
|
|
356
|
-
routes: () => e.http.get(`${t}/routes`).then(
|
|
712
|
+
sources: () => e.http.get(`${t}/sources`).then(l),
|
|
713
|
+
search: (n, o, i) => e.http.get(`${t}/search`, { query: { type: n, q: o, locale: i } }).then(l),
|
|
714
|
+
resolve: (n, o) => e.http.post(`${t}/resolve`, { links: n, locale: o }).then(l),
|
|
715
|
+
routes: () => e.http.get(`${t}/routes`).then(l)
|
|
357
716
|
};
|
|
358
717
|
}
|
|
359
|
-
const
|
|
718
|
+
const Ql = { class: "wx-link-picker" }, Zl = {
|
|
360
719
|
key: 0,
|
|
361
720
|
class: "wx-link-picker__entity"
|
|
362
|
-
},
|
|
721
|
+
}, ea = {
|
|
363
722
|
key: 1,
|
|
364
723
|
class: "wx-link-picker__url"
|
|
365
|
-
},
|
|
724
|
+
}, ta = {
|
|
366
725
|
key: 2,
|
|
367
726
|
class: "wx-link-picker__hash"
|
|
368
|
-
},
|
|
727
|
+
}, la = {
|
|
369
728
|
key: 3,
|
|
370
729
|
class: "wx-link-picker__attributes"
|
|
371
|
-
},
|
|
730
|
+
}, aa = { class: "wx-link-picker__rel" }, na = /* @__PURE__ */ M({
|
|
372
731
|
name: "WxLinkPicker",
|
|
373
732
|
__name: "LinkPicker",
|
|
374
|
-
props: /* @__PURE__ */
|
|
733
|
+
props: /* @__PURE__ */ ne({
|
|
375
734
|
allowNone: { type: Boolean, default: !0 },
|
|
376
735
|
attributes: { type: Boolean, default: !0 },
|
|
377
736
|
disabled: { type: Boolean, default: !1 }
|
|
@@ -381,195 +740,195 @@ const La = { class: "wx-link-picker" }, Va = {
|
|
|
381
740
|
}),
|
|
382
741
|
emits: ["update:modelValue"],
|
|
383
742
|
setup(e) {
|
|
384
|
-
const t = e,
|
|
743
|
+
const t = e, l = re(e, "modelValue"), n = J(), o = dl(), i = Jl(n), s = D("webx-admin"), r = L([]), u = L([]), d = L([]), h = L(!1), f = L(null), v = L(""), c = L(null);
|
|
385
744
|
let x = null;
|
|
386
|
-
const p =
|
|
387
|
-
const
|
|
388
|
-
{ value: "entity", label:
|
|
389
|
-
{ value: "url", label:
|
|
745
|
+
const p = g(() => l.value ?? Gl()), b = g(() => {
|
|
746
|
+
const W = [
|
|
747
|
+
{ value: "entity", label: s("links.target-entity") },
|
|
748
|
+
{ value: "url", label: s("links.target-url") }
|
|
390
749
|
];
|
|
391
|
-
return t.allowNone ? [
|
|
392
|
-
}),
|
|
393
|
-
() => r.value.map((
|
|
394
|
-
),
|
|
395
|
-
() => u.value.map((
|
|
396
|
-
value:
|
|
397
|
-
description:
|
|
398
|
-
id:
|
|
750
|
+
return t.allowNone ? [...W, { value: "none", label: s("links.target-none") }] : W;
|
|
751
|
+
}), T = g(
|
|
752
|
+
() => r.value.map((W) => ({ value: W.type, label: W.title }))
|
|
753
|
+
), F = g(
|
|
754
|
+
() => u.value.map((W) => ({
|
|
755
|
+
value: W.title,
|
|
756
|
+
description: E(W),
|
|
757
|
+
id: W.id
|
|
399
758
|
}))
|
|
400
|
-
),
|
|
401
|
-
() => d.value.map((
|
|
759
|
+
), Q = g(
|
|
760
|
+
() => d.value.map((W) => ({ value: W.path, description: W.name }))
|
|
402
761
|
);
|
|
403
|
-
|
|
404
|
-
r.value = await i.sources(),
|
|
405
|
-
}),
|
|
762
|
+
Ee(async () => {
|
|
763
|
+
r.value = await i.sources(), f.value = p.value.entity_type ?? r.value[0]?.type ?? null, await Promise.all([H(), V()]);
|
|
764
|
+
}), te(
|
|
406
765
|
() => [p.value.entity_type, p.value.entity_id].join(":"),
|
|
407
766
|
() => {
|
|
408
|
-
|
|
767
|
+
H();
|
|
409
768
|
}
|
|
410
769
|
);
|
|
411
|
-
async function
|
|
412
|
-
const { entity_type:
|
|
413
|
-
if (
|
|
414
|
-
c.value = null,
|
|
770
|
+
async function H() {
|
|
771
|
+
const { entity_type: W, entity_id: P } = p.value;
|
|
772
|
+
if (W === null || P === null) {
|
|
773
|
+
c.value = null, v.value = "";
|
|
415
774
|
return;
|
|
416
775
|
}
|
|
417
|
-
if (c.value?.id ===
|
|
776
|
+
if (c.value?.id === P)
|
|
418
777
|
return;
|
|
419
|
-
const [
|
|
420
|
-
c.value =
|
|
778
|
+
const [O] = await i.resolve([{ type: W, id: P }], o.state.locale);
|
|
779
|
+
c.value = O ?? null, v.value = O?.title ?? s("links.missing"), x = v.value;
|
|
421
780
|
}
|
|
422
|
-
async function
|
|
781
|
+
async function V() {
|
|
423
782
|
d.value = await i.routes();
|
|
424
783
|
}
|
|
425
|
-
async function
|
|
426
|
-
if (
|
|
784
|
+
async function k(W) {
|
|
785
|
+
if (W === x) {
|
|
427
786
|
x = null;
|
|
428
787
|
return;
|
|
429
788
|
}
|
|
430
|
-
if (x = null,
|
|
789
|
+
if (x = null, f.value !== null) {
|
|
431
790
|
h.value = !0;
|
|
432
791
|
try {
|
|
433
|
-
u.value = await i.search(
|
|
792
|
+
u.value = await i.search(f.value, W, o.state.locale);
|
|
434
793
|
} finally {
|
|
435
794
|
h.value = !1;
|
|
436
795
|
}
|
|
437
796
|
}
|
|
438
797
|
}
|
|
439
|
-
function
|
|
440
|
-
|
|
798
|
+
function C(W) {
|
|
799
|
+
W !== void 0 && (l.value = { ...p.value, target: W });
|
|
441
800
|
}
|
|
442
|
-
function
|
|
443
|
-
|
|
801
|
+
function _(W) {
|
|
802
|
+
f.value = W == null ? null : String(W), u.value = [], k("");
|
|
444
803
|
}
|
|
445
|
-
function
|
|
446
|
-
const
|
|
447
|
-
|
|
804
|
+
function q(W) {
|
|
805
|
+
const P = u.value.find((O) => O.id === W.id);
|
|
806
|
+
P === void 0 || f.value === null || (c.value = P, v.value = P.title, l.value = { ...p.value, entity_type: f.value, entity_id: P.id });
|
|
448
807
|
}
|
|
449
|
-
function
|
|
450
|
-
c.value = null,
|
|
808
|
+
function R() {
|
|
809
|
+
c.value = null, v.value = "", u.value = [], l.value = { ...p.value, entity_type: null, entity_id: null };
|
|
451
810
|
}
|
|
452
|
-
function
|
|
453
|
-
|
|
811
|
+
function U(W) {
|
|
812
|
+
l.value = { ...p.value, url: W === "" ? null : W };
|
|
454
813
|
}
|
|
455
|
-
function
|
|
456
|
-
const
|
|
457
|
-
|
|
814
|
+
function I(W) {
|
|
815
|
+
const P = (typeof W == "string" || typeof W == "number" ? String(W) : "").replace(/^#+/, "").trim();
|
|
816
|
+
l.value = { ...p.value, hash: P === "" ? null : P };
|
|
458
817
|
}
|
|
459
|
-
function
|
|
460
|
-
|
|
818
|
+
function de(W) {
|
|
819
|
+
l.value = { ...p.value, new_tab: W };
|
|
461
820
|
}
|
|
462
|
-
function
|
|
463
|
-
const
|
|
464
|
-
|
|
821
|
+
function ie(W, P) {
|
|
822
|
+
const O = p.value.rel.filter((We) => We !== W);
|
|
823
|
+
l.value = { ...p.value, rel: P ? [...O, W] : O };
|
|
465
824
|
}
|
|
466
|
-
function
|
|
467
|
-
const
|
|
468
|
-
(
|
|
825
|
+
function E(W) {
|
|
826
|
+
const P = [W.hint, W.url ?? void 0].filter(
|
|
827
|
+
(O) => typeof O == "string" && O !== ""
|
|
469
828
|
);
|
|
470
|
-
return
|
|
829
|
+
return W.available || P.push(s("links.unavailable")), P.join(" · ");
|
|
471
830
|
}
|
|
472
|
-
const
|
|
473
|
-
return (
|
|
474
|
-
|
|
475
|
-
options:
|
|
831
|
+
const Z = ["nofollow", "sponsored", "ugc"];
|
|
832
|
+
return (W, P) => (m(), $("div", Ql, [
|
|
833
|
+
w(a(Et), {
|
|
834
|
+
options: b.value,
|
|
476
835
|
"model-value": p.value.target,
|
|
477
836
|
disabled: t.disabled,
|
|
478
|
-
"aria-label":
|
|
479
|
-
"onUpdate:modelValue":
|
|
837
|
+
"aria-label": a(s)("links.target-entity"),
|
|
838
|
+
"onUpdate:modelValue": C
|
|
480
839
|
}, null, 8, ["options", "model-value", "disabled", "aria-label"]),
|
|
481
|
-
p.value.target === "entity" ? (
|
|
482
|
-
|
|
840
|
+
p.value.target === "entity" ? (m(), $("div", Zl, [
|
|
841
|
+
T.value.length > 1 ? (m(), S(a(we), {
|
|
483
842
|
key: 0,
|
|
484
843
|
class: "wx-link-picker__section",
|
|
485
|
-
options:
|
|
486
|
-
"model-value":
|
|
844
|
+
options: T.value,
|
|
845
|
+
"model-value": f.value,
|
|
487
846
|
disabled: t.disabled,
|
|
488
|
-
"aria-label":
|
|
489
|
-
"onUpdate:modelValue":
|
|
847
|
+
"aria-label": a(s)("links.section"),
|
|
848
|
+
"onUpdate:modelValue": _
|
|
490
849
|
}, null, 8, ["options", "model-value", "disabled", "aria-label"])) : N("", !0),
|
|
491
|
-
|
|
850
|
+
w(a(Ne), {
|
|
492
851
|
class: "wx-link-picker__search",
|
|
493
|
-
"model-value":
|
|
494
|
-
options:
|
|
852
|
+
"model-value": v.value,
|
|
853
|
+
options: F.value,
|
|
495
854
|
remote: "",
|
|
496
855
|
clearable: "",
|
|
497
856
|
loading: h.value,
|
|
498
|
-
"loading-text":
|
|
499
|
-
"empty-text":
|
|
500
|
-
placeholder:
|
|
501
|
-
"aria-label":
|
|
857
|
+
"loading-text": a(s)("links.searching"),
|
|
858
|
+
"empty-text": a(s)("links.empty"),
|
|
859
|
+
placeholder: a(s)("links.search"),
|
|
860
|
+
"aria-label": a(s)("links.search"),
|
|
502
861
|
disabled: t.disabled,
|
|
503
|
-
"onUpdate:modelValue":
|
|
504
|
-
onSearch:
|
|
505
|
-
onSelect:
|
|
506
|
-
onClear:
|
|
862
|
+
"onUpdate:modelValue": P[0] || (P[0] = (O) => v.value = O),
|
|
863
|
+
onSearch: k,
|
|
864
|
+
onSelect: q,
|
|
865
|
+
onClear: R
|
|
507
866
|
}, null, 8, ["model-value", "options", "loading", "loading-text", "empty-text", "placeholder", "aria-label", "disabled"])
|
|
508
|
-
])) : p.value.target === "url" ? (
|
|
509
|
-
|
|
867
|
+
])) : p.value.target === "url" ? (m(), $("div", ea, [
|
|
868
|
+
w(a(Ne), {
|
|
510
869
|
"model-value": p.value.url ?? "",
|
|
511
|
-
options:
|
|
870
|
+
options: Q.value,
|
|
512
871
|
clearable: "",
|
|
513
872
|
"open-on-focus": "",
|
|
514
|
-
"empty-text":
|
|
515
|
-
placeholder:
|
|
516
|
-
"aria-label":
|
|
873
|
+
"empty-text": a(s)("links.url-routes"),
|
|
874
|
+
placeholder: a(s)("links.url-placeholder"),
|
|
875
|
+
"aria-label": a(s)("links.url-label"),
|
|
517
876
|
disabled: t.disabled,
|
|
518
|
-
"onUpdate:modelValue":
|
|
877
|
+
"onUpdate:modelValue": U
|
|
519
878
|
}, null, 8, ["model-value", "options", "empty-text", "placeholder", "aria-label", "disabled"])
|
|
520
879
|
])) : N("", !0),
|
|
521
|
-
p.value.target !== "none" ? (
|
|
522
|
-
|
|
880
|
+
p.value.target !== "none" ? (m(), $("label", ta, [
|
|
881
|
+
w(a(ee), {
|
|
523
882
|
size: "sm",
|
|
524
883
|
tone: "muted"
|
|
525
884
|
}, {
|
|
526
885
|
default: y(() => [
|
|
527
|
-
|
|
886
|
+
z(A(a(s)("links.hash")), 1)
|
|
528
887
|
]),
|
|
529
888
|
_: 1
|
|
530
889
|
}),
|
|
531
|
-
|
|
890
|
+
P[2] || (P[2] = B("span", {
|
|
532
891
|
class: "wx-link-picker__sign",
|
|
533
892
|
"aria-hidden": "true"
|
|
534
893
|
}, "#", -1)),
|
|
535
|
-
|
|
894
|
+
w(a(Te), {
|
|
536
895
|
"model-value": p.value.hash ?? "",
|
|
537
|
-
placeholder:
|
|
538
|
-
"aria-label":
|
|
896
|
+
placeholder: a(s)("links.hash-placeholder"),
|
|
897
|
+
"aria-label": a(s)("links.hash"),
|
|
539
898
|
disabled: t.disabled,
|
|
540
899
|
clearable: "",
|
|
541
|
-
"onUpdate:modelValue":
|
|
900
|
+
"onUpdate:modelValue": I
|
|
542
901
|
}, null, 8, ["model-value", "placeholder", "aria-label", "disabled"])
|
|
543
902
|
])) : N("", !0),
|
|
544
|
-
t.attributes && p.value.target !== "none" ? (
|
|
545
|
-
|
|
903
|
+
t.attributes && p.value.target !== "none" ? (m(), $("div", la, [
|
|
904
|
+
w(a(He), {
|
|
546
905
|
"model-value": p.value.new_tab,
|
|
547
906
|
disabled: t.disabled,
|
|
548
|
-
"onUpdate:modelValue":
|
|
907
|
+
"onUpdate:modelValue": P[1] || (P[1] = (O) => de(O))
|
|
549
908
|
}, {
|
|
550
909
|
default: y(() => [
|
|
551
|
-
|
|
910
|
+
z(A(a(s)("links.new-tab")), 1)
|
|
552
911
|
]),
|
|
553
912
|
_: 1
|
|
554
913
|
}, 8, ["model-value", "disabled"]),
|
|
555
|
-
B("div",
|
|
556
|
-
|
|
914
|
+
B("div", aa, [
|
|
915
|
+
w(a(ee), {
|
|
557
916
|
size: "sm",
|
|
558
917
|
tone: "muted"
|
|
559
918
|
}, {
|
|
560
919
|
default: y(() => [
|
|
561
|
-
|
|
920
|
+
z(A(a(s)("links.rel")), 1)
|
|
562
921
|
]),
|
|
563
922
|
_: 1
|
|
564
923
|
}),
|
|
565
|
-
(
|
|
566
|
-
key:
|
|
567
|
-
"model-value": p.value.rel.includes(
|
|
924
|
+
(m(), $(j, null, ae(Z, (O) => w(a(He), {
|
|
925
|
+
key: O,
|
|
926
|
+
"model-value": p.value.rel.includes(O),
|
|
568
927
|
disabled: t.disabled,
|
|
569
|
-
"onUpdate:modelValue": (
|
|
928
|
+
"onUpdate:modelValue": (We) => ie(O, We)
|
|
570
929
|
}, {
|
|
571
930
|
default: y(() => [
|
|
572
|
-
|
|
931
|
+
z(A(a(s)(`links.rel-${O}`)), 1)
|
|
573
932
|
]),
|
|
574
933
|
_: 2
|
|
575
934
|
}, 1032, ["model-value", "disabled", "onUpdate:modelValue"])), 64))
|
|
@@ -577,11 +936,11 @@ const La = { class: "wx-link-picker" }, Va = {
|
|
|
577
936
|
])) : N("", !0)
|
|
578
937
|
]));
|
|
579
938
|
}
|
|
580
|
-
}),
|
|
939
|
+
}), oa = /* @__PURE__ */ G(na, [["__scopeId", "data-v-e54022e5"]]), sa = /* @__PURE__ */ M({
|
|
581
940
|
name: "WxLinkField",
|
|
582
941
|
inheritAttrs: !1,
|
|
583
942
|
__name: "LinkField",
|
|
584
|
-
props: /* @__PURE__ */
|
|
943
|
+
props: /* @__PURE__ */ ne({
|
|
585
944
|
allowNone: { type: Boolean, default: !0 },
|
|
586
945
|
attributes: { type: Boolean, default: !0 },
|
|
587
946
|
disabled: { type: Boolean, default: !1 }
|
|
@@ -591,17 +950,17 @@ const La = { class: "wx-link-picker" }, Va = {
|
|
|
591
950
|
}),
|
|
592
951
|
emits: ["update:modelValue"],
|
|
593
952
|
setup(e) {
|
|
594
|
-
const t = e,
|
|
595
|
-
return (
|
|
596
|
-
modelValue:
|
|
597
|
-
"onUpdate:modelValue":
|
|
598
|
-
},
|
|
953
|
+
const t = e, l = re(e, "modelValue");
|
|
954
|
+
return (n, o) => (m(), S(oa, et({
|
|
955
|
+
modelValue: l.value,
|
|
956
|
+
"onUpdate:modelValue": o[0] || (o[0] = (i) => l.value = i)
|
|
957
|
+
}, n.$attrs, {
|
|
599
958
|
"allow-none": t.allowNone,
|
|
600
959
|
attributes: t.attributes,
|
|
601
960
|
disabled: t.disabled
|
|
602
961
|
}), null, 16, ["modelValue", "allow-none", "attributes", "disabled"]));
|
|
603
962
|
}
|
|
604
|
-
}),
|
|
963
|
+
}), ia = /* @__PURE__ */ M({
|
|
605
964
|
__name: "BackButton",
|
|
606
965
|
props: {
|
|
607
966
|
to: {},
|
|
@@ -609,21 +968,21 @@ const La = { class: "wx-link-picker" }, Va = {
|
|
|
609
968
|
size: { default: "sm" }
|
|
610
969
|
},
|
|
611
970
|
setup(e) {
|
|
612
|
-
const t = e,
|
|
613
|
-
return (
|
|
971
|
+
const t = e, l = D("webx-admin"), n = g(() => t.label ?? l("editor.back"));
|
|
972
|
+
return (o, i) => (m(), S(a(ue), {
|
|
614
973
|
icon: "arrow-left",
|
|
615
974
|
class: "wx-back-button",
|
|
616
|
-
as:
|
|
975
|
+
as: a(Nt),
|
|
617
976
|
to: e.to,
|
|
618
|
-
title:
|
|
977
|
+
title: n.value,
|
|
619
978
|
size: e.size,
|
|
620
979
|
"tooltip-side": "bottom"
|
|
621
980
|
}, null, 8, ["as", "to", "title", "size"]));
|
|
622
981
|
}
|
|
623
|
-
}),
|
|
982
|
+
}), ra = {
|
|
624
983
|
key: 0,
|
|
625
984
|
class: "wx-dropdown__divider"
|
|
626
|
-
},
|
|
985
|
+
}, ua = /* @__PURE__ */ M({
|
|
627
986
|
__name: "RowMenu",
|
|
628
987
|
props: {
|
|
629
988
|
actions: {},
|
|
@@ -631,36 +990,36 @@ const La = { class: "wx-link-picker" }, Va = {
|
|
|
631
990
|
size: { default: "sm" }
|
|
632
991
|
},
|
|
633
992
|
setup(e) {
|
|
634
|
-
const t =
|
|
635
|
-
...
|
|
636
|
-
...
|
|
637
|
-
]),
|
|
638
|
-
const i =
|
|
639
|
-
return i &&
|
|
993
|
+
const t = D("webx-admin"), l = e, n = g(() => [
|
|
994
|
+
...l.actions.filter((i) => !i.danger),
|
|
995
|
+
...l.actions.filter((i) => i.danger)
|
|
996
|
+
]), o = g(() => {
|
|
997
|
+
const i = n.value.find((s) => s.danger);
|
|
998
|
+
return i && n.value[0] !== i ? i.key : null;
|
|
640
999
|
});
|
|
641
|
-
return (i,
|
|
1000
|
+
return (i, s) => n.value.length > 0 ? (m(), S(a(Bt), {
|
|
642
1001
|
key: 0,
|
|
643
1002
|
class: "wx-row-menu",
|
|
644
1003
|
collapse: "always",
|
|
645
1004
|
align: "end",
|
|
646
1005
|
size: e.size,
|
|
647
1006
|
"aria-label": e.label,
|
|
648
|
-
onClick:
|
|
1007
|
+
onClick: s[0] || (s[0] = tt(() => {
|
|
649
1008
|
}, ["stop"]))
|
|
650
1009
|
}, {
|
|
651
1010
|
trigger: y(() => [
|
|
652
|
-
|
|
1011
|
+
w(a(ue), {
|
|
653
1012
|
type: "more",
|
|
654
1013
|
size: e.size,
|
|
655
|
-
title:
|
|
1014
|
+
title: a(t)("editor.more")
|
|
656
1015
|
}, null, 8, ["size", "title"])
|
|
657
1016
|
]),
|
|
658
1017
|
collapsed: y(() => [
|
|
659
|
-
(
|
|
1018
|
+
(m(!0), $(j, null, ae(n.value, (r) => (m(), $(j, {
|
|
660
1019
|
key: r.key
|
|
661
1020
|
}, [
|
|
662
|
-
r.key ===
|
|
663
|
-
|
|
1021
|
+
r.key === o.value ? (m(), $("hr", ra)) : N("", !0),
|
|
1022
|
+
w(a(Mt), {
|
|
664
1023
|
icon: r.icon,
|
|
665
1024
|
tone: r.danger ? "danger" : "default",
|
|
666
1025
|
href: r.href,
|
|
@@ -669,7 +1028,7 @@ const La = { class: "wx-link-picker" }, Va = {
|
|
|
669
1028
|
onClick: (u) => r.run?.()
|
|
670
1029
|
}, {
|
|
671
1030
|
default: y(() => [
|
|
672
|
-
|
|
1031
|
+
z(A(r.label), 1)
|
|
673
1032
|
]),
|
|
674
1033
|
_: 2
|
|
675
1034
|
}, 1032, ["icon", "tone", "href", "target", "disabled", "onClick"])
|
|
@@ -678,13 +1037,13 @@ const La = { class: "wx-link-picker" }, Va = {
|
|
|
678
1037
|
_: 1
|
|
679
1038
|
}, 8, ["size", "aria-label"])) : N("", !0);
|
|
680
1039
|
}
|
|
681
|
-
}),
|
|
1040
|
+
}), Fe = /* @__PURE__ */ G(ua, [["__scopeId", "data-v-cab01f7f"]]), da = ["data-level"], ca = {
|
|
682
1041
|
key: 0,
|
|
683
1042
|
class: "wx-screen-head__trail"
|
|
684
|
-
},
|
|
1043
|
+
}, ma = { class: "wx-screen-head__name" }, fa = {
|
|
685
1044
|
key: 4,
|
|
686
1045
|
class: "wx-screen-head__actions"
|
|
687
|
-
},
|
|
1046
|
+
}, va = /* @__PURE__ */ M({
|
|
688
1047
|
__name: "ScreenHead",
|
|
689
1048
|
props: {
|
|
690
1049
|
title: { default: void 0 },
|
|
@@ -698,57 +1057,57 @@ const La = { class: "wx-link-picker" }, Va = {
|
|
|
698
1057
|
},
|
|
699
1058
|
emits: ["back"],
|
|
700
1059
|
setup(e, { emit: t }) {
|
|
701
|
-
const
|
|
1060
|
+
const l = e, n = t, o = D("webx-admin"), i = St(), s = lt("root"), r = Pt(s), u = g(() => r.value > 0 && r.value < l.collapseBelow), d = g(() => l.actions ?? []), h = g(
|
|
702
1061
|
() => d.value.find((p) => p.primary) ?? null
|
|
703
|
-
),
|
|
704
|
-
() =>
|
|
705
|
-
), x =
|
|
706
|
-
() =>
|
|
1062
|
+
), f = g(() => u.value ? h.value ? [h.value] : [] : d.value.filter((p) => !p.menu && !p.danger)), v = g(() => u.value ? d.value.filter((p) => p !== h.value) : d.value.filter((p) => p.menu || p.danger)), c = g(
|
|
1063
|
+
() => l.back && l.back !== !0 ? l.back : null
|
|
1064
|
+
), x = g(
|
|
1065
|
+
() => f.value.length > 0 || v.value.length > 0 || !!i.extra
|
|
707
1066
|
);
|
|
708
|
-
return (p,
|
|
1067
|
+
return (p, b) => (m(), $("div", {
|
|
709
1068
|
ref_key: "root",
|
|
710
|
-
ref:
|
|
711
|
-
class:
|
|
1069
|
+
ref: s,
|
|
1070
|
+
class: oe(["wx-screen-head", {
|
|
712
1071
|
"is-narrow": u.value,
|
|
713
|
-
"has-button":
|
|
1072
|
+
"has-button": f.value.length > 0,
|
|
714
1073
|
"has-trail": !!p.$slots.trail,
|
|
715
1074
|
"has-divider": e.divider
|
|
716
1075
|
}]),
|
|
717
1076
|
"data-level": e.level
|
|
718
1077
|
}, [
|
|
719
|
-
p.$slots.trail ? (
|
|
720
|
-
|
|
1078
|
+
p.$slots.trail ? (m(), $("div", ca, [
|
|
1079
|
+
Y(p.$slots, "trail", {}, void 0, !0)
|
|
721
1080
|
])) : N("", !0),
|
|
722
|
-
c.value ? (
|
|
1081
|
+
c.value ? (m(), S(ia, {
|
|
723
1082
|
key: 1,
|
|
724
1083
|
class: "wx-screen-head__back",
|
|
725
1084
|
to: c.value,
|
|
726
1085
|
label: e.backLabel,
|
|
727
1086
|
"tooltip-side": "bottom"
|
|
728
|
-
}, null, 8, ["to", "label"])) : e.back ? (
|
|
1087
|
+
}, null, 8, ["to", "label"])) : e.back ? (m(), S(a(ue), {
|
|
729
1088
|
key: 2,
|
|
730
1089
|
class: "wx-screen-head__back",
|
|
731
1090
|
icon: "arrow-left",
|
|
732
1091
|
size: "sm",
|
|
733
1092
|
"tooltip-side": "bottom",
|
|
734
|
-
title: e.backLabel ??
|
|
735
|
-
onClick:
|
|
1093
|
+
title: e.backLabel ?? a(o)("editor.back"),
|
|
1094
|
+
onClick: b[0] || (b[0] = (T) => n("back"))
|
|
736
1095
|
}, null, 8, ["title"])) : N("", !0),
|
|
737
|
-
B("div",
|
|
738
|
-
e.title ? (
|
|
1096
|
+
B("div", ma, [
|
|
1097
|
+
e.title ? (m(), S(a(Ft), {
|
|
739
1098
|
key: 0,
|
|
740
1099
|
level: e.level,
|
|
741
1100
|
truncate: "",
|
|
742
1101
|
class: "wx-screen-head__title"
|
|
743
1102
|
}, {
|
|
744
1103
|
default: y(() => [
|
|
745
|
-
|
|
1104
|
+
z(A(e.title), 1)
|
|
746
1105
|
]),
|
|
747
1106
|
_: 1
|
|
748
1107
|
}, 8, ["level"])) : N("", !0),
|
|
749
|
-
|
|
1108
|
+
Y(p.$slots, "title-after", {}, void 0, !0)
|
|
750
1109
|
]),
|
|
751
|
-
e.subtitle || p.$slots.subtitle ? (
|
|
1110
|
+
e.subtitle || p.$slots.subtitle ? (m(), S(a(ee), {
|
|
752
1111
|
key: 3,
|
|
753
1112
|
class: "wx-screen-head__subtitle",
|
|
754
1113
|
size: "sm",
|
|
@@ -756,53 +1115,53 @@ const La = { class: "wx-link-picker" }, Va = {
|
|
|
756
1115
|
truncate: ""
|
|
757
1116
|
}, {
|
|
758
1117
|
default: y(() => [
|
|
759
|
-
|
|
760
|
-
|
|
1118
|
+
Y(p.$slots, "subtitle", {}, () => [
|
|
1119
|
+
z(A(e.subtitle), 1)
|
|
761
1120
|
], !0)
|
|
762
1121
|
]),
|
|
763
1122
|
_: 3
|
|
764
1123
|
})) : N("", !0),
|
|
765
|
-
x.value ? (
|
|
766
|
-
|
|
767
|
-
(
|
|
768
|
-
key:
|
|
769
|
-
class:
|
|
770
|
-
type:
|
|
771
|
-
variant:
|
|
772
|
-
loading:
|
|
773
|
-
disabled:
|
|
774
|
-
href:
|
|
775
|
-
target:
|
|
776
|
-
rel:
|
|
777
|
-
onClick: (
|
|
778
|
-
},
|
|
1124
|
+
x.value ? (m(), $("div", fa, [
|
|
1125
|
+
Y(p.$slots, "extra", {}, void 0, !0),
|
|
1126
|
+
(m(!0), $(j, null, ae(f.value, (T) => (m(), S(a(le), {
|
|
1127
|
+
key: T.key,
|
|
1128
|
+
class: oe(["wx-screen-head__button", { "is-primary": T.primary }]),
|
|
1129
|
+
type: T.primary ? "primary" : "default",
|
|
1130
|
+
variant: T.primary ? "solid" : T.variant ?? "outline",
|
|
1131
|
+
loading: T.loading,
|
|
1132
|
+
disabled: T.disabled,
|
|
1133
|
+
href: T.href,
|
|
1134
|
+
target: T.href ? T.target ?? "_blank" : void 0,
|
|
1135
|
+
rel: T.href ? "noopener" : void 0,
|
|
1136
|
+
onClick: (F) => T.run?.()
|
|
1137
|
+
}, ke({
|
|
779
1138
|
default: y(() => [
|
|
780
|
-
|
|
1139
|
+
z(" " + A(T.label), 1)
|
|
781
1140
|
]),
|
|
782
1141
|
_: 2
|
|
783
1142
|
}, [
|
|
784
|
-
|
|
1143
|
+
T.icon ? {
|
|
785
1144
|
name: "icon",
|
|
786
1145
|
fn: y(() => [
|
|
787
|
-
|
|
788
|
-
name:
|
|
1146
|
+
w(a(Me), {
|
|
1147
|
+
name: T.icon
|
|
789
1148
|
}, null, 8, ["name"])
|
|
790
1149
|
]),
|
|
791
1150
|
key: "0"
|
|
792
1151
|
} : void 0
|
|
793
1152
|
]), 1032, ["class", "type", "variant", "loading", "disabled", "href", "target", "rel", "onClick"]))), 128)),
|
|
794
|
-
|
|
1153
|
+
v.value.length > 0 ? (m(), S(Fe, {
|
|
795
1154
|
key: 0,
|
|
796
|
-
actions:
|
|
1155
|
+
actions: v.value,
|
|
797
1156
|
size: "lg",
|
|
798
|
-
label: e.title ??
|
|
1157
|
+
label: e.title ?? a(o)("editor.more")
|
|
799
1158
|
}, null, 8, ["actions", "label"])) : N("", !0)
|
|
800
1159
|
])) : N("", !0)
|
|
801
|
-
], 10,
|
|
1160
|
+
], 10, da));
|
|
802
1161
|
}
|
|
803
|
-
}),
|
|
1162
|
+
}), pt = /* @__PURE__ */ G(va, [["__scopeId", "data-v-e27d184e"]]), pa = ["data-wx-fill"], ha = /* @__PURE__ */ M({
|
|
804
1163
|
__name: "ListScreen",
|
|
805
|
-
props: /* @__PURE__ */
|
|
1164
|
+
props: /* @__PURE__ */ ne({
|
|
806
1165
|
title: { default: void 0 },
|
|
807
1166
|
subtitle: { default: void 0 },
|
|
808
1167
|
back: { default: void 0 },
|
|
@@ -819,12 +1178,12 @@ const La = { class: "wx-link-picker" }, Va = {
|
|
|
819
1178
|
}),
|
|
820
1179
|
emits: ["update:view"],
|
|
821
1180
|
setup(e) {
|
|
822
|
-
const t =
|
|
823
|
-
return (
|
|
824
|
-
class:
|
|
1181
|
+
const t = re(e, "view");
|
|
1182
|
+
return (l, n) => (m(), $("div", {
|
|
1183
|
+
class: oe(["wx-list-screen", { "is-fill": e.fill }]),
|
|
825
1184
|
"data-wx-fill": e.fill ? "" : void 0
|
|
826
1185
|
}, [
|
|
827
|
-
e.title || e.actions ||
|
|
1186
|
+
e.title || e.actions || l.$slots.actions ? (m(), S(pt, {
|
|
828
1187
|
key: 0,
|
|
829
1188
|
class: "wx-list-screen__head",
|
|
830
1189
|
title: e.title,
|
|
@@ -833,217 +1192,220 @@ const La = { class: "wx-link-picker" }, Va = {
|
|
|
833
1192
|
"back-label": e.backLabel,
|
|
834
1193
|
actions: e.actions,
|
|
835
1194
|
"collapse-below": 480
|
|
836
|
-
},
|
|
837
|
-
|
|
1195
|
+
}, ke({ _: 2 }, [
|
|
1196
|
+
l.$slots.actions ? {
|
|
838
1197
|
name: "extra",
|
|
839
1198
|
fn: y(() => [
|
|
840
|
-
|
|
1199
|
+
Y(l.$slots, "actions", {}, void 0, !0)
|
|
841
1200
|
]),
|
|
842
1201
|
key: "0"
|
|
843
1202
|
} : void 0
|
|
844
1203
|
]), 1032, ["title", "subtitle", "back", "back-label", "actions"])) : N("", !0),
|
|
845
|
-
e.views && e.views.length > 0 ? (
|
|
1204
|
+
e.views && e.views.length > 0 ? (m(), S(a(Dt), {
|
|
846
1205
|
key: 1,
|
|
847
1206
|
modelValue: t.value,
|
|
848
|
-
"onUpdate:modelValue":
|
|
1207
|
+
"onUpdate:modelValue": n[0] || (n[0] = (o) => t.value = o),
|
|
849
1208
|
class: "wx-list-screen__views",
|
|
850
1209
|
items: e.views,
|
|
851
1210
|
"collapse-below": e.collapseBelow,
|
|
852
1211
|
"aria-label": e.title
|
|
853
1212
|
}, {
|
|
854
1213
|
default: y(() => [
|
|
855
|
-
e.card ? (
|
|
1214
|
+
e.card ? (m(), S(a(Re), {
|
|
856
1215
|
key: 0,
|
|
857
1216
|
class: "wx-list-screen__card",
|
|
858
1217
|
padding: e.padding
|
|
859
1218
|
}, {
|
|
860
1219
|
default: y(() => [
|
|
861
|
-
|
|
1220
|
+
Y(l.$slots, "default", {}, void 0, !0)
|
|
862
1221
|
]),
|
|
863
1222
|
_: 3
|
|
864
|
-
}, 8, ["padding"])) :
|
|
1223
|
+
}, 8, ["padding"])) : Y(l.$slots, "default", {}, void 0, !0, 1)
|
|
865
1224
|
]),
|
|
866
1225
|
_: 3
|
|
867
|
-
}, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (
|
|
868
|
-
e.card ? (
|
|
1226
|
+
}, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (m(), $(j, { key: 2 }, [
|
|
1227
|
+
e.card ? (m(), S(a(Re), {
|
|
869
1228
|
key: 0,
|
|
870
1229
|
class: "wx-list-screen__card",
|
|
871
1230
|
padding: e.padding
|
|
872
1231
|
}, {
|
|
873
1232
|
default: y(() => [
|
|
874
|
-
|
|
1233
|
+
Y(l.$slots, "default", {}, void 0, !0)
|
|
875
1234
|
]),
|
|
876
1235
|
_: 3
|
|
877
|
-
}, 8, ["padding"])) :
|
|
1236
|
+
}, 8, ["padding"])) : Y(l.$slots, "default", {}, void 0, !0, 1)
|
|
878
1237
|
], 64))
|
|
879
|
-
], 10,
|
|
1238
|
+
], 10, pa));
|
|
880
1239
|
}
|
|
881
|
-
}),
|
|
1240
|
+
}), ht = /* @__PURE__ */ G(ha, [["__scopeId", "data-v-8c7e5ad1"]]), ga = /* @__PURE__ */ M({
|
|
882
1241
|
name: "WxRichTextField",
|
|
883
1242
|
inheritAttrs: !1,
|
|
884
1243
|
__name: "RichTextField",
|
|
885
1244
|
setup(e) {
|
|
886
|
-
const t =
|
|
887
|
-
bold:
|
|
888
|
-
italic:
|
|
889
|
-
strike:
|
|
890
|
-
code:
|
|
891
|
-
h2:
|
|
892
|
-
h3:
|
|
893
|
-
h4:
|
|
894
|
-
bulletList:
|
|
895
|
-
orderedList:
|
|
896
|
-
blockquote:
|
|
897
|
-
hr:
|
|
898
|
-
link:
|
|
899
|
-
table:
|
|
900
|
-
image:
|
|
901
|
-
youtube:
|
|
902
|
-
undo:
|
|
903
|
-
redo:
|
|
904
|
-
addRowAfter:
|
|
905
|
-
addRowBefore:
|
|
906
|
-
addColumnAfter:
|
|
907
|
-
addColumnBefore:
|
|
908
|
-
deleteRow:
|
|
909
|
-
deleteColumn:
|
|
910
|
-
mergeOrSplit:
|
|
911
|
-
deleteTable:
|
|
912
|
-
toolbar:
|
|
913
|
-
linkAddress:
|
|
914
|
-
youtubeAddress:
|
|
915
|
-
apply:
|
|
916
|
-
cancel:
|
|
917
|
-
uploading:
|
|
1245
|
+
const t = J(), l = D("webx-admin"), n = g(() => t.pickImage ?? void 0), o = g(() => ({
|
|
1246
|
+
bold: l("rich-text.bold"),
|
|
1247
|
+
italic: l("rich-text.italic"),
|
|
1248
|
+
strike: l("rich-text.strike"),
|
|
1249
|
+
code: l("rich-text.code"),
|
|
1250
|
+
h2: l("rich-text.h2"),
|
|
1251
|
+
h3: l("rich-text.h3"),
|
|
1252
|
+
h4: l("rich-text.h4"),
|
|
1253
|
+
bulletList: l("rich-text.bullet-list"),
|
|
1254
|
+
orderedList: l("rich-text.ordered-list"),
|
|
1255
|
+
blockquote: l("rich-text.blockquote"),
|
|
1256
|
+
hr: l("rich-text.hr"),
|
|
1257
|
+
link: l("rich-text.link"),
|
|
1258
|
+
table: l("rich-text.table"),
|
|
1259
|
+
image: l("rich-text.image"),
|
|
1260
|
+
youtube: l("rich-text.youtube"),
|
|
1261
|
+
undo: l("rich-text.undo"),
|
|
1262
|
+
redo: l("rich-text.redo"),
|
|
1263
|
+
addRowAfter: l("rich-text.row-below"),
|
|
1264
|
+
addRowBefore: l("rich-text.row-above"),
|
|
1265
|
+
addColumnAfter: l("rich-text.column-after"),
|
|
1266
|
+
addColumnBefore: l("rich-text.column-before"),
|
|
1267
|
+
deleteRow: l("rich-text.delete-row"),
|
|
1268
|
+
deleteColumn: l("rich-text.delete-column"),
|
|
1269
|
+
mergeOrSplit: l("rich-text.merge-cells"),
|
|
1270
|
+
deleteTable: l("rich-text.delete-table"),
|
|
1271
|
+
toolbar: l("rich-text.toolbar"),
|
|
1272
|
+
linkAddress: l("rich-text.link-address"),
|
|
1273
|
+
youtubeAddress: l("rich-text.youtube-address"),
|
|
1274
|
+
apply: l("rich-text.apply"),
|
|
1275
|
+
cancel: l("rich-text.cancel"),
|
|
1276
|
+
uploading: l("rich-text.uploading")
|
|
918
1277
|
}));
|
|
919
|
-
return (i,
|
|
920
|
-
labels:
|
|
921
|
-
"pick-image":
|
|
1278
|
+
return (i, s) => (m(), S(a(Ot), et(i.$attrs, {
|
|
1279
|
+
labels: o.value,
|
|
1280
|
+
"pick-image": n.value
|
|
922
1281
|
}), null, 16, ["labels", "pick-image"]));
|
|
923
1282
|
}
|
|
924
|
-
}),
|
|
925
|
-
function
|
|
926
|
-
|
|
1283
|
+
}), gt = /* @__PURE__ */ Symbol("wx-record-address");
|
|
1284
|
+
function ya(e) {
|
|
1285
|
+
ze(gt, e);
|
|
927
1286
|
}
|
|
928
|
-
function
|
|
929
|
-
return
|
|
1287
|
+
function ba() {
|
|
1288
|
+
return se(gt, null);
|
|
930
1289
|
}
|
|
931
|
-
const
|
|
1290
|
+
const wa = { class: "wx-slug" }, xa = { class: "wx-slug__prefix" }, ka = /* @__PURE__ */ M({
|
|
932
1291
|
name: "WxSlugField",
|
|
933
1292
|
inheritAttrs: !1,
|
|
934
1293
|
__name: "SlugField",
|
|
935
1294
|
setup(e) {
|
|
936
|
-
const t =
|
|
937
|
-
const
|
|
938
|
-
return
|
|
939
|
-
}),
|
|
940
|
-
const
|
|
941
|
-
return typeof
|
|
942
|
-
}), i =
|
|
943
|
-
const
|
|
944
|
-
return typeof
|
|
1295
|
+
const t = ba(), l = it(), n = g(() => {
|
|
1296
|
+
const s = t?.prefix.value ?? "";
|
|
1297
|
+
return s === "" ? "/" : `/${s}/`;
|
|
1298
|
+
}), o = g(() => {
|
|
1299
|
+
const s = t?.values.value.slug;
|
|
1300
|
+
return typeof s == "string" ? s : s?.[l.active.value] ?? "";
|
|
1301
|
+
}), i = g(() => {
|
|
1302
|
+
const s = t?.path.value;
|
|
1303
|
+
return typeof s == "string" && o.value !== "" && `${n.value}${o.value}` != `/${s}`;
|
|
945
1304
|
});
|
|
946
|
-
return (
|
|
947
|
-
|
|
1305
|
+
return (s, r) => (m(), $("div", wa, [
|
|
1306
|
+
w(a(Te), Ct(Wt(s.$attrs)), {
|
|
948
1307
|
prefix: y(() => [
|
|
949
|
-
B("span",
|
|
1308
|
+
B("span", xa, A(n.value), 1)
|
|
950
1309
|
]),
|
|
951
1310
|
_: 1
|
|
952
1311
|
}, 16),
|
|
953
|
-
i.value &&
|
|
1312
|
+
i.value && a(t) ? (m(), S(a(Se), {
|
|
954
1313
|
key: 0,
|
|
955
1314
|
type: "info",
|
|
956
1315
|
variant: "soft",
|
|
957
|
-
description:
|
|
1316
|
+
description: a(t).moving()
|
|
958
1317
|
}, null, 8, ["description"])) : N("", !0)
|
|
959
1318
|
]));
|
|
960
1319
|
}
|
|
961
|
-
}),
|
|
962
|
-
"wx-list": { component:
|
|
1320
|
+
}), Ge = /* @__PURE__ */ G(ka, [["__scopeId", "data-v-5921c0dd"]]), _a = {
|
|
1321
|
+
"wx-list": { component: ht, kind: "layout", labelProp: "title" },
|
|
963
1322
|
// Full width: an editor shares a row with nothing, and a form of two columns would give it
|
|
964
1323
|
// half a line to write a page of text in.
|
|
965
|
-
"wx-rich-text": { component:
|
|
1324
|
+
"wx-rich-text": { component: ga, kind: "field", wide: !0 },
|
|
966
1325
|
// Wide as well: a row of the picker is a segmented switch, a section and a search box, and half
|
|
967
1326
|
// a form's width leaves the search box too narrow to read a page title in.
|
|
968
|
-
"wx-link": { component:
|
|
969
|
-
"wx-categories": { component:
|
|
1327
|
+
"wx-link": { component: sa, kind: "field", wide: !0 },
|
|
1328
|
+
"wx-categories": { component: gl, kind: "field" },
|
|
970
1329
|
// Wide: four controls in a column, and half a line leaves the category chips one to a row.
|
|
971
|
-
"wx-collection": { component:
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
1330
|
+
"wx-collection": { component: Xl, kind: "field", wide: !0 },
|
|
1331
|
+
// Wide: a row carries a picture, a name with a line under it and a mark, and the search box
|
|
1332
|
+
// under the list reads titles.
|
|
1333
|
+
"wx-relations": { component: mt, kind: "field", wide: !0 },
|
|
1334
|
+
"wx-slug": { component: Ge, kind: "field" },
|
|
1335
|
+
"wx-category-slug": { component: Ge, kind: "field" }
|
|
1336
|
+
}, yt = /* @__PURE__ */ Symbol("webx-admin");
|
|
1337
|
+
function J() {
|
|
1338
|
+
const e = se(yt, null);
|
|
977
1339
|
if (e === null)
|
|
978
1340
|
throw new Error("useAdmin() was called outside a panel created by createAdmin().");
|
|
979
1341
|
return e;
|
|
980
1342
|
}
|
|
981
|
-
function
|
|
982
|
-
const t =
|
|
1343
|
+
function $a(e) {
|
|
1344
|
+
const t = be({
|
|
983
1345
|
status: "loading",
|
|
984
1346
|
manifest: null,
|
|
985
1347
|
user: null,
|
|
986
1348
|
error: null
|
|
987
|
-
}),
|
|
1349
|
+
}), l = g(() => {
|
|
988
1350
|
const c = t.manifest;
|
|
989
1351
|
if (c === null)
|
|
990
1352
|
return [];
|
|
991
1353
|
const x = [];
|
|
992
1354
|
for (const p of c.modules) {
|
|
993
|
-
const
|
|
994
|
-
if (
|
|
1355
|
+
const b = e.modules.find((F) => F.id === p.id);
|
|
1356
|
+
if (b === void 0)
|
|
995
1357
|
continue;
|
|
996
|
-
const
|
|
997
|
-
|
|
1358
|
+
const T = b.path ?? b.routes?.[0]?.path;
|
|
1359
|
+
T !== void 0 && x.push({
|
|
998
1360
|
id: p.id,
|
|
999
1361
|
title: p.title,
|
|
1000
1362
|
icon: p.icon,
|
|
1001
|
-
path:
|
|
1363
|
+
path: T,
|
|
1002
1364
|
group: p.group ?? null
|
|
1003
1365
|
});
|
|
1004
1366
|
}
|
|
1005
1367
|
return x;
|
|
1006
|
-
}),
|
|
1368
|
+
}), n = g(() => {
|
|
1007
1369
|
const c = t.manifest?.groups ?? [], x = [], p = /* @__PURE__ */ new Map();
|
|
1008
|
-
for (const
|
|
1009
|
-
if (
|
|
1010
|
-
const
|
|
1011
|
-
|
|
1370
|
+
for (const b of l.value)
|
|
1371
|
+
if (b.group !== null && c.some((T) => T.id === b.group)) {
|
|
1372
|
+
const T = p.get(b.group) ?? [];
|
|
1373
|
+
T.push(b), p.set(b.group, T);
|
|
1012
1374
|
} else
|
|
1013
|
-
x.push(
|
|
1375
|
+
x.push(b);
|
|
1014
1376
|
return {
|
|
1015
1377
|
top: x,
|
|
1016
|
-
groups: c.filter((
|
|
1017
|
-
id:
|
|
1018
|
-
title:
|
|
1019
|
-
icon:
|
|
1020
|
-
entries: p.get(
|
|
1378
|
+
groups: c.filter((b) => p.has(b.id)).map((b) => ({
|
|
1379
|
+
id: b.id,
|
|
1380
|
+
title: b.title,
|
|
1381
|
+
icon: b.icon ?? null,
|
|
1382
|
+
entries: p.get(b.id) ?? []
|
|
1021
1383
|
}))
|
|
1022
1384
|
};
|
|
1023
|
-
}),
|
|
1385
|
+
}), o = { ..._a };
|
|
1024
1386
|
for (const c of e.modules)
|
|
1025
|
-
Object.assign(
|
|
1026
|
-
Object.assign(
|
|
1027
|
-
const i = e.modules.find((c) => c.pickImage !== void 0)?.pickImage,
|
|
1387
|
+
Object.assign(o, c.types);
|
|
1388
|
+
Object.assign(o, e.types);
|
|
1389
|
+
const i = e.modules.find((c) => c.pickImage !== void 0)?.pickImage, s = /* @__PURE__ */ new Map();
|
|
1028
1390
|
async function r(c) {
|
|
1029
1391
|
const x = `${e.i18n.state.locale}:${c}`;
|
|
1030
|
-
let p =
|
|
1031
|
-
return p === void 0 && (p = e.http.get(`${e.apiPath}/screens/${c}`).then((
|
|
1032
|
-
throw
|
|
1033
|
-
}),
|
|
1392
|
+
let p = s.get(x);
|
|
1393
|
+
return p === void 0 && (p = e.http.get(`${e.apiPath}/screens/${c}`).then((b) => b.data.root).catch((b) => {
|
|
1394
|
+
throw s.delete(x), b;
|
|
1395
|
+
}), s.set(x, p)), p;
|
|
1034
1396
|
}
|
|
1035
1397
|
let u = null;
|
|
1036
1398
|
async function d() {
|
|
1037
1399
|
t.status = "loading", t.error = null;
|
|
1038
1400
|
try {
|
|
1039
|
-
if (u !== null && (t.user = await u(),
|
|
1401
|
+
if (u !== null && (t.user = await u(), f(t.user), t.user === null)) {
|
|
1040
1402
|
t.manifest = null, t.status = "unauthenticated";
|
|
1041
1403
|
return;
|
|
1042
1404
|
}
|
|
1043
1405
|
const c = await e.loadManifest();
|
|
1044
|
-
t.manifest = c, e.i18n.state.contentLocales = c.locales ?? [], e.i18n.state.panelLocales = c.panelLocales ?? e.i18n.state.panelLocales, c.locale !== void 0 && c.locale !== e.i18n.state.locale && await
|
|
1406
|
+
t.manifest = c, e.i18n.state.contentLocales = c.locales ?? [], e.i18n.state.panelLocales = c.panelLocales ?? e.i18n.state.panelLocales, c.locale !== void 0 && c.locale !== e.i18n.state.locale && await v(c.locale), t.status = "ready";
|
|
1045
1407
|
} catch (c) {
|
|
1046
|
-
if (
|
|
1408
|
+
if (Sa(c)) {
|
|
1047
1409
|
t.manifest = null, t.user = null, t.status = "unauthenticated";
|
|
1048
1410
|
return;
|
|
1049
1411
|
}
|
|
@@ -1057,10 +1419,10 @@ function al(e) {
|
|
|
1057
1419
|
} catch {
|
|
1058
1420
|
}
|
|
1059
1421
|
}
|
|
1060
|
-
function
|
|
1422
|
+
function f(c) {
|
|
1061
1423
|
c !== null && e.theme?.adopt(c.theme);
|
|
1062
1424
|
}
|
|
1063
|
-
async function
|
|
1425
|
+
async function v(c) {
|
|
1064
1426
|
if (e.loadDictionary === void 0) {
|
|
1065
1427
|
e.i18n.state.locale = c;
|
|
1066
1428
|
return;
|
|
@@ -1074,15 +1436,15 @@ function al(e) {
|
|
|
1074
1436
|
state: t,
|
|
1075
1437
|
i18n: e.i18n,
|
|
1076
1438
|
modules: e.modules,
|
|
1077
|
-
nav:
|
|
1078
|
-
groups:
|
|
1079
|
-
types:
|
|
1439
|
+
nav: l,
|
|
1440
|
+
groups: n,
|
|
1441
|
+
types: o,
|
|
1080
1442
|
pickImage: i ?? null,
|
|
1081
1443
|
reload: d,
|
|
1082
1444
|
refreshManifest: h,
|
|
1083
|
-
setLocale:
|
|
1445
|
+
setLocale: v,
|
|
1084
1446
|
setUser(c) {
|
|
1085
|
-
t.user = c,
|
|
1447
|
+
t.user = c, f(c);
|
|
1086
1448
|
},
|
|
1087
1449
|
useSessionLoader(c) {
|
|
1088
1450
|
u = c;
|
|
@@ -1097,78 +1459,78 @@ function al(e) {
|
|
|
1097
1459
|
}
|
|
1098
1460
|
};
|
|
1099
1461
|
}
|
|
1100
|
-
function
|
|
1101
|
-
e.provide(
|
|
1462
|
+
function Ta(e, t) {
|
|
1463
|
+
e.provide(yt, t);
|
|
1102
1464
|
}
|
|
1103
|
-
function
|
|
1465
|
+
function Sa(e) {
|
|
1104
1466
|
return typeof e == "object" && e !== null && "status" in e && e.status === 401;
|
|
1105
1467
|
}
|
|
1106
|
-
const
|
|
1468
|
+
const Ca = /* @__PURE__ */ M({
|
|
1107
1469
|
__name: "AdminLanding",
|
|
1108
1470
|
props: {
|
|
1109
1471
|
landing: { default: null }
|
|
1110
1472
|
},
|
|
1111
1473
|
setup(e) {
|
|
1112
|
-
const t = e,
|
|
1113
|
-
const
|
|
1114
|
-
return
|
|
1474
|
+
const t = e, l = J(), n = _e(), o = D("webx-admin"), i = g(() => {
|
|
1475
|
+
const s = l.nav.value;
|
|
1476
|
+
return s.length === 0 ? null : ((t.landing === null ? void 0 : s.find((u) => u.path === t.landing)) ?? s[0])?.path ?? null;
|
|
1115
1477
|
});
|
|
1116
|
-
return
|
|
1478
|
+
return te(
|
|
1117
1479
|
i,
|
|
1118
|
-
(
|
|
1119
|
-
|
|
1480
|
+
(s) => {
|
|
1481
|
+
s !== null && n.replace(s);
|
|
1120
1482
|
},
|
|
1121
1483
|
{ immediate: !0 }
|
|
1122
|
-
), (
|
|
1484
|
+
), (s, r) => i.value === null && a(l).state.status === "ready" ? (m(), S(a(Ht), {
|
|
1123
1485
|
key: 0,
|
|
1124
1486
|
status: "info",
|
|
1125
|
-
title:
|
|
1126
|
-
description:
|
|
1487
|
+
title: a(o)("shell.empty-title"),
|
|
1488
|
+
description: a(o)("shell.empty-description")
|
|
1127
1489
|
}, null, 8, ["title", "description"])) : N("", !0);
|
|
1128
1490
|
}
|
|
1129
|
-
}),
|
|
1491
|
+
}), Wa = /* @__PURE__ */ M({
|
|
1130
1492
|
__name: "AdminNav",
|
|
1131
1493
|
props: {
|
|
1132
1494
|
collapsed: { type: Boolean }
|
|
1133
1495
|
},
|
|
1134
1496
|
emits: ["select"],
|
|
1135
1497
|
setup(e, { emit: t }) {
|
|
1136
|
-
const
|
|
1498
|
+
const l = t, n = J(), o = D("webx-admin"), i = _e(), s = st(), r = g({
|
|
1137
1499
|
/*
|
|
1138
1500
|
* The longest path that contains this one, on a segment boundary: a section may live inside
|
|
1139
1501
|
* another's path (`/services/categories` under `/services`), and the first match in the order
|
|
1140
1502
|
* of the menu would light up the outer one.
|
|
1141
1503
|
*/
|
|
1142
|
-
get: () =>
|
|
1504
|
+
get: () => n.nav.value.filter((d) => s.path === d.path || s.path.startsWith(`${d.path}/`)).sort((d, h) => h.path.length - d.path.length)[0]?.id ?? "",
|
|
1143
1505
|
set: (u) => {
|
|
1144
|
-
const d =
|
|
1506
|
+
const d = n.nav.value.find((h) => h.id === u);
|
|
1145
1507
|
d !== void 0 && i.push(d.path);
|
|
1146
1508
|
}
|
|
1147
1509
|
});
|
|
1148
1510
|
return (u, d) => {
|
|
1149
|
-
const h =
|
|
1150
|
-
return
|
|
1511
|
+
const h = X("wx-menu-item"), f = X("wx-submenu"), v = X("wx-menu");
|
|
1512
|
+
return m(), S(v, {
|
|
1151
1513
|
modelValue: r.value,
|
|
1152
1514
|
"onUpdate:modelValue": d[0] || (d[0] = (c) => r.value = c),
|
|
1153
1515
|
collapsed: e.collapsed,
|
|
1154
|
-
label:
|
|
1155
|
-
onSelect: d[1] || (d[1] = (c) =>
|
|
1516
|
+
label: a(o)("nav.sections"),
|
|
1517
|
+
onSelect: d[1] || (d[1] = (c) => l("select"))
|
|
1156
1518
|
}, {
|
|
1157
1519
|
default: y(() => [
|
|
1158
|
-
(
|
|
1520
|
+
(m(!0), $(j, null, ae(a(n).groups.value.top, (c) => (m(), S(h, {
|
|
1159
1521
|
key: c.id,
|
|
1160
1522
|
value: c.id,
|
|
1161
1523
|
icon: c.icon ?? void 0,
|
|
1162
1524
|
label: c.title
|
|
1163
1525
|
}, null, 8, ["value", "icon", "label"]))), 128)),
|
|
1164
|
-
(
|
|
1526
|
+
(m(!0), $(j, null, ae(a(n).groups.value.groups, (c) => (m(), S(f, {
|
|
1165
1527
|
key: c.id,
|
|
1166
1528
|
value: `group:${c.id}`,
|
|
1167
1529
|
title: c.title,
|
|
1168
1530
|
icon: c.icon ?? "gear"
|
|
1169
1531
|
}, {
|
|
1170
1532
|
default: y(() => [
|
|
1171
|
-
(
|
|
1533
|
+
(m(!0), $(j, null, ae(c.entries, (x) => (m(), S(h, {
|
|
1172
1534
|
key: x.id,
|
|
1173
1535
|
value: x.id,
|
|
1174
1536
|
icon: x.icon ?? void 0,
|
|
@@ -1182,68 +1544,68 @@ const ol = /* @__PURE__ */ I({
|
|
|
1182
1544
|
}, 8, ["modelValue", "collapsed", "label"]);
|
|
1183
1545
|
};
|
|
1184
1546
|
}
|
|
1185
|
-
}),
|
|
1547
|
+
}), Aa = {
|
|
1186
1548
|
key: 0,
|
|
1187
1549
|
class: "wx-root wx-admin-plain"
|
|
1188
|
-
},
|
|
1550
|
+
}, Va = {
|
|
1189
1551
|
key: 1,
|
|
1190
1552
|
class: "wx-root wx-admin-plain"
|
|
1191
|
-
},
|
|
1553
|
+
}, La = {
|
|
1192
1554
|
key: 2,
|
|
1193
1555
|
class: "wx-root wx-admin-plain"
|
|
1194
|
-
},
|
|
1556
|
+
}, Na = ["src", "alt", "width", "height"], Ra = ["src", "alt", "width", "height"], Ua = ["src", "alt"], za = { class: "wx-admin__user" }, Ia = { class: "wx-admin__user wx-admin__user--drawer" }, Ea = /* @__PURE__ */ M({
|
|
1195
1557
|
__name: "AdminShell",
|
|
1196
1558
|
setup(e) {
|
|
1197
|
-
const t =
|
|
1198
|
-
|
|
1559
|
+
const t = J(), l = D("webx-admin"), n = L(null), { width: o, layout: i, collapsed: s, showAside: r, drawerOpen: u, toggle: d, close: h } = jt(
|
|
1560
|
+
n,
|
|
1199
1561
|
{ persist: "webx-admin-shell" }
|
|
1200
|
-
),
|
|
1201
|
-
return
|
|
1562
|
+
), f = g(() => t.state.manifest?.title ?? ""), v = g(() => t.state.manifest?.branding?.logo ?? null), c = g(() => t.state.manifest?.branding?.mark ?? null), x = g(() => Kt(o.value, null));
|
|
1563
|
+
return At(() => {
|
|
1202
1564
|
typeof document > "u" || (document.documentElement.dataset.wxShell = x.value);
|
|
1203
|
-
}),
|
|
1565
|
+
}), Vt(() => {
|
|
1204
1566
|
typeof document < "u" && delete document.documentElement.dataset.wxShell;
|
|
1205
|
-
}), (p,
|
|
1206
|
-
const
|
|
1207
|
-
return
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
])) :
|
|
1212
|
-
|
|
1213
|
-
label: l
|
|
1567
|
+
}), (p, b) => {
|
|
1568
|
+
const T = X("router-view"), F = X("wx-loading"), Q = X("wx-button"), H = X("wx-result"), V = X("wx-action"), k = X("wx-text"), C = X("wx-header"), _ = X("wx-aside"), q = X("wx-main"), R = X("wx-container"), U = X("wx-drawer");
|
|
1569
|
+
return m(), $(j, null, [
|
|
1570
|
+
w(a(qt), { placement: "bottom-center" }),
|
|
1571
|
+
a(t).state.status === "unauthenticated" ? (m(), $("div", Aa, [
|
|
1572
|
+
w(T)
|
|
1573
|
+
])) : a(t).state.status === "loading" ? (m(), $("div", Va, [
|
|
1574
|
+
w(F, {
|
|
1575
|
+
label: a(l)("shell.loading")
|
|
1214
1576
|
}, null, 8, ["label"])
|
|
1215
|
-
])) :
|
|
1216
|
-
|
|
1577
|
+
])) : a(t).state.status === "error" ? (m(), $("div", La, [
|
|
1578
|
+
w(H, {
|
|
1217
1579
|
status: "error",
|
|
1218
|
-
title: l
|
|
1219
|
-
description:
|
|
1580
|
+
title: a(l)("shell.error-title"),
|
|
1581
|
+
description: a(t).state.error
|
|
1220
1582
|
}, {
|
|
1221
1583
|
default: y(() => [
|
|
1222
|
-
|
|
1584
|
+
w(Q, {
|
|
1223
1585
|
type: "primary",
|
|
1224
|
-
onClick:
|
|
1586
|
+
onClick: b[0] || (b[0] = (I) => a(t).reload())
|
|
1225
1587
|
}, {
|
|
1226
1588
|
default: y(() => [
|
|
1227
|
-
|
|
1589
|
+
z(A(a(l)("shell.retry")), 1)
|
|
1228
1590
|
]),
|
|
1229
1591
|
_: 1
|
|
1230
1592
|
})
|
|
1231
1593
|
]),
|
|
1232
1594
|
_: 1
|
|
1233
1595
|
}, 8, ["title", "description"])
|
|
1234
|
-
])) : (
|
|
1596
|
+
])) : (m(), $("div", {
|
|
1235
1597
|
key: 3,
|
|
1236
1598
|
ref_key: "shellEl",
|
|
1237
|
-
ref:
|
|
1238
|
-
class:
|
|
1599
|
+
ref: n,
|
|
1600
|
+
class: oe(["wx-root wx-admin", `wx-admin--${x.value}`])
|
|
1239
1601
|
}, [
|
|
1240
|
-
|
|
1241
|
-
direction:
|
|
1602
|
+
w(R, {
|
|
1603
|
+
direction: a(i) === "drawer" ? "vertical" : "horizontal",
|
|
1242
1604
|
"full-height": "",
|
|
1243
1605
|
class: "wx-admin__frame"
|
|
1244
1606
|
}, {
|
|
1245
1607
|
default: y(() => [
|
|
1246
|
-
|
|
1608
|
+
a(i) === "drawer" ? (m(), S(C, {
|
|
1247
1609
|
key: 0,
|
|
1248
1610
|
class: "wx-admin__header",
|
|
1249
1611
|
floating: "",
|
|
@@ -1253,29 +1615,29 @@ const ol = /* @__PURE__ */ I({
|
|
|
1253
1615
|
height: "var(--wx-admin-header-height)"
|
|
1254
1616
|
}, {
|
|
1255
1617
|
end: y(() => [
|
|
1256
|
-
|
|
1618
|
+
Y(p.$slots, "user", { expanded: !1 }, void 0, !0)
|
|
1257
1619
|
]),
|
|
1258
1620
|
default: y(() => [
|
|
1259
|
-
|
|
1621
|
+
w(V, {
|
|
1260
1622
|
icon: "menu",
|
|
1261
|
-
title: l
|
|
1262
|
-
onClick:
|
|
1623
|
+
title: a(l)("nav.menu"),
|
|
1624
|
+
onClick: a(d)
|
|
1263
1625
|
}, null, 8, ["title", "onClick"]),
|
|
1264
|
-
|
|
1265
|
-
|
|
1626
|
+
Y(p.$slots, "brand", {}, () => [
|
|
1627
|
+
v.value ? (m(), $("img", {
|
|
1266
1628
|
key: 0,
|
|
1267
1629
|
class: "wx-admin__logo",
|
|
1268
|
-
src:
|
|
1269
|
-
alt:
|
|
1270
|
-
width:
|
|
1271
|
-
height:
|
|
1272
|
-
}, null, 8,
|
|
1630
|
+
src: v.value.url,
|
|
1631
|
+
alt: f.value,
|
|
1632
|
+
width: v.value.width ?? void 0,
|
|
1633
|
+
height: v.value.height ?? void 0
|
|
1634
|
+
}, null, 8, Na)) : (m(), S(k, {
|
|
1273
1635
|
key: 1,
|
|
1274
1636
|
weight: "semibold",
|
|
1275
1637
|
truncate: ""
|
|
1276
1638
|
}, {
|
|
1277
1639
|
default: y(() => [
|
|
1278
|
-
|
|
1640
|
+
z(A(f.value), 1)
|
|
1279
1641
|
]),
|
|
1280
1642
|
_: 1
|
|
1281
1643
|
}))
|
|
@@ -1283,96 +1645,96 @@ const ol = /* @__PURE__ */ I({
|
|
|
1283
1645
|
]),
|
|
1284
1646
|
_: 3
|
|
1285
1647
|
})) : N("", !0),
|
|
1286
|
-
|
|
1648
|
+
a(r) ? (m(), S(_, {
|
|
1287
1649
|
key: 1,
|
|
1288
1650
|
class: "wx-admin__aside",
|
|
1289
1651
|
sticky: "",
|
|
1290
1652
|
floating: "",
|
|
1291
1653
|
scroll: "",
|
|
1292
1654
|
bordered: !1,
|
|
1293
|
-
collapsed:
|
|
1655
|
+
collapsed: a(s),
|
|
1294
1656
|
width: 220,
|
|
1295
1657
|
"collapsed-width": 56
|
|
1296
1658
|
}, {
|
|
1297
1659
|
top: y(() => [
|
|
1298
1660
|
B("div", {
|
|
1299
|
-
class:
|
|
1661
|
+
class: oe(["wx-admin__brand", { "wx-admin__brand--stacked": a(s) && c.value }])
|
|
1300
1662
|
}, [
|
|
1301
|
-
|
|
1663
|
+
a(s) ? c.value ? (m(), $("img", {
|
|
1302
1664
|
key: 1,
|
|
1303
1665
|
class: "wx-admin__mark",
|
|
1304
1666
|
src: c.value.url,
|
|
1305
|
-
alt:
|
|
1306
|
-
}, null, 8,
|
|
1307
|
-
|
|
1667
|
+
alt: f.value
|
|
1668
|
+
}, null, 8, Ua)) : N("", !0) : Y(p.$slots, "brand", {}, () => [
|
|
1669
|
+
v.value ? (m(), $("img", {
|
|
1308
1670
|
key: 0,
|
|
1309
1671
|
class: "wx-admin__logo",
|
|
1310
|
-
src:
|
|
1311
|
-
alt:
|
|
1312
|
-
width:
|
|
1313
|
-
height:
|
|
1314
|
-
}, null, 8,
|
|
1672
|
+
src: v.value.url,
|
|
1673
|
+
alt: f.value,
|
|
1674
|
+
width: v.value.width ?? void 0,
|
|
1675
|
+
height: v.value.height ?? void 0
|
|
1676
|
+
}, null, 8, Ra)) : (m(), S(k, {
|
|
1315
1677
|
key: 1,
|
|
1316
1678
|
weight: "semibold",
|
|
1317
1679
|
truncate: "",
|
|
1318
1680
|
class: "wx-admin__title"
|
|
1319
1681
|
}, {
|
|
1320
1682
|
default: y(() => [
|
|
1321
|
-
|
|
1683
|
+
z(A(f.value), 1)
|
|
1322
1684
|
]),
|
|
1323
1685
|
_: 1
|
|
1324
1686
|
}))
|
|
1325
1687
|
], !0, 0),
|
|
1326
|
-
|
|
1688
|
+
w(V, {
|
|
1327
1689
|
icon: "sidebar",
|
|
1328
|
-
title:
|
|
1329
|
-
onClick:
|
|
1690
|
+
title: a(s) ? a(l)("nav.expand") : a(l)("nav.collapse"),
|
|
1691
|
+
onClick: a(d)
|
|
1330
1692
|
}, null, 8, ["title", "onClick"])
|
|
1331
1693
|
], 2)
|
|
1332
1694
|
]),
|
|
1333
1695
|
bottom: y(() => [
|
|
1334
|
-
B("div",
|
|
1335
|
-
|
|
1336
|
-
expanded: !
|
|
1696
|
+
B("div", za, [
|
|
1697
|
+
Y(p.$slots, "user", {
|
|
1698
|
+
expanded: !a(s)
|
|
1337
1699
|
}, void 0, !0)
|
|
1338
1700
|
])
|
|
1339
1701
|
]),
|
|
1340
1702
|
default: y(() => [
|
|
1341
|
-
|
|
1703
|
+
Y(p.$slots, "nav", { collapsed: a(s) }, void 0, !0)
|
|
1342
1704
|
]),
|
|
1343
1705
|
_: 3
|
|
1344
1706
|
}, 8, ["collapsed"])) : N("", !0),
|
|
1345
|
-
|
|
1707
|
+
w(q, {
|
|
1346
1708
|
padding: "none",
|
|
1347
1709
|
class: "wx-admin__screen"
|
|
1348
1710
|
}, {
|
|
1349
1711
|
default: y(() => [
|
|
1350
|
-
|
|
1712
|
+
w(T)
|
|
1351
1713
|
]),
|
|
1352
1714
|
_: 1
|
|
1353
1715
|
})
|
|
1354
1716
|
]),
|
|
1355
1717
|
_: 3
|
|
1356
1718
|
}, 8, ["direction"]),
|
|
1357
|
-
|
|
1358
|
-
open:
|
|
1359
|
-
"onUpdate:open":
|
|
1719
|
+
w(U, {
|
|
1720
|
+
open: a(u),
|
|
1721
|
+
"onUpdate:open": b[1] || (b[1] = (I) => at(u) ? u.value = I : null),
|
|
1360
1722
|
class: "wx-admin__drawer",
|
|
1361
|
-
title:
|
|
1723
|
+
title: f.value === "" ? a(l)("nav.menu") : f.value,
|
|
1362
1724
|
side: "left",
|
|
1363
1725
|
size: 260,
|
|
1364
1726
|
"full-screen": !1,
|
|
1365
1727
|
closable: ""
|
|
1366
1728
|
}, {
|
|
1367
1729
|
footer: y(() => [
|
|
1368
|
-
B("div",
|
|
1369
|
-
|
|
1730
|
+
B("div", Ia, [
|
|
1731
|
+
Y(p.$slots, "user", { expanded: !0 }, void 0, !0)
|
|
1370
1732
|
])
|
|
1371
1733
|
]),
|
|
1372
1734
|
default: y(() => [
|
|
1373
|
-
|
|
1735
|
+
Y(p.$slots, "nav", {
|
|
1374
1736
|
collapsed: !1,
|
|
1375
|
-
select:
|
|
1737
|
+
select: a(h)
|
|
1376
1738
|
}, void 0, !0)
|
|
1377
1739
|
]),
|
|
1378
1740
|
_: 3
|
|
@@ -1381,146 +1743,47 @@ const ol = /* @__PURE__ */ I({
|
|
|
1381
1743
|
], 64);
|
|
1382
1744
|
};
|
|
1383
1745
|
}
|
|
1384
|
-
}),
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
super(t), this.status = a, this.errors = o, this.retryAfter = s, this.body = i, this.name = "HttpError";
|
|
1388
|
-
}
|
|
1389
|
-
status;
|
|
1390
|
-
errors;
|
|
1391
|
-
retryAfter;
|
|
1392
|
-
body;
|
|
1393
|
-
/** A failed form rather than a failed request. */
|
|
1394
|
-
get isValidation() {
|
|
1395
|
-
return this.status === 422;
|
|
1396
|
-
}
|
|
1397
|
-
get isUnauthenticated() {
|
|
1398
|
-
return this.status === 401;
|
|
1399
|
-
}
|
|
1400
|
-
get isThrottled() {
|
|
1401
|
-
return this.status === 429;
|
|
1402
|
-
}
|
|
1403
|
-
}
|
|
1404
|
-
const gl = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]);
|
|
1405
|
-
function yl(e = {}) {
|
|
1406
|
-
const t = (e.baseUrl ?? "").replace(/\/$/, ""), a = e.csrfUrl ?? "/api/cms/auth/csrf-cookie", o = e.fetch ?? globalThis.fetch.bind(globalThis), s = e.onUnauthenticated, i = e.headers;
|
|
1407
|
-
let n = !1;
|
|
1408
|
-
async function r(d = !1) {
|
|
1409
|
-
n && !d && qe("XSRF-TOKEN") !== null || (await o(a, { credentials: "same-origin" }), n = !0);
|
|
1410
|
-
}
|
|
1411
|
-
async function u(d, h, m, f = {}, c = !1) {
|
|
1412
|
-
const x = gl.has(d);
|
|
1413
|
-
x && await r();
|
|
1414
|
-
const p = {
|
|
1415
|
-
Accept: "application/json",
|
|
1416
|
-
"X-Requested-With": "XMLHttpRequest",
|
|
1417
|
-
// Standing headers first, so a caller can still override one for a single request.
|
|
1418
|
-
...i?.(),
|
|
1419
|
-
...f.headers
|
|
1420
|
-
};
|
|
1421
|
-
if (x) {
|
|
1422
|
-
const k = qe("XSRF-TOKEN");
|
|
1423
|
-
k !== null && (p["X-XSRF-TOKEN"] = k);
|
|
1424
|
-
}
|
|
1425
|
-
m !== void 0 && (p["Content-Type"] = "application/json");
|
|
1426
|
-
const g = await o(wl(t, h, f.query), {
|
|
1427
|
-
method: d,
|
|
1428
|
-
credentials: "same-origin",
|
|
1429
|
-
headers: p,
|
|
1430
|
-
signal: f.signal,
|
|
1431
|
-
body: m === void 0 ? void 0 : JSON.stringify(m)
|
|
1432
|
-
});
|
|
1433
|
-
if (g.status === 419 && x && !c)
|
|
1434
|
-
return await r(!0), u(d, h, m, f, !0);
|
|
1435
|
-
if (g.status === 401 && s?.(), !g.ok)
|
|
1436
|
-
throw await bl(g);
|
|
1437
|
-
if (g.status !== 204)
|
|
1438
|
-
return await g.json();
|
|
1439
|
-
}
|
|
1440
|
-
return {
|
|
1441
|
-
get: (d, h) => u("GET", d, void 0, h),
|
|
1442
|
-
post: (d, h, m) => u("POST", d, h, m),
|
|
1443
|
-
put: (d, h, m) => u("PUT", d, h, m),
|
|
1444
|
-
patch: (d, h, m) => u("PATCH", d, h, m),
|
|
1445
|
-
delete: (d, h) => u("DELETE", d, void 0, h)
|
|
1446
|
-
};
|
|
1447
|
-
}
|
|
1448
|
-
async function bl(e) {
|
|
1449
|
-
let t = null;
|
|
1450
|
-
try {
|
|
1451
|
-
t = await e.json();
|
|
1452
|
-
} catch {
|
|
1453
|
-
}
|
|
1454
|
-
const a = t ?? {}, o = typeof a.message == "string" && a.message !== "" ? a.message : e.statusText || `Request failed with ${e.status}`, s = a.errors !== null && typeof a.errors == "object" ? a.errors : {}, i = e.headers.get("Retry-After"), n = i === null ? null : Number.parseInt(i, 10);
|
|
1455
|
-
return new We(
|
|
1456
|
-
o,
|
|
1457
|
-
e.status,
|
|
1458
|
-
s,
|
|
1459
|
-
Number.isFinite(n) ? n : null,
|
|
1460
|
-
t
|
|
1461
|
-
);
|
|
1462
|
-
}
|
|
1463
|
-
function wl(e, t, a) {
|
|
1464
|
-
const s = /^https?:\/\//i.test(t) ? t : `${e}/${t.replace(/^\//, "")}`;
|
|
1465
|
-
if (a === void 0)
|
|
1466
|
-
return s;
|
|
1467
|
-
const i = new URLSearchParams();
|
|
1468
|
-
for (const [r, u] of Object.entries(a))
|
|
1469
|
-
u != null && i.set(r, String(u));
|
|
1470
|
-
const n = i.toString();
|
|
1471
|
-
return n === "" ? s : `${s}${s.includes("?") ? "&" : "?"}${n}`;
|
|
1472
|
-
}
|
|
1473
|
-
function qe(e) {
|
|
1474
|
-
if (typeof document > "u")
|
|
1475
|
-
return null;
|
|
1476
|
-
for (const t of document.cookie.split(";")) {
|
|
1477
|
-
const [a, ...o] = t.trim().split("=");
|
|
1478
|
-
if (a === e)
|
|
1479
|
-
return decodeURIComponent(o.join("="));
|
|
1480
|
-
}
|
|
1481
|
-
return null;
|
|
1482
|
-
}
|
|
1483
|
-
const xl = "webx.theme", ht = /* @__PURE__ */ Symbol("webx-theme");
|
|
1484
|
-
function gn() {
|
|
1485
|
-
const e = ne(ht, null);
|
|
1746
|
+
}), Ba = /* @__PURE__ */ G(Ea, [["__scopeId", "data-v-819885ab"]]), Ma = "webx.theme", bt = /* @__PURE__ */ Symbol("webx-theme");
|
|
1747
|
+
function In() {
|
|
1748
|
+
const e = se(bt, null);
|
|
1486
1749
|
if (e === null)
|
|
1487
1750
|
throw new Error("useTheme() was called outside a panel created by createAdmin().");
|
|
1488
1751
|
return e;
|
|
1489
1752
|
}
|
|
1490
|
-
function
|
|
1491
|
-
e.provide(
|
|
1753
|
+
function Pa(e, t) {
|
|
1754
|
+
e.provide(bt, t);
|
|
1492
1755
|
}
|
|
1493
|
-
function
|
|
1494
|
-
const t = e.storageKey === void 0 ?
|
|
1495
|
-
preference:
|
|
1756
|
+
function Fa(e = {}) {
|
|
1757
|
+
const t = e.storageKey === void 0 ? Ma : e.storageKey, l = be({
|
|
1758
|
+
preference: Da(t) ?? "system",
|
|
1496
1759
|
resolved: "light"
|
|
1497
1760
|
});
|
|
1498
|
-
function
|
|
1499
|
-
|
|
1761
|
+
function n() {
|
|
1762
|
+
il(l.preference), l.resolved = l.preference === "system" ? rl() : l.preference;
|
|
1500
1763
|
}
|
|
1501
|
-
return
|
|
1502
|
-
|
|
1764
|
+
return n(), sl((o) => {
|
|
1765
|
+
l.preference === "system" && (l.resolved = o);
|
|
1503
1766
|
}), {
|
|
1504
|
-
state:
|
|
1505
|
-
set(
|
|
1506
|
-
|
|
1767
|
+
state: l,
|
|
1768
|
+
set(o) {
|
|
1769
|
+
l.preference = o, n(), Je(t, o);
|
|
1507
1770
|
},
|
|
1508
|
-
adopt(
|
|
1509
|
-
if (
|
|
1771
|
+
adopt(o) {
|
|
1772
|
+
if (o === void 0)
|
|
1510
1773
|
return;
|
|
1511
|
-
const i =
|
|
1512
|
-
i !==
|
|
1774
|
+
const i = o ?? "system";
|
|
1775
|
+
i !== l.preference && (l.preference = i, n(), Je(t, i));
|
|
1513
1776
|
}
|
|
1514
1777
|
};
|
|
1515
1778
|
}
|
|
1516
|
-
function
|
|
1779
|
+
function Je(e, t) {
|
|
1517
1780
|
if (e !== null)
|
|
1518
1781
|
try {
|
|
1519
1782
|
localStorage.setItem(e, t);
|
|
1520
1783
|
} catch {
|
|
1521
1784
|
}
|
|
1522
1785
|
}
|
|
1523
|
-
function
|
|
1786
|
+
function Da(e) {
|
|
1524
1787
|
if (e === null)
|
|
1525
1788
|
return null;
|
|
1526
1789
|
try {
|
|
@@ -1530,7 +1793,7 @@ function $l(e) {
|
|
|
1530
1793
|
return null;
|
|
1531
1794
|
}
|
|
1532
1795
|
}
|
|
1533
|
-
const
|
|
1796
|
+
const wt = {
|
|
1534
1797
|
shell: {
|
|
1535
1798
|
loading: "Loading the panel…",
|
|
1536
1799
|
"error-title": "The panel could not start",
|
|
@@ -1752,6 +2015,8 @@ const gt = {
|
|
|
1752
2015
|
"unknown-category": "One of the chosen categories no longer exists.",
|
|
1753
2016
|
limit: "How many to show: a whole number from 1 to :max, or empty for all.",
|
|
1754
2017
|
flag: "This switch takes yes or no.",
|
|
2018
|
+
"unknown-relation": "Records of this section cannot be filtered by that.",
|
|
2019
|
+
"unknown-related": "One of the chosen related records no longer exists.",
|
|
1755
2020
|
"field-source": "Shows records from “:source”.",
|
|
1756
2021
|
"field-unavailable": "Records from “:source” cannot be chosen here: the section is not installed, or you have no access to it.",
|
|
1757
2022
|
"field-categories": "Categories",
|
|
@@ -1764,29 +2029,51 @@ const gt = {
|
|
|
1764
2029
|
"field-markup-auto-on": "By default it is on: the block shows every category.",
|
|
1765
2030
|
"field-markup-auto-off": "By default it is off: search engines ask not to mark the same records up on several pages, and a chosen category usually stands on several.",
|
|
1766
2031
|
"field-markup-reset": "Back to the default"
|
|
2032
|
+
},
|
|
2033
|
+
// The records of another section a record points at (`wx-relations`), and the same choice as a
|
|
2034
|
+
// block's filter ("only related to" in `wx-collection`). Kept apart from `collections` because
|
|
2035
|
+
// the field is a field of its own, on any screen.
|
|
2036
|
+
relations: {
|
|
2037
|
+
"field-add": "Add…",
|
|
2038
|
+
"field-searching": "Searching…",
|
|
2039
|
+
"field-nothing": "Nothing found.",
|
|
2040
|
+
"field-empty": "Nothing chosen yet.",
|
|
2041
|
+
"field-remove": "Remove",
|
|
2042
|
+
"field-drag": "Drag to change the order",
|
|
2043
|
+
"field-hidden": "Not on the site",
|
|
2044
|
+
"field-trashed": "In the bin",
|
|
2045
|
+
"field-missing": "Not found",
|
|
2046
|
+
"field-full": "No more than :max can be chosen.",
|
|
2047
|
+
"field-forbidden": "You cannot see these records, so the choice cannot be changed here.",
|
|
2048
|
+
"collection-related": "Only related to",
|
|
2049
|
+
"collection-related-to": "Only related to “:target”",
|
|
2050
|
+
"collection-related-type": "Which section",
|
|
2051
|
+
"collection-related-any": "Not narrowed: every record, related or not.",
|
|
2052
|
+
"collection-related-current": "The record of the page it stands on",
|
|
2053
|
+
"collection-related-current-hint": "On the page of a record of “:target” the block shows what is related to it; on any other page it shows nothing."
|
|
1767
2054
|
}
|
|
1768
|
-
},
|
|
1769
|
-
function
|
|
1770
|
-
const t = e.manifestUrl ??
|
|
1771
|
-
for (const
|
|
1772
|
-
i.push(...
|
|
1773
|
-
if (!i.some((
|
|
1774
|
-
const
|
|
2055
|
+
}, xt = "webx.locale";
|
|
2056
|
+
function En(e = {}) {
|
|
2057
|
+
const t = e.manifestUrl ?? Ya() ?? "/api/cms/manifest", l = e.apiPath ?? t.replace(/\/manifest\/?$/, ""), n = e.basePath ?? "/cms", o = e.modules ?? [], i = [...e.routes ?? []];
|
|
2058
|
+
for (const b of o)
|
|
2059
|
+
i.push(...b.routes ?? []);
|
|
2060
|
+
if (!i.some((b) => b.path === "/")) {
|
|
2061
|
+
const b = o.find((T) => T.landing === !0);
|
|
1775
2062
|
i.push({
|
|
1776
2063
|
path: "/",
|
|
1777
2064
|
name: "webx.home",
|
|
1778
|
-
component:
|
|
1779
|
-
props: { landing:
|
|
2065
|
+
component: Ca,
|
|
2066
|
+
props: { landing: b?.path ?? b?.routes?.[0]?.path ?? null }
|
|
1780
2067
|
});
|
|
1781
2068
|
}
|
|
1782
|
-
const
|
|
1783
|
-
history:
|
|
2069
|
+
const s = Rt({
|
|
2070
|
+
history: Ut(n),
|
|
1784
2071
|
routes: i
|
|
1785
|
-
}), r =
|
|
2072
|
+
}), r = Pe({ locale: e.locale ?? Ha() }), u = Fa(), d = e.http ?? bl({
|
|
1786
2073
|
baseUrl: "",
|
|
1787
|
-
csrfUrl: `${
|
|
2074
|
+
csrfUrl: `${l}/auth/csrf-cookie`,
|
|
1788
2075
|
onUnauthenticated: () => {
|
|
1789
|
-
|
|
2076
|
+
f.setUser(null), f.state.status = "unauthenticated";
|
|
1790
2077
|
},
|
|
1791
2078
|
// Every request says which language the panel is currently showing. It decides what
|
|
1792
2079
|
// the server writes its own messages in — a 422 under a field — for anybody who has
|
|
@@ -1794,174 +2081,174 @@ function yn(e = {}) {
|
|
|
1794
2081
|
// signing in on a Russian sign-in screen lands in an English panel.
|
|
1795
2082
|
headers: () => ({ "X-Webx-Locale": r.state.locale })
|
|
1796
2083
|
});
|
|
1797
|
-
r.defaults("webx-admin",
|
|
1798
|
-
async function h(
|
|
1799
|
-
const
|
|
1800
|
-
r.load(
|
|
2084
|
+
r.defaults("webx-admin", wt);
|
|
2085
|
+
async function h(b) {
|
|
2086
|
+
const T = await d.get(`${l}/translations/${b}`);
|
|
2087
|
+
r.load(T.data.namespaces, T.data.locale, T.data.fallback), ja(T.data.locale), qa(T.data.locale, r.state.panelLocales);
|
|
1801
2088
|
}
|
|
1802
|
-
const
|
|
2089
|
+
const f = $a({
|
|
1803
2090
|
http: d,
|
|
1804
2091
|
theme: u,
|
|
1805
|
-
basePath:
|
|
1806
|
-
apiPath:
|
|
1807
|
-
modules:
|
|
2092
|
+
basePath: n,
|
|
2093
|
+
apiPath: l,
|
|
2094
|
+
modules: o,
|
|
1808
2095
|
i18n: r,
|
|
1809
2096
|
loadDictionary: h,
|
|
1810
2097
|
types: e.types,
|
|
1811
2098
|
screens: e.screens,
|
|
1812
2099
|
loadManifest: async () => (await d.get(t)).data
|
|
1813
|
-
}),
|
|
1814
|
-
|
|
1815
|
-
const c =
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
),
|
|
1820
|
-
list:
|
|
1821
|
-
() => r.state.contentLocales.map((
|
|
1822
|
-
code:
|
|
1823
|
-
label:
|
|
2100
|
+
}), v = Lt(Oa(e));
|
|
2101
|
+
v.use(Yt), Ta(v, f), cl(v, r), Pa(v, u);
|
|
2102
|
+
const c = L("");
|
|
2103
|
+
v.provide(
|
|
2104
|
+
Xt,
|
|
2105
|
+
g(() => r.state.locale)
|
|
2106
|
+
), v.provide(Gt, {
|
|
2107
|
+
list: g(
|
|
2108
|
+
() => r.state.contentLocales.map((b) => ({
|
|
2109
|
+
code: b.code,
|
|
2110
|
+
label: b.code.toUpperCase()
|
|
1824
2111
|
}))
|
|
1825
2112
|
),
|
|
1826
|
-
active:
|
|
2113
|
+
active: g({
|
|
1827
2114
|
get: () => c.value || (r.state.contentLocales[0]?.code ?? ""),
|
|
1828
|
-
set: (
|
|
1829
|
-
c.value =
|
|
2115
|
+
set: (b) => {
|
|
2116
|
+
c.value = b;
|
|
1830
2117
|
}
|
|
1831
2118
|
})
|
|
1832
2119
|
});
|
|
1833
2120
|
const x = {
|
|
1834
|
-
app:
|
|
1835
|
-
router:
|
|
1836
|
-
context:
|
|
2121
|
+
app: v,
|
|
2122
|
+
router: s,
|
|
2123
|
+
context: f,
|
|
1837
2124
|
i18n: r,
|
|
1838
2125
|
theme: u,
|
|
1839
2126
|
async mount() {
|
|
1840
2127
|
await Promise.all([p(), h(r.state.locale)]).catch(() => {
|
|
1841
|
-
}),
|
|
2128
|
+
}), v.mount(e.el ?? "#webx-app"), await f.reload();
|
|
1842
2129
|
}
|
|
1843
2130
|
};
|
|
1844
2131
|
async function p() {
|
|
1845
|
-
const
|
|
1846
|
-
r.state.panelLocales =
|
|
2132
|
+
const b = await d.get(`${l}/locales`);
|
|
2133
|
+
r.state.panelLocales = b.data.panel, r.state.contentLocales = b.data.content;
|
|
1847
2134
|
}
|
|
1848
|
-
for (const
|
|
1849
|
-
|
|
1850
|
-
return
|
|
2135
|
+
for (const b of e.plugins ?? [])
|
|
2136
|
+
b.install(x);
|
|
2137
|
+
return v.use(s), x;
|
|
1851
2138
|
}
|
|
1852
|
-
function
|
|
2139
|
+
function Oa(e) {
|
|
1853
2140
|
const t = {
|
|
1854
2141
|
// The menu is the panel's own: it is the manifest, drawn.
|
|
1855
2142
|
// The shell hands in what a choice means where it drew the menu — in the drawer it is what
|
|
1856
2143
|
// closes it, and a drawer that stays open over the section it just opened is a drawer the
|
|
1857
2144
|
// reader has to dismiss by hand.
|
|
1858
|
-
nav: (
|
|
2145
|
+
nav: (l) => ce(Wa, { collapsed: l.collapsed === !0, onSelect: l.select })
|
|
1859
2146
|
};
|
|
1860
|
-
return e.brand !== void 0 && (t.brand = () =>
|
|
2147
|
+
return e.brand !== void 0 && (t.brand = () => ce(e.brand)), e.userMenu !== void 0 && (t.user = (l) => ce(e.userMenu, { expanded: l.expanded === !0 })), { render: () => ce(Ba, null, t) };
|
|
1861
2148
|
}
|
|
1862
|
-
function
|
|
1863
|
-
const e =
|
|
2149
|
+
function Ha() {
|
|
2150
|
+
const e = Ka(xt);
|
|
1864
2151
|
return e !== null ? e : typeof document < "u" && document.documentElement.lang !== "" ? document.documentElement.lang : typeof navigator > "u" ? "en" : navigator.language;
|
|
1865
2152
|
}
|
|
1866
|
-
function
|
|
2153
|
+
function ja(e) {
|
|
1867
2154
|
try {
|
|
1868
|
-
localStorage.setItem(
|
|
2155
|
+
localStorage.setItem(xt, e);
|
|
1869
2156
|
} catch {
|
|
1870
2157
|
}
|
|
1871
2158
|
}
|
|
1872
|
-
function
|
|
2159
|
+
function Ka(e) {
|
|
1873
2160
|
try {
|
|
1874
2161
|
return localStorage.getItem(e);
|
|
1875
2162
|
} catch {
|
|
1876
2163
|
return null;
|
|
1877
2164
|
}
|
|
1878
2165
|
}
|
|
1879
|
-
function
|
|
1880
|
-
typeof document > "u" || (document.documentElement.lang = e, document.documentElement.dir = t.find((
|
|
2166
|
+
function qa(e, t) {
|
|
2167
|
+
typeof document > "u" || (document.documentElement.lang = e, document.documentElement.dir = t.find((l) => l.code === e)?.direction ?? "ltr");
|
|
1881
2168
|
}
|
|
1882
|
-
function
|
|
2169
|
+
function Ya() {
|
|
1883
2170
|
return typeof document > "u" ? null : document.querySelector('meta[name="webx-manifest"]')?.getAttribute("content") ?? null;
|
|
1884
2171
|
}
|
|
1885
|
-
function
|
|
2172
|
+
function Xa(e) {
|
|
1886
2173
|
const t = e.replace(/\r\n?/g, `
|
|
1887
2174
|
`).split(`
|
|
1888
|
-
`),
|
|
1889
|
-
let
|
|
1890
|
-
for (;
|
|
1891
|
-
const
|
|
1892
|
-
if (
|
|
1893
|
-
|
|
2175
|
+
`), l = [];
|
|
2176
|
+
let n = 0;
|
|
2177
|
+
for (; n < t.length; ) {
|
|
2178
|
+
const o = t[n] ?? "";
|
|
2179
|
+
if (o.trim() === "") {
|
|
2180
|
+
n += 1;
|
|
1894
2181
|
continue;
|
|
1895
2182
|
}
|
|
1896
|
-
if (/^```([\w-]*)\s*$/.exec(
|
|
2183
|
+
if (/^```([\w-]*)\s*$/.exec(o)) {
|
|
1897
2184
|
const u = [];
|
|
1898
|
-
for (
|
|
1899
|
-
u.push(t[
|
|
1900
|
-
|
|
2185
|
+
for (n += 1; n < t.length && !/^```\s*$/.test(t[n] ?? ""); )
|
|
2186
|
+
u.push(t[n] ?? ""), n += 1;
|
|
2187
|
+
n += 1, l.push(`<pre><code>${Ue(u.join(`
|
|
1901
2188
|
`))}</code></pre>`);
|
|
1902
2189
|
continue;
|
|
1903
2190
|
}
|
|
1904
|
-
const
|
|
1905
|
-
if (
|
|
1906
|
-
const u = Math.min(
|
|
1907
|
-
|
|
2191
|
+
const s = /^(#{1,4})\s+(.*)$/.exec(o);
|
|
2192
|
+
if (s) {
|
|
2193
|
+
const u = Math.min(s[1].length + 1, 5);
|
|
2194
|
+
l.push(`<h${u}>${Le(s[2] ?? "")}</h${u}>`), n += 1;
|
|
1908
2195
|
continue;
|
|
1909
2196
|
}
|
|
1910
|
-
if (
|
|
1911
|
-
const u = /^\s*\d+[.)]\s+/.test(
|
|
1912
|
-
for (;
|
|
1913
|
-
for (d.push((t[
|
|
1914
|
-
const
|
|
1915
|
-
if (
|
|
2197
|
+
if (he(o)) {
|
|
2198
|
+
const u = /^\s*\d+[.)]\s+/.test(o), d = [];
|
|
2199
|
+
for (; n < t.length && he(t[n] ?? ""); )
|
|
2200
|
+
for (d.push((t[n] ?? "").replace(/^\s*(?:[-*+]|\d+[.)])\s+/, "")), n += 1; n < t.length; ) {
|
|
2201
|
+
const f = t[n] ?? "";
|
|
2202
|
+
if (f.trim() === "" || he(f) || /^(#{1,4})\s/.test(f) || /^```/.test(f))
|
|
1916
2203
|
break;
|
|
1917
|
-
d[d.length - 1] += ` ${
|
|
2204
|
+
d[d.length - 1] += ` ${f.trim()}`, n += 1;
|
|
1918
2205
|
}
|
|
1919
2206
|
const h = u ? "ol" : "ul";
|
|
1920
|
-
|
|
2207
|
+
l.push(`<${h}>${d.map((f) => `<li>${Le(f)}</li>`).join("")}</${h}>`);
|
|
1921
2208
|
continue;
|
|
1922
2209
|
}
|
|
1923
2210
|
const r = [];
|
|
1924
|
-
for (;
|
|
1925
|
-
const u = t[
|
|
1926
|
-
if (u.trim() === "" ||
|
|
1927
|
-
r.push(u.trim()),
|
|
2211
|
+
for (; n < t.length; ) {
|
|
2212
|
+
const u = t[n] ?? "";
|
|
2213
|
+
if (u.trim() === "" || he(u) || /^(#{1,4})\s/.test(u) || /^```/.test(u)) break;
|
|
2214
|
+
r.push(u.trim()), n += 1;
|
|
1928
2215
|
}
|
|
1929
|
-
|
|
2216
|
+
l.push(`<p>${Le(r.join(" "))}</p>`);
|
|
1930
2217
|
}
|
|
1931
|
-
return
|
|
2218
|
+
return l.join("");
|
|
1932
2219
|
}
|
|
1933
|
-
const
|
|
1934
|
-
function
|
|
2220
|
+
const pe = "\0";
|
|
2221
|
+
function he(e) {
|
|
1935
2222
|
return /^\s*(?:[-*+]|\d+[.)])\s+/.test(e);
|
|
1936
2223
|
}
|
|
1937
|
-
function
|
|
1938
|
-
const t = [],
|
|
1939
|
-
return
|
|
2224
|
+
function Le(e) {
|
|
2225
|
+
const t = [], l = e.replace(/`([^`]+)`/g, (o, i) => (t.push(`<code>${Ue(i)}</code>`), `${pe}${t.length - 1}${pe}`));
|
|
2226
|
+
return Ue(l).replace(
|
|
1940
2227
|
/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,
|
|
1941
2228
|
'<a href="$2" target="_blank" rel="noopener">$1</a>'
|
|
1942
2229
|
).replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>").replace(
|
|
1943
|
-
new RegExp(`${
|
|
1944
|
-
(
|
|
2230
|
+
new RegExp(`${pe}(\\d+)${pe}`, "g"),
|
|
2231
|
+
(o, i) => t[Number(i)] ?? ""
|
|
1945
2232
|
);
|
|
1946
2233
|
}
|
|
1947
|
-
function
|
|
2234
|
+
function Ue(e) {
|
|
1948
2235
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
1949
2236
|
}
|
|
1950
|
-
function
|
|
1951
|
-
const t = e.scope("webx-admin"),
|
|
1952
|
-
function
|
|
2237
|
+
function Ga(e) {
|
|
2238
|
+
const t = e.scope("webx-admin"), l = /* @__PURE__ */ new Map();
|
|
2239
|
+
function n(i, s, r) {
|
|
1953
2240
|
const u = e.state.locale, d = `${u}:${i}`;
|
|
1954
|
-
let h =
|
|
1955
|
-
return h === void 0 && (h = new Intl.DateTimeFormat(u,
|
|
2241
|
+
let h = l.get(d);
|
|
2242
|
+
return h === void 0 && (h = new Intl.DateTimeFormat(u, s), l.set(d, h)), h.format(r);
|
|
1956
2243
|
}
|
|
1957
|
-
const
|
|
2244
|
+
const o = (i) => n("time", { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }, i);
|
|
1958
2245
|
return {
|
|
1959
2246
|
short(i) {
|
|
1960
|
-
const
|
|
1961
|
-
if (
|
|
2247
|
+
const s = ye(i);
|
|
2248
|
+
if (s === null)
|
|
1962
2249
|
return t("dates.never");
|
|
1963
|
-
const r = /* @__PURE__ */ new Date(), u =
|
|
1964
|
-
return u === 0 ? t("dates.today", { time: s
|
|
2250
|
+
const r = /* @__PURE__ */ new Date(), u = Qe(s, r);
|
|
2251
|
+
return u === 0 ? t("dates.today", { time: o(s) }) : u === -1 ? t("dates.yesterday", { time: o(s) }) : s.getFullYear() === r.getFullYear() ? n(
|
|
1965
2252
|
"this-year",
|
|
1966
2253
|
{
|
|
1967
2254
|
day: "numeric",
|
|
@@ -1970,123 +2257,123 @@ function zl(e) {
|
|
|
1970
2257
|
minute: "2-digit",
|
|
1971
2258
|
hourCycle: "h23"
|
|
1972
2259
|
},
|
|
1973
|
-
|
|
1974
|
-
) :
|
|
2260
|
+
s
|
|
2261
|
+
) : n("earlier", { day: "numeric", month: "long", year: "numeric" }, s);
|
|
1975
2262
|
},
|
|
1976
2263
|
compact(i) {
|
|
1977
|
-
const
|
|
1978
|
-
if (
|
|
2264
|
+
const s = ye(i);
|
|
2265
|
+
if (s === null)
|
|
1979
2266
|
return t("dates.never");
|
|
1980
2267
|
const r = /* @__PURE__ */ new Date();
|
|
1981
|
-
return
|
|
2268
|
+
return Qe(s, r) === 0 ? o(s) : s.getFullYear() === r.getFullYear() ? n("compact", { day: "numeric", month: "short" }, s) : n("compact-earlier", { dateStyle: "short" }, s);
|
|
1982
2269
|
},
|
|
1983
2270
|
exact(i) {
|
|
1984
|
-
const
|
|
1985
|
-
return
|
|
2271
|
+
const s = ye(i);
|
|
2272
|
+
return s === null ? "" : n("exact", { dateStyle: "long", timeStyle: "medium", hourCycle: "h23" }, s);
|
|
1986
2273
|
},
|
|
1987
2274
|
iso(i) {
|
|
1988
|
-
const
|
|
1989
|
-
return
|
|
2275
|
+
const s = ye(i);
|
|
2276
|
+
return s === null ? "" : s.toISOString();
|
|
1990
2277
|
}
|
|
1991
2278
|
};
|
|
1992
2279
|
}
|
|
1993
|
-
function
|
|
1994
|
-
const e =
|
|
1995
|
-
return
|
|
2280
|
+
function kt() {
|
|
2281
|
+
const e = se(Ce, null);
|
|
2282
|
+
return Ga(e ?? Ja());
|
|
1996
2283
|
}
|
|
1997
|
-
let
|
|
1998
|
-
function
|
|
1999
|
-
return
|
|
2284
|
+
let ge = null;
|
|
2285
|
+
function Ja() {
|
|
2286
|
+
return ge === null && (ge = Pe(), ge.defaults("webx-admin", wt)), ge;
|
|
2000
2287
|
}
|
|
2001
|
-
function
|
|
2288
|
+
function ye(e) {
|
|
2002
2289
|
if (e == null || e === "")
|
|
2003
2290
|
return null;
|
|
2004
2291
|
const t = e instanceof Date ? e : new Date(e);
|
|
2005
2292
|
return Number.isNaN(t.getTime()) ? null : t;
|
|
2006
2293
|
}
|
|
2007
|
-
function
|
|
2008
|
-
const
|
|
2009
|
-
return Math.round((
|
|
2294
|
+
function Qe(e, t) {
|
|
2295
|
+
const l = (n) => Date.UTC(n.getFullYear(), n.getMonth(), n.getDate());
|
|
2296
|
+
return Math.round((l(e) - l(t)) / 864e5);
|
|
2010
2297
|
}
|
|
2011
|
-
function
|
|
2012
|
-
const
|
|
2013
|
-
if (
|
|
2014
|
-
return
|
|
2015
|
-
if (
|
|
2016
|
-
if (
|
|
2017
|
-
if (
|
|
2018
|
-
if (
|
|
2019
|
-
if (
|
|
2020
|
-
const
|
|
2021
|
-
return
|
|
2298
|
+
function Qa(e, t, l) {
|
|
2299
|
+
const n = e instanceof fe ? e.status : Za(e);
|
|
2300
|
+
if (n === 422)
|
|
2301
|
+
return en(e) ?? l ?? t("errors.unknown");
|
|
2302
|
+
if (n === 401) return t("errors.signed-out");
|
|
2303
|
+
if (n === 403) return t("errors.forbidden");
|
|
2304
|
+
if (n === 404) return t("errors.gone");
|
|
2305
|
+
if (n === 409) return t("errors.conflict");
|
|
2306
|
+
if (n === 429) {
|
|
2307
|
+
const o = e instanceof fe ? e.retryAfter : null;
|
|
2308
|
+
return o === null ? t("errors.throttled") : t("errors.throttled-in", { seconds: o });
|
|
2022
2309
|
}
|
|
2023
|
-
return
|
|
2310
|
+
return n !== null && n >= 500 ? t("errors.server") : n === null ? t("errors.offline") : l ?? t("errors.unknown");
|
|
2024
2311
|
}
|
|
2025
|
-
function
|
|
2026
|
-
const e =
|
|
2027
|
-
return (t,
|
|
2312
|
+
function De() {
|
|
2313
|
+
const e = D("webx-admin");
|
|
2314
|
+
return (t, l) => Qa(t, e, l);
|
|
2028
2315
|
}
|
|
2029
|
-
function
|
|
2316
|
+
function Za(e) {
|
|
2030
2317
|
const t = e?.status;
|
|
2031
2318
|
return typeof t == "number" ? t : null;
|
|
2032
2319
|
}
|
|
2033
|
-
function
|
|
2034
|
-
const
|
|
2035
|
-
return typeof
|
|
2320
|
+
function en(e) {
|
|
2321
|
+
const l = e?.body?.message;
|
|
2322
|
+
return typeof l == "string" && l !== "" ? l : null;
|
|
2036
2323
|
}
|
|
2037
|
-
function
|
|
2038
|
-
const
|
|
2324
|
+
function tn(e, t, l) {
|
|
2325
|
+
const n = `${e.apiPath}/entities/${t}/${l}/notes`, o = (s) => `${e.apiPath}/notes/${s}`, i = (s) => s.data;
|
|
2039
2326
|
return {
|
|
2040
|
-
list: () => e.http.get(
|
|
2041
|
-
add: (
|
|
2042
|
-
save: (
|
|
2043
|
-
remove: (
|
|
2327
|
+
list: () => e.http.get(n).then(i),
|
|
2328
|
+
add: (s) => e.http.post(n, { body: s }).then(i),
|
|
2329
|
+
save: (s, r) => e.http.put(o(s), { body: r }).then(i),
|
|
2330
|
+
remove: (s) => e.http.delete(o(s)).then(() => {
|
|
2044
2331
|
})
|
|
2045
2332
|
};
|
|
2046
2333
|
}
|
|
2047
|
-
const
|
|
2048
|
-
function
|
|
2049
|
-
|
|
2334
|
+
const _t = /* @__PURE__ */ Symbol("wx-category-editor");
|
|
2335
|
+
function ln(e) {
|
|
2336
|
+
ze(_t, e);
|
|
2050
2337
|
}
|
|
2051
|
-
function
|
|
2052
|
-
return
|
|
2338
|
+
function Bn() {
|
|
2339
|
+
return se(_t, null);
|
|
2053
2340
|
}
|
|
2054
|
-
function
|
|
2341
|
+
function an(e) {
|
|
2055
2342
|
return (e.q ?? "").trim() !== "" || e.filtered ? "locked" : e.category == null ? "all" : "category";
|
|
2056
2343
|
}
|
|
2057
|
-
function
|
|
2058
|
-
const
|
|
2344
|
+
function Mn(e, t) {
|
|
2345
|
+
const l = J(), n = D("webx-admin"), o = g(() => an(t()));
|
|
2059
2346
|
return {
|
|
2060
|
-
mode:
|
|
2061
|
-
sortable:
|
|
2062
|
-
hint:
|
|
2063
|
-
move: (i) =>
|
|
2347
|
+
mode: o,
|
|
2348
|
+
sortable: g(() => o.value !== "locked"),
|
|
2349
|
+
hint: g(() => n(`categories.order-${o.value}`)),
|
|
2350
|
+
move: (i) => fl(l, e, i, o.value === "category" ? t().category ?? null : null)
|
|
2064
2351
|
};
|
|
2065
2352
|
}
|
|
2066
|
-
function
|
|
2067
|
-
const t =
|
|
2068
|
-
return (
|
|
2353
|
+
function Oe(e = {}) {
|
|
2354
|
+
const t = D("webx-admin");
|
|
2355
|
+
return (l, n) => t(e[l] ?? `webx-admin::categories.${l}`, n);
|
|
2069
2356
|
}
|
|
2070
|
-
const
|
|
2357
|
+
const nn = /* @__PURE__ */ M({
|
|
2071
2358
|
name: "WxCategoryCreateDialog",
|
|
2072
2359
|
__name: "CategoryCreateDialog",
|
|
2073
2360
|
props: {
|
|
2074
2361
|
options: {}
|
|
2075
2362
|
},
|
|
2076
2363
|
setup(e) {
|
|
2077
|
-
const t = e, { open:
|
|
2078
|
-
|
|
2079
|
-
await
|
|
2364
|
+
const t = e, { open: l, resolve: n, dismiss: o } = Jt(), i = ve(J(), t.options.api), s = Oe(t.options.words), r = L(""), u = L(!1), d = L({}), h = lt("field");
|
|
2365
|
+
Ee(async () => {
|
|
2366
|
+
await Ie(), h.value?.querySelector("input")?.focus();
|
|
2080
2367
|
});
|
|
2081
|
-
function
|
|
2368
|
+
function f(c) {
|
|
2082
2369
|
const x = Object.keys(d.value).find((p) => p === c || p.startsWith(`${c}.`));
|
|
2083
2370
|
return x === void 0 ? void 0 : d.value[x]?.[0];
|
|
2084
2371
|
}
|
|
2085
|
-
async function
|
|
2372
|
+
async function v() {
|
|
2086
2373
|
if (!(r.value.trim() === "" || u.value)) {
|
|
2087
2374
|
u.value = !0, d.value = {};
|
|
2088
2375
|
try {
|
|
2089
|
-
|
|
2376
|
+
n(await i.create({ title: r.value.trim() }));
|
|
2090
2377
|
} catch (c) {
|
|
2091
2378
|
d.value = c.body?.errors ?? {};
|
|
2092
2379
|
} finally {
|
|
@@ -2094,32 +2381,32 @@ const Pl = /* @__PURE__ */ I({
|
|
|
2094
2381
|
}
|
|
2095
2382
|
}
|
|
2096
2383
|
}
|
|
2097
|
-
return (c, x) => (
|
|
2098
|
-
open: l
|
|
2099
|
-
"onUpdate:open": x[2] || (x[2] = (p) =>
|
|
2100
|
-
title:
|
|
2384
|
+
return (c, x) => (m(), S(a(rt), {
|
|
2385
|
+
open: a(l),
|
|
2386
|
+
"onUpdate:open": x[2] || (x[2] = (p) => at(l) ? l.value = p : null),
|
|
2387
|
+
title: a(s)("new"),
|
|
2101
2388
|
width: 440
|
|
2102
2389
|
}, {
|
|
2103
2390
|
footer: y(() => [
|
|
2104
|
-
|
|
2391
|
+
w(a(Zt), { size: "sm" }, {
|
|
2105
2392
|
default: y(() => [
|
|
2106
|
-
|
|
2393
|
+
w(a(le), {
|
|
2107
2394
|
variant: "outline",
|
|
2108
|
-
onClick: x[1] || (x[1] = (p) =>
|
|
2395
|
+
onClick: x[1] || (x[1] = (p) => a(o)())
|
|
2109
2396
|
}, {
|
|
2110
2397
|
default: y(() => [
|
|
2111
|
-
|
|
2398
|
+
z(A(a(s)("cancel")), 1)
|
|
2112
2399
|
]),
|
|
2113
2400
|
_: 1
|
|
2114
2401
|
}),
|
|
2115
|
-
|
|
2402
|
+
w(a(le), {
|
|
2116
2403
|
type: "primary",
|
|
2117
2404
|
loading: u.value,
|
|
2118
2405
|
disabled: r.value.trim() === "",
|
|
2119
|
-
onClick:
|
|
2406
|
+
onClick: v
|
|
2120
2407
|
}, {
|
|
2121
2408
|
default: y(() => [
|
|
2122
|
-
|
|
2409
|
+
z(A(a(s)("create")), 1)
|
|
2123
2410
|
]),
|
|
2124
2411
|
_: 1
|
|
2125
2412
|
}, 8, ["loading", "disabled"])
|
|
@@ -2128,9 +2415,9 @@ const Pl = /* @__PURE__ */ I({
|
|
|
2128
2415
|
})
|
|
2129
2416
|
]),
|
|
2130
2417
|
default: y(() => [
|
|
2131
|
-
|
|
2132
|
-
label:
|
|
2133
|
-
error:
|
|
2418
|
+
w(a(Qt), {
|
|
2419
|
+
label: a(s)("field-title"),
|
|
2420
|
+
error: f("title") ?? f("slug"),
|
|
2134
2421
|
required: ""
|
|
2135
2422
|
}, {
|
|
2136
2423
|
default: y(() => [
|
|
@@ -2138,11 +2425,11 @@ const Pl = /* @__PURE__ */ I({
|
|
|
2138
2425
|
ref_key: "field",
|
|
2139
2426
|
ref: h
|
|
2140
2427
|
}, [
|
|
2141
|
-
|
|
2428
|
+
w(a(Te), {
|
|
2142
2429
|
modelValue: r.value,
|
|
2143
2430
|
"onUpdate:modelValue": x[0] || (x[0] = (p) => r.value = p),
|
|
2144
|
-
"aria-label":
|
|
2145
|
-
onKeyup:
|
|
2431
|
+
"aria-label": a(s)("field-title"),
|
|
2432
|
+
onKeyup: nt(v, ["enter"])
|
|
2146
2433
|
}, null, 8, ["modelValue", "aria-label"])
|
|
2147
2434
|
], 512)
|
|
2148
2435
|
]),
|
|
@@ -2152,136 +2439,136 @@ const Pl = /* @__PURE__ */ I({
|
|
|
2152
2439
|
_: 1
|
|
2153
2440
|
}, 8, ["open", "title"]));
|
|
2154
2441
|
}
|
|
2155
|
-
}),
|
|
2442
|
+
}), on = { class: "wx-category-row__name" }, sn = /* @__PURE__ */ M({
|
|
2156
2443
|
name: "WxCategoriesPage",
|
|
2157
2444
|
__name: "CategoriesPage",
|
|
2158
2445
|
props: {
|
|
2159
2446
|
options: {}
|
|
2160
2447
|
},
|
|
2161
2448
|
setup(e) {
|
|
2162
|
-
const t = e,
|
|
2163
|
-
() =>
|
|
2164
|
-
),
|
|
2449
|
+
const t = e, l = J(), n = ve(l, t.options.api), o = _e(), i = Oe(t.options.words), s = De(), r = L([]), u = L(!0), d = L(!0), h = g(() => l.can(t.options.manage)), f = g(
|
|
2450
|
+
() => l.state.manifest?.modules.find((V) => V.id === t.options.module)?.title ?? ""
|
|
2451
|
+
), v = el(nn), c = g(
|
|
2165
2452
|
() => h.value ? [{ key: "new", label: i("new"), icon: "plus", primary: !0, run: () => {
|
|
2166
|
-
|
|
2453
|
+
T();
|
|
2167
2454
|
} }] : []
|
|
2168
2455
|
);
|
|
2169
|
-
function x(
|
|
2170
|
-
return Number(
|
|
2456
|
+
function x(V) {
|
|
2457
|
+
return Number(V[t.options.count] ?? 0);
|
|
2171
2458
|
}
|
|
2172
2459
|
async function p() {
|
|
2173
2460
|
u.value = !0;
|
|
2174
2461
|
try {
|
|
2175
|
-
const
|
|
2176
|
-
r.value =
|
|
2177
|
-
} catch (
|
|
2178
|
-
|
|
2462
|
+
const V = await n.list();
|
|
2463
|
+
r.value = V.data, d.value = V.prefix !== null;
|
|
2464
|
+
} catch (V) {
|
|
2465
|
+
K.danger(s(V));
|
|
2179
2466
|
} finally {
|
|
2180
2467
|
u.value = !1;
|
|
2181
2468
|
}
|
|
2182
2469
|
}
|
|
2183
2470
|
p();
|
|
2184
|
-
function
|
|
2185
|
-
|
|
2471
|
+
function b(V) {
|
|
2472
|
+
o.push(`${t.options.path}/${V.id}`);
|
|
2186
2473
|
}
|
|
2187
|
-
async function
|
|
2188
|
-
const
|
|
2189
|
-
|
|
2474
|
+
async function T() {
|
|
2475
|
+
const V = await v({ options: t.options });
|
|
2476
|
+
V !== void 0 && b(V);
|
|
2190
2477
|
}
|
|
2191
|
-
async function
|
|
2192
|
-
if (x(
|
|
2193
|
-
|
|
2478
|
+
async function F(V) {
|
|
2479
|
+
if (x(V) > 0) {
|
|
2480
|
+
K.warning(i("delete-blocked"));
|
|
2194
2481
|
return;
|
|
2195
2482
|
}
|
|
2196
|
-
if (await
|
|
2197
|
-
title: i("delete-title", { name:
|
|
2483
|
+
if (await xe({
|
|
2484
|
+
title: i("delete-title", { name: V.name }),
|
|
2198
2485
|
message: i("delete-text"),
|
|
2199
2486
|
confirmText: i("delete"),
|
|
2200
2487
|
cancelText: i("cancel"),
|
|
2201
2488
|
tone: "danger"
|
|
2202
2489
|
}))
|
|
2203
2490
|
try {
|
|
2204
|
-
await
|
|
2205
|
-
} catch (
|
|
2206
|
-
|
|
2491
|
+
await n.remove(V.id), K.success(i("deleted")), await p();
|
|
2492
|
+
} catch (C) {
|
|
2493
|
+
K.danger(s(C));
|
|
2207
2494
|
}
|
|
2208
2495
|
}
|
|
2209
|
-
function
|
|
2210
|
-
const
|
|
2211
|
-
return
|
|
2496
|
+
function Q(V) {
|
|
2497
|
+
const k = [{ key: "edit", label: i("edit"), icon: "edit", run: () => b(V) }], C = t.options.items;
|
|
2498
|
+
return C && x(V) > 0 && k.push({
|
|
2212
2499
|
key: "items",
|
|
2213
2500
|
label: i("show-items"),
|
|
2214
2501
|
icon: "file-txt",
|
|
2215
2502
|
run: () => {
|
|
2216
|
-
|
|
2503
|
+
o.push(C(V.id));
|
|
2217
2504
|
}
|
|
2218
|
-
}),
|
|
2505
|
+
}), V.url && V.is_visible && k.push({ key: "site", label: i("open-on-site"), icon: "link", href: V.url }), h.value && k.push({
|
|
2219
2506
|
key: "delete",
|
|
2220
2507
|
label: i("delete"),
|
|
2221
2508
|
icon: "trash",
|
|
2222
2509
|
danger: !0,
|
|
2223
2510
|
run: () => {
|
|
2224
|
-
|
|
2511
|
+
F(V);
|
|
2225
2512
|
}
|
|
2226
|
-
}),
|
|
2513
|
+
}), k;
|
|
2227
2514
|
}
|
|
2228
|
-
async function
|
|
2515
|
+
async function H() {
|
|
2229
2516
|
try {
|
|
2230
|
-
await
|
|
2231
|
-
} catch (
|
|
2232
|
-
|
|
2517
|
+
await n.reorder(r.value.map((V) => V.id));
|
|
2518
|
+
} catch (V) {
|
|
2519
|
+
K.danger(s(V, i("reorder-failed"))), await p();
|
|
2233
2520
|
}
|
|
2234
2521
|
}
|
|
2235
|
-
return (
|
|
2236
|
-
const
|
|
2237
|
-
return
|
|
2522
|
+
return (V, k) => {
|
|
2523
|
+
const C = X("router-link");
|
|
2524
|
+
return m(), S(ht, {
|
|
2238
2525
|
class: "wx-categories",
|
|
2239
|
-
title:
|
|
2526
|
+
title: f.value,
|
|
2240
2527
|
actions: c.value,
|
|
2241
2528
|
padding: "sm"
|
|
2242
2529
|
}, {
|
|
2243
2530
|
default: y(() => [
|
|
2244
|
-
u.value ? (
|
|
2531
|
+
u.value ? (m(), S(a(me), {
|
|
2245
2532
|
key: 0,
|
|
2246
2533
|
class: "wx-categories__loading",
|
|
2247
2534
|
rows: 5
|
|
2248
|
-
})) : r.value.length === 0 ? (
|
|
2535
|
+
})) : r.value.length === 0 ? (m(), S(a(ut), {
|
|
2249
2536
|
key: 1,
|
|
2250
|
-
title:
|
|
2251
|
-
description:
|
|
2252
|
-
}, null, 8, ["title", "description"])) : (
|
|
2253
|
-
|
|
2537
|
+
title: a(i)("empty"),
|
|
2538
|
+
description: a(i)("empty-help")
|
|
2539
|
+
}, null, 8, ["title", "description"])) : (m(), $(j, { key: 2 }, [
|
|
2540
|
+
w(a(Be), {
|
|
2254
2541
|
modelValue: r.value,
|
|
2255
|
-
"onUpdate:modelValue":
|
|
2542
|
+
"onUpdate:modelValue": k[0] || (k[0] = (_) => r.value = _),
|
|
2256
2543
|
class: "wx-categories__list",
|
|
2257
2544
|
plain: "",
|
|
2258
2545
|
"item-key": "id",
|
|
2259
|
-
"item-label": (
|
|
2546
|
+
"item-label": (_) => _.name,
|
|
2260
2547
|
disabled: !h.value,
|
|
2261
|
-
onMove:
|
|
2548
|
+
onMove: H
|
|
2262
2549
|
}, {
|
|
2263
|
-
default: y(({ item:
|
|
2264
|
-
|
|
2265
|
-
class:
|
|
2266
|
-
to: `${t.options.path}/${
|
|
2550
|
+
default: y(({ item: _ }) => [
|
|
2551
|
+
w(C, {
|
|
2552
|
+
class: oe(["wx-category-row", { "is-hidden": !_.is_visible }]),
|
|
2553
|
+
to: `${t.options.path}/${_.id}`
|
|
2267
2554
|
}, {
|
|
2268
2555
|
default: y(() => [
|
|
2269
|
-
B("span",
|
|
2270
|
-
|
|
2556
|
+
B("span", on, [
|
|
2557
|
+
w(a(ee), {
|
|
2271
2558
|
truncate: "",
|
|
2272
2559
|
weight: "medium"
|
|
2273
2560
|
}, {
|
|
2274
2561
|
default: y(() => [
|
|
2275
|
-
|
|
2562
|
+
z(A(_.name), 1)
|
|
2276
2563
|
]),
|
|
2277
2564
|
_: 2
|
|
2278
2565
|
}, 1024),
|
|
2279
|
-
|
|
2566
|
+
_.is_visible ? N("", !0) : (m(), S(a(dt), {
|
|
2280
2567
|
key: 0,
|
|
2281
|
-
content:
|
|
2568
|
+
content: a(i)("hidden")
|
|
2282
2569
|
}, {
|
|
2283
2570
|
default: y(() => [
|
|
2284
|
-
|
|
2571
|
+
w(a(Me), {
|
|
2285
2572
|
name: "eye-off",
|
|
2286
2573
|
size: "sm"
|
|
2287
2574
|
})
|
|
@@ -2289,14 +2576,14 @@ const Pl = /* @__PURE__ */ I({
|
|
|
2289
2576
|
_: 1
|
|
2290
2577
|
}, 8, ["content"]))
|
|
2291
2578
|
]),
|
|
2292
|
-
d.value ? (
|
|
2579
|
+
d.value ? (m(), S(a(ee), {
|
|
2293
2580
|
key: 0,
|
|
2294
2581
|
size: "sm",
|
|
2295
2582
|
tone: "muted",
|
|
2296
2583
|
truncate: ""
|
|
2297
2584
|
}, {
|
|
2298
2585
|
default: y(() => [
|
|
2299
|
-
|
|
2586
|
+
z(A(_.path === null ? a(i)("no-address") : `/${_.path}`), 1)
|
|
2300
2587
|
]),
|
|
2301
2588
|
_: 2
|
|
2302
2589
|
}, 1024)) : N("", !0)
|
|
@@ -2304,28 +2591,28 @@ const Pl = /* @__PURE__ */ I({
|
|
|
2304
2591
|
_: 2
|
|
2305
2592
|
}, 1032, ["class", "to"])
|
|
2306
2593
|
]),
|
|
2307
|
-
actions: y(({ item:
|
|
2308
|
-
|
|
2594
|
+
actions: y(({ item: _ }) => [
|
|
2595
|
+
w(a(ee), {
|
|
2309
2596
|
class: "wx-category-row__count",
|
|
2310
2597
|
size: "sm",
|
|
2311
2598
|
tone: "muted"
|
|
2312
2599
|
}, {
|
|
2313
2600
|
default: y(() => [
|
|
2314
|
-
|
|
2601
|
+
z(A(a(i)("count", { count: x(_) })), 1)
|
|
2315
2602
|
]),
|
|
2316
2603
|
_: 2
|
|
2317
2604
|
}, 1024),
|
|
2318
|
-
|
|
2319
|
-
actions:
|
|
2320
|
-
label:
|
|
2605
|
+
w(Fe, {
|
|
2606
|
+
actions: Q(_),
|
|
2607
|
+
label: _.name
|
|
2321
2608
|
}, null, 8, ["actions", "label"])
|
|
2322
2609
|
]),
|
|
2323
2610
|
_: 1
|
|
2324
2611
|
}, 8, ["modelValue", "item-label", "disabled"]),
|
|
2325
|
-
|
|
2612
|
+
w(a(Se), {
|
|
2326
2613
|
class: "wx-categories__note",
|
|
2327
2614
|
type: "info",
|
|
2328
|
-
description:
|
|
2615
|
+
description: a(i)("order")
|
|
2329
2616
|
}, null, 8, ["description"])
|
|
2330
2617
|
], 64))
|
|
2331
2618
|
]),
|
|
@@ -2333,45 +2620,45 @@ const Pl = /* @__PURE__ */ I({
|
|
|
2333
2620
|
}, 8, ["title", "actions"]);
|
|
2334
2621
|
};
|
|
2335
2622
|
}
|
|
2336
|
-
}),
|
|
2623
|
+
}), rn = {
|
|
2337
2624
|
class: "wx-save-state",
|
|
2338
2625
|
role: "status",
|
|
2339
2626
|
"aria-live": "polite"
|
|
2340
|
-
},
|
|
2627
|
+
}, un = /* @__PURE__ */ M({
|
|
2341
2628
|
__name: "SaveState",
|
|
2342
2629
|
props: {
|
|
2343
2630
|
state: {},
|
|
2344
2631
|
linger: { default: 2e3 }
|
|
2345
2632
|
},
|
|
2346
2633
|
setup(e) {
|
|
2347
|
-
const t = e,
|
|
2348
|
-
let
|
|
2349
|
-
|
|
2634
|
+
const t = e, l = D("webx-admin"), n = L(!1);
|
|
2635
|
+
let o = null;
|
|
2636
|
+
te(
|
|
2350
2637
|
() => t.state,
|
|
2351
|
-
(
|
|
2352
|
-
|
|
2353
|
-
|
|
2638
|
+
(s, r) => {
|
|
2639
|
+
o !== null && clearTimeout(o), n.value = r === "saving" && s === "saved", n.value && (o = window.setTimeout(() => {
|
|
2640
|
+
n.value = !1, o = null;
|
|
2354
2641
|
}, t.linger));
|
|
2355
2642
|
}
|
|
2356
2643
|
);
|
|
2357
|
-
const i =
|
|
2358
|
-
() => t.state === "saving" ? "saving" :
|
|
2644
|
+
const i = g(
|
|
2645
|
+
() => t.state === "saving" ? "saving" : n.value ? "saved" : null
|
|
2359
2646
|
);
|
|
2360
|
-
return
|
|
2361
|
-
|
|
2362
|
-
}), (
|
|
2363
|
-
i.value ? (
|
|
2647
|
+
return ot(() => {
|
|
2648
|
+
o !== null && clearTimeout(o);
|
|
2649
|
+
}), (s, r) => (m(), $("span", rn, [
|
|
2650
|
+
i.value ? (m(), S(a(Me), {
|
|
2364
2651
|
key: 0,
|
|
2365
|
-
class:
|
|
2652
|
+
class: oe(["wx-save-state__mark", { "is-saved": i.value === "saved" }]),
|
|
2366
2653
|
name: i.value === "saving" ? "loader" : "check",
|
|
2367
2654
|
spin: i.value === "saving",
|
|
2368
|
-
label: l
|
|
2655
|
+
label: a(l)(`editor.${i.value}`)
|
|
2369
2656
|
}, null, 8, ["class", "name", "spin", "label"])) : N("", !0)
|
|
2370
2657
|
]));
|
|
2371
2658
|
}
|
|
2372
|
-
}),
|
|
2659
|
+
}), dn = /* @__PURE__ */ G(un, [["__scopeId", "data-v-216e5e44"]]), cn = { class: "wx-screen-host" }, mn = /* @__PURE__ */ M({
|
|
2373
2660
|
__name: "Screen",
|
|
2374
|
-
props: /* @__PURE__ */
|
|
2661
|
+
props: /* @__PURE__ */ ne({
|
|
2375
2662
|
name: {},
|
|
2376
2663
|
errors: { default: void 0 },
|
|
2377
2664
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -2382,39 +2669,39 @@ const Pl = /* @__PURE__ */ I({
|
|
|
2382
2669
|
modelValue: { default: () => ({}) },
|
|
2383
2670
|
modelModifiers: {}
|
|
2384
2671
|
}),
|
|
2385
|
-
emits: /* @__PURE__ */
|
|
2386
|
-
setup(e, { expose: t, emit:
|
|
2387
|
-
const
|
|
2672
|
+
emits: /* @__PURE__ */ ne(["loaded"], ["update:modelValue"]),
|
|
2673
|
+
setup(e, { expose: t, emit: l }) {
|
|
2674
|
+
const n = e, o = l, i = re(e, "modelValue"), s = J(), r = D("webx-admin"), u = L(null), d = L(null);
|
|
2388
2675
|
async function h() {
|
|
2389
2676
|
u.value = null, d.value = null;
|
|
2390
2677
|
try {
|
|
2391
|
-
const
|
|
2392
|
-
u.value =
|
|
2393
|
-
} catch (
|
|
2394
|
-
d.value =
|
|
2678
|
+
const f = await s.loadScreen(n.name);
|
|
2679
|
+
u.value = f, o("loaded", f);
|
|
2680
|
+
} catch (f) {
|
|
2681
|
+
d.value = f instanceof Error ? f.message : String(f);
|
|
2395
2682
|
}
|
|
2396
2683
|
}
|
|
2397
|
-
return
|
|
2684
|
+
return te([() => n.name, () => s.i18n.state.locale], () => {
|
|
2398
2685
|
h();
|
|
2399
|
-
}, { immediate: !0 }), t({ reload: h }), (
|
|
2400
|
-
d.value ? (
|
|
2686
|
+
}, { immediate: !0 }), t({ reload: h }), (f, v) => (m(), $("div", cn, [
|
|
2687
|
+
d.value ? (m(), S(a(Se), {
|
|
2401
2688
|
key: 0,
|
|
2402
2689
|
type: "danger",
|
|
2403
|
-
title:
|
|
2690
|
+
title: a(r)("shell.error-title"),
|
|
2404
2691
|
description: d.value
|
|
2405
|
-
}, null, 8, ["title", "description"])) : u.value === null ? (
|
|
2692
|
+
}, null, 8, ["title", "description"])) : u.value === null ? (m(), S(a(me), {
|
|
2406
2693
|
key: 1,
|
|
2407
2694
|
rows: 4
|
|
2408
|
-
})) : (
|
|
2695
|
+
})) : (m(), S(a(ul), {
|
|
2409
2696
|
key: 2,
|
|
2410
2697
|
modelValue: i.value,
|
|
2411
|
-
"onUpdate:modelValue":
|
|
2698
|
+
"onUpdate:modelValue": v[0] || (v[0] = (c) => i.value = c),
|
|
2412
2699
|
root: u.value,
|
|
2413
|
-
patch:
|
|
2414
|
-
types:
|
|
2700
|
+
patch: a(s).screenPatch(e.name),
|
|
2701
|
+
types: a(s).types,
|
|
2415
2702
|
errors: e.errors,
|
|
2416
|
-
translate:
|
|
2417
|
-
can:
|
|
2703
|
+
translate: a(s).i18n.t,
|
|
2704
|
+
can: a(s).can,
|
|
2418
2705
|
disabled: e.disabled,
|
|
2419
2706
|
"label-position": e.labelPosition,
|
|
2420
2707
|
"label-width": e.labelWidth,
|
|
@@ -2422,141 +2709,141 @@ const Pl = /* @__PURE__ */ I({
|
|
|
2422
2709
|
}, null, 8, ["modelValue", "root", "patch", "types", "errors", "translate", "can", "disabled", "label-position", "label-width", "size"]))
|
|
2423
2710
|
]));
|
|
2424
2711
|
}
|
|
2425
|
-
}),
|
|
2712
|
+
}), fn = /* @__PURE__ */ M({
|
|
2426
2713
|
name: "WxCategoryEditorPage",
|
|
2427
2714
|
__name: "CategoryEditorPage",
|
|
2428
2715
|
props: {
|
|
2429
2716
|
options: {}
|
|
2430
2717
|
},
|
|
2431
2718
|
setup(e) {
|
|
2432
|
-
const t = e,
|
|
2433
|
-
() =>
|
|
2434
|
-
),
|
|
2435
|
-
const
|
|
2436
|
-
return
|
|
2719
|
+
const t = e, l = J(), n = ve(l, t.options.api), o = st(), i = _e(), s = it(), r = Oe(t.options.words), u = De(), d = g(() => Number(o.params.id)), h = g(() => t.options.path), f = L(null), v = L({}), c = L(null), x = L(""), p = L(!0), b = L(!1), T = L({}), F = g(() => l.can(t.options.manage)), Q = g(() => JSON.stringify(v.value)), H = g(() => x.value !== "" && Q.value !== x.value), V = g(() => b.value ? "saving" : H.value ? "unsaved" : "saved"), k = g(
|
|
2720
|
+
() => l.state.manifest?.modules.find((E) => E.id === t.options.module)?.title ?? ""
|
|
2721
|
+
), C = g(() => {
|
|
2722
|
+
const E = v.value.title;
|
|
2723
|
+
return tl(E, s.active.value, f.value?.name ?? "") || r("untitled");
|
|
2437
2724
|
});
|
|
2438
|
-
|
|
2439
|
-
values:
|
|
2725
|
+
ln({ category: f, values: v, prefix: c, moving: () => r("address-moving") }), ya({
|
|
2726
|
+
values: v,
|
|
2440
2727
|
prefix: c,
|
|
2441
|
-
path:
|
|
2728
|
+
path: g(() => f.value?.path),
|
|
2442
2729
|
moving: () => r("address-moving")
|
|
2443
2730
|
});
|
|
2444
|
-
function
|
|
2445
|
-
|
|
2731
|
+
function _(E) {
|
|
2732
|
+
f.value = E.category, v.value = E.values, c.value = E.prefix, x.value = JSON.stringify(E.values);
|
|
2446
2733
|
}
|
|
2447
|
-
async function
|
|
2734
|
+
async function q() {
|
|
2448
2735
|
p.value = !0;
|
|
2449
2736
|
try {
|
|
2450
|
-
|
|
2451
|
-
} catch (
|
|
2452
|
-
|
|
2737
|
+
_(await n.get(d.value));
|
|
2738
|
+
} catch (E) {
|
|
2739
|
+
K.danger(u(E)), i.push(h.value);
|
|
2453
2740
|
} finally {
|
|
2454
2741
|
p.value = !1;
|
|
2455
2742
|
}
|
|
2456
2743
|
}
|
|
2457
|
-
async function
|
|
2458
|
-
if (!(!
|
|
2459
|
-
|
|
2744
|
+
async function R() {
|
|
2745
|
+
if (!(!f.value || b.value || !F.value)) {
|
|
2746
|
+
b.value = !0, T.value = {};
|
|
2460
2747
|
try {
|
|
2461
|
-
|
|
2462
|
-
} catch (
|
|
2463
|
-
const
|
|
2464
|
-
|
|
2748
|
+
_(await n.save(f.value.id, v.value)), K.success(r("saved"));
|
|
2749
|
+
} catch (E) {
|
|
2750
|
+
const Z = E.body;
|
|
2751
|
+
Z?.errors ? (T.value = Z.errors, K.danger(r("save-failed"))) : K.danger(u(E));
|
|
2465
2752
|
} finally {
|
|
2466
|
-
|
|
2753
|
+
b.value = !1;
|
|
2467
2754
|
}
|
|
2468
2755
|
}
|
|
2469
2756
|
}
|
|
2470
|
-
async function
|
|
2471
|
-
const
|
|
2472
|
-
if (!(!
|
|
2473
|
-
title: r("delete-title", { name:
|
|
2757
|
+
async function U() {
|
|
2758
|
+
const E = f.value;
|
|
2759
|
+
if (!(!E || !await xe({
|
|
2760
|
+
title: r("delete-title", { name: E.name }),
|
|
2474
2761
|
message: r("delete-text"),
|
|
2475
2762
|
confirmText: r("delete"),
|
|
2476
2763
|
cancelText: r("cancel"),
|
|
2477
2764
|
tone: "danger"
|
|
2478
2765
|
})))
|
|
2479
2766
|
try {
|
|
2480
|
-
await
|
|
2481
|
-
} catch (
|
|
2482
|
-
|
|
2767
|
+
await n.remove(E.id), K.success(r("deleted")), x.value = Q.value, i.push(h.value);
|
|
2768
|
+
} catch (W) {
|
|
2769
|
+
K.danger(u(W));
|
|
2483
2770
|
}
|
|
2484
2771
|
}
|
|
2485
|
-
function
|
|
2486
|
-
|
|
2772
|
+
function I(E) {
|
|
2773
|
+
H.value && E.preventDefault();
|
|
2487
2774
|
}
|
|
2488
|
-
function
|
|
2489
|
-
(
|
|
2775
|
+
function de(E) {
|
|
2776
|
+
(E.ctrlKey || E.metaKey) && E.key.toLowerCase() === "s" && (E.preventDefault(), H.value && R());
|
|
2490
2777
|
}
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
}),
|
|
2494
|
-
|
|
2495
|
-
}),
|
|
2496
|
-
window.removeEventListener("beforeunload",
|
|
2497
|
-
}), zt(async () => !
|
|
2778
|
+
te(d, () => {
|
|
2779
|
+
q();
|
|
2780
|
+
}), Ee(() => {
|
|
2781
|
+
q(), window.addEventListener("beforeunload", I);
|
|
2782
|
+
}), ot(() => {
|
|
2783
|
+
window.removeEventListener("beforeunload", I);
|
|
2784
|
+
}), zt(async () => !H.value || !F.value ? !0 : await xe({
|
|
2498
2785
|
title: r("leave-title"),
|
|
2499
2786
|
message: r("leave-text"),
|
|
2500
2787
|
confirmText: r("leave"),
|
|
2501
2788
|
cancelText: r("cancel"),
|
|
2502
2789
|
tone: "danger"
|
|
2503
2790
|
}));
|
|
2504
|
-
const
|
|
2505
|
-
const
|
|
2506
|
-
return
|
|
2791
|
+
const ie = g(() => {
|
|
2792
|
+
const E = f.value, Z = [];
|
|
2793
|
+
return E && (E.url && E.is_visible && Z.push({ key: "site", label: r("open-on-site"), icon: "link", href: E.url }), F.value && Z.push({
|
|
2507
2794
|
key: "delete",
|
|
2508
2795
|
label: r("delete"),
|
|
2509
2796
|
icon: "trash",
|
|
2510
2797
|
danger: !0,
|
|
2511
2798
|
menu: !0,
|
|
2512
2799
|
run: () => {
|
|
2513
|
-
|
|
2800
|
+
U();
|
|
2514
2801
|
}
|
|
2515
|
-
})),
|
|
2802
|
+
})), Z;
|
|
2516
2803
|
});
|
|
2517
|
-
return (
|
|
2804
|
+
return (E, Z) => (m(), $("div", {
|
|
2518
2805
|
class: "wx-category-editor",
|
|
2519
|
-
onKeydown:
|
|
2806
|
+
onKeydown: de
|
|
2520
2807
|
}, [
|
|
2521
|
-
p.value || !
|
|
2522
|
-
|
|
2808
|
+
p.value || !f.value ? (m(), $(j, { key: 0 }, [
|
|
2809
|
+
w(a(me), {
|
|
2523
2810
|
class: "wx-category-editor__ghost",
|
|
2524
2811
|
title: "",
|
|
2525
2812
|
rows: 1
|
|
2526
2813
|
}),
|
|
2527
|
-
|
|
2814
|
+
w(a(Re), null, {
|
|
2528
2815
|
default: y(() => [
|
|
2529
|
-
|
|
2816
|
+
w(a(me), { rows: 6 })
|
|
2530
2817
|
]),
|
|
2531
2818
|
_: 1
|
|
2532
2819
|
})
|
|
2533
|
-
], 64)) : (
|
|
2534
|
-
|
|
2820
|
+
], 64)) : (m(), $(j, { key: 1 }, [
|
|
2821
|
+
w(pt, {
|
|
2535
2822
|
divider: "",
|
|
2536
2823
|
back: h.value,
|
|
2537
|
-
"back-label":
|
|
2538
|
-
title:
|
|
2539
|
-
subtitle:
|
|
2540
|
-
actions:
|
|
2541
|
-
},
|
|
2824
|
+
"back-label": k.value,
|
|
2825
|
+
title: C.value,
|
|
2826
|
+
subtitle: f.value.path === null ? void 0 : `/${f.value.path}`,
|
|
2827
|
+
actions: ie.value
|
|
2828
|
+
}, ke({
|
|
2542
2829
|
trail: y(() => [
|
|
2543
|
-
|
|
2830
|
+
w(a(ll), {
|
|
2544
2831
|
size: "sm",
|
|
2545
|
-
label:
|
|
2832
|
+
label: a(r)("trail")
|
|
2546
2833
|
}, {
|
|
2547
2834
|
default: y(() => [
|
|
2548
|
-
|
|
2835
|
+
w(a(je), {
|
|
2549
2836
|
as: "router-link",
|
|
2550
2837
|
to: h.value
|
|
2551
2838
|
}, {
|
|
2552
2839
|
default: y(() => [
|
|
2553
|
-
|
|
2840
|
+
z(A(k.value), 1)
|
|
2554
2841
|
]),
|
|
2555
2842
|
_: 1
|
|
2556
2843
|
}, 8, ["to"]),
|
|
2557
|
-
|
|
2844
|
+
w(a(je), { current: "" }, {
|
|
2558
2845
|
default: y(() => [
|
|
2559
|
-
|
|
2846
|
+
z(A(C.value), 1)
|
|
2560
2847
|
]),
|
|
2561
2848
|
_: 1
|
|
2562
2849
|
})
|
|
@@ -2566,12 +2853,12 @@ const Pl = /* @__PURE__ */ I({
|
|
|
2566
2853
|
]),
|
|
2567
2854
|
_: 2
|
|
2568
2855
|
}, [
|
|
2569
|
-
|
|
2856
|
+
f.value.is_visible ? void 0 : {
|
|
2570
2857
|
name: "title-after",
|
|
2571
2858
|
fn: y(() => [
|
|
2572
|
-
|
|
2859
|
+
w(a($e), { dot: "" }, {
|
|
2573
2860
|
default: y(() => [
|
|
2574
|
-
|
|
2861
|
+
z(A(a(r)("hidden")), 1)
|
|
2575
2862
|
]),
|
|
2576
2863
|
_: 1
|
|
2577
2864
|
})
|
|
@@ -2579,26 +2866,26 @@ const Pl = /* @__PURE__ */ I({
|
|
|
2579
2866
|
key: "0"
|
|
2580
2867
|
}
|
|
2581
2868
|
]), 1032, ["back", "back-label", "title", "subtitle", "actions"]),
|
|
2582
|
-
|
|
2583
|
-
modelValue:
|
|
2584
|
-
"onUpdate:modelValue":
|
|
2869
|
+
w(mn, {
|
|
2870
|
+
modelValue: v.value,
|
|
2871
|
+
"onUpdate:modelValue": Z[0] || (Z[0] = (W) => v.value = W),
|
|
2585
2872
|
name: t.options.screen,
|
|
2586
|
-
errors:
|
|
2587
|
-
disabled: !
|
|
2873
|
+
errors: T.value,
|
|
2874
|
+
disabled: !F.value || b.value
|
|
2588
2875
|
}, null, 8, ["modelValue", "name", "errors", "disabled"]),
|
|
2589
|
-
|
|
2876
|
+
F.value ? (m(), S(a(al), { key: 0 }, {
|
|
2590
2877
|
state: y(() => [
|
|
2591
|
-
|
|
2878
|
+
w(dn, { state: V.value }, null, 8, ["state"])
|
|
2592
2879
|
]),
|
|
2593
2880
|
default: y(() => [
|
|
2594
|
-
|
|
2881
|
+
w(a(le), {
|
|
2595
2882
|
type: "primary",
|
|
2596
|
-
loading:
|
|
2597
|
-
disabled: !
|
|
2598
|
-
onClick:
|
|
2883
|
+
loading: b.value,
|
|
2884
|
+
disabled: !H.value,
|
|
2885
|
+
onClick: R
|
|
2599
2886
|
}, {
|
|
2600
2887
|
default: y(() => [
|
|
2601
|
-
|
|
2888
|
+
z(A(a(r)("save")), 1)
|
|
2602
2889
|
]),
|
|
2603
2890
|
_: 1
|
|
2604
2891
|
}, 8, ["loading", "disabled"])
|
|
@@ -2608,44 +2895,44 @@ const Pl = /* @__PURE__ */ I({
|
|
|
2608
2895
|
], 64))
|
|
2609
2896
|
], 32));
|
|
2610
2897
|
}
|
|
2611
|
-
}),
|
|
2612
|
-
function
|
|
2613
|
-
return
|
|
2898
|
+
}), vn = /* @__PURE__ */ G(fn, [["__scopeId", "data-v-86d85f8c"]]);
|
|
2899
|
+
function Ze(e, t) {
|
|
2900
|
+
return M({
|
|
2614
2901
|
name: "WxCategoriesView",
|
|
2615
|
-
setup: () => () =>
|
|
2902
|
+
setup: () => () => ce(e, { options: t })
|
|
2616
2903
|
});
|
|
2617
2904
|
}
|
|
2618
|
-
function
|
|
2905
|
+
function Pn(e) {
|
|
2619
2906
|
return [
|
|
2620
|
-
{ path: e.path, name: e.name, component:
|
|
2907
|
+
{ path: e.path, name: e.name, component: Ze(sn, e) },
|
|
2621
2908
|
{
|
|
2622
2909
|
path: `${e.path}/:id(\\d+)`,
|
|
2623
2910
|
name: `${e.name}.edit`,
|
|
2624
|
-
component:
|
|
2911
|
+
component: Ze(vn, e)
|
|
2625
2912
|
}
|
|
2626
2913
|
];
|
|
2627
2914
|
}
|
|
2628
|
-
const
|
|
2915
|
+
const Fn = 76, Dn = /* @__PURE__ */ M({
|
|
2629
2916
|
__name: "FilterChips",
|
|
2630
2917
|
props: {
|
|
2631
2918
|
filters: {}
|
|
2632
2919
|
},
|
|
2633
2920
|
setup(e) {
|
|
2634
|
-
return (t,
|
|
2635
|
-
key:
|
|
2921
|
+
return (t, l) => (m(!0), $(j, null, ae(e.filters, (n) => (m(), S(a($e), {
|
|
2922
|
+
key: n.key,
|
|
2636
2923
|
class: "wx-filter-chip",
|
|
2637
2924
|
size: "sm",
|
|
2638
2925
|
round: "",
|
|
2639
2926
|
closable: "",
|
|
2640
|
-
onClose: (
|
|
2927
|
+
onClose: (o) => n.clear()
|
|
2641
2928
|
}, {
|
|
2642
2929
|
default: y(() => [
|
|
2643
|
-
|
|
2930
|
+
z(A(n.label), 1)
|
|
2644
2931
|
]),
|
|
2645
2932
|
_: 2
|
|
2646
2933
|
}, 1032, ["onClose"]))), 128));
|
|
2647
2934
|
}
|
|
2648
|
-
}),
|
|
2935
|
+
}), pn = { class: "wx-rename__footer" }, hn = /* @__PURE__ */ M({
|
|
2649
2936
|
__name: "RenameButton",
|
|
2650
2937
|
props: {
|
|
2651
2938
|
name: { default: "" },
|
|
@@ -2656,21 +2943,21 @@ const kn = 76, _n = /* @__PURE__ */ I({
|
|
|
2656
2943
|
},
|
|
2657
2944
|
emits: ["rename"],
|
|
2658
2945
|
setup(e, { emit: t }) {
|
|
2659
|
-
const
|
|
2660
|
-
|
|
2661
|
-
h && (
|
|
2946
|
+
const l = e, n = t, o = D("webx-admin"), i = L(!1), s = L(l.name), r = L(null), u = g(() => l.label ?? o("editor.rename"));
|
|
2947
|
+
te(i, async (h) => {
|
|
2948
|
+
h && (s.value = l.name, await Ie(), r.value?.focus(), r.value?.select());
|
|
2662
2949
|
});
|
|
2663
2950
|
function d() {
|
|
2664
|
-
const h =
|
|
2665
|
-
if (h === "" || h ===
|
|
2951
|
+
const h = s.value.trim();
|
|
2952
|
+
if (h === "" || h === l.name) {
|
|
2666
2953
|
i.value = !1;
|
|
2667
2954
|
return;
|
|
2668
2955
|
}
|
|
2669
|
-
|
|
2956
|
+
n("rename", h), i.value = !1;
|
|
2670
2957
|
}
|
|
2671
|
-
return (h,
|
|
2958
|
+
return (h, f) => (m(), S(a(nl), {
|
|
2672
2959
|
open: i.value,
|
|
2673
|
-
"onUpdate:open":
|
|
2960
|
+
"onUpdate:open": f[2] || (f[2] = (v) => i.value = v),
|
|
2674
2961
|
title: u.value,
|
|
2675
2962
|
width: 320,
|
|
2676
2963
|
side: "bottom",
|
|
@@ -2678,7 +2965,7 @@ const kn = 76, _n = /* @__PURE__ */ I({
|
|
|
2678
2965
|
teleport: ""
|
|
2679
2966
|
}, {
|
|
2680
2967
|
trigger: y(() => [
|
|
2681
|
-
|
|
2968
|
+
w(a(ue), {
|
|
2682
2969
|
type: "edit",
|
|
2683
2970
|
title: u.value,
|
|
2684
2971
|
size: e.size,
|
|
@@ -2688,25 +2975,25 @@ const kn = 76, _n = /* @__PURE__ */ I({
|
|
|
2688
2975
|
default: y(() => [
|
|
2689
2976
|
B("form", {
|
|
2690
2977
|
class: "wx-rename",
|
|
2691
|
-
onSubmit:
|
|
2978
|
+
onSubmit: tt(d, ["prevent"])
|
|
2692
2979
|
}, [
|
|
2693
|
-
|
|
2980
|
+
w(a(Te), {
|
|
2694
2981
|
ref_key: "field",
|
|
2695
2982
|
ref: r,
|
|
2696
|
-
modelValue:
|
|
2697
|
-
"onUpdate:modelValue":
|
|
2983
|
+
modelValue: s.value,
|
|
2984
|
+
"onUpdate:modelValue": f[0] || (f[0] = (v) => s.value = v),
|
|
2698
2985
|
"aria-label": u.value,
|
|
2699
2986
|
placeholder: e.placeholder,
|
|
2700
|
-
onKeydown:
|
|
2987
|
+
onKeydown: f[1] || (f[1] = nt((v) => i.value = !1, ["esc"]))
|
|
2701
2988
|
}, null, 8, ["modelValue", "aria-label", "placeholder"]),
|
|
2702
|
-
B("div",
|
|
2703
|
-
|
|
2989
|
+
B("div", pn, [
|
|
2990
|
+
w(a(le), {
|
|
2704
2991
|
type: "primary",
|
|
2705
2992
|
size: "sm",
|
|
2706
2993
|
"native-type": "submit"
|
|
2707
2994
|
}, {
|
|
2708
2995
|
default: y(() => [
|
|
2709
|
-
|
|
2996
|
+
z(A(a(o)("editor.save")), 1)
|
|
2710
2997
|
]),
|
|
2711
2998
|
_: 1
|
|
2712
2999
|
})
|
|
@@ -2716,7 +3003,7 @@ const kn = 76, _n = /* @__PURE__ */ I({
|
|
|
2716
3003
|
_: 1
|
|
2717
3004
|
}, 8, ["open", "title"]));
|
|
2718
3005
|
}
|
|
2719
|
-
}),
|
|
3006
|
+
}), On = /* @__PURE__ */ G(hn, [["__scopeId", "data-v-d879e8d3"]]), gn = ["innerHTML"], yn = /* @__PURE__ */ M({
|
|
2720
3007
|
__name: "HelpButton",
|
|
2721
3008
|
props: {
|
|
2722
3009
|
body: {},
|
|
@@ -2726,33 +3013,33 @@ const kn = 76, _n = /* @__PURE__ */ I({
|
|
|
2726
3013
|
width: { default: 720 }
|
|
2727
3014
|
},
|
|
2728
3015
|
setup(e) {
|
|
2729
|
-
const t = e,
|
|
2730
|
-
return (
|
|
2731
|
-
|
|
3016
|
+
const t = e, l = D("webx-admin"), n = L(!1), o = g(() => t.title ?? l("help.title")), i = g(() => Xa(t.body));
|
|
3017
|
+
return (s, r) => (m(), $(j, null, [
|
|
3018
|
+
w(a(ue), {
|
|
2732
3019
|
type: "details",
|
|
2733
3020
|
icon: "question",
|
|
2734
3021
|
tone: "neutral",
|
|
2735
3022
|
size: e.size,
|
|
2736
|
-
title: e.label ??
|
|
2737
|
-
onClick: r[0] || (r[0] = (u) =>
|
|
3023
|
+
title: e.label ?? o.value,
|
|
3024
|
+
onClick: r[0] || (r[0] = (u) => n.value = !0)
|
|
2738
3025
|
}, null, 8, ["size", "title"]),
|
|
2739
|
-
|
|
2740
|
-
open:
|
|
2741
|
-
"onUpdate:open": r[1] || (r[1] = (u) =>
|
|
2742
|
-
title:
|
|
3026
|
+
w(a(rt), {
|
|
3027
|
+
open: n.value,
|
|
3028
|
+
"onUpdate:open": r[1] || (r[1] = (u) => n.value = u),
|
|
3029
|
+
title: o.value,
|
|
2743
3030
|
width: e.width
|
|
2744
3031
|
}, {
|
|
2745
3032
|
default: y(() => [
|
|
2746
3033
|
B("div", {
|
|
2747
3034
|
class: "wx-help",
|
|
2748
3035
|
innerHTML: i.value
|
|
2749
|
-
}, null, 8,
|
|
3036
|
+
}, null, 8, gn)
|
|
2750
3037
|
]),
|
|
2751
3038
|
_: 1
|
|
2752
3039
|
}, 8, ["open", "title", "width"])
|
|
2753
3040
|
], 64));
|
|
2754
3041
|
}
|
|
2755
|
-
}),
|
|
3042
|
+
}), Hn = /* @__PURE__ */ G(yn, [["__scopeId", "data-v-6c280d42"]]), $t = /* @__PURE__ */ M({
|
|
2756
3043
|
name: "WxDate",
|
|
2757
3044
|
__name: "DateText",
|
|
2758
3045
|
props: {
|
|
@@ -2762,46 +3049,46 @@ const kn = 76, _n = /* @__PURE__ */ I({
|
|
|
2762
3049
|
tone: { default: "muted" }
|
|
2763
3050
|
},
|
|
2764
3051
|
setup(e) {
|
|
2765
|
-
const t = e,
|
|
2766
|
-
return (
|
|
3052
|
+
const t = e, l = kt(), n = g(() => t.compact ? l.compact(t.value) : l.short(t.value)), o = g(() => l.exact(t.value)), i = g(() => l.iso(t.value));
|
|
3053
|
+
return (s, r) => o.value ? (m(), S(a(dt), {
|
|
2767
3054
|
key: 0,
|
|
2768
|
-
content:
|
|
3055
|
+
content: o.value
|
|
2769
3056
|
}, {
|
|
2770
3057
|
default: y(() => [
|
|
2771
|
-
|
|
3058
|
+
w(a(ee), {
|
|
2772
3059
|
as: "time",
|
|
2773
3060
|
datetime: i.value,
|
|
2774
3061
|
size: e.size,
|
|
2775
3062
|
tone: e.tone
|
|
2776
3063
|
}, {
|
|
2777
3064
|
default: y(() => [
|
|
2778
|
-
|
|
3065
|
+
z(A(n.value), 1)
|
|
2779
3066
|
]),
|
|
2780
3067
|
_: 1
|
|
2781
3068
|
}, 8, ["datetime", "size", "tone"])
|
|
2782
3069
|
]),
|
|
2783
3070
|
_: 1
|
|
2784
|
-
}, 8, ["content"])) : (
|
|
3071
|
+
}, 8, ["content"])) : (m(), S(a(ee), {
|
|
2785
3072
|
key: 1,
|
|
2786
3073
|
size: e.size,
|
|
2787
3074
|
tone: e.tone
|
|
2788
3075
|
}, {
|
|
2789
3076
|
default: y(() => [
|
|
2790
|
-
|
|
3077
|
+
z(A(n.value), 1)
|
|
2791
3078
|
]),
|
|
2792
3079
|
_: 1
|
|
2793
3080
|
}, 8, ["size", "tone"]));
|
|
2794
3081
|
}
|
|
2795
|
-
}),
|
|
3082
|
+
}), bn = { class: "wx-notes" }, wn = {
|
|
2796
3083
|
key: 3,
|
|
2797
3084
|
class: "wx-notes__list"
|
|
2798
|
-
},
|
|
3085
|
+
}, xn = { class: "wx-note__body" }, kn = { class: "wx-note__head" }, _n = { class: "wx-note__buttons" }, $n = {
|
|
2799
3086
|
key: 1,
|
|
2800
3087
|
class: "wx-note__text"
|
|
2801
|
-
},
|
|
3088
|
+
}, Tn = {
|
|
2802
3089
|
key: 4,
|
|
2803
3090
|
class: "wx-notes__new"
|
|
2804
|
-
},
|
|
3091
|
+
}, Sn = /* @__PURE__ */ M({
|
|
2805
3092
|
name: "WxNotes",
|
|
2806
3093
|
__name: "NotesFeed",
|
|
2807
3094
|
props: {
|
|
@@ -2812,52 +3099,52 @@ const kn = 76, _n = /* @__PURE__ */ I({
|
|
|
2812
3099
|
},
|
|
2813
3100
|
emits: ["change"],
|
|
2814
3101
|
setup(e, { emit: t }) {
|
|
2815
|
-
const
|
|
3102
|
+
const l = e, n = t, o = J(), i = D("webx-admin"), s = De(), r = L([]), u = L(!0), d = L(""), h = L(!1), f = L(null), v = L(""), c = g(() => tn(o, l.type, l.id)), x = g(() => l.title ?? i("notes.title"));
|
|
2816
3103
|
async function p() {
|
|
2817
3104
|
u.value = !0;
|
|
2818
3105
|
try {
|
|
2819
3106
|
r.value = await c.value.list();
|
|
2820
|
-
} catch (
|
|
2821
|
-
|
|
3107
|
+
} catch (k) {
|
|
3108
|
+
K.danger(s(k));
|
|
2822
3109
|
} finally {
|
|
2823
3110
|
u.value = !1;
|
|
2824
3111
|
}
|
|
2825
3112
|
}
|
|
2826
|
-
|
|
2827
|
-
() => [
|
|
3113
|
+
te(
|
|
3114
|
+
() => [l.type, l.id],
|
|
2828
3115
|
() => {
|
|
2829
|
-
|
|
3116
|
+
f.value = null, d.value = "", p();
|
|
2830
3117
|
},
|
|
2831
3118
|
{ immediate: !0 }
|
|
2832
3119
|
);
|
|
2833
|
-
async function
|
|
2834
|
-
const
|
|
2835
|
-
if (!(
|
|
3120
|
+
async function b() {
|
|
3121
|
+
const k = d.value.trim();
|
|
3122
|
+
if (!(k === "" || h.value)) {
|
|
2836
3123
|
h.value = !0;
|
|
2837
3124
|
try {
|
|
2838
|
-
r.value = [...r.value, await c.value.add(
|
|
2839
|
-
} catch (
|
|
2840
|
-
|
|
3125
|
+
r.value = [...r.value, await c.value.add(k)], d.value = "", n("change");
|
|
3126
|
+
} catch (C) {
|
|
3127
|
+
K.danger(s(C));
|
|
2841
3128
|
} finally {
|
|
2842
3129
|
h.value = !1;
|
|
2843
3130
|
}
|
|
2844
3131
|
}
|
|
2845
3132
|
}
|
|
2846
|
-
function k
|
|
2847
|
-
|
|
3133
|
+
function T(k) {
|
|
3134
|
+
f.value = k.id, v.value = k.body;
|
|
2848
3135
|
}
|
|
2849
|
-
async function
|
|
2850
|
-
const
|
|
2851
|
-
if (
|
|
3136
|
+
async function F(k) {
|
|
3137
|
+
const C = v.value.trim();
|
|
3138
|
+
if (C !== "")
|
|
2852
3139
|
try {
|
|
2853
|
-
const
|
|
2854
|
-
r.value = r.value.map((
|
|
2855
|
-
} catch (
|
|
2856
|
-
|
|
3140
|
+
const _ = await c.value.save(k.id, C);
|
|
3141
|
+
r.value = r.value.map((q) => q.id === _.id ? _ : q), f.value = null, K.success(i("notes.saved")), n("change");
|
|
3142
|
+
} catch (_) {
|
|
3143
|
+
K.danger(s(_));
|
|
2857
3144
|
}
|
|
2858
3145
|
}
|
|
2859
|
-
async function
|
|
2860
|
-
if (await
|
|
3146
|
+
async function Q(k) {
|
|
3147
|
+
if (await xe({
|
|
2861
3148
|
title: i("notes.delete-title"),
|
|
2862
3149
|
message: i("notes.delete-text"),
|
|
2863
3150
|
confirmText: i("notes.delete"),
|
|
@@ -2865,256 +3152,262 @@ const kn = 76, _n = /* @__PURE__ */ I({
|
|
|
2865
3152
|
tone: "danger"
|
|
2866
3153
|
}))
|
|
2867
3154
|
try {
|
|
2868
|
-
await c.value.remove(
|
|
2869
|
-
} catch (
|
|
2870
|
-
|
|
3155
|
+
await c.value.remove(k.id), r.value = r.value.filter((_) => _.id !== k.id), K.success(i("notes.deleted")), n("change");
|
|
3156
|
+
} catch (_) {
|
|
3157
|
+
K.danger(s(_));
|
|
2871
3158
|
}
|
|
2872
3159
|
}
|
|
2873
|
-
function
|
|
2874
|
-
return !
|
|
2875
|
-
{ key: "edit", icon: "edit", label: i("notes.edit"), run: () => k
|
|
3160
|
+
function H(k) {
|
|
3161
|
+
return !l.can || !k.is_mine ? [] : [
|
|
3162
|
+
{ key: "edit", icon: "edit", label: i("notes.edit"), run: () => T(k) },
|
|
2876
3163
|
{
|
|
2877
3164
|
key: "delete",
|
|
2878
3165
|
icon: "trash",
|
|
2879
3166
|
label: i("notes.delete"),
|
|
2880
3167
|
danger: !0,
|
|
2881
3168
|
run: () => {
|
|
2882
|
-
|
|
3169
|
+
Q(k);
|
|
2883
3170
|
}
|
|
2884
3171
|
}
|
|
2885
3172
|
];
|
|
2886
3173
|
}
|
|
2887
|
-
function
|
|
2888
|
-
return
|
|
3174
|
+
function V(k) {
|
|
3175
|
+
return k.author?.name ?? i("notes.unknown-author");
|
|
2889
3176
|
}
|
|
2890
|
-
return (
|
|
2891
|
-
x.value ? (
|
|
3177
|
+
return (k, C) => (m(), $("section", bn, [
|
|
3178
|
+
x.value ? (m(), S(a(ee), {
|
|
2892
3179
|
key: 0,
|
|
2893
3180
|
weight: "medium",
|
|
2894
3181
|
class: "wx-notes__title"
|
|
2895
3182
|
}, {
|
|
2896
3183
|
default: y(() => [
|
|
2897
|
-
|
|
3184
|
+
z(A(x.value), 1)
|
|
2898
3185
|
]),
|
|
2899
3186
|
_: 1
|
|
2900
3187
|
})) : N("", !0),
|
|
2901
|
-
u.value ? (
|
|
3188
|
+
u.value ? (m(), S(a(me), {
|
|
2902
3189
|
key: 1,
|
|
2903
3190
|
rows: 2
|
|
2904
|
-
})) : r.value.length === 0 ? (
|
|
3191
|
+
})) : r.value.length === 0 ? (m(), S(a(ut), {
|
|
2905
3192
|
key: 2,
|
|
2906
3193
|
size: "sm",
|
|
2907
|
-
description:
|
|
2908
|
-
}, null, 8, ["description"])) : (
|
|
2909
|
-
(
|
|
2910
|
-
key:
|
|
3194
|
+
description: a(i)("notes.empty")
|
|
3195
|
+
}, null, 8, ["description"])) : (m(), $("ul", wn, [
|
|
3196
|
+
(m(!0), $(j, null, ae(r.value, (_) => (m(), $("li", {
|
|
3197
|
+
key: _.id,
|
|
2911
3198
|
class: "wx-note"
|
|
2912
3199
|
}, [
|
|
2913
|
-
|
|
2914
|
-
name:
|
|
3200
|
+
w(a(ol), {
|
|
3201
|
+
name: V(_),
|
|
2915
3202
|
size: "sm",
|
|
2916
3203
|
tone: "auto"
|
|
2917
3204
|
}, null, 8, ["name"]),
|
|
2918
|
-
B("div",
|
|
2919
|
-
B("div",
|
|
2920
|
-
|
|
3205
|
+
B("div", xn, [
|
|
3206
|
+
B("div", kn, [
|
|
3207
|
+
w(a(ee), {
|
|
2921
3208
|
size: "sm",
|
|
2922
3209
|
weight: "medium",
|
|
2923
3210
|
truncate: ""
|
|
2924
3211
|
}, {
|
|
2925
3212
|
default: y(() => [
|
|
2926
|
-
|
|
3213
|
+
z(A(V(_)), 1)
|
|
2927
3214
|
]),
|
|
2928
3215
|
_: 2
|
|
2929
3216
|
}, 1024),
|
|
2930
|
-
|
|
2931
|
-
value:
|
|
3217
|
+
w($t, {
|
|
3218
|
+
value: _.created_at
|
|
2932
3219
|
}, null, 8, ["value"]),
|
|
2933
|
-
|
|
2934
|
-
actions:
|
|
2935
|
-
label:
|
|
3220
|
+
w(Fe, {
|
|
3221
|
+
actions: H(_),
|
|
3222
|
+
label: V(_)
|
|
2936
3223
|
}, null, 8, ["actions", "label"])
|
|
2937
3224
|
]),
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
modelValue:
|
|
2941
|
-
"onUpdate:modelValue":
|
|
3225
|
+
f.value === _.id ? (m(), $(j, { key: 0 }, [
|
|
3226
|
+
w(a(Ke), {
|
|
3227
|
+
modelValue: v.value,
|
|
3228
|
+
"onUpdate:modelValue": C[0] || (C[0] = (q) => v.value = q),
|
|
2942
3229
|
autosize: { minRows: 2, maxRows: 10 }
|
|
2943
3230
|
}, null, 8, ["modelValue"]),
|
|
2944
|
-
B("div",
|
|
2945
|
-
|
|
3231
|
+
B("div", _n, [
|
|
3232
|
+
w(a(le), {
|
|
2946
3233
|
size: "sm",
|
|
2947
3234
|
type: "primary",
|
|
2948
|
-
onClick: (
|
|
3235
|
+
onClick: (q) => F(_)
|
|
2949
3236
|
}, {
|
|
2950
3237
|
default: y(() => [
|
|
2951
|
-
|
|
3238
|
+
z(A(a(i)("notes.save")), 1)
|
|
2952
3239
|
]),
|
|
2953
3240
|
_: 1
|
|
2954
3241
|
}, 8, ["onClick"]),
|
|
2955
|
-
|
|
3242
|
+
w(a(le), {
|
|
2956
3243
|
size: "sm",
|
|
2957
3244
|
variant: "text",
|
|
2958
|
-
onClick:
|
|
3245
|
+
onClick: C[1] || (C[1] = (q) => f.value = null)
|
|
2959
3246
|
}, {
|
|
2960
3247
|
default: y(() => [
|
|
2961
|
-
|
|
3248
|
+
z(A(a(i)("notes.cancel")), 1)
|
|
2962
3249
|
]),
|
|
2963
3250
|
_: 1
|
|
2964
3251
|
})
|
|
2965
3252
|
])
|
|
2966
|
-
], 64)) : (
|
|
3253
|
+
], 64)) : (m(), $("p", $n, A(_.body), 1))
|
|
2967
3254
|
])
|
|
2968
3255
|
]))), 128))
|
|
2969
3256
|
])),
|
|
2970
|
-
e.can ? (
|
|
2971
|
-
|
|
3257
|
+
e.can ? (m(), $("div", Tn, [
|
|
3258
|
+
w(a(Ke), {
|
|
2972
3259
|
modelValue: d.value,
|
|
2973
|
-
"onUpdate:modelValue":
|
|
2974
|
-
placeholder:
|
|
3260
|
+
"onUpdate:modelValue": C[2] || (C[2] = (_) => d.value = _),
|
|
3261
|
+
placeholder: a(i)("notes.placeholder"),
|
|
2975
3262
|
autosize: { minRows: 2, maxRows: 8 }
|
|
2976
3263
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
2977
|
-
|
|
3264
|
+
w(a(le), {
|
|
2978
3265
|
size: "sm",
|
|
2979
3266
|
type: "primary",
|
|
2980
3267
|
disabled: d.value.trim() === "",
|
|
2981
3268
|
loading: h.value,
|
|
2982
|
-
onClick:
|
|
3269
|
+
onClick: b
|
|
2983
3270
|
}, {
|
|
2984
3271
|
default: y(() => [
|
|
2985
|
-
|
|
3272
|
+
z(A(a(i)("notes.add")), 1)
|
|
2986
3273
|
]),
|
|
2987
3274
|
_: 1
|
|
2988
3275
|
}, 8, ["disabled", "loading"])
|
|
2989
3276
|
])) : N("", !0)
|
|
2990
3277
|
]));
|
|
2991
3278
|
}
|
|
2992
|
-
}),
|
|
3279
|
+
}), jn = /* @__PURE__ */ G(Sn, [["__scopeId", "data-v-71004c1a"]]), Cn = {
|
|
2993
3280
|
key: 1,
|
|
2994
3281
|
class: "wx-backup-note"
|
|
2995
|
-
},
|
|
3282
|
+
}, Wn = 48, An = /* @__PURE__ */ M({
|
|
2996
3283
|
name: "WxBackupNote",
|
|
2997
3284
|
__name: "BackupNote",
|
|
2998
3285
|
setup(e) {
|
|
2999
|
-
const t =
|
|
3000
|
-
const d =
|
|
3286
|
+
const t = J(), l = kt(), n = D("webx-admin"), o = g(() => t.state.manifest?.backup ?? null), i = g(() => o.value !== null && t.can("settings.view")), s = g(() => {
|
|
3287
|
+
const d = o.value?.at;
|
|
3001
3288
|
if (d == null) return !0;
|
|
3002
3289
|
const h = new Date(d).getTime();
|
|
3003
|
-
return Number.isNaN(h) || Date.now() - h >
|
|
3004
|
-
}), r =
|
|
3005
|
-
const d =
|
|
3290
|
+
return Number.isNaN(h) || Date.now() - h > Wn * 36e5;
|
|
3291
|
+
}), r = g(() => {
|
|
3292
|
+
const d = o.value?.bytes;
|
|
3006
3293
|
if (d == null) return "";
|
|
3007
3294
|
const h = ["byte", "kilobyte", "megabyte", "gigabyte", "terabyte"];
|
|
3008
|
-
let
|
|
3009
|
-
for (;
|
|
3010
|
-
|
|
3295
|
+
let f = d, v = 0;
|
|
3296
|
+
for (; f >= 1024 && v < h.length - 1; )
|
|
3297
|
+
f /= 1024, v++;
|
|
3011
3298
|
return new Intl.NumberFormat(t.i18n.state.locale, {
|
|
3012
3299
|
style: "unit",
|
|
3013
|
-
unit: h[
|
|
3300
|
+
unit: h[v],
|
|
3014
3301
|
unitDisplay: "short",
|
|
3015
|
-
maximumFractionDigits:
|
|
3016
|
-
}).format(
|
|
3017
|
-
}), u =
|
|
3018
|
-
() =>
|
|
3302
|
+
maximumFractionDigits: f >= 10 || v === 0 ? 0 : 1
|
|
3303
|
+
}).format(f);
|
|
3304
|
+
}), u = g(
|
|
3305
|
+
() => o.value?.at == null ? n("backup.never") : n("backup.stale", { date: l.short(o.value.at) })
|
|
3019
3306
|
);
|
|
3020
|
-
return (d, h) => i.value &&
|
|
3307
|
+
return (d, h) => i.value && s.value ? (m(), S(a(Se), {
|
|
3021
3308
|
key: 0,
|
|
3022
3309
|
type: "warning",
|
|
3023
3310
|
variant: "soft",
|
|
3024
3311
|
description: u.value
|
|
3025
|
-
}, null, 8, ["description"])) : i.value ? (
|
|
3026
|
-
|
|
3312
|
+
}, null, 8, ["description"])) : i.value ? (m(), $("p", Cn, [
|
|
3313
|
+
w(a(ee), {
|
|
3027
3314
|
size: "sm",
|
|
3028
3315
|
tone: "muted"
|
|
3029
3316
|
}, {
|
|
3030
3317
|
default: y(() => [
|
|
3031
|
-
|
|
3318
|
+
z(A(a(n)("backup.title")), 1)
|
|
3032
3319
|
]),
|
|
3033
3320
|
_: 1
|
|
3034
3321
|
}),
|
|
3035
|
-
|
|
3036
|
-
value:
|
|
3322
|
+
w($t, {
|
|
3323
|
+
value: o.value?.at
|
|
3037
3324
|
}, null, 8, ["value"]),
|
|
3038
|
-
r.value ? (
|
|
3325
|
+
r.value ? (m(), S(a(ee), {
|
|
3039
3326
|
key: 0,
|
|
3040
3327
|
size: "sm",
|
|
3041
3328
|
tone: "muted"
|
|
3042
3329
|
}, {
|
|
3043
3330
|
default: y(() => [
|
|
3044
|
-
|
|
3331
|
+
z("· " + A(r.value), 1)
|
|
3045
3332
|
]),
|
|
3046
3333
|
_: 1
|
|
3047
3334
|
})) : N("", !0)
|
|
3048
3335
|
])) : N("", !0);
|
|
3049
3336
|
}
|
|
3050
|
-
}),
|
|
3337
|
+
}), Kn = /* @__PURE__ */ G(An, [["__scopeId", "data-v-beeee67e"]]);
|
|
3051
3338
|
export {
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3339
|
+
Ca as AdminLanding,
|
|
3340
|
+
Wa as AdminNav,
|
|
3341
|
+
Ba as AdminShell,
|
|
3342
|
+
ft as COLLECTION_MAX_LIMIT,
|
|
3343
|
+
fe as HttpError,
|
|
3344
|
+
ia as WxBackButton,
|
|
3345
|
+
Kn as WxBackupNote,
|
|
3346
|
+
gl as WxCategoriesField,
|
|
3347
|
+
sn as WxCategoriesPage,
|
|
3348
|
+
nn as WxCategoryCreateDialog,
|
|
3349
|
+
vn as WxCategoryEditorPage,
|
|
3350
|
+
Ge as WxCategorySlug,
|
|
3351
|
+
Xl as WxCollectionField,
|
|
3352
|
+
$t as WxDate,
|
|
3353
|
+
Dn as WxFilterChips,
|
|
3354
|
+
Hn as WxHelpButton,
|
|
3355
|
+
sa as WxLinkField,
|
|
3356
|
+
oa as WxLinkPicker,
|
|
3357
|
+
ht as WxListScreen,
|
|
3358
|
+
jn as WxNotes,
|
|
3359
|
+
mt as WxRelationsField,
|
|
3360
|
+
On as WxRenameButton,
|
|
3361
|
+
ga as WxRichTextField,
|
|
3362
|
+
Fe as WxRowMenu,
|
|
3363
|
+
dn as WxSaveState,
|
|
3364
|
+
mn as WxScreen,
|
|
3365
|
+
pt as WxScreenHead,
|
|
3366
|
+
Ge as WxSlugField,
|
|
3367
|
+
yt as adminKey,
|
|
3368
|
+
wt as adminMessages,
|
|
3369
|
+
_a as adminTypes,
|
|
3370
|
+
Pn as categoryRoutes,
|
|
3371
|
+
Nl as collectionSources,
|
|
3372
|
+
En as createAdmin,
|
|
3373
|
+
$a as createAdminContext,
|
|
3374
|
+
ve as createCategoriesApi,
|
|
3375
|
+
Ga as createDates,
|
|
3376
|
+
bl as createHttp,
|
|
3377
|
+
Pe as createI18n,
|
|
3378
|
+
Jl as createLinksApi,
|
|
3379
|
+
tn as createNotesApi,
|
|
3380
|
+
kl as createRelationsApi,
|
|
3381
|
+
Fa as createTheme,
|
|
3382
|
+
Xe as defaultMarkup,
|
|
3383
|
+
Gl as emptyLink,
|
|
3384
|
+
Qa as errorText,
|
|
3385
|
+
Ce as i18nKey,
|
|
3386
|
+
an as itemOrderMode,
|
|
3387
|
+
Ye as normaliseCollection,
|
|
3388
|
+
_l as normaliseRelations,
|
|
3389
|
+
Ta as provideAdmin,
|
|
3390
|
+
cl as provideI18n,
|
|
3391
|
+
ya as provideRecordAddress,
|
|
3392
|
+
zn as provideRelationOwner,
|
|
3393
|
+
Pa as provideTheme,
|
|
3103
3394
|
qe as readCookie,
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3395
|
+
gt as recordAddressKey,
|
|
3396
|
+
ct as relationOwnerKey,
|
|
3397
|
+
Xa as renderMarkdown,
|
|
3398
|
+
fl as reorderItems,
|
|
3399
|
+
Fn as rowMenuWidth,
|
|
3400
|
+
bt as themeKey,
|
|
3401
|
+
J as useAdmin,
|
|
3402
|
+
Bn as useCategoryEditor,
|
|
3403
|
+
Oe as useCategoryWords,
|
|
3404
|
+
kt as useDates,
|
|
3405
|
+
De as useErrorText,
|
|
3406
|
+
dl as useI18n,
|
|
3407
|
+
Mn as useItemOrder,
|
|
3408
|
+
ba as useRecordAddress,
|
|
3409
|
+
$l as useRelationOwner,
|
|
3410
|
+
In as useTheme,
|
|
3411
|
+
D as useTranslate
|
|
3119
3412
|
};
|
|
3120
3413
|
//# sourceMappingURL=index.js.map
|