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