@webx-ui/module-admin 0.5.0 → 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/dist/AdminShell.d.ts +9 -3
- package/dist/BackButton.d.ts +25 -0
- package/dist/HelpButton.d.ts +31 -0
- package/dist/RenameButton.d.ts +163 -0
- package/dist/admin.d.ts +9 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +702 -488
- package/dist/index.js.map +1 -1
- package/dist/markdown.d.ts +14 -0
- package/dist/style.css +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRouter as
|
|
3
|
-
import { WxHeading as
|
|
4
|
-
import { WxScreenRenderer as
|
|
5
|
-
const
|
|
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
6
|
key: 0,
|
|
7
7
|
class: "wx-list-screen__head"
|
|
8
|
-
},
|
|
8
|
+
}, qe = {
|
|
9
9
|
key: 1,
|
|
10
10
|
class: "wx-list-screen__actions"
|
|
11
|
-
},
|
|
11
|
+
}, Xe = /* @__PURE__ */ T({
|
|
12
12
|
__name: "ListScreen",
|
|
13
|
-
props: /* @__PURE__ */
|
|
13
|
+
props: /* @__PURE__ */ K({
|
|
14
14
|
title: { default: void 0 },
|
|
15
15
|
views: { default: void 0 },
|
|
16
16
|
card: { type: Boolean, default: !0 },
|
|
@@ -23,158 +23,161 @@ const We = ["data-wx-fill"], Me = {
|
|
|
23
23
|
}),
|
|
24
24
|
emits: ["update:view"],
|
|
25
25
|
setup(e) {
|
|
26
|
-
const t =
|
|
27
|
-
return (n,
|
|
28
|
-
class:
|
|
26
|
+
const t = se(e, "view");
|
|
27
|
+
return (n, a) => (p(), y("div", {
|
|
28
|
+
class: F(["wx-list-screen", { "is-fill": e.fill }]),
|
|
29
29
|
"data-wx-fill": e.fill ? "" : void 0
|
|
30
30
|
}, [
|
|
31
|
-
e.title || n.$slots.actions ? (
|
|
32
|
-
e.title ? (
|
|
31
|
+
e.title || n.$slots.actions ? (p(), y("div", Ke, [
|
|
32
|
+
e.title ? (p(), b(f(Ee), {
|
|
33
33
|
key: 0,
|
|
34
34
|
level: 2,
|
|
35
35
|
class: "wx-list-screen__title"
|
|
36
36
|
}, {
|
|
37
|
-
default:
|
|
38
|
-
|
|
37
|
+
default: w(() => [
|
|
38
|
+
L(E(e.title), 1)
|
|
39
39
|
]),
|
|
40
40
|
_: 1
|
|
41
|
-
})) :
|
|
42
|
-
n.$slots.actions ? (
|
|
43
|
-
|
|
44
|
-
])) :
|
|
45
|
-
])) :
|
|
46
|
-
e.views && e.views.length > 0 ? (
|
|
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
47
|
key: 1,
|
|
48
48
|
modelValue: t.value,
|
|
49
|
-
"onUpdate:modelValue":
|
|
49
|
+
"onUpdate:modelValue": a[0] || (a[0] = (i) => t.value = i),
|
|
50
50
|
class: "wx-list-screen__views",
|
|
51
51
|
items: e.views,
|
|
52
52
|
"collapse-below": e.collapseBelow,
|
|
53
53
|
"aria-label": e.title
|
|
54
54
|
}, {
|
|
55
|
-
default:
|
|
56
|
-
e.card ? (
|
|
55
|
+
default: w(() => [
|
|
56
|
+
e.card ? (p(), b(f(ne), {
|
|
57
57
|
key: 0,
|
|
58
58
|
class: "wx-list-screen__card",
|
|
59
59
|
padding: e.padding
|
|
60
60
|
}, {
|
|
61
|
-
default:
|
|
62
|
-
|
|
61
|
+
default: w(() => [
|
|
62
|
+
S(n.$slots, "default", {}, void 0, !0)
|
|
63
63
|
]),
|
|
64
64
|
_: 3
|
|
65
|
-
}, 8, ["padding"])) :
|
|
65
|
+
}, 8, ["padding"])) : S(n.$slots, "default", {}, void 0, !0, 1)
|
|
66
66
|
]),
|
|
67
67
|
_: 3
|
|
68
|
-
}, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (
|
|
69
|
-
e.card ? (
|
|
68
|
+
}, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (p(), y(C, { key: 2 }, [
|
|
69
|
+
e.card ? (p(), b(f(ne), {
|
|
70
70
|
key: 0,
|
|
71
71
|
class: "wx-list-screen__card",
|
|
72
72
|
padding: e.padding
|
|
73
73
|
}, {
|
|
74
|
-
default:
|
|
75
|
-
|
|
74
|
+
default: w(() => [
|
|
75
|
+
S(n.$slots, "default", {}, void 0, !0)
|
|
76
76
|
]),
|
|
77
77
|
_: 3
|
|
78
|
-
}, 8, ["padding"])) :
|
|
78
|
+
}, 8, ["padding"])) : S(n.$slots, "default", {}, void 0, !0, 1)
|
|
79
79
|
], 64))
|
|
80
|
-
], 10,
|
|
80
|
+
], 10, Fe));
|
|
81
81
|
}
|
|
82
|
-
}),
|
|
82
|
+
}), N = (e, t) => {
|
|
83
83
|
const n = e.__vccOpts || e;
|
|
84
|
-
for (const [
|
|
85
|
-
n[
|
|
84
|
+
for (const [a, i] of t)
|
|
85
|
+
n[a] = i;
|
|
86
86
|
return n;
|
|
87
|
-
},
|
|
88
|
-
"wx-list": { component:
|
|
89
|
-
},
|
|
90
|
-
function
|
|
91
|
-
const e =
|
|
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);
|
|
92
92
|
if (e === null)
|
|
93
93
|
throw new Error("useAdmin() was called outside a panel created by createAdmin().");
|
|
94
94
|
return e;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
const t =
|
|
96
|
+
function Je(e) {
|
|
97
|
+
const t = q({
|
|
98
98
|
status: "loading",
|
|
99
99
|
manifest: null,
|
|
100
100
|
user: null,
|
|
101
101
|
error: null
|
|
102
102
|
}), n = k(() => {
|
|
103
|
-
const
|
|
104
|
-
if (
|
|
103
|
+
const l = t.manifest;
|
|
104
|
+
if (l === null)
|
|
105
105
|
return [];
|
|
106
|
-
const
|
|
107
|
-
for (const h of
|
|
108
|
-
const
|
|
109
|
-
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)
|
|
110
110
|
continue;
|
|
111
|
-
const
|
|
112
|
-
|
|
111
|
+
const v = g.path ?? g.routes?.[0]?.path;
|
|
112
|
+
v !== void 0 && m.push({
|
|
113
113
|
id: h.id,
|
|
114
114
|
title: h.title,
|
|
115
115
|
icon: h.icon,
|
|
116
|
-
path:
|
|
116
|
+
path: v,
|
|
117
117
|
group: h.group ?? null
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
|
-
return
|
|
121
|
-
}),
|
|
122
|
-
const
|
|
123
|
-
for (const
|
|
124
|
-
if (
|
|
125
|
-
const
|
|
126
|
-
|
|
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);
|
|
127
127
|
} else
|
|
128
|
-
|
|
128
|
+
m.push(g);
|
|
129
129
|
return {
|
|
130
|
-
top:
|
|
131
|
-
groups:
|
|
132
|
-
id:
|
|
133
|
-
title:
|
|
134
|
-
entries: h.get(
|
|
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) ?? []
|
|
135
135
|
}))
|
|
136
136
|
};
|
|
137
|
-
}),
|
|
138
|
-
for (const
|
|
139
|
-
Object.assign(
|
|
140
|
-
Object.assign(
|
|
141
|
-
const
|
|
142
|
-
async function
|
|
143
|
-
const
|
|
144
|
-
let h =
|
|
145
|
-
return h === void 0 && (h = e.http.get(`${e.apiPath}/screens/${
|
|
146
|
-
throw
|
|
147
|
-
}),
|
|
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;
|
|
148
148
|
}
|
|
149
|
-
let
|
|
150
|
-
async function
|
|
149
|
+
let r = null;
|
|
150
|
+
async function s() {
|
|
151
151
|
t.status = "loading", t.error = null;
|
|
152
152
|
try {
|
|
153
|
-
if (
|
|
153
|
+
if (r !== null && (t.user = await r(), t.user === null)) {
|
|
154
154
|
t.manifest = null, t.status = "unauthenticated";
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
|
-
const
|
|
158
|
-
t.manifest =
|
|
159
|
-
} catch (
|
|
160
|
-
if (
|
|
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
161
|
t.manifest = null, t.user = null, t.status = "unauthenticated";
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
t.error =
|
|
164
|
+
t.error = l instanceof Error ? l.message : String(l), t.status = "error";
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
async function
|
|
168
|
-
if (
|
|
169
|
-
e.i18n.state.locale = a;
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
if (await e.loadDictionary(a), t.manifest !== null)
|
|
167
|
+
async function u() {
|
|
168
|
+
if (t.manifest !== null)
|
|
173
169
|
try {
|
|
174
170
|
t.manifest = await e.loadManifest();
|
|
175
171
|
} catch {
|
|
176
172
|
}
|
|
177
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
|
+
}
|
|
178
181
|
return {
|
|
179
182
|
http: e.http,
|
|
180
183
|
basePath: e.basePath,
|
|
@@ -183,130 +186,131 @@ function Ie(e) {
|
|
|
183
186
|
i18n: e.i18n,
|
|
184
187
|
modules: e.modules,
|
|
185
188
|
nav: n,
|
|
186
|
-
groups:
|
|
187
|
-
types:
|
|
188
|
-
reload:
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
189
|
+
groups: a,
|
|
190
|
+
types: i,
|
|
191
|
+
reload: s,
|
|
192
|
+
refreshManifest: u,
|
|
193
|
+
setLocale: c,
|
|
194
|
+
setUser(l) {
|
|
195
|
+
t.user = l;
|
|
192
196
|
},
|
|
193
|
-
useSessionLoader(
|
|
194
|
-
|
|
197
|
+
useSessionLoader(l) {
|
|
198
|
+
r = l;
|
|
195
199
|
},
|
|
196
|
-
can(
|
|
197
|
-
const
|
|
198
|
-
return
|
|
200
|
+
can(l) {
|
|
201
|
+
const m = t.user;
|
|
202
|
+
return m === null ? !1 : m.isSuper || m.permissions.includes(l);
|
|
199
203
|
},
|
|
200
|
-
loadScreen:
|
|
201
|
-
screenPatch(
|
|
202
|
-
return e.screens?.[
|
|
204
|
+
loadScreen: o,
|
|
205
|
+
screenPatch(l) {
|
|
206
|
+
return e.screens?.[l] ?? [];
|
|
203
207
|
}
|
|
204
208
|
};
|
|
205
209
|
}
|
|
206
|
-
function
|
|
207
|
-
e.provide(
|
|
210
|
+
function Qe(e, t) {
|
|
211
|
+
e.provide(re, t);
|
|
208
212
|
}
|
|
209
|
-
function
|
|
213
|
+
function Ze(e) {
|
|
210
214
|
return typeof e == "object" && e !== null && "status" in e && e.status === 401;
|
|
211
215
|
}
|
|
212
|
-
const
|
|
213
|
-
function
|
|
214
|
-
const e =
|
|
216
|
+
const j = /* @__PURE__ */ Symbol("webx-i18n");
|
|
217
|
+
function Nt() {
|
|
218
|
+
const e = V(j, null);
|
|
215
219
|
if (e === null)
|
|
216
220
|
throw new Error("useI18n() was called outside a panel created by createAdmin().");
|
|
217
221
|
return e;
|
|
218
222
|
}
|
|
219
|
-
function
|
|
220
|
-
const t =
|
|
221
|
-
return t === null ?
|
|
223
|
+
function U(e) {
|
|
224
|
+
const t = V(j, null);
|
|
225
|
+
return t === null ? Q().scope(e) : t.scope(e);
|
|
222
226
|
}
|
|
223
|
-
function
|
|
224
|
-
e.provide(
|
|
227
|
+
function et(e, t) {
|
|
228
|
+
e.provide(j, t);
|
|
225
229
|
}
|
|
226
|
-
function
|
|
227
|
-
const t = e.fallback ?? "en", n =
|
|
230
|
+
function Q(e = {}) {
|
|
231
|
+
const t = e.fallback ?? "en", n = q({
|
|
228
232
|
locale: e.locale ?? t,
|
|
229
233
|
fallback: t,
|
|
230
234
|
panelLocales: [],
|
|
231
235
|
contentLocales: []
|
|
232
|
-
}),
|
|
233
|
-
function
|
|
234
|
-
let
|
|
235
|
-
for (const
|
|
236
|
-
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)
|
|
237
241
|
return null;
|
|
238
|
-
|
|
242
|
+
c = c[l];
|
|
239
243
|
}
|
|
240
|
-
return typeof
|
|
244
|
+
return typeof c == "string" ? c : null;
|
|
241
245
|
}
|
|
242
|
-
function
|
|
243
|
-
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
|
|
244
248
|
// label says nothing to anybody trying to fix it.
|
|
245
|
-
|
|
246
|
-
return
|
|
249
|
+
s;
|
|
250
|
+
return u === void 0 ? h : tt(h, u);
|
|
247
251
|
}
|
|
248
252
|
return {
|
|
249
253
|
state: n,
|
|
250
|
-
defaults(
|
|
251
|
-
|
|
254
|
+
defaults(r, s) {
|
|
255
|
+
a[r] = { ...a[r], ...s };
|
|
252
256
|
},
|
|
253
|
-
load(
|
|
254
|
-
|
|
257
|
+
load(r, s, u) {
|
|
258
|
+
i.value = r ?? {}, n.locale = s ?? n.locale, u !== void 0 && (n.fallback = u);
|
|
255
259
|
},
|
|
256
|
-
scope(
|
|
257
|
-
return (
|
|
260
|
+
scope(r) {
|
|
261
|
+
return (s, u) => o(r, s, u);
|
|
258
262
|
},
|
|
259
|
-
t: (
|
|
263
|
+
t: (r, s) => o("", r, s)
|
|
260
264
|
};
|
|
261
265
|
}
|
|
262
|
-
function
|
|
266
|
+
function tt(e, t) {
|
|
263
267
|
let n = e;
|
|
264
|
-
for (const [
|
|
265
|
-
n = n.replaceAll(`:${
|
|
268
|
+
for (const [a, i] of Object.entries(t))
|
|
269
|
+
n = n.replaceAll(`:${a}`, String(i));
|
|
266
270
|
return n;
|
|
267
271
|
}
|
|
268
|
-
const
|
|
272
|
+
const nt = /* @__PURE__ */ T({
|
|
269
273
|
__name: "AdminNav",
|
|
270
274
|
props: {
|
|
271
275
|
collapsed: { type: Boolean }
|
|
272
276
|
},
|
|
273
277
|
emits: ["select"],
|
|
274
278
|
setup(e, { emit: t }) {
|
|
275
|
-
const n = t,
|
|
276
|
-
get: () =>
|
|
277
|
-
set: (
|
|
278
|
-
const
|
|
279
|
-
|
|
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);
|
|
280
284
|
}
|
|
281
285
|
});
|
|
282
|
-
return (
|
|
283
|
-
const
|
|
284
|
-
return
|
|
285
|
-
modelValue:
|
|
286
|
-
"onUpdate:modelValue":
|
|
286
|
+
return (s, u) => {
|
|
287
|
+
const c = $("wx-menu-item"), l = $("wx-submenu"), m = $("wx-menu");
|
|
288
|
+
return p(), b(m, {
|
|
289
|
+
modelValue: r.value,
|
|
290
|
+
"onUpdate:modelValue": u[0] || (u[0] = (h) => r.value = h),
|
|
287
291
|
collapsed: e.collapsed,
|
|
288
|
-
label: f(
|
|
289
|
-
onSelect:
|
|
292
|
+
label: f(i)("nav.sections"),
|
|
293
|
+
onSelect: u[1] || (u[1] = (h) => n("select"))
|
|
290
294
|
}, {
|
|
291
|
-
default:
|
|
292
|
-
(
|
|
293
|
-
key:
|
|
294
|
-
value:
|
|
295
|
-
icon:
|
|
296
|
-
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
|
|
297
301
|
}, null, 8, ["value", "icon", "label"]))), 128)),
|
|
298
|
-
(
|
|
299
|
-
key:
|
|
300
|
-
value: `group:${
|
|
301
|
-
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,
|
|
302
306
|
icon: "gear"
|
|
303
307
|
}, {
|
|
304
|
-
default:
|
|
305
|
-
(
|
|
306
|
-
key:
|
|
307
|
-
value:
|
|
308
|
-
icon:
|
|
309
|
-
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
|
|
310
314
|
}, null, 8, ["value", "icon", "label"]))), 128))
|
|
311
315
|
]),
|
|
312
316
|
_: 2
|
|
@@ -316,64 +320,64 @@ const Be = /* @__PURE__ */ A({
|
|
|
316
320
|
}, 8, ["modelValue", "collapsed", "label"]);
|
|
317
321
|
};
|
|
318
322
|
}
|
|
319
|
-
}),
|
|
323
|
+
}), at = {
|
|
320
324
|
key: 0,
|
|
321
325
|
class: "wx-root wx-admin-plain"
|
|
322
|
-
},
|
|
326
|
+
}, lt = {
|
|
323
327
|
key: 1,
|
|
324
328
|
class: "wx-root wx-admin-plain"
|
|
325
|
-
},
|
|
329
|
+
}, st = {
|
|
326
330
|
key: 2,
|
|
327
331
|
class: "wx-root wx-admin-plain"
|
|
328
|
-
},
|
|
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({
|
|
329
333
|
__name: "AdminShell",
|
|
330
334
|
setup(e) {
|
|
331
|
-
const t =
|
|
332
|
-
|
|
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,
|
|
333
337
|
{ persist: "webx-admin-shell" }
|
|
334
|
-
),
|
|
335
|
-
return (
|
|
336
|
-
const
|
|
337
|
-
return
|
|
338
|
-
|
|
339
|
-
f(t).state.status === "unauthenticated" ? (
|
|
340
|
-
|
|
341
|
-
])) : f(t).state.status === "loading" ? (
|
|
342
|
-
|
|
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, {
|
|
343
347
|
label: f(n)("shell.loading")
|
|
344
348
|
}, null, 8, ["label"])
|
|
345
|
-
])) : f(t).state.status === "error" ? (
|
|
346
|
-
|
|
349
|
+
])) : f(t).state.status === "error" ? (p(), y("div", st, [
|
|
350
|
+
_(me, {
|
|
347
351
|
status: "error",
|
|
348
352
|
title: f(n)("shell.error-title"),
|
|
349
353
|
description: f(t).state.error
|
|
350
354
|
}, {
|
|
351
|
-
default:
|
|
352
|
-
|
|
355
|
+
default: w(() => [
|
|
356
|
+
_(fe, {
|
|
353
357
|
type: "primary",
|
|
354
|
-
onClick: x[0] || (x[0] = (
|
|
358
|
+
onClick: x[0] || (x[0] = (te) => f(t).reload())
|
|
355
359
|
}, {
|
|
356
|
-
default:
|
|
357
|
-
|
|
360
|
+
default: w(() => [
|
|
361
|
+
L(E(f(n)("shell.retry")), 1)
|
|
358
362
|
]),
|
|
359
363
|
_: 1
|
|
360
364
|
})
|
|
361
365
|
]),
|
|
362
366
|
_: 1
|
|
363
367
|
}, 8, ["title", "description"])
|
|
364
|
-
])) : (
|
|
368
|
+
])) : (p(), y("div", {
|
|
365
369
|
key: 3,
|
|
366
370
|
ref_key: "shellEl",
|
|
367
|
-
ref:
|
|
368
|
-
class:
|
|
371
|
+
ref: a,
|
|
372
|
+
class: F(["wx-root wx-admin", `wx-admin--${g.value}`])
|
|
369
373
|
}, [
|
|
370
|
-
|
|
371
|
-
direction: f(
|
|
374
|
+
_(ge, {
|
|
375
|
+
direction: f(d) === "drawer" ? "vertical" : "horizontal",
|
|
372
376
|
"full-height": "",
|
|
373
377
|
class: "wx-admin__frame"
|
|
374
378
|
}, {
|
|
375
|
-
default:
|
|
376
|
-
f(
|
|
379
|
+
default: w(() => [
|
|
380
|
+
f(d) === "drawer" ? (p(), b(he, {
|
|
377
381
|
key: 0,
|
|
378
382
|
class: "wx-admin__header",
|
|
379
383
|
floating: "",
|
|
@@ -382,123 +386,126 @@ const Be = /* @__PURE__ */ A({
|
|
|
382
386
|
padding: "sm",
|
|
383
387
|
height: "var(--wx-admin-header-height)"
|
|
384
388
|
}, {
|
|
385
|
-
end:
|
|
386
|
-
|
|
389
|
+
end: w(() => [
|
|
390
|
+
S(v.$slots, "user", { expanded: !1 }, void 0, !0)
|
|
387
391
|
]),
|
|
388
|
-
default:
|
|
389
|
-
|
|
392
|
+
default: w(() => [
|
|
393
|
+
_(Z, {
|
|
390
394
|
icon: "menu",
|
|
391
395
|
title: f(n)("nav.menu"),
|
|
392
|
-
onClick: f(
|
|
396
|
+
onClick: f(u)
|
|
393
397
|
}, null, 8, ["title", "onClick"]),
|
|
394
|
-
|
|
395
|
-
|
|
398
|
+
S(v.$slots, "brand", {}, () => [
|
|
399
|
+
m.value ? (p(), y("img", {
|
|
396
400
|
key: 0,
|
|
397
401
|
class: "wx-admin__logo",
|
|
398
|
-
src:
|
|
399
|
-
alt:
|
|
400
|
-
width:
|
|
401
|
-
height:
|
|
402
|
-
}, null, 8,
|
|
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, {
|
|
403
407
|
key: 1,
|
|
404
408
|
weight: "semibold",
|
|
405
409
|
truncate: ""
|
|
406
410
|
}, {
|
|
407
|
-
default:
|
|
408
|
-
|
|
411
|
+
default: w(() => [
|
|
412
|
+
L(E(l.value), 1)
|
|
409
413
|
]),
|
|
410
414
|
_: 1
|
|
411
415
|
}))
|
|
412
416
|
], !0)
|
|
413
417
|
]),
|
|
414
418
|
_: 3
|
|
415
|
-
})) :
|
|
416
|
-
f(
|
|
419
|
+
})) : z("", !0),
|
|
420
|
+
f(r) ? (p(), b(pe, {
|
|
417
421
|
key: 1,
|
|
418
422
|
class: "wx-admin__aside",
|
|
419
423
|
sticky: "",
|
|
420
424
|
floating: "",
|
|
421
425
|
scroll: "",
|
|
422
426
|
bordered: !1,
|
|
423
|
-
collapsed: f(
|
|
427
|
+
collapsed: f(o),
|
|
424
428
|
width: 220,
|
|
425
429
|
"collapsed-width": 56
|
|
426
430
|
}, {
|
|
427
|
-
top:
|
|
428
|
-
|
|
429
|
-
class:
|
|
431
|
+
top: w(() => [
|
|
432
|
+
A("div", {
|
|
433
|
+
class: F(["wx-admin__brand", { "wx-admin__brand--stacked": f(o) && h.value }])
|
|
430
434
|
}, [
|
|
431
|
-
f(
|
|
435
|
+
f(o) ? h.value ? (p(), y("img", {
|
|
432
436
|
key: 1,
|
|
433
437
|
class: "wx-admin__mark",
|
|
434
|
-
src:
|
|
435
|
-
alt:
|
|
436
|
-
}, null, 8,
|
|
437
|
-
|
|
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", {
|
|
438
442
|
key: 0,
|
|
439
443
|
class: "wx-admin__logo",
|
|
440
|
-
src:
|
|
441
|
-
alt:
|
|
442
|
-
width:
|
|
443
|
-
height:
|
|
444
|
-
}, null, 8,
|
|
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, {
|
|
445
449
|
key: 1,
|
|
446
450
|
weight: "semibold",
|
|
447
451
|
truncate: "",
|
|
448
452
|
class: "wx-admin__title"
|
|
449
453
|
}, {
|
|
450
|
-
default:
|
|
451
|
-
|
|
454
|
+
default: w(() => [
|
|
455
|
+
L(E(l.value), 1)
|
|
452
456
|
]),
|
|
453
457
|
_: 1
|
|
454
458
|
}))
|
|
455
459
|
], !0, 0),
|
|
456
|
-
|
|
460
|
+
_(Z, {
|
|
457
461
|
icon: "sidebar",
|
|
458
|
-
title: f(
|
|
459
|
-
onClick: f(
|
|
462
|
+
title: f(o) ? f(n)("nav.expand") : f(n)("nav.collapse"),
|
|
463
|
+
onClick: f(u)
|
|
460
464
|
}, null, 8, ["title", "onClick"])
|
|
461
465
|
], 2)
|
|
462
466
|
]),
|
|
463
|
-
bottom:
|
|
464
|
-
|
|
465
|
-
|
|
467
|
+
bottom: w(() => [
|
|
468
|
+
A("div", ut, [
|
|
469
|
+
S(v.$slots, "user", {
|
|
470
|
+
expanded: !f(o)
|
|
471
|
+
}, void 0, !0)
|
|
466
472
|
])
|
|
467
473
|
]),
|
|
468
|
-
default:
|
|
469
|
-
|
|
474
|
+
default: w(() => [
|
|
475
|
+
S(v.$slots, "nav", { collapsed: f(o) }, void 0, !0)
|
|
470
476
|
]),
|
|
471
477
|
_: 3
|
|
472
|
-
}, 8, ["collapsed"])) :
|
|
473
|
-
|
|
478
|
+
}, 8, ["collapsed"])) : z("", !0),
|
|
479
|
+
_(ve, {
|
|
474
480
|
padding: "none",
|
|
475
481
|
class: "wx-admin__screen"
|
|
476
482
|
}, {
|
|
477
|
-
default:
|
|
478
|
-
|
|
483
|
+
default: w(() => [
|
|
484
|
+
_(M)
|
|
479
485
|
]),
|
|
480
486
|
_: 1
|
|
481
487
|
})
|
|
482
488
|
]),
|
|
483
489
|
_: 3
|
|
484
490
|
}, 8, ["direction"]),
|
|
485
|
-
|
|
486
|
-
open: f(
|
|
487
|
-
"onUpdate:open": x[1] || (x[1] = (
|
|
488
|
-
title:
|
|
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,
|
|
489
495
|
side: "left",
|
|
490
496
|
size: 260,
|
|
497
|
+
"full-screen": !1,
|
|
491
498
|
closable: ""
|
|
492
499
|
}, {
|
|
493
|
-
footer:
|
|
494
|
-
|
|
495
|
-
|
|
500
|
+
footer: w(() => [
|
|
501
|
+
A("div", dt, [
|
|
502
|
+
S(v.$slots, "user", { expanded: !0 }, void 0, !0)
|
|
496
503
|
])
|
|
497
504
|
]),
|
|
498
|
-
default:
|
|
499
|
-
|
|
505
|
+
default: w(() => [
|
|
506
|
+
S(v.$slots, "nav", {
|
|
500
507
|
collapsed: !1,
|
|
501
|
-
select: f(
|
|
508
|
+
select: f(c)
|
|
502
509
|
}, void 0, !0)
|
|
503
510
|
]),
|
|
504
511
|
_: 3
|
|
@@ -507,10 +514,10 @@ const Be = /* @__PURE__ */ A({
|
|
|
507
514
|
], 64);
|
|
508
515
|
};
|
|
509
516
|
}
|
|
510
|
-
}),
|
|
511
|
-
class
|
|
512
|
-
constructor(t, n,
|
|
513
|
-
super(t), this.status = n, this.errors =
|
|
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";
|
|
514
521
|
}
|
|
515
522
|
status;
|
|
516
523
|
errors;
|
|
@@ -527,86 +534,86 @@ class B extends Error {
|
|
|
527
534
|
return this.status === 429;
|
|
528
535
|
}
|
|
529
536
|
}
|
|
530
|
-
const
|
|
531
|
-
function
|
|
532
|
-
const t = (e.baseUrl ?? "").replace(/\/$/, ""), n = e.csrfUrl ?? "/sanctum/csrf-cookie",
|
|
533
|
-
let
|
|
534
|
-
async function
|
|
535
|
-
|
|
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);
|
|
536
543
|
}
|
|
537
|
-
async function
|
|
538
|
-
const
|
|
539
|
-
|
|
540
|
-
const
|
|
544
|
+
async function s(u, c, l, m = {}, h = !1) {
|
|
545
|
+
const g = mt.has(u);
|
|
546
|
+
g && await r();
|
|
547
|
+
const v = {
|
|
541
548
|
Accept: "application/json",
|
|
542
549
|
"X-Requested-With": "XMLHttpRequest",
|
|
543
550
|
// Standing headers first, so a caller can still override one for a single request.
|
|
544
|
-
...
|
|
545
|
-
...
|
|
551
|
+
...d?.(),
|
|
552
|
+
...m.headers
|
|
546
553
|
};
|
|
547
|
-
if (
|
|
548
|
-
const
|
|
549
|
-
|
|
554
|
+
if (g) {
|
|
555
|
+
const M = le("XSRF-TOKEN");
|
|
556
|
+
M !== null && (v["X-XSRF-TOKEN"] = M);
|
|
550
557
|
}
|
|
551
|
-
|
|
552
|
-
const x = await
|
|
553
|
-
method:
|
|
558
|
+
l !== void 0 && (v["Content-Type"] = "application/json");
|
|
559
|
+
const x = await a(vt(t, c, m.query), {
|
|
560
|
+
method: u,
|
|
554
561
|
credentials: "same-origin",
|
|
555
|
-
headers:
|
|
556
|
-
signal:
|
|
557
|
-
body:
|
|
562
|
+
headers: v,
|
|
563
|
+
signal: m.signal,
|
|
564
|
+
body: l === void 0 ? void 0 : JSON.stringify(l)
|
|
558
565
|
});
|
|
559
|
-
if (x.status === 419 &&
|
|
560
|
-
return await
|
|
561
|
-
if (x.status === 401 &&
|
|
562
|
-
throw 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);
|
|
563
570
|
if (x.status !== 204)
|
|
564
571
|
return await x.json();
|
|
565
572
|
}
|
|
566
573
|
return {
|
|
567
|
-
get: (
|
|
568
|
-
post: (
|
|
569
|
-
put: (
|
|
570
|
-
patch: (
|
|
571
|
-
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)
|
|
572
579
|
};
|
|
573
580
|
}
|
|
574
|
-
async function
|
|
581
|
+
async function pt(e) {
|
|
575
582
|
let t = null;
|
|
576
583
|
try {
|
|
577
584
|
t = await e.json();
|
|
578
585
|
} catch {
|
|
579
586
|
}
|
|
580
|
-
const n = t ?? {},
|
|
581
|
-
return new
|
|
582
|
-
|
|
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,
|
|
583
590
|
e.status,
|
|
584
|
-
|
|
585
|
-
Number.isFinite(
|
|
591
|
+
i,
|
|
592
|
+
Number.isFinite(o) ? o : null,
|
|
586
593
|
t
|
|
587
594
|
);
|
|
588
595
|
}
|
|
589
|
-
function
|
|
590
|
-
const
|
|
596
|
+
function vt(e, t, n) {
|
|
597
|
+
const i = /^https?:\/\//i.test(t) ? t : `${e}/${t.replace(/^\//, "")}`;
|
|
591
598
|
if (n === void 0)
|
|
592
|
-
return
|
|
593
|
-
const
|
|
594
|
-
for (const [
|
|
595
|
-
|
|
596
|
-
const
|
|
597
|
-
return
|
|
598
|
-
}
|
|
599
|
-
function
|
|
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}`;
|
|
605
|
+
}
|
|
606
|
+
function le(e) {
|
|
600
607
|
if (typeof document > "u")
|
|
601
608
|
return null;
|
|
602
609
|
for (const t of document.cookie.split(";")) {
|
|
603
|
-
const [n, ...
|
|
610
|
+
const [n, ...a] = t.trim().split("=");
|
|
604
611
|
if (n === e)
|
|
605
|
-
return decodeURIComponent(
|
|
612
|
+
return decodeURIComponent(a.join("="));
|
|
606
613
|
}
|
|
607
614
|
return null;
|
|
608
615
|
}
|
|
609
|
-
const
|
|
616
|
+
const ue = {
|
|
610
617
|
shell: {
|
|
611
618
|
loading: "Loading the panel…",
|
|
612
619
|
"error-title": "The panel could not start",
|
|
@@ -623,6 +630,18 @@ const ne = {
|
|
|
623
630
|
// The one menu group the panel names itself; a module's own group is named by the module.
|
|
624
631
|
system: "System"
|
|
625
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
|
+
},
|
|
626
645
|
// When something happened, said the way a person would. The month names and the order of
|
|
627
646
|
// the parts come from `Intl` — only the words that no formatter knows are here.
|
|
628
647
|
dates: {
|
|
@@ -645,123 +664,188 @@ const ne = {
|
|
|
645
664
|
offline: "The server did not answer. Check the connection and try again.",
|
|
646
665
|
unknown: "That did not work."
|
|
647
666
|
}
|
|
648
|
-
},
|
|
649
|
-
function
|
|
650
|
-
const t = e.manifestUrl ??
|
|
651
|
-
for (const
|
|
652
|
-
|
|
653
|
-
const
|
|
654
|
-
history:
|
|
655
|
-
routes:
|
|
656
|
-
}),
|
|
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({
|
|
657
676
|
baseUrl: "",
|
|
658
677
|
onUnauthenticated: () => {
|
|
659
|
-
|
|
678
|
+
c.setUser(null), c.state.status = "unauthenticated";
|
|
660
679
|
},
|
|
661
680
|
// Every request says which language the panel is currently showing. It decides what
|
|
662
681
|
// the server writes its own messages in — a 422 under a field — for anybody who has
|
|
663
682
|
// not stored a preference yet, which is everybody until they choose one. Without it,
|
|
664
683
|
// signing in on a Russian sign-in screen lands in an English panel.
|
|
665
|
-
headers: () => ({ "X-Webx-Locale":
|
|
684
|
+
headers: () => ({ "X-Webx-Locale": r.state.locale })
|
|
666
685
|
});
|
|
667
|
-
|
|
668
|
-
async function
|
|
669
|
-
const x = await
|
|
670
|
-
|
|
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);
|
|
671
690
|
}
|
|
672
|
-
const
|
|
673
|
-
http:
|
|
674
|
-
basePath:
|
|
691
|
+
const c = Je({
|
|
692
|
+
http: s,
|
|
693
|
+
basePath: a,
|
|
675
694
|
apiPath: n,
|
|
676
|
-
modules:
|
|
677
|
-
i18n:
|
|
678
|
-
loadDictionary:
|
|
695
|
+
modules: i,
|
|
696
|
+
i18n: r,
|
|
697
|
+
loadDictionary: u,
|
|
679
698
|
types: e.types,
|
|
680
699
|
screens: e.screens,
|
|
681
|
-
loadManifest: async () => (await
|
|
682
|
-
}),
|
|
683
|
-
|
|
684
|
-
const
|
|
685
|
-
|
|
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, {
|
|
686
705
|
list: k(
|
|
687
|
-
() =>
|
|
688
|
-
code:
|
|
689
|
-
label:
|
|
706
|
+
() => r.state.contentLocales.map((v) => ({
|
|
707
|
+
code: v.code,
|
|
708
|
+
label: v.code.toUpperCase()
|
|
690
709
|
}))
|
|
691
710
|
),
|
|
692
711
|
active: k({
|
|
693
|
-
get: () =>
|
|
694
|
-
set: (
|
|
695
|
-
|
|
712
|
+
get: () => m.value || (r.state.contentLocales[0]?.code ?? ""),
|
|
713
|
+
set: (v) => {
|
|
714
|
+
m.value = v;
|
|
696
715
|
}
|
|
697
716
|
})
|
|
698
717
|
});
|
|
699
|
-
const
|
|
700
|
-
app:
|
|
701
|
-
router:
|
|
702
|
-
context:
|
|
703
|
-
i18n:
|
|
718
|
+
const h = {
|
|
719
|
+
app: l,
|
|
720
|
+
router: o,
|
|
721
|
+
context: c,
|
|
722
|
+
i18n: r,
|
|
704
723
|
async mount() {
|
|
705
|
-
await Promise.all([
|
|
706
|
-
}),
|
|
724
|
+
await Promise.all([g(), u(r.state.locale)]).catch(() => {
|
|
725
|
+
}), l.mount(e.el ?? "#webx-app"), await c.reload();
|
|
707
726
|
}
|
|
708
727
|
};
|
|
709
|
-
async function
|
|
710
|
-
const
|
|
711
|
-
|
|
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;
|
|
712
731
|
}
|
|
713
|
-
for (const
|
|
714
|
-
|
|
715
|
-
return
|
|
732
|
+
for (const v of e.plugins ?? [])
|
|
733
|
+
v.install(h);
|
|
734
|
+
return l.use(o), h;
|
|
716
735
|
}
|
|
717
|
-
function
|
|
736
|
+
function gt(e) {
|
|
718
737
|
const t = {
|
|
719
738
|
// The menu is the panel's own: it is the manifest, drawn.
|
|
720
739
|
// The shell hands in what a choice means where it drew the menu — in the drawer it is what
|
|
721
740
|
// closes it, and a drawer that stays open over the section it just opened is a drawer the
|
|
722
741
|
// reader has to dismiss by hand.
|
|
723
|
-
nav: (n) => P(
|
|
742
|
+
nav: (n) => P(nt, { collapsed: n.collapsed === !0, onSelect: n.select })
|
|
724
743
|
};
|
|
725
|
-
return e.brand !== void 0 && (t.brand = () => P(e.brand)), e.userMenu !== void 0 && (t.user = () => P(e.userMenu)), { render: () => P(
|
|
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) };
|
|
726
745
|
}
|
|
727
|
-
function
|
|
728
|
-
const e =
|
|
746
|
+
function wt() {
|
|
747
|
+
const e = bt(de);
|
|
729
748
|
return e !== null ? e : typeof document < "u" && document.documentElement.lang !== "" ? document.documentElement.lang : typeof navigator > "u" ? "en" : navigator.language;
|
|
730
749
|
}
|
|
731
|
-
function
|
|
750
|
+
function yt(e) {
|
|
732
751
|
try {
|
|
733
|
-
localStorage.setItem(
|
|
752
|
+
localStorage.setItem(de, e);
|
|
734
753
|
} catch {
|
|
735
754
|
}
|
|
736
755
|
}
|
|
737
|
-
function
|
|
756
|
+
function bt(e) {
|
|
738
757
|
try {
|
|
739
758
|
return localStorage.getItem(e);
|
|
740
759
|
} catch {
|
|
741
760
|
return null;
|
|
742
761
|
}
|
|
743
762
|
}
|
|
744
|
-
function
|
|
763
|
+
function xt(e, t) {
|
|
745
764
|
typeof document > "u" || (document.documentElement.lang = e, document.documentElement.dir = t.find((n) => n.code === e)?.direction ?? "ltr");
|
|
746
765
|
}
|
|
747
|
-
function
|
|
766
|
+
function _t() {
|
|
748
767
|
return typeof document > "u" ? null : document.querySelector('meta[name="webx-manifest"]')?.getAttribute("content") ?? null;
|
|
749
768
|
}
|
|
750
|
-
function
|
|
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) {
|
|
751
835
|
const t = e.scope("webx-admin"), n = /* @__PURE__ */ new Map();
|
|
752
|
-
function
|
|
753
|
-
const
|
|
754
|
-
let
|
|
755
|
-
return
|
|
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);
|
|
756
840
|
}
|
|
757
|
-
const
|
|
841
|
+
const i = (d) => a("time", { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }, d);
|
|
758
842
|
return {
|
|
759
|
-
short(
|
|
760
|
-
const
|
|
761
|
-
if (
|
|
843
|
+
short(d) {
|
|
844
|
+
const o = O(d);
|
|
845
|
+
if (o === null)
|
|
762
846
|
return t("dates.never");
|
|
763
|
-
const
|
|
764
|
-
return
|
|
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(
|
|
765
849
|
"this-year",
|
|
766
850
|
{
|
|
767
851
|
day: "numeric",
|
|
@@ -770,66 +854,66 @@ function dt(e) {
|
|
|
770
854
|
minute: "2-digit",
|
|
771
855
|
hourCycle: "h23"
|
|
772
856
|
},
|
|
773
|
-
|
|
774
|
-
) :
|
|
857
|
+
o
|
|
858
|
+
) : a("earlier", { day: "numeric", month: "long", year: "numeric" }, o);
|
|
775
859
|
},
|
|
776
|
-
exact(
|
|
777
|
-
const
|
|
778
|
-
return
|
|
860
|
+
exact(d) {
|
|
861
|
+
const o = O(d);
|
|
862
|
+
return o === null ? "" : a("exact", { dateStyle: "long", timeStyle: "medium", hourCycle: "h23" }, o);
|
|
779
863
|
},
|
|
780
|
-
iso(
|
|
781
|
-
const
|
|
782
|
-
return
|
|
864
|
+
iso(d) {
|
|
865
|
+
const o = O(d);
|
|
866
|
+
return o === null ? "" : o.toISOString();
|
|
783
867
|
}
|
|
784
868
|
};
|
|
785
869
|
}
|
|
786
|
-
function
|
|
787
|
-
const e =
|
|
788
|
-
return
|
|
870
|
+
function St() {
|
|
871
|
+
const e = V(j, null);
|
|
872
|
+
return $t(e ?? Tt());
|
|
789
873
|
}
|
|
790
|
-
let
|
|
791
|
-
function
|
|
792
|
-
return
|
|
874
|
+
let D = null;
|
|
875
|
+
function Tt() {
|
|
876
|
+
return D === null && (D = Q(), D.defaults("webx-admin", ue)), D;
|
|
793
877
|
}
|
|
794
|
-
function
|
|
878
|
+
function O(e) {
|
|
795
879
|
if (e == null || e === "")
|
|
796
880
|
return null;
|
|
797
881
|
const t = e instanceof Date ? e : new Date(e);
|
|
798
882
|
return Number.isNaN(t.getTime()) ? null : t;
|
|
799
883
|
}
|
|
800
|
-
function
|
|
801
|
-
const n = (
|
|
884
|
+
function Lt(e, t) {
|
|
885
|
+
const n = (a) => Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());
|
|
802
886
|
return Math.round((n(e) - n(t)) / 864e5);
|
|
803
887
|
}
|
|
804
|
-
function
|
|
805
|
-
const
|
|
806
|
-
if (
|
|
807
|
-
return
|
|
808
|
-
if (
|
|
809
|
-
if (
|
|
810
|
-
if (
|
|
811
|
-
if (
|
|
812
|
-
if (
|
|
813
|
-
const
|
|
814
|
-
return
|
|
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 });
|
|
815
899
|
}
|
|
816
|
-
return
|
|
900
|
+
return a !== null && a >= 500 ? t("errors.server") : a === null ? t("errors.offline") : n ?? t("errors.unknown");
|
|
817
901
|
}
|
|
818
|
-
function
|
|
819
|
-
const e =
|
|
820
|
-
return (t, n) =>
|
|
902
|
+
function Ht() {
|
|
903
|
+
const e = U("webx-admin");
|
|
904
|
+
return (t, n) => Et(t, e, n);
|
|
821
905
|
}
|
|
822
|
-
function
|
|
906
|
+
function zt(e) {
|
|
823
907
|
const t = e?.status;
|
|
824
908
|
return typeof t == "number" ? t : null;
|
|
825
909
|
}
|
|
826
|
-
function
|
|
910
|
+
function Ct(e) {
|
|
827
911
|
const n = e?.body?.message;
|
|
828
912
|
return typeof n == "string" && n !== "" ? n : null;
|
|
829
913
|
}
|
|
830
|
-
const
|
|
914
|
+
const Wt = { class: "wx-screen-host" }, Ot = /* @__PURE__ */ T({
|
|
831
915
|
__name: "Screen",
|
|
832
|
-
props: /* @__PURE__ */
|
|
916
|
+
props: /* @__PURE__ */ K({
|
|
833
917
|
name: {},
|
|
834
918
|
errors: { default: void 0 },
|
|
835
919
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -840,39 +924,39 @@ const yt = { class: "wx-screen-host" }, Ct = /* @__PURE__ */ A({
|
|
|
840
924
|
modelValue: { default: () => ({}) },
|
|
841
925
|
modelModifiers: {}
|
|
842
926
|
}),
|
|
843
|
-
emits: /* @__PURE__ */
|
|
927
|
+
emits: /* @__PURE__ */ K(["loaded"], ["update:modelValue"]),
|
|
844
928
|
setup(e, { expose: t, emit: n }) {
|
|
845
|
-
const
|
|
846
|
-
async function
|
|
847
|
-
|
|
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;
|
|
848
932
|
try {
|
|
849
|
-
const
|
|
850
|
-
|
|
851
|
-
} catch (
|
|
852
|
-
|
|
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);
|
|
853
937
|
}
|
|
854
938
|
}
|
|
855
|
-
return
|
|
856
|
-
|
|
857
|
-
}, { immediate: !0 }), t({ reload:
|
|
858
|
-
|
|
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), {
|
|
859
943
|
key: 0,
|
|
860
944
|
type: "danger",
|
|
861
|
-
title: f(
|
|
862
|
-
description:
|
|
863
|
-
}, 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), {
|
|
864
948
|
key: 1,
|
|
865
949
|
rows: 4
|
|
866
|
-
})) : (
|
|
950
|
+
})) : (p(), b(f(Oe), {
|
|
867
951
|
key: 2,
|
|
868
|
-
modelValue:
|
|
869
|
-
"onUpdate:modelValue":
|
|
870
|
-
root:
|
|
871
|
-
patch: f(
|
|
872
|
-
types: f(
|
|
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,
|
|
873
957
|
errors: e.errors,
|
|
874
|
-
translate: f(
|
|
875
|
-
can: f(
|
|
958
|
+
translate: f(o).i18n.t,
|
|
959
|
+
can: f(o).can,
|
|
876
960
|
disabled: e.disabled,
|
|
877
961
|
"label-position": e.labelPosition,
|
|
878
962
|
"label-width": e.labelWidth,
|
|
@@ -880,10 +964,10 @@ const yt = { class: "wx-screen-host" }, Ct = /* @__PURE__ */ A({
|
|
|
880
964
|
}, null, 8, ["modelValue", "root", "patch", "types", "errors", "translate", "can", "disabled", "label-position", "label-width", "size"]))
|
|
881
965
|
]));
|
|
882
966
|
}
|
|
883
|
-
}),
|
|
967
|
+
}), Ut = {
|
|
884
968
|
key: 0,
|
|
885
969
|
class: "wx-dropdown__divider"
|
|
886
|
-
},
|
|
970
|
+
}, Ft = /* @__PURE__ */ T({
|
|
887
971
|
__name: "RowMenu",
|
|
888
972
|
props: {
|
|
889
973
|
actions: {},
|
|
@@ -892,45 +976,171 @@ const yt = { class: "wx-screen-host" }, Ct = /* @__PURE__ */ A({
|
|
|
892
976
|
},
|
|
893
977
|
setup(e) {
|
|
894
978
|
const t = e, n = k(() => [
|
|
895
|
-
...t.actions.filter((
|
|
896
|
-
...t.actions.filter((
|
|
897
|
-
]),
|
|
898
|
-
const
|
|
899
|
-
return
|
|
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;
|
|
900
984
|
});
|
|
901
|
-
return (
|
|
985
|
+
return (i, d) => n.value.length > 0 ? (p(), b(f(Be), {
|
|
902
986
|
key: 0,
|
|
903
987
|
collapse: "always",
|
|
904
988
|
align: "end",
|
|
905
989
|
size: e.size,
|
|
906
990
|
"aria-label": e.label,
|
|
907
|
-
onClick:
|
|
991
|
+
onClick: d[0] || (d[0] = ie(() => {
|
|
908
992
|
}, ["stop"]))
|
|
909
993
|
}, {
|
|
910
|
-
collapsed:
|
|
911
|
-
(
|
|
912
|
-
key:
|
|
994
|
+
collapsed: w(() => [
|
|
995
|
+
(p(!0), y(C, null, I(n.value, (o) => (p(), y(C, {
|
|
996
|
+
key: o.key
|
|
913
997
|
}, [
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
icon:
|
|
917
|
-
tone:
|
|
918
|
-
href:
|
|
919
|
-
target:
|
|
920
|
-
disabled:
|
|
921
|
-
onClick: (
|
|
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?.()
|
|
922
1006
|
}, {
|
|
923
|
-
default:
|
|
924
|
-
|
|
1007
|
+
default: w(() => [
|
|
1008
|
+
L(E(o.label), 1)
|
|
925
1009
|
]),
|
|
926
1010
|
_: 2
|
|
927
1011
|
}, 1032, ["icon", "tone", "href", "target", "disabled", "onClick"])
|
|
928
1012
|
], 64))), 128))
|
|
929
1013
|
]),
|
|
930
1014
|
_: 1
|
|
931
|
-
}, 8, ["size", "aria-label"])) :
|
|
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));
|
|
932
1142
|
}
|
|
933
|
-
}),
|
|
1143
|
+
}), Xt = /* @__PURE__ */ N(Rt, [["__scopeId", "data-v-6c280d42"]]), Yt = /* @__PURE__ */ T({
|
|
934
1144
|
name: "WxDate",
|
|
935
1145
|
__name: "DateText",
|
|
936
1146
|
props: {
|
|
@@ -939,62 +1149,66 @@ const yt = { class: "wx-screen-host" }, Ct = /* @__PURE__ */ A({
|
|
|
939
1149
|
tone: { default: "muted" }
|
|
940
1150
|
},
|
|
941
1151
|
setup(e) {
|
|
942
|
-
const t = e, n =
|
|
943
|
-
return (
|
|
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), {
|
|
944
1154
|
key: 0,
|
|
945
|
-
content:
|
|
1155
|
+
content: i.value
|
|
946
1156
|
}, {
|
|
947
|
-
default:
|
|
948
|
-
|
|
1157
|
+
default: w(() => [
|
|
1158
|
+
_(f(ae), {
|
|
949
1159
|
as: "time",
|
|
950
|
-
datetime:
|
|
1160
|
+
datetime: d.value,
|
|
951
1161
|
size: e.size,
|
|
952
1162
|
tone: e.tone
|
|
953
1163
|
}, {
|
|
954
|
-
default:
|
|
955
|
-
|
|
1164
|
+
default: w(() => [
|
|
1165
|
+
L(E(a.value), 1)
|
|
956
1166
|
]),
|
|
957
1167
|
_: 1
|
|
958
1168
|
}, 8, ["datetime", "size", "tone"])
|
|
959
1169
|
]),
|
|
960
1170
|
_: 1
|
|
961
|
-
}, 8, ["content"])) : (
|
|
1171
|
+
}, 8, ["content"])) : (p(), b(f(ae), {
|
|
962
1172
|
key: 1,
|
|
963
1173
|
size: e.size,
|
|
964
1174
|
tone: e.tone
|
|
965
1175
|
}, {
|
|
966
|
-
default:
|
|
967
|
-
|
|
1176
|
+
default: w(() => [
|
|
1177
|
+
L(E(a.value), 1)
|
|
968
1178
|
]),
|
|
969
1179
|
_: 1
|
|
970
1180
|
}, 8, ["size", "tone"]));
|
|
971
1181
|
}
|
|
972
1182
|
});
|
|
973
1183
|
export {
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
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
|
|
999
1213
|
};
|
|
1000
1214
|
//# sourceMappingURL=index.js.map
|