@webx-ui/module-admin 0.20.0 → 0.21.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/AdminNav.d.ts +3 -1
- package/dist/categories/SourceSelect.d.ts +11 -0
- package/dist/categories/index.d.ts +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1280 -1224
- package/dist/index.js.map +1 -1
- package/dist/screenTypes.d.ts +4 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +21 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { inject as fe, reactive as
|
|
1
|
+
import { inject as fe, reactive as ze, defineComponent as K, useModel as ge, ref as A, watch as re, computed as b, openBlock as d, createElementBlock as $, createVNode as x, unref as a, withCtx as g, createElementVNode as M, toDisplayString as C, createBlock as W, createTextVNode as R, createCommentVNode as U, mergeModels as me, mergeProps as et, provide as Ue, normalizeClass as ve, createSlots as Re, nextTick as tt, useId as qt, Fragment as j, onMounted as Ie, renderList as ie, withModifiers as $t, useSlots as Yt, useTemplateRef as St, renderSlot as oe, normalizeProps as Xt, guardReactiveProps as Jt, resolveComponent as ne, watchEffect as Gt, onUnmounted as Qt, isRef as Tt, createApp as Zt, h as xe, onBeforeUnmount as lt, getCurrentScope as el, onScopeDispose as tl, readonly as we, withKeys as Ct } from "vue";
|
|
2
2
|
import { RouterLink as ll, useRouter as Me, useRoute as At, createRouter as al, createWebHistory as nl, onBeforeRouteLeave as ol } from "vue-router";
|
|
3
|
-
import { WxSortableList as
|
|
3
|
+
import { WxSortableList as at, WxAction as be, WxBadge as Oe, WxSelect as ke, WxAutocomplete as Xe, WxSwitch as Fe, WxInputNumber as sl, WxButton as ce, WxSegmented as il, WxText as Q, WxInput as Se, WxCheckbox as ft, WxTooltip as Wt, WxEmpty as Ve, WxSkeleton as ye, WxAvatar as Lt, WxDialog as nt, toast as Z, WxActions as rl, WxDropdownItem as ul, useElementWidth as dl, WxHeading as cl, WxIcon as ot, WxTabs as fl, WxCard as Je, WxRichText as ml, useLocales as zt, WxAlert as Pe, WxResult as vl, useResponsiveShell as pl, shellLayoutFor as hl, WxToaster as yl, WebxUI as gl, dateLocaleKey as bl, localesKey as wl, useModal as _l, WxFormItem as xl, WxSpace as kl, createModal as $l, confirm as Ne, localizedValue as Sl, WxBreadcrumb as Tl, WxBreadcrumbItem as mt, WxActionBar as Cl, WxPopover as Al, WxTextarea as vt } from "@webx-ui/core";
|
|
4
4
|
import { watchSystemTheme as Wl, applyTheme as Ll, systemTheme as zl } from "@webx-ui/tokens";
|
|
5
5
|
import { WxScreenRenderer as Vl } from "@webx-ui/schema";
|
|
6
6
|
const Be = /* @__PURE__ */ Symbol("webx-i18n");
|
|
@@ -12,43 +12,43 @@ function Nl() {
|
|
|
12
12
|
}
|
|
13
13
|
function J(e) {
|
|
14
14
|
const t = fe(Be, null);
|
|
15
|
-
return t === null ?
|
|
15
|
+
return t === null ? st().scope(e) : t.scope(e);
|
|
16
16
|
}
|
|
17
17
|
function El(e, t) {
|
|
18
18
|
e.provide(Be, t);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const t = e.fallback ?? "en", l =
|
|
20
|
+
function st(e = {}) {
|
|
21
|
+
const t = e.fallback ?? "en", l = ze({
|
|
22
22
|
locale: e.locale ?? t,
|
|
23
23
|
fallback: t,
|
|
24
24
|
panelLocales: [],
|
|
25
25
|
contentLocales: []
|
|
26
|
-
}), s = {}, n =
|
|
27
|
-
function i(r, u,
|
|
28
|
-
let
|
|
29
|
-
for (const
|
|
30
|
-
if (typeof
|
|
26
|
+
}), s = {}, n = ze({ value: {} });
|
|
27
|
+
function i(r, u, m) {
|
|
28
|
+
let v = r[u]?.[m[0] ?? ""];
|
|
29
|
+
for (const f of m.slice(1)) {
|
|
30
|
+
if (typeof v != "object" || v === null)
|
|
31
31
|
return null;
|
|
32
|
-
|
|
32
|
+
v = v[f];
|
|
33
33
|
}
|
|
34
|
-
return typeof
|
|
34
|
+
return typeof v == "string" ? v : null;
|
|
35
35
|
}
|
|
36
|
-
function o(r, u,
|
|
37
|
-
const [
|
|
36
|
+
function o(r, u, m) {
|
|
37
|
+
const [v, f] = u.includes("::") ? u.split("::", 2) : [r, u], c = f.split("."), h = i(n.value, v, c) ?? i(s, v, c) ?? // 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 m === void 0 ? h : Ul(h, m);
|
|
41
41
|
}
|
|
42
42
|
return {
|
|
43
43
|
state: l,
|
|
44
44
|
defaults(r, u) {
|
|
45
45
|
s[r] = { ...s[r], ...u };
|
|
46
46
|
},
|
|
47
|
-
load(r, u,
|
|
48
|
-
n.value = r ?? {}, l.locale = u ?? l.locale,
|
|
47
|
+
load(r, u, m) {
|
|
48
|
+
n.value = r ?? {}, l.locale = u ?? l.locale, m !== void 0 && (l.fallback = m);
|
|
49
49
|
},
|
|
50
50
|
scope(r) {
|
|
51
|
-
return (u,
|
|
51
|
+
return (u, m) => o(r, u, m);
|
|
52
52
|
},
|
|
53
53
|
t: (r, u) => o("", r, u)
|
|
54
54
|
};
|
|
@@ -59,7 +59,7 @@ function Ul(e, t) {
|
|
|
59
59
|
l = l.replaceAll(`:${s}`, String(n));
|
|
60
60
|
return l;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function _e(e, t) {
|
|
63
63
|
const l = `${e.apiPath}/${t.replace(/^\/+|\/+$/g, "")}`, s = (n) => n.data;
|
|
64
64
|
return {
|
|
65
65
|
list: (n = {}) => {
|
|
@@ -81,7 +81,7 @@ function Rl(e, t, l, s = null) {
|
|
|
81
81
|
return e.http.post(`${n}/reorder`, s === null ? { ids: l } : { ids: l, category: s }).then(() => {
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
const Il = { class: "wx-categories-field" }, Ml = { class: "wx-categories-field__name" }, Ol = /* @__PURE__ */
|
|
84
|
+
const Il = { class: "wx-categories-field" }, Ml = { class: "wx-categories-field__name" }, Ol = /* @__PURE__ */ K({
|
|
85
85
|
name: "WxCategoriesField",
|
|
86
86
|
__name: "CategoriesField",
|
|
87
87
|
props: /* @__PURE__ */ me({
|
|
@@ -99,37 +99,37 @@ const Il = { class: "wx-categories-field" }, Ml = { class: "wx-categories-field_
|
|
|
99
99
|
}),
|
|
100
100
|
emits: ["update:modelValue"],
|
|
101
101
|
setup(e) {
|
|
102
|
-
const t = e, l = ge(e, "modelValue"), s =
|
|
102
|
+
const t = e, l = ge(e, "modelValue"), s = te(), n = J("webx-admin"), i = A([]);
|
|
103
103
|
re(
|
|
104
104
|
() => t.source,
|
|
105
105
|
async (c) => {
|
|
106
106
|
try {
|
|
107
|
-
const
|
|
108
|
-
i.value =
|
|
107
|
+
const h = await _e(s, c).list();
|
|
108
|
+
i.value = h.data.map((y) => ({ id: y.id, name: y.name }));
|
|
109
109
|
} catch {
|
|
110
110
|
i.value = [];
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
113
|
{ immediate: !0 }
|
|
114
114
|
);
|
|
115
|
-
const o =
|
|
115
|
+
const o = b(() => Array.isArray(l.value) ? l.value : []), r = b(() => new Map(i.value.map((c) => [c.id, c.name]))), u = b({
|
|
116
116
|
get: () => o.value.map((c) => ({ id: c, name: r.value.get(c) ?? `#${c}` })),
|
|
117
117
|
set: (c) => {
|
|
118
|
-
l.value = c.map((
|
|
118
|
+
l.value = c.map((h) => h.id);
|
|
119
119
|
}
|
|
120
|
-
}),
|
|
120
|
+
}), m = b(
|
|
121
121
|
() => i.value.filter((c) => !o.value.includes(c.id)).map((c) => ({ label: c.name, value: c.id }))
|
|
122
122
|
);
|
|
123
|
-
function
|
|
123
|
+
function v(c) {
|
|
124
124
|
typeof c != "number" || o.value.includes(c) || (l.value = [...o.value, c]);
|
|
125
125
|
}
|
|
126
|
-
function
|
|
127
|
-
l.value = o.value.filter((
|
|
126
|
+
function f(c) {
|
|
127
|
+
l.value = o.value.filter((h) => h !== c);
|
|
128
128
|
}
|
|
129
|
-
return (c,
|
|
130
|
-
|
|
129
|
+
return (c, h) => (d(), $("div", Il, [
|
|
130
|
+
x(a(at), {
|
|
131
131
|
modelValue: u.value,
|
|
132
|
-
"onUpdate:modelValue":
|
|
132
|
+
"onUpdate:modelValue": h[0] || (h[0] = (y) => u.value = y),
|
|
133
133
|
plain: "",
|
|
134
134
|
size: "sm",
|
|
135
135
|
"item-key": "id",
|
|
@@ -137,9 +137,9 @@ const Il = { class: "wx-categories-field" }, Ml = { class: "wx-categories-field_
|
|
|
137
137
|
disabled: t.disabled,
|
|
138
138
|
"empty-text": t.emptyText ?? a(n)("categories.field-empty")
|
|
139
139
|
}, {
|
|
140
|
-
default: g(({ item: y, index:
|
|
140
|
+
default: g(({ item: y, index: p }) => [
|
|
141
141
|
M("span", Ml, C(y.name), 1),
|
|
142
|
-
t.main &&
|
|
142
|
+
t.main && p === 0 ? (d(), W(a(Oe), {
|
|
143
143
|
key: 0,
|
|
144
144
|
type: "primary"
|
|
145
145
|
}, {
|
|
@@ -150,36 +150,65 @@ const Il = { class: "wx-categories-field" }, Ml = { class: "wx-categories-field_
|
|
|
150
150
|
})) : U("", !0)
|
|
151
151
|
]),
|
|
152
152
|
actions: g(({ item: y }) => [
|
|
153
|
-
|
|
153
|
+
x(a(be), {
|
|
154
154
|
type: "remove",
|
|
155
155
|
size: "sm",
|
|
156
156
|
disabled: t.disabled,
|
|
157
157
|
title: t.removeText ?? a(n)("categories.field-remove"),
|
|
158
|
-
onClick: (
|
|
158
|
+
onClick: (p) => f(y.id)
|
|
159
159
|
}, null, 8, ["disabled", "title", "onClick"])
|
|
160
160
|
]),
|
|
161
161
|
_: 1
|
|
162
162
|
}, 8, ["modelValue", "disabled", "empty-text"]),
|
|
163
|
-
|
|
163
|
+
x(a(ke), {
|
|
164
164
|
"model-value": null,
|
|
165
|
-
options:
|
|
165
|
+
options: m.value,
|
|
166
166
|
placeholder: t.addText ?? a(n)("categories.field-add"),
|
|
167
|
-
disabled: t.disabled ||
|
|
167
|
+
disabled: t.disabled || m.value.length === 0,
|
|
168
168
|
"empty-text": t.noneLeftText ?? a(n)("categories.field-none-left"),
|
|
169
169
|
filterable: "",
|
|
170
170
|
teleport: "",
|
|
171
171
|
"aria-label": t.addText ?? a(n)("categories.field-add"),
|
|
172
|
-
"onUpdate:modelValue":
|
|
172
|
+
"onUpdate:modelValue": v
|
|
173
173
|
}, null, 8, ["options", "placeholder", "disabled", "empty-text", "aria-label"])
|
|
174
174
|
]));
|
|
175
175
|
}
|
|
176
|
-
}),
|
|
176
|
+
}), se = (e, t) => {
|
|
177
177
|
const l = e.__vccOpts || e;
|
|
178
178
|
for (const [s, n] of t)
|
|
179
179
|
l[s] = n;
|
|
180
180
|
return l;
|
|
181
|
-
}, Pl = /* @__PURE__ */
|
|
182
|
-
|
|
181
|
+
}, Pl = /* @__PURE__ */ se(Ol, [["__scopeId", "data-v-640cd836"]]), Bl = /* @__PURE__ */ K({
|
|
182
|
+
name: "WxSourceSelect",
|
|
183
|
+
inheritAttrs: !1,
|
|
184
|
+
__name: "SourceSelect",
|
|
185
|
+
props: {
|
|
186
|
+
source: { default: void 0 },
|
|
187
|
+
options: { default: () => [] }
|
|
188
|
+
},
|
|
189
|
+
setup(e) {
|
|
190
|
+
const t = e, l = te(), s = A([]);
|
|
191
|
+
re(
|
|
192
|
+
() => t.source,
|
|
193
|
+
async (i) => {
|
|
194
|
+
if (!i) {
|
|
195
|
+
s.value = [];
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
try {
|
|
199
|
+
const o = await _e(l, i).list();
|
|
200
|
+
s.value = o.data.map((r) => ({ label: r.name, value: r.id }));
|
|
201
|
+
} catch {
|
|
202
|
+
s.value = [];
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
{ immediate: !0 }
|
|
206
|
+
);
|
|
207
|
+
const n = b(() => t.source ? s.value : t.options);
|
|
208
|
+
return (i, o) => (d(), W(a(ke), et(i.$attrs, { options: n.value }), null, 16, ["options"]));
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
class $e extends Error {
|
|
183
212
|
constructor(t, l, s = {}, n = null, i = null) {
|
|
184
213
|
super(t), this.status = l, this.errors = s, this.retryAfter = n, this.body = i, this.name = "HttpError";
|
|
185
214
|
}
|
|
@@ -198,17 +227,17 @@ class xe extends Error {
|
|
|
198
227
|
return this.status === 429;
|
|
199
228
|
}
|
|
200
229
|
}
|
|
201
|
-
const
|
|
202
|
-
function
|
|
230
|
+
const Dl = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]);
|
|
231
|
+
function Fl(e = {}) {
|
|
203
232
|
const t = (e.baseUrl ?? "").replace(/\/$/, ""), l = e.csrfUrl ?? "/api/cms/auth/csrf-cookie", s = e.fetch ?? globalThis.fetch.bind(globalThis), n = e.onUnauthenticated, i = e.headers;
|
|
204
233
|
let o = !1;
|
|
205
|
-
async function r(
|
|
206
|
-
o && !
|
|
234
|
+
async function r(v = !1) {
|
|
235
|
+
o && !v && pt("XSRF-TOKEN") !== null || (await s(l, { credentials: "same-origin" }), o = !0);
|
|
207
236
|
}
|
|
208
|
-
async function u(
|
|
209
|
-
const y =
|
|
237
|
+
async function u(v, f, c = {}, h = !1) {
|
|
238
|
+
const y = Dl.has(v);
|
|
210
239
|
y && await r();
|
|
211
|
-
const
|
|
240
|
+
const p = {
|
|
212
241
|
Accept: "application/json",
|
|
213
242
|
"X-Requested-With": "XMLHttpRequest",
|
|
214
243
|
// Standing headers first, so a caller can still override one for a single request.
|
|
@@ -216,22 +245,22 @@ function Dl(e = {}) {
|
|
|
216
245
|
...c.headers
|
|
217
246
|
};
|
|
218
247
|
if (y) {
|
|
219
|
-
const
|
|
220
|
-
|
|
248
|
+
const S = pt("XSRF-TOKEN");
|
|
249
|
+
S !== null && (p["X-XSRF-TOKEN"] = S);
|
|
221
250
|
}
|
|
222
|
-
c.json === !0 && (
|
|
223
|
-
const
|
|
224
|
-
method:
|
|
251
|
+
c.json === !0 && (p["Content-Type"] = "application/json");
|
|
252
|
+
const _ = await s(Hl(t, f, c.query), {
|
|
253
|
+
method: v,
|
|
225
254
|
credentials: "same-origin",
|
|
226
|
-
headers:
|
|
255
|
+
headers: p,
|
|
227
256
|
signal: c.signal,
|
|
228
257
|
body: c.body ?? void 0
|
|
229
258
|
});
|
|
230
|
-
return
|
|
259
|
+
return _.status === 419 && y && !h ? (await r(!0), u(v, f, c, !0)) : (_.status === 401 && n?.(), _);
|
|
231
260
|
}
|
|
232
|
-
async function v
|
|
233
|
-
const y = await u(
|
|
234
|
-
...
|
|
261
|
+
async function m(v, f, c, h = {}) {
|
|
262
|
+
const y = await u(v, f, {
|
|
263
|
+
...h,
|
|
235
264
|
json: c !== void 0,
|
|
236
265
|
body: c === void 0 ? void 0 : JSON.stringify(c)
|
|
237
266
|
});
|
|
@@ -241,12 +270,12 @@ function Dl(e = {}) {
|
|
|
241
270
|
return await y.json();
|
|
242
271
|
}
|
|
243
272
|
return {
|
|
244
|
-
get: (
|
|
245
|
-
post: (
|
|
246
|
-
put: (
|
|
247
|
-
patch: (
|
|
248
|
-
delete: (
|
|
249
|
-
send: (
|
|
273
|
+
get: (v, f) => m("GET", v, void 0, f),
|
|
274
|
+
post: (v, f, c) => m("POST", v, f, c),
|
|
275
|
+
put: (v, f, c) => m("PUT", v, f, c),
|
|
276
|
+
patch: (v, f, c) => m("PATCH", v, f, c),
|
|
277
|
+
delete: (v, f) => m("DELETE", v, void 0, f),
|
|
278
|
+
send: (v, f, c) => u(v.toUpperCase(), f, c)
|
|
250
279
|
};
|
|
251
280
|
}
|
|
252
281
|
async function Ge(e) {
|
|
@@ -256,7 +285,7 @@ async function Ge(e) {
|
|
|
256
285
|
} catch {
|
|
257
286
|
}
|
|
258
287
|
const l = t ?? {}, s = typeof l.message == "string" && l.message !== "" ? l.message : e.statusText || `Request failed with ${e.status}`, n = l.errors !== null && typeof l.errors == "object" ? l.errors : {}, i = e.headers.get("Retry-After"), o = i === null ? null : Number.parseInt(i, 10);
|
|
259
|
-
return new
|
|
288
|
+
return new $e(
|
|
260
289
|
s,
|
|
261
290
|
e.status,
|
|
262
291
|
n,
|
|
@@ -264,7 +293,7 @@ async function Ge(e) {
|
|
|
264
293
|
t
|
|
265
294
|
);
|
|
266
295
|
}
|
|
267
|
-
function
|
|
296
|
+
function Hl(e, t, l) {
|
|
268
297
|
const n = /^https?:\/\//i.test(t) ? t : `${e}/${t.replace(/^\//, "")}`;
|
|
269
298
|
if (l === void 0)
|
|
270
299
|
return n;
|
|
@@ -274,7 +303,7 @@ function Fl(e, t, l) {
|
|
|
274
303
|
const o = i.toString();
|
|
275
304
|
return o === "" ? n : `${n}${n.includes("?") ? "&" : "?"}${o}`;
|
|
276
305
|
}
|
|
277
|
-
function
|
|
306
|
+
function pt(e) {
|
|
278
307
|
if (typeof document > "u")
|
|
279
308
|
return null;
|
|
280
309
|
for (const t of document.cookie.split(";")) {
|
|
@@ -284,33 +313,33 @@ function vt(e) {
|
|
|
284
313
|
}
|
|
285
314
|
return null;
|
|
286
315
|
}
|
|
287
|
-
function
|
|
316
|
+
function jl(e, t) {
|
|
288
317
|
const l = `${e.apiPath}/relations/${encodeURIComponent(t)}`;
|
|
289
318
|
return {
|
|
290
319
|
search: (s) => e.http.get(l, { query: { q: s } }).then((n) => n.data),
|
|
291
320
|
named: (s) => s.length === 0 ? Promise.resolve([]) : e.http.get(`${l}?${s.map((n) => `ids[]=${n}`).join("&")}`).then((n) => n.data)
|
|
292
321
|
};
|
|
293
322
|
}
|
|
294
|
-
function
|
|
323
|
+
function Kl(e) {
|
|
295
324
|
return Array.isArray(e) ? [...new Set(e.map(Number).filter((t) => Number.isInteger(t) && t > 0))] : [];
|
|
296
325
|
}
|
|
297
326
|
const Vt = /* @__PURE__ */ Symbol("wx-relation-owner");
|
|
298
|
-
function
|
|
327
|
+
function Ro(e) {
|
|
299
328
|
Ue(Vt, e);
|
|
300
329
|
}
|
|
301
|
-
function
|
|
330
|
+
function ql() {
|
|
302
331
|
return fe(Vt, null);
|
|
303
332
|
}
|
|
304
|
-
const
|
|
333
|
+
const Yl = ["src"], Xl = { class: "wx-relations-field__text" }, Jl = { class: "wx-relations-field__title" }, Gl = {
|
|
305
334
|
key: 0,
|
|
306
335
|
class: "wx-relations-field__subtitle"
|
|
307
|
-
},
|
|
336
|
+
}, Ql = {
|
|
308
337
|
key: 0,
|
|
309
338
|
class: "wx-relations-field__note"
|
|
310
|
-
},
|
|
339
|
+
}, Zl = {
|
|
311
340
|
key: 1,
|
|
312
341
|
class: "wx-relations-field__add"
|
|
313
|
-
},
|
|
342
|
+
}, ea = /* @__PURE__ */ K({
|
|
314
343
|
name: "WxRelationsField",
|
|
315
344
|
__name: "RelationsField",
|
|
316
345
|
props: /* @__PURE__ */ me({
|
|
@@ -326,84 +355,84 @@ const ql = ["src"], Yl = { class: "wx-relations-field__text" }, Xl = { class: "w
|
|
|
326
355
|
}),
|
|
327
356
|
emits: ["update:modelValue"],
|
|
328
357
|
setup(e) {
|
|
329
|
-
const t = e, l = ge(e, "modelValue"), s =
|
|
358
|
+
const t = e, l = ge(e, "modelValue"), s = te(), n = ql(), i = J("webx-admin"), o = b(() => jl(s, t.target)), r = A(/* @__PURE__ */ new Map()), u = A(/* @__PURE__ */ new Set()), m = A(!1), v = A([]), f = A(!1), c = A(""), h = b(() => Kl(l.value));
|
|
330
359
|
function y(V) {
|
|
331
360
|
const I = new Map(r.value);
|
|
332
361
|
for (const O of V) I.set(O.id, O);
|
|
333
362
|
r.value = I;
|
|
334
363
|
}
|
|
335
|
-
async function
|
|
364
|
+
async function p(V) {
|
|
336
365
|
const I = V.filter((O) => !r.value.has(O) && !u.value.has(O));
|
|
337
|
-
if (!(I.length === 0 ||
|
|
366
|
+
if (!(I.length === 0 || m.value))
|
|
338
367
|
try {
|
|
339
368
|
const O = await o.value.named(I);
|
|
340
369
|
y(O);
|
|
341
|
-
const
|
|
342
|
-
u.value = /* @__PURE__ */ new Set([...u.value, ...I.filter((ue) => !
|
|
370
|
+
const le = new Set(O.map((ue) => ue.id));
|
|
371
|
+
u.value = /* @__PURE__ */ new Set([...u.value, ...I.filter((ue) => !le.has(ue))]);
|
|
343
372
|
} catch (O) {
|
|
344
|
-
O instanceof
|
|
373
|
+
O instanceof $e && O.status === 403 && (m.value = !0);
|
|
345
374
|
}
|
|
346
375
|
}
|
|
347
376
|
re(
|
|
348
377
|
() => t.target,
|
|
349
378
|
() => {
|
|
350
|
-
r.value = /* @__PURE__ */ new Map(), u.value = /* @__PURE__ */ new Set(),
|
|
379
|
+
r.value = /* @__PURE__ */ new Map(), u.value = /* @__PURE__ */ new Set(), m.value = !1, v.value = [], p(h.value);
|
|
351
380
|
}
|
|
352
|
-
), re(
|
|
353
|
-
|
|
381
|
+
), re(h, (V) => {
|
|
382
|
+
p(V);
|
|
354
383
|
}, { immediate: !0 });
|
|
355
|
-
const
|
|
356
|
-
get: () =>
|
|
384
|
+
const _ = b({
|
|
385
|
+
get: () => h.value.map((V) => {
|
|
357
386
|
const I = r.value.get(V) ?? null;
|
|
358
387
|
return { id: V, title: I?.title || `#${V}`, candidate: I };
|
|
359
388
|
}),
|
|
360
389
|
set: (V) => {
|
|
361
390
|
l.value = V.map((I) => I.id);
|
|
362
391
|
}
|
|
363
|
-
}),
|
|
364
|
-
() =>
|
|
392
|
+
}), S = b(() => t.max !== null && h.value.length >= t.max), F = b(() => n !== null && n.type === t.target ? n.id.value : null), Y = b(
|
|
393
|
+
() => v.value.filter((V) => V.id !== F.value && !h.value.includes(V.id)).map((V) => ({
|
|
365
394
|
value: V.title,
|
|
366
395
|
description: [V.subtitle, V.visible ? null : i("relations.field-hidden")].filter((I) => typeof I == "string" && I !== "").join(" · "),
|
|
367
396
|
id: V.id
|
|
368
397
|
}))
|
|
369
398
|
);
|
|
370
|
-
async function
|
|
371
|
-
|
|
399
|
+
async function D(V) {
|
|
400
|
+
f.value = !0;
|
|
372
401
|
try {
|
|
373
402
|
const I = await o.value.search(V);
|
|
374
|
-
|
|
403
|
+
v.value = I, y(I);
|
|
375
404
|
} catch (I) {
|
|
376
|
-
|
|
405
|
+
v.value = [], I instanceof $e && I.status === 403 && (m.value = !0);
|
|
377
406
|
} finally {
|
|
378
|
-
|
|
407
|
+
f.value = !1;
|
|
379
408
|
}
|
|
380
409
|
}
|
|
381
|
-
function
|
|
410
|
+
function L(V) {
|
|
382
411
|
const I = Number(V.id);
|
|
383
|
-
!Number.isInteger(I) ||
|
|
412
|
+
!Number.isInteger(I) || h.value.includes(I) || S.value || (l.value = [...h.value, I], tt(() => {
|
|
384
413
|
c.value = "";
|
|
385
414
|
}));
|
|
386
415
|
}
|
|
387
|
-
function
|
|
388
|
-
l.value =
|
|
416
|
+
function T(V) {
|
|
417
|
+
l.value = h.value.filter((I) => I !== V);
|
|
389
418
|
}
|
|
390
|
-
const
|
|
391
|
-
() =>
|
|
419
|
+
const z = b(() => t.disabled || m.value), k = b(
|
|
420
|
+
() => S.value ? i("relations.field-full", { max: String(t.max) }) : t.addText ?? i("relations.field-add")
|
|
392
421
|
);
|
|
393
|
-
function
|
|
422
|
+
function H(V) {
|
|
394
423
|
return V.candidate === null ? u.value.has(V.id) ? i("relations.field-missing") : null : V.candidate.trashed === !0 ? i("relations.field-trashed") : V.candidate.visible ? null : i("relations.field-hidden");
|
|
395
424
|
}
|
|
396
425
|
return (V, I) => (d(), $("div", {
|
|
397
426
|
class: ve(["wx-relations-field", { "is-unordered": !t.sortable }])
|
|
398
427
|
}, [
|
|
399
|
-
|
|
400
|
-
modelValue:
|
|
401
|
-
"onUpdate:modelValue": I[0] || (I[0] = (O) =>
|
|
428
|
+
x(a(at), {
|
|
429
|
+
modelValue: _.value,
|
|
430
|
+
"onUpdate:modelValue": I[0] || (I[0] = (O) => _.value = O),
|
|
402
431
|
plain: "",
|
|
403
432
|
size: "sm",
|
|
404
433
|
"item-key": "id",
|
|
405
434
|
"item-label": "title",
|
|
406
|
-
disabled:
|
|
435
|
+
disabled: z.value || !t.sortable,
|
|
407
436
|
"empty-text": t.emptyText ?? a(i)("relations.field-empty"),
|
|
408
437
|
"drag-label": a(i)("relations.field-drag")
|
|
409
438
|
}, Re({
|
|
@@ -413,61 +442,61 @@ const ql = ["src"], Yl = { class: "wx-relations-field__text" }, Xl = { class: "w
|
|
|
413
442
|
class: "wx-relations-field__thumb",
|
|
414
443
|
src: O.candidate.thumb,
|
|
415
444
|
alt: ""
|
|
416
|
-
}, null, 8,
|
|
417
|
-
M("span",
|
|
418
|
-
M("span",
|
|
419
|
-
O.candidate?.subtitle ? (d(), $("span",
|
|
445
|
+
}, null, 8, Yl)) : U("", !0),
|
|
446
|
+
M("span", Xl, [
|
|
447
|
+
M("span", Jl, C(O.title), 1),
|
|
448
|
+
O.candidate?.subtitle ? (d(), $("span", Gl, C(O.candidate.subtitle), 1)) : U("", !0)
|
|
420
449
|
]),
|
|
421
|
-
|
|
450
|
+
H(O) ? (d(), W(a(Oe), {
|
|
422
451
|
key: 1,
|
|
423
452
|
type: "warning"
|
|
424
453
|
}, {
|
|
425
454
|
default: g(() => [
|
|
426
|
-
R(C(
|
|
455
|
+
R(C(H(O)), 1)
|
|
427
456
|
]),
|
|
428
457
|
_: 2
|
|
429
458
|
}, 1024)) : U("", !0)
|
|
430
459
|
]),
|
|
431
460
|
_: 2
|
|
432
461
|
}, [
|
|
433
|
-
|
|
462
|
+
z.value ? void 0 : {
|
|
434
463
|
name: "actions",
|
|
435
464
|
fn: g(({ item: O }) => [
|
|
436
|
-
|
|
465
|
+
x(a(be), {
|
|
437
466
|
type: "remove",
|
|
438
467
|
size: "sm",
|
|
439
468
|
title: a(i)("relations.field-remove"),
|
|
440
|
-
onClick: (
|
|
469
|
+
onClick: (le) => T(O.id)
|
|
441
470
|
}, null, 8, ["title", "onClick"])
|
|
442
471
|
]),
|
|
443
472
|
key: "0"
|
|
444
473
|
}
|
|
445
474
|
]), 1032, ["modelValue", "disabled", "empty-text", "drag-label"]),
|
|
446
|
-
|
|
447
|
-
|
|
475
|
+
m.value ? (d(), $("p", Ql, C(a(i)("relations.field-forbidden")), 1)) : (d(), $("div", Zl, [
|
|
476
|
+
x(a(Xe), {
|
|
448
477
|
modelValue: c.value,
|
|
449
478
|
"onUpdate:modelValue": I[1] || (I[1] = (O) => c.value = O),
|
|
450
|
-
options:
|
|
479
|
+
options: Y.value,
|
|
451
480
|
remote: "",
|
|
452
481
|
teleport: "",
|
|
453
|
-
loading:
|
|
482
|
+
loading: f.value,
|
|
454
483
|
"loading-text": a(i)("relations.field-searching"),
|
|
455
484
|
"empty-text": a(i)("relations.field-nothing"),
|
|
456
|
-
placeholder:
|
|
457
|
-
"aria-label":
|
|
458
|
-
disabled: t.disabled ||
|
|
459
|
-
onSearch:
|
|
460
|
-
onSelect:
|
|
485
|
+
placeholder: k.value,
|
|
486
|
+
"aria-label": k.value,
|
|
487
|
+
disabled: t.disabled || S.value,
|
|
488
|
+
onSearch: D,
|
|
489
|
+
onSelect: L
|
|
461
490
|
}, null, 8, ["modelValue", "options", "loading", "loading-text", "empty-text", "placeholder", "aria-label", "disabled"])
|
|
462
491
|
]))
|
|
463
492
|
], 2));
|
|
464
493
|
}
|
|
465
|
-
}), Nt = /* @__PURE__ */
|
|
466
|
-
function
|
|
494
|
+
}), Nt = /* @__PURE__ */ se(ea, [["__scopeId", "data-v-5ecf0e47"]]), Et = 100, He = /* @__PURE__ */ new WeakMap();
|
|
495
|
+
function ta(e) {
|
|
467
496
|
let t = He.get(e);
|
|
468
|
-
return t === void 0 && (t = e.http.get(`${e.apiPath}/collections`).then((l) => l.data.map((s) => ({ ...s, relations:
|
|
497
|
+
return t === void 0 && (t = e.http.get(`${e.apiPath}/collections`).then((l) => l.data.map((s) => ({ ...s, relations: la(s) }))), t.catch(() => He.delete(e)), He.set(e, t)), t;
|
|
469
498
|
}
|
|
470
|
-
function
|
|
499
|
+
function la(e) {
|
|
471
500
|
return Array.isArray(e.relations) ? e.relations.flatMap((t) => {
|
|
472
501
|
if (typeof t == "string") return t === "" ? [] : [{ key: t, title: t }];
|
|
473
502
|
if (typeof t == "object" && t !== null && typeof t.key == "string") {
|
|
@@ -482,7 +511,7 @@ function Ut(e) {
|
|
|
482
511
|
(t, l) => t - l
|
|
483
512
|
) : [];
|
|
484
513
|
}
|
|
485
|
-
function
|
|
514
|
+
function aa(e) {
|
|
486
515
|
if (typeof e != "object" || e === null || Array.isArray(e)) return null;
|
|
487
516
|
const {
|
|
488
517
|
type: t,
|
|
@@ -494,32 +523,32 @@ function la(e) {
|
|
|
494
523
|
const n = Ut(l);
|
|
495
524
|
return typeof t == "string" && t !== "" && n.length > 0 ? { type: t, ids: n } : null;
|
|
496
525
|
}
|
|
497
|
-
function
|
|
526
|
+
function ht(e) {
|
|
498
527
|
const t = typeof e == "object" && e !== null && !Array.isArray(e) ? e : {}, l = typeof t.limit == "number" && Number.isInteger(t.limit) ? t.limit : null;
|
|
499
528
|
return {
|
|
500
529
|
categories: Ut(t.categories),
|
|
501
|
-
related:
|
|
530
|
+
related: aa(t.related),
|
|
502
531
|
limit: l !== null && l >= 1 ? Math.min(l, Et) : null,
|
|
503
532
|
filter: t.filter === !0,
|
|
504
533
|
markup: typeof t.markup == "boolean" ? t.markup : null
|
|
505
534
|
};
|
|
506
535
|
}
|
|
507
|
-
function
|
|
536
|
+
function yt(e) {
|
|
508
537
|
return e.categories.length === 0 && e.related === null;
|
|
509
538
|
}
|
|
510
|
-
const
|
|
539
|
+
const na = ["aria-busy"], oa = {
|
|
511
540
|
key: 0,
|
|
512
541
|
class: "wx-collection-field__note"
|
|
513
|
-
},
|
|
542
|
+
}, sa = { class: "wx-collection-field__note" }, ia = {
|
|
514
543
|
key: 0,
|
|
515
544
|
class: "wx-collection-field__row"
|
|
516
|
-
},
|
|
545
|
+
}, ra = ["for"], ua = {
|
|
517
546
|
key: 1,
|
|
518
547
|
class: "wx-collection-field__row"
|
|
519
|
-
},
|
|
548
|
+
}, da = { class: "wx-collection-field__label" }, ca = { class: "wx-collection-field__hint" }, fa = { class: "wx-collection-field__row" }, ma = ["for"], va = { class: "wx-collection-field__limit" }, pa = {
|
|
520
549
|
key: 3,
|
|
521
550
|
class: "wx-collection-field__markup"
|
|
522
|
-
},
|
|
551
|
+
}, ha = { class: "wx-collection-field__hint" }, ya = /* @__PURE__ */ K({
|
|
523
552
|
name: "WxCollectionField",
|
|
524
553
|
__name: "CollectionField",
|
|
525
554
|
props: /* @__PURE__ */ me({
|
|
@@ -531,83 +560,83 @@ const aa = ["aria-busy"], na = {
|
|
|
531
560
|
}),
|
|
532
561
|
emits: ["update:modelValue"],
|
|
533
562
|
setup(e) {
|
|
534
|
-
const t = e, l = ge(e, "modelValue"), s =
|
|
563
|
+
const t = e, l = ge(e, "modelValue"), s = te(), n = J("webx-admin"), i = qt(), o = A(void 0), r = A([]);
|
|
535
564
|
re(
|
|
536
565
|
() => t.source,
|
|
537
|
-
async (
|
|
566
|
+
async (T) => {
|
|
538
567
|
o.value = void 0, r.value = [];
|
|
539
568
|
try {
|
|
540
|
-
o.value = (await
|
|
569
|
+
o.value = (await ta(s)).find((z) => z.key === T) ?? null;
|
|
541
570
|
} catch {
|
|
542
571
|
o.value = null;
|
|
543
572
|
}
|
|
544
573
|
if (o.value?.categories)
|
|
545
574
|
try {
|
|
546
|
-
const
|
|
547
|
-
r.value =
|
|
575
|
+
const z = await _e(s, o.value.categories).list();
|
|
576
|
+
r.value = z.data.map((k) => ({ label: k.name, value: k.id }));
|
|
548
577
|
} catch {
|
|
549
578
|
r.value = [];
|
|
550
579
|
}
|
|
551
580
|
},
|
|
552
581
|
{ immediate: !0 }
|
|
553
582
|
);
|
|
554
|
-
const u =
|
|
555
|
-
function
|
|
556
|
-
l.value =
|
|
583
|
+
const u = b(() => ht(l.value));
|
|
584
|
+
function m(T) {
|
|
585
|
+
l.value = ht({ ...u.value, ...T });
|
|
557
586
|
}
|
|
558
|
-
const
|
|
559
|
-
const
|
|
560
|
-
return [...r.value, ...
|
|
587
|
+
const v = b(() => {
|
|
588
|
+
const T = new Set(r.value.map((k) => k.value)), z = u.value.categories.filter((k) => !T.has(k)).map((k) => ({ label: `#${k}`, value: k }));
|
|
589
|
+
return [...r.value, ...z];
|
|
561
590
|
});
|
|
562
|
-
function
|
|
563
|
-
|
|
564
|
-
}
|
|
565
|
-
function c(
|
|
566
|
-
|
|
567
|
-
}
|
|
568
|
-
const
|
|
569
|
-
() => (o.value?.relations ?? []).map((
|
|
570
|
-
),
|
|
571
|
-
const
|
|
572
|
-
if (
|
|
573
|
-
const
|
|
574
|
-
return
|
|
591
|
+
function f(T) {
|
|
592
|
+
m({ categories: Array.isArray(T) ? T.map(Number) : [] });
|
|
593
|
+
}
|
|
594
|
+
function c(T) {
|
|
595
|
+
m({ limit: T ?? null });
|
|
596
|
+
}
|
|
597
|
+
const h = A(null), y = b(
|
|
598
|
+
() => (o.value?.relations ?? []).map((T) => ({ label: T.title, value: T.key }))
|
|
599
|
+
), p = b(() => {
|
|
600
|
+
const T = o.value?.relations ?? [];
|
|
601
|
+
if (T.length === 1) return T[0];
|
|
602
|
+
const z = u.value.related?.type ?? h.value;
|
|
603
|
+
return T.find((k) => k.key === z) ?? null;
|
|
575
604
|
});
|
|
576
|
-
function
|
|
577
|
-
|
|
605
|
+
function _(T) {
|
|
606
|
+
h.value = typeof T == "string" ? T : null, m({ related: null });
|
|
578
607
|
}
|
|
579
|
-
function T
|
|
580
|
-
const
|
|
581
|
-
|
|
608
|
+
function S(T) {
|
|
609
|
+
const z = p.value?.key;
|
|
610
|
+
m({ related: z && T && T.length > 0 ? { type: z, ids: T } : null });
|
|
582
611
|
}
|
|
583
|
-
function
|
|
584
|
-
const
|
|
585
|
-
|
|
612
|
+
function F(T) {
|
|
613
|
+
const z = p.value?.key;
|
|
614
|
+
m({ related: T && z ? { type: z, ids: [], current: !0 } : null });
|
|
586
615
|
}
|
|
587
|
-
const
|
|
588
|
-
function
|
|
589
|
-
|
|
616
|
+
const Y = b(() => u.value.markup ?? yt(u.value));
|
|
617
|
+
function D(T) {
|
|
618
|
+
m({ markup: T === !0 });
|
|
590
619
|
}
|
|
591
|
-
const
|
|
620
|
+
const L = b(
|
|
592
621
|
() => n(
|
|
593
|
-
|
|
622
|
+
yt(u.value) ? "collections.field-markup-auto-on" : "collections.field-markup-auto-off"
|
|
594
623
|
)
|
|
595
624
|
);
|
|
596
|
-
return (
|
|
625
|
+
return (T, z) => (d(), $("div", {
|
|
597
626
|
class: "wx-collection-field",
|
|
598
627
|
"aria-busy": o.value === void 0
|
|
599
628
|
}, [
|
|
600
|
-
o.value === null ? (d(), $("p",
|
|
601
|
-
M("p",
|
|
602
|
-
o.value.categories ? (d(), $("div",
|
|
629
|
+
o.value === null ? (d(), $("p", oa, C(a(n)("collections.field-unavailable", { source: t.source })), 1)) : o.value ? (d(), $(j, { key: 1 }, [
|
|
630
|
+
M("p", sa, C(a(n)("collections.field-source", { source: o.value.title })), 1),
|
|
631
|
+
o.value.categories ? (d(), $("div", ia, [
|
|
603
632
|
M("label", {
|
|
604
633
|
class: "wx-collection-field__label",
|
|
605
634
|
for: `${a(i)}-categories`
|
|
606
|
-
}, C(a(n)("collections.field-categories")), 9,
|
|
607
|
-
|
|
635
|
+
}, C(a(n)("collections.field-categories")), 9, ra),
|
|
636
|
+
x(a(ke), {
|
|
608
637
|
id: `${a(i)}-categories`,
|
|
609
638
|
"model-value": u.value.categories,
|
|
610
|
-
options:
|
|
639
|
+
options: v.value,
|
|
611
640
|
placeholder: u.value.categories.length === 0 ? a(n)("collections.field-all") : "",
|
|
612
641
|
"empty-text": a(n)("collections.field-no-categories"),
|
|
613
642
|
disabled: t.disabled,
|
|
@@ -615,48 +644,48 @@ const aa = ["aria-busy"], na = {
|
|
|
615
644
|
filterable: "",
|
|
616
645
|
clearable: "",
|
|
617
646
|
teleport: "",
|
|
618
|
-
"onUpdate:modelValue":
|
|
647
|
+
"onUpdate:modelValue": f
|
|
619
648
|
}, null, 8, ["id", "model-value", "options", "placeholder", "empty-text", "disabled"])
|
|
620
649
|
])) : U("", !0),
|
|
621
|
-
o.value.relations.length > 0 ? (d(), $("div",
|
|
622
|
-
M("span",
|
|
623
|
-
o.value.relations.length > 1 ? (d(),
|
|
650
|
+
o.value.relations.length > 0 ? (d(), $("div", ua, [
|
|
651
|
+
M("span", da, C(o.value.relations.length === 1 ? a(n)("relations.collection-related-to", { target: o.value.relations[0].title }) : a(n)("relations.collection-related")), 1),
|
|
652
|
+
o.value.relations.length > 1 ? (d(), W(a(ke), {
|
|
624
653
|
key: 0,
|
|
625
|
-
"model-value":
|
|
654
|
+
"model-value": p.value?.key ?? null,
|
|
626
655
|
options: y.value,
|
|
627
656
|
placeholder: a(n)("relations.collection-related-type"),
|
|
628
657
|
"aria-label": a(n)("relations.collection-related-type"),
|
|
629
658
|
disabled: t.disabled,
|
|
630
659
|
clearable: "",
|
|
631
660
|
teleport: "",
|
|
632
|
-
"onUpdate:modelValue":
|
|
661
|
+
"onUpdate:modelValue": _
|
|
633
662
|
}, null, 8, ["model-value", "options", "placeholder", "aria-label", "disabled"])) : U("", !0),
|
|
634
|
-
|
|
635
|
-
|
|
663
|
+
p.value ? (d(), $(j, { key: 1 }, [
|
|
664
|
+
x(a(Fe), {
|
|
636
665
|
"model-value": u.value.related?.current === !0,
|
|
637
666
|
label: a(n)("relations.collection-related-current"),
|
|
638
667
|
disabled: t.disabled,
|
|
639
|
-
"onUpdate:modelValue":
|
|
668
|
+
"onUpdate:modelValue": z[0] || (z[0] = (k) => F(k === !0))
|
|
640
669
|
}, null, 8, ["model-value", "label", "disabled"]),
|
|
641
|
-
M("p",
|
|
670
|
+
M("p", ca, C(a(n)("relations.collection-related-current-hint", { target: p.value.title })), 1)
|
|
642
671
|
], 64)) : U("", !0),
|
|
643
|
-
|
|
672
|
+
p.value && u.value.related?.current !== !0 ? (d(), W(Nt, {
|
|
644
673
|
key: 2,
|
|
645
674
|
"model-value": u.value.related?.ids ?? [],
|
|
646
|
-
target:
|
|
675
|
+
target: p.value.key,
|
|
647
676
|
sortable: !1,
|
|
648
677
|
"empty-text": a(n)("relations.collection-related-any"),
|
|
649
678
|
disabled: t.disabled,
|
|
650
|
-
"onUpdate:modelValue":
|
|
679
|
+
"onUpdate:modelValue": S
|
|
651
680
|
}, null, 8, ["model-value", "target", "empty-text", "disabled"])) : U("", !0)
|
|
652
681
|
])) : U("", !0),
|
|
653
|
-
M("div",
|
|
682
|
+
M("div", fa, [
|
|
654
683
|
M("label", {
|
|
655
684
|
class: "wx-collection-field__label",
|
|
656
685
|
for: `${a(i)}-limit`
|
|
657
|
-
}, C(a(n)("collections.field-limit")), 9,
|
|
658
|
-
M("div",
|
|
659
|
-
|
|
686
|
+
}, C(a(n)("collections.field-limit")), 9, ma),
|
|
687
|
+
M("div", va, [
|
|
688
|
+
x(a(sl), {
|
|
660
689
|
id: `${a(i)}-limit`,
|
|
661
690
|
"model-value": u.value.limit,
|
|
662
691
|
min: 1,
|
|
@@ -669,28 +698,28 @@ const aa = ["aria-busy"], na = {
|
|
|
669
698
|
}, null, 8, ["id", "model-value", "max", "placeholder", "disabled"])
|
|
670
699
|
])
|
|
671
700
|
]),
|
|
672
|
-
o.value.categories ? (d(),
|
|
701
|
+
o.value.categories ? (d(), W(a(Fe), {
|
|
673
702
|
key: 2,
|
|
674
703
|
"model-value": u.value.filter,
|
|
675
704
|
label: a(n)("collections.field-filter"),
|
|
676
705
|
disabled: t.disabled,
|
|
677
|
-
"onUpdate:modelValue":
|
|
706
|
+
"onUpdate:modelValue": z[1] || (z[1] = (k) => m({ filter: k === !0 }))
|
|
678
707
|
}, null, 8, ["model-value", "label", "disabled"])) : U("", !0),
|
|
679
|
-
o.value.markup ? (d(), $("div",
|
|
680
|
-
|
|
681
|
-
"model-value":
|
|
708
|
+
o.value.markup ? (d(), $("div", pa, [
|
|
709
|
+
x(a(Fe), {
|
|
710
|
+
"model-value": Y.value,
|
|
682
711
|
label: a(n)("collections.field-markup"),
|
|
683
712
|
disabled: t.disabled,
|
|
684
|
-
"onUpdate:modelValue":
|
|
713
|
+
"onUpdate:modelValue": D
|
|
685
714
|
}, null, 8, ["model-value", "label", "disabled"]),
|
|
686
|
-
M("p",
|
|
687
|
-
u.value.markup !== null ? (d(),
|
|
715
|
+
M("p", ha, C(L.value), 1),
|
|
716
|
+
u.value.markup !== null ? (d(), W(a(ce), {
|
|
688
717
|
key: 0,
|
|
689
718
|
class: "wx-collection-field__reset",
|
|
690
719
|
variant: "text",
|
|
691
720
|
size: "sm",
|
|
692
721
|
disabled: t.disabled,
|
|
693
|
-
onClick:
|
|
722
|
+
onClick: z[2] || (z[2] = (k) => m({ markup: null }))
|
|
694
723
|
}, {
|
|
695
724
|
default: g(() => [
|
|
696
725
|
R(C(a(n)("collections.field-markup-reset")), 1)
|
|
@@ -699,10 +728,10 @@ const aa = ["aria-busy"], na = {
|
|
|
699
728
|
}, 8, ["disabled"])) : U("", !0)
|
|
700
729
|
])) : U("", !0)
|
|
701
730
|
], 64)) : U("", !0)
|
|
702
|
-
], 8,
|
|
731
|
+
], 8, na));
|
|
703
732
|
}
|
|
704
|
-
}),
|
|
705
|
-
function
|
|
733
|
+
}), ga = /* @__PURE__ */ se(ya, [["__scopeId", "data-v-023ad095"]]);
|
|
734
|
+
function ba() {
|
|
706
735
|
return {
|
|
707
736
|
target: "entity",
|
|
708
737
|
entity_type: null,
|
|
@@ -713,7 +742,7 @@ function ga() {
|
|
|
713
742
|
rel: []
|
|
714
743
|
};
|
|
715
744
|
}
|
|
716
|
-
function
|
|
745
|
+
function wa(e) {
|
|
717
746
|
const t = `${e.apiPath}/links`, l = (s) => s.data;
|
|
718
747
|
return {
|
|
719
748
|
sources: () => e.http.get(`${t}/sources`).then(l),
|
|
@@ -722,19 +751,19 @@ function ba(e) {
|
|
|
722
751
|
routes: () => e.http.get(`${t}/routes`).then(l)
|
|
723
752
|
};
|
|
724
753
|
}
|
|
725
|
-
const
|
|
754
|
+
const _a = { class: "wx-link-picker" }, xa = {
|
|
726
755
|
key: 0,
|
|
727
756
|
class: "wx-link-picker__entity"
|
|
728
|
-
},
|
|
757
|
+
}, ka = {
|
|
729
758
|
key: 1,
|
|
730
759
|
class: "wx-link-picker__url"
|
|
731
|
-
},
|
|
760
|
+
}, $a = {
|
|
732
761
|
key: 2,
|
|
733
762
|
class: "wx-link-picker__hash"
|
|
734
|
-
},
|
|
763
|
+
}, Sa = {
|
|
735
764
|
key: 3,
|
|
736
765
|
class: "wx-link-picker__attributes"
|
|
737
|
-
},
|
|
766
|
+
}, Ta = { class: "wx-link-picker__rel" }, Ca = /* @__PURE__ */ K({
|
|
738
767
|
name: "WxLinkPicker",
|
|
739
768
|
__name: "LinkPicker",
|
|
740
769
|
props: /* @__PURE__ */ me({
|
|
@@ -747,134 +776,134 @@ const wa = { class: "wx-link-picker" }, _a = {
|
|
|
747
776
|
}),
|
|
748
777
|
emits: ["update:modelValue"],
|
|
749
778
|
setup(e) {
|
|
750
|
-
const t = e, l = ge(e, "modelValue"), s =
|
|
779
|
+
const t = e, l = ge(e, "modelValue"), s = te(), n = Nl(), i = wa(s), o = J("webx-admin"), r = A([]), u = A([]), m = A([]), v = A(!1), f = A(null), c = A(""), h = A(null);
|
|
751
780
|
let y = null;
|
|
752
|
-
const
|
|
753
|
-
const
|
|
781
|
+
const p = b(() => l.value ?? ba()), _ = b(() => {
|
|
782
|
+
const w = [
|
|
754
783
|
{ value: "entity", label: o("links.target-entity") },
|
|
755
784
|
{ value: "url", label: o("links.target-url") }
|
|
756
785
|
];
|
|
757
|
-
return t.allowNone ? [...
|
|
758
|
-
}),
|
|
759
|
-
() => r.value.map((
|
|
760
|
-
),
|
|
761
|
-
() => u.value.map((
|
|
762
|
-
value:
|
|
763
|
-
description: P(
|
|
764
|
-
id:
|
|
786
|
+
return t.allowNone ? [...w, { value: "none", label: o("links.target-none") }] : w;
|
|
787
|
+
}), S = b(
|
|
788
|
+
() => r.value.map((w) => ({ value: w.type, label: w.title }))
|
|
789
|
+
), F = b(
|
|
790
|
+
() => u.value.map((w) => ({
|
|
791
|
+
value: w.title,
|
|
792
|
+
description: P(w),
|
|
793
|
+
id: w.id
|
|
765
794
|
}))
|
|
766
|
-
),
|
|
767
|
-
() =>
|
|
795
|
+
), Y = b(
|
|
796
|
+
() => m.value.map((w) => ({ value: w.path, description: w.name }))
|
|
768
797
|
);
|
|
769
798
|
Ie(async () => {
|
|
770
|
-
r.value = await i.sources(),
|
|
799
|
+
r.value = await i.sources(), f.value = p.value.entity_type ?? r.value[0]?.type ?? null, await Promise.all([D(), L()]);
|
|
771
800
|
}), re(
|
|
772
|
-
() => [
|
|
801
|
+
() => [p.value.entity_type, p.value.entity_id].join(":"),
|
|
773
802
|
() => {
|
|
774
|
-
|
|
803
|
+
D();
|
|
775
804
|
}
|
|
776
805
|
);
|
|
777
|
-
async function
|
|
778
|
-
const { entity_type:
|
|
779
|
-
if (
|
|
780
|
-
|
|
806
|
+
async function D() {
|
|
807
|
+
const { entity_type: w, entity_id: N } = p.value;
|
|
808
|
+
if (w === null || N === null) {
|
|
809
|
+
h.value = null, c.value = "";
|
|
781
810
|
return;
|
|
782
811
|
}
|
|
783
|
-
if (
|
|
812
|
+
if (h.value?.id === N)
|
|
784
813
|
return;
|
|
785
|
-
const [E] = await i.resolve([{ type:
|
|
786
|
-
|
|
814
|
+
const [E] = await i.resolve([{ type: w, id: N }], n.state.locale);
|
|
815
|
+
h.value = E ?? null, c.value = E?.title ?? o("links.missing"), y = c.value;
|
|
787
816
|
}
|
|
788
|
-
async function
|
|
789
|
-
|
|
817
|
+
async function L() {
|
|
818
|
+
m.value = await i.routes();
|
|
790
819
|
}
|
|
791
|
-
async function
|
|
792
|
-
if (
|
|
820
|
+
async function T(w) {
|
|
821
|
+
if (w === y) {
|
|
793
822
|
y = null;
|
|
794
823
|
return;
|
|
795
824
|
}
|
|
796
|
-
if (y = null,
|
|
797
|
-
|
|
825
|
+
if (y = null, f.value !== null) {
|
|
826
|
+
v.value = !0;
|
|
798
827
|
try {
|
|
799
|
-
u.value = await i.search(
|
|
828
|
+
u.value = await i.search(f.value, w, n.state.locale);
|
|
800
829
|
} finally {
|
|
801
|
-
|
|
830
|
+
v.value = !1;
|
|
802
831
|
}
|
|
803
832
|
}
|
|
804
833
|
}
|
|
805
|
-
function
|
|
806
|
-
|
|
834
|
+
function z(w) {
|
|
835
|
+
w !== void 0 && (l.value = { ...p.value, target: w });
|
|
807
836
|
}
|
|
808
|
-
function
|
|
809
|
-
|
|
837
|
+
function k(w) {
|
|
838
|
+
f.value = w == null ? null : String(w), u.value = [], T("");
|
|
810
839
|
}
|
|
811
|
-
function
|
|
812
|
-
const N = u.value.find((E) => E.id ===
|
|
813
|
-
N === void 0 ||
|
|
840
|
+
function H(w) {
|
|
841
|
+
const N = u.value.find((E) => E.id === w.id);
|
|
842
|
+
N === void 0 || f.value === null || (h.value = N, c.value = N.title, l.value = { ...p.value, entity_type: f.value, entity_id: N.id });
|
|
814
843
|
}
|
|
815
844
|
function V() {
|
|
816
|
-
|
|
845
|
+
h.value = null, c.value = "", u.value = [], l.value = { ...p.value, entity_type: null, entity_id: null };
|
|
817
846
|
}
|
|
818
|
-
function I(
|
|
819
|
-
l.value = { ...
|
|
847
|
+
function I(w) {
|
|
848
|
+
l.value = { ...p.value, url: w === "" ? null : w };
|
|
820
849
|
}
|
|
821
|
-
function O(
|
|
822
|
-
const N = (typeof
|
|
823
|
-
l.value = { ...
|
|
850
|
+
function O(w) {
|
|
851
|
+
const N = (typeof w == "string" || typeof w == "number" ? String(w) : "").replace(/^#+/, "").trim();
|
|
852
|
+
l.value = { ...p.value, hash: N === "" ? null : N };
|
|
824
853
|
}
|
|
825
|
-
function
|
|
826
|
-
l.value = { ...
|
|
854
|
+
function le(w) {
|
|
855
|
+
l.value = { ...p.value, new_tab: w };
|
|
827
856
|
}
|
|
828
|
-
function ue(
|
|
829
|
-
const E =
|
|
830
|
-
l.value = { ...
|
|
857
|
+
function ue(w, N) {
|
|
858
|
+
const E = p.value.rel.filter((X) => X !== w);
|
|
859
|
+
l.value = { ...p.value, rel: N ? [...E, w] : E };
|
|
831
860
|
}
|
|
832
|
-
function P(
|
|
833
|
-
const N = [
|
|
861
|
+
function P(w) {
|
|
862
|
+
const N = [w.hint, w.url ?? void 0].filter(
|
|
834
863
|
(E) => typeof E == "string" && E !== ""
|
|
835
864
|
);
|
|
836
|
-
return
|
|
865
|
+
return w.available || N.push(o("links.unavailable")), N.join(" · ");
|
|
837
866
|
}
|
|
838
867
|
const ee = ["nofollow", "sponsored", "ugc"];
|
|
839
|
-
return (
|
|
840
|
-
|
|
841
|
-
options:
|
|
842
|
-
"model-value":
|
|
868
|
+
return (w, N) => (d(), $("div", _a, [
|
|
869
|
+
x(a(il), {
|
|
870
|
+
options: _.value,
|
|
871
|
+
"model-value": p.value.target,
|
|
843
872
|
disabled: t.disabled,
|
|
844
873
|
"aria-label": a(o)("links.target-entity"),
|
|
845
|
-
"onUpdate:modelValue":
|
|
874
|
+
"onUpdate:modelValue": z
|
|
846
875
|
}, null, 8, ["options", "model-value", "disabled", "aria-label"]),
|
|
847
|
-
|
|
848
|
-
|
|
876
|
+
p.value.target === "entity" ? (d(), $("div", xa, [
|
|
877
|
+
S.value.length > 1 ? (d(), W(a(ke), {
|
|
849
878
|
key: 0,
|
|
850
879
|
class: "wx-link-picker__section",
|
|
851
|
-
options:
|
|
852
|
-
"model-value":
|
|
880
|
+
options: S.value,
|
|
881
|
+
"model-value": f.value,
|
|
853
882
|
disabled: t.disabled,
|
|
854
883
|
"aria-label": a(o)("links.section"),
|
|
855
|
-
"onUpdate:modelValue":
|
|
884
|
+
"onUpdate:modelValue": k
|
|
856
885
|
}, null, 8, ["options", "model-value", "disabled", "aria-label"])) : U("", !0),
|
|
857
|
-
|
|
886
|
+
x(a(Xe), {
|
|
858
887
|
class: "wx-link-picker__search",
|
|
859
888
|
"model-value": c.value,
|
|
860
|
-
options:
|
|
889
|
+
options: F.value,
|
|
861
890
|
remote: "",
|
|
862
891
|
clearable: "",
|
|
863
|
-
loading:
|
|
892
|
+
loading: v.value,
|
|
864
893
|
"loading-text": a(o)("links.searching"),
|
|
865
894
|
"empty-text": a(o)("links.empty"),
|
|
866
895
|
placeholder: a(o)("links.search"),
|
|
867
896
|
"aria-label": a(o)("links.search"),
|
|
868
897
|
disabled: t.disabled,
|
|
869
898
|
"onUpdate:modelValue": N[0] || (N[0] = (E) => c.value = E),
|
|
870
|
-
onSearch:
|
|
871
|
-
onSelect:
|
|
899
|
+
onSearch: T,
|
|
900
|
+
onSelect: H,
|
|
872
901
|
onClear: V
|
|
873
902
|
}, null, 8, ["model-value", "options", "loading", "loading-text", "empty-text", "placeholder", "aria-label", "disabled"])
|
|
874
|
-
])) :
|
|
875
|
-
|
|
876
|
-
"model-value":
|
|
877
|
-
options:
|
|
903
|
+
])) : p.value.target === "url" ? (d(), $("div", ka, [
|
|
904
|
+
x(a(Xe), {
|
|
905
|
+
"model-value": p.value.url ?? "",
|
|
906
|
+
options: Y.value,
|
|
878
907
|
clearable: "",
|
|
879
908
|
"open-on-focus": "",
|
|
880
909
|
"empty-text": a(o)("links.url-routes"),
|
|
@@ -884,8 +913,8 @@ const wa = { class: "wx-link-picker" }, _a = {
|
|
|
884
913
|
"onUpdate:modelValue": I
|
|
885
914
|
}, null, 8, ["model-value", "options", "empty-text", "placeholder", "aria-label", "disabled"])
|
|
886
915
|
])) : U("", !0),
|
|
887
|
-
|
|
888
|
-
|
|
916
|
+
p.value.target !== "none" ? (d(), $("label", $a, [
|
|
917
|
+
x(a(Q), {
|
|
889
918
|
size: "sm",
|
|
890
919
|
tone: "muted"
|
|
891
920
|
}, {
|
|
@@ -898,8 +927,8 @@ const wa = { class: "wx-link-picker" }, _a = {
|
|
|
898
927
|
class: "wx-link-picker__sign",
|
|
899
928
|
"aria-hidden": "true"
|
|
900
929
|
}, "#", -1)),
|
|
901
|
-
|
|
902
|
-
"model-value":
|
|
930
|
+
x(a(Se), {
|
|
931
|
+
"model-value": p.value.hash ?? "",
|
|
903
932
|
placeholder: a(o)("links.hash-placeholder"),
|
|
904
933
|
"aria-label": a(o)("links.hash"),
|
|
905
934
|
disabled: t.disabled,
|
|
@@ -907,19 +936,19 @@ const wa = { class: "wx-link-picker" }, _a = {
|
|
|
907
936
|
"onUpdate:modelValue": O
|
|
908
937
|
}, null, 8, ["model-value", "placeholder", "aria-label", "disabled"])
|
|
909
938
|
])) : U("", !0),
|
|
910
|
-
t.attributes &&
|
|
911
|
-
|
|
912
|
-
"model-value":
|
|
939
|
+
t.attributes && p.value.target !== "none" ? (d(), $("div", Sa, [
|
|
940
|
+
x(a(ft), {
|
|
941
|
+
"model-value": p.value.new_tab,
|
|
913
942
|
disabled: t.disabled,
|
|
914
|
-
"onUpdate:modelValue": N[1] || (N[1] = (E) =>
|
|
943
|
+
"onUpdate:modelValue": N[1] || (N[1] = (E) => le(E))
|
|
915
944
|
}, {
|
|
916
945
|
default: g(() => [
|
|
917
946
|
R(C(a(o)("links.new-tab")), 1)
|
|
918
947
|
]),
|
|
919
948
|
_: 1
|
|
920
949
|
}, 8, ["model-value", "disabled"]),
|
|
921
|
-
M("div",
|
|
922
|
-
|
|
950
|
+
M("div", Ta, [
|
|
951
|
+
x(a(Q), {
|
|
923
952
|
size: "sm",
|
|
924
953
|
tone: "muted"
|
|
925
954
|
}, {
|
|
@@ -928,11 +957,11 @@ const wa = { class: "wx-link-picker" }, _a = {
|
|
|
928
957
|
]),
|
|
929
958
|
_: 1
|
|
930
959
|
}),
|
|
931
|
-
(d(), $(
|
|
960
|
+
(d(), $(j, null, ie(ee, (E) => x(a(ft), {
|
|
932
961
|
key: E,
|
|
933
|
-
"model-value":
|
|
962
|
+
"model-value": p.value.rel.includes(E),
|
|
934
963
|
disabled: t.disabled,
|
|
935
|
-
"onUpdate:modelValue": (
|
|
964
|
+
"onUpdate:modelValue": (X) => ue(E, X)
|
|
936
965
|
}, {
|
|
937
966
|
default: g(() => [
|
|
938
967
|
R(C(a(o)(`links.rel-${E}`)), 1)
|
|
@@ -943,7 +972,7 @@ const wa = { class: "wx-link-picker" }, _a = {
|
|
|
943
972
|
])) : U("", !0)
|
|
944
973
|
]));
|
|
945
974
|
}
|
|
946
|
-
}),
|
|
975
|
+
}), Aa = /* @__PURE__ */ se(Ca, [["__scopeId", "data-v-e54022e5"]]), Wa = /* @__PURE__ */ K({
|
|
947
976
|
name: "WxLinkField",
|
|
948
977
|
inheritAttrs: !1,
|
|
949
978
|
__name: "LinkField",
|
|
@@ -958,7 +987,7 @@ const wa = { class: "wx-link-picker" }, _a = {
|
|
|
958
987
|
emits: ["update:modelValue"],
|
|
959
988
|
setup(e) {
|
|
960
989
|
const t = e, l = ge(e, "modelValue");
|
|
961
|
-
return (s, n) => (d(),
|
|
990
|
+
return (s, n) => (d(), W(Aa, et({
|
|
962
991
|
modelValue: l.value,
|
|
963
992
|
"onUpdate:modelValue": n[0] || (n[0] = (i) => l.value = i)
|
|
964
993
|
}, s.$attrs, {
|
|
@@ -1260,20 +1289,20 @@ const wa = { class: "wx-link-picker" }, _a = {
|
|
|
1260
1289
|
"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."
|
|
1261
1290
|
}
|
|
1262
1291
|
};
|
|
1263
|
-
function
|
|
1292
|
+
function La(e) {
|
|
1264
1293
|
const t = e.scope("webx-admin"), l = /* @__PURE__ */ new Map();
|
|
1265
1294
|
function s(i, o, r) {
|
|
1266
|
-
const u = e.state.locale,
|
|
1267
|
-
let
|
|
1268
|
-
return
|
|
1295
|
+
const u = e.state.locale, m = `${u}:${i}`;
|
|
1296
|
+
let v = l.get(m);
|
|
1297
|
+
return v === void 0 && (v = new Intl.DateTimeFormat(u, o), l.set(m, v)), v.format(r);
|
|
1269
1298
|
}
|
|
1270
1299
|
const n = (i) => s("time", { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }, i);
|
|
1271
1300
|
return {
|
|
1272
1301
|
short(i) {
|
|
1273
|
-
const o =
|
|
1302
|
+
const o = Ce(i);
|
|
1274
1303
|
if (o === null)
|
|
1275
1304
|
return t("dates.never");
|
|
1276
|
-
const r = /* @__PURE__ */ new Date(), u =
|
|
1305
|
+
const r = /* @__PURE__ */ new Date(), u = gt(o, r);
|
|
1277
1306
|
return u === 0 ? t("dates.today", { time: n(o) }) : u === -1 ? t("dates.yesterday", { time: n(o) }) : o.getFullYear() === r.getFullYear() ? s(
|
|
1278
1307
|
"this-year",
|
|
1279
1308
|
{
|
|
@@ -1287,41 +1316,41 @@ function Wa(e) {
|
|
|
1287
1316
|
) : s("earlier", { day: "numeric", month: "long", year: "numeric" }, o);
|
|
1288
1317
|
},
|
|
1289
1318
|
compact(i) {
|
|
1290
|
-
const o =
|
|
1319
|
+
const o = Ce(i);
|
|
1291
1320
|
if (o === null)
|
|
1292
1321
|
return t("dates.never");
|
|
1293
1322
|
const r = /* @__PURE__ */ new Date();
|
|
1294
|
-
return
|
|
1323
|
+
return gt(o, r) === 0 ? n(o) : o.getFullYear() === r.getFullYear() ? s("compact", { day: "numeric", month: "short" }, o) : s("compact-earlier", { dateStyle: "short" }, o);
|
|
1295
1324
|
},
|
|
1296
1325
|
exact(i) {
|
|
1297
|
-
const o =
|
|
1326
|
+
const o = Ce(i);
|
|
1298
1327
|
return o === null ? "" : s("exact", { dateStyle: "long", timeStyle: "medium", hourCycle: "h23" }, o);
|
|
1299
1328
|
},
|
|
1300
1329
|
iso(i) {
|
|
1301
|
-
const o =
|
|
1330
|
+
const o = Ce(i);
|
|
1302
1331
|
return o === null ? "" : o.toISOString();
|
|
1303
1332
|
}
|
|
1304
1333
|
};
|
|
1305
1334
|
}
|
|
1306
1335
|
function It() {
|
|
1307
1336
|
const e = fe(Be, null);
|
|
1308
|
-
return
|
|
1337
|
+
return La(e ?? za());
|
|
1309
1338
|
}
|
|
1310
|
-
let
|
|
1311
|
-
function
|
|
1312
|
-
return
|
|
1339
|
+
let Te = null;
|
|
1340
|
+
function za() {
|
|
1341
|
+
return Te === null && (Te = st(), Te.defaults("webx-admin", Rt)), Te;
|
|
1313
1342
|
}
|
|
1314
|
-
function
|
|
1343
|
+
function Ce(e) {
|
|
1315
1344
|
if (e == null || e === "")
|
|
1316
1345
|
return null;
|
|
1317
1346
|
const t = e instanceof Date ? e : new Date(e);
|
|
1318
1347
|
return Number.isNaN(t.getTime()) ? null : t;
|
|
1319
1348
|
}
|
|
1320
|
-
function
|
|
1349
|
+
function gt(e, t) {
|
|
1321
1350
|
const l = (s) => Date.UTC(s.getFullYear(), s.getMonth(), s.getDate());
|
|
1322
1351
|
return Math.round((l(e) - l(t)) / 864e5);
|
|
1323
1352
|
}
|
|
1324
|
-
const Ee = /* @__PURE__ */
|
|
1353
|
+
const Ee = /* @__PURE__ */ K({
|
|
1325
1354
|
name: "WxDate",
|
|
1326
1355
|
__name: "DateText",
|
|
1327
1356
|
props: {
|
|
@@ -1331,13 +1360,13 @@ const Ee = /* @__PURE__ */ j({
|
|
|
1331
1360
|
tone: { default: "muted" }
|
|
1332
1361
|
},
|
|
1333
1362
|
setup(e) {
|
|
1334
|
-
const t = e, l = It(), s =
|
|
1335
|
-
return (o, r) => n.value ? (d(),
|
|
1363
|
+
const t = e, l = It(), s = b(() => t.compact ? l.compact(t.value) : l.short(t.value)), n = b(() => l.exact(t.value)), i = b(() => l.iso(t.value));
|
|
1364
|
+
return (o, r) => n.value ? (d(), W(a(Wt), {
|
|
1336
1365
|
key: 0,
|
|
1337
1366
|
content: n.value
|
|
1338
1367
|
}, {
|
|
1339
1368
|
default: g(() => [
|
|
1340
|
-
|
|
1369
|
+
x(a(Q), {
|
|
1341
1370
|
as: "time",
|
|
1342
1371
|
datetime: i.value,
|
|
1343
1372
|
size: e.size,
|
|
@@ -1350,7 +1379,7 @@ const Ee = /* @__PURE__ */ j({
|
|
|
1350
1379
|
}, 8, ["datetime", "size", "tone"])
|
|
1351
1380
|
]),
|
|
1352
1381
|
_: 1
|
|
1353
|
-
}, 8, ["content"])) : (d(),
|
|
1382
|
+
}, 8, ["content"])) : (d(), W(a(Q), {
|
|
1354
1383
|
key: 1,
|
|
1355
1384
|
size: e.size,
|
|
1356
1385
|
tone: e.tone
|
|
@@ -1362,33 +1391,33 @@ const Ee = /* @__PURE__ */ j({
|
|
|
1362
1391
|
}, 8, ["size", "tone"]));
|
|
1363
1392
|
}
|
|
1364
1393
|
});
|
|
1365
|
-
function
|
|
1366
|
-
const s = e instanceof
|
|
1394
|
+
function Va(e, t, l) {
|
|
1395
|
+
const s = e instanceof $e ? e.status : Na(e);
|
|
1367
1396
|
if (s === 422)
|
|
1368
|
-
return
|
|
1397
|
+
return Ea(e) ?? l ?? t("errors.unknown");
|
|
1369
1398
|
if (s === 401) return t("errors.signed-out");
|
|
1370
1399
|
if (s === 403) return t("errors.forbidden");
|
|
1371
1400
|
if (s === 404) return t("errors.gone");
|
|
1372
1401
|
if (s === 409) return t("errors.conflict");
|
|
1373
1402
|
if (s === 429) {
|
|
1374
|
-
const n = e instanceof
|
|
1403
|
+
const n = e instanceof $e ? e.retryAfter : null;
|
|
1375
1404
|
return n === null ? t("errors.throttled") : t("errors.throttled-in", { seconds: n });
|
|
1376
1405
|
}
|
|
1377
1406
|
return s !== null && s >= 500 ? t("errors.server") : s === null ? t("errors.offline") : l ?? t("errors.unknown");
|
|
1378
1407
|
}
|
|
1379
1408
|
function De() {
|
|
1380
1409
|
const e = J("webx-admin");
|
|
1381
|
-
return (t, l) =>
|
|
1410
|
+
return (t, l) => Va(t, e, l);
|
|
1382
1411
|
}
|
|
1383
|
-
function
|
|
1412
|
+
function Na(e) {
|
|
1384
1413
|
const t = e?.status;
|
|
1385
1414
|
return typeof t == "number" ? t : null;
|
|
1386
1415
|
}
|
|
1387
|
-
function
|
|
1416
|
+
function Ea(e) {
|
|
1388
1417
|
const l = e?.body?.message;
|
|
1389
1418
|
return typeof l == "string" && l !== "" ? l : null;
|
|
1390
1419
|
}
|
|
1391
|
-
function
|
|
1420
|
+
function Ua(e, t, l) {
|
|
1392
1421
|
return {
|
|
1393
1422
|
list: (s = 1) => e.http.get(`${e.apiPath}/history/${t}/${l}`, { query: { page: s } }),
|
|
1394
1423
|
run: (s, n = 1, i = null) => e.http.get(`${e.apiPath}/history/runs/${s}`, {
|
|
@@ -1397,43 +1426,43 @@ function Ea(e, t, l) {
|
|
|
1397
1426
|
};
|
|
1398
1427
|
}
|
|
1399
1428
|
const Mt = /* @__PURE__ */ Symbol("wx-history-subject");
|
|
1400
|
-
function
|
|
1429
|
+
function Ra(e) {
|
|
1401
1430
|
Ue(Mt, e);
|
|
1402
1431
|
}
|
|
1403
|
-
function
|
|
1432
|
+
function Ia() {
|
|
1404
1433
|
return fe(Mt, null);
|
|
1405
1434
|
}
|
|
1406
1435
|
function je(e, t, l = 120) {
|
|
1407
|
-
return e == null || e === "" ? t : typeof e == "boolean" ? e ? "✓" : "✗" : typeof e == "string" ?
|
|
1436
|
+
return e == null || e === "" ? t : typeof e == "boolean" ? e ? "✓" : "✗" : typeof e == "string" ? bt(e, l) : typeof e == "number" ? String(e) : bt(JSON.stringify(e), l);
|
|
1408
1437
|
}
|
|
1409
|
-
function
|
|
1438
|
+
function bt(e, t) {
|
|
1410
1439
|
return e.length > t ? `${e.slice(0, t - 1)}…` : e;
|
|
1411
1440
|
}
|
|
1412
|
-
const
|
|
1441
|
+
const Ma = { class: "wx-history" }, Oa = {
|
|
1413
1442
|
key: 4,
|
|
1414
1443
|
class: "wx-history__list"
|
|
1415
|
-
},
|
|
1444
|
+
}, Pa = { class: "wx-history-entry__body" }, Ba = { class: "wx-history-entry__head" }, Da = {
|
|
1416
1445
|
key: 0,
|
|
1417
1446
|
class: "wx-history-entry__changes"
|
|
1418
|
-
},
|
|
1447
|
+
}, Fa = { class: "wx-history-change__label" }, Ha = {
|
|
1419
1448
|
key: 0,
|
|
1420
1449
|
class: "wx-history-change__long"
|
|
1421
|
-
},
|
|
1450
|
+
}, ja = { class: "wx-history-change__from" }, Ka = { class: "wx-history-change__to" }, qa = ["onClick"], Ya = {
|
|
1422
1451
|
key: 5,
|
|
1423
1452
|
class: "wx-history__more"
|
|
1424
|
-
},
|
|
1453
|
+
}, Xa = {
|
|
1425
1454
|
key: 1,
|
|
1426
1455
|
class: "wx-history-run"
|
|
1427
|
-
},
|
|
1456
|
+
}, Ja = { class: "wx-history-run__head" }, Ga = {
|
|
1428
1457
|
key: 0,
|
|
1429
1458
|
class: "wx-history-run__summary"
|
|
1430
|
-
},
|
|
1459
|
+
}, Qa = { class: "wx-history__list" }, Za = { class: "wx-history-entry__changes" }, en = { class: "wx-history-change__label" }, tn = {
|
|
1431
1460
|
key: 0,
|
|
1432
1461
|
class: "wx-history-change__long"
|
|
1433
|
-
},
|
|
1462
|
+
}, ln = { class: "wx-history-change__from" }, an = { class: "wx-history-change__to" }, nn = {
|
|
1434
1463
|
key: 2,
|
|
1435
1464
|
class: "wx-history__more"
|
|
1436
|
-
},
|
|
1465
|
+
}, on = /* @__PURE__ */ K({
|
|
1437
1466
|
name: "WxHistory",
|
|
1438
1467
|
__name: "HistoryFeed",
|
|
1439
1468
|
props: {
|
|
@@ -1442,94 +1471,94 @@ const Ra = { class: "wx-history" }, Ia = {
|
|
|
1442
1471
|
title: { default: void 0 }
|
|
1443
1472
|
},
|
|
1444
1473
|
setup(e, { expose: t }) {
|
|
1445
|
-
const l = e, s =
|
|
1446
|
-
() => c.value === null ? null :
|
|
1447
|
-
), y =
|
|
1448
|
-
async function
|
|
1449
|
-
if (r.value = [], u.value = 1,
|
|
1450
|
-
|
|
1474
|
+
const l = e, s = te(), n = J("webx-admin"), i = De(), o = Ia(), r = A([]), u = A(1), m = A(1), v = A(!1), f = A(!1), c = b(() => l.id ?? o?.id.value ?? null), h = b(
|
|
1475
|
+
() => c.value === null ? null : Ua(s, l.type, c.value)
|
|
1476
|
+
), y = b(() => l.title ?? n("history.title"));
|
|
1477
|
+
async function p() {
|
|
1478
|
+
if (r.value = [], u.value = 1, m.value = 1, h.value !== null) {
|
|
1479
|
+
v.value = !0;
|
|
1451
1480
|
try {
|
|
1452
|
-
const
|
|
1453
|
-
r.value =
|
|
1454
|
-
} catch (
|
|
1455
|
-
Z.danger(i(
|
|
1481
|
+
const w = await h.value.list(1);
|
|
1482
|
+
r.value = w.data, m.value = w.last_page;
|
|
1483
|
+
} catch (w) {
|
|
1484
|
+
Z.danger(i(w));
|
|
1456
1485
|
} finally {
|
|
1457
|
-
|
|
1486
|
+
v.value = !1;
|
|
1458
1487
|
}
|
|
1459
1488
|
}
|
|
1460
1489
|
}
|
|
1461
|
-
async function
|
|
1462
|
-
if (!(
|
|
1463
|
-
|
|
1490
|
+
async function _() {
|
|
1491
|
+
if (!(h.value === null || f.value)) {
|
|
1492
|
+
f.value = !0;
|
|
1464
1493
|
try {
|
|
1465
|
-
const
|
|
1466
|
-
r.value = [...r.value, ...
|
|
1467
|
-
} catch (
|
|
1468
|
-
Z.danger(i(
|
|
1494
|
+
const w = await h.value.list(u.value + 1);
|
|
1495
|
+
r.value = [...r.value, ...w.data], u.value = w.current_page, m.value = w.last_page;
|
|
1496
|
+
} catch (w) {
|
|
1497
|
+
Z.danger(i(w));
|
|
1469
1498
|
} finally {
|
|
1470
|
-
|
|
1499
|
+
f.value = !1;
|
|
1471
1500
|
}
|
|
1472
1501
|
}
|
|
1473
1502
|
}
|
|
1474
1503
|
re([() => l.type, c], () => {
|
|
1475
|
-
|
|
1476
|
-
}, { immediate: !0 }), t({ reload:
|
|
1477
|
-
function
|
|
1478
|
-
return
|
|
1504
|
+
p();
|
|
1505
|
+
}, { immediate: !0 }), t({ reload: p });
|
|
1506
|
+
function S(w) {
|
|
1507
|
+
return w.admin?.name ?? n("history.unknown-author");
|
|
1479
1508
|
}
|
|
1480
|
-
function
|
|
1481
|
-
return `${n(`history.event-${
|
|
1509
|
+
function F(w) {
|
|
1510
|
+
return `${n(`history.event-${w.event}`)} · ${n(`history.source-${w.source}`)}`;
|
|
1482
1511
|
}
|
|
1483
|
-
function
|
|
1484
|
-
return je(
|
|
1512
|
+
function Y(w) {
|
|
1513
|
+
return je(w.from, n("history.empty-value"));
|
|
1485
1514
|
}
|
|
1486
|
-
function
|
|
1487
|
-
return je(
|
|
1515
|
+
function D(w) {
|
|
1516
|
+
return je(w.to, n("history.empty-value"));
|
|
1488
1517
|
}
|
|
1489
|
-
function
|
|
1518
|
+
function L(w) {
|
|
1490
1519
|
return n("history.long", {
|
|
1491
|
-
from: String(
|
|
1492
|
-
to: String(
|
|
1520
|
+
from: String(w.from_length ?? 0),
|
|
1521
|
+
to: String(w.to_length ?? 0)
|
|
1493
1522
|
});
|
|
1494
1523
|
}
|
|
1495
|
-
function
|
|
1496
|
-
const N =
|
|
1524
|
+
function T(w) {
|
|
1525
|
+
const N = w.run?.summary?.what;
|
|
1497
1526
|
return typeof N == "string" && N !== "" ? `${n("history.run")} · ${N}` : n("history.run");
|
|
1498
1527
|
}
|
|
1499
|
-
const
|
|
1528
|
+
const z = A(!1), k = A(null), H = A(null), V = A(""), I = A(!1);
|
|
1500
1529
|
let O = 0;
|
|
1501
|
-
async function
|
|
1502
|
-
if (
|
|
1530
|
+
async function le(w, N = 1) {
|
|
1531
|
+
if (h.value === null) return;
|
|
1503
1532
|
I.value = !0;
|
|
1504
1533
|
const E = ++O;
|
|
1505
1534
|
try {
|
|
1506
|
-
const
|
|
1535
|
+
const X = /^\d+$/.test(V.value.trim()) ? Number(V.value.trim()) : null, pe = await h.value.run(w, N, X);
|
|
1507
1536
|
if (E !== O) return;
|
|
1508
|
-
|
|
1537
|
+
k.value = N === 1 || k.value === null ? pe : {
|
|
1509
1538
|
run: pe.run,
|
|
1510
|
-
rows: { ...pe.rows, data: [...
|
|
1539
|
+
rows: { ...pe.rows, data: [...k.value.rows.data, ...pe.rows.data] }
|
|
1511
1540
|
};
|
|
1512
|
-
} catch (
|
|
1513
|
-
Z.danger(i(
|
|
1541
|
+
} catch (X) {
|
|
1542
|
+
Z.danger(i(X));
|
|
1514
1543
|
} finally {
|
|
1515
1544
|
I.value = !1;
|
|
1516
1545
|
}
|
|
1517
1546
|
}
|
|
1518
|
-
function ue(
|
|
1519
|
-
|
|
1547
|
+
function ue(w) {
|
|
1548
|
+
H.value = w, k.value = null, V.value = "", z.value = !0, le(w);
|
|
1520
1549
|
}
|
|
1521
1550
|
re(V, () => {
|
|
1522
|
-
|
|
1551
|
+
H.value !== null && z.value && le(H.value);
|
|
1523
1552
|
});
|
|
1524
|
-
const P =
|
|
1525
|
-
const
|
|
1526
|
-
return Object.entries(
|
|
1527
|
-
}), ee =
|
|
1528
|
-
const
|
|
1529
|
-
return typeof
|
|
1553
|
+
const P = b(() => {
|
|
1554
|
+
const w = k.value?.run.summary ?? {};
|
|
1555
|
+
return Object.entries(w).filter(([N]) => N !== "rows" && N !== "failed").map(([N, E]) => ({ key: N, value: je(E, n("history.empty-value")) }));
|
|
1556
|
+
}), ee = b(() => {
|
|
1557
|
+
const w = k.value?.run.summary?.failed;
|
|
1558
|
+
return typeof w == "string" ? w : null;
|
|
1530
1559
|
});
|
|
1531
|
-
return (
|
|
1532
|
-
y.value ? (d(),
|
|
1560
|
+
return (w, N) => (d(), $("section", Ma, [
|
|
1561
|
+
y.value ? (d(), W(a(Q), {
|
|
1533
1562
|
key: 0,
|
|
1534
1563
|
weight: "medium",
|
|
1535
1564
|
class: "wx-history__title"
|
|
@@ -1539,65 +1568,65 @@ const Ra = { class: "wx-history" }, Ia = {
|
|
|
1539
1568
|
]),
|
|
1540
1569
|
_: 1
|
|
1541
1570
|
})) : U("", !0),
|
|
1542
|
-
c.value === null ? (d(),
|
|
1571
|
+
c.value === null ? (d(), W(a(Ve), {
|
|
1543
1572
|
key: 1,
|
|
1544
1573
|
size: "sm",
|
|
1545
1574
|
description: a(n)("history.unsaved")
|
|
1546
|
-
}, null, 8, ["description"])) :
|
|
1575
|
+
}, null, 8, ["description"])) : v.value ? (d(), W(a(ye), {
|
|
1547
1576
|
key: 2,
|
|
1548
1577
|
rows: 3
|
|
1549
|
-
})) : r.value.length === 0 ? (d(),
|
|
1578
|
+
})) : r.value.length === 0 ? (d(), W(a(Ve), {
|
|
1550
1579
|
key: 3,
|
|
1551
1580
|
size: "sm",
|
|
1552
1581
|
description: a(n)("history.empty")
|
|
1553
|
-
}, null, 8, ["description"])) : (d(), $("ul",
|
|
1554
|
-
(d(!0), $(
|
|
1582
|
+
}, null, 8, ["description"])) : (d(), $("ul", Oa, [
|
|
1583
|
+
(d(!0), $(j, null, ie(r.value, (E) => (d(), $("li", {
|
|
1555
1584
|
key: E.id,
|
|
1556
1585
|
class: "wx-history-entry"
|
|
1557
1586
|
}, [
|
|
1558
|
-
|
|
1559
|
-
name:
|
|
1587
|
+
x(a(Lt), {
|
|
1588
|
+
name: S(E),
|
|
1560
1589
|
size: "sm",
|
|
1561
1590
|
tone: "auto"
|
|
1562
1591
|
}, null, 8, ["name"]),
|
|
1563
|
-
M("div",
|
|
1564
|
-
M("div",
|
|
1565
|
-
|
|
1592
|
+
M("div", Pa, [
|
|
1593
|
+
M("div", Ba, [
|
|
1594
|
+
x(a(Q), {
|
|
1566
1595
|
size: "sm",
|
|
1567
1596
|
weight: "medium",
|
|
1568
1597
|
truncate: ""
|
|
1569
1598
|
}, {
|
|
1570
1599
|
default: g(() => [
|
|
1571
|
-
R(C(
|
|
1600
|
+
R(C(S(E)), 1)
|
|
1572
1601
|
]),
|
|
1573
1602
|
_: 2
|
|
1574
1603
|
}, 1024),
|
|
1575
|
-
|
|
1604
|
+
x(Ee, {
|
|
1576
1605
|
value: E.created_at
|
|
1577
1606
|
}, null, 8, ["value"])
|
|
1578
1607
|
]),
|
|
1579
|
-
|
|
1608
|
+
x(a(Q), {
|
|
1580
1609
|
size: "sm",
|
|
1581
1610
|
tone: "muted"
|
|
1582
1611
|
}, {
|
|
1583
1612
|
default: g(() => [
|
|
1584
|
-
R(C(
|
|
1613
|
+
R(C(F(E)), 1)
|
|
1585
1614
|
]),
|
|
1586
1615
|
_: 2
|
|
1587
1616
|
}, 1024),
|
|
1588
|
-
E.changes.length > 0 ? (d(), $("ul",
|
|
1589
|
-
(d(!0), $(
|
|
1590
|
-
key:
|
|
1617
|
+
E.changes.length > 0 ? (d(), $("ul", Da, [
|
|
1618
|
+
(d(!0), $(j, null, ie(E.changes, (X) => (d(), $("li", {
|
|
1619
|
+
key: X.field,
|
|
1591
1620
|
class: "wx-history-change"
|
|
1592
1621
|
}, [
|
|
1593
|
-
M("span",
|
|
1594
|
-
|
|
1595
|
-
M("span",
|
|
1622
|
+
M("span", Fa, C(X.label) + ":", 1),
|
|
1623
|
+
X.long ? (d(), $("span", Ha, C(L(X)), 1)) : (d(), $(j, { key: 1 }, [
|
|
1624
|
+
M("span", ja, C(Y(X)), 1),
|
|
1596
1625
|
N[3] || (N[3] = M("span", {
|
|
1597
1626
|
class: "wx-history-change__arrow",
|
|
1598
1627
|
"aria-hidden": "true"
|
|
1599
1628
|
}, "→", -1)),
|
|
1600
|
-
M("span",
|
|
1629
|
+
M("span", Ka, C(D(X)), 1)
|
|
1601
1630
|
], 64))
|
|
1602
1631
|
]))), 128))
|
|
1603
1632
|
])) : U("", !0),
|
|
@@ -1605,16 +1634,16 @@ const Ra = { class: "wx-history" }, Ia = {
|
|
|
1605
1634
|
key: 1,
|
|
1606
1635
|
type: "button",
|
|
1607
1636
|
class: "wx-history-entry__run",
|
|
1608
|
-
onClick: (
|
|
1609
|
-
}, C(
|
|
1637
|
+
onClick: (X) => ue(E.run.id)
|
|
1638
|
+
}, C(T(E)), 9, qa)) : U("", !0)
|
|
1610
1639
|
])
|
|
1611
1640
|
]))), 128))
|
|
1612
1641
|
])),
|
|
1613
|
-
u.value <
|
|
1614
|
-
|
|
1642
|
+
u.value < m.value ? (d(), $("div", Ya, [
|
|
1643
|
+
x(a(ce), {
|
|
1615
1644
|
size: "sm",
|
|
1616
|
-
loading:
|
|
1617
|
-
onClick:
|
|
1645
|
+
loading: f.value,
|
|
1646
|
+
onClick: _
|
|
1618
1647
|
}, {
|
|
1619
1648
|
default: g(() => [
|
|
1620
1649
|
R(C(a(n)("history.more")), 1)
|
|
@@ -1622,55 +1651,55 @@ const Ra = { class: "wx-history" }, Ia = {
|
|
|
1622
1651
|
_: 1
|
|
1623
1652
|
}, 8, ["loading"])
|
|
1624
1653
|
])) : U("", !0),
|
|
1625
|
-
|
|
1626
|
-
open:
|
|
1627
|
-
"onUpdate:open": N[2] || (N[2] = (E) =>
|
|
1654
|
+
x(a(nt), {
|
|
1655
|
+
open: z.value,
|
|
1656
|
+
"onUpdate:open": N[2] || (N[2] = (E) => z.value = E),
|
|
1628
1657
|
title: a(n)("history.run-title"),
|
|
1629
1658
|
width: 640
|
|
1630
1659
|
}, {
|
|
1631
1660
|
default: g(() => [
|
|
1632
|
-
|
|
1661
|
+
k.value === null ? (d(), W(a(ye), {
|
|
1633
1662
|
key: 0,
|
|
1634
1663
|
rows: 4
|
|
1635
|
-
})) : (d(), $("div",
|
|
1636
|
-
M("div",
|
|
1637
|
-
|
|
1664
|
+
})) : (d(), $("div", Xa, [
|
|
1665
|
+
M("div", Ja, [
|
|
1666
|
+
x(a(Q), {
|
|
1638
1667
|
size: "sm",
|
|
1639
1668
|
weight: "medium"
|
|
1640
1669
|
}, {
|
|
1641
1670
|
default: g(() => [
|
|
1642
|
-
R(C(
|
|
1671
|
+
R(C(S(k.value.run)), 1)
|
|
1643
1672
|
]),
|
|
1644
1673
|
_: 1
|
|
1645
1674
|
}),
|
|
1646
|
-
|
|
1647
|
-
value:
|
|
1675
|
+
x(Ee, {
|
|
1676
|
+
value: k.value.run.created_at
|
|
1648
1677
|
}, null, 8, ["value"])
|
|
1649
1678
|
]),
|
|
1650
|
-
|
|
1679
|
+
x(a(Q), {
|
|
1651
1680
|
size: "sm",
|
|
1652
1681
|
tone: "muted"
|
|
1653
1682
|
}, {
|
|
1654
1683
|
default: g(() => [
|
|
1655
|
-
R(C(
|
|
1684
|
+
R(C(F(k.value.run)), 1)
|
|
1656
1685
|
]),
|
|
1657
1686
|
_: 1
|
|
1658
1687
|
}),
|
|
1659
|
-
P.value.length > 0 ? (d(), $("dl",
|
|
1660
|
-
(d(!0), $(
|
|
1688
|
+
P.value.length > 0 ? (d(), $("dl", Ga, [
|
|
1689
|
+
(d(!0), $(j, null, ie(P.value, (E) => (d(), $(j, {
|
|
1661
1690
|
key: E.key
|
|
1662
1691
|
}, [
|
|
1663
1692
|
M("dt", null, C(E.key), 1),
|
|
1664
1693
|
M("dd", null, C(E.value), 1)
|
|
1665
1694
|
], 64))), 128))
|
|
1666
1695
|
])) : U("", !0),
|
|
1667
|
-
|
|
1696
|
+
x(a(Q), { size: "sm" }, {
|
|
1668
1697
|
default: g(() => [
|
|
1669
|
-
R(C(a(n)("history.run-rows", { count: String(
|
|
1698
|
+
R(C(a(n)("history.run-rows", { count: String(k.value.run.rows ?? 0) })), 1)
|
|
1670
1699
|
]),
|
|
1671
1700
|
_: 1
|
|
1672
1701
|
}),
|
|
1673
|
-
ee.value ? (d(),
|
|
1702
|
+
ee.value ? (d(), W(a(Q), {
|
|
1674
1703
|
key: 1,
|
|
1675
1704
|
size: "sm",
|
|
1676
1705
|
tone: "danger"
|
|
@@ -1680,7 +1709,7 @@ const Ra = { class: "wx-history" }, Ia = {
|
|
|
1680
1709
|
]),
|
|
1681
1710
|
_: 1
|
|
1682
1711
|
})) : U("", !0),
|
|
1683
|
-
|
|
1712
|
+
x(a(Se), {
|
|
1684
1713
|
modelValue: V.value,
|
|
1685
1714
|
"onUpdate:modelValue": N[0] || (N[0] = (E) => V.value = E),
|
|
1686
1715
|
size: "sm",
|
|
@@ -1688,12 +1717,12 @@ const Ra = { class: "wx-history" }, Ia = {
|
|
|
1688
1717
|
placeholder: a(n)("history.search"),
|
|
1689
1718
|
clearable: ""
|
|
1690
1719
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
1691
|
-
M("ul",
|
|
1692
|
-
(d(!0), $(
|
|
1720
|
+
M("ul", Qa, [
|
|
1721
|
+
(d(!0), $(j, null, ie(k.value.rows.data, (E) => (d(), $("li", {
|
|
1693
1722
|
key: E.id,
|
|
1694
1723
|
class: "wx-history-run__row"
|
|
1695
1724
|
}, [
|
|
1696
|
-
|
|
1725
|
+
x(a(Q), {
|
|
1697
1726
|
size: "sm",
|
|
1698
1727
|
weight: "medium"
|
|
1699
1728
|
}, {
|
|
@@ -1702,29 +1731,29 @@ const Ra = { class: "wx-history" }, Ia = {
|
|
|
1702
1731
|
]),
|
|
1703
1732
|
_: 2
|
|
1704
1733
|
}, 1024),
|
|
1705
|
-
M("ul",
|
|
1706
|
-
(d(!0), $(
|
|
1707
|
-
key:
|
|
1734
|
+
M("ul", Za, [
|
|
1735
|
+
(d(!0), $(j, null, ie(E.changes, (X) => (d(), $("li", {
|
|
1736
|
+
key: X.field,
|
|
1708
1737
|
class: "wx-history-change"
|
|
1709
1738
|
}, [
|
|
1710
|
-
M("span",
|
|
1711
|
-
|
|
1712
|
-
M("span",
|
|
1739
|
+
M("span", en, C(X.label) + ":", 1),
|
|
1740
|
+
X.long ? (d(), $("span", tn, C(L(X)), 1)) : (d(), $(j, { key: 1 }, [
|
|
1741
|
+
M("span", ln, C(Y(X)), 1),
|
|
1713
1742
|
N[4] || (N[4] = M("span", {
|
|
1714
1743
|
class: "wx-history-change__arrow",
|
|
1715
1744
|
"aria-hidden": "true"
|
|
1716
1745
|
}, "→", -1)),
|
|
1717
|
-
M("span",
|
|
1746
|
+
M("span", an, C(D(X)), 1)
|
|
1718
1747
|
], 64))
|
|
1719
1748
|
]))), 128))
|
|
1720
1749
|
])
|
|
1721
1750
|
]))), 128))
|
|
1722
1751
|
]),
|
|
1723
|
-
|
|
1724
|
-
|
|
1752
|
+
k.value.rows.current_page < k.value.rows.last_page ? (d(), $("div", nn, [
|
|
1753
|
+
x(a(ce), {
|
|
1725
1754
|
size: "sm",
|
|
1726
1755
|
loading: I.value,
|
|
1727
|
-
onClick: N[1] || (N[1] = (E) =>
|
|
1756
|
+
onClick: N[1] || (N[1] = (E) => H.value !== null && le(H.value, k.value.rows.current_page + 1))
|
|
1728
1757
|
}, {
|
|
1729
1758
|
default: g(() => [
|
|
1730
1759
|
R(C(a(n)("history.more")), 1)
|
|
@@ -1738,7 +1767,7 @@ const Ra = { class: "wx-history" }, Ia = {
|
|
|
1738
1767
|
}, 8, ["open", "title"])
|
|
1739
1768
|
]));
|
|
1740
1769
|
}
|
|
1741
|
-
}),
|
|
1770
|
+
}), sn = /* @__PURE__ */ se(on, [["__scopeId", "data-v-68eae472"]]), rn = /* @__PURE__ */ K({
|
|
1742
1771
|
__name: "BackButton",
|
|
1743
1772
|
props: {
|
|
1744
1773
|
to: {},
|
|
@@ -1746,8 +1775,8 @@ const Ra = { class: "wx-history" }, Ia = {
|
|
|
1746
1775
|
size: { default: "sm" }
|
|
1747
1776
|
},
|
|
1748
1777
|
setup(e) {
|
|
1749
|
-
const t = e, l = J("webx-admin"), s =
|
|
1750
|
-
return (n, i) => (d(),
|
|
1778
|
+
const t = e, l = J("webx-admin"), s = b(() => t.label ?? l("editor.back"));
|
|
1779
|
+
return (n, i) => (d(), W(a(be), {
|
|
1751
1780
|
icon: "arrow-left",
|
|
1752
1781
|
class: "wx-back-button",
|
|
1753
1782
|
as: a(ll),
|
|
@@ -1757,10 +1786,10 @@ const Ra = { class: "wx-history" }, Ia = {
|
|
|
1757
1786
|
"tooltip-side": "bottom"
|
|
1758
1787
|
}, null, 8, ["as", "to", "title", "size"]));
|
|
1759
1788
|
}
|
|
1760
|
-
}),
|
|
1789
|
+
}), un = {
|
|
1761
1790
|
key: 0,
|
|
1762
1791
|
class: "wx-dropdown__divider"
|
|
1763
|
-
},
|
|
1792
|
+
}, dn = /* @__PURE__ */ K({
|
|
1764
1793
|
__name: "RowMenu",
|
|
1765
1794
|
props: {
|
|
1766
1795
|
actions: {},
|
|
@@ -1768,14 +1797,14 @@ const Ra = { class: "wx-history" }, Ia = {
|
|
|
1768
1797
|
size: { default: "sm" }
|
|
1769
1798
|
},
|
|
1770
1799
|
setup(e) {
|
|
1771
|
-
const t = J("webx-admin"), l = e, s =
|
|
1800
|
+
const t = J("webx-admin"), l = e, s = b(() => [
|
|
1772
1801
|
...l.actions.filter((i) => !i.danger),
|
|
1773
1802
|
...l.actions.filter((i) => i.danger)
|
|
1774
|
-
]), n =
|
|
1803
|
+
]), n = b(() => {
|
|
1775
1804
|
const i = s.value.find((o) => o.danger);
|
|
1776
1805
|
return i && s.value[0] !== i ? i.key : null;
|
|
1777
1806
|
});
|
|
1778
|
-
return (i, o) => s.value.length > 0 ? (d(),
|
|
1807
|
+
return (i, o) => s.value.length > 0 ? (d(), W(a(rl), {
|
|
1779
1808
|
key: 0,
|
|
1780
1809
|
class: "wx-row-menu",
|
|
1781
1810
|
collapse: "always",
|
|
@@ -1786,18 +1815,18 @@ const Ra = { class: "wx-history" }, Ia = {
|
|
|
1786
1815
|
}, ["stop"]))
|
|
1787
1816
|
}, {
|
|
1788
1817
|
trigger: g(() => [
|
|
1789
|
-
|
|
1818
|
+
x(a(be), {
|
|
1790
1819
|
type: "more",
|
|
1791
1820
|
size: e.size,
|
|
1792
1821
|
title: a(t)("editor.more")
|
|
1793
1822
|
}, null, 8, ["size", "title"])
|
|
1794
1823
|
]),
|
|
1795
1824
|
collapsed: g(() => [
|
|
1796
|
-
(d(!0), $(
|
|
1825
|
+
(d(!0), $(j, null, ie(s.value, (r) => (d(), $(j, {
|
|
1797
1826
|
key: r.key
|
|
1798
1827
|
}, [
|
|
1799
|
-
r.key === n.value ? (d(), $("hr",
|
|
1800
|
-
|
|
1828
|
+
r.key === n.value ? (d(), $("hr", un)) : U("", !0),
|
|
1829
|
+
x(a(ul), {
|
|
1801
1830
|
icon: r.icon,
|
|
1802
1831
|
tone: r.danger ? "danger" : "default",
|
|
1803
1832
|
href: r.href,
|
|
@@ -1815,13 +1844,13 @@ const Ra = { class: "wx-history" }, Ia = {
|
|
|
1815
1844
|
_: 1
|
|
1816
1845
|
}, 8, ["size", "aria-label"])) : U("", !0);
|
|
1817
1846
|
}
|
|
1818
|
-
}),
|
|
1847
|
+
}), it = /* @__PURE__ */ se(dn, [["__scopeId", "data-v-cab01f7f"]]), cn = ["data-level"], fn = {
|
|
1819
1848
|
key: 0,
|
|
1820
1849
|
class: "wx-screen-head__trail"
|
|
1821
|
-
},
|
|
1850
|
+
}, mn = { class: "wx-screen-head__name" }, vn = {
|
|
1822
1851
|
key: 4,
|
|
1823
1852
|
class: "wx-screen-head__actions"
|
|
1824
|
-
},
|
|
1853
|
+
}, pn = /* @__PURE__ */ K({
|
|
1825
1854
|
__name: "ScreenHead",
|
|
1826
1855
|
props: {
|
|
1827
1856
|
title: { default: void 0 },
|
|
@@ -1835,44 +1864,44 @@ const Ra = { class: "wx-history" }, Ia = {
|
|
|
1835
1864
|
},
|
|
1836
1865
|
emits: ["back"],
|
|
1837
1866
|
setup(e, { emit: t }) {
|
|
1838
|
-
const l = e, s = t, n = J("webx-admin"), i = Yt(), o = St("root"), r = dl(o), u =
|
|
1839
|
-
() =>
|
|
1840
|
-
),
|
|
1867
|
+
const l = e, s = t, n = J("webx-admin"), i = Yt(), o = St("root"), r = dl(o), u = b(() => r.value > 0 && r.value < l.collapseBelow), m = b(() => l.actions ?? []), v = b(
|
|
1868
|
+
() => m.value.find((p) => p.primary) ?? null
|
|
1869
|
+
), f = b(() => u.value ? v.value ? [v.value] : [] : m.value.filter((p) => !p.menu && !p.danger)), c = b(() => u.value ? m.value.filter((p) => p !== v.value) : m.value.filter((p) => p.menu || p.danger)), h = b(
|
|
1841
1870
|
() => l.back && l.back !== !0 ? l.back : null
|
|
1842
|
-
), y =
|
|
1843
|
-
() =>
|
|
1871
|
+
), y = b(
|
|
1872
|
+
() => f.value.length > 0 || c.value.length > 0 || !!i.extra
|
|
1844
1873
|
);
|
|
1845
|
-
return (
|
|
1874
|
+
return (p, _) => (d(), $("div", {
|
|
1846
1875
|
ref_key: "root",
|
|
1847
1876
|
ref: o,
|
|
1848
1877
|
class: ve(["wx-screen-head", {
|
|
1849
1878
|
"is-narrow": u.value,
|
|
1850
|
-
"has-button":
|
|
1851
|
-
"has-trail": !!
|
|
1879
|
+
"has-button": f.value.length > 0,
|
|
1880
|
+
"has-trail": !!p.$slots.trail,
|
|
1852
1881
|
"has-divider": e.divider
|
|
1853
1882
|
}]),
|
|
1854
1883
|
"data-level": e.level
|
|
1855
1884
|
}, [
|
|
1856
|
-
|
|
1857
|
-
|
|
1885
|
+
p.$slots.trail ? (d(), $("div", fn, [
|
|
1886
|
+
oe(p.$slots, "trail", {}, void 0, !0)
|
|
1858
1887
|
])) : U("", !0),
|
|
1859
|
-
|
|
1888
|
+
h.value ? (d(), W(rn, {
|
|
1860
1889
|
key: 1,
|
|
1861
1890
|
class: "wx-screen-head__back",
|
|
1862
|
-
to:
|
|
1891
|
+
to: h.value,
|
|
1863
1892
|
label: e.backLabel,
|
|
1864
1893
|
"tooltip-side": "bottom"
|
|
1865
|
-
}, null, 8, ["to", "label"])) : e.back ? (d(),
|
|
1894
|
+
}, null, 8, ["to", "label"])) : e.back ? (d(), W(a(be), {
|
|
1866
1895
|
key: 2,
|
|
1867
1896
|
class: "wx-screen-head__back",
|
|
1868
1897
|
icon: "arrow-left",
|
|
1869
1898
|
size: "sm",
|
|
1870
1899
|
"tooltip-side": "bottom",
|
|
1871
1900
|
title: e.backLabel ?? a(n)("editor.back"),
|
|
1872
|
-
onClick:
|
|
1901
|
+
onClick: _[0] || (_[0] = (S) => s("back"))
|
|
1873
1902
|
}, null, 8, ["title"])) : U("", !0),
|
|
1874
|
-
M("div",
|
|
1875
|
-
e.title ? (d(),
|
|
1903
|
+
M("div", mn, [
|
|
1904
|
+
e.title ? (d(), W(a(cl), {
|
|
1876
1905
|
key: 0,
|
|
1877
1906
|
level: e.level,
|
|
1878
1907
|
truncate: "",
|
|
@@ -1883,9 +1912,9 @@ const Ra = { class: "wx-history" }, Ia = {
|
|
|
1883
1912
|
]),
|
|
1884
1913
|
_: 1
|
|
1885
1914
|
}, 8, ["level"])) : U("", !0),
|
|
1886
|
-
|
|
1915
|
+
oe(p.$slots, "title-after", {}, void 0, !0)
|
|
1887
1916
|
]),
|
|
1888
|
-
e.subtitle ||
|
|
1917
|
+
e.subtitle || p.$slots.subtitle ? (d(), W(a(Q), {
|
|
1889
1918
|
key: 3,
|
|
1890
1919
|
class: "wx-screen-head__subtitle",
|
|
1891
1920
|
size: "sm",
|
|
@@ -1893,51 +1922,51 @@ const Ra = { class: "wx-history" }, Ia = {
|
|
|
1893
1922
|
truncate: ""
|
|
1894
1923
|
}, {
|
|
1895
1924
|
default: g(() => [
|
|
1896
|
-
|
|
1925
|
+
oe(p.$slots, "subtitle", {}, () => [
|
|
1897
1926
|
R(C(e.subtitle), 1)
|
|
1898
1927
|
], !0)
|
|
1899
1928
|
]),
|
|
1900
1929
|
_: 3
|
|
1901
1930
|
})) : U("", !0),
|
|
1902
|
-
y.value ? (d(), $("div",
|
|
1903
|
-
|
|
1904
|
-
(d(!0), $(
|
|
1905
|
-
key:
|
|
1906
|
-
class: ve(["wx-screen-head__button", { "is-primary":
|
|
1907
|
-
type:
|
|
1908
|
-
variant:
|
|
1909
|
-
loading:
|
|
1910
|
-
disabled:
|
|
1911
|
-
href:
|
|
1912
|
-
target:
|
|
1913
|
-
rel:
|
|
1914
|
-
onClick: (
|
|
1931
|
+
y.value ? (d(), $("div", vn, [
|
|
1932
|
+
oe(p.$slots, "extra", {}, void 0, !0),
|
|
1933
|
+
(d(!0), $(j, null, ie(f.value, (S) => (d(), W(a(ce), {
|
|
1934
|
+
key: S.key,
|
|
1935
|
+
class: ve(["wx-screen-head__button", { "is-primary": S.primary }]),
|
|
1936
|
+
type: S.primary ? "primary" : "default",
|
|
1937
|
+
variant: S.primary ? "solid" : S.variant ?? "outline",
|
|
1938
|
+
loading: S.loading,
|
|
1939
|
+
disabled: S.disabled,
|
|
1940
|
+
href: S.href,
|
|
1941
|
+
target: S.href ? S.target ?? "_blank" : void 0,
|
|
1942
|
+
rel: S.href ? "noopener" : void 0,
|
|
1943
|
+
onClick: (F) => S.run?.()
|
|
1915
1944
|
}, Re({
|
|
1916
1945
|
default: g(() => [
|
|
1917
|
-
R(" " + C(
|
|
1946
|
+
R(" " + C(S.label), 1)
|
|
1918
1947
|
]),
|
|
1919
1948
|
_: 2
|
|
1920
1949
|
}, [
|
|
1921
|
-
|
|
1950
|
+
S.icon ? {
|
|
1922
1951
|
name: "icon",
|
|
1923
1952
|
fn: g(() => [
|
|
1924
|
-
|
|
1925
|
-
name:
|
|
1953
|
+
x(a(ot), {
|
|
1954
|
+
name: S.icon
|
|
1926
1955
|
}, null, 8, ["name"])
|
|
1927
1956
|
]),
|
|
1928
1957
|
key: "0"
|
|
1929
1958
|
} : void 0
|
|
1930
1959
|
]), 1032, ["class", "type", "variant", "loading", "disabled", "href", "target", "rel", "onClick"]))), 128)),
|
|
1931
|
-
c.value.length > 0 ? (d(),
|
|
1960
|
+
c.value.length > 0 ? (d(), W(it, {
|
|
1932
1961
|
key: 0,
|
|
1933
1962
|
actions: c.value,
|
|
1934
1963
|
size: "lg",
|
|
1935
1964
|
label: e.title ?? a(n)("editor.more")
|
|
1936
1965
|
}, null, 8, ["actions", "label"])) : U("", !0)
|
|
1937
1966
|
])) : U("", !0)
|
|
1938
|
-
], 10,
|
|
1967
|
+
], 10, cn));
|
|
1939
1968
|
}
|
|
1940
|
-
}), Ot = /* @__PURE__ */
|
|
1969
|
+
}), Ot = /* @__PURE__ */ se(pn, [["__scopeId", "data-v-9ebd5372"]]), hn = ["data-wx-fill"], yn = /* @__PURE__ */ K({
|
|
1941
1970
|
__name: "ListScreen",
|
|
1942
1971
|
props: /* @__PURE__ */ me({
|
|
1943
1972
|
title: { default: void 0 },
|
|
@@ -1961,7 +1990,7 @@ const Ra = { class: "wx-history" }, Ia = {
|
|
|
1961
1990
|
class: ve(["wx-list-screen", { "is-fill": e.fill }]),
|
|
1962
1991
|
"data-wx-fill": e.fill ? "" : void 0
|
|
1963
1992
|
}, [
|
|
1964
|
-
e.title || e.actions || l.$slots.actions ? (d(),
|
|
1993
|
+
e.title || e.actions || l.$slots.actions ? (d(), W(Ot, {
|
|
1965
1994
|
key: 0,
|
|
1966
1995
|
class: "wx-list-screen__head",
|
|
1967
1996
|
title: e.title,
|
|
@@ -1974,12 +2003,12 @@ const Ra = { class: "wx-history" }, Ia = {
|
|
|
1974
2003
|
l.$slots.actions ? {
|
|
1975
2004
|
name: "extra",
|
|
1976
2005
|
fn: g(() => [
|
|
1977
|
-
|
|
2006
|
+
oe(l.$slots, "actions", {}, void 0, !0)
|
|
1978
2007
|
]),
|
|
1979
2008
|
key: "0"
|
|
1980
2009
|
} : void 0
|
|
1981
2010
|
]), 1032, ["title", "subtitle", "back", "back-label", "actions"])) : U("", !0),
|
|
1982
|
-
e.views && e.views.length > 0 ? (d(),
|
|
2011
|
+
e.views && e.views.length > 0 ? (d(), W(a(fl), {
|
|
1983
2012
|
key: 1,
|
|
1984
2013
|
modelValue: t.value,
|
|
1985
2014
|
"onUpdate:modelValue": s[0] || (s[0] = (n) => t.value = n),
|
|
@@ -1989,38 +2018,38 @@ const Ra = { class: "wx-history" }, Ia = {
|
|
|
1989
2018
|
"aria-label": e.title
|
|
1990
2019
|
}, {
|
|
1991
2020
|
default: g(() => [
|
|
1992
|
-
e.card ? (d(),
|
|
2021
|
+
e.card ? (d(), W(a(Je), {
|
|
1993
2022
|
key: 0,
|
|
1994
2023
|
class: "wx-list-screen__card",
|
|
1995
2024
|
padding: e.padding
|
|
1996
2025
|
}, {
|
|
1997
2026
|
default: g(() => [
|
|
1998
|
-
|
|
2027
|
+
oe(l.$slots, "default", {}, void 0, !0)
|
|
1999
2028
|
]),
|
|
2000
2029
|
_: 3
|
|
2001
|
-
}, 8, ["padding"])) :
|
|
2030
|
+
}, 8, ["padding"])) : oe(l.$slots, "default", {}, void 0, !0, 1)
|
|
2002
2031
|
]),
|
|
2003
2032
|
_: 3
|
|
2004
|
-
}, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (d(), $(
|
|
2005
|
-
e.card ? (d(),
|
|
2033
|
+
}, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (d(), $(j, { key: 2 }, [
|
|
2034
|
+
e.card ? (d(), W(a(Je), {
|
|
2006
2035
|
key: 0,
|
|
2007
2036
|
class: "wx-list-screen__card",
|
|
2008
2037
|
padding: e.padding
|
|
2009
2038
|
}, {
|
|
2010
2039
|
default: g(() => [
|
|
2011
|
-
|
|
2040
|
+
oe(l.$slots, "default", {}, void 0, !0)
|
|
2012
2041
|
]),
|
|
2013
2042
|
_: 3
|
|
2014
|
-
}, 8, ["padding"])) :
|
|
2043
|
+
}, 8, ["padding"])) : oe(l.$slots, "default", {}, void 0, !0, 1)
|
|
2015
2044
|
], 64))
|
|
2016
|
-
], 10,
|
|
2045
|
+
], 10, hn));
|
|
2017
2046
|
}
|
|
2018
|
-
}), Pt = /* @__PURE__ */
|
|
2047
|
+
}), Pt = /* @__PURE__ */ se(yn, [["__scopeId", "data-v-8c7e5ad1"]]), gn = /* @__PURE__ */ K({
|
|
2019
2048
|
name: "WxRichTextField",
|
|
2020
2049
|
inheritAttrs: !1,
|
|
2021
2050
|
__name: "RichTextField",
|
|
2022
2051
|
setup(e) {
|
|
2023
|
-
const t =
|
|
2052
|
+
const t = te(), l = J("webx-admin"), s = b(() => t.pickImage ?? void 0), n = b(() => ({
|
|
2024
2053
|
bold: l("rich-text.bold"),
|
|
2025
2054
|
italic: l("rich-text.italic"),
|
|
2026
2055
|
strike: l("rich-text.strike"),
|
|
@@ -2053,41 +2082,41 @@ const Ra = { class: "wx-history" }, Ia = {
|
|
|
2053
2082
|
cancel: l("rich-text.cancel"),
|
|
2054
2083
|
uploading: l("rich-text.uploading")
|
|
2055
2084
|
}));
|
|
2056
|
-
return (i, o) => (d(),
|
|
2085
|
+
return (i, o) => (d(), W(a(ml), et(i.$attrs, {
|
|
2057
2086
|
labels: n.value,
|
|
2058
2087
|
"pick-image": s.value
|
|
2059
2088
|
}), null, 16, ["labels", "pick-image"]));
|
|
2060
2089
|
}
|
|
2061
2090
|
}), Bt = /* @__PURE__ */ Symbol("wx-record-address");
|
|
2062
|
-
function
|
|
2091
|
+
function bn(e) {
|
|
2063
2092
|
Ue(Bt, e);
|
|
2064
2093
|
}
|
|
2065
|
-
function
|
|
2094
|
+
function wn() {
|
|
2066
2095
|
return fe(Bt, null);
|
|
2067
2096
|
}
|
|
2068
|
-
const
|
|
2097
|
+
const _n = { class: "wx-slug" }, xn = { class: "wx-slug__prefix" }, kn = /* @__PURE__ */ K({
|
|
2069
2098
|
name: "WxSlugField",
|
|
2070
2099
|
inheritAttrs: !1,
|
|
2071
2100
|
__name: "SlugField",
|
|
2072
2101
|
setup(e) {
|
|
2073
|
-
const t =
|
|
2102
|
+
const t = wn(), l = zt(), s = b(() => {
|
|
2074
2103
|
const o = t?.prefix.value ?? "";
|
|
2075
2104
|
return o === "" ? "/" : `/${o}/`;
|
|
2076
|
-
}), n =
|
|
2105
|
+
}), n = b(() => {
|
|
2077
2106
|
const o = t?.values.value.slug;
|
|
2078
2107
|
return typeof o == "string" ? o : o?.[l.active.value] ?? "";
|
|
2079
|
-
}), i =
|
|
2108
|
+
}), i = b(() => {
|
|
2080
2109
|
const o = t?.path.value;
|
|
2081
2110
|
return typeof o == "string" && n.value !== "" && `${s.value}${n.value}` != `/${o}`;
|
|
2082
2111
|
});
|
|
2083
|
-
return (o, r) => (d(), $("div",
|
|
2084
|
-
|
|
2112
|
+
return (o, r) => (d(), $("div", _n, [
|
|
2113
|
+
x(a(Se), Xt(Jt(o.$attrs)), {
|
|
2085
2114
|
prefix: g(() => [
|
|
2086
|
-
M("span",
|
|
2115
|
+
M("span", xn, C(s.value), 1)
|
|
2087
2116
|
]),
|
|
2088
2117
|
_: 1
|
|
2089
2118
|
}, 16),
|
|
2090
|
-
i.value && a(t) ? (d(),
|
|
2119
|
+
i.value && a(t) ? (d(), W(a(Pe), {
|
|
2091
2120
|
key: 0,
|
|
2092
2121
|
type: "info",
|
|
2093
2122
|
variant: "soft",
|
|
@@ -2095,119 +2124,129 @@ const bn = { class: "wx-slug" }, wn = { class: "wx-slug__prefix" }, _n = /* @__P
|
|
|
2095
2124
|
}, null, 8, ["description"])) : U("", !0)
|
|
2096
2125
|
]));
|
|
2097
2126
|
}
|
|
2098
|
-
}),
|
|
2127
|
+
}), wt = /* @__PURE__ */ se(kn, [["__scopeId", "data-v-5921c0dd"]]), $n = {
|
|
2099
2128
|
"wx-list": { component: Pt, kind: "layout", labelProp: "title" },
|
|
2100
2129
|
// Full width: an editor shares a row with nothing, and a form of two columns would give it
|
|
2101
2130
|
// half a line to write a page of text in.
|
|
2102
|
-
"wx-rich-text": { component:
|
|
2131
|
+
"wx-rich-text": { component: gn, kind: "field", wide: !0 },
|
|
2103
2132
|
// Wide as well: a row of the picker is a segmented switch, a section and a search box, and half
|
|
2104
2133
|
// a form's width leaves the search box too narrow to read a page title in.
|
|
2105
|
-
"wx-link": { component:
|
|
2134
|
+
"wx-link": { component: Wa, kind: "field", wide: !0 },
|
|
2106
2135
|
"wx-categories": { component: Pl, kind: "field" },
|
|
2136
|
+
"wx-select": { component: Bl, kind: "field" },
|
|
2107
2137
|
// Wide: four controls in a column, and half a line leaves the category chips one to a row.
|
|
2108
|
-
"wx-collection": { component:
|
|
2138
|
+
"wx-collection": { component: ga, kind: "field", wide: !0 },
|
|
2109
2139
|
// Wide: a row carries a picture, a name with a line under it and a mark, and the search box
|
|
2110
2140
|
// under the list reads titles.
|
|
2111
2141
|
"wx-relations": { component: Nt, kind: "field", wide: !0 },
|
|
2112
|
-
"wx-slug": { component:
|
|
2113
|
-
"wx-category-slug": { component:
|
|
2142
|
+
"wx-slug": { component: wt, kind: "field" },
|
|
2143
|
+
"wx-category-slug": { component: wt, kind: "field" },
|
|
2114
2144
|
// The node's label is the feed's heading; inside a tab that already names it, `props.title: ""`.
|
|
2115
|
-
"wx-history": { component:
|
|
2145
|
+
"wx-history": { component: sn, kind: "display", labelProp: "title" }
|
|
2116
2146
|
}, Dt = /* @__PURE__ */ Symbol("webx-admin");
|
|
2117
|
-
function
|
|
2147
|
+
function te() {
|
|
2118
2148
|
const e = fe(Dt, null);
|
|
2119
2149
|
if (e === null)
|
|
2120
2150
|
throw new Error("useAdmin() was called outside a panel created by createAdmin().");
|
|
2121
2151
|
return e;
|
|
2122
2152
|
}
|
|
2123
|
-
function
|
|
2124
|
-
const t =
|
|
2153
|
+
function Sn(e) {
|
|
2154
|
+
const t = ze({
|
|
2125
2155
|
status: "loading",
|
|
2126
2156
|
manifest: null,
|
|
2127
2157
|
user: null,
|
|
2128
2158
|
error: null
|
|
2129
|
-
}), l =
|
|
2130
|
-
const
|
|
2131
|
-
if (
|
|
2159
|
+
}), l = b(() => {
|
|
2160
|
+
const h = t.manifest;
|
|
2161
|
+
if (h === null)
|
|
2132
2162
|
return [];
|
|
2133
2163
|
const y = [];
|
|
2134
|
-
for (const
|
|
2135
|
-
const
|
|
2136
|
-
if (
|
|
2164
|
+
for (const p of h.modules) {
|
|
2165
|
+
const _ = e.modules.find((F) => F.id === p.id);
|
|
2166
|
+
if (_ === void 0)
|
|
2137
2167
|
continue;
|
|
2138
|
-
const
|
|
2139
|
-
|
|
2140
|
-
id:
|
|
2141
|
-
title:
|
|
2142
|
-
icon:
|
|
2143
|
-
path:
|
|
2144
|
-
group:
|
|
2168
|
+
const S = _.path ?? _.routes?.[0]?.path;
|
|
2169
|
+
S !== void 0 && y.push({
|
|
2170
|
+
id: p.id,
|
|
2171
|
+
title: p.title,
|
|
2172
|
+
icon: p.icon,
|
|
2173
|
+
path: S,
|
|
2174
|
+
group: p.group ?? null,
|
|
2175
|
+
section: p.section ?? null
|
|
2145
2176
|
});
|
|
2146
2177
|
}
|
|
2147
2178
|
return y;
|
|
2148
|
-
}), s =
|
|
2149
|
-
const
|
|
2150
|
-
for (const
|
|
2151
|
-
if (
|
|
2152
|
-
const
|
|
2153
|
-
|
|
2179
|
+
}), s = b(() => {
|
|
2180
|
+
const h = t.manifest?.groups ?? [], y = [], p = /* @__PURE__ */ new Map();
|
|
2181
|
+
for (const _ of l.value)
|
|
2182
|
+
if (_.group !== null && h.some((S) => S.id === _.group)) {
|
|
2183
|
+
const S = p.get(_.group) ?? [];
|
|
2184
|
+
S.push(_), p.set(_.group, S);
|
|
2154
2185
|
} else
|
|
2155
|
-
y.push(
|
|
2186
|
+
y.push(_);
|
|
2156
2187
|
return {
|
|
2157
2188
|
top: y,
|
|
2158
|
-
groups:
|
|
2159
|
-
id
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2189
|
+
groups: h.filter((_) => p.has(_.id)).map((_) => {
|
|
2190
|
+
const S = p.get(_.id) ?? [], F = _.sections ?? [], Y = (D) => F.some((L) => L.id === D.section);
|
|
2191
|
+
return {
|
|
2192
|
+
id: _.id,
|
|
2193
|
+
title: _.title,
|
|
2194
|
+
icon: _.icon ?? null,
|
|
2195
|
+
entries: S.filter((D) => !Y(D)),
|
|
2196
|
+
sections: F.map((D) => ({
|
|
2197
|
+
id: D.id,
|
|
2198
|
+
title: D.title,
|
|
2199
|
+
entries: S.filter((L) => L.section === D.id)
|
|
2200
|
+
})).filter((D) => D.entries.length > 0)
|
|
2201
|
+
};
|
|
2202
|
+
})
|
|
2164
2203
|
};
|
|
2165
|
-
}), n = {
|
|
2166
|
-
for (const
|
|
2167
|
-
Object.assign(n,
|
|
2204
|
+
}), n = { ...$n };
|
|
2205
|
+
for (const h of e.modules)
|
|
2206
|
+
Object.assign(n, h.types);
|
|
2168
2207
|
Object.assign(n, e.types);
|
|
2169
|
-
const i = e.modules.find((
|
|
2170
|
-
async function r(
|
|
2171
|
-
const y = `${e.i18n.state.locale}:${
|
|
2172
|
-
let
|
|
2173
|
-
return
|
|
2174
|
-
throw o.delete(y),
|
|
2175
|
-
}), o.set(y,
|
|
2208
|
+
const i = e.modules.find((h) => h.pickImage !== void 0)?.pickImage, o = /* @__PURE__ */ new Map();
|
|
2209
|
+
async function r(h) {
|
|
2210
|
+
const y = `${e.i18n.state.locale}:${h}`;
|
|
2211
|
+
let p = o.get(y);
|
|
2212
|
+
return p === void 0 && (p = e.http.get(`${e.apiPath}/screens/${h}`).then((_) => _.data.root).catch((_) => {
|
|
2213
|
+
throw o.delete(y), _;
|
|
2214
|
+
}), o.set(y, p)), p;
|
|
2176
2215
|
}
|
|
2177
2216
|
let u = null;
|
|
2178
|
-
async function
|
|
2217
|
+
async function m() {
|
|
2179
2218
|
t.status = "loading", t.error = null;
|
|
2180
2219
|
try {
|
|
2181
|
-
if (u !== null && (t.user = await u(),
|
|
2220
|
+
if (u !== null && (t.user = await u(), f(t.user), t.user === null)) {
|
|
2182
2221
|
t.manifest = null, t.status = "unauthenticated";
|
|
2183
2222
|
return;
|
|
2184
2223
|
}
|
|
2185
|
-
const
|
|
2186
|
-
t.manifest =
|
|
2187
|
-
} catch (
|
|
2188
|
-
if (
|
|
2224
|
+
const h = await e.loadManifest();
|
|
2225
|
+
t.manifest = h, e.i18n.state.contentLocales = h.locales ?? [], e.i18n.state.panelLocales = h.panelLocales ?? e.i18n.state.panelLocales, h.locale !== void 0 && h.locale !== e.i18n.state.locale && await c(h.locale), t.status = "ready";
|
|
2226
|
+
} catch (h) {
|
|
2227
|
+
if (Cn(h)) {
|
|
2189
2228
|
t.manifest = null, t.user = null, t.status = "unauthenticated";
|
|
2190
2229
|
return;
|
|
2191
2230
|
}
|
|
2192
|
-
t.error =
|
|
2231
|
+
t.error = h instanceof Error ? h.message : String(h), t.status = "error";
|
|
2193
2232
|
}
|
|
2194
2233
|
}
|
|
2195
|
-
async function
|
|
2234
|
+
async function v() {
|
|
2196
2235
|
if (t.manifest !== null)
|
|
2197
2236
|
try {
|
|
2198
2237
|
t.manifest = await e.loadManifest();
|
|
2199
2238
|
} catch {
|
|
2200
2239
|
}
|
|
2201
2240
|
}
|
|
2202
|
-
function
|
|
2203
|
-
|
|
2241
|
+
function f(h) {
|
|
2242
|
+
h !== null && e.theme?.adopt(h.theme);
|
|
2204
2243
|
}
|
|
2205
|
-
async function c(
|
|
2244
|
+
async function c(h) {
|
|
2206
2245
|
if (e.loadDictionary === void 0) {
|
|
2207
|
-
e.i18n.state.locale =
|
|
2246
|
+
e.i18n.state.locale = h;
|
|
2208
2247
|
return;
|
|
2209
2248
|
}
|
|
2210
|
-
await e.loadDictionary(
|
|
2249
|
+
await e.loadDictionary(h), await v();
|
|
2211
2250
|
}
|
|
2212
2251
|
return {
|
|
2213
2252
|
http: e.http,
|
|
@@ -2220,38 +2259,38 @@ function kn(e) {
|
|
|
2220
2259
|
groups: s,
|
|
2221
2260
|
types: n,
|
|
2222
2261
|
pickImage: i ?? null,
|
|
2223
|
-
reload:
|
|
2224
|
-
refreshManifest:
|
|
2262
|
+
reload: m,
|
|
2263
|
+
refreshManifest: v,
|
|
2225
2264
|
setLocale: c,
|
|
2226
|
-
setUser(
|
|
2227
|
-
t.user =
|
|
2265
|
+
setUser(h) {
|
|
2266
|
+
t.user = h, f(h);
|
|
2228
2267
|
},
|
|
2229
|
-
useSessionLoader(
|
|
2230
|
-
u =
|
|
2268
|
+
useSessionLoader(h) {
|
|
2269
|
+
u = h;
|
|
2231
2270
|
},
|
|
2232
|
-
can(
|
|
2271
|
+
can(h) {
|
|
2233
2272
|
const y = t.user;
|
|
2234
|
-
return y === null ? !1 : y.isSuper || y.permissions.includes(
|
|
2273
|
+
return y === null ? !1 : y.isSuper || y.permissions.includes(h);
|
|
2235
2274
|
},
|
|
2236
2275
|
loadScreen: r,
|
|
2237
|
-
screenPatch(
|
|
2238
|
-
return e.screens?.[
|
|
2276
|
+
screenPatch(h) {
|
|
2277
|
+
return e.screens?.[h] ?? [];
|
|
2239
2278
|
}
|
|
2240
2279
|
};
|
|
2241
2280
|
}
|
|
2242
|
-
function
|
|
2281
|
+
function Tn(e, t) {
|
|
2243
2282
|
e.provide(Dt, t);
|
|
2244
2283
|
}
|
|
2245
|
-
function
|
|
2284
|
+
function Cn(e) {
|
|
2246
2285
|
return typeof e == "object" && e !== null && "status" in e && e.status === 401;
|
|
2247
2286
|
}
|
|
2248
|
-
const
|
|
2287
|
+
const An = /* @__PURE__ */ K({
|
|
2249
2288
|
__name: "AdminLanding",
|
|
2250
2289
|
props: {
|
|
2251
2290
|
landing: { default: null }
|
|
2252
2291
|
},
|
|
2253
2292
|
setup(e) {
|
|
2254
|
-
const t = e, l =
|
|
2293
|
+
const t = e, l = te(), s = Me(), n = J("webx-admin"), i = b(() => {
|
|
2255
2294
|
const o = l.nav.value;
|
|
2256
2295
|
return o.length === 0 ? null : ((t.landing === null ? void 0 : o.find((u) => u.path === t.landing)) ?? o[0])?.path ?? null;
|
|
2257
2296
|
});
|
|
@@ -2261,61 +2300,75 @@ const Tn = /* @__PURE__ */ j({
|
|
|
2261
2300
|
o !== null && s.replace(o);
|
|
2262
2301
|
},
|
|
2263
2302
|
{ immediate: !0 }
|
|
2264
|
-
), (o, r) => i.value === null && a(l).state.status === "ready" ? (d(),
|
|
2303
|
+
), (o, r) => i.value === null && a(l).state.status === "ready" ? (d(), W(a(vl), {
|
|
2265
2304
|
key: 0,
|
|
2266
2305
|
status: "info",
|
|
2267
2306
|
title: a(n)("shell.empty-title"),
|
|
2268
2307
|
description: a(n)("shell.empty-description")
|
|
2269
2308
|
}, null, 8, ["title", "description"])) : U("", !0);
|
|
2270
2309
|
}
|
|
2271
|
-
}),
|
|
2310
|
+
}), Wn = /* @__PURE__ */ K({
|
|
2272
2311
|
__name: "AdminNav",
|
|
2273
2312
|
props: {
|
|
2274
2313
|
collapsed: { type: Boolean }
|
|
2275
2314
|
},
|
|
2276
2315
|
emits: ["select"],
|
|
2277
2316
|
setup(e, { emit: t }) {
|
|
2278
|
-
const l = t, s =
|
|
2317
|
+
const l = t, s = te(), n = J("webx-admin"), i = Me(), o = At(), r = b({
|
|
2279
2318
|
/*
|
|
2280
2319
|
* The longest path that contains this one, on a segment boundary: a section may live inside
|
|
2281
2320
|
* another's path (`/services/categories` under `/services`), and the first match in the order
|
|
2282
2321
|
* of the menu would light up the outer one.
|
|
2283
2322
|
*/
|
|
2284
|
-
get: () => s.nav.value.filter((
|
|
2323
|
+
get: () => s.nav.value.filter((m) => o.path === m.path || o.path.startsWith(`${m.path}/`)).sort((m, v) => v.path.length - m.path.length)[0]?.id ?? "",
|
|
2285
2324
|
set: (u) => {
|
|
2286
|
-
const
|
|
2287
|
-
|
|
2325
|
+
const m = s.nav.value.find((v) => v.id === u);
|
|
2326
|
+
m !== void 0 && i.push(m.path);
|
|
2288
2327
|
}
|
|
2289
2328
|
});
|
|
2290
|
-
return (u,
|
|
2291
|
-
const
|
|
2292
|
-
return d(),
|
|
2329
|
+
return (u, m) => {
|
|
2330
|
+
const v = ne("wx-menu-item"), f = ne("wx-menu-group"), c = ne("wx-submenu"), h = ne("wx-menu");
|
|
2331
|
+
return d(), W(h, {
|
|
2293
2332
|
modelValue: r.value,
|
|
2294
|
-
"onUpdate:modelValue":
|
|
2333
|
+
"onUpdate:modelValue": m[0] || (m[0] = (y) => r.value = y),
|
|
2295
2334
|
collapsed: e.collapsed,
|
|
2296
2335
|
label: a(n)("nav.sections"),
|
|
2297
|
-
onSelect:
|
|
2336
|
+
onSelect: m[1] || (m[1] = (y) => l("select"))
|
|
2298
2337
|
}, {
|
|
2299
2338
|
default: g(() => [
|
|
2300
|
-
(d(!0), $(
|
|
2301
|
-
key:
|
|
2302
|
-
value:
|
|
2303
|
-
icon:
|
|
2304
|
-
label:
|
|
2339
|
+
(d(!0), $(j, null, ie(a(s).groups.value.top, (y) => (d(), W(v, {
|
|
2340
|
+
key: y.id,
|
|
2341
|
+
value: y.id,
|
|
2342
|
+
icon: y.icon ?? void 0,
|
|
2343
|
+
label: y.title
|
|
2305
2344
|
}, null, 8, ["value", "icon", "label"]))), 128)),
|
|
2306
|
-
(d(!0), $(
|
|
2307
|
-
key:
|
|
2308
|
-
value: `group:${
|
|
2309
|
-
title:
|
|
2310
|
-
icon:
|
|
2345
|
+
(d(!0), $(j, null, ie(a(s).groups.value.groups, (y) => (d(), W(c, {
|
|
2346
|
+
key: y.id,
|
|
2347
|
+
value: `group:${y.id}`,
|
|
2348
|
+
title: y.title,
|
|
2349
|
+
icon: y.icon ?? "gear"
|
|
2311
2350
|
}, {
|
|
2312
2351
|
default: g(() => [
|
|
2313
|
-
(d(!0), $(
|
|
2314
|
-
key:
|
|
2315
|
-
value:
|
|
2316
|
-
icon:
|
|
2317
|
-
label:
|
|
2318
|
-
}, null, 8, ["value", "icon", "label"]))), 128))
|
|
2352
|
+
(d(!0), $(j, null, ie(y.entries, (p) => (d(), W(v, {
|
|
2353
|
+
key: p.id,
|
|
2354
|
+
value: p.id,
|
|
2355
|
+
icon: p.icon ?? void 0,
|
|
2356
|
+
label: p.title
|
|
2357
|
+
}, null, 8, ["value", "icon", "label"]))), 128)),
|
|
2358
|
+
(d(!0), $(j, null, ie(y.sections, (p) => (d(), W(f, {
|
|
2359
|
+
key: p.id,
|
|
2360
|
+
title: p.title
|
|
2361
|
+
}, {
|
|
2362
|
+
default: g(() => [
|
|
2363
|
+
(d(!0), $(j, null, ie(p.entries, (_) => (d(), W(v, {
|
|
2364
|
+
key: _.id,
|
|
2365
|
+
value: _.id,
|
|
2366
|
+
icon: _.icon ?? void 0,
|
|
2367
|
+
label: _.title
|
|
2368
|
+
}, null, 8, ["value", "icon", "label"]))), 128))
|
|
2369
|
+
]),
|
|
2370
|
+
_: 2
|
|
2371
|
+
}, 1032, ["title"]))), 128))
|
|
2319
2372
|
]),
|
|
2320
2373
|
_: 2
|
|
2321
2374
|
}, 1032, ["value", "title", "icon"]))), 128))
|
|
@@ -2324,46 +2377,46 @@ const Tn = /* @__PURE__ */ j({
|
|
|
2324
2377
|
}, 8, ["modelValue", "collapsed", "label"]);
|
|
2325
2378
|
};
|
|
2326
2379
|
}
|
|
2327
|
-
}),
|
|
2380
|
+
}), Ln = {
|
|
2328
2381
|
key: 0,
|
|
2329
2382
|
class: "wx-root wx-admin-plain"
|
|
2330
|
-
},
|
|
2383
|
+
}, zn = {
|
|
2331
2384
|
key: 1,
|
|
2332
2385
|
class: "wx-root wx-admin-plain"
|
|
2333
|
-
},
|
|
2386
|
+
}, Vn = {
|
|
2334
2387
|
key: 2,
|
|
2335
2388
|
class: "wx-root wx-admin-plain"
|
|
2336
|
-
},
|
|
2389
|
+
}, Nn = ["src", "alt", "width", "height"], En = ["src", "alt", "width", "height"], Un = ["src", "alt"], Rn = { class: "wx-admin__user" }, In = { class: "wx-admin__user wx-admin__user--drawer" }, Mn = /* @__PURE__ */ K({
|
|
2337
2390
|
__name: "AdminShell",
|
|
2338
2391
|
setup(e) {
|
|
2339
|
-
const t =
|
|
2392
|
+
const t = te(), l = J("webx-admin"), s = A(null), { width: n, layout: i, collapsed: o, showAside: r, drawerOpen: u, toggle: m, close: v } = pl(
|
|
2340
2393
|
s,
|
|
2341
2394
|
{ persist: "webx-admin-shell" }
|
|
2342
|
-
),
|
|
2395
|
+
), f = b(() => t.state.manifest?.title ?? ""), c = b(() => t.state.manifest?.branding?.logo ?? null), h = b(() => t.state.manifest?.branding?.mark ?? null), y = b(() => hl(n.value, null));
|
|
2343
2396
|
return Gt(() => {
|
|
2344
2397
|
typeof document > "u" || (document.documentElement.dataset.wxShell = y.value);
|
|
2345
2398
|
}), Qt(() => {
|
|
2346
2399
|
typeof document < "u" && delete document.documentElement.dataset.wxShell;
|
|
2347
|
-
}), (
|
|
2348
|
-
const
|
|
2349
|
-
return d(), $(
|
|
2350
|
-
|
|
2351
|
-
a(t).state.status === "unauthenticated" ? (d(), $("div",
|
|
2352
|
-
|
|
2353
|
-
])) : a(t).state.status === "loading" ? (d(), $("div",
|
|
2354
|
-
|
|
2400
|
+
}), (p, _) => {
|
|
2401
|
+
const S = ne("router-view"), F = ne("wx-loading"), Y = ne("wx-button"), D = ne("wx-result"), L = ne("wx-action"), T = ne("wx-text"), z = ne("wx-header"), k = ne("wx-aside"), H = ne("wx-main"), V = ne("wx-container"), I = ne("wx-drawer");
|
|
2402
|
+
return d(), $(j, null, [
|
|
2403
|
+
x(a(yl), { placement: "bottom-center" }),
|
|
2404
|
+
a(t).state.status === "unauthenticated" ? (d(), $("div", Ln, [
|
|
2405
|
+
x(S)
|
|
2406
|
+
])) : a(t).state.status === "loading" ? (d(), $("div", zn, [
|
|
2407
|
+
x(F, {
|
|
2355
2408
|
label: a(l)("shell.loading")
|
|
2356
2409
|
}, null, 8, ["label"])
|
|
2357
|
-
])) : a(t).state.status === "error" ? (d(), $("div",
|
|
2358
|
-
|
|
2410
|
+
])) : a(t).state.status === "error" ? (d(), $("div", Vn, [
|
|
2411
|
+
x(D, {
|
|
2359
2412
|
status: "error",
|
|
2360
2413
|
title: a(l)("shell.error-title"),
|
|
2361
2414
|
description: a(t).state.error
|
|
2362
2415
|
}, {
|
|
2363
2416
|
default: g(() => [
|
|
2364
|
-
|
|
2417
|
+
x(Y, {
|
|
2365
2418
|
type: "primary",
|
|
2366
|
-
onClick:
|
|
2419
|
+
onClick: _[0] || (_[0] = (O) => a(t).reload())
|
|
2367
2420
|
}, {
|
|
2368
2421
|
default: g(() => [
|
|
2369
2422
|
R(C(a(l)("shell.retry")), 1)
|
|
@@ -2379,13 +2432,13 @@ const Tn = /* @__PURE__ */ j({
|
|
|
2379
2432
|
ref: s,
|
|
2380
2433
|
class: ve(["wx-root wx-admin", `wx-admin--${y.value}`])
|
|
2381
2434
|
}, [
|
|
2382
|
-
|
|
2435
|
+
x(V, {
|
|
2383
2436
|
direction: a(i) === "drawer" ? "vertical" : "horizontal",
|
|
2384
2437
|
"full-height": "",
|
|
2385
2438
|
class: "wx-admin__frame"
|
|
2386
2439
|
}, {
|
|
2387
2440
|
default: g(() => [
|
|
2388
|
-
a(i) === "drawer" ? (d(),
|
|
2441
|
+
a(i) === "drawer" ? (d(), W(z, {
|
|
2389
2442
|
key: 0,
|
|
2390
2443
|
class: "wx-admin__header",
|
|
2391
2444
|
floating: "",
|
|
@@ -2395,29 +2448,29 @@ const Tn = /* @__PURE__ */ j({
|
|
|
2395
2448
|
height: "var(--wx-admin-header-height)"
|
|
2396
2449
|
}, {
|
|
2397
2450
|
end: g(() => [
|
|
2398
|
-
|
|
2451
|
+
oe(p.$slots, "user", { expanded: !1 }, void 0, !0)
|
|
2399
2452
|
]),
|
|
2400
2453
|
default: g(() => [
|
|
2401
|
-
|
|
2454
|
+
x(L, {
|
|
2402
2455
|
icon: "menu",
|
|
2403
2456
|
title: a(l)("nav.menu"),
|
|
2404
|
-
onClick: a(
|
|
2457
|
+
onClick: a(m)
|
|
2405
2458
|
}, null, 8, ["title", "onClick"]),
|
|
2406
|
-
|
|
2459
|
+
oe(p.$slots, "brand", {}, () => [
|
|
2407
2460
|
c.value ? (d(), $("img", {
|
|
2408
2461
|
key: 0,
|
|
2409
2462
|
class: "wx-admin__logo",
|
|
2410
2463
|
src: c.value.url,
|
|
2411
|
-
alt:
|
|
2464
|
+
alt: f.value,
|
|
2412
2465
|
width: c.value.width ?? void 0,
|
|
2413
2466
|
height: c.value.height ?? void 0
|
|
2414
|
-
}, null, 8,
|
|
2467
|
+
}, null, 8, Nn)) : (d(), W(T, {
|
|
2415
2468
|
key: 1,
|
|
2416
2469
|
weight: "semibold",
|
|
2417
2470
|
truncate: ""
|
|
2418
2471
|
}, {
|
|
2419
2472
|
default: g(() => [
|
|
2420
|
-
R(C(
|
|
2473
|
+
R(C(f.value), 1)
|
|
2421
2474
|
]),
|
|
2422
2475
|
_: 1
|
|
2423
2476
|
}))
|
|
@@ -2425,7 +2478,7 @@ const Tn = /* @__PURE__ */ j({
|
|
|
2425
2478
|
]),
|
|
2426
2479
|
_: 3
|
|
2427
2480
|
})) : U("", !0),
|
|
2428
|
-
a(r) ? (d(),
|
|
2481
|
+
a(r) ? (d(), W(k, {
|
|
2429
2482
|
key: 1,
|
|
2430
2483
|
class: "wx-admin__aside",
|
|
2431
2484
|
sticky: "",
|
|
@@ -2438,83 +2491,83 @@ const Tn = /* @__PURE__ */ j({
|
|
|
2438
2491
|
}, {
|
|
2439
2492
|
top: g(() => [
|
|
2440
2493
|
M("div", {
|
|
2441
|
-
class: ve(["wx-admin__brand", { "wx-admin__brand--stacked": a(o) &&
|
|
2494
|
+
class: ve(["wx-admin__brand", { "wx-admin__brand--stacked": a(o) && h.value }])
|
|
2442
2495
|
}, [
|
|
2443
|
-
a(o) ?
|
|
2496
|
+
a(o) ? h.value ? (d(), $("img", {
|
|
2444
2497
|
key: 1,
|
|
2445
2498
|
class: "wx-admin__mark",
|
|
2446
|
-
src:
|
|
2447
|
-
alt:
|
|
2448
|
-
}, null, 8,
|
|
2499
|
+
src: h.value.url,
|
|
2500
|
+
alt: f.value
|
|
2501
|
+
}, null, 8, Un)) : U("", !0) : oe(p.$slots, "brand", {}, () => [
|
|
2449
2502
|
c.value ? (d(), $("img", {
|
|
2450
2503
|
key: 0,
|
|
2451
2504
|
class: "wx-admin__logo",
|
|
2452
2505
|
src: c.value.url,
|
|
2453
|
-
alt:
|
|
2506
|
+
alt: f.value,
|
|
2454
2507
|
width: c.value.width ?? void 0,
|
|
2455
2508
|
height: c.value.height ?? void 0
|
|
2456
|
-
}, null, 8,
|
|
2509
|
+
}, null, 8, En)) : (d(), W(T, {
|
|
2457
2510
|
key: 1,
|
|
2458
2511
|
weight: "semibold",
|
|
2459
2512
|
truncate: "",
|
|
2460
2513
|
class: "wx-admin__title"
|
|
2461
2514
|
}, {
|
|
2462
2515
|
default: g(() => [
|
|
2463
|
-
R(C(
|
|
2516
|
+
R(C(f.value), 1)
|
|
2464
2517
|
]),
|
|
2465
2518
|
_: 1
|
|
2466
2519
|
}))
|
|
2467
2520
|
], !0, 0),
|
|
2468
|
-
|
|
2521
|
+
x(L, {
|
|
2469
2522
|
icon: "sidebar",
|
|
2470
2523
|
title: a(o) ? a(l)("nav.expand") : a(l)("nav.collapse"),
|
|
2471
|
-
onClick: a(
|
|
2524
|
+
onClick: a(m)
|
|
2472
2525
|
}, null, 8, ["title", "onClick"])
|
|
2473
2526
|
], 2)
|
|
2474
2527
|
]),
|
|
2475
2528
|
bottom: g(() => [
|
|
2476
|
-
M("div",
|
|
2477
|
-
|
|
2529
|
+
M("div", Rn, [
|
|
2530
|
+
oe(p.$slots, "user", {
|
|
2478
2531
|
expanded: !a(o)
|
|
2479
2532
|
}, void 0, !0)
|
|
2480
2533
|
])
|
|
2481
2534
|
]),
|
|
2482
2535
|
default: g(() => [
|
|
2483
|
-
|
|
2536
|
+
oe(p.$slots, "nav", { collapsed: a(o) }, void 0, !0)
|
|
2484
2537
|
]),
|
|
2485
2538
|
_: 3
|
|
2486
2539
|
}, 8, ["collapsed"])) : U("", !0),
|
|
2487
|
-
|
|
2540
|
+
x(H, {
|
|
2488
2541
|
padding: "none",
|
|
2489
2542
|
class: "wx-admin__screen"
|
|
2490
2543
|
}, {
|
|
2491
2544
|
default: g(() => [
|
|
2492
|
-
|
|
2545
|
+
x(S)
|
|
2493
2546
|
]),
|
|
2494
2547
|
_: 1
|
|
2495
2548
|
})
|
|
2496
2549
|
]),
|
|
2497
2550
|
_: 3
|
|
2498
2551
|
}, 8, ["direction"]),
|
|
2499
|
-
|
|
2552
|
+
x(I, {
|
|
2500
2553
|
open: a(u),
|
|
2501
|
-
"onUpdate:open":
|
|
2554
|
+
"onUpdate:open": _[1] || (_[1] = (O) => Tt(u) ? u.value = O : null),
|
|
2502
2555
|
class: "wx-admin__drawer",
|
|
2503
|
-
title:
|
|
2556
|
+
title: f.value === "" ? a(l)("nav.menu") : f.value,
|
|
2504
2557
|
side: "left",
|
|
2505
2558
|
size: 260,
|
|
2506
2559
|
"full-screen": !1,
|
|
2507
2560
|
closable: ""
|
|
2508
2561
|
}, {
|
|
2509
2562
|
footer: g(() => [
|
|
2510
|
-
M("div",
|
|
2511
|
-
|
|
2563
|
+
M("div", In, [
|
|
2564
|
+
oe(p.$slots, "user", { expanded: !0 }, void 0, !0)
|
|
2512
2565
|
])
|
|
2513
2566
|
]),
|
|
2514
2567
|
default: g(() => [
|
|
2515
|
-
|
|
2568
|
+
oe(p.$slots, "nav", {
|
|
2516
2569
|
collapsed: !1,
|
|
2517
|
-
select: a(
|
|
2570
|
+
select: a(v)
|
|
2518
2571
|
}, void 0, !0)
|
|
2519
2572
|
]),
|
|
2520
2573
|
_: 3
|
|
@@ -2523,19 +2576,19 @@ const Tn = /* @__PURE__ */ j({
|
|
|
2523
2576
|
], 64);
|
|
2524
2577
|
};
|
|
2525
2578
|
}
|
|
2526
|
-
}),
|
|
2527
|
-
function
|
|
2579
|
+
}), On = /* @__PURE__ */ se(Mn, [["__scopeId", "data-v-819885ab"]]), Pn = "webx.theme", Ft = /* @__PURE__ */ Symbol("webx-theme");
|
|
2580
|
+
function Io() {
|
|
2528
2581
|
const e = fe(Ft, null);
|
|
2529
2582
|
if (e === null)
|
|
2530
2583
|
throw new Error("useTheme() was called outside a panel created by createAdmin().");
|
|
2531
2584
|
return e;
|
|
2532
2585
|
}
|
|
2533
|
-
function
|
|
2586
|
+
function Bn(e, t) {
|
|
2534
2587
|
e.provide(Ft, t);
|
|
2535
2588
|
}
|
|
2536
|
-
function
|
|
2537
|
-
const t = e.storageKey === void 0 ?
|
|
2538
|
-
preference:
|
|
2589
|
+
function Dn(e = {}) {
|
|
2590
|
+
const t = e.storageKey === void 0 ? Pn : e.storageKey, l = ze({
|
|
2591
|
+
preference: Fn(t) ?? "system",
|
|
2539
2592
|
resolved: "light"
|
|
2540
2593
|
});
|
|
2541
2594
|
function s() {
|
|
@@ -2546,24 +2599,24 @@ function Pn(e = {}) {
|
|
|
2546
2599
|
}), {
|
|
2547
2600
|
state: l,
|
|
2548
2601
|
set(n) {
|
|
2549
|
-
l.preference = n, s(),
|
|
2602
|
+
l.preference = n, s(), _t(t, n);
|
|
2550
2603
|
},
|
|
2551
2604
|
adopt(n) {
|
|
2552
2605
|
if (n === void 0)
|
|
2553
2606
|
return;
|
|
2554
2607
|
const i = n ?? "system";
|
|
2555
|
-
i !== l.preference && (l.preference = i, s(),
|
|
2608
|
+
i !== l.preference && (l.preference = i, s(), _t(t, i));
|
|
2556
2609
|
}
|
|
2557
2610
|
};
|
|
2558
2611
|
}
|
|
2559
|
-
function
|
|
2612
|
+
function _t(e, t) {
|
|
2560
2613
|
if (e !== null)
|
|
2561
2614
|
try {
|
|
2562
2615
|
localStorage.setItem(e, t);
|
|
2563
2616
|
} catch {
|
|
2564
2617
|
}
|
|
2565
2618
|
}
|
|
2566
|
-
function
|
|
2619
|
+
function Fn(e) {
|
|
2567
2620
|
if (e === null)
|
|
2568
2621
|
return null;
|
|
2569
2622
|
try {
|
|
@@ -2574,27 +2627,27 @@ function Bn(e) {
|
|
|
2574
2627
|
}
|
|
2575
2628
|
}
|
|
2576
2629
|
const Ht = "webx.locale";
|
|
2577
|
-
function
|
|
2578
|
-
const t = e.manifestUrl ??
|
|
2579
|
-
for (const
|
|
2580
|
-
i.push(...
|
|
2581
|
-
if (!i.some((
|
|
2582
|
-
const
|
|
2630
|
+
function Mo(e = {}) {
|
|
2631
|
+
const t = e.manifestUrl ?? Xn() ?? "/api/cms/manifest", l = e.apiPath ?? t.replace(/\/manifest\/?$/, ""), s = e.basePath ?? "/cms", n = e.modules ?? [], i = [...e.routes ?? []];
|
|
2632
|
+
for (const _ of n)
|
|
2633
|
+
i.push(..._.routes ?? []);
|
|
2634
|
+
if (!i.some((_) => _.path === "/")) {
|
|
2635
|
+
const _ = n.find((S) => S.landing === !0);
|
|
2583
2636
|
i.push({
|
|
2584
2637
|
path: "/",
|
|
2585
2638
|
name: "webx.home",
|
|
2586
|
-
component:
|
|
2587
|
-
props: { landing:
|
|
2639
|
+
component: An,
|
|
2640
|
+
props: { landing: _?.path ?? _?.routes?.[0]?.path ?? null }
|
|
2588
2641
|
});
|
|
2589
2642
|
}
|
|
2590
2643
|
const o = al({
|
|
2591
2644
|
history: nl(s),
|
|
2592
2645
|
routes: i
|
|
2593
|
-
}), r =
|
|
2646
|
+
}), r = st({ locale: e.locale ?? jn() }), u = Dn(), m = e.http ?? Fl({
|
|
2594
2647
|
baseUrl: "",
|
|
2595
2648
|
csrfUrl: `${l}/auth/csrf-cookie`,
|
|
2596
2649
|
onUnauthenticated: () => {
|
|
2597
|
-
|
|
2650
|
+
f.setUser(null), f.state.status = "unauthenticated";
|
|
2598
2651
|
},
|
|
2599
2652
|
// Every request says which language the panel is currently showing. It decides what
|
|
2600
2653
|
// the server writes its own messages in — a 422 under a field — for anybody who has
|
|
@@ -2603,94 +2656,94 @@ function Io(e = {}) {
|
|
|
2603
2656
|
headers: () => ({ "X-Webx-Locale": r.state.locale })
|
|
2604
2657
|
});
|
|
2605
2658
|
r.defaults("webx-admin", Rt);
|
|
2606
|
-
async function
|
|
2607
|
-
const
|
|
2608
|
-
r.load(
|
|
2659
|
+
async function v(_) {
|
|
2660
|
+
const S = await m.get(`${l}/translations/${_}`);
|
|
2661
|
+
r.load(S.data.namespaces, S.data.locale, S.data.fallback), Kn(S.data.locale), Yn(S.data.locale, r.state.panelLocales);
|
|
2609
2662
|
}
|
|
2610
|
-
const
|
|
2611
|
-
http:
|
|
2663
|
+
const f = Sn({
|
|
2664
|
+
http: m,
|
|
2612
2665
|
theme: u,
|
|
2613
2666
|
basePath: s,
|
|
2614
2667
|
apiPath: l,
|
|
2615
2668
|
modules: n,
|
|
2616
2669
|
i18n: r,
|
|
2617
|
-
loadDictionary:
|
|
2670
|
+
loadDictionary: v,
|
|
2618
2671
|
types: e.types,
|
|
2619
2672
|
screens: e.screens,
|
|
2620
|
-
loadManifest: async () => (await
|
|
2621
|
-
}), c = Zt(
|
|
2622
|
-
c.use(gl),
|
|
2623
|
-
const
|
|
2673
|
+
loadManifest: async () => (await m.get(t)).data
|
|
2674
|
+
}), c = Zt(Hn(e));
|
|
2675
|
+
c.use(gl), Tn(c, f), El(c, r), Bn(c, u);
|
|
2676
|
+
const h = A("");
|
|
2624
2677
|
c.provide(
|
|
2625
2678
|
bl,
|
|
2626
|
-
|
|
2679
|
+
b(() => r.state.locale)
|
|
2627
2680
|
), c.provide(wl, {
|
|
2628
|
-
list:
|
|
2629
|
-
() => r.state.contentLocales.map((
|
|
2630
|
-
code:
|
|
2631
|
-
label:
|
|
2681
|
+
list: b(
|
|
2682
|
+
() => r.state.contentLocales.map((_) => ({
|
|
2683
|
+
code: _.code,
|
|
2684
|
+
label: _.code.toUpperCase()
|
|
2632
2685
|
}))
|
|
2633
2686
|
),
|
|
2634
|
-
active:
|
|
2635
|
-
get: () =>
|
|
2636
|
-
set: (
|
|
2637
|
-
|
|
2687
|
+
active: b({
|
|
2688
|
+
get: () => h.value || (r.state.contentLocales[0]?.code ?? ""),
|
|
2689
|
+
set: (_) => {
|
|
2690
|
+
h.value = _;
|
|
2638
2691
|
}
|
|
2639
2692
|
})
|
|
2640
2693
|
});
|
|
2641
2694
|
const y = {
|
|
2642
2695
|
app: c,
|
|
2643
2696
|
router: o,
|
|
2644
|
-
context:
|
|
2697
|
+
context: f,
|
|
2645
2698
|
i18n: r,
|
|
2646
2699
|
theme: u,
|
|
2647
2700
|
async mount() {
|
|
2648
|
-
await Promise.all([
|
|
2649
|
-
}), c.mount(e.el ?? "#webx-app"), await
|
|
2701
|
+
await Promise.all([p(), v(r.state.locale)]).catch(() => {
|
|
2702
|
+
}), c.mount(e.el ?? "#webx-app"), await f.reload();
|
|
2650
2703
|
}
|
|
2651
2704
|
};
|
|
2652
|
-
async function
|
|
2653
|
-
const
|
|
2654
|
-
r.state.panelLocales =
|
|
2705
|
+
async function p() {
|
|
2706
|
+
const _ = await m.get(`${l}/locales`);
|
|
2707
|
+
r.state.panelLocales = _.data.panel, r.state.contentLocales = _.data.content;
|
|
2655
2708
|
}
|
|
2656
|
-
for (const
|
|
2657
|
-
|
|
2709
|
+
for (const _ of e.plugins ?? [])
|
|
2710
|
+
_.install(y);
|
|
2658
2711
|
return c.use(o), y;
|
|
2659
2712
|
}
|
|
2660
|
-
function
|
|
2713
|
+
function Hn(e) {
|
|
2661
2714
|
const t = {
|
|
2662
2715
|
// The menu is the panel's own: it is the manifest, drawn.
|
|
2663
2716
|
// The shell hands in what a choice means where it drew the menu — in the drawer it is what
|
|
2664
2717
|
// closes it, and a drawer that stays open over the section it just opened is a drawer the
|
|
2665
2718
|
// reader has to dismiss by hand.
|
|
2666
|
-
nav: (l) =>
|
|
2719
|
+
nav: (l) => xe(Wn, { collapsed: l.collapsed === !0, onSelect: l.select })
|
|
2667
2720
|
};
|
|
2668
|
-
return e.brand !== void 0 && (t.brand = () =>
|
|
2721
|
+
return e.brand !== void 0 && (t.brand = () => xe(e.brand)), e.userMenu !== void 0 && (t.user = (l) => xe(e.userMenu, { expanded: l.expanded === !0 })), { render: () => xe(On, null, t) };
|
|
2669
2722
|
}
|
|
2670
|
-
function
|
|
2671
|
-
const e =
|
|
2723
|
+
function jn() {
|
|
2724
|
+
const e = qn(Ht);
|
|
2672
2725
|
return e !== null ? e : typeof document < "u" && document.documentElement.lang !== "" ? document.documentElement.lang : typeof navigator > "u" ? "en" : navigator.language;
|
|
2673
2726
|
}
|
|
2674
|
-
function
|
|
2727
|
+
function Kn(e) {
|
|
2675
2728
|
try {
|
|
2676
2729
|
localStorage.setItem(Ht, e);
|
|
2677
2730
|
} catch {
|
|
2678
2731
|
}
|
|
2679
2732
|
}
|
|
2680
|
-
function
|
|
2733
|
+
function qn(e) {
|
|
2681
2734
|
try {
|
|
2682
2735
|
return localStorage.getItem(e);
|
|
2683
2736
|
} catch {
|
|
2684
2737
|
return null;
|
|
2685
2738
|
}
|
|
2686
2739
|
}
|
|
2687
|
-
function
|
|
2740
|
+
function Yn(e, t) {
|
|
2688
2741
|
typeof document > "u" || (document.documentElement.lang = e, document.documentElement.dir = t.find((l) => l.code === e)?.direction ?? "ltr");
|
|
2689
2742
|
}
|
|
2690
|
-
function
|
|
2743
|
+
function Xn() {
|
|
2691
2744
|
return typeof document > "u" ? null : document.querySelector('meta[name="webx-manifest"]')?.getAttribute("content") ?? null;
|
|
2692
2745
|
}
|
|
2693
|
-
function
|
|
2746
|
+
function Jn(e) {
|
|
2694
2747
|
const t = e.replace(/\r\n?/g, `
|
|
2695
2748
|
`).split(`
|
|
2696
2749
|
`), l = [];
|
|
@@ -2715,53 +2768,53 @@ function Yn(e) {
|
|
|
2715
2768
|
l.push(`<h${u}>${Ke(o[2] ?? "")}</h${u}>`), s += 1;
|
|
2716
2769
|
continue;
|
|
2717
2770
|
}
|
|
2718
|
-
if (
|
|
2719
|
-
const u = /^\s*\d+[.)]\s+/.test(n),
|
|
2720
|
-
for (; s < t.length &&
|
|
2721
|
-
for (
|
|
2722
|
-
const
|
|
2723
|
-
if (
|
|
2771
|
+
if (We(n)) {
|
|
2772
|
+
const u = /^\s*\d+[.)]\s+/.test(n), m = [];
|
|
2773
|
+
for (; s < t.length && We(t[s] ?? ""); )
|
|
2774
|
+
for (m.push((t[s] ?? "").replace(/^\s*(?:[-*+]|\d+[.)])\s+/, "")), s += 1; s < t.length; ) {
|
|
2775
|
+
const f = t[s] ?? "";
|
|
2776
|
+
if (f.trim() === "" || We(f) || /^(#{1,4})\s/.test(f) || /^```/.test(f))
|
|
2724
2777
|
break;
|
|
2725
|
-
|
|
2778
|
+
m[m.length - 1] += ` ${f.trim()}`, s += 1;
|
|
2726
2779
|
}
|
|
2727
|
-
const
|
|
2728
|
-
l.push(`<${
|
|
2780
|
+
const v = u ? "ol" : "ul";
|
|
2781
|
+
l.push(`<${v}>${m.map((f) => `<li>${Ke(f)}</li>`).join("")}</${v}>`);
|
|
2729
2782
|
continue;
|
|
2730
2783
|
}
|
|
2731
2784
|
const r = [];
|
|
2732
2785
|
for (; s < t.length; ) {
|
|
2733
2786
|
const u = t[s] ?? "";
|
|
2734
|
-
if (u.trim() === "" ||
|
|
2787
|
+
if (u.trim() === "" || We(u) || /^(#{1,4})\s/.test(u) || /^```/.test(u)) break;
|
|
2735
2788
|
r.push(u.trim()), s += 1;
|
|
2736
2789
|
}
|
|
2737
2790
|
l.push(`<p>${Ke(r.join(" "))}</p>`);
|
|
2738
2791
|
}
|
|
2739
2792
|
return l.join("");
|
|
2740
2793
|
}
|
|
2741
|
-
const
|
|
2742
|
-
function
|
|
2794
|
+
const Ae = "\0";
|
|
2795
|
+
function We(e) {
|
|
2743
2796
|
return /^\s*(?:[-*+]|\d+[.)])\s+/.test(e);
|
|
2744
2797
|
}
|
|
2745
2798
|
function Ke(e) {
|
|
2746
|
-
const t = [], l = e.replace(/`([^`]+)`/g, (n, i) => (t.push(`<code>${Qe(i)}</code>`), `${
|
|
2799
|
+
const t = [], l = e.replace(/`([^`]+)`/g, (n, i) => (t.push(`<code>${Qe(i)}</code>`), `${Ae}${t.length - 1}${Ae}`));
|
|
2747
2800
|
return Qe(l).replace(
|
|
2748
2801
|
/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,
|
|
2749
2802
|
'<a href="$2" target="_blank" rel="noopener">$1</a>'
|
|
2750
2803
|
).replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>").replace(
|
|
2751
|
-
new RegExp(`${
|
|
2804
|
+
new RegExp(`${Ae}(\\d+)${Ae}`, "g"),
|
|
2752
2805
|
(n, i) => t[Number(i)] ?? ""
|
|
2753
2806
|
);
|
|
2754
2807
|
}
|
|
2755
2808
|
function Qe(e) {
|
|
2756
2809
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
2757
2810
|
}
|
|
2758
|
-
function
|
|
2811
|
+
function Gn(e) {
|
|
2759
2812
|
function t(l) {
|
|
2760
2813
|
(l.target === document.body || l.target === document.documentElement) && e(l);
|
|
2761
2814
|
}
|
|
2762
|
-
Ie(() => window.addEventListener("keydown", t)),
|
|
2815
|
+
Ie(() => window.addEventListener("keydown", t)), lt(() => window.removeEventListener("keydown", t));
|
|
2763
2816
|
}
|
|
2764
|
-
function
|
|
2817
|
+
function Qn(e, t, l) {
|
|
2765
2818
|
const s = `${e.apiPath}/entities/${t}/${l}/notes`, n = (o) => `${e.apiPath}/notes/${o}`, i = (o) => o.data;
|
|
2766
2819
|
return {
|
|
2767
2820
|
list: () => e.http.get(s).then(i),
|
|
@@ -2771,58 +2824,58 @@ function Jn(e, t, l) {
|
|
|
2771
2824
|
})
|
|
2772
2825
|
};
|
|
2773
2826
|
}
|
|
2774
|
-
const
|
|
2827
|
+
const Le = 256 * 1024, Ze = "webx:uploads", Zn = 8e3;
|
|
2775
2828
|
function qe(e) {
|
|
2776
2829
|
return `${e.name}|${e.size}|${e.lastModified}`;
|
|
2777
2830
|
}
|
|
2778
|
-
function
|
|
2779
|
-
return
|
|
2831
|
+
function Oo(e, t = rt()) {
|
|
2832
|
+
return ut(t).filter((l) => e === void 0 || l.purpose === e);
|
|
2780
2833
|
}
|
|
2781
|
-
function
|
|
2834
|
+
function eo(e, t, l = rt()) {
|
|
2782
2835
|
jt(
|
|
2783
2836
|
l,
|
|
2784
|
-
|
|
2837
|
+
ut(l).filter(
|
|
2785
2838
|
(s) => s.fingerprint !== e || s.purpose !== t
|
|
2786
2839
|
)
|
|
2787
2840
|
);
|
|
2788
2841
|
}
|
|
2789
|
-
function
|
|
2790
|
-
const t = e.admin ??
|
|
2791
|
-
() =>
|
|
2842
|
+
function Po(e = {}) {
|
|
2843
|
+
const t = e.admin ?? te(), l = e.storage === void 0 ? rt() : e.storage, s = e.retries ?? 3, n = e.retryDelay ?? 1e3, i = `${t.apiPath}/uploads`, o = A("idle"), r = A(0), u = A(0), m = A(0), v = A(null), f = A(null), c = b(() => u.value > 0 ? Math.min(1, r.value / u.value) : 0), h = b(
|
|
2844
|
+
() => m.value > 0 ? Math.ceil((u.value - r.value) / m.value) : null
|
|
2792
2845
|
);
|
|
2793
|
-
let y = null,
|
|
2794
|
-
function
|
|
2795
|
-
return
|
|
2846
|
+
let y = null, p = "", _ = Le, S = 0, F = null, Y = [], D = null, L = null;
|
|
2847
|
+
function T(B, q, G = {}) {
|
|
2848
|
+
return to(t.http, B, q, G);
|
|
2796
2849
|
}
|
|
2797
|
-
function
|
|
2798
|
-
return
|
|
2799
|
-
|
|
2800
|
-
}),
|
|
2801
|
-
})),
|
|
2850
|
+
function z() {
|
|
2851
|
+
return L === null && (L = new Promise((B, q) => {
|
|
2852
|
+
D = { resolve: B, reject: q };
|
|
2853
|
+
}), L.catch(() => {
|
|
2854
|
+
})), L;
|
|
2802
2855
|
}
|
|
2803
|
-
function
|
|
2804
|
-
const G =
|
|
2805
|
-
|
|
2856
|
+
function k(B, q) {
|
|
2857
|
+
const G = D;
|
|
2858
|
+
D = null, L = null, q !== void 0 ? G?.reject(q) : G?.resolve(B);
|
|
2806
2859
|
}
|
|
2807
|
-
function
|
|
2808
|
-
|
|
2860
|
+
function H(B) {
|
|
2861
|
+
f.value = B instanceof Error ? B : new Error(String(B)), o.value = "failed", m.value = 0, k(null, f.value);
|
|
2809
2862
|
}
|
|
2810
2863
|
function V(B) {
|
|
2811
2864
|
r.value = Math.min(B, u.value);
|
|
2812
|
-
const
|
|
2813
|
-
|
|
2814
|
-
const G =
|
|
2815
|
-
|
|
2816
|
-
}
|
|
2817
|
-
function I(B,
|
|
2818
|
-
const de = qe(B),
|
|
2819
|
-
(he) => he.fingerprint !== de || he.purpose !==
|
|
2865
|
+
const q = Date.now();
|
|
2866
|
+
Y.push({ at: q, bytes: r.value }), Y = Y.filter((ae) => q - ae.at <= Zn);
|
|
2867
|
+
const G = Y[0], de = G === void 0 ? 0 : (q - G.at) / 1e3;
|
|
2868
|
+
m.value = G !== void 0 && de > 0 ? (r.value - G.bytes) / de : 0, y !== null && I(y, p, r.value);
|
|
2869
|
+
}
|
|
2870
|
+
function I(B, q, G) {
|
|
2871
|
+
const de = qe(B), ae = ut(l).filter(
|
|
2872
|
+
(he) => he.fingerprint !== de || he.purpose !== q
|
|
2820
2873
|
);
|
|
2821
2874
|
jt(l, [
|
|
2822
|
-
...
|
|
2875
|
+
...ae,
|
|
2823
2876
|
{
|
|
2824
2877
|
fingerprint: de,
|
|
2825
|
-
purpose:
|
|
2878
|
+
purpose: q,
|
|
2826
2879
|
name: B.name,
|
|
2827
2880
|
size: B.size,
|
|
2828
2881
|
offset: G,
|
|
@@ -2831,71 +2884,71 @@ function Oo(e = {}) {
|
|
|
2831
2884
|
]);
|
|
2832
2885
|
}
|
|
2833
2886
|
function O() {
|
|
2834
|
-
y !== null &&
|
|
2887
|
+
y !== null && eo(qe(y), p, l);
|
|
2835
2888
|
}
|
|
2836
|
-
function
|
|
2837
|
-
|
|
2889
|
+
function le() {
|
|
2890
|
+
S += 1, F?.abort(), F = null, m.value = 0, Y = [];
|
|
2838
2891
|
}
|
|
2839
|
-
async function ue(B,
|
|
2892
|
+
async function ue(B, q) {
|
|
2840
2893
|
if (o.value === "uploading" || o.value === "paused" || o.value === "offline")
|
|
2841
2894
|
throw new Error("This upload is still going; cancel it before starting another.");
|
|
2842
|
-
|
|
2843
|
-
const G =
|
|
2895
|
+
le(), y = B, p = q, v.value = null, f.value = null, r.value = 0, u.value = B.size, o.value = "uploading";
|
|
2896
|
+
const G = z(), de = S;
|
|
2844
2897
|
try {
|
|
2845
|
-
const
|
|
2898
|
+
const ae = await t.http.post(i, {
|
|
2846
2899
|
name: B.name,
|
|
2847
2900
|
size: B.size,
|
|
2848
2901
|
type: B.type,
|
|
2849
2902
|
fingerprint: qe(B),
|
|
2850
|
-
purpose:
|
|
2903
|
+
purpose: q
|
|
2851
2904
|
});
|
|
2852
|
-
if (de !==
|
|
2905
|
+
if (de !== S)
|
|
2853
2906
|
return G;
|
|
2854
|
-
|
|
2855
|
-
} catch (
|
|
2856
|
-
de ===
|
|
2907
|
+
v.value = ae.data.id, _ = Math.max(Le, ae.data.chunk_size), V(ae.data.offset), ee();
|
|
2908
|
+
} catch (ae) {
|
|
2909
|
+
de === S && H(ae);
|
|
2857
2910
|
}
|
|
2858
2911
|
return G;
|
|
2859
2912
|
}
|
|
2860
2913
|
async function P() {
|
|
2861
|
-
const B = await
|
|
2914
|
+
const B = await T("HEAD", `${i}/${v.value}`);
|
|
2862
2915
|
if (!B.ok)
|
|
2863
|
-
return
|
|
2864
|
-
const
|
|
2865
|
-
return
|
|
2916
|
+
return H(await Ge(B)), !1;
|
|
2917
|
+
const q = Ye(B);
|
|
2918
|
+
return q !== null && V(q), !0;
|
|
2866
2919
|
}
|
|
2867
2920
|
async function ee() {
|
|
2868
|
-
const B =
|
|
2869
|
-
let
|
|
2870
|
-
for (o.value = "uploading"; B ===
|
|
2921
|
+
const B = S;
|
|
2922
|
+
let q = 0;
|
|
2923
|
+
for (o.value = "uploading"; B === S && y !== null && v.value !== null; ) {
|
|
2871
2924
|
if (r.value >= u.value) {
|
|
2872
|
-
o.value = "done",
|
|
2925
|
+
o.value = "done", m.value = 0, O(), k(v.value);
|
|
2873
2926
|
return;
|
|
2874
2927
|
}
|
|
2875
|
-
const G = r.value, de = Math.min(u.value, G +
|
|
2876
|
-
|
|
2877
|
-
let
|
|
2928
|
+
const G = r.value, de = Math.min(u.value, G + _);
|
|
2929
|
+
F = new AbortController();
|
|
2930
|
+
let ae;
|
|
2878
2931
|
try {
|
|
2879
|
-
|
|
2932
|
+
ae = await T("PATCH", `${i}/${v.value}`, {
|
|
2880
2933
|
body: y.slice(G, de),
|
|
2881
2934
|
headers: {
|
|
2882
2935
|
"Upload-Offset": String(G),
|
|
2883
2936
|
"Content-Type": "application/offset+octet-stream"
|
|
2884
2937
|
},
|
|
2885
|
-
signal:
|
|
2938
|
+
signal: F.signal
|
|
2886
2939
|
});
|
|
2887
2940
|
} catch (he) {
|
|
2888
|
-
if (B !==
|
|
2941
|
+
if (B !== S)
|
|
2889
2942
|
return;
|
|
2890
|
-
if (
|
|
2943
|
+
if (xt()) {
|
|
2891
2944
|
N();
|
|
2892
2945
|
return;
|
|
2893
2946
|
}
|
|
2894
|
-
if (
|
|
2895
|
-
|
|
2947
|
+
if (q += 1, q > s) {
|
|
2948
|
+
H(he);
|
|
2896
2949
|
return;
|
|
2897
2950
|
}
|
|
2898
|
-
if (await
|
|
2951
|
+
if (await lo(n * 2 ** (q - 1)), B !== S)
|
|
2899
2952
|
return;
|
|
2900
2953
|
try {
|
|
2901
2954
|
if (!await P())
|
|
@@ -2904,81 +2957,81 @@ function Oo(e = {}) {
|
|
|
2904
2957
|
}
|
|
2905
2958
|
continue;
|
|
2906
2959
|
}
|
|
2907
|
-
if (B !==
|
|
2960
|
+
if (B !== S)
|
|
2908
2961
|
return;
|
|
2909
|
-
if (
|
|
2910
|
-
|
|
2962
|
+
if (ae.ok) {
|
|
2963
|
+
q = 0, V(Ye(ae) ?? de);
|
|
2911
2964
|
continue;
|
|
2912
2965
|
}
|
|
2913
|
-
if (
|
|
2914
|
-
const he = Ye(
|
|
2966
|
+
if (ae.status === 409) {
|
|
2967
|
+
const he = Ye(ae);
|
|
2915
2968
|
if (he !== null) {
|
|
2916
2969
|
V(he);
|
|
2917
2970
|
continue;
|
|
2918
2971
|
}
|
|
2919
2972
|
}
|
|
2920
|
-
if (
|
|
2921
|
-
|
|
2973
|
+
if (ae.status === 413 && _ > Le) {
|
|
2974
|
+
_ = Math.max(Le, Math.floor(_ / 2));
|
|
2922
2975
|
continue;
|
|
2923
2976
|
}
|
|
2924
|
-
|
|
2977
|
+
H(await Ge(ae));
|
|
2925
2978
|
return;
|
|
2926
2979
|
}
|
|
2927
2980
|
}
|
|
2928
|
-
function
|
|
2929
|
-
o.value === "uploading" && (
|
|
2981
|
+
function w() {
|
|
2982
|
+
o.value === "uploading" && (le(), o.value = "paused");
|
|
2930
2983
|
}
|
|
2931
2984
|
function N() {
|
|
2932
|
-
|
|
2985
|
+
le(), o.value = "offline";
|
|
2933
2986
|
}
|
|
2934
2987
|
async function E() {
|
|
2935
2988
|
if (o.value === "uploading" || o.value === "done" || o.value === "idle")
|
|
2936
|
-
return
|
|
2989
|
+
return L ?? Promise.resolve(o.value === "done" ? v.value : null);
|
|
2937
2990
|
if (y === null)
|
|
2938
2991
|
return Promise.resolve(null);
|
|
2939
|
-
if (
|
|
2940
|
-
return o.value = "idle", ue(y,
|
|
2941
|
-
|
|
2942
|
-
const B =
|
|
2992
|
+
if (v.value === null)
|
|
2993
|
+
return o.value = "idle", ue(y, p);
|
|
2994
|
+
le(), f.value = null, o.value = "uploading";
|
|
2995
|
+
const B = z(), q = S;
|
|
2943
2996
|
try {
|
|
2944
|
-
await P() &&
|
|
2997
|
+
await P() && q === S && ee();
|
|
2945
2998
|
} catch (G) {
|
|
2946
|
-
|
|
2999
|
+
q === S && (xt() ? N() : H(G));
|
|
2947
3000
|
}
|
|
2948
3001
|
return B;
|
|
2949
3002
|
}
|
|
2950
|
-
async function
|
|
2951
|
-
const B =
|
|
2952
|
-
if (
|
|
3003
|
+
async function X() {
|
|
3004
|
+
const B = v.value;
|
|
3005
|
+
if (le(), O(), o.value = "idle", r.value = 0, v.value = null, k(null), B !== null)
|
|
2953
3006
|
try {
|
|
2954
|
-
await
|
|
3007
|
+
await T("DELETE", `${i}/${B}`);
|
|
2955
3008
|
} catch {
|
|
2956
3009
|
}
|
|
2957
3010
|
}
|
|
2958
3011
|
function pe() {
|
|
2959
3012
|
o.value === "uploading" && N();
|
|
2960
3013
|
}
|
|
2961
|
-
function
|
|
3014
|
+
function ct() {
|
|
2962
3015
|
o.value === "offline" && E();
|
|
2963
3016
|
}
|
|
2964
|
-
return typeof window < "u" && (window.addEventListener("offline", pe), window.addEventListener("online",
|
|
2965
|
-
typeof window < "u" && (window.removeEventListener("offline", pe), window.removeEventListener("online",
|
|
3017
|
+
return typeof window < "u" && (window.addEventListener("offline", pe), window.addEventListener("online", ct)), el() !== void 0 && tl(() => {
|
|
3018
|
+
typeof window < "u" && (window.removeEventListener("offline", pe), window.removeEventListener("online", ct)), w();
|
|
2966
3019
|
}), {
|
|
2967
3020
|
state: we(o),
|
|
2968
3021
|
progress: c,
|
|
2969
3022
|
uploaded: we(r),
|
|
2970
3023
|
total: we(u),
|
|
2971
|
-
speed: we(
|
|
2972
|
-
remaining:
|
|
2973
|
-
id: we(
|
|
2974
|
-
error: we(
|
|
3024
|
+
speed: we(m),
|
|
3025
|
+
remaining: h,
|
|
3026
|
+
id: we(v),
|
|
3027
|
+
error: we(f),
|
|
2975
3028
|
start: ue,
|
|
2976
|
-
pause:
|
|
3029
|
+
pause: w,
|
|
2977
3030
|
resume: E,
|
|
2978
|
-
cancel:
|
|
3031
|
+
cancel: X
|
|
2979
3032
|
};
|
|
2980
3033
|
}
|
|
2981
|
-
async function
|
|
3034
|
+
async function to(e, t, l, s) {
|
|
2982
3035
|
return e.send !== void 0 ? e.send(t, l, s) : globalThis.fetch(l, {
|
|
2983
3036
|
method: t,
|
|
2984
3037
|
credentials: "same-origin",
|
|
@@ -2991,20 +3044,20 @@ function Ye(e) {
|
|
|
2991
3044
|
const t = e.headers.get("Upload-Offset");
|
|
2992
3045
|
return t === null || !/^\d+$/.test(t) ? null : Number.parseInt(t, 10);
|
|
2993
3046
|
}
|
|
2994
|
-
function
|
|
3047
|
+
function xt() {
|
|
2995
3048
|
return typeof navigator < "u" && navigator.onLine === !1;
|
|
2996
3049
|
}
|
|
2997
|
-
function
|
|
3050
|
+
function lo(e) {
|
|
2998
3051
|
return new Promise((t) => setTimeout(t, e));
|
|
2999
3052
|
}
|
|
3000
|
-
function
|
|
3053
|
+
function rt() {
|
|
3001
3054
|
try {
|
|
3002
3055
|
return typeof localStorage > "u" ? null : localStorage;
|
|
3003
3056
|
} catch {
|
|
3004
3057
|
return null;
|
|
3005
3058
|
}
|
|
3006
3059
|
}
|
|
3007
|
-
function
|
|
3060
|
+
function ut(e) {
|
|
3008
3061
|
if (e === null)
|
|
3009
3062
|
return [];
|
|
3010
3063
|
try {
|
|
@@ -3022,74 +3075,74 @@ function jt(e, t) {
|
|
|
3022
3075
|
}
|
|
3023
3076
|
}
|
|
3024
3077
|
const Kt = /* @__PURE__ */ Symbol("wx-category-editor");
|
|
3025
|
-
function
|
|
3078
|
+
function ao(e) {
|
|
3026
3079
|
Ue(Kt, e);
|
|
3027
3080
|
}
|
|
3028
|
-
function
|
|
3081
|
+
function Bo() {
|
|
3029
3082
|
return fe(Kt, null);
|
|
3030
3083
|
}
|
|
3031
|
-
function
|
|
3084
|
+
function no(e) {
|
|
3032
3085
|
return (e.q ?? "").trim() !== "" || e.filtered ? "locked" : e.category == null ? "all" : "category";
|
|
3033
3086
|
}
|
|
3034
|
-
function
|
|
3035
|
-
const l =
|
|
3087
|
+
function Do(e, t) {
|
|
3088
|
+
const l = te(), s = J("webx-admin"), n = b(() => no(t()));
|
|
3036
3089
|
return {
|
|
3037
3090
|
mode: n,
|
|
3038
|
-
sortable:
|
|
3039
|
-
hint:
|
|
3091
|
+
sortable: b(() => n.value !== "locked"),
|
|
3092
|
+
hint: b(() => s(`categories.order-${n.value}`)),
|
|
3040
3093
|
move: (i) => Rl(l, e, i, n.value === "category" ? t().category ?? null : null)
|
|
3041
3094
|
};
|
|
3042
3095
|
}
|
|
3043
|
-
function
|
|
3096
|
+
function dt(e = {}) {
|
|
3044
3097
|
const t = J("webx-admin");
|
|
3045
3098
|
return (l, s) => t(e[l] ?? `webx-admin::categories.${l}`, s);
|
|
3046
3099
|
}
|
|
3047
|
-
const
|
|
3100
|
+
const oo = /* @__PURE__ */ K({
|
|
3048
3101
|
name: "WxCategoryCreateDialog",
|
|
3049
3102
|
__name: "CategoryCreateDialog",
|
|
3050
3103
|
props: {
|
|
3051
3104
|
options: {}
|
|
3052
3105
|
},
|
|
3053
3106
|
setup(e) {
|
|
3054
|
-
const t = e, { open: l, resolve: s, dismiss: n } = _l(), i =
|
|
3107
|
+
const t = e, { open: l, resolve: s, dismiss: n } = _l(), i = _e(te(), t.options.api), o = dt(t.options.words), r = A(""), u = A(!1), m = A({}), v = St("field");
|
|
3055
3108
|
Ie(async () => {
|
|
3056
|
-
await
|
|
3109
|
+
await tt(), v.value?.querySelector("input")?.focus();
|
|
3057
3110
|
});
|
|
3058
|
-
function
|
|
3059
|
-
const y = Object.keys(
|
|
3060
|
-
return y === void 0 ? void 0 :
|
|
3111
|
+
function f(h) {
|
|
3112
|
+
const y = Object.keys(m.value).find((p) => p === h || p.startsWith(`${h}.`));
|
|
3113
|
+
return y === void 0 ? void 0 : m.value[y]?.[0];
|
|
3061
3114
|
}
|
|
3062
3115
|
async function c() {
|
|
3063
3116
|
if (!(r.value.trim() === "" || u.value)) {
|
|
3064
|
-
u.value = !0,
|
|
3117
|
+
u.value = !0, m.value = {};
|
|
3065
3118
|
try {
|
|
3066
3119
|
s(await i.create({ title: r.value.trim() }));
|
|
3067
|
-
} catch (
|
|
3068
|
-
|
|
3120
|
+
} catch (h) {
|
|
3121
|
+
m.value = h.body?.errors ?? {};
|
|
3069
3122
|
} finally {
|
|
3070
3123
|
u.value = !1;
|
|
3071
3124
|
}
|
|
3072
3125
|
}
|
|
3073
3126
|
}
|
|
3074
|
-
return (
|
|
3127
|
+
return (h, y) => (d(), W(a(nt), {
|
|
3075
3128
|
open: a(l),
|
|
3076
|
-
"onUpdate:open": y[2] || (y[2] = (
|
|
3129
|
+
"onUpdate:open": y[2] || (y[2] = (p) => Tt(l) ? l.value = p : null),
|
|
3077
3130
|
title: a(o)("new"),
|
|
3078
3131
|
width: 440
|
|
3079
3132
|
}, {
|
|
3080
3133
|
footer: g(() => [
|
|
3081
|
-
|
|
3134
|
+
x(a(kl), { size: "sm" }, {
|
|
3082
3135
|
default: g(() => [
|
|
3083
|
-
|
|
3136
|
+
x(a(ce), {
|
|
3084
3137
|
variant: "outline",
|
|
3085
|
-
onClick: y[1] || (y[1] = (
|
|
3138
|
+
onClick: y[1] || (y[1] = (p) => a(n)())
|
|
3086
3139
|
}, {
|
|
3087
3140
|
default: g(() => [
|
|
3088
3141
|
R(C(a(o)("cancel")), 1)
|
|
3089
3142
|
]),
|
|
3090
3143
|
_: 1
|
|
3091
3144
|
}),
|
|
3092
|
-
|
|
3145
|
+
x(a(ce), {
|
|
3093
3146
|
type: "primary",
|
|
3094
3147
|
loading: u.value,
|
|
3095
3148
|
disabled: r.value.trim() === "",
|
|
@@ -3105,19 +3158,19 @@ const ao = /* @__PURE__ */ j({
|
|
|
3105
3158
|
})
|
|
3106
3159
|
]),
|
|
3107
3160
|
default: g(() => [
|
|
3108
|
-
|
|
3161
|
+
x(a(xl), {
|
|
3109
3162
|
label: a(o)("field-title"),
|
|
3110
|
-
error:
|
|
3163
|
+
error: f("title") ?? f("slug"),
|
|
3111
3164
|
required: ""
|
|
3112
3165
|
}, {
|
|
3113
3166
|
default: g(() => [
|
|
3114
3167
|
M("div", {
|
|
3115
3168
|
ref_key: "field",
|
|
3116
|
-
ref:
|
|
3169
|
+
ref: v
|
|
3117
3170
|
}, [
|
|
3118
|
-
|
|
3171
|
+
x(a(Se), {
|
|
3119
3172
|
modelValue: r.value,
|
|
3120
|
-
"onUpdate:modelValue": y[0] || (y[0] = (
|
|
3173
|
+
"onUpdate:modelValue": y[0] || (y[0] = (p) => r.value = p),
|
|
3121
3174
|
"aria-label": a(o)("field-title"),
|
|
3122
3175
|
onKeyup: Ct(c, ["enter"])
|
|
3123
3176
|
}, null, 8, ["modelValue", "aria-label"])
|
|
@@ -3129,136 +3182,136 @@ const ao = /* @__PURE__ */ j({
|
|
|
3129
3182
|
_: 1
|
|
3130
3183
|
}, 8, ["open", "title"]));
|
|
3131
3184
|
}
|
|
3132
|
-
}),
|
|
3185
|
+
}), so = { class: "wx-category-row__name" }, io = /* @__PURE__ */ K({
|
|
3133
3186
|
name: "WxCategoriesPage",
|
|
3134
3187
|
__name: "CategoriesPage",
|
|
3135
3188
|
props: {
|
|
3136
3189
|
options: {}
|
|
3137
3190
|
},
|
|
3138
3191
|
setup(e) {
|
|
3139
|
-
const t = e, l =
|
|
3140
|
-
() => l.state.manifest?.modules.find((
|
|
3141
|
-
), c = $l(
|
|
3142
|
-
() =>
|
|
3143
|
-
|
|
3192
|
+
const t = e, l = te(), s = _e(l, t.options.api), n = Me(), i = dt(t.options.words), o = De(), r = A([]), u = A(!0), m = A(!0), v = b(() => l.can(t.options.manage)), f = b(
|
|
3193
|
+
() => l.state.manifest?.modules.find((L) => L.id === t.options.module)?.title ?? ""
|
|
3194
|
+
), c = $l(oo), h = b(
|
|
3195
|
+
() => v.value ? [{ key: "new", label: i("new"), icon: "plus", primary: !0, run: () => {
|
|
3196
|
+
S();
|
|
3144
3197
|
} }] : []
|
|
3145
3198
|
);
|
|
3146
|
-
function y(
|
|
3147
|
-
return Number(
|
|
3199
|
+
function y(L) {
|
|
3200
|
+
return Number(L[t.options.count] ?? 0);
|
|
3148
3201
|
}
|
|
3149
|
-
async function
|
|
3202
|
+
async function p() {
|
|
3150
3203
|
u.value = !0;
|
|
3151
3204
|
try {
|
|
3152
|
-
const
|
|
3153
|
-
r.value =
|
|
3154
|
-
} catch (
|
|
3155
|
-
Z.danger(o(
|
|
3205
|
+
const L = await s.list();
|
|
3206
|
+
r.value = L.data, m.value = L.prefix !== null;
|
|
3207
|
+
} catch (L) {
|
|
3208
|
+
Z.danger(o(L));
|
|
3156
3209
|
} finally {
|
|
3157
3210
|
u.value = !1;
|
|
3158
3211
|
}
|
|
3159
3212
|
}
|
|
3160
|
-
|
|
3161
|
-
function
|
|
3162
|
-
n.push(`${t.options.path}/${
|
|
3213
|
+
p();
|
|
3214
|
+
function _(L) {
|
|
3215
|
+
n.push(`${t.options.path}/${L.id}`);
|
|
3163
3216
|
}
|
|
3164
|
-
async function
|
|
3165
|
-
const
|
|
3166
|
-
|
|
3217
|
+
async function S() {
|
|
3218
|
+
const L = await c({ options: t.options });
|
|
3219
|
+
L !== void 0 && _(L);
|
|
3167
3220
|
}
|
|
3168
|
-
async function
|
|
3169
|
-
if (y(
|
|
3221
|
+
async function F(L) {
|
|
3222
|
+
if (y(L) > 0) {
|
|
3170
3223
|
Z.warning(i("delete-blocked"));
|
|
3171
3224
|
return;
|
|
3172
3225
|
}
|
|
3173
3226
|
if (await Ne({
|
|
3174
|
-
title: i("delete-title", { name:
|
|
3227
|
+
title: i("delete-title", { name: L.name }),
|
|
3175
3228
|
message: i("delete-text"),
|
|
3176
3229
|
confirmText: i("delete"),
|
|
3177
3230
|
cancelText: i("cancel"),
|
|
3178
3231
|
tone: "danger"
|
|
3179
3232
|
}))
|
|
3180
3233
|
try {
|
|
3181
|
-
await s.remove(
|
|
3182
|
-
} catch (
|
|
3183
|
-
Z.danger(o(
|
|
3234
|
+
await s.remove(L.id), Z.success(i("deleted")), await p();
|
|
3235
|
+
} catch (z) {
|
|
3236
|
+
Z.danger(o(z));
|
|
3184
3237
|
}
|
|
3185
3238
|
}
|
|
3186
|
-
function
|
|
3187
|
-
const
|
|
3188
|
-
return
|
|
3239
|
+
function Y(L) {
|
|
3240
|
+
const T = [{ key: "edit", label: i("edit"), icon: "edit", run: () => _(L) }], z = t.options.items;
|
|
3241
|
+
return z && y(L) > 0 && T.push({
|
|
3189
3242
|
key: "items",
|
|
3190
3243
|
label: i("show-items"),
|
|
3191
3244
|
icon: "file-txt",
|
|
3192
3245
|
run: () => {
|
|
3193
|
-
n.push(
|
|
3246
|
+
n.push(z(L.id));
|
|
3194
3247
|
}
|
|
3195
|
-
}),
|
|
3248
|
+
}), L.url && L.is_visible && T.push({ key: "site", label: i("open-on-site"), icon: "link", href: L.url }), v.value && T.push({
|
|
3196
3249
|
key: "delete",
|
|
3197
3250
|
label: i("delete"),
|
|
3198
3251
|
icon: "trash",
|
|
3199
3252
|
danger: !0,
|
|
3200
3253
|
run: () => {
|
|
3201
|
-
|
|
3254
|
+
F(L);
|
|
3202
3255
|
}
|
|
3203
|
-
}),
|
|
3256
|
+
}), T;
|
|
3204
3257
|
}
|
|
3205
|
-
async function
|
|
3258
|
+
async function D() {
|
|
3206
3259
|
try {
|
|
3207
|
-
await s.reorder(r.value.map((
|
|
3208
|
-
} catch (
|
|
3209
|
-
Z.danger(o(
|
|
3260
|
+
await s.reorder(r.value.map((L) => L.id));
|
|
3261
|
+
} catch (L) {
|
|
3262
|
+
Z.danger(o(L, i("reorder-failed"))), await p();
|
|
3210
3263
|
}
|
|
3211
3264
|
}
|
|
3212
|
-
return (
|
|
3213
|
-
const
|
|
3214
|
-
return d(),
|
|
3265
|
+
return (L, T) => {
|
|
3266
|
+
const z = ne("router-link");
|
|
3267
|
+
return d(), W(Pt, {
|
|
3215
3268
|
class: "wx-categories",
|
|
3216
|
-
title:
|
|
3217
|
-
actions:
|
|
3269
|
+
title: f.value,
|
|
3270
|
+
actions: h.value,
|
|
3218
3271
|
padding: "sm"
|
|
3219
3272
|
}, {
|
|
3220
3273
|
default: g(() => [
|
|
3221
|
-
u.value ? (d(),
|
|
3274
|
+
u.value ? (d(), W(a(ye), {
|
|
3222
3275
|
key: 0,
|
|
3223
3276
|
class: "wx-categories__loading",
|
|
3224
3277
|
rows: 5
|
|
3225
|
-
})) : r.value.length === 0 ? (d(),
|
|
3278
|
+
})) : r.value.length === 0 ? (d(), W(a(Ve), {
|
|
3226
3279
|
key: 1,
|
|
3227
3280
|
title: a(i)("empty"),
|
|
3228
3281
|
description: a(i)("empty-help")
|
|
3229
|
-
}, null, 8, ["title", "description"])) : (d(), $(
|
|
3230
|
-
|
|
3282
|
+
}, null, 8, ["title", "description"])) : (d(), $(j, { key: 2 }, [
|
|
3283
|
+
x(a(at), {
|
|
3231
3284
|
modelValue: r.value,
|
|
3232
|
-
"onUpdate:modelValue":
|
|
3285
|
+
"onUpdate:modelValue": T[0] || (T[0] = (k) => r.value = k),
|
|
3233
3286
|
class: "wx-categories__list",
|
|
3234
3287
|
plain: "",
|
|
3235
3288
|
"item-key": "id",
|
|
3236
|
-
"item-label": (
|
|
3237
|
-
disabled: !
|
|
3238
|
-
onMove:
|
|
3289
|
+
"item-label": (k) => k.name,
|
|
3290
|
+
disabled: !v.value,
|
|
3291
|
+
onMove: D
|
|
3239
3292
|
}, {
|
|
3240
|
-
default: g(({ item:
|
|
3241
|
-
|
|
3242
|
-
class: ve(["wx-category-row", { "is-hidden": !
|
|
3243
|
-
to: `${t.options.path}/${
|
|
3293
|
+
default: g(({ item: k }) => [
|
|
3294
|
+
x(z, {
|
|
3295
|
+
class: ve(["wx-category-row", { "is-hidden": !k.is_visible }]),
|
|
3296
|
+
to: `${t.options.path}/${k.id}`
|
|
3244
3297
|
}, {
|
|
3245
3298
|
default: g(() => [
|
|
3246
|
-
M("span",
|
|
3247
|
-
|
|
3299
|
+
M("span", so, [
|
|
3300
|
+
x(a(Q), {
|
|
3248
3301
|
truncate: "",
|
|
3249
3302
|
weight: "medium"
|
|
3250
3303
|
}, {
|
|
3251
3304
|
default: g(() => [
|
|
3252
|
-
R(C(
|
|
3305
|
+
R(C(k.name), 1)
|
|
3253
3306
|
]),
|
|
3254
3307
|
_: 2
|
|
3255
3308
|
}, 1024),
|
|
3256
|
-
|
|
3309
|
+
k.is_visible ? U("", !0) : (d(), W(a(Wt), {
|
|
3257
3310
|
key: 0,
|
|
3258
3311
|
content: a(i)("hidden")
|
|
3259
3312
|
}, {
|
|
3260
3313
|
default: g(() => [
|
|
3261
|
-
|
|
3314
|
+
x(a(ot), {
|
|
3262
3315
|
name: "eye-off",
|
|
3263
3316
|
size: "sm"
|
|
3264
3317
|
})
|
|
@@ -3266,14 +3319,14 @@ const ao = /* @__PURE__ */ j({
|
|
|
3266
3319
|
_: 1
|
|
3267
3320
|
}, 8, ["content"]))
|
|
3268
3321
|
]),
|
|
3269
|
-
|
|
3322
|
+
m.value ? (d(), W(a(Q), {
|
|
3270
3323
|
key: 0,
|
|
3271
3324
|
size: "sm",
|
|
3272
3325
|
tone: "muted",
|
|
3273
3326
|
truncate: ""
|
|
3274
3327
|
}, {
|
|
3275
3328
|
default: g(() => [
|
|
3276
|
-
R(C(
|
|
3329
|
+
R(C(k.path === null ? a(i)("no-address") : `/${k.path}`), 1)
|
|
3277
3330
|
]),
|
|
3278
3331
|
_: 2
|
|
3279
3332
|
}, 1024)) : U("", !0)
|
|
@@ -3281,25 +3334,25 @@ const ao = /* @__PURE__ */ j({
|
|
|
3281
3334
|
_: 2
|
|
3282
3335
|
}, 1032, ["class", "to"])
|
|
3283
3336
|
]),
|
|
3284
|
-
actions: g(({ item:
|
|
3285
|
-
|
|
3337
|
+
actions: g(({ item: k }) => [
|
|
3338
|
+
x(a(Q), {
|
|
3286
3339
|
class: "wx-category-row__count",
|
|
3287
3340
|
size: "sm",
|
|
3288
3341
|
tone: "muted"
|
|
3289
3342
|
}, {
|
|
3290
3343
|
default: g(() => [
|
|
3291
|
-
R(C(a(i)("count", { count: y(
|
|
3344
|
+
R(C(a(i)("count", { count: y(k) })), 1)
|
|
3292
3345
|
]),
|
|
3293
3346
|
_: 2
|
|
3294
3347
|
}, 1024),
|
|
3295
|
-
|
|
3296
|
-
actions:
|
|
3297
|
-
label:
|
|
3348
|
+
x(it, {
|
|
3349
|
+
actions: Y(k),
|
|
3350
|
+
label: k.name
|
|
3298
3351
|
}, null, 8, ["actions", "label"])
|
|
3299
3352
|
]),
|
|
3300
3353
|
_: 1
|
|
3301
3354
|
}, 8, ["modelValue", "item-label", "disabled"]),
|
|
3302
|
-
|
|
3355
|
+
x(a(Pe), {
|
|
3303
3356
|
class: "wx-categories__note",
|
|
3304
3357
|
type: "info",
|
|
3305
3358
|
description: a(i)("order")
|
|
@@ -3310,11 +3363,11 @@ const ao = /* @__PURE__ */ j({
|
|
|
3310
3363
|
}, 8, ["title", "actions"]);
|
|
3311
3364
|
};
|
|
3312
3365
|
}
|
|
3313
|
-
}),
|
|
3366
|
+
}), ro = {
|
|
3314
3367
|
class: "wx-save-state",
|
|
3315
3368
|
role: "status",
|
|
3316
3369
|
"aria-live": "polite"
|
|
3317
|
-
},
|
|
3370
|
+
}, uo = /* @__PURE__ */ K({
|
|
3318
3371
|
__name: "SaveState",
|
|
3319
3372
|
props: {
|
|
3320
3373
|
state: {},
|
|
@@ -3331,13 +3384,13 @@ const ao = /* @__PURE__ */ j({
|
|
|
3331
3384
|
}, t.linger));
|
|
3332
3385
|
}
|
|
3333
3386
|
);
|
|
3334
|
-
const i =
|
|
3387
|
+
const i = b(
|
|
3335
3388
|
() => t.state === "saving" ? "saving" : s.value ? "saved" : null
|
|
3336
3389
|
);
|
|
3337
|
-
return
|
|
3390
|
+
return lt(() => {
|
|
3338
3391
|
n !== null && clearTimeout(n);
|
|
3339
|
-
}), (o, r) => (d(), $("span",
|
|
3340
|
-
i.value ? (d(),
|
|
3392
|
+
}), (o, r) => (d(), $("span", ro, [
|
|
3393
|
+
i.value ? (d(), W(a(ot), {
|
|
3341
3394
|
key: 0,
|
|
3342
3395
|
class: ve(["wx-save-state__mark", { "is-saved": i.value === "saved" }]),
|
|
3343
3396
|
name: i.value === "saving" ? "loader" : "check",
|
|
@@ -3346,7 +3399,7 @@ const ao = /* @__PURE__ */ j({
|
|
|
3346
3399
|
}, null, 8, ["class", "name", "spin", "label"])) : U("", !0)
|
|
3347
3400
|
]));
|
|
3348
3401
|
}
|
|
3349
|
-
}),
|
|
3402
|
+
}), co = /* @__PURE__ */ se(uo, [["__scopeId", "data-v-216e5e44"]]), fo = { class: "wx-screen-host" }, mo = /* @__PURE__ */ K({
|
|
3350
3403
|
__name: "Screen",
|
|
3351
3404
|
props: /* @__PURE__ */ me({
|
|
3352
3405
|
name: {},
|
|
@@ -3361,31 +3414,31 @@ const ao = /* @__PURE__ */ j({
|
|
|
3361
3414
|
}),
|
|
3362
3415
|
emits: /* @__PURE__ */ me(["loaded"], ["update:modelValue"]),
|
|
3363
3416
|
setup(e, { expose: t, emit: l }) {
|
|
3364
|
-
const s = e, n = l, i = ge(e, "modelValue"), o =
|
|
3365
|
-
async function
|
|
3366
|
-
u.value = null,
|
|
3417
|
+
const s = e, n = l, i = ge(e, "modelValue"), o = te(), r = J("webx-admin"), u = A(null), m = A(null);
|
|
3418
|
+
async function v() {
|
|
3419
|
+
u.value = null, m.value = null;
|
|
3367
3420
|
try {
|
|
3368
|
-
const
|
|
3369
|
-
u.value =
|
|
3370
|
-
} catch (
|
|
3371
|
-
|
|
3421
|
+
const f = await o.loadScreen(s.name);
|
|
3422
|
+
u.value = f, n("loaded", f);
|
|
3423
|
+
} catch (f) {
|
|
3424
|
+
m.value = f instanceof Error ? f.message : String(f);
|
|
3372
3425
|
}
|
|
3373
3426
|
}
|
|
3374
3427
|
return re([() => s.name, () => o.i18n.state.locale], () => {
|
|
3375
|
-
|
|
3376
|
-
}, { immediate: !0 }), t({ reload:
|
|
3377
|
-
|
|
3428
|
+
v();
|
|
3429
|
+
}, { immediate: !0 }), t({ reload: v }), (f, c) => (d(), $("div", fo, [
|
|
3430
|
+
m.value ? (d(), W(a(Pe), {
|
|
3378
3431
|
key: 0,
|
|
3379
3432
|
type: "danger",
|
|
3380
3433
|
title: a(r)("shell.error-title"),
|
|
3381
|
-
description:
|
|
3382
|
-
}, null, 8, ["title", "description"])) : u.value === null ? (d(),
|
|
3434
|
+
description: m.value
|
|
3435
|
+
}, null, 8, ["title", "description"])) : u.value === null ? (d(), W(a(ye), {
|
|
3383
3436
|
key: 1,
|
|
3384
3437
|
rows: 4
|
|
3385
|
-
})) : (d(),
|
|
3438
|
+
})) : (d(), W(a(Vl), {
|
|
3386
3439
|
key: 2,
|
|
3387
3440
|
modelValue: i.value,
|
|
3388
|
-
"onUpdate:modelValue": c[0] || (c[0] = (
|
|
3441
|
+
"onUpdate:modelValue": c[0] || (c[0] = (h) => i.value = h),
|
|
3389
3442
|
root: u.value,
|
|
3390
3443
|
patch: a(o).screenPatch(e.name),
|
|
3391
3444
|
types: a(o).types,
|
|
@@ -3399,53 +3452,53 @@ const ao = /* @__PURE__ */ j({
|
|
|
3399
3452
|
}, null, 8, ["modelValue", "root", "patch", "types", "errors", "translate", "can", "disabled", "label-position", "label-width", "size"]))
|
|
3400
3453
|
]));
|
|
3401
3454
|
}
|
|
3402
|
-
}),
|
|
3455
|
+
}), vo = /* @__PURE__ */ K({
|
|
3403
3456
|
name: "WxCategoryEditorPage",
|
|
3404
3457
|
__name: "CategoryEditorPage",
|
|
3405
3458
|
props: {
|
|
3406
3459
|
options: {}
|
|
3407
3460
|
},
|
|
3408
3461
|
setup(e) {
|
|
3409
|
-
const t = e, l =
|
|
3462
|
+
const t = e, l = te(), s = _e(l, t.options.api), n = At(), i = Me(), o = zt(), r = dt(t.options.words), u = De(), m = b(() => Number(n.params.id)), v = b(() => t.options.path), f = A(null), c = A({}), h = A(null), y = A(""), p = A(!0), _ = A(!1), S = A({}), F = b(() => l.can(t.options.manage)), Y = b(() => JSON.stringify(c.value)), D = b(() => y.value !== "" && Y.value !== y.value), L = b(() => _.value ? "saving" : D.value ? "unsaved" : "saved"), T = b(
|
|
3410
3463
|
() => l.state.manifest?.modules.find((P) => P.id === t.options.module)?.title ?? ""
|
|
3411
|
-
),
|
|
3464
|
+
), z = b(() => {
|
|
3412
3465
|
const P = c.value.title;
|
|
3413
|
-
return Sl(P, o.active.value,
|
|
3466
|
+
return Sl(P, o.active.value, f.value?.name ?? "") || r("untitled");
|
|
3414
3467
|
});
|
|
3415
|
-
|
|
3468
|
+
ao({ category: f, values: c, prefix: h, moving: () => r("address-moving") }), Ra({ id: b(() => f.value?.id ?? null) }), bn({
|
|
3416
3469
|
values: c,
|
|
3417
|
-
prefix:
|
|
3418
|
-
path:
|
|
3470
|
+
prefix: h,
|
|
3471
|
+
path: b(() => f.value?.path),
|
|
3419
3472
|
moving: () => r("address-moving")
|
|
3420
3473
|
});
|
|
3421
|
-
function
|
|
3422
|
-
|
|
3474
|
+
function k(P) {
|
|
3475
|
+
f.value = P.category, c.value = P.values, h.value = P.prefix, y.value = JSON.stringify(P.values);
|
|
3423
3476
|
}
|
|
3424
|
-
async function
|
|
3425
|
-
|
|
3477
|
+
async function H() {
|
|
3478
|
+
p.value = !0;
|
|
3426
3479
|
try {
|
|
3427
|
-
|
|
3480
|
+
k(await s.get(m.value));
|
|
3428
3481
|
} catch (P) {
|
|
3429
|
-
Z.danger(u(P)), i.push(
|
|
3482
|
+
Z.danger(u(P)), i.push(v.value);
|
|
3430
3483
|
} finally {
|
|
3431
|
-
|
|
3484
|
+
p.value = !1;
|
|
3432
3485
|
}
|
|
3433
3486
|
}
|
|
3434
3487
|
async function V() {
|
|
3435
|
-
if (!(!
|
|
3436
|
-
|
|
3488
|
+
if (!(!f.value || _.value || !F.value)) {
|
|
3489
|
+
_.value = !0, S.value = {};
|
|
3437
3490
|
try {
|
|
3438
|
-
|
|
3491
|
+
k(await s.save(f.value.id, c.value)), Z.success(r("saved"));
|
|
3439
3492
|
} catch (P) {
|
|
3440
3493
|
const ee = P.body;
|
|
3441
|
-
ee?.errors ? (
|
|
3494
|
+
ee?.errors ? (S.value = ee.errors, Z.danger(r("save-failed"))) : Z.danger(u(P));
|
|
3442
3495
|
} finally {
|
|
3443
|
-
|
|
3496
|
+
_.value = !1;
|
|
3444
3497
|
}
|
|
3445
3498
|
}
|
|
3446
3499
|
}
|
|
3447
3500
|
async function I() {
|
|
3448
|
-
const P =
|
|
3501
|
+
const P = f.value;
|
|
3449
3502
|
if (!(!P || !await Ne({
|
|
3450
3503
|
title: r("delete-title", { name: P.name }),
|
|
3451
3504
|
message: r("delete-text"),
|
|
@@ -3454,33 +3507,33 @@ const ao = /* @__PURE__ */ j({
|
|
|
3454
3507
|
tone: "danger"
|
|
3455
3508
|
})))
|
|
3456
3509
|
try {
|
|
3457
|
-
await s.remove(P.id), Z.success(r("deleted")), y.value =
|
|
3458
|
-
} catch (
|
|
3459
|
-
Z.danger(u(
|
|
3510
|
+
await s.remove(P.id), Z.success(r("deleted")), y.value = Y.value, i.push(v.value);
|
|
3511
|
+
} catch (w) {
|
|
3512
|
+
Z.danger(u(w));
|
|
3460
3513
|
}
|
|
3461
3514
|
}
|
|
3462
3515
|
function O(P) {
|
|
3463
|
-
|
|
3516
|
+
D.value && P.preventDefault();
|
|
3464
3517
|
}
|
|
3465
|
-
function
|
|
3466
|
-
(P.ctrlKey || P.metaKey) && P.key.toLowerCase() === "s" && (P.preventDefault(),
|
|
3518
|
+
function le(P) {
|
|
3519
|
+
(P.ctrlKey || P.metaKey) && P.key.toLowerCase() === "s" && (P.preventDefault(), D.value && V());
|
|
3467
3520
|
}
|
|
3468
|
-
|
|
3469
|
-
|
|
3521
|
+
Gn(le), re(m, () => {
|
|
3522
|
+
H();
|
|
3470
3523
|
}), Ie(() => {
|
|
3471
|
-
|
|
3472
|
-
}),
|
|
3524
|
+
H(), window.addEventListener("beforeunload", O);
|
|
3525
|
+
}), lt(() => {
|
|
3473
3526
|
window.removeEventListener("beforeunload", O);
|
|
3474
|
-
}), ol(async () => !
|
|
3527
|
+
}), ol(async () => !D.value || !F.value ? !0 : await Ne({
|
|
3475
3528
|
title: r("leave-title"),
|
|
3476
3529
|
message: r("leave-text"),
|
|
3477
3530
|
confirmText: r("leave"),
|
|
3478
3531
|
cancelText: r("cancel"),
|
|
3479
3532
|
tone: "danger"
|
|
3480
3533
|
}));
|
|
3481
|
-
const ue =
|
|
3482
|
-
const P =
|
|
3483
|
-
return P && (P.url && P.is_visible && ee.push({ key: "site", label: r("open-on-site"), icon: "link", href: P.url }),
|
|
3534
|
+
const ue = b(() => {
|
|
3535
|
+
const P = f.value, ee = [];
|
|
3536
|
+
return P && (P.url && P.is_visible && ee.push({ key: "site", label: r("open-on-site"), icon: "link", href: P.url }), F.value && ee.push({
|
|
3484
3537
|
key: "delete",
|
|
3485
3538
|
label: r("delete"),
|
|
3486
3539
|
icon: "trash",
|
|
@@ -3493,47 +3546,47 @@ const ao = /* @__PURE__ */ j({
|
|
|
3493
3546
|
});
|
|
3494
3547
|
return (P, ee) => (d(), $("div", {
|
|
3495
3548
|
class: "wx-category-editor",
|
|
3496
|
-
onKeydown:
|
|
3549
|
+
onKeydown: le
|
|
3497
3550
|
}, [
|
|
3498
|
-
|
|
3499
|
-
|
|
3551
|
+
p.value || !f.value ? (d(), $(j, { key: 0 }, [
|
|
3552
|
+
x(a(ye), {
|
|
3500
3553
|
class: "wx-category-editor__ghost",
|
|
3501
3554
|
title: "",
|
|
3502
3555
|
rows: 1
|
|
3503
3556
|
}),
|
|
3504
|
-
|
|
3557
|
+
x(a(Je), null, {
|
|
3505
3558
|
default: g(() => [
|
|
3506
|
-
|
|
3559
|
+
x(a(ye), { rows: 6 })
|
|
3507
3560
|
]),
|
|
3508
3561
|
_: 1
|
|
3509
3562
|
})
|
|
3510
|
-
], 64)) : (d(), $(
|
|
3511
|
-
|
|
3563
|
+
], 64)) : (d(), $(j, { key: 1 }, [
|
|
3564
|
+
x(Ot, {
|
|
3512
3565
|
divider: "",
|
|
3513
|
-
back:
|
|
3514
|
-
"back-label":
|
|
3515
|
-
title:
|
|
3516
|
-
subtitle:
|
|
3566
|
+
back: v.value,
|
|
3567
|
+
"back-label": T.value,
|
|
3568
|
+
title: z.value,
|
|
3569
|
+
subtitle: f.value.path === null ? void 0 : `/${f.value.path}`,
|
|
3517
3570
|
actions: ue.value
|
|
3518
3571
|
}, Re({
|
|
3519
3572
|
trail: g(() => [
|
|
3520
|
-
|
|
3573
|
+
x(a(Tl), {
|
|
3521
3574
|
size: "sm",
|
|
3522
3575
|
label: a(r)("trail")
|
|
3523
3576
|
}, {
|
|
3524
3577
|
default: g(() => [
|
|
3525
|
-
|
|
3578
|
+
x(a(mt), {
|
|
3526
3579
|
as: "router-link",
|
|
3527
|
-
to:
|
|
3580
|
+
to: v.value
|
|
3528
3581
|
}, {
|
|
3529
3582
|
default: g(() => [
|
|
3530
|
-
R(C(
|
|
3583
|
+
R(C(T.value), 1)
|
|
3531
3584
|
]),
|
|
3532
3585
|
_: 1
|
|
3533
3586
|
}, 8, ["to"]),
|
|
3534
|
-
|
|
3587
|
+
x(a(mt), { current: "" }, {
|
|
3535
3588
|
default: g(() => [
|
|
3536
|
-
R(C(
|
|
3589
|
+
R(C(z.value), 1)
|
|
3537
3590
|
]),
|
|
3538
3591
|
_: 1
|
|
3539
3592
|
})
|
|
@@ -3543,10 +3596,10 @@ const ao = /* @__PURE__ */ j({
|
|
|
3543
3596
|
]),
|
|
3544
3597
|
_: 2
|
|
3545
3598
|
}, [
|
|
3546
|
-
|
|
3599
|
+
f.value.is_visible ? void 0 : {
|
|
3547
3600
|
name: "title-after",
|
|
3548
3601
|
fn: g(() => [
|
|
3549
|
-
|
|
3602
|
+
x(a(Oe), { dot: "" }, {
|
|
3550
3603
|
default: g(() => [
|
|
3551
3604
|
R(C(a(r)("hidden")), 1)
|
|
3552
3605
|
]),
|
|
@@ -3556,22 +3609,22 @@ const ao = /* @__PURE__ */ j({
|
|
|
3556
3609
|
key: "0"
|
|
3557
3610
|
}
|
|
3558
3611
|
]), 1032, ["back", "back-label", "title", "subtitle", "actions"]),
|
|
3559
|
-
|
|
3612
|
+
x(mo, {
|
|
3560
3613
|
modelValue: c.value,
|
|
3561
|
-
"onUpdate:modelValue": ee[0] || (ee[0] = (
|
|
3614
|
+
"onUpdate:modelValue": ee[0] || (ee[0] = (w) => c.value = w),
|
|
3562
3615
|
name: t.options.screen,
|
|
3563
|
-
errors:
|
|
3564
|
-
disabled: !
|
|
3616
|
+
errors: S.value,
|
|
3617
|
+
disabled: !F.value || _.value
|
|
3565
3618
|
}, null, 8, ["modelValue", "name", "errors", "disabled"]),
|
|
3566
|
-
|
|
3619
|
+
F.value ? (d(), W(a(Cl), { key: 0 }, {
|
|
3567
3620
|
state: g(() => [
|
|
3568
|
-
|
|
3621
|
+
x(co, { state: L.value }, null, 8, ["state"])
|
|
3569
3622
|
]),
|
|
3570
3623
|
default: g(() => [
|
|
3571
|
-
|
|
3624
|
+
x(a(ce), {
|
|
3572
3625
|
type: "primary",
|
|
3573
|
-
loading:
|
|
3574
|
-
disabled: !
|
|
3626
|
+
loading: _.value,
|
|
3627
|
+
disabled: !D.value,
|
|
3575
3628
|
onClick: V
|
|
3576
3629
|
}, {
|
|
3577
3630
|
default: g(() => [
|
|
@@ -3585,30 +3638,30 @@ const ao = /* @__PURE__ */ j({
|
|
|
3585
3638
|
], 64))
|
|
3586
3639
|
], 32));
|
|
3587
3640
|
}
|
|
3588
|
-
}),
|
|
3589
|
-
function
|
|
3590
|
-
return
|
|
3641
|
+
}), po = /* @__PURE__ */ se(vo, [["__scopeId", "data-v-c245c468"]]);
|
|
3642
|
+
function kt(e, t) {
|
|
3643
|
+
return K({
|
|
3591
3644
|
name: "WxCategoriesView",
|
|
3592
|
-
setup: () => () =>
|
|
3645
|
+
setup: () => () => xe(e, { options: t })
|
|
3593
3646
|
});
|
|
3594
3647
|
}
|
|
3595
|
-
function
|
|
3648
|
+
function Fo(e) {
|
|
3596
3649
|
return [
|
|
3597
|
-
{ path: e.path, name: e.name, component:
|
|
3650
|
+
{ path: e.path, name: e.name, component: kt(io, e) },
|
|
3598
3651
|
{
|
|
3599
3652
|
path: `${e.path}/:id(\\d+)`,
|
|
3600
3653
|
name: `${e.name}.edit`,
|
|
3601
|
-
component:
|
|
3654
|
+
component: kt(po, e)
|
|
3602
3655
|
}
|
|
3603
3656
|
];
|
|
3604
3657
|
}
|
|
3605
|
-
const
|
|
3658
|
+
const Ho = 76, jo = /* @__PURE__ */ K({
|
|
3606
3659
|
__name: "FilterChips",
|
|
3607
3660
|
props: {
|
|
3608
3661
|
filters: {}
|
|
3609
3662
|
},
|
|
3610
3663
|
setup(e) {
|
|
3611
|
-
return (t, l) => (d(!0), $(
|
|
3664
|
+
return (t, l) => (d(!0), $(j, null, ie(e.filters, (s) => (d(), W(a(Oe), {
|
|
3612
3665
|
key: s.key,
|
|
3613
3666
|
class: "wx-filter-chip",
|
|
3614
3667
|
size: "sm",
|
|
@@ -3622,7 +3675,7 @@ const Fo = 76, Ho = /* @__PURE__ */ j({
|
|
|
3622
3675
|
_: 2
|
|
3623
3676
|
}, 1032, ["onClose"]))), 128));
|
|
3624
3677
|
}
|
|
3625
|
-
}),
|
|
3678
|
+
}), ho = { class: "wx-rename__footer" }, yo = /* @__PURE__ */ K({
|
|
3626
3679
|
__name: "RenameButton",
|
|
3627
3680
|
props: {
|
|
3628
3681
|
name: { default: "" },
|
|
@@ -3633,21 +3686,21 @@ const Fo = 76, Ho = /* @__PURE__ */ j({
|
|
|
3633
3686
|
},
|
|
3634
3687
|
emits: ["rename"],
|
|
3635
3688
|
setup(e, { emit: t }) {
|
|
3636
|
-
const l = e, s = t, n = J("webx-admin"), i = A(!1), o = A(l.name), r = A(null), u =
|
|
3637
|
-
re(i, async (
|
|
3638
|
-
|
|
3689
|
+
const l = e, s = t, n = J("webx-admin"), i = A(!1), o = A(l.name), r = A(null), u = b(() => l.label ?? n("editor.rename"));
|
|
3690
|
+
re(i, async (v) => {
|
|
3691
|
+
v && (o.value = l.name, await tt(), r.value?.focus(), r.value?.select());
|
|
3639
3692
|
});
|
|
3640
|
-
function
|
|
3641
|
-
const
|
|
3642
|
-
if (
|
|
3693
|
+
function m() {
|
|
3694
|
+
const v = o.value.trim();
|
|
3695
|
+
if (v === "" || v === l.name) {
|
|
3643
3696
|
i.value = !1;
|
|
3644
3697
|
return;
|
|
3645
3698
|
}
|
|
3646
|
-
s("rename",
|
|
3699
|
+
s("rename", v), i.value = !1;
|
|
3647
3700
|
}
|
|
3648
|
-
return (
|
|
3701
|
+
return (v, f) => (d(), W(a(Al), {
|
|
3649
3702
|
open: i.value,
|
|
3650
|
-
"onUpdate:open":
|
|
3703
|
+
"onUpdate:open": f[2] || (f[2] = (c) => i.value = c),
|
|
3651
3704
|
title: u.value,
|
|
3652
3705
|
width: 320,
|
|
3653
3706
|
side: "bottom",
|
|
@@ -3655,7 +3708,7 @@ const Fo = 76, Ho = /* @__PURE__ */ j({
|
|
|
3655
3708
|
teleport: ""
|
|
3656
3709
|
}, {
|
|
3657
3710
|
trigger: g(() => [
|
|
3658
|
-
|
|
3711
|
+
x(a(be), {
|
|
3659
3712
|
type: "edit",
|
|
3660
3713
|
title: u.value,
|
|
3661
3714
|
size: e.size,
|
|
@@ -3665,19 +3718,19 @@ const Fo = 76, Ho = /* @__PURE__ */ j({
|
|
|
3665
3718
|
default: g(() => [
|
|
3666
3719
|
M("form", {
|
|
3667
3720
|
class: "wx-rename",
|
|
3668
|
-
onSubmit: $t(
|
|
3721
|
+
onSubmit: $t(m, ["prevent"])
|
|
3669
3722
|
}, [
|
|
3670
|
-
|
|
3723
|
+
x(a(Se), {
|
|
3671
3724
|
ref_key: "field",
|
|
3672
3725
|
ref: r,
|
|
3673
3726
|
modelValue: o.value,
|
|
3674
|
-
"onUpdate:modelValue":
|
|
3727
|
+
"onUpdate:modelValue": f[0] || (f[0] = (c) => o.value = c),
|
|
3675
3728
|
"aria-label": u.value,
|
|
3676
3729
|
placeholder: e.placeholder,
|
|
3677
|
-
onKeydown:
|
|
3730
|
+
onKeydown: f[1] || (f[1] = Ct((c) => i.value = !1, ["esc"]))
|
|
3678
3731
|
}, null, 8, ["modelValue", "aria-label", "placeholder"]),
|
|
3679
|
-
M("div",
|
|
3680
|
-
|
|
3732
|
+
M("div", ho, [
|
|
3733
|
+
x(a(ce), {
|
|
3681
3734
|
type: "primary",
|
|
3682
3735
|
size: "sm",
|
|
3683
3736
|
"native-type": "submit"
|
|
@@ -3693,7 +3746,7 @@ const Fo = 76, Ho = /* @__PURE__ */ j({
|
|
|
3693
3746
|
_: 1
|
|
3694
3747
|
}, 8, ["open", "title"]));
|
|
3695
3748
|
}
|
|
3696
|
-
}),
|
|
3749
|
+
}), Ko = /* @__PURE__ */ se(yo, [["__scopeId", "data-v-d879e8d3"]]), go = ["innerHTML"], bo = /* @__PURE__ */ K({
|
|
3697
3750
|
__name: "HelpButton",
|
|
3698
3751
|
props: {
|
|
3699
3752
|
body: {},
|
|
@@ -3703,9 +3756,9 @@ const Fo = 76, Ho = /* @__PURE__ */ j({
|
|
|
3703
3756
|
width: { default: 720 }
|
|
3704
3757
|
},
|
|
3705
3758
|
setup(e) {
|
|
3706
|
-
const t = e, l = J("webx-admin"), s = A(!1), n =
|
|
3707
|
-
return (o, r) => (d(), $(
|
|
3708
|
-
|
|
3759
|
+
const t = e, l = J("webx-admin"), s = A(!1), n = b(() => t.title ?? l("help.title")), i = b(() => Jn(t.body));
|
|
3760
|
+
return (o, r) => (d(), $(j, null, [
|
|
3761
|
+
x(a(be), {
|
|
3709
3762
|
type: "details",
|
|
3710
3763
|
icon: "question",
|
|
3711
3764
|
tone: "neutral",
|
|
@@ -3713,7 +3766,7 @@ const Fo = 76, Ho = /* @__PURE__ */ j({
|
|
|
3713
3766
|
title: e.label ?? n.value,
|
|
3714
3767
|
onClick: r[0] || (r[0] = (u) => s.value = !0)
|
|
3715
3768
|
}, null, 8, ["size", "title"]),
|
|
3716
|
-
|
|
3769
|
+
x(a(nt), {
|
|
3717
3770
|
open: s.value,
|
|
3718
3771
|
"onUpdate:open": r[1] || (r[1] = (u) => s.value = u),
|
|
3719
3772
|
title: n.value,
|
|
@@ -3723,22 +3776,22 @@ const Fo = 76, Ho = /* @__PURE__ */ j({
|
|
|
3723
3776
|
M("div", {
|
|
3724
3777
|
class: "wx-help",
|
|
3725
3778
|
innerHTML: i.value
|
|
3726
|
-
}, null, 8,
|
|
3779
|
+
}, null, 8, go)
|
|
3727
3780
|
]),
|
|
3728
3781
|
_: 1
|
|
3729
3782
|
}, 8, ["open", "title", "width"])
|
|
3730
3783
|
], 64));
|
|
3731
3784
|
}
|
|
3732
|
-
}),
|
|
3785
|
+
}), qo = /* @__PURE__ */ se(bo, [["__scopeId", "data-v-6c280d42"]]), wo = { class: "wx-notes" }, _o = {
|
|
3733
3786
|
key: 3,
|
|
3734
3787
|
class: "wx-notes__list"
|
|
3735
|
-
},
|
|
3788
|
+
}, xo = { class: "wx-note__body" }, ko = { class: "wx-note__head" }, $o = { class: "wx-note__buttons" }, So = {
|
|
3736
3789
|
key: 1,
|
|
3737
3790
|
class: "wx-note__text"
|
|
3738
|
-
},
|
|
3791
|
+
}, To = {
|
|
3739
3792
|
key: 4,
|
|
3740
3793
|
class: "wx-notes__new"
|
|
3741
|
-
},
|
|
3794
|
+
}, Co = /* @__PURE__ */ K({
|
|
3742
3795
|
name: "WxNotes",
|
|
3743
3796
|
__name: "NotesFeed",
|
|
3744
3797
|
props: {
|
|
@@ -3749,13 +3802,13 @@ const Fo = 76, Ho = /* @__PURE__ */ j({
|
|
|
3749
3802
|
},
|
|
3750
3803
|
emits: ["change"],
|
|
3751
3804
|
setup(e, { emit: t }) {
|
|
3752
|
-
const l = e, s = t, n =
|
|
3753
|
-
async function
|
|
3805
|
+
const l = e, s = t, n = te(), i = J("webx-admin"), o = De(), r = A([]), u = A(!0), m = A(""), v = A(!1), f = A(null), c = A(""), h = b(() => Qn(n, l.type, l.id)), y = b(() => l.title ?? i("notes.title"));
|
|
3806
|
+
async function p() {
|
|
3754
3807
|
u.value = !0;
|
|
3755
3808
|
try {
|
|
3756
|
-
r.value = await
|
|
3757
|
-
} catch (
|
|
3758
|
-
Z.danger(o(
|
|
3809
|
+
r.value = await h.value.list();
|
|
3810
|
+
} catch (T) {
|
|
3811
|
+
Z.danger(o(T));
|
|
3759
3812
|
} finally {
|
|
3760
3813
|
u.value = !1;
|
|
3761
3814
|
}
|
|
@@ -3763,37 +3816,37 @@ const Fo = 76, Ho = /* @__PURE__ */ j({
|
|
|
3763
3816
|
re(
|
|
3764
3817
|
() => [l.type, l.id],
|
|
3765
3818
|
() => {
|
|
3766
|
-
|
|
3819
|
+
f.value = null, m.value = "", p();
|
|
3767
3820
|
},
|
|
3768
3821
|
{ immediate: !0 }
|
|
3769
3822
|
);
|
|
3770
|
-
async function
|
|
3771
|
-
const
|
|
3772
|
-
if (!(
|
|
3773
|
-
|
|
3823
|
+
async function _() {
|
|
3824
|
+
const T = m.value.trim();
|
|
3825
|
+
if (!(T === "" || v.value)) {
|
|
3826
|
+
v.value = !0;
|
|
3774
3827
|
try {
|
|
3775
|
-
r.value = [...r.value, await
|
|
3776
|
-
} catch (
|
|
3777
|
-
Z.danger(o(
|
|
3828
|
+
r.value = [...r.value, await h.value.add(T)], m.value = "", s("change");
|
|
3829
|
+
} catch (z) {
|
|
3830
|
+
Z.danger(o(z));
|
|
3778
3831
|
} finally {
|
|
3779
|
-
|
|
3832
|
+
v.value = !1;
|
|
3780
3833
|
}
|
|
3781
3834
|
}
|
|
3782
3835
|
}
|
|
3783
|
-
function T
|
|
3784
|
-
|
|
3836
|
+
function S(T) {
|
|
3837
|
+
f.value = T.id, c.value = T.body;
|
|
3785
3838
|
}
|
|
3786
|
-
async function
|
|
3787
|
-
const
|
|
3788
|
-
if (
|
|
3839
|
+
async function F(T) {
|
|
3840
|
+
const z = c.value.trim();
|
|
3841
|
+
if (z !== "")
|
|
3789
3842
|
try {
|
|
3790
|
-
const
|
|
3791
|
-
r.value = r.value.map((
|
|
3792
|
-
} catch (
|
|
3793
|
-
Z.danger(o(
|
|
3843
|
+
const k = await h.value.save(T.id, z);
|
|
3844
|
+
r.value = r.value.map((H) => H.id === k.id ? k : H), f.value = null, Z.success(i("notes.saved")), s("change");
|
|
3845
|
+
} catch (k) {
|
|
3846
|
+
Z.danger(o(k));
|
|
3794
3847
|
}
|
|
3795
3848
|
}
|
|
3796
|
-
async function
|
|
3849
|
+
async function Y(T) {
|
|
3797
3850
|
if (await Ne({
|
|
3798
3851
|
title: i("notes.delete-title"),
|
|
3799
3852
|
message: i("notes.delete-text"),
|
|
@@ -3802,30 +3855,30 @@ const Fo = 76, Ho = /* @__PURE__ */ j({
|
|
|
3802
3855
|
tone: "danger"
|
|
3803
3856
|
}))
|
|
3804
3857
|
try {
|
|
3805
|
-
await
|
|
3806
|
-
} catch (
|
|
3807
|
-
Z.danger(o(
|
|
3858
|
+
await h.value.remove(T.id), r.value = r.value.filter((k) => k.id !== T.id), Z.success(i("notes.deleted")), s("change");
|
|
3859
|
+
} catch (k) {
|
|
3860
|
+
Z.danger(o(k));
|
|
3808
3861
|
}
|
|
3809
3862
|
}
|
|
3810
|
-
function
|
|
3811
|
-
return !l.can || !
|
|
3812
|
-
{ key: "edit", icon: "edit", label: i("notes.edit"), run: () => T
|
|
3863
|
+
function D(T) {
|
|
3864
|
+
return !l.can || !T.is_mine ? [] : [
|
|
3865
|
+
{ key: "edit", icon: "edit", label: i("notes.edit"), run: () => S(T) },
|
|
3813
3866
|
{
|
|
3814
3867
|
key: "delete",
|
|
3815
3868
|
icon: "trash",
|
|
3816
3869
|
label: i("notes.delete"),
|
|
3817
3870
|
danger: !0,
|
|
3818
3871
|
run: () => {
|
|
3819
|
-
|
|
3872
|
+
Y(T);
|
|
3820
3873
|
}
|
|
3821
3874
|
}
|
|
3822
3875
|
];
|
|
3823
3876
|
}
|
|
3824
|
-
function
|
|
3825
|
-
return
|
|
3877
|
+
function L(T) {
|
|
3878
|
+
return T.author?.name ?? i("notes.unknown-author");
|
|
3826
3879
|
}
|
|
3827
|
-
return (
|
|
3828
|
-
y.value ? (d(),
|
|
3880
|
+
return (T, z) => (d(), $("section", wo, [
|
|
3881
|
+
y.value ? (d(), W(a(Q), {
|
|
3829
3882
|
key: 0,
|
|
3830
3883
|
weight: "medium",
|
|
3831
3884
|
class: "wx-notes__title"
|
|
@@ -3835,64 +3888,64 @@ const Fo = 76, Ho = /* @__PURE__ */ j({
|
|
|
3835
3888
|
]),
|
|
3836
3889
|
_: 1
|
|
3837
3890
|
})) : U("", !0),
|
|
3838
|
-
u.value ? (d(),
|
|
3891
|
+
u.value ? (d(), W(a(ye), {
|
|
3839
3892
|
key: 1,
|
|
3840
3893
|
rows: 2
|
|
3841
|
-
})) : r.value.length === 0 ? (d(),
|
|
3894
|
+
})) : r.value.length === 0 ? (d(), W(a(Ve), {
|
|
3842
3895
|
key: 2,
|
|
3843
3896
|
size: "sm",
|
|
3844
3897
|
description: a(i)("notes.empty")
|
|
3845
|
-
}, null, 8, ["description"])) : (d(), $("ul",
|
|
3846
|
-
(d(!0), $(
|
|
3847
|
-
key:
|
|
3898
|
+
}, null, 8, ["description"])) : (d(), $("ul", _o, [
|
|
3899
|
+
(d(!0), $(j, null, ie(r.value, (k) => (d(), $("li", {
|
|
3900
|
+
key: k.id,
|
|
3848
3901
|
class: "wx-note"
|
|
3849
3902
|
}, [
|
|
3850
|
-
|
|
3851
|
-
name:
|
|
3903
|
+
x(a(Lt), {
|
|
3904
|
+
name: L(k),
|
|
3852
3905
|
size: "sm",
|
|
3853
3906
|
tone: "auto"
|
|
3854
3907
|
}, null, 8, ["name"]),
|
|
3855
|
-
M("div",
|
|
3856
|
-
M("div",
|
|
3857
|
-
|
|
3908
|
+
M("div", xo, [
|
|
3909
|
+
M("div", ko, [
|
|
3910
|
+
x(a(Q), {
|
|
3858
3911
|
size: "sm",
|
|
3859
3912
|
weight: "medium",
|
|
3860
3913
|
truncate: ""
|
|
3861
3914
|
}, {
|
|
3862
3915
|
default: g(() => [
|
|
3863
|
-
R(C(
|
|
3916
|
+
R(C(L(k)), 1)
|
|
3864
3917
|
]),
|
|
3865
3918
|
_: 2
|
|
3866
3919
|
}, 1024),
|
|
3867
|
-
|
|
3868
|
-
value:
|
|
3920
|
+
x(Ee, {
|
|
3921
|
+
value: k.created_at
|
|
3869
3922
|
}, null, 8, ["value"]),
|
|
3870
|
-
|
|
3871
|
-
actions:
|
|
3872
|
-
label:
|
|
3923
|
+
x(it, {
|
|
3924
|
+
actions: D(k),
|
|
3925
|
+
label: L(k)
|
|
3873
3926
|
}, null, 8, ["actions", "label"])
|
|
3874
3927
|
]),
|
|
3875
|
-
|
|
3876
|
-
|
|
3928
|
+
f.value === k.id ? (d(), $(j, { key: 0 }, [
|
|
3929
|
+
x(a(vt), {
|
|
3877
3930
|
modelValue: c.value,
|
|
3878
|
-
"onUpdate:modelValue":
|
|
3931
|
+
"onUpdate:modelValue": z[0] || (z[0] = (H) => c.value = H),
|
|
3879
3932
|
autosize: { minRows: 2, maxRows: 10 }
|
|
3880
3933
|
}, null, 8, ["modelValue"]),
|
|
3881
|
-
M("div",
|
|
3882
|
-
|
|
3934
|
+
M("div", $o, [
|
|
3935
|
+
x(a(ce), {
|
|
3883
3936
|
size: "sm",
|
|
3884
3937
|
type: "primary",
|
|
3885
|
-
onClick: (
|
|
3938
|
+
onClick: (H) => F(k)
|
|
3886
3939
|
}, {
|
|
3887
3940
|
default: g(() => [
|
|
3888
3941
|
R(C(a(i)("notes.save")), 1)
|
|
3889
3942
|
]),
|
|
3890
3943
|
_: 1
|
|
3891
3944
|
}, 8, ["onClick"]),
|
|
3892
|
-
|
|
3945
|
+
x(a(ce), {
|
|
3893
3946
|
size: "sm",
|
|
3894
3947
|
variant: "text",
|
|
3895
|
-
onClick:
|
|
3948
|
+
onClick: z[1] || (z[1] = (H) => f.value = null)
|
|
3896
3949
|
}, {
|
|
3897
3950
|
default: g(() => [
|
|
3898
3951
|
R(C(a(i)("notes.cancel")), 1)
|
|
@@ -3900,23 +3953,23 @@ const Fo = 76, Ho = /* @__PURE__ */ j({
|
|
|
3900
3953
|
_: 1
|
|
3901
3954
|
})
|
|
3902
3955
|
])
|
|
3903
|
-
], 64)) : (d(), $("p",
|
|
3956
|
+
], 64)) : (d(), $("p", So, C(k.body), 1))
|
|
3904
3957
|
])
|
|
3905
3958
|
]))), 128))
|
|
3906
3959
|
])),
|
|
3907
|
-
e.can ? (d(), $("div",
|
|
3908
|
-
|
|
3909
|
-
modelValue:
|
|
3910
|
-
"onUpdate:modelValue":
|
|
3960
|
+
e.can ? (d(), $("div", To, [
|
|
3961
|
+
x(a(vt), {
|
|
3962
|
+
modelValue: m.value,
|
|
3963
|
+
"onUpdate:modelValue": z[2] || (z[2] = (k) => m.value = k),
|
|
3911
3964
|
placeholder: a(i)("notes.placeholder"),
|
|
3912
3965
|
autosize: { minRows: 2, maxRows: 8 }
|
|
3913
3966
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
3914
|
-
|
|
3967
|
+
x(a(ce), {
|
|
3915
3968
|
size: "sm",
|
|
3916
3969
|
type: "primary",
|
|
3917
|
-
disabled:
|
|
3918
|
-
loading:
|
|
3919
|
-
onClick:
|
|
3970
|
+
disabled: m.value.trim() === "",
|
|
3971
|
+
loading: v.value,
|
|
3972
|
+
onClick: _
|
|
3920
3973
|
}, {
|
|
3921
3974
|
default: g(() => [
|
|
3922
3975
|
R(C(a(i)("notes.add")), 1)
|
|
@@ -3926,41 +3979,41 @@ const Fo = 76, Ho = /* @__PURE__ */ j({
|
|
|
3926
3979
|
])) : U("", !0)
|
|
3927
3980
|
]));
|
|
3928
3981
|
}
|
|
3929
|
-
}),
|
|
3982
|
+
}), Yo = /* @__PURE__ */ se(Co, [["__scopeId", "data-v-71004c1a"]]), Ao = {
|
|
3930
3983
|
key: 1,
|
|
3931
3984
|
class: "wx-backup-note"
|
|
3932
|
-
},
|
|
3985
|
+
}, Wo = 48, Lo = /* @__PURE__ */ K({
|
|
3933
3986
|
name: "WxBackupNote",
|
|
3934
3987
|
__name: "BackupNote",
|
|
3935
3988
|
setup(e) {
|
|
3936
|
-
const t =
|
|
3937
|
-
const
|
|
3938
|
-
if (
|
|
3939
|
-
const
|
|
3940
|
-
return Number.isNaN(
|
|
3941
|
-
}), r =
|
|
3942
|
-
const
|
|
3943
|
-
if (
|
|
3944
|
-
const
|
|
3945
|
-
let
|
|
3946
|
-
for (;
|
|
3947
|
-
|
|
3989
|
+
const t = te(), l = It(), s = J("webx-admin"), n = b(() => t.state.manifest?.backup ?? null), i = b(() => n.value !== null && t.can("settings.view")), o = b(() => {
|
|
3990
|
+
const m = n.value?.at;
|
|
3991
|
+
if (m == null) return !0;
|
|
3992
|
+
const v = new Date(m).getTime();
|
|
3993
|
+
return Number.isNaN(v) || Date.now() - v > Wo * 36e5;
|
|
3994
|
+
}), r = b(() => {
|
|
3995
|
+
const m = n.value?.bytes;
|
|
3996
|
+
if (m == null) return "";
|
|
3997
|
+
const v = ["byte", "kilobyte", "megabyte", "gigabyte", "terabyte"];
|
|
3998
|
+
let f = m, c = 0;
|
|
3999
|
+
for (; f >= 1024 && c < v.length - 1; )
|
|
4000
|
+
f /= 1024, c++;
|
|
3948
4001
|
return new Intl.NumberFormat(t.i18n.state.locale, {
|
|
3949
4002
|
style: "unit",
|
|
3950
|
-
unit:
|
|
4003
|
+
unit: v[c],
|
|
3951
4004
|
unitDisplay: "short",
|
|
3952
|
-
maximumFractionDigits:
|
|
3953
|
-
}).format(
|
|
3954
|
-
}), u =
|
|
4005
|
+
maximumFractionDigits: f >= 10 || c === 0 ? 0 : 1
|
|
4006
|
+
}).format(f);
|
|
4007
|
+
}), u = b(
|
|
3955
4008
|
() => n.value?.at == null ? s("backup.never") : s("backup.stale", { date: l.short(n.value.at) })
|
|
3956
4009
|
);
|
|
3957
|
-
return (
|
|
4010
|
+
return (m, v) => i.value && o.value ? (d(), W(a(Pe), {
|
|
3958
4011
|
key: 0,
|
|
3959
4012
|
type: "warning",
|
|
3960
4013
|
variant: "soft",
|
|
3961
4014
|
description: u.value
|
|
3962
|
-
}, null, 8, ["description"])) : i.value ? (d(), $("p",
|
|
3963
|
-
|
|
4015
|
+
}, null, 8, ["description"])) : i.value ? (d(), $("p", Ao, [
|
|
4016
|
+
x(a(Q), {
|
|
3964
4017
|
size: "sm",
|
|
3965
4018
|
tone: "muted"
|
|
3966
4019
|
}, {
|
|
@@ -3969,10 +4022,10 @@ const Fo = 76, Ho = /* @__PURE__ */ j({
|
|
|
3969
4022
|
]),
|
|
3970
4023
|
_: 1
|
|
3971
4024
|
}),
|
|
3972
|
-
|
|
4025
|
+
x(Ee, {
|
|
3973
4026
|
value: n.value?.at
|
|
3974
4027
|
}, null, 8, ["value"]),
|
|
3975
|
-
r.value ? (d(),
|
|
4028
|
+
r.value ? (d(), W(a(Q), {
|
|
3976
4029
|
key: 0,
|
|
3977
4030
|
size: "sm",
|
|
3978
4031
|
tone: "muted"
|
|
@@ -3984,92 +4037,95 @@ const Fo = 76, Ho = /* @__PURE__ */ j({
|
|
|
3984
4037
|
})) : U("", !0)
|
|
3985
4038
|
])) : U("", !0);
|
|
3986
4039
|
}
|
|
3987
|
-
}),
|
|
4040
|
+
}), Xo = /* @__PURE__ */ se(Lo, [["__scopeId", "data-v-beeee67e"]]);
|
|
3988
4041
|
export {
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
4042
|
+
An as AdminLanding,
|
|
4043
|
+
Wn as AdminNav,
|
|
4044
|
+
On as AdminShell,
|
|
3992
4045
|
Et as COLLECTION_MAX_LIMIT,
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
4046
|
+
$e as HttpError,
|
|
4047
|
+
Le as MIN_CHUNK,
|
|
4048
|
+
rn as WxBackButton,
|
|
4049
|
+
Xo as WxBackupNote,
|
|
3997
4050
|
Pl as WxCategoriesField,
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4051
|
+
io as WxCategoriesPage,
|
|
4052
|
+
oo as WxCategoryCreateDialog,
|
|
4053
|
+
po as WxCategoryEditorPage,
|
|
4054
|
+
wt as WxCategorySlug,
|
|
4055
|
+
ga as WxCollectionField,
|
|
4003
4056
|
Ee as WxDate,
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4057
|
+
jo as WxFilterChips,
|
|
4058
|
+
qo as WxHelpButton,
|
|
4059
|
+
sn as WxHistory,
|
|
4060
|
+
Wa as WxLinkField,
|
|
4061
|
+
Aa as WxLinkPicker,
|
|
4009
4062
|
Pt as WxListScreen,
|
|
4010
|
-
|
|
4063
|
+
Yo as WxNotes,
|
|
4011
4064
|
Nt as WxRelationsField,
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4065
|
+
Ko as WxRenameButton,
|
|
4066
|
+
gn as WxRichTextField,
|
|
4067
|
+
it as WxRowMenu,
|
|
4068
|
+
co as WxSaveState,
|
|
4069
|
+
mo as WxScreen,
|
|
4017
4070
|
Ot as WxScreenHead,
|
|
4018
|
-
|
|
4071
|
+
wt as WxSlugField,
|
|
4072
|
+
Bl as WxSourceSelect,
|
|
4019
4073
|
Dt as adminKey,
|
|
4020
4074
|
Rt as adminMessages,
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4075
|
+
$n as adminTypes,
|
|
4076
|
+
Kt as categoryEditorKey,
|
|
4077
|
+
Fo as categoryRoutes,
|
|
4078
|
+
ta as collectionSources,
|
|
4079
|
+
Mo as createAdmin,
|
|
4080
|
+
Sn as createAdminContext,
|
|
4081
|
+
_e as createCategoriesApi,
|
|
4082
|
+
La as createDates,
|
|
4083
|
+
Ua as createHistoryApi,
|
|
4084
|
+
Fl as createHttp,
|
|
4085
|
+
st as createI18n,
|
|
4086
|
+
wa as createLinksApi,
|
|
4087
|
+
Qn as createNotesApi,
|
|
4088
|
+
jl as createRelationsApi,
|
|
4089
|
+
Dn as createTheme,
|
|
4090
|
+
yt as defaultMarkup,
|
|
4091
|
+
ba as emptyLink,
|
|
4092
|
+
Va as errorText,
|
|
4093
|
+
eo as forgetUnfinishedUpload,
|
|
4039
4094
|
Mt as historySubjectKey,
|
|
4040
4095
|
je as historyValue,
|
|
4041
4096
|
Be as i18nKey,
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4097
|
+
no as itemOrderMode,
|
|
4098
|
+
ht as normaliseCollection,
|
|
4099
|
+
Kl as normaliseRelations,
|
|
4100
|
+
Tn as provideAdmin,
|
|
4101
|
+
ao as provideCategoryEditor,
|
|
4102
|
+
Ra as provideHistorySubject,
|
|
4047
4103
|
El as provideI18n,
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4104
|
+
bn as provideRecordAddress,
|
|
4105
|
+
Ro as provideRelationOwner,
|
|
4106
|
+
Bn as provideTheme,
|
|
4107
|
+
pt as readCookie,
|
|
4052
4108
|
Bt as recordAddressKey,
|
|
4053
4109
|
Vt as relationOwnerKey,
|
|
4054
|
-
|
|
4110
|
+
Jn as renderMarkdown,
|
|
4055
4111
|
Rl as reorderItems,
|
|
4056
|
-
|
|
4112
|
+
Ho as rowMenuWidth,
|
|
4057
4113
|
Ft as themeKey,
|
|
4058
|
-
|
|
4114
|
+
Oo as unfinishedUploads,
|
|
4059
4115
|
qe as uploadFingerprint,
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4116
|
+
te as useAdmin,
|
|
4117
|
+
Gn as useBodyKeys,
|
|
4118
|
+
Bo as useCategoryEditor,
|
|
4119
|
+
dt as useCategoryWords,
|
|
4120
|
+
Po as useChunkedUpload,
|
|
4065
4121
|
It as useDates,
|
|
4066
4122
|
De as useErrorText,
|
|
4067
|
-
|
|
4123
|
+
Ia as useHistorySubject,
|
|
4068
4124
|
Nl as useI18n,
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4125
|
+
Do as useItemOrder,
|
|
4126
|
+
wn as useRecordAddress,
|
|
4127
|
+
ql as useRelationOwner,
|
|
4128
|
+
Io as useTheme,
|
|
4073
4129
|
J as useTranslate
|
|
4074
4130
|
};
|
|
4075
4131
|
//# sourceMappingURL=index.js.map
|