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