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