@webx-ui/module-admin 0.4.2 → 0.6.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/README.md +33 -0
- package/dist/AdminShell.d.ts +11 -2
- package/dist/BackButton.d.ts +25 -0
- package/dist/DateText.d.ts +23 -0
- package/dist/HelpButton.d.ts +31 -0
- package/dist/ListScreen.d.ts +80 -0
- package/dist/RenameButton.d.ts +163 -0
- package/dist/RowMenu.d.ts +28 -0
- package/dist/admin.d.ts +9 -0
- package/dist/dates.d.ts +40 -0
- package/dist/errors.d.ts +24 -0
- package/dist/index.d.ts +11 -1
- package/dist/index.js +954 -388
- package/dist/index.js.map +1 -1
- package/dist/markdown.d.ts +14 -0
- package/dist/screenTypes.d.ts +14 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +43 -0
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,228 +1,316 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useRouter as
|
|
3
|
-
import { useResponsiveShell as
|
|
4
|
-
import { WxScreenRenderer as
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { defineComponent as T, useModel as se, openBlock as p, createElementBlock as y, normalizeClass as F, createBlock as b, unref as f, withCtx as w, createTextVNode as L, toDisplayString as E, createCommentVNode as z, renderSlot as S, Fragment as C, mergeModels as K, inject as V, reactive as q, computed as k, resolveComponent as $, renderList as I, ref as W, createVNode as _, createElementVNode as A, isRef as ye, createApp as be, h as P, watch as oe, withModifiers as ie, nextTick as xe, withKeys as _e } from "vue";
|
|
2
|
+
import { useRouter as ke, useRoute as $e, createRouter as Se, createWebHistory as Te, RouterLink as Le } from "vue-router";
|
|
3
|
+
import { WxHeading as Ee, WxTabs as ze, WxCard as ne, useResponsiveShell as Ce, shellLayoutFor as We, WxToaster as Ue, WebxUI as Ae, localesKey as Me, WxAlert as Pe, WxSkeleton as Re, WxActions as Be, WxDropdownItem as De, WxAction as G, WxPopover as Ie, WxInput as Ve, WxButton as Ne, WxDialog as je, WxTooltip as He, WxText as ae } from "@webx-ui/core";
|
|
4
|
+
import { WxScreenRenderer as Oe } from "@webx-ui/schema";
|
|
5
|
+
const Fe = ["data-wx-fill"], Ke = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "wx-list-screen__head"
|
|
8
|
+
}, qe = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "wx-list-screen__actions"
|
|
11
|
+
}, Xe = /* @__PURE__ */ T({
|
|
12
|
+
__name: "ListScreen",
|
|
13
|
+
props: /* @__PURE__ */ K({
|
|
14
|
+
title: { default: void 0 },
|
|
15
|
+
views: { default: void 0 },
|
|
16
|
+
card: { type: Boolean, default: !0 },
|
|
17
|
+
padding: { default: void 0 },
|
|
18
|
+
fill: { type: Boolean, default: !1 },
|
|
19
|
+
collapseBelow: { default: 560 }
|
|
20
|
+
}, {
|
|
21
|
+
view: { default: void 0 },
|
|
22
|
+
viewModifiers: {}
|
|
23
|
+
}),
|
|
24
|
+
emits: ["update:view"],
|
|
25
|
+
setup(e) {
|
|
26
|
+
const t = se(e, "view");
|
|
27
|
+
return (n, a) => (p(), y("div", {
|
|
28
|
+
class: F(["wx-list-screen", { "is-fill": e.fill }]),
|
|
29
|
+
"data-wx-fill": e.fill ? "" : void 0
|
|
30
|
+
}, [
|
|
31
|
+
e.title || n.$slots.actions ? (p(), y("div", Ke, [
|
|
32
|
+
e.title ? (p(), b(f(Ee), {
|
|
33
|
+
key: 0,
|
|
34
|
+
level: 2,
|
|
35
|
+
class: "wx-list-screen__title"
|
|
36
|
+
}, {
|
|
37
|
+
default: w(() => [
|
|
38
|
+
L(E(e.title), 1)
|
|
39
|
+
]),
|
|
40
|
+
_: 1
|
|
41
|
+
})) : z("", !0),
|
|
42
|
+
n.$slots.actions ? (p(), y("div", qe, [
|
|
43
|
+
S(n.$slots, "actions", {}, void 0, !0)
|
|
44
|
+
])) : z("", !0)
|
|
45
|
+
])) : z("", !0),
|
|
46
|
+
e.views && e.views.length > 0 ? (p(), b(f(ze), {
|
|
47
|
+
key: 1,
|
|
48
|
+
modelValue: t.value,
|
|
49
|
+
"onUpdate:modelValue": a[0] || (a[0] = (i) => t.value = i),
|
|
50
|
+
class: "wx-list-screen__views",
|
|
51
|
+
items: e.views,
|
|
52
|
+
"collapse-below": e.collapseBelow,
|
|
53
|
+
"aria-label": e.title
|
|
54
|
+
}, {
|
|
55
|
+
default: w(() => [
|
|
56
|
+
e.card ? (p(), b(f(ne), {
|
|
57
|
+
key: 0,
|
|
58
|
+
class: "wx-list-screen__card",
|
|
59
|
+
padding: e.padding
|
|
60
|
+
}, {
|
|
61
|
+
default: w(() => [
|
|
62
|
+
S(n.$slots, "default", {}, void 0, !0)
|
|
63
|
+
]),
|
|
64
|
+
_: 3
|
|
65
|
+
}, 8, ["padding"])) : S(n.$slots, "default", {}, void 0, !0, 1)
|
|
66
|
+
]),
|
|
67
|
+
_: 3
|
|
68
|
+
}, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (p(), y(C, { key: 2 }, [
|
|
69
|
+
e.card ? (p(), b(f(ne), {
|
|
70
|
+
key: 0,
|
|
71
|
+
class: "wx-list-screen__card",
|
|
72
|
+
padding: e.padding
|
|
73
|
+
}, {
|
|
74
|
+
default: w(() => [
|
|
75
|
+
S(n.$slots, "default", {}, void 0, !0)
|
|
76
|
+
]),
|
|
77
|
+
_: 3
|
|
78
|
+
}, 8, ["padding"])) : S(n.$slots, "default", {}, void 0, !0, 1)
|
|
79
|
+
], 64))
|
|
80
|
+
], 10, Fe));
|
|
81
|
+
}
|
|
82
|
+
}), N = (e, t) => {
|
|
83
|
+
const n = e.__vccOpts || e;
|
|
84
|
+
for (const [a, i] of t)
|
|
85
|
+
n[a] = i;
|
|
86
|
+
return n;
|
|
87
|
+
}, Ye = /* @__PURE__ */ N(Xe, [["__scopeId", "data-v-7586ed04"]]), Ge = {
|
|
88
|
+
"wx-list": { component: Ye, kind: "layout", labelProp: "title" }
|
|
89
|
+
}, re = /* @__PURE__ */ Symbol("webx-admin");
|
|
90
|
+
function J() {
|
|
91
|
+
const e = V(re, null);
|
|
8
92
|
if (e === null)
|
|
9
93
|
throw new Error("useAdmin() was called outside a panel created by createAdmin().");
|
|
10
94
|
return e;
|
|
11
95
|
}
|
|
12
|
-
function
|
|
13
|
-
const
|
|
96
|
+
function Je(e) {
|
|
97
|
+
const t = q({
|
|
14
98
|
status: "loading",
|
|
15
99
|
manifest: null,
|
|
16
100
|
user: null,
|
|
17
101
|
error: null
|
|
18
|
-
}),
|
|
19
|
-
const
|
|
20
|
-
if (
|
|
102
|
+
}), n = k(() => {
|
|
103
|
+
const l = t.manifest;
|
|
104
|
+
if (l === null)
|
|
21
105
|
return [];
|
|
22
|
-
const
|
|
23
|
-
for (const
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
106
|
+
const m = [];
|
|
107
|
+
for (const h of l.modules) {
|
|
108
|
+
const g = e.modules.find((x) => x.id === h.id);
|
|
109
|
+
if (g === void 0)
|
|
26
110
|
continue;
|
|
27
|
-
const v =
|
|
28
|
-
v !== void 0 &&
|
|
29
|
-
id:
|
|
30
|
-
title:
|
|
31
|
-
icon:
|
|
111
|
+
const v = g.path ?? g.routes?.[0]?.path;
|
|
112
|
+
v !== void 0 && m.push({
|
|
113
|
+
id: h.id,
|
|
114
|
+
title: h.title,
|
|
115
|
+
icon: h.icon,
|
|
32
116
|
path: v,
|
|
33
|
-
group:
|
|
117
|
+
group: h.group ?? null
|
|
34
118
|
});
|
|
35
119
|
}
|
|
36
|
-
return
|
|
37
|
-
}),
|
|
38
|
-
const
|
|
39
|
-
for (const
|
|
40
|
-
if (
|
|
41
|
-
const v =
|
|
42
|
-
v.push(
|
|
120
|
+
return m;
|
|
121
|
+
}), a = k(() => {
|
|
122
|
+
const l = t.manifest?.groups ?? [], m = [], h = /* @__PURE__ */ new Map();
|
|
123
|
+
for (const g of n.value)
|
|
124
|
+
if (g.group !== null && l.some((v) => v.id === g.group)) {
|
|
125
|
+
const v = h.get(g.group) ?? [];
|
|
126
|
+
v.push(g), h.set(g.group, v);
|
|
43
127
|
} else
|
|
44
|
-
|
|
128
|
+
m.push(g);
|
|
45
129
|
return {
|
|
46
|
-
top:
|
|
47
|
-
groups:
|
|
48
|
-
id:
|
|
49
|
-
title:
|
|
50
|
-
entries:
|
|
130
|
+
top: m,
|
|
131
|
+
groups: l.filter((g) => h.has(g.id)).map((g) => ({
|
|
132
|
+
id: g.id,
|
|
133
|
+
title: g.title,
|
|
134
|
+
entries: h.get(g.id) ?? []
|
|
51
135
|
}))
|
|
52
136
|
};
|
|
53
|
-
}),
|
|
54
|
-
for (const
|
|
55
|
-
Object.assign(
|
|
56
|
-
Object.assign(
|
|
57
|
-
const
|
|
58
|
-
async function
|
|
59
|
-
const
|
|
60
|
-
let
|
|
61
|
-
return
|
|
62
|
-
throw
|
|
63
|
-
}),
|
|
137
|
+
}), i = { ...Ge };
|
|
138
|
+
for (const l of e.modules)
|
|
139
|
+
Object.assign(i, l.types);
|
|
140
|
+
Object.assign(i, e.types);
|
|
141
|
+
const d = /* @__PURE__ */ new Map();
|
|
142
|
+
async function o(l) {
|
|
143
|
+
const m = `${e.i18n.state.locale}:${l}`;
|
|
144
|
+
let h = d.get(m);
|
|
145
|
+
return h === void 0 && (h = e.http.get(`${e.apiPath}/screens/${l}`).then((g) => g.data.root).catch((g) => {
|
|
146
|
+
throw d.delete(m), g;
|
|
147
|
+
}), d.set(m, h)), h;
|
|
64
148
|
}
|
|
65
149
|
let r = null;
|
|
66
|
-
async function
|
|
67
|
-
|
|
150
|
+
async function s() {
|
|
151
|
+
t.status = "loading", t.error = null;
|
|
68
152
|
try {
|
|
69
|
-
if (r !== null && (
|
|
70
|
-
|
|
153
|
+
if (r !== null && (t.user = await r(), t.user === null)) {
|
|
154
|
+
t.manifest = null, t.status = "unauthenticated";
|
|
71
155
|
return;
|
|
72
156
|
}
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
} catch (
|
|
76
|
-
if (
|
|
77
|
-
|
|
157
|
+
const l = await e.loadManifest();
|
|
158
|
+
t.manifest = l, e.i18n.state.contentLocales = l.locales ?? [], e.i18n.state.panelLocales = l.panelLocales ?? e.i18n.state.panelLocales, l.locale !== void 0 && l.locale !== e.i18n.state.locale && await c(l.locale), t.status = "ready";
|
|
159
|
+
} catch (l) {
|
|
160
|
+
if (Ze(l)) {
|
|
161
|
+
t.manifest = null, t.user = null, t.status = "unauthenticated";
|
|
78
162
|
return;
|
|
79
163
|
}
|
|
80
|
-
|
|
164
|
+
t.error = l instanceof Error ? l.message : String(l), t.status = "error";
|
|
81
165
|
}
|
|
82
166
|
}
|
|
83
|
-
async function
|
|
84
|
-
if (
|
|
85
|
-
e.i18n.state.locale = t;
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
if (await e.loadDictionary(t), n.manifest !== null)
|
|
167
|
+
async function u() {
|
|
168
|
+
if (t.manifest !== null)
|
|
89
169
|
try {
|
|
90
|
-
|
|
170
|
+
t.manifest = await e.loadManifest();
|
|
91
171
|
} catch {
|
|
92
172
|
}
|
|
93
173
|
}
|
|
174
|
+
async function c(l) {
|
|
175
|
+
if (e.loadDictionary === void 0) {
|
|
176
|
+
e.i18n.state.locale = l;
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
await e.loadDictionary(l), await u();
|
|
180
|
+
}
|
|
94
181
|
return {
|
|
95
182
|
http: e.http,
|
|
96
183
|
basePath: e.basePath,
|
|
97
184
|
apiPath: e.apiPath,
|
|
98
|
-
state:
|
|
185
|
+
state: t,
|
|
99
186
|
i18n: e.i18n,
|
|
100
187
|
modules: e.modules,
|
|
101
|
-
nav:
|
|
102
|
-
groups:
|
|
103
|
-
types:
|
|
104
|
-
reload:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
188
|
+
nav: n,
|
|
189
|
+
groups: a,
|
|
190
|
+
types: i,
|
|
191
|
+
reload: s,
|
|
192
|
+
refreshManifest: u,
|
|
193
|
+
setLocale: c,
|
|
194
|
+
setUser(l) {
|
|
195
|
+
t.user = l;
|
|
108
196
|
},
|
|
109
|
-
useSessionLoader(
|
|
110
|
-
r =
|
|
197
|
+
useSessionLoader(l) {
|
|
198
|
+
r = l;
|
|
111
199
|
},
|
|
112
|
-
can(
|
|
113
|
-
const
|
|
114
|
-
return
|
|
200
|
+
can(l) {
|
|
201
|
+
const m = t.user;
|
|
202
|
+
return m === null ? !1 : m.isSuper || m.permissions.includes(l);
|
|
115
203
|
},
|
|
116
|
-
loadScreen:
|
|
117
|
-
screenPatch(
|
|
118
|
-
return e.screens?.[
|
|
204
|
+
loadScreen: o,
|
|
205
|
+
screenPatch(l) {
|
|
206
|
+
return e.screens?.[l] ?? [];
|
|
119
207
|
}
|
|
120
208
|
};
|
|
121
209
|
}
|
|
122
|
-
function
|
|
123
|
-
e.provide(
|
|
210
|
+
function Qe(e, t) {
|
|
211
|
+
e.provide(re, t);
|
|
124
212
|
}
|
|
125
|
-
function
|
|
213
|
+
function Ze(e) {
|
|
126
214
|
return typeof e == "object" && e !== null && "status" in e && e.status === 401;
|
|
127
215
|
}
|
|
128
|
-
const
|
|
129
|
-
function
|
|
130
|
-
const e =
|
|
216
|
+
const j = /* @__PURE__ */ Symbol("webx-i18n");
|
|
217
|
+
function Nt() {
|
|
218
|
+
const e = V(j, null);
|
|
131
219
|
if (e === null)
|
|
132
220
|
throw new Error("useI18n() was called outside a panel created by createAdmin().");
|
|
133
221
|
return e;
|
|
134
222
|
}
|
|
135
|
-
function
|
|
136
|
-
const
|
|
137
|
-
return
|
|
223
|
+
function U(e) {
|
|
224
|
+
const t = V(j, null);
|
|
225
|
+
return t === null ? Q().scope(e) : t.scope(e);
|
|
138
226
|
}
|
|
139
|
-
function
|
|
140
|
-
e.provide(
|
|
227
|
+
function et(e, t) {
|
|
228
|
+
e.provide(j, t);
|
|
141
229
|
}
|
|
142
|
-
function
|
|
143
|
-
const
|
|
144
|
-
locale: e.locale ??
|
|
145
|
-
fallback:
|
|
230
|
+
function Q(e = {}) {
|
|
231
|
+
const t = e.fallback ?? "en", n = q({
|
|
232
|
+
locale: e.locale ?? t,
|
|
233
|
+
fallback: t,
|
|
146
234
|
panelLocales: [],
|
|
147
235
|
contentLocales: []
|
|
148
|
-
}),
|
|
149
|
-
function
|
|
150
|
-
let
|
|
151
|
-
for (const
|
|
152
|
-
if (typeof
|
|
236
|
+
}), a = {}, i = q({ value: {} });
|
|
237
|
+
function d(r, s, u) {
|
|
238
|
+
let c = r[s]?.[u[0] ?? ""];
|
|
239
|
+
for (const l of u.slice(1)) {
|
|
240
|
+
if (typeof c != "object" || c === null)
|
|
153
241
|
return null;
|
|
154
|
-
|
|
242
|
+
c = c[l];
|
|
155
243
|
}
|
|
156
|
-
return typeof
|
|
244
|
+
return typeof c == "string" ? c : null;
|
|
157
245
|
}
|
|
158
|
-
function
|
|
159
|
-
const [
|
|
246
|
+
function o(r, s, u) {
|
|
247
|
+
const [c, l] = s.includes("::") ? s.split("::", 2) : [r, s], m = l.split("."), h = d(i.value, c, m) ?? d(a, c, m) ?? // Not an empty string: a key on screen is ugly, but it says which key, and a blank
|
|
160
248
|
// label says nothing to anybody trying to fix it.
|
|
161
|
-
|
|
162
|
-
return
|
|
249
|
+
s;
|
|
250
|
+
return u === void 0 ? h : tt(h, u);
|
|
163
251
|
}
|
|
164
252
|
return {
|
|
165
|
-
state:
|
|
166
|
-
defaults(r,
|
|
167
|
-
|
|
253
|
+
state: n,
|
|
254
|
+
defaults(r, s) {
|
|
255
|
+
a[r] = { ...a[r], ...s };
|
|
168
256
|
},
|
|
169
|
-
load(r,
|
|
170
|
-
|
|
257
|
+
load(r, s, u) {
|
|
258
|
+
i.value = r ?? {}, n.locale = s ?? n.locale, u !== void 0 && (n.fallback = u);
|
|
171
259
|
},
|
|
172
260
|
scope(r) {
|
|
173
|
-
return (
|
|
261
|
+
return (s, u) => o(r, s, u);
|
|
174
262
|
},
|
|
175
|
-
t: (r,
|
|
263
|
+
t: (r, s) => o("", r, s)
|
|
176
264
|
};
|
|
177
265
|
}
|
|
178
|
-
function
|
|
179
|
-
let
|
|
180
|
-
for (const [
|
|
181
|
-
|
|
182
|
-
return
|
|
266
|
+
function tt(e, t) {
|
|
267
|
+
let n = e;
|
|
268
|
+
for (const [a, i] of Object.entries(t))
|
|
269
|
+
n = n.replaceAll(`:${a}`, String(i));
|
|
270
|
+
return n;
|
|
183
271
|
}
|
|
184
|
-
const
|
|
272
|
+
const nt = /* @__PURE__ */ T({
|
|
185
273
|
__name: "AdminNav",
|
|
186
274
|
props: {
|
|
187
275
|
collapsed: { type: Boolean }
|
|
188
276
|
},
|
|
189
277
|
emits: ["select"],
|
|
190
|
-
setup(e, { emit:
|
|
191
|
-
const
|
|
192
|
-
get: () =>
|
|
193
|
-
set: (
|
|
194
|
-
const
|
|
195
|
-
|
|
278
|
+
setup(e, { emit: t }) {
|
|
279
|
+
const n = t, a = J(), i = U("webx-admin"), d = ke(), o = $e(), r = k({
|
|
280
|
+
get: () => a.nav.value.find((u) => o.path.startsWith(u.path))?.id ?? "",
|
|
281
|
+
set: (s) => {
|
|
282
|
+
const u = a.nav.value.find((c) => c.id === s);
|
|
283
|
+
u !== void 0 && d.push(u.path);
|
|
196
284
|
}
|
|
197
285
|
});
|
|
198
|
-
return (
|
|
199
|
-
const
|
|
200
|
-
return
|
|
286
|
+
return (s, u) => {
|
|
287
|
+
const c = $("wx-menu-item"), l = $("wx-submenu"), m = $("wx-menu");
|
|
288
|
+
return p(), b(m, {
|
|
201
289
|
modelValue: r.value,
|
|
202
|
-
"onUpdate:modelValue":
|
|
290
|
+
"onUpdate:modelValue": u[0] || (u[0] = (h) => r.value = h),
|
|
203
291
|
collapsed: e.collapsed,
|
|
204
|
-
label:
|
|
205
|
-
onSelect:
|
|
292
|
+
label: f(i)("nav.sections"),
|
|
293
|
+
onSelect: u[1] || (u[1] = (h) => n("select"))
|
|
206
294
|
}, {
|
|
207
|
-
default:
|
|
208
|
-
(
|
|
209
|
-
key:
|
|
210
|
-
value:
|
|
211
|
-
icon:
|
|
212
|
-
label:
|
|
295
|
+
default: w(() => [
|
|
296
|
+
(p(!0), y(C, null, I(f(a).groups.value.top, (h) => (p(), b(c, {
|
|
297
|
+
key: h.id,
|
|
298
|
+
value: h.id,
|
|
299
|
+
icon: h.icon ?? void 0,
|
|
300
|
+
label: h.title
|
|
213
301
|
}, null, 8, ["value", "icon", "label"]))), 128)),
|
|
214
|
-
(
|
|
215
|
-
key:
|
|
216
|
-
value: `group:${
|
|
217
|
-
title:
|
|
302
|
+
(p(!0), y(C, null, I(f(a).groups.value.groups, (h) => (p(), b(l, {
|
|
303
|
+
key: h.id,
|
|
304
|
+
value: `group:${h.id}`,
|
|
305
|
+
title: h.title,
|
|
218
306
|
icon: "gear"
|
|
219
307
|
}, {
|
|
220
|
-
default:
|
|
221
|
-
(
|
|
222
|
-
key:
|
|
223
|
-
value:
|
|
224
|
-
icon:
|
|
225
|
-
label:
|
|
308
|
+
default: w(() => [
|
|
309
|
+
(p(!0), y(C, null, I(h.entries, (g) => (p(), b(c, {
|
|
310
|
+
key: g.id,
|
|
311
|
+
value: g.id,
|
|
312
|
+
icon: g.icon ?? void 0,
|
|
313
|
+
label: g.title
|
|
226
314
|
}, null, 8, ["value", "icon", "label"]))), 128))
|
|
227
315
|
]),
|
|
228
316
|
_: 2
|
|
@@ -232,138 +320,204 @@ const we = /* @__PURE__ */ M({
|
|
|
232
320
|
}, 8, ["modelValue", "collapsed", "label"]);
|
|
233
321
|
};
|
|
234
322
|
}
|
|
235
|
-
}),
|
|
323
|
+
}), at = {
|
|
236
324
|
key: 0,
|
|
237
325
|
class: "wx-root wx-admin-plain"
|
|
238
|
-
},
|
|
326
|
+
}, lt = {
|
|
239
327
|
key: 1,
|
|
240
328
|
class: "wx-root wx-admin-plain"
|
|
241
|
-
},
|
|
329
|
+
}, st = {
|
|
242
330
|
key: 2,
|
|
243
331
|
class: "wx-root wx-admin-plain"
|
|
244
|
-
},
|
|
332
|
+
}, ot = ["src", "alt", "width", "height"], it = ["src", "alt", "width", "height"], rt = ["src", "alt"], ut = { class: "wx-admin__user" }, dt = { class: "wx-admin__user wx-admin__user--drawer" }, ct = /* @__PURE__ */ T({
|
|
245
333
|
__name: "AdminShell",
|
|
246
334
|
setup(e) {
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
335
|
+
const t = J(), n = U("webx-admin"), a = W(null), { width: i, layout: d, collapsed: o, showAside: r, drawerOpen: s, toggle: u, close: c } = Ce(
|
|
336
|
+
a,
|
|
337
|
+
{ persist: "webx-admin-shell" }
|
|
338
|
+
), l = k(() => t.state.manifest?.title ?? ""), m = k(() => t.state.manifest?.branding?.logo ?? null), h = k(() => t.state.manifest?.branding?.mark ?? null), g = k(() => We(i.value, null));
|
|
339
|
+
return (v, x) => {
|
|
340
|
+
const M = $("router-view"), ce = $("wx-loading"), fe = $("wx-button"), me = $("wx-result"), Z = $("wx-action"), ee = $("wx-text"), he = $("wx-header"), pe = $("wx-aside"), ve = $("wx-main"), ge = $("wx-container"), we = $("wx-drawer");
|
|
341
|
+
return p(), y(C, null, [
|
|
342
|
+
_(f(Ue)),
|
|
343
|
+
f(t).state.status === "unauthenticated" ? (p(), y("div", at, [
|
|
344
|
+
_(M)
|
|
345
|
+
])) : f(t).state.status === "loading" ? (p(), y("div", lt, [
|
|
346
|
+
_(ce, {
|
|
347
|
+
label: f(n)("shell.loading")
|
|
259
348
|
}, null, 8, ["label"])
|
|
260
|
-
])) :
|
|
261
|
-
|
|
349
|
+
])) : f(t).state.status === "error" ? (p(), y("div", st, [
|
|
350
|
+
_(me, {
|
|
262
351
|
status: "error",
|
|
263
|
-
title:
|
|
264
|
-
description:
|
|
352
|
+
title: f(n)("shell.error-title"),
|
|
353
|
+
description: f(t).state.error
|
|
265
354
|
}, {
|
|
266
|
-
default:
|
|
267
|
-
|
|
355
|
+
default: w(() => [
|
|
356
|
+
_(fe, {
|
|
268
357
|
type: "primary",
|
|
269
|
-
onClick:
|
|
358
|
+
onClick: x[0] || (x[0] = (te) => f(t).reload())
|
|
270
359
|
}, {
|
|
271
|
-
default:
|
|
272
|
-
|
|
360
|
+
default: w(() => [
|
|
361
|
+
L(E(f(n)("shell.retry")), 1)
|
|
273
362
|
]),
|
|
274
363
|
_: 1
|
|
275
364
|
})
|
|
276
365
|
]),
|
|
277
366
|
_: 1
|
|
278
367
|
}, 8, ["title", "description"])
|
|
279
|
-
])) : (
|
|
368
|
+
])) : (p(), y("div", {
|
|
280
369
|
key: 3,
|
|
281
370
|
ref_key: "shellEl",
|
|
282
|
-
ref:
|
|
283
|
-
class: "wx-root wx-admin"
|
|
371
|
+
ref: a,
|
|
372
|
+
class: F(["wx-root wx-admin", `wx-admin--${g.value}`])
|
|
284
373
|
}, [
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
374
|
+
_(ge, {
|
|
375
|
+
direction: f(d) === "drawer" ? "vertical" : "horizontal",
|
|
376
|
+
"full-height": "",
|
|
377
|
+
class: "wx-admin__frame"
|
|
378
|
+
}, {
|
|
379
|
+
default: w(() => [
|
|
380
|
+
f(d) === "drawer" ? (p(), b(he, {
|
|
381
|
+
key: 0,
|
|
382
|
+
class: "wx-admin__header",
|
|
383
|
+
floating: "",
|
|
384
|
+
sticky: "",
|
|
385
|
+
bordered: !1,
|
|
386
|
+
padding: "sm",
|
|
387
|
+
height: "var(--wx-admin-header-height)"
|
|
388
|
+
}, {
|
|
389
|
+
end: w(() => [
|
|
390
|
+
S(v.$slots, "user", { expanded: !1 }, void 0, !0)
|
|
290
391
|
]),
|
|
291
|
-
default:
|
|
292
|
-
|
|
293
|
-
icon:
|
|
294
|
-
title:
|
|
295
|
-
onClick:
|
|
296
|
-
}, null, 8, ["
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
392
|
+
default: w(() => [
|
|
393
|
+
_(Z, {
|
|
394
|
+
icon: "menu",
|
|
395
|
+
title: f(n)("nav.menu"),
|
|
396
|
+
onClick: f(u)
|
|
397
|
+
}, null, 8, ["title", "onClick"]),
|
|
398
|
+
S(v.$slots, "brand", {}, () => [
|
|
399
|
+
m.value ? (p(), y("img", {
|
|
400
|
+
key: 0,
|
|
401
|
+
class: "wx-admin__logo",
|
|
402
|
+
src: m.value.url,
|
|
403
|
+
alt: l.value,
|
|
404
|
+
width: m.value.width ?? void 0,
|
|
405
|
+
height: m.value.height ?? void 0
|
|
406
|
+
}, null, 8, ot)) : (p(), b(ee, {
|
|
407
|
+
key: 1,
|
|
408
|
+
weight: "semibold",
|
|
409
|
+
truncate: ""
|
|
410
|
+
}, {
|
|
411
|
+
default: w(() => [
|
|
412
|
+
L(E(l.value), 1)
|
|
301
413
|
]),
|
|
302
414
|
_: 1
|
|
303
|
-
})
|
|
415
|
+
}))
|
|
304
416
|
], !0)
|
|
305
417
|
]),
|
|
306
418
|
_: 3
|
|
307
|
-
}),
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
419
|
+
})) : z("", !0),
|
|
420
|
+
f(r) ? (p(), b(pe, {
|
|
421
|
+
key: 1,
|
|
422
|
+
class: "wx-admin__aside",
|
|
423
|
+
sticky: "",
|
|
424
|
+
floating: "",
|
|
425
|
+
scroll: "",
|
|
426
|
+
bordered: !1,
|
|
427
|
+
collapsed: f(o),
|
|
428
|
+
width: 220,
|
|
429
|
+
"collapsed-width": 56
|
|
430
|
+
}, {
|
|
431
|
+
top: w(() => [
|
|
432
|
+
A("div", {
|
|
433
|
+
class: F(["wx-admin__brand", { "wx-admin__brand--stacked": f(o) && h.value }])
|
|
434
|
+
}, [
|
|
435
|
+
f(o) ? h.value ? (p(), y("img", {
|
|
436
|
+
key: 1,
|
|
437
|
+
class: "wx-admin__mark",
|
|
438
|
+
src: h.value.url,
|
|
439
|
+
alt: l.value
|
|
440
|
+
}, null, 8, rt)) : z("", !0) : S(v.$slots, "brand", {}, () => [
|
|
441
|
+
m.value ? (p(), y("img", {
|
|
442
|
+
key: 0,
|
|
443
|
+
class: "wx-admin__logo",
|
|
444
|
+
src: m.value.url,
|
|
445
|
+
alt: l.value,
|
|
446
|
+
width: m.value.width ?? void 0,
|
|
447
|
+
height: m.value.height ?? void 0
|
|
448
|
+
}, null, 8, it)) : (p(), b(ee, {
|
|
449
|
+
key: 1,
|
|
450
|
+
weight: "semibold",
|
|
451
|
+
truncate: "",
|
|
452
|
+
class: "wx-admin__title"
|
|
453
|
+
}, {
|
|
454
|
+
default: w(() => [
|
|
455
|
+
L(E(l.value), 1)
|
|
456
|
+
]),
|
|
457
|
+
_: 1
|
|
458
|
+
}))
|
|
459
|
+
], !0, 0),
|
|
460
|
+
_(Z, {
|
|
461
|
+
icon: "sidebar",
|
|
462
|
+
title: f(o) ? f(n)("nav.expand") : f(n)("nav.collapse"),
|
|
463
|
+
onClick: f(u)
|
|
464
|
+
}, null, 8, ["title", "onClick"])
|
|
465
|
+
], 2)
|
|
466
|
+
]),
|
|
467
|
+
bottom: w(() => [
|
|
468
|
+
A("div", ut, [
|
|
469
|
+
S(v.$slots, "user", {
|
|
470
|
+
expanded: !f(o)
|
|
471
|
+
}, void 0, !0)
|
|
472
|
+
])
|
|
473
|
+
]),
|
|
474
|
+
default: w(() => [
|
|
475
|
+
S(v.$slots, "nav", { collapsed: f(o) }, void 0, !0)
|
|
331
476
|
]),
|
|
332
477
|
_: 3
|
|
478
|
+
}, 8, ["collapsed"])) : z("", !0),
|
|
479
|
+
_(ve, {
|
|
480
|
+
padding: "none",
|
|
481
|
+
class: "wx-admin__screen"
|
|
482
|
+
}, {
|
|
483
|
+
default: w(() => [
|
|
484
|
+
_(M)
|
|
485
|
+
]),
|
|
486
|
+
_: 1
|
|
333
487
|
})
|
|
334
488
|
]),
|
|
335
489
|
_: 3
|
|
336
|
-
}),
|
|
337
|
-
|
|
338
|
-
open:
|
|
339
|
-
"onUpdate:open":
|
|
340
|
-
title:
|
|
490
|
+
}, 8, ["direction"]),
|
|
491
|
+
_(we, {
|
|
492
|
+
open: f(s),
|
|
493
|
+
"onUpdate:open": x[1] || (x[1] = (te) => ye(s) ? s.value = te : null),
|
|
494
|
+
title: l.value === "" ? f(n)("nav.menu") : l.value,
|
|
341
495
|
side: "left",
|
|
342
496
|
size: 260,
|
|
497
|
+
"full-screen": !1,
|
|
343
498
|
closable: ""
|
|
344
499
|
}, {
|
|
345
|
-
|
|
346
|
-
|
|
500
|
+
footer: w(() => [
|
|
501
|
+
A("div", dt, [
|
|
502
|
+
S(v.$slots, "user", { expanded: !0 }, void 0, !0)
|
|
503
|
+
])
|
|
504
|
+
]),
|
|
505
|
+
default: w(() => [
|
|
506
|
+
S(v.$slots, "nav", {
|
|
347
507
|
collapsed: !1,
|
|
348
|
-
|
|
349
|
-
(...L) => d(l) && d(l)(...L))
|
|
508
|
+
select: f(c)
|
|
350
509
|
}, void 0, !0)
|
|
351
510
|
]),
|
|
352
511
|
_: 3
|
|
353
512
|
}, 8, ["open", "title"])
|
|
354
|
-
],
|
|
513
|
+
], 2))
|
|
355
514
|
], 64);
|
|
356
515
|
};
|
|
357
516
|
}
|
|
358
|
-
}),
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
return o;
|
|
363
|
-
}, Se = /* @__PURE__ */ _e(xe, [["__scopeId", "data-v-9ef35d4d"]]);
|
|
364
|
-
class ke extends Error {
|
|
365
|
-
constructor(n, o, u = {}, f = null, m = null) {
|
|
366
|
-
super(n), this.status = o, this.errors = u, this.retryAfter = f, this.body = m, this.name = "HttpError";
|
|
517
|
+
}), ft = /* @__PURE__ */ N(ct, [["__scopeId", "data-v-ebc6adf3"]]);
|
|
518
|
+
class X extends Error {
|
|
519
|
+
constructor(t, n, a = {}, i = null, d = null) {
|
|
520
|
+
super(t), this.status = n, this.errors = a, this.retryAfter = i, this.body = d, this.name = "HttpError";
|
|
367
521
|
}
|
|
368
522
|
status;
|
|
369
523
|
errors;
|
|
@@ -380,86 +534,86 @@ class ke extends Error {
|
|
|
380
534
|
return this.status === 429;
|
|
381
535
|
}
|
|
382
536
|
}
|
|
383
|
-
const
|
|
384
|
-
function
|
|
385
|
-
const
|
|
386
|
-
let
|
|
387
|
-
async function r(
|
|
388
|
-
|
|
537
|
+
const mt = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]);
|
|
538
|
+
function ht(e = {}) {
|
|
539
|
+
const t = (e.baseUrl ?? "").replace(/\/$/, ""), n = e.csrfUrl ?? "/sanctum/csrf-cookie", a = e.fetch ?? globalThis.fetch.bind(globalThis), i = e.onUnauthenticated, d = e.headers;
|
|
540
|
+
let o = !1;
|
|
541
|
+
async function r(u = !1) {
|
|
542
|
+
o && !u && le("XSRF-TOKEN") !== null || (await a(n, { credentials: "same-origin" }), o = !0);
|
|
389
543
|
}
|
|
390
|
-
async function
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
const
|
|
544
|
+
async function s(u, c, l, m = {}, h = !1) {
|
|
545
|
+
const g = mt.has(u);
|
|
546
|
+
g && await r();
|
|
547
|
+
const v = {
|
|
394
548
|
Accept: "application/json",
|
|
395
549
|
"X-Requested-With": "XMLHttpRequest",
|
|
396
550
|
// Standing headers first, so a caller can still override one for a single request.
|
|
397
|
-
...
|
|
398
|
-
...
|
|
551
|
+
...d?.(),
|
|
552
|
+
...m.headers
|
|
399
553
|
};
|
|
400
|
-
if (
|
|
401
|
-
const
|
|
402
|
-
|
|
554
|
+
if (g) {
|
|
555
|
+
const M = le("XSRF-TOKEN");
|
|
556
|
+
M !== null && (v["X-XSRF-TOKEN"] = M);
|
|
403
557
|
}
|
|
404
|
-
|
|
405
|
-
const
|
|
406
|
-
method:
|
|
558
|
+
l !== void 0 && (v["Content-Type"] = "application/json");
|
|
559
|
+
const x = await a(vt(t, c, m.query), {
|
|
560
|
+
method: u,
|
|
407
561
|
credentials: "same-origin",
|
|
408
|
-
headers:
|
|
409
|
-
signal:
|
|
410
|
-
body:
|
|
562
|
+
headers: v,
|
|
563
|
+
signal: m.signal,
|
|
564
|
+
body: l === void 0 ? void 0 : JSON.stringify(l)
|
|
411
565
|
});
|
|
412
|
-
if (
|
|
413
|
-
return await r(!0),
|
|
414
|
-
if (
|
|
415
|
-
throw await
|
|
416
|
-
if (
|
|
417
|
-
return await
|
|
566
|
+
if (x.status === 419 && g && !h)
|
|
567
|
+
return await r(!0), s(u, c, l, m, !0);
|
|
568
|
+
if (x.status === 401 && i?.(), !x.ok)
|
|
569
|
+
throw await pt(x);
|
|
570
|
+
if (x.status !== 204)
|
|
571
|
+
return await x.json();
|
|
418
572
|
}
|
|
419
573
|
return {
|
|
420
|
-
get: (
|
|
421
|
-
post: (
|
|
422
|
-
put: (
|
|
423
|
-
patch: (
|
|
424
|
-
delete: (
|
|
574
|
+
get: (u, c) => s("GET", u, void 0, c),
|
|
575
|
+
post: (u, c, l) => s("POST", u, c, l),
|
|
576
|
+
put: (u, c, l) => s("PUT", u, c, l),
|
|
577
|
+
patch: (u, c, l) => s("PATCH", u, c, l),
|
|
578
|
+
delete: (u, c) => s("DELETE", u, void 0, c)
|
|
425
579
|
};
|
|
426
580
|
}
|
|
427
|
-
async function
|
|
428
|
-
let
|
|
581
|
+
async function pt(e) {
|
|
582
|
+
let t = null;
|
|
429
583
|
try {
|
|
430
|
-
|
|
584
|
+
t = await e.json();
|
|
431
585
|
} catch {
|
|
432
586
|
}
|
|
433
|
-
const
|
|
434
|
-
return new
|
|
435
|
-
|
|
587
|
+
const n = t ?? {}, a = typeof n.message == "string" && n.message !== "" ? n.message : e.statusText || `Request failed with ${e.status}`, i = n.errors !== null && typeof n.errors == "object" ? n.errors : {}, d = e.headers.get("Retry-After"), o = d === null ? null : Number.parseInt(d, 10);
|
|
588
|
+
return new X(
|
|
589
|
+
a,
|
|
436
590
|
e.status,
|
|
437
|
-
|
|
438
|
-
Number.isFinite(
|
|
439
|
-
|
|
591
|
+
i,
|
|
592
|
+
Number.isFinite(o) ? o : null,
|
|
593
|
+
t
|
|
440
594
|
);
|
|
441
595
|
}
|
|
442
|
-
function
|
|
443
|
-
const
|
|
444
|
-
if (
|
|
445
|
-
return
|
|
446
|
-
const
|
|
447
|
-
for (const [r,
|
|
448
|
-
|
|
449
|
-
const
|
|
450
|
-
return
|
|
596
|
+
function vt(e, t, n) {
|
|
597
|
+
const i = /^https?:\/\//i.test(t) ? t : `${e}/${t.replace(/^\//, "")}`;
|
|
598
|
+
if (n === void 0)
|
|
599
|
+
return i;
|
|
600
|
+
const d = new URLSearchParams();
|
|
601
|
+
for (const [r, s] of Object.entries(n))
|
|
602
|
+
s != null && d.set(r, String(s));
|
|
603
|
+
const o = d.toString();
|
|
604
|
+
return o === "" ? i : `${i}${i.includes("?") ? "&" : "?"}${o}`;
|
|
451
605
|
}
|
|
452
|
-
function
|
|
606
|
+
function le(e) {
|
|
453
607
|
if (typeof document > "u")
|
|
454
608
|
return null;
|
|
455
|
-
for (const
|
|
456
|
-
const [
|
|
457
|
-
if (
|
|
458
|
-
return decodeURIComponent(
|
|
609
|
+
for (const t of document.cookie.split(";")) {
|
|
610
|
+
const [n, ...a] = t.trim().split("=");
|
|
611
|
+
if (n === e)
|
|
612
|
+
return decodeURIComponent(a.join("="));
|
|
459
613
|
}
|
|
460
614
|
return null;
|
|
461
615
|
}
|
|
462
|
-
const
|
|
616
|
+
const ue = {
|
|
463
617
|
shell: {
|
|
464
618
|
loading: "Loading the panel…",
|
|
465
619
|
"error-title": "The panel could not start",
|
|
@@ -471,20 +625,57 @@ const Ue = {
|
|
|
471
625
|
sections: "Sections",
|
|
472
626
|
menu: "Menu",
|
|
473
627
|
collapse: "Collapse the menu",
|
|
474
|
-
|
|
628
|
+
expand: "Expand the menu",
|
|
629
|
+
language: "Language",
|
|
630
|
+
// The one menu group the panel names itself; a module's own group is named by the module.
|
|
631
|
+
system: "System"
|
|
632
|
+
},
|
|
633
|
+
// What a screen that edits one record offers whatever the record is: the way out of it, and
|
|
634
|
+
// the way to rename it. A module that opens an editor should not be inventing these.
|
|
635
|
+
editor: {
|
|
636
|
+
back: "Back",
|
|
637
|
+
rename: "Rename",
|
|
638
|
+
save: "Save"
|
|
639
|
+
},
|
|
640
|
+
// The page behind a '?'. Only the heading is the panel's: what the page says belongs to
|
|
641
|
+
// whatever is being explained, and travels with that module's own words.
|
|
642
|
+
help: {
|
|
643
|
+
title: "Help"
|
|
644
|
+
},
|
|
645
|
+
// When something happened, said the way a person would. The month names and the order of
|
|
646
|
+
// the parts come from `Intl` — only the words that no formatter knows are here.
|
|
647
|
+
dates: {
|
|
648
|
+
today: "today at :time",
|
|
649
|
+
yesterday: "yesterday at :time",
|
|
650
|
+
// Not an empty cell and not a dash: a column that says nothing leaves a reader wondering
|
|
651
|
+
// whether the panel failed to load it.
|
|
652
|
+
never: "never"
|
|
653
|
+
},
|
|
654
|
+
// How a request fails, in the panel's words rather than the server's (§13.3). `errors.ts`
|
|
655
|
+
// decides which of these a status gets.
|
|
656
|
+
errors: {
|
|
657
|
+
"signed-out": "You are signed out. Sign in again and try once more.",
|
|
658
|
+
forbidden: "You are not allowed to do that.",
|
|
659
|
+
gone: "It is not there any more — somebody may have deleted it.",
|
|
660
|
+
conflict: "Somebody changed this while you were working on it.",
|
|
661
|
+
throttled: "Too many attempts. Try again in a moment.",
|
|
662
|
+
"throttled-in": "Too many attempts. Try again in :seconds seconds.",
|
|
663
|
+
server: "The server could not do that. Try again in a moment.",
|
|
664
|
+
offline: "The server did not answer. Check the connection and try again.",
|
|
665
|
+
unknown: "That did not work."
|
|
475
666
|
}
|
|
476
|
-
},
|
|
477
|
-
function
|
|
478
|
-
const
|
|
479
|
-
for (const
|
|
480
|
-
|
|
481
|
-
const
|
|
482
|
-
history:
|
|
483
|
-
routes:
|
|
484
|
-
}), r =
|
|
667
|
+
}, de = "webx.locale";
|
|
668
|
+
function jt(e = {}) {
|
|
669
|
+
const t = e.manifestUrl ?? _t() ?? "/api/cms/manifest", n = e.apiPath ?? t.replace(/\/manifest\/?$/, ""), a = e.basePath ?? "/cms", i = e.modules ?? [], d = [...e.routes ?? []];
|
|
670
|
+
for (const v of i)
|
|
671
|
+
d.push(...v.routes ?? []);
|
|
672
|
+
const o = Se({
|
|
673
|
+
history: Te(a),
|
|
674
|
+
routes: d
|
|
675
|
+
}), r = Q({ locale: e.locale ?? wt() }), s = e.http ?? ht({
|
|
485
676
|
baseUrl: "",
|
|
486
677
|
onUnauthenticated: () => {
|
|
487
|
-
|
|
678
|
+
c.setUser(null), c.state.status = "unauthenticated";
|
|
488
679
|
},
|
|
489
680
|
// Every request says which language the panel is currently showing. It decides what
|
|
490
681
|
// the server writes its own messages in — a 422 under a field — for anybody who has
|
|
@@ -492,89 +683,237 @@ function He(e = {}) {
|
|
|
492
683
|
// signing in on a Russian sign-in screen lands in an English panel.
|
|
493
684
|
headers: () => ({ "X-Webx-Locale": r.state.locale })
|
|
494
685
|
});
|
|
495
|
-
r.defaults("webx-admin",
|
|
496
|
-
async function
|
|
497
|
-
const
|
|
498
|
-
r.load(
|
|
686
|
+
r.defaults("webx-admin", ue);
|
|
687
|
+
async function u(v) {
|
|
688
|
+
const x = await s.get(`${n}/translations/${v}`);
|
|
689
|
+
r.load(x.data.namespaces, x.data.locale, x.data.fallback), yt(x.data.locale), xt(x.data.locale, r.state.panelLocales);
|
|
499
690
|
}
|
|
500
|
-
const
|
|
501
|
-
http:
|
|
502
|
-
basePath:
|
|
503
|
-
apiPath:
|
|
504
|
-
modules:
|
|
691
|
+
const c = Je({
|
|
692
|
+
http: s,
|
|
693
|
+
basePath: a,
|
|
694
|
+
apiPath: n,
|
|
695
|
+
modules: i,
|
|
505
696
|
i18n: r,
|
|
506
|
-
loadDictionary:
|
|
697
|
+
loadDictionary: u,
|
|
507
698
|
types: e.types,
|
|
508
699
|
screens: e.screens,
|
|
509
|
-
loadManifest: async () => (await
|
|
510
|
-
}),
|
|
511
|
-
|
|
512
|
-
const
|
|
513
|
-
|
|
700
|
+
loadManifest: async () => (await s.get(t)).data
|
|
701
|
+
}), l = be(gt(e));
|
|
702
|
+
l.use(Ae), Qe(l, c), et(l, r);
|
|
703
|
+
const m = W("");
|
|
704
|
+
l.provide(Me, {
|
|
514
705
|
list: k(
|
|
515
|
-
() => r.state.contentLocales.map((
|
|
516
|
-
code:
|
|
517
|
-
label:
|
|
706
|
+
() => r.state.contentLocales.map((v) => ({
|
|
707
|
+
code: v.code,
|
|
708
|
+
label: v.code.toUpperCase()
|
|
518
709
|
}))
|
|
519
710
|
),
|
|
520
711
|
active: k({
|
|
521
|
-
get: () =>
|
|
522
|
-
set: (
|
|
523
|
-
|
|
712
|
+
get: () => m.value || (r.state.contentLocales[0]?.code ?? ""),
|
|
713
|
+
set: (v) => {
|
|
714
|
+
m.value = v;
|
|
524
715
|
}
|
|
525
716
|
})
|
|
526
717
|
});
|
|
527
|
-
const
|
|
528
|
-
app:
|
|
529
|
-
router:
|
|
530
|
-
context:
|
|
718
|
+
const h = {
|
|
719
|
+
app: l,
|
|
720
|
+
router: o,
|
|
721
|
+
context: c,
|
|
531
722
|
i18n: r,
|
|
532
723
|
async mount() {
|
|
533
|
-
await Promise.all([
|
|
534
|
-
}),
|
|
724
|
+
await Promise.all([g(), u(r.state.locale)]).catch(() => {
|
|
725
|
+
}), l.mount(e.el ?? "#webx-app"), await c.reload();
|
|
535
726
|
}
|
|
536
727
|
};
|
|
537
|
-
async function
|
|
538
|
-
const
|
|
539
|
-
r.state.panelLocales =
|
|
728
|
+
async function g() {
|
|
729
|
+
const v = await s.get(`${n}/locales`);
|
|
730
|
+
r.state.panelLocales = v.data.panel, r.state.contentLocales = v.data.content;
|
|
540
731
|
}
|
|
541
|
-
for (const
|
|
542
|
-
|
|
543
|
-
return
|
|
732
|
+
for (const v of e.plugins ?? [])
|
|
733
|
+
v.install(h);
|
|
734
|
+
return l.use(o), h;
|
|
544
735
|
}
|
|
545
|
-
function
|
|
546
|
-
const
|
|
736
|
+
function gt(e) {
|
|
737
|
+
const t = {
|
|
547
738
|
// The menu is the panel's own: it is the manifest, drawn.
|
|
548
|
-
|
|
739
|
+
// The shell hands in what a choice means where it drew the menu — in the drawer it is what
|
|
740
|
+
// closes it, and a drawer that stays open over the section it just opened is a drawer the
|
|
741
|
+
// reader has to dismiss by hand.
|
|
742
|
+
nav: (n) => P(nt, { collapsed: n.collapsed === !0, onSelect: n.select })
|
|
549
743
|
};
|
|
550
|
-
return e.brand !== void 0 && (
|
|
744
|
+
return e.brand !== void 0 && (t.brand = () => P(e.brand)), e.userMenu !== void 0 && (t.user = (n) => P(e.userMenu, { expanded: n.expanded === !0 })), { render: () => P(ft, null, t) };
|
|
551
745
|
}
|
|
552
|
-
function
|
|
553
|
-
const e =
|
|
746
|
+
function wt() {
|
|
747
|
+
const e = bt(de);
|
|
554
748
|
return e !== null ? e : typeof document < "u" && document.documentElement.lang !== "" ? document.documentElement.lang : typeof navigator > "u" ? "en" : navigator.language;
|
|
555
749
|
}
|
|
556
|
-
function
|
|
750
|
+
function yt(e) {
|
|
557
751
|
try {
|
|
558
|
-
localStorage.setItem(
|
|
752
|
+
localStorage.setItem(de, e);
|
|
559
753
|
} catch {
|
|
560
754
|
}
|
|
561
755
|
}
|
|
562
|
-
function
|
|
756
|
+
function bt(e) {
|
|
563
757
|
try {
|
|
564
758
|
return localStorage.getItem(e);
|
|
565
759
|
} catch {
|
|
566
760
|
return null;
|
|
567
761
|
}
|
|
568
762
|
}
|
|
569
|
-
function
|
|
570
|
-
typeof document > "u" || (document.documentElement.lang = e, document.documentElement.dir =
|
|
763
|
+
function xt(e, t) {
|
|
764
|
+
typeof document > "u" || (document.documentElement.lang = e, document.documentElement.dir = t.find((n) => n.code === e)?.direction ?? "ltr");
|
|
571
765
|
}
|
|
572
|
-
function
|
|
766
|
+
function _t() {
|
|
573
767
|
return typeof document > "u" ? null : document.querySelector('meta[name="webx-manifest"]')?.getAttribute("content") ?? null;
|
|
574
768
|
}
|
|
575
|
-
|
|
769
|
+
function kt(e) {
|
|
770
|
+
const t = e.replace(/\r\n?/g, `
|
|
771
|
+
`).split(`
|
|
772
|
+
`), n = [];
|
|
773
|
+
let a = 0;
|
|
774
|
+
for (; a < t.length; ) {
|
|
775
|
+
const i = t[a] ?? "";
|
|
776
|
+
if (i.trim() === "") {
|
|
777
|
+
a += 1;
|
|
778
|
+
continue;
|
|
779
|
+
}
|
|
780
|
+
if (/^```([\w-]*)\s*$/.exec(i)) {
|
|
781
|
+
const s = [];
|
|
782
|
+
for (a += 1; a < t.length && !/^```\s*$/.test(t[a] ?? ""); )
|
|
783
|
+
s.push(t[a] ?? ""), a += 1;
|
|
784
|
+
a += 1, n.push(`<pre><code>${Y(s.join(`
|
|
785
|
+
`))}</code></pre>`);
|
|
786
|
+
continue;
|
|
787
|
+
}
|
|
788
|
+
const o = /^(#{1,4})\s+(.*)$/.exec(i);
|
|
789
|
+
if (o) {
|
|
790
|
+
const s = Math.min(o[1].length + 1, 5);
|
|
791
|
+
n.push(`<h${s}>${H(o[2] ?? "")}</h${s}>`), a += 1;
|
|
792
|
+
continue;
|
|
793
|
+
}
|
|
794
|
+
if (B(i)) {
|
|
795
|
+
const s = /^\s*\d+[.)]\s+/.test(i), u = [];
|
|
796
|
+
for (; a < t.length && B(t[a] ?? ""); )
|
|
797
|
+
for (u.push((t[a] ?? "").replace(/^\s*(?:[-*+]|\d+[.)])\s+/, "")), a += 1; a < t.length; ) {
|
|
798
|
+
const l = t[a] ?? "";
|
|
799
|
+
if (l.trim() === "" || B(l) || /^(#{1,4})\s/.test(l) || /^```/.test(l))
|
|
800
|
+
break;
|
|
801
|
+
u[u.length - 1] += ` ${l.trim()}`, a += 1;
|
|
802
|
+
}
|
|
803
|
+
const c = s ? "ol" : "ul";
|
|
804
|
+
n.push(`<${c}>${u.map((l) => `<li>${H(l)}</li>`).join("")}</${c}>`);
|
|
805
|
+
continue;
|
|
806
|
+
}
|
|
807
|
+
const r = [];
|
|
808
|
+
for (; a < t.length; ) {
|
|
809
|
+
const s = t[a] ?? "";
|
|
810
|
+
if (s.trim() === "" || B(s) || /^(#{1,4})\s/.test(s) || /^```/.test(s)) break;
|
|
811
|
+
r.push(s.trim()), a += 1;
|
|
812
|
+
}
|
|
813
|
+
n.push(`<p>${H(r.join(" "))}</p>`);
|
|
814
|
+
}
|
|
815
|
+
return n.join("");
|
|
816
|
+
}
|
|
817
|
+
const R = "\0";
|
|
818
|
+
function B(e) {
|
|
819
|
+
return /^\s*(?:[-*+]|\d+[.)])\s+/.test(e);
|
|
820
|
+
}
|
|
821
|
+
function H(e) {
|
|
822
|
+
const t = [], n = e.replace(/`([^`]+)`/g, (i, d) => (t.push(`<code>${Y(d)}</code>`), `${R}${t.length - 1}${R}`));
|
|
823
|
+
return Y(n).replace(
|
|
824
|
+
/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,
|
|
825
|
+
'<a href="$2" target="_blank" rel="noopener">$1</a>'
|
|
826
|
+
).replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>").replace(
|
|
827
|
+
new RegExp(`${R}(\\d+)${R}`, "g"),
|
|
828
|
+
(i, d) => t[Number(d)] ?? ""
|
|
829
|
+
);
|
|
830
|
+
}
|
|
831
|
+
function Y(e) {
|
|
832
|
+
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
833
|
+
}
|
|
834
|
+
function $t(e) {
|
|
835
|
+
const t = e.scope("webx-admin"), n = /* @__PURE__ */ new Map();
|
|
836
|
+
function a(d, o, r) {
|
|
837
|
+
const s = e.state.locale, u = `${s}:${d}`;
|
|
838
|
+
let c = n.get(u);
|
|
839
|
+
return c === void 0 && (c = new Intl.DateTimeFormat(s, o), n.set(u, c)), c.format(r);
|
|
840
|
+
}
|
|
841
|
+
const i = (d) => a("time", { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }, d);
|
|
842
|
+
return {
|
|
843
|
+
short(d) {
|
|
844
|
+
const o = O(d);
|
|
845
|
+
if (o === null)
|
|
846
|
+
return t("dates.never");
|
|
847
|
+
const r = /* @__PURE__ */ new Date(), s = Lt(o, r);
|
|
848
|
+
return s === 0 ? t("dates.today", { time: i(o) }) : s === -1 ? t("dates.yesterday", { time: i(o) }) : o.getFullYear() === r.getFullYear() ? a(
|
|
849
|
+
"this-year",
|
|
850
|
+
{
|
|
851
|
+
day: "numeric",
|
|
852
|
+
month: "long",
|
|
853
|
+
hour: "2-digit",
|
|
854
|
+
minute: "2-digit",
|
|
855
|
+
hourCycle: "h23"
|
|
856
|
+
},
|
|
857
|
+
o
|
|
858
|
+
) : a("earlier", { day: "numeric", month: "long", year: "numeric" }, o);
|
|
859
|
+
},
|
|
860
|
+
exact(d) {
|
|
861
|
+
const o = O(d);
|
|
862
|
+
return o === null ? "" : a("exact", { dateStyle: "long", timeStyle: "medium", hourCycle: "h23" }, o);
|
|
863
|
+
},
|
|
864
|
+
iso(d) {
|
|
865
|
+
const o = O(d);
|
|
866
|
+
return o === null ? "" : o.toISOString();
|
|
867
|
+
}
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
function St() {
|
|
871
|
+
const e = V(j, null);
|
|
872
|
+
return $t(e ?? Tt());
|
|
873
|
+
}
|
|
874
|
+
let D = null;
|
|
875
|
+
function Tt() {
|
|
876
|
+
return D === null && (D = Q(), D.defaults("webx-admin", ue)), D;
|
|
877
|
+
}
|
|
878
|
+
function O(e) {
|
|
879
|
+
if (e == null || e === "")
|
|
880
|
+
return null;
|
|
881
|
+
const t = e instanceof Date ? e : new Date(e);
|
|
882
|
+
return Number.isNaN(t.getTime()) ? null : t;
|
|
883
|
+
}
|
|
884
|
+
function Lt(e, t) {
|
|
885
|
+
const n = (a) => Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());
|
|
886
|
+
return Math.round((n(e) - n(t)) / 864e5);
|
|
887
|
+
}
|
|
888
|
+
function Et(e, t, n) {
|
|
889
|
+
const a = e instanceof X ? e.status : zt(e);
|
|
890
|
+
if (a === 422)
|
|
891
|
+
return Ct(e) ?? n ?? t("errors.unknown");
|
|
892
|
+
if (a === 401) return t("errors.signed-out");
|
|
893
|
+
if (a === 403) return t("errors.forbidden");
|
|
894
|
+
if (a === 404) return t("errors.gone");
|
|
895
|
+
if (a === 409) return t("errors.conflict");
|
|
896
|
+
if (a === 429) {
|
|
897
|
+
const i = e instanceof X ? e.retryAfter : null;
|
|
898
|
+
return i === null ? t("errors.throttled") : t("errors.throttled-in", { seconds: i });
|
|
899
|
+
}
|
|
900
|
+
return a !== null && a >= 500 ? t("errors.server") : a === null ? t("errors.offline") : n ?? t("errors.unknown");
|
|
901
|
+
}
|
|
902
|
+
function Ht() {
|
|
903
|
+
const e = U("webx-admin");
|
|
904
|
+
return (t, n) => Et(t, e, n);
|
|
905
|
+
}
|
|
906
|
+
function zt(e) {
|
|
907
|
+
const t = e?.status;
|
|
908
|
+
return typeof t == "number" ? t : null;
|
|
909
|
+
}
|
|
910
|
+
function Ct(e) {
|
|
911
|
+
const n = e?.body?.message;
|
|
912
|
+
return typeof n == "string" && n !== "" ? n : null;
|
|
913
|
+
}
|
|
914
|
+
const Wt = { class: "wx-screen-host" }, Ot = /* @__PURE__ */ T({
|
|
576
915
|
__name: "Screen",
|
|
577
|
-
props: /* @__PURE__ */
|
|
916
|
+
props: /* @__PURE__ */ K({
|
|
578
917
|
name: {},
|
|
579
918
|
errors: { default: void 0 },
|
|
580
919
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -585,39 +924,39 @@ const Oe = { class: "wx-screen-host" }, Fe = /* @__PURE__ */ M({
|
|
|
585
924
|
modelValue: { default: () => ({}) },
|
|
586
925
|
modelModifiers: {}
|
|
587
926
|
}),
|
|
588
|
-
emits: /* @__PURE__ */
|
|
589
|
-
setup(e, { expose:
|
|
590
|
-
const
|
|
591
|
-
async function
|
|
592
|
-
|
|
927
|
+
emits: /* @__PURE__ */ K(["loaded"], ["update:modelValue"]),
|
|
928
|
+
setup(e, { expose: t, emit: n }) {
|
|
929
|
+
const a = e, i = n, d = se(e, "modelValue"), o = J(), r = U("webx-admin"), s = W(null), u = W(null);
|
|
930
|
+
async function c() {
|
|
931
|
+
s.value = null, u.value = null;
|
|
593
932
|
try {
|
|
594
|
-
const
|
|
595
|
-
|
|
596
|
-
} catch (
|
|
597
|
-
|
|
933
|
+
const l = await o.loadScreen(a.name);
|
|
934
|
+
s.value = l, i("loaded", l);
|
|
935
|
+
} catch (l) {
|
|
936
|
+
u.value = l instanceof Error ? l.message : String(l);
|
|
598
937
|
}
|
|
599
938
|
}
|
|
600
|
-
return
|
|
601
|
-
|
|
602
|
-
}, { immediate: !0 }),
|
|
603
|
-
|
|
939
|
+
return oe([() => a.name, () => o.i18n.state.locale], () => {
|
|
940
|
+
c();
|
|
941
|
+
}, { immediate: !0 }), t({ reload: c }), (l, m) => (p(), y("div", Wt, [
|
|
942
|
+
u.value ? (p(), b(f(Pe), {
|
|
604
943
|
key: 0,
|
|
605
944
|
type: "danger",
|
|
606
|
-
title:
|
|
607
|
-
description:
|
|
608
|
-
}, null, 8, ["title", "description"])) :
|
|
945
|
+
title: f(r)("shell.error-title"),
|
|
946
|
+
description: u.value
|
|
947
|
+
}, null, 8, ["title", "description"])) : s.value === null ? (p(), b(f(Re), {
|
|
609
948
|
key: 1,
|
|
610
949
|
rows: 4
|
|
611
|
-
})) : (
|
|
950
|
+
})) : (p(), b(f(Oe), {
|
|
612
951
|
key: 2,
|
|
613
|
-
modelValue:
|
|
614
|
-
"onUpdate:modelValue":
|
|
615
|
-
root:
|
|
616
|
-
patch:
|
|
617
|
-
types:
|
|
952
|
+
modelValue: d.value,
|
|
953
|
+
"onUpdate:modelValue": m[0] || (m[0] = (h) => d.value = h),
|
|
954
|
+
root: s.value,
|
|
955
|
+
patch: f(o).screenPatch(e.name),
|
|
956
|
+
types: f(o).types,
|
|
618
957
|
errors: e.errors,
|
|
619
|
-
translate:
|
|
620
|
-
can:
|
|
958
|
+
translate: f(o).i18n.t,
|
|
959
|
+
can: f(o).can,
|
|
621
960
|
disabled: e.disabled,
|
|
622
961
|
"label-position": e.labelPosition,
|
|
623
962
|
"label-width": e.labelWidth,
|
|
@@ -625,24 +964,251 @@ const Oe = { class: "wx-screen-host" }, Fe = /* @__PURE__ */ M({
|
|
|
625
964
|
}, null, 8, ["modelValue", "root", "patch", "types", "errors", "translate", "can", "disabled", "label-position", "label-width", "size"]))
|
|
626
965
|
]));
|
|
627
966
|
}
|
|
967
|
+
}), Ut = {
|
|
968
|
+
key: 0,
|
|
969
|
+
class: "wx-dropdown__divider"
|
|
970
|
+
}, Ft = /* @__PURE__ */ T({
|
|
971
|
+
__name: "RowMenu",
|
|
972
|
+
props: {
|
|
973
|
+
actions: {},
|
|
974
|
+
label: { default: void 0 },
|
|
975
|
+
size: { default: "sm" }
|
|
976
|
+
},
|
|
977
|
+
setup(e) {
|
|
978
|
+
const t = e, n = k(() => [
|
|
979
|
+
...t.actions.filter((i) => !i.danger),
|
|
980
|
+
...t.actions.filter((i) => i.danger)
|
|
981
|
+
]), a = k(() => {
|
|
982
|
+
const i = n.value.find((d) => d.danger);
|
|
983
|
+
return i && n.value[0] !== i ? i.key : null;
|
|
984
|
+
});
|
|
985
|
+
return (i, d) => n.value.length > 0 ? (p(), b(f(Be), {
|
|
986
|
+
key: 0,
|
|
987
|
+
collapse: "always",
|
|
988
|
+
align: "end",
|
|
989
|
+
size: e.size,
|
|
990
|
+
"aria-label": e.label,
|
|
991
|
+
onClick: d[0] || (d[0] = ie(() => {
|
|
992
|
+
}, ["stop"]))
|
|
993
|
+
}, {
|
|
994
|
+
collapsed: w(() => [
|
|
995
|
+
(p(!0), y(C, null, I(n.value, (o) => (p(), y(C, {
|
|
996
|
+
key: o.key
|
|
997
|
+
}, [
|
|
998
|
+
o.key === a.value ? (p(), y("hr", Ut)) : z("", !0),
|
|
999
|
+
_(f(De), {
|
|
1000
|
+
icon: o.icon,
|
|
1001
|
+
tone: o.danger ? "danger" : "default",
|
|
1002
|
+
href: o.href,
|
|
1003
|
+
target: o.href ? o.target ?? "_blank" : void 0,
|
|
1004
|
+
disabled: o.disabled,
|
|
1005
|
+
onClick: (r) => o.run?.()
|
|
1006
|
+
}, {
|
|
1007
|
+
default: w(() => [
|
|
1008
|
+
L(E(o.label), 1)
|
|
1009
|
+
]),
|
|
1010
|
+
_: 2
|
|
1011
|
+
}, 1032, ["icon", "tone", "href", "target", "disabled", "onClick"])
|
|
1012
|
+
], 64))), 128))
|
|
1013
|
+
]),
|
|
1014
|
+
_: 1
|
|
1015
|
+
}, 8, ["size", "aria-label"])) : z("", !0);
|
|
1016
|
+
}
|
|
1017
|
+
}), Kt = /* @__PURE__ */ T({
|
|
1018
|
+
__name: "BackButton",
|
|
1019
|
+
props: {
|
|
1020
|
+
to: {},
|
|
1021
|
+
label: { default: void 0 },
|
|
1022
|
+
size: { default: "sm" }
|
|
1023
|
+
},
|
|
1024
|
+
setup(e) {
|
|
1025
|
+
const t = e, n = U("webx-admin"), a = k(() => t.label ?? n("editor.back"));
|
|
1026
|
+
return (i, d) => (p(), b(f(G), {
|
|
1027
|
+
icon: "arrow-left",
|
|
1028
|
+
class: "wx-back-button",
|
|
1029
|
+
as: f(Le),
|
|
1030
|
+
to: e.to,
|
|
1031
|
+
title: a.value,
|
|
1032
|
+
size: e.size,
|
|
1033
|
+
"tooltip-side": "bottom"
|
|
1034
|
+
}, null, 8, ["as", "to", "title", "size"]));
|
|
1035
|
+
}
|
|
1036
|
+
}), At = { class: "wx-rename__footer" }, Mt = /* @__PURE__ */ T({
|
|
1037
|
+
__name: "RenameButton",
|
|
1038
|
+
props: {
|
|
1039
|
+
name: { default: "" },
|
|
1040
|
+
label: { default: void 0 },
|
|
1041
|
+
placeholder: { default: void 0 },
|
|
1042
|
+
disabled: { type: Boolean, default: !1 },
|
|
1043
|
+
size: { default: "sm" }
|
|
1044
|
+
},
|
|
1045
|
+
emits: ["rename"],
|
|
1046
|
+
setup(e, { emit: t }) {
|
|
1047
|
+
const n = e, a = t, i = U("webx-admin"), d = W(!1), o = W(n.name), r = W(null), s = k(() => n.label ?? i("editor.rename"));
|
|
1048
|
+
oe(d, async (c) => {
|
|
1049
|
+
c && (o.value = n.name, await xe(), r.value?.focus(), r.value?.select());
|
|
1050
|
+
});
|
|
1051
|
+
function u() {
|
|
1052
|
+
const c = o.value.trim();
|
|
1053
|
+
if (c === "" || c === n.name) {
|
|
1054
|
+
d.value = !1;
|
|
1055
|
+
return;
|
|
1056
|
+
}
|
|
1057
|
+
a("rename", c), d.value = !1;
|
|
1058
|
+
}
|
|
1059
|
+
return (c, l) => (p(), b(f(Ie), {
|
|
1060
|
+
open: d.value,
|
|
1061
|
+
"onUpdate:open": l[2] || (l[2] = (m) => d.value = m),
|
|
1062
|
+
title: s.value,
|
|
1063
|
+
width: 320,
|
|
1064
|
+
side: "bottom",
|
|
1065
|
+
align: "start",
|
|
1066
|
+
teleport: ""
|
|
1067
|
+
}, {
|
|
1068
|
+
trigger: w(() => [
|
|
1069
|
+
_(f(G), {
|
|
1070
|
+
type: "edit",
|
|
1071
|
+
title: s.value,
|
|
1072
|
+
size: e.size,
|
|
1073
|
+
disabled: e.disabled
|
|
1074
|
+
}, null, 8, ["title", "size", "disabled"])
|
|
1075
|
+
]),
|
|
1076
|
+
default: w(() => [
|
|
1077
|
+
A("form", {
|
|
1078
|
+
class: "wx-rename",
|
|
1079
|
+
onSubmit: ie(u, ["prevent"])
|
|
1080
|
+
}, [
|
|
1081
|
+
_(f(Ve), {
|
|
1082
|
+
ref_key: "field",
|
|
1083
|
+
ref: r,
|
|
1084
|
+
modelValue: o.value,
|
|
1085
|
+
"onUpdate:modelValue": l[0] || (l[0] = (m) => o.value = m),
|
|
1086
|
+
"aria-label": s.value,
|
|
1087
|
+
placeholder: e.placeholder,
|
|
1088
|
+
onKeydown: l[1] || (l[1] = _e((m) => d.value = !1, ["esc"]))
|
|
1089
|
+
}, null, 8, ["modelValue", "aria-label", "placeholder"]),
|
|
1090
|
+
A("div", At, [
|
|
1091
|
+
_(f(Ne), {
|
|
1092
|
+
type: "primary",
|
|
1093
|
+
size: "sm",
|
|
1094
|
+
"native-type": "submit"
|
|
1095
|
+
}, {
|
|
1096
|
+
default: w(() => [
|
|
1097
|
+
L(E(f(i)("editor.save")), 1)
|
|
1098
|
+
]),
|
|
1099
|
+
_: 1
|
|
1100
|
+
})
|
|
1101
|
+
])
|
|
1102
|
+
], 32)
|
|
1103
|
+
]),
|
|
1104
|
+
_: 1
|
|
1105
|
+
}, 8, ["open", "title"]));
|
|
1106
|
+
}
|
|
1107
|
+
}), qt = /* @__PURE__ */ N(Mt, [["__scopeId", "data-v-d879e8d3"]]), Pt = ["innerHTML"], Rt = /* @__PURE__ */ T({
|
|
1108
|
+
__name: "HelpButton",
|
|
1109
|
+
props: {
|
|
1110
|
+
body: {},
|
|
1111
|
+
title: { default: void 0 },
|
|
1112
|
+
label: { default: void 0 },
|
|
1113
|
+
size: { default: "sm" },
|
|
1114
|
+
width: { default: 720 }
|
|
1115
|
+
},
|
|
1116
|
+
setup(e) {
|
|
1117
|
+
const t = e, n = U("webx-admin"), a = W(!1), i = k(() => t.title ?? n("help.title")), d = k(() => kt(t.body));
|
|
1118
|
+
return (o, r) => (p(), y(C, null, [
|
|
1119
|
+
_(f(G), {
|
|
1120
|
+
type: "details",
|
|
1121
|
+
icon: "question",
|
|
1122
|
+
tone: "neutral",
|
|
1123
|
+
size: e.size,
|
|
1124
|
+
title: e.label ?? i.value,
|
|
1125
|
+
onClick: r[0] || (r[0] = (s) => a.value = !0)
|
|
1126
|
+
}, null, 8, ["size", "title"]),
|
|
1127
|
+
_(f(je), {
|
|
1128
|
+
open: a.value,
|
|
1129
|
+
"onUpdate:open": r[1] || (r[1] = (s) => a.value = s),
|
|
1130
|
+
title: i.value,
|
|
1131
|
+
width: e.width
|
|
1132
|
+
}, {
|
|
1133
|
+
default: w(() => [
|
|
1134
|
+
A("div", {
|
|
1135
|
+
class: "wx-help",
|
|
1136
|
+
innerHTML: d.value
|
|
1137
|
+
}, null, 8, Pt)
|
|
1138
|
+
]),
|
|
1139
|
+
_: 1
|
|
1140
|
+
}, 8, ["open", "title", "width"])
|
|
1141
|
+
], 64));
|
|
1142
|
+
}
|
|
1143
|
+
}), Xt = /* @__PURE__ */ N(Rt, [["__scopeId", "data-v-6c280d42"]]), Yt = /* @__PURE__ */ T({
|
|
1144
|
+
name: "WxDate",
|
|
1145
|
+
__name: "DateText",
|
|
1146
|
+
props: {
|
|
1147
|
+
value: {},
|
|
1148
|
+
size: { default: "sm" },
|
|
1149
|
+
tone: { default: "muted" }
|
|
1150
|
+
},
|
|
1151
|
+
setup(e) {
|
|
1152
|
+
const t = e, n = St(), a = k(() => n.short(t.value)), i = k(() => n.exact(t.value)), d = k(() => n.iso(t.value));
|
|
1153
|
+
return (o, r) => i.value ? (p(), b(f(He), {
|
|
1154
|
+
key: 0,
|
|
1155
|
+
content: i.value
|
|
1156
|
+
}, {
|
|
1157
|
+
default: w(() => [
|
|
1158
|
+
_(f(ae), {
|
|
1159
|
+
as: "time",
|
|
1160
|
+
datetime: d.value,
|
|
1161
|
+
size: e.size,
|
|
1162
|
+
tone: e.tone
|
|
1163
|
+
}, {
|
|
1164
|
+
default: w(() => [
|
|
1165
|
+
L(E(a.value), 1)
|
|
1166
|
+
]),
|
|
1167
|
+
_: 1
|
|
1168
|
+
}, 8, ["datetime", "size", "tone"])
|
|
1169
|
+
]),
|
|
1170
|
+
_: 1
|
|
1171
|
+
}, 8, ["content"])) : (p(), b(f(ae), {
|
|
1172
|
+
key: 1,
|
|
1173
|
+
size: e.size,
|
|
1174
|
+
tone: e.tone
|
|
1175
|
+
}, {
|
|
1176
|
+
default: w(() => [
|
|
1177
|
+
L(E(a.value), 1)
|
|
1178
|
+
]),
|
|
1179
|
+
_: 1
|
|
1180
|
+
}, 8, ["size", "tone"]));
|
|
1181
|
+
}
|
|
628
1182
|
});
|
|
629
1183
|
export {
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
1184
|
+
nt as AdminNav,
|
|
1185
|
+
ft as AdminShell,
|
|
1186
|
+
X as HttpError,
|
|
1187
|
+
Kt as WxBackButton,
|
|
1188
|
+
Yt as WxDate,
|
|
1189
|
+
Xt as WxHelpButton,
|
|
1190
|
+
Ye as WxListScreen,
|
|
1191
|
+
qt as WxRenameButton,
|
|
1192
|
+
Ft as WxRowMenu,
|
|
1193
|
+
Ot as WxScreen,
|
|
1194
|
+
re as adminKey,
|
|
1195
|
+
ue as adminMessages,
|
|
1196
|
+
Ge as adminTypes,
|
|
1197
|
+
jt as createAdmin,
|
|
1198
|
+
Je as createAdminContext,
|
|
1199
|
+
$t as createDates,
|
|
1200
|
+
ht as createHttp,
|
|
1201
|
+
Q as createI18n,
|
|
1202
|
+
Et as errorText,
|
|
1203
|
+
j as i18nKey,
|
|
1204
|
+
Qe as provideAdmin,
|
|
1205
|
+
et as provideI18n,
|
|
1206
|
+
le as readCookie,
|
|
1207
|
+
kt as renderMarkdown,
|
|
1208
|
+
J as useAdmin,
|
|
1209
|
+
St as useDates,
|
|
1210
|
+
Ht as useErrorText,
|
|
1211
|
+
Nt as useI18n,
|
|
1212
|
+
U as useTranslate
|
|
647
1213
|
};
|
|
648
1214
|
//# sourceMappingURL=index.js.map
|