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