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