@webx-ui/module-admin 0.9.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AdminNav.d.ts +3 -0
- package/dist/BackButton.d.ts +1 -1
- package/dist/DateText.d.ts +6 -0
- package/dist/FilterChips.d.ts +18 -0
- package/dist/HelpButton.d.ts +2 -2
- package/dist/ListScreen.d.ts +29 -6
- package/dist/RenameButton.d.ts +5 -5
- package/dist/RowMenu.d.ts +1 -15
- package/dist/SaveState.d.ts +27 -0
- package/dist/ScreenHead.d.ts +112 -0
- package/dist/dates.d.ts +9 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +932 -718
- package/dist/index.js.map +1 -1
- package/dist/rowMenu.d.ts +13 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +44 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,17 +1,275 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { WxHeading as
|
|
4
|
-
import { WxScreenRenderer as
|
|
5
|
-
const
|
|
1
|
+
import { inject as te, reactive as oe, defineComponent as R, computed as x, openBlock as h, createBlock as w, unref as i, withModifiers as pe, withCtx as g, createElementBlock as k, Fragment as I, renderList as P, createCommentVNode as z, createVNode as _, createTextVNode as W, toDisplayString as C, useSlots as Le, useTemplateRef as ze, normalizeClass as H, renderSlot as L, createElementVNode as M, createSlots as ge, useModel as be, mergeModels as ie, mergeProps as We, watch as Y, resolveComponent as U, ref as A, watchEffect as Ae, onUnmounted as Re, isRef as Ee, createApp as Ue, h as G, onBeforeUnmount as Be, nextTick as Ie, withKeys as Me } from "vue";
|
|
2
|
+
import { RouterLink as De, useRouter as we, useRoute as Ne, createRouter as Pe, createWebHistory as Ve } from "vue-router";
|
|
3
|
+
import { WxAction as K, WxActions as Fe, WxDropdownItem as He, useElementWidth as Oe, WxHeading as je, WxText as q, WxButton as j, WxIcon as ye, WxTabs as qe, WxCard as me, WxRichText as Ye, WxResult as Ke, useResponsiveShell as Xe, shellLayoutFor as Ge, WxToaster as Je, WebxUI as Qe, dateLocaleKey as Ze, localesKey as et, WxAlert as tt, WxSkeleton as xe, WxBadge as nt, WxPopover as at, WxInput as lt, WxDialog as st, WxTooltip as ot, WxEmpty as it, WxAvatar as rt, WxTextarea as fe, toast as F, confirm as ut } from "@webx-ui/core";
|
|
4
|
+
import { WxScreenRenderer as dt } from "@webx-ui/schema";
|
|
5
|
+
const ne = /* @__PURE__ */ Symbol("webx-i18n");
|
|
6
|
+
function Ln() {
|
|
7
|
+
const e = te(ne, null);
|
|
8
|
+
if (e === null)
|
|
9
|
+
throw new Error("useI18n() was called outside a panel created by createAdmin().");
|
|
10
|
+
return e;
|
|
11
|
+
}
|
|
12
|
+
function B(e) {
|
|
13
|
+
const n = te(ne, null);
|
|
14
|
+
return n === null ? de().scope(e) : n.scope(e);
|
|
15
|
+
}
|
|
16
|
+
function ct(e, n) {
|
|
17
|
+
e.provide(ne, n);
|
|
18
|
+
}
|
|
19
|
+
function de(e = {}) {
|
|
20
|
+
const n = e.fallback ?? "en", t = oe({
|
|
21
|
+
locale: e.locale ?? n,
|
|
22
|
+
fallback: n,
|
|
23
|
+
panelLocales: [],
|
|
24
|
+
contentLocales: []
|
|
25
|
+
}), a = {}, u = oe({ value: {} });
|
|
26
|
+
function s(o, r, m) {
|
|
27
|
+
let v = o[r]?.[m[0] ?? ""];
|
|
28
|
+
for (const f of m.slice(1)) {
|
|
29
|
+
if (typeof v != "object" || v === null)
|
|
30
|
+
return null;
|
|
31
|
+
v = v[f];
|
|
32
|
+
}
|
|
33
|
+
return typeof v == "string" ? v : null;
|
|
34
|
+
}
|
|
35
|
+
function l(o, r, m) {
|
|
36
|
+
const [v, f] = r.includes("::") ? r.split("::", 2) : [o, r], d = f.split("."), p = s(u.value, v, d) ?? s(a, v, d) ?? // Not an empty string: a key on screen is ugly, but it says which key, and a blank
|
|
37
|
+
// label says nothing to anybody trying to fix it.
|
|
38
|
+
r;
|
|
39
|
+
return m === void 0 ? p : mt(p, m);
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
state: t,
|
|
43
|
+
defaults(o, r) {
|
|
44
|
+
a[o] = { ...a[o], ...r };
|
|
45
|
+
},
|
|
46
|
+
load(o, r, m) {
|
|
47
|
+
u.value = o ?? {}, t.locale = r ?? t.locale, m !== void 0 && (t.fallback = m);
|
|
48
|
+
},
|
|
49
|
+
scope(o) {
|
|
50
|
+
return (r, m) => l(o, r, m);
|
|
51
|
+
},
|
|
52
|
+
t: (o, r) => l("", o, r)
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function mt(e, n) {
|
|
56
|
+
let t = e;
|
|
57
|
+
for (const [a, u] of Object.entries(n))
|
|
58
|
+
t = t.replaceAll(`:${a}`, String(u));
|
|
59
|
+
return t;
|
|
60
|
+
}
|
|
61
|
+
const ft = /* @__PURE__ */ R({
|
|
62
|
+
__name: "BackButton",
|
|
63
|
+
props: {
|
|
64
|
+
to: {},
|
|
65
|
+
label: { default: void 0 },
|
|
66
|
+
size: { default: "sm" }
|
|
67
|
+
},
|
|
68
|
+
setup(e) {
|
|
69
|
+
const n = e, t = B("webx-admin"), a = x(() => n.label ?? t("editor.back"));
|
|
70
|
+
return (u, s) => (h(), w(i(K), {
|
|
71
|
+
icon: "arrow-left",
|
|
72
|
+
class: "wx-back-button",
|
|
73
|
+
as: i(De),
|
|
74
|
+
to: e.to,
|
|
75
|
+
title: a.value,
|
|
76
|
+
size: e.size,
|
|
77
|
+
"tooltip-side": "bottom"
|
|
78
|
+
}, null, 8, ["as", "to", "title", "size"]));
|
|
79
|
+
}
|
|
80
|
+
}), vt = {
|
|
6
81
|
key: 0,
|
|
7
|
-
class: "wx-
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
82
|
+
class: "wx-dropdown__divider"
|
|
83
|
+
}, ht = /* @__PURE__ */ R({
|
|
84
|
+
__name: "RowMenu",
|
|
85
|
+
props: {
|
|
86
|
+
actions: {},
|
|
87
|
+
label: { default: void 0 },
|
|
88
|
+
size: { default: "sm" }
|
|
89
|
+
},
|
|
90
|
+
setup(e) {
|
|
91
|
+
const n = B("webx-admin"), t = e, a = x(() => [
|
|
92
|
+
...t.actions.filter((s) => !s.danger),
|
|
93
|
+
...t.actions.filter((s) => s.danger)
|
|
94
|
+
]), u = x(() => {
|
|
95
|
+
const s = a.value.find((l) => l.danger);
|
|
96
|
+
return s && a.value[0] !== s ? s.key : null;
|
|
97
|
+
});
|
|
98
|
+
return (s, l) => a.value.length > 0 ? (h(), w(i(Fe), {
|
|
99
|
+
key: 0,
|
|
100
|
+
class: "wx-row-menu",
|
|
101
|
+
collapse: "always",
|
|
102
|
+
align: "end",
|
|
103
|
+
size: e.size,
|
|
104
|
+
"aria-label": e.label,
|
|
105
|
+
onClick: l[0] || (l[0] = pe(() => {
|
|
106
|
+
}, ["stop"]))
|
|
107
|
+
}, {
|
|
108
|
+
trigger: g(() => [
|
|
109
|
+
_(i(K), {
|
|
110
|
+
type: "more",
|
|
111
|
+
size: e.size,
|
|
112
|
+
title: i(n)("editor.more")
|
|
113
|
+
}, null, 8, ["size", "title"])
|
|
114
|
+
]),
|
|
115
|
+
collapsed: g(() => [
|
|
116
|
+
(h(!0), k(I, null, P(a.value, (o) => (h(), k(I, {
|
|
117
|
+
key: o.key
|
|
118
|
+
}, [
|
|
119
|
+
o.key === u.value ? (h(), k("hr", vt)) : z("", !0),
|
|
120
|
+
_(i(He), {
|
|
121
|
+
icon: o.icon,
|
|
122
|
+
tone: o.danger ? "danger" : "default",
|
|
123
|
+
href: o.href,
|
|
124
|
+
target: o.href ? o.target ?? "_blank" : void 0,
|
|
125
|
+
disabled: o.disabled,
|
|
126
|
+
onClick: (r) => o.run?.()
|
|
127
|
+
}, {
|
|
128
|
+
default: g(() => [
|
|
129
|
+
W(C(o.label), 1)
|
|
130
|
+
]),
|
|
131
|
+
_: 2
|
|
132
|
+
}, 1032, ["icon", "tone", "href", "target", "disabled", "onClick"])
|
|
133
|
+
], 64))), 128))
|
|
134
|
+
]),
|
|
135
|
+
_: 1
|
|
136
|
+
}, 8, ["size", "aria-label"])) : z("", !0);
|
|
137
|
+
}
|
|
138
|
+
}), N = (e, n) => {
|
|
139
|
+
const t = e.__vccOpts || e;
|
|
140
|
+
for (const [a, u] of n)
|
|
141
|
+
t[a] = u;
|
|
142
|
+
return t;
|
|
143
|
+
}, ke = /* @__PURE__ */ N(ht, [["__scopeId", "data-v-cab01f7f"]]), pt = ["data-level"], gt = {
|
|
144
|
+
key: 0,
|
|
145
|
+
class: "wx-screen-head__trail"
|
|
146
|
+
}, bt = { class: "wx-screen-head__name" }, wt = {
|
|
147
|
+
key: 4,
|
|
148
|
+
class: "wx-screen-head__actions"
|
|
149
|
+
}, yt = /* @__PURE__ */ R({
|
|
150
|
+
__name: "ScreenHead",
|
|
151
|
+
props: {
|
|
152
|
+
title: { default: void 0 },
|
|
153
|
+
subtitle: { default: void 0 },
|
|
154
|
+
back: { type: Boolean, default: void 0 },
|
|
155
|
+
backLabel: { default: void 0 },
|
|
156
|
+
level: { default: 2 },
|
|
157
|
+
actions: { default: void 0 },
|
|
158
|
+
collapseBelow: { default: 720 },
|
|
159
|
+
divider: { type: Boolean, default: !1 }
|
|
160
|
+
},
|
|
161
|
+
emits: ["back"],
|
|
162
|
+
setup(e, { emit: n }) {
|
|
163
|
+
const t = e, a = n, u = B("webx-admin"), s = Le(), l = ze("root"), o = Oe(l), r = x(() => o.value > 0 && o.value < t.collapseBelow), m = x(() => t.actions ?? []), v = x(
|
|
164
|
+
() => m.value.find((c) => c.primary) ?? null
|
|
165
|
+
), f = x(() => r.value ? v.value ? [v.value] : [] : m.value.filter((c) => !c.menu && !c.danger)), d = x(() => r.value ? m.value.filter((c) => c !== v.value) : m.value.filter((c) => c.menu || c.danger)), p = x(
|
|
166
|
+
() => t.back && t.back !== !0 ? t.back : null
|
|
167
|
+
), b = x(
|
|
168
|
+
() => f.value.length > 0 || d.value.length > 0 || !!s.extra
|
|
169
|
+
);
|
|
170
|
+
return (c, y) => (h(), k("div", {
|
|
171
|
+
ref_key: "root",
|
|
172
|
+
ref: l,
|
|
173
|
+
class: H(["wx-screen-head", {
|
|
174
|
+
"is-narrow": r.value,
|
|
175
|
+
"has-button": f.value.length > 0,
|
|
176
|
+
"has-trail": !!c.$slots.trail,
|
|
177
|
+
"has-divider": e.divider
|
|
178
|
+
}]),
|
|
179
|
+
"data-level": e.level
|
|
180
|
+
}, [
|
|
181
|
+
c.$slots.trail ? (h(), k("div", gt, [
|
|
182
|
+
L(c.$slots, "trail", {}, void 0, !0)
|
|
183
|
+
])) : z("", !0),
|
|
184
|
+
p.value ? (h(), w(ft, {
|
|
185
|
+
key: 1,
|
|
186
|
+
class: "wx-screen-head__back",
|
|
187
|
+
to: p.value,
|
|
188
|
+
label: e.backLabel,
|
|
189
|
+
"tooltip-side": "bottom"
|
|
190
|
+
}, null, 8, ["to", "label"])) : e.back ? (h(), w(i(K), {
|
|
191
|
+
key: 2,
|
|
192
|
+
class: "wx-screen-head__back",
|
|
193
|
+
icon: "arrow-left",
|
|
194
|
+
size: "sm",
|
|
195
|
+
"tooltip-side": "bottom",
|
|
196
|
+
title: e.backLabel ?? i(u)("editor.back"),
|
|
197
|
+
onClick: y[0] || (y[0] = ($) => a("back"))
|
|
198
|
+
}, null, 8, ["title"])) : z("", !0),
|
|
199
|
+
M("div", bt, [
|
|
200
|
+
e.title ? (h(), w(i(je), {
|
|
201
|
+
key: 0,
|
|
202
|
+
level: e.level,
|
|
203
|
+
truncate: "",
|
|
204
|
+
class: "wx-screen-head__title"
|
|
205
|
+
}, {
|
|
206
|
+
default: g(() => [
|
|
207
|
+
W(C(e.title), 1)
|
|
208
|
+
]),
|
|
209
|
+
_: 1
|
|
210
|
+
}, 8, ["level"])) : z("", !0),
|
|
211
|
+
L(c.$slots, "title-after", {}, void 0, !0)
|
|
212
|
+
]),
|
|
213
|
+
e.subtitle || c.$slots.subtitle ? (h(), w(i(q), {
|
|
214
|
+
key: 3,
|
|
215
|
+
class: "wx-screen-head__subtitle",
|
|
216
|
+
size: "sm",
|
|
217
|
+
tone: "muted",
|
|
218
|
+
truncate: ""
|
|
219
|
+
}, {
|
|
220
|
+
default: g(() => [
|
|
221
|
+
L(c.$slots, "subtitle", {}, () => [
|
|
222
|
+
W(C(e.subtitle), 1)
|
|
223
|
+
], !0)
|
|
224
|
+
]),
|
|
225
|
+
_: 3
|
|
226
|
+
})) : z("", !0),
|
|
227
|
+
b.value ? (h(), k("div", wt, [
|
|
228
|
+
L(c.$slots, "extra", {}, void 0, !0),
|
|
229
|
+
(h(!0), k(I, null, P(f.value, ($) => (h(), w(i(j), {
|
|
230
|
+
key: $.key,
|
|
231
|
+
class: H(["wx-screen-head__button", { "is-primary": $.primary }]),
|
|
232
|
+
type: $.primary ? "primary" : "default",
|
|
233
|
+
variant: $.primary ? "solid" : $.variant ?? "outline",
|
|
234
|
+
loading: $.loading,
|
|
235
|
+
disabled: $.disabled,
|
|
236
|
+
href: $.href,
|
|
237
|
+
target: $.href ? $.target ?? "_blank" : void 0,
|
|
238
|
+
rel: $.href ? "noopener" : void 0,
|
|
239
|
+
onClick: (X) => $.run?.()
|
|
240
|
+
}, ge({
|
|
241
|
+
default: g(() => [
|
|
242
|
+
W(" " + C($.label), 1)
|
|
243
|
+
]),
|
|
244
|
+
_: 2
|
|
245
|
+
}, [
|
|
246
|
+
$.icon ? {
|
|
247
|
+
name: "icon",
|
|
248
|
+
fn: g(() => [
|
|
249
|
+
_(i(ye), {
|
|
250
|
+
name: $.icon
|
|
251
|
+
}, null, 8, ["name"])
|
|
252
|
+
]),
|
|
253
|
+
key: "0"
|
|
254
|
+
} : void 0
|
|
255
|
+
]), 1032, ["class", "type", "variant", "loading", "disabled", "href", "target", "rel", "onClick"]))), 128)),
|
|
256
|
+
d.value.length > 0 ? (h(), w(ke, {
|
|
257
|
+
key: 0,
|
|
258
|
+
actions: d.value,
|
|
259
|
+
size: "lg",
|
|
260
|
+
label: e.title ?? i(u)("editor.more")
|
|
261
|
+
}, null, 8, ["actions", "label"])) : z("", !0)
|
|
262
|
+
])) : z("", !0)
|
|
263
|
+
], 10, pt));
|
|
264
|
+
}
|
|
265
|
+
}), xt = /* @__PURE__ */ N(yt, [["__scopeId", "data-v-e27d184e"]]), kt = ["data-wx-fill"], _t = /* @__PURE__ */ R({
|
|
12
266
|
__name: "ListScreen",
|
|
13
|
-
props: /* @__PURE__ */
|
|
267
|
+
props: /* @__PURE__ */ ie({
|
|
14
268
|
title: { default: void 0 },
|
|
269
|
+
subtitle: { default: void 0 },
|
|
270
|
+
back: { default: void 0 },
|
|
271
|
+
backLabel: { default: void 0 },
|
|
272
|
+
actions: { default: void 0 },
|
|
15
273
|
views: { default: void 0 },
|
|
16
274
|
card: { type: Boolean, default: !0 },
|
|
17
275
|
padding: { default: void 0 },
|
|
@@ -23,129 +281,71 @@ const tt = ["data-wx-fill"], nt = {
|
|
|
23
281
|
}),
|
|
24
282
|
emits: ["update:view"],
|
|
25
283
|
setup(e) {
|
|
26
|
-
const n =
|
|
27
|
-
return (t, a) => (
|
|
28
|
-
class:
|
|
284
|
+
const n = be(e, "view");
|
|
285
|
+
return (t, a) => (h(), k("div", {
|
|
286
|
+
class: H(["wx-list-screen", { "is-fill": e.fill }]),
|
|
29
287
|
"data-wx-fill": e.fill ? "" : void 0
|
|
30
288
|
}, [
|
|
31
|
-
e.title || t.$slots.actions ? (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
289
|
+
e.title || e.actions || t.$slots.actions ? (h(), w(xt, {
|
|
290
|
+
key: 0,
|
|
291
|
+
class: "wx-list-screen__head",
|
|
292
|
+
title: e.title,
|
|
293
|
+
subtitle: e.subtitle,
|
|
294
|
+
back: e.back,
|
|
295
|
+
"back-label": e.backLabel,
|
|
296
|
+
actions: e.actions,
|
|
297
|
+
"collapse-below": 480
|
|
298
|
+
}, ge({ _: 2 }, [
|
|
299
|
+
t.$slots.actions ? {
|
|
300
|
+
name: "extra",
|
|
301
|
+
fn: g(() => [
|
|
302
|
+
L(t.$slots, "actions", {}, void 0, !0)
|
|
39
303
|
]),
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
])) : E("", !0)
|
|
45
|
-
])) : E("", !0),
|
|
46
|
-
e.views && e.views.length > 0 ? (p(), _(r(De), {
|
|
304
|
+
key: "0"
|
|
305
|
+
} : void 0
|
|
306
|
+
]), 1032, ["title", "subtitle", "back", "back-label", "actions"])) : z("", !0),
|
|
307
|
+
e.views && e.views.length > 0 ? (h(), w(i(qe), {
|
|
47
308
|
key: 1,
|
|
48
309
|
modelValue: n.value,
|
|
49
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
310
|
+
"onUpdate:modelValue": a[0] || (a[0] = (u) => n.value = u),
|
|
50
311
|
class: "wx-list-screen__views",
|
|
51
312
|
items: e.views,
|
|
52
313
|
"collapse-below": e.collapseBelow,
|
|
53
314
|
"aria-label": e.title
|
|
54
315
|
}, {
|
|
55
316
|
default: g(() => [
|
|
56
|
-
e.card ? (
|
|
317
|
+
e.card ? (h(), w(i(me), {
|
|
57
318
|
key: 0,
|
|
58
319
|
class: "wx-list-screen__card",
|
|
59
320
|
padding: e.padding
|
|
60
321
|
}, {
|
|
61
322
|
default: g(() => [
|
|
62
|
-
|
|
323
|
+
L(t.$slots, "default", {}, void 0, !0)
|
|
63
324
|
]),
|
|
64
325
|
_: 3
|
|
65
|
-
}, 8, ["padding"])) :
|
|
326
|
+
}, 8, ["padding"])) : L(t.$slots, "default", {}, void 0, !0, 1)
|
|
66
327
|
]),
|
|
67
328
|
_: 3
|
|
68
|
-
}, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (
|
|
69
|
-
e.card ? (
|
|
329
|
+
}, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (h(), k(I, { key: 2 }, [
|
|
330
|
+
e.card ? (h(), w(i(me), {
|
|
70
331
|
key: 0,
|
|
71
332
|
class: "wx-list-screen__card",
|
|
72
333
|
padding: e.padding
|
|
73
334
|
}, {
|
|
74
335
|
default: g(() => [
|
|
75
|
-
|
|
336
|
+
L(t.$slots, "default", {}, void 0, !0)
|
|
76
337
|
]),
|
|
77
338
|
_: 3
|
|
78
|
-
}, 8, ["padding"])) :
|
|
339
|
+
}, 8, ["padding"])) : L(t.$slots, "default", {}, void 0, !0, 1)
|
|
79
340
|
], 64))
|
|
80
|
-
], 10,
|
|
81
|
-
}
|
|
82
|
-
}), V = (e, n) => {
|
|
83
|
-
const t = e.__vccOpts || e;
|
|
84
|
-
for (const [a, i] of n)
|
|
85
|
-
t[a] = i;
|
|
86
|
-
return t;
|
|
87
|
-
}, ot = /* @__PURE__ */ V(lt, [["__scopeId", "data-v-7586ed04"]]), Q = /* @__PURE__ */ Symbol("webx-i18n");
|
|
88
|
-
function fn() {
|
|
89
|
-
const e = G(Q, null);
|
|
90
|
-
if (e === null)
|
|
91
|
-
throw new Error("useI18n() was called outside a panel created by createAdmin().");
|
|
92
|
-
return e;
|
|
93
|
-
}
|
|
94
|
-
function I(e) {
|
|
95
|
-
const n = G(Q, null);
|
|
96
|
-
return n === null ? ue().scope(e) : n.scope(e);
|
|
97
|
-
}
|
|
98
|
-
function st(e, n) {
|
|
99
|
-
e.provide(Q, n);
|
|
100
|
-
}
|
|
101
|
-
function ue(e = {}) {
|
|
102
|
-
const n = e.fallback ?? "en", t = se({
|
|
103
|
-
locale: e.locale ?? n,
|
|
104
|
-
fallback: n,
|
|
105
|
-
panelLocales: [],
|
|
106
|
-
contentLocales: []
|
|
107
|
-
}), a = {}, i = se({ value: {} });
|
|
108
|
-
function o(d, s, c) {
|
|
109
|
-
let f = d[s]?.[c[0] ?? ""];
|
|
110
|
-
for (const m of c.slice(1)) {
|
|
111
|
-
if (typeof f != "object" || f === null)
|
|
112
|
-
return null;
|
|
113
|
-
f = f[m];
|
|
114
|
-
}
|
|
115
|
-
return typeof f == "string" ? f : null;
|
|
341
|
+
], 10, kt));
|
|
116
342
|
}
|
|
117
|
-
|
|
118
|
-
const [f, m] = s.includes("::") ? s.split("::", 2) : [d, s], u = m.split("."), v = o(i.value, f, u) ?? o(a, f, u) ?? // Not an empty string: a key on screen is ugly, but it says which key, and a blank
|
|
119
|
-
// label says nothing to anybody trying to fix it.
|
|
120
|
-
s;
|
|
121
|
-
return c === void 0 ? v : it(v, c);
|
|
122
|
-
}
|
|
123
|
-
return {
|
|
124
|
-
state: t,
|
|
125
|
-
defaults(d, s) {
|
|
126
|
-
a[d] = { ...a[d], ...s };
|
|
127
|
-
},
|
|
128
|
-
load(d, s, c) {
|
|
129
|
-
i.value = d ?? {}, t.locale = s ?? t.locale, c !== void 0 && (t.fallback = c);
|
|
130
|
-
},
|
|
131
|
-
scope(d) {
|
|
132
|
-
return (s, c) => l(d, s, c);
|
|
133
|
-
},
|
|
134
|
-
t: (d, s) => l("", d, s)
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
function it(e, n) {
|
|
138
|
-
let t = e;
|
|
139
|
-
for (const [a, i] of Object.entries(n))
|
|
140
|
-
t = t.replaceAll(`:${a}`, String(i));
|
|
141
|
-
return t;
|
|
142
|
-
}
|
|
143
|
-
const rt = /* @__PURE__ */ W({
|
|
343
|
+
}), $t = /* @__PURE__ */ N(_t, [["__scopeId", "data-v-8c7e5ad1"]]), St = /* @__PURE__ */ R({
|
|
144
344
|
name: "WxRichTextField",
|
|
145
345
|
inheritAttrs: !1,
|
|
146
346
|
__name: "RichTextField",
|
|
147
347
|
setup(e) {
|
|
148
|
-
const n =
|
|
348
|
+
const n = O(), t = B("webx-admin"), a = x(() => n.pickImage ?? void 0), u = x(() => ({
|
|
149
349
|
bold: t("rich-text.bold"),
|
|
150
350
|
italic: t("rich-text.italic"),
|
|
151
351
|
strike: t("rich-text.strike"),
|
|
@@ -178,107 +378,108 @@ const rt = /* @__PURE__ */ W({
|
|
|
178
378
|
cancel: t("rich-text.cancel"),
|
|
179
379
|
uploading: t("rich-text.uploading")
|
|
180
380
|
}));
|
|
181
|
-
return (
|
|
182
|
-
labels:
|
|
381
|
+
return (s, l) => (h(), w(i(Ye), We(s.$attrs, {
|
|
382
|
+
labels: u.value,
|
|
183
383
|
"pick-image": a.value
|
|
184
384
|
}), null, 16, ["labels", "pick-image"]));
|
|
185
385
|
}
|
|
186
|
-
}),
|
|
187
|
-
"wx-list": { component:
|
|
386
|
+
}), Tt = {
|
|
387
|
+
"wx-list": { component: $t, kind: "layout", labelProp: "title" },
|
|
188
388
|
// Full width: an editor shares a row with nothing, and a form of two columns would give it
|
|
189
389
|
// half a line to write a page of text in.
|
|
190
|
-
"wx-rich-text": { component:
|
|
191
|
-
},
|
|
192
|
-
function
|
|
193
|
-
const e =
|
|
390
|
+
"wx-rich-text": { component: St, kind: "field", wide: !0 }
|
|
391
|
+
}, _e = /* @__PURE__ */ Symbol("webx-admin");
|
|
392
|
+
function O() {
|
|
393
|
+
const e = te(_e, null);
|
|
194
394
|
if (e === null)
|
|
195
395
|
throw new Error("useAdmin() was called outside a panel created by createAdmin().");
|
|
196
396
|
return e;
|
|
197
397
|
}
|
|
198
|
-
function
|
|
199
|
-
const n =
|
|
398
|
+
function Ct(e) {
|
|
399
|
+
const n = oe({
|
|
200
400
|
status: "loading",
|
|
201
401
|
manifest: null,
|
|
202
402
|
user: null,
|
|
203
403
|
error: null
|
|
204
|
-
}), t =
|
|
205
|
-
const
|
|
206
|
-
if (
|
|
404
|
+
}), t = x(() => {
|
|
405
|
+
const d = n.manifest;
|
|
406
|
+
if (d === null)
|
|
207
407
|
return [];
|
|
208
|
-
const
|
|
209
|
-
for (const
|
|
210
|
-
const
|
|
211
|
-
if (
|
|
408
|
+
const p = [];
|
|
409
|
+
for (const b of d.modules) {
|
|
410
|
+
const c = e.modules.find(($) => $.id === b.id);
|
|
411
|
+
if (c === void 0)
|
|
212
412
|
continue;
|
|
213
|
-
const y =
|
|
214
|
-
y !== void 0 &&
|
|
215
|
-
id:
|
|
216
|
-
title:
|
|
217
|
-
icon:
|
|
413
|
+
const y = c.path ?? c.routes?.[0]?.path;
|
|
414
|
+
y !== void 0 && p.push({
|
|
415
|
+
id: b.id,
|
|
416
|
+
title: b.title,
|
|
417
|
+
icon: b.icon,
|
|
218
418
|
path: y,
|
|
219
|
-
group:
|
|
419
|
+
group: b.group ?? null
|
|
220
420
|
});
|
|
221
421
|
}
|
|
222
|
-
return
|
|
223
|
-
}), a =
|
|
224
|
-
const
|
|
225
|
-
for (const
|
|
226
|
-
if (
|
|
227
|
-
const y =
|
|
228
|
-
y.push(
|
|
422
|
+
return p;
|
|
423
|
+
}), a = x(() => {
|
|
424
|
+
const d = n.manifest?.groups ?? [], p = [], b = /* @__PURE__ */ new Map();
|
|
425
|
+
for (const c of t.value)
|
|
426
|
+
if (c.group !== null && d.some((y) => y.id === c.group)) {
|
|
427
|
+
const y = b.get(c.group) ?? [];
|
|
428
|
+
y.push(c), b.set(c.group, y);
|
|
229
429
|
} else
|
|
230
|
-
|
|
430
|
+
p.push(c);
|
|
231
431
|
return {
|
|
232
|
-
top:
|
|
233
|
-
groups:
|
|
234
|
-
id:
|
|
235
|
-
title:
|
|
236
|
-
|
|
432
|
+
top: p,
|
|
433
|
+
groups: d.filter((c) => b.has(c.id)).map((c) => ({
|
|
434
|
+
id: c.id,
|
|
435
|
+
title: c.title,
|
|
436
|
+
icon: c.icon ?? null,
|
|
437
|
+
entries: b.get(c.id) ?? []
|
|
237
438
|
}))
|
|
238
439
|
};
|
|
239
|
-
}),
|
|
240
|
-
for (const
|
|
241
|
-
Object.assign(
|
|
242
|
-
Object.assign(
|
|
243
|
-
const
|
|
244
|
-
async function d
|
|
245
|
-
const
|
|
246
|
-
let
|
|
247
|
-
return
|
|
248
|
-
throw l.delete(
|
|
249
|
-
}), l.set(
|
|
440
|
+
}), u = { ...Tt };
|
|
441
|
+
for (const d of e.modules)
|
|
442
|
+
Object.assign(u, d.types);
|
|
443
|
+
Object.assign(u, e.types);
|
|
444
|
+
const s = e.modules.find((d) => d.pickImage !== void 0)?.pickImage, l = /* @__PURE__ */ new Map();
|
|
445
|
+
async function o(d) {
|
|
446
|
+
const p = `${e.i18n.state.locale}:${d}`;
|
|
447
|
+
let b = l.get(p);
|
|
448
|
+
return b === void 0 && (b = e.http.get(`${e.apiPath}/screens/${d}`).then((c) => c.data.root).catch((c) => {
|
|
449
|
+
throw l.delete(p), c;
|
|
450
|
+
}), l.set(p, b)), b;
|
|
250
451
|
}
|
|
251
|
-
let
|
|
252
|
-
async function
|
|
452
|
+
let r = null;
|
|
453
|
+
async function m() {
|
|
253
454
|
n.status = "loading", n.error = null;
|
|
254
455
|
try {
|
|
255
|
-
if (
|
|
456
|
+
if (r !== null && (n.user = await r(), n.user === null)) {
|
|
256
457
|
n.manifest = null, n.status = "unauthenticated";
|
|
257
458
|
return;
|
|
258
459
|
}
|
|
259
|
-
const
|
|
260
|
-
n.manifest =
|
|
261
|
-
} catch (
|
|
262
|
-
if (
|
|
460
|
+
const d = await e.loadManifest();
|
|
461
|
+
n.manifest = d, e.i18n.state.contentLocales = d.locales ?? [], e.i18n.state.panelLocales = d.panelLocales ?? e.i18n.state.panelLocales, d.locale !== void 0 && d.locale !== e.i18n.state.locale && await f(d.locale), n.status = "ready";
|
|
462
|
+
} catch (d) {
|
|
463
|
+
if (zt(d)) {
|
|
263
464
|
n.manifest = null, n.user = null, n.status = "unauthenticated";
|
|
264
465
|
return;
|
|
265
466
|
}
|
|
266
|
-
n.error =
|
|
467
|
+
n.error = d instanceof Error ? d.message : String(d), n.status = "error";
|
|
267
468
|
}
|
|
268
469
|
}
|
|
269
|
-
async function
|
|
470
|
+
async function v() {
|
|
270
471
|
if (n.manifest !== null)
|
|
271
472
|
try {
|
|
272
473
|
n.manifest = await e.loadManifest();
|
|
273
474
|
} catch {
|
|
274
475
|
}
|
|
275
476
|
}
|
|
276
|
-
async function
|
|
477
|
+
async function f(d) {
|
|
277
478
|
if (e.loadDictionary === void 0) {
|
|
278
|
-
e.i18n.state.locale =
|
|
479
|
+
e.i18n.state.locale = d;
|
|
279
480
|
return;
|
|
280
481
|
}
|
|
281
|
-
await e.loadDictionary(
|
|
482
|
+
await e.loadDictionary(d), await v();
|
|
282
483
|
}
|
|
283
484
|
return {
|
|
284
485
|
http: e.http,
|
|
@@ -289,169 +490,169 @@ function ut(e) {
|
|
|
289
490
|
modules: e.modules,
|
|
290
491
|
nav: t,
|
|
291
492
|
groups: a,
|
|
292
|
-
types:
|
|
293
|
-
pickImage:
|
|
294
|
-
reload:
|
|
295
|
-
refreshManifest:
|
|
296
|
-
setLocale:
|
|
297
|
-
setUser(
|
|
298
|
-
n.user =
|
|
493
|
+
types: u,
|
|
494
|
+
pickImage: s ?? null,
|
|
495
|
+
reload: m,
|
|
496
|
+
refreshManifest: v,
|
|
497
|
+
setLocale: f,
|
|
498
|
+
setUser(d) {
|
|
499
|
+
n.user = d;
|
|
299
500
|
},
|
|
300
|
-
useSessionLoader(
|
|
301
|
-
|
|
501
|
+
useSessionLoader(d) {
|
|
502
|
+
r = d;
|
|
302
503
|
},
|
|
303
|
-
can(
|
|
304
|
-
const
|
|
305
|
-
return
|
|
504
|
+
can(d) {
|
|
505
|
+
const p = n.user;
|
|
506
|
+
return p === null ? !1 : p.isSuper || p.permissions.includes(d);
|
|
306
507
|
},
|
|
307
|
-
loadScreen:
|
|
308
|
-
screenPatch(
|
|
309
|
-
return e.screens?.[
|
|
508
|
+
loadScreen: o,
|
|
509
|
+
screenPatch(d) {
|
|
510
|
+
return e.screens?.[d] ?? [];
|
|
310
511
|
}
|
|
311
512
|
};
|
|
312
513
|
}
|
|
313
|
-
function
|
|
314
|
-
e.provide(
|
|
514
|
+
function Lt(e, n) {
|
|
515
|
+
e.provide(_e, n);
|
|
315
516
|
}
|
|
316
|
-
function
|
|
517
|
+
function zt(e) {
|
|
317
518
|
return typeof e == "object" && e !== null && "status" in e && e.status === 401;
|
|
318
519
|
}
|
|
319
|
-
const
|
|
520
|
+
const Wt = /* @__PURE__ */ R({
|
|
320
521
|
__name: "AdminLanding",
|
|
321
522
|
props: {
|
|
322
523
|
landing: { default: null }
|
|
323
524
|
},
|
|
324
525
|
setup(e) {
|
|
325
|
-
const n = e, t =
|
|
526
|
+
const n = e, t = O(), a = we(), u = B("webx-admin"), s = x(() => {
|
|
326
527
|
const l = t.nav.value;
|
|
327
|
-
return l.length === 0 ? null : ((n.landing === null ? void 0 : l.find((
|
|
528
|
+
return l.length === 0 ? null : ((n.landing === null ? void 0 : l.find((r) => r.path === n.landing)) ?? l[0])?.path ?? null;
|
|
328
529
|
});
|
|
329
|
-
return
|
|
330
|
-
|
|
530
|
+
return Y(
|
|
531
|
+
s,
|
|
331
532
|
(l) => {
|
|
332
533
|
l !== null && a.replace(l);
|
|
333
534
|
},
|
|
334
535
|
{ immediate: !0 }
|
|
335
|
-
), (l,
|
|
536
|
+
), (l, o) => s.value === null && i(t).state.status === "ready" ? (h(), w(i(Ke), {
|
|
336
537
|
key: 0,
|
|
337
538
|
status: "info",
|
|
338
|
-
title:
|
|
339
|
-
description:
|
|
340
|
-
}, null, 8, ["title", "description"])) :
|
|
539
|
+
title: i(u)("shell.empty-title"),
|
|
540
|
+
description: i(u)("shell.empty-description")
|
|
541
|
+
}, null, 8, ["title", "description"])) : z("", !0);
|
|
341
542
|
}
|
|
342
|
-
}),
|
|
543
|
+
}), At = /* @__PURE__ */ R({
|
|
343
544
|
__name: "AdminNav",
|
|
344
545
|
props: {
|
|
345
546
|
collapsed: { type: Boolean }
|
|
346
547
|
},
|
|
347
548
|
emits: ["select"],
|
|
348
549
|
setup(e, { emit: n }) {
|
|
349
|
-
const t = n, a =
|
|
350
|
-
get: () => a.nav.value.find((
|
|
351
|
-
set: (
|
|
352
|
-
const
|
|
353
|
-
|
|
550
|
+
const t = n, a = O(), u = B("webx-admin"), s = we(), l = Ne(), o = x({
|
|
551
|
+
get: () => a.nav.value.find((m) => l.path.startsWith(m.path))?.id ?? "",
|
|
552
|
+
set: (r) => {
|
|
553
|
+
const m = a.nav.value.find((v) => v.id === r);
|
|
554
|
+
m !== void 0 && s.push(m.path);
|
|
354
555
|
}
|
|
355
556
|
});
|
|
356
|
-
return (
|
|
357
|
-
const
|
|
358
|
-
return
|
|
359
|
-
modelValue:
|
|
360
|
-
"onUpdate:modelValue":
|
|
557
|
+
return (r, m) => {
|
|
558
|
+
const v = U("wx-menu-item"), f = U("wx-submenu"), d = U("wx-menu");
|
|
559
|
+
return h(), w(d, {
|
|
560
|
+
modelValue: o.value,
|
|
561
|
+
"onUpdate:modelValue": m[0] || (m[0] = (p) => o.value = p),
|
|
361
562
|
collapsed: e.collapsed,
|
|
362
|
-
label:
|
|
363
|
-
onSelect:
|
|
563
|
+
label: i(u)("nav.sections"),
|
|
564
|
+
onSelect: m[1] || (m[1] = (p) => t("select"))
|
|
364
565
|
}, {
|
|
365
566
|
default: g(() => [
|
|
366
|
-
(
|
|
367
|
-
key:
|
|
368
|
-
value:
|
|
369
|
-
icon:
|
|
370
|
-
label:
|
|
567
|
+
(h(!0), k(I, null, P(i(a).groups.value.top, (p) => (h(), w(v, {
|
|
568
|
+
key: p.id,
|
|
569
|
+
value: p.id,
|
|
570
|
+
icon: p.icon ?? void 0,
|
|
571
|
+
label: p.title
|
|
371
572
|
}, null, 8, ["value", "icon", "label"]))), 128)),
|
|
372
|
-
(
|
|
373
|
-
key:
|
|
374
|
-
value: `group:${
|
|
375
|
-
title:
|
|
376
|
-
icon: "gear"
|
|
573
|
+
(h(!0), k(I, null, P(i(a).groups.value.groups, (p) => (h(), w(f, {
|
|
574
|
+
key: p.id,
|
|
575
|
+
value: `group:${p.id}`,
|
|
576
|
+
title: p.title,
|
|
577
|
+
icon: p.icon ?? "gear"
|
|
377
578
|
}, {
|
|
378
579
|
default: g(() => [
|
|
379
|
-
(
|
|
380
|
-
key:
|
|
381
|
-
value:
|
|
382
|
-
icon:
|
|
383
|
-
label:
|
|
580
|
+
(h(!0), k(I, null, P(p.entries, (b) => (h(), w(v, {
|
|
581
|
+
key: b.id,
|
|
582
|
+
value: b.id,
|
|
583
|
+
icon: b.icon ?? void 0,
|
|
584
|
+
label: b.title
|
|
384
585
|
}, null, 8, ["value", "icon", "label"]))), 128))
|
|
385
586
|
]),
|
|
386
587
|
_: 2
|
|
387
|
-
}, 1032, ["value", "title"]))), 128))
|
|
588
|
+
}, 1032, ["value", "title", "icon"]))), 128))
|
|
388
589
|
]),
|
|
389
590
|
_: 1
|
|
390
591
|
}, 8, ["modelValue", "collapsed", "label"]);
|
|
391
592
|
};
|
|
392
593
|
}
|
|
393
|
-
}),
|
|
594
|
+
}), Rt = {
|
|
394
595
|
key: 0,
|
|
395
596
|
class: "wx-root wx-admin-plain"
|
|
396
|
-
},
|
|
597
|
+
}, Et = {
|
|
397
598
|
key: 1,
|
|
398
599
|
class: "wx-root wx-admin-plain"
|
|
399
|
-
},
|
|
600
|
+
}, Ut = {
|
|
400
601
|
key: 2,
|
|
401
602
|
class: "wx-root wx-admin-plain"
|
|
402
|
-
},
|
|
603
|
+
}, Bt = ["src", "alt", "width", "height"], It = ["src", "alt", "width", "height"], Mt = ["src", "alt"], Dt = { class: "wx-admin__user" }, Nt = { class: "wx-admin__user wx-admin__user--drawer" }, Pt = /* @__PURE__ */ R({
|
|
403
604
|
__name: "AdminShell",
|
|
404
605
|
setup(e) {
|
|
405
|
-
const n =
|
|
606
|
+
const n = O(), t = B("webx-admin"), a = A(null), { width: u, layout: s, collapsed: l, showAside: o, drawerOpen: r, toggle: m, close: v } = Xe(
|
|
406
607
|
a,
|
|
407
608
|
{ persist: "webx-admin-shell" }
|
|
408
|
-
),
|
|
409
|
-
return
|
|
410
|
-
typeof document > "u" || (document.documentElement.dataset.wxShell =
|
|
411
|
-
}),
|
|
609
|
+
), f = x(() => n.state.manifest?.title ?? ""), d = x(() => n.state.manifest?.branding?.logo ?? null), p = x(() => n.state.manifest?.branding?.mark ?? null), b = x(() => Ge(u.value, null));
|
|
610
|
+
return Ae(() => {
|
|
611
|
+
typeof document > "u" || (document.documentElement.dataset.wxShell = b.value);
|
|
612
|
+
}), Re(() => {
|
|
412
613
|
typeof document < "u" && delete document.documentElement.dataset.wxShell;
|
|
413
|
-
}), (
|
|
414
|
-
const
|
|
415
|
-
return
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
])) :
|
|
420
|
-
|
|
421
|
-
label:
|
|
614
|
+
}), (c, y) => {
|
|
615
|
+
const $ = U("router-view"), X = U("wx-loading"), ae = U("wx-button"), le = U("wx-result"), V = U("wx-action"), S = U("wx-text"), E = U("wx-header"), T = U("wx-aside"), D = U("wx-main"), Te = U("wx-container"), Ce = U("wx-drawer");
|
|
616
|
+
return h(), k(I, null, [
|
|
617
|
+
_(i(Je)),
|
|
618
|
+
i(n).state.status === "unauthenticated" ? (h(), k("div", Rt, [
|
|
619
|
+
_($)
|
|
620
|
+
])) : i(n).state.status === "loading" ? (h(), k("div", Et, [
|
|
621
|
+
_(X, {
|
|
622
|
+
label: i(t)("shell.loading")
|
|
422
623
|
}, null, 8, ["label"])
|
|
423
|
-
])) :
|
|
424
|
-
|
|
624
|
+
])) : i(n).state.status === "error" ? (h(), k("div", Ut, [
|
|
625
|
+
_(le, {
|
|
425
626
|
status: "error",
|
|
426
|
-
title:
|
|
427
|
-
description:
|
|
627
|
+
title: i(t)("shell.error-title"),
|
|
628
|
+
description: i(n).state.error
|
|
428
629
|
}, {
|
|
429
630
|
default: g(() => [
|
|
430
|
-
|
|
631
|
+
_(ae, {
|
|
431
632
|
type: "primary",
|
|
432
|
-
onClick: y[0] || (y[0] = (ce) =>
|
|
633
|
+
onClick: y[0] || (y[0] = (ce) => i(n).reload())
|
|
433
634
|
}, {
|
|
434
635
|
default: g(() => [
|
|
435
|
-
|
|
636
|
+
W(C(i(t)("shell.retry")), 1)
|
|
436
637
|
]),
|
|
437
638
|
_: 1
|
|
438
639
|
})
|
|
439
640
|
]),
|
|
440
641
|
_: 1
|
|
441
642
|
}, 8, ["title", "description"])
|
|
442
|
-
])) : (
|
|
643
|
+
])) : (h(), k("div", {
|
|
443
644
|
key: 3,
|
|
444
645
|
ref_key: "shellEl",
|
|
445
646
|
ref: a,
|
|
446
|
-
class:
|
|
647
|
+
class: H(["wx-root wx-admin", `wx-admin--${b.value}`])
|
|
447
648
|
}, [
|
|
448
|
-
|
|
449
|
-
direction:
|
|
649
|
+
_(Te, {
|
|
650
|
+
direction: i(s) === "drawer" ? "vertical" : "horizontal",
|
|
450
651
|
"full-height": "",
|
|
451
652
|
class: "wx-admin__frame"
|
|
452
653
|
}, {
|
|
453
654
|
default: g(() => [
|
|
454
|
-
|
|
655
|
+
i(s) === "drawer" ? (h(), w(E, {
|
|
455
656
|
key: 0,
|
|
456
657
|
class: "wx-admin__header",
|
|
457
658
|
floating: "",
|
|
@@ -461,126 +662,126 @@ const ft = /* @__PURE__ */ W({
|
|
|
461
662
|
height: "var(--wx-admin-header-height)"
|
|
462
663
|
}, {
|
|
463
664
|
end: g(() => [
|
|
464
|
-
|
|
665
|
+
L(c.$slots, "user", { expanded: !1 }, void 0, !0)
|
|
465
666
|
]),
|
|
466
667
|
default: g(() => [
|
|
467
|
-
|
|
668
|
+
_(V, {
|
|
468
669
|
icon: "menu",
|
|
469
|
-
title:
|
|
470
|
-
onClick:
|
|
670
|
+
title: i(t)("nav.menu"),
|
|
671
|
+
onClick: i(m)
|
|
471
672
|
}, null, 8, ["title", "onClick"]),
|
|
472
|
-
|
|
473
|
-
|
|
673
|
+
L(c.$slots, "brand", {}, () => [
|
|
674
|
+
d.value ? (h(), k("img", {
|
|
474
675
|
key: 0,
|
|
475
676
|
class: "wx-admin__logo",
|
|
476
|
-
src:
|
|
477
|
-
alt:
|
|
478
|
-
width:
|
|
479
|
-
height:
|
|
480
|
-
}, null, 8,
|
|
677
|
+
src: d.value.url,
|
|
678
|
+
alt: f.value,
|
|
679
|
+
width: d.value.width ?? void 0,
|
|
680
|
+
height: d.value.height ?? void 0
|
|
681
|
+
}, null, 8, Bt)) : (h(), w(S, {
|
|
481
682
|
key: 1,
|
|
482
683
|
weight: "semibold",
|
|
483
684
|
truncate: ""
|
|
484
685
|
}, {
|
|
485
686
|
default: g(() => [
|
|
486
|
-
|
|
687
|
+
W(C(f.value), 1)
|
|
487
688
|
]),
|
|
488
689
|
_: 1
|
|
489
690
|
}))
|
|
490
691
|
], !0)
|
|
491
692
|
]),
|
|
492
693
|
_: 3
|
|
493
|
-
})) :
|
|
494
|
-
|
|
694
|
+
})) : z("", !0),
|
|
695
|
+
i(o) ? (h(), w(T, {
|
|
495
696
|
key: 1,
|
|
496
697
|
class: "wx-admin__aside",
|
|
497
698
|
sticky: "",
|
|
498
699
|
floating: "",
|
|
499
700
|
scroll: "",
|
|
500
701
|
bordered: !1,
|
|
501
|
-
collapsed:
|
|
702
|
+
collapsed: i(l),
|
|
502
703
|
width: 220,
|
|
503
704
|
"collapsed-width": 56
|
|
504
705
|
}, {
|
|
505
706
|
top: g(() => [
|
|
506
707
|
M("div", {
|
|
507
|
-
class:
|
|
708
|
+
class: H(["wx-admin__brand", { "wx-admin__brand--stacked": i(l) && p.value }])
|
|
508
709
|
}, [
|
|
509
|
-
|
|
710
|
+
i(l) ? p.value ? (h(), k("img", {
|
|
510
711
|
key: 1,
|
|
511
712
|
class: "wx-admin__mark",
|
|
512
|
-
src:
|
|
513
|
-
alt:
|
|
514
|
-
}, null, 8,
|
|
515
|
-
|
|
713
|
+
src: p.value.url,
|
|
714
|
+
alt: f.value
|
|
715
|
+
}, null, 8, Mt)) : z("", !0) : L(c.$slots, "brand", {}, () => [
|
|
716
|
+
d.value ? (h(), k("img", {
|
|
516
717
|
key: 0,
|
|
517
718
|
class: "wx-admin__logo",
|
|
518
|
-
src:
|
|
519
|
-
alt:
|
|
520
|
-
width:
|
|
521
|
-
height:
|
|
522
|
-
}, null, 8,
|
|
719
|
+
src: d.value.url,
|
|
720
|
+
alt: f.value,
|
|
721
|
+
width: d.value.width ?? void 0,
|
|
722
|
+
height: d.value.height ?? void 0
|
|
723
|
+
}, null, 8, It)) : (h(), w(S, {
|
|
523
724
|
key: 1,
|
|
524
725
|
weight: "semibold",
|
|
525
726
|
truncate: "",
|
|
526
727
|
class: "wx-admin__title"
|
|
527
728
|
}, {
|
|
528
729
|
default: g(() => [
|
|
529
|
-
|
|
730
|
+
W(C(f.value), 1)
|
|
530
731
|
]),
|
|
531
732
|
_: 1
|
|
532
733
|
}))
|
|
533
734
|
], !0, 0),
|
|
534
|
-
|
|
735
|
+
_(V, {
|
|
535
736
|
icon: "sidebar",
|
|
536
|
-
title:
|
|
537
|
-
onClick:
|
|
737
|
+
title: i(l) ? i(t)("nav.expand") : i(t)("nav.collapse"),
|
|
738
|
+
onClick: i(m)
|
|
538
739
|
}, null, 8, ["title", "onClick"])
|
|
539
740
|
], 2)
|
|
540
741
|
]),
|
|
541
742
|
bottom: g(() => [
|
|
542
|
-
M("div",
|
|
543
|
-
|
|
544
|
-
expanded: !
|
|
743
|
+
M("div", Dt, [
|
|
744
|
+
L(c.$slots, "user", {
|
|
745
|
+
expanded: !i(l)
|
|
545
746
|
}, void 0, !0)
|
|
546
747
|
])
|
|
547
748
|
]),
|
|
548
749
|
default: g(() => [
|
|
549
|
-
|
|
750
|
+
L(c.$slots, "nav", { collapsed: i(l) }, void 0, !0)
|
|
550
751
|
]),
|
|
551
752
|
_: 3
|
|
552
|
-
}, 8, ["collapsed"])) :
|
|
553
|
-
|
|
753
|
+
}, 8, ["collapsed"])) : z("", !0),
|
|
754
|
+
_(D, {
|
|
554
755
|
padding: "none",
|
|
555
756
|
class: "wx-admin__screen"
|
|
556
757
|
}, {
|
|
557
758
|
default: g(() => [
|
|
558
|
-
|
|
759
|
+
_($)
|
|
559
760
|
]),
|
|
560
761
|
_: 1
|
|
561
762
|
})
|
|
562
763
|
]),
|
|
563
764
|
_: 3
|
|
564
765
|
}, 8, ["direction"]),
|
|
565
|
-
|
|
566
|
-
open: r
|
|
567
|
-
"onUpdate:open": y[1] || (y[1] = (ce) =>
|
|
766
|
+
_(Ce, {
|
|
767
|
+
open: i(r),
|
|
768
|
+
"onUpdate:open": y[1] || (y[1] = (ce) => Ee(r) ? r.value = ce : null),
|
|
568
769
|
class: "wx-admin__drawer",
|
|
569
|
-
title:
|
|
770
|
+
title: f.value === "" ? i(t)("nav.menu") : f.value,
|
|
570
771
|
side: "left",
|
|
571
772
|
size: 260,
|
|
572
773
|
"full-screen": !1,
|
|
573
774
|
closable: ""
|
|
574
775
|
}, {
|
|
575
776
|
footer: g(() => [
|
|
576
|
-
M("div",
|
|
577
|
-
|
|
777
|
+
M("div", Nt, [
|
|
778
|
+
L(c.$slots, "user", { expanded: !0 }, void 0, !0)
|
|
578
779
|
])
|
|
579
780
|
]),
|
|
580
781
|
default: g(() => [
|
|
581
|
-
|
|
782
|
+
L(c.$slots, "nav", {
|
|
582
783
|
collapsed: !1,
|
|
583
|
-
select:
|
|
784
|
+
select: i(v)
|
|
584
785
|
}, void 0, !0)
|
|
585
786
|
]),
|
|
586
787
|
_: 3
|
|
@@ -589,10 +790,10 @@ const ft = /* @__PURE__ */ W({
|
|
|
589
790
|
], 64);
|
|
590
791
|
};
|
|
591
792
|
}
|
|
592
|
-
}),
|
|
593
|
-
class
|
|
594
|
-
constructor(n, t, a = {},
|
|
595
|
-
super(n), this.status = t, this.errors = a, this.retryAfter =
|
|
793
|
+
}), Vt = /* @__PURE__ */ N(Pt, [["__scopeId", "data-v-5baa6cbf"]]);
|
|
794
|
+
class re extends Error {
|
|
795
|
+
constructor(n, t, a = {}, u = null, s = null) {
|
|
796
|
+
super(n), this.status = t, this.errors = a, this.retryAfter = u, this.body = s, this.name = "HttpError";
|
|
596
797
|
}
|
|
597
798
|
status;
|
|
598
799
|
errors;
|
|
@@ -609,76 +810,76 @@ class ie extends Error {
|
|
|
609
810
|
return this.status === 429;
|
|
610
811
|
}
|
|
611
812
|
}
|
|
612
|
-
const
|
|
613
|
-
function
|
|
614
|
-
const n = (e.baseUrl ?? "").replace(/\/$/, ""), t = e.csrfUrl ?? "/sanctum/csrf-cookie", a = e.fetch ?? globalThis.fetch.bind(globalThis),
|
|
813
|
+
const Ft = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]);
|
|
814
|
+
function Ht(e = {}) {
|
|
815
|
+
const n = (e.baseUrl ?? "").replace(/\/$/, ""), t = e.csrfUrl ?? "/sanctum/csrf-cookie", a = e.fetch ?? globalThis.fetch.bind(globalThis), u = e.onUnauthenticated, s = e.headers;
|
|
615
816
|
let l = !1;
|
|
616
|
-
async function
|
|
617
|
-
l && !
|
|
817
|
+
async function o(m = !1) {
|
|
818
|
+
l && !m && ve("XSRF-TOKEN") !== null || (await a(t, { credentials: "same-origin" }), l = !0);
|
|
618
819
|
}
|
|
619
|
-
async function
|
|
620
|
-
const
|
|
621
|
-
|
|
622
|
-
const
|
|
820
|
+
async function r(m, v, f, d = {}, p = !1) {
|
|
821
|
+
const b = Ft.has(m);
|
|
822
|
+
b && await o();
|
|
823
|
+
const c = {
|
|
623
824
|
Accept: "application/json",
|
|
624
825
|
"X-Requested-With": "XMLHttpRequest",
|
|
625
826
|
// Standing headers first, so a caller can still override one for a single request.
|
|
626
|
-
...
|
|
627
|
-
...
|
|
827
|
+
...s?.(),
|
|
828
|
+
...d.headers
|
|
628
829
|
};
|
|
629
|
-
if (
|
|
630
|
-
const
|
|
631
|
-
|
|
830
|
+
if (b) {
|
|
831
|
+
const $ = ve("XSRF-TOKEN");
|
|
832
|
+
$ !== null && (c["X-XSRF-TOKEN"] = $);
|
|
632
833
|
}
|
|
633
|
-
|
|
634
|
-
const y = await a(
|
|
635
|
-
method:
|
|
834
|
+
f !== void 0 && (c["Content-Type"] = "application/json");
|
|
835
|
+
const y = await a(jt(n, v, d.query), {
|
|
836
|
+
method: m,
|
|
636
837
|
credentials: "same-origin",
|
|
637
|
-
headers:
|
|
638
|
-
signal:
|
|
639
|
-
body:
|
|
838
|
+
headers: c,
|
|
839
|
+
signal: d.signal,
|
|
840
|
+
body: f === void 0 ? void 0 : JSON.stringify(f)
|
|
640
841
|
});
|
|
641
|
-
if (y.status === 419 &&
|
|
642
|
-
return await
|
|
643
|
-
if (y.status === 401 &&
|
|
644
|
-
throw await
|
|
842
|
+
if (y.status === 419 && b && !p)
|
|
843
|
+
return await o(!0), r(m, v, f, d, !0);
|
|
844
|
+
if (y.status === 401 && u?.(), !y.ok)
|
|
845
|
+
throw await Ot(y);
|
|
645
846
|
if (y.status !== 204)
|
|
646
847
|
return await y.json();
|
|
647
848
|
}
|
|
648
849
|
return {
|
|
649
|
-
get: (
|
|
650
|
-
post: (
|
|
651
|
-
put: (
|
|
652
|
-
patch: (
|
|
653
|
-
delete: (
|
|
850
|
+
get: (m, v) => r("GET", m, void 0, v),
|
|
851
|
+
post: (m, v, f) => r("POST", m, v, f),
|
|
852
|
+
put: (m, v, f) => r("PUT", m, v, f),
|
|
853
|
+
patch: (m, v, f) => r("PATCH", m, v, f),
|
|
854
|
+
delete: (m, v) => r("DELETE", m, void 0, v)
|
|
654
855
|
};
|
|
655
856
|
}
|
|
656
|
-
async function
|
|
857
|
+
async function Ot(e) {
|
|
657
858
|
let n = null;
|
|
658
859
|
try {
|
|
659
860
|
n = await e.json();
|
|
660
861
|
} catch {
|
|
661
862
|
}
|
|
662
|
-
const t = n ?? {}, a = typeof t.message == "string" && t.message !== "" ? t.message : e.statusText || `Request failed with ${e.status}`,
|
|
663
|
-
return new
|
|
863
|
+
const t = n ?? {}, a = typeof t.message == "string" && t.message !== "" ? t.message : e.statusText || `Request failed with ${e.status}`, u = t.errors !== null && typeof t.errors == "object" ? t.errors : {}, s = e.headers.get("Retry-After"), l = s === null ? null : Number.parseInt(s, 10);
|
|
864
|
+
return new re(
|
|
664
865
|
a,
|
|
665
866
|
e.status,
|
|
666
|
-
|
|
867
|
+
u,
|
|
667
868
|
Number.isFinite(l) ? l : null,
|
|
668
869
|
n
|
|
669
870
|
);
|
|
670
871
|
}
|
|
671
|
-
function
|
|
672
|
-
const
|
|
872
|
+
function jt(e, n, t) {
|
|
873
|
+
const u = /^https?:\/\//i.test(n) ? n : `${e}/${n.replace(/^\//, "")}`;
|
|
673
874
|
if (t === void 0)
|
|
674
|
-
return
|
|
675
|
-
const
|
|
676
|
-
for (const [
|
|
677
|
-
|
|
678
|
-
const l =
|
|
679
|
-
return l === "" ?
|
|
875
|
+
return u;
|
|
876
|
+
const s = new URLSearchParams();
|
|
877
|
+
for (const [o, r] of Object.entries(t))
|
|
878
|
+
r != null && s.set(o, String(r));
|
|
879
|
+
const l = s.toString();
|
|
880
|
+
return l === "" ? u : `${u}${u.includes("?") ? "&" : "?"}${l}`;
|
|
680
881
|
}
|
|
681
|
-
function
|
|
882
|
+
function ve(e) {
|
|
682
883
|
if (typeof document > "u")
|
|
683
884
|
return null;
|
|
684
885
|
for (const n of document.cookie.split(";")) {
|
|
@@ -688,7 +889,7 @@ function he(e) {
|
|
|
688
889
|
}
|
|
689
890
|
return null;
|
|
690
891
|
}
|
|
691
|
-
const
|
|
892
|
+
const $e = {
|
|
692
893
|
shell: {
|
|
693
894
|
loading: "Loading the panel…",
|
|
694
895
|
"error-title": "The panel could not start",
|
|
@@ -709,8 +910,13 @@ const xe = {
|
|
|
709
910
|
// the way to rename it. A module that opens an editor should not be inventing these.
|
|
710
911
|
editor: {
|
|
711
912
|
back: "Back",
|
|
913
|
+
// The head's ··· on a screen that has no name to give the menu.
|
|
914
|
+
more: "More",
|
|
712
915
|
rename: "Rename",
|
|
713
|
-
save: "Save"
|
|
916
|
+
save: "Save",
|
|
917
|
+
// Said out loud to a screen reader while the little wheel turns, and after it stops.
|
|
918
|
+
saving: "Saving…",
|
|
919
|
+
saved: "Saved"
|
|
714
920
|
},
|
|
715
921
|
// The page behind a '?'. Only the heading is the panel's: what the page says belongs to
|
|
716
922
|
// whatever is being explained, and travels with that module's own words.
|
|
@@ -719,6 +925,13 @@ const xe = {
|
|
|
719
925
|
},
|
|
720
926
|
// When something happened, said the way a person would. The month names and the order of
|
|
721
927
|
// the parts come from `Intl` — only the words that no formatter knows are here.
|
|
928
|
+
// The two words every list needs the moment it has filters: what the funnel is called,
|
|
929
|
+
// and the way out of all of them at once. The names of the filters themselves belong to
|
|
930
|
+
// whatever is being filtered, and travel with that module's own words.
|
|
931
|
+
filters: {
|
|
932
|
+
title: "Filters",
|
|
933
|
+
reset: "Reset all"
|
|
934
|
+
},
|
|
722
935
|
dates: {
|
|
723
936
|
today: "today at :time",
|
|
724
937
|
yesterday: "yesterday at :time",
|
|
@@ -797,197 +1010,200 @@ const xe = {
|
|
|
797
1010
|
forbidden: "You may not read the notes of this record.",
|
|
798
1011
|
"not-yours": "A note is edited by whoever wrote it."
|
|
799
1012
|
}
|
|
800
|
-
},
|
|
801
|
-
function
|
|
802
|
-
const n = e.manifestUrl ??
|
|
803
|
-
for (const
|
|
804
|
-
|
|
805
|
-
if (!
|
|
806
|
-
const
|
|
807
|
-
|
|
1013
|
+
}, Se = "webx.locale";
|
|
1014
|
+
function zn(e = {}) {
|
|
1015
|
+
const n = e.manifestUrl ?? Jt() ?? "/api/cms/manifest", t = e.apiPath ?? n.replace(/\/manifest\/?$/, ""), a = e.basePath ?? "/cms", u = e.modules ?? [], s = [...e.routes ?? []];
|
|
1016
|
+
for (const c of u)
|
|
1017
|
+
s.push(...c.routes ?? []);
|
|
1018
|
+
if (!s.some((c) => c.path === "/")) {
|
|
1019
|
+
const c = u.find((y) => y.landing === !0);
|
|
1020
|
+
s.push({
|
|
808
1021
|
path: "/",
|
|
809
1022
|
name: "webx.home",
|
|
810
|
-
component:
|
|
811
|
-
props: { landing:
|
|
1023
|
+
component: Wt,
|
|
1024
|
+
props: { landing: c?.path ?? c?.routes?.[0]?.path ?? null }
|
|
812
1025
|
});
|
|
813
1026
|
}
|
|
814
|
-
const l =
|
|
815
|
-
history:
|
|
816
|
-
routes:
|
|
817
|
-
}),
|
|
1027
|
+
const l = Pe({
|
|
1028
|
+
history: Ve(a),
|
|
1029
|
+
routes: s
|
|
1030
|
+
}), o = de({ locale: e.locale ?? Yt() }), r = e.http ?? Ht({
|
|
818
1031
|
baseUrl: "",
|
|
819
1032
|
onUnauthenticated: () => {
|
|
820
|
-
|
|
1033
|
+
v.setUser(null), v.state.status = "unauthenticated";
|
|
821
1034
|
},
|
|
822
1035
|
// Every request says which language the panel is currently showing. It decides what
|
|
823
1036
|
// the server writes its own messages in — a 422 under a field — for anybody who has
|
|
824
1037
|
// not stored a preference yet, which is everybody until they choose one. Without it,
|
|
825
1038
|
// signing in on a Russian sign-in screen lands in an English panel.
|
|
826
|
-
headers: () => ({ "X-Webx-Locale":
|
|
1039
|
+
headers: () => ({ "X-Webx-Locale": o.state.locale })
|
|
827
1040
|
});
|
|
828
|
-
|
|
829
|
-
async function c
|
|
830
|
-
const y = await
|
|
831
|
-
|
|
1041
|
+
o.defaults("webx-admin", $e);
|
|
1042
|
+
async function m(c) {
|
|
1043
|
+
const y = await r.get(`${t}/translations/${c}`);
|
|
1044
|
+
o.load(y.data.namespaces, y.data.locale, y.data.fallback), Kt(y.data.locale), Gt(y.data.locale, o.state.panelLocales);
|
|
832
1045
|
}
|
|
833
|
-
const
|
|
834
|
-
http:
|
|
1046
|
+
const v = Ct({
|
|
1047
|
+
http: r,
|
|
835
1048
|
basePath: a,
|
|
836
1049
|
apiPath: t,
|
|
837
|
-
modules:
|
|
838
|
-
i18n:
|
|
839
|
-
loadDictionary:
|
|
1050
|
+
modules: u,
|
|
1051
|
+
i18n: o,
|
|
1052
|
+
loadDictionary: m,
|
|
840
1053
|
types: e.types,
|
|
841
1054
|
screens: e.screens,
|
|
842
|
-
loadManifest: async () => (await
|
|
843
|
-
}),
|
|
844
|
-
|
|
845
|
-
const
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
1055
|
+
loadManifest: async () => (await r.get(n)).data
|
|
1056
|
+
}), f = Ue(qt(e));
|
|
1057
|
+
f.use(Qe), Lt(f, v), ct(f, o);
|
|
1058
|
+
const d = A("");
|
|
1059
|
+
f.provide(
|
|
1060
|
+
Ze,
|
|
1061
|
+
x(() => o.state.locale)
|
|
1062
|
+
), f.provide(et, {
|
|
1063
|
+
list: x(
|
|
1064
|
+
() => o.state.contentLocales.map((c) => ({
|
|
1065
|
+
code: c.code,
|
|
1066
|
+
label: c.code.toUpperCase()
|
|
851
1067
|
}))
|
|
852
1068
|
),
|
|
853
|
-
active:
|
|
854
|
-
get: () =>
|
|
855
|
-
set: (
|
|
856
|
-
|
|
1069
|
+
active: x({
|
|
1070
|
+
get: () => d.value || (o.state.contentLocales[0]?.code ?? ""),
|
|
1071
|
+
set: (c) => {
|
|
1072
|
+
d.value = c;
|
|
857
1073
|
}
|
|
858
1074
|
})
|
|
859
1075
|
});
|
|
860
|
-
const
|
|
861
|
-
app:
|
|
1076
|
+
const p = {
|
|
1077
|
+
app: f,
|
|
862
1078
|
router: l,
|
|
863
|
-
context:
|
|
864
|
-
i18n:
|
|
1079
|
+
context: v,
|
|
1080
|
+
i18n: o,
|
|
865
1081
|
async mount() {
|
|
866
|
-
await Promise.all([
|
|
867
|
-
}),
|
|
1082
|
+
await Promise.all([b(), m(o.state.locale)]).catch(() => {
|
|
1083
|
+
}), f.mount(e.el ?? "#webx-app"), await v.reload();
|
|
868
1084
|
}
|
|
869
1085
|
};
|
|
870
|
-
async function
|
|
871
|
-
const
|
|
872
|
-
|
|
1086
|
+
async function b() {
|
|
1087
|
+
const c = await r.get(`${t}/locales`);
|
|
1088
|
+
o.state.panelLocales = c.data.panel, o.state.contentLocales = c.data.content;
|
|
873
1089
|
}
|
|
874
|
-
for (const
|
|
875
|
-
|
|
876
|
-
return
|
|
1090
|
+
for (const c of e.plugins ?? [])
|
|
1091
|
+
c.install(p);
|
|
1092
|
+
return f.use(l), p;
|
|
877
1093
|
}
|
|
878
|
-
function
|
|
1094
|
+
function qt(e) {
|
|
879
1095
|
const n = {
|
|
880
1096
|
// The menu is the panel's own: it is the manifest, drawn.
|
|
881
1097
|
// The shell hands in what a choice means where it drew the menu — in the drawer it is what
|
|
882
1098
|
// closes it, and a drawer that stays open over the section it just opened is a drawer the
|
|
883
1099
|
// reader has to dismiss by hand.
|
|
884
|
-
nav: (t) =>
|
|
1100
|
+
nav: (t) => G(At, { collapsed: t.collapsed === !0, onSelect: t.select })
|
|
885
1101
|
};
|
|
886
|
-
return e.brand !== void 0 && (n.brand = () =>
|
|
1102
|
+
return e.brand !== void 0 && (n.brand = () => G(e.brand)), e.userMenu !== void 0 && (n.user = (t) => G(e.userMenu, { expanded: t.expanded === !0 })), { render: () => G(Vt, null, n) };
|
|
887
1103
|
}
|
|
888
|
-
function
|
|
889
|
-
const e =
|
|
1104
|
+
function Yt() {
|
|
1105
|
+
const e = Xt(Se);
|
|
890
1106
|
return e !== null ? e : typeof document < "u" && document.documentElement.lang !== "" ? document.documentElement.lang : typeof navigator > "u" ? "en" : navigator.language;
|
|
891
1107
|
}
|
|
892
|
-
function
|
|
1108
|
+
function Kt(e) {
|
|
893
1109
|
try {
|
|
894
|
-
localStorage.setItem(
|
|
1110
|
+
localStorage.setItem(Se, e);
|
|
895
1111
|
} catch {
|
|
896
1112
|
}
|
|
897
1113
|
}
|
|
898
|
-
function
|
|
1114
|
+
function Xt(e) {
|
|
899
1115
|
try {
|
|
900
1116
|
return localStorage.getItem(e);
|
|
901
1117
|
} catch {
|
|
902
1118
|
return null;
|
|
903
1119
|
}
|
|
904
1120
|
}
|
|
905
|
-
function
|
|
1121
|
+
function Gt(e, n) {
|
|
906
1122
|
typeof document > "u" || (document.documentElement.lang = e, document.documentElement.dir = n.find((t) => t.code === e)?.direction ?? "ltr");
|
|
907
1123
|
}
|
|
908
|
-
function
|
|
1124
|
+
function Jt() {
|
|
909
1125
|
return typeof document > "u" ? null : document.querySelector('meta[name="webx-manifest"]')?.getAttribute("content") ?? null;
|
|
910
1126
|
}
|
|
911
|
-
function
|
|
1127
|
+
function Qt(e) {
|
|
912
1128
|
const n = e.replace(/\r\n?/g, `
|
|
913
1129
|
`).split(`
|
|
914
1130
|
`), t = [];
|
|
915
1131
|
let a = 0;
|
|
916
1132
|
for (; a < n.length; ) {
|
|
917
|
-
const
|
|
918
|
-
if (
|
|
1133
|
+
const u = n[a] ?? "";
|
|
1134
|
+
if (u.trim() === "") {
|
|
919
1135
|
a += 1;
|
|
920
1136
|
continue;
|
|
921
1137
|
}
|
|
922
|
-
if (/^```([\w-]*)\s*$/.exec(
|
|
923
|
-
const
|
|
1138
|
+
if (/^```([\w-]*)\s*$/.exec(u)) {
|
|
1139
|
+
const r = [];
|
|
924
1140
|
for (a += 1; a < n.length && !/^```\s*$/.test(n[a] ?? ""); )
|
|
925
|
-
|
|
926
|
-
a += 1, t.push(`<pre><code>${
|
|
1141
|
+
r.push(n[a] ?? ""), a += 1;
|
|
1142
|
+
a += 1, t.push(`<pre><code>${ue(r.join(`
|
|
927
1143
|
`))}</code></pre>`);
|
|
928
1144
|
continue;
|
|
929
1145
|
}
|
|
930
|
-
const l = /^(#{1,4})\s+(.*)$/.exec(
|
|
1146
|
+
const l = /^(#{1,4})\s+(.*)$/.exec(u);
|
|
931
1147
|
if (l) {
|
|
932
|
-
const
|
|
933
|
-
t.push(`<h${
|
|
1148
|
+
const r = Math.min(l[1].length + 1, 5);
|
|
1149
|
+
t.push(`<h${r}>${se(l[2] ?? "")}</h${r}>`), a += 1;
|
|
934
1150
|
continue;
|
|
935
1151
|
}
|
|
936
|
-
if (
|
|
937
|
-
const
|
|
938
|
-
for (; a < n.length &&
|
|
939
|
-
for (
|
|
940
|
-
const
|
|
941
|
-
if (
|
|
1152
|
+
if (Q(u)) {
|
|
1153
|
+
const r = /^\s*\d+[.)]\s+/.test(u), m = [];
|
|
1154
|
+
for (; a < n.length && Q(n[a] ?? ""); )
|
|
1155
|
+
for (m.push((n[a] ?? "").replace(/^\s*(?:[-*+]|\d+[.)])\s+/, "")), a += 1; a < n.length; ) {
|
|
1156
|
+
const f = n[a] ?? "";
|
|
1157
|
+
if (f.trim() === "" || Q(f) || /^(#{1,4})\s/.test(f) || /^```/.test(f))
|
|
942
1158
|
break;
|
|
943
|
-
|
|
1159
|
+
m[m.length - 1] += ` ${f.trim()}`, a += 1;
|
|
944
1160
|
}
|
|
945
|
-
const
|
|
946
|
-
t.push(`<${
|
|
1161
|
+
const v = r ? "ol" : "ul";
|
|
1162
|
+
t.push(`<${v}>${m.map((f) => `<li>${se(f)}</li>`).join("")}</${v}>`);
|
|
947
1163
|
continue;
|
|
948
1164
|
}
|
|
949
|
-
const
|
|
1165
|
+
const o = [];
|
|
950
1166
|
for (; a < n.length; ) {
|
|
951
|
-
const
|
|
952
|
-
if (
|
|
953
|
-
|
|
1167
|
+
const r = n[a] ?? "";
|
|
1168
|
+
if (r.trim() === "" || Q(r) || /^(#{1,4})\s/.test(r) || /^```/.test(r)) break;
|
|
1169
|
+
o.push(r.trim()), a += 1;
|
|
954
1170
|
}
|
|
955
|
-
t.push(`<p>${
|
|
1171
|
+
t.push(`<p>${se(o.join(" "))}</p>`);
|
|
956
1172
|
}
|
|
957
1173
|
return t.join("");
|
|
958
1174
|
}
|
|
959
|
-
const
|
|
960
|
-
function
|
|
1175
|
+
const J = "\0";
|
|
1176
|
+
function Q(e) {
|
|
961
1177
|
return /^\s*(?:[-*+]|\d+[.)])\s+/.test(e);
|
|
962
1178
|
}
|
|
963
|
-
function
|
|
964
|
-
const n = [], t = e.replace(/`([^`]+)`/g, (
|
|
965
|
-
return
|
|
1179
|
+
function se(e) {
|
|
1180
|
+
const n = [], t = e.replace(/`([^`]+)`/g, (u, s) => (n.push(`<code>${ue(s)}</code>`), `${J}${n.length - 1}${J}`));
|
|
1181
|
+
return ue(t).replace(
|
|
966
1182
|
/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,
|
|
967
1183
|
'<a href="$2" target="_blank" rel="noopener">$1</a>'
|
|
968
1184
|
).replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>").replace(
|
|
969
|
-
new RegExp(`${
|
|
970
|
-
(
|
|
1185
|
+
new RegExp(`${J}(\\d+)${J}`, "g"),
|
|
1186
|
+
(u, s) => n[Number(s)] ?? ""
|
|
971
1187
|
);
|
|
972
1188
|
}
|
|
973
|
-
function
|
|
1189
|
+
function ue(e) {
|
|
974
1190
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
975
1191
|
}
|
|
976
|
-
function
|
|
1192
|
+
function Zt(e) {
|
|
977
1193
|
const n = e.scope("webx-admin"), t = /* @__PURE__ */ new Map();
|
|
978
|
-
function a(
|
|
979
|
-
const
|
|
980
|
-
let
|
|
981
|
-
return
|
|
1194
|
+
function a(s, l, o) {
|
|
1195
|
+
const r = e.state.locale, m = `${r}:${s}`;
|
|
1196
|
+
let v = t.get(m);
|
|
1197
|
+
return v === void 0 && (v = new Intl.DateTimeFormat(r, l), t.set(m, v)), v.format(o);
|
|
982
1198
|
}
|
|
983
|
-
const
|
|
1199
|
+
const u = (s) => a("time", { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }, s);
|
|
984
1200
|
return {
|
|
985
|
-
short(
|
|
986
|
-
const l =
|
|
1201
|
+
short(s) {
|
|
1202
|
+
const l = ee(s);
|
|
987
1203
|
if (l === null)
|
|
988
1204
|
return n("dates.never");
|
|
989
|
-
const
|
|
990
|
-
return
|
|
1205
|
+
const o = /* @__PURE__ */ new Date(), r = he(l, o);
|
|
1206
|
+
return r === 0 ? n("dates.today", { time: u(l) }) : r === -1 ? n("dates.yesterday", { time: u(l) }) : l.getFullYear() === o.getFullYear() ? a(
|
|
991
1207
|
"this-year",
|
|
992
1208
|
{
|
|
993
1209
|
day: "numeric",
|
|
@@ -999,73 +1215,80 @@ function Dt(e) {
|
|
|
999
1215
|
l
|
|
1000
1216
|
) : a("earlier", { day: "numeric", month: "long", year: "numeric" }, l);
|
|
1001
1217
|
},
|
|
1002
|
-
|
|
1003
|
-
const l =
|
|
1218
|
+
compact(s) {
|
|
1219
|
+
const l = ee(s);
|
|
1220
|
+
if (l === null)
|
|
1221
|
+
return n("dates.never");
|
|
1222
|
+
const o = /* @__PURE__ */ new Date();
|
|
1223
|
+
return he(l, o) === 0 ? u(l) : l.getFullYear() === o.getFullYear() ? a("compact", { day: "numeric", month: "short" }, l) : a("compact-earlier", { dateStyle: "short" }, l);
|
|
1224
|
+
},
|
|
1225
|
+
exact(s) {
|
|
1226
|
+
const l = ee(s);
|
|
1004
1227
|
return l === null ? "" : a("exact", { dateStyle: "long", timeStyle: "medium", hourCycle: "h23" }, l);
|
|
1005
1228
|
},
|
|
1006
|
-
iso(
|
|
1007
|
-
const l =
|
|
1229
|
+
iso(s) {
|
|
1230
|
+
const l = ee(s);
|
|
1008
1231
|
return l === null ? "" : l.toISOString();
|
|
1009
1232
|
}
|
|
1010
1233
|
};
|
|
1011
1234
|
}
|
|
1012
|
-
function
|
|
1013
|
-
const e =
|
|
1014
|
-
return
|
|
1235
|
+
function en() {
|
|
1236
|
+
const e = te(ne, null);
|
|
1237
|
+
return Zt(e ?? tn());
|
|
1015
1238
|
}
|
|
1016
|
-
let
|
|
1017
|
-
function
|
|
1018
|
-
return
|
|
1239
|
+
let Z = null;
|
|
1240
|
+
function tn() {
|
|
1241
|
+
return Z === null && (Z = de(), Z.defaults("webx-admin", $e)), Z;
|
|
1019
1242
|
}
|
|
1020
|
-
function
|
|
1243
|
+
function ee(e) {
|
|
1021
1244
|
if (e == null || e === "")
|
|
1022
1245
|
return null;
|
|
1023
1246
|
const n = e instanceof Date ? e : new Date(e);
|
|
1024
1247
|
return Number.isNaN(n.getTime()) ? null : n;
|
|
1025
1248
|
}
|
|
1026
|
-
function
|
|
1249
|
+
function he(e, n) {
|
|
1027
1250
|
const t = (a) => Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());
|
|
1028
1251
|
return Math.round((t(e) - t(n)) / 864e5);
|
|
1029
1252
|
}
|
|
1030
|
-
function
|
|
1031
|
-
const a = e instanceof
|
|
1253
|
+
function nn(e, n, t) {
|
|
1254
|
+
const a = e instanceof re ? e.status : ln(e);
|
|
1032
1255
|
if (a === 422)
|
|
1033
|
-
return
|
|
1256
|
+
return sn(e) ?? t ?? n("errors.unknown");
|
|
1034
1257
|
if (a === 401) return n("errors.signed-out");
|
|
1035
1258
|
if (a === 403) return n("errors.forbidden");
|
|
1036
1259
|
if (a === 404) return n("errors.gone");
|
|
1037
1260
|
if (a === 409) return n("errors.conflict");
|
|
1038
1261
|
if (a === 429) {
|
|
1039
|
-
const
|
|
1040
|
-
return
|
|
1262
|
+
const u = e instanceof re ? e.retryAfter : null;
|
|
1263
|
+
return u === null ? n("errors.throttled") : n("errors.throttled-in", { seconds: u });
|
|
1041
1264
|
}
|
|
1042
1265
|
return a !== null && a >= 500 ? n("errors.server") : a === null ? n("errors.offline") : t ?? n("errors.unknown");
|
|
1043
1266
|
}
|
|
1044
|
-
function
|
|
1045
|
-
const e =
|
|
1046
|
-
return (n, t) =>
|
|
1267
|
+
function an() {
|
|
1268
|
+
const e = B("webx-admin");
|
|
1269
|
+
return (n, t) => nn(n, e, t);
|
|
1047
1270
|
}
|
|
1048
|
-
function
|
|
1271
|
+
function ln(e) {
|
|
1049
1272
|
const n = e?.status;
|
|
1050
1273
|
return typeof n == "number" ? n : null;
|
|
1051
1274
|
}
|
|
1052
|
-
function
|
|
1275
|
+
function sn(e) {
|
|
1053
1276
|
const t = e?.body?.message;
|
|
1054
1277
|
return typeof t == "string" && t !== "" ? t : null;
|
|
1055
1278
|
}
|
|
1056
|
-
function
|
|
1057
|
-
const a = `${e.apiPath}/entities/${n}/${t}/notes`,
|
|
1279
|
+
function on(e, n, t) {
|
|
1280
|
+
const a = `${e.apiPath}/entities/${n}/${t}/notes`, u = (l) => `${e.apiPath}/notes/${l}`, s = (l) => l.data;
|
|
1058
1281
|
return {
|
|
1059
|
-
list: () => e.http.get(a).then(
|
|
1060
|
-
add: (l) => e.http.post(a, { body: l }).then(
|
|
1061
|
-
save: (l,
|
|
1062
|
-
remove: (l) => e.http.delete(
|
|
1282
|
+
list: () => e.http.get(a).then(s),
|
|
1283
|
+
add: (l) => e.http.post(a, { body: l }).then(s),
|
|
1284
|
+
save: (l, o) => e.http.put(u(l), { body: o }).then(s),
|
|
1285
|
+
remove: (l) => e.http.delete(u(l)).then(() => {
|
|
1063
1286
|
})
|
|
1064
1287
|
};
|
|
1065
1288
|
}
|
|
1066
|
-
const
|
|
1289
|
+
const rn = { class: "wx-screen-host" }, Wn = /* @__PURE__ */ R({
|
|
1067
1290
|
__name: "Screen",
|
|
1068
|
-
props: /* @__PURE__ */
|
|
1291
|
+
props: /* @__PURE__ */ ie({
|
|
1069
1292
|
name: {},
|
|
1070
1293
|
errors: { default: void 0 },
|
|
1071
1294
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -1076,39 +1299,39 @@ const jt = { class: "wx-screen-host" }, pn = /* @__PURE__ */ W({
|
|
|
1076
1299
|
modelValue: { default: () => ({}) },
|
|
1077
1300
|
modelModifiers: {}
|
|
1078
1301
|
}),
|
|
1079
|
-
emits: /* @__PURE__ */
|
|
1302
|
+
emits: /* @__PURE__ */ ie(["loaded"], ["update:modelValue"]),
|
|
1080
1303
|
setup(e, { expose: n, emit: t }) {
|
|
1081
|
-
const a = e,
|
|
1082
|
-
async function
|
|
1083
|
-
|
|
1304
|
+
const a = e, u = t, s = be(e, "modelValue"), l = O(), o = B("webx-admin"), r = A(null), m = A(null);
|
|
1305
|
+
async function v() {
|
|
1306
|
+
r.value = null, m.value = null;
|
|
1084
1307
|
try {
|
|
1085
|
-
const
|
|
1086
|
-
|
|
1087
|
-
} catch (
|
|
1088
|
-
|
|
1308
|
+
const f = await l.loadScreen(a.name);
|
|
1309
|
+
r.value = f, u("loaded", f);
|
|
1310
|
+
} catch (f) {
|
|
1311
|
+
m.value = f instanceof Error ? f.message : String(f);
|
|
1089
1312
|
}
|
|
1090
1313
|
}
|
|
1091
|
-
return
|
|
1092
|
-
|
|
1093
|
-
}, { immediate: !0 }), n({ reload:
|
|
1094
|
-
|
|
1314
|
+
return Y([() => a.name, () => l.i18n.state.locale], () => {
|
|
1315
|
+
v();
|
|
1316
|
+
}, { immediate: !0 }), n({ reload: v }), (f, d) => (h(), k("div", rn, [
|
|
1317
|
+
m.value ? (h(), w(i(tt), {
|
|
1095
1318
|
key: 0,
|
|
1096
1319
|
type: "danger",
|
|
1097
|
-
title:
|
|
1098
|
-
description:
|
|
1099
|
-
}, null, 8, ["title", "description"])) :
|
|
1320
|
+
title: i(o)("shell.error-title"),
|
|
1321
|
+
description: m.value
|
|
1322
|
+
}, null, 8, ["title", "description"])) : r.value === null ? (h(), w(i(xe), {
|
|
1100
1323
|
key: 1,
|
|
1101
1324
|
rows: 4
|
|
1102
|
-
})) : (
|
|
1325
|
+
})) : (h(), w(i(dt), {
|
|
1103
1326
|
key: 2,
|
|
1104
|
-
modelValue:
|
|
1105
|
-
"onUpdate:modelValue":
|
|
1106
|
-
root:
|
|
1107
|
-
patch:
|
|
1108
|
-
types:
|
|
1327
|
+
modelValue: s.value,
|
|
1328
|
+
"onUpdate:modelValue": d[0] || (d[0] = (p) => s.value = p),
|
|
1329
|
+
root: r.value,
|
|
1330
|
+
patch: i(l).screenPatch(e.name),
|
|
1331
|
+
types: i(l).types,
|
|
1109
1332
|
errors: e.errors,
|
|
1110
|
-
translate:
|
|
1111
|
-
can:
|
|
1333
|
+
translate: i(l).i18n.t,
|
|
1334
|
+
can: i(l).can,
|
|
1112
1335
|
disabled: e.disabled,
|
|
1113
1336
|
"label-position": e.labelPosition,
|
|
1114
1337
|
"label-width": e.labelWidth,
|
|
@@ -1116,77 +1339,63 @@ const jt = { class: "wx-screen-host" }, pn = /* @__PURE__ */ W({
|
|
|
1116
1339
|
}, null, 8, ["modelValue", "root", "patch", "types", "errors", "translate", "can", "disabled", "label-position", "label-width", "size"]))
|
|
1117
1340
|
]));
|
|
1118
1341
|
}
|
|
1119
|
-
}),
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1342
|
+
}), An = 76, un = {
|
|
1343
|
+
class: "wx-save-state",
|
|
1344
|
+
role: "status",
|
|
1345
|
+
"aria-live": "polite"
|
|
1346
|
+
}, dn = /* @__PURE__ */ R({
|
|
1347
|
+
__name: "SaveState",
|
|
1124
1348
|
props: {
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
size: { default: "sm" }
|
|
1349
|
+
state: {},
|
|
1350
|
+
linger: { default: 2e3 }
|
|
1128
1351
|
},
|
|
1129
1352
|
setup(e) {
|
|
1130
|
-
const n = e, t =
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
tone: l.danger ? "danger" : "default",
|
|
1155
|
-
href: l.href,
|
|
1156
|
-
target: l.href ? l.target ?? "_blank" : void 0,
|
|
1157
|
-
disabled: l.disabled,
|
|
1158
|
-
onClick: (d) => l.run?.()
|
|
1159
|
-
}, {
|
|
1160
|
-
default: g(() => [
|
|
1161
|
-
R(C(l.label), 1)
|
|
1162
|
-
]),
|
|
1163
|
-
_: 2
|
|
1164
|
-
}, 1032, ["icon", "tone", "href", "target", "disabled", "onClick"])
|
|
1165
|
-
], 64))), 128))
|
|
1166
|
-
]),
|
|
1167
|
-
_: 1
|
|
1168
|
-
}, 8, ["size", "aria-label"])) : E("", !0);
|
|
1353
|
+
const n = e, t = B("webx-admin"), a = A(!1);
|
|
1354
|
+
let u = null;
|
|
1355
|
+
Y(
|
|
1356
|
+
() => n.state,
|
|
1357
|
+
(l, o) => {
|
|
1358
|
+
u !== null && clearTimeout(u), a.value = o === "saving" && l === "saved", a.value && (u = window.setTimeout(() => {
|
|
1359
|
+
a.value = !1, u = null;
|
|
1360
|
+
}, n.linger));
|
|
1361
|
+
}
|
|
1362
|
+
);
|
|
1363
|
+
const s = x(
|
|
1364
|
+
() => n.state === "saving" ? "saving" : a.value ? "saved" : null
|
|
1365
|
+
);
|
|
1366
|
+
return Be(() => {
|
|
1367
|
+
u !== null && clearTimeout(u);
|
|
1368
|
+
}), (l, o) => (h(), k("span", un, [
|
|
1369
|
+
s.value ? (h(), w(i(ye), {
|
|
1370
|
+
key: 0,
|
|
1371
|
+
class: H(["wx-save-state__mark", { "is-saved": s.value === "saved" }]),
|
|
1372
|
+
name: s.value === "saving" ? "loader" : "check",
|
|
1373
|
+
spin: s.value === "saving",
|
|
1374
|
+
label: i(t)(`editor.${s.value}`)
|
|
1375
|
+
}, null, 8, ["class", "name", "spin", "label"])) : z("", !0)
|
|
1376
|
+
]));
|
|
1169
1377
|
}
|
|
1170
|
-
}),
|
|
1171
|
-
__name: "
|
|
1378
|
+
}), Rn = /* @__PURE__ */ N(dn, [["__scopeId", "data-v-216e5e44"]]), En = /* @__PURE__ */ R({
|
|
1379
|
+
__name: "FilterChips",
|
|
1172
1380
|
props: {
|
|
1173
|
-
|
|
1174
|
-
label: { default: void 0 },
|
|
1175
|
-
size: { default: "sm" }
|
|
1381
|
+
filters: {}
|
|
1176
1382
|
},
|
|
1177
1383
|
setup(e) {
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1384
|
+
return (n, t) => (h(!0), k(I, null, P(e.filters, (a) => (h(), w(i(nt), {
|
|
1385
|
+
key: a.key,
|
|
1386
|
+
class: "wx-filter-chip",
|
|
1387
|
+
size: "sm",
|
|
1388
|
+
round: "",
|
|
1389
|
+
closable: "",
|
|
1390
|
+
onClose: (u) => a.clear()
|
|
1391
|
+
}, {
|
|
1392
|
+
default: g(() => [
|
|
1393
|
+
W(C(a.label), 1)
|
|
1394
|
+
]),
|
|
1395
|
+
_: 2
|
|
1396
|
+
}, 1032, ["onClose"]))), 128));
|
|
1188
1397
|
}
|
|
1189
|
-
}),
|
|
1398
|
+
}), cn = { class: "wx-rename__footer" }, mn = /* @__PURE__ */ R({
|
|
1190
1399
|
__name: "RenameButton",
|
|
1191
1400
|
props: {
|
|
1192
1401
|
name: { default: "" },
|
|
@@ -1197,31 +1406,31 @@ const jt = { class: "wx-screen-host" }, pn = /* @__PURE__ */ W({
|
|
|
1197
1406
|
},
|
|
1198
1407
|
emits: ["rename"],
|
|
1199
1408
|
setup(e, { emit: n }) {
|
|
1200
|
-
const t = e, a = n,
|
|
1201
|
-
|
|
1202
|
-
|
|
1409
|
+
const t = e, a = n, u = B("webx-admin"), s = A(!1), l = A(t.name), o = A(null), r = x(() => t.label ?? u("editor.rename"));
|
|
1410
|
+
Y(s, async (v) => {
|
|
1411
|
+
v && (l.value = t.name, await Ie(), o.value?.focus(), o.value?.select());
|
|
1203
1412
|
});
|
|
1204
|
-
function
|
|
1205
|
-
const
|
|
1206
|
-
if (
|
|
1207
|
-
|
|
1413
|
+
function m() {
|
|
1414
|
+
const v = l.value.trim();
|
|
1415
|
+
if (v === "" || v === t.name) {
|
|
1416
|
+
s.value = !1;
|
|
1208
1417
|
return;
|
|
1209
1418
|
}
|
|
1210
|
-
a("rename",
|
|
1419
|
+
a("rename", v), s.value = !1;
|
|
1211
1420
|
}
|
|
1212
|
-
return (
|
|
1213
|
-
open:
|
|
1214
|
-
"onUpdate:open":
|
|
1215
|
-
title:
|
|
1421
|
+
return (v, f) => (h(), w(i(at), {
|
|
1422
|
+
open: s.value,
|
|
1423
|
+
"onUpdate:open": f[2] || (f[2] = (d) => s.value = d),
|
|
1424
|
+
title: r.value,
|
|
1216
1425
|
width: 320,
|
|
1217
1426
|
side: "bottom",
|
|
1218
1427
|
align: "start",
|
|
1219
1428
|
teleport: ""
|
|
1220
1429
|
}, {
|
|
1221
1430
|
trigger: g(() => [
|
|
1222
|
-
|
|
1431
|
+
_(i(K), {
|
|
1223
1432
|
type: "edit",
|
|
1224
|
-
title:
|
|
1433
|
+
title: r.value,
|
|
1225
1434
|
size: e.size,
|
|
1226
1435
|
disabled: e.disabled
|
|
1227
1436
|
}, null, 8, ["title", "size", "disabled"])
|
|
@@ -1229,25 +1438,25 @@ const jt = { class: "wx-screen-host" }, pn = /* @__PURE__ */ W({
|
|
|
1229
1438
|
default: g(() => [
|
|
1230
1439
|
M("form", {
|
|
1231
1440
|
class: "wx-rename",
|
|
1232
|
-
onSubmit:
|
|
1441
|
+
onSubmit: pe(m, ["prevent"])
|
|
1233
1442
|
}, [
|
|
1234
|
-
|
|
1443
|
+
_(i(lt), {
|
|
1235
1444
|
ref_key: "field",
|
|
1236
|
-
ref:
|
|
1445
|
+
ref: o,
|
|
1237
1446
|
modelValue: l.value,
|
|
1238
|
-
"onUpdate:modelValue":
|
|
1239
|
-
"aria-label":
|
|
1447
|
+
"onUpdate:modelValue": f[0] || (f[0] = (d) => l.value = d),
|
|
1448
|
+
"aria-label": r.value,
|
|
1240
1449
|
placeholder: e.placeholder,
|
|
1241
|
-
onKeydown:
|
|
1450
|
+
onKeydown: f[1] || (f[1] = Me((d) => s.value = !1, ["esc"]))
|
|
1242
1451
|
}, null, 8, ["modelValue", "aria-label", "placeholder"]),
|
|
1243
|
-
M("div",
|
|
1244
|
-
|
|
1452
|
+
M("div", cn, [
|
|
1453
|
+
_(i(j), {
|
|
1245
1454
|
type: "primary",
|
|
1246
1455
|
size: "sm",
|
|
1247
1456
|
"native-type": "submit"
|
|
1248
1457
|
}, {
|
|
1249
1458
|
default: g(() => [
|
|
1250
|
-
|
|
1459
|
+
W(C(i(u)("editor.save")), 1)
|
|
1251
1460
|
]),
|
|
1252
1461
|
_: 1
|
|
1253
1462
|
})
|
|
@@ -1257,7 +1466,7 @@ const jt = { class: "wx-screen-host" }, pn = /* @__PURE__ */ W({
|
|
|
1257
1466
|
_: 1
|
|
1258
1467
|
}, 8, ["open", "title"]));
|
|
1259
1468
|
}
|
|
1260
|
-
}),
|
|
1469
|
+
}), Un = /* @__PURE__ */ N(mn, [["__scopeId", "data-v-d879e8d3"]]), fn = ["innerHTML"], vn = /* @__PURE__ */ R({
|
|
1261
1470
|
__name: "HelpButton",
|
|
1262
1471
|
props: {
|
|
1263
1472
|
body: {},
|
|
@@ -1267,81 +1476,82 @@ const jt = { class: "wx-screen-host" }, pn = /* @__PURE__ */ W({
|
|
|
1267
1476
|
width: { default: 720 }
|
|
1268
1477
|
},
|
|
1269
1478
|
setup(e) {
|
|
1270
|
-
const n = e, t =
|
|
1271
|
-
return (l,
|
|
1272
|
-
|
|
1479
|
+
const n = e, t = B("webx-admin"), a = A(!1), u = x(() => n.title ?? t("help.title")), s = x(() => Qt(n.body));
|
|
1480
|
+
return (l, o) => (h(), k(I, null, [
|
|
1481
|
+
_(i(K), {
|
|
1273
1482
|
type: "details",
|
|
1274
1483
|
icon: "question",
|
|
1275
1484
|
tone: "neutral",
|
|
1276
1485
|
size: e.size,
|
|
1277
|
-
title: e.label ??
|
|
1278
|
-
onClick:
|
|
1486
|
+
title: e.label ?? u.value,
|
|
1487
|
+
onClick: o[0] || (o[0] = (r) => a.value = !0)
|
|
1279
1488
|
}, null, 8, ["size", "title"]),
|
|
1280
|
-
|
|
1489
|
+
_(i(st), {
|
|
1281
1490
|
open: a.value,
|
|
1282
|
-
"onUpdate:open":
|
|
1283
|
-
title:
|
|
1491
|
+
"onUpdate:open": o[1] || (o[1] = (r) => a.value = r),
|
|
1492
|
+
title: u.value,
|
|
1284
1493
|
width: e.width
|
|
1285
1494
|
}, {
|
|
1286
1495
|
default: g(() => [
|
|
1287
1496
|
M("div", {
|
|
1288
1497
|
class: "wx-help",
|
|
1289
|
-
innerHTML:
|
|
1290
|
-
}, null, 8,
|
|
1498
|
+
innerHTML: s.value
|
|
1499
|
+
}, null, 8, fn)
|
|
1291
1500
|
]),
|
|
1292
1501
|
_: 1
|
|
1293
1502
|
}, 8, ["open", "title", "width"])
|
|
1294
1503
|
], 64));
|
|
1295
1504
|
}
|
|
1296
|
-
}),
|
|
1505
|
+
}), Bn = /* @__PURE__ */ N(vn, [["__scopeId", "data-v-6c280d42"]]), hn = /* @__PURE__ */ R({
|
|
1297
1506
|
name: "WxDate",
|
|
1298
1507
|
__name: "DateText",
|
|
1299
1508
|
props: {
|
|
1300
1509
|
value: {},
|
|
1510
|
+
compact: { type: Boolean, default: !1 },
|
|
1301
1511
|
size: { default: "sm" },
|
|
1302
1512
|
tone: { default: "muted" }
|
|
1303
1513
|
},
|
|
1304
1514
|
setup(e) {
|
|
1305
|
-
const n = e, t =
|
|
1306
|
-
return (l,
|
|
1515
|
+
const n = e, t = en(), a = x(() => n.compact ? t.compact(n.value) : t.short(n.value)), u = x(() => t.exact(n.value)), s = x(() => t.iso(n.value));
|
|
1516
|
+
return (l, o) => u.value ? (h(), w(i(ot), {
|
|
1307
1517
|
key: 0,
|
|
1308
|
-
content:
|
|
1518
|
+
content: u.value
|
|
1309
1519
|
}, {
|
|
1310
1520
|
default: g(() => [
|
|
1311
|
-
|
|
1521
|
+
_(i(q), {
|
|
1312
1522
|
as: "time",
|
|
1313
|
-
datetime:
|
|
1523
|
+
datetime: s.value,
|
|
1314
1524
|
size: e.size,
|
|
1315
1525
|
tone: e.tone
|
|
1316
1526
|
}, {
|
|
1317
1527
|
default: g(() => [
|
|
1318
|
-
|
|
1528
|
+
W(C(a.value), 1)
|
|
1319
1529
|
]),
|
|
1320
1530
|
_: 1
|
|
1321
1531
|
}, 8, ["datetime", "size", "tone"])
|
|
1322
1532
|
]),
|
|
1323
1533
|
_: 1
|
|
1324
|
-
}, 8, ["content"])) : (
|
|
1534
|
+
}, 8, ["content"])) : (h(), w(i(q), {
|
|
1325
1535
|
key: 1,
|
|
1326
1536
|
size: e.size,
|
|
1327
1537
|
tone: e.tone
|
|
1328
1538
|
}, {
|
|
1329
1539
|
default: g(() => [
|
|
1330
|
-
|
|
1540
|
+
W(C(a.value), 1)
|
|
1331
1541
|
]),
|
|
1332
1542
|
_: 1
|
|
1333
1543
|
}, 8, ["size", "tone"]));
|
|
1334
1544
|
}
|
|
1335
|
-
}),
|
|
1545
|
+
}), pn = { class: "wx-notes" }, gn = {
|
|
1336
1546
|
key: 3,
|
|
1337
1547
|
class: "wx-notes__list"
|
|
1338
|
-
},
|
|
1548
|
+
}, bn = { class: "wx-note__body" }, wn = { class: "wx-note__head" }, yn = { class: "wx-note__buttons" }, xn = {
|
|
1339
1549
|
key: 1,
|
|
1340
1550
|
class: "wx-note__text"
|
|
1341
|
-
},
|
|
1551
|
+
}, kn = {
|
|
1342
1552
|
key: 4,
|
|
1343
1553
|
class: "wx-notes__new"
|
|
1344
|
-
},
|
|
1554
|
+
}, _n = /* @__PURE__ */ R({
|
|
1345
1555
|
name: "WxNotes",
|
|
1346
1556
|
__name: "NotesFeed",
|
|
1347
1557
|
props: {
|
|
@@ -1352,217 +1562,221 @@ const jt = { class: "wx-screen-host" }, pn = /* @__PURE__ */ W({
|
|
|
1352
1562
|
},
|
|
1353
1563
|
emits: ["change"],
|
|
1354
1564
|
setup(e, { emit: n }) {
|
|
1355
|
-
const t = e, a = n,
|
|
1356
|
-
async function
|
|
1357
|
-
|
|
1565
|
+
const t = e, a = n, u = O(), s = B("webx-admin"), l = an(), o = A([]), r = A(!0), m = A(""), v = A(!1), f = A(null), d = A(""), p = x(() => on(u, t.type, t.id)), b = x(() => t.title ?? s("notes.title"));
|
|
1566
|
+
async function c() {
|
|
1567
|
+
r.value = !0;
|
|
1358
1568
|
try {
|
|
1359
|
-
|
|
1360
|
-
} catch (
|
|
1361
|
-
|
|
1569
|
+
o.value = await p.value.list();
|
|
1570
|
+
} catch (S) {
|
|
1571
|
+
F.danger(l(S));
|
|
1362
1572
|
} finally {
|
|
1363
|
-
|
|
1573
|
+
r.value = !1;
|
|
1364
1574
|
}
|
|
1365
1575
|
}
|
|
1366
|
-
|
|
1576
|
+
Y(
|
|
1367
1577
|
() => [t.type, t.id],
|
|
1368
1578
|
() => {
|
|
1369
|
-
|
|
1579
|
+
f.value = null, m.value = "", c();
|
|
1370
1580
|
},
|
|
1371
1581
|
{ immediate: !0 }
|
|
1372
1582
|
);
|
|
1373
1583
|
async function y() {
|
|
1374
|
-
const
|
|
1375
|
-
if (!(
|
|
1376
|
-
|
|
1584
|
+
const S = m.value.trim();
|
|
1585
|
+
if (!(S === "" || v.value)) {
|
|
1586
|
+
v.value = !0;
|
|
1377
1587
|
try {
|
|
1378
|
-
|
|
1379
|
-
} catch (
|
|
1380
|
-
|
|
1588
|
+
o.value = [...o.value, await p.value.add(S)], m.value = "", a("change");
|
|
1589
|
+
} catch (E) {
|
|
1590
|
+
F.danger(l(E));
|
|
1381
1591
|
} finally {
|
|
1382
|
-
|
|
1592
|
+
v.value = !1;
|
|
1383
1593
|
}
|
|
1384
1594
|
}
|
|
1385
1595
|
}
|
|
1386
|
-
function
|
|
1387
|
-
|
|
1596
|
+
function $(S) {
|
|
1597
|
+
f.value = S.id, d.value = S.body;
|
|
1388
1598
|
}
|
|
1389
|
-
async function
|
|
1390
|
-
const
|
|
1391
|
-
if (
|
|
1599
|
+
async function X(S) {
|
|
1600
|
+
const E = d.value.trim();
|
|
1601
|
+
if (E !== "")
|
|
1392
1602
|
try {
|
|
1393
|
-
const T = await
|
|
1394
|
-
|
|
1603
|
+
const T = await p.value.save(S.id, E);
|
|
1604
|
+
o.value = o.value.map((D) => D.id === T.id ? T : D), f.value = null, F.success(s("notes.saved")), a("change");
|
|
1395
1605
|
} catch (T) {
|
|
1396
|
-
|
|
1606
|
+
F.danger(l(T));
|
|
1397
1607
|
}
|
|
1398
1608
|
}
|
|
1399
|
-
async function
|
|
1400
|
-
if (await
|
|
1401
|
-
title:
|
|
1402
|
-
message:
|
|
1403
|
-
confirmText:
|
|
1404
|
-
cancelText:
|
|
1609
|
+
async function ae(S) {
|
|
1610
|
+
if (await ut({
|
|
1611
|
+
title: s("notes.delete-title"),
|
|
1612
|
+
message: s("notes.delete-text"),
|
|
1613
|
+
confirmText: s("notes.delete"),
|
|
1614
|
+
cancelText: s("notes.cancel"),
|
|
1405
1615
|
tone: "danger"
|
|
1406
1616
|
}))
|
|
1407
1617
|
try {
|
|
1408
|
-
await
|
|
1618
|
+
await p.value.remove(S.id), o.value = o.value.filter((T) => T.id !== S.id), F.success(s("notes.deleted")), a("change");
|
|
1409
1619
|
} catch (T) {
|
|
1410
|
-
|
|
1620
|
+
F.danger(l(T));
|
|
1411
1621
|
}
|
|
1412
1622
|
}
|
|
1413
|
-
function
|
|
1414
|
-
return !t.can ||
|
|
1415
|
-
{ key: "edit", icon: "edit", label:
|
|
1623
|
+
function le(S) {
|
|
1624
|
+
return !t.can || !S.is_mine ? [] : [
|
|
1625
|
+
{ key: "edit", icon: "edit", label: s("notes.edit"), run: () => $(S) },
|
|
1416
1626
|
{
|
|
1417
1627
|
key: "delete",
|
|
1418
1628
|
icon: "trash",
|
|
1419
|
-
label:
|
|
1629
|
+
label: s("notes.delete"),
|
|
1420
1630
|
danger: !0,
|
|
1421
1631
|
run: () => {
|
|
1422
|
-
|
|
1632
|
+
ae(S);
|
|
1423
1633
|
}
|
|
1424
1634
|
}
|
|
1425
1635
|
];
|
|
1426
1636
|
}
|
|
1427
|
-
function
|
|
1428
|
-
return
|
|
1637
|
+
function V(S) {
|
|
1638
|
+
return S.author?.name ?? s("notes.unknown-author");
|
|
1429
1639
|
}
|
|
1430
|
-
return (
|
|
1431
|
-
|
|
1640
|
+
return (S, E) => (h(), k("section", pn, [
|
|
1641
|
+
b.value ? (h(), w(i(q), {
|
|
1432
1642
|
key: 0,
|
|
1433
1643
|
weight: "medium",
|
|
1434
1644
|
class: "wx-notes__title"
|
|
1435
1645
|
}, {
|
|
1436
1646
|
default: g(() => [
|
|
1437
|
-
|
|
1647
|
+
W(C(b.value), 1)
|
|
1438
1648
|
]),
|
|
1439
1649
|
_: 1
|
|
1440
|
-
})) :
|
|
1441
|
-
|
|
1650
|
+
})) : z("", !0),
|
|
1651
|
+
r.value ? (h(), w(i(xe), {
|
|
1442
1652
|
key: 1,
|
|
1443
1653
|
rows: 2
|
|
1444
|
-
})) :
|
|
1654
|
+
})) : o.value.length === 0 ? (h(), w(i(it), {
|
|
1445
1655
|
key: 2,
|
|
1446
1656
|
size: "sm",
|
|
1447
|
-
description:
|
|
1448
|
-
}, null, 8, ["description"])) : (
|
|
1449
|
-
(
|
|
1657
|
+
description: i(s)("notes.empty")
|
|
1658
|
+
}, null, 8, ["description"])) : (h(), k("ul", gn, [
|
|
1659
|
+
(h(!0), k(I, null, P(o.value, (T) => (h(), k("li", {
|
|
1450
1660
|
key: T.id,
|
|
1451
1661
|
class: "wx-note"
|
|
1452
1662
|
}, [
|
|
1453
|
-
|
|
1454
|
-
name:
|
|
1663
|
+
_(i(rt), {
|
|
1664
|
+
name: V(T),
|
|
1455
1665
|
size: "sm",
|
|
1456
1666
|
tone: "auto"
|
|
1457
1667
|
}, null, 8, ["name"]),
|
|
1458
|
-
M("div",
|
|
1459
|
-
M("div",
|
|
1460
|
-
|
|
1668
|
+
M("div", bn, [
|
|
1669
|
+
M("div", wn, [
|
|
1670
|
+
_(i(q), {
|
|
1461
1671
|
size: "sm",
|
|
1462
1672
|
weight: "medium",
|
|
1463
1673
|
truncate: ""
|
|
1464
1674
|
}, {
|
|
1465
1675
|
default: g(() => [
|
|
1466
|
-
|
|
1676
|
+
W(C(V(T)), 1)
|
|
1467
1677
|
]),
|
|
1468
1678
|
_: 2
|
|
1469
1679
|
}, 1024),
|
|
1470
|
-
|
|
1680
|
+
_(hn, {
|
|
1471
1681
|
value: T.created_at
|
|
1472
1682
|
}, null, 8, ["value"]),
|
|
1473
|
-
|
|
1474
|
-
actions:
|
|
1475
|
-
label:
|
|
1683
|
+
_(ke, {
|
|
1684
|
+
actions: le(T),
|
|
1685
|
+
label: V(T)
|
|
1476
1686
|
}, null, 8, ["actions", "label"])
|
|
1477
1687
|
]),
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
modelValue:
|
|
1481
|
-
"onUpdate:modelValue":
|
|
1688
|
+
f.value === T.id ? (h(), k(I, { key: 0 }, [
|
|
1689
|
+
_(i(fe), {
|
|
1690
|
+
modelValue: d.value,
|
|
1691
|
+
"onUpdate:modelValue": E[0] || (E[0] = (D) => d.value = D),
|
|
1482
1692
|
autosize: { minRows: 2, maxRows: 10 }
|
|
1483
1693
|
}, null, 8, ["modelValue"]),
|
|
1484
|
-
M("div",
|
|
1485
|
-
|
|
1694
|
+
M("div", yn, [
|
|
1695
|
+
_(i(j), {
|
|
1486
1696
|
size: "sm",
|
|
1487
1697
|
type: "primary",
|
|
1488
|
-
onClick: (
|
|
1698
|
+
onClick: (D) => X(T)
|
|
1489
1699
|
}, {
|
|
1490
1700
|
default: g(() => [
|
|
1491
|
-
|
|
1701
|
+
W(C(i(s)("notes.save")), 1)
|
|
1492
1702
|
]),
|
|
1493
1703
|
_: 1
|
|
1494
1704
|
}, 8, ["onClick"]),
|
|
1495
|
-
|
|
1705
|
+
_(i(j), {
|
|
1496
1706
|
size: "sm",
|
|
1497
1707
|
variant: "text",
|
|
1498
|
-
onClick:
|
|
1708
|
+
onClick: E[1] || (E[1] = (D) => f.value = null)
|
|
1499
1709
|
}, {
|
|
1500
1710
|
default: g(() => [
|
|
1501
|
-
|
|
1711
|
+
W(C(i(s)("notes.cancel")), 1)
|
|
1502
1712
|
]),
|
|
1503
1713
|
_: 1
|
|
1504
1714
|
})
|
|
1505
1715
|
])
|
|
1506
|
-
], 64)) : (
|
|
1716
|
+
], 64)) : (h(), k("p", xn, C(T.body), 1))
|
|
1507
1717
|
])
|
|
1508
1718
|
]))), 128))
|
|
1509
1719
|
])),
|
|
1510
|
-
e.can ? (
|
|
1511
|
-
|
|
1512
|
-
modelValue:
|
|
1513
|
-
"onUpdate:modelValue":
|
|
1514
|
-
placeholder:
|
|
1720
|
+
e.can ? (h(), k("div", kn, [
|
|
1721
|
+
_(i(fe), {
|
|
1722
|
+
modelValue: m.value,
|
|
1723
|
+
"onUpdate:modelValue": E[2] || (E[2] = (T) => m.value = T),
|
|
1724
|
+
placeholder: i(s)("notes.placeholder"),
|
|
1515
1725
|
autosize: { minRows: 2, maxRows: 8 }
|
|
1516
1726
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
1517
|
-
|
|
1727
|
+
_(i(j), {
|
|
1518
1728
|
size: "sm",
|
|
1519
1729
|
type: "primary",
|
|
1520
|
-
disabled:
|
|
1521
|
-
loading:
|
|
1730
|
+
disabled: m.value.trim() === "",
|
|
1731
|
+
loading: v.value,
|
|
1522
1732
|
onClick: y
|
|
1523
1733
|
}, {
|
|
1524
1734
|
default: g(() => [
|
|
1525
|
-
|
|
1735
|
+
W(C(i(s)("notes.add")), 1)
|
|
1526
1736
|
]),
|
|
1527
1737
|
_: 1
|
|
1528
1738
|
}, 8, ["disabled", "loading"])
|
|
1529
|
-
])) :
|
|
1739
|
+
])) : z("", !0)
|
|
1530
1740
|
]));
|
|
1531
1741
|
}
|
|
1532
|
-
}),
|
|
1742
|
+
}), In = /* @__PURE__ */ N(_n, [["__scopeId", "data-v-71004c1a"]]);
|
|
1533
1743
|
export {
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1744
|
+
Wt as AdminLanding,
|
|
1745
|
+
At as AdminNav,
|
|
1746
|
+
Vt as AdminShell,
|
|
1747
|
+
re as HttpError,
|
|
1748
|
+
ft as WxBackButton,
|
|
1749
|
+
hn as WxDate,
|
|
1750
|
+
En as WxFilterChips,
|
|
1751
|
+
Bn as WxHelpButton,
|
|
1752
|
+
$t as WxListScreen,
|
|
1753
|
+
In as WxNotes,
|
|
1754
|
+
Un as WxRenameButton,
|
|
1755
|
+
St as WxRichTextField,
|
|
1756
|
+
ke as WxRowMenu,
|
|
1757
|
+
Rn as WxSaveState,
|
|
1758
|
+
Wn as WxScreen,
|
|
1759
|
+
xt as WxScreenHead,
|
|
1760
|
+
_e as adminKey,
|
|
1761
|
+
$e as adminMessages,
|
|
1762
|
+
Tt as adminTypes,
|
|
1763
|
+
zn as createAdmin,
|
|
1764
|
+
Ct as createAdminContext,
|
|
1765
|
+
Zt as createDates,
|
|
1766
|
+
Ht as createHttp,
|
|
1767
|
+
de as createI18n,
|
|
1768
|
+
on as createNotesApi,
|
|
1769
|
+
nn as errorText,
|
|
1770
|
+
ne as i18nKey,
|
|
1771
|
+
Lt as provideAdmin,
|
|
1772
|
+
ct as provideI18n,
|
|
1773
|
+
ve as readCookie,
|
|
1774
|
+
Qt as renderMarkdown,
|
|
1775
|
+
An as rowMenuWidth,
|
|
1776
|
+
O as useAdmin,
|
|
1777
|
+
en as useDates,
|
|
1778
|
+
an as useErrorText,
|
|
1779
|
+
Ln as useI18n,
|
|
1780
|
+
B as useTranslate
|
|
1567
1781
|
};
|
|
1568
1782
|
//# sourceMappingURL=index.js.map
|